diff --git a/translated/talk/20140724 What are useful online tools for Linux.md b/published/20140724 What are useful online tools for Linux.md similarity index 62% rename from translated/talk/20140724 What are useful online tools for Linux.md rename to published/20140724 What are useful online tools for Linux.md index b01b5b189a..cfeadfc3b8 100644 --- a/translated/talk/20140724 What are useful online tools for Linux.md +++ b/published/20140724 What are useful online tools for Linux.md @@ -1,6 +1,7 @@ -适用于Linux的在线工具 +16个 Linux 方面的在线工具类网站 ================================================================================ -众所周知,GNU Linux不仅仅只是一款操作系统。看起来通过互联网全球许多人都在致力于这款企鹅图标(即Linux)的操作系统。如果你读到这篇文章,你可能倾向于读到关于Linux联机的内容。在可以找到的所有关于这个主题的网页中,有一些网站是每个Linux爱好者都应该收藏起来的。这些网站不仅仅只是教程或回顾,更是可以随时随地访问并与他人共享的实用工具。所以,今天我会建议一份包含16个应该收藏的网址清单。它们中的一些对Windows或Mac用户同样有用:这是在他们的能力范围内可以做到的。(译者注:Windows和Mac一样可以很好地体验Linux) +众所周知,GNU Linux不仅仅只是一款操作系统。看起来通过互联网全球许多人都在致力于这款以企鹅为吉祥物的操作系统。如果你读到这篇文章,你可能希望读一些关于Linux在线资源的内容。在可以找到的所有关于这个主题的网页中,有一些网站是每个Linux爱好者都应该收藏起来的。这些网站不仅仅只是教程或回顾,更是可以随时随地访问并与他人共享的实用工具。所以,今天我会建议一份包含16个应该收藏的网址清单。它们中的一些对Windows或Mac用户同样有用:这是在他们的能力范围内可以做到的。(译者注:Windows和Mac一样可以很好地体验Linux) + ### 1. [ExplainShell.com][1] ### [![](https://farm4.staticflickr.com/3841/14517716647_3b6a1a564d_z.jpg)][2] @@ -11,43 +12,43 @@ [![](https://farm4.staticflickr.com/3900/14703872782_033e5acdb8_z.jpg)][4] -如果你想开始学习Linux命令行,或者想快速地得到一个自定义的shell命令提示符,但不知道从何下手,这个网站会为你生成PS1提示代码,在家目录下放置.bashrc文件。你可以拖拽任何你想在提示符里看到的元素,譬如用户名和当前时间,这个网站都会为你编写易懂可读的代码。绝对是懒人必备! +如果你想开始学习Linux命令行,或者想快速地生成一个自定义的shell命令提示符,但不知道从何下手,这个网站可以为你生成PS1提示的代码,将代码放到家目录下的.bashrc文件中即可。你可以拖拽任何你想在提示符里看到的元素,譬如用户名和当前时间,这个网站都会为你编写易懂可读的代码。绝对是懒人必备! ### 3. [Vim-adventures.com][5] ### [![](https://farm4.staticflickr.com/3838/14681149696_0c533fd6de_z.jpg)][6] -我是最近才发现这个网站的,但我的生活已经深陷其中。简而言之:它就是一个使用Vim命令的RPG游戏。在等距的水平上使用‘h,j,k,l’四个键移动字母,获取新的命令/能力,收集关键词,非常快速地学习高效地使用Vim。 +我是最近才发现这个网站的,但我的生活已经深陷其中。简而言之:它就是一个使用Vim命令的RPG游戏。在地图的平面上使用‘h,j,k,l’四个键移动你的角色、得到新的命令/能力、收集钥匙,可以帮助你非常快速地学习如何高效使用Vim。 ### 4. [Try Github][7] ### [![](https://farm4.staticflickr.com/3874/14517499739_0452848d68_z.jpg)][8] -目标很简单:15分钟学会Git。这个网站模拟一个控制台,带你遍历这种协作编辑的每一步。界面非常时尚,目的十分有用。唯一不足的是对Git敏感,但Git绝对是一项不错的技能,这里也是学习Git的绝佳之处。 +目标很简单:15分钟学会Git。这个网站模拟一个控制台,带你遍历这种协作编辑的每一步。界面非常时尚,目的十分有用。唯一不足的是对Git感兴趣,但Git绝对是一项不错的技能,这里也是学习Git的绝佳之处。 ### 5. [Shortcutfoo.com][9] ### [![](https://farm4.staticflickr.com/3906/14517499799_f142ea37cb_z.jpg)][10] -又一个包含众多快捷键数据库的网站,shortcutfoo以更标准的方式将其内容呈现给用户,但绝对比有趣的迷你游戏更直截了当。这里有许多软件的快捷键,并按类别分组。虽然它不像Vim一类完全依赖快捷键的软件那么全面,但也足以提供快速的提示或一般性的概述。 +又一个包含众多快捷键数据库的网站,shortcutfoo以更标准的方式将其内容呈现给用户,但绝对比有趣的迷你游戏更直截了当。这里有许多软件的快捷键,并按类别分组。虽然像Vim一类的软件它没有给出超级完整的快捷键列表,但也足以提供快速的提示或一般性的概述。 ### 6. [GitHub Free Programming Books][11] ### [![](https://farm4.staticflickr.com/3867/14517499989_408a28d8be_z.jpg)][12] -正如你从URL上猜到的一样,这个网站就是免费在线编程书籍的集合,使用Git协作方式编写。上面的内容非常好,作者们应该为做出这些工作受到表扬。它可能不是最容易阅读的,但一定是最有启发性的之一。我们只希望这项运动能持续进行。 +正如你从URL上猜到的一样,这个网站就是免费在线编程书籍的集合,使用Git协作方式编写。上面的内容非常好,作者们应该为他们做出的这些贡献受到表扬。它可能不是最容易阅读的,但一定是最有启发性的之一。我们只希望这项运动能持续进行。 ### 7. [Collabedit.com][13] ### [![](https://farm3.staticflickr.com/2940/14681150086_2d169d67f9_z.jpg)][14] -如果你曾经准备过电话面试,你应该先试试collabedit。它让你创建文件,选择你想使用的编程语言,然后通过URL共享文档。打开链接的人可以免费地实时使用文本交互,使你可以评判他们的编程水平或只是交换一些程序片段。这里甚至还提供合适的语法高亮和聊天功能。换句话说,这就是程序员的即时Google文档。 +如果你曾经计划过电话面试,你应该先试试collabedit。它让你创建文件,选择你想使用的编程语言,然后通过URL共享文档。打开链接的人可以免费地实时使用文本交互,使你可以评判他们的编程水平或只是交换一些程序片段。这里甚至还提供合适的语法高亮和聊天功能。换句话说,这就是程序员的即时Google Doucment。 ### 8. [Cpp.sh][15] ### [![](https://farm4.staticflickr.com/3840/14700981001_af3ac40b65_z.jpg)][16] -尽管这个网站超出了Linux范围,但因为它非常有用,所以值得将它放在这里。简单地说,这是一个C++在线开发环境。只需在导航栏里编写程序,然后运行它。作为奖励,你可以使用自动补全、Ctrl+Z,以及和你的小伙伴共享URL。这些有趣的事情,你只需要通过一个简单的浏览器就能做到。 +尽管这个网站超出了Linux范围,但因为它非常有用,所以值得将它放在这里。简单地说,这是一个C++在线开发环境。只需在浏览器里编写程序,然后运行它。作为奖励,你可以使用自动补全、Ctrl+Z,以及和你的小伙伴分享你的作品的URL。这些有趣的事情,你只需要通过一个简单的浏览器就能做到。 ### 9. [Copy.sh][17] ### @@ -59,13 +60,13 @@ [![](https://farm4.staticflickr.com/3887/14517495938_ca3b831ca9_z.jpg)][21] -我们总是在自己的电脑上保存着一大段类似于“gems”的命令行【翻译得不准确,麻烦校正】,commandlinefu的目标是把这些片段释放给全世界。作为一个协作式数据库,它就像是命令行里的维基百科。每个人可以免费注册,把自己最钟爱的命令提交到这个网站上给其他人看。你将能够获取来自四面八方的知识并与人分享。如果你对精通shell饶有兴趣,commandlinefu也可以提供一些优秀的特性,比如随机命令和每天学习新知识的新闻订阅。 +我们总是在自己的电脑上保存着一大段命令行“宝石”,commandlinefu的目标是把这些片段释放给全世界。作为一个协作式数据库,它就像是命令行里的维基百科。每个人可以免费注册,把自己最钟爱的命令提交到这个网站上给其他人看。你将能够获取来自四面八方的知识并与人分享。如果你对精通shell饶有兴趣,commandlinefu也可以提供一些优秀的特性,比如随机命令和每天学习新知识的新闻订阅。 ### 11. [Alias.sh][22] ### [![](https://farm4.staticflickr.com/3868/14701762124_a7b3547aca_z.jpg)][23] -另一协作式数据库,alias.sh(我爱死这个URL了)有点像commandlinefu,但是为shell别名开发的。你可以共享和发现一些有用的别名,来使你的CLI(命令行界面)体验更加舒服。我个人喜欢这个获取图片维度的别名。 +另一协作式数据库,alias.sh(我爱死这个URL了)有点像commandlinefu,但是为shell别名开发的。你可以共享和发现一些有用的别名,来使你的CLI(命令行界面)体验更加舒服。我个人喜欢这个获取图片维度的别名命令。 function dim(){ sips $1 -g pixelWidth -g pixelHeight } @@ -75,40 +76,41 @@ [![](https://farm3.staticflickr.com/2910/14681149996_50a45bff78_z.jpg)][25] -有谁不知道Distrowatch?除了基于这个网站流行度给出一个精确的Linux发行版排名,Distrowatch也是一个非常有用的数据库。无论你正苦苦寻找一个新的发行版,还是只是出于好奇,它都能为你能找到的每个Linux版本呈现一个详尽的描述,包含默认的桌面环境,包管理系统,默认应用程序等信息,还有所有的版本号,以及可用的下载链接。总而言之,这就是个Linux宝库。 +有谁不知道Distrowatch?除了基于这个网站流行度给出一个精确的Linux发行版排名,Distrowatch也是一个非常有用的数据库。无论你正苦苦寻找一个新的发行版,还是只是出于好奇,它都能为你能找到的每个Linux版本呈现一个详尽的描述,包含默认的桌面环境、包管理系统、默认应用程序等信息,还有所有的版本号,以及可用的下载链接。总而言之,这就是个Linux宝库。 ### 13. [Linuxmanpages.com][26] ### [![](https://farm4.staticflickr.com/3911/14704165765_8e30cb3d3f_z.jpg)][27] -一切都在URL中:随时随地获取主流命令的手册页面。尽管不确信对于Linux用户是否真的有用,因为他们可以从真实的终端中获取这些信息,但这里的内容还是值得关注的。 +一切尽在URL中说明了:随时随地获取主流命令的手册页面。尽管不确信对于Linux用户是否真的有用,因为他们可以从真实的终端中获取这些信息,但这里的内容还是值得关注的。 ### 14. [AwesomeCow.com][28] ### [![](https://farm6.staticflickr.com/5558/14704165965_02b10ee293_z.jpg)][29] -这里可能少一些核心的Linux内容,但肯定是有一些用的。Awesomecow是一个搜索引擎,来寻找Windows软件在Linux上的替代品。它对那些迁移到企鹅操作系统(Linux)或习惯Windows软件的人很有帮助。我认为这个网站代表一种能力,表明了在谈到软件质量时Linux也可以适用于专业领域。大家至少可以尝试一下。 +这可能对于骨灰级 Linux 没啥用,但是对于其他人也许有用。Awesomecow是一个搜索引擎,来寻找Windows软件在Linux上对应的替代品。它对那些迁移到企鹅操作系统(Linux)或习惯Windows软件的人很有帮助。我认为这个网站代表一种能力,表明了在谈到软件质量时Linux也可以适用于专业领域。大家至少可以尝试一下。 ### 15. [PenguSpy.com][30] ### [![](https://farm4.staticflickr.com/3904/14517495728_f6877e8e3b_z.jpg)][31] -Steam在Linux上崭露头角之前,游戏性可能是Linux的软肋。但这个名为“pengsupy”的网站不遗余力地弥补这个软肋,通过使用漂亮的接口在数据库中收集所有兼容Linux的游戏。游戏按照类别、发行日期、评分等指标分类。我真心希望这一类的网站不会因为Steam的存在走向衰亡,毕竟这是我在这个列表里最喜爱的网站之一。 +Steam在Linux上崭露头角之前,可玩性可能是Linux的软肋。但这个名为“pengsupy”的网站不遗余力地弥补这个软肋,通过使用漂亮的界面展现了数据库中收集的所有兼容Linux的游戏。游戏按照类别、发行日期、评分等指标分类。我真心希望这一类的网站不会因为Steam的存在走向衰亡,毕竟这是我在这个列表里最喜爱的网站之一。 ### 16. [Linux Cross Reference by Free Electrons][32] ### [![](https://farm4.staticflickr.com/3913/14712049464_6b666e2cfa_z.jpg)][33] -最后,对所有的专家和好奇的用户,lxr是源自Linux Cross Reference的回文构词法,使我们能交互地在线查看Linux内核代码。通过标识符可以很方便地使用导航栏,你可以使用标准的diff标记对比文件的不同版本。这个网站的界面看起来严肃直接,毕竟这只是一个希望完美阐述开源观点的网站。 +最后,对所有的专家和好奇的用户,lxr 是源于 Linux Cross Reference 的另外一种形式,使我们能交互地在线查看Linux内核代码。可以通过各种标识符在代码中很方便地导航,你可以使用标准的diff标记对比文件的不同版本。这个网站的界面看起来严肃直接,毕竟这只是一个希望完美阐述开源观点的网站。 总而言之,应该列出更多这一类的网站,作为这篇文章第二部分的主题。但这篇文章是一个好的开始,是一道为Linux用户寻找在线工具的开胃菜。如果你有其它任何想要分享的页面,而且是紧跟这个主题的,在评论里写出来。这将有助于续写这个列表。 + -------------------------------------------------------------------------------- via: http://xmodulo.com/2014/07/useful-online-tools-linux.html 原文作者:[Adrien Brochard][a](我是一名来自法国的Linux狂热爱好者。在尝试过众多的发行版后,我最终选择了Archlinux。但我一直会通过叠加技巧和窍门来优化我的系统。) -译者:[KayGuoWhu](https://github.com/KayGuoWhu) 校对:[校对者ID](https://github.com/校对者ID) +译者:[KayGuoWhu](https://github.com/KayGuoWhu) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 diff --git a/translated/tech/20140729 How to use awk command in Linux.md b/published/20140729 How to use awk command in Linux.md similarity index 79% rename from translated/tech/20140729 How to use awk command in Linux.md rename to published/20140729 How to use awk command in Linux.md index 6208316dc9..c4fded9e5c 100644 --- a/translated/tech/20140729 How to use awk command in Linux.md +++ b/published/20140729 How to use awk command in Linux.md @@ -1,8 +1,8 @@ 如何在Linux中使用awk命令 ================================================================================ -文本处理是Unix的核心。从管道到/proc子系统,“一切都是文件”的理念贯穿于操作系统和所有基于它构造的工具。正因为如此,轻松地处理文本是一个期望成为Linux系统管理员甚至是资深用户的最重要的技能之一,awk是通用编程语言之外最强大的文本处理工具之一。 +文本处理是Unix的核心。从管道到/proc子系统,“一切都是文件”的理念贯穿于操作系统和所有基于它构造的工具。正因为如此,轻松地处理文本是一个期望成为Linux系统管理员甚至是资深用户的最重要的技能之一,而 awk是通用编程语言之外最强大的文本处理工具之一。 -最简单的awk的任务是从标准输入中选择字段;如果你对awk除了这个没有学习过其他的,它还是会是你身边一个非常有用的工具。 +最简单的awk的任务是从标准输入中选择字段;如果你对awk除了这个用途之外,从来没了解过它的其他用途,你会发现它还是会是你身边一个非常有用的工具。 默认情况下,awk通过空格分隔输入。如果您想选择输入的第一个字段,你只需要告诉awk输出$ 1: @@ -30,13 +30,13 @@ > foo: three | bar: one -好吧,如果你的输入不是由空格分隔怎么办?只需用awk中的'-F'标志后带上你的分隔符: +好吧,如果你的输入不是由空格分隔怎么办?只需用awk中的'-F'标志指定你的分隔符: $ echo 'one mississippi,two mississippi,three mississippi,four mississippi' | awk -F , '{print $4}' > four mississippi -偶尔间,你会发现自己正在处理拥有不同的字段数量的数据,但你只知道你想要的*最后*字段。 awk中内置的$NF变量代表*字段的数量*,这样你就可以用它来抓取最后一个元素: +偶尔间,你会发现自己正在处理字段数量不同的数据,但你只知道你想要的*最后*字段。 awk中内置的$NF变量代表*字段的数量*,这样你就可以用它来抓取最后一个元素: $ echo 'one two three four' | awk '{print $NF}' @@ -54,9 +54,9 @@ > three -而且这一切都非常有用,同样你可以摆脱强制使用sed,cut,和grep来得到这些结果(尽管有大量的工作)。 +而且这一切都非常有用,同样你可以摆脱强制使用sed,cut,和grep来得到这些结果(尽管要做更多的操作)。 -因此,我将为你留下awk的最后介绍特性,维护跨行状态。 +因此,我将最后为你介绍awk的一个特性,维持跨行状态。 $ echo -e 'one 1\ntwo 2' | awk '{print $2}' @@ -68,7 +68,7 @@ > 3 -(END代表的是我们在执行完每行的处理**之后**只处理下面的代码块 +(END代表的是我们在执行完每行的处理**之后**只处理下面的代码块) 这里我使用的例子是统计web服务器请求日志的字节大小。想象一下我们有如下这样的日志: @@ -104,7 +104,7 @@ > 31657 -如果你正在寻找关于awk的更多资料,你可以在Amazon中在15美元内找到[原始awk手册][1]的副本。你同样可以使用Eric Pement的[单行awk命令收集][2]这本书 +如果你正在寻找关于awk的更多资料,你可以在Amazon中花费不到15美元买到[原始awk手册][1]的二手书。你也许还可以看看Eric Pement的[单行awk命令收集][2]这本书。 -------------------------------------------------------------------------------- @@ -112,7 +112,7 @@ via: http://xmodulo.com/2014/07/use-awk-command-linux.html 作者:[James Pearson][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/20140804 How to install and configure Nvidia Optimus driver on Ubuntu.md b/published/20140804 How to install and configure Nvidia Optimus driver on Ubuntu.md similarity index 76% rename from translated/tech/20140804 How to install and configure Nvidia Optimus driver on Ubuntu.md rename to published/20140804 How to install and configure Nvidia Optimus driver on Ubuntu.md index 62b0c99dd6..79ce3d44f1 100644 --- a/translated/tech/20140804 How to install and configure Nvidia Optimus driver on Ubuntu.md +++ b/published/20140804 How to install and configure Nvidia Optimus driver on Ubuntu.md @@ -4,19 +4,20 @@ Nvidia Optimus是一款利用“双显卡切换”技术的混合GPU系统,但 ### 背景知识 ### 对那些不熟悉Nvidia Optimus的读者,在板载Intel图形芯片组和使用被称为“GPU切换”、对需求有着更强大处理能力的NVIDA显卡这两者之间的进行切换是很有必要的。这么做的主要目的是延长笔记本电池的使用寿命,以便在不需要Nvidia GPU的时候将其关闭。带来的好处是显而易见的,比如说你只是想简单地打打字,笔记本电池可以撑8个小时;如果看高清视频,可能就只能撑3个小时了。使用Windows时经常如此。 + ![](https://farm6.staticflickr.com/5581/14612159387_2e89a52085_z.jpg) 几年前,我买了一台上网本(Asus VX6),犯的最蠢的一个错误就是没有检查Linux驱动兼容性。因为在以前,特别是对于一台上网本大小的设备,这根本不会是问题。即便某些驱动不是现成可用的,我也可以找到其它的办法让它正常工作,比如安装专门模块或者使用反向移植。对我来说这是第一次——我的电脑预先配备了Nvidia ION2图形显卡。 在那时候,Nvidia的Optimus混合GPU硬件还是相当新的产品,而我也没有预见到在这台机器上运行Linux会遇到什么限制。如果你读到了这里,恰好对Linux系统有经验,而且也在几年前买过一台笔记本,你可能对这种痛苦感同身受。 -[Bumblebee][4]项目直到最近因为得到Linux系统对混合图形方面的支持才变得好起来。事实上,如果配置正确的话,通过命令行接口(如“optirun vlc”)为想要的应用程序去利用Nvidia显卡的功能是可能的,但让HDMI一类的功能运转起来就很不同了。(译者注:Bumblebee 项目是把Nvidia的Optimus技术移到Linux上来。) +[Bumblebee][4]项目直到最近因为得到Linux系统对混合图形方面的支持才变得好起来。事实上,如果配置正确的话,通过命令行接口(如“optirun vlc”)让你选定的应用程序能利用Nvidia显卡功能是可行的,但让HDMI一类的功能运转起来就很不同了。(译者注:Bumblebee 项目是把Nvidia的Optimus技术移到Linux上来。) -我之所以使用“如果配置正确的话”这个短语,是因为实际上为了让它发挥出性能往往不只是通过几次尝试去改变Xorg的配置就能做到的。如果你以前没有使用过ppa-purge或者运行过“dpkg-reconfigure -phigh xserver-xorg”这类命令,那么我可以向你保证修补Bumblebee的过程会让你受益匪浅。 +我之所以使用“如果配置正确的话”这个短语,是因为实际上为了让它发挥出性能来往往不只是通过几次尝试去改变Xorg的配置就能做到的。如果你以前没有使用过ppa-purge或者运行过“dpkg-reconfigure -phigh xserver-xorg”这类命令,那么我可以向你保证修补Bumblebee的过程会让你受益匪浅。 [![](https://farm6.staticflickr.com/5588/14798680495_947c38b043_o.png)][2] -等待了很长一段时间,Nvidia才发布了支持Optimus的Linux驱动,但我们仍然没有获取对双显卡切换的真正支持。然而,现在有了Ubuntu 14.04、nvidia-prime和nvidia-331驱动,任何人都可以在Intel芯片和Nvidia显卡之间轻松切换。不幸的是,为了使切换生效,还是会受限于要重启X11视窗系统(通过注销登录实现)。 +在等待了很长一段时间后,Nvidia才发布了支持Optimus的Linux驱动,但我们仍然没有得到对双显卡切换的真正支持。然而,现在有了Ubuntu 14.04、nvidia-prime和nvidia-331驱动,任何人都可以在Intel芯片和Nvidia显卡之间轻松切换。不过不幸的是,为了使切换生效,还是会受限于需要重启X11视窗系统(通过注销登录实现)。 为了减轻这种不便,有一个小型程序用于快速切换,稍后我会给出。这个驱动程序的安装就此成为一件轻而易举的事了,HDMI也可以正常工作,这足以让我心满意足了。 @@ -24,11 +25,11 @@ Nvidia Optimus是一款利用“双显卡切换”技术的混合GPU系统,但 为了更快地描述这个过程,我假设你已经安装好Ubuntu 14.04或者Mint 17。 -作为一名系统管理员,最近我发现90%的Linux通过命令行执行起来更快,但这次我推荐使用“Additional Drivers”这个应用程序,你可能使用它安装过网卡或声卡驱动。 +作为一名系统管理员,最近我发现90%的Linux操作通过命令行执行起来更快,但这次我推荐使用“Additional Drivers”这个应用程序,你可能使用它安装过网卡或声卡驱动。 ![](https://farm4.staticflickr.com/3886/14795564221_753f9e2d99_z.jpg) -**注意:下面的所有命令都是在~#前执行的,需要root权限执行。在运行命令前,要么使用“sudo su”(切换到root权限),要么在每条命令的开头使用速冻运行。** +**注意:下面的所有命令都是在~#提示符下执行的,需要root权限执行。在运行命令前,要么使用“sudo su”(切换到root权限),要么在每条命令的开头使用sudo运行。** 你也可以在命令行输入如下命令进行安装: @@ -44,19 +45,19 @@ Nvidia Optimus是一款利用“双显卡切换”技术的混合GPU系统,但 ~$ nvidia-settings -#### 注意:~$表示不以root用户身份执行。 #### +**注意:~$表示不以root用户身份执行。** ![](https://farm4.staticflickr.com/3921/14796320814_de5c9882c2_z.jpg) 你也可以使用命令行设置默认使用哪一块显卡: - ~# prime-select intel (or nvidia) + ~# prime-select intel (或 nvidia) 使用这个命令进行切换: - ~# prime-switch intel (or nvidia) + ~# prime-switch intel (或 nvidia) -两个命令的生效都需要重启X11,可以通过注销和重新登录实现。重启电脑也行。 +两个命令的生效都需要重启X11,可以通过注销和重新登录实现。当然重启电脑也行。 对Ubuntu用户键入命令: @@ -70,7 +71,7 @@ Nvidia Optimus是一款利用“双显卡切换”技术的混合GPU系统,但 ~# prime-select query -最后,你可以通过添加ppa:nilarimogard/webupd8来安装叫做prime-indicator的程序包,实现通过工具栏快速切换来重启Xserver会话。为了安装它,只需要运行: +最后,你可以通过添加ppa:nilarimogard/webupd8来安装叫做prime-indicator的程序包,实现通过工具栏快速切换来重启Xserver会话。要安装它,只需要运行: ~# add-apt-repository ppa:nilarimogard/webupd8 ~# apt-get update @@ -84,7 +85,7 @@ Nvidia Optimus是一款利用“双显卡切换”技术的混合GPU系统,但 也可以花时间查看一下这个我偶然发现的[脚本][3],用来方便地在Bumblebee和Nvidia-Prime之间进行切换,但我必须强调并没有亲自对此进行实验。 -最后,我感到非常惭愧写了这么多才得以为Linux上的显卡提供了专门支持,但仍然不能实现双显卡切换,因为混合图形技术似乎是便携式设备的未来。一般情况下,AMD会发布Linux平台上的驱动支持,但我认为Optimus是目前为止我遇到过的最糟糕的硬件支持问题。 +最后,我感到非常惭愧,写了这么多才得以为Linux上的显卡提供了专门支持,但仍然不能实现双显卡切换,因为混合图形技术似乎是便携式设备的未来。一般情况下,AMD会发布Linux平台上的驱动支持,但我认为Optimus是目前为止我遇到过的最糟糕的硬件支持问题。 不管这篇教程对你的使用是否完美,但这确实是利用这块Nvidia显卡最容易的方法。你可以试着在Intel显卡上只运行最新的Unity,然后考虑2到3个小时的电池寿命是否值得权衡。 @@ -94,7 +95,7 @@ via: http://xmodulo.com/2014/08/install-configure-nvidia-optimus-driver-ubuntu.h 作者:[Christopher Ward][a] 译者:[KayGuoWhu](https://github.com/KayGuoWhu) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 diff --git a/translated/tech/20140808 How to install Puppet server and client on CentOS and RHEL.md b/published/20140808 How to install Puppet server and client on CentOS and RHEL.md similarity index 93% rename from translated/tech/20140808 How to install Puppet server and client on CentOS and RHEL.md rename to published/20140808 How to install Puppet server and client on CentOS and RHEL.md index a84062730f..ded986fab8 100644 --- a/translated/tech/20140808 How to install Puppet server and client on CentOS and RHEL.md +++ b/published/20140808 How to install Puppet server and client on CentOS and RHEL.md @@ -4,7 +4,7 @@ ### Puppet 是什么? ### -Puppet 是一款为 IT 系统管理员和顾问设计的自动化软件,你可以用它自动化地完成诸如安装应用程序和服务、补丁管理和部署等工作。所有资源的相关配置都以“manifests”的方式保存,单台机器或者多台机器都可以使用。如果你想了解更多内容,Puppet 实验室的网站上有关于 [Puppet 及其工作原理][1]的更详细的介绍。 +Puppet 是一款为 IT 系统管理员和顾问们设计的自动化软件,你可以用它自动化地完成诸如安装应用程序和服务、补丁管理和部署等工作。所有资源的相关配置都以“manifests”的方式保存,单台机器或者多台机器都可以使用。如果你想了解更多内容,Puppet 实验室的网站上有关于 [Puppet 及其工作原理][1]的更详细的介绍。 ### 本教程要做些什么? ### @@ -58,7 +58,7 @@ Puppet 是一款为 IT 系统管理员和顾问设计的自动化软件,你可 # chkconfig puppet on -Puppet 客户端需要知道 Puppet master 服务器的地址。最佳方案是使用 DNS 服务器解析 Puppet master 服务器地址。如果你没有 DNS 服务器,在 `/etc/hosts` 里添加下面这几行也可以: +Puppet 客户端需要知道 Puppet master 服务器的地址。最佳方案是使用 DNS 服务器解析 Puppet master 服务器地址。如果你没有 DNS 服务器,在 `/etc/hosts` 里添加类似下面这几行也可以: > 1.2.3.4 server.your.domain @@ -125,7 +125,7 @@ master 服务器名也要在 `/etc/puppet/puppet.conf` 文件的“[agent]”小 > runinterval = -这个选项的值可以是秒(格式比如 30 或者 30s),分钟(30m),小时(6h),天(2d)以及年(5y)。值得注意的是,0 意味着“立即执行”而不是“从不执行”。 +这个选项的值可以是秒(格式比如 30 或者 30s),分钟(30m),小时(6h),天(2d)以及年(5y)。值得注意的是,**0 意味着“立即执行”而不是“从不执行”**。 ### 提示和技巧 ### @@ -139,7 +139,7 @@ master 服务器名也要在 `/etc/puppet/puppet.conf` 文件的“[agent]”小 # puppet agent -t --debug -Debug 选项会显示 Puppet 本次运行时的差不多每一个步骤,这在调试非常复杂的问题时很有用。另一个很有用的选项是: +debug 选项会显示 Puppet 本次运行时的差不多每一个步骤,这在调试非常复杂的问题时很有用。另一个很有用的选项是: # puppet agent -t --noop @@ -187,7 +187,7 @@ via: http://xmodulo.com/2014/08/install-puppet-server-client-centos-rhel.html 作者:[Jaroslav Štěpánek][a] 译者:[sailing](https://github.com/sailing) -校对:[校对者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/20140811 How to improve your productivity in terminal environment with Tmux.md b/published/20140811 How to improve your productivity in terminal environment with Tmux.md similarity index 51% rename from translated/tech/20140811 How to improve your productivity in terminal environment with Tmux.md rename to published/20140811 How to improve your productivity in terminal environment with Tmux.md index c94df0b81b..5bdb273d06 100644 --- a/translated/tech/20140811 How to improve your productivity in terminal environment with Tmux.md +++ b/published/20140811 How to improve your productivity in terminal environment with Tmux.md @@ -1,15 +1,15 @@ -如何使用Tmux提高终端环境下的生产率 +如何使用Tmux提高终端环境下的效率 === -鼠标的采用是次精彩的创新,它让电脑更加接近普通人。但从程序员和系统管理员的角度,使用电脑办公时,手一旦离开键盘,就会有些分心 +鼠标的发明是了不起的创新,它让电脑更加接近普通人。但从程序员和系统管理员的角度,使用电脑工作时,手一旦离开键盘,就会有些分心。 -作为一名系统管理员,我大量的工作都需要在终端环境下。打开很多标签,然后在多个终端之间切换窗口会让我慢下来。而且当我的服务器出问题的时候,我不能浪费任何时间 +作为一名系统管理员,我大量的工作都需要在终端环境下。打开很多标签,然后在多个终端之间切换窗口会让我慢下来。尤其是当我的服务器出问题的时候,我不能浪费任何时间! ![](https://farm6.staticflickr.com/5563/14853747084_e14cf18e8f_z.jpg) -[Tmux][1]是我日常工作必要的工具之一。我可以借助Tmux创造出复杂的开发环境,同时还可以在一旁进行SSH远程连接。我可以开出很多窗口,拆分成很多面板,附加和分离会话等等。掌握了Tmux之后,你就可以扔掉鼠标了(只是个玩笑:D) +[Tmux][1]是我日常工作必要的工具之一。我可以借助Tmux构建出复杂的开发环境,同时还可以在一旁进行SSH远程连接。我可以开出很多窗口,将其拆分成很多面板,接管和分离会话等等。掌握了Tmux之后,你就可以扔掉鼠标了(只是个玩笑:D)。 -Tmux("Terminal Multiplexer"的简称)可以让我们在单个屏幕的灵活布局下开出很多终端,我们就可以协作地使用它们。举个例子,在一个面板中,我们用Vim修改一些配置文件,在另一个面板,我们使用irssi聊天,而在其余的面板,跟踪一些日志。然后,我们还可以打开新的窗口来升级系统,再开一个新窗口来进行服务器的ssh连接。在这些窗口面板间浏览切换和创建它们一样简单。它的高度可配置和可定制的,让其成为你心中的延伸 +Tmux("Terminal Multiplexer"的简称)可以让我们在单个屏幕的灵活布局下开出很多终端,我们就可以协作地使用它们。举个例子,在一个面板中,我们用Vim修改一些配置文件,在另一个面板,我们使用`irssi`聊天,而在其余的面板,可以跟踪一些日志。然后,我们还可以打开新的窗口来升级系统,再开一个新窗口来进行服务器的ssh连接。在这些窗口面板间浏览切换和创建它们一样简单。它的高度可配置和可定制的,让其成为你心中的延伸 ### 在Linux/OSX下安装Tmux ### @@ -20,22 +20,21 @@ Tmux("Terminal Multiplexer"的简称)可以让我们在单个屏幕的灵活布 # sudo brew install tmux # sudo port install tmux -### Debian/Ubuntu ### +#### Debian/Ubuntu: #### # sudo apt-get install tmux -RHEL/CentOS/Fedora(RHEL/CentOS 要求 [EPEL repo][2]): +####RHEL/CentOS/Fedora(RHEL/CentOS 要求 [EPEL repo][2]):#### $ sudo yum install tmux -Archlinux: +####Archlinux:#### $ sudo pacman -S tmux ### 使用不同会话工作 ### -使用Tmux的最好方式是使用不同的会话,这样你就可以以你想要的方式,将任务和应用组织到不同的会话中。如果你想改变一个会话,会话里面的任何工作都无须停止或者杀掉,让我们来看看这是怎么工作的 - +使用Tmux的最好方式是使用会话的方式,这样你就可以以你想要的方式,将任务和应用组织到不同的会话中。如果你想改变一个会话,会话里面的任何工作都无须停止或者杀掉。让我们来看看这是怎么工作的。 让我们开始一个叫做"session"的会话,并且运行top命令 @@ -46,20 +45,20 @@ Archlinux: $ tmux attach-session -t session -之后你会看到top操作仍然运行在重新连接的会话上 +之后你会看到top操作仍然运行在重新连接的会话上。 一些管理sessions的命令: $ tmux list-session - $ tmux new-session - $ tmux attach-session -t - $ tmux rename-session -t - $ tmux choose-session -t - $ tmux kill-session -t + $ tmux new-session <会话名> + $ tmux attach-session -t <会话名> + $ tmux rename-session -t <会话名> + $ tmux choose-session -t <会话名> + $ tmux kill-session -t <会话名> ### 使用不同的窗口工作 -很多情况下,你需要在一个会话中运行多个命令,并且执行多个任务。我们可以在一个会话的多个窗口里组织他们。在现代化的GUI终端(比如 iTerm或者Konsole),一个窗口被视为一个标签。在会话中配置了我们默认的环境,我们就能够在一个会话中创建许多我们需要的窗口。窗口就像运行在会话中的应用程序,当我们脱离当前会话的时候,它仍在持续,让我们来看一个例子: +很多情况下,你需要在一个会话中运行多个命令,执行多个任务。我们可以在一个会话的多个窗口里组织他们。在现代的GUI终端(比如 iTerm或者Konsole),一个窗口被视为一个标签。在会话中配置了我们默认的环境之后,我们就能够在一个会话中创建许多我们需要的窗口。窗口就像运行在会话中的应用程序,当我们脱离当前会话的时候,它仍在持续,让我们来看一个例子: $ tmux new -s my_session @@ -67,7 +66,7 @@ Archlinux: 按下**CTRL-b c** -这将会创建一个新的窗口,然后屏幕的光标移向它。现在你就可以在新窗口下运行你的新应用。你可以写下你当前窗口的名字。在目前的案例下,我运行的top程序,所以top就是该窗口的名字 +这将会创建一个新的窗口,然后屏幕的光标移向它。现在你就可以在新窗口下运行你的新应用。你可以修改你当前窗口的名字。在目前的例子里,我运行的top程序,所以top就是该窗口的名字 如果你想要重命名,只需要按下: @@ -77,15 +76,15 @@ Archlinux: ![](https://farm6.staticflickr.com/5579/14855868482_d52516a357_z.jpg) -一旦在一个会话中创建多个窗口,我们需要在这些窗口间移动的办法。窗口以数组的形式被组织在一起,每个窗口都有一个从0开始计数的号码,想要快速跳转到其余窗口: +一旦在一个会话中创建多个窗口,我们需要在这些窗口间移动的办法。窗口像数组一样组织在一起,从0开始用数字标记每个窗口,想要快速跳转到其余窗口: -**CTRL-b ** +**CTRL-b <窗口号>** -如果我们给窗口起了名字,我们可以使用下面的命令切换: +如果我们给窗口起了名字,我们可以使用下面的命令找到它们: **CTRL-b f** -列出所有窗口: +也可以列出所有窗口: **CTRL-b w** @@ -94,21 +93,21 @@ Archlinux: **CTRL-b n**(到达下一个窗口) **CTRL-b p**(到达上一个窗口) -想要离开一个窗口: +想要离开一个窗口,可以输入 exit 或者: **CTRL-b &** -关闭窗口之前,你需要确认一下 +关闭窗口之前,你需要确认一下。 ### 把窗口分成许多面板 -有时候你在编辑器工作的同时,需要查看日志文件。编辑的同时追踪日志真的很有帮助。Tmux可以让我们把窗口分成许多面板。举了例子,我们可以创建一个控制台监测我们的服务器,同时拥有一个复杂的编辑器环境,这样就能同时进行编译和debug +有时候你在编辑器工作的同时,需要查看日志文件。在编辑的同时追踪日志真的很有帮助。Tmux可以让我们把窗口分成许多面板。举个例子,我们可以创建一个控制台监测我们的服务器,同时用编辑器构造复杂的开发环境,这样就能同时进行编译和调试了。 -让我们创建另一个Tmux会话,让其以面板的方式工作。首先,如果我们在某个会话中,那就从Tmux会话中脱离出来 +让我们创建另一个Tmux会话,让其以面板的方式工作。首先,如果我们在某个会话中,那就从Tmux会话中脱离出来: **CTRL-b d** -开始一个叫做"panes"的新会话 +开始一个叫做"panes"的新会话: $ tmux new -s panes @@ -120,17 +119,17 @@ Archlinux: **CRTL-b %** -又增加了两个 +又增加了两个: ![](https://farm4.staticflickr.com/3881/14669677417_bc1bdce255_z.jpg) 在他们之间移动: -**CTRL-b ** +**CTRL-b <光标键>** ### 结论 -我希望这篇教程能对你有作用。作为奖励,像[Tmuxinator][3] 或者 [Tmuxifier][4]这样的工具,可以简化Tmux会话,窗口和面板的创建及加载,你可以很容易就配置Tmux。如果你没有使用过这些,尝试一下吧 +我希望这篇教程能对你有作用。此外,像[Tmuxinator][3] 或者 [Tmuxifier][4]这样的工具,可以简化Tmux会话,窗口和面板的创建及加载,你可以很容易就配置Tmux。如果你没有使用过这些,尝试一下吧! -------------------------------------------------------------------------------- @@ -138,7 +137,7 @@ via: http://xmodulo.com/2014/08/improve-productivity-terminal-environment-tmux.h 作者:[Christopher Valerio][a] 译者:[su-kaiyao](https://github.com/su-kaiyao) -校对:[校对者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/20140813 How to Extend or Reduce LVM' s (Logical Volume Management) in Linux--Part II.md b/published/20140813 How to Extend or Reduce LVM' s (Logical Volume Management) in Linux--Part II.md similarity index 95% rename from translated/tech/20140813 How to Extend or Reduce LVM' s (Logical Volume Management) in Linux--Part II.md rename to published/20140813 How to Extend or Reduce LVM' s (Logical Volume Management) in Linux--Part II.md index 4013367d2f..48b261e5ef 100644 --- a/translated/tech/20140813 How to Extend or Reduce LVM' s (Logical Volume Management) in Linux--Part II.md +++ b/published/20140813 How to Extend or Reduce LVM' s (Logical Volume Management) in Linux--Part II.md @@ -1,18 +1,17 @@ -在Linux中扩展/缩减LVM(逻辑卷管理)—— 第二部分 +在Linux中扩展/缩减LVM(第二部分) ================================================================================ 前面我们已经了解了怎样使用LVM创建弹性的磁盘存储。这里,我们将了解怎样来扩展卷组,扩展和缩减逻辑卷。在这里,我们可以缩减或者扩展逻辑卷管理(LVM)中的分区,LVM也可称之为弹性卷文件系统。 ![Extend/Reduce LVMs in Linux](http://www.tecmint.com/wp-content/uploads/2014/08/LVM_extend.jpg) -### 需求 ### +### 前置需求 ### - [使用LVM创建弹性磁盘存储——第一部分][1] -注:两篇都翻译完了的话,发布的时候将这个链接做成发布的中文的文章地址 #### 什么时候我们需要缩减卷? #### -或许我们需要创建一个独立的分区用于其它用途,或者我们需要扩展任何空间低的分区。真是这样的话,我们可以很容易地缩减大尺寸的分区,并且扩展空间低的分区,只要按下面几个简易的步骤来即可。 +或许我们需要创建一个独立的分区用于其它用途,或者我们需要扩展任何空间低的分区。遇到这种情况时,使用 LVM我们可以很容易地缩减大尺寸的分区,以及扩展空间低的分区,只要按下面几个简易的步骤来即可。 #### 我的服务器设置 —— 需求 #### @@ -284,9 +283,9 @@ via: http://www.tecmint.com/extend-and-reduce-lvms-in-linux/ 作者:[Babin Lonston][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/) 荣誉推出 [a]:http://www.tecmint.com/author/babinlonston/ -[1]:http://www.tecmint.com/create-lvm-storage-in-linux/ +[1]:http://linux.cn/article-3965-1.html diff --git a/translated/tech/20140813 How to remove file metadata on Linux.md b/published/20140813 How to remove file metadata on Linux.md similarity index 83% rename from translated/tech/20140813 How to remove file metadata on Linux.md rename to published/20140813 How to remove file metadata on Linux.md index b33dba70a2..f9a0bb7050 100644 --- a/translated/tech/20140813 How to remove file metadata on Linux.md +++ b/published/20140813 How to remove file metadata on Linux.md @@ -1,16 +1,15 @@ -移除Linux系统上的文件元数据 +如何在Linux上移除文件内的隐私数据 ================================================================================ -典型的数据文件通常关联着“元数据”,其包含这个文件的描述信息,表现为一系列属性-值的集合。元数据一般包括创建者名称、生成文件的工具、文件创建/修改时期、创建位置和编辑历史等等。EXIF(镜像标准)、RDF(web资源)和DOI(数字文档)是几种流行的元数据标准。 - +典型的数据文件通常关联着“元数据”,其包含这个文件的描述信息,表现为一系列属性-值的集合。元数据一般包括创建者名称、生成文件的工具、文件创建/修改时期、创建位置和编辑历史等等。几种流行的元数据标准有 EXIF(图片)、RDF(web资源)和DOI(数字文档)等。 虽然元数据在数据管理领域有它的优点,但事实上它会[危害][1]你的隐私。相机图片中的EXIF格式数据会泄露出可识别的个人信息,比如相机型号、拍摄相关的GPS坐标和用户偏爱的照片编辑软件等。在文档和电子表格中的元数据包含作者/所属单位信息和相关的编辑历史。不一定这么绝对,但诸如[metagoofil][2]一类的元数据收集工具在信息收集的过程中常最作为入侵测试的一部分被利用。 对那些想要从共享数据中擦除一切个人元数据的用户来说,有一些方法从数据文件中移除元数据。你可以使用已有的文档或图片编辑软件,通常有自带的元数据编辑功能。在这个教程里,我会介绍一种不错的、单独的**元数据清理工具**,其目标只有一个:**匿名一切私有元数据**。 -[MAT][3](元数据匿名工具箱)是一款专业的元数据清理器,使用Python编写。它在Tor工程旗下开发而成,在[Trails][4]上衍生出标准,后者是一种私人增强的live操作系统。【翻译得别扭,麻烦修正:)】 +[MAT][3](元数据匿名工具箱)是一款专业的元数据清理器,使用Python编写。它属于Tor旗下的项目,而且是Live 版的隐私增强操作系统 [Trails][4] 的标配应用。 -与诸如[exiftool][5]等只能对有限数量的文件类型进行写入的工具相比,MAT支持从各种各样的文件中消除元数据:图片(png、jpg)、文档(odt、docx、pptx、xlsx和pdf)、归档文件(tar、tar.bz2)和音频(mp3、ogg、flac)等。 +与诸如[exiftool][5]等只能对有限种类的文件类型进行写入的工具相比,MAT支持从各种各样的文件中消除元数据:图片(png、jpg)、文档(odt、docx、pptx、xlsx和pdf)、归档文件(tar、tar.bz2)和音频(mp3、ogg、flac)等。 ### 在Linux上安装MAT ### @@ -18,7 +17,7 @@ $ sudo apt-get install mat -在Fedora上,并没有预先生成的MAT包,所以你需要从源码生成。这是我在Fedora上生成MAT的步骤(不成功的话,请查看教程底部): +在Fedora上,并没有预先生成的MAT软件包,所以你需要从源码生成。这是我在Fedora上生成MAT的步骤(不成功的话,请查看教程底部): $ sudo yum install python-devel intltool python-pdfrw perl-Image-ExifTool python-mutagen $ sudo pip install hachoir-core hachoir-parser @@ -95,7 +94,7 @@ ### 总结 ### -MAT是一款简单但非常好用的工具,用来预防从元数据中无意泄露私人数据。请注意如果有必要,还是需要你去隐藏文件内容。MAT能做的是消除与文件相关的元数据,但并不会对文件本身进行任何操作。简而言之,MAT是一名救生员,因为它可以处理大多数常见的元数据移除,但不应该只指望它来保证你的隐私。[译者注:养成良好的隐私保护意识和习惯才是最好的方法] +MAT是一款简单但非常好用的工具,用来预防从元数据中无意泄露私人数据。请注意如果有必要,文件内容也需要保护。MAT能做的是消除与文件相关的元数据,但并不会对文件本身进行任何操作。简而言之,MAT是一名救生员,因为它可以处理大多数常见的元数据移除,但不应该只指望它来保证你的隐私。[译者注:养成良好的隐私保护意识和习惯才是最好的方法] -------------------------------------------------------------------------------- @@ -103,7 +102,7 @@ via: http://xmodulo.com/2014/08/remove-file-metadata-linux.html 作者:[Dan Nanni][a] 译者:[KayGuoWhu](https://github.com/KayGuoWhu) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 diff --git a/translated/tech/20140813 Setup Flexible Disk Storage with Logical Volume Management (LVM) in Linux--PART 1.md b/published/20140813 Setup Flexible Disk Storage with Logical Volume Management (LVM) in Linux--PART 1.md similarity index 67% rename from translated/tech/20140813 Setup Flexible Disk Storage with Logical Volume Management (LVM) in Linux--PART 1.md rename to published/20140813 Setup Flexible Disk Storage with Logical Volume Management (LVM) in Linux--PART 1.md index 218dfe7e5a..fc80f34f20 100644 --- a/translated/tech/20140813 Setup Flexible Disk Storage with Logical Volume Management (LVM) in Linux--PART 1.md +++ b/published/20140813 Setup Flexible Disk Storage with Logical Volume Management (LVM) in Linux--PART 1.md @@ -1,11 +1,12 @@ -在Linux中使用逻辑卷管理器构建灵活的磁盘存储——第一部分 +在Linux中使用LVM构建灵活的磁盘存储(第一部分) ================================================================================ -**逻辑卷管理器(LVM)**让磁盘空间管理更为便捷。如果一个文件系统需要更多的空间,它可以在它的卷组中将空闲空间添加到它的逻辑卷中,而文件系统可以根据你的意愿调整大小。如果某个磁盘启动失败,替换磁盘可以使用卷组注册成一个物理卷,而逻辑卷扩展可以将数据迁移到新磁盘而不会丢失数据。 +**逻辑卷管理器(LVM)**让磁盘空间管理更为便捷。如果一个文件系统需要更多的空间,可以在它的卷组中将空闲空间添加到其逻辑卷中,而文件系统可以根据你的意愿调整大小。如果某个磁盘启动失败,用于替换的磁盘可以使用卷组注册成一个物理卷,而逻辑卷扩展可以将数据迁移到新磁盘而不会丢失数据。 -![Create LVM Storage in Linux](http://www.tecmint.com/wp-content/uploads/2014/07/Create-Logical-Volume-Storage.jpg) -在Linux中创建LVM存储 +
![Create LVM Storage in Linux](http://www.tecmint.com/wp-content/uploads/2014/07/Create-Logical-Volume-Storage.jpg)
-在现代世界中,每台服务器空间都会因为我们的需求增长而不断扩展。逻辑卷可以用于RAID,SAN。单个物理卷将会被加入组以创建卷组,在卷组中,我们需要切割空间以创建逻辑卷。在使用逻辑卷时,我们可以使用某些命令来跨磁盘、跨逻辑卷扩展,或者减少逻辑卷大小,而不用重新格式化和重新对当前磁盘分区。卷可以跨磁盘抽取数据,这会增加I/O数据量。 +
*在Linux中创建LVM存储*
+ +在如今,每台服务器空间都会因为我们的需求增长而不断扩展。逻辑卷可以用于RAID,SAN。单个物理卷将会被加入组以创建卷组,在卷组中,我们需要切割空间以创建逻辑卷。在使用逻辑卷时,我们可以使用某些命令来跨磁盘、跨逻辑卷扩展,或者减少逻辑卷大小,而不用重新格式化和重新对当前磁盘分区。卷可以跨磁盘抽取数据,这会增加I/O数据量。 ### LVM特性 ### @@ -27,8 +28,8 @@ # vgs # lvs -![Check Physical Volumes](http://www.tecmint.com/wp-content/uploads/2014/07/Create-Logical-Volume-Storage-03.jpg) -检查物理卷 +
![Check Physical Volumes](http://www.tecmint.com/wp-content/uploads/2014/07/Create-Logical-Volume-Storage-03.jpg)
+
*检查物理卷*
下面是上面截图中各个参数的说明。 @@ -52,8 +53,8 @@ # fdisk -l -![Verify Added Disks](http://www.tecmint.com/wp-content/uploads/2014/07/Create-Logical-Volume-Storage-04.jpg) -验证添加的磁盘 +
![Verify Added Disks](http://www.tecmint.com/wp-content/uploads/2014/07/Create-Logical-Volume-Storage-04.jpg)
+
*验证添加的磁盘*
- 用于操作系统(CentOS 6.5)的默认磁盘。 - 默认磁盘上定义的分区(vda1 = swap),(vda2 = /)。 @@ -61,8 +62,8 @@ 各个磁盘大小都是20GB,默认的卷组的PE大小为4MB,我们在该服务器上配置的卷组使用默认PE。 -![Volume Group Display](http://www.tecmint.com/wp-content/uploads/2014/07/Create-Logical-Volume-Storage-05.jpg) -卷组显示 +
![Volume Group Display](http://www.tecmint.com/wp-content/uploads/2014/07/Create-Logical-Volume-Storage-05.jpg)
+
*卷组显示*
- **VG Name** – 卷组名称。 - **Format** – LVM架构使用LVM2。 @@ -82,8 +83,8 @@ # df -TH -![Check the Disk Space](http://www.tecmint.com/wp-content/uploads/2014/07/Create-Logical-Volume-Storage-06.jpg) -检查磁盘空间 +
![Check the Disk Space](http://www.tecmint.com/wp-content/uploads/2014/07/Create-Logical-Volume-Storage-06.jpg)
+
*检查磁盘空间*
上面的图片中显示了用于根的挂载点已使用了**18GB**,因此没有空闲空间可用了。 @@ -91,15 +92,15 @@ 我们可以扩展当前使用的卷组以获得更多空间。但在这里,我们将要做的是,创建新的卷组,然后在里面肆意妄为吧。过会儿,我们可以看到怎样来扩展使用中的卷组的文件系统。 -在使用新磁盘钱,我们需要使用fdisk来对磁盘分区。 +在使用新磁盘前,我们需要使用fdisk来对磁盘分区。 # fdisk -cu /dev/sda - **c** – 关闭DOS兼容模式,推荐使用该选项。 - **u** – 当列出分区表时,会以扇区而不是柱面显示。 -![Create New Physical Partitions](http://www.tecmint.com/wp-content/uploads/2014/07/Create-Logical-Volume-Storage-07.jpg) -创建新的物理分区 +
![Create New Physical Partitions](http://www.tecmint.com/wp-content/uploads/2014/07/Create-Logical-Volume-Storage-07.jpg)
+
*创建新的物理分区*
接下来,请遵循以下步骤来创建新分区。 @@ -118,8 +119,8 @@ # fdisk -l -![Verify Partition Table](http://www.tecmint.com/wp-content/uploads/2014/07/Create-Logical-Volume-Storage-08.jpg) -验证分区表 +
![Verify Partition Table](http://www.tecmint.com/wp-content/uploads/2014/07/Create-Logical-Volume-Storage-08.jpg)
+
*验证分区表*
### 创建物理卷 ### @@ -135,8 +136,8 @@ # pvs -![Create Physical Volumes](http://www.tecmint.com/wp-content/uploads/2014/07/Create-Logical-Volume-Storage-09.jpg) -创建物理卷 +
![Create Physical Volumes](http://www.tecmint.com/wp-content/uploads/2014/07/Create-Logical-Volume-Storage-09.jpg)
+
*创建物理卷*
### 创建卷组 ### @@ -152,11 +153,11 @@ # vgs -![Create Volume Groups](http://www.tecmint.com/wp-content/uploads/2014/07/Create-Logical-Volume-Storage-10.jpg) -创建卷组 +
![Create Volume Groups](http://www.tecmint.com/wp-content/uploads/2014/07/Create-Logical-Volume-Storage-10.jpg)
+
*创建卷组*
-![Verify Volume Groups](http://www.tecmint.com/wp-content/uploads/2014/07/Create-Logical-Volume-Storage-11.jpg) -验证卷组 +
![Verify Volume Groups](http://www.tecmint.com/wp-content/uploads/2014/07/Create-Logical-Volume-Storage-11.jpg)
+
*验证卷组*
理解vgs命令输出: @@ -173,15 +174,15 @@ # vgs -v -![Check Volume Group Information](http://www.tecmint.com/wp-content/uploads/2014/07/Create-Logical-Volume-Storage-12.jpg) -检查卷组信息 +
![Check Volume Group Information](http://www.tecmint.com/wp-content/uploads/2014/07/Create-Logical-Volume-Storage-12.jpg)
+
*检查卷组信息*
**8.** 要获取更多关于新创建的卷组信息,运行以下命令。 # vgdisplay tecmint_add_vg -![List New Volume Groups](http://www.tecmint.com/wp-content/uploads/2014/07/Create-Logical-Volume-Storage-13.jpg) -列出新卷组 +
![List New Volume Groups](http://www.tecmint.com/wp-content/uploads/2014/07/Create-Logical-Volume-Storage-13.jpg)
+
*列出新卷组*
- 卷组名称 - 使用的LVM架构。 @@ -200,15 +201,15 @@ # lvs -![List Current Volume Groups](http://www.tecmint.com/wp-content/uploads/2014/07/Create-Logical-Volume-Storage-14.jpg) -列出当前卷组 +
![List Current Volume Groups](http://www.tecmint.com/wp-content/uploads/2014/07/Create-Logical-Volume-Storage-14.jpg)
+
*列出当前卷组*
**10.** 这些逻辑卷处于**vg_tecmint**卷组中使用**pvs**命令来列出并查看有多少空闲空间可以创建逻辑卷。 # pvs -![Check Free Space](http://www.tecmint.com/wp-content/uploads/2014/07/Create-Logical-Volume-Storage-15.jpg) -检查空闲空间 +
![Check Free Space](http://www.tecmint.com/wp-content/uploads/2014/07/Create-Logical-Volume-Storage-15.jpg)
+
*检查空闲空间*
**11.** 卷组大小为**54GB**,而且未被使用,所以我们可以在该组内创建LV。让我们将卷组平均划分大小来创建3个逻辑卷,就是说**54GB**/3 = **18GB**,创建出来的单个逻辑卷应该会是18GB。 @@ -218,8 +219,8 @@ # vgdisplay tecmint_add_vg -![Create New Logical Volume](http://www.tecmint.com/wp-content/uploads/2014/07/Create-Logical-Volume-Storage-16.jpg) -创建新逻辑卷 +
![Create New Logical Volume](http://www.tecmint.com/wp-content/uploads/2014/07/Create-Logical-Volume-Storage-16.jpg)
+
*创建新逻辑卷*
- 默认分配给该卷组的PE为32MB,这里单个的PE大小为32MB。 - 总可用PE是1725。 @@ -233,8 +234,8 @@ 1725PE/3 = 575 PE. 575 PE x 32MB = 18400 --> 18GB -![Calculate Disk Space](http://www.tecmint.com/wp-content/uploads/2014/07/Create-Logical-Volume-Storage-17.jpg) -计算磁盘空间 +
![Calculate Disk Space](http://www.tecmint.com/wp-content/uploads/2014/07/Create-Logical-Volume-Storage-17.jpg)
+
*计算磁盘空间*
按**CRTL+D**退出**bc**。现在让我们使用575个PE来创建3个逻辑卷。 @@ -253,8 +254,8 @@ # lvs -![List Created Logical Volumes](http://www.tecmint.com/wp-content/uploads/2014/07/Create-Logical-Volume-Storage-18.jpg) -列出创建的逻辑卷 +
![List Created Logical Volumes](http://www.tecmint.com/wp-content/uploads/2014/07/Create-Logical-Volume-Storage-18.jpg)
+
*列出创建的逻辑卷*
#### 方法2: 使用GB大小创建逻辑卷 #### @@ -272,8 +273,8 @@ # lvs -![Verify Created Logical Volumes](http://www.tecmint.com/wp-content/uploads/2014/07/Create-Logical-Volume-Storage-19.jpg) -验证创建的逻辑卷 +
![Verify Created Logical Volumes](http://www.tecmint.com/wp-content/uploads/2014/07/Create-Logical-Volume-Storage-19.jpg)
+
*验证创建的逻辑卷*
这里,我们可以看到,当创建第三个LV的时候,我们不能收集到18GB空间。这是因为尺寸有小小的改变,但在使用或者尺寸来创建LV时,这个问题会被忽略。 @@ -287,8 +288,8 @@ # mkfs.ext4 /dev/tecmint_add_vg/tecmint_manager -![Create Ext4 File System](http://www.tecmint.com/wp-content/uploads/2014/07/Create-Logical-Volume-Storage-20.jpg) -创建Ext4文件系统 +
![Create Ext4 File System](http://www.tecmint.com/wp-content/uploads/2014/07/Create-Logical-Volume-Storage-20.jpg)
+
*创建Ext4文件系统*
**13.** 让我们在**/mnt**下创建目录,并将已创建好文件系统的逻辑卷挂载上去。 @@ -302,8 +303,8 @@ # df -h -![Mount Logical Volumes](http://www.tecmint.com/wp-content/uploads/2014/07/Create-Logical-Volume-Storage-22.jpg) -挂载逻辑卷 +
![Mount Logical Volumes](http://www.tecmint.com/wp-content/uploads/2014/07/Create-Logical-Volume-Storage-22.jpg)
+
*挂载逻辑卷*
#### 永久挂载 #### @@ -321,32 +322,31 @@ /dev/mapper/tecmint_add_vg-tecmint_public /mnt/tecmint_public ext4 defaults 0 0 /dev/mapper/tecmint_add_vg-tecmint_manager /mnt/tecmint_manager ext4 defaults 0 0 -![Get mtab Mount Entry](http://www.tecmint.com/wp-content/uploads/2014/07/Create-Logical-Volume-Storage-23.jpg) -获取mtab挂载条目 +
![Get mtab Mount Entry](http://www.tecmint.com/wp-content/uploads/2014/07/Create-Logical-Volume-Storage-23.jpg)*
+
*获取mtab挂载条目*
-![Open fstab File](http://www.tecmint.com/wp-content/uploads/2014/07/Create-Logical-Volume-Storage-24.jpg) -打开fstab文件 +
![Open fstab File](http://www.tecmint.com/wp-content/uploads/2014/07/Create-Logical-Volume-Storage-24.jpg)
+
*打开fstab文件*
-![Add Auto Mount Entry](http://www.tecmint.com/wp-content/uploads/2014/07/Create-Logical-Volume-Storage-25.jpg) -添加自动挂载条目 +
![Add Auto Mount Entry](http://www.tecmint.com/wp-content/uploads/2014/07/Create-Logical-Volume-Storage-25.jpg)
+
*添加自动挂载条目*
重启前,执行mount -a命令来检查fstab条目。 # mount -av -![Verify fstab Entry](http://www.tecmint.com/wp-content/uploads/2014/07/Create-Logical-Volume-Storage-26.jpg) -验证fstab条目 +
![Verify fstab Entry](http://www.tecmint.com/wp-content/uploads/2014/07/Create-Logical-Volume-Storage-26.jpg)
+
*验证fstab条目*
这里,我们已经了解了怎样来使用逻辑卷构建灵活的存储,从使用物理磁盘到物理卷,物理卷到卷组,卷组再到逻辑卷。 -在我即将奉献的文章中,我将介绍如何扩展卷组、逻辑卷,减少逻辑卷,拍快照以及从快照中恢复。到那时,保持TecMint更新到这些精彩文章中的内容。 --------------------------------------------------------------------------------- +在我即将奉献的文章中,我将介绍如何扩展卷组、逻辑卷,减少逻辑卷,拍快照以及从快照中恢复。 -------------------------------------------------------------------------------- via: http://www.tecmint.com/create-lvm-storage-in-linux/ 作者:[Babin Lonston][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/20140818 Disable reboot using Ctrl-Alt-Del Keys in RHEL or CentOS.md b/published/20140818 Disable reboot using Ctrl-Alt-Del Keys in RHEL or CentOS.md similarity index 94% rename from translated/tech/20140818 Disable reboot using Ctrl-Alt-Del Keys in RHEL or CentOS.md rename to published/20140818 Disable reboot using Ctrl-Alt-Del Keys in RHEL or CentOS.md index f95f9d4eb4..0efa52c08e 100644 --- a/translated/tech/20140818 Disable reboot using Ctrl-Alt-Del Keys in RHEL or CentOS.md +++ b/published/20140818 Disable reboot using Ctrl-Alt-Del Keys in RHEL or CentOS.md @@ -1,4 +1,4 @@ -在RHEL / CentOS下停用按下Ctrl-Alt-Del 重启系统的功能 +在RHEL/CentOS 5/6下停用按下Ctrl-Alt-Del 重启系统的功能 ================================================================================ 在Linux里,由于对安全的考虑,我们允许任何人按下**Ctrl-Alt-Del**来**重启**系统。但是在生产环境中,应该停用按下Ctrl-Alt-Del 重启系统的功能。 @@ -37,7 +37,7 @@ via: http://www.linuxtechi.com/disable-reboot-using-ctrl-alt-del-keys/ 作者:[Pradeep Kumar][a] 译者:[2q1w2007](https://github.com/2q1w2007) -校对:[校对者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/20140818 How to configure Access Control Lists (ACLs) on Linux.md b/published/20140818 How to configure Access Control Lists (ACLs) on Linux.md similarity index 72% rename from translated/tech/20140818 How to configure Access Control Lists (ACLs) on Linux.md rename to published/20140818 How to configure Access Control Lists (ACLs) on Linux.md index bac19246bd..c960731533 100644 --- a/translated/tech/20140818 How to configure Access Control Lists (ACLs) on Linux.md +++ b/published/20140818 How to configure Access Control Lists (ACLs) on Linux.md @@ -1,8 +1,8 @@ -配置Linux访问控制列表(ACL) +配置 Linux 的访问控制列表(ACL) ================================================================================ -使用拥有权限控制的Liunx,工作是一件轻松的任务。它可以定义任何user,group和other的权限。无论是在桌面电脑或者不会有很多用户的虚拟Linux实例,或者当用户不愿意分享他们之间的文件时,这样的工作是很棒的。然而,如果你是在一个大型组织,你运行了NFS或者Samba服务给不同的用户。然后你将会需要灵活的挑选并设置很多复杂的配置和权限去满足你的组织不同的需求。 +使用拥有权限控制的Liunx,工作是一件轻松的任务。它可以定义任何user,group和other的权限。无论是在桌面电脑或者不会有很多用户的虚拟Linux实例,或者当用户不愿意分享他们之间的文件时,这样的工作是很棒的。然而,如果你是在一个大型组织,你运行了NFS或者Samba服务给不同的用户,然后你将会需要灵活的挑选并设置很多复杂的配置和权限去满足你的组织不同的需求。 -Linux(和其他Unix,兼容POSIX的)所以拥有访问控制列表(ACL),它是一种分配权限之外的普遍范式。例如,默认情况下你需要确认3个权限组:owner,group和other。使用ACL,你可以增加权限给其他用户或组别,而不单只是简单的"other"或者是拥有者不存在的组别。可以允许指定的用户A、B、C拥有写权限而不再是让他们整个组拥有写权限。 +Linux(和其他Unix等POSIX兼容的操作系统)有一种被称为访问控制列表(ACL)的权限控制方法,它是一种权限分配之外的普遍范式。例如,默认情况下你需要确认3个权限组:owner、group和other。而使用ACL,你可以增加权限给其他用户或组别,而不单只是简单的"other"或者是拥有者不存在的组别。可以允许指定的用户A、B、C拥有写权限而不再是让他们整个组拥有写权限。 ACL支持多种Linux文件系统,包括ext2, ext3, ext4, XFS, Btfrs, 等。如果你不确定你的文件系统是否支持ACL,请参考文档。 @@ -32,15 +32,15 @@ Archlinux 中: ![](https://farm4.staticflickr.com/3859/14768099340_eab7b53e28_z.jpg) -你可以注意到,我的root分区中ACL属性已经开启。万一你没有开启,你需要编辑/etc/fstab文件。增加acl标记,在你需要开启ACL的分区之前。 +你可以注意到,我的root分区中ACL属性已经开启。万一你没有开启,你需要编辑/etc/fstab文件,在你需要开启ACL的分区的选项前增加acl标记。 ![](https://farm6.staticflickr.com/5566/14931771056_b48d5daae2_z.jpg) -现在我们需要重新挂载分区(我喜欢完全重启,因为我不想丢掉数据),如果你对任何分区开启ACL,你必须也重新挂载它。 +现在我们需要重新挂载分区(我喜欢完全重启,因为我不想丢失数据),如果你对其它分区开启ACL,你必须也重新挂载它。 $ sudo mount / -o remount -令人敬佩!现在我们已经在我们的系统中开启ACL,让我们开始和它一起工作。 +干的不错!现在我们已经在我们的系统中开启ACL,让我们开始和它一起工作。 ### ACL 范例 ### @@ -54,7 +54,6 @@ Archlinux 中: 我想要分享这个目录给其他两个用户test和test2,一个拥有完整权限,另一个只有读权限。 -First, to set ACLs for user test: 首先,为用户test设置ACL: $ sudo setfacl -m u:test:rwx /shared @@ -84,7 +83,7 @@ First, to set ACLs for user test: ![](https://farm6.staticflickr.com/5591/14768099389_9a7f3a6bf2_z.jpg) -你可以注意到,正常权限后多一个+标记。这表示ACL已经设置成功。为了真正读取ACL,我们需要运行: +你可以注意到,正常权限后多一个+标记。这表示ACL已经设置成功。要具体看一下ACL,我们需要运行: $ sudo getfacl /shared @@ -102,11 +101,11 @@ First, to set ACLs for user test: ![](https://farm4.staticflickr.com/3863/14768099130_a7d175f067_z.jpg) -最后一件事。在设置了ACL文件或目录工作时,cp和mv命令会改变这些设置。在cp的情况下,需要添加“p”参数来复制ACL设置。如果这不可行,它将会展示一个警告。mv默认移动ACL设置,如果这也不可行,它也会向您展示一个警告。 +最后,在设置了ACL文件或目录工作时,cp和mv命令会改变这些设置。在cp的情况下,需要添加“p”参数来复制ACL设置。如果这不可行,它将会展示一个警告。mv默认移动ACL设置,如果这也不可行,它也会向您展示一个警告。 ### 总结 ### -使用ACL给了在你想要分享的文件上巨大的权利和控制,特别是在NFS/Samba服务。此外,如果你的主管共享主机,这个工具是必备的。 +使用ACL让在你想要分享的文件上拥有更多的能力和控制,特别是在NFS/Samba服务。此外,如果你的主管共享主机,这个工具是必备的。 -------------------------------------------------------------------------------- @@ -114,7 +113,7 @@ via: http://xmodulo.com/2014/08/configure-access-control-lists-acls-linux.html 作者:[Christopher Valerio][a] 译者:[VicYu](http://www.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/20140822 15 Practical Examples of 'echo' command in Linux.md b/published/20140822 15 Practical Examples of 'echo' command in Linux.md similarity index 73% rename from translated/tech/20140822 15 Practical Examples of 'echo' command in Linux.md rename to published/20140822 15 Practical Examples of 'echo' command in Linux.md index 6b906232b1..b5898209e7 100644 --- a/translated/tech/20140822 15 Practical Examples of 'echo' command in Linux.md +++ b/published/20140822 15 Practical Examples of 'echo' command in Linux.md @@ -1,15 +1,16 @@ -Linux中15个‘echo’ 实例 +Linux中的15个‘echo’ 命令实例 ================================================================================ **echo**是一种最常用的与广泛使用的内置于Linux的bash和C shell的命令,通常用在脚本语言和批处理文件中来在标准输出或者文件中显示一行文本或者字符串。 ![echo command examples](http://www.tecmint.com/wp-content/uploads/2014/08/echo-command.png) + echo命令例子 echo命令的语法是: echo [选项] [字符串] -**1.** 输入一行文本并显示在标准输出上 +###**1.** 输入一行文本并显示在标准输出上 $ echo Tecmint is a community of Linux Nerds @@ -17,7 +18,9 @@ echo命令的语法是: Tecmint is a community of Linux Nerds -**2.** 声明一个变量并输出它的值。比如,声明变量**x**并给它赋值为**10**。 +###**2.** 输出一个声明的变量值 + +比如,声明变量**x**并给它赋值为**10**。 $ x=10 @@ -27,15 +30,20 @@ echo命令的语法是: The value of variable x = 10 -**注意:** Linux中的选项‘**-e**‘扮演了转义字符反斜线的翻译器。 -**3.** 使用‘**\b**‘选项- ‘**-e**‘后带上'\b'会删除字符间的所有空格。 +###**3.** 使用‘**\b**‘选项 + +‘**-e**‘后带上'\b'会删除字符间的所有空格。 + +**注意:** Linux中的选项‘**-e**‘扮演了转义字符反斜线的翻译器。 $ echo -e "Tecmint \bis \ba \bcommunity \bof \bLinux \bNerds" TecmintisacommunityofLinuxNerds -**4.** 使用‘**\n**‘选项- ‘**-e**‘后面的带上‘\n’行会在遇到的地方作为新的一行 +###**4.** 使用‘**\n**‘选项 + +‘**-e**‘后面的带上‘\n’行会在遇到的地方作为新的一行 $ echo -e "Tecmint \nis \na \ncommunity \nof \nLinux \nNerds" @@ -47,13 +55,15 @@ echo命令的语法是: Linux Nerds -**5.** 使用‘**\t**‘选项 - ‘**-e**‘后面跟上‘\t’会在空格间加上水平制表符。 +###**5.** 使用‘**\t**‘选项 + +‘**-e**‘后面跟上‘\t’会在空格间加上水平制表符。 $ echo -e "Tecmint \tis \ta \tcommunity \tof \tLinux \tNerds" Tecmint is a community of Linux Nerds -**6.** 也可以同时使用换行‘**\n**‘与水平制表符‘**\t**‘。 +###**6.** 也可以同时使用换行‘**\n**‘与水平制表符‘**\t**‘ $ echo -e "\n\tTecmint \n\tis \n\ta \n\tcommunity \n\tof \n\tLinux \n\tNerds" @@ -65,7 +75,9 @@ echo命令的语法是: Linux Nerds -**7.** 使用‘**\v**‘选项 - ‘**-e**‘后面跟上‘\v’会加上垂直制表符。 +###**7.** 使用‘**\v**‘选项 + +‘**-e**‘后面跟上‘\v’会加上垂直制表符。 $ echo -e "\vTecmint \vis \va \vcommunity \vof \vLinux \vNerds" @@ -77,7 +89,7 @@ echo命令的语法是: Linux Nerds -**8.** 也可以同时使用换行‘**\n**‘与垂直制表符‘**\v**‘。 +###**8.** 也可以同时使用换行‘**\n**‘与垂直制表符‘**\v**‘ $ echo -e "\n\vTecmint \n\vis \n\va \n\vcommunity \n\vof \n\vLinux \n\vNerds" @@ -98,43 +110,51 @@ echo命令的语法是: **注意:** 你可以按照你的需求连续使用两个或者多个垂直制表符,水平制表符与换行符。 -**9.** 使用‘**\r**‘选项 - ‘**-e**‘后面跟上‘\r’来指定输出中的回车符。 +###**9.** 使用‘**\r**‘选项 + +‘**-e**‘后面跟上‘\r’来指定输出中的回车符。(LCTT 译注:会覆写行开头的字符) $ echo -e "Tecmint \ris a community of Linux Nerds" is a community of Linux Nerds -**10.** 使用‘**\c**‘选项 - ‘**-e**‘后面跟上‘\c’会抑制输出后面的字符并且最后不会换新行。 +###**10.** 使用‘**\c**‘选项 + +‘**-e**‘后面跟上‘\c’会抑制输出后面的字符并且最后不会换新行。 $ echo -e "Tecmint is a community \cof Linux Nerds" Tecmint is a community @tecmint:~$ -**11.** ‘**-n**‘会在echo完后不会输出新行。 +###**11.** ‘**-n**‘会在echo完后不会输出新行 $ echo -n "Tecmint is a community of Linux Nerds" Tecmint is a community of Linux Nerds@tecmint:~/Documents$ -**12.** 使用‘**\c**‘选项 - ‘**-e**‘后面跟上‘\a’选项会听到声音警告。 +###**12.** 使用‘**\a**‘选项 + +‘**-e**‘后面跟上‘\a’选项会听到声音警告。 $ echo -e "Tecmint is a community of \aLinux Nerds" Tecmint is a community of Linux Nerds -**注意:** 在你开始前,请先检查你的音量键。 +**注意:** 在你开始前,请先检查你的音量设置。 -**13.** 使用echo命令打印所有的文件和文件夹(ls命令的替代)。 +###**13.** 使用echo命令打印所有的文件和文件夹(ls命令的替代) $ echo * 103.odt 103.pdf 104.odt 104.pdf 105.odt 105.pdf 106.odt 106.pdf 107.odt 107.pdf 108a.odt 108.odt 108.pdf 109.odt 109.pdf 110b.odt 110.odt 110.pdf 111.odt 111.pdf 112.odt 112.pdf 113.odt linux-headers-3.16.0-customkernel_1_amd64.deb linux-image-3.16.0-customkernel_1_amd64.deb network.jpeg -**14.** 打印制定的文件类型。比如,让我们假设你想要打印所有的‘**.jpeg**‘文件,使用下面的命令。 +###**14.** 打印制定的文件类型 + +比如,让我们假设你想要打印所有的‘**.jpeg**‘文件,使用下面的命令。 $ echo *.jpeg network.jpeg -**15.** echo可以使用重定向符来输出到一个文件而不是标准输出。 +###**15.** echo可以使用重定向符来输出到一个文件而不是标准输出 $ echo "Test Page" > testpage @@ -142,7 +162,7 @@ echo命令的语法是: avi@tecmint:~$ cat testpage Test Page -### echo 选项 ### +### echo 选项列表 ### @@ -187,14 +207,15 @@ echo命令的语法是:
-就是这些了,不要忘记在下面留下你有价值的反馈。 +就是这些了,不要忘记在下面留下你的反馈。 + -------------------------------------------------------------------------------- via: http://www.tecmint.com/echo-command-in-linux/ 作者:[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中国](http://linux.cn/) 荣誉推出 diff --git a/translated/tech/20140825 Linux FAQs with Answers--How to install Shutter on CentOS.md b/published/20140825 Linux FAQs with Answers--How to install Shutter on CentOS.md similarity index 74% rename from translated/tech/20140825 Linux FAQs with Answers--How to install Shutter on CentOS.md rename to published/20140825 Linux FAQs with Answers--How to install Shutter on CentOS.md index ca52077ab0..2f84ed9a8d 100644 --- a/translated/tech/20140825 Linux FAQs with Answers--How to install Shutter on CentOS.md +++ b/published/20140825 Linux FAQs with Answers--How to install Shutter on CentOS.md @@ -1,9 +1,10 @@ -Linux有问必答——如何在CentOS上安装Shutter +Linux有问必答:如何在CentOS上安装Shutter ================================================================================ > **问题**:我想要在我的CentOS桌面上试试Shutter屏幕截图程序,但是,当我试着用yum来安装Shutter时,它总是告诉我“没有shutter包可用”。我怎样才能在CentOS上安装Shutter啊? [Shutter][1]是一个用于Linux桌面的开源(GPLv3)屏幕截图工具。它打包有大量用户友好的功能,这让它成为Linux中功能最强大的屏幕截图程序之一。你可以用Shutter来捕捉一个规则区域、一个窗口、整个桌面屏幕、或者甚至是来自任意专用地址的一个网页的截图。除此之外,你也可以用它内建的图像编辑器来对捕获的截图进行编辑,应用不同的效果,将图像导出为不同的图像格式(svg,pdf,ps),或者上传图片到公共图像主机或者FTP站点。 -Shutter is not available as a pre-built package on CentOS (as of version 7). Fortunately, there exists a third-party RPM repository called Nux Dextop, which offers Shutter package. So [enable Nux Dextop repository][2] on CentOS. Then use the following command to install Shutter. + +Shutter 在 CentOS (截止至版本 7)上没有预先构建好的软件包。幸运的是,有一个第三方提供的叫做 Nux Dextop 的 RPM 中提供了 Shutter 软件包。 所以在 CentOS 上[启用 Nux Dextop 软件库][2],然后使用下列命令来安装它: $ sudo yum --enablerepo=nux-dextop install shutter @@ -14,9 +15,9 @@ Shutter is not available as a pre-built package on CentOS (as of version 7). For via: http://ask.xmodulo.com/install-shutter-centos.html 译者:[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/) 荣誉推出 [1]:http://shutter-project.org/ -[2]:http://ask.xmodulo.com/enable-nux-dextop-repository-centos-rhel.html +[2]:http://linux.cn/article-3889-1.html diff --git a/translated/tech/20140825 Linux FAQs with Answers--How to show a MAC learning table of Linux bridge.md b/published/20140825 Linux FAQs with Answers--How to show a MAC learning table of Linux bridge.md similarity index 93% rename from translated/tech/20140825 Linux FAQs with Answers--How to show a MAC learning table of Linux bridge.md rename to published/20140825 Linux FAQs with Answers--How to show a MAC learning table of Linux bridge.md index 3cf867ff1b..53a448b51f 100644 --- a/translated/tech/20140825 Linux FAQs with Answers--How to show a MAC learning table of Linux bridge.md +++ b/published/20140825 Linux FAQs with Answers--How to show a MAC learning table of Linux bridge.md @@ -1,4 +1,4 @@ -Linux有问必答——如何显示Linux网桥的MAC学习表 +Linux有问必答:如何显示Linux网桥的MAC学习表 ================================================================================ > **问题**:我想要检查一下我用brctl工具创建的Linux网桥的MAC地址学习状态。请问,我要怎样才能查看Linux网桥的MAC学习表(或者转发表)? @@ -18,6 +18,6 @@ Linux网桥是网桥的软件实现,这是Linux内核的内核部分。与硬 via: http://ask.xmodulo.com/show-mac-learning-table-linux-bridge.html 译者:[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/talk/20140826 Linus Torvalds Promotes Linux for Desktops, Embedded Computing.md b/published/20140826 Linus Torvalds Promotes Linux for Desktops, Embedded Computing.md similarity index 52% rename from translated/talk/20140826 Linus Torvalds Promotes Linux for Desktops, Embedded Computing.md rename to published/20140826 Linus Torvalds Promotes Linux for Desktops, Embedded Computing.md index 90701b54f5..4e7ac1dbc1 100644 --- a/translated/talk/20140826 Linus Torvalds Promotes Linux for Desktops, Embedded Computing.md +++ b/published/20140826 Linus Torvalds Promotes Linux for Desktops, Embedded Computing.md @@ -1,20 +1,20 @@ -Linus Torvalds推动Linux的桌面与嵌入式计算的发展 +Linus Torvalds 希望推动Linux在桌面和嵌入式计算方面共同发展 ================================================================================ -> Linux的内核开发者和开源领袖Linus Torvalds最近表达了关于Linux桌面和嵌入式设备中Linux的未来的看法。 +> Linux的内核开发者和开源领袖Linus Torvalds前一段时间表达了关于Linux桌面和嵌入式设备中Linux的未来的看法。 ![](http://thevarguy.com/site-files/thevarguy.com/files/imagecache/medium_img/uploads/2014/08/linus-torvalds-1.jpg) 什么是Linux桌面和嵌入式设备中Linux的未来?这是个值得讨论的问题,不过Linux的创始人和开源巨人Linus Torvalds在最近一届 [Linux 基金会][1] 的LinuxCon大会上,在一次对话中表达了一些有趣的观点。 -作为敲出第一版Linux内核代码并且在1991年将它们共享在互联网上的家伙,Torvalds毫无疑问是开源软件甚至是任何软件中最著名的开发者,如今他依然活跃在其中。在此期间,Torvalds是许多人和组织中唯一一个引领着Linux发展的个体,它的观点往往能影响着开源社区,而且,作为一个内核开发者的角色赋予了他能决定哪些特点和代码能被放进操作系统内部的强大权利。 +作为敲出第一版Linux内核代码并且在1991年将它们共享在互联网上的家伙,Torvalds毫无疑问是开源软件甚至是所有软件中最著名的开发者,如今他依然活跃在其中。在此期间,Torvalds是许多人和组织中唯一一个引领着Linux发展的个体,它的观点往往能影响着开源社区,而且,作为一个内核开发者的角色赋予了他能决定哪些特点和代码能被放进操作系统内部的强大权利。 -所以说,关注Torvalds所说的话是很值得的, "我还是挺想要桌面的。" [上周他在LinuxCon大会上这样说道][2] 那标志着他仍然着眼于作为使个人机更加强大的操作系统Linux的未来,尽管十年来Linux桌面市场的分享一直很少,而且大部分围绕Linux的商业活动都去涉及服务器或者安卓手机硬件去了。 +所以说,关注Torvalds所说的话是很值得的, "我还是挺想要桌面的。" [他在上月的LinuxCon大会上这样说道][2] 那表明他仍然着眼于作为使PC更加强大的操作系统Linux的未来,尽管十年来Linux桌面市场的份额一直很少,而且大部分围绕Linux的商业活动都去涉及服务器或者安卓手机去了。 -但是,Torvalds还说,确保Linux桌面能有个宏伟的未来意味着解决了受阻的 “基础设施问题”,好像庞大的开源软件生态系统和硬件世界让他充满信心。这不是Linux核心代码本身的问题,而是要让Linux桌面渠道友好,这可能是伟大的Torvalds和他开发同伴们所需要花精力去达到的目标。这取决于app的开发者、硬件制造商和其它有志于实现人们能方便使用基于Linux的计算平台的各方力量。 +但是,Torvalds还说,确保Linux桌面能有个宏伟的未来意味着解决了受阻的 “基础设施问题”,庞大的开源软件生态系统和硬件世界让他充满信心。这不是Linux核心代码本身的问题,而是要让Linux桌面渠道友好,这可能是伟大的Torvalds和他开发同伴们所需要花精力去达到的目标。这取决于app的开发者、硬件制造商和其它有志于实现人们能方便使用基于Linux的计算平台的各方力量。 -另一方面,Torvalds也提到了他的憧憬,就是内核开发者们能简化嵌入式装置中的Linux代码——一个在让内核更加桌面友好化上会导致很多分歧的任务。但这也不一定,因为无论如何,Linux都是以模块化设计的,单内核代码库不能同时满足桌面用户和嵌入式开发者的需求,这是没有道理的,因为这取决于他们使用的模块。 +另一方面,Torvalds也提到了他的憧憬,就是内核开发者们能简化嵌入式装置中的Linux代码——这也许和让Linux内核更加桌面友好化的任务有所分歧。但这也不一定,因为无论如何,Linux都是以模块化设计的,单内核代码库不能同时满足桌面用户和嵌入式开发者的需求,这是没有道理的,因为这取决于他们使用的模块。 -作为一个长时间想看到更多搭载Linux的嵌入式设备出现的Linux桌面用户,我希望Torvalds的所有愿望都可以实现,到那时我就能只用Liunx来做所有我想做的事情,无论是在电脑桌面上、手机上、车上,或者是任何其它的地方。 +作为一个一直想看到更多搭载Linux的嵌入式设备出现的Linux桌面用户,我希望Torvalds的所有愿望都可以实现,到那时我就可以只用Linux来做所有我想做的事情,无论是在电脑桌面上、手机上、车上,或者是任何其它的地方。 -------------------------------------------------------------------------------- @@ -22,7 +22,7 @@ via: http://thevarguy.com/open-source-application-software-companies/082514/linu 作者:[Christopher Tozzi][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/20140902 Mount Google drive in Ubuntu 14.04 LTS.md b/published/20140902 Mount Google drive in Ubuntu 14.04 LTS.md similarity index 82% rename from translated/tech/20140902 Mount Google drive in Ubuntu 14.04 LTS.md rename to published/20140902 Mount Google drive in Ubuntu 14.04 LTS.md index 899b897906..66ebd14a6c 100644 --- a/translated/tech/20140902 Mount Google drive in Ubuntu 14.04 LTS.md +++ b/published/20140902 Mount Google drive in Ubuntu 14.04 LTS.md @@ -1,6 +1,6 @@ -Google drive和Ubuntu 14.04 LTS的胶合 +墙外香花:Google drive和Ubuntu 14.04 LTS的胶合 ================================================================================ -Google尚未发布其**官方Linux客户端**,以用于从Ubuntu访问其drive。然开源社区却业已开发完毕非官方之软件包‘**grive-tools**’。 +Google尚未发布用于从Ubuntu访问其drive的**官方Linux客户端**。然开源社区却业已开发完毕非官方之软件包‘**grive-tools**’。 Grive乃是Google Drive(**在线存储服务**)的GNU/Linux系统客户端,允许你**同步**所选目录到云端,以及上传新文件到Google Drive。 @@ -22,7 +22,7 @@ Grive乃是Google Drive(**在线存储服务**)的GNU/Linux系统客户端 **步骤:1** 安装完了,通过输入**Grive**在**Unity Dash**搜索应用,并打开之。 -![](http://www.linuxtechi.com/wp-content/uploads/2014/09/access-grive-setup.png) +![](http://www.linuxtechi.com/wp-content/uploads/2014/09/access-grive-setup-1.jpg) **步骤:2** 登入google drive,你将被问及访问google drive的权限。 @@ -36,25 +36,25 @@ Grive乃是Google Drive(**在线存储服务**)的GNU/Linux系统客户端 **步骤:3** 下面将提供给你一个 **google代码**,复制并粘贴到**Grive设置框**内。 -![](http://www.linuxtechi.com/wp-content/uploads/2014/09/gdrive-code.png) +![](http://www.linuxtechi.com/wp-content/uploads/2014/09/gdrive-code-1.jpg) -![](http://www.linuxtechi.com/wp-content/uploads/2014/09/code-in-grive.png) +![](http://www.linuxtechi.com/wp-content/uploads/2014/09/code-in-grive-1.jpg) 点击下一步后,将会开始同步google drive到你**家目录**下的‘**Google Drive**’文件夹。完成后,将出现如下窗口。 ![](http://www.linuxtechi.com/wp-content/uploads/2014/09/grive-installation-completed.png) -Google Drive folder created under **user's home directory** +Google Drive 文件夹会创建在**用户的主目录**下。 -![](http://www.linuxtechi.com/wp-content/uploads/2014/09/google-drive-folder.png) +![](http://www.linuxtechi.com/wp-content/uploads/2014/09/google-drive-folder-1.jpg) -------------------------------------------------------------------------------- via: http://www.linuxtechi.com/mount-google-drive-in-ubuntu/ -作者:[Pradeep Kumar ][a] +作者:[Pradeep Kumar][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/20140902 Photo Editing on Linux with Krita.md b/published/20140902 Photo Editing on Linux with Krita.md new file mode 100644 index 0000000000..3e36fb76ad --- /dev/null +++ b/published/20140902 Photo Editing on Linux with Krita.md @@ -0,0 +1,76 @@ +在 Linux 下用 Krita 进行照片编辑 +================================================================================ +
+
图 1:侏儒山羊 Annabelle
+ +[Krita][1] 是一款很棒的绘图应用,同时也是很不错的照片编辑器。今天我们将学习如何给图片添加文字,以及如何有选择地锐化照片的某一部分。 + +### Krita 简介 ### + +与其他绘图/制图应用类似,Krita 内置了数百种工具和选项,以及多种处理方法。因此它值得我们花点时间来了解一下。 + +Krita 默认使用了暗色主题。我不太喜欢暗色主题,但幸运的是 Krita 还有其他很赞的主题,你可以在任何时候通过菜单里的“设置 > 主题”进行更改。 + +Krita 使用了窗口停靠样式的工具条。如果左右两侧面板的 Dock 工具条没有显示,检查一下“设置 > 显示工具条”选项,你也可以在“设置 > 工具条”中对工具条按你的偏好进行调整。不过隐藏的工具条也许会让你感到一些小小的不快,它们只会在一个狭小的压扁区域展开,你看不见其中的任何东西。你可以拖动它们至顶端或者 Krita 窗口的一侧,放大或者缩小它们,甚至你可以把它们拖到 Krita 外,放在你显示屏的任意位置。如果你把其中一个工具条拖到了另一个工具条上,它们会自动合并成一个工具条。 + +当你配置好比较满意的工作区后,你可以在“选择工作区”内保存它。你可以在笔刷工具条(通过“设置 > 显示工具条”开启显示)的右侧找到“选择工作区”。其中有对工作区的不同配置,当然你也可以创建自己的配置(图 2)。 + +
+
图 2:在“选择工作区”里保存用户定制的工作区。
+ +Krita 中有多重缩放控制方法。Ctrl + “=” 放大,Ctrl + “-” 缩小,Ctrl + “0” 重置为 100% 缩放画面。你也可以通过“视图 > 缩放”,或者右下角的缩放条进行控制。在缩放条的左侧还有一个下拉式的缩放菜单。 + +工具菜单位于窗口左部,其中包含了锐化和选择工具。你必须移动光标到每个工具上,才能查看它的标签。工具选项条总是显示当前正在使用的工具的选项,默认情况下工具选项条位于窗口右部。 + +### 裁切工具 ### + +当然,在工具菜单条中有裁切工具,并且非常易于使用。把你想要选择的区域用矩形圈定,使用拖拽的方式来调整选区,调整完毕后点击返回按钮。在工具选项条中,你可以选择对所有图层应用裁切,还是只对当前图层应用裁切,通过输入具体数值,或者是百分比调整尺寸。 + +### 添加文本 ### + +当你想在照片上添加标签或者说明这类简单文本的时候,Krita 也许会让你眼花缭乱,因为它有太多的艺术字效果可供选择了。但 Krita 同时也支持添加简单的文字。点击文本工具条,你将会看到工具选项条如图 3 那样。 + +
+
图 3:文本选项。
+ +点击展开按钮。这将显示简单文本工具;首先绘制矩形文本框,接着在文本框内输入文字。工具选项条中有所有常用的文本格式选项:文本选择、文本尺寸、文字与背景颜色、边距,以及一系列图形风格。但你处理完文本后点击外观处理工具,外观处理工具的按钮是一个白色的箭头,在文本工具按钮旁边,通过外观处理工具你可以调整文字整体的尺寸、外观还有位置。外观处理工具的工具选项包括多种不同的线条、颜色还有边距。图 4 是我为我那些蜗居在城市里的亲戚们发送的一幅带有愉快标题的照片。 + +
+
图 4:来这绿色农场吧。
+ +如何处理你的照片上已经存在的文字?点击外观处理工具,在文本区域内双击。这将使文本进入编辑模式,从文本框内出现的光标可以看出这一点。现在,你就可以开始选择文字、添加文字、更改格式,等等。 + +### 锐化选区 ### + +外观编辑上,Krita 有许多很棒的工具。在图 5 中我想要锐化 Annabelle 的脸和眼睛。(Annabelle 住在隔壁,但她很喜欢我的狗,在我这里呆了很长一段时间。我的狗却因为害怕她而跑了,但她却一点也不气馁。)首先通过“外形选区”工具选择一个区域。接着打开“滤镜 > 增强 > 虚边蒙板”。你可以调节三个变量:半长值、总量以及阈值。大多数图像编辑软件都有半径、总量和阀值的设置。半径是直径的一半,因此从技术上来说“半长值”是正确的,但却可能造成不必要的混乱。 + +
+
图 5:选取任意的区域进行编辑。
+ +半长值决定了锐化线条的粗细。你需要足够大的数值来产生较好的结果,但很明显,不要过大。 + +阀值决定了锐化时两个像素点之间的效果差异。“0”是锐化的最大值,“99”则表示不进行锐化。 + +总量控制着锐化强度;其值越高锐化程度越高。 + +锐化基本上是你处理照片的最后一步,因为它和你对照片所做的一切处理都有关:裁切、改变尺寸、颜色、色差...如果你先进行锐化再进行其他操作,你的锐化效果将变得一团糟。 + +接着,你要问,“虚化蒙板”是什么意思?这个名字来源于锐化技术:虚化蒙板滤镜在原始图像上覆盖一层模糊的蒙板,接着在上面分层进行虚化蒙板。这将使图像比直接锐化产生更加锐利清晰的效果。 + +今天要说的就这么多。有关 Krita 的资料很多,但比较杂乱。你可以从 [Krita Tutorials][2] 开始学习,也可以在 YouTube 上找寻相关的学习视频。 + +- [krita 官方网站][1] + +-------------------------------------------------------------------------------- + +via: http://www.linux.com/learn/tutorials/786040-photo-editing-on-linux-with-krita + +作者:[Carla Schroder][a] +译者:[SteveArcher](https://github.com/SteveArcher) +校对:[Caroline](https://github.com/carolinewuyan) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://www.linux.com/community/forums/person/3734 +[1]:https://krita.org/ +[2]:https://krita.org/learn/tutorials/ diff --git a/translated/talk/20140904 Making MySQL Better at GitHub.md b/published/20140904 Making MySQL Better at GitHub.md similarity index 76% rename from translated/talk/20140904 Making MySQL Better at GitHub.md rename to published/20140904 Making MySQL Better at GitHub.md index 2efbf9def7..1aeea36c03 100644 --- a/translated/talk/20140904 Making MySQL Better at GitHub.md +++ b/published/20140904 Making MySQL Better at GitHub.md @@ -1,26 +1,26 @@ -优化 GitHub 服务器上的 MySQL 数据库性能 + GitHub 是如何迁移 MySQL 集群的 ================================================================================ > 在 GitHub 我们总是说“如果网站响应速度不够快,我们就不应该让它上线运营”。我们之前在[前端的体验速度][1]这篇文章中介绍了一些提高网站响应速率的方法,但这只是故事的一部分。真正影响到 GitHub.com 性能的因素是 MySQL 数据库架构。让我们来瞧瞧我们的基础架构团队是如何无缝升级了 MySQL 架构吧,这事儿发生在去年8月份,成果就是大大提高了 GitHub 网站的速度。 ### 任务 ### -去年我们把 GitHub 上的大部分数据移到了新的数据中心,这个中心有世界顶级的硬件资源和网络平台。自从使用了 MySQL 作为我们的后端基本存储系统,我们一直期望着一些改进来大大提高数据库性能,但是在数据中心使用全新的硬件来部署一套全新的集群环境并不是一件简单的工作,所以我们制定了一套计划和测试工作,以便数据能平滑过渡到新环境。 +去年我们把 GitHub 上的大部分数据移到了新的数据中心,这个中心有世界顶级的硬件资源和网络平台。自从使用了 MySQL 作为我们的后端系统的基础,我们一直期望着一些改进来大大提高数据库性能,但是在数据中心使用全新的硬件来部署一套全新的集群环境并不是一件简单的工作,所以我们制定了一套计划和测试工作,以便数据能平滑过渡到新环境。 ### 准备工作 ### -像我们这种关于架构上的巨大改变,在执行的每一步都需要收集数据指标。新机器上安装好了基础操作系统,接下来就是测试新配置下的各种性能。为了模拟真实的工作负载环境,我们使用 tcpdump 工具从老集群那里复制正在发生的 SELECT 请求,并在新集群上重新响应一遍。 +像我们这种关于架构上的巨大改变,在执行的每一步都需要收集数据指标。新机器上安装好了基本的操作系统,接下来就是测试新配置下的各种性能。为了模拟真实的工作负载环境,我们使用 tcpdump 工具从旧的集群那里复制正在发生的 SELECT 请求,并在新集群上重新回放一遍。 -MySQL 微调是个繁琐的细致活,像众所周知的 innodb_buffer_pool_size 这个参数往往能对 MySQL 性能产生巨大的影响。对于这类参数,我们必须考虑在内,所以我们列了一份参数清单,包括 innodb_thread_concurrency,innodb_io_capacity,和 innodb_buffer_pool_instances,还有其它的。 +MySQL 调优是个繁琐的细致活,像众所周知的 innodb_buffer_pool_size 这个参数往往能对 MySQL 性能产生巨大的影响。对于这类参数,我们必须考虑在内,所以我们列了一份参数清单,包括 innodb_thread_concurrency,innodb_io_capacity,和 innodb_buffer_pool_instances,还有其它的。 在每次测试中,我们都很小心地只改变一个参数,并且让一次测试至少运行12小时。我们会观察响应时间的变化曲线,每秒的响应次数,以及有可能会导致并发性降低的参数。我们使用 “SHOW ENGINE INNODB STATUS” 命令打印 InnoDB 性能信息,特别观察了 “SEMAPHORES” 一节的内容,它为我们提供了工作负载的状态信息。 -当我们在设置参数后对运行结果感到满意,然后就开始将我们最大的一个数据表格迁移到一套独立的集群上,这个步骤作为整个迁移过程的早期测试,保证我们的核心集群空出更多的缓存池空间,并且为故障切换和存储功能提供更强的灵活性。这步初始迁移方案也引入了一个有趣的挑战:我们必须维持多条客户连接,并且要将这些连接重定向到正确的集群上。 +当我们在设置参数后对运行结果感到满意,然后就开始将我们最大的数据表格之一迁移到一套独立的集群上,这个步骤作为整个迁移过程的早期测试,以保证我们的核心集群有更多的缓存池空间,并且为故障切换和存储功能提供更强的灵活性。这步初始迁移方案也引入了一个有趣的挑战:我们必须维持多条客户连接,并且要将这些连接指向到正确的集群上。 除了硬件性能的提升,还需要补充一点,我们同时也对处理进程和拓扑结构进行了改进:我们添加了延时拷贝技术,更快、更高频地备份数据,以及更多的读拷贝空间。这些功能已经准备上线。 ### 列出任务清单,三思后行 ### -每天有上百万用户的使用 GitHub.com,我们不可能有机会进行实际意义上的数据切换。我们有一个详细的[任务清单][2]来执行迁移: +每天有上百万用户的使用 GitHub.com,我们不可能有机会等没有人用了才进行实际数据切换。我们有一个详细的[任务清单][2]来执行迁移: ![](https://cloud.githubusercontent.com/assets/1155781/4116929/13fc6f50-328b-11e4-837b-922aad3055a8.png) @@ -28,7 +28,7 @@ MySQL 微调是个繁琐的细致活,像众所周知的 innodb_buffer_pool_siz ### 迁移时间到 ### -太平洋时间星期六上午5点,我们的迁移团队上线集合聊天,同时数据迁移正式开始: +太平洋时间星期六上午5点,我们的迁移团队上线集合对话,同时数据迁移正式开始: ![](https://cloud.githubusercontent.com/assets/1155781/4060850/39f52cd4-2df3-11e4-9aca-1f54a4870d24.png) @@ -40,7 +40,7 @@ MySQL 微调是个繁琐的细致活,像众所周知的 innodb_buffer_pool_siz ![](https://cloud.githubusercontent.com/assets/1155781/4060870/6a4c0060-2df3-11e4-8dab-654562fe628d.png) -然后我们让 GitHub.com 脱离维护期,并且让全世界的用户都知道我们的最新状态: +然后我们让 GitHub.com 脱离维护模式,并且让全世界的用户都知道我们的最新状态: ![](https://cloud.githubusercontent.com/assets/1155781/4060878/79b9884c-2df3-11e4-98ed-d11818c8915a.png) @@ -56,7 +56,7 @@ MySQL 微调是个繁琐的细致活,像众所周知的 innodb_buffer_pool_siz #### 功能划分 #### -在迁移过程中,我们采用了一个比较好的方法是:将大的数据表(主要记录了一些历史数据)先迁移过去,空出旧集群的磁盘空间和缓存池空间。这一步给我们留下了更过的资源用户维护“热”数据,将一些连接请求分离到多套集群里面。这步为我们之后的胜利奠定了基础,我们以后还会使用这种模式来进行迁移工作。 +在迁移过程中,我们采用了一个比较好的方法是:将大的数据表(主要记录了一些历史数据)先迁移过去,空出旧集群的磁盘空间和缓存池空间。这一步给我们留下了更多的资源用于“热”数据,将一些连接请求分离到多套集群里面。这步为我们之后的胜利奠定了基础,我们以后还会使用这种模式来进行迁移工作。 #### 测试测试测试 #### @@ -68,11 +68,11 @@ MySQL 微调是个繁琐的细致活,像众所周知的 innodb_buffer_pool_siz 团队成员地图: -![](https://render.githubusercontent.com/view/geojson?url=https://gist.githubusercontent.com/anonymous/5fa29a7ccbd0101630da/raw/map.geojson) +https://render.githubusercontent.com/view/geojson?url=https://gist.githubusercontent.com/anonymous/5fa29a7ccbd0101630da/raw/map.geojson 本次合作新创了一种工作流程:我们提交更改(pull request),获取实时反馈,查看修改了错误的 commit —— 全程没有电话交流或面对面的会议。当所有东西都可以通过 URL 提供信息,不同区域的人群之间的交流和反馈会变得非常简单。 -### 一年后。。。 ### +### 一年后…… ### 整整一年时间过去了,我们很高兴地宣布这次数据迁移是很成功的 —— MySQL 性能和可靠性一直处于我们期望的状态。另外,新的集群还能让我们进一步去升级,提供更好的可靠性和响应时间。我将继续记录这些优化过程。 @@ -82,7 +82,7 @@ via: https://github.com/blog/1880-making-mysql-better-at-github 作者:[samlambert][a] 译者:[bazz2](https://github.com/bazz2) -校对:[校对者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/20140910 How To Recover Default Openbox Config Files On Crunchbang.md b/published/20140910 How To Recover Default Openbox Config Files On Crunchbang.md similarity index 82% rename from translated/tech/20140910 How To Recover Default Openbox Config Files On Crunchbang.md rename to published/20140910 How To Recover Default Openbox Config Files On Crunchbang.md index 942a23037d..579b45bd10 100644 --- a/translated/tech/20140910 How To Recover Default Openbox Config Files On Crunchbang.md +++ b/published/20140910 How To Recover Default Openbox Config Files On Crunchbang.md @@ -1,4 +1,4 @@ -如何在Crunchbang下回复Openbox的默认配置 +如何在Crunchbang下恢复Openbox的默认配置 ================================================================================ [CrunchBang][1]是一个很好地融合了速度、风格和内容的基于Debian GNU/Linux的发行版。使用了灵活的Openbox窗口管理器,高度定制化并且提供了一个现代、全功能的GNU/Linux系统而没有牺牲性能。 @@ -6,7 +6,7 @@ Crunchbang是高度自定义的,用户可以尽情地地把它调整成他们 ![](http://180016988.r.cdn77.net/wp-content/uploads/2014/09/curnchbang_menu_xml.png) -其中从菜单配置文件中去除了所有代码。由于我没有备份(最好备份配置文件)。我不得不搜索Crunchbang开箱即用的默认配置。这里就是我如何修复的过程,要感谢Crunchbang论坛。 +我的菜单配置文件中丢失了所有内容。由于我没有备份(最好备份配置文件)。我不得不搜索Crunchbang安装后的默认配置。这里就是我如何修复的过程,这里要感谢Crunchbang论坛。 了解所有为你预备份的默认配置是很有趣的,你可以在这里找到: @@ -30,7 +30,7 @@ via: http://www.unixmen.com/recover-default-openbox-config-files-crunchbang/ 作者:[Enock Seth Nyamador][a] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 diff --git a/translated/tech/20140915 Linux FAQs with Answers--How to capture TCP SYN, ACK and FIN packets with tcpdump.md b/published/20140915 Linux FAQs with Answers--How to capture TCP SYN, ACK and FIN packets with tcpdump.md similarity index 81% rename from translated/tech/20140915 Linux FAQs with Answers--How to capture TCP SYN, ACK and FIN packets with tcpdump.md rename to published/20140915 Linux FAQs with Answers--How to capture TCP SYN, ACK and FIN packets with tcpdump.md index f0f638a7cd..8887a0a057 100644 --- a/translated/tech/20140915 Linux FAQs with Answers--How to capture TCP SYN, ACK and FIN packets with tcpdump.md +++ b/published/20140915 Linux FAQs with Answers--How to capture TCP SYN, ACK and FIN packets with tcpdump.md @@ -1,8 +1,8 @@ -Linux有问必答——如何使用tcpdump来捕获TCP SYN,ACK和FIN包 +Linux有问必答:如何使用tcpdump来捕获TCP SYN,ACK和FIN包 ================================================================================ > **问题**:我想要监控TCP连接活动(如,建立连接的三次握手,以及断开连接的四次握手)。要完成此事,我只需要捕获TCP控制包,如SYN,ACK或FIN标记相关的包。我怎样使用tcpdump来仅仅捕获TCP SYN,ACK和/或FYN包? -作为事实上的捕获工具,tcpdump提供了强大而又灵活的包过滤功能。作为tcpdump基础的libpcap包捕获引擎支持标准的包过滤规则,如基于5重包头的过滤(如基于源/目的IP地址/端口和IP协议类型)。 +作为业界标准的捕获工具,tcpdump提供了强大而又灵活的包过滤功能。作为tcpdump基础的libpcap包捕获引擎支持标准的包过滤规则,如基于5重包头的过滤(如基于源/目的IP地址/端口和IP协议类型)。 tcpdump/libpcap的包过滤规则也支持更多通用分组表达式,在这些表达式中,包中的任意字节范围都可以使用关系或二进制操作符进行检查。对于字节范围表达,你可以使用以下格式: @@ -34,8 +34,8 @@ tcpdump/libpcap的包过滤规则也支持更多通用分组表达式,在这 via: http://ask.xmodulo.com/capture-tcp-syn-ack-fin-packets-tcpdump.html -作者:[作者名][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/20140915 Linux FAQs with Answers--How to change hostname on CentOS or RHEL 7.md b/published/20140915 Linux FAQs with Answers--How to change hostname on CentOS or RHEL 7.md similarity index 68% rename from translated/tech/20140915 Linux FAQs with Answers--How to change hostname on CentOS or RHEL 7.md rename to published/20140915 Linux FAQs with Answers--How to change hostname on CentOS or RHEL 7.md index 5c02aebbfe..fd680ad8c6 100644 --- a/translated/tech/20140915 Linux FAQs with Answers--How to change hostname on CentOS or RHEL 7.md +++ b/published/20140915 Linux FAQs with Answers--How to change hostname on CentOS or RHEL 7.md @@ -1,8 +1,8 @@ -Linux有问必答——如何在CentOS或RHEL 7上修改主机名 +Linux有问必答:如何在CentOS或RHEL 7上修改主机名 ================================================================================ > 问题:在CentOS/RHEL 7上修改主机名的正确方法是什么(永久或临时)? -在CentOS或RHEL中,有三种定义的主机名:(1)静态的(2)瞬态的,以及(3)灵活的。“静态”主机名也称为内核主机名,是系统在启动时从/etc/hostname自动初始化的主机名。“瞬态”主机名是在系统运行时临时分配的主机名,例如,通过DHCP或mDNS服务器分配。静态主机名和瞬态主机名都遵从作为互联网域名同样的字符限制规则。而另一方面,“灵活”主机名则允许使用自由形式(包括特殊/空白字符)的主机名,以展示给终端用户(如Dan's Computer)。 +在CentOS或RHEL中,有三种定义的主机名:a、静态的(static),b、瞬态的(transient),以及 c、灵活的(pretty)。“静态”主机名也称为内核主机名,是系统在启动时从/etc/hostname自动初始化的主机名。“瞬态”主机名是在系统运行时临时分配的主机名,例如,通过DHCP或mDNS服务器分配。静态主机名和瞬态主机名都遵从作为互联网域名同样的字符限制规则。而另一方面,“灵活”主机名则允许使用自由形式(包括特殊/空白字符)的主机名,以展示给终端用户(如Dan's Computer)。 在CentOS/RHEL 7中,有个叫hostnamectl的命令行工具,它允许你查看或修改与主机名相关的配置。 @@ -22,7 +22,7 @@ Linux有问必答——如何在CentOS或RHEL 7上修改主机名 ![](https://farm4.staticflickr.com/3855/15113489172_4e25ac87fa_z.jpg) -就像上面展示的那样,在修改静态/瞬态主机名时,任何特殊字符或空白字符会被移除,而提供的参数中的任何大写字母会自动转化为小写。一旦修改了静态主机名,/etc/hostname将被自动更新。然而,/etc/hosts不会更新来回应所做的修改,所以你需要手动更新/etc/hosts。 +就像上面展示的那样,在修改静态/瞬态主机名时,任何特殊字符或空白字符会被移除,而提供的参数中的任何大写字母会自动转化为小写。一旦修改了静态主机名,/etc/hostname 将被自动更新。然而,/etc/hosts 不会更新以保存所做的修改,所以你需要手动更新/etc/hosts。 如果你只想修改特定的主机名(静态,瞬态或灵活),你可以使用“--static”,“--transient”或“--pretty”选项。 diff --git a/translated/tech/20140915 Linux FAQs with Answers--How to create a new Amazon AWS access key.md b/published/20140915 Linux FAQs with Answers--How to create a new Amazon AWS access key.md similarity index 95% rename from translated/tech/20140915 Linux FAQs with Answers--How to create a new Amazon AWS access key.md rename to published/20140915 Linux FAQs with Answers--How to create a new Amazon AWS access key.md index d872155a9c..f716678fb3 100644 --- a/translated/tech/20140915 Linux FAQs with Answers--How to create a new Amazon AWS access key.md +++ b/published/20140915 Linux FAQs with Answers--How to create a new Amazon AWS access key.md @@ -1,4 +1,4 @@ -Linux有问必答——如何创建新的亚马逊AWS访问密钥 +Linux有问必答:如何创建新的亚马逊AWS访问密钥 ================================================================================ > **问题**:我在配置一个需要访问我的亚马逊AWS帐号的应用时被要求提供**AWS访问密钥ID**和**秘密访问密钥**,我怎样创建一个新的AWS访问密钥呢? @@ -42,7 +42,7 @@ IAM是一个web服务,它允许一个公司管理多个用户及其与一个AW via: http://ask.xmodulo.com/create-amazon-aws-access-key.html 译者:[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/20140915 Linux FAQs with Answers--How to remove PPA repository from command line on Ubuntu.md b/published/20140915 Linux FAQs with Answers--How to remove PPA repository from command line on Ubuntu.md similarity index 73% rename from translated/tech/20140915 Linux FAQs with Answers--How to remove PPA repository from command line on Ubuntu.md rename to published/20140915 Linux FAQs with Answers--How to remove PPA repository from command line on Ubuntu.md index 6698a8677b..e7171b6c3d 100644 --- a/translated/tech/20140915 Linux FAQs with Answers--How to remove PPA repository from command line on Ubuntu.md +++ b/published/20140915 Linux FAQs with Answers--How to remove PPA repository from command line on Ubuntu.md @@ -1,15 +1,14 @@ -Linux FAQ - Ubuntu如何使用命令行移除PPA仓库 +Linux有问必答:Ubuntu如何使用命令行移除PPA仓库 ================================================================================ > **问题**: 前段时间,我的Ubuntu增加了一个第三方的PPA仓库,如何才能移除这个PPA仓库呢? 个人软件包档案(PPA)是Ubuntu独有的解决方案,允许独立开发者和贡献者构建、贡献任何定制的软件包来作为通过启动面板的第三方APT仓库。如果你是Ubuntu用户,有可能你已经增加一些流行的第三方PPA仓库到你的Ubuntu系统。如果你需要删除掉已经预先配置好的PPA仓库,下面将教你怎么做。 - -假如你有一个第三方PPA仓库叫“ppa:webapps/preview”增加到了你的系统中,如下。 +假如你想增加一个叫“ppa:webapps/preview”第三方PPA仓库到你的系统中,如下: $ sudo add-apt-repository ppa:webapps/preview -如果你想要 **单独地删除一个PPA仓库**,运行下面的命令。 +如果你想要 **单独地删除某个PPA仓库**,运行下面的命令: $ sudo add-apt-repository --remove ppa:someppa/ppa @@ -17,22 +16,22 @@ Linux FAQ - Ubuntu如何使用命令行移除PPA仓库 如果你想要 **完整的删除一个PPA仓库并包括来自这个PPA安装或更新过的软件包**,你需要ppa-purge命令。 -安装ppa-purge软件包: +首先要安装ppa-purge软件包: $ sudo apt-get install ppa-purge -删除PPA仓库和与之相关的软件包,运行下列命令: +然后使用如下命令删除PPA仓库和与之相关的软件包: $ sudo ppa-purge ppa:webapps/preview -特别滴,在发行版更新后,你需要[分辨和清除已损坏的PPA仓库][1],这个方法特别有用! +特别滴,在发行版更新后,当你[分辨和清除已损坏的PPA仓库][1]时这个方法特别有用! -------------------------------------------------------------------------------- via: http://ask.xmodulo.com/how-to-remove-ppa-repository-from-command-line-on-ubuntu.html 译者:[Vic___](http://www.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/20140919 Linux FAQs with Answers--How to create a MySQL database from the command line.md b/published/20140919 Linux FAQs with Answers--How to create a MySQL database from the command line.md similarity index 95% rename from translated/tech/20140919 Linux FAQs with Answers--How to create a MySQL database from the command line.md rename to published/20140919 Linux FAQs with Answers--How to create a MySQL database from the command line.md index f2c7e3186a..1db2425acc 100644 --- a/translated/tech/20140919 Linux FAQs with Answers--How to create a MySQL database from the command line.md +++ b/published/20140919 Linux FAQs with Answers--How to create a MySQL database from the command line.md @@ -1,4 +1,4 @@ -数据库常见问题答案--如何使用命令行创建一个MySQL数据库 +Linux有问必答:如何在命令行创建一个MySQL数据库 === > **问题**:在一个某处运行的MySQL服务器上,我该怎样通过命令行创建和安装一个MySQL数据库呢? @@ -47,8 +47,8 @@ 为了达到演示的目的,我们将会创建一个叫做posts_tbl的表,表里会存储关于文章的如下信息: - 文章的标题 -- 作者的第一个名字 -- 作者的最后一个名字 +- 作者的名字 +- 作者的姓 - 文章可用或者不可用 - 文章创建的日期 @@ -104,7 +104,7 @@ via: http://ask.xmodulo.com/create-mysql-database-command-line.html 译者:[su-kaiyao](https://github.com/su-kaiyao) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linu x中国](http://linux.cn/) 荣誉推出 diff --git a/translated/tech/20140925 Linux FAQs with Answers--How to catch and handle a signal in Perl.md b/published/20140925 Linux FAQs with Answers--How to catch and handle a signal in Perl.md similarity index 51% rename from translated/tech/20140925 Linux FAQs with Answers--How to catch and handle a signal in Perl.md rename to published/20140925 Linux FAQs with Answers--How to catch and handle a signal in Perl.md index 4e6f628416..80272c60a0 100644 --- a/translated/tech/20140925 Linux FAQs with Answers--How to catch and handle a signal in Perl.md +++ b/published/20140925 Linux FAQs with Answers--How to catch and handle a signal in Perl.md @@ -1,10 +1,10 @@ -Linux 有问必答-- 如何在Perl中捕捉并处理信号 +Linux 有问必答:如何在Perl中捕捉并处理信号 ================================================================================ > **提问**: 我需要通过使用Perl的自定义信号处理程序来处理一个中断信号。在一般情况下,我怎么在Perl程序中捕获并处理各种信号(如INT,TERM)? -作为POSIX标准的异步通知机制,信号由操作系统发送给进程某个事件来通知它。当产生信号时,目标程序的执行是通过操作系统中断,并且该信号被发送到处理该信号的处理程序。任何人可以定义和注册自定义信号处理程序或依赖于默认的信号处理程序。 +作为POSIX标准的异步通知机制,信号由操作系统发送给进程某个事件来通知它。当产生信号时,操作系统会中断目标程序的执行,并且该信号被发送到该程序的信号处理函数。可以定义和注册自己的信号处理程序或使用默认的信号处理程序。 -在Perl中,信号可以被捕获并被一个全局的%SIG哈希变量处理。这个%SIG哈希变量被信号号锁定并包含对相应的信号处理程序。因此,如果你想为特定的信号定义自定义信号处理程序,你可以直接更新%SIG的信号的哈希值。 +在Perl中,信号可以被捕获,并由一个全局的%SIG哈希变量指定处理函数。这个%SIG哈希变量的键名是信号值,键值是对应的信号处理程序的引用。因此,如果你想为特定的信号定义自己的信号处理程序,你可以直接在%SIG中设置信号的哈希值。 下面是一个代码段来处理使用自定义信号处理程序中断(INT)和终止(TERM)的信号。 @@ -18,13 +18,13 @@ Linux 有问必答-- 如何在Perl中捕捉并处理信号 ![](https://farm4.staticflickr.com/3910/15141131060_f7958f20fb.jpg) -%SIG其他有效的哈希值有'IGNORE'和'DEFAULT'。当所分配的哈希值是'IGNORE'(例如,$SIG{CHLD}='IGNORE')时,相应的信号将被忽略。分配'DEFAULT'的哈希值(例如,$SIG{HUP}='DEFAULT'),意味着我们将使用一个默认的信号处理程序。 +%SIG其他的可用的键值有'IGNORE'和'DEFAULT'。当所指定的键值是'IGNORE'(例如,$SIG{CHLD}='IGNORE')时,相应的信号将被忽略。指定'DEFAULT'的键值(例如,$SIG{HUP}='DEFAULT'),意味着我们将使用一个(系统)默认的信号处理程序。 -------------------------------------------------------------------------------- via: http://ask.xmodulo.com/catch-handle-interrupt-signal-perl.html 译者:[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/) 荣誉推出 \ No newline at end of file diff --git a/translated/tech/20140925 Linux FAQs with Answers--How to configure a static IP address on CentOS 7.md b/published/20140925 Linux FAQs with Answers--How to configure a static IP address on CentOS 7.md similarity index 85% rename from translated/tech/20140925 Linux FAQs with Answers--How to configure a static IP address on CentOS 7.md rename to published/20140925 Linux FAQs with Answers--How to configure a static IP address on CentOS 7.md index e126b930f3..a2134b43cf 100644 --- a/translated/tech/20140925 Linux FAQs with Answers--How to configure a static IP address on CentOS 7.md +++ b/published/20140925 Linux FAQs with Answers--How to configure a static IP address on CentOS 7.md @@ -1,10 +1,10 @@ -Linux有问必答——如何为CentOS 7配置静态IP地址 +Linux有问必答:如何为CentOS 7配置静态IP地址 ================================================================================ > **问题**:在CentOS 7上,我想要将我其中一个网络接口从DHCP改为静态IP地址配置,如何才能永久为CentOS或RHEL 7上的网络接口分配静态IP地址? 如果你想要为CentOS 7中的某个网络接口设置静态IP地址,有几种不同的方法,这取决于你是否想要使用网络管理器。 -网络管理器是一个动态的网络控制与配置系统,它用于在网络设备可用时保持设备和连接开启并激活。默认情况下,CentOS/RHEL 7安装有网络管理器,并处于启用状态。 +网络管理器(Network Manager)是一个动态网络的控制器与配置系统,它用于当网络设备可用时保持设备和连接开启并激活。默认情况下,CentOS/RHEL 7安装有网络管理器,并处于启用状态。 使用下面的命令来验证网络管理器服务的状态: @@ -30,7 +30,7 @@ Linux有问必答——如何为CentOS 7配置静态IP地址 ![](https://farm4.staticflickr.com/3880/15112184199_f4cbf269a6.jpg) -在上图中,“NM_CONTROLLED=no”表示该接口将通过该配置进行设置,而不是通过网络管理器进行管理。“ONBOOT=yes”告诉我们,系统将在启动时开启该接口。 +在上图中,“NM_CONTROLLED=no”表示该接口将通过该配置文件进行设置,而不是通过网络管理器进行管理。“ONBOOT=yes”告诉我们,系统将在启动时开启该接口。 保存修改并使用以下命令来重启网络服务: @@ -43,6 +43,7 @@ Linux有问必答——如何为CentOS 7配置静态IP地址 ![](https://farm6.staticflickr.com/5593/15112397947_ac69a33fb4_z.jpg) ### 使用网络管理器配置静态IP地址 ### + 如果你想要使用网络管理器来管理该接口,你可以使用nmtui(网络管理器文本用户界面),它提供了在终端环境中配置配置网络管理器的方式。 在使用nmtui之前,首先要在/etc/sysconfig/network-scripts/ifcfg-enp0s3中设置“NM_CONTROLLED=yes”。 @@ -65,13 +66,13 @@ Linux有问必答——如何为CentOS 7配置静态IP地址 # systemctl restart network.service -好了,现在一切就绪。 +好了,现在一切都搞定了。 -------------------------------------------------------------------------------- via: http://ask.xmodulo.com/configure-static-ip-address-centos7.html 译者:[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/20140925 Linux FAQs with Answers--How to detect a Linux distribution in Perl.md b/published/20140925 Linux FAQs with Answers--How to detect a Linux distribution in Perl.md similarity index 81% rename from translated/tech/20140925 Linux FAQs with Answers--How to detect a Linux distribution in Perl.md rename to published/20140925 Linux FAQs with Answers--How to detect a Linux distribution in Perl.md index 322d8e6163..6793ab5565 100644 --- a/translated/tech/20140925 Linux FAQs with Answers--How to detect a Linux distribution in Perl.md +++ b/published/20140925 Linux FAQs with Answers--How to detect a Linux distribution in Perl.md @@ -1,8 +1,8 @@ -Linux有问必答-- 如何用Perl检测Linux的发行版本 +Linux有问必答:如何用Perl检测Linux的发行版本 ================================================================================ > **提问**:我需要写一个Perl程序,它会包含Linux发行版相关的代码。为此,Perl程序需要能够自动检测运行中的Linux的发行版(如Ubuntu、CentOS、Debian、Fedora等等),以及它是什么版本号。如何用Perl检测Linux的发行版本? -如果要用Perl脚本检测Linux的发行版,你可以使用一个名为[Linux::Distribution][1]的Perl模块。该模块通过检查/etc/lsb-release以及其他特定的/etc下的发行版特定的目录来猜测底层Linux操作系统。它支持检测所有主要的Linux发行版,包括Fedora、CentOS、Arch Linux、Debian、Ubuntu、SUSE、Red Hat、Gentoo、Slackware、Knoppix和Mandrake。 +如果要用Perl脚本检测Linux的发行版,你可以使用一个名为[Linux::Distribution][1]的Perl模块。该模块通过检查/etc/lsb-release以及其他在/etc下的发行版特定的目录来猜测底层Linux操作系统。它支持检测所有主要的Linux发行版,包括Fedora、CentOS、Arch Linux、Debian、Ubuntu、SUSE、Red Hat、Gentoo、Slackware、Knoppix和Mandrake。 要在Perl中使用这个模块,你首先需要安装它。 @@ -20,7 +20,7 @@ Linux有问必答-- 如何用Perl检测Linux的发行版本 $ sudo yum -y install perl-CPAN -使用这条命令来构建并安装模块: +然后,使用这条命令来构建并安装模块: $ sudo perl -MCPAN -e 'install Linux::Distribution' @@ -46,7 +46,7 @@ Linux::Distribution模块安装完成之后,你可以使用下面的代码片 via: http://ask.xmodulo.com/detect-linux-distribution-in-perl.html 译者:[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/20140926 How To Reset Root Password On CentOS 7.md b/published/20140926 How To Reset Root Password On CentOS 7.md similarity index 95% rename from translated/tech/20140926 How To Reset Root Password On CentOS 7.md rename to published/20140926 How To Reset Root Password On CentOS 7.md index d9da58dd6c..c4586cec8b 100644 --- a/translated/tech/20140926 How To Reset Root Password On CentOS 7.md +++ b/published/20140926 How To Reset Root Password On CentOS 7.md @@ -47,6 +47,6 @@ via: http://www.unixmen.com/reset-root-password-centos-7/ 作者:M.el Khamlichi 译者:[su-kaiyao](https://github.com/su-kaiyao) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 diff --git a/published/20140928 Oracle Linux 5.11 Features Updated Unbreakable Linux Kernel.md b/published/20140928 Oracle Linux 5.11 Features Updated Unbreakable Linux Kernel.md new file mode 100644 index 0000000000..1debab469b --- /dev/null +++ b/published/20140928 Oracle Linux 5.11 Features Updated Unbreakable Linux Kernel.md @@ -0,0 +1,51 @@ +Oracle Linux 5.11更新了其Unbreakable Linux内核 +================================================================================ +> 此版本更新了很多软件包 + +![This is the last release for this branch](http://i1-news.softpedia-static.com/images/news2/Oracle-Linux-5-11-Features-Updated-Unbreakable-Linux-Kernel-460129-2.jpg) + +这是这个分支的最后一个版本更新(随同 RHEL 5.11的落幕,CentOS 和 Oracle Linux 的5.x 系列也纷纷释出该系列的最后版本)。 + +>**甲骨文公司宣布,Oracle Linux5.11版已提供下载,但是这是企业版,需要用户注册才能下载。** + +这个新的Oracle Linux是这个系列的最后一次更新。该系统基于Red Hat和该公司最近推送的RHEL 5X分支更新,这意味着这也是Oracle此产品线的最后一次更新。 + +Oracle Linux还带来了一系列有趣的功能,就像一个名为Ksplice的零宕机内核更新,它最初是针对openSUSE,包括Oracle数据库和Oracle应用软件开发的,它们在基于x86的Oracle系统中使用。 + +### Oracle Linux有哪些特别的 ### + +尽管Oracle Linux基于红帽,它的开发者曾经举出了很多你不应该使用RHEL的原因。理由有很多,但最主要的是,任何人都可以下载Oracle Linux(注册后),而RHEL实际上限制了非付费会员下载。 + +开发者在其网站上说:“为企业应用和系统提供先进的可扩展性和可靠性,Oracle Linux提供了极高的性能,并且在采用x86架构的Oracle工程系统中使用。Oracle Linux是免费使用,免费派发,免费更新,并可轻松下载。它是唯一带来生产中零宕机补丁Oracle Ksplice支持的Linux发行版,允许客户无需重启而部署安全或者其他更新,并且同时提供诊断功能来调试生产系统中的内核问题。” + +Oracle Linux其中一个最有趣且独一无二的功能是其Unbreakable Kernel(坚不可摧的内核)。这是它的开发者实际使用的名称。它基于来自3.0.36分支的旧Linux内核。用户还可以使用红帽兼容内核(内核2.6.18-398.el5),这在发行版中默认提供。 + +此外,Oracle Linux Release 5.11企业版内核提供了对大量硬件和设备的支持,但这个最新的更新带来了更好的支持。 + +您可以查看Oracle Linux 5.11全部[发布通告][1],这可能需要花费一些时间去读。 + +你也可以从下面下载Oracle Linux 5.11: + +- [Oracle Enterprise Linux 6.5 (ISO) 64-bit][2] +- [Oracle Enterprise Linux 6.5 (ISO) 32-bit][3] +- [Oracle Enterprise Linux 7.0 (ISO) 64-bit][4] +- [Oracle Enterprise Linux 5.11 (ISO) 64-bit][5] +- [Oracle Enterprise Linux 5.11 (ISO) 32-bit][6] + +-------------------------------------------------------------------------------- + +via: http://news.softpedia.com/news/Oracle-Linux-5-11-Features-Updated-Unbreakable-Linux-Kernel-460129.shtml + +作者:[Silviu Stahie][a] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://news.softpedia.com/editors/browse/silviu-stahie +[1]:https://oss.oracle.com/ol5/docs/RELEASE-NOTES-U11-en.html#Kernel_and_Driver_Updates +[2]:http://mirrors.dotsrc.org/oracle-linux/OL6/U5/i386/OracleLinux-R6-U5-Server-i386-dvd.iso +[3]:http://mirrors.dotsrc.org/oracle-linux/OL6/U5/x86_64/OracleLinux-R6-U5-Server-x86_64-dvd.iso +[4]:https://edelivery.oracle.com/linux/ +[5]:http://ftp5.gwdg.de/pub/linux/oracle/EL5/U11/x86_64/Enterprise-R5-U11-Server-x86_64-dvd.iso +[6]:http://ftp5.gwdg.de/pub/linux/oracle/EL5/U11/i386/Enterprise-R5-U11-Server-i386-dvd.iso \ No newline at end of file diff --git a/translated/tech/20140930 Check If Your Linux System Is Vulnerable To Shellshock And Fix It.md b/published/20140930 Check If Your Linux System Is Vulnerable To Shellshock And Fix It.md similarity index 95% rename from translated/tech/20140930 Check If Your Linux System Is Vulnerable To Shellshock And Fix It.md rename to published/20140930 Check If Your Linux System Is Vulnerable To Shellshock And Fix It.md index 8380185195..c9ef13ca11 100644 --- a/translated/tech/20140930 Check If Your Linux System Is Vulnerable To Shellshock And Fix It.md +++ b/published/20140930 Check If Your Linux System Is Vulnerable To Shellshock And Fix It.md @@ -2,7 +2,7 @@ ================================================================================ ![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2014/09/shellshock_Linux_check.jpeg) -快速地向你展示**如何检查你的系统是否受到Shellshock的影响**如果有,**怎样修复你的系统免于被Bash漏洞利用**。 +快速地向你展示**如何检查你的系统是否受到Shellshock的影响**,如果有,**怎样修复你的系统免于被Bash漏洞利用**。 如果你正跟踪新闻,你可能已经听说过在[Bash][1]中发现了一个漏洞,这被称为**Bash Bug**或者** Shellshock**。 [红帽][2]是第一个发现这个漏洞的机构。Shellshock错误允许攻击者注入自己的代码,从而使系统开放各给种恶意软件和远程攻击。事实上,[黑客已经利用它来启动DDoS攻击][3]。 @@ -55,7 +55,7 @@ via: http://itsfoss.com/linux-shellshock-check-fix/ 作者:[Abhishek][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/published/20140610 How does the cloud affect the everyday linux user.md b/published/201410/20140610 How does the cloud affect the everyday linux user.md similarity index 100% rename from published/20140610 How does the cloud affect the everyday linux user.md rename to published/201410/20140610 How does the cloud affect the everyday linux user.md diff --git a/published/20140624 Staying free--should GCC allow non-free plug ins.md b/published/201410/20140624 Staying free--should GCC allow non-free plug ins.md similarity index 100% rename from published/20140624 Staying free--should GCC allow non-free plug ins.md rename to published/201410/20140624 Staying free--should GCC allow non-free plug ins.md diff --git a/published/20140716 Linux FAQs with Answers--How to define PATH environment variable for sudo commands.md b/published/201410/20140716 Linux FAQs with Answers--How to define PATH environment variable for sudo commands.md similarity index 100% rename from published/20140716 Linux FAQs with Answers--How to define PATH environment variable for sudo commands.md rename to published/201410/20140716 Linux FAQs with Answers--How to define PATH environment variable for sudo commands.md diff --git a/published/20140718 Need Microsoft Office on Ubuntu--Install the Official Webapps.md b/published/201410/20140718 Need Microsoft Office on Ubuntu--Install the Official Webapps.md similarity index 100% rename from published/20140718 Need Microsoft Office on Ubuntu--Install the Official Webapps.md rename to published/201410/20140718 Need Microsoft Office on Ubuntu--Install the Official Webapps.md diff --git a/published/20140722 How to manage DigitalOcean VPS droplets from the command line on Linux.md b/published/201410/20140722 How to manage DigitalOcean VPS droplets from the command line on Linux.md similarity index 100% rename from published/20140722 How to manage DigitalOcean VPS droplets from the command line on Linux.md rename to published/201410/20140722 How to manage DigitalOcean VPS droplets from the command line on Linux.md diff --git a/published/20140723 How to access SoundCloud from the command line in Linux.md b/published/201410/20140723 How to access SoundCloud from the command line in Linux.md similarity index 100% rename from published/20140723 How to access SoundCloud from the command line in Linux.md rename to published/201410/20140723 How to access SoundCloud from the command line in Linux.md diff --git a/published/20140723 Top 10 Fun On The Command Line.md b/published/201410/20140723 Top 10 Fun On The Command Line.md similarity index 100% rename from published/20140723 Top 10 Fun On The Command Line.md rename to published/201410/20140723 Top 10 Fun On The Command Line.md diff --git a/published/20140724 diff -u--What is New in Kernel Development.md b/published/201410/20140724 diff -u--What is New in Kernel Development.md similarity index 100% rename from published/20140724 diff -u--What is New in Kernel Development.md rename to published/201410/20140724 diff -u--What is New in Kernel Development.md diff --git a/published/20140729 10 Useful 'Squid Proxy Server' Interview Questions and Answers in Linux.md b/published/201410/20140729 10 Useful 'Squid Proxy Server' Interview Questions and Answers in Linux.md similarity index 100% rename from published/20140729 10 Useful 'Squid Proxy Server' Interview Questions and Answers in Linux.md rename to published/201410/20140729 10 Useful 'Squid Proxy Server' Interview Questions and Answers in Linux.md diff --git a/published/20140729 How to access Linux command cheat sheets from the command line.md b/published/201410/20140729 How to access Linux command cheat sheets from the command line.md similarity index 100% rename from published/20140729 How to access Linux command cheat sheets from the command line.md rename to published/201410/20140729 How to access Linux command cheat sheets from the command line.md diff --git a/published/20140730 How to use variables in shell Scripting.md b/published/201410/20140730 How to use variables in shell Scripting.md similarity index 100% rename from published/20140730 How to use variables in shell Scripting.md rename to published/201410/20140730 How to use variables in shell Scripting.md diff --git a/published/20140731 Easy Steps to Make GNOME 3 More Efficient.md b/published/201410/20140731 Easy Steps to Make GNOME 3 More Efficient.md similarity index 100% rename from published/20140731 Easy Steps to Make GNOME 3 More Efficient.md rename to published/201410/20140731 Easy Steps to Make GNOME 3 More Efficient.md diff --git a/published/20140801 How To Install Java On Ubuntu 14.04.md b/published/201410/20140801 How To Install Java On Ubuntu 14.04.md similarity index 100% rename from published/20140801 How To Install Java On Ubuntu 14.04.md rename to published/201410/20140801 How To Install Java On Ubuntu 14.04.md diff --git a/published/20140801 How to Create an Ubuntu Kiosk Computer.md b/published/201410/20140801 How to Create an Ubuntu Kiosk Computer.md similarity index 100% rename from published/20140801 How to Create an Ubuntu Kiosk Computer.md rename to published/201410/20140801 How to Create an Ubuntu Kiosk Computer.md diff --git a/published/20140804 Cheat--An Ultimate Command Line 'Cheat-Sheet' for Linux Beginners and Administrators.md b/published/201410/20140804 Cheat--An Ultimate Command Line 'Cheat-Sheet' for Linux Beginners and Administrators.md similarity index 100% rename from published/20140804 Cheat--An Ultimate Command Line 'Cheat-Sheet' for Linux Beginners and Administrators.md rename to published/201410/20140804 Cheat--An Ultimate Command Line 'Cheat-Sheet' for Linux Beginners and Administrators.md diff --git a/published/20140808 When Linux Was Perfect Enough.md b/published/201410/20140808 When Linux Was Perfect Enough.md similarity index 100% rename from published/20140808 When Linux Was Perfect Enough.md rename to published/201410/20140808 When Linux Was Perfect Enough.md diff --git a/published/20140811 Disable or Password Protect Single User Mode or RHEL ro CentOS ro 5.x ro 6.x.md b/published/201410/20140811 Disable or Password Protect Single User Mode or RHEL ro CentOS ro 5.x ro 6.x.md similarity index 100% rename from published/20140811 Disable or Password Protect Single User Mode or RHEL ro CentOS ro 5.x ro 6.x.md rename to published/201410/20140811 Disable or Password Protect Single User Mode or RHEL ro CentOS ro 5.x ro 6.x.md diff --git a/published/20140811 How to Image and Clone Hard Drives with Clonezilla.md b/published/201410/20140811 How to Image and Clone Hard Drives with Clonezilla.md similarity index 100% rename from published/20140811 How to Image and Clone Hard Drives with Clonezilla.md rename to published/201410/20140811 How to Image and Clone Hard Drives with Clonezilla.md diff --git a/published/20140811 Linux FAQs with Answers--How to check the last time system was rebooted on Linux.md b/published/201410/20140811 Linux FAQs with Answers--How to check the last time system was rebooted on Linux.md similarity index 100% rename from published/20140811 Linux FAQs with Answers--How to check the last time system was rebooted on Linux.md rename to published/201410/20140811 Linux FAQs with Answers--How to check the last time system was rebooted on Linux.md diff --git a/published/20140818 Linux FAQs with Answers--How to set a static MAC address on VMware ESXi virtual machine.md b/published/201410/20140818 Linux FAQs with Answers--How to set a static MAC address on VMware ESXi virtual machine.md similarity index 100% rename from published/20140818 Linux FAQs with Answers--How to set a static MAC address on VMware ESXi virtual machine.md rename to published/201410/20140818 Linux FAQs with Answers--How to set a static MAC address on VMware ESXi virtual machine.md diff --git a/published/20140818 Where And How To Code--Choosing The Best Free Code Editor.md b/published/201410/20140818 Where And How To Code--Choosing The Best Free Code Editor.md similarity index 100% rename from published/20140818 Where And How To Code--Choosing The Best Free Code Editor.md rename to published/201410/20140818 Where And How To Code--Choosing The Best Free Code Editor.md diff --git a/translated/tech/20140819 8 Options to Trace or Debug Programs using Linux strace Command.md b/published/201410/20140819 8 Options to Trace or Debug Programs using Linux strace Command.md similarity index 85% rename from translated/tech/20140819 8 Options to Trace or Debug Programs using Linux strace Command.md rename to published/201410/20140819 8 Options to Trace or Debug Programs using Linux strace Command.md index cb713ec438..a840ee7b59 100644 --- a/translated/tech/20140819 8 Options to Trace or Debug Programs using Linux strace Command.md +++ b/published/201410/20140819 8 Options to Trace or Debug Programs using Linux strace Command.md @@ -1,14 +1,16 @@ -8 Options to Trace/Debug Programs using Linux strace Command +使用 Linux 的 strace 命令跟踪/调试程序的常用选项 ================================================================================ + 在调试的时候,strace能帮助你追踪到一个程序所执行的系统调用。当你想知道程序和操作系统如何交互的时候,这是极其方便的,比如你想知道执行了哪些系统调用,并且以何种顺序执行。 这个简单而又强大的工具几乎在所有的Linux操作系统上可用,并且可被用来调试大量的程序。 -### 1. 命令用法 ### +### 命令用法 ### 让我们看看strace命令如何追踪一个程序的执行情况。 最简单的形式,strace后面可以跟任何命令。它将列出许许多多的系统调用。一开始,我们并不能理解所有的输出,但是如果你正在寻找一些特殊的东西,那么你应该能从输出中发现它。 + 让我们来看看简单命令ls的系统调用跟踪情况。 raghu@raghu-Linoxide ~ $ strace ls @@ -20,21 +22,22 @@ ![Strace write system call (ls)](http://linoxide.com/wp-content/uploads/2014/08/02.strace_ls_write.png) 上面的输出部分展示了write系统调用,它把当前目录的列表输出到标准输出。 + 下面的图片展示了使用ls命令列出的目录内容(没有使用strace)。 raghu@raghu-Linoxide ~ $ ls ![ls command output](http://linoxide.com/wp-content/uploads/2014/08/03.ls_.png) -#### 1.1 寻找被程序读取的配置文件 #### +#### 选项1 寻找被程序读取的配置文件 #### -一个有用的跟踪(除了调试某些问题以外)是你能找到被一个程序读取的配置文件。例如, +Strace 的用法之一(除了调试某些问题以外)是你能找到被一个程序读取的配置文件。例如, raghu@raghu-Linoxide ~ $ strace php 2>&1 | grep php.ini ![Strace config file read by program](http://linoxide.com/wp-content/uploads/2014/08/04.strace_php_configuration.png) -#### 1.2 跟踪指定的系统调用 #### +#### 选项2 跟踪指定的系统调用 #### strace命令的-e选项仅仅被用来展示特定的系统调用(例如,open,write等等) @@ -44,7 +47,7 @@ strace命令的-e选项仅仅被用来展示特定的系统调用(例如,ope ![Stracing specific system call (open here)](http://linoxide.com/wp-content/uploads/2014/08/05.strace_open_systemcall.png) -#### 1.3 用于进程 #### +#### 选项3 跟踪进程 #### strace不但能用在命令上,而且通过使用-p选项能用在运行的进程上。 @@ -52,15 +55,15 @@ strace不但能用在命令上,而且通过使用-p选项能用在运行的进 ![Strace a process](http://linoxide.com/wp-content/uploads/2014/08/06.strace_process.png) -#### 1.4 strace的统计概要 #### +#### 选项4 strace的统计概要 #### -包括系统调用的概要,执行时间,错误等等。使用-c选项能够以一种整洁的方式展示: +它包括系统调用的概要,执行时间,错误等等。使用-c选项能够以一种整洁的方式展示: raghu@raghu-Linoxide ~ $ strace -c ls ![Strace summary display](http://linoxide.com/wp-content/uploads/2014/08/07.strace_summary.png) -#### 1.5 保存输出结果 #### +#### 选项5 保存输出结果 #### 通过使用-o选项可以把strace命令的输出结果保存到一个文件中。 @@ -70,7 +73,7 @@ strace不但能用在命令上,而且通过使用-p选项能用在运行的进 之所以以sudo来运行上面的命令,是为了防止用户ID与所查看进程的所有者ID不匹配的情况。 -### 1.6 显示时间戳 ### +### 选项6 显示时间戳 ### 使用-t选项,可以在每行的输出之前添加时间戳。 @@ -78,7 +81,7 @@ strace不但能用在命令上,而且通过使用-p选项能用在运行的进 ![Timestamp before each output line](http://linoxide.com/wp-content/uploads/2014/08/09.strace_timestamp.png) -#### 1.7 更好的时间戳 #### +#### 选项7 更精细的时间戳 #### -tt选项可以展示微秒级别的时间戳。 @@ -92,7 +95,7 @@ strace不但能用在命令上,而且通过使用-p选项能用在运行的进 ![Seconds since epoch](http://linoxide.com/wp-content/uploads/2014/08/011.strace_epoch_seconds.png) -#### 1.8 Relative Time #### +#### 选项8 相对时间 #### -r选项展示系统调用之间的相对时间戳。 @@ -106,7 +109,7 @@ via: http://linoxide.com/linux-command/linux-strace-command-examples/ 作者:[Raghu][a] 译者:[guodongxiaren](https://github.com/guodongxiaren) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 diff --git a/published/20140819 A Pocket Guide for Linux ssh Command with Examples.md b/published/201410/20140819 A Pocket Guide for Linux ssh Command with Examples.md similarity index 100% rename from published/20140819 A Pocket Guide for Linux ssh Command with Examples.md rename to published/201410/20140819 A Pocket Guide for Linux ssh Command with Examples.md diff --git a/published/20140819 KDE Plasma 5--For those Linux users undecided on the kernel' s future.md b/published/201410/20140819 KDE Plasma 5--For those Linux users undecided on the kernel' s future.md similarity index 100% rename from published/20140819 KDE Plasma 5--For those Linux users undecided on the kernel' s future.md rename to published/201410/20140819 KDE Plasma 5--For those Linux users undecided on the kernel' s future.md diff --git a/published/20140819 Linux Systemd--Start or Stop or Restart Services in RHEL or CentOS 7.md b/published/201410/20140819 Linux Systemd--Start or Stop or Restart Services in RHEL or CentOS 7.md similarity index 100% rename from published/20140819 Linux Systemd--Start or Stop or Restart Services in RHEL or CentOS 7.md rename to published/201410/20140819 Linux Systemd--Start or Stop or Restart Services in RHEL or CentOS 7.md diff --git a/published/20140822 15 Practical Examples of 'cd' Command in Linux.md b/published/201410/20140822 15 Practical Examples of 'cd' Command in Linux.md similarity index 100% rename from published/20140822 15 Practical Examples of 'cd' Command in Linux.md rename to published/201410/20140822 15 Practical Examples of 'cd' Command in Linux.md diff --git a/published/20140825 China Will Change The Way All Software Is Bought And Sold.md b/published/201410/20140825 China Will Change The Way All Software Is Bought And Sold.md similarity index 100% rename from published/20140825 China Will Change The Way All Software Is Bought And Sold.md rename to published/201410/20140825 China Will Change The Way All Software Is Bought And Sold.md diff --git a/published/20140825 Linux FAQs with Answers--How to enable Nux Dextop repository on CentOS or RHEL.md b/published/201410/20140825 Linux FAQs with Answers--How to enable Nux Dextop repository on CentOS or RHEL.md similarity index 100% rename from published/20140825 Linux FAQs with Answers--How to enable Nux Dextop repository on CentOS or RHEL.md rename to published/201410/20140825 Linux FAQs with Answers--How to enable Nux Dextop repository on CentOS or RHEL.md diff --git a/published/20140825 Linux FAQs with Answers--How to fix 'failed to run aclocal--No such file or directory'.md b/published/201410/20140825 Linux FAQs with Answers--How to fix 'failed to run aclocal--No such file or directory'.md similarity index 100% rename from published/20140825 Linux FAQs with Answers--How to fix 'failed to run aclocal--No such file or directory'.md rename to published/201410/20140825 Linux FAQs with Answers--How to fix 'failed to run aclocal--No such file or directory'.md diff --git a/published/20140825 Linux Terminal--speedtest_cli checks your real bandwidth speed.md b/published/201410/20140825 Linux Terminal--speedtest_cli checks your real bandwidth speed.md similarity index 100% rename from published/20140825 Linux Terminal--speedtest_cli checks your real bandwidth speed.md rename to published/201410/20140825 Linux Terminal--speedtest_cli checks your real bandwidth speed.md diff --git a/published/20140826 Linus Torvalds is my hero, says 13 year old Zachary DuPont.md b/published/201410/20140826 Linus Torvalds is my hero, says 13 year old Zachary DuPont.md similarity index 100% rename from published/20140826 Linus Torvalds is my hero, says 13 year old Zachary DuPont.md rename to published/201410/20140826 Linus Torvalds is my hero, says 13 year old Zachary DuPont.md diff --git a/published/20140828 GIMP 2.8.12 Released--Here' s How to Install it on Ubuntu.md b/published/201410/20140828 GIMP 2.8.12 Released--Here' s How to Install it on Ubuntu.md similarity index 100% rename from published/20140828 GIMP 2.8.12 Released--Here' s How to Install it on Ubuntu.md rename to published/201410/20140828 GIMP 2.8.12 Released--Here' s How to Install it on Ubuntu.md diff --git a/published/20140829 Linux Doesn't Need to Own the Desktop.md b/published/201410/20140829 Linux Doesn't Need to Own the Desktop.md similarity index 100% rename from published/20140829 Linux Doesn't Need to Own the Desktop.md rename to published/201410/20140829 Linux Doesn't Need to Own the Desktop.md diff --git a/published/20140901 Awesome systemd Commands to Manage Linux System.md b/published/201410/20140901 Awesome systemd Commands to Manage Linux System.md similarity index 100% rename from published/20140901 Awesome systemd Commands to Manage Linux System.md rename to published/201410/20140901 Awesome systemd Commands to Manage Linux System.md diff --git a/published/20140901 Remarkable--A New MarkDown Editor For Linux.md b/published/201410/20140901 Remarkable--A New MarkDown Editor For Linux.md similarity index 100% rename from published/20140901 Remarkable--A New MarkDown Editor For Linux.md rename to published/201410/20140901 Remarkable--A New MarkDown Editor For Linux.md diff --git a/published/20140901 Ubuntu Wallpaper Contest Closes, These Are Our 8 Faves.md b/published/201410/20140901 Ubuntu Wallpaper Contest Closes, These Are Our 8 Faves.md similarity index 100% rename from published/20140901 Ubuntu Wallpaper Contest Closes, These Are Our 8 Faves.md rename to published/201410/20140901 Ubuntu Wallpaper Contest Closes, These Are Our 8 Faves.md diff --git a/published/20140902 Happy Birthday Email.md b/published/201410/20140902 Happy Birthday Email.md similarity index 100% rename from published/20140902 Happy Birthday Email.md rename to published/201410/20140902 Happy Birthday Email.md diff --git a/published/20140902 How to share on linux the output of your shell commands.md b/published/201410/20140902 How to share on linux the output of your shell commands.md similarity index 100% rename from published/20140902 How to share on linux the output of your shell commands.md rename to published/201410/20140902 How to share on linux the output of your shell commands.md diff --git a/published/20140902 Use SearchMonkey To Search Text In All Files Within A Directory In Ubuntu.md b/published/201410/20140902 Use SearchMonkey To Search Text In All Files Within A Directory In Ubuntu.md similarity index 100% rename from published/20140902 Use SearchMonkey To Search Text In All Files Within A Directory In Ubuntu.md rename to published/201410/20140902 Use SearchMonkey To Search Text In All Files Within A Directory In Ubuntu.md diff --git a/published/20140904 The Masked Avengers.md b/published/201410/20140904 The Masked Avengers.md similarity index 100% rename from published/20140904 The Masked Avengers.md rename to published/201410/20140904 The Masked Avengers.md diff --git a/published/20140905 Ubuntu Touch Now Has a Torrent Client in the Ubuntu Store.md b/published/201410/20140905 Ubuntu Touch Now Has a Torrent Client in the Ubuntu Store.md similarity index 100% rename from published/20140905 Ubuntu Touch Now Has a Torrent Client in the Ubuntu Store.md rename to published/201410/20140905 Ubuntu Touch Now Has a Torrent Client in the Ubuntu Store.md diff --git a/published/20140910 Colourful systemd vs sysVinit Linux Cheatsheet.md b/published/201410/20140910 Colourful systemd vs sysVinit Linux Cheatsheet.md similarity index 100% rename from published/20140910 Colourful systemd vs sysVinit Linux Cheatsheet.md rename to published/201410/20140910 Colourful systemd vs sysVinit Linux Cheatsheet.md diff --git a/published/20140910 Jelly Conky Adds Simple, Stylish Stats To Your Linux Desktop.md b/published/201410/20140910 Jelly Conky Adds Simple, Stylish Stats To Your Linux Desktop.md similarity index 100% rename from published/20140910 Jelly Conky Adds Simple, Stylish Stats To Your Linux Desktop.md rename to published/201410/20140910 Jelly Conky Adds Simple, Stylish Stats To Your Linux Desktop.md diff --git a/published/20140910 Meet the 12 Ubuntu 14.10 Wallpaper Contest Winners (So Far).md b/published/201410/20140910 Meet the 12 Ubuntu 14.10 Wallpaper Contest Winners (So Far).md similarity index 100% rename from published/20140910 Meet the 12 Ubuntu 14.10 Wallpaper Contest Winners (So Far).md rename to published/201410/20140910 Meet the 12 Ubuntu 14.10 Wallpaper Contest Winners (So Far).md diff --git a/published/20140910 [Quick Tip] How To List All Installed Packages On Linux Distributions.md b/published/201410/20140910 [Quick Tip] How To List All Installed Packages On Linux Distributions.md similarity index 100% rename from published/20140910 [Quick Tip] How To List All Installed Packages On Linux Distributions.md rename to published/201410/20140910 [Quick Tip] How To List All Installed Packages On Linux Distributions.md diff --git a/published/20140911 Install UberWriter Markdown Editor In Ubuntu 14.04.md b/published/201410/20140911 Install UberWriter Markdown Editor In Ubuntu 14.04.md similarity index 100% rename from published/20140911 Install UberWriter Markdown Editor In Ubuntu 14.04.md rename to published/201410/20140911 Install UberWriter Markdown Editor In Ubuntu 14.04.md diff --git a/published/20140912 How to Go Hands On With the Utopic Unicorn--Literally.md b/published/201410/20140912 How to Go Hands On With the Utopic Unicorn--Literally.md similarity index 100% rename from published/20140912 How to Go Hands On With the Utopic Unicorn--Literally.md rename to published/201410/20140912 How to Go Hands On With the Utopic Unicorn--Literally.md diff --git a/published/20140912 QuiteRSS--RSS Reader For Desktop Linux.md b/published/201410/20140912 QuiteRSS--RSS Reader For Desktop Linux.md similarity index 100% rename from published/20140912 QuiteRSS--RSS Reader For Desktop Linux.md rename to published/201410/20140912 QuiteRSS--RSS Reader For Desktop Linux.md diff --git a/published/20140915 How To Uninstall Ubuntu Linux From Windows 8 Dual Boot.md b/published/201410/20140915 How To Uninstall Ubuntu Linux From Windows 8 Dual Boot.md similarity index 100% rename from published/20140915 How To Uninstall Ubuntu Linux From Windows 8 Dual Boot.md rename to published/201410/20140915 How To Uninstall Ubuntu Linux From Windows 8 Dual Boot.md diff --git a/published/20140915 Linux FAQs with Answers--How to find and remove obsolete PPA repositories on Ubuntu.md b/published/201410/20140915 Linux FAQs with Answers--How to find and remove obsolete PPA repositories on Ubuntu.md similarity index 100% rename from published/20140915 Linux FAQs with Answers--How to find and remove obsolete PPA repositories on Ubuntu.md rename to published/201410/20140915 Linux FAQs with Answers--How to find and remove obsolete PPA repositories on Ubuntu.md diff --git a/published/20140915 One of the Smallest Distros in the World, Tiny Core, Gets a Fresh Update.md b/published/201410/20140915 One of the Smallest Distros in the World, Tiny Core, Gets a Fresh Update.md similarity index 100% rename from published/20140915 One of the Smallest Distros in the World, Tiny Core, Gets a Fresh Update.md rename to published/201410/20140915 One of the Smallest Distros in the World, Tiny Core, Gets a Fresh Update.md diff --git a/published/20140915 Potenza Icon Themes 2.0 Available For Download.md b/published/201410/20140915 Potenza Icon Themes 2.0 Available For Download.md similarity index 100% rename from published/20140915 Potenza Icon Themes 2.0 Available For Download.md rename to published/201410/20140915 Potenza Icon Themes 2.0 Available For Download.md diff --git a/published/20140917 GNOME Control Center 3.14 RC1 Corrects Lots of Potential Crashes.md b/published/201410/20140917 GNOME Control Center 3.14 RC1 Corrects Lots of Potential Crashes.md similarity index 100% rename from published/20140917 GNOME Control Center 3.14 RC1 Corrects Lots of Potential Crashes.md rename to published/201410/20140917 GNOME Control Center 3.14 RC1 Corrects Lots of Potential Crashes.md diff --git a/published/20140919 Another Italian City Says Goodbye To Microsoft Office, Will Switch To OpenOffice Soon.md b/published/201410/20140919 Another Italian City Says Goodbye To Microsoft Office, Will Switch To OpenOffice Soon.md similarity index 100% rename from published/20140919 Another Italian City Says Goodbye To Microsoft Office, Will Switch To OpenOffice Soon.md rename to published/201410/20140919 Another Italian City Says Goodbye To Microsoft Office, Will Switch To OpenOffice Soon.md diff --git a/published/20140919 Mir and Unity 8 Status Update Arrives from Ubuntu Devs.md b/published/201410/20140919 Mir and Unity 8 Status Update Arrives from Ubuntu Devs.md similarity index 100% rename from published/20140919 Mir and Unity 8 Status Update Arrives from Ubuntu Devs.md rename to published/201410/20140919 Mir and Unity 8 Status Update Arrives from Ubuntu Devs.md diff --git a/published/20140919 Netflix Offers to Work with Ubuntu to Bring Native Playback to All.md b/published/201410/20140919 Netflix Offers to Work with Ubuntu to Bring Native Playback to All.md similarity index 100% rename from published/20140919 Netflix Offers to Work with Ubuntu to Bring Native Playback to All.md rename to published/201410/20140919 Netflix Offers to Work with Ubuntu to Bring Native Playback to All.md diff --git a/published/20140919 Red Hat Acquires FeedHenry for $82 Million to Advance Mobile Development.md b/published/201410/20140919 Red Hat Acquires FeedHenry for $82 Million to Advance Mobile Development.md similarity index 100% rename from published/20140919 Red Hat Acquires FeedHenry for $82 Million to Advance Mobile Development.md rename to published/201410/20140919 Red Hat Acquires FeedHenry for $82 Million to Advance Mobile Development.md diff --git a/published/20140922 Ten Blogs Every Ubuntu User Must Follow.md b/published/201410/20140922 Ten Blogs Every Ubuntu User Must Follow.md similarity index 100% rename from published/20140922 Ten Blogs Every Ubuntu User Must Follow.md rename to published/201410/20140922 Ten Blogs Every Ubuntu User Must Follow.md diff --git a/published/20140924 Canonical Closes nginx Exploit in Ubuntu 14.04 LTS.md b/published/201410/20140924 Canonical Closes nginx Exploit in Ubuntu 14.04 LTS.md similarity index 100% rename from published/20140924 Canonical Closes nginx Exploit in Ubuntu 14.04 LTS.md rename to published/201410/20140924 Canonical Closes nginx Exploit in Ubuntu 14.04 LTS.md diff --git a/published/20140924 Debian 8 Jessie to Have GNOME as the Default Desktop.md b/published/201410/20140924 Debian 8 Jessie to Have GNOME as the Default Desktop.md similarity index 100% rename from published/20140924 Debian 8 Jessie to Have GNOME as the Default Desktop.md rename to published/201410/20140924 Debian 8 Jessie to Have GNOME as the Default Desktop.md diff --git a/published/20140924 End of the Line for Red Hat Enterprise Linux 5.md b/published/201410/20140924 End of the Line for Red Hat Enterprise Linux 5.md similarity index 100% rename from published/20140924 End of the Line for Red Hat Enterprise Linux 5.md rename to published/201410/20140924 End of the Line for Red Hat Enterprise Linux 5.md diff --git a/published/20140924 Second Bugfix Release for KDE Plasma 5 Arrives with Lots of Changes.md b/published/201410/20140924 Second Bugfix Release for KDE Plasma 5 Arrives with Lots of Changes.md similarity index 100% rename from published/20140924 Second Bugfix Release for KDE Plasma 5 Arrives with Lots of Changes.md rename to published/201410/20140924 Second Bugfix Release for KDE Plasma 5 Arrives with Lots of Changes.md diff --git a/published/20140924 Wal Commander GitHub Edition 0.17 released.md b/published/201410/20140924 Wal Commander GitHub Edition 0.17 released.md similarity index 100% rename from published/20140924 Wal Commander GitHub Edition 0.17 released.md rename to published/201410/20140924 Wal Commander GitHub Edition 0.17 released.md diff --git a/published/How to listen to Internet radio from the command line on Linux.md b/published/201410/How to listen to Internet radio from the command line on Linux.md similarity index 100% rename from published/How to listen to Internet radio from the command line on Linux.md rename to published/201410/How to listen to Internet radio from the command line on Linux.md diff --git a/published/The Open Source Witch Hunts Have Returned.md b/published/201410/The Open Source Witch Hunts Have Returned.md similarity index 100% rename from published/The Open Source Witch Hunts Have Returned.md rename to published/201410/The Open Source Witch Hunts Have Returned.md diff --git a/published/20141008 Adobe Pulls Linux PDF Reader Downloads From Website.md b/published/20141008 Adobe Pulls Linux PDF Reader Downloads From Website.md new file mode 100644 index 0000000000..17e9920227 --- /dev/null +++ b/published/20141008 Adobe Pulls Linux PDF Reader Downloads From Website.md @@ -0,0 +1,41 @@ +Adobe从网站上撤下了Linux PDF Reader的下载链接 +================================================================================ +
![Linux上的其他PDF解决方案](http://www.omgubuntu.co.uk/wp-content/uploads/2012/07/test-pdf.jpg)
+ + +**由于该公司从网站上撤下了软件的下载链接,因此这对于任何需要在Linux上使用Adobe这家公司的PDF阅读器的人而言有些麻烦了。** + +[Reddit 上的一个用户][1]发帖说,当他去 Adobe 网站上去下载该软件时,Linux并没有列在[支持的操作系统][2]里。 + +不知道什么时候,更不知道为什么,Linux版本被删除了,不过第一次被发现是在八月份。 + +这也并没有让人太惊讶。Adobe Reader 官方的Linux版本在2013年5月才更新,而且当时还在滞后的版本9.5.x上,而Windows和Mac版已经在v11.x。 + +### 谁在意呢?无所谓 ### + +这是一个巨大的损失么?你可能并不会这么想。毕竟Adobe Reader是一款名声不好的app。速度慢,占用资源而且体积臃肿。而原生的PDF阅读app像Evince和Okular提供了一流的体验而没有上面的那些缺点。 + +除开Snark,这一决定将会影响一些事。一些政府网站只能使用官方Abode应用才能完成或者提交提供的官方文档和程序。 + +Adobe把Linux给刷了这事并不鲜见。该公司在2012年[停止了Linux上flash版本的更新][3](把它留给Google去做),[并且此前从它们的跨平台运行时环境“Air”中排除了踢开了Linux用户][4]。 + +不过并没有失去一切。虽然网在不再提供链接了,然而在Adobe FTP服务器上仍有Debian的安装程序。计划使用老的版本?需要自己承担风险且没有来自Adobe的支持。同样注意这些版本可能还有没有修复的漏洞。 + +- [下载Ubuntu版本的 Adobe Reader 9.5.5][5] + +-------------------------------------------------------------------------------- + +via: http://www.omgubuntu.co.uk/2014/10/adobe-reader-linux-download-pulled-website + +作者:[Joey-Elijah Sneddon][a] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:https://plus.google.com/117485690627814051450/?rel=author +[1]:https://www.reddit.com/r/linux/comments/2hsgq6/linux_version_of_adobe_reader_no_longer/ +[2]:http://get.adobe.com/reader/otherversions/ +[3]:http://www.omgubuntu.co.uk/2012/02/adobe-adandons-flash-on-linux +[4]:http://www.omgubuntu.co.uk/2011/06/adobe-air-for-linux-axed +[5]:ftp://ftp.adobe.com/pub/adobe/reader/unix/9.x/9.5.5/enu/AdbeRdr9.5.5-1_i386linux_enu.deb \ No newline at end of file diff --git a/translated/talk/How to Achieve Better Security With Proper Management of Open Source.md b/published/How to Achieve Better Security With Proper Management of Open Source.md similarity index 91% rename from translated/talk/How to Achieve Better Security With Proper Management of Open Source.md rename to published/How to Achieve Better Security With Proper Management of Open Source.md index 8fd4aafd1b..b5e0f7ed3f 100644 --- a/translated/talk/How to Achieve Better Security With Proper Management of Open Source.md +++ b/published/How to Achieve Better Security With Proper Management of Open Source.md @@ -1,8 +1,6 @@ 恰当地管理开源,让软件更加安全 ================================================================================ -![作者 Bill Ledingham 是 Black Duck Software 公司的首席技术官(CTO)兼工程执行副总裁](http://www.linux.com/images/stories/41373/Bill-Ledingham.jpg) - -Bill Ledingham 是 Black Duck Software 公司的首席技术官(CTO)兼工程执行副总裁。 +
![作者 Bill Ledingham 是 Black Duck Software 公司的首席技术官(CTO)兼工程执行副总裁](http://www.linux.com/images/stories/41373/Bill-Ledingham.jpg)
越来越多的公司意识到,要想比对手率先开发出高质量具有创造性的软件,关键在于积极使用开源项目。软件版本更迭要求市场推广速度足够快,成本足够低,而仅仅使用商业源代码已经无法满足这些需求了。如果不能选择最合适的开源软件集成到自己的项目里,一些令人称道的点子怕是永无出头之日了。 @@ -38,12 +36,9 @@ Heartbleed bug 让开发人员和企业知道了软件安全性有多重要。 虽然每个公司、每个开发团队都面临各不相同的问题,但实践证明下面几条安全管理经验对使用开源软件的任何规模的组织都有意义: -- **自动认证并分类** - 捕捉并追踪开源组件的相关属性,评估授权许可,自动扫描可能出现的安全漏洞,自动认证并归档。 -- -- **维护最新代码的版本** - 评估代码质量,确保你的产品使用的是最新版本的代码。 -- +- **自动批准和分类** - 捕捉并追踪开源组件的相关属性,评估许可证合规性,通过自动化扫描、批准和使用过程来审查可能出现的安全漏洞。 +- **维护最新代码的版本** - 评估代码质量,确保你的产品使用的是最新版本的代码。 - **评估代码** - 评估所有在使用的开源代码;审查代码安全性、授权许可、列出风险并予以解决。 -- - **确保代码合法** - 创建并实现开源政策,建立自动化合规检查流程确保开源政策、法规、法律责任等符合开源组织的要求。 ### 关键是,要让管理流程运作起来 ### @@ -58,7 +53,7 @@ via: http://www.linux.com/news/software/applications/782953-how-to-achieve-bette 作者:[Bill Ledingham][a] 译者:[sailing](https://github.com/sailing) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 diff --git a/sources/news/20140928 Oracle Linux 5.11 Features Updated Unbreakable Linux Kernel.md b/sources/news/20140928 Oracle Linux 5.11 Features Updated Unbreakable Linux Kernel.md deleted file mode 100644 index 00967e3288..0000000000 --- a/sources/news/20140928 Oracle Linux 5.11 Features Updated Unbreakable Linux Kernel.md +++ /dev/null @@ -1,52 +0,0 @@ -Oracle Linux 5.11 Features Updated Unbreakable Linux Kernel -================================================================================ -> A lot of packages have been updated in this release - -![This is the last release for this branch](http://i1-news.softpedia-static.com/images/news2/Oracle-Linux-5-11-Features-Updated-Unbreakable-Linux-Kernel-460129-2.jpg) - -This is the last release for this branch - -> **Oracle has announced that Oracle Linux Release 5.11 has been made available for download, but this is the enterprise version, so users will have to register in order to get the download.** - -The new Oracle Linux update is probably the last one in the series. This operating system is based on Red Hat and the company has just pushed out the last update for the RHEL 5x branch, which means that this is the end of the line for the Oracle version as well. - -Oracle Linux also comes with a series of features that make it very interesting, like zero-downtime kernel updates with the help of a tool called Ksplice that was originally developed for OpenSUSE, inclusion of the Oracle Database and Oracle Applications, and it's used in all x86-based Oracle Engineered Systems. - -### What's so special about Oracle Linux ### - - -Despite the fact that Oracle Linux is based on Red Hat, its developers have actually made a list of reasons why you shouldn't use RHEL. There are quite a lot of them, but the main one is that anyone can download Oracle Linux (after registering) and RHEL is actually off limits for non-paying members. - -"Providing advanced scalability and reliability for enterprise applications and systems, Oracle Linux delivers extreme performance and is used in all x86-based Oracle Engineered Systems. Oracle Linux is free to use, free to distribute, free to update, and easy to download. It is the only Linux distribution with production support for zero-downtime kernel updates with Oracle Ksplice, allowing customers the ability to apply patches for security and other updates without a reboot, as well as providing diagnostic features for debugging kernel issues on production systems," say the developers on their website. - -One of the most interesting features for Oracle Linux and unique for this distribution is its unbreakable kernel. This is the actual name used by the developers. It's based on an older Linux kernel from the 3.0.36 branch. Users also have access to a Red Hat-compatible Kernel (kernel-2.6.18-398.el5), which is provided by default in the distro. - -Also, the Unbreakable Enterprise Kernel available in the Oracle Linux Release 5.11 features a ton of drivers for hardware and devices, but this latest update brought even better support. - -You can check the comprehensive [release notes][1] for Oracle Linux 5.11, which will probably take you the rest of the day. - -You can also download Oracle Linux 5.11: - -- [Oracle Enterprise Linux 6.5 (ISO) 64-bit][2] -- [Oracle Enterprise Linux 6.5 (ISO) 32-bit][3] -- [Oracle Enterprise Linux 7.0 (ISO) 64-bit][4] -- [Oracle Enterprise Linux 5.11 (ISO) 64-bit][5] -- [Oracle Enterprise Linux 5.11 (ISO) 32-bit][6] - --------------------------------------------------------------------------------- - -via: http://news.softpedia.com/news/Oracle-Linux-5-11-Features-Updated-Unbreakable-Linux-Kernel-460129.shtml - -作者:[Silviu Stahie][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://news.softpedia.com/editors/browse/silviu-stahie -[1]:https://oss.oracle.com/ol5/docs/RELEASE-NOTES-U11-en.html#Kernel_and_Driver_Updates -[2]:http://mirrors.dotsrc.org/oracle-linux/OL6/U5/i386/OracleLinux-R6-U5-Server-i386-dvd.iso -[3]:http://mirrors.dotsrc.org/oracle-linux/OL6/U5/x86_64/OracleLinux-R6-U5-Server-x86_64-dvd.iso -[4]:https://edelivery.oracle.com/linux/ -[5]:http://ftp5.gwdg.de/pub/linux/oracle/EL5/U11/x86_64/Enterprise-R5-U11-Server-x86_64-dvd.iso -[6]:http://ftp5.gwdg.de/pub/linux/oracle/EL5/U11/i386/Enterprise-R5-U11-Server-i386-dvd.iso \ No newline at end of file diff --git a/sources/news/20141008 How To Use Steam Music Player on Ubuntu Desktop.md b/sources/news/20141008 How To Use Steam Music Player on Ubuntu Desktop.md new file mode 100644 index 0000000000..a1bfd515b1 --- /dev/null +++ b/sources/news/20141008 How To Use Steam Music Player on Ubuntu Desktop.md @@ -0,0 +1,79 @@ +How To Use Steam Music Player on Ubuntu Desktop +================================================================================ +![](http://www.omgubuntu.co.uk/wp-content/uploads/2014/09/steam-music.jpg) + +**‘Music makes the people come together’ Madonna once sang. But can Steam’s new music player feature mix the bourgeoisie and the rebel as well?** + +If you’ve been living under a rock, ears pressed tight to a granite roof, word of Steam Music may have passed you by. The feature isn’t entirely new. It’s been in testing in some form or another since earlier this year. + +But in the latest stable update of the Steam client on Windows, Mac and Linux it is now available to all. Why does a gaming client need to add a music player, you ask? To let you play your favourite music while gaming, of course. + +Don’t worry: playing your music over in-game music is not as bad as it sounds (har har) on paper. Steam reduces/cancels out the game soundtrack in favour of your tunes, but keeps sound effects high in the mix so you can hear the plings, boops and blams all the same. + +### Using Steam Music Player ### + +![Music in Big Picture Mode](http://www.omgubuntu.co.uk/wp-content/uploads/2014/10/steam-music-bpm.jpg) + +Music in Big Picture Mode + +Steam Music Player is available to anyone running the latest version of the client. It’s a pretty simple addition: it lets you add, browse and play music from your computer. + +The player element itself is accessible on the desktop and when playing in Steam’s (awesome) Big Picture mode. In both instances, controlling playback is made dead simple. + +As the feature is **designed for playing music while gaming** it is not pitching itself as a rival for Rhythmbox or successor to Spotify. In fact, there’s no store to purchase music from and no integration with online services like Rdio, Grooveshark, etc. or the desktop. Nope, your keyboard media keys won’t work with the player in Linux. + +Valve say they “*…plan to add more features so you can experience Steam music in new ways. We’re just getting started.*” + +#### Steam Music Key Features: #### + +- Plays MP3s only +- Mixes with in-game soundtrack +- Music controls available in game +- Player can run on the desktop or in Big Picture mode +- Playlist/queue based playback + +**It does not integrate with the Ubuntu Sound Menu and does not currently support keyboard media keys.** + +### Using Steam Music on Ubuntu ### + +The first thing to do before you can play music is to add some. On Ubuntu, by default, Steam automatically adds two folders: the standard Music directory in Home, and its own Steam Music folder, where any downloadable soundtracks are stored. + +Note: at present **Steam Music only plays MP3s**. If the bulk of your music is in a different file format (e.g., .aac, .m4a, etc.) it won’t be added and cannot be played. + +To add an additional source or scan files in those already listed: + +- Head to **View > Settings > Music**. +- Click ‘**Add**‘ to add a folder in a different location to the two listed entries +- Hit ‘**Start Scanning**’ + +![](http://www.omgubuntu.co.uk/wp-content/uploads/2014/09/Tardis.jpg) + +This dialog is also where you can adjust other preferences, including a ‘scan at start’. If you routinely add new music and are prone to forgetting to manually initiate a scan, tick this one on. You can also choose whether to see notifications on track change, set the default volume levels, and adjust playback behaviour when opening an app or taking a voice chat. + +Once your music sources have been successfully added and scanned you are all set to browse through your entries from the **Library > Music** section of the main client. + +![](http://www.omgubuntu.co.uk/wp-content/uploads/2014/09/browser.jpg) + +The Steam Music section groups music by album title by default. To browse by band name you need to click the ‘Albums’ header and then select ‘Artists’ from the drop down menu. + +![](http://www.omgubuntu.co.uk/wp-content/uploads/2014/10/steam-selection.jpg) + +Steam Music works off of a ‘queue’ system. You can add music to the queue by double-clicking on a track in the browser or by right-clicking and selecting ‘Add to Queue’. + +![](http://www.omgubuntu.co.uk/wp-content/uploads/2014/10/steam-music-queue.jpg) + +To **launch the desktop player** click the musical note emblem in the upper-right hand corner or through the **View > Music Player** menu. + +![](http://www.omgubuntu.co.uk/wp-content/uploads/2014/10/steam-music.jpg) + +-------------------------------------------------------------------------------- + +via: http://www.omgubuntu.co.uk/2014/10/use-steam-music-player-linux + +作者:[Joey-Elijah Sneddon][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:https://plus.google.com/117485690627814051450/?rel=author \ No newline at end of file diff --git a/sources/news/20141008 Linux Kernel 3.17 Is Out With Plenty of New Features.md b/sources/news/20141008 Linux Kernel 3.17 Is Out With Plenty of New Features.md new file mode 100644 index 0000000000..27c11ac6b5 --- /dev/null +++ b/sources/news/20141008 Linux Kernel 3.17 Is Out With Plenty of New Features.md @@ -0,0 +1,54 @@ +Linux Kernel 3.17 Is Out With Plenty of New Features +================================================================================ +Linus Torvalds has announced the latest stable release of the Linux kernel, version 3.17. + +![](http://www.omgubuntu.co.uk/wp-content/uploads/2011/07/Tux-psd3894.jpg) + +Announced in his typical [laissez-faire style][1] in a post on the Linux Kernel Mailing List Torvalds explained: + +> “So the past week was fairly calm, and so I have no qualms about releasing 3.17 on the normal schedule (as opposed to the optimistic “maybe I can release it one week early” schedule that was not to be).” + +Due to travel Linus says he won’t start merging changes for Linux 3.18 just yet: + +> “I now have travel coming up – something I hoped to avoid when I was hoping for releasing early. Which means that while 3.17 is out, I’m not going to be merging stuff very actively next week, and the week after that is LinuxCon EU…” + +### What’s New In Linux 3.17? ### + +As with every new release, Linux 3.17 sees the kernel loaded up on the latest improvements, hardware support, fixes and so on. These range from the bamboozling – e.g., [memfd and file sealing patches][2] – to the sort of things most of us appreciate, such as support for new hardware. + +Below is a short list compiling some notable highlights of this release. It’s by no means exhaustive. + +- Microsoft Xbox One controller support (without vibration) +- Additional improvements to Sony SIXAXIS support +- Toshiba “Active Protection Sensor” support +- New ARM support includes Rockchip RK3288 and AllWinner A23 SoCs +- “Cross-thread filter setting” for secure computing facility +- Broadcom BCM7XXX-based board support (used in various set-top boxes) +- Enhanced AMD Radeon R9 290 support +- Misc. Nouveau driver improvements, including Kepler GPU fixes +- Audio support includes Wildcatpoint Audio DSP on Intel Broadwell Ultrabooks. + +### Installing Linux 3.17 on Ubuntu ### + +Although classed as stable there is, at present, little need for most of us to “have it now”. + +But if you’re impatient and — **more importantly** — skilled enough to handle issues resulting from it, you can install Linux 3.17 in Ubuntu 14.10 by installing the appropriate set of packages for your system from the mainline kernel archive maintained by Canonical. + +**Do not attempt to install anything from this link unless you know what you’re doing.** + +- [Visit the Ubuntu Kernel Mainline Archive][3] + +-------------------------------------------------------------------------------- + +via: http://www.omgubuntu.co.uk/2014/10/linux-kernel-3-17-whats-new-improved + +作者:[Joey-Elijah Sneddon][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:https://plus.google.com/117485690627814051450/?rel=author +[1]:http://lkml.iu.edu/hypermail/linux/kernel/1410.0/02818.html +[2]:http://lwn.net/Articles/607627/ +[3]:http://kernel.ubuntu.com/~kernel-ppa/mainline/?C=N;O=D \ No newline at end of file diff --git a/sources/share/README.md b/sources/share/README.md new file mode 100644 index 0000000000..e5e225858e --- /dev/null +++ b/sources/share/README.md @@ -0,0 +1 @@ +这里放分享类文章,包括各种软件的简单介绍、有用的书籍和网站等。 diff --git a/sources/talk/20140617 7 Improvements The Linux Desktop Needs.md b/sources/talk/20140617 7 Improvements The Linux Desktop Needs.md index 9a5c215d2e..295cd1e406 100644 --- a/sources/talk/20140617 7 Improvements The Linux Desktop Needs.md +++ b/sources/talk/20140617 7 Improvements The Linux Desktop Needs.md @@ -1,3 +1,4 @@ +Translating by ZTinoZ 7 Improvements The Linux Desktop Needs ====================================== diff --git a/sources/talk/20140818 Can Ubuntu Do This--Answers to The 4 Questions New Users Ask Most.md b/sources/talk/20140818 Can Ubuntu Do This--Answers to The 4 Questions New Users Ask Most.md deleted file mode 100644 index 69831d7704..0000000000 --- a/sources/talk/20140818 Can Ubuntu Do This--Answers to The 4 Questions New Users Ask Most.md +++ /dev/null @@ -1,78 +0,0 @@ -Can Ubuntu Do This? — Answers to The 4 Questions New Users Ask Most -================================================================================ -![](http://www.omgubuntu.co.uk/wp-content/uploads/2014/08/Screen-Shot-2014-08-13-at-14.31.42.png) - -**Type ‘Can Ubuntu’ into Google and you’ll see a stream of auto suggested terms put before you, all based on the queries asked most often by curious searchers. ** - -For long-time Linux users these queries all have rather obvious answers. But for new users or those feeling out whether a distribution like Ubuntu is for them the answers are not quite so obvious; they’re pertinent, real and essential asks. - -So, in this article, I’m going to answer the top four most searched for questions asking “*Can Ubuntu…?*” - -### Can Ubuntu Replace Windows? ### - -![Windows isn’t to everyones tastes — or needs](http://www.omgubuntu.co.uk/wp-content/uploads/2014/07/windows-9-desktop-rumour.png) -Windows isn’t to everyones tastes — or needs - -Yes. Ubuntu (and most other Linux distributions) can be installed on just about any computer capable of running Microsoft Windows. - -Whether you **should** replace it will, invariably, depend on your own needs. - -For example, if you’re attending a school or college that requires access to Windows-only software, you may want to hold off replacing it entirely. Same goes for businesses; if your work depends on Microsoft Office, Adobe Creative Suite or a specific AutoCAD application you may find it easier to stick with what you have. - -But for most of us Ubuntu can replace Windows full-time. It offers a safe, dependable desktop experience that can run on and support a wide range of hardware. Software available covers everything from office suites to web browsers, video and music apps to games. - -### Can Ubuntu Run .exe Files? ### - -![You can run some Windows apps in Ubuntu](http://www.omgubuntu.co.uk/wp-content/uploads/2013/01/adobe-photoshop-cs2-free-linux.png) -You can run some Windows apps in Ubuntu - -Yes, though not out of the box, and not with guaranteed success. This is because software distributed in .exe are meant to run on Windows. These are not natively compatible with any other desktop operating system, including Mac OS X or Android. - -Software installers made for Ubuntu (and other Linux distributions) tend to come as ‘.deb’ files. These can be installed similarly to .exe — you just double-click and follow any on-screen prompts. - -But Linux is versatile. Using a compatibility layer called ‘Wine’ (which technically is not an emulator, but for simplicity’s sake can be referred to as one for shorthand) that can run many popular apps. They won’t work quite as well as they do on Windows, nor look as pretty. But, for many, it works well enough to use on a daily basis. - -Notable Windows software that can run on Ubuntu through Wine includes older versions of Photoshop and early versions of Microsoft Office . For a list of compatible software [refer to the Wine App Database][1]. - -### Can Ubuntu Get Viruses? ### - -![It may have errors, but it doesn’t have viruses](http://www.omgubuntu.co.uk/wp-content/uploads/2014/04/errors.jpg) -It may have errors, but it doesn’t have viruses - -Theoretically, yes. But in reality, no. - -Linux distributions are built in a way that makes it incredibly hard for viruses, malware and root kits to be installed, much less run and do any significant damage. - -For example, most applications run as a ‘regular user’ with no special administrative privileges, required for a virus to access critical parts of the operating system. Most software is also installed from well maintained and centralised sources, like the Ubuntu Software Center, and not random websites. This makes the risk of installing something that is infected negligible. - -Should you use anti-virus on Ubuntu? That’s up to you. For peace of mind, or if you’re regularly using Windows software through Wine or dual-booting, you can install a free and open-source virus scanner app like ClamAV, available from the Software Center. - -You can learn more about the potential for viruses on Linux/Ubuntu [on the Ubuntu Wiki][2]. - -### Can Ubuntu Play Games? ### - -![Steam has hundreds of high-quality games for Linux](http://www.omgubuntu.co.uk/wp-content/uploads/2012/11/steambeta.jpg) -Steam has hundreds of high-quality games for Linux - -Oh yes it can. From the traditionally simple distractions of 2D chess, word games and minesweeper to modern AAA titles requiring powerful graphics cards, Ubuntu has a diverse range of games available for it. - -Your first port of call will be the **Ubuntu Software Center**. Here you’ll find a sizeable number of free, open-source and paid-for games, including acclaimed indie titles like World of Goo and Braid, as well as several sections filled with more traditional offerings, like PyChess, four-in-a-row and Scrabble clones. - -For serious gaming you’ll want to grab **Steam for Linux**. This is where you’ll find some of the latest and greatest games available, spanning the full gamut of genres. - -Also keep an eye on the [Humble Bundle][3]. These ‘pay what you want’ packages are held for two weeks every month or so. The folks at Humble have been fantastic supporters of Linux as a gaming platform, single-handily ensuring the Linux debut of many touted titles. - --------------------------------------------------------------------------------- - -via: http://www.omgubuntu.co.uk/2014/08/ubuntu-can-play-games-replace-windows-questions - -作者:[Joey-Elijah Sneddon][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:https://plus.google.com/117485690627814051450/?rel=author -[1]:https://appdb.winehq.org/ -[2]:https://help.ubuntu.com/community/Antivirus -[3]:https://www.humblebundle.com/ \ No newline at end of file diff --git a/sources/talk/20140818 Upstream and Downstream--why packaging takes time.md b/sources/talk/20140818 Upstream and Downstream--why packaging takes time.md index fc1c708b14..c4af2aef08 100644 --- a/sources/talk/20140818 Upstream and Downstream--why packaging takes time.md +++ b/sources/talk/20140818 Upstream and Downstream--why packaging takes time.md @@ -1,3 +1,5 @@ +[felixonmars translating...] + Upstream and Downstream: why packaging takes time ================================================================================ Here in the KDE office in Barcelona some people spend their time on purely upstream KDE projects and some of us are primarily interested in making distros work which mean our users can get all the stuff we make. I've been asked why we don't just automate the packaging and go and do more productive things. One view of making on a distro like Kubuntu is that its just a way to package up the hard work done by others to take all the credit. I don't deny that, but there's quite a lot to the packaging of all that hard work, for a start there's a lot of it these days. diff --git a/sources/talk/20140822 Want To Start An Open Source Project--Here's How.md b/sources/talk/20140822 Want To Start An Open Source Project--Here's How.md index 976b2dc8ff..62af776e6a 100644 --- a/sources/talk/20140822 Want To Start An Open Source Project--Here's How.md +++ b/sources/talk/20140822 Want To Start An Open Source Project--Here's How.md @@ -1,3 +1,5 @@ + Vic020 + Want To Start An Open Source Project? Here's How ================================================================================ > Our step-by-step guide. @@ -104,4 +106,4 @@ via: http://readwrite.com/2014/08/20/open-source-project-how-to [9]:http://opensourcedesign.is/blogging_about/import-designers/ [10]:https://twitter.com/h_ingo/status/501323333301190656 [11]:https://news.ycombinator.com/item?id=8122814 -[12]:http://www.shutterstock.com/ \ No newline at end of file +[12]:http://www.shutterstock.com/ diff --git a/sources/talk/20140826 Linus Torvalds Started a Revolution on August 25 1991 Happy Birthday Linux.md b/sources/talk/20140826 Linus Torvalds Started a Revolution on August 25 1991 Happy Birthday Linux.md deleted file mode 100644 index da1df59c37..0000000000 --- a/sources/talk/20140826 Linus Torvalds Started a Revolution on August 25 1991 Happy Birthday Linux.md +++ /dev/null @@ -1,41 +0,0 @@ -Linus Torvalds Started a Revolution on August 25, 1991. Happy Birthday, Linux! -================================================================================ -![Linus Torvalds](http://i1-news.softpedia-static.com/images/news2/Linus-Torvalds-Started-a-Revolution-on-August-25-1991-Happy-Birthday-Linux-456212-2.jpg) -Linus Torvalds - -**The Linux project has just turned 23 and it's now the biggest collaborative endeavor in the world, with thousands of people working on it.** - -Back in 1991, a young programmer called Linus Torvalds wanted to make a free operating system that wasn't going to be as big as the GNU project and that was just a hobby. He started something that would turn out to be the most successful operating system on the planet, but no one would have been able to guess it back then. - -Linus Torvalds sent an email on August 25, 1991, asking for help in testing his new operating system. Things haven't changed all that much in the meantime and he still sends emails about new Linux releases, although back then it wasn't called like that. - -"I'm doing a (free) operating system (just a hobby, won't be big and professional like gnu) for 386(486) AT clones. This has been brewing since april, and is starting to get ready. I'd like any feedback on things people like/dislike in minix, as my OS resembles it somewhat (same physical layout of the file-system (due to practical reasons) among other things). I've currently ported bash(1.08) and gcc(1.40), and things seem to work." - -"This implies that I'll get something practical within a few months, and I'd like to know what features most people would want. Any suggestions are welcome, but I won't promise I'll implement them :-) PS. Yes - it's free of any minix code, and it has a multi-threaded fs. It is NOT protable (uses 386 task switching etc), and it probably never will support anything other than AT-harddisks, as that's all I have :-(. " [wrote][1] Linus Torvalds. - -This is the entire mails that started it all, although it's interesting to see how things have evolved since then. The Linux operating system caught on, especially on the server market, but the power of Linux also extended in other areas. - -In fact, it's hard to find any technology that hasn't been influenced by a Linus OS. Phones, TVs, fridges, minicomputers, consoles, tablets, and basically everything that has a chip in it is capable of running Linux or it already has some sort of Linux-based OS installed on it. - -Linux is omnipresent on billions of devices and its influence is growing each year on an exponential basis. You might think that Linus is also the wealthiest man on the planet, but remember, Linux is free software and anyone can use it, modify it, and make money of it. He didn't do it for the money. - -Linus Torvalds started a revolution in 1991, but it hasn't ended. In fact, you could say that it's just getting started. - -> Happy Anniversary, Linux! Please join us in celebrating 23 years of the free OS that has changed the world. [pic.twitter.com/mTVApV85gD][2] -> -> — The Linux Foundation (@linuxfoundation) [August 25, 2014][3] - --------------------------------------------------------------------------------- - -via: http://news.softpedia.com/news/Linus-Torvalds-Started-a-Revolution-on-August-25-1991-Happy-Birthday-Linux-456212.shtml - -作者:[Silviu Stahie][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://news.softpedia.com/editors/browse/silviu-stahie -[1]:https://groups.google.com/forum/#!original/comp.os.minix/dlNtH7RRrGA/SwRavCzVE7gJ -[2]:http://t.co/mTVApV85gD -[3]:https://twitter.com/linuxfoundation/statuses/503799441900314624 \ No newline at end of file diff --git a/sources/talk/20140910 Why Do Some Old Programming Languages Never Die.md b/sources/talk/20140910 Why Do Some Old Programming Languages Never Die.md deleted file mode 100644 index 7e33b05047..0000000000 --- a/sources/talk/20140910 Why Do Some Old Programming Languages Never Die.md +++ /dev/null @@ -1,86 +0,0 @@ -(translating by runningwater) -Why Do Some Old Programming Languages Never Die? -================================================================================ -> We like what we already know. - -![](http://a4.files.readwrite.com/image/upload/c_fill,h_900,q_70,w_1600/MTIzMDQ5NjY0MTUxMjU4NjM2.jpg) - -Many of today’s most well-known programming languages are old enough to vote. PHP is 20. Python is 23. HTML is 21. Ruby and JavaScript are 19. C is a whopping 42 years old. - -Nobody could have predicted this. Not even computer scientist [Brian Kernighan][1], co-author of the very first book on C, which is still being printed today. (The language itself was the work of Kernighan's [co-author Dennis Ritchie][2], who passed away in 2011.) - -“I dimly recall a conversation early on with the editors, telling them that we’d sell something like 5,000 copies of the book,” Kernighan told me in a recent interview. “We managed to do better than that. I didn’t think students would still be using a version of it as a textbook in 2014.” - -What’s especially remarkable about C's persistence is that Google developed a new language, Go, specifically to more efficiently solve the problems C solves now. Still, it’s hard for Kernighan to imagine something like Go outright killing C no matter how good it is. - -“Most languages don’t die—or at least once they get to a certain level of acceptance they don’t die," he said. "C still solves certain problems better than anything else, so it sticks around.” - -### Write What You Know ### - -Why do some computer languages become more successful than others? Because developers choose to use them. That’s logical enough, but it gets tricky when you want to figure out why developers choose to use the languages they do. - -Ari Rabkin and Leo Meyerovich are researchers from, respectively, Princeton and the University of California at Berkeley who devoted two years to answering just that question. Their resulting paper, [Empirical Analysis of Programming Language Adoption][3], describes their analysis of more than 200,000 Sourceforge projects and polling of more than 13,000 programmers. - -Their main finding? Most of the time programmers choose programming languages they know. - -“There are languages we use because we’ve always used them,” Rabkin told me. “For example, astronomers historically use IDL [Interactive Data Language] for their computer programs, not because it has special features for stars or anything, but because it has tremendous inertia. They have good programs they’ve built with it that they want to keep.” - -In other words, it’s partly thanks to name recognition that established languages retain monumental staying power. Of course, that doesn’t mean popular languages don’t change. Rabkin noted that the C we use today is nothing like the language Kernighan first wrote about, which probably wouldn’t be fully compatible with a modern C compiler. - -“There’s an old, relevant joke in which an engineer is asked which language he thinks people will be using in 30 years and he says, ‘I don’t know, but it’ll be called Fortran’,” Rabkin said. “Long-lived languages are not the same as how they were when they were designed in the '70s and '80s. People have mostly added things instead of removed because that doesn’t break backwards compatibility, but many features have been fixed.” - -This backwards compatibility means that not only can programmers continue to use languages as they update programs, they also don’t need to go back and rewrite the oldest sections. That older ‘legacy code’ keeps languages around forever, but at a cost. As long as it’s there, people’s beliefs about a language will stick around, too. - -### PHP: A Case Study Of A Long-Lived Language ### - -Legacy code refers to programs—or portions of programs—written in outdated source code. Think, for instance, of key programming functions for a business or engineering project that are written in a language that no one supports. They still carry out their original purpose and are too difficult or expensive to rewrite in modern code, so they stick around, forcing programmers to turn handsprings to ensure they keep working even as other code changes around them. - -Any language that's been around more than a few years has a legacy-code problem of some sort, and PHP is no exception. PHP is an interesting example because its legacy code is distinctly different from its modern code, in what proponents say—and critics admit—is a huge improvement. - -Andi Gutmans is a co-inventor of the Zend Engine, the compiler that became standard by the time PHP4 came around. Gutmans said he and his partner originally wanted to improve PHP3, and were so successful that the original PHP inventor, Rasmus Lerdorf, joined their project. The result was a compiler for PHP4 and its successor, PHP5. - -As a consequence, the PHP of today is quite different from its progenitor, the original PHP. Yet in Gutmans' view, the base of legacy code written in older PHP versions keeps alive old prejudices against the language—such as the notion that PHP is riddled with security holes, or that it can't "scale" to handle large computing tasks. - -"People who criticize PHP are usually criticizing where it was in 1998,” he says. “These people are not up-to-date with where it is today. PHP today is a very mature ecosystem.” - -Today, Gutmans says, the most important thing for him as a steward is to encouraging people to keep updating to the latest versions. “PHP is a big enough community now that you have big legacy code bases," he says. "But generally speaking, most of our communities are on PHP5.3 at minimum.” - -The issue is that users never fully upgrade to the latest version of any language. It’s why many Python users are still using Python 2, released in 2000, instead of Python 3, released in 2008. Even after six years major users like Google still aren’t upgrading. There are a variety of reasons for this, but it made many developers wary about taking the plunge. - -“Nothing ever dies," Rabkin says. "Any language with legacy code will last forever. Rewrites are expensive and if it’s not broke don’t fix it.” - -### Developer Brains As Scarce Resources ### - -Of course, developers aren’t choosing these languages merely to maintain pesky legacy code. Rabkin and Meyerovich found that when it comes to language preference, age is just a number. As Rabkin told me: - -> A thing that really shocked us and that I think is important is that we grouped people by age and asked them how many languages they know. Our intuition was that it would gradually rise over time; it doesn’t. Twenty-five-year-olds and 45-year-olds all know about the same number of languages. This was constant through several rewordings of the question. Your chance of knowing a given language does not vary with your age. - -In other words, it’s not just old developers who cling to the classics; young programmers are also discovering and adopting old languages for the first time. That could be because the languages have interesting libraries and features, or because the communities these developers are a part of have adopted the language as a group. - -“There’s a fixed amount of programmer attention in the world,” said Rabkin. “If a language delivers enough distinctive value, people will learn it and use it. If the people you exchange code and knowledge with you share a language, you’ll want to learn it. So for example, as long as those libraries are Python libraries and community expertise is Python experience, Python will do well.” - -Communities are a huge factor in how languages do, the researchers discovered. While there's not much difference between high level languages like Python and Ruby, for example, programmers are prone to develop strong feelings about the superiority of one over the other. - -“Rails didn’t have to be written in Ruby, but since it was, it proves there were social factors at work,” Rabkin says. “For example, the thing that resurrected Objective-C is that the Apple engineering team said, ‘Let’s use this.’ They didn’t have to pick it.” - -Through social influence and legacy code, our oldest and most popular computer languages have powerful inertia. How could Go surpass C? If the right people and companies say it ought to. - -“It comes down to who is better at evangelizing a language,” says Rabkin. - -Lead image by [Blake Patterson][4] - --------------------------------------------------------------------------------- - -via: http://readwrite.com/2014/09/02/programming-language-coding-lifetime - -作者:[Lauren Orsini][a] -译者:[runningwater](https://github.com/runningwater) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://readwrite.com/author/lauren-orsini -[1]:http://en.wikipedia.org/wiki/Brian_Kernighan -[2]:http://en.wikipedia.org/wiki/Dennis_Ritchie -[3]:http://asrabkin.bitbucket.org/papers/oopsla13.pdf -[4]:https://www.flickr.com/photos/blakespot/2444037775/ \ No newline at end of file diff --git a/sources/talk/20140915 10 Open Source Cloning Software For Linux Users.md b/sources/talk/20140915 10 Open Source Cloning Software For Linux Users.md index e96b5c37f5..ac9c87bf09 100644 --- a/sources/talk/20140915 10 Open Source Cloning Software For Linux Users.md +++ b/sources/talk/20140915 10 Open Source Cloning Software For Linux Users.md @@ -1,3 +1,5 @@ +[felixonmars translating...] + 10 Open Source Cloning Software For Linux Users ================================================================================ > These cloning software take all disk data, convert them into a single .img file and you can copy it to another hard drive. @@ -84,4 +86,4 @@ via: http://www.efytimes.com/e1/fullnews.asp?edid=148039 [7]:http://doclone.nongnu.org/ [8]:http://www.macrium.com/reflectfree.aspx [9]:http://www.runtime.org/driveimage-xml.htm -[10]:http://www.paragon-software.com/home/br-free/ \ No newline at end of file +[10]:http://www.paragon-software.com/home/br-free/ diff --git a/sources/talk/20140926 ChromeOS vs Linux--The Good, the Bad and the Ugly.md b/sources/talk/20140926 ChromeOS vs Linux--The Good, the Bad and the Ugly.md deleted file mode 100644 index 7ef89a4348..0000000000 --- a/sources/talk/20140926 ChromeOS vs Linux--The Good, the Bad and the Ugly.md +++ /dev/null @@ -1,108 +0,0 @@ -barney-ro translating - -ChromeOS vs Linux: The Good, the Bad and the Ugly -ChromeOS 对战 Linux : 孰优孰劣 仁者见仁 智者见智 -================================================================================ -> In the battle between ChromeOS and Linux, both desktop environments have strengths and weaknesses. - -> 在 ChromeOS 和 Linux 的斗争过程中,不管是哪一家的操作系统都是有优有劣。 - -Anyone who believes Google isn't "making a play" for desktop users isn't paying attention. In recent years, I've seen [ChromeOS][1] making quite a splash on the [Google Chromebook][2]. Exploding with popularity on sites such as Amazon.com, it looks as if ChromeOS could be unstoppable. - -任何不关注Google的人都不会相信Google在桌面用户当中扮演这一个很重要的角色。在近几年,我们见到的[ChromeOS][1]制造的[Google Chromebook][2]相当的轰动。和同期的人气火爆的Amazon一样,似乎ChromeOS势不可挡。 - -In this article, I'm going to look at ChromeOS as a concept to market, how it's affecting Linux adoption and whether or not it's a good/bad thing for the Linux community as a whole. Plus, I'll talk about the biggest issue of all and how no one is doing anything about it. - -在本文中,我们要了解的是ChromeOS概念的市场,ChromeOS怎么影响着Linux的使用,和整个 ChromeOS 对于一个社区来说,是好事还是坏事。另外,我将会谈到一些重大的事情,和为什么没人去为他做点什么事情。 - -### ChromeOS isn't really Linux ### - -### ChromeOS 并不是真正的Linux ### - -When folks ask me if ChromeOS is a Linux distribution, I usually reply that ChromeOS is to Linux what OS X is to BSD. In other words, I consider ChromeOS to be a forked operating system that uses the Linux kernel under the hood. Much of the operating system is made up of Google's own proprietary blend of code and software. - -每当有朋友问我说是否ChromeOS 是否是Linux 的一个分支时,我都会这样回答:ChromeOS 对于Linux 就好像是 OS X 对于BSD 。换句话说,我认为,ChromeOS 是一个派生的操作系统,运行于Linux 内核的引擎之下。很多操作系统就组成了Google 的专利代码和软件。 - -So while the ChromeOS is using the Linux kernel under its hood, it's still very different from what we might find with today's modern Linux distributions. - -尽管ChromeOS 是利用了Linux 内核引擎,但是它仍然有很大的不同和现在流行的Linux分支版本。 - -Where ChromeOS's difference becomes most apparent, however, is in the apps it offers the end user: Web applications. With everything being launched from a browser window, Linux users might find using ChromeOS to be a bit vanilla. But for non-Linux users, the experience is not all that different than what they may have used on their old PCs. - -ChromeOS和它们最大的不同就在于它给终端用户提供的app,包括Web 应用。因为ChromeOS 每一个操作都是开始于浏览器窗口,对于Linux 用户来说,可能会有很多不一样的感受,但是,对于没有Linux 经验的用户来说,这与他们使用的旧电脑并没有什么不同。 - -For example: Anyone who is living a Google-centric lifestyle on Windows will feel right at home on ChromeOS. Odds are this individual is already relying on the Chrome browser, Google Drive and Gmail. By extension, moving over to ChromeOS feels fairly natural for these folks, as they're simply using the browser they're already used to. - -就是说,每一个以Google-centric为生活方式的人来说,当他们回到家时在ChromeOS上的感觉将会非常良好。这样的优势就是这个人已经接受了Chrome 浏览器,Google 驱动器和Gmail 。久而久之,他们的亲朋好友也都对ChromeOs有了好感,就好像是他们很容易接受Chrome 流浪器,因为他们早已经用过。 - -Linux enthusiasts, however, tend to feel constrained almost immediately. Software choices feel limited and boxed in, plus games and VoIP are totally out of the question. Sorry, but [GooglePlus Hangouts][3] isn't a replacement for [VoIP][4] software. Not even by a long shot. - -然而,对于Linux 爱好者来说,这样就立即带来了不适应。软件的选择是受限制的,盒装的,在加上游戏和VoIP 是完全不可能的。对不起,因为[GooglePlus Hangouts][3]是代替不了VoIP 软件的。甚至在很长的一段时间里。 - -### ChromeOS or Linux on the desktop ### - -### ChromeOS 和Linux 的桌面化 ### -Anyone making the claim that ChromeOS hurts Linux adoption on the desktop needs to come up for air and meet non-technical users sometime. - -有人断言,ChromeOS 要是想在桌面系统中对Linux 产生影响,只有在Linux 停下来浮出水面换气的时候或者是满足某个非技术用户的时候。 - -Yes, desktop Linux is absolutely fine for most casual computer users. However it helps to have someone to install the OS and offer "maintenance" services like we see in the Windows and OS X camps. Sadly Linux lacks this here in the States, which is where I see ChromeOS coming into play. - -是的,桌面Linux 对于大多数休闲型的用户来说绝对是一个好东西。它有助于有专人安装操作系统,并且提供“维修”服务,从windows 和 OS X 的阵营来看。但是,令人失望的是,在美国Linux 正好在这个方面很缺乏。所以,我们看到,ChromeOS 慢慢的走入我们的视线。 - -I've found the Linux desktop is best suited for environments where on-site tech support can manage things on the down-low. Examples include: Homes where advanced users can drop by and handle updates, governments and schools with IT departments. These are environments where Linux on the desktop is set up to be used by users of any skill level or background. - -By contrast, ChromeOS is built to be completely maintenance free, thus not requiring any third part assistance short of turning it on and allowing updates to do the magic behind the scenes. This is partly made possible due to the ChromeOS being designed for specific hardware builds, in a similar spirit to how Apple develops their own computers. Because Google has a pulse on the hardware ChromeOS is bundled with, it allows for a generally error free experience. And for some individuals, this is fantastic! - -Comically, the folks who exclaim that there's a problem here are not even remotely the target market for ChromeOS. In short, these are passionate Linux enthusiasts looking for something to gripe about. My advice? Stop inventing problems where none exist. - -The point is: the market share for ChromeOS and Linux on the desktop are not even remotely the same. This could change in the future, but at this time, these two groups are largely separate. - -### ChromeOS use is growing ### - -No matter what your view of ChromeOS happens to be, the fact remains that its adoption is growing. New computers built for ChromeOS are being released all the time. One of the most recent ChromeOS computer releases is from Dell. Appropriately named the [Dell Chromebox][5], this desktop ChromeOS appliance is yet another shot at traditional computing. It has zero software DVDs, no anti-malware software, and offfers completely seamless updates behind the scenes. For casual users, Chromeboxes and Chromebooks are becoming a viable option for those who do most of their work from within a web browser. - -Despite this growth, ChromeOS appliances face one huge downside – storage. Bound by limited hard drive size and a heavy reliance on cloud storage, ChromeOS isn't going to cut it for anyone who uses their computers outside of basic web browser functionality. - -### ChromeOS and Linux crossing streams ### - -Previously, I mentioned that ChromeOS and Linux on the desktop are in two completely separate markets. The reason why this is the case stems from the fact that the Linux community has done a horrid job at promoting Linux on the desktop offline. - -Yes, there are occasional events where casual folks might discover this "Linux thing" for the first time. But there isn't a single entity to then follow up with these folks, making sure they’re getting their questions answered and that they're getting the most out of Linux. - -In reality, the likely offline discovery breakdown goes something like this: - -- Casual user finds out Linux from their local Linux event. -- They bring the DVD/USB device home and attempt to install the OS. -- While some folks very well may have success with the install process, I've been contacted by a number of folks with the opposite experience. -- Frustrated, these folks are then expected to "search" online forums for help. Difficult to do on a primary computer experiencing network or video issues. -- Completely fed up, some of the above frustrated bring their computers back into a Windows shop for "repair." In addition to Windows being re-installed, they also receive an earful about how "Linux isn't for them" and should be avoided. - -Some of you might charge that the above example is exaggerated. I would respond with this: It's happened to people I know personally and it happens often. Wake up Linux community, our adoption model is broken and tired. - -### Great platforms, horrible marketing and closing thoughts ### - -If there is one thing that I feel ChromeOS and Linux on the desktop have in common...besides the Linux kernel, it's that they both happen to be great products with rotten marketing. The advantage however, goes to Google with this one, due to their ability to spend big money online and reserve shelf space at big box stores. - -Google believes that because they have the "online advantage" that offline efforts aren't really that important. This is incredibly short-sighted and reflects one of Google's biggest missteps. The belief that if you're not exposed to their online efforts, you're not worth bothering with, is only countered by local shelf-space at select big box stores. - -My suggestion is this – offer Linux on the desktop to the ChromeOS market through offline efforts. This means Linux User Groups need to start raising funds to be present at county fairs, mall kiosks during the holiday season and teaching free classes at community centers. This will immediately put Linux on the desktop in front of the same audience that might otherwise end up with a ChromeOS powered appliance. - -If local offline efforts like this don't happen, not to worry. Linux on the desktop will continue to grow as will the ChromeOS market. Sadly though, it will absolutely keep the two markets separate as they are now. - --------------------------------------------------------------------------------- - -via: http://www.datamation.com/open-source/chromeos-vs-linux-the-good-the-bad-and-the-ugly-1.html - -作者:[Matt Hartley][a] -译者:[barney-ro](https://github.com/barney-ro) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://www.datamation.com/author/Matt-Hartley-3080.html -[1]:http://en.wikipedia.org/wiki/Chrome_OS -[2]:http://www.google.com/chrome/devices/features/ -[3]:https://plus.google.com/hangouts -[4]:http://en.wikipedia.org/wiki/Voice_over_IP -[5]:http://www.pcworld.com/article/2602845/dell-brings-googles-chrome-os-to-desktops.html diff --git a/sources/talk/20140928 What is a good subtitle editor on Linux.md b/sources/talk/20140928 What is a good subtitle editor on Linux.md deleted file mode 100644 index 1bbd854fad..0000000000 --- a/sources/talk/20140928 What is a good subtitle editor on Linux.md +++ /dev/null @@ -1,64 +0,0 @@ -What is a good subtitle editor on Linux -================================================================================ -If you watch foreign movies regularly, chances are you prefer having subtitles rather than the dub. Grown up in France, I know that most Disney movies during my childhood sounded weird because of the French dub. If now I have the chance to be able to watch them in their original version, I know that for a lot of people subtitles are still required. And I surprise myself sometimes making subtitles for my family. Hopefully for me, Linux is not devoid of fancy and open source subtitle editors. In short, this is the non-exhaustive list of open source subtitle editors for Linux. Share your opinion on what you think of the best subtitle editor. - -### 1. Gnome Subtitles ### - -![](https://farm6.staticflickr.com/5596/15323769611_59bc5fb4b7_z.jpg) - -[Gnome Subtitles][2] is a bit my go to when it comes to quickly editing some existing subtitles. You can load the video, load the subtitle text files and instantly get going. I appreciate its balance between ease of use and advanced features. It comes with a synchronization tool as well as a spell check. Finally, last but not least, the shortcuts are what makes it good in the end: when you edit a lot of lines, you prefer to keep your hands on the keyboard, and use the built in shortcuts to move around. - -### 2. Aegisub ### - -![](https://farm3.staticflickr.com/2944/15323964121_59e9b26ba5_z.jpg) - -[Aegisub][2] is already one level of complexity higher. Just the interface reflects a learning curve. But besides its intimidating aspect, Aegisub is very complete software, providing tools beyond anything I could have imagined before. Like Gnome Subtitles, Aegisub has a WYSIWYG approach, but to a whole new level: it is possible to drag and drop the subtitles on the screen, see the audio spectrum on the side, and do everything with shortcuts. In addition to that, it comes with a Kanji tool, a karaoke mode, and the possibility to import lua script to automate some tasks. I really invite you to go read the [manual page][3] before starting using it. - -### 3. Gaupol ### - -![](https://farm3.staticflickr.com/2942/15326817292_6702cc63fc_z.jpg) - -At the other end of the complexity spectrum is [Gaupol][4]. Unlike Aegisub, Gaupol is quick to pick up and adopts an interface very close to Gnome Subtitles. But behind this relative simplicity, it comes with all the necessary tools: shortcuts, third party extension, spell checking, and even speech recognition (courtesy of [CMU Sphinx][5]). As a downside, however, I did notice some slow-downs while testing it, nothing too serious, but just enough to make me prefer Gnome Subtitles still. - -### 4. Subtitle Editor ### - -![](https://farm4.staticflickr.com/3914/15323911521_8e33126610_z.jpg) - -[Subtitle Editor][6] is very close to Gaupol. However, the interface is a little bit less intuitive, and the features are slightly more advanced. I appreciate the possibility to define "key frames" and all the given synchronization options. However, maybe more icons and less text would enhance the interface. As a goodie, Subtitle Editor can simulate a "type writer" effect, while I am not sure if it is extremely useful. And last but not least, the possibility to redefine the shortcuts is always handy. - -### 5. Jubler ### - -![](https://farm4.staticflickr.com/3912/15323769701_3d94ca8884_z.jpg) - -Written in Java, [Jubler][7] is a multi-platform subtitle editor. I was actually very impressed by its interface. I definitely see the Java-ish aspect of it, but it remains well conceived and clear. Like Aegisub, you can drag and drop the subtitles on the image, making the experience far more pleasant than just typing. It is also possible to define a style for subtitles, play sound from another track, translate the subtitles, or use the spell checker. However, be careful as you will need MPlayer installed and correctly configured beforehand if you want to use Jubler fully. Oh and I give it a special credit for its easy installation process after downloading the script from the [official page][8]. - -### 6. Subtitle Composer ### - -![](https://farm6.staticflickr.com/5578/15323769711_6c6dfbe405_z.jpg) - -Defined as a "KDE subtitle composer," [Subtitle Composer][9] comes with most of the traditional features evoked previously, but with the KDE interface that we expect. This comes naturally with the option to redefine the shortcuts, which is very dear to me. But beyond all of this, what differentiates Subtitle Composer from all the previously mentioned programs is its ability to follow scripts written in JavaScript, Python, and even Ruby. A few examples are packaged with the software, and will definitely help you pick up the syntax and the usefulness of such feature. - -To conclude, whether you, like me, just edit a few subtitles for your family, re-synchronize the entire track, or write everything from scratch, Linux has the tools for you. For me in the end, the shortcuts and the ease-of-use make all the difference, but for any higher usage, scripting or speech recognition can become super handy. - -Which subtitle editor do you use and why? Or is there another one that you prefer not mentioned here? Let us know in the comments. - --------------------------------------------------------------------------------- - -via: http://xmodulo.com/good-subtitle-editor-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://gnomesubtitles.org/ -[2]:http://www.aegisub.org/ -[3]:http://docs.aegisub.org/3.2/Main_Page/ -[4]:http://home.gna.org/gaupol/ -[5]:http://cmusphinx.sourceforge.net/ -[6]:http://home.gna.org/subtitleeditor/ -[7]:http://www.jubler.org/ -[8]:http://www.jubler.org/download.html -[9]:http://sourceforge.net/projects/subcomposer/ \ No newline at end of file diff --git a/sources/talk/20140929 Shellshock--How to protect your Unix, Linux and Mac servers.md b/sources/talk/20140929 Shellshock--How to protect your Unix, Linux and Mac servers.md index 94cc23fb5d..c053e6d9e9 100644 --- a/sources/talk/20140929 Shellshock--How to protect your Unix, Linux and Mac servers.md +++ b/sources/talk/20140929 Shellshock--How to protect your Unix, Linux and Mac servers.md @@ -1,3 +1,4 @@ +luoyutiantan Shellshock: How to protect your Unix, Linux and Mac servers ================================================================================ > **Summary**: The Unix/Linux Bash security hole can be deadly to your servers. Here's what you need to worry about, how to see if you can be attacked, and what to do if your shields are down. @@ -97,4 +98,4 @@ via: http://www.zdnet.com/shellshock-how-to-protect-your-unix-linux-and-mac-serv [15]:http://apple.stackexchange.com/questions/146849/how-do-i-recompile-bash-to-avoid-the-remote-exploit-cve-2014-6271-and-cve-2014-7 [16]:https://bugzilla.redhat.com/show_bug.cgi?id=1141597#c27 [17]:http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2014-7169 -[18]:http://www.inmotionhosting.com/support/website/modsecurity/what-is-modsecurity-and-why-is-it-important \ No newline at end of file +[18]:http://www.inmotionhosting.com/support/website/modsecurity/what-is-modsecurity-and-why-is-it-important diff --git a/sources/talk/20140929 What Linux Users Should Know About Open Hardware.md b/sources/talk/20140929 What Linux Users Should Know About Open Hardware.md index 753a598a9f..2816764239 100644 --- a/sources/talk/20140929 What Linux Users Should Know About Open Hardware.md +++ b/sources/talk/20140929 What Linux Users Should Know About Open Hardware.md @@ -1,3 +1,4 @@ +zpl1025 What Linux Users Should Know About Open Hardware ================================================================================ > What Linux users don't know about manufacturing open hardware can lead them to disappointment. @@ -62,4 +63,4 @@ via: http://www.datamation.com/open-source/what-linux-users-should-know-about-op 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 -[a]:http://www.datamation.com/author/Bruce-Byfield-6030.html \ No newline at end of file +[a]:http://www.datamation.com/author/Bruce-Byfield-6030.html diff --git a/sources/talk/The history of Android/08 - The history of Android.md b/sources/talk/The history of Android/08 - The history of Android.md index 3bd0c3a8c5..589822dbc7 100644 --- a/sources/talk/The history of Android/08 - The history of Android.md +++ b/sources/talk/The history of Android/08 - The history of Android.md @@ -1,3 +1,5 @@ +alim0x translating + The history of Android ================================================================================ ![Android 1.5’s on-screen keyboard showing the suggestion bar while typing, the capital letters keyboard, the number and symbols screen, and an additional key popup.](http://cdn.arstechnica.net/wp-content/uploads/2013/12/kb5.png) @@ -88,15 +90,15 @@ The HTC Magic, the second Android device, and the first without a hardware keybo Photo by HTC > #### Google Maps is the first built-in app to hit the Android Market #### -> +> > While this article is (mostly) organizing app updates by Android version for simplicity's sake, there are a few outliers that deserve special recognition. On June 14, 2009, Google Maps was the first packed-in Android app to be updated via the Android Market. While every other app required a full system release to be updated, Maps was broken out of the OS, free to receive out-of-cycle updates whenever a new feature was ready. -> +> > Moving apps out of the core OS and onto the Android Market would be a big focus for Google going forward. In general, OTA updates were a big initiative—they required the cooperation of the OEM and the carrier, both of which could drag their feet. Updates also didn’t make it to every device. Today, the Android Market gives Google a direct line to every Android phone with no such interference from outside parties. -> +> > These were problems for a later date, though. In 2009, Google had only two unskinned phones to support, and the early Android carriers were seemingly responsive to Google’s update needs. This early move would prove to be a very proactive decision on Google’s part. At first, the company went this route only with its most important properties—Maps and Gmail—but later it would port the majority of the packed-in apps to the Android Market. Later initiatives like Google Play Services even brought app APIs out of the OS and into Google’s store. -> +> > As for the new Maps at the time, it gained a new directions interface, along with the ability to give mass transit and walking directions. For now, directions were given on a plain black list—turn-by-turn-style navigation would come later. -> +> > June 2009 was also the time Apple launched the third iPhone—the 3GS—and the third version of iPhone OS. iPhone OS 3's headline features were mostly catch-up items like copy/paste and MMS support. Apple's hardware was still nicer, and the software was smoother, more cohesive, and better designed. Google's insane pace of development was putting it on a path to parity though. iPhone OS 2 launched just before the Milestone 5 build of Android 0.5, which makes five Android releases in the span of the yearly iOS release cycle. Android 1.5 gave the YouTube app the ability to upload videos to the site. Uploading was accomplished by sharing a video from the Gallery to the YouTube app, or by opening a video directly from the YouTube app. This would bring up an upload screen, where the user would set things like the video title, tags, and access rights. Photos could be uploaded to Picasa, Google's original photo site, in a similar fashion. @@ -125,4 +127,4 @@ via: http://arstechnica.com/gadgets/2014/06/building-android-a-40000-word-histor [1]:http://en.wikipedia.org/wiki/Diacritic [a]:http://arstechnica.com/author/ronamadeo -[t]:https://twitter.com/RonAmadeo \ No newline at end of file +[t]:https://twitter.com/RonAmadeo diff --git a/sources/tech/20140724 Camicri Cube--An Offline And Portable Package Management System.md b/sources/tech/20140724 Camicri Cube--An Offline And Portable Package Management System.md index bcd2773a32..8854426a4e 100644 --- a/sources/tech/20140724 Camicri Cube--An Offline And Portable Package Management System.md +++ b/sources/tech/20140724 Camicri Cube--An Offline And Portable Package Management System.md @@ -1,3 +1,4 @@ +(翻译中 by runningwater) Camicri Cube: An Offline And Portable Package Management System ================================================================================ ![](http://180016988.r.cdn77.net/wp-content/uploads/2014/07/camicri-cube-206x205.jpg) @@ -158,7 +159,7 @@ via: http://www.unixmen.com/camicri-cube-offline-portable-package-management-sys [SK][a](Senthilkumar, aka SK, is a Linux enthusiast, FOSS Supporter & Linux Consultant from Tamilnadu, India. A passionate and dynamic person, aims to deliver quality content to IT professionals and loves very much to write and explore new things about Linux, Open Source, Computers and Internet.) -译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID) +译者:[runningwater](https://github.com/runningwater) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 diff --git a/sources/tech/20140818 What are useful CLI tools for Linux system admins.md b/sources/tech/20140818 What are useful CLI tools for Linux system admins.md index 261af07857..49bd994f71 100644 --- a/sources/tech/20140818 What are useful CLI tools for Linux system admins.md +++ b/sources/tech/20140818 What are useful CLI tools for Linux system admins.md @@ -1,3 +1,5 @@ +translating by haimingfg + What are useful CLI tools for Linux system admins ================================================================================ System administrators (sysadmins) are responsible for day-to-day operations of production systems and services. One of the critical roles of sysadmins is to ensure that operational services are available round the clock. For that, they have to carefully plan backup policies, disaster management strategies, scheduled maintenance, security audits, etc. Like every other discipline, sysadmins have their tools of trade. Utilizing proper tools in the right case at the right time can help maintain the health of operating systems with minimal service interruptions and maximum uptime. @@ -184,4 +186,4 @@ via: http://xmodulo.com/2014/08/useful-cli-tools-linux-system-admins.html [17]:http://rsync.samba.org/ [18]:http://www.nongnu.org/rdiff-backup/ [19]:http://nethogs.sourceforge.net/ -[20]:http://code.google.com/p/inxi/ \ No newline at end of file +[20]:http://code.google.com/p/inxi/ diff --git a/sources/tech/20140821 How to configure a network printer and scanner on Ubuntu desktop.md b/sources/tech/20140821 How to configure a network printer and scanner on Ubuntu desktop.md index 0703a11d9a..aefb970a23 100644 --- a/sources/tech/20140821 How to configure a network printer and scanner on Ubuntu desktop.md +++ b/sources/tech/20140821 How to configure a network printer and scanner on Ubuntu desktop.md @@ -1,3 +1,4 @@ +诗诗来翻译!disylee How to configure a network printer and scanner on Ubuntu desktop ================================================================================ In a [previous article][1](注:这篇文章在2014年8月12号的原文里做过,不知道翻译了没有,如果翻译发布了,发布此文章的时候可改成翻译后的链接), we discussed how to install several kinds of printers (and also a network scanner) in a Linux server. Today we will deal with the other end of the line: how to access the network printer/scanner devices from a desktop client. @@ -197,4 +198,4 @@ via: http://xmodulo.com/2014/08/configure-network-printer-scanner-ubuntu-desktop [a]:http://xmodulo.com/author/gabriel [1]:http://xmodulo.com/2014/08/usb-network-printer-and-scanner-server-debian.html [2]:http://www.cups-pdf.de/documentation.shtml -[3]:http://xmodulo.com/2014/08/usb-network-printer-and-scanner-server-debian.html#scanner \ No newline at end of file +[3]:http://xmodulo.com/2014/08/usb-network-printer-and-scanner-server-debian.html#scanner diff --git a/sources/tech/20140826 20 Postfix Interview Questions and Answers.md b/sources/tech/20140826 20 Postfix Interview Questions and Answers.md deleted file mode 100644 index 1848b82f09..0000000000 --- a/sources/tech/20140826 20 Postfix Interview Questions and Answers.md +++ /dev/null @@ -1,122 +0,0 @@ -20 Postfix Interview Questions & Answers -================================================================================ -### Q:1 What is postfix and default port used for postfix ? ### - -Ans: Postfix is a open source MTA (Mail Transfer agent) which is used to route & deliver emails. Postfix is the alternate of widely used Sendmail MTA. Default port for postfix is 25. - -### Q:2 What is the difference between Postfix & Sendmail ? ### - -Ans: Postfix uses a modular approach and is composed of multiple independent executables. Sendmail has a more monolithic design utilizing a single always running daemon. - -### Q:3 What is MTA and it’s role in mailing system ? ### - -Ans: MTA Stands for Mail Transfer Agent.MTA receives and delivers email. Determines message routing and possible address rewriting. Locally delivered messages are handed off to an MDA for final delivery. Examples Qmail, Postfix, Sendmail - -### Q:4 What is MDA ? ### - -Ans: MDA stands for Mail Delivery Agent. MDA is a Program that handles final delivery of messages for a system's local recipients. MDAs can often filter or categorize messages upon delivery. An MDA might also determine that a message must be forwarded to another email address. Example Procmail - -### Q:5 What is MUA ? ### - -Ans: MUA stands for Mail User Agent. MUA is aEmail client software used to compose, send, and retrieve email messages. Sends messages through an MTA. Retrieves messages from a mail store either directly or through a POP/ IMAP server. Examples Outlook, Thunderbird, Evolution. - -### Q:6 What is the use of postmaster account in Mailserver ? ### - -Ans: An email administrator is commonly referred to as a postmaster. An individual with postmaster responsibilities makes sure that the mail system is working correctly, makes configuration changes, and adds/removes email accounts, among other things. You must have a postmaster alias at all domains for which you handle email that directs messages to the correct person or persons . - -### Q:7 What are the important daemons in postfix ? ### - -Ans : Below are the lists of impportant daemons in postfix mail server : - -- **master** :The master daemon is the brain of the Postfix mail system. It spawns all other daemons. -- **smtpd**: The smtpd daemon (server) handles incoming connections. -- **smtp** :The smtp client handles outgoing connections. -- **qmgr** :The qmgr-Daemon is the heart of the Postfix mail system. It processes and controls all messages in the mail queues. -- **local** : The local program is Postfix’ own local delivery agent. It stores messages in mailboxes. - -### Q:8 What are the configuration files of postfix server ? ### - -Ans: There are two main Configuration files of postfix : - -- **/etc/postfix/main.cf** : This file holds global configuration options. They will be applied to all instances of a daemon, unless they are overridden in master.cf -- **/etc/postfix/master.cf** : This file defines runtime environment for daemons attached to services. Runtime behavior defined in main.cf may be overridden by setting service specific options. - -### Q:9 How to restart the postfix service & make it enable across reboot ? ### - -Ans: Use this command to restart service “ Service postfix restart” and to make the service persist across the reboot, use the command “ chkconfig postfix on” - -### Q:10 How to check the mail's queue in postfix ? ### - -Ans: Postfix maintains two queues, the pending mails queue, and the deferred mail queue,the deferred mail queue has the mail that has soft-fail and should be retried (Temporary failure), Postfix retries the deferred queue on set intervals (configurable, and by default 5 minutes) - -To display the list of queued mails : - - # postqueue -p - -To Save the output of above command : - - # postqueue -p > /mnt/queue-backup.txt - -Tell Postfix to process the Queue now - - # postqueue -f - -### Q:11 How to delete mails from the queue in postfix ? ### - -Ans: Use below command to delete all queued mails - - # postsuper -d ALL - -To delete only deferred mails from queue , use below command - - # postsuper -d ALL deferred - -### Q:12 How to check postfix configuration from the command line ? ### - -Ans: Using the command 'postconf -n' we can see current configuration of postfix excluding the lines which are commented. - -### Q:13 Which command is used to see live mail logs in postfix ? ### - -Ans: Use the command 'tail -f /var/log/maillog' or 'tailf /var/log/maillog' - -### Q:14 How to send a test mail from command line ? ### - -Ans: Use the below command to send a test mail from postfix itself : - -# echo "Test mail from postfix" | mail -s "Plz ignore" info@something.com - -### Q:15 What is an Open mail relay ? ### - -Ans: An open mail relay is an SMTP server configured in such a way that it allows anyone on the Internet to send e-mail through it, not just mail destined to or originating from known users.This used to be the default configuration in many mail servers; indeed, it was the way the Internet was initially set up, but open mail relays have become unpopular because of their exploitation by spammers and worms. - -### Q:16 What is relay host in postfix ? ### - -Ans: Relay host is the smtp address , if mentioned in postfix config file , then all the incoming mails be relayed through smtp server. - -### Q:17 What is Greylisting ? ### - -Ans: Greylisting is a method of defending e-mail users against spam. A mail transfer agent (MTA) using greylisting will "temporarily reject" any email from a sender it does not recognize. If the mail is legitimate the originating server will, after a delay, try again and, if sufficient time has elapsed, the email will be accepted. - -### Q:18 What is the importance of SPF records in mail servers ? ### - -Ans: SPF (Sender Policy Framework) is a system to help domain owners specify the servers which are supposed to send mail from their domain. The aim is that other mail systems can then check to make sure the server sending email from that domain is authorized to do so – reducing the chance of email 'spoofing', phishing schemes and spam! - -### Q:19 What is the use of Domain Keys(DKIM) in mail servers ? ### - -Ans: DomainKeys is an e-mail authentication system designed to verify the DNS domain of an e-mail sender and the message integrity. The DomainKeys specification has adopted aspects of Identified Internet Mail to create an enhanced protocol called DomainKeys Identified Mail (DKIM). - -### Q:20 What is the role of Anti-Spam SMTP Proxy (ASSP) in mail server ? ### - -Ans: ASSP is a gateway server which is install in front of your MTA and implements auto-whitelists, self learning Bayesian, Greylisting, DNSBL, DNSWL, URIBL, SPF, SRS, Backscatter, Virus scanning, attachment blocking, Senderbase and multiple other filter methods - --------------------------------------------------------------------------------- - -via: http://www.linuxtechi.com/postfix-interview-questions-answers/ - -作者:[Pradeep 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.linuxtechi.com/author/pradeep/ \ No newline at end of file diff --git a/sources/tech/20140901 How to install and configure ownCloud on Debian.md b/sources/tech/20140901 How to install and configure ownCloud on Debian.md deleted file mode 100644 index a0a18225b6..0000000000 --- a/sources/tech/20140901 How to install and configure ownCloud on Debian.md +++ /dev/null @@ -1,209 +0,0 @@ -How to install and configure ownCloud on Debian -================================================================================ -According to its official website, ownCloud gives you universal access to your files through a web interface or WebDAV. It also provides a platform to easily view, edit and sync your contacts, calendars and bookmarks across all your devices. Even though ownCloud is very similar to the widely-used Dropbox cloud storage, the primary difference is that ownCloud is free and open-source, making it possible to set up a Dropbox-like cloud storage service on your own server. With ownCloud, only you have complete access and control over your private data, with no limits on storage space (except for hard disk capacity) or the number of connected clients. - -ownCloud is available in Community Edition (free of charge) and Enterprise Edition (business-oriented with paid support). The pre-built package of ownCloud Community Edition is available for CentOS, Debian, Fedora openSUSE, SLE and Ubuntu. This tutorial will demonstrate how to install and configure ownCloud Community Edition on Debian Wheezy. - -### Installing ownCloud on Debian ### - -Go to the official website: [http://owncloud.org][1], and click on the 'Install' button (upper right corner). - -![](https://farm4.staticflickr.com/3885/14884771598_323f2fc01c_z.jpg) - -Now choose "Packages for auto updates" for the current version (v7 in the image below). This will allow you to easily keep ownCloud up to date using Debian's package management system, with packages maintained by the ownCloud community. - -![](https://farm6.staticflickr.com/5589/15071372505_298a796ff6_z.jpg) - -Then click on Continue on the next screen: - -![](https://farm6.staticflickr.com/5589/14884818527_554d1483f9_z.jpg) - -Select Debian 7 [Wheezy] from the list of available operating systems: - -![](https://farm6.staticflickr.com/5581/14884669449_433e3334e0_z.jpg) - -Add the ownCloud's official Debian repository: - - # echo 'deb http://download.opensuse.org/repositories/isv:/ownCloud:/community/Debian_7.0/ /' >> /etc/apt/sources.list.d/owncloud.list - -Add the repository key to apt: - - # wget http://download.opensuse.org/repositories/isv:ownCloud:community/Debian_7.0/Release.key - # apt-key add - < Release.key - -Go ahead and install ownCloud: - - # aptitude update - # aptitude install owncloud - -Open your web browser and navigate to your ownCloud instance, which can be found at http:///owncloud: - -![](https://farm4.staticflickr.com/3869/15071011092_f8f32ffe11_z.jpg) - -Note that ownCloud may be alerting about an Apache misconfiguration. Follow the steps below to solve this issue, and get rid of that error message. - -a) Edit the /etc/apache2/apache2.conf file (set the AllowOverride directive to All): - - - Options Indexes FollowSymLinks - AllowOverride All - Order allow,deny - Allow from all - - -b) Edit the /etc/apache2/conf.d/owncloud.conf file - - - Options Indexes FollowSymLinks MultiViews - AllowOverride All - Order allow,deny - Allow from all - - -c) Restart the web server: - - # service apache2 restart - -d) Refresh the web browser. Verify that the security warning has disappeared. - -![](https://farm6.staticflickr.com/5562/14884771428_fc9c063418_z.jpg) - -### Setting up a Database ### - -Now it's time to set up a database for ownCloud. - -First, log in to the local MySQL/MariaDB server: - - $ mysql -u root -h localhost -p - -Create a database and user account for ownCloud as follows. - - mysql> CREATE DATABASE owncloud_DB; - mysql> CREATE USER ‘owncloud-web’@'localhost' IDENTIFIED BY ‘whateverpasswordyouchoose’; - mysql> GRANT ALL PRIVILEGES ON owncloud_DB.* TO ‘owncloud-web’@'localhost'; - mysql> FLUSH PRIVILEGES; - -Go to ownCloud page at http:///owncloud, and choose the 'Storage & database' section. Enter the rest of the requested information (MySQL/MariaDB user, password, database and hostname), and click on Finish setup. - -![](https://farm6.staticflickr.com/5584/15071010982_b76c23c384_z.jpg) - -### Configuring ownCloud for SSL Connections ### - -Before you start using ownCloud, it is strongly recommended to enable SSL support in ownCloud. Using SSL provides important security benefits such as encrypting ownCloud traffic and providing proper authentication. In this tutorial, a self-signed certificate will be used for SSL. - -Create a new directory where we will store the server key and certificate: - - # mkdir /etc/apache2/ssl - -Create a certificate (and the key that will protect it) which will remain valid for one year. - - # openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/apache2/ssl/apache.key -out /etc/apache2/ssl/apache.crt - -![](https://farm6.staticflickr.com/5587/15068784081_f281b54b72_z.jpg) - -Edit the /etc/apache2/conf.d/owncloud.conf file to enable HTTPS. For details on the meaning of the rewrite rules NC, R, and L, you can refer to the [Apache docs][2]: - - Alias /owncloud /var/www/owncloud - - - RewriteEngine on - ReWriteCond %{SERVER_PORT} !^443$ - RewriteRule ^/(.*) https://%{HTTP_HOST}/$1 [NC,R,L] - - - - SSLEngine on - SSLCertificateFile /etc/apache2/ssl/apache.crt - SSLCertificateKeyFile /etc/apache2/ssl/apache.key - DocumentRoot /var/www/owncloud/ - - Options Indexes FollowSymLinks MultiViews - AllowOverride All - Order allow,deny - Allow from all - - - -Enable the rewrite module and restart Apache: - - # a2enmod rewrite - # service apache2 restart - -Open your ownCloud instance. Notice that even if you try to use plain HTTP, you will be automatically redirected to HTTPS. - -Be advised that even having followed the above steps, the first time that you launch your ownCloud instance, an error message will be displayed stating that the certificate has not been issued by a trusted authority (that is because we created a self-signed certificate). You can safely ignore this message, but if you are considering deploying ownCloud in a production server, you may want to purchase a certificate from a trusted company. - -### Create an Account ### - -Now we are ready to create an ownCloud admin account. - -![](https://farm6.staticflickr.com/5587/15048366536_430b4fd64e.jpg) - -Welcome to your new personal cloud! Note that you can install a desktop or mobile client app to sync your files, calendars, contacts and more. - -![](https://farm4.staticflickr.com/3862/15071372425_c391d912f5_z.jpg) - -In the upper right corner, click on your user name, and a drop-down menu is displayed: - -![](https://farm4.staticflickr.com/3897/15071372355_3de08d2847.jpg) - -Click on Personal to change your settings, such as password, display name, email address, profile picture, and more. - -### ownCloud Use Case: Access Calendar ### - -Let's start by adding an event to your calendar and later downloading it. - -Click on the upper left corner drop-down menu and choose Calendar. - -![](https://farm4.staticflickr.com/3891/15048366346_7dcc388244.jpg) - -Add a new event and save it to your calendar. - -![](https://farm4.staticflickr.com/3882/14884818197_f55154fd91_z.jpg) - -Download your calendar and add it to your Thunderbird calendar by going to 'Event and Tasks' -> 'Import...' -> 'Select file': - -![](https://farm4.staticflickr.com/3840/14884818217_16a53400f0_z.jpg) - -![](https://farm4.staticflickr.com/3871/15048366356_a7f98ca63d_z.jpg) - -TIP: You also need to set your time zone in order to successfully import your calendar in another application (by default, the Calendar application uses the UTC +00:00 time zone). To change the time zone, go to the bottom left corner and click on the small gear icon. The Calendar settings menu will appear and you will be able to select your time zone: - -![](https://farm4.staticflickr.com/3858/14884669029_4e0cd3e366.jpg) - -### ownCloud Use Case: Upload a File ### - -Next, we will upload a file from the client computer. - -Go to the Files menu (upper left corner) and click on the up arrow to open a select-file dialog. - -![](https://farm4.staticflickr.com/3851/14884818067_4a4cc73b40.jpg) - -Select a file and click on Open. - -![](https://farm6.staticflickr.com/5591/14884669039_5a9dd00ca9_z.jpg) - -You can then open/edit the selected file, move it into another folder, or delete it. - -![](https://farm4.staticflickr.com/3909/14884771088_d0b8a20ae2_o.png) - -### Conclusion ### - -ownCloud is a versatile and powerful cloud storage that makes the transition from another provider quick, easy, and painless. In addition, it is FOSS, and with little time and effort you can configure it to meet all your needs. For further information, you can always refer to the [User][3], [Admin][4], or [Developer][5] manuals. - --------------------------------------------------------------------------------- - -via: http://xmodulo.com/2014/08/install-configure-owncloud-debian.html - -作者:[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.gabrielcanepa.com.ar/ -[1]:http://owncloud.org/ -[2]:http://httpd.apache.org/docs/2.2/rewrite/flags.html -[3]:http://doc.owncloud.org/server/7.0/ownCloudUserManual.pdf -[4]:http://doc.owncloud.org/server/7.0/ownCloudAdminManual.pdf -[5]:http://doc.owncloud.org/server/7.0/ownCloudDeveloperManual.pdf \ No newline at end of file diff --git a/sources/tech/20140902 Photo Editing on Linux with Krita.md b/sources/tech/20140902 Photo Editing on Linux with Krita.md deleted file mode 100644 index c3e4367556..0000000000 --- a/sources/tech/20140902 Photo Editing on Linux with Krita.md +++ /dev/null @@ -1,76 +0,0 @@ -Photo Editing on Linux with Krita -================================================================================ -![Figure 1: Annabelle the pygmy goat.](http://www.linux.com/images/stories/41373/fig-1-annabelle.jpg) -Figure 1: Annabelle the pygmy goat. - -[Krita][1] is a wonderful drawing and painting program, and it's also a nice photo editor. Today we will learn how to add text to an image, and how to selectively sharpen portions of a photo. - -### Navigating Krita ### - -Like all image creation and editing programs, Krita contains hundreds of tools and options, and redundant controls for exposing and using them. It's worth taking some time to explore it and to see where everything is. - -The default theme for Krita is a dark theme. I'm not a fan of dark themes, but fortunately Krita comes with a nice batch of themes that you can change anytime in the Settings > Theme menu. - -Krita uses docking tool dialogues. Check Settings > Show Dockers to see your tool docks in the right and left panes, and Settings > Dockers to select the ones you want to see. The individual docks can drive you a little bit mad, as some of them open in a tiny squished aspect so you can't see anything. You can drag them to the top and sides of your Krita window, enlarge and shrink them, and you can drag them out of Krita to any location on your computer screen. If you drop a dock onto another dock they automatically create tabs. - -When you have arranged your perfect workspace, you can preserve it in the "Choose Workspace" picker. This is a button at the right end of the Brushes and Stuff toolbar (Settings > Toolbars Shown). This comes with a little batch of preset workspaces, and you can create your own (figure 2). - -![Figure 2: Preserve custom workspaces in the Choose Workspace dialogue.](http://www.linux.com/images/stories/41373/fig-2-workspaces.jpg) -Figure 2: Preserve custom workspaces in the Choose Workspace dialogue. - -Krita has multiple zoom controls. Ctrl+= zooms in, Ctrl+- zooms out, and Ctrl+0 resets to 100%. You can also use the View > Zoom controls, and the zoom slider at the bottom right. There is also a dropdown zoom menu to the left of the slider. - -The Tools menu sits in the left pane, and this contains your shape and selection tools. You have to hover your cursor over each tool to see its label. The Tool Options dock always displays options for the current tool you are using, and by default it sits in the right pane. - -### Crop Tool ### - -Of course there is a crop tool in the Tools dock, and it is very easy to use. Draw a rectangle that contains the area you want to keep, use the drag handles to adjust it, and press the Return key. In the Tools Options dock you can choose to apply the crop to all layers or just the current layer, adjust the dimensions by typing in the size values, or size it as a percentage. - -### Adding Text ### - -When you want to add some simple text to a photo, such as a label or a caption, Krita may leave you feeling overwhelmed because it contains so many artistic text effects. But it also supports adding simple text. Click the Text tool, and the Tool Options dock looks like figure 3. - -![Figure 3: Text options.](http://www.linux.com/images/stories/41373/fig-3-text.jpg) -Figure 3: Text options. - -Click the Multiline button. This opens the simple text tool; first draw a rectangle to contain your text, then start typing your text. The Tool Options dock has all the usual text formatting options: font selector, font size, text and background colors, alignment, and a bunch of paragraph styles. When you're finished click the Shape Handling tool, which is the white arrow next to the Text tool button, to adjust the size, shape, and position of your text box. The Tool Options for the Shape Handling tool include borders of various thicknesses, colors, and alignments. Figure 4 shows the gleeful captioned photo I send to my city-trapped relatives. - -![Figure 4: Green acres is the place to be.](http://www.linux.com/images/stories/41373/fig-4-frontdoor.jpg) -Figure 4: Green acres is the place to be. - -How to edit your existing text isn't obvious. Click the Shape Handling tool, and double-click inside the text box. This opens editing mode, which is indicated by the text cursor. Now you can select text, add new text, change formatting, and so on. - -### Sharpening Selected Areas ### - -Krita has a number of nice tools for making surgical edits. In figure 5 I want to sharpen Annabelle's face and eyes. (Annabelle lives next door, but she has a crush on my dog and spends a lot of time here. My dog is terrified of her and runs away, but she is not discouraged.) First select an area with the "Select an area by its outline" tool. Then open Filter > Enhance > Unsharp Mask. You have three settings to play with: Half-Size, Amount, and Threshold. Most image editing software has Radius, Amount, and Threshold settings. A radius is half of a diameter, so Half-Size is technically correct, but perhaps needlessly confusing. - -![Figure 5: Selecting an arbitrary area to edit.](http://www.linux.com/images/stories/41373/fig-5-annabelle.jpg) -Figure 5: Selecting an arbitrary area to edit. - -The Half-Size value controls the width of the sharpening lines. You want a large enough value to get a good affect, but not so large that it's obvious. - -The Threshold value determines how different two pixels need to be for the sharpening effect to be applied. 0 = maximum sharpening, and 99 is no sharpening. - -Amount controls the strength of the sharpening effect; higher values apply more sharpening. - -Sharpening is nearly always the last edit you want to make to a photo, because it is affected by anything else you do to your image: crop, resize, color and contrast... if you apply sharpening first and then make other changes it will mess up your sharpening. - -And what, you ask, does unsharp mask mean? The name comes from the sharpening technique: the unsharp mask filter creates a blurred mask of the original, and then layers the unsharp mask over the original. This creates an image that appears sharper and clearer without creating a lot of obvious sharpening artifacts. - -That is all for today. The documentation for Krita is abundant, but disorganized. Start at [Krita Tutorials][2], and poke around YouTube for a lot of good video how-tos. - -- [krita Official Web Site][1] - --------------------------------------------------------------------------------- - -via: http://www.linux.com/learn/tutorials/786040-photo-editing-on-linux-with-krita - -作者:[Carla Schroder][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://www.linux.com/community/forums/person/3734 -[1]:https://krita.org/ -[2]:https://krita.org/learn/tutorials/ \ No newline at end of file diff --git a/sources/tech/20140910 How to create a cloud-based encrypted file system on Linux.md b/sources/tech/20140910 How to create a cloud-based encrypted file system on Linux.md deleted file mode 100644 index 3eccb78edd..0000000000 --- a/sources/tech/20140910 How to create a cloud-based encrypted file system on Linux.md +++ /dev/null @@ -1,158 +0,0 @@ -[felixonmars translating...] - -How to create a cloud-based encrypted file system on Linux -================================================================================ -Commercial cloud storage services such as [Amazon S3][1] and [Google Cloud Storage][2] offer highly available, scalable, infinite-capacity object store at affordable costs. To accelerate wide adoption of their cloud offerings, these providers are fostering rich developer ecosystems around their products based on well-defined APIs and SDKs. Cloud-backed file systems are one popular by-product of such active developer communities, for which several open-source implementations exist. - -[S3QL][3] is one of the most popular open-source cloud-based file systems. It is a FUSE-based file system backed by several commercial or open-source cloud storages, such as Amazon S3, Google Cloud Storage, Rackspace CloudFiles, or OpenStack. As a full featured file system, S3QL boasts of a number of powerful capabilities, such as unlimited capacity, up to 2TB file sizes, compression, UNIX attributes, encryption, snapshots with copy-on-write, immutable trees, de-duplication, hardlink/symlink support, etc. Any bytes written to an S3QL file system are compressed/encrypted locally before being transmitted to cloud backend. When you attempt to read contents stored in an S3QL file system, the corresponding objects are downloaded from cloud (if not in the local cache), and decrypted/uncompressed on the fly. - -To be clear, S3QL does have limitations. For example, you cannot mount the same S3FS file system on several computers simultaneously, but only once at a time. Also, no ACL (access control list) support is available. - -In this tutorial, I am going to describe **how to set up an encrypted file system on top of Amazon S3, using S3QL**. As an example use case, I will also demonstrate how to run rsync backup tool on top of a mounted S3QL file system. - -### Preparation ### - -To use this tutorial, you will need to create an [Amazon AWS account][4] (sign up is free, but requires a valid credit card). - -If you haven't done so, first [create an AWS access key][4] (access key ID and secret access key) which is needed to authorize S3QL to access your AWS account. - -Now, go to AWS S3 via AWS management console, and create a new empty bucket for S3QL. - -![](https://farm4.staticflickr.com/3841/15170673701_7d0660e11f_c.jpg) - -For best performance, choose a region which is geographically closest to you. - -![](https://farm4.staticflickr.com/3902/15150663516_4928d757fc_b.jpg) - -### Install S3QL on Linux ### - -S3QL is available as a pre-built package on most Linux distros. - -#### On Debian, Ubuntu or Linux Mint: #### - - $ sudo apt-get install s3ql - -#### On Fedora: #### - - $ sudo yum install s3ql - -On Arch Linux, use [AUR][6]. - -### Configure S3QL for the First Time ### - -Create authinfo2 file in ~/.s3ql directory, which is a default S3QL configuration file. This file contains information about a required AWS access key, S3 bucket name and encryption passphrase. The encryption passphrase is used to encrypt the randomly-generated master encryption key. This master key is then used to encrypt actual S3QL file system data. - - $ mkdir ~/.s3ql - $ vi ~/.s3ql/authinfo2 - ----------- - - [s3] - storage-url: s3://[bucket-name] - backend-login: [your-access-key-id] - backend-password: [your-secret-access-key] - fs-passphrase: [your-encryption-passphrase] - -The AWS S3 bucket that you specify should be created via AWS management console beforehand. - -Make the authinfo2 file readable to you only for security. - - $ chmod 600 ~/.s3ql/authinfo2 - -### Create an S3QL File System ### - -You are now ready to create an S3QL file system on top of AWS S3. - -Use mkfs.s3ql command to create a new S3QL file system. The bucket name you supply with the command should be matched with the one in authinfo2 file. The "--ssl" option forces you to use SSL to connect to backend storage servers. By default, the mkfs.s3ql command will enable compression and encryption in the S3QL file system. - - $ mkfs.s3ql s3://[bucket-name] --ssl - -You will be asked to enter an encryption passphrase. Type the same passphrase as you defined in ~/.s3ql/autoinfo2 (under "fs-passphrase"). - -If a new file system was created successfully, you will see the following output. - -![](https://farm6.staticflickr.com/5582/14988587230_e182ca3abd_z.jpg) - -### Mount an S3QL File System ### - -Once you created an S3QL file system, the next step is to mount it. - -First, create a local mount point, and then use mount.s3ql command to mount an S3QL file system. - - $ mkdir ~/mnt_s3ql - $ mount.s3ql s3://[bucket-name] ~/mnt_s3ql - -You do not need privileged access to mount an S3QL file system. Just make sure that you have write access to the local mount point. - -Optionally, you can specify a compression algorithm to use (e.g., lzma, bzip2, zlib) with "--compress" option. Without it, lzma algorithm is used by default. Note that when you specify a custom compression algorithm, it will apply to newly created data objects, not existing ones. - - $ mount.s3ql --compress bzip2 s3://[bucket-name] ~/mnt_s3ql - -For performance reason, an S3QL file system maintains a local file cache, which stores recently accessed (partial or full) files. You can customize the file cache size using "--cachesize" and "--max-cache-entries" options. - -To allow other users than you to access a mounted S3QL file system, use "--allow-other" option. - -If you want to export a mounted S3QL file system to other machines over NFS, use "--nfs" option. - -After running mount.s3ql, check if the S3QL file system is successfully mounted: - - $ df ~/mnt_s3ql - $ mount | grep s3ql - -![](https://farm4.staticflickr.com/3863/15174861482_27a842da3e_z.jpg) - -### Unmount an S3QL File System ### - -To unmount an S3QL file system (with potentially uncommitted data) safely, use umount.s3ql command. It will wait until all data (including the one in local file system cache) has been successfully transferred and written to backend servers. Depending on the amount of write-pending data, this process can take some time. - - $ umount.s3ql ~/mnt_s3ql - -View S3QL File System Statistics and Repair an S3QL File System - -To view S3QL file system statistics, you can use s3qlstat command, which shows information such as total data/metadata size, de-duplication and compression ratio. - - $ s3qlstat ~/mnt_s3ql - -![](https://farm6.staticflickr.com/5559/15184926905_4815e5827a_z.jpg) - -You can check and repair an S3QL file system with fsck.s3ql command. Similar to fsck command, the file system being checked needs to be unmounted first. - - $ fsck.s3ql s3://[bucket-name] - -### S3QL Use Case: Rsync Backup ### - -Let me conclude this tutorial with one popular use case of S3QL: local file system backup. For this, I recommend using rsync incremental backup tool especially because S3QL comes with a rsync wrapper script (/usr/lib/s3ql/pcp.py). This script allows you to recursively copy a source tree to a S3QL destination using multiple rsync processes. - - $ /usr/lib/s3ql/pcp.py -h - -![](https://farm4.staticflickr.com/3873/14998096829_d3a64749d0_z.jpg) - -The following command will back up everything in ~/Documents to an S3QL file system via four concurrent rsync connections. - - $ /usr/lib/s3ql/pcp.py -a --quiet --processes=4 ~/Documents ~/mnt_s3ql - -The files will first be copied to the local file cache, and then gradually flushed to the backend servers over time in the background. - -For more information about S3QL such as automatic mounting, snapshotting, immuntable trees, I strongly recommend checking out the [official user's guide][7]. Let me know what you think of S3QL. Share your experience with any other tools. - - - - --------------------------------------------------------------------------------- - -via: http://xmodulo.com/2014/09/create-cloud-based-encrypted-file-system-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://aws.amazon.com/s3 -[2]:http://code.google.com/apis/storage/ -[3]:https://bitbucket.org/nikratio/s3ql/ -[4]:http://aws.amazon.com/ -[5]:http://ask.xmodulo.com/create-amazon-aws-access-key.html -[6]:https://aur.archlinux.org/packages/s3ql/ -[7]:http://www.rath.org/s3ql-docs/ diff --git a/sources/tech/20140910 How to download GOG games from the command line on Linux.md b/sources/tech/20140910 How to download GOG games from the command line on Linux.md deleted file mode 100644 index 081e22cb0f..0000000000 --- a/sources/tech/20140910 How to download GOG games from the command line on Linux.md +++ /dev/null @@ -1,75 +0,0 @@ -How to download GOG games from the command line on Linux -================================================================================ -If you are a gamer and a Linux user, you probably were delighted when [GOG][1] announced a few months ago that it will start proposing games for your favorite OS. If you have never heard of GOG before, I encourage you to check out their catalog of “good old games”, reasonably priced, DRM-free, and packed with goodies. However, if the Windows client for GOG existed for quite some time now, an official Linux version is nowhere to be seen. So if waiting for the official version is uncomfortable for you, an unofficial open source program named LGOGDownloader gives you access to your library from the command line. - -![](https://farm4.staticflickr.com/3843/15121593356_b13309c70f_z.jpg) - -### Install LGOGDownloader on Linux ### - -For Ubuntu users, the [official page][2] recommends that you download the sources and do: - - $ sudo apt-get install build-essential libcurl4-openssl-dev liboauth-dev libjsoncpp-dev libhtmlcxx-dev libboost-system-dev libboost-filesystem-dev libboost-regex-dev libboost-program-options-dev libboost-date-time-dev libtinyxml-dev librhash-dev help2man - $ tar -xvzf lgogdownloader-2.17.tar.gz - $ cd lgogdownloader-2.17 - $ make release - $ sudo make install - -If you are an Archlinux user, an [AUR package][2] is waiting for you. - -### Usage of LGOGDownloader ### - -Once the program is installed, you will need to identify yourself with the command: - - $ lgogdownloader --login - -![](https://farm6.staticflickr.com/5593/15121593346_9c5d02d5ce_z.jpg) - -Notice that the configuration file if you need it is at ~/.config/lgogdownloader/config.cfg - -Once authenticated, you can list all the games in your library with: - - $ lgogdownloader --list - -![](https://farm6.staticflickr.com/5581/14958040387_8321bb71cf.jpg) - -Then download one with: - - $ lgogdownloader --download --game [game name] - -![](https://farm6.staticflickr.com/5585/14958040367_b1c584a2d1_z.jpg) - -You will notice that lgogdownloader allows you to resume previously interrupted downloads, which is nice because typical game downloads are not small. - -Like every respectable command line utility, you can add various options: - -- **--platform [number]** to select your OS where 1 is for windows and 4 for Linux. -- **--directory [destination]** to download the installer in a particular directory. -- **--language [number]** for a particular language pack (check the manual pages for the number corresponding to your language). -- **--limit-rate [speed]** to limit the downloading rate at a particular speed. - -As a side bonus, lgogdownloader also comes with the possibility to check for updates on the GOG website: - - $ lgogdownloader --update-check - -![](https://farm4.staticflickr.com/3882/14958035568_7889acaef0.jpg) - -The result will list the number of forum and private messages you have received, as well as the number of updated games. - -To conclude, lgogdownloader is pretty standard when it comes to command line utilities. I would even say that it is an epitome of clarity and coherence. It is true that we are far in term of features from the relatively recent Steam Linux client, but on the other hand, the official GOG windows client does not do much more than this unofficial Linux version. In other words lgogdownloader is a perfect replacement. I cannot wait to see more Linux compatible games on GOG, especially after their recent announcements to offer DRM free movies, with a thematic around video games. Hopefully we will see an update in the client for when movie catalog matches the game library. - -What do you think of GOG? Would you use the unofficial Linux Client? Let us know in the comments. - --------------------------------------------------------------------------------- - -via: http://xmodulo.com/2014/09/download-gog-games-command-line-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://www.gog.com/ -[2]:https://sites.google.com/site/gogdownloader/home -[3]:https://aur.archlinux.org/packages/lgogdownloader/ \ No newline at end of file diff --git a/sources/tech/20140910 How to monitor server memory usage with Nagios Remote Plugin Executor (NRPE).md b/sources/tech/20140910 How to monitor server memory usage with Nagios Remote Plugin Executor (NRPE).md deleted file mode 100644 index 39e2270b87..0000000000 --- a/sources/tech/20140910 How to monitor server memory usage with Nagios Remote Plugin Executor (NRPE).md +++ /dev/null @@ -1,155 +0,0 @@ -How to monitor server memory usage with Nagios Remote Plugin Executor (NRPE) -================================================================================ -In a [previous tutorial][1]注:此篇文章在同一个更新中,如果也翻译了,发布的时候可修改相应的链接, we have seen how we can set up Nagios Remote Plugin Executor (NRPE) in an existing Nagios setup. However, the scripts and plugins needed to monitor memory usage do not come with stock Nagios. In this tutorial, we will see how we can configure NRPE to monitor RAM usage of a remote server. - -The script that we will use for monitoring RAM is available at [Nagios Exchange][2], as well as the creators' [Github repository][3]. - -Assuming that NRPE has already been set up, we start the process by downloading the script in the server that we want to monitor. - -### Preparing Remote Servers ### - -#### On Debain/Ubuntu: #### - - # cd /usr/lib/nagios/plugins/ - # wget https://raw.githubusercontent.com/justintime/nagios-plugins/master/check_mem/check_mem.pl - # mv check_mem.pl check_mem - # chmod +x check_mem - -#### On RHEL/CentOS: #### - - # cd /usr/lib64/nagios/plugins/ (or /usr/lib/nagios/plugins/ for 32-bit) - # wget https://raw.githubusercontent.com/justintime/nagios-plugins/master/check_mem/check_mem.pl - # mv check_mem.pl check_mem - # chmod +x check_mem - -You can check whether the script generates output properly by manually running the following command on localhost. When used with NRPE, this command is supposed to check free memory, warn when free memory is less than 20%, and generate critical alarm when free memory is less than 10%. - - # ./check_mem -f -w 20 -c 10 - ----------- - - OK - 34.0% (2735744 kB) free.|TOTAL=8035340KB;;;; USED=5299596KB;6428272;7231806;; FREE=2735744KB;;;; CACHES=2703504KB;;;; - -If you see something like the above as an output, that means the command is working okay. - -Now that the script is ready, we define the command to check RAM usage for NRPE. As mentioned before, the command will check free memory, warn when free memory is less than 20%, and generate critical alarm when free memory is less than 10%. - - # vim /etc/nagios/nrpe.cfg - -#### For Debian/Ubuntu: #### - - command[check_mem]=/usr/lib/nagios/plugins/check_mem -f -w 20 -c 10 - -#### For RHEL/CentOS 32 bit: #### - - command[check_mem]=/usr/lib/nagios/plugins/check_mem -f -w 20 -c 10 - -#### For RHEL/CentOS 64 bit: #### - - command[check_mem]=/usr/lib64/nagios/plugins/check_mem -f -w 20 -c 10 - -### Preparing Nagios Server ### - -In the Nagios server, we define a custom command for NRPE. The command can be stored in any directory within Nagios. To keep the tutorial simple, we will put the command definition in /etc/nagios directory. - -#### For Debian/Ubuntu: #### - - # vim /etc/nagios3/conf.d/nrpe_command.cfg - ----------- - - define command{ - command_name check_nrpe - command_line /usr/lib/nagios/plugins/check_nrpe -H '$HOSTADDRESS$' -c '$ARG1$' - } - -#### For RHEL/CentOS 32 bit: #### - - # vim /etc/nagios/objects/nrpe_command.cfg - ----------- - - define command{ - command_name check_nrpe - command_line /usr/lib/nagios/plugins/check_nrpe -H $HOSTADDRESS$ -c $ARG1$ - } - -#### For RHEL/CentOS 64 bit: #### - - # vim /etc/nagios/objects/nrpe_command.cfg - ----------- - - define command{ - command_name check_nrpe - command_line /usr/lib64/nagios/plugins/check_nrpe -H $HOSTADDRESS$ -c $ARG1$ - } - -Now we define the service check in Nagios. - -#### On Debian/Ubuntu: #### - - # vim /etc/nagios3/conf.d/nrpe_service_check.cfg - ----------- - - define service{ - use local-service - host_name remote-server - service_description Check RAM - check_command check_nrpe!check_mem - } - -#### On RHEL/CentOS: #### - - # vim /etc/nagios/objects/nrpe_service_check.cfg - ----------- - - define service{ - use local-service - host_name remote-server - service_description Check RAM - check_command check_nrpe!check_mem - } - -Finally, we restart the Nagios service. - -#### On Debian/Ubuntu: #### - - # service nagios3 restart - -#### On RHEL/CentOS 6: #### - - # service nagios restart - -#### On RHEL/CentOS 7: #### - - # systemctl restart nagios.service - -### Troubleshooting ### - -Nagios should start checking RAM usage of a remote-server using NRPE. If you are having any problem, you could check the following. - - -- Make sure that NRPE port is allowed all the way to the remote host. Default NRPE port is TCP 5666. -- You could try manually checking NRPE operation by executing the check_nrpe command: /usr/lib/nagios/plugins/check_nrpe -H remote-server -- You could also try to run the check_mem command manually: /usr/lib/nagios/plugins/check_nrpe -H remote-server –c check_mem -- In the remote server, set debug=1 in /etc/nagios/nrpe.cfg. Restart the NRPE service and check the log file /var/log/messages (RHEL/CentOS) or /var/log/syslog (Debain/Ubuntu). The log files should contain relevant information if there is any configuration or permission errors. If there are not hits in the log, it is very likely that the requests are not reaching the remote server due to port filtering at some point. - -To sum up, this tutorial demonstrated how we can easily tune NRPE to monitor RAM usage of remote servers. The process is as simple as downloading the script, defining the commands, and restarting the services. Hope this helps. - --------------------------------------------------------------------------------- - -via: http://xmodulo.com/2014/09/monitor-server-memory-usage-nagios-remote-plugin-executor.html - -作者:[Sarmed Rahman][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://xmodulo.com/author/sarmed -[1]:http://xmodulo.com/2014/03/nagios-remote-plugin-executor-nrpe-linux.html -[2]:http://exchange.nagios.org/directory/Plugins/Operating-Systems/Solaris/check_mem-2Epl/details -[3]:https://github.com/justintime/nagios-plugins/blob/master/check_mem/check_mem.pl \ No newline at end of file diff --git a/sources/tech/20140911 Sysstat--All-in-One System Performance and Usage Activity Monitoring Tool For Linux.md b/sources/tech/20140911 Sysstat--All-in-One System Performance and Usage Activity Monitoring Tool For Linux.md deleted file mode 100644 index 37cd6ca5f9..0000000000 --- a/sources/tech/20140911 Sysstat--All-in-One System Performance and Usage Activity Monitoring Tool For Linux.md +++ /dev/null @@ -1,125 +0,0 @@ -translating by cvsher -Sysstat – All-in-One System Performance and Usage Activity Monitoring Tool For Linux -================================================================================ -**Sysstat** is really a handy tool which comes with number of utilities to monitor system resources, their performance and usage activities. Number of utilities that we all use in our daily bases comes with sysstat package. It also provide the tool which can be scheduled using cron to collect all performance and activity data. - -![Install Sysstat in Linux](http://www.tecmint.com/wp-content/uploads/2014/08/sysstat.png) - -Install Sysstat in Linux - -Following are the list of tools included in sysstat packages. - -### Sysstat Features ### - -- [**iostat**][1]: Reports all statistics about your CPU and I/O statistics for I/O devices. -- **mpstat**: Details about CPUs (individual or combined). -- **pidstat**: Statistics about running processes/task, CPU, memory etc. -- **sar**: Save and report details about different resources (CPU, Memory, IO, Network, kernel etc..). -- **sadc**: System activity data collector, used for collecting data in backend for sar. -- **sa1**: Fetch and store binary data in sadc data file. This is used with sadc. -- **sa2**: Summaries daily report to be used with sar. -- **Sadf**: Used for displaying data generated by sar in different formats (CSV or XML). -- **Sysstat**: Man page for sysstat utility. -- **nfsiostat**-sysstat: I/O statistics for NFS. -- **cifsiostat**: Statistics for CIFS. - -Recenlty, on 17th of June 2014, **Sysstat 11.0.0** (stable version) has been released with some new interesting features as follows. - -pidstat command has been enhanced with some new options: first is “-R” which will provide information about the policy and task scheduling priority. And second one is “**-G**” which we can search processes with name and to get the list of all matching threads. - -Some new enhancement have been brought to sar, sadc and sadf with regards to the data files: Now data files can be renamed using “**saYYYYMMDD**” instead of “**saDD**” using option **–D** and can be located in directory different from “**/var/log/sa**”. We can define new directory by setting variable “SA_DIR”, which is being used by sa1 and sa2. - -### Installation of Sysstat in Linux ### - -The ‘**Sysstat**‘ package also available to install from default repository as a package in all major Linux distributions. However, the package which is available from the repo is little old and outdated version. So, that’s the reason, we here going to download and install the latest version of sysstat (i.e. version **11.0.0**) from source package. - -First download the latest version of sysstat package using the following link or you may also use **wget** command to download directly on the terminal. - -- [http://sebastien.godard.pagesperso-orange.fr/download.html][2] - - # wget http://pagesperso-orange.fr/sebastien.godard/sysstat-11.0.0.tar.gz - -![Download Sysstat Package](http://www.tecmint.com/wp-content/uploads/2014/08/Download-Sysstat.png) - -Download Sysstat Package - -Next, extract the downloaded package and go inside that directory to begin compile process. - - # tar -xvf sysstat-11.0.0.tar.gz - # cd sysstat-11.0.0/ - -Here you will have two options for compilation: - -a). Firstly, you can use **iconfig** (which will give you flexibility for choosing/entering the customized values for each parameters). - - # ./iconfig - -![Sysstat iconfig Command](http://www.tecmint.com/wp-content/uploads/2014/08/Sysstat-iconfig-Command.png) - -Sysstat iconfig Command - -b). Secondly, you can use standard **configure** command to define options in single line. You can run **./configure –help command** to get list of different supported options. - - # ./configure --help - -![Sysstat Configure Help](http://www.tecmint.com/wp-content/uploads/2014/08/Configure-Help.png) - -Sysstat Configure Help - -Here, we are moving ahead with standard option i.e. **./configure** command to compile sysstat package. - - # ./configure - # make - # make install - -![Configure Sysstat in Linux](http://www.tecmint.com/wp-content/uploads/2014/08/Configure-Sysstat.png) - -Configure Sysstat in Linux - -After compilation process completes, you will see the output similar to above. Now, verify the sysstat version by running following command. - - # mpstat -V - - sysstat version 11.0.0 - (C) Sebastien Godard (sysstat orange.fr) - -### Updating Sysstat in Linux ### - -By default sysstat use “**/usr/local**” as its prefix directory. So, all binary/utilities will get installed in “**/usr/local/bin**” directory. If you have existing sysstat package installed, then those will be there in “**/usr/bin**”. - -Due to existing sysstat package, you will not get your updated version reflected, because your “**$PATH**” variable don’t have “**/usr/local/bin set**”. So, make sure that “**/usr/local/bin**” exist there in your “$PATH” or set **–prefix** option to “**/usr**” during compilation and remove existing version before starting updating. - - # yum remove sysstat [On RedHat based System] - # apt-get remove sysstat [On Debian based System] - ----------- - - # ./configure --prefix=/usr - # make - # make install - -Now again, verify the updated version of systat using same ‘mpstat’ command with option ‘**-V**’. - - # mpstat -V - - sysstat version 11.0.0 - (C) Sebastien Godard (sysstat orange.fr) - -**Reference**: For more information please go through [Sysstat Documentation][3] - -That’s it for now, in my upcoming article, I will show some practical examples and usages of sysstat command, till then stay tuned to updates and don’t forget to add your valuable thoughts about the article at below comment section. - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/install-sysstat-in-linux/ - -作者:[Kuldeep Sharma][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/kuldeepsharma47/ -[1]:http://www.tecmint.com/linux-performance-monitoring-with-vmstat-and-iostat-commands/ -[2]:http://sebastien.godard.pagesperso-orange.fr/download.html -[3]:http://sebastien.godard.pagesperso-orange.fr/documentation.html diff --git a/sources/tech/20140926 How to manage configurations in Linux with Puppet and Augeas.md b/sources/tech/20140926 How to manage configurations in Linux with Puppet and Augeas.md deleted file mode 100644 index 12cc09c445..0000000000 --- a/sources/tech/20140926 How to manage configurations in Linux with Puppet and Augeas.md +++ /dev/null @@ -1,151 +0,0 @@ -How to manage configurations in Linux with Puppet and Augeas -================================================================================ -Although [Puppet][1](注:此文原文原文中曾今做过,文件名:“20140808 How to install Puppet server and client on CentOS and RHEL.md”,如果翻译发布过,可修改此链接为发布地址) is a really unique and useful tool, there are situations where you could use a bit of a different approach. Situations like modification of configuration files which are already present on several of your servers and are unique on each one of them at the same time. Folks from Puppet labs realized this as well, and integrated a great tool called [Augeas][2] that is designed exactly for this usage. - -Augeas can be best thought of as filling for the gaps in Puppet's capabilities where an object­specific resource type (such as the host resource to manipulate /etc/hosts entries) is not yet available. In this howto, you will learn how to use Augeas to ease your configuration file management. - -### What is Augeas? ### - -Augeas is basically a configuration editing tool. It parses configuration files in their native formats and transforms them into a tree. Configuration changes are made by manipulating this tree and saving it back into native config files. - -### What are we going to achieve in this tutorial? ### - -We will install and configure the Augeas tool for use with our previously built Puppet server. We will create and test several different configurations with this tool, and learn how to properly use it to manage our system configurations. - -### Prerequisites ### - -We will need a working Puppet server and client setup. If you don't have it, please follow my previous tutorial. - -Augeas package can be found in our standard CentOS/RHEL repositories. Unfortunately, Puppet uses Augeas ruby wrapper which is only available in the puppetlabs repository (or [EPEL][4]). If you don't have this repository in your system already, add it using following command: - -On CentOS/RHEL 6.5: - - # rpm -­ivh https://yum.puppetlabs.com/el/6.5/products/x86_64/puppetlabs­release­6­10.noarch.rpm - -On CentOS/RHEL 7: - - # rpm -­ivh https://yum.puppetlabs.com/el/7/products/x86_64/puppetlabs­release­7­10.noarch.rpm - -After you have successfully added this repository, install Ruby­Augeas in your system: - - # yum install ruby­augeas - -Or if you are continuing from my last tutorial, install this package using the Puppet way. Modify your custom_utils class inside of your /etc/puppet/manifests/site.pp to contain "ruby­augeas" inside of the packages array: - - class custom_utils { - package { ["nmap","telnet","vim­enhanced","traceroute","ruby­augeas"]: - ensure => latest, - allow_virtual => false, - } - } - -### Augeas without Puppet ### - -As it was said in the beginning, Augeas is not originally from Puppet Labs, which means we can still use it even without Puppet itself. This approach can be useful for verifying your modifications and ideas before applying them in your Puppet environment. To make this possible, you need to install one additional package in your system. To do so, please execute following command: - - # yum install augeas - -### Puppet Augeas Examples ### - -For demonstration, here are a few example Augeas use cases. - -#### Management of /etc/sudoers file #### - -1. Add sudo rights to wheel group - -This example will show you how to add simple sudo rights for group %wheel in your GNU/Linux system. - - # Install sudo package - package { 'sudo': - ensure => installed, # ensure sudo package installed - } - - # Allow users belonging to wheel group to use sudo - augeas { 'sudo_wheel': - context => '/files/etc/sudoers', # The target file is /etc/sudoers - changes => [ - # allow wheel users to use sudo - 'set spec[user = "%wheel"]/user %wheel', - 'set spec[user = "%wheel"]/host_group/host ALL', - 'set spec[user = "%wheel"]/host_group/command ALL', - 'set spec[user = "%wheel"]/host_group/command/runas_user ALL', - ] - } - -Now let's explain what the code does: **spec** defines the user section in /etc/sudoers, **[user]** defines given user from the array, and all definitions behind slash ( / ) are subparts of this user. So in typical configuration this would be represented as: - - user host_group/host host_group/command host_group/command/runas_user - -Which is translated into this line of /etc/sudoers: - - %wheel ALL = (ALL) ALL - -2. Add command alias - -The following part will show you how to define command alias which you can use inside your sudoers file. - - # Create new alias SERVICES which contains some basic privileged commands - augeas { 'sudo_cmdalias': - context => '/files/etc/sudoers', # The target file is /etc/sudoers - changes => [ - "set Cmnd_Alias[alias/name = 'SERVICES']/alias/name SERVICES", - "set Cmnd_Alias[alias/name = 'SERVICES']/alias/command[1] /sbin/service", - "set Cmnd_Alias[alias/name = 'SERVICES']/alias/command[2] /sbin/chkconfig", - "set Cmnd_Alias[alias/name = 'SERVICES']/alias/command[3] /bin/hostname", - "set Cmnd_Alias[alias/name = 'SERVICES']/alias/command[4] /sbin/shutdown", - ] - } - -Syntax of sudo command aliases is pretty simple: **Cmnd_Alias** defines the section of command aliases, **[alias/name]** binds all to given alias name, /alias/name **SERVICES** defines the actual alias name and alias/command is the array of all the commands that should be part of this alias. The output of this command will be following: - - Cmnd_Alias SERVICES = /sbin/service , /sbin/chkconfig , /bin/hostname , /sbin/shutdown - -For more information about /etc/sudoers, visit the [official documentation][5]. - -#### Adding users to a group #### - -To add users to groups using Augeas, you might want to add the new user either after the gid field or after the last user. We'll use group SVN for the sake of this example. This can be achieved by using the following command: - -In Puppet: - - augeas { 'augeas_mod_group: - context => '/files/etc/group', # The target file is /etc/group - changes => [ - "ins user after svn/*[self::gid or self::user][last()]", - "set svn/user[last()] john", - ] - } - -Using augtool: - - augtool> ins user after /files/etc/group/svn/*[self::gid or self::user][last()] augtool> set /files/etc/group/svn/user[last()] john - -### Summary ### - -By now, you should have a good idea on how to use Augeas in your Puppet projects. Feel free to experiment with it and definitely go through the official Augeas documentation. It will help you get the idea how to use Augeas properly in your own projects, and it will show you how much time you can actually save by using it. - -If you have any questions feel free to post them in the comments and I will do my best to answer them and advise you. - -### Useful Links ### - -- [http://www.watzmann.net/categories/augeas.html][6]: contains a lot of tutorials focused on Augeas usage. -- [http://projects.puppetlabs.com/projects/1/wiki/puppet_augeas][7]: Puppet wiki with a lot of practical examples. - --------------------------------------------------------------------------------- - -via: http://xmodulo.com/2014/09/manage-configurations-linux-puppet-augeas.html - -作者:[Jaroslav Štěpánek][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/jaroslav -[1]:http://xmodulo.com/2014/08/install-puppet-server-client-centos-rhel.html -[2]:http://augeas.net/ -[3]:http://xmodulo.com/manage-configurations-linux-puppet-augeas.html -[4]:http://xmodulo.com/2013/03/how-to-set-up-epel-repository-on-centos.html -[5]:http://augeas.net/docs/references/lenses/files/sudoers-aug.html -[6]:http://www.watzmann.net/categories/augeas.html -[7]:http://projects.puppetlabs.com/projects/1/wiki/puppet_augeas \ No newline at end of file diff --git a/sources/tech/20140928 How to Use Systemd Timers.md b/sources/tech/20140928 How to Use Systemd Timers.md deleted file mode 100644 index e7944cb0c9..0000000000 --- a/sources/tech/20140928 How to Use Systemd Timers.md +++ /dev/null @@ -1,112 +0,0 @@ -Translating by johnhoow... -How to Use Systemd Timers -================================================================================ -I was setting up some scripts to run backups recently, and decided I would try to set them up to use [systemd timers][1] rather than the more familiar to me [cron jobs][2]. - -As I went about trying to set them up, I had the hardest time, since it seems like the required information is spread around in various places. I wanted to record what I did so firstly, I can remember, but also so that others don’t have to go searching as far and wide as I did. - -There are additional options associated with the each step I mention below, but this is the bare minimum to get started. Look at the man pages for **systemd.service**, **systemd.timer**, and **systemd.target** for all that you can do with them. - -### Running a Single Script ### - -Let’s say you have a script **/usr/local/bin/myscript** that you want to run every hour. - -#### Service File #### - -First, create a service file, and put it wherever it goes on your Linux distribution (on Arch, it is either **/etc/systemd/system/** or **/usr/lib/systemd/system**). - -myscript.service - - [Unit] - Description=MyScript - - [Service] - Type=simple - ExecStart=/usr/local/bin/myscript - -Note that it is important to set the **Type** variable to be “simple”, not “oneshot”. Using “oneshot” makes it so that the script will be run the first time, and then systemd thinks that you don’t want to run it again, and will turn off the timer we make next. - -#### Timer File #### - -Next, create a timer file, and put it also in the same directory as the service file above. - -myscript.timer - - [Unit] - Description=Runs myscript every hour - - [Timer] - # Time to wait after booting before we run first time - OnBootSec=10min - # Time between running each consecutive time - OnUnitActiveSec=1h - Unit=myscript.service - - [Install] - WantedBy=multi-user.target - -#### Enable / Start #### - -Rather than starting / enabling the service file, you use the timer. - - # Start timer, as root - systemctl start myscript.timer - # Enable timer to start at boot - systemctl enable myscript.timer - -### Running Multiple Scripts on the Same Timer ### - -Now let’s say there a bunch of scripts you want to run all at the same time. In this case, you will want make a couple changes on the above formula. - -#### Service Files #### - -Create the service files to run your scripts as I [showed previously][3], but include the following section at the end of each service file. - - [Install] - WantedBy=mytimer.target - -If there is any ordering dependency in your service files, be sure you specify it with the **After=something.service** and/or **Before=whatever.service** parameters within the **Description** section. - -Alternatively (and perhaps more simply), create a wrapper script that runs the appropriate commands in the correct order, and use the wrapper in your service file. - -#### Timer File #### - -You only need a single timer file. Create **mytimer.timer**, as I [outlined above][4]. - -#### Target File #### - -You can create the target that all these scripts depend upon. - -mytimer.target - - [Unit] - Description=Mytimer - # Lots more stuff could go here, but it's situational. - # Look at systemd.unit man page. - -#### Enable / Start #### - -You need to enable each of the service files, as well as the timer. - - systemctl enable script1.service - systemctl enable script2.service - ... - systemctl enable mytimer.timer - systemctl start mytimer.service - -Good luck. - --------------------------------------------------------------------------------- - -via: http://jason.the-graham.com/2013/03/06/how-to-use-systemd-timers/#enable--start-1 - -作者:Jason Graham -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[1]:https://fedoraproject.org/wiki/User:Johannbg/QA/Systemd/Systemd.timer -[2]:https://en.wikipedia.org/wiki/Cron -[3]:http://jason.the-graham.com/2013/03/06/how-to-use-systemd-timers/#service-file -[4]:http://jason.the-graham.com/2013/03/06/how-to-use-systemd-timers/#timer-file-1 diff --git a/sources/tech/20140928 How to turn your CentOS box into an OSPF router using Quagga.md b/sources/tech/20140928 How to turn your CentOS box into an OSPF router using Quagga.md deleted file mode 100644 index 0aa4fb1f1d..0000000000 --- a/sources/tech/20140928 How to turn your CentOS box into an OSPF router using Quagga.md +++ /dev/null @@ -1,223 +0,0 @@ -How to turn your CentOS box into an OSPF router using Quagga -================================================================================ -[Quagga][1] is an open source routing software suite that can be used to turn your Linux box into a fully-fledged router that supports major routing protocols like RIP, OSPF, BGP or ISIS router. It has full provisions for IPv4 and IPv6, and supports route/prefix filtering. Quagga can be a life saver in case your production router is down, and you don't have a spare one at your disposal, so are waiting for a replacement. With proper configurations, Quagga can even be provisioned as a production router. - -In this tutorial, we will connect two hypothetical branch office networks (e.g., 192.168.1.0/24 and 172.17.1.0/24) that have a dedicated link between them. - -![](https://farm4.staticflickr.com/3861/15172727969_13cb7f037f_b.jpg) - -Our CentOS boxes are located at both ends of the dedicated link. The hostnames of the two boxes are set as 'site-A-RTR' and 'site-B-RTR' respectively. IP address details are provided below. - -- **Site-A**: 192.168.1.0/24 -- **Site-B**: 172.16.1.0/24 -- **Peering between 2 Linux boxes**: 10.10.10.0/30 - -The Quagga package consists of several daemons that work together. In this tutorial, we will focus on setting up the following daemons. - -1. **Zebra**: a core daemon, responsible for kernel interfaces and static routes. -1. **Ospfd**: an IPv4 OSPF daemon. - -### Install Quagga on CentOS ### - -We start the process by installing Quagga using yum. - - # yum install quagga - -On CentOS 7, SELinux prevents /usr/sbin/zebra from writing to its configuration directory by default. This SELinux policy interferes with the setup procedure we are going to describe, so we want to disable this policy. For that, either [turn off SELinux][2] (which is not recommended), or enable the 'zebra_write_config' boolean as follows. Skip this step if you are using CentOS 6. - - # setsebool -P zebra_write_config 1 - -Without this change, we will see the following error when attempting to save Zebra configuration from inside Quagga's command shell. - - Can't open configuration file /etc/quagga/zebra.conf.OS1Uu5. - -After Quagga is installed, we configure necessary peering IP addresses, and update OSPF settings. Quagga comes with a command line shell called vtysh. The Quagga commands used inside vtysh are similar to those of major router vendors such as Cisco or Juniper. - -### Phase 1: Configuring Zebra ### - -We start by creating a Zebra configuration file, and launching Zebra daemon. - - # cp /usr/share/doc/quagga-XXXXX/zebra.conf.sample /etc/quagga/zebra.conf - # service zebra start - # chkconfig zebra on - -Launch vtysh command shell: - - # vtysh - -First, we configure the log file for Zebra. For that, enter the global configuration mode in vtysh by typing: - - site-A-RTR# configure terminal - -and specify log file location, then exit the mode: - - site-A-RTR(config)# log file /var/log/quagga/quagga.log - site-A-RTR(config)# exit - -Save configuration permanently: - - site-A-RTR# write - -Next, we identify available interfaces and configure their IP addresses as necessary. - - site-A-RTR# show interface - ----------- - - Interface eth0 is up, line protocol detection is disabled - . . . . . - Interface eth1 is up, line protocol detection is disabled - . . . . . - -Configure eth0 parameters: - - site-A-RTR# configure terminal - site-A-RTR(config)# interface eth0 - site-A-RTR(config-if)# ip address 10.10.10.1/30 - site-A-RTR(config-if)# description to-site-B - site-A-RTR(config-if)# no shutdown - -Go ahead and configure eth1 parameters: - - site-A-RTR(config)# interface eth1 - site-A-RTR(config-if)# ip address 192.168.1.1/24 - site-A-RTR(config-if)# description to-site-A-LAN - site-A-RTR(config-if)# no shutdown - -Now verify configuration: - - site-A-RTR(config-if)# do show interface - ----------- - - Interface eth0 is up, line protocol detection is disabled - . . . . . - inet 10.10.10.1/30 broadcast 10.10.10.3 - . . . . . - Interface eth1 is up, line protocol detection is disabled - . . . . . - inet 192.168.1.1/24 broadcast 192.168.1.255 - . . . . . - ----------- - - site-A-RTR(config-if)# do show interface description - ----------- - - Interface Status Protocol Description - eth0 up unknown to-site-B - eth1 up unknown to-site-A-LAN - -Save configuration permanently: - - site-A-RTR(config-if)# do write - -Repeat the IP address configuration step on site-B server as well. - -If all goes well, you should be able to ping site-B's peering IP 10.10.10.2 from site-A server. - -Note that once Zebra daemon has started, any change made with vtysh's command line interface takes effect immediately. There is no need to restart Zebra daemon after configuration change. - -### Phase 2: Configuring OSPF ### - -We start by creating an OSPF configuration file, and starting the OSPF daemon: - - # cp /usr/share/doc/quagga-XXXXX/ospfd.conf.sample /etc/quagga/ospfd.conf - # service ospfd start - # chkconfig ospfd on - -Now launch vtysh shell to continue with OSPF configuration: - - # vtysh - -Enter router configuration mode: - - site-A-RTR# configure terminal - site-A-RTR(config)# router ospf - -Optionally, set the router-id manually: - - site-A-RTR(config-router)# router-id 10.10.10.1 - -Add the networks that will participate in OSPF: - - site-A-RTR(config-router)# network 10.10.10.0/30 area 0 - site-A-RTR(config-router)# network 192.168.1.0/24 area 0 - -Save configuration permanently: - - site-A-RTR(config-router)# do write - -Repeat the similar OSPF configuration on site-B as well: - - site-B-RTR(config-router)# network 10.10.10.0/30 area 0 - site-B-RTR(config-router)# network 172.16.1.0/24 area 0 - site-B-RTR(config-router)# do write - -The OSPF neighbors should come up now. As long as ospfd is running, any OSPF related configuration change made via vtysh shell takes effect immediately without having to restart ospfd. - -In the next section, we are going to verify our Quagga setup. - -### Verification ### - -#### 1. Test with ping #### - -To begin with, you should be able to ping the LAN subnet of site-B from site-A. Make sure that your firewall does not block ping traffic. - - [root@site-A-RTR ~]# ping 172.16.1.1 -c 2 - -#### 2. Check routing tables #### - -Necessary routes should be present in both kernel and Quagga routing tables. - - [root@site-A-RTR ~]# ip route - ----------- - - 10.10.10.0/30 dev eth0 proto kernel scope link src 10.10.10.1 - 172.16.1.0/30 via 10.10.10.2 dev eth0 proto zebra metric 20 - 192.168.1.0/24 dev eth1 proto kernel scope link src 192.168.1.1 - ----------- - - [root@site-A-RTR ~]# vtysh - site-A-RTR# show ip route - ----------- - - Codes: K - kernel route, C - connected, S - static, R - RIP, O - OSPF, - I - ISIS, B - BGP, > - selected route, * - FIB route - - O 10.10.10.0/30 [110/10] is directly connected, eth0, 00:14:29 - C>* 10.10.10.0/30 is directly connected, eth0 - C>* 127.0.0.0/8 is directly connected, lo - O>* 172.16.1.0/30 [110/20] via 10.10.10.2, eth0, 00:14:14 - C>* 192.168.1.0/24 is directly connected, eth1 - -#### 3. Verifying OSPF neighbors and routes #### - -Inside vtysh shell, you can check if necessary neighbors are up, and proper routes are being learnt. - - [root@site-A-RTR ~]# vtysh - site-A-RTR# show ip ospf neighbor - -![](https://farm3.staticflickr.com/2943/15160942468_d348241bd5_z.jpg) - -In this tutorial, we focused on configuring basic OSPF using Quagga. In general, Quagga allows us to easily configure a regular Linux box to speak dynamic routing protocols such as OSPF, RIP or BGP. Quagga-enabled boxes will be able to communicate and exchange routes with any other router that you may have in your network. Since it supports major open standard routing protocols, it may be a preferred choice in many scenarios. Better yet, Quagga's command line interface is almost identical to that of major router vendors like Cisco or Juniper, which makes deploying and maintaining Quagga boxes very easy. - -Hope this helps. - --------------------------------------------------------------------------------- - -via: http://xmodulo.com/turn-centos-box-into-ospf-router-quagga.html - -作者:[Sarmed Rahman][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://xmodulo.com/author/sarmed -[1]:http://www.nongnu.org/quagga/ -[2]:http://xmodulo.com/how-to-disable-selinux.html \ No newline at end of file diff --git a/sources/tech/20140928 How to use xargs command in Linux.md b/sources/tech/20140928 How to use xargs command in Linux.md deleted file mode 100644 index 9df6605a8e..0000000000 --- a/sources/tech/20140928 How to use xargs command in Linux.md +++ /dev/null @@ -1,117 +0,0 @@ -zpl1025 -How to use xargs command in Linux -================================================================================ -Have you ever been in the situation where you are running the same command over and over again for multiple files? If so, you know how tedious and inefficient this can feel. The good news is that there is an easier way, made possible through the xargs command in Unix-based operating systems. With this command you can process multiple files efficiently, saving you time and energy. In this tutorial, you will learn how to execute a command or script for multiple files at once, avoiding the daunting task of processing numerous log files or data files individually. - -There are two ingredients for the xargs command. First, you must specify the files of interest. Second, you must indicate which command or script will be executed for each of the files you specified. - -This tutorial will cover three scenarios in which the xargs command can be used to process files located within several different directories: - -1. Count the number of lines in all files -1. Print the first line of specific files -1. Process each file using a custom script - -Consider the following directory named xargstest (the directory tree can be displayed using the tree command with the combined -i and -f options, which print the results without indentation and with the full path prefix for each file): - - $ tree -if xargstest/ - -![](https://farm3.staticflickr.com/2942/15334985981_ce1a192def.jpg) - -The contents of each of the six files are as follows: - -![](https://farm4.staticflickr.com/3882/15346287662_a3084a8e4f_o.png) - -The **xargstest** directory, its subdirectories and files will be used in the following examples. - -### Scenario 1: Count the number of lines in all files ### - -As mentioned earlier, the first ingredient for the xargs command is a list of files for which the command or script will be run. We can use the find command to identify and list the files that we are interested in. The **-name 'file??'** option specifies that only files with names beginning with "file" followed by any two characters will be matched within the xargstest directory. This search is recursive by default, which means that the find command will search for matching files within xargstest and all of its sub-directories. - - $ find xargstest/ -name 'file??' - ----------- - - xargstest/dir3/file3B - xargstest/dir3/file3A - xargstest/dir1/file1A - xargstest/dir1/file1B - xargstest/dir2/file2B - xargstest/dir2/file2A - -We can pipe the results to the sort command to order the filenames sequentially: - - $ find xargstest/ -name 'file??' | sort - ----------- - - xargstest/dir1/file1A - xargstest/dir1/file1B - xargstest/dir2/file2A - xargstest/dir2/file2B - xargstest/dir3/file3A - xargstest/dir3/file3B - -We now need the second ingredient, which is the command to execute. We use the wc command with the -l option to count the number of newlines in each file (printed at the beginning of each output line): - - $ find xargstest/ -name 'file??' | sort | xargs wc -l - ----------- - - 1 xargstest/dir1/file1A - 2 xargstest/dir1/file1B - 3 xargstest/dir2/file2A - 4 xargstest/dir2/file2B - 5 xargstest/dir3/file3A - 6 xargstest/dir3/file3B - 21 total - -You'll see that instead of manually running the wc -l command for each of these files, the xargs command allows you to complete this operation in a single step. Tasks that may have previously seemed unmanageable, such as processing hundreds of files individually, can now be performed quite easily. - -### Scenario 2: Print the first line of specific files ### - -Now that you know the basics of how to use the xargs command, you have the freedom to choose which command you want to execute. Sometimes, you may want to run commands for only a subset of files and ignore others. In this case, you can use the find command with the -name option and the ? globbing character (matches any single character) to select specific files to pipe into the xargs command. For example, if you want to print the first line of all files that end with a "B" character and ignore the files that end with an "A" character, use the following combination of the find, xargs, and head commands (head -n1 will print the first line in a file): - - $ find xargstest/ -name 'file?B' | sort | xargs head -n1 - ----------- - - ==> xargstest/dir1/file1B <== - one - - ==> xargstest/dir2/file2B <== - one - - ==> xargstest/dir3/file3B <== - one - -You'll see that only the files with names that end with a "B" character were processed, and all files that end with an "A" character were ignored. - -### Scenario 3: Process each file using a custom script ### - -Finally, you may want to run a custom script (in Bash, Python, or Perl for example) for the files. To do this, simply substitute the name of your custom script in place of the wc and head commands shown previously: - - $ find xargstest/ -name 'file??' | xargs myscript.sh - -The custom script **myscript.sh** needs to be written to take a file name as an argument and process the file. The above command will then invoke the script for every file found by find command. - -Note that the above examples include file names that do not contain spaces. Generally speaking, life in a Linux environment is much more pleasant when using file names without spaces. If you do need to handle file names with spaces, the above commands will not work, and should be tweaked to accommodate them. This is accomplished with the -print0 option for find command (which prints the full file name to stdout, followed by a null character), and -0 option for xargs command (which interprets a null character as the end of a string), as shown below: - - $ find xargstest/ -name 'file*' -print0 | xargs -0 myscript.sh - -Note that the argument for the -name option has been changed to 'file*', which means any files with names beginning with "file" and trailed by any number of characters will be matched. - -### Summary ### - -After reading this tutorial you will understand the capabilities of the xargs command and how you can implement this into your workflow. Soon you'll be spending more time enjoying the efficiency offered by this command, and less time doing repetitive tasks. For more details and additional options you can read the xargs documentation by entering the 'man xargs' command in your terminal. - --------------------------------------------------------------------------------- - -via: http://xmodulo.com/xargs-command-linux.html - -作者:[Joshua Reed][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/joshua diff --git a/sources/tech/20140929 Git Rebase Tutorial--Going Back in Time with Git Rebase.md b/sources/tech/20140929 Git Rebase Tutorial--Going Back in Time with Git Rebase.md deleted file mode 100644 index 92274ad99f..0000000000 --- a/sources/tech/20140929 Git Rebase Tutorial--Going Back in Time with Git Rebase.md +++ /dev/null @@ -1,108 +0,0 @@ -Git Rebase Tutorial: Going Back in Time with Git Rebase -================================================================================ -![](https://www.gravatar.com/avatar/7c148ace0d63306091cc79ed9d9e77b4?d=mm&s=200) - -A programmer since the tender age of 10, Christoph Burgdorf is the the founder of the HannoverJS meetup, and he has been an active member in the AngularJS community since its very beginning. He is also very knowledgeable about the ins and outs of git, where he hosts workshops at [thoughtram][1] to help beginners master the technology. - -The following tutorial was originally posted on his [blog][2]. - ----------- - -### Tutorial: Git Rebase ### - -Imagine you are working on that radical new feature. It’s going to be brilliant but it takes a while. You’ve been working on that for a couple of days now, maybe weeks. - -Your feature branch is already six commits ahead of master. You’ve been a good developer and have crafted meaningful semantical commits. But there’s the thing: you are slowly realizing that this beast will still take some more time before it’s really ready to be merged back into master. - - m1-m2-m3-m4 (master) - \ - f1-f2-f3-f4-f5-f6(feature) - -What you also realize is that some parts are actually less coupled to the new feature. They could land in master earlier. Unfortunately, the part that you want to port back into master earlier is in a commit somewhere in the middle of your six commits. Even worse, it also contains a change that relies on a previous commits of your feature branch. One could argue that you should have made that two commits in the first place, but then nobody is perfect. - - m1-m2-m3-m4 (master) - \ - f1-f2-f3-f4-f5-f6(feature) - ^ - | - mixed commit - -At the time that you crafted the commit, you didn’t foresee that you might come into a situation where you want to gradually bring the feature into master. Heck! You wouldn’t have guessed that this whole thing could take us so long. - -What you need is a way to go back in history, open up the commit and split it into two commits so that you can separate out all the things that are safe to be ported back into master by now. - -Speaking in terms of a graph, we want to have it like this. - - m1-m2-m3-m4 (master) - \ - f1-f2-f3a-f3b-f4-f5-f6(feature) - -With the work split into two commits, we could just cherry-pick the precious bits into master. - -Turns out, git comes with a powerful command git rebase -i which lets us do exactly that. It lets us change the history. Changing the history can be problematic and as a rule of thumb should be avoided as soon as the history is shared with others. In our case though, we are just changing history of our local feature branch. Nobody will get hurt. Promised! - -Ok, let’s take a closer look at what exactly happened in commit f3. Turns out we modified two files: userService.js and wishlistService.js. Let’s say that the changes to userService.js could go straight back into master whereas the changes to wishlistService.js could not. Because wishlistService.js does not even exist in master. It was introduced in commit f1. - -> Pro Tip: even if the changes would have been in one file, git could handle that. We keep things simple for this blog post though. - -We’ve set up a [public demo repository][3] that we will use for this exercise. To make it easier to follow, each commit message is prefixed with the pseudo SHAs used in the graphs above. What follows is the branch graph as printed by git before we start to split the commit f3. - -![](https://s3.amazonaws.com/codementor_content/2014-Sep-week3/git1.png) - -Now the first thing we want to do is to checkout our feature branch with git checkout feature. To get started with the rebase we run git rebase -i master. - -Now what follows is that git opens a temporary file in the configured editor (defaults to Vim). - -![](https://s3.amazonaws.com/codementor_content/2014-Sep-week3/git2.png) - -This file is meant to provide you some options for the rebase and it comes with a little cheat sheet (the blue text). For each commit we could choose between the actions pick, reword, edit, squash, fixup and exec. Each action can also be referred to by its short form p, r, e, s, f and e. It’s out of the scope of this article to describe each and every option so let’s focus on our specific task. - -We want to choose the edit option for our f3 commit hence we change the contents to look like that. - -Now we save the file (in Vim followed by :wq, followed by ). The next thing we notice is that git stops the rebase at the commit for which we choose the edit option. - -What this means is that git started to apply f1, f2 and f3 as if it was a regular rebase but then stopped **after** applying f3. In fact, we can prove that if we just look at the log at the point where we stopped. - -To split our commit f3 into two commits, all we have to do at this point is to reset gits pointer to the previous commit (f2) while keeping the working directory the same as it is right now. This is exactly what the mixed mode of git reset does. Since mixed is the default mode of git reset we can just write git reset head~1. Let’s do that and also run git status right after it to see what happened. - -The git status tells us that both our userService.js and our wishlistService.js are modified. If we run git diff we can see that those are exactly the changes of our f3 commit. - -If we look at the log again at this point we see that the f3 is gone though. - -We are now at the point that we have the changes of our previous f3 commit ready to be committed whereas the original f3 commit itself is gone. Keep in mind though that we are still in the middle of a rebase. Our f4, f5 and f6 commits are not lost, they’ll be back in a moment. - -Let’s make two new commits: Let’s start with the commit for the changes made to the userService.js which are fine to get picked into master. Run git add userService.js followed by git commit -m "f3a: add updateUser method". - -Great! Let’s create another commit for the changes made to wishlistService.js. Run git add wishlistService.js followed by git commit -m "f3b: add addItems method". - -Let’s take a look at the log again. - -This is exactly what we wanted except our commits f4, f5 and f6 are still missing. This is because we are still in the middle of the interactive rebase and we need to tell git to continue with the rebase. This is done with the command git rebase --continue. - -Let’s check out the log again. - -And that’s it. We now have the history we wanted. The previous f3 commit is now split into two commits f3a and f3b. The only thing left to do is to cherry-pick the f3a commit over to the master branch. - -To finish the last step we first switch to the master branch. We do this with git checkout master. Now we can pick the f3a commit with the cherry-pick command. We can refer to the commit by its SHA key which is bd47ee1 in this case. - -We now have the f3a commit sitting on top of latest master. Exactly what we wanted! - -Given the length of the post this may seem like a lot of effort but it’s really only a matter of seconds for an advanced git user. - -> Note: Christoph is currently writing a book on [rebasing with Git][4] together with Pascal Precht, and you can subscribe to it at leanpub to get notified when it’s ready. - --------------------------------------------------------------------------------- - -via: https://www.codementor.io/git-tutorial/git-rebase-split-old-commit-master - -作者:[cburgdorf][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:https://www.codementor.io/cburgdorf -[1]:http://thoughtram.io/ -[2]:http://blog.thoughtram.io/posts/going-back-in-time-to-split-older-commits/ -[3]:https://github.com/thoughtram/interactive-rebase-demo -[4]:https://leanpub.com/rebase-the-complete-guide-on-rebasing-in-git \ No newline at end of file diff --git a/sources/tech/20140929 Learning Vim in 2014--Working with Files.md b/sources/tech/20140929 Learning Vim in 2014--Working with Files.md deleted file mode 100644 index 7f5f361c99..0000000000 --- a/sources/tech/20140929 Learning Vim in 2014--Working with Files.md +++ /dev/null @@ -1,89 +0,0 @@ -Learning Vim in 2014: Working with Files -================================================================================ -As a software developer, you shouldn't have to spend time thinking about how to get to the code you want to edit. One of the messiest parts of my transition to using Vim full time was its way of dealing with files. Coming to Vim after primarily using Eclipse and Sublime Text, it frustrated me that Vim doesn't bundle a persistent file system viewer, and the built-in ways of opening and switching files always felt extremely painful. - -At this point I appreciate the depth of Vim's file management features. I've put together a system that works for me even better than more visual editors once did. Because it's purely keyboard based, it allows me to move through my code much faster. That took some time though, and involves several plugins. But the first step was me understanding Vim's built in options for dealing with files. This post will be looking at the most important structures Vim provides you for file management, with a quick peek at some of the more advanced features you can get through plugins. - -### The Basics: Opening a new file ### - -One of the biggest obstacles to learning Vim is its lack of visual affordances. Unlike modern GUI based editors, there is no obvious way to do anything when you open a new instance of Vim in the terminal. Everything is done through keyboard commands, and while that ends up being more efficient for experienced users, new Vim users will find themselves looking up even basic commands routinely. So lets start with the basics. - -The command to open a new file in Vim is **:e . :e** opens up a new buffer with the contents of the file inside. If the file doesn't exist yet it opens up an empty buffer and will write to the file location you specify once you make changes and save. Buffers are Vim's term for a "block of text stored in memory". That text can be associated with an existing file or not, but there will be one buffer for each file you have open. - -After you open a file and make changes, you can save the contents of the buffer back to the file with the write command **:w**. If the buffer is not yet associated with a file or you want to save to a different location, you can save to a specific file with **:w **. You may need to add a ! and use **:w! ** if you're overwriting an existing file. - -This is the survival level knowledge for dealing with Vim files. Plenty of developers get by with just these commands, and its technically all you need. But Vim offers a lot more for those who dig a bit deeper. - -### Buffer Management ### - -Moving beyond the basics, let's talk some more about buffers. Vim handles open files a bit differently than other editors. Rather than leaving all open files visible as tabs, or only allowing you to have one file open at a time, Vim allows you to have multiple buffers open. Some of these may be visible while others are not. You can view a list of all open buffers at any time with **:ls**. This shows each open buffer, along with their buffer number. You can then switch to a specific buffer with the **:b ** command, or move in order along the list with the **:bnext** and **:bprevious** commands. (these can be shortened to **:bn** and **:bp** respectively). - -While these commands are the fundamental Vim solutions for managing buffers, I've found that they don't map well to my own way of thinking about files. I don't want to care about the order of buffers, I just want to go to the file I'm thinking about, or maybe to the file I was just in before the current one. So while its important to understand Vim's underlying buffer model, I wouldn't necessarily recommend its builtin commands as your main file management strategy. There are more powerful options available. - -![](http://benmccormick.org/content/images/2014/Jul/skitch.jpeg) - -### Splits ### - -One of the best parts of managing files in Vim is its splits. With Vim, you can split your current window into 2 windows at any time, and then resize and arrange them into any configuration you like. Its not unusual for me to have 6 files open at a given time, each with its own small split of the window. - -You can open a new split with **:sp ** or **:vs **, for horizontal and vertical splits respectively. There are keyword commands you can use to then resize the windows the way you want them, but to be honest this is the one Vim task I prefer to do with my mouse. A mouse gives me more precision without having to guess the number of columns I want or fiddle back and forth between 2 widths. - -After you create some splits, you can switch back and forth between them with **ctrl-w [h|j|k|l]**. This is a bit clunky though, and it's important for common operations to be efficient and easy. If you use splits heavily, I would personally recommend aliasing these commands to **ctrl-h** **ctrl-j** etc in your .vimrc using this snippet. - - nnoremap "Ctrl-j to move down a split - nnoremap "Ctrl-k to move up a split - nnoremap "Ctrl-l to move right a split - nnoremap "Ctrl-h to move left a split - -### The jumplist ### - -Splits solve the problem of viewing multiple related files at a time, but we still haven't seen a satisfactory solution for moving quickly between open and hidden files. The jumplist is one tool you can use for that. - -The jumplist is one of those Vim features that can appear weird or even useless at first. Vim keeps track of every motion command and file switch you make as you're editing files. Every time you "jump" from one place to another in a split, Vim adds an entry to the jumplist. While this may initially seem like a small thing, it becomes powerful when you're switching files a lot, or moving around in a large file. Instead of having to remember your place, or worry about what file you were in, you can instead retrace your footsteps quickly using some quick key commands. **Ctrl-o** allows you to jump back to your last jump location. Repeating it multiple times allows you to quickly jump back to the last file or code chunk you were working on, without having to keep the details of where that code is in your head. You can then move back up the chain with **ctrl-i**. This turns out to be immensely powerful when you're moving around in code quickly, debugging a problem in multiple files or flipping back and forth between 2 files. Instead of typing file names or remembering buffer numbers, you can just move up and down the existing path. It's not the answer to everything, but like other Vim concepts, it's a small focused tool that adds to the overall power of the editor without trying to do everything. - -### Plugins ### - -So let's be real, if you're coming to Vim from something like Sublime Text or Atom, there's a good chance all of this looks a bit arcane, scary, and inefficient. "Why would I want to type the full path to open a file when Sublime has fuzzy finding?" "How can I get a view of a project's structure without a sidebar to show the directory tree?" Legitimate questions. The good news is that Vim has solutions. They're just not baked into the Vim core. I'll touch more on Vim configuration and plugins in later posts, but for now here's a pointer to 3 helpful plugins that you can use to get Sublime-like file management. - -- [CtrlP][1] is a fuzzy finding file search similar to Sublime's "Go to Anything" bar. It's lightning fast and pretty configurable. I use it as my main way of opening new files. With it I only need to know part of the file name and don't need to memorize my project's directory structure. -- [The NERDTree][2] is a "file navigation drawer" plugin that replicates the side file navigation that many editors have. I actually rarely use it, as fuzzy search always seems faster to me. But it can be useful coming into a project, when you're trying to learn the project structure and see what's available. NERDTree is immensely configurable, and also replaces Vim's built in directory tools when installed. -- [Ack.vim][3] is a code search plugin for Vim that allows you to search across your project for text expressions. It acts as a light wrapper around Ack or Ag, [2 great code search tools][4], and allows you to quickly jump to any occurrence of a search term in your project. - -Between it's core and its plugin ecosystem, Vim offers enough tools to allow you to craft your workflow anyway you want. File management is a key part of a good software development system, and it's worth experimenting to get it right. - -Start with the basics for long enough to understand them, and then start adding tools on top until you find a comfortable workflow. It will all be worth it when you're able to seamlessly move to the code you want to work on without the mental overhead of figuring out how to get there. - -### More Resources ### - -- [Seamlessly Navigate Vim & Tmux Splits][5] This is a must read for anyone who wants to use vim with [tmux][6]. It presents an easy system for treating Vim and Tmux splits as equals, and moving between them easily. -- [Using Tab Pages][7] One file management feature I didn't cover, since it's poorly named and a bit confusing to use, is Vim's "tab" feature. This post on the Vim wiki gives a good overview of how you can use "tab pages" to have multiple views of your current workspace -- [Vimcasts: The edit command][8] Vimcasts in general is a great resource for anyone learning Vim, but this screenshot does a good job of covering the file opening basics mentioned above, with some suggestions on improving the builtin workflow - -### Subscribe ### - -This was the third in a series of posts on learning Vim in a modern way. If you enjoyed the post consider subscribing to the [feed][8] or joining my [mailing list][10]. I'll be continuing with [a post on Vim configuration next week][11] after a brief JavaScript interlude later this week. You should also checkout the first 2 posts in this series, on [the basics of using Vim][12], and [the language of Vim and Vi][13]. - --------------------------------------------------------------------------------- - -via: http://benmccormick.org/2014/07/07/learning-vim-in-2014-working-with-files/ - -作者:[Ben McCormick][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://benmccormick.org/2014/07/07/learning-vim-in-2014-working-with-files/ -[1]:https://github.com/kien/ctrlp.vim -[2]:https://github.com/scrooloose/nerdtree -[3]:https://github.com/mileszs/ack.vim -[4]:http://benmccormick.org/2013/11/25/a-look-at-ack/ -[5]:http://robots.thoughtbot.com/seamlessly-navigate-vim-and-tmux-splits -[6]:http://tmux.sourceforge.net/ -[7]:http://vim.wikia.com/wiki/Using_tab_pages -[8]:http://vimcasts.org/episodes/the-edit-command/ -[9]:http://feedpress.me/benmccormick -[10]:http://eepurl.com/WFYon -[11]:http://benmccormick.org/2014/07/14/learning-vim-in-2014-configuring-vim/ -[12]:http://benmccormick.org/2014/06/30/learning-vim-in-2014-the-basics/ -[13]:http://benmccormick.org/2014/07/02/learning-vim-in-2014-vim-as-language/ \ No newline at end of file diff --git a/sources/tech/20140929 Using GIT to backup your website files on linux.md b/sources/tech/20140929 Using GIT to backup your website files on linux.md deleted file mode 100644 index 2507bf80f2..0000000000 --- a/sources/tech/20140929 Using GIT to backup your website files on linux.md +++ /dev/null @@ -1,121 +0,0 @@ -wangjiezhe translating - -Using GIT to backup your website files on linux -================================================================================ -![](http://techarena51.com/wp-content/uploads/2014/09/git_logo-1024x480-580x271.png) - -Well not exactly Git but a software based on Git known as BUP. I generally use rsync to backup my files and that has worked fine so far. The only problem or drawback is that you cannot restore your files to a particular point in time. Hence, I started looking for an alternative and found BUP a git based software which stores your data in repositories and gives you the option to restore data to a particular point in time. - -With BUP you will first need to initialize an empty repository, then take a backup of all your files. When BUP takes a backup it creates a restore point which you can later restore to. It also creates an index of all your files, this index contains file attributes and checksum. When another backup is scheduled BUP compares the files with this attribute and only saves data if anything has changed. This saves you a lot of space. - -### Installing BUP (Tested on Centos 6 & 7) ### - -Ensure you have RPMFORGE and EPEL repos installed. - - [techarena51@vps ~]$sudo yum groupinstall "Development Tools" - [techarena51@vps ~]$ sudo yum install python python-devel - [techarena51@vps ~]$ sudo yum install fuse-python pyxattr pylibacl - [techarena51@vps ~]$ sudo yum install perl-Time-HiRes - [techarena51@vps ~]$ git clone git://github.com/bup/bup - [techarena51@vps ~]$cd bup - [techarena51@vps ~]$ make - [techarena51@vps ~]$ make test - [techarena51@vps ~]$sudo make install - -For debian/ubuntu users you can do “apt-get build-dep bup” on recent versions for more information check out https://github.com/bup/bup -You may get errors on CentOS 7 at “make test”, but you can continue to run make install. - -The first step like git is to initialize an empty repository. - - [techarena51@vps ~]$bup init - -By default, bup will store it’s repository under “~/.bup” but you can change that by setting the “export BUP_DIR=/mnt/user/bup” environment variable - -Next you create an index of all files. The index, as I mentioned earlier stores a listing of files, their attributes, and their git object ids (sha1 hashes). ( Attributes include soft links, permissions as well as the immutable bit - - bup index /path/to/file - bup save -n nameofbackup /path/to/file - - #Example - [techarena51@vps ~]$ bup index /var/www/html - Indexing: 7973, done (4398 paths/s). - bup: merging indexes (7980/7980), done. - - [techarena51@vps ~]$ bup save -n techarena51 /var/www/html - - Reading index: 28, done. - Saving: 100.00% (4/4k, 28/28 files), done. - bloom: adding 1 file (7 objects). - Receiving index from server: 1268/1268, done. - bloom: adding 1 file (7 objects). - -“BUP save” will split all the contents of the file into chunks and store them as objects. The “-n” option takes the name of backup. - -You can check a list of backups as well as a list of backed up files. - - [techarena51@vps ~]$ bup ls - local-etc techarena51 test - #Check for a list of backups available for my site - [techarena51@vps ~]$ bup ls techarena51 - 2014-09-24-064416 2014-09-24-071814 latest - #Check for the files available in these backups - [techarena51@vps ~]$ bup ls techarena51/2014-09-24-064416/var/www/html - apc.php techarena51.com wp-config-sample.php wp-load.php - -Backing up files on the same server is never a good option. BUP allows you to remotely backup your website files, you however need to ensure that your SSH keys and BUP are installed on the remote server. - - bup index path/to/dir - bup save-r remote-vps.com -n backupname path/to/dir - -### Example: Backing up the “/var/www/html” directory ### - - [techarena51@vps ~]$bup index /var/www/html - [techarena51@vps ~]$ bup save -r user@remotelinuxvps.com: -n techarena51 /var/www/html - Reading index: 28, done. - Saving: 100.00% (4/4k, 28/28 files), done. - bloom: adding 1 file (7 objects). - Receiving index from server: 1268/1268, done. - bloom: adding 1 file (7 objects). - -### Restoring your Backup ### - -Log into the remote server and type the following - - [techarena51@vps ~]$bup restore -C ./backup techarena51/latest - - #Restore an older version of the entire working dir elsewhere - [techarena51@vps ~]$bup restore -C /tmp/bup-out /testrepo/2013-09-29-195827 - #Restore one individual file from an old backup - [techarena51@vps ~]$bup restore -C /tmp/bup-out /testrepo/2013-09-29-201328/root/testbup/binfile1.bin - -The only drawback is you cannot restore files to another server, you have to manually copy the files via SCP or even rsync. - -View your backups via an integrated web server - - bup web - #specific port - bup web :8181 - -You can run bup along with a shell script and a cron job once everyday. - - #!/bin/bash - - bup index /var/www/html - bup save -r user@remote-vps.com: -n techarena51 /var/www/html - -BUP may not be perfect, but it get’s the job done pretty well. I would definitely like to see more development on this project and hopefully a remote restore as well. - -You may also like to read using [inotify-tools][1] for real time file syncing. - --------------------------------------------------------------------------------- - -via: http://techarena51.com/index.php/using-git-backup-website-files-on-linux/ - -作者:[Leo G][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://techarena51.com/ -[1]:http://techarena51.com/index.php/inotify-tools-example/ diff --git a/sources/tech/20140930 How to Boot Linux ISO Images Directly From Your Hard Drive.md b/sources/tech/20140930 How to Boot Linux ISO Images Directly From Your Hard Drive.md deleted file mode 100644 index 57af6aecb4..0000000000 --- a/sources/tech/20140930 How to Boot Linux ISO Images Directly From Your Hard Drive.md +++ /dev/null @@ -1,94 +0,0 @@ -How to Boot Linux ISO Images Directly From Your Hard Drive -================================================================================ -![](data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAooAAAEsAgMAAAA5t3pxAAAABGdBTUEAALGPC/xhBQAAAAxQTFRFAAAALAAeqKio/v7+NGqafgAABflJREFUeNrt3L1u4zgQB/DU7q+/8qCnuJegBQcQVLlY98RWhoKrDu4V4LZaHCAgp/chUuYpWAY6DofUh6PdtXcVcZL8ZUSmaSf5mSKHY0rJzQ22RbbflPTtTxhhhBFGGGGEEUYYYYQRRhhhhBFGGGH8zrY9e/xpVycxHup6X+/pvnWltp4zHlztrdvfe+Mu1BzqtYz1vvFGkrJ27jVK7em9NNHI35HSWO8P9Zf6UFPbfamjiPZU29bU9qsa1T9sVGMjy7f+HbgKFrk91e5COYVx6I+hTdU2tN7WtyXvyah8+dCsZbxv7r3D3avYjvu6dT3vU2/kHsj7ttk53Y5GzIr98T72x3owuiPvWi8a9/51vK/VLpTXNLrROmtU+2isg24w1usam2BshjFz6xX1yHjr3f2YabjbrhbD9xRp4j2PGYo5tfs6NBxl2ubW1bUNx55tfdhT+YD5GkYYYYQRRhhhhBFGGGGEEUYYYfyhsewEbm/RKPAYlzDCCCOMML4zoxFvNJqNBYy/aHwy9NW5vVyj1fRVKMlGvsEIo5gxY73RSjVW5slUrh1zt8d8DSOM78Y4Hs99Oe+r8j7BNImM5ayxGBlj1rZOFjdndL941qhEGSmC+0hON81RvTMlR3dDJiqtlWl+Y762RnMWSWWeHelYc51SZLJ6rUzz2zmFor0vcw0b+egWo/rXzz7mjJ1rRXe8qS19eWo8RqNKaaTfqg23mVHnxtzIN9I4F2G0peJxcz5muB8OxjUyzXljpV2c8fFniD0um7SVoTqOPWa1TPPS+Trl6sp7MiI3+2DG2U6pkxin8bjo9/lZTWVKs8YK4K8Y3WykUhmti9XPluIz52EUyTvfYs/+mVhDc00+ys7XNRr9WMRcsQizNZWo9rGINSmNT5qN47n5hdH3x86kM3bWGxUbO3vsjfRMrKH30D3nicaMUWOjO6Kmb0fl29HX+GxSpTZqy0alz41KJzdyf1TlZMzkL8eMM6aKj5V5LHyGqGlNgiINfUIgIz0Ta6rwOTbxXKilzoXDVqVMG5GbwfgT+eOwXRIp9WKx55r8cWosZ346xfnOZUyle1ysbOT88XttmYefWfr1DkpSljJelz9yjKJX0/pk3j/ycd5Hr8/uZsIaR76Y8Zr8UYXZ02paa8n7Ryyin0DHmuasJY3X5Y88mMLvZ2NYpxwb3SvNssZr8kf6riOtUzpJZQfj0Rs7y8YhT0qRP/qxYWgVsD/WYZ3St6OKRv1KxkvyRw57L41KT41maeMV+WO/gk5Gm49WTidjht7xgrHnuvwxRhvjemOlKxse8dqlpVe4vbvv7JIx/Lr88bqjpxc3XpI/Js/DkZt9AKMRbvRnjUbjIfcPS7+nKLL2J7FLjKU/769DjORMI7VRm+l56c/KTYHOVggzjs9L5zTZ+jzaG5UEY3l2rtK5vNF44/ENGHMj5VhPjZSpunzW56tKyzQq345K0Jihc9bj89JkLDmNFWSs9Pi8tMsJ/ed3STEcOQWMMP6EUcs20nwyGFNEmwvi46QdU0TtS4x05VG81lGqka+A5PXHFBnjBf2xzyn8WkqCjPGSduz4ejiaqZNkjBcd634lNk3GeL1R8pgxIXuUHHvcvZYaw5FTLGDcttK2/2B8XWPWPog23kyMd5u77C6TZswyMsbtoc1O2UmWkUx32e/Z15b2Mo1//EumzYlsm5M3ttKMf58yf3P90bffQ/uXOOPXLDvdbMh4t2HjQyayHdvsFPthbE9x/XFiFDmuszBmNlKNFMMp6rjY7W0yYzhyigWMyMM/mHF8HUcu0mhGLr5qqEi6DvnN9cfeqFS8+jHVWsC8sVRPhkXWUrkz8oy5sjoaqRzaUcky8t/l0nWGVGbjUaCRr4UcjKnWIX9kNCOj0jKP9dho5BnDX9nLNHaW/hdAFf4rAZXpyh5ZMRw5BYwwwggjjDDCCCOMMMIII4wwwggjjDDCCCOMMMIII4wwwggjjDDCCCOMMMIII4wwwggjjDDCCCOMMMIII4wwwggjjDDCCCOMMMIIo3TjG9j+B4tUkGfI5p/jAAAAAElFTkSuQmCC) - -Linux’s GRUB2 boot loader can boot Linux ISO files directly from your hard drive. Boot Linux live CDs or even install Linux on another hard drive partition without burning it to disc or booting from a USB drive. - -We performed this process on Ubuntu 14.04 — Ubuntu and Ubuntu-based Linux distributions have good support for this. [Other Linux distributions][1] should work similarly. - -### Get a Linux ISO File ### - -This trick requires you have a Linux system installed on your hard drive. Your computer must be using [the GRUB2 boot loader][2], which is a standard boot loader on most Linux systems. Sorry, you can’t boot a Linux ISO file directly from a Windows system using the Windows boot loader. - -Download the ISO files you want to use and store them on your Linux partition. GRUB2 should support most Linux systems. if you want to use them in a live environment without installing them to your hard drive, be sure to download the “[live CD][3]” versions of each Linux ISO. Many Linux-based bootable utility discs should also work. - -### Check the Contents of the ISO File ### - -You may need to look inside the ISO file to determine exactly where specific files are. For example, you can do this by opening the ISO file with the Archive Manager/File Roller graphical application that comes with Ubuntu and other GNOME-based desktop environments. In the Nautilus file manager, right-click the ISO file and select Open with Archive Manager. - -Locate the kernel file and the initrd image. If you’re using a Ubuntu ISO file, you’ll find these files inside the casper folder — the vmlinuz file is the Linux kernel and the initrd file is the initrd image. You’ll need to know their location inside the ISO file later. - -![](http://cdn8.howtogeek.com/wp-content/uploads/2014/09/650x350xvmlinuz-and-initrd-file-locations.png.pagespeed.ic.hB1yMlHMr2.png) - -### Determine the Hard Drive Partition’s Path ### - -GRUB uses a different “device name” scheme than Linux does. On a Linux system, /dev/sda0 is the first partition on the first hard disk — **a** means the first hard disk and **0** means its first partition. In GRUB, (hd0,1) is equivalent to /dev/sda0. The **0** means the first hard disk, while the **1** means the first partition on it. In other words, in a GRUB device name, the disk numbers start counting at 0 and the partition num6ers start counting at 1 — yes, it’s unnecessarily confusing. For example, (hd3,6) refers to the sixth partition on the fourth hard disk. - -You can use the **fdisk -l** command to view this information. On Ubuntu, open a Terminal and run the following command: - - sudo fdisk -l - -You’ll see a list of Linux device paths, which you can convert to GRUB device names on your own. For example, below we can see the system partition is /dev/sda1 — so that’s (hd0,1) for GRUB. - -![](http://cdn8.howtogeek.com/wp-content/uploads/2014/09/650x410xfdisk-l-command.png.pagespeed.ic.yW7uP1_G0C.png) - -### Create the GRUB2 Boot Entry ### - -The easiest way to add a custom boot entry is to edit the /etc/grub.d/40_custom script. This file is designed for user-added custom boot entries. After editing the file, the contents of your /etc/defaults/grub file and the /etc/grub.d/ scripts will be combined to create a /boot/grub/grub.cfg file — you shouldn’t edit this file by hand. It’s designed to be automatically generated from settings you specify in other files. - -You’ll need to open the /etc/grub.d/40_custom file for editing with root privileges. On Ubuntu, you can do this by opening a Terminal window and running the following command: - - sudo gedit /etc/grub.d/40_custom - -Feel free to open the file in your favorite text editor. For example, you could replace “gedit” with “nano” in the command to open the file in [the Nano text editor][4]. - -Unless you’ve added other custom boot entries, you should see a mostly empty file. You’ll need to add one or more ISO-booting sections to the file below the [commented][5] lines. - -![](http://cdn8.howtogeek.com/wp-content/uploads/2014/09/650x300xadd-custom-boot-menu-entries-to-grub.png.pagespeed.ic.uUT-Yls8xf.png) - -Here’s how you can boot an Ubuntu or Ubuntu-based distribution from an ISO file. We tested this with Ubuntu 14.04: - - menuentry “Ubuntu 14.04 ISO” { - set isofile=”/home/name/Downloads/ubuntu-14.04.1-desktop-amd64.iso” - loopback loop (hd0,1)$isofile - linux (loop)/casper/vmlinuz.efi boot=casper iso-scan/filename=${isofile} quiet splash - initrd (loop)/casper/initrd.lz - } - -Customize the boot entry to contain your desiredmenu entry name, the correct path to the ISO file on your computer, and the device name of the hard disk and partition containing the ISO file. If the vmlinuz and initrd files have different names or paths, be sure to specify the correct path to those files, too. - -(If you have a separate /home/ partition, omit the /home bit, like so: **set isofile=”/name/Downloads/${isoname}”**). - -**Important Note**: Different Linux distributions require different boot entries with different boot options. The GRUB Live ISO Multiboot project offers a variety of [menu entries for different Linux distributions][6]. You should be able to adapt these example menu entries for the ISO file you want to boot. You can also just perform a web search for the name and release number of the Linux distribution you want to boot along with “boot from ISO in GRUB” to find more information. - -![](http://cdn8.howtogeek.com/wp-content/uploads/2014/09/650x392xadd-a-linux-iso-file-to-grub-boot-loader.png.pagespeed.ic.2FR0nOtugC.png) - -If you want to add more ISO boot options, add additional sections to the file. - -Save the file when you’re done. Return to a Terminal window and run the following command: - - sudo update-grub - -![](http://cdn8.howtogeek.com/wp-content/uploads/2014/09/650x249xgenerate-grub.cfg-on-ubuntu.png.pagespeed.ic.5I70sH4ZRs.png) - -The next time you boot your computer, you’ll see the ISO boot entry and you can choose it to boot the ISO file. You may have to hold Shift while booting to see the GRUB menu. - -If you see an error message or a black screen when you attempt to boot the ISO file, you misconfigured the boot entry somehow. Even if you got the ISO file path and device name right, the paths to the vmlinuz and intird files on the ISO file may not be correct or the Linux system you’re booting may require different options. - --------------------------------------------------------------------------------- - -via: http://www.howtogeek.com/196933/how-to-boot-linux-iso-images-directly-from-your-hard-drive/ - -作者:[Chris Hoffman][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://www.howtogeek.com/author/chrishoffman/ -[1]:http://www.howtogeek.com/191207/10-of-the-most-popular-linux-distributions-compared/ -[2]:http://www.howtogeek.com/196655/how-to-configure-the-grub2-boot-loaders-settings/ -[3]:http://www.howtogeek.com/172810/take-a-secure-desktop-everywhere-everything-you-need-to-know-about-linux-live-cds-and-usb-drives/ -[4]:http://www.howtogeek.com/howto/42980/the-beginners-guide-to-nano-the-linux-command-line-text-editor/ -[5]:http://www.howtogeek.com/118389/how-to-comment-out-and-uncomment-lines-in-a-configuration-file/ -[6]:http://git.marmotte.net/git/glim/tree/grub2 \ No newline at end of file diff --git a/sources/tech/20141004 Practical Lessons in Peer Code Review.md b/sources/tech/20141004 Practical Lessons in Peer Code Review.md new file mode 100644 index 0000000000..3576dd0e98 --- /dev/null +++ b/sources/tech/20141004 Practical Lessons in Peer Code Review.md @@ -0,0 +1,138 @@ +johnhoow translating... +# Practical Lessons in Peer Code Review # + +Millions of years ago, apes descended from the trees, evolved opposable thumbs and—eventually—turned into human beings. + +We see mandatory code reviews in a similar light: something that separates human from beast on the rolling grasslands of the software +development savanna. + +Nonetheless, I sometimes hear comments like these from our team members: + +"Code reviews on this project are a waste of time." +"I don't have time to do code reviews." +"My release is delayed because my dastardly colleague hasn't done my review yet." +"Can you believe my colleague wants me to change something in my code? Please explain to them that the delicate balance of the universe will +be disrupted if my pristine, elegant code is altered in any way." + +### Why do we do code reviews? ### + +Let us remember, first of all, why we do code reviews. One of the most important goals of any professional software developer is to +continually improve the quality of their work. Even if your team is packed with talented programmers, you aren't going to distinguish +yourselves from a capable freelancer unless you work as a team. Code reviews are one of the most important ways to achieve this. In +particular, they: + +provide a second pair of eyes to find defects and better ways of doing something. +ensure that at least one other person is familiar with your code. +help train new staff by exposing them to the code of more experienced developers. +promote knowledge sharing by exposing both the reviewer and reviewee to the good ideas and practices of the other. +encourage developers to be more thorough in their work since they know it will be reviewed by one of their colleagues. + +### Doing thorough reviews ### + +However, these goals cannot be achieved unless appropriate time and care are devoted to reviews. Just scrolling through a patch, making sure +that the indentation is correct and that all the variables use lower camel case, does not constitute a thorough code review. It is +instructive to consider pair programming, which is a fairly popular practice and adds an overhead of 100% to all development time, as the +baseline for code review effort. You can spend a lot of time on code reviews and still use much less overall engineer time than pair +programming. + +My feeling is that something around 25% of the original development time should be spent on code reviews. For example, if a developer takes +two days to implement a story, the reviewer should spend roughly four hours reviewing it. + +Of course, it isn't primarily important how much time you spend on a review as long as the review is done correctly. Specifically, you must +understand the code you are reviewing. This doesn't just mean that you know the syntax of the language it is written in. It means that you +must understand how the code fits into the larger context of the application, component or library it is part of. If you don't grasp all the +implications of every line of code, then your reviews are not going to be very valuable. This is why good reviews cannot be done quickly: it +takes time to investigate the various code paths that can trigger a given function, to ensure that third-party APIs are used correctly +(including any edge cases) and so forth. + +In addition to looking for defects or other problems in the code you are reviewing, you should ensure that: + +All necessary tests are included. +Appropriate design documentation has been written. +Even developers who are good about writing tests and documentation don't always remember to update them when they change their code. A +gentle nudge from the code reviewer when appropriate is vital to ensure that they don't go stale over time. + +### Preventing code review overload ### + +If your team does mandatory code reviews, there is the danger that your code review backlog will build up to the point where it is +unmanageable. If you don't do any reviews for two weeks, you can easily have several days of reviews to catch up on. This means that your +own development work will take a large and unexpected hit when you finally decide to deal with them. It also makes it a lot harder to do +good reviews since proper code reviews require intense and sustained mental effort. It is difficult to keep this up for days on end. + +For this reason, developers should strive to empty their review backlog every day. One approach is to tackle reviews first thing in the +morning. By doing all outstanding reviews before you start your own development work, you can keep the review situation from getting out of +hand. Some might prefer to do reviews before or after the midday break or at the end of the day. Whenever you do them, by considering code +reviews as part of your regular daily work and not a distraction, you avoid: + +Not having time to deal with your review backlog. +Delaying a release because your reviews aren't done yet. +Posting reviews that are no longer relevant since the code has changed so much in the meantime. +Doing poor reviews since you have to rush through them at the last minute. + +### Writing reviewable code ### + +The reviewer is not always the one responsible for out-of-control review backlogs. If my colleague spends a week adding code willy-nilly +across a large project then the patch they post is going to be really hard to review. There will be too much to get through in one session. +It will be difficult to understand the purpose and underlying architecture of the code. + +This is one of many reasons why it is important to split your work into manageable units. We use scrum methodology so the appropriate unit +for us is the story. By making an effort to organize our work by story and submit reviews that pertain only to the specific story we are +working on, we write code that is much easier to review. Your team may use another methodology but the principle is the same. + +There are other prerequisites to writing reviewable code. If there are tricky architectural decisions to be made, it makes sense to meet +with the reviewer beforehand to discuss them. This will make it much easier for the reviewer to understand your code, since they will know +what you are trying to achieve and how you plan to achieve it. This also helps avoid the situation where you have to rewrite large swathes +of code after the reviewer suggests a different and better approach. + +Project architecture should be described in detail in your design documentation. This is important anyway since it enables a new project +member to get up to speed and understand the existing code base. It has the further advantage of helping a reviewer to do their job +properly. Unit tests are also helpful in illustrating to the reviewer how components should be used. + +If you are including third-party code in your patch, commit it separately. It is much harder to review code properly when 9000 lines of +jQuery are dropped into the middle. + +One of the most important steps for creating reviewable code is to annotate your code reviews. This means that you go through the review +yourself and add comments anywhere you feel that this will help the reviewer to understand what is going on. I have found that annotating +code takes relatively little time (often just a few minutes) and makes a massive difference in how quickly and well the code can be +reviewed. Of course, code comments have many of the same advantages and should be used where appropriate, but often a review annotation +makes more sense. As a bonus, studies have shown that developers find many defects in their own code while rereading and annotating it. + +### Large code refactorings ### + +Sometimes it is necessary to refactor a code base in a way that affects many components. In the case of a large application, this can take +several days (or more) and result in a huge patch. In these cases a standard code review may be impractical. + +The best solution is to refactor code incrementally. Figure out a partial change of reasonable scope that results in a working code base and +brings you in the direction you want to go. Once that change has been completed and a review posted, proceed to a second incremental change +and so forth until the full refactoring has been completed. This might not always be possible, but with thought and planning it is usually +realistic to avoid massive monolithic patches when refactoring. It might take more time for the developer to refactor in this way, but it +also leads to better quality code as well as making reviews much easier. + +If it really isn't possible to refactor code incrementally (which probably says something about how well the original code was written and +organized), one solution might be to do pair programming instead of code reviews while working on the refactoring. + +### Resolving disputes ### + +Your team is doubtless made up of intelligent professionals, and in almost all cases it should be possible to come an agreement when +opinions about a specific coding question differ. As a developer, keep an open mind and be prepared to compromise if your reviewer prefers a +different approach. Don't take a proprietary attitude to your code and don't take review comments personally. Just because someone feels +that you should refactor some duplicated code into a reusable function, it doesn't mean that you are any less of an attractive, brilliant +and charming individual. + +As a reviewer, be tactful. Before suggesting changes, consider whether your proposal is really better or just a matter of taste. You will +have more success if you choose your battles and concentrate on areas where the original code clearly requires improvement. Say things like +"it might be worth considering..." or "some people recommend..." instead of "my pet hamster could write a more efficient sorting algorithm +than this." + +If you really can't find middle ground, ask a third developer who both of you respect to take a look and give their opinion. + +-------------------------------------------------------------------------------- + +via: http://blog.salsitasoft.com/practical-lessons-in-peer-code-review/ +作者:[Matt][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + + diff --git a/sources/tech/20141008 How to configure HTTP load balancer with HAProxy on Linux.md b/sources/tech/20141008 How to configure HTTP load balancer with HAProxy on Linux.md new file mode 100644 index 0000000000..e6b66f4563 --- /dev/null +++ b/sources/tech/20141008 How to configure HTTP load balancer with HAProxy on Linux.md @@ -0,0 +1,273 @@ +How to configure HTTP load balancer with HAProxy on Linux +================================================================================ +Increased demand on web based applications and services are putting more and more weight on the shoulders of IT administrators. When faced with unexpected traffic spikes, organic traffic growth, or internal challenges such as hardware failures and urgent maintenance, your web application must remain available, no matter what. Even modern devops and continuous delivery practices can threaten the reliability and consistent performance of your web service. + +Unpredictability or inconsistent performance is not something you can afford. But how can we eliminate these downsides? In most cases a proper load balancing solution will do the job. And today I will show you how to set up HTTP load balancer using [HAProxy][1]. + +### What is HTTP load balancing? ### + +HTTP load balancing is a networking solution responsible for distributing incoming HTTP or HTTPS traffic among servers hosting the same application content. By balancing application requests across multiple available servers, a load balancer prevents any application server from becoming a single point of failure, thus improving overall application availability and responsiveness. It also allows you to easily scale in/out an application deployment by adding or removing extra application servers with changing workloads. + +### Where and when to use load balancing? ### + +As load balancers improve server utilization and maximize availability, you should use it whenever your servers start to be under high loads. Or if you are just planning your architecture for a bigger project, it's a good habit to plan usage of load balancer upfront. It will prove itself useful in the future when you need to scale your environment. + +### What is HAProxy? ### + +HAProxy is a popular open-source load balancer and proxy for TCP/HTTP servers on GNU/Linux platforms. Designed in a single-threaded event-driven architecture, HAproxy is capable of handling [10G NIC line rate][2] easily, and is being extensively used in many production environments. Its features include automatic health checks, customizable load balancing algorithms, HTTPS/SSL support, session rate limiting, etc. + +### What are we going to achieve in this tutorial? ### + +In this tutorial, we will go through the process of configuring a HAProxy-based load balancer for HTTP web servers. + +### Prerequisites ### + +You will need at least one, or preferably two web servers to verify functionality of your load balancer. We assume that backend HTTP web servers are already [up and running][3]. + +### Install HAProxy on Linux ### + +For most distributions, we can install HAProxy using your distribution's package manager. + +#### Install HAProxy on Debian #### + +In Debian we need to add backports for Wheezy. To do that, please create a new file called "backports.list" in /etc/apt/sources.list.d, with the following content: + + deb http://cdn.debian.net/debian wheezy­backports main + +Refresh your repository data and install HAProxy. + + # apt­ get update + # apt ­get install haproxy + +#### Install HAProxy on Ubuntu #### + + # apt ­get install haproxy + +#### Install HAProxy on CentOS and RHEL #### + + # yum install haproxy + +### Configure HAProxy ### + +In this tutorial, we assume that there are two HTTP web servers up and running with IP addresses 192.168.100.2 and 192.168.100.3. We also assume that the load balancer will be configured at a server with IP address 192.168.100.4. + +To make HAProxy functional, you need to change a number of items in /etc/haproxy/haproxy.cfg. These changes are described in this section. In case some configuration differs for different GNU/Linux distributions, it will be noted in the paragraph. + +#### 1. Configure Logging #### + +One of the first things you should do is to set up proper logging for your HAProxy, which will be useful for future debugging. Log configuration can be found in the global section of /etc/haproxy/haproxy.cfg. The following are distro-specific instructions for configuring logging for HAProxy. + +**CentOS or RHEL:** + +To enable logging on CentOS/RHEL, replace: + + log 127.0.0.1 local2 + +with: + + log 127.0.0.1 local0 + +The next step is to set up separate log files for HAProxy in /var/log. For that, we need to modify our current rsyslog configuration. To make the configuration simple and clear, we will create a new file called haproxy.conf in /etc/rsyslog.d/ with the following content. + + $ModLoad imudp + $UDPServerRun 514 + $template Haproxy,"%msg%\n" + local0.=info ­/var/log/haproxy.log;Haproxy + local0.notice ­/var/log/haproxy­status.log;Haproxy + local0.* ~ + +This configuration will separate all HAProxy messages based on the $template to log files in /var/log. Now restart rsyslog to apply the changes. + + # service rsyslog restart + +**Debian or Ubuntu:** + +To enable logging for HAProxy on Debian or Ubuntu, replace: + + log /dev/log local0 + log /dev/log local1 notice + +with: + + log 127.0.0.1 local0 + +Next, to configure separate log files for HAProxy, edit a file called haproxy.conf (or 49-haproxy.conf in Debian) in /etc/rsyslog.d/ with the following content. + + $ModLoad imudp + $UDPServerRun 514 + $template Haproxy,"%msg%\n" + local0.=info ­/var/log/haproxy.log;Haproxy + local0.notice ­/var/log/haproxy­status.log;Haproxy + local0.* ~ + +This configuration will separate all HAProxy messages based on the $template to log files in /var/log. Now restart rsyslog to apply the changes. + + # service rsyslog restart + +#### 2. Setting Defaults #### + +The next step is to set default variables for HAProxy. Find the defaults section in /etc/haproxy/haproxy.cfg, and replace it with the following configuration. + + defaults + log global + mode http + option httplog + option dontlognull + retries 3 + option redispatch + maxconn 20000 + contimeout 5000 + clitimeout 50000 + srvtimeout 50000 + +The configuration stated above is recommended for HTTP load balancer use, but it may not be the optimal solution for your environment. In that case, feel free to explore HAProxy man pages to tweak it. + +#### 3. Webfarm Configuration #### + +Webfarm configuration defines the pool of available HTTP servers. Most of the settings for our load balancer will be placed here. Now we will create some basic configuration, where our nodes will be defined. Replace all of the configuration from frontend section until the end of file with the following code: + + listen webfarm *:80 + mode http + stats enable + stats uri /haproxy?stats + stats realm Haproxy\ Statistics + stats auth haproxy:stats + balance roundrobin + cookie LBN insert indirect nocache + option httpclose + option forwardfor + server web01 192.168.100.2:80 cookie node1 check + server web02 192.168.100.3:80 cookie node2 check + +The line "listen webfarm *:80" defines on which interfaces our load balancer will listen. For the sake of the tutorial, I've set that to "*" which makes the load balancer listen on all our interfaces. In a real world scenario, this might be undesirable and should be replaced with an interface that is accessible from the internet. + + stats enable + stats uri /haproxy?stats + stats realm Haproxy\ Statistics + stats auth haproxy:stats + +The above settings declare that our load balancer statistics can be accessed on http:///haproxy?stats. The access is secured with a simple HTTP authentication with login name "haproxy" and password "stats". These settings should be replaced with your own credentials. If you don't need to have these statistics available, then completely disable them. + +Here is an example of HAProxy statistics. + +![](https://farm4.staticflickr.com/3928/15416835905_a678c8f286_c.jpg) + +The line "balance roundrobin" defines the type of load balancing we will use. In this tutorial we will use simple round robin algorithm, which is fully sufficient for HTTP load balancing. HAProxy also offers other types of load balancing: + +- **leastconn**:­ gives connections to the server with the lowest number of connections. +- **source**: hashes the source IP address, and divides it by the total weight of the running servers to decide which server will receive the request. +- **uri**: the left part of the URI (before the question mark) is hashed and divided by the total weight of the running servers. The result determines which server will receive the request. +- **url_param**: the URL parameter specified in the argument will be looked up in the query string of each HTTP GET request. You can basically lock the request using crafted URL to specific load balancer node. +- **hdr(name**): the HTTP header will be looked up in each HTTP request and directed to specific node. + +The line "cookie LBN insert indirect nocache" makes our load balancer store persistent cookies, which allows us to pinpoint which node from the pool is used for a particular session. These node cookies will be stored with a defined name. In our case, I used "LBN", but you can specify any name you like. The node will store its string as a value for this cookie. + + server web01 192.168.100.2:80 cookie node1 check + server web02 192.168.100.3:80 cookie node2 check + +The above part is the definition of our pool of web server nodes. Each server is represented with its internal name (e.g., web01, web02). IP address, and unique cookie string. The cookie string can be defined as anything you want. I am using simple node1, node2 ... node(n). + +### Start HAProxy ### + +When you are done with the configuration, it's time to start HAProxy and verify that everything is working as intended. + +#### Start HAProxy on Centos/RHEL #### + +Enable HAProxy to be started after boot and turn it on using: + + # chkconfig haproxy on + # service haproxy start + +And of course don't forget to enable port 80 in the firewall as follows. + +**Firewall on CentOS/RHEL 7:** + + # firewall­cmd ­­permanent ­­zone=public ­­add­port=80/tcp + # firewall­cmd ­­reload + +**Firewall on CentOS/RHEL 6:** + +Add following line into section ":OUTPUT ACCEPT" of /etc/sysconfig/iptables: + + ­A INPUT ­m state ­­state NEW ­m tcp ­p tcp ­­dport 80 ­j ACCEPT + +and restart **iptables**: + + # service iptables restart + +#### Start HAProxy on Debian #### + +#### Start HAProxy with: #### + + # service haproxy start + +Don't forget to enable port 80 in the firewall by adding the following line into /etc/iptables.up.rules: + + ­A INPUT ­p tcp ­­dport 80 ­j ACCEPT + +#### Start HAProxy on Ubuntu #### + +Enable HAProxy to be started after boot by setting "ENABLED" option to "1" in /etc/default/haproxy: + + ENABLED=1 + +Start HAProxy: + + # service haproxy start + +and enable port 80 in the firewall: + + # ufw allow 80 + +### Test HAProxy ### + +To check whether HAproxy is working properly, we can do the following. + +First, prepare test.php file with the following content: + + + +This PHP file will tell us which server (i.e., load balancer) forwarded the request, and what backend web server actually handled the request. + +Place this PHP file in the root directory of both backend web servers. Now use curl command to fetch this PHP file from the load balancer (192.168.100.4). + + $ curl http://192.168.100.4/test.php + +When we run this command multiple times, we should see the following two outputs alternate (due to the round robin algorithm). + + Server IP: 192.168.100.2 + X-Forwarded-for: 192.168.100.4 + +---------- + + Server IP: 192.168.100.3 + X-Forwarded-for: 192.168.100.4 + +If we stop one of the two backend web servers, the curl command should still work, directing requests to the other available web server. + +### Summary ### + +By now you should have a fully operational load balancer that supplies your web nodes with requests in round robin mode. As always, feel free to experiment with the configuration to make it more suitable for your infrastructure. I hope this tutorial helped you to make your web projects more resistant and available. + +As most of you already noticed, this tutorial contains settings for only one load balancer. Which means that we have just replaced one single point of failure with another. In real life scenarios you should deploy at least two or three load balancers to cover for any failures that might happen, but that is out of the scope of this tutorial right now. + +If you have any questions or suggestions feel free to post them in the comments and I will do my best to answer or advice. + +-------------------------------------------------------------------------------- + +via: http://xmodulo.com/haproxy-http-load-balancer-linux.html + +作者:[Jaroslav Štěpánek][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/jaroslav +[1]:http://www.haproxy.org/ +[2]:http://www.haproxy.org/10g.html +[3]:http://xmodulo.com/how-to-install-lamp-server-on-ubuntu.html \ No newline at end of file diff --git a/sources/tech/20141008 How to debug a C or C++ program with GDB command-line debugger.md b/sources/tech/20141008 How to debug a C or C++ program with GDB command-line debugger.md new file mode 100644 index 0000000000..f8dbba013c --- /dev/null +++ b/sources/tech/20141008 How to debug a C or C++ program with GDB command-line debugger.md @@ -0,0 +1,172 @@ +SPccman Translating +How to debug a C/C++ program with GDB command-line debugger +================================================================================ +What is the worst part of coding without a debugger? Compiling on your knees praying that nothing will crash? Running the executable with a blood offering? Or just having to write printf("test") at every line hoping to find where the problem is coming from? As you probably know, there are not many advantages to coding without a debugger. But the good side is that debugging on Linux is easy. While most people use the debugger included in their favorite IDE, Linux is famous for its powerful command line C/C++ debugger: GDB. However, like most command line utilities, GDB requires a bit of training to master fully. In this tutorial, I will give you a quick rundown of GDB debugger. + +### Installation of GDB ### + +GDB is available in most distributions' repositories. + +For Debian or Ubuntu: + + $ sudo apt-get install gdb + +For Arch Linux: + + $ sudo pacman -S gdb + +For Fedora, CentOS or RHEL: + + $ sudo yum install gdb + +If you cannot find it anywhere else, it is always possible to download it from the [official page][1]. + +### Code Sample ### + +When you are learning GDB, it is always better to have a piece of code to try things. Here is a quick sample that I coded to show the best features of GDB. Feel free to copy paste it to try the examples. That's the best way to learn. + + #include + #include + + int main(int argc, char **argv) + { + int i; + int a=0, b=0, c=0; + double d; + for (i=0; i<100; i++) + { + a++; + if (i>97) + d = i / 2.0; + b++; + } + return 0; + } + +### Usage of GDB ### + +First and foremost, you will need to compile your program with the flag "-g" (for debug) to run it via GDB. From there the syntax to start debugging is: + + $ gdb -tui [executable's name] + +The "-tui” option will show your code in a nice interactive terminal window (so-called "text user interface") that you can navigate in with the arrow keys, while typing in the GDB shell below. + +![](https://farm3.staticflickr.com/2947/15397534362_ac0b5692c8_z.jpg) + +We can now start playing around placing breakpoints anywhere in the source code with debugger. Here you have the options to set a breakpoint at a line number of the current source file: + + break [line number] + +or at a line number of a specific source file: + + break [file name]:[line number] + +or at a particular function: + + break [function name] + +And even better, you can set conditional breakpoints: + + break [line number] if [condition] + +For example, in our code sample, I can set: + + break 11 if i > 97 + +![](https://farm3.staticflickr.com/2948/15374839066_8c7c0eb8a4_o.png) + +which will have an effect of stopping me at "a++;" after 97 iterations of the for loop. As you have guessed, this is very handy when you do not want to step through the loop 97 times on your own. + +Last but not least, you can place a "watchpoint" which will pause the program if a variable is modified: + + watch [variable] + +Here, I can set one like: + + watch d + +which will stop the program as soon as variable d is set to a new value (i.e. when i > 97 is true). + +Once our breakpoints are set, we can run the program with the "run" command, or simply: + + r [command line arguments if your program takes some] + +as most words can be abbreviated in just a letter with gdb. + +And without surprises, we are stopped at line 11. From there, we can do interesting things. The command: + + bt + +for backtrack will tell us how we got to that point. + +![](https://farm3.staticflickr.com/2943/15211202760_1e77a3bb2e_z.jpg) + + info locals + +will display all the local variables and their current values (as you can see I didn't set my d variable to anything so its value is currently garbage). + +![](https://farm4.staticflickr.com/3843/15374838916_8b65e4e3c7_z.jpg) + +Of course: + + p [variable] + +will show the value of a particular variable. But even better: + + ptype [variable] + +shows the type of a local variable. So here we can confirm that d is double type. + +![](https://farm4.staticflickr.com/3881/15397534242_3cb6163252_o.jpg) + +And since we are playing with fire, might as well do it all the way: + + set var [variable] = [new value] + +will override the value of the variable. Be careful though as you can't create a new variable or change its type. But here we can do: + + set var a = 0 + +![](https://farm3.staticflickr.com/2949/15211357497_d28963a9eb_o.png) + +And just like any good debugger, we can "step" with: + + step + +to run the next line and potentially step into a function. Or just: + + next + +to just go straight to the line below, ignoring any function call. + +![](https://farm4.staticflickr.com/3927/15397863215_fb2f5912ac_o.jpg) + +And to finish testing, you can delete a breakpoint with: + + delete [line number] + +Keep running the program from the current breakpoint with: + + continue + +and exit GDB with: + + quit + +To conclude, with GDB, no more praying to compile, no more blood offerings to run, no more printf("test"). Of course this post is not exhaustive and GDB's capabilities run beyond this, so I really encourage you to learn more about it on your own (or in a future post maybe?). What I am the most interested now is to integrate GDB nicely in Vim. In the meantime, here is a very [big memo][2] of all the GDB commands for future reference. + +What do you think of GDB? Would you consider its advantages over a graphical debugger or an IDE's? And what about integrating into Vim? Let us know in the comments. + +-------------------------------------------------------------------------------- + +via: http://xmodulo.com/gdb-command-line-debugger.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]:https://www.gnu.org/software/gdb/ +[2]:http://users.ece.utexas.edu/~adnan/gdb-refcard.pdf diff --git a/sources/tech/20141008 How to speed up slow apt-get install on Debian or Ubuntu.md b/sources/tech/20141008 How to speed up slow apt-get install on Debian or Ubuntu.md new file mode 100644 index 0000000000..4fe7667081 --- /dev/null +++ b/sources/tech/20141008 How to speed up slow apt-get install on Debian or Ubuntu.md @@ -0,0 +1,119 @@ +su-kaiyao translating + +How to speed up slow apt-get install on Debian or Ubuntu +================================================================================ +If you feel that package installation by **apt-get** or **aptitude** is often too slow on your Debian or Ubuntu system, there are several ways to improve the situation. Have you considered switching default mirror sites being used? Have you checked the upstream bandwidth of your Internet connection to see if that is the bottleneck? + +Nothing else, you can try this third option: use [apt-fast][1] tool. apt-fast is actually a shell script wrapper written around apt-get and aptitude, which can accelerate package download speed. Internally, apt-fast uses [aria2][2] download utility which can download a file in "chunked" forms from multiple mirrors simultaneously (like in BitTorrent download). + +### Install apt-fast on Debian or Ubuntu ### + +Here are the steps to install apt-fast on Debian-based Linux. + +#### Debian #### + + $ sudo apt-get install aria2 + $ wget https://github.com/ilikenwf/apt-fast/archive/master.zip + $ unzip master.zip + $ cd apt-fast-master + $ sudo cp apt-fast /usr/bin + $ sudo cp apt-fast.conf /etc + $ sudo cp ./man/apt-fast.8 /usr/share/man/man8 + $ sudo gzip /usr/share/man/man8/apt-fast.8 + $ sudo cp ./man/apt-fast.conf.5 /usr/share/man/man5 + $ sudo gzip /usr/share/man/man5/apt-fast.conf.5 + +#### Ubuntu 14.04 and higher #### + + $ sudo add-apt-repository ppa:saiarcot895/myppa + $ sudo apt-get update + $ sudo apt-get install apt-fast + +#### Ubuntu 11.04 to 13.10 #### + + $ sudo add-apt-repository ppa:apt-fast/stable + $ sudo apt-get update + $ sudo apt-get install apt-fast + +During installation on Ubuntu, you will be asked to choose a default package manager (e.g., apt-get, aptitude), and other settings. You can always change the settings later by editing a configuration file /etc/apt-fast.conf. + +![](https://farm6.staticflickr.com/5615/15285526898_1b18f64d58_z.jpg) + +![](https://farm3.staticflickr.com/2949/15449069896_76ee00851b_z.jpg) + +![](https://farm6.staticflickr.com/5600/15471817412_9ef7f16096_z.jpg) + +### Configure apt-fast ### + +After installation, you need to configure a list of mirrors used by **apt-fast** in /etc/apt-fast.conf. + +You can find a list of Debian/Ubuntu mirrors to choose from at the following URLs. + +- **Debian**: [http://www.debian.org/mirror/list][3] +- **Ubuntu**: [https://launchpad.net/ubuntu/+archivemirrors][4] + +After choosing mirrors which are geographically close to your location, add those chosen mirrors to /etc/apt-fast.conf in the following format. + + $ sudo vi /etc/apt-fast.conf + +Debian: + + MIRRORS=('http://ftp.us.debian.org/debian/,http://carroll.aset.psu.edu/pub/linux/distributions/debian/,http://debian.gtisc.gatech.edu/debian/,http://debian.lcs.mit.edu/debian/,http://mirror.cc.columbia.edu/debian/') + +Ubuntu/Mint: + + MIRRORS=('http://us.archive.ubuntu.com/ubuntu,http://mirror.cc.columbia.edu/pub/linux/ubuntu/archive/,http://mirror.cc.vt.edu/pub2/ubuntu/,http://mirror.umd.edu/ubuntu/,http://mirrors.mit.edu/ubuntu/') + +As shown above, individual mirrors for a particular archive should be separated by commas. It is recommended that you include the default mirror site specified in /etc/apt/sources.list in the MIRRORS string. + +### Install a Package with apt-fast ### + +Now you are ready to test the power of apt-fast. Here is the command-line usage of **apt-fast**: + + apt-fast [apt-get options and arguments] + apt-fast [aptitude options and arguments] + apt-fast { { install | upgrade | dist-upgrade | build-dep | download | source } [ -y | --yes | --assume-yes | --assume-no ] ... | clean } + +To install a package with **apt-fast**: + + $ sudo apt-fast install texlive-full + +To download a package in the current directory without installing it: + + $ sudo apt-fast download texlive-full + +![](http://farm8.staticflickr.com/7309/10585846956_6c98c6dcc9_z.jpg) + +As mentioned earlier, parallel downloading of apt-fast is done by aria2. You can verify parallel downloads from multiple mirrors as follows. + + $ sudo netstat -nap | grep aria2c + +![](http://farm8.staticflickr.com/7328/10585846886_4744a0e021_z.jpg) + +Note that **apt-fast** does not make "apt-get update" faster. Parallel downloading gets triggered only for "install", "upgrade", "dist-upgrade" and "build-dep" operations. For other operations, apt-fast simply falls back to the default package manager **apt-get** or **aptitude**. + +### How Fast is apt-fast? ### + +To compare apt-fast and apt-get, I tried installing several packages using two methods on two identical Ubuntu instances. The following graph shows total package installation time (in seconds). + +![](http://farm4.staticflickr.com/3810/10585846986_504d07b4a7_z.jpg) + +As you can see, **apt-fast** is substantially faster (e.g., 3--4 times faster) than **apt-get**, especially when a bulky package is installed. + +Be aware that performance improvement will of course vary, depending on your upstream Internet connectivity. In my case, I had ample spare bandwidth to leverage in my upstream connection, and that's why I see dramatic improvement by using parallel download. + +-------------------------------------------------------------------------------- + +via: http://xmodulo.com/speed-slow-apt-get-install-debian-ubuntu.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://github.com/ilikenwf/apt-fast +[2]:http://aria2.sourceforge.net/ +[3]:http://www.debian.org/mirror/list +[4]:https://launchpad.net/ubuntu/+archivemirrors diff --git a/sources/tech/20141008 The Why and How of Ansible and Docker.md b/sources/tech/20141008 The Why and How of Ansible and Docker.md new file mode 100644 index 0000000000..5f9684ed06 --- /dev/null +++ b/sources/tech/20141008 The Why and How of Ansible and Docker.md @@ -0,0 +1,103 @@ +The Why and How of Ansible and Docker +================================================================================ +There is a lot of interest from the tech community in both [Docker][1] and [Ansible][2], I am hoping that after reading this article you will share our enthusiasm. You will also gain a practical insight into using Ansible and Docker for setting up a complete server environment for a Rails application. + +Many reading this might be asking, “Why don’t you just use Heroku?”. First of all, I can run Docker and Ansible on any host, with any provider. Secondly, I prefer flexibility over convenience. I can run anything in this manner, not just web applications. Last but not least, because I am a tinkerer at heart, I get a kick from understanding how all the pieces fit together. The fundamental building block of Heroku is the Linux Container. The same technology lies at the heart of Docker’s versatility. As a matter of fact, one of Docker’s mottoes is: “Containerization is the new virtualization”. + +### Why Ansible? ### + +After 4 years of heavy Chef usage, the **infrastructure as code** mentality becomes really tedious. I was spending most of my time with the code that was managing my infrastructure, not with the infrastructure itself. Any change, regardless how small, would require a considerable amount of effort for a relatively small gain. With [Ansible][3], there’s data describing infrastructure on one hand, and the constraints of the interactions between various components on the other hand. It’s a much simpler model that enables me to move quicker by letting me focus on what makes my infrastructure personal. Similar to the Unix model, Ansible provides simple modules with a single responsibility that can be combined in endless ways. + +Ansible has no dependencies other than Python and SSH. It doesn’t require any agents to be set up on the remote hosts and it doesn’t leave any traces after it runs either. What’s more, it comes with an extensive, built-in library of modules for controlling everything from package managers to cloud providers, to databases and everything else in between. + +### Why Docker? ### + +[Docker][4] is establishing itself as the most reliable and convenient way of deploying a process on a host. This can be anything from mysqld to ![](Docker container as a VM. The)redis, to a Rails application. Just like git snapshots and distributes code in the most efficient way, Docker does the same with processes. It guarantees that everything required to run that process will be available regardless of the host that it runs on. + +A common but understandable mistake is to treat a Docker container as a VM. The [Single Responsibility Principle][5] still applies, running a single process per container will give it a single reason to change, it will make it re-usable and easy to reason about. This model has stood the test of time in the form of the Unix philosophy, it makes for a solid foundation to build on. + +### The Setup ### + +Without leaving my terminal, I can have Ansible provision a new instance for me with any of the following: Amazon Web Services, Linode, Rackspace or DigitalOcean. To be more specific, I can have Ansible create a new DigitalOcean 2GB droplet in Amsterdam 2 region in precisely 1 minute and 25 seconds. In a further 1 minute and 50 seconds I can have the system setup with Docker and a few other personal preferences. Once I have this base system in place, I can deploy my application. Notice that I didn’t setup any database or programming language. Docker will handle all application dependencies. + +Ansible runs all remote commands via SSH. My SSH keys stored in the local ssh-agent will be shared remotely during Ansible’s SSH sessions. When my application code will be cloned or updated on remote hosts, no git credentials will be required, the forwarded ssh-agent will be used to authenticate with the git host. + +### Docker and application dependencies ### + +I find it amusing that most developers are specific about the version of the programming language which their application needs, the version of the dependencies in the form of Python packages, Ruby gems or node.js modules, but when it comes to something as important as the database or the message queue, they just use whatever is available in the environment that the application runs. I believe this is one of the reasons behind the devops movement, developers taking responsibility for the application’s environment. Docker makes this task easier and more straightforward by adding a layer of pragmatism and confidence to the existing practices. + +My application defines dependencies on processes such as MySQL 5.5 and Redis 2.8 by including the following `.docker_container_dependencies` file: + + gerhard/mysql:5.5 + gerhard/redis:2.8 + +The Ansible playbook will notice this file and will instruct Docker to pull the correct images from the Docker index and start them as containers. It also links these service containers to my application container. If you want to find out how Docker container linking works, refer to the [Docker 0.6.5 announcement][6]. + +My application also comes with a Dockerfile which is specific about the Ruby Docker image that is required. As this is already built, the steps in my Dockerfile will have the guarantee that the correct Ruby version will be available to them. + + FROM howareyou/ruby:2.0.0-p353 + + ADD ./ /terrabox + + RUN \ + . /.profile ;\ + rm -fr /terrabox/.git ;\ + cd /terrabox ;\ + bundle install --local ;\ + echo '. /.profile && cd /terrabox && RAILS_ENV=test bundle exec rake db:create db:migrate && bundle exec rspec' > /test-terrabox ;\ + echo '. /.profile && cd /terrabox && export RAILS_ENV=production && rake db:create db:migrate && bundle exec unicorn -c config/unicorn.rails.conf.rb' > /run-terrabox ;\ + # END RUN + + ENTRYPOINT ["/bin/bash"] + CMD ["/run-terrabox"] + + EXPOSE 3000 + +The first step is to copy all my application’s code into the Docker image and load the global environment variables added by previous images. The Ruby Docker image for example will append PATH configuration which ensures that the correct Ruby version gets loaded. + +Next, I remove the git history as this is not useful in the context of a Docker container. I install all the gems and then create a `/test-terrabox` command which will be run by the test-only container. The purpose of this is to have a “canary” which ensures that the application and all its dependencies are properly resolved, that the Docker containers are linked correctly and all tests pass before the actual application container will be started. + +The command that gets run when a new web application container gets started is defined in the CMD step. The `/run-terrabox` command was defined part of the build process, right after the test one. + +The last instruction in this application’s Dockerfile maps port 3000 from inside the container to an automatically allocated port on the host that runs Docker. This is the port that the reverse proxy or load balancer will use when proxying public requests to my application running inside the Docker container. + +### Running a Rails application inside a Docker container ### + +For a medium-sized Rails application, with about 100 gems and just as many integration tests running under Rails, this takes 8 minutes and 16 seconds on a 2GB and 2 core instance, without any local Docker images. If I already had Ruby, MySQL & Redis Docker images on that host, this would take 4 minutes and 45 seconds. Furthermore, if I had a master application image to base a new Docker image build of the same application, this would take a mere 2 minutes and 23 seconds. To put this into perspective, it takes me just over 2 minutes to deploy a new version of my Rails application, including dependent services such as MySQL and Redis. + +I would like to point out that my application deploys also run a full test suite which alone takes about a minute end-to-end. Without intending, Docker became a simple Continuous Integration environment that leaves test-only containers behind for inspection when tests fail, or starts a new application container with the latest version of my application when the test suite passes. All of a sudden, I can validate new code with my customers in minutes, with the guarantee that different versions of my application are isolated from one another, all the way to the operating system. Unlike traditional VMs which take minutes to boot, a Docker container will take under a second. Furthermore, once a Docker image is built and tests pass for a specific version of my application, I can have this image pushed into a private Docker registry, waiting to be pulled by other Docker hosts and started as a new Docker container, all within seconds. + +### Conclusion ### + +Ansible made me re-discover the joy of managing infrastructures. Docker gives me confidence and stability when dealing with the most important step of application development, the delivery phase. In combination, they are unmatched. + +To go from no server to a fully deployed Rails application in just under 12 minutes is impressive by any standard. To get a very basic Continuous Integration system for free and be able to preview different versions of an application side-by-side, without affecting the “live” version which runs on the same hosts in any way, is incredibly powerful. This makes me very excited, and having reached the end of the article, I can only hope that you share my excitement. + +I gave a talk at the January 2014 London Docker meetup on this subject, [I have shared the slides on Speakerdeck][7]. + +For more Ansible and Docker content, subscribe to [The Changelog Weekly][8] — it ships every Saturday and regularly includes the week’s best links for both topics. + +[Use the Draft repo][9] if you’d like to write a post like this for The Changelog. They’ll work with you through the process too. + +Until next time, [Gerhard][a]. + +-------------------------------------------------------------------------------- + +via: http://thechangelog.com/ansible-docker/ + +作者:[Gerhard Lazu][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:https://twitter.com/gerhardlazu +[1]:https://www.docker.io/ +[2]:https://github.com/ansible/ansible +[3]:http://ansible.com/ +[4]:http://docker.io/ +[5]:http://en.wikipedia.org/wiki/Single_responsibility_principle +[6]:http://blog.docker.io/2013/10/docker-0-6-5-links-container-naming-advanced-port-redirects-host-integration/ +[7]:https://speakerdeck.com/gerhardlazu/ansible-and-docker-the-path-to-continuous-delivery-part-1 +[8]:http://thechangelog.com/weekly/ +[9]:https://github.com/thechangelog/draft \ No newline at end of file diff --git a/sources/tech/20141009 How to convert image audio and video formats on Ubuntu.md b/sources/tech/20141009 How to convert image audio and video formats on Ubuntu.md new file mode 100644 index 0000000000..baa145b56c --- /dev/null +++ b/sources/tech/20141009 How to convert image audio and video formats on Ubuntu.md @@ -0,0 +1,86 @@ +How to convert image, audio and video formats on Ubuntu +================================================================================ +If you need to work with a variety of image, audio and video files encoded in all sorts of different formats, you are probably using more than one tools to convert among all those heterogeneous media formats. If there is a versatile all-in-one media conversion tool that is capable of dealing with all different image/audio/video formats, that will be awesome. + +[Format Junkie][1] is one such all-in-one media conversion tool with an extremely user-friendly GUI. Better yet, it is free software! With Format Junkie, you can convert image, audio, video and archive files of pretty much all the popular formats simply with a few mouse clicks. + +### Install Format Junkie on Ubuntu 12.04, 12.10 and 13.04 ### + +Format Junkie is available for installation via Ubuntu PPA format-junkie-team. This PPA supports Ubuntu 12.04, 12.10 and 13.04. To install Format Junkie on one of those Ubuntu releases, simply run the following. + + $ sudo add-apt-repository ppa:format-junkie-team/release + $ sudo apt-get update + $ sudo apt-get install formatjunkie + $ sudo ln -s /opt/extras.ubuntu.com/formatjunkie/formatjunkie /usr/bin/formatjunkie + +### Install Format Junkie on Ubuntu 13.10 ### + +If you are running Ubuntu 13.10 (Saucy Salamander), you can download and install .deb package for Ubuntu 13.04 as follows. Since the .deb package for Format Junkie requires quite a few dependent packages, install it using [gdebi deb installer][2]. + +On 32-bit Ubuntu 13.10: + + $ wget https://launchpad.net/~format-junkie-team/+archive/release/+files/formatjunkie_1.07-1~raring0.2_i386.deb + $ sudo gdebi formatjunkie_1.07-1~raring0.2_i386.deb + $ sudo ln -s /opt/extras.ubuntu.com/formatjunkie/formatjunkie /usr/bin/formatjunkie + +On 64-bit Ubuntu 13.10: + + $ wget https://launchpad.net/~format-junkie-team/+archive/release/+files/formatjunkie_1.07-1~raring0.2_amd64.deb + $ sudo gdebi formatjunkie_1.07-1~raring0.2_amd64.deb + $ sudo ln -s /opt/extras.ubuntu.com/formatjunkie/formatjunkie /usr/bin/formatjunkie + +### Install Format Junkie on Ubuntu 14.04 or Later ### + +The currently available official Format Junkie .deb file requires libavcodec-extra-53 which has become obsolete starting from Ubuntu 14.04. Thus if you want to install Format Junkie on Ubuntu 14.04 or later, you can use the following third-party PPA repositories instead. + + $ sudo add-apt-repository ppa:jon-severinsson/ffmpeg + $ sudo add-apt-repository ppa:noobslab/apps + $ sudo apt-get update + $ sudo apt-get install formatjunkie + +### How to Use Format Junkie ### + +To start Format Junkie after installation, simply run: + + $ formatjunkie + +#### Convert audio, video, image and archive formats with Format Junkie #### + +The user interface of Format Junkie is pretty simple and intuitive, as shown below. To choose among audio, video, image and iso media, click on one of four tabs at the top. You can add as many files as you want for batch conversion. After you add files, and select output format, simply click on "Start Converting" button to convert. + +![](http://farm9.staticflickr.com/8107/8643695905_082b323059.jpg) + +Format Junkie supports conversion among the following media formats: + +- **Audio**: mp3, wav, ogg, wma, flac, m4r, aac, m4a, mp2. +- **Video**: avi, ogv, vob, mp4, 3gp, wmv, mkv, mpg, mov, flv, webm. +- **Image**: jpg, png, ico, bmp, svg, tif, pcx, pdf, tga, pnm. +- **Archive**: iso, cso. + +#### Subtitle encoding with Format Junkie #### + +Besides media conversion, Format Junkie also provides GUI for subtitle encoding. Actual subtitle encoding is done by MEncoder. In order to do subtitle encoding via Format Junkie interface, first you need to install MEencoder. + + $ sudo apt-get install mencoder + +Then click on "Advanced" tab on Format Junkie. Choose AVI/subtitle files to use for encoding, as shown below. + +![](http://farm9.staticflickr.com/8100/8644791396_bfe602cd16.jpg) + +Overall, Format Junkie is an extremely easy-to-use and versatile media conversion tool. One drawback, though, is that it does not allow any sort of customization during conversion (e.g., bitrate, fps, sampling frequency, image quality, size). So this tool is recommended for newbies who are looking for an easy-to-use simple media conversion tool. + +Enjoyed this post? I will appreciate your like/share buttons on Facebook, Twitter and Google+. + +-------------------------------------------------------------------------------- + +via: http://xmodulo.com/how-to-convert-image-audio-and-video-formats-on-ubuntu.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://launchpad.net/format-junkie +[2]:http://xmodulo.com/how-to-install-deb-file-with-dependencies.html \ No newline at end of file diff --git a/sources/tech/20141009 How to set up RAID 10 for high performance and fault tolerant disk I or O on Linux.md b/sources/tech/20141009 How to set up RAID 10 for high performance and fault tolerant disk I or O on Linux.md new file mode 100644 index 0000000000..e8c011c8c7 --- /dev/null +++ b/sources/tech/20141009 How to set up RAID 10 for high performance and fault tolerant disk I or O on Linux.md @@ -0,0 +1,139 @@ +How to set up RAID 10 for high performance and fault tolerant disk I/O on Linux +================================================================================ +A RAID 10 (aka RAID 1+0 or stripe of mirrors) array provides high performance and fault-tolerant disk I/O operations by combining features of RAID 0 (where read/write operations are performed in parallel across multiple drives) and RAID 1 (where data is written identically to two or more drives). + +In this tutorial, I'll show you how to set up a software RAID 10 array using five identical 8 GiB disks. While the minimum number of disks for setting up a RAID 10 array is four (e.g., a striped set of two mirrors), we will add an extra spare drive should one of the main drives become faulty. We will also share some tools that you can later use to analyze the performance of your RAID array. + +Please note that going through all the pros and cons of RAID 10 and other partitioning schemes (with different-sized drives and filesystems) is beyond the scope of this post. + +### How Does a Raid 10 Array Work? ### + +If you need to implement a storage solution that supports I/O-intensive operations (such as database, email, and web servers), RAID 10 is the way to go. Let me show you why. Let's refer to the below image. + +![](https://farm4.staticflickr.com/3844/15179003008_e48806b3ef_o.png) + +Imagine a file that is composed of blocks A, B, C, D, E, and F in the above diagram. Each RAID 1 mirror set (e.g., Mirror 1 or 2) replicates blocks on each of its two devices. Because of this configuration, write performance is reduced because every block has to be written twice, once for each disk, whereas read performance remains unchanged compared to reading from single disks. The bright side is that this setup provides redundancy in that unless more than one of the disks in each mirror fail, normal disk I/O operations can be maintained. + +The RAID 0 stripe works by dividing data into blocks and writing block A to Mirror 1, block B to Mirror 2 (and so on) simultaneously, thereby improving the overall read and write performance. On the other hand, none of the mirrors contains the entire information for any piece of data committed to the main set. This means that if one of the mirrors fail, the entire RAID 0 component (and therefore the RAID 10 set) is rendered inoperable, with unrecoverable loss of data. + +### Setting up a RAID 10 Array ### + +There are two possible setups for a RAID 10 array: complex (built in one step) or nested (built by creating two or more RAID 1 arrays, and then using them as component devices in a RAID 0). In this tutorial, we will cover the creation of a complex RAID 10 array due to the fact that it allows us to create an array using either an even or odd number of disks, and can be managed as a single RAID device, as opposed to the nested setup (which only permits an even number of drives, and must be managed as a nested device, dealing with RAID 1 and RAID 0 separately). + +It is assumed that you have mdadm installed, and the daemon running on your system. Refer to [this tutorial][1] for details. It is also assumed that a primary partition sd[bcdef]1 has been created on each disk. Thus, the output of: + + ls -l /dev | grep sd[bcdef] + +should be like: + +![](https://farm3.staticflickr.com/2944/15365276992_db79cac82a.jpg) + +Let's go ahead and create a RAID 10 array with the following command: + + # mdadm --create --verbose /dev/md0 --level=10 --raid-devices=4 /dev/sd[bcde]1 --spare-devices=1 /dev/sdf1 + +![](https://farm3.staticflickr.com/2946/15365277042_28a100baa2_z.jpg) + +When the array has been created (it should not take more than a few minutes), the output of: + + # mdadm --detail /dev/md0 + +should look like: + +![](https://farm3.staticflickr.com/2946/15362417891_7984c6a05f_o.png) + +A couple of things to note before we proceed further. + +1. **Used Dev Space** indicates the capacity of each member device used by the array. + +2. **Array Size** is the total size of the array. For a RAID 10 array, this is equal to (N*C)/M, where N: number of active devices, C: capacity of active devices, M: number of devices in each mirror. So in this case, (N*C)/M equals to (4*8GiB)/2 = 16GiB. + +3. **Layout** refers to the fine details of data layout. The possible layout values are as follows. + +---------- + +- **n** (default option): means near copies. Multiple copies of one data block are at similar offsets in different devices. This layout yields similar read and write performance than that of a RAID 0 array. + +![](https://farm3.staticflickr.com/2941/15365413092_0aa41505c2_o.png) + +- **o** indicates offset copies. Rather than the chunks being duplicated within a stripe, whole stripes are duplicated, but are rotated by one device so duplicate blocks are on different devices. Thus subsequent copies of a block are in the next drive, one chunk further down. To use this layout for your RAID 10 array, add --layout=o2 to the command that is used to create the array. + +![](https://farm3.staticflickr.com/2944/15178897580_6ef923a1cb_o.png) + +- **f** represents far copies (multiple copies with very different offsets). This layout provides better read performance but worse write performance. Thus, it is the best option for systems that will need to support far more reads than writes. To use this layout for your RAID 10 array, add --layout=f2 to the command that is used to create the array. + +![](https://farm3.staticflickr.com/2948/15179140458_4a803bb194_o.png) + +The number that follows the **n**, **f**, and **o** in the --layout option indicates the number of replicas of each data block that are required. The default value is 2, but it can be 2 to the number of devices in the array. By providing an adequate number of replicas, you can minimize I/O impact on individual drives. + +4. **Chunk Size**, as per the [Linux RAID wiki][2], is the smallest unit of data that can be written to the devices. The optimal chunk size depends on the rate of I/O operations and the size of the files involved. For large writes, you may see lower overhead by having fairly large chunks, whereas arrays that are primarily holding small files may benefit more from a smaller chunk size. To specify a certain chunk size for your RAID 10 array, add **--chunk=desired_chunk_size** to the command that is used to create the array. + +Unfortunately, there is no one-size-fits-all formula to improve performance. Here are a few guidelines to consider. + +- Filesystem: overall, [XFS][3] is said to be the best, while EXT4 remains a good choice. +- Optimal layout: far layout improves read performance, but worsens write performance. +- Number of replicas: more replicas minimize I/O impact, but increase costs as more disks will be needed. +- Hardware: SSDs are more likely to show increased performance (under the same context) than traditional (spinning) disks. + +### RAID Performance Tests using DD ### + +The following benchmarking tests can be used to check on the performance of our RAID 10 array (/dev/md0). + +#### 1. Write operation #### + +A single file of 256MB is written to the device: + + # dd if=/dev/zero of=/dev/md0 bs=256M count=1 oflag=dsync + +512 bytes are written 1000 times: + + # dd if=/dev/zero of=/dev/md0 bs=512 count=1000 oflag=dsync + +With dsync flag, dd bypasses filesystem cache, and performs synchronized write to a RAID array. This option is used to eliminate caching effect during RAID performance tests. + +#### 2. Read operation #### + +256KiB*15000 (3.9 GB) are copied from the array to /dev/null: + + # dd if=/dev/md0 of=/dev/null bs=256K count=15000 + +### RAID Performance Tests Using Iozone ### + +[Iozone][4] is a filesystem benchmark tool that allows us to measure a variety of disk I/O operations, including random read/write, sequential read/write, and re-read/re-write. It can export the results to a Microsoft Excel or LibreOffice Calc file. + +#### Installing Iozone on CentOS/RHEL 7 #### + +Enable [Repoforge][5]. Then: + + # yum install iozone + +#### Installing Iozone on Debian 7 #### + + # aptitude install iozone3 + +The iozone command below will perform all tests in the RAID-10 array: + + # iozone -Ra /dev/md0 -b /tmp/md0.xls + +- **-R**: generates an Excel-compatible report to standard out. +- **-a**: runs iozone in a full automatic mode with all tests and possible record/file sizes. Record sizes: 4k-16M and file sizes: 64k-512M. +- **-b /tmp/md0.xls**: stores test results in a specified file. + +Hope this helps. Feel free to add your thoughts or add tips to consider on how to improve performance of RAID 10. + +-------------------------------------------------------------------------------- + +via: http://xmodulo.com/setup-raid10-linux.html + +作者:[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://xmodulo.com/author/gabriel +[1]:http://xmodulo.com/create-software-raid1-array-mdadm-linux.html +[2]:https://raid.wiki.kernel.org/ +[3]:http://ask.xmodulo.com/create-mount-xfs-file-system-linux.html +[4]:http://www.iozone.org/ +[5]:http://xmodulo.com/how-to-set-up-rpmforge-repoforge-repository-on-centos.html \ No newline at end of file diff --git a/translated/news/20141008 Linux Calendar App California 0.2 Released.md b/translated/news/20141008 Linux Calendar App California 0.2 Released.md new file mode 100644 index 0000000000..959288c383 --- /dev/null +++ b/translated/news/20141008 Linux Calendar App California 0.2 Released.md @@ -0,0 +1,57 @@ +Linux日历程序California 0.2 发布了 +================================================================================ +**随着[上月的Geary和Shotwell的更新][1],非盈利软件套装Yobra又回来了,这次带来的是新的[California][2]日历程序的发布。** + +一个合格的桌面日历是工作井井有条(和想要井井有条)的必备工具。[广受欢迎Chrome Web Store上的Sunrise应用][3]的发布意味着选择并不像以前那么少了。California又为这个撑腰了。 + +Yorba的Jim Nelson在Yorba博客上写道:“发生了很多变化“,接着写道:“初次发布比我想的加入了更多的特性。” + +![California 0.2 Looks Great on GNOME](http://www.omgubuntu.co.uk/wp-content/uploads/2014/10/california-point-2.jpg) + +California 0.2在GNOME上看上去棒极了。 + +最突出的是添加了“自然语言”解析器。这使得添加事件更容易。相反,你可以直接输入“**在下午2点就Nachos会见Sam”接着California就会自动把它安排下接下来的星期一的下午两点,而不必你手动输入位的信息(日期,时间等等)。 + + +![](http://www.omgubuntu.co.uk/wp-content/uploads/2014/05/Screen-Shot-2014-05-15-at-21.26.20.png) + +当我们在5月份回顾开发版本时这个特性也能工作了,甚至修复了一个问题:重复事件。 + +要创建一个重复时间(比如:“每个星期四搜索自己的名字”),你需要在日期前包含文字“every”(每个)。要确保地点也在内(比如:中午12点和Samba De Amigo在Boston Tea Party喝咖啡)。条目中需要有“at”或者“@”。 + +至于详细信息,我们可以见[GNOME Wiki上的快速添加页面][4] + +其他的改变包括: + +- 通过‘月’和‘周’查看事件 +-添加/删除 Google,CalDAV和web(.ics)日历 +- 改进数据服务器整合 +-添加/编辑/啥是拿出远程事件(包括重复事件) +-自然语言计划 +-F1在线帮助快捷键 +- 新的动画和弹出窗口 + +### 在Ubuntu 14.10上安装 California 0.2 ### + +由于是GNOME 3的程序,可以说这下面程序看起来和感受上更好。 + +Yorba没有忽略Ubuntu用户。他们已经努力(也可以说是耐心地)地解决导致Ubuntu需要同时安装GTK+和GNOME的主题问题。结果就是在Ubuntu上程序可能看上去有点错位,但是同样工作的很好。 + +California 0.2在[Yorba稳定版软件PPA][5]中可以下载,且只针对Ubuntu 14.10。 + +-------------------------------------------------------------------------------- + +via: http://www.omgubuntu.co.uk/2014/10/california-calendar-natural-language-parser + +作者:[Joey-Elijah Sneddon][a] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:https://plus.google.com/117485690627814051450/?rel=author +[1]:http://www.omgubuntu.co.uk/2014/09/new-shotwell-geary-stable-release-available-to-downed +[2]:https://wiki.gnome.org/Apps/California +[3]:http://www.omgchrome.com/sunrise-calendar-app-for-google-chrome/ +[4]:https://wiki.gnome.org/Apps/California/HowToUseQuickAdd +[5]:https://launchpad.net/~yorba/+archive/ubuntu/ppa?field.series_filter=utopic \ No newline at end of file diff --git a/translated/share/README.md b/translated/share/README.md new file mode 100644 index 0000000000..e5e225858e --- /dev/null +++ b/translated/share/README.md @@ -0,0 +1 @@ +这里放分享类文章,包括各种软件的简单介绍、有用的书籍和网站等。 diff --git a/translated/talk/20140818 Can Ubuntu Do This--Answers to The 4 Questions New Users Ask Most.md b/translated/talk/20140818 Can Ubuntu Do This--Answers to The 4 Questions New Users Ask Most.md new file mode 100644 index 0000000000..65afcb84f4 --- /dev/null +++ b/translated/talk/20140818 Can Ubuntu Do This--Answers to The 4 Questions New Users Ask Most.md @@ -0,0 +1,79 @@ + +Ubunto可以实现这功能吗?-回答4个新用户最常问的问题 +================================================================================ +![](http://www.omgubuntu.co.uk/wp-content/uploads/2014/08/Screen-Shot-2014-08-13-at-14.31.42.png) + +**在谷歌输入‘Can Ubunt[u]’,一系列的自动建议会展现在你面前。这些建议都是根据最近搜索用户最频繁检索而形成的。 + +对于Linux老用户来说,他们都胸有成竹的回答这些问题。但是对于新用户或者那些还在探索类似Ubuntu是否是值得分配的人,他们不是十分清楚这些答案。这都是中肯,真实而且是基本的问题。 + +所以,在这片文章,我将会去回答4个最常会被搜索到的"Can Ubuntu...?"问题。 + +### Ubuntu可以取代Windows吗?### + +![Windows isn’t to everyones tastes — or needs](http://www.omgubuntu.co.uk/wp-content/uploads/2014/07/windows-9-desktop-rumour.png) +Windows 并不是每个人都喜欢 - 或者说是必须的。 + +是的。Ubutu(和其他Linux发行版)是可以安装到任何一台有能力运行微软系统的电脑。 + +无论你觉得 **应不应该** 取代它,不变的是,这取决于你自己的需求。 + +例如,你在上大学,所需的软件都只是Windows而已。暂时而言,你是不需要完全更换你的系统。对于工作也是同样的道理。如果你工作所用到的软件只是微软Office, Adobe Creative Suite 或者是一个AutoCAD应用程序,不是很建议你更换系统,坚持你现在所用的软件就足够了。 + +但是对于那些用Ubuntu完全取代微软的我们,Ubuntu 提供一个安全的桌面工作环境。这个桌面工作环境可以运行与支持很广的硬件环境。基本上,每个东西都有软件的支持,从办公套件到网页浏览器,视频应用程序,音乐应用程序到游戏。 + +### Ubuntu 可以运行 .exe文件吗?### + +![你可以在Ubuntu运行一些Windows应用程序。](http://www.omgubuntu.co.uk/wp-content/uploads/2013/01/adobe-photoshop-cs2-free-linux.png) +你可以在Ubuntu运行一些Windows应用程序 + +是可以的,尽管这些程序不是一步安装到位,或者不能保证安装成功。这是因为这些软件版本本来就是在Windows下运行的。 这些程序本来就与其他桌面操作系统不兼容,包括Mac OS X 或者 Android (安卓系统)。 + +那些专门为Ubuntu(和其他Linux发行版本)的软件安装包都是带有“.deb”的文件后缀名。它们的安装过程与安装 .exe 的程序是一样的 -双击安装包,然后根据屏幕提示完成安装。 + +但是Linux是很多样化的。 使用一个名为"Wine"的兼容层,可以运行许多当下很流行的应用程序。 (Wine不是一个模拟器,但是简单来讲是一个速记本。)这些程序不会像在Windows下运行得那么顺畅,或者有着出色的用户界面。然而,它足以满足日常的工作要求。 + +一些很出名的Windows软件是可以通过Wine来运行在Ubuntu操作系统上,这包括老版本的Photoshop和微软办公室软件。 有关兼容软件的列表 [参照Wine应用程序数据库][1]. + +### Ubuntu会有病毒吗?### + +![它可能有错误,但是它并没有病毒](http://www.omgubuntu.co.uk/wp-content/uploads/2014/04/errors.jpg) +它可能有错误,但是它并有病毒 + +理论上,它会有病毒。但是,实际上它没有。 + +Linux发行版本是建立在一个病毒,蠕虫,隐匿程序都很难被安装,运行或者造成很大影响的环境之下的。 + +例如,很多应用程序都是在没有特别管理权限要求,以普通用户权限运行的。病毒的访问系统关键部分的请求也是需要用户管理权限的。很多软件的提供都是从那些维护良好的而且集中的资源库,例如Ubuntu软件中心,而不是一些不知名的网站。 由于这样的管理使得安装一些受感染的软件的几率可以忽略不计。 + +你应不应该在Ubuntu系统安装杀毒软件?这取决于你自己。为了自己的安心,或者如果你经常通过Wine来使用Windows软件,或者双系统,你可以安装ClamAV。它是一个免费的开源的病毒扫描应用程序。你可以在Ubuntu软件中心找到它。 + +你可以在Ubuntu维基百科了解更多关于病毒在Linux或者Ubuntu的信息。 [Ubuntu 维基百科][2]. + +### 在Ubuntu上可以玩游戏吗?### + +![Steam有着上百个专门为Linux设计的高质量游戏。](http://www.omgubuntu.co.uk/wp-content/uploads/2012/11/steambeta.jpg) +Steam有着上百个专门为Linux设计的高质量游戏。 + +当然可以!Ubuntu有着多样化的游戏,从传统简单的2D象棋,拼字游戏和扫雷游戏,到很现代化AAA级别的对显卡要求强的游戏。 + +你首先去到 **Ubuntu 软件中心**。这里你会找到很多免费的,开源的和付钱的游戏,包括广受好评的独立制作游戏,像World of Goo 和Braid。当然也有其他传统游戏的提供,例如,Pychess(国际象棋),four-in-a-row和Scrabble clones(猜字拼字游戏)。 + +对于游戏狂热爱好者,你可以点击**Steam for Linux**. 在这里你可以找到各种这样最新最好玩的游戏。 + +另外,记得留意这个网站 [Humble Bundle][3]。这些“只买你想要的”的套餐只会持续每个月里面的两周。作为游戏平台,它是Linux特别友好的支持者。因为每当一些新游戏出来的时候,它都保证可以在Linux下搜索到。 + +-------------------------------------------------------------------------------- + +via: http://www.omgubuntu.co.uk/2014/08/ubuntu-can-play-games-replace-windows-questions + +作者:[Joey-Elijah Sneddon][a] +译者:[Shaohao Lin](https://github.com/shaohaolin) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:https://plus.google.com/117485690627814051450/?rel=author +[1]:https://appdb.winehq.org/ +[2]:https://help.ubuntu.com/community/Antivirus +[3]:https://www.humblebundle.com/ \ No newline at end of file diff --git a/translated/talk/20140910 Why Do Some Old Programming Languages Never Die.md b/translated/talk/20140910 Why Do Some Old Programming Languages Never Die.md new file mode 100644 index 0000000000..5ed8a5513d --- /dev/null +++ b/translated/talk/20140910 Why Do Some Old Programming Languages Never Die.md @@ -0,0 +1,85 @@ +为什么一些古老的编程语言不会消亡? +================================================================================ +> 我们中意于我们所知道的。 + +![](http://a4.files.readwrite.com/image/upload/c_fill,h_900,q_70,w_1600/MTIzMDQ5NjY0MTUxMjU4NjM2.jpg) + +当今许多知名的编程语言已经都非常古老了。PHP 语言20年、Python 语言23年、HTML 语言21年、Ruby 语言和 JavaScript 语言已经19年,C 语言更是高达42年之久。 + +这是没人能预料得到的,即使是计算机科学家 [Brian Kernighan][1] 也一样。他是写著第一本关于 C 语言的作者之一,只到今天这本书还在印刷着。(C 语言本身的发明者 [Dennis Ritchie][2] 是 Kernighan 的合著者,他于 2011 年已辞世。) + +“我依稀记得早期跟编辑们的谈话,告诉他们我们已经卖出了5000册左右的量,”最近采访 Kernighan 时他告诉我说。“我们设法做的更好。我没有想到的是在2014年的教科书里学生仍然在使用第一个版本的书。” + +关于 C 语言的持久性特别显著的就是 Google 开发出了新的语言 Go,解决同一问题比用 C 语言更有效率。 + +“大多数语言并不会消失或者至少很大一部分用户承认它们不会消失,”他说。“C 语言仍然在一定的领域独领风骚,所以它很接地气。” + +### 编写所熟悉的 ### + +为什么某些计算机编程语言要比其它的更流行?因为开发者都选择使用它们。逻辑上来说,这解释已经足够,但还想深入了解为什么开发人员会选择使用它们呢,这就有点棘手了。 + +分别来自普林斯顿大学和加州大学伯克利分校的研究者 Ari Rabkin 和 Leo Meyerovich 花费了两年时间来研究解决上面的问题。他们的研究报告,[《编程语言使用情况实例分析》][3],记录了对超过 200,000 个 Sourceforge 项目和超过 13,000 个程序员投票结果的分析。 + +他们主要的发现呢?大多数时候程序员选择的编程语言都是他们所熟悉的。 + +“存在着我们使用的语言是因为我们经常使用他们,” Rabkin 告诉我。“例如:天文学家就经常使用 IDL [交互式数据语言]来开发他们的计算机程序,并不是因为它具有什么特殊的星级功能或其它特点,而是因为用它形成习惯了。他们已经用些语言构建出很优秀的程序了,并且想保持原状。” + +换句话说,它部分要归功于创建其的语言的的知名度仍保留较大劲头。当然,这并不意味着流行的语言不会变化。Rabkin 指出我们今天在使用的 C 语言就跟 Kernighan 第一次创建时的一点都不同,那时的 C 编译器跟现代的也不是完全兼容。 + +“有一个古老的,关于工程师的笑话。工程师被问到哪一种编程语言人们会使用30年,他说,‘我不知道,但它总会被叫做 Fortran’,” Rabkin 说到。“长期存活的语言跟他们在70年代和80年代刚设计出来的时候不一样了。人们通常都是在上面增加功能,而不会删除功能,因为要保持向后兼容,但有些功能会被修正。” + +向后兼容意思就是当语言升级后,程序员不仅可以使用升级语言的新特性,也不用回去重写已经实现的老代码块。老的“遗留代码”的语法规则已经不用了,但舍弃是要花成本的。只要它们存在,我们就有理由相信相关的语言也会存在。 + +### PHP: 存活长久语言的一个案例学习 ### + +遗留代码指的是用过时的源代码编写的程序或部分程序。想想看,一个企业或工程项目的关键程序功能部分是用没人维护的编程语言写出来的。因为它们仍起着作用,用现代的源代码重写非常困难或着代价太高,所以它们不得不保留下来,即使其它部分的代码都变动了,程序员也必须不断折腾以保证它们能正常工作。 + +任何的编程语言,存在了超过几十年时间都具有某种形式的遗留代码问题, PHP 也不加例外。PHP 是一个很有趣的例子,因为它的遗留代码跟现在的代码明显不同,支持者或评论家都承认这是一个巨大的进步。 + +Andi Gutmans 是 已经成为 PHP4 的标准编译器的 Zend Engine 的发明者之一。Gutmans 说他和搭档本来是想改进完善 PHP3 的,他们的工作如此成功,以至于 PHP 的原发明者 Rasmus Lerdorf 也加入他们的项目。结果就成为了 PHP4 和他的后续者 PHP5 的编译器。 + +因此,当今的 PHP 与它的祖先即最开始的 PHP 是完全不同的。然而,在 Gutmans 看来,在用古老的 PHP 语言版本写的遗留代码的地方一直存在着偏见以至于上升到整个语言的高度。比如 PHP 充满着安全漏洞或没有“集群”功能来支持大规模的计算任务等概念。 + +“批评 PHP 的人们通常批评的是在 1998 年时候的 PHP 版本,”他说。“这些人都没有与时俱进。当今的 PHP 已经有了很成熟的生态系统了。” + +如今,Gutmans 说,他作为一个管理者最重要的事情就是鼓励人们升级到最新版本。“PHP有个很大的社区,足以支持您的遗留代码的问题,”他说。“但总的来说,我们的社区大部分都在 PHP5.3 及以上的。” + +问题是,任何语言用户都不会全部升级到最新版本。这就是为什么 Python 用户仍在使用 2000 年发布的 Python 2,而不是使用 2008 年发布的 Python 3 的原因。甚至是已经六年了喜欢 Google 的大多数用户仍没有升级。这种情况是多种原因造成的,但它使得很多开发者在承担风险。 + +“任何东西都不会消亡的,”Rabkin 说。“任何语言的遗留代码都会一直存在。重写的代价是非常高昂的,如果它们不出问题就不要去改动。” + +### 开发者是稀缺的资源 ### + +当然,开发者是不会选择那些仅仅只是为了维护老旧代码的的程序语言的。当谈论到对语言选择的偏好时,Rabkin 和 Meyerovich 发现年龄仅仅只代表个数字。Rabkin 告诉我说: + +> 有一件事使我们被深深震撼到了。这事最重要的就是我们给人们按年龄分组,然后询问他们知道多少编程语言。我们主观的认为随着年龄的增长知道的会越来越多,但实际上却不是,25岁年龄组和45岁年龄组知道的语言数目是一样的。几个反复询问的问题这里持续不变的。您知道一种语言的几率并不与您的年龄挂钩。 + +换句话说,不仅仅里年长的开发者坚持传统,年轻的程序员会承认并采用古老的编程语言作为他们的第一们语言。这可能是因为这些语言具有很有趣的开发库及功能特点,也可能是因为在社区里开发者都是一个组的都喜爱这种开发语言。 + +“在全球程序员关注的语言的数量是有定数的,” Rabkin 说。“如果一们语言表现出足够独特的价值,人们将会学习和使用它。如果是和您交流代码和知识的的某个人分享一门编程语言,您将会学习它。因此,例如,只要那些开发库是 Python 库和社区特长是 Python 语言的经验,那么 Python 将会大行其道。” + +研究人员发现关于语言实现的功能,社区是一个巨大的因素。虽然像 Python 和 Ruby 这样的高级语言并没有太大的差别,但,例如程序员就更容易觉得一种比另一种优越。 + +“Rails 不一定要用 Ruby 语言编写,但它用了,这就是社会因素在起作用,” Rabkin 说。“例如,复活 Objective-C 语言这件事就是苹果的工程师团队说‘让我们使用它吧,’ 他们就没得选择了。” + +通观社会的影响及老旧代码这些问题,我们发现最古老的和最新的计算机语言都有巨大的惰性。Go 语言怎么样能超越 C 语言呢?如果有合适的人或公司说它超越它就超越。 + +“它归结为谁传播的更好谁就好,” Rabkin 说。 + +开始的图片来自 [Blake Patterson][4] + +-------------------------------------------------------------------------------- + +via: http://readwrite.com/2014/09/02/programming-language-coding-lifetime + +作者:[Lauren Orsini][a] +译者:[runningwater](https://github.com/runningwater) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://readwrite.com/author/lauren-orsini +[1]:http://en.wikipedia.org/wiki/Brian_Kernighan +[2]:http://en.wikipedia.org/wiki/Dennis_Ritchie +[3]:http://asrabkin.bitbucket.org/papers/oopsla13.pdf +[4]:https://www.flickr.com/photos/blakespot/2444037775/ \ No newline at end of file diff --git a/translated/talk/20140926 ChromeOS vs Linux--The Good, the Bad and the Ugly.md b/translated/talk/20140926 ChromeOS vs Linux--The Good, the Bad and the Ugly.md new file mode 100644 index 0000000000..2a193224b1 --- /dev/null +++ b/translated/talk/20140926 ChromeOS vs Linux--The Good, the Bad and the Ugly.md @@ -0,0 +1,82 @@ +ChromeOS 对战 Linux : 孰优孰劣,仁者见仁,智者见智 +================================================================================ +> 在 ChromeOS 和 Linux 的斗争过程中,不管是哪一家的操作系统都是有优有劣。 + +任何不关注Google 的人都不会相信Google在桌面用户当中扮演着一个很重要的角色。在近几年,我们见到的[ChromeOS][1]制造的[Google Chromebook][2]相当的轰动。和同期的人气火爆的Amazon 一样,似乎ChromeOS 势不可挡。 + +在本文中,我们要了解的是ChromeOS 的概念市场,ChromeOS 怎么影响着Linux 的份额,和整个 ChromeOS 对于linux 社区来说,是好事还是坏事。另外,我将会谈到一些重大的事情,和为什么没人去为他做点什么事情。 + +### ChromeOS 并非真正的Linux ### + +每当有朋友问我说是否ChromeOS 是否是Linux 的一个版本时,我都会这样回答:ChromeOS 对于Linux 就好像是 OS X 对于BSD 。换句话说,我认为,ChromeOS 是linux 的一个派生操作系统,运行于Linux 内核的引擎之下。而很多操作系统就组成了Google 的专利代码和软件。 + +尽管ChromeOS 是利用了Linux 内核引擎,但是它仍然有很大的不同和现在流行的Linux 分支版本。 + +尽管ChromeOS 的差异化越来越明显,是在于它给终端用户提供的app,包括Web 应用。因为ChromeOS 的每一个操作都是开始于浏览器窗口,这对于Linux 用户来说,可能会有很多不一样的感受,但是,对于没有Linux 经验的用户来说,这与他们使用的旧电脑并没有什么不同。 + +就是说,每一个以Google-centric 为生活方式的人来说,在ChromeOS上的感觉将会非常良好,就好像是回家一样。这样的优势就是这个人已经接受了Chrome 浏览器,Google 驱动器和Gmail 。久而久之,他们的亲朋好友使用ChromeOs 也就是很自然的事情了,就好像是他们很容易接受Chrome 浏览器,因为他们觉得早已经用过。 + +然而,对于Linux 爱好者来说,这样的约束就立即带来了不适应。因为软件的选择被限制,有范围的,在加上要想玩游戏和VoIP 是完全不可能的。那么对不起,因为[GooglePlus Hangouts][3]是代替不了VoIP 软件的。甚至在很长的一段时间里。 + +### ChromeOS 还是Linux 桌面 ### + +有人断言,ChromeOS 要是想在桌面系统的浪潮中对Linux 产生影响,只有在Linux 停下来浮出水面栖息的时候或者是满足某个非技术用户的时候。 + +是的,桌面Linux 对于大多数休闲型的用户来说绝对是一个好东西。然而,它必须有专人帮助你安装操作系统,并且提供“维修”服务,从windows 和 OS X 的阵营来看。但是,令人失望的是,在美国Linux 正好在这个方面很缺乏。所以,我们看到,ChromeOS 正慢慢的走入我们的视线。 + +我发现Linux 桌面系统最适合做网上技术支持来管理。比如说:家里的高级用户可以操作和处理更新政府和学校的IT 部门。Linux 还可以应用于这样的环境,Linux桌面系统可以被配置给任何技能水平和背景的人使用。 + +相比之下,ChromeOS 是建立在完全免维护的初衷之下的,因此,不需要第三者的帮忙,你只需要允许更新,然后让他静默完成即可。这在一定程度上可能是由于ChromeOS 是为某些特定的硬件结构设计的,这与苹果开发自己的PC 电脑也有异曲同工之妙。因为Google 的ChromeOS 附带一个硬件脉冲,它允许“犯错误”。对于某些人来说,这是一个很奇妙的地方。 + +滑稽的是,有些人却宣称,ChomeOs 的远期的市场存在很多问题。简言之,这只是一些Linux 激情的爱好者在找对于ChomeOS 的抱怨罢了。在我看来,停止造谣这些子虚乌有的事情才是关键。 + +问题是:ChromeOS 的市场份额和Linux 桌面系统在很长的一段时间内是不同的。这个存在可能会在将来被打破,然而在现在,仍然会是两军对峙的局面。 + +### ChromeOS 的使用率正在增长 ### + +不管你对ChromeOS 有怎么样的看法,事实是,ChromeOS 的使用率正在增长。专门针对ChromeOS 的电脑也一直有发布。最近,戴尔(Dell)也发布了一款针对ChromeOS 的电脑。命名为[Dell Chromebox][5],这款ChromeOS 设备将会是另一些传统设备的终结者。它没有软件光驱,没有反病毒软件,offers 能够无缝的在屏幕后面自动更新。对于一般的用户,Chromebox 和Chromebook 正逐渐成为那些工作在web 浏览器上的人的一个选择。 + +尽管增长速度很快,ChromeOS 设备仍然面临着一个很严峻的问题 - 存储。受限于有限的硬盘的大小和严重依赖于云存储,并且ChromeOS 不会为了任何使用它们电脑的人消减基本的web 浏览器的功能。 + +### ChromeOS 和Linux 的异同点 ### + +以前,我注意到ChromeOS 和Linux 桌面系统分别占有着两个完全不同的市场。出现这样的情况是源于,Linux 社区的致力于提升Linux 桌面系统的脱机性能。 + +是的,偶然的,有些人可能会第一时间发现这个“Linux 的问题”。但是,并没有一个人接着跟进这些问题,确保得到问题的答案,确保他们得到Linux 最多的帮助。 + +事实上,脱机故障可能是这样发现的: + +- 有些用户偶然的在Linux 本地事件发现了Linux 的问题。 +- 他们带回了DVD/USB 设备,并尝试安装这个操作系统。 +- 当然,有些人很幸运的成功的安装成功了这个进程,但是,据我所知大多数的人并没有那么幸运。 +- 令人失望的是,这些人希望在网上论坛里搜索帮助。很难做一个主计算机,没有网络和视频的问题。 +- 我真的是受够了,后来有很多失望的用户拿着他们的电脑到windows 商店来“维修”。除了重装一个windows 操作系统,他们很多时候都会听到一句话,“Linux 并不适合你们”,应该尽量避免。 + +有些人肯定会说,上面的举例肯定夸大其词了。让我来告诉你:这是发生在我身边真实的事的,而且是经常发生。醒醒吧,Linux 社区的人们,我们的这种模式已经过时了。 + +### 伟大的平台,强大的营销和结论 ### + +如果非要说ChromeOS 和Linux 桌面系统相同的地方,除了它们都使用了Linux 内核,就是它们都伟大的产品却拥有极其差劲的市场营销。而Google 的好处就是,他们投入大量的资金在网上构建大面积存储空间。 + +Google 相信他们拥有“网上的优势”,而线下的影响不是很重要。这真是一个让人难以置信的目光短浅,这也成了Google 历史上最大的一个失误之一。相信,如果你没有接触到他们在线的努力,你不值得困扰,仅仅就当是他们在是在选择网上存储空间上做出反击。 + +我的建议是:通过Google 的线下影响,提供Linux 桌面系统给ChromeOS 的市场。这就意味着Linux 社区的人需要筹集资金来出席县博览会、商场展览,在节日季节,和在社区中进行免费的教学课程。这会立即使Linux 桌面系统走入人们的视线,否则,最终将会是一个ChromeOS 设备出现在人们的面前。 + +如果说本地的线下市场并没有想我说的这样,别担心。Linux 桌面系统的市场仍然会像ChromeOS 一样增长。最坏也能保持现在这种两军对峙的市场局面。 + +-------------------------------------------------------------------------------- + +via: http://www.datamation.com/open-source/chromeos-vs-linux-the-good-the-bad-and-the-ugly-1.html + +作者:[Matt Hartley][a] +译者:[barney-ro](https://github.com/barney-ro) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://www.datamation.com/author/Matt-Hartley-3080.html +[1]:http://en.wikipedia.org/wiki/Chrome_OS +[2]:http://www.google.com/chrome/devices/features/ +[3]:https://plus.google.com/hangouts +[4]:http://en.wikipedia.org/wiki/Voice_over_IP +[5]:http://www.pcworld.com/article/2602845/dell-brings-googles-chrome-os-to-desktops.html diff --git a/translated/talk/20140928 What is a good subtitle editor on Linux.md b/translated/talk/20140928 What is a good subtitle editor on Linux.md new file mode 100644 index 0000000000..8ae39fd098 --- /dev/null +++ b/translated/talk/20140928 What is a good subtitle editor on Linux.md @@ -0,0 +1,64 @@ +Linux 上好用的几款字幕编辑器介绍 +================================================================================ +如果你经常看国外的大片,你应该会喜欢带字幕版本而不是有国语配音的版本。在法国长大,我的童年记忆里充满了迪斯尼电影。但是这些电影因为有了法语的配音而听起来很怪。如果现在有机会能看原始的版本,我知道,对于大多数的人来说,字幕还是必须的。我很高兴能为家人制作字幕。最让我感到希望的是,Linux 也不无花哨,而且有很多开源的字幕编辑器。总之一句话,这篇文章并不是一个详尽的Linux上字幕编辑器的列表。你可以告诉我那一款是你认为最好的字幕编辑器。 + +### 1. Gnome Subtitles ### + +![](https://farm6.staticflickr.com/5596/15323769611_59bc5fb4b7_z.jpg) + +[Gnome Subtitles][1] 我的一个选择,当有字幕需要快速编辑时。你可以载入视频,载入字幕文本,然后就可以即刻开始了。我很欣赏其对于易用性和高级特性之间的平衡性。它带有一个同步工具以及一个拼写检查工具。最后,虽然最后,但并不是不重要,这么好用最主要的是因为它的快捷键:当你编辑很多的台词的时候,你最好把你的手放在键盘上,使用其内置的快捷键来移动。 + +### 2. Aegisub ### + +![](https://farm3.staticflickr.com/2944/15323964121_59e9b26ba5_z.jpg) + +[Aegisub][2] 有更高级别的复杂性。接口仅仅反映了学习曲线。但是,除了它吓人的样子以外,Aegisub 是一个非常完整的软件,提供的工具远远超出你能想象的。和Gnome Subtitles 一样,Aegisub也采用了所见即所得(WYSIWYG:what you see is what you get)的处理方式。但是是一个全新的高度:可以再屏幕上任意拖动字幕,也可以在另一边查看音频的频谱,并且可以利用快捷键做任何的事情。除此以外,它还带有一个汉字工具,有一个kalaok模式,并且你可以导入lua 脚本让它自动完成一些任务。我希望你在用之前,先去阅读下它的[指南][3]。 + +### 3. Gaupol ### + +![](https://farm3.staticflickr.com/2942/15326817292_6702cc63fc_z.jpg) + +另一个操作复杂的软件是[Gaupol][4],不像Aegisub ,Gaupol 很容易上手而且采用了一个和Gnome Subtitles 很像的界面。但是在这些相对简单背后,它拥有很多很必要的工具:快捷键、第三方扩展、拼写检查,甚至是语音识别(由[CMU Sphinx][5]提供)。这里也提一个缺点,我注意到有时候在测试的时候也,软件会有消极怠工的表现,不是很严重,但是也足以让我更有理由喜欢Gnome Subtitles了。 + +### 4. Subtitle Editor ### + +![](https://farm4.staticflickr.com/3914/15323911521_8e33126610_z.jpg) + +[Subtitle Editor][6]和Gaupol 很像。但是,它的界面有点不太直观,特性也只是稍微的高级一点点。我很欣赏的一点是,它可以定义“关键帧”,而且提供所有的同步选项。然而,多一点的图标,或者是少一点的文字都能提供界面的特性。作为一个好人,我认为,Subtitle Editor 可以模仿“作家”打字的效果,虽然我不知道它是否有用。最后但并非不重要。重定义快捷键的功能很实用。 + +### 5. Jubler ### + +![](https://farm4.staticflickr.com/3912/15323769701_3d94ca8884_z.jpg) + +用Java 写的,[Jubler][7]是一个多平台支持的字幕编辑器。我对它的界面印象特别深刻。在上面我确实看出了Java-ish 方面的东西,但是,它仍然是经过精心的构造和构思的。像Aegisub 一样,你可以再屏幕上任意的拖动字幕,让你有愉快的体验而不单单是打字。它也可以为字幕自定义一个风格,在另外的一个轨道播放音频,翻译字幕,或者是是做拼写检查,然而,你必须要注意的是,你必须事先安装好媒体播放器并且正确的配置,如果你想完整的使用Jubler。我把这些归功于在[官方页面][8]下载了脚本以后其简便的安装方式。 + +### 6. Subtitle Composer ### + +![](https://farm6.staticflickr.com/5578/15323769711_6c6dfbe405_z.jpg) + +被视为“KDE里的字幕作曲家”,[Subtitle Composer][9]能够唤起对很多传统功能的回忆。伴随着KDE界面,我们很期望。很自然的我们就会说到快捷键,我特别喜欢这个功能。除此之外,Subtitle Composer 与上面提到的编辑器最大的不同地方就在于,它可以执行用JavaScript,Python,甚至是Ruby写成的脚本。软件带有几个例子,肯定能够帮助你很好的学习使用这些特性的语法。 + +最后,不管你喜不喜欢我,都要为你的家庭编辑几个字幕,重新同步整个轨道,或者是一切从头开始,那么Linux 有很好的工具给你。对我来说,快捷键和易用性使得各个工具有差异,想要更高级别的使用体验,脚本和语音识别就成了很便利的一个功能。 + +你会使用哪个字幕编辑器,为什么?你认为还有没有更好用的字幕编辑器这里没有提到的?在评论里告诉我们。 + +-------------------------------------------------------------------------------- + +via: http://xmodulo.com/good-subtitle-editor-linux.html + +作者:[Adrien Brochard][a] +译者:[barney-ro](https://github.com/barney-ro) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://xmodulo.com/author/adrien +[1]:http://gnomesubtitles.org/ +[2]:http://www.aegisub.org/ +[3]:http://docs.aegisub.org/3.2/Main_Page/ +[4]:http://home.gna.org/gaupol/ +[5]:http://cmusphinx.sourceforge.net/ +[6]:http://home.gna.org/subtitleeditor/ +[7]:http://www.jubler.org/ +[8]:http://www.jubler.org/download.html +[9]:http://sourceforge.net/projects/subcomposer/ diff --git a/translated/tech/20140826 20 Postfix Interview Questions and Answers.md b/translated/tech/20140826 20 Postfix Interview Questions and Answers.md new file mode 100644 index 0000000000..4ae9f2ad38 --- /dev/null +++ b/translated/tech/20140826 20 Postfix Interview Questions and Answers.md @@ -0,0 +1,122 @@ +Postfix的20个问答题 +================================================================================ +### 问题1:什么是 Postfix,它的默认端口是多少? ### + +答:Postfix 是一个开源的 MTA(邮件传送代理,英文名:Mail Transfer Agent),用于转发 email。相信很多人知道 Sendmail,而 Postfix 是它的替代品。默认端口是25。 + +### 问题2:Postfix 和 Sendmail 有什么区别? ### + +答:Postfix 使用模块化设计,由多个独立的可执行程序组成;而 Sendmail 被设计成有一个强大的后台进程提供所有服务。 + +### 问题3:什么是 MTA,它在邮件系统中扮演什么角色? ### + +答:MTA 是 Mail Transfer Agent 的缩写。MTA 负责接收和发送邮件、确定发送路径和地址重写(LCTT:address rewriting,就是完善发送地址,比如将“username”这个地址重写为“username@example.com”)。本地转发就是将邮件发送给 MDA。Qmail、Postix、Sendmail 都是 MTA。 + +### 问题4:什么是 MDA? ### + +答:MDA 是 Mail Delivery Agent 的缩写。MDA 这个程序用于从 MTA 获取邮件并传送至本地接受者的邮箱。MDA 通常可以过滤邮件或为邮件分类。一个 MDA 也能决定一封邮件是否需要转发到另一个邮箱地址。Procmail 就是一个 MDA。 + +### 问题5:什么是 MUA? ### + +答:MUA 是 Mail User Agent 的缩写。MUA 是一个邮件客户端软件,可以用来写邮件、发送邮件、接收邮件。发送邮件时使用的是 MTA;接收邮件时可以从邮件存储区直接收取,也可以通过 POP/IMAP 服务器间接收取。Outlook、Thunkerbird、Evolution 都是 MUA。 + +### 问题6:Mailserver 里 postmaster 的作用是什么? ### + +答:邮件管理者一般就是 postmaster。一个 postmaster 的责任就是保证邮件系统正常工作、更新系统配置、添加/删除邮箱帐号,以及其他。每个域中必须存在一个 postmaster 的别名(LCTT:postmaster 别名的作用就是能让你的邮件系统以外的用户往邮件系统里面的用户发邮件,当然也能接收来自系统内部用户发送出来的邮件),用于将邮件发往正确的用户。 + +### 问题7:Postfix 都有些什么重要的进程? ### + +答:以下是 Postfix 邮件系统里最重要的后台进程列表: + +- **master**:这条进程是 Postfix 邮件系统的大脑,它产生所有其他进程。 +- **smtpd**:作为服务器端程序处理所有外部连进来的请求。 +- **smtp**:作为客户端程序处理所有对外发起连接的请求。 +- **qmgr**:它是 Postfix 邮件系统的心脏,处理和控制邮件列表里面的所有消息。 +- **local**:这是 Postfix 自有的本地传送代理,就是它负责把邮件保存到邮箱里。 + +### 问题8:Postfix 服务器的配置什么是什么? ### + +答:有两个主要配置文件: + +- **/etc/postfix/main.cf**:这个文件保存全局配置信息,所有进程都会用到,除非这些配置在 master.cf 文件中被重新设置了。 +- **/etc/postfix/master.cf**:这个文件保存了额外的进程运行时环境参数,在 main.cf 文件中定义的配置可能会被本文件的配置覆盖掉。 + +### 问题9:如何将 Postfix 重启以及设为开机启动? ### + +答:使用这个命令重启:`service postfix restart`;使用这个命令设为开机启动:`chkconfig postfix on` + +### 问题10:怎么查看 Postfix 的邮件列表? ### + +答:Postfix 维护两个列表:未决邮件队列(pending mails queue)和等待邮件队列(deferred mail queue)。等待队列包含了暂时发送失败、需要重新发送的邮件,Postfix 会定期重发(默认5分钟,可自定义设置)。(LCTT:其实 Postfix 维护5个队列:输入队列,邮件进入 Postfix 系统的第一站;活动队列,qmgr 将输入队列的邮件移到活动队列;等待队列,保存暂时不能发送出去的邮件;故障队列,保存受损或无法解读的邮件;保留队列,将邮件无限期留在 Postfix 队列系统中。) + +列出邮件队列里面所有邮件: + + # postqueue -p + +保存邮件队列名单: + + # postqueue -p > /mnt/queue-backup.txt + +让 Postfix 马上处理队列: + + # postqueue -f + +### 问题11:如何删除邮件队列里面的邮件? ### + +答:以下命令删除所有邮件: + + # postsuper -d ALL + +以下命令只删除等待队列中的邮件: + + # postsuper -d ALL deferred + +### 问题12:如何通过命令来检查 Postfix 配置信息? ### + +答:使用`postconf -n`命令可以查看,它会过滤掉配置文件里面被注释掉的配置信息。 + +### 问题13:实时查看邮件日志要用什么命令? ### + +答:`tail -f /var/log/maillog` 或 `tailf /var/log/maillog` + +### 问题14:如何通过命令行发送测试邮件? ### + +答:参考下面的命令: + + # echo "Test mail from postfix" | mail -s "Plz ignore" info@something.com + +### 问题15:什么是“开放邮件转发”? ### + +答:开放邮件转发是 SMTP 服务器的一项设定,允许因特网上其他用户能通过该服务器转发邮件,而不是直接发送到某个帐号。过去,这项功能在许多邮件服务器中都是默认开启的,但是现在已经不再流行了,因为邮件转发会导致大量垃圾邮件和病毒邮件在网络上肆虐。 + +### 问题16:什么是 Postfix 上的邮件转发主机? ### + +答:转发主机是 SMTP 的地址,如果在配置文件中有配置,那么所有输入邮件都将被 SMTP 服务器转发。 + +### 问题17:什么是灰名单? ### + +答:灰名单(LCTT:介于白名单和黑名单之间)用于拦截垃圾邮件。一个 MTA 使用灰名单时就会“暂时拒绝”未被识别的发送者发来的所有邮件。如果邮件是正当合理的,发起者会在一段时间后重新发送,然后这份邮件就能被接收。(LCTT:灰名单基于这样一个事实,就是大多数的垃圾邮件服务器和僵尸网络的邮件只发送一次,而会忽略要求它们在一定的时间间隔后再次发送的请求。) + +### 问题18:邮件系统中 SPF 记录有什么重要作用? ### + +答:SPF 是 Sender Policy Framework 的缩写,用于帮助域的拥有者确认发送方是否来自他们的域,目的是其他邮件系统能够保证发送方在发送邮件时是否经过授权 —— 这种方法可以减小遇到邮件地址欺骗、网络钓鱼和垃圾邮件的风险。 + +### 问题19:邮件系统中 DKIM 有什么用处? ### + +答:域名密匙是一套电子邮件身份认证系统,用于验证邮件发送方的 DNS 域和邮件的完整性。域名密匙规范采用互联网电子邮件认证技术,建立了一套加强版协议:域名密匙识别邮件(就是 DKIM)。 + +### 问题20:邮件系统中 ASSP 的规则是什么? ### + +答:ASSP(Anti-Spam SMTP Proxy,反垃圾代理) 是一个网关服务器,安装在你的 MTA 前面,通过自建白名单、自动学习贝叶斯算法、灰名单、DNS 黑名单(DNSBL)、DNS 白名单(DNSWL)、URI黑名单(URIBL)、SPF、SRS、Backscatter、病毒扫描功能、附件阻拦功能、基于发送方等多种方法来反垃圾邮件。 + +-------------------------------------------------------------------------------- + +via: http://www.linuxtechi.com/postfix-interview-questions-answers/ + +作者:[Pradeep Kumar][a] +译者:[bazz2](https://github.com/bazz2) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://www.linuxtechi.com/author/pradeep/ diff --git a/translated/tech/20140901 How to install and configure ownCloud on Debian.md b/translated/tech/20140901 How to install and configure ownCloud on Debian.md new file mode 100644 index 0000000000..84755fe8e1 --- /dev/null +++ b/translated/tech/20140901 How to install and configure ownCloud on Debian.md @@ -0,0 +1,209 @@ +如何在Debian上安装配置ownCloud +================================================================================ +据其官方网站,ownCloud可以让你通过一个网络接口或者WebDAV访问你的文件。它还提供了一个平台,可以轻松地查看、编辑和同步您所有设备的通讯录、日历和书签。尽管ownCloud与广泛使用Dropbox非常相似,但主要区别在于ownCloud是免费的,开源的,从而可以自己的服务器上建立与Dropbox类似的云存储服务。使用ownCloud你可以完整地访问和控制您的私人数据而对存储空间没有限制(除了硬盘容量)或者连客户端的连接数量。 + +ownCloud提供了社区版(免费)和企业版(面向企业的有偿支持)。预编译的ownCloud社区版可以提供了CentOS、Debian、Fedora、openSUSE、,SLE和Ubuntu版本。本教程将演示如何在Debian Wheezy上安装和在配置ownCloud社区版。 + +### 在Debian上安装 ownCloud ### + +进入官方网站:[http://owncloud.org][1],并点击‘Install’按钮(右上角)。 + +![](https://farm4.staticflickr.com/3885/14884771598_323f2fc01c_z.jpg) + +为当前的版本选择“Packages for auto updates”(下面的图是v7)。这可以让你轻松的让你使用的ownCloud与Debian的包管理系统保持一致,包是由ownCloud社区维护的。 + +![](https://farm6.staticflickr.com/5589/15071372505_298a796ff6_z.jpg) + +在下一屏职工点击继续: + +![](https://farm6.staticflickr.com/5589/14884818527_554d1483f9_z.jpg) + +在可用的操作系统列表中选择Debian 7 [Wheezy]: + +![](https://farm6.staticflickr.com/5581/14884669449_433e3334e0_z.jpg) + +加入ownCloud的官方Debian仓库: + + # echo 'deb http://download.opensuse.org/repositories/isv:/ownCloud:/community/Debian_7.0/ /' >> /etc/apt/sources.list.d/owncloud.list + +加入仓库密钥到apt中: + + # wget http://download.opensuse.org/repositories/isv:ownCloud:community/Debian_7.0/Release.key + # apt-key add - < Release.key + +继续安装ownCLoud: + + # aptitude update + # aptitude install owncloud + +打开你的浏览器并定位到你的ownCloud实例中,地址是http:///owncloud: + +![](https://farm4.staticflickr.com/3869/15071011092_f8f32ffe11_z.jpg) + +注意ownCloud可能会包一个Apache配置错误的警告。使用下面的步骤来解决这个错误来摆脱这些错误信息。 + +a) 编辑 the /etc/apache2/apache2.conf (设置 AllowOverride 为 All): + + + Options Indexes FollowSymLinks + AllowOverride All + Order allow,deny + Allow from all + + +b) 编辑 the /etc/apache2/conf.d/owncloud.conf + + + Options Indexes FollowSymLinks MultiViews + AllowOverride All + Order allow,deny + Allow from all + + +c) 重启web服务器: + + # service apache2 restart + +d) 刷新浏览器,确认安全警告已经消失 + +![](https://farm6.staticflickr.com/5562/14884771428_fc9c063418_z.jpg) + +### 设置数据库 ### + +是时候为ownCloud设置数据库了。 + +首先登录本地的MySQL/MariaDB数据库: + + $ mysql -u root -h localhost -p + +为ownCloud创建数据库和用户账户。 + + mysql> CREATE DATABASE owncloud_DB; + mysql> CREATE USER ‘owncloud-web’@'localhost' IDENTIFIED BY ‘whateverpasswordyouchoose’; + mysql> GRANT ALL PRIVILEGES ON owncloud_DB.* TO ‘owncloud-web’@'localhost'; + mysql> FLUSH PRIVILEGES; + +通过http:///owncloud 进入ownCloud页面,并选择‘Storage & database’ 选项。输入所需的信息(MySQL/MariaDB用户名,密码,数据库和主机名),并点击完成按钮。 + +![](https://farm6.staticflickr.com/5584/15071010982_b76c23c384_z.jpg) + +### 为ownCloud配置SSL连接 ### + +在你开始使用ownCloud之前,强烈建议你在ownCloud中启用SSL支持。使用SSL可以提供重要的安全好处,比如加密ownCloud流量并提供适当的验证。在本教程中,将会为SSL使用一个自签名的证书。 + +创建一个储存服务器密钥和证书的目录: + + # mkdir /etc/apache2/ssl + +创建一个证书(并有一个密钥来保护它),它有一年的有效期。 + + # openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/apache2/ssl/apache.key -out /etc/apache2/ssl/apache.crt + +![](https://farm6.staticflickr.com/5587/15068784081_f281b54b72_z.jpg) + +编辑/etc/apache2/conf.d/owncloud.conf 启用HTTPS。对于余下的NC、R和L重写规则的意义,你可以参考[Apache 文档][2]: + + Alias /owncloud /var/www/owncloud + + + RewriteEngine on + ReWriteCond %{SERVER_PORT} !^443$ + RewriteRule ^/(.*) https://%{HTTP_HOST}/$1 [NC,R,L] + + + + SSLEngine on + SSLCertificateFile /etc/apache2/ssl/apache.crt + SSLCertificateKeyFile /etc/apache2/ssl/apache.key + DocumentRoot /var/www/owncloud/ + + Options Indexes FollowSymLinks MultiViews + AllowOverride All + Order allow,deny + Allow from all + + + +启用重写模块并重启Apache: + + # a2enmod rewrite + # service apache2 restart + +打开你的ownCloud实例。注意一下,即使你尝试使用HTTP,你也会自动被重定向到HTTPS。 + +注意,即使你已经按照上述步骤做了,在你启动ownCloud你仍将看到一条错误消息,指出该证书尚未被受信的机构颁发(那是因为我们创建了一个自签名证书)。您可以放心地忽略此消息,但如果你考虑在生产服务器上部署ownCloud,你可以从一个值得信赖的公司购买证书。 + +### 创建一个账号 ### + +现在我们准备创建一个ownCloud管理员帐号了。 + +![](https://farm6.staticflickr.com/5587/15048366536_430b4fd64e.jpg) + +欢迎来自你的个人云!注意你可以安装一个桌面或者移动端app来同步你的文件、日历、通讯录或者更多了。 + +![](https://farm4.staticflickr.com/3862/15071372425_c391d912f5_z.jpg) + +在右上叫,点击你的用户名,会显示一个下拉菜单: + +![](https://farm4.staticflickr.com/3897/15071372355_3de08d2847.jpg) + +点击Personal来改变你的设置,比如密码,显示名,email地址、头像还有更多。 + +### ownCloud 使用案例:访问日历 ### + +让我开始添加一个事件到日历中并稍后下载。 + +点击左上角的下拉菜单并选择日历。 + +![](https://farm4.staticflickr.com/3891/15048366346_7dcc388244.jpg) + +添加一个时间并保存到你的日历中。 + +![](https://farm4.staticflickr.com/3882/14884818197_f55154fd91_z.jpg) + +通过 'Event and Tasks' -> 'Import...' -> 'Select file' 下载你的日历并添加到你的Thunderbird日历中: + +![](https://farm4.staticflickr.com/3840/14884818217_16a53400f0_z.jpg) + +![](https://farm4.staticflickr.com/3871/15048366356_a7f98ca63d_z.jpg) + +提示:你还需要设置你的时区以便在其他程序中成功地导入你的日历(默认情况下,日历程序将使用UTC+00:00时区)。要更改时区在左下角点击小齿轮图标,接着日历设置菜单就会出现,你就可以选择时区了: + +![](https://farm4.staticflickr.com/3858/14884669029_4e0cd3e366.jpg) + +### ownCloud 使用案例:上传一个文件 ### + +接下来,我们会从本机上传一个文件 + +进入文件菜单(左上角)并点击向上箭头来打开一个选择文件对话框。 + +![](https://farm4.staticflickr.com/3851/14884818067_4a4cc73b40.jpg) + +选择一个文件并点击打开。 + +![](https://farm6.staticflickr.com/5591/14884669039_5a9dd00ca9_z.jpg) + +接下来你就可以打开/编辑选中的文件,把它移到另外一个文件夹或者删除它了。 + +![](https://farm4.staticflickr.com/3909/14884771088_d0b8a20ae2_o.png) + +### 总结 ### + +ownCloud是一个灵活和强大的云存储,可以从其他供应商快速、简便、无痛的过渡。此外,它是开源软件,你只需要很少有时间和精力对其进行配置以满足你的所有需求。欲了解更多信息,可以随时参考[用户][3]、[管理][4]或[开发][5]手册。 + +-------------------------------------------------------------------------------- + +via: http://xmodulo.com/2014/08/install-configure-owncloud-debian.html + +作者:[Gabriel Cánepa][a] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://www.gabrielcanepa.com.ar/ +[1]:http://owncloud.org/ +[2]:http://httpd.apache.org/docs/2.2/rewrite/flags.html +[3]:http://doc.owncloud.org/server/7.0/ownCloudUserManual.pdf +[4]:http://doc.owncloud.org/server/7.0/ownCloudAdminManual.pdf +[5]:http://doc.owncloud.org/server/7.0/ownCloudDeveloperManual.pdf \ No newline at end of file diff --git a/translated/tech/20140904 Use LaTeX In Ubuntu 14.04 and Linux Mint 17 With Texmaker.md b/translated/tech/20140904 Use LaTeX In Ubuntu 14.04 and Linux Mint 17 With Texmaker.md index af974647be..56c589a83d 100644 --- a/translated/tech/20140904 Use LaTeX In Ubuntu 14.04 and Linux Mint 17 With Texmaker.md +++ b/translated/tech/20140904 Use LaTeX In Ubuntu 14.04 and Linux Mint 17 With Texmaker.md @@ -1,10 +1,10 @@ -在Ubuntu 14.04和拥有Texmaker的Linux Mint 17(基于ubuntu和debian的Linux发行版)中使用LaTeX +在 Ubuntu 14.04 和 Linux Mint 17 中通过 Texmaker 来使用LaTeX ================================================================================ ![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2014/09/texmaker_Ubuntu.jpeg) -[LaTeX][1]是一种文本标记语言,也可以说是一种文档制作系统。经常在很多大学或者机构中作为一种标准来书写专业的科学文献,毕业论文或其他类似的文档。在这篇文章中,我们会看到如何在Ubuntu 14.04中使用LaTeX。 +[LaTeX][1]是一种文本标记语言,也可以说是一种文件准备系统。在很多大学或者机构中普遍作为一种标准来书写专业的科学文献,毕业论文或其他类似的文档。在这篇文章中,我们会看到如何在Ubuntu 14.04中使用LaTeX。 -### 在Ubuntu 14.04或Linux Mint 17中安装Texmaker +### 在 Ubuntu 14.04 或 Linux Mint 17 中安装 Texmaker 来使用LaTeX [Texmaker][2]是一款免费开源的LaTeX编辑器,它支持一些主流的桌面操作系统,比如Window,Linux和OS X。下面是Texmaker的主要特点: @@ -36,7 +36,7 @@ via: http://itsfoss.com/install-latex-ubuntu-1404/ 作者:[Abhishek][a] 译者:[john](https://github.com/johnhoow) -校对:[校对者ID](https://github.com/校对者ID) +校对:[Caroline](https://github.com/carolinewuyan) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 @@ -44,4 +44,4 @@ via: http://itsfoss.com/install-latex-ubuntu-1404/ [1]:http://www.latex-project.org/ [2]:http://www.xm1math.net/texmaker/index.html [3]:http://www.xm1math.net/texmaker/download.html#linux -[4]:http://itsfoss.com/remarkable-markdown-editor-linux/ +[4]:http://itsfoss.com/remarkable-markdown-editor-linux/ diff --git a/translated/tech/20140910 How to create a cloud-based encrypted file system on Linux.md b/translated/tech/20140910 How to create a cloud-based encrypted file system on Linux.md new file mode 100644 index 0000000000..0cc76306ca --- /dev/null +++ b/translated/tech/20140910 How to create a cloud-based encrypted file system on Linux.md @@ -0,0 +1,156 @@ +如何在 Linux 系统中创建一个云端的加密文件系统 +================================================================================ +[Amazon S3][1] 和 [Google Cloud Storage][2] 之类的商业云存储服务以能承受的价格提供了高可用性、可扩展、无限容量的对象存储服务。为了加速这些云产品的广泛采用,这些提供商为他们的产品基于明确的 API 和 SDK 培养了一个良好的开发者生态系统。而基于云的文件系统便是这些活跃的开发者社区中的典型产品,已经有了好几个开源的实现。 + +[S3QL][3] 便是最流行的开源云端文件系统之一。它是一个基于 FUSE 的文件系统,提供了好几个商业或开源的云存储后端,比如 Amazon S3、Google Cloud Storage、Rackspace CloudFiles,还有 OpenStack。作为一个功能完整的文件系统,S3QL 拥有不少强大的功能:最大 2T 的文件大小、压缩、UNIX 属性、加密、基于写入时复制的快照、不可变树、重复数据删除,以及软、硬链接支持等等。写入 S3QL 文件系统任何数据都将首先被本地压缩、加密,之后才会传输到云后端。当你试图从 S3QL 文件系统中取出内容的时候,如果它们不在本地缓存中,相应的对象会从云端下载回来,然后再即时地解密、解压缩。 + +需要明确的是,S3QL 的确也有它的限制。比如,你不能把同一个 S3FS 文件系统在几个不同的电脑上同时挂载,只能有一台电脑同时访问它。另外,ACL(访问控制列表)也并没有被支持。 + +在这篇教程中,我将会描述“如何基于 Amazon S3 用 S3QL 配置一个加密文件系统”。作为一个使用范例,我还会说明如何在挂载的 S3QL 文件系统上运行 rsync 备份工具。 + +### 准备工作 ### + +本教程首先需要你创建一个 [Amazon AWS 帐号][4](注册是免费的,但是需要一张有效的信用卡)。 + +然后 [创建一个 AWS access key][4](access key ID 和 secret access key),S3QL 使用这些信息来访问你的 AWS 帐号。 + +之后通过 AWS 管理面板访问 AWS S3,并为 S3QL 创建一个新的空 bucket。 + +![](https://farm4.staticflickr.com/3841/15170673701_7d0660e11f_c.jpg) + +为最佳性能考虑,请选择一个地理上距离你最近的区域。 + +![](https://farm4.staticflickr.com/3902/15150663516_4928d757fc_b.jpg) + +### 在 Linux 上安装 S3QL ### + +在大多数 Linux 发行版中都有预先编译好的 S3QL 软件包。 + +#### 对于 Debian、Ubuntu 或 Linux Mint:#### + + $ sudo apt-get install s3ql + +#### 对于 Fedora:#### + + $ sudo yum install s3ql + +对于 Arch Linux,使用 [AUR][6]。 + +### 首次配置 S3QL ### + +在 ~/.s3ql 目录中创建 autoinfo2 文件,它是 S3QL 的一个默认的配置文件。这个文件里的信息包括必须的 AWS access key,S3 bucket 名,以及加密口令。这个加密口令将被用来加密一个随机生成的主密钥,而主密钥将被用来实际地加密 S3QL 文件系统数据。 + + $ mkdir ~/.s3ql + $ vi ~/.s3ql/authinfo2 + +---------- + + [s3] + storage-url: s3://[bucket-name] + backend-login: [your-access-key-id] + backend-password: [your-secret-access-key] + fs-passphrase: [your-encryption-passphrase] + +指定的 AWS S3 bucket 需要预先通过 AWS 管理面板来创建。 + +为了安全起见,让 authinfo2 文件仅对你可访问。 + + $ chmod 600 ~/.s3ql/authinfo2 + +### 创建 S3QL 文件系统 ### + +现在你已经准备好可以在 AWS S3 上创建一个 S3QL 文件系统了。 + +使用 mkfs.s3ql 工具来创建一个新的 S3QL 文件系统。这个命令中的 bucket 名应该与 authinfo2 文件中所指定的相符。使用“--ssl”参数将强制使用 SSL 连接到后端存储服务器。默认情况下,mkfs.s3ql 命令会在 S3QL 文件系统中启用压缩和加密。 + + $ mkfs.s3ql s3://[bucket-name] --ssl + +你会被要求输入一个加密口令。请输入你在 ~/.s3ql/autoinfo2 中通过“fs-passphrase”指定的那个口令。 + +如果一个新文件系统被成功创建,你将会看到这样的输出: + +![](https://farm6.staticflickr.com/5582/14988587230_e182ca3abd_z.jpg) + +### 挂载 S3QL 文件系统 ### + +当你创建了一个 S3QL 文件系统之后,下一步便是要挂载它。 + +首先创建一个本地的挂载点,然后使用 mount.s3ql 命令来挂载 S3QL 文件系统。 + + $ mkdir ~/mnt_s3ql + $ mount.s3ql s3://[bucket-name] ~/mnt_s3ql + +挂载一个 S3QL 文件系统不需要特权用户,只要确定你对该挂载点有写权限即可。 + +视情况,你可以使用“--compress”参数来指定一个压缩算法(如 lzma、bzip2、zlib)。在不指定的情况下,lzma 将被默认使用。注意如果你指定了一个自定义的压缩算法,它将只会应用到新创建的数据对象上,并不会影响已经存在的数据对象。 + + $ mount.s3ql --compress bzip2 s3://[bucket-name] ~/mnt_s3ql + +因为性能原因,S3QL 文件系统维护了一份本地文件缓存,里面包括了最近访问的(部分或全部的)文件。你可以通过“--cachesize”和“--max-cache-entries”选项来自定义文件缓存的大小。 + +如果想要除你以外的用户访问一个已挂载的 S3QL 文件系统,请使用“--allow-other”选项。 + +如果你想通过 NFS 导出已挂载的 S3QL 文件系统到其他机器,请使用“--nfs”选项。 + +运行 mount.s3ql 之后,检查 S3QL 文件系统是否被成功挂载了: + + $ df ~/mnt_s3ql + $ mount | grep s3ql + +![](https://farm4.staticflickr.com/3863/15174861482_27a842da3e_z.jpg) + +### 卸载 S3QL 文件系统 ### + +想要安全地卸载一个(可能含有未提交数据的)S3QL 文件系统,请使用 umount.s3ql 命令。它将会等待所有数据(包括本地文件系统缓存中的部分)成功传输到后端服务器。取决于等待写的数据的多少,这个过程可能需要一些时间。 + + $ umount.s3ql ~/mnt_s3ql + +### 查看 S3QL 文件系统统计信息及修复 S3QL 文件系统 ### + +若要查看 S3QL 文件系统统计信息,你可以使用 s3qlstat 命令,它将会显示诸如总的数据、元数据大小、重复文件删除率和压缩率等信息。 + + $ s3qlstat ~/mnt_s3ql + +![](https://farm6.staticflickr.com/5559/15184926905_4815e5827a_z.jpg) + +你可以使用 fsck.s3ql 命令来检查和修复 S3QL 文件系统。与 fsck 命令类似,待检查的文件系统必须首先被卸载。 + + $ fsck.s3ql s3://[bucket-name] + +### S3QL 使用案例:Rsync 备份 ### + +让我用一个流行的使用案例来结束这篇教程:本地文件系统备份。为此,我推荐使用 rsync 增量备份工具,特别是因为 S3QL 提供了一个 rsync 的封装脚本(/usr/lib/s3ql/pcp.py)。这个脚本允许你使用多个 rsync 进程递归地复制目录树到 S3QL 目标。 + + $ /usr/lib/s3ql/pcp.py -h + +![](https://farm4.staticflickr.com/3873/14998096829_d3a64749d0_z.jpg) + +下面这个命令将会使用 4 个并发的 rsync 连接来备份 ~/Documents 里的所有内容到一个 S3QL 文件系统。 + + $ /usr/lib/s3ql/pcp.py -a --quiet --processes=4 ~/Documents ~/mnt_s3ql + +这些文件将首先被复制到本地文件缓存中,然后在后台再逐步地同步到后端服务器。 + +若想了解与 S3QL 有关的更多信息,如自动挂载、快照、不可变树,我强烈推荐阅读 [官方用户指南][7]。欢迎告诉我你对 S3QL 怎么看,以及你对任何其他工具的使用经验。 + + + + +-------------------------------------------------------------------------------- + +via: http://xmodulo.com/2014/09/create-cloud-based-encrypted-file-system-linux.html + +作者:[Dan Nanni][a] +译者:[felixonmars](https://github.com/felixonmars) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://xmodulo.com/author/nanni +[1]:http://aws.amazon.com/s3 +[2]:http://code.google.com/apis/storage/ +[3]:https://bitbucket.org/nikratio/s3ql/ +[4]:http://aws.amazon.com/ +[5]:http://ask.xmodulo.com/create-amazon-aws-access-key.html +[6]:https://aur.archlinux.org/packages/s3ql/ +[7]:http://www.rath.org/s3ql-docs/ diff --git a/translated/tech/20140910 How to download GOG games from the command line on Linux.md b/translated/tech/20140910 How to download GOG games from the command line on Linux.md new file mode 100644 index 0000000000..8ed3e8e792 --- /dev/null +++ b/translated/tech/20140910 How to download GOG games from the command line on Linux.md @@ -0,0 +1,75 @@ +如何在Linux命令行中下载GOG游戏 +================================================================================ +如果你是一个玩家同时也是一个Linux用户,你可能很高兴在[GOG][1]在几个月前宣布它会在你最喜欢的操作系统上推出游戏。如果你之前从来没有听说过GOG,我鼓励你看看他们的产品目录中的“很棒的老游戏”,价格合理,无DRM限制,而且充满了很棒的东西。然而现在的Windows上的GOG存在了很长的时间按,正式的Linux版本却是无处可见。因此,你不想等待官方的正式版本,一个名为LGOGDownloader非官方的开放源码计划能让你在命令行中访问你的库。 + +![](https://farm4.staticflickr.com/3843/15121593356_b13309c70f_z.jpg) + +### 在Linux中安装 LGOGDownloader ### + +对于Ubuntu用户来说,[官方页面][2]建议您下载源代码并执行: + + $ sudo apt-get install build-essential libcurl4-openssl-dev liboauth-dev libjsoncpp-dev libhtmlcxx-dev libboost-system-dev libboost-filesystem-dev libboost-regex-dev libboost-program-options-dev libboost-date-time-dev libtinyxml-dev librhash-dev help2man + $ tar -xvzf lgogdownloader-2.17.tar.gz + $ cd lgogdownloader-2.17 + $ make release + $ sudo make install + +如果你是ArchLinux用户。有一个[AUR 包][2]等着你 + +### LGOGDownloader 的使用### + +一旦安装了该程序,你需要用下面的命令登录: + + $ lgogdownloader --login + +![](https://farm6.staticflickr.com/5593/15121593346_9c5d02d5ce_z.jpg) + +如果你需要配置文件,那它在这里:~/.config/lgogdownloader/config.cfg + +验证通过后,你可以列出你库中所有的游戏: + + $ lgogdownloader --list + +![](https://farm6.staticflickr.com/5581/14958040387_8321bb71cf.jpg) + +用下面的命令下载游戏: + + $ lgogdownloader --download --game [game name] + +![](https://farm6.staticflickr.com/5585/14958040367_b1c584a2d1_z.jpg) + +你可以注意到lgogdownloader允许你恢复之前中断的下载,这当下载的游戏并不小时是很有用的。 + +像每一个可敬的命令行实用程序,您可以添加各种选项: + +- **--platform [number]** 选择您的操作系统,1是 Windows, 4是Linux。 +- **--directory [destination]** 下载安装包到指定的目录。 +- **--language [number]** 下载特定的语言包 (根据你的语言查阅手册上对应的数字)。 +- **--limit-rate [speed]** 限制下载速度。 + +一个额外的福利,lgogdownloader同样可以检查GOG网站上的更新: + + $ lgogdownloader --update-check + +![](https://farm4.staticflickr.com/3882/14958035568_7889acaef0.jpg) + +结果将列出论坛上收到的私人邮件的数量以及更新的游戏数量。 + +最后,lgogdownloader是非常标准的命令行实用工具。我甚至可以说,它是清晰和连贯性的一个缩影。我们距离Steam Linux客户端的确还差的很远,但在另一方面,官方GOG Windows客户端不会做的比这个非官方的Linux版本更多。换句话说lgogdownloader是一个完美的替代品。我等不及要看到GOG上更多的Linux兼容游戏,尤其是在他们最近公告称会提供的无DRM电影,会有视频游戏的专题。希望在电影目录中有游戏库时能在客户端看到更新。 + +你觉得GOG怎么样?你会使用非官方的Linux客户端么?让我们在评论中知道你的想法。 + +-------------------------------------------------------------------------------- + +via: http://xmodulo.com/2014/09/download-gog-games-command-line-linux.html + +作者:[Adrien Brochard][a] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://xmodulo.com/author/adrien +[1]:http://www.gog.com/ +[2]:https://sites.google.com/site/gogdownloader/home +[3]:https://aur.archlinux.org/packages/lgogdownloader/ \ No newline at end of file diff --git a/translated/tech/20140910 How to monitor server memory usage with Nagios Remote Plugin Executor (NRPE).md b/translated/tech/20140910 How to monitor server memory usage with Nagios Remote Plugin Executor (NRPE).md new file mode 100644 index 0000000000..d0ace6a56b --- /dev/null +++ b/translated/tech/20140910 How to monitor server memory usage with Nagios Remote Plugin Executor (NRPE).md @@ -0,0 +1,155 @@ +如何用Nagios远程执行插件(NRPE)来检测服务器内存使用率 +================================================================================ +在[先前的教程中][1]注:此篇文章在同一个更新中,如果也翻译了,发布的时候可修改相应的链接,我们已经见到了如何在Nagios设置中设置Nagios远程执行插件(NRPE)。然而,监控内存使用率的脚本和插件并没有在原生的Nagios中。本篇中,我们会看到如何配置NRPE来监控远程服务器上的内存使用率。 + +我们要用的监控内存的脚本在[Nagios 市场][2]上,也在创建者的[Github仓库][3]中。 + +假设我们已经安装了NRPE,我们首先在我们想要监控的服务器上下载脚本。 + +### 准备远程服务器 ### + +#### 在 Debain/Ubuntu 中: #### + + # cd /usr/lib/nagios/plugins/ + # wget https://raw.githubusercontent.com/justintime/nagios-plugins/master/check_mem/check_mem.pl + # mv check_mem.pl check_mem + # chmod +x check_mem + +#### 在 RHEL/CentOS 中: #### + + # cd /usr/lib64/nagios/plugins/ (or /usr/lib/nagios/plugins/ for 32-bit) + # wget https://raw.githubusercontent.com/justintime/nagios-plugins/master/check_mem/check_mem.pl + # mv check_mem.pl check_mem + # chmod +x check_mem + +你可以通过手工在本地运行下面的命令来检查脚本的输出是否正常。当使用NRPE时,这条命令应该会检测空闲的内存,当可用内存小于20%时会发出警告,并且在可用内存小于10%时会生成一个严重警告。 + + # ./check_mem -f -w 20 -c 10 + +---------- + + OK - 34.0% (2735744 kB) free.|TOTAL=8035340KB;;;; USED=5299596KB;6428272;7231806;; FREE=2735744KB;;;; CACHES=2703504KB;;;; + +如果你看到像上面那样的输出,那就意味这命令正常工作着。 + +现在脚本已经准备好了,我们要定义NRPE检查内存使用率的命令了。如上所述,命令会检查可用内存,在可用率小于20%时发出警报,小于10%时发出严重警告。 + + # vim /etc/nagios/nrpe.cfg + +#### 对于 Debian/Ubuntu: #### + + command[check_mem]=/usr/lib/nagios/plugins/check_mem -f -w 20 -c 10 + +#### 对于 RHEL/CentOS 32 bit: #### + + command[check_mem]=/usr/lib/nagios/plugins/check_mem -f -w 20 -c 10 + +#### 对于 RHEL/CentOS 64 bit: #### + + command[check_mem]=/usr/lib64/nagios/plugins/check_mem -f -w 20 -c 10 + +### 准备 Nagios 服务器 ### + +在Nagios服务器中,我们为NRPE定义了一条自定义命令。该命令可存储在Nagios内的任何目录中。为了让本教程简单,我们会将命令定义放在/etc/nagios目录中。 + +#### 对于 Debian/Ubuntu: #### + + # vim /etc/nagios3/conf.d/nrpe_command.cfg + +---------- + + define command{ + command_name check_nrpe + command_line /usr/lib/nagios/plugins/check_nrpe -H '$HOSTADDRESS$' -c '$ARG1$' + } + +#### 对于 RHEL/CentOS 32 bit: #### + + # vim /etc/nagios/objects/nrpe_command.cfg + +---------- + + define command{ + command_name check_nrpe + command_line /usr/lib/nagios/plugins/check_nrpe -H $HOSTADDRESS$ -c $ARG1$ + } + +#### 对于 RHEL/CentOS 64 bit: #### + + # vim /etc/nagios/objects/nrpe_command.cfg + +---------- + + define command{ + command_name check_nrpe + command_line /usr/lib64/nagios/plugins/check_nrpe -H $HOSTADDRESS$ -c $ARG1$ + } + +现在我们定义Nagios的服务检查 + +#### 在 Debian/Ubuntu 上: #### + + # vim /etc/nagios3/conf.d/nrpe_service_check.cfg + +---------- + + define service{ + use local-service + host_name remote-server + service_description Check RAM + check_command check_nrpe!check_mem + } + +#### 在 RHEL/CentOS 上: #### + + # vim /etc/nagios/objects/nrpe_service_check.cfg + +---------- + + define service{ + use local-service + host_name remote-server + service_description Check RAM + check_command check_nrpe!check_mem + } + +最后我们重启Nagios服务 + +#### 在 Debian/Ubuntu 上: #### + + # service nagios3 restart + +#### 在 RHEL/CentOS 6 上: #### + + # service nagios restart + +#### 在 RHEL/CentOS 7 上: #### + + # systemctl restart nagios.service + +### 故障排除 ### + +Nagios应该开始在使用NRPE的远程服务器上检查内存使用率了。如果你有任何问题,你可以检查下面这些情况。 + + +- 确保NRPE的端口在远程主机上是总是允许的。默认NRPE的端口是TCP 5666。 +- 你可以尝试通过执行check_nrpe 命令: /usr/lib/nagios/plugins/check_nrpe -H remote-server 手工检查NRPE操作。 +- 你同样可以尝试运行check_mem 命令:/usr/lib/nagios/plugins/check_nrpe -H remote-server –c check_mem +- 在远程服务器上,在/etc/nagios/nrpe.cfg中设置debug=1。重启NRPE服务并检查这些日志文件,/var/log/messages (RHEL/CentOS)或者/var/log/syslog (Debain/Ubuntu)。如果有任何的配置或者权限错误,日志中应该包含了相关的信息。如果日志中没有反映出什么,很有可能是由于请求在某些端口上有过滤而没有到达远程服务器上。 + +总结一下,这边教程描述了我们该如何调试NRPE来监控远程服务器的内存使用率。过程只需要下载脚本、定义命令和重启服务就行了。希望这对你们有帮助。 + +-------------------------------------------------------------------------------- + +via: http://xmodulo.com/2014/09/monitor-server-memory-usage-nagios-remote-plugin-executor.html + +作者:[Sarmed Rahman][a] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://xmodulo.com/author/sarmed +[1]:http://xmodulo.com/2014/03/nagios-remote-plugin-executor-nrpe-linux.html +[2]:http://exchange.nagios.org/directory/Plugins/Operating-Systems/Solaris/check_mem-2Epl/details +[3]:https://github.com/justintime/nagios-plugins/blob/master/check_mem/check_mem.pl \ No newline at end of file diff --git a/translated/tech/20140926 How to manage configurations in Linux with Puppet and Augeas.md b/translated/tech/20140926 How to manage configurations in Linux with Puppet and Augeas.md new file mode 100644 index 0000000000..17e7e21f5d --- /dev/null +++ b/translated/tech/20140926 How to manage configurations in Linux with Puppet and Augeas.md @@ -0,0 +1,152 @@ +如何用Puppet和Augeas管理Linux配置 +================================================================================ +虽然[Puppet][1](注:此文原文原文中曾今做过,文件名:“20140808 How to install Puppet server and client on CentOS and RHEL.md”,如果翻译发布过,可修改此链接为发布地址)是一个非常独特的和有用的工具,在有些情况下你可以使用一点不同的方法。要修改的配置文件已经在几个不同的服务器上且它们在这时是互补相同的。Puppet实验室的人也意识到了这一点并集成了一个伟大的工具,称之为[Augeas][2],它是专为这种使用情况而设计的。 + + +Augeas可被认为填补了Puppet能力的缺陷,其中一个特定对象的资源类型(如主机资源来处理/etc/hosts中的条目)还不可用。在这个文档中,您将学习如何使用Augeas来减轻你管理配置文件的负担。 + +### Augeas是什么? ### + +Augeas基本上就是一个配置编辑工具。它以他们原生的格式解析配置文件并且将它们转换成树。配置的更改可以通过操作树来完成,并可以以原生配置文件格式保存配置。 + +### 这篇教程要达成什么目的? ### + +我们会安装并配置Augeas用于我们之前构建的Puppet服务器。我们会使用这个工具创建并测试几个不同的配置文件,并学习如何适当地使用它来管理我们的系统配置。 + +### 先决条件 ### + +我们需要一台工作的Puppet服务器和客户端。如果你还没有,请先按照我先前的教程来。 + +Augeas安装包可以在标准CentOS/RHEL仓库中找到。不幸的是,Puppet用到的ruby封装的Augeas只在puppetlabs仓库中(或者[EPEL][4])中才有。如果你系统中还没有这个仓库,请使用下面的命令: + +在CentOS/RHEL 6.5上: + + # rpm -­ivh https://yum.puppetlabs.com/el/6.5/products/x86_64/puppetlabs­release­6­10.noarch.rpm + +在CentOS/RHEL 7上: + + # rpm -­ivh https://yum.puppetlabs.com/el/7/products/x86_64/puppetlabs­release­7­10.noarch.rpm + +在你成功地安装了这个仓库后,在你的系统中安装Ruby­Augeas: + + # yum install ruby­augeas + +或者如果你是从我的上一篇教程中继续的,使用puppet的方法安装这个包。在/etc/puppet/manifests/site.pp中修改你的custom_utils类,在packages这行中加入“ruby­augeas”。 + + class custom_utils { + package { ["nmap","telnet","vim­enhanced","traceroute","ruby­augeas"]: + ensure => latest, + allow_virtual => false, + } + } + +### 不带Puppet的Augeas ### + +如我先前所说,最初Augeas并不是来自Puppet实验室,这意味着即使没有Puppet本身我们仍然可以使用它。这种方法可在你将它们部署到Puppet环境之前,验证你的修改和想法是否是正确的。要做到这一点,你需要在你的系统中安装一个额外的软件包。请执行以下命令: + + # yum install augeas + +### Puppet Augeas 示例 ### + +用于演示,这里有几个Augeas使用案例。 + +#### 管理 /etc/sudoers 文件 #### + +1. 给wheel组加上sudo权限。 + +这个例子会向你战士如何在你的GNU/Linux系统中为%wheel组加上sudo权限。 + + # 安装sudo包 + package { 'sudo': + ensure => installed, # 确保sudo包已安装 + } + + # 允许用户属于wheel组来使用sudo + augeas { 'sudo_wheel': + context => '/files/etc/sudoers', # 目标文件是 /etc/sudoers + changes => [ + # 允许wheel用户使用sudo + 'set spec[user = "%wheel"]/user %wheel', + 'set spec[user = "%wheel"]/host_group/host ALL', + 'set spec[user = "%wheel"]/host_group/command ALL', + 'set spec[user = "%wheel"]/host_group/command/runas_user ALL', + ] + } + +现在来解释这些代码做了什么:**spec**定义了/etc/sudoers中的用户段,**[user]**定义了数组中给定的用户,所有的定义的斜杠( / ) 后用户的子部分。因此在典型的配置中这个可以这么表达: + + user host_group/host host_group/command host_group/command/runas_user + +这个将被转换成/etc/sudoers下的这一行: + + %wheel ALL = (ALL) ALL + +2. 添加命令别称 + +下面这部分会向你展示如何定义命令别名,他可以在你的sudoer文件中使用。 + + # 创建新的SERVICE别名,包含了一些基本的特权命令。 + augeas { 'sudo_cmdalias': + context => '/files/etc/sudoers', # The target file is /etc/sudoers + changes => [ + "set Cmnd_Alias[alias/name = 'SERVICES']/alias/name SERVICES", + "set Cmnd_Alias[alias/name = 'SERVICES']/alias/command[1] /sbin/service", + "set Cmnd_Alias[alias/name = 'SERVICES']/alias/command[2] /sbin/chkconfig", + "set Cmnd_Alias[alias/name = 'SERVICES']/alias/command[3] /bin/hostname", + "set Cmnd_Alias[alias/name = 'SERVICES']/alias/command[4] /sbin/shutdown", + ] + } + +sudo命令别名的语法很简单:**Cmnd_Alias**定义了命令别名字段,**[alias/name]**绑定所有给定的别名,/alias/name **SERVICES** 定义真实的别名以及alias/command 是所有命令的数组,每条命令是这个别名的一部分。 + + Cmnd_Alias SERVICES = /sbin/service , /sbin/chkconfig , /bin/hostname , /sbin/shutdown + +关于/etc/sudoers的更多信息,请访问[官方文档][5]。 + +#### 向一个组中加入用户 #### + +要使用Augeas向组中添加用户,你有也许要添加一个新用户,无论是在gid字段后或者在最后一个用户后。我们在这个例子中使用组SVN。这可以通过下面的命令达成: + +在Puppet中: + + augeas { 'augeas_mod_group: + context => '/files/etc/group', # The target file is /etc/group + changes => [ + "ins user after svn/*[self::gid or self::user][last()]", + "set svn/user[last()] john", + ] + } + +使用 augtool: + + augtool> ins user after /files/etc/group/svn/*[self::gid or self::user][last()] augtool> set /files/etc/group/svn/user[last()] john + +### 总结 ### + +目前为止,你应该对如何在Puppet项目中使用Augeas有一个好想法了。随意地试一下,你肯定会经历官方的Augeas文档。这会帮助你了解如何在你的个人项目中正确地使用Augeas,并且它会想你展示你可以用它节省多少时间。 + +如有任何问题,欢迎在下面的评论中发布,我会尽力解答和向你建议。 + +### 有用的链接 ### + +- [http://www.watzmann.net/categories/augeas.html][6]: contains a lot of tutorials focused on Augeas usage. +- [http://projects.puppetlabs.com/projects/1/wiki/puppet_augeas][7]: Puppet wiki with a lot of practical examples. + +-------------------------------------------------------------------------------- + +via: http://xmodulo.com/2014/09/manage-configurations-linux-puppet-augeas.html + +作者:[Jaroslav Štěpánek][a] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://xmodulo.com/author/jaroslav +[1]:http://xmodulo.com/2014/08/install-puppet-server-client-centos-rhel.html +[2]:http://augeas.net/ +[3]:http://xmodulo.com/manage-configurations-linux-puppet-augeas.html +[4]:http://xmodulo.com/2013/03/how-to-set-up-epel-repository-on-centos.html +[5]:http://augeas.net/docs/references/lenses/files/sudoers-aug.html +[6]:http://www.watzmann.net/categories/augeas.html +[7]:http://projects.puppetlabs.com/projects/1/wiki/puppet_augeas \ No newline at end of file diff --git a/translated/tech/20140928 How to Use Systemd Timers.md b/translated/tech/20140928 How to Use Systemd Timers.md new file mode 100644 index 0000000000..bcbe1a1bec --- /dev/null +++ b/translated/tech/20140928 How to Use Systemd Timers.md @@ -0,0 +1,111 @@ +如何使用系统定时器 +================================================================================ +我最近在写一些运行备份的脚本,我决定使用[systemd timers][1]而不是对我而已更熟悉的[cron jobs][2]来管理它们。 + +在我使用时,出现了很多问题需要我去各个地方找资料,这个过程非常麻烦。因此,我想要把我目前所做的记录下来,方便自己的记忆,也方便读者不必像我这样,满世界的找资料了。 + +在我下面提到的步骤中有其他的选择,但是这边是最简单的方法。在此之前,查看**systemd.service**, **systemd.timer**,和**systemd.target**的帮助页面(man),学习你能用它们做些什么。 + +### 运行一个简单的脚本 ### + +假设你有一个脚本叫:**/usr/local/bin/myscript** ,你想要每隔一小时就运行一次。 + +#### Service 文件 #### + +第一步,创建一个service文件,根据你Linux的发行版本放到相应的系统目录(在Arch中,这个目录是**/etc/systemd/system/** 或 **/usr/lib/systemd/system**) + +myscript.service + + [Unit] + Description=MyScript + + [Service] + Type=simple + ExecStart=/usr/local/bin/myscript + +注意,务必将**Type**变量的值设置为"simple"而不是"oneshot"。使用"oneshot"使得脚本只在第一次运行,之后系统会认为你不想再次运行它,从而关掉我们接下去创建的定时器(Timer)。 + +#### Timer 文件 #### + +第二步,创建一个timer文件,把它放在第一步中service文件放置的目录。 + +myscript.timer + + [Unit] + Description=Runs myscript every hour + + [Timer] + # Time to wait after booting before we run first time + OnBootSec=10min + # Time between running each consecutive time + OnUnitActiveSec=1h + Unit=myscript.service + + [Install] + WantedBy=multi-user.target + +#### 授权 / 运行 #### + +授权并运行的是timer文件,而不是service文件。 + + # Start timer, as root + systemctl start myscript.timer + # Enable timer to start at boot + systemctl enable myscript.timer + +### 在同一个Timer上运行多个脚本 ### + +现在我们假设你在相同时间想要运行多个脚本。这种情况,你需要在上面的文件中做适当的修改。 + +#### Service 文件 #### + +像我[之前说过的][3]那样创建你的service文件来运行你的脚本,但是在每个service 文件最后都要包含下面的内容: + + [Install] + WantedBy=mytimer.target + +如果在你的service 文件中有一些规则,确保你使用**Description**字段中的值具体化**After=something.service**和**Before=whatever.service**中的参数。 + +另外的一种选择是(或许更加简单),创建一个包装者脚本来使用正确的规则运行合理的命令,并在你的service文件中使用这个脚本。 + +#### Timer 文件 #### + +你只需要一个timer文件,创建**mytimer.timer**,像我在[上面指出的](4)。 + +#### target 文件 #### + +你可以创建一个以上所有的脚本依赖的target文件。 + +mytimer.target + + [Unit] + Description=Mytimer + # Lots more stuff could go here, but it's situational. + # Look at systemd.unit man page. + +#### 授权 / 启动 #### + +你需要将所有的service文件和timer文件授权。 + + systemctl enable script1.service + systemctl enable script2.service + ... + systemctl enable mytimer.timer + systemctl start mytimer.service + +Good luck. + +-------------------------------------------------------------------------------- + +via: http://jason.the-graham.com/2013/03/06/how-to-use-systemd-timers/#enable--start-1 + +作者:Jason Graham +译者:[译者ID](https://github.com/johnhoow) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[1]:https://fedoraproject.org/wiki/User:Johannbg/QA/Systemd/Systemd.timer +[2]:https://en.wikipedia.org/wiki/Cron +[3]:http://jason.the-graham.com/2013/03/06/how-to-use-systemd-timers/#service-file +[4]:http://jason.the-graham.com/2013/03/06/how-to-use-systemd-timers/#timer-file-1 diff --git a/translated/tech/20140928 How to turn your CentOS box into an OSPF router using Quagga.md b/translated/tech/20140928 How to turn your CentOS box into an OSPF router using Quagga.md new file mode 100644 index 0000000000..bfa2898e8c --- /dev/null +++ b/translated/tech/20140928 How to turn your CentOS box into an OSPF router using Quagga.md @@ -0,0 +1,224 @@ +如何使用Quagga将CentOS放入OSPF路由器中 +================================================================================ +[Quagga][1]是一个可以将Linux放入支持如RIP、OSPF、BGP和IS-IS等主要路由协议的路由器的一个开源路由软件套件。它具有对IPv4和IPv6的完整规定,并支持路由/前缀过滤。Quagga可以是你生命中的救星,以防你的生产路由器一旦宕机,而你没有备用的设备而只能等待更换。通过适当的配置,Quagga甚至可以作为生产路由器。 + +本教程中,我们将连接两个假设之间具有专线连接的分支机构网络(例如,192.168.1.0/24和172.17.1.0/24)。 + +![](https://farm4.staticflickr.com/3861/15172727969_13cb7f037f_b.jpg) + +我们的CentOS位于所述专用链路的两端。两台主机名分别设置为“site-A-RTR”和“site-B-RTR'。下面是IP地址的详细信息。 + +- **Site-A**: 192.168.1.0/24 +- **Site-B**: 172.16.1.0/24 +- **Peering between 2 Linux boxes**: 10.10.10.0/30 + +Quagga包括了几个协同工作的守护进程。在本教程中,我们将重点建立以下守护进程。 + +1. **Zebra**: 核心守护进程,负责内核接口和静态路由。 +1. **Ospfd**: IPv4 OSPF 守护进程. + +### 在CentOS上安装Quagga ### + +我们使用yum安装Quagga。 + + # yum install quagga + +在CentOS7,SELinux默认会阻止quagga将配置文件写到/usr/sbin/zebra。这个SELinux策略会干涉我们接下来要介绍的安装过程,所以我们要禁用此策略。对于这一点,无论是[关闭SELinux][2](这里不推荐),还是如下启用“zebra_write_config'。如果你使用的是CentOS 6的请跳过此步骤。 + + # setsebool -P zebra_write_config 1 + +如果没有这个改变,在我们尝试在Quagga命令行中保存配置的时候看到如下错误。 + + Can't open configuration file /etc/quagga/zebra.conf.OS1Uu5. + +安装完Quagga后,我们要配置必要的对等IP地址,并更新OSPF设置。Quagga自带了一个命令行称为vtysh。vtysh里面用到的Quagga命令与主要的路由器厂商如思科和Juniper是相似的。 + +### 步骤 1: 配置 Zebra ### + +我们首先创建Zebra配置文件,并启用Zebra守护进程。 + + # cp /usr/share/doc/quagga-XXXXX/zebra.conf.sample /etc/quagga/zebra.conf + # service zebra start + # chkconfig zebra on + +启动vtysh命令行: + + # vtysh + +首先,我们为Zebra被指日志文件。输入下面的命令进入vtysh的全局配置模式: + + site-A-RTR# configure terminal + +指定日志文件位置,接着退出模式: + + site-A-RTR(config)# log file /var/log/quagga/quagga.log + site-A-RTR(config)# exit + +永久保存配置: + + site-A-RTR# write + +接下来,我们要确定可用的接口并按需配置它们的IP地址。 + + site-A-RTR# show interface + +---------- + + Interface eth0 is up, line protocol detection is disabled + . . . . . + Interface eth1 is up, line protocol detection is disabled + . . . . . + +配置eth0参数: + + site-A-RTR# configure terminal + site-A-RTR(config)# interface eth0 + site-A-RTR(config-if)# ip address 10.10.10.1/30 + site-A-RTR(config-if)# description to-site-B + site-A-RTR(config-if)# no shutdown + +继续配置eth1参数: + + site-A-RTR(config)# interface eth1 + site-A-RTR(config-if)# ip address 192.168.1.1/24 + site-A-RTR(config-if)# description to-site-A-LAN + site-A-RTR(config-if)# no shutdown + +现在验证配置: + + site-A-RTR(config-if)# do show interface + +---------- + + Interface eth0 is up, line protocol detection is disabled + . . . . . + inet 10.10.10.1/30 broadcast 10.10.10.3 + . . . . . + Interface eth1 is up, line protocol detection is disabled + . . . . . + inet 192.168.1.1/24 broadcast 192.168.1.255 + . . . . . + +---------- + + site-A-RTR(config-if)# do show interface description + +---------- + + Interface Status Protocol Description + eth0 up unknown to-site-B + eth1 up unknown to-site-A-LAN + +永久保存配置: + + site-A-RTR(config-if)# do write + +在site-B上重复上面配置IP地址的步骤。 + +如果一切顺利,你应该可以在site-A的服务器上ping通site-B上的对等IP地址10.10.10.2了。 + +注意一旦Zebra的守护进程启动了,在vtysh命令行中的任何改变都会立即生效。因此没有必要在更改配置后重启Zebra守护进程。 + +### 步骤 2: 配置OSPF ### + +我们首先创建OSPF配置文件,并启动OSPF守护进程: + + # cp /usr/share/doc/quagga-XXXXX/ospfd.conf.sample /etc/quagga/ospfd.conf + # service ospfd start + # chkconfig ospfd on + +现在启动vtysh命令行来继续OSPF配置: + + # vtysh + +输入路由配置模式: + + site-A-RTR# configure terminal + site-A-RTR(config)# router ospf + +可选配置路由id: + + site-A-RTR(config-router)# router-id 10.10.10.1 + +添加在OSPF中的网络: + + site-A-RTR(config-router)# network 10.10.10.0/30 area 0 + site-A-RTR(config-router)# network 192.168.1.0/24 area 0 + +永久保存配置: + + site-A-RTR(config-router)# do write + +在site-B上重复和上面相似的OSPF配置: + + site-B-RTR(config-router)# network 10.10.10.0/30 area 0 + site-B-RTR(config-router)# network 172.16.1.0/24 area 0 + site-B-RTR(config-router)# do write + +OSPF的邻居现在应该启动了。只要ospfd在运行,通过vtysh的任何OSPF相关配置的改变都会立即生效而不必重启ospfd。 + +下一章节,我们会验证我们的Quagga设置。 + +### 验证 ### + +#### 1. 通过ping测试 #### + +首先你应该可以从site-A ping同site-B的LAN子网。确保你的防火墙没有阻止ping的流量。 + + [root@site-A-RTR ~]# ping 172.16.1.1 -c 2 + +#### 2. 检查路由表 #### + +必要的路由应该同时出现在内核与Quagga理由表中。 + + [root@site-A-RTR ~]# ip route + +---------- + + 10.10.10.0/30 dev eth0 proto kernel scope link src 10.10.10.1 + 172.16.1.0/30 via 10.10.10.2 dev eth0 proto zebra metric 20 + 192.168.1.0/24 dev eth1 proto kernel scope link src 192.168.1.1 + +---------- + + [root@site-A-RTR ~]# vtysh + site-A-RTR# show ip route + +---------- + + Codes: K - kernel route, C - connected, S - static, R - RIP, O - OSPF, + I - ISIS, B - BGP, > - selected route, * - FIB route + + O 10.10.10.0/30 [110/10] is directly connected, eth0, 00:14:29 + C>* 10.10.10.0/30 is directly connected, eth0 + C>* 127.0.0.0/8 is directly connected, lo + O>* 172.16.1.0/30 [110/20] via 10.10.10.2, eth0, 00:14:14 + C>* 192.168.1.0/24 is directly connected, eth1 + +#### 3. 验证OSPF邻居和路由 #### + +在vtysh命令行中,你可以检查必要的邻居是否在线与是否已经学习了合适的路由。 + + [root@site-A-RTR ~]# vtysh + site-A-RTR# show ip ospf neighbor + +![](https://farm3.staticflickr.com/2943/15160942468_d348241bd5_z.jpg) + +本教程中,我们将重点放在使用Quagga配置基本的OSPF。在一般情况下,Quagga能让我们能够轻松在一台普通的Linux机器上配置动态路由协议,如OSPF、RIP或BGP。启用了Quagga的机器可以与你网络中的其他路由器进行通信和交换路由信息。由于它支持主要的开放标准的路由协议,它或许是许多情况下的首选。更重要的是,Quagga的命令行界面与主要路由器厂商如思科和Juniper几乎是相同的,这使得部署和维护Quagga机器变得非常容易。 + + +希望这些对你们有帮助。 + +-------------------------------------------------------------------------------- + +via: http://xmodulo.com/turn-centos-box-into-ospf-router-quagga.html + +作者:[Sarmed Rahman][a] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://xmodulo.com/author/sarmed +[1]:http://www.nongnu.org/quagga/ +[2]:http://xmodulo.com/how-to-disable-selinux.html \ No newline at end of file diff --git a/translated/tech/20140928 How to use xargs command in Linux.md b/translated/tech/20140928 How to use xargs command in Linux.md new file mode 100644 index 0000000000..5f5e5e120d --- /dev/null +++ b/translated/tech/20140928 How to use xargs command in Linux.md @@ -0,0 +1,116 @@ +如何在Linux里使用xargs命令 +================================================================================ +你是否遇到过这样的情况,需要一遍又一遍地对多个文件执行同样的操作?如果有过,那你肯定会深有感触这是多么的无聊和效率低下。还好有种简单的方式,可以在类Unix操作系统中使用xargs命令解决这个烦恼。通过这个命令你可以有效地处理多个文件,节省你的时间和精力。在这篇教程中,你可以学到如何一次性对多个文件执行命令或脚本操作,再也不用担心像单独处理无数个日志或数据文件那样吓人的任务了。 + +xargs命令有两个要点。第一,你必须列出目标文件。第二,你必须指定对每个文件需要执行的命令或脚本。 + +这篇教程会涉及三个应用场景,xargs命令被用来处理分布在不同目录下的文件: + +1. 计算所有文件的行数 +1. 打印指定文件的第一行 +1. 对每个文件执行一个自定义脚本 + +请看下面这个叫xargstest的目录(用tree命令以及-i和-f选项显示了目录树结构,这样可以避免缩进显示而且每个文件都会带有完整路径): + + $ tree -if xargstest/ + +![](https://farm3.staticflickr.com/2942/15334985981_ce1a192def.jpg) + +这六个文件的内容分别如下: + +![](https://farm4.staticflickr.com/3882/15346287662_a3084a8e4f_o.png) + +这个**xargstest**目录,以及它包含的子目录和文件将用在下面的例子中。 + +### 场景1:计算所有文件的行数 ### + +就像之前提到的,使用xargs命令的第一个要点是一个用来运行命令或脚本的文件列表。我们可以用find命令来确定和列出目标文件。选项**-name 'file??'**指定了xargstest目录下那些名字以"file"开头并跟随两个任意字符的文件才是匹配的。这个搜索默认是递归的,意思是find命令会在xargstest和它的子目录下搜索匹配的文件。 + + $ find xargstest/ -name 'file??' + +---------- + + xargstest/dir3/file3B + xargstest/dir3/file3A + xargstest/dir1/file1A + xargstest/dir1/file1B + xargstest/dir2/file2B + xargstest/dir2/file2A + +我们可以通过管道把结果发给sort命令让文件名按顺序排列: + + $ find xargstest/ -name 'file??' | sort + +---------- + + xargstest/dir1/file1A + xargstest/dir1/file1B + xargstest/dir2/file2A + xargstest/dir2/file2B + xargstest/dir3/file3A + xargstest/dir3/file3B + +然后我们需要第二个部分,就是需要执行的命令。我们使用带有-l选项的wc命令来计算每个文件包含的换行符数目(会在输出的每一行的前面打印出来): + + $ find xargstest/ -name 'file??' | sort | xargs wc -l + +---------- + + 1 xargstest/dir1/file1A + 2 xargstest/dir1/file1B + 3 xargstest/dir2/file2A + 4 xargstest/dir2/file2B + 5 xargstest/dir3/file3A + 6 xargstest/dir3/file3B + 21 total + +可以看到,不用对每个文件手动执行一次wc -l命令,而xargs命令可以让你在一步里完成所有操作。那些之前看起来无法完成的任务,例如单独处理数百个文件,现在可以轻松进行了。 + +### 场景2:打印指定文件的第一行 ### + +既然对xargs命令的使用已经有一点基础了,你可以自由选择执行什么命令。有时,你也许希望只对一部分文件执行操作而忽略其他的。在这种情况下,你可以使用find命令的-name选项以及?通配符(匹配任意单个字符)来选中特定文件并通过管道输出给xargs命令。举个例子,如果你想打印以“B”字符结尾的文件而忽略以“A”结尾的文件的第一行,可以使用下面的find、xargs和head命令组合来完成(head -n1会打印一个文件的第一行): + + $ find xargstest/ -name 'file?B' | sort | xargs head -n1 + +---------- + + ==> xargstest/dir1/file1B <== + one + + ==> xargstest/dir2/file2B <== + one + + ==> xargstest/dir3/file3B <== + one + +你将看到只有以“B”结尾的文件会被处理,而所有以“A”结尾的文件都被忽略了。 + +### 场景3:对每个文件执行一个自定义脚本 ### + +最后,你也许希望对一些文件执行一个自定义脚本(例如Bash、Python或是Perl)。要做到这个,只要简单地把你的自定义脚本名字替换掉之前例子中的wc和head命令就好了: + + $ find xargstest/ -name 'file??' | xargs myscript.sh + +自定义脚本**myscript.sh**需要写成接受一个文件名作为参数并处理这个文件。上面的命令将为find命令找到的每个文件分别调用脚本。 + +注意一下上面的例子中的文件名并没有包含空格。通常来说,在Linux环境下操作没有空格的文件名会舒服很多。如果你实在是需要处理名字中带有空格的文件,上边的命令就不能用了,需要稍微处理一下来让它可以被接受。这可以通过find命令的-print0选项(它会打印完整的文件名到标准输出,并以空字符结尾),以及xargs命令的-0选项(它会以空字符作为字符串结束标记)来实现,就像下面的例子: + + $ find xargstest/ -name 'file*' -print0 | xargs -0 myscript.sh + +注意一下,-name选项所跟的参数已经改为'file\*',意思是所有以"file"开头而结尾可以是任意字符的文件都会被选中。 + +### 总结 ### + +在看完这篇教程后你应该会理解xargs命令的作用,以及如何应用到自己的工作中。很快你就可以有时间享受这个命令所带来的高效率,而不哟给你花时间在一些重复的任务上了。想了解更详细的信息以及更多的选项,你可以在终端中输入'man xargs'命令来查看xargs的文档。 + +-------------------------------------------------------------------------------- + +via: http://xmodulo.com/xargs-command-linux.html + +作者:[Joshua Reed][a] +译者:[zpl1025](https://github.com/zpl1025) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://xmodulo.com/author/joshua diff --git a/translated/tech/20140929 Git Rebase Tutorial--Going Back in Time with Git Rebase.md b/translated/tech/20140929 Git Rebase Tutorial--Going Back in Time with Git Rebase.md new file mode 100644 index 0000000000..ad1938d8ca --- /dev/null +++ b/translated/tech/20140929 Git Rebase Tutorial--Going Back in Time with Git Rebase.md @@ -0,0 +1,109 @@ +Git Rebase教程: 用Git Rebase让时光倒流 +================================================================================ +![](https://www.gravatar.com/avatar/7c148ace0d63306091cc79ed9d9e77b4?d=mm&s=200) + +Christoph Burgdorf自10岁时就是一名程序员,他是HannoverJS Meetup网站的创始人,并且一直活跃在AngularJS社区。他也是非常了解gti的内内外外,在那里他举办一个[thoughtram][1]的工作室来帮助初学者掌握该技术。 + +下面的教程最初发表在他的[blog][2]。 + +---------- + +### 教程: Git Rebase ### + +想象一下你正在开发一个激进的新功能。这将是很灿烂的但它需要一段时间。您这几天也许是几个星期一直在做这个。 + +你的功能分支已经超前master有6个提交了。你是一个优秀的开发人员并做了有意义的语义提交。但有一件事情:你开始慢慢意识到,这个野兽仍需要更多的时间才能真的做好准备被合并回主分支。 + + m1-m2-m3-m4 (master) + \ + f1-f2-f3-f4-f5-f6(feature) + +你也知道的是,一些地方实际上是少耦合的新功能。它们可以更早地合并到主分支。不幸的是,你想将部分合并到主分支的内容存在于你六个提交中的某个地方。更糟糕的是,它也包含了依赖于你的功能分支的之前的提交。有人可能会说,你应该在第一处地方做两次提交,但没有人是完美的。 + + m1-m2-m3-m4 (master) + \ + f1-f2-f3-f4-f5-f6(feature) + ^ + | + mixed commit + +在你准备提交的时间,你没有预见到,你可能要逐步把该功能合并入主分支。哎呀!你不会想到这件事会有这么久。 + +你需要的是一种方法可以回溯历史,把它并分成两次提交,这样就可以把代码都安全地分离出来,并可以移植到master分支。 + +用图说话,就是我们需要这样。 + + m1-m2-m3-m4 (master) + \ + f1-f2-f3a-f3b-f4-f5-f6(feature) + +在将工作分成两个提交后,我们就可以cherry-pick出前面的部分到主分支了。 + +原来Git自带了一个功能强大的命令git rebase -i ,它可以让我们这样做。它可以让我们改变历史。改变历史可能会产生问题,并作为一个经验法应尽快避免历史与他人共享。在我们的例子中,虽然我们只是改变我们的本地功能分支的历史。没有人会受到伤害。这这么做了! + +好吧,让我们来仔细看看f3提交究竟修改了什么。原来我们共修改了两个文件:userService.js和wishlistService.js。比方说,userService.js的更改可以直接合入主分支而wishlistService.js不能。因为wishlistService.js甚至没有在主分支存在。这根据的是f1提交中的介绍。 + +>>专家提示:即使是在一个文件中更改,git也可以搞定。但这篇博客中我们要让事情变得简单。 + +我们已经建立了一个[公众演示仓库][3],我们将使用这个来练习。为了便于跟踪,每一个提交信息的前缀是在上面的图表中使用的假的SHA。以下是git在分开提交f3时的分支图。 + +![](https://s3.amazonaws.com/codementor_content/2014-Sep-week3/git1.png) + +现在,我们要做的第一件事就是使用git的checkout功能checkout出我们的功能分支。用git rebase -i master开始做rebase。 + +现在接下来git会用配置的编辑器打开(默认为Vim)一个临时文件。 + +![](https://s3.amazonaws.com/codementor_content/2014-Sep-week3/git2.png) + +该文件为您提供一些rebase选择,它带有一个提示(蓝色文字)。对于每一个提交,我们可以选择的动作有pick、rwork、edit、squash、fixup和exec。每一个动作也可以通过它的缩写形式p、r、e、s、f和e引用。描述每一个选项超出了本文范畴,所以让我们专注于我们的具体任务。 + +我们要为f3提交选择编辑选项,因此我们把内容改变成这样。 + +现在我们保存文件(在Vim中是按下后输入:wq,最后是按下回车)。接下来我们注意到git在编辑选项中选择的提交处停止了rebase。 + +这意味这git开始为f1、f2、f3生效仿佛它就是常规的rebase但是在f3**之后**停止。事实上,我们可以看一眼停止的地方的日志就可以证明这一点。 + +要将f3分成两个提交,我们所要做的是重置git的指针到先前的提交(f2)而保持工作目录和现在一样。这就是git reset在混合模式在做的。由于混合模式是git reset的默认模式,我们可以直接用git reset head~1。就这么做并在运行后用git status看下发生了什么。 + +git status告诉我们userService.js和wishlistService.js被修改了。如果我们与行git diff 我们就可以看见在f3里面确切地做了哪些更改。 + +如果我们看一眼日志我们会发现f3已经消失了。 + +现在我们有了准备提交的先前的f3提交而原先的f3提交已经消失了。记住虽然我们仍旧在rebase的中间过程。我们的f4、f5、f6提交还没有缺失,它们会在接下来回来。 + + +让我们创建两个新的提交:首先让我们为可以提交到主分支的userService.js创建一个提交。运行git add userService.js 接着运行 git commit -m "f3a: add updateUser method"。 + +太棒了!让我们为wishlistService.js的改变创建另外一个提交。运行git add wishlistService.js,接着运行git commit -m "f3b: add addItems method". + +让我们在看一眼日志。 + +这就是我们想要的除了f4、f5、f6仍旧缺失。这是因为我们仍在rebase交互的中间,我们需要告诉git继续rebase。用下面的命令继续:git rebase --continue。 + +让我们再次检查一下日志。 + +就是这样。我们现在已经得到我们想要的历史了。先前的f3提交现在已经被分割成两个提交f3a和f3b。剩下的最后一件事是cherry-pick出f3a提交到主分支上。 + +为了完成最后一步,我们首先切换到主分支。我们用git checkout master。现在我们就可以用cherry-pick命令来拾取f3a commit了。本例中我们可以用它的SHA值bd47ee1来引用它。 + +现在f3a这个提交i就在主分支的最上面了。这就是我们需要的! + +这篇文章的长度看起来需要花费很大的功夫,但实际上对于一个git高级用户而言这只是一会会。 + +>注:Christoph目前正在与Pascal Precht写一本关于[Git rebase][4]的书,您可以在leanpub订阅它并在准备出版时获得通知。 + +-------------------------------------------------------------------------------- + +via: https://www.codementor.io/git-tutorial/git-rebase-split-old-commit-master + +作者:[cburgdorf][a] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:https://www.codementor.io/cburgdorf +[1]:http://thoughtram.io/ +[2]:http://blog.thoughtram.io/posts/going-back-in-time-to-split-older-commits/ +[3]:https://github.com/thoughtram/interactive-rebase-demo +[4]:https://leanpub.com/rebase-the-complete-guide-on-rebasing-in-git \ No newline at end of file diff --git a/translated/tech/20140929 Using GIT to backup your website files on linux.md b/translated/tech/20140929 Using GIT to backup your website files on linux.md new file mode 100644 index 0000000000..a72a547097 --- /dev/null +++ b/translated/tech/20140929 Using GIT to backup your website files on linux.md @@ -0,0 +1,119 @@ +使用 GIT 备份 linux 上的网页 +================================================================================ +![](http://techarena51.com/wp-content/uploads/2014/09/git_logo-1024x480-580x271.png) + +BUP 并不单纯是 Git, 而是一款基于 Git 的软件. 一般情况下, 我使用 rsync 来备份我的文件, 而且迄今为止一直工作的很好. 唯一的不足就是无法把文件恢复到某个特定的时间点. 因此, 我开始寻找替代品, 结果发现了 BUP, 一款基于 git 的软件, 它将数据存储在一个仓库中, 并且有将数据恢复到特定时间点的选项. + +要使用 BUP, 你先要初始化一个空的仓库, 然后备份所有文件. 当 BUP 完成一次备份是, 它会创建一个还原点, 你可以过后还原到这里. 它还会创建所有文件的索引, 包括文件的属性和验校和. 当要进行下一个备份是, BUP 会对比文件的属性和验校和, 只保存发生变化的数据. 这样可以节省很多空间. + +### 安装 BUP (在 Centos 6 & 7 上测试通过) ### + +首先确保你已经安装了 RPMFORGE 和 EPEL 仓库 + + [techarena51@vps ~]$ sudo yum groupinstall "Development Tools" + [techarena51@vps ~]$ sudo yum install python python-devel + [techarena51@vps ~]$ sudo yum install fuse-python pyxattr pylibacl + [techarena51@vps ~]$ sudo yum install perl-Time-HiRes + [techarena51@vps ~]$ git clone git://github.com/bup/bup + [techarena51@vps ~]$ cd bup + [techarena51@vps ~]$ make + [techarena51@vps ~]$ make test + [techarena51@vps ~]$ sudo make install + +对于 debian/ubuntu 用户, 你可以使用 "apt-get build-dep bup". 要获得更多的信心, 可以查看 https://github.com/bup/bup +在 CentOS 7 上, 当你运行 "make test" 时可能会出错, 但你可以继续运行 "make install". + +第一步时初始化一个空的仓库, 就像 git 一样. + + [techarena51@vps ~]$ bup init + +默认情况下, bup 会把仓库存储在 "~/.bup" 中, 但你可以通过设置环境变量 "export BUP_DIR=/mnt/user/bup" 来改变设置. + +然后, 创建所有文件的索引. 这个索引, 就像之前讲过的那样, 存储了一系列文件和它们的属性及 git 目标 id (sha1 哈希表). (属性包括了软链接, 权限和不可改变字节) + + bup index /path/to/file + bup save -n nameofbackup /path/to/file + + #Example + [techarena51@vps ~]$ bup index /var/www/html + Indexing: 7973, done (4398 paths/s). + bup: merging indexes (7980/7980), done. + + [techarena51@vps ~]$ bup save -n techarena51 /var/www/html + + Reading index: 28, done. + Saving: 100.00% (4/4k, 28/28 files), done. + bloom: adding 1 file (7 objects). + Receiving index from server: 1268/1268, done. + bloom: adding 1 file (7 objects). + +"BUP save" 会把所有内容分块, 然后把它们作为对象储存. "-n" 选项指定备份名. + +你可以查看一系列备份和已备份文件. + + [techarena51@vps ~]$ bup ls + local-etc techarena51 test + #Check for a list of backups available for my site + [techarena51@vps ~]$ bup ls techarena51 + 2014-09-24-064416 2014-09-24-071814 latest + #Check for the files available in these backups + [techarena51@vps ~]$ bup ls techarena51/2014-09-24-064416/var/www/html + apc.php techarena51.com wp-config-sample.php wp-load.php + +在同一个服务器上备份文件从来不是一个好的选择. BUP 允许你远程备份网页文件, 但你必须保证你的 SSH 密钥和 BUP 都已经安装在远程服务器上. + + bup index path/to/dir + bup save-r remote-vps.com -n backupname path/to/dir + +### 例子: 备份 "/var/www/html" 文件夹 ### + + [techarena51@vps ~]$bup index /var/www/html + [techarena51@vps ~]$ bup save -r user@remotelinuxvps.com: -n techarena51 /var/www/html + Reading index: 28, done. + Saving: 100.00% (4/4k, 28/28 files), done. + bloom: adding 1 file (7 objects). + Receiving index from server: 1268/1268, done. + bloom: adding 1 file (7 objects). + +### 恢复备份 ### + +登入远程服务器并输入下面的命令 + + [techarena51@vps ~]$bup restore -C ./backup techarena51/latest + + #Restore an older version of the entire working dir elsewhere + [techarena51@vps ~]$bup restore -C /tmp/bup-out /testrepo/2013-09-29-195827 + #Restore one individual file from an old backup + [techarena51@vps ~]$bup restore -C /tmp/bup-out /testrepo/2013-09-29-201328/root/testbup/binfile1.bin + +唯一的缺点是你不能把文件恢复到另一个服务器, 你必须通过 SCP 或者 rsync 手动复制文件. + +通过集成的 web 服务器查看备份 + + bup web + #specific port + bup web :8181 + +你可以使用 shell 脚本来运行 bup, 并建立一个每日运行的定时任务 + + #!/bin/bash + + bup index /var/www/html + bup save -r user@remote-vps.com: -n techarena51 /var/www/html + +BUP 并不完美, 但它的确能够很好地完成任务. 我当然非常愿意看到这个项目的进一步开发, 希望以后能够增加远程恢复的功能. + +你也许喜欢阅读 使用[inotify-tools][1], 一篇关于实时文件同步的文章. + +-------------------------------------------------------------------------------- + +via: http://techarena51.com/index.php/using-git-backup-website-files-on-linux/ + +作者:[Leo G][a] +译者:[wangjiezhe](https://github.com/wangjiezhe) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://techarena51.com/ +[1]:http://techarena51.com/index.php/inotify-tools-example/ diff --git a/translated/tech/20140930 How to Boot Linux ISO Images Directly From Your Hard Drive.md b/translated/tech/20140930 How to Boot Linux ISO Images Directly From Your Hard Drive.md new file mode 100644 index 0000000000..3dcc1a95c3 --- /dev/null +++ b/translated/tech/20140930 How to Boot Linux ISO Images Directly From Your Hard Drive.md @@ -0,0 +1,94 @@ +直接从硬盘启动Linux ISO镜像 +================================================================================ +![](data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAooAAAEsAgMAAAA5t3pxAAAABGdBTUEAALGPC/xhBQAAAAxQTFRFAAAALAAeqKio/v7+NGqafgAABflJREFUeNrt3L1u4zgQB/DU7q+/8qCnuJegBQcQVLlY98RWhoKrDu4V4LZaHCAgp/chUuYpWAY6DofUh6PdtXcVcZL8ZUSmaSf5mSKHY0rJzQ22RbbflPTtTxhhhBFGGGGEEUYYYYQRRhhhhBFGGGH8zrY9e/xpVycxHup6X+/pvnWltp4zHlztrdvfe+Mu1BzqtYz1vvFGkrJ27jVK7em9NNHI35HSWO8P9Zf6UFPbfamjiPZU29bU9qsa1T9sVGMjy7f+HbgKFrk91e5COYVx6I+hTdU2tN7WtyXvyah8+dCsZbxv7r3D3avYjvu6dT3vU2/kHsj7ttk53Y5GzIr98T72x3owuiPvWi8a9/51vK/VLpTXNLrROmtU+2isg24w1usam2BshjFz6xX1yHjr3f2YabjbrhbD9xRp4j2PGYo5tfs6NBxl2ubW1bUNx55tfdhT+YD5GkYYYYQRRhhhhBFGGGGEEUYYYfyhsewEbm/RKPAYlzDCCCOMML4zoxFvNJqNBYy/aHwy9NW5vVyj1fRVKMlGvsEIo5gxY73RSjVW5slUrh1zt8d8DSOM78Y4Hs99Oe+r8j7BNImM5ayxGBlj1rZOFjdndL941qhEGSmC+0hON81RvTMlR3dDJiqtlWl+Y762RnMWSWWeHelYc51SZLJ6rUzz2zmFor0vcw0b+egWo/rXzz7mjJ1rRXe8qS19eWo8RqNKaaTfqg23mVHnxtzIN9I4F2G0peJxcz5muB8OxjUyzXljpV2c8fFniD0um7SVoTqOPWa1TPPS+Trl6sp7MiI3+2DG2U6pkxin8bjo9/lZTWVKs8YK4K8Y3WykUhmti9XPluIz52EUyTvfYs/+mVhDc00+ys7XNRr9WMRcsQizNZWo9rGINSmNT5qN47n5hdH3x86kM3bWGxUbO3vsjfRMrKH30D3nicaMUWOjO6Kmb0fl29HX+GxSpTZqy0alz41KJzdyf1TlZMzkL8eMM6aKj5V5LHyGqGlNgiINfUIgIz0Ta6rwOTbxXKilzoXDVqVMG5GbwfgT+eOwXRIp9WKx55r8cWosZ346xfnOZUyle1ysbOT88XttmYefWfr1DkpSljJelz9yjKJX0/pk3j/ycd5Hr8/uZsIaR76Y8Zr8UYXZ02paa8n7Ryyin0DHmuasJY3X5Y88mMLvZ2NYpxwb3SvNssZr8kf6riOtUzpJZQfj0Rs7y8YhT0qRP/qxYWgVsD/WYZ3St6OKRv1KxkvyRw57L41KT41maeMV+WO/gk5Gm49WTidjht7xgrHnuvwxRhvjemOlKxse8dqlpVe4vbvv7JIx/Lr88bqjpxc3XpI/Js/DkZt9AKMRbvRnjUbjIfcPS7+nKLL2J7FLjKU/769DjORMI7VRm+l56c/KTYHOVggzjs9L5zTZ+jzaG5UEY3l2rtK5vNF44/ENGHMj5VhPjZSpunzW56tKyzQq345K0Jihc9bj89JkLDmNFWSs9Pi8tMsJ/ed3STEcOQWMMP6EUcs20nwyGFNEmwvi46QdU0TtS4x05VG81lGqka+A5PXHFBnjBf2xzyn8WkqCjPGSduz4ejiaqZNkjBcd634lNk3GeL1R8pgxIXuUHHvcvZYaw5FTLGDcttK2/2B8XWPWPog23kyMd5u77C6TZswyMsbtoc1O2UmWkUx32e/Z15b2Mo1//EumzYlsm5M3ttKMf58yf3P90bffQ/uXOOPXLDvdbMh4t2HjQyayHdvsFPthbE9x/XFiFDmuszBmNlKNFMMp6rjY7W0yYzhyigWMyMM/mHF8HUcu0mhGLr5qqEi6DvnN9cfeqFS8+jHVWsC8sVRPhkXWUrkz8oy5sjoaqRzaUcky8t/l0nWGVGbjUaCRr4UcjKnWIX9kNCOj0jKP9dho5BnDX9nLNHaW/hdAFf4rAZXpyh5ZMRw5BYwwwggjjDDCCCOMMMIII4wwwggjjDDCCCOMMMIII4wwwggjjDDCCCOMMMIII4wwwggjjDDCCCOMMMIII4wwwggjjDDCCCOMMMIIo3TjG9j+B4tUkGfI5p/jAAAAAElFTkSuQmCC) + +Linux的GRUB2启动加载器可以直接从硬盘启动Linux ISO文件,可以启动Live CD,甚至可以不用烧录到磁盘来安装Linux到另外一个硬盘分区或从USB驱动启动。 + +我们在Ubuntu 14.04上实施了该过程——Ubuntu及基于Ubuntu的Linux版本对此支持良好。[其它Linux发行版][1]上的工作原理也类似。 + +### 获取Linux ISO文件 ### + +这一密技需要你的硬盘驱动器上安装有Linux系统,你的计算机必须使用[GRUB2启动加载器][2],这是大多数Linux系统的标准启动加载器。不好意思,你是不能使用Windows启动加载器来直接启动一个Linux ISO文件的。 + +下载你想要使用的ISO文件,并放到你的Linux分区中。GRUB2应该支持大多数Linux系统的。如果你想要在live环境中使用它们,而不想将它们安装到硬盘驱动器上,请确认你下载的是各个Linux ISO的“[live CD][3]”版本。很多基于Linux的可启动工具盘也应该可以工作。 + +### 检查ISO文件内容 ### + +你可能需要检查ISO文件来明确确定指定的文件在哪里。例如,你可以通过使用Ubuntu及其它基于GNOME的桌面环境中的归档管理器/File Roller文件管理器这些图形化应用程序来打开ISO文件来完成此项工作。在Nautilus文件管理器中,右击ISO文件并选择使用归档管理器打开。 + +定位内核文件和initrd映像。如果你正在使用Ubuntu ISO文件,你会在卡斯帕文件夹中找到这些文件——vmlinuz文件时Linux内核,而initrd文件是initrd映像。后面,你需要知道它们在ISO文件中所处的位置。 + +![](http://cdn8.howtogeek.com/wp-content/uploads/2014/09/650x350xvmlinuz-and-initrd-file-locations.png.pagespeed.ic.hB1yMlHMr2.png) + +### 检查硬盘分区路径 ### + +GRUB使用与Linux不同的“设备命名”结构。在Linux系统中,/dev/sda0是硬盘上的第一个分区——**a**是指第一个硬盘,而**0**是指第一个分区。在GRUB中,与/dev/sda0相对应的是(hd0,1)。**0**指第一个硬盘,而**1**则指它上面的第一个分区。换句话说,在GRUB设备名中,磁盘编号从0开始计数,而分区编号则从1开始计数——是啊,这真是突然令人困惑。例如,(hd3,6)是指第四磁盘上的第六分区。 + +你可以使用**fdisk -l**命令来查看该信息。在Ubuntu上,打开终端并运行以下命令: + + sudo fdisk -l + +你将看到一个Linux设备路径列表,你可以自行将它们转成GRUB设备名。例如,在下面的图片中,我们可以看到有个系统分区是/dev/sda1——那么,对于GRUB而言,它就是(hd0,1)。 + +![](http://cdn8.howtogeek.com/wp-content/uploads/2014/09/650x410xfdisk-l-command.png.pagespeed.ic.yW7uP1_G0C.png) + +### 创建GRUB2启动条目 ### + +添加自定义启动条目的最简单的方式是编辑/etc/grub.d/40_custom脚本,该文件设计用于用户自行添加启动条目。在编辑该文件后,/etc/defaults/grub文件和/etc/grub.d/脚本的内容将合成创建/boot/grub/grub.cfg文件——你不应该手工编辑该文件。它设计用于通过你在其它文件指定的设置自动生成。 + +你需要以root特权打开/etc/grub.d/40_custom文件来编辑。在Ubuntu上,你可以通过打开终端窗口,并运行以下命令来完成: + + sudo gedit /etc/grub.d/40_custom + +放轻松点,你可以用你喜爱的文本编辑打开该文件。例如,你可以替换命令中“gedit”为“nano”,在[Nano文本编辑器][4]中打开它。 + +除非你已经添加了其它自定义启动条目,否则你应当看到的是一个几乎空的文件。你需要在[注释][5]行下添加一个或多个ISO启动部分。 + +![](http://cdn8.howtogeek.com/wp-content/uploads/2014/09/650x300xadd-custom-boot-menu-entries-to-grub.png.pagespeed.ic.uUT-Yls8xf.png) + +这里为你展示了怎样来从ISO文件启动Ubuntu或基于Ubuntu的发行版,我们在Ubuntu 14.04下作了测试: + + menuentry “Ubuntu 14.04 ISO” { + set isofile=”/home/name/Downloads/ubuntu-14.04.1-desktop-amd64.iso” + loopback loop (hd0,1)$isofile + linux (loop)/casper/vmlinuz.efi boot=casper iso-scan/filename=${isofile} quiet splash + initrd (loop)/casper/initrd.lz + } + +自定义启动条目以包含你期望的菜单的条目名称,计算机上到ISO文件的正确路径,以及包含ISO文件的硬盘和分区设备名。如果vmlinuz和initrd文件的名称或路径不同,请为这些文件指定正确的路径。 + +(如果你有一个独立的/home/分区,忽略/home位,像这样:**set isofile=”/name/Downloads/${isoname}”**)。 + +**重要说明**:不同的Linux版本要求带有不同启动选项的不同的启动条目,GRUB Live ISO多启动项目提供了[用于不同Linux发行版的菜单条目][6]的各种不同类型。你应当可以为你想要启动的ISO文件调整这些示例菜单条目。你也可以仅仅从网页搜索你想要启动的Linux发行版的名称和发行编号,并附带关键词“在GRUB中从ISO启动”,以获取更多信息。 + +![](http://cdn8.howtogeek.com/wp-content/uploads/2014/09/650x392xadd-a-linux-iso-file-to-grub-boot-loader.png.pagespeed.ic.2FR0nOtugC.png) + +如果你想要添加更多ISO启动选项,请为该文件添加额外章节。 + +完成后保存文件,返回终端窗口并运行以下命令: + + sudo update-grub + +![](http://cdn8.howtogeek.com/wp-content/uploads/2014/09/650x249xgenerate-grub.cfg-on-ubuntu.png.pagespeed.ic.5I70sH4ZRs.png) + +再次启动计算机时,你将看到ISO启动条目,你可以选择它来启动ISO文件。在启动时,你可能需要按Shift键来显示GRUB菜单。 + +如果在尝试启动ISO文件时你看见错误信息或黑屏,那么你的启动条目配置不管怎么说配置错误了。即使ISO文件路径和设备名是正确的,ISO文件上的vmlinuz和initrd文件的路径可能是不正确的,或者你启动Linux系统可能需要不同的选项。 + +-------------------------------------------------------------------------------- + +via: http://www.howtogeek.com/196933/how-to-boot-linux-iso-images-directly-from-your-hard-drive/ + +作者:[Chris Hoffman][a] +译者:[GOLinux](https://github.com/GOLinux) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://www.howtogeek.com/author/chrishoffman/ +[1]:http://www.howtogeek.com/191207/10-of-the-most-popular-linux-distributions-compared/ +[2]:http://www.howtogeek.com/196655/how-to-configure-the-grub2-boot-loaders-settings/ +[3]:http://www.howtogeek.com/172810/take-a-secure-desktop-everywhere-everything-you-need-to-know-about-linux-live-cds-and-usb-drives/ +[4]:http://www.howtogeek.com/howto/42980/the-beginners-guide-to-nano-the-linux-command-line-text-editor/ +[5]:http://www.howtogeek.com/118389/how-to-comment-out-and-uncomment-lines-in-a-configuration-file/ +[6]:http://git.marmotte.net/git/glim/tree/grub2 diff --git a/translated/tech/20141008 How to configure a host intrusion detection system on CentOS.md b/translated/tech/20141008 How to configure a host intrusion detection system on CentOS.md new file mode 100644 index 0000000000..90ec639b97 --- /dev/null +++ b/translated/tech/20141008 How to configure a host intrusion detection system on CentOS.md @@ -0,0 +1,125 @@ +在CentOS上配置主机入侵检测系统 +================================================================================ +所有系统管理员想要在他们生产服务器上部署的第一个安全手段之一,就是检测文件篡改的机制——不仅仅是文件内容,而且也包括它们的属性。 + +[AIDE][1] (“高级入侵检测环境”的简称)是一个开源的基于主机的入侵检测系统。AIDE通过检查大量文件属性的不一致性来检查系统二进制文件和基本配置文件的完整性,这些文件属性包括权限、文件类型、索引节点、链接数、链接名、用户、组、文件大小、块计数、修改时间、添加时间、创建时间、acl、SELinux安全上下文、xattrs,以及md5/sha校验和在内。 + +AIDE通过扫描一台(未被篡改)的Linux服务器的文件系统来构建文件属性数据库,以后将服务器文件属性与数据库中的进行校对,然后在服务器运行时对修改过的索引的文件发出警告。处于这个原因,AIDE必须在系统更新后或其配置文件进行合法修改后重新对受保护的文件做索引。 + +对于某些客户,他们可能会根据他们的安全策略在他们的服务器上强制安装某种入侵检测系统。但是,不管客户是否要求,系统管理员都部署一个入侵检测系统,这通常是一个很好的做法。 + +### 安装AIDE到CentOS或RHEL ### + +AIDE的初始安装(同时是首次运行)最好是在系统刚安装完后,并且没有任何服务暴露在互联网,甚至是局域网中。在这个早期阶段,我们可以将来自外部的一切闯入和破坏风险降到最低限度。事实上,这也是确保系统在AIDE构建其初始数据库时保持干净的唯一途径。 + +出于上面的原因,在安装完AIDE后,我们可以执行下面的命令: + + # yum install aide + +我们需要将我们的机器从网络断开,并实施下面所述的一些基本配置任务。 + +### 配置AIDE ### + +默认配置文件是/etc/aide.conf,该文件介绍了几个示例保护规则(如FIPSR,NORMAL,DIR,DATAONLY),各个规则后面跟着一个等于号以及要检查的文件属性列表,或者某些预定义的规则(由+分隔)。你也可以使用此种格式自定义规则。 + +![](https://farm3.staticflickr.com/2947/15446746115_7d0a291b0a_o.png) + + FIPSR = p+i+n+u+g+s+m+c+acl+selinux+xattrs+sha256 + NORMAL = FIPSR+sha512 + +例如,上面的例子说明,NORMAL规则将检查下列属性的不一致性:权限(p)、索引节点(i)、链接数(n)、用户(u)、组(g)、大小(s)、修改时间(m)、创建时间(c)、ACL(acl)、SELinux(selinux)、xattrs(xattr)、SHA256/SHA512校验和(sha256和sha512)。 + +定义的规则可灵活地用于不同的目录和文件(用正则表达式表示)。 + +![](https://farm6.staticflickr.com/5601/15259978179_f93b757c56_o.png) + +条目之前的感叹号(!)告诉AIDE忽略子目录(或目录中的文件),对于这些可以另外定义规则。 + +在上面的例子中,PERMS是用于/etc机器子目录和文件的默认规则。然而,没有规则将用于/etc中的备份文件(如/etc/.*~),也没有规则用于/etc/mtab文件。对于/etc中的一些选择性的子目录或文件,NORMAL规则会被应用,覆盖默认规则PERMS。 + +定义并应用正确的规则到系统中正确的位置,是使用AIDE最难的一部分,但作出好的判断是一个良好的开始。作为首要的一条规则,不要检查不必要的属性。例如,检查/var/log或/var/spool里头的文件的修改时间将导致大量误报,因为许多的应用程序和守护进程经常会写入内容到该位置,而这些内容都没有问题。此外,检查多个校验和可能加强安全性,但随之而来的是AIDE的运行时间的增加。 + +你可以选择将检查结果发送到你的邮箱,如果你使用MAILTO变量指定了电子邮件地址。将下面这一行放到/etc/aide.conf中的任何位置即可。 + + MAILTO=root@localhost + +### 首次运行AIDE ### + +运行以下命令来初始化AIDE数据库: + + # aide --init + +![](https://farm3.staticflickr.com/2942/15446399402_198472e983_o.png) + +根据/etc/aide.conf生成的/var/lib/aide/aide.db.new.gz文件需要被重命名为/var/lib/aide/aide.db.gz,以便AIDE能读取它: + + # mv /var/lib/aide/aide.db.new.gz /var/lib/aide.db.gz + +现在,是时候来将我们的系统与数据库进行第一次校对了。任务很简单,只需运行: + + # aide + +在没有选项时,AIDE假定使用了--check选项。 + +如果在数据库创建后没有对系统做过任何修改,AIDE将会以OK信息来结束本次校对。 + +![](https://farm3.staticflickr.com/2948/15260041950_f568b3996a_o.png) + +### 生产环境中管理AIDE ### + +在构建了一个初始AIDE数据库后,作为不断推进的系统管理活动,你常常需要处于某些合法的理由更新受保护的服务器。每次服务器更新后,你必须重新构建AIDE数据库,以更新数据库内容。要完成该任务,请执行以下命令: + + # aide --update + +要使用AIDE保护生产系统,可能最好通过任务计划调用AIDE来周期性检查不一致性。例如,要让AIDE每天运行一次,并将结果发送到邮箱: + + # crontab -e + +---------- + + 0 0 * * * /usr/sbin/aide --check | /usr/bin/mail -s "AIDE run for $HOSTNAME" your@email.com + +### 测试AIDE检查文件篡改 ### + +下面的测试环境将演示AIDE是如何来检查文件的完整性的。 + +#### 测试环境 1 #### + +让我们添加一个新文件(如/etc/fake)。 + + # cat /dev/null > /etc/fake + +![](https://farm3.staticflickr.com/2941/15260140358_f1d758d354_o.png) + +#### 测试环境 2 #### + +让我们修改文件权限,然后看看它是否被检测到。 + + # chmod 644 /etc/aide.conf + +#### 测试环境 3 #### + +最后,让我们修改文件内容(如,添加一个注释行到/etc/aide.conf)。 + + echo "#This is a comment" >> /etc/aide.conf + +![](https://farm4.staticflickr.com/3936/15259978229_3ff1ea950e_b.jpg) + +上面的截图中,第一栏显示了文件的属性,第二栏是AIDE数据库中的值,而第三栏是更新后的值。第三栏中空白部分表示该属性没有改动(如本例中的ACL)。 + +### 结尾 ### + +如果你曾经发现你自己有很好的理由相信系统被入侵了,但是第一眼又不能确定到底哪些东西被改动了,那么像AIDE这样一个基于主机的入侵检测系统就会很有帮助了,因为它可以帮助你很快识别出哪些东西被改动过,而不是通过猜测来浪费宝贵的时间。 + +-------------------------------------------------------------------------------- + +via: http://xmodulo.com/host-intrusion-detection-system-centos.html + +作者:[Gabriel Cánepa][a] +译者:[GOLinux](https://github.com/GOLinux) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://xmodulo.com/author/gabriel +[1]:http://aide.sourceforge.net/ diff --git a/translated/tech/20141009 Linux Terminal--An lsof Primer.md b/translated/tech/20141009 Linux Terminal--An lsof Primer.md new file mode 100644 index 0000000000..2485801eb3 --- /dev/null +++ b/translated/tech/20141009 Linux Terminal--An lsof Primer.md @@ -0,0 +1,252 @@ +Linux终端:lsof入门 +================================================================================ +![](http://cdn.linuxaria.com/wp-content/uploads/2011/06/tux-terminal.jpg) + +Daniel Miessler撰写,首次在他[博客][1]上贴出 + +**lsof**是系统管理/[安全][2]尤伯工具。我大多数时候用它来从系统获得与[网络][3]连接相关的信息,但那只是这个强大而又鲜为人知的应用的第一步。将这个工具称之为lsof真实名副其实,因为它是指“**列出打开文件(lists openfiles)**”。而有一点要切记,在Unix中一切(包括网络套接口)都是文件。 + +有趣的是,lsof也是有着最多开关的Linux/Unix命令。它有那么多的开关,它必须同时使用-和+。 + + usage: [-?abhlnNoOPRstUvV] [+|-c c] [+|-d s] [+D D] [+|-f[cgG]] + [-F [f]] [-g [s]] [-i [i]] [+|-L [l]] [+|-M] [-o [o]] + [-p s] [+|-r [t]] [-S [t]] [-T [t]] [-u s] [+|-w] [-x [fl]] [--] [names] + +正如你所见,lsof有着实在是令人惊讶的选项数量。你可以使用它来获得你系统上设备的信息,你能通过它了解到指定的用户在指定的地点正在碰什么东西,或者甚至是一个进程正在使用什么文件或网络连接。 + +对于我,lsof替代了netstat和ps的全部工作。它可以带来那些工具所能带来的一切,而且要比那些工具多得多。那么,让我们来看看它的一些基本能力吧: + +### 关键选项 ### + +理解一些关于lsof如何工作的关键性东西是很重要的。最重要的是,当你给它传递选项时,默认行为是对结果进行或运算。因此,如果你正是用-i来拉出一个端口列表,同时又用-p来拉出一个进程列表,那么默认情况下你会获得两者的结果。 + +下面的一些其它东西需要牢记: + +- **default** : 没有选项,lsof列出活跃进程的所有打开文件 +- **grouping** : 可以分组选项,如-abc,但要当心哪些选项需要参数 +- **-a** : 结果进行与运算(而不是或) +- **-l** : 在输出显示用户ID而不是用户名 +- **-h** : 获得帮助 +- **-t** : 仅获取进程ID +- **-U** : 获取UNIX套接口地址 +- **-F** : 输出结果为其它命令准备好,可以通过多种方式格式化,如-F pcfn(用于进程id、命令名、文件描述符、文件名,并以空终止) + +#### 获取网络信息 #### + +正如我所说的,我主要将lsof用于获取关于系统怎么和网络交互的信息。这里提供了关于此信息的一些主题: + +### 使用-i显示所有连接 ### + +有些人喜欢用netstat来获取网络连接,但是我更喜欢使用lsof来进行此项工作。结果以对我来说很直观的方式呈现,而我了解到,我仅仅只需改变我的语法,就可以通过同样的命令来获取更多信息。 + +# lsof -i + + COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME + dhcpcd 6061 root 4u IPv4 4510 UDP *:bootpc + sshd 7703 root 3u IPv6 6499 TCP *:ssh (LISTEN) + sshd 7892 root 3u IPv6 6757 TCP 10.10.1.5:ssh->192.168.1.5:49901 (ESTABLISHED) + +### 使用-i 6仅获取IPv6流量 ### + +# lsof -i 6 + +### 仅显示TCP连接(同理可获得UDP连接) ### + +你也可以通过在-i后提供对应的协议来仅仅显示TCP或者UDP连接信息。 + +# lsof -iTCP + + COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME + sshd 7703 root 3u IPv6 6499 TCP *:ssh (LISTEN) + sshd 7892 root 3u IPv6 6757 TCP 10.10.1.5:ssh->192.168.1.5:49901 (ESTABLISHED) + +### 使用-i:port来显示与指定端口相关的网络信息 ### + +或者,你也可以通过端口搜索,这对于要找出什么阻止了另外一个应用绑定到指定端口实在是太棒了。 + +# lsof -i :22 + + COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME + sshd 7703 root 3u IPv6 6499 TCP *:ssh (LISTEN) + sshd 7892 root 3u IPv6 6757 TCP 10.10.1.5:ssh->192.168.1.5:49901 (ESTABLISHED) + +### 使用@host来显示指定到指定主机的连接 ### + +这对于你在检查是否开放连接到网络中或互联网上某个指定主机的连接时十分有用。 + +# lsof -i@172.16.12.5 + + sshd 7892 root 3u IPv6 6757 TCP 10.10.1.5:ssh->172.16.12.5:49901 (ESTABLISHED) + +### 使用@host:port显示基于主机与端口的连接 ### + +你也可以组合主机与端口的显示信息。 + +# lsof -i@172.16.12.5:22 + + sshd 7892 root 3u IPv6 6757 TCP 10.10.1.5:ssh->192.168.1.5:49901 (ESTABLISHED) + +### 找出监听端口 ### + +找出正等候连接的端口。 + +# lsof -i -sTCP:LISTEN + +你也可以grep “LISTEN”来完成该任务。 + +# lsof -i | grep -i LISTEN + + iTunes 400 daniel 16u IPv4 0x4575228 0t0 TCP *:daap (LISTEN) + +### 找出已建立的连接 ### + +你也可以显示任何已经连接的连接。 + +# lsof -i -sTCP:ESTABLISHED + +你也可以通过grep搜索“ESTABLISHED”来完成该任务。 + +# lsof -i | grep -i ESTABLISHED + + firefox-b 169 daniel 49u IPv4 0t0 TCP 1.2.3.3:1863->1.2.3.4:http (ESTABLISHED) + +#### 用户信息 #### + +你也可以获取各种用户的信息,以及它们在系统上正干着的事情,包括它们的网络活动、对文件的操作等。 + +### 使用-u显示指定用户打开了什么 ### + +# lsof -u daniel + + -- snipped -- + Dock 155 daniel txt REG 14,2 2798436 823208 /usr/lib/libicucore.A.dylib + Dock 155 daniel txt REG 14,2 1580212 823126 /usr/lib/libobjc.A.dylib + Dock 155 daniel txt REG 14,2 2934184 823498 /usr/lib/libstdc++.6.0.4.dylib + Dock 155 daniel txt REG 14,2 132008 823505 /usr/lib/libgcc_s.1.dylib + Dock 155 daniel txt REG 14,2 212160 823214 /usr/lib/libauto.dylib + -- snipped -- + +### 使用-u ^user来显示除指定用户以外的其它所有用户所做的事情 ### + +# lsof -u ^daniel + + -- snipped -- + Dock 155 jim txt REG 14,2 2798436 823208 /usr/lib/libicucore.A.dylib + Dock 155 jim txt REG 14,2 1580212 823126 /usr/lib/libobjc.A.dylib + Dock 155 jim txt REG 14,2 2934184 823498 /usr/lib/libstdc++.6.0.4.dylib + Dock 155 jim txt REG 14,2 132008 823505 /usr/lib/libgcc_s.1.dylib + Dock 155 jim txt REG 14,2 212160 823214 /usr/lib/libauto.dylib + -- snipped -- + +### 杀死指定用户所做的一切事情 ### + +可以消灭指定用户运行的所有东西,这真不错。 + +# kill -9 `lsof -t -u daniel` + +#### 命令和进程 #### + +可以查看指定程序或进程由什么决定,这通常会很有用,而你可以使用lsof通过名称或进程ID过滤来完成这个任务。下面列出了一些选项: + +### 使用-c查看指定的命令正在使用的文件和网络连接 ### + +# lsof -c syslog-ng + + COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME + syslog-ng 7547 root cwd DIR 3,3 4096 2 / + syslog-ng 7547 root rtd DIR 3,3 4096 2 / + syslog-ng 7547 root txt REG 3,3 113524 1064970 /usr/sbin/syslog-ng + -- snipped -- + +### 使用-p查看指定进程ID已打开的内容 ### + +# lsof -p 10075 + + -- snipped -- + sshd 10068 root mem REG 3,3 34808 850407 /lib/libnss_files-2.4.so + sshd 10068 root mem REG 3,3 34924 850409 /lib/libnss_nis-2.4.so + sshd 10068 root mem REG 3,3 26596 850405 /lib/libnss_compat-2.4.so + sshd 10068 root mem REG 3,3 200152 509940 /usr/lib/libssl.so.0.9.7 + sshd 10068 root mem REG 3,3 46216 510014 /usr/lib/liblber-2.3 + sshd 10068 root mem REG 3,3 59868 850413 /lib/libresolv-2.4.so + sshd 10068 root mem REG 3,3 1197180 850396 /lib/libc-2.4.so + sshd 10068 root mem REG 3,3 22168 850398 /lib/libcrypt-2.4.so + sshd 10068 root mem REG 3,3 72784 850404 /lib/libnsl-2.4.so + sshd 10068 root mem REG 3,3 70632 850417 /lib/libz.so.1.2.3 + sshd 10068 root mem REG 3,3 9992 850416 /lib/libutil-2.4.so + -- snipped -- + +### -t选项只返回PID ### + +# lsof -t -c Mail + + 350 + +#### 文件和目录 #### + +通过查看指定文件或目录,你可以看到系统上所有正与其交互的资源——包括用户、进程等。 + +#### 显示与指定目录交互的所有一切 #### + +# lsof /var/log/messages/ + + COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME + syslog-ng 7547 root 4w REG 3,3 217309 834024 /var/log/messages + +### 显示与指定文件交互的所有一切 ### + +# lsof /home/daniel/firewall_whitelist.txt + +#### 高级用法 #### + +与[tcpdump][4]类似,当你开始组合查询时,它就显示了它强大的功能。 + +### 显示daniel连接到1.1.1.1所做的一切 ### + +# lsof -u daniel -i @1.1.1.1 + + bkdr 1893 daniel 3u IPv6 3456 TCP 10.10.1.10:1234->1.1.1.1:31337 (ESTABLISHED) + +### 同时使用-t和-c选项以挂起进程 ### + +# kill -HUP `lsof -t -c sshd` + +### lsof +L1显示所有打开的链接数小于1的文件 ### + +这通常(当不总是)表示某个攻击者正尝试通过取消文件链接来隐藏文件。 + +# lsof +L1 + + (hopefully nothing) + +### 显示某个端口范围的开放连接 ### + + # lsof -i @fw.google.com:2150=2180 + +#### 结尾 #### + +This primer just scratches the surface of lsof‘s functionality. For a full reference, run man lsof or check out [the online version][5]. I hope this has been useful to you, and as always,[comments and corrections are welcomed][6]. +本入门教程只是管窥了lsof功能的一斑,要查看完整参考,运行man lsof命令或查看[在线版本][5]。希望本文对你有所助益,也随时[欢迎你的评论和指正][6]。 + +### 资源 ### + +- lsof手册页:[http://www.netadmintools.com/html/lsof.man.html][7] + +-------------------------------------------------------------------------------- + +via: http://linuxaria.com/howto/linux-terminal-an-lsof-primer + +作者:[Daniel Miessler][a] +译者:[GOLinux](https://github.com/GOLinux) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:https://plus.google.com/101727609700016666852/posts?rel=author +[1]:http://danielmiessler.com/study/lsof/ +[2]:http://linuxaria.com/tag/security +[3]:http://linuxaria.com/tag/network +[4]:http://danielmiessler.com/study/tcpdump/ +[5]:http://www.netadmintools.com/html/lsof.man.html +[6]:http://danielmiessler.com/connect/ +[7]:http://www.netadmintools.com/html/lsof.man.html diff --git a/translated/tech/20141009 Linux or UNIX wget command with practical examples.md b/translated/tech/20141009 Linux or UNIX wget command with practical examples.md new file mode 100644 index 0000000000..7a720c725b --- /dev/null +++ b/translated/tech/20141009 Linux or UNIX wget command with practical examples.md @@ -0,0 +1,127 @@ +Linux/Unix wget命令实例 +================================================================================ +wget是Linux/Unix命令行**文件下载器**,它是下载网站上文件的免费的非交互下载工具,它支持**HTTP**、**HTTPS**和**FTP**协议,也支持通过HTTP代理检索。Wget是非交互的,这就是说它可以在用户没有登录到系统时在后台工作。 + +在本帖中,我们将讨论wget命令的一些不同使用实例。 + +### 实例:1 下载单个文件 ### + + # wget http://mirror.nbrc.ac.in/centos/7.0.1406/isos/x86_64/CentOS-7.0-1406-x86_64-DVD.iso + +该命令会下载CentOS 7 ISO文件到用户当前工作目录中。 + +### 实例:2 续传分段下载文件 ### + +总有那么一些场景,当我们开始下载一个大文件时,中途互联网却断开了。那样的话,我们可以使用wget命令的‘**-c**’选项,让下载从断点续传。 + + # wget -c http://mirror.nbrc.ac.in/centos/7.0.1406/isos/x86_64/CentOS-7.0-1406-x86_64-DVD.iso + +![](http://www.linuxtechi.com/wp-content/uploads/2014/09/wget-resume-download-1024x111-1.jpg) + +### 实例:3 后台下载文件 ### + +我们可以通过在wget命令中使用‘-b’选项来让它在后台下载文件。 + + linuxtechi@localhost:~$ wget -b http://mirror.nbrc.ac.in/centos/7.0.1406/isos/x86_64/ + CentOS-7.0-1406-x86_64-DVD.iso + Continuing in background, pid 4505. + Output will be written to ‘wget-log’. + +正如我们上面所见,下载进程被捕获到用户当前目录中的‘wget-log’文件中。 + + linuxtechi@localhost:~$ tail -f wget-log + 2300K ………. ………. ………. ………. ………. 0% 48.1K 18h5m + 2350K ………. ………. ………. ………. ………. 0% 53.7K 18h9m + 2400K ………. ………. ………. ………. ………. 0% 52.1K 18h13m + 2450K ………. ………. ………. ………. ………. 0% 58.3K 18h14m + 2500K ………. ………. ………. ………. ………. 0% 63.6K 18h14m + 2550K ………. ………. ………. ………. ………. 0% 63.4K 18h13m + 2600K ………. ………. ………. ………. ………. 0% 72.8K 18h10m + 2650K ………. ………. ………. ………. ………. 0% 59.8K 18h11m + 2700K ………. ………. ………. ………. ………. 0% 52.8K 18h14m + 2750K ………. ………. ………. ………. ………. 0% 58.4K 18h15m + 2800K ………. ………. ………. ………. ………. 0% 58.2K 18h16m + 2850K ………. ………. ………. ………. ………. 0% 52.2K 18h20m + +### 实例:4 限制下载速率 ### + +默认情况下,wget命令尝试以全速下载,但是有时候你可能使用的是共享互联网,那么如果你尝试使用wget来下载庞大的文件时,就会把其它用户的网络拖慢。这时,你如果使用‘-limit-rate’选项来限制下载速率,就可以避免这种情况的发生。 + + #wget --limit-rate=100k http://mirror.nbrc.ac.in/centos/7.0.1406/isos/x86_64/CentOS-7.0-1406-x86_64-DVD.iso + +在上例中,下载速率被限制到了100k。 + +### 实例:5 使用‘-i’选项来下载多个文件 ### + +如果你想要使用wget命令来下载多个文件,那么首先要创建一个文本文件,并将所有的URL添加到该文件中。 + + # cat download-list.txt + url1 + url2 + url3 + url4 + +现在,发出以下命令吧: + + # wget -i download-list.txt + +### 实例:6 增加重试次数 ### + +我们可以使用‘-tries’选项来增加重试次数。默认情况下,wget命令会重试20次以使下载成功。 + +该选项在你下载一个大文件的过程中互联网连接发生问题时十分有用,因为在那种情况下,会增加下载失败的几率。 + + # wget --tries=75 http://mirror.nbrc.ac.in/centos/7.0.1406/isos/x86_64/CentOS-7.0-1406-x86_64-DVD.iso + +### 实例:7 使用-o选项来重定向wget日志到文件 ### + +我们可以使用‘-o’选项来重定向wget命令的日志到一个日志文件。 + + #wget -o download.log http://mirror.nbrc.ac.in/centos/7.0.1406/isos/x86_64/CentOS-7.0-1406-x86_64-DVD.iso + +上面的命令会在用户当前目录下创建download.log文件。 + +### 实例:8 下载整个网站用于本地查看 ### + + # wget --mirror -p --convert-links -P ./ website-url + +鉴于 + +- **–mirror** : 开启适用于镜像的选项。 +- **-p** : 下载所有能正确显示指定HTML网页的全部必要文件。 +- **–convert-links** : 下载完成后,转换文档中的链接以用于本地查看。 +- -**P ./Local-Folder** : 保存所有文件和目录到指定的目录。 + +### 实例:9 下载过程中拒绝文件类型 ### + +当你正打算下载整个网站时,我们可以使用‘-reject’选项来强制wget不下载图片。 + + # wget --reject=png Website-To-Be-Downloaded + +### 实例:10 使用wget -Q设置下载配额 ### + +我们可以使用‘-Q’选项强制wget命令在下载大小超过特定大小时退出下载。 + + # wget -Q10m -i download-list.txt + +注意,配额不会对单个文件的下载产生影响。所以,如果你指定wget -Q10m ftp://wuarchive.wustl.edu/ls-lR.gz,ls-lR的全部内容都会被下载。这在下载命令行指定的多个URL时也一样。然而,在递归或从一个输入文件检索时,还是值得一用。因此,你可以安全地输入‘wget -Q10m -i download-list.txt’,在超过配额时,下载会退出。 + +### 实例:11 从密码保护的网站下载文件 ### + + # wget --ftp-user= --ftp-password= Download-URL + +另外一种指定用户名和密码的方式是在URL中。 + +任一方法都将你的密码揭露给了那些运行“ps”命令的人。要防止密码被查看到,将它们存储到.wgetrc或.netrc中,并使用“chmod”设置合适的权限来保护这些文件不让其他用户查看到。如果密码真的很重要,不要在它们还在文件里躺着的时候走开,在Wget开始下载后,编辑该文件,或者删除它们。 + +-------------------------------------------------------------------------------- + +via: http://www.linuxtechi.com/wget-command-practical-examples/ + +作者:[Pradeep Kumar][a] +译者:[GOLinux](https://github.com/GOLinux) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://www.linuxtechi.com/author/pradeep/ diff --git a/translated/tech/Sysstat – All-in-One System Performance and Usage Activity Monitoring Tool For Linux.md b/translated/tech/Sysstat – All-in-One System Performance and Usage Activity Monitoring Tool For Linux.md new file mode 100644 index 0000000000..2c28c2c7d2 --- /dev/null +++ b/translated/tech/Sysstat – All-in-One System Performance and Usage Activity Monitoring Tool For Linux.md @@ -0,0 +1,122 @@ +集所有功能与一身的Linux系统性能和使用活动监控工具-Sysstat +=========================================================================== +**Sysstat**是一个非常方便的工具,它带有众多的系统资源监控工具,用于监控系统的性能和使用情况。我们在日常使用的工具中有相当一部分是来自sysstat工具包的。同时,它还提供了一种使用cron表达式来制定性能和活动数据的收集计划。 + +![Install Sysstat in Linux](http://www.tecmint.com/wp-content/uploads/2014/08/sysstat.png) + +在Linux系统中安装Sysstat + +下表是包含在sysstat包中的工具 + +- [**isstat**][1]: 输出CPU的统计信息和所有I/O设备的输入输出(I/O)统计信息。 +- **mpstat**: 关于多有CPU的详细信息(单独输出或者分组输出)。 +- **pidstat**: 关于运行中的进程/任务、CPU、内存等的统计信息。 +- **sar**: 保存并输出不同系统资源(CPU、内存、IO、网络、内核、等。。。)的详细信息。 +- **sadc**: 系统活动数据收集器,用于手机sar工具的后端数据。 +- **sa1**: 系统手机并存储sadc数据文件的二进制数据,与sadc工具配合使用 +- **sa2**: 配合sar工具使用,产生每日的摘要报告。 +- **sadf**: 用于以不同的数据格式(CVS或者XML)来格式化sar工具的输出。 +- **Sysstat**: sysstat工具的man帮助页面。 +- **nfsiostat**: NFS(Network File System)的I/O统计信息。 +- **cifsiostat**: CIFS(Common Internet File System)的统计信息。 + +最近(在2014年6月17日),**sysstat 11.0.0**(稳定版)已经发布了,同时还新增了一些有趣的特性,如下: + +pidstat命令新增了一些新的选项:首先是“-R”选项,该选项将会输出有关策略和任务调度的优先级信息。然后是“**-G**”选项,通过这个选项我们可以使用名称搜索进程,然后列出所有匹配的线程。 + +sar、sadc和sadf命令在数据文件方面同样带来了一些功能上的增强。与以往只能使用“**saDD**”来命名数据文件。现在使用**-D**选项可以用“**saYYYYMMDD**”来重命名数据文件,同样的,现在的数据文件不必放在“**var/log/sa**”目录中,我们可以使用“SA_DIR”变量来定义新的目录,该变量将应用与sa1和sa2命令。 + +###在Linux系统中安装Sysstat#### + +在主要的linux发行版中,‘**Sysstat**’工具包可以在默认的程序库中安装。然而,在默认程序库中的版本通常有点旧,因此,我们将会下载源代码包,编译安装最新版本(**11.0.0**版本)。 + +首先,使用下面的连接下载最新版本的sysstat包,或者你可以使用**wget**命令直接在终端中下载。 + +- [http://sebastien.godard.pagesperso-orange.fr/download.html][2] + + # wget http://pagesperso-orange.fr/sebastien.godard/sysstat-11.0.0.tar.gz + +![Download Sysstat Package](http://www.tecmint.com/wp-content/uploads/2014/08/Download-Sysstat.png) + +下载Sysstat包 + +然后解压缩下载下来的包,进去该目录,开始编译安装 + + # tar -xvf sysstat-11.0.0.tar.gz + # cd sysstat-11.0.0/ + +这里,你有两种编译安装的方法: + +a).第一,你可以使用**iconfig**(这将会给予你很大的灵活性,你可以选择/输入每个参数的自定义值) + + # ./iconfig + +![Sysstat iconfig Command](http://www.tecmint.com/wp-content/uploads/2014/08/Sysstat-iconfig-Command.png) + +Sysstat的iconfig命令 + +b).第二,你可以使用标准的**configure**命令在当行中定义所有选项。你可以运行 **./configure –help 命令**来列出该命令所支持的所有限选项。 + + # ./configure --help + +![Sysstat Configure Help](http://www.tecmint.com/wp-content/uploads/2014/08/Configure-Help.png) + +Stsstat的cofigure -help + +在这里,我们使用标准的**./configure**命令来编译安装sysstat工具包。 + + # ./configure + # make + # make install + +![Configure Sysstat in Linux](http://www.tecmint.com/wp-content/uploads/2014/08/Configure-Sysstat.png) + +在Linux系统中配置sysstat + +在编译完成后,我们将会看到一些类似于上图的输出。现在运行如下命令来查看sysstat的版本。 + + # mpstat -V + + sysstat version 11.0.0 + (C) Sebastien Godard (sysstat orange.fr) + +###在Linux 系统中更新sysstat### + +默认的,sysstat使用“**/usr/local**”作为其目录前缀。因此,所有的二进制数据/工具都会安装在“**/usr/local/bin**”目录中。如果你的系统已经安装了sysstat 工具包,则上面提到的二进制数据/工具有可能在“**/usr/bin**”目录中。 + +因为“**$PATH**”变量不包含“**/usr/local/bin**”路径,你在更新时可能会失败。因此,确保“**/usr/local/bin**”路径包含在“$PATH”环境变量中,或者在更新前,在编译和卸载旧版本时将**-prefix**选项指定值为“**/usr**”。 + + # yum remove sysstat [On RedHat based System] + # apt-get remove sysstat [On Debian based System] + +---------- + + # ./configure --prefix=/usr + # make + # make install + +现在,使用‘mpstat’命令的‘**-V**’选项查看更新后的版本。 + + # mpstat -V + + sysstat version 11.0.0 + (C) Sebastien Godard (sysstat orange.fr) + +**参考**: 更多详细的信息请到 [Sysstat Documentation][3] + +在我的下一篇文章中,我将会展示一些sysstat命令使用的实际例子,敬请关注更新。别忘了在下面评论框中留下您宝贵的意见。 + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/install-sysstat-in-linux/ + +作者:[Kuldeep Sharma][a] +译者:[cvsher](https://github.com/cvsher) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/kuldeepsharma47/ +[1]:http://www.tecmint.com/linux-performance-monitoring-with-vmstat-and-iostat-commands/ +[2]:http://sebastien.godard.pagesperso-orange.fr/download.html +[3]:http://sebastien.godard.pagesperso-orange.fr/documentation.html diff --git a/translated/tech/[翻译完成]20140929 Learning Vim in 2014--Working with Files.md b/translated/tech/[翻译完成]20140929 Learning Vim in 2014--Working with Files.md new file mode 100644 index 0000000000..0a1eb2a3f3 --- /dev/null +++ b/translated/tech/[翻译完成]20140929 Learning Vim in 2014--Working with Files.md @@ -0,0 +1,113 @@ +2014年学习如何使用vim处理文件工作 +================================================================================ + +作为一名开发者你不能够只化时间去写你想要的代码。其中最难以处理的部分是我的工作只使用vim来处理文本。我感觉到很无语与无比的蛋疼,vim没有自己额外文件查看系统与内部打开与切换文件功能。因此,继vim之后,我主要使用Eclipse 和 Sublime Text. + +就此,我非常欣赏深度定制的vim文件管理功能。在工作环境上我已经装配了这些工具,甚至比起那些视觉编辑器好很多。因为这个是纯键盘操作,促使我可以更加快地移动我的代码。第一篇文章使我明白这个vim内建功能只是处理文件的另一选择。在这篇文章里我会带你去认识vim文件管理功能与使用更高级的插件。 + +### 基础篇:打开新文件 ### + +学习vim其中最大的一个障碍是缺少可视提示,不像现在的GUI图形编辑器,当你在终端打开一个新的vim是没有明显的提示去提醒你去走什么,所有事情都是靠键盘输入,同时也没有更多更好的界面交互,vim新手需要习惯如何靠自己去查找一些基本的操作指令。好吧,让我开始学习基础吧。 + +创建新文件的命令是**:e 或:e** 打开一个新缓冲区保存文件内容。如果文件不存在它会开辟一个缓冲区去保存与修改你指定文件。缓冲区是vim是术语,意为"保存文本块到内存"。文本是否能够与存在的文件关联,要看是否每个你打开的文件都对应一个缓冲区。 + + +打开文件与修改文件之后,你可以使用**:w**命令来保存在缓冲区的文件内容到文件里面,如果缓冲区不能关联你的文件或者你想保存到另外一个地方,你需要使用**:w **来保存指定地方。 + +这些是vim处理文件的基本知识,很多的开发者都掌握了这些命令,这些技巧你都需要掌握。vim提供了很多技巧让人去深挖。 + + +### 缓冲区管理 ### + +基础掌握了,就让我来说更多关于缓冲区得东西,vim处理打开文件与其他编辑器有一点不同,打开的文件不会作为一个标签留在一个可视地方,而是只允许你同时只有一个文件在缓冲区打开,vim允许你多个缓存打开。一些会显示出来,另外一些就不会,你需要用**:ls**来查看已经打开的缓存,这个命令会显示每个打开的缓存区,同时会有它们的序码,你可以通过这些序码实用**:b **来切换或者使用循序移动命令**:bnext** 和 **:bprevious** 也可以使用它们的缩写**:bn**和**:bp**。 + +这些命令是vim管理文件缓冲区的一个基础,我发现他们不会按照我的思维去映射出来。我不想关心缓冲区的顺序,我只想按照我的思维去到那个文件或者想在当前这个文件.因此必需了解vim更深的缓存模式,我不是推荐你必须内部命令来作为主要的文件管理方案。但这些的确是很强大可行的选择。 + +![](http://benmccormick.org/content/images/2014/Jul/skitch.jpeg) + +### 分屏 ### + +分屏是vim其中一个最好用的管理文件功能,在vim +你可以在当前窗同时分开2个窗口,可以按照你喜欢的配置去重设大小和分配,这个很特别可以在不同地方同时打开6文件每个文件都拥有自己的窗口大少 + +你可以通过命令**:sp **来新建水平分割窗口或者 **:vs **垂直分割窗口。你可以使用这些关键命令去重置你想要的窗口, +老实说,我喜欢用鼠标处理vim任务,因为鼠标能够给我更加准确的两列的宽度而不需要猜大概的宽度。 + +创建新的分屏后,你需要使用**ctrl-w +[h|j|k|l]**来向后向前切换。这个有少少笨拙,但这个确实很重要很普遍很容易很高效的操作.如果你经常使用分屏,我建议你去.vimrc使用以下代码q去设置别名为**ctrl-h** **ctrl-j** 等等。 + + nnoremap "Ctrl-j to move down a split + nnoremap "Ctrl-k to move up a split + nnoremap "Ctrl-l to move right a split + nnoremap "Ctrl-h to move left a split + +### 跳转表 ### + +分屏是解决多个关联文件同时查看问题,但我们仍然不能满足打开文件与隐藏文件之间快速移动。这时跳转表是一个能够解决的工具。 + +跳转表是众多插件中看其来奇怪而且很少使用。vim能够追踪每一步命令还有切换你正在修改的文件。每次从一个分屏窗口跳到另外一个,vim都会添加记录到跳转表里面。这个记录你去过的地方,这样就不需要担心之前的文件在哪里,你可以使用快捷键去快速追溯你的踪迹。**Ctrl-o**允许你返回你上一次地方。重复操作几次就能够返回到你最先编写的代码段地方。你可以使用**ctrl-i**来向前返回。当你在调试多个文件或两个文件之间切换能够发挥极大的快速移动功能。 + + +### 插件 ### + +如果你想vim像Sublime Text 或者Atom一样,我就让你认清一下,这里有很好的机会让你看到一些难懂,可怕和低效的事情。例如大家会发出"当Sublime有了模糊查找功能,为什么我一定要输入全路径才能够打开文件" "没有侧边栏显示目录树我怎样查看项目结构" 。但vim有了解决方案。这些方案不需要破坏vim的核心。我只需要经常修改vim配置与添加一些最新的插件,这里有3个有用的插件可以让你像Sublime管理文件 + +- [CtrlP][1] 是一个跟Sublime的"Go to Anything"栏一样模糊查找文件.它快如闪电并且非常可配置性。我使用它最主要打开文件。我只需知道部分的文件名字不需要记住整个项目结构就可以查找了 + +- [The NERDTree][2] + 这个一个文件管理夹插件,它重复了很多编辑器的有的侧边文件管理夹功能。我实际上很少用它,对于我模糊查找会更加快。对于你接手一个项目,尝试学习项目结构与了解什么可以用是非常方便的,NERDTree是可以自己定制配置,安装它能够代替vim内置的目录工具。 + + +- [Ack.vim][3] 是一个专为vim的代码搜索插件,它允许你跨项目搜索文本。通过Ack 或 Ag 去高亮查找 + [第二个极其好用的搜索工具][4],允许你在任何时候在你项目之间快速搜索跳转 + + +在vim核心与它的插件生态系统之间,vim 提供足够的工具允许你构建你想要得工作环境。文件管理是软件开发系统的最核心部分并且你值得拥有体验的权利 + + +开始是需要通过很长的时间去理解它们,然后才找到你感觉舒服的工作流程之后才开始添加工具在上面。但依然值得你去使用,当你不需要头爆去理解如何去使用就能够轻易编写你的代码。 + + +### 更多插件资源 ### + +- [Seamlessly Navigate Vim & Tmux Splits][5] 这个插件需要每一个想使用它的人都要懂得实用[tmux][6],这个跟vim的splits 一样简单好用 + + +- [Using Tab Pages][7] 它是一个vim的标签功能插件,虽然它的名字用起来有一点疑惑,但我不能说它是文件管理器。 + 对如何在有多个工作可视区使用"tab + pages" 在vim wiki 网站上有更好的概述 + +- [Vimcasts: The edit command][8] 一般来说 Vimcasts + 是大家学习vim的一个好资源。这个屏幕截图与一些内置工作流程是很好描述之前说得文件操作方面的知识 + + +### 订阅 ### + +这篇文章通过第三个方面介绍如何通过一些好的手法学习vim。如果你喜欢这篇文章你可以通过[feed][8]来订阅或email我[mailing +list][10]。在这个星期javascript小插曲之后,下星期我会继续介绍vim的配置方面的东西,你可以先看基础篇:使用vim +看我前2篇系列文章和vim与vi的语言 + +-------------------------------------------------------------------------------- + +via: http://benmccormick.org/2014/07/07/learning-vim-in-2014-working-with-files/ + +作者:[Ben McCormick][a] +译者:[译者ID](https://github.com/haimingfg) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://benmccormick.org/2014/07/07/learning-vim-in-2014-working-with-files/ +[1]:https://github.com/kien/ctrlp.vim +[2]:https://github.com/scrooloose/nerdtree +[3]:https://github.com/mileszs/ack.vim +[4]:http://benmccormick.org/2013/11/25/a-look-at-ack/ +[5]:http://robots.thoughtbot.com/seamlessly-navigate-vim-and-tmux-splits +[6]:http://tmux.sourceforge.net/ +[7]:http://vim.wikia.com/wiki/Using_tab_pages +[8]:http://vimcasts.org/episodes/the-edit-command/ +[9]:http://feedpress.me/benmccormick +[10]:http://eepurl.com/WFYon +[11]:http://benmccormick.org/2014/07/14/learning-vim-in-2014-configuring-vim/ +[12]:http://benmccormick.org/2014/06/30/learning-vim-in-2014-the-basics/ +[13]:http://benmccormick.org/2014/07/02/learning-vim-in-2014-vim-as-language/