From 39cf8ad47e5e9122fd1a53b7c1ce3f8012626524 Mon Sep 17 00:00:00 2001 From: ZTinoZ Date: Mon, 11 May 2015 17:38:10 +0800 Subject: [PATCH 001/965] Translating by ZTinoZ --- ...to Do After Installing Ubuntu 15.04 Desktop.md | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/sources/tech/20150427 15 Things to Do After Installing Ubuntu 15.04 Desktop.md b/sources/tech/20150427 15 Things to Do After Installing Ubuntu 15.04 Desktop.md index 179aa139bd..e40612ea8f 100644 --- a/sources/tech/20150427 15 Things to Do After Installing Ubuntu 15.04 Desktop.md +++ b/sources/tech/20150427 15 Things to Do After Installing Ubuntu 15.04 Desktop.md @@ -1,16 +1,15 @@ -Translating by ZTinoZ -15 Things to Do After Installing Ubuntu 15.04 Desktop +安装完Ubuntu 15.04桌面后要做的15件事 ================================================================================ -This tutorial is intended for beginners and covers some basic steps on what to do after you have installed Ubuntu 15.04 “Vivid Vervet” Desktop version on your computer in order to customize the system and install basic programs for daily usage. +本教程适用于新手和在自己的电脑上安装好Ubuntu 15.04 “Vivid Vervet” 桌面之后为了自定义自己的系统并安装一些基本程序作为日常使用的已经做了一些准备的人。 ![Things to Do After Installing Ubuntu 15.04](http://www.tecmint.com/wp-content/uploads/2015/04/things-to-do-after-installing-ubuntu-15.04.jpeg) -15 Things to Do After Installing Ubuntu 15.04 +安装完Ubuntu 15.04桌面后要做的15件事 -### 1. Enable Ubuntu Extra Repositories and Update the System ### +### 1. 启用Ubuntu额外软件库并更新系统 ### -The first thing you should take care of after a fresh installation of Ubuntu is to enable Ubuntu Extra Repositories provided by official Canonical Partners and keep an up-to-date system with the last security patches and software updates. +在刚装好Ubuntu之后你应该要关心的第一件事是启用官方合作伙伴提供的Ubuntu额外软件库并且通过最近一次的安全补丁和软件更新来保持系统是最新状态。 -In order to accomplish this step, open from the left Launcher System Settings -> Software and Updates utility and check all Ubuntu Software and Other Software (Canonical Partners) repositories. After you finish hit the Close button and wait for the utility to Reload the cache sources tree. +要完成这一步,In order to accomplish this step, open from the left Launcher System Settings -> Software and Updates utility and check all Ubuntu Software and Other Software (Canonical Partners) repositories. After you finish hit the Close button and wait for the utility to Reload the cache sources tree. ![Software Updates](http://www.tecmint.com/wp-content/uploads/2015/04/Software-Updates.jpg) Software Updates @@ -26,7 +25,7 @@ For a fast and smooth update process, open a Terminal and issue the following co ![Ubuntu Upgrade](http://www.tecmint.com/wp-content/uploads/2015/04/Ubuntu-Upgrade.jpg) Ubuntu Upgrade -### 2. Install Additional Drivers ### +### 2. 安装额外驱动 ### In order for the system to scan and install additional hardware proprietary drivers, open Software and Updates utility from System Settings, go to Additional Drivers tab and wait for the utility to scan for drivers. From 232d893ebf3bc688bee2003d91b0232a4598dfdf Mon Sep 17 00:00:00 2001 From: wwy-hust Date: Tue, 12 May 2015 13:01:17 +0800 Subject: [PATCH 002/965] establish translated file --- ...basics terminology http headers and caching strategies.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 translated/tech/2015-04-29 web caching basics terminology http headers and caching strategies.md diff --git a/translated/tech/2015-04-29 web caching basics terminology http headers and caching strategies.md b/translated/tech/2015-04-29 web caching basics terminology http headers and caching strategies.md new file mode 100644 index 0000000000..e149266918 --- /dev/null +++ b/translated/tech/2015-04-29 web caching basics terminology http headers and caching strategies.md @@ -0,0 +1,5 @@ +WebHTTPͷͻ +===================================================================== + +### + From 8d1f4c09f5c4607c416c74402402a9e6974bbdd2 Mon Sep 17 00:00:00 2001 From: wwy-hust Date: Tue, 12 May 2015 17:33:11 +0800 Subject: [PATCH 003/965] part of translation --- ...ogy http headers and caching strategies.md | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/translated/tech/2015-04-29 web caching basics terminology http headers and caching strategies.md b/translated/tech/2015-04-29 web caching basics terminology http headers and caching strategies.md index e149266918..2d428484ab 100644 --- a/translated/tech/2015-04-29 web caching basics terminology http headers and caching strategies.md +++ b/translated/tech/2015-04-29 web caching basics terminology http headers and caching strategies.md @@ -3,3 +3,54 @@ Web ### +վķ˵ܻݻûЧķʽ֮һ棬߶֮ǰʱ洢HTTPЭʵĵݷַ֮һַ·еԻٺڶĻԡ + +ָУǽһЩWebݻĻҪѡ񻺴Ա֤ΧڵĻܹȷĴݡǽ̸һ̸ĺôáԼͬIJܴܺԵϡ + +ʲôǻ棿 +------------ + +Ǵ洢ԴԱӿ಻ͬ͵Ļ棬ÿֶص㣬Ӧó򻺴ڴ滺ضظļ٣ܳá + +Web棬ָϵģһֲͬ͵Ļ档WebHTTPЭһԣСû֪ϵͳӦٶȡݴӷĴУÿ涼ҵӰ + +WebضĹ򻺴ӦHTTPĻظڻݵĺֱɻ·Web + +ô +---- + +ЧĻ漼ûݵṩߡһЩݷַĺôУ + +- **翪**ݿڴṩߵ·֮಻ͬĵط档ھ߸ĵطʱڻĴڣ󽫲ĶԴ + +- **ӿӦٶ**òDZģʹݵĻñø졣ھûĵطά棬ʹݵĻȡ˲ʱġ + +- **ͬӲٶ**ڱԭʼݵķ˵ܿͨĻԴӲѹեӵǿý·ǿķӦijݸصij + +- **жʱɿ**ʹijֲԣԱ֤ݶûĿãܵԭʼijʱڱòá + + +---- + +ԻʱܶһЩ̫ܲϤһЩ£ + +- **ԭʼ**ԭʼݵԭʼŵص㡣WebԱĻΪκβܴӻеõݽлظҸݵĻԡ + +- ****һЧջʽжǿԴӻеõݵıʡʸζкܸ߱ݿԴӻлáͨǴԱҪĽ + +- **ʶ**ʶһеĿǷʺϷظͻˡеֻɻָʶʱڲŻᱻء + +- ****иݻԵʶѹڵݡڵݱΪ"¾"ͨݲڻظͻ˵󡣱´ԭʼµݻ֤ǷȻ׼ȷ + +- **У**еĹݿԱ֤ЧԱˢ¹ʱ䡣֤̰ϵԭʼԼ黺Ƿɴİ汾 + +- **ʧЧ**ʧЧݹڴӻƳݵĹ̡ԭʼѱı䲢һйڵݻᵼ¿ͻǩʱDZġ + +ĻЩӦܰ㿪ʼ + +ʲôܱ棿 +------------- + + + + From 00d94167474fce1972fcfef1717d06689b565b13 Mon Sep 17 00:00:00 2001 From: wwy-hust Date: Tue, 12 May 2015 18:21:00 +0800 Subject: [PATCH 004/965] another part of translatiokn --- ...ogy http headers and caching strategies.md | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/translated/tech/2015-04-29 web caching basics terminology http headers and caching strategies.md b/translated/tech/2015-04-29 web caching basics terminology http headers and caching strategies.md index 2d428484ab..a777d4f2c3 100644 --- a/translated/tech/2015-04-29 web caching basics terminology http headers and caching strategies.md +++ b/translated/tech/2015-04-29 web caching basics terminology http headers and caching strategies.md @@ -51,6 +51,37 @@ Web ʲôܱ棿 ------------- +ijЩضݱݸױ档Դվ˵һЩѺõ£ +- Logo̱ͼ +- ͨõķתͼ磬ͼ꣩ +- ʽ +- ͨJavascriptļ +- ص +- ýļ +Щļڲı䣬ԳʱĶǽлܻúô + +һЩĿڻбע⣺ + +- HTMLҳ +- תͼ +- ޸ĵJavascriptCSSļ +- ½cookiesʵ + +һЩݴӦñ棺 + +- ϢصԴݣȣ +- ûҾĵ + +ͨù⣬ͨҪָһЩԱڸõػ治ͬݡ磬½ûͬվͼӦκεطҳ档½ûһʱڿվûеͼӦûݵмκн黺ͼ + +Webݻλ +----------------- + +Webݻַ·е಻ͬĵص㱻棺 + +- **** +- **м仺** +- **򻺴** From fa3765e0a48a909680b0bb8adb06b4636dee8b9e Mon Sep 17 00:00:00 2001 From: wwy-hust Date: Tue, 12 May 2015 23:30:54 +0800 Subject: [PATCH 005/965] translate part of article --- ...ogy http headers and caching strategies.md | 32 +++++++++++++++++-- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/translated/tech/2015-04-29 web caching basics terminology http headers and caching strategies.md b/translated/tech/2015-04-29 web caching basics terminology http headers and caching strategies.md index a777d4f2c3..020881c9a3 100644 --- a/translated/tech/2015-04-29 web caching basics terminology http headers and caching strategies.md +++ b/translated/tech/2015-04-29 web caching basics terminology http headers and caching strategies.md @@ -81,7 +81,33 @@ Web Webݻַ·е಻ͬĵص㱻棺 -- **** -- **м仺** -- **򻺴** +- ****WebάһСͻ档͵أʹһֲָʾҪݡûصݻܻٴش۽ϸߡ +- **м仺**κڿͻ˺Ļܹ֮ķ԰һЩݡЩISPṩߣ֯ṩ +- **򻺴**ķܹΪ˵ķʵԼĻ档ʵ˻棬ôӴ㷵Ӧݶÿʹú˷ + +ЩλͨԸĻԺԴĻԻһЩӦݡ + +ͷ +-------- + +ͬءʵ屾ҪǷӦûɽܵݡֻ沿ֿԻݣܻ泬Ƶݡ + +ΪҪɻԾӵáЩҪضHTTPͷı + +ͬHTTPЭĵһЩͬľ۽ڻͷˣǵĸӶȸͬгЩҲӦעģ + +- **`Expires`**ʹ÷Χ൱ޣ`Expires`ͷǷdz˵ġͨһδʱ䣬ݻڴʱڡʱκζͬݵӦûصԭʼͷʺϻģʽfall back +- **`Cache-Control`**`Expires`һִ滻ѱܺõ֧֣ӵиʵ֡ڴУ`Expires`ãͬʱߵֵҲ޷Ժǽõ`Cache-Control`ϸѡ +- **`ETag`**`ETag`ڻ֤Դ״ηһʱΪṩһص`ETag`һҪ֤Ƿ񼴽ڣὫӦ`ETag`ͻطԴ߸߻һµģ߷͸ºݣµ`ETag` +- **`Last-Modified`**ͷָӦһα޸ĵʱ䡣ܻΪ֤ʶȵ֤Եһֱʹá +- **`Content-Length`**ܲûȷڻб漰`Content-Length`ͷûʱҪijЩǰ֪ݵĴС㹻ռ䣬ܾݡ +- **`Vary`**ϵͳͨʹ·Ϊ洢Դļ`Vary`ͷԱھһǷͬʱѻϵͳעһӵͷͨ߻ϵͳͬʹ`Accept-Encoding`ͷΪ˻ϵͳܹѹδѹݡ + +### Varyͷ + +`Vary`ͷṩ洢ͬһݲͬ汾ϡ˻ڡ + +`Accept-Encoding`İУ`Vary`ͷѹδѹӵоԵڷijЩܴѹݵʱҪԱ֤ʹá`Accept-Encoding``Vary`IJĺѡֵΪֻõֵһԡ + + From 4544fa955516dc4d182f66a7b5a09800eab7c79f Mon Sep 17 00:00:00 2001 From: wwy-hust Date: Wed, 13 May 2015 13:09:26 +0800 Subject: [PATCH 006/965] translate part of article --- ...ogy http headers and caching strategies.md | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/translated/tech/2015-04-29 web caching basics terminology http headers and caching strategies.md b/translated/tech/2015-04-29 web caching basics terminology http headers and caching strategies.md index 020881c9a3..ae7ab6f1a1 100644 --- a/translated/tech/2015-04-29 web caching basics terminology http headers and caching strategies.md +++ b/translated/tech/2015-04-29 web caching basics terminology http headers and caching strategies.md @@ -109,5 +109,31 @@ Web `Accept-Encoding`İУ`Vary`ͷѹδѹӵоԵڷijЩܴѹݵʱҪԱ֤ʹá`Accept-Encoding``Vary`IJĺѡֵΪֻõֵһԡ +`User-Agent`ͷһʼȥƶԱվṩ컯ķĺ⡣`User-Agent`ַǷDZ׼ġм仺жͬһݵ಻ͬ汾Ļ棬ᵼ»ʵĽ͡`Vary`ͷӦñصʹã߱Ƶм棨磬ݷַ磩ʹ׼ +Ʊ־Ӱ컺 +------------------------ +ᵽ`Cache-Control`ͷαִԱ׼಻ͬĻָܹͨͷ趨ָͬͨŽзַָ + +һЩʹõָʾݻԵ`Cache-Control`ѡ£ + +- **`no-cache`**ָָʾлµ󵽴ʱ֤ٷ͸ͻˡָʵʽ̱ΪڵģDZ֤֤Աݡ +- **`no-store`**ָָʾݲκηʽ档ʺڻظϢʱá +- **`public`**ݱΪеģζܱκмڵ㻺档ͨʹHTTP֤ظĬϱΪ`private``public`ǽḲá +- **`private`**ݱΪ˽еġ˽ݿԱû棬**κмڵ㻺档ͨûصݡ +- **`max-age`**ָʾ˻ݵڣںԴ֤ءִѡȡ`Expires`ͷҲΪݵʶȵĻѡֵΪλʾԱʾһʶȣ31536000룩 +- **`s-maxage`**ѡdz`max-age`ָܹʱ䡣ѡֻмڵĻЧѡԹĻԡ +- **`must-revalidate`**ָ`max-age``s-maxage``Expires`ͷָʶϢ뱻ϸء˻жϵƵijбʹá +- **`proxy-revalidate`**ѡһãֻӦмĴڵ㡣£ûжʱʹùݣмĻݲڴĿġ +- **`no-transform`**ѡ߻κ¶Ϊܵԭ޸Ľյݡζţ治ѹյݣûдԭʼչѹ汾ĸݣ͡ + +ЩѡܹԲͬķʽԻòͬĻΪһЩֵ£ + +- `no-cache``no-store`ԼǰΪᵽѡָijõĻΪ +- `public``private` + +`no-store``no-cache`ãô`no-store`ȡ`no-cache`ڷȨĻظ`public`áȨĻظ`private`ѡġǿͨ`Cache-Control`ͷָӦ෴ѡԸǡ + +һֻ +---------------- From c695d1f645c8448fe5ee7d464e58a7ca58602c45 Mon Sep 17 00:00:00 2001 From: GOLinux Date: Wed, 13 May 2015 14:31:45 +0800 Subject: [PATCH 007/965] [Translated]20150512 Linux FAQs with Answers--How to view torrent file content on Linux.md --- ...w to view torrent file content on Linux.md | 64 ------------------- ...w to view torrent file content on Linux.md | 62 ++++++++++++++++++ 2 files changed, 62 insertions(+), 64 deletions(-) delete mode 100644 sources/tech/20150512 Linux FAQs with Answers--How to view torrent file content on Linux.md create mode 100644 translated/tech/20150512 Linux FAQs with Answers--How to view torrent file content on Linux.md diff --git a/sources/tech/20150512 Linux FAQs with Answers--How to view torrent file content on Linux.md b/sources/tech/20150512 Linux FAQs with Answers--How to view torrent file content on Linux.md deleted file mode 100644 index 7f82ca2aa5..0000000000 --- a/sources/tech/20150512 Linux FAQs with Answers--How to view torrent file content on Linux.md +++ /dev/null @@ -1,64 +0,0 @@ -Translating by GOLinux! -Linux FAQs with Answers--How to view torrent file content on Linux -================================================================================ -> **Question**: I have a torrent file downloaded from the web. Is there a tool that allows me to view the content of a torrent on Linux? For example, I want to know what files are included inside a torrent. - -A torrent file (i.e., a file with **.torrent** extension) is a BitTorrent metadata file which stores information (e.g., tracker URLs, file list, sizes, checksums, creation date) needed by a BitTorrent client to download files shared on BitTorrent peer-to-peer networks. Inside a single torrent file, one or more files can be listed for sharing. - -The content of a torrent file is encoded with BEncode, the BitTorrent's data serialization format. Thus to view the content of a torrent file, you need a corresponding decoder. - -In fact, any GUI-based BitTorrent client (e.g., Transmission or uTorrent) is equipped with BEncode decoder, so can show to you the content of a torrent file by opening it. However, if you don't want to use any sort of BitTorrent client to check up on a torrent file, you can try a command-line torrent viewer called [dumptorrent][2]. - -The **dumptorrent** command prints the detailed content of a torrent file (e.g., file names, sizes, tracker URLs, creation date, info hash, etc.) by using a built-in BEncode decoder. - -### Install DumpTorrent on Linux ### - -To install dumptorrent on Linux, you can build it from the source. - -On Debian, Ubuntu or Linux Mint: - - $ sudo apt-get install gcc make - $ wget http://downloads.sourceforge.net/project/dumptorrent/dumptorrent/1.2/dumptorrent-1.2.tar.gz - $ tar -xvf dumptorrent-1.2.tar.gz - $ cd dumptorrent-1.2 - $ make - $ sudo cp dumptorrent /usr/local/bin - -On CentOS, Fedora or RHEL: - - $ sudo yum install gcc make - $ wget http://downloads.sourceforge.net/project/dumptorrent/dumptorrent/1.2/dumptorrent-1.2.tar.gz - $ tar -xvf dumptorrent-1.2.tar.gz - $ cd dumptorrent-1.2 - $ make - $ sudo cp dumptorrent /usr/local/bin - -Make sure that /usr/local/bin is [included][2] in your PATH. - -### View the Content of a Torrent ### - -To check the content of a torrent, simply run dumptorrent with a torrent file as an argument. This will print a summary of a torrent, including file names, sizes and tracker URL. - - $ dumptorrent - -![](https://farm8.staticflickr.com/7729/16816455904_b051e29972_b.jpg) - -To view the full content of a torrent, add "-v" option. This will print more detailed information of a torrent, including info-hash, piece length, creation date, creator, and full announce list. - - $ dumptorrent -v - -![](https://farm6.staticflickr.com/5331/17438628461_1f6675bd77_b.jpg) - --------------------------------------------------------------------------------- - -via: http://ask.xmodulo.com/view-torrent-file-content-linux.html - -作者:[Dan Nanni][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://ask.xmodulo.com/author/nanni -[1]:http://dumptorrent.sourceforge.net/ -[2]:http://ask.xmodulo.com/change-path-environment-variable-linux.html diff --git a/translated/tech/20150512 Linux FAQs with Answers--How to view torrent file content on Linux.md b/translated/tech/20150512 Linux FAQs with Answers--How to view torrent file content on Linux.md new file mode 100644 index 0000000000..8b5ba22907 --- /dev/null +++ b/translated/tech/20150512 Linux FAQs with Answers--How to view torrent file content on Linux.md @@ -0,0 +1,62 @@ +Linux有问必答——Linux上如何查看torrent文件内容 +================================================================================ +> **问题**: 我从网站上下载了一个torrent文件。Linux上有没有工具让我查看torrent文件的内容?例如,我想知道torrent里面都有什么文件。 + +torrent文件(也就是扩展名为**.torrent**的文件)是BitTorrent元数据文件,里面存储了BitTorrent客户端用来从BitTorrent点对点网络下载共享文件的信息(如,追踪器URL、文件列表、大小、校验和、创建日期等)。在单个torrent文件里面,可以列出一个或多个文件用于共享。 + +torrent文件内容由BEncode编码为BitTorrent数据序列化格式,因此,要查看torrent文件的内容,你需要相应的解码器。 + +事实上,任何图形化的BitTorrent客户端(如Transmission或uTorrent)都带有BEncode解码器,所以,你可以用它们直接打开来查看torrent文件的内容。然而,如果你不想要使用BitTorrent客户端来检查torrent文件,你可以试试这个命令行torrent查看器,它叫[dumptorrent][1]。 + +**dumptorrent**命令可以使用内建的BEncode解码器打印torrent文件的详细信息(如,文件名、大小、跟踪器URL、创建日期、信息散列等等)。 + +### 安装DumpTorrent到Linux ### + +要安装dumptorrent到Linux,你可以从源代码来构建它。 + +在Debian、Ubuntu或Linux Mint上: + + $ sudo apt-get install gcc make + $ wget http://downloads.sourceforge.net/project/dumptorrent/dumptorrent/1.2/dumptorrent-1.2.tar.gz + $ tar -xvf dumptorrent-1.2.tar.gz + $ cd dumptorrent-1.2 + $ make + $ sudo cp dumptorrent /usr/local/bin + +在CentOS、Fedora或RHEL上: + + $ sudo yum install gcc make + $ wget http://downloads.sourceforge.net/project/dumptorrent/dumptorrent/1.2/dumptorrent-1.2.tar.gz + $ tar -xvf dumptorrent-1.2.tar.gz + $ cd dumptorrent-1.2 + $ make + $ sudo cp dumptorrent /usr/local/bin + +确保你的路径中[包含][2]了/usr/local/bin。 + +### 查看torrent的内容 ### + +要检查torrent的内容,只需要运行dumptorrent,并将torrent文件作为参数执行。这会打印出torrent的概要,包括文件名、大小和跟踪器URL。 + + $ dumptorrent + +![](https://farm8.staticflickr.com/7729/16816455904_b051e29972_b.jpg) +要查看torrent的完整内容,请添加“-v”选项。它会打印更多关于torrent的详细信息,包括信息散列、片长度、创建日期、创建者,以及完整的声明列表。 + + $ dumptorrent -v + +![](https://farm6.staticflickr.com/5331/17438628461_1f6675bd77_b.jpg) + +-------------------------------------------------------------------------------- + +via: http://ask.xmodulo.com/view-torrent-file-content-linux.html + +作者:[Dan Nanni][a] +译者:[GOLinux](https://github.com/GOLinux) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://ask.xmodulo.com/author/nanni +[1]:http://dumptorrent.sourceforge.net/ +[2]:http://ask.xmodulo.com/change-path-environment-variable-linux.html From a49587f368f13f9115805398bce5359d3d890fe7 Mon Sep 17 00:00:00 2001 From: joeren Date: Wed, 13 May 2015 15:24:22 +0800 Subject: [PATCH 008/965] Update 20150511 OpenSSL command line Root and Intermediate CA including OCSP, CRL and revocation.md --- ...t and Intermediate CA including OCSP, CRL and revocation.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150511 OpenSSL command line Root and Intermediate CA including OCSP, CRL and revocation.md b/sources/tech/20150511 OpenSSL command line Root and Intermediate CA including OCSP, CRL and revocation.md index f584e31f11..dcabb0bc97 100644 --- a/sources/tech/20150511 OpenSSL command line Root and Intermediate CA including OCSP, CRL and revocation.md +++ b/sources/tech/20150511 OpenSSL command line Root and Intermediate CA including OCSP, CRL and revocation.md @@ -1,3 +1,4 @@ +Translating by GOLinux! OpenSSL command line Root and Intermediate CA including OCSP, CRL and revocation ================================================================================ These are quick and dirty notes on generating a certificate authority (CA), intermediate certificate authorities and end certificates using OpenSSL. It includes OCSP, CRL and CA Issuer information and specific issue and expiry dates. @@ -402,4 +403,4 @@ via: https://raymii.org/s/tutorials/OpenSSL_command_line_Root_and_Intermediate_C 译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID) -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 \ No newline at end of file +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 7c9db1180307a354efa4fea054306292e071ecfc Mon Sep 17 00:00:00 2001 From: GOLinux Date: Wed, 13 May 2015 16:22:37 +0800 Subject: [PATCH 009/965] [Translated]20150511 OpenSSL command line Root and Intermediate CA including OCSP, CRL and revocation.md --- ...e CA including OCSP, CRL and revocation.md | 107 +++++++++--------- 1 file changed, 53 insertions(+), 54 deletions(-) rename {sources => translated}/tech/20150511 OpenSSL command line Root and Intermediate CA including OCSP, CRL and revocation.md (77%) diff --git a/sources/tech/20150511 OpenSSL command line Root and Intermediate CA including OCSP, CRL and revocation.md b/translated/tech/20150511 OpenSSL command line Root and Intermediate CA including OCSP, CRL and revocation.md similarity index 77% rename from sources/tech/20150511 OpenSSL command line Root and Intermediate CA including OCSP, CRL and revocation.md rename to translated/tech/20150511 OpenSSL command line Root and Intermediate CA including OCSP, CRL and revocation.md index dcabb0bc97..b9b5748f7a 100644 --- a/sources/tech/20150511 OpenSSL command line Root and Intermediate CA including OCSP, CRL and revocation.md +++ b/translated/tech/20150511 OpenSSL command line Root and Intermediate CA including OCSP, CRL and revocation.md @@ -1,35 +1,35 @@ -Translating by GOLinux! -OpenSSL command line Root and Intermediate CA including OCSP, CRL and revocation +OpenSSL命令行生成根CA和中间CA,涵盖了OCSP、CRL和证书撤销 ================================================================================ -These are quick and dirty notes on generating a certificate authority (CA), intermediate certificate authorities and end certificates using OpenSSL. It includes OCSP, CRL and CA Issuer information and specific issue and expiry dates. -We'll set up our own root CA. We'll use the root CA to generate an example intermediate CA. We'll use the intermediate CA to sign end user certificates. +这些是关于使用OpenSSL生成证书授权(CA)、中间证书授权和末端证书的速记随笔,内容包括OCSP、CRL和CA颁发者信息,以及指定颁发和有效期限。 -### Root CA ### +我们将建立我们自己的根CA,我们将使用根CA来生成一个样例中间CA,我们将使用中间CA来签署末端用户证书。 -Create and move in to a folder for the root ca: +### 根CA ### + +创建根CA授权目录并切换到该目录: mkdir ~/SSLCA/root/ cd ~/SSLCA/root/ -Generate a 8192-bit long SHA-256 RSA key for our root CA: +为我们的根CA生成一个8192位长的SHA-256 RSA密钥: openssl genrsa -aes256 -out rootca.key 8192 -Example output: +样例输出: Generating RSA private key, 8192 bit long modulus .........++ ....................................................................................................................++ e is 65537 (0x10001) -If you want to password-protect this key, add the option `-aes256`. +如果你想要用密码保护该密钥,请添加`-aes256`选项。 -Create the self-signed root CA certificate `ca.crt`; you'll need to provide an identity for your root CA: +创建自颁发根CA证书`ca.crt`;你需要为你的根CA提供一个身份: openssl req -sha256 -new -x509 -days 1826 -key rootca.key -out rootca.crt -Example output: +样例输出: You are about to be asked to enter information that will be incorporated into your certificate request. @@ -46,13 +46,13 @@ Example output: Common Name (e.g. server FQDN or YOUR name) []:Sparkling Root CA Email Address []: -Create a few files where the CA will store it's serials: +创建存储CA序列的文件: touch certindex echo 1000 > certserial echo 1000 > crlnumber -Place the CA config file. This file has stubs for CRL and OCSP endpoints. +放置CA配置文件,该文件持有CRL和OCSP末端的存根。 # vim ca.conf [ ca ] @@ -121,23 +121,22 @@ Place the CA config file. This file has stubs for CRL and OCSP endpoints. OCSP;URI.0 = http://pki.sparklingca.com/ocsp/ OCSP;URI.1 = http://pki.backup.com/ocsp/ -If you need to set a specific certificate start / expiry date, add the following to `[myca]` +如果你需要设置某个特定的证书生效/过期日期,请添加以下内容到`[myca]` # format: YYYYMMDDHHMMSS default_enddate = 20191222035911 default_startdate = 20181222035911 -### Creating Intermediate 1 CA ### - -Generate the intermediate CA's private key: +### 创建中间1 CA ### +生成中间CA的私钥: openssl genrsa -out intermediate1.key 4096 -Generate the intermediate1 CA's CSR: +生成intermediate1 CA的CSR: openssl req -new -sha256 -key intermediate1.key -out intermediate1.csr -Example output: +样例输出: You are about to be asked to enter information that will be incorporated into your certificate request. @@ -159,13 +158,13 @@ Example output: A challenge password []: An optional company name []: -Make sure the subject (CN) of the intermediate is different from the root. +确保中间CA的主体(CN)和根CA不同。 -Sign the intermediate1 CSR with the Root CA: +用根CA签署intermediate1 CSR: openssl ca -batch -config ca.conf -notext -in intermediate1.csr -out intermediate1.crt -Example Output: +样例输出: Using configuration from ca.conf Check that the request matches the signature @@ -182,37 +181,37 @@ Example Output: Write out database with 1 new entries Data Base Updated -Generate the CRL (both in PEM and DER): +生成CRL(同时采用PEM和DER格式): openssl ca -config ca.conf -gencrl -keyfile rootca.key -cert rootca.crt -out rootca.crl.pem openssl crl -inform PEM -in rootca.crl.pem -outform DER -out rootca.crl -Generate the CRL after every certificate you sign with the CA. +每次使用该CA签署证书后,请生成CRL。 -If you ever need to revoke the this intermediate cert: +如果你需要撤销该中间证书: openssl ca -config ca.conf -revoke intermediate1.crt -keyfile rootca.key -cert rootca.crt -### Configuring the Intermediate CA 1 ### +### 配置中间CA 1 ### -Create a new folder for this intermediate and move in to it: +为该中间CA创建一个新文件夹,然后进入该文件夹: mkdir ~/SSLCA/intermediate1/ cd ~/SSLCA/intermediate1/ -Copy the Intermediate cert and key from the Root CA: +从根CA拷贝中间证书和密钥: cp ~/SSLCA/root/intermediate1.key ./ cp ~/SSLCA/root/intermediate1.crt ./ -Create the index files: +创建索引文件: touch certindex echo 1000 > certserial echo 1000 > crlnumber -Create a new `ca.conf` file: +创建一个新的`ca.conf`文件: # vim ca.conf [ ca ] @@ -270,35 +269,35 @@ Create a new `ca.conf` file: OCSP;URI.0 = http://pki.sparklingca.com/ocsp/ OCSP;URI.1 = http://pki.backup.com/ocsp/ -Change the `[alt_names]` section to whatever you need as Subject Alternative names. Remove it including the `subjectAltName = @alt_names` line if you don't want a Subject Alternative Name. +修改`[alt_names]`部分,添加你需要的主体备选名。如果你不需要主体备选名,请移除该部分包括`subjectAltName = @alt_names`的行。 -If you need to set a specific certificate start / expiry date, add the following to `[myca]` +如果你需要设置一个指定的生效/到期日期,请添加以下内容到`[myca]` # format: YYYYMMDDHHMMSS default_enddate = 20191222035911 default_startdate = 20181222035911 -Generate an empty CRL (both in PEM and DER): +生成一个空白CRL(同时以PEM和DER格式): openssl ca -config ca.conf -gencrl -keyfile rootca.key -cert rootca.crt -out rootca.crl.pem openssl crl -inform PEM -in rootca.crl.pem -outform DER -out rootca.crl -### Creating end user certificates ### +### 生成末端用户证书 ### -We use this new intermediate CA to generate an end user certificate. Repeat these steps for every end user certificate you want to sign with this CA. +我们使用这个新的中间CA来生成一个末端用户证书,请重复以下操作来使用该CA为每个用户签署。 mkdir enduser-certs -Generate the end user's private key: +生成末端用户的私钥: openssl genrsa -out enduser-certs/enduser-example.com.key 4096 -Generate the end user's CSR: +生成末端用户的CSR: openssl req -new -sha256 -key enduser-certs/enduser-example.com.key -out enduser-certs/enduser-example.com.csr -Example output: +样例输出: You are about to be asked to enter information that will be incorporated into your certificate request. @@ -320,11 +319,11 @@ Example output: A challenge password []: An optional company name []: -Sign the end user's CSR with the Intermediate 1 CA: +使用Intermediate 1 CA签署末端用户的CSR: openssl ca -batch -config ca.conf -notext -in enduser-certs/enduser-example.com.csr -out enduser-certs/enduser-example.com.crt -Example output: +样例输出: Using configuration from ca.conf Check that the request matches the signature @@ -341,56 +340,56 @@ Example output: Write out database with 1 new entries Data Base Updated -Generate the CRL (both in PEM and DER): +生成CRL(同时以PEM和DER格式): openssl ca -config ca.conf -gencrl -keyfile intermediate1.key -cert intermediate1.crt -out intermediate1.crl.pem openssl crl -inform PEM -in intermediate1.crl.pem -outform DER -out intermediate1.crl -Generate the CRL after every certificate you sign with the CA. +每次你使用该CA签署证书后,都需要生成CRL。 -If you ever need to revoke the this end users cert: +如果你需要撤销该末端用户证书: openssl ca -config ca.conf -revoke enduser-certs/enduser-example.com.crt -keyfile intermediate1.key -cert intermediate1.crt -Example output: +样例输出: Using configuration from ca.conf Revoking Certificate 1000. Data Base Updated -Create the certificate chain file by concatenating the Root and intermediate 1 certificates together. +通过联结根证书和intermediate 1证书来创建证书链文件。 cat ../root/rootca.crt intermediate1.crt > enduser-certs/enduser-example.com.chain -Send the following files to the end user: +发送以下文件给末端用户: enduser-example.com.crt enduser-example.com.key enduser-example.com.chain -You can also let the end user supply their own CSR and just send them the .crt file. Do not delete that from the server, otherwise you cannot revoke it. +你也可以只发送给他们.crt文件,让末端用户提供他们自己的CSR。不要把它从服务器删除,否则你就不能撤销了。 -### Validating the certificate ### +### 合法化证书 ### -You can validate the end user certificate against the chain using the following command: +你可以使用以下命令来针对链验证末端用户证书: openssl verify -CAfile enduser-certs/enduser-example.com.chain enduser-certs/enduser-example.com.crt enduser-certs/enduser-example.com.crt: OK -You can also validate it against the CRL. Concatenate the PEM CRL and the chain together first: +你也可以针对CRL来验证。首先,将PEM、CRL和链连结: cat ../root/rootca.crt intermediate1.crt intermediate1.crl.pem > enduser-certs/enduser-example.com.crl.chain -Verify the certificate: +验证证书: openssl verify -crl_check -CAfile enduser-certs/enduser-example.com.crl.chain enduser-certs/enduser-example.com.crt -Output when not revoked: +没有撤销时的输出: enduser-certs/enduser-example.com.crt: OK -Output when revoked: +撤销后的输出: enduser-certs/enduser-example.com.crt: CN = example.com, ST = Noord Holland, C = NL, O = Example Inc, OU = IT Dept error 23 at 0 depth lookup:certificate revoked @@ -400,7 +399,7 @@ Output when revoked: via: https://raymii.org/s/tutorials/OpenSSL_command_line_Root_and_Intermediate_CA_including_OCSP_CRL%20and_revocation.html 作者:Remy van Elst -译者:[译者ID](https://github.com/译者ID) +译者:[GOLinux](https://github.com/GOLinux) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From b3a9d43f6891c2adce41cdc5dddfd715a703126b Mon Sep 17 00:00:00 2001 From: wxy Date: Thu, 14 May 2015 00:26:56 +0800 Subject: [PATCH 010/965] PUB:20150511 OpenSSL command line Root and Intermediate CA including OCSP, CRL and revocation @GOLinux --- ...e CA including OCSP, CRL and revocation.md | 75 ++++++++++--------- 1 file changed, 38 insertions(+), 37 deletions(-) rename {translated/tech => published}/20150511 OpenSSL command line Root and Intermediate CA including OCSP, CRL and revocation.md (82%) diff --git a/translated/tech/20150511 OpenSSL command line Root and Intermediate CA including OCSP, CRL and revocation.md b/published/20150511 OpenSSL command line Root and Intermediate CA including OCSP, CRL and revocation.md similarity index 82% rename from translated/tech/20150511 OpenSSL command line Root and Intermediate CA including OCSP, CRL and revocation.md rename to published/20150511 OpenSSL command line Root and Intermediate CA including OCSP, CRL and revocation.md index b9b5748f7a..9bd388f67c 100644 --- a/translated/tech/20150511 OpenSSL command line Root and Intermediate CA including OCSP, CRL and revocation.md +++ b/published/20150511 OpenSSL command line Root and Intermediate CA including OCSP, CRL and revocation.md @@ -1,18 +1,18 @@ -OpenSSL命令行生成根CA和中间CA,涵盖了OCSP、CRL和证书撤销 +建立你自己的 CA 服务:OpenSSL 命令行 CA 操作快速指南 ================================================================================ -这些是关于使用OpenSSL生成证书授权(CA)、中间证书授权和末端证书的速记随笔,内容包括OCSP、CRL和CA颁发者信息,以及指定颁发和有效期限。 +这些是关于使用 OpenSSL 生成证书授权(CA)、中间证书授权和末端证书的速记随笔,内容包括 OCSP、CRL 和 CA 颁发者信息,以及指定颁发和有效期限等。 -我们将建立我们自己的根CA,我们将使用根CA来生成一个样例中间CA,我们将使用中间CA来签署末端用户证书。 +我们将建立我们自己的根 CA,我们将使用根 CA 来生成一个中间 CA 的例子,我们将使用中间 CA 来签署末端用户证书。 -### 根CA ### +### 根 CA ### -创建根CA授权目录并切换到该目录: +创建根 CA 授权目录并切换到该目录: mkdir ~/SSLCA/root/ cd ~/SSLCA/root/ -为我们的根CA生成一个8192位长的SHA-256 RSA密钥: +为我们的根 CA 生成一个8192位长的 SHA-256 RSA 密钥: openssl genrsa -aes256 -out rootca.key 8192 @@ -23,9 +23,9 @@ OpenSSL命令行生成根CA和中间CA,涵盖了OCSP、CRL和证书撤销 ....................................................................................................................++ e is 65537 (0x10001) -如果你想要用密码保护该密钥,请添加`-aes256`选项。 +如果你想要用密码保护该密钥,请添加 `-aes256` 选项。 -创建自颁发根CA证书`ca.crt`;你需要为你的根CA提供一个身份: +创建自签名根 CA 证书 `ca.crt`;你需要为你的根 CA 提供一个身份: openssl req -sha256 -new -x509 -days 1826 -key rootca.key -out rootca.crt @@ -46,13 +46,13 @@ OpenSSL命令行生成根CA和中间CA,涵盖了OCSP、CRL和证书撤销 Common Name (e.g. server FQDN or YOUR name) []:Sparkling Root CA Email Address []: -创建存储CA序列的文件: +创建一个存储 CA 序列的文件: touch certindex echo 1000 > certserial echo 1000 > crlnumber -放置CA配置文件,该文件持有CRL和OCSP末端的存根。 +放置 CA 配置文件,该文件持有 CRL 和 OCSP 末端的存根。 # vim ca.conf [ ca ] @@ -121,18 +121,19 @@ OpenSSL命令行生成根CA和中间CA,涵盖了OCSP、CRL和证书撤销 OCSP;URI.0 = http://pki.sparklingca.com/ocsp/ OCSP;URI.1 = http://pki.backup.com/ocsp/ -如果你需要设置某个特定的证书生效/过期日期,请添加以下内容到`[myca]` +如果你需要设置某个特定的证书生效/过期日期,请添加以下内容到`[myca]`: # format: YYYYMMDDHHMMSS default_enddate = 20191222035911 default_startdate = 20181222035911 -### 创建中间1 CA ### +### 创建中间 CA### + +生成中间 CA (名为 intermediate1)的私钥: -生成中间CA的私钥: openssl genrsa -out intermediate1.key 4096 -生成intermediate1 CA的CSR: +生成中间 CA 的 CSR: openssl req -new -sha256 -key intermediate1.key -out intermediate1.csr @@ -158,9 +159,9 @@ OpenSSL命令行生成根CA和中间CA,涵盖了OCSP、CRL和证书撤销 A challenge password []: An optional company name []: -确保中间CA的主体(CN)和根CA不同。 +确保中间 CA 的主体(CN)和根 CA 不同。 -用根CA签署intermediate1 CSR: +用根 CA 签署 中间 CA 的 CSR: openssl ca -batch -config ca.conf -notext -in intermediate1.csr -out intermediate1.crt @@ -181,26 +182,26 @@ OpenSSL命令行生成根CA和中间CA,涵盖了OCSP、CRL和证书撤销 Write out database with 1 new entries Data Base Updated -生成CRL(同时采用PEM和DER格式): +生成 CRL(同时采用 PEM 和 DER 格式): openssl ca -config ca.conf -gencrl -keyfile rootca.key -cert rootca.crt -out rootca.crl.pem openssl crl -inform PEM -in rootca.crl.pem -outform DER -out rootca.crl -每次使用该CA签署证书后,请生成CRL。 +每次使用该 CA 签署证书后,请生成 CRL。 如果你需要撤销该中间证书: openssl ca -config ca.conf -revoke intermediate1.crt -keyfile rootca.key -cert rootca.crt -### 配置中间CA 1 ### +### 配置中间 CA ### -为该中间CA创建一个新文件夹,然后进入该文件夹: +为该中间 CA 创建一个新文件夹,然后进入该文件夹: mkdir ~/SSLCA/intermediate1/ cd ~/SSLCA/intermediate1/ -从根CA拷贝中间证书和密钥: +从根 CA 拷贝中间证书和密钥: cp ~/SSLCA/root/intermediate1.key ./ cp ~/SSLCA/root/intermediate1.crt ./ @@ -211,7 +212,7 @@ OpenSSL命令行生成根CA和中间CA,涵盖了OCSP、CRL和证书撤销 echo 1000 > certserial echo 1000 > crlnumber -创建一个新的`ca.conf`文件: +创建一个新的 `ca.conf` 文件: # vim ca.conf [ ca ] @@ -269,15 +270,15 @@ OpenSSL命令行生成根CA和中间CA,涵盖了OCSP、CRL和证书撤销 OCSP;URI.0 = http://pki.sparklingca.com/ocsp/ OCSP;URI.1 = http://pki.backup.com/ocsp/ -修改`[alt_names]`部分,添加你需要的主体备选名。如果你不需要主体备选名,请移除该部分包括`subjectAltName = @alt_names`的行。 +修改 `[alt_names]` 部分,添加你需要的主体备选名。如果你不需要主体备选名,请移除该部分包括`subjectAltName = @alt_names`的行。 -如果你需要设置一个指定的生效/到期日期,请添加以下内容到`[myca]` +如果你需要设置一个指定的生效/到期日期,请添加以下内容到 `[myca]`: # format: YYYYMMDDHHMMSS default_enddate = 20191222035911 default_startdate = 20181222035911 -生成一个空白CRL(同时以PEM和DER格式): +生成一个空白 CRL(同时以 PEM 和 DER 格式): openssl ca -config ca.conf -gencrl -keyfile rootca.key -cert rootca.crt -out rootca.crl.pem @@ -285,7 +286,7 @@ OpenSSL命令行生成根CA和中间CA,涵盖了OCSP、CRL和证书撤销 ### 生成末端用户证书 ### -我们使用这个新的中间CA来生成一个末端用户证书,请重复以下操作来使用该CA为每个用户签署。 +我们使用这个新的中间 CA 来生成一个末端用户证书,请重复以下操作来使用该 CA 为每个用户签署。 mkdir enduser-certs @@ -293,7 +294,7 @@ OpenSSL命令行生成根CA和中间CA,涵盖了OCSP、CRL和证书撤销 openssl genrsa -out enduser-certs/enduser-example.com.key 4096 -生成末端用户的CSR: +生成末端用户的 CSR: openssl req -new -sha256 -key enduser-certs/enduser-example.com.key -out enduser-certs/enduser-example.com.csr @@ -319,7 +320,7 @@ OpenSSL命令行生成根CA和中间CA,涵盖了OCSP、CRL和证书撤销 A challenge password []: An optional company name []: -使用Intermediate 1 CA签署末端用户的CSR: +使用中间 CA 签署末端用户的 CSR: openssl ca -batch -config ca.conf -notext -in enduser-certs/enduser-example.com.csr -out enduser-certs/enduser-example.com.crt @@ -340,13 +341,13 @@ OpenSSL命令行生成根CA和中间CA,涵盖了OCSP、CRL和证书撤销 Write out database with 1 new entries Data Base Updated -生成CRL(同时以PEM和DER格式): +生成 CRL(同时以 PEM 和 DER 格式): openssl ca -config ca.conf -gencrl -keyfile intermediate1.key -cert intermediate1.crt -out intermediate1.crl.pem openssl crl -inform PEM -in intermediate1.crl.pem -outform DER -out intermediate1.crl -每次你使用该CA签署证书后,都需要生成CRL。 +每次你使用该 CA 签署证书后,都需要生成 CRL。 如果你需要撤销该末端用户证书: @@ -358,7 +359,7 @@ OpenSSL命令行生成根CA和中间CA,涵盖了OCSP、CRL和证书撤销 Revoking Certificate 1000. Data Base Updated -通过联结根证书和intermediate 1证书来创建证书链文件。 +通过连接根证书和中间证书来创建证书链文件。 cat ../root/rootca.crt intermediate1.crt > enduser-certs/enduser-example.com.chain @@ -368,16 +369,16 @@ OpenSSL命令行生成根CA和中间CA,涵盖了OCSP、CRL和证书撤销 enduser-example.com.key enduser-example.com.chain -你也可以只发送给他们.crt文件,让末端用户提供他们自己的CSR。不要把它从服务器删除,否则你就不能撤销了。 +你也可以让末端用户提供他们自己的 CSR,而只发送给他们这个 .crt 文件。不要把它从服务器删除,否则你就不能撤销了。 -### 合法化证书 ### +### 校验证书 ### -你可以使用以下命令来针对链验证末端用户证书: +你可以对证书链使用以下命令来验证末端用户证书: openssl verify -CAfile enduser-certs/enduser-example.com.chain enduser-certs/enduser-example.com.crt enduser-certs/enduser-example.com.crt: OK -你也可以针对CRL来验证。首先,将PEM、CRL和链连结: +你也可以针对 CRL 来验证。首先,将 PEM 格式的 CRL 和证书链相连接: cat ../root/rootca.crt intermediate1.crt intermediate1.crl.pem > enduser-certs/enduser-example.com.crl.chain @@ -389,7 +390,7 @@ OpenSSL命令行生成根CA和中间CA,涵盖了OCSP、CRL和证书撤销 enduser-certs/enduser-example.com.crt: OK -撤销后的输出: +撤销后的输出如下: enduser-certs/enduser-example.com.crt: CN = example.com, ST = Noord Holland, C = NL, O = Example Inc, OU = IT Dept error 23 at 0 depth lookup:certificate revoked @@ -400,6 +401,6 @@ via: https://raymii.org/s/tutorials/OpenSSL_command_line_Root_and_Intermediate_C 作者:Remy van Elst 译者:[GOLinux](https://github.com/GOLinux) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From d8de7d35fe33d2060f2ee5112b5b5e3be22acf3c Mon Sep 17 00:00:00 2001 From: wxy Date: Thu, 14 May 2015 00:37:26 +0800 Subject: [PATCH 011/965] PUB:20150323 How to enable ssh login without entering password @KayGuoWhu --- ...50323 How to enable ssh login without entering password.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20150323 How to enable ssh login without entering password.md (89%) diff --git a/translated/tech/20150323 How to enable ssh login without entering password.md b/published/20150323 How to enable ssh login without entering password.md similarity index 89% rename from translated/tech/20150323 How to enable ssh login without entering password.md rename to published/20150323 How to enable ssh login without entering password.md index 4f9a4c317d..8202bc62cd 100644 --- a/translated/tech/20150323 How to enable ssh login without entering password.md +++ b/published/20150323 How to enable ssh login without entering password.md @@ -16,7 +16,7 @@ $ cat .ssh/id_rsa.pub | ssh aliceB@hostB 'cat >> .ssh/authorized_keys' -自此以后,从aliceA@hostA上ssh到aliceB@hostB上再也不需要输入密码。 +自此以后,从aliceA@hostA上ssh到aliceB@hostB上再也不需要输入密码。(LCTT 译注:上述的创建目录并复制的操作也可以通过一个 ssh-copy-id 命令一步完成:`ssh-copy-id -i ~/.ssh/id_rsa.pub aliceB@hostB`) ### 疑难解答 ### @@ -34,7 +34,7 @@ via: http://xmodulo.com/how-to-enable-ssh-login-without.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/) 荣誉推出 From 9528c205d0eaf0c795e18e7b5e03c4a973470a68 Mon Sep 17 00:00:00 2001 From: wxy Date: Thu, 14 May 2015 06:47:51 +0800 Subject: [PATCH 012/965] PUB:20150506 Linux FAQs with Answers--How to configure a Linux bridge with Network Manager on Ubuntu @wi-cuckoo --- ...x bridge with Network Manager on Ubuntu.md | 86 ++++++++++++++++ ...x bridge with Network Manager on Ubuntu.md | 98 ------------------- 2 files changed, 86 insertions(+), 98 deletions(-) create mode 100644 published/20150506 Linux FAQs with Answers--How to configure a Linux bridge with Network Manager on Ubuntu.md delete mode 100644 translated/tech/20150506 Linux FAQs with Answers--How to configure a Linux bridge with Network Manager on Ubuntu.md diff --git a/published/20150506 Linux FAQs with Answers--How to configure a Linux bridge with Network Manager on Ubuntu.md b/published/20150506 Linux FAQs with Answers--How to configure a Linux bridge with Network Manager on Ubuntu.md new file mode 100644 index 0000000000..b1ff96e30b --- /dev/null +++ b/published/20150506 Linux FAQs with Answers--How to configure a Linux bridge with Network Manager on Ubuntu.md @@ -0,0 +1,86 @@ +Linux 有问必答:如何在Ubuntu上配置网桥 +=============================================================================== +> **Question**: 我需要在我的Ubuntu主机上建立一个Linux网桥,共享一个网卡给其他一些虚拟主机或在主机上创建的容器。我目前正在Ubuntu上使用网络管理器(Network Manager),所以最好>能使用网络管理器来配置一个网桥。我该怎么做? + +网桥是一个硬件装备,用来将两个或多个数据链路层(OSI七层模型中第二层)互联,以使得不同网段上的网络设备可以互相访问。当你想要互联一个主机里的多个虚拟机器或者以太接口时,就需要在Linux主机里有一个类似桥接的概念。这里使用的是一种软网桥。 + +有很多的方法来配置一个Linux网桥。举个例子,在一个无外接显示/键盘的服务器环境里,你可以使用[brct][1]手动地配置一个网桥。而在桌面环境下,在网络管理器里也支持网桥设置。那就让我们测试一下如何用网络管理器配置一个网桥吧。 + +### 要求 ### + +为了避免[任何问题][2],建议你的网络管理器版本为0.9.9或者更高,它用在 Ubuntu 15.04或者更新的版本。 + + $ apt-cache show network-manager | grep Version + +---------- + + Version: 0.9.10.0-4ubuntu15.1 + Version: 0.9.10.0-4ubuntu15 + +### 创建一个网桥 ### + +使用网络管理器创建网桥最简单的方式就是通过nm-connection-editor。这款GUI(图形用户界面)的工具允许你傻瓜式地配置一个网桥。 + +首先,启动nm-connection-editor。 + + $ nm-connection-editor + +该编辑器的窗口会显示给你一个列表,列出目前配置好的网络连接。点击右上角的“添加”按钮,创建一个网桥。 + +![](https://farm9.staticflickr.com/8781/17139502730_c3ca920f7f.jpg) + +接下来,选择“Bridge”(网桥)作为连接类型。 + +![](https://farm9.staticflickr.com/8873/17301102406_4f75133391_z.jpg) + +现在,开始配置网桥,包括它的名字和所桥接的连接。如果没有创建过其他网桥,那么默认的网桥接口会被命名为bridge0。 + +回顾一下,创建网桥的目的是为了通过网桥共享你的以太网卡接口,所以你需要添加以太网卡接口到网桥。在图形界面添加一个新的“桥接的连接”可以实现上述目的。点击“Add”按钮。 + +![](https://farm9.staticflickr.com/8876/17327069755_52f1d81f37_z.jpg) + +选择“以太网”作为连接类型。 + +![](https://farm9.staticflickr.com/8832/17326664591_632a9001da_z.jpg) + +在“设备的 MAC 地址”区域,选择你想要从属于网桥的接口。本例中,假设该接口是eth0。 + +![](https://farm9.staticflickr.com/8842/17140820559_07a661f30c_z.jpg) + +点击“常规”标签,并且选中两个复选框,分别是“当其可用时自动连接到该网络”和“所有用户都可以连接到该网络”。 + +![](https://farm8.staticflickr.com/7776/17325199982_801290e172_z.jpg) + +切换到“IPv4 设置”标签,为网桥配置DHCP或者是静态IP地址。注意,你应该为从属的以太网卡接口eth0使用相同的IPv4设定。本例中,我们假设eth0是用过DHCP配置的。因此,此处选择“自动(DHCP)”。如果eth0被指定了一个静态IP地址,那么你也应该指定相同的IP地址给网桥。 + +![](https://farm8.staticflickr.com/7737/17140820469_99955cf916_z.jpg) + +最后,保存网桥的设置。 + +现在,你会看见一个新增的网桥连接被创建在“网络连接”窗口里。因为已经从属与网桥,以前配置好的有线连接 eth0 就不再需要了,所以去删除原来的有线连接吧。 + +![](https://farm9.staticflickr.com/8700/17140820439_272a6d5c4e.jpg) + +这时候,网桥连接会被自动激活。从指定给eth0的IP地址被网桥接管起,你将会暂时丢失一下连接。当IP地址赋给了网桥,你将会通过网桥连接回你的以太网卡接口。你可以通过“Network”设置确认一下。 + +![](https://farm8.staticflickr.com/7742/17325199902_9ceb67ddc1_c.jpg) + +同时,检查可用的接口。提醒一下,网桥接口必须已经取代了任何你的以太网卡接口拥有的IP地址。 + +![](https://farm8.staticflickr.com/7717/17327069605_6143f1bd6a_b.jpg) + +就这么多了,现在,网桥已经可以用了。 + +-------------------------------------------------------------------------------- + +via: http://ask.xmodulo.com/configure-linux-bridge-network-manager-ubuntu.html + +作者:[Dan Nanni][a] +译者:[wi-cuckoo](https://github.com/wi-cuckoo) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://ask.xmodulo.com/author/nanni +[1]:http://xmodulo.com/how-to-configure-linux-bridge-interface.html +[2]:https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/1273201 diff --git a/translated/tech/20150506 Linux FAQs with Answers--How to configure a Linux bridge with Network Manager on Ubuntu.md b/translated/tech/20150506 Linux FAQs with Answers--How to configure a Linux bridge with Network Manager on Ubuntu.md deleted file mode 100644 index ae99e20261..0000000000 --- a/translated/tech/20150506 Linux FAQs with Answers--How to configure a Linux bridge with Network Manager on Ubuntu.md +++ /dev/null @@ -1,98 +0,0 @@ -nux常见问题解答--如何在Ubuntu上使用网络管理配置一个Linux网桥 -=============================================================================== -> **Question**: 我需要在我的Ubuntu主机上建立一个Linux网桥,共享一个NIC给其他一些虚拟主机或者主机上创建的容器。我目前正在Ubunut上使用网络管理,所以最好>能使用网络管理来配置一个网桥。我该怎么做? - - -网桥是一个硬件装备,用来内部连接两个或多个数据链路层(OSI七层模型中第二层),所以使得不同段上的网络设备可以互相访问。当你想要内连多个虚拟机器或者一个>主机里的以太接口时,就需要在Linux主机里有一个类似桥接的概念。 - -有很多的方法来配置一个Linux网桥。举个例子,在一个无中心的服务器环境里,你可以使用[brct][1]手动地配置一个网桥。在桌面环境下,在网络管理里有建立网桥支持 -。那就让我们测试一下如何用网络管理配置一个网桥吧。 - -### 要求 ### - -为了避免[任何问题][2],建议你的网络管理版本为0.9.9或者更高,这主要为了配合Ubuntu15.05或者更新的版本。 - - $ apt-cache show network-manager | grep Version - ----------- - - Version: 0.9.10.0-4ubuntu15.1 - Version: 0.9.10.0-4ubuntu15 - -### 创建一个网桥 ### - -使用网络管理创建网桥最简单的方式就是通过nm-connection-editor。这款GUI(图形用户界面)的工具允许你傻瓜式地配置一个网桥。 - -首先,启动nm-connection-editor。 - - $ nm-connection-editor - -该编辑器的窗口会显示给你一个列表,关于目前配置好的网络连接。点击右上角的“Click”按钮,创建一个网桥。 - -![](https://farm9.staticflickr.com/8781/17139502730_c3ca920f7f.jpg) - -接下来,选择“Bridge”作为连接类型。 - -![](https://farm9.staticflickr.com/8873/17301102406_4f75133391_z.jpg) - -现在,开始配置网桥,包括它的名字和桥接。如果没有其他网桥被创建,那么默认的网桥接口会被命名为bridge0。 - -回顾一下,创建网桥的目的是为了通过网桥共享你的以太网卡接口。所以你需要添加以太网卡接口到网桥。在图形界面添加一个新的“bridged connection”可以实现上述目的。点击“Add”按钮。 - -![](https://farm9.staticflickr.com/8876/17327069755_52f1d81f37_z.jpg) - -选择“Ethernet”作为连接类型。 - -![](https://farm9.staticflickr.com/8832/17326664591_632a9001da_z.jpg) - -在“Device MAC address”区域,选择你想要控制的接口到bridge里。本例中,假设接口是eth0。 - -![](https://farm9.staticflickr.com/8842/17140820559_07a661f30c_z.jpg) - -点击“General”标签,并且选中两个复选框,分别是“Automatically connect to this network when it is available”和“All users may connect to this network”。 - -![](https://farm8.staticflickr.com/7776/17325199982_801290e172_z.jpg) - -保存更改。 - -现在,你会在网桥里看见一个新的从属连接被建立。 - -![](https://farm8.staticflickr.com/7674/17119624667_6966b1147e_z.jpg) - -点击网桥的“General”标签,并且确保最上面的两个复选框被选中了。 - -![](https://farm8.staticflickr.com/7715/17301102276_4266a1e41d_z.jpg) - -切换到“IPv4 Setting”标签,为网桥配置DHCP或者是静态IP地址。注意,你应该使用相同的IPv4设定作为从属的以太网卡接口eth0。本例中,我们假设eth0是用过DHCP配置的。因此,此处选择“Automatic(DHCP)”。如果eth0被指定了一个静态IP地址,那么你应该指定相同的IP地址给网桥。 - -![](https://farm8.staticflickr.com/7737/17140820469_99955cf916_z.jpg) - -最后,保存网桥的设置。 - -现在,你会看见一个额外的网桥连接被创建在“Network Connection”窗口里。你不再需要一个预先配置的有线连接,为着从属的eth0接口。所以去删除原来的有线连接吧。 - -![](https://farm9.staticflickr.com/8700/17140820439_272a6d5c4e.jpg) - -这时候,网桥连接会被自动激活。你将会暂时失去一个连接,从指定给eth0的IP地址被网桥接管。一旦IP地址指定给了网桥,你将会连接回你的以太网卡接口,通过网桥。你可以通过“Network”设置确认一下。 - -![](https://farm8.staticflickr.com/7742/17325199902_9ceb67ddc1_c.jpg) - -同时,检查可用的接口。提醒一下,网桥接口必须已经取代了任何通过你的以太网卡接口的IP地址。 - -![](https://farm8.staticflickr.com/7717/17327069605_6143f1bd6a_b.jpg) - -就这么多了,现在,网桥已经可以用了。 - --------------------------------------------------------------------------------- - -via: http://ask.xmodulo.com/configure-linux-bridge-network-manager-ubuntu.html - -作者:[Dan Nanni][a] -译者:[wi-cuckoo](https://github.com/wi-cuckoo) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://ask.xmodulo.com/author/nanni -[1]:http://xmodulo.com/how-to-configure-linux-bridge-interface.html -[2]:https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/1273201 From b704b551ae2071d1a23f6c3dcb91a6b67d3cb8ab Mon Sep 17 00:00:00 2001 From: joeren Date: Thu, 14 May 2015 08:31:55 +0800 Subject: [PATCH 013/965] Update 20150511 Fix Various Update Errors In Ubuntu 14.04.md --- .../tech/20150511 Fix Various Update Errors In Ubuntu 14.04.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150511 Fix Various Update Errors In Ubuntu 14.04.md b/sources/tech/20150511 Fix Various Update Errors In Ubuntu 14.04.md index a84fc1b061..b49a59aa57 100644 --- a/sources/tech/20150511 Fix Various Update Errors In Ubuntu 14.04.md +++ b/sources/tech/20150511 Fix Various Update Errors In Ubuntu 14.04.md @@ -1,3 +1,4 @@ +Translating by GOLinux! Fix Various Update Errors In Ubuntu 14.04 ================================================================================ ![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2014/09/Fix_Ubuntu_Update_Error.jpeg) @@ -148,4 +149,4 @@ via: http://itsfoss.com/fix-update-errors-ubuntu-1404/ [6]:http://itsfoss.com/solve-open-shared-object-file-quick-tip/ [7]:http://itsfoss.com/fix-ubuntu-install-error/ [8]:http://itsfoss.com/solve-gpg-error-signatures-verified-ubuntu/ -[9]:http://itsfoss.com/solve-badsig-error-quick-tip/ \ No newline at end of file +[9]:http://itsfoss.com/solve-badsig-error-quick-tip/ From 3df0de1eee408193553e3e6a16bdf2a2b48174bb Mon Sep 17 00:00:00 2001 From: GOLinux Date: Thu, 14 May 2015 09:44:53 +0800 Subject: [PATCH 014/965] [Translated]20150511 Fix Various Update Errors In Ubuntu 14.04.md --- ...x Various Update Errors In Ubuntu 14.04.md | 71 +++++++++---------- 1 file changed, 35 insertions(+), 36 deletions(-) rename {sources => translated}/tech/20150511 Fix Various Update Errors In Ubuntu 14.04.md (53%) diff --git a/sources/tech/20150511 Fix Various Update Errors In Ubuntu 14.04.md b/translated/tech/20150511 Fix Various Update Errors In Ubuntu 14.04.md similarity index 53% rename from sources/tech/20150511 Fix Various Update Errors In Ubuntu 14.04.md rename to translated/tech/20150511 Fix Various Update Errors In Ubuntu 14.04.md index b49a59aa57..3780b4f948 100644 --- a/sources/tech/20150511 Fix Various Update Errors In Ubuntu 14.04.md +++ b/translated/tech/20150511 Fix Various Update Errors In Ubuntu 14.04.md @@ -1,13 +1,12 @@ -Translating by GOLinux! -Fix Various Update Errors In Ubuntu 14.04 +修复Ubuntu 14.04中各种更新错误 ================================================================================ ![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2014/09/Fix_Ubuntu_Update_Error.jpeg) -Who hasn’t come across an error while doing an update in Ubuntu? Update errors are common and plenty in Ubuntu and other Linux distributions based on Ubuntu. These errors occur for various reasons and can be fixed easily. In this article, we shall see various types of frequently occurring update errors in Ubuntu and how to fix them. +在Ubuntu更新中,谁没有碰见个错误?在Ubuntu和其它基于Ubuntu的Linux发行版中,更新错误很常见,也为数不少。这些错误出现的原因多种多样,修复起来也很简单。在本文中,我们将见到Ubuntu中各种类型频繁发生的更新错误以及它们的修复方法。 -### Problem With MergeList ### +### 合并列表问题 ### -When you run update in terminal, you may encounter an error “[problem with MergeList][1]” like below: +当你在终端中运行更新命令时,你可能会碰到这个错误“[合并列表错误][1]”,就像下面这样: > E:Encountered a section with no Package: header, > @@ -15,14 +14,14 @@ When you run update in terminal, you may encounter an error “[problem with Mer > > E:The package lists or status file could not be parsed or opened.’ -To fix this error, use the following commands: +可以使用以下命令来修复该错误: sudo rm -r /var/lib/apt/lists/* sudo apt-get clean && sudo apt-get update -### Failed to download repository information -1 ### +### 下载仓库信息失败 -1 ### -There are actually two types of [failed to download repository information errors][2]. If your error read like this: +实际上,有两种类型的[下载仓库信息失败错误][2]。如果你的错误是这样的: > W:Failed to fetch bzip2:/var/lib/apt/lists/partial/in.archive.ubuntu.com_ubuntu_dists_oneiric_restricted_binary-i386_Packages Hash Sum mismatch, > @@ -30,88 +29,88 @@ There are actually two types of [failed to download repository information error > > E:Some index files failed to download. They have been ignored, or old ones used instead -Then you can use the following commands to fix it: +那么,你可以用以下命令修复: sudo rm -rf /var/lib/apt/lists/* sudo apt-get update -### Failed to download repository information -2 ### +### 下载仓库信息失败 -2 ### -Th other type of failed to download repository information error is because of outdated PPA. Usually, when you run Update Manager and see an error like this: +下载仓库信息失败的另外一种类型是由于PPA过时导致的。通常,当你运行更新管理器,并看到这样的错误时: ![](Th other type of failed to download repository information error is because of outdated PPA. Usually, when you run Update Manager and see an error like this:) -You can run sudo apt-get update to see what PPAs are failing. And you can remove it from the sources list. You can follow this screenshot guide to [fix failed to download repository information error][3]. +你可以运行sudo apt-get update来查看哪个PPA更新失败,你可以把它从源列表中删除。你可以按照这个截图指南来[修复下载仓库信息失败错误][3]。 -### Failed to download package files error ### +### 下载包文件失败错误 ### -A similar error is [failed to download package files error][4] like this: +一个类似的错误是[下载包文件失败错误][4],像这样: ![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2014/09/Ubuntu_Update_error.jpeg) -This can be easily fixed by changing the software sources to Main server. Go to Software & Updates and in there changed the download server to Main server: +该错误很容易修复,只需修改软件源为主服务器即可。转到软件和更新,在那里你可以修改下载服务器为主服务器: ![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2014/09/Change_server_Ubuntu.jpeg) -### Partial upgrade error ### +### 部分更新错误 ### -Running updates in terminal may throw this [partial upgrade error][5]: +在终端中运行更新会出现[部分更新错误][5]: > Not all updates can be installed > > Run a partial upgrade, to install as many updates as possible -Run the following command in terminal to fix this error: +在终端中运行以下命令来修复该错误: sudo apt-get install -f -### error while loading shared libraries ### +### 加载共享库时发生错误 ### -This is more of an installation error than update error. If you try to install a program from source code, you may encounter this error: +该错误更多是安装错误,而不是更新错误。如果尝试从源码安装程序,你可能会碰到这个错误: > error while loading shared libraries: > > cannot open shared object file: No such file or directory -This error can be fixed by running the following command in terminal: +该错误可以通过在终端中运行以下命令来修复: sudo /sbin/ldconfig -v -You can find more details on this [error while loading shared libraries][6]. +你可以在这里查找到更多详细内容[加载共享库时发生错误][6]。 -### Could not get lock /var/cache/apt/archives/lock ### +### 无法获取锁/var/cache/apt/archives/lock ### -This error happens when another program is using APT. Suppose you are installing some thing in Ubuntu Software Center and trying to run apt in terminal. +在另一个程序在使用APT时,会发生该错误。假定你正在Ubuntu软件中心安装某个东西,然后你又试着在终端中运行apt。 > E: Could not get lock /var/cache/apt/archives/lock – open (11: Resource temporarily unavailable) > > E: Unable to lock directory /var/cache/apt/archives/ -Normally, this should be fine if you close all other programs using apt but if the problem persists, use the following command: +通常,只要你把所有其它使用apt的程序关了,这个问题就会好的。但是,如果问题持续,可以使用以下命令: sudo rm /var/lib/apt/lists/lock -If the above command doesn’t work, try this command: +如果上面的命令不起作用,可以试试这个命令: sudo killall apt-get -More details about this error can be found [here][7]. +关于该错误的更多信息,可以在[这里][7]找到。 -### GPG error: The following signatures couldn’t be verified ### +### GPG错误: 下列签名无法验证 ### -Adding a PPA may result in the following [GPG error: The following signatures couldn’t be verified][8] when you try to run an update in terminal: +在添加一个PPA时,可能会导致以下错误[GPG错误: 下列签名无法验证][8],这通常发生在终端中运行更新时: > W: GPG error: http://repo.mate-desktop.org saucy InRelease: The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY 68980A0EA10B4DE8 -All we need to do is to fetch this public key in the system. Get the key number from the message. In the above message, the key is 68980A0EA10B4DE8. This key can be used in the following manner: +我们所要做的,就是获取系统中的这个公钥,从信息中获取密钥号。在上述信息中,密钥号为68980A0EA10B4DE8。该密钥可通过以下方式使用: sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 68980A0EA10B4DE8 -Once the key has been added, run an update again and it will be fine. +在添加密钥后,再次运行更新就没有问题了。 -### BADSIG error ### +### BADSIG错误 ### -Another signature related Ubuntu update error is [BADSIG error][9] which looks something like this: +另外一个与签名相关的Ubuntu更新错误是[BADSIG错误][9],它看起来像这样: > W: A error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://extras.ubuntu.com precise Release: The following signatures were invalid: BADSIG 16126D3A3E5C1192 Ubuntu Extras Archive Automatic Signing Key > @@ -119,7 +118,7 @@ Another signature related Ubuntu update error is [BADSIG error][9] which looks s > > The following signatures were invalid: BADSIG 4C1CBC1B69B0E2F4 Launchpad PPA for Jonathan French W: Failed to fetch http://extras.ubuntu.com/ubuntu/dists/precise/Release -To fix this BADSIG error, use the following commands in terminal: +要修复该BADSIG错误,请在终端中使用以下命令: sudo apt-get clean cd /var/lib/apt @@ -128,14 +127,14 @@ To fix this BADSIG error, use the following commands in terminal: sudo apt-get clean sudo apt-get update -That compiles the list of frequent **Ubuntu update errors** you may encounter. I hope this helps you to get rid of these errors. Have you encountered any other update error in Ubuntu as well? Do mention it in comments and I’ll try to do a quick tutorial on it. +本文汇集了你可能会碰到的**Ubuntu更新错误**,我希望这会对你处理这些错误有所帮助。你在Ubuntu中是否也碰到过其它更新错误呢?请在下面的评论中告诉我,我会试着写个快速指南。 -------------------------------------------------------------------------------- via: http://itsfoss.com/fix-update-errors-ubuntu-1404/ 作者:[Abhishek][a] -译者:[译者ID](https://github.com/译者ID) +译者:[GOLinux](https://github.com/GOLinux) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From f0a15bf383cf48d1aebe7f20589c4383ac9855ee Mon Sep 17 00:00:00 2001 From: Chang Liu Date: Thu, 14 May 2015 11:11:00 +0800 Subject: [PATCH 015/965] Translated 20150331 Conky---The Ultimate X Based System Monitor Application.md --- ...mate X Based System Monitor Application.md | 149 ------------------ ...mate X Based System Monitor Application.md | 146 +++++++++++++++++ 2 files changed, 146 insertions(+), 149 deletions(-) delete mode 100644 sources/tech/20150331 Conky--The Ultimate X Based System Monitor Application.md create mode 100644 translated/tech/20150331 Conky--The Ultimate X Based System Monitor Application.md diff --git a/sources/tech/20150331 Conky--The Ultimate X Based System Monitor Application.md b/sources/tech/20150331 Conky--The Ultimate X Based System Monitor Application.md deleted file mode 100644 index b54d6763d3..0000000000 --- a/sources/tech/20150331 Conky--The Ultimate X Based System Monitor Application.md +++ /dev/null @@ -1,149 +0,0 @@ -FSSlc translating - -Conky – The Ultimate X Based System Monitor Application -================================================================================ -Conky is a system monitor application written in ‘C’ Programming Language and released under GNU General Public License and BSD License. It is available for Linux and BSD Operating System. The application is X (GUI) based that was originally forked from [Torsmo][1]. - -#### Features #### - -- Simple User Interface -- Higher Degree of configuration -- It can show System stats using built-in objects (300+) as well as external scripts either on the desktop or in it’s own container. -- Low on Resource Utilization -- Shows system stats for a wide range of system variables which includes but not restricted to CPU, memory, swap, Temperature, Processes, Disk, Network, Battery, email, System messages, Music player, weather, breaking news, updates and blah..blah..blah -- Available in Default installation of OS like CrunchBang Linux and Pinguy OS. - -#### Lesser Known Facts about Conky #### - -- The Name conky was derived from a Canadian Television Show. -- It has already been ported to Nokia N900. -- It is no more maintained officially. - -### Conky Installation and Usage in Linux ### - -Before we install conky, we need to install packages like lm-sensors, curl and hddtemp using following command. - - # apt-get install lm-sensors curl hddtemp - -Time to detect-sensors. - - # sensors-detect - -**Note**: Answer ‘Yes‘ when prompted! - -Check all the detected sensors. - - # sensors - -#### Sample Output #### - - acpitz-virtual-0 - Adapter: Virtual device - temp1: +49.5°C (crit = +99.0°C) - - coretemp-isa-0000 - Adapter: ISA adapter - Physical id 0: +49.0°C (high = +100.0°C, crit = +100.0°C) - Core 0: +49.0°C (high = +100.0°C, crit = +100.0°C) - Core 1: +49.0°C (high = +100.0°C, crit = +100.0°C) - -Conky can be installed from repo as well as, can be compiled from source. - - # yum install conky [On RedHat systems] - # apt-get install conky-all [On Debian systems] - -**Note**: Before you install conky on Fedora/CentOS, you must have enabled [EPEL repository][2]. - -After conky has been installed, just issue following command to start it. - - $ conky & - -![Conky Monitor in Action](http://www.tecmint.com/wp-content/uploads/2015/03/Start-Conkey.jpeg) -Conky Monitor in Action - -It will run conky in a popup like window. It uses the basic conky configuration file located at /etc/conky/conky.conf. - -You may need to integrate conky with the desktop and won’t like a popup like window every-time. Here is what you need to do - -Copy the configuration file /etc/conky/conky.conf to your home directory and rename it as ‘`.conkyrc`‘. The dot (.) at the beginning ensures that the configuration file is hidden. - - $ cp /etc/conky/conky.conf /home/$USER/.conkyrc - -Now restart conky to take new changes. - - $ killall -SIGUSR1 conky - -![Conky Monitor Window](http://www.tecmint.com/wp-content/uploads/2015/03/Restart-Conky.jpeg) -Conky Monitor Window - -You may edit the conky configuration file located in your home dircetory. The configuration file is very easy to understand. - -Here is a sample configuration of conky. - -![Conky Configuration](http://www.tecmint.com/wp-content/uploads/2015/03/Conky-Configuration.jpeg) -Conky Configuration - -From the above window you can modify color, borders, size, scale, background, alignment and several other properties. By setting different alignments to different conky window, we can run more than one conky script at a time. - -**Using script other than the default for conky and where to find it?** - -You may write your own conky script or use one that is available over Internet. We don’t suggest you to use any script you find on the web which can be potentially dangerous unless you know what you are doing. However a few famous threads and pages have conky script that you can trust as mentioned below. - -- [http://ubuntuforums.org/showthread.php?t=281865][3] -- [http://conky.sourceforge.net/screenshots.html][4] - -At the above url, you will find every screenshot has a hyperlink, which will redirects to script file. - -#### Testing Conky Script #### - -Here I will be running a third party written conky-script on my Debian Jessie Machine, to test. - - $ wget https://github.com/alexbel/conky/archive/master.zip - $ unzip master.zip - -Change current working directory to just extracted directory. - - $ cd conky-master - -Rename the secrets.yml.example to secrets.yml. - - $ mv secrets.yml.example secrets.yml - -Install Ruby before you could run this (ruby) script. - - $ sudo apt-get install ruby - $ ruby starter.rb - -![Conky Fancy Look](http://www.tecmint.com/wp-content/uploads/2015/03/Conky-Fancy-Look.jpeg) -Conky Fancy Look - -**Note**: This script can be modified to show your current weather, temperature, etc. - -If you want to start conky at boot, add the below one liner to startup Applications. - - conky --pause 10 - save and exit. - -And Finally…such a lightweight and useful GUI eye candy like package is not in active stage and is not maintained officially anymore. The last stable release was conky 1.9.0 released on May 03, 2012. A thread on Ubuntu forum has gone over 2k pages of users sharing configuration. (link to forum : [http://ubuntuforums.org/showthread.php?t=281865/][5]) - -- [Conky Homepage][6] - -That’s all for now. Keep connected. Keep commenting. Share your thoughts and configuration in comments below. - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/install-conky-in-ubuntu-debian-fedora/ - -作者:[Avishek Kumar][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://www.tecmint.com/author/avishek/ -[1]:http://torsmo.sourceforge.net/ -[2]:http://www.tecmint.com/how-to-enable-epel-repository-for-rhel-centos-6-5/ -[3]:http://ubuntuforums.org/showthread.php?t=281865 -[4]:http://conky.sourceforge.net/screenshots.html -[5]:http://ubuntuforums.org/showthread.php?t=281865/ -[6]:http://conky.sourceforge.net/ diff --git a/translated/tech/20150331 Conky--The Ultimate X Based System Monitor Application.md b/translated/tech/20150331 Conky--The Ultimate X Based System Monitor Application.md new file mode 100644 index 0000000000..f6ab2f69ec --- /dev/null +++ b/translated/tech/20150331 Conky--The Ultimate X Based System Monitor Application.md @@ -0,0 +1,146 @@ +Conky - 终极的 X 视窗系统监视器应用 +================================================================================ +Conky 是一个用 ‘C’ 语言写就的系统监视器,并在 GNU 通用公共许可协议和 BSD 许可协议下发布,在 Linux 和 BSD 操作系统中都可以获取到它。这个应用是基于 X 视窗系统的,原本 fork 至 [Torsmo][1]。 + +#### 特点 #### + +- 简洁的用户界面; +- 高配置性; +- 它既可使用内置的部件(超过 300 多个) 也可使用外部脚本,来在桌面或其自有容器中展示系统的状态; +- 低资源消耗; +- 它可显示范围广泛的系统参数,包括但不限于 CPU,内存,swap 分区 ,温度,进程,磁盘使用情况,网络状态,电池电量,邮件收发,系统消息,音乐播放器的控制,天气信息,最新新闻,升级信息等等; +- 在许多操作系统中如 CrunchBang Linux 和 Pinguy OS 被默认安装; + +#### 关于 Conky 的少有人知的事实 #### + +- conky 这个名称来自于一个加拿大电视节目; +- 它已被移植到 Nokia N900 上; +- 它已不再被官方维护; + +### 在 Linux 中 Conky 的安装和使用 ### + +在我们安装 conky 之前,我们需要使用下面的命令来安装诸如 `lm-sensors`, `curl` 和 `hddtemp` 之类的软件包: + + # apt-get install lm-sensors curl hddtemp + +然后是检测传感器: + + # sensors-detect + +**注**: 在被系统提示时,回答 ‘Yes’ 。 + +检测所有探测到的传感器: + + # sensors + +#### 样例输出 #### + + acpitz-virtual-0 + Adapter: Virtual device + temp1: +49.5°C (crit = +99.0°C) + + coretemp-isa-0000 + Adapter: ISA adapter + Physical id 0: +49.0°C (high = +100.0°C, crit = +100.0°C) + Core 0: +49.0°C (high = +100.0°C, crit = +100.0°C) + Core 1: +49.0°C (high = +100.0°C, crit = +100.0°C) + +Conky 既可以从软件仓库中安装,也可从源代码编译得到: + + # yum install conky [在 RedHat 系的系统上] + # apt-get install conky-all [在 Debian 系的系统上] + +**注**: 在 Fedora/CentOS 上安装 conky 之前,你必须启用 [EPEL 软件仓库][2]。 + +在安装完 conky 之后,只需输入如下命令来开启它: + + $ conky & + +![正在运行的 Conky 监视器](http://www.tecmint.com/wp-content/uploads/2015/03/Start-Conkey.jpeg) +正在运行的 Conky 监视器 + +这使得 conky 以一个弹窗的形式运行,并使用位于 `/etc/conky/conky.conf` 的 conky 基本配置文件。 + +你可能想将 conky 集成到桌面上,并不想让它每次以弹窗的形式出现,下面就是你需要做的: + +将配置文件 `/etc/conky/conky.conf` 复制到你的家目录中,并将它重命名为 `.conkyrc`,开头的点号 (.) 是为了确保这个配置文件是隐藏的。 + + $ cp /etc/conky/conky.conf /home/$USER/.conkyrc + +现在重启 conky 来应用新的更改: + + $ killall -SIGUSR1 conky + +![Conky 监视器窗口](http://www.tecmint.com/wp-content/uploads/2015/03/Restart-Conky.jpeg) +Conky 监视器窗口 + +你可能想编辑位于你家目录的 conky 的配置文件,这个配置文件的内容是非常容易理解的。 + +下面是 conky 配置文件的一个样例: + +![Conky 的配置](http://www.tecmint.com/wp-content/uploads/2015/03/Conky-Configuration.jpeg) +Conky 的配置 + +从上面的窗口中,你可以更改颜色,边框,大小,缩放比例,背景,对齐方式及几个其他属性。通过为不同的 conky 窗口设定不同的对齐方式,我们可以同时运行超过一个 conky 脚本。 + +**为 conky 使用脚本而不是默认配置以及如何找到这些脚本?** + +你可以编写你自己的 conky 脚本或使用来自于互联网的脚本;我们并不建议你使用你从互联网中找到的具有潜在危险的任何脚本,除非你清楚你正在做什么。然而,有一些著名的主题和网页包含可信赖的 conky 脚本,例如下面所提及的: + +- [http://ubuntuforums.org/showthread.php?t=281865][3] +- [http://conky.sourceforge.net/screenshots.html][4] + +在上面的 URL 地址中,你将发现每个截图都有一个超链接,它们将重定向到脚本文件。 + +#### 测试 Conky 脚本 #### + +这里我将在我的 Debian Jessie 机子中运行一个由第三方写的 conky 脚本,以此来进行测试: + + $ wget https://github.com/alexbel/conky/archive/master.zip + $ unzip master.zip + +切换当前工作目录到刚才解压的目录: + + $ cd conky-master + +将 `secrets.yml.example` 重命名为 `secrets.yml`: + + $ mv secrets.yml.example secrets.yml + +在你能够运行这个(ruby)脚本之前安装 Ruby: + + $ sudo apt-get install ruby + $ ruby starter.rb + +![华丽的 conky 外观](http://www.tecmint.com/wp-content/uploads/2015/03/Conky-Fancy-Look.jpeg) +华丽的 conky 外观 + +**注**: 这个脚本可以被修改以展示你当前的天气,温度等; + +假如你想让 conky 开机自启,请在开机启动应用设置(startup Applications) 中添加如下的几行命令: + + conky --pause 10 + save and exit. + +最后。。。 如此轻量级且吸引眼球的实用 GUI 软件包不再处于激活状态且官方不再进行维护了。最新的稳定发布版本为 conky 1.9.0, 于 2012 年 5 月 3 号发布。在 Ubuntu 论坛上,一个有关用户分享 conky 配置的主题已经超过了 2000 多页。(这个论坛主题的链接为: [http://ubuntuforums.org/showthread.php?t=281865/][5]) + +- [Conky 主页][6] + +这就是全部内容了。保持联系,保持评论。请在下面的评论框里分享你的想法和配置。 +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/install-conky-in-ubuntu-debian-fedora/ + +作者:[Avishek Kumar][a] +译者:[FSSlc](https://github.com/FSSlc) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/avishek/ +[1]:http://torsmo.sourceforge.net/ +[2]:http://www.tecmint.com/how-to-enable-epel-repository-for-rhel-centos-6-5/ +[3]:http://ubuntuforums.org/showthread.php?t=281865 +[4]:http://conky.sourceforge.net/screenshots.html +[5]:http://ubuntuforums.org/showthread.php?t=281865/ +[6]:http://conky.sourceforge.net/ From 96a3c977dfa278976eff2eb5ab779c6a54ee1787 Mon Sep 17 00:00:00 2001 From: Chang Liu Date: Thu, 14 May 2015 11:19:32 +0800 Subject: [PATCH 016/965] Update 20150507 Install uGet Download Manager 2.0 in Debian Ubuntu Linux Mint and Fedora.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 准备翻译该篇。 --- ...load Manager 2.0 in Debian Ubuntu Linux Mint and Fedora.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150507 Install uGet Download Manager 2.0 in Debian Ubuntu Linux Mint and Fedora.md b/sources/tech/20150507 Install uGet Download Manager 2.0 in Debian Ubuntu Linux Mint and Fedora.md index 611fdea333..c9f54a8185 100644 --- a/sources/tech/20150507 Install uGet Download Manager 2.0 in Debian Ubuntu Linux Mint and Fedora.md +++ b/sources/tech/20150507 Install uGet Download Manager 2.0 in Debian Ubuntu Linux Mint and Fedora.md @@ -1,3 +1,5 @@ +FSSlc translating + Install uGet Download Manager 2.0 in Debian, Ubuntu, Linux Mint and Fedora ================================================================================ After a long development period, which includes more than 11 developement releases, finally uGet project team pleased to announce the immediate availability of the latest stable version of uGet 2.0. The latest version includes numerous attractive features, such as a new setting dialog, improved BitTorrent and Metalink support added in the aria2 plugin, as well as better support for uGet RSS messages in the banner, other features include: @@ -131,4 +133,4 @@ via: http://www.tecmint.com/install-uget-download-manager-in-linux/ [2]:http://ugetdm.com/downloads [3]:http://www.tecmint.com/install-aria2-a-multi-protocol-command-line-download-manager-in-rhel-centos-fedora/ [4]:http://ugetdm.com/downloads-aria2 -[5]:http://ugetdm.com/downloads \ No newline at end of file +[5]:http://ugetdm.com/downloads From 162b28c95ae9ccff51f9fd0f1e9389c14b23c94f Mon Sep 17 00:00:00 2001 From: wwy-hust Date: Thu, 14 May 2015 12:46:37 +0800 Subject: [PATCH 017/965] finish translation, need review by meself --- ...ogy http headers and caching strategies.md | 60 +++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/translated/tech/2015-04-29 web caching basics terminology http headers and caching strategies.md b/translated/tech/2015-04-29 web caching basics terminology http headers and caching strategies.md index ae7ab6f1a1..d32242f3b9 100644 --- a/translated/tech/2015-04-29 web caching basics terminology http headers and caching strategies.md +++ b/translated/tech/2015-04-29 web caching basics terminology http headers and caching strategies.md @@ -137,3 +137,63 @@ Web һֻ ---------------- + +£κݶԱĻ棬ķֻҪżṩһЩ֤ݼɡʵкٷӦóһЩǵĻԣڳڻվıﵽƽ⡣ + + +### + +Уݱķʽÿû̬IJݵԣеݣЩݲӦñ档һЩԱûʱԵⲿδڣ°汾Ѿ + +ЩǾ⣬ǻӰ컺ܺṩݵ׼ȷԡȻǿͨǰԤЩĻЩ⡣ + +### һ㽨 + +ʵָѡĻԣĽܰһЩľ + +ʹһضͷ֮ǰһЩضIJ԰ᵽĻʡһЩ£ + +- **ΪͼCSS͹ݽضļ**ݷŵضļʹԷĴվеκҳЩݡ +- **ʹͬURLʾͬ**ڻʹе·ΪӦ֤ҳеĸݵ÷ʽͬǰһ +- **ʹCSSͼ**ͼ͵ݣʹCSSͼܹȾҳҪԾ黺ܳһʱ䡣 +- **ܽűⲿԴػ**ʹJavascriptűⲿԴûṩʵĻͷôӦǽЩݷԼķϡӦעεκθ£Ա±صĿ +- **ԻռļժҪ**̬ݱCSSJavascriptļͨȽʺռļժҪζΪļһصı־ͨļĹϣֵļ޸ĺƿ汣֤µݱ»ȡкܶ๤߿԰ļժҪ޸HTMLĵеá + +ڲͬļȷѡͬͷ£ݿΪһԵIJο + +- **еĻ洢һ**̬ԼûصӦڷַнڵ㱻档ʹмڵԽݻظû +- **ûص**ÿûݣͨûԼлǿԱġûܹʹûڽܹ˲ʱȡЩݲʺκмڵ㻺档 +- **ʱеΪ**ʱеģôοӦýЩΪԱ֤ڵݲڹؼ±ʹá磬վһﳵӦ̷ӦﳵƷݵص㣬`Cache-Control`ͷʹ`no-cache``no-store`ѡ +- **ṩ֤**֤ʹùڵݿضõˢ¡`ETag``Last-Modified`ͷԭʼ֤ݣδ޸ʱˢ¸ʶԼٸء +- **ֵ֧ó**Ϊ˸Чû棬һЩΪ֧ԵӦñýϳڡͨȽʺͼCSSûȾHTMLҳݡļժҪһӳڽ泤ʱĴ洢ЩԴԴı䣬޸ĵļժҪʹЧµݵءʱµֵ֧ݻ档 +- **Ըö̵**ΪʹǰģʽӦӦö̵ڣòȫ档ͨЭʹõHTMLҳ档HTMLҳ潫ᱻƵأʹܿٵӦı䡣֧Ե˿ԱĻ档 + +ؼ֮ڴﵽƽ⣬һԼĽл棬һΪδıݵĻᡣı䷢ʱվӦͬʱУ + +- ػ +- ӵж̵ڵĻݣԱ֤ +- ȫ + +ĿıǽݾܵƶһࣨĻ棩еͬʱάֿԽܵĻʡ + + +---- + +ʱȷվʹ˺ʵĻԽվҪӰ졣ʹԱ֤ͬݵͬʱٴʹáķ˿ԿͬӲҪǣͻվлø飬ʹǸԸƵķʡЧWeb沢úʵĻԻʹСĴۻÿɹ۵ջ + +--- + +: [Justin Ellingwood](https://www.digitalocean.com/community/users/jellingwood) + +ߣ[wwy-hust](https://github.com/wwy-hust) + +Уԣ[УID](https://github.com/УID) + +Ƽ[royaso](https://github.com/royaso) + +via: https://www.digitalocean.com/community/tutorials/web-caching-basics-terminology-http-headers-and-caching-strategies + + [LCTT](https://github.com/LCTT/TranslateProject) ԭ룬[Linuxй](http://linux.cn/) Ƴ + + + From 25df49614557f8d75d9f88997638f88461165c83 Mon Sep 17 00:00:00 2001 From: wwy-hust Date: Thu, 14 May 2015 13:19:34 +0800 Subject: [PATCH 018/965] finish review and deleted the origin from sources --- ...ogy http headers and caching strategies.md | 446 ------------------ ...ogy http headers and caching strategies.md | 49 +- 2 files changed, 24 insertions(+), 471 deletions(-) delete mode 100644 sources/tech/2015-04-29 web caching basics terminology http headers and caching strategies.md diff --git a/sources/tech/2015-04-29 web caching basics terminology http headers and caching strategies.md b/sources/tech/2015-04-29 web caching basics terminology http headers and caching strategies.md deleted file mode 100644 index 07fd4fcd42..0000000000 --- a/sources/tech/2015-04-29 web caching basics terminology http headers and caching strategies.md +++ /dev/null @@ -1,446 +0,0 @@ -translating by wwy-hust - -Web Caching Basics: Terminology, HTTP Headers, and Caching Strategies -===================================================================== - -### Introduction - -Intelligent content caching is one of the most effective ways to improve -the experience for your site's visitors. Caching, or temporarily storing -content from previous requests, is part of the core content delivery -strategy implemented within the HTTP protocol. Components throughout the -delivery path can all cache items to speed up subsequent requests, -subject to the caching policies declared for the content. - -In this guide, we will discuss some of the basic concepts of web content -caching. This will mainly cover how to select caching policies to ensure -that caches throughout the internet can correctly process your content. -We will talk about the benefits that caching affords, the side effects -to be aware of, and the different strategies to employ to provide the -best mixture of performance and flexibility. - -What Is Caching? ----------------- - -Caching is the term for storing reusable responses in order to make -subsequent requests faster. There are many different types of caching -available, each of which has its own characteristics. Application caches -and memory caches are both popular for their ability to speed up certain -responses. - -Web caching, the focus of this guide, is a different type of cache. Web -caching is a core design feature of the HTTP protocol meant to minimize -network traffic while improving the perceived responsiveness of the -system as a whole. Caches are found at every level of a content's -journey from the original server to the browser. - -Web caching works by caching the HTTP responses for requests according -to certain rules. Subsequent requests for cached content can then be -fulfilled from a cache closer to the user instead of sending the request -all the way back to the web server. - -Benefits --------- - -Effective caching aids both content consumers and content providers. -Some of the benefits that caching brings to content delivery are: - -- **Decreased network costs**: Content can be cached at various points - in the network path between the content consumer and content origin. - When the content is cached closer to the consumer, requests will not - cause much additional network activity beyond the cache. -- **Improved responsiveness**: Caching enables content to be retrieved - faster because an entire network round trip is not necessary. Caches - maintained close to the user, like the browser cache, can make this - retrieval nearly instantaneous. -- **Increased performance on the same hardware**: For the server where - the content originated, more performance can be squeezed from the - same hardware by allowing aggressive caching. The content owner can - leverage the powerful servers along the delivery path to take the - brunt of certain content loads. -- **Availability of content during network interruptions**: With - certain policies, caching can be used to serve content to end users - even when it may be unavailable for short periods of time from the - origin servers. - -Terminology ------------ - -When dealing with caching, there are a few terms that you are likely to -come across that might be unfamiliar. Some of the more common ones are -below: - -- **Origin server**: The origin server is the original location of the - content. If you are acting as the web server administrator, this is - the machine that you control. It is responsible for serving any - content that could not be retrieved from a cache along the request - route and for setting the caching policy for all content. -- **Cache hit ratio**: A cache's effectiveness is measured in terms of - its cache hit ratio or hit rate. This is a ratio of the requests - able to be retrieved from a cache to the total requests made. A high - cache hit ratio means that a high percentage of the content was able - to be retrieved from the cache. This is usually the desired outcome - for most administrators. -- **Freshness**: Freshness is a term used to describe whether an item - within a cache is still considered a candidate to serve to a client. - Content in a cache will only be used to respond if it is within the - freshness time frame specified by the caching policy. -- **Stale content**: Items in the cache expire according to the cache - freshness settings in the caching policy. Expired content is - "stale". In general, expired content cannot be used to respond to - client requests. The origin server must be re-contacted to retrieve - the new content or at least verify that the cached content is still - accurate. -- **Validation**: Stale items in the cache can be validated in order - to refresh their expiration time. Validation involves checking in - with the origin server to see if the cached content still represents - the most recent version of item. -- **Invalidation**: Invalidation is the process of removing content - from the cache before its specified expiration date. This is - necessary if the item has been changed on the origin server and - having an outdated item in cache would cause significant issues for - the client. - -There are plenty of other caching terms, but the ones above should help -you get started. - -What Can be Cached? -------------------- - -Certain content lends itself more readily to caching than others. Some -very cache-friendly content for most sites are: - -- Logos and brand images -- Non-rotating images in general (navigation icons, for example) -- Style sheets -- General Javascript files -- Downloadable Content -- Media Files - -These tend to change infrequently, so they can benefit from being cached -for longer periods of time. - -Some items that you have to be careful in caching are: - -- HTML pages -- Rotating images -- Frequently modified Javascript and CSS -- Content requested with authentication cookies - -Some items that should almost never be cached are: - -- Assets related to sensitive data (banking info, etc.) -- Content that is user-specific and frequently changed - -In addition to the above general rules, it's possible to specify -policies that allow you to cache different types of content -appropriately. For instance, if authenticated users all see the same -view of your site, it may be possible to cache that view anywhere. If -authenticated users see a user-sensitive view of the site that will be -valid for some time, you may tell the user's browser to cache, but tell -any intermediary caches not to store the view. - -Locations Where Web Content Is Cached -------------------------------------- - -Content can be cached at many different points throughout the delivery -chain: - -- **Browser cache**: Web browsers themselves maintain a small cache. - Typically, the browser sets a policy that dictates the most - important items to cache. This may be user-specific content or - content deemed expensive to download and likely to be requested - again. -- **Intermediary caching proxies**: Any server in between the client - and your infrastructure can cache certain content as desired. These - caches may be maintained by ISPs or other independent parties. -- **Reverse Cache**: Your server infrastructure can implement its own - cache for backend services. This way, content can be served from the - point-of-contact instead of hitting backend servers on each request. - -Each of these locations can and often do cache items according to their -own caching policies and the policies set at the content origin. - -Caching Headers ---------------- - -Caching policy is dependent upon two different factors. The caching -entity itself gets to decide whether or not to cache acceptable content. -It can decide to cache less than it is allowed to cache, but never more. - -The majority of caching behavior is determined by the caching policy, -which is set by the content owner. These policies are mainly articulated -through the use of specific HTTP headers. - -Through various iterations of the HTTP protocol, a few different -cache-focused headers have arisen with varying levels of sophistication. -The ones you probably still need to pay attention to are below: - -- **`Expires`**: The `Expires` header is very straight-forward, - although fairly limited in scope. Basically, it sets a time in the - future when the content will expire. At this point, any requests for - the same content will have to go back to the origin server. This - header is probably best used only as a fall back. -- **`Cache-Control`**: This is the more modern replacement for the - `Expires` header. It is well supported and implements a much more - flexible design. In almost all cases, this is preferable to - `Expires`, but it may not hurt to set both values. We will discuss - the specifics of the options you can set with `Cache-Control` a bit - later. -- **`Etag`**: The `Etag` header is used with cache validation. The - origin can provide a unique `Etag` for an item when it initially - serves the content. When a cache needs to validate the content it - has on-hand upon expiration, it can send back the `Etag` it has for - the content. The origin will either tell the cache that the content - is the same, or send the updated content (with the new `Etag`). -- **`Last-Modified`**: This header specifies the last time that the - item was modified. This may be used as part of the validation - strategy to ensure fresh content. -- **`Content-Length`**: While not specifically involved in caching, - the `Content-Length` header is important to set when defining - caching policies. Certain software will refuse to cache content if - it does not know in advanced the size of the content it will need to - reserve space for. -- **`Vary`**: A cache typically uses the requested host and the path - to the resource as the key with which to store the cache item. The - `Vary` header can be used to tell caches to pay attention to an - additional header when deciding whether a request is for the same - item. This is most commonly used to tell caches to key by the - `Accept-Encoding` header as well, so that the cache will know to - differentiate between compressed and uncompressed content. - -### An Aside about the Vary Header - -The `Vary` header provides you with the ability to store different -versions of the same content at the expense of diluting the entries in -the cache. - -In the case of `Accept-Encoding`, setting the `Vary` header allows for a -critical distinction to take place between compressed and uncompressed -content. This is needed to correctly serve these items to browsers that -cannot handle compressed content and is necessary in order to provide -basic usability. One characteristic that tells you that -`Accept-Encoding` may be a good candidate for `Vary` is that it only has -two or three possible values. - -Items like `User-Agent` might at first glance seem to be a good way to -differentiate between mobile and desktop browsers to serve different -versions of your site. However, since `User-Agent` strings are -non-standard, the result will likely be many versions of the same -content on intermediary caches, with a very low cache hit ratio. The -`Vary` header should be used sparingly, especially if you do not have -the ability to normalize the requests in intermediate caches that you -control (which may be possible, for instance, if you leverage a content -delivery network). - -How Cache-Control Flags Impact Caching --------------------------------------- - -Above, we mentioned how the `Cache-Control` header is used for modern -cache policy specification. A number of different policy instructions -can be set using this header, with multiple instructions being separated -by commas. - -Some of the `Cache-Control` options you can use to dictate your -content's caching policy are: - -- **`no-cache`**: This instruction specifies that any cached content - must be re-validated on each request before being served to a - client. This, in effect, marks the content as stale immediately, but - allows it to use revalidation techniques to avoid re-downloading the - entire item again. -- **`no-store`**: This instruction indicates that the content cannot - be cached in any way. This is appropriate to set if the response - represents sensitive data. -- **`public`**: This marks the content as public, which means that it - can be cached by the browser and any intermediate caches. For - requests that utilized HTTP authentication, responses are marked - `private` by default. This header overrides that setting. -- **`private`**: This marks the content as `private`. Private content - may be stored by the user's browser, but must *not* be cached by any - intermediate parties. This is often used for user-specific data. -- **`max-age`**: This setting configures the maximum age that the - content may be cached before it must revalidate or re-download the - content from the origin server. In essence, this replaces the - `Expires` header for modern browsing and is the basis for - determining a piece of content's freshness. This option takes its - value in seconds with a maximum valid freshness time of one year - (31536000 seconds). -- **`s-maxage`**: This is very similar to the `max-age` setting, in - that it indicates the amount of time that the content can be cached. - The difference is that this option is applied only to intermediary - caches. Combining this with the above allows for more flexible - policy construction. -- **`must-revalidate`**: This indicates that the freshness information - indicated by `max-age`, `s-maxage` or the `Expires` header must be - obeyed strictly. Stale content cannot be served under any - circumstance. This prevents cached content from being used in case - of network interruptions and similar scenarios. -- **`proxy-revalidate`**: This operates the same as the above setting, - but only applies to intermediary proxies. In this case, the user's - browser can potentially be used to serve stale content in the event - of a network interruption, but intermediate caches cannot be used - for this purpose. -- **`no-transform`**: This option tells caches that they are not - allowed to modify the received content for performance reasons under - any circumstances. This means, for instance, that the cache is not - able to send compressed versions of content it did not receive from - the origin server compressed and is not allowed. - -These can be combined in different ways to achieve various caching -behavior. Some mutually exclusive values are: - -- `no-cache`, `no-store`, and the regular caching behavior indicated - by absence of either -- `public` and `private` - -The `no-store` option supersedes the `no-cache` if both are present. For -responses to unauthenticated requests, `public` is implied. For -responses to authenticated requests, `private` is implied. These can be -overridden by including the opposite option in the `Cache-Control` -header. - -Developing a Caching Strategy ------------------------------ - -In a perfect world, everything could be cached aggressively and your -servers would only be contacted to validate content occasionally. This -doesn't often happen in practice though, so you should try to set some -sane caching policies that aim to balance between implementing long-term -caching and responding to the demands of a changing site. - -### Common Issues - -There are many situations where caching cannot or should not be -implemented due to how the content is produced (dynamically generated -per user) or the nature of the content (sensitive banking information, -for example). Another problem that many administrators face when setting -up caching is the situation where older versions of your content are out -in the wild, not yet stale, even though new versions have been -published. - -These are both frequently encountered issues that can have serious -impacts on cache performance and the accuracy of content you are -serving. However, we can mitigate these issues by developing caching -policies that anticipate these problems. - -### General Recommendations - -While your situation will dictate the caching strategy you use, the -following recommendations can help guide you towards some reasonable -decisions. - -There are certain steps that you can take to increase your cache hit -ratio before worrying about the specific headers you use. Some ideas -are: - -- **Establish specific directories for images, css, and shared - content**: Placing content into dedicated directories will allow you - to easily refer to them from any page on your site. -- **Use the same URL to refer to the same items**: Since caches key - off of both the host and the path to the content requested, ensure - that you refer to your content in the same way on all of your pages. - The previous recommendation makes this significantly easier. -- **Use CSS image sprites where possible**: CSS image sprites for - items like icons and navigation decrease the number of round trips - needed to render your site and allow your site to cache that single - sprite for a long time. -- **Host scripts and external resources locally where possible**: If - you utilize javascript scripts and other external resources, - consider hosting those resources on your own servers if the correct - headers are not being provided upstream. Note that you will have to - be aware of any updates made to the resource upstream so that you - can update your local copy. -- **Fingerprint cache items**: For static content like CSS and - Javascript files, it may be appropriate to fingerprint each item. - This means adding a unique identifier to the filename (often a hash - of the file) so that if the resource is modified, the new resource - name can be requested, causing the requests to correctly bypass the - cache. There are a variety of tools that can assist in creating - fingerprints and modifying the references to them within HTML - documents. - -In terms of selecting the correct headers for different items, the -following can serve as a general reference: - -- **Allow all caches to store generic assets**: Static content and - content that is not user-specific can and should be cached at all - points in the delivery chain. This will allow intermediary caches to - respond with the content for multiple users. -- **Allow browsers to cache user-specific assets**: For per-user - content, it is often acceptable and useful to allow caching within - the user's browser. While this content would not be appropriate to - cache on any intermediary caching proxies, caching in the browser - will allow for instant retrieval for users during subsequent visits. -- **Make exceptions for essential time-sensitive content**: If you - have content that is time-sensitive, make an exception to the above - rules so that the out-dated content is not served in critical - situations. For instance, if your site has a shopping cart, it - should reflect the items in the cart immediately. Depending on the - nature of the content, the `no-cache` or `no-store` options can be - set in the `Cache-Control` header to achieve this. -- **Always provide validators**: Validators allow stale content to be - refreshed without having to download the entire resource again. - Setting the `Etag` and the `Last-Modified` headers allow caches to - validate their content and re-serve it if it has not been modified - at the origin, further reducing load. -- **Set long freshness times for supporting content**: In order to - leverage caching effectively, elements that are requested as - supporting content to fulfill a request should often have a long - freshness setting. This is generally appropriate for items like - images and CSS that are pulled in to render the HTML page requested - by the user. Setting extended freshness times, combined with - fingerprinting, allows caches to store these resources for long - periods of time. If the assets change, the modified fingerprint will - invalidate the cached item and will trigger a download of the new - content. Until then, the supporting items can be cached far into the - future. -- **Set short freshness times for parent content**: In order to make - the above scheme work, the containing item must have relatively - short freshness times or may not be cached at all. This is typically - the HTML page that calls in the other assisting content. The HTML - itself will be downloaded frequently, allowing it to respond to - changes rapidly. The supporting content can then be cached - aggressively. - -The key is to strike a balance that favors aggressive caching where -possible while leaving opportunities to invalidate entries in the future -when changes are made. Your site will likely have a combination of: - -- Aggressively cached items -- Cached items with a short freshness time and the ability to - re-validate -- Items that should not be cached at all - -The goal is to move content into the first categories when possible -while maintaining an acceptable level of accuracy. - -Conclusion ----------- - -Taking the time to ensure that your site has proper caching policies in -place can have a significant impact on your site. Caching allows you to -cut down on the bandwidth costs associated with serving the same content -repeatedly. Your server will also be able to handle a greater amount of -traffic with the same hardware. Perhaps most importantly, clients will -have a faster experience on your site, which may lead them to return -more frequently. While effective web caching is not a silver bullet, -setting up appropriate caching policies can give you measurable gains -with minimal work. - - ---- - -作者: [Justin Ellingwood](https://www.digitalocean.com/community/users/jellingwood) - -译者:[译者ID](https://github.com/译者ID) - -校对:[校对者ID](https://github.com/校对者ID) - -推荐:[royaso](https://github.com/royaso) - -via: https://www.digitalocean.com/community/tutorials/web-caching-basics-terminology-http-headers-and-caching-strategies - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - - diff --git a/translated/tech/2015-04-29 web caching basics terminology http headers and caching strategies.md b/translated/tech/2015-04-29 web caching basics terminology http headers and caching strategies.md index d32242f3b9..1b04873445 100644 --- a/translated/tech/2015-04-29 web caching basics terminology http headers and caching strategies.md +++ b/translated/tech/2015-04-29 web caching basics terminology http headers and caching strategies.md @@ -3,9 +3,9 @@ Web ### -վķ˵ܻݻûЧķʽ֮һ棬߶֮ǰʱ洢HTTPЭʵĵݷַ֮һַ·еԻٺڶĻԡ +վķ˵ܻݻûЧķʽ֮һ棬߶֮ǰʱ洢HTTPЭʵĵݷַ֮һַ·еԻٺڶԸĻԡ -ָУǽһЩWebݻĻҪѡ񻺴Ա֤ΧڵĻܹȷĴݡǽ̸һ̸ĺôáԼͬIJܴܺԵϡ +ָУǽһЩWebݻĻҪѡ񻺴Ա֤ΧڵĻܹȷĴݡǽ̸һ̸ĺôԼͬIJܴܺԵϡ ʲôǻ棿 ------------ @@ -19,7 +19,7 @@ Web ô ---- -ЧĻ漼ûݵṩߡһЩݷַĺôУ +ЧĻ漼ûݵṩߡݷַĺôУ - **翪**ݿڴṩߵ·֮಻ͬĵط档ھ߸ĵطʱڻĴڣ󽫲ĶԴ @@ -27,7 +27,7 @@ Web - **ͬӲٶ**ڱԭʼݵķ˵ܿͨĻԴӲѹեӵǿý·ǿķӦijݸصij -- **жʱɿ**ʹijֲԣԱ֤ݶûĿãܵԭʼijʱڱòá +- **жʱɿ**ʹijֲԣԱ֤ԭʼòʱӦݶûɿá ---- @@ -36,20 +36,20 @@ Web - **ԭʼ**ԭʼݵԭʼŵص㡣WebԱĻΪκβܴӻеõݽлظҸݵĻԡ -- ****һЧջʽжǿԴӻеõݵıʡʸζкܸ߱ݿԴӻлáͨǴԱҪĽ +- ****һЧջʽжǿԴӻеõݵıʡʸζкܸ߱ݿԴӻлáͨǴԱҪĽ -- **ʶ**ʶһеĿǷʺϷظͻˡеֻɻָʶʱڲŻᱻء +- **ʶ**ʶһеĿǷʺϷظͻˡеֻɻָڲŻᱻء -- ****иݻԵʶѹڵݡڵݱΪ"¾"ͨݲڻظͻ˵󡣱´ԭʼµݻ֤ǷȻ׼ȷ +- ****иݻԵѹڵݡڵݱΪ¾ɡͨݲڻظͻ˵󡣱´ԭʼµݻ֤ǷȻ׼ȷ - **У**еĹݿԱ֤ЧԱˢ¹ʱ䡣֤̰ϵԭʼԼ黺Ƿɴİ汾 -- **ʧЧ**ʧЧݹڴӻƳݵĹ̡ԭʼѱı䲢һйڵݻᵼ¿ͻǩʱDZġ +- **ʧЧ**ʧЧݹڴӻƳݵĹ̡ԭʼѱı䲢һйڵݻᵼ¿ͻ˵ǩʱDZġ -ĻЩӦܰ㿪ʼ +ĻЩӦܰʼ ʲôܱ棿 -------------- +-------------- ijЩضݱݸױ档Դվ˵һЩѺõ£ @@ -74,7 +74,7 @@ Web - ϢصԴݣȣ - ûҾĵ -ͨù⣬ͨҪָһЩԱڸõػ治ͬݡ磬½ûͬվͼӦκεطҳ档½ûһʱڿվûеͼӦûݵмκн黺ͼ +ͨù⣬ͨҪָһЩԱڸõػ治ͬݡ磬½ûͬվͼӦκεطҳ档½ûһʱڿվûеͼӦûݶӦκнڵ㻺ͼ Webݻλ ----------------- @@ -92,9 +92,9 @@ Web ͬءʵ屾ҪǷӦûɽܵݡֻ沿ֿԻݣܻ泬Ƶݡ -ΪҪɻԾӵáЩҪضHTTPͷı +ΪҪɻԾӵáЩҪͨضHTTPͷر -ͬHTTPЭĵһЩͬľ۽ڻͷˣǵĸӶȸͬгЩҲӦעģ +ͬHTTPЭĵһЩͬľ۽ڻͷˣǵĸӶȸͬгЩҲӦעģ - **`Expires`**ʹ÷Χ൱ޣ`Expires`ͷǷdz˵ġͨһδʱ䣬ݻڴʱڡʱκζͬݵӦûصԭʼͷʺϻģʽfall back - **`Cache-Control`**`Expires`һִ滻ѱܺõ֧֣ӵиʵ֡ڴУ`Expires`ãͬʱߵֵҲ޷Ժǽõ`Cache-Control`ϸѡ @@ -105,11 +105,11 @@ Web ### Varyͷ -`Vary`ͷṩ洢ͬһݲͬ汾ϡ˻ڡ +`Vary`ͷṩ洢ͬһݵIJͬ汾ϡ˻ڡ -`Accept-Encoding`İУ`Vary`ͷѹδѹӵоԵڷijЩܴѹݵʱҪԱ֤ʹá`Accept-Encoding``Vary`IJĺѡֵΪֻõֵһԡ +`Accept-Encoding`İУ`Vary`ͷѹδѹӵоԵڷijЩܴѹݵʱҪԱ֤ʹá`Accept-Encoding``Vary`IJĺѡֵΪֻѡֵ -`User-Agent`ͷһʼȥƶԱվṩ컯ķĺ⡣`User-Agent`ַǷDZ׼ġм仺жͬһݵ಻ͬ汾Ļ棬ᵼ»ʵĽ͡`Vary`ͷӦñصʹã߱Ƶм棨磬ݷַ磩ʹ׼ +`User-Agent`ͷһʼȥƶԱվṩ컯ķĺ⡣`User-Agent`ַǷDZ׼ģм仺жͬһݵ಻ͬ汾Ļ棬ᵼ»ʵĽ͡`Vary`ͷӦñصʹã߱Ƶм棨磬ݷַ磩ʹ׼ Ʊ־Ӱ컺 ------------------------ @@ -120,9 +120,9 @@ Web - **`no-cache`**ָָʾлµ󵽴ʱ֤ٷ͸ͻˡָʵʽ̱ΪڵģDZ֤֤Աݡ - **`no-store`**ָָʾݲκηʽ档ʺڻظϢʱá -- **`public`**ݱΪеģζܱκмڵ㻺档ͨʹHTTP֤ظĬϱΪ`private``public`ǽḲá +- **`public`**ݱΪеģζܱκмڵ㻺档ͨʹHTTP֤ظĬϱΪ`private``public`ǽḲá - **`private`**ݱΪ˽еġ˽ݿԱû棬**κмڵ㻺档ͨûصݡ -- **`max-age`**ָʾ˻ݵڣںԴ֤ءִѡȡ`Expires`ͷҲΪݵʶȵĻѡֵΪλʾԱʾһʶȣ31536000룩 +- **`max-age`**ָʾ˻ݵڣںԴ֤ءִѡȡ`Expires`ͷҲΪݵʶȵĻѡֵΪλʾԱʾһڣ31536000룩 - **`s-maxage`**ѡdz`max-age`ָܹʱ䡣ѡֻмڵĻЧѡԹĻԡ - **`must-revalidate`**ָ`max-age``s-maxage``Expires`ͷָʶϢ뱻ϸء˻жϵƵijбʹá - **`proxy-revalidate`**ѡһãֻӦмĴڵ㡣£ûжʱʹùݣмĻݲڴĿġ @@ -130,7 +130,7 @@ Web ЩѡܹԲͬķʽԻòͬĻΪһЩֵ£ -- `no-cache``no-store`ԼǰΪᵽѡָijõĻΪ +- `no-cache``no-store`ԼǰδᵽѡָijõĻΪ - `public``private` `no-store``no-cache`ãô`no-store`ȡ`no-cache`ڷȨĻظ`public`áȨĻظ`private`ѡġǿͨ`Cache-Control`ͷָӦ෴ѡԸǡ @@ -138,8 +138,7 @@ Web һֻ ---------------- -£κݶԱĻ棬ķֻҪżṩһЩ֤ݼɡʵкٷӦóһЩǵĻԣڳڻվıﵽƽ⡣ - +£κݶԱĻ棬ķֻҪżṩһЩ֤ݼɡʵкٷӦóһЩǵĻԣڳڻվıﵽƽ⡣ ### @@ -147,11 +146,11 @@ Web ЩǾ⣬ǻӰ컺ܺṩݵ׼ȷԡȻǿͨǰԤЩĻЩ⡣ -### һ㽨 +### һԽ ʵָѡĻԣĽܰһЩľ -ʹһضͷ֮ǰһЩضIJ԰ᵽĻʡһЩ£ +ʹһضͷ֮ǰһЩضIJ԰ĻʡһЩ£ - **ΪͼCSS͹ݽضļ**ݷŵضļʹԷĴվеκҳЩݡ - **ʹͬURLʾͬ**ڻʹе·ΪӦ֤ҳеĸݵ÷ʽͬǰһ @@ -162,7 +161,7 @@ Web ڲͬļȷѡͬͷ£ݿΪһԵIJο - **еĻ洢һ**̬ԼûصӦڷַнڵ㱻档ʹмڵԽݻظû -- **ûص**ÿûݣͨûԼлǿԱġûܹʹûڽܹ˲ʱȡЩݲʺκмڵ㻺档 +- **ûص**ÿûݣͨûԼлǿԱġûܹʹûڽܹ˲ʱȡЩݲʺκмڵ㻺档 - **ʱеΪ**ʱеģôοӦýЩΪԱ֤ڵݲڹؼ±ʹá磬վһﳵӦ̷ӦﳵƷݵص㣬`Cache-Control`ͷʹ`no-cache``no-store`ѡ - **ṩ֤**֤ʹùڵݿضõˢ¡`ETag``Last-Modified`ͷԭʼ֤ݣδ޸ʱˢ¸ʶԼٸء - **ֵ֧ó**Ϊ˸Чû棬һЩΪ֧ԵӦñýϳڡͨȽʺͼCSSûȾHTMLҳݡļժҪһӳڽ泤ʱĴ洢ЩԴԴı䣬޸ĵļժҪʹЧµݵءʱµֵ֧ݻ档 @@ -179,7 +178,7 @@ Web ---- -ʱȷվʹ˺ʵĻԽվҪӰ졣ʹԱ֤ͬݵͬʱٴʹáķ˿ԿͬӲҪǣͻվлø飬ʹǸԸƵķʡЧWeb沢úʵĻԻʹСĴۻÿɹ۵ջ +ʱȷվʹ˺ʵĻԽվҪӰ졣ʹڱ֤ͬݵͬʱٴʹáķ˿ԿͬӲҪǣͻվлø飬ʹǸԸƵķվ㡣ЧWeb沢úʵĻԻʹСĴۻÿɹ۵ջ --- From ddfabbfff9f22addf6b0f0db08e06e378d019e62 Mon Sep 17 00:00:00 2001 From: wwy Date: Thu, 14 May 2015 13:28:16 +0800 Subject: [PATCH 019/965] [Translating] Install Linux-Dash (Web Based Monitoring tool) on Ubntu 14.10 --- ...ll Linux-Dash (Web Based Monitoring tool) on Ubntu 14.10.md} | 2 ++ 1 file changed, 2 insertions(+) rename sources/tech/{20150211 Install Linux-Dash (Web Based Monitoring tool) on Ubntu 14.10.md => [Translating] 20150211 Install Linux-Dash (Web Based Monitoring tool) on Ubntu 14.10.md} (99%) diff --git a/sources/tech/20150211 Install Linux-Dash (Web Based Monitoring tool) on Ubntu 14.10.md b/sources/tech/[Translating] 20150211 Install Linux-Dash (Web Based Monitoring tool) on Ubntu 14.10.md similarity index 99% rename from sources/tech/20150211 Install Linux-Dash (Web Based Monitoring tool) on Ubntu 14.10.md rename to sources/tech/[Translating] 20150211 Install Linux-Dash (Web Based Monitoring tool) on Ubntu 14.10.md index 6817a75b03..c52fae405d 100644 --- a/sources/tech/20150211 Install Linux-Dash (Web Based Monitoring tool) on Ubntu 14.10.md +++ b/sources/tech/[Translating] 20150211 Install Linux-Dash (Web Based Monitoring tool) on Ubntu 14.10.md @@ -1,3 +1,5 @@ +translating by wwy-hust + Install Linux-Dash (Web Based Monitoring tool) on Ubntu 14.10 ================================================================================ From 6abcdd0f8e3c9a920c2a3bc0bb2d33585e376588 Mon Sep 17 00:00:00 2001 From: H-mudcup Date: Thu, 14 May 2015 15:00:27 +0800 Subject: [PATCH 020/965] Delete 20150429 Synfig Studio 1.0--Open Source Animation Gets Serious.md --- ...1.0--Open Source Animation Gets Serious.md | 42 ------------------- 1 file changed, 42 deletions(-) delete mode 100644 sources/share/20150429 Synfig Studio 1.0--Open Source Animation Gets Serious.md diff --git a/sources/share/20150429 Synfig Studio 1.0--Open Source Animation Gets Serious.md b/sources/share/20150429 Synfig Studio 1.0--Open Source Animation Gets Serious.md deleted file mode 100644 index 326593d7a3..0000000000 --- a/sources/share/20150429 Synfig Studio 1.0--Open Source Animation Gets Serious.md +++ /dev/null @@ -1,42 +0,0 @@ -Translating by H-mudcup -Synfig Studio 1.0 — Open Source Animation Gets Serious -================================================================================ -![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/04/synfig-free-animations-750x467.jpg) - -**A brand new version of the free, open-source 2D animation software Synfig Studio is now available to download. ** - -The first release of the cross-platform software in well over a year, Synfig Studio 1.0 builds on its claim of offering “industrial-strength solution for creating film-quality animation” with a suite of new and improved features. - -Among them is an improved user interface that the project developers say is ‘easier’ and ‘more intuitive’ to use. The client adds a new **single-window mode** for tidy working and has been **reworked to use the latest GTK3 libraries**. - -On the features front there are several notable changes, including the addition of a fully-featured bone system. - -This **joint-and-pivot ‘skeleton’ framework** is well suited to 2D cut-out animation and should prove super efficient when coupled with the complex deformations new to this release, or used with Synfig’s popular ‘automatic interpolated keyframes’ (read: frame-to-frame morphing). - -注:youtube视频 - - -New non-destructive cutout tools, friction effects and initial support for full frame-by-frame bitmap animation, may help unlock the creativity of open-source animators, as might the addition of a sound layer for syncing the animation timeline with a soundtrack! - -### Download Synfig Studio 1.0 ### - -Synfig Studio is not a tool suited for everyone, though the latest batch of improvements in this latest release should help persuade some animators to give the free animation software a try. - -If you want to find out what open-source animation software is like for yourself, you can grab an installer for Ubuntu for the latest release direct from the project’s Sourceforge page using the links below. - -- [Download Synfig 1.0 (64bit) .deb Installer][1] -- [Download Synfig 1.0 (32bit) .deb Installer][2] - --------------------------------------------------------------------------------- - -via: http://www.omgubuntu.co.uk/2015/04/synfig-studio-new-release-features - -作者:[oey-Elijah Sneddon][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:https://plus.google.com/117485690627814051450/?rel=author -[1]:http://sourceforge.net/projects/synfig/files/releases/1.0/linux/synfigstudio_1.0_amd64.deb/download -[2]:http://sourceforge.net/projects/synfig/files/releases/1.0/linux/synfigstudio_1.0_x86.deb/download From d403aae711d1068fe0440060b95f9f8bf12d0bfe Mon Sep 17 00:00:00 2001 From: H-mudcup Date: Thu, 14 May 2015 15:01:13 +0800 Subject: [PATCH 021/965] Create 20150429 Synfig Studio 1.0--Open Source Animation Gets Serious.md --- ...1.0--Open Source Animation Gets Serious.md | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 translated/share/20150429 Synfig Studio 1.0--Open Source Animation Gets Serious.md diff --git a/translated/share/20150429 Synfig Studio 1.0--Open Source Animation Gets Serious.md b/translated/share/20150429 Synfig Studio 1.0--Open Source Animation Gets Serious.md new file mode 100644 index 0000000000..b4e41bd155 --- /dev/null +++ b/translated/share/20150429 Synfig Studio 1.0--Open Source Animation Gets Serious.md @@ -0,0 +1,43 @@ +Translating by H-mudcup + +Synfig Studio 1.0 —— 开源动画动真格的了 +================================================================================ +![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/04/synfig-free-animations-750x467.jpg) + +**现在可以下载 Synfig Studio 这个自由、开源的2D动画软件的全新版本了。 ** + +在第一次发行这个跨平台的软件一年以后,Synfig Studio 1.0 带着一套全新改和改进过的功能,实现它所承诺的“创造电影级别的动画的产业级解决方案”。 + +在众多功能之上的是一个改进过的用户界面,据工程开发者说那是个用起来‘更简单’、‘更直观’的界面。客户端添加了新的**单窗口模式**,让界面更整洁,而且**为了使用最新的 GTK3 库而被重新制作**。 + +在功能方面有几个值得注意的变化,包括新加的全功能骨骼系统。 + +这套**关节和转轴的‘骨骼’构架**非常适合2D剪纸动画,再配上这个版本新加的复杂的变形控制系统或是 Synfig 受欢迎的‘关键帧自动插入’(阅读:画面与画面间的变形)应该会变得非常有效率的。 + +注:youtube视频 + + +新的无损剪切工具,摩擦力效果和对逐帧位图动画的支持,可能会有助于释放开源动画师们的创造力,更别说新加的用于同步动画的时间线和声音的声效层! + +### 下载 Synfig Studio 1.0 ### + +Synfig Studio 并不是任何人都能用的工具套件,这最新发行版的最新一批改进应该能吸引一些动画制作者试一试这个软件。 + +If you want to find out what open-source animation software is like for yourself, you can grab an installer for Ubuntu for the latest release direct from the project’s page using the links below. 如果你想看看开源动画制作软件是什么样的,你可以通过下面的链接直接从工程的 Sourceforge 页下载一个适用于 Ubuntu 的最新版本的安装器。 + +- [Download Synfig 1.0 (64bit) .deb Installer][1] +- [Download Synfig 1.0 (32bit) .deb Installer][2] + +-------------------------------------------------------------------------------- + +via: http://www.omgubuntu.co.uk/2015/04/synfig-studio-new-release-features + +作者:[oey-Elijah Sneddon][a] +译者:[H-mudcup](https://github.com/H-mudcup) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:https://plus.google.com/117485690627814051450/?rel=author +[1]:http://sourceforge.net/projects/synfig/files/releases/1.0/linux/synfigstudio_1.0_amd64.deb/download +[2]:http://sourceforge.net/projects/synfig/files/releases/1.0/linux/synfigstudio_1.0_x86.deb/download From 68ca7b3faa5e98699efb1144c3a8f98963352427 Mon Sep 17 00:00:00 2001 From: ZTinoZ Date: Thu, 14 May 2015 18:00:51 +0800 Subject: [PATCH 022/965] Translating by ZTinoZ --- ...427 15 Things to Do After Installing Ubuntu 15.04 Desktop.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20150427 15 Things to Do After Installing Ubuntu 15.04 Desktop.md b/sources/tech/20150427 15 Things to Do After Installing Ubuntu 15.04 Desktop.md index e40612ea8f..e0ac1fa238 100644 --- a/sources/tech/20150427 15 Things to Do After Installing Ubuntu 15.04 Desktop.md +++ b/sources/tech/20150427 15 Things to Do After Installing Ubuntu 15.04 Desktop.md @@ -9,7 +9,7 @@ 在刚装好Ubuntu之后你应该要关心的第一件事是启用官方合作伙伴提供的Ubuntu额外软件库并且通过最近一次的安全补丁和软件更新来保持系统是最新状态。 -要完成这一步,In order to accomplish this step, open from the left Launcher System Settings -> Software and Updates utility and check all Ubuntu Software and Other Software (Canonical Partners) repositories. After you finish hit the Close button and wait for the utility to Reload the cache sources tree. +要完成这一步,open from the left Launcher System Settings -> Software and Updates工具并检查所有Ubuntu软件和其他软件库(官方合作伙伴所提供)。After you finish hit the Close button and wait for the utility to Reload the cache sources tree. ![Software Updates](http://www.tecmint.com/wp-content/uploads/2015/04/Software-Updates.jpg) Software Updates From cd45e7e498bfc189892c3e3cd73d75da1553ab60 Mon Sep 17 00:00:00 2001 From: joeren Date: Fri, 15 May 2015 07:53:07 +0800 Subject: [PATCH 023/965] Update 20150512 A Shell Script to Monitor Network, Disk Usage, Uptime, Load Average and RAM Usage in Linux.md --- ... Disk Usage, Uptime, Load Average and RAM Usage in Linux.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150512 A Shell Script to Monitor Network, Disk Usage, Uptime, Load Average and RAM Usage in Linux.md b/sources/tech/20150512 A Shell Script to Monitor Network, Disk Usage, Uptime, Load Average and RAM Usage in Linux.md index ae73d6896b..1242fdb60c 100644 --- a/sources/tech/20150512 A Shell Script to Monitor Network, Disk Usage, Uptime, Load Average and RAM Usage in Linux.md +++ b/sources/tech/20150512 A Shell Script to Monitor Network, Disk Usage, Uptime, Load Average and RAM Usage in Linux.md @@ -1,3 +1,4 @@ +Translating by GOLinux! A Shell Script to Monitor Network, Disk Usage, Uptime, Load Average and RAM Usage in Linux ================================================================================ The duty of System Administrator is really tough as he/she has to monitor the servers, users, logs, create backup and blah blah blah. For the most repetitive task most of the administrator write a script to automate their day-to-day repetitive task. Here we have written a shell Script that do not aims to automate the task of a typical system admin, but it may be helpful at places and specially for those newbies who can get most of the information they require about their System, Network, Users, Load, Ram, host, Internal IP, External IP, Uptime, etc. @@ -93,4 +94,4 @@ via: http://www.tecmint.com/linux-server-health-monitoring-script/ 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 [a]:http://www.tecmint.com/author/avishek/ -[1]:http://www.tecmint.com/10-wget-command-examples-in-linux/ \ No newline at end of file +[1]:http://www.tecmint.com/10-wget-command-examples-in-linux/ From 96cbedcc182286a4fb3911b99acaa01a94f5d4d2 Mon Sep 17 00:00:00 2001 From: GOLinux Date: Fri, 15 May 2015 08:35:21 +0800 Subject: [PATCH 024/965] [Translated]20150512 A Shell Script to Monitor Network, Disk Usage, Uptime, Load Average and RAM Usage in Linux.md --- ...me, Load Average and RAM Usage in Linux.md | 97 ------------------- ...me, Load Average and RAM Usage in Linux.md | 96 ++++++++++++++++++ 2 files changed, 96 insertions(+), 97 deletions(-) delete mode 100644 sources/tech/20150512 A Shell Script to Monitor Network, Disk Usage, Uptime, Load Average and RAM Usage in Linux.md create mode 100644 translated/tech/20150512 A Shell Script to Monitor Network, Disk Usage, Uptime, Load Average and RAM Usage in Linux.md diff --git a/sources/tech/20150512 A Shell Script to Monitor Network, Disk Usage, Uptime, Load Average and RAM Usage in Linux.md b/sources/tech/20150512 A Shell Script to Monitor Network, Disk Usage, Uptime, Load Average and RAM Usage in Linux.md deleted file mode 100644 index 1242fdb60c..0000000000 --- a/sources/tech/20150512 A Shell Script to Monitor Network, Disk Usage, Uptime, Load Average and RAM Usage in Linux.md +++ /dev/null @@ -1,97 +0,0 @@ -Translating by GOLinux! -A Shell Script to Monitor Network, Disk Usage, Uptime, Load Average and RAM Usage in Linux -================================================================================ -The duty of System Administrator is really tough as he/she has to monitor the servers, users, logs, create backup and blah blah blah. For the most repetitive task most of the administrator write a script to automate their day-to-day repetitive task. Here we have written a shell Script that do not aims to automate the task of a typical system admin, but it may be helpful at places and specially for those newbies who can get most of the information they require about their System, Network, Users, Load, Ram, host, Internal IP, External IP, Uptime, etc. - -We have taken care of formatting the output (to certain extent). The Script don’t contains any Malicious contents and it can be run using Normal user Account. In-fact it is recommended to run this script as user and not as root. - -![Linux Server Health Monitoring](http://www.tecmint.com/wp-content/uploads/2015/05/Linux-Health-Monitoring.png) -Shell Script to Monitor Linux System Health - -You are free to use/modify/redistribute the below piece of code by giving proper credit to Tecmint and Author. We have tried to customize the output to the extent that nothing other than the required output is generated. We have tried to use those variables which are generally not used by Linux System and are probably free. - -#### Minimum System Requirement #### - -All you need to have is a working Linux box. - -#### Dependency #### - -There is no dependency required to use this package for a standard Linux Distribution. Moreover the script don’t requires root permission for execution purpose. However if you want to Install it, you need to enter root password once. - -#### Security #### - -We have taken care to ensure security of the system. Nothing additional package is required/installed. No root access required to run. Moreover code has been released under Apache 2.0 License, that means you are free to edit, modify and re-distribute by keeping Tecmint copyright. - -### How Do I Install and Run Script? ### - -First, use following [wget command][1] to download the monitor script `"tecmint_monitor.sh"` and make it executable by setting appropriate permissions. - - # wget http://tecmint.com/wp-content/scripts/tecmint_monitor.sh - # chmod 755 tecmint_monitor.sh - -It is strongly advised to install the script as user and not as root. It will ask for root password and will install the necessary components at required places. - -To install `"tecmint_monitor.sh"` script, simple use -i (install) option as shown below. - - /tecmint_monitor.sh -i - -Enter root password when prompted. If everything goes well you will get a success message like shown below. - - Password: - Congratulations! Script Installed, now run monitor Command - -After installation, you can run the script by calling command `'monitor'` from any location or user. If you don’t like to install it, you need to include the location every-time you want to run it. - - # ./Path/to/script/tecmint_monitor.sh - -Now run monitor command from anywhere using any user account simply as: - - $ monitor - -![TecMint Monitor Script in Action](http://www.tecmint.com/wp-content/uploads/2015/05/TecMint-Monitor-Script.gif) - -As soon as you run the command you get various System related information which are: - -- Internet Connectivity -- OS Type -- OS Name -- OS Version -- Architecture -- Kernel Release -- Hostname -- Internal IP -- External IP -- Name Servers -- Logged In users -- Ram Usages -- Swap Usages -- Disk Usages -- Load Average -- System Uptime - -Check the installed version of script using -v (version) switch. - - $ monitor -v - - tecmint_monitor version 0.1 - Designed by Tecmint.com - Released Under Apache 2.0 License - -### Conclusion ### - -This script is working out of the box on a few machines I have checked. It should work the same for you as well. If you find any bug let us know in the comments. This is not the end. This is the beginning. You can take it to any level from here. If you feel like editing the script and carry it further you are free to do so giving us proper credit and also share the updated script with us so that we can update this article by giving you proper credit. - -Don’t forget to share your thoughts or your script with us. We will be here to help you. Thank you for all the love you have given us. Keep Connected! Stay tuned. - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/linux-server-health-monitoring-script/ - -作者:[Avishek Kumar][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.tecmint.com/author/avishek/ -[1]:http://www.tecmint.com/10-wget-command-examples-in-linux/ diff --git a/translated/tech/20150512 A Shell Script to Monitor Network, Disk Usage, Uptime, Load Average and RAM Usage in Linux.md b/translated/tech/20150512 A Shell Script to Monitor Network, Disk Usage, Uptime, Load Average and RAM Usage in Linux.md new file mode 100644 index 0000000000..58eb9f18ca --- /dev/null +++ b/translated/tech/20150512 A Shell Script to Monitor Network, Disk Usage, Uptime, Load Average and RAM Usage in Linux.md @@ -0,0 +1,96 @@ +Linux中用于监控网络、磁盘使用、开机时间、平均负载和内存使用率的shell脚本 +================================================================================ +系统管理员的任务真的很艰难,因为他/她必须监控服务器、用户、日志,还得创建备份,等等等等。对于大多数重复性的任务,大多数管理员都会写一个自动化脚本来日复一日重复这些任务。这里,我们已经写了一个shell脚本给大家,用来自动化完成系统管理员所要完成的常规任务,这可能在多数情况下,尤其是对于新手而言十分有用,他们能通过该脚本获取到大多数的他们想要的信息,包括系统、网络、用户、负载、内存、主机、内部IP、外部IP、开机时间等。 + +我们已经注意并进行了格式化输出(在一定程度上哦)。此脚本不包含任何恶意内容,并且它能以普通用户帐号运行。事实上,我们也推荐你以普通用户运行该脚本,而不是root。 + +![Linux Server Health Monitoring](http://www.tecmint.com/wp-content/uploads/2015/05/Linux-Health-Monitoring.png) +监控Linux系统健康的Shell脚本 + +你可以通过给Tecmint和脚本作者合适的积分,获得自由使用/修改/再分发下面代码的权利。我们已经试着在一定程度上自定义了输出结果,除了要求的输出内容外,其它内容都不会生成。我们也已经试着使用了那些Linux系统中通常不使用的变量,这些变量可能也是自由代码。 + +#### 最小系统要求 #### + +你所需要的一切,就是一台正常运转的Linux盒子。 + +#### 依赖性 #### + +对于一个标准的Linux发行版,使用此包时没有任何依赖。此外,该脚本不需要root权限来执行。但是,如果你想要安装,则必须输入一次root密码。 + +#### 安全性 #### + +我们也关注到了系统安全问题,所以在安装此包时,不需要安装任何额外包,也不需要root访问权限来运行。此外,源代码是采用Apache 2.0许可证发布的,这意味着只要你保留Tecmint的版权,你可以自由地编辑、修改并再分发该代码。 + +### 如何安装和运行脚本? ### + +首先,使用[wget命令][1]下载监控脚本`“tecmint_monitor.sh”`,给它赋予合适的执行权限。 + + # wget http://tecmint.com/wp-content/scripts/tecmint_monitor.sh + # chmod 755 tecmint_monitor.sh + +强烈建议你以普通用户身份安装该脚本,而不是root。安装过程中会询问root密码,并且在需要的时候安装必要的组件。 + +要安装`“tecmint_monitor.sh”`脚本,只需像下面这样使用-i(安装)选项就可以了。 + + /tecmint_monitor.sh -i + +在提示你输入root密码时输入该密码。如果一切顺利,你会看到像下面这样的安装成功信息。 + + Password: + Congratulations! Script Installed, now run monitor Command + +安装完毕后,你可以通过在任何位置,以任何用户调用命令`‘monitor’`来运行该脚本。如果你不喜欢安装,你需要在每次运行时输入路径。 + + # ./Path/to/script/tecmint_monitor.sh + +现在,以任何用户从任何地方运行monitor命令,就是这么简单: + + $ monitor + +![TecMint Monitor Script in Action](http://www.tecmint.com/wp-content/uploads/2015/05/TecMint-Monitor-Script.gif) + +你一运行命令,就会获得下面这些各种各样和系统相关的信息: + +- 互联网连通性 +- 操作系统类型 +- 操作系统名称 +- 操作系统版本 +- 架构 +- 内核版本 +- 主机名 +- 内部IP +- 外部IP +- 域名服务器 +- 已登录用户 +- 内存使用率 +- 交换分区使用率 +- 磁盘使用率 +- 平均负载 +- 系统开机时间 + +使用-v(版本)开关来检查安装的脚本的版本。 + + $ monitor -v + + tecmint_monitor version 0.1 + Designed by Tecmint.com + Released Under Apache 2.0 License + +### 小结 ### + +该脚本在一些机器上可以开机即用,这一点我已经检查过。相信对于你而言,它也会正常工作。如果你们发现了什么毛病,可以在评论中告诉我。这个脚本还不是结束,这仅仅是个开始。从这里开始,你可以将它提升到任何等级。如果你想要编辑脚本,将它带入一个更深的层次,尽管随意去做吧,别忘了给我们合适的积分,也别忘了把你更新后的脚本拿出来和我们分享哦,这样,我们也能通过给你合适的积分来更新此文。 + +别忘了和我们分享你的想法或者脚本,我们会在这儿帮助你。谢谢你们给予的所有挚爱。保持连线,不要走开哦。 + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/linux-server-health-monitoring-script/ + +作者:[Avishek Kumar][a] +译者:[GOLinux](https://github.com/GOLinux) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/avishek/ +[1]:http://www.tecmint.com/10-wget-command-examples-in-linux/ From da8593f1a323f8267590d7c478c67fcc7149da50 Mon Sep 17 00:00:00 2001 From: ZTinoZ Date: Fri, 15 May 2015 11:38:30 +0800 Subject: [PATCH 025/965] Translating by ZTinoZ --- ...o After Installing Ubuntu 15.04 Desktop.md | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/sources/tech/20150427 15 Things to Do After Installing Ubuntu 15.04 Desktop.md b/sources/tech/20150427 15 Things to Do After Installing Ubuntu 15.04 Desktop.md index e0ac1fa238..634d624197 100644 --- a/sources/tech/20150427 15 Things to Do After Installing Ubuntu 15.04 Desktop.md +++ b/sources/tech/20150427 15 Things to Do After Installing Ubuntu 15.04 Desktop.md @@ -9,7 +9,7 @@ 在刚装好Ubuntu之后你应该要关心的第一件事是启用官方合作伙伴提供的Ubuntu额外软件库并且通过最近一次的安全补丁和软件更新来保持系统是最新状态。 -要完成这一步,open from the left Launcher System Settings -> Software and Updates工具并检查所有Ubuntu软件和其他软件库(官方合作伙伴所提供)。After you finish hit the Close button and wait for the utility to Reload the cache sources tree. +要完成这一步,依次从左边菜单中打开System Settings -> Software and Updates工具并检查所有Ubuntu软件和其他软件库(官方合作伙伴所提供),点击关闭按钮并等待重新加载缓存源树。 ![Software Updates](http://www.tecmint.com/wp-content/uploads/2015/04/Software-Updates.jpg) Software Updates @@ -17,7 +17,7 @@ Software Updates ![Other Software (Canonical Partners)](http://www.tecmint.com/wp-content/uploads/2015/04/Other-Software.jpg) Other Software (Canonical Partners) -For a fast and smooth update process, open a Terminal and issue the following command in order to update the system using the new software repositories: +经过一系列快速平滑的更新过程之后,打开终端并输入以下命令来让系统使用新软件库: $ sudo apt-get update $ sudo apt-get upgrade @@ -34,7 +34,7 @@ If some drivers matching your hardware are found, check the drivers you want to ![Install Drivers in Ubuntu](http://www.tecmint.com/wp-content/uploads/2015/04/install-drivers.jpg) Install Drivers -### 3. Install Synaptic and Gdebi Package Tools ### +### 3. 安装Synaptic和Gdebi工具 ### Besides Ubuntu Software Center, Synaptic is a Graphical utility for apt command line through which you can manage repositories or install, remove, search, upgrade and configure software packages. Similar way, Gdebi has the same functionality for local .deb packages. To install this two package managers on your system issue the following command on Terminal: @@ -46,14 +46,14 @@ Install Synaptic and Gdebi ![Synaptic Package Manager](http://www.tecmint.com/wp-content/uploads/2015/04/synaptic-package-manager.jpg) Synaptic Package Manager -### 4. Change System Appearance and Behavior ### +### 4. 更改系统外观和运行状态 ### If you want to change Desktop Background or Launcher Icon Size, open System Settings –> Appearance –> Look and personalize the desktop. To move the menu to window title bar, enable workspaces and desktop icons or auto-hide the Launcher visit Behavior tab. ![System Appearances](http://www.tecmint.com/wp-content/uploads/2015/04/system-appearance.jpg) System Appearances -### 5. Improve System Security and Privacy ### +### 5. 提升系统安全性和隐私性 ### ![System Security Enhancement](http://www.tecmint.com/wp-content/uploads/2015/04/system-security-1.jpg) System Security Enhancement @@ -61,7 +61,7 @@ System Security Enhancement ![System Security Options](http://www.tecmint.com/wp-content/uploads/2015/04/system-security-2.jpg) System Security Options -### 5. Disable Unneeded Startup Applications ### +### 5. 禁用不需要开机自启动的应用程序 ### To improve system login speed, reveal hidden Startup Applications by issuing the below command on Terminal, open Startup Applications utility by searching it in Dash and uncheck the unneeded applications during login process. @@ -70,7 +70,7 @@ To improve system login speed, reveal hidden Startup Applications by issuing the ![Disable Unwanted Applications](http://www.tecmint.com/wp-content/uploads/2015/04/disable-unwanted-applications.jpg) Disable Unwanted Applications -### 6. Add Extended Multimedia Support ### +### 6. 添加扩展多媒体支持 ### By default, Ubuntu comes with a minimal support for media files. In order to play various media formats or manipulate video files, install the following multimedia applications: @@ -108,7 +108,7 @@ To enable DVD Playback and other multimedia codecs issue the following command o ![Enable Video Codes](http://www.tecmint.com/wp-content/uploads/2015/04/enable-video-playbacks.jpg) Enable Video Codes -### 7. Install Image Applications ### +### 7. 安装图像处理应用程序 ### If you are a photography enthusiast and you want to handle and manipulate images on Ubuntu, probably you want to install the following imaging programs: @@ -131,7 +131,7 @@ Install Image Applications ![Rawtherapee Tool](http://www.tecmint.com/wp-content/uploads/2015/04/rawtherapee.jpg) Rawtherapee Tool -### 8. Install Media Burners ### +### 8. 安装媒体烧录软件 ### To mount ISO images or burn a CDs or a DVD, you can choose and install from the following software: @@ -148,7 +148,7 @@ To mount ISO images or burn a CDs or a DVD, you can choose and install from the ![Install Media Burners](http://www.tecmint.com/wp-content/uploads/2015/04/install-media-burners.jpg) Install Media Burners -### 9. Install Archive Applications ### +### 9. 安装压缩应用程序 ### To handle most of archive formatted files (zip, tar.gz, zip, 7zip rar etc) install the following packages by issuing the below command: @@ -157,7 +157,7 @@ To handle most of archive formatted files (zip, tar.gz, zip, 7zip rar etc) insta ![Install Archive Applications](http://www.tecmint.com/wp-content/uploads/2015/04/install-archive-apps.jpg) Install Archive Applications -### 10. Install Chat Application ### +### 10. 安装聊天应用程序 ### If you want to talk to people all over the world, here is a list of the most popular chat applications for Linux: @@ -186,7 +186,7 @@ To install Viber application on Ubuntu visit [Viber official webpage][1], downlo ![Install Viber in Ubuntu](http://www.tecmint.com/wp-content/uploads/2015/04/install-viber.jpg) Install Viber -### 11. Install Torrent Software ### +### 11. 安装种子软件 ### The most popular torrent applications and peer-to-peer file sharing programs for Ubuntu are: @@ -205,7 +205,7 @@ To install your favorite peer-to-peer file sharing application on Ubuntu issue t ![Install Torrent](http://www.tecmint.com/wp-content/uploads/2015/04/install-torrent.jpg) Install Torrent -### 12. Install Windows Emulator -Wine and Gaming Support – Steam ### +### 12. 安装Windows仿真器-Wine和游戏支持平台-Steam ### Wine emulator allows you to install and run Windows applications on Linux. On the other hand, Steam is a popular gaming platform for Linux based systems developed by Valve. To install both of them on your machine issue the following command on Terminal or use Ubuntu Software Center. @@ -214,7 +214,7 @@ Wine emulator allows you to install and run Windows applications on Linux. On th ![Install Wine](http://www.tecmint.com/wp-content/uploads/2015/04/install-wine.jpg) Install Wine -### 13. Install Cairo-Dock and Enable Desktop Visual Effects ### +### 13. 安装Cairo-Dock并启用桌面视觉效果 ### Cairo-Dock is a beautiful and flexible launcher bar for Linux desktops similar to the Mac OS X dock. To install it on Ubuntu, run the following command on Terminal. @@ -244,7 +244,7 @@ Compiz Settings Addons ![Desktop Window Rotating](http://www.tecmint.com/wp-content/uploads/2015/04/desktop-cube.jpg) Desktop Window Rotating -### 14. Add Extra Browser Support ### +### 14. 添加额外浏览器支持 ### Ubuntu 15.04 comes by default with Mozilla Firefox Web Browser. To install other browsers such as Google Chrome or Opera, visit their official web pages, download the provided .deb packages and install them on your system using the Gdebi Package Installer. @@ -258,7 +258,7 @@ To install Chromium Open Source browser issue the following command on Terminal. $ sudo apt-get install chromium-browser -### 15. Install Tweak Tools ### +### 15. 安装Tweak工具 ### Want extra applications for customizing Ubuntu? Then install Unity Tweak Tool and Gnome Tweak Tool by issuing the following commands on Terminal. From cf06b774b5131f08395505cfaa46204b0bef10cb Mon Sep 17 00:00:00 2001 From: wwy Date: Fri, 15 May 2015 11:55:21 +0800 Subject: [PATCH 026/965] start translation --- ...l Linux-Dash (Web Based Monitoring tool) on Ubntu 14.10.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 translated/tech/20150211 Install Linux-Dash (Web Based Monitoring tool) on Ubntu 14.10.md diff --git a/translated/tech/20150211 Install Linux-Dash (Web Based Monitoring tool) on Ubntu 14.10.md b/translated/tech/20150211 Install Linux-Dash (Web Based Monitoring tool) on Ubntu 14.10.md new file mode 100644 index 0000000000..afe07b4a37 --- /dev/null +++ b/translated/tech/20150211 Install Linux-Dash (Web Based Monitoring tool) on Ubntu 14.10.md @@ -0,0 +1,4 @@ +Ubuntu 14.10ϰװLinux-Dash(Webļع) +================================================================================ + +һGNU/LinuxģͿļDZ̡򵥵İװʼɣLinux DashĽṩĹؼϢϸͼ From b0aae05e4d0df830aa2d99cdae6b9e3639890063 Mon Sep 17 00:00:00 2001 From: wwy-hust Date: Fri, 15 May 2015 13:14:33 +0800 Subject: [PATCH 027/965] finished translation --- ...b Based Monitoring tool) on Ubntu 14.10.md | 69 ++++++++++++++++++- 1 file changed, 68 insertions(+), 1 deletion(-) diff --git a/translated/tech/20150211 Install Linux-Dash (Web Based Monitoring tool) on Ubntu 14.10.md b/translated/tech/20150211 Install Linux-Dash (Web Based Monitoring tool) on Ubntu 14.10.md index afe07b4a37..006e636a25 100644 --- a/translated/tech/20150211 Install Linux-Dash (Web Based Monitoring tool) on Ubntu 14.10.md +++ b/translated/tech/20150211 Install Linux-Dash (Web Based Monitoring tool) on Ubntu 14.10.md @@ -1,4 +1,71 @@ Ubuntu 14.10ϰװLinux-Dash(Webļع) ================================================================================ -һGNU/LinuxģͿļDZ̡򵥵İװʼɣLinux DashĽṩĹؼϢϸͼ +һGNU/LinuxģͿļDZ̡򵥵İװʼɣLinux DashĽṩĹؼϢϸͼɼϢRAMʹʹʡ硢װûе̡߳еϢ࣬ͨҳеĹеİťκһСLinux DashȽļ⹤ߣʮʺѰײӦõû + +### Linux-DashĹ ### + +һWebƯDZ̽طϢ + +ʵʱļRAMءʱ䡢áûϵͳ״̬ + +ʽΪװApache2/niginx + PHP + +϶пؼ + +ֶ֧͵linux + +### ǰռб ### + +- ͨϢ +- ƽ +- RAM +- ʹ +- û +- +- IP +- +- +- +- ־ + +### Ubuntu server 14.10ϰװLinux-Dash ### + +Ҫȷװ[Ubuntu LAMP server 14.10][1]Ҫװİ + + sudo apt-get install php5-json unzip + +װģҪapache2ʹܸģ飬Ҫʹapache2 + + sudo service apache2 restart + +Ҫlinux-dashװҰװ + + wget https://github.com/afaqurk/linux-dash/archive/master.zip + + unzip master.zip + + sudo mv linux-dash-master/ /var/www/html/linux-dash-master/ + +ҪʹıȨޣ + + sudo chmod 755 /var/www/html/linux-dash-master/ + +Էhttp://serverip/linux-dash-master/Ӧûῴ + +![](http://www.ubuntugeek.com/wp-content/uploads/2015/02/1.png) + +![](http://www.ubuntugeek.com/wp-content/uploads/2015/02/2.png) + +-------------------------------------------------------------------------------- + +via: http://www.ubuntugeek.com/install-linux-dash-web-based-monitoring-tool-on-ubntu-14-10.html + +ߣ[ruchi][a] +ߣ[wwy-hust](https://github.com/wwy-hust) +Уԣ[УID](https://github.com/УID) + + [LCTT](https://github.com/LCTT/TranslateProject) ԭ룬[Linuxй](http://linux.cn/) Ƴ + +[a]:http://www.ubuntugeek.com/author/ubuntufix +[1]:http://www.ubuntugeek.com/step-by-step-ubuntu-14-10-utopic-unicorn-lamp-server-setup.html From d269fa75e988e609a88e8dd53f002758225fd8f4 Mon Sep 17 00:00:00 2001 From: wwy-hust Date: Fri, 15 May 2015 13:29:18 +0800 Subject: [PATCH 028/965] after review by meself --- ...b Based Monitoring tool) on Ubntu 14.10.md | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/translated/tech/20150211 Install Linux-Dash (Web Based Monitoring tool) on Ubntu 14.10.md b/translated/tech/20150211 Install Linux-Dash (Web Based Monitoring tool) on Ubntu 14.10.md index 006e636a25..14496aabfc 100644 --- a/translated/tech/20150211 Install Linux-Dash (Web Based Monitoring tool) on Ubntu 14.10.md +++ b/translated/tech/20150211 Install Linux-Dash (Web Based Monitoring tool) on Ubntu 14.10.md @@ -1,21 +1,21 @@ Ubuntu 14.10ϰװLinux-Dash(Webļع) ================================================================================ -һGNU/LinuxģͿļDZ̡򵥵İװʼɣLinux DashĽṩĹؼϢϸͼɼϢRAMʹʹʡ硢װûе̡߳еϢ࣬ͨҳеĹеİťκһСLinux DashȽļ⹤ߣʮʺѰײӦõû +Linux-DashһGNU/LinuxģͿļDZ̡װʼʹðɣLinux DashĽṩķйؼϢϸͼɼϢRAMʹʡ硢װûе̵߳ȡеϢ࣬ͨҳеİťκһСLinux DashȽļ⹤ߣʮʺѰײӦõû ### Linux-DashĹ ### -һWebƯDZ̽طϢ +ʹһWebƯDZ̽طϢ -ʵʱļRAMءʱ䡢áûϵͳ״̬ +ʵʱļRAMءʱ䡢áûϵͳ״̬ -ʽΪװApache2/niginx + PHP +ɲʽΪװApache2/niginx + PHP -϶пؼ +ͨ϶пؼ ֶ֧͵linux -### ǰռб ### +### ǰؼб ### - ͨϢ - ƽ @@ -34,12 +34,12 @@ Ҫȷװ[Ubuntu LAMP server 14.10][1]Ҫװİ sudo apt-get install php5-json unzip - + װģҪapache2ʹܸģ飬Ҫʹapache2 sudo service apache2 restart -Ҫlinux-dashװҰװ +Ҫlinux-dashİװװ wget https://github.com/afaqurk/linux-dash/archive/master.zip @@ -47,11 +47,11 @@ sudo mv linux-dash-master/ /var/www/html/linux-dash-master/ -ҪʹıȨޣ +ҪʹıȨޣ sudo chmod 755 /var/www/html/linux-dash-master/ -Էhttp://serverip/linux-dash-master/Ӧûῴ +Էhttp://serverip/linux-dash-master/ˡӦûῴ ![](http://www.ubuntugeek.com/wp-content/uploads/2015/02/1.png) From 357ae318d2018f7350a2da650aa8176168fb32f8 Mon Sep 17 00:00:00 2001 From: wwy-hust Date: Fri, 15 May 2015 13:33:20 +0800 Subject: [PATCH 029/965] remove source article --- ...b Based Monitoring tool) on Ubntu 14.10.md | 73 ------------------- 1 file changed, 73 deletions(-) delete mode 100644 sources/tech/[Translating] 20150211 Install Linux-Dash (Web Based Monitoring tool) on Ubntu 14.10.md diff --git a/sources/tech/[Translating] 20150211 Install Linux-Dash (Web Based Monitoring tool) on Ubntu 14.10.md b/sources/tech/[Translating] 20150211 Install Linux-Dash (Web Based Monitoring tool) on Ubntu 14.10.md deleted file mode 100644 index c52fae405d..0000000000 --- a/sources/tech/[Translating] 20150211 Install Linux-Dash (Web Based Monitoring tool) on Ubntu 14.10.md +++ /dev/null @@ -1,73 +0,0 @@ -translating by wwy-hust - -Install Linux-Dash (Web Based Monitoring tool) on Ubntu 14.10 -================================================================================ - -A low-overhead monitoring web dashboard for a GNU/Linux machine. Simply drop-in the app and go!.Linux Dash's interface provides a detailed overview of all vital aspects of your server, including RAM and disk usage, network, installed software, users, and running processes. All information is organized into sections, and you can jump to a specific section using the buttons in the main toolbar. Linux Dash is not the most advanced monitoring tool out there, but it might be a good fit for users looking for a slick, lightweight, and easy to deploy application. - -### Linux-Dash Features ### - -A beautiful web-based dashboard for monitoring server info - -Live, on-demand monitoring of RAM, Load, Uptime, Disk Allocation, Users and many more system stats - -Drop-in install for servers with Apache2/nginx + PHP - -Click and drag to re-arrange widgets - -Support for wide range of linux server flavors - -### List of Current Widgets ### - -- General info -- Load Average -- RAM -- Disk Usage -- Users -- Software -- IP -- Internet Speed -- Online -- Processes -- Logs - -### Install Linux-dash on ubuntu server 14.10 ### - -First you need to make sure you have [Ubuntu LAMP server 14.10][1] installed and Now you have to install the following package - - sudo apt-get install php5-json unzip - -After the installation this module will enable for apache2 so you need to restart the apache2 server using the following command - - sudo service apache2 restart - -Now you need to download the linux-dash package and install - - wget https://github.com/afaqurk/linux-dash/archive/master.zip - - unzip master.zip - - sudo mv linux-dash-master/ /var/www/html/linux-dash-master/ - -Now you need to change the permissions using the following command - - sudo chmod 755 /var/www/html/linux-dash-master/ - -Now you need to go to http://serverip/linux-dash-master/ you should see similar to the following output - -![](http://www.ubuntugeek.com/wp-content/uploads/2015/02/1.png) - -![](http://www.ubuntugeek.com/wp-content/uploads/2015/02/2.png) - --------------------------------------------------------------------------------- - -via: http://www.ubuntugeek.com/install-linux-dash-web-based-monitoring-tool-on-ubntu-14-10.html - -作者:[ruchi][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://www.ubuntugeek.com/author/ubuntufix -[1]:http://www.ubuntugeek.com/step-by-step-ubuntu-14-10-utopic-unicorn-lamp-server-setup.html From 8dad59d0bb422191a27a54af91779e56dae0bf80 Mon Sep 17 00:00:00 2001 From: ictlyh Date: Fri, 15 May 2015 13:34:18 +0800 Subject: [PATCH 030/965] [Translating] sources/20150512 How To Run Docker Client Inside Windows OS --- .../tech/20150512 How To Run Docker Client Inside Windows OS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20150512 How To Run Docker Client Inside Windows OS.md b/sources/tech/20150512 How To Run Docker Client Inside Windows OS.md index e2379b70b8..0dcd19d5e4 100644 --- a/sources/tech/20150512 How To Run Docker Client Inside Windows OS.md +++ b/sources/tech/20150512 How To Run Docker Client Inside Windows OS.md @@ -1,3 +1,4 @@ +Translating by ictlyh How To Run Docker Client Inside Windows OS ================================================================================ Hi everyone, today we'll learn about Docker in Windows Operating System and about the installation of Docker Windows Client in it. Docker Engine uses Linux Specific Kernel features so it cannot use Windows Kernel to run so, the Docker Engine creates a small Virtual Machine running Linux and utilizes its resources and Kernel. The Windows Docker Client uses the virtualized Docker Engine to build, run and manage Docker Containers out of the box. There is an application developed by the Boot2Docker Team called Boot2Docker which creates the virtual machine running a small Linux based on [Tiny Core Linux][1] made specifically to run [Docker][2] containers on Windows. It runs completely from RAM, weighs ~27MB and boots in ~5s (YMMV). So, until the Docker Engine for Windows is developed, we can only run Linux containers in our Windows Machine. From b076d426e0d7d94e982f5c9cb1ae77163312a522 Mon Sep 17 00:00:00 2001 From: ictlyh Date: Fri, 15 May 2015 14:58:08 +0800 Subject: [PATCH 031/965] [Translated] tech/20150512 How To Run Docker Client Inside Windows OS --- ... To Run Docker Client Inside Windows OS.md | 108 ------------------ ... To Run Docker Client Inside Windows OS.md | 107 +++++++++++++++++ 2 files changed, 107 insertions(+), 108 deletions(-) delete mode 100644 sources/tech/20150512 How To Run Docker Client Inside Windows OS.md create mode 100644 translated/tech/20150512 How To Run Docker Client Inside Windows OS.md diff --git a/sources/tech/20150512 How To Run Docker Client Inside Windows OS.md b/sources/tech/20150512 How To Run Docker Client Inside Windows OS.md deleted file mode 100644 index 0dcd19d5e4..0000000000 --- a/sources/tech/20150512 How To Run Docker Client Inside Windows OS.md +++ /dev/null @@ -1,108 +0,0 @@ -Translating by ictlyh -How To Run Docker Client Inside Windows OS -================================================================================ -Hi everyone, today we'll learn about Docker in Windows Operating System and about the installation of Docker Windows Client in it. Docker Engine uses Linux Specific Kernel features so it cannot use Windows Kernel to run so, the Docker Engine creates a small Virtual Machine running Linux and utilizes its resources and Kernel. The Windows Docker Client uses the virtualized Docker Engine to build, run and manage Docker Containers out of the box. There is an application developed by the Boot2Docker Team called Boot2Docker which creates the virtual machine running a small Linux based on [Tiny Core Linux][1] made specifically to run [Docker][2] containers on Windows. It runs completely from RAM, weighs ~27MB and boots in ~5s (YMMV). So, until the Docker Engine for Windows is developed, we can only run Linux containers in our Windows Machine. - -Here is some easy and simple steps which will allow us to install the Docker Client and run containers on top of it. - -### 1. Downloading Boot2Docker ### - -Now, before we start the installation, we'll need the executable file for Boot2Docker. The latest version of Boot2Docker can be downloaded from [its Github][3]. Here, in this tutorial, we'll download version v1.6.1 from the site. Here, we'll download the file named [docker-install.exe][4] from that page using our favorite Web Browser or Download Manager. - -![](http://blog.linoxide.com/wp-content/uploads/2015/05/downloading-boot2docker-installer.png) - -### 2. Installing Boot2Docker ### - -Now, we'll simply run the installer which will install Windows Docker Client, Git for Windows (MSYS-git), VirtualBox, The Boot2Docker Linux ISO, and the Boot2Docker management tool which are essential for the total functioning of Docker Engine out of the box. - -![](http://blog.linoxide.com/wp-content/uploads/2015/05/boot2docker-installer.png) - -### 3. Running Boot2Docker ### - -![](http://blog.linoxide.com/wp-content/uploads/2015/05/boot2docker-start-icon-e1431322598697.png) - -After installing the necessary stuffs, we'll run Boot2Docker by simply running the Boot2Docker Start shortcut from the Desktop. This will ask you to enter an SSH key paraphrase that we'll require in future for authentication. It will start a unix shell already configured to manage Docker running inside the virtual machine. - -![](http://blog.linoxide.com/wp-content/uploads/2015/05/starting-boot2docker.png) - -Now to check whether it is correctly configured or not, simply run docker version as shown below. - - docker version - -![](http://blog.linoxide.com/wp-content/uploads/2015/05/docker-version.png) - -### 4. Running Docker ### - -As **Boot2Docker Start** automatically starts a shell with environment variables correctly set so we can simply start using Docker right away. **Please note that, if we are Boot2Docker as remote Docker Daemon , then do not type the sudo before the docker commands.** - -Now, Let's try the **hello-world** example image which will download the hello-world image, executes it and gives an output "Hello from Docker" message. - - $ docker run hello-world - -![](http://blog.linoxide.com/wp-content/uploads/2015/05/running-hello-world.png) - -### 5. Running Docker using Command Prompt (CMD) ### - -Now, if you are wanting to get started with Docker using Command Prompt, you can simply launch the command prompt (CMD.exe). As Boot2Docker requires ssh.exe to be in the PATH, therefore we need to include bin folder of the Git installation to the %PATH% environment variable by running the following command in the command prompt. - - set PATH=%PATH%;"c:\Program Files (x86)\Git\bin" - -![](http://blog.linoxide.com/wp-content/uploads/2015/05/docker-in-cmd.png) - -After running the above command, we can run the **boot2docker start** command in the command prompt to start the Boot2Docker VM. - - boot2docker start - -![](http://blog.linoxide.com/wp-content/uploads/2015/05/docker-cmd-variables.png) - -**Note**: If you get an error saying machine does not exist then run **boot2docker init** command in it. - -Then copy the instructions for cmd.exe shown in the console to set the environment variables to the console window and we are ready to run docker containers as usual. - -### 6. Running Docker using PowerShell ### - -In order to run Docker on PowerShell, we simply need to launch a PowerShell window then add ssh.exe to our PATH variable. - - $Env:Path = "${Env:Path};c:\Program Files (x86)\Git\bin" - -After running the above command, we'll need to run - - boot2docker start - -![](http://blog.linoxide.com/wp-content/uploads/2015/05/docker-in-powershell.png) - -This will print PowerShell commands to set the environment variables to connect Docker running inside VM. We'll simply run those commands in the PowerShell and we are ready to run docker containers as usual. - -### 7. Logging with PUTTY ### - -Boot2Docker generates and uses the public or private key pair inside %USERPROFILE%\.ssh directory so to login, we'll need use the private key from this same directory. That private key needs to be converted into the PuTTY 's format. We can use puttygen.exe to do that. - -We need to open puttygen.exe and load ("File"->"Load" menu) the private key from %USERPROFILE%\.ssh\id_boot2docker then click on "Save Private Key". Then use the saved file to login with PuTTY using docker@127.0.0.1:2022 . - -### 8. Boot2Docker Options ### - -The Boot2Docker management tool provides several commands as shown below. - - $ boot2docker - - Usage: boot2docker.exe [] {help|init|up|ssh|save|down|poweroff|reset|restart|config|status|info|ip|shellinit|delete|download|upgrade|version} [] - -### Conclusion ### - -Using Docker with Docker Windows Client is fun. The Boot2Docker management tool is an awesome application developed which enables every Docker containers to run smoothly as running in Linux host. If you are more curious, the username for the boot2docker default user is docker and the password is tcuser. The latest version of boot2docker sets up a host only network adapter which provides access to the container's ports. Typically, it is 192.168.59.103, but it could get changed by Virtualbox's DHCP implementation. If you have any questions, suggestions, feedback please write them in the comment box below so that we can improve or update our contents. Thank you ! Enjoy :-) - --------------------------------------------------------------------------------- - -via: http://linoxide.com/linux-how-to/run-docker-client-inside-windows-os/ - -作者:[Arun Pyasi][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://linoxide.com/author/arunp/ -[1]:http://tinycorelinux.net/ -[2]:https://www.docker.io/ -[3]:https://github.com/boot2docker/windows-installer/releases/latest -[4]:https://github.com/boot2docker/windows-installer/releases/download/v1.6.1/docker-install.exe \ No newline at end of file diff --git a/translated/tech/20150512 How To Run Docker Client Inside Windows OS.md b/translated/tech/20150512 How To Run Docker Client Inside Windows OS.md new file mode 100644 index 0000000000..f23c109149 --- /dev/null +++ b/translated/tech/20150512 How To Run Docker Client Inside Windows OS.md @@ -0,0 +1,107 @@ +如何在 Windows 操作系统中运行 Docker 客户端 +================================================================================ +大家好,今天我们来了解一下 Windows 操作系统中的 Docker 以及在其中安装 Docker Windows 客户端的知识。Docker 引擎使用 Linux 特定内核特性,因此不能通过 Windows 内核运行,Docker 引擎创建一个小的虚拟系统运行 Linux 并利用它的资源和内核。Windows Docker 客户端用虚拟化 Docker 引擎构建,运行以及管理 盒子以外的 Docker 容器。这里有个由 Boot2Docker 团队开发的名为 Boot2Docker 的应用程序,它创建运行在基于[Linux 微内核][1]的小型 Linux 系统上的虚拟机,是特意为在 Windows 上运行 [Docker][2] 容器开发的。它完全运行在 RAM 中,需要大约 27M 内存并能在 5s(YMMV,译者注:your mileage may vary,因人而异) 内启动。因此,在用于 Windows 的 Docker 引擎被开发出来之前,我们在 Windows 机器里只能运行 Linux 容器。 + +下面是安装 Docker 客户端并在上面运行容器的简单步骤。 + +### 1. 下载 Boot2Docker ### + +在我们开始安装之前,我们需要 Boot2Docker 的可执行文件。可以从 [它的 Github][3] 下载最新版本的 Boot2Docker。在这篇指南中,我们从网站中下载版本 v1.6.1。我们从那网页中用我们喜欢的浏览器或者下载管理器下载了名为 [docker-install.exe][4] 的文件。 + +![](http://blog.linoxide.com/wp-content/uploads/2015/05/downloading-boot2docker-installer.png) + +### 2. 安装 Boot2Docker ### + +现在我们运行安装文件,它会安装 Window Docker 客户端、用于 Windows 的 Git(MSYS-git)、VirtualBox、Boot2Docker Linux ISO 以及 Boot2Docker 管理工具,这些对于在盒子之外运行 Docker 引擎都至关重要。 + +![](http://blog.linoxide.com/wp-content/uploads/2015/05/boot2docker-installer.png) + +### 3. 运行 Boot2Docker ### + +![](http://blog.linoxide.com/wp-content/uploads/2015/05/boot2docker-start-icon-e1431322598697.png) + +安装完成必要的组件之后,我们从桌面 Boot2Docker 快捷方式启动 Boot2Docker。它会要求你输入以后用于验证的 SSH 密钥。然后会启动一个配置好的用于管理在虚拟机中运行的 Docker 的 unix shell。 + +![](http://blog.linoxide.com/wp-content/uploads/2015/05/starting-boot2docker.png) + +为了检查是否正确配置,运行下面的 docker version 命令。 + + docker version + +![](http://blog.linoxide.com/wp-content/uploads/2015/05/docker-version.png) + +### 4. 运行 Docker ### + +由于 **Boot2Docker Start** 自动启动了一个已经正确设置好环境变量的 shell,我们可以马上开始使用 Docker。**请注意,如果我们将 Boot2Docker 作为一个远程 Docker 守护进程,那么不要在 docker 命令之前加 sudo。** + +现在,让我们来试试 **hello-world** 例子镜像,它会下载 hello-world 镜像,运行并输出 "Hello from Docker" 信息。 + + $ docker run hello-world + +![](http://blog.linoxide.com/wp-content/uploads/2015/05/running-hello-world.png) + +### 5. 使用命令提示符(CMD) 运行 Docker### + +现在,如果你想开始用命令提示符使用 Docker,你可以打开命令提示符(CMD.exe)。由于 Boot2Docker 要求 ssh.exe 在 PATH 中,我们需要在命令提示符中输入以下命令使得 %PATH% 环境变量中包括 Git 安装目录下的 bin 文件夹。 + + set PATH=%PATH%;"c:\Program Files (x86)\Git\bin" + +![](http://blog.linoxide.com/wp-content/uploads/2015/05/docker-in-cmd.png) + +运行上面的命令之后,我们可以在命令提示符中运行 **boot2docker start** 启动 Boot2Docker 虚拟机。 + + boot2docker start + +![](http://blog.linoxide.com/wp-content/uploads/2015/05/docker-cmd-variables.png) + +**注意**: 如果你看到 machine does no exist 的错误信息,就运行 **boot2docker init** 命令。 + +然后复制控制台中的命令到 cmd.exe 中为控制台窗口设置环境变量,然后我们就可以像平常一样运行 docker 容器了。 + +### 6. 使用 PowerShell 运行 Docker ### + +为了能在 PowerShell 中运行 Docker,我们需要启动一个 PowerShell 窗口并添加 ssh.exe 到 PATH 变量。 + + $Env:Path = "${Env:Path};c:\Program Files (x86)\Git\bin" + +运行完上面的命令,我们还需要运行 + + boot2docker start + +![](http://blog.linoxide.com/wp-content/uploads/2015/05/docker-in-powershell.png) + +这会打印用于设置环境变量连接到虚拟机内部运行的 Docker 的 PowerShell 命令。我们只需要在 PowerShell 中运行这些命令就可以和平常一样运行 docker 容器。 + +### 7. 用 PUTTY 登录 ### + +Boot2Docker 在%USERPROFILE%\.ssh 目录生成和使用用于登录的公共和私有密钥,我们也需要使用这个文件夹中的私有密钥。私有密钥需要转换为 PuTTY 的格式。我们可以通过 puttygen.exe 实现。 + +我们需要打开 puttygen.exe 并从 %USERPROFILE%\.ssh\id_boot2docker 中导入("File"->"Load" 菜单)私钥,然后点击 "Save Private Key"。然后用保存的文件通过 PuTTY 用 docker@127.0.0.1:2022 登录。 + +### 8. Boot2Docker 选项 ### + +Boot2Docker 管理工具提供了一些命令,如下所示。 + + $ boot2docker + + Usage: boot2docker.exe [] {help|init|up|ssh|save|down|poweroff|reset|restart|config|status|info|ip|shellinit|delete|download|upgrade|version} [] + +### 总结 ### + +通过 Docker Windows 客户端使用 Docker 很有趣。Boot2Docker 管理工具是一个能使任何 Docker 容器能像在 Linux 主机上平稳运行的很棒的应用程序。如果你更仔细的话,你会发现 boot2docker 默认用户的用户名是 docker,密码是 tcuser。最新版本的 boot2docker 设置了一个 host-only 的网络适配器提供访问容器的端口。一般来说是 192.168.59.103,但可以通过 VirtualBox 的 DHCP 实现改变。如果你有任何问题、建议、反馈,请在下面的评论框中写下来然后我们可以改进或者更新我们的内容。非常感谢!Enjoy:-) + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/linux-how-to/run-docker-client-inside-windows-os/ + +作者:[Arun Pyasi][a] +译者:[ictlyh](https://github.com/ictlyh) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://linoxide.com/author/arunp/ +[1]:http://tinycorelinux.net/ +[2]:https://www.docker.io/ +[3]:https://github.com/boot2docker/windows-installer/releases/latest +[4]:https://github.com/boot2docker/windows-installer/releases/download/v1.6.1/docker-install.exe \ No newline at end of file From 33084d152870fb1434bc51b9a98d1c96f39d2206 Mon Sep 17 00:00:00 2001 From: wwy Date: Fri, 15 May 2015 16:05:24 +0800 Subject: [PATCH 032/965] =?UTF-8?q?[Translating]=20Guake=200.7.0=20Release?= =?UTF-8?q?d=20=E2=80=93=20A=20Drop-Down=20Terminal=20for=20Gnome=20Deskto?= =?UTF-8?q?ps?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...0.7.0 Released--A Drop-Down Terminal for Gnome Desktops.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/share/20150512 Guake 0.7.0 Released--A Drop-Down Terminal for Gnome Desktops.md b/sources/share/20150512 Guake 0.7.0 Released--A Drop-Down Terminal for Gnome Desktops.md index 40adc3390c..786acddff4 100644 --- a/sources/share/20150512 Guake 0.7.0 Released--A Drop-Down Terminal for Gnome Desktops.md +++ b/sources/share/20150512 Guake 0.7.0 Released--A Drop-Down Terminal for Gnome Desktops.md @@ -1,3 +1,5 @@ +translating by wwy-hust + Guake 0.7.0 Released – A Drop-Down Terminal for Gnome Desktops ================================================================================ Linux commandline is the best and most powerful thing that fascinates a new user and provides extreme power to experienced users and geeks. For those who work on Server and Production, they are already aware of this fact. It would be interesting to know that Linux console was one of those first features of the kernel that was written by Linus Torvalds way back in the year 1991. @@ -112,4 +114,4 @@ via: http://www.tecmint.com/install-guake-terminal-ubuntu-mint-fedora/ [a]:http://www.tecmint.com/author/avishek/ [1]:http://www.tecmint.com/linux-terminal-emulators/ -[2]:https://github.com/Guake/guake/releases/tag/0.7.0 \ No newline at end of file +[2]:https://github.com/Guake/guake/releases/tag/0.7.0 From 13a63f2765c354b9a46bd629f185b92afface4c7 Mon Sep 17 00:00:00 2001 From: DeadFire Date: Fri, 15 May 2015 16:16:05 +0800 Subject: [PATCH 033/965] =?UTF-8?q?20150515-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...working Commands with Docker Containers.md | 106 ++++++++++ ...w to Install Percona Server on CentOS 7.md | 188 ++++++++++++++++++ 2 files changed, 294 insertions(+) create mode 100644 sources/tech/20150515 Basic Networking Commands with Docker Containers.md create mode 100644 sources/tech/20150515 How to Install Percona Server on CentOS 7.md diff --git a/sources/tech/20150515 Basic Networking Commands with Docker Containers.md b/sources/tech/20150515 Basic Networking Commands with Docker Containers.md new file mode 100644 index 0000000000..d07c3b2507 --- /dev/null +++ b/sources/tech/20150515 Basic Networking Commands with Docker Containers.md @@ -0,0 +1,106 @@ +Basic Networking Commands with Docker Containers +================================================================================ +Hi everybody, today we'll learn some basic networking with Docker Containers. Docker is an Open Source project that provides an open platform to pack, ship and run any application as a lightweight container. It has no boundaries of Language support, Frameworks or packaging system and can be run anywhere, anytime from a small home computers to high-end servers. It makes them great building blocks for deploying and scaling web apps, databases, and back-end services without depending on a particular stack or provider. Docker is meant for networking as it is gradually used in data-centers, ISPs and much more networked servers. + +So, here are some basic networking commands that you can use on managing Docker Containers. + +### 1. Finding the Docker Interface ### + +Docker by default creates a bridge interface named docker0 which basically connects with the outside world. The docker containers running is directly connected with the bridge interface docker0. By default, docker assigns ip address 172.17.42.1/16 to the bridge interface docker0 which acts as a subnet for all the ip addresses of the running containers. It is pretty easy to get the Docker Interface's IP Address. To find out our docker0 bridge interface and the docker containers connected with the bridge we can simply run ip a command inside a terminal or a shell where Docker is installed. + + # ip a + +![Docker Interface](http://blog.linoxide.com/wp-content/uploads/2015/05/docker-interface.png) + +### 2. Getting the Docker Container's IP Address ### + +As we read above, docker creates a bridge interface named docker0 in the host machine. As we create a new docker container, it is automatically assigned with a new dynamic IP Address by default which is followed within the subnet range of the interface. So, to check the IP Address of the running Docker container, we'll need to get into a running container and check out the ip address as shown below. First, we'll run a new container and get into the container. If you have got a container running already, you may skip the first command below. + + # docker run -it ubuntu + +Now, we'll be able to run ip a in order to get the ip address of the running container. + + # ip a + +![Docker Container IP](http://blog.linoxide.com/wp-content/uploads/2015/05/docker-container-ip.png) + +### 3. Mapping the Expose port ### + +To map the exposed port configured in the Dockerfile for the container to the high port, we'll simply need to follow the docker command with -P flag. This will open the random port of the Docker Container to the port defined by the Dockerfile. So, here's an example of using the flag -P to open/expose the defined port. + + # docker run -itd -P httpd + +![Mapping Expose Port](http://blog.linoxide.com/wp-content/uploads/2015/05/mapping-expose-port.png) + +The above command will map container's port to port 80 as its defined in the Dockerfile of httpd. We can check the exposed port by viewing the running container using the following command. + + # docker ps + +And can use curl to check by running the below command. + + # curl http://localhost:49153 + +![Curl Exposed Port](http://blog.linoxide.com/wp-content/uploads/2015/05/curl-exposed-port-e1431034586219.png) + +### 4. Mapping to the Specific Port ### + +We can also map the expose port or docker container port to the port we specify or define. In order to map the container to a specific port of our choice, we'll need to define the port of our desire with the flag -p . Here's an example on how we can do that. + + # docker run -itd -p 8080:80 httpd + +The above command will map the port 8080 to port 80. We can check it by running curl to that port. + + # curl http://localhost:8080 + +![Mapping Specific Port](Curl Exposed Port) + +### 5. Creating own Bridge ### + +To assign a custom IP Address to the containers, we'll need to create a new bridge interface named bro in this tutorial. To assign a desired IP Address, we'll need to run the following command in the host machine running docker. + + # stop docker.io + # ip link add br0 type bridge + # ip addr add 172.30.1.1/20 dev br0 + # ip link set br0 up + # docker -d -b br0 + +![Creating Bridge Interface](http://blog.linoxide.com/wp-content/uploads/2015/05/creating-bridge-interface.png) + +After creating the docker bridge, we'll want to let the Docker Daemon know about it. + + # echo 'DOCKER_OPTS="-b=br0"' >> /etc/default/docker + # service docker.io start + +![Adding Interface to Docker](http://blog.linoxide.com/wp-content/uploads/2015/05/adding-interface-to-docker.png) + +Here, the bridged interface will range the docker containers with the ip address followed by bridge ip subnet . + +### 6. Linking one Container to another ### + +We can connect one container with the another container with Docker. We can run different apps on different containers and connect or link with each other. Links allow containers to connect with each other and securely transfer information about one container to another container. To do so, we'll use the --link flag. First, we'll use flag --name so that it will be easy to denote training/postgres image. + + # docker run -d --name db training/postgres + +![Running db Container](http://blog.linoxide.com/wp-content/uploads/2015/05/running-db-container.png) + +After done, we'll gonna link training/webapp with the container db that we create earlier forming a new container named web. + + # docker run -d -P --name web --link db:db training/webapp python app.py + +![linking two containers](http://blog.linoxide.com/wp-content/uploads/2015/05/linking-two-containers.png) + +### Conclusion ### + +Networking with Docker is fun and amazing cause there are many stuffs we can do with Docker Containers. These were some easy and basic networking commands that we can play with Docker. Networking with docker is really advanced. We can do many stuffs with it. If you have any questions, suggestions, feedback please write them in the comment box below so that we can improve or update our contents. Thank you ! Enjoy :-) + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/linux-how-to/networking-commands-docker-containers/ + +作者:[Arun Pyasi][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://linoxide.com/author/arunp/ \ No newline at end of file diff --git a/sources/tech/20150515 How to Install Percona Server on CentOS 7.md b/sources/tech/20150515 How to Install Percona Server on CentOS 7.md new file mode 100644 index 0000000000..03affe787e --- /dev/null +++ b/sources/tech/20150515 How to Install Percona Server on CentOS 7.md @@ -0,0 +1,188 @@ +How to Install Percona Server on CentOS 7 +================================================================================ +In this article we are going to learn about percona server, an opensource drop-in replacement for MySQL and also for MariaDB. The InnoDB database engine make it very attractive and a good alternative if you need performance, reliability and a cost efficient solution + +In the following sections I am going to cover the installation of the percona server on the CentOS 7, I will also cover the steps needed to make backup of your current data, configuration and how to restore your backup. + +### Table of contents ### + +1. What is and why use percona +1. Backup your databases +1. Remove previous SQL server +1. Installing Percona binaries +1. Configuring Percona +1. Securing your environment +1. Restore your backup + +### 1. What is and why use Percona ### + +Percona is an opensource alternative to the MySQL and MariaDB databases, it's a fork of the MySQL with many improvements and unique features that makes it more reliable, powerful and faster than MySQL, and yet is fully compatible with it, you can even use replication between Oracle's MySQL and Percona. + +#### Features exclusive to Percona #### + +- Partitioned Adaptive Hash Search +- Fast Checksum Algorithm +- Buffer Pool Pre-Load +- Support for FlashCache + +#### MySQL Enterprise and Percona specific features #### + +- Import Tables From Different Servers +- PAM authentication +- Audit Log +- Threadpool + +Now that you are pretty excited to see all these good things together, we are going show you how to install and do basic configuration of Percona Server. + +### 2. Backup your databases ### + +The following, command creates a mydatabases.sql file with the SQL commands to recreate/restore salesdb and employeedb databases, replace the databases names to reflect your setup, skip if this is a brand new setup + + mysqldump -u root -p --databases employeedb salesdb > mydatabases.sql + +Copy the current configuration file, you can also skip this in fresh setups + + cp my.cnf my.cnf.bkp + +### 3. Remove your previous SQL Server ### + +Stop the MySQL/MariaDB if it's running. + + systemctl stop mysql.service + +Uninstall MariaDB and MySQL + + yum remove MariaDB-server MariaDB-client MariaDB-shared mysql mysql-server + +Move / Rename the MariaDB files in **/var/lib/mysql**, it's a safer and faster than just removing, it's like a 2nd level instant backup. :) + + mv /var/lib/mysql /var/lib/mysql_mariadb + +### 4. Installing Percona binaries ### + +You can choose from a number of options on how to install Percona, in a CentOS system it's generally a better idea to use yum or RPM, so these are the way that are covered by this article, compiling and install from sources are not covered by this article. + +Installing from Yum repository: + +First you need to set the Percona's Yum repository with this: + + yum install http://www.percona.com/downloads/percona-release/redhat/0.1-3/percona-release-0.1-3.noarch.rpm + +And then install Percona with: + + yum install Percona-Server-client-56 Percona-Server-server-56 + +The above command installs Percona server and clients, shared libraries, possibly Perl and perl modules such as DBI::MySQL, if that are not already installed, and also other dependencies as needed. + +Installing from RPM package: + +We can download all rpm packages with the help of wget: + + wget -r -l 1 -nd -A rpm -R "*devel*,*debuginfo*" \ http://www.percona.com/downloads/Percona-Server-5.5/Percona-Server-5.5.42-37.1/binary/redhat/7/x86_64/ + +And with rpm utility, you install all the packages once: + + rpm -ivh Percona-Server-server-55-5.5.42-rel37.1.el7.x86_64.rpm \ Percona-Server-client-55-5.5.42-rel37.1.el7.x86_64.rpm \ Percona-Server-shared-55-5.5.42-rel37.1.el7.x86_64.rpm + +Note the backslash '\' on the end of the sentences on the above commands, if you install individual packages, remember that to met dependencies, the shared package must be installed before client and client before server. + +### 5. Configuring Percona Server ### + +#### Restoring previous configuration #### + +As we are moving from MariaDB, you can just restore the backup of my.cnf file that you made in earlier steps. + + cp /etc/my.cnf.bkp /etc/my.cnf + +#### Creating a new my.cnf #### + +If you need a new configuration file that fit your needs or if you don't have made a copy of my.cnf, you can use this wizard, it will generate for you, through simple steps. + +Here is a sample my.cnf file that comes with Percona-Server package + + # Percona Server template configuration + + [mysqld] + # + # Remove leading # and set to the amount of RAM for the most important data + # cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%. + # innodb_buffer_pool_size = 128M + # + # Remove leading # to turn on a very important data integrity option: logging + # changes to the binary log between backups. + # log_bin + # + # Remove leading # to set options mainly useful for reporting servers. + # The server defaults are faster for transactions and fast SELECTs. + # Adjust sizes as needed, experiment to find the optimal values. + # join_buffer_size = 128M + # sort_buffer_size = 2M + # read_rnd_buffer_size = 2M + datadir=/var/lib/mysql + socket=/var/lib/mysql/mysql.sock + + # Disabling symbolic-links is recommended to prevent assorted security risks + symbolic-links=0 + + [mysqld_safe] + log-error=/var/log/mysqld.log + pid-file=/var/run/mysqld/mysqld.pid + +After making your my.cnf file fit your needs, it's time to start the service: + + systemctl restart mysql.service + +If everything goes fine, your server is now up and ready to ready to receive SQL commands, you can try the following command to check: + + mysql -u root -p -e 'SHOW VARIABLES LIKE "version_comment"' + +If you can't start the service, you can look for a reason in **/var/log/mysql/mysqld.log** this file is set by the **log-error** option in my.cnf's **[mysqld_safe]** session. + + tail /var/log/mysql/mysqld.log + +You can also take a look in a file inside **/var/lib/mysql/** with name in the form of **[hostname].err** as the following example: + + tail /var/lib/mysql/centos7.err + +If this also fail in show what is wrong, you can also try strace: + + yum install strace && systemctl stop mysql.service && strace -f -f mysqld_safe + +The above command is extremely verbous and it's output is quite low level but can show you the reason you can't start service in most times. + +### 6. Securing your environment ### + +Ok, you now have your RDBMS ready to receive SQL queries, but it's not a good idea to put your precious data on a server without minimum security, it's better to make it safer with mysql_secure_instalation, this utility helps in removing unused default features, also set the root main password and make access restrictions for using this user. +Just invoke it by the shell and follow instructions on the screen. + + mysql_secure_install + +### 7. Restore your backup ### + +If you are coming from a previous setup, now you can restore your databases, just use mysqldump once again. + + mysqldump -u root -p < mydatabases.sql + +Congratulations, you just installed Percona on your CentOS Linux, your server is now fully ready for use; You can now use your service as it was MySQL, and your services are fully compatible with it. + +### Conclusion ### + +There is a lot of things to configure in order to achieve better performance, but here is some straightforward options to improve your setup. When using innodb engine it's also a good idea to set the **innodb_file_per_table** option **on**, it gonna distribute table indexes in a file per table basis, it means that each table have it's own index file, it makes the overall system, more robust and easier to repair. + +Other option to have in mind is the **innodb_buffer_pool_size** option, InnoDB should have large enough to your datasets, and some value **between 70% and 80%** of the total available memory should be reasonable. + +By setting the **innodb-flush-method** to **O_DIRECT** you disable write cache, if you have **RAID**, this should be set to improved performance as this cache is already done in a lower level. + +If your data is not that critical and you don't need fully **ACID** compliant transactions, you can adjust to 2 the option **innodb_flush_log_at_trx_commit**, this will also lead to improved performance. + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/linux-how-to/percona-server-centos-7/ + +作者:[Carlos Alberto][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://linoxide.com/author/carlosal/ \ No newline at end of file From 2e83a483ef099cbf1cb668f3385582b78f7fcc57 Mon Sep 17 00:00:00 2001 From: DeadFire Date: Fri, 15 May 2015 16:41:50 +0800 Subject: [PATCH 034/965] =?UTF-8?q?20150515-2=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...5 Apps You Didn't Know You Were Missing.md | 103 ++++++++++ ... Instagram Style Filters to Your Photos.md | 71 +++++++ ... System to Preserve Privacy and Anonymity.md | 179 ++++++++++++++++++ 3 files changed, 353 insertions(+) create mode 100644 sources/share/20150515 New to Linux 5 Apps You Didn't Know You Were Missing.md create mode 100644 sources/share/20150515 This Ubuntu App Applies Instagram Style Filters to Your Photos.md create mode 100644 sources/tech/20150515 Install 'Tails 1.4′ Linux Operating System to Preserve Privacy and Anonymity.md diff --git a/sources/share/20150515 New to Linux 5 Apps You Didn't Know You Were Missing.md b/sources/share/20150515 New to Linux 5 Apps You Didn't Know You Were Missing.md new file mode 100644 index 0000000000..99b4b1915f --- /dev/null +++ b/sources/share/20150515 New to Linux 5 Apps You Didn't Know You Were Missing.md @@ -0,0 +1,103 @@ +New to Linux? 5 Apps You Didn’t Know You Were Missing +================================================================================ +![](http://cdn.makeuseof.com/wp-content/uploads/2015/05/linux-apps-840x420.jpg?92a7a3) + +When you moved to Linux, you went straight for the obvious browsers, cloud clients, music players, email clients, and perhaps image editors, right? As a result, you’ve missed several vital, productive tools. Here’s a roundup of five umissable Linux apps that you really need to install. + +### [Synergy][1] ### + +Synergy is a godsend if you use multiple desktops. It’s an open-source app that allows you to use a single mouse and keyboard across multiple computers, displays, and operating systems. Switching the mouse and keyboard functionality between the desktops is easy. Just move the mouse out the edge of one screen and into another. + +![](http://cdn.makeuseof.com/wp-content/uploads/2015/04/multiple-monitors-640x431.jpg?92a7a3) + +When you open Synergy for the first time, it will run you through the setup wizard. The primary desktop is the one whose input devices you’ll be sharing with the other desktops. Configure that as the server. Add the remaining computers as clients. + +![](http://cdn.makeuseof.com/wp-content/uploads/2015/04/synergy-setup-wizard-640x480.jpg?92a7a3) + +Synergy maintains a common clipboard across all connected desktops. It also merges the lock screen setup, i.e. you need to bypass the lock screen just once to log in to all the computers together. Under **Edit > Settings**, you can make a few more tweaks such as adding a password and setting Synergy to launch on startup. + +### [BasKet Note Pads][2] ### + +Using BasKet Note Pads is somewhat like mapping your brain onto a computer. It helps make sense of all the ideas floating around in your head by allowing you to organize them in digestible chunks. You can use BasKet Note Pads for various tasks such as taking notes, creating idea maps and to-do lists, saving links, managing research, and keeping track of project data. + +Each main idea or project goes into a section called a basket. To split ideas further, you can have one or more sub-baskets or sibling baskets. The baskets are further broken down into notes, which hold all the bits and pieces of a project. You can group them, tag them, and filter them. + +The left pane in the application’s two-pane structure displays a tree-like view of all the baskets you have created. + +![](http://cdn.makeuseof.com/wp-content/uploads/2015/04/basket-note-pads-640x480.jpg?92a7a3) + +BasKet Note Pads might seem a little complex on day one, but you’ll get the hang of it soon. When you’re not using it, the app sits in the system tray, ready for quick access. + +Want a [simpler note-taking alternative][3] on Linux? Try [Springseed][4]. + +### [Caffeine][5]### + +How do you ensure that your computer doesn’t go to sleep right in the middle of an [interesting movie][6]? Caffeine is the answer. No, you don’t need to brew a cup of coffee for your computer. You just need to install a lightweight indicator applet called Caffeine. It prevents the screen-saver, lock screen, or the Sleep mode from being activated when the computer is idle, only if the current window is in full-screen mode. + +To install the applet, [download its latest version][7]. If you want to go [the ppa way][8], here’s how you can: + + $ sudo add-apt-repository ppa:caffeine-developers/ppa + $ sudo apt-get update + $ sudo apt-get install caffeine + +On Ubuntu versions 14.10 and 15.04 (and their derivatives), you’ll also need to install certain dependency packages: + + $ sudo apt-get install libappindicator3-1 gir1.2-appindicator3-0.1 + +After finishing the installation, add **caffeine-indicator** to your list of startup applications to make the indicator appear in the system tray. You can turn Caffeine’s functionality on and off via the app’s context menu, which pops up when you right-click on the tray icon. + +![](http://cdn.makeuseof.com/wp-content/uploads/2015/04/caffeine-indicator-640x480.jpg?92a7a3) + +### Easystroke ### + +Easystroke makes an excellent [Linux mouse hack][9]. Use it to set up a series of customized mouse/touchpad/pen gestures to simulate common actions such as keystrokes, commands, and scrolls. Setting up Easystroke gestures is straightforward enough, thanks to the clear instructions that appear at all the right moments when you’re navigating the UI. + +![](http://cdn.makeuseof.com/wp-content/uploads/2015/04/easystroke-record-640x480.jpg?92a7a3) + +Begin by choosing the mouse button you’d like to use for performing gestures. Throw in a modifier if you like. You’ll find this setting under **Preferences > Behavior > Gesture Button**. Now head to the **Actions** tab and record strokes for your most commonly used actions. + +![](http://cdn.makeuseof.com/wp-content/uploads/2015/04/easytroke-actions-640x480.jpg?92a7a3) + +Using the **Preferences** and **Advanced** tabs, you can make other tweaks like setting Easystroke to autostart, adding a system tray icon, and changing scroll speed. + +### Guake ### + +I saved my favorite Linux find for last. Guake is a dropdown command line modeled after the one in the first-person shooter video game [Quake][10]. Whether you’re [learning about terminal commands][11] or executing them on a regular basis, Guake is a great way to keep the terminal handy. You can bring it up or hide it in a single keystroke. + +As you can see in the image below, when in action, Guake appears as an overlay on the current window. Right-click within the terminal to access the **Preferences** section, from where you can change Guake’s appearance, its scroll action, keyboard shortcuts, and more. + +![](http://cdn.makeuseof.com/wp-content/uploads/2015/04/guake-terminal-640x480.jpg?92a7a3) + +If KDE is your [Linux desktop of choice][12], do check out [Yakuake][13], which provides a similar functionality. + +### Name Your Favorite Linux Discovery! ### + +There are many more [super useful Linux apps][14] waiting to be discovered. Rest assured that we’ll keep introducing you to them. + +Which Linux app were you happiest to learn about? Which one do you consider a must-have? Tell us in the comments. + +-------------------------------------------------------------------------------- + +via: http://www.makeuseof.com/tag/new-linux-5-apps-didnt-know-missing/ + +作者:[Akshata][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.makeuseof.com/tag/author/akshata/ +[1]:http://synergy-project.org/ +[2]:http://basket.kde.org/ +[3]:http://www.makeuseof.com/tag/try-these-3-beautiful-note-taking-apps-that-work-offline/ +[4]:http://getspringseed.com/ +[5]:https://launchpad.net/caffeine +[6]:http://www.makeuseof.com/tag/popular-apps-movies-according-google/ +[7]:http://ppa.launchpad.net/caffeine-developers/ppa/ubuntu/pool/main/c/caffeine/ +[8]:http://www.makeuseof.com/tag/ubuntu-ppa-technology-explained/ +[9]:http://www.makeuseof.com/tag/4-astounding-linux-mouse-hacks/ +[10]:http://en.wikipedia.org/wiki/Quake_%28video_game%29 +[11]:http://www.makeuseof.com/tag/4-ways-teach-terminal-commands-linux-si/ +[12]:http://www.makeuseof.com/tag/10-top-linux-desktop-environments-available/ +[13]:https://yakuake.kde.org/ +[14]:http://www.makeuseof.com/tag/linux-treasures-x-sublime-native-linux-apps-will-make-want-switch/ \ No newline at end of file diff --git a/sources/share/20150515 This Ubuntu App Applies Instagram Style Filters to Your Photos.md b/sources/share/20150515 This Ubuntu App Applies Instagram Style Filters to Your Photos.md new file mode 100644 index 0000000000..b9ff371e5f --- /dev/null +++ b/sources/share/20150515 This Ubuntu App Applies Instagram Style Filters to Your Photos.md @@ -0,0 +1,71 @@ +This Ubuntu App Applies Instagram Style Filters to Your Photos +================================================================================ +**Looking for an Ubuntu app to apply Instagram style filters to your photos in Ubuntu?** + +Grab your selfie stick and step this way… + +![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/05/instagram-app.jpg) +XnRetro is a photo editing app + +### XnRetro Photo Editor ### + +**XnRetro** is a simple image editing application that lets you quickly add “Instagram like” effects to your photos. + +You know the sort of effects I’m talking about: scratches, noises, and frames, over processing, vintage washes and nostalgic tints (because in this age of digital transience we must know that endless selfies and sandwich snaps are unlikely to ever become nostalgic of themselves). + +Whether you consider such effects to be of asinine artistic value or shortcut to being creative, these kinds of filters are popular and can help add a splash of personality to an otherwise so-so photo. + +#### XnRetro Features #### + +**XnRetro features the following:** + +- 20 color filters +- 15 light effects (bokeh, leaks, etc) +- 28 frames and borders +- 5 Vignettes (with strength control) +- Image adjustments for contrast, gamma, saturation, etc +- Square crop option + +![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/05/Screen-Shot-2015-05-10-at-23.30.01-e1431297068833.png) +Small tweak to make light effects work + +You can save edited images (in theory) as .jpg or .png files and share them straight to social media from within the app. + +I say “in theory” because .jpg saving doesn’t actually work in the Linux version of the app (you can save edited images as .png files though). Similarly, most of the built-in social networking links are borked or just flat out fail on export. + +To get the **15 light leaks** to work you will need to re-save each .jpg image in XnRetro ‘light’ folder as a .png file. Edit the ‘light.xml’ to match the new file names, hit save and the light effects will load up in XnRetro without issue. + +> ‘For user-friendly image editing XnRetro is hard to beat — once you make it work.’ + +**Is XnRetro Worth Installing?** + +XnRetro is not perfect. It’s is pretty old-looking, difficult to properly install and has not been updated for several years. + +It does still work, barring .jpg saving, and is a nimble alternative to an advanced app like The Gimp or Shotwell’s set of ‘serious’ image adjustment tools. + +While web apps and Chrome Apps¹ like [Pixlr Touch Up][1] and [Polarr][2] offer similar features you may be looking for a truly native solution. + +And for that, for user-friendly image editing based around easy-to-apply filters, XnRetro is hard to beat. + +### Download XnRetro for Ubuntu ### + +XnRetro is not available as an installable .deb package. It is distributed as a binary file, meaning you need to double-click on the program file run it each and every time. It’s also 32-bit only. + +You can download XnRetro using the link below. Once completed you need to extract the archive and enter the folder it creates. Double-click on the ‘xnretro’ program binary inside. + +- [Download XnRetro for Linux (32bit, tar.gz)][3] + +-------------------------------------------------------------------------------- + +via: http://www.omgubuntu.co.uk/2015/05/instagram-photo-filters-ubuntu-desktop-app + +作者:[Joey-Elijah Sneddon][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://plus.google.com/117485690627814051450/?rel=author +[1]:http://www.omgchrome.com/?s=pixlr +[2]:http://www.omgchrome.com/the-best-chrome-apps-of-2014/ +[3]:http://www.xnview.com/en/xnretro/#downloads \ No newline at end of file diff --git a/sources/tech/20150515 Install 'Tails 1.4′ Linux Operating System to Preserve Privacy and Anonymity.md b/sources/tech/20150515 Install 'Tails 1.4′ Linux Operating System to Preserve Privacy and Anonymity.md new file mode 100644 index 0000000000..8d0d5ccbdf --- /dev/null +++ b/sources/tech/20150515 Install 'Tails 1.4′ Linux Operating System to Preserve Privacy and Anonymity.md @@ -0,0 +1,179 @@ +Install ‘Tails 1.4′ Linux Operating System to Preserve Privacy and Anonymity +================================================================================ +In this Internet world and the world of Internet we perform most of our task online be it Ticket booking, Money transfer, Studies, Business, Entertainment, Social Networking and what not. We spend a major part of our time online daily. It has been getting hard to remain anonymous with each passing day specially when backdoors are being planted by organizations like NSA (National Security Agency) who are putting their nose in between every thing that we come across online. We have least or no privacy online. All the searches are logged upon the basis of user Internet surfing activity and machine activity. + +A wonderful browser from Tor project is used by millions which help us surfing the web anonymously however it is not difficult to trace your browsing habits and hence tor alone is not the guarantee of your safety online. You may like to check Tor features and installation instructions here: + +- [Anonymous Web Browsing using Tor][1] + +There is a operating system named Tails by Tor Projects. Tails (The Amnesic Incognito Live System) is a live operating system, based on Debian Linux distribution, which mainly focused on preserving privacy and anonymity on the web while browsing internet, means all it’s outgoing connection are forced to pass through the Tor and direct (non-anonymous) requests are blocked. The system is designed to run from any boot-able media be it USB stick or DVD. + +The latest stable release of Tails OS is 1.4 which was released on May 12, 2015. Powered by open source Monolithic Linux Kernel and built on top of Debian GNU/Linux Tails aims at Personal Computer Market and includes GNOME 3 as default user Interface. + +#### Features of Tails OS 1.4 #### + +- Tails is a free operating system, free as in beer and free as in speech. +- Built on top of Debian/GNU Linux. The most widely used OS that is Universal. +- Security Focused Distribution. +- Windows 8 camouflage. +- Need not to be installed and browse Internet anonymously using Live Tails CD/DVD. +- Leave no trace on the computer, while tails is running. +- Advanced cryptographic tools used to encrypt everything that concerns viz., files, emails, etc. +- Sends and Receive traffic through tor network. +- In true sense it provides privacy for anyone, anywhere. +- Comes with several applications ready to be used from Live Environment. +- All the softwares comes per-configured to connect to INTERNET only through Tor network. +- Any application that tries to connect to Internet without Tor Network is blocked, automatically. +- Restricts someone who is watching what sites you visit and restricts sites to learn your geographical location. +- Connect to websites that are blocked and/or censored. +- Designed specially not to use space used by parent OS even when there is free swap space. +- The whole OS loads on RAM and is flushed when we reboot/shutdown. Hence no trace of running. +- Advanced security implementation by encrypting USB disk, HTTPS ans Encrypt and sign emails and documents. + +#### What can you expect in Tails 1.4 #### + +- Tor Browser 4.5 with a security Slider. +- Tor Upgraded to version 0.2.6.7. +- Several Security holes fixed. +- Many of the bug fixed and patches applied to Applications like curl, OpenJDK 7, tor Network, openldap, etc. + +To get a complete list of change logs you may visit [HERE][2] + +**Note**: It is strongly recommended to upgrade to Tails 1.4, if you’re using any older version of Tails. + +#### Why should I use Tails Operating System #### + +You need Tails because you need: + +- Freedom from network surveillance +- Defend freedom, privacy and confidentiality +- Security aka traffic analysis + +This tutorial will walk through the installation of Tails 1.4 OS with a short review. + +### Tails 1.4 Installation Guide ### + +1. To download the latest Tails OS 1.4, you may use wget command to download directly. + + $ wget http://dl.amnesia.boum.org/tails/stable/tails-i386-1.4/tails-i386-1.4.iso + +Alternatively you may download Tails 1.4 Direct ISO image or use a Torrent Client to pull the iso image file for you. Here is the link to both downloads: + +- [tails-i386-1.4.iso][3] +- [tails-i386-1.4.torrent][4] + +2. After downloading, verify ISO Integrity by matching SHA256 checksum with the SHA256SUM provided on the official website.. + + $ sha256sum tails-i386-1.4.iso + + 339c8712768c831e59c4b1523002b83ccb98a4fe62f6a221fee3a15e779ca65d + +If you are interested in knowing OpenPGP, checking Tails signing key against Debian keyring and anything related to Tails cryptographic signature, you may like to point your browser [HERE][5]. + +3. Next you need to write the image to USB stick or DVD ROM. You may like to check the article, [How to Create Live Bootable USB][6] for details on how to make a flash drive bootable and write ISO to it. + +4. Insert the Tails OS Bootable flash drive or DVD ROM in the disk and boot from it (select from BIOS to boot). The first screen – two options to select from ‘Live‘ and ‘Live (failsafe)‘. Select ‘Live‘ and press Enter. + +![Tails Boot Menu](http://www.tecmint.com/wp-content/uploads/2015/05/1.png) +Tails Boot Menu + +5. Just before login. You have two options. Click ‘More Options‘ if you want to configure and set advanced options else click ‘No‘. + +![Tails Welcome Screen](http://www.tecmint.com/wp-content/uploads/2015/05/2.png) +Tails Welcome Screen + +6. After clicking Advanced option, you need to setup root password. This is important if you want to upgrade it. This root password is valid till you shutdown/reboot the machine. + +Also you may enable Windows Camouflage, if you want to run this OS on a public place, so that it seems as you are running Windows 8 operating system. Good option indeed! Is not it? Also you have a option to configure Network and Mac Address. Click ‘Login‘ when done!. + +![Tails OS Configuration](http://www.tecmint.com/wp-content/uploads/2015/05/3.png) +Tails OS Configuration + +7. This is Tails GNU/Linux OS camouflaged by Windows Skin. + +![Tails Windows Look](http://www.tecmint.com/wp-content/uploads/2015/05/4.jpg) +Tails Windows Look + +8. It will start Tor Network in the background. Check the Notification on the top-right corner of the screen – Tor is Ready / You are now connected to the Internet. + +Also check what it contains under Internet Menu. Notice – It has Tor Browser (safe) and Unsafe Web Browser (Where incoming and outgoing data don’t pass through TOR Network) along with other applications. + +![Tails Menu and Tools](http://www.tecmint.com/wp-content/uploads/2015/05/5.jpg) +Tails Menu and Tools + +9. Click Tor and check your IP Address. It confirms my physical location is not shared and my privacy is intact. + +![Check Privacy on Tails](http://www.tecmint.com/wp-content/uploads/2015/05/6.jpg) +Check Privacy on Tails + +10. You may Invoke Tails Installer to clone & Install, Clone & Upgrade and Upgrade from ISO. + +![Tails Installer Options](http://www.tecmint.com/wp-content/uploads/2015/05/7.jpg) +Tails Installer Options + +11. The other option was to select Tor without any advanced option, just before login (Check step #5 above). + +![Tails Without Advance Option](http://www.tecmint.com/wp-content/uploads/2015/05/8.png) +Tails Without Advance Option + +12. You will get log-in to Gnome3 Desktop Environment. + +![Tails Gnome Desktop](http://www.tecmint.com/wp-content/uploads/2015/05/9.png) +Tails Gnome Desktop + +13. If you click to Launch Unsafe browser in Camouflage or without Camouflage, you will be notified. + +![Tails Browsing Notification](http://www.tecmint.com/wp-content/uploads/2015/05/10.png) +Tails Browsing Notification + +If you do, this is what you get in a Browser. + +![Tails Browsing Alert](http://www.tecmint.com/wp-content/uploads/2015/05/11.png) +Tails Browsing Alert + +#### Is Tails for me? #### + +To get the above question answered, first answer a few question. + +- Do you need your privacy to be intact while you are online? +- Do you want to remain hidden from Identity thieves? +- Do you want somebody to put your nose in between your private chat online? +- Do you really want to show your geographical location to anybody there? +- Do you carry out banking transactions online? +- Are you happy with the censorship by government and ISP? + +If the answer to any of the above question is ‘YES‘ you preferably need Tails. If answer to all the above question is ‘NO‘ you perhaps don’t need it. + +To know more about Tails? Point your browser to user Documentation : [https://tails.boum.org/doc/index.en.html][7] + +### Conclusion ### + +Tails is an OS which is must for those who work in an unsafe environment. An OS focused on security yet contains bundles of Application – Gnome Desktop, Tor, Firefox (Iceweasel), Network Manager, Pidgin, Claws mail, Liferea feed addregator, Gobby, Aircrack-ng, I2P. + +It also contain several tools for Encryption and Privacy Under the Hood, viz., LUKS, GNUPG, PWGen, Shamir’s Secret Sharing, Virtual Keyboard (against Hardware Keylogging), MAT, KeePassX Password Manager, etc. + +That’s all for now. Keep Connected to Tecmint. Share your thoughts on Tails GNU/Linux Operating System. What do you think about the future of the Project? Also test it Locally and let us know your experience. + +You may run it in [Virtualbox][8] as well. Remember Tails loads the whole OS in RAM hence give enough RAM to run Tails in VM. + +I tested in 1GB Environment and it worked without lagging. Thanks to all our readers for their Support. In making Tecmint a one place for all Linux related stuffs your co-operation is needed. Kudos! + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/install-tails-1-4-linux-operating-system-to-preserve-privacy-and-anonymity/ + +作者:[Avishek Kumar][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/avishek/ +[1]:http://www.tecmint.com/tor-browser-for-anonymous-web-browsing/ +[2]:https://tails.boum.org/news/version_1.4/index.en.html +[3]:http://dl.amnesia.boum.org/tails/stable/tails-i386-1.4/tails-i386-1.4.iso +[4]:https://tails.boum.org/torrents/files/tails-i386-1.4.torrent +[5]:https://tails.boum.org/download/index.en.html#verify +[6]:http://www.tecmint.com/install-linux-from-usb-device/ +[7]:https://tails.boum.org/doc/index.en.html +[8]:http://www.tecmint.com/install-virtualbox-on-redhat-centos-fedora/ \ No newline at end of file From 28f553a3d1fd3c459aac701ccaced37f6db2bce2 Mon Sep 17 00:00:00 2001 From: wi-cuckoo Date: Sat, 16 May 2015 00:07:39 +0800 Subject: [PATCH 035/965] translated wi-cuckoo --- ...r and Remove Unwanted Packages in Linux.md | 184 ------------------ ...r and Remove Unwanted Packages in Linux.md | 177 +++++++++++++++++ 2 files changed, 177 insertions(+), 184 deletions(-) delete mode 100644 sources/tech/20150504 Useful Commands to Create Commandline Chat Server and Remove Unwanted Packages in Linux.md create mode 100644 translated/tech/20150504 Useful Commands to Create Commandline Chat Server and Remove Unwanted Packages in Linux.md diff --git a/sources/tech/20150504 Useful Commands to Create Commandline Chat Server and Remove Unwanted Packages in Linux.md b/sources/tech/20150504 Useful Commands to Create Commandline Chat Server and Remove Unwanted Packages in Linux.md deleted file mode 100644 index cbcd668b14..0000000000 --- a/sources/tech/20150504 Useful Commands to Create Commandline Chat Server and Remove Unwanted Packages in Linux.md +++ /dev/null @@ -1,184 +0,0 @@ -translating wi-cuckoo -Useful Commands to Create Commandline Chat Server and Remove Unwanted Packages in Linux -================================================================================ -Here we are with the next part of Linux Command Line Tips and Tricks. If you missed our previous post on Linux Tricks you may find it here. - -- [5 Linux Command Line Tricks][1] - -In this post we will be introducing 6 command Line tips namely create Linux Command line chat using Netcat command, perform addition of a column on the fly from the output of a command, remove orphan packages from Debian and CentOS, get local and remote IP from command Line, get colored output in terminal and decode various color code and last but not the least hash tags implementation in Linux command Line. Lets check them one by one. - -![Linux Commandline Chat Server](http://www.tecmint.com/wp-content/uploads/2015/04/linux-commandline-chat-server.jpg) -6 Useful Commandline Tricks and Tips - -### 1. Create Linux Commandline Chat Server ### - -We all have been using chat service since a long time. We are familiar with Google chat, Hangout, Facebook chat, Whatsapp, Hike and several other application and integrated chat services. Do you know Linux nc command can make your Linux box a chat server with just one line of command. -What is nc command in Linux and what it does? - -nc is the depreciation of Linux netcat command. The nc utility is often referred as Swiss army knife based upon the number of its built-in capabilities. It is used as debugging tool, investigation tool, reading and writing to network connection using TCP/UDP, DNS forward/reverse checking. - -It is prominently used for port scanning, file transferring, backdoor and port listening. nc has the ability to use any local unused port and any local network source address. - -Use nc command (On Server with IP address: 192.168.0.7) to create a command line messaging server instantly. - - $ nc -l -vv -p 11119 - -Explanation of the above command switches. - -- -v : means Verbose -- -vv : more verbose -- -p : The local port Number - -You may replace 11119 with any other local port number. - -Next on the client machine (IP address: 192.168.0.15) run the following command to initialize chat session to machine (where messaging server is running). - - $ nc 192.168.0.7 11119 - -![Linux Commandline Chat with nc Command](http://www.tecmint.com/wp-content/uploads/2015/04/Chat-on-Linux-Commandline.gif) - -**Note**: You can terminate chat session by hitting ctrl+c key and also nc chat is one-to-one service. - -### 2. How to Sum Values in a Column in Linux ### - -How to sum the numerical values of a column, generated as an output of a command, on the fly in the terminal. - -The output of the ‘ls -l‘ command. - - $ ls -l - -![Sum Numerical Values](http://www.tecmint.com/wp-content/uploads/2015/04/Sum-Values.gif) - -Notice that the second column is numerical which represents number of symbolic links and the 5th column is numerical which represents the size of he file. Say we need to sum the values of fifth column on the fly. - -List the content of 5th column without printing anything else. We will be using ‘awk‘ command to do this. ‘$5‘ represents 5th column. - - $ ls -l | awk '{print $5}' - -![List Content Column](http://www.tecmint.com/wp-content/uploads/2015/04/List-Content-Column.gif) - -Now use awk to print the sum of the output of 5th column by pipelining it. - - $ ls -l | awk '{print $5}' | awk '{total = total + $1}END{print total}' - -![Sum and Print Columns](http://www.tecmint.com/wp-content/uploads/2015/04/Sum-Columns.gif) - -### How to Remove Orphan Packages in Linux? ### - -Orphan packages are those packages that are installed as a dependency of another package and no longer required when the original package is removed. - -Say we installed a package gtprogram which was dependent of gtdependency. We can’t install gtprogram unless gtdependency is installed. - -When we remove gtprogram it won’t remove gtdependency by default. And if we don’t remove gtdependency, it will remain as Orpahn Package with no connection to any other package. - - # yum autoremove [On RedHat Systems] - -![Remove Orphan Packages in CentOS](http://www.tecmint.com/wp-content/uploads/2015/04/Remove-Orphan-Packages-in-CentOS1.gif) - - # apt-get autoremove [On Debian Systems] - -![Remove Orphan Packages in Debian](http://www.tecmint.com/wp-content/uploads/2015/04/Remove-Orphan-Packages-in-Debian.gif) - -You should always remove Orphan Packages to keep the Linux box loaded with just necessary stuff and nothing else. - -### 4. How to Get Local and Public IP Address of Linux Server ### - -To get you local IP address run the below one liner script. - - $ ifconfig | grep "inet addr:" | awk '{print $2}' | grep -v '127.0.0.1' | cut -f2 -d: - -You must have installed ifconfig, if not, apt or yum the required packages. Here we will be pipelining the output of ifconfig with grep command to find the string “intel addr:”. - -We know ifconfig command is sufficient to output local IP Address. But ifconfig generate lots of other outputs and our concern here is to generate only local IP address and nothing else. - - # ifconfig | grep "inet addr:" - -![Check Local IP Address](http://www.tecmint.com/wp-content/uploads/2015/04/Check-Local-IP-Address.gif) - -Although the output is more custom now, but we need to filter our local IP address only and nothing else. For this we will use awk to print the second column only by pipelining it with the above script. - - # ifconfig | grep “inet addr:” | awk '{print $2}' - -![Filter Only IP Address](http://www.tecmint.com/wp-content/uploads/2015/04/Filter-IP-Address.gif) - -Clear from the above image that we have customised the output very much but still not what we want. The loopback address 127.0.0.1 is still there in the result. - -We use use -v flag with grep that will print only those lines that don’t match the one provided in argument. Every machine have the same loopback address 127.0.0.1, so use grep -v to print those lines that don’t have this string, by pipelining it with above output. - - # ifconfig | grep "inet addr" | awk '{print $2}' | grep -v '127.0.0.1' - -![Print IP Address](http://www.tecmint.com/wp-content/uploads/2015/04/Print-IP-Address.gif) - -We have almost generated desired output, just replace the string `(addr:)` from the beginning. We will use cut command to print only column two. The column 1 and column 2 are not separated by tab but by `(:)`, so we need to use delimiter `(-d)` by pipelining the above output. - - # ifconfig | grep "inet addr:" | awk '{print $2}' | grep -v '127.0.0.1' | cut -f2 -d: - -![Customized IP Address](http://www.tecmint.com/wp-content/uploads/2015/04/Custome-IP-Address.gif) - -Finally! The desired result has been generated. - -### 5. How to Color Linux Terminal ### - -You might have seen colored output in terminal. Also you would be knowing to enable/disable colored output in terminal. If not you may follow the below steps. - -In Linux every user has `'.bashrc'` file, this file is used to handle your terminal output. Open and edit this file with your choice of editor. Note that, this file is hidden (dot beginning of file means hidden). - - $ vi /home/$USER/.bashrc - -Make sure that the following lines below are uncommented. ie., it don’t start with a #. - - if [ -x /usr/bin/dircolors ]; then - test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dirc$ - alias ls='ls --color=auto' - #alias dir='dir --color=auto' - #alias vdir='vdir --color=auto' - - alias grep='grep --color=auto' - alias fgrep='fgrep --color=auto' - alias egrep='egrep --color=auto' - fi - -![User .bashrc File](http://www.tecmint.com/wp-content/uploads/2015/04/bashrc-file.gif) - -Once done! Save and exit. To make the changes taken into effect logout and again login. - -Now you will see files and folders are listed in various colors based upon type of file. To decode the color code run the below command. - - $ dircolors -p - -Since the output is too long, lets pipeline the output with less command so that we get output one screen at a time. - - $ dircolors -p | less - -![Linux Color Output](http://www.tecmint.com/wp-content/uploads/2015/04/Linux-Color-Output.gif) - -### 6. How to Hash Tag Linux Commands and Scripts ### - -We are using hash tags on Twitter, Facebook and Google Plus (may be some other places, I have not noticed). These hash tags make it easier for others to search for a hash tag. Very few know that we can use hash tag in Linux command Line. - -We already know that `#` in configuration files and most of the programming languages is treated as comment line and is excluded from execution. - -Run a command and then create a hash tag of the command so that we can find it later. Say we have a long script that was executed in point 4 above. Now create a hash tag for this. We know ifconfig can be run by sudo or root user hence acting as root. - - # ifconfig | grep "inet addr:" | awk '{print $2}' | grep -v '127.0.0.1' | cut -f2 -d: #myip - -The script above has been hash tagged with ‘myip‘. Now search for the hash tag in reverse-i-serach (press ctrl+r), in the terminal and type ‘myip‘. You may execute it from there, as well. - -![Create Command Hash Tags](http://www.tecmint.com/wp-content/uploads/2015/04/Create-Command-Hash-Tags.gif) - -You may create as many hash tags for every command and find it later using reverse-i-search. - -That’s all for now. We have been working hard to produce interesting and knowledgeable contents for you. What do you think how we are doing? Any suggestion is welcome. You may comment in the box below. Keep connected! Kudos. - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/linux-commandline-chat-server-and-remove-unwanted-packages/ - -作者:[Avishek Kumar][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://www.tecmint.com/author/avishek/ -[1]:http://www.tecmint.com/5-linux-command-line-tricks/ diff --git a/translated/tech/20150504 Useful Commands to Create Commandline Chat Server and Remove Unwanted Packages in Linux.md b/translated/tech/20150504 Useful Commands to Create Commandline Chat Server and Remove Unwanted Packages in Linux.md new file mode 100644 index 0000000000..cd90e2bfb7 --- /dev/null +++ b/translated/tech/20150504 Useful Commands to Create Commandline Chat Server and Remove Unwanted Packages in Linux.md @@ -0,0 +1,177 @@ +Linux中,创建聊天服务器、移除冗余软件包的实用命令 +============================================================================= +这里,我们来看Linux命令行实用技巧的下一个部分。如果你错过了Linux Tracks之前的文章,可以从这里找到。 + +- [5 Linux Command Line Tracks][1] + +本篇中,我们将会介绍6个命令行小技巧,包括使用Netcat命令创建Linux命令行聊天,从某个命令的输出中对某一列做加法,移除Debian和CentOS上多余的包,从命令行中获取本地与远程的IP地址,在终端获得彩色的输出与解码各样的颜色,最后是Linux命令行里井号标签的使用。让我们来一个一个地看一下。 + +![Linux Commandline Chat Server](http://www.tecmint.com/wp-content/uploads/2015/04/linux-commandline-chat-server.jpg) +6个实用的命令行技巧 + +### 1. 创建Linux命令行聊天服务 ### +我们大家使用聊天服务都有很长一段时间了。对于Google Chat,Hangout,Facebook Chat,Whatsapp,Hike和其他一些应用与集成的聊天服务,我们都很熟悉了。那你知道Linux的nc命令可以使你的Linux盒子变成一个聊天服务器,而仅仅只需要一行命令吗。什么是nc命令,它又是怎么工作的呢? + +nc是Linux netcat命令的旧版。nc就像瑞士军刀一样,内建呢大量的功能。nc可用做调式工具,调查工具,使用TCP/UDP读写网络连接,DNS正向/反向检查。 + +nc主要用在端口扫描,文件传输,后台和端口监听。nc可以使用任何闲置的端口和任何本地网络源地址。 + +使用nc命令(在192.168.0.7的服务器上)创建一个命令行即时信息传输服务器。 + + $ nc -l -vv 11119 + +对上述命令的解释。 + +- -v : 表示 Verbose +- -vv : 更多的 Verbose +- -p : 本地端口号 + +你可以用任何其他的本地端口号替换11119。 + +接下来在客户端机器(IP地址:192.168.0.15),运行下面的命令初始化聊天会话(信息传输服务正在运行)。 + + $ nc 192.168.0.7:11119 + +![Linux Commandline Chat with nc Command](http://www.tecmint.com/wp-content/uploads/2015/04/Chat-on-Linux-Commandline.gif) + +**注意**:你可以按下ctrl+c终止会话,同时nc聊天是一个一对一的服务。 + +### 2. Linux中如何统计某一列的总值 ### + +如何统计在终端里,某个命令的输出中,其中一列的数值总和, + +‘ls -l’命令的输出。 + + $ ls -l + +![Sum Numerical Values](http://www.tecmint.com/wp-content/uploads/2015/04/Sum-Values.gif) + +注意到第二列代表软连接的数量,第五列则是文件的大小。假设我们需要汇总第五列的数值。 + +仅仅列出第五列的内容。我们会使用‘awk’命令做到这点。‘$5’即代表第五列。 + + $ ls -l | awk '{print $5}' + +![List Content Column](http://www.tecmint.com/wp-content/uploads/2015/04/List-Content-Column.gif) + +现在,通过管道连接,使用awk打印出第五列数值的总和。 + + $ ls -l | awk '{print $5}' | awk '{total = total + $1}END{print total}' + +![Sum and Print Columns](http://www.tecmint.com/wp-content/uploads/2015/04/Sum-Columns.gif) + +### 在Linux里如何移除废弃包 ### + +废弃包是指那些作为其他包的依赖而被安装,但是当源包被移除之后就不再需要的包。 + +假设我们安装了gtprogram,依赖是gtdependency。除非我们安装了gtdependency,否则安装不了gtprogram。 + +当我们移除gtprogram的时候,默认并不会移除gtdependency。并且如果我们不移除gtdependency的话,它就会遗留下来成为废弃包,与其他任何包再无联系。 + + # yum autoremove [On RedHat Systems] + +![Remove Orphan Packages in CentOS](http://www.tecmint.com/wp-content/uploads/2015/04/Remove-Orphan-Packages-in-CentOS1.gif) + + # apt-get autoremove [On Debian Systems] + +![Remove Orphan Packages in Debian](http://www.tecmint.com/wp-content/uploads/2015/04/Remove-Orphan-Packages-in-Debian.gif) + +你应该经常移除废弃包,保持Linux机器仅仅加载一些需要的东西。 + +### 4. 如何获得Linux服务器本地的与公网的IP地址 ### + +为了获得本地IP地址,运行下面的一行脚本。 + + $ ifconfig | grep "inet addr:" | awk '{print $2}' | grep -v '127.0.0.1' | cut -f2 -d: + +你必须安装了ifconfig,如果没有,使用apt或者yum工具安装需要的包。这里我们将会管道连接ifconfig的输出,并且结合grep命令找到包含“intel addr:”的字符串。 + +我们知道对于输出本地IP地址,ifconfig命令足够用了。但是ifconfig生成了许多的输出,而我们关注的地方仅仅是本地IP地址,不是其他的。 + + # ifconfig | grep "inet addr:" + +![Check Local IP Address](http://www.tecmint.com/wp-content/uploads/2015/04/Check-Local-IP-Address.gif) + +尽管目前的输出好多了,但是我们需要过滤出本地的IP地址,不含其他东西。针对这个,我们将会使用awk打印出第二列输出,通过管道连接上述的脚本。 + + # ifconfig | grep “inet addr:” | awk '{print $2}' + +![Filter Only IP Address](http://www.tecmint.com/wp-content/uploads/2015/04/Filter-IP-Address.gif) + +上面图片清楚的表示,我们已经很大程度上自定义了输出,当仍然不是我们想要的。本地环路地址 127.0.0.1 仍然在结果中。 + +我们可以使用grep的-v选项,这样会打印出不匹配给定参数的其他行。每个机器都有同样的环路地址 127.0.0.1,所以使用grep -v打印出不包含127.0.0.1的行,通过管道连接前面的脚本。 + + # ifconfig | grep "inet addr" | awk '{print $2}' | grep -v '127.0.0.1' + +![Print IP Address](http://www.tecmint.com/wp-content/uploads/2015/04/Print-IP-Address.gif) + +我们差不多得到想要的输出了,仅仅需要从开头替换掉字符串`(addr:)`。我们将会使用cut命令单独打印出第二列。一二列之间并不是用tab分割,而是`(:)`,所以我们需要使用到域分割符选项`(-d)`,通过管道连接上面的输出。 + + # ifconfig | grep "inet addr:" | awk '{print $2}' | grep -v '127.0.0.1' | cut -f2 -d: + +![Customized IP Address](http://www.tecmint.com/wp-content/uploads/2015/04/Custome-IP-Address.gif) + +最后!期望的结果出来了。 + +### 5.如何在Linux终端彩色输出 ### + +你可能在终端看见过彩色的输出。同时你也可能知道在终端里允许/禁用彩色输出。如果都不知道的话,里可以参考下面的步骤。 + +在Linux中,每个用户都有`'.bashrc'`文件,被用来管理你的终端输出。打开并且编辑该文件,用你喜欢的编辑器。注意一下,这个文件是隐藏的(文件开头为点的代表隐藏文件)。 + + $ vi /home/$USER/.bashrc + +确保以下的行没有被注释掉。ie.,行开头没有#。 + + if [ -x /usr/bin/dircolors ]; then + test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dirc$ + alias ls='ls --color=auto' + #alias dir='dir --color=auto' + #alias vdir='vdir --color=auto' + + alias grep='grep --color=auto' + alias fgrep='fgrep --color=auto' + alias egrep='egrep --color=auto' + fi + +![User .bashrc File](http://www.tecmint.com/wp-content/uploads/2015/04/bashrc-file.gif) + +完成后!保存并退出。为了让改动生效,需要注销账户后再次登录。 + +现在,你会看见列出的文件和文件夹名字有着不同的颜色,根据文件类型来决定。为了解码颜色,可以运行下面的命令。 + + $ dircolors -p | less + +![Linux Color Output](http://www.tecmint.com/wp-content/uploads/2015/04/Linux-Color-Output.gif) + +### 6.如何用井号标记和Linux命令和脚本 ### + +我们一直在Twitter,Facebook和Google Plus(可能是其他我们没有提到的地方)上使用井号标签。那些井号标签使得其他人搜索一个标签更加容易。可是很少人知道,我们可以在Linux命令行使用井号标签。 + +我们已经知道配置文件里的`#`,在大多数的编程语言中,这个符号被用作注释行,即不被执行。 + +运行一个命令,然后为这个命令创建一个井号标签,这样之后我们就可以找到它。假设我们有一个很长的脚本,就上面第四点被执行的命令。现在为它创建一个井号标签。我们知道ifconfig可以被sudo或者root执行,因此用root来执行。 + + # ifconfig | grep "inet addr:" | awk '{print $2}' | grep -v '127.0.0.1' | cut -f2 -d: #myip + +上述脚本被’mytag‘给标记了。现在在reverse-i-search(按下ctrl+r)搜索一下这个标签,在终端里,并输入’mytag‘。你可以从这里开始执行。 + +![Create Command Hash Tags](http://www.tecmint.com/wp-content/uploads/2015/04/Create-Command-Hash-Tags.gif) + +你可以创建很多的井号标签,为每个命令,之后使用reverse-i-search找到它。 + +目前就这么多了。我们一直在辛苦的工作,创造有趣的,有知识性的内容给你。你觉得我们是如何工作的呢?欢迎咨询任何问题。你可以在下面评论。保持联络!Kudox。 + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/linux-commandline-chat-server-and-remove-unwanted-packages/ + +作者:[Avishek Kumar][a] +译者:[wi-cuckoo](https://github.com/wi-cuckoo) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/avishek/ +[1]:http://www.tecmint.com/5-linux-command-line-tricks/ From b751a9e5899e718deb3417f819dbfb29a746792c Mon Sep 17 00:00:00 2001 From: geekpi Date: Sat, 16 May 2015 09:55:46 +0800 Subject: [PATCH 036/965] translating --- ...150515 Basic Networking Commands with Docker Containers.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150515 Basic Networking Commands with Docker Containers.md b/sources/tech/20150515 Basic Networking Commands with Docker Containers.md index d07c3b2507..d636cc82dd 100644 --- a/sources/tech/20150515 Basic Networking Commands with Docker Containers.md +++ b/sources/tech/20150515 Basic Networking Commands with Docker Containers.md @@ -1,3 +1,5 @@ +translating---geekpi + Basic Networking Commands with Docker Containers ================================================================================ Hi everybody, today we'll learn some basic networking with Docker Containers. Docker is an Open Source project that provides an open platform to pack, ship and run any application as a lightweight container. It has no boundaries of Language support, Frameworks or packaging system and can be run anywhere, anytime from a small home computers to high-end servers. It makes them great building blocks for deploying and scaling web apps, databases, and back-end services without depending on a particular stack or provider. Docker is meant for networking as it is gradually used in data-centers, ISPs and much more networked servers. @@ -103,4 +105,4 @@ via: http://linoxide.com/linux-how-to/networking-commands-docker-containers/ 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 -[a]:http://linoxide.com/author/arunp/ \ No newline at end of file +[a]:http://linoxide.com/author/arunp/ From e9cf8f9b07e8437aac4d97ed5d368eb1e80a0ec3 Mon Sep 17 00:00:00 2001 From: geekpi Date: Sat, 16 May 2015 10:52:14 +0800 Subject: [PATCH 037/965] translated --- ...working Commands with Docker Containers.md | 108 ------------------ ...working Commands with Docker Containers.md | 106 +++++++++++++++++ 2 files changed, 106 insertions(+), 108 deletions(-) delete mode 100644 sources/tech/20150515 Basic Networking Commands with Docker Containers.md create mode 100644 translated/tech/20150515 Basic Networking Commands with Docker Containers.md diff --git a/sources/tech/20150515 Basic Networking Commands with Docker Containers.md b/sources/tech/20150515 Basic Networking Commands with Docker Containers.md deleted file mode 100644 index d636cc82dd..0000000000 --- a/sources/tech/20150515 Basic Networking Commands with Docker Containers.md +++ /dev/null @@ -1,108 +0,0 @@ -translating---geekpi - -Basic Networking Commands with Docker Containers -================================================================================ -Hi everybody, today we'll learn some basic networking with Docker Containers. Docker is an Open Source project that provides an open platform to pack, ship and run any application as a lightweight container. It has no boundaries of Language support, Frameworks or packaging system and can be run anywhere, anytime from a small home computers to high-end servers. It makes them great building blocks for deploying and scaling web apps, databases, and back-end services without depending on a particular stack or provider. Docker is meant for networking as it is gradually used in data-centers, ISPs and much more networked servers. - -So, here are some basic networking commands that you can use on managing Docker Containers. - -### 1. Finding the Docker Interface ### - -Docker by default creates a bridge interface named docker0 which basically connects with the outside world. The docker containers running is directly connected with the bridge interface docker0. By default, docker assigns ip address 172.17.42.1/16 to the bridge interface docker0 which acts as a subnet for all the ip addresses of the running containers. It is pretty easy to get the Docker Interface's IP Address. To find out our docker0 bridge interface and the docker containers connected with the bridge we can simply run ip a command inside a terminal or a shell where Docker is installed. - - # ip a - -![Docker Interface](http://blog.linoxide.com/wp-content/uploads/2015/05/docker-interface.png) - -### 2. Getting the Docker Container's IP Address ### - -As we read above, docker creates a bridge interface named docker0 in the host machine. As we create a new docker container, it is automatically assigned with a new dynamic IP Address by default which is followed within the subnet range of the interface. So, to check the IP Address of the running Docker container, we'll need to get into a running container and check out the ip address as shown below. First, we'll run a new container and get into the container. If you have got a container running already, you may skip the first command below. - - # docker run -it ubuntu - -Now, we'll be able to run ip a in order to get the ip address of the running container. - - # ip a - -![Docker Container IP](http://blog.linoxide.com/wp-content/uploads/2015/05/docker-container-ip.png) - -### 3. Mapping the Expose port ### - -To map the exposed port configured in the Dockerfile for the container to the high port, we'll simply need to follow the docker command with -P flag. This will open the random port of the Docker Container to the port defined by the Dockerfile. So, here's an example of using the flag -P to open/expose the defined port. - - # docker run -itd -P httpd - -![Mapping Expose Port](http://blog.linoxide.com/wp-content/uploads/2015/05/mapping-expose-port.png) - -The above command will map container's port to port 80 as its defined in the Dockerfile of httpd. We can check the exposed port by viewing the running container using the following command. - - # docker ps - -And can use curl to check by running the below command. - - # curl http://localhost:49153 - -![Curl Exposed Port](http://blog.linoxide.com/wp-content/uploads/2015/05/curl-exposed-port-e1431034586219.png) - -### 4. Mapping to the Specific Port ### - -We can also map the expose port or docker container port to the port we specify or define. In order to map the container to a specific port of our choice, we'll need to define the port of our desire with the flag -p . Here's an example on how we can do that. - - # docker run -itd -p 8080:80 httpd - -The above command will map the port 8080 to port 80. We can check it by running curl to that port. - - # curl http://localhost:8080 - -![Mapping Specific Port](Curl Exposed Port) - -### 5. Creating own Bridge ### - -To assign a custom IP Address to the containers, we'll need to create a new bridge interface named bro in this tutorial. To assign a desired IP Address, we'll need to run the following command in the host machine running docker. - - # stop docker.io - # ip link add br0 type bridge - # ip addr add 172.30.1.1/20 dev br0 - # ip link set br0 up - # docker -d -b br0 - -![Creating Bridge Interface](http://blog.linoxide.com/wp-content/uploads/2015/05/creating-bridge-interface.png) - -After creating the docker bridge, we'll want to let the Docker Daemon know about it. - - # echo 'DOCKER_OPTS="-b=br0"' >> /etc/default/docker - # service docker.io start - -![Adding Interface to Docker](http://blog.linoxide.com/wp-content/uploads/2015/05/adding-interface-to-docker.png) - -Here, the bridged interface will range the docker containers with the ip address followed by bridge ip subnet . - -### 6. Linking one Container to another ### - -We can connect one container with the another container with Docker. We can run different apps on different containers and connect or link with each other. Links allow containers to connect with each other and securely transfer information about one container to another container. To do so, we'll use the --link flag. First, we'll use flag --name so that it will be easy to denote training/postgres image. - - # docker run -d --name db training/postgres - -![Running db Container](http://blog.linoxide.com/wp-content/uploads/2015/05/running-db-container.png) - -After done, we'll gonna link training/webapp with the container db that we create earlier forming a new container named web. - - # docker run -d -P --name web --link db:db training/webapp python app.py - -![linking two containers](http://blog.linoxide.com/wp-content/uploads/2015/05/linking-two-containers.png) - -### Conclusion ### - -Networking with Docker is fun and amazing cause there are many stuffs we can do with Docker Containers. These were some easy and basic networking commands that we can play with Docker. Networking with docker is really advanced. We can do many stuffs with it. If you have any questions, suggestions, feedback please write them in the comment box below so that we can improve or update our contents. Thank you ! Enjoy :-) - --------------------------------------------------------------------------------- - -via: http://linoxide.com/linux-how-to/networking-commands-docker-containers/ - -作者:[Arun Pyasi][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://linoxide.com/author/arunp/ diff --git a/translated/tech/20150515 Basic Networking Commands with Docker Containers.md b/translated/tech/20150515 Basic Networking Commands with Docker Containers.md new file mode 100644 index 0000000000..d4b90aa7f2 --- /dev/null +++ b/translated/tech/20150515 Basic Networking Commands with Docker Containers.md @@ -0,0 +1,106 @@ +关于Docker容器的基础网络命令 +================================================================================ +各位好,今天我们将学习一些Docker容器的基础命令。Docker是一个提供了开放平台来打包、发布并以一个轻量级容器运行任意程序的开放平台。它没有语言支持、框架或者打包系统的限制,可在任何时间、任何地方在小到家用电脑大到高端服务器上运行。这使得在部署和扩展网络应用、数据库和终端服务时不依赖于特定的栈或者提供商。Docker注定是用于网络的如它正应用于数据中心、ISP和越来越多的网络服务。 + +因此,这里有一些你在管理Docker容器的时候会用到的一些命令。 + +### 1. 找到Docker接口 ### + +Docker默认会创建一个名为docker0的网桥接口来连接外部的世界。docker容器运行时直接连接到网桥接口docker0。默认上,docker会分配172.17.42.1/16给docker0,它是所有运行容器ip地址的子网。得到Docker接口的ip地址非常简单。要找出docker0网桥接口和连接到网桥上的docker容器,我们可以在终端或者安装了docker的shell中运行ip命令。 + + # ip a + +![Docker Interface](http://blog.linoxide.com/wp-content/uploads/2015/05/docker-interface.png) + +### 2. 得到Docker容器的ip地址 ### + +如我们上面读到的,docker在主机中创建了一个叫docker0的网桥接口。如我们创建一个心的docker容器一样,它自动被默认分配了一个在子网范围内的ip地址。因此,要检测运行中的Docker容器的ip地址,我们需要进入一个正在运行的容器并用下面的命令检查ip地址。首先,我们运行一个新的容器并进入。如果你已经有一个正在运行的容器,你可以跳过这个步骤。 + + # docker run -it ubuntu + +现在,我们可以运行ip a来得到容器的ip地址了。 + + # ip a + +![Docker Container IP](http://blog.linoxide.com/wp-content/uploads/2015/05/docker-container-ip.png) + +### 3. 映射暴露的端口 ### + +要映射配置在Dockerfile的暴露端口,我们只需用下面带上-P标志的命令。这会打开docker容器的随机端口并映射到Dockerfile中定义的端口。下面是使用-P来打开/映射定义的端口的例子。 + + # docker run -itd -P httpd + +![Mapping Expose Port](http://blog.linoxide.com/wp-content/uploads/2015/05/mapping-expose-port.png) + +上面的命令会映射Dockerfile中定义的httpd 80端口到容器的端口上。我们用下面的命令来查看正在运行的容器暴露的端口。 + + # docker ps + +并且可以用下面的curl命令来检查。 + + # curl http://localhost:49153 + +![Curl Exposed Port](http://blog.linoxide.com/wp-content/uploads/2015/05/curl-exposed-port-e1431034586219.png) + +### 4. 映射到特定的端口上 ### + +我们也可以映射暴露端口或者docker容器端口到我们指定的端口上。要实现这个,我们用-p标志来定义我们的需要。这里是我们的一个例子。 + + # docker run -itd -p 8080:80 httpd + +上面的命令会映射8080端口到80上。我们可以运行curl来检查这点。 + + # curl http://localhost:8080 + +![Mapping Specific Port](Curl Exposed Port) + +### 5. 创建自己的网桥 ### + +要给容器创建一个自定义的IP地址,在本篇中我们会创建一个名为bro的新网桥。要分配需要的ip地址,我们需要在运行docker的主机中运行下面的命令。 + + # stop docker.io + # ip link add br0 type bridge + # ip addr add 172.30.1.1/20 dev br0 + # ip link set br0 up + # docker -d -b br0 + +![Creating Bridge Interface](http://blog.linoxide.com/wp-content/uploads/2015/05/creating-bridge-interface.png) + +创建完docker网桥之后,我们要让docker的守护进程知道它。 + + # echo 'DOCKER_OPTS="-b=br0"' >> /etc/default/docker + # service docker.io start + +![Adding Interface to Docker](http://blog.linoxide.com/wp-content/uploads/2015/05/adding-interface-to-docker.png) + +到这里,桥接后的接口将会分配给容器新的在桥接子网内的ip地址。 + +### 6. 链接到另外一个容器上 ### + +我们可以用Dokcer连接一个容器到另外一个上。我们可以在不容的容器上运行不同的程序,并且相互连接或链接。链接允许容器间相互连接并安全地从一个容器上传输信息给另一个容器。要做到这个,我们可以使用--link标志。首先,我们使用--name标志来表示training/postgres镜像。 + + # docker run -d --name db training/postgres + +![Running db Container](http://blog.linoxide.com/wp-content/uploads/2015/05/running-db-container.png) + +完成之后,我们将容器db与training/webapp链接来形成新的叫web的容器。 + + # docker run -d -P --name web --link db:db training/webapp python app.py + +![linking two containers](http://blog.linoxide.com/wp-content/uploads/2015/05/linking-two-containers.png) + +### 总结 ### + +Docker网络很神奇也好玩,因为有我们可以对docker容器做很多事情。这里有些简单和基础的我们可以把玩docker网络命令。docker的网络是非常高级的。我们可以用它做很多事情。如果你有任何的问题、建议、反馈请在下面的评论栏写下来以便于我们我们可以提升或者更新文章的内容。谢谢! 玩得开心!:-) + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/linux-how-to/networking-commands-docker-containers/ + +作者:[Arun Pyasi][a] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://linoxide.com/author/arunp/ From be79963b89466df5208c1f47ac28817d85fac5a4 Mon Sep 17 00:00:00 2001 From: wxy Date: Sat, 16 May 2015 21:06:34 +0800 Subject: [PATCH 038/965] PUB:20150413 A Walk Through Some Important Docker Commands @ictlyh --- ... Through Some Important Docker Commands.md | 31 ++++++++++--------- 1 file changed, 16 insertions(+), 15 deletions(-) rename {translated/tech => published}/20150413 A Walk Through Some Important Docker Commands.md (56%) diff --git a/translated/tech/20150413 A Walk Through Some Important Docker Commands.md b/published/20150413 A Walk Through Some Important Docker Commands.md similarity index 56% rename from translated/tech/20150413 A Walk Through Some Important Docker Commands.md rename to published/20150413 A Walk Through Some Important Docker Commands.md index 6e350c6d1c..d58dda2d54 100644 --- a/translated/tech/20150413 A Walk Through Some Important Docker Commands.md +++ b/published/20150413 A Walk Through Some Important Docker Commands.md @@ -1,12 +1,12 @@ -一些重要Docker命令的简单介绍 +一些重要 Docker 命令的简单介绍 ================================================================================ -大家好,今天我们来学习一些在你使用Docker之前需要了解的重要的 Docker 命令。Docker 是一个提供开发平台去打包,装载和运行任何应用的轻量级容器开源项目。它没有语言支持,框架和打包系统的限制,能从一个小的家庭电脑到高端服务器,在任何地方任何时间运行。这使得它们成为不依赖于一个特定的栈或供应商,部署和扩展web应用,数据库和后端服务很好的构建块。 +大家好,今天我们来学习一些在你使用 Docker 之前需要了解的重要的 Docker 命令。[Docker][1] 是一个开源项目,提供了一个可以打包、装载和运行任何应用的轻量级容器的开放平台。它没有语言支持、框架和打包系统的限制,从小型的家用电脑到高端服务器,在何时何地都可以运行。这使它们可以不依赖于特定软件栈和供应商,像一块块积木一样部署和扩展网络应用、数据库和后端服务。 Docker 命令简单易学,也很容易实现或实践。这是一些你运行 Docker 并充分利用它需要知道的简单 Docker 命令。 -### 1. 拉取一个 Docker 镜像 ### +### 1. 拉取 Docker 镜像 ### -由于容器是由 Docker 镜像构建的,首先我们需要拉取一个 docker 镜像来开始。我们可以从 Docker 注册 Hub 获取需要的 docker 镜像。在我们使用 pull 命令拉取任何镜像之前,由于pull命令被标识为恶意命令,我们需要保护我们的系统。为了保护我们的系统不受这个问题影响,我们需要添加 **127.0.0.1 index.docker.io** 到 /etc/hosts 条目。我们可以通过使用喜欢的文本编辑器完成。 +由于容器是由 Docker 镜像构建的,首先我们需要拉取一个 docker 镜像来开始。我们可以从 Docker Registry Hub 获取所需的 docker 镜像。在我们使用 pull 命令拉取任何镜像之前,为了避免 pull 命令的一些恶意风险,我们需要保护我们的系统。为了保护我们的系统不受这个风险影响,我们需要添加 **127.0.0.1 index.docker.io** 到 /etc/hosts 条目。我们可以通过使用喜欢的文本编辑器完成。 # nano /etc/hosts @@ -16,7 +16,7 @@ Docker 命令简单易学,也很容易实现或实践。这是一些你运行 ![Docker 宿主机](http://blog.linoxide.com/wp-content/uploads/2015/04/docker-hosts.png) -要拉取一个 docker 进行,我们需要运行下面的命令。 +要拉取一个 docker 镜像,我们需要运行下面的命令。 # docker pull registry.hub.docker.com/busybox @@ -28,9 +28,9 @@ Docker 命令简单易学,也很容易实现或实践。这是一些你运行 ![Docker 镜像](http://blog.linoxide.com/wp-content/uploads/2015/04/docker-images.png) -### 2. 运行一个 Docker 容器 ### +### 2. 运行 Docker 容器 ### -现在,成功地拉取要求或需要的 Docker 镜像之后,我们当然想运行这个 Docker 镜像。我们可以用 docker run 命令在镜像上运行一个 docker 容器。在 Docker 镜像之上运行一个 docker 容易时我们有很多选项和标记。我们使用 -t 和 -i 标记运行一个 docker 镜像并进入容器,如下面所示。 +现在,成功地拉取要求的或所需的 Docker 镜像之后,我们当然想运行这个 Docker 镜像。我们可以用 docker run 命令在镜像上运行一个 docker 容器。在 Docker 镜像上运行一个 docker 容器时我们有很多选项和标记。我们使用 -t 和 -i 选项来运行一个 docker 镜像并进入容器,如下面所示。 # docker run -it busybox @@ -50,7 +50,7 @@ Docker 命令简单易学,也很容易实现或实践。这是一些你运行 ![进入Docker](http://blog.linoxide.com/wp-content/uploads/2015/04/docker-attach.png) -### 3. 查看容器 ### +### 3. 检查容器运行 ### 不论容器是否运行,查看日志文件都很简单。我们可以使用下面的命令去检查是否有 docker 容器在实时运行。 @@ -62,17 +62,17 @@ Docker 命令简单易学,也很容易实现或实践。这是一些你运行 ![查看 Docker 容器](http://blog.linoxide.com/wp-content/uploads/2015/04/view-docker-containers1.png) -### 4. 检查 Docker 容器 ### +### 4. 查看容器信息 ### -我们可以使用 inspect 命令检查一个 Docker 容器的每条信息。 +我们可以使用 inspect 命令查看一个 Docker 容器的各种信息。 # docker inspect ![检查Docker](http://blog.linoxide.com/wp-content/uploads/2015/04/docker-inspect.png) -### 5. 杀死或删除命令 ### +### 5. 杀死或删除 ### -我们可以使用 docker id 杀死或者停止进程或 docker 容器,如下所示。 +我们可以使用容器 id 杀死或者停止 docker 容器(进程),如下所示。 # docker stop @@ -90,7 +90,7 @@ Docker 命令简单易学,也很容易实现或实践。这是一些你运行 ### 结论 ### -这些都是学习充分实现和利用 Docker 很基本的 docker 命令。有了这些命令,Docker 变得很简单,提供给端用户一个简单的计算平台。根据上面的教程,任何人学习 Docker 命令都非常简单。如果你有任何问题,建议,反馈,请写到下面的评论框中以便我们改进和更新内容。多谢!享受吧 :-) +这些都是充分学习和使用 Docker 很基本的 docker 命令。有了这些命令,Docker 变得很简单,可以提供给最终用户一个易用的计算平台。根据上面的教程,任何人学习 Docker 命令都非常简单。如果你有任何问题,建议,反馈,请写到下面的评论框中以便我们改进和更新内容。多谢! 希望你喜欢 :-) -------------------------------------------------------------------------------- @@ -98,8 +98,9 @@ via: http://linoxide.com/linux-how-to/important-docker-commands/ 作者:[Arun Pyasi][a] 译者:[ictlyh](https://github.com/ictlyh) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 -[a]:http://linoxide.com/author/arunp/ \ No newline at end of file +[a]:http://linoxide.com/author/arunp/ +[1]:https://www.docker.com/ \ No newline at end of file From f8deb5dacd93fa8a0402ee8ec469ef34df5faf9d Mon Sep 17 00:00:00 2001 From: wxy Date: Sat, 16 May 2015 23:23:46 +0800 Subject: [PATCH 039/965] PUB:Linux grep command with 14 different examples @cvsher --- ...grep command with 14 different examples.md | 40 ++++++++++--------- 1 file changed, 21 insertions(+), 19 deletions(-) rename translated/tech/[translated]Linux grep command with 14 different examples.md => published/Linux grep command with 14 different examples.md (77%) diff --git a/translated/tech/[translated]Linux grep command with 14 different examples.md b/published/Linux grep command with 14 different examples.md similarity index 77% rename from translated/tech/[translated]Linux grep command with 14 different examples.md rename to published/Linux grep command with 14 different examples.md index cff151dd09..591a32ae43 100644 --- a/translated/tech/[translated]Linux grep command with 14 different examples.md +++ b/published/Linux grep command with 14 different examples.md @@ -1,12 +1,15 @@ +14 个 grep 命令的例子 +=========== + ###概述:### -所有类linux系统都会提供一个名为**grep(global regular expression print)**的搜索工具。grep命令在基于模式对一个或多个文件内容进行搜索的情况下是非常有用的。一个模式可以是单个字符、多个字符、单个单词、或者是一个句子。 +所有的类linux系统都会提供一个名为**grep(global regular expression print,全局正则表达式输出)**的搜索工具。grep命令在对一个或多个文件的内容进行基于模式的搜索的情况下是非常有用的。模式可以是单个字符、多个字符、单个单词、或者是一个句子。 当命令匹配到执行命令时指定的模式时,grep会将包含模式的一行输出,但是并不对原文件内容进行修改。 在本文中,我们将会讨论到14个grep命令的例子。 -###1 在文件中查找模式(单词)### +###例1 在文件中查找模式(单词)### 在/etc/passwd文件中查找单词“linuxtechi” @@ -14,7 +17,7 @@ linuxtechi:x:1000:1000:linuxtechi,,,:/home/linuxtechi:/bin/bash root@Linux-world:~# -###2 在多个文件中查找模式。### +###例2 在多个文件中查找模式。### root@Linux-world:~# grep linuxtechi /etc/passwd /etc/shadow /etc/gshadow /etc/passwd:linuxtechi:x:1000:1000:linuxtechi,,,:/home/linuxtechi:/bin/bash @@ -28,14 +31,14 @@ /etc/gshadow:sambashare:!::linuxtechi root@Linux-world:~# -###3 使用-l参数列出包含指定模式的文件的文件名。### +###例3 使用-l参数列出包含指定模式的文件的文件名。### root@Linux-world:~# grep -l linuxtechi /etc/passwd /etc/shadow /etc/fstab /etc/mtab /etc/passwd /etc/shadow root@Linux-world:~# -###4 使用-n参数,在文件中查找指定模式及其相关的行号### +###例4 使用-n参数,在文件中查找指定模式并显示匹配行的行号### root@Linux-world:~# grep -n linuxtechi /etc/passwd 39:linuxtechi:x:1000:1000:linuxtechi,,,:/home/linuxtechi:/bin/bash @@ -45,7 +48,7 @@ root@Linux-world:~# grep -n root /etc/passwd /etc/shadow ![](http://www.linuxtechi.com/wp-content/uploads/2015/05/grep-n-root.jpg) -###5 使用-v参数输出不包含指定模式的行### +###例5 使用-v参数输出不包含指定模式的行### 输出/etc/passwd文件中所有不含单词“linuxtechi”的行 @@ -53,15 +56,15 @@ root@Linux-world:~# grep -n root /etc/passwd /etc/shadow ![](http://www.linuxtechi.com/wp-content/uploads/2015/05/grep-v-option.jpg) -###6 使用^符号输出所有以某指定模式开头的行### +###例6 使用 ^ 符号输出所有以某指定模式开头的行### -Bash脚本将^符号当作特殊字符处理,用于指定一行或者一个单词的开始。例如输出/etc/passes文件中所有以“root”开头的行 +Bash脚本将 ^ 符号视作特殊字符,用于指定一行或者一个单词的开始。例如输出/etc/passes文件中所有以“root”开头的行 root@Linux-world:~# grep ^root /etc/passwd root:x:0:0:root:/root:/bin/bash root@Linux-world:~# -###7 使用 $ 符号输出所有以指定模式结尾的行。### +###例7 使用 $ 符号输出所有以指定模式结尾的行。### 输出/etc/passwd文件中所有以“bash”结尾的行。 @@ -70,10 +73,9 @@ Bash脚本将^符号当作特殊字符处理,用于指定一行或者一个单 linuxtechi:x:1000:1000:linuxtechi,,,:/home/linuxtechi:/bin/bash root@Linux-world:~# -Bash脚本将美元($)符号当作特殊字符,用于指定一行或者一个单词的结尾。 - -###8 使用 -r 参数递归的查找特定模式### +Bash脚本将美元($)符号视作特殊字符,用于指定一行或者一个单词的结尾。 +###例8 使用 -r 参数递归地查找特定模式### root@Linux-world:~# grep -r linuxtechi /etc/ /etc/subuid:linuxtechi:100000:65536 @@ -91,14 +93,14 @@ Bash脚本将美元($)符号当作特殊字符,用于指定一行或者一个 上面的命令将会递归的在/etc目录中查找“linuxtechi”单词 -###9 使用grep查找文件中所有的空行 +###例9 使用 grep 查找文件中所有的空行 root@Linux-world:~# grep ^$ /etc/shadow root@Linux-world:~# 由于/etc/shadow文件中没有空行,所以没有任何输出 -###10 使用“grep -i”参数查找模式### +###例10 使用 -i 参数查找模式### grep命令的-i参数在查找时忽略字符的大小写。 @@ -108,7 +110,7 @@ grep命令的-i参数在查找时忽略字符的大小写。 linuxtechi:x:1001:1001::/home/linuxtechi:/bin/bash nextstep4it@localhost:~$ -###11 使用-e参数查找多个模式### +###例11 使用 -e 参数查找多个模式### 例如,我想在一条grep命令中查找‘linuxtechi’和‘root’单词,使用-e参数,我们可以查找多个模式。 @@ -117,7 +119,7 @@ grep命令的-i参数在查找时忽略字符的大小写。 linuxtechi:x:1000:1000:linuxtechi,,,:/home/linuxtechi:/bin/bash root@Linux-world:~# -###12 使用“grep -f”从一个文件中获取待查找的模式### +###例12 使用 -f 用文件指定待查找的模式### 首先,在当前目录中创建一个搜索模式文件“grep_pattern”,我想文件中输入的如下内容。 @@ -133,7 +135,7 @@ grep命令的-i参数在查找时忽略字符的大小写。 ![](http://www.linuxtechi.com/wp-content/uploads/2015/05/grep-f-option.jpg) -###13 使用-c参数计算模式匹配的数量### +###例13 使用 -c 参数计算模式匹配到的数量### 继续上面例子,我们在grep命令中使用-c命令计算匹配指定模式的数量 @@ -141,7 +143,7 @@ grep命令的-i参数在查找时忽略字符的大小写。 22 root@Linux-world:~# -###14 输出匹配指定模式行的前或者后面N行### +###例14 输出匹配指定模式行的前或者后面N行### a)使用-B参数输出匹配行的前4行 @@ -167,7 +169,7 @@ via: http://www.linuxtechi.com/linux-grep-command-with-14-different-examples/ 作者:[Pradeep Kumar][a] 译者:[cvsher](https://github.com/cvsher) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 51d831cbee858362ddc9adbf15bb748987f9179f Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 17 May 2015 09:50:01 +0800 Subject: [PATCH 040/965] PUB:20150323 Linux FAQs with Answers--How to install and access CentOS remote desktop on VPS @geekpi --- ... and access CentOS remote desktop on VPS.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) rename {translated/tech => published}/20150323 Linux FAQs with Answers--How to install and access CentOS remote desktop on VPS.md (82%) diff --git a/translated/tech/20150323 Linux FAQs with Answers--How to install and access CentOS remote desktop on VPS.md b/published/20150323 Linux FAQs with Answers--How to install and access CentOS remote desktop on VPS.md similarity index 82% rename from translated/tech/20150323 Linux FAQs with Answers--How to install and access CentOS remote desktop on VPS.md rename to published/20150323 Linux FAQs with Answers--How to install and access CentOS remote desktop on VPS.md index 3108d1ed32..7c3db8a320 100644 --- a/translated/tech/20150323 Linux FAQs with Answers--How to install and access CentOS remote desktop on VPS.md +++ b/published/20150323 Linux FAQs with Answers--How to install and access CentOS remote desktop on VPS.md @@ -1,6 +1,6 @@ -Linux有问必答-- 如何在VPS上安装和访问CentOS远程桌面 +Linux有问必答:如何在VPS上安装和访问CentOS 7远程桌面 ================================================================================ -> **提问**: 我想在VPS中安装CentOS桌面,并可以直接从我家远程访问GUI桌面。有什么建议可以在VPS上设置和访问CentOS远程桌面? +> **提问**: 我想在VPS中安装CentOS桌面,并可以直接从我家远程访问GUI桌面。在VPS上设置和访问CentOS远程桌面有什么建议吗? 如何远程办公或者远程弹性化工作制在技术领域正变得越来越流行。这个趋势背后的一个技术就是远程桌面。你的桌面环境在云中,你可以在任何你去的地方,或者在家或者工作场所访问你的远程桌面。 @@ -10,7 +10,7 @@ Linux有问必答-- 如何在VPS上安装和访问CentOS远程桌面 ### 第一步: 安装CentOS桌面 ### -如果现在的CentOS版本是没有桌面的最小版本,你需要先在VPS上安装桌面(比如GNOME)。比如,DigitalOcean的镜像就是最小版本,它需要如下安装[桌面GUI][2] +如果你现在安装的CentOS版本是没有桌面的最小版本,你需要先在VPS上安装桌面(比如GNOME)。比如,DigitalOcean的镜像就是最小版本,它需要如下安装[桌面GUI][2] # yum groupinstall "GNOME Desktop" @@ -36,15 +36,15 @@ CentOS依靠systemd来管理和配置系统服务。所以我们将使用systemd # systemctl status vncserver@:.service # systemctl is-enabled vncserver@.service -默认上,刚安装的VNC服务并没有激活(禁用)。 +默认的,刚安装的VNC服务并没有激活(禁用)。 ![](https://farm8.staticflickr.com/7613/16877514732_8ccffe7b6b_b.jpg) -现在服务一份通用的VNC服务文件来位用户xmodulo创建一个VNC服务配置。 +现在复制一份通用的VNC服务文件来为用户xmodulo创建一个VNC服务配置。 # cp /lib/systemd/system/vncserver@.service /etc/systemd/system/vncserver@:1.service -用本文编辑器来打开配置文件,用实际的用户名(比如:xmodulo)来替换[Service]下面的。同样。在ExecStart后面追加 "-geometry " 参数。最后,要修改下面两行加粗字体的两行。 +用本文编辑器来打开配置文件,用实际的用户名(比如:xmodulo)来替换[Service]下面的。同样。在ExecStart后面追加 "-geometry " 参数。最后,要修改下面“ExecStart”和“PIDFile”两行。 # vi /etc/systemd/system/vncserver@:1.service @@ -85,7 +85,7 @@ CentOS依靠systemd来管理和配置系统服务。所以我们将使用systemd ### 第三步:通过SSH连接到远程桌面 ### -设计上,VNC使用的远程帧缓存(RFB)并不是一种安全的协议。那么在VNC客户端上直接连接到VNC服务器上并不是一个好主意。任何敏感信息比如密码都可以在VNC流量中被轻易地泄露。因此,我强烈建议使用SSH隧道来[加密你的VNC流量][3]。 +从设计上说,VNC使用的远程帧缓存(RFB)并不是一种安全的协议,那么在VNC客户端上直接连接到VNC服务器上并不是一个好主意。任何敏感信息比如密码都可以在VNC流量中被轻易地泄露。因此,我强烈建议使用SSH隧道来[加密你的VNC流量][3]。 在你要运行VNC客户端的本机上,使用下面的命令来创建一个连接到远程VPS的SSH通道。当被要输入SSH密码时,输入用户的密码。 @@ -99,7 +99,7 @@ CentOS依靠systemd来管理和配置系统服务。所以我们将使用systemd ![](https://farm8.staticflickr.com/7639/16691289910_fae83510fb_o.png) -你将被要求输入VNC密码。当你输入VNC密码时,你就可以安全地连接到CentOS的远程桌面了. +你将被要求输入VNC密码。当你输入VNC密码时,你就可以安全地连接到CentOS的远程桌面了。 ![](https://farm8.staticflickr.com/7614/16877678411_aa8349f6b1_c.jpg) @@ -111,7 +111,7 @@ via: http://ask.xmodulo.com/centos-remote-desktop-vps.html 作者:[Dan Nanni][a] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 From d5d5082d570824fc88bb25bde9e9dfd044236faa Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 17 May 2015 10:37:12 +0800 Subject: [PATCH 041/965] PUB:20150211 Install Linux-Dash (Web Based Monitoring tool) on Ubntu 14.10 @wwy-hust --- ...b Based Monitoring tool) on Ubntu 14.10.md | 67 +++++++++++++++++ ...b Based Monitoring tool) on Ubntu 14.10.md | 71 ------------------- 2 files changed, 67 insertions(+), 71 deletions(-) create mode 100644 published/20150211 Install Linux-Dash (Web Based Monitoring tool) on Ubntu 14.10.md delete mode 100644 translated/tech/20150211 Install Linux-Dash (Web Based Monitoring tool) on Ubntu 14.10.md diff --git a/published/20150211 Install Linux-Dash (Web Based Monitoring tool) on Ubntu 14.10.md b/published/20150211 Install Linux-Dash (Web Based Monitoring tool) on Ubntu 14.10.md new file mode 100644 index 0000000000..97641f0298 --- /dev/null +++ b/published/20150211 Install Linux-Dash (Web Based Monitoring tool) on Ubntu 14.10.md @@ -0,0 +1,67 @@ +在Ubuntu 14.10上安装基于Web的监控工具:Linux-Dash +================================================================================ + +Linux-Dash是一个用于GNU/Linux机器的,低开销的监控仪表盘。您可以安装试试!Linux Dash的界面提供了您的服务器的所有关键信息的详细视图,可监测的信息包括RAM、磁盘使用率、网络、安装的软件、用户、运行的进程等。所有的信息都被分成几类,您可以通过主页工具栏中的按钮跳到任何一类中。Linux Dash并不是最先进的监测工具,但它十分适合寻找灵活、轻量级、容易部署的应用的用户。 + +### Linux-Dash的功能 ### + +- 使用一个基于Web的漂亮的仪表盘界面来监控服务器信息 +- 实时的按照你的要求监控RAM、负载、运行时间、磁盘配置、用户和许多其他系统状态 +- 支持基于Apache2/niginx + PHP的服务器 +- 通过点击和拖动来重排列控件 +- 支持多种类型的linux服务器 + +### 当前控件列表 ### + +- 通用信息 +- 平均负载 +- RAM +- 磁盘使用量 +- 用户 +- 软件 +- IP +- 网络速率 +- 在线状态 +- 处理器 +- 日志 + +### 在Ubuntu server 14.10上安装Linux-Dash ### + +首先您需要确认您安装了[Ubuntu LAMP server 14.10][1],接下来您需要安装下面的包: + + sudo apt-get install php5-json unzip + +安装这个模块后,需要在apache2中启用该模块,所以您需要使用下面的命令重启apache2服务器: + + sudo service apache2 restart + +现在您需要下载linux-dash的安装包并安装它: + + wget https://github.com/afaqurk/linux-dash/archive/master.zip + + unzip master.zip + + sudo mv linux-dash-master/ /var/www/html/linux-dash-master/ + +接下来您需要使用下面的命令来改变权限: + + sudo chmod 755 /var/www/html/linux-dash-master/ + +现在您便可以访问http://serverip/linux-dash-master/了。您应该会看到类似下面的输出: + +![](http://www.ubuntugeek.com/wp-content/uploads/2015/02/1.png) + +![](http://www.ubuntugeek.com/wp-content/uploads/2015/02/2.png) + +-------------------------------------------------------------------------------- + +via: http://www.ubuntugeek.com/install-linux-dash-web-based-monitoring-tool-on-ubntu-14-10.html + +作者:[ruchi][a] +译者:[wwy-hust](https://github.com/wwy-hust) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://www.ubuntugeek.com/author/ubuntufix +[1]:http://www.ubuntugeek.com/step-by-step-ubuntu-14-10-utopic-unicorn-lamp-server-setup.html diff --git a/translated/tech/20150211 Install Linux-Dash (Web Based Monitoring tool) on Ubntu 14.10.md b/translated/tech/20150211 Install Linux-Dash (Web Based Monitoring tool) on Ubntu 14.10.md deleted file mode 100644 index 14496aabfc..0000000000 --- a/translated/tech/20150211 Install Linux-Dash (Web Based Monitoring tool) on Ubntu 14.10.md +++ /dev/null @@ -1,71 +0,0 @@ -Ubuntu 14.10ϰװLinux-Dash(Webļع) -================================================================================ - -Linux-DashһGNU/LinuxģͿļDZ̡װʼʹðɣLinux DashĽṩķйؼϢϸͼɼϢRAMʹʡ硢װûе̵߳ȡеϢ࣬ͨҳеİťκһСLinux DashȽļ⹤ߣʮʺѰײӦõû - -### Linux-DashĹ ### - -ʹһWebƯDZ̽طϢ - -ʵʱļRAMءʱ䡢áûϵͳ״̬ - -ɲʽΪװApache2/niginx + PHP - -ͨ϶пؼ - -ֶ֧͵linux - -### ǰؼб ### - -- ͨϢ -- ƽ -- RAM -- ʹ -- û -- -- IP -- -- -- -- ־ - -### Ubuntu server 14.10ϰװLinux-Dash ### - -Ҫȷװ[Ubuntu LAMP server 14.10][1]Ҫװİ - - sudo apt-get install php5-json unzip - -װģҪapache2ʹܸģ飬Ҫʹapache2 - - sudo service apache2 restart - -Ҫlinux-dashİװװ - - wget https://github.com/afaqurk/linux-dash/archive/master.zip - - unzip master.zip - - sudo mv linux-dash-master/ /var/www/html/linux-dash-master/ - -ҪʹıȨޣ - - sudo chmod 755 /var/www/html/linux-dash-master/ - -Էhttp://serverip/linux-dash-master/ˡӦûῴ - -![](http://www.ubuntugeek.com/wp-content/uploads/2015/02/1.png) - -![](http://www.ubuntugeek.com/wp-content/uploads/2015/02/2.png) - --------------------------------------------------------------------------------- - -via: http://www.ubuntugeek.com/install-linux-dash-web-based-monitoring-tool-on-ubntu-14-10.html - -ߣ[ruchi][a] -ߣ[wwy-hust](https://github.com/wwy-hust) -Уԣ[УID](https://github.com/УID) - - [LCTT](https://github.com/LCTT/TranslateProject) ԭ룬[Linuxй](http://linux.cn/) Ƴ - -[a]:http://www.ubuntugeek.com/author/ubuntufix -[1]:http://www.ubuntugeek.com/step-by-step-ubuntu-14-10-utopic-unicorn-lamp-server-setup.html From 0ea3e1ee09766bab4cf3f263d43fb9fe7507bc5b Mon Sep 17 00:00:00 2001 From: geekpi Date: Sun, 17 May 2015 10:40:53 +0800 Subject: [PATCH 042/965] translating --- .../20150323 Square 2.0 Icon Pack Is Twice More Beautiful.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/share/20150323 Square 2.0 Icon Pack Is Twice More Beautiful.md b/sources/share/20150323 Square 2.0 Icon Pack Is Twice More Beautiful.md index b0e5afbf8b..10f7243617 100644 --- a/sources/share/20150323 Square 2.0 Icon Pack Is Twice More Beautiful.md +++ b/sources/share/20150323 Square 2.0 Icon Pack Is Twice More Beautiful.md @@ -1,3 +1,5 @@ +Translating---geekpi + Square 2.0 Icon Pack Is Twice More Beautiful ================================================================================ ![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/03/Square_Icon_Pack_Linux_3.jpeg) @@ -53,4 +55,4 @@ via: http://itsfoss.com/square-2-0-icon-pack-linux/ [7]:http://itsfoss.com/install-icon-linux-mint/ [8]:http://itsfoss.com/install-themes-icons-elementary-os-freya/ [9]:http://itsfoss.com/default-wallpapers-ubuntu-1504/ -[10]:http://itsfoss.com/best-icon-themes-ubuntu-1404/ \ No newline at end of file +[10]:http://itsfoss.com/best-icon-themes-ubuntu-1404/ From beae44bf4710b6cc8897520f767937cd355fd450 Mon Sep 17 00:00:00 2001 From: geekpi Date: Sun, 17 May 2015 10:41:35 +0800 Subject: [PATCH 043/965] Update 20150323 Square 2.0 Icon Pack Is Twice More Beautiful.md --- .../20150323 Square 2.0 Icon Pack Is Twice More Beautiful.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/sources/share/20150323 Square 2.0 Icon Pack Is Twice More Beautiful.md b/sources/share/20150323 Square 2.0 Icon Pack Is Twice More Beautiful.md index 10f7243617..8fb244c5bc 100644 --- a/sources/share/20150323 Square 2.0 Icon Pack Is Twice More Beautiful.md +++ b/sources/share/20150323 Square 2.0 Icon Pack Is Twice More Beautiful.md @@ -1,5 +1,3 @@ -Translating---geekpi - Square 2.0 Icon Pack Is Twice More Beautiful ================================================================================ ![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/03/Square_Icon_Pack_Linux_3.jpeg) From ada3568deab76d2a77f83deb48e8a5ab46293374 Mon Sep 17 00:00:00 2001 From: geekpi Date: Sun, 17 May 2015 10:42:04 +0800 Subject: [PATCH 044/965] translating --- .../20150323 Square 2.0 Icon Pack Is Twice More Beautiful.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/share/20150323 Square 2.0 Icon Pack Is Twice More Beautiful.md b/sources/share/20150323 Square 2.0 Icon Pack Is Twice More Beautiful.md index b0e5afbf8b..10f7243617 100644 --- a/sources/share/20150323 Square 2.0 Icon Pack Is Twice More Beautiful.md +++ b/sources/share/20150323 Square 2.0 Icon Pack Is Twice More Beautiful.md @@ -1,3 +1,5 @@ +Translating---geekpi + Square 2.0 Icon Pack Is Twice More Beautiful ================================================================================ ![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/03/Square_Icon_Pack_Linux_3.jpeg) @@ -53,4 +55,4 @@ via: http://itsfoss.com/square-2-0-icon-pack-linux/ [7]:http://itsfoss.com/install-icon-linux-mint/ [8]:http://itsfoss.com/install-themes-icons-elementary-os-freya/ [9]:http://itsfoss.com/default-wallpapers-ubuntu-1504/ -[10]:http://itsfoss.com/best-icon-themes-ubuntu-1404/ \ No newline at end of file +[10]:http://itsfoss.com/best-icon-themes-ubuntu-1404/ From f5c039462af3facab006858ce45f2e9dab699329 Mon Sep 17 00:00:00 2001 From: geekpi Date: Sun, 17 May 2015 11:04:05 +0800 Subject: [PATCH 045/965] translated --- ...e 2.0 Icon Pack Is Twice More Beautiful.md | 58 ------------------- ...e 2.0 Icon Pack Is Twice More Beautiful.md | 56 ++++++++++++++++++ 2 files changed, 56 insertions(+), 58 deletions(-) delete mode 100644 sources/share/20150323 Square 2.0 Icon Pack Is Twice More Beautiful.md create mode 100644 translated/share/20150323 Square 2.0 Icon Pack Is Twice More Beautiful.md diff --git a/sources/share/20150323 Square 2.0 Icon Pack Is Twice More Beautiful.md b/sources/share/20150323 Square 2.0 Icon Pack Is Twice More Beautiful.md deleted file mode 100644 index 10f7243617..0000000000 --- a/sources/share/20150323 Square 2.0 Icon Pack Is Twice More Beautiful.md +++ /dev/null @@ -1,58 +0,0 @@ -Translating---geekpi - -Square 2.0 Icon Pack Is Twice More Beautiful -================================================================================ -![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/03/Square_Icon_Pack_Linux_3.jpeg) - -Elegant, modern looking [Square icon theme][1] has recently been upgraded to version 2.0, which makes it more beautiful than ever. Square icon packs are compatible with all major desktop environments such as **Unity, GNOME, KDE, MATE** etc. Which means that you can use them for all popular Linux distributions such as Ubuntu, Fedora, Linux Mint, elementary OS etc. The vastness of this icon pack can be estimated from the fact it contains over 15,000 icons. - -### Install and use Square icon pack 2.0 in Linux ### - -There are two variants of Square icons, dark and light. Based on your preference, you can choose either of the two. For experimentation sake, I would advise you to download both variants of the icon theme. - -You can download the icon pack from the link below. The files are stored in Google Drive, so don’t be suspicious if you don’t see a standard website like [SourceForge][2]. - -- [Square Dark Icons][3] -- [Square Light Icons][4] - -To use the icon theme, extract the downloaded files in ~/.icons directory. If this doesn’t exist, create it. Once you have the files in the right place, based on your desktop environment, use a tool to change the icon theme. I have written some small tutorials in the past on this topic. Feel free to refer to them if you need further help: - -- [How to change themes in Ubuntu Unity][5] -- [How to change themes in GNOME Shell][6] -- [How to change themes in Linux Mint][7] -- [How to change theme in Elementary OS Freya][8] - -### Give it a try ### - -Here is what my Ubuntu 14.04 looks like with Square icons. I am using [Ubuntu 15.04 default wallpaper][9] in the background. - -![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/03/Square_Icon_Pack_Linux_2.jpeg) - -A quick look at several icons in the Square theme: - -![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/03/Square_Icon_Pack_Linux.jpeg) - -How do you find it? Do you think it can be considered as one of the [best icon themes for Ubuntu 14.04][10]? Do share your thoughts and stay tuned for more articles on customizing your Linux desktop. - - --------------------------------------------------------------------------------- - -via: http://itsfoss.com/square-2-0-icon-pack-linux/ - -作者:[Abhishek][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://itsfoss.com/author/abhishek/ -[1]:http://gnome-look.org/content/show.php/Square?content=163513 -[2]:http://sourceforge.net/ -[3]:http://gnome-look.org/content/download.php?content=163513&id=1&tan=62806435 -[4]:http://gnome-look.org/content/download.php?content=163513&id=2&tan=19789941 -[5]:http://itsfoss.com/how-to-install-themes-in-ubuntu-13-10/ -[6]:http://itsfoss.com/install-switch-themes-gnome-shell/ -[7]:http://itsfoss.com/install-icon-linux-mint/ -[8]:http://itsfoss.com/install-themes-icons-elementary-os-freya/ -[9]:http://itsfoss.com/default-wallpapers-ubuntu-1504/ -[10]:http://itsfoss.com/best-icon-themes-ubuntu-1404/ diff --git a/translated/share/20150323 Square 2.0 Icon Pack Is Twice More Beautiful.md b/translated/share/20150323 Square 2.0 Icon Pack Is Twice More Beautiful.md new file mode 100644 index 0000000000..a18110fb11 --- /dev/null +++ b/translated/share/20150323 Square 2.0 Icon Pack Is Twice More Beautiful.md @@ -0,0 +1,56 @@ +Square 2.0图标包更漂亮了 +================================================================================ +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/03/Square_Icon_Pack_Linux_3.jpeg) + +优雅、现代的[Square图标主题][1]最近更新到了2.0版,这让它比以前更漂亮了。Square图标包与其他主要的桌面环境如**Unity、 GNOME、KDE、 MATE等等**兼容。这意味着你可以在所有的流行Linux发行版如Ubuntu、Fedora、Linux Mint、elementary OS等等中使用它。 这个图标包估计包含超过了15000个图标。 + +### 在Linux中安装Square 2.0图标包 ### + +有两种不同的Square图标,暗色和亮色。基于你的洗好,你可以选择二者之一。出于实验,我建议你两个主题包都下载。 + +你可以用下面的链接下载图标包。文件存储在Google Drive,因此如果你没有看见像[SourceForge][2]这样标准的下载网站时怀疑。 + +- [Square Dark Icons][3] +- [Square Light Icons][4] + +要使用图标主题,解压下载的文件到~/.icons文件夹下。如果它不存在,就创建它。当你在正确的地方有这些文件后,基于你的桌面环境,使用一个工具来改变图标主题。我以前写了一些关于这个主题的教程。如果你需要额外的帮助,那么欢迎指出来: + +- [如何在Ubuntu Unity中改变主题][5] +- [如何在GNOME Shell中改变主题][6] +- [如何在Linux Mint中改变主题][7] +- [如何在Elementary OS Freya中改变主题][8] + +### 试一下 ### + +这是我用Square图标在Ubuntu 14.04中的效果。我背景使用的是[Ubuntu 15.04 默认壁纸][9]。 + +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/03/Square_Icon_Pack_Linux_2.jpeg) + +Square主题中几个图标的样子: + +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/03/Square_Icon_Pack_Linux.jpeg) + +你怎么找到它的?你认为它是[Ubuntu 14.04中最佳的图标主题][10]之一么?你会分享它病期待更多关于自定义Linux桌面的文章么? + + +-------------------------------------------------------------------------------- + +via: http://itsfoss.com/square-2-0-icon-pack-linux/ + +作者:[Abhishek][a] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://itsfoss.com/author/abhishek/ +[1]:http://gnome-look.org/content/show.php/Square?content=163513 +[2]:http://sourceforge.net/ +[3]:http://gnome-look.org/content/download.php?content=163513&id=1&tan=62806435 +[4]:http://gnome-look.org/content/download.php?content=163513&id=2&tan=19789941 +[5]:http://itsfoss.com/how-to-install-themes-in-ubuntu-13-10/ +[6]:http://itsfoss.com/install-switch-themes-gnome-shell/ +[7]:http://itsfoss.com/install-icon-linux-mint/ +[8]:http://itsfoss.com/install-themes-icons-elementary-os-freya/ +[9]:http://itsfoss.com/default-wallpapers-ubuntu-1504/ +[10]:http://itsfoss.com/best-icon-themes-ubuntu-1404/ From f486dea7065a36dc0ecf30851a591081e8782508 Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 17 May 2015 11:14:23 +0800 Subject: [PATCH 046/965] PUB:20150429 web caching basics terminology http headers and caching strategies MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @wwy-hust 辛苦啦! --- ...ogy http headers and caching strategies.md | 181 ++++++++++++++++ ...ogy http headers and caching strategies.md | 198 ------------------ 2 files changed, 181 insertions(+), 198 deletions(-) create mode 100644 published/20150429 web caching basics terminology http headers and caching strategies.md delete mode 100644 translated/tech/2015-04-29 web caching basics terminology http headers and caching strategies.md diff --git a/published/20150429 web caching basics terminology http headers and caching strategies.md b/published/20150429 web caching basics terminology http headers and caching strategies.md new file mode 100644 index 0000000000..52e4e4e01f --- /dev/null +++ b/published/20150429 web caching basics terminology http headers and caching strategies.md @@ -0,0 +1,181 @@ +Web缓存基础:术语、HTTP报头和缓存策略 +===================================================================== + +### 简介 + +对于您的站点的访问者来说,智能化的内容缓存是提高用户体验最有效的方式之一。缓存,或者对之前的请求的临时存储,是HTTP协议实现中最核心的内容分发策略之一。分发路径中的组件均可以缓存内容来加速后续的请求,这受控于对该内容所声明的缓存策略。 + +在这份指南中,我们将讨论一些Web内容缓存的基本概念。这主要包括如何选择缓存策略以保证互联网范围内的缓存能够正确的处理您的内容。我们将谈一谈缓存带来的好处、副作用以及不同的策略能带来的性能和灵活性的最大结合。 + +###什么是缓存(caching)? + +缓存(caching)是一个描述存储可重用资源以便加快后续请求的行为的术语。有许多不同类型的缓存,每种都有其自身的特点,应用程序缓存和内存缓存由于其对特定回复的加速,都很常用。 + +这份指南的主要讲述的Web缓存是一种不同类型的缓存。Web缓存是HTTP协议的一个核心特性,它能最小化网络流量,并且提升用户所感知的整个系统响应速度。内容从服务器到浏览器的传输过程中,每个层面都可以找到缓存的身影。 + +Web缓存根据特定的规则缓存相应HTTP请求的响应。对于缓存内容的后续请求便可以直接由缓存满足而不是重新发送请求到Web服务器。 + +###好处 + +有效的缓存技术不仅可以帮助用户,还可以帮助内容的提供者。缓存对内容分发带来的好处有: + +- **减少网络开销**:内容可以在从内容提供者到内容消费者网络路径之间的许多不同的地方被缓存。当内容在距离内容消费者更近的地方被缓存时,由于缓存的存在,请求将不会消耗额外的网络资源。 +- **加快响应速度**:由于并不是必须通过整个网络往返,缓存可以使内容的获得变得更快。缓存放在距用户更近的地方,例如浏览器缓存,使得内容的获取几乎是瞬时的。 +- **在同样的硬件上提高速度**:对于保存原始内容的服务器来说,更多的性能可以通过允许激进的缓存策略从硬件上压榨出来。内容拥有者们可以利用分发路径上某个强大的服务器来应对特定内容负载的冲击。 +- **网络中断时内容依旧可用**:使用某种策略,缓存可以保证在原始服务器变得不可用时,相应的内容对用户依旧可用。 + +###术语 + +在面对缓存时,您可能对一些经常遇到的术语可能不太熟悉。一些常见的术语如下: + +- **原始服务器**:原始服务器是内容的原始存放地点。如果您是Web服务器管理员,它就是您所管理的机器。它负责为任何不能从缓存中得到的内容进行回复,并且负责设置所有内容的缓存策略。 +- **缓存命中率**:一个缓存的有效性依照缓存的命中率进行度量。它是可以从缓存中得到数据的请求数与所有请求数的比率。缓存命中率高意味着有很高比例的数据可以从缓存中获得。这通常是大多数管理员想要的结果。 +- **新鲜度**:新鲜度用来描述一个缓存中的项目是否依旧适合返回给客户端。缓存中的内容只有在由缓存策略指定的新鲜期内才会被返回。 +- **过期内容**:缓存中根据缓存策略的新鲜期设置已过期的内容。过期的内容被标记为“陈旧”。通常,过期内容不能用于回复客户端的请求。必须重新从原始服务器请求新的内容或者至少验证缓存的内容是否仍然准确。 +- **校验**:缓存中的过期内容可以验证是否有效以便刷新过期时间。验证过程包括联系原始服务器以检查缓存的数据是否依旧代表了最近的版本。 +- **失效**:失效是依据过期日期从缓存中移除内容的过程。当内容在原始服务器上已被改变时就必须这样做,缓存中过期的内容会导致客户端发生问题。 + +还有许多其他的缓存术语,不过上面的这些应该能帮助您开始。 + +###什么能被缓存? + +某些特定的内容比其他内容更容易被缓存。对大多数站点来说,一些适合缓存的内容如下: + +- Logo和商标图像 +- 普通的不变化的图像(例如,导航图标) +- CSS样式表 +- 普通的Javascript文件 +- 可下载的内容 +- 媒体文件 + +这些文件更倾向于不经常改变,所以长时间的对它们进行缓存能获得好处。 + +一些项目在缓存中必须加以注意: + +- HTML页面 +- 会替换改变的图像 +- 经常修改的Javascript和CSS文件 +- 需要有认证后的cookies才能访问的内容 + +一些内容从来不应该被缓存: + +- 与敏感信息相关的资源(银行数据,等) +- 用户相关且经常更改的数据 + +除上面的通用规则外,通常您需要指定一些规则以便于更好地缓存不同种类的内容。例如,如果登录的用户都看到的是同样的网站视图,就应该在任何地方缓存这个页面。如果登录的用户会在一段时间内看到站点中用户特定的视图,您应该让用户的浏览器缓存该数据而不应让任何中介节点缓存该视图。 + +###Web内容缓存的位置 + +Web内容会在整个分发路径中的许多不同的位置被缓存: + +- **浏览器缓存**:Web浏览器自身会维护一个小型缓存。典型地,浏览器使用一种策略指示缓存最重要的内容。这可能是用户相关的内容或可能会再次请求且下载代价较高。 +- **中间缓存代理**:任何在客户端和您的基础架构之间的服务器都可以按期望缓存一些内容。这些缓存可能由ISP(网络服务提供者)或者其他独立组织提供。 +- **反向缓存**:您的服务器基础架构可以为后端的服务实现自己的缓存。如果实现了缓存,那么便可以在处理请求的位置返回相应的内容而不用每次请求都使用后端服务。 + +上面的这些位置通常都可以根据它们自身的缓存策略和内容源的缓存策略缓存一些相应的内容。 + +###缓存头部 + +缓存策略依赖于两个不同的因素。所缓存的实体本身需要决定是否应该缓存可接受的内容。它可以只缓存部分可以缓存的内容,但不能缓存超过限制的内容。 + +缓存行为主要由缓存策略决定,而缓存策略由内容拥有者设置。这些策略主要通过特定的HTTP头部来清晰地表达。 + +经过几个不同HTTP协议的变化,出现了一些不同的针对缓存方面的头部,它们的复杂度各不相同。下面列出了那些你也许应该注意的: + +- **`Expires`**:尽管使用范围相当有限,但`Expires`头部是非常简洁明了的。通常它设置一个未来的时间,内容会在此时间过期。这时,任何对同样内容的请求都应该回到原始服务器处。这个头部或许仅仅最适合回退模式(fall back)。 +- **`Cache-Control`**:这是`Expires`的一个更加现代化的替换物。它已被很好的支持,且拥有更加灵活的实现。在大多数案例中,它比`Expires`更好,但同时设置两者的值也无妨。稍后我们将讨论您可以设置的`Cache-Control`的详细选项。 +- **`ETag`**:`ETag`用于缓存验证。源服务器可以在首次服务一个内容时为该内容提供一个独特的`ETag`。当一个缓存需要验证这个内容是否即将过期,他会将相应的`ETag`发送回服务器。源服务器或者告诉缓存内容是一致的,或者发送更新后的内容(带着新的`ETag`)。 +- **`Last-Modified`**:这个头部指明了相应的内容最后一次被修改的时间。它可能会作为保证内容新鲜度的验证策略的一部分被使用。 +- **`Content-Length`**:尽管并没有在缓存中明确涉及,`Content-Length`头部在设置缓存策略时很重要。某些软件如果不提前获知内容的大小以留出足够空间,则会拒绝缓存该内容。 +- **`Vary`**:缓存系统通常使用请求的主机和路径作为存储该资源的键。当判断一个请求是否是请求同样内容时,`Vary`头部可以被用来提醒缓存系统需要注意另一个附加头部。它通常被用来告诉缓存系统同样注意`Accept-Encoding`头部,以便缓存系统能够区分压缩和未压缩的内容。 + +### Vary头部的隐语 + +`Vary`头部提供给您存储同一个内容的不同版本的能力,代价是降低了缓存的容量。 + +在使用`Accept-Encoding`时,设置`Vary`头部允许明确区分压缩和未压缩的内容。这在服务某些不能处理压缩数据的浏览器时很重要,它可以保证基本的可用性。`Vary`的一个典型的值是`Accept-Encoding`,它只有两到三个可选的值。 + +一开始看上去`User-Agent`这样的头部可以用于区分移动浏览器和桌面浏览器,以便您的站点提供差异化的服务。但`User-Agent`字符串是非标准的,结果将会造成在中间缓存中保存同一内容的许多不同版本的缓存,这会导致缓存命中率的降低。`Vary`头部应该谨慎使用,尤其是您不具备在您控制的中间缓存中使请求标准化的能力(也许可以,比如您可以控制CDN的话)。 + +###缓存控制标志怎样影响缓存 + +上面我们提到了`Cache-Control`头部如何被用与现代缓存策略标准。能够通过这个头部设定许多不同的缓存指令,多个不同的指令通过逗号分隔。 + +一些您可以使用的指示内容缓存策略的`Cache-Control`的选项如下: + +- **`no-cache`**:这个指令指示所有缓存的内容在新的请求到达时必须先重新验证,再发送给客户端。这条指令实际将内容立刻标记为过期的,但允许通过验证手段重新验证以避免重新下载整个内容。 +- **`no-store`**:这条指令指示缓存的内容不能以任何方式被缓存。它适合在回复敏感信息时设置。 +- **`public`**:它将内容标记为公有的,这意味着它能被浏览器和其他任何中间节点缓存。通常,对于使用了HTTP验证的请求,其回复被默认标记为`private`。`public`标记将会覆盖这个设置。 +- **`private`**:它将内容标记为私有的。私有数据可以被用户的浏览器缓存,但*不能*被任何中间节点缓存。它通常用于用户相关的数据。 +- **`max-age`**:这个设置指示了缓存内容的最大生存期,它在最大生存期后必须在源服务器处被验证或被重新下载。在现代浏览器中这个选项大体上取代了`Expires`头部,浏览器也将其作为决定内容的新鲜度的基础。这个选项的值以秒为单位表示,最大可以表示一年的新鲜期(31536000秒)。 +- **`s-maxage`**:这个选项非常类似于`max-age`,它指明了内容能够被缓存的时间。区别是这个选项只在中间节点的缓存中有效。结合这两个选项可以构建更加灵活的缓存策略。 +- **`must-revalidate`**:它指明了由`max-age`、`s-maxage`或`Expires`头部指明的新鲜度信息必须被严格的遵守。它避免了缓存的数据在网络中断等类似的场景中被使用。 +- **`proxy-revalidate`**:它和上面的选项有着一样的作用,但只应用于中间的代理节点。在这种情况下,用户的浏览器可以在网络中断时使用过期内容,但中间缓存内容不能用于此目的。 +- **`no-transform`**:这个选项告诉缓存在任何情况下都不能因为性能的原因修改接收到的内容。这意味着,缓存不允许压缩接收到的内容(没有从原始服务器处接收过压缩版本的该内容)并发送。 + +这些选项能够以不同的方式结合以获得不同的缓存行为。一些互斥的值如下: + +- `no-cache`,`no-store`以及由其他前面未提到的选项指明的常用的缓存行为 +- `public`和`private` + +如果`no-store`和`no-cache`都被设置,那么`no-store`会取代`no-cache`。对于非授权的请求的回复,`public`是隐含的设置。对于授权的请求的回复,`private`选项是隐含的。他们可以通过在`Cache-Control`头部中指明相应的相反的选项以覆盖。 + +###开发一种缓存策略 + +在理想情况下,任何内容都可以被尽可能缓存,而您的服务器只需要偶尔的提供一些验证内容即可。但这在现实中很少发生,因此您应该尝试设置一些明智的缓存策略,以在长期缓存和站点改变的需求间达到平衡。 + +### 常见问题 + +在许多情况中,由于内容被产生的方式(如根据每个用户动态的产生)或者内容的特性(例如银行的敏感数据),这些内容不应该被缓存。另一些许多管理员在设置缓存时可能面对的问题是外部缓存的数据未过期,但新版本的数据已经产生。 + +这些都是经常遇到的问题,它们会影响缓存的性能和您提供的数据的准确性。然而,我们可以通过开发提前预见这些问题的缓存策略来缓解这些问题。 + +### 一般性建议 + +尽管您的实际情况会指导您选择的缓存策略,但是下面的建议能帮助您获得一些合理的决定。 + +在您担心使用哪一个特定的头部之前,有一些特定的步骤可以帮助您提高您的缓存命中率。一些建议如下: + +- **为图像、CSS和共享的内容建立特定的文件夹**:将内容放到特定的文件夹内使得您可以方便的从您的站点中的任何页面引用这些内容。 +- **使用同样的URL来表示同样的内容**:由于缓存使用内容请求中的主机名和路径作为键,因此应保证您的所有页面中的该内容的引用方式相同,前一个建议能让这点更加容易做到。 +- **尽可能使用CSS图像拼接**:对于像图标和导航等内容,使用CSS图像拼接能够减少渲染您页面所需要的请求往返,并且允许对拼接缓存很长一段时间。 +- **尽可能将主机脚本和外部资源本地化**:如果您使用Javascript脚本和其他外部资源,如果上游没有提供合适的缓存头部,那么您应考虑将这些内容放在您自己的服务器上。您应该注意上游的任何更新,以便更新本地的拷贝。 +- **对缓存内容收集文件摘要**:静态的内容比如CSS和Javascript文件等通常比较适合收集文件摘要。这意味着为文件名增加一个独特的标志符(通常是这个文件的哈希值)可以在文件修改后绕开缓存保证新的内容被重新获取。有很多工具可以帮助您创建文件摘要并且修改HTML文档中的引用。 + +对于不同的文件正确地选择不同的头部这件事,下面的内容可以作为一般性的参考: + +- **允许所有的缓存存储一般内容**:静态内容以及非用户相关的内容应该在分发链的所有节点被缓存。这使得中间节点可以将该内容回复给多个用户。 +- **允许浏览器缓存用户相关的内容**:对于每个用户的数据,通常在用户自己的浏览器中缓存是可以被接受且有益的。缓存在用户自身的浏览器能够使得用户在接下来的浏览中能够瞬时读取,但这些内容不适合在任何中间代理节点缓存。 +- **将时间敏感的内容作为特例**:如果您的数据是时间敏感的,那么相对上面两条参考,应该将这些数据作为特例,以保证过期的数据不会在关键的情况下被使用。例如,您的站点有一个购物车,它应该立刻反应购物车里面的物品。依据内容的特点,可以在`Cache-Control`头部中使用`no-cache`或`no-store`选项。 +- **总是提供验证器**:验证器使得过期的内容可以无需重新下载而得到刷新。设置`ETag`和`Last-Modified`头部将允许缓存向原始服务器验证内容,并在内容未修改时刷新该内容新鲜度以减少负载。 +- **对于支持的内容设置长的新鲜期**:为了更加有效的利用缓存,一些作为支持性的内容应该被设置较长的新鲜期。这通常比较适合图像和CSS等由用户请求用来渲染HTML页面的内容。和文件摘要一起,设置延长的新鲜期将允许缓存长时间的存储这些资源。如果资源发生改变,修改的文件摘要将会使缓存的数据无效并触发对新的内容的下载。那时,新的支持的内容会继续被缓存。 +- **对父内容设置短的新鲜期**:为了使得前面的模式正常工作,容器类的内容应该相应的设置短的新鲜期,或者设置不全部缓存。这通常是在其他协助内容中使用的HTML页面。这个HTML页面将会被频繁的下载,使得它能快速的响应改变。支持性的内容因此可以被尽量缓存。 + +关键之处便在于达到平衡,一方面可以尽量的进行缓存,另一方面为未来保留当改变发生时从而改变整个内容的机会。您的站点应该同时具有: + +- 尽量缓存的内容 +- 拥有短的新鲜期的缓存内容,可以被重新验证 +- 完全不被缓存的内容 + +这样做的目的便是将内容尽可能的移动到第一个分类(尽量缓存)中的同时,维持可以接受的缓存命中率。 + +结论 +---- + +花时间确保您的站点使用了合适的缓存策略将对您的站点产生重要的影响。缓存使得您可以在保证服务同样内容的同时减少带宽的使用。您的服务器因此可以靠同样的硬件处理更多的流量。或许更重要的是,客户们能在您的网站中获得更快的体验,这会使得他们更愿意频繁的访问您的站点。尽管有效的Web缓存并不是银弹,但设置合适的缓存策略会使您以最小的代价获得可观的收获。 + +--- + +via: https://www.digitalocean.com/community/tutorials/web-caching-basics-terminology-http-headers-and-caching-strategies + +作者: [Justin Ellingwood](https://www.digitalocean.com/community/users/jellingwood) +译者:[wwy-hust](https://github.com/wwy-hust) +校对:[wxy](https://github.com/wxy) +推荐:[royaso](https://github.com/royaso) + + + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + + + diff --git a/translated/tech/2015-04-29 web caching basics terminology http headers and caching strategies.md b/translated/tech/2015-04-29 web caching basics terminology http headers and caching strategies.md deleted file mode 100644 index 1b04873445..0000000000 --- a/translated/tech/2015-04-29 web caching basics terminology http headers and caching strategies.md +++ /dev/null @@ -1,198 +0,0 @@ -WebHTTPͷͻ -===================================================================== - -### - -վķ˵ܻݻûЧķʽ֮һ棬߶֮ǰʱ洢HTTPЭʵĵݷַ֮һַ·еԻٺڶԸĻԡ - -ָУǽһЩWebݻĻҪѡ񻺴Ա֤ΧڵĻܹȷĴݡǽ̸һ̸ĺôԼͬIJܴܺԵϡ - -ʲôǻ棿 ------------- - -Ǵ洢ԴԱӿ಻ͬ͵Ļ棬ÿֶص㣬Ӧó򻺴ڴ滺ضظļ٣ܳá - -Web棬ָϵģһֲͬ͵Ļ档WebHTTPЭһԣСû֪ϵͳӦٶȡݴӷĴУÿ涼ҵӰ - -WebضĹ򻺴ӦHTTPĻظڻݵĺֱɻ·Web - -ô ----- - -ЧĻ漼ûݵṩߡݷַĺôУ - -- **翪**ݿڴṩߵ·֮಻ͬĵط档ھ߸ĵطʱڻĴڣ󽫲ĶԴ - -- **ӿӦٶ**òDZģʹݵĻñø졣ھûĵطά棬ʹݵĻȡ˲ʱġ - -- **ͬӲٶ**ڱԭʼݵķ˵ܿͨĻԴӲѹեӵǿý·ǿķӦijݸصij - -- **жʱɿ**ʹijֲԣԱ֤ԭʼòʱӦݶûɿá - - ----- - -ԻʱܶһЩ̫ܲϤһЩ£ - -- **ԭʼ**ԭʼݵԭʼŵص㡣WebԱĻΪκβܴӻеõݽлظҸݵĻԡ - -- ****һЧջʽжǿԴӻеõݵıʡʸζкܸ߱ݿԴӻлáͨǴԱҪĽ - -- **ʶ**ʶһеĿǷʺϷظͻˡеֻɻָڲŻᱻء - -- ****иݻԵѹڵݡڵݱΪ¾ɡͨݲڻظͻ˵󡣱´ԭʼµݻ֤ǷȻ׼ȷ - -- **У**еĹݿԱ֤ЧԱˢ¹ʱ䡣֤̰ϵԭʼԼ黺Ƿɴİ汾 - -- **ʧЧ**ʧЧݹڴӻƳݵĹ̡ԭʼѱı䲢һйڵݻᵼ¿ͻ˵ǩʱDZġ - -ĻЩӦܰʼ - -ʲôܱ棿 --------------- - -ijЩضݱݸױ档Դվ˵һЩѺõ£ - -- Logo̱ͼ -- ͨõķתͼ磬ͼ꣩ -- ʽ -- ͨJavascriptļ -- ص -- ýļ - -Щļڲı䣬ԳʱĶǽлܻúô - -һЩĿڻбע⣺ - -- HTMLҳ -- תͼ -- ޸ĵJavascriptCSSļ -- ½cookiesʵ - -һЩݴӦñ棺 - -- ϢصԴݣȣ -- ûҾĵ - -ͨù⣬ͨҪָһЩԱڸõػ治ͬݡ磬½ûͬվͼӦκεطҳ档½ûһʱڿվûеͼӦûݶӦκнڵ㻺ͼ - -Webݻλ ------------------ - -Webݻַ·е಻ͬĵص㱻棺 - -- ****WebάһСͻ档͵أʹһֲָʾҪݡûصݻܻٴش۽ϸߡ -- **м仺**κڿͻ˺Ļܹ֮ķ԰һЩݡЩISPṩߣ֯ṩ -- **򻺴**ķܹΪ˵ķʵԼĻ档ʵ˻棬ôӴ㷵Ӧݶÿʹú˷ - -ЩλͨԸĻԺԴĻԻһЩӦݡ - -ͷ --------- - -ͬءʵ屾ҪǷӦûɽܵݡֻ沿ֿԻݣܻ泬Ƶݡ - -ΪҪɻԾӵáЩҪͨضHTTPͷر - -ͬHTTPЭĵһЩͬľ۽ڻͷˣǵĸӶȸͬгЩҲӦעģ - -- **`Expires`**ʹ÷Χ൱ޣ`Expires`ͷǷdz˵ġͨһδʱ䣬ݻڴʱڡʱκζͬݵӦûصԭʼͷʺϻģʽfall back -- **`Cache-Control`**`Expires`һִ滻ѱܺõ֧֣ӵиʵ֡ڴУ`Expires`ãͬʱߵֵҲ޷Ժǽõ`Cache-Control`ϸѡ -- **`ETag`**`ETag`ڻ֤Դ״ηһʱΪṩһص`ETag`һҪ֤Ƿ񼴽ڣὫӦ`ETag`ͻطԴ߸߻һµģ߷͸ºݣµ`ETag` -- **`Last-Modified`**ͷָӦһα޸ĵʱ䡣ܻΪ֤ʶȵ֤Եһֱʹá -- **`Content-Length`**ܲûȷڻб漰`Content-Length`ͷûʱҪijЩǰ֪ݵĴС㹻ռ䣬ܾݡ -- **`Vary`**ϵͳͨʹ·Ϊ洢Դļ`Vary`ͷԱھһǷͬʱѻϵͳעһӵͷͨ߻ϵͳͬʹ`Accept-Encoding`ͷΪ˻ϵͳܹѹδѹݡ - -### Varyͷ - -`Vary`ͷṩ洢ͬһݵIJͬ汾ϡ˻ڡ - -`Accept-Encoding`İУ`Vary`ͷѹδѹӵоԵڷijЩܴѹݵʱҪԱ֤ʹá`Accept-Encoding``Vary`IJĺѡֵΪֻѡֵ - -`User-Agent`ͷһʼȥƶԱվṩ컯ķĺ⡣`User-Agent`ַǷDZ׼ģм仺жͬһݵ಻ͬ汾Ļ棬ᵼ»ʵĽ͡`Vary`ͷӦñصʹã߱Ƶм棨磬ݷַ磩ʹ׼ - -Ʊ־Ӱ컺 ------------------------- - -ᵽ`Cache-Control`ͷαִԱ׼಻ͬĻָܹͨͷ趨ָͬͨŽзַָ - -һЩʹõָʾݻԵ`Cache-Control`ѡ£ - -- **`no-cache`**ָָʾлµ󵽴ʱ֤ٷ͸ͻˡָʵʽ̱ΪڵģDZ֤֤Աݡ -- **`no-store`**ָָʾݲκηʽ档ʺڻظϢʱá -- **`public`**ݱΪеģζܱκмڵ㻺档ͨʹHTTP֤ظĬϱΪ`private``public`ǽḲá -- **`private`**ݱΪ˽еġ˽ݿԱû棬**κмڵ㻺档ͨûصݡ -- **`max-age`**ָʾ˻ݵڣںԴ֤ءִѡȡ`Expires`ͷҲΪݵʶȵĻѡֵΪλʾԱʾһڣ31536000룩 -- **`s-maxage`**ѡdz`max-age`ָܹʱ䡣ѡֻмڵĻЧѡԹĻԡ -- **`must-revalidate`**ָ`max-age``s-maxage``Expires`ͷָʶϢ뱻ϸء˻жϵƵijбʹá -- **`proxy-revalidate`**ѡһãֻӦмĴڵ㡣£ûжʱʹùݣмĻݲڴĿġ -- **`no-transform`**ѡ߻κ¶Ϊܵԭ޸Ľյݡζţ治ѹյݣûдԭʼչѹ汾ĸݣ͡ - -ЩѡܹԲͬķʽԻòͬĻΪһЩֵ£ - -- `no-cache``no-store`ԼǰδᵽѡָijõĻΪ -- `public``private` - -`no-store``no-cache`ãô`no-store`ȡ`no-cache`ڷȨĻظ`public`áȨĻظ`private`ѡġǿͨ`Cache-Control`ͷָӦ෴ѡԸǡ - -һֻ ----------------- - -£κݶԱĻ棬ķֻҪżṩһЩ֤ݼɡʵкٷӦóһЩǵĻԣڳڻվıﵽƽ⡣ - -### - -Уݱķʽÿû̬IJݵԣеݣЩݲӦñ档һЩԱûʱԵⲿδڣ°汾Ѿ - -ЩǾ⣬ǻӰ컺ܺṩݵ׼ȷԡȻǿͨǰԤЩĻЩ⡣ - -### һԽ - -ʵָѡĻԣĽܰһЩľ - -ʹһضͷ֮ǰһЩضIJ԰ĻʡһЩ£ - -- **ΪͼCSS͹ݽضļ**ݷŵضļʹԷĴվеκҳЩݡ -- **ʹͬURLʾͬ**ڻʹе·ΪӦ֤ҳеĸݵ÷ʽͬǰһ -- **ʹCSSͼ**ͼ͵ݣʹCSSͼܹȾҳҪԾ黺ܳһʱ䡣 -- **ܽűⲿԴػ**ʹJavascriptűⲿԴûṩʵĻͷôӦǽЩݷԼķϡӦעεκθ£Ա±صĿ -- **ԻռļժҪ**̬ݱCSSJavascriptļͨȽʺռļժҪζΪļһصı־ͨļĹϣֵļ޸ĺƿ汣֤µݱ»ȡкܶ๤߿԰ļժҪ޸HTMLĵеá - -ڲͬļȷѡͬͷ£ݿΪһԵIJο - -- **еĻ洢һ**̬ԼûصӦڷַнڵ㱻档ʹмڵԽݻظû -- **ûص**ÿûݣͨûԼлǿԱġûܹʹûڽܹ˲ʱȡЩݲʺκмڵ㻺档 -- **ʱеΪ**ʱеģôοӦýЩΪԱ֤ڵݲڹؼ±ʹá磬վһﳵӦ̷ӦﳵƷݵص㣬`Cache-Control`ͷʹ`no-cache``no-store`ѡ -- **ṩ֤**֤ʹùڵݿضõˢ¡`ETag``Last-Modified`ͷԭʼ֤ݣδ޸ʱˢ¸ʶԼٸء -- **ֵ֧ó**Ϊ˸Чû棬һЩΪ֧ԵӦñýϳڡͨȽʺͼCSSûȾHTMLҳݡļժҪһӳڽ泤ʱĴ洢ЩԴԴı䣬޸ĵļժҪʹЧµݵءʱµֵ֧ݻ档 -- **Ըö̵**ΪʹǰģʽӦӦö̵ڣòȫ档ͨЭʹõHTMLҳ档HTMLҳ潫ᱻƵأʹܿٵӦı䡣֧Ե˿ԱĻ档 - -ؼ֮ڴﵽƽ⣬һԼĽл棬һΪδıݵĻᡣı䷢ʱվӦͬʱУ - -- ػ -- ӵж̵ڵĻݣԱ֤ -- ȫ - -ĿıǽݾܵƶһࣨĻ棩еͬʱάֿԽܵĻʡ - - ----- - -ʱȷվʹ˺ʵĻԽվҪӰ졣ʹڱ֤ͬݵͬʱٴʹáķ˿ԿͬӲҪǣͻվлø飬ʹǸԸƵķվ㡣ЧWeb沢úʵĻԻʹСĴۻÿɹ۵ջ - ---- - -: [Justin Ellingwood](https://www.digitalocean.com/community/users/jellingwood) - -ߣ[wwy-hust](https://github.com/wwy-hust) - -Уԣ[УID](https://github.com/УID) - -Ƽ[royaso](https://github.com/royaso) - -via: https://www.digitalocean.com/community/tutorials/web-caching-basics-terminology-http-headers-and-caching-strategies - - [LCTT](https://github.com/LCTT/TranslateProject) ԭ룬[Linuxй](http://linux.cn/) Ƴ - - - From 92ef3991c77d1be9e0dd165ed0d2203aab5fd05e Mon Sep 17 00:00:00 2001 From: zhangboyue Date: Sun, 17 May 2015 12:14:31 +0800 Subject: [PATCH 047/965] Get an article for translating --- ...ypper Commands to Manage 'Suse' Linux Package Management.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150512 45 Zypper Commands to Manage 'Suse' Linux Package Management.md b/sources/tech/20150512 45 Zypper Commands to Manage 'Suse' Linux Package Management.md index 8468a26986..1f5661e8c4 100644 --- a/sources/tech/20150512 45 Zypper Commands to Manage 'Suse' Linux Package Management.md +++ b/sources/tech/20150512 45 Zypper Commands to Manage 'Suse' Linux Package Management.md @@ -1,3 +1,4 @@ +zhangboyue 翻译中 45 Zypper Commands to Manage ‘Suse’ Linux Package Management ================================================================================ SUSE (Software and System Entwicklung (Germany) meaning Software and System Development, in English) Linux lies on top of Linux Kernel brought by Novell. SUSE comes in two pack. One of them is called OpenSUSE, which is freely available (free as in speech as well as free as in wine). It is a community driven project packed with latest application support, the latest stable release of OpenSUSE Linux is 13.2. @@ -823,4 +824,4 @@ via: http://www.tecmint.com/zypper-commands-to-manage-suse-linux-package-managem 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 [a]:http://www.tecmint.com/author/avishek/ -[1]:http://www.tecmint.com/installation-of-suse-linux-enterprise-server-12/ \ No newline at end of file +[1]:http://www.tecmint.com/installation-of-suse-linux-enterprise-server-12/ From 7fd070d95c56c00f609f17119d7604d86899fcb7 Mon Sep 17 00:00:00 2001 From: zhangboyue Date: Sun, 17 May 2015 12:20:03 +0800 Subject: [PATCH 048/965] Update 20150512 45 Zypper Commands to Manage 'Suse' Linux Package Management.md From bbc7998cfc89f3f2ca99c5a7218d52a58dd1fe41 Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 17 May 2015 20:38:55 +0800 Subject: [PATCH 049/965] PUB:20150316 Systemd Boot Process a Close Look in Linux @zpl1025 --- ...temd Boot Process a Close Look in Linux.md | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) rename {translated/tech => published}/20150316 Systemd Boot Process a Close Look in Linux.md (75%) diff --git a/translated/tech/20150316 Systemd Boot Process a Close Look in Linux.md b/published/20150316 Systemd Boot Process a Close Look in Linux.md similarity index 75% rename from translated/tech/20150316 Systemd Boot Process a Close Look in Linux.md rename to published/20150316 Systemd Boot Process a Close Look in Linux.md index a2c2ea28be..747e946925 100644 --- a/translated/tech/20150316 Systemd Boot Process a Close Look in Linux.md +++ b/published/20150316 Systemd Boot Process a Close Look in Linux.md @@ -1,12 +1,13 @@ 走进Linux之systemd启动过程 ================================================================================ -Linux系统的启动方式有点复杂,而且总是有需要优化的地方。传统的Linux系统启动过程主要由著名的init进程(也被称为SysV init启动系统)处理,而基于init的启动系统也被确认会有效率不足的问题,systemd是Linux系统机器的另一种启动方式,宣称弥补了以[传统Linux SysV init][2]为基础的系统的缺点。在这里我们将着重讨论systemd的特性和争议,但是为了更好地理解它,也会看一下通过传统的以SysV init为基础的系统的Linux启动过程是什么样的。友情提醒一下systemd仍然处在测试阶段,而未来发布的Linux操作系统也正准备用systemd启动管理程序替代当前的启动过程。 + +Linux系统的启动方式有点复杂,而且总是有需要优化的地方。传统的Linux系统启动过程主要由著名的init进程(也被称为SysV init启动系统)处理,而基于init的启动系统被认为有效率不足的问题,systemd是Linux系统机器的另一种启动方式,宣称弥补了以[传统Linux SysV init][2]为基础的系统的缺点。在这里我们将着重讨论systemd的特性和争议,但是为了更好地理解它,也会看一下通过传统的以SysV init为基础的系统的Linux启动过程是什么样的。友情提醒一下,systemd仍然处在测试阶段,而未来发布的Linux操作系统也正准备用systemd启动管理程序替代当前的启动过程(LCTT 译注:截止到本文发表,主流的Linux发行版已经有很多采用了 systemd)。 ### 理解Linux启动过程 ### -在我们打开Linux电脑的电源后第一个启动的进程就是init。分配给init进程的PID是1。它是系统其他所有进程的父进程。当一台Linux电脑启动后,处理器会先在系统存储中查找BIOS,之后BIOS会测试系统资源然后找到第一个引导设备,通常设置为硬盘,然后会查找硬盘的主引导记录(MBR),然后加载到内存中并把控制权交给它,以后的启动过程就由MBR控制。 +在我们打开Linux电脑的电源后第一个启动的进程就是init。分配给init进程的PID是1。它是系统其他所有进程的父进程。当一台Linux电脑启动后,处理器会先在系统存储中查找BIOS,之后BIOS会检测系统资源然后找到第一个引导设备,通常为硬盘,然后会查找硬盘的主引导记录(MBR),然后加载到内存中并把控制权交给它,以后的启动过程就由MBR控制。 -主引导记录会初始化引导程序(Linux上有两个著名的引导程序,GRUB和LILO,80%的Linux系统在用GRUB引导程序),这个时候GRUB或LILO会加载内核模块。内核会马上查找/sbin下的init进程并执行它。从这里开始init成为了Linux系统的父进程。init读取的第一个文件是/etc/inittab,通过它init会确定我们Linux操作系统的运行级别。它会从文件/etc/fstab里查找分区表信息然后做相应的挂载。然后init会启动/etc/init.d里指定的默认启动级别的所有服务/脚本。所有服务在这里通过init一个一个被初始化。在这个过程里,init每次只启动一个服务,所有服务/守护进程都在后台执行并由init来管理。 +主引导记录会初始化引导程序(Linux上有两个著名的引导程序,GRUB和LILO,80%的Linux系统在用GRUB引导程序),这个时候GRUB或LILO会加载内核模块。内核会马上查找/sbin下的“init”程序并执行它。从这里开始init成为了Linux系统的父进程。init读取的第一个文件是/etc/inittab,通过它init会确定我们Linux操作系统的运行级别。它会从文件/etc/fstab里查找分区表信息然后做相应的挂载。然后init会启动/etc/init.d里指定的默认启动级别的所有服务/脚本。所有服务在这里通过init一个一个被初始化。在这个过程里,init每次只启动一个服务,所有服务/守护进程都在后台执行并由init来管理。 关机过程差不多是相反的过程,首先init停止所有服务,最后阶段会卸载文件系统。 @@ -14,9 +15,9 @@ Linux系统的启动方式有点复杂,而且总是有需要优化的地方。 ### 理解Systemd ### -开发Systemd的主要目的就是减少系统引导时间和计算开销。Systemd(系统管理守护进程),最开始以GNU GPL协议授权开发,现在已转为使用GNU LGPL协议,它是如今讨论最热烈的引导和服务管理程序。如果你的Linux系统配置为使用Systemd引导程序,那么代替传统的SysV init,启动过程将交给systemd处理。Systemd的一个核心功能是它同时支持SysV init的后开机启动脚本。 +开发Systemd的主要目的就是减少系统引导时间和计算开销。Systemd(系统管理守护进程),最开始以GNU GPL协议授权开发,现在已转为使用GNU LGPL协议,它是如今讨论最热烈的引导和服务管理程序。如果你的Linux系统配置为使用Systemd引导程序,它取替传统的SysV init,启动过程将交给systemd处理。Systemd的一个核心功能是它同时支持SysV init的后开机启动脚本。 -Systemd引入了并行启动的概念,它会为每个需要启动的守护进程建立一个管道套接字,这些套接字对于使用它们的进程来说是抽象的,这样它们可以允许不同守护进程之间进行交互。Systemd会创建新进程并为每个进程分配一个控制组。处于不同控制组的进程之间可以通过内核来互相通信。[systemd处理开机启动进程][2]的方式非常漂亮,和传统基于init的系统比起来优化了太多。让我们看下Systemd的一些核心功能。 +Systemd引入了并行启动的概念,它会为每个需要启动的守护进程建立一个套接字,这些套接字对于使用它们的进程来说是抽象的,这样它们可以允许不同守护进程之间进行交互。Systemd会创建新进程并为每个进程分配一个控制组(cgroup)。处于不同控制组的进程之间可以通过内核来互相通信。[systemd处理开机启动进程][2]的方式非常漂亮,和传统基于init的系统比起来优化了太多。让我们看下Systemd的一些核心功能。 - 和init比起来引导过程简化了很多 - Systemd支持并发引导过程从而可以更快启动 @@ -81,7 +82,9 @@ Systemd提供了工具用于识别和定位引导相关的问题或性能影响 234ms httpd.service 191ms vmms.service -**systemd-analyze verify** 显示在所有系统单元中是否有语法错误。**systemd-analyze plot** 可以用来把整个引导过程写入一个SVG格式文件里。整个引导过程非常长不方便阅读,所以通过这个命令我们可以把输出写入一个文件,之后再查看和分析。下面这个命令就是做这个。 +**systemd-analyze verify** 显示在所有系统单元中是否有语法错误。 + +**systemd-analyze plot** 可以用来把整个引导过程写入一个SVG格式文件里。整个引导过程非常长不方便阅读,所以通过这个命令我们可以把输出写入一个文件,之后再查看和分析。下面这个命令就是做这个。 systemd-analyze plot > boot.svg @@ -89,9 +92,9 @@ Systemd提供了工具用于识别和定位引导相关的问题或性能影响 Systemd并没有幸运地获得所有人的青睐,一些专家和管理员对于它的工作方式和开发有不同意见。根据对于Systemd的批评,它不是“类Unix”方式因为它试着替换一些系统服务。一些专家也不喜欢使用二进制配置文件的想法。据说编辑systemd配置非常困难而且没有一个可用的图形工具。 -### 在Ubuntu 14.04和12.04上测试Systemd ### +###  如何在Ubuntu 14.04和12.04上测试Systemd ### -本来,Ubuntu决定从Ubuntu 16.04 LTS开始使用Systemd来替换当前的引导过程。Ubuntu 16.04预计在2016年4月发布,但是考虑到Systemd的流行和需求,即将发布的**Ubuntu 15.04**将采用它作为默认引导程序。好消息是Ubuntu 14.04 Trusty Tahr和Ubuntu 12.04 Precise Pangolin的用户可以在他们的机器上测试Systemd。测试过程并不复杂,你所要做的只是把相关的PPA包含到系统中,更新仓库并升级系统。 +本来,Ubuntu决定从Ubuntu 16.04 LTS开始使用Systemd来替换当前的引导过程。Ubuntu 16.04预计在2016年4月发布,但是考虑到Systemd的流行和需求,刚刚发布的**Ubuntu 15.04**采用它作为默认引导程序。另外,Ubuntu 14.04 Trusty Tahr和Ubuntu 12.04 Precise Pangolin的用户可以在他们的机器上测试Systemd。测试过程并不复杂,你所要做的只是把相关的PPA包含到系统中,更新仓库并升级系统。 **声明**:请注意它仍然处于Ubuntu的测试和开发阶段。升级测试包可能会带来一些未知错误,最坏的情况下有可能损坏你的系统配置。请确保在尝试升级前已经备份好重要数据。 @@ -127,7 +130,7 @@ Systemd并没有幸运地获得所有人的青睐,一些专家和管理员对 ![](http://blog.linoxide.com/wp-content/uploads/2015/03/Grub-Systemd.png) -就这样,你的Ubuntu系统已经不在使用传统的引导程序了,改为使用Systemd管理器。重启你的机器然后查看systemd引导过程吧。 +就这样,你的Ubuntu系统已经不再使用传统的引导程序了,改为使用Systemd管理器。重启你的机器然后查看systemd引导过程吧。 ![](http://blog.linoxide.com/wp-content/uploads/2015/03/Sytemd-Boot.png) @@ -141,7 +144,7 @@ via: http://linoxide.com/linux-how-to/systemd-boot-process/ 作者:[Aun Raza][a] 译者:[zpl1025](https://github.com/zpl1025) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 From 6fb46f77567489e08c7484f594c31647b2b12cda Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 17 May 2015 21:46:57 +0800 Subject: [PATCH 050/965] PUB:20150324 How to Host Open Source Code Repository in github @ZTinoZ --- ...t Open Source Code Repository in github.md | 31 ++++++++++--------- 1 file changed, 16 insertions(+), 15 deletions(-) rename {translated/tech => published}/20150324 How to Host Open Source Code Repository in github.md (62%) diff --git a/translated/tech/20150324 How to Host Open Source Code Repository in github.md b/published/20150324 How to Host Open Source Code Repository in github.md similarity index 62% rename from translated/tech/20150324 How to Host Open Source Code Repository in github.md rename to published/20150324 How to Host Open Source Code Repository in github.md index d382f9cd64..8b9f40d3b1 100644 --- a/translated/tech/20150324 How to Host Open Source Code Repository in github.md +++ b/published/20150324 How to Host Open Source Code Repository in github.md @@ -1,10 +1,11 @@ -怎样在Github上做开源代码库的主人 +怎样在Github上托管开源代码库 ================================================================================ -大家好,今天我们要学习一下怎样管理github.com库中的开源软件源代码。GitHub是一个基于web的Git库托管服务,提供分布式修改控制和Git的源代码管理(SCM)功能并加入了自身的特点。它给开源和私有项目提供了一个互相协作的工作区、代码预览和代码管理功能。不像Git,一个完完全全的命令行工具,GitHub提供了一个基于web的图形化界面和桌面,也整合了手机。GitHub同时提供了私有库付费计划和免费账号,都是用来管理开源软件项目的。 + +大家好,今天我们要学习一下怎样在github.com提供的仓库中托管开源软件源代码。GitHub是一个基于web的Git仓库托管服务,提供基于 git 的分布式版本控制和源代码管理(SCM)功能,并加入了自身的特点。它给开源项目和私有项目提供了一个互相协作的工作区、代码预览和代码管理功能。不像Git是一个完完全全的命令行工具,GitHub提供了一个基于web的图形化界面和桌面,也整合了手机操作。GitHub同时提供了私有库付费计划和通常用来管理开源软件项目的免费账号。 ![github universe logo](http://blog.linoxide.com/wp-content/uploads/2015/03/github-universe.jpg) -这是一种快速灵活,基于web的托管服务,它使用方便,管理分布式修改控制系统也是相当容易,任何人都能为了将它们使用、贡献、共享、问题跟踪和更多的全球各地数以百万计的人在github的库里管理他们的软件源代码。这里有一些简单快速地管理软件源代码的方法。 +这是一种快速灵活,基于web的托管服务,它使用方便,管理分布式版本控制系统也是相当容易,任何人都能将他们的软件源代码托管到 github,让全球各地数以百万计的人可以使用它、参与贡献、共享它、进行问题跟踪以及更多的用途。这里有一些简单快速地托管软件源代码的方法。 ### 1. 创建一个新的Github账号 ### @@ -20,7 +21,7 @@ ### 2. 创建一个新的库 ### -成功注册新账号或登录上Github之后,我们需要创建一个新的库来开始我们的正题。 +成功注册新账号或登录上Github之后,我们需要创建一个新的库来开始我们的征程。 点击位于顶部靠右账号id旁边的**(+)**按钮,然后点击“New Repository”。 @@ -46,13 +47,13 @@ 现在git已经准备就绪,我们要上传代码了。 -**注意**:为了避免错误,不要用**README**文件、许可证或gitignore文件来初始化新库,你可以在项目推送到Github上之后再添加它们。 +**注意**:为了避免错误,不要在初始化的新库中包含**README**、license或gitignore等文件,你可以在项目推送到Github上之后再添加它们。 -在终端上,我们需要把当前工作目录更改为你的本地项目,然后将本地目录初始化为Git库。 +在终端上,我们需要切换当前工作目录为你的本地项目的目录,然后将其初始化为Git库。 $ git init -接着我们在我们的新的本地库里添加的文件来作为我们的首次提交内容。 +接着我们添加新的本地库里中的文件,作为我们的首次提交内容。 $ git add . @@ -62,16 +63,16 @@ ![git commit](http://blog.linoxide.com/wp-content/uploads/2015/03/git-commit.png) -在终端上,我们要给远程库添加URL地址,用于以后我们能提交我们本地的库。 +在终端上,添加远程库的URL地址,以便我们的本地库推送到远程。 - $ git remote add origin remote Repository url + $ git remote add origin 远程库的URL $ git remote -v ![adding remote url](http://blog.linoxide.com/wp-content/uploads/2015/03/adding-remote-url.png) -注意:请确保将远程库的URL替换成了自己的远程库的URL。 +注意:请确保将上述“远程库的URL”替换成了你自己的远程库的URL。 -现在,要将我们的本地库提交至GitHub版本库中,我们需要运行一下命令并且输入所需的用户名和密码。 +现在,要将我们的本地库的改变推送至GitHub的版本库中,我们需要运行以下命令,并且输入所需的用户名和密码。 $ git push origin master @@ -87,9 +88,9 @@ 请把以上这条URL地址更改成你想要克隆的地址。 -### 更新改动 ### +### 推送改动 ### -如果我们对我们的代码做了更改并想把它们提交至我们的远程库中,我们应该在该目录下运行以下命令。 +如果我们对我们的代码做了更改并想把它们推送至我们的远程库中,我们应该在该目录下运行以下命令。 $ git add . $ git commit -m "Updating" @@ -97,7 +98,7 @@ ### 结论 ### -啊哈!我们已经成功地管理我们在Github库中的项目源代码了。快速灵活的Github基于web的托管服务,分布式修改控制系统使用起来方便容易。数百万个非常棒的开源项目驻扎在github上。所以,如果你有任何问题、建议或反馈,请在评论中告诉我们。谢谢大家!好好享受吧 :-) +啊哈!我们已经成功地将我们的项目源代码托管到Github的库中了。Github是快速灵活的基于web的托管服务,分布式版本控制系统使用起来方便容易。数百万个非常棒的开源项目驻扎在github上。所以,如果你有任何问题、建议或反馈,请在评论中告诉我们。谢谢大家!好好享受吧 :-) -------------------------------------------------------------------------------- @@ -105,7 +106,7 @@ via: http://linoxide.com/usr-mgmt/host-open-source-code-repository-github/ 作者:[Arun Pyasi][a] 译者:[ZTinoZ](https://github.com/ZTinoZ) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 From 3fef384edca0d37e9fbed51e5ae67ddf0937f4a1 Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 17 May 2015 21:52:45 +0800 Subject: [PATCH 051/965] PUB:20150506 Linux FAQs with Answers--How to install autossh on Linux @Vic020 --- ... with Answers--How to install autossh on Linux.md | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) rename {translated/tech => published}/20150506 Linux FAQs with Answers--How to install autossh on Linux.md (88%) diff --git a/translated/tech/20150506 Linux FAQs with Answers--How to install autossh on Linux.md b/published/20150506 Linux FAQs with Answers--How to install autossh on Linux.md similarity index 88% rename from translated/tech/20150506 Linux FAQs with Answers--How to install autossh on Linux.md rename to published/20150506 Linux FAQs with Answers--How to install autossh on Linux.md index e83c23e9f3..3fa2cf8a86 100644 --- a/translated/tech/20150506 Linux FAQs with Answers--How to install autossh on Linux.md +++ b/published/20150506 Linux FAQs with Answers--How to install autossh on Linux.md @@ -1,12 +1,11 @@ -Linux有问必答--如何安装autossh +Linux有问必答:如何安装autossh ================================================================================ > **提问**: 我打算在linux上安装autossh,我应该怎么做呢? -[autossh][1] 是一款开源工具,可以帮助管理SSH会话,自动重连和停止转发流量。autossh会假定目标主机已经设定[无密码SSH登陆][2],以便autossh可以重连断开的SSH会话而不用用户操作。 +[autossh][1] 是一款开源工具,可以帮助管理SSH会话、自动重连和停止转发流量。autossh会假定目标主机已经设定[无密码SSH登陆][2],以便autossh可以重连断开的SSH会话而不用用户操作。 只要你建立[反向SSH隧道][3]或者[挂载基于SSH的远程文件夹][4],autossh迟早会派上用场。基本上只要需要维持SSH会话,autossh肯定是有用的。 - ![](https://farm8.staticflickr.com/7786/17150854870_63966e78bc_c.jpg) 下面有许多linux发行版autossh的安装方法。 @@ -29,8 +28,7 @@ CentOS/RHEL 6 或早期版本, 需要开启第三库[Repoforge库][5], 然后才 $ sudo yum install autossh -CentOS/RHEL 7以后,autossh 已经不在Repoforge库中. 你需要从源码编译安装(例子在下面). - +CentOS/RHEL 7以后,autossh 已经不在Repoforge库中. 你需要从源码编译安装(例子在下面)。 ### Arch Linux 系统 ### @@ -66,13 +64,13 @@ via: http://ask.xmodulo.com/install-autossh-linux.html 作者:[Dan Nanni][a] 译者:[Vic020/VicYu](http://vicyu.net) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 [a]:http://ask.xmodulo.com/author/nanni [1]:http://www.harding.motd.ca/autossh/ -[2]:http://xmodulo.com/how-to-enable-ssh-login-without.html +[2]:https://linux.cn/article-5444-1.html [3]:http://xmodulo.com/access-linux-server-behind-nat-reverse-ssh-tunnel.html [4]:http://xmodulo.com/how-to-mount-remote-directory-over-ssh-on-linux.html [5]:http://xmodulo.com/how-to-set-up-rpmforge-repoforge-repository-on-centos.html From 86f6044cdc05e7ab46ae0f118ee06d664b35f92e Mon Sep 17 00:00:00 2001 From: Chang Liu Date: Sun, 17 May 2015 22:13:56 +0800 Subject: [PATCH 052/965] [Translated]20150507 Install uGet Download Manager 2.0 in Debian Ubuntu Linux Mint and Fedora.md --- ... in Debian Ubuntu Linux Mint and Fedora.md | 136 ------------------ ... in Debian Ubuntu Linux Mint and Fedora.md | 134 +++++++++++++++++ 2 files changed, 134 insertions(+), 136 deletions(-) delete mode 100644 sources/tech/20150507 Install uGet Download Manager 2.0 in Debian Ubuntu Linux Mint and Fedora.md create mode 100644 translated/tech/20150507 Install uGet Download Manager 2.0 in Debian Ubuntu Linux Mint and Fedora.md diff --git a/sources/tech/20150507 Install uGet Download Manager 2.0 in Debian Ubuntu Linux Mint and Fedora.md b/sources/tech/20150507 Install uGet Download Manager 2.0 in Debian Ubuntu Linux Mint and Fedora.md deleted file mode 100644 index c9f54a8185..0000000000 --- a/sources/tech/20150507 Install uGet Download Manager 2.0 in Debian Ubuntu Linux Mint and Fedora.md +++ /dev/null @@ -1,136 +0,0 @@ -FSSlc translating - -Install uGet Download Manager 2.0 in Debian, Ubuntu, Linux Mint and Fedora -================================================================================ -After a long development period, which includes more than 11 developement releases, finally uGet project team pleased to announce the immediate availability of the latest stable version of uGet 2.0. The latest version includes numerous attractive features, such as a new setting dialog, improved BitTorrent and Metalink support added in the aria2 plugin, as well as better support for uGet RSS messages in the banner, other features include: - -- A new “Check for Updates” button informs you about new released versions. -- Added new languages & updated existing languages. -- Added a new “Message Banner” that allows developers to easily provide uGet related information to all users. -- Enhanced the Help Menu by including links to the Documentation, to submit Feedback & Bug Reports and more. -- Integrated uGet download manager into the two major browsers on the Linux platform, Firefox and Google Chrome. -- Improved support for Firefox Addon ‘FlashGot’. - -### What is uGet ### - -uGet (formerly known ad UrlGfe) is an open source, free and very powerful multi-platform GTK based download manager application was written in C language, that released and licensed under GPL. It offers large collection of features such as resuming downloads, multiple download support, categories support with an independent configuration, clipboard monitoring, download scheduler, import URLs from HTML files, integrated Flashgot plugin with Firefox and download torrent and metalink files using aria2 (a command-line download manager) that integrated with uGet. - -I have listed down all the key features of uGet Download Manager in detailed explanation. - -#### Key Features of uGet Download Manager #### - -- Downloads Queue: Place all your downloads into a Queue. As downloads finishes, the remaining queue files will automatically start downloading. -- Resume Downloads: If in case, your network connection disconnected, don’t worry you can start or resume download where it was left. -- Download Categories: Support for unlimited categories to manage downloads. -- Clipboard Monitor: Add the types of files to clipboard that automatically prompt you to download copied files. -- Batch Downloads: Allows you to easily add unlimited number of files at once for downloading. -- Multi-Protocol: Allows you to easily download files through HTTP, HTTPS, FTP, BitTorrent and Metalink using arial2 command-line plugin. -- Multi-Connection: Support for up to 20 simultaneous connections per download using aria2 plugin. -- FTP Login & Anonymous FTP: Added support for FTP login using username and password, as well as anonymous FTP. -- Scheduler: Added support for scheduled downloads, now you can schedule all your downloads. -- FireFox Integration via FlashGot: Integrated FlashGot as an independent supported Firefox extension that handles single or massive selection of files for downloading. -- CLI / Terminal Support: Offers command line or terminal option to download files. -- Folder Auto-Creation: If you have provided the save path for the download, but the save path doesn’t exist, uget will automatically create them. -- Download History Management: Keeps a track of finished download and recycled entries, per list 9,999 files. Entries which are older than the custom limit will be deleted automatically. -- Multi-Language Support: By default uGet uses English, but it support more than 23 languages. -- Aria2 Plugin: uGet integrated with Aria2 plugin to give more user friendly GUI. - -If you want to know a complete list of available features, see the official uGet [features page][1]. - -### Install uGet in Debian, Ubuntu, Linux Mint and Fedora ### - -The uGet developers added latest version in various repos throughout the Linux platform, so you can able to install or upgrade uGet using supported repository under your Linux distribution. - -Currently, a few Linux distributions are not up-to-date, but you can get the status of your distribution by going to the [uGet Download page][2] and selecting your preferred distro from there for more details. - -#### On Debian #### - -In Debian Testing (Jessie) and Debian Unstable (Sid), you can easily install and update using the official repository on a fairly reliable basis. - - $ sudo apt-get update - $ sudo apt-get install uget - -#### On Ubuntu & Linux Mint #### - -In Ubuntu and Linux Mint, you can install and update uGet using official PPA repository ‘ppa:plushuang-tw/uget-stable‘. By using this PPA, you automatically be kept up-to-date with the latest versions. - - $ sudo add-apt-repository ppa:plushuang-tw/uget-stable - $ sudo apt-get update - $ sudo apt-get install uget - -#### On Fedora #### - -In Fedora 20 – 21, latest version of uGet (2.0) available from the official repositories, installing from these repo is fairly reliable. - - $ sudo yum install uget - -**Note**: On older versions of Debian, Ubuntu, Linux Mint and Fedora, users can also install uGet. but the available version is 1.10.4. If you are looking for updated version (i.e. 2.0) you need to upgrade your system and add uGet PPA to get latest stable version. - -### Installing aria2 plugin ### - -[aria2][3] is a excellent command-line download utility, that is used by uGet as a aria2 plugin to add even more great functionality such as downloading torrent files, metalinks, multi-protocol & multi-source download. - -By default uGet uses CURL as backend in most of the today’s Linux systems, but the aria2 Plugin replaces CURL with aria2 as the backend. - -aria2 is a separate package that needs to be installed separately. You can easily install latest version of aria2 using supported repository under your Linux distribution or you can also use [downloads-aria2][4] that explains how to install aria2 on each distro. - -#### On Debian, Ubuntu and Linux Mint #### - -Use the official aria2 PPA repository to install latest version of aria2 using the following commands. - - $ sudo add-apt-repository ppa:t-tujikawa/ppa - $ sudo apt-get update - $ sudo apt-get install aria2 - -#### On Fedora #### - -Fedora’s official repositories already added aria2 package, so you can easily install it using the following yum command. - - $ sudo yum install aria2 - -#### Starting uGet #### - -To start uGet application, from the desktop “Menu” on search bar type “uget“. Refer below screenshot. - -![Start uGet Download Manager](http://www.tecmint.com/wp-content/uploads/2014/03/Start-uGet.gif) -Start uGet Download Manager - -![uGet Version: 2.0](http://www.tecmint.com/wp-content/uploads/2014/03/uGet-Version.gif) -uGet Version: 2.0 - -#### Activate aria2 Plugin in uGet #### - -To active the aria2 plugin, from the uGet menu go to Edit –> Settings –> Plug-in tab, from the drop-down select “arial2“. - -![Enable Aria2 Plugin for uGet](http://www.tecmint.com/wp-content/uploads/2014/03/Enable-Aria2-Plugin.gif) -Enable Aria2 Plugin for uGet - -### uGet 2.0 Screenshot Tour ### - -![Download Files Using Aria2](http://www.tecmint.com/wp-content/uploads/2014/03/Download-Files-Using-Aria2.gif) -Download Files Using Aria2 - -![Download Torrent File Using uGet](http://www.tecmint.com/wp-content/uploads/2014/03/Download-Torrent-File.gif) -Download Torrent File Using uGet - -![Batch Downloads Using uGet](http://www.tecmint.com/wp-content/uploads/2014/03/Batch-Download-Files.gif) -Batch Downloads Using uGet - -uGet source files and RPM packages also available for other Linux distributions and Windows at [download page][5]. - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/install-uget-download-manager-in-linux/ - -作者:[Ravi Saive][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.tecmint.com/author/admin/ -[1]:http://uget.visuex.com/features -[2]:http://ugetdm.com/downloads -[3]:http://www.tecmint.com/install-aria2-a-multi-protocol-command-line-download-manager-in-rhel-centos-fedora/ -[4]:http://ugetdm.com/downloads-aria2 -[5]:http://ugetdm.com/downloads diff --git a/translated/tech/20150507 Install uGet Download Manager 2.0 in Debian Ubuntu Linux Mint and Fedora.md b/translated/tech/20150507 Install uGet Download Manager 2.0 in Debian Ubuntu Linux Mint and Fedora.md new file mode 100644 index 0000000000..d5c2fc98f5 --- /dev/null +++ b/translated/tech/20150507 Install uGet Download Manager 2.0 in Debian Ubuntu Linux Mint and Fedora.md @@ -0,0 +1,134 @@ +在 Debian, Ubuntu, Linux Mint 及 Fedora 中安装 uGet 下载管理器 2.0 +================================================================================ +在经历了一段漫长的开发期后,期间发布了超过 11 个开发版本,最终 uGet 项目小组高兴地宣布 uGet 的最新稳定版本 uGet 2.0 已经可以下载使用了。最新版本包含许多吸引人的特点,例如一个新的设定对话框,改进了 aria2 插件对 BitTorrent 和 Metalink 协议的支持,同时对位于横栏中的 uGet RSS 信息提供了更好的支持,其他特点包括: + +- 一个新的 “检查更新” 按钮,提醒您有关新的发行版本的信息; +- 增添新的语言支持并升级了现有的语言; +- 增加了一个新的 “信息横栏” ,允许开发者轻松地向所有的用户提供有关 uGet 的信息; +- 通过对文档、提交反馈和错误报告等内容的链接,增强了帮助菜单; +- 将 uGet 下载管理器集成到了 Linux 平台下的两个主要的浏览器 Firefox 和 Google Chrome 中; +- 改进了对 Firefox 插件 ‘FlashGot’ 的支持; + +### 何为 uGet ### + +uGet (先前名为 UrlGfe) 是一个开源,免费,且极其强大的基于 GTK 的多平台下载管理器应用程序,它用 C 语言写就,在 GPL 协议下发布。它提供了一大类的功能,如恢复先前的下载任务,支持多重下载,使用一个独立的配置来支持分类,剪贴板监视,下载队列,从 HTML 文件中导出 URL 地址,集成在 Firefox 中的 Flashgot 插件中,使用集成在 uGet 中的 aria2(一个命令行下载管理器) 来下载 torrent 和 metalink 文件。 + +我已经在下面罗列出了 uGet 下载管理器的所有关键特点,并附带了详细的解释。 + +#### uGet 下载管理器的关键特点 #### + +- 下载队列: 可以将你的下载任务放入一个队列中。当某些下载任务完成后,将会自动开始下载队列中余下的文件; +- 恢复下载: 假如在某些情况下,你的网络中断了,不要担心,你可以从先前停止的地方继续下载或重新开始; +- 下载分类: 支持多种分类来管理下载; +- 剪贴板监视: 将要下载的文件类型复制到剪贴板中,便会自动弹出下载提示框以下载刚才复制的文件; +- 批量下载: 允许你轻松地一次性下载多个文件; +- 支持多种协议: 允许你轻松地使用 aria2 命令行插件通过 HTTP, HTTPS, FTP, BitTorrent 及 Metalink 等协议下载文件; +- 多连接: 使用 aria2 插件,每个下载同时支持多达 20 个连接; +- 支持 FTP 登录或匿名 FTP 登录: 同时支持使用用户名和密码来登录 FTP 或匿名 FTP ; +- 队列下载: 新增队列下载,现在你可以对你的所有下载进行安排调度; +- 通过 FlashGot 与 FireFox 集成: 与作为一个独立支持的 Firefox 插件的 FlashGot 集成,从而可以处理单个或大量的下载任务; +- CLI 界面或虚拟终端支持: 提供命令行或虚拟终端选项来下载文件; +- 自动创建目录: 假如你提供了一个先前并不存在的保存路径,uGet 将会自动创建这个目录; +- 下载历史管理: 跟踪记录已下载和已删除的下载任务的条目,每个列表支持 9999 个条目,比当前默认支持条目数目更早的条目将会被自动删除; +- 多语言支持: uGet 默认使用英语,但它可支持多达 23 种语言; +- Aria2 插件: uGet 集成了 Aria2 插件,来为 aria2 提供更友好的 GUI 界面; + +如若你想了解更加完整的特点描述,请访问 uGet 官方的 [特点页面][1]. + +### 在 Debian, Ubuntu, Linux Mint 及 Fedora 中安装 uGet ### + +uGet 开发者在 Linux 平台下的各种软件仓库中添加了 uGet 的最新版本,所以你可以在你使用的 Linux 发行版本下使用受支持的软件仓库来安装或升级 uGet 。 + +当前,一些 Linux 发行版本下的 uGet 可能不是最新的,但你可以到 [uGet 下载页面][2] 去了解你所用发行版本的支持状态,在那里选择你喜爱的发行版本来了解更多的信息。 + +#### 在 Debian 下 #### + +在 Debian 的测试版本 (Jessie) 和不稳定版本 (Sid) 中,你可以在一个可信赖的基础上,使用官方的软件仓库轻易地安装和升级 uGet 。 + + $ sudo apt-get update + $ sudo apt-get install uget + +#### 在 Ubuntu 和 Linux Mint 下 #### + +在 Ubuntu 和 Linux Mint 下,你可以使用官方的 PPA `ppa:plushuang-tw/uget-stable` 安装和升级 uGet ,通过使用这个 PPA,你可以自动地与最新版本保持同步。 + + $ sudo add-apt-repository ppa:plushuang-tw/uget-stable + $ sudo apt-get update + $ sudo apt-get install uget + +#### 在 Fedora 下 #### + +在 Fedora 20 – 21 下,最新版本的 uGet(2.0) 可以从官方软件仓库中获得,从这些软件仓库中安装是非常值得信赖的。 + + $ sudo yum install uget + +**注**: 在旧版本的 Debian, Ubuntu, Linux Mint 和 Fedora 下,用户也可以安装 uGet , 但可获取的版本为 1.10.4 。假如你期待使用升级版本(例如 2.0 版本),你需要升级你的系统并添加 uGet 的 PPA 以此来获取最新的稳定版本。 + +### 安装 aria2 插件 ### + +[aria2][3] 是一个卓越的命令行下载管理应用,在 uGet 中它作为一个 aria2 插件,为 uGet 增添了更为强大的功能,如下载 toorent,metalinks 文件,支持多种协议和多来源下载等功能。 + +默认情况下,uGet 在当今大多数的 Linux 系统中使用 `curl` 来作为后端,但 aria2 插件将 curl 替换为 aria2 来作为 uGet 的后端。 + +aria2 是一个单独的软件包,需要独立安装。你可以在你的 Linux 发行版本下,使用受支持的软件仓库来轻易地安装 aria2 的最新版本,或根据 [下载 aria2 页面][4] 来安装它,该页面详细解释了在各个发行版本中如何安装 aria2 。 + +#### 在 Debian, Ubuntu 和 Linux Mint 下 #### + +利用下面的命令,使用 aria2 的个人软件仓库来安装最新版本的 aria2 : + + $ sudo add-apt-repository ppa:t-tujikawa/ppa + $ sudo apt-get update + $ sudo apt-get install aria2 + +#### 在 Fedora 下 #### + +Fedora 的官方软件仓库中已经添加了 aria2 软件包,所以你可以轻易地使用下面的 yum 命令来安装它: + + $ sudo yum install aria2 + +#### 开启 uGet #### + +为了启动 uGet,从桌面菜单的搜索栏中键入 "uGet"。可参考如下的截图: + +![开启 uGet 下载管理器](http://www.tecmint.com/wp-content/uploads/2014/03/Start-uGet.gif) +开启 uGet 下载管理器 + +![uGet 版本: 2.0](http://www.tecmint.com/wp-content/uploads/2014/03/uGet-Version.gif) +uGet 版本: 2.0 + +#### 在 uGet 中激活 aria2 插件 #### + +为了激活 aria2 插件, 从 uGet 菜单接着到 `编辑 –> 设置 –> 插件` , 从下拉菜单中选择 "aria2"。 + +![为 uGet 启用 Aria2 插件](http://www.tecmint.com/wp-content/uploads/2014/03/Enable-Aria2-Plugin.gif) +为 uGet 启用 Aria2 插件 + +### uGet 2.0 截图赏析 ### + +![使用 Aria2 下载文件](http://www.tecmint.com/wp-content/uploads/2014/03/Download-Files-Using-Aria2.gif) +使用 Aria2 下载文件 + +![使用 uGet 下载 Torrent 文件](http://www.tecmint.com/wp-content/uploads/2014/03/Download-Torrent-File.gif) +使用 uGet 下载 Torrent 文件 + +![使用 uGet 进行批量下载](http://www.tecmint.com/wp-content/uploads/2014/03/Batch-Download-Files.gif) +使用 uGet 进行批量下载 + +针对其他 Linux 发行版本和 Windows 平台的 RPM 包和 uGet 的源文件都可以在 uGet 的[下载页面][5] 下找到。 + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/install-uget-download-manager-in-linux/ + +作者:[Ravi Saive][a] +译者:[FSSlc](https://github.com/FSSlc) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/admin/ +[1]:http://uget.visuex.com/features +[2]:http://ugetdm.com/downloads +[3]:http://www.tecmint.com/install-aria2-a-multi-protocol-command-line-download-manager-in-rhel-centos-fedora/ +[4]:http://ugetdm.com/downloads-aria2 +[5]:http://ugetdm.com/downloads \ No newline at end of file From 9e738faeafe3f197082b16c95bac8b66cba8bb7f Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 17 May 2015 22:18:25 +0800 Subject: [PATCH 053/965] PUB:20150306 How to Setup lftp--A Simple Command line FTP Program @zpl1025 --- ...up lftp--A Simple Command line FTP Program.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) rename {translated/tech => published}/20150306 How to Setup lftp--A Simple Command line FTP Program.md (85%) diff --git a/translated/tech/20150306 How to Setup lftp--A Simple Command line FTP Program.md b/published/20150306 How to Setup lftp--A Simple Command line FTP Program.md similarity index 85% rename from translated/tech/20150306 How to Setup lftp--A Simple Command line FTP Program.md rename to published/20150306 How to Setup lftp--A Simple Command line FTP Program.md index df90008704..6f7d3b047f 100644 --- a/translated/tech/20150306 How to Setup lftp--A Simple Command line FTP Program.md +++ b/published/20150306 How to Setup lftp--A Simple Command line FTP Program.md @@ -1,8 +1,8 @@ -如何设置lftp - 一个简易的命令行FTP程序 +LFTP : 一个功能强大的命令行FTP程序 ================================================================================ -大家好,这篇文章是介绍Lftp以及如何在Linux操作系统下安装的。[Lftp][1]是一个基于命令行的文件传输软件也被称为FTP客户端,由Alexander Lukyanov开发并以GNU GPL协议许可发行。除了FTP,它还支持FTPS,HTTP,HTTPS,HFTP,FISH,以及SFTP。这个程序还支持FXP,允许数据绕过客户端直接在两个FTP服务器之间传输。 +大家好,这篇文章是介绍Lftp以及如何在Linux操作系统下安装的。[Lftp][1]是一个基于命令行的文件传输软件(也被称为FTP客户端),由Alexander Lukyanov开发并以GNU GPL协议许可发行。除了FTP协议外,它还支持FTPS,HTTP,HTTPS,HFTP,FISH,以及SFTP等协议。这个程序还支持FXP,允许数据绕过客户端直接在两个FTP服务器之间传输。 -他有很多很棒的高级功能,比如完整目录树递归镜像以及断点续传下载。传输任务可以安排在稍后的时间段执行,可以限制带宽,可以创建传输列表,还支持类似Unix shell的任务控制。客户端还可以在交互式或自动脚本里使用。 +它有很多很棒的高级功能,比如递归镜像整个目录树以及断点续传下载。传输任务可以安排在稍后的时间段计划执行,可以限制带宽,可以创建传输列表,还支持类似Unix shell的任务控制。客户端还可以在交互式或自动脚本里使用。 ### 安装Lftp ### @@ -44,7 +44,7 @@ OpenSuse系统里的包管理软件Zypper可以用来安装lftp。下面是在Op 要登录到ftp服务器或sftp服务器,我们首先需要知道所要求的认证信息,比如用户名,密码,端口。 -之后,我们想通过lftp来登录。 +之后,我们可以通过lftp来登录。 $ lftp ftp://linoxide@localhost @@ -56,9 +56,9 @@ OpenSuse系统里的包管理软件Zypper可以用来安装lftp。下面是在Op ![ftp login with ports](http://blog.linoxide.com/wp-content/uploads/2015/03/lftp-login-port.png) -### 浏览 ### +### 导航 ### -我们可以用**ls**命令来列出文件和目录,用**cd**命令打开目录。 +我们可以用**ls**命令来列出文件和目录,用**cd**命令进入到目录。 ![ls and cd](http://blog.linoxide.com/wp-content/uploads/2015/03/ls-cd-lftp.png) @@ -158,7 +158,7 @@ OpenSuse系统里的包管理软件Zypper可以用来安装lftp。下面是在Op ### 总结 ### -哇!我们已经成功地安装了lftp并学会了使用它的一些基础的主要方式。lftp是一个非常棒的命令行ftp客户端,它支持许多额外的功能以及很酷的特性。它比其他普通ftp客户端多了很多东西。好吧,你要是有任何问题,建议,反馈,请在下面的评论区里留言。谢谢!享用lftp吧 :-) +哇!我们已经成功地安装了lftp并学会了它的一些基础的主要使用方式。lftp是一个非常棒的命令行ftp客户端,它支持许多额外的功能以及很酷的特性。它比其他普通ftp客户端多了很多东西。好吧,你要是有任何问题,建议,反馈,请在下面的评论区里留言。谢谢!享用lftp吧 :-) -------------------------------------------------------------------------------- @@ -166,7 +166,7 @@ via: http://linoxide.com/linux-how-to/setup-lftp-command-line-ftp/ 作者:[Arun Pyasi][a] 译者:[zpl1025](https://github.com/zpl1025) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 From f1bbec053fbec2519c29f7dfc90b5d058a2dcc20 Mon Sep 17 00:00:00 2001 From: joeren Date: Mon, 18 May 2015 08:26:02 +0800 Subject: [PATCH 054/965] Update 20150429 KDE Plasma 5.3 Released, Here' s How To Upgrade in Kubuntu 15.04.md --- ...ma 5.3 Released, Here' s How To Upgrade in Kubuntu 15.04.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150429 KDE Plasma 5.3 Released, Here' s How To Upgrade in Kubuntu 15.04.md b/sources/tech/20150429 KDE Plasma 5.3 Released, Here' s How To Upgrade in Kubuntu 15.04.md index 43b2adc3dd..acff452248 100644 --- a/sources/tech/20150429 KDE Plasma 5.3 Released, Here' s How To Upgrade in Kubuntu 15.04.md +++ b/sources/tech/20150429 KDE Plasma 5.3 Released, Here' s How To Upgrade in Kubuntu 15.04.md @@ -1,3 +1,4 @@ +Translating by GOLinux! KDE Plasma 5.3 Released, Here’s How To Upgrade in Kubuntu 15.04 ================================================================================ **KDE [has announced][1] the stable release of Plasma 5.3, which comes charged with a slate of new power management features. ** @@ -83,4 +84,4 @@ via: http://www.omgubuntu.co.uk/2015/04/kde-plasma-5-3-released-heres-how-to-upg [2]:http://www.omgubuntu.co.uk/2015/04/beta-plasma-5-3-features [3]:http://www.omgubuntu.co.uk/2015/04/beta-plasma-5-3-features [4]:https://www.kde.org/announcements/plasma-5.2.2-5.3.0-changelog.php -[5]:https://community.kde.org/Plasma/Live_Images \ No newline at end of file +[5]:https://community.kde.org/Plasma/Live_Images From 9d8d4ca45f8ade211e839efbfea58e26f570514f Mon Sep 17 00:00:00 2001 From: Gore Liu Date: Mon, 18 May 2015 09:21:55 +0800 Subject: [PATCH 055/965] [Translating] 20150123 How to make a file immutable on Linux.md --- sources/tech/20150123 How to make a file immutable on Linux.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20150123 How to make a file immutable on Linux.md b/sources/tech/20150123 How to make a file immutable on Linux.md index 622cc4e5b3..d6261cb3c1 100644 --- a/sources/tech/20150123 How to make a file immutable on Linux.md +++ b/sources/tech/20150123 How to make a file immutable on Linux.md @@ -1,3 +1,5 @@ +Translating by goreliu ... + How to make a file immutable on Linux ================================================================================ Suppose you want to write-protect some important files on Linux, so that they cannot be deleted or tampered with by accident or otherwise. In other cases, you may want to prevent certain configuration files from being overwritten automatically by software. While changing their ownership or permission bits on the files by using chown or chmod is one way to deal with this situation, this is not a perfect solution as it cannot prevent any action done with root privilege. That is when chattr comes in handy. From 1e97e32507ee621c0f21e11906a92190d95ced77 Mon Sep 17 00:00:00 2001 From: wxy Date: Mon, 18 May 2015 10:19:22 +0800 Subject: [PATCH 056/965] PUB:20150112 What are useful command-line network monitors on Linux MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @wwy-hust 翻译的不错! --- ... command-line network monitors on Linux.md | 136 ++++++++++++++++++ ... command-line network monitors on Linux.md | 135 ----------------- 2 files changed, 136 insertions(+), 135 deletions(-) create mode 100644 published/20150112 What are useful command-line network monitors on Linux.md delete mode 100644 translated/tech/20150112 What are useful command-line network monitors on Linux.md diff --git a/published/20150112 What are useful command-line network monitors on Linux.md b/published/20150112 What are useful command-line network monitors on Linux.md new file mode 100644 index 0000000000..25d7910ec7 --- /dev/null +++ b/published/20150112 What are useful command-line network monitors on Linux.md @@ -0,0 +1,136 @@ +又一波你可能不知道的 Linux 命令行网络监控工具 +=============================================================================== + +对任何规模的业务来说,网络监控工具都是一个重要的功能。网络监控的目标可能千差万别。比如,监控活动的目标可以是保证长期的网络服务、安全保护、对性能进行排查、网络使用统计等。由于它的目标不同,网络监控器使用很多不同的方式来完成任务。比如对包层面的嗅探,对数据流层面的统计数据,向网络中注入探测的流量,分析服务器日志等。 + +尽管有许多专用的网络监控系统可以365天24小时监控,但您依旧可以在特定的情况下使用命令行式的网络监控器,某些命令行式的网络监控器在某方面很有用。如果您是系统管理员,那您就应该有亲身使用一些知名的命令行式网络监控器的经历。这里有一份**Linux上流行且实用的网络监控器**列表。 + +### 包层面的嗅探器 ### + +在这个类别下,监控工具在链路上捕捉独立的包,分析它们的内容,展示解码后的内容或者包层面的统计数据。这些工具在最底层对网络进行监控、管理,同样的也能进行最细粒度的监控,其代价是影响网络I/O和分析的过程。 + +1. **dhcpdump**:一个命令行式的DHCP流量嗅探工具,捕捉DHCP的请求/回复流量,并以用户友好的方式显示解码的DHCP协议消息。这是一款排查DHCP相关故障的实用工具。 + +2. **[dsniff][1]**:一个基于命令行的嗅探、伪造和劫持的工具合集,被设计用于网络审查和渗透测试。它可以嗅探多种信息,比如密码、NSF流量(LCTT 译注:此处疑为 NFS 流量)、email消息、网络地址等。 + +3. **[httpry][2]**:一个HTTP报文嗅探器,用于捕获、解码HTTP请求和回复报文,并以用户友好的方式显示这些信息。(LCTT 译注:[延伸阅读](https://linux.cn/article-4148-1.html)。 ) + +4. **IPTraf**:基于命令行的网络统计数据查看器。它实时显示包层面、连接层面、接口层面、协议层面的报文/字节数。抓包过程由协议过滤器控制,且操作过程全部是菜单驱动的。(LCTT 译注:[延伸阅读](https://linux.cn/article-5430-1.html)。) + + ![](https://farm8.staticflickr.com/7519/16055246118_8ea182b413_c.jpg) + +5. **[mysql-sniffer][3]**:一个用于抓取、解码MySQL请求相关的数据包的工具。它以可读的方式显示最频繁或全部的请求。 + +6. **[ngrep][4]**:在网络报文中执行grep。它能实时抓取报文,并用正则表达式或十六进制表达式的方式匹配(过滤)报文。它是一个可以对异常流量进行检测、存储或者对实时流中特定模式报文进行抓取的实用工具。 + +7. **[p0f][5]**:一个被动的基于包嗅探的指纹采集工具,可以可靠地识别操作系统、NAT或者代理设置、网络链路类型以及许多其它与活动的TCP连接相关的属性。 + +8. **pktstat**:一个命令行式的工具,通过实时分析报文,显示连接带宽使用情况以及相关的协议(例如,HTTP GET/POST、FTP、X11)等描述信息。 + + ![](https://farm8.staticflickr.com/7477/16048970999_be60f74952_b.jpg) + +9. **Snort**:一个入侵检测和预防工具,通过规则驱动的协议分析和内容匹配,来检测/预防活跃流量中各种各样的后门、僵尸网络、网络钓鱼、间谍软件攻击。 + +10. **tcpdump**:一个命令行的嗅探工具,可以基于过滤表达式抓取网络中的报文,分析报文,并且在包层面输出报文内容以便于包层面的分析。他在许多网络相关的错误排查、网络程序debug、或[安全][6]监测方面应用广泛。 + +11. **tshark**:一个与Wireshark窗口程序一起使用的命令行式的嗅探工具。它能捕捉、解码网络上的实时报文,并能以用户友好的方式显示其内容。 + +### 流/进程/接口层面的监控 ### + +在这个分类中,网络监控器通过把流量按照流、相关进程或接口分类,收集每个流、每个进程、每个接口的统计数据。其信息的来源可以是libpcap抓包库或者sysfs内核虚拟文件系统。这些工具的监控成本很低,但是缺乏包层面的检视能力。 + +12. **bmon**:一个基于命令行的带宽监测工具,可以显示各种接口相关的信息,不但包括接收/发送的总量/平均值统计数据,而且拥有历史带宽使用视图。 + + ![](https://farm9.staticflickr.com/8580/16234265932_87f20c5d17_b.jpg) + +13. **[iftop][7]**:一个带宽使用监测工具,可以实时显示某个网络连接的带宽使用情况。它对所有带宽使用情况排序并通过ncurses的接口来进行可视化。他可以方便的监控哪个连接消耗了最多的带宽。(LCTT 译注:[延伸阅读](https://linux.cn/article-1843-1.html)。) + +14. **nethogs**:一个基于ncurses显示的进程监控工具,提供进程相关的实时的上行/下行带宽使用信息。它对检测占用大量带宽的进程很有用。(LCTT 译注:[延伸阅读](https://linux.cn/article-2808-1.html)。) + +15. **netstat**:一个显示许多TCP/UDP的网络堆栈的统计信息的工具。诸如打开的TCP/UDP连接书、网络接口发送/接收、路由表、协议/套接字的统计信息和属性。当您诊断与网络堆栈相关的性能、资源使用时它很有用。 + +16. **[speedometer][8]**:一个可视化某个接口发送/接收的带宽使用的历史趋势,并且基于ncurses的条状图进行显示的终端工具。 + + ![](https://farm8.staticflickr.com/7485/16048971069_31dd573a4f_c.jpg) + +17. **[sysdig][9]**:一个可以通过统一的界面对各个Linux子系统进行系统级综合性调试的工具。它的网络监控模块可以监控在线或离线、许多进程/主机相关的网络统计数据,例如带宽、连接/请求数等。(LCTT 译注:[延伸阅读](https://linux.cn/article-4341-1.html)。) + +18. **tcptrack**:一个TCP连接监控工具,可以显示活动的TCP连接,包括源/目的IP地址/端口、TCP状态、带宽使用等。 + + ![](https://farm8.staticflickr.com/7507/16047703080_5fdda2e811_b.jpg) + +19. **vnStat**:一个存储并显示每个接口的历史接收/发送带宽视图(例如,当前、每日、每月)的流量监控器。作为一个后台守护进程,它收集并存储统计数据,包括接口带宽使用率和传输字节总数。(LCTT 译注:[延伸阅读](https://linux.cn/article-5256-1.html)。) + +### 主动网络监控器 ### + +不同于前面提到的被动的监听工具,这个类别的工具们在监听时会主动的“注入”探测内容到网络中,并且会收集相应的反应。监听目标包括路由路径、可供使用的带宽、丢包率、延时、抖动(jitter)、系统设置或者缺陷等。 + +20. **[dnsyo][10]**:一个DNS检测工具,能够管理跨越多达1500个不同网络的开放解析器的DNS查询。它在您检查DNS传播或排查DNS设置的时候很有用。 + +21. **[iperf][11]**:一个TCP/UDP带宽测量工具,能够测量两个端点间最大可用带宽。它通过在两个主机间单向或双向的输出TCP/UDP探测流量来测量可用的带宽。它在监测网络容量、调谐网络协议栈参数时很有用。一个叫做[netperf][12]的变种拥有更多的功能及更好的统计数据。 + +22. **[netcat][13]/socat**:通用的网络调试工具,可以对TCP/UDP套接字进行读、写或监听。它通常和其他的程序或脚本结合起来在后端对网络传输或端口进行监听。(LCTT 译注:[延伸阅读](https://linux.cn/article-1171-1.html)。) + +23. **nmap**:一个命令行的端口扫描和网络发现工具。它依赖于若干基于TCP/UDP的扫描技术来查找开放的端口、活动的主机或者在本地网络存在的操作系统。它在你审查本地主机漏洞或者建立维护所用的主机映射时很有用。[zmap][14]是一个类似的替代品,是一个用于互联网范围的扫描工具。(LCTT 译注:[延伸阅读](https://linux.cn/article-2561-1.html)。) + +24. ping:一个常用的网络测试工具。通过交换ICMP的echo和reply报文来实现其功能。它在测量路由的RTT、丢包率以及检测远端系统防火墙规则时很有用。ping的变种有更漂亮的界面(例如,[noping][15])、多协议支持(例如,[hping][16])或者并行探测能力(例如,[fping][17])。(LCTT 译注:[延伸阅读](https://linux.cn/article-2303-1.html)。) + + ![](https://farm8.staticflickr.com/7466/15612665344_a4bb665a5b_c.jpg) + +25. **[sprobe][18]**:一个启发式推断本地主机和任意远端IP地址之间的网络带宽瓶颈的命令行工具。它使用TCP三次握手机制来评估带宽的瓶颈。它在检测大范围网络性能和路由相关的问题时很有用。 + +26. **traceroute**:一个能发现从本地到远端主机的第三层路由/转发路径的网络发现工具。它发送限制了TTL的探测报文,收集中间路由的ICMP反馈信息。它在排查低速网络连接或者路由相关的问题时很有用。traceroute的变种有更好的RTT统计功能(例如,[mtr][19])。 + +### 应用日志解析器 ### + +在这个类别下的网络监测器把特定的服务器应用程序作为目标(例如,web服务器或者数据库服务器)。由服务器程序产生或消耗的网络流量通过它的日志被分析和监测。不像前面提到的网络层的监控器,这个类别的工具能够在应用层面分析和监控网络流量。 + +27. **[GoAccess][20]**:一个针对Apache和Nginx服务器流量的交互式查看器。基于对获取到的日志的分析,它能展示包括日访问量、最多请求、客户端操作系统、客户端位置、客户端浏览器等在内的多个实时的统计信息,并以滚动方式显示。 + + ![](https://farm8.staticflickr.com/7518/16209185266_da6c5c56eb_c.jpg) + +28. **[mtop][21]**:一个面向MySQL/MariaDB服务器的命令行监控器,它可以将成本最大的查询和当前数据库服务器负载以可视化的方式显示出来。它在您优化MySQL服务器性能、调谐服务器参数时很有用。 + + ![](https://farm8.staticflickr.com/7472/16047570248_bc996795f2_c.jpg) + +29. **[ngxtop][22]**:一个面向Nginx和Apache服务器的流量监测工具,能够以类似top指令的方式可视化的显示Web服务器的流量。它解析web服务器的查询日志文件并收集某个目的地或请求的流量统计信息。 + +### 总结 ### + +在这篇文章中,我展示了许多命令行式监测工具,从最底层的包层面的监控器到最高层应用程序层面的网络监控器。了解那个工具的作用是一回事,选择哪个工具使用又是另外一回事。单一的一个工具不能作为您每天使用的通用的解决方案。一个好的系统管理员应该能决定哪个工具更适合当前的环境。希望这个列表对此有所帮助。 + +欢迎您通过回复来改进这个列表的内容! + +-------------------------------------------------------------------------------- + +via: http://xmodulo.com/useful-command-line-network-monitors-linux.html + +作者:[Dan Nanni][a] +译者:[wwy-hust](https://github.com/wwy-hust) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://xmodulo.com/author/nanni +[1]:http://www.monkey.org/~dugsong/dsniff/ +[2]:http://xmodulo.com/monitor-http-traffic-command-line-linux.html +[3]:https://github.com/zorkian/mysql-sniffer +[4]:http://ngrep.sourceforge.net/ +[5]:http://lcamtuf.coredump.cx/p0f3/ +[6]:http://xmodulo.com/recommend/firewallbook +[7]:http://xmodulo.com/how-to-install-iftop-on-linux.html +[8]:https://excess.org/speedometer/ +[9]:http://xmodulo.com/monitor-troubleshoot-linux-server-sysdig.html +[10]:http://xmodulo.com/check-dns-propagation-linux.html +[11]:https://iperf.fr/ +[12]:http://www.netperf.org/netperf/ +[13]:http://xmodulo.com/useful-netcat-examples-linux.html +[14]:https://zmap.io/ +[15]:http://noping.cc/ +[16]:http://www.hping.org/ +[17]:http://fping.org/ +[18]:http://sprobe.cs.washington.edu/ +[19]:http://xmodulo.com/better-alternatives-basic-command-line-utilities.html#mtr_link +[20]:http://goaccess.io/ +[21]:http://mtop.sourceforge.net/ +[22]:http://xmodulo.com/monitor-nginx-web-server-command-line-real-time.html diff --git a/translated/tech/20150112 What are useful command-line network monitors on Linux.md b/translated/tech/20150112 What are useful command-line network monitors on Linux.md deleted file mode 100644 index 37eea5a91b..0000000000 --- a/translated/tech/20150112 What are useful command-line network monitors on Linux.md +++ /dev/null @@ -1,135 +0,0 @@ -ʲôLinuxʵõʽӹ -=============================================================================== -κιģҵ˵һҪĹܡӵĿǧ𡣱磬ӻĿDZ֤ڵ繩ӦȫܽŲ顢ʹͳƵȡĿ겻ͬʹúܶ಻ͬķʽ񡣱ʹð̽ʹͳݣע̽־ȡ - -רõϵͳ36524СʱӣɿضʹʽijЩʽijáϵͳԱӦʹһЩ֪ʽľһ**Linuxʵõ**б - -### ̽ ### - -£ӹ·ϲ׽İǵݣչʾݻ߰ͳݡЩײмӡͬҲܽϸȵļӣDzI/OͷĹ̡ - -1. **dhcpdump**һʽDHCP̽ߣ׽DHCP/ظûѺõķʽʾDHCPЭϢһŲDHCPعϵʵùߡ - -2. **[dsniff][1]**һе̽߼ϣӵƭͽٳֹܣ͸ԡ̽Ϣ롢NSFemailϢַȡ - -3. **[httpry][2]**һHTTP̽ڲ񡢽HTTPͻظģûѺõķʽʾЩϢ - -4. **IPTraf**еͳݲ鿴ʵʱʾ桢Ӳ桢ӿڲ桢Эı/ֽץЭƣҲȫDz˵ġ - -![](https://farm8.staticflickr.com/7519/16055246118_8ea182b413_c.jpg) - -5. **[mysql-sniffer][3]**һץȡMySQLصݰĹߡԿɶķʽʾƵȫ - -6. **[ngrep][4]**籨ִgrepʵʱץȡģʽʮƱʽķʽƥ䱨ġһԶ쳣м⡢洢߶ʵʱضģʽĽץȡʵùߡ - -7. **[p0f][5]**һĻڰָ̽ƲɼߣԿɿʶϵͳNATߴá·ԼTCPصԡ - -8. **pktstat**һʽĹߣͨʵʱģʾӴʹԼصЭ飨磬HTTP GET/POSTFTPX11Ϣ - -![](https://farm8.staticflickr.com/7477/16048970999_be60f74952_b.jpg - -9. **Snort**һּԤߣͨЭƥ䣬/ԤԾиָĺšʬ硢㡢 - -10. **tcpdump**һе̽ߣԻڹ˱ʽץȡеıģģڰԱڰķصĴŲ顢debug[ȫ][6]ⷽӦù㷺 - -11. **tshark**һWiresharkڳһʹõʽ̽ߡܲ׽ϵʵʱģûѺõķʽʾݡ - -### //ӿڲļ ### - -УͨΪ̻ӿռÿÿ̡ÿӿڵͳݡϢԴlibpcapץsysfsںļϵͳЩߵļӳɱܵͣȱļ - -12. **bmon**һеĴ⹤ߣʾֽӿصϢ/͵ֵ/ƽֵͳݣӵʷʹͼ - -![](https://farm9.staticflickr.com/8580/16234265932_87f20c5d17_b.jpg) - -13. **[iftop][7]**һʹü⹤ߣʵʱʾijӵĴʹдʹͨncursesĽӿпӻԷļĸĴ - -14. **nethogs**һ̼ӹߣṩصʵʱ/дʹϢncursesʾԼռôĽ̺á - -15. **netstat**һʾTCP/UDPջͳϢĹߡӿڷ/ա·ɱЭ/׽ֵͳϢԡջصܡԴʹʱá - -16. **[speedometer][8]**һӻijӿڷ/յĴʹõʷƣһncurses״ͼʾĹߡ - -![](https://farm8.staticflickr.com/7485/16048971069_31dd573a4f_c.jpg) - -17. **[sysdig][9]**һLinuxϵͳӵͳһԽӿڵϵͳۺdebugߡģԼ߻ߡ/صͳݣ/ȡ - -18. **tcptrack**һTCPӼӹߣʾTCPӣԴ/ĿIPַ/˿ڡTCP״̬ʹõȡ - -![](https://farm8.staticflickr.com/7507/16047703080_5fdda2e811_b.jpg) - -19. **vnStat**һά˻ڽӿڵʷ/ʹͼ磬ǰÿաÿ£Ϊһ̨ػ̣ռ洢ͳݣӿڴʹʺʹֽ - -### ### - -ͬǰᵽıļߣĹڼʱġע롱̽ݵУһռӦķӦĿ··ɹʹõĴʡʱϵͳûȱݵȡ - -20. **[dnsyo][10]**һDNS⹤ߣܹ1500ͬĿŽȺDNSѯDNSŲDNSõʱá - -21. **[iperf][11]**һTCP/UDPߣܹôͨ䵥˫TCP/UDP̽õĴڼгЭջʱáһ[netperf][12]ıӵиĹܼõͳݡ - -22. **[netcat][13]/socat**ͨõdebugߣԶTCP/UDP׽ֽждͨijűں˶紫˿ڽм - -23. **nmap**һж˿ɨ緢ֹߡɻTCP/UDPɨ輼ҿŵĶ˿ڡڱڵIJϵͳ鱾©߽ӳʱá[zmap][14]һƵƷһڻΧɨ蹤ߡ - -24. pingһõԹߡͨICMPechoreplyĽǿʵ书ܡڲ·ɵRTTԼԶϵͳǽʱápingıиƯĽ棨磬[noping][15]Э֧֣磬[hping][16]߲̽磬[fping][17] - -![](https://farm8.staticflickr.com/7466/15612665344_a4bb665a5b_c.jpg) - -25. **[sprobe][18]**һʽƶϱԶIPַƿйߡʹTCPֻƿڼΧܺ·صʱá - -26. **traceroute**һִܷӱصԶĵ·/ת·緢ֹߡTTL̽ⱨģռм·ɵICMPϢŲӻ·صʱátracerouteıиõRTTͳƹܣ磬[mtr][19] - -### Ӧ־ ### - -£ضķӦóΪĿ꣨磬webݿɷĵͨ־ͼ⡣ǰᵽļĹܹӦòͼ - -27. **[GoAccess][20]**һApacheNginxĽʽ鿴ڶԻȡ־ķչʾշ󡢿ͻ˲ϵͳͻλáͻڵĶʵʱͳϢԹʽʾ - -![](https://farm8.staticflickr.com/7518/16209185266_da6c5c56eb_c.jpg) - -28. **[mtop][21]**һMySQL/MariaDBмԽǰݿдIJѯԿӻķʽʾŻMySQLܡгʱá - -![](https://farm8.staticflickr.com/7472/16047570248_bc996795f2_c.jpg) - -29. **[ngxtop][22]**һNginxApache⹤ߣܹtopָķʽӻʾWebwebIJѯ־ļռijĿĵػͳϢ - -### Conclusion ### - -ƪУչʾʽ⹤ߣײİļ߲Ӧó֪Ǹߵһ£ѡĸʹһ¡һһ߲ΪÿʹõͨõĽһõϵͳԱӦܾĸ߸ʺϵǰĻϣбԴ - -ӭͨظĽбݣ - --------------------------------------------------------------------------------- - -via: http://xmodulo.com/useful-command-line-network-monitors-linux.html - -ߣ[Dan Nanni][a] -ߣ[wwy-hust](https://github.com/wwy-hust) -Уԣ[УID](https://github.com/УID) - - [LCTT](https://github.com/LCTT/TranslateProject) ԭ룬[Linuxй](http://linux.cn/) Ƴ - -[a]:http://xmodulo.com/author/nanni -[1]:http://www.monkey.org/~dugsong/dsniff/ -[2]:http://xmodulo.com/monitor-http-traffic-command-line-linux.html -[3]:https://github.com/zorkian/mysql-sniffer -[4]:http://ngrep.sourceforge.net/ -[5]:http://lcamtuf.coredump.cx/p0f3/ -[6]:http://xmodulo.com/recommend/firewallbook -[7]:http://xmodulo.com/how-to-install-iftop-on-linux.html -[8]:https://excess.org/speedometer/ -[9]:http://xmodulo.com/monitor-troubleshoot-linux-server-sysdig.html -[10]:http://xmodulo.com/check-dns-propagation-linux.html -[11]:https://iperf.fr/ -[12]:http://www.netperf.org/netperf/ -[13]:http://xmodulo.com/useful-netcat-examples-linux.html -[14]:https://zmap.io/ -[15]:http://noping.cc/ -[16]:http://www.hping.org/ -[17]:http://fping.org/ -[18]:http://sprobe.cs.washington.edu/ -[19]:http://xmodulo.com/better-alternatives-basic-command-line-utilities.html#mtr_link -[20]:http://goaccess.io/ -[21]:http://mtop.sourceforge.net/ -[22]:http://xmodulo.com/monitor-nginx-web-server-command-line-real-time.html From 1e079b2f8fa886447ee6ed619c7643490f292deb Mon Sep 17 00:00:00 2001 From: GOLinux Date: Mon, 18 May 2015 10:25:41 +0800 Subject: [PATCH 057/965] [Translated]20150429 KDE Plasma 5.3 Released, Here's How To Upgrade in Kubuntu 15.04.md --- ...Here' s How To Upgrade in Kubuntu 15.04.md | 87 ------------------- ...Here' s How To Upgrade in Kubuntu 15.04.md | 85 ++++++++++++++++++ 2 files changed, 85 insertions(+), 87 deletions(-) delete mode 100644 sources/tech/20150429 KDE Plasma 5.3 Released, Here' s How To Upgrade in Kubuntu 15.04.md create mode 100644 translated/tech/20150429 KDE Plasma 5.3 Released, Here' s How To Upgrade in Kubuntu 15.04.md diff --git a/sources/tech/20150429 KDE Plasma 5.3 Released, Here' s How To Upgrade in Kubuntu 15.04.md b/sources/tech/20150429 KDE Plasma 5.3 Released, Here' s How To Upgrade in Kubuntu 15.04.md deleted file mode 100644 index acff452248..0000000000 --- a/sources/tech/20150429 KDE Plasma 5.3 Released, Here' s How To Upgrade in Kubuntu 15.04.md +++ /dev/null @@ -1,87 +0,0 @@ -Translating by GOLinux! -KDE Plasma 5.3 Released, Here’s How To Upgrade in Kubuntu 15.04 -================================================================================ -**KDE [has announced][1] the stable release of Plasma 5.3, which comes charged with a slate of new power management features. ** - -Having impressed and excited [with an earlier beta release in April][2], the latest update to the new stable update to the Plasma 5 desktop environments is now considered stable and ready for download. - -Plasma 5.3 continues to refine and finesse the new-look KDE desktop. It sees plenty of feature additions for desktop users to enjoy and **almost 400 bug fixes** packed in it should also improvements the performance and overall stability, too. - -### What’s New in Plasma 5.3 ### - -![Better Bluetooth Management in Plasma 5.3](http://www.omgubuntu.co.uk/wp-content/uploads/2015/04/bluetooth-applet-in-kde.jpg) -Better Bluetooth Management in Plasma 5.3 - -While we touched on the majority of the **new features** [in Plasma 5.3 in an earlier article][3] many are worth reiterating. - -**Enhanced power management** features and configuration options, including a **new battery applet, energy usage monitor** and **animated changes in screen brightness**, will help KDE last longer on portable devices. - -Closing a laptop when an external monitor is connected no longer triggers ‘suspend’. This new behaviour is called ‘**cinema mode**‘ and comes enabled by default, but can be disabled using an option in power management settings. - -**Bluetooth functionality is improved**, with a brand new panel applet making connecting and configuring paired bluetooth devices like smartphones, keyboards and speakers easier than ever. - -Similarly, **trackpad configuration in KDE is easier** with Plasma 5.3 thanks to a new set-up and settings module. - -![Trackpad, Touchpad. Tomato, Tomayto.](http://www.omgubuntu.co.uk/wp-content/uploads/2015/04/touchpad-kde.jpg) -Trackpad, Touchpad. Tomato, Tomayto. - -For Plasma widget fans there is a new **Press and Hold** gesture. When enabled this hides the settings handle that appears when on mouseover. Instead making it only appear when long-clicking on widget. - -On the topic of widget-y things, several **old Plasmoid favourites are reintroduced** with this release, including a useful system monitor, handy hard-drive stats and a comic reader. - -### Learning More & Trying It Out ### - -![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/04/plasma-5.3-beta.jpg\) - -A full list of everything — and I mean everything — that is new and improved in Plasma 5.3 is listed [in the official change log][4]. - -Live images that let you try Plasma 5.3 on a Kubuntu base **without affecting your own system** are available from the KDE community: - -- [Download KDE Plasma Live Images][5] - -If you need super stable system you can use these live images to try the features but stick with the version of KDE that comes with your distribution on your main computer. - -However, if you’re happy to experiment — read: can handle any package conflicts or system issues resulting from attempting to upgrade your desktop environment — you can. - -### Install Plasma 5.3 in Kubuntu 15.04 ### - -![](http://www.omgubuntu.co.uk/wp-content/uploads/2012/02/logo-kubuntu.png) - -To **install Plasma 5.3 in Kubuntu 15.04** you need to add the KDE Backports PPA, run the Software Updater tool and install any available updates. - -The Kubuntu backports PPA may/will also upgrade other parts of the KDE Platform other than Plasma that are installed on your system including KDE applications, frameworks and Kubuntu specific configuration files. - -Using the command line is by far the fastest way to upgrade to Plasma 5.3 in Kubuntu: - - sudo add-apt-repository ppa:kubuntu-ppa/backports - - sudo apt-get update && sudo apt-get dist-upgrade - -After the upgrade process has completed, and assuming everything went well, you should reboot your computer. - -If you’re using an alternative desktop environment, like LXDE, Unity or GNOME, you will need to install the Kubuntu desktop package (you’ll find it in the Ubuntu Software Centre) after running both of the commands above. - -To downgrade to the stock version of Plasma in 15.04 you can use the PPA-Purge tool: - - sudo apt-get install ppa-purge - - sudo ppa-purge ppa:kubuntu-ppa/backports - -Let us know how your upgrade/testing goes in the comments below and don’t forget to mention the features you hope to see added to the Plasma 5 desktop next. - --------------------------------------------------------------------------------- - -via: http://www.omgubuntu.co.uk/2015/04/kde-plasma-5-3-released-heres-how-to-upgrade-in-kubuntu-15-04 - -作者:[Joey-Elijah Sneddon][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:https://plus.google.com/117485690627814051450/?rel=author -[1]:https://www.kde.org/announcements/plasma-5.3.0.php -[2]:http://www.omgubuntu.co.uk/2015/04/beta-plasma-5-3-features -[3]:http://www.omgubuntu.co.uk/2015/04/beta-plasma-5-3-features -[4]:https://www.kde.org/announcements/plasma-5.2.2-5.3.0-changelog.php -[5]:https://community.kde.org/Plasma/Live_Images diff --git a/translated/tech/20150429 KDE Plasma 5.3 Released, Here' s How To Upgrade in Kubuntu 15.04.md b/translated/tech/20150429 KDE Plasma 5.3 Released, Here' s How To Upgrade in Kubuntu 15.04.md new file mode 100644 index 0000000000..1e2a36a0a7 --- /dev/null +++ b/translated/tech/20150429 KDE Plasma 5.3 Released, Here' s How To Upgrade in Kubuntu 15.04.md @@ -0,0 +1,85 @@ + +KDE Plasma 5.3已发布,Kubuntu 15.04升级攻略 +================================================================================ +**KDE[已经宣布][1]Plasma 5.3的稳定版已经准备就绪,它包含了一个新的电源管理方面的稳定特性。** + +[先前四月份的beta版][2]已经让我们印象深刻,甚至跃跃欲试了,Plasma 5桌面环境的稳定版更新的最新更新已经稳定,并且可以下载了。 + +Plasma 5.3继续改善和细化了全新的KDE桌面,它添加了大量的特性供桌面用户体验。同时也修复了**多达400个错误**,这对性能和稳定性方面也进行了大量改善。 + +### Plasma 5.3中的新东西 ### + +![Better Bluetooth Management in Plasma 5.3](http://www.omgubuntu.co.uk/wp-content/uploads/2015/04/bluetooth-applet-in-kde.jpg) +Plasma 5.3中更好的蓝牙管理 + +而[在早期关于Plasma 5.3的文章][3]中,我们触及了大量**新特性**,这其中很多都值得反复说道说道。 + +**加强的电源管理**特性和配置选项,包括**新的电源小程序、能源使用监控**和**动态屏幕亮度变化**,将有助于让KDE在移动设备上加强续航能力。 + +在连接了外部监视器的时候合上笔记本盖子时,不会再触发‘挂起’操作。这个新的行为被称之为‘**影院模式**’,并且默认开启。但是,可以通功过电源管理设置中的相关选项禁用。 + +**蓝牙功能被改善**,带来了一个全新的面板小程序,使得在连接到并配置配对的蓝牙设备,如只能手机、键盘和扬声器时,比以往更为便捷。 + +同样,对于Plasma 5.3,**KDE中的轨迹板配置更为方便**,这多亏了新的安装和设置模块。 +![Trackpad, Touchpad. Tomato, Tomayto.](http://www.omgubuntu.co.uk/wp-content/uploads/2015/04/touchpad-kde.jpg) +轨迹板、触控板。Tomato, Tomayto。 + +对于Plasma小部件狂热者,带来了一个**按住并锁定**手势。当启用该功能,会隐藏移动鼠标时出现的设置处理。取而代之的是,它只会在长点击小部件时发生该行为。 + +谈到widget-y这类事情时,该发布版中**再次引入了几个旧的Plasmoid最受欢迎的东西**,包括一个有用的系统监视器、便利的硬盘驱动器统计和一个漫画阅读器。 + +### 了解更多&尝试 ### + +![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/04/plasma-5.3-beta.jpg\) + +一张全部内容的完整列表——我说全部内容——是指Plasma 5.3中[在官方修改日志中][4]列出的新的和改进的内容。 + +你可以从KDE社区获取Live镜像,试用Kubuntu上的Plasma 5.3,**而不会影响到你自己的系统**: + +- [下载KDE Plasma Live镜像][5] + +如果你需要超级稳定的系统,你可以使用这些镜像来尝试新特性,但是你可以继续使用你的主要计算机上与你的版本对应的KDE版本。 + +但是,如果你对实验版满意——请阅:能够处理任何包冲突,或者由尝试升级桌面环境而导致的系统问题——那么你可以安装。 + +### 安装Plasma 5.3到Kubuntu 15.04 ### + +![](http://www.omgubuntu.co.uk/wp-content/uploads/2012/02/logo-kubuntu.png) + +要**安装Plasma 5.3到Kubuntu 15.04**中,你需要添加KDE 移植PPA,运行软件更新器工具并安装任何可用的更新。 + +Kubuntu移植PPA可能也会升级除了安装在你系统上的Plasma外的其它KDE平台组件,包括KDE应用程序、框架和Kubuntu特定配置文件。 + +目前为止,使用命令行来升级Kubuntu中的到Plasma 5.3是最快速的方法: + + sudo add-apt-repository ppa:kubuntu-ppa/backports + + sudo apt-get update && sudo apt-get dist-upgrade + +在升级过程完成后,如果一切顺利,你应该重启计算机。 + +如果你正在使用一个备用桌面环境,比如LXDE、Unity或者GNOME,则你需要在运行完上面的两个命令后安装Kubuntu桌面包(你可以在Ubuntu软件中心找到)。 +To downgrade to the stock version of Plasma in 15.04 you can use the PPA-Purge tool: + + sudo apt-get install ppa-purge + + sudo ppa-purge ppa:kubuntu-ppa/backports + +请在下面的评论中留言,让我们知道你怎么升级/测试过程是怎样的,别忘了告诉我们你在下一个Plasma 5桌面中要看到的特性。 + +-------------------------------------------------------------------------------- + +via: http://www.omgubuntu.co.uk/2015/04/kde-plasma-5-3-released-heres-how-to-upgrade-in-kubuntu-15-04 + +作者:[Joey-Elijah Sneddon][a] +译者:[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/117485690627814051450/?rel=author +[1]:https://www.kde.org/announcements/plasma-5.3.0.php +[2]:http://www.omgubuntu.co.uk/2015/04/beta-plasma-5-3-features +[3]:http://www.omgubuntu.co.uk/2015/04/beta-plasma-5-3-features +[4]:https://www.kde.org/announcements/plasma-5.2.2-5.3.0-changelog.php +[5]:https://community.kde.org/Plasma/Live_Images From 7f96e58b800e532baf423fefa6f608f2db2b3157 Mon Sep 17 00:00:00 2001 From: ZTinoZ Date: Mon, 18 May 2015 10:56:47 +0800 Subject: [PATCH 058/965] Translating by ZTinoZ --- ...7 15 Things to Do After Installing Ubuntu 15.04 Desktop.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20150427 15 Things to Do After Installing Ubuntu 15.04 Desktop.md b/sources/tech/20150427 15 Things to Do After Installing Ubuntu 15.04 Desktop.md index 634d624197..9c43d734a8 100644 --- a/sources/tech/20150427 15 Things to Do After Installing Ubuntu 15.04 Desktop.md +++ b/sources/tech/20150427 15 Things to Do After Installing Ubuntu 15.04 Desktop.md @@ -27,9 +27,9 @@ Ubuntu Upgrade ### 2. 安装额外驱动 ### -In order for the system to scan and install additional hardware proprietary drivers, open Software and Updates utility from System Settings, go to Additional Drivers tab and wait for the utility to scan for drivers. +为了能让系统扫描并安装额外的硬件专有驱动,我们依然从System Settings打开Software and Updates工具,选择Additional Drivers标签并等待该工具扫描驱动。 -If some drivers matching your hardware are found, check the drivers you want to install and hit the Apply Changes button to install it. In case the proprietary drivers are not working as expected, uninstall them using the Revert button or check Do not use the device and Apply Changes. +如果有驱动匹配到了你的硬件,查看你想要安装的驱动并点击Apply按钮来安装它,以防专有驱动没有如期工作,用Revert按钮就能卸载它们或勾选Do not use the device后点击Apply按钮。 ![Install Drivers in Ubuntu](http://www.tecmint.com/wp-content/uploads/2015/04/install-drivers.jpg) Install Drivers From 685cd3dc49666b2a8073699c9591ff35f345cc97 Mon Sep 17 00:00:00 2001 From: wwy-hust Date: Mon, 18 May 2015 13:10:24 +0800 Subject: [PATCH 059/965] translation finished, source removed --- ...A Drop-Down Terminal for Gnome Desktops.md | 117 ------------------ ...A Drop-Down Terminal for Gnome Desktops.md | 115 +++++++++++++++++ 2 files changed, 115 insertions(+), 117 deletions(-) delete mode 100644 sources/share/20150512 Guake 0.7.0 Released--A Drop-Down Terminal for Gnome Desktops.md create mode 100644 translated/share/20150512 Guake 0.7.0 Released--A Drop-Down Terminal for Gnome Desktops.md diff --git a/sources/share/20150512 Guake 0.7.0 Released--A Drop-Down Terminal for Gnome Desktops.md b/sources/share/20150512 Guake 0.7.0 Released--A Drop-Down Terminal for Gnome Desktops.md deleted file mode 100644 index 786acddff4..0000000000 --- a/sources/share/20150512 Guake 0.7.0 Released--A Drop-Down Terminal for Gnome Desktops.md +++ /dev/null @@ -1,117 +0,0 @@ -translating by wwy-hust - -Guake 0.7.0 Released – A Drop-Down Terminal for Gnome Desktops -================================================================================ -Linux commandline is the best and most powerful thing that fascinates a new user and provides extreme power to experienced users and geeks. For those who work on Server and Production, they are already aware of this fact. It would be interesting to know that Linux console was one of those first features of the kernel that was written by Linus Torvalds way back in the year 1991. - -Terminal is a powerful tool that is very reliable as it does not have any movable part. Terminal serves as an intermediate between console and GUI environment. Terminal themselves are GUI application that run on top of a desktop environment. There are a lot of terminal application some of which are Desktop Environment specific and rest are universal. Terminator, Konsole, Gnome-Terminal, Terminology, XFCE terminal, xterm are a few terminal emulators to name. - -You may get a list of most widely used Terminal Emulator follow the below link. - -- [20 Useful Terminals for Linux][1] - -Last day while surfing web, I came across a terminal namely ‘guake‘ which is a terminal for gnome. Though this is not the first time I have learned about Guake. I’d known this application nearly one year ago but somehow I could not write on this and later it was out of my mind until I heard it again. So finally the article is here. We will be taking you to Guake features, installation on Debian, Ubuntu and Fedora followed by quick testing. - -#### What is Guake? #### - -Guake is a Drop Down Terminal for Gnome Environment. Written from scratch mostly in Python and a little in C this application is released under GPLv2+ and is available for Linux and alike systems. Guake is inspired by a console in computer game Quake which slides down from the top by pressing a specially Key (Default is F12) and then slides-up when the same key is pressed. - -Important to mention that Guake is not the first of this kind. Yakuake which stands for Yet Another Kuake, a terminal emulator for KDE Desktop Environment and Tilda which is a GTK+ terminal Emulator are also inspired by the same slide up/down console of computer game Quake. - -#### Features of Guake #### - -- Lightweight -- Simple Easy and Elegant -- Functional -- Powerful -- Good Looking -- Smooth integration of terminal into GUI -- Appears when you call and disappear once you are done by pressing a predefined hot key -- Support for hotkeys, tabs, background transparency makes it a brilliant application, must for every Gnome User. -- Extremely configurable -- Plenty of color palette included, fixed and recognized -- Shortcut for transparency level -- Run a script when Guake starts via Guake Preferences. -- Able to run on more than one monitor - -Guake 0.7.0 was released recently, which brings numerous fixes as well as some new features as discussed above. For complete Guake 0.7.0 changelog and source tarball packages can be found [Here][2]. - -### Installing Guake Terminal in Linux ### - -If you are interested in compiling Guake from source you may download the source from the link above, build it yourself before installing. - -However Guake is available to be installed on most of the distributions from repository or by adding an additional repository. Here, we will be installing Guake on Debian, Ubuntu, Linux Mint and Fedora systems. - -First get the latest software package list from the repository and then install Guake from the default repository as shown below. - - ---------------- On Debian, Ubuntu and Linux Mint ---------------- - $ sudo apt-get update - $ apt-get install guake - ----------- - - ---------------- On Fedora 19 Onwards ---------------- - # yum update - # yum install guake - -After installation, start the Guake from another terminal as: - - $ guake - -After starting it, use F12 (Default) to roll down and roll up the terminal on your Gnome Desktop. - -Seems very beautiful specially the transparent background. Roll down… Roll up… Roll down… Roll up…. run command. Open another tab run command… Roll up… Roll down… - -![Guake Terminal in Action](http://www.tecmint.com/wp-content/uploads/2015/05/Guake.png) -Guake Terminal in Action - -If your wallpaper or working windows color don’t match you may like to change your wallpaper or reduce the transparency of the Guake terminal color. - -Next is to look into Guake Properties to edit settings as per requirements. Run Guake Preferences either by running it from Application Menu or by running the below command. - - $ guake --preferences - -![Guake Terminal Properties](http://www.tecmint.com/wp-content/uploads/2015/05/Guake-Properties.png) -Guake Terminal Properties - -Scrolling Properties.. - -![Guake Scrolling Settings](http://www.tecmint.com/wp-content/uploads/2015/05/Guake-Scrolling.png) -Guake Scrolling Settings - -Appearance Properties – Here you can modify text and background color as well as tune transparency. - -![Appearance Properties](http://www.tecmint.com/wp-content/uploads/2015/05/Appearance-Properties.png) -Appearance Properties - -Keyboard Shortcuts – Here you may edit and Modify Toggle key for Guage Visibility (default is F12). - -![Keyboard Shortcuts](http://www.tecmint.com/wp-content/uploads/2015/05/Keyboard-Shortcuts.png) -Keyboard Shortcuts - -Compatibility Setting – Perhaps you won’t need to edit it. - -![Compatibility Setting](http://www.tecmint.com/wp-content/uploads/2015/05/Compatibility-Setting.png) -Compatibility Setting - -### Conclusion ### - -This Project is not too young and not too old, hence has reached certain level of maturity and is quiet solid and works out of the box. For someone like me who need to switch between GUI and Console very often Guake is a boon. I don’t need to manage an extra window, open and close frequently, use tab among a huge pool of opened applications to find terminal or switch to different workspace to manage terminal now all I need is F12. - -I think this is a must tool for any Linux user who makes use of GUI and Console at the same time, equally. I am going to recommend it to anyone who want to work on a system where interaction between GUI and Console is smooth and hassle free. - -That’s all for now. Let us know if there is any problem in installing and running. We will be here to help you. Also tell us your’s experience about Guake. Provide us with your valuable feedback in the comments below. Like and share us and help us get spread. - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/install-guake-terminal-ubuntu-mint-fedora/ - -作者:[Avishek Kumar][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.tecmint.com/author/avishek/ -[1]:http://www.tecmint.com/linux-terminal-emulators/ -[2]:https://github.com/Guake/guake/releases/tag/0.7.0 diff --git a/translated/share/20150512 Guake 0.7.0 Released--A Drop-Down Terminal for Gnome Desktops.md b/translated/share/20150512 Guake 0.7.0 Released--A Drop-Down Terminal for Gnome Desktops.md new file mode 100644 index 0000000000..a4a3609cf0 --- /dev/null +++ b/translated/share/20150512 Guake 0.7.0 Released--A Drop-Down Terminal for Gnome Desktops.md @@ -0,0 +1,115 @@ +Guake 0.7.0 ѷ - һGnomeʽն +================================================================================ +LinuxáǿĶʹԣΪֺͼ͵ṩǿĹܡЩڷ¹ʶʵȤǣLinuxնLinus Torvald1991дںʱʵֵĵһ֮һ + +նǸǿĹߣûпƶIJ֣ʮֿɿն˽ڿ̨GUI֮䡣նΪһGUI滷¡նض滷ģͨõġTerminator, Konsole, Gnome-Terminal, Terminology, XFCE terminal, xtermЩõնģ + +Դлһʹ㷺նģб + +- [20 Useful Terminals for Linux][1] + +ǰʱżΪGuakegnomeնģⲢҵһGuakeʵϣڴԼһǰ֪Ӧó򣬵֪ôģʱûддGuakeٺұ㽥GuakeֱһGuakeԣգƪµˡҽ㽲GuakeĹܣDebianUbuntuFedoraϵİװԼһЩԡ + +#### ʲôGuake #### + +GuakeӦGnomeʽնˡҪPythonдʹһЩCGPL2+֤鷢LinuxԼƵϵͳGuakeԴڵϷQuake֮նˣQuakeնͨضĬΪF12Ļϻڰͬļȥ + +ֵעǣGuakeǵһӦáYakuakeYet Another KuakeһKDEնģTildaһGTK+дɵնģǵж֮»նˡ + +#### GuakeĹ #### + +- +- 򵥶 +- ڶ๦ +- ǿ +- ÿ +- ƽļGUI +- ڰԤļ/ʧ +- ֧ȼǩ͸ʹʺGnomeû +- ˵ؿ +- ɫĵɫ +- 趨͸ȵĿݷʽ +- ͨGuakeãʱһű +- ڶ + +Guake 0.7.0һЩԼᵽһЩܡİ汾ʷԴ[][2]ҵ + +### LinuxаװGuakeն ### + +ԴԴGuakeȤԴӴGuakeڰװǰб롣 + +ȻGuakeķаͨӶIJֿװǽDebianUbuntuLinux MintFedora°װGuake + +ȴӲֿȡµбĬϵIJֿⰲװGuakeʾ + + ---------------- On Debian, Ubuntu and Linux Mint ---------------- + $ sudo apt-get update + $ apt-get install guake + +---------- + + ---------------- On Fedora 19 Onwards ---------------- + # yum update + # yum install guake + +װ󣬿ԴһնGuake + + $ guake + +󣬱GnomeʹF12Ĭã»ϻնˡ + +dzƯ͸...ȥ......ȥ...ִһǩִȥ......ѳУ + +![Guake Terminal in Action](http://www.tecmint.com/wp-content/uploads/2015/05/Guake.png) +Guakeʵս + +ıֽڵɫGuakeɫЩԸııֽ͸Ȼ߸ıGuakeɫ + +һǽGuakeãÿ˵޸áͨӦò˵Guakeá + + $ guake --preferences + +![Guake Terminal Properties](http://www.tecmint.com/wp-content/uploads/2015/05/Guake-Properties.png) +Guakeն + + + +![Guake Scrolling Settings](http://www.tecmint.com/wp-content/uploads/2015/05/Guake-Scrolling.png) +Guake + + - ޸ɫͱɫԼ͸ȡ + +![Appearance Properties](http://www.tecmint.com/wp-content/uploads/2015/05/Appearance-Properties.png) + + +̿ݼ - ޸GuakeʾĿؿݼ + +![Keyboard Shortcuts](http://www.tecmint.com/wp-content/uploads/2015/05/Keyboard-Shortcuts.png) +̿ݼ + + - ϲ + +![Compatibility Setting](http://www.tecmint.com/wp-content/uploads/2015/05/Compatibility-Setting.png) + + +### ### + +Ŀ̫Ҳ̫ϣѾﵽһijȣ㹻ɿԿ伴áҪGUIն˼Ƶл˵GuakeһҲҪһĴڣƵĴ򿪺͹رգʹtabڴ򿪵ӦóѰն˻лͬĹնˣҪֻF12 + +ΪκͬʱʹGUIն˵Linuxû˵GuakeDZĹߡͬģһκҪϵͳнʹGUIն˵ƼΪƽûκϰ + +Ҫ˵ȫˡڰװʹʱκ⣬ңǻҲʹGuakeľ顣ľ顣޺ͷ԰ + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/install-guake-terminal-ubuntu-mint-fedora/ + +ߣ[Avishek Kumar][a] +ߣ[wwy-hust](https://github.com/wwy-hust) +Уԣ[УID](https://github.com/УID) + + [LCTT](https://github.com/LCTT/TranslateProject) ԭ룬[Linuxй](https://linux.cn/) Ƴ + +[a]:http://www.tecmint.com/author/avishek/ +[1]:http://www.tecmint.com/linux-terminal-emulators/ +[2]:https://github.com/Guake/guake/releases/tag/0.7.0 From f240551dc0a506c4e2e8bd4a755a27d463e2ba4e Mon Sep 17 00:00:00 2001 From: Gore Liu Date: Mon, 18 May 2015 13:47:46 +0800 Subject: [PATCH 060/965] [Translated] 20150123 How to make a file immutable on Linux.md --- ...3 How to make a file immutable on Linux.md | 74 ------------------- ...3 How to make a file immutable on Linux.md | 73 ++++++++++++++++++ 2 files changed, 73 insertions(+), 74 deletions(-) delete mode 100644 sources/tech/20150123 How to make a file immutable on Linux.md create mode 100755 translated/tech/20150123 How to make a file immutable on Linux.md diff --git a/sources/tech/20150123 How to make a file immutable on Linux.md b/sources/tech/20150123 How to make a file immutable on Linux.md deleted file mode 100644 index d6261cb3c1..0000000000 --- a/sources/tech/20150123 How to make a file immutable on Linux.md +++ /dev/null @@ -1,74 +0,0 @@ -Translating by goreliu ... - -How to make a file immutable on Linux -================================================================================ -Suppose you want to write-protect some important files on Linux, so that they cannot be deleted or tampered with by accident or otherwise. In other cases, you may want to prevent certain configuration files from being overwritten automatically by software. While changing their ownership or permission bits on the files by using chown or chmod is one way to deal with this situation, this is not a perfect solution as it cannot prevent any action done with root privilege. That is when chattr comes in handy. - -chattr is a Linux command which allows one to set or unset attributes on a file, which are separate from the standard (read, write, execute) file permission. A related command is lsattr which shows which attributes are set on a file. While file attributes managed by chattr and lsattr are originally supported by EXT file systems (EXT2/3/4) only, this feature is now available on many other native Linux file systems such as XFS, Btrfs, ReiserFS, etc. - -In this tutorial, I am going to demonstrate how to use chattr to make files immutable on Linux. - -chattr and lsattr commands are a part of e2fsprogs package which comes pre-installed on all modern Linux distributions. - -Basic syntax of chattr is as follows. - - $ chattr [-RVf] [operator][attribute(s)] files... - -The operator can be '+' (which adds selected attributes to attribute list), '-' (which removes selected attributes from attribute list), or '=' (which forces selected attributes only). - -Some of available attributes are the following. - -- **a**: can be opened in append mode only. -- **A**: do not update atime (file access time). -- **c**: automatically compressed when written to disk. -- **C**: turn off copy-on-write. -- **i**: set immutable. -- **s**: securely deleted with automatic zeroing. - -### Immutable Attribute ### - -To make a file immutable, you can add "immutable" attribute to the file as follows. For example, to write-protect /etc/passwd file: - - $ sudo chattr +i /etc/passwd - -Note that you must use root privilege to set or unset "immutable" attribute on a file. Now verify that "immutable" attribute is added to the file successfully. - - $ lsattr /etc/passwd - -Once the file is set immutable, this file is impervious to change for any user. Even the root cannot modify, remove, overwrite, move or rename the file. You will need to unset the immutable attribute before you can tamper with the file again. - -To unset the immutable attribute, use the following command: - - $ sudo chattr -i /etc/passwd - -![](https://farm9.staticflickr.com/8613/16152651317_076a65cf50_b.jpg) - -If you want to make a whole directory (e.g., /etc) including all its content immutable at once recursively, use "-R" option: - - $ sudo chattr -R +i /etc - -### Append Only Attribute ### - -Another useful attribute is "append-only" attribute which forces a file to grow only. You cannot overwrite or delete a file with "append-only" attribute set. This attribute can be useful when you want to prevent a log file from being cleared by accident. - -Similar to immutable attribute, you can turn a file into "append-only" mode by: - - $ sudo chattr +a /var/log/syslog - -Note that when you copy an immutable or append-only file to another file, those attributes will not be preserved on the newly created file. - -### Conclusion ### - -In this tutorial, I showed how to use chattr and lsattr commands to manage additional file attributes to prevent (accidental or otherwise) file tampering. Beware that you cannot rely on chattr as a security measure as one can easily undo immutability. One possible way to address this limitation is to restrict the availability of chattr command itself, or drop kernel capability CAP_LINUX_IMMUTABLE. For more details on chattr and available attributes, refer to its man page. - --------------------------------------------------------------------------------- - -via: http://xmodulo.com/make-file-immutable-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 diff --git a/translated/tech/20150123 How to make a file immutable on Linux.md b/translated/tech/20150123 How to make a file immutable on Linux.md new file mode 100755 index 0000000000..8c22e3a2b8 --- /dev/null +++ b/translated/tech/20150123 How to make a file immutable on Linux.md @@ -0,0 +1,73 @@ +如何在Linux下创建一个不可变更的文件 +================================================================================ + +假如你想对Linux中的一些重要文件做写保护,这样它们就不能被删除或者被篡改成之前的版本或者其他东西。或者在其他情况,你可能想避免某些配置文件被软件自动修改。使用`chown`和`chmod`命令修改文件的归属关系或者权限位是处理这种情况的一个解决方法,但这并不完美,因为这样无法避免有root权限的操作。这时`chattr`就派上用场了。 + +`chattr`是一个可以设置或取消文件的标志位的Linux命令,它和标准的文件权限(读、写、执行)是分离的。与此相关的另一个命令是`lsattr`,它可以显示文件的哪些标志位被设置上了。最初只有EXT文件系统(EXT2/3/4)支持`chattr`和`lsattr`所管理的标志位,但现在很多其他的本地Linux文件系统都支持了,比如XFS、Btrfs、ReiserFS等等。 + +在这个教程中,我会示范如果使用`chattr`来让Linux中的文件不可变更。 + +`chattr`和`lsattr`命令是e2fsprogs包的一部分,它在所有现代Linux发行版都预装了。 + +下面是`chattr`的基本语法。 + + $ chattr [-RVf] [操作符][标志位] 文件... + +其中操作符可以是“+”(把选定的标志位添加到标志位列表)、“-”(从标志位列表中移除选定的标志位)、或者“=”(强制使用选定的标志位)。 + +下面是一些可用的标志位。 + +- **a**: 只能以追加模式打开。 +- **A**: 不能更新atime(文件访问时间)。 +- **c**: 当被写入磁盘时被自动压缩。 +- **C**: 关掉“写时复制”。 +- **i**: 不可变更。 +- **s**: 通过自动归零来安全删除。(译注:一般情况文件被删后内容不会被修改,改标志位会使得文件被删后原有内容被0取代) + +### “不可变更”标志位 ### + +为了让一个文件不可变更,你需要按照如下方法为这个文件添加“不可变更”标志位。例如,对/etc/passwd文件做写保护: + + $ sudo chattr +i /etc/passwd + +注意设置或取消一个文件的“不可变更”标志位是需要根用户权限的。现在检查该文件“不可变更”标志位是否被添加上了。 + + $ lsattr /etc/passwd + +一旦文件被设置为不可变更,任何用户都将无法修改该文件。即使是根用户也不可以修改、删除、覆盖、移动或者重命名这个文件。如果你想再次修改这个文件,需要先把“不可变更”标志位取消了。 + +用如下命令取消“不可变更”标志位: + + $ sudo chattr -i /etc/passwd + +![](https://farm9.staticflickr.com/8613/16152651317_076a65cf50_b.jpg) + +如果你想让一个目录(比如/etc)连同它下边的所有内容不可变更,使用“-R”选项: + + $ sudo chattr -R +i /etc + +### “只可追加”标志位 ### + +另一个有用的的标志位是“只可追加”,它只允许文件内容被追加的方式修改。你不能覆盖或者删除一个设置了“只可追加”标志位的文件。这个标志位在你想避免日志文件被意外清理掉的情况很有用。 + +和“不可变更”标志位类似,你可以使用如下命令让文件变成“只可追加”模式: + + $ sudo chattr +a /var/log/syslog + +注意当你复制一个“不可变更”或者“只可追加”的文件到其他地方后,新文件不会保留这些标志位。 + +### 结论 ### + +在这个教程中,我展示了如何使用`chattr`和`lsattr`命令来管理额外的文件标志位,来避免文件被篡改(意外或者其他情况)的方法。注意你不能将`chattr`作为一个安全措施,因为“不可变更”标志位可以很容易被取消掉。解决这个问题的一个可能的方式是限制`chattr`命令自身的可用性,或者剥夺CAP_LINUX_IMMUTABLE内核权能标志。关于`chattr`以及可用的标志位的更多细节,请参考它的man手册。 + +-------------------------------------------------------------------------------- + +via: http://xmodulo.com/make-file-immutable-linux.html + +作者:[Dan Nanni][a] +译者:[goreliu](https://github.com/goreliu) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://xmodulo.com/author/nanni From 98b56111a668ba6ce10e614c30c9d8f6d22f65e9 Mon Sep 17 00:00:00 2001 From: Gore Liu Date: Mon, 18 May 2015 13:49:09 +0800 Subject: [PATCH 061/965] chmod 644 20150123 How to make a file immutable on Linux.md --- translated/tech/20150123 How to make a file immutable on Linux.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 translated/tech/20150123 How to make a file immutable on Linux.md diff --git a/translated/tech/20150123 How to make a file immutable on Linux.md b/translated/tech/20150123 How to make a file immutable on Linux.md old mode 100755 new mode 100644 From 4fea50a0257e590378033099f113cf1f4d4fbd95 Mon Sep 17 00:00:00 2001 From: KayGuoWhu Date: Mon, 18 May 2015 15:07:13 +0800 Subject: [PATCH 062/965] translated by KayGuoWhu --- ...oid Apps on Ubuntu using ARChon Runtime.md | 68 +++++++++---------- 1 file changed, 33 insertions(+), 35 deletions(-) diff --git a/sources/tech/20150227 Enjoy Android Apps on Ubuntu using ARChon Runtime.md b/sources/tech/20150227 Enjoy Android Apps on Ubuntu using ARChon Runtime.md index 0f7a2d20aa..4995eec9d1 100644 --- a/sources/tech/20150227 Enjoy Android Apps on Ubuntu using ARChon Runtime.md +++ b/sources/tech/20150227 Enjoy Android Apps on Ubuntu using ARChon Runtime.md @@ -1,48 +1,46 @@ -[translating by KayGuoWhu] -Enjoy Android Apps on Ubuntu using ARChon Runtime +使用ARChon环境在Ubuntu上运行Android应用 ================================================================================ -Before, we gave try to many android app emulating tools like Genymotion, Virtualbox, Android SDK, etc to try to run android apps on it. But, with this new Chrome Android Runtime, we are able to run Android Apps on our Chrome Browser. So, here are the steps we'll need to follow to install Android Apps on Ubuntu using ARChon Runtime. +在此之前,我们尝试过在多款安卓应用模拟器工具上运行安卓应用,比如Genymotion、VirtualBox和Android SDK等。但是,有了这套全新的Chrome安卓运行环境,就可以在Chrome浏览器中运行安卓应用了。所以,下面是一些步骤来指导如何使用ARChon运行环境在Ubuntu上安装安卓应用。 -Google had [announced the first set of Android apps is ready to run natively on Chrome OS][1], a feature made possible using a new ‘**Android Runtime**’ extension. Now, a developer named Vlad Filippov has figured out a way to bring Android Apps to Chrome on the desktop. His chromeos-apk script and ARChon Android Runtime extension work hand-in-hand to bring Android apps to Chrome browser on the Windows, Mac and Linux desktop. +谷歌已经公布了[首批支持原生运行在Chrome OS的安卓应用][1],而使用一个全新的“**安卓运行环境**”扩展程序使其成为可能。如今,一位名为Vlad Filippov的开发者已经找到了一种把安卓应用移植到桌面端Chrome浏览器的方法。他把chromeos-apk脚本和ARChon安卓运行环境扩展程序两者紧密结合在一起,使得安卓应用可以运行在Windows、Max和Linux系统的桌面端Chrome浏览器中。 -Performance of this apps through the runtime is not pretty good. Similarly, as its both an unofficial repackaging of the official runtime and running outside of Google's Chrome OS, system integration like webcam, speakers, etc. may be patchy or non-existent. +应用借助这种运行环境时的性能并不是很好。同样,由于它是官方运行环境的非官方二次开发包,而且运行在Google的Chrome OS之外,因此一些如webcam和speaker等系统集成工具可能需要通过打补丁获得或者根本就没有。 -### Installing Chrome ### +### 安装Chrome ### -First of all, we'll need Chrome installed in our machine, Chrome version 37 or higher is required. We can download them from the [download page of Chrome Browser][2]. +首先,需要在机器上安装Chrome,版本要求是Chrome 37或者更高。可以从[Chrome浏览器的下载页面][2]下载。 -If you wanna install a Dev Channel version you'll need to follow below procedure. +如果打算安装Dev Channel版本,按照如下操作。 -We'll need to add repository source list for Google Chrome which can be done my using the following command. +首先,使用这个命令为Google Chrome添加软件源列表: $ wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add - $ sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list' ![Adding google source list](http://blog.linoxide.com/wp-content/uploads/2015/02/adding-google-source-list.png) -After adding the repository source list, we'll need to update the local repository index by the command below. +添加完软件源列表后,使用下列命令更新本地的软件库索引。 $ sudo apt-get update -Now, we'll gonna install google chrome unstable which is dev version. - +现在,就可以安装非稳定版的google chrome,即开发版。 $ sudo apt-get install google-chrome-unstable ![Installing Google chrome unstable](http://blog.linoxide.com/wp-content/uploads/2015/02/installing-google-chrome-unstable.png) -### Installing Archon Runtime ### +### 安装Archon运行时环境 ### -Next we'll need to download the custom-made ergo officially not endorsed by Google or Chromium Android Runtime created by Vlad Filippov. This differs from the official version in a number of ways, the chief being it can be used on desktop versions of the browser. Here below is the runtime we need to download, please select anyone of the following according to your bit of Ubuntu installed. +接下来,需要下载定制版的运行环境安装包,因为官方版本不被Google或Vlad Filippov创建的Chromium安卓运行环境认可。它在很多方面有别于官方版本,主要区别是它可以用于Google浏览器的各个桌面端。下面是需要下载的运行环境安装包,请根据所安装的Ubuntu系统位数选择下列的一种。 -For **32-bit** Ubuntu Distributions: +**32位** Ubntu发行版: - [Download Archron for 32-bit Ubuntu][3] -For **64-bit** Ubuntu Distributions: +**64位** Ubntu发行版: - [Download Archron for 64-bit Ubuntu][4] -Once the runtime has fully downloaded you will need to extract the contents from the .zip files and move the resulting directory to Home. Here is the gist commands for this steps to download and extract the contents. +下载好运行环境安装包后,从.zip文件中解压,并将解压得到的目录移动到Home目录。操作命令如下: $ wget https://github.com/vladikoff/chromeos-apk/releases/download/v3.0.0/ARChon-v1.1-x86_32.zip @@ -50,58 +48,58 @@ Once the runtime has fully downloaded you will need to extract the contents from $ unzip ARChon-v1.1-x86_32.zip ~/ -Now to install the runtime, we'll gonna Open our latest Google Chrome and goto the url **chrome://extensions/** then, we'll need to check ‘**Enable developer mode**’. Finally, we'll gonna click on the ‘**load unpacked extension**’ button and select the folder which was placed into **~/Home**. +接下来是安装运行时环境,首先打开Google Chrome浏览器,在地址栏键入**chrome://extensions**。然后,选中“**开发者模式**”。最后,点击“**载入未打包扩展程序**”,选择刚才放置在**~/Home**下面的文件夹。 -### Installing ChromeOS-APK ### +### 安装 ChromeOS-APK ### -To convert APKs manually is something you really don’t need to do any more if you use one of the apps mentioned above — you will need to install the ‘[chromeos-apk][5]’ command line JavaScript utility. This is available to install through the Node Packaged Modules (npm) manager. To install nmp and chromeos-apk, we'll need to run the following command in a shell or terminal. +如果要用到上面提到的应用,那么手动转换这些APKs无需复杂的操作——只需要安装“[chromeos-apk][5]”命令行JavaScript工具。可以在Node Package Modules(npm)管理器中安装它。为了安装npm和chromeos-apk,在shell或终端中运行下面命令: $ sudo apt-get install npm nodejs nodejs-legacy -**If you are running 64 bit OS**, you should grab the following library, to do so run the below commands in a shell or terminal. +如果**操作系统是64位**,需要安装下面这个库,命令如下: $ sudo apt-get install lib32stdc++6 -Now run the command to install the the latest chromeos-apk is: +然后,运行这条命令来安装最新的chromeos-apk: $ npm install -g chromeos-apk@latest ![chromeos apk installation](http://blog.linoxide.com/wp-content/uploads/2015/02/chomeos-apk-installation.png) -Depending on your system configuration you may need to need to run this latter command as sudo. +取决于系统配置,可能需要以sudo权限运行后一条命令。 -Now, we'll gonna for Google to find an APK of an app to give it a try, bearing in mind **not all Android apps will work**, and those that do may be unstable or lack features. Most of the messenger out of the box are not working. +现在,我们将找一个应用程序的APK来在Google浏览器上试一试,但务必牢记**并非所有的安卓应用都可以**,有一些可能不稳定或者缺少某些特性。大部分安装即用的通讯类应用都不适用这个环境。 -### Converting APK ### +### 转换APK ### -Place your **Android APK in ~/Home**, then return to **Terminal** to convert it using the following command: +将**安卓APK放到~/Home**下,然后在**终端**执行下列命令进行转换: $ chromeos-apk myapp.apk --archon -If you want the app in fullscreen mode then run the following instead: +如果想以全屏模式运行应用,请替换成这条命令: $ chromeos-apk myapp.apk --archon --tablet -Note: Please replace myapp.apk to the Android APK app filename you want to convert. +注意:请将myapp.apk替换成待转换的安卓APK应用的文件名。 -For our ease, we can also use [Twerk][6] for the conversion process if we want to skip this step. +为了方便,也可以使用[Twerk][6]来进行转换,这样可以跳过这一步。 -### Running Android Apk ### +### 运行安卓Apk ### -Finally, we'll need to open our chrome browser and then goto chrome://extensions page and enable developer mode then tap the ‘load unpacked extension’ button and select the folder the script above created. +最后,打开chrome浏览器,然后进入chrome://extensions页面,勾选开发者模式。点击“载入未打包扩展程序”按钮,选择文件夹载入刚创建的脚本。 -Now, we can Open the Chrome App Launcher to run it. +至此,就可以打开Chrome应用启动器运行安卓应用了。 -### Conclusion ### +### 总结 ### -Hurray! We have successfully installed Android Apk App in our favorite desktop browser ie Chrome Browser. This article is all about the popular Chrome Android Runtime called Archon created by Vlad Filippov. This runtime allows us to run converted Apk files in our Chrome browser. It has not yet supported messaging apps like Whatsapp, etc. So, if you have any questions, suggestions, feedback please write them in the comment box below. Thank you ! Enjoy Archon :-) +万岁!我们已经成功在Chrome浏览器中安装好安卓Apk应用程序了。这篇文章是关于一款由Vlad Filippov开发的、名为Archon的、时下流行的Chrome安卓运行环境。这个运行环境使用户在Chrome浏览器中运行转换过的Apk文件。目前它还不支持通讯类应用,诸如Whatsapp。因此,如果你有任何问题、建议和反馈,请在下面的评论框中写出来。非常感谢!去拥抱Archon吧!:-) -------------------------------------------------------------------------------- via: http://linoxide.com/ubuntu-how-to/android-apps-ubuntu-archon-runtime/ 作者:[Arun Pyasi][a] -译者:[译者ID](https://github.com/译者ID) +译者:[KayGuoWhu](https://github.com/KayGuoWhu) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 From b9b3c8df4bfb903e0b65a8a390729fc704640bc0 Mon Sep 17 00:00:00 2001 From: wwy Date: Mon, 18 May 2015 15:29:14 +0800 Subject: [PATCH 063/965] [Translating] 20150330 How to Serve Git Repositories Using Gitblit Tool in Linux.md --- ...w to Serve Git Repositories Using Gitblit Tool in Linux.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150330 How to Serve Git Repositories Using Gitblit Tool in Linux.md b/sources/tech/20150330 How to Serve Git Repositories Using Gitblit Tool in Linux.md index 806a462675..aebd06f535 100644 --- a/sources/tech/20150330 How to Serve Git Repositories Using Gitblit Tool in Linux.md +++ b/sources/tech/20150330 How to Serve Git Repositories Using Gitblit Tool in Linux.md @@ -1,3 +1,5 @@ +translating by wwy-hust + How to Serve Git Repositories Using Gitblit Tool in Linux ================================================================================ Hi friends, today we'll be learning how to install Gitblit in your Linux Server or PC. So, lets check out what is a Git, its features and steps to install Gitblit. [Git is a distributed revision control system][1] with an emphasis on speed, data integrity, and support for distributed, non-linear workflows. It was initially designed and developed by Linus Torvalds for Linux kernel under the terms of the GNU General Public License version 2 development in 2005, and has since become the most widely adopted version control system for software development. @@ -98,4 +100,4 @@ via: http://linoxide.com/linux-how-to/serve-git-repositories-gitblit/ [a]:http://linoxide.com/author/arunp/ [1]:http://git-scm.com/ -[2]:http://gitblit.com/ \ No newline at end of file +[2]:http://gitblit.com/ From e49ed47aac658ea8551b5845da49a2d67f4229f0 Mon Sep 17 00:00:00 2001 From: DeadFire Date: Mon, 18 May 2015 15:56:45 +0800 Subject: [PATCH 064/965] =?UTF-8?q?20150518-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... How to set up a Replica Set on MongoDB.md | 182 ++++++++++++++++++ ...pecific user agents on nginx web server.md | 114 +++++++++++ ...ror with 'apt-get update' on old Ubuntu.md | 45 +++++ ...h no Package--header' error on Raspbian.md | 31 +++ ...m_modules.h--No such file or directory'.md | 33 ++++ ...w to view threads of a process on Linux.md | 57 ++++++ ... the Apache error log location on Linux.md | 81 ++++++++ 7 files changed, 543 insertions(+) create mode 100644 sources/tech/20150518 How to set up a Replica Set on MongoDB.md create mode 100644 sources/tech/20150518 Linux FAQs with Answers--How to block specific user agents on nginx web server.md create mode 100644 sources/tech/20150518 Linux FAQs with Answers--How to fix '404 Not Found' error with 'apt-get update' on old Ubuntu.md create mode 100644 sources/tech/20150518 Linux FAQs with Answers--How to fix 'Encountered a section with no Package--header' error on Raspbian.md create mode 100644 sources/tech/20150518 Linux FAQs with Answers--How to fix 'fatal error--security or pam_modules.h--No such file or directory'.md create mode 100644 sources/tech/20150518 Linux FAQs with Answers--How to view threads of a process on Linux.md create mode 100644 sources/tech/20150518 Linux FAQs with Answers--What is the Apache error log location on Linux.md diff --git a/sources/tech/20150518 How to set up a Replica Set on MongoDB.md b/sources/tech/20150518 How to set up a Replica Set on MongoDB.md new file mode 100644 index 0000000000..07e16dafc1 --- /dev/null +++ b/sources/tech/20150518 How to set up a Replica Set on MongoDB.md @@ -0,0 +1,182 @@ +How to set up a Replica Set on MongoDB +================================================================================ +MongoDB has become the most famous NoSQL database on the market. MongoDB is document-oriented, and its scheme-free design makes it a really attractive solution for all kinds of web applications. One of the features that I like the most is Replica Set, where multiple copies of the same data set are maintained by a group of mongod nodes for redundancy and high availability. + +This tutorial describes how to configure a Replica Set on MonoDB. + +The most common configuration for a Replica Set involves one primary and multiple secondary nodes. The replication will then be initiated from the primary toward the secondaries. Replica Sets can not only provide database protection against unexpected hardware failure and service downtime, but also improve read throughput of database clients as they can be configured to read from different nodes. + +### Set up the Environment ### + +In this tutorial, we are going to set up a Replica Set with one primary and two secondary nodes. + +![](https://farm8.staticflickr.com/7667/17801038505_529a5224a1.jpg) + +In order to implement this lab, we will use three virtual machines (VMs) running on VirtualBox. I am going to install Ubuntu 14.04 on the VMs, and install official packages for Mongodb. + +I am going to set up a necessary environment on one VM instance, and then clone it to the other two VM instances. Thus pick one VM named master, and perform the following installations. + +First, we need to add the MongoDB key for apt: + + $ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10 + +Then we need to add the official MongoDB repository to our source.list: + + $ sudo su + # echo "deb http://repo.mongodb.org/apt/ubuntu "$(lsb_release -sc)"/mongodb-org/3.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.0.list + +Let's update repositories and install MongoDB. + + $ sudo apt-get update + $ sudo apt-get install -y mongodb-org + +Now let's make some changes in /etc/mongodb.conf. + + auth = true + dbpath=/var/lib/mongodb + logpath=/var/log/mongodb/mongod.log + logappend=true + keyFile=/var/lib/mongodb/keyFile + replSet=myReplica + +The first line is to make sure that we are going to have authentication on our database. keyFile is to set up a keyfile that is going to be used by MongoDB to replicate between nodes. replSet sets up the name of our replica set. + +Now we are going to create our keyfile, so that it can be in all our instances. + + $ echo -n "MyRandomStringForReplicaSet" | md5sum > keyFile + +This will create keyfile that contains a MD5 string, but it has some noise that we need to clean up before using it in MongoDB. Use the following command to clean it up: + + $ echo -n "MyReplicaSetKey" | md5sum|grep -o "[0-9a-z]\+" > keyFile + +What grep command does is to print MD5 string with no spaces or other characters that we don't want. + +Now we are going to make the keyfile ready for use: + + $ sudo cp keyFile /var/lib/mongodb + $ sudo chown mongodb:nogroup keyFile + $ sudo chmod 400 keyFile + +Now we have our Ubuntu VM ready to be cloned. Power it off, and clone it to the other VMs. + +![](https://farm9.staticflickr.com/8729/17800903865_9876a9cc9c.jpg) + +I name the cloned VMs secondary1 and secondary2. Make sure to reinitialize the MAC address of cloned VMs and clone full disks. + +![](https://farm6.staticflickr.com/5333/17613392900_6de45c9450.jpg) + +All three VM instances should be on the same network to communicate with each other. For this, we are going to attach all three VMs to "Internet Network". + +It is recommended that each VM instances be assigned a static IP address, as opposed to DHCP IP address, so that the VMs will not lose connectivity among themselves when a DHCP server assigns different IP addresses to them. + +Let's edit /etc/networks/interfaces of each VM as follows. + +On primary: + + auto eth1 + iface eth1 inet static + address 192.168.50.2 + netmask 255.255.255.0 + +On secondary1: + + auto eth1 + iface eth1 inet static + address 192.168.50.3 + netmask 255.255.255.0 + +On secondary2: + + auto eth1 + iface eth1 inet static + address 192.168.50.4 + netmask 255.255.255.0 + +Another file that needs to be set up is /etc/hosts, because we don't have DNS. We need to set the hostnames in /etc/hosts. + +On primary: + + 127.0.0.1 localhost primary + 192.168.50.2 primary + 192.168.50.3 secondary1 + 192.168.50.4 secondary2 + +On secondary1: + + 127.0.0.1 localhost secondary1 + 192.168.50.2 primary + 192.168.50.3 secondary1 + 192.168.50.4 secondary2 + +On secondary2: + + 127.0.0.1 localhost secondary2 + 192.168.50.2 primary + 192.168.50.3 secondary1 + 192.168.50.4 secondary2 + +Check connectivity among themselves by using ping command: + + $ ping primary + $ ping secondary1 + $ ping secondary2 + +### Set up a Replica Set ### + +After verifying connectivity among VMs, we can go ahead and create the admin user so that we can start working on the Replica Set. + +On primary node, open /etc/mongodb.conf, and comment out two lines that start with auth and replSet: + + dbpath=/var/lib/mongodb + logpath=/var/log/mongodb/mongod.log + logappend=true + #auth = true + keyFile=/var/lib/mongodb/keyFile + #replSet=myReplica + +Restart mongod daemon. + + $ sudo service mongod restart + +Create an admin user after conencting to MongoDB: + + > use admin + > db.createUser({ + user:"admin", + pwd:" + }) + $ sudo service mongod restart + +Connect to MongoDB and use these commands to add secondary1 and secondary2 to our Replicat Set. + + > use admin + > db.auth("admin","myreallyhardpassword") + > rs.initiate() + > rs.add ("secondary1:27017") + > rs.add("secondary2:27017") + +Now that we have our Replica Set, we can start working on our project. Consult the [official driver documentation][1] to see how to connect to a Replica Set. In case you want to query from shell, you have to connect to primary instance to insert or query the database. Secondary nodes will not let you do that. If you attempt to access the database on a secondary node, you will get this error message: + + myReplica:SECONDARY> + myReplica:SECONDARY> show databases + 2015-05-10T03:09:24.131+0000 E QUERY Error: listDatabases failed:{ "note" : "from execCommand", "ok" : 0, "errmsg" : "not master" } + at Error () + at Mongo.getDBs (src/mongo/shell/mongo.js:47:15) + at shellHelper.show (src/mongo/shell/utils.js:630:33) + at shellHelper (src/mongo/shell/utils.js:524:36) + at (shellhelp2):1:1 at src/mongo/shell/mongo.js:47 + +I hope you find this tutorial useful. You can use Vagrant to automate your local environments and help you code faster. + +-------------------------------------------------------------------------------- + +via: http://xmodulo.com/setup-replica-set-mongodb.html + +作者:[Christopher Valerio][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://xmodulo.com/author/valerio +[1]:http://docs.mongodb.org/ecosystem/drivers/ \ No newline at end of file diff --git a/sources/tech/20150518 Linux FAQs with Answers--How to block specific user agents on nginx web server.md b/sources/tech/20150518 Linux FAQs with Answers--How to block specific user agents on nginx web server.md new file mode 100644 index 0000000000..6ea8ae3b06 --- /dev/null +++ b/sources/tech/20150518 Linux FAQs with Answers--How to block specific user agents on nginx web server.md @@ -0,0 +1,114 @@ +Linux FAQs with Answers--How to block specific user agents on nginx web server +================================================================================ +> **Question**: I notice that some robots often visit my nginx-powered website and scan it aggressively, ending up wasting a lot of my web server resources. I am trying to block those robots based on their user-agent string. How can I block specific user agent(s) on nginx web server? + +The modern Internet is infested with various malicious robots and crawlers such as malware bots, spambots or content scrapers which are scanning your website in surreptitious ways, for example to detect potential website vulnerabilities, harvest email addresses, or just to steal content from your website. Many of these robots can be identified by their signature "user-agent" string. + +As a first line of defense, you could try to block malicious bots from accessing your website by blacklisting their user-agents in robots.txt file. However, unfortunately this works only for "well-behaving" robots which are designed to obey robots.txt. Many malicious bots can simply ignore robots.txt and scan your website at will. + +An alternative way to block particular robots is to configure your web server, such that it refuses to serve content to requests with certain user-agent strings. This post explains how to **block certain user-agent on nginx web server**. + +### Blacklist Certain User-Agents in Nginx ### + +To configure user-agent block list, open the nginx configuration file of your website, where the server section is defined. This file can be found in different places depending on your nginx setup or Linux distribution (e.g., /etc/nginx/nginx.conf, /etc/nginx/sites-enabled/, /usr/local/nginx/conf/nginx.conf, /etc/nginx/conf.d/). + + server { + listen 80 default_server; + server_name xmodulo.com; + root /usr/share/nginx/html; + + .... + } + +Once you open the config file with the server section, add the following if statement(s) somewhere inside the section. + + server { + listen 80 default_server; + server_name xmodulo.com; + root /usr/share/nginx/html; + + # case sensitive matching + if ($http_user_agent ~ (Antivirx|Arian) { + return 403; + } + + # case insensitive matching + if ($http_user_agent ~* (netcrawl|npbot|malicious)) { + return 403; + } + + .... + } + +As you can guess, these if statements match any bad user-string with regular expressions, and return 403 HTTP status code when a match is found. $http_user_agent is a variable that contains the user-agent string of an HTTP request. The '~' operator does case-sensitive matching against user-agent string, while the '~' operator does case-insensitive matching. The '|' operator is logical-OR, so you can put as many user-agent keywords in the if statements, and block them all. + +After modifying the configuration file, you must reload nginx to activate the blocking: + + $ sudo /path/to/nginx -s reload + +You can test user-agent blocking by using wget with "--user-agent" option. + + $ wget --user-agent "malicious bot" http:// + +![](https://farm6.staticflickr.com/5333/17434036358_ef139a6b59_b.jpg) + +### Manage User-Agent Blacklist in Nginx ### + +So far, I have shown how to block HTTP requests with a few user-agents in nginx. What if you have many different types of crawling bots to block? + +Since the user-agent blacklist can grow very big, it is not a good idea to put them all inside your nginx's server section. Instead, you can create a separate file which lists all blocked user agents. For example, let's create /etc/nginx/useragent.rules, and define a map with all blocked user agents in the following format. + + $ sudo vi /etc/nginx/useragent.rules + +---------- + + map $http_user_agent $badagent { + default 0; + ~*malicious 1; + ~*backdoor 1; + ~*netcrawler 1; + ~Antivirx 1; + ~Arian 1; + ~webbandit 1; + } + +Similar to the earlier setup, '~*' will match a keyword in case-insensitive manner, while '~' will match a keyword using a case-sensitive regular expression. The line that says "default 0" means that any other user-agent not listed in the file will be allowed. + +Next, open an nginx configuration file of your website, which contains http section, and add the following line somewhere inside the http section. + + http { + ..... + include /etc/nginx/useragent.rules + } + +Note that this include statement must appear before the server section (this is why we add it inside http section). + +Now open an nginx configuration where your server section is defined, and add the following if statement: + + server { + .... + + if ($badagent) { + return 403; + } + + .... + } + +Finally, reload nginx. + + $ sudo /path/to/nginx -s reload + +Now any user-agent which contains a keyword listed in /etc/nginx/useragent.rules will be automatically banned by nginx. + +-------------------------------------------------------------------------------- + +via: http://ask.xmodulo.com/block-specific-user-agents-nginx-web-server.html + +作者:[Dan Nanni][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://ask.xmodulo.com/author/nanni \ No newline at end of file diff --git a/sources/tech/20150518 Linux FAQs with Answers--How to fix '404 Not Found' error with 'apt-get update' on old Ubuntu.md b/sources/tech/20150518 Linux FAQs with Answers--How to fix '404 Not Found' error with 'apt-get update' on old Ubuntu.md new file mode 100644 index 0000000000..a5f150d3eb --- /dev/null +++ b/sources/tech/20150518 Linux FAQs with Answers--How to fix '404 Not Found' error with 'apt-get update' on old Ubuntu.md @@ -0,0 +1,45 @@ +Linux FAQs with Answers--How to fix “404 Not Found” error with “apt-get update” on old Ubuntu +================================================================================ +> **Question**: I have old Ubuntu 13.04 (Raring Ringtail) installation on my PC. When I run "sudo apt-get update" on it, it throws a bunch of "404 Not Found" errors, and I cannot install or update any package using apt-get or aptitude. Due to this error I cannot even upgrade it to a newer release. How can I fix this problem? + +![](https://farm6.staticflickr.com/5460/17634085636_996b2a8ab5_b.jpg) + +Every Ubuntu release has its end-of-life (EOL) time; regular Ubuntu releases are supported for 18 months, while LTS (Long Term Support) versions are supported up to 3 years (server edition) and 5 years (desktop edition). Once a Ubuntu release has reached EOL, its repositories will no longer be accessible, and you won't get any maintenance updates and security patches from Canonical. As of this writing, Ubuntu 13.04 (Raring Ringtail) has already reached EOL. + +If the Ubuntu system you are using is EOL-ed, you will get the following 404 errors from apt-get or aptitude as its repositories have been deprecated. + + W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/raring-backports/multiverse/binary-i386/Packages 404 Not Found [IP: 91.189.91.13 80] + + W: Failed to fetch http://extras.ubuntu.com/ubuntu/dists/raring/main/binary-amd64/Packages 404 Not Found + + W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/raring-security/universe/binary-i386/Packages 404 Not Found [IP: 91.189.88.149 80] + + E: Some index files failed to download. They have been ignored, or old ones used instead + +For those users who are using old versions of Ubuntu, Canonical maintains old-releases.ubuntu.com, which is an archive of EOL-ed repositories. Thus, when Canonical's support for your Ubuntu installation ends, you need to switch to repositories at old-releases.ubuntu.com (unless you want to upgrade it before EOL). + +Here is a quick way to fix "404 Not Found" errors on old Ubuntu by switching to old-releases repositories. + +First, replace main/security repositories with old-releases versions as follows. + + $ sudo sed -i -r 's/([a-z]{2}\.)?archive.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list + $ sudo sed -i -r 's/security.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list + +Then open /etc/apt/sources.list with a text editor, and look for extras.ubuntu.com. This repository is also no longer supported for 13.04. So you need to comment out extras.ubuntu.com by prepending '#' sign. + + #deb http://extras.ubuntu.com/ubuntu raring main + #deb-src http://extras.ubuntu.com/ubuntu raring main + +Now you should be able to install or update packages on an old unsupported Ubuntu release. + +-------------------------------------------------------------------------------- + +via: http://ask.xmodulo.com/404-not-found-error-apt-get-update-ubuntu.html + +作者:[Dan Nanni][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://ask.xmodulo.com/author/nanni \ No newline at end of file diff --git a/sources/tech/20150518 Linux FAQs with Answers--How to fix 'Encountered a section with no Package--header' error on Raspbian.md b/sources/tech/20150518 Linux FAQs with Answers--How to fix 'Encountered a section with no Package--header' error on Raspbian.md new file mode 100644 index 0000000000..f79090e1da --- /dev/null +++ b/sources/tech/20150518 Linux FAQs with Answers--How to fix 'Encountered a section with no Package--header' error on Raspbian.md @@ -0,0 +1,31 @@ +Linux FAQs with Answers--How to fix “Encountered a section with no Package: header” error on Raspbian +================================================================================ +> **Question**: I installed fresh Rasbian on Raspberry Pi. But when I tried to update APT package index by running sudo apt-get update, it throws the following error: + + E: Encountered a section with no Package: header + E: Problem with MergeList /var/lib/dpkg/status + E: The package lists or status file could not be parsed or opened. + +> I then cannot install any package on Raspbian. How can I solve this error? + +![](https://farm8.staticflickr.com/7704/17445484636_05ba81722f_c.jpg) + +The error saying "Problem with MergeList /var/lib/dpkg/status" indicates that the status file got corrupted for some reason, and so cannot be parsed. This status file contains information about installed deb packages, and thus needs to be carefully backed up. + +In this case, since this is freshly installed Raspbian, you can safely remove the status file, and re-generate it as follows. + + $ sudo rm /var/lib/dpkg/status + $ sudo touch /var/lib/dpkg/status + $ sudo apt-get update + +-------------------------------------------------------------------------------- + +via: http://ask.xmodulo.com/encountered-section-with-no-package-header-error.html + +作者:[Dan Nanni][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://ask.xmodulo.com/author/nanni \ No newline at end of file diff --git a/sources/tech/20150518 Linux FAQs with Answers--How to fix 'fatal error--security or pam_modules.h--No such file or directory'.md b/sources/tech/20150518 Linux FAQs with Answers--How to fix 'fatal error--security or pam_modules.h--No such file or directory'.md new file mode 100644 index 0000000000..55c17e1669 --- /dev/null +++ b/sources/tech/20150518 Linux FAQs with Answers--How to fix 'fatal error--security or pam_modules.h--No such file or directory'.md @@ -0,0 +1,33 @@ +Linux FAQs with Answers--How to fix “fatal error: security/pam_modules.h: No such file or directory” +================================================================================ +> **Question**: I was trying to compile a program on [insert your Linux distro], but was getting the following compile error: +> +> "pam_otpw.c:27:34: fatal error: security/pam_modules.h: No such file or directory" +> +> How can I fix this error? + +The missing header file 'security/pam_modules.h' is part of development files for libpam, a PAM (Pluggable Authentication Modules) library. Thus to fix this error, you need to install libpam development package, as described below. + +On Debian, Ubuntu or Linux Mint: + + $ sudo apt-get install libpam0g-dev + +On CentOS, Fedora or RHEL: + + $ sudo yum install gcc pam-devel + +Now verify that the missing header file is installed under /usr/include/security. + +![](https://farm8.staticflickr.com/7751/16819069693_fa961f0d40_b.jpg) + +-------------------------------------------------------------------------------- + +via: http://ask.xmodulo.com/fatal-error-security-pam-modules.html + +作者:[Dan Nanni][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://ask.xmodulo.com/author/nanni \ No newline at end of file diff --git a/sources/tech/20150518 Linux FAQs with Answers--How to view threads of a process on Linux.md b/sources/tech/20150518 Linux FAQs with Answers--How to view threads of a process on Linux.md new file mode 100644 index 0000000000..9bb7bc0b9f --- /dev/null +++ b/sources/tech/20150518 Linux FAQs with Answers--How to view threads of a process on Linux.md @@ -0,0 +1,57 @@ +Linux FAQs with Answers--How to view threads of a process on Linux +================================================================================ +> **Question**: My program creates and executes multiple threads in it. How can I monitor individual threads of the program once they are created? I would like to see the details (e.g., CPU/memory usage) of individual threads with their names. + +Threads are a popular programming abstraction for parallel execution on modern operating systems. When threads are forked inside a program for multiple flows of execution, these threads share certain resources (e.g., memory address space, open files) among themselves to minimize forking overhead and avoid expensive IPC (inter-process communication) channel. These properties make threads an efficient mechanism for concurrent execution. + +In Linux, threads (also called Lightweight Processes (LWP)) created within a program will have the same "thread group ID" as the program's PID. Each thread will then have its own thread ID (TID). To the Linux kernel's scheduler, threads are nothing more than standard processes which happen to share certain resources. Classic command-line tools such as ps or top, which display process-level information by default, can be instructed to display thread-level information. + +Here are several ways to **show threads for a process on Linux**. + +### Method One: PS ### + +In ps command, "-T" option enables thread views. The following command list all threads created by a process with . + + $ ps -T -p + +![](https://farm8.staticflickr.com/7749/17350561110_94cacfc456_c.jpg) + +The "SID" column represents thread IDs, and "CMD" column shows thread names. + +### Method Two: Top ### + +The top command can show a real-time view of individual threads. To enable thread views in the top output, invoke top with "-H" option. This will list all Linux threads. You can also toggle on or off thread view mode while top is running, by pressing 'H' key. + + $ top -H + +![](https://farm9.staticflickr.com/8824/17350561070_3dfe447974_c.jpg) + +To restrict the top output to a particular process and check all threads running inside the process: + + $ top -H -p + +![](https://farm8.staticflickr.com/7797/17538002751_c8a3d574d8_c.jpg) + +### Method Three: Htop ### + +A more user-friendly way to view threads per process is via htop, an ncurses-based interactive process viewer. This program allows you to monitor individual threads in tree views. + +To enable thread views in htop, launch htop, and press to enter htop setup menu. Choose "Display option" under "Setup" column, and toggle on "Three view" and "Show custom thread names" options. Presss to exit the setup. + +![](https://farm6.staticflickr.com/5338/17350364568_59bce22e7b_b.jpg) + +Now you will see the follow threaded view of individual processes. + +![](https://farm9.staticflickr.com/8885/17350560930_98952d5350_c.jpg) + +-------------------------------------------------------------------------------- + +via: http://ask.xmodulo.com/view-threads-process-linux.html + +作者:[Dan Nanni][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://ask.xmodulo.com/author/nanni \ No newline at end of file diff --git a/sources/tech/20150518 Linux FAQs with Answers--What is the Apache error log location on Linux.md b/sources/tech/20150518 Linux FAQs with Answers--What is the Apache error log location on Linux.md new file mode 100644 index 0000000000..946094a532 --- /dev/null +++ b/sources/tech/20150518 Linux FAQs with Answers--What is the Apache error log location on Linux.md @@ -0,0 +1,81 @@ +Linux FAQs with Answers--What is the Apache error log location on Linux +================================================================================ +> **Question**: I am trying to troubleshoot Apache web server errors on my Linux system. Where is the Apache error log file located on [insert your Linux distro]? + +Error log and access log files are a useful piece of information for system admins, for example to troubleshoot their web server, [protect][1] it from various malicious activities, or just to run [various][2] [analytics][3] for HTTP server monitoring. Depending on your web server setup, its error/access logs may be found in different places on your system. + +This post may help you **find Apache error log location on Linux**. + +![](https://farm8.staticflickr.com/7664/16958522954_4852ab5ea5_c.jpg) + +### Apache Error Log Location on Debian, Ubuntu or Linux Mint ### + +#### Default Error Log #### + +On Debian-based Linux, the system-wide default location of Apache error log is **/var/log/apache2/error.log**. The default location can be customized by editing Apache configuration file. + +#### Custom Error Log #### + +To find a custom error log location, open /etc/apache2/apache2.conf with a text editor, and look for a line that starts with ErrorLog. This line specifies a custom location of Apache error log file. For example, the unmodified Apache configuration file has the following line: + + ErrorLog ${APACHE_LOG_DIR}/error.log + +In this case, the location is configured using APACHE_LOG_DIR environment variable, which is defined in /etc/apache2/envvars. + + export APACHE_LOG_DIR=/var/log/apache2$SUFFIX + +In reality, ErrorLog may point to any arbitrary path on your Linux system. + +#### Custom Error Log with VirtualHost #### + +If VirtualHost is used in Apache web server, ErrorLog directive can be specified within VirtualHost container, in which case the system-wide error log location described above will be ignored. + +With VirtualHost enabled, each VirtualHost can define its own custom error log location. To find out the error log location of a particular VirtualHost, you can open /etc/apache2/sites-enabled/.conf, and look for ErrorLog directive, which will show a site-specific error log file. + +### Apache Error Log Location on CentOS, Fedora or RHEL ### + +#### Default Error Log #### + +On Red Hat based Linux, a system-wide Apache error log file is by default placed in **/var/log/httpd/error_log**. This default location can be customized by editing Apache configuration file. + +#### Custom Error Log #### + +To find out the custom location of Apache error log, open /etc/httpd/conf/httpd.conf with a text editor, and look for ServerRoot, which shows the top of the Apache server directory tree, under which log files and configurations are located. For example: + + ServerRoot "/etc/httpd" + +Now look for a line that starts with ErrorLog, which indicates where Apache web server is writing its error logs. Note that the specified location is relative to the ServerRoot value. For example: + + ErrorLog "log/error_log" + +Combine the above two directives to obtain the full path of an error log, which is by default /etc/httpd/logs/error_log. This is a symlink to /var/log/httpd/error_log with freshly installed Apache. + +In reality, ErrorLog may point to any arbitrary location on your Linux system. + +#### Custom Error Log with VirtualHost #### + +If you enabled VirtualHost, you can find the error log location of individual VirtualHosts by checking /etc/httpd/conf/httpd.conf (or any file where VirtualHost is defined). Look for ErrorLog inside individual VirtualHost sections. For example, in the following VirtualHost section, an error log is found in /var/www/xmodulo.com/logs/error_log. + + + ServerAdmin webmaster@xmodulo.com + DocumentRoot /var/www/xmodulo.com/public_html + ServerName www.xmodulo.com + ServerAlias xmodulo.com + ErrorLog /var/www/xmodulo.com/logs/error_log + CustomLog /var/www/xmodulo.com/logs/access_log + + +-------------------------------------------------------------------------------- + +via: http://ask.xmodulo.com/apache-error-log-location-linux.html + +作者:[Dan Nanni][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://ask.xmodulo.com/author/nanni +[1]:http://xmodulo.com/configure-fail2ban-apache-http-server.html +[2]:http://xmodulo.com/interactive-apache-web-server-log-analyzer-linux.html +[3]:http://xmodulo.com/sql-queries-apache-log-files-linux.html \ No newline at end of file From e79f29cffc4b414bc41334fd5c8131695cfdfd23 Mon Sep 17 00:00:00 2001 From: DeadFire Date: Mon, 18 May 2015 16:16:32 +0800 Subject: [PATCH 065/965] =?UTF-8?q?20150518-2=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...of Symbol or Operator in Linux Commands.md | 193 +++++++++ ...ripting Interview Questions and Answers.md | 399 ++++++++++++++++++ 2 files changed, 592 insertions(+) create mode 100644 sources/tech/20150518 10 Amazing and Mysterious Uses of Symbol or Operator in Linux Commands.md create mode 100644 sources/tech/20150518 70 Expected Shell Scripting Interview Questions and Answers.md diff --git a/sources/tech/20150518 10 Amazing and Mysterious Uses of Symbol or Operator in Linux Commands.md b/sources/tech/20150518 10 Amazing and Mysterious Uses of Symbol or Operator in Linux Commands.md new file mode 100644 index 0000000000..2b281b8e85 --- /dev/null +++ b/sources/tech/20150518 10 Amazing and Mysterious Uses of Symbol or Operator in Linux Commands.md @@ -0,0 +1,193 @@ +10 Amazing and Mysterious Uses of (!) Symbol or Operator in Linux Commands +================================================================================ +The `'!'` symbol or operator in Linux can be used as Logical Negation operator as well as to fetch commands from history with tweaks or to run previously run command with modification. All the commands below have been checked explicitly in bash Shell. Though I have not checked but a major of these won’t run in other shell. Here we go into the amazing and mysterious uses of `'!'` symbol or operator in Linux commands. + +### 1. Run a command from history by command number. ### + +You might not be aware of the fact that you can run a command from your history command (already/earlier executed commands). To get started first find the command number by running ‘history‘ command. + + $ history + +![Find Last Executed Commands with History Command](http://www.tecmint.com/wp-content/uploads/2015/05/history-Command.gif) + +Now run a command from history just by the number at which it appears, in the output of history. Say run a command that appears at number 1551 in the output of ‘history‘ command. + + $ !1551 + +![Run Last Executed Commands by Number ID](http://www.tecmint.com/wp-content/uploads/2015/05/Run-Commands-By-number.gif) + +And, it runs the command ([top command][1] in the above case), that was listed at number 1551. This way to retrieving already executed command is very helpful specially in case of those commands which are long. You just need to call it using **![Number at which it appears in the output of history command]**. + +### 2. Run previously executed command as 2nd last command, 7th last command,etc. ### + +You may run those commands which you have run previously by their running sequence being the last run command will be represented as -1, second last as -2, seventh last as -7,…. + +First run history command to get a list of last executed command. It is necessary to run history command, so that you can be sure that there is no command like `rm command > file` and others just to make sure you do not run any dangerous command accidentally. And then check Sixth last command, Eight last command and Tenth last command. + + $ history + $ !-6 + $ !-8 + $ !-10 + +![Run Last Executed Commands By Numbers](http://www.tecmint.com/wp-content/uploads/2015/05/3.gif) +Run Last Executed Commands By Numbers + +### 3. Pass arguments of last command that we run to the new command without retyping ### + +I need to list the content of directory ‘/home/$USER/Binary/firefox‘ so I fired. + + $ ls /home/$USER/Binary/firefox + +Then I realized that I should have fired ‘ls -l‘ to see which file is executable there? So should I type the whole command again! No I don’t need. I just need to carry the last argument to this new command as: + + $ ls -l !$ + +Here `!$` will carry arguments passed in last command to this new command. + +![Pass Arguments of Last Executed Command to New](http://www.tecmint.com/wp-content/uploads/2015/05/4.gif) +Pass Arguments of Last Executed Command to New + +### 4. How to handle two or more arguments using (!) ### + +Let’s say I created a text file 1.txt on the Desktop. + + $ touch /home/avi/Desktop/1.txt + +and then copy it to ‘/home/avi/Downloads‘ using complete path on either side with cp command. + + $ cp /home/avi/Desktop/1.txt /home/avi/downloads + +Now we have passed two arguments with cp command. First is ‘/home/avi/Desktop/1.txt‘ and second is ‘/home/avi/Downloads‘, lets handle them differently, just execute `echo [arguments]` to print both arguments differently. + + $ echo “1st Argument is : !^” + $ echo “2nd Argument is : !cp:2” + +Note 1st argument can be printed as `“!^”` and rest of the arguments can be printed by executing `“![Name_of_Command]:[Number_of_argument]”`. + +In the above example the first command was ‘cp‘ and 2nd argument was needed to print. Hence `“!cp:2”`, if any command say xyz is run with 5 arguments and you need to get 4th argument, you may use `“!xyz:4”`, and use it as you like. All the arguments can be accessed by `“!*”`. + +![Handle Two or More Arguments](http://www.tecmint.com/wp-content/uploads/2015/05/5.gif) +Handle Two or More Arguments + +### 5. Execute last command on the basis of keywords ### + +We can execute the last executed command on the basis of keywords. We can understand it as follows: + + $ ls /home > /dev/null [Command 1] + $ ls -l /home/avi/Desktop > /dev/null [Command 2] + $ ls -la /home/avi/Downloads > /dev/null [Command 3] + $ ls -lA /usr/bin > /dev/null [Command 4] + +Here we have used same command (ls) but with different switches and for different folders. Moreover we have sent to output of each command to ‘/dev/null‘ as we are not going to deal with the output of the command also the console remains clean. + +Now Execute last run command on the basis of keywords. + + $ ! ls [Command 1] + $ ! ls -l [Command 2] + $ ! ls -la [Command 3] + $ ! ls -lA [Command 4] + +Check the output and you will be astonished that you are running already executed commands just by `ls` keywords. + +![Run Commands Based on Keywords](http://www.tecmint.com/wp-content/uploads/2015/05/6.gif) +Run Commands Based on Keywords + +### 6. The power of !! Operator ### + +You can run/alter your last run command using `(!!)`. It will call the last run command with alter/tweak in the current command. Lets show you the scenario + +Last day I run a one-liner script to get my private IP so I run, + + $ ip addr show | grep inet | grep -v 'inet6'| grep -v '127.0.0.1' | awk '{print $2}' | cut -f1 -d/ + +Then suddenly I figured out that I need to redirect the output of the above script to a file ip.txt, so what should I do? Should I retype the whole command again and redirect the output to a file? Well an easy solution is to use `UP` navigation key and add `'> ip.txt'` to redirect the output to a file as. + + $ ip addr show | grep inet | grep -v 'inet6'| grep -v '127.0.0.1' | awk '{print $2}' | cut -f1 -d/ > ip.txt + +Thanks to the life Savior `UP` navigation key here. Now consider the below condition, the next time I run below one-liner script. + + $ ifconfig | grep "inet addr:" | awk '{print $2}' | grep -v '127.0.0.1' | cut -f2 -d: + +As soon as I run script, the bash prompt returned an error with the message `“bash: ifconfig: command not found”`, It was not difficult for me to guess I run this command as user where it should be run as root. + +So what’s the solution? It is difficult to login to root and then type the whole command again! Also (UP Navigation Key) in last example didn’t came to rescue here. So? We need to call `“!!”` without quotes, which will call the last command for that user. + + $ su -c “!!” root + +Here su is switch user which is root, `-c` is to run the specific command as the user and the most important part `!!` will be replaced by command and last run command will be substituted here. Yeah! You need to provide root password. + +![The Power of !! Key](http://www.tecmint.com/wp-content/uploads/2015/05/7.gif) +The Power of !! Key + +I make use of `!!` mostly in following scenarios, + +1. When I run apt-get command as normal user, I usually get an error saying you don’t have permission to execute. + + $ apt-get upgrade && apt-get dist-upgrade + +Opps error…don’t worry execute below command to get it successful.. + + $ su -c !! + +Same way I do for, + + $ service apache2 start + or + $ /etc/init.d/apache2 start + or + $ systemctl start apache2 + +OOPS User not authorized to carry such task, so I run.. + + $ su -c 'service apache2 start' + or + $ su -c '/etc/init.d/apache2 start' + or + $ su -c 'systemctl start apache2' + +### 7. Run a command that affects all the file except ![FILE_NAME] ### + +The `!` (Logical NOT) can be used to run the command on all the files/extension except that is behind `'!'`. + +A. Remove all the files from a directory except the one the name of which is 2.txt. + + $ rm !(2.txt) + +B. Remove all the file type from the folder except the one the extension of which is ‘pdf‘. + + $ $ rm !(*.pdf) + +### 8. Check if a directory (say /home/avi/Tecmint)exist or not? Printf if the said directory exist or not. ### + +Here we will use `'! -d'` to validate if the directory exist or not followed by Logical AND Operator `(&&)` to print that directory does not exist and Logical OR Operator `(||)` to print the directory is present. + +Logic is, when the output of `[ ! -d /home/avi/Tecmint ]` is 0, it will execute what lies beyond Logical AND else it will go to Logical OR `(||)` and execute what lies beyond Logical OR. + + $ [ ! -d /home/avi/Tecmint ] && printf '\nno such /home/avi/Tecmint directory exist\n' || printf '\n/home/avi/Tecmint directory exist\n' + +### 9. Check if a directory exist or not? If not exit the command. ### + +Similar to the above condition, but here if the desired directory doesn’t exist it will exit the command. + + $ [ ! -d /home/avi/Tecmint ] && exit + +### 10. Create a directory (say test) in your home directory if it does not exist. ### + +A general implementation in Scripting Language where if the desired directory does not exist, it will create one. + + [ ! -d /home/avi/Tecmint ] && mkdir /home/avi/Tecmint + +That’s all for now. If you know or come across any other use of `'!'` which is worth knowing, you may like to provide us with your suggestion in the feedback. Keep connected! + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/mysterious-uses-of-symbol-or-operator-in-linux-commands/ + +作者:[Avishek Kumar][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/avishek/ +[1]:http://www.tecmint.com/12-top-command-examples-in-linux/ \ No newline at end of file diff --git a/sources/tech/20150518 70 Expected Shell Scripting Interview Questions and Answers.md b/sources/tech/20150518 70 Expected Shell Scripting Interview Questions and Answers.md new file mode 100644 index 0000000000..27d28387c7 --- /dev/null +++ b/sources/tech/20150518 70 Expected Shell Scripting Interview Questions and Answers.md @@ -0,0 +1,399 @@ +70 Expected Shell Scripting Interview Questions & Answers +================================================================================ +We have selected expected 70 shell scripting question and answers for your interview preparation. Its really vital for all system admin to know scripting or atleast the basics which in turn helps to automate many tasks in your work environment. In the past few years we have seen that all linux job specification requires scripting skills. + +### 1) How to pass argument to a script ? ### + +./script argument + +**Example** : Script will show filename + +./show.sh file1.txt + + cat show.sh + #!/bin/bash + cat $1 + +### 2) How to use argument in a script ? ### + +First argument: $1, +Second argument : $2 + +Example : Script will copy file (arg1) to destination (arg2) + +./copy.sh file1.txt /tmp/ + + cat copy.sh + #!/bin/bash + cp $1 $2 + +### 3) How to calculate number of passed arguments ? ### + +$# + +### 4) How to get script name inside a script ? ### + +$0 + +### 5) How to check if previous command run successful ? ### + +$? + +### 6) How to get last line from a file ? ### + +tail -1 + +### 7) How to get first line from a file ? ### + +head -1 + +### 8) How to get 3rd element from each line from a file ? ### + +awk '{print $3}' + +### 9) How to get 2nd element from each line from a file, if first equal FIND ### + +awk '{ if ($1 == "FIND") print $2}' + +### 10) How to debug bash script ### + +Add -xv to #!/bin/bash + +Example + +#!/bin/bash –xv + +### 11) Give an example how to write function ? ### + +function example { +echo "Hello world!" +} + +### 12) How to add string to string ? ### + +V1="Hello" +V2="World" +V3=$V1+$V2 +echo $V3 + +Output + +Hello+World + +### 13) How to add two integers ? ### + +V1=1 +V2=2 +V3=$V1+$V2 +echo $V3 + +Output +3 + +### 14) How to check if file exist on filesystem ? ### + +if [ -f /var/log/messages ] +then +echo "File exists" +fi + +### 15) Write down syntax for all loops in shell scripting ? ### + +#### for loop : #### + +for i in $( ls ); do +echo item: $i +done + +#### while loop : #### + +#!/bin/bash +COUNTER=0 +while [ $COUNTER -lt 10 ]; do +echo The counter is $COUNTER +let COUNTER=COUNTER+1 +done + +until l#### ####oop : + +#!/bin/bash +COUNTER=20 +until [ $COUNTER -lt 10 ]; do +echo COUNTER $COUNTER +let COUNTER-=1 +done + +### 16) What it means by #!/bin/sh or #!/bin/bash at beginning of every script ? ### + +That line tells which shell to use. #!/bin/bash script to execute using /bin/bash. In case of python script there there will be #!/usr/bin/python + +### 17) How to get 10th line from the text file ? ### + +head -10 file|tail -1 + +### 18) What is the first symbol in the bash script file ### + +# + +### 19) What would be the output of command: [ -z "" ] && echo 0 || echo 1 ### + +0 + +### 20) What command "export" do ? ### + +Makes variable public in subshells + +### 21) How to run script in background ? ### + +add "&" to the end of script + +### 22) What "chmod 500 script" do ? ### + +Makes script executable for script owner + +### 23) What ">" do ? ### + +Redirects output stream to file or another stream. + +### 24) What difference between & and && ### + +& - we using it when want to put script to background +&& - when we wand to execute command/script if first script was finished successfully + +### 25) When we need "if" before [ condition ] ? ### + +When we need to run several commands if condition meets. + +### 26) What would be the output of the command: name=John && echo 'My name is $name' ### + +My name is $name + +### 27) Which is the symbol used for comments in bash shell scripting ? ### + +# + +### 28) What would be the output of command: echo ${new:-variable} ### + +variable + +### 29) What difference between ' and " quotes ? ### + +' - we use it when do not want to evaluate variables to the values +" - all variables will be evaluated and its values will be assigned instead. + +### 30) How to redirect stdout and stderr streams to log.txt file from script inside ? ### + +Add "exec >log.txt 2>&1" as the first command in the script + +### 31) How to get part of string variable with echo command only ? ### + +echo ${variable:x:y} +x - start position +y - length +example: +variable="My name is Petras, and I am developer." +echo ${variable:11:6} # will display Petras + +### 32) How to get home_dir with echo command only if string variable="User:123:321:/home/dir" is given ? ### + +echo ${variable#*:*:*:} +or +echo ${variable##*:} + +### 33) How to get “User” from the string above ? ### + +echo ${variable%:*:*:*} +or +echo ${variable%%:*} + +### 34) How to list users which UID less that 100 (awk) ? ### + +awk -F: '$3<100' /etc/passwd + +### 35) Write the program which counts unique primary groups for users and displays count and group name only ### + +cat /etc/passwd|cut -d: -f4|sort|uniq -c|while read c g +do +{ echo $c; grep :$g: /etc/group|cut -d: -f1;}|xargs -n 2 +done + +### 36) How to change standard field separator to ":" in bash shell ? ### + +IFS=":" + +### 37) How to get variable length ? ### + +${#variable} + +### 38) How to print last 5 characters of variable ? ### + +echo ${variable: -5} + +### 39) What difference between ${variable:-10} and ${variable: -10} ? ### + +${variable:-10} - gives 10 if variable was not assigned before +${variable: -10} - gives last 10 symbols of variable + +### 40) How to substitute part of string with echo command only ? ### + +echo ${variable//pattern/replacement} + +### 41) Which command replaces string to uppercase ? ### + +tr '[:lower:]' '[:upper:]' + +### 42) How to count local accounts ? ### + +wc -l /etc/passwd|cut -d" " -f1 +or +cat /etc/passwd|wc -l + +### 43) How to count words in a string without wc command ? ### + +set ${string} +echo $# + +### 44) Which one is correct "export $variable" or "export variable" ? ### + +export variable + +### 45) How to list files where second letter is a or b ? ### + +ls -d ?[ab]* + +### 46) How to add integers a to b and assign to c ? ### + +c=$((a+b)) +or +c=`expr $a + $b` +or +c=`echo "$a+$b"|bc` + +### 47) How to remove all spaces from the string ? ### + +echo $string|tr -d " " + +### 48) Rewrite the command to print the sentence and converting variable to plural: item="car"; echo "I like $item" ? ### + +item="car"; echo "I like ${item}s" + +### 49) Write the command which will print numbers from 0 to 100 and display every third (0 3 6 9 …) ? ### + +for i in {0..100..3}; do echo $i; done +or +for (( i=0; i<=100; i=i+3 )); do echo "Welcome $i times"; done + +### 50) How to print all arguments provided to the script ? ### + +echo $* +or +echo $@ + +### 51) What difference between [ $a == $b ] and [ $a -eq $b ] ### + +[ $a == $b ] - should be used for string comparison +[ $a -eq $b ] - should be used for number tests + +### 52) What difference between = and == ### + += - we using to assign value to variable +== - we using for string comparison + +### 53) Write the command to test if $a greater than 12 ? ### + +[ $a -gt 12 ] + +### 54) Write the command to test if $b les or equal 12 ? ### + +[ $b -le 12 ] + +### 55) How to check if string begins with "abc" letters ? ### + +[[ $string == abc* ]] + +### 56) What difference between [[ $string == abc* ]] and [[ $string == "abc* ]] ### + +[[ $string == abc* ]] - will check if string begins with abc letters +[[ $string == "abc*"" ]] - will check if string is equal exactly to abc* + +### 57) How to list usernames which starts with ab or xy ? ### + +egrep "^ab|^xy" /etc/passwd|cut -d: -f1 + +### 58) What $! means in bash ? ### + +Most recent background command PID + +### 59) What $? means ? ### + +Most recent foreground exit status. + +### 60) How to print PID of the current shell ? ### + +echo $$ + +### 61) How to get number of passed arguments to the script ? ### + +echo $# + +### 62) What difference between $* and $@ ### + +$* - gives all passed arguments to the script as a single string +$@ - gives all passed arguments to the script as delimited list. Delimiter $IFS + +### 63) How to define array in bash ? ### + +array=("Hi" "my" "name" "is") + +### 64) How to print the first array element ? ### + +echo ${array[0]} + +### 65) How to print all array elements ? ### + +echo ${array[@]} + +### 66) How to print all array indexes ? ### + +echo ${!array[@]} + +### 67) How to remove array element with id 2 ? ### + +unset array[2] + +### 68) How to add new array element with id 333 ? ### + +array[333]="New_element" + +### 69) How shell script get input values ? ### + +a) via parameters + +./script param1 param2 + +b) via read command + +read -p "Destination backup Server : " desthost + +### 70) How can we use "expect" command in a script ? ### + +/usr/bin/expect << EOD +spawn rsync -ar ${line} ${desthost}:${destpath} +expect "*?assword:*" +send "${password}\r" +expect eof +EOD + +Good luck !! Please comment below if you have any new query or need answers for your questions. Let us know how well this helped for your interview :-) + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/linux-shell-script/shell-scripting-interview-questions-answers/ + +作者:[Petras Liumparas][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://linoxide.com/author/petrasl/ \ No newline at end of file From c7cd7b425d81f19aa763b8fc1f0748496eb5e7fe Mon Sep 17 00:00:00 2001 From: ictlyh Date: Mon, 18 May 2015 17:04:23 +0800 Subject: [PATCH 066/965] [Translating] tech/20150518 70 Expected Shell Scripting Interview Questions and Answers --- ...0 Expected Shell Scripting Interview Questions and Answers.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20150518 70 Expected Shell Scripting Interview Questions and Answers.md b/sources/tech/20150518 70 Expected Shell Scripting Interview Questions and Answers.md index 27d28387c7..3d9b188bb1 100644 --- a/sources/tech/20150518 70 Expected Shell Scripting Interview Questions and Answers.md +++ b/sources/tech/20150518 70 Expected Shell Scripting Interview Questions and Answers.md @@ -1,3 +1,4 @@ +Translating by ictlyh 70 Expected Shell Scripting Interview Questions & Answers ================================================================================ We have selected expected 70 shell scripting question and answers for your interview preparation. Its really vital for all system admin to know scripting or atleast the basics which in turn helps to automate many tasks in your work environment. In the past few years we have seen that all linux job specification requires scripting skills. From e080a6a2623a90d722cf8e9d44399dbe1d2a0bb8 Mon Sep 17 00:00:00 2001 From: Gore Liu Date: Mon, 18 May 2015 18:32:24 +0800 Subject: [PATCH 067/965] [Translating] 20150205 Inxi--Find System And Hardware Information On Linux.md --- ...205 Inxi--Find System And Hardware Information On Linux.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150205 Inxi--Find System And Hardware Information On Linux.md b/sources/tech/20150205 Inxi--Find System And Hardware Information On Linux.md index efdc243fc6..09981ae74f 100644 --- a/sources/tech/20150205 Inxi--Find System And Hardware Information On Linux.md +++ b/sources/tech/20150205 Inxi--Find System And Hardware Information On Linux.md @@ -1,3 +1,5 @@ +Translating by goreliu ... + Inxi: Find System And Hardware Information On Linux ================================================================================ We already have shown different [applications][1] and ways to find the system and hardware information on Linux. In that series, today we will see how to find such details using **inxi**. It can be used for forum technical support, as a debugging tool, to quickly ascertain user system configuration and hardware. @@ -168,4 +170,4 @@ via: http://www.unixmen.com/inxi-find-system-hardware-information-linux/ 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 [a]:http://www.unixmen.com/author/sk/ -[1]:http://www.unixmen.com/screenfetch-bash-screenshot-information-tool/ \ No newline at end of file +[1]:http://www.unixmen.com/screenfetch-bash-screenshot-information-tool/ From df159f869923b3ffaac1ed059aa81bb6bf25a906 Mon Sep 17 00:00:00 2001 From: ictlyh Date: Mon, 18 May 2015 19:33:45 +0800 Subject: [PATCH 068/965] [Translated] tech/20150518 70 Expected Shell Scripting Interview Questions and Answers --- ...ripting Interview Questions and Answers.md | 400 ------------------ ...ripting Interview Questions and Answers.md | 399 +++++++++++++++++ 2 files changed, 399 insertions(+), 400 deletions(-) delete mode 100644 sources/tech/20150518 70 Expected Shell Scripting Interview Questions and Answers.md create mode 100644 translated/tech/20150518 70 Expected Shell Scripting Interview Questions and Answers.md diff --git a/sources/tech/20150518 70 Expected Shell Scripting Interview Questions and Answers.md b/sources/tech/20150518 70 Expected Shell Scripting Interview Questions and Answers.md deleted file mode 100644 index 3d9b188bb1..0000000000 --- a/sources/tech/20150518 70 Expected Shell Scripting Interview Questions and Answers.md +++ /dev/null @@ -1,400 +0,0 @@ -Translating by ictlyh -70 Expected Shell Scripting Interview Questions & Answers -================================================================================ -We have selected expected 70 shell scripting question and answers for your interview preparation. Its really vital for all system admin to know scripting or atleast the basics which in turn helps to automate many tasks in your work environment. In the past few years we have seen that all linux job specification requires scripting skills. - -### 1) How to pass argument to a script ? ### - -./script argument - -**Example** : Script will show filename - -./show.sh file1.txt - - cat show.sh - #!/bin/bash - cat $1 - -### 2) How to use argument in a script ? ### - -First argument: $1, -Second argument : $2 - -Example : Script will copy file (arg1) to destination (arg2) - -./copy.sh file1.txt /tmp/ - - cat copy.sh - #!/bin/bash - cp $1 $2 - -### 3) How to calculate number of passed arguments ? ### - -$# - -### 4) How to get script name inside a script ? ### - -$0 - -### 5) How to check if previous command run successful ? ### - -$? - -### 6) How to get last line from a file ? ### - -tail -1 - -### 7) How to get first line from a file ? ### - -head -1 - -### 8) How to get 3rd element from each line from a file ? ### - -awk '{print $3}' - -### 9) How to get 2nd element from each line from a file, if first equal FIND ### - -awk '{ if ($1 == "FIND") print $2}' - -### 10) How to debug bash script ### - -Add -xv to #!/bin/bash - -Example - -#!/bin/bash –xv - -### 11) Give an example how to write function ? ### - -function example { -echo "Hello world!" -} - -### 12) How to add string to string ? ### - -V1="Hello" -V2="World" -V3=$V1+$V2 -echo $V3 - -Output - -Hello+World - -### 13) How to add two integers ? ### - -V1=1 -V2=2 -V3=$V1+$V2 -echo $V3 - -Output -3 - -### 14) How to check if file exist on filesystem ? ### - -if [ -f /var/log/messages ] -then -echo "File exists" -fi - -### 15) Write down syntax for all loops in shell scripting ? ### - -#### for loop : #### - -for i in $( ls ); do -echo item: $i -done - -#### while loop : #### - -#!/bin/bash -COUNTER=0 -while [ $COUNTER -lt 10 ]; do -echo The counter is $COUNTER -let COUNTER=COUNTER+1 -done - -until l#### ####oop : - -#!/bin/bash -COUNTER=20 -until [ $COUNTER -lt 10 ]; do -echo COUNTER $COUNTER -let COUNTER-=1 -done - -### 16) What it means by #!/bin/sh or #!/bin/bash at beginning of every script ? ### - -That line tells which shell to use. #!/bin/bash script to execute using /bin/bash. In case of python script there there will be #!/usr/bin/python - -### 17) How to get 10th line from the text file ? ### - -head -10 file|tail -1 - -### 18) What is the first symbol in the bash script file ### - -# - -### 19) What would be the output of command: [ -z "" ] && echo 0 || echo 1 ### - -0 - -### 20) What command "export" do ? ### - -Makes variable public in subshells - -### 21) How to run script in background ? ### - -add "&" to the end of script - -### 22) What "chmod 500 script" do ? ### - -Makes script executable for script owner - -### 23) What ">" do ? ### - -Redirects output stream to file or another stream. - -### 24) What difference between & and && ### - -& - we using it when want to put script to background -&& - when we wand to execute command/script if first script was finished successfully - -### 25) When we need "if" before [ condition ] ? ### - -When we need to run several commands if condition meets. - -### 26) What would be the output of the command: name=John && echo 'My name is $name' ### - -My name is $name - -### 27) Which is the symbol used for comments in bash shell scripting ? ### - -# - -### 28) What would be the output of command: echo ${new:-variable} ### - -variable - -### 29) What difference between ' and " quotes ? ### - -' - we use it when do not want to evaluate variables to the values -" - all variables will be evaluated and its values will be assigned instead. - -### 30) How to redirect stdout and stderr streams to log.txt file from script inside ? ### - -Add "exec >log.txt 2>&1" as the first command in the script - -### 31) How to get part of string variable with echo command only ? ### - -echo ${variable:x:y} -x - start position -y - length -example: -variable="My name is Petras, and I am developer." -echo ${variable:11:6} # will display Petras - -### 32) How to get home_dir with echo command only if string variable="User:123:321:/home/dir" is given ? ### - -echo ${variable#*:*:*:} -or -echo ${variable##*:} - -### 33) How to get “User” from the string above ? ### - -echo ${variable%:*:*:*} -or -echo ${variable%%:*} - -### 34) How to list users which UID less that 100 (awk) ? ### - -awk -F: '$3<100' /etc/passwd - -### 35) Write the program which counts unique primary groups for users and displays count and group name only ### - -cat /etc/passwd|cut -d: -f4|sort|uniq -c|while read c g -do -{ echo $c; grep :$g: /etc/group|cut -d: -f1;}|xargs -n 2 -done - -### 36) How to change standard field separator to ":" in bash shell ? ### - -IFS=":" - -### 37) How to get variable length ? ### - -${#variable} - -### 38) How to print last 5 characters of variable ? ### - -echo ${variable: -5} - -### 39) What difference between ${variable:-10} and ${variable: -10} ? ### - -${variable:-10} - gives 10 if variable was not assigned before -${variable: -10} - gives last 10 symbols of variable - -### 40) How to substitute part of string with echo command only ? ### - -echo ${variable//pattern/replacement} - -### 41) Which command replaces string to uppercase ? ### - -tr '[:lower:]' '[:upper:]' - -### 42) How to count local accounts ? ### - -wc -l /etc/passwd|cut -d" " -f1 -or -cat /etc/passwd|wc -l - -### 43) How to count words in a string without wc command ? ### - -set ${string} -echo $# - -### 44) Which one is correct "export $variable" or "export variable" ? ### - -export variable - -### 45) How to list files where second letter is a or b ? ### - -ls -d ?[ab]* - -### 46) How to add integers a to b and assign to c ? ### - -c=$((a+b)) -or -c=`expr $a + $b` -or -c=`echo "$a+$b"|bc` - -### 47) How to remove all spaces from the string ? ### - -echo $string|tr -d " " - -### 48) Rewrite the command to print the sentence and converting variable to plural: item="car"; echo "I like $item" ? ### - -item="car"; echo "I like ${item}s" - -### 49) Write the command which will print numbers from 0 to 100 and display every third (0 3 6 9 …) ? ### - -for i in {0..100..3}; do echo $i; done -or -for (( i=0; i<=100; i=i+3 )); do echo "Welcome $i times"; done - -### 50) How to print all arguments provided to the script ? ### - -echo $* -or -echo $@ - -### 51) What difference between [ $a == $b ] and [ $a -eq $b ] ### - -[ $a == $b ] - should be used for string comparison -[ $a -eq $b ] - should be used for number tests - -### 52) What difference between = and == ### - -= - we using to assign value to variable -== - we using for string comparison - -### 53) Write the command to test if $a greater than 12 ? ### - -[ $a -gt 12 ] - -### 54) Write the command to test if $b les or equal 12 ? ### - -[ $b -le 12 ] - -### 55) How to check if string begins with "abc" letters ? ### - -[[ $string == abc* ]] - -### 56) What difference between [[ $string == abc* ]] and [[ $string == "abc* ]] ### - -[[ $string == abc* ]] - will check if string begins with abc letters -[[ $string == "abc*"" ]] - will check if string is equal exactly to abc* - -### 57) How to list usernames which starts with ab or xy ? ### - -egrep "^ab|^xy" /etc/passwd|cut -d: -f1 - -### 58) What $! means in bash ? ### - -Most recent background command PID - -### 59) What $? means ? ### - -Most recent foreground exit status. - -### 60) How to print PID of the current shell ? ### - -echo $$ - -### 61) How to get number of passed arguments to the script ? ### - -echo $# - -### 62) What difference between $* and $@ ### - -$* - gives all passed arguments to the script as a single string -$@ - gives all passed arguments to the script as delimited list. Delimiter $IFS - -### 63) How to define array in bash ? ### - -array=("Hi" "my" "name" "is") - -### 64) How to print the first array element ? ### - -echo ${array[0]} - -### 65) How to print all array elements ? ### - -echo ${array[@]} - -### 66) How to print all array indexes ? ### - -echo ${!array[@]} - -### 67) How to remove array element with id 2 ? ### - -unset array[2] - -### 68) How to add new array element with id 333 ? ### - -array[333]="New_element" - -### 69) How shell script get input values ? ### - -a) via parameters - -./script param1 param2 - -b) via read command - -read -p "Destination backup Server : " desthost - -### 70) How can we use "expect" command in a script ? ### - -/usr/bin/expect << EOD -spawn rsync -ar ${line} ${desthost}:${destpath} -expect "*?assword:*" -send "${password}\r" -expect eof -EOD - -Good luck !! Please comment below if you have any new query or need answers for your questions. Let us know how well this helped for your interview :-) - --------------------------------------------------------------------------------- - -via: http://linoxide.com/linux-shell-script/shell-scripting-interview-questions-answers/ - -作者:[Petras Liumparas][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://linoxide.com/author/petrasl/ \ No newline at end of file diff --git a/translated/tech/20150518 70 Expected Shell Scripting Interview Questions and Answers.md b/translated/tech/20150518 70 Expected Shell Scripting Interview Questions and Answers.md new file mode 100644 index 0000000000..b5ccd63e0a --- /dev/null +++ b/translated/tech/20150518 70 Expected Shell Scripting Interview Questions and Answers.md @@ -0,0 +1,399 @@ +70 个可能的 Shell 脚本面试问题及解答 +================================================================================ +我们为你的面试准备选择了 70 个可能的 shell 脚面问题及解答。了解脚本或至少知道基础知识对系统管理员来说至关重要,它也有助于你在工作环境中自动完成很多任务。在过去的几年里,我们注意到所有的 linux 工作职位都要求脚本技能。 + +### 1) 如何向脚本传递参数 ? ### + +./script argument + +**例子** : 显示文件名称脚本 + +./show.sh file1.txt + + cat show.sh + #!/bin/bash + cat $1 + +### 2) 如何在脚本中使用参数 ? ### + +第一个参数: $1, +第二个参数 : $2 + +例子 : 脚本会复制文件(arg1) 到目标地址(arg2) + +./copy.sh file1.txt /tmp/ + + cat copy.sh + #!/bin/bash + cp $1 $2 + +### 3) 如何计算传递进来的参数 ? ### + +$# + +### 4) 如何在脚本中获取脚本名称 ? ### + +$0 + +### 5) 如何检查之前的命令是否运行成功 ? ### + +$? + +### 6) 如何获取文件的最后一行 ? ### + +tail -1 + +### 7) 如何获取文件的第一行 ? ### + +head -1 + +### 8) 如何获取一个文件每一行的第三个元素 ? ### + +awk '{print $3}' + +### 9) 假如第一个等于 FIND,如何获取文件中每行的第二个元素 ### + +awk '{ if ($1 == "FIND") print $2}' + +### 10) 如何调试 bash 脚本 ### + +Add -xv to #!/bin/bash + +例子 + +#!/bin/bash –xv + +### 11) 举例如何写一个函数 ? ### + +function example { +echo "Hello world!" +} + +### 12) 如何向 string 添加 string ? ### + +V1="Hello" +V2="World" +V3=$V1+$V2 +echo $V3 + +Output + +Hello+World + +### 13) 如何进行两个整数相加 ? ### + +V1=1 +V2=2 +V3=$V1+$V2 +echo $V3 + +Output +3 + +### 14) 如何检查文件系统中是否存在某个文件 ? ### + +if [ -f /var/log/messages ] +then +echo "File exists" +fi + +### 15) 写出 shell 脚本中所有循环语法 ? ### + +#### for loop : #### + +for i in $( ls ); do +echo item: $i +done + +#### while loop : #### + +#!/bin/bash +COUNTER=0 +while [ $COUNTER -lt 10 ]; do +echo The counter is $COUNTER +let COUNTER=COUNTER+1 +done + +#### untill oop : #### + +#!/bin/bash +COUNTER=20 +until [ $COUNTER -lt 10 ]; do +echo COUNTER $COUNTER +let COUNTER-=1 +done + +### 16) 每个脚本开始的 #!/bin/sh 或 #!/bin/bash 表示什么意思 ? ### + +这一行说明要使用的 shell。#!/bin/bash 表示脚本使用 /bin/bash。对于 python 脚本,就是 #!/usr/bin/python + +### 17) 如何获取文本文件的第 10 行 ? ### + +head -10 file|tail -1 + +### 18) bash 脚本文件的第一个符号是什么 ### + +# + +### 19) 命令:[ -z "" ] && echo 0 || echo 1 的输出是什么 ### + +0 + +### 20) 命令 “export” 有什么用 ? ### + +使变量在子 shell 中公有 + +### 21) 如何在后台运行脚本 ? ### + +在脚本后面添加 “&” + +### 22) "chmod 500 script" 做什么 ? ### + +使脚本所有者拥有可执行权限 + +### 23) ">" 做什么 ? ### + +重定向输出流到文件或另一个流。 + +### 24) & 和 && 有什么区别 ### + +& - 希望脚本在后台运行的时候使用它 +&& - 当第一个脚本成功完成才执行命令/脚本的时候使用它 + +### 25) 什么时候要在 [ condition ] 之前使用 “if” ? ### + +当条件满足时需要运行多条命令的时候。 + +### 26) 命令: name=John && echo 'My name is $name' 的输出是什么 ### + +My name is $name + +### 27) bash shell 脚本中哪个符号用于注释 ? ### + +# + +### 28) 命令: echo ${new:-variable} 的输出是什么 ### + +variable + +### 29) ' 和 " 引号有什么区别 ? ### + +' - 当我们不希望把变量转换为值的时候使用它。 +" - 会计算所有变量的值并用值代替。 + +### 30) 如何在脚本文件中重定向标准输入输出流到 log.txt 文件 ? ### + +在脚本文件中添加 "exec >log.txt 2>&1" 命令 + +### 31) 如何只用 echo 命令获取 string 变量的一部分 ? ### + +echo ${variable:x:y} +x - 起始位置 +y - 长度 +例子: +variable="My name is Petras, and I am developer." +echo ${variable:11:6} # 会显示 Petras + +### 32) 如果给定字符串 variable="User:123:321:/home/dir" 如何只用 echo 命令获取 home_dir ? ### + +echo ${variable#*:*:*:} +或 +echo ${variable##*:} + +### 33) 如何从上面的字符串中获取 “User” ? ### + +echo ${variable%:*:*:*} +或 +echo ${variable%%:*} + +### 34) 如何使用 awk 列出 UID 小于 100 的用户 ? ### + +awk -F: '$3<100' /etc/passwd + +### 35) 写程序为用户计算主组数目并显示次数和组名 ### + +cat /etc/passwd|cut -d: -f4|sort|uniq -c|while read c g +do +{ echo $c; grep :$g: /etc/group|cut -d: -f1;}|xargs -n 2 +done + +### 36) 如何在 bash shell 中更改标注域分隔符为 ":" ? ### + +IFS=":" + +### 37) 如何获取变量长度 ? ### + +${#variable} + +### 38) 如何打印变量的最后 5 个字符 ? ### + +echo ${variable: -5} + +### 39) ${variable:-10} 和 ${variable: -10} 有什么区别? ### + +${variable:-10} - 如果之前没有给 variable 赋值则输出 10 +${variable: -10} - 输出 variable 的最后 10 个字符 + +### 40) 如何只用 echo 命令替换字符串的一部分 ? ### + +echo ${variable//pattern/replacement} + +### 41) 哪个命令将命令替换为大写 ? ### + +tr '[:lower:]' '[:upper:]' + +### 42) 如何计算本地用户数目 ? ### + +wc -l /etc/passwd|cut -d" " -f1 +或者 +cat /etc/passwd|wc -l + +### 43) 不用 wc 命令如何计算字符串中的单词数目 ? ### + +set ${string} +echo $# + +### 44) "export $variable" 或 "export variable" 哪个正确 ? ### + +export variable + +### 45) 如何列出第二个字母是 a 或 b 的文件 ? ### + +ls -d ?[ab]* + +### 46) 如何将整数 a 加到 b 并赋值给 c ? ### + +c=$((a+b)) +或 +c=`expr $a + $b` +或 +c=`echo "$a+$b"|bc` + +### 47) 如何去除字符串中的所有空格 ? ### + +echo $string|tr -d " " + +### 48) 重写命令输出变量转换为复数的句子: item="car"; echo "I like $item" ? ### + +item="car"; echo "I like ${item}s" + +### 49) 写出输出数字 0 到 100 中 3 的倍数(0 3 6 9 …)的命令 ? ### + +for i in {0..100..3}; do echo $i; done +或 +for (( i=0; i<=100; i=i+3 )); do echo "Welcome $i times"; done + +### 50) 如何打印传递给脚本的所有参数 ? ### + +echo $* +或 +echo $@ + +### 51) [ $a == $b ] 和 [ $a -eq $b ] 有什么区别 ### + +[ $a == $b ] - 用于字符串比较 +[ $a -eq $b ] - 用于数字比较 + +### 52) = 和 == 有什么区别 ### + += - 用于为变量复制 +== - 用于字符串比较 + +### 53) 写出测试 $a 是否大于 12 的命令 ? ### + +[ $a -gt 12 ] + +### 54) 写出测试 $b 是否小于等于 12 的命令 ? ### + +[ $b -le 12 ] + +### 55) 如何检查字符串是否以字母 "abc" 开头 ? ### + +[[ $string == abc* ]] + +### 56) [[ $string == abc* ]] 和 [[ $string == "abc*" ]] 有什么区别 ### + +[[ $string == abc* ]] - 检查字符串是否以字母 abc 开头 +[[ $string == "abc* " ]] - 检查字符串是否完全等于 abc* + +### 57) 如何列出以 ab 或 xy 开头的用户名 ? ### + +egrep "^ab|^xy" /etc/passwd|cut -d: -f1 + +### 58) bash 中 $! 表示什么意思 ? ### + +后台最近命令的 PID + +### 59) $? 表示什么意思 ? ### + +前台最近命令的结束状态 + +### 60) 如何输出当前 shell 的 PID ? ### + +echo $$ + +### 61) 如何获取传递给脚本的参数数目 ? ### + +echo $# + +### 62) $* 和 $@ 有什么区别 ### + +$* - 以一个字符串形式输出所有传递到脚本的参数 +$@ - 以 $IFS 为分隔符列出所有传递到脚本中的参数 + +### 63) 如何在 bash 中定义数组 ? ### + +array=("Hi" "my" "name" "is") + +### 64) 如何打印数组的第一个元素 ? ### + +echo ${array[0]} + +### 65) 如何打印数组的所有元素 ? ### + +echo ${array[@]} + +### 66) 如何输出所有数组索引 ? ### + +echo ${!array[@]} + +### 67) 如何移除数组中索引为 2 的元素 ? ### + +unset array[2] + +### 68) 如何在数组中添加 id 为 333 的元素 ? ### + +array[333]="New_element" + +### 69) shell 脚本如何获取输入的值 ? ### + +a) 通过参数 + +./script param1 param2 + +b) 通过 read 命令 + +read -p "Destination backup Server : " desthost + +### 70) 在脚本中如何使用 "expect" ? ### + +/usr/bin/expect << EOD +spawn rsync -ar ${line} ${desthost}:${destpath} +expect "*?assword:*" +send "${password}\r" +expect eof +EOD + +好运 !! 如果你有任何疑问或者问题需要解答都可以在下面的评论框中写下来。让我们知道这对你的面试有所帮助:-) + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/linux-shell-script/shell-scripting-interview-questions-answers/ + +作者:[Petras Liumparas][a] +译者:[ictlyh](https://github.com/ictlyh) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://linoxide.com/author/petrasl/ \ No newline at end of file From 5abc1187f6dd9370fd51ed263e604316ec8988b3 Mon Sep 17 00:00:00 2001 From: Gore Liu Date: Mon, 18 May 2015 19:34:59 +0800 Subject: [PATCH 069/965] [Translated] 20150205 Inxi--Find System And Hardware Information On Linux.md --- ...ystem And Hardware Information On Linux.md | 345 +++++++++--------- 1 file changed, 172 insertions(+), 173 deletions(-) rename {sources => translated}/tech/20150205 Inxi--Find System And Hardware Information On Linux.md (65%) diff --git a/sources/tech/20150205 Inxi--Find System And Hardware Information On Linux.md b/translated/tech/20150205 Inxi--Find System And Hardware Information On Linux.md similarity index 65% rename from sources/tech/20150205 Inxi--Find System And Hardware Information On Linux.md rename to translated/tech/20150205 Inxi--Find System And Hardware Information On Linux.md index 09981ae74f..7b7b148413 100644 --- a/sources/tech/20150205 Inxi--Find System And Hardware Information On Linux.md +++ b/translated/tech/20150205 Inxi--Find System And Hardware Information On Linux.md @@ -1,173 +1,172 @@ -Translating by goreliu ... - -Inxi: Find System And Hardware Information On Linux -================================================================================ -We already have shown different [applications][1] and ways to find the system and hardware information on Linux. In that series, today we will see how to find such details using **inxi**. It can be used for forum technical support, as a debugging tool, to quickly ascertain user system configuration and hardware. - -**Inxi** is a command line tool that can be used to find the complete system and hardware details such as; - -- Hardware, -- CPU, -- Drivers, -- Xorg, -- Desktop, -- Kernel, -- GCC version, -- Processes, -- RAM usage, -- and other useful information. - -### Installation ### - -Inxi is available in the default repositories of most modern GNU/Linux operating systems. So, we can simply install it by running the following commands. - -**On Debian based system:** - - sudo apt-get install inxi - -**On Fedora:** - - sudo yum install inxi - -**On RHEL based systems:** - -Install EPEL repository: - - sudo yum install epel-release - -Then, install inxi using command: - - sudo yum install inxi - -### Usage ### - -To find the quick view of the system information, run the following command from Terminal. - - inxi - -**Sample output:** - - CPU~Dual core Intel Core i3-2350M CPU (-HT-MCP-) clocked at Min:800.000Mhz Max:1200.000Mhz Kernel~3.13.0-45-generic x86_64 Up~6:41 Mem~1537.7/3861.3MB HDD~500.1GB(52.5% used) Procs~183 Client~Shell inxi~1.9.17 - -Ofcourse, we can retrieve a particular hardware details. For example to retrieve the **Audio/Sound hardware details**, run the following command: - - inxi -A - -**Sample output:** - - Audio: Card: Intel 6 Series/C200 Series Family High Definition Audio Controller driver: snd_hda_intel - Sound: Advanced Linux Sound Architecture ver: k3.13.0-45-generic - -Cool, isn’t it? - -Likewise, you can retrieve the details of **Graphic card** information. - - inxi -G - -**Sample output:** - - Graphics: Card: Intel 2nd Generation Core Processor Family Integrated Graphics Controller - X.Org: 1.15.1 drivers: intel (unloaded: fbdev,vesa) Resolution: 1366x768@60.0hz - GLX Renderer: Mesa DRI Intel Sandybridge Mobile GLX Version: 3.0 Mesa 10.3.0 - -What about harddisk information? That’s also possible. To view the full **harddisk** information, run the following command. - - inxi -D - -**Sample Output:** - - Drives: HDD Total Size: 500.1GB (52.5% used) 1: id: /dev/sda model: ST9601325BD size: 500.1GB - -To display the Bios and Motherboard details: - - inxi -M - -**Sample output:** - - Machine: System: Dell (portable) product: Inspiron N5050 - Mobo: Dell model: 01HXXJ version: A05 Bios: Dell version: A05 date: 08/03/2012 - -Not only hardware details, it can also displays the **list of available repositories** in our system. - - inxi -r - -**Sample output:** - - Repos: Active apt sources in file: /etc/apt/sources.list - deb http://ubuntu.excellmedia.net/archive/ trusty main restricted - deb-src http://ubuntu.excellmedia.net/archive/ trusty main restricted - deb http://ubuntu.excellmedia.net/archive/ trusty-updates main restricted - deb-src http://ubuntu.excellmedia.net/archive/ trusty-updates main restricted - deb http://ubuntu.excellmedia.net/archive/ trusty universe - . - . - Active apt sources in file: /etc/apt/sources.list.d/intellinuxgraphics.list - deb https://download.01.org/gfx/ubuntu/14.04/main trusty main #Intel Graphics drivers - Active apt sources in file: /etc/apt/sources.list.d/linrunner-tlp-trusty.list - Active apt sources in file: /etc/apt/sources.list.d/wseverin-ppa-trusty.list - deb http://ppa.launchpad.net/wseverin/ppa/ubuntu trusty main - -Inxi will also display the Weather details of your location. Surprised? Yes, It should. - - inxi -W Erode,Tamilnadu - -Here **Erode** is the District and **Tamilnadu** is a state in India. - -Sample output: - - Weather: Conditions: 79 F (26 C) - Clear Time: February 4, 6:00 PM IST - -### Viewing Complete Hardware details ### - -Tired of finding each hardware details? Well, you can list all details at once using command: - - inxi -F - -**Sample output:** - - System: Host: sk Kernel: 3.13.0-45-generic x86_64 (64 bit) Desktop: LXDE (Openbox 3.5.2) Distro: Ubuntu 14.04 trusty - Machine: System: Dell (portable) product: Inspiron N5050 - Mobo: Dell model: 01HXXJ version: A05 Bios: Dell version: A05 date: 08/03/2012 - CPU: Dual core Intel Core i3-2350M CPU (-HT-MCP-) cache: 3072 KB flags: (lm nx sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx) - Clock Speeds: 1: 800.00 MHz 2: 1000.00 MHz 3: 800.00 MHz 4: 800.00 MHz - Graphics: Card: Intel 2nd Generation Core Processor Family Integrated Graphics Controller - X.Org: 1.15.1 drivers: intel (unloaded: fbdev,vesa) Resolution: 1366x768@60.0hz - GLX Renderer: Mesa DRI Intel Sandybridge Mobile GLX Version: 3.0 Mesa 10.3.0 - Audio: Card: Intel 6 Series/C200 Series Family High Definition Audio Controller driver: snd_hda_intel - Sound: Advanced Linux Sound Architecture ver: k3.13.0-45-generic - Network: Card-1: Qualcomm Atheros AR9285 Wireless Network Adapter (PCI-Express) driver: ath9k - IF: wlan0 state: up mac: - Card-2: Realtek RTL8101E/RTL8102E PCI Express Fast Ethernet controller driver: r8169 - IF: eth0 state: down mac: - Drives: HDD Total Size: 500.1GB (52.5% used) 1: id: /dev/sda model: ST9500325AS size: 500.1GB - Partition: ID: / size: 455G used: 245G (57%) fs: ext4 ID: /boot size: 236M used: 159M (72%) fs: ext2 - ID: swap-1 size: 4.19GB used: 0.00GB (0%) fs: swap - RAID: No RAID devices detected - /proc/mdstat and md_mod kernel raid module present - Sensors: System Temperatures: cpu: 64.5C mobo: N/A - Fan Speeds (in rpm): cpu: N/A - Info: Processes: 186 Uptime: 6:52 Memory: 1547.2/3861.3MB Client: Shell (bash) inxi: 1.9.17 - -As you see in the above, inxi displays the complete hardware details. - -For more details, refer the man pages. - - man inxi - -### Conclusion ### - -Are you searching for a simple tool which displays your complete system and hardware details? Then, don’t look anywhere, inxi will give you what actually want. And, it is light weight tool available in your default repositories. What else you want more? Give it a try, you won’t be disappointed. - -Cheers! - --------------------------------------------------------------------------------- - -via: http://www.unixmen.com/inxi-find-system-hardware-information-linux/ - -作者:[SK][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://www.unixmen.com/author/sk/ -[1]:http://www.unixmen.com/screenfetch-bash-screenshot-information-tool/ +Inxi——获取Linux的系统和硬件信息 +================================================================================ + +我们已经展示了一些不同的[应用程序][1]和方法来获取Linux的系统和硬件信息。在这一系列,我们将看到如何使用**inxi**来获取这些详情信息。在论坛技术支持中,它可以作为调试工具,迅速确定用户的系统配置和硬件信息。 + +**Inxi**是一个可以获取完整的系统和硬件详情信息的命令行工具,内容包括: + +- 硬件 +- CPU +- 磁盘驱动器 +- Xorg +- 桌面环境 +- 内核 +- GCC版本 +- 进程 +- 内存占用 +- 和其他有用的信息 + +### 安装方法 ### + +Inxi在多数现代GNU/Linux操作系统的默认软件仓库中。所以我们可以简单地运行下列命令安装。 + +**在基于Debian的发行版:** + + sudo apt-get install inxi + +**在Fedora:** + + sudo yum install inxi + +**在基于RHEL的发行版:** + +安装EPEL软件仓库: + + sudo yum install epel-release + +然后使用如下命令安装inxi: + + sudo yum install inxi + +### 使用方法 ### + +在终端运行如下命令可以获取系统的概况信息。 + + inxi + +**示例输出:** + + CPU~Dual core Intel Core i3-2350M CPU (-HT-MCP-) clocked at Min:800.000Mhz Max:1200.000Mhz Kernel~3.13.0-45-generic x86_64 Up~6:41 Mem~1537.7/3861.3MB HDD~500.1GB(52.5% used) Procs~183 Client~Shell inxi~1.9.17 + +当然,我们可以获取一个特定硬件的详情信息。比如获取**声音/音频硬件详情信息**,可以运行如下命令: + + inxi -A + +**示例输出:** + + Audio: Card: Intel 6 Series/C200 Series Family High Definition Audio Controller driver: snd_hda_intel + Sound: Advanced Linux Sound Architecture ver: k3.13.0-45-generic + +很酷是吧? + +同样的,你可以获取**显卡**的详情信息。 + + inxi -G + +**示例输出:** + + Graphics: Card: Intel 2nd Generation Core Processor Family Integrated Graphics Controller + X.Org: 1.15.1 drivers: intel (unloaded: fbdev,vesa) Resolution: 1366x768@60.0hz + GLX Renderer: Mesa DRI Intel Sandybridge Mobile GLX Version: 3.0 Mesa 10.3.0 + +硬盘信息呢?也是可以的。运行如下命令来获取完整的**硬盘**信息。 + + inxi -D + +**示例输出:** + + Drives: HDD Total Size: 500.1GB (52.5% used) 1: id: /dev/sda model: ST9601325BD size: 500.1GB + +显示Bios和主板详情信息: + + inxi -M + +**示例输出:** + + Machine: System: Dell (portable) product: Inspiron N5050 + Mobo: Dell model: 01HXXJ version: A05 Bios: Dell version: A05 date: 08/03/2012 + +不只有硬性详情信息,它也可以显示我们系统中的**可用软件仓库列表**。 + + inxi -r + +**示例输出:** + + Repos: Active apt sources in file: /etc/apt/sources.list + deb http://ubuntu.excellmedia.net/archive/ trusty main restricted + deb-src http://ubuntu.excellmedia.net/archive/ trusty main restricted + deb http://ubuntu.excellmedia.net/archive/ trusty-updates main restricted + deb-src http://ubuntu.excellmedia.net/archive/ trusty-updates main restricted + deb http://ubuntu.excellmedia.net/archive/ trusty universe + . + . + Active apt sources in file: /etc/apt/sources.list.d/intellinuxgraphics.list + deb https://download.01.org/gfx/ubuntu/14.04/main trusty main #Intel Graphics drivers + Active apt sources in file: /etc/apt/sources.list.d/linrunner-tlp-trusty.list + Active apt sources in file: /etc/apt/sources.list.d/wseverin-ppa-trusty.list + deb http://ppa.launchpad.net/wseverin/ppa/ubuntu trusty main + +Inxi还可以显示你所在位置的天气信息。感到意外吗?是的,它可以。 + + inxi -W Erode,Tamilnadu + +这里**Erode**是区,**Tamilnadu**是印度的一个邦。 + +示例输出: + + Weather: Conditions: 79 F (26 C) - Clear Time: February 4, 6:00 PM IST + +### 查看完整的硬件详情信息 ### + +厌倦了获取每种硬件的信息?你可以使用如下命令将所有信息一次列出: + + inxi -F + +**示例输出:** + + System: Host: sk Kernel: 3.13.0-45-generic x86_64 (64 bit) Desktop: LXDE (Openbox 3.5.2) Distro: Ubuntu 14.04 trusty + Machine: System: Dell (portable) product: Inspiron N5050 + Mobo: Dell model: 01HXXJ version: A05 Bios: Dell version: A05 date: 08/03/2012 + CPU: Dual core Intel Core i3-2350M CPU (-HT-MCP-) cache: 3072 KB flags: (lm nx sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx) + Clock Speeds: 1: 800.00 MHz 2: 1000.00 MHz 3: 800.00 MHz 4: 800.00 MHz + Graphics: Card: Intel 2nd Generation Core Processor Family Integrated Graphics Controller + X.Org: 1.15.1 drivers: intel (unloaded: fbdev,vesa) Resolution: 1366x768@60.0hz + GLX Renderer: Mesa DRI Intel Sandybridge Mobile GLX Version: 3.0 Mesa 10.3.0 + Audio: Card: Intel 6 Series/C200 Series Family High Definition Audio Controller driver: snd_hda_intel + Sound: Advanced Linux Sound Architecture ver: k3.13.0-45-generic + Network: Card-1: Qualcomm Atheros AR9285 Wireless Network Adapter (PCI-Express) driver: ath9k + IF: wlan0 state: up mac: + Card-2: Realtek RTL8101E/RTL8102E PCI Express Fast Ethernet controller driver: r8169 + IF: eth0 state: down mac: + Drives: HDD Total Size: 500.1GB (52.5% used) 1: id: /dev/sda model: ST9500325AS size: 500.1GB + Partition: ID: / size: 455G used: 245G (57%) fs: ext4 ID: /boot size: 236M used: 159M (72%) fs: ext2 + ID: swap-1 size: 4.19GB used: 0.00GB (0%) fs: swap + RAID: No RAID devices detected - /proc/mdstat and md_mod kernel raid module present + Sensors: System Temperatures: cpu: 64.5C mobo: N/A + Fan Speeds (in rpm): cpu: N/A + Info: Processes: 186 Uptime: 6:52 Memory: 1547.2/3861.3MB Client: Shell (bash) inxi: 1.9.17 + +就像上面你看到的那样,inxi显示出了完整的硬件详情信息。 + +更多的细节可以参考man手册。 + + man inxi + +### 结论 ### + +你在寻找一个可以显示完整的系统和硬件详情信息的简单工具吗?那么不用再找了,inxi会提供你所需要的。并且,它还是在你系统默认的软件仓库中的轻量级工具。你还想要更多东西吗?试一试它,你不会失望。 + +欢呼吧! + +-------------------------------------------------------------------------------- + +via: http://www.unixmen.com/inxi-find-system-hardware-information-linux/ + +作者:[SK][a] +译者:[goreliu](https://github.com/goreliu) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://www.unixmen.com/author/sk/ +[1]:http://www.unixmen.com/screenfetch-bash-screenshot-information-tool/ From 0ad77a5df2909f13de1518aa9e1e134203df7492 Mon Sep 17 00:00:00 2001 From: Gore Liu Date: Mon, 18 May 2015 19:46:16 +0800 Subject: [PATCH 070/965] [Translating] 20150205 zBackup--A versatile deduplicating backup tool.md --- ...20150205 zBackup--A versatile deduplicating backup tool.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150205 zBackup--A versatile deduplicating backup tool.md b/sources/tech/20150205 zBackup--A versatile deduplicating backup tool.md index 62eee8521c..82f8bf199a 100644 --- a/sources/tech/20150205 zBackup--A versatile deduplicating backup tool.md +++ b/sources/tech/20150205 zBackup--A versatile deduplicating backup tool.md @@ -1,3 +1,5 @@ +Translating by goreliu ... + zBackup – A versatile deduplicating backup tool ================================================================================ zbackup is a globally-deduplicating backup tool, based on the ideas found in rsync. Feed a large .tar into it, and it will store duplicate regions of it only once, then compress and optionally encrypt the result. Feed another .tar file, and it will also re-use any data found in any previous backups. This way only new changes are stored, and as long as the files are not very different, the amount of storage required is very low. Any of the backup files stored previously can be read back in full at any time. @@ -60,4 +62,4 @@ via: http://www.ubuntugeek.com/zbackup-a-versatile-deduplicating-backup-tool.htm 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 -[a]:http://www.ubuntugeek.com/author/ubuntufix \ No newline at end of file +[a]:http://www.ubuntugeek.com/author/ubuntufix From 5c2e00ec96fe0b36ce5900c1584493b10daa8dcb Mon Sep 17 00:00:00 2001 From: Gore Liu Date: Mon, 18 May 2015 21:48:04 +0800 Subject: [PATCH 071/965] [Translated] 20150205 zBackup--A versatile deduplicating backup tool.md --- ...--A versatile deduplicating backup tool.md | 65 ------------------- ...--A versatile deduplicating backup tool.md | 63 ++++++++++++++++++ 2 files changed, 63 insertions(+), 65 deletions(-) delete mode 100644 sources/tech/20150205 zBackup--A versatile deduplicating backup tool.md create mode 100644 translated/tech/20150205 zBackup--A versatile deduplicating backup tool.md diff --git a/sources/tech/20150205 zBackup--A versatile deduplicating backup tool.md b/sources/tech/20150205 zBackup--A versatile deduplicating backup tool.md deleted file mode 100644 index 82f8bf199a..0000000000 --- a/sources/tech/20150205 zBackup--A versatile deduplicating backup tool.md +++ /dev/null @@ -1,65 +0,0 @@ -Translating by goreliu ... - -zBackup – A versatile deduplicating backup tool -================================================================================ -zbackup is a globally-deduplicating backup tool, based on the ideas found in rsync. Feed a large .tar into it, and it will store duplicate regions of it only once, then compress and optionally encrypt the result. Feed another .tar file, and it will also re-use any data found in any previous backups. This way only new changes are stored, and as long as the files are not very different, the amount of storage required is very low. Any of the backup files stored previously can be read back in full at any time. - -### zBackup Features ### - -Parallel LZMA or LZO compression of the stored data -Built-in AES encryption of the stored data -Possibility to delete old backup data -Use of a 64-bit rolling hash, keeping the amount of soft collisions to zero -Repository consists of immutable files. No existing files are ever modified -Written in C++ only with only modest library dependencies -Safe to use in production -Possibility to exchange data between repos without recompression - -### Install zBackup in ubuntu ### - -Open the terminal and run the following command - - sudo apt-get install zbackup - -### Using zBackup ### - -zbackup init initializes a backup repository for the backup files to be stored. - - zbackup init [--non-encrypted] [--password-file ~/.my_backup_password ] /my/backup/repo - -zbackup backup backups a tar file generated by tar c to the repository initialized using zbackup init - - zbackup [--password-file ~/.my_backup_password ] [--threads number_of_threads ] backup /my/backup/repo/backups/backup-`date ‘+%Y-%m-%d'` - -zbackup restore restores the backup file to a tar file. - - zbackup [--password-file ~/.my_backup_password [--cache-size cache_size_in_mb restore /my/backup/repo/backups/backup-`date ‘+%Y-%m-%d'` > /my/precious/backup-restored.tar - -### Available Options ### - -- -non-encrypted -- Do not encrypt the backup repository. -- --password-file ~/.my_backup_password -- Use the password file specified at ~/.my_backup_password to encrypt the repository and backup file, or to decrypt the backup file. -- --threads number_of_threads -- Limit the partial LZMA compression to number_of_threads needed. Recommended for 32-bit architectures. -- --cache-size cache_size_in_mb -- Use the cache size provided by cache_size_in_mb to speed up the restoration process. - -### zBackup files ### - -~/.my_backup_password Used to encrypt the repository and backup file, or to decrypt the backup file. See zbackup for further details. - -/my/backup/repo The directory used to hold the backup repository. - -/my/precious/restored-tar The tar used for restoring the backup. - -/my/backup/repo/backups/backup-`date ‘+%Y-%m-%d'` Specifies the backup file. - --------------------------------------------------------------------------------- - -via: http://www.ubuntugeek.com/zbackup-a-versatile-deduplicating-backup-tool.html - -作者:[ruchi][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://www.ubuntugeek.com/author/ubuntufix diff --git a/translated/tech/20150205 zBackup--A versatile deduplicating backup tool.md b/translated/tech/20150205 zBackup--A versatile deduplicating backup tool.md new file mode 100644 index 0000000000..988db2d324 --- /dev/null +++ b/translated/tech/20150205 zBackup--A versatile deduplicating backup tool.md @@ -0,0 +1,63 @@ +zBackup——一个通用的重复数据备份工具 +================================================================================ +zbackup是一个基于rsync思想的全局重复数据备份工具。给它传入一个大的tar文件后,它会存储该文件的重复区域(仅进行一次),然后对结果进行压缩,并根据参数确定是否对其加密。传入另一个tar文件后,它会从之前的已备份文件中复用重复的数据。只有新的改动会被保存,并且只要文件变动不是很大,需要的存储空间非常少。任何时候之前的已备份文件都可以被完整地读出来。 + +### zBackup特性 ### + +- 使用并行的LZMA或者LZO压缩算法压缩已备份数据 +- 使用内置的AES加密算法加密已备份数据 +- 可以删除旧的已备份数据 +- 使用一个64位滚动哈希,保持软碰撞数量为0 +- 已备份数据由不可更改的文件组成。任何现有文件都没有被更改过 +- 使用C++语言编写,并且只有适量的依赖库 +- 可以在生产环境安全使用 +- 可以在不同备份库中交换数据而无需重新压缩 + +### 在ubuntu中安装zBackup ### + +打开终端并运行如下命令: + + sudo apt-get install zbackup + +### 使用zBackup ### + +`zbackup init`命令会初始化一个备份库,用来存放待备份的数据。 + + zbackup init [--non-encrypted] [--password-file ~/.my_backup_password ] /my/backup/repo + +`zbackup backup`命令备份一个由`tar c`创建的tar文件到刚才使用`zbackup init`初始化的备份库。(译注:实际使用时类似这样,tar c files | zbackup ...) + + zbackup [--password-file ~/.my_backup_password ] [--threads number_of_threads ] backup /my/backup/repo/backups/backup-`date ‘+%Y-%m-%d'` + +`zbackup restore`命令从备份库中恢复一个已备份文件到tar文件中。 + + zbackup [--password-file ~/.my_backup_password ] [--cache-size cache_size_in_mb ] restore /my/backup/repo/backups/backup-`date ‘+%Y-%m-%d'` > /my/precious/backup-restored.tar + +### 可用选项 ### + +- -non-encrypted -- 不加密备份库。 +- --password-file ~/.my_backup_password -- 使用位于~/.my_backup_password的口令文件来加密备份库和待备份文件,以及解密已备份文件。 +- --threads number_of_threads -- 限制并行LZMA压缩的线程数到number_of_threads。建议在32位的系统平台使用。 +- --cache-size cache_size_in_mb -- 使用cache_size_in_mb中的缓存大小来加速恢复文件的过程。 + +### zBackup相关文件 ### + +~/.my_backup_password 用来加密备份库和待备份文件,以及解密已备份文件。更多细节见zbackup。 + +/my/backup/repo 存放备份库的目录。 + +/my/precious/restored-tar 用来恢复已备份文件的tar文件。 + +/my/backup/repo/backups/backup-`date ‘+%Y-%m-%d'` 指定的之前已备份文件的文件名。 + +-------------------------------------------------------------------------------- + +via: http://www.ubuntugeek.com/zbackup-a-versatile-deduplicating-backup-tool.html + +作者:[ruchi][a] +译者:[goreliu](https://github.com/goreliu) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://www.ubuntugeek.com/author/ubuntufix From 0b9d2663dc47b9ca2003aaca9eb94c913bdc0374 Mon Sep 17 00:00:00 2001 From: Gore Liu Date: Mon, 18 May 2015 22:00:55 +0800 Subject: [PATCH 072/965] [Translating] 20150316 5 Interesting Command Line Tips and Tricks in Linux--Part 1.md --- ...teresting Command Line Tips and Tricks in Linux--Part 1.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150316 5 Interesting Command Line Tips and Tricks in Linux--Part 1.md b/sources/tech/20150316 5 Interesting Command Line Tips and Tricks in Linux--Part 1.md index 352fa2816c..073e5f9370 100644 --- a/sources/tech/20150316 5 Interesting Command Line Tips and Tricks in Linux--Part 1.md +++ b/sources/tech/20150316 5 Interesting Command Line Tips and Tricks in Linux--Part 1.md @@ -1,3 +1,5 @@ +Translating by goreliu ... + 5 Interesting Command Line Tips and Tricks in Linux – Part 1 ================================================================================ Are you making most out of the Linux? There are lots of helpful features which appears to be Tips and Tricks for many of Linux Users. Sometimes Tips and Tricks become the need. It helps you get productive with the same set of commands yet with enhanced functionality. @@ -112,4 +114,4 @@ via: http://www.tecmint.com/5-linux-command-line-tricks/ [a]:http://www.tecmint.com/author/avishek/ [1]:http://www.tecmint.com/history-command-examples/ -[2]:http://www.tecmint.com/check-linux-disk-usage-of-files-and-directories/ \ No newline at end of file +[2]:http://www.tecmint.com/check-linux-disk-usage-of-files-and-directories/ From bff7e462106c199d71e1f9d1c80f89315852f11b Mon Sep 17 00:00:00 2001 From: joeren Date: Tue, 19 May 2015 08:04:54 +0800 Subject: [PATCH 073/965] Update 20150518 Linux FAQs with Answers--How to view threads of a process on Linux.md --- ... with Answers--How to view threads of a process on Linux.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150518 Linux FAQs with Answers--How to view threads of a process on Linux.md b/sources/tech/20150518 Linux FAQs with Answers--How to view threads of a process on Linux.md index 9bb7bc0b9f..305d556aa9 100644 --- a/sources/tech/20150518 Linux FAQs with Answers--How to view threads of a process on Linux.md +++ b/sources/tech/20150518 Linux FAQs with Answers--How to view threads of a process on Linux.md @@ -1,3 +1,4 @@ +Translating by GOLinux! Linux FAQs with Answers--How to view threads of a process on Linux ================================================================================ > **Question**: My program creates and executes multiple threads in it. How can I monitor individual threads of the program once they are created? I would like to see the details (e.g., CPU/memory usage) of individual threads with their names. @@ -54,4 +55,4 @@ via: http://ask.xmodulo.com/view-threads-process-linux.html 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 -[a]:http://ask.xmodulo.com/author/nanni \ No newline at end of file +[a]:http://ask.xmodulo.com/author/nanni From 34533e46066a3858cdddfc228a19de40d68bdc2d Mon Sep 17 00:00:00 2001 From: KayGuoWhu Date: Tue, 19 May 2015 08:36:12 +0800 Subject: [PATCH 074/965] translating by KayGuoWhu --- .../talk/20150511 Open Source History--Why Did Linux Succeed.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/talk/20150511 Open Source History--Why Did Linux Succeed.md b/sources/talk/20150511 Open Source History--Why Did Linux Succeed.md index 9a5a19686a..e50eb38cb7 100644 --- a/sources/talk/20150511 Open Source History--Why Did Linux Succeed.md +++ b/sources/talk/20150511 Open Source History--Why Did Linux Succeed.md @@ -1,3 +1,4 @@ +[translating by KayGuoWhu] Open Source History: Why Did Linux Succeed? ================================================================================ > Why did Linux, the Unix-like operating system kernel started by Linus Torvalds in 1991 that became central to the open source world, succeed where so many similar projects, including GNU HURD and the BSDs, fail? From b3050ecfd9ea19b3c5d9ccb15f10464d714d626a Mon Sep 17 00:00:00 2001 From: GOLinux Date: Tue, 19 May 2015 08:41:00 +0800 Subject: [PATCH 075/965] [Translated]20150518 Linux FAQs with Answers--How to view threads of a process on Linux.md --- ...w to view threads of a process on Linux.md | 58 ------------------- ...w to view threads of a process on Linux.md | 57 ++++++++++++++++++ 2 files changed, 57 insertions(+), 58 deletions(-) delete mode 100644 sources/tech/20150518 Linux FAQs with Answers--How to view threads of a process on Linux.md create mode 100644 translated/tech/20150518 Linux FAQs with Answers--How to view threads of a process on Linux.md diff --git a/sources/tech/20150518 Linux FAQs with Answers--How to view threads of a process on Linux.md b/sources/tech/20150518 Linux FAQs with Answers--How to view threads of a process on Linux.md deleted file mode 100644 index 305d556aa9..0000000000 --- a/sources/tech/20150518 Linux FAQs with Answers--How to view threads of a process on Linux.md +++ /dev/null @@ -1,58 +0,0 @@ -Translating by GOLinux! -Linux FAQs with Answers--How to view threads of a process on Linux -================================================================================ -> **Question**: My program creates and executes multiple threads in it. How can I monitor individual threads of the program once they are created? I would like to see the details (e.g., CPU/memory usage) of individual threads with their names. - -Threads are a popular programming abstraction for parallel execution on modern operating systems. When threads are forked inside a program for multiple flows of execution, these threads share certain resources (e.g., memory address space, open files) among themselves to minimize forking overhead and avoid expensive IPC (inter-process communication) channel. These properties make threads an efficient mechanism for concurrent execution. - -In Linux, threads (also called Lightweight Processes (LWP)) created within a program will have the same "thread group ID" as the program's PID. Each thread will then have its own thread ID (TID). To the Linux kernel's scheduler, threads are nothing more than standard processes which happen to share certain resources. Classic command-line tools such as ps or top, which display process-level information by default, can be instructed to display thread-level information. - -Here are several ways to **show threads for a process on Linux**. - -### Method One: PS ### - -In ps command, "-T" option enables thread views. The following command list all threads created by a process with . - - $ ps -T -p - -![](https://farm8.staticflickr.com/7749/17350561110_94cacfc456_c.jpg) - -The "SID" column represents thread IDs, and "CMD" column shows thread names. - -### Method Two: Top ### - -The top command can show a real-time view of individual threads. To enable thread views in the top output, invoke top with "-H" option. This will list all Linux threads. You can also toggle on or off thread view mode while top is running, by pressing 'H' key. - - $ top -H - -![](https://farm9.staticflickr.com/8824/17350561070_3dfe447974_c.jpg) - -To restrict the top output to a particular process and check all threads running inside the process: - - $ top -H -p - -![](https://farm8.staticflickr.com/7797/17538002751_c8a3d574d8_c.jpg) - -### Method Three: Htop ### - -A more user-friendly way to view threads per process is via htop, an ncurses-based interactive process viewer. This program allows you to monitor individual threads in tree views. - -To enable thread views in htop, launch htop, and press to enter htop setup menu. Choose "Display option" under "Setup" column, and toggle on "Three view" and "Show custom thread names" options. Presss to exit the setup. - -![](https://farm6.staticflickr.com/5338/17350364568_59bce22e7b_b.jpg) - -Now you will see the follow threaded view of individual processes. - -![](https://farm9.staticflickr.com/8885/17350560930_98952d5350_c.jpg) - --------------------------------------------------------------------------------- - -via: http://ask.xmodulo.com/view-threads-process-linux.html - -作者:[Dan Nanni][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://ask.xmodulo.com/author/nanni diff --git a/translated/tech/20150518 Linux FAQs with Answers--How to view threads of a process on Linux.md b/translated/tech/20150518 Linux FAQs with Answers--How to view threads of a process on Linux.md new file mode 100644 index 0000000000..a91a2b3ed3 --- /dev/null +++ b/translated/tech/20150518 Linux FAQs with Answers--How to view threads of a process on Linux.md @@ -0,0 +1,57 @@ +Linux有问必答——Linux上如何查看某个进程的线程 +================================================================================ +> **问题**: 我的程序创建并在它里头执行了多个线程,我怎样才能在该程序创建线程后监控其中单个线程?我想要看到带有它们名称的单个线程详细情况(如,CPU/内存使用率)。 + +线程是现代操作系统上进行并行执行的一个流行的编程方面的抽象概念。当一个程序内有多个线程被叉分出用以执行多个流时,这些线程就会在它们之间共享特定的资源(如,内存地址空间、打开的文件),以使叉分开销最小化,并避免大量花销IPC(进程间通信)频道。这些功能让线程在并发执行时成为一个高效的机制。 + +在Linux中,程序中创建的线程(也称为轻量级进程,LWP)会具有和程序的PID相同的“线程组ID”。然后,各个线程会获得其自身的线程ID(TID)。对于Linux内核调度器而言,线程不过是恰好共享特定资源的标准的进程。经典的命令行工具,如ps或top,都可以用来显示线程级别的信息,默认情况下它们会显示进程级别的信息。 + +这里提供了**在Linux上显示某个进程的线程**的几种方式。 + +### 方法一:PS ### + +在ps命令中,“-T”选项可以开启线程查看。下面的命令列出了由进程号为的进程创建的所有线程。 + + $ ps -T -p + +![](https://farm8.staticflickr.com/7749/17350561110_94cacfc456_c.jpg) + +“SID”栏表示线程ID,而“CMD”栏则显示了线程名称。 + +### 方法二: Top ### + +top命令可以实时显示各个线程情况。要在top输出中开启线程查看,请调用top命令的“-H”选项,该选项会列出所有Linux线程。在top运行时,你也可以通过按“H”键将线程查看模式切换为开或关。 + + $ top -H + +![](https://farm9.staticflickr.com/8824/17350561070_3dfe447974_c.jpg) + +要让top输出某个特定进程并检查该进程内运行的线程状况: + + $ top -H -p + +![](https://farm8.staticflickr.com/7797/17538002751_c8a3d574d8_c.jpg) + +### 方法三: Htop ### + +一个对用户更加友好的方式是,通过htop查看单个进程的线程,它是一个基于ncurses的交互进程查看器。该程序允许你在树状视图中监控单个独立线程。 + +要在htop中启用线程查看,请开启htop,然后按来进入htop的设置菜单。选择“设置”栏下面的“显示选项”,然后开启“树状视图”和“显示自定义线程名”选项。按退出设置。 + +![](https://farm6.staticflickr.com/5338/17350364568_59bce22e7b_b.jpg) + +现在,你就会看到下面这样单个进程的线程视图。 + +![](https://farm9.staticflickr.com/8885/17350560930_98952d5350_c.jpg) + +-------------------------------------------------------------------------------- + +via: http://ask.xmodulo.com/view-threads-process-linux.html + +作者:[Dan Nanni][a] +译者:[GOLinux](https://github.com/GOLinux) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://ask.xmodulo.com/author/nanni From bc8c783a333d022983ef6cc0a89f9d84caf38dc0 Mon Sep 17 00:00:00 2001 From: KayGuoWhu Date: Tue, 19 May 2015 08:43:58 +0800 Subject: [PATCH 076/965] move the article from sources to translated --- .../20150227 Enjoy Android Apps on Ubuntu using ARChon Runtime.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/20150227 Enjoy Android Apps on Ubuntu using ARChon Runtime.md (100%) diff --git a/sources/tech/20150227 Enjoy Android Apps on Ubuntu using ARChon Runtime.md b/translated/tech/20150227 Enjoy Android Apps on Ubuntu using ARChon Runtime.md similarity index 100% rename from sources/tech/20150227 Enjoy Android Apps on Ubuntu using ARChon Runtime.md rename to translated/tech/20150227 Enjoy Android Apps on Ubuntu using ARChon Runtime.md From e82f964e69fda5ef164f6340f533b0dd51841c04 Mon Sep 17 00:00:00 2001 From: joeren Date: Tue, 19 May 2015 08:48:23 +0800 Subject: [PATCH 077/965] Update 20150518 Linux FAQs with Answers--How to fix '404 Not Found' error with 'apt-get update' on old Ubuntu.md --- ...404 Not Found' error with 'apt-get update' on old Ubuntu.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150518 Linux FAQs with Answers--How to fix '404 Not Found' error with 'apt-get update' on old Ubuntu.md b/sources/tech/20150518 Linux FAQs with Answers--How to fix '404 Not Found' error with 'apt-get update' on old Ubuntu.md index a5f150d3eb..9538b58556 100644 --- a/sources/tech/20150518 Linux FAQs with Answers--How to fix '404 Not Found' error with 'apt-get update' on old Ubuntu.md +++ b/sources/tech/20150518 Linux FAQs with Answers--How to fix '404 Not Found' error with 'apt-get update' on old Ubuntu.md @@ -1,3 +1,4 @@ +Translating by GOLinux! Linux FAQs with Answers--How to fix “404 Not Found” error with “apt-get update” on old Ubuntu ================================================================================ > **Question**: I have old Ubuntu 13.04 (Raring Ringtail) installation on my PC. When I run "sudo apt-get update" on it, it throws a bunch of "404 Not Found" errors, and I cannot install or update any package using apt-get or aptitude. Due to this error I cannot even upgrade it to a newer release. How can I fix this problem? @@ -42,4 +43,4 @@ via: http://ask.xmodulo.com/404-not-found-error-apt-get-update-ubuntu.html 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 -[a]:http://ask.xmodulo.com/author/nanni \ No newline at end of file +[a]:http://ask.xmodulo.com/author/nanni From ae20d738fb9fe1c93745e2f5f0242a02fc2ce028 Mon Sep 17 00:00:00 2001 From: GOLinux Date: Tue, 19 May 2015 09:14:27 +0800 Subject: [PATCH 078/965] [Translated]20150518 Linux FAQs with Answers--How to fix '404 Not Found' error with 'apt-get update' on old Ubuntu.md --- ...ror with 'apt-get update' on old Ubuntu.md | 46 ------------------- ...ror with 'apt-get update' on old Ubuntu.md | 45 ++++++++++++++++++ 2 files changed, 45 insertions(+), 46 deletions(-) delete mode 100644 sources/tech/20150518 Linux FAQs with Answers--How to fix '404 Not Found' error with 'apt-get update' on old Ubuntu.md create mode 100644 translated/tech/20150518 Linux FAQs with Answers--How to fix '404 Not Found' error with 'apt-get update' on old Ubuntu.md diff --git a/sources/tech/20150518 Linux FAQs with Answers--How to fix '404 Not Found' error with 'apt-get update' on old Ubuntu.md b/sources/tech/20150518 Linux FAQs with Answers--How to fix '404 Not Found' error with 'apt-get update' on old Ubuntu.md deleted file mode 100644 index 9538b58556..0000000000 --- a/sources/tech/20150518 Linux FAQs with Answers--How to fix '404 Not Found' error with 'apt-get update' on old Ubuntu.md +++ /dev/null @@ -1,46 +0,0 @@ -Translating by GOLinux! -Linux FAQs with Answers--How to fix “404 Not Found” error with “apt-get update” on old Ubuntu -================================================================================ -> **Question**: I have old Ubuntu 13.04 (Raring Ringtail) installation on my PC. When I run "sudo apt-get update" on it, it throws a bunch of "404 Not Found" errors, and I cannot install or update any package using apt-get or aptitude. Due to this error I cannot even upgrade it to a newer release. How can I fix this problem? - -![](https://farm6.staticflickr.com/5460/17634085636_996b2a8ab5_b.jpg) - -Every Ubuntu release has its end-of-life (EOL) time; regular Ubuntu releases are supported for 18 months, while LTS (Long Term Support) versions are supported up to 3 years (server edition) and 5 years (desktop edition). Once a Ubuntu release has reached EOL, its repositories will no longer be accessible, and you won't get any maintenance updates and security patches from Canonical. As of this writing, Ubuntu 13.04 (Raring Ringtail) has already reached EOL. - -If the Ubuntu system you are using is EOL-ed, you will get the following 404 errors from apt-get or aptitude as its repositories have been deprecated. - - W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/raring-backports/multiverse/binary-i386/Packages 404 Not Found [IP: 91.189.91.13 80] - - W: Failed to fetch http://extras.ubuntu.com/ubuntu/dists/raring/main/binary-amd64/Packages 404 Not Found - - W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/raring-security/universe/binary-i386/Packages 404 Not Found [IP: 91.189.88.149 80] - - E: Some index files failed to download. They have been ignored, or old ones used instead - -For those users who are using old versions of Ubuntu, Canonical maintains old-releases.ubuntu.com, which is an archive of EOL-ed repositories. Thus, when Canonical's support for your Ubuntu installation ends, you need to switch to repositories at old-releases.ubuntu.com (unless you want to upgrade it before EOL). - -Here is a quick way to fix "404 Not Found" errors on old Ubuntu by switching to old-releases repositories. - -First, replace main/security repositories with old-releases versions as follows. - - $ sudo sed -i -r 's/([a-z]{2}\.)?archive.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list - $ sudo sed -i -r 's/security.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list - -Then open /etc/apt/sources.list with a text editor, and look for extras.ubuntu.com. This repository is also no longer supported for 13.04. So you need to comment out extras.ubuntu.com by prepending '#' sign. - - #deb http://extras.ubuntu.com/ubuntu raring main - #deb-src http://extras.ubuntu.com/ubuntu raring main - -Now you should be able to install or update packages on an old unsupported Ubuntu release. - --------------------------------------------------------------------------------- - -via: http://ask.xmodulo.com/404-not-found-error-apt-get-update-ubuntu.html - -作者:[Dan Nanni][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://ask.xmodulo.com/author/nanni diff --git a/translated/tech/20150518 Linux FAQs with Answers--How to fix '404 Not Found' error with 'apt-get update' on old Ubuntu.md b/translated/tech/20150518 Linux FAQs with Answers--How to fix '404 Not Found' error with 'apt-get update' on old Ubuntu.md new file mode 100644 index 0000000000..9880f7953f --- /dev/null +++ b/translated/tech/20150518 Linux FAQs with Answers--How to fix '404 Not Found' error with 'apt-get update' on old Ubuntu.md @@ -0,0 +1,45 @@ +Linux有问必答——在旧的Ubuntu上如何修复“apt-get update”的“404 Not Found”错误 +================================================================================ +> **问题**: 我的PC上安装了旧版的Ubuntu 13.04(急切的浣熊)。当我在上面运行“sudo apt-get update”时,它丢给了我一大堆“404 Not Found”错误,结果是我不能使用apt-get或aptitude来安装或更新任何软件包了。由于该错误的原因,我甚至不能将它升级到更新的版本。我怎样才能修复这个问题啊? +> +![](https://farm6.staticflickr.com/5460/17634085636_996b2a8ab5_b.jpg) + +每个Ubuntu版本都有生命结束周期(EOL)时间;常规的Ubuntu发行版提供18个月的支持,而LTS(长期支持)版本则长达3年(服务器版本)和5年(桌面版本)。当某个Ubuntu版本达到生命结束周期时,其仓库就不能再访问了,你也不能再从Canonical获取任何维护更新和安全补丁。在撰写本文时,Ubuntu 13.04(急切的浣熊)已经达到了它的生命结束周期。 + +如果你所使用的Ubuntu系统已经被结束生命周期,你就会从apt-get或aptitude得到以下404错误,因为它的仓库已经被遗弃了。 + + W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/raring-backports/multiverse/binary-i386/Packages 404 Not Found [IP: 91.189.91.13 80] + + W: Failed to fetch http://extras.ubuntu.com/ubuntu/dists/raring/main/binary-amd64/Packages 404 Not Found + + W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/raring-security/universe/binary-i386/Packages 404 Not Found [IP: 91.189.88.149 80] + + E: Some index files failed to download. They have been ignored, or old ones used instead + +对于那些还在使用旧版本Ubuntu的用户,Canonical维护了一个old-releases.ubuntu.com的网站,这里包含了结束生命周期的仓库归档。因此,当Canonical对你安装的Ubuntu版本结束支持时,你需要将仓库切换到old-releases.ubuntu.com(除非你在结束生命周期之前想要升级)。 + +这里,通过切换到旧版本仓库提供了一个快速修复“404 Not Found”错误的便捷方式。 + +首先,使用旧版本仓库替换main/security仓库,就像下面这样。 + + $ sudo sed -i -r 's/([a-z]{2}\.)?archive.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list + $ sudo sed -i -r 's/security.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list + +然后,使用文本编辑器打开/etc/apt/sources.list,并查找extras.ubuntu.com。该仓库也不再支持Ubuntu 13.04了,所以你需要使用“#”号将extras.ubuntu.com注释掉。 + + #deb http://extras.ubuntu.com/ubuntu raring main + #deb-src http://extras.ubuntu.com/ubuntu raring main + +现在,你应该可以在旧版不受支持的Ubuntu上安装或更新软件包了。 + +-------------------------------------------------------------------------------- + +via: http://ask.xmodulo.com/404-not-found-error-apt-get-update-ubuntu.html + +作者:[Dan Nanni][a] +译者:[GOLinux](https://github.com/GOLinux) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://ask.xmodulo.com/author/nanni From 304a3bab0a7e7d866c62ba3971e46f28fc9734d4 Mon Sep 17 00:00:00 2001 From: joeren Date: Tue, 19 May 2015 09:19:15 +0800 Subject: [PATCH 079/965] Update 20150518 Linux FAQs with Answers--How to block specific user agents on nginx web server.md --- ...s--How to block specific user agents on nginx web server.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150518 Linux FAQs with Answers--How to block specific user agents on nginx web server.md b/sources/tech/20150518 Linux FAQs with Answers--How to block specific user agents on nginx web server.md index 6ea8ae3b06..53bd4c4935 100644 --- a/sources/tech/20150518 Linux FAQs with Answers--How to block specific user agents on nginx web server.md +++ b/sources/tech/20150518 Linux FAQs with Answers--How to block specific user agents on nginx web server.md @@ -1,3 +1,4 @@ +Translating by GOLinux! Linux FAQs with Answers--How to block specific user agents on nginx web server ================================================================================ > **Question**: I notice that some robots often visit my nginx-powered website and scan it aggressively, ending up wasting a lot of my web server resources. I am trying to block those robots based on their user-agent string. How can I block specific user agent(s) on nginx web server? @@ -111,4 +112,4 @@ via: http://ask.xmodulo.com/block-specific-user-agents-nginx-web-server.html 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 -[a]:http://ask.xmodulo.com/author/nanni \ No newline at end of file +[a]:http://ask.xmodulo.com/author/nanni From 5c11fd2ddb2cc5681b7b5ac0443bb3d454e60676 Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 19 May 2015 11:16:22 +0800 Subject: [PATCH 080/965] PUB:20150304 Share Folders On Local Network Between Ubuntu And Windows @KayGuoWhu --- ...ocal Network Between Ubuntu And Windows.md | 35 +++++++++---------- 1 file changed, 17 insertions(+), 18 deletions(-) rename {translated/tech => published}/20150304 Share Folders On Local Network Between Ubuntu And Windows.md (81%) diff --git a/translated/tech/20150304 Share Folders On Local Network Between Ubuntu And Windows.md b/published/20150304 Share Folders On Local Network Between Ubuntu And Windows.md similarity index 81% rename from translated/tech/20150304 Share Folders On Local Network Between Ubuntu And Windows.md rename to published/20150304 Share Folders On Local Network Between Ubuntu And Windows.md index 972486fbf0..a2e5e59286 100644 --- a/translated/tech/20150304 Share Folders On Local Network Between Ubuntu And Windows.md +++ b/published/20150304 Share Folders On Local Network Between Ubuntu And Windows.md @@ -1,10 +1,10 @@ -局域网中实现Ubuntu和Windows共享文件夹 +如何在局域网中将Ubuntu文件夹共享给Windows ================================================================================ ![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/03/Share_Folder_Ubuntu_windows.jpeg) 本文全面详细地向你描述了**在Ubuntu中如何实现局域网内的文件夹共享**。 -你的家中是不是有多台电脑?当你需要从一台Ubuntu电脑向另一台电脑传输数据时,是不是必须用到U盘或SD卡?你是否也觉得这个方法很烦人?我想肯定是。本文的目的就是使你在局域网内快速方便地传输文件、文档和其它较大的数据,来节省你的宝贵时间。只需一次设置,然后轻点鼠标,你就可以自由地**在Ubuntu和Windows之间共享文件**,当然这对其它Linux系统同样使用。不要担心这很容易操作,不会花费太多时间。 +你的家中是不是有多台电脑?当你需要从一台Ubuntu电脑向另一台电脑传输数据时,是不是必须用到U盘或SD卡?你是否也觉得这个方法很烦人?我想肯定是。本文的目的就是使你在局域网内快速方便地传输文件、文档和其它较大的数据,以节省你的宝贵时间。只需一次设置,然后轻点鼠标,你就可以自由地**在Ubuntu和Windows之间共享文件**,当然这对其它Linux系统同样使用。不要担心,这很容易操作,不会花费太多时间。 除此之外,尽管本文是在Ubuntu上进行实践,但这个教程在其它Linux系统上同样有用。 @@ -21,11 +21,11 @@ #### 步骤一:#### -为了在Ubuntu上实现局域网共享文件夹,右键点击打算共享的文件夹,并选择“Local Network Share”: +为了在Ubuntu上实现局域网共享文件夹,右键点击打算共享的文件夹,并选择“Local Network Share(本地网络共享)”: ![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/02/Share_Folder_Ubuntu.jpeg) -**可能有用的故障方案**:如果在右键菜单中看不到“Local Network Share”的选项,那就新建一个终端,使用下面的命令去安装nautlius-share: +**可能有用的故障解决方案**:如果在右键菜单中看不到“Local Network Share”的选项,那就新建一个终端,使用下面的命令去安装nautlius-share插件: sudo apt-get install nautilus-share @@ -35,17 +35,17 @@ #### 步骤二:#### -一旦点击“Local Network Share”,就会出现共享文件夹的选项。只需选中“Share this folder”这一项: +一旦点击“Local Network Share”,就会出现共享文件夹的选项。只需选中“Share this folder(共享该文件夹)”这一项: ![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/03/Share_Folder_Ubuntu_1.jpeg) -可能的故障方案:如果提示共享服务还未安装,就像下图所示,那就点击安装服务,按照提示操作。 +**可能的故障解决方案**:如果提示共享服务还未安装,就像下图所示,那就点击安装服务,按照提示操作。 ![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/03/Share_Folder_Ubuntu_2.jpeg) #### 步骤三:#### -一旦选中“Share this folder”的选项,就会看到按钮“Create Share”变成可用了。你也可以允许其他用户在共享文件夹中编辑文件。选项“Guest access”也是如此。 +当选中“Share this folder”的选项,就会看到按钮“Create Share(创建共享)”变得可以点击了。你也可以“Allow others to create and delete fies in this folder(允许其他用户在共享文件夹中编辑文件)”。选项“Guest access(允许访客访问)”也是如此。 ![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/03/Share_folder_Ubuntu_3.png) @@ -55,13 +55,13 @@ ### 2. 在Ubuntu上使用密码保护实现局域网共享文件夹### -为了达到目的,首先需要配置Samba服务器。事实上,在这篇教程的前一部分我们已经用到了Samba,只是我们没有刻意强调。在介绍如何在Ubuntu上搭建Samba服务器实现局域网共享的方法之前,先快速预览一下[Samba][1]到底是什么。 +为了达到这个目的,首先需要配置Samba服务器。事实上,在这篇教程的前一部分我们已经用到了Samba,只是我们没有刻意强调。在介绍如何在Ubuntu上搭建Samba服务器实现局域网共享的方法之前,先快速预览一下[Samba][1]到底是什么。 #### Samba是什么? #### Samba是一个允许用户通过网络共享文件、文档和打印机的软件包,无论是在Linux、Windows,还是Mac上。它适用于所有的主流平台,可以在所有支持系统上流畅运行。下面是维基百科的介绍: -> Samba是一款重新实现SMB/CIFS网络协议的自由软件,最初由安德鲁·垂鸠开发。在第三版中,Smaba不仅支持通过不同的Windows客户端访问及分享SMB的文件夹及打印机,还可以集成到Windows Server域名,作为主要域名控制站(PDC)或者域名成员。它也可以作为Active Directory域名的一部分。 +> Samba是一款重新实现SMB/CIFS网络协议的自由软件,最初由安德鲁·垂鸠开发。在第三版中,Smaba不仅支持通过不同的Windows客户端访问及分享SMB的文件夹及打印机,还可以集成到Windows Server域,作为主域控制器(PDC)或者域成员。它也可以作为活动目录域的一部分。 #### 在Ubuntu上安装Samba服务器 #### @@ -77,7 +77,7 @@ Samba是一个允许用户通过网络共享文件、文档和打印机的软件 #### 在Ubuntu上配置Samba服务器 #### -从dash打开Samba配置工具: +从dash中打开Samba配置工具: ![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/02/Setup-Samba.png) @@ -86,7 +86,7 @@ Samba是一个允许用户通过网络共享文件、文档和打印机的软件 在Server Setting中可以看到两个选项卡,‘Basic’和‘Security’。在Basic选项卡下的选项含义如下: - 工作组 - 用户要连接的电脑所在工作组的名字。比如,如果你想连接到一台Windows电脑,你就要输入Windows电脑的工作组名字。在Windows的Samba服务器设置中,已经默认设置好统一的工作组名字。但如果你有不同的工作组名字,就在这个字段中输入自定义的工作组名字。(在Windows 7中获取工作组名字,右击计算机图标,进到属性,就能看到Windows工作组名字。) -- 描述 - 其他用户看到的你的电脑名字。不要使用空格或计算机不支持(望更正!)的字符。 +- 描述 - 其他用户看到的你的电脑名字。不要使用空格或不适用于网络的字符。 ![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/02/samba-server-settings.png) @@ -101,14 +101,14 @@ Samba是一个允许用户通过网络共享文件、文档和打印机的软件 现在我们需要为网络共享文件创建一个系统用户。下面是非常简单的步骤: - 在Systems Settings下点击**User Accounts**。 -- 点击**unlock**使其可用,以及+(**plus**)图标。 -- 点击+(plus)图标,创建一个新的系统用户。 +- 点击**unlock**使其可用,以及+(**加号**)图标。 +- 点击+(加号)图标,创建一个新的系统用户。 ![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/02/create-system-user1.jpg) 如上图所示,需要输入‘Full name’。当你输入‘Full name’时,Username会自动填充为Full name。因为创建这个用户是为了共享文件,所以还要指定Account Type为‘**Standard**’。 -完成上述步骤,点击添加,你就创建好一个系统用户。这个用户还没有被激活,所以需要为其设置密码来激活。确保Users accounts界面已经解锁。点击Account disabled。输入一个新密码,然后确认密码,点击Change。 +完成上述步骤,点击添加,你就创建好一个系统用户。这个用户还没有被激活,所以需要为其设置密码来激活。确保Users accounts界面已经解锁。点击尚不可用的账户,输入一个新密码,然后确认密码,点击Change。 ![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/02/activate-system-user.jpg) @@ -132,7 +132,7 @@ Samba是一个允许用户通过网络共享文件、文档和打印机的软件 #### 通过网络共享文件夹或文件 #### -在图形用户界面下通过Samba共享文件是很简单的。点击Plus图标,会看到如图所示的对话框: +在图形用户界面下通过Samba共享文件是很简单的。点击加号图标,会看到如图所示的对话框: ![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/02/share-files-and-folders.jpg) @@ -157,9 +157,8 @@ Samba是一个允许用户通过网络共享文件、文档和打印机的软件 全部搞定!我们也可以使用终端进行网络文件共享,但这样没有本文介绍的方法这么容易。如果你确实想知道命令行操作,我会再写一篇关于在Linux上使用命令行实现网络文件共享的文章。 -所以,你是怎么找到这篇教程的呢?我希望看了这篇教程你可以**很容易地在Ubuntu和Windows之间共享文件**。如果你有任何问题或建议,请再评论里说出来。 +所以,你是怎么找到这篇教程的呢?我希望看了这篇教程你可以**很容易地在Ubuntu和Windows之间共享文件**。如果你有任何问题或建议,请在评论里说出来。 -这篇教程是在Kalc的请求下写出的。如果你也想,你可以[请求你自己的教程][2]。我们很乐意帮助你和面临同样问题的读者解决问题。 -------------------------------------------------------------------------------- @@ -167,7 +166,7 @@ via: http://itsfoss.com/share-folders-local-network-ubuntu-windows/ 作者:[Mohd Sohail][a] 译者:[KayGuoWhu](https://github.com/KayGuoWhu) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 From 0a3d2011be313b73cdca6c21f2dde13290b5c635 Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 19 May 2015 11:29:11 +0800 Subject: [PATCH 081/965] PUB:20150123 How to make a file immutable on Linux MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @goreliu  翻译的不错。https://linux.cn/article-5467-1.html --- ...0123 How to make a file immutable on Linux.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) rename {translated/tech => published}/20150123 How to make a file immutable on Linux.md (74%) diff --git a/translated/tech/20150123 How to make a file immutable on Linux.md b/published/20150123 How to make a file immutable on Linux.md similarity index 74% rename from translated/tech/20150123 How to make a file immutable on Linux.md rename to published/20150123 How to make a file immutable on Linux.md index 8c22e3a2b8..493b0096be 100644 --- a/translated/tech/20150123 How to make a file immutable on Linux.md +++ b/published/20150123 How to make a file immutable on Linux.md @@ -1,9 +1,9 @@ 如何在Linux下创建一个不可变更的文件 ================================================================================ -假如你想对Linux中的一些重要文件做写保护,这样它们就不能被删除或者被篡改成之前的版本或者其他东西。或者在其他情况,你可能想避免某些配置文件被软件自动修改。使用`chown`和`chmod`命令修改文件的归属关系或者权限位是处理这种情况的一个解决方法,但这并不完美,因为这样无法避免有root权限的操作。这时`chattr`就派上用场了。 +假如你想对Linux中的一些重要文件做写保护,这样它们就不能被删除或者被篡改成之前的版本或者其他东西,或者在其他情况下,你可能想避免某些配置文件被软件自动修改。使用`chown`和`chmod`命令修改文件的归属关系或者权限位是处理这种情况的一个解决方法,但这并不完美,因为这样无法避免有root权限的操作。这时`chattr`就派上用场了。 -`chattr`是一个可以设置或取消文件的标志位的Linux命令,它和标准的文件权限(读、写、执行)是分离的。与此相关的另一个命令是`lsattr`,它可以显示文件的哪些标志位被设置上了。最初只有EXT文件系统(EXT2/3/4)支持`chattr`和`lsattr`所管理的标志位,但现在很多其他的本地Linux文件系统都支持了,比如XFS、Btrfs、ReiserFS等等。 +`chattr`是一个可以设置或取消文件的标志位的Linux命令,它和标准的文件权限(读、写、执行)是分离的。与此相关的另一个命令是`lsattr`,它可以显示文件的哪些标志位被设置上了。最初只有EXT文件系统(EXT2/3/4)支持`chattr`和`lsattr`所管理的标志位,但现在很多其他的原生的Linux文件系统都支持了,比如XFS、Btrfs、ReiserFS等等。 在这个教程中,我会示范如果使用`chattr`来让Linux中的文件不可变更。 @@ -22,7 +22,7 @@ - **c**: 当被写入磁盘时被自动压缩。 - **C**: 关掉“写时复制”。 - **i**: 不可变更。 -- **s**: 通过自动归零来安全删除。(译注:一般情况文件被删后内容不会被修改,改标志位会使得文件被删后原有内容被0取代) +- **s**: 通过自动归零来安全删除。(LCTT 译注:一般情况文件被删后内容不会被修改,改标志位会使得文件被删后原有内容被“0”取代) ### “不可变更”标志位 ### @@ -30,11 +30,11 @@ $ sudo chattr +i /etc/passwd -注意设置或取消一个文件的“不可变更”标志位是需要根用户权限的。现在检查该文件“不可变更”标志位是否被添加上了。 +注意设置或取消一个文件的“不可变更”标志位是需要root用户权限的。现在检查该文件“不可变更”标志位是否被添加上了。 $ lsattr /etc/passwd -一旦文件被设置为不可变更,任何用户都将无法修改该文件。即使是根用户也不可以修改、删除、覆盖、移动或者重命名这个文件。如果你想再次修改这个文件,需要先把“不可变更”标志位取消了。 +一旦文件被设置为不可变更,任何用户都将无法修改该文件。即使是root用户也不可以修改、删除、覆盖、移动或者重命名这个文件。如果你想再次修改这个文件,需要先把“不可变更”标志位取消了。 用如下命令取消“不可变更”标志位: @@ -54,11 +54,11 @@ $ sudo chattr +a /var/log/syslog -注意当你复制一个“不可变更”或者“只可追加”的文件到其他地方后,新文件不会保留这些标志位。 +注意当你复制一个“不可变更”或者“只可追加”的文件到其他地方后,新文件不会保留这些标志位! ### 结论 ### -在这个教程中,我展示了如何使用`chattr`和`lsattr`命令来管理额外的文件标志位,来避免文件被篡改(意外或者其他情况)的方法。注意你不能将`chattr`作为一个安全措施,因为“不可变更”标志位可以很容易被取消掉。解决这个问题的一个可能的方式是限制`chattr`命令自身的可用性,或者剥夺CAP_LINUX_IMMUTABLE内核权能标志。关于`chattr`以及可用的标志位的更多细节,请参考它的man手册。 +在这个教程中,我展示了如何使用`chattr`和`lsattr`命令来管理额外的文件标志位,来避免文件被篡改(意外或者其他情况)的方法。注意你不能将`chattr`作为一个安全措施,因为“不可变更”标志位可以很容易被取消掉。解决这个问题的一个可能的方式是限制`chattr`命令自身的可用性,或者去掉CAP_LINUX_IMMUTABLE内核权能标志。关于`chattr`以及可用的标志位的更多细节,请参考它的man手册。 -------------------------------------------------------------------------------- @@ -66,7 +66,7 @@ via: http://xmodulo.com/make-file-immutable-linux.html 作者:[Dan Nanni][a] 译者:[goreliu](https://github.com/goreliu) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 From 64adbec1e8e78adba0ef9e487ba61b7c3c2a3b32 Mon Sep 17 00:00:00 2001 From: ZTinoZ Date: Tue, 19 May 2015 13:26:38 +0800 Subject: [PATCH 082/965] Translating by ZTinoZ --- ...o After Installing Ubuntu 15.04 Desktop.md | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/sources/tech/20150427 15 Things to Do After Installing Ubuntu 15.04 Desktop.md b/sources/tech/20150427 15 Things to Do After Installing Ubuntu 15.04 Desktop.md index 9c43d734a8..593d9c761d 100644 --- a/sources/tech/20150427 15 Things to Do After Installing Ubuntu 15.04 Desktop.md +++ b/sources/tech/20150427 15 Things to Do After Installing Ubuntu 15.04 Desktop.md @@ -36,7 +36,7 @@ Install Drivers ### 3. 安装Synaptic和Gdebi工具 ### -Besides Ubuntu Software Center, Synaptic is a Graphical utility for apt command line through which you can manage repositories or install, remove, search, upgrade and configure software packages. Similar way, Gdebi has the same functionality for local .deb packages. To install this two package managers on your system issue the following command on Terminal: +除了Ubuntu Software Center,Synaptic是一个apt图形化工具,通过它你能管理、安装、卸载、搜索和升级软件库并配置软件包。同样的,Gdebi在功能上也有相同的地方。在终端上输入以下命令来安装这两个包: $ sudo apt-get install synaptic gdebi @@ -48,7 +48,7 @@ Synaptic Package Manager ### 4. 更改系统外观和运行状态 ### -If you want to change Desktop Background or Launcher Icon Size, open System Settings –> Appearance –> Look and personalize the desktop. To move the menu to window title bar, enable workspaces and desktop icons or auto-hide the Launcher visit Behavior tab. +如果你想要更改桌面背景或图标大小,依次打开System Settings –> Appearance –> Look并对桌面进行个性化设置,把菜单移动到窗口标题栏,在Behavior标签中启动workspaces和desktop icons或开关auto-hide the Launcher。 ![System Appearances](http://www.tecmint.com/wp-content/uploads/2015/04/system-appearance.jpg) System Appearances @@ -61,16 +61,16 @@ System Security Enhancement ![System Security Options](http://www.tecmint.com/wp-content/uploads/2015/04/system-security-2.jpg) System Security Options -### 5. 禁用不需要开机自启动的应用程序 ### +### 6. 禁用不需要开机自启动的应用程序 ### -To improve system login speed, reveal hidden Startup Applications by issuing the below command on Terminal, open Startup Applications utility by searching it in Dash and uncheck the unneeded applications during login process. +要提高登录系统的速度,通过输入以下命令来显示被隐藏的开机启动应用程序,在Dash中搜索它就能打开Startup Applications工具并反选不需要再登录系统的过程中启动的程序。 $ sudo sed -i ‘s/NoDisplay=true/NoDisplay=false/g’ /etc/xdg/autostart/*.desktop ![Disable Unwanted Applications](http://www.tecmint.com/wp-content/uploads/2015/04/disable-unwanted-applications.jpg) Disable Unwanted Applications -### 6. 添加扩展多媒体支持 ### +### 7. 添加扩展多媒体支持 ### By default, Ubuntu comes with a minimal support for media files. In order to play various media formats or manipulate video files, install the following multimedia applications: @@ -108,7 +108,7 @@ To enable DVD Playback and other multimedia codecs issue the following command o ![Enable Video Codes](http://www.tecmint.com/wp-content/uploads/2015/04/enable-video-playbacks.jpg) Enable Video Codes -### 7. 安装图像处理应用程序 ### +### 8. 安装图像处理应用程序 ### If you are a photography enthusiast and you want to handle and manipulate images on Ubuntu, probably you want to install the following imaging programs: @@ -131,7 +131,7 @@ Install Image Applications ![Rawtherapee Tool](http://www.tecmint.com/wp-content/uploads/2015/04/rawtherapee.jpg) Rawtherapee Tool -### 8. 安装媒体烧录软件 ### +### 9. 安装媒体烧录软件 ### To mount ISO images or burn a CDs or a DVD, you can choose and install from the following software: @@ -148,7 +148,7 @@ To mount ISO images or burn a CDs or a DVD, you can choose and install from the ![Install Media Burners](http://www.tecmint.com/wp-content/uploads/2015/04/install-media-burners.jpg) Install Media Burners -### 9. 安装压缩应用程序 ### +### 10. 安装压缩应用程序 ### To handle most of archive formatted files (zip, tar.gz, zip, 7zip rar etc) install the following packages by issuing the below command: @@ -157,7 +157,7 @@ To handle most of archive formatted files (zip, tar.gz, zip, 7zip rar etc) insta ![Install Archive Applications](http://www.tecmint.com/wp-content/uploads/2015/04/install-archive-apps.jpg) Install Archive Applications -### 10. 安装聊天应用程序 ### +### 11. 安装聊天应用程序 ### If you want to talk to people all over the world, here is a list of the most popular chat applications for Linux: @@ -186,7 +186,7 @@ To install Viber application on Ubuntu visit [Viber official webpage][1], downlo ![Install Viber in Ubuntu](http://www.tecmint.com/wp-content/uploads/2015/04/install-viber.jpg) Install Viber -### 11. 安装种子软件 ### +### 12. 安装种子软件 ### The most popular torrent applications and peer-to-peer file sharing programs for Ubuntu are: @@ -205,7 +205,7 @@ To install your favorite peer-to-peer file sharing application on Ubuntu issue t ![Install Torrent](http://www.tecmint.com/wp-content/uploads/2015/04/install-torrent.jpg) Install Torrent -### 12. 安装Windows仿真器-Wine和游戏支持平台-Steam ### +### 13. 安装Windows仿真器-Wine和游戏支持平台-Steam ### Wine emulator allows you to install and run Windows applications on Linux. On the other hand, Steam is a popular gaming platform for Linux based systems developed by Valve. To install both of them on your machine issue the following command on Terminal or use Ubuntu Software Center. @@ -214,7 +214,7 @@ Wine emulator allows you to install and run Windows applications on Linux. On th ![Install Wine](http://www.tecmint.com/wp-content/uploads/2015/04/install-wine.jpg) Install Wine -### 13. 安装Cairo-Dock并启用桌面视觉效果 ### +### 14. 安装Cairo-Dock并启用桌面视觉效果 ### Cairo-Dock is a beautiful and flexible launcher bar for Linux desktops similar to the Mac OS X dock. To install it on Ubuntu, run the following command on Terminal. @@ -244,7 +244,7 @@ Compiz Settings Addons ![Desktop Window Rotating](http://www.tecmint.com/wp-content/uploads/2015/04/desktop-cube.jpg) Desktop Window Rotating -### 14. 添加额外浏览器支持 ### +### 15. 添加额外浏览器支持 ### Ubuntu 15.04 comes by default with Mozilla Firefox Web Browser. To install other browsers such as Google Chrome or Opera, visit their official web pages, download the provided .deb packages and install them on your system using the Gdebi Package Installer. @@ -258,7 +258,7 @@ To install Chromium Open Source browser issue the following command on Terminal. $ sudo apt-get install chromium-browser -### 15. 安装Tweak工具 ### +### 16. 安装Tweak工具 ### Want extra applications for customizing Ubuntu? Then install Unity Tweak Tool and Gnome Tweak Tool by issuing the following commands on Terminal. From bb33174d6e1fd06edeb1890769b38096937891cd Mon Sep 17 00:00:00 2001 From: Gore Liu Date: Tue, 19 May 2015 13:50:33 +0800 Subject: [PATCH 083/965] [Translated] 20150316 5 Interesting Command Line Tips and Tricks in Linux--Part 1.md --- ...d Line Tips and Tricks in Linux--Part 1.md | 117 ------------------ ...d Line Tips and Tricks in Linux--Part 1.md | 115 +++++++++++++++++ 2 files changed, 115 insertions(+), 117 deletions(-) delete mode 100644 sources/tech/20150316 5 Interesting Command Line Tips and Tricks in Linux--Part 1.md create mode 100644 translated/tech/20150316 5 Interesting Command Line Tips and Tricks in Linux--Part 1.md diff --git a/sources/tech/20150316 5 Interesting Command Line Tips and Tricks in Linux--Part 1.md b/sources/tech/20150316 5 Interesting Command Line Tips and Tricks in Linux--Part 1.md deleted file mode 100644 index 073e5f9370..0000000000 --- a/sources/tech/20150316 5 Interesting Command Line Tips and Tricks in Linux--Part 1.md +++ /dev/null @@ -1,117 +0,0 @@ -Translating by goreliu ... - -5 Interesting Command Line Tips and Tricks in Linux – Part 1 -================================================================================ -Are you making most out of the Linux? There are lots of helpful features which appears to be Tips and Tricks for many of Linux Users. Sometimes Tips and Tricks become the need. It helps you get productive with the same set of commands yet with enhanced functionality. - -![5 Command Line Tips and Tricks](http://www.tecmint.com/wp-content/uploads/2015/03/5-Command-Line-Tips.jpg) -5 Command Line Tips and Tricks - -Here we are starting a new series, where we will be writing some tips and tricks and will try to yield as more as we can in small time. - -### 1. To audit the commands we’d run in past, we use [history command][1]. Here is a sample output of history command. ### - - # history - -![history command example](http://www.tecmint.com/wp-content/uploads/2015/03/history-command.gif) -history command example - -Obvious from output, the history command do not output the time stamp with the log of last executed commands. Any solution for this? Yeah! Run the below command. - - # HISTTIMEFORMAT="%d/%m/%y %T " - # history - -If you want to permanently append this change, add the below line to `~/.bashrc`. - - export HISTTIMEFORMAT="%d/%m/%y %T " - -and then, from terminal run, - - # source ~/.bashrc - -Explanation of commands and switches. - -- history – GNU History Library -- HISTIMEFORMAT – Environmental Variable -- %d – Day -- %m – Month -- %y – Year -- %T – Time Stamp -- source – in short send the contents of file to shell -- .bashrc – is a shell script that BASH runs whenever it is started interactively. - -![history Command Logs](http://www.tecmint.com/wp-content/uploads/2015/03/History-Command-Logs.gif) -history Command Logs - -### 2. The next gem in the list is – how to check disk write speed? Well one liner dd command script serves the purpose. ### - - # dd if=/dev/zero of=/tmp/output.img bs=8k count=256k conv=fdatasync; rm -rf /tmp/output.img - -![dd Command Example](http://www.tecmint.com/wp-content/uploads/2015/03/dd-Command-Example.gif) -dd Command Example - -Explanation of commands and switches. - -- dd – Convert and Copy a file -- if=/dev/zero – Read the file and not stdin -- of=/tmp/output.img – Write to file and not stdout -- bs – Read and Write maximum upto M bytes, at one time -- count – Copy N input block -- conv – Convert the file as per comma separated symbol list. -- rm – Removes files and folder -- -rf – (-r) removes directories and contents recursively and (-f) Force the removal without prompt. - -### 3. How will you check the top six files that are eating out your space? A simple one liner script made from [du command][2], which is primarily used as file space usages. ### - - # du -hsx * | sort -rh | head -6 - -![Check Disk Space Usage](http://www.tecmint.com/wp-content/uploads/2015/03/check-disk-space-usage.gif) -Check Disk Space Usage - -Explanation of commands and switches. - -- du – Estimate file space usages -- -hsx – (-h) Human Readable Format, (-s) Summaries Output, (-x) One File Format, skip directories on other file format. -- sort – Sort text file lines -- -rf – (-r) Reverse the result of comparison, (-f) Ignore case -- head – output first n lines of file. - -### 4. The next step involves statistics in terminal of a file of every kind. We can output the statistics related to a file with the help of stat (output file/fileSystem status) command. ### - - # stat filename_ext (viz., stat abc.pdf) - -![Check File Statistics](http://www.tecmint.com/wp-content/uploads/2015/03/Check-File-Statistics.gif) -Check File Statistics - -### 5. The next and last but not the least, this one line script is for those, who are newbies. If you are an experienced user you probably don’t need it, unless you want some fun out of it. Well newbies are Linux-command-line phobic and the below one liner will generate random man pages. The benefit is as a newbie you always get something to learn and never get bored. ### - - # man $(ls /bin | shuf | head -1) - -![Generate Random Man Pages](http://www.tecmint.com/wp-content/uploads/2015/03/Generate-Random-Man-Pages.gif) -Generate Random Man Pages - -Explanation of commands and switches. - -- man – Linux Man pages -- ls – Linux Listing Commands -- /bin – System Binary file Location -- shuf – Generate Random Permutation -- head – Output first n line of file. - -That’s all for now. If you know any such tips and tricks you may share with us and we will post the same in your words on our reputed Tecmint.com website. - -If you want to share any tips and tricks that you cannot make into article you may share it at tecmint[dot]com[at]gmail[dot]com and we will include it in our article. Don’t forget to provide us with your valuable feedback in the comments below. Keep connected. Like and share us and help us get spread. - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/5-linux-command-line-tricks/ - -作者:[Avishek Kumar][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://www.tecmint.com/author/avishek/ -[1]:http://www.tecmint.com/history-command-examples/ -[2]:http://www.tecmint.com/check-linux-disk-usage-of-files-and-directories/ diff --git a/translated/tech/20150316 5 Interesting Command Line Tips and Tricks in Linux--Part 1.md b/translated/tech/20150316 5 Interesting Command Line Tips and Tricks in Linux--Part 1.md new file mode 100644 index 0000000000..6bf88dba2c --- /dev/null +++ b/translated/tech/20150316 5 Interesting Command Line Tips and Tricks in Linux--Part 1.md @@ -0,0 +1,115 @@ +5个有趣的Linux命令行技巧(第一部分) +================================================================================ +你有将Linux物尽其用吗?对很多Linux用户来说,有很多看起来是技巧的有用特性。有些时候你会需要这些技巧。本文会帮助你更好得使用一些命令,发挥其更强大的功能。 + +![5个命令行技巧](http://www.tecmint.com/wp-content/uploads/2015/03/5-Command-Line-Tips.jpg) +图1:5个命令行技巧 + +我们开始一个新的系列,在这里我们还会写一些技巧,并且用尽量小的篇幅写清楚。 + +### 1. 我们可以使用[`history`命令][1]来查看曾经运行过的命令。这里是一个`history`命令的示例输出。 ### + + # history + +![history命令例子](http://www.tecmint.com/wp-content/uploads/2015/03/history-command.gif) +图2:history命令例子 + +从`history`命令输出看,很明显,命令的执行时间没有被打出来。有解决方法吗?有的!运行如下命令: + + # HISTTIMEFORMAT="%d/%m/%y %T " + # history + +如果你想让这个修改永久生效,添加如下的一行内容到`~/.bashrc`文件中: + + export HISTTIMEFORMAT="%d/%m/%y %T " + +然后,在终端中运行: + + # source ~/.bashrc + +命令和选项的解释: + +- history – 查看运行过的命令 +- HISTIMEFORMAT – 设置时间格式的环境变量 +- %d – 天 +- %m – 月 +- %y – 年 +- %T – 时间戳 +- source – 简而言之就是将文件内容发送给shell来执行 +- .bashrc – BASH以交互方式启动时运行的脚本文件 + +![history命令输出的日志](http://www.tecmint.com/wp-content/uploads/2015/03/History-Command-Logs.gif) +图3:`history`命令输出的日志 + +### 2. 如何测试磁盘写入速度?一行`dd`命令脚本就可以实现。### + + # dd if=/dev/zero of=/tmp/output.img bs=8k count=256k conv=fdatasync; rm -rf /tmp/output.img + +![dd命令例子](http://www.tecmint.com/wp-content/uploads/2015/03/dd-Command-Example.gif) +图4:`dd`命令例子 + +命令和选项的解释: + +- dd – 转换和复制文件 +- if=/dev/zero – 指定输入文件,默认为stdin(标准输入) +- of=/tmp/output.img – 指定输出文件,默认为stdout(标准输出) +- bs – 一次读和写的大小,最大可以以MB为单位 +- count – 复制次数 +- conv – 使用逗号分隔的策略来转换文件(LCTT 译注:比如将大写字母转换成小写,echo AA | dd conv=lcase) +- rm – 删除文件和目录 +- -rf – (-r) 递归地删除目录和其中的内容,(-f)强行删除而不输出确认信息 + +### 3. 你如何获取吃掉你磁盘空间的最大的6个文件?一个使用[`du`命令][2]的简单单行脚本即可实现,`du`命令主要用于获取文件的空间使用情况。### + + # du -hsx * | sort -rh | head -6 + +![获取磁盘空间使用情况的方法](http://www.tecmint.com/wp-content/uploads/2015/03/check-disk-space-usage.gif) +图5:获取磁盘空间使用情况的方法 + +命令和选项的解释: + +- du – 估计文件的空间使用情况 +- -hsx – (-h)更易读的格式,(-s)汇总输出,(-x)跳过其他文件系统的文件 +- sort – 对文本文件按行排序 +- -rf – (-r)将比较的结果逆序输出,(-f)忽略大小写 +- head – 输出文件的头几行 + +### 4. 获取一个文件的详细状态信息,可以使用`stat`命令。 ### + + # stat filename_ext (例如:stat abc.pdf) + +![获取文件的详细信息](http://www.tecmint.com/wp-content/uploads/2015/03/Check-File-Statistics.gif) +图6:获取文件的详细信息 + +### 5. 最后一个技巧是为那些入门者准备的,如果你是有经验的用户,可能不需要它,除非你想从中寻找乐趣。入门者可能有Linux命令行恐惧症,下面的命令会随机显示一个man手册页。对入门者来说,好处是总会学到新的东西,而且不会厌倦。 ### + + # man $(ls /bin | shuf | head -1) + +![查看随机的man手册页](http://www.tecmint.com/wp-content/uploads/2015/03/Generate-Random-Man-Pages.gif) +图7:查看随机的man手册页 + +命令和选项的解释: + +- man – Linux man手册 +- ls – 列出文件 +- /bin – 系统可执行文件的路径 +- shuf – 把输入内容按行随机打乱并输出 +- head – 输出文件的头几行 + +这就是所有的内容了。如果你知道任何类似的技巧,可以分享给我们,我们会用你的语言在Tecmint.com网站上发表出来。 + +如果你想分享任何技巧,但不想写成文章,可以发到tecmint[dot]com[at]gmail[dot]com,我们会将其包含在我们的文章中。不要忘记在下边评论框中留下有价值的反馈。保持联系。可以点赞或者将本文分享来帮助我们更好地传播内容。 + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/5-linux-command-line-tricks/ + +作者:[Avishek Kumar][a] +译者:[goreliu](https://github.com/goreliu) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/avishek/ +[1]:http://www.tecmint.com/history-command-examples/ +[2]:http://www.tecmint.com/check-linux-disk-usage-of-files-and-directories/ \ No newline at end of file From c2432fc19480b512e85308923e81144b988f7c00 Mon Sep 17 00:00:00 2001 From: Gore Liu Date: Tue, 19 May 2015 14:14:02 +0800 Subject: [PATCH 084/965] [Translating] 20150423 20 Awesome Docker Containers for a Desktop User.md --- .../20150423 20 Awesome Docker Containers for a Desktop User.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20150423 20 Awesome Docker Containers for a Desktop User.md b/sources/tech/20150423 20 Awesome Docker Containers for a Desktop User.md index 060aeb755d..00786e9bde 100644 --- a/sources/tech/20150423 20 Awesome Docker Containers for a Desktop User.md +++ b/sources/tech/20150423 20 Awesome Docker Containers for a Desktop User.md @@ -1,3 +1,5 @@ +Translating by gaoliu ... + 20 Awesome Docker Containers for a Desktop User ================================================================================ Greetings to everyone, today we'll list out some awesome Desktop Apps that we can run using Docker Containers in our very own Desktop running Docker. Docker is an Open Source project that provides an open platform to pack, ship and run any application as a lightweight container. It has no boundaries of Language support, Frameworks or packaging system and can be run anywhere, anytime from a small home computers to high-end servers. It makes them great building blocks for deploying and scaling web apps, databases, and back-end services without depending on a particular stack or provider. It is basically used by the developers, Ops and Engineers as it is easy, fast and handy tool for testing or deploying their products but we can also use Docker for our Desktop usage to run a desktop apps out of the box. From 9b1572335910695bdd0d99d9e0962081d79fb135 Mon Sep 17 00:00:00 2001 From: ictlyh Date: Tue, 19 May 2015 14:22:43 +0800 Subject: [PATCH 085/965] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E5=AE=8C=E6=88=90=20?= =?UTF-8?q?tech/20150518=20Linux=20FAQs=20with=20Answers--How=20to=20fix?= =?UTF-8?q?=20'Encountered=20a=20section=20with=20no=20Package--header'=20?= =?UTF-8?q?error=20on=20Raspbian=20tech/20150518=20Linux=20FAQs=20with=20A?= =?UTF-8?q?nswers--How=20to=20fix=20'fatal=20error--security=20or=20pam=5F?= =?UTF-8?q?modules.h--No=20such=20file=20or=20directory'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...with no Package--header' error on Raspbian.md | 12 ++++++------ ... pam_modules.h--No such file or directory'.md | 16 ++++++++-------- 2 files changed, 14 insertions(+), 14 deletions(-) rename {sources => translated}/tech/20150518 Linux FAQs with Answers--How to fix 'Encountered a section with no Package--header' error on Raspbian.md (51%) rename {sources => translated}/tech/20150518 Linux FAQs with Answers--How to fix 'fatal error--security or pam_modules.h--No such file or directory'.md (51%) diff --git a/sources/tech/20150518 Linux FAQs with Answers--How to fix 'Encountered a section with no Package--header' error on Raspbian.md b/translated/tech/20150518 Linux FAQs with Answers--How to fix 'Encountered a section with no Package--header' error on Raspbian.md similarity index 51% rename from sources/tech/20150518 Linux FAQs with Answers--How to fix 'Encountered a section with no Package--header' error on Raspbian.md rename to translated/tech/20150518 Linux FAQs with Answers--How to fix 'Encountered a section with no Package--header' error on Raspbian.md index f79090e1da..54e0f393d1 100644 --- a/sources/tech/20150518 Linux FAQs with Answers--How to fix 'Encountered a section with no Package--header' error on Raspbian.md +++ b/translated/tech/20150518 Linux FAQs with Answers--How to fix 'Encountered a section with no Package--header' error on Raspbian.md @@ -1,18 +1,18 @@ -Linux FAQs with Answers--How to fix “Encountered a section with no Package: header” error on Raspbian +Linux 有问必答--如何修复 Raspbian 上的 “Encountered a section with no Package: header” 错误 ================================================================================ -> **Question**: I installed fresh Rasbian on Raspberry Pi. But when I tried to update APT package index by running sudo apt-get update, it throws the following error: +> **问题**: 我在 Raspberry Pi 上安装新版的 Rasbian。但当我使用 sudo apt-get update 命令更新 APT 软件包索引的时候,它抛出下面的错误: E: Encountered a section with no Package: header E: Problem with MergeList /var/lib/dpkg/status E: The package lists or status file could not be parsed or opened. -> I then cannot install any package on Raspbian. How can I solve this error? +> 之后我不能在 Raspbian 上安装任何软件包。我怎样才能解决这个错误? ![](https://farm8.staticflickr.com/7704/17445484636_05ba81722f_c.jpg) -The error saying "Problem with MergeList /var/lib/dpkg/status" indicates that the status file got corrupted for some reason, and so cannot be parsed. This status file contains information about installed deb packages, and thus needs to be carefully backed up. +错误说 "Problem with MergeList /var/lib/dpkg/status" 表示由于某些原因状态文件损坏了,因此无法解释。这个状态文件包括了已经安装的 deb 软件包的信息,因此需要小心备份。 -In this case, since this is freshly installed Raspbian, you can safely remove the status file, and re-generate it as follows. +在这种情况下,由于这是新安装的 Raspbian,你可以安全地删除状态文件,然后用下面的命令重新生成。 $ sudo rm /var/lib/dpkg/status $ sudo touch /var/lib/dpkg/status @@ -23,7 +23,7 @@ In this case, since this is freshly installed Raspbian, you can safely remove th via: http://ask.xmodulo.com/encountered-section-with-no-package-header-error.html 作者:[Dan Nanni][a] -译者:[译者ID](https://github.com/译者ID) +译者:[ictlyh](https://github.com/ictlyh) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 diff --git a/sources/tech/20150518 Linux FAQs with Answers--How to fix 'fatal error--security or pam_modules.h--No such file or directory'.md b/translated/tech/20150518 Linux FAQs with Answers--How to fix 'fatal error--security or pam_modules.h--No such file or directory'.md similarity index 51% rename from sources/tech/20150518 Linux FAQs with Answers--How to fix 'fatal error--security or pam_modules.h--No such file or directory'.md rename to translated/tech/20150518 Linux FAQs with Answers--How to fix 'fatal error--security or pam_modules.h--No such file or directory'.md index 55c17e1669..0e2d0ab54c 100644 --- a/sources/tech/20150518 Linux FAQs with Answers--How to fix 'fatal error--security or pam_modules.h--No such file or directory'.md +++ b/translated/tech/20150518 Linux FAQs with Answers--How to fix 'fatal error--security or pam_modules.h--No such file or directory'.md @@ -1,22 +1,22 @@ -Linux FAQs with Answers--How to fix “fatal error: security/pam_modules.h: No such file or directory” +Linux 有问必答--如何修复 “fatal error: security/pam_modules.h: No such file or directory” ================================================================================ -> **Question**: I was trying to compile a program on [insert your Linux distro], but was getting the following compile error: +> **问题**: 我尝试在 [插入你的 Linux 发行版] 上编译程序,但是出现下面的编译错误: > > "pam_otpw.c:27:34: fatal error: security/pam_modules.h: No such file or directory" > -> How can I fix this error? +> 我怎样才能修复这个错误? -The missing header file 'security/pam_modules.h' is part of development files for libpam, a PAM (Pluggable Authentication Modules) library. Thus to fix this error, you need to install libpam development package, as described below. +缺失的头文件 'security/pam_modules.h' 是 libpam 开发版的一部分,一个 PAM(Pluggable Authentication Modules:插入式验证模块)库。因此要修复这个错误,你需要安装 libpam 开发包,如下所示。 -On Debian, Ubuntu or Linux Mint: +对于 Debian、 Ubuntu 或者 Linux Mint: $ sudo apt-get install libpam0g-dev -On CentOS, Fedora or RHEL: +对与 CentOS、 Fedora 或者 RHEL: $ sudo yum install gcc pam-devel -Now verify that the missing header file is installed under /usr/include/security. +现在验证缺失的头文件是否安装到了 /usr/include/security。 ![](https://farm8.staticflickr.com/7751/16819069693_fa961f0d40_b.jpg) @@ -25,7 +25,7 @@ Now verify that the missing header file is installed under /usr/include/security via: http://ask.xmodulo.com/fatal-error-security-pam-modules.html 作者:[Dan Nanni][a] -译者:[译者ID](https://github.com/译者ID) +译者:[ictlyh](https://github.com/ictlyh) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 251b64df9b4957eeba996357204aa85fdc31194a Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 19 May 2015 15:10:18 +0800 Subject: [PATCH 086/965] PUB:20150309 List Of Free Windows SSH Client Tools To Connect To Your Linux Server @wi-cuckoo --- ... Tools To Connect To Your Linux Server .md | 82 +++++++++++++++++++ ... Tools To Connect To Your Linux Server .md | 81 ------------------ 2 files changed, 82 insertions(+), 81 deletions(-) create mode 100644 published/20150309 List Of Free Windows SSH Client Tools To Connect To Your Linux Server .md delete mode 100644 translated/tech/20150309 List Of Free Windows SSH Client Tools To Connect To Your Linux Server .md diff --git a/published/20150309 List Of Free Windows SSH Client Tools To Connect To Your Linux Server .md b/published/20150309 List Of Free Windows SSH Client Tools To Connect To Your Linux Server .md new file mode 100644 index 0000000000..d75ecbb555 --- /dev/null +++ b/published/20150309 List Of Free Windows SSH Client Tools To Connect To Your Linux Server .md @@ -0,0 +1,82 @@ +Windows 下的免费 SSH 客户端工具 +================================================================================ + +如果你的操作系统是 Windows,而你想要连接 Linux 服务器相互传送文件,那么你需要一个简称 SSH 的 Secure Shell 软件。实际上,SSH 是一个网络协议,它允许你通过网络连接到 Linux 和 Unix 服务器。SSH 使用公钥加密来认证远程的计算机。你可以有多种途径使用 SSH,无论是自动连接,还是使用密码认证登录。 + +本篇文章介绍了几种可以连接 Linux 服务器 SSH 客户端。 + +让我们开始。 + +### Putty ### + +**Putty** 是最有名的 SSH 和 telnet 客户端,最初由 Simon Tatham 为 Windows 平台开发。Putty 是一款开源软件,有可用的源代码,和一群志愿者的开发和支持。 + +![](http://www.unixmen.com/wp-content/uploads/2015/03/putty.png) + +Putty 非常易于安装和使用,通常大部分的配置选项你都不需要修改。你只需要输入少量基本的参数,就可以开始很简单地建立连接会话。[点此下载][1] Putty。 + +### Bitvise SSH Client ### + +**Bitvise SSH** 是一款支持 SSH 和 SFTP 的 Windows 客户端。由 Bitvise 开发和提供专业支持。这款 SSH 客户端性能强悍,易于安装、便于使用。Bitvise SSH 客户端拥有功能丰富的图形界面,通过一个有自动重连功能的内置代理进行动态端口转发。 + +![](http://www.unixmen.com/wp-content/uploads/2015/03/bitvise.png) + +Bitvise SSH 客户端对**个人用户使用是免费的**,同时对于在组织内部的个人商业使用也一样。你可以[在这里下载 Bitvise SSH 客户端][2]。 + +### MobaXterm ### + +**MobaXterm** 是你的**远程计算的终极工具箱**。在一个 Windows 应用里,它为程序员、网管、IT 管理员及其它用户提供了精心裁剪的一揽子功能,让他们的远程操作变得简约时尚。 + +![](http://www.unixmen.com/wp-content/uploads/2015/03/mobaxterm.png) + +MobaXterm 提供了所有重要的**远程网络工具** (如SSH、 X11、 RDP、 VNC、 FTP、 MOSH 等等),以及 Windows 桌面上的 **Unix 命令**(bash、 ls、 cat、sed、 grep、 awk、 rsync等等),而这些都是由一个开箱即用的**单一的便携程序**所提供。MobaXterm 对**个人使用免费**,你可以[在这里][3]下载 MobaXterm。 + +### DameWare SSH ### + +我认为 **DameWare SSH** 是最好的免费SSH客户端。 + +![](http://www.unixmen.com/wp-content/uploads/2015/03/ssh.png) + +这个免费工具是一个终端模拟器,可以让你从一个易用的控制台建立多个 telnet 和 SSH 连接。 + +-用一个带标签的控制台界面管理多个会话 +-将常用的会话保存在 Windows 文件系统中 +-使用多套保存的证书来轻松登录不同的设备 +-使用 telnet、SSH1 和 SSH2 协议连接计算机和设备 + +你可以从[这个链接][4]下载 **DameWare SSH**。 + +### SmarTTY ### +  +SmarTTY 是一款免费的多标签 SSH 客户端,支持使用 SCP 命令随时复制文件和目录。 + +![](http://www.unixmen.com/wp-content/uploads/2015/03/smart.png) + +大多数 SSH 服务器每个连接支持最多10个子会话.SmarTTY 在这方面做得很好:没有烦人的多个窗口,不需要重新登录,仅仅打开一个新的标签页就可以开始了! + +### Cygwin ### + +Cygwin 是一款 GNU 和开源工具的大杂烩,提供的功能近似于一个 Windows 平台下的 Linux。 + +![](http://www.unixmen.com/wp-content/uploads/2015/03/cyq.png) + +**Cygwin** 包括了一个称为模拟库的 Unix 系统:cygwin.dll,集成了大量的 GNU 和其它的免费软件,以大量的可选包方式组织而成。在这些安装包中,有高质量的编译器和其他软件开发工具、一个X11服务器、一套完整的X11开发套件、GNU emacs 编辑器、Tex 和 LaTeX、openSSH(客户端和服务器),除此之外还有很多,包括在微软 Windows 下需要编译和使用 PhysioToolkit 软件的每一样东西。 + +读完我们的文章后,不知你中意哪一款 SSH 客户端?你可以留下你的评论,描述你喜欢的系统和选择的原因。当然,如果有另外的 SSH 客户端没有被本文列举出来,你可以帮助我们补充。 + +-------------------------------------------------------------------------------- + +via: http://www.unixmen.com/list-free-windows-ssh-client-tools-connect-linux-server/ + +作者:[anismaj][a] +译者:[wi-cuckoo](http://github.com/wi-cuckoo) +校对:[wxy](http://github.com/wxy) + +本文由 [LCTT](http://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://www.unixmen.com/author/anis/ +[1]:http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html +[2]:http://www.bitvise.com/download-area +[3]:http://mobaxterm.mobatek.net/download.html +[4]:http://www.dameware.com/downloads/registration.aspx?productType=ssh&AppID=17471&CampaignID=70150000000PcNM +[5]:http://cygwin.com/packages/ diff --git a/translated/tech/20150309 List Of Free Windows SSH Client Tools To Connect To Your Linux Server .md b/translated/tech/20150309 List Of Free Windows SSH Client Tools To Connect To Your Linux Server .md deleted file mode 100644 index ccb4bc2fec..0000000000 --- a/translated/tech/20150309 List Of Free Windows SSH Client Tools To Connect To Your Linux Server .md +++ /dev/null @@ -1,81 +0,0 @@ -在windows下,连接你的Linux服务器的ssh免费客户端工具列举\ -================================================================================ -你的操作系统是Windows,而你想要连接Linux服务器相互传送文件.于是你需要一个Secure Shell,简称SSH.实际上,SSH是一个网络协议,允许你通过网络连接到Linux和Unix服务器.SSH使用公钥加密来认证远程的计算机.你可以有多种途径使用SSH,要么自动地连接,或者使用密码认证登录. - -本篇文章讲述了几种SSH客户端,供选择使用来连接你的Linux服务器. - -我们开始. - -### Putty ### - -**Putty**是最有名的SSH和telnet客户端,最初由Simon Tatham为Windows平台开发.Putty是一款开源软件,有可用的源代码,和一群志愿者的发展和支持. - -![](https://www.unixmen.com/wp-content/uploads/2015/03/putty.png) - -Putty非常易于安装和使用,通常你不需要改大部分的配置选项.你只需要输入少量基本的参赛,就可以开始最简单的对话连接[here][1]. - -### Bitvise SSH Client ### - -**Bitvise SSH **是一款支持SSH和SFTP的Windows客户端.由Bitvise专业地提供支持和发展.这款SSH客户端性能强悍,易于安装和使用.Bitvise SSH客户端功能丰富,拥有图形界面,通过一个有自动重连能力的内置代理允许用户动态端口运行. - -![](https://www.unixmen.com/wp-content/uploads/2015/03/bitvise.png) - -Bitvise SSH客户端对个人用户使用**是**免费的,同时对于在组织内部的单独商业使用也一样.你可以[在这里下载Bitvise SSH客户端][2] - -### MobaXterm ### - -**M偶吧Xterm**是你的**终极工具箱,解决远程计算**.在单一的Windows应用里,它提供了许多裁剪过的的功能,针对程序员,网络管理者,IT管理员和相当一部分需要在更简单界面(此处原文为in a more simple fashion,有点费解)远程作业的用户. - -![](https://www.unixmen.com/wp-content/uploads/2015/03/mobaxterm.png) - -MobaXterm提供了所有重要的**远程网络工具** (如SSH, X11, RDP, VNC, FTP, MOSH 等等),和**Unix 命令**(bash, ls, cat, sed, grep, awk, rsync等等)适用于Windows桌面,在一个**单独便于携带的可执行文件里**,其工作独立于工具箱.MobaXterm对**个人使用免费**.你可以下载MobaXterm[在这里][3]. - -### DameWare SSH ### - -我认为**DameWare SSH**是最好的免费SSH客户端. - -![](https://www.unixmen.com/wp-content/uploads/2015/03/ssh.png) - -这个免费工具是一个终端模拟器,可以让你实现从一个易用控制台的多种telnet和SSH连接. - --用一个带标签的控制台界面管理多方会话 --在Windows文件系统中保存喜欢的会话 --获取多个保存的证书集合,用于轻松登录不同的设备 --使用telnet,SSH1和SSH2协议连接计算机和设备 - -你可以从[这个链接][4]下载 **DameWare SSH** - -### SmarTTY ### -  -SmarTTY是一款免费的多标签SSH客户端,支持使用SCP命令及时复制文件和目录 - -![](https://www.unixmen.com/wp-content/uploads/2015/03/smart.png) - -大多数SSH服务器每次连接支持最多10个子会话.SmarTTY在这方面做得很好:没有烦人的多个窗口,不需要重新登录,仅仅打开一个新的标签页就可以开始了! - -### Cygwin ### - -Cygwin是一款GNU和开源工具的大杂烩,提供的功能近似一个Windows平台下的Linux. - -![](https://www.unixmen.com/wp-content/uploads/2015/03/cyq.png) - -**Cygwin**包括了一个Unix系统,集模拟库,cygwin.dll,GNU大量集合和其他被归类了的大量可选免费应用软件包.在这些安装包中,有高质量的编译器和其他软件开发工具,一个X11服务器,一套完整的X11开发套件,GNU emacs编辑器,Tex和LaTeX,openSSH(客户端和服务器),除此之外还有很多,包括在微软Windows下需要编译和使用PhysioToolkit软件的每一样东西. - -读完我们的文章后,不知你中意哪一款SSH客户端?你可以留下你的评论,描述你喜欢的系统和选择的原因.当然,如果有另外的SSH客户端没有被本文列举出来,你可以帮助我们补充. - --------------------------------------------------------------------------------- - -via: https://www.unixmen.com/list-free-windows-ssh-client-tools-connect-linux-server/ - -作者:[anismaj][a] -译者:[wi-cuckoo](https://github.com/wi-cuckoo) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:https://www.unixmen.com/author/anis/ -[1]:http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html -[2]:http://www.bitvise.com/download-area -[3]:http://mobaxterm.mobatek.net/download.html -[4]:http://www.dameware.com/downloads/registration.aspx?productType=ssh&AppID=17471&CampaignID=70150000000PcNM -[5]:http://cygwin.com/packages/ From c05eb203cea9cc0e7d4dcde70a1e55da5ef9b9b1 Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 19 May 2015 22:13:56 +0800 Subject: [PATCH 087/965] PUB:20150316 How to access Gmail from the command line on Linux with Alpine MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @FSSlc 遇到 youtube 视频,可以将视频搬运到国内的视频网站,然后指向该视频,如果视频不太重要的话,可以仅仅留个 youtube 的链接即可。 --- ...m the command line on Linux with Alpine.md | 38 +++++++++---------- 1 file changed, 18 insertions(+), 20 deletions(-) rename {translated/tech => published}/20150316 How to access Gmail from the command line on Linux with Alpine.md (55%) diff --git a/translated/tech/20150316 How to access Gmail from the command line on Linux with Alpine.md b/published/20150316 How to access Gmail from the command line on Linux with Alpine.md similarity index 55% rename from translated/tech/20150316 How to access Gmail from the command line on Linux with Alpine.md rename to published/20150316 How to access Gmail from the command line on Linux with Alpine.md index ce347ad4e6..0d78b2fd34 100644 --- a/translated/tech/20150316 How to access Gmail from the command line on Linux with Alpine.md +++ b/published/20150316 How to access Gmail from the command line on Linux with Alpine.md @@ -1,12 +1,13 @@ -如何在 Linux 中使用 Alpine 在命令行里获取 Gmail +如何在 Linux 中使用 Alpine 在命令行里访问 Gmail ================================================================================ -假如你是一个命令行爱好者,我很确信你将张开双臂欢迎任何可以使你使用这个强大的工作环境来执行哪怕一项日常任务的工具,例如从 [安排日程][1] 、 [管理财务][2] 到 获取 [Facebook][3] 、[Twitter][4]等任务。 -在这个帖子中,我将为你展示 Linux 命令行的另一个漂亮干练的使用案例:**获取 Google 的 Gmail 服务**,为此,我们将使用 Alpine,一个基于 ncurses 的多功能命令行邮件客户端(不要和 Alpine Linux 搞混淆)。我们将在 Alphine 中配置 Gmail 的 IMAP 和 SMTP 设定来通过 Google 的邮件服务器在终端环境中收取和发送邮件。在这个教程的最后,你将意识到只需几步就可以在 Alpine 中使用其他的邮件服务。 +假如你是一个命令行爱好者,我很确信你会使用这个强大的工作环境来执行哪怕是一项日常任务的工具,并为之欢呼,例如从 [安排日程][1] 、 [管理财务][2] 到 获取 [Facebook][3] 、[Twitter][4]等任务。(LCTT 译注:阅读本文的另一个前提是,假如你还能访问 Gmail 或者知道 Gmail 是什么的话。) -诚然,已有许多卓越的基于 GUI 的邮件客户端存在,例如 Thunderbird, Evolution 或者甚至是 Web 界面,那么为什么还有人对使用命令行的邮件客户端来收取 Gmail 这样的事感兴趣呢?答案很简单。假如你需要快速地处理好事情并想避免使用不必要系统资源;或者你正工作在一个最小化安装(注:这里我感觉自己翻译有误)的服务器上,而它没有安装 X 服务(注:这里也需要更改);又或者是 X 服务在你的桌面上崩溃了,而你需要在解决这个问题之前急切地发送一些邮件。在上述所有的情况下, Alpine 都可以派上用场并在任何时间满足你的需求。 +在这个帖子中,我将为你展示 Linux 命令行的另一个漂亮干练的使用案例:**访问 Google 的 Gmail 服务**,为此,我们将使用 Alpine,一个基于 ncurses 的多功能命令行邮件客户端(不要和 Alpine Linux 搞混淆)。我们将在 Alphine 中配置 Gmail 的 IMAP 和 SMTP 设定,通过 Google 的邮件服务器在终端环境中收取和发送邮件。在这个教程的最后,你将发现只需几步就可以在 Alpine 中使用其他的邮件服务。 -除了简单的编辑,发送和接收文本类的邮件信息等功能外, Alpine 还可以进行加密,解密和对邮件信息进行数字签名,以及与 TLS(注:Transport Layer Security) 无缝集成。 +诚然,已有许多卓越的基于 GUI 的邮件客户端存在,例如 Thunderbird, Evolution 或者甚至是 Web 界面,那么为什么还有人对使用命令行的邮件客户端来收取 Gmail 这样的事感兴趣呢?答案很简单。假如你需要快速地处理好事情并想避免浪费不必要系统资源;或者你正工作在一个精简安装无操作台的服务器上,它没有安装用于图形显示的 X 服务;又或者是 X 服务在你的桌面上崩溃了,而你需要在解决这个问题之前急切地发送一些邮件。在上述所有的情况下, Alpine 都可以派上用场并在任何时间满足你的需求。 + +除了简单的编辑,发送和接收文本类的邮件信息等功能外, Alpine 还可以进行加密,解密和对邮件信息进行数字签名,以及与 TLS(注:Transport Layer Security,传输层加密)无缝集成。 ### 在 Linux 上安装 Alpine ### @@ -22,16 +23,13 @@ # alpine -在你第一次启用 Alpine 时,它将在当前用户的家目录下创建一个邮件文件夹(`~/mail`),并显现出主界面,正如下面的截屏所显示的那样: - -注:youtube视频,发布的时候做个链接吧(注:这里我不知道该如何操作,不过我已经下载了该视频,如有需要,可以发送) - +在你第一次启用 Alpine 时,它将在当前用户的家目录下创建一个邮件文件夹(`~/mail`),并显现出主界面,正如下面的视频所显示的那样:YOUTUBU 视频 - http://www.youtube.com/kuKiv3uze4U 。 它的用户界面有下列几个模块: ![](https://farm9.staticflickr.com/8724/16618079590_6c236ce2c2_c.jpg) -请随意地浏览,操作来熟悉 Alpine。你总是可以在任何时候通过敲 'Q' 来回到命令提示符界面。请注意,所有的字符界面下方都有与操作相关的帮助。 +请随意地浏览、操作来熟悉 Alpine。你总是可以在任何时候通过敲 'Q' 来回到命令提示符界面。请注意,所有的字符界面下方都有与操作相关的帮助。 在进一步深入之前,我们将为 Alpine 创建一个默认的配置文件。为此,请关闭 Alpine,然后在命令行中执行下面的命令: @@ -39,9 +37,9 @@ ### 配置 Alpine 来使用 Gmail 账号 ### -一旦你安装了 Alpine 并至少花费了几分钟的时间来熟悉它的界面和菜单,下面便是实际配置它来使用一个已有的 Gmail 账户的时候了。 +当你安装了 Alpine 并至少花费了几分钟的时间来熟悉它的界面和菜单,下面便是实际配置它来使用一个已有的 Gmail 账户的时候了。 -在 Alpine 中执行下面的步骤之前,记得要通过你的 Web 邮件界面,在你的 Gmail 设定里启用 IMAP 协议。一旦在你的 Gmail 账户中 IMAP 被启用,执行下面的步骤来在 Alpine 中启用阅读 Gmail 信息的功能。 +在 Alpine 中执行下面的步骤之前,记得首先要通过你的 Web 邮件界面,在你的 Gmail 设定里启用 IMAP 协议。一旦在你的 Gmail 账户中启用了 IMAP ,执行下面的步骤来在 Alpine 中启用阅读 Gmail 信息的功能。 首先,启动 Alpine。 @@ -51,12 +49,12 @@ 按 'A' 来新建一个文件夹并填写必要的信息: -- **昵称**: 填写任何你想写的名字; -- **服务器**: imap.gmail.com/ssl/user=yourgmailusername@gmail.com +- **Nickname**: 填写任何你想写的名字; +- **Server**: imap.gmail.com/ssl/user=yourgmailusername@gmail.com 你可以将 `Path` 和 `View` 留白不填。 -然后按 `Ctrl+X` 并在有提示时输入你的 Gmail 密码: +然后按 `Ctrl+X` 并在提示时输入你的 Gmail 密码: ![](https://farm9.staticflickr.com/8611/16618079640_6f7dca336a_b.jpg) @@ -64,7 +62,7 @@ ![](https://farm8.staticflickr.com/7598/16804355052_10c1a6c5bd_b.jpg) -为了验证,你可以比较在 Alpine 中显示的 "Gmail Sent" 信箱和在 Web 界面下的信箱: +要验证的话,你可以比较在 Alpine 中显示的 "Gmail Sent" 信箱和在 Web 界面下的信箱: ![](https://farm8.staticflickr.com/7602/16619323939_d2eab3e162_c.jpg) @@ -73,7 +71,7 @@ # The approximate number of seconds between checks for new mail mail-check-interval=10 -最后,我们需要配置一个 SMTP 服务器来通过 Alpine 发送邮件信息。回到先前解释过的 Alpine 的设置界面,然后按 'C' 来设定一个 Google 的 SMTP 服务器地址,你需要像下面这样编辑 `SMTP Server`(为了发送) 这一行内容: +最后,我们需要配置一个 SMTP 服务器来通过 Alpine 发送邮件。回到先前解释过的 Alpine 的设置界面,然后按 'C' 来设定一个 Google 的 SMTP 服务器地址,你需要像下面这样编辑 `SMTP Server`(用于发送邮件)这一行内容: smtp.gmail.com:587/tls/user=yourgmailusername@gmail.com @@ -81,7 +79,7 @@ ### 总结 ### -在这个帖子里,我们讨论了在终端环境中如何通过一个名为 Alpha 的轻量且强大的命令行邮件客户端来获取 Gmail。 Alpine 是一个发布在 Apache Software License 2.0 协议下的自由软件,该协议与 GPL 协议相兼容。 Alpine 引以自豪的是:它不仅对新手友好,同时还做到了让那些经验丰富的系统管理员认为它是强大的。我希望在你阅读完这篇文章后,你能意识到我最后一个论断是多么的正确。 +在这个帖子里,我们讨论了在终端环境中如何通过一个名为 Alpine 的轻量且强大的命令行邮件客户端来访问 Gmail。 Alpine 是一个发布在 Apache Software License 2.0 协议下的自由软件,该协议与 GPL 协议相兼容。 Alpine 引以自豪的是:它不仅对新手友好,同时还做到了让那些经验丰富的系统管理员认为它是强大的。我希望在你阅读完这篇文章后,你能意识到我最后一个论断是多么的正确。 非常欢迎使用下面的输入框来留下你的评论或问题。我期待着你们的反馈! @@ -91,7 +89,7 @@ via: http://xmodulo.com/gmail-command-line-linux-alpine.html 作者:[Gabriel Cánepa][a] 译者:[FSSlc](https://github.com/FSSlc) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 @@ -100,4 +98,4 @@ via: http://xmodulo.com/gmail-command-line-linux-alpine.html [2]:http://xmodulo.com/manage-personal-expenses-command-line.html [3]:http://xmodulo.com/access-facebook-command-line-linux.html [4]:http://xmodulo.com/access-twitter-command-line-linux.html -[5]:http://xmodulo.com/how-to-set-up-epel-repository-on-centos.html +[5]:https://linux.cn/article-2324-1.html From 5c1673b7e6311c90e51651bbfbb1928f38364988 Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 19 May 2015 22:24:43 +0800 Subject: [PATCH 088/965] PUB:20150330 Linux FAQs with Answers--How to upgrade Docker on Ubuntu @geekpi --- ...ux FAQs with Answers--How to upgrade Docker on Ubuntu.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename {translated/tech => published}/20150330 Linux FAQs with Answers--How to upgrade Docker on Ubuntu.md (87%) diff --git a/translated/tech/20150330 Linux FAQs with Answers--How to upgrade Docker on Ubuntu.md b/published/20150330 Linux FAQs with Answers--How to upgrade Docker on Ubuntu.md similarity index 87% rename from translated/tech/20150330 Linux FAQs with Answers--How to upgrade Docker on Ubuntu.md rename to published/20150330 Linux FAQs with Answers--How to upgrade Docker on Ubuntu.md index 8d993c1c47..ad9ed38d09 100644 --- a/translated/tech/20150330 Linux FAQs with Answers--How to upgrade Docker on Ubuntu.md +++ b/published/20150330 Linux FAQs with Answers--How to upgrade Docker on Ubuntu.md @@ -1,8 +1,8 @@ -Linux有问必答-- 如何在Ubuntu中升级Docker +Linux有问必答:如何在Ubuntu中升级Docker ================================================================================ > **提问**: 我使用了Ubuntu的标准仓库安装了Docker。然而,默认安装的Docker不能满足我另外一个依赖Docker程序的版本需要。我该如何在Ubuntu中升级到Docker的最新版本? -Docker第一次在2013年发布,它快速地演变成了一个针对分布式程序的开发平台。为了满足工业期望,Docker正在紧密地开发并持续地带来新特性的升级。这样Ubuntu发行版中的Docker版本可能很快就会过时。比如,, Ubuntu 14.10 Utopic 中的Docker版本是1.2.0, 然而最新的Docker版本是1.5.0。 +Docker第一次在2013年发布,它快速地演变成了一个针对分布式程序的开发平台。为了满足工业期望,Docker正在紧密地开发并持续地带来新特性的升级。这样Ubuntu发行版中的Docker版本可能很快就会过时。比如, Ubuntu 14.10 Utopic 中的Docker版本是1.2.0, 然而最新的Docker版本是1.6.0。 ![](https://farm9.staticflickr.com/8730/16351300024_9acb9086da_b.jpg) @@ -28,7 +28,7 @@ via: http://ask.xmodulo.com/upgrade-docker-ubuntu.html 作者:[Dan Nanni][a] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 From ecc79cb1b9bd35e64f153736597b3795f65863bc Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 19 May 2015 22:51:04 +0800 Subject: [PATCH 089/965] PUB:20150324 4 Tools to Securely Delete Files from Linux MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @dbarobin 翻译的不错。 --- ...ols to Securely Delete Files from Linux.md | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) rename {translated/tech => published}/20150324 4 Tools to Securely Delete Files from Linux.md (58%) diff --git a/translated/tech/20150324 4 Tools to Securely Delete Files from Linux.md b/published/20150324 4 Tools to Securely Delete Files from Linux.md similarity index 58% rename from translated/tech/20150324 4 Tools to Securely Delete Files from Linux.md rename to published/20150324 4 Tools to Securely Delete Files from Linux.md index bbf0dcb3bf..5926279c9e 100644 --- a/translated/tech/20150324 4 Tools to Securely Delete Files from Linux.md +++ b/published/20150324 4 Tools to Securely Delete Files from Linux.md @@ -1,12 +1,13 @@ -# Linux 下四种安全删除文件的工具 # +Linux 下四种安全删除文件的工具 +=============== -任何一个普通水平的计算机用户都知道,从计算机系统中删除的任意数据都可以稍候通过一些努力恢复出来。当你不小心删除了你的重要数据,这是一个不错的方案。但是大多数情况,你不希望你的隐私数据被轻易地恢复。不论何时,我们删除任意的文件,操作系统删除的仅仅是特定数据的索引。这就意味着,数据仍然保存在磁盘的某块地方,这种方法是不安全的,任何一个聪明的计算机黑客可以使用任意不错的数据恢复工具来恢复你删除的数据。Linux 用户利用我们都知晓的 "rm" 命令来从他们的操作系统中删除数据,但是 "rm" 命令在约定俗成的场景下工作。从这个命令删除的数据也可以使用特殊的文件恢复工具恢复。 +任何一个普通水平的计算机用户都知道,从计算机系统中删除的任意数据都可以稍后通过一些努力恢复出来。当你不小心删除了你的重要数据时,这是一个不错的方案。但是大多数情况,你不希望你的隐私数据被轻易地恢复。不论何时,我们删除的任意文件,操作系统删除的仅仅是对特定数据的索引。这就意味着,数据仍然保存在磁盘的某块地方,这种方法是不安全的,任何一个聪明的计算机黑客可以使用各种不错的数据恢复工具来恢复你删除的数据。Linux 用户利用我们都知晓的 "rm" 命令来从他们的操作系统中删除数据,但是 "rm" 命令也是像上面说的那样删除文件。从这个命令删除的数据也可以使用特殊的文件恢复工具恢复。 -让我们看看怎样安全并且完整地从你地 Linux 系统中删除文件或者文件夹。以下提到的工具可以完全地删除数据,因此那些恢复工具很难找到真实数据的痕迹然后恢复它。 +让我们看看怎样安全并完整地从你的 Linux 系统中删除文件或者文件夹。以下提到的工具可以完全地删除数据,因此那些恢复工具很难找到真实数据的痕迹然后恢复它。 ### Secure-Delete ### -Secure-Delete 是一组为 Linux 操作系统而生的工具集合,他们为永久删除文件提供高级的技术支持。一旦 Secure-Delete 安装在任意的 Linux 系统,它会提供如下的四个命令: +Secure-Delete 是一组为 Linux 操作系统而生的工具集合,他们为永久删除文件提供了先进的技术支持。一旦 Secure-Delete 安装在各种 Linux 系统上,就提供了如下的四个命令: - srm - smem @@ -45,13 +46,13 @@ Secure-Delete 是一组为 Linux 操作系统而生的工具集合,他们为 sudo sswap /dev/sda5 -“**smem**” 用来清理在内存中的内容,它保证当系统重启或者关机时随机存取存储器(RAM)中的内容被清理,但是残余的数据痕迹仍然保存在内存。这个命令提供安全的内存清理,简单地在终端中运行 smem 命令。 +“**smem**” 用来清理在内存中的内容,虽然当系统重启或者关机时会清理随机存取存储器(RAM)中的内容,但是内存中仍然会保留一些数据的残留痕迹。这个命令提供安全的内存清理,简单地在终端中运行 smem 命令即可。 smem ### Shred ### -"shred" 命令销毁文件或者文件夹的内容,在某种程度上,不可能恢复。它使用随机生成的数据模式来持续重写文件,因此很难恢复任意的被销毁的数据,即使是那些黑客或者窃贼使用高水平的数据恢复工具或者设备。Shred 在 Linux 发行版中时默认安装的,如果你想,你可以运行如下命令来找到它的安装目录: +"shred" 命令以一种不可恢复的方式来销毁文件或者文件夹的内容。它使用随机生成的数据模式来持续覆写文件,因此很难恢复任意的被销毁的数据,即使是那些黑客或者窃贼使用高水平的数据恢复工具或者设备。Shred 默认安装在所有 Linux 发行版中,如果你想,你可以运行如下命令来找到它的安装目录: aun@eagle:~$ whereis shred @@ -75,17 +76,17 @@ Shred 默认情况下使用随机内容重写数据 25 次。如果你想它重 ### dd ### -这个命令起初是用于磁盘克隆的。它用于一个分区或者一个磁盘复制到另一个分区或者磁盘。但是它还用于安全地清除硬盘或者分区的内容。运行如下命令使用随机数据来重写你的当前数据。你不需要安装 dd 命令,所有的 Linux 分发版都已经包含了此命令。 +这个命令起初是用于磁盘克隆的。它用于将一个分区或者一个磁盘复制到另一个分区或者磁盘。但是它还可用于安全地清除硬盘或者分区的内容。运行如下命令使用随机数据来重写你的当前数据。你不需要安装 dd 命令,所有的 Linux 分发版都已经包含了此命令。 sudo dd if=/dev/random of=/dev/sda -你也可以重写磁盘或者分区中的内容,只需要简单地将所有替换为 “zero”。 +你也可以覆写磁盘或者分区中的内容,只需要简单地将所有替换为 “zero”。 sudo dd if=/dev/zero of=/dev/sda ### Wipe ### -Wipe 起初开发的目的是从磁媒体中安全地擦除文件。这个命令行工具使用特殊的模式来重复地写文件。它使用 fsync() 调用和或 O_SYNC 位来强制访问磁盘,并且使用 Gutmann 算法来重复地写。你可以使用此命令删除单个文件,文件夹或者整个磁盘的内容,但是使用 wipe 命令来删除整个磁盘的模式会耗费大量的时间。另外,安装和使用这个工具相当容易。 +Wipe 起初开发的目的是从磁性介质中安全地擦除文件。这个命令行工具使用特殊的模式来重复地写文件。它使用 fsync() 调用和/或 O_SYNC 位来强制访问磁盘,并且使用 Gutmann 算法来重复地写。你可以使用此命令删除单个文件、文件夹或者整个磁盘的内容,但是使用 wipe 命令来删除整个磁盘的模式会耗费大量的时间。另外,安装和使用这个工具相当容易。 在 ubuntu 的终端中运行如下命令来安装 wipe。 @@ -123,7 +124,7 @@ via: http://linoxide.com/security/delete-files-permanatly-linux/ 作者:[Aun Raza][a] 译者:[dbarobin](https://github.com/dbarobin) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 From bed742550b6289335e1dd4d95706a90ffa46017a Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 19 May 2015 23:06:01 +0800 Subject: [PATCH 090/965] PUB:20150331 Conky--The Ultimate X Based System Monitor Application MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @FSSlc 翻译的不错 --- ...mate X Based System Monitor Application.md | 41 +++++++++++-------- 1 file changed, 23 insertions(+), 18 deletions(-) rename {translated/tech => published}/20150331 Conky--The Ultimate X Based System Monitor Application.md (73%) diff --git a/translated/tech/20150331 Conky--The Ultimate X Based System Monitor Application.md b/published/20150331 Conky--The Ultimate X Based System Monitor Application.md similarity index 73% rename from translated/tech/20150331 Conky--The Ultimate X Based System Monitor Application.md rename to published/20150331 Conky--The Ultimate X Based System Monitor Application.md index f6ab2f69ec..fb90f58168 100644 --- a/translated/tech/20150331 Conky--The Ultimate X Based System Monitor Application.md +++ b/published/20150331 Conky--The Ultimate X Based System Monitor Application.md @@ -1,11 +1,11 @@ Conky - 终极的 X 视窗系统监视器应用 ================================================================================ -Conky 是一个用 ‘C’ 语言写就的系统监视器,并在 GNU 通用公共许可协议和 BSD 许可协议下发布,在 Linux 和 BSD 操作系统中都可以获取到它。这个应用是基于 X 视窗系统的,原本 fork 至 [Torsmo][1]。 +Conky 是一个用 ‘C’ 语言写就的系统监视器,并在 GNU GPL 和 BSD 许可协议下发布,在 Linux 和 BSD 操作系统中都可以获取到它。这个应用是基于 X 视窗系统的,原本由 [Torsmo][1] 分支而来。 #### 特点 #### - 简洁的用户界面; -- 高配置性; +- 高度可配置; - 它既可使用内置的部件(超过 300 多个) 也可使用外部脚本,来在桌面或其自有容器中展示系统的状态; - 低资源消耗; - 它可显示范围广泛的系统参数,包括但不限于 CPU,内存,swap 分区 ,温度,进程,磁盘使用情况,网络状态,电池电量,邮件收发,系统消息,音乐播放器的控制,天气信息,最新新闻,升级信息等等; @@ -15,7 +15,7 @@ Conky 是一个用 ‘C’ 语言写就的系统监视器,并在 GNU 通用公 - conky 这个名称来自于一个加拿大电视节目; - 它已被移植到 Nokia N900 上; -- 它已不再被官方维护; +- 官方已经不再维护它了; ### 在 Linux 中 Conky 的安装和使用 ### @@ -57,7 +57,8 @@ Conky 既可以从软件仓库中安装,也可从源代码编译得到: $ conky & ![正在运行的 Conky 监视器](http://www.tecmint.com/wp-content/uploads/2015/03/Start-Conkey.jpeg) -正在运行的 Conky 监视器 + +*正在运行的 Conky 监视器* 这使得 conky 以一个弹窗的形式运行,并使用位于 `/etc/conky/conky.conf` 的 conky 基本配置文件。 @@ -72,29 +73,31 @@ Conky 既可以从软件仓库中安装,也可从源代码编译得到: $ killall -SIGUSR1 conky ![Conky 监视器窗口](http://www.tecmint.com/wp-content/uploads/2015/03/Restart-Conky.jpeg) -Conky 监视器窗口 -你可能想编辑位于你家目录的 conky 的配置文件,这个配置文件的内容是非常容易理解的。 +*Conky 监视器窗口* + +你可能想编辑位于你的家目录的 conky 的配置文件,这个配置文件的内容是非常容易理解的。 下面是 conky 配置文件的一个样例: ![Conky 的配置](http://www.tecmint.com/wp-content/uploads/2015/03/Conky-Configuration.jpeg) -Conky 的配置 -从上面的窗口中,你可以更改颜色,边框,大小,缩放比例,背景,对齐方式及几个其他属性。通过为不同的 conky 窗口设定不同的对齐方式,我们可以同时运行超过一个 conky 脚本。 +*Conky 的配置* + +从上面的窗口中,你可以更改颜色,边框,大小,缩放比例,背景,对齐方式及几个其他属性。通过为不同的 conky 窗口设定不同的对齐方式,我们可以同时运行几个 conky 脚本。 -**为 conky 使用脚本而不是默认配置以及如何找到这些脚本?** +**让 conky 使用其它脚本而不是默认配置,以及如何找到这些脚本?** -你可以编写你自己的 conky 脚本或使用来自于互联网的脚本;我们并不建议你使用你从互联网中找到的具有潜在危险的任何脚本,除非你清楚你正在做什么。然而,有一些著名的主题和网页包含可信赖的 conky 脚本,例如下面所提及的: +你可以编写你自己的 conky 脚本或使用来自于互联网的脚本;我们并不建议你使用从互联网中找到的具有潜在危险的任何脚本,除非你清楚你正在做什么。然而,有一些著名的主题和网页包含可信赖的 conky 脚本,例如下面所提及的: - [http://ubuntuforums.org/showthread.php?t=281865][3] - [http://conky.sourceforge.net/screenshots.html][4] -在上面的 URL 地址中,你将发现每个截图都有一个超链接,它们将重定向到脚本文件。 +在上面的 URL 地址中,你将发现其中每个截图都有一个超链接,它们将指向到脚本文件。 #### 测试 Conky 脚本 #### -这里我将在我的 Debian Jessie 机子中运行一个由第三方写的 conky 脚本,以此来进行测试: +这里我将在我的 Debian Jessie 系统中运行一个由第三方写的 conky 脚本,以此来进行测试: $ wget https://github.com/alexbel/conky/archive/master.zip $ unzip master.zip @@ -107,39 +110,41 @@ Conky 的配置 $ mv secrets.yml.example secrets.yml -在你能够运行这个(ruby)脚本之前安装 Ruby: +在你需要运行这个(ruby)脚本之前安装 Ruby: $ sudo apt-get install ruby $ ruby starter.rb ![华丽的 conky 外观](http://www.tecmint.com/wp-content/uploads/2015/03/Conky-Fancy-Look.jpeg) -华丽的 conky 外观 -**注**: 这个脚本可以被修改以展示你当前的天气,温度等; +*华丽的 conky 外观* + +**注**: 可以修改这个脚本以展示你当前的天气,温度等; 假如你想让 conky 开机自启,请在开机启动应用设置(startup Applications) 中添加如下的几行命令: conky --pause 10 save and exit. -最后。。。 如此轻量级且吸引眼球的实用 GUI 软件包不再处于激活状态且官方不再进行维护了。最新的稳定发布版本为 conky 1.9.0, 于 2012 年 5 月 3 号发布。在 Ubuntu 论坛上,一个有关用户分享 conky 配置的主题已经超过了 2000 多页。(这个论坛主题的链接为: [http://ubuntuforums.org/showthread.php?t=281865/][5]) +最后,如此轻量级且吸引眼球的实用 GUI 软件包不再处于活跃状态且官方不再进行维护了。最新的稳定发布版本为 conky 1.9.0, 于 2012 年 5 月 3 号发布。在 Ubuntu 论坛上,一个有关用户分享 conky 配置的主题已经超过了 2000 多页。(这个论坛主题的链接为: [http://ubuntuforums.org/showthread.php?t=281865/][5]) - [Conky 主页][6] 这就是全部内容了。保持联系,保持评论。请在下面的评论框里分享你的想法和配置。 + -------------------------------------------------------------------------------- via: http://www.tecmint.com/install-conky-in-ubuntu-debian-fedora/ 作者:[Avishek Kumar][a] 译者:[FSSlc](https://github.com/FSSlc) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 [a]:http://www.tecmint.com/author/avishek/ [1]:http://torsmo.sourceforge.net/ -[2]:http://www.tecmint.com/how-to-enable-epel-repository-for-rhel-centos-6-5/ +[2]:https://linux.cn/article-2324-1.html [3]:http://ubuntuforums.org/showthread.php?t=281865 [4]:http://conky.sourceforge.net/screenshots.html [5]:http://ubuntuforums.org/showthread.php?t=281865/ From fa8a54685ffa175f138e8ae4dd838778c9c4847f Mon Sep 17 00:00:00 2001 From: GOLinux Date: Wed, 20 May 2015 10:01:10 +0800 Subject: [PATCH 091/965] [Translated]20150518 Linux FAQs with Answers--How to block specific user agents on nginx web server.md --- ...pecific user agents on nginx web server.md | 115 ------------------ ...pecific user agents on nginx web server.md | 115 ++++++++++++++++++ 2 files changed, 115 insertions(+), 115 deletions(-) delete mode 100644 sources/tech/20150518 Linux FAQs with Answers--How to block specific user agents on nginx web server.md create mode 100644 translated/tech/20150518 Linux FAQs with Answers--How to block specific user agents on nginx web server.md diff --git a/sources/tech/20150518 Linux FAQs with Answers--How to block specific user agents on nginx web server.md b/sources/tech/20150518 Linux FAQs with Answers--How to block specific user agents on nginx web server.md deleted file mode 100644 index 53bd4c4935..0000000000 --- a/sources/tech/20150518 Linux FAQs with Answers--How to block specific user agents on nginx web server.md +++ /dev/null @@ -1,115 +0,0 @@ -Translating by GOLinux! -Linux FAQs with Answers--How to block specific user agents on nginx web server -================================================================================ -> **Question**: I notice that some robots often visit my nginx-powered website and scan it aggressively, ending up wasting a lot of my web server resources. I am trying to block those robots based on their user-agent string. How can I block specific user agent(s) on nginx web server? - -The modern Internet is infested with various malicious robots and crawlers such as malware bots, spambots or content scrapers which are scanning your website in surreptitious ways, for example to detect potential website vulnerabilities, harvest email addresses, or just to steal content from your website. Many of these robots can be identified by their signature "user-agent" string. - -As a first line of defense, you could try to block malicious bots from accessing your website by blacklisting their user-agents in robots.txt file. However, unfortunately this works only for "well-behaving" robots which are designed to obey robots.txt. Many malicious bots can simply ignore robots.txt and scan your website at will. - -An alternative way to block particular robots is to configure your web server, such that it refuses to serve content to requests with certain user-agent strings. This post explains how to **block certain user-agent on nginx web server**. - -### Blacklist Certain User-Agents in Nginx ### - -To configure user-agent block list, open the nginx configuration file of your website, where the server section is defined. This file can be found in different places depending on your nginx setup or Linux distribution (e.g., /etc/nginx/nginx.conf, /etc/nginx/sites-enabled/, /usr/local/nginx/conf/nginx.conf, /etc/nginx/conf.d/). - - server { - listen 80 default_server; - server_name xmodulo.com; - root /usr/share/nginx/html; - - .... - } - -Once you open the config file with the server section, add the following if statement(s) somewhere inside the section. - - server { - listen 80 default_server; - server_name xmodulo.com; - root /usr/share/nginx/html; - - # case sensitive matching - if ($http_user_agent ~ (Antivirx|Arian) { - return 403; - } - - # case insensitive matching - if ($http_user_agent ~* (netcrawl|npbot|malicious)) { - return 403; - } - - .... - } - -As you can guess, these if statements match any bad user-string with regular expressions, and return 403 HTTP status code when a match is found. $http_user_agent is a variable that contains the user-agent string of an HTTP request. The '~' operator does case-sensitive matching against user-agent string, while the '~' operator does case-insensitive matching. The '|' operator is logical-OR, so you can put as many user-agent keywords in the if statements, and block them all. - -After modifying the configuration file, you must reload nginx to activate the blocking: - - $ sudo /path/to/nginx -s reload - -You can test user-agent blocking by using wget with "--user-agent" option. - - $ wget --user-agent "malicious bot" http:// - -![](https://farm6.staticflickr.com/5333/17434036358_ef139a6b59_b.jpg) - -### Manage User-Agent Blacklist in Nginx ### - -So far, I have shown how to block HTTP requests with a few user-agents in nginx. What if you have many different types of crawling bots to block? - -Since the user-agent blacklist can grow very big, it is not a good idea to put them all inside your nginx's server section. Instead, you can create a separate file which lists all blocked user agents. For example, let's create /etc/nginx/useragent.rules, and define a map with all blocked user agents in the following format. - - $ sudo vi /etc/nginx/useragent.rules - ----------- - - map $http_user_agent $badagent { - default 0; - ~*malicious 1; - ~*backdoor 1; - ~*netcrawler 1; - ~Antivirx 1; - ~Arian 1; - ~webbandit 1; - } - -Similar to the earlier setup, '~*' will match a keyword in case-insensitive manner, while '~' will match a keyword using a case-sensitive regular expression. The line that says "default 0" means that any other user-agent not listed in the file will be allowed. - -Next, open an nginx configuration file of your website, which contains http section, and add the following line somewhere inside the http section. - - http { - ..... - include /etc/nginx/useragent.rules - } - -Note that this include statement must appear before the server section (this is why we add it inside http section). - -Now open an nginx configuration where your server section is defined, and add the following if statement: - - server { - .... - - if ($badagent) { - return 403; - } - - .... - } - -Finally, reload nginx. - - $ sudo /path/to/nginx -s reload - -Now any user-agent which contains a keyword listed in /etc/nginx/useragent.rules will be automatically banned by nginx. - --------------------------------------------------------------------------------- - -via: http://ask.xmodulo.com/block-specific-user-agents-nginx-web-server.html - -作者:[Dan Nanni][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://ask.xmodulo.com/author/nanni diff --git a/translated/tech/20150518 Linux FAQs with Answers--How to block specific user agents on nginx web server.md b/translated/tech/20150518 Linux FAQs with Answers--How to block specific user agents on nginx web server.md new file mode 100644 index 0000000000..89a94cfbeb --- /dev/null +++ b/translated/tech/20150518 Linux FAQs with Answers--How to block specific user agents on nginx web server.md @@ -0,0 +1,115 @@ +Linux有问必答——nginx网络服务器上如何阻挡特定用户代理 +================================================================================ +> **问题**: 我注意到有一些机器人经常访问我nginx驱动的网站,并且进行一些攻击性的扫描,导致消耗掉了我的网络服务器的大量资源。我一直尝试着通过用户代理符串来阻挡这些机器人。我怎样才能在nginx网络服务器上阻挡掉特定的用户代理呢? + +现代互联网滋生了大量各种各样的恶意机器人和网络爬虫,比如像恶意软件机器人、垃圾邮件程序或内容刮刀,这些恶意工具一直偷偷摸摸地扫描你的网站,干些诸如检测潜在网站漏洞、收获电子邮件地址,或者只是从你的网站偷取内容。大多数机器人能够通过它们的“用户代理”签名字符串来识别。 + +作为第一道防线,你可以尝试通过将这些机器人的用户代理字符串添加入robots.txt文件来阻止这些恶意软件机器人访问你的网站。但是,很不幸的是,该操作只针对那些“行为良好”的机器人,这些机器人被设计遵循robots.txt的规范。许多恶意软件机器人可以很容易地忽略掉robots.txt,然后随意扫描你的网站。 + +另一个用以阻挡特定机器人的途径,就是配置你的网络服务器,通过特定的用户代理字符串拒绝要求提供内容的请求。本文就是说明如何**在nginx网络服务器上阻挡特定的用户代理**。 + +### 在Nginx中将特定用户代理列入黑名单 ### + +要配置用户代理阻挡列表,请打开你的网站的nginx配置文件,找到服务器定义部分。该文件可能会放在不同的地方,这取决于你的nginx配置或Linux版本(如,/etc/nginx/nginx.conf,/etc/nginx/sites-enabled/,/usr/local/nginx/conf/nginx.conf,/etc/nginx/conf.d/)。 + + server { + listen 80 default_server; + server_name xmodulo.com; + root /usr/share/nginx/html; + + .... + } + +在打开该配置文件并找到 server 部分后,添加以下 if 声明到该部分内的某个地方。 + + server { + listen 80 default_server; + server_name xmodulo.com; + root /usr/share/nginx/html; + + # case sensitive matching + if ($http_user_agent ~ (Antivirx|Arian) { + return 403; + } + + # case insensitive matching + if ($http_user_agent ~* (netcrawl|npbot|malicious)) { + return 403; + } + + .... + } + +如你所想,这些 if 声明使用正则表达式匹配了任意不良用户字符串,并向匹配的对象返回403 HTTP状态码。 +$http_user_agent是HTTP请求的一个包含有用户代理字符串的变量。‘~’操作符针对用户代理字符串进行大小写敏感匹配,而‘~*’操作符则进行大小写不敏感匹配。‘|’操作符是逻辑或,因此,你可以在 if 声明中放入众多的用户代理关键字,然后将它们全部阻挡掉。 + +在修改配置文件后,你必须重新加载nginx以激活阻挡: + + $ sudo /path/to/nginx -s reload + +你可以通过使用带有 “--user-agent” 选项的 wget 测试用户代理阻挡。 + + $ wget --user-agent "malicious bot" http:// + +![](https://farm6.staticflickr.com/5333/17434036358_ef139a6b59_b.jpg) + +### 管理Nginx中的用户代理黑名单 ### + +目前为止,我已经展示了在nginx中如何阻挡一些用户代理的HTTP请求。如果你有学多不同类型的网络爬虫机器人要阻挡,又该怎么办呢? + +由于用户代理黑名单会增长得很大,所以将它们放在nginx的server部分不是个好点子。取而代之的是,你可以创建一个独立的文件,在该文件中列出所有被阻挡的用户代理。例如,让我们创建/etc/nginx/useragent.rules,并定义以下面的格式定义所有被阻挡的用户代理的图谱。 + + $ sudo vi /etc/nginx/useragent.rules + +---------- + + map $http_user_agent $badagent { + default 0; + ~*malicious 1; + ~*backdoor 1; + ~*netcrawler 1; + ~Antivirx 1; + ~Arian 1; + ~webbandit 1; + } + +与先前的配置类似,‘~*’将匹配以大小写不敏感的方式匹配关键字,而‘~’将使用大小写敏感的正则表达式匹配关键字。“default 0”行所表达的意思是,任何其它文件中未被列出的用户代理将被允许。 + +接下来,打开你的网站的nginx配置文件,找到里面包含 http 的部分,然后添加以下行到 http 部分某个位置。 + + http { + ..... + include /etc/nginx/useragent.rules + } + +注意,该 include 声明必须出现在 server 部分之前(这就是为什么我们将它添加到了 http 部分里)。 + +现在,打开nginx配置定义你的服务器的部分,添加以下 if 声明: + + server { + .... + + if ($badagent) { + return 403; + } + + .... + } + +最后,重新加载nginx。 + + $ sudo /path/to/nginx -s reload + +现在,任何包含有/etc/nginx/useragent.rules中列出的关键字的用户代理将被nginx自动禁止。 + +-------------------------------------------------------------------------------- + +via: http://ask.xmodulo.com/block-specific-user-agents-nginx-web-server.html + +作者:[Dan Nanni][a] +译者:[GOLinux](https://github.com/GOLinux) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://ask.xmodulo.com/author/nanni From abaa5d6ee004ea189acfbcc858e9a761a4d1baac Mon Sep 17 00:00:00 2001 From: joeren Date: Wed, 20 May 2015 10:08:58 +0800 Subject: [PATCH 092/965] Update 20150518 Linux FAQs with Answers--What is the Apache error log location on Linux.md --- ... Answers--What is the Apache error log location on Linux.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150518 Linux FAQs with Answers--What is the Apache error log location on Linux.md b/sources/tech/20150518 Linux FAQs with Answers--What is the Apache error log location on Linux.md index 946094a532..b25c7fe3c8 100644 --- a/sources/tech/20150518 Linux FAQs with Answers--What is the Apache error log location on Linux.md +++ b/sources/tech/20150518 Linux FAQs with Answers--What is the Apache error log location on Linux.md @@ -1,3 +1,4 @@ +Translating by GOLinux! Linux FAQs with Answers--What is the Apache error log location on Linux ================================================================================ > **Question**: I am trying to troubleshoot Apache web server errors on my Linux system. Where is the Apache error log file located on [insert your Linux distro]? @@ -78,4 +79,4 @@ via: http://ask.xmodulo.com/apache-error-log-location-linux.html [a]:http://ask.xmodulo.com/author/nanni [1]:http://xmodulo.com/configure-fail2ban-apache-http-server.html [2]:http://xmodulo.com/interactive-apache-web-server-log-analyzer-linux.html -[3]:http://xmodulo.com/sql-queries-apache-log-files-linux.html \ No newline at end of file +[3]:http://xmodulo.com/sql-queries-apache-log-files-linux.html From d6c50a390ba637b10cf1826d918031b67f7d5b28 Mon Sep 17 00:00:00 2001 From: Gore Liu Date: Wed, 20 May 2015 11:16:28 +0800 Subject: [PATCH 093/965] [Translated] 20150423 20 Awesome Docker Containers for a Desktop User.md --- ...me Docker Containers for a Desktop User.md | 239 ------------------ ...me Docker Containers for a Desktop User.md | 236 +++++++++++++++++ 2 files changed, 236 insertions(+), 239 deletions(-) delete mode 100644 sources/tech/20150423 20 Awesome Docker Containers for a Desktop User.md create mode 100644 translated/tech/20150423 20 Awesome Docker Containers for a Desktop User.md diff --git a/sources/tech/20150423 20 Awesome Docker Containers for a Desktop User.md b/sources/tech/20150423 20 Awesome Docker Containers for a Desktop User.md deleted file mode 100644 index 00786e9bde..0000000000 --- a/sources/tech/20150423 20 Awesome Docker Containers for a Desktop User.md +++ /dev/null @@ -1,239 +0,0 @@ -Translating by gaoliu ... - -20 Awesome Docker Containers for a Desktop User -================================================================================ -Greetings to everyone, today we'll list out some awesome Desktop Apps that we can run using Docker Containers in our very own Desktop running Docker. Docker is an Open Source project that provides an open platform to pack, ship and run any application as a lightweight container. It has no boundaries of Language support, Frameworks or packaging system and can be run anywhere, anytime from a small home computers to high-end servers. It makes them great building blocks for deploying and scaling web apps, databases, and back-end services without depending on a particular stack or provider. It is basically used by the developers, Ops and Engineers as it is easy, fast and handy tool for testing or deploying their products but we can also use Docker for our Desktop usage to run a desktop apps out of the box. - -So here are some awesome 10 Desktop Application Docker images that we can run with Docker. - -### 1. Lynx ### - -Lynx is a all time favorite text-based web browser which is a lot familiar to most of the people running Linux. It is the oldest web browser currently in general use and development. To run Lynx, run the following command. - - $ docker run -it \ - --name lynx \ - jess/lynx - -### 2. Irssi ### - -Irssi is an awesome IRC Client which is based on Text Interface. To run Irssi using docker, we'll need to run the following commands in a docker installed desktop computer. - - docker run -it --name my-irssi -e TERM -u $(id -u):$(id -g) \ - -v $HOME/.irssi:/home/user/.irssi:ro \ - -v /etc/localtime:/etc/localtime:ro \ - irssi - -### 3. Chrome ### - -Chrome is an awesome GUI-based web browser developed by Google and is based on Open Source Project Chromium. Google Chrome is widely used, fast and secure web browser that are very much familiar to most of the people who surf internet. We can run Chrome using docker by running the following command. - - $ docker run -it \ - --net host \ - --cpuset 0 \ - --memory 512mb \ - -v /tmp/.X11-unix:/tmp/.X11-unix \ - -e DISPLAY=unix$DISPLAY \ - -v $HOME/Downloads:/root/Downloads \ - -v $HOME/.config/google-chrome/:/data \ - -v /dev/snd:/dev/snd --privileged \ - --name chrome \ - jess/chrome - -### 4. Tor Browser ### - -Tor Browser is a web browser which support anonymous features. It enables us freedom to surf website or services blocked by a particular organization or ISPs. It prevents somebody watching our Internet connection from learning what we do on internet and our exact location. To run Tor Browser, run the following command. - - $ docker run -it \ - -v /tmp/.X11-unix:/tmp/.X11-unix \ - -e DISPLAY=unix$DISPLAY \ - -v /dev/snd:/dev/snd --privileged \ - --name tor-browser \ - jess/tor-browser - -### 5. Firefox Browser ### - -Firefox Browser is a free and open source web browser which is developed by Mozilla Foundation. It is run by Gecko and SpiderMonkey engines. Firefox Browser has a lot of new features and is specially known for its performance and security. - - $ docker run -d \ - --name firefox \ - -e DISPLAY=$DISPLAY \ - -v /tmp/.X11-unix:/tmp/.X11-unix \ - kennethkl/firefox - -### 6. Rainbow Stream ### - -Rainbow Stream is a terminal based Twitter Client featuring real time tweetstream, compose, search , favorite and much more fun directly from terminal. To run Rainbow Stream, run the following command. - - $ docker run -it \ - -v /etc/localtime:/etc/localtime \ - -v $HOME/.rainbow_oauth:/root/.rainbow_oauth \ - -v $HOME/.rainbow_config.json:/root/.rainbow_config.json \ - --name rainbowstream \ - jess/rainbowstream - -### 7. Gparted ### - -Gparted is an open source software which allows us to partition disks. Now enjoy partitioning from a docker container. To run gparted, we'll need to run the following command. - - $ docker run -it \ - -v /tmp/.X11-unix:/tmp/.X11-unix \ - -e DISPLAY=unix$DISPLAY \ - --device /dev/sda:/dev/sda \ # mount the device to partition - --name gparted \ - jess/gparted - -### 8. GIMP Editor ### - -GIMP stands for Gnu Image Manipulation Program which is an awesome tool on Linux for graphics, image editing platform. It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. - - $ docker run -it \ - --rm -e DISPLAY=$DISPLAY \ - -v /tmp/.X11-unix:/tmp/.X11-unix \ - jarfil/gimp-git - -### 9. Thunderbird ### - -Thunderbird is also a free and open source email application which is developed and maintained by Mozilla Foundation. It has tons of features that an email application software should have. Thunderbird is really easy to setup and customize. To run Thunderbird in a Docker environment, run the following command. - - $ docker run -d \ - -e DISPLAY \ - -v /tmp/.X11-unix:/tmp/.X11-unix:ro \ - -u docker \ - -v $HOME/docker-data/thunderbird:/home/docker/.thunderbird/ \ - yantis/thunderbird thunderbird - -### 10. Mutt ### - -Mutt is a text based email client which has bunches of cool features including color support, IMAP, POP3, SMTP support, mail storing support and much more. To run Mutt out of the box using docker, we'll need to run the following command. - - $ docker run -it \ - -v /etc/localtime:/etc/localtime \ - -e GMAIL -e GMAIL_NAME \ - -e GMAIL_PASS -e GMAIL_FROM \ - -v $HOME/.gnupg:/home/user/.gnupg \ - --name mutt \ - jess/mutt - -### 11. Skype ### - -Skype is an instant messaging, video calling software which is not open source but can be run awesome in linux. We can run Skype using Docker Containers too. To run Skype using a docker, run the following command. - - $ docker run -it \ - -v /tmp/.X11-unix:/tmp/.X11-unix:ro \ - -v /dev/snd:/dev/snd --privileged \ - -e DISPLAY="unix$DISPLAY" \ - tianon/skype - -### 12. Cathode ### - -Cathode is a beautiful fully customizable terminal app with a look inspired by classic computers. We can run Cathode by running the below command. - - $ docker run -it \ - -v /tmp/.X11-unix:/tmp/.X11-unix \ - -e DISPLAY=unix$DISPLAY \ - --name cathode \ - jess/1995 - -### 13. LibreOffice ### - -LibreOffice is a powerful office suite which is free and open source and is maintained by The Document Foundation. It has clean interface and is a powerful tools that lets us unleash our creativity and grow our productivity. LibreOffice embeds several applications that make it the most powerful Free & Open Source Office suite on the market. - - $docker run \ - -v $HOME/Documents:/home/libreoffice/Documents:rw \ - -v /tmp/.X11-unix:/tmp/.X11-unix \ - -e uid=$(id -u) -e gid=$(id -g) \ - -e DISPLAY=unix$DISPLAY --name libreoffice \ - chrisdaish/libreoffice - -### 14. Spotify ### - -Spotify gives us instant access to millions of songs from old favorites to the latest hits. To listen our favorite songs using docker, run the following command. - - $ docker run -it \ - -v /tmp/.X11-unix:/tmp/.X11-unix \ - -e DISPLAY=unix$DISPLAY \ - -v /dev/snd:/dev/snd --privileged \ - --name spotify \ - jess/spotify - -### 15. Audacity ### - -Audacity is free and open source cross-platform software for recording and editing sounds. Audacity can be used for post-processing of all types of audio, including podcasts by adding effects such as normalization, trimming, and fading in and out. To run Audacity, we'll need to run the following command in a terminal or shell. - - $ docker run --rm \ - -u $(id -u):$(id -g) \ - -v /tmp/.X11-unix:/tmp/.X11-unix:ro \ - -v /dev/snd:/dev/snd \ - -v "$HOME:$HOME" \ - -w "$HOME" \ - -e DISPLAY="unix$DISPLAY" \ - -e HOME \ - $(find /dev/snd/ -type c | sed 's/^/--device /') \ - knickers/audacity - -### 16. Eclipse ### - -Eclipse is an integrated development environment (IDE). It contains a base workspace and an extensible plug-in system for customizing the environment. It is mostly used to develop Java Based Applications. - - $ docker run -v ~/workspace/:/home/eclipse/workspace/ \ - -e DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix:ro \ - -d leesah/eclipse - -### 17. VLC Media Player ### - -VLC is a free and open source cross-platform multimedia player and framework that plays most multimedia files as well as DVDs, Audio CDs, VCDs, and various streaming protocols. VLC Media Player is developed and maintained by VideoLAN Organization. To run VLC in docker environment, run the following command. - - $ docker run -v\ - $HOME/Documents:/home/vlc/Documents:rw \ - -v /dev/snd:/dev/snd --privileged \ - -v /tmp/.X11-unix:/tmp/.X11-unix \ - -e uid=$(id -u) -e gid=$(id -g) \ - -e DISPLAY=unix$DISPLAY --name vlc \ - chrisdaish/vlc - -### 18. Vim Editor ### - -Vim is a highly configurable text-based text editor built to enable efficient text editing. It is an improved version of the vi editor distributed with most UNIX systems. - - $ docker run -i -t --name my-vim -v ~/:/home/dev/src haron/vim - -### 19. Inkscape ### - -Inkscape is a free and open-source vector graphics editor. It can create, edit vector graphics such as illustrations, diagrams, line arts, charts, logos and even complex paintings. Inkscape's primary vector graphics format is Scalable Vector Graphics (SVG) version 1.1. It can import from or export to several other formats as well but all editing workflow must inevitably occur within the constraints of SVG format. - - $docker build -t rasch/inkscape --rm . - $ docker run --rm -e DISPLAY \ - -u inkscaper - -v /tmp/.X11-unix:/tmp/.X11-unix \ - -v $HOME/.Xauthority:/home/inkscaper/.Xauthority \ - --net=host rasch/inkscape - -### 20. Filezilla ### - -Filezilla is a free FTP solution application software. It supports FTP, SFTP, FTPS protocols. It is a powerful file management tool for client side. It is an awesome open source FTP project which is highly reliable and easy to use. - - $ xhost +si:localuser:$(whoami) - $ docker run \ - -d \ - -e DISPLAY \ - -v /tmp/.X11-unix:/tmp/.X11-unix:ro \ - -u docker \ - -v /:/host \ - -v $HOME/docker-data/filezilla:/home/docker/.config/filezilla/ \ - yantis/filezilla filezilla - -### Conclusion ### - -Running desktop application software using Docker is really an awesome experience. Docker is really an awesome platform for fast and easy development, shipping and deployment of software and packages in any place from home to office to production areas. Running desktop apps with docker is a cool way to try out the apps without really installing it into the host filesystem. So, if you have any questions, comments, feedback please do write on the comment box below and let us know what stuffs needs to be added or improved. Thank You! Enjoy with Docker :-) - --------------------------------------------------------------------------------- - -via: http://linoxide.com/how-tos/20-docker-containers-desktop-user/ - -作者:[Arun Pyasi][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://linoxide.com/author/arunp/ \ No newline at end of file diff --git a/translated/tech/20150423 20 Awesome Docker Containers for a Desktop User.md b/translated/tech/20150423 20 Awesome Docker Containers for a Desktop User.md new file mode 100644 index 0000000000..055c1eb9b5 --- /dev/null +++ b/translated/tech/20150423 20 Awesome Docker Containers for a Desktop User.md @@ -0,0 +1,236 @@ +20个为桌面用户准备的令人惊叹的Docker容器 +================================================================================ +大家好,今天我们会列出一些很棒的运行在Docker容器中的桌面软件,我们可以在自己的桌面系统中运行它们。Docker是一个开源的项目,它提供可以将应用程序作为一个轻量级容器来打包、传送和运行的开放平台。它没有语言支持、框架或打包系统的限制,可以运行在任何地方,从小型的家用电脑到高端的服务器。它可以使部署和扩展web应用程序、数据库和后端服务像搭积木一样容易,而不依赖特定技术栈或提供商。它主要是由开发、运维工程师使用的,因为它简单、快速和方便,可以用来测试和辅助开发他们产品,但是我们也可以在桌面环境使用Docker,这样一些桌面程序可以开箱即用。 + +下边是20个非常棒的桌面软件docker镜像,我们可以使用Docker来运行。 + +### 1. Lynx ### + +Lynx是一个一直以来最受欢迎的文本界面网页浏览器,它对多数Linux用户来说都很熟悉。它应该是现在还在日常和开发环境中被使用的最古老的网页浏览器了。可以使用如下命令运行Lync。 + + $ docker run -it \ + --name lynx \ + jess/lynx + +### 2. Irssi ### + +Irssi是一个非常棒的文本界面IRC客户端。可以使用如下命令运行Irssi。 + + docker run -it --name my-irssi -e TERM -u $(id -u):$(id -g) \ + -v $HOME/.irssi:/home/user/.irssi:ro \ + -v /etc/localtime:/etc/localtime:ro \ + irssi + +### 3. Chrome ### + +Chrome是一个令人惊叹的图形界面网页浏览器,由Google开发,它基于开源的Chromium项目。Google Chrome是一个被广泛使用的、快速安全的网页浏览器,经常上网的人会非常熟悉它。我们可以使用如下命令在Docker中运行Chrome。 + + $ docker run -it \ + --net host \ + --cpuset 0 \ + --memory 512mb \ + -v /tmp/.X11-unix:/tmp/.X11-unix \ + -e DISPLAY=unix$DISPLAY \ + -v $HOME/Downloads:/root/Downloads \ + -v $HOME/.config/google-chrome/:/data \ + -v /dev/snd:/dev/snd --privileged \ + --name chrome \ + jess/chrome + +### 4. Tor浏览器 ### + +Tor浏览器是一个支持匿名访问的网页浏览器。它让我们可以自由地在网络世界遨游,或者浏览被特定组织或者网络服务提供商封锁的网站。它会阻止有人通过监视我们的网络连接来窃取我们在网络上的一举一动以及我们的确切位置。运行如下命令运行Tor浏览器。 + + $ docker run -it \ + -v /tmp/.X11-unix:/tmp/.X11-unix \ + -e DISPLAY=unix$DISPLAY \ + -v /dev/snd:/dev/snd --privileged \ + --name tor-browser \ + jess/tor-browser + +### 5. Firefox浏览器 ### + +Firefox浏览器是一个自由并且开源的网页浏览器,它由Mozilla基金会开发。它使用Gecko和SpiderMonkey引擎。Firefox浏览器有很多新特性,并且它以性能和安全性著称。 + + $ docker run -d \ + --name firefox \ + -e DISPLAY=$DISPLAY \ + -v /tmp/.X11-unix:/tmp/.X11-unix \ + kennethkl/firefox + +### 6. Rainbow Stream ### + +Rainbow Stream是一个文本界面的Twitter客户端,有实时显示tweetstream、搜索、喜欢和更多其他特性,可以直接在终端使用。使用如下命令运行Rainbow Stream。 + + $ docker run -it \ + -v /etc/localtime:/etc/localtime \ + -v $HOME/.rainbow_oauth:/root/.rainbow_oauth \ + -v $HOME/.rainbow_config.json:/root/.rainbow_config.json \ + --name rainbowstream \ + jess/rainbowstream + +### 7. Gparted ### + +Gparted是一个用来给磁盘分区的开源软件。现在可以在Docker容器里享受分区的乐趣。可以使用如下命令运行gparted。 + + $ docker run -it \ + -v /tmp/.X11-unix:/tmp/.X11-unix \ + -e DISPLAY=unix$DISPLAY \ + --device /dev/sda:/dev/sda \ # mount the device to partition + --name gparted \ + jess/gparted + +### 8. GIMP图片编辑器 ### + +GIMP(Gnu Image Manipulation Program)是一个令人惊叹的Linux图片编辑软件。它是一个可以自由分发的可以处理照片修正、图像合成和图像创作等任务的工具。 + + $ docker run -it \ + --rm -e DISPLAY=$DISPLAY \ + -v /tmp/.X11-unix:/tmp/.X11-unix \ + jarfil/gimp-git + +### 9. Thunderbird ### + +Thunderbird是一个自由并且开源的电子邮件软件,它由Mozilla基金会开发和维护。它有众多一个电子邮件软件应该具有的功能。Thunderbird非常易于安装和定制。使用如下命令在Docker中运行Thunderbird。 + + $ docker run -d \ + -e DISPLAY \ + -v /tmp/.X11-unix:/tmp/.X11-unix:ro \ + -u docker \ + -v $HOME/docker-data/thunderbird:/home/docker/.thunderbird/ \ + yantis/thunderbird thunderbird + +### 10. Mutt ### + +Mutt是一个文本界面的电子邮件客户端,有很多很酷的功能,如颜色支持,IMAP、POP3、SMTP支持,邮件存储支持等。 使用如下命令运行Mutt。 + + $ docker run -it \ + -v /etc/localtime:/etc/localtime \ + -e GMAIL -e GMAIL_NAME \ + -e GMAIL_PASS -e GMAIL_FROM \ + -v $HOME/.gnupg:/home/user/.gnupg \ + --name mutt \ + jess/mutt + +### 11. Skype ### + +Skype是一个支持文字、语音和视频的即时通讯软件,它不是开源的,但在Linux下可以很棒地运行。我们同样可以在Docker中运行Skype,使用如下命令。 + + $ docker run -it \ + -v /tmp/.X11-unix:/tmp/.X11-unix:ro \ + -v /dev/snd:/dev/snd --privileged \ + -e DISPLAY="unix$DISPLAY" \ + tianon/skype + +### 12. Cathode ### + +Cathode是一个漂亮并且高度可定制的终端模拟器,灵感来自经典的计算机。使用如下命令运行Cathode。 + + $ docker run -it \ + -v /tmp/.X11-unix:/tmp/.X11-unix \ + -e DISPLAY=unix$DISPLAY \ + --name cathode \ + jess/1995 + +### 13. LibreOffice ### + +LibreOffice是一个功能强大的办公套件,它是自由和开源的,现在由The Document基金会维护。它有干净的界面和强大的功能,让我们释放创造力和提升生产力。LibreOffice将数个应用程序集成在一起,是市面上最强大的自由并且开源的办公套件。 + $docker run \ + -v $HOME/Documents:/home/libreoffice/Documents:rw \ + -v /tmp/.X11-unix:/tmp/.X11-unix \ + -e uid=$(id -u) -e gid=$(id -g) \ + -e DISPLAY=unix$DISPLAY --name libreoffice \ + chrisdaish/libreoffice + +### 14. Spotify ### + +Spotify可以即时访问数百万的歌曲,从经典老歌到最新单曲。可以使用如下命令在Docker中听我们最喜欢的歌曲。 + + $ docker run -it \ + -v /tmp/.X11-unix:/tmp/.X11-unix \ + -e DISPLAY=unix$DISPLAY \ + -v /dev/snd:/dev/snd --privileged \ + --name spotify \ + jess/spotify + +### 15. Audacity ### + +Audacity是一个自由并且开源的跨平台软件,用来录制和编辑音频。Audacity可以用来做所有类型音频(例如podcast)的后期处理,如归一化、调整、淡入淡出。使用如下命令来运行Audacity。 + + $ docker run --rm \ + -u $(id -u):$(id -g) \ + -v /tmp/.X11-unix:/tmp/.X11-unix:ro \ + -v /dev/snd:/dev/snd \ + -v "$HOME:$HOME" \ + -w "$HOME" \ + -e DISPLAY="unix$DISPLAY" \ + -e HOME \ + $(find /dev/snd/ -type c | sed 's/^/--device /') \ + knickers/audacity + +### 16. Eclipse ### + +Eclipse是一个集成开发环境。它包含基本的工作区和用来定制环境的可扩展插件系统。它在Java开发者中很流行。 + + $ docker run -v ~/workspace/:/home/eclipse/workspace/ \ + -e DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix:ro \ + -d leesah/eclipse + +### 17. VLC媒体播放器 ### + +VLC是一个自由并且开源的跨平台多媒体播放器,可以播放本地文件、DVD、CD、VCD和各种流媒体。VLC由VideoLAN组织开发和维护。使用如下命令运行VLC。 + + $ docker run -v\ + $HOME/Documents:/home/vlc/Documents:rw \ + -v /dev/snd:/dev/snd --privileged \ + -v /tmp/.X11-unix:/tmp/.X11-unix \ + -e uid=$(id -u) -e gid=$(id -g) \ + -e DISPLAY=unix$DISPLAY --name vlc \ + chrisdaish/vlc + +### 18. Vim编辑器 ### + +Vim是一个高度可配置的文本界面文字编辑器,为高效的文本编辑而生。它是预装在多数UNIX系统中的vi编辑器的改进版本。 + + $ docker run -i -t --name my-vim -v ~/:/home/dev/src haron/vim + +### 19. Inkscape ### + +Inkscape是一个自由并且开源的矢量图形编辑器。它可以创建、编辑矢量图形,如插图、图示、线条艺术、图表、徽标以及更复杂的绘画。Inkscape使用的主要矢量图形格式是SVG 1.1版本。它也可以导入和导出一些其他的格式,但实际编辑使用的还是SVG格式。 + + $docker build -t rasch/inkscape --rm . + $ docker run --rm -e DISPLAY \ + -u inkscaper + -v /tmp/.X11-unix:/tmp/.X11-unix \ + -v $HOME/.Xauthority:/home/inkscaper/.Xauthority \ + --net=host rasch/inkscape + +### 20. Filezilla ### + +Filezilla是一个自由的FTP解决方案,支持FTP、SFTP、FTPS协议。它的客户端是一个功能强大的文件管理工具。它是一个很棒的高度可靠和易用的开源FTP解决方案。 + + $ xhost +si:localuser:$(whoami) + $ docker run \ + -d \ + -e DISPLAY \ + -v /tmp/.X11-unix:/tmp/.X11-unix:ro \ + -u docker \ + -v /:/host \ + -v $HOME/docker-data/filezilla:/home/docker/.config/filezilla/ \ + yantis/filezilla filezilla + +### 总结 ### + +使用Docker运行桌面软件真的是很棒的体验。Docker是一个快速、简单的开发平台,适合从家里、办公室到生产环境里传送和开发软件的场景。使用Docker运行桌面软件是试用而不将其安装到自己实体机文件系统中的很酷的方法。如果你有任何问题、评论或者反馈,清写在下方的评论框中,让我们知道哪些是需要增加或者改进的。谢谢!享受Docker吧 :-) + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/how-tos/20-docker-containers-desktop-user/ + +作者:[Arun Pyasi][a] +译者:[goreliu](https://github.com/goreliu) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://linoxide.com/author/arunp/ \ No newline at end of file From 487ea71cf576f14d87ea239bc0b34b51676d27cb Mon Sep 17 00:00:00 2001 From: ZTinoZ Date: Wed, 20 May 2015 11:26:13 +0800 Subject: [PATCH 094/965] Translating by ZTinoZ --- ...15 Things to Do After Installing Ubuntu 15.04 Desktop.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sources/tech/20150427 15 Things to Do After Installing Ubuntu 15.04 Desktop.md b/sources/tech/20150427 15 Things to Do After Installing Ubuntu 15.04 Desktop.md index 593d9c761d..857b2157b3 100644 --- a/sources/tech/20150427 15 Things to Do After Installing Ubuntu 15.04 Desktop.md +++ b/sources/tech/20150427 15 Things to Do After Installing Ubuntu 15.04 Desktop.md @@ -72,7 +72,7 @@ Disable Unwanted Applications ### 7. 添加扩展多媒体支持 ### -By default, Ubuntu comes with a minimal support for media files. In order to play various media formats or manipulate video files, install the following multimedia applications: +默认情况下,Ubuntu对多媒体文件支持不是很好。为了能播放各种不同的多媒体格式或解析视频文件,可以安装以下多媒体应用程序: - VLC - Smplayer @@ -83,7 +83,7 @@ By default, Ubuntu comes with a minimal support for media files. In order to pla - Handbrake - Openshot -Use the following command line to install all with one shot: +用以下命令来一次性安装所有的这些应用程序: $ sudo apt-get install vlc smplayer audacious qmmp mixxx xbmc handbrake openshot @@ -93,7 +93,7 @@ Install Media Players ![Media Player Playlist](http://www.tecmint.com/wp-content/uploads/2015/04/media-playllist.jpg) Media Player Playlist -Besides this multimedia players also install ubuntu-restricted-extras and Java support packages in order to decode and support other restricted media formats. +除了Besides this multimedia players also install ubuntu-restricted-extras and Java support packages in order to decode and support other restricted media formats. $ sudo apt-get install ubuntu-restricted-extras openjdk-8-jdk From 9c0a5cc60ccfeabe544beb19caaa90a5e5aef14d Mon Sep 17 00:00:00 2001 From: Gore Liu Date: Wed, 20 May 2015 12:59:11 +0800 Subject: [PATCH 095/965] [Translating] 20150409 4 Tools Send Email with Subject, Body and Attachment in Linux.md --- ...ols Send Email with Subject, Body and Attachment in Linux.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20150409 4 Tools Send Email with Subject, Body and Attachment in Linux.md b/sources/tech/20150409 4 Tools Send Email with Subject, Body and Attachment in Linux.md index 77936b6a67..bc3f02095c 100644 --- a/sources/tech/20150409 4 Tools Send Email with Subject, Body and Attachment in Linux.md +++ b/sources/tech/20150409 4 Tools Send Email with Subject, Body and Attachment in Linux.md @@ -1,3 +1,5 @@ +Translating by goreliu ... + 4 Tools Send Email with Subject, Body and Attachment in Linux ================================================================================ In today's article we will cover a few ways you can use to send emails with attachments from the command line interface on Linux. It can have quite a few uses, for example to send an archive with an application from an application server to email or you can use the commands in scripts to automate some process. For our examples,we will use the file foo.tar.gz as our attachment. From 2693e62ddfdd6feed61d1360856f1b21277024b4 Mon Sep 17 00:00:00 2001 From: Gore Liu Date: Wed, 20 May 2015 14:38:40 +0800 Subject: [PATCH 096/965] [Translated] 20150409 4 Tools Send Email with Subject, Body and Attachment in Linux.md --- ...h Subject, Body and Attachment in Linux.md | 263 ------------------ ...h Subject, Body and Attachment in Linux.md | 261 +++++++++++++++++ 2 files changed, 261 insertions(+), 263 deletions(-) delete mode 100644 sources/tech/20150409 4 Tools Send Email with Subject, Body and Attachment in Linux.md create mode 100644 translated/tech/20150409 4 Tools Send Email with Subject, Body and Attachment in Linux.md diff --git a/sources/tech/20150409 4 Tools Send Email with Subject, Body and Attachment in Linux.md b/sources/tech/20150409 4 Tools Send Email with Subject, Body and Attachment in Linux.md deleted file mode 100644 index bc3f02095c..0000000000 --- a/sources/tech/20150409 4 Tools Send Email with Subject, Body and Attachment in Linux.md +++ /dev/null @@ -1,263 +0,0 @@ -Translating by goreliu ... - -4 Tools Send Email with Subject, Body and Attachment in Linux -================================================================================ -In today's article we will cover a few ways you can use to send emails with attachments from the command line interface on Linux. It can have quite a few uses, for example to send an archive with an application from an application server to email or you can use the commands in scripts to automate some process. For our examples,we will use the file foo.tar.gz as our attachment. - -There are various ways to send emails from command line using different mail clients but here I am sharing few mail client utility used by most users like mailx, mutt and swaks. - -All the tools we will present to you are very popular and present in the repositories of most Linux distributions, you can install them using the following commands: - -For **Debian / Ubuntu** systems - - apt-get install mutt - apt-get install swaks - apt-get install mailx - apt-get install sharutils - -For Red Hat based systems like **CentOS** or **Fedora** - - yum install mutt - yum install swaks - yum install mailx - yum install sharutils - -### 1) Using mail / mailx ### - -The mailx utility found as the default mailer application in most Linux distributions now includes the support to attach file. If it is not available you can easily install using the following commands please take note that this may not be supported in older versions, to check this you can use the command: - - $ man mail - -And the first line should look like this: - -mailx [-BDdEFintv~] [-s subject] [-a attachment ] [-c cc-addr] [-b bcc-addr] [-r from-addr] [-h hops] [-A account] [-S variable[=value]] to-addr . . . - -As you can see it supports the -a attribute to add a file to the email and -s attribute to subject to the email. Use few of below examples to send mails. - -**a) Simple Mail** - -Run the mail command, and then mailx would wait for you to enter the message of the email. You can hit enter for new lines. When done typing the message, press Ctrl+D and mailx would display EOT. - -After than mailx automatically delivers the email to the destination. - - $ mail user@example.com - - HI, - Good Morning - How are you - EOT - -**b) To send email with subject** - - $ echo "Email text" | mail -s "Test Subject" user@example.com - --s is used for defining subject for email. - -**c) To send message from a file** - - $ mail -s "message send from file" user@example.com < /path/to/file - -**d) To send message piped using the echo command** - - $ echo "This is message body" | mail -s "This is Subject" user@example.com - -**e) To send email with attachment** - - $ echo “Body with attachment "| mail -a foo.tar.gz -s "attached file" user@example.com - --a is used for attachments - -### 2) mutt ### - -Mutt is a text-based email client for Unix-like systems. It was developed over 20 years ago and it's an important part of Linux history, one of the first clients to support scoring and threading capabilities. Use few of below examples to send email. - -**a) Send email with subject & body message from a file** - - $ mutt -s "Testing from mutt" user@example.com < /tmp/message.txt - -**b) To send body message piped using the echo command** - - $ echo "This is the body" | mutt -s "Testing mutt" user@example.com - -**c) To send email with attachment** - - $ echo "This is the body" | mutt -s "Testing mutt" user@example.com -a /tmp/foo.tar.gz - -**d) To send email with multiple attachments** - - $ echo "This is the body" | mutt -s "Testing" user@example.com -a foo.tar.gz –a bar.tar.gz - -### 3) swaks ### - -Swaks stands for Swiss Army Knife for SMTP and it is a featureful, flexible, scriptable, transaction-oriented SMTP test tool written and maintained by John Jetmore. You can use the following syntax to send an email with attachment: - - $ swaks -t "foo@bar.com" --header "Subject: Subject" --body "Email Text" --attach foo.tar.gz - -The important thing about Swaks is that it will also debug the full mail transaction for you, so it is a very useful tool if you also wish to debug the mail sending process: - -As you can see it gives you full details about the sending process including what capabilities the receiving mail server supports, each step of the transaction between the 2 servers. - -### 4) uuencode ### - -Email transport systems were originally designed to transmit characters with a seven-bit encoding -- like ASCII. This meant they could send messages with plain text but not "binary" text, such as program files or image files that used all of an eight-bit byte. The program is used to solve this limitation is “uuencode”( "UNIX to UNIX encoding") which encode the mail from binary format to text format that is safe to transmit & program is used to decode the data is called “uudecode” - -We can easily send binary text such as a program files or image files using uuencode with mailx or mutt email client is shown by following example: - - $ uuencode example.jpeg example.jpeg | mail user@example.com - -### Shell Script : Explain how to send email ### - - #!/bin/bash - - FROM="" - SUBJECT="" - ATTACHMENTS="" - TO="" - BODY="" - - # Function to check if entered file names are really files - function check_files() - { - output_files="" - for file in $1 - do - if [ -s $file ] - then - output_files="${output_files}${file} " - fi - done - echo $output_files - } - - echo "*********************" - echo "E-mail sending script." - echo "*********************" - echo - - # Getting the From address from user - while [ 1 ] - do - if [ ! $FROM ] - then - echo -n -e "Enter the e-mail address you wish to send mail from:\n[Enter] " - else - echo -n -e "The address you provided is not valid:\n[Enter] " - fi - - read FROM - echo $FROM | grep -E '^.+@.+$' > /dev/null - if [ $? -eq 0 ] - then - break - fi - done - - echo - - # Getting the To address from user - while [ 1 ] - do - if [ ! $TO ] - then - echo -n -e "Enter the e-mail address you wish to send mail to:\n[Enter] " - else - echo -n -e "The address you provided is not valid:\n[Enter] " - fi - - read TO - echo $TO | grep -E '^.+@.+$' > /dev/null - if [ $? -eq 0 ] - then - break - fi - done - - echo - - # Getting the Subject from user - echo -n -e "Enter e-mail subject:\n[Enter] " - read SUBJECT - - echo - - if [ "$SUBJECT" == "" ] - then - echo "Proceeding without the subject..." - fi - - # Getting the file names to attach - echo -e "Provide the list of attachments. Separate names by space. - If there are spaces in file name, quote file name with \"." - read att - - echo - - # Making sure file names are poiting to real files - attachments=$(check_files "$att") - echo "Attachments: $attachments" - - for attachment in $attachments - do - ATTACHMENTS="$ATTACHMENTS-a $attachment " - done - - echo - - # Composing body of the message - echo "Enter message. To mark the end of message type ;; in new line." - read line - - while [ "$line" != ";;" ] - do - BODY="$BODY$line\n" - read line - done - - SENDMAILCMD="mutt -e \"set from=$FROM\" -s \"$SUBJECT\" \ - $ATTACHMENTS -- \"$TO\" <<< \"$BODY\"" - echo $SENDMAILCMD - - mutt -e "set from=$FROM" -s "$SUBJECT" $ATTACHMENTS -- $TO <<< $BODY - -**Script Output** - - $ bash send_mail.sh - ********************* - E-mail sending script. - ********************* - - Enter the e-mail address you wish to send mail from: - [Enter] test@gmail.com - - Enter the e-mail address you wish to send mail to: - [Enter] test@gmail.com - - Enter e-mail subject: - [Enter] Message subject - - Provide the list of attachments. Separate names by space. - If there are spaces in file name, quote file name with ". - send_mail.sh - - Attachments: send_mail.sh - - Enter message. To mark the end of message type ;; in new line. - This is a message - text - ;; - -### Conclusion ### - -There are many ways of send emails from command line / shell script but here we have shared 4 tools available for unix / linux based distros. Hope you enjoyed reading our article and please provide your valuable comments and also let us know if you know about any new tools. - --------------------------------------------------------------------------------- - -via: http://linoxide.com/linux-shell-script/send-email-subject-body-attachment-linux/ - -作者:[Bobbin Zachariah][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://linoxide.com/author/bobbin/ \ No newline at end of file diff --git a/translated/tech/20150409 4 Tools Send Email with Subject, Body and Attachment in Linux.md b/translated/tech/20150409 4 Tools Send Email with Subject, Body and Attachment in Linux.md new file mode 100644 index 0000000000..fe2fa8c5cf --- /dev/null +++ b/translated/tech/20150409 4 Tools Send Email with Subject, Body and Attachment in Linux.md @@ -0,0 +1,261 @@ +4个可以发送带主题、正文和附件的电子邮件的工具 +================================================================================ +今天的文章里我们会讲到一些使用Linux命令行工具来发送带附件的电子邮件的方法。它有很多用处,比如在应用程序所在服务器上,使用电子邮件发送一个档案过来,或者你可以在脚本中使用这些命令来做一些自动化操作。在本文的例子中,我们会使用foo.tar.gz文件作为附件。 + +有不同的命令行工具可以发送邮件,这里我分享几个多数用户会使用的工具,如`mailx`、`mutt`和`swaks`。 + +我们即将呈现的多数工具都是非常有名的,并且存在于多数Linux发行版默认的软件仓库中,你可以使用如下命令安装: + +在 **Debian / Ubuntu** 系统 + + apt-get install mutt + apt-get install swaks + apt-get install mailx + apt-get install sharutils + +在基于Red Hat的系统,如 **CentOS** 或者 **Fedora** + + yum install mutt + yum install swaks + yum install mailx + yum install sharutils + +### 1) 使用 mail / mailx ### + +`mailx`工具在多数Linux发行版中是默认的邮件程序,现在已经支持发送附件了。如果它不在你的系统中,你可以使用上边的命令安装。有一点需要注意,老版本的mailx可能不支持发送附件,运行如下命令查看是否支持。 + + $ man mail + +第一行看起来是这样的: + + mailx [-BDdEFintv~] [-s subject] [-a attachment ] [-c cc-addr] [-b bcc-addr] [-r from-addr] [-h hops] [-A account] [-S variable[=value]] to-addr . . . + +如果你看到它支持`-a`的选项(-a 文件名,将文件作为附件添加到邮件)和`-s`选项(-s 主题,指定邮件的主题),就是支持的。可以使用如下的几个例子发送邮件。 + +**a) 简单的邮件 ** + +运行`mail`命令,然后`mailx`会等待你输入邮件内容。你可以按回车来换行。当输入完成后,按Ctrl + D,`mailx`会显示EOT。 + +然后`mailx`会自动将邮件发送给收件人。 + + $ mail user@example.com + + HI, + Good Morning + How are you + EOT + +**b) 发送有主题的邮件 ** + + $ echo "Email text" | mail -s "Test Subject" user@example.com + +`-s`的用处是指定邮件的主题。 + +**c) 从文件中读取邮件内容并发送 ** + + $ mail -s "message send from file" user@example.com < /path/to/file + +**d) 将从管道获取到的`echo`命令输出作为邮件内容发送 ** + + $ echo "This is message body" | mail -s "This is Subject" user@example.com + +**e) 发送带附件的邮件 ** + + $ echo “Body with attachment "| mail -a foo.tar.gz -s "attached file" user@example.com + +`-a`选项用于指定附件。 + +### 2) mutt ### + +Mutt是类Unix系统上的一个文本界面邮件客户端。它有20多年的历史,在Linux历史中也是一个很重要的部分,它是最早支持进程打分和多线程处理的程序之一。按照如下的例子来发送邮件。 + +**a) 从文件中读取邮件的主题和正文,并发送 ** + + $ mutt -s "Testing from mutt" user@example.com < /tmp/message.txt + +**b) 将从管道获取到的`echo`命令输出作为邮件内容发送 ** + + $ echo "This is the body" | mutt -s "Testing mutt" user@example.com + +**c) 发送带附件的邮件 ** + + $ echo "This is the body" | mutt -s "Testing mutt" user@example.com -a /tmp/foo.tar.gz + +**d) 发送带有多个附件的邮件 ** + + $ echo "This is the body" | mutt -s "Testing" user@example.com -a foo.tar.gz –a bar.tar.gz + +### 3) swaks ### + +Swaks(Swiss Army Knife,瑞士军刀)是SMTP的瑞士军刀,它功能强大、灵活、可编程、面向事务的SMTP测试工具,由John Jetmore开发和维护。你可以使用如下语法发送带附件的邮件: + + $ swaks -t "foo@bar.com" --header "Subject: Subject" --body "Email Text" --attach foo.tar.gz + +关于Swaks一个重要的事情是,它会为你显示整个邮件发送过程,所以如果你想调试邮件发送过程,它是一个非常有用的工具: + +正如你看到的那样,它给你提供了邮件发送过程的所有细节,包括邮件接收服务器的功能支持、两个服务器之间的每一步交互。 + +### 4) uuencode ### + +邮件传输系统最初是被设计来传送7位编码(类似ASCII)的内容的。这就意味这它是用来发送文本内容,而不能发会使用8个位的二进制内容(如程序文件或者图片)。`uuencode`(“UNIX to UNIX encoding”,UNIX之间使用的编码方式)程序用来解决这个限制。使用`uuencode`,发送端将二进制格式的转换成文本格式来传输,接收端再转换回去。 + +我们可以简单地使用`uuencode`和`mailx`或者`mutt`配合,来发送二进制内容,类似这样: + + $ uuencode example.jpeg example.jpeg | mail user@example.com + +### Shell脚本:解释如何发送邮件 ### + + #!/bin/bash + + FROM="" + SUBJECT="" + ATTACHMENTS="" + TO="" + BODY="" + + # 检查文件名对应的文件是否存在 + function check_files() + { + output_files="" + for file in $1 + do + if [ -s $file ] + then + output_files="${output_files}${file} " + fi + done + echo $output_files + } + + echo "*********************" + echo "E-mail sending script." + echo "*********************" + echo + + # 读取用户输入的邮件地址 + while [ 1 ] + do + if [ ! $FROM ] + then + echo -n -e "Enter the e-mail address you wish to send mail from:\n[Enter] " + else + echo -n -e "The address you provided is not valid:\n[Enter] " + fi + + read FROM + echo $FROM | grep -E '^.+@.+$' > /dev/null + if [ $? -eq 0 ] + then + break + fi + done + + echo + + # 读取用户输入的收件人地址 + while [ 1 ] + do + if [ ! $TO ] + then + echo -n -e "Enter the e-mail address you wish to send mail to:\n[Enter] " + else + echo -n -e "The address you provided is not valid:\n[Enter] " + fi + + read TO + echo $TO | grep -E '^.+@.+$' > /dev/null + if [ $? -eq 0 ] + then + break + fi + done + + echo + + # 读取用户输入的邮件主题 + echo -n -e "Enter e-mail subject:\n[Enter] " + read SUBJECT + + echo + + if [ "$SUBJECT" == "" ] + then + echo "Proceeding without the subject..." + fi + + # 读取作为附件的文件名 + echo -e "Provide the list of attachments. Separate names by space. + If there are spaces in file name, quote file name with \"." + read att + + echo + + # 确保文件名指向真实文件 + attachments=$(check_files "$att") + echo "Attachments: $attachments" + + for attachment in $attachments + do + ATTACHMENTS="$ATTACHMENTS-a $attachment " + done + + echo + + # 读取完整的邮件正文 + echo "Enter message. To mark the end of message type ;; in new line." + read line + + while [ "$line" != ";;" ] + do + BODY="$BODY$line\n" + read line + done + + SENDMAILCMD="mutt -e \"set from=$FROM\" -s \"$SUBJECT\" \ + $ATTACHMENTS -- \"$TO\" <<< \"$BODY\"" + echo $SENDMAILCMD + + mutt -e "set from=$FROM" -s "$SUBJECT" $ATTACHMENTS -- $TO <<< $BODY + +** 脚本输出 ** + + $ bash send_mail.sh + ********************* + E-mail sending script. + ********************* + + Enter the e-mail address you wish to send mail from: + [Enter] test@gmail.com + + Enter the e-mail address you wish to send mail to: + [Enter] test@gmail.com + + Enter e-mail subject: + [Enter] Message subject + + Provide the list of attachments. Separate names by space. + If there are spaces in file name, quote file name with ". + send_mail.sh + + Attachments: send_mail.sh + + Enter message. To mark the end of message type ;; in new line. + This is a message + text + ;; + +### 总结 ### + +有很多方法可以使用命令行/Shell脚本来发送邮件,我们只分享了其中4个类Unix系统可用的工具。希望你喜欢我们的文章,并且提供您的宝贵意见,让我们知道您想了解哪些新工具。 + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/linux-shell-script/send-email-subject-body-attachment-linux/ + +作者:[Bobbin Zachariah][a] +译者:[goreliu](https://github.com/goreliu) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://linoxide.com/author/bobbin/ \ No newline at end of file From af3da6d18941c590905a9b3bbf1c64e07de4531e Mon Sep 17 00:00:00 2001 From: ZTinoZ Date: Wed, 20 May 2015 16:03:26 +0800 Subject: [PATCH 097/965] Translating by ZTinoZ --- ...7 15 Things to Do After Installing Ubuntu 15.04 Desktop.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20150427 15 Things to Do After Installing Ubuntu 15.04 Desktop.md b/sources/tech/20150427 15 Things to Do After Installing Ubuntu 15.04 Desktop.md index 857b2157b3..d5e543a7ba 100644 --- a/sources/tech/20150427 15 Things to Do After Installing Ubuntu 15.04 Desktop.md +++ b/sources/tech/20150427 15 Things to Do After Installing Ubuntu 15.04 Desktop.md @@ -93,14 +93,14 @@ Install Media Players ![Media Player Playlist](http://www.tecmint.com/wp-content/uploads/2015/04/media-playllist.jpg) Media Player Playlist -除了Besides this multimedia players also install ubuntu-restricted-extras and Java support packages in order to decode and support other restricted media formats. +除了多媒体播放器,安装ubuntu-restricted-extras和Java支持包也可以解码并支持其它受约束的多媒体格式。 $ sudo apt-get install ubuntu-restricted-extras openjdk-8-jdk ![Install Ubuntu Extras](http://www.tecmint.com/wp-content/uploads/2015/04/install-ubuntu-extras.jpg) Install Ubuntu Extras -To enable DVD Playback and other multimedia codecs issue the following command on Terminal: +在终端上输入以下命令来启用DVD Playback和其它多媒体解码器: $ sudo apt-get install ffmpeg gstreamer0.10-plugins-bad lame libavcodec-extra $ sudo /usr/share/doc/libdvdread4/install-css.sh From cc999458e61e54c9da842a7040f089b9bd43391a Mon Sep 17 00:00:00 2001 From: Gore Liu Date: Wed, 20 May 2015 18:37:13 +0800 Subject: [PATCH 098/965] [Translating] 20150326 How to set up server monitoring system with Monit.md --- ...50326 How to set up server monitoring system with Monit.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150326 How to set up server monitoring system with Monit.md b/sources/tech/20150326 How to set up server monitoring system with Monit.md index c8f9efaecd..a803878b39 100644 --- a/sources/tech/20150326 How to set up server monitoring system with Monit.md +++ b/sources/tech/20150326 How to set up server monitoring system with Monit.md @@ -1,3 +1,5 @@ +Translating by goreliu ... + How to set up server monitoring system with Monit ================================================================================ Many Linux admins rely on a centralized remote monitoring system (e.g., [Nagios][1] or [Cacti][2]) to check the health of their network infrastructure. While centralized monitoring makes an admin's life easy when dealing with many hosts and devices, a dedicated monitoring box obviously becomes a single point of failure; if the monitoring box goes down or becomes unreachable for whatever reason (e.g., bad hardware or network outage), you will lose visibility on your entire infrastructure. @@ -237,7 +239,7 @@ In this tutorial, I demonstrate how to set up Monit on a local server. What I sh via: http://xmodulo.com/server-monitoring-system-monit.html 作者:[Iulian Murgulet][a] -译者:[译者ID](https://github.com/译者ID) +译者:[goreliu](https://github.com/goreliu) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 From 3797ef5f4fc973220f9f83946e0b38c1165ba82a Mon Sep 17 00:00:00 2001 From: wwy-hust Date: Wed, 20 May 2015 22:45:41 +0800 Subject: [PATCH 099/965] after translation --- ...epositories Using Gitblit Tool in Linux.md | 101 ------------------ ...epositories Using Gitblit Tool in Linux.md | 101 ++++++++++++++++++ 2 files changed, 101 insertions(+), 101 deletions(-) delete mode 100644 sources/tech/20150330 How to Serve Git Repositories Using Gitblit Tool in Linux.md create mode 100644 translated/tech/20150330 How to Serve Git Repositories Using Gitblit Tool in Linux.md diff --git a/sources/tech/20150330 How to Serve Git Repositories Using Gitblit Tool in Linux.md b/sources/tech/20150330 How to Serve Git Repositories Using Gitblit Tool in Linux.md deleted file mode 100644 index 806a462675..0000000000 --- a/sources/tech/20150330 How to Serve Git Repositories Using Gitblit Tool in Linux.md +++ /dev/null @@ -1,101 +0,0 @@ -How to Serve Git Repositories Using Gitblit Tool in Linux -================================================================================ -Hi friends, today we'll be learning how to install Gitblit in your Linux Server or PC. So, lets check out what is a Git, its features and steps to install Gitblit. [Git is a distributed revision control system][1] with an emphasis on speed, data integrity, and support for distributed, non-linear workflows. It was initially designed and developed by Linus Torvalds for Linux kernel under the terms of the GNU General Public License version 2 development in 2005, and has since become the most widely adopted version control system for software development. - -[Gitblit is a free and open source][2] built on a pure Java stack designed to handle everything from small to very large projects with speed and efficiency for serving Git repositories. It is easy to learn and has a tiny footprint with lightning fast performance. It outclasses SCM tools like Subversion, CVS, Perforce, and ClearCase with features like cheap local branching, convenient staging areas, and multiple workflows. - -#### Features of Gitblit #### - -- It can be used as a dumb repository viewer with no administrative controls or user accounts. -- It can be used as a complete Git stack for cloning, pushing, and repository access control. -- It can be used without any other Git tooling (including actual Git) or it can cooperate with your established tools. - -### 1. Creating Gitblit install directory ### - -First of all we'll gonna to create a directory in our server in which we'll be installing our latest gitblit in. - - $ sudo mkdir -p /opt/gitblit - - $ cd /opt/gitblit - -![creating directory gitblit](http://blog.linoxide.com/wp-content/uploads/2015/01/creating-directory-gitblit.png) - -### 2. Downloading and Extracting ### - -Now, we will want to download the latest gitblit from the official site. Here, the current version of gitblit we are gonna install is 1.6.2 . So, please change it as the version you are gonna install in your system. - - $ sudo wget http://dl.bintray.com/gitblit/releases/gitblit-1.6.2.tar.gz - -![downloading gitblit package](http://blog.linoxide.com/wp-content/uploads/2015/01/downloading-gitblit.png) - -Now, we'll be extracting our downloaded tarball package to our current folder ie /opt/gitblit/ - - $ sudo tar -zxvf gitblit-1.6.2.tar.gz - -![extracting gitblit tar](http://blog.linoxide.com/wp-content/uploads/2015/01/extracting-gitblit-tar.png) - -### 3. Configuring and Running ### - -Now, we'll configure our Gitblit configuration. If you want to customize the behavior of Gitblit server, you can do it by modifying `gitblit/data/gitblit.properties` . Now, after you are done configuring the configuration. We finally wanna run our gitblit. We have two options on running gitblit, first is that we run it manually by the command below: - - $ sudo java -jar gitblit.jar --baseFolder data - -And next is to add and use gitblit as service. Here are the steps that we'll need to follow to use gitblit as service in linux. - -So, As I am running Ubuntu, the command below will be sudo cp service-ubuntu.sh /etc/init.d/gitblit so please change the file name service-ubuntu.sh to the distribution you are currently running. - - $ sudo ./install-service-ubuntu.sh - - $ sudo service gitblit start - -![starting gitblit service](http://blog.linoxide.com/wp-content/uploads/2015/01/starting-gitblit-service.png) - -Open your browser to http://localhost:8080 or https://localhost:8443 or replace "localhost" with the ip-address of the machine depending on your system configuration. Enter the default administrator credentials: admin / admin and click the Login button. - -![gitblit welcome](http://blog.linoxide.com/wp-content/uploads/2015/01/gitblit-welcome.png) - -Now, we'll wanna add a new user. First you'll need to login to the admin with default administrator credentials: username = **admin** and password = **admin** . - -Then, Goto user icon > users > (+) new user. And create a new user like as shown in the figure below. - -![add new user](http://blog.linoxide.com/wp-content/uploads/2015/01/add-user.png) - -Now, we'll create a new repo out of the box. Go to repositories > (+) new repository . Then, add new repository as shown below. - -![add new repository](http://blog.linoxide.com/wp-content/uploads/2015/01/add-new-repository.png) - -#### Create a new repository on the command-line #### - - touch README.md - git init - git add README.md - git commit -m "first commit" - git remote add origin ssh://arunlinoxide@localhost:29418/linoxide.com.git - git push -u origin master - -Please replace the username arunlinoxide with the user you add. - -#### Push an existing repository from the command-line #### - - git remote add origin ssh://arunlinoxide@localhost:29418/linoxide.com.git - git push -u origin master - -**Note**: It is highly recommended to everyone to change the password of username "admin" as it comes by default. - -### Conclusion ### - -Hurray, we finally installed our latest Gitblit in our Linux Computer. We can now enjoy such a beautiful version controlling system for our projects whether its small or large, no matter. With Gitblit, version controlling has been too easy. It is easy to learn and has a tiny footprint with lightning fast performance. So, if you have any questions, suggestions, feedback please write them in the comment box below. - --------------------------------------------------------------------------------- - -via: http://linoxide.com/linux-how-to/serve-git-repositories-gitblit/ - -作者:[Arun Pyasi][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://linoxide.com/author/arunp/ -[1]:http://git-scm.com/ -[2]:http://gitblit.com/ \ No newline at end of file diff --git a/translated/tech/20150330 How to Serve Git Repositories Using Gitblit Tool in Linux.md b/translated/tech/20150330 How to Serve Git Repositories Using Gitblit Tool in Linux.md new file mode 100644 index 0000000000..45c09f3475 --- /dev/null +++ b/translated/tech/20150330 How to Serve Git Repositories Using Gitblit Tool in Linux.md @@ -0,0 +1,101 @@ +如何在Linux下使用Gitblit工具创建Git仓库服务 +================================================================================ +嗨!朋友,今天我们将学习如何在你的Linux服务器或者PC上安装Gitblit工具。首先,我们看看什么是Git,它的功能以及安装Gitblit的步骤。[Git是分布式版本控制系统][1],它强调速度、数据一致性,并且支持分布式、非线性工作流。它最初由Linus Torvalds在2005年为Linux内核设计和开发,使用GPL2证书,并因此成为软件开发中使用最广泛的版本控制系统。 + +[Gitblit是完全开源的软件][2],它基于纯粹的Java堆栈,被设计以在Git仓库速度和效率方面胜任从小型到极大型的项目。它很容易学习和上手,并有着闪电般的性能。它在廉价的本地分支、便于staging、多工作流等方面远胜过一些SCM(版本控制)工具,比如Subversion、CVS、Perforce和ClearCase。 + +#### Gitblit的功能 #### + +- 它可以做为一个无声的仓库视图,没有管理控制以及用户账户。 +- 它可以做为完整的Git堆栈,拥有clone, pushing和仓库存取控制。 +- 它能独立于其他Git工具使用(包括实际的Git),它能和您已创建的工具合作。 + +### 1.创建Gitblit安装目录 ### + +首先我们将在我们的服务器上建立一个目录,我们将在该目录下安装最新的Gitblit。 + + $ sudo mkdir -p /opt/gitblit + + $ cd /opt/gitblit + +![创建gitblit目录](http://blog.linoxide.com/wp-content/uploads/2015/01/creating-directory-gitblit.png) + +### 2. 下载并解压 ### + +现在,我们将从Gitblit官方站点下载最新版的Gitblit。这里我们将安装1.6.2版本。所以,请在安装时根据具体的版本对命令进行修改。 + + $ sudo wget http://dl.bintray.com/gitblit/releases/gitblit-1.6.2.tar.gz + +![下载gitblit安装包](http://blog.linoxide.com/wp-content/uploads/2015/01/downloading-gitblit.png) + +接下来,我们将解压下载到的tarball压缩包至之前创建的目录 /opt/gitblit/ + + $ sudo tar -zxvf gitblit-1.6.2.tar.gz + +![解压gitblit压缩包](http://blog.linoxide.com/wp-content/uploads/2015/01/extracting-gitblit-tar.png) + +### 3.配置并运行 ### + +现在,我们将对Gitblit进行配置。如果你想要定制Gitblit的行为,你可以修改`gitblit/data/gitblit.properties`。在完成配置后,我们将运行安装好的gitblit。有两种方式来运行gitblit,第一种是通过下面的命令手动运行: + + $ sudo java -jar gitblit.jar --baseFolder data + +另一种是将gitblit添加为服务。下面是在linux下将gitblit添加为服务的步骤。 + +由于我在使用Ubuntu,下面的命令将是 sudo cp service-ubuntu.sh /etc/init.d/gitblit。所以请根据你的发行版修改文件名service-ubuntu.sh为相应的你运行的发行版。 + + $ sudo ./install-service-ubuntu.sh + + $ sudo service gitblit start + +![启动gitblit服务](http://blog.linoxide.com/wp-content/uploads/2015/01/starting-gitblit-service.png) + +在你的浏览器中打开http://localhost:8080或https://localhost:8443,也可以将localhost根据本地配置替换为IP地址。输入默认的管理员凭证:admin/admin并点击login按钮。 + +![gitblit欢迎页面](http://blog.linoxide.com/wp-content/uploads/2015/01/gitblit-welcome.png) + +现在,我们将添加一个新的用户。首先,你需要以admin用户登录,username = **admin**,password = **admin**。 + +然后,点击 user icon > users > (+) new user 来创建一个新用户,如下图所示。 + +![添加新用户](http://blog.linoxide.com/wp-content/uploads/2015/01/add-user.png) + +现在,我们将创建一个开箱可用的仓库。点击 repositories > (+) new repository。然后,如下图所示添加新的仓库。 + +![添加新的仓库](http://blog.linoxide.com/wp-content/uploads/2015/01/add-new-repository.png) + +#### 使用命令行创建一个新的仓库 #### + + touch README.md + git init + git add README.md + git commit -m "first commit" + git remote add origin ssh://arunlinoxide@localhost:29418/linoxide.com.git + git push -u origin master + +请将用户名arunlinoxide替换为你添加的用户名。 + +#### 在命令行中push一个已存在的仓库 #### + + git remote add origin ssh://arunlinoxide@localhost:29418/linoxide.com.git + git push -u origin master + +**注意**:强烈建议所有人修改用户名“admin”的密码。 + +### 结论 ### + +欢呼吧!我们已经在Linux电脑中安装好了最新版本的Gitblit。接下来我们便可以在我们的大小工程中享受这样一个优美的版本控制系统。有了Gitblit,版本控制便再容易不过了。它有易于学习、轻量级、高性能的特点。因此,如果你有任何的问题、建议和反馈,请在留言处留言。 + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/linux-how-to/serve-git-repositories-gitblit/ + +作者:[Arun Pyasi][a] +译者:[wwy-hust](https://github.com/wwy-hust) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://linoxide.com/author/arunp/ +[1]:http://git-scm.com/ +[2]:http://gitblit.com/ \ No newline at end of file From f2be3eca0187b39b285eed0f1cb7cd2873bb210e Mon Sep 17 00:00:00 2001 From: wxy Date: Wed, 20 May 2015 23:15:23 +0800 Subject: [PATCH 100/965] PUB:20150413 Linux FAQs with Answers--How to change PATH environment variable on Linux @geekpi --- ...s--How to change PATH environment variable on Linux.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) rename {translated/tech => published}/20150413 Linux FAQs with Answers--How to change PATH environment variable on Linux.md (90%) diff --git a/translated/tech/20150413 Linux FAQs with Answers--How to change PATH environment variable on Linux.md b/published/20150413 Linux FAQs with Answers--How to change PATH environment variable on Linux.md similarity index 90% rename from translated/tech/20150413 Linux FAQs with Answers--How to change PATH environment variable on Linux.md rename to published/20150413 Linux FAQs with Answers--How to change PATH environment variable on Linux.md index 5cc7a17bd2..321ce4b2d3 100644 --- a/translated/tech/20150413 Linux FAQs with Answers--How to change PATH environment variable on Linux.md +++ b/published/20150413 Linux FAQs with Answers--How to change PATH environment variable on Linux.md @@ -1,4 +1,4 @@ -Linux有问必答--如何在Linux中修改环境变量PATH +Linux有问必答:如何在Linux中修改环境变量PATH ================================================================================ > **提问**: 当我试着运行一个程序时,它提示“command not found”。 但这个程序就在/usr/local/bin下。我该如何添加/usr/local/bin到我的PATH变量下,这样我就可以不用指定路径来运行这个命令了。 @@ -38,7 +38,7 @@ Linux有问必答--如何在Linux中修改环境变量PATH /usr/lib64/qt-3.3/bin:/bin:/usr/bin:/usr/sbin:/sbin:/home/xmodulo/bin:/usr/local/bin -更新的PATH会在当前的PATH一直有效。然而,更改将在新的会话中失效。 +更新后的PATH会在当前的会话一直有效。然而,更改将在新的会话中失效。 如果你想要永久更改PATH变量,用编辑器打开~/.bashrc (或者 ~/.bash_profile),接着在最后添加下面这行。 @@ -46,7 +46,7 @@ Linux有问必答--如何在Linux中修改环境变量PATH 接着运行下面这行永久激活更改: - $ source ~/.bashrc (or source ~/.bash_profile) + $ source ~/.bashrc (或者 source ~/.bash_profile) ### 改变系统级的环境变量 ### @@ -66,7 +66,7 @@ via: http://ask.xmodulo.com/change-path-environment-variable-linux.html 作者:[Dan Nanni][a] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 From 522b7ea44009d0dc4aaa902e7f1b7e1aaac2b065 Mon Sep 17 00:00:00 2001 From: wxy Date: Wed, 20 May 2015 23:37:30 +0800 Subject: [PATCH 101/965] PUB:20150410 What is a good alternative to wget or curl on Linux MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @wangjiezhe 翻译的不错! --- ...od alternative to wget or curl on Linux.md | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) rename {translated/tech => published}/20150410 What is a good alternative to wget or curl on Linux.md (71%) diff --git a/translated/tech/20150410 What is a good alternative to wget or curl on Linux.md b/published/20150410 What is a good alternative to wget or curl on Linux.md similarity index 71% rename from translated/tech/20150410 What is a good alternative to wget or curl on Linux.md rename to published/20150410 What is a good alternative to wget or curl on Linux.md index caa4010661..3af223b631 100644 --- a/translated/tech/20150410 What is a good alternative to wget or curl on Linux.md +++ b/published/20150410 What is a good alternative to wget or curl on Linux.md @@ -1,12 +1,13 @@ -Linux 上 wget 或 curl 的更佳替代品 +用腻了 wget 或 curl,有什么更好的替代品吗? ================================================================================ -如果你经常需要通过终端以非交互模式访问网络服务器(例如,从网络上下载文件,或者是测试 RESTful 网络服务接口),可能你会选择的工具是 wget 或 curl。通过大量的命令行选项,这两种工具都可以处理很多非交互网络访问的情况(比如[这里][1],[这里][2],还有[这里][3])。然而,即使像这些一样的强大的工具,也只是与你对如何使用它们的了解程度等同。除非你很精通那些又多又笨(原文是 nitty and gritty)的语法细节,这些工具对于你来说只不过是简单的网络下载器。 -就像宣传的那样,“为人类着想的类 curl 工具”,[HTTPie][4] 设计用来增强 wget 和 curl 的可用性。它的主要目标是使通过命令行与网络服务器进行交互的过程变得尽可能的人性化。为此,HTTPie 支持具有表现力,但又很简单很直观的语法。它以彩色模式显示响应,并且还有一些不错的优点,比如对 JSON 的良好支持,和持久性会话用以作业流程化。 +如果你经常需要通过终端以非交互模式访问网络服务器(例如,从网络上下载文件,或者是测试 RESTful 网络服务接口),可能你会选择的工具是 wget 或 curl。通过大量的命令行选项,这两种工具都可以处理很多非交互网络访问的情况(比如[这里][1]、[这里][2],还有[这里][3])。然而,即使像这些一样的强大的工具,你也只能发挥你所了解的那些选项的功能。除非你很精通那些繁冗的语法细节,这些工具对于你来说只不过是简单的网络下载器而已。 -我知道很多人对把像 wget 和 curl 这样的无处不在的可用的完美工具换成完全没听说过的软件心存怀疑。这种观点是好的,特别是如果你是一个系统管理员、要处理很多不同的硬件的话。然而,对于开发者和终端用户来说,重要的是效率。如果我发现了一个工具的用户友好替代,我没有看到任何问题如果你采用易于使用的版本来节省你宝贵的时间。没有必要对替换掉的工具保持信仰忠诚。毕竟,对于 Linux 来说,最好的事情是可以选择。 +就像其宣传的那样,“给人用 curl 类工具”,[HTTPie][4] 设计用来增强 wget 和 curl 的可用性。它的主要目标是使通过命令行与网络服务器进行交互的过程变得尽可能的人性化。为此,HTTPie 支持具有表现力、但又很简单很直观的语法。它以彩色模式显示响应,并且还有一些不错的优点,比如对 JSON 的良好支持,和持久性会话用以作业流程化。 -在这篇文章中,让我们来回顾并展示一下我所说的 HTTPie,一个用户友好的 wget 和 curl 的替代。 +我知道很多人对把像 wget 和 curl 这样的无处不在的、可用的、完美的工具换成完全没听说过的软件心存疑虑。这种观点是好的,特别是如果你是一个系统管理员、要处理很多不同的硬件的话。然而,对于开发者和终端用户来说,重要的是效率。如果我发现了一个工具的用户更佳替代品,那么我认为采用易于使用的版本来节省宝贵的时间是毫无疑问的。没有必要对替换掉的工具保持信仰忠诚。毕竟,对于 Linux 来说,最好的事情就是可以选择。 + +在这篇文章中,让我们来了解并展示一下我所说的 HTTPie,一个用户友好的 wget 和 curl 的替代。 ![](https://farm8.staticflickr.com/7633/16849137018_bcc7a616fc_b.jpg) @@ -40,10 +41,9 @@ HTTPie 是用 Python 写的,所以你可以在几乎所有地方(Linux,Mac 你可以使用 <header:value> 的格式来定制头部。例如,我们发送一个 HTTP GET 请求到 www.test.com ,使用定制用户代理(user-agent)和来源(referer),还有定制头部(比如 MyParam)。 - $ http www.test.com User-Agent:Xmodulo/1.0 Referer:http://xmodulo.com MyParam:Foo -注意到当使用 HTTP GET 方法时,你无需指定任何 HTTP 方法。 +注意到当使用 HTTP GET 方法时,就无需明确指定 HTTP 方法。 这个 HTTP 请求看起来如下: @@ -121,7 +121,7 @@ HTTPie 的另外一个用户友好特性是输入重定向,你可以使用缓 ### 结束语 ### -在这篇文章中,我介绍了 HTTPie,一个 wget 和 curl 的可能替代工具。除了这里展示的几个简单的例子,你可以在[官方网站][7]上找到 HTTPie 的很多有趣的应用。再次重复一遍,一款强大的工具也只相当于你对它的了解程度。从个人而言,我更热衷于 HTTPie,因为我在寻找一种更简洁的测试复杂网络接口的方法。 +在这篇文章中,我介绍了 HTTPie,一个 wget 和 curl 的可能替代工具。除了这里展示的几个简单的例子,你可以在其[官方网站][7]上找到 HTTPie 的很多有趣的应用。再次重复一遍,一款再强大的工具也取决于你对它的了解程度。从个人而言,我更倾向于 HTTPie,因为我在寻找一种更简洁的测试复杂网络接口的方法。 你怎么看? @@ -131,15 +131,15 @@ via: http://xmodulo.com/wget-curl-alternative-linux.html 作者:[Dan Nanni][a] 译者:[wangjiezhe](https://github.com/wangjiezhe) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 [a]:http://xmodulo.com/author/nanni [1]:http://xmodulo.com/how-to-download-multiple-files-with-wget.html [2]:http://xmodulo.com/how-to-use-custom-http-headers-with-wget.html -[3]:http://ask.xmodulo.com/custom-http-header-curl.html +[3]:https://linux.cn/article-4957-1.html [4]:https://github.com/jakubroztocil/httpie -[5]:http://xmodulo.com/how-to-set-up-epel-repository-on-centos.html +[5]:https://linux.cn/article-2324-1.html [6]:http://ask.xmodulo.com/install-pip-linux.html [7]:https://github.com/jakubroztocil/httpie From 08e9d737523c4ef03255fcc7607cef2addaf0dd1 Mon Sep 17 00:00:00 2001 From: wxy Date: Thu, 21 May 2015 00:04:24 +0800 Subject: [PATCH 102/965] PUB:20150409 Install Inkscape - Open Source Vector Graphic Editor @ZTinoZ --- ...ape - Open Source Vector Graphic Editor.md | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) rename {translated/tech => published}/20150409 Install Inkscape - Open Source Vector Graphic Editor.md (62%) diff --git a/translated/tech/20150409 Install Inkscape - Open Source Vector Graphic Editor.md b/published/20150409 Install Inkscape - Open Source Vector Graphic Editor.md similarity index 62% rename from translated/tech/20150409 Install Inkscape - Open Source Vector Graphic Editor.md rename to published/20150409 Install Inkscape - Open Source Vector Graphic Editor.md index f18b10315e..c6361e780b 100644 --- a/translated/tech/20150409 Install Inkscape - Open Source Vector Graphic Editor.md +++ b/published/20150409 Install Inkscape - Open Source Vector Graphic Editor.md @@ -1,8 +1,8 @@ -安装Inkscape - 开源适量图形编辑器 +Inkscape - 开源适量图形编辑器 ================================================================================ -Inkscape是一款开源矢量图形编辑工具,它使用可缩放矢量图形(SVG)图形格式并不同于它的竞争对手如Xara X、Corel Draw和Adobe Illustrator等等。SVG是一个广泛部署、免版税使用的图形格式,由W3C SVG工作组开发和维护。这是一个跨平台工具,完美运行于Linux、Windows和Mac OS上。 +Inkscape是一款开源矢量图形编辑工具,并不同于Xara X、Corel Draw和Adobe Illustrator等竞争对手,它使用的是可缩放矢量图形(SVG)图形格式。SVG是一个广泛部署、免版税使用的图形格式,由W3C SVG工作组开发和维护。这是一个跨平台工具,完美运行于Linux、Windows和Mac OS上。 -Inkscape始于2003年,起初它的bug跟踪系统托管于Sourceforge上但是 后来迁移到了Launchpad上。当前它最新的一个稳定版本是0.91,它不断地在发展和修改中。我们将在本文里了解一下它的突出特点和安装过程。 +Inkscape始于2003年,起初它的bug跟踪系统托管于Sourceforge上,但是后来迁移到了Launchpad上。当前它最新的一个稳定版本是0.91,它不断地在发展和修改中。我们将在本文里了解一下它的突出特点和安装过程。 ### 显著特性 ### @@ -12,30 +12,30 @@ Inkscape始于2003年,起初它的bug跟踪系统托管于Sourceforge上但是 - 用铅笔工具来画出不同颜色、大小和形状的手绘线,用贝塞尔曲线(笔式)工具来画出直线和曲线,通过书法工具来应用到手写的书法笔画上等等 - 用文本工具来创建、选择、编辑和格式化文本。在纯文本框、在路径上或在形状里操作文本 -- 有效绘制各种形状,像矩形、椭圆形、圆形、弧线、多边形、星形和螺旋形等等并调整其大小、旋转并修改(圆角化)它们 +- 方便绘制各种形状,像矩形、椭圆形、圆形、弧线、多边形、星形和螺旋形等等并调整其大小、旋转并修改(圆角化)它们 - 用简单地命令创建并嵌入位图 #### 对象处理 #### -- 通过交互式操作和调整数值来扭曲、移动、测量、旋转目标 -- 执行力提升并减少了Z-order操作。 -- 对象群组化或取消群组化可以去创建一个虚拟层阶用来编辑或处理 -- 图层采用层次结构树的结构并且能锁定或以各式各样的处理方式来重新布置 +- 通过交互式操作和调整参量来扭曲、移动、测量、旋转目标 +- 可以对 Z 轴进行提升或降低操作。 +- 通过对象组合和取消组合可以创建一个虚拟层用来编辑或处理 +- 图层采用层次结构树的结构,并且能锁定或以各式各样的处理方式来重新布置 - 分布与对齐指令 #### 填充与边框 #### -- 复制/粘贴风格 +- 可以复制/粘贴不同风格 - 取色工具 - 用RGB, HSL, CMS, CMYK和色盘这四种不同的方式选色 -- 渐层编辑器能创建和管理多停点渐层 -- 定义一个图像或其它选择用来进行花纹填充 -- 用一些预定义泼洒花纹可对边框进行花纹泼洒 -- 通过路径标示器来开始、对折和结束标示 +- 渐变层编辑器能创建和管理多停点渐变层 +- 使用图像或其它选择区作为花纹填充 +- 用一些预定义点状花纹进行笔触填充 +- 通过路径标示器标示开始、对折和结束点 #### 路径上的操作 #### -- 节点编辑:移动节点和贝塞尔曲线掌控,节点的对齐和分布等等 +- 节点编辑:移动节点和贝塞尔曲线控制点,节点的对齐和分布等等 - 布尔运算(是或否) - 运用可变的路径起迄点可简化路径 - 路径插入和增设连同动态和链接偏移对象 @@ -43,9 +43,9 @@ Inkscape始于2003年,起初它的bug跟踪系统托管于Sourceforge上但是 #### 文本处理 #### -- 所有安装好的外框字体都能用甚至可以从右至左对齐对象 +- 所有安装好的框线字体都能用,甚至可以从右至左对齐对象 - 格式化文本、调整字母间距、行间距或列间距 -- 路径上的文本和形状上的文本和路径或形状都可以被编辑和修改 +- 路径上和形状上的文本中的文本、路径或形状都可以被编辑和修改 #### 渲染 #### @@ -78,7 +78,7 @@ PPA添加到APT库中后,我们要用以下命令进行更新: ### 结论 ### -Inkscape是一款特点鲜明的图形编辑工具,它给予用户充分发挥自己艺术力的权利。它还是一款自由安装和自定义开源应用并且支持大范围文件类型包括JPEG, PNG, GIF和PDF且不仅这些。访问它的 [官方网站][2] 来获取更多新闻和应用更新。 +Inkscape是一款特点鲜明的图形编辑工具,它给予用户充分发挥自己艺术能力的权利。它还是一款自由安装和自定义的开源应用,并且支持各种文件类型,包括JPEG, PNG, GIF和PDF及更多。访问它的 [官方网站][2] 来获取更多新闻和应用更新。 -------------------------------------------------------------------------------- @@ -86,7 +86,7 @@ via: http://linoxide.com/tools/install-inkscape-open-source-vector-graphic-edito 作者:[Aun Raza][a] 译者:[ZTinoZ](https://github.com/ZTinoZ) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 From f59deb250e4e8212c0ab45e7233623a3c5cdecc0 Mon Sep 17 00:00:00 2001 From: wxy Date: Thu, 21 May 2015 00:08:10 +0800 Subject: [PATCH 103/965] =?UTF-8?q?=E6=81=A2=E5=A4=8D=E7=A7=BB=E5=8A=A8?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E7=9A=84=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...Your Network And Servers With Observium.md | 174 ++++++++++++++++++ 1 file changed, 174 insertions(+) create mode 100644 published/20150304 Monitoring Your Network And Servers With Observium.md diff --git a/published/20150304 Monitoring Your Network And Servers With Observium.md b/published/20150304 Monitoring Your Network And Servers With Observium.md new file mode 100644 index 0000000000..14fc41b746 --- /dev/null +++ b/published/20150304 Monitoring Your Network And Servers With Observium.md @@ -0,0 +1,174 @@ +使用Observium来监控你的网络和服务器 +================================================================================ +### 简介### + +在监控你的服务器、交换机或者设备时遇到过问题吗?**Observium** 可以满足你的需求。这是一个免费的监控系统,它可以帮助你远程监控你的服务器。它是一个由PHP编写的基于自动发现 SNMP 的网络监控平台,支持非常广泛的网络硬件和操作系统,包括 Cisco、Windows、Linux、HP、NetApp 等等。在此我会给出在 Ubuntu 12.04 上一步步地设置一个 **Observium** 服务器的介绍。 + +![](http://www.unixmen.com/wp-content/uploads/2015/03/Capture1.png) + +目前有两种不同的 **observium** 版本。 + +- Observium 社区版本是一个在 QPL 开源许可证下的免费工具,这个版本是对于较小部署的最好解决方案。该版本每6个月进行一次安全性更新。 +- 第2个版本是 Observium 专业版,该版本采用基于 SVN 的发布机制。 会得到每日安全性更新。 该工具适用于服务提供商和企业级部署。 + +更多信息可以通过其[官网][1]获得。 + +### 系统需求### + +要安装 **Observium**, 需要具有一个最新安装的服务器。**Observium** 是在 Ubuntu LTS 和 Debian 系统上进行开发的,所以推荐在 Ubuntu 或 Debian 上安装 **Observium**,因为可能在别的平台上会有一些小问题。 + +该文章会引导你在 Ubuntu 12.04 上安装 **Observium**。对于小型的 **Observium** 安装,建议使用 256MB 内存和双核处理器的配置。 + +### 安装需求 ### + +在安装 **Observuim** 之前,你需要确认安装所有的依赖关系包。 + +首先,使用下面的命令更新你的服务器: + + sudo apt-get update + +然后你需要安装下列运行 Observuim 所需的全部软件包。 + +Observium 需要使用下面所列出的软件才能正确的运行: + +- LAMP 服务器 +- fping +- Net-SNMP 5.4+ +- RRDtool 1.3+ +- Graphviz + +对于可选特性的要求: + +- Ipmitool - 仅在当你想要获取服务器上的 IPMI(Intelligent Platform Management Interface 智能平台管理接口)基板控制器时。 +- Libvirt-bin - 仅在当你想要使用 libvirt 进行远程 VM 主机监控时。 + + sudo apt-get install libapache2-mod-php5 php5-cli php5-mysql php5-gd php5-mcrypt php5-json php-pear snmp fping mysql-server mysql-client python-mysqldb rrdtool subversion whois mtr-tiny ipmitool graphviz imagemagick libvirt ipmitool + +### 为 Observium 创建 MySQL 数据库及其用户。 + +现在你需要登录到 MySQL 中并为 **Observium** 创建数据库: + + mysql -u root -p + +在用户验证成功之后,你需要按照下面的命令创建该数据库。 + + CREATE DATABASE observium; + +数据库名为 **Observium**,稍后你会需要这个信息。 + +现在你需要创建数据库管理员用户。 + + CREATE USER observiumadmin@localhost IDENTIFIED BY 'observiumpassword'; + +接下来,你需要给该管理员用户相应的权限来管理创建的数据库。 + + GRANT ALL PRIVILEGES ON observium.* TO observiumadmin@localhost; + +你需要将权限信息写回到磁盘中来激活新的 MySQL 用户: + + FLUSH PRIVILEGES; + exit + +### 下载并安装 Observium### + +现在我们的系统已经准备好了, 可以开始Observium的安装了。 + +第一步,创建 Observium 将要使用的文件目录: + + mkdir -p /opt/observium && cd /opt + +按本教程的目的,我们将会使用 Observium 的社区/开源版本。使用下面的命令下载并解压: + + wget http://www.observium.org/observium-community-latest.tar.gz + tar zxvf observium-community-latest.tar.gz + +现在进入到 Observium 目录。 + + cd observium + +将默认的配置文件 '**config.php.default**' 复制到 '**config.php**',并将数据库配置选项填充到配置文件中: + + cp config.php.default config.php + nano config.php + +---------- + + / Database config + $config['db_host'] = 'localhost'; + $config['db_user'] = 'observiumadmin'; + $config['db_pass'] = 'observiumpassword'; + $config['db_name'] = 'observium'; + +现在为 MySQL 数据库设置默认的数据库模式: + + php includes/update/update.php + +现在你需要创建一个文件目录来存储 rrd 文件,并修改其权限以便让 apache 能将写入到文件中。 + + mkdir rrd + chown apache:apache rrd + +为了在出现问题时排错,你需要创建日志文件。 + + mkdir -p /var/log/observium + chown apache:apache /var/log/observium + +现在你需要为 Observium 创建虚拟主机配置。 + + + DocumentRoot /opt/observium/html/ + ServerName observium.domain.com + CustomLog /var/log/observium/access_log combined + ErrorLog /var/log/observium/error_log + + AllowOverride All + Options FollowSymLinks MultiViews + + + +下一步你需要让你的 Apache 服务器的 rewrite (重写)功能生效。 + +为了让 'mod_rewrite' 生效,输入以下命令: + + sudo a2enmod rewrite + +该模块在下一次 Apache 服务重启之后就会生效。 + + sudo service apache2 restart + +###配置 Observium### + +在登入 Web 界面之前,你需要为 Observium 创建一个管理员账户(级别10)。 + + # cd /opt/observium + # ./adduser.php admin adminpassword 10 + User admin added successfully. + +下一步为发现和探寻任务设置一个 cron 任务,创建一个新的文件 ‘**/etc/cron.d/observium**’ 并在其中添加以下的内容。 + + 33 */6 * * * root /opt/observium/discovery.php -h all >> /dev/null 2>&1 + */5 * * * * root /opt/observium/discovery.php -h new >> /dev/null 2>&1 + */5 * * * * root /opt/observium/poller-wrapper.py 1 >> /dev/null 2>&1 + +重载 cron 进程来增加新的任务。 + + # /etc/init.d/cron reload + +好啦,你已经完成了 Observium 服务器的安装拉! 使用你的浏览器登录到 **http://\**,然后上路吧。 + +![](http://www.unixmen.com/wp-content/uploads/2015/03/Capture.png) + +尽情享受吧! + +-------------------------------------------------------------------------------- + +via: http://www.unixmen.com/monitoring-network-servers-observium/ + +作者:[anismaj][a] +译者:[theo-l](http://github.com/theo-l) +校对:[wxy](http://github.com/wxy) + +本文由 [LCTT](http://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://www.unixmen.com/author/anis/ +[1]:http://www.observium.org/ From 4b93be5c4618a2491680eb9380b2f743f3892209 Mon Sep 17 00:00:00 2001 From: DeadFire Date: Thu, 21 May 2015 08:11:46 +0800 Subject: [PATCH 104/965] =?UTF-8?q?20150520-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... X GNU Open Source and Apple in History.md | 57 ++++++ ...se Docker Machine with a Cloud Provider.md | 147 +++++++++++++++ ... How to Use tmpfs on RHEL or CentOS 7.0.md | 64 +++++++ ...dgets on Ubuntu or Debian or Linux Mint.md | 167 +++++++++++++++++ ...Backup Files or Directories Using rsync.md | 170 ++++++++++++++++++ 5 files changed, 605 insertions(+) create mode 100644 sources/talk/20150520 Is Linux Better than OS X GNU Open Source and Apple in History.md create mode 100644 sources/tech/20150520 How to Use Docker Machine with a Cloud Provider.md create mode 100644 sources/tech/20150520 How to Use tmpfs on RHEL or CentOS 7.0.md create mode 100644 sources/tech/20150520 How to compile and install wxWidgets on Ubuntu or Debian or Linux Mint.md create mode 100644 sources/tech/20150520 Shell Script to Backup Files or Directories Using rsync.md diff --git a/sources/talk/20150520 Is Linux Better than OS X GNU Open Source and Apple in History.md b/sources/talk/20150520 Is Linux Better than OS X GNU Open Source and Apple in History.md new file mode 100644 index 0000000000..4a602997ad --- /dev/null +++ b/sources/talk/20150520 Is Linux Better than OS X GNU Open Source and Apple in History.md @@ -0,0 +1,57 @@ +Is Linux Better than OS X? GNU, Open Source and Apple in History +================================================================================ +> Tensions between the free software/open source community and Apple date back to the 1980s, Linux's founder called the core of Mac OS X "a piece of crap" and other anecdotes from software history. + +![](http://thevarguy.com/site-files/thevarguy.com/files/imagecache/medium_img/uploads/2015/05/untitled_2.png) + +Open source fans have long had a rocky relationship with Microsoft. Everyone knows that. But, in many ways, the tension between Apple and supporters of free or open source software is even starker—even if it receives much less attention in the press. + +To be sure, not all open source advocates have an aversion to Apple. Anecdotally, I've seen plenty of Linux hackers sporting iPhones and iPads. In fact, some Linux users like Apple's OS X so much that they've [created a number of Linux distributions][1] designed to look just like it. (So has the [North Korean government][2], incidentally.) + +But relations between the Cult of Mac and the Cult of Tux—that is, the Linux community (not to mention the other, smaller segments of the free and open source software world)—have not always been completely peaceable. And that's by no means a new phenomenon, as I'm discovering as I research the history of Linux and the Free Software Foundation. + +### GNU vs. Apple ### + +The ill will dates to at least the late 1980s. By June 1988, [GNU][3], the project launched by Richard Stallman to build a completely free Unix-like operating system whose source code would be freely shared, was [strongly criticizing][4] Apple's lawsuit against [Hewlett-Packard][5] (HPQ) and [Microsoft][6] (MSFT) over what Apple claimed was improper copying of the "look and feel" of the Macintosh operating system. If Apple prevailed, GNU warned, the company "will use this new power over the public to put an end to free software that could substitute for commercial software." + +At the time, GNU fought against the lawsuit (which meant, ironically, that GNU was supporting Microsoft, though those were different times) by distributing "[Keep Your Lawyers Off My Computer" buttons][7]. It also urged GNU supporters to boycott Apple, warning that, even if Macintoshes seemed like good computers, Apple's success in the lawsuit could provide the company with a monopoly in the market that would greatly increase the price of computers. + +Apple eventually [lost the lawsuit][8], but not until 1994, after which GNU [dropped its Apple boycott][9]. In the interim, GNU remained critical of the company. In the early 1990s, even after it began promoting GNU software programs for use on other personal computing platforms, including MS-DOS PCs, [GNU affirmed][10] that, until Apple ceased pursuing a "monopoly" over computers with user interfaces similar to those of the Macintosh, "we will not provide any support for Apple machines." (It's therefore ironic that a fair amount of the software that made it into OS X, the Unix-like operating system that Apple introduced later in the 1990s, came from GNU. But that's another story.) + +### Torvalds on Jobs ### + +Despite his more laissez-faire attitude toward most issues, Linus Torvalds, the creator of the Linux kernel, was no less charitable in his attitudes toward Apple than Stallman and GNU had been. In his 2001 book "Just for Fun: The Story of an Accidental Revolutionary," Torvalds described meeting with Steve Jobs circa 1997, at the latter's invitation, to discuss Mac OS X, which Apple was then developing but had not yet released publicly. + +"Basically, Jobs started off by trying to tell me that on the desktop there were just two players, Microsoft and Apple, and that he thought that the best thing I could do for Linux was to get in bed with Apple and try to get the open source people behind Mac OS X," Torvalds wrote. + +This courting apparently turned Torvalds off quite a bit. One point of disagreement centered on Torvalds's technical disdain for Mach, the kernel on which Apple was then building its new OS X operating system, which Torvalds called "a piece of crap. It contains all the design mistakes you can make, and managed to even make up a few of its own." + +But more off-putting, apparently, was the way Jobs was approaching open source in developing OS X (which had many open source programs at its core): "He sort of played down the flaw in the setup: Who cares if the basic operating system, the real low-core stuff, is open source if you then have the Mac layer on top, which is not open source?" + +All in all, Torvalds concluded, Jobs "didn't use very many arguments. He just basically took it for granted that I would be interested" in collaborating with Apple. "He was clueless, unable to imagine that there could be entire segments of the human race who weren't the least bit concerned about increasing the Mac's market share. I think he was truly surprised at how little I cared about how big a market the Mac had—or how big a market Microsoft has." + +Torvalds doesn't speak for all Linux users, of course. And his views on OS X and Apple may have softened since 2001. But the fact that, in the early 2000s, the Linux community's leading figure exhibited so much disdain for Apple and the hubris of its chief says something significant about how deeply seated tensions between the Apple world and the open source/free software world are. + +Both of these historical tidbits offer insight into the great debate regarding the actual value of Apple's products—whether the company thrives on the quality of the hardware and software it creates, or merely benefits from exceptional marketing acumen that allows it to sell products for much more than their non-Apple functional equivalents are worth. But I'll stay out of that debate, for now. + +-------------------------------------------------------------------------------- + +via: http://thevarguy.com/open-source-application-software-companies/051815/linux-better-os-x-gnu-open-source-and-apple- + +作者:[Christopher Tozzi][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://thevarguy.com/author/christopher-tozzi +[1]:https://www.linux.com/news/software/applications/773516-the-mac-ifying-of-the-linux-desktop/ +[2]:http://thevarguy.com/open-source-application-software-companies/010615/north-koreas-red-star-linux-os-made-apples-image +[3]:http://gnu.org/ +[4]:https://www.gnu.org/bulletins/bull5.html +[5]:http://www.hp.com/ +[6]:http://www.microsoft.com/ +[7]:http://www.duntemann.com/AppleSnakeButton.jpg +[8]:http://www.freibrun.com/articles/articl12.htm +[9]:https://www.gnu.org/bulletins/bull18.html#SEC6 +[10]:https://www.gnu.org/bulletins/bull12.html \ No newline at end of file diff --git a/sources/tech/20150520 How to Use Docker Machine with a Cloud Provider.md b/sources/tech/20150520 How to Use Docker Machine with a Cloud Provider.md new file mode 100644 index 0000000000..8ccc8c8c94 --- /dev/null +++ b/sources/tech/20150520 How to Use Docker Machine with a Cloud Provider.md @@ -0,0 +1,147 @@ +How to Use Docker Machine with a Cloud Provider +================================================================================ +Hi everyone, today we'll learn how we can use Docker Machine to deploy Docker host in various Cloud Provider Platforms. Docker Machine is an application that helps to create Docker hosts on our computer, on cloud providers and inside our own data center. It provides easy solution for creating servers, installing Docker on them and then configuring the Docker client according the users configuration and requirements. The driver APIs works for provisioning Docker on a local machine, on a virtual machine in the data center, or on a public cloud instance. Docker Machine is supported on Windows, OSX, and Linux and is available for installation as one standalone binary. It enables us to take full advantage of ecosystem partners providing Docker-ready infrastructure, while still accessing everything through the same interface. It makes people able to deploy the docker containers in the respective cloud platform pretty fast and in pretty easy way with just a single command. + +### 1. Installing Docker Machine ### + +Docker Machine supports awesome on every Linux Operating System. First of all, we'll need to download the latest version of Docker Machine from the Github site . Here, we'll use curl to download the latest version of Docker Machine ie 0.2.0 . + +For 64 Bit Operating System + + # curl -L https://github.com/docker/machine/releases/download/v0.2.0/docker-machine_linux-amd64 > /usr/local/bin/docker-machine + +For 32 Bit Operating System + + # curl -L https://github.com/docker/machine/releases/download/v0.2.0/docker-machine_linux-i386 > /usr/local/bin/docker-machine + +After downloading the latest release of Docker Machine, we'll make the file named docker-machine under /usr/local/bin/ executable using the command below. + + # chmod +x /usr/local/bin/docker-machine + +After doing the above, we'll wanna ensure that we have successfully installed docker-machine. To check it, we can run the docker-machine -v which will give output of the version of docker-machine installed in our system. + + # docker-machine -v + +![Installing Docker Machine](http://blog.linoxide.com/wp-content/uploads/2015/05/installing-docker-machine.png) + +To enable Docker commands on our machines, make sure to install the Docker client as well by running the command below. + + # curl -L https://get.docker.com/builds/linux/x86_64/docker-latest > /usr/local/bin/docker + # chmod +x /usr/local/bin/docker + +### 2. Creating Machine ### + +After finish installing Docker Machine in our Linux box, we'll wanna deploy a docker host into the cloud server. Docker Machine includes drivers for several popular Cloud Platforms such as Digital Ocean, Amazon Web Services (AWS), Microsoft Azure, Google Cloud Computing and many other which enables us to create same interface of docker deployment in different platforms. So, here in this tutorial we'll gonna deploy the Docker Host into the Digital Ocean server using digitalocean driver API. Here, we'll need to run command docker-machine create followed by --driver flag as digitalocean with --digitalocean-access-token flag as the API Token provided by the [Digital Ocean Control Panel][1] and at last the name of the docker host we just created. To do so, we'll need to run the following command as. + + # docker-machine create --driver digitalocean --digitalocean-access-token linux-dev + + # eval "$(docker-machine env linux-dev)" + +![Docker Machine Digitalocean Cloud](http://blog.linoxide.com/wp-content/uploads/2015/05/docker-machine-digitalocean-cloud.png) + +**Note**: Here, linux-dev is the name of the machine we are wanting to create. is a security key which can be generated from the Digital Ocean Control Panel of the account holder of Digital Ocean Cloud Platform. To retrieve that key, we simply need to login to our Digital Ocean Control Panel then click on API, then click on Generate New Token and give it a name tick on both Read and Write. Then we'll get a long hex key, thats the now, simply replace it into the command above. + +After running the above command, we can see in our Digital Ocean Droplet Panel that a droplet has been created with default configuration. + +![DigitalOcean Droplet Panel](http://blog.linoxide.com/wp-content/uploads/2015/05/digitalocean-droplet-panel.png) + +For ease and convenience, docker-machine deploys the droplet with default configuration choosing setting such as images that the VPS is based on we can override the default configuration as our need. We can do that by simply adding the flags respective to our need and requirement of the Droplet. Here are some flags for digitalocean that we can add to override the default configuration of the Docker Machine. + + --digitalocean-image "ubuntu-14-04-x64" for Choosing Droplet Image + --digitalocean-ipv6 enable to enable IPv6 Networking + --digitalocean-private-networking enable to enable Private Networking + --digitalocean-region "nyc3" to choose Region to deploy the Droplet + --digitalocean-size "512mb" to select the RAM size and type of deployment. + +If you are wanting to use docker-machine with other cloud providers and need to override the default configuration, we can run following command to get the list of flags for every platforms supported by Docker Machine by default. + + # docker-machine create -h + +### 3. Selecting Active Host ### + +After deploying the droplet, we wanna run a docker container straight away but before that, we'll need to check whether the active host is the required machine or not. To see that, we can run the following command. + + # docker-machine ls + +![Docker Machine List](http://blog.linoxide.com/wp-content/uploads/2015/05/docker-machine-ls.png) + +The active host can be identified by "*" in the ACTIVE column. + +Now, if we need to switch the active host to the required machine, we can simply run the following command. + + # docker-machine active linux-dev + +**Note**: Here, linux-dev is the Machine name that we are wanting to make as ACTIVE and run Docker Container on top of it. + +### 4. Running a Docker Container ### + +Now, after selecting our active host, we'll wanna finally run a docker container out of the box. Now, to give it a test, we'll run a busybox container out of it by running docker run busybox command with echo hello world so that we can get the output of the container. + + # docker run busybox echo hello world + +Note: If you are trying to deploy a docker container using a 32 Bit Operating System running in the host, its good idea to use SSH to run the docker commands. So, you can simply skip this step and follow the SSH step. + +### 5. SSH with Docker Machine ### + +If we want to control over the machine or the droplet that we just deployed with Docker Machine, we can ssh into the server using docker-machine ssh as command. + + # docker-machine ssh + +![Docker Machine SSH](http://blog.linoxide.com/wp-content/uploads/2015/05/docker-machine-ssh.png) + +Now, after ssh into the machine, we can run any docker containers into it. Here we'll run an nginx server into it. + + # docker run -itd -p 80:80 nginx + +After finishing up with SSH, we need to run exit to exit from the droplet or server. + + # exit + +### 5. Removing Hosts ### + +In order to remove the active host and all its images, containers, we can use docker-machine rm command as shown below. + + # docker-machine rm linux-dev + +![Docker Machine Remove All](http://blog.linoxide.com/wp-content/uploads/2015/05/docker-machine-remove-machine.png) + +To check whether the host has been removed or not, we can run docker-machine ls command. + + # docker-machine ls + +![Docker Machine Remove Check](http://blog.linoxide.com/wp-content/uploads/2015/05/docker-machine-remove-check.png) + +### 6. Adding a host without a driver ### + +We can add a host to Docker which only has a URL and no driver. It can be used an alias for an existing host, so we don’t have to type out the URL every time we run a Docker command. + + $ docker-machine create --url=tcp://104.131.50.36:2376 custombox + +### 7. Managing the Hosts ### + +If you are finished working with the running docker, we can simply run **docker-machine stop** command to stop the whole hosts which are Active and if wanna start again, we can run **docker-machine start**. + + # docker-machine stop + # docker-machine start + +You can also specify a machine name to stop or start using the host name as an argument. + + $ docker-machine stop linux-dev + $ docker-machine start linux-dev + +### Conclusion ### + +Docker Machine is really and awesome tool for deploying servers with Docker Container running. In this article we demostrated with Digital Ocean Platform but there are other platforms also available like Amazon Web Service, Google Cloud Computing and more which is supported by Docker Machine and includes driver APIs of them. It has made easy for fast and secure deployment of Docker Containers into several different Platforms with Docker Machine. As Docker Machine is still under Beta, so it is recommended not to use docker-machine in production. If you have any questions, suggestions, feedback please write them in the comment box below so that we can improve or update our contents. Thank you ! Enjoy :-) + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/linux-how-to/use-docker-machine-cloud-provider/ + +作者:[Arun Pyasi][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://linoxide.com/author/arunp/ +[1]:https://cloud.digitalocean.com/settings/applications \ No newline at end of file diff --git a/sources/tech/20150520 How to Use tmpfs on RHEL or CentOS 7.0.md b/sources/tech/20150520 How to Use tmpfs on RHEL or CentOS 7.0.md new file mode 100644 index 0000000000..96dfbe2535 --- /dev/null +++ b/sources/tech/20150520 How to Use tmpfs on RHEL or CentOS 7.0.md @@ -0,0 +1,64 @@ +How to Use tmpfs on RHEL / CentOS 7.0 +================================================================================ +Today we will talk about tmpfs CentOS 7 a file system that will keep all files and folders in the virtual memory of the operating system as opposed to actually writing them to the disk. This means that all the content in tmpfs is temporary in the sense that it’s not permanently written to the disk and in case the tmpfs is unmounted, the system is rebooted or the power is cut all content will be lost. From a technical point of view tmpfs puts everything in the kernel internal cache and then grows or shrinks to accommodate the files it contains ans is able to swap unneeded pages out of swap space. + +By default CentOS uses tmpfs for various things as you can see from the output of the df –h command: + + # df –h + +![df](http://blog.linoxide.com/wp-content/uploads/2015/05/tmpfs1.jpg) + +/dev - directory contains the special device files for all the devices. +/dev/shm – contains shared memory allocation +/run - used for system logs +/sys/fs/cgroup - used for cgroups, a kernel feature to limit, police and account the resource usage of certain processes + +One use of tmpfs is to obviously use it as a /tmp folder, you can do this in 2 ways: + +### Using systemctl to enable tmpfs in /tmp ### + +You can use the systemctl command to enable tmpfs in the /tmp folder, first use the following command to check if this feature is not already enabled: + + # systemctl is-enabled tmp.mount + +Will show the current status of settings you can use the following command to enable it: + + # systemctl enable tmp.mount + +![systemctl](http://blog.linoxide.com/wp-content/uploads/2015/05/tmpfs3.jpg) + +This will have the system controlling the /tmp folder and mount a tmpfs in it. + +### Manually mounting a /tmp/fs ### + +You can also manually add a tmpfs in /tmp by adding the following line to /etc/fstab: + + tmpfs /tmp tmpfs size=512m 0 0 + +And then running the mount command like this: + + # mount –a + +![df](http://blog.linoxide.com/wp-content/uploads/2015/05/tmpfs2.jpg) + +This should make the tmpfs show in df –h, also it will automatically mount it the next time you reboot. + +### Creating a tmpfs on the fly ### + +If for some reason you wish to create a tmpfs in a folder on the fly you can always use the following command: + + # mount -t tmpfs -o size=1G tmpfs /mnt/mytmpfs + +Of course you can specify any size you wish in the size option and any mount point you wish, just remember it must be a valid directory. + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/file-system/use-tmpfs-rhel-centos-7-0/ + +作者:[Adrian Dinu][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://linoxide.com/author/adriand/ \ No newline at end of file diff --git a/sources/tech/20150520 How to compile and install wxWidgets on Ubuntu or Debian or Linux Mint.md b/sources/tech/20150520 How to compile and install wxWidgets on Ubuntu or Debian or Linux Mint.md new file mode 100644 index 0000000000..04014c599e --- /dev/null +++ b/sources/tech/20150520 How to compile and install wxWidgets on Ubuntu or Debian or Linux Mint.md @@ -0,0 +1,167 @@ +How to compile and install wxWidgets on Ubuntu/Debian/Linux Mint +================================================================================ +### wxWidgets ### + +wxWidgets is an application development framework/library that allows developer to make cross platform GUI applications for Windows, Mac and Linux using the same codebase. + +Its primarily written in C++ but has bindings for other languages as well like Python, Perl and Ruby. + +In this tutorial I am going to show you how to compile and build wxwidgets 3.0+ on Debian based linux systems like Ubuntu and Linux Mint. + +Compiling wxWidgets from source is not at all difficult as it might sound and takes only a few minutes to do. + +The library can be compiled in different modes like static library or dynamic library. + +### 1. Download wxWidgets ### + +The first step would be to download the wxWidgets source files from [wxwidgets.org][1] + +Once done, extract the files to a directory. + +### 2. Setup build environment ### + +To compile wxwidgets we would need some utility programs including the C++ compiler on Linux called g++. And all of it would be installed from the repositories using apt-get. + +We also need the GTK development libraries which wxWidgets depend on. + + $ sudo apt-get install libgtk-3-dev build-essential checkinstall + +> The utility called checkinstall would allow us to create an installation package for wxwidgets, so that later on it can un-installed easily using package managers + +### 3. Compile wxWidgets ### + +Get inside the directory where wxWidgets is extracted. In order to keep things clean, create a directory where the compilation would be done. + + $ mkdir gtk-build + $ cd gtk-build/ + +Now run the configure and make commands one by one. Each one would take some time to finish. + + $ ../configure --disable-shared --enable-unicode + $ make + +The "--disable-shared" option instructs wxwidgets to builds static libraries instead of shared/dynamic ones. + +After the make command finishes, the compilation is done successfully. Its time to install the wxWidgets files to the correct location. + +More information about compile options can be found in install.txt and readme.txt files that can be found in /docs/gtk/ inside the wxwidgets directory. + +### 4. Install with checkinstall ### + +Now instead of using the "make install" command, we shall use the checkinstall command to create a deb package for wxwidgets. Run the following command + + $ sudo checkinstall + +Checkinstall would ask few questions during the process and make sure to provide a version number when asked, otherwise it would fail. + +Once the process is over, wxWidgets would be installed and also a deb file would be created in the same directory. + +### 5. Track the installed files ### + +If you wish to check where the files are installed, use the dpkg command followed by the name of the package provided during the checkinstall process. + + $ dpkg -L package_name + /. + /usr + /usr/local + /usr/local/lib + /usr/local/lib/libwx_baseu-3.0.a + /usr/local/lib/libwx_gtk3u_propgrid-3.0.a + /usr/local/lib/libwx_gtk3u_html-3.0.a + /usr/local/lib/libwxscintilla-3.0.a + /usr/local/lib/libwx_gtk3u_ribbon-3.0.a + /usr/local/lib/libwx_gtk3u_stc-3.0.a + /usr/local/lib/libwx_gtk3u_qa-3.0.a + /usr/local/lib/libwx_baseu_net-3.0.a + /usr/local/lib/libwxtiff-3.0.a + +### 6. Compile the samples ### + +After compiling wxWidgets, its time to compile the sample programs to see it in action. In the same directory where we compiled wxwidgets, a new subdirectory called samples would have been created. + +Just enter it and run the make command + + $ compile samples + $ cd samples/ + $ make + +After the make process finishes, get inside each sample sub directory and there should be an executable file that can be run right away to see the demo. + +### 7. Compile your first program ### + +After you are done with the demo programs, its time to write your own program and compile it. Again it is quite easy. + +It is assumed that you are coding in C++ and for that you can use any good editor with syntax highlighting feature. For example gedit, kate, kwrite would do. Or you might want to try fully loaded IDEs like Geany, Codelite, Codeblocks etc. + +However for your first program just use an ordinary text editor get it done quick. + +Here it is + + #include + + class Simple : public wxFrame + { + public: + Simple(const wxString& title) + : wxFrame(NULL, wxID_ANY, title, wxDefaultPosition, wxSize(250, 150)) + { + Centre(); + } + }; + + class MyApp : public wxApp + { + public: + bool OnInit() + { + Simple *simple = new Simple(wxT("Simple")); + simple->Show(true); + return true; + } + }; + + wxIMPLEMENT_APP(MyApp); + +Now save the program somewhere and compile it with the following commands + + # compile + $ g++ basic.cpp `wx-config --cxxflags --libs std` -o program + + # run + $ ./program + +#### Compiling with non standard libraries #### + +The wx-config command shown above provides only the standard libraries by default. If you are using the Aui classes for example, then you need to specify additional libraries for it + + $ g++ code.cpp `wx-config --cxxflags --libs std,aui` -o program + +More information can be found [here][2]. + +### Resources ### + +Download source and help files for wxWidgets +[https://www.wxwidgets.org/downloads/][3] + +wxWidgets wiki page on compile instructions +[https://wiki.wxwidgets.org/Compiling_and_getting_started][4] + +Notes on how to use the latest wxWidgets version (3.0+) +[https://wiki.wxwidgets.org/Updating_to_the_Latest_Version_of_wxWidgets][5] + +-------------------------------------------------------------------------------- + +via: http://www.binarytides.com/install-wxwidgets-ubuntu/ + +作者:[Silver Moon][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://plus.google.com/117145272367995638274/posts +[1]:https://www.wxwidgets.org/downloads/ +[2]:https://wiki.wxwidgets.org/Updating_to_the_Latest_Version_of_wxWidgets#The_wx-config_script +[3]:https://www.wxwidgets.org/downloads/ +[4]:https://wiki.wxwidgets.org/Compiling_and_getting_started +[5]:https://wiki.wxwidgets.org/Updating_to_the_Latest_Version_of_wxWidgets \ No newline at end of file diff --git a/sources/tech/20150520 Shell Script to Backup Files or Directories Using rsync.md b/sources/tech/20150520 Shell Script to Backup Files or Directories Using rsync.md new file mode 100644 index 0000000000..b6a2ffaf4f --- /dev/null +++ b/sources/tech/20150520 Shell Script to Backup Files or Directories Using rsync.md @@ -0,0 +1,170 @@ +Shell Script to Backup Files / Directories Using rsync +================================================================================ +This article we bring shell scripts to backup your files / directories from you local linux machine to a remote linux server using rsync command. This would be an interactive way to perform backup , where you need to provide remote backup server hostname / ip address and folder location. We keep a separate file where you need to provide files / directories that need backup. We have added two scripts where **first script** ask password after each file had been copied (if you have enabled ssh authentication keys , then password will be not be asked) and in second script password will be prompted only once. + +We are going to backup bckup.txt, dataconfig.txt, docs and oracledb. + + [root@Fedora21 tmp]# ls -l + total 12 + -rw-r--r--. 1 root root 0 May 15 10:43 bckrsync.sh + -rw-r--r--. 1 root root 0 May 15 10:44 bckup.txt + -rw-r--r--. 1 root root 0 May 15 10:46 dataconfig.txt + drwxr-xr-x. 2 root root 4096 May 15 10:45 docs + drwxr-xr-x. 2 root root 4096 May 15 10:44 oracledb + +This file contains backup files / dir details + + [root@Fedora21 tmp]# cat /tmp/bckup.txt + /tmp/oracledb + /tmp/dataconfig.txt + /tmp/docs + [root@Fedora21 tmp]# + +### Script 1 : ### + + #!/bin/bash + + #We will save path to backup file in variable + backupf='/tmp/bckup.txt' + + #Next line just prints message + echo "Shell Script Backup Your Files / Directories Using rsync" + + #next line check if entered value is not null, and if null it will reask user to enter Destination Server + while [ x$desthost = "x" ]; do + + #next line prints what userd should enter, and stores entered value to variable with name desthost + read -p "Destination backup Server : " desthost + + #next line finishes while loop + done + + #next line check if entered value is not null, and if null it will reask user to enter Destination Path + while [ x$destpath = "x" ]; do + + #next line prints what userd should enter, and stores entered value to variable with name destpath + read -p "Destination Folder : " destpath + + #next line finishes while loop + done + + #Next line will start reading backup file line by line + for line in `cat $backupf` + + #and on each line will execute next + do + + #print message that file/dir will be copied + echo "Copying $line ... " + #copy via rsync file/dir to destination + + rsync -ar "$line" "$desthost":"$destpath" + + #this line just print done + echo "DONE" + + #end of reading backup file + done + +#### Running the script with output #### + + [root@Fedora21 tmp]# ./bckrsync.sh + Shell Script Backup Your Files / Directories Using rsync + Destination backup Server : 104.*.*.41 + Destination Folder : /tmp + Copying /tmp/oracledb ... + The authenticity of host '104.*.*.41 (104.*.*.41)' can't be established. + ECDSA key fingerprint is 96:11:61:17:7f:fa:...... + Are you sure you want to continue connecting (yes/no)? yes + Warning: Permanently added '104.*.*.41' (ECDSA) to the list of known hosts. + root@104.*.*.41's password: + DONE + Copying /tmp/dataconfig.txt ... + root@104.*.*.41's password: + DONE + Copying /tmp/docs ... + root@104.*.*.41's password: + DONE + [root@Fedora21 tmp]# + +### Script 2 : ### + + #!/bin/bash + + #We will save path to backup file in variable + backupf='/tmp/bckup.txt' + + #Next line just prints message + echo "Shell Script Backup Your Files / Directories Using rsync" + + #next line check if entered value is not null, and if null it will reask user to enter Destination Server + while [ x$desthost = "x" ]; do + + #next line prints what userd should enter, and stores entered value to variable with name desthost + read -p "Destination backup Server : " desthost + + #next line finishes while loop + done + + #next line check if entered value is not null, and if null it will reask user to enter Destination Path + while [ x$destpath = "x" ]; do + + #next line prints what userd should enter, and stores entered value to variable with name destpath + read -p "Destination Folder : " destpath + + #next line finishes while loop + done + + #next line check if entered value is not null, and if null it will reask user to enter password + while [ x$password = "x" ]; do + #next line prints what userd should enter, and stores entered value to variable with name password. #To hide password we are using -s key + read -sp "Password : " password + #next line finishes while loop + done + + #Next line will start reading backup file line by line + for line in `cat $backupf` + + #and on each line will execute next + do + + #print message that file/dir will be copied + echo "Copying $line ... " + #we will use expect tool to enter password inside script + /usr/bin/expect << EOD + #next line set timeout to -1, recommended to use + set timeout -1 + #copy via rsync file/dir to destination, using part of expect — spawn command + + spawn rsync -ar ${line} ${desthost}:${destpath} + #as result of previous command we expect “password” promtp + expect "*?assword:*" + #next command enters password from script + send "${password}\r" + #next command tells that we expect end of file (everything finished on remote server) + expect eof + #end of expect pard + EOD + #this line just print done + echo "DONE" + + #end of reading backup file + done + +#### Screenshot running the second script with output #### + +![rsync script](http://blog.linoxide.com/wp-content/uploads/2015/05/bckuprsync-script.png) + +Hope these scripts help you to take backup !! + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/linux-shell-script/shell-script-backup-files-directories-rsync/ + +作者:[Yevhen Duma][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://linoxide.com/author/yevhend/ \ No newline at end of file From cb93ad626c25aa88c53a326e1471eb5ec2d7e2f8 Mon Sep 17 00:00:00 2001 From: wwy Date: Thu, 21 May 2015 08:24:52 +0800 Subject: [PATCH 105/965] [Translating] How to share a directory with Samba on Fedora or CentOS --- ...How to share a directory with Samba on Fedora or CentOS.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150318 How to share a directory with Samba on Fedora or CentOS.md b/sources/tech/20150318 How to share a directory with Samba on Fedora or CentOS.md index 0c01862bff..1013b58759 100644 --- a/sources/tech/20150318 How to share a directory with Samba on Fedora or CentOS.md +++ b/sources/tech/20150318 How to share a directory with Samba on Fedora or CentOS.md @@ -1,3 +1,5 @@ +translating by wwy-hust + How to share a directory with Samba on Fedora or CentOS ================================================================================ Nowadays sharing data across different computers is not something new at home or many work places. Riding on this trend, modern operating systems make it easy to share and exchange data transparently across computers via network file systems. If your work environment involves a mix of Microsoft Windows and Linux computers, one way to share files and folders among them is via SMB/CIFS, a cross-platform network file sharing protocol. Windows Microsoft natively supports SMB/CIFS, while Linux offers free software implementation of SMB/CIFS network protocol in Samba. @@ -141,4 +143,4 @@ via: http://xmodulo.com/share-directory-samba-fedora-centos.html 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 -[a]:http://xmodulo.com/author/kristophorus \ No newline at end of file +[a]:http://xmodulo.com/author/kristophorus From e48a39d33ce2695ee755bae7d435fbc76c8d2416 Mon Sep 17 00:00:00 2001 From: GOLinux Date: Thu, 21 May 2015 08:57:32 +0800 Subject: [PATCH 106/965] [Translated]20150518 Linux FAQs with Answers--What is the Apache error log location on Linux.md --- ... the Apache error log location on Linux.md | 82 ------------------- ... the Apache error log location on Linux.md | 81 ++++++++++++++++++ 2 files changed, 81 insertions(+), 82 deletions(-) delete mode 100644 sources/tech/20150518 Linux FAQs with Answers--What is the Apache error log location on Linux.md create mode 100644 translated/tech/20150518 Linux FAQs with Answers--What is the Apache error log location on Linux.md diff --git a/sources/tech/20150518 Linux FAQs with Answers--What is the Apache error log location on Linux.md b/sources/tech/20150518 Linux FAQs with Answers--What is the Apache error log location on Linux.md deleted file mode 100644 index b25c7fe3c8..0000000000 --- a/sources/tech/20150518 Linux FAQs with Answers--What is the Apache error log location on Linux.md +++ /dev/null @@ -1,82 +0,0 @@ -Translating by GOLinux! -Linux FAQs with Answers--What is the Apache error log location on Linux -================================================================================ -> **Question**: I am trying to troubleshoot Apache web server errors on my Linux system. Where is the Apache error log file located on [insert your Linux distro]? - -Error log and access log files are a useful piece of information for system admins, for example to troubleshoot their web server, [protect][1] it from various malicious activities, or just to run [various][2] [analytics][3] for HTTP server monitoring. Depending on your web server setup, its error/access logs may be found in different places on your system. - -This post may help you **find Apache error log location on Linux**. - -![](https://farm8.staticflickr.com/7664/16958522954_4852ab5ea5_c.jpg) - -### Apache Error Log Location on Debian, Ubuntu or Linux Mint ### - -#### Default Error Log #### - -On Debian-based Linux, the system-wide default location of Apache error log is **/var/log/apache2/error.log**. The default location can be customized by editing Apache configuration file. - -#### Custom Error Log #### - -To find a custom error log location, open /etc/apache2/apache2.conf with a text editor, and look for a line that starts with ErrorLog. This line specifies a custom location of Apache error log file. For example, the unmodified Apache configuration file has the following line: - - ErrorLog ${APACHE_LOG_DIR}/error.log - -In this case, the location is configured using APACHE_LOG_DIR environment variable, which is defined in /etc/apache2/envvars. - - export APACHE_LOG_DIR=/var/log/apache2$SUFFIX - -In reality, ErrorLog may point to any arbitrary path on your Linux system. - -#### Custom Error Log with VirtualHost #### - -If VirtualHost is used in Apache web server, ErrorLog directive can be specified within VirtualHost container, in which case the system-wide error log location described above will be ignored. - -With VirtualHost enabled, each VirtualHost can define its own custom error log location. To find out the error log location of a particular VirtualHost, you can open /etc/apache2/sites-enabled/.conf, and look for ErrorLog directive, which will show a site-specific error log file. - -### Apache Error Log Location on CentOS, Fedora or RHEL ### - -#### Default Error Log #### - -On Red Hat based Linux, a system-wide Apache error log file is by default placed in **/var/log/httpd/error_log**. This default location can be customized by editing Apache configuration file. - -#### Custom Error Log #### - -To find out the custom location of Apache error log, open /etc/httpd/conf/httpd.conf with a text editor, and look for ServerRoot, which shows the top of the Apache server directory tree, under which log files and configurations are located. For example: - - ServerRoot "/etc/httpd" - -Now look for a line that starts with ErrorLog, which indicates where Apache web server is writing its error logs. Note that the specified location is relative to the ServerRoot value. For example: - - ErrorLog "log/error_log" - -Combine the above two directives to obtain the full path of an error log, which is by default /etc/httpd/logs/error_log. This is a symlink to /var/log/httpd/error_log with freshly installed Apache. - -In reality, ErrorLog may point to any arbitrary location on your Linux system. - -#### Custom Error Log with VirtualHost #### - -If you enabled VirtualHost, you can find the error log location of individual VirtualHosts by checking /etc/httpd/conf/httpd.conf (or any file where VirtualHost is defined). Look for ErrorLog inside individual VirtualHost sections. For example, in the following VirtualHost section, an error log is found in /var/www/xmodulo.com/logs/error_log. - - - ServerAdmin webmaster@xmodulo.com - DocumentRoot /var/www/xmodulo.com/public_html - ServerName www.xmodulo.com - ServerAlias xmodulo.com - ErrorLog /var/www/xmodulo.com/logs/error_log - CustomLog /var/www/xmodulo.com/logs/access_log - - --------------------------------------------------------------------------------- - -via: http://ask.xmodulo.com/apache-error-log-location-linux.html - -作者:[Dan Nanni][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://ask.xmodulo.com/author/nanni -[1]:http://xmodulo.com/configure-fail2ban-apache-http-server.html -[2]:http://xmodulo.com/interactive-apache-web-server-log-analyzer-linux.html -[3]:http://xmodulo.com/sql-queries-apache-log-files-linux.html diff --git a/translated/tech/20150518 Linux FAQs with Answers--What is the Apache error log location on Linux.md b/translated/tech/20150518 Linux FAQs with Answers--What is the Apache error log location on Linux.md new file mode 100644 index 0000000000..c43ac481e7 --- /dev/null +++ b/translated/tech/20150518 Linux FAQs with Answers--What is the Apache error log location on Linux.md @@ -0,0 +1,81 @@ +Linux有问必答——Linux上Apache错误日志的位置在哪里? +================================================================================ +> **问题**: 我尝试着解决我 Linux 系统上的 Apache 网络服务器的错误,Apache的错误日志文件放在[你的 Linux 版本]的哪个位置呢? + +错误日志和访问日志文件为系统管理员提供了有用的信息,比如,为网络服务器排障,[保护][1]系统不受各种各样的恶意活动侵犯,或者只是进行[各种各样的][2][分析][3]以监控 HTTP 服务器。根据你网络服务器配置的不同,其错误/访问日志可能放在你系统中不同位置。 + +本文可以帮助你**找到Linux上的Apache错误日志**。 + +![](https://farm8.staticflickr.com/7664/16958522954_4852ab5ea5_c.jpg) + +### Debian,Ubuntu或Linux Mint上的Apache错误日志位置 ### + +#### 默认的错误日志 #### + +在基于Debian的Linux上,系统范围的Apache错误日志默认位置是**/var/log/apache2/error.log**。默认位置可以通过编辑Apache的配置文件进行修改。 + +#### 自定义的错误日志 #### + +要找到自定义的错误日志位置,请用文本编辑器打开 /etc/apache2/apache2.conf,然后查找以 ErrorLog 开头的行,该行指定了自定义的 Apache 错误日志文件的位置。例如,在未经修改的 Apache 配置文件中可以找到以下行: + + ErrorLog ${APACHE_LOG_DIR}/error.log + +在本例中,该位置使用 APACHE_LOG_DIR 环境变量进行配置,该变量在 /etc/apache2/envvars 中已被定义。 + + export APACHE_LOG_DIR=/var/log/apache2$SUFFIX + +在实际情况中, ErrorLog 可能会指向你 Linux 系统中任意路径。 + +#### 使用虚拟主机自定义的错误日志 #### + +如果在 Apache 网络服务器中使用了虚拟主机, ErrorLog 指令可能会在虚拟主机容器内指定,在这种情况下,上面所说的系统范围的错误日志位置将被忽略。 + +启用了虚拟主机后,各个虚拟主机可以定义其自身的自定义错误日志位置。要找出某个特定虚拟主机的错误日志位置,你可以打开 /etc/apache2/sites-enabled/.conf,然后查找 ErrorLog 指令,该指令会显示站点指定的错误日志文件。 + +### CentOS,Fedora或RHEL上的Apache错误日志位置 ### + +#### 默认的错误日志 #### + +在基于 Red Hat 的Linux中,系统范围的 Apache 错误日志文件默认被放置在**/var/log/httpd/error_log**。该默认位置可以通过修改 Apache 配置文件进行自定义。 + +#### 自定义的错误日志 #### + +要找出 Apache 错误日志的自定义位置,请用文本编辑器打开 /etc/httpd/conf/httpd.conf,然后查找 ServerRoot,该参数显示了 Apache 服务器目录树的顶层,日志文件和配置都位于该目录树中。例如: + + ServerRoot "/etc/httpd" + +现在,查找 ErrorLog 开头的行,该行指出了 Apache 网络服务器将错误日志写到了哪里去。注意,指定的位置是 ServerRoot 值的相对位置。例如: + + ErrorLog "log/error_log" + +结合上面的两个指令,可以获得完整的错误日志路径,默认情况下该路径就是 /etc/httpd/logs/error_log。在全新安装的Apache中,这是一个到 /var/log/httpd/error_log 的符号链接。 + +在实际情况中, ErrorLog 可能指向你 Linux 系统中的任意位置。 + +#### 使用虚拟主机自定义的错误日志 #### + +如果你启用了虚拟主机,你可以通过检查 /etc/httpd/conf/httpd.conf(或其它任何定义了虚拟主机的文件)来找到各个虚拟主机的错误日志位置。在独立的虚拟主机部分查找 ErrorLog。如,在下面的虚拟主机部分,错误日志的位置是 /var/www/xmodulo.com/logs/error_log。 + + + ServerAdmin webmaster@xmodulo.com + DocumentRoot /var/www/xmodulo.com/public_html + ServerName www.xmodulo.com + ServerAlias xmodulo.com + ErrorLog /var/www/xmodulo.com/logs/error_log + CustomLog /var/www/xmodulo.com/logs/access_log + + +-------------------------------------------------------------------------------- + +via: http://ask.xmodulo.com/apache-error-log-location-linux.html + +作者:[Dan Nanni][a] +译者:[GOLinux](https://github.com/GOLinux) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://ask.xmodulo.com/author/nanni +[1]:http://xmodulo.com/configure-fail2ban-apache-http-server.html +[2]:http://xmodulo.com/interactive-apache-web-server-log-analyzer-linux.html +[3]:http://xmodulo.com/sql-queries-apache-log-files-linux.html From 25fabfe33ad1e12f02f85b59164120610fff549a Mon Sep 17 00:00:00 2001 From: joeren Date: Thu, 21 May 2015 09:00:53 +0800 Subject: [PATCH 107/965] Update 20150520 Shell Script to Backup Files or Directories Using rsync.md --- ... Shell Script to Backup Files or Directories Using rsync.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150520 Shell Script to Backup Files or Directories Using rsync.md b/sources/tech/20150520 Shell Script to Backup Files or Directories Using rsync.md index b6a2ffaf4f..1d3a89b84a 100644 --- a/sources/tech/20150520 Shell Script to Backup Files or Directories Using rsync.md +++ b/sources/tech/20150520 Shell Script to Backup Files or Directories Using rsync.md @@ -1,3 +1,4 @@ +Translating by GOLinux! Shell Script to Backup Files / Directories Using rsync ================================================================================ This article we bring shell scripts to backup your files / directories from you local linux machine to a remote linux server using rsync command. This would be an interactive way to perform backup , where you need to provide remote backup server hostname / ip address and folder location. We keep a separate file where you need to provide files / directories that need backup. We have added two scripts where **first script** ask password after each file had been copied (if you have enabled ssh authentication keys , then password will be not be asked) and in second script password will be prompted only once. @@ -167,4 +168,4 @@ via: http://linoxide.com/linux-shell-script/shell-script-backup-files-directorie 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 -[a]:http://linoxide.com/author/yevhend/ \ No newline at end of file +[a]:http://linoxide.com/author/yevhend/ From a948701eabc587a91259798f2c351b66b3c39b29 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 21 May 2015 10:01:42 +0800 Subject: [PATCH 108/965] translating --- .../tech/20150520 How to Use tmpfs on RHEL or CentOS 7.0.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150520 How to Use tmpfs on RHEL or CentOS 7.0.md b/sources/tech/20150520 How to Use tmpfs on RHEL or CentOS 7.0.md index 96dfbe2535..e2d4941e0b 100644 --- a/sources/tech/20150520 How to Use tmpfs on RHEL or CentOS 7.0.md +++ b/sources/tech/20150520 How to Use tmpfs on RHEL or CentOS 7.0.md @@ -1,3 +1,5 @@ +translating----geekpi + How to Use tmpfs on RHEL / CentOS 7.0 ================================================================================ Today we will talk about tmpfs CentOS 7 a file system that will keep all files and folders in the virtual memory of the operating system as opposed to actually writing them to the disk. This means that all the content in tmpfs is temporary in the sense that it’s not permanently written to the disk and in case the tmpfs is unmounted, the system is rebooted or the power is cut all content will be lost. From a technical point of view tmpfs puts everything in the kernel internal cache and then grows or shrinks to accommodate the files it contains ans is able to swap unneeded pages out of swap space. @@ -61,4 +63,4 @@ via: http://linoxide.com/file-system/use-tmpfs-rhel-centos-7-0/ 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 -[a]:http://linoxide.com/author/adriand/ \ No newline at end of file +[a]:http://linoxide.com/author/adriand/ From 18d2d64317b22c99c1bd42bbbaa5e06ab9eddc61 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 21 May 2015 10:02:23 +0800 Subject: [PATCH 109/965] translating --- ...and install wxWidgets on Ubuntu or Debian or Linux Mint.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150520 How to compile and install wxWidgets on Ubuntu or Debian or Linux Mint.md b/sources/tech/20150520 How to compile and install wxWidgets on Ubuntu or Debian or Linux Mint.md index 04014c599e..6719acdbc4 100644 --- a/sources/tech/20150520 How to compile and install wxWidgets on Ubuntu or Debian or Linux Mint.md +++ b/sources/tech/20150520 How to compile and install wxWidgets on Ubuntu or Debian or Linux Mint.md @@ -1,3 +1,5 @@ +translating---geekpi + How to compile and install wxWidgets on Ubuntu/Debian/Linux Mint ================================================================================ ### wxWidgets ### @@ -164,4 +166,4 @@ via: http://www.binarytides.com/install-wxwidgets-ubuntu/ [2]:https://wiki.wxwidgets.org/Updating_to_the_Latest_Version_of_wxWidgets#The_wx-config_script [3]:https://www.wxwidgets.org/downloads/ [4]:https://wiki.wxwidgets.org/Compiling_and_getting_started -[5]:https://wiki.wxwidgets.org/Updating_to_the_Latest_Version_of_wxWidgets \ No newline at end of file +[5]:https://wiki.wxwidgets.org/Updating_to_the_Latest_Version_of_wxWidgets From 71178217f449fcd1d6128265e37278a817148d07 Mon Sep 17 00:00:00 2001 From: GOLinux Date: Thu, 21 May 2015 10:16:17 +0800 Subject: [PATCH 110/965] [Translated]20150520 Shell Script to Backup Files or Directories Using rsync.md --- ...Backup Files or Directories Using rsync.md | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) rename {sources => translated}/tech/20150520 Shell Script to Backup Files or Directories Using rsync.md (83%) diff --git a/sources/tech/20150520 Shell Script to Backup Files or Directories Using rsync.md b/translated/tech/20150520 Shell Script to Backup Files or Directories Using rsync.md similarity index 83% rename from sources/tech/20150520 Shell Script to Backup Files or Directories Using rsync.md rename to translated/tech/20150520 Shell Script to Backup Files or Directories Using rsync.md index 1d3a89b84a..639e58ede9 100644 --- a/sources/tech/20150520 Shell Script to Backup Files or Directories Using rsync.md +++ b/translated/tech/20150520 Shell Script to Backup Files or Directories Using rsync.md @@ -1,9 +1,8 @@ -Translating by GOLinux! -Shell Script to Backup Files / Directories Using rsync +Shell脚本:使用rsync备份文件/目录 ================================================================================ -This article we bring shell scripts to backup your files / directories from you local linux machine to a remote linux server using rsync command. This would be an interactive way to perform backup , where you need to provide remote backup server hostname / ip address and folder location. We keep a separate file where you need to provide files / directories that need backup. We have added two scripts where **first script** ask password after each file had been copied (if you have enabled ssh authentication keys , then password will be not be asked) and in second script password will be prompted only once. +本文,我们带来了shell脚本,用来使用rsync命令将你本地Linux机器上的文件/目录备份到远程Linux服务器上。使用该脚本实施备份会是一个交互的方式,你需要提供远程备份服务器的主机名/ip地址和文件夹位置。我们保留了一个独立文件,在这个文件中你需要提供需要备份的文件/目录。我们添加了两个脚本,**第一个脚本**在每次拷贝完一个文件后询问密码(如果你启用了ssh验证密钥,那么就不会询问密码),而第二个脚本中,则只会提示一次输入密码。 -We are going to backup bckup.txt, dataconfig.txt, docs and oracledb. +我们打算备份bckup.txt,dataconfig.txt,docs和orcledb。 [root@Fedora21 tmp]# ls -l total 12 @@ -13,7 +12,7 @@ We are going to backup bckup.txt, dataconfig.txt, docs and oracledb. drwxr-xr-x. 2 root root 4096 May 15 10:45 docs drwxr-xr-x. 2 root root 4096 May 15 10:44 oracledb -This file contains backup files / dir details +该文件包含了备份文件/目录的详情 [root@Fedora21 tmp]# cat /tmp/bckup.txt /tmp/oracledb @@ -21,7 +20,7 @@ This file contains backup files / dir details /tmp/docs [root@Fedora21 tmp]# -### Script 1 : ### +### 脚本 1: ### #!/bin/bash @@ -67,7 +66,7 @@ This file contains backup files / dir details #end of reading backup file done -#### Running the script with output #### +#### 运行带有输出结果的脚本 #### [root@Fedora21 tmp]# ./bckrsync.sh Shell Script Backup Your Files / Directories Using rsync @@ -88,7 +87,7 @@ This file contains backup files / dir details DONE [root@Fedora21 tmp]# -### Script 2 : ### +### 脚本 2: ### #!/bin/bash @@ -152,18 +151,18 @@ This file contains backup files / dir details #end of reading backup file done -#### Screenshot running the second script with output #### +#### 运行第二个带有输出结果的脚本的屏幕截图 #### ![rsync script](http://blog.linoxide.com/wp-content/uploads/2015/05/bckuprsync-script.png) -Hope these scripts help you to take backup !! +希望这些脚本对你备份会有帮助!! -------------------------------------------------------------------------------- via: http://linoxide.com/linux-shell-script/shell-script-backup-files-directories-rsync/ 作者:[Yevhen Duma][a] -译者:[译者ID](https://github.com/译者ID) +译者:[GOLinux](https://github.com/GOLinux) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 783a57c2e62c50524e93e75a1738200e7289ebe8 Mon Sep 17 00:00:00 2001 From: DeadFire Date: Thu, 21 May 2015 11:43:34 +0800 Subject: [PATCH 111/965] =?UTF-8?q?20150521-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...es The Windows Communication Foundation.md | 26 +++++++ ...u Linux Hit 200 Million Users This Year.md | 38 ++++++++++ ...from the command line on Ubuntu desktop.md | 71 +++++++++++++++++++ ...tall Unity Tweak Tool on Ubuntu desktop.md | 42 +++++++++++ 4 files changed, 177 insertions(+) create mode 100644 sources/news/20150521 Microsoft Open-Sources The Windows Communication Foundation.md create mode 100644 sources/talk/20150521 Will Ubuntu Linux Hit 200 Million Users This Year.md create mode 100644 sources/tech/20150521 Linux FAQs with Answers--How to change system proxy settings from the command line on Ubuntu desktop.md create mode 100644 sources/tech/20150521 Linux FAQs with Answers--How to install Unity Tweak Tool on Ubuntu desktop.md diff --git a/sources/news/20150521 Microsoft Open-Sources The Windows Communication Foundation.md b/sources/news/20150521 Microsoft Open-Sources The Windows Communication Foundation.md new file mode 100644 index 0000000000..37c5f189d2 --- /dev/null +++ b/sources/news/20150521 Microsoft Open-Sources The Windows Communication Foundation.md @@ -0,0 +1,26 @@ +Microsoft Open-Sources The Windows Communication Foundation +================================================================================ +Microsoft has today announced they've open-sourced the important WCF (Windows Communication Foundation) code that now targets .NET Core. + +As described by [MSDN][1], "Windows Communication Foundation (WCF) is a framework for building service-oriented applications. Using WCF, you can send data as asynchronous messages from one service endpoint to another. A service endpoint can be part of a continuously available service hosted by IIS, or it can be a service hosted in an application. An endpoint can be a client of a service that requests data from a service endpoint. The messages can be as simple as a single character or word sent as XML, or as complex as a stream of binary data." + +The [code on GitHub][2], "contains a subset of the full Windows Communication Foundation product available on the Windows desktop, and it supports the library profiles already available for building WCF apps for the Windows Store. These profiles are primarily client-based, making them suited for mobile devices or on mid-tier servers to communicate with existing WCF services." + +More details on Microsoft opening up the Windows Communication Foundation can be found via the announcement posted this morning to the [dotNETFoundation.org blog][3]. + +Windows Communication Foundation sounds a bit like D-Bus on Linux for inter-process communication between programs/services. + +-------------------------------------------------------------------------------- + +via: http://www.phoronix.com/scan.php?page=news_item&px=Microsoft-Open-Source-WCF + +作者:[Michael Larabel][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.michaellarabel.com/ +[1]:https://msdn.microsoft.com/en-us/library/ms731082%28v=vs.110%29.aspx +[2]:https://github.com/dotnet/wcf +[3]:http://www.dotnetfoundation.org/blog/wcf-is-open-source \ No newline at end of file diff --git a/sources/talk/20150521 Will Ubuntu Linux Hit 200 Million Users This Year.md b/sources/talk/20150521 Will Ubuntu Linux Hit 200 Million Users This Year.md new file mode 100644 index 0000000000..2b0318375b --- /dev/null +++ b/sources/talk/20150521 Will Ubuntu Linux Hit 200 Million Users This Year.md @@ -0,0 +1,38 @@ +Will Ubuntu Linux Hit 200 Million Users This Year? +================================================================================ +It's been four years and two weeks since Mark Shuttleworth expressed his goal of "200 million users of Ubuntu in 4 years." While Ubuntu's presence has continued to increase over the past four years, it doesn't look like that goal has been realized yet or will be by the end of the calendar year. + +It was back at [UDS Budapest][1] in May of 2011 when Shuttleworth expressed a goal of 200 million Ubuntu users in four years. + +![](http://www.phoronix.net/image.php?id=uds_budapest&image=budapest_phoronix_03_show&w=1920) + +Last I heard there was "tens of millions" of Ubuntu Linux users, but haven't seen any reliable reports anywhere of the Ubuntu user-base being close to 200 million. The latest monthly statistics from Valve show [the Linux gaming population being below 1%][2] compared to Windows and OS X. Most usage statistics based on web metrics and other data tend to put the total Linux user-base at just a few percent. + +Aside from desktop installations, Ubuntu at least has made substantial inroads with cloud and server deployments over the past four years and have proven to be a contender with Red Hat Enterprise Linux on such fronts. Ubuntu has also proven itself quite well on ARM hardware. When Mark was coming up with his goal in four years, he was probably thinking that Ubuntu Phone/Touch would be much further along than where it is now: just having one device available in the EU and [a second currently in China][3] and [the Ubuntu Touch software stack still maturing][4] with [major work on key apps still needed][5], etc. + +![](http://www.phoronix.net/image.php?id=0x2015&image=shuttleworth_200_million_show&w=1920) + +It's also been three years since the Canonical claim of [Ubuntu would soon ship on 5% of PCs][6]. The 5% claim was for worldwide PC shipments, but even three years later, I have a hard time believing that... At least in the US and Europe I still very rarely see Ubuntu preloads on systems within brick and mortar stores while the major Internet retailers / OEMs still tend to offer Linux on a few select PC models, sans Chrome OS / Android devices. + +Another lofty, unrelated goal that went unreached by the open-source community was [GNOME owning 10% of the global desktop market by 2010][7]. Five years later, there's no indication they're even close to reaching that 10x10 milestone. + +How large do you think the Ubuntu user-base is today? How large do you think the Ubuntu (or Linux) user-base will grow in the years to come? Share with us your thoughts by commenting on this article. + +-------------------------------------------------------------------------------- + +via: http://www.phoronix.com/scan.php?page=news_item&px=2015-200-Million-Goal-Retro + +作者:[Michael Larabel][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.michaellarabel.com/ +[1]:http://www.phoronix.com/vr.php?view=16002 +[2]:http://www.phoronix.com/scan.php?page=news_item&px=Steam-April-2015-1-Drop +[3]:http://www.phoronix.com/scan.php?page=news_item&px=Ubuntu-MX4-In-China +[4]:http://www.phoronix.com/scan.php?page=news_item&px=Ubuntu-Calculator-Reboot +[5]:http://www.phoronix.com/scan.php?page=news_item&px=MTgzOTM +[6]:http://www.phoronix.com/scan.php?page=news_item&px=MTA5ODM +[7]:https://www.phoronix.com/scan.php?page=news_item&px=Nzg1Mw \ No newline at end of file diff --git a/sources/tech/20150521 Linux FAQs with Answers--How to change system proxy settings from the command line on Ubuntu desktop.md b/sources/tech/20150521 Linux FAQs with Answers--How to change system proxy settings from the command line on Ubuntu desktop.md new file mode 100644 index 0000000000..346f9cb438 --- /dev/null +++ b/sources/tech/20150521 Linux FAQs with Answers--How to change system proxy settings from the command line on Ubuntu desktop.md @@ -0,0 +1,71 @@ +Linux FAQs with Answers--How to change system proxy settings from the command line on Ubuntu desktop +================================================================================ +> **Question**: I often need to change system proxy settings on Ubuntu desktop, but I do not want to go through a chain of GUI menus: "System Settings" -> "Network" -> "Network proxy", which is cumbersome. Is there a more convenient way to change desktop's proxy settings from the command line? + +In Ubuntu desktop, its desktop environment settings, including system proxy settings, are stored in DConf database, which is a simple key/value store. If you modify any desktop properties using System Settings menu, the changes are persisted in the DConf database backend. There are GUI-based or non-GUI-based ways to modify DConf database on Ubuntu. While System Settings or dconf-editor are graphical methods for accessing DConf database, gsettings or dconf are command-line tools that can modify the database. + +Here is how to change system proxy settings from the command line using gsettings. + +![](https://farm6.staticflickr.com/5460/17872782271_68e5267a4a_c.jpg) + +The basic usage of gsettings for reading and writing a particular Dconf setting is as follows. + +To modify a DConf setting: + + $ gsettings set + +To read a DConf setting: + + $ gsettings get + +### Change System Proxy Setting to Manual from the Command Line ### + +The following commands will change HTTP proxy setting to "my.proxy.com:8000" on Ubuntu desktop. + + $ gsettings set org.gnome.system.proxy.http host 'my.proxy.com' + $ gsettings set org.gnome.system.proxy.http port 8000 + $ gsettings set org.gnome.system.proxy mode 'manual' + +If you want to change HTTPS/FTP proxy to manual as well, use these commands: + + $ gsettings set org.gnome.system.proxy.https host 'my.proxy.com' + $ gsettings set org.gnome.system.proxy.https port 8000 + $ gsettings set org.gnome.system.proxy.ftp host 'my.proxy.com' + $ gsettings set org.gnome.system.proxy.ftp port 8000 + +To change Socks host settings to manual: + + $ gsettings set org.gnome.system.proxy.socks host 'my.proxy.com' + $ gsettings set org.gnome.system.proxy.socks port 8000 + +All these changes above are limited to the current Desktop user only. If you want to apply the proxy setting changes system-wide, prepend sudo to gsettings command. For example: + + $ sudo gsettings set org.gnome.system.proxy.http host 'my.proxy.com' + $ sudo gsettings set org.gnome.system.proxy.http port 8000 + $ sudo gsettings set org.gnome.system.proxy mode 'manual' + +### Change System Proxy Setting to Automatic from the Command Line ### + +If you are using [proxy auto configuration][1] (PAC), type the following commands to switch to PAC. + + $ gsettings set org.gnome.system.proxy mode 'auto' + $ gsettings set org.gnome.system.proxy autoconfig-url http://my.proxy.com/autoproxy.pac + +### Clear System Proxy Setting from the Command Line ### + +Finally, to remove manual/automatic proxy setting, and revert to no-proxy setting: + + $ gsettings set org.gnome.system.proxy mode 'none' + +-------------------------------------------------------------------------------- + +via: http://ask.xmodulo.com/change-system-proxy-settings-command-line-ubuntu-desktop.html + +作者:[Dan Nanni][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://ask.xmodulo.com/author/nanni +[1]:http://xmodulo.com/how-to-set-up-proxy-auto-config-on-ubuntu-desktop.html \ No newline at end of file diff --git a/sources/tech/20150521 Linux FAQs with Answers--How to install Unity Tweak Tool on Ubuntu desktop.md b/sources/tech/20150521 Linux FAQs with Answers--How to install Unity Tweak Tool on Ubuntu desktop.md new file mode 100644 index 0000000000..8237527afd --- /dev/null +++ b/sources/tech/20150521 Linux FAQs with Answers--How to install Unity Tweak Tool on Ubuntu desktop.md @@ -0,0 +1,42 @@ +Linux FAQs with Answers--How to install Unity Tweak Tool on Ubuntu desktop +================================================================================ +> **Question**: I am trying to customize fresh Ubuntu desktop that I just installed. For that, I want to use Unity Tweak Tool. How can I install Unity Tweak Tool on Ubuntu? + +[Unity Tweak Tool][1] is a popular Unity desktop customization tool. As the name implies, this tool is applicable to Ubuntu's default desktop environment only (i.e., Unity-based GNOME desktop). This versatile tool allows you to customize a wide variety of Unity desktop features and configurations via extremely intuitive and easy-to-use GUI. Its menu looks similar to Ubuntu's official System Settings, but its desktop customization capabilities far exceed those of the default System Settings. Using Unity Tweak Tool, you can customize appearance, behaviors and configurations for a plethora of desktop components, such as workspace, windows, icons, themes, cursors, fonts, scrolling, hot corners, etc. If you are a Unity desktop user, Unity Tweak Tool is definitely a must-have app. + +![](https://farm6.staticflickr.com/5463/17684020389_25dc7f0db2_b.jpg) + +While Unity Tweak Tool is an essential tool for Ubuntu desktop, it does not come pre-installed on stock Ubuntu desktop. For those of you to customize Unity desktop, here is how to install Unity Tweak Tool on Ubuntu desktop. + +### Install Unity Tweak Tool on Ubuntu 13.04 and higher ### + +Starting with Ubuntu 13.04, Unity Tweak Tool is available in the Ubuntu's base repositories. So its installation is as straightforward as: + + $ sudo apt-get install unity-tweak-tool + +To launch Unity Tweak Tool: + + $ unity-tweak-tool + +If you want to try the latest version of Unity Tweak Tool, you can install it from its daily PPA (as describe below). + +### Install Unity Tweak Tool on Ubuntu 12.10 ### + +Note that Unity Tweak Tool works on Ubuntu 12.10 and higher. If you want to install it on Ubuntu 12.10, you can use its PPA repository as follows. This PPA repository is also useful when you want to test the latest developments of the tool. + + $ sudo add-apt-repository ppa:freyja-dev/unity-tweak-tool-daily + $ sudo apt-get update + $ sudo apt-get install unity-tweak-tool + +-------------------------------------------------------------------------------- + +via: http://ask.xmodulo.com/install-unity-tweak-tool-ubuntu-desktop.html + +作者:[Dan Nanni][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://ask.xmodulo.com/author/nanni +[1]:https://launchpad.net/unity-tweak-tool \ No newline at end of file From ba9c32a2239c061c29455b0c525b40238a1809ef Mon Sep 17 00:00:00 2001 From: ictlyh Date: Thu, 21 May 2015 12:05:25 +0800 Subject: [PATCH 112/965] [Translating] 20150521 Linux FAQs with Answers--How to change system proxy settings from the command line on Ubuntu desktoptech/20150521 Linux FAQs with Answers--How to install Unity Tweak Tool on Ubuntu desktop tech/ --- ...tem proxy settings from the command line on Ubuntu desktop.md | 1 + ...Answers--How to install Unity Tweak Tool on Ubuntu desktop.md | 1 + 2 files changed, 2 insertions(+) diff --git a/sources/tech/20150521 Linux FAQs with Answers--How to change system proxy settings from the command line on Ubuntu desktop.md b/sources/tech/20150521 Linux FAQs with Answers--How to change system proxy settings from the command line on Ubuntu desktop.md index 346f9cb438..0c58a8416b 100644 --- a/sources/tech/20150521 Linux FAQs with Answers--How to change system proxy settings from the command line on Ubuntu desktop.md +++ b/sources/tech/20150521 Linux FAQs with Answers--How to change system proxy settings from the command line on Ubuntu desktop.md @@ -1,3 +1,4 @@ +Translating by ictlyh Linux FAQs with Answers--How to change system proxy settings from the command line on Ubuntu desktop ================================================================================ > **Question**: I often need to change system proxy settings on Ubuntu desktop, but I do not want to go through a chain of GUI menus: "System Settings" -> "Network" -> "Network proxy", which is cumbersome. Is there a more convenient way to change desktop's proxy settings from the command line? diff --git a/sources/tech/20150521 Linux FAQs with Answers--How to install Unity Tweak Tool on Ubuntu desktop.md b/sources/tech/20150521 Linux FAQs with Answers--How to install Unity Tweak Tool on Ubuntu desktop.md index 8237527afd..6dd2efa820 100644 --- a/sources/tech/20150521 Linux FAQs with Answers--How to install Unity Tweak Tool on Ubuntu desktop.md +++ b/sources/tech/20150521 Linux FAQs with Answers--How to install Unity Tweak Tool on Ubuntu desktop.md @@ -1,3 +1,4 @@ +Translating by ictlyh Linux FAQs with Answers--How to install Unity Tweak Tool on Ubuntu desktop ================================================================================ > **Question**: I am trying to customize fresh Ubuntu desktop that I just installed. For that, I want to use Unity Tweak Tool. How can I install Unity Tweak Tool on Ubuntu? From 213db38fc7d760bfff27396d93b7febebffdce0e Mon Sep 17 00:00:00 2001 From: ictlyh Date: Thu, 21 May 2015 12:41:47 +0800 Subject: [PATCH 113/965] [Translated] tech/20150521 Linux FAQs with Answers--How to change system proxy settings from the command line on Ubuntu desktop tech/20150521 Linux FAQs with Answers--How to install Unity Tweak Tool on Ubuntu desktop --- ...from the command line on Ubuntu desktop.md | 72 ------------------- ...tall Unity Tweak Tool on Ubuntu desktop.md | 43 ----------- ...from the command line on Ubuntu desktop.md | 71 ++++++++++++++++++ ...tall Unity Tweak Tool on Ubuntu desktop.md | 42 +++++++++++ 4 files changed, 113 insertions(+), 115 deletions(-) delete mode 100644 sources/tech/20150521 Linux FAQs with Answers--How to change system proxy settings from the command line on Ubuntu desktop.md delete mode 100644 sources/tech/20150521 Linux FAQs with Answers--How to install Unity Tweak Tool on Ubuntu desktop.md create mode 100644 translated/tech/20150521 Linux FAQs with Answers--How to change system proxy settings from the command line on Ubuntu desktop.md create mode 100644 translated/tech/20150521 Linux FAQs with Answers--How to install Unity Tweak Tool on Ubuntu desktop.md diff --git a/sources/tech/20150521 Linux FAQs with Answers--How to change system proxy settings from the command line on Ubuntu desktop.md b/sources/tech/20150521 Linux FAQs with Answers--How to change system proxy settings from the command line on Ubuntu desktop.md deleted file mode 100644 index 0c58a8416b..0000000000 --- a/sources/tech/20150521 Linux FAQs with Answers--How to change system proxy settings from the command line on Ubuntu desktop.md +++ /dev/null @@ -1,72 +0,0 @@ -Translating by ictlyh -Linux FAQs with Answers--How to change system proxy settings from the command line on Ubuntu desktop -================================================================================ -> **Question**: I often need to change system proxy settings on Ubuntu desktop, but I do not want to go through a chain of GUI menus: "System Settings" -> "Network" -> "Network proxy", which is cumbersome. Is there a more convenient way to change desktop's proxy settings from the command line? - -In Ubuntu desktop, its desktop environment settings, including system proxy settings, are stored in DConf database, which is a simple key/value store. If you modify any desktop properties using System Settings menu, the changes are persisted in the DConf database backend. There are GUI-based or non-GUI-based ways to modify DConf database on Ubuntu. While System Settings or dconf-editor are graphical methods for accessing DConf database, gsettings or dconf are command-line tools that can modify the database. - -Here is how to change system proxy settings from the command line using gsettings. - -![](https://farm6.staticflickr.com/5460/17872782271_68e5267a4a_c.jpg) - -The basic usage of gsettings for reading and writing a particular Dconf setting is as follows. - -To modify a DConf setting: - - $ gsettings set - -To read a DConf setting: - - $ gsettings get - -### Change System Proxy Setting to Manual from the Command Line ### - -The following commands will change HTTP proxy setting to "my.proxy.com:8000" on Ubuntu desktop. - - $ gsettings set org.gnome.system.proxy.http host 'my.proxy.com' - $ gsettings set org.gnome.system.proxy.http port 8000 - $ gsettings set org.gnome.system.proxy mode 'manual' - -If you want to change HTTPS/FTP proxy to manual as well, use these commands: - - $ gsettings set org.gnome.system.proxy.https host 'my.proxy.com' - $ gsettings set org.gnome.system.proxy.https port 8000 - $ gsettings set org.gnome.system.proxy.ftp host 'my.proxy.com' - $ gsettings set org.gnome.system.proxy.ftp port 8000 - -To change Socks host settings to manual: - - $ gsettings set org.gnome.system.proxy.socks host 'my.proxy.com' - $ gsettings set org.gnome.system.proxy.socks port 8000 - -All these changes above are limited to the current Desktop user only. If you want to apply the proxy setting changes system-wide, prepend sudo to gsettings command. For example: - - $ sudo gsettings set org.gnome.system.proxy.http host 'my.proxy.com' - $ sudo gsettings set org.gnome.system.proxy.http port 8000 - $ sudo gsettings set org.gnome.system.proxy mode 'manual' - -### Change System Proxy Setting to Automatic from the Command Line ### - -If you are using [proxy auto configuration][1] (PAC), type the following commands to switch to PAC. - - $ gsettings set org.gnome.system.proxy mode 'auto' - $ gsettings set org.gnome.system.proxy autoconfig-url http://my.proxy.com/autoproxy.pac - -### Clear System Proxy Setting from the Command Line ### - -Finally, to remove manual/automatic proxy setting, and revert to no-proxy setting: - - $ gsettings set org.gnome.system.proxy mode 'none' - --------------------------------------------------------------------------------- - -via: http://ask.xmodulo.com/change-system-proxy-settings-command-line-ubuntu-desktop.html - -作者:[Dan Nanni][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://ask.xmodulo.com/author/nanni -[1]:http://xmodulo.com/how-to-set-up-proxy-auto-config-on-ubuntu-desktop.html \ No newline at end of file diff --git a/sources/tech/20150521 Linux FAQs with Answers--How to install Unity Tweak Tool on Ubuntu desktop.md b/sources/tech/20150521 Linux FAQs with Answers--How to install Unity Tweak Tool on Ubuntu desktop.md deleted file mode 100644 index 6dd2efa820..0000000000 --- a/sources/tech/20150521 Linux FAQs with Answers--How to install Unity Tweak Tool on Ubuntu desktop.md +++ /dev/null @@ -1,43 +0,0 @@ -Translating by ictlyh -Linux FAQs with Answers--How to install Unity Tweak Tool on Ubuntu desktop -================================================================================ -> **Question**: I am trying to customize fresh Ubuntu desktop that I just installed. For that, I want to use Unity Tweak Tool. How can I install Unity Tweak Tool on Ubuntu? - -[Unity Tweak Tool][1] is a popular Unity desktop customization tool. As the name implies, this tool is applicable to Ubuntu's default desktop environment only (i.e., Unity-based GNOME desktop). This versatile tool allows you to customize a wide variety of Unity desktop features and configurations via extremely intuitive and easy-to-use GUI. Its menu looks similar to Ubuntu's official System Settings, but its desktop customization capabilities far exceed those of the default System Settings. Using Unity Tweak Tool, you can customize appearance, behaviors and configurations for a plethora of desktop components, such as workspace, windows, icons, themes, cursors, fonts, scrolling, hot corners, etc. If you are a Unity desktop user, Unity Tweak Tool is definitely a must-have app. - -![](https://farm6.staticflickr.com/5463/17684020389_25dc7f0db2_b.jpg) - -While Unity Tweak Tool is an essential tool for Ubuntu desktop, it does not come pre-installed on stock Ubuntu desktop. For those of you to customize Unity desktop, here is how to install Unity Tweak Tool on Ubuntu desktop. - -### Install Unity Tweak Tool on Ubuntu 13.04 and higher ### - -Starting with Ubuntu 13.04, Unity Tweak Tool is available in the Ubuntu's base repositories. So its installation is as straightforward as: - - $ sudo apt-get install unity-tweak-tool - -To launch Unity Tweak Tool: - - $ unity-tweak-tool - -If you want to try the latest version of Unity Tweak Tool, you can install it from its daily PPA (as describe below). - -### Install Unity Tweak Tool on Ubuntu 12.10 ### - -Note that Unity Tweak Tool works on Ubuntu 12.10 and higher. If you want to install it on Ubuntu 12.10, you can use its PPA repository as follows. This PPA repository is also useful when you want to test the latest developments of the tool. - - $ sudo add-apt-repository ppa:freyja-dev/unity-tweak-tool-daily - $ sudo apt-get update - $ sudo apt-get install unity-tweak-tool - --------------------------------------------------------------------------------- - -via: http://ask.xmodulo.com/install-unity-tweak-tool-ubuntu-desktop.html - -作者:[Dan Nanni][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://ask.xmodulo.com/author/nanni -[1]:https://launchpad.net/unity-tweak-tool \ No newline at end of file diff --git a/translated/tech/20150521 Linux FAQs with Answers--How to change system proxy settings from the command line on Ubuntu desktop.md b/translated/tech/20150521 Linux FAQs with Answers--How to change system proxy settings from the command line on Ubuntu desktop.md new file mode 100644 index 0000000000..526de3549e --- /dev/null +++ b/translated/tech/20150521 Linux FAQs with Answers--How to change system proxy settings from the command line on Ubuntu desktop.md @@ -0,0 +1,71 @@ +Linux 有问必答--如何在桌面版 Ubuntu 中用命令行更改系统代理设置 +================================================================================ +> **问题**: 我经常需要在桌面版 Ubuntu 中更改系统代理设置,但我不想通过繁琐的 GUI 菜单链:"系统设置" -> "网络" -> "网络代理"。在命令行中有更方便的方法更改桌面版的代理设置吗? + +在桌面版 Ubuntu 中,它的桌面环境设置,包括系统代理设置,都存储在 DConf 数据库,这是简单的键值对存储。如果你想通过系统设置菜单修改桌面属性,更改会持久保存在后端的 DConf 数据库。在 Ubuntu 中更改 DConf 数据库有基于图像用户界面和非图形用户界面的两种方式。系统设置或者 dconf-editor 是访问 DConf 数据库的图形方法,而 gsettings 或 dconf 就是能更改数据库的命令行工具。 + +下面介绍如何用 gsettings 从命令行更改系统代理设置。 + +![](https://farm6.staticflickr.com/5460/17872782271_68e5267a4a_c.jpg) + +gsetting 读写特定 Dconf 设置的基本用法如下: + +更改 DConf 设置: + + $ gsettings set + +读取 DConf 设置: + + $ gsettings get + +### 通过命令行更改系统代理设置为手动 ### + +桌面版 Ubuntu 中下面的命令会更改 HTTP 代理设置为 "my.proxy.com:8000"。 + + $ gsettings set org.gnome.system.proxy.http host 'my.proxy.com' + $ gsettings set org.gnome.system.proxy.http port 8000 + $ gsettings set org.gnome.system.proxy mode 'manual' + +如果你还想更改 HTTPS/FTP 代理为手动,用这些命令: + + $ gsettings set org.gnome.system.proxy.https host 'my.proxy.com' + $ gsettings set org.gnome.system.proxy.https port 8000 + $ gsettings set org.gnome.system.proxy.ftp host 'my.proxy.com' + $ gsettings set org.gnome.system.proxy.ftp port 8000 + +更改套接字主机设置为手动: + + $ gsettings set org.gnome.system.proxy.socks host 'my.proxy.com' + $ gsettings set org.gnome.system.proxy.socks port 8000 + +上面的更改都只适用于当前的桌面用户。如果你想在系统范围内使用代理设置更改,在 gsettings 命令面前添加 sudo。例如: + + $ sudo gsettings set org.gnome.system.proxy.http host 'my.proxy.com' + $ sudo gsettings set org.gnome.system.proxy.http port 8000 + $ sudo gsettings set org.gnome.system.proxy mode 'manual' + +### 在命令行中更改系统代理设置为自动 ### + +如果你正在使用 [自动配置代理][1] (proxy auto configuration,PAC),输入以下命令更改为 PAC。 + + $ gsettings set org.gnome.system.proxy mode 'auto' + $ gsettings set org.gnome.system.proxy autoconfig-url http://my.proxy.com/autoproxy.pac + +### 在命令行中清除系统代理设置 ### + +最后,清除所有 手动/自动 代理设置,还原为无代理设置: + + $ gsettings set org.gnome.system.proxy mode 'none' + +-------------------------------------------------------------------------------- + +via: http://ask.xmodulo.com/change-system-proxy-settings-command-line-ubuntu-desktop.html + +作者:[Dan Nanni][a] +译者:[ictlyh](https://github.com/ictlyh) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://ask.xmodulo.com/author/nanni +[1]:http://xmodulo.com/how-to-set-up-proxy-auto-config-on-ubuntu-desktop.html \ No newline at end of file diff --git a/translated/tech/20150521 Linux FAQs with Answers--How to install Unity Tweak Tool on Ubuntu desktop.md b/translated/tech/20150521 Linux FAQs with Answers--How to install Unity Tweak Tool on Ubuntu desktop.md new file mode 100644 index 0000000000..def6860616 --- /dev/null +++ b/translated/tech/20150521 Linux FAQs with Answers--How to install Unity Tweak Tool on Ubuntu desktop.md @@ -0,0 +1,42 @@ +Linux 有问必答--如何在桌面版 Ubuntu 中安装 Unity Tweak Tool +================================================================================ +> **问题**: 我试着给刚安装的桌面版 Ubuntu 自定制桌面。我想使用 Unity Tweak Tool。我怎样才能在 Ubuntu 上安装 Unity Tweak Tool 呢? + +[Unity Tweak Tool][1] 是个流行的 Unity 桌面自定制工具。顾名思义,该工具只适用于 Ubuntu 的默认桌面环境(例如,基于 Unity 的 GNOME 桌面)。这个多功能的工具允许你通过非常直观和简单易用的图形用户界面自定义多种 Unity 桌面特性。它的菜单看起来类似于 Ubuntu 的官方系统设置,但它的桌面自定制能力远远超过默认的系统设置。通过使用 Unity Tweak Tool,你可以自定制外观、行为以及很多桌面组件的配置,例如工作区、窗口、图标、主题、光标、字体、滑动、热键等等。如果你是 Unity 桌面用户,Unity Tweak Tool 一定是个必不可少的应用程序。 + +![](https://farm6.staticflickr.com/5463/17684020389_25dc7f0db2_b.jpg) + +尽管 Unity Tweak Tool 是桌面版 Ubuntu 的重要工具,并没有在桌面版 Ubuntu 中预安装。为了能自定制 Unity 桌面,下面介绍一下如何在桌面版 Ubuntu 中安装 Unity Tweak Tool。 + +### 在 Ubuntu 13.04 或更高版本中安装 Unity Tweak Tool ### + +从 Ubuntu 13.04 开始, Ubuntu 的基础库中就有 Unity Tweak Tool 了。因此它的安装非常简单: + + $ sudo apt-get install unity-tweak-tool + +启动 Unity Tweak Tool: + + $ unity-tweak-tool + +如果你想使用最新版本的 Unity Tweak Tool,你可以从它的 PPA 中安装(如下所述)。 + +### 在 Ubuntu 12.10 中安装 Unity Tweak Tool ### + +注意,Unity Tweak Tool 要求 Ubuntu 12.10 或更高的版本。如果你想着 Ubuntu 上安装它,你可以安装下面方法使用 PPA。当你想测试最新的开发版的时候这个 PPA 库也非常有用。 + + $ sudo add-apt-repository ppa:freyja-dev/unity-tweak-tool-daily + $ sudo apt-get update + $ sudo apt-get install unity-tweak-tool + +-------------------------------------------------------------------------------- + +via: http://ask.xmodulo.com/install-unity-tweak-tool-ubuntu-desktop.html + +作者:[Dan Nanni][a] +译者:[ictlyh](https://github.com/ictlyh) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://ask.xmodulo.com/author/nanni +[1]:https://launchpad.net/unity-tweak-tool \ No newline at end of file From abf2c18d5546ab9ab1778297f0fcfff837430c4f Mon Sep 17 00:00:00 2001 From: wxy Date: Thu, 21 May 2015 15:20:25 +0800 Subject: [PATCH 114/965] PUB:20150413 [Solved] Ubuntu Does Not Remember Brightness Settings @ZTinoZ --- ...3 [Solved] Ubuntu Does Not Remember Brightness Settings.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20150413 [Solved] Ubuntu Does Not Remember Brightness Settings.md (94%) diff --git a/translated/tech/20150413 [Solved] Ubuntu Does Not Remember Brightness Settings.md b/published/20150413 [Solved] Ubuntu Does Not Remember Brightness Settings.md similarity index 94% rename from translated/tech/20150413 [Solved] Ubuntu Does Not Remember Brightness Settings.md rename to published/20150413 [Solved] Ubuntu Does Not Remember Brightness Settings.md index 5cd7abadaa..d0248ff2c2 100644 --- a/translated/tech/20150413 [Solved] Ubuntu Does Not Remember Brightness Settings.md +++ b/published/20150413 [Solved] Ubuntu Does Not Remember Brightness Settings.md @@ -1,4 +1,4 @@ -[已解决] Ubuntu下不能记住亮度设置问题 +如何解决 Ubuntu 下不能记住亮度设置的问题 ================================================================================ ![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/04/Fix_Ubuntu_Brightness_Issue.jpg) @@ -22,7 +22,7 @@ via: http://itsfoss.com/ubuntu-mint-brightness-settings/ 作者:[Abhishek][a] 译者:[ZTinoZ](https://github.com/ZTinoZ) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 From dbb0833d3bd13649ba2aa6dec69839c42afb7509 Mon Sep 17 00:00:00 2001 From: wxy Date: Thu, 21 May 2015 15:58:19 +0800 Subject: [PATCH 115/965] PUB:20150324 How to Interactively Create a Docker Container @wi-cuckoo --- ...Interactively Create a Docker Container.md | 100 ++++++++++++++++++ ...Interactively Create a Docker Container.md | 99 ----------------- 2 files changed, 100 insertions(+), 99 deletions(-) create mode 100644 published/20150324 How to Interactively Create a Docker Container.md delete mode 100644 translated/tech/20150324 How to Interactively Create a Docker Container.md diff --git a/published/20150324 How to Interactively Create a Docker Container.md b/published/20150324 How to Interactively Create a Docker Container.md new file mode 100644 index 0000000000..8fb5f6fa39 --- /dev/null +++ b/published/20150324 How to Interactively Create a Docker Container.md @@ -0,0 +1,100 @@ +如何交互式地创建一个Docker容器 +=============================================================================== + +大家好,今天我们来学习如何使用一个docker镜像交互式地创建一个Docker容器。当我们从镜像中启动一个Docker进程,Docker就会获取该镜像及其父镜像,并重复这个过程,直到到达基础镜像。然后联合文件系统(UFS)会在其顶层添加一个读写层。读写层被称之为容器,它包含了一些关于父镜像信息及一些其他的信息,如唯一ID,网络配置和资源限制等。容器是有状态的,其状态可以从 **运行态** 切换到 **退出态**。一个处于 **运行态**的容器包含了在CPU上面运行的进程树,于其它在该主机上运行的进程相隔离,而**退出态**是指文件系统的状态,并保留了其退出值。你可以使用它来启动,停止和重启一个容器。 + +Docker技术为IT界带来了巨大的改变,它使得云服务可以用来共享应用和工作流程自动化,使得应用可以用组件快速组合,消除了开发、品质保证、产品环境间的摩擦。在这篇文章中,我们将会建立CentOS环境,然后用Apache网络服务器提供一个网站服务。 + +这是一个快速且容易的教程,讨论我们怎样使用交互的shell,以交互的方式来创建一个容器。 + +### 1. 运行一个Docker实例 ### + +Docker首先会尝试从本地取得并运行所需的镜像,如果在本地主机上没有发现,它就会从[Docker公共注册中心][1]拉取。这里,我们将会拉取镜像并在 Docker 容器中创建一个fedora实例,并连接到它的 tty 上的bash shell。 + + # docker run -i -t fedora bash + +![Downloading Fedora Base Image](http://blog.linoxide.com/wp-content/uploads/2015/03/downloading-fedora-base-image.png) + +### 2.安装Apache网络服务器 ### + +现在,在我们的Fedora基本镜像实例准备好后,我们将会开始交互式地安装Apache网络服务器,而不是为它创建Dockerfile。为了做到这点,我们需要在终端或者shell运行以下命令。 + + # yum update + +![Installing httpd](http://blog.linoxide.com/wp-content/uploads/2015/03/installing-httpd2.png) + + # yum install httpd + +![Installing httpd](http://blog.linoxide.com/wp-content/uploads/2015/03/installing-httpd2.png) + + # exit + +### 3.保存镜像 ### + +现在,我们要去保存在Fedora实例里做的修改。要做到这个,我们首先需要知道实例的容器ID。而为了得到ID,我们又需要运行以下命令(LCTT 译注:在容器外执行该命令)。 + + # docker ps -a + +![Docker Running Container](http://blog.linoxide.com/wp-content/uploads/2015/03/docker-running-container.png) + +然后,我们会保存这些改变为一个新的镜像,请运行以下命令。 + + # docker commit c16378f943fe fedora-httpd + +![committing fedora httpd](http://blog.linoxide.com/wp-content/uploads/2015/03/committing-fedora-httpd.png) + +这里,修改已经通过使用容器ID保存起来了,镜像名字叫fedora-httpd。为了确认新的镜像是否在运行,我们将运行以下命令。 + + # docker images + +![view docker images](http://blog.linoxide.com/wp-content/uploads/2015/03/view-docker-images.png) + +### 4. 添加内容到新的镜像 ### + +我们自己新的Fedora Apache镜像正成功的运行,现在我们想添加一些我们网站的网页内容到Apache网络服务器,使得网站能够开箱即用。为做到这点,我们需要创建一个新的Dockerfile,它会处理从复制网页内容到启用80端口的所有操作。要达到这样的目的,我们需要使用我们最喜欢的文本编辑器创建Dockerfile文件,像下面演示的一样。 + + # nano Dockerfile + +现在,我们需要添加以下的命令行到文件中。 + + FROM fedora-httpd + ADD mysite.tar /tmp/ + RUN mv /tmp/mysite/* /var/www/html + EXPOSE 80 + ENTRYPOINT [ "/usr/sbin/httpd" ] + CMD [ "-D", "FOREGROUND" ] + +![configuring Dockerfile](http://blog.linoxide.com/wp-content/uploads/2015/03/configuring-Dockerfile.png) + +这里,上述的Dockerfile中,放在mysite.tar里的网页内容会自动解压到/tmp/文件夹里。然后,整个站点会被移动到Apache的网页根目录/var/www/html/,命令expose 80会打开80端口,这样网站就能正常访问了。其次,入口点放在了/usr/sbin/https里面,保证Apache服务器能够执行。 + +### 5. 构建并运行一个容器 ### + +现在,我们要用刚刚创建的Dockerfile创建我们的容器,以便将我们的网站添加到上面。为做到这,我们需要运行以下命令。 + + # docker build -rm -t mysite . + +![Building mysite Image](http://blog.linoxide.com/wp-content/uploads/2015/03/building-mysite-image.png) + +建立好我们的新容器后,我们需要要用下面的命令来运行容器。 + + # docker run -d -P mysite + +![Running mysite Container](http://blog.linoxide.com/wp-content/uploads/2015/03/running-mysite-container.png) + +### 总结 ### + +最后,我们已经成功的以交互式的方式建立了一个Docker容器。在本节方法中,我们是直接通过交互的shell命令建立我们的容器和镜像。在建立与配置镜像与容器时,这种方法十分简单且快速。如果你有任何问题,建议和反馈,请在下方的评论框里写下来,以便我们可以提升或者更新我们的文章。谢谢!祝生活快乐 :-) + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/linux-how-to/interactively-create-docker-container/ + +作者:[Arun Pyasi][a] +译者:[wi-cuckoo](https://github.com/wi-cuckoo) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://linoxide.com/author/arunp/ +[1]:https://registry.hub.docker.com/ diff --git a/translated/tech/20150324 How to Interactively Create a Docker Container.md b/translated/tech/20150324 How to Interactively Create a Docker Container.md deleted file mode 100644 index 9661e8d3f2..0000000000 --- a/translated/tech/20150324 How to Interactively Create a Docker Container.md +++ /dev/null @@ -1,99 +0,0 @@ -如何交互式地创建一个Docker容器 -=============================================================================== -大家好,今天我们来学习如何使用一个docker镜像交互式地创建一个Docker容器。一旦我们从镜像中启动一个Docker进程,Docker就会在父镜像与子镜像间来回搬运,重复工作,直到到达子镜像。然后联合文件系统会在顶层添加一个读写层。读写层又叫一个 **Container** 包含一些信息,关于它的父镜像和一些其他的信息,如单独的ID,网络配置和资源限制。容器已经声明,他们可以从 **running** 切换到 **exited** 状态。一个处于 **running** 状态的容器包含了很多分支在CPU上面运行,独立于其他在主机上运行的进程,而主机上 **exited** 是文件系统的状态,它的退出变量值是保留的。你可以使用读写层来启动,停止和重启一个容器。 - -Docker技术为IT界带来了巨大的改变,它使得云服务可以用来共享应用和工作流程自动化,使得应用可以从组件快速组合,消除了开发与品质保证和产品环境间的摩擦。在这篇文章中,我们将会建立CentOS环境,然后维护一个网站,在Apache网络服务器下运行。 - -这是快速且容易的教程,讨论我们怎样使用一个交互的shell,以一个交互的方式来创建一个容器。 - -### 1. 运行一个Docker实例 ### - -Docker一开始尝试从本地取得和运行所需的镜像,如果在本地主机上没有发现,它就会从[Docker公共注册中心][1]拉取。这里,我们将会在一个DOcker容器里取得并创建一个fedora实例,附加一个bash shell到tty - - # docker run -i -t fedora bash - -![Downloading Fedora Base Image](http://blog.linoxide.com/wp-content/uploads/2015/03/downloading-fedora-base-image.png) - -### 2.安装Apache网络服务器 ### - -现在,在我们的Fedora基本镜像准备好后,我们将会开始交互式地安装Apache网络服务器,而不必为它创建Dockerfile。为了做到这点,我们需要在终端或者shell运行以下命令。 - - # yum update - -![Installing httpd](http://blog.linoxide.com/wp-content/uploads/2015/03/installing-httpd2.png) - - # yum install httpd - -![Installing httpd](http://blog.linoxide.com/wp-content/uploads/2015/03/installing-httpd2.png) - - # exit - -### 3.Saving the Image ### - -现在,我们要去保存在Fedora实例里做的修改。要做到这个,我们首先需要知道实例的容器ID。而为了得到ID,我们又需要运行以下命令。 - - # docker ps -a - -![Docker Running Container](http://blog.linoxide.com/wp-content/uploads/2015/03/docker-running-container.png) - -然后,我们会保存这些改变为一个新的镜像,请运行以下命令。 - - # docker commit c16378f943fe fedora-httpd - -![committing fedora httpd](http://blog.linoxide.com/wp-content/uploads/2015/03/committing-fedora-httpd.png) - -这里,修改已经通过使用容器ID保存起来了,镜像名字叫fedora-httpd。为了确认新的镜像时候在运行,我们将运行以下命令 - - # docker images - -![view docker images](http://blog.linoxide.com/wp-content/uploads/2015/03/view-docker-images.png) - -### 4. 添加内容到新的镜像 ### - -我们自己新的Fedora Apache镜像正成功的运行,现在我们想添加一些网页内容到Apache网络服务器,包括我们的网站,使得网站能够脱离盒子正确运行。为做到这点,我们需要创建一个新的Dockerfile,它会处理从复制网页内容到使用80端口的所有操作。而为做到这,我们又需要使用我们最喜欢的文本编辑器创建Dockerfile文件,像下面演示的一样。 - - # nano Dockerfile - -现在,我们需要添加以下的命令行到文件中。 - - FROM fedora-httpd - ADD mysite.tar /tmp/ - RUN mv /tmp/mysite/* /var/www/html - EXPOSE 80 - ENTRYPOINT [ "/usr/sbin/httpd" ] - CMD [ "-D", "FOREGROUND" ] - -![configuring Dockerfile](http://blog.linoxide.com/wp-content/uploads/2015/03/configuring-Dockerfile.png) - -这里,运行Dockerfile,mysite.tar里的网页内容会自动解压到/temp/文件夹里。然后,整个文件会被转移到Apache网页根目录/var/www/html/,命令expose 80会打开80端口,这样网站就能正常访问。其次,入口点放在了/usr/sbin/https里面,保证Apache服务器能够执行。 - -### 5. 建立并运行一个容器 ### - -现在,为了添加我们网站在上面,我们要用刚刚创建的Dockerfile创建我们的容器,为做到这,我们需要运行以下命令。 - - # docker build -rm -t mysite . - -![Building mysite Image](http://blog.linoxide.com/wp-content/uploads/2015/03/building-mysite-image.png) - -我们建立自己的容器后,我们想要用下面的命令来运行容器。 - - # docker run -d -P mysite - -![Running mysite Container](http://blog.linoxide.com/wp-content/uploads/2015/03/running-mysite-container.png) - -### 总结 ### - -最后,我们已经成功的以交互式的方式建立了一个Docker容器。在本节方法中,我们是直接通过交互的shell命令建立我们的容器和镜像。这种方法十分简单且快速,在建立与配置镜像与容器方面。如果你有任何问题,建议和反馈,请在下方的评论框里写下来,以便我们可以提升或者更新我们的文章。谢谢!祝生活快乐 :-) - --------------------------------------------------------------------------------- - -via: http://linoxide.com/linux-how-to/interactively-create-docker-container/ - -作者:[Arun Pyasi][a] -译者:[wi-cuckoo](https://github.com/wi-cuckoo) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://linoxide.com/author/arunp/ -[1]:https://registry.hub.docker.com/ From 0e1c622fbfcb0808c6e8ea766bd042bfdc932b45 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 21 May 2015 21:07:36 +0800 Subject: [PATCH 116/965] translated --- ... How to Use tmpfs on RHEL or CentOS 7.0.md | 66 ------------------- ... How to Use tmpfs on RHEL or CentOS 7.0.md | 64 ++++++++++++++++++ 2 files changed, 64 insertions(+), 66 deletions(-) delete mode 100644 sources/tech/20150520 How to Use tmpfs on RHEL or CentOS 7.0.md create mode 100644 translated/tech/20150520 How to Use tmpfs on RHEL or CentOS 7.0.md diff --git a/sources/tech/20150520 How to Use tmpfs on RHEL or CentOS 7.0.md b/sources/tech/20150520 How to Use tmpfs on RHEL or CentOS 7.0.md deleted file mode 100644 index e2d4941e0b..0000000000 --- a/sources/tech/20150520 How to Use tmpfs on RHEL or CentOS 7.0.md +++ /dev/null @@ -1,66 +0,0 @@ -translating----geekpi - -How to Use tmpfs on RHEL / CentOS 7.0 -================================================================================ -Today we will talk about tmpfs CentOS 7 a file system that will keep all files and folders in the virtual memory of the operating system as opposed to actually writing them to the disk. This means that all the content in tmpfs is temporary in the sense that it’s not permanently written to the disk and in case the tmpfs is unmounted, the system is rebooted or the power is cut all content will be lost. From a technical point of view tmpfs puts everything in the kernel internal cache and then grows or shrinks to accommodate the files it contains ans is able to swap unneeded pages out of swap space. - -By default CentOS uses tmpfs for various things as you can see from the output of the df –h command: - - # df –h - -![df](http://blog.linoxide.com/wp-content/uploads/2015/05/tmpfs1.jpg) - -/dev - directory contains the special device files for all the devices. -/dev/shm – contains shared memory allocation -/run - used for system logs -/sys/fs/cgroup - used for cgroups, a kernel feature to limit, police and account the resource usage of certain processes - -One use of tmpfs is to obviously use it as a /tmp folder, you can do this in 2 ways: - -### Using systemctl to enable tmpfs in /tmp ### - -You can use the systemctl command to enable tmpfs in the /tmp folder, first use the following command to check if this feature is not already enabled: - - # systemctl is-enabled tmp.mount - -Will show the current status of settings you can use the following command to enable it: - - # systemctl enable tmp.mount - -![systemctl](http://blog.linoxide.com/wp-content/uploads/2015/05/tmpfs3.jpg) - -This will have the system controlling the /tmp folder and mount a tmpfs in it. - -### Manually mounting a /tmp/fs ### - -You can also manually add a tmpfs in /tmp by adding the following line to /etc/fstab: - - tmpfs /tmp tmpfs size=512m 0 0 - -And then running the mount command like this: - - # mount –a - -![df](http://blog.linoxide.com/wp-content/uploads/2015/05/tmpfs2.jpg) - -This should make the tmpfs show in df –h, also it will automatically mount it the next time you reboot. - -### Creating a tmpfs on the fly ### - -If for some reason you wish to create a tmpfs in a folder on the fly you can always use the following command: - - # mount -t tmpfs -o size=1G tmpfs /mnt/mytmpfs - -Of course you can specify any size you wish in the size option and any mount point you wish, just remember it must be a valid directory. - --------------------------------------------------------------------------------- - -via: http://linoxide.com/file-system/use-tmpfs-rhel-centos-7-0/ - -作者:[Adrian Dinu][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://linoxide.com/author/adriand/ diff --git a/translated/tech/20150520 How to Use tmpfs on RHEL or CentOS 7.0.md b/translated/tech/20150520 How to Use tmpfs on RHEL or CentOS 7.0.md new file mode 100644 index 0000000000..7f3e37b3fe --- /dev/null +++ b/translated/tech/20150520 How to Use tmpfs on RHEL or CentOS 7.0.md @@ -0,0 +1,64 @@ +如何在RHEL/CentOS 7.0中使用tmpfs +================================================================================ + 7中的tmpfs,这是一个将所有文件和文件夹写到虚拟内存中而不是实际写到磁盘中的虚拟文件系统。这意味中tmpfs中所有的内容都是临时的,在取消挂载、系统重启或者电源切断后内容都将会丢失。技术的角度上来说,tmpfs将搜有的内容放在内核内部缓存中并且会增大或者缩小来容纳文件并可从交换空间中交换处不需要的页。 + +CentOS默认使用tmpfs做的事可用df -h命令的输出来看: + + # df –h + +![df](http://blog.linoxide.com/wp-content/uploads/2015/05/tmpfs1.jpg) + +/dev - 含有针对所有设备的设备文件的目录 +/dev/shm – 包含共享内存分配 +/run - 用于系统日志 +/sys/fs/cgroup - 用于cgrpups, 一个针对特定进程限制、管制和审计资源利用的内核特性 + +/tmp目录, 你可以用下面的两种方法来做到: + +### 使用systemctl来在/tmp中启用tmpfs ### + +你可以使用systemctl命令在tmp目录启用tmpfs, 首先用下面的命令来检查这个特性是否可用: + + # systemctl is-enabled tmp.mount + +这会显示当先的状态,你可以使用下面的命令来启用它: + + # systemctl enable tmp.mount + +![systemctl](http://blog.linoxide.com/wp-content/uploads/2015/05/tmpfs3.jpg) + +这会控制/tmp目录并挂载tmpfs。 + +### 手动挂载/tmp/文件系统 ### + +你可以在/etc/fstab中添加下面这行在/tmp挂载tmpfs。 + + tmpfs /tmp tmpfs size=512m 0 0 + +接着运行这条命令 + + # mount –a + +![df](http://blog.linoxide.com/wp-content/uploads/2015/05/tmpfs2.jpg) + +这应该就会在df -h中显示tmpfs了,同样也会在你下次重启是会自动挂载。 + +### 立即创建tmpfs ### + +如果由于一些原因,你写昂立即创建tmpfs,你可以使用下面的命令: + + # mount -t tmpfs -o size=1G tmpfs /mnt/mytmpfs + +当然你可以在size选项中指定你希望的大小和希望的挂载点,只要记住是有效的目录就行了。 + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/file-system/use-tmpfs-rhel-centos-7-0/ + +作者:[Adrian Dinu][a] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://linoxide.com/author/adriand/ From 4d899b7b3ded97ea97d386e0aff27f72268e74bd Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 21 May 2015 21:51:11 +0800 Subject: [PATCH 117/965] translated --- ...dgets on Ubuntu or Debian or Linux Mint.md | 169 ------------------ ...dgets on Ubuntu or Debian or Linux Mint.md | 167 +++++++++++++++++ 2 files changed, 167 insertions(+), 169 deletions(-) delete mode 100644 sources/tech/20150520 How to compile and install wxWidgets on Ubuntu or Debian or Linux Mint.md create mode 100644 translated/tech/20150520 How to compile and install wxWidgets on Ubuntu or Debian or Linux Mint.md diff --git a/sources/tech/20150520 How to compile and install wxWidgets on Ubuntu or Debian or Linux Mint.md b/sources/tech/20150520 How to compile and install wxWidgets on Ubuntu or Debian or Linux Mint.md deleted file mode 100644 index 6719acdbc4..0000000000 --- a/sources/tech/20150520 How to compile and install wxWidgets on Ubuntu or Debian or Linux Mint.md +++ /dev/null @@ -1,169 +0,0 @@ -translating---geekpi - -How to compile and install wxWidgets on Ubuntu/Debian/Linux Mint -================================================================================ -### wxWidgets ### - -wxWidgets is an application development framework/library that allows developer to make cross platform GUI applications for Windows, Mac and Linux using the same codebase. - -Its primarily written in C++ but has bindings for other languages as well like Python, Perl and Ruby. - -In this tutorial I am going to show you how to compile and build wxwidgets 3.0+ on Debian based linux systems like Ubuntu and Linux Mint. - -Compiling wxWidgets from source is not at all difficult as it might sound and takes only a few minutes to do. - -The library can be compiled in different modes like static library or dynamic library. - -### 1. Download wxWidgets ### - -The first step would be to download the wxWidgets source files from [wxwidgets.org][1] - -Once done, extract the files to a directory. - -### 2. Setup build environment ### - -To compile wxwidgets we would need some utility programs including the C++ compiler on Linux called g++. And all of it would be installed from the repositories using apt-get. - -We also need the GTK development libraries which wxWidgets depend on. - - $ sudo apt-get install libgtk-3-dev build-essential checkinstall - -> The utility called checkinstall would allow us to create an installation package for wxwidgets, so that later on it can un-installed easily using package managers - -### 3. Compile wxWidgets ### - -Get inside the directory where wxWidgets is extracted. In order to keep things clean, create a directory where the compilation would be done. - - $ mkdir gtk-build - $ cd gtk-build/ - -Now run the configure and make commands one by one. Each one would take some time to finish. - - $ ../configure --disable-shared --enable-unicode - $ make - -The "--disable-shared" option instructs wxwidgets to builds static libraries instead of shared/dynamic ones. - -After the make command finishes, the compilation is done successfully. Its time to install the wxWidgets files to the correct location. - -More information about compile options can be found in install.txt and readme.txt files that can be found in /docs/gtk/ inside the wxwidgets directory. - -### 4. Install with checkinstall ### - -Now instead of using the "make install" command, we shall use the checkinstall command to create a deb package for wxwidgets. Run the following command - - $ sudo checkinstall - -Checkinstall would ask few questions during the process and make sure to provide a version number when asked, otherwise it would fail. - -Once the process is over, wxWidgets would be installed and also a deb file would be created in the same directory. - -### 5. Track the installed files ### - -If you wish to check where the files are installed, use the dpkg command followed by the name of the package provided during the checkinstall process. - - $ dpkg -L package_name - /. - /usr - /usr/local - /usr/local/lib - /usr/local/lib/libwx_baseu-3.0.a - /usr/local/lib/libwx_gtk3u_propgrid-3.0.a - /usr/local/lib/libwx_gtk3u_html-3.0.a - /usr/local/lib/libwxscintilla-3.0.a - /usr/local/lib/libwx_gtk3u_ribbon-3.0.a - /usr/local/lib/libwx_gtk3u_stc-3.0.a - /usr/local/lib/libwx_gtk3u_qa-3.0.a - /usr/local/lib/libwx_baseu_net-3.0.a - /usr/local/lib/libwxtiff-3.0.a - -### 6. Compile the samples ### - -After compiling wxWidgets, its time to compile the sample programs to see it in action. In the same directory where we compiled wxwidgets, a new subdirectory called samples would have been created. - -Just enter it and run the make command - - $ compile samples - $ cd samples/ - $ make - -After the make process finishes, get inside each sample sub directory and there should be an executable file that can be run right away to see the demo. - -### 7. Compile your first program ### - -After you are done with the demo programs, its time to write your own program and compile it. Again it is quite easy. - -It is assumed that you are coding in C++ and for that you can use any good editor with syntax highlighting feature. For example gedit, kate, kwrite would do. Or you might want to try fully loaded IDEs like Geany, Codelite, Codeblocks etc. - -However for your first program just use an ordinary text editor get it done quick. - -Here it is - - #include - - class Simple : public wxFrame - { - public: - Simple(const wxString& title) - : wxFrame(NULL, wxID_ANY, title, wxDefaultPosition, wxSize(250, 150)) - { - Centre(); - } - }; - - class MyApp : public wxApp - { - public: - bool OnInit() - { - Simple *simple = new Simple(wxT("Simple")); - simple->Show(true); - return true; - } - }; - - wxIMPLEMENT_APP(MyApp); - -Now save the program somewhere and compile it with the following commands - - # compile - $ g++ basic.cpp `wx-config --cxxflags --libs std` -o program - - # run - $ ./program - -#### Compiling with non standard libraries #### - -The wx-config command shown above provides only the standard libraries by default. If you are using the Aui classes for example, then you need to specify additional libraries for it - - $ g++ code.cpp `wx-config --cxxflags --libs std,aui` -o program - -More information can be found [here][2]. - -### Resources ### - -Download source and help files for wxWidgets -[https://www.wxwidgets.org/downloads/][3] - -wxWidgets wiki page on compile instructions -[https://wiki.wxwidgets.org/Compiling_and_getting_started][4] - -Notes on how to use the latest wxWidgets version (3.0+) -[https://wiki.wxwidgets.org/Updating_to_the_Latest_Version_of_wxWidgets][5] - --------------------------------------------------------------------------------- - -via: http://www.binarytides.com/install-wxwidgets-ubuntu/ - -作者:[Silver Moon][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://plus.google.com/117145272367995638274/posts -[1]:https://www.wxwidgets.org/downloads/ -[2]:https://wiki.wxwidgets.org/Updating_to_the_Latest_Version_of_wxWidgets#The_wx-config_script -[3]:https://www.wxwidgets.org/downloads/ -[4]:https://wiki.wxwidgets.org/Compiling_and_getting_started -[5]:https://wiki.wxwidgets.org/Updating_to_the_Latest_Version_of_wxWidgets diff --git a/translated/tech/20150520 How to compile and install wxWidgets on Ubuntu or Debian or Linux Mint.md b/translated/tech/20150520 How to compile and install wxWidgets on Ubuntu or Debian or Linux Mint.md new file mode 100644 index 0000000000..1f733207f3 --- /dev/null +++ b/translated/tech/20150520 How to compile and install wxWidgets on Ubuntu or Debian or Linux Mint.md @@ -0,0 +1,167 @@ +如何在Ubuntu/Debian/Linux Mint中编译和安装wxWidgets +================================================================================ +### wxWidgets ### + +wxWidgets是一个程序开发框架/库, 允许你在Windows、Mac、Linux中使用相同的代码跨平台开发。 + +它主要用C++写成,但也可以与其他语言绑定比如Python、Perl、Ruby。 + +本教程中我将向你展示如何在基于Debian的linux中如Ubuntu和Linux Mint中编译wxwidgets 3.0+。 + +从源码编译wxWidgets并不困难,仅仅需要几分钟。 + +库可以按不同的方式来编译,比如静态或者动态库。 + +### 1. 下载 wxWidgets ### + +第一步你需要从[wxwidgets.org][1]下载wxWidgets源码文件。 + +做完后,解压到目录。 + +### 2. 设置编译环境 ### + +要编译wxwidgets,我们需要一些工具包括C++编译器, 在Linux上是g++。所有这些可以通过apt-get工具从仓库中安装。 + +我们还需要wxWidgets依赖的GTK开发库。 + + $ sudo apt-get install libgtk-3-dev build-essential checkinstall + +>checkinstall工具允许我们为wxwidgets创建一个安装包,这样之后就可以轻松的使用包管理器来卸载。 + +### 3. 编译 wxWidgets ### + +进入到wxWidgets解压后的目录。为了保持清洁,创建一个编译用的目录。 + + $ mkdir gtk-build + $ cd gtk-build/ + +现在运行configure和make命令。每个将花费一些时间来完成。 + + $ ../configure --disable-shared --enable-unicode + $ make + +"--disable-shared"选项将会编译静态库而不是动态库。 + +make命令完成后,编译也成功了。是时候安装wxWidgets到正确的目录。 + +更多信息请参考install.txt和readme.txt,这可在wxwidgets中的/docs/gtk/目录下找到。 + +### 4. 安装 checkinstall ### + +现在我们不使用"make install"命令,我们使用checkinstall命令来创建一个wxwidgets的deb安装包。运行命令: + + $ sudo checkinstall + +checkinstall会询问几个问题,请保证在提问后提供一个版本号,否则将会失败。 + +完成这一切后,wxWidgets就安装好了,deb文件也会创建在相同的目录下。 + +### 5. 追踪安装的文件 ### + +如果你想要检查文件安装的位置,使用dpkg命令后面跟上checkinstall提供的报名。 + + $ dpkg -L package_name + /. + /usr + /usr/local + /usr/local/lib + /usr/local/lib/libwx_baseu-3.0.a + /usr/local/lib/libwx_gtk3u_propgrid-3.0.a + /usr/local/lib/libwx_gtk3u_html-3.0.a + /usr/local/lib/libwxscintilla-3.0.a + /usr/local/lib/libwx_gtk3u_ribbon-3.0.a + /usr/local/lib/libwx_gtk3u_stc-3.0.a + /usr/local/lib/libwx_gtk3u_qa-3.0.a + /usr/local/lib/libwx_baseu_net-3.0.a + /usr/local/lib/libwxtiff-3.0.a + +### 6. 编译示例 ### + +编译wxWidgets完成后就可以马上编译示例程序了。在相同的目录下,一个新的sample目录已经创建了。 + +进入它并运行下面的命令 + + $ compile samples + $ cd samples/ + $ make + +make命令完成后,进入sampl子目录,这里就有一个可以马上运行的Demo程序了。 + +### 7. 编译你的第一个程序 ### + +你完成编译demo程序后,可以写你自己的程序来编译了。这个也很简单。 + +假设你用的是C++这样你可以使用编辑器的高亮特性。比如gedit、kate、kwrite等等。或者用全功能的IDE像Geany、Codelite、Codeblocks等等。 + +然而你的第一个程序只需要用一个文本编辑器来快速完成。 + +这里就是 + + #include + + class Simple : public wxFrame + { + public: + Simple(const wxString& title) + : wxFrame(NULL, wxID_ANY, title, wxDefaultPosition, wxSize(250, 150)) + { + Centre(); + } + }; + + class MyApp : public wxApp + { + public: + bool OnInit() + { + Simple *simple = new Simple(wxT("Simple")); + simple->Show(true); + return true; + } + }; + + wxIMPLEMENT_APP(MyApp); + +现在保存并用下面的命令编译。 + + # compile + $ g++ basic.cpp `wx-config --cxxflags --libs std` -o program + + # run + $ ./program + +#### 和非标准的库一起编译 #### + +面展示的wx-config命令默认只支持标准的库。如果你使用的是Aui库,那么你需要指定额外用到的库。 + + $ g++ code.cpp `wx-config --cxxflags --libs std,aui` -o program + +更多的信息参考这里[这里][2]。 + +### 资源 ### + +下载wxWidgets的源码和帮助 +[https://www.wxwidgets.org/downloads/][3] + +wxWidgets编译的wiki页面 +[https://wiki.wxwidgets.org/Compiling_and_getting_started][4] + +使用wxWidgets最新版本(3.0+)的事项 +[https://wiki.wxwidgets.org/Updating_to_the_Latest_Version_of_wxWidgets][5] + +-------------------------------------------------------------------------------- + +via: http://www.binarytides.com/install-wxwidgets-ubuntu/ + +作者:[Silver Moon][a] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://plus.google.com/117145272367995638274/posts +[1]:https://www.wxwidgets.org/downloads/ +[2]:https://wiki.wxwidgets.org/Updating_to_the_Latest_Version_of_wxWidgets#The_wx-config_script +[3]:https://www.wxwidgets.org/downloads/ +[4]:https://wiki.wxwidgets.org/Compiling_and_getting_started +[5]:https://wiki.wxwidgets.org/Updating_to_the_Latest_Version_of_wxWidgets From 1fa7073ae62a5f8fadcebf2ab4e1b12936dbbbe2 Mon Sep 17 00:00:00 2001 From: Gore Liu Date: Thu, 21 May 2015 22:00:35 +0800 Subject: [PATCH 118/965] [Translated] 20150326 How to set up server monitoring system with Monit.md --- ... up server monitoring system with Monit.md | 254 ------------------ ... up server monitoring system with Monit.md | 250 +++++++++++++++++ 2 files changed, 250 insertions(+), 254 deletions(-) delete mode 100644 sources/tech/20150326 How to set up server monitoring system with Monit.md create mode 100755 translated/tech/20150326 How to set up server monitoring system with Monit.md diff --git a/sources/tech/20150326 How to set up server monitoring system with Monit.md b/sources/tech/20150326 How to set up server monitoring system with Monit.md deleted file mode 100644 index a803878b39..0000000000 --- a/sources/tech/20150326 How to set up server monitoring system with Monit.md +++ /dev/null @@ -1,254 +0,0 @@ -Translating by goreliu ... - -How to set up server monitoring system with Monit -================================================================================ -Many Linux admins rely on a centralized remote monitoring system (e.g., [Nagios][1] or [Cacti][2]) to check the health of their network infrastructure. While centralized monitoring makes an admin's life easy when dealing with many hosts and devices, a dedicated monitoring box obviously becomes a single point of failure; if the monitoring box goes down or becomes unreachable for whatever reason (e.g., bad hardware or network outage), you will lose visibility on your entire infrastructure. - -One way to add redundancy to your monitoring system is to install standalone monitoring software (as a fallback) at least on any critical/core servers on your network. In case a centralized monitor is down, you will still be able to maintain visibility on your core servers from their backup monitor. - -### What is Monit? ### - -[Monit][3] is a cross-platform open-source tool for monitoring Unix/Linux systems (e.g., Linux, BSD, OSX, Solaris). Monit is extremely easy to install and reasonably lightweight (with only 500KB in size), and does not require any third-party programs, plugins or libraries. Yet, Monit lends itself to full-blown monitoring, capable of process status monitoring, filesystem change monitoring, email notification, customizable actions for core services, and so on. The combination of ease of setup, lightweight implementation and powerful features makes Monit an ideal candidate for a backup monitoring tool. - -I have been using Monit for several years on multiple hosts, and I am very pleased how reliable it has been. Even as a full-blown monitoring system, Monit is very useful and powerful for any Linux admin. In this tutorial, let me demonstrate how to set up Monit on a local server (as a backup monitor) to monitor common services. With this setup, I will only scrach the surface of what Monit can do for us. - -### Installation of Monit on Linux ### - -Most Linux distributions already include Monit in their repositories. - -Debian, Ubuntu or Linux Mint: - - $ sudo aptitude install monit - -Fedora or CentOS/RHEL: - -On CentOS/RHEL, you must enable either [EPEL][4] or [Repoforge][5] repository first. - - # yum install monit - -Monit comes with a very well documented configuration file with a lots of examples. The main configuration file is located in /etc/monit.conf in Fedora/CentOS/RHEL, or /etc/monit/monitrc in Debian/Ubuntu/Mint. Monit configuration has two parts: "Global" and "Services" sections. - -Gl### ###obal Configuration: Web Status Page - -Monit can use several mail servers for notifications, and/or an HTTP/HTTPS status page. Let's start with the web status page with the following requirements. - -- Monit listens on port 1966. -- Access to the web status page is encrypted with SSL. -- Login requires monituser/romania as user/password. -- Login is permitted from localhost, myhost.mydomain.ro, and internal LAN (192.168.0.0/16) only. -- Monit stores an SSL certificate in a pem format. - -For subsequent steps, I will use a Red Hat based system. Similar steps will be applicable on a Debian based system. - -First, generate and store a self-signed certificate (monit.pem) in /var/cert. - - # mkdir /var/certs - # cd /etc/pki/tls/certs - # ./make-dummy-cert monit.pem - # cp monit.pem /var/certs - # chmod 0400 /var/certs/monit.pem - -Now put the following snippet in the Monit's main configuration file. You can start with an empty configuration file or make a copy of the original file. - - set httpd port 1966 and - SSL ENABLE - PEMFILE /var/certs/monit.pem - allow monituser:romania - allow localhost - allow 192.168.0.0/16 - allow myhost.mydomain.ro - -### Global Configuration: Email Notification ### - -Next, let's set up email notification in Monit. We need at least one active [SMTP server][6] which can send mails from the Monit host. Something like the following will do (adjust it for your case): - -- Mail server hostname: smtp.monit.ro -- Sender email address used by monit (from): monit@monit.ro -- Who will receive mail from monit daemon: guletz@monit.ro -- SMTP port used by mail server: 587 (default is 25) - -With the above information, email notification would be configured like this: - - set mailserver smtp.monit.ro port 587 - set mail-format { - from: monit@monit.ro - subject: $SERVICE $EVENT at $DATE on $HOST - message: Monit $ACTION $SERVICE $EVENT at $DATE on $HOST : $DESCRIPTION. - - Yours sincerely, - Monit - - } - - set alert guletz@monit.ro - -As you can see, Monit offers several built-in variables ($DATE, $EVENT, $HOST, etc.), and you can customize your email message for your needs. If you want to send mails from the Monit host itself, you need a sendmail-compatible program (e.g., postfix or ssmtp) already installed. - -### Global Configuration: Monit Daemon ### - -The next part is setting up monit daemon. We will set it up as follows. - -- Performs the first check after 120 seconds. -- Checks services once every 3 minutes. -- Use syslog for logging. - -Place the following snippet to achieve the above setting. - - set daemon 120 - with start delay 240 - set logfile syslog facility log_daemon - -We must also define "idfile", a unique ID used by monit demon, and "eventqueue", a path where mails sent by monit but undelivered due to SMTP/network errors. Verifiy that path (/var/monit) already exists. The following configuration will do. - - set idfile /var/monit/id - set eventqueue - basedir /var/monit - -### Test Global Configuration ### - -Now the "Global" section is finished. The Monit configuration file will look like this: - - # Global Section - - # status webpage and acl's - set httpd port 1966 and - SSL ENABLE - PEMFILE /var/certs/monit.pem - allow monituser:romania - allow localhost - allow 192.168.0.0/16 - allow myhost.mydomain.ro - - # mail-server - set mailserver smtp.monit.ro port 587 - # email-format - set mail-format { - from: monit@monit.ro - subject: $SERVICE $EVENT at $DATE on $HOST - message: Monit $ACTION $SERVICE $EVENT at $DATE on $HOST : $DESCRIPTION. - - Yours sincerely, - Monit - - } - - set alert guletz@monit.ro - - # delay checks - set daemon 120 - with start delay 240 - set logfile syslog facility log_daemon - - # idfile and mail queue path - set idfile /var/monit/id - set eventqueue - basedir /var/monit - -Now it is time to check what we have done. You can test an existing configuration file (/etc/monit.conf) by running: - - # monit -t - ----------- - - Control file syntax OK - -If Monit complains about any error, please review the configuration file again. Fortunately, error/warnings messages are informative. For example: - - monit: Cannot stat the SSL server PEM file '/var/certs/monit.pem' -- No such file or directory - /etc/monit/monitrc:10: Warning: hostname did not resolve 'smtp.monit.ro' - -Once you verify the syntax of configuration, start monit daemon, and wait 2 to 3 minutes: - - # service monit start - -If you are using systemd, run: - - # systemctl start monit - -Now open a browser window, and go to https://:1966. Replace & with your Monit hostname or IP address. - -Note that if you have a self-signed SSL certificate, you will see a warning message in your browser. - -![](https://farm8.staticflickr.com/7596/16737206479_96b9f7dfdb_c.jpg) - -After you have completed login, you must see the following page. - -![](https://farm8.staticflickr.com/7594/16303369973_6019482dea_c.jpg) - -In the rest of the tutorial, let me show how we can monitor a local server and common services. You will see a lot of useful examples on the [official wiki page][7]. Most of them are copy-and-pastable! - -### Service Configuration: CPU/Memory Monitoring ### - -Let start with monitoring a local server's CPU/memory usage. Copy the following snippet in the configuration file. - - check system localhost - if loadavg (1min) > 10 then alert - if loadavg (5min) > 6 then alert - if memory usage > 75% then alert - if cpu usage (user) > 70% then alert - if cpu usage (system) > 60% then alert - if cpu usage (wait) > 75% then alert - -You can easily interpret the above configuration. The above checks are performed on local host for every monitoring cycle (which is set to 120 seconds in the Global section). If any condition is met, monit daemon will send an alert with an email. - -If certain properties do not need to be monitored for every cycle, you can use the following format. For example, this will monitor average load every other cycle (i.e., every 240 seconds). - - if loadavg (1min) > 10 for 2 cycles then alert - -### Service Configuration: SSH Service Monitoring ### - -Let's check if we have sshd binary installed in /usr/sbin/sshd: - - check file sshd_bin with path /usr/sbin/sshd - -We also want to check if the init script for sshd exist: - - check file sshd_init with path /etc/init.d/sshd - -Finally, we want to check if sshd daemon is up an running, and listens on port 22: - - check process sshd with pidfile /var/run/sshd.pid - start program "/etc/init.d/sshd start" - stop program "/etc/init.d/sshd stop" - if failed port 22 protocol ssh then restart - if 5 restarts within 5 cycles then timeout - -More specifically, we can interpret the above configuration as follows. We check if a process named sshd and a pidfile (/var/run/sshd.pid) exist. If either one does not exist, we restart sshd demon using init script. We check if a process listening on port 22 can speak SSH protocol. If not, we restart sshd daemon. If there are at least 5 restarts within the last 5 monitoring cycles (i.e., 5x120 seconds), sshd daemon is declared non-functional, and we do not try to check again. - -![](https://farm9.staticflickr.com/8685/16735725998_62c26a24bc_c.jpg) - -### Service Configuration: SMTP Service Monitoring ### - -Now let's set up a check on a remote SMTP mail server (e.g., 192.168.111.102). Let's assume that the SMTP server is running SMTP, IMAP and SSH on its LAN interface. - - check host MAIL with address 192.168.111.102 - if failed icmp type echo within 10 cycles then alert - if failed port 25 protocol smtp then alert - else if recovered then exec "/scripts/mail-script" - if failed port 22 protocol ssh then alert - if failed port 143 protocol imap then alert - -We check if the remote host responds to ICMP. If we haven't received ICMP response within 10 cycles, we send out an alert. If testing for SMTP protocol on port 25 fails, we send out an alert. If testing succeeds again after a failed test, we run a script (/scripts/mail-script). If testing for SSH and IMAP protocols fail on port 22 and 143, respectively, we send out an alert. - -### Conclusion ### - -In this tutorial, I demonstrate how to set up Monit on a local server. What I showed here is just the tip of the iceberg, as far as Monit's capabilities are concerned. Take your time and read the man page about Monit (a very good one). Monit can do a lot for any Linux admin with a very nice and easy to understand syntax. If you put together a centralized remote monitor and Monit to work for you, you will have a more reliable monitoring system. What is your thought on Monit? - --------------------------------------------------------------------------------- - -via: http://xmodulo.com/server-monitoring-system-monit.html - -作者:[Iulian Murgulet][a] -译者:[goreliu](https://github.com/goreliu) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://xmodulo.com/author/iulian -[1]:http://xmodulo.com/monitor-common-services-nagios.html -[2]:http://xmodulo.com/monitor-linux-servers-snmp-cacti.html -[3]:http://mmonit.com/monit/ -[4]:http://xmodulo.com/how-to-set-up-epel-repository-on-centos.html -[5]:http://xmodulo.com/how-to-set-up-rpmforge-repoforge-repository-on-centos.html -[6]:http://xmodulo.com/mail-server-ubuntu-debian.html -[7]:http://mmonit.com/wiki/Monit/ConfigurationExamples \ No newline at end of file diff --git a/translated/tech/20150326 How to set up server monitoring system with Monit.md b/translated/tech/20150326 How to set up server monitoring system with Monit.md new file mode 100755 index 0000000000..5fbce3aa70 --- /dev/null +++ b/translated/tech/20150326 How to set up server monitoring system with Monit.md @@ -0,0 +1,250 @@ +如何使用Monit部署服务器监控系统 +================================================================================ +很多Linux系统管理员依赖一个集中式的远程监控系统(比如[Nagios][1]或者[Cacti][2])来检查他们网络基础设备的健康状况。虽然集中式监控让管理员的生活更简单了,然而处理很多机器和服务时,专用的监控中心显然成为了一个单点故障,如果监控中心挂了或者因为什么原因(比如硬件或者网络故障)不可访问了,你就会失去整个网络基础设备情况的任何信息。 + +一个给你的监控系统增加冗余度的方法是安装独立的监控软件(作为后备),至少在网络中的关键/核心服务器上。这样在集中式监控系统挂掉的情况,你还有能力通过后备的监控方式来获取核心服务器的运行状况。 + +### Monit是什么? ### + +[Monit][3]是一个跨平台的用来监控Unix/linux系统(比如Linux、BSD、OSX、Solaris)的工具。Monit特别易于安装,而且非常轻量级(只有500KB大小),并且不依赖任何第三方程序、插件或者库。然而,Monit可以胜任全面监控、进程状态监控、文件系统变动监控、邮件通知和对核心服务的自定义回调等场景。易于安装、轻量级的实现以及强大的功能,让Monit成为一个理想的后备监控工具。 + +我已经在一些机器使用Monit几年了,而且我对它的可靠性非常满意。甚至作为全面的监控系统,对任何Linux系统管理员来说Monit也是非常有用和强大的。在这篇教程中,我会展示如何在一个本地服务器部署Monit(作为后备监控系统)来监控常见的服务。在部署过程中,我只会展示我们用到的部分。 + +### 在Linux安装Monit ### + +Monit已经被包含在多数Linux发行版的软件仓库中了。 + +Debian、Ubuntu或者Linux Mint: + + $ sudo aptitude install monit + +Fedora或者CentOS/RHEL: + +在CentOS/RHEL中,你必须首先启用[EPEL][4]或者[Repoforge][5]软件仓库. + + # yum install monit + +Monit自带一个文档完善的配置文件,其中包含了很多例子。主配置文件在/etc/monit.conf(Fedora/CentOS/RHEL),或者/etc/monit/monitrc(Debian/Ubuntu/Mint)。Monit配置文件有两部分:“Global”(全局)和“Services”(服务)。 + +### Global Configuration: Web Status Page (全局配置:Web状态页面。LCTT 译注:保留原文是因为和配置文件中的字段对应) ### + +Monit可以使用邮件服务来发送通知,也可以使用HTTP/HTTPS页面来展示。我们先使用符合以下要求的web状态页面吧: + +- Monit监听1966端口。 +- 对web状态页面的访问是通过SSL加密的。 +- 使用monituser/romania作为用户名/口令登录。 +- 只允许使用localhost、myhost.mydomain.ro和在局域网内部(192.168.0.0/16)访问。 +- Monit使用pem格式的SSL证书。 + +之后的步骤,我会使用一个基于Red Hat的系统。在基于Debian的系统中的步骤也是类似的。 + +首先,在/var/cert生成一个自签名的证书(monit.pem): + + # mkdir /var/certs + # cd /etc/pki/tls/certs + # ./make-dummy-cert monit.pem + # cp monit.pem /var/certs + # chmod 0400 /var/certs/monit.pem + +现在将下列代码片段放到Monit的主配置文件中。你可以创建一个空配置文件,或者基于自带的配置文件修改。 + + set httpd port 1966 and + SSL ENABLE + PEMFILE /var/certs/monit.pem + allow monituser:romania + allow localhost + allow 192.168.0.0/16 + allow myhost.mydomain.ro + +### Global Configuration: Email Notification (全局配置:邮件通知) ### + +然后,我们来设置Monit的邮件通知。我们至少需要一个可用的[SMTP服务器][6]来让Monit发送邮件。这样就可以(按照你的实际情况修改): + +- 邮件服务器的机器名:smtp.monit.ro +- Monit使用的发件人:monit@monit.ro +- 邮件的收件人:guletz@monit.ro +- 邮件服务器使用的SMTP端口:587(默认是25) + +有了以上信息,邮件通知就可以这样配置: + + set mailserver smtp.monit.ro port 587 + set mail-format { + from: monit@monit.ro + subject: $SERVICE $EVENT at $DATE on $HOST + message: Monit $ACTION $SERVICE $EVENT at $DATE on $HOST : $DESCRIPTION. + + Yours sincerely, + Monit + + } + + set alert guletz@monit.ro + +就像你看到的,Monit会提供几个内部变量(`$DATE`、`$EVENT`、`$HOST`等),你可以按照你的需求自定义邮件内容。如果你想要从Monit所在机器发送邮件,就需要一个已经安装的与sendmail兼容的程序(如postfix或者ssmtp)。 + +### Global Configuration: Monit Daemon (全局配置:Monit守护进程)### + +接下来就该配置Monit守护进程了。可以将其设置成这样: + +- 在120秒后进行第一次检测。 +- 每3分钟检测一次服务。 +- 使用syslog来记录日志。 + +如下代码段可以满足上述需求。 + + set daemon 120 + with start delay 240 + set logfile syslog facility log_daemon + +我们必须定义“idfile”,Monit守护进程的一个独一无二的ID文件;以及“eventqueue”,当monit的邮件因为SMTP或者网络故障发不出去,邮件会暂存在这里;以及确保/var/monit路径是存在的。然后使用下边的配置就可以了。 + + set idfile /var/monit/id + set eventqueue + basedir /var/monit + +### 测试Global Configuration(全局配置) ### + +现在“Global”部分就完成了。Monit配置文件看起来像这样: + + # Global Section + + # status webpage and acl's + set httpd port 1966 and + SSL ENABLE + PEMFILE /var/certs/monit.pem + allow monituser:romania + allow localhost + allow 192.168.0.0/16 + allow myhost.mydomain.ro + + # mail-server + set mailserver smtp.monit.ro port 587 + # email-format + set mail-format { + from: monit@monit.ro + subject: $SERVICE $EVENT at $DATE on $HOST + message: Monit $ACTION $SERVICE $EVENT at $DATE on $HOST : $DESCRIPTION. + + Yours sincerely, + Monit + + } + + set alert guletz@monit.ro + + # delay checks + set daemon 120 + with start delay 240 + set logfile syslog facility log_daemon + + # idfile and mail queue path + set idfile /var/monit/id + set eventqueue + basedir /var/monit + +现在是时候验证我们的工作了,你可以通过运行如下命令来验证存在的配置文件(/etc/monit.conf): + + # monit -t + + Control file syntax OK + +如果monit提示任何错误,请再检查下配置文件。幸运的是,错误/警告信息是可以帮助你发现问题的,比如: + + monit: Cannot stat the SSL server PEM file '/var/certs/monit.pem' -- No such file or directory + /etc/monit/monitrc:10: Warning: hostname did not resolve 'smtp.monit.ro' + +一旦你确认配置文件没问题了,可以启动monit守护进程,然后等2到3分钟: + + # service monit start + +如果你使用的是systemd,运行: + + # systemctl start monit + +现在打开一个浏览器窗口,然后访问`https://:1966`。将``替换成Monit所在机器的机器名或者IP地址。 + +如果你使用的是自签名的SSL证书,你会在浏览器中看到一个警告信息。 + +![](https://farm8.staticflickr.com/7596/16737206479_96b9f7dfdb_c.jpg) + +你完成登录后,一定要看这个页面。 + +![](https://farm8.staticflickr.com/7594/16303369973_6019482dea_c.jpg) + +在这个教程的其余部分,我们演示监控一个本地服务器和常见服务的方法。你会在[官方wiki页面][7]看到很多有用的例子。其中的多数是可以直接复制粘贴的! + +### Service Configuration: CPU/Memory Monitoring (服务配置:CPU、内存监控) ### + +我们先来监控本地服务器的CPU、内存占用。复制如下代码段到配置文件中。 + + check system localhost + if loadavg (1min) > 10 then alert + if loadavg (5min) > 6 then alert + if memory usage > 75% then alert + if cpu usage (user) > 70% then alert + if cpu usage (system) > 60% then alert + if cpu usage (wait) > 75% then alert + +你可以很容易理解上边的配置。最上边的check是指每个监控周期(全局配置里设置的120秒)都对本机进行下面的操作。如果满足了任何条件,monit守护进程就会使用邮件发送一条报警。 + +如果某个监控项不需要每个周期都检查,可以使用如下格式,它会每240秒检查一次平均负载。 + + if loadavg (1min) > 10 for 2 cycles then alert + +### Service Configuration: SSH Service Monitoring (服务配置:SSH服务监控) ### + +先检查我们的sshd是否安装在/usr/sbin/sshd: + + check file sshd_bin with path /usr/sbin/sshd + +我们还想检查sshd的启动脚本是否存在: + + check file sshd_init with path /etc/init.d/sshd + +最后,我们还想检查sshd守护进程是否存活,并且在监听22端口: + + check process sshd with pidfile /var/run/sshd.pid + start program "/etc/init.d/sshd start" + stop program "/etc/init.d/sshd stop" + if failed port 22 protocol ssh then restart + if 5 restarts within 5 cycles then timeout + +我们可以这样解释上述配置。我们检查是否存在名为sshd的进程,并且有一个保存pid的文件存在(/var/run/sshd.pid)。如果任何一个不存在,我们就使用启动脚本重启sshd。我们检查是否有进程在监听22端口,并且使用的是SSH协议。如果没有,我们还是重启sshd。如果在最近的5个监控周期(5x120秒)至少重启5次了,sshd就被认为是不能用的,我们就不再检查了。 + +![](https://farm9.staticflickr.com/8685/16735725998_62c26a24bc_c.jpg) + +### Service Configuration: SMTP Service Monitoring (服务配置:SMTP服务监控) ### + +现在我们来设置一个检查远程SMTP服务器(如192.168.111.102)的监控。假定SMTP服务器运行着SMTP、IMAP、SSH服务。 + + check host MAIL with address 192.168.111.102 + if failed icmp type echo within 10 cycles then alert + if failed port 25 protocol smtp then alert + else if recovered then exec "/scripts/mail-script" + if failed port 22 protocol ssh then alert + if failed port 143 protocol imap then alert + +我们检查远程主机是否响应ICMP协议。如果我们在10个周期内没有收到ICMP回应,就发送一条报警。如果监测到25端口上的SMTP协议是异常的,就发送一条报警。如果在一次监测失败后又监测成功了,就运行一个脚本(/scripts/mail-script)。如果检查22端口上的SSH或者143端口上的IMAP协议不正常,同样发送报警。 + +### 总结 ### + +在这个教程,我演示了如何在本地服务器设置Monit,当然这只是Monit功能的冰山一角。你可以花些时间阅读Monit的man手册(写得很好)。Monit可以为任何Linux系统管理员做很多事情,并且具有非常优美和易于理解的语法。如果你将一个集中式的远程监控系统和Monit一同使用,你会得到一个更可靠的监控系统。你感觉Monit怎么样? + +-------------------------------------------------------------------------------- + +via: http://xmodulo.com/server-monitoring-system-monit.html + +作者:[Iulian Murgulet][a] +译者:[goreliu](https://github.com/goreliu) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://xmodulo.com/author/iulian +[1]:http://xmodulo.com/monitor-common-services-nagios.html +[2]:http://xmodulo.com/monitor-linux-servers-snmp-cacti.html +[3]:http://mmonit.com/monit/ +[4]:http://xmodulo.com/how-to-set-up-epel-repository-on-centos.html +[5]:http://xmodulo.com/how-to-set-up-rpmforge-repoforge-repository-on-centos.html +[6]:http://xmodulo.com/mail-server-ubuntu-debian.html +[7]:http://mmonit.com/wiki/Monit/ConfigurationExamples \ No newline at end of file From c573ac00465672e9d3941cca63515246468be8ac Mon Sep 17 00:00:00 2001 From: wxy Date: Thu, 21 May 2015 22:34:34 +0800 Subject: [PATCH 119/965] PUB:20150316 5 Interesting Command Line Tips and Tricks in Linux--Part 1 @goreliu --- ...d Line Tips and Tricks in Linux--Part 1.md | 55 ++++++++++++------- 1 file changed, 36 insertions(+), 19 deletions(-) rename {translated/tech => published}/20150316 5 Interesting Command Line Tips and Tricks in Linux--Part 1.md (69%) diff --git a/translated/tech/20150316 5 Interesting Command Line Tips and Tricks in Linux--Part 1.md b/published/20150316 5 Interesting Command Line Tips and Tricks in Linux--Part 1.md similarity index 69% rename from translated/tech/20150316 5 Interesting Command Line Tips and Tricks in Linux--Part 1.md rename to published/20150316 5 Interesting Command Line Tips and Tricks in Linux--Part 1.md index 6bf88dba2c..9344d8c482 100644 --- a/translated/tech/20150316 5 Interesting Command Line Tips and Tricks in Linux--Part 1.md +++ b/published/20150316 5 Interesting Command Line Tips and Tricks in Linux--Part 1.md @@ -1,18 +1,22 @@ -5个有趣的Linux命令行技巧(第一部分) +5个有趣的Linux命令行技巧 ================================================================================ 你有将Linux物尽其用吗?对很多Linux用户来说,有很多看起来是技巧的有用特性。有些时候你会需要这些技巧。本文会帮助你更好得使用一些命令,发挥其更强大的功能。 ![5个命令行技巧](http://www.tecmint.com/wp-content/uploads/2015/03/5-Command-Line-Tips.jpg) -图1:5个命令行技巧 + +*图1:5个命令行技巧* 我们开始一个新的系列,在这里我们还会写一些技巧,并且用尽量小的篇幅写清楚。 -### 1. 我们可以使用[`history`命令][1]来查看曾经运行过的命令。这里是一个`history`命令的示例输出。 ### +### 1. 我们可以使用[`history`命令][1]来查看曾经运行过的命令。 ### + +这里是一个`history`命令的示例输出。 # history ![history命令例子](http://www.tecmint.com/wp-content/uploads/2015/03/history-command.gif) -图2:history命令例子 + +*图2:history命令例子* 从`history`命令输出看,很明显,命令的执行时间没有被打出来。有解决方法吗?有的!运行如下命令: @@ -39,32 +43,39 @@ - .bashrc – BASH以交互方式启动时运行的脚本文件 ![history命令输出的日志](http://www.tecmint.com/wp-content/uploads/2015/03/History-Command-Logs.gif) -图3:`history`命令输出的日志 + +*图3:`history`命令输出的日志* -### 2. 如何测试磁盘写入速度?一行`dd`命令脚本就可以实现。### +### 2. 如何测试磁盘写入速度?### + +一行`dd`命令脚本就可以实现。 # dd if=/dev/zero of=/tmp/output.img bs=8k count=256k conv=fdatasync; rm -rf /tmp/output.img ![dd命令例子](http://www.tecmint.com/wp-content/uploads/2015/03/dd-Command-Example.gif) -图4:`dd`命令例子 + +*图4:`dd`命令例子* 命令和选项的解释: - dd – 转换和复制文件 - if=/dev/zero – 指定输入文件,默认为stdin(标准输入) - of=/tmp/output.img – 指定输出文件,默认为stdout(标准输出) -- bs – 一次读和写的大小,最大可以以MB为单位 +- bs – 一次读和写的块大小,最大可以以MB为单位 - count – 复制次数 - conv – 使用逗号分隔的策略来转换文件(LCTT 译注:比如将大写字母转换成小写,echo AA | dd conv=lcase) - rm – 删除文件和目录 - -rf – (-r) 递归地删除目录和其中的内容,(-f)强行删除而不输出确认信息 -### 3. 你如何获取吃掉你磁盘空间的最大的6个文件?一个使用[`du`命令][2]的简单单行脚本即可实现,`du`命令主要用于获取文件的空间使用情况。### +### 3. 你如何获取吃掉你磁盘空间的最大的6个文件?### + +一个使用[`du`命令][2]的简单单行脚本即可实现,`du`命令主要用于获取文件的空间使用情况。 # du -hsx * | sort -rh | head -6 ![获取磁盘空间使用情况的方法](http://www.tecmint.com/wp-content/uploads/2015/03/check-disk-space-usage.gif) -图5:获取磁盘空间使用情况的方法 + +*图5:获取磁盘空间使用情况的方法* 命令和选项的解释: @@ -74,19 +85,25 @@ - -rf – (-r)将比较的结果逆序输出,(-f)忽略大小写 - head – 输出文件的头几行 -### 4. 获取一个文件的详细状态信息,可以使用`stat`命令。 ### +### 4. 获取一个文件的详细状态信息### + +可以使用`stat`命令 # stat filename_ext (例如:stat abc.pdf) ![获取文件的详细信息](http://www.tecmint.com/wp-content/uploads/2015/03/Check-File-Statistics.gif) -图6:获取文件的详细信息 + +*图6:获取文件的详细信息* -### 5. 最后一个技巧是为那些入门者准备的,如果你是有经验的用户,可能不需要它,除非你想从中寻找乐趣。入门者可能有Linux命令行恐惧症,下面的命令会随机显示一个man手册页。对入门者来说,好处是总会学到新的东西,而且不会厌倦。 ### +### 5. 显示帮助 ### + +最后一个技巧是为那些入门者准备的,如果你是有经验的用户,可能不需要它,除非你想从中寻找乐趣。入门者可能有Linux命令行恐惧症,下面的命令会随机显示一个man手册页。对入门者来说,好处是总会学到新的东西,而且不会厌倦。 # man $(ls /bin | shuf | head -1) -![查看随机的man手册页](http://www.tecmint.com/wp-content/uploads/2015/03/Generate-Random-Man-Pages.gif) -图7:查看随机的man手册页 +![查看随机的man手册页](http://www.tecmint.com/wp-content/uploads/2015/03/Generate-Random-Man-Pages.gif) + +*图7:查看随机的man手册页* 命令和选项的解释: @@ -96,9 +113,9 @@ - shuf – 把输入内容按行随机打乱并输出 - head – 输出文件的头几行 -这就是所有的内容了。如果你知道任何类似的技巧,可以分享给我们,我们会用你的语言在Tecmint.com网站上发表出来。 +这就是所有的内容了。如果你知道任何类似的技巧,可以分享给我们,我们会用你的语言在网站上发表出来。 -如果你想分享任何技巧,但不想写成文章,可以发到tecmint[dot]com[at]gmail[dot]com,我们会将其包含在我们的文章中。不要忘记在下边评论框中留下有价值的反馈。保持联系。可以点赞或者将本文分享来帮助我们更好地传播内容。 +不要忘记在下边评论框中留下有价值的反馈。保持联系。可以点赞或者将本文分享来帮助我们更好地传播内容。 -------------------------------------------------------------------------------- @@ -106,10 +123,10 @@ via: http://www.tecmint.com/5-linux-command-line-tricks/ 作者:[Avishek Kumar][a] 译者:[goreliu](https://github.com/goreliu) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 [a]:http://www.tecmint.com/author/avishek/ -[1]:http://www.tecmint.com/history-command-examples/ +[1]:https://linux.cn/article-1143-1.html [2]:http://www.tecmint.com/check-linux-disk-usage-of-files-and-directories/ \ No newline at end of file From 92e6fbd286a1b9e853ece25467d852550a14fb42 Mon Sep 17 00:00:00 2001 From: wxy Date: Thu, 21 May 2015 22:51:25 +0800 Subject: [PATCH 120/965] PUB:20150331 How to Generate or Encrypt or Decrypt Random Passwords in Linux @FSSlc --- ...pt or Decrypt Random Passwords in Linux.md | 52 +++++++++++-------- 1 file changed, 29 insertions(+), 23 deletions(-) rename {translated/tech => published}/20150331 How to Generate or Encrypt or Decrypt Random Passwords in Linux.md (70%) diff --git a/translated/tech/20150331 How to Generate or Encrypt or Decrypt Random Passwords in Linux.md b/published/20150331 How to Generate or Encrypt or Decrypt Random Passwords in Linux.md similarity index 70% rename from translated/tech/20150331 How to Generate or Encrypt or Decrypt Random Passwords in Linux.md rename to published/20150331 How to Generate or Encrypt or Decrypt Random Passwords in Linux.md index dcb675d782..b4023b5162 100644 --- a/translated/tech/20150331 How to Generate or Encrypt or Decrypt Random Passwords in Linux.md +++ b/published/20150331 How to Generate or Encrypt or Decrypt Random Passwords in Linux.md @@ -2,42 +2,45 @@ ================================================================================ 我们一直积极地提供有关 Linux 技巧的系列文章,如果你错过了这个系列的最新文章,你或许可以去访问下面的链接。 -注:此篇文章做过原文 -- [Linux 中 5 个有趣的命令行技巧][1] (注:这篇文章还没有被翻译,在 20150316 选的题) +- [Linux 中 5 个有趣的命令行技巧][1] 在这篇文章中,我们将分享一些有趣 Linux 技巧,内容是有关如何产生随机密码以及加密或解密这些经过加盐或没有加盐处理的密码。 安全是数字时代中的一个主要话题。在电脑,email,云端,手机,文档和其他的场合中,我们都会使用到密码。众所周知,选择密码的基本原则是 “易记,难猜”。考虑过使用基于机器自动生成的密码吗?相信我,Linux 非常擅长这方面的工作。 -**1. 使用命令 `pwgen` 来生成一个长度为 10 个字符的唯一的随机密码。假如你还没有安装 pwgen,请使用 Apt 或 YUM 等包管理器来安装它。** +**1. 使用命令 `pwgen` 来生成一个长度为 10 个字符的独特的随机密码。假如你还没有安装 pwgen,请使用 Apt 或 YUM 等包管理器来安装它。** $ pwgen 10 1 -![生成一个唯一的随机密码](http://www.tecmint.com/wp-content/uploads/2015/03/Generate-Random-Unique-Password-in-Linux.gif) -生成一个唯一的随机密码 +![生成一个独特的随机密码](http://www.tecmint.com/wp-content/uploads/2015/03/Generate-Random-Unique-Password-in-Linux.gif) + +*生成一个独特的随机密码* 一口气生成若干组长度为 50 个字符的唯一的随机密码! $ pwgen 50 ![生成多组随机密码](http://www.tecmint.com/wp-content/uploads/2015/03/Generate-Multiple-Random-Passwords.gif) -生成多组随机密码 -**2. 你还可以使用 `makepasswd` 来每次生成一个给定长度的唯一的随机密码。在你把玩 makepasswd 命令之前,请确保你已经安装了它。如若没有安装它,试试使用 Apt 或 YUM 包管理器来安装 `makepasswd`这个软件包。** +*生成多组随机密码* + +**2. 你还可以使用 `makepasswd` 来每次生成一个给定长度的独特的随机密码。在你把玩 makepasswd 命令之前,请确保你已经安装了它。如若没有安装它,试试使用 Apt 或 YUM 包管理器来安装 `makepasswd`这个软件包。** 生成一个长度为 10 个字符的随机密码。该命令产生的密码的长度默认为 10。 $ makepasswd -![使用 makepasswd 生成唯一的密码](http://www.tecmint.com/wp-content/uploads/2015/03/mkpasswd-generate-unique-password.gif) -使用 makepasswd 生成唯一的密码 +![使用 makepasswd 生成独特的密码](http://www.tecmint.com/wp-content/uploads/2015/03/mkpasswd-generate-unique-password.gif) + +*使用 makepasswd 生成独特的密码* 生成一个长度为 50 个字符的随机密码。 $ makepasswd --char 50 ![生成长度为 50 的密码](http://www.tecmint.com/wp-content/uploads/2015/03/Random-Password-Generate.gif) -生成长度为 50 的密码 + +*生成长度为 50 的密码* 生成 7 个长度为 20 个字符的随机密码。 @@ -47,9 +50,7 @@ **3. 使用带“盐”的 Crypt(注:这里应该指的是一个函数,可以参考[这里](http://man7.org/linux/man-pages/man3/crypt.3.html) ) 来加密一个密码。提供手动或自动添加 “盐”。** -对于那些不清楚 **盐** 的意义的人, - -这里的 “盐” 指的是一个随机数据,它作为密码生成函数的一个额外的输入, 目的是保护密码免受词典攻击。 +对于那些不清楚 **盐** 的意义的人,这里的 “盐” 指的是一个随机数据,它作为密码生成函数的一个额外的输入, 目的是保护密码免受词典攻击。 在执行下面的操作前,请确保你已经安装了 `mkpasswd`。 @@ -58,46 +59,51 @@ $ mkpasswd tecmint ![使用 Crypt 来加密密码](http://www.tecmint.com/wp-content/uploads/2015/03/Encrypt-Password-in-Linux.gif) -使用 Crypt 来加密密码 + +*使用 Crypt 来加密密码* 现在让我们来手动定义 “盐” 的值。每次它将产生相同的结果。请注意你可以输入任何你想输入的值来作为 “盐” 的值。 $ mkpasswd tecmint -s tt ![带“盐”加密密码](http://www.tecmint.com/wp-content/uploads/2015/03/Encrypt-Password-Using-Salt.gif) -带“盐”加密密码 + +*带“盐”加密密码* 另外, mkpasswd 还是交互式的,假如你在命令中没有提供密码,它将主动询问你来输入密码。 -**4. 使用 aes-256-cbc 加密算法并使用密码(如 “tecmint”) 并带“盐” 加密一个字符串(如 “Tecmint-is-a-Linux-Community”)。** +**4. 使用 aes-256-cbc 加密算法并使用带“盐”的密码(如 “tecmint”) 加密一个字符串(如 “Tecmint-is-a-Linux-Community”)。** # echo Tecmint-is-a-Linux-Community | openssl enc -aes-256-cbc -a -salt -pass pass:tecmint ![在 Linux 中加密一个字符串](http://www.tecmint.com/wp-content/uploads/2015/03/Encrypt-A-String-in-Linux.gif) -在 Linux 中加密一个字符串 -在上面例子中, [echo 命令][2](注:此篇原文也做过,这里是链接 http://linux.cn/article-3948-1.html) 的输出通过管道传递给了 openssl 命令,使得该输出被 Cipher(enc) 所加密,这个过程中使用了 aes-256-cbc 加密算法,并附带了密码 (tecmint) 和 “盐” 。 +*在 Linux 中加密一个字符串* + +在上面例子中, [echo 命令][2]的输出通过管道传递给了 openssl 命令,使得该输出通过加密编码方式(enc:Encoding with Cipher ) 所加密,这个过程中使用了 aes-256-cbc 加密算法,并附带了密码 (tecmint) 和 “盐” 。 **5. 使用 openssl 命令的 -aes-256-cbc 解密选项来解密上面的字符串。** # echo U2FsdGVkX18Zgoc+dfAdpIK58JbcEYFdJBPMINU91DKPeVVrU2k9oXWsgpvpdO/Z | openssl enc -aes-256-cbc -a -d -salt -pass pass:tecmint ![在 Linux 中解密字符串](http://www.tecmint.com/wp-content/uploads/2015/03/Decrypt-String-in-Linux.gif) -在 Linux 中解密字符串 -现在就是这些内容了。假如你知道任何这类的技巧,请将你的技巧发送到 admin@tecmint.com 邮箱中,你的技巧将会以你的名义来发表,同时我们也将在我们将来的文章中把它包含进去。 +*在 Linux 中解密字符串* + +现在就是这些内容了。 保持联系,保持连接,敬请关注。不要忘了在下面的评论中提供给我们您有价值的反馈。 + -------------------------------------------------------------------------------- via: http://www.tecmint.com/generate-encrypt-decrypt-random-passwords-in-linux/ 作者:[Avishek Kumar][a] 译者:[FSSlc](https://github.com/FSSlc) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 [a]:http://www.tecmint.com/author/avishek/ -[1]:http://www.tecmint.com/5-linux-command-line-tricks/ -[2]:http://www.tecmint.com/echo-command-in-linux/ \ No newline at end of file +[1]:https://linux.cn/article-5485-1.html +[2]:http://linux.cn/article-3948-1.html \ No newline at end of file From 5d7da8621eec99832b6dd3129d58d64a85b91155 Mon Sep 17 00:00:00 2001 From: wxy Date: Thu, 21 May 2015 23:03:34 +0800 Subject: [PATCH 121/965] PUB:20150518 Linux FAQs with Answers--How to block specific user agents on nginx web server @GOLinux --- ...pecific user agents on nginx web server.md | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) rename {translated/tech => published}/20150518 Linux FAQs with Answers--How to block specific user agents on nginx web server.md (75%) diff --git a/translated/tech/20150518 Linux FAQs with Answers--How to block specific user agents on nginx web server.md b/published/20150518 Linux FAQs with Answers--How to block specific user agents on nginx web server.md similarity index 75% rename from translated/tech/20150518 Linux FAQs with Answers--How to block specific user agents on nginx web server.md rename to published/20150518 Linux FAQs with Answers--How to block specific user agents on nginx web server.md index 89a94cfbeb..16bc2060fb 100644 --- a/translated/tech/20150518 Linux FAQs with Answers--How to block specific user agents on nginx web server.md +++ b/published/20150518 Linux FAQs with Answers--How to block specific user agents on nginx web server.md @@ -1,6 +1,6 @@ -Linux有问必答——nginx网络服务器上如何阻挡特定用户代理 +Linux有问必答:nginx网络服务器上如何阻止特定用户代理(UA) ================================================================================ -> **问题**: 我注意到有一些机器人经常访问我nginx驱动的网站,并且进行一些攻击性的扫描,导致消耗掉了我的网络服务器的大量资源。我一直尝试着通过用户代理符串来阻挡这些机器人。我怎样才能在nginx网络服务器上阻挡掉特定的用户代理呢? +> **问题**: 我注意到有一些机器人经常访问我的nginx驱动的网站,并且进行一些攻击性的扫描,导致消耗掉了我的网络服务器的大量资源。我一直尝试着通过用户代理符串来阻挡这些机器人。我怎样才能在nginx网络服务器上阻挡掉特定的用户代理呢? 现代互联网滋生了大量各种各样的恶意机器人和网络爬虫,比如像恶意软件机器人、垃圾邮件程序或内容刮刀,这些恶意工具一直偷偷摸摸地扫描你的网站,干些诸如检测潜在网站漏洞、收获电子邮件地址,或者只是从你的网站偷取内容。大多数机器人能够通过它们的“用户代理”签名字符串来识别。 @@ -10,7 +10,7 @@ Linux有问必答——nginx网络服务器上如何阻挡特定用户代理 ### 在Nginx中将特定用户代理列入黑名单 ### -要配置用户代理阻挡列表,请打开你的网站的nginx配置文件,找到服务器定义部分。该文件可能会放在不同的地方,这取决于你的nginx配置或Linux版本(如,/etc/nginx/nginx.conf,/etc/nginx/sites-enabled/,/usr/local/nginx/conf/nginx.conf,/etc/nginx/conf.d/)。 +要配置用户代理阻挡列表,请打开你的网站的nginx配置文件,找到`server`定义部分。该文件可能会放在不同的地方,这取决于你的nginx配置或Linux版本(如,`/etc/nginx/nginx.conf`,`/etc/nginx/sites-enabled/`,`/usr/local/nginx/conf/nginx.conf`,`/etc/nginx/conf.d/`)。 server { listen 80 default_server; @@ -20,19 +20,19 @@ Linux有问必答——nginx网络服务器上如何阻挡特定用户代理 .... } -在打开该配置文件并找到 server 部分后,添加以下 if 声明到该部分内的某个地方。 +在打开该配置文件并找到 `server` 部分后,添加以下 if 声明到该部分内的某个地方。 server { listen 80 default_server; server_name xmodulo.com; root /usr/share/nginx/html; - # case sensitive matching + # 大小写敏感的匹配 if ($http_user_agent ~ (Antivirx|Arian) { return 403; } - # case insensitive matching + #大小写无关的匹配 if ($http_user_agent ~* (netcrawl|npbot|malicious)) { return 403; } @@ -41,7 +41,7 @@ Linux有问必答——nginx网络服务器上如何阻挡特定用户代理 } 如你所想,这些 if 声明使用正则表达式匹配了任意不良用户字符串,并向匹配的对象返回403 HTTP状态码。 -$http_user_agent是HTTP请求的一个包含有用户代理字符串的变量。‘~’操作符针对用户代理字符串进行大小写敏感匹配,而‘~*’操作符则进行大小写不敏感匹配。‘|’操作符是逻辑或,因此,你可以在 if 声明中放入众多的用户代理关键字,然后将它们全部阻挡掉。 +`$http_user_agent`是HTTP请求中的一个包含有用户代理字符串的变量。‘~’操作符针对用户代理字符串进行大小写敏感匹配,而‘~*’操作符则进行大小写无关匹配。‘|’操作符是逻辑或,因此,你可以在 if 声明中放入众多的用户代理关键字,然后将它们全部阻挡掉。 在修改配置文件后,你必须重新加载nginx以激活阻挡: @@ -55,7 +55,7 @@ $http_user_agent是HTTP请求的一个包含有用户代理字符串的变量。 ### 管理Nginx中的用户代理黑名单 ### -目前为止,我已经展示了在nginx中如何阻挡一些用户代理的HTTP请求。如果你有学多不同类型的网络爬虫机器人要阻挡,又该怎么办呢? +目前为止,我已经展示了在nginx中如何阻挡一些用户代理的HTTP请求。如果你有许多不同类型的网络爬虫机器人要阻挡,又该怎么办呢? 由于用户代理黑名单会增长得很大,所以将它们放在nginx的server部分不是个好点子。取而代之的是,你可以创建一个独立的文件,在该文件中列出所有被阻挡的用户代理。例如,让我们创建/etc/nginx/useragent.rules,并定义以下面的格式定义所有被阻挡的用户代理的图谱。 @@ -100,7 +100,7 @@ $http_user_agent是HTTP请求的一个包含有用户代理字符串的变量。 $ sudo /path/to/nginx -s reload -现在,任何包含有/etc/nginx/useragent.rules中列出的关键字的用户代理将被nginx自动禁止。 +现在,任何包含有`/etc/nginx/useragent.rules`中列出的关键字的用户代理将被nginx自动禁止。 -------------------------------------------------------------------------------- @@ -108,7 +108,7 @@ via: http://ask.xmodulo.com/block-specific-user-agents-nginx-web-server.html 作者:[Dan Nanni][a] 译者:[GOLinux](https://github.com/GOLinux) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From eb9234e144019bdb20eecbccd2d50a898f64ff08 Mon Sep 17 00:00:00 2001 From: wxy Date: Fri, 22 May 2015 00:31:17 +0800 Subject: [PATCH 122/965] PUB:20150429 Docker 1.6 Released--How to Upgrade on Fedora or CentOS @wi-cuckoo --- ...sed--How to Upgrade on Fedora or CentOS.md | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) rename {translated/tech => published}/20150429 Docker 1.6 Released--How to Upgrade on Fedora or CentOS.md (64%) diff --git a/translated/tech/20150429 Docker 1.6 Released--How to Upgrade on Fedora or CentOS.md b/published/20150429 Docker 1.6 Released--How to Upgrade on Fedora or CentOS.md similarity index 64% rename from translated/tech/20150429 Docker 1.6 Released--How to Upgrade on Fedora or CentOS.md rename to published/20150429 Docker 1.6 Released--How to Upgrade on Fedora or CentOS.md index a07ecad986..6b6141211f 100644 --- a/translated/tech/20150429 Docker 1.6 Released--How to Upgrade on Fedora or CentOS.md +++ b/published/20150429 Docker 1.6 Released--How to Upgrade on Fedora or CentOS.md @@ -1,22 +1,22 @@ -Docker 1.6 发布 - 如何在Fedora / CentOS上面升级 +如何在Fedora / CentOS上面升级Docker 1.6 ============================================================================= -Docker,一个为软件打包的流行开源容器平台,有了新的发行版1.6,增加了许多新的特性。该版本在Docker注册,引擎,云集,组合和机器方面都有更新。这次发行旨在提升体验,开发者和系统管理员的经验(这里不太确定)。让我们来快速看看有哪些新特性吧。 +Docker,一个流行的将软件打包的开源容器平台,已经有了新的1.6版,增加了许多新的特性。该版本主要更新了Docker Registry、Engine、 Swarm、 Compose 和 Machine等方面。这次发布旨在提升性能、改善开发者和系统管理员的体验。让我们来快速看看有哪些新特性吧。 -**Docker Registry (2.0)**是一项推送Docker镜像用于存储和分享的服务,经历过架构的改变,因为面临加载下的体验问题。它仍然向下兼容。Docker Registry的编写语言现在从Python改为Google的Go语言了,为了提升表现力。与Docker引擎1.6结合后,拉取镜像的能力更快了。早先的镜像被队列式地输送,而现在是并行的啦。 +**Docker Registry (2.0)**是一项推送Docker镜像用于存储和分享的服务,因为面临加载下的体验问题而经历了架构的改变。它仍然向后兼容。Docker Registry的编写语言现在从Python改为Google的Go语言了,以提升性能。与Docker Engine 1.6结合后,拉取镜像的能力更快了。早先的镜像是队列式输送的,而现在是并行的啦。 -**Docker Engine (1.6)**相比之前的版本有很大的提高。目前支持容器与镜像标签。通过标签,你可以附加用户自定义的元数据到镜像和容器上,而镜像和容器反过来可以被其他工具使用。标签对正在运行的应用是不可见的,可以用来加速搜索容器和镜像。 +**Docker Engine (1.6)**相比之前的版本有很大的提高。目前支持容器与镜像的标签。通过标签,你可以附加用户自定义的元数据到镜像和容器上,而镜像和容器反过来可以被其他工具使用。标签对正在运行的应用是不可见的,可以用来加速搜索容器和镜像。 -Windows版本的Docker客户端可以连接一个远程的运行linux的Docker引擎。 +Windows版本的Docker客户端可以连接到远程的运行在linux上的Docker Engine。 Docker目前支持日志驱动API,这允许我们发送容器日志给系统如Syslog,或者第三方。这将会使得系统管理员受益。 -**Swarm (0.2)**是一个Docker集群工具,将一个Docker主机池转换为一个虚拟主机。在新特性里,容器甚至被放在了可用的节点上。通过添加更多的Docker命令,所有的努力都朝着支持完整的Docker API。将来,使用第三方驱动来集群会成为可能。 +**Swarm (0.2)**是一个Docker集群工具,可以将一个Docker主机池转换为一个虚拟主机。在新特性里,容器甚至被放在了可用的节点上。通过添加更多的Docker命令,努力支持完整的Docker API。将来,使用第三方驱动来集群会成为可能。 -**Compose (1.2)** 是一个Docker里定义和运行复杂应用的工具, 也得到了升级。在新版本里,一个可以创建多个子文件,而不是一个没有结构的文件描述一个多容器应用。 +**Compose (1.2)** 是一个Docker里定义和运行复杂应用的工具, 也得到了升级。在新版本里,可以创建多个子文件,而不是用一个没有结构的文件描述一个多容器应用。 -通过**Machine (0.2)**,我们可以很容易地在本地计算机,云和数据中心上搭建Docker主机。新的发行版为开发者提供了一个相对干净地驱动界面来写驱动。供应被Machine牢牢地掌握,而不是每个独立的驱动。新的命令被添加,可以用来生成主机的TLS证书,以提高安全性。 +通过**Machine (0.2)**,我们可以很容易地在本地计算机、云和数据中心上搭建Docker主机。新的发布版本为开发者提供了一个相对干净地驱动界面来编写驱动。Machine集中控制供给,而不是每个独立的驱动。增加了新的命令,可以用来生成主机的TLS证书,以提高安全性。 -### 在Fedora / CentOS 上升级架构 ### +### 在Fedora / CentOS 上的升级指导 ### 在这一部分里,我们将会学习如何在Fedora和CentOS上升级已有的docker到最新版本。请注意,目前的Docker仅运行在64位的架构上,Fedora和CentOS都源于RedHat,命令的使用是差不多相同的,除了在Fedora20和CentOS6.5里Docker包被叫做“docker-io”。 @@ -28,7 +28,7 @@ Docker目前支持日志驱动API,这允许我们发送容器日志给系统 在升级之前,备份一下docker镜像和容器卷是个不错的主意。 -参考[filesystem to a tar archive][1]与[volumes backups, restores or migrations options][2],获取更多信息。 +参考[“将文件系统打成 tar 包”][1]与[“卷备份、恢复或迁移”][2],获取更多信息。 目前,测试系统安装了Docker1.5。样例输出显示是来自一个Fedora20的系统。 @@ -42,7 +42,7 @@ Docker目前支持日志驱动API,这允许我们发送容器日志给系统 [root@TestNode1 ~]# sudo systemctl stop docker -升级到最新版使用yum update。但是写这篇文章的时候,仓库并不是最新版本(1.6)。因此你需要使用二进制的升级方法。 +使用yum update升级到最新版,但是写这篇文章的时候,仓库并不是最新版本(1.6),因此你需要使用二进制的升级方法。 [root@TestNode1 ~]#sudo yum -y update docker-io @@ -66,7 +66,7 @@ Docker目前支持日志驱动API,这允许我们发送容器日志给系统 2015-04-19 13:40:50 (8.72 MB/s) - /usr/bin/docker saved -检查更新版本 +检查更新后的版本 [root@TestNode1 ~]#sudo docker -v @@ -88,7 +88,7 @@ Docker目前支持日志驱动API,这允许我们发送容器日志给系统 Hello World -CentOS安装时需要**注意**,在CentOS上安装完Docker后,当你试图启动Docker服务的时候,你可能会得到错误的信息,如下所示 +CentOS安装时需要**注意**,在CentOS上安装完Docker后,当你试图启动Docker服务的时候,你可能会得到错误的信息,如下所示: docker.service - Docker Application Container Engine @@ -116,7 +116,7 @@ CentOS安装时需要**注意**,在CentOS上安装完Docker后,当你试图 Apr 20 03:24:24 centos7 systemd[1]: Unit docker.service entered failed state. -这是一个熟知的bug([https://bugzilla.redhat.com/show_bug.cgi?id=1207839][3]),需要一个设备映射的升级,到最新的水平。 +这是一个已知的bug([https://bugzilla.redhat.com/show_bug.cgi?id=1207839][3]),需要将设备映射升级到最新。 [root@centos7 ~]# rpm -qa device-mapper @@ -132,7 +132,7 @@ CentOS安装时需要**注意**,在CentOS上安装完Docker后,当你试图 ### 总结 ### -尽管docker技术出现时间不长,当很快获得了流行。它使得开发者的生活变得容易,运维团队可以快速独立地创建和部署应用。通过公司发布快速的Docker更新,来提升产品质量,满足用户需求,未来对于Docker来说一片光明。 +尽管docker技术出现时间不长,但很快就变得非常流行了。它使得开发者的生活变得轻松,运维团队可以快速独立地创建和部署应用。通过该公司的发布,Docker的快速更新,产品质量的提升,满足用户需求,未来对于Docker来说一片光明。 -------------------------------------------------------------------------------- @@ -140,7 +140,7 @@ via: http://linoxide.com/linux-how-to/docker-1-6-features-upgrade-fedora-centos/ 作者:[B N Poornima][a] 译者:[wi-cuckoo](https://github.com/wi-cuckoo) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 From 0d466bf52984661356b718820844073d24257920 Mon Sep 17 00:00:00 2001 From: joeren Date: Fri, 22 May 2015 07:58:56 +0800 Subject: [PATCH 123/965] Update 20150504 How to Install and Configure 'PowerDNS' (with MariaDB) and 'PowerAdmin' in RHEL or CentOS 7.md --- ...DNS' (with MariaDB) and 'PowerAdmin' in RHEL or CentOS 7.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150504 How to Install and Configure 'PowerDNS' (with MariaDB) and 'PowerAdmin' in RHEL or CentOS 7.md b/sources/tech/20150504 How to Install and Configure 'PowerDNS' (with MariaDB) and 'PowerAdmin' in RHEL or CentOS 7.md index e8974ba386..e9cef0f5f3 100644 --- a/sources/tech/20150504 How to Install and Configure 'PowerDNS' (with MariaDB) and 'PowerAdmin' in RHEL or CentOS 7.md +++ b/sources/tech/20150504 How to Install and Configure 'PowerDNS' (with MariaDB) and 'PowerAdmin' in RHEL or CentOS 7.md @@ -1,3 +1,4 @@ +Translating by GOLinux! How to Install and Configure ‘PowerDNS’ (with MariaDB) and ‘PowerAdmin’ in RHEL/CentOS 7 ================================================================================ PowerDNS is a DNS server running on many Linux/Unix derivatives. It can be configured with different backends including BIND style zone files, relational databases or load balancing/failover algorithms. It can also be setup as a DNS recursor running as a separate process on the server. @@ -420,4 +421,4 @@ via: http://www.tecmint.com/install-powerdns-poweradmin-mariadb-in-centos-rhel/ [a]:http://www.tecmint.com/author/marintodorov89/ [1]:http://downloads.powerdns.com/documentation/html/index.html [2]:http://www.tecmint.com/install-lamp-in-centos-7/ -[3]:https://github.com/poweradmin/poweradmin/wiki/Documentation \ No newline at end of file +[3]:https://github.com/poweradmin/poweradmin/wiki/Documentation From d6ee31b35c37ff1cffa2727e771fb9817e28249c Mon Sep 17 00:00:00 2001 From: GOLinux Date: Fri, 22 May 2015 10:31:01 +0800 Subject: [PATCH 124/965] [Translated]20150504 How to Install and Configure 'PowerDNS' (with MariaDB) and 'PowerAdmin' in RHEL or CentOS 7.md --- ...B) and 'PowerAdmin' in RHEL or CentOS 7.md | 228 +++++++++--------- 1 file changed, 113 insertions(+), 115 deletions(-) rename {sources => translated}/tech/20150504 How to Install and Configure 'PowerDNS' (with MariaDB) and 'PowerAdmin' in RHEL or CentOS 7.md (52%) diff --git a/sources/tech/20150504 How to Install and Configure 'PowerDNS' (with MariaDB) and 'PowerAdmin' in RHEL or CentOS 7.md b/translated/tech/20150504 How to Install and Configure 'PowerDNS' (with MariaDB) and 'PowerAdmin' in RHEL or CentOS 7.md similarity index 52% rename from sources/tech/20150504 How to Install and Configure 'PowerDNS' (with MariaDB) and 'PowerAdmin' in RHEL or CentOS 7.md rename to translated/tech/20150504 How to Install and Configure 'PowerDNS' (with MariaDB) and 'PowerAdmin' in RHEL or CentOS 7.md index e9cef0f5f3..0f7bc3d62f 100644 --- a/sources/tech/20150504 How to Install and Configure 'PowerDNS' (with MariaDB) and 'PowerAdmin' in RHEL or CentOS 7.md +++ b/translated/tech/20150504 How to Install and Configure 'PowerDNS' (with MariaDB) and 'PowerAdmin' in RHEL or CentOS 7.md @@ -1,46 +1,44 @@ -Translating by GOLinux! -How to Install and Configure ‘PowerDNS’ (with MariaDB) and ‘PowerAdmin’ in RHEL/CentOS 7 +RHEL/CentOS 7中安装并配置‘PowerDNS’(与MariaDB搭配)和‘PowerAdmin’ ================================================================================ -PowerDNS is a DNS server running on many Linux/Unix derivatives. It can be configured with different backends including BIND style zone files, relational databases or load balancing/failover algorithms. It can also be setup as a DNS recursor running as a separate process on the server. +PowerDNS是一个运行在许多Linux/Unix衍生版上的DNS服务器,它可以使用不同的后端进行配置,包括BIND类型的区域文件、相关的数据库,或者负载均衡/失效转移算法。它也可以被配置成一台DNS递归器,作为服务器上的一个独立进程运行。 -The latest version of PowerDNS Authoritative server is 3.4.4, but the one available in the EPEL repository right now is 3.4.3. I would recommend installing the one for the EPEL repository due to the fact that this version is tested in CentOS and Fedora. That way you will also be able to easily update PowerDNS in future. +PowerDNS授权服务器的最新版本是3.4.4,但是当前EPEL仓库中可以获得的版本是3.4.3。我推荐安装EPEL仓库中提供的那一个,因为该版本已经在CentOS和Fedora中测试过。那样,你也可以在今后很容易地更新PowerDNS。 -This article intends to show you how to install and setup master PowerDNS server with a MariaDB backend and the PowerAdmin – a friendly web interface managing tool for PowerDNS. +本文倾向于向你演示如何安装并配置以MariaDB作为后端的PowerDNS和 +出于本文的写作目的,我将使用以下服务器: -For the purpose of this article I will be using server with: + 主机名: centos7.localhost + IP地址: 192.168.0.102 - Hostname: centos7.localhost - IP Address 192.168.0.102 +### 步骤 1: 安装带有MariaDB后端的PowerDNS ### -### Step 1: Installing PowerDNS with MariaDB Backend ### - -#### 1. First you need to enable the EPEL repository for your server simply use: #### +#### 1. 首先,你需要为你的系统启用EPEL仓库,只需使用: #### # yum install epel-release.noarch ![Enable Epel Repository](http://www.tecmint.com/wp-content/uploads/2015/04/Enable-Epel-Repository.png) -Enable Epel Repository +启用Epel仓库 -#### 2. The next step is to install the MariaDB server. This can be easily done by running the following command: #### +#### 2. 下一步是安装MariaDB服务器。运行以下命令即可达成: #### # yum -y install mariadb-server mariadb ![Install MariaDB Server](http://www.tecmint.com/wp-content/uploads/2015/04/Install-MariaDB-Server.png) -Install MariaDB Server +安装MariaDB服务器 -#### 3. Next we will configure MySQL to enable and start upon system boot: #### +#### 3. 接下来,我们将配置并启用MySQL,并设置开机启动: #### # systemctl enable mariadb.service # systemctl start mariadb.service ![Enable Start MariaDB System Boot](http://www.tecmint.com/wp-content/uploads/2015/04/Enable-Start-MariaDB-System-Boot.png) -Enable Start MariaDB System Boot +启用MariaDB开机启动 -#### 4. Now that the MySQL service is running, we will secure and setup a password for MariaDB by running: #### +#### 4. 由于MySQL服务正在运行,我们将为MariaDB设置密码进行安全加固,运行以下命令: #### # mysql_secure_installation -#### Follow Instructions #### +#### 按照指示做 #### /bin/mysql_secure_installation: line 379: find_mysql_client: command not found @@ -104,33 +102,33 @@ Enable Start MariaDB System Boot Thanks for using MariaDB! -#### 5. Once MariaDB configuration done successfully, we can proceed further with the installation of PowerDNS. This is easily completed by running: #### +#### 5. MariaDB配置成功后,我们可以继续去安装PowerDNS。运行以下命令即可轻易完成: #### # yum -y install pdns pdns-backend-mysql ![Install PowerDNS with MariaDB Backend](http://www.tecmint.com/wp-content/uploads/2015/04/Install-PowerDNS-with-MariaDB-Backend.png) -Install PowerDNS with MariaDB Backend +安装带有MariaDB后端的PowerDNS -#### 6. The configuration file for PowerDNS is located in `/etc/pdns/pdns`, but before editing it, we will setup a MySQL database for PowerDNS service. First we will connect to the MySQL server and will create a database with name powerdns: #### +#### 6. PowerDNS的配置文件位于`/etc/pdns/pdns`,在编辑之前,我们将为PowerDNS服务配置一个MySQL数据库。首先,我们将连接到MySQL服务器并创建一个名为powerdns的数据库: #### # mysql -u root -p MariaDB [(none)]> CREATE DATABASE powerdns; ![Create PowerDNS Database](http://www.tecmint.com/wp-content/uploads/2015/04/Create-PowerDNS-Database.png) -Create PowerDNS Database +创建PowerDNS数据库 -#### 7. Next, we will create a database user called powerdns: #### +#### 7. 接下来,我们将创建一个名为powerdns的数据库用户: #### MariaDB [(none)]> GRANT ALL ON powerdns.* TO 'powerdns'@'localhost' IDENTIFIED BY ‘tecmint123’; MariaDB [(none)]> GRANT ALL ON powerdns.* TO 'powerdns'@'centos7.localdomain' IDENTIFIED BY 'tecmint123'; MariaDB [(none)]> FLUSH PRIVILEGES; ![Create PowerDNS User](http://www.tecmint.com/wp-content/uploads/2015/04/Create-PowerDNS-User.png) -Create PowerDNS User +创建PowerDNS用户 -**Note**: Replace “tecmint123” with the actual password that you want to use for your setup. +**注意**: 请将“tecmint123”替换为你想要设置的实际密码。 -#### 8. We proceed by creating the database tables used by PowerDNS. Execute those block by block: #### +#### 8. 我们继续创建PowerDNS要使用的数据库表。像堆积木一样执行以下这些: #### MariaDB [(none)]> USE powerdns; MariaDB [(none)]> CREATE TABLE domains ( @@ -145,7 +143,7 @@ Create PowerDNS User ); ![Create Table Domains for PowerDNS](http://www.tecmint.com/wp-content/uploads/2015/04/Create-Table-Domains-for-PowerDNS.png) -Create Table Domains for PowerDNS +创建用于PowerDNS的表域 MariaDB [(none)]> CREATE UNIQUE INDEX name_index ON domains(name); MariaDB [(none)]> CREATE TABLE records ( @@ -161,14 +159,14 @@ Create Table Domains for PowerDNS ); ![Create Index Domains for PowerDNS](http://www.tecmint.com/wp-content/uploads/2015/04/Create-Index-Domains-for-PowerDNS.png) -Create Index Domains for PowerDNS +创建用于PowerDNS的索引域 MariaDB [(none)]> CREATE INDEX rec_name_index ON records(name); MariaDB [(none)]> CREATE INDEX nametype_index ON records(name,type); MariaDB [(none)]> CREATE INDEX domain_id ON records(domain_id); ![Create Index Records](http://www.tecmint.com/wp-content/uploads/2015/04/Create-Records.png) -Create Index Records +创建索引记录 MariaDB [(none)]> CREATE TABLE supermasters ( ip VARCHAR(25) NOT NULL, @@ -177,24 +175,24 @@ Create Index Records ); ![Create Table Supermaster](http://www.tecmint.com/wp-content/uploads/2015/04/Create-Table-Supermaster.png) -Create Table Supermaster +创建表的超主 -You can now exit the MySQL console by typing: +你现在可以输入以下命令退出MySQL控制台: MariaDB [(none)]> quit; -#### 9. Finally we can proceed with configuring our PowerDNS in a way that, it will use MySQL as backend. For that purpose open PowerDNS configuration file located at: #### +#### 9. 最后,我们可以继续以MySQL作为后台的方式配置PowerDNS。请打开PowerDNS的配置文件: #### # vim /etc/pdns/pdns.conf -In that file look for the lines looking like this: +在该文件中查找像下面这样的行: ################################# # launch Which backends to launch and order to query them in # # launch= -Just after that put the following code: +在这后面放置以下代码: launch=gmysql gmysql-host=localhost @@ -202,101 +200,101 @@ Just after that put the following code: gmysql-password=user-pass gmysql-dbname=powerdns -Change “user-pass” with the actual password that you set earlier. Here is how my configuration looks like: +修改“user-pass”为你先前设置的实际密码,配置如下: ![Configure PowerDNS](http://www.tecmint.com/wp-content/uploads/2015/04/Configure-PowerDNS.png) -Configure PowerDNS +配置PowerDNS -Save your change and exit from. +保存修改并退出。 -#### 10. Now we will start and add PowerDNS to the list of services starting at system boot: #### +#### 10. 现在,我们将启动并添加PowerDNS到系统开机启动列表: #### # systemctl enable pdns.service # systemctl start pdns.service ![Enable and Start PowerDNS](http://www.tecmint.com/wp-content/uploads/2015/04/Enable-and-Start-PowerDNS.png) -Enable and Start PowerDNS +启用并启动PowerDNS -At this point your PowerDNS server is up and running. For more information about PowerDNS you can refer to the manual available at [http://downloads.powerdns.com/documentation/html/index.html][1] +到这一步,你的PowerDNS服务器已经起来并运行了。要获取更多关于PowerDNS的信息,你可以参考手册[http://downloads.powerdns.com/documentation/html/index.html][1] -### Step 2: Installing PowerAdmin to Manage PowerDNS ### +### 步骤 2: 安装PowerAdmin来管理PowerDNS ### -#### 11. Now we will install PowerAdmin – a friendly web interface designed to manager PowerDNS servers. Since it is written in PHP, we will need to install PHP and a web server (Apache): #### +#### 11. 现在,我们将安装PowerAdmin——一个友好的网页接口PowerDNS服务器管理器。由于它是用PHP写的,我们将需要安装PHP和一台网络服务器(Apache): #### # yum install httpd php php-devel php-gd php-imap php-ldap php-mysql php-odbc php-pear php-xml php-xmlrpc php-mbstring php-mcrypt php-mhash gettext ![Install Apache PHP](http://www.tecmint.com/wp-content/uploads/2015/04/Install-Apache-PHP.jpeg) -Install Apache PHP +安装Apache PHP -PowerAdmin also requires two PEAR packages: +PowerAdmin也需要两个PEAR包: # yum -y install php-pear-DB php-pear-MDB2-Driver-mysql ![Install Pear](http://www.tecmint.com/wp-content/uploads/2015/04/Install-Pear.jpeg) -Install Pear +安装Pear -You can also refer to the following article for complete instructions how to install LAMP stack in CentOS 7: +你也可以参考一下文章了解CentOS 7中安装LAMP堆栈的完整指南: -- [Install LAMP in CentOS 7][2] +- [CentOS 7中安装LAMP][2] -Once the install is complete, we will need to start and set Apache to start at system boot: +安装完成后,我们将需要启动并设置Apache开机启动: # systemctl enable httpd.service # systemctl start httpd.service ![Enable Start Apache System Boot](http://www.tecmint.com/wp-content/uploads/2015/04/Enable-Start-Apache-System-Boot.png) -Enable Start Apache System Boot +启用Apache开机启动 -#### 12. Now that all system requirements for running PowerAdmn are met, we can proceed and download the package. Since the default web directory for Apache is /var/www/html/, we will download the package in there. #### +#### 12. 由于已经满足PowerAdmin的所有系统要求,我们可以继续下载软件包。因为Apache默认的网页目录位于/var/www/html/,我们将下载软件包到这里。 #### # cd /var/www/html/ # wget http://downloads.sourceforge.net/project/poweradmin/poweradmin-2.1.7.tgz # tar xfv poweradmin-2.1.7.tgz ![Download PowerAdmin](http://www.tecmint.com/wp-content/uploads/2015/04/Download-PowerAdmin.jpeg) -Download PowerAdmin +下载PowerAdmin -#### 13. Now, we can now start the web installer of PowerAdmin. Simply open: #### +#### 13. 现在,我们可以启动PowerAdmin的网页安装器了,只需打开: #### http://192.168.0.102/poweradmin-2.1.7/install/ -This should bring the first step of the installation: +这会进入安装过程的第一步: ![Select Installation Language](http://www.tecmint.com/wp-content/uploads/2015/04/Select-Installation-Language.png) -Select Installation Language +选择安装语言 -The above page will ask you to choose the language for your PowerAdmin. Select the one you wish to use and click the “Go to step 2” button. +上面的页面会要求你为PowerAdmin选择语言,请选择你想要使用的那一个,然后点击“进入步骤 2”按钮。 -#### 14. The installer will expect you to have a PowerDNS database: #### +#### 14. 安装器需要PowerDNS数据库: #### ![PowerDNS Database](http://www.tecmint.com/wp-content/uploads/2015/04/PowerDNS-Database.png) -PowerDNS Database +PowerDNS数据库 -#### 15. Since we already created one, we can proceed to the next step. You will be asked to enter the database details you setup earlier. You will also need to setup Poweradmin administrator password: #### +#### 15. 因为我们已经创建了一个,所以我们可以继续进入下一步。你会被要求提供先前配置的数据库详情,你也需要为Poweradmin设置管理员密码: #### ![Enter PowerDNS Database Settings](http://www.tecmint.com/wp-content/uploads/2015/04/PowerDNS.png) -Enter PowerDNS Database Settings +输入PowerDNS数据库配置 -#### 16. Once you have input those, go to step 4. You will create a new user with a limited rights for Poweradmin. The fields that you need to enter here are: #### +#### 16. 输入这些信息后,进入步骤 4。你将创建为Poweradmin创建一个受限用户。这里你需要输入的字段是: #### -- Username - username for hte PowerAdmin. -- Password – password for the above user. -- Hostmaster - When creating SOA records and you have not specified hostmaster, this value will be used. -- Secondary nameserver – the value will be used as primary name server when creating new DNS zones. +- 用户名 - PowerAdmin用户名。 +- 密码 – 上述用户的密码。 +- 注册人 - 当创建SOA记录而你没有制定注册人时,该值会被使用。 +- 辅助域名服务器 – 该值在创建新的DNS区域时会被用于作为主域名服务器。 ![PowerDNS Configuration Settings](http://www.tecmint.com/wp-content/uploads/2015/04/PowerDNS-Configuration-Settings.png) -PowerDNS Configuration Settings +PowerDNS配置设置 -#### 17. On the next step Poweradmin will ask you to create new database user with limited rights on the database tables. It will provide you with the code that you will need to put in a MySQL console: #### +#### 17. 在下一步中,Poweradmin会要求你在数据库表中创建新的受限数据库用户,它会提供你需要在MySQL控制台输入的代码: #### ![Create New Database User](http://www.tecmint.com/wp-content/uploads/2015/04/Create-New-Database-User.png) -Create New Database User +创建新的数据库用户 -#### 18. Now open a terminal and run: #### +#### 18. 现在打开终端并运行: #### # mysql -u root -p -Provide your password and execute the code provided by Poweradmin: +提供你的密码并执行由Poweradmin提供的代码: MariaDB [(none)]> GRANT SELECT, INSERT, UPDATE, DELETE ON powerdns.* @@ -304,116 +302,116 @@ Provide your password and execute the code provided by Poweradmin: IDENTIFIED BY '123qweasd'; ![Grant Mysql Permissions to User](http://www.tecmint.com/wp-content/uploads/2015/04/Grant-Mysql-Permissions-to-User.png) -Grant Mysql Permissions to User +为用户授予Mysql权限 -#### 19. Now go back to your browser and proceed to the next step. The installer will attempt to create its configuration file in /var/www/html/poweradmin-2.1.7/inc. #### +#### 19. 现在,回到浏览器中并继续下一步。安装器将尝试创建配置文件到/var/www/html/poweradmin-2.1.7/inc。 #### -The file name is config.inc.php. In case the script is not able to write that file you can create it manually by copying the text and putting it in above mentioned file: +文件名是config.inc.php。为防止该脚本没有写权限,你可以手动复制这些内容到上述文件中: ![Configuration Settings of PowerDNS](http://www.tecmint.com/wp-content/uploads/2015/04/PowerDNS-Configuration.png) -Configuration Settings of PowerDNS +配置PowerDNS设置 -#### 20. Now go to the last page where you will be informed that the installation is complete and will receive information how to access your Poweradmin install: #### +#### 20. 现在,进入最后页面,该页面会告知你安装已经完成以及如何访问安装好的Poweradmin: #### ![PowerDNS Installation Completed](http://www.tecmint.com/wp-content/uploads/2015/04/PowerDNS-Installation-Completed.png) -PowerDNS Installation Completed +PowerDNS安装完成 -You can enable URLs used by other dynamic DNS providers by running: +你可以通过运行以下命令来启用其他动态DNS提供商的URL: # cp install/htaccess.dist .htaccess -For that purpose you will need to have mod_rewrite enabled in Apache’s configuration. +出于该目的,你将需要在Apache的配置中启用mod_rewrite。 -#### 21. Now it is important to remove the “install” folder from Poweradmin’s root directory with the following command: #### +#### 21. 现在,需要移除从Poweradmin的根目录中移除“install”文件夹,这一点很重要。使用以下命令: #### # rm -fr /var/www/html/poweradmin/install/ -After that you can access your poweradmin at: +在此之后,你可以通过以下方式访问PowerAdmin: http://192.168.0.102/poweradmin-2.1.7/ ![PowerDNS Login](http://www.tecmint.com/wp-content/uploads/2015/04/PowerDNS-Login.png) -PowerDNS Login +PowerDNS登录 -After logging you should see the Poweradmin main page: +在登录后,你应该会看到Poweradmin的主页: ![PowerDNS Dashboard](http://www.tecmint.com/wp-content/uploads/2015/04/PowerDNS-Dashboard.png) -PowerDNS Dashboard +PowerDNS仪表盘 -At this point your installation is complete and you are now ready to start managing your DNS zones. +到这里,安装已经完成了,你也可以开始管理你的DNS区域了。 -### Step 3: How to Add, Edit and Delete DNS Zones in PowerDNS ### +### 步骤 3: PowerDNS中添加、编辑和删除DNS区域 ### -#### 22. To add new master zone, simply click on the “Add master zone”: #### +#### 22. 要添加新的主区域,只需点击“添加主区域”: #### ![Add Master Zone](http://www.tecmint.com/wp-content/uploads/2015/04/Add-Master-Zone.png) -Add Master Zone +添加主区域 -On the next page there are few things that you need to fill: +在下一页中,你需要填写一些东西: -- Domain – domain for which you will be adding the zone. -- Owner – sets the owner of the DNS zone. -- Template – DNS template – leave to none. -- DNSSEC – Donany Name System Security Extensions (optional -check if you need it). +- 域 – 你要添加区域的域。 +- 所有者 – 设置DNS区域的所有者。 +- 模板 – DNS模板 – 留空。 +- DNSSEC – Donany名称系统安全扩展(可选——检查你是否需要)。 -Click the “Add zone” button to add the DNS zone. +点击“添加区域”按钮来添加DNS区域。 ![Master DNS Zone](http://www.tecmint.com/wp-content/uploads/2015/04/Master-DNS-Zone.png) -Master DNS Zone +主DNS区域 -Now you can go back to the index page of Poweradmin by clicking the “Index” link. To review all existing DNS zones simply go to “List zones”: +现在,你可以点击“首页”链接回到Poweradmin的首页。要查看所有现存的DNS区域,只需转到“列出区域”: ![Check List of Zones](http://www.tecmint.com/wp-content/uploads/2015/04/Check-List-Zones.png) -Check List of Zones +检查区域列表 -You should now see a list of available DNS zones: +你现在应该看到一个可用DNS区域列表: ![Check List of DNS Zones](http://www.tecmint.com/wp-content/uploads/2015/04/DNS-Zones.png) -Check List of DNS Zones +检查DNS区域列表 -#### 23. To edit an existing DNS zone or add new records click the edit icon: #### +#### 23. 要编辑现存DNS区域或者添加新的记录,点击编辑图标: #### ![Edit DNS Zone](http://www.tecmint.com/wp-content/uploads/2015/04/Edit-DNS-Zone.png) -Edit DNS Zone +编辑DNS区域 -On the next page you will see the entries for the DNS zone you have chosen: +在接下来的页面,你会看到你选择的DNS区域的条目: ![Domain DNS Zone Entries](http://www.tecmint.com/wp-content/uploads/2015/04/Domain-DNS.png) -Domain DNS Zone Entries +主DNS区域条目 -#### 24. In here to add new DNS zone you will need to set the following information: #### +#### 24. 在此处添加新的DNS区域,你需要设置以下信息: #### -- Name – name for the entry. Only add the first part of the domain/subdomain, the rest will be added by Poweradmin. -- Type – choose the record type. -- Priority – priority of the record. -- TTL – Time To Live in seconds. +- 名称 – 条目名称。只需添加域/子域的第一部分,Poweradmin会添加剩下的。 +- 类型 – 选择记录类型。 +- 优先级 – 记录优先级。 +- TTL – 存活时间,以秒计算。 -For the purpose of this article, I will add an A record for subdomain new.example.com that will resolve on IP address 192.168.0.102 with time to live 14400 seconds: +出于本文目的,我将为子域new.example.com添加一个A记录用于解析IP地址192.168.0.102,设置存活时间为14400秒: ![Add New DNS Record](http://www.tecmint.com/wp-content/uploads/2015/04/Add-New-DNS-Record.png) -Add New DNS Record +添加新DNS记录 -Finally click the “Add record” button. +最后,点击“添加记录”按钮。 -#### 25. If you wish to delete a DNS zone you can go back to the “List zone” page and click on the “Trash” icon next to the DNS zone which you wish to delete: #### +#### 25. 如果你想要删除DNS区域,你可以回到“列出区域”页面,然后点击你想要删除的DNS区域旁边“垃圾桶”图标: #### ![Delete DNS Zone](http://www.tecmint.com/wp-content/uploads/2015/04/Delete-DNS-Zone.png) -Delete DNS Zone +删除DNS区域 -Poweradmin will ask you if you are sure you want to delete the DNS zone. Simply click “Yes” to finish the deletion. +Poweradmin将问你是否确定想要删除DNS区域。只需点击“是”来完成删除。 -For more detailed instructions how to create, edit and delete zones you can refer to Poweradmin’s documentation at: +如要获取更多关于怎样创建、编辑和删除区域的说明,你可以参与Poweradmin的文档: [https://github.com/poweradmin/poweradmin/wiki/Documentation][3] -I hope you have find this article interesting and useful. As always if you have any questions or comments please do not hesitate to submit them in the comment section below. +我希望你已经发现本文很有趣,也很有用。一如既往,如果你有问题或要发表评论,请别犹豫,在下面评论区提交你的评论吧。 -------------------------------------------------------------------------------- via: http://www.tecmint.com/install-powerdns-poweradmin-mariadb-in-centos-rhel/ 作者:[Marin Todorov][a] -译者:[译者ID](https://github.com/译者ID) +译者:[GOLinux](https://github.com/GOLinux) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 From 9622b4e0103ecc37717801a2aa2ae271743d33e7 Mon Sep 17 00:00:00 2001 From: wwy-hust Date: Fri, 22 May 2015 12:34:30 +0800 Subject: [PATCH 125/965] finished translation and review --- ...irectory with Samba on Fedora or CentOS.md | 146 ------------------ ...irectory with Samba on Fedora or CentOS.md | 144 +++++++++++++++++ 2 files changed, 144 insertions(+), 146 deletions(-) delete mode 100644 sources/tech/20150318 How to share a directory with Samba on Fedora or CentOS.md create mode 100644 translated/tech/20150318 How to share a directory with Samba on Fedora or CentOS.md diff --git a/sources/tech/20150318 How to share a directory with Samba on Fedora or CentOS.md b/sources/tech/20150318 How to share a directory with Samba on Fedora or CentOS.md deleted file mode 100644 index 1013b58759..0000000000 --- a/sources/tech/20150318 How to share a directory with Samba on Fedora or CentOS.md +++ /dev/null @@ -1,146 +0,0 @@ -translating by wwy-hust - -How to share a directory with Samba on Fedora or CentOS -================================================================================ -Nowadays sharing data across different computers is not something new at home or many work places. Riding on this trend, modern operating systems make it easy to share and exchange data transparently across computers via network file systems. If your work environment involves a mix of Microsoft Windows and Linux computers, one way to share files and folders among them is via SMB/CIFS, a cross-platform network file sharing protocol. Windows Microsoft natively supports SMB/CIFS, while Linux offers free software implementation of SMB/CIFS network protocol in Samba. - -In this article, we will demonstrate **how to share a directory using Samba**. The Linux platform we will use is **Fedora or CentOS**. This article is dividied into four parts. First, we will install Samba under Fedora/CentOS environment. Next, we discuss how to adjust SELinux and firewall configurations to allow file sharing with Samba. Finally, we cover how to enable Samba to share a directory. - -### Step One: Install Samba on Fedora or CentOS ### - -First thing first. Let's install Samba and configure basic settings. - -Check whether Samba application is already installed on your system by running: - - $ rpm -q samba samba-common samba-client - -If the above command doesn't show anything at all, it means that Samba is not installed. In that case, install Samba using the command below. - - $ sudo yum install samba samba-common samba-client - -Next, creates a local directory which will share data over network. This directory will be exported to remote users as a Samba share. In this tutorial, we will create this directory in the top-level directory '/', so make sure that you have the privileges to do it. - - $ sudo mkdir /shared - -If you want to create a shared directory inside your home directory (e.g., ~/shared), you must activate Samba home directory sharing in the SELinux options, which will be described below in more detail. - -After creating /shared directory, set the privileges of the directory so other users can access it. - - $ sudo chmod o+rw /shared - -If you don't want other users to be able to have write to the directory, just remove the 'w' option in chmod command as follows. - - $ sudo chmod o+r /shared - -Next, create one empty file as a test. This file will be used to verify that he Samba share is mounted properly. - - $ sudo touch /shared/file1 - -### Step Two: Configure SELinux for Samba ### - -Next, we need to re-configure SELinux which is enabled by default in Fedora and CentOS distributions. SELinux allows Samba to read and modify files or directories only when they have the right security context (e.g., labeled with the 'samba_share_t' attribute). - -The following command adds the necessary label to file-context configuration: - - $ sudo semanage fcontext -a -t samba_share_t "(/.*)?" - -Replace the with the local directory we created earlier for Samba share (e.g., /shared): - - $ sudo semanage fcontext -a -t samba_share_t "/shared(/.*)?" - -To activate the label change, we then must run the restorecon command like below. - - $ sudo restorecon -R -v /shared - -![](https://farm9.staticflickr.com/8584/16652774078_2055f45f70_b.jpg) - -To share a directory inside our home directory via Samba, we must enable sharing home directory option in SELinux because it is disabled by default. The following command achieves the desired effect. Skip this step if you are not sharing your home directory. - - $ sudo setsebool -P samba_enable_home_dirs 1 - -### Step Three: Configure Firewall for Samba ### - -The next step is to open necessary TCP/UDP ports in the firewall settings for Samba to operate. - -If you are using firewalld (e.g., on Fedora or CentOS 7), the following command will take care of permanent firewall rule change for Samba service. - - $ sudo firewall-cmd --permanent --add-service=samba - -If you are using iptables for your firewall (e.g., CentOS 6 or earlier), use the following commands to open up necessary Samba ports to the world. - - $ sudo vi /etc/sysconfig/iptables - ----------- - - -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 445 -j ACCEPT - -A RH-Firewall-1-INPUT -m state --state NEW -m udp -p udp --dport 445 -j ACCEPT - -A RH-Firewall-1-INPUT -m state --state NEW -m udp -p udp --dport 137 -j ACCEPT - -A RH-Firewall-1-INPUT -m state --state NEW -m udp -p udp --dport 138 -j ACCEPT - -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 139 -j ACCEPT - -Then restart iptables service: - - $ sudo service iptables restart - -### Step Four: Change Samba Configuration ### - -The last step is to configure Samba to export a created local directory as a Samba-share. - -Open the Samba configuration file with a text editor, and add the following lines at the bottom of the file. - - $ sudo nano /etc/samba/smb.conf - ----------- - - [myshare] - comment=my shared files - path=/shared - public=yes - writeable=yes - -In the above the text inside a pair of brackets (e.g., "myshare") is the name of the Samba-shared resource, which will be used to access the Samba share from a remote host. - -Create a Samba user account which is required to mount and export the Samba file system. To create a Samba user, use the smbpasswd tool. Note that the Samba user account must be the same as any existing Linux user. If you try to add a non-existing user with smbpasswd, it will give an error message. - -If you don't want to use any existing Linux user as a Samba user, you can create a new dedicated user in your system. For safety, set the new user's login shell to /sbin/nologin, and do not create its home directory. - -In this example, we are creating a new user named "sambaguest" as follows. - - $ sudo useradd -M -s /sbin/nologin sambaguest - $ sudo passwd sambaguest - -![](https://farm9.staticflickr.com/8702/16814479366_53f540d3ba_b.jpg) - -After creating a new user, add the user as a Samba user using smbpasswd command. When this command asks a password, you can type a different password than the user's password. - - $ sudo smbpasswd -a sambaguest - -4. Activate the Samba service, and check whether the Samba service is running or not. - - $ sudo systemctl enable smb.service - $ sudo systemctl start smb.service - $ sudo systemctl is-active smb - -![](https://farm8.staticflickr.com/7607/16652984770_622f24bccc_b.jpg) - -To see the list of shared directories in Samba, type the following command. - - $ smbclient -U sambaguest -L localhost - -![](https://farm8.staticflickr.com/7281/16220411103_06bf585901_b.jpg) - -The following is a screenshot of accessing the Samba-shared directory on Thunar file manager, and doing copy-paste of file1. Note that the Samba share is accessible via "smb:///myshare" address on Thunar. - -![](https://farm8.staticflickr.com/7644/16218011174_c8b34fcedc_b.jpg) - --------------------------------------------------------------------------------- - -via: http://xmodulo.com/share-directory-samba-fedora-centos.html - -作者:[Kristophorus Hadiono][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/kristophorus diff --git a/translated/tech/20150318 How to share a directory with Samba on Fedora or CentOS.md b/translated/tech/20150318 How to share a directory with Samba on Fedora or CentOS.md new file mode 100644 index 0000000000..901fbf603e --- /dev/null +++ b/translated/tech/20150318 How to share a directory with Samba on Fedora or CentOS.md @@ -0,0 +1,144 @@ +FedoraCentOSʹSambaļ +================================================================================ +ڼǰ칫ͬĵ֮乲ļѲʲôˡ£ִϵͳͨļϵͳķʽʹõԼݵĽü򵥶͸Ļм΢WindowsLinuxôһļĿ¼ķʽͨһƽ̨ļЭ,SMB/CIFSWindowsȻ֧SMB/CIFSLinuxҲͨԴSambaʵSMB/CIFSЭ顣 + +ƪУǽչʾ**ʹSambaļ**ʹõLinuxƽ̨**FedoraCentOS**ƪ·ΪIJ֡ȣFedora/CentOS°װSambeţεSELinuxͷǽSambaļǽʹSambaļС + +### 1FedoraCentOSϰװSamba ### + +ȣװSambaԼһЩá + +SambaǷѾװϵͳУ + + $ rpm -q samba samba-common samba-client + +ûκζSambaδװʱӦʹװSamba + + $ sudo yum install samba samba-common samba-client + +һйıļСļӦSambaķʽԶ̵ûָУǻڶļ'/'дļУˣȷӦȨޡ + + $ sudo mkdir /shared + +homeļڴļУ磬~/shared뼤SELinuxSambahomeļйѡ彫ںᵽ + +ڴ/sharedļкļȨԱ֤ûԷ + + $ sudo chmod o+rw /shared + +ûԸļӵдȨޣҪƳе'w'ѡ + + $ sudo chmod o+r /shared + +һļԡļԱ֤SambaĹѾء + + $ sudo touch /shared/file1 + +### 2ΪSambaSELinux ### + +ҪٴSELinuxFedoraCentOSаSELinuxĬϿġSELinuxȷİȫ²Sambaȡ޸ļļС磬'samba_share_t'Աǩ + +ΪļӱҪıǩ + + $ sudo semanage fcontext -a -t samba_share_t "(/.*)?" + +滻Ϊ֮ǰΪSambaıļУ磬/shared + + $ sudo semanage fcontext -a -t samba_share_t "/shared(/.*)?" + +DZִrestorecon޸ĵıǩ£ + + $ sudo restorecon -R -v /shared + +![](https://farm9.staticflickr.com/8584/16652774078_2055f45f70_b.jpg) + +ΪͨSambahomeļڵļУDZSELinuxпhomeļеѡѡĬϱرաܴﵽЧδhomeļУôò衣 + + $ sudo setsebool -P samba_enable_home_dirs 1 + +### 3ΪSamba÷ǽ ### + +򿪷ǽSambaΪҪTCP/UDP˿ڡ + +ʹfirewalld磬FedoraCentOS7£õ޸Sambaصķǽ + + $ sudo firewall-cmd --permanent --add-service=samba + +ڷǽʹiptables磬CentOS6߸İ汾ʹSambaҪĶ˿ڡ + + $ sudo vi /etc/sysconfig/iptables + +---------- + + -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 445 -j ACCEPT + -A RH-Firewall-1-INPUT -m state --state NEW -m udp -p udp --dport 445 -j ACCEPT + -A RH-Firewall-1-INPUT -m state --state NEW -m udp -p udp --dport 137 -j ACCEPT + -A RH-Firewall-1-INPUT -m state --state NEW -m udp -p udp --dport 138 -j ACCEPT + -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 139 -j ACCEPT + +Ȼiptables + + $ sudo service iptables restart + +### 4Samba ### + +IJSambaԽļеΪSambaļС + +ʹļ༭Sambaļӵļĩβ + + $ sudo nano /etc/samba/smb.conf + +---------- + + [myshare] + comment=my shared files + path=/shared + public=yes + writeable=yes + +ڵı磬"myshare"SambaԴ֣ԶȡSamba + +Sambaûʻǹغ͵SambaļϵͳġǿʹsmbpasswdһSambaûע⣬SambaûʻLinuxûѴڵġʹsmbpasswdһڵû᷵һϢ + +ʹκѴڵLinuxûΪSambaûϵͳдһµûΪȫûĵ¼űΪ/sbin/nologinҲûhomeļС + +Уڴһ"sambaguest"û£ + + $ sudo useradd -M -s /sbin/nologin sambaguest + $ sudo passwd sambaguest + +![](https://farm9.staticflickr.com/8702/16814479366_53f540d3ba_b.jpg) + +ڴһûʹsmbpasswdSambaûѯһʱԼһͬڸû롣 + + $ sudo smbpasswd -a sambaguest + +4. Samba񣬲SambaǷС + + $ sudo systemctl enable smb.service + $ sudo systemctl start smb.service + $ sudo systemctl is-active smb + +![](https://farm8.staticflickr.com/7607/16652984770_622f24bccc_b.jpg) + +ʹ鿴Sambaйļб + + $ smbclient -U sambaguest -L localhost + +![](https://farm8.staticflickr.com/7281/16220411103_06bf585901_b.jpg) + +ThunarļдȡSambaļԼfile1пƵĽͼע⣬SambaĹݿͨThunarͨ"smb:///myshare"ַȡ + +![](https://farm8.staticflickr.com/7644/16218011174_c8b34fcedc_b.jpg) + +-------------------------------------------------------------------------------- + +via: http://xmodulo.com/share-directory-samba-fedora-centos.html + +ߣ[Kristophorus Hadiono][a] +ߣ[wwy-hust](https://github.com/wwy-hust) +Уԣ[УID](https://github.com/УID) + + [LCTT](https://github.com/LCTT/TranslateProject) ԭ룬[Linuxй](http://linux.cn/) Ƴ + +[a]:http://xmodulo.com/author/kristophorus From 02fd3bdc581a4a4c284c81f1645230ffbb94f692 Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 22 May 2015 12:46:17 +0800 Subject: [PATCH 126/965] translating --- ...crosoft Open-Sources The Windows Communication Foundation.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/news/20150521 Microsoft Open-Sources The Windows Communication Foundation.md b/sources/news/20150521 Microsoft Open-Sources The Windows Communication Foundation.md index 37c5f189d2..927e42b021 100644 --- a/sources/news/20150521 Microsoft Open-Sources The Windows Communication Foundation.md +++ b/sources/news/20150521 Microsoft Open-Sources The Windows Communication Foundation.md @@ -1,3 +1,5 @@ +Translating---geekpi + Microsoft Open-Sources The Windows Communication Foundation ================================================================================ Microsoft has today announced they've open-sourced the important WCF (Windows Communication Foundation) code that now targets .NET Core. From 05d2af76e0bf56580734fed8711978c82338a445 Mon Sep 17 00:00:00 2001 From: wxy Date: Fri, 22 May 2015 13:02:46 +0800 Subject: [PATCH 127/965] PUB:20150417 How to Configure MariaDB Replication on CentOS Linux @ictlyh --- ...ure MariaDB Replication on CentOS Linux.md | 60 ++++++++++--------- 1 file changed, 32 insertions(+), 28 deletions(-) rename {translated/tech => published}/20150417 How to Configure MariaDB Replication on CentOS Linux.md (82%) diff --git a/translated/tech/20150417 How to Configure MariaDB Replication on CentOS Linux.md b/published/20150417 How to Configure MariaDB Replication on CentOS Linux.md similarity index 82% rename from translated/tech/20150417 How to Configure MariaDB Replication on CentOS Linux.md rename to published/20150417 How to Configure MariaDB Replication on CentOS Linux.md index ca27084edf..702d3d7521 100644 --- a/translated/tech/20150417 How to Configure MariaDB Replication on CentOS Linux.md +++ b/published/20150417 How to Configure MariaDB Replication on CentOS Linux.md @@ -1,22 +1,26 @@ -如何在 CentOS Linux 中配置 MariADB 复制 +如何在 CentOS Linux 中配置 MariaDB 复制 ================================================================================ -这是一个创建数据库重复版本的过程。复制过程不仅仅是复制一个数据库,同时也包括从主节点到一个从节点的更改同步。但这并不意味着从数据库就是和主数据库完全相同的副本,因为复制可以配置为只有表或者行或者列的一个模式将被复制,例如,局部复制。复制保证了特定的配置对象在不同的数据库之间保持同步。 +这是一个创建数据库重复版本的过程。复制过程不仅仅是复制一个数据库,同时也包括从主节点到一个从节点的更改同步。但这并不意味着从数据库就是和主数据库完全相同的副本,因为复制可以配置为只复制表结构、行或者列,这叫做局部复制。复制保证了特定的配置对象在不同的数据库之间保持一致。 ### Mariadb 复制概念 ### -**备份** :复制可以用来进行数据库备份。例如,你有主->从复制。如果主节点丢失(比如hdd损坏),你可以从从节点中恢复你的数据库。 +**备份** :复制可以用来进行数据库备份。例如,当你做了主->从复制。如果主节点数据丢失(比如硬盘损坏),你可以从从节点中恢复你的数据库。 -**扩展** :你可以使用主->从复制作为扩展的解决方案。例如,如果你有一些大的数据库以及SQL查询,使用复制你可以将这些查询单独分到每个复制节点。写SQL应该只在主节点进行,而只读查询可以在从节点上进行。 +**扩展** :你可以使用主->从复制作为扩展解决方案。例如,如果你有一些大的数据库以及SQL查询,使用复制你可以将这些查询分离到每个复制节点。写入操作的SQL应该只在主节点进行,而只读查询可以在从节点上进行。 -**传播解决方案** :你可以用复制来进行分发。例如,你可以将不同的销售数据分发到不同的数据库。 +**分发解决方案** :你可以用复制来进行分发。例如,你可以将不同的销售数据分发到不同的数据库。 -**故障解决方案** : 假如你有主节点->从节点1->从节点2->从节点3的复制。你可以为主节点写脚本监控,如果主节点出故障了,脚本可以快速的将从节点1作为新的主节点,有主节点->从节点1->从节点2,你的应用可以继续工作而不会停机。 +**故障解决方案** : 假如你建立有主节点->从节点1->从节点2->从节点3的复制结构。你可以为主节点写脚本监控,如果主节点出故障了,脚本可以快速的将从节点1切换为新的主节点,这样复制结构变成了主节点->从节点1->从节点2,你的应用可以继续工作而不会停机。 ### 复制的简单图解示范 ### ![mysql 复制原理](http://blog.linoxide.com/wp-content/uploads/2015/04/mysql-replication-principle.png) -开始之前,你应该知道什么是**二进制日志文件**以及 Ibdata1。二进制日志文件中包括关于数据库,数据和结构的所有更改的记录,以及每条语句的执行时间。二进制日志文件包括设置日志文件和一个索引。这意味着主要的SQL语句,例如CREATE, ALTER, INSERT, UPDATE 和 DELETE 会放到这个日志文件中,而例如SELECT语句就不会被记录。这些信息可以被记录到普通的query.log文件。简单的说 **Ibdata1** 是一个包括所有表和所有数据库信息的文件。 +开始之前,你应该知道什么是**二进制日志文件**以及 Ibdata1。 + +二进制日志文件中包括关于数据库,数据和结构的所有更改的记录,以及每条语句的执行了多长时间。二进制日志文件包括一系列日志文件和一个索引文件。这意味着主要的SQL语句,例如CREATE, ALTER, INSERT, UPDATE 和 DELETE 会放到这个日志文件中;而例如SELECT这样的语句就不会被记录,它们可以被记录到普通的query.log文件中。 + +而 **Ibdata1** 简单的说据是一个包括所有表和所有数据库信息的文件。 ### 主服务器配置 ### @@ -39,7 +43,7 @@ sudo systemctl start mariadb.service sudo systemctl enable mariadb.service -输出: +输出如下: ln -s '/usr/lib/systemd/system/mariadb.service' '/etc/systemd/system/multi-user.target.wants/mariadb.service' @@ -51,7 +55,7 @@ sudo systemctl is-active mariadb.service -输出: +输出如下: Redirecting to /bin/systemctl status mariadb.service mariadb.service - MariaDB database server @@ -65,11 +69,11 @@ mysql> flush privileges; mysql> exit -SOME_ROOT_PASSWORD - 你的 root 密码。 例如我用"q"作为密码,然后尝试登陆: +这里 SOME_ROOT_PASSWORD 是你的 root 密码。 例如我用"q"作为密码,然后尝试登录: sudo mysql -u root -pSOME_ROOT_PASSWORD -输出: +输出如下: Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 5 @@ -89,7 +93,7 @@ SOME_ROOT_PASSWORD - 你的 root 密码。 例如我用"q"作为密码,然后 test_repl - 将要被复制的模式的名字 -输出: +输出:如下 Query OK, 1 row affected (0.00 sec) @@ -105,7 +109,7 @@ SOME_ROOT_PASSWORD - 你的 root 密码。 例如我用"q"作为密码,然后 City varchar(255) ); -输出: +输出如下: mysql> MariaDB [test_repl]> CREATE TABLE Persons ( -> PersonID int, @@ -124,7 +128,7 @@ SOME_ROOT_PASSWORD - 你的 root 密码。 例如我用"q"作为密码,然后 mysql> INSERT INTO Persons VALUES (4, "LastName4", "FirstName4", "Address4", "City4"); mysql> INSERT INTO Persons VALUES (5, "LastName5", "FirstName5", "Address5", "City5"); -输出: +输出如下: Query OK, 5 row affected (0.00 sec) @@ -132,7 +136,7 @@ SOME_ROOT_PASSWORD - 你的 root 密码。 例如我用"q"作为密码,然后 mysql> select * from Persons; -输出: +输出如下: +----------+-----------+------------+----------+-------+ | PersonID | LastName | FirstName | Address | City | @@ -145,9 +149,9 @@ SOME_ROOT_PASSWORD - 你的 root 密码。 例如我用"q"作为密码,然后 | 5 | LastName5 | FirstName5 | Address5 | City5 | +----------+-----------+------------+----------+-------+ -### 配置 MariaDB 重复 ### +### 配置 MariaDB 复制 ### -你需要在主结点服务器上编辑 my.cnf文件来启用二进制日志以及设置服务器id。我会使用vi文本编辑器,但你可以使用任何你喜欢的,例如nano,joe。 +你需要在主节点服务器上编辑 my.cnf文件来启用二进制日志以及设置服务器id。我会使用vi文本编辑器,但你可以使用任何你喜欢的,例如nano,joe。 sudo vi /etc/my.cnf @@ -159,7 +163,7 @@ SOME_ROOT_PASSWORD - 你的 root 密码。 例如我用"q"作为密码,然后 binlog-format=row server_id=1 -输出: +输出如下: ![mariadb 配置主节点](http://blog.linoxide.com/wp-content/uploads/2015/04/mariadb-config.png) @@ -173,7 +177,7 @@ sudo mysql -u root -pq test_repl mysql> SHOW MASTER STATUS; -输出: +输出如下: +--------------------+----------+--------------+------------------+ | File | Position | Binlog_Do_DB | Binlog_Ignore_DB | @@ -183,12 +187,12 @@ mysql> SHOW MASTER STATUS; **记住** : "File" 和 "Position" 的值。在从节点中你需要使用这些值 -创建用来重复的用户 +创建用来复制的用户 mysql> GRANT REPLICATION SLAVE ON *.* TO replication_user IDENTIFIED BY 'bigs3cret' WITH GRANT OPTION; mysql> flush privileges; -输出: +输出如下: Query OK, 0 rows affected (0.00 sec) Query OK, 0 rows affected (0.00 sec) @@ -197,7 +201,7 @@ mysql> SHOW MASTER STATUS; mysql> select * from mysql.user WHERE user="replication_user"\G; -输出: +输出如下: mysql> select * from mysql.user WHERE user="replication_user"\G; *************************** 1. row *************************** @@ -220,11 +224,11 @@ mysql> SHOW MASTER STATUS; ### 从节点配置 ### -所有这些命令需要在从节点中进行 +所有这些命令需要在从节点中进行。 -假设我们已经更新/升级了包括有最新的MariaDB服务器的 CentOS 7.x,而且你可以用root账号登陆到MariaDBs服务器(这在这篇文章的第一部分已经介绍过) +假设我们已经更新/升级了包括有最新的MariaDB服务器的 CentOS 7.x,而且你可以用root账号登陆到MariaDB服务器(这在这篇文章的第一部分已经介绍过) -登陆到Maria 数据库控制台并创建数据库 +登录到Maria 数据库控制台并创建数据库 mysql -u root -pSOME_ROOT_PASSWORD; mysql> create database test_repl; @@ -264,7 +268,7 @@ full-dump.sql - 你在测试服务器中创建的DB Dump。 mysql> slave start; -输出: +输出如下: Query OK, 0 rows affected (0.00 sec) @@ -272,7 +276,7 @@ full-dump.sql - 你在测试服务器中创建的DB Dump。 mysql> show slave status\G; -输出: +输出如下: *************************** 1. row *************************** Slave_IO_State: Waiting for master to send event @@ -352,7 +356,7 @@ via: http://linoxide.com/how-tos/configure-mariadb-replication-centos-linux/ 作者:[Bobbin Zachariah][a] 译者:[ictlyh](https://github.com/ictlyh) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 From 270ce2609dd0cf60a5ec10caa3edd622bd5c5b42 Mon Sep 17 00:00:00 2001 From: Chang Liu Date: Fri, 22 May 2015 13:10:16 +0800 Subject: [PATCH 128/965] Update 20150320 Sleuth Kit--Open Source Forensic Tool to Analyze Disk Images and Recover Files.md --- ...ce Forensic Tool to Analyze Disk Images and Recover Files.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20150320 Sleuth Kit--Open Source Forensic Tool to Analyze Disk Images and Recover Files.md b/sources/tech/20150320 Sleuth Kit--Open Source Forensic Tool to Analyze Disk Images and Recover Files.md index 2f138a9e3d..b3acf5f00e 100644 --- a/sources/tech/20150320 Sleuth Kit--Open Source Forensic Tool to Analyze Disk Images and Recover Files.md +++ b/sources/tech/20150320 Sleuth Kit--Open Source Forensic Tool to Analyze Disk Images and Recover Files.md @@ -1,3 +1,5 @@ +FSSlc Translating + Sleuth Kit - Open Source Forensic Tool to Analyze Disk Images and Recover Files ================================================================================ SIFT is a Ubuntu based forensics distribution provided by SANS Inc. It consist of many forensics tools such as Sleuth kit / Autopsy etc . However, Sleuth kit/Autopsy tools can be installed on Ubuntu/Fedora distribution instead of downloading complete distribution of SIFT. From f50e0082b471a1c1276c9a15f6dbb9dd05e0085e Mon Sep 17 00:00:00 2001 From: wxy Date: Fri, 22 May 2015 15:37:47 +0800 Subject: [PATCH 129/965] PUB:20150330 How to secure SSH login with one-time passwords on Linux @bazz2 --- ... login with one-time passwords on Linux.md | 26 ++++++++++--------- 1 file changed, 14 insertions(+), 12 deletions(-) rename {translated/tech => published}/20150330 How to secure SSH login with one-time passwords on Linux.md (73%) diff --git a/translated/tech/20150330 How to secure SSH login with one-time passwords on Linux.md b/published/20150330 How to secure SSH login with one-time passwords on Linux.md similarity index 73% rename from translated/tech/20150330 How to secure SSH login with one-time passwords on Linux.md rename to published/20150330 How to secure SSH login with one-time passwords on Linux.md index f3668f14f0..443f8cab25 100644 --- a/translated/tech/20150330 How to secure SSH login with one-time passwords on Linux.md +++ b/published/20150330 How to secure SSH login with one-time passwords on Linux.md @@ -1,10 +1,10 @@ -使用 SSH 和一次性密码安全登录 Linux +使用一次性密码本通过 SSH 安全登录 Linux ================================================================================ -有人说,安全不是一个产品,而是一个过程(LCTT 注:安全公司 McAfee 认为,安全风险管理是一个方法论,而不是安全产品的堆叠)。虽然 SSH 协议被设计成使用加密技术来确保安全,但如果使用不当,别人还是能够破坏你的系统:比如弱密码、密钥泄露、使用的 SSH 客户端过时等,都能引发安全问题。 +有人说,安全不是一个产品,而是一个过程(LCTT 注:安全公司 McAfee 认为,安全风险管理是一个方法论,而不是安全产品的堆叠)。虽然 SSH 协议被设计成使用加密技术来确保安全,但如果使用不当,别人还是能够破坏你的系统:比如弱密码、密钥泄露、使用过时的 SSH 客户端等,都能引发安全问题。 -在考虑 SSH 认证方案时,大家普遍认为[公钥认证][1]比密码认证更安全。然而,公钥认证技术并不是为公共环境设置的,如果你在一台公用电脑上使用公钥认证登录 SSH 服务器,你的服务器已经毫无安全可言了,公用的电脑可能会记录你的公钥,或从你的内存中读取公钥。如果你不信任本地电脑,那你最好还是使用其他方式登录服务器。现在就是“一次性密码”派上用场的时候了,就像名字所示,一次性密码只能被使用一次。这种一次性密码非常合适在不安全的环境下发挥作用,就算它被窃取,也无法再次使用。 +在考虑 SSH 认证方案时,大家普遍认为[公钥认证][1]比密码认证更安全。然而,公钥认证技术并不是为公共环境设置的,如果你在一台公用电脑上使用公钥认证登录 SSH 服务器,你的服务器已经毫无安全可言了,公用的电脑可能会记录你的公钥,或从你的内存中读取公钥。如果你不信任本地电脑,那你最好还是使用其他方式登录服务器。现在就是“一次性密码(OTP)”派上用场的时候了,就像名字所示,一次性密码只能被使用一次。这种一次性密码非常合适在不安全的环境下发挥作用,就算它被窃取,也无法再次使用。 -有个一次性密码方案叫[谷歌认证][2],但在本文中,我要介绍的是另一种 SSH 登录方案:[OTPW][3],它是个一次性密码登录的软件包。不像谷歌认证,OTPW 不需要依赖任何第三方库。 +有个生成一次性密码的方法是通过[谷歌认证器][2],但在本文中,我要介绍的是另一种 SSH 登录方案:[OTPW][3],它是个一次性密码登录的软件包。不像谷歌认证,OTPW 不需要依赖任何第三方库。 ### OTPW 是什么 ### @@ -39,7 +39,7 @@ OTPW 由一次性密码生成器和 PAM 认证规则组成。在 OTPW 中一次 $ git clone https://www.cl.cam.ac.uk/~mgk25/git/otpw $ cd otpw -打开 Makefile 文件,编辑以“PAMLIB=”开头的那行配置: +打开 Makefile 文件,编辑以“PAMLIB=”开头的那行配置: 64 位系统: @@ -49,12 +49,12 @@ OTPW 由一次性密码生成器和 PAM 认证规则组成。在 OTPW 中一次 PAMLIB=/usr/lib/security -编译安装。需要注意的是安装过程会把 SSH 服务重启一下,所以如果你是使用 SSH 连接到服务器,做好被断开连接的准备吧。 +编译安装。需要注意的是安装过程会自动重启 SSH 服务一下,所以如果你是使用 SSH 连接到服务器,做好被断开连接的准备吧(LCTT 译注:也许不会被断开连接,即便被断开连接,请使用原来的方式重新连接即可,现在还没有换成一次性口令方式。)。 $ make $ sudo make install -现在你需要更新 SELinux 策略,因为 /usr/sbin/sshd 会往你的 home 目录写数据,而 SELinux 默认是不允许这么做的。如果你使用了 SELinux 服务(LCTT 注:使用 getenforce 命令查看结果,如果是 enforcing,就是打开了 SELinux 服务),如果没有使用 SELinux 服务,请跳过这一步。 +现在你需要更新 SELinux 策略,因为 /usr/sbin/sshd 会往你的 home 目录写数据,而 SELinux 默认是不允许这么做的。如果没有使用 SELinux 服务(LCTT 注:使用 getenforce 命令查看结果,如果是 enforcing,就是打开了 SELinux 服务),请跳过这一步。 $ sudo grep sshd /var/log/audit/audit.log | audit2allow -M mypol $ sudo semodule -i mypol.pp @@ -90,6 +90,8 @@ Debian, Ubuntu 或 Linux Mint 发行版: Fedora 或 CentOS/RHEL 7 发行版: $ sudo systemctl restart sshd + +(LCTT 译注:虽然这里重启了 sshd 服务,但是你当前的 ssh 连接应该不受影响,只是在你完成下述步骤之前,无法按照原有方式建立新的连接了。因此,保险起见,要么多开一个 ssh 连接,避免误退出当前连接;要么将重启 sshd 服务器步骤放到步骤3完成之后。) #### 步骤3:使用 OTPW 产生一次性密码 #### @@ -102,7 +104,7 @@ Fedora 或 CentOS/RHEL 7 发行版: 这个命令会让你输入密码前缀,当你以后登录的时候,你需要同时输入这个前缀以及一次性密码。密码前缀是另外一层保护,就算你的一次性密码表被泄漏,别人也无法通过暴力破解你的 SSH 密码。 -设置好密码前缀后,这个命令会产生 280 个一次性密码,并将它们保存在一个文本文件中(如 temporary_password.txt)。每个密码(默认是 8 个字符)由一个 3 位十进制数索引。你需要将这个密码表打印出来,并随身携带。 +设置好密码前缀后,这个命令会产生 280 个一次性密码(LCTT 译注:保存到 ~/.otpw 下),并将它们导出到一个文本文件中(如 temporary_password.txt)。每个密码(默认是 8 个字符)由一个 3 位十进制数索引。你需要将这个密码表打印出来,并随身携带。 ![](https://farm8.staticflickr.com/7281/16962594055_c2696d5ae1_b.jpg) @@ -160,7 +162,7 @@ Fedora 或 CentOS/RHEL 7 发行版: ### 总结 ### -在这个教程中,我介绍了如何使用 OTPW 工具来设置一次性登录密码。你也许意识到了在这种两个因子的认证方式中,打印一张密码表让人感觉好 low,但是这种方式是最简单的,并且不用依赖任何第三方软件。无论你用哪种方式创建一次性密码,在你需要在一个不被信任的环境登录 SSH 服务器的时候,它们都很有用。你可以就这个主题来分享你的经验和观点。 +在这个教程中,我介绍了如何使用 OTPW 工具来设置一次性登录密码。你也许意识到了在这种双因子的认证方式中,打印一张密码表让人感觉好 low,但是这种方式是最简单的,并且不用依赖任何第三方软件。无论你用哪种方式创建一次性密码,在你需要在一个不可信任的环境登录 SSH 服务器的时候,它们都很有用。你可以就这个主题来分享你的经验和观点。 -------------------------------------------------------------------------------- @@ -168,11 +170,11 @@ via: http://xmodulo.com/secure-ssh-login-one-time-passwords-linux.html 作者:[Dan Nanni][a] 译者:[bazz2](https://github.com/bazz2) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 [a]:http://xmodulo.com/author/nanni -[1]:http://xmodulo.com/how-to-force-ssh-login-via-public-key-authentication.html -[2]:http://xmodulo.com/two-factor-authentication-ssh-login-linux.html +[1]:https://linux.cn/article-5444-1.html +[2]:https://linux.cn/article-2642-1.html [3]:http://www.cl.cam.ac.uk/~mgk25/otpw.html From 68be41500e33c2956ee3298efb7e2cad0a0c2b48 Mon Sep 17 00:00:00 2001 From: ZTinoZ Date: Fri, 22 May 2015 15:51:31 +0800 Subject: [PATCH 130/965] Translating by ZTinoZ --- ...o After Installing Ubuntu 15.04 Desktop.md | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/sources/tech/20150427 15 Things to Do After Installing Ubuntu 15.04 Desktop.md b/sources/tech/20150427 15 Things to Do After Installing Ubuntu 15.04 Desktop.md index d5e543a7ba..e7d536958e 100644 --- a/sources/tech/20150427 15 Things to Do After Installing Ubuntu 15.04 Desktop.md +++ b/sources/tech/20150427 15 Things to Do After Installing Ubuntu 15.04 Desktop.md @@ -1,4 +1,4 @@ -安装完Ubuntu 15.04桌面后要做的15件事 +安装完Ubuntu 15.04桌面后要做的16件事 ================================================================================ 本教程适用于新手和在自己的电脑上安装好Ubuntu 15.04 “Vivid Vervet” 桌面之后为了自定义自己的系统并安装一些基本程序作为日常使用的已经做了一些准备的人。 @@ -110,7 +110,7 @@ Enable Video Codes ### 8. 安装图像处理应用程序 ### -If you are a photography enthusiast and you want to handle and manipulate images on Ubuntu, probably you want to install the following imaging programs: +如果你是一个摄影爱好者,想在Ubuntu上处理调整图像,或许需要安装一下图像处理程序: - GIMP (alternative for Adobe Photoshop) - Darktable @@ -121,7 +121,7 @@ If you are a photography enthusiast and you want to handle and manipulate images - Digikam - Cheese -This applications can be installed from Ubuntu Software Center or all at once by using the following command line on Terminal: +这些应用程序能从Ubuntu Software Center中安装或者立刻在终端上使用以下命令: $ sudo apt-get install gimp gimp-plugin-registry gimp-data-extras darktable rawtherapee pinta shotwell inkscape @@ -133,7 +133,7 @@ Rawtherapee Tool ### 9. 安装媒体烧录软件 ### -To mount ISO images or burn a CDs or a DVD, you can choose and install from the following software: +如果要挂载ISO镜像或烧录一张CD或DVD,你可以选择并安装以下软件中的一款: - Brasero Disk Burner - K3b @@ -150,7 +150,7 @@ Install Media Burners ### 10. 安装压缩应用程序 ### -To handle most of archive formatted files (zip, tar.gz, zip, 7zip rar etc) install the following packages by issuing the below command: +如果要处理大多数归档格式的文件(zip, tar.gz, zip, 7zip rar等等),输入以下命令来安装这些包: $ sudo apt-get install unace unrar zip unzip p7zip-full p7zip-rar sharutils rar uudeview mpack arj cabextract file-roller @@ -159,7 +159,7 @@ Install Archive Applications ### 11. 安装聊天应用程序 ### -If you want to talk to people all over the world, here is a list of the most popular chat applications for Linux: +如果你想要和世界各地的人们聊天,这里有一份最流行的Linux聊天应用程序列表: - Pidgin - Skype @@ -168,7 +168,7 @@ If you want to talk to people all over the world, here is a list of the most pop - aMSN - Viber -You can install most of them from Ubuntu Software Center or by using the command line: +你可以从Ubuntu Software Center中安装它们或使用以下命令: $ sudo apt-get install pidgin $ sudo apt-get install skype @@ -181,21 +181,21 @@ You can install most of them from Ubuntu Software Center or by using the command ![Install Chat Applications](http://www.tecmint.com/wp-content/uploads/2015/04/install-chat-apps.jpg) Install Chat Applications -To install Viber application on Ubuntu visit [Viber official webpage][1], download the Debian package locally and install the viber.deb application using Gdebi package manager (left click – > Open with -> GDebi Package Installer). +想要在Ubuntu上安装Viber可以访问[Viber官方网站][1]下载Debian安装包到本地并用Gdebi包管理工具来安装viber.deb应用程序(右击 –> 打开 -> GDebi Package Installer). ![Install Viber in Ubuntu](http://www.tecmint.com/wp-content/uploads/2015/04/install-viber.jpg) Install Viber ### 12. 安装种子软件 ### -The most popular torrent applications and peer-to-peer file sharing programs for Ubuntu are: +在Ubuntu最流行的种子应用程序和P2P文件共享程序是: - Deluge - Transmission - Qbittorrent - LinuxDC++ -To install your favorite peer-to-peer file sharing application on Ubuntu issue the following command on Terminal. +想要在Ubuntu上安装你最喜欢的P2P文件共享应用程序,可以在终端上输入以下命令: $ sudo apt-get install deluge $ sudo apt-get install transmission @@ -288,7 +288,7 @@ This are just a few tweaks and programs that an average user might install and u via: http://www.tecmint.com/things-to-do-after-installing-ubuntu-15-04-desktop/ 作者:[Matei Cezar][a] -译者:[译者ID](https://github.com/译者ID) +译者:[ZTinoZ](https://github.com/ZTinoZ) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 From 45b56d13944ac7b1f808c35f6237b791d3a7fd0e Mon Sep 17 00:00:00 2001 From: DeadFire Date: Fri, 22 May 2015 16:09:26 +0800 Subject: [PATCH 131/965] =?UTF-8?q?20150522-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sources/tech/20150522 Analyzing Linux Logs.md | 181 ++++++++++++++++++ 1 file changed, 181 insertions(+) create mode 100644 sources/tech/20150522 Analyzing Linux Logs.md diff --git a/sources/tech/20150522 Analyzing Linux Logs.md b/sources/tech/20150522 Analyzing Linux Logs.md new file mode 100644 index 0000000000..085d3a8ed3 --- /dev/null +++ b/sources/tech/20150522 Analyzing Linux Logs.md @@ -0,0 +1,181 @@ +Analyzing Linux Logs +================================================================================ +There’s a great deal of information waiting for you within your logs, although it’s not always as easy as you’d like to extract it. In this section we will cover some examples of basic analysis you can do with your logs right away (just search what’s there). We’ll also cover more advanced analysis that may take some upfront effort to set up properly, but will save you time on the back end. Examples of advanced analysis you can do on parsed data include generating summary counts, filtering on field values, and more. + +We’ll show you first how to do this yourself on the command line using several different tools and then show you how a log management tool can automate much of the grunt work and make this so much more streamlined. + +### Searching with Grep ### + +Searching for text is the most basic way to find what you’re looking for. The most common tool for searching text is [grep][1]. This command line tool, available on most Linux distributions, allows you to search your logs using regular expressions. A regular expression is a pattern written in a special language that can identify matching text. The simplest pattern is to put the string you’re searching for surrounded by quotes + +#### Regular Expressions #### + +Here’s an example to find authentication logs for “user hoover” on an Ubuntu system: + + $ grep "user hoover" /var/log/auth.log + Accepted password for hoover from 10.0.2.2 port 4792 ssh2 + pam_unix(sshd:session): session opened for user hoover by (uid=0) + pam_unix(sshd:session): session closed for user hoover + +It can be hard to construct regular expressions that are accurate. For example, if we searched for a number like the port “4792” it could also match timestamps, URLs, and other undesired data. In the below example for Ubuntu, it matched an Apache log that we didn’t want. + + $ grep "4792" /var/log/auth.log + Accepted password for hoover from 10.0.2.2 port 4792 ssh2 + 74.91.21.46 - - [31/Mar/2015:19:44:32 +0000] "GET /scripts/samples/search?q=4972HTTP/1.0" 404 545 "-" "-” + +#### Surround Search #### + +Another useful tip is that you can do surround search with grep. This will show you what happened a few lines before or after a match. It can help you debug what lead up to a particular error or problem. The B flag gives you lines before, and A gives you lines after. For example, we can see that when someone failed to login as an admin, they also failed the reverse mapping which means they might not have a valid domain name. This is very suspicious! + + $ grep -B 3 -A 2 'Invalid user' /var/log/auth.log + Apr 28 17:06:20 ip-172-31-11-241 sshd[12545]: reverse mapping checking getaddrinfo for 216-19-2-8.commspeed.net [216.19.2.8] failed - POSSIBLE BREAK-IN ATTEMPT! + Apr 28 17:06:20 ip-172-31-11-241 sshd[12545]: Received disconnect from 216.19.2.8: 11: Bye Bye [preauth] + Apr 28 17:06:20 ip-172-31-11-241 sshd[12547]: Invalid user admin from 216.19.2.8 + Apr 28 17:06:20 ip-172-31-11-241 sshd[12547]: input_userauth_request: invalid user admin [preauth] + Apr 28 17:06:20 ip-172-31-11-241 sshd[12547]: Received disconnect from 216.19.2.8: 11: Bye Bye [preauth] + +#### Tail #### + +You can also pair grep with [tail][2] to get the last few lines of a file, or to follow the logs and print them in real time. This is useful if you are making interactive changes like starting a server or testing a code change. + + $ tail -f /var/log/auth.log | grep 'Invalid user' + Apr 30 19:49:48 ip-172-31-11-241 sshd[6512]: Invalid user ubnt from 219.140.64.136 + Apr 30 19:49:49 ip-172-31-11-241 sshd[6514]: Invalid user admin from 219.140.64.136 + +A full introduction on grep and regular expressions is outside the scope of this guide, but [Ryan’s Tutorials][3] include more in-depth information. + +Log management systems have higher performance and more powerful searching abilities. They often index their data and parallelize queries so you can quickly search gigabytes or terabytes of logs in seconds. In contrast, this would take minutes or in extreme cases hours with grep. Log management systems also use query languages like [Lucene][4] which offer an easier syntax for searching on numbers, fields, and more. + +### Parsing with Cut, AWK, and Grok ### + +#### Command Line Tools #### + +Linux offers several command line tools for text parsing and analysis. They are great if you want to quickly parse a small amount of data but can take a long time to process large volumes of data + +#### Cut #### + +The [cut][5] command allows you to parse fields from delimited logs. Delimiters are characters like equal signs or commas that break up fields or key value pairs. + +Let’s say we want to parse the user from this log: + + pam_unix(su:auth): authentication failure; logname=hoover uid=1000 euid=0 tty=/dev/pts/0 ruser=hoover rhost= user=root + +We can use the cut command like this to get the text after the eighth equal sign. This example is on an Ubuntu system: + + $ grep "authentication failure" /var/log/auth.log | cut -d '=' -f 8 + root + hoover + root + nagios + nagios + +#### AWK #### + +Alternately, you can use [awk][6], which offers more powerful features to parse out fields. It offers a scripting language so you can filter out nearly everything that’s not relevant. + +For example, let’s say we have the following log line on an Ubuntu system and we want to extract the username that failed to login: + + Mar 24 08:28:18 ip-172-31-11-241 sshd[32701]: input_userauth_request: invalid user guest [preauth] + +Here’s how you can use the awk command. First, put a regular expression /sshd.*invalid user/ to match the sshd invalid user lines. Then print the ninth field using the default delimiter of space using { print $9 }. This outputs the usernames. + + $ awk '/sshd.*invalid user/ { print $9 }' /var/log/auth.log + guest + admin + info + test + ubnt + +You can read more about how to use regular expressions and print fields in the [Awk User’s Guide][7]. + +#### Log Management Systems #### + +Log management systems make parsing easier and enable users to quickly analyze large collections of log files. They can automatically parse standard log formats like common Linux logs or web server logs. This saves a lot of time because you don’t have to think about writing your own parsing logic when troubleshooting a system problem. + +Here you can see an example log message from sshd which has each of the fields remoteHost and user parsed out. This is a screenshot from Loggly, a cloud-based log management service. + +![](http://www.loggly.com/ultimate-guide/wp-content/uploads/2015/05/Screen-Shot-2015-03-12-at-11.25.09-AM.png) + +You can also do custom parsing for non-standard formats. A common tool to use is [Grok][8] which uses a library of common regular expressions to parse raw text into structured JSON. Here is an example configuration for Grok to parse kernel log files inside Logstash: + + filter{ + grok { + match => {"message" => "%{CISCOTIMESTAMP:timestamp} %{HOST:host} %{WORD:program}%{NOTSPACE} %{NOTSPACE}%{NUMBER:duration}%{NOTSPACE} %{GREEDYDATA:kernel_logs}" + } + } + +And here is what the parsed output looks like from Grok: + +![](http://www.loggly.com/ultimate-guide/wp-content/uploads/2015/05/Screen-Shot-2015-03-12-at-11.30.37-AM.png) + +### Filtering with Rsyslog and AWK ### + +Filtering allows you to search on a specific field value instead of doing a full text search. This makes your log analysis more accurate because it will ignore undesired matches from other parts of the log message. In order to search on a field value, you need to parse your logs first or at least have a way of searching based on the event structure. + +#### How to Filter on One App #### + +Often, you just want to see the logs from just one application. This is easy if your application always logs to a single file. It’s more complicated if you need to filter one application among many in an aggregated or centralized log. Here are several ways to do this: + +1. Use the rsyslog daemon to parse and filter logs. This example writes logs from the sshd application to a file named sshd-messages, then discards the event so it’s not repeated elsewhere. You can try this example by adding it to your rsyslog.conf file. + + :programname, isequal, “sshd” /var/log/sshd-messages + &~ + +2. Use command line tools like awk to extract the values of a particular field like the sshd username. This example is from an Ubuntu system. + + $ awk '/sshd.*invalid user/ { print $9 }' /var/log/auth.log + guest + admin + info + test + ubnt + +3. Use a log management system that automatically parses your logs, then click to filter on the desired application name. Here is a screenshot showing the syslog fields in a log management service called Loggly. We are filtering on the appName “sshd” as indicated by the Venn diagram icon. + +![](http://www.loggly.com/ultimate-guide/wp-content/uploads/2015/05/Screen-Shot-2015-03-12-at-11.05.02-AM.png) + +#### How to Filter on Errors #### + +One of the most common thing people want to see in their logs is errors. Unfortunately, the default syslog configuration doesn’t output the severity of errors directly, making it difficult to filter on them. + +There are two ways you can solve this problem. First, you can modify your rsyslog configuration to output the severity in the log file to make it easier to read and search. In your rsyslog configuration you can add a [template][9] with pri-text such as the following: + + "<%pri-text%> : %timegenerated%,%HOSTNAME%,%syslogtag%,%msg%n" + +This example gives you output in the following format. You can see that the severity in this message is err. + + : Mar 11 18:18:00,hoover-VirtualBox,su[5026]:, pam_authenticate: Authentication failure + +You can use awk or grep to search for just the error messages. In this example for Ubuntu, we’re including some surrounding syntax like the . and the > which match only this field. + + $ grep '.err>' /var/log/auth.log + : Mar 11 18:18:00,hoover-VirtualBox,su[5026]:, pam_authenticate: Authentication failure + +Your second option is to use a log management system. Good log management systems automatically parse syslog messages and extract the severity field. They also allow you to filter on log messages of a certain severity with a single click. + +Here is a screenshot from Loggly showing the syslog fields with the error severity highlighted to show we are filtering for errors: + +![](http://www.loggly.com/ultimate-guide/wp-content/uploads/2015/05/Screen-Shot-2015-03-12-at-11.00.36-AM.png) + +-------------------------------------------------------------------------------- + +via: http://www.loggly.com/ultimate-guide/logging/analyzing-linux-logs/ + +作者:[Jason Skowronski][a] [Amy Echeverri][b] [ Sadequl Hussain][c] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://www.linkedin.com/in/jasonskowronski +[b]:https://www.linkedin.com/in/amyecheverri +[c]:https://www.linkedin.com/pub/sadequl-hussain/14/711/1a7 +[1]:http://linux.die.net/man/1/grep +[2]:http://linux.die.net/man/1/tail +[3]:http://ryanstutorials.net/linuxtutorial/grep.php +[4]:https://lucene.apache.org/core/2_9_4/queryparsersyntax.html +[5]:http://linux.die.net/man/1/cut +[6]:http://linux.die.net/man/1/awk +[7]:http://www.delorie.com/gnu/docs/gawk/gawk_26.html#IDX155 +[8]:http://logstash.net/docs/1.4.2/filters/grok +[9]:http://www.rsyslog.com/doc/v8-stable/configuration/templates.html \ No newline at end of file From 5b51ea24362f25d41a44012591f667cf69ee65c5 Mon Sep 17 00:00:00 2001 From: Gore Liu Date: Fri, 22 May 2015 19:15:07 +0800 Subject: [PATCH 132/965] [Translating] 20150520 How to Use Docker Machine with a Cloud Provider.md --- ...0150520 How to Use Docker Machine with a Cloud Provider.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150520 How to Use Docker Machine with a Cloud Provider.md b/sources/tech/20150520 How to Use Docker Machine with a Cloud Provider.md index 8ccc8c8c94..1539b4e751 100644 --- a/sources/tech/20150520 How to Use Docker Machine with a Cloud Provider.md +++ b/sources/tech/20150520 How to Use Docker Machine with a Cloud Provider.md @@ -1,3 +1,5 @@ +Translating by goreliu ... + How to Use Docker Machine with a Cloud Provider ================================================================================ Hi everyone, today we'll learn how we can use Docker Machine to deploy Docker host in various Cloud Provider Platforms. Docker Machine is an application that helps to create Docker hosts on our computer, on cloud providers and inside our own data center. It provides easy solution for creating servers, installing Docker on them and then configuring the Docker client according the users configuration and requirements. The driver APIs works for provisioning Docker on a local machine, on a virtual machine in the data center, or on a public cloud instance. Docker Machine is supported on Windows, OSX, and Linux and is available for installation as one standalone binary. It enables us to take full advantage of ecosystem partners providing Docker-ready infrastructure, while still accessing everything through the same interface. It makes people able to deploy the docker containers in the respective cloud platform pretty fast and in pretty easy way with just a single command. @@ -138,7 +140,7 @@ Docker Machine is really and awesome tool for deploying servers with Docker Cont via: http://linoxide.com/linux-how-to/use-docker-machine-cloud-provider/ 作者:[Arun Pyasi][a] -译者:[译者ID](https://github.com/译者ID) +译者:[goreliu](https://github.com/goreliu) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 57bada1e8eeace5ca7552d75c67300f829e20570 Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 22 May 2015 21:34:23 +0800 Subject: [PATCH 133/965] translated --- ...es The Windows Communication Foundation.md | 16 +++++------- ...es The Windows Communication Foundation.md | 26 +++++++++++++++++++ 2 files changed, 33 insertions(+), 9 deletions(-) create mode 100644 translated/news/20150521 Microsoft Open-Sources The Windows Communication Foundation.md diff --git a/sources/news/20150521 Microsoft Open-Sources The Windows Communication Foundation.md b/sources/news/20150521 Microsoft Open-Sources The Windows Communication Foundation.md index 927e42b021..45d8d6514a 100644 --- a/sources/news/20150521 Microsoft Open-Sources The Windows Communication Foundation.md +++ b/sources/news/20150521 Microsoft Open-Sources The Windows Communication Foundation.md @@ -1,23 +1,21 @@ -Translating---geekpi - -Microsoft Open-Sources The Windows Communication Foundation +微软开源了WCF框架 ================================================================================ -Microsoft has today announced they've open-sourced the important WCF (Windows Communication Foundation) code that now targets .NET Core. +微软今天宣布我们开源的针对.NET核心的WCF(Windows Communication Foundation)。 -As described by [MSDN][1], "Windows Communication Foundation (WCF) is a framework for building service-oriented applications. Using WCF, you can send data as asynchronous messages from one service endpoint to another. A service endpoint can be part of a continuously available service hosted by IIS, or it can be a service hosted in an application. An endpoint can be a client of a service that requests data from a service endpoint. The messages can be as simple as a single character or word sent as XML, or as complex as a stream of binary data." +[MSDN][1]中说:“WCF是一个构建面向服务程序的框架。使用WCF,你可以从服务端给另一个发送异步消息。服务终端可以是托管在IIS中连续可用服务的一部分,也可以是托管在某个程序上的服务。终端可以是请求服务端数据的客户端。消息可以是一个字符或者XML,也可以是复杂的二进制流。” -The [code on GitHub][2], "contains a subset of the full Windows Communication Foundation product available on the Windows desktop, and it supports the library profiles already available for building WCF apps for the Windows Store. These profiles are primarily client-based, making them suited for mobile devices or on mid-tier servers to communicate with existing WCF services." +它的[代码在GitHub][2],“包含了Window桌面中完整WCF框架的一部分,它支持已经在Window Store中的WCF库。这些档案主要是基于客户端,方便移动设备和中间层服务器使用WCF进行通信。” -More details on Microsoft opening up the Windows Communication Foundation can be found via the announcement posted this morning to the [dotNETFoundation.org blog][3]. +More details on Microsoft opening up the Windows Communication Foundation can be found via the announcement posted this morning to the [dotNETFoundation.[dotNETFoundation.org blog][3]中查看。 -Windows Communication Foundation sounds a bit like D-Bus on Linux for inter-process communication between programs/services. +WCF听上去有点像Linux中进程/服务间通信的D-BUS。 -------------------------------------------------------------------------------- via: http://www.phoronix.com/scan.php?page=news_item&px=Microsoft-Open-Source-WCF 作者:[Michael Larabel][a] -译者:[译者ID](https://github.com/译者ID) +译者:[geekpi](https://github.com/geekpi) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 diff --git a/translated/news/20150521 Microsoft Open-Sources The Windows Communication Foundation.md b/translated/news/20150521 Microsoft Open-Sources The Windows Communication Foundation.md new file mode 100644 index 0000000000..45d8d6514a --- /dev/null +++ b/translated/news/20150521 Microsoft Open-Sources The Windows Communication Foundation.md @@ -0,0 +1,26 @@ +微软开源了WCF框架 +================================================================================ +微软今天宣布我们开源的针对.NET核心的WCF(Windows Communication Foundation)。 + +[MSDN][1]中说:“WCF是一个构建面向服务程序的框架。使用WCF,你可以从服务端给另一个发送异步消息。服务终端可以是托管在IIS中连续可用服务的一部分,也可以是托管在某个程序上的服务。终端可以是请求服务端数据的客户端。消息可以是一个字符或者XML,也可以是复杂的二进制流。” + +它的[代码在GitHub][2],“包含了Window桌面中完整WCF框架的一部分,它支持已经在Window Store中的WCF库。这些档案主要是基于客户端,方便移动设备和中间层服务器使用WCF进行通信。” + +More details on Microsoft opening up the Windows Communication Foundation can be found via the announcement posted this morning to the [dotNETFoundation.[dotNETFoundation.org blog][3]中查看。 + +WCF听上去有点像Linux中进程/服务间通信的D-BUS。 + +-------------------------------------------------------------------------------- + +via: http://www.phoronix.com/scan.php?page=news_item&px=Microsoft-Open-Source-WCF + +作者:[Michael Larabel][a] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.michaellarabel.com/ +[1]:https://msdn.microsoft.com/en-us/library/ms731082%28v=vs.110%29.aspx +[2]:https://github.com/dotnet/wcf +[3]:http://www.dotnetfoundation.org/blog/wcf-is-open-source \ No newline at end of file From 4182debf361bc2e1ccc7a07a280fb410766cee5a Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 22 May 2015 21:37:01 +0800 Subject: [PATCH 134/965] translated --- ...es The Windows Communication Foundation.md | 26 ------------------- 1 file changed, 26 deletions(-) delete mode 100644 sources/news/20150521 Microsoft Open-Sources The Windows Communication Foundation.md diff --git a/sources/news/20150521 Microsoft Open-Sources The Windows Communication Foundation.md b/sources/news/20150521 Microsoft Open-Sources The Windows Communication Foundation.md deleted file mode 100644 index 45d8d6514a..0000000000 --- a/sources/news/20150521 Microsoft Open-Sources The Windows Communication Foundation.md +++ /dev/null @@ -1,26 +0,0 @@ -微软开源了WCF框架 -================================================================================ -微软今天宣布我们开源的针对.NET核心的WCF(Windows Communication Foundation)。 - -[MSDN][1]中说:“WCF是一个构建面向服务程序的框架。使用WCF,你可以从服务端给另一个发送异步消息。服务终端可以是托管在IIS中连续可用服务的一部分,也可以是托管在某个程序上的服务。终端可以是请求服务端数据的客户端。消息可以是一个字符或者XML,也可以是复杂的二进制流。” - -它的[代码在GitHub][2],“包含了Window桌面中完整WCF框架的一部分,它支持已经在Window Store中的WCF库。这些档案主要是基于客户端,方便移动设备和中间层服务器使用WCF进行通信。” - -More details on Microsoft opening up the Windows Communication Foundation can be found via the announcement posted this morning to the [dotNETFoundation.[dotNETFoundation.org blog][3]中查看。 - -WCF听上去有点像Linux中进程/服务间通信的D-BUS。 - --------------------------------------------------------------------------------- - -via: http://www.phoronix.com/scan.php?page=news_item&px=Microsoft-Open-Source-WCF - -作者:[Michael Larabel][a] -译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.michaellarabel.com/ -[1]:https://msdn.microsoft.com/en-us/library/ms731082%28v=vs.110%29.aspx -[2]:https://github.com/dotnet/wcf -[3]:http://www.dotnetfoundation.org/blog/wcf-is-open-source \ No newline at end of file From 4559a7909b13d24bd1a3a31a255140fae02a2500 Mon Sep 17 00:00:00 2001 From: wwy Date: Fri, 22 May 2015 22:54:13 +0800 Subject: [PATCH 135/965] Update 20150518 10 Amazing and Mysterious Uses of Symbol or Operator in Linux Commands.md --- ...Mysterious Uses of Symbol or Operator in Linux Commands.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150518 10 Amazing and Mysterious Uses of Symbol or Operator in Linux Commands.md b/sources/tech/20150518 10 Amazing and Mysterious Uses of Symbol or Operator in Linux Commands.md index 2b281b8e85..16795b92e8 100644 --- a/sources/tech/20150518 10 Amazing and Mysterious Uses of Symbol or Operator in Linux Commands.md +++ b/sources/tech/20150518 10 Amazing and Mysterious Uses of Symbol or Operator in Linux Commands.md @@ -1,3 +1,5 @@ +translating by wwy-hust + 10 Amazing and Mysterious Uses of (!) Symbol or Operator in Linux Commands ================================================================================ The `'!'` symbol or operator in Linux can be used as Logical Negation operator as well as to fetch commands from history with tweaks or to run previously run command with modification. All the commands below have been checked explicitly in bash Shell. Though I have not checked but a major of these won’t run in other shell. Here we go into the amazing and mysterious uses of `'!'` symbol or operator in Linux commands. @@ -190,4 +192,4 @@ via: http://www.tecmint.com/mysterious-uses-of-symbol-or-operator-in-linux-comma 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 [a]:http://www.tecmint.com/author/avishek/ -[1]:http://www.tecmint.com/12-top-command-examples-in-linux/ \ No newline at end of file +[1]:http://www.tecmint.com/12-top-command-examples-in-linux/ From feb8bf95cf6461377a0ad62fd71f6d21f8bbc3ec Mon Sep 17 00:00:00 2001 From: geekpi Date: Sun, 24 May 2015 10:10:00 +0800 Subject: [PATCH 136/965] translating --- ...untu App Applies Instagram Style Filters to Your Photos.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/share/20150515 This Ubuntu App Applies Instagram Style Filters to Your Photos.md b/sources/share/20150515 This Ubuntu App Applies Instagram Style Filters to Your Photos.md index b9ff371e5f..e30264f75b 100644 --- a/sources/share/20150515 This Ubuntu App Applies Instagram Style Filters to Your Photos.md +++ b/sources/share/20150515 This Ubuntu App Applies Instagram Style Filters to Your Photos.md @@ -1,3 +1,5 @@ +translating----geekpi + This Ubuntu App Applies Instagram Style Filters to Your Photos ================================================================================ **Looking for an Ubuntu app to apply Instagram style filters to your photos in Ubuntu?** @@ -68,4 +70,4 @@ via: http://www.omgubuntu.co.uk/2015/05/instagram-photo-filters-ubuntu-desktop-a [a]:https://plus.google.com/117485690627814051450/?rel=author [1]:http://www.omgchrome.com/?s=pixlr [2]:http://www.omgchrome.com/the-best-chrome-apps-of-2014/ -[3]:http://www.xnview.com/en/xnretro/#downloads \ No newline at end of file +[3]:http://www.xnview.com/en/xnretro/#downloads From 1150c902dd25b0b8481f7f701fae4e094bc14455 Mon Sep 17 00:00:00 2001 From: geekpi Date: Sun, 24 May 2015 10:55:14 +0800 Subject: [PATCH 137/965] translated --- ... Instagram Style Filters to Your Photos.md | 73 ------------------ ... Instagram Style Filters to Your Photos.md | 74 +++++++++++++++++++ 2 files changed, 74 insertions(+), 73 deletions(-) delete mode 100644 sources/share/20150515 This Ubuntu App Applies Instagram Style Filters to Your Photos.md create mode 100644 translated/share/20150515 This Ubuntu App Applies Instagram Style Filters to Your Photos.md diff --git a/sources/share/20150515 This Ubuntu App Applies Instagram Style Filters to Your Photos.md b/sources/share/20150515 This Ubuntu App Applies Instagram Style Filters to Your Photos.md deleted file mode 100644 index e30264f75b..0000000000 --- a/sources/share/20150515 This Ubuntu App Applies Instagram Style Filters to Your Photos.md +++ /dev/null @@ -1,73 +0,0 @@ -translating----geekpi - -This Ubuntu App Applies Instagram Style Filters to Your Photos -================================================================================ -**Looking for an Ubuntu app to apply Instagram style filters to your photos in Ubuntu?** - -Grab your selfie stick and step this way… - -![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/05/instagram-app.jpg) -XnRetro is a photo editing app - -### XnRetro Photo Editor ### - -**XnRetro** is a simple image editing application that lets you quickly add “Instagram like” effects to your photos. - -You know the sort of effects I’m talking about: scratches, noises, and frames, over processing, vintage washes and nostalgic tints (because in this age of digital transience we must know that endless selfies and sandwich snaps are unlikely to ever become nostalgic of themselves). - -Whether you consider such effects to be of asinine artistic value or shortcut to being creative, these kinds of filters are popular and can help add a splash of personality to an otherwise so-so photo. - -#### XnRetro Features #### - -**XnRetro features the following:** - -- 20 color filters -- 15 light effects (bokeh, leaks, etc) -- 28 frames and borders -- 5 Vignettes (with strength control) -- Image adjustments for contrast, gamma, saturation, etc -- Square crop option - -![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/05/Screen-Shot-2015-05-10-at-23.30.01-e1431297068833.png) -Small tweak to make light effects work - -You can save edited images (in theory) as .jpg or .png files and share them straight to social media from within the app. - -I say “in theory” because .jpg saving doesn’t actually work in the Linux version of the app (you can save edited images as .png files though). Similarly, most of the built-in social networking links are borked or just flat out fail on export. - -To get the **15 light leaks** to work you will need to re-save each .jpg image in XnRetro ‘light’ folder as a .png file. Edit the ‘light.xml’ to match the new file names, hit save and the light effects will load up in XnRetro without issue. - -> ‘For user-friendly image editing XnRetro is hard to beat — once you make it work.’ - -**Is XnRetro Worth Installing?** - -XnRetro is not perfect. It’s is pretty old-looking, difficult to properly install and has not been updated for several years. - -It does still work, barring .jpg saving, and is a nimble alternative to an advanced app like The Gimp or Shotwell’s set of ‘serious’ image adjustment tools. - -While web apps and Chrome Apps¹ like [Pixlr Touch Up][1] and [Polarr][2] offer similar features you may be looking for a truly native solution. - -And for that, for user-friendly image editing based around easy-to-apply filters, XnRetro is hard to beat. - -### Download XnRetro for Ubuntu ### - -XnRetro is not available as an installable .deb package. It is distributed as a binary file, meaning you need to double-click on the program file run it each and every time. It’s also 32-bit only. - -You can download XnRetro using the link below. Once completed you need to extract the archive and enter the folder it creates. Double-click on the ‘xnretro’ program binary inside. - -- [Download XnRetro for Linux (32bit, tar.gz)][3] - --------------------------------------------------------------------------------- - -via: http://www.omgubuntu.co.uk/2015/05/instagram-photo-filters-ubuntu-desktop-app - -作者:[Joey-Elijah Sneddon][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://plus.google.com/117485690627814051450/?rel=author -[1]:http://www.omgchrome.com/?s=pixlr -[2]:http://www.omgchrome.com/the-best-chrome-apps-of-2014/ -[3]:http://www.xnview.com/en/xnretro/#downloads diff --git a/translated/share/20150515 This Ubuntu App Applies Instagram Style Filters to Your Photos.md b/translated/share/20150515 This Ubuntu App Applies Instagram Style Filters to Your Photos.md new file mode 100644 index 0000000000..ae5e6df6eb --- /dev/null +++ b/translated/share/20150515 This Ubuntu App Applies Instagram Style Filters to Your Photos.md @@ -0,0 +1,74 @@ +一个Ubuntu中给你的照片加Instagram风格滤镜的程序 +================================================================================ +**在Ubuntu中寻找一个给你的照片加Instagram风格的滤镜程序么?** + +拿起你的自拍棒跟着这个来。 + +![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/05/instagram-app.jpg) +XnRetro是一个照片编辑应用 + +### XnRetro 照片编辑器 ### + +**XnRetro** 是一个可以让你快速给你照片添加“类Instagram”效果的程序。 + +你知道我说的这些效果:划痕、噪点、框架、过处理、复古和怀旧色调(因为在这个数字时代,我们必须知道无尽的自拍不能称为怀旧的自己。) + +无论你认为这些效果是愚蠢的艺术价值或者创作的捷径,这些滤镜非常流行切可以帮助那些平平照片添加个性。 + + +#### XnRetro的功能 #### + +**XnRetro有下面那些功能** + +- 20色彩滤镜 +- 15中光效果(虚化、泄露等等) +- 28框架和边框 +- 5中插图 (带力度控制) +- Image adjustments for contrast, gamma, saturation, etc +- 对比度、伽马、饱和度等图像调整 +- 矩形修剪选项 + +![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/05/Screen-Shot-2015-05-10-at-23.30.01-e1431297068833.png) +灯光效果调整 + +你可以(理论上)编辑。jpg或者.png文件并且直接在app中等想到社交媒体上。 + +我说“理论”上的意思是保存.jpg图像无法正常在linux版的程序上工作(你可以保存.png的图像)。相似的,大多数内置的社交链接失效或者无法导出。 + +要使用**15中光影效果**你需要在XnRetro的‘light’文件夹下重新保存.jpg文件成.png文件。编辑‘light.xml’来匹配新的文件名,点击保存那没灯光效果就可以没有问题的加载进XnRetro了。 + +> ‘用户友好的XnRetro很难打败-一旦你用顺之后。’ + +**XnRetro值得安装么?** + +XnRetro并不是完美的。它看上去很丑、很难正确的安装并且已经纪念没有更新了。 + +它还可以使用,输了保存.jpg文件外。同时也是那些像Gimp或者Shotwell的那些‘正规’图片调整工具的一个灵活替代品。 + +While web apps and Chrome Apps¹ like [Pixlr Touch Up][1] and [Polarr][2] offer similar features you may be looking for a truly native solution. +虽然web应用和Chrome Apps¹像[Pixlr Touch Up][1] 和 [Polarr][2]提供另外相似的功能,而你也许正在寻找真正原生的解决方案。 + +对于此,用户友好带有容易使用滤镜的XnRetro很难被打败。 + +### 下载Ubuntu下的XnRetro ### + +XnRetro没有可用的.deb安装包。它以二进制文件的形式发型,这意味着你需要每次双击程序来运行。它也只有32位的版本。 + +你可以使用下面的XnRetro下载链接。下载完成后你需要解压压缩包并进入。双击里面的‘xnretro’程序。 + +- [下载Linux版XnRetro (32位, tar.gz)][3] + +-------------------------------------------------------------------------------- + +via: http://www.omgubuntu.co.uk/2015/05/instagram-photo-filters-ubuntu-desktop-app + +作者:[Joey-Elijah Sneddon][a] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://plus.google.com/117485690627814051450/?rel=author +[1]:http://www.omgchrome.com/?s=pixlr +[2]:http://www.omgchrome.com/the-best-chrome-apps-of-2014/ +[3]:http://www.xnview.com/en/xnretro/#downloads From 03960afa819cccf18a5db08834e36e50022da6e6 Mon Sep 17 00:00:00 2001 From: zhangkun Date: Sun, 24 May 2015 15:43:19 +0800 Subject: [PATCH 138/965] Finished translating --- ... Manage 'Suse' Linux Package Management.md | 1594 ++++++++--------- 1 file changed, 767 insertions(+), 827 deletions(-) diff --git a/sources/tech/20150512 45 Zypper Commands to Manage 'Suse' Linux Package Management.md b/sources/tech/20150512 45 Zypper Commands to Manage 'Suse' Linux Package Management.md index 1f5661e8c4..bfd3eeeaf5 100644 --- a/sources/tech/20150512 45 Zypper Commands to Manage 'Suse' Linux Package Management.md +++ b/sources/tech/20150512 45 Zypper Commands to Manage 'Suse' Linux Package Management.md @@ -1,827 +1,767 @@ -zhangboyue 翻译中 -45 Zypper Commands to Manage ‘Suse’ Linux Package Management -================================================================================ -SUSE (Software and System Entwicklung (Germany) meaning Software and System Development, in English) Linux lies on top of Linux Kernel brought by Novell. SUSE comes in two pack. One of them is called OpenSUSE, which is freely available (free as in speech as well as free as in wine). It is a community driven project packed with latest application support, the latest stable release of OpenSUSE Linux is 13.2. - -The other is SUSE Linux Enterprise which is a commercial Linux Distribution designed specially for enterprise and production. SUSE Linux Enterprise edition comes with a variety of Enterprise Applications and features suited for production environment, the latest stable release of SUSE Linux Enterprise Edition is 12. - -You may like to check the detailed installation instruction of SUSE Linux Enterprise Server at: - -- [Installation of SUSE Linux Enterprise Server 12][1] - -Zypper and YaST are the Package Manager for SUSE Linux, which works on top of RPM. - -YaST which stands for Yet another Setup Tool is a tool that works on OpenSUSE and SUSE Enterprise edition to administer, setup and configure SUSE Linux. - -Zypper is the command line interface of ZYpp package manager for installing, removing and updating SUSE. ZYpp is the package management engine that powers both Zypper and YaST. - -Here in this article we will see Zypper in action, which will be installing, updating, removing and doing every other thing a package manager can do. Here we go… - -**Important** : Remember all these command are meant for system wide changes hence must be run as root, else the command will fail. - -### Getting Basic Help with Zypper ### - -1. Run zypper without any option, will give you a list of all global options and commands. - - # zypper - - Usage: - zypper [--global-options] - -2. To get help on a specific command say ‘in’ (install), run the below commands. - - # zypper help in - OR - # zypper help install - - install (in) [options] ... - - Install packages with specified capabilities or RPM files with specified - location. A capability is NAME[.ARCH][OP], where OP is one - of <, <=, =, >=, >. - - Command options: - --from Select packages from the specified repository. - -r, --repo Load only the specified repository. - -t, --type Type of package (package, patch, pattern, product, srcpackage). - Default: package. - -n, --name Select packages by plain name, not by capability. - -C, --capability Select packages by capability. - -f, --force Install even if the item is already installed (reinstall), - downgraded or changes vendor or architecture. - --oldpackage Allow to replace a newer item with an older one. - Handy if you are doing a rollback. Unlike --force - it will not enforce a reinstall. - --replacefiles Install the packages even if they replace files from other, - already installed, packages. Default is to treat file conflicts - as an error. --download-as-needed disables the fileconflict check. - ...... - -3. Search for a package (say gnome-desktop) before installing. - - # zypper se gnome-desktop - - Retrieving repository 'openSUSE-13.2-Debug' metadata ............................................................[done] - Building repository 'openSUSE-13.2-Debug' cache .................................................................[done] - Retrieving repository 'openSUSE-13.2-Non-Oss' metadata ......................................................... [done] - Building repository 'openSUSE-13.2-Non-Oss' cache ...............................................................[done] - Retrieving repository 'openSUSE-13.2-Oss' metadata ..............................................................[done] - Building repository 'openSUSE-13.2-Oss' cache ...................................................................[done] - Retrieving repository 'openSUSE-13.2-Update' metadata ...........................................................[done] - Building repository 'openSUSE-13.2-Update' cache ................................................................[done] - Retrieving repository 'openSUSE-13.2-Update-Non-Oss' metadata ...................................................[done] - Building repository 'openSUSE-13.2-Update-Non-Oss' cache ........................................................[done] - Loading repository data... - Reading installed packages... - - S | Name | Summary | Type - --+---------------------------------------+-----------------------------------------------------------+----------- - | gnome-desktop2-lang | Languages for package gnome-desktop2 | package - | gnome-desktop2 | The GNOME Desktop API Library | package - | libgnome-desktop-2-17 | The GNOME Desktop API Library | package - | libgnome-desktop-3-10 | The GNOME Desktop API Library | package - | libgnome-desktop-3-devel | The GNOME Desktop API Library -- Development Files | package - | libgnome-desktop-3_0-common | The GNOME Desktop API Library -- Common data files | package - | gnome-desktop-debugsource | Debug sources for package gnome-desktop | package - | gnome-desktop-sharp2-debugsource | Debug sources for package gnome-desktop-sharp2 | package - | gnome-desktop2-debugsource | Debug sources for package gnome-desktop2 | package - | libgnome-desktop-2-17-debuginfo | Debug information for package libgnome-desktop-2-17 | package - | libgnome-desktop-3-10-debuginfo | Debug information for package libgnome-desktop-3-10 | package - | libgnome-desktop-3_0-common-debuginfo | Debug information for package libgnome-desktop-3_0-common | package - | libgnome-desktop-2-17-debuginfo-32bit | Debug information for package libgnome-desktop-2-17 | package - | libgnome-desktop-3-10-debuginfo-32bit | Debug information for package libgnome-desktop-3-10 | package - | gnome-desktop-sharp2 | Mono bindings for libgnome-desktop | package - | libgnome-desktop-2-devel | The GNOME Desktop API Library -- Development Files | package - | gnome-desktop-lang | Languages for package gnome-desktop | package - | libgnome-desktop-2-17-32bit | The GNOME Desktop API Library | package - | libgnome-desktop-3-10-32bit | The GNOME Desktop API Library | package - | gnome-desktop | The GNOME Desktop API Library | srcpackage - -4. Get information on a pattern package (say lamp_server) using following command. - - # zypper info -t pattern lamp_server - - Loading repository data... - Reading installed packages... - - - Information for pattern lamp_server: - ------------------------------------ - Repository: openSUSE-13.2-Update - Name: lamp_server - Version: 20141007-5.1 - Arch: x86_64 - Vendor: openSUSE - Installed: No - Visible to User: Yes - Summary: Web and LAMP Server - Description: - Software to set up a Web server that is able to serve static, dynamic, and interactive content (like a Web shop). This includes Apache HTTP Server, the database management system MySQL, - and scripting languages such as PHP, Python, Ruby on Rails, or Perl. - Contents: - - S | Name | Type | Dependency - --+-------------------------------+---------+----------- - | apache2-mod_php5 | package | - | php5-iconv | package | - i | patterns-openSUSE-base | package | - i | apache2-prefork | package | - | php5-dom | package | - | php5-mysql | package | - i | apache2 | package | - | apache2-example-pages | package | - | mariadb | package | - | apache2-mod_perl | package | - | php5-ctype | package | - | apache2-doc | package | - | yast2-http-server | package | - | patterns-openSUSE-lamp_server | package | - -5. To open zypper shell session run the below command. - - # zypper shell - OR - # zypper sh - - zypper> help - Usage: - zypper [--global-options] - -**Note**: On Zypper shell type ‘help‘ to get a list of global options and commands. - -### Zypper Repository Management ### - -#### Listing Defined Repositories #### - -6. Use zypper repos or zypper lr commands to list all the defined repositories. - - # zypper repos - OR - # zypper lr - - | Alias | Name | Enabled | Refresh - --+---------------------------+------------------------------------+---------+-------- - 1 | openSUSE-13.2-0 | openSUSE-13.2-0 | Yes | No - 2 | repo-debug | openSUSE-13.2-Debug | Yes | Yes - 3 | repo-debug-update | openSUSE-13.2-Update-Debug | No | Yes - 4 | repo-debug-update-non-oss | openSUSE-13.2-Update-Debug-Non-Oss | No | Yes - 5 | repo-non-oss | openSUSE-13.2-Non-Oss | Yes | Yes - 6 | repo-oss | openSUSE-13.2-Oss | Yes | Yes - 7 | repo-source | openSUSE-13.2-Source | No | Yes - 8 | repo-update | openSUSE-13.2-Update | Yes | Yes - 9 | repo-update-non-oss | openSUSE-13.2-Update-Non-Oss | Yes | Yes - -7. List zypper URI on the table. - - # zypper lr -u - - # | Alias | Name | Enabled | Refresh | URI - --+---------------------------+------------------------------------+---------+---------+---------------------------------------------------------------- - 1 | openSUSE-13.2-0 | openSUSE-13.2-0 | Yes | No | cd:///?devices=/dev/disk/by-id/ata-VBOX_CD-ROM_VB2-01700376 - 2 | repo-debug | openSUSE-13.2-Debug | Yes | Yes | http://download.opensuse.org/debug/distribution/13.2/repo/oss/ - 3 | repo-debug-update | openSUSE-13.2-Update-Debug | No | Yes | http://download.opensuse.org/debug/update/13.2/ - 4 | repo-debug-update-non-oss | openSUSE-13.2-Update-Debug-Non-Oss | No | Yes | http://download.opensuse.org/debug/update/13.2-non-oss/ - 5 | repo-non-oss | openSUSE-13.2-Non-Oss | Yes | Yes | http://download.opensuse.org/distribution/13.2/repo/non-oss/ - 6 | repo-oss | openSUSE-13.2-Oss | Yes | Yes | http://download.opensuse.org/distribution/13.2/repo/oss/ - 7 | repo-source | openSUSE-13.2-Source | No | Yes | http://download.opensuse.org/source/distribution/13.2/repo/oss/ - 8 | repo-update | openSUSE-13.2-Update | Yes | Yes | http://download.opensuse.org/update/13.2/ - 9 | repo-update-non-oss | openSUSE-13.2-Update-Non-Oss | Yes | Yes | http://download.opensuse.org/update/13.2-non-oss/ - -8. List repository priority and list by priority. - - # zypper lr -P - - # | Alias | Name | Enabled | Refresh | Priority - --+---------------------------+------------------------------------+---------+---------+--------- - 1 | openSUSE-13.2-0 | openSUSE-13.2-0 | Yes | No | 99 - 2 | repo-debug | openSUSE-13.2-Debug | Yes | Yes | 99 - 3 | repo-debug-update | openSUSE-13.2-Update-Debug | No | Yes | 99 - 4 | repo-debug-update-non-oss | openSUSE-13.2-Update-Debug-Non-Oss | No | Yes | 99 - 5 | repo-non-oss | openSUSE-13.2-Non-Oss | Yes | Yes | 85 - 6 | repo-oss | openSUSE-13.2-Oss | Yes | Yes | 99 - 7 | repo-source | openSUSE-13.2-Source | No | Yes | 99 - 8 | repo-update | openSUSE-13.2-Update | Yes | Yes | 99 - 9 | repo-update-non-oss | openSUSE-13.2-Update-Non-Oss | Yes | Yes | 99 - -#### Refreshing Repositories #### - -9. Use commands zypper refresh or zypper ref to refresh zypper repositories. - - # zypper refresh - OR - # zypper ref - - Repository 'openSUSE-13.2-0' is up to date. - Repository 'openSUSE-13.2-Debug' is up to date. - Repository 'openSUSE-13.2-Non-Oss' is up to date. - Repository 'openSUSE-13.2-Oss' is up to date. - Repository 'openSUSE-13.2-Update' is up to date. - Repository 'openSUSE-13.2-Update-Non-Oss' is up to date. - All repositories have been refreshed. - -10. To refresh a specific repository say ‘repo-non-oss‘, type: - - # zypper refresh repo-non-oss - - Repository 'openSUSE-13.2-Non-Oss' is up to date. - Specified repositories have been refreshed. - -11. To force update a repository say ‘repo-non-oss‘, type: - - # zypper ref -f repo-non-oss - - Forcing raw metadata refresh - Retrieving repository 'openSUSE-13.2-Non-Oss' metadata ............................................................[done] - Forcing building of repository cache - Building repository 'openSUSE-13.2-Non-Oss' cache ............................................................[done] - Specified repositories have been refreshed. - -#### Modifying Repositories #### - -Here, we use ‘zypper modifyrepo‘ or ‘zypper mr‘ commands to disable, enable zypper repositories. - -12. Before disabling repository, you must know that in Zypper, every repository has its own unique number, that is used to disable or enable a repository. - -Let’s say you want to disable repository ‘repo-oss‘, to disable first you need to its number by typing following command. - - # zypper lr - - # | Alias | Name | Enabled | Refresh - --+---------------------------+------------------------------------+---------+-------- - 1 | openSUSE-13.2-0 | openSUSE-13.2-0 | Yes | No - 2 | repo-debug | openSUSE-13.2-Debug | Yes | Yes - 3 | repo-debug-update | openSUSE-13.2-Update-Debug | No | Yes - 4 | repo-debug-update-non-oss | openSUSE-13.2-Update-Debug-Non-Oss | No | Yes - 5 | repo-non-oss | openSUSE-13.2-Non-Oss | Yes | Yes - 6 | repo-oss | openSUSE-13.2-Oss | No | Yes - 7 | repo-source | openSUSE-13.2-Source | No | Yes - 8 | repo-update | openSUSE-13.2-Update | Yes | Yes - 9 | repo-update-non-oss | openSUSE-13.2-Update-Non-Oss | Yes | Yes - -Do you see in the above output, that the repository ‘repo-oss‘ having number 6, to disable this you need to specify number 6 along with following command. - - # zypper mr -d 6 - - Repository 'repo-oss' has been successfully disabled. - -13. To enable again same repository ‘repo-oss‘, which appears at number 6 (as shown in above example). - - # zypper mr -e 6 - - Repository 'repo-oss' has been successfully enabled. - -14. Enable auto-refresh and rpm file ‘caching‘ for a repo say ‘repo-non-oss‘ and set its priority to say 85. - - # zypper mr -rk -p 85 repo-non-oss - - Repository 'repo-non-oss' priority has been left unchanged (85) - Nothing to change for repository 'repo-non-oss'. - -15. Disable rpm file caching for all the repositories. - - # zypper mr -Ka - - RPM files caching has been disabled for repository 'openSUSE-13.2-0'. - RPM files caching has been disabled for repository 'repo-debug'. - RPM files caching has been disabled for repository 'repo-debug-update'. - RPM files caching has been disabled for repository 'repo-debug-update-non-oss'. - RPM files caching has been disabled for repository 'repo-non-oss'. - RPM files caching has been disabled for repository 'repo-oss'. - RPM files caching has been disabled for repository 'repo-source'. - RPM files caching has been disabled for repository 'repo-update'. - RPM files caching has been disabled for repository 'repo-update-non-oss'. - -16. Enable rpm file caching for all the repositories. - - # zypper mr -ka - - RPM files caching has been enabled for repository 'openSUSE-13.2-0'. - RPM files caching has been enabled for repository 'repo-debug'. - RPM files caching has been enabled for repository 'repo-debug-update'. - RPM files caching has been enabled for repository 'repo-debug-update-non-oss'. - RPM files caching has been enabled for repository 'repo-non-oss'. - RPM files caching has been enabled for repository 'repo-oss'. - RPM files caching has been enabled for repository 'repo-source'. - RPM files caching has been enabled for repository 'repo-update'. - RPM files caching has been enabled for repository 'repo-update-non-oss'. - -17. Disable rpm file caching for remote repositories. - - # zypper mr -Kt - - RPM files caching has been disabled for repository 'repo-debug'. - RPM files caching has been disabled for repository 'repo-debug-update'. - RPM files caching has been disabled for repository 'repo-debug-update-non-oss'. - RPM files caching has been disabled for repository 'repo-non-oss'. - RPM files caching has been disabled for repository 'repo-oss'. - RPM files caching has been disabled for repository 'repo-source'. - RPM files caching has been disabled for repository 'repo-update'. - RPM files caching has been disabled for repository 'repo-update-non-oss'. - -18. Enable rpm file caching for remote repositories. - - # zypper mr -kt - - RPM files caching has been enabled for repository 'repo-debug'. - RPM files caching has been enabled for repository 'repo-debug-update'. - RPM files caching has been enabled for repository 'repo-debug-update-non-oss'. - RPM files caching has been enabled for repository 'repo-non-oss'. - RPM files caching has been enabled for repository 'repo-oss'. - RPM files caching has been enabled for repository 'repo-source'. - RPM files caching has been enabled for repository 'repo-update'. - RPM files caching has been enabled for repository 'repo-update-non-oss'. - -#### Adding Repositories #### - -You may make use of any of the two commands – ‘zypper addrepo‘ or ‘zypper ar‘. You may use repo url or alias to add Repository. - -19. Add a repository say “http://download.opensuse.org/update/12.3/”. - - # zypper ar http://download.opensuse.org/update/11.1/ update - - Adding repository 'update' .............................................................................................................................................................[done] - Repository 'update' successfully added - Enabled : Yes - Autorefresh : No - GPG check : Yes - URI : http://download.opensuse.org/update/11.1/ - -20. Rename a repository. It will change the alias only. You may use command ‘zypper namerepo‘ or ‘zypper nr‘. To rename aka change alias of a repo that appears at number 10 (zypper lr) to upd8, run the below command. - - # zypper nr 10 upd8 - - Repository 'update' renamed to 'upd8'. - -#### Removing Repositories #### - -21. Remove a repository. It will remove the repository from the system. You may use the command ‘zypper removerepo‘ or ‘zypper rr‘. To remove a repo say ‘upd8‘, run the below command. - - # zypper rr upd8 - - # Removing repository 'upd8' .........................................................................................[done] - Repository 'upd8' has been removed. - -### Package Management using Zypper ### - -#### Install a Package with Zypper #### - -22. With Zypper, we can install packages based upon capability name. For example, to install a package (say Mozilla Firefox) using capability name. - - # zypper in MozillaFirefox - - Loading repository data... - Reading installed packages... - Resolving package dependencies... - - The following 128 NEW packages are going to be installed: - adwaita-icon-theme at-spi2-atk-common at-spi2-atk-gtk2 at-spi2-core cantarell-fonts cups-libs desktop-file-utils fontconfig gdk-pixbuf-query-loaders gstreamer gstreamer-fluendo-mp3 - gstreamer-plugins-base gtk2-branding-openSUSE gtk2-data gtk2-immodule-amharic gtk2-immodule-inuktitut gtk2-immodule-thai gtk2-immodule-vietnamese gtk2-metatheme-adwaita - gtk2-theming-engine-adwaita gtk2-tools gtk3-data gtk3-metatheme-adwaita gtk3-tools hicolor-icon-theme hicolor-icon-theme-branding-openSUSE libasound2 libatk-1_0-0 libatk-bridge-2_0-0 - libatspi0 libcairo2 libcairo-gobject2 libcanberra0 libcanberra-gtk0 libcanberra-gtk2-module libcanberra-gtk3-0 libcanberra-gtk3-module libcanberra-gtk-module-common libcdda_interface0 - libcdda_paranoia0 libcolord2 libdrm2 libdrm_intel1 libdrm_nouveau2 libdrm_radeon1 libFLAC8 libfreebl3 libgbm1 libgdk_pixbuf-2_0-0 libgraphite2-3 libgstapp-1_0-0 libgstaudio-1_0-0 - libgstpbutils-1_0-0 libgstreamer-1_0-0 libgstriff-1_0-0 libgsttag-1_0-0 libgstvideo-1_0-0 libgthread-2_0-0 libgtk-2_0-0 libgtk-3-0 libharfbuzz0 libjasper1 libjbig2 libjpeg8 libjson-c2 - liblcms2-2 libLLVM libltdl7 libnsssharedhelper0 libogg0 liborc-0_4-0 libpackagekit-glib2-18 libpango-1_0-0 libpciaccess0 libpixman-1-0 libpulse0 libsndfile1 libsoftokn3 libspeex1 - libsqlite3-0 libstartup-notification-1-0 libtheoradec1 libtheoraenc1 libtiff5 libvisual libvorbis0 libvorbisenc2 libvorbisfile3 libwayland-client0 libwayland-cursor0 libwayland-server0 - libX11-xcb1 libxcb-dri2-0 libxcb-dri3-0 libxcb-glx0 libxcb-present0 libxcb-render0 libxcb-shm0 libxcb-sync1 libxcb-util1 libxcb-xfixes0 libXcomposite1 libXcursor1 libXdamage1 libXevie1 - libXfixes3 libXft2 libXi6 libXinerama1 libxkbcommon-0_4_3 libXrandr2 libXrender1 libxshmfence1 libXtst6 libXv1 libXxf86vm1 Mesa Mesa-libEGL1 Mesa-libGL1 Mesa-libglapi0 - metatheme-adwaita-common MozillaFirefox MozillaFirefox-branding-openSUSE mozilla-nss mozilla-nss-certs PackageKit-gstreamer-plugin pango-tools sound-theme-freedesktop - - The following 10 recommended packages were automatically selected: - gstreamer-fluendo-mp3 gtk2-branding-openSUSE gtk2-data gtk2-immodule-amharic gtk2-immodule-inuktitut gtk2-immodule-thai gtk2-immodule-vietnamese libcanberra0 libpulse0 - PackageKit-gstreamer-plugin - - 128 new packages to install. - Overall download size: 77.2 MiB. Already cached: 0 B After the operation, additional 200.0 MiB will be used. - Continue? [y/n/? shows all options] (y): y - Retrieving package cantarell-fonts-0.0.16-1.1.noarch (1/128), 74.1 KiB (115.6 KiB unpacked) - Retrieving: cantarell-fonts-0.0.16-1.1.noarch.rpm .........................................................................................................................[done (63.4 KiB/s)] - Retrieving package hicolor-icon-theme-0.13-2.1.2.noarch (2/128), 40.1 KiB ( 50.5 KiB unpacked) - Retrieving: hicolor-icon-theme-0.13-2.1.2.noarch.rpm ...................................................................................................................................[done] - Retrieving package sound-theme-freedesktop-0.8-7.1.2.noarch (3/128), 372.6 KiB (460.3 KiB unpacked) - -23. Install a package (say gcc) using version. - - # zypper in 'gcc<5.1' - - Loading repository data... - Reading installed packages... - Resolving package dependencies... - - The following 13 NEW packages are going to be installed: - cpp cpp48 gcc gcc48 libasan0 libatomic1-gcc49 libcloog-isl4 libgomp1-gcc49 libisl10 libitm1-gcc49 libmpc3 libmpfr4 libtsan0-gcc49 - - 13 new packages to install. - Overall download size: 14.5 MiB. Already cached: 0 B After the operation, additional 49.4 MiB will be used. - Continue? [y/n/? shows all options] (y): y - -24. Install a package (say gcc) for architecture (say i586). - - # zypper in gcc.i586 - - Loading repository data... - Reading installed packages... - Resolving package dependencies... - - The following 13 NEW packages are going to be installed: - cpp cpp48 gcc gcc48 libasan0 libatomic1-gcc49 libcloog-isl4 libgomp1-gcc49 libisl10 libitm1-gcc49 libmpc3 libmpfr4 libtsan0-gcc49 - - 13 new packages to install. - Overall download size: 14.5 MiB. Already cached: 0 B After the operation, additional 49.4 MiB will be used. - Continue? [y/n/? shows all options] (y): y - Retrieving package libasan0-4.8.3+r212056-2.2.4.x86_64 (1/13), 74.2 KiB (166.9 KiB unpacked) - Retrieving: libasan0-4.8.3+r212056-2.2.4.x86_64.rpm .......................................................................................................................[done (79.2 KiB/s)] - Retrieving package libatomic1-gcc49-4.9.0+r211729-2.1.7.x86_64 (2/13), 14.3 KiB ( 26.1 KiB unpacked) - Retrieving: libatomic1-gcc49-4.9.0+r211729-2.1.7.x86_64.rpm ...............................................................................................................[done (55.3 KiB/s)] - -25. Install a package (say gcc) for specific architecture (say i586) and specific version (say <5.1), - - # zypper in 'gcc.i586<5.1' - - Loading repository data... - Reading installed packages... - Resolving package dependencies... - - The following 13 NEW packages are going to be installed: - cpp cpp48 gcc gcc48 libasan0 libatomic1-gcc49 libcloog-isl4 libgomp1-gcc49 libisl10 libitm1-gcc49 libmpc3 libmpfr4 libtsan0-gcc49 - - 13 new packages to install. - Overall download size: 14.4 MiB. Already cached: 129.5 KiB After the operation, additional 49.4 MiB will be used. - Continue? [y/n/? shows all options] (y): y - In cache libasan0-4.8.3+r212056-2.2.4.x86_64.rpm (1/13), 74.2 KiB (166.9 KiB unpacked) - In cache libatomic1-gcc49-4.9.0+r211729-2.1.7.x86_64.rpm (2/13), 14.3 KiB ( 26.1 KiB unpacked) - In cache libgomp1-gcc49-4.9.0+r211729-2.1.7.x86_64.rpm (3/13), 41.1 KiB ( 90.7 KiB unpacked) - -26. Install a Package (say libxine) from repository (amarok). - - # zypper in amarok upd:libxine1 - - Loading repository data... - Reading installed packages... - Resolving package dependencies... - The following 202 NEW packages are going to be installed: - amarok bundle-lang-kde-en clamz cups-libs enscript fontconfig gdk-pixbuf-query-loaders ghostscript-fonts-std gptfdisk gstreamer gstreamer-plugins-base hicolor-icon-theme - hicolor-icon-theme-branding-openSUSE htdig hunspell hunspell-tools icoutils ispell ispell-american kde4-filesystem kdebase4-runtime kdebase4-runtime-branding-openSUSE kdelibs4 - kdelibs4-branding-openSUSE kdelibs4-core kdialog libakonadi4 l - ..... - -27. Install a Package (say git) using name (-n). - - # zypper in -n git - - Loading repository data... - Reading installed packages... - Resolving package dependencies... - - The following 35 NEW packages are going to be installed: - cvs cvsps fontconfig git git-core git-cvs git-email git-gui gitk git-svn git-web libserf-1-1 libsqlite3-0 libXft2 libXrender1 libXss1 perl-Authen-SASL perl-Clone perl-DBD-SQLite perl-DBI - perl-Error perl-IO-Socket-SSL perl-MLDBM perl-Net-Daemon perl-Net-SMTP-SSL perl-Net-SSLeay perl-Params-Util perl-PlRPC perl-SQL-Statement perl-Term-ReadKey subversion subversion-perl tcl - tk xhost - - The following 13 recommended packages were automatically selected: - git-cvs git-email git-gui gitk git-svn git-web perl-Authen-SASL perl-Clone perl-MLDBM perl-Net-Daemon perl-Net-SMTP-SSL perl-PlRPC perl-SQL-Statement - - The following package is suggested, but will not be installed: - git-daemon - - 35 new packages to install. - Overall download size: 15.6 MiB. Already cached: 0 B After the operation, additional 56.7 MiB will be used. - Continue? [y/n/? shows all options] (y): y - -28. Install a package using wildcards. For example, install all php5 packages. - - # zypper in php5* - - Loading repository data... - Reading installed packages... - Resolving package dependencies... - - Problem: php5-5.6.1-18.1.x86_64 requires smtp_daemon, but this requirement cannot be provided - uninstallable providers: exim-4.83-3.1.8.x86_64[openSUSE-13.2-0] - postfix-2.11.0-5.2.2.x86_64[openSUSE-13.2-0] - sendmail-8.14.9-2.2.2.x86_64[openSUSE-13.2-0] - exim-4.83-3.1.8.i586[repo-oss] - msmtp-mta-1.4.32-2.1.3.i586[repo-oss] - postfix-2.11.0-5.2.2.i586[repo-oss] - sendmail-8.14.9-2.2.2.i586[repo-oss] - exim-4.83-3.1.8.x86_64[repo-oss] - msmtp-mta-1.4.32-2.1.3.x86_64[repo-oss] - postfix-2.11.0-5.2.2.x86_64[repo-oss] - sendmail-8.14.9-2.2.2.x86_64[repo-oss] - postfix-2.11.3-5.5.1.i586[repo-update] - postfix-2.11.3-5.5.1.x86_64[repo-update] - Solution 1: Following actions will be done: - do not install php5-5.6.1-18.1.x86_64 - do not install php5-pear-Auth_SASL-1.0.6-7.1.3.noarch - do not install php5-pear-Horde_Http-2.0.1-6.1.3.noarch - do not install php5-pear-Horde_Image-2.0.1-6.1.3.noarch - do not install php5-pear-Horde_Kolab_Format-2.0.1-6.1.3.noarch - do not install php5-pear-Horde_Ldap-2.0.1-6.1.3.noarch - do not install php5-pear-Horde_Memcache-2.0.1-7.1.3.noarch - do not install php5-pear-Horde_Mime-2.0.2-6.1.3.noarch - do not install php5-pear-Horde_Oauth-2.0.0-6.1.3.noarch - do not install php5-pear-Horde_Pdf-2.0.1-6.1.3.noarch - .... - -29. Install a Package (say lamp_server) using pattern (group of packages). - - # zypper in -t pattern lamp_server - - ading repository data... - Reading installed packages... - Resolving package dependencies... - - The following 29 NEW packages are going to be installed: - apache2 apache2-doc apache2-example-pages apache2-mod_perl apache2-prefork patterns-openSUSE-lamp_server perl-Data-Dump perl-Encode-Locale perl-File-Listing perl-HTML-Parser - perl-HTML-Tagset perl-HTTP-Cookies perl-HTTP-Daemon perl-HTTP-Date perl-HTTP-Message perl-HTTP-Negotiate perl-IO-HTML perl-IO-Socket-SSL perl-libwww-perl perl-Linux-Pid - perl-LWP-MediaTypes perl-LWP-Protocol-https perl-Net-HTTP perl-Net-SSLeay perl-Tie-IxHash perl-TimeDate perl-URI perl-WWW-RobotRules yast2-http-server - - The following NEW pattern is going to be installed: - lamp_server - - The following 10 recommended packages were automatically selected: - apache2 apache2-doc apache2-example-pages apache2-mod_perl apache2-prefork perl-Data-Dump perl-IO-Socket-SSL perl-LWP-Protocol-https perl-TimeDate yast2-http-server - - 29 new packages to install. - Overall download size: 7.2 MiB. Already cached: 1.2 MiB After the operation, additional 34.7 MiB will be used. - Continue? [y/n/? shows all options] (y): - -30. Install a Package (say nano) and remove a package (say vi) in one go. - - # zypper in nano -vi - - Loading repository data... - Reading installed packages... - '-vi' not found in package names. Trying capabilities. - Resolving package dependencies... - - The following 2 NEW packages are going to be installed: - nano nano-lang - - The following package is going to be REMOVED: - vim - - The following recommended package was automatically selected: - nano-lang - - 2 new packages to install, 1 to remove. - Overall download size: 550.0 KiB. Already cached: 0 B After the operation, 463.3 KiB will be freed. - Continue? [y/n/? shows all options] (y): - ... - -31. Install a rpm package (say teamviewer). - - # zypper in teamviewer*.rpm - - Loading repository data... - Reading installed packages... - Resolving package dependencies... - - The following 24 NEW packages are going to be installed: - alsa-oss-32bit fontconfig-32bit libasound2-32bit libexpat1-32bit libfreetype6-32bit libgcc_s1-gcc49-32bit libICE6-32bit libjpeg62-32bit libpng12-0-32bit libpng16-16-32bit libSM6-32bit - libuuid1-32bit libX11-6-32bit libXau6-32bit libxcb1-32bit libXdamage1-32bit libXext6-32bit libXfixes3-32bit libXinerama1-32bit libXrandr2-32bit libXrender1-32bit libXtst6-32bit - libz1-32bit teamviewer - - The following recommended package was automatically selected: - alsa-oss-32bit - - 24 new packages to install. - Overall download size: 41.2 MiB. Already cached: 0 B After the operation, additional 119.7 MiB will be used. - Continue? [y/n/? shows all options] (y): - .. - -#### Remove a Package with Zypper #### - -32. To remove any package, you can use ‘zypper remove‘ or ‘zypper rm‘ commands. For example, to remove a package (say apache2), run: - - # zypper remove apache2 - Or - # zypper rm apache2 - - Loading repository data... - Reading installed packages... - Resolving package dependencies... - - The following 2 packages are going to be REMOVED: - apache2 apache2-prefork - - 2 packages to remove. - After the operation, 4.2 MiB will be freed. - Continue? [y/n/? shows all options] (y): y - (1/2) Removing apache2-2.4.10-19.1 ........................................................................[done] - (2/2) Removing apache2-prefork-2.4.10-19.1 ................................................................[done] - -#### Updating Packages using Zypper #### - -33. Update all packages. You may use commands ‘zypper update‘ or ‘zypper up‘. - - # zypper up - OR - # zypper update - - Loading repository data... - Reading installed packages... - Nothing to do. - -34. Update specific packages (say apache2 and openssh). - - # zypper up apache2 openssh - - Loading repository data... - Reading installed packages... - No update candidate for 'apache2-2.4.10-19.1.x86_64'. The highest available version is already installed. - No update candidate for 'openssh-6.6p1-5.1.3.x86_64'. The highest available version is already installed. - Resolving package dependencies... - - Nothing to do. - -35. Install a package say (mariadb) if not installed, if installed update it. - - # zypper in mariadb - - Loading repository data... - Reading installed packages... - 'mariadb' is already installed. - No update candidate for 'mariadb-10.0.13-2.6.1.x86_64'. The highest available version is already installed. - Resolving package dependencies... - - Nothing to do. - -#### Install Source and Build Dependencies #### - -You may use ‘zypper source-install‘ or ‘zypper si‘ commands to build packages from source. - -36. Install source packages and build their dependencies for a package (say mariadb). - - # zypper si mariadb - - Reading installed packages... - Loading repository data... - Resolving package dependencies... - - The following 36 NEW packages are going to be installed: - autoconf automake bison cmake cpp cpp48 gcc gcc48 gcc48-c++ gcc-c++ libaio-devel libarchive13 libasan0 libatomic1-gcc49 libcloog-isl4 libedit-devel libevent-devel libgomp1-gcc49 libisl10 - libitm1-gcc49 libltdl7 libmpc3 libmpfr4 libopenssl-devel libstdc++48-devel libtool libtsan0-gcc49 m4 make ncurses-devel pam-devel readline-devel site-config tack tcpd-devel zlib-devel - - The following source package is going to be installed: - mariadb - - 36 new packages to install, 1 source package. - Overall download size: 71.5 MiB. Already cached: 129.5 KiB After the operation, additional 183.9 MiB will be used. - Continue? [y/n/? shows all options] (y): y - -37. Install only the source for a package (say mariadb). - - # zypper in -D mariadb - - Loading repository data... - Reading installed packages... - 'mariadb' is already installed. - No update candidate for 'mariadb-10.0.13-2.6.1.x86_64'. The highest available version is already installed. - Resolving package dependencies... - - Nothing to do. - -38. Install only the build dependencies for a packages (say mariadb). - - # zypper si -d mariadb - - Reading installed packages... - Loading repository data... - Resolving package dependencies... - - The following 36 NEW packages are going to be installed: - autoconf automake bison cmake cpp cpp48 gcc gcc48 gcc48-c++ gcc-c++ libaio-devel libarchive13 libasan0 libatomic1-gcc49 libcloog-isl4 libedit-devel libevent-devel libgomp1-gcc49 libisl10 - libitm1-gcc49 libltdl7 libmpc3 libmpfr4 libopenssl-devel libstdc++48-devel libtool libtsan0-gcc49 m4 make ncurses-devel pam-devel readline-devel site-config tack tcpd-devel zlib-devel - - The following package is recommended, but will not be installed due to conflicts or dependency issues: - readline-doc - - 36 new packages to install. - Overall download size: 33.7 MiB. Already cached: 129.5 KiB After the operation, additional 144.3 MiB will be used. - Continue? [y/n/? shows all options] (y): y - -#### Zypper in Scripts and Applications #### - -39. Install a Package (say mariadb) without interaction of user. - - # zypper --non-interactive in mariadb - - Loading repository data... - Reading installed packages... - 'mariadb' is already installed. - No update candidate for 'mariadb-10.0.13-2.6.1.x86_64'. The highest available version is already installed. - Resolving package dependencies... - - Nothing to do. - -40. Remove a Package (say mariadb) without interaction of user. - - # zypper --non-interactive rm mariadb - - Loading repository data... - Reading installed packages... - Resolving package dependencies... - - The following package is going to be REMOVED: - mariadb - - 1 package to remove. - After the operation, 71.8 MiB will be freed. - Continue? [y/n/? shows all options] (y): y - (1/1) Removing mariadb-10.0.13-2.6.1 .............................................................................[done] - -41. Output zypper in xml. - - # zypper --xmlout - - - - Usage: - zypper [--global-options] [--command-options] [arguments] - - Global Options - .... - -42. Generate quiet output at installation. - - # zypper --quiet in mariadb - - The following NEW package is going to be installed: - mariadb - - 1 new package to install. - Overall download size: 0 B. Already cached: 7.8 MiB After the operation, additional 71.8 MiB will be used. - Continue? [y/n/? shows all options] (y): - ... - -43. Generate quiet output at UN-installation. - - # zypper --quiet rm mariadb - -44. Auto agree to Licenses/Agreements. - - # zypper patch --auto-agree-with-licenses - - Loading repository data... - Reading installed packages... - Resolving package dependencies... - - Nothing to do. - -#### Clean Zypper Cache and View History #### - -45. If you want to clean zypper cache only, you can use following command. - - # zypper clean - - All repositories have been cleaned up. - -If you want to clean metadata and package cache at once you may like to pass –all/-a with zypper as. - - # zypper clean -a - - All repositories have been cleaned up. - -46. To view logs of any installed, updated or removed packages through zypper, are logged in /var/log/zypp/history. You may cat it to view or may use filter to get a custom output. - - # cat /var/log/zypp/history - - 2015-05-07 15:43:03|install|boost-license1_54_0|1.54.0-10.1.3|noarch||openSUSE-13.2-0|0523b909d2aae5239f9841316dafaf3a37b4f096| - 2015-05-07 15:43:03|install|branding-openSUSE|13.2-3.6.1|noarch||openSUSE-13.2-0|6609def94b1987bf3f90a9467f4f7ab8f8d98a5c| - 2015-05-07 15:43:03|install|bundle-lang-common-en|13.2-3.3.1|noarch||openSUSE-13.2-0|ca55694e6fdebee6ce37ac7cf3725e2aa6edc342| - 2015-05-07 15:43:03|install|insserv-compat|0.1-12.2.2|noarch||openSUSE-13.2-0|6160de7fbf961a279591a83a1550093a581214d9| - 2015-05-07 15:43:03|install|libX11-data|1.6.2-5.1.2|noarch||openSUSE-13.2-0|f1cb58364ba9016c1f93b1a383ba12463c56885a| - 2015-05-07 15:43:03|install|libnl-config|3.2.25-2.1.2|noarch||openSUSE-13.2-0|aab2ded312a781e93b739b418e3d32fe4e187020| - 2015-05-07 15:43:04|install|wireless-regdb|2014.06.13-1.2|noarch||openSUSE-13.2-0|be8cb16f3e92af12b5ceb977e37e13f03c007bd1| - 2015-05-07 15:43:04|install|yast2-trans-en_US|3.1.0-2.1|noarch||openSUSE-13.2-0|1865754e5e0ec3c149ac850b340bcca55a3c404d| - 2015-05-07 15:43:04|install|yast2-trans-stats|2.19.0-16.1.3|noarch||openSUSE-13.2-0|b107d2b3e702835885b57b04d12d25539f262d1a| - 2015-05-07 15:43:04|install|cracklib-dict-full|2.8.12-64.1.2|x86_64||openSUSE-13.2-0|08bd45dbba7ad44e3a4837f730be76f55ad5dcfa| - ...... - -#### Upgrade Suse Using Zypper #### - -47. You can use ‘dist-upgrade‘ option with zypper command to upgrade your current Suse Linux to most recent version. - - # zypper dist-upgrade - - You are about to do a distribution upgrade with all enabled repositories. Make sure these repositories are compatible before you continue. See 'man zypper' for more information about this command. - Building repository 'openSUSE-13.2-0' cache .....................................................................[done] - Retrieving repository 'openSUSE-13.2-Debug' metadata ............................................................[done] - Building repository 'openSUSE-13.2-Debug' cache .................................................................[done] - Retrieving repository 'openSUSE-13.2-Non-Oss' metadata ..........................................................[done] - Building repository 'openSUSE-13.2-Non-Oss' cache ...............................................................[done] - -That’s all for now. Hope this article would help you in managing you SUSE System and Server specially for newbies. If you feel that I left certain commands (Human are erroneous) you may provide us with the feedback in the comments so that we can update the article. Keep Connected, Keep Commenting, Stay tuned. Kudos! - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/zypper-commands-to-manage-suse-linux-package-management/ - -作者:[Avishek Kumar][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.tecmint.com/author/avishek/ -[1]:http://www.tecmint.com/installation-of-suse-linux-enterprise-server-12/ +45 个用于 ‘Suse‘ Linux 包管理的 Zypper 命令 +====================================================================== +SUSE( Software and System Entwicklung,即软件和系统开发。其中‘entwicklung‘是德语,意为开发)Linux是 Novell 公司在 Linux 内核基础上发布的操作系统。SUSE Linux 有两个发行分支。其中之一名为 OpenSUSE,这是一款自由而且免费的操作系统。该系统由开源社区开发维护,支持一些最新版本的应用软件,其最新的稳定版本为 13.2。 + +另外一个分支是SUSE Linux 企业版。该分支是一个为企业及商业化产品设计的 Linux 发行版,包含了大量的企业应用以及适用于商业产品生产环境的特性。其最新的稳定版本为 12。 + +以下的链接包含了安装企业版 SUSE Linux 服务器的详细信息。 + +- [如何安装企业版 SUSE Linux 12][1] + +Zypper 和 Yast 是 SUSE Linux 平台上的软件包管理工具,他们的底层使用了 RPM(译者注:RPM 最初指 Redhat Pacakge Manager ,现普遍解释为递归短语 RPM Package Manager 的缩写)。 + +Yast(Yet another Setup Tool )是 OpenSUSE 以及企业版 SUSE 上用于系统管理、设置和配置的工具。 + +Zypper 是软件包管理器ZYpp的命令行接口,可用于安装、删除SUSE Linux上的软件以及进行系统更新。ZYpp为Zypper和Yast提供底层支持。 + +本文将介绍实际应用中常见的一些Zypper命令。这些命令用来进行安装、更新、删除等任何软件包管理器所能够胜任的工作。 + +**重要** : 切记所有的这些指令都将在系统全局范围内产生影响,所以必须以 root 身份执行,否则命令将失败。 + +### 获取基本的 Zypper 帮助信息 ### + +1. 不带任何选项的执行 zypper, 将输出该命令的全局选项以及子命令列表(译者注:全局选项,global option,控制台命令的输入分为可选参数和位置参数两大类。按照习惯,一般可选参数称为选项'option',而位置参数称为参数 'argument')。 + +
%>  zypper
+        Usage:
+        zypper [--global-options]
+ +2. 获取一个具体的子命令的帮助信息,比如 'in' (install),可以执行下面的命令 + +
%> zypper help in
+ 或者 +
%> zypper help install
+    install (in) [options] {capability | rpm_file_uri}
+    
+    Install packages with specified capabilities or RPM files with specified
+    location. A capability is NAME[.ARCH][OP], where OP is one
+    of <, <=, =, >=, >.
+    
+      Command options:
+    --from     Select packages from the specified repository.
+    -r, --repo     Load only the specified repository.
+    -t, --type            Type of package (package, patch, pattern, product, srcpackage).
+                                Default: package.
+    -n, --name                  Select packages by plain name, not by capability.
+    -C, --capability            Select packages by capability.
+    -f, --force                 Install even if the item is already installed (reinstall),
+                                downgraded or changes vendor or architecture.
+        --oldpackage            Allow to replace a newer item with an older one.
+                                Handy if you are doing a rollback. Unlike --force
+    j                            it will not enforce a reinstall.
+        --replacefiles          Install the packages even if they replace files from other,
+                                already installed, packages. Default is to treat file conflicts
+                                as an error. --download-as-needed disables the fileconflict check.
+    ...... 
+ +3. 安装之前搜索一个安转包(以 gnome-desktop 为例 ) + +
# zypper se gnome-desktop
+    
+    Retrieving repository 'openSUSE-13.2-Debug' metadata ............................................................[done]
+    Building repository 'openSUSE-13.2-Debug' cache .................................................................[done]
+    Retrieving repository 'openSUSE-13.2-Non-Oss' metadata ......................................................... [done]
+    Building repository 'openSUSE-13.2-Non-Oss' cache ...............................................................[done]
+    Retrieving repository 'openSUSE-13.2-Oss' metadata ..............................................................[done]
+    Building repository 'openSUSE-13.2-Oss' cache ...................................................................[done]
+    Retrieving repository 'openSUSE-13.2-Update' metadata ...........................................................[done]
+    Building repository 'openSUSE-13.2-Update' cache ................................................................[done]
+    Retrieving repository 'openSUSE-13.2-Update-Non-Oss' metadata ...................................................[done]
+    Building repository 'openSUSE-13.2-Update-Non-Oss' cache ........................................................[done]
+    Loading repository data...
+    Reading installed packages...
+    
+    S | Name                                  | Summary                                                   | Type
+    --+---------------------------------------+-----------------------------------------------------------+-----------
+      | gnome-desktop2-lang                   | Languages for package gnome-desktop2                      | package
+      | gnome-desktop2                        | The GNOME Desktop API Library                             | package
+      | libgnome-desktop-2-17                 | The GNOME Desktop API Library                             | package
+      | libgnome-desktop-3-10                 | The GNOME Desktop API Library                             | package
+      | libgnome-desktop-3-devel              | The GNOME Desktop API Library -- Development Files        | package
+      | libgnome-desktop-3_0-common           | The GNOME Desktop API Library -- Common data files        | package
+      | gnome-desktop-debugsource             | Debug sources for package gnome-desktop                   | package
+      | gnome-desktop-sharp2-debugsource      | Debug sources for package gnome-desktop-sharp2            | package
+      | gnome-desktop2-debugsource            | Debug sources for package gnome-desktop2                  | package
+      | libgnome-desktop-2-17-debuginfo       | Debug information for package libgnome-desktop-2-17       | package
+      | libgnome-desktop-3-10-debuginfo       | Debug information for package libgnome-desktop-3-10       | package
+      | libgnome-desktop-3_0-common-debuginfo | Debug information for package libgnome-desktop-3_0-common | package
+      | libgnome-desktop-2-17-debuginfo-32bit | Debug information for package libgnome-desktop-2-17       | package
+      | libgnome-desktop-3-10-debuginfo-32bit | Debug information for package libgnome-desktop-3-10       | package
+      | gnome-desktop-sharp2                  | Mono bindings for libgnome-desktop                        | package
+      | libgnome-desktop-2-devel              | The GNOME Desktop API Library -- Development Files        | packag
+      | gnome-desktop-lang                    | Languages for package gnome-desktop                       | package
+      | libgnome-desktop-2-17-32bit           | The GNOME Desktop API Library                             | package
+      | libgnome-desktop-3-10-32bit           | The GNOME Desktop API Library                             | package
+      | gnome-desktop                         | The GNOME Desktop API Library                             | srcpackage
+ +4. 获取一个模式包的信息(以 lamp_server 为例)。 + +
%> zypper info -t pattern lamp_server
+    
+    Loading repository data...
+    Reading installed packages...
+    
+    
+    Information for pattern lamp_server:
+    ------------------------------------
+    Repository: openSUSE-13.2-Update
+    Name: lamp_server
+    Version: 20141007-5.1
+    Arch: x86_64
+    Vendor: openSUSE
+    Installed: No
+    Visible to User: Yes
+    Summary: Web and LAMP Server
+    Description: 
+      Software to set up a Web server that is able to serve static, dynamic, and interactive content (like a Web shop). This includes Apache HTTP Server, the database management system MySQL,
+      and scripting languages such as PHP, Python, Ruby on Rails, or Perl.
+    Contents:
+    
+    S | Name                          | Type    | Dependency
+    --+-------------------------------+---------+-----------
+      | apache2-mod_php5              | package |
+      | php5-iconv                    | package |
+    i | patterns-openSUSE-base        | package |
+    i | apache2-prefork               | package |
+      | php5-dom                      | package |
+      | php5-mysql                    | package |
+    i | apache2                       | package |
+      | apache2-example-pages         | package |
+      | mariadb                       | package |
+      | apache2-mod_perl              | package |
+      | php5-ctype                    | package |
+      | apache2-doc                   | package |
+      | yast2-http-server             | package |
+      | patterns-openSUSE-lamp_server | package |
+ +5. 开启一个Zypper Shell 的会话。 + +
 %>zypper shell 
+ 或者 +
 %>zypper sh 
+ +
zypper> help
+      Usage:
+    	zypper [--global-options]
+ +**注意**:在 Zypper shell里面可以通过键入 ‘help‘ 获得全局选项以及子命令的列表。 +### Zypper 软件库管理 ### + +#### 列举已定义的软件库 #### + +6. 使用 'zypper repos' 或者 'zypper lr' 来列举所有已定以的软件库。 + +
%> zypper repos
+ 或者 +
%> zypper lr
+      | Alias                     | Name                               | Enabled | Refresh
+    --+---------------------------+------------------------------------+---------+--------
+    1 | openSUSE-13.2-0           | openSUSE-13.2-0                    | Yes     | No
+    2 | repo-debug                | openSUSE-13.2-Debug                | Yes     | Yes
+    3 | repo-debug-update         | openSUSE-13.2-Update-Debug         | No      | Yes
+    4 | repo-debug-update-non-oss | openSUSE-13.2-Update-Debug-Non-Oss | No      | Yes
+    5 | repo-non-oss              | openSUSE-13.2-Non-Oss              | Yes     | Yes
+    6 | repo-oss                  | openSUSE-13.2-Oss                  | Yes     | Yes
+    7 | repo-source               | openSUSE-13.2-Source               | No      | Yes
+    8 | repo-update               | openSUSE-13.2-Update               | Yes     | Yes
+    9 | repo-update-non-oss       | openSUSE-13.2-Update-Non-Oss       | Yes     | Yes
+ +7. 在表格里面显示 zypper URI + +
# zypper lr -u
+      | Alias                     | Name                               | Enabled | Refresh | URI
+    --+---------------------------+------------------------------------+---------+---------+----------------------------------------------------------------
+    1 | openSUSE-13.2-0           | openSUSE-13.2-0                    | Yes     | No      | cd:///?devices=/dev/disk/by-id/ata-VBOX_CD-ROM_VB2-01700376
+    2 | repo-debug                | openSUSE-13.2-Debug                | Yes     | Yes     | http://download.opensuse.org/debug/distribution/13.2/repo/oss/
+    3 | repo-debug-update         | openSUSE-13.2-Update-Debug         | No      | Yes     | http://download.opensuse.org/debug/update/13.2/
+    4 | repo-debug-update-non-oss | openSUSE-13.2-Update-Debug-Non-Oss | No      | Yes     | http://download.opensuse.org/debug/update/13.2-non-oss/
+    5 | repo-non-oss              | openSUSE-13.2-Non-Oss              | Yes     | Yes     | http://download.opensuse.org/distribution/13.2/repo/non-oss/
+    6 | repo-oss                  | openSUSE-13.2-Oss                  | Yes     | Yes     | http://download.opensuse.org/distribution/13.2/repo/oss/
+    7 | repo-source               | openSUSE-13.2-Source               | No      | Yes     | http://download.opensuse.org/source/distribution/13.2/repo/oss/
+    8 | repo-update               | openSUSE-13.2-Update               | Yes     | Yes     | http://download.opensuse.org/update/13.2/
+    9 | repo-update-non-oss       | openSUSE-13.2-Update-Non-Oss       | Yes     | Yes     | http://download.opensuse.org/update/13.2-non-oss/
+ +8. 根据优先级列举软件库。 + +
%> zypper lr -P
+      | Alias                     | Name                               | Enabled | Refresh | Priority
+    --+---------------------------+------------------------------------+---------+---------+---------
+    1 | openSUSE-13.2-0           | openSUSE-13.2-0                    | Yes     | No      |   99
+    2 | repo-debug                | openSUSE-13.2-Debug                | Yes     | Yes     |   99
+    3 | repo-debug-update         | openSUSE-13.2-Update-Debug         | No      | Yes     |   99
+    4 | repo-debug-update-non-oss | openSUSE-13.2-Update-Debug-Non-Oss | No      | Yes     |   99
+    5 | repo-non-oss              | openSUSE-13.2-Non-Oss              | Yes     | Yes     |   85
+    6 | repo-oss                  | openSUSE-13.2-Oss                  | Yes     | Yes     |   99
+    7 | repo-source               | openSUSE-13.2-Source               | No      | Yes     |   99
+    8 | repo-update               | openSUSE-13.2-Update               | Yes     | Yes     |   99
+    9 | repo-update-non-oss       | openSUSE-13.2-Update-Non-Oss       | Yes     | Yes     |   99
+ +#### 刷新软件库 #### + +9. 使用 'zypper refresh' or 'zypper ref' 来刷新 zypper 软件库。 + +
%> zypper refresh 
+ 或者 +
%> zypper ref
+    Repository 'openSUSE-13.2-0' is up to date.
+    Repository 'openSUSE-13.2-Debug' is up to date.
+    Repository 'openSUSE-13.2-Non-Oss' is up to date.
+    Repository 'openSUSE-13.2-Oss' is up to date.
+    Repository 'openSUSE-13.2-Update' is up to date.
+    Repository 'openSUSE-13.2-Update-Non-Oss' is up to date.
+    All repositories have been refreshed. 
+ +10. 刷新一个指定的软件库(以 'repo-non-oss' 为例 )。 + +
%> zypper refresh repo-non-oss
+    Repository 'openSUSE-13.2-Non-Oss' is up to date.
+    Specified repositories have been refreshed. 
+ +11. 强制更新一个软件库(以 'repo-non-oss' 为例 )。 + +
%> zypper ref -f repo-non-oss 
+    Forcing raw metadata refresh
+    Retrieving repository 'openSUSE-13.2-Non-Oss' metadata ............................................................[done]
+    Forcing building of repository cache
+    Building repository 'openSUSE-13.2-Non-Oss' cache ............................................................[done]
+    Specified repositories have been refreshed.
+ +#### 修改软件库 #### + +本文中我们使用‘zypper modifyrepo‘ 或者 ‘zypper mr‘ 来关闭或者开启 zypper 软件库。 + +12. 在关闭一个软件库之前,我们需要知道在 zypper中,每一个软件库有一个唯一的标示数字与之关联,该数字用于打开或者关闭与之相联系的软件库。假设我们需要关闭 'repo-oss' 软件库,那么我们可以通过以下的法来获得该软件库的标志数字。 + +
%> zypper lr
+      | Alias                     | Name                               | Enabled | Refresh
+    --+---------------------------+------------------------------------+---------+--------
+    1 | openSUSE-13.2-0           | openSUSE-13.2-0                    | Yes     | No
+    2 | repo-debug                | openSUSE-13.2-Debug                | Yes     | Yes
+    3 | repo-debug-update         | openSUSE-13.2-Update-Debug         | No      | Yes
+    4 | repo-debug-update-non-oss | openSUSE-13.2-Update-Debug-Non-Oss | No      | Yes
+    5 | repo-non-oss              | openSUSE-13.2-Non-Oss              | Yes     | Yes
+    6 | repo-oss                  | openSUSE-13.2-Oss                  | No      | Yes
+    7 | repo-source               | openSUSE-13.2-Source               | No      | Yes
+    8 | repo-update               | openSUSE-13.2-Update               | Yes     | Yes
+    9 | repo-update-non-oss       | openSUSE-13.2-Update-Non-Oss       | Yes     | Yes
+从以上输出的列表中我们可以看到 'repo-oss' 库的标示数字是 6,因此通过以下的命令来关闭该库。 + +
%> zypper mr -d 6
+    Repository 'repo-oss' has been successfully disabled.
+ +13. 如果需要再次开启软件库 ‘repo-oss‘, 接上例,与之相关联的标示数字为 6。 + +
%> zypper mr -e 6
+    Repository 'repo-oss' has been successfully enabled.
+ +14. 针对某一个软件库(以 'repo-non-oss' 为例 )开启自动刷新( auto-refresh )和 rpm 缓存,并设置该软件库的优先级,比如85。 + +
%> zypper mr -rk -p 85 repo-non-oss
+    Repository 'repo-non-oss' priority has been left unchanged (85)
+    Nothing to change for repository 'repo-non-oss'.
+ +15. 对所有的软件库关闭 rpm 文件缓存。 + +
%> zypper mr -Ka
+    RPM files caching has been disabled for repository 'openSUSE-13.2-0'.
+    RPM files caching has been disabled for repository 'repo-debug'.
+    RPM files caching has been disabled for repository 'repo-debug-update'.
+    RPM files caching has been disabled for repository 'repo-debug-update-non-oss'.
+    RPM files caching has been disabled for repository 'repo-non-oss'.
+    RPM files caching has been disabled for repository 'repo-oss'.
+    RPM files caching has been disabled for repository 'repo-source'.
+    RPM files caching has been disabled for repository 'repo-update'.
+    RPM files caching has been disabled for repository 'repo-update-non-oss'.
+ +16. 对所有的软件库开启 rpm 文件缓存。 +
 zypper mr -ka
+    RPM files caching has been enabled for repository 'openSUSE-13.2-0'.
+    RPM files caching has been enabled for repository 'repo-debug'.
+    RPM files caching has been enabled for repository 'repo-debug-update'.
+    RPM files caching has been enabled for repository 'repo-debug-update-non-oss'.
+    RPM files caching has been enabled for repository 'repo-non-oss'.
+    RPM files caching has been enabled for repository 'repo-oss'.
+    RPM files caching has been enabled for repository 'repo-source'.
+    RPM files caching has been enabled for repository 'repo-update'.
+    RPM files caching has been enabled for repository 'repo-update-non-oss'.
+ +17. 关闭远程库的rpm 文件缓存 +
%> zypper mr -Kt
+    RPM files caching has been disabled for repository 'repo-debug'.
+    RPM files caching has been disabled for repository 'repo-debug-update'.
+    RPM files caching has been disabled for repository 'repo-debug-update-non-oss'.
+    RPM files caching has been disabled for repository 'repo-non-oss'.
+    RPM files caching has been disabled for repository 'repo-oss'.
+    RPM files caching has been disabled for repository 'repo-source'.
+    RPM files caching has been disabled for repository 'repo-update'.
+    RPM files caching has been disabled for repository 'repo-update-non-oss'.
+ +18. 开启远程软件库的 rpm 文件缓存。 +
%> zypper mr -kt
+    RPM files caching has been enabled for repository 'repo-debug'.
+    RPM files caching has been enabled for repository 'repo-debug-update'.
+    RPM files caching has been enabled for repository 'repo-debug-update-non-oss'.
+    RPM files caching has been enabled for repository 'repo-non-oss'.
+    RPM files caching has been enabled for repository 'repo-oss'.
+    RPM files caching has been enabled for repository 'repo-source'.
+    RPM files caching has been enabled for repository 'repo-update'.
+    RPM files caching has been enabled for repository 'repo-update-non-oss'.
+ +#### 增加新的软件库 #### + +可以通过这两个 zypper 指令 – 'zypper addrepo' 和 'zypper ar' 来增加新的软件库。在此过程中可以使用 URL 或者软件库的别名。 + +19. 增加一个新的软件库( 以 “http://download.opensuse.org/update/12.3/” 为例 )。 + +
%>  zypper ar http://download.opensuse.org/update/11.1/ update
+    Adding repository 'update' .............................................................................................................................................................[done]
+    Repository 'update' successfully added
+    Enabled     : Yes
+    Autorefresh : No
+    GPG check   : Yes
+    URI         : http://download.opensuse.org/update/11.1/
+ +20. 更改一个软件库的名字,这将仅仅改变软件库的别名。 命令 'zypper namerepo' 或者 'zypperr nr' 可以胜任此工作。例如更改标示数字为10的软件库的名字为 'upd8',或者说将标示数字为10的软件库的别名改为 'upd8',可以使用下面的命令。 + +
%> zypper nr 10 upd8
+    Repository 'update' renamed to 'upd8'.
+ +#### 删除软件库 #### + +21. 删除一个软件库。要从系统删除一个软件库可以使 'zypper removerepo' 或者 'zypper rr'。例如以下的命令可以删除软件库 'upd8' + +
%> zypper rr upd8
+    # Removing repository 'upd8' .........................................................................................[done]
+    Repository 'upd8' has been removed.
+ +### 使用 zypper 进行软件包管理 ### + +#### 用 zypper 安装一个软件包 #### + +22. 在 zypper 中,我们可以通过软件包的功能名称来安装一个软件包。以 Firefox 为例,以下的命令可以用来安装该软件包。 +
%> zypper in MozillaFirefox
+    Loading repository data...
+    Reading installed packages...
+    Resolving package dependencies...
+
+    The following 128 NEW packages are going to be installed:
+      adwaita-icon-theme at-spi2-atk-common at-spi2-atk-gtk2 at-spi2-core cantarell-fonts cups-libs desktop-file-utils fontconfig gdk-pixbuf-query-loaders gstreamer gstreamer-fluendo-mp3
+      gstreamer-plugins-base gtk2-branding-openSUSE gtk2-data gtk2-immodule-amharic gtk2-immodule-inuktitut gtk2-immodule-thai gtk2-immodule-vietnamese gtk2-metatheme-adwaita
+      gtk2-theming-engine-adwaita gtk2-tools gtk3-data gtk3-metatheme-adwaita gtk3-tools hicolor-icon-theme hicolor-icon-theme-branding-openSUSE libasound2 libatk-1_0-0 libatk-bridge-2_0-0
+      libatspi0 libcairo2 libcairo-gobject2 libcanberra0 libcanberra-gtk0 libcanberra-gtk2-module libcanberra-gtk3-0 libcanberra-gtk3-module libcanberra-gtk-module-common libcdda_interface0
+      libcdda_paranoia0 libcolord2 libdrm2 libdrm_intel1 libdrm_nouveau2 libdrm_radeon1 libFLAC8 libfreebl3 libgbm1 libgdk_pixbuf-2_0-0 libgraphite2-3 libgstapp-1_0-0 libgstaudio-1_0-0
+      libgstpbutils-1_0-0 libgstreamer-1_0-0 libgstriff-1_0-0 libgsttag-1_0-0 libgstvideo-1_0-0 libgthread-2_0-0 libgtk-2_0-0 libgtk-3-0 libharfbuzz0 libjasper1 libjbig2 libjpeg8 libjson-c2
+      liblcms2-2 libLLVM libltdl7 libnsssharedhelper0 libogg0 liborc-0_4-0 libpackagekit-glib2-18 libpango-1_0-0 libpciaccess0 libpixman-1-0 libpulse0 libsndfile1 libsoftokn3 libspeex1
+      libsqlite3-0 libstartup-notification-1-0 libtheoradec1 libtheoraenc1 libtiff5 libvisual libvorbis0 libvorbisenc2 libvorbisfile3 libwayland-client0 libwayland-cursor0 libwayland-server0
+      libX11-xcb1 libxcb-dri2-0 libxcb-dri3-0 libxcb-glx0 libxcb-present0 libxcb-render0 libxcb-shm0 libxcb-sync1 libxcb-util1 libxcb-xfixes0 libXcomposite1 libXcursor1 libXdamage1 libXevie1
+      libXfixes3 libXft2 libXi6 libXinerama1 libxkbcommon-0_4_3 libXrandr2 libXrender1 libxshmfence1 libXtst6 libXv1 libXxf86vm1 Mesa Mesa-libEGL1 Mesa-libGL1 Mesa-libglapi0
+      metatheme-adwaita-common MozillaFirefox MozillaFirefox-branding-openSUSE mozilla-nss mozilla-nss-certs PackageKit-gstreamer-plugin pango-tools sound-theme-freedesktop
+
+    The following 10 recommended packages were automatically selected:
+      gstreamer-fluendo-mp3 gtk2-branding-openSUSE gtk2-data gtk2-immodule-amharic gtk2-immodule-inuktitut gtk2-immodule-thai gtk2-immodule-vietnamese libcanberra0 libpulse0
+      PackageKit-gstreamer-plugin
+    
+    128 new packages to install.
+    Overall download size: 77.2 MiB. Already cached: 0 B  After the operation, additional 200.0 MiB will be used.
+    Continue? [y/n/? shows all options] (y): y
+    Retrieving package cantarell-fonts-0.0.16-1.1.noarch                                                                                                   (1/128),  74.1 KiB (115.6 KiB unpacked)
+    Retrieving: cantarell-fonts-0.0.16-1.1.noarch.rpm .........................................................................................................................[done (63.4 KiB/s)]
+    Retrieving package hicolor-icon-theme-0.13-2.1.2.noarch                                                                                                (2/128),  40.1 KiB ( 50.5 KiB unpacked)
+    Retrieving: hicolor-icon-theme-0.13-2.1.2.noarch.rpm ...................................................................................................................................[done]
+    Retrieving package sound-theme-freedesktop-0.8-7.1.2.noarch                                                                                            (3/128), 372.6 KiB (460.3 KiB unpacked) 
+ +23. 安装指定版本号的软件包,(以 gcc 5.1 为例)。 +
 %>zypper in 'gcc<5.1'
+    Loading repository data...
+    Reading installed packages...
+    Resolving package dependencies...
+
+    The following 13 NEW packages are going to be installed:
+      cpp cpp48 gcc gcc48 libasan0 libatomic1-gcc49 libcloog-isl4 libgomp1-gcc49 libisl10 libitm1-gcc49 libmpc3 libmpfr4 libtsan0-gcc49
+
+    13 new packages to install.
+    Overall download size: 14.5 MiB. Already cached: 0 B  After the operation, additional 49.4 MiB will be used.
+    Continue? [y/n/? shows all options] (y): y 
+ +24. 为特定的CPU架构安装软件包(以兼容 i586 的 gcc 为例)。 + +
%> zypper in gcc.i586
+    Loading repository data...
+    Reading installed packages...
+    Resolving package dependencies...
+
+    The following 13 NEW packages are going to be installed:
+      cpp cpp48 gcc gcc48 libasan0 libatomic1-gcc49 libcloog-isl4 libgomp1-gcc49 libisl10 libitm1-gcc49 libmpc3 libmpfr4 libtsan0-gcc49
+
+    13 new packages to install.
+    Overall download size: 14.5 MiB. Already cached: 0 B  After the operation, additional 49.4 MiB will be used.
+    Continue? [y/n/? shows all options] (y): y
+    Retrieving package libasan0-4.8.3+r212056-2.2.4.x86_64                                                                                                  (1/13),  74.2 KiB (166.9 KiB unpacked)
+    Retrieving: libasan0-4.8.3+r212056-2.2.4.x86_64.rpm .......................................................................................................................[done (79.2 KiB/s)]
+    Retrieving package libatomic1-gcc49-4.9.0+r211729-2.1.7.x86_64                                                                                          (2/13),  14.3 KiB ( 26.1 KiB unpacked)
+    Retrieving: libatomic1-gcc49-4.9.0+r211729-2.1.7.x86_64.rpm ...............................................................................................................[done (55.3 KiB/s)] 
+ +25. 为特定的CPU架构安装指定版本号的软件包(以兼容 i586 且版本低于5.1的 gcc 为例) + +
%> zypper in 'gcc.i586<5.1'
+    Loading repository data...
+    Reading installed packages...
+    Resolving package dependencies...
+
+    The following 13 NEW packages are going to be installed:
+      cpp cpp48 gcc gcc48 libasan0 libatomic1-gcc49 libcloog-isl4 libgomp1-gcc49 libisl10 libitm1-gcc49 libmpc3 libmpfr4 libtsan0-gcc49
+
+    13 new packages to install.
+    Overall download size: 14.4 MiB. Already cached: 129.5 KiB  After the operation, additional 49.4 MiB will be used.
+    Continue? [y/n/? shows all options] (y): y
+    In cache libasan0-4.8.3+r212056-2.2.4.x86_64.rpm                                                                                                        (1/13),  74.2 KiB (166.9 KiB unpacked)
+    In cache libatomic1-gcc49-4.9.0+r211729-2.1.7.x86_64.rpm                                           (2/13),  14.3 KiB ( 26.1 KiB unpacked)
+    In cache libgomp1-gcc49-4.9.0+r211729-2.1.7.x86_64.rpm                                             (3/13),  41.1 KiB ( 90.7 KiB unpacked) 
+ +26. 从指定的软件库里面安装一个软件包,例如从 amarok 中安装 libxine。 +
%> zypper in amarok upd:libxine1
+    Loading repository data...
+    Reading installed packages...
+    Resolving package dependencies...
+    The following 202 NEW packages are going to be installed:
+      amarok bundle-lang-kde-en clamz cups-libs enscript fontconfig gdk-pixbuf-query-loaders ghostscript-fonts-std gptfdisk gstreamer gstreamer-plugins-base hicolor-icon-theme
+      hicolor-icon-theme-branding-openSUSE htdig hunspell hunspell-tools icoutils ispell ispell-american kde4-filesystem kdebase4-runtime kdebase4-runtime-branding-openSUSE kdelibs4
+      kdelibs4-branding-openSUSE kdelibs4-core kdialog libakonadi4 l
+    .....
+ +27. 通过指定软件包的名字安装软件包。 + +
%> zypper in -n git
+    Loading repository data...
+    Reading installed packages...
+    Resolving package dependencies...
+
+    The following 35 NEW packages are going to be installed:
+      cvs cvsps fontconfig git git-core git-cvs git-email git-gui gitk git-svn git-web libserf-1-1 libsqlite3-0 libXft2 libXrender1 libXss1 perl-Authen-SASL perl-Clone perl-DBD-SQLite perl-DBI
+      perl-Error perl-IO-Socket-SSL perl-MLDBM perl-Net-Daemon perl-Net-SMTP-SSL perl-Net-SSLeay perl-Params-Util perl-PlRPC perl-SQL-Statement perl-Term-ReadKey subversion subversion-perl tcl
+      tk xhost
+
+    The following 13 recommended packages were automatically selected:
+      git-cvs git-email git-gui gitk git-svn git-web perl-Authen-SASL perl-Clone perl-MLDBM perl-Net-Daemon perl-Net-SMTP-SSL perl-PlRPC perl-SQL-Statement
+
+    The following package is suggested, but will not be installed:
+      git-daemon
+
+    35 new packages to install.
+    Overall download size: 15.6 MiB. Already cached: 0 B  After the operation, additional 56.7 MiB will be used.
+    Continue? [y/n/? shows all options] (y): y 
+ +28. 通过通配符来安装软件包,例如,安装所有 php5 的软件包。 +
%> zypper in php5*
+    Loading repository data...
+    Reading installed packages...
+    Resolving package dependencies...
+
+    Problem: php5-5.6.1-18.1.x86_64 requires smtp_daemon, but this requirement cannot be provided
+      uninstallable providers: exim-4.83-3.1.8.x86_64[openSUSE-13.2-0]
+                       postfix-2.11.0-5.2.2.x86_64[openSUSE-13.2-0]
+                       sendmail-8.14.9-2.2.2.x86_64[openSUSE-13.2-0]
+                       exim-4.83-3.1.8.i586[repo-oss]
+                       msmtp-mta-1.4.32-2.1.3.i586[repo-oss]
+                       postfix-2.11.0-5.2.2.i586[repo-oss]
+                       sendmail-8.14.9-2.2.2.i586[repo-oss]
+                       exim-4.83-3.1.8.x86_64[repo-oss]
+                       msmtp-mta-1.4.32-2.1.3.x86_64[repo-oss]
+                       postfix-2.11.0-5.2.2.x86_64[repo-oss]
+                       sendmail-8.14.9-2.2.2.x86_64[repo-oss]
+                       postfix-2.11.3-5.5.1.i586[repo-update]
+                       postfix-2.11.3-5.5.1.x86_64[repo-update]
+     Solution 1: Following actions will be done:
+      do not install php5-5.6.1-18.1.x86_64
+      do not install php5-pear-Auth_SASL-1.0.6-7.1.3.noarch
+      do not install php5-pear-Horde_Http-2.0.1-6.1.3.noarch
+      do not install php5-pear-Horde_Image-2.0.1-6.1.3.noarch
+      do not install php5-pear-Horde_Kolab_Format-2.0.1-6.1.3.noarch
+      do not install php5-pear-Horde_Ldap-2.0.1-6.1.3.noarch
+      do not install php5-pear-Horde_Memcache-2.0.1-7.1.3.noarch
+      do not install php5-pear-Horde_Mime-2.0.2-6.1.3.noarch
+      do not install php5-pear-Horde_Oauth-2.0.0-6.1.3.noarch
+      do not install php5-pear-Horde_Pdf-2.0.1-6.1.3.noarch
+    ....
+ +29. 使用模式名称(模式名称是一类软件包的名字)来批量安装软件包 + +
%> zypper in -t pattern lamp_server
+    ading repository data...
+    Reading installed packages...
+    Resolving package dependencies...
+
+    The following 29 NEW packages are going to be installed:
+      apache2 apache2-doc apache2-example-pages apache2-mod_perl apache2-prefork patterns-openSUSE-lamp_server perl-Data-Dump perl-Encode-Locale perl-File-Listing perl-HTML-Parser
+      perl-HTML-Tagset perl-HTTP-Cookies perl-HTTP-Daemon perl-HTTP-Date perl-HTTP-Message perl-HTTP-Negotiate perl-IO-HTML perl-IO-Socket-SSL perl-libwww-perl perl-Linux-Pid
+      perl-LWP-MediaTypes perl-LWP-Protocol-https perl-Net-HTTP perl-Net-SSLeay perl-Tie-IxHash perl-TimeDate perl-URI perl-WWW-RobotRules yast2-http-server
+
+    The following NEW pattern is going to be installed:
+      lamp_server
+
+    The following 10 recommended packages were automatically selected:
+      apache2 apache2-doc apache2-example-pages apache2-mod_perl apache2-prefork perl-Data-Dump perl-IO-Socket-SSL perl-LWP-Protocol-https perl-TimeDate yast2-http-server
+
+    29 new packages to install.
+    Overall download size: 7.2 MiB. Already cached: 1.2 MiB  After the operation, additional 34.7 MiB will be used.
+    Continue? [y/n/? shows all options] (y): 
+ +30. 使用一行命令安转一个软件包同时卸载另一个软件包,例如在安装 nano 的同时卸载 vi + +
# zypper in nano -vi
+    Loading repository data...
+    Reading installed packages...
+    '-vi' not found in package names. Trying capabilities.
+    Resolving package dependencies...
+
+    The following 2 NEW packages are going to be installed:
+      nano nano-lang
+
+    The following package is going to be REMOVED:
+      vim
+
+    The following recommended package was automatically selected:
+      nano-lang
+
+    2 new packages to install, 1 to remove.
+    Overall download size: 550.0 KiB. Already cached: 0 B  After the operation, 463.3 KiB will be freed.
+    Continue? [y/n/? shows all options] (y):
+    ...
+ +31. 使用 zypper 安装 rpm 软件包。 + +
%> zypper in teamviewer*.rpm
+    Loading repository data...
+    Reading installed packages...
+    Resolving package dependencies...
+
+    The following 24 NEW packages are going to be installed:
+      alsa-oss-32bit fontconfig-32bit libasound2-32bit libexpat1-32bit libfreetype6-32bit libgcc_s1-gcc49-32bit libICE6-32bit libjpeg62-32bit libpng12-0-32bit libpng16-16-32bit libSM6-32bit
+      libuuid1-32bit libX11-6-32bit libXau6-32bit libxcb1-32bit libXdamage1-32bit libXext6-32bit libXfixes3-32bit libXinerama1-32bit libXrandr2-32bit libXrender1-32bit libXtst6-32bit
+      libz1-32bit teamviewer
+
+    The following recommended package was automatically selected:
+      alsa-oss-32bit
+
+    24 new packages to install.
+    Overall download size: 41.2 MiB. Already cached: 0 B  After the operation, additional 119.7 MiB will be used.
+    Continue? [y/n/? shows all options] (y):
+    ..
+ +#### 使用 zypper 卸载软件包 #### + +32. 命令 ‘zypper remove‘ 和 ‘zypper rm‘ 用于卸载软件包。例如卸载 apache2: + +
%> zypper remove apache2 
+ 或者 +
%> zypper rm apache2
+    Loading repository data...
+    Reading installed packages...
+    Resolving package dependencies...
+
+    The following 2 packages are going to be REMOVED:
+      apache2 apache2-prefork
+
+    2 packages to remove.
+    After the operation, 4.2 MiB will be freed.
+    Continue? [y/n/? shows all options] (y): y
+    (1/2) Removing apache2-2.4.10-19.1 ........................................................................[done]
+    (2/2) Removing apache2-prefork-2.4.10-19.1 ................................................................[done] 
+ +#### 使用Zypper 进行软件包更新 #### + +33. 更新所有的软件包,可以使用 ‘zypper update‘ 或者 ‘zypper up‘。 + +
%> zypper up 
+ 或者 +
%> zypper update
+
+    Loading repository data...
+    Reading installed packages...
+    Nothing to do. 
+ +34. 更新指定的软件包,例如更新 apache2 以及 openssh。 + +
 zypper up apache2 openssh
+    Loading repository data...
+    Reading installed packages...
+    No update candidate for 'apache2-2.4.10-19.1.x86_64'. The highest available version is already installed.
+    No update candidate for 'openssh-6.6p1-5.1.3.x86_64'. The highest available version is already installed.
+    Resolving package dependencies...
+
+    Nothing to do.
+ +35. 安装一个软件库,例如 ariadb,如果该库存在则更新之。 + +
%> zypper in mariadb
+    Loading repository data...
+    Reading installed packages...
+    'mariadb' is already installed.
+    No update candidate for 'mariadb-10.0.13-2.6.1.x86_64'. The highest available version is already installed.
+    Resolving package dependencies...
+
+    Nothing to do.
+ +#### 安装源文件并且构建依赖关系 #### + +命令 ‘zypper source-install‘ 或者 ‘zypper si‘ 可以用于从源文件编译软件包 + +36. 安装某一个软件包的源文件及其依赖关系,例如 mariadb。 + +
%> zypper si mariadb
+    Reading installed packages...
+    Loading repository data...
+    Resolving package dependencies...
+
+    The following 36 NEW packages are going to be installed:
+      autoconf automake bison cmake cpp cpp48 gcc gcc48 gcc48-c++ gcc-c++ libaio-devel libarchive13 libasan0 libatomic1-gcc49 libcloog-isl4 libedit-devel libevent-devel libgomp1-gcc49 libisl10
+      libitm1-gcc49 libltdl7 libmpc3 libmpfr4 libopenssl-devel libstdc++48-devel libtool libtsan0-gcc49 m4 make ncurses-devel pam-devel readline-devel site-config tack tcpd-devel zlib-devel
+
+    The following source package is going to be installed:
+      mariadb
+
+    36 new packages to install, 1 source package.
+    Overall download size: 71.5 MiB. Already cached: 129.5 KiB  After the operation, additional 183.9 MiB will be used.
+    Continue? [y/n/? shows all options] (y): y 
+ +37. 仅为某一个软件包安装源文件,例如 mariadb + +
%> zypper in -D mariadb
+    Loading repository data...
+    Reading installed packages...
+    'mariadb' is already installed.
+    No update candidate for 'mariadb-10.0.13-2.6.1.x86_64'. The highest available version is already installed.
+    Resolving package dependencies...
+
+    Nothing to do. 
+ +38. 仅为某一个软件包安装依赖关系,例如 mariadb + +
%> zypper si -d mariadb
+    Reading installed packages...
+    Loading repository data...
+    Resolving package dependencies...
+
+    The following 36 NEW packages are going to be installed:
+      autoconf automake bison cmake cpp cpp48 gcc gcc48 gcc48-c++ gcc-c++ libaio-devel libarchive13 libasan0 libatomic1-gcc49 libcloog-isl4 libedit-devel libevent-devel libgomp1-gcc49 libisl10
+      libitm1-gcc49 libltdl7 libmpc3 libmpfr4 libopenssl-devel libstdc++48-devel libtool libtsan0-gcc49 m4 make ncurses-devel pam-devel readline-devel site-config tack tcpd-devel zlib-devel
+
+    The following package is recommended, but will not be installed due to conflicts or dependency issues:
+      readline-doc
+
+    36 new packages to install.
+    Overall download size: 33.7 MiB. Already cached: 129.5 KiB  After the operation, additional 144.3 MiB will be used.
+    Continue? [y/n/? shows all options] (y): y
+ +#### Zypper in Scripts and Applications #### + +39. 安装一个软件包,并且在安装过程中跳过与用户的交互, 例如 mariadb。 + +
%> zypper --non-interactive in mariadb
+    Loading repository data...
+    Reading installed packages...
+    'mariadb' is already installed.
+    No update candidate for 'mariadb-10.0.13-2.6.1.x86_64'. The highest available version is already installed.
+    Resolving package dependencies...
+
+    Nothing to do.
+ +40. 卸载一个软件包,并且在卸载过程中跳过与用户的交互,例如 mariadb + +
%> zypper --non-interactive rm mariadb
+    Loading repository data...
+    Reading installed packages...
+    Resolving package dependencies...
+
+    The following package is going to be REMOVED:
+      mariadb
+
+    1 package to remove.
+    After the operation, 71.8 MiB will be freed.
+    Continue? [y/n/? shows all options] (y): y
+    (1/1) Removing mariadb-10.0.13-2.6.1 .............................................................................[done] 
+ +41. 将 zypper 输出用 XML 格式打印。 + +
%> zypper --xmlout
+      Usage:
+    	zypper [--global-options]  [--command-options] [arguments]
+
+      Global Options
+    ....
+ +42. 禁止详细信息输出到屏幕。 + +
%> zypper --quiet in mariadb
+    The following NEW package is going to be installed:
+      mariadb
+
+    1 new package to install.
+    Overall download size: 0 B. Already cached: 7.8 MiB  After the operation, additional 71.8 MiB will be used.
+    Continue? [y/n/? shows all options] (y):
+    ...
+ +43. 在卸载过程中禁止详细信息输出到屏幕 + +
%> zypper --quiet rm mariadb 
+ +44. 自动地同意版权或者协议。 +
%> zypper patch --auto-agree-with-licenses
+    Loading repository data...
+    Reading installed packages...
+    Resolving package dependencies...
+
+    Nothing to do.
+ +#### 清除 Zypper 缓存以及查看历史信息 #### + +45. 以下指令可以用来清理Zypper缓存。 + +
%> zypper clean
+    All repositories have been cleaned up.
+ +如果需要一次性地清理元数据以及软件包缓存,可以通过 -all/-a 选项来达到目的 + +
%> zypper clean -a
+    All repositories have been cleaned up.
+ +46. 查看 Zypper 的历史信息。籍由 Zypper 所有的软件包管理动作,包括安装、更新以及卸载都会在 /var/log/zypp/history中保留历史信息。可以通过 cat 来查看此文件,或者通过过滤器来筛选希望看到的信息。 + +
 cat /var/log/zypp/history
+    2015-05-07 15:43:03|install|boost-license1_54_0|1.54.0-10.1.3|noarch||openSUSE-13.2-0|0523b909d2aae5239f9841316dafaf3a37b4f096|
+    2015-05-07 15:43:03|install|branding-openSUSE|13.2-3.6.1|noarch||openSUSE-13.2-0|6609def94b1987bf3f90a9467f4f7ab8f8d98a5c|
+    2015-05-07 15:43:03|install|bundle-lang-common-en|13.2-3.3.1|noarch||openSUSE-13.2-0|ca55694e6fdebee6ce37ac7cf3725e2aa6edc342|
+    2015-05-07 15:43:03|install|insserv-compat|0.1-12.2.2|noarch||openSUSE-13.2-0|6160de7fbf961a279591a83a1550093a581214d9|
+    2015-05-07 15:43:03|install|libX11-data|1.6.2-5.1.2|noarch||openSUSE-13.2-0|f1cb58364ba9016c1f93b1a383ba12463c56885a|
+    2015-05-07 15:43:03|install|libnl-config|3.2.25-2.1.2|noarch||openSUSE-13.2-0|aab2ded312a781e93b739b418e3d32fe4e187020|
+    2015-05-07 15:43:04|install|wireless-regdb|2014.06.13-1.2|noarch||openSUSE-13.2-0|be8cb16f3e92af12b5ceb977e37e13f03c007bd1|
+    2015-05-07 15:43:04|install|yast2-trans-en_US|3.1.0-2.1|noarch||openSUSE-13.2-0|1865754e5e0ec3c149ac850b340bcca55a3c404d|
+    2015-05-07 15:43:04|install|yast2-trans-stats|2.19.0-16.1.3|noarch||openSUSE-13.2-0|b107d2b3e702835885b57b04d12d25539f262d1a|
+    2015-05-07 15:43:04|install|cracklib-dict-full|2.8.12-64.1.2|x86_64||openSUSE-13.2-0|08bd45dbba7ad44e3a4837f730be76f55ad5dcfa|
+    ......
+ +#### 使用 Zypper 进行SUSE系统升级 #### + +47. 可以使用 Zypper 命令的 'dist-upgrade' 选项来将当前的SUSE Linux升级至最新版本。 +
# zypper dist-upgrade
+    You are about to do a distribution upgrade with all enabled repositories. Make sure these repositories are compatible before you continue. See 'man zypper' for more information about this command.
+    Building repository 'openSUSE-13.2-0' cache .....................................................................[done]
+    Retrieving repository 'openSUSE-13.2-Debug' metadata ............................................................[done]
+    Building repository 'openSUSE-13.2-Debug' cache .................................................................[done]
+    Retrieving repository 'openSUSE-13.2-Non-Oss' metadata ..........................................................[done]
+    Building repository 'openSUSE-13.2-Non-Oss' cache ...............................................................[done]
+ +正文至此结束。希望本文可以帮助读者尤其是新手们管理SUSE Linux系统和服务器。如果您觉得某些比较重要的命令被作者漏掉了,请在评论部分写下您的返回,作者将根据评论对文章进行更新。保持联络,保持评论,多谢支持。 + +-------------------------------------------------------------------------------- + +原文地址: http://www.tecmint.com/zypper-commands-to-manage-suse-linux-package-management/ + +作者:[Avishek Kumar][a] +译者:[张博约](https://github.com/zhangboyue) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/avishek/ +[1]:http://www.tecmint.com/installation-of-suse-linux-enterprise-server-12/ From 027e2e5c193904dcaea6da1df53d463d204f88c7 Mon Sep 17 00:00:00 2001 From: zhangkun Date: Sun, 24 May 2015 17:56:15 +0800 Subject: [PATCH 139/965] translation finished --- ... Manage 'Suse' Linux Package Management.md | 767 ------------------ 1 file changed, 767 deletions(-) delete mode 100644 sources/tech/20150512 45 Zypper Commands to Manage 'Suse' Linux Package Management.md diff --git a/sources/tech/20150512 45 Zypper Commands to Manage 'Suse' Linux Package Management.md b/sources/tech/20150512 45 Zypper Commands to Manage 'Suse' Linux Package Management.md deleted file mode 100644 index bfd3eeeaf5..0000000000 --- a/sources/tech/20150512 45 Zypper Commands to Manage 'Suse' Linux Package Management.md +++ /dev/null @@ -1,767 +0,0 @@ -45 个用于 ‘Suse‘ Linux 包管理的 Zypper 命令 -====================================================================== -SUSE( Software and System Entwicklung,即软件和系统开发。其中‘entwicklung‘是德语,意为开发)Linux是 Novell 公司在 Linux 内核基础上发布的操作系统。SUSE Linux 有两个发行分支。其中之一名为 OpenSUSE,这是一款自由而且免费的操作系统。该系统由开源社区开发维护,支持一些最新版本的应用软件,其最新的稳定版本为 13.2。 - -另外一个分支是SUSE Linux 企业版。该分支是一个为企业及商业化产品设计的 Linux 发行版,包含了大量的企业应用以及适用于商业产品生产环境的特性。其最新的稳定版本为 12。 - -以下的链接包含了安装企业版 SUSE Linux 服务器的详细信息。 - -- [如何安装企业版 SUSE Linux 12][1] - -Zypper 和 Yast 是 SUSE Linux 平台上的软件包管理工具,他们的底层使用了 RPM(译者注:RPM 最初指 Redhat Pacakge Manager ,现普遍解释为递归短语 RPM Package Manager 的缩写)。 - -Yast(Yet another Setup Tool )是 OpenSUSE 以及企业版 SUSE 上用于系统管理、设置和配置的工具。 - -Zypper 是软件包管理器ZYpp的命令行接口,可用于安装、删除SUSE Linux上的软件以及进行系统更新。ZYpp为Zypper和Yast提供底层支持。 - -本文将介绍实际应用中常见的一些Zypper命令。这些命令用来进行安装、更新、删除等任何软件包管理器所能够胜任的工作。 - -**重要** : 切记所有的这些指令都将在系统全局范围内产生影响,所以必须以 root 身份执行,否则命令将失败。 - -### 获取基本的 Zypper 帮助信息 ### - -1. 不带任何选项的执行 zypper, 将输出该命令的全局选项以及子命令列表(译者注:全局选项,global option,控制台命令的输入分为可选参数和位置参数两大类。按照习惯,一般可选参数称为选项'option',而位置参数称为参数 'argument')。 - -
%>  zypper
-        Usage:
-        zypper [--global-options]
- -2. 获取一个具体的子命令的帮助信息,比如 'in' (install),可以执行下面的命令 - -
%> zypper help in
- 或者 -
%> zypper help install
-    install (in) [options] {capability | rpm_file_uri}
-    
-    Install packages with specified capabilities or RPM files with specified
-    location. A capability is NAME[.ARCH][OP], where OP is one
-    of <, <=, =, >=, >.
-    
-      Command options:
-    --from     Select packages from the specified repository.
-    -r, --repo     Load only the specified repository.
-    -t, --type            Type of package (package, patch, pattern, product, srcpackage).
-                                Default: package.
-    -n, --name                  Select packages by plain name, not by capability.
-    -C, --capability            Select packages by capability.
-    -f, --force                 Install even if the item is already installed (reinstall),
-                                downgraded or changes vendor or architecture.
-        --oldpackage            Allow to replace a newer item with an older one.
-                                Handy if you are doing a rollback. Unlike --force
-    j                            it will not enforce a reinstall.
-        --replacefiles          Install the packages even if they replace files from other,
-                                already installed, packages. Default is to treat file conflicts
-                                as an error. --download-as-needed disables the fileconflict check.
-    ...... 
- -3. 安装之前搜索一个安转包(以 gnome-desktop 为例 ) - -
# zypper se gnome-desktop
-    
-    Retrieving repository 'openSUSE-13.2-Debug' metadata ............................................................[done]
-    Building repository 'openSUSE-13.2-Debug' cache .................................................................[done]
-    Retrieving repository 'openSUSE-13.2-Non-Oss' metadata ......................................................... [done]
-    Building repository 'openSUSE-13.2-Non-Oss' cache ...............................................................[done]
-    Retrieving repository 'openSUSE-13.2-Oss' metadata ..............................................................[done]
-    Building repository 'openSUSE-13.2-Oss' cache ...................................................................[done]
-    Retrieving repository 'openSUSE-13.2-Update' metadata ...........................................................[done]
-    Building repository 'openSUSE-13.2-Update' cache ................................................................[done]
-    Retrieving repository 'openSUSE-13.2-Update-Non-Oss' metadata ...................................................[done]
-    Building repository 'openSUSE-13.2-Update-Non-Oss' cache ........................................................[done]
-    Loading repository data...
-    Reading installed packages...
-    
-    S | Name                                  | Summary                                                   | Type
-    --+---------------------------------------+-----------------------------------------------------------+-----------
-      | gnome-desktop2-lang                   | Languages for package gnome-desktop2                      | package
-      | gnome-desktop2                        | The GNOME Desktop API Library                             | package
-      | libgnome-desktop-2-17                 | The GNOME Desktop API Library                             | package
-      | libgnome-desktop-3-10                 | The GNOME Desktop API Library                             | package
-      | libgnome-desktop-3-devel              | The GNOME Desktop API Library -- Development Files        | package
-      | libgnome-desktop-3_0-common           | The GNOME Desktop API Library -- Common data files        | package
-      | gnome-desktop-debugsource             | Debug sources for package gnome-desktop                   | package
-      | gnome-desktop-sharp2-debugsource      | Debug sources for package gnome-desktop-sharp2            | package
-      | gnome-desktop2-debugsource            | Debug sources for package gnome-desktop2                  | package
-      | libgnome-desktop-2-17-debuginfo       | Debug information for package libgnome-desktop-2-17       | package
-      | libgnome-desktop-3-10-debuginfo       | Debug information for package libgnome-desktop-3-10       | package
-      | libgnome-desktop-3_0-common-debuginfo | Debug information for package libgnome-desktop-3_0-common | package
-      | libgnome-desktop-2-17-debuginfo-32bit | Debug information for package libgnome-desktop-2-17       | package
-      | libgnome-desktop-3-10-debuginfo-32bit | Debug information for package libgnome-desktop-3-10       | package
-      | gnome-desktop-sharp2                  | Mono bindings for libgnome-desktop                        | package
-      | libgnome-desktop-2-devel              | The GNOME Desktop API Library -- Development Files        | packag
-      | gnome-desktop-lang                    | Languages for package gnome-desktop                       | package
-      | libgnome-desktop-2-17-32bit           | The GNOME Desktop API Library                             | package
-      | libgnome-desktop-3-10-32bit           | The GNOME Desktop API Library                             | package
-      | gnome-desktop                         | The GNOME Desktop API Library                             | srcpackage
- -4. 获取一个模式包的信息(以 lamp_server 为例)。 - -
%> zypper info -t pattern lamp_server
-    
-    Loading repository data...
-    Reading installed packages...
-    
-    
-    Information for pattern lamp_server:
-    ------------------------------------
-    Repository: openSUSE-13.2-Update
-    Name: lamp_server
-    Version: 20141007-5.1
-    Arch: x86_64
-    Vendor: openSUSE
-    Installed: No
-    Visible to User: Yes
-    Summary: Web and LAMP Server
-    Description: 
-      Software to set up a Web server that is able to serve static, dynamic, and interactive content (like a Web shop). This includes Apache HTTP Server, the database management system MySQL,
-      and scripting languages such as PHP, Python, Ruby on Rails, or Perl.
-    Contents:
-    
-    S | Name                          | Type    | Dependency
-    --+-------------------------------+---------+-----------
-      | apache2-mod_php5              | package |
-      | php5-iconv                    | package |
-    i | patterns-openSUSE-base        | package |
-    i | apache2-prefork               | package |
-      | php5-dom                      | package |
-      | php5-mysql                    | package |
-    i | apache2                       | package |
-      | apache2-example-pages         | package |
-      | mariadb                       | package |
-      | apache2-mod_perl              | package |
-      | php5-ctype                    | package |
-      | apache2-doc                   | package |
-      | yast2-http-server             | package |
-      | patterns-openSUSE-lamp_server | package |
- -5. 开启一个Zypper Shell 的会话。 - -
 %>zypper shell 
- 或者 -
 %>zypper sh 
- -
zypper> help
-      Usage:
-    	zypper [--global-options]
- -**注意**:在 Zypper shell里面可以通过键入 ‘help‘ 获得全局选项以及子命令的列表。 -### Zypper 软件库管理 ### - -#### 列举已定义的软件库 #### - -6. 使用 'zypper repos' 或者 'zypper lr' 来列举所有已定以的软件库。 - -
%> zypper repos
- 或者 -
%> zypper lr
-      | Alias                     | Name                               | Enabled | Refresh
-    --+---------------------------+------------------------------------+---------+--------
-    1 | openSUSE-13.2-0           | openSUSE-13.2-0                    | Yes     | No
-    2 | repo-debug                | openSUSE-13.2-Debug                | Yes     | Yes
-    3 | repo-debug-update         | openSUSE-13.2-Update-Debug         | No      | Yes
-    4 | repo-debug-update-non-oss | openSUSE-13.2-Update-Debug-Non-Oss | No      | Yes
-    5 | repo-non-oss              | openSUSE-13.2-Non-Oss              | Yes     | Yes
-    6 | repo-oss                  | openSUSE-13.2-Oss                  | Yes     | Yes
-    7 | repo-source               | openSUSE-13.2-Source               | No      | Yes
-    8 | repo-update               | openSUSE-13.2-Update               | Yes     | Yes
-    9 | repo-update-non-oss       | openSUSE-13.2-Update-Non-Oss       | Yes     | Yes
- -7. 在表格里面显示 zypper URI - -
# zypper lr -u
-      | Alias                     | Name                               | Enabled | Refresh | URI
-    --+---------------------------+------------------------------------+---------+---------+----------------------------------------------------------------
-    1 | openSUSE-13.2-0           | openSUSE-13.2-0                    | Yes     | No      | cd:///?devices=/dev/disk/by-id/ata-VBOX_CD-ROM_VB2-01700376
-    2 | repo-debug                | openSUSE-13.2-Debug                | Yes     | Yes     | http://download.opensuse.org/debug/distribution/13.2/repo/oss/
-    3 | repo-debug-update         | openSUSE-13.2-Update-Debug         | No      | Yes     | http://download.opensuse.org/debug/update/13.2/
-    4 | repo-debug-update-non-oss | openSUSE-13.2-Update-Debug-Non-Oss | No      | Yes     | http://download.opensuse.org/debug/update/13.2-non-oss/
-    5 | repo-non-oss              | openSUSE-13.2-Non-Oss              | Yes     | Yes     | http://download.opensuse.org/distribution/13.2/repo/non-oss/
-    6 | repo-oss                  | openSUSE-13.2-Oss                  | Yes     | Yes     | http://download.opensuse.org/distribution/13.2/repo/oss/
-    7 | repo-source               | openSUSE-13.2-Source               | No      | Yes     | http://download.opensuse.org/source/distribution/13.2/repo/oss/
-    8 | repo-update               | openSUSE-13.2-Update               | Yes     | Yes     | http://download.opensuse.org/update/13.2/
-    9 | repo-update-non-oss       | openSUSE-13.2-Update-Non-Oss       | Yes     | Yes     | http://download.opensuse.org/update/13.2-non-oss/
- -8. 根据优先级列举软件库。 - -
%> zypper lr -P
-      | Alias                     | Name                               | Enabled | Refresh | Priority
-    --+---------------------------+------------------------------------+---------+---------+---------
-    1 | openSUSE-13.2-0           | openSUSE-13.2-0                    | Yes     | No      |   99
-    2 | repo-debug                | openSUSE-13.2-Debug                | Yes     | Yes     |   99
-    3 | repo-debug-update         | openSUSE-13.2-Update-Debug         | No      | Yes     |   99
-    4 | repo-debug-update-non-oss | openSUSE-13.2-Update-Debug-Non-Oss | No      | Yes     |   99
-    5 | repo-non-oss              | openSUSE-13.2-Non-Oss              | Yes     | Yes     |   85
-    6 | repo-oss                  | openSUSE-13.2-Oss                  | Yes     | Yes     |   99
-    7 | repo-source               | openSUSE-13.2-Source               | No      | Yes     |   99
-    8 | repo-update               | openSUSE-13.2-Update               | Yes     | Yes     |   99
-    9 | repo-update-non-oss       | openSUSE-13.2-Update-Non-Oss       | Yes     | Yes     |   99
- -#### 刷新软件库 #### - -9. 使用 'zypper refresh' or 'zypper ref' 来刷新 zypper 软件库。 - -
%> zypper refresh 
- 或者 -
%> zypper ref
-    Repository 'openSUSE-13.2-0' is up to date.
-    Repository 'openSUSE-13.2-Debug' is up to date.
-    Repository 'openSUSE-13.2-Non-Oss' is up to date.
-    Repository 'openSUSE-13.2-Oss' is up to date.
-    Repository 'openSUSE-13.2-Update' is up to date.
-    Repository 'openSUSE-13.2-Update-Non-Oss' is up to date.
-    All repositories have been refreshed. 
- -10. 刷新一个指定的软件库(以 'repo-non-oss' 为例 )。 - -
%> zypper refresh repo-non-oss
-    Repository 'openSUSE-13.2-Non-Oss' is up to date.
-    Specified repositories have been refreshed. 
- -11. 强制更新一个软件库(以 'repo-non-oss' 为例 )。 - -
%> zypper ref -f repo-non-oss 
-    Forcing raw metadata refresh
-    Retrieving repository 'openSUSE-13.2-Non-Oss' metadata ............................................................[done]
-    Forcing building of repository cache
-    Building repository 'openSUSE-13.2-Non-Oss' cache ............................................................[done]
-    Specified repositories have been refreshed.
- -#### 修改软件库 #### - -本文中我们使用‘zypper modifyrepo‘ 或者 ‘zypper mr‘ 来关闭或者开启 zypper 软件库。 - -12. 在关闭一个软件库之前,我们需要知道在 zypper中,每一个软件库有一个唯一的标示数字与之关联,该数字用于打开或者关闭与之相联系的软件库。假设我们需要关闭 'repo-oss' 软件库,那么我们可以通过以下的法来获得该软件库的标志数字。 - -
%> zypper lr
-      | Alias                     | Name                               | Enabled | Refresh
-    --+---------------------------+------------------------------------+---------+--------
-    1 | openSUSE-13.2-0           | openSUSE-13.2-0                    | Yes     | No
-    2 | repo-debug                | openSUSE-13.2-Debug                | Yes     | Yes
-    3 | repo-debug-update         | openSUSE-13.2-Update-Debug         | No      | Yes
-    4 | repo-debug-update-non-oss | openSUSE-13.2-Update-Debug-Non-Oss | No      | Yes
-    5 | repo-non-oss              | openSUSE-13.2-Non-Oss              | Yes     | Yes
-    6 | repo-oss                  | openSUSE-13.2-Oss                  | No      | Yes
-    7 | repo-source               | openSUSE-13.2-Source               | No      | Yes
-    8 | repo-update               | openSUSE-13.2-Update               | Yes     | Yes
-    9 | repo-update-non-oss       | openSUSE-13.2-Update-Non-Oss       | Yes     | Yes
-从以上输出的列表中我们可以看到 'repo-oss' 库的标示数字是 6,因此通过以下的命令来关闭该库。 - -
%> zypper mr -d 6
-    Repository 'repo-oss' has been successfully disabled.
- -13. 如果需要再次开启软件库 ‘repo-oss‘, 接上例,与之相关联的标示数字为 6。 - -
%> zypper mr -e 6
-    Repository 'repo-oss' has been successfully enabled.
- -14. 针对某一个软件库(以 'repo-non-oss' 为例 )开启自动刷新( auto-refresh )和 rpm 缓存,并设置该软件库的优先级,比如85。 - -
%> zypper mr -rk -p 85 repo-non-oss
-    Repository 'repo-non-oss' priority has been left unchanged (85)
-    Nothing to change for repository 'repo-non-oss'.
- -15. 对所有的软件库关闭 rpm 文件缓存。 - -
%> zypper mr -Ka
-    RPM files caching has been disabled for repository 'openSUSE-13.2-0'.
-    RPM files caching has been disabled for repository 'repo-debug'.
-    RPM files caching has been disabled for repository 'repo-debug-update'.
-    RPM files caching has been disabled for repository 'repo-debug-update-non-oss'.
-    RPM files caching has been disabled for repository 'repo-non-oss'.
-    RPM files caching has been disabled for repository 'repo-oss'.
-    RPM files caching has been disabled for repository 'repo-source'.
-    RPM files caching has been disabled for repository 'repo-update'.
-    RPM files caching has been disabled for repository 'repo-update-non-oss'.
- -16. 对所有的软件库开启 rpm 文件缓存。 -
 zypper mr -ka
-    RPM files caching has been enabled for repository 'openSUSE-13.2-0'.
-    RPM files caching has been enabled for repository 'repo-debug'.
-    RPM files caching has been enabled for repository 'repo-debug-update'.
-    RPM files caching has been enabled for repository 'repo-debug-update-non-oss'.
-    RPM files caching has been enabled for repository 'repo-non-oss'.
-    RPM files caching has been enabled for repository 'repo-oss'.
-    RPM files caching has been enabled for repository 'repo-source'.
-    RPM files caching has been enabled for repository 'repo-update'.
-    RPM files caching has been enabled for repository 'repo-update-non-oss'.
- -17. 关闭远程库的rpm 文件缓存 -
%> zypper mr -Kt
-    RPM files caching has been disabled for repository 'repo-debug'.
-    RPM files caching has been disabled for repository 'repo-debug-update'.
-    RPM files caching has been disabled for repository 'repo-debug-update-non-oss'.
-    RPM files caching has been disabled for repository 'repo-non-oss'.
-    RPM files caching has been disabled for repository 'repo-oss'.
-    RPM files caching has been disabled for repository 'repo-source'.
-    RPM files caching has been disabled for repository 'repo-update'.
-    RPM files caching has been disabled for repository 'repo-update-non-oss'.
- -18. 开启远程软件库的 rpm 文件缓存。 -
%> zypper mr -kt
-    RPM files caching has been enabled for repository 'repo-debug'.
-    RPM files caching has been enabled for repository 'repo-debug-update'.
-    RPM files caching has been enabled for repository 'repo-debug-update-non-oss'.
-    RPM files caching has been enabled for repository 'repo-non-oss'.
-    RPM files caching has been enabled for repository 'repo-oss'.
-    RPM files caching has been enabled for repository 'repo-source'.
-    RPM files caching has been enabled for repository 'repo-update'.
-    RPM files caching has been enabled for repository 'repo-update-non-oss'.
- -#### 增加新的软件库 #### - -可以通过这两个 zypper 指令 – 'zypper addrepo' 和 'zypper ar' 来增加新的软件库。在此过程中可以使用 URL 或者软件库的别名。 - -19. 增加一个新的软件库( 以 “http://download.opensuse.org/update/12.3/” 为例 )。 - -
%>  zypper ar http://download.opensuse.org/update/11.1/ update
-    Adding repository 'update' .............................................................................................................................................................[done]
-    Repository 'update' successfully added
-    Enabled     : Yes
-    Autorefresh : No
-    GPG check   : Yes
-    URI         : http://download.opensuse.org/update/11.1/
- -20. 更改一个软件库的名字,这将仅仅改变软件库的别名。 命令 'zypper namerepo' 或者 'zypperr nr' 可以胜任此工作。例如更改标示数字为10的软件库的名字为 'upd8',或者说将标示数字为10的软件库的别名改为 'upd8',可以使用下面的命令。 - -
%> zypper nr 10 upd8
-    Repository 'update' renamed to 'upd8'.
- -#### 删除软件库 #### - -21. 删除一个软件库。要从系统删除一个软件库可以使 'zypper removerepo' 或者 'zypper rr'。例如以下的命令可以删除软件库 'upd8' - -
%> zypper rr upd8
-    # Removing repository 'upd8' .........................................................................................[done]
-    Repository 'upd8' has been removed.
- -### 使用 zypper 进行软件包管理 ### - -#### 用 zypper 安装一个软件包 #### - -22. 在 zypper 中,我们可以通过软件包的功能名称来安装一个软件包。以 Firefox 为例,以下的命令可以用来安装该软件包。 -
%> zypper in MozillaFirefox
-    Loading repository data...
-    Reading installed packages...
-    Resolving package dependencies...
-
-    The following 128 NEW packages are going to be installed:
-      adwaita-icon-theme at-spi2-atk-common at-spi2-atk-gtk2 at-spi2-core cantarell-fonts cups-libs desktop-file-utils fontconfig gdk-pixbuf-query-loaders gstreamer gstreamer-fluendo-mp3
-      gstreamer-plugins-base gtk2-branding-openSUSE gtk2-data gtk2-immodule-amharic gtk2-immodule-inuktitut gtk2-immodule-thai gtk2-immodule-vietnamese gtk2-metatheme-adwaita
-      gtk2-theming-engine-adwaita gtk2-tools gtk3-data gtk3-metatheme-adwaita gtk3-tools hicolor-icon-theme hicolor-icon-theme-branding-openSUSE libasound2 libatk-1_0-0 libatk-bridge-2_0-0
-      libatspi0 libcairo2 libcairo-gobject2 libcanberra0 libcanberra-gtk0 libcanberra-gtk2-module libcanberra-gtk3-0 libcanberra-gtk3-module libcanberra-gtk-module-common libcdda_interface0
-      libcdda_paranoia0 libcolord2 libdrm2 libdrm_intel1 libdrm_nouveau2 libdrm_radeon1 libFLAC8 libfreebl3 libgbm1 libgdk_pixbuf-2_0-0 libgraphite2-3 libgstapp-1_0-0 libgstaudio-1_0-0
-      libgstpbutils-1_0-0 libgstreamer-1_0-0 libgstriff-1_0-0 libgsttag-1_0-0 libgstvideo-1_0-0 libgthread-2_0-0 libgtk-2_0-0 libgtk-3-0 libharfbuzz0 libjasper1 libjbig2 libjpeg8 libjson-c2
-      liblcms2-2 libLLVM libltdl7 libnsssharedhelper0 libogg0 liborc-0_4-0 libpackagekit-glib2-18 libpango-1_0-0 libpciaccess0 libpixman-1-0 libpulse0 libsndfile1 libsoftokn3 libspeex1
-      libsqlite3-0 libstartup-notification-1-0 libtheoradec1 libtheoraenc1 libtiff5 libvisual libvorbis0 libvorbisenc2 libvorbisfile3 libwayland-client0 libwayland-cursor0 libwayland-server0
-      libX11-xcb1 libxcb-dri2-0 libxcb-dri3-0 libxcb-glx0 libxcb-present0 libxcb-render0 libxcb-shm0 libxcb-sync1 libxcb-util1 libxcb-xfixes0 libXcomposite1 libXcursor1 libXdamage1 libXevie1
-      libXfixes3 libXft2 libXi6 libXinerama1 libxkbcommon-0_4_3 libXrandr2 libXrender1 libxshmfence1 libXtst6 libXv1 libXxf86vm1 Mesa Mesa-libEGL1 Mesa-libGL1 Mesa-libglapi0
-      metatheme-adwaita-common MozillaFirefox MozillaFirefox-branding-openSUSE mozilla-nss mozilla-nss-certs PackageKit-gstreamer-plugin pango-tools sound-theme-freedesktop
-
-    The following 10 recommended packages were automatically selected:
-      gstreamer-fluendo-mp3 gtk2-branding-openSUSE gtk2-data gtk2-immodule-amharic gtk2-immodule-inuktitut gtk2-immodule-thai gtk2-immodule-vietnamese libcanberra0 libpulse0
-      PackageKit-gstreamer-plugin
-    
-    128 new packages to install.
-    Overall download size: 77.2 MiB. Already cached: 0 B  After the operation, additional 200.0 MiB will be used.
-    Continue? [y/n/? shows all options] (y): y
-    Retrieving package cantarell-fonts-0.0.16-1.1.noarch                                                                                                   (1/128),  74.1 KiB (115.6 KiB unpacked)
-    Retrieving: cantarell-fonts-0.0.16-1.1.noarch.rpm .........................................................................................................................[done (63.4 KiB/s)]
-    Retrieving package hicolor-icon-theme-0.13-2.1.2.noarch                                                                                                (2/128),  40.1 KiB ( 50.5 KiB unpacked)
-    Retrieving: hicolor-icon-theme-0.13-2.1.2.noarch.rpm ...................................................................................................................................[done]
-    Retrieving package sound-theme-freedesktop-0.8-7.1.2.noarch                                                                                            (3/128), 372.6 KiB (460.3 KiB unpacked) 
- -23. 安装指定版本号的软件包,(以 gcc 5.1 为例)。 -
 %>zypper in 'gcc<5.1'
-    Loading repository data...
-    Reading installed packages...
-    Resolving package dependencies...
-
-    The following 13 NEW packages are going to be installed:
-      cpp cpp48 gcc gcc48 libasan0 libatomic1-gcc49 libcloog-isl4 libgomp1-gcc49 libisl10 libitm1-gcc49 libmpc3 libmpfr4 libtsan0-gcc49
-
-    13 new packages to install.
-    Overall download size: 14.5 MiB. Already cached: 0 B  After the operation, additional 49.4 MiB will be used.
-    Continue? [y/n/? shows all options] (y): y 
- -24. 为特定的CPU架构安装软件包(以兼容 i586 的 gcc 为例)。 - -
%> zypper in gcc.i586
-    Loading repository data...
-    Reading installed packages...
-    Resolving package dependencies...
-
-    The following 13 NEW packages are going to be installed:
-      cpp cpp48 gcc gcc48 libasan0 libatomic1-gcc49 libcloog-isl4 libgomp1-gcc49 libisl10 libitm1-gcc49 libmpc3 libmpfr4 libtsan0-gcc49
-
-    13 new packages to install.
-    Overall download size: 14.5 MiB. Already cached: 0 B  After the operation, additional 49.4 MiB will be used.
-    Continue? [y/n/? shows all options] (y): y
-    Retrieving package libasan0-4.8.3+r212056-2.2.4.x86_64                                                                                                  (1/13),  74.2 KiB (166.9 KiB unpacked)
-    Retrieving: libasan0-4.8.3+r212056-2.2.4.x86_64.rpm .......................................................................................................................[done (79.2 KiB/s)]
-    Retrieving package libatomic1-gcc49-4.9.0+r211729-2.1.7.x86_64                                                                                          (2/13),  14.3 KiB ( 26.1 KiB unpacked)
-    Retrieving: libatomic1-gcc49-4.9.0+r211729-2.1.7.x86_64.rpm ...............................................................................................................[done (55.3 KiB/s)] 
- -25. 为特定的CPU架构安装指定版本号的软件包(以兼容 i586 且版本低于5.1的 gcc 为例) - -
%> zypper in 'gcc.i586<5.1'
-    Loading repository data...
-    Reading installed packages...
-    Resolving package dependencies...
-
-    The following 13 NEW packages are going to be installed:
-      cpp cpp48 gcc gcc48 libasan0 libatomic1-gcc49 libcloog-isl4 libgomp1-gcc49 libisl10 libitm1-gcc49 libmpc3 libmpfr4 libtsan0-gcc49
-
-    13 new packages to install.
-    Overall download size: 14.4 MiB. Already cached: 129.5 KiB  After the operation, additional 49.4 MiB will be used.
-    Continue? [y/n/? shows all options] (y): y
-    In cache libasan0-4.8.3+r212056-2.2.4.x86_64.rpm                                                                                                        (1/13),  74.2 KiB (166.9 KiB unpacked)
-    In cache libatomic1-gcc49-4.9.0+r211729-2.1.7.x86_64.rpm                                           (2/13),  14.3 KiB ( 26.1 KiB unpacked)
-    In cache libgomp1-gcc49-4.9.0+r211729-2.1.7.x86_64.rpm                                             (3/13),  41.1 KiB ( 90.7 KiB unpacked) 
- -26. 从指定的软件库里面安装一个软件包,例如从 amarok 中安装 libxine。 -
%> zypper in amarok upd:libxine1
-    Loading repository data...
-    Reading installed packages...
-    Resolving package dependencies...
-    The following 202 NEW packages are going to be installed:
-      amarok bundle-lang-kde-en clamz cups-libs enscript fontconfig gdk-pixbuf-query-loaders ghostscript-fonts-std gptfdisk gstreamer gstreamer-plugins-base hicolor-icon-theme
-      hicolor-icon-theme-branding-openSUSE htdig hunspell hunspell-tools icoutils ispell ispell-american kde4-filesystem kdebase4-runtime kdebase4-runtime-branding-openSUSE kdelibs4
-      kdelibs4-branding-openSUSE kdelibs4-core kdialog libakonadi4 l
-    .....
- -27. 通过指定软件包的名字安装软件包。 - -
%> zypper in -n git
-    Loading repository data...
-    Reading installed packages...
-    Resolving package dependencies...
-
-    The following 35 NEW packages are going to be installed:
-      cvs cvsps fontconfig git git-core git-cvs git-email git-gui gitk git-svn git-web libserf-1-1 libsqlite3-0 libXft2 libXrender1 libXss1 perl-Authen-SASL perl-Clone perl-DBD-SQLite perl-DBI
-      perl-Error perl-IO-Socket-SSL perl-MLDBM perl-Net-Daemon perl-Net-SMTP-SSL perl-Net-SSLeay perl-Params-Util perl-PlRPC perl-SQL-Statement perl-Term-ReadKey subversion subversion-perl tcl
-      tk xhost
-
-    The following 13 recommended packages were automatically selected:
-      git-cvs git-email git-gui gitk git-svn git-web perl-Authen-SASL perl-Clone perl-MLDBM perl-Net-Daemon perl-Net-SMTP-SSL perl-PlRPC perl-SQL-Statement
-
-    The following package is suggested, but will not be installed:
-      git-daemon
-
-    35 new packages to install.
-    Overall download size: 15.6 MiB. Already cached: 0 B  After the operation, additional 56.7 MiB will be used.
-    Continue? [y/n/? shows all options] (y): y 
- -28. 通过通配符来安装软件包,例如,安装所有 php5 的软件包。 -
%> zypper in php5*
-    Loading repository data...
-    Reading installed packages...
-    Resolving package dependencies...
-
-    Problem: php5-5.6.1-18.1.x86_64 requires smtp_daemon, but this requirement cannot be provided
-      uninstallable providers: exim-4.83-3.1.8.x86_64[openSUSE-13.2-0]
-                       postfix-2.11.0-5.2.2.x86_64[openSUSE-13.2-0]
-                       sendmail-8.14.9-2.2.2.x86_64[openSUSE-13.2-0]
-                       exim-4.83-3.1.8.i586[repo-oss]
-                       msmtp-mta-1.4.32-2.1.3.i586[repo-oss]
-                       postfix-2.11.0-5.2.2.i586[repo-oss]
-                       sendmail-8.14.9-2.2.2.i586[repo-oss]
-                       exim-4.83-3.1.8.x86_64[repo-oss]
-                       msmtp-mta-1.4.32-2.1.3.x86_64[repo-oss]
-                       postfix-2.11.0-5.2.2.x86_64[repo-oss]
-                       sendmail-8.14.9-2.2.2.x86_64[repo-oss]
-                       postfix-2.11.3-5.5.1.i586[repo-update]
-                       postfix-2.11.3-5.5.1.x86_64[repo-update]
-     Solution 1: Following actions will be done:
-      do not install php5-5.6.1-18.1.x86_64
-      do not install php5-pear-Auth_SASL-1.0.6-7.1.3.noarch
-      do not install php5-pear-Horde_Http-2.0.1-6.1.3.noarch
-      do not install php5-pear-Horde_Image-2.0.1-6.1.3.noarch
-      do not install php5-pear-Horde_Kolab_Format-2.0.1-6.1.3.noarch
-      do not install php5-pear-Horde_Ldap-2.0.1-6.1.3.noarch
-      do not install php5-pear-Horde_Memcache-2.0.1-7.1.3.noarch
-      do not install php5-pear-Horde_Mime-2.0.2-6.1.3.noarch
-      do not install php5-pear-Horde_Oauth-2.0.0-6.1.3.noarch
-      do not install php5-pear-Horde_Pdf-2.0.1-6.1.3.noarch
-    ....
- -29. 使用模式名称(模式名称是一类软件包的名字)来批量安装软件包 - -
%> zypper in -t pattern lamp_server
-    ading repository data...
-    Reading installed packages...
-    Resolving package dependencies...
-
-    The following 29 NEW packages are going to be installed:
-      apache2 apache2-doc apache2-example-pages apache2-mod_perl apache2-prefork patterns-openSUSE-lamp_server perl-Data-Dump perl-Encode-Locale perl-File-Listing perl-HTML-Parser
-      perl-HTML-Tagset perl-HTTP-Cookies perl-HTTP-Daemon perl-HTTP-Date perl-HTTP-Message perl-HTTP-Negotiate perl-IO-HTML perl-IO-Socket-SSL perl-libwww-perl perl-Linux-Pid
-      perl-LWP-MediaTypes perl-LWP-Protocol-https perl-Net-HTTP perl-Net-SSLeay perl-Tie-IxHash perl-TimeDate perl-URI perl-WWW-RobotRules yast2-http-server
-
-    The following NEW pattern is going to be installed:
-      lamp_server
-
-    The following 10 recommended packages were automatically selected:
-      apache2 apache2-doc apache2-example-pages apache2-mod_perl apache2-prefork perl-Data-Dump perl-IO-Socket-SSL perl-LWP-Protocol-https perl-TimeDate yast2-http-server
-
-    29 new packages to install.
-    Overall download size: 7.2 MiB. Already cached: 1.2 MiB  After the operation, additional 34.7 MiB will be used.
-    Continue? [y/n/? shows all options] (y): 
- -30. 使用一行命令安转一个软件包同时卸载另一个软件包,例如在安装 nano 的同时卸载 vi - -
# zypper in nano -vi
-    Loading repository data...
-    Reading installed packages...
-    '-vi' not found in package names. Trying capabilities.
-    Resolving package dependencies...
-
-    The following 2 NEW packages are going to be installed:
-      nano nano-lang
-
-    The following package is going to be REMOVED:
-      vim
-
-    The following recommended package was automatically selected:
-      nano-lang
-
-    2 new packages to install, 1 to remove.
-    Overall download size: 550.0 KiB. Already cached: 0 B  After the operation, 463.3 KiB will be freed.
-    Continue? [y/n/? shows all options] (y):
-    ...
- -31. 使用 zypper 安装 rpm 软件包。 - -
%> zypper in teamviewer*.rpm
-    Loading repository data...
-    Reading installed packages...
-    Resolving package dependencies...
-
-    The following 24 NEW packages are going to be installed:
-      alsa-oss-32bit fontconfig-32bit libasound2-32bit libexpat1-32bit libfreetype6-32bit libgcc_s1-gcc49-32bit libICE6-32bit libjpeg62-32bit libpng12-0-32bit libpng16-16-32bit libSM6-32bit
-      libuuid1-32bit libX11-6-32bit libXau6-32bit libxcb1-32bit libXdamage1-32bit libXext6-32bit libXfixes3-32bit libXinerama1-32bit libXrandr2-32bit libXrender1-32bit libXtst6-32bit
-      libz1-32bit teamviewer
-
-    The following recommended package was automatically selected:
-      alsa-oss-32bit
-
-    24 new packages to install.
-    Overall download size: 41.2 MiB. Already cached: 0 B  After the operation, additional 119.7 MiB will be used.
-    Continue? [y/n/? shows all options] (y):
-    ..
- -#### 使用 zypper 卸载软件包 #### - -32. 命令 ‘zypper remove‘ 和 ‘zypper rm‘ 用于卸载软件包。例如卸载 apache2: - -
%> zypper remove apache2 
- 或者 -
%> zypper rm apache2
-    Loading repository data...
-    Reading installed packages...
-    Resolving package dependencies...
-
-    The following 2 packages are going to be REMOVED:
-      apache2 apache2-prefork
-
-    2 packages to remove.
-    After the operation, 4.2 MiB will be freed.
-    Continue? [y/n/? shows all options] (y): y
-    (1/2) Removing apache2-2.4.10-19.1 ........................................................................[done]
-    (2/2) Removing apache2-prefork-2.4.10-19.1 ................................................................[done] 
- -#### 使用Zypper 进行软件包更新 #### - -33. 更新所有的软件包,可以使用 ‘zypper update‘ 或者 ‘zypper up‘。 - -
%> zypper up 
- 或者 -
%> zypper update
-
-    Loading repository data...
-    Reading installed packages...
-    Nothing to do. 
- -34. 更新指定的软件包,例如更新 apache2 以及 openssh。 - -
 zypper up apache2 openssh
-    Loading repository data...
-    Reading installed packages...
-    No update candidate for 'apache2-2.4.10-19.1.x86_64'. The highest available version is already installed.
-    No update candidate for 'openssh-6.6p1-5.1.3.x86_64'. The highest available version is already installed.
-    Resolving package dependencies...
-
-    Nothing to do.
- -35. 安装一个软件库,例如 ariadb,如果该库存在则更新之。 - -
%> zypper in mariadb
-    Loading repository data...
-    Reading installed packages...
-    'mariadb' is already installed.
-    No update candidate for 'mariadb-10.0.13-2.6.1.x86_64'. The highest available version is already installed.
-    Resolving package dependencies...
-
-    Nothing to do.
- -#### 安装源文件并且构建依赖关系 #### - -命令 ‘zypper source-install‘ 或者 ‘zypper si‘ 可以用于从源文件编译软件包 - -36. 安装某一个软件包的源文件及其依赖关系,例如 mariadb。 - -
%> zypper si mariadb
-    Reading installed packages...
-    Loading repository data...
-    Resolving package dependencies...
-
-    The following 36 NEW packages are going to be installed:
-      autoconf automake bison cmake cpp cpp48 gcc gcc48 gcc48-c++ gcc-c++ libaio-devel libarchive13 libasan0 libatomic1-gcc49 libcloog-isl4 libedit-devel libevent-devel libgomp1-gcc49 libisl10
-      libitm1-gcc49 libltdl7 libmpc3 libmpfr4 libopenssl-devel libstdc++48-devel libtool libtsan0-gcc49 m4 make ncurses-devel pam-devel readline-devel site-config tack tcpd-devel zlib-devel
-
-    The following source package is going to be installed:
-      mariadb
-
-    36 new packages to install, 1 source package.
-    Overall download size: 71.5 MiB. Already cached: 129.5 KiB  After the operation, additional 183.9 MiB will be used.
-    Continue? [y/n/? shows all options] (y): y 
- -37. 仅为某一个软件包安装源文件,例如 mariadb - -
%> zypper in -D mariadb
-    Loading repository data...
-    Reading installed packages...
-    'mariadb' is already installed.
-    No update candidate for 'mariadb-10.0.13-2.6.1.x86_64'. The highest available version is already installed.
-    Resolving package dependencies...
-
-    Nothing to do. 
- -38. 仅为某一个软件包安装依赖关系,例如 mariadb - -
%> zypper si -d mariadb
-    Reading installed packages...
-    Loading repository data...
-    Resolving package dependencies...
-
-    The following 36 NEW packages are going to be installed:
-      autoconf automake bison cmake cpp cpp48 gcc gcc48 gcc48-c++ gcc-c++ libaio-devel libarchive13 libasan0 libatomic1-gcc49 libcloog-isl4 libedit-devel libevent-devel libgomp1-gcc49 libisl10
-      libitm1-gcc49 libltdl7 libmpc3 libmpfr4 libopenssl-devel libstdc++48-devel libtool libtsan0-gcc49 m4 make ncurses-devel pam-devel readline-devel site-config tack tcpd-devel zlib-devel
-
-    The following package is recommended, but will not be installed due to conflicts or dependency issues:
-      readline-doc
-
-    36 new packages to install.
-    Overall download size: 33.7 MiB. Already cached: 129.5 KiB  After the operation, additional 144.3 MiB will be used.
-    Continue? [y/n/? shows all options] (y): y
- -#### Zypper in Scripts and Applications #### - -39. 安装一个软件包,并且在安装过程中跳过与用户的交互, 例如 mariadb。 - -
%> zypper --non-interactive in mariadb
-    Loading repository data...
-    Reading installed packages...
-    'mariadb' is already installed.
-    No update candidate for 'mariadb-10.0.13-2.6.1.x86_64'. The highest available version is already installed.
-    Resolving package dependencies...
-
-    Nothing to do.
- -40. 卸载一个软件包,并且在卸载过程中跳过与用户的交互,例如 mariadb - -
%> zypper --non-interactive rm mariadb
-    Loading repository data...
-    Reading installed packages...
-    Resolving package dependencies...
-
-    The following package is going to be REMOVED:
-      mariadb
-
-    1 package to remove.
-    After the operation, 71.8 MiB will be freed.
-    Continue? [y/n/? shows all options] (y): y
-    (1/1) Removing mariadb-10.0.13-2.6.1 .............................................................................[done] 
- -41. 将 zypper 输出用 XML 格式打印。 - -
%> zypper --xmlout
-      Usage:
-    	zypper [--global-options]  [--command-options] [arguments]
-
-      Global Options
-    ....
- -42. 禁止详细信息输出到屏幕。 - -
%> zypper --quiet in mariadb
-    The following NEW package is going to be installed:
-      mariadb
-
-    1 new package to install.
-    Overall download size: 0 B. Already cached: 7.8 MiB  After the operation, additional 71.8 MiB will be used.
-    Continue? [y/n/? shows all options] (y):
-    ...
- -43. 在卸载过程中禁止详细信息输出到屏幕 - -
%> zypper --quiet rm mariadb 
- -44. 自动地同意版权或者协议。 -
%> zypper patch --auto-agree-with-licenses
-    Loading repository data...
-    Reading installed packages...
-    Resolving package dependencies...
-
-    Nothing to do.
- -#### 清除 Zypper 缓存以及查看历史信息 #### - -45. 以下指令可以用来清理Zypper缓存。 - -
%> zypper clean
-    All repositories have been cleaned up.
- -如果需要一次性地清理元数据以及软件包缓存,可以通过 -all/-a 选项来达到目的 - -
%> zypper clean -a
-    All repositories have been cleaned up.
- -46. 查看 Zypper 的历史信息。籍由 Zypper 所有的软件包管理动作,包括安装、更新以及卸载都会在 /var/log/zypp/history中保留历史信息。可以通过 cat 来查看此文件,或者通过过滤器来筛选希望看到的信息。 - -
 cat /var/log/zypp/history
-    2015-05-07 15:43:03|install|boost-license1_54_0|1.54.0-10.1.3|noarch||openSUSE-13.2-0|0523b909d2aae5239f9841316dafaf3a37b4f096|
-    2015-05-07 15:43:03|install|branding-openSUSE|13.2-3.6.1|noarch||openSUSE-13.2-0|6609def94b1987bf3f90a9467f4f7ab8f8d98a5c|
-    2015-05-07 15:43:03|install|bundle-lang-common-en|13.2-3.3.1|noarch||openSUSE-13.2-0|ca55694e6fdebee6ce37ac7cf3725e2aa6edc342|
-    2015-05-07 15:43:03|install|insserv-compat|0.1-12.2.2|noarch||openSUSE-13.2-0|6160de7fbf961a279591a83a1550093a581214d9|
-    2015-05-07 15:43:03|install|libX11-data|1.6.2-5.1.2|noarch||openSUSE-13.2-0|f1cb58364ba9016c1f93b1a383ba12463c56885a|
-    2015-05-07 15:43:03|install|libnl-config|3.2.25-2.1.2|noarch||openSUSE-13.2-0|aab2ded312a781e93b739b418e3d32fe4e187020|
-    2015-05-07 15:43:04|install|wireless-regdb|2014.06.13-1.2|noarch||openSUSE-13.2-0|be8cb16f3e92af12b5ceb977e37e13f03c007bd1|
-    2015-05-07 15:43:04|install|yast2-trans-en_US|3.1.0-2.1|noarch||openSUSE-13.2-0|1865754e5e0ec3c149ac850b340bcca55a3c404d|
-    2015-05-07 15:43:04|install|yast2-trans-stats|2.19.0-16.1.3|noarch||openSUSE-13.2-0|b107d2b3e702835885b57b04d12d25539f262d1a|
-    2015-05-07 15:43:04|install|cracklib-dict-full|2.8.12-64.1.2|x86_64||openSUSE-13.2-0|08bd45dbba7ad44e3a4837f730be76f55ad5dcfa|
-    ......
- -#### 使用 Zypper 进行SUSE系统升级 #### - -47. 可以使用 Zypper 命令的 'dist-upgrade' 选项来将当前的SUSE Linux升级至最新版本。 -
# zypper dist-upgrade
-    You are about to do a distribution upgrade with all enabled repositories. Make sure these repositories are compatible before you continue. See 'man zypper' for more information about this command.
-    Building repository 'openSUSE-13.2-0' cache .....................................................................[done]
-    Retrieving repository 'openSUSE-13.2-Debug' metadata ............................................................[done]
-    Building repository 'openSUSE-13.2-Debug' cache .................................................................[done]
-    Retrieving repository 'openSUSE-13.2-Non-Oss' metadata ..........................................................[done]
-    Building repository 'openSUSE-13.2-Non-Oss' cache ...............................................................[done]
- -正文至此结束。希望本文可以帮助读者尤其是新手们管理SUSE Linux系统和服务器。如果您觉得某些比较重要的命令被作者漏掉了,请在评论部分写下您的返回,作者将根据评论对文章进行更新。保持联络,保持评论,多谢支持。 - --------------------------------------------------------------------------------- - -原文地址: http://www.tecmint.com/zypper-commands-to-manage-suse-linux-package-management/ - -作者:[Avishek Kumar][a] -译者:[张博约](https://github.com/zhangboyue) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.tecmint.com/author/avishek/ -[1]:http://www.tecmint.com/installation-of-suse-linux-enterprise-server-12/ From f644d213a78a924dbe1f6db91466290d7e3a4239 Mon Sep 17 00:00:00 2001 From: zhangkun Date: Sun, 24 May 2015 18:31:57 +0800 Subject: [PATCH 140/965] Finished translation of '45 zypper commands --- sources/tech/.directory | 4 + ... Manage 'Suse' Linux Package Management.md | 767 ++++++++++++++++++ 2 files changed, 771 insertions(+) create mode 100644 sources/tech/.directory create mode 100644 translated/tech/20150512 45 Zypper Commands to Manage 'Suse' Linux Package Management.md diff --git a/sources/tech/.directory b/sources/tech/.directory new file mode 100644 index 0000000000..45bdd1cb5c --- /dev/null +++ b/sources/tech/.directory @@ -0,0 +1,4 @@ +[Dolphin] +Timestamp=2015,5,23,17,31,51 +Version=3 +ViewMode=2 diff --git a/translated/tech/20150512 45 Zypper Commands to Manage 'Suse' Linux Package Management.md b/translated/tech/20150512 45 Zypper Commands to Manage 'Suse' Linux Package Management.md new file mode 100644 index 0000000000..bfd3eeeaf5 --- /dev/null +++ b/translated/tech/20150512 45 Zypper Commands to Manage 'Suse' Linux Package Management.md @@ -0,0 +1,767 @@ +45 个用于 ‘Suse‘ Linux 包管理的 Zypper 命令 +====================================================================== +SUSE( Software and System Entwicklung,即软件和系统开发。其中‘entwicklung‘是德语,意为开发)Linux是 Novell 公司在 Linux 内核基础上发布的操作系统。SUSE Linux 有两个发行分支。其中之一名为 OpenSUSE,这是一款自由而且免费的操作系统。该系统由开源社区开发维护,支持一些最新版本的应用软件,其最新的稳定版本为 13.2。 + +另外一个分支是SUSE Linux 企业版。该分支是一个为企业及商业化产品设计的 Linux 发行版,包含了大量的企业应用以及适用于商业产品生产环境的特性。其最新的稳定版本为 12。 + +以下的链接包含了安装企业版 SUSE Linux 服务器的详细信息。 + +- [如何安装企业版 SUSE Linux 12][1] + +Zypper 和 Yast 是 SUSE Linux 平台上的软件包管理工具,他们的底层使用了 RPM(译者注:RPM 最初指 Redhat Pacakge Manager ,现普遍解释为递归短语 RPM Package Manager 的缩写)。 + +Yast(Yet another Setup Tool )是 OpenSUSE 以及企业版 SUSE 上用于系统管理、设置和配置的工具。 + +Zypper 是软件包管理器ZYpp的命令行接口,可用于安装、删除SUSE Linux上的软件以及进行系统更新。ZYpp为Zypper和Yast提供底层支持。 + +本文将介绍实际应用中常见的一些Zypper命令。这些命令用来进行安装、更新、删除等任何软件包管理器所能够胜任的工作。 + +**重要** : 切记所有的这些指令都将在系统全局范围内产生影响,所以必须以 root 身份执行,否则命令将失败。 + +### 获取基本的 Zypper 帮助信息 ### + +1. 不带任何选项的执行 zypper, 将输出该命令的全局选项以及子命令列表(译者注:全局选项,global option,控制台命令的输入分为可选参数和位置参数两大类。按照习惯,一般可选参数称为选项'option',而位置参数称为参数 'argument')。 + +
%>  zypper
+        Usage:
+        zypper [--global-options]
+ +2. 获取一个具体的子命令的帮助信息,比如 'in' (install),可以执行下面的命令 + +
%> zypper help in
+ 或者 +
%> zypper help install
+    install (in) [options] {capability | rpm_file_uri}
+    
+    Install packages with specified capabilities or RPM files with specified
+    location. A capability is NAME[.ARCH][OP], where OP is one
+    of <, <=, =, >=, >.
+    
+      Command options:
+    --from     Select packages from the specified repository.
+    -r, --repo     Load only the specified repository.
+    -t, --type            Type of package (package, patch, pattern, product, srcpackage).
+                                Default: package.
+    -n, --name                  Select packages by plain name, not by capability.
+    -C, --capability            Select packages by capability.
+    -f, --force                 Install even if the item is already installed (reinstall),
+                                downgraded or changes vendor or architecture.
+        --oldpackage            Allow to replace a newer item with an older one.
+                                Handy if you are doing a rollback. Unlike --force
+    j                            it will not enforce a reinstall.
+        --replacefiles          Install the packages even if they replace files from other,
+                                already installed, packages. Default is to treat file conflicts
+                                as an error. --download-as-needed disables the fileconflict check.
+    ...... 
+ +3. 安装之前搜索一个安转包(以 gnome-desktop 为例 ) + +
# zypper se gnome-desktop
+    
+    Retrieving repository 'openSUSE-13.2-Debug' metadata ............................................................[done]
+    Building repository 'openSUSE-13.2-Debug' cache .................................................................[done]
+    Retrieving repository 'openSUSE-13.2-Non-Oss' metadata ......................................................... [done]
+    Building repository 'openSUSE-13.2-Non-Oss' cache ...............................................................[done]
+    Retrieving repository 'openSUSE-13.2-Oss' metadata ..............................................................[done]
+    Building repository 'openSUSE-13.2-Oss' cache ...................................................................[done]
+    Retrieving repository 'openSUSE-13.2-Update' metadata ...........................................................[done]
+    Building repository 'openSUSE-13.2-Update' cache ................................................................[done]
+    Retrieving repository 'openSUSE-13.2-Update-Non-Oss' metadata ...................................................[done]
+    Building repository 'openSUSE-13.2-Update-Non-Oss' cache ........................................................[done]
+    Loading repository data...
+    Reading installed packages...
+    
+    S | Name                                  | Summary                                                   | Type
+    --+---------------------------------------+-----------------------------------------------------------+-----------
+      | gnome-desktop2-lang                   | Languages for package gnome-desktop2                      | package
+      | gnome-desktop2                        | The GNOME Desktop API Library                             | package
+      | libgnome-desktop-2-17                 | The GNOME Desktop API Library                             | package
+      | libgnome-desktop-3-10                 | The GNOME Desktop API Library                             | package
+      | libgnome-desktop-3-devel              | The GNOME Desktop API Library -- Development Files        | package
+      | libgnome-desktop-3_0-common           | The GNOME Desktop API Library -- Common data files        | package
+      | gnome-desktop-debugsource             | Debug sources for package gnome-desktop                   | package
+      | gnome-desktop-sharp2-debugsource      | Debug sources for package gnome-desktop-sharp2            | package
+      | gnome-desktop2-debugsource            | Debug sources for package gnome-desktop2                  | package
+      | libgnome-desktop-2-17-debuginfo       | Debug information for package libgnome-desktop-2-17       | package
+      | libgnome-desktop-3-10-debuginfo       | Debug information for package libgnome-desktop-3-10       | package
+      | libgnome-desktop-3_0-common-debuginfo | Debug information for package libgnome-desktop-3_0-common | package
+      | libgnome-desktop-2-17-debuginfo-32bit | Debug information for package libgnome-desktop-2-17       | package
+      | libgnome-desktop-3-10-debuginfo-32bit | Debug information for package libgnome-desktop-3-10       | package
+      | gnome-desktop-sharp2                  | Mono bindings for libgnome-desktop                        | package
+      | libgnome-desktop-2-devel              | The GNOME Desktop API Library -- Development Files        | packag
+      | gnome-desktop-lang                    | Languages for package gnome-desktop                       | package
+      | libgnome-desktop-2-17-32bit           | The GNOME Desktop API Library                             | package
+      | libgnome-desktop-3-10-32bit           | The GNOME Desktop API Library                             | package
+      | gnome-desktop                         | The GNOME Desktop API Library                             | srcpackage
+ +4. 获取一个模式包的信息(以 lamp_server 为例)。 + +
%> zypper info -t pattern lamp_server
+    
+    Loading repository data...
+    Reading installed packages...
+    
+    
+    Information for pattern lamp_server:
+    ------------------------------------
+    Repository: openSUSE-13.2-Update
+    Name: lamp_server
+    Version: 20141007-5.1
+    Arch: x86_64
+    Vendor: openSUSE
+    Installed: No
+    Visible to User: Yes
+    Summary: Web and LAMP Server
+    Description: 
+      Software to set up a Web server that is able to serve static, dynamic, and interactive content (like a Web shop). This includes Apache HTTP Server, the database management system MySQL,
+      and scripting languages such as PHP, Python, Ruby on Rails, or Perl.
+    Contents:
+    
+    S | Name                          | Type    | Dependency
+    --+-------------------------------+---------+-----------
+      | apache2-mod_php5              | package |
+      | php5-iconv                    | package |
+    i | patterns-openSUSE-base        | package |
+    i | apache2-prefork               | package |
+      | php5-dom                      | package |
+      | php5-mysql                    | package |
+    i | apache2                       | package |
+      | apache2-example-pages         | package |
+      | mariadb                       | package |
+      | apache2-mod_perl              | package |
+      | php5-ctype                    | package |
+      | apache2-doc                   | package |
+      | yast2-http-server             | package |
+      | patterns-openSUSE-lamp_server | package |
+ +5. 开启一个Zypper Shell 的会话。 + +
 %>zypper shell 
+ 或者 +
 %>zypper sh 
+ +
zypper> help
+      Usage:
+    	zypper [--global-options]
+ +**注意**:在 Zypper shell里面可以通过键入 ‘help‘ 获得全局选项以及子命令的列表。 +### Zypper 软件库管理 ### + +#### 列举已定义的软件库 #### + +6. 使用 'zypper repos' 或者 'zypper lr' 来列举所有已定以的软件库。 + +
%> zypper repos
+ 或者 +
%> zypper lr
+      | Alias                     | Name                               | Enabled | Refresh
+    --+---------------------------+------------------------------------+---------+--------
+    1 | openSUSE-13.2-0           | openSUSE-13.2-0                    | Yes     | No
+    2 | repo-debug                | openSUSE-13.2-Debug                | Yes     | Yes
+    3 | repo-debug-update         | openSUSE-13.2-Update-Debug         | No      | Yes
+    4 | repo-debug-update-non-oss | openSUSE-13.2-Update-Debug-Non-Oss | No      | Yes
+    5 | repo-non-oss              | openSUSE-13.2-Non-Oss              | Yes     | Yes
+    6 | repo-oss                  | openSUSE-13.2-Oss                  | Yes     | Yes
+    7 | repo-source               | openSUSE-13.2-Source               | No      | Yes
+    8 | repo-update               | openSUSE-13.2-Update               | Yes     | Yes
+    9 | repo-update-non-oss       | openSUSE-13.2-Update-Non-Oss       | Yes     | Yes
+ +7. 在表格里面显示 zypper URI + +
# zypper lr -u
+      | Alias                     | Name                               | Enabled | Refresh | URI
+    --+---------------------------+------------------------------------+---------+---------+----------------------------------------------------------------
+    1 | openSUSE-13.2-0           | openSUSE-13.2-0                    | Yes     | No      | cd:///?devices=/dev/disk/by-id/ata-VBOX_CD-ROM_VB2-01700376
+    2 | repo-debug                | openSUSE-13.2-Debug                | Yes     | Yes     | http://download.opensuse.org/debug/distribution/13.2/repo/oss/
+    3 | repo-debug-update         | openSUSE-13.2-Update-Debug         | No      | Yes     | http://download.opensuse.org/debug/update/13.2/
+    4 | repo-debug-update-non-oss | openSUSE-13.2-Update-Debug-Non-Oss | No      | Yes     | http://download.opensuse.org/debug/update/13.2-non-oss/
+    5 | repo-non-oss              | openSUSE-13.2-Non-Oss              | Yes     | Yes     | http://download.opensuse.org/distribution/13.2/repo/non-oss/
+    6 | repo-oss                  | openSUSE-13.2-Oss                  | Yes     | Yes     | http://download.opensuse.org/distribution/13.2/repo/oss/
+    7 | repo-source               | openSUSE-13.2-Source               | No      | Yes     | http://download.opensuse.org/source/distribution/13.2/repo/oss/
+    8 | repo-update               | openSUSE-13.2-Update               | Yes     | Yes     | http://download.opensuse.org/update/13.2/
+    9 | repo-update-non-oss       | openSUSE-13.2-Update-Non-Oss       | Yes     | Yes     | http://download.opensuse.org/update/13.2-non-oss/
+ +8. 根据优先级列举软件库。 + +
%> zypper lr -P
+      | Alias                     | Name                               | Enabled | Refresh | Priority
+    --+---------------------------+------------------------------------+---------+---------+---------
+    1 | openSUSE-13.2-0           | openSUSE-13.2-0                    | Yes     | No      |   99
+    2 | repo-debug                | openSUSE-13.2-Debug                | Yes     | Yes     |   99
+    3 | repo-debug-update         | openSUSE-13.2-Update-Debug         | No      | Yes     |   99
+    4 | repo-debug-update-non-oss | openSUSE-13.2-Update-Debug-Non-Oss | No      | Yes     |   99
+    5 | repo-non-oss              | openSUSE-13.2-Non-Oss              | Yes     | Yes     |   85
+    6 | repo-oss                  | openSUSE-13.2-Oss                  | Yes     | Yes     |   99
+    7 | repo-source               | openSUSE-13.2-Source               | No      | Yes     |   99
+    8 | repo-update               | openSUSE-13.2-Update               | Yes     | Yes     |   99
+    9 | repo-update-non-oss       | openSUSE-13.2-Update-Non-Oss       | Yes     | Yes     |   99
+ +#### 刷新软件库 #### + +9. 使用 'zypper refresh' or 'zypper ref' 来刷新 zypper 软件库。 + +
%> zypper refresh 
+ 或者 +
%> zypper ref
+    Repository 'openSUSE-13.2-0' is up to date.
+    Repository 'openSUSE-13.2-Debug' is up to date.
+    Repository 'openSUSE-13.2-Non-Oss' is up to date.
+    Repository 'openSUSE-13.2-Oss' is up to date.
+    Repository 'openSUSE-13.2-Update' is up to date.
+    Repository 'openSUSE-13.2-Update-Non-Oss' is up to date.
+    All repositories have been refreshed. 
+ +10. 刷新一个指定的软件库(以 'repo-non-oss' 为例 )。 + +
%> zypper refresh repo-non-oss
+    Repository 'openSUSE-13.2-Non-Oss' is up to date.
+    Specified repositories have been refreshed. 
+ +11. 强制更新一个软件库(以 'repo-non-oss' 为例 )。 + +
%> zypper ref -f repo-non-oss 
+    Forcing raw metadata refresh
+    Retrieving repository 'openSUSE-13.2-Non-Oss' metadata ............................................................[done]
+    Forcing building of repository cache
+    Building repository 'openSUSE-13.2-Non-Oss' cache ............................................................[done]
+    Specified repositories have been refreshed.
+ +#### 修改软件库 #### + +本文中我们使用‘zypper modifyrepo‘ 或者 ‘zypper mr‘ 来关闭或者开启 zypper 软件库。 + +12. 在关闭一个软件库之前,我们需要知道在 zypper中,每一个软件库有一个唯一的标示数字与之关联,该数字用于打开或者关闭与之相联系的软件库。假设我们需要关闭 'repo-oss' 软件库,那么我们可以通过以下的法来获得该软件库的标志数字。 + +
%> zypper lr
+      | Alias                     | Name                               | Enabled | Refresh
+    --+---------------------------+------------------------------------+---------+--------
+    1 | openSUSE-13.2-0           | openSUSE-13.2-0                    | Yes     | No
+    2 | repo-debug                | openSUSE-13.2-Debug                | Yes     | Yes
+    3 | repo-debug-update         | openSUSE-13.2-Update-Debug         | No      | Yes
+    4 | repo-debug-update-non-oss | openSUSE-13.2-Update-Debug-Non-Oss | No      | Yes
+    5 | repo-non-oss              | openSUSE-13.2-Non-Oss              | Yes     | Yes
+    6 | repo-oss                  | openSUSE-13.2-Oss                  | No      | Yes
+    7 | repo-source               | openSUSE-13.2-Source               | No      | Yes
+    8 | repo-update               | openSUSE-13.2-Update               | Yes     | Yes
+    9 | repo-update-non-oss       | openSUSE-13.2-Update-Non-Oss       | Yes     | Yes
+从以上输出的列表中我们可以看到 'repo-oss' 库的标示数字是 6,因此通过以下的命令来关闭该库。 + +
%> zypper mr -d 6
+    Repository 'repo-oss' has been successfully disabled.
+ +13. 如果需要再次开启软件库 ‘repo-oss‘, 接上例,与之相关联的标示数字为 6。 + +
%> zypper mr -e 6
+    Repository 'repo-oss' has been successfully enabled.
+ +14. 针对某一个软件库(以 'repo-non-oss' 为例 )开启自动刷新( auto-refresh )和 rpm 缓存,并设置该软件库的优先级,比如85。 + +
%> zypper mr -rk -p 85 repo-non-oss
+    Repository 'repo-non-oss' priority has been left unchanged (85)
+    Nothing to change for repository 'repo-non-oss'.
+ +15. 对所有的软件库关闭 rpm 文件缓存。 + +
%> zypper mr -Ka
+    RPM files caching has been disabled for repository 'openSUSE-13.2-0'.
+    RPM files caching has been disabled for repository 'repo-debug'.
+    RPM files caching has been disabled for repository 'repo-debug-update'.
+    RPM files caching has been disabled for repository 'repo-debug-update-non-oss'.
+    RPM files caching has been disabled for repository 'repo-non-oss'.
+    RPM files caching has been disabled for repository 'repo-oss'.
+    RPM files caching has been disabled for repository 'repo-source'.
+    RPM files caching has been disabled for repository 'repo-update'.
+    RPM files caching has been disabled for repository 'repo-update-non-oss'.
+ +16. 对所有的软件库开启 rpm 文件缓存。 +
 zypper mr -ka
+    RPM files caching has been enabled for repository 'openSUSE-13.2-0'.
+    RPM files caching has been enabled for repository 'repo-debug'.
+    RPM files caching has been enabled for repository 'repo-debug-update'.
+    RPM files caching has been enabled for repository 'repo-debug-update-non-oss'.
+    RPM files caching has been enabled for repository 'repo-non-oss'.
+    RPM files caching has been enabled for repository 'repo-oss'.
+    RPM files caching has been enabled for repository 'repo-source'.
+    RPM files caching has been enabled for repository 'repo-update'.
+    RPM files caching has been enabled for repository 'repo-update-non-oss'.
+ +17. 关闭远程库的rpm 文件缓存 +
%> zypper mr -Kt
+    RPM files caching has been disabled for repository 'repo-debug'.
+    RPM files caching has been disabled for repository 'repo-debug-update'.
+    RPM files caching has been disabled for repository 'repo-debug-update-non-oss'.
+    RPM files caching has been disabled for repository 'repo-non-oss'.
+    RPM files caching has been disabled for repository 'repo-oss'.
+    RPM files caching has been disabled for repository 'repo-source'.
+    RPM files caching has been disabled for repository 'repo-update'.
+    RPM files caching has been disabled for repository 'repo-update-non-oss'.
+ +18. 开启远程软件库的 rpm 文件缓存。 +
%> zypper mr -kt
+    RPM files caching has been enabled for repository 'repo-debug'.
+    RPM files caching has been enabled for repository 'repo-debug-update'.
+    RPM files caching has been enabled for repository 'repo-debug-update-non-oss'.
+    RPM files caching has been enabled for repository 'repo-non-oss'.
+    RPM files caching has been enabled for repository 'repo-oss'.
+    RPM files caching has been enabled for repository 'repo-source'.
+    RPM files caching has been enabled for repository 'repo-update'.
+    RPM files caching has been enabled for repository 'repo-update-non-oss'.
+ +#### 增加新的软件库 #### + +可以通过这两个 zypper 指令 – 'zypper addrepo' 和 'zypper ar' 来增加新的软件库。在此过程中可以使用 URL 或者软件库的别名。 + +19. 增加一个新的软件库( 以 “http://download.opensuse.org/update/12.3/” 为例 )。 + +
%>  zypper ar http://download.opensuse.org/update/11.1/ update
+    Adding repository 'update' .............................................................................................................................................................[done]
+    Repository 'update' successfully added
+    Enabled     : Yes
+    Autorefresh : No
+    GPG check   : Yes
+    URI         : http://download.opensuse.org/update/11.1/
+ +20. 更改一个软件库的名字,这将仅仅改变软件库的别名。 命令 'zypper namerepo' 或者 'zypperr nr' 可以胜任此工作。例如更改标示数字为10的软件库的名字为 'upd8',或者说将标示数字为10的软件库的别名改为 'upd8',可以使用下面的命令。 + +
%> zypper nr 10 upd8
+    Repository 'update' renamed to 'upd8'.
+ +#### 删除软件库 #### + +21. 删除一个软件库。要从系统删除一个软件库可以使 'zypper removerepo' 或者 'zypper rr'。例如以下的命令可以删除软件库 'upd8' + +
%> zypper rr upd8
+    # Removing repository 'upd8' .........................................................................................[done]
+    Repository 'upd8' has been removed.
+ +### 使用 zypper 进行软件包管理 ### + +#### 用 zypper 安装一个软件包 #### + +22. 在 zypper 中,我们可以通过软件包的功能名称来安装一个软件包。以 Firefox 为例,以下的命令可以用来安装该软件包。 +
%> zypper in MozillaFirefox
+    Loading repository data...
+    Reading installed packages...
+    Resolving package dependencies...
+
+    The following 128 NEW packages are going to be installed:
+      adwaita-icon-theme at-spi2-atk-common at-spi2-atk-gtk2 at-spi2-core cantarell-fonts cups-libs desktop-file-utils fontconfig gdk-pixbuf-query-loaders gstreamer gstreamer-fluendo-mp3
+      gstreamer-plugins-base gtk2-branding-openSUSE gtk2-data gtk2-immodule-amharic gtk2-immodule-inuktitut gtk2-immodule-thai gtk2-immodule-vietnamese gtk2-metatheme-adwaita
+      gtk2-theming-engine-adwaita gtk2-tools gtk3-data gtk3-metatheme-adwaita gtk3-tools hicolor-icon-theme hicolor-icon-theme-branding-openSUSE libasound2 libatk-1_0-0 libatk-bridge-2_0-0
+      libatspi0 libcairo2 libcairo-gobject2 libcanberra0 libcanberra-gtk0 libcanberra-gtk2-module libcanberra-gtk3-0 libcanberra-gtk3-module libcanberra-gtk-module-common libcdda_interface0
+      libcdda_paranoia0 libcolord2 libdrm2 libdrm_intel1 libdrm_nouveau2 libdrm_radeon1 libFLAC8 libfreebl3 libgbm1 libgdk_pixbuf-2_0-0 libgraphite2-3 libgstapp-1_0-0 libgstaudio-1_0-0
+      libgstpbutils-1_0-0 libgstreamer-1_0-0 libgstriff-1_0-0 libgsttag-1_0-0 libgstvideo-1_0-0 libgthread-2_0-0 libgtk-2_0-0 libgtk-3-0 libharfbuzz0 libjasper1 libjbig2 libjpeg8 libjson-c2
+      liblcms2-2 libLLVM libltdl7 libnsssharedhelper0 libogg0 liborc-0_4-0 libpackagekit-glib2-18 libpango-1_0-0 libpciaccess0 libpixman-1-0 libpulse0 libsndfile1 libsoftokn3 libspeex1
+      libsqlite3-0 libstartup-notification-1-0 libtheoradec1 libtheoraenc1 libtiff5 libvisual libvorbis0 libvorbisenc2 libvorbisfile3 libwayland-client0 libwayland-cursor0 libwayland-server0
+      libX11-xcb1 libxcb-dri2-0 libxcb-dri3-0 libxcb-glx0 libxcb-present0 libxcb-render0 libxcb-shm0 libxcb-sync1 libxcb-util1 libxcb-xfixes0 libXcomposite1 libXcursor1 libXdamage1 libXevie1
+      libXfixes3 libXft2 libXi6 libXinerama1 libxkbcommon-0_4_3 libXrandr2 libXrender1 libxshmfence1 libXtst6 libXv1 libXxf86vm1 Mesa Mesa-libEGL1 Mesa-libGL1 Mesa-libglapi0
+      metatheme-adwaita-common MozillaFirefox MozillaFirefox-branding-openSUSE mozilla-nss mozilla-nss-certs PackageKit-gstreamer-plugin pango-tools sound-theme-freedesktop
+
+    The following 10 recommended packages were automatically selected:
+      gstreamer-fluendo-mp3 gtk2-branding-openSUSE gtk2-data gtk2-immodule-amharic gtk2-immodule-inuktitut gtk2-immodule-thai gtk2-immodule-vietnamese libcanberra0 libpulse0
+      PackageKit-gstreamer-plugin
+    
+    128 new packages to install.
+    Overall download size: 77.2 MiB. Already cached: 0 B  After the operation, additional 200.0 MiB will be used.
+    Continue? [y/n/? shows all options] (y): y
+    Retrieving package cantarell-fonts-0.0.16-1.1.noarch                                                                                                   (1/128),  74.1 KiB (115.6 KiB unpacked)
+    Retrieving: cantarell-fonts-0.0.16-1.1.noarch.rpm .........................................................................................................................[done (63.4 KiB/s)]
+    Retrieving package hicolor-icon-theme-0.13-2.1.2.noarch                                                                                                (2/128),  40.1 KiB ( 50.5 KiB unpacked)
+    Retrieving: hicolor-icon-theme-0.13-2.1.2.noarch.rpm ...................................................................................................................................[done]
+    Retrieving package sound-theme-freedesktop-0.8-7.1.2.noarch                                                                                            (3/128), 372.6 KiB (460.3 KiB unpacked) 
+ +23. 安装指定版本号的软件包,(以 gcc 5.1 为例)。 +
 %>zypper in 'gcc<5.1'
+    Loading repository data...
+    Reading installed packages...
+    Resolving package dependencies...
+
+    The following 13 NEW packages are going to be installed:
+      cpp cpp48 gcc gcc48 libasan0 libatomic1-gcc49 libcloog-isl4 libgomp1-gcc49 libisl10 libitm1-gcc49 libmpc3 libmpfr4 libtsan0-gcc49
+
+    13 new packages to install.
+    Overall download size: 14.5 MiB. Already cached: 0 B  After the operation, additional 49.4 MiB will be used.
+    Continue? [y/n/? shows all options] (y): y 
+ +24. 为特定的CPU架构安装软件包(以兼容 i586 的 gcc 为例)。 + +
%> zypper in gcc.i586
+    Loading repository data...
+    Reading installed packages...
+    Resolving package dependencies...
+
+    The following 13 NEW packages are going to be installed:
+      cpp cpp48 gcc gcc48 libasan0 libatomic1-gcc49 libcloog-isl4 libgomp1-gcc49 libisl10 libitm1-gcc49 libmpc3 libmpfr4 libtsan0-gcc49
+
+    13 new packages to install.
+    Overall download size: 14.5 MiB. Already cached: 0 B  After the operation, additional 49.4 MiB will be used.
+    Continue? [y/n/? shows all options] (y): y
+    Retrieving package libasan0-4.8.3+r212056-2.2.4.x86_64                                                                                                  (1/13),  74.2 KiB (166.9 KiB unpacked)
+    Retrieving: libasan0-4.8.3+r212056-2.2.4.x86_64.rpm .......................................................................................................................[done (79.2 KiB/s)]
+    Retrieving package libatomic1-gcc49-4.9.0+r211729-2.1.7.x86_64                                                                                          (2/13),  14.3 KiB ( 26.1 KiB unpacked)
+    Retrieving: libatomic1-gcc49-4.9.0+r211729-2.1.7.x86_64.rpm ...............................................................................................................[done (55.3 KiB/s)] 
+ +25. 为特定的CPU架构安装指定版本号的软件包(以兼容 i586 且版本低于5.1的 gcc 为例) + +
%> zypper in 'gcc.i586<5.1'
+    Loading repository data...
+    Reading installed packages...
+    Resolving package dependencies...
+
+    The following 13 NEW packages are going to be installed:
+      cpp cpp48 gcc gcc48 libasan0 libatomic1-gcc49 libcloog-isl4 libgomp1-gcc49 libisl10 libitm1-gcc49 libmpc3 libmpfr4 libtsan0-gcc49
+
+    13 new packages to install.
+    Overall download size: 14.4 MiB. Already cached: 129.5 KiB  After the operation, additional 49.4 MiB will be used.
+    Continue? [y/n/? shows all options] (y): y
+    In cache libasan0-4.8.3+r212056-2.2.4.x86_64.rpm                                                                                                        (1/13),  74.2 KiB (166.9 KiB unpacked)
+    In cache libatomic1-gcc49-4.9.0+r211729-2.1.7.x86_64.rpm                                           (2/13),  14.3 KiB ( 26.1 KiB unpacked)
+    In cache libgomp1-gcc49-4.9.0+r211729-2.1.7.x86_64.rpm                                             (3/13),  41.1 KiB ( 90.7 KiB unpacked) 
+ +26. 从指定的软件库里面安装一个软件包,例如从 amarok 中安装 libxine。 +
%> zypper in amarok upd:libxine1
+    Loading repository data...
+    Reading installed packages...
+    Resolving package dependencies...
+    The following 202 NEW packages are going to be installed:
+      amarok bundle-lang-kde-en clamz cups-libs enscript fontconfig gdk-pixbuf-query-loaders ghostscript-fonts-std gptfdisk gstreamer gstreamer-plugins-base hicolor-icon-theme
+      hicolor-icon-theme-branding-openSUSE htdig hunspell hunspell-tools icoutils ispell ispell-american kde4-filesystem kdebase4-runtime kdebase4-runtime-branding-openSUSE kdelibs4
+      kdelibs4-branding-openSUSE kdelibs4-core kdialog libakonadi4 l
+    .....
+ +27. 通过指定软件包的名字安装软件包。 + +
%> zypper in -n git
+    Loading repository data...
+    Reading installed packages...
+    Resolving package dependencies...
+
+    The following 35 NEW packages are going to be installed:
+      cvs cvsps fontconfig git git-core git-cvs git-email git-gui gitk git-svn git-web libserf-1-1 libsqlite3-0 libXft2 libXrender1 libXss1 perl-Authen-SASL perl-Clone perl-DBD-SQLite perl-DBI
+      perl-Error perl-IO-Socket-SSL perl-MLDBM perl-Net-Daemon perl-Net-SMTP-SSL perl-Net-SSLeay perl-Params-Util perl-PlRPC perl-SQL-Statement perl-Term-ReadKey subversion subversion-perl tcl
+      tk xhost
+
+    The following 13 recommended packages were automatically selected:
+      git-cvs git-email git-gui gitk git-svn git-web perl-Authen-SASL perl-Clone perl-MLDBM perl-Net-Daemon perl-Net-SMTP-SSL perl-PlRPC perl-SQL-Statement
+
+    The following package is suggested, but will not be installed:
+      git-daemon
+
+    35 new packages to install.
+    Overall download size: 15.6 MiB. Already cached: 0 B  After the operation, additional 56.7 MiB will be used.
+    Continue? [y/n/? shows all options] (y): y 
+ +28. 通过通配符来安装软件包,例如,安装所有 php5 的软件包。 +
%> zypper in php5*
+    Loading repository data...
+    Reading installed packages...
+    Resolving package dependencies...
+
+    Problem: php5-5.6.1-18.1.x86_64 requires smtp_daemon, but this requirement cannot be provided
+      uninstallable providers: exim-4.83-3.1.8.x86_64[openSUSE-13.2-0]
+                       postfix-2.11.0-5.2.2.x86_64[openSUSE-13.2-0]
+                       sendmail-8.14.9-2.2.2.x86_64[openSUSE-13.2-0]
+                       exim-4.83-3.1.8.i586[repo-oss]
+                       msmtp-mta-1.4.32-2.1.3.i586[repo-oss]
+                       postfix-2.11.0-5.2.2.i586[repo-oss]
+                       sendmail-8.14.9-2.2.2.i586[repo-oss]
+                       exim-4.83-3.1.8.x86_64[repo-oss]
+                       msmtp-mta-1.4.32-2.1.3.x86_64[repo-oss]
+                       postfix-2.11.0-5.2.2.x86_64[repo-oss]
+                       sendmail-8.14.9-2.2.2.x86_64[repo-oss]
+                       postfix-2.11.3-5.5.1.i586[repo-update]
+                       postfix-2.11.3-5.5.1.x86_64[repo-update]
+     Solution 1: Following actions will be done:
+      do not install php5-5.6.1-18.1.x86_64
+      do not install php5-pear-Auth_SASL-1.0.6-7.1.3.noarch
+      do not install php5-pear-Horde_Http-2.0.1-6.1.3.noarch
+      do not install php5-pear-Horde_Image-2.0.1-6.1.3.noarch
+      do not install php5-pear-Horde_Kolab_Format-2.0.1-6.1.3.noarch
+      do not install php5-pear-Horde_Ldap-2.0.1-6.1.3.noarch
+      do not install php5-pear-Horde_Memcache-2.0.1-7.1.3.noarch
+      do not install php5-pear-Horde_Mime-2.0.2-6.1.3.noarch
+      do not install php5-pear-Horde_Oauth-2.0.0-6.1.3.noarch
+      do not install php5-pear-Horde_Pdf-2.0.1-6.1.3.noarch
+    ....
+ +29. 使用模式名称(模式名称是一类软件包的名字)来批量安装软件包 + +
%> zypper in -t pattern lamp_server
+    ading repository data...
+    Reading installed packages...
+    Resolving package dependencies...
+
+    The following 29 NEW packages are going to be installed:
+      apache2 apache2-doc apache2-example-pages apache2-mod_perl apache2-prefork patterns-openSUSE-lamp_server perl-Data-Dump perl-Encode-Locale perl-File-Listing perl-HTML-Parser
+      perl-HTML-Tagset perl-HTTP-Cookies perl-HTTP-Daemon perl-HTTP-Date perl-HTTP-Message perl-HTTP-Negotiate perl-IO-HTML perl-IO-Socket-SSL perl-libwww-perl perl-Linux-Pid
+      perl-LWP-MediaTypes perl-LWP-Protocol-https perl-Net-HTTP perl-Net-SSLeay perl-Tie-IxHash perl-TimeDate perl-URI perl-WWW-RobotRules yast2-http-server
+
+    The following NEW pattern is going to be installed:
+      lamp_server
+
+    The following 10 recommended packages were automatically selected:
+      apache2 apache2-doc apache2-example-pages apache2-mod_perl apache2-prefork perl-Data-Dump perl-IO-Socket-SSL perl-LWP-Protocol-https perl-TimeDate yast2-http-server
+
+    29 new packages to install.
+    Overall download size: 7.2 MiB. Already cached: 1.2 MiB  After the operation, additional 34.7 MiB will be used.
+    Continue? [y/n/? shows all options] (y): 
+ +30. 使用一行命令安转一个软件包同时卸载另一个软件包,例如在安装 nano 的同时卸载 vi + +
# zypper in nano -vi
+    Loading repository data...
+    Reading installed packages...
+    '-vi' not found in package names. Trying capabilities.
+    Resolving package dependencies...
+
+    The following 2 NEW packages are going to be installed:
+      nano nano-lang
+
+    The following package is going to be REMOVED:
+      vim
+
+    The following recommended package was automatically selected:
+      nano-lang
+
+    2 new packages to install, 1 to remove.
+    Overall download size: 550.0 KiB. Already cached: 0 B  After the operation, 463.3 KiB will be freed.
+    Continue? [y/n/? shows all options] (y):
+    ...
+ +31. 使用 zypper 安装 rpm 软件包。 + +
%> zypper in teamviewer*.rpm
+    Loading repository data...
+    Reading installed packages...
+    Resolving package dependencies...
+
+    The following 24 NEW packages are going to be installed:
+      alsa-oss-32bit fontconfig-32bit libasound2-32bit libexpat1-32bit libfreetype6-32bit libgcc_s1-gcc49-32bit libICE6-32bit libjpeg62-32bit libpng12-0-32bit libpng16-16-32bit libSM6-32bit
+      libuuid1-32bit libX11-6-32bit libXau6-32bit libxcb1-32bit libXdamage1-32bit libXext6-32bit libXfixes3-32bit libXinerama1-32bit libXrandr2-32bit libXrender1-32bit libXtst6-32bit
+      libz1-32bit teamviewer
+
+    The following recommended package was automatically selected:
+      alsa-oss-32bit
+
+    24 new packages to install.
+    Overall download size: 41.2 MiB. Already cached: 0 B  After the operation, additional 119.7 MiB will be used.
+    Continue? [y/n/? shows all options] (y):
+    ..
+ +#### 使用 zypper 卸载软件包 #### + +32. 命令 ‘zypper remove‘ 和 ‘zypper rm‘ 用于卸载软件包。例如卸载 apache2: + +
%> zypper remove apache2 
+ 或者 +
%> zypper rm apache2
+    Loading repository data...
+    Reading installed packages...
+    Resolving package dependencies...
+
+    The following 2 packages are going to be REMOVED:
+      apache2 apache2-prefork
+
+    2 packages to remove.
+    After the operation, 4.2 MiB will be freed.
+    Continue? [y/n/? shows all options] (y): y
+    (1/2) Removing apache2-2.4.10-19.1 ........................................................................[done]
+    (2/2) Removing apache2-prefork-2.4.10-19.1 ................................................................[done] 
+ +#### 使用Zypper 进行软件包更新 #### + +33. 更新所有的软件包,可以使用 ‘zypper update‘ 或者 ‘zypper up‘。 + +
%> zypper up 
+ 或者 +
%> zypper update
+
+    Loading repository data...
+    Reading installed packages...
+    Nothing to do. 
+ +34. 更新指定的软件包,例如更新 apache2 以及 openssh。 + +
 zypper up apache2 openssh
+    Loading repository data...
+    Reading installed packages...
+    No update candidate for 'apache2-2.4.10-19.1.x86_64'. The highest available version is already installed.
+    No update candidate for 'openssh-6.6p1-5.1.3.x86_64'. The highest available version is already installed.
+    Resolving package dependencies...
+
+    Nothing to do.
+ +35. 安装一个软件库,例如 ariadb,如果该库存在则更新之。 + +
%> zypper in mariadb
+    Loading repository data...
+    Reading installed packages...
+    'mariadb' is already installed.
+    No update candidate for 'mariadb-10.0.13-2.6.1.x86_64'. The highest available version is already installed.
+    Resolving package dependencies...
+
+    Nothing to do.
+ +#### 安装源文件并且构建依赖关系 #### + +命令 ‘zypper source-install‘ 或者 ‘zypper si‘ 可以用于从源文件编译软件包 + +36. 安装某一个软件包的源文件及其依赖关系,例如 mariadb。 + +
%> zypper si mariadb
+    Reading installed packages...
+    Loading repository data...
+    Resolving package dependencies...
+
+    The following 36 NEW packages are going to be installed:
+      autoconf automake bison cmake cpp cpp48 gcc gcc48 gcc48-c++ gcc-c++ libaio-devel libarchive13 libasan0 libatomic1-gcc49 libcloog-isl4 libedit-devel libevent-devel libgomp1-gcc49 libisl10
+      libitm1-gcc49 libltdl7 libmpc3 libmpfr4 libopenssl-devel libstdc++48-devel libtool libtsan0-gcc49 m4 make ncurses-devel pam-devel readline-devel site-config tack tcpd-devel zlib-devel
+
+    The following source package is going to be installed:
+      mariadb
+
+    36 new packages to install, 1 source package.
+    Overall download size: 71.5 MiB. Already cached: 129.5 KiB  After the operation, additional 183.9 MiB will be used.
+    Continue? [y/n/? shows all options] (y): y 
+ +37. 仅为某一个软件包安装源文件,例如 mariadb + +
%> zypper in -D mariadb
+    Loading repository data...
+    Reading installed packages...
+    'mariadb' is already installed.
+    No update candidate for 'mariadb-10.0.13-2.6.1.x86_64'. The highest available version is already installed.
+    Resolving package dependencies...
+
+    Nothing to do. 
+ +38. 仅为某一个软件包安装依赖关系,例如 mariadb + +
%> zypper si -d mariadb
+    Reading installed packages...
+    Loading repository data...
+    Resolving package dependencies...
+
+    The following 36 NEW packages are going to be installed:
+      autoconf automake bison cmake cpp cpp48 gcc gcc48 gcc48-c++ gcc-c++ libaio-devel libarchive13 libasan0 libatomic1-gcc49 libcloog-isl4 libedit-devel libevent-devel libgomp1-gcc49 libisl10
+      libitm1-gcc49 libltdl7 libmpc3 libmpfr4 libopenssl-devel libstdc++48-devel libtool libtsan0-gcc49 m4 make ncurses-devel pam-devel readline-devel site-config tack tcpd-devel zlib-devel
+
+    The following package is recommended, but will not be installed due to conflicts or dependency issues:
+      readline-doc
+
+    36 new packages to install.
+    Overall download size: 33.7 MiB. Already cached: 129.5 KiB  After the operation, additional 144.3 MiB will be used.
+    Continue? [y/n/? shows all options] (y): y
+ +#### Zypper in Scripts and Applications #### + +39. 安装一个软件包,并且在安装过程中跳过与用户的交互, 例如 mariadb。 + +
%> zypper --non-interactive in mariadb
+    Loading repository data...
+    Reading installed packages...
+    'mariadb' is already installed.
+    No update candidate for 'mariadb-10.0.13-2.6.1.x86_64'. The highest available version is already installed.
+    Resolving package dependencies...
+
+    Nothing to do.
+ +40. 卸载一个软件包,并且在卸载过程中跳过与用户的交互,例如 mariadb + +
%> zypper --non-interactive rm mariadb
+    Loading repository data...
+    Reading installed packages...
+    Resolving package dependencies...
+
+    The following package is going to be REMOVED:
+      mariadb
+
+    1 package to remove.
+    After the operation, 71.8 MiB will be freed.
+    Continue? [y/n/? shows all options] (y): y
+    (1/1) Removing mariadb-10.0.13-2.6.1 .............................................................................[done] 
+ +41. 将 zypper 输出用 XML 格式打印。 + +
%> zypper --xmlout
+      Usage:
+    	zypper [--global-options]  [--command-options] [arguments]
+
+      Global Options
+    ....
+ +42. 禁止详细信息输出到屏幕。 + +
%> zypper --quiet in mariadb
+    The following NEW package is going to be installed:
+      mariadb
+
+    1 new package to install.
+    Overall download size: 0 B. Already cached: 7.8 MiB  After the operation, additional 71.8 MiB will be used.
+    Continue? [y/n/? shows all options] (y):
+    ...
+ +43. 在卸载过程中禁止详细信息输出到屏幕 + +
%> zypper --quiet rm mariadb 
+ +44. 自动地同意版权或者协议。 +
%> zypper patch --auto-agree-with-licenses
+    Loading repository data...
+    Reading installed packages...
+    Resolving package dependencies...
+
+    Nothing to do.
+ +#### 清除 Zypper 缓存以及查看历史信息 #### + +45. 以下指令可以用来清理Zypper缓存。 + +
%> zypper clean
+    All repositories have been cleaned up.
+ +如果需要一次性地清理元数据以及软件包缓存,可以通过 -all/-a 选项来达到目的 + +
%> zypper clean -a
+    All repositories have been cleaned up.
+ +46. 查看 Zypper 的历史信息。籍由 Zypper 所有的软件包管理动作,包括安装、更新以及卸载都会在 /var/log/zypp/history中保留历史信息。可以通过 cat 来查看此文件,或者通过过滤器来筛选希望看到的信息。 + +
 cat /var/log/zypp/history
+    2015-05-07 15:43:03|install|boost-license1_54_0|1.54.0-10.1.3|noarch||openSUSE-13.2-0|0523b909d2aae5239f9841316dafaf3a37b4f096|
+    2015-05-07 15:43:03|install|branding-openSUSE|13.2-3.6.1|noarch||openSUSE-13.2-0|6609def94b1987bf3f90a9467f4f7ab8f8d98a5c|
+    2015-05-07 15:43:03|install|bundle-lang-common-en|13.2-3.3.1|noarch||openSUSE-13.2-0|ca55694e6fdebee6ce37ac7cf3725e2aa6edc342|
+    2015-05-07 15:43:03|install|insserv-compat|0.1-12.2.2|noarch||openSUSE-13.2-0|6160de7fbf961a279591a83a1550093a581214d9|
+    2015-05-07 15:43:03|install|libX11-data|1.6.2-5.1.2|noarch||openSUSE-13.2-0|f1cb58364ba9016c1f93b1a383ba12463c56885a|
+    2015-05-07 15:43:03|install|libnl-config|3.2.25-2.1.2|noarch||openSUSE-13.2-0|aab2ded312a781e93b739b418e3d32fe4e187020|
+    2015-05-07 15:43:04|install|wireless-regdb|2014.06.13-1.2|noarch||openSUSE-13.2-0|be8cb16f3e92af12b5ceb977e37e13f03c007bd1|
+    2015-05-07 15:43:04|install|yast2-trans-en_US|3.1.0-2.1|noarch||openSUSE-13.2-0|1865754e5e0ec3c149ac850b340bcca55a3c404d|
+    2015-05-07 15:43:04|install|yast2-trans-stats|2.19.0-16.1.3|noarch||openSUSE-13.2-0|b107d2b3e702835885b57b04d12d25539f262d1a|
+    2015-05-07 15:43:04|install|cracklib-dict-full|2.8.12-64.1.2|x86_64||openSUSE-13.2-0|08bd45dbba7ad44e3a4837f730be76f55ad5dcfa|
+    ......
+ +#### 使用 Zypper 进行SUSE系统升级 #### + +47. 可以使用 Zypper 命令的 'dist-upgrade' 选项来将当前的SUSE Linux升级至最新版本。 +
# zypper dist-upgrade
+    You are about to do a distribution upgrade with all enabled repositories. Make sure these repositories are compatible before you continue. See 'man zypper' for more information about this command.
+    Building repository 'openSUSE-13.2-0' cache .....................................................................[done]
+    Retrieving repository 'openSUSE-13.2-Debug' metadata ............................................................[done]
+    Building repository 'openSUSE-13.2-Debug' cache .................................................................[done]
+    Retrieving repository 'openSUSE-13.2-Non-Oss' metadata ..........................................................[done]
+    Building repository 'openSUSE-13.2-Non-Oss' cache ...............................................................[done]
+ +正文至此结束。希望本文可以帮助读者尤其是新手们管理SUSE Linux系统和服务器。如果您觉得某些比较重要的命令被作者漏掉了,请在评论部分写下您的返回,作者将根据评论对文章进行更新。保持联络,保持评论,多谢支持。 + +-------------------------------------------------------------------------------- + +原文地址: http://www.tecmint.com/zypper-commands-to-manage-suse-linux-package-management/ + +作者:[Avishek Kumar][a] +译者:[张博约](https://github.com/zhangboyue) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/avishek/ +[1]:http://www.tecmint.com/installation-of-suse-linux-enterprise-server-12/ From ec3073217d164aa6ffdff5dfcceebe69eefcc890 Mon Sep 17 00:00:00 2001 From: zhang kun Date: Sun, 24 May 2015 18:29:07 +0800 Subject: [PATCH 141/965] Fixed a typo --- ...Zypper Commands to Manage 'Suse' Linux Package Management.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/translated/tech/20150512 45 Zypper Commands to Manage 'Suse' Linux Package Management.md b/translated/tech/20150512 45 Zypper Commands to Manage 'Suse' Linux Package Management.md index bfd3eeeaf5..efa807f2f3 100644 --- a/translated/tech/20150512 45 Zypper Commands to Manage 'Suse' Linux Package Management.md +++ b/translated/tech/20150512 45 Zypper Commands to Manage 'Suse' Linux Package Management.md @@ -48,7 +48,7 @@ Zypper 是软件包管理器ZYpp的命令行接口,可用于安装、删除SUS downgraded or changes vendor or architecture. --oldpackage Allow to replace a newer item with an older one. Handy if you are doing a rollback. Unlike --force - j it will not enforce a reinstall. + it will not enforce a reinstall. --replacefiles Install the packages even if they replace files from other, already installed, packages. Default is to treat file conflicts as an error. --download-as-needed disables the fileconflict check. From adfff118b0753c72f6921cd82b6794e85deb1fb9 Mon Sep 17 00:00:00 2001 From: zhangkun Date: Sun, 24 May 2015 18:40:48 +0800 Subject: [PATCH 142/965] Deleted an trash directory --- sources/tech/.directory | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 sources/tech/.directory diff --git a/sources/tech/.directory b/sources/tech/.directory deleted file mode 100644 index 45bdd1cb5c..0000000000 --- a/sources/tech/.directory +++ /dev/null @@ -1,4 +0,0 @@ -[Dolphin] -Timestamp=2015,5,23,17,31,51 -Version=3 -ViewMode=2 From fd9df4bb2e9a6e900cef3d40dffdfb07bd7b832f Mon Sep 17 00:00:00 2001 From: zhangkun Date: Sun, 24 May 2015 21:29:06 +0800 Subject: [PATCH 143/965] Kick off a translation --- sources/tech/20150522 Analyzing Linux Logs.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150522 Analyzing Linux Logs.md b/sources/tech/20150522 Analyzing Linux Logs.md index 085d3a8ed3..38d5b4636e 100644 --- a/sources/tech/20150522 Analyzing Linux Logs.md +++ b/sources/tech/20150522 Analyzing Linux Logs.md @@ -1,3 +1,4 @@ +translating by zhangboyue Analyzing Linux Logs ================================================================================ There’s a great deal of information waiting for you within your logs, although it’s not always as easy as you’d like to extract it. In this section we will cover some examples of basic analysis you can do with your logs right away (just search what’s there). We’ll also cover more advanced analysis that may take some upfront effort to set up properly, but will save you time on the back end. Examples of advanced analysis you can do on parsed data include generating summary counts, filtering on field values, and more. @@ -178,4 +179,4 @@ via: http://www.loggly.com/ultimate-guide/logging/analyzing-linux-logs/ [6]:http://linux.die.net/man/1/awk [7]:http://www.delorie.com/gnu/docs/gawk/gawk_26.html#IDX155 [8]:http://logstash.net/docs/1.4.2/filters/grok -[9]:http://www.rsyslog.com/doc/v8-stable/configuration/templates.html \ No newline at end of file +[9]:http://www.rsyslog.com/doc/v8-stable/configuration/templates.html From d6ef19f580f9db5a642ebc300a6ca5d069453f55 Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 24 May 2015 23:00:36 +0800 Subject: [PATCH 144/965] PUB:20150521 Microsoft Open-Sources The Windows Communication Foundation @geekpi --- ...es The Windows Communication Foundation.md | 26 +++++++++++++++++++ ...es The Windows Communication Foundation.md | 26 ------------------- 2 files changed, 26 insertions(+), 26 deletions(-) create mode 100644 published/20150521 Microsoft Open-Sources The Windows Communication Foundation.md delete mode 100644 translated/news/20150521 Microsoft Open-Sources The Windows Communication Foundation.md diff --git a/published/20150521 Microsoft Open-Sources The Windows Communication Foundation.md b/published/20150521 Microsoft Open-Sources The Windows Communication Foundation.md new file mode 100644 index 0000000000..bf071f9c5d --- /dev/null +++ b/published/20150521 Microsoft Open-Sources The Windows Communication Foundation.md @@ -0,0 +1,26 @@ +微软开源了WCF框架 +================================================================================ +微软于今日(2015/5/20)宣布了针对 .NET Core 重大开源:WCF(Windows Communication Foundation)。 + +如[MSDN][1]中的描述:“WCF是一个构建面向服务应用的框架。使用WCF,你可以从一个服务终端给另一个发送异步消息。服务终端可以是托管在IIS中连续可用的服务的一部分,也可以是托管在某个程序上的服务。服务终端可以是请求服务端数据的客户端。消息可以是一个字符或者XML,也可以是复杂的二进制流。” + +它的[代码放在GitHub][2],“包含了Window桌面中完整WCF框架的一部分,它支持已经可用于构建Window Store上的WCF应用的库。这些主要是基于客户端,方便移动设备和中间层服务器使用WCF进行通信。” + +更多的关于微软开源 WCF 的细节查看[dotNETFoundation.org blog][3]的公告。 + +WCF听上去有点像Linux中用于进程/服务之间的进程间通讯的D-BUS。 + +-------------------------------------------------------------------------------- + +via: http://www.phoronix.com/scan.php?page=news_item&px=Microsoft-Open-Source-WCF + +作者:[Michael Larabel][a] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.michaellarabel.com/ +[1]:https://msdn.microsoft.com/en-us/library/ms731082%28v=vs.110%29.aspx +[2]:https://github.com/dotnet/wcf +[3]:http://www.dotnetfoundation.org/blog/wcf-is-open-source \ No newline at end of file diff --git a/translated/news/20150521 Microsoft Open-Sources The Windows Communication Foundation.md b/translated/news/20150521 Microsoft Open-Sources The Windows Communication Foundation.md deleted file mode 100644 index 45d8d6514a..0000000000 --- a/translated/news/20150521 Microsoft Open-Sources The Windows Communication Foundation.md +++ /dev/null @@ -1,26 +0,0 @@ -微软开源了WCF框架 -================================================================================ -微软今天宣布我们开源的针对.NET核心的WCF(Windows Communication Foundation)。 - -[MSDN][1]中说:“WCF是一个构建面向服务程序的框架。使用WCF,你可以从服务端给另一个发送异步消息。服务终端可以是托管在IIS中连续可用服务的一部分,也可以是托管在某个程序上的服务。终端可以是请求服务端数据的客户端。消息可以是一个字符或者XML,也可以是复杂的二进制流。” - -它的[代码在GitHub][2],“包含了Window桌面中完整WCF框架的一部分,它支持已经在Window Store中的WCF库。这些档案主要是基于客户端,方便移动设备和中间层服务器使用WCF进行通信。” - -More details on Microsoft opening up the Windows Communication Foundation can be found via the announcement posted this morning to the [dotNETFoundation.[dotNETFoundation.org blog][3]中查看。 - -WCF听上去有点像Linux中进程/服务间通信的D-BUS。 - --------------------------------------------------------------------------------- - -via: http://www.phoronix.com/scan.php?page=news_item&px=Microsoft-Open-Source-WCF - -作者:[Michael Larabel][a] -译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.michaellarabel.com/ -[1]:https://msdn.microsoft.com/en-us/library/ms731082%28v=vs.110%29.aspx -[2]:https://github.com/dotnet/wcf -[3]:http://www.dotnetfoundation.org/blog/wcf-is-open-source \ No newline at end of file From 2b8dc336f1e48543b5246cc965c0925b634d47ea Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 24 May 2015 23:08:16 +0800 Subject: [PATCH 145/965] PUB:20150323 Square 2.0 Icon Pack Is Twice More Beautiful @geekpi --- ...quare 2.0 Icon Pack Is Twice More Beautiful.md | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) rename {translated/share => published}/20150323 Square 2.0 Icon Pack Is Twice More Beautiful.md (66%) diff --git a/translated/share/20150323 Square 2.0 Icon Pack Is Twice More Beautiful.md b/published/20150323 Square 2.0 Icon Pack Is Twice More Beautiful.md similarity index 66% rename from translated/share/20150323 Square 2.0 Icon Pack Is Twice More Beautiful.md rename to published/20150323 Square 2.0 Icon Pack Is Twice More Beautiful.md index a18110fb11..cd8c8556a0 100644 --- a/translated/share/20150323 Square 2.0 Icon Pack Is Twice More Beautiful.md +++ b/published/20150323 Square 2.0 Icon Pack Is Twice More Beautiful.md @@ -1,19 +1,19 @@ -Square 2.0图标包更漂亮了 +更漂亮的 Square 2.0图标包 ================================================================================ ![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/03/Square_Icon_Pack_Linux_3.jpeg) -优雅、现代的[Square图标主题][1]最近更新到了2.0版,这让它比以前更漂亮了。Square图标包与其他主要的桌面环境如**Unity、 GNOME、KDE、 MATE等等**兼容。这意味着你可以在所有的流行Linux发行版如Ubuntu、Fedora、Linux Mint、elementary OS等等中使用它。 这个图标包估计包含超过了15000个图标。 +优雅、现代的[Square图标主题][1]最近更新到了2.0版,它比以前更漂亮了。Square图标包与其他主要的桌面环境如**Unity、 GNOME、KDE、 MATE等等**兼容。这意味着你可以在所有的流行Linux发行版如Ubuntu、Fedora、Linux Mint、elementary OS等等中使用它。 这个图标包估计包含超过了15000个图标。 ### 在Linux中安装Square 2.0图标包 ### -有两种不同的Square图标,暗色和亮色。基于你的洗好,你可以选择二者之一。出于实验,我建议你两个主题包都下载。 +有两种不同的Square图标,暗色和亮色。基于你的喜好,你可以选择二者之一。出于体验的目的,我建议你两个主题包都下载。 -你可以用下面的链接下载图标包。文件存储在Google Drive,因此如果你没有看见像[SourceForge][2]这样标准的下载网站时怀疑。 +你可以用下面的链接下载图标包。文件存储在Google Drive,因此如果你没有看见像[SourceForge][2]这样标准的下载网站时不要怀疑。 - [Square Dark Icons][3] - [Square Light Icons][4] -要使用图标主题,解压下载的文件到~/.icons文件夹下。如果它不存在,就创建它。当你在正确的地方有这些文件后,基于你的桌面环境,使用一个工具来改变图标主题。我以前写了一些关于这个主题的教程。如果你需要额外的帮助,那么欢迎指出来: +要使用图标主题,解压下载的文件到~/.icons文件夹下。如果它不存在,就创建它。当这些文件放好后,基于你的桌面环境,使用一个工具来改变图标主题。我以前写了一些关于这个主题的教程。如果你需要额外的帮助,那么欢迎指出来: - [如何在Ubuntu Unity中改变主题][5] - [如何在GNOME Shell中改变主题][6] @@ -30,8 +30,7 @@ Square主题中几个图标的样子: ![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/03/Square_Icon_Pack_Linux.jpeg) -你怎么找到它的?你认为它是[Ubuntu 14.04中最佳的图标主题][10]之一么?你会分享它病期待更多关于自定义Linux桌面的文章么? - +你觉得怎么样?你认为它是[Ubuntu 14.04中最佳的图标主题][10]之一么?你会分享它并期待更多关于自定义Linux桌面的文章么? -------------------------------------------------------------------------------- @@ -39,7 +38,7 @@ via: http://itsfoss.com/square-2-0-icon-pack-linux/ 作者:[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/) 荣誉推出 From 67bcd640f7b6461278ca30ea26dd3fcf2968e9ca Mon Sep 17 00:00:00 2001 From: joeren Date: Mon, 25 May 2015 07:52:40 +0800 Subject: [PATCH 146/965] Update 20150407 How to secure BGP sessions using authentication on Quagga.md --- ...ow to secure BGP sessions using authentication on Quagga.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150407 How to secure BGP sessions using authentication on Quagga.md b/sources/tech/20150407 How to secure BGP sessions using authentication on Quagga.md index 020e2277cc..cf2226fac0 100644 --- a/sources/tech/20150407 How to secure BGP sessions using authentication on Quagga.md +++ b/sources/tech/20150407 How to secure BGP sessions using authentication on Quagga.md @@ -1,3 +1,4 @@ +Translating by GOLinux! How to secure BGP sessions using authentication on Quagga ================================================================================ The BGP protocol runs over TCP, and as such, it inherits all the vulnerabilities of a TCP connection. For example, within a BGP session, an attacker may impersonate a legitimate BGP neighbor, and convince the BGP routers on the other end to share their routing information with the attacker. The problem occurs when the attacker advertises and injects bogus routes towards neighboring routers. The unsuspecting neighboring routers may then start sending live traffic towards the attacker, which in most cases goes nowhere and simply gets dropped. Back in 2008, YouTube actually [fell victim][1] to such BGP route poisoning, and suffered major outage on their video service for more than an hour. In a far worse case, if the attacker is savvy enough, they can falsely act as a transparent transit router and sniff the transit traffic for any sensitive data. As you can imagine, this can have far reaching consequences. @@ -82,4 +83,4 @@ via: http://xmodulo.com/bgp-authentication-quagga.html [a]:http://xmodulo.com/author/sarmed [1]:http://research.dyn.com/2008/02/pakistan-hijacks-youtube-1/ [2]:http://tools.ietf.org/html/rfc2385 -[3]:http://xmodulo.com/centos-bgp-router-quagga.html \ No newline at end of file +[3]:http://xmodulo.com/centos-bgp-router-quagga.html From 03a0de17463d436f33b8bc1ad2fac839e35eb744 Mon Sep 17 00:00:00 2001 From: GOLinux Date: Mon, 25 May 2015 10:01:28 +0800 Subject: [PATCH 147/965] [Translated]20150407 How to secure BGP sessions using authentication on Quagga.md --- ...sessions using authentication on Quagga.md | 86 ------------------- ...sessions using authentication on Quagga.md | 84 ++++++++++++++++++ 2 files changed, 84 insertions(+), 86 deletions(-) delete mode 100644 sources/tech/20150407 How to secure BGP sessions using authentication on Quagga.md create mode 100644 translated/tech/20150407 How to secure BGP sessions using authentication on Quagga.md diff --git a/sources/tech/20150407 How to secure BGP sessions using authentication on Quagga.md b/sources/tech/20150407 How to secure BGP sessions using authentication on Quagga.md deleted file mode 100644 index cf2226fac0..0000000000 --- a/sources/tech/20150407 How to secure BGP sessions using authentication on Quagga.md +++ /dev/null @@ -1,86 +0,0 @@ -Translating by GOLinux! -How to secure BGP sessions using authentication on Quagga -================================================================================ -The BGP protocol runs over TCP, and as such, it inherits all the vulnerabilities of a TCP connection. For example, within a BGP session, an attacker may impersonate a legitimate BGP neighbor, and convince the BGP routers on the other end to share their routing information with the attacker. The problem occurs when the attacker advertises and injects bogus routes towards neighboring routers. The unsuspecting neighboring routers may then start sending live traffic towards the attacker, which in most cases goes nowhere and simply gets dropped. Back in 2008, YouTube actually [fell victim][1] to such BGP route poisoning, and suffered major outage on their video service for more than an hour. In a far worse case, if the attacker is savvy enough, they can falsely act as a transparent transit router and sniff the transit traffic for any sensitive data. As you can imagine, this can have far reaching consequences. - -To protect active BGP sessions against such attacks, many service providers leverage [MD5 checksum and a pre-shared key][2] for their BGP sessions. In a protected BGP session, a BGP router which sends a packet generates an MD5 hash value by using a pre-shared key, portions of the IP and TCP headers and the payload. The MD5 hash is then stored as a TCP option field. Upon receipt of the packet, a receiving router uses the same method to generate its version of the MD5 hash using a pre-shared key. It compares the hash with the one of the received packet to decide whether to accept the packet. For an attacker, it is almost impossible to guess the checksum or the key. For BGP routers, they can be assured that each packet is validated before its content is consumed. - -In this tutorial, we will see how we can secure a BGP session between two neighbors using MD5 checksum and a pre-shared key. - -### Preparation ### - -Securing a BGP session is fairly straightforward. We will use the following routers. - -注:表格 - - - - - - - - - - - - - - - - -
Router nameASIP address
router-A10010.10.12.1/30
router-B20010.10.12.2/30
- -The stock Linux kernel supports TCP MD5 option natively for IPv4 and IPv6. Thus if you built Quagga router from a brand new [Linux box][3], TCP MD5 capability will be automatically available for Quagga. It'll be just a matter of configuring Quagga to take advantage of the capability. But if you are using a FreeBSD box or built a custom kernel for Quagga, make sure that you enable TCP MD5 support on the kernel (e.g., CONFIG_TCP_MD5SIG kernel option in Linux). - -### Configuring Router-A for Authentication ### - -We will use the CLI shell of Quagga to configure the routers. The only new command that we will use is 'password'. - - [root@router-a ~]# vtysh - router-a# conf t - router-a(config)# router bgp 100 - router-a(config-router)# network 192.168.100.0/24 - router-a(config-router)# neighbor 10.10.12.2 remote-as 200 - router-a(config-router)# neighbor 10.10.12.2 password xmodulo - -The pre-shared key in this example is 'xmodulo'. Obviously, in a production environment you need to select a strong key. - -**Note**: in Quagga, the 'service password-encryption’ command is supposed to encrypt all plain-text passwords (e.g., login password) in its configuration file. However, when I use this command, I notice that the pre-shared key in BGP configuration still remains in clear text. I am not sure whether it's a limitation of Quagga, or whether it's a version issue. - -### Configuring Router-B for Authentication ### - -We will configure router-B in a similar fashion. - - [root@router-b ~]# vtysh - router-b# conf t - router-b(config)# router bgp 200 - router-b(config-router)# network 192.168.200.0/24 - router-b(config-router)# neighbor 10.10.12.1 remote-as 100 - router-b(config-router)# neighbor 10.10.12.1 password xmodulo - -### Verifying a BGP session ### - -If everything has been configured correctly, the BGP session should be up, and both routers should be exchanging routes. At this point, every outgoing packet in a TCP session carries a MD5 digest of the packet contents and a secret key, and the digest is automatically validated by the other end point. - -We can verify the active BGP session by viewing BGP summary as usual. MD5 checksum verification occurs transparently within Quagga, so you don't see it at the BGP level. - -![](https://farm8.staticflickr.com/7621/16837774368_e9ff66b370_c.jpg) - -If you want to test BGP authentication, you can configure one neighbor without a password or deliberately use a wrong pre-shared key and see what happens. You can also use a packet sniffer like tcpdump or Wireshark to analyze the packets that go through the BGP session. For example, tcpdump with "-M " option will validate the MD5 digests found in TCP option field. - -To sum up, in this tutorial we demonstrate how we can easily secure the BGP session between two routers. The process is very straightforward compared to other protocols. It is always recommended to secure your BGP session, especially if you are setting up the BGP session with another AS. The pre-shared key should also be kept safe. - --------------------------------------------------------------------------------- - -via: http://xmodulo.com/bgp-authentication-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://research.dyn.com/2008/02/pakistan-hijacks-youtube-1/ -[2]:http://tools.ietf.org/html/rfc2385 -[3]:http://xmodulo.com/centos-bgp-router-quagga.html diff --git a/translated/tech/20150407 How to secure BGP sessions using authentication on Quagga.md b/translated/tech/20150407 How to secure BGP sessions using authentication on Quagga.md new file mode 100644 index 0000000000..be67b88ab1 --- /dev/null +++ b/translated/tech/20150407 How to secure BGP sessions using authentication on Quagga.md @@ -0,0 +1,84 @@ +Quagga上使用验证加固BGP会话安全 +================================================================================ +BGP协议运行于TCP之上,因而,它也继承了TCP连接的所有漏洞。例如,在一个BGP会话内,攻击者可以冒充一个合法的BGP邻居,然后说服另一端的BGP路由器共享路由信息给攻击者。在攻击者通告并向邻居路由注入伪造的路由时,就会发生这个问题。毫无戒备的邻居路由器就会开始向攻击者发送通信实况,实际上这些信息并没有去向任何地方,仅仅只是被丢弃了。回到2008年,YouTube实际上也[受害于][1]这样的BGP路由中毒,并遭受了长达一个小时的视频服务大量中断。一个更加糟糕的情况是,如果攻击者是个足够懂行的人,他们可以伪装成一台透明路由器,然后嗅探经过的通信以获取敏感数据。你可以想象,这会造成深远的影响。 + +要保护活跃的BGP会话不受攻击,许多服务提供商在BGP会话中使用[MD5校验和并预共享密钥][2]。在受保护的BGP会话中,一台发送包的BGP路由器通过使用预共享的密钥生成MD5散列值、部分IP和TCP头以及有效负载。然后,MD5散列作为一个TCP选项字段存储。在收到包后,接受路由器用同样的方法使用预共享密钥生成它的MD5版本。它会将它的MD5散列和接收到的某个包的值进行对比,以决定是否接受该包。对于一个攻击者而言,几乎不可能猜测校验和或其密钥。对于BGP路由器而言,它们能在消耗包的内容前确保每个包的合法性。 + +在本教程中,我们将为大家演示如何使用MD5校验和以及预共享密钥来加固两个邻居间的BGP会话的安全。 + +### 准备 ### + +加固BGP会话安全是相当简单而直截了当的,我们会使用以下路由器。 + + + + + + + + + + + + + + + + + +
路由器名称ASIP地址
router-A10010.10.12.1/30
router-B20010.10.12.2/30
+ +常用的Linux内核原生支持TCP的MD5选项用于IPv4和IPv6。因此,如果你从全新的[Linux盒子][3]构建了Quagga路由器,TCP的MD5功能会自动启用。剩下来的事情,仅仅是配置Quagga以使用它的功能。但是,如果你使用的是FreeBSD盒子或者为Quagga构建了一个自定义内核,请确保内核开启了TCP的MD5支持(如,Linux中的CONFIG_TCP_MD5SIG选项)。 + +### 配置Router-A验证功能 ### + +我们将使用Quagga的CLI Shell来配置路由器,我们将使用的唯一的一个新命令是‘password’。 + + [root@router-a ~]# vtysh + router-a# conf t + router-a(config)# router bgp 100 + router-a(config-router)# network 192.168.100.0/24 + router-a(config-router)# neighbor 10.10.12.2 remote-as 200 + router-a(config-router)# neighbor 10.10.12.2 password xmodulo + +本例中使用的预共享密钥是‘xmodulo’。很明显,在生产环境中,你需要选择一个更健壮的密钥。 + +**注意**: 在Quagga中,‘service password-encryption’命令是想加密配置文件中所有明文密码(如,登录密码)。然而,当我使用该命令时,我注意到BGP配置中的预共享密钥仍然是明文的。我不确定这是否是Quagga的限制,还是版本自身的问题。 + +### 配置Router-B验证功能 ### + +我们将以类似的方式配置router-B。 + + [root@router-b ~]# vtysh + router-b# conf t + router-b(config)# router bgp 200 + router-b(config-router)# network 192.168.200.0/24 + router-b(config-router)# neighbor 10.10.12.1 remote-as 100 + router-b(config-router)# neighbor 10.10.12.1 password xmodulo + +### 验证BGP会话 ### + +如果一切配置正确,那么BGP会话就会起来,两台路由器应该能交换路由表。这时候,TCP会话中的所有流出包都会携带一个MD5摘要的包内容和一个密钥,而摘要信息会被另一端自动验证。 + +我们可以像平时一样通过查看BGP的概要来验证活跃的BGP会话。MD5校验和验证在Quagga内部是透明的,因此,你在BGP级别是无法看到的。 + +![](https://farm8.staticflickr.com/7621/16837774368_e9ff66b370_c.jpg) + +如果你想要测试BGP验证,你可以配置一个邻居路由,设置其密码为空,或者故意使用错误的预共享密钥,然后查看发生了什么。你也可以使用包嗅探器,像tcpdump或者Wireshark等,来分析通过BGP会话的包。例如,带有“-M ”选项的tcpdump将验证TCP选项字段的MD5摘要。 + +小结之,在本教程中,我们演示了怎样简单地加固两台路由间的BGP会话安全。相对于其它协议而言,配置过程非常简明。强烈推荐你加固BGP会话安全,尤其是当你用另一个AS配置BGP会话的时候。预共享密钥也应该安全地保存。 + +-------------------------------------------------------------------------------- + +via: http://xmodulo.com/bgp-authentication-quagga.html + +作者:[Sarmed Rahman][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/sarmed +[1]:http://research.dyn.com/2008/02/pakistan-hijacks-youtube-1/ +[2]:http://tools.ietf.org/html/rfc2385 +[3]:http://xmodulo.com/centos-bgp-router-quagga.html From fd8ba580bcf001c396220b4b0ce1df318861515f Mon Sep 17 00:00:00 2001 From: ZTinoZ Date: Mon, 25 May 2015 10:16:28 +0800 Subject: [PATCH 148/965] Translating by ZTinoZ --- ... Things to Do After Installing Ubuntu 15.04 Desktop.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sources/tech/20150427 15 Things to Do After Installing Ubuntu 15.04 Desktop.md b/sources/tech/20150427 15 Things to Do After Installing Ubuntu 15.04 Desktop.md index e7d536958e..9c897e60c4 100644 --- a/sources/tech/20150427 15 Things to Do After Installing Ubuntu 15.04 Desktop.md +++ b/sources/tech/20150427 15 Things to Do After Installing Ubuntu 15.04 Desktop.md @@ -207,7 +207,7 @@ Install Torrent ### 13. 安装Windows仿真器-Wine和游戏支持平台-Steam ### -Wine emulator allows you to install and run Windows applications on Linux. On the other hand, Steam is a popular gaming platform for Linux based systems developed by Valve. To install both of them on your machine issue the following command on Terminal or use Ubuntu Software Center. +Wine仿真器允许你在Linux上安装并运行Window应用程序。在另一方面,Steam是一款Valve开发的流行于Linux系统的游戏平台。想要在你的机器上安装它们,可以输入以下命令或使用Ubuntu Software Center。 $ sudo apt-get install steam wine winetricks @@ -216,7 +216,7 @@ Install Wine ### 14. 安装Cairo-Dock并启用桌面视觉效果 ### -Cairo-Dock is a beautiful and flexible launcher bar for Linux desktops similar to the Mac OS X dock. To install it on Ubuntu, run the following command on Terminal. +Cairo-Dock是一款漂亮且灵巧的用于Linux桌面上的启动条,类似于Mac OS X dock。想要在Ubuntu上安装它,可以在终端上运行以下命令: $ sudo apt-get install cairo-dock cairo-dock-plug-ins @@ -226,11 +226,11 @@ Install Cairo Dock ![Add Cairo Dock at Startup](http://www.tecmint.com/wp-content/uploads/2015/04/add-cairo-dock-startup.jpg) Add Cairo Dock at Startup -To enable a set of Desktop Effects, such as Cube effect, install Compiz package with the following command: +想要启用某一套桌面效果,例如Cube效果,可以使用以下命令来安装Compiz包: $ sudo apt-get install compiz compizconfig-settings-manager compiz-plugins-extra -To activate the Desktop Cube effect, search for ccsm on Dash, open CompizConfig Settings Manager, go to General Options – > Desktop Size and set Horizontal Virtual Size value to 4 and Vertical Virtual Size to 1. Then go back and check Desktop Cube (Disable Desktop Wall) and Rotate Cube boxes (Resolve Conflicts ->Disable Switch to Viewport 1) and press Ctrl+Alt+Left Mouse Click to view the cube effect. +想要激活桌面Cube效果,search for ccsm on Dash, open CompizConfig Settings Manager, go to General Options – > Desktop Size and set Horizontal Virtual Size value to 4 and Vertical Virtual Size to 1. Then go back and check Desktop Cube (Disable Desktop Wall) and Rotate Cube boxes (Resolve Conflicts ->Disable Switch to Viewport 1) and press Ctrl+Alt+Left Mouse Click to view the cube effect. ![Enable Compiz](http://www.tecmint.com/wp-content/uploads/2015/04/enable-compiz.jpg) Enable Compiz From 7fc8f458177648c39d2fbd3758df780accffe77b Mon Sep 17 00:00:00 2001 From: wxy Date: Mon, 25 May 2015 09:39:43 +0800 Subject: [PATCH 149/965] PUB:20150331 Its Now Worth Try Installing PHP 7.0 on CentOS 7.x or Fedora 21 @wi-cuckoo --- ...ling PHP 7.0 on CentOS 7.x or Fedora 21.md | 35 ++++++++++--------- 1 file changed, 18 insertions(+), 17 deletions(-) rename {translated/tech => published}/20150331 Its Now Worth Try Installing PHP 7.0 on CentOS 7.x or Fedora 21.md (77%) diff --git a/translated/tech/20150331 Its Now Worth Try Installing PHP 7.0 on CentOS 7.x or Fedora 21.md b/published/20150331 Its Now Worth Try Installing PHP 7.0 on CentOS 7.x or Fedora 21.md similarity index 77% rename from translated/tech/20150331 Its Now Worth Try Installing PHP 7.0 on CentOS 7.x or Fedora 21.md rename to published/20150331 Its Now Worth Try Installing PHP 7.0 on CentOS 7.x or Fedora 21.md index bc27aec4ec..2d059a4930 100644 --- a/translated/tech/20150331 Its Now Worth Try Installing PHP 7.0 on CentOS 7.x or Fedora 21.md +++ b/published/20150331 Its Now Worth Try Installing PHP 7.0 on CentOS 7.x or Fedora 21.md @@ -1,29 +1,30 @@ -现在值得去尝试一下在CentOS 7.x或Fedora 21上面安装PHP 7.0 +在CentOS 7.x / Fedora 21 上面体验 PHP 7.0 =============================================================================== -PHP是一种为我们熟知的通用的,服务器网页脚本语言。超大量的在线网站都是用PHP编写的。PHP过去一直在更新,丰富功能,易于使用,而且很好组织的脚本语言。目前PHP的开发团队正筹备下一个PHP版本的发行,名字是PHP 7。现在的PHP版本为PHP 5.6,可能你清楚PHP 6已经流产了,PHP 7的支持者们不希望下一个重要的版本被其他分支混淆,即过去已经停止很久的PHP 6。所以决定下一个PHP主要的发行版本叫PHP 7,而不是PHP 6。PHP 7.0预计在今年十一月份发行。 -在下一个主要的PHP发行版里有一些不错的功能。 +PHP是一种为我们熟知的通用服务器网页脚本语言。非常多的在线网站都是用PHP编写的。PHP这些年来一直在持续进化,丰富其功能,变得易于使用,更好地组织的脚本语言。目前PHP的开发团队正筹备下一个PHP版本的发行,名字是PHP 7。现在的PHP版本为PHP 5.6,可能你清楚PHP 6已经流产了,PHP 7的支持者们不希望下一个重要的版本被其他分支混淆,即过去已经停止很久的PHP 6。所以决定下一个PHP主要的发行版本叫PHP 7,而不是PHP 6。PHP 7.0预计在今年十一月份发行。 -- 为了提升执行效率与记忆痕迹,PHPNG功能被添加到新的发行版中。 -- JIT引擎被收入来动态编译Zend操作码为自然机器码,以此来达到更快的处理性能。这项功能允许随后的程序调用同一份代码,这样会运行快很多。 +在下一代主要PHP版本里有一些不错的功能: + +- 为了改善执行效率与内存占用,新的版本添加了PHPNG功能。 +- 引入了JIT引擎来动态编译Zend操作码为自然机器码,以此来达到更快的处理性能。这项功能允许随后的程序调用同一份代码,这样会运行快很多。 - AST(抽象语法树)是最新添加的功能,它可以增强支持PHP的扩展性和用户应用。 -- 异步编程功能会添加支持并行任务,在同样的需求下。 --新的版本会支持独立多线程网页服务,这样可以使用一个单独的存储块处理很多并发的请求。 +- 添加异步编程功能以支持同一个请求中的并行任务。 +- 新的版本会支持独立的多线程网页服务器,这样可以使用一个单独的存储池处理很多并发的请求。 -### 在CcentOS/Fedora上安装PHP 7 ### +### 在CentOS/Fedora上安装PHP 7 ### -让我们来看看怎样在CentOS 7和Fedora 21安装PHP7。为了安装PHP7,我们首先需要克隆php-src 仓库。当克隆工作完成,我们会配置和编译它。进行下一步之前,我们要确保已经在LInux系统下安装了如下的东西,否则PHP编译会返回错误,然后流产。 +让我们来看看怎样在CentOS 7和Fedora 21安装PHP7。为了安装PHP7,我们首先需要克隆php-src 仓库。当克隆工作完成,我们再配置和编译它。进行下一步之前,我们要确保已经在LInux系统下安装了如下的组件,否则PHP编译会返回错误中止。 - Git - autoconf - gcc - bison -所有上面提到的要求可以使用Yum软件包管理器安装。用连续的一个命令应该这样: +所有上面提到的要求可以使用Yum软件包管理器安装。以下一条命令即可完成: yum install git autoconf gcc bison -准备好开始安装PHP7了吗?让我们先创建一个PHP7目录,作为你的工作目录。 +准备好开始安装PHP7了吗?让我们先创建一个PHP7目录,作为你的当前工作目录。 mkdir php7 @@ -143,7 +144,7 @@ PHP是一种为我们熟知的通用的,服务器网页脚本语言。超大 --with-mysqli=/usr/bin/mysql_config -这会花去不少的时间,一旦完成,你应该会看到如下面的输出: +这会花去不少的时间,当完成后你应该会看到如下面的输出: creating libtool @@ -206,9 +207,9 @@ PHP是一种为我们熟知的通用的,服务器网页脚本语言。超大 运行下面的命令,完成编译过程。 - manke + make -“make”命令过后的样例输出如下所示: +“make”命令的样例输出如下所示: Generating phar.php @@ -294,7 +295,7 @@ PHP是一种为我们熟知的通用的,服务器网页脚本语言。超大 cd sapi/cli -在这里验证PHP的版本。 +验证一下PHP的版本。 [root@localhost cli]# ./php -v @@ -306,7 +307,7 @@ PHP是一种为我们熟知的通用的,服务器网页脚本语言。超大 ### 总结 ### -PHP 7也被[添加到了remi仓库][1],即将到来的版本主要关注执行效率的提升,新的特性致力于使PHP较好满足现代编程的需求和趋势。PHP 7.0将会有许多新的特性,丢弃一些老版本的东西。在接下来的日子里,我们希望看到新特性和弃用功能的具体情况。尽情享受吧! +PHP 7也[添加到了remi仓库][1],这个即将到来的版本主要关注执行效率的提升,它的新特性致力于使PHP较好满足现代编程的需求和趋势。PHP 7.0将会有许多新的特性、丢弃一些老版本的东西。在接下来的日子里,我们希望看到新特性和弃用功能的具体情况。希望你喜欢! -------------------------------------------------------------------------------- @@ -314,7 +315,7 @@ via: http://linoxide.com/linux-how-to/install-php-7-centos-7-fedora-21/ 作者:[Aun Raza][a] 译者:[wi-cuckoo](https://github.com/wi-cuckoo) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 From e862305ee1259ca79f68c450072b86da87fe3677 Mon Sep 17 00:00:00 2001 From: wxy Date: Mon, 25 May 2015 11:07:35 +0800 Subject: [PATCH 150/965] PUB:20150409 4 Tools Send Email with Subject, Body and Attachment in Linux @goreliu https://linux.cn/article-5502-1.html --- ...h Subject, Body and Attachment in Linux.md | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) rename {translated/tech => published}/20150409 4 Tools Send Email with Subject, Body and Attachment in Linux.md (76%) diff --git a/translated/tech/20150409 4 Tools Send Email with Subject, Body and Attachment in Linux.md b/published/20150409 4 Tools Send Email with Subject, Body and Attachment in Linux.md similarity index 76% rename from translated/tech/20150409 4 Tools Send Email with Subject, Body and Attachment in Linux.md rename to published/20150409 4 Tools Send Email with Subject, Body and Attachment in Linux.md index fe2fa8c5cf..00003eaa19 100644 --- a/translated/tech/20150409 4 Tools Send Email with Subject, Body and Attachment in Linux.md +++ b/published/20150409 4 Tools Send Email with Subject, Body and Attachment in Linux.md @@ -1,10 +1,10 @@ -4个可以发送带主题、正文和附件的电子邮件的工具 +4个可以发送完整电子邮件的命令行工具 ================================================================================ -今天的文章里我们会讲到一些使用Linux命令行工具来发送带附件的电子邮件的方法。它有很多用处,比如在应用程序所在服务器上,使用电子邮件发送一个档案过来,或者你可以在脚本中使用这些命令来做一些自动化操作。在本文的例子中,我们会使用foo.tar.gz文件作为附件。 +今天的文章里我们会讲到一些使用Linux命令行工具来发送带附件的电子邮件的方法。它有很多用处,比如在应用程序所在服务器上,使用电子邮件发送一个文件过来,或者你可以在脚本中使用这些命令来做一些自动化操作。在本文的例子中,我们会使用foo.tar.gz文件作为附件。 有不同的命令行工具可以发送邮件,这里我分享几个多数用户会使用的工具,如`mailx`、`mutt`和`swaks`。 -我们即将呈现的多数工具都是非常有名的,并且存在于多数Linux发行版默认的软件仓库中,你可以使用如下命令安装: +我们即将呈现的这些工具都是非常有名的,并且存在于多数Linux发行版默认的软件仓库中,你可以使用如下命令安装: 在 **Debian / Ubuntu** 系统 @@ -30,11 +30,11 @@ mailx [-BDdEFintv~] [-s subject] [-a attachment ] [-c cc-addr] [-b bcc-addr] [-r from-addr] [-h hops] [-A account] [-S variable[=value]] to-addr . . . -如果你看到它支持`-a`的选项(-a 文件名,将文件作为附件添加到邮件)和`-s`选项(-s 主题,指定邮件的主题),就是支持的。可以使用如下的几个例子发送邮件。 +如果你看到它支持`-a`的选项(-a 文件名,将文件作为附件添加到邮件)和`-s`选项(-s 主题,指定邮件的主题),那就是支持的。可以使用如下的几个例子发送邮件。 -**a) 简单的邮件 ** +**a) 简单的邮件** -运行`mail`命令,然后`mailx`会等待你输入邮件内容。你可以按回车来换行。当输入完成后,按Ctrl + D,`mailx`会显示EOT。 +运行`mail`命令,然后`mailx`会等待你输入邮件内容。你可以按回车来换行。当输入完成后,按Ctrl + D,`mailx`会显示EOT表示结束。 然后`mailx`会自动将邮件发送给收件人。 @@ -45,21 +45,21 @@ How are you EOT -**b) 发送有主题的邮件 ** +**b) 发送有主题的邮件** $ echo "Email text" | mail -s "Test Subject" user@example.com `-s`的用处是指定邮件的主题。 -**c) 从文件中读取邮件内容并发送 ** +**c) 从文件中读取邮件内容并发送** $ mail -s "message send from file" user@example.com < /path/to/file -**d) 将从管道获取到的`echo`命令输出作为邮件内容发送 ** +**d) 将从管道获取到的`echo`命令输出作为邮件内容发送** $ echo "This is message body" | mail -s "This is Subject" user@example.com -**e) 发送带附件的邮件 ** +**e) 发送带附件的邮件** $ echo “Body with attachment "| mail -a foo.tar.gz -s "attached file" user@example.com @@ -67,37 +67,37 @@ ### 2) mutt ### -Mutt是类Unix系统上的一个文本界面邮件客户端。它有20多年的历史,在Linux历史中也是一个很重要的部分,它是最早支持进程打分和多线程处理的程序之一。按照如下的例子来发送邮件。 +Mutt是类Unix系统上的一个文本界面邮件客户端。它有20多年的历史,在Linux历史中也是一个很重要的部分,它是最早支持进程打分和多线程处理的客户端程序之一。按照如下的例子来发送邮件。 -**a) 从文件中读取邮件的主题和正文,并发送 ** +**a) 带有主题,从文件中读取邮件的正文,并发送** $ mutt -s "Testing from mutt" user@example.com < /tmp/message.txt -**b) 将从管道获取到的`echo`命令输出作为邮件内容发送 ** +**b) 通过管道获取`echo`命令输出作为邮件内容发送** $ echo "This is the body" | mutt -s "Testing mutt" user@example.com -**c) 发送带附件的邮件 ** +**c) 发送带附件的邮件** $ echo "This is the body" | mutt -s "Testing mutt" user@example.com -a /tmp/foo.tar.gz -**d) 发送带有多个附件的邮件 ** +**d) 发送带有多个附件的邮件** $ echo "This is the body" | mutt -s "Testing" user@example.com -a foo.tar.gz –a bar.tar.gz ### 3) swaks ### -Swaks(Swiss Army Knife,瑞士军刀)是SMTP的瑞士军刀,它功能强大、灵活、可编程、面向事务的SMTP测试工具,由John Jetmore开发和维护。你可以使用如下语法发送带附件的邮件: +Swaks(Swiss Army Knife,瑞士军刀)是SMTP服务上的瑞士军刀,它是一个功能强大、灵活、可编程、面向事务的SMTP测试工具,由John Jetmore开发和维护。你可以使用如下语法发送带附件的邮件: $ swaks -t "foo@bar.com" --header "Subject: Subject" --body "Email Text" --attach foo.tar.gz -关于Swaks一个重要的事情是,它会为你显示整个邮件发送过程,所以如果你想调试邮件发送过程,它是一个非常有用的工具: +关于Swaks一个重要的地方是,它会为你显示整个邮件发送过程,所以如果你想调试邮件发送过程,它是一个非常有用的工具。 -正如你看到的那样,它给你提供了邮件发送过程的所有细节,包括邮件接收服务器的功能支持、两个服务器之间的每一步交互。 +它会给你提供了邮件发送过程的所有细节,包括邮件接收服务器的功能支持、两个服务器之间的每一步交互。 ### 4) uuencode ### -邮件传输系统最初是被设计来传送7位编码(类似ASCII)的内容的。这就意味这它是用来发送文本内容,而不能发会使用8个位的二进制内容(如程序文件或者图片)。`uuencode`(“UNIX to UNIX encoding”,UNIX之间使用的编码方式)程序用来解决这个限制。使用`uuencode`,发送端将二进制格式的转换成文本格式来传输,接收端再转换回去。 +邮件传输系统最初是被设计来传送7位编码(类似ASCII)的内容的。这就意味这它是用来发送文本内容,而不能发会使用8位的二进制内容(如程序文件或者图片)。`uuencode`(“UNIX to UNIX encoding”,UNIX之间使用的编码方式)程序用来解决这个限制。使用`uuencode`,发送端将二进制格式的转换成文本格式来传输,接收端再转换回去。 我们可以简单地使用`uuencode`和`mailx`或者`mutt`配合,来发送二进制内容,类似这样: @@ -246,7 +246,7 @@ Swaks(Swiss Army Knife,瑞士军刀)是SMTP的瑞士军刀,它功能强 ### 总结 ### -有很多方法可以使用命令行/Shell脚本来发送邮件,我们只分享了其中4个类Unix系统可用的工具。希望你喜欢我们的文章,并且提供您的宝贵意见,让我们知道您想了解哪些新工具。 +有很多方法可以使用命令行/Shell脚本来发送邮件,这里我们只分享了其中4个类Unix系统可用的工具。希望你喜欢我们的文章,并且提供您的宝贵意见,让我们知道您想了解哪些新工具。 -------------------------------------------------------------------------------- @@ -254,7 +254,7 @@ via: http://linoxide.com/linux-shell-script/send-email-subject-body-attachment-l 作者:[Bobbin Zachariah][a] 译者:[goreliu](https://github.com/goreliu) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 From b7cccea3350ecce6aa5d077297eb92a0706c604f Mon Sep 17 00:00:00 2001 From: wxy Date: Mon, 25 May 2015 11:34:59 +0800 Subject: [PATCH 151/965] PUB:20150205 Inxi--Find System And Hardware Information On Linux @goreliu --- ...ind System And Hardware Information On Linux.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) rename {translated/tech => published}/20150205 Inxi--Find System And Hardware Information On Linux.md (88%) diff --git a/translated/tech/20150205 Inxi--Find System And Hardware Information On Linux.md b/published/20150205 Inxi--Find System And Hardware Information On Linux.md similarity index 88% rename from translated/tech/20150205 Inxi--Find System And Hardware Information On Linux.md rename to published/20150205 Inxi--Find System And Hardware Information On Linux.md index 7b7b148413..abbfc030cf 100644 --- a/translated/tech/20150205 Inxi--Find System And Hardware Information On Linux.md +++ b/published/20150205 Inxi--Find System And Hardware Information On Linux.md @@ -1,7 +1,7 @@ -Inxi——获取Linux的系统和硬件信息 +Inxi:获取Linux的系统和硬件信息 ================================================================================ -我们已经展示了一些不同的[应用程序][1]和方法来获取Linux的系统和硬件信息。在这一系列,我们将看到如何使用**inxi**来获取这些详情信息。在论坛技术支持中,它可以作为调试工具,迅速确定用户的系统配置和硬件信息。 +我们已经展示了一些不同的[应用程序][1]和方法来获取Linux的系统和硬件信息。在这一系列里,我们将看到如何使用**inxi**来获取这些详情信息。在论坛技术支持中,它可以作为调试工具,迅速确定用户的系统配置和硬件信息。 **Inxi**是一个可以获取完整的系统和硬件详情信息的命令行工具,内容包括: @@ -86,7 +86,7 @@ Inxi在多数现代GNU/Linux操作系统的默认软件仓库中。所以我们 Machine: System: Dell (portable) product: Inspiron N5050 Mobo: Dell model: 01HXXJ version: A05 Bios: Dell version: A05 date: 08/03/2012 -不只有硬性详情信息,它也可以显示我们系统中的**可用软件仓库列表**。 +不仅是硬性详情信息,它也可以显示我们系统中的**可用软件仓库列表**。 inxi -r @@ -110,7 +110,7 @@ Inxi还可以显示你所在位置的天气信息。感到意外吗?是的, inxi -W Erode,Tamilnadu -这里**Erode**是区,**Tamilnadu**是印度的一个邦。 +这里**Erode**是地区,**Tamilnadu**是印度的一个邦。 示例输出: @@ -118,7 +118,7 @@ Inxi还可以显示你所在位置的天气信息。感到意外吗?是的, ### 查看完整的硬件详情信息 ### -厌倦了获取每种硬件的信息?你可以使用如下命令将所有信息一次列出: +厌倦了逐一获取每种硬件的信息?你可以使用如下命令将所有信息一次列出: inxi -F @@ -164,9 +164,9 @@ via: http://www.unixmen.com/inxi-find-system-hardware-information-linux/ 作者:[SK][a] 译者:[goreliu](https://github.com/goreliu) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 [a]:http://www.unixmen.com/author/sk/ -[1]:http://www.unixmen.com/screenfetch-bash-screenshot-information-tool/ +[1]:https://linux.cn/article-1947-1.html From 282bdac1fbce0a2860aacac539e3454d0fff7fff Mon Sep 17 00:00:00 2001 From: wxy Date: Mon, 25 May 2015 11:52:40 +0800 Subject: [PATCH 152/965] =?UTF-8?q?=E6=A0=A1=E5=AF=B9=E9=83=A8=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...20140804 Group Test--Linux Text Editors.md | 124 +++++++++--------- 1 file changed, 59 insertions(+), 65 deletions(-) diff --git a/translated/share/20140804 Group Test--Linux Text Editors.md b/translated/share/20140804 Group Test--Linux Text Editors.md index 1976cfca32..5400d1b935 100644 --- a/translated/share/20140804 Group Test--Linux Text Editors.md +++ b/translated/share/20140804 Group Test--Linux Text Editors.md @@ -1,14 +1,15 @@ -组测试: Linux 文本编辑器 +五款 Linux 文本编辑器测评 ================================================================================ -> Mayank Sharma 测试了5款不仅仅是能处理字的超级文本编辑器。 -如果你使用Linux已经有很长一段时间,你知道,不管是编辑一款app的配置文件,一起用shell脚本骇客,或者编写/查看代码,类似LobreOffice的工具并不能满足。尽管字面上看起来意思一样,你不需要一个字处理器来完成这些任务;你需要一个文本编辑器。 +> Mayank Sharma 测试了5款不仅仅是能处理文字的超强文本编辑器。 -在这个组测试中,我们将着眼于5款不仅仅是能胜任繁重文本任务的简陋的文本编辑器。他们能高亮语法,像拼写检查一样轻松处理代码缩进。你可以像你复制/粘贴文本那样容易地使用他们记录宏以及管理代码片段。 +如果你使用Linux已经有很长一段时间,你知道,不管是编辑一款app的配置文件,还是修改shell脚本,或者编写/查看代码,类似LibreOffice的工具并不适合。尽管字面上看起来都是一样,但是你并不需要一个文字处理器来完成这些任务;你需要的是一个文本编辑器。 -得益于能向它们注入足以抗衡其它类型的以文本为中心的应用程序能力的插件,一些简单的文本编辑器甚至超过了它们的设计目标。它们能胜任一个源代码编辑器的任务,甚至是一个集成开发环境。 +在这个测评中,我们将着眼于5款更能胜任繁重文本工作的轻量级的文本编辑器。他们支持语法高亮,像拼写检查一样轻松处理代码缩进。你可以像你复制/粘贴文本那样容易地使用它们记录宏以及管理代码片段。 -Emacs和Vim是两款最流行和强大的纯文本编辑器。但是,由于一些原因,我们在这个组测试中并没有包括它们。首先,如果你使用它们中的任何一个,那么恭喜你:你不需要更换了。其次,它们都有陡峭的学习曲线,尤其是那些熟悉了桌面环境的用户:他们很更愿意投入其他有图形界面的文本编辑器。 +得益于它们的插件,使得它们足以抗衡其它的以文本为中心的应用程序,一些简单的文本编辑器甚至超出了它们的设计目标。它们能胜任一个源代码编辑器的任务,甚至就是一个集成开发环境。 + +Emacs和Vim是两款最流行和强大的纯文本编辑器。但是,由于一些原因,我们在这个测评中并没有包括它们。首先,如果你使用它们中的任何一个,那么恭喜你:你不需要更换了。其次,它们都有陡峭的学习曲线,尤其是那些熟悉了桌面环境的用户:他们很更愿意投入其他有图形界面的文本编辑器。 ### 目录: ### @@ -17,7 +18,7 @@ Emacs和Vim是两款最流行和强大的纯文本编辑器。但是,由于一 - URL:http://projects.gnome.org/gedit/ - 版本: 3.10 - 许可证: GPL -- Gnome的默认文本编辑器准备好挑战了? +- Gnome的默认文本编辑器准备好挑战了吗? #### Kate #### @@ -31,120 +32,115 @@ Emacs和Vim是两款最流行和强大的纯文本编辑器。但是,由于一 - URL: www.sublimetext.com - 版本: 2.0.2 - 许可证: Proprietary -- 在自由与黄金心脏土地上的私有软件。 +- 在自由的土地上的带有黄金般的心脏的专利软件。 #### UltraEdit #### - URL: www.ultraedit.com - 版本: 4.1.0.4 - 许可证: Proprietary -- 它做的足够多去证明它的价值了吗? +- 足够证明它的价值了吗? #### jEdit #### - URL: www.jedit.org - 版本: 5.1.0 - 许可证: GPL -- 基于Java的编辑器是否会扰乱其他编辑器的世界? +- 基于Java的编辑器是否会毁掉其他编辑器的世界? ![在展示一个有功能的应用程序和将它们所有的东西曝光给用户之间有一个很好的平衡。Geddit隐藏了它的大部分功能。](http://www.linuxvoice.com/wp-content/uploads/2014/07/gedit-web.png) -在展示一个有功能的应用程序和将它们所有的东西曝光给用户之间有一个很好的平衡。Geddit隐藏了它的大部分功能。 + +*在功能与界面之间取得了良好的平衡,Gedit将其大部分功能隐藏在背后。* ### 关键标准 ### -除了Gedit和jEdit以外的所有工具,都是通过推荐的安装方法安装在Fedora和Ubuntu上。前者已经兼容默认的Gnome桌面,后者仍然固执地反对安装在Fedora上。由于这些是相对简单的应用程序,他们没有复杂的依赖,唯一例外的是jEdit,它要求要有Oracle Java。 +除了Gedit和jEdit以外的所有工具,都是通过其推荐的安装方法安装在Fedora和Ubuntu上。前者已经兼容默认的Gnome桌面,后者仍然固执地反对安装在Fedora上。由于这些是相对简单的应用程序,他们没有复杂的依赖,唯一例外的是jEdit,它要求要有Oracle Java。 -得益于Gnome和KDE持续的努力,不论他们运行的桌面环境,所有编辑器看起来很好,功能也很正常。这不仅是作为评价的标准,也意味着你不再受制于要找到和你的桌面环境兼容的工具。 +得益于Gnome和KDE持续的努力,所有编辑器无论在哪个桌面上的外观看起来很好,功能也很正常。这不仅是作为评价的标准,也意味着你不再受制于你的桌面环境兼容的工具。 -除了它们奇特的功能,我们也对所有候选者测试了通用文本编辑功能。然而,它们并没有被设计为模仿现代字处理器的所有功能,我们也不以此评判。 +除了它们独特的功能,我们也对所有候选者测试了常规的文本编辑功能。然而,它们并没有被设计为模仿现代字处理器的所有功能,我们也不以此评判。 ![Kate能搭建为功能丰富的集成开发环境](http://www.linuxvoice.com/wp-content/uploads/2014/08/kate-web.png) -Kate能搭建为功能丰富的集成开发环境。 +*Kate能搭建为功能丰富的集成开发环境。* ### 编程语言支持 ### -UltraEdit 能进行语法高亮,代码折叠以及拥有项目管理的能力。这也有一个罗列源文件中所有函数的功能列表,但并不适用于我们任何的测试代码文件。UltraEdit也支持HTML5,有能添加常用HTML标记的HTML工具栏。 +UltraEdit 能进行语法高亮、代码折叠以及拥有项目管理的能力。也有一个罗列源文件中所有函数的功能列表,但并不适用于我们测试的任何代码文件。UltraEdit也支持HTML5,有一个能添加常用HTML标记的HTML工具栏。 -即使Gnome的默认文本编辑器Gedit,也有几个面向编码的功能特性,例如括号匹配,自动缩进以及为包括C, C++, Java, HTML, XML, Python, Perl, 以及许多其它编程语言进行语法高亮。 +即使Gnome的默认文本编辑器Gedit,也有几个面向编码的功能特性,例如括号匹配、自动缩进以及为包括C, C++, Java, HTML, XML, Python, Perl, 以及许多其它编程语言进行语法高亮。 -如果你需要更多的编程辅助,看一下Sublime和Kate。Sublime支持多种编程语言并且(正如流行的那些)能为C#, D, Dylan, Erlang, Groovy, Haskell, Lisp, Lua, MATLAB, OCaml, R, 甚至 SQL 进行语法高亮。如果这还不够,你可以下载插件以支持更多的语言。 +如果你需要更多的编程辅助功能,看一下Sublime和Kate。 -另外,它的语法高亮功能提供了多个可定制选项。这个应用程序也会进行括号匹配,确保代码段都正确,Sublime的自动补全功能也支持用户创建的变量。 +Sublime支持多种编程语言并且能为(那些流行的)C#, D, Dylan, Erlang, Groovy, Haskell, Lisp, Lua, MATLAB, OCaml, R, 甚至 SQL 进行语法高亮。如果这还不够,你可以下载插件以支持更多的语言。另外,它的语法高亮功能提供了多个可定制选项。这个应用程序也会进行括号匹配,确保代码段都正确,Sublime的自动补全功能也支持用户创建的变量。就像Komodo IDE,Sublime也可以显示一个全部源代码的滚动预览图,这对于长代码文件导航和在文件中的不同部分跳转很方便。Sublime最好的功能之一就是能在编辑器内部运行特定语言,例如C++, Python, Ruby等的代码,当然假设在你的电脑上安装有编译器以及其它系统工具。省时间而且不用再开终端. -正如Komodo IDE,Sublime也可滚动浏览显示完整的代码,这对于长代码文件导航和在文件中的不同部分跳转很方便。 +你也可以用插件在Kate中开启构建系统功能。另外,你可以为GDB调试器添加一个简单的前端。Kate能和Git,Subversion以及Mercurial版本控制系统一起工作,也提供了一些项目管理的功能。除了能为超过180种语言进行语法高亮,它支持所有的这些辅助功能,例如括号匹配,自动补全和自动缩进。它也支持代码折叠,甚至在一个程序中折叠函数。 -Sublime最好的功能之一就是能在编辑器内部为特定语言,例如C++, Python, Ruby等运行代码,当然假设在你的电脑上安装有编译器以及其它系统工具。省时间而且不用再开终端. +唯一的遗憾的是jEdit,它声称自己是一个程序员的文本编辑器,但它缺少其他的基本功能,例如代码折叠,它甚至不能提示或者补全函数. -你也可以用插件在Kate中开启构建系统功能。另外,你可以为GDB调试器添加一个简单的前端。Kate能和Git,Subversion以及Mercurial版本控制系统一起工作,也提供了一些项目管理的功能。 +**评分:** -除了能为超过180中语言进行语法高亮,它支持所有的这些辅助功能,例如括号匹配,自动补全和自动缩进。它也支持代码折叠,甚至在一个程序中折叠函数。 +- Gedit:3/5 +- Kate:5/5 +- Sublime:5/5 +- UltraEdit:3/5 +- jEdit:1/5 -唯一的遗憾的是jEdit,它声称自己是一个程序员的文本编辑器,但它缺少其他的基本功能,例如代码折叠,它甚至不能提示或者不全函数. +![如果你不喜欢Sublime的Charcoal外观,你可以选择它包含的其它22种主题。](http://www.linuxvoice.com/wp-content/uploads/2014/08/sublime-web.png) -**评分:** - -- Gedit:3/5 -- Kate:5/5 -- Sublime:5/5 -- UltraEdit3/5 -- jEdit:1/5 - -![如果你不喜欢Sublime的Charcoal外观,你可以选择它包含的其它22中主题。](http://www.linuxvoice.com/wp-content/uploads/2014/08/sublime-web.png) - -如果你不喜欢Sublime的Charcoal外观,你可以选择它包含的其它22中主题。 +*如果你不喜欢Sublime的Charcoal外观,你可以选择它包含的其它22种主题。* ### 键盘控制 ### -高级文本编辑器用户希望能完全通过键盘控制和操作,一些应用程序甚至运行他们的用户自定义快捷方式的键盘绑定。 +高级文本编辑器的用户希望能完全通过键盘控制和操作,一些应用程序甚至支持用户自定义快捷方式的键盘绑定。 -你可以轻松的使用Gedit的扩展键盘快捷键。这里有编辑文件,为普通任务,例如对一个文档进行拼写检查,唤起工具的快捷键。你可以获取应用程序内部的一系列默认快捷键,但并没有图形化的方式去自定义它们。相似的,在Sublime中自定义键绑定,你需要修改他的XML键映射文件。Sublime由于缺少定义键盘快捷键的图形化界面而饱受批评,但长期使用的用户支持当前的基于文件的机制:这给他们更多的控制能力。 +你可以轻松的使用Gedit的扩展键盘快捷键。可以在编辑文件时通过工具的快捷键调用工具,例如对一个文档进行拼写检查。你可以看到应用程序内部的一系列默认快捷键,但并没有图形化的方式去自定义它们。相似的,在Sublime中自定义键盘绑定,你需要修改它的XML的键盘映射文件。Sublime由于缺少定义键盘快捷键的图形化界面而饱受批评,但长期使用的用户支持当前的基于文件的机制:这给了他们更多的控制能力。 -UltraEdit为它"一切都可自定义"的座右铭感到自豪,这也包括键盘快捷键。你可以自定义菜单导航的热键,以及定义你自己的访问大量函数的多键键映射。 +UltraEdit为它"一切都可自定义"的座右铭感到自豪,这也包括键盘快捷键。你可以自定义菜单导航的热键,以及定义你自己的访问大量功能的组合键映射。 除了完全可自定义的键盘快捷键以外,jEdit也有为Emacs预定义的键映射。Kate在这方面尤其令人映像深刻。它有简单可访问的自定义键绑定窗口。你可以更改默认的键,或者定义替代的键。另外,Kate也有一个能使用户使用Vi键操作Kate的Vi模式。 -**Verdict:** +**评分:** -- Gedit:2/5 -- Kate:5/5 -- Sublime:3/5 -- UltraEdit:4/5 -- jEdit:5/5 +- Gedit:2/5 +- Kate:5/5 +- Sublime:3/5 +- UltraEdit:4/5 +- jEdit:5/5 ### 片段和宏 ### 宏通过自动化重复的步骤帮助你降低花费在编辑和组织数据上的时间,而代码片段通过创建可重用的源代码块为程序员扩展类似的功能。这两者都能节省你的时间。 -标准的Gedit安装没有这两种功能中的任何一种,但是你可以通过独立的插件启用这些功能。片段插件随Gedit一起发布,但在Gedit内部启用宏插件之前你需要手动下载和安装(被称为gedit-macropy,托管在GitHub上)。 +标准的Gedit安装没有这两种功能中的任何一种,但是你可以通过独立的插件启用这些功能。片段插件随Gedit一起发布,但在Gedit内启用宏插件,则需要你手动下载和安装(被称为gedit-macropy,托管在GitHub上)。 -Kate也同样通过插件的形式启用片段功能。一旦加入,插件也增加了片段的PHP,Bash和Java库。你可以在侧边栏中显示片段列表以便于访问。可以通过右击片段或者快捷键组合方式编辑它的内容。然而,令人惊讶的是,它不支持宏-尽管用户从2002年开始重复要求! +Kate也同样通过插件的形式启用片段功能。一旦加入,插件也增加了PHP,Bash和Java的片段库。你可以在侧边栏中显示片段列表以便于访问。可以通过右击片段或者快捷键组合方式编辑它的内容。然而,令人惊讶的是,它不支持宏-尽管用户从2002年就不断要求! -jEdit也有一个启用片段的插件。但是它可以从用户行为中记录宏或者你也可以在BeanShell 脚本语言(BeanShell支持像Perl和JavaScript那样将脚本对象封锁为简单的方法)中写宏。jEdit也有一个可以从jEdit的网站中下载多种宏的插件。 +jEdit也有一个启用片段的插件。它还可以从用户行为中记录宏或者你也可以用BeanShell 脚本语言(BeanShell支持像Perl和JavaScript那样将脚本对象封装为简单的方法)中写宏。jEdit也有一个可以从jEdit的网站中下载多种宏的插件。 Sublime有创建片段和宏的内建功能,也有为大多数编程语言经常使用的函数多种片段。 -在UltraEdit中片段被称为智能模板,正如Sublime你可以根据正在编辑的源代码文件类型插入片段。要完成宏记录功能,UltraEdit还有一个基于JavaScript的集成脚本语言来完成自动任务。你也可以从编辑器的网站中下载用户提交的宏和脚本。 +在UltraEdit中片段被称为智能模板,就像Sublime中一样,你可以根据正在编辑的源代码文件类型插入片段。要完成宏记录功能,UltraEdit还有集成了一个基于JavaScript的脚本语言引擎来完成自动任务。你也可以从该编辑器的网站中下载用户提交的宏和脚本。 -**Verdict:** +**评分:** -- Gedit:3/5 -- Kate:1/5 -- Sublime:5/5 -- UltraEdit:5/5 -- jEdit:5/5 +- Gedit:3/5 +- Kate:1/5 +- Sublime:5/5 +- UltraEdit:5/5 +- jEdit:5/5 -![UltraEdit的用户界面是高度可配置的 — 你可以正如改变其它许多方面那样简单的自定义工具栏和菜单的布局。](http://www.linuxvoice.com/wp-content/uploads/2014/08/ultraedit-web.png) +![UltraEdit的用户界面是高度可配置的 — 你可以像改变其它许多方面那样简单的自定义工具栏和菜单的布局。](http://www.linuxvoice.com/wp-content/uploads/2014/08/ultraedit-web.png) -UltraEdit的用户界面是高度可配置的 — 你可以正如改变其它许多方面那样简单的自定义工具栏和菜单的布局。] +*UltraEdit的用户界面是高度可配置的 — 你可以像改变其它许多方面那样简单的自定义工具栏和菜单的布局。* ### 易用性 ### -不像一个准系统文本编辑器,文本编辑器的这个功能洋溢着适应大范围用户的功能 - 从文档写作者到程序员。从应用程序剥离相反,他们的开发者在寻找添加更多功能的途径。 +不像那些简陋的文本编辑器,这些文本编辑器在这方面可以适应从文档写作者到程序员的各种用户的需要。与精简应用程序相反,他们的开发者在寻找添加更多功能的途径。 -尽管第一眼看上去这次组测试中的大部分应用有一个很相似的布局,经过仔细的检查,你会发现一些可用性差异。我们通过用户界面的合理使用来介绍它们的功能和特性,而不是铺天盖地地告诉读者。 +尽管第一眼看上去这次测评中的大部分应用有一个很相似的布局,经过仔细的检查,你会发现一些可用性的差异。我们通过用户界面的合理使用来介绍它们的功能和特性,而不是铺天盖地地告诉读者。 -### Gedit: 4/5 ### +#### Gedit: 4/5 #### Gedit有很普通的外观。通过最小化菜单和按钮有一个简单的界面。但这也是一种双刃剑,因为有些用户可能不会发现它真正的潜能。 @@ -152,21 +148,19 @@ Gedit可以通过在窗口中能重排和移动的选项卡打开多个文件。 为了适配Gnome,在应用程序的最后一个版本中考虑了大量的用户界面。然而它还并不稳定,尽管包括了所有的功能,和菜单交互的一些插件还需要升级。 -### Kate: 5/5 ### +#### Kate: 5/5 #### 尽管用户界面的主要部分和Gedit的相似,Kate可以在两边显示选项卡并且它的菜单更加丰富。该应用程序平易近人,让用户可以挖掘其它功能。 Kate可以在KDE的KIO支持的所有协议上透明地打开和保存文件,包括HTTP, FTP, SSH, SMB 和 WebDAV。你可以用这个应用同时处理多个文件。但不同于大部分应用程序传统的水平选项卡选择栏,Kate在屏幕的两个方向都有选项卡。左侧的侧边栏显示打开文件的索引。需要同时查看一个文件不同部分的程序员也会感激它可以水平或者竖直分隔界面的能力。 -### Sublime: 5/5 ### - +#### Sublime: 5/5 #### Sublime支持你在不同方式同时查看多达四个文件。当你在zone下,这里也有一个只显示文件和菜单的全屏模式。 这个编辑器还在右边有个小地图,这在长文件中导航非常有用。应用程序为多种编程语言提供多种流行功能的片段,这使得它对于开发者非常有用。另一个精巧的功能是,无论你使用都是文本文档或者代码,都可以交换和随机选择。 -### UltraEdit: 3/5 ### - +#### UltraEdit: 3/5 #### UltraEdit在界面的顶部和底部加载了多种工具栏。由于有在文档中跳转的选项卡,两边的面板,以及复杂区别,使得只剩下一点空间给编辑窗口。 @@ -174,7 +168,7 @@ UltraEdit在界面的顶部和底部加载了多种工具栏。由于有在文 使用应用程序的Preference窗口,你可以调整应用程序的多个方面,包括颜色主题和类似语法高亮的其它功能。 -### jEdit: 3/5 ### +#### jEdit: 3/5 #### 在可用性方面,首先一个不好就是jEdit不能在基于RPM的发行版上安装。导航编辑器需要一些时间来适应,因为它的菜单和其它流行的应用程序顺序不同,而且有些普通桌面用户不熟悉的名字。但是,该应用程序有详细的内部帮助,这有利于缓解学习曲线。 From 883effa6d3c6d3366a93e1bb6440ab00a03c5da0 Mon Sep 17 00:00:00 2001 From: wxy Date: Mon, 25 May 2015 14:35:17 +0800 Subject: [PATCH 153/965] PUB:20140804 Group Test--Linux Text Editors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @ictlyh 这篇口语化太多了,翻译不易,我也只能初步校对,想必还有不少不尽如人意的地方。 --- ...20140804 Group Test--Linux Text Editors.md | 146 +++++++++--------- 1 file changed, 76 insertions(+), 70 deletions(-) rename {translated/share => published}/20140804 Group Test--Linux Text Editors.md (65%) diff --git a/translated/share/20140804 Group Test--Linux Text Editors.md b/published/20140804 Group Test--Linux Text Editors.md similarity index 65% rename from translated/share/20140804 Group Test--Linux Text Editors.md rename to published/20140804 Group Test--Linux Text Editors.md index 5400d1b935..66b271bcf4 100644 --- a/translated/share/20140804 Group Test--Linux Text Editors.md +++ b/published/20140804 Group Test--Linux Text Editors.md @@ -48,9 +48,6 @@ Emacs和Vim是两款最流行和强大的纯文本编辑器。但是,由于一 - 许可证: GPL - 基于Java的编辑器是否会毁掉其他编辑器的世界? -![在展示一个有功能的应用程序和将它们所有的东西曝光给用户之间有一个很好的平衡。Geddit隐藏了它的大部分功能。](http://www.linuxvoice.com/wp-content/uploads/2014/07/gedit-web.png) - -*在功能与界面之间取得了良好的平衡,Gedit将其大部分功能隐藏在背后。* ### 关键标准 ### @@ -60,9 +57,6 @@ Emacs和Vim是两款最流行和强大的纯文本编辑器。但是,由于一 除了它们独特的功能,我们也对所有候选者测试了常规的文本编辑功能。然而,它们并没有被设计为模仿现代字处理器的所有功能,我们也不以此评判。 -![Kate能搭建为功能丰富的集成开发环境](http://www.linuxvoice.com/wp-content/uploads/2014/08/kate-web.png) - -*Kate能搭建为功能丰富的集成开发环境。* ### 编程语言支持 ### @@ -86,9 +80,6 @@ Sublime支持多种编程语言并且能为(那些流行的)C#, D, Dylan, Erlang - UltraEdit:3/5 - jEdit:1/5 -![如果你不喜欢Sublime的Charcoal外观,你可以选择它包含的其它22种主题。](http://www.linuxvoice.com/wp-content/uploads/2014/08/sublime-web.png) - -*如果你不喜欢Sublime的Charcoal外观,你可以选择它包含的其它22种主题。* ### 键盘控制 ### @@ -130,9 +121,6 @@ Sublime有创建片段和宏的内建功能,也有为大多数编程语言经 - UltraEdit:5/5 - jEdit:5/5 -![UltraEdit的用户界面是高度可配置的 — 你可以像改变其它许多方面那样简单的自定义工具栏和菜单的布局。](http://www.linuxvoice.com/wp-content/uploads/2014/08/ultraedit-web.png) - -*UltraEdit的用户界面是高度可配置的 — 你可以像改变其它许多方面那样简单的自定义工具栏和菜单的布局。* ### 易用性 ### @@ -142,91 +130,107 @@ Sublime有创建片段和宏的内建功能,也有为大多数编程语言经 #### Gedit: 4/5 #### -Gedit有很普通的外观。通过最小化菜单和按钮有一个简单的界面。但这也是一种双刃剑,因为有些用户可能不会发现它真正的潜能。 +Gedit的外观很普通,它有一个带有很少的菜单和按钮的简单界面。这是一把双刃剑,因为有些用户可能不会发现它真正的潜能。 -Gedit可以通过在窗口中能重排和移动的选项卡打开多个文件。用户可以通过使用一个插件选择性地启用旁边或者底部用来显示文件浏览和工具输出的面板。这个应用程序会检测到被其它应用程序更改的文件并可以重新加载这个文件。 +Gedit可以在选项卡中打开多个文件,这些选项卡可以重排和在多个 Gedit窗口之间移动。用户可以选择通过插件来启用侧边栏来浏览文件或者在底部面板显示工具输出内容。这个应用程序会检测到被其它应用程序更改的文件并可以重新加载该文件。 -为了适配Gnome,在应用程序的最后一个版本中考虑了大量的用户界面。然而它还并不稳定,尽管包括了所有的功能,和菜单交互的一些插件还需要升级。 +为了适配Gnome,在应用程序的最新版本中做了大量的 UI 修改。然而修改还还不稳定,尽管包括了所有的功能,但是菜单交互的一些插件还需要升级。 + +![在展示一个有功能的应用程序和将它们所有的东西曝光给用户之间有一个很好的平衡。Geddit隐藏了它的大部分功能。](http://www.linuxvoice.com/wp-content/uploads/2014/07/gedit-web.png) + +*在功能与界面之间取得了良好的平衡,Gedit将其大部分功能隐藏在背后。* #### Kate: 5/5 #### -尽管用户界面的主要部分和Gedit的相似,Kate可以在两边显示选项卡并且它的菜单更加丰富。该应用程序平易近人,让用户可以挖掘其它功能。 +尽管用户界面的主要部分和Gedit相似,Kate可以在两边显示选项卡并且它的菜单更加丰富。该应用程序平易近人,吸引用户来挖掘它的其它功能。 -Kate可以在KDE的KIO支持的所有协议上透明地打开和保存文件,包括HTTP, FTP, SSH, SMB 和 WebDAV。你可以用这个应用同时处理多个文件。但不同于大部分应用程序传统的水平选项卡选择栏,Kate在屏幕的两个方向都有选项卡。左侧的侧边栏显示打开文件的索引。需要同时查看一个文件不同部分的程序员也会感激它可以水平或者竖直分隔界面的能力。 +Kate可以在KDE的KIO支持的所有协议上透明地打开和保存文件,包括通过HTTP, FTP, SSH, SMB 和 WebDAV。你可以用这个应用同时处理多个文件。但不同于大部分应用程序传统的水平选项卡选择栏,Kate在屏幕的两个方向都有选项卡。左侧的侧边栏显示打开的文件列表。需要同时查看一个文件不同部分的程序员也会感激它可以水平或者竖直分隔界面的能力。 + +![Kate能搭建为功能丰富的集成开发环境](http://www.linuxvoice.com/wp-content/uploads/2014/08/kate-web.png) + +*Kate能搭建为功能丰富的集成开发环境。* #### Sublime: 5/5 #### -Sublime支持你在不同方式同时查看多达四个文件。当你在zone下,这里也有一个只显示文件和菜单的全屏模式。 +Sublime支持你在不同方式同时查看多达四个文件。当你在集中精力编程时,它也有一个只显示文件和菜单的全屏无扰模式。 -这个编辑器还在右边有个小地图,这在长文件中导航非常有用。应用程序为多种编程语言提供多种流行功能的片段,这使得它对于开发者非常有用。另一个精巧的功能是,无论你使用都是文本文档或者代码,都可以交换和随机选择。 +这个编辑器还在右边有个缩略地图,这在长文件中导航非常有用。应用程序为多种编程语言提供多种常用函数的片段,这使得它对于开发者非常有用。另一个精巧的功能是,无论你使用都是文本文档或者代码,都可以任意选择和替换。 + +![如果你不喜欢Sublime的Charcoal外观,你可以选择它包含的其它22种主题。](http://www.linuxvoice.com/wp-content/uploads/2014/08/sublime-web.png) + +*如果你不喜欢Sublime的Charcoal外观,你可以选择它包含的其它22种主题。* #### UltraEdit: 3/5 #### -UltraEdit在界面的顶部和底部加载了多种工具栏。由于有在文档中跳转的选项卡,两边的面板,以及复杂区别,使得只剩下一点空间给编辑窗口。 +UltraEdit在界面的顶部和底部加载了多种工具栏。加上切换文档的选项卡、两边的面板,以及分隔区域,使得只剩下一点空间给编辑窗口。 使用HTML的网络开发者有很多唾手可得的帮助。你可以通过FTP和SFTP访问远程文件。高级功能,例如记录一个宏以及比较文件,也简单易用。 -使用应用程序的Preference窗口,你可以调整应用程序的多个方面,包括颜色主题和类似语法高亮的其它功能。 +使用应用程序的偏好设置窗口,你可以调整应用程序的多个方面,包括颜色主题和类似语法高亮的其它功能。 + +![UltraEdit的用户界面是高度可配置的 — 你可以像改变其它许多方面那样简单的自定义工具栏和菜单的布局。](http://www.linuxvoice.com/wp-content/uploads/2014/08/ultraedit-web.png) + +*UltraEdit的用户界面是高度可配置的 — 你可以像改变其它许多方面那样简单的自定义工具栏和菜单的布局。* #### jEdit: 3/5 #### 在可用性方面,首先一个不好就是jEdit不能在基于RPM的发行版上安装。导航编辑器需要一些时间来适应,因为它的菜单和其它流行的应用程序顺序不同,而且有些普通桌面用户不熟悉的名字。但是,该应用程序有详细的内部帮助,这有利于缓解学习曲线。 -jEdit高亮你所在的当前行,并使你能一多种查看方式分隔窗口。你可以简单地从应用程序中安装和管理插件,除了全宏,jEdit也支持你记录快速临时的宏。 +jEdit会高亮你所在的当前行,并使你能以多种查看方式分隔窗口。你可以简单地从应用程序中安装和管理插件,除了使用完整的宏,jEdit也支持你快速记录一个临时的宏。 ![由于它的Java基础,jEdit在任何桌面环境中都不能给人宾至如归的感觉](http://www.linuxvoice.com/wp-content/uploads/2014/08/jedit-web.png) -由于它的Java基础,jEdit在任何桌面环境中都不能给人宾至如归的感觉 +*由于它的Java基础,jEdit在任何桌面环境中都不能给人宾至如归的感觉* ### 可用性和支持 ### -在Gedit和Kate之间有很多相似性。两个应用程序都得益于他们各自的父项目,Gnome和KDE,并绑定在各种主流的发行版中。另外两个项目都是交叉平台的,有Windows和Mac OS X版本以及本来的Linux版本。 +在Gedit和Kate之间有很多相似性。两个应用程序都得益于他们各自的父项目,Gnome和KDE,捆绑在各种主流的发行版中。另外两个项目都是跨平台的,有Windows和Mac OS X版本以及原生的Linux版本。 -Gedit托管在Gnome的网络设施上并有一个简单的用户指南,关于多种插件的信息,以及包括邮件列表和IRC通道的常用保持联系方式。你也可以在其它基于Gnome的发行版,例如Ubuntu中找到使用信息。相似地,Kate得益于KDE的资源,并包括详细的用户信息以及邮件列表和IRC通道。你也可以从应用程序中获取相应的离线用户指南。 +Gedit托管在Gnome的网站上,并有一个简单的用户指南、关于多种插件的信息,以及包括邮件列表和IRC通道在内的常用联系方式。你也可以在其它基于Gnome的发行版,例如Ubuntu中找到使用信息。相似地,Kate得益于KDE的资源,并包括详细的用户信息以及邮件列表和IRC通道。你也可以从应用程序中获取相应的离线用户指南。 -除了Linux,UltraEdit在Windows和Mac OS X中也可用,虽然在应用程序中并没有包括,但在启动时也有详细的用户指南。为了辅助用户,UltraEdit保存了一个常见问题的数据库,一系列关于多种特定功能的详细信息的有用提示,用户还可以在论坛版块彼此帮助。另外,付费用户也可以通过邮件从开发者中获取支持。 +除了Linux,UltraEdit在Windows和Mac OS X中也可用,虽然在应用程序中并没有包括,但在启动时也有详细的用户指南。为了辅助用户的使用,UltraEdit保存了一个常见问题的数据库,一系列关于多种特定功能的详细介绍,用户还可以在论坛版块彼此帮助。另外,付费用户也可以通过邮件从开发者中获取支持。 -Sublime支持相同数目的平台,但是你需要单独为每种平台购买许可证。开发者通过博客使用户了解正在进行的开发,并积极参加了主持论坛。这个项目支持设施的亮点是提供免费的详细教程和视频课程。Sublime非常可爱。 +Sublime支持一样多的平台,但是你需要单独为每种平台购买许可证。开发者通过博客让用户了解正在进行的开发,并积极参加它的论坛。这个项目支持设施的亮点是提供免费的详细教程和视频课程。Sublime非常漂亮。 -由于是用java编写的,jEdit在多种平台中都可用。在它的网站上你可以找到一个详细的用户指南以及一些插件帮助文档的链接。然而,这里没有能使用户和其他用户或者开发者交流的途径。 +由于jEdit是用java编写的,所以它在多种平台中都可用。在它的网站上你可以找到一个详细的用户指南以及一些插件帮助文档的链接。然而,这里没有能使用户和其他用户或者开发者交流的途径。 -**判定:** +**评分:** -- Gedit: 4/5 -- Kate: 4/5 -- Sublime: 5/5 -- UltraEdit: 3/5 -- jEdit: 2/5 +- Gedit:4/5 +- Kate:4/5 +- Sublime:5/5 +- UltraEdit:3/5 +- jEdit:2/5 -### 附加和插件 ### +### 附加组件和插件 ### 不同的用户有不同的需求,一个简单的轻量级应用程序只能做到这么多。这就是为什么需要插件的原因。应用程序依赖于这些小部件来扩展它们的功能集并让更多的用户使用。 -UltraEdit是一个另外。它没有第三方插件,但开发者确实支出了例如HtmlTidy的第三方工具已经安装到了UltraEdit。 +UltraEdit是一个例外。它没有第三方插件,但开发者将例如HtmlTidy这样的第三方工具集成到了UltraEdit。 -Gedit附带了好多已安装的插件,你可以从gedit-插件包下载更多的插件。基于和Gedit版本的兼容性,项目网站也有到多个第三方插件的链接。 +Gedit附带了好多已安装的插件,你可以下载更多的更多gedit插件包。基于和Gedit版本的兼容性,项目网站也有到多个第三方插件的链接。 -三个对程序员非常有用的插件是Code Comment,在底部面板增加一个终端的Terminal Plugin以及Session Saver。当你用多个文件开发项目的时候Session Saver相当有用。你可以在选项卡中打开文件,保存会话,当你用一个单击回复的时候,可以按照你保存时的选项卡顺序打开所有的文件。 +三个对程序员非常有用的插件是:Code Comment、在底部面板增加一个终端的Terminal Plugin以及Session Saver。当你用多个文件开发项目的时候Session Saver相当有用。你可以在选项卡中打开文件,保存会话,你可以用一键恢复,就可以按照你保存时的选项卡顺序打开所有的文件。 -类似的,你可以通过用内部的插件管理器增加插件来扩展Kate。除了令人映像深刻的项目插件,一些开发者使用的插件包括嵌入式终端,能编译和调试代码,以及对数据库执行SQL查询。 +类似的,你可以通过用内部的插件管理器增加插件来扩展Kate。除了令人映像深刻的项目插件,一些开发者使用的插件包括嵌入式终端,它能编译和调试代码,以及对数据库执行SQL查询。 -Sublime的插件是用Python写的,文本编辑器包括了一个类似于apt-get,能使用户查找,安装,升级和移除插件包的名为Package Control的工具。通过插件,你可以在Sublime中使用Git版本控制,以及改进JavaScript的JSLint工具。Sublime Linter能指出你代码中的错误,是编码人员必备的插件。 +Sublime的插件是用Python写的,文本编辑器包括了一个类似于apt-get,能使用户查找,安装,升级和移除插件包的名为Package Control的工具。通过插件,你可以在Sublime中使用Git版本控制,以及美化JavaScript代码的JSLint工具。Sublime Linter能指出你代码中的错误,是编码人员必备的插件。 -jEdit拥有最令人映像深刻的插件设施。该应用有超过200个插件,可以在它们自己的专用网站中浏览。网站通过不同的类型列举了插件,例如文件管理,版本控制,文本等。你可以在每个类型下找到很多的插件。 +jEdit拥有最令人印象深刻的插件设施。该应用有超过200个插件,可以在它们自己的专用网站中浏览。网站通过不同的类型列出了插件,例如文件管理,版本控制,文本等。你可以在每个类型下找到很多的插件。 一些最好的插件是Android插件,它们提供了和Android项目协同工作的工具;你可以使用TomcatSwitch插件创建和控制外部Jakarta Tomcat服务器进程;以及类似于Vi功能的Vimulator插件。你可以通过使用jEdit的插件管理器安装这些插件。 -**评定** +**评分:** -- Gedit: 3/5 -- Kate: 4/5 -- Sublime: 4/5 -- UltraEdit: 1/5 -- jEdit: 5/5 +- Gedit:3/5 +- Kate:4/5 +- Sublime:4/5 +- UltraEdit:1/5 +- jEdit:5/5 ### 纯文本编辑 ### -尽管它们强大的额外功能甚至可能会取代几个流派完全成熟的应用程序,有时候可能只需要使用这些庞大的文本编辑器读写或者编辑简单的纯文本。虽然你可以使用它们中的任何一个输入文本,我们通过普通文本编辑的方便性评价它们。 +尽管它们强大的额外功能甚至可能会取代几种完全成熟的应用程序,有时候可能只需要使用这些庞大的文本编辑器读、写或者编辑简单的纯文本。虽然你可以使用它们中的任何一个输入文本,我们通过普通文本编辑的方便性评价它们。 Gnome的默认文本编辑器Gedit,支持取消和重做机制以及搜索和替换。它可以对多种语言进行拼写检查,并能通过使用Gnome GVFS库访问和编辑远程文件。 @@ -234,44 +238,46 @@ Gnome的默认文本编辑器Gedit,支持取消和重做机制以及搜索和 Sublime有很多可选择的编辑命令,例如缩进文本和格式化段落。它的自动保存功能帮助防止用户丢失他们的更改。高级用户还会喜欢基于正则表达式的递归查找和替换功能,以及选择多个不连续的文本块并执行统一操作。 -UltraEdit也允许用户在查找和替换功能中使用正则表示,并能通过FTP编辑远程文件。JEdit一个独特的功能是它支持被称为寄存器的不限数目的剪切板。你可以复制文本片段到这些寄存器中,在编辑会话过程中都可用。 +UltraEdit也允许用户在查找和替换功能中使用正则表达式,并能通过FTP编辑远程文件。 -**评定:** +JEdit一个独特的功能是它支持被称为寄存器的不限数目的剪切板。你可以复制文本片段到这些寄存器中,在编辑会话过程中都可用。 -- Gedit: 4/5 -- Kate: 5/5 -- Sublime: 5/5 -- UltraEdit: 4/5 -- jEdit: 4/5 +**评分:** + +- Gedit:4/5 +- Kate:5/5 +- Sublime:5/5 +- UltraEdit:4/5 +- jEdit:4/5 ### 我们的评比 ### -在这里的所有编辑器都足以替换你已有的文本编辑器去用来编辑文本和调整配置文件。事实上,没准它们会组合起来作为你的集成开发环境。这些应用程序都有各种各样功能,它们的开发者不会考虑剥离功能,而是增加越来越多的功能。 +在这里的所有编辑器都足以替换你已有的文本编辑器,来编辑文本和调整配置文件。事实上,没准它们会组合起来作为你的集成开发环境。这些应用程序都有各种各样功能,它们的开发者不会考虑剥离功能,而是增加越来越多的功能。 -jEdit排在这次测试的最后面。因为它不仅坚持使用专有的Oracle Java运行环境,不能在你的Fedora机器上安装,而且开发者不积极的和用户交互。 +jEdit排在这次测试的最后面。因为它不仅坚持使用专有的Oracle Java运行时环境,不能在你的Fedora机器上安装,而且开发者并不积极和用户交互。 -UltraEdit做的稍微好一点。这个商业专用工具专注于网络开发者,不为非开发者高级用户提供任何功能,使得它不值得推荐为免费软件的替代品。 +UltraEdit做的稍微好一点。这个商业专用工具专注于网络开发者,不为非开发者的高级用户提供任何功能,使得它不值得推荐为免费软件的替代品。 -排在第三的是Gedit。作为Gnome的默认编辑器,它没有任何内在的错误,但尽管有很多积极的方面,它还是略微被Sublime和Kate超越。开诚布公地说,Kate是比Gedit更通用的编辑器,甚至考虑到他们的插件系统,评分也优于Gnome的默认编辑器。 +排在第三的是Gedit。作为Gnome的默认编辑器,它没有任何内在的问题,但尽管有很多积极的方面,它还是略微被Sublime和Kate超越。开诚布公地说,Kate是比Gedit更通用的编辑器,甚至考虑到他们的插件系统,评分也优于Gnome的默认编辑器。 -Sublime和Kate都相当好。他们在我们的大多数测试中表现同样出色。由于不支持宏而落后于Sublime,但键盘友好和能简单定义自定义键绑定又使Kate找回优势。 +Sublime和Kate都相当好。他们在我们的大多数测试中表现同样出色。Kate由于不支持宏而落后于Sublime,但键盘友好和能简单定义自定义键绑定又使Kate找回优势。 -Kate成功的原因可以归结为它通过最小化学习曲线提供了最大化数目的功能。尽量使用它吧,不仅作为简单文本编辑器使用,或者容易使用语法高亮编辑配置文件,甚至得益于项目管理能力能使用它协作一个复杂的编程项目。 +Kate成功的原因可以归结为它通过最小化学习曲线提供了最大化的功能。尽管使用它吧,不仅作为简单文本编辑器使用,或者容易使用语法高亮编辑配置文件,甚至得益于其项目管理能力能使用它协作一个复杂的编程项目。 -我们不是选择Kate去替换一个类似[在这里插入你最喜欢的专业工具]的全面的集成开发环境。但是它是一个专业工具理想的全面的以及完美的垫脚石。 +我们不是选择Kate去替换一个类似“[XX,在这里插入你最喜欢的专业工具]”的全面的集成开发环境。但是它是一个专业工具理想的、全面的、以及完美的垫脚石。 Kate为能快速响应你的需要而设计,它的界面并不会使你茫然,并且和那些过于复杂的应用一样的有用。 - + ### 1st Kate ### - Licence LGPL/GPL Version 3.11 - www.kate-editor.org -- 拥有超能力,最终温和的文本编辑器。 +- 拥有超能力,态度温和的文本编辑器。 - Kate是KDE项目中最有用的应用程序之一。 ### 2nd Sublime Text ### -- Licence Proprietary Version 2.0.2 +- Licence 专利 Version 2.0.2 - www.sublimetext.com - 值得你每分钱的专业文本编辑器 - 简单易用,功能全面而且看起来很棒。 @@ -279,13 +285,13 @@ Kate为能快速响应你的需要而设计,它的界面并不会使你茫然 - Licence GPL Version 3.10 - http://projects.gnome.org/gedit -- 从Gnome中完成。这是一个奇妙的文本编辑器,确实令人钦佩的工作,但这里的竞争实在太大了。 +- 在Gnome中就用它吧。这是一个奇妙的文本编辑器,确实令人钦佩的工作,但这里的竞争实在太大了。 ### 4th UltraEdit ### - Licence Proprietary Version 4.1.0.4 - www.ultraedit.com -- 关注于为网络开发者绑定便利,而不为普通用户提供任何特殊功能。 +- 关注于为网络开发者提供各种便利,而不为普通用户提供任何特殊功能。 ### 5th jEdit ### @@ -297,9 +303,9 @@ Kate为能快速响应你的需要而设计,它的界面并不会使你茫然 随你发行版发布的默认文本编辑器也能帮助你一些高级任务。例如KDE的KWrite和Raspbian的Nano。得益于KDE的katepart组件,KWrite继承了一些Kate的功能,得益于在树莓派上的可用性,Nano也开始重现风头。 -如果你希望跟随Linux大师的脚步,你总是可以尝试崇高的文本编辑机Emacs和Vim。想尝试Vim强大的用户首先可以考虑gVim,它通过图形界面展现了Vim的强大。 +如果你希望跟随Linux大师的脚步,你总是可以尝试高大上的文本编辑器Emacs和Vim。想尝试Vim强大的用户首先可以考虑gVim,它通过图形界面展现了Vim的强大。 -除了jEdit和Kate,这里还有其他模仿例如Emacs和Vim之类的老派高级编辑器的编辑器,比如JED 编辑器和Joe's Own Editor,这两者都有Emacs的模拟模式。另一方面,如果你在寻找轻量级的代码编辑器,可以看看Bluefish和Geany。他们的存在是为了填补文本编辑器和全面集成的开发平台之间的空隙。 +除了jEdit和Kate,这里还有其他模仿Emacs和Vim之类的旧式高级编辑器的编辑器,比如JED 编辑器和Joe's Own Editor,这两者都有Emacs的模拟模式。另一方面,如果你在寻找轻量级的代码编辑器,可以看看Bluefish和Geany。他们的存在是为了填补文本编辑器和全面集成的开发平台之间的空隙。 -------------------------------------------------------------------------------- @@ -307,7 +313,7 @@ via: http://www.linuxvoice.com/text-editors/ 作者:[Ben Everard][a] 译者:[ictlyh](https://github.com/ictlyh) -校对:[royaso](https://github.com/royaso) +校对:[royaso](https://github.com/royaso),[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 From aa40f785bf0abd8ac4fdab0c9efbc3838af6e11f Mon Sep 17 00:00:00 2001 From: DeadFire Date: Mon, 25 May 2015 16:42:16 +0800 Subject: [PATCH 154/965] =?UTF-8?q?20150525-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...onitoring Tool Installation Screenshots.md | 188 ++++++++++++++++++ 1 file changed, 188 insertions(+) create mode 100644 sources/tech/20150525 Linux ntopng--Network Monitoring Tool Installation Screenshots.md diff --git a/sources/tech/20150525 Linux ntopng--Network Monitoring Tool Installation Screenshots.md b/sources/tech/20150525 Linux ntopng--Network Monitoring Tool Installation Screenshots.md new file mode 100644 index 0000000000..01fc6f5e68 --- /dev/null +++ b/sources/tech/20150525 Linux ntopng--Network Monitoring Tool Installation Screenshots.md @@ -0,0 +1,188 @@ +Linux ntopng - Network Monitoring Tool Installation (Screenshots) +================================================================================ +Nowdays computers are connected between each other. From the small area such as your home Local Area Network (LAN) until the the biggest one which we call - Internet. When you are managing a network computer, you are managing one of the most critical component. Since most of developed application is web based application, the network between critical. + +There is why we need a network monitoring tool. One of the best network monitoring tool is called ntop. From [Wikipedia][1] “ntop is a network probe that shows network usage in a way similar to what top does for processes. In interactive mode, it displays the networkstatus on the user's terminal. In Web mode, it acts as a web server, creating a HTML dump of the network status. It supports a NetFlow/sFlowemitter/collector, a HTTP-based client interface for creating ntop-centric monitoring applications, and RRD for persistently storing traffic statistics” + +Now after 15 years, you will find ntopng - the next generation ntop. + +### What is ntopng ### + +Ntopng is a high-speed web-based traffic analysis and flow collection. Ntopng is based from ntop. It’s run on every Unix platform, MacOS X and Windows. + +### Features ### + +From [ntopng website][2], they said there are many features of it. Here’s some of the list : + +- Sort network traffic according to many protocols +- Show network traffic and IPv4/v6 active hosts +- Store on disk persistent traffic statistics in RRD format Geolocate hosts +- Discover application protocols by leveraging on nDPI, ntop’s DPI framework +- Show IP traffic distribution among the various protocols +- Analyse IP traffic and sort it according to the source/destination +- Display IP Traffic Subnet matrix (who’s talking to who?) +- Report IP protocol usage sorted by protocol type +- Produce HTML5/AJAX network traffic statistics + +### Installation ### + +Ntop is available in pre-compiled packages for CentOS dan Ubuntu **64-bit based**. You may find the packages in [their download page][3]. For 32-bit operating system, you have to compile it from the source. This article is **tested** on **CentOS 6.4 32-bit** version. But it may works also in other version of CentOS / RedHat based Linux. Let’s start. + +#### Prerequisites #### + +#### Development Tools #### + +You have to make sure that you have all development tools which is needed to compile ntopng. To install the development tools you can use yum command : + + # yum groupinstall ‘Development Tools’ + +#### Install TCL #### + + # yum install tcl + +#### Install libpcap #### + + # yum install libpcap libcap-devel + +#### Install Redis #### + + # wget http://redis.googlecode.com/files/redis-2.6.13.tar.gz + # tar zxfv redis-2.6.13.tar.gz + # cd redis-2.6.13 + # make 32bit + # make test + # make install + +### Install ntopng ### + +#### Method 1 : #### + + # wget http://sourceforge.net/projects/ntop/files/ntopng/ntopng-1.1_6932.tgz/download + # tar zxfv ntopng-1.1_6932.tgz + # cd ntopng-1.1_6932 + # ./configure + # make + # make install + +#### Method 2 : #### + +On my CentOS 6.4 , I got an error message when using Method 1. Here’s the error message : + + ./third-party/LuaJIT-2.0.2/src/libluajit.a : could not read symbols : File in wrong format + +So I **switch** to install it using **SVN**. Internet connection is required for this installation method. Here’s the steps : + + # svn co https://svn.ntop.org/svn/ntop/trunk/ntopng/ + # ./autogen.sh + # ./configure + # make + # make install + +*Since ntopng is a web-based application, your system must have a working web-server installed* + +### Create configuration files for ntopng ### + +If everything is installed, then it’s time for us to running it. By default, redis and ntopng will installed in /usr/local/ folder if we don’t change the installation folder explicitly in ./configure step. Next we need to create configuration files for ntopng. In this article we use vi as text editor. You can use your favorite text editor to create ntopng configuration files. + + # cd /usr/local/etc + # mkdir ntopng + # cd ntopng + # vi ntopng.start + + Put these lines : + --local-network “10.0.2.0/24” + --interface 1 + + # vi ntopng.pid + + Put this line : + -G=/var/run/ntopng.pid + +Save those files and we can continue to the next step + +### Run ntopng ### + +We assume that you have installed web server correctly, then the next step is to run redis server. + + # /usr/local/bin/redis-server + +![Starting Redis Server](http://blog.linoxide.com/wp-content/uploads/2013/11/redis-server-start.png) + +Then **run** ntopng + + # /usr/local/bin/ntopng + +![Starting Ntopng](http://blog.linoxide.com/wp-content/uploads/2013/11/ntopng-start.png) + +### Testing ntopng ### + +Now you can test your ntopng application by typing [http://yourserver.name:3000][4] . You will see ntopng login page. For the first time, you can use user ‘**admin**’ and password ‘**admin**’. + +![Ntop Login page](http://blog.linoxide.com/wp-content/uploads/2013/11/ntopng_login.png) + +The dashboard is quite simple. After you logged in, you will see an information about Top Flow Talkers. + +![Ntopng Flow Talker](http://blog.linoxide.com/wp-content/uploads/2013/11/ntopng_talkers.png) + +If you click **Flows menu** on the right top, ntopng will show you more detail about Active Flows. + +![Ntopng Flows](http://blog.linoxide.com/wp-content/uploads/2013/11/ntopng_flows.png) + +On **Hosts menu**, you can see all hosts which are connected to the flows + +![Ntopng Hosts List](http://blog.linoxide.com/wp-content/uploads/2013/11/ntopng_hoslist.png) + +If you click **Hosts > Interactions**, ntop will show you a nice graphic about interaction which happen between them. + +![Ntopng Hosts Interaction](http://blog.linoxide.com/wp-content/uploads/2013/11/ntopng_hosts_interaction.png) + +**Dashboard menu** consist of : + +#### Top Hosts (Send+Receive) #### + +![Ntopng Hosts](http://blog.linoxide.com/wp-content/uploads/2013/11/ntopng_hosts.png) + +#### Top Application Protocol #### + +![Ntopng Apps](http://blog.linoxide.com/wp-content/uploads/2013/11/ntopng_apps.png) + +**Interfaces menu** will bring you more menus inside. Packets menu shows you size distribution of packets. + +![Ntopng packets](http://blog.linoxide.com/wp-content/uploads/2013/11/ntopng_packets.png) + +**Protocols menus** will give you information about how many protocols that have been used and its percentage. + +![Ntopng protocol](http://blog.linoxide.com/wp-content/uploads/2013/11/ntopng_protocol.png) + +![Ntopng protocols - detail](http://blog.linoxide.com/wp-content/uploads/2013/11/ntopng_protocol_detail.png) + +You can also see the activity by using **Historical Activity menu** + +![Ntopng Historical Activity](http://blog.linoxide.com/wp-content/uploads/2013/11/ntopng_historical.png) + +![Ntopng Historical Activity detail](http://blog.linoxide.com/wp-content/uploads/2013/11/ntopng_historical_detail.png) + +Last but not least, you can also manage the user who can access ntopng via **Settings menu** on the top right area (the one that have a gear icon). Then click **Manage Users**. + +![Ntopng Users](http://blog.linoxide.com/wp-content/uploads/2013/11/ntopng_users.png) + +Ntopng provide you with a wide range of timeframe, from every 5 minutes until 1 year. You just need to click the timeframe you want to show. The graphic itself is clickable. You can click it to zoom it. + +Of course, ntopng is more than just pictures above. You can also integrates it with GeoLocation and GeoMap services. From ntopng website it self, there are a paid modul such as nprobe to enrich the information provided by ntopng. For more detail usage of ntopng, please visit [ntopng website][5]. + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/monitoring-2/ntopng-network-monitoring-tool/ + +作者:[Pungki Arianto][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://linoxide.com/author/pungki/ +[1]:http://en.wikipedia.org/wiki/Ntop +[2]:http://www.ntop.org/products/ntop/ +[3]:http://www.nmon.net/packages/ +[4]:http://yourserver.name:3000/ +[5]:http://www.ntop.org/ \ No newline at end of file From d35cfe1fddfaaedd3212cfcb9546edee8eb46251 Mon Sep 17 00:00:00 2001 From: wwy-hust Date: Mon, 25 May 2015 20:35:31 +0800 Subject: [PATCH 155/965] finish translation of tech article '10 Amazing and Mysterious Uses of...' --- ...of Symbol or Operator in Linux Commands.md | 195 ------------------ ...of Symbol or Operator in Linux Commands.md | 193 +++++++++++++++++ 2 files changed, 193 insertions(+), 195 deletions(-) delete mode 100644 sources/tech/20150518 10 Amazing and Mysterious Uses of Symbol or Operator in Linux Commands.md create mode 100644 translated/tech/20150518 10 Amazing and Mysterious Uses of Symbol or Operator in Linux Commands.md diff --git a/sources/tech/20150518 10 Amazing and Mysterious Uses of Symbol or Operator in Linux Commands.md b/sources/tech/20150518 10 Amazing and Mysterious Uses of Symbol or Operator in Linux Commands.md deleted file mode 100644 index 16795b92e8..0000000000 --- a/sources/tech/20150518 10 Amazing and Mysterious Uses of Symbol or Operator in Linux Commands.md +++ /dev/null @@ -1,195 +0,0 @@ -translating by wwy-hust - -10 Amazing and Mysterious Uses of (!) Symbol or Operator in Linux Commands -================================================================================ -The `'!'` symbol or operator in Linux can be used as Logical Negation operator as well as to fetch commands from history with tweaks or to run previously run command with modification. All the commands below have been checked explicitly in bash Shell. Though I have not checked but a major of these won’t run in other shell. Here we go into the amazing and mysterious uses of `'!'` symbol or operator in Linux commands. - -### 1. Run a command from history by command number. ### - -You might not be aware of the fact that you can run a command from your history command (already/earlier executed commands). To get started first find the command number by running ‘history‘ command. - - $ history - -![Find Last Executed Commands with History Command](http://www.tecmint.com/wp-content/uploads/2015/05/history-Command.gif) - -Now run a command from history just by the number at which it appears, in the output of history. Say run a command that appears at number 1551 in the output of ‘history‘ command. - - $ !1551 - -![Run Last Executed Commands by Number ID](http://www.tecmint.com/wp-content/uploads/2015/05/Run-Commands-By-number.gif) - -And, it runs the command ([top command][1] in the above case), that was listed at number 1551. This way to retrieving already executed command is very helpful specially in case of those commands which are long. You just need to call it using **![Number at which it appears in the output of history command]**. - -### 2. Run previously executed command as 2nd last command, 7th last command,etc. ### - -You may run those commands which you have run previously by their running sequence being the last run command will be represented as -1, second last as -2, seventh last as -7,…. - -First run history command to get a list of last executed command. It is necessary to run history command, so that you can be sure that there is no command like `rm command > file` and others just to make sure you do not run any dangerous command accidentally. And then check Sixth last command, Eight last command and Tenth last command. - - $ history - $ !-6 - $ !-8 - $ !-10 - -![Run Last Executed Commands By Numbers](http://www.tecmint.com/wp-content/uploads/2015/05/3.gif) -Run Last Executed Commands By Numbers - -### 3. Pass arguments of last command that we run to the new command without retyping ### - -I need to list the content of directory ‘/home/$USER/Binary/firefox‘ so I fired. - - $ ls /home/$USER/Binary/firefox - -Then I realized that I should have fired ‘ls -l‘ to see which file is executable there? So should I type the whole command again! No I don’t need. I just need to carry the last argument to this new command as: - - $ ls -l !$ - -Here `!$` will carry arguments passed in last command to this new command. - -![Pass Arguments of Last Executed Command to New](http://www.tecmint.com/wp-content/uploads/2015/05/4.gif) -Pass Arguments of Last Executed Command to New - -### 4. How to handle two or more arguments using (!) ### - -Let’s say I created a text file 1.txt on the Desktop. - - $ touch /home/avi/Desktop/1.txt - -and then copy it to ‘/home/avi/Downloads‘ using complete path on either side with cp command. - - $ cp /home/avi/Desktop/1.txt /home/avi/downloads - -Now we have passed two arguments with cp command. First is ‘/home/avi/Desktop/1.txt‘ and second is ‘/home/avi/Downloads‘, lets handle them differently, just execute `echo [arguments]` to print both arguments differently. - - $ echo “1st Argument is : !^” - $ echo “2nd Argument is : !cp:2” - -Note 1st argument can be printed as `“!^”` and rest of the arguments can be printed by executing `“![Name_of_Command]:[Number_of_argument]”`. - -In the above example the first command was ‘cp‘ and 2nd argument was needed to print. Hence `“!cp:2”`, if any command say xyz is run with 5 arguments and you need to get 4th argument, you may use `“!xyz:4”`, and use it as you like. All the arguments can be accessed by `“!*”`. - -![Handle Two or More Arguments](http://www.tecmint.com/wp-content/uploads/2015/05/5.gif) -Handle Two or More Arguments - -### 5. Execute last command on the basis of keywords ### - -We can execute the last executed command on the basis of keywords. We can understand it as follows: - - $ ls /home > /dev/null [Command 1] - $ ls -l /home/avi/Desktop > /dev/null [Command 2] - $ ls -la /home/avi/Downloads > /dev/null [Command 3] - $ ls -lA /usr/bin > /dev/null [Command 4] - -Here we have used same command (ls) but with different switches and for different folders. Moreover we have sent to output of each command to ‘/dev/null‘ as we are not going to deal with the output of the command also the console remains clean. - -Now Execute last run command on the basis of keywords. - - $ ! ls [Command 1] - $ ! ls -l [Command 2] - $ ! ls -la [Command 3] - $ ! ls -lA [Command 4] - -Check the output and you will be astonished that you are running already executed commands just by `ls` keywords. - -![Run Commands Based on Keywords](http://www.tecmint.com/wp-content/uploads/2015/05/6.gif) -Run Commands Based on Keywords - -### 6. The power of !! Operator ### - -You can run/alter your last run command using `(!!)`. It will call the last run command with alter/tweak in the current command. Lets show you the scenario - -Last day I run a one-liner script to get my private IP so I run, - - $ ip addr show | grep inet | grep -v 'inet6'| grep -v '127.0.0.1' | awk '{print $2}' | cut -f1 -d/ - -Then suddenly I figured out that I need to redirect the output of the above script to a file ip.txt, so what should I do? Should I retype the whole command again and redirect the output to a file? Well an easy solution is to use `UP` navigation key and add `'> ip.txt'` to redirect the output to a file as. - - $ ip addr show | grep inet | grep -v 'inet6'| grep -v '127.0.0.1' | awk '{print $2}' | cut -f1 -d/ > ip.txt - -Thanks to the life Savior `UP` navigation key here. Now consider the below condition, the next time I run below one-liner script. - - $ ifconfig | grep "inet addr:" | awk '{print $2}' | grep -v '127.0.0.1' | cut -f2 -d: - -As soon as I run script, the bash prompt returned an error with the message `“bash: ifconfig: command not found”`, It was not difficult for me to guess I run this command as user where it should be run as root. - -So what’s the solution? It is difficult to login to root and then type the whole command again! Also (UP Navigation Key) in last example didn’t came to rescue here. So? We need to call `“!!”` without quotes, which will call the last command for that user. - - $ su -c “!!” root - -Here su is switch user which is root, `-c` is to run the specific command as the user and the most important part `!!` will be replaced by command and last run command will be substituted here. Yeah! You need to provide root password. - -![The Power of !! Key](http://www.tecmint.com/wp-content/uploads/2015/05/7.gif) -The Power of !! Key - -I make use of `!!` mostly in following scenarios, - -1. When I run apt-get command as normal user, I usually get an error saying you don’t have permission to execute. - - $ apt-get upgrade && apt-get dist-upgrade - -Opps error…don’t worry execute below command to get it successful.. - - $ su -c !! - -Same way I do for, - - $ service apache2 start - or - $ /etc/init.d/apache2 start - or - $ systemctl start apache2 - -OOPS User not authorized to carry such task, so I run.. - - $ su -c 'service apache2 start' - or - $ su -c '/etc/init.d/apache2 start' - or - $ su -c 'systemctl start apache2' - -### 7. Run a command that affects all the file except ![FILE_NAME] ### - -The `!` (Logical NOT) can be used to run the command on all the files/extension except that is behind `'!'`. - -A. Remove all the files from a directory except the one the name of which is 2.txt. - - $ rm !(2.txt) - -B. Remove all the file type from the folder except the one the extension of which is ‘pdf‘. - - $ $ rm !(*.pdf) - -### 8. Check if a directory (say /home/avi/Tecmint)exist or not? Printf if the said directory exist or not. ### - -Here we will use `'! -d'` to validate if the directory exist or not followed by Logical AND Operator `(&&)` to print that directory does not exist and Logical OR Operator `(||)` to print the directory is present. - -Logic is, when the output of `[ ! -d /home/avi/Tecmint ]` is 0, it will execute what lies beyond Logical AND else it will go to Logical OR `(||)` and execute what lies beyond Logical OR. - - $ [ ! -d /home/avi/Tecmint ] && printf '\nno such /home/avi/Tecmint directory exist\n' || printf '\n/home/avi/Tecmint directory exist\n' - -### 9. Check if a directory exist or not? If not exit the command. ### - -Similar to the above condition, but here if the desired directory doesn’t exist it will exit the command. - - $ [ ! -d /home/avi/Tecmint ] && exit - -### 10. Create a directory (say test) in your home directory if it does not exist. ### - -A general implementation in Scripting Language where if the desired directory does not exist, it will create one. - - [ ! -d /home/avi/Tecmint ] && mkdir /home/avi/Tecmint - -That’s all for now. If you know or come across any other use of `'!'` which is worth knowing, you may like to provide us with your suggestion in the feedback. Keep connected! - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/mysterious-uses-of-symbol-or-operator-in-linux-commands/ - -作者:[Avishek Kumar][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.tecmint.com/author/avishek/ -[1]:http://www.tecmint.com/12-top-command-examples-in-linux/ diff --git a/translated/tech/20150518 10 Amazing and Mysterious Uses of Symbol or Operator in Linux Commands.md b/translated/tech/20150518 10 Amazing and Mysterious Uses of Symbol or Operator in Linux Commands.md new file mode 100644 index 0000000000..4225cf9bb4 --- /dev/null +++ b/translated/tech/20150518 10 Amazing and Mysterious Uses of Symbol or Operator in Linux Commands.md @@ -0,0 +1,193 @@ +10!Linux¾˺÷ +================================================================================ +`'!'`Linuxв񶨷ţʷ¼ȡ򲻼޸ĵִ֮ǰеѾBash Shellоȷеؼ顣ûԹ඼ڱShellСǽLinuxз`'!'`Ǿ˺÷ + +### 1. ʹִʷбһִ ### + +ҲûʶԴʷб֮ǰѾִеҳһСȣͨ"history"֮ǰš + + $ history + +![ʹhistoryҵִе](http://www.tecmint.com/wp-content/uploads/2015/05/history-Command.gif) + +ڣֻҪʹʷʾڸǰֱ磬һ`history`б1551 + + $ !1551 + +![ʹIDִе](http://www.tecmint.com/wp-content/uploads/2015/05/Run-Commands-By-number.gif) + +Ϊ1551[top][1]ˡͨIDִ֮ǰķʽãЩܳ¡ֻҪʹ**![history]**Ե + +### 2. ֮ǰĵڶ߸ ### + +һַʽ֮ǰִеͨʹ-1-2ڶ-7߸ȡ + +ʹhistoryִйбhistoryִкбҪΪͨȷû`rm command > file`ᵼΣյִеڰ˸ʮ + + $ history + $ !-6 + $ !-8 + $ !-10 + +![֮ͨǰִе](http://www.tecmint.com/wp-content/uploads/2015/05/3.gif) +֮ͨǰִе + +### 3. ݲԷµ ### + +Ҫʾ`/home/$USER/Binary/firefox`ļеݣִУ + + $ ls /home/$USER/Binary/firefox + +ʶӦִ'ls -l'鿴ĸļǿִļӦôҲҪҽҪµдIJƣ + + $ ls -l !$ + +`!$`ִеIJݵµС + +![һIJݸ](http://www.tecmint.com/wp-content/uploads/2015/05/4.gif) +һIJݸ + +### 4. ʹ!IJ ### + +˵洴һıļfile1.txt + + $ touch /home/avi/Desktop/1.txt + +Ȼcpʹþ·`/home/avi/Downloads` + + $ cp /home/avi/Desktop/1.txt /home/avi/downloads + +ڣǸcpһ`/home/avi/Desktop/1.txt`ڶ`/home/avi/Downloads`Ƿֱǣʹ`echo [arguments]`ӡͬIJ + + $ echo "1st Argument is : !^" + $ echo "2nd Argument is : !cp:2" + +עһʹ`"!^"`дӡͨ`"![]:[]"`ӡ + +Уһ`cp`ڶҲҪӡ`"!cp:2"`κxyzʱ5Ҫõĸʹ`"!xyz:4"`еIJͨ`"!*"`á + +![IJ](http://www.tecmint.com/wp-content/uploads/2015/05/5.gif) +IJ + +### 5. ԹؼΪִϸ ### + +ǿԹؼΪִϴִеԴ⣺ + + $ ls /home > /dev/null [1] + $ ls -l /home/avi/Desktop > /dev/null [2] + $ ls -la /home/avi/Downloads > /dev/null [3] + $ ls -lA /usr/bin > /dev/null [4] + +ʹͬlsвͬĿغͲͬIJļСңǻݵ`/dev/null`Dzδնɺܸɾ + +ԹؼΪִϸ + + $ ! ls [1] + $ ! ls -l [2] + $ ! ls -la [3] + $ ! ls -lA [4] + +淢ʹùؼ`ls`ִѾִй + +![ԹؼΪִ](http://www.tecmint.com/wp-content/uploads/2015/05/6.gif) +ԹؼΪִ + +### 6. !! ### + +ʹ`(!!)`/޸ϸеһЩ޸/ϸҸչʾһЩʵ龳 + +һнűҵ˽IPִˣ + + $ ip addr show | grep inet | grep -v 'inet6'| grep -v '127.0.0.1' | awk '{print $2}' | cut -f1 -d/ + +ţͻȻҪűضһip.txtļˣҸôأҸضһļôһ򵥵Ľʹϵ`'> ip.txt'`ضļ + + $ ip addr show | grep inet | grep -v 'inet6'| grep -v '127.0.0.1' | awk '{print $2}' | cut -f1 -d/ > ip.txt + +л"ϵ"ڣһнű + + $ ifconfig | grep "inet addr:" | awk '{print $2}' | grep -v '127.0.0.1' | cut -f2 -d: + +һűBashʾ㷵˴Ϣ`"bash: ifconfig: command not found"`ԭ򲢲Ѳ£˱ӦrootȨ޵е + +ԣôأǺrootû¼ٴμϵҲˡˣҪ`"!!"`ȥţΪǸûϸ + + $ su -c "!!" root + +suлrootûģ`-c`ijûضҪIJ`!!`滻ΪϴеԵģҪṩroot롣 + +![!!](http://www.tecmint.com/wp-content/uploads/2015/05/7.gif) +!! + +ͨ龰ʹ`!!` + +1.ͨûapt-getͨյʾ˵ûȨִС + + $ apt-get upgrade && apt-get dist-upgrade + +ðɣд󡣵ģʹɹִ... + + $ su -c !! + +ͬڣ + + $ service apache2 start + + $ /etc/init.d/apache2 start + + $ systemctl start apache2 + +ͨûȨִЩУ + + $ su -c 'service apache2 start' + + $ su -c '/etc/init.d/apache2 start' + + $ su -c 'systemctl start apache2' + +### 7.һӰг![FILE_NAME]ļ ### + +`!`߼ǣԳ`'!'`ļеļ/չִ + +A.ļƳļ2.txt⡣ + + $ rm !(2.txt) + +B.ļƳеļͣpdfͳ⡣ + + $ rm !(*.pdf) + +### 8.ijļУ/home/avi/TecmintǷڣӡ ### + +ʹ`'! -d'`֤ļǷڣļвʱʹAND`(&&)`дӡļдʱʹOR`(||)`дӡ + +߼ϣ`[ ! -d /home/avi/Tecmint ]`Ϊ0ʱִAND߼ݣִOR߼`(||)`ݡ + + $ [ ! -d /home/avi/Tecmint ] && printf '\nno such /home/avi/Tecmint directory exist\n' || printf '\n/home/avi/Tecmint directory exist\n' + +### 9.ijļǷڣ˳ ### + +ﵱļвʱ˳ + + $ [ ! -d /home/avi/Tecmint ] && exit + +### 10.homeļڲһļУȷ˵test򴴽 ### + +ǽűеһõʵ֣ļвʱһ + + [ ! -d /home/avi/Tecmint ] && mkdir /home/avi/Tecmint + +ȫˡ֪żֵ˽`'!'`ʹ÷ڷĵطὨ顣ϵ + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/mysterious-uses-of-symbol-or-operator-in-linux-commands/ + +ߣ[Avishek Kumar][a] +ߣ[wwy-hust](https://github.com/wwy-hust) +Уԣ[УID](https://github.com/УID) + + [LCTT](https://github.com/LCTT/TranslateProject) ԭ룬[Linuxй](https://linux.cn/) Ƴ + +[a]:http://www.tecmint.com/author/avishek/ +[1]:http://www.tecmint.com/12-top-command-examples-in-linux/ From 0b16f7d34e121d6f8f316a4d050215e74cdceef9 Mon Sep 17 00:00:00 2001 From: wwy Date: Mon, 25 May 2015 20:43:55 +0800 Subject: [PATCH 156/965] [Translating] 20150521 Will Ubuntu Linux Hit 200 Million Users This Year.md --- ...50521 Will Ubuntu Linux Hit 200 Million Users This Year.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/talk/20150521 Will Ubuntu Linux Hit 200 Million Users This Year.md b/sources/talk/20150521 Will Ubuntu Linux Hit 200 Million Users This Year.md index 2b0318375b..8a79781a22 100644 --- a/sources/talk/20150521 Will Ubuntu Linux Hit 200 Million Users This Year.md +++ b/sources/talk/20150521 Will Ubuntu Linux Hit 200 Million Users This Year.md @@ -1,3 +1,5 @@ +translating by wwy-hust + Will Ubuntu Linux Hit 200 Million Users This Year? ================================================================================ It's been four years and two weeks since Mark Shuttleworth expressed his goal of "200 million users of Ubuntu in 4 years." While Ubuntu's presence has continued to increase over the past four years, it doesn't look like that goal has been realized yet or will be by the end of the calendar year. @@ -35,4 +37,4 @@ via: http://www.phoronix.com/scan.php?page=news_item&px=2015-200-Million-Goal-Re [4]:http://www.phoronix.com/scan.php?page=news_item&px=Ubuntu-Calculator-Reboot [5]:http://www.phoronix.com/scan.php?page=news_item&px=MTgzOTM [6]:http://www.phoronix.com/scan.php?page=news_item&px=MTA5ODM -[7]:https://www.phoronix.com/scan.php?page=news_item&px=Nzg1Mw \ No newline at end of file +[7]:https://www.phoronix.com/scan.php?page=news_item&px=Nzg1Mw From 4d355a85012d9559436aab47d39c744ab76d40c2 Mon Sep 17 00:00:00 2001 From: Chang Liu Date: Mon, 25 May 2015 21:36:45 +0800 Subject: [PATCH 157/965] [Translated]20150320 Sleuth Kit -- Open Source Forensic Tool to Analyze Disk Images and Recover Files.md --- ...o Analyze Disk Images and Recover Files.md | 161 ------------------ ...o Analyze Disk Images and Recover Files.md | 159 +++++++++++++++++ 2 files changed, 159 insertions(+), 161 deletions(-) delete mode 100644 sources/tech/20150320 Sleuth Kit--Open Source Forensic Tool to Analyze Disk Images and Recover Files.md create mode 100644 translated/tech/20150320 Sleuth Kit--Open Source Forensic Tool to Analyze Disk Images and Recover Files.md diff --git a/sources/tech/20150320 Sleuth Kit--Open Source Forensic Tool to Analyze Disk Images and Recover Files.md b/sources/tech/20150320 Sleuth Kit--Open Source Forensic Tool to Analyze Disk Images and Recover Files.md deleted file mode 100644 index b3acf5f00e..0000000000 --- a/sources/tech/20150320 Sleuth Kit--Open Source Forensic Tool to Analyze Disk Images and Recover Files.md +++ /dev/null @@ -1,161 +0,0 @@ -FSSlc Translating - -Sleuth Kit - Open Source Forensic Tool to Analyze Disk Images and Recover Files -================================================================================ -SIFT is a Ubuntu based forensics distribution provided by SANS Inc. It consist of many forensics tools such as Sleuth kit / Autopsy etc . However, Sleuth kit/Autopsy tools can be installed on Ubuntu/Fedora distribution instead of downloading complete distribution of SIFT. - -Sleuth Kit /Autopsy is open source digital forensics investigation tool which is used for recovering the lost files from disk image and analysis of images for incident response. Autopsy tool is a web interface of sleuth kit which supports all features of sleuth kit. This tool is available for both Windows and Linux Platforms. - -### Install Sleuth kit ### - -First of all, download Sleuth kit software from [sleuthkit][1] website. Use wget command to download it in terminal which is shown in the figure. - - # wget http://cznic.dl.sourceforge.net/project/sleuthkit/sleuthkit/4.1.3/sleuthkit-4.1.3.tar.gz - -![Download Sleuth Kit](http://blog.linoxide.com/wp-content/uploads/2015/03/download-sleuthkeit.png) - -Extract the sleuthkit-4.1.3.tar.gz using following command and go inside the extracted directory - - # tar -xvzf sleuthkit-4.1.3.tar.gz - -![Extraction Process](http://blog.linoxide.com/wp-content/uploads/2015/03/extract.png) - -Run following command which perform the requirement check before sleuth kit installation - - #./configure - -![configure](http://blog.linoxide.com/wp-content/uploads/2015/03/configure.png) - -Make command compile the sleuth kit code. - - #make - -![make](http://blog.linoxide.com/wp-content/uploads/2015/03/make.png) - -Finally following command install it under **/usr/local** path. - - #make install - -![make install](http://blog.linoxide.com/wp-content/uploads/2015/03/make-install.png) - -### Install Autopsy Tool ### - -Sleuth kit installation is complete and now we will install autopsy interface. Download Autopsy software from [sleuthkit's autopsy page][2] . Use wget command to download it in terminal which is shown in the figure. - - # wget http://kaz.dl.sourceforge.net/project/autopsy/autopsy/2.24/autopsy-2.24.tar.gz - -![Autpsy download link](http://blog.linoxide.com/wp-content/uploads/2015/03/autopsy.png) - -Extract the autopsy-2.24.tar.gz using following command and go inside the extracted directory - - # tar -xvzf autopsy-2.24.tar.gz - -![Autopsy Extraction](http://blog.linoxide.com/wp-content/uploads/2015/03/Autopsy-extraction.png) - -Configuration script of autopsy asks for NSRL (National Software Reference Library) and path of **Evidence_Locker** folder. - -Enter "n" for NSRL prompt and create Evidence_Locker folder under **/usr/local** directory. Autopsy stores the configuration files, audit logs and output under Evidence_Locker folder. - - #mkdir /usr/local/Evidence_Locker - - #cd autopsy-2.24 - - #./configure - -![Autopsy Configuration Script](http://blog.linoxide.com/wp-content/uploads/2015/03/autopsy-configuration.png) - -After adding Evidence_Locker path in installation process , autopsy stores configuration files in it and shows a following message to run the autopsy program. - -![Start Autopsy](http://blog.linoxide.com/wp-content/uploads/2015/03/start-autopsy.png) - -Type **./autopsy** command in terminal to start the graphical interface of Sleuth kit tool. - -![Autopsy Started](http://blog.linoxide.com/wp-content/uploads/2015/03/autopsy-started.png) - -Type following address in the web browser to access the interface of autopsy . - - http://localhost:9999/autopsy - -Main web page of autopsy plugin is shown int the following figure. - -![Main Page](http://blog.linoxide.com/wp-content/uploads/2015/03/main-interface.png) - -Click on the **New Case** button to start analysis in autopsy tool. Enter the case name, description about the investigation and name of agent which is shown in the following figure. - -![create new case](http://blog.linoxide.com/wp-content/uploads/2015/03/create-new-case1.png) - -Following web page will appear after entering the details in the above page. Click on **Add Host** button to add details for the analyst machine. - -![add host](http://blog.linoxide.com/wp-content/uploads/2015/03/add-host1.png) - -Enter host name, description and time zone setting of analyst machine on the next page. - -![add host-detial](http://blog.linoxide.com/wp-content/uploads/2015/03/add-host-detial.png) - -Click on the **Add Image** button to add image file for forensics analysis. - -![add image](http://blog.linoxide.com/wp-content/uploads/2015/03/add-image.png) - -Click on the **Add Image File** button on the following web page. It opens new web page which require Path of image file and select type & importing method. - -![Add image file](http://blog.linoxide.com/wp-content/uploads/2015/03/Add-image-file.png) - -As shown in the following figure, we have entered path of Linux image file. In our case, image file is partition of disk. - -![add image parition](http://blog.linoxide.com/wp-content/uploads/2015/03/add-image-parition.png) - -Click on the next button and select **Calculate hash** option in the next page which is shown in the following figure. It also detect the file system type of the given image. - -![image and file system detail](http://blog.linoxide.com/wp-content/uploads/2015/03/image-and-file-system-detail.png) - -Following window shows the MD5 hash of the image file before static analysis . - -![hash](http://blog.linoxide.com/wp-content/uploads/2015/03/hash1.png) - -On the next web page, autopsy shows following information about the image file. - -- mount point for the image -- name of image -- file system type of given image - -Click on the **details** button to get more information about the given image file. It also offer extraction of unallocated fragments and strings from the volume of image file which is shown in the following figure. - -![Image detail](http://blog.linoxide.com/wp-content/uploads/2015/03/image-details.png) - -Click on **Analyze** button which is shown in the below figure to start analysis on given image . It opens another page which shows the multiple options for image analysis. - -![analysis](http://blog.linoxide.com/wp-content/uploads/2015/03/analysis1.png) - -Autopsy offer following features during image analysis process. - -- File Analysis -- Keyword Search -- File Type -- Image Details -- Data Unit - -File Analysis on given image of Linux partition is shown in the following figure. - -![Analysis of image](http://blog.linoxide.com/wp-content/uploads/2015/03/Analysis-of-image.png) - -It extracts all files and folders from the given image . Extraction of deleted files are shown int he figure. - -![Deleted Files](http://blog.linoxide.com/wp-content/uploads/2015/03/deleted.png) - -### Conclusion ### - -Hopefully this article will be useful for the beginner in static forensics analysis of disk image. Autopsy is web interface for sleuth kit which provides features such as extraction of strings , recovery of deleted files, timeline analysis, extraction of web surfing history, keyword search and email analysis on windows and linux disk images. - --------------------------------------------------------------------------------- - -via: http://linoxide.com/ubuntu-how-to/autopsy-sleuth-kit-installation-ubuntu/ - -作者:[nido][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://linoxide.com/author/naveeda/ -[1]:http://www.sleuthkit.org/sleuthkit/download.php -[2]:http://www.sleuthkit.org/autopsy/download.php diff --git a/translated/tech/20150320 Sleuth Kit--Open Source Forensic Tool to Analyze Disk Images and Recover Files.md b/translated/tech/20150320 Sleuth Kit--Open Source Forensic Tool to Analyze Disk Images and Recover Files.md new file mode 100644 index 0000000000..e86a8f3c10 --- /dev/null +++ b/translated/tech/20150320 Sleuth Kit--Open Source Forensic Tool to Analyze Disk Images and Recover Files.md @@ -0,0 +1,159 @@ +Sleuth Kit -- 一个用来分析磁盘映像和恢复文件的开源取证工具 +================================================================================ +SIFT 是一个由 SANS 公司提供的基于 Ubuntu 的取证发行版本。它包含许多取证工具,如 Sleuth kit/Autopsy 。但 Sleuth kit / Autopsy 可以直接在 Ubuntu 或 Fedora 发行版本上直接安装,而不必下载 SIFT 的整个发行版本。 + +Sleuth Kit/Autopsy 是一个开源的电子取证调查工具,它被用于从磁盘映像中恢复丢失的文件,基于事件响应的磁盘映像的分析。 Autopsy 工具是 sleuth kit 的一个网页接口,支持 sleuth kit 的所有功能。这个工具在 Windows 和 Linux 平台下都可获取到。 + +### 安装 Sleuth kit ### + +首先,从 [sleuthkit][1] 的网站下载 Sleuth kit 软件。使用下面的命令在虚拟终端下使用 wget 命令来下载它,下图展示了这个过程。 + + # wget http://cznic.dl.sourceforge.net/project/sleuthkit/sleuthkit/4.1.3/sleuthkit-4.1.3.tar.gz + +![下载 Sleuth Kit](http://blog.linoxide.com/wp-content/uploads/2015/03/download-sleuthkeit.png) + +使用下面的命令解压 sleuthkit-4.1.3.tar.gz 并进入解压后的目录: + + # tar -xvzf sleuthkit-4.1.3.tar.gz + +![解压过程](http://blog.linoxide.com/wp-content/uploads/2015/03/extract.png) + +在安装 sleuth kit 之前,运行下面的命令来执行所需的检查: + + #./configure + +![configure](http://blog.linoxide.com/wp-content/uploads/2015/03/configure.png) + +然后使用 Make 命令来编译 sleuth kit : + + #make + +![make](http://blog.linoxide.com/wp-content/uploads/2015/03/make.png) + +最后,使用下面的命令将它安装到 **/usr/local** 目录下: + + #make install + +![make install](http://blog.linoxide.com/wp-content/uploads/2015/03/make-install.png) + +### 安装 Autopsy 工具 ### + +Sleuth kit 已经安装完毕,现在我们将为它安装 autopsy 界面。从 [sleuthkit 的 autopsy 页面][2] 下载 Autopsy 软件。使用下面的命令在虚拟终端下使用 wget 命令来下载它,下图展示了这个过程。 + + # wget http://kaz.dl.sourceforge.net/project/autopsy/autopsy/2.24/autopsy-2.24.tar.gz + +![Autpsy 的下载链接](http://blog.linoxide.com/wp-content/uploads/2015/03/autopsy.png) + +使用下面的命令解压 autopsy-2.24.tar.gz 并进入解压后的目录: + + # tar -xvzf autopsy-2.24.tar.gz + +![Autopsy 的解压](http://blog.linoxide.com/wp-content/uploads/2015/03/Autopsy-extraction.png) + +autopsy 的配置脚本将询问 NSRL (National Software Reference Library) 和 **Evidence_Locker** 文件夹的路径。 + +当弹窗问及 NSRL 时,输入 "n",并在 **/usr/local** 目录下创建名为 Evidence_Locker 的文件夹。Autopsy 将在 Evidence_Locker 文件夹下存储配置文件,审计记录和输出文件。 + + #mkdir /usr/local/Evidence_Locker + + #cd autopsy-2.24 + + #./configure + +![Autopsy 配置脚本](http://blog.linoxide.com/wp-content/uploads/2015/03/autopsy-configuration.png) + +在安装过程中添加完 Evidence_Locker 的安装路径后, autopsy 在那里存储配置文件并展现如下的信息来运行 autopsy 程序。 + +![启动 Autopsy](http://blog.linoxide.com/wp-content/uploads/2015/03/start-autopsy.png) + +在虚拟终端中键入 **./autopsy** 命令来启动 Sleuth kit 工具的图形界面: + +![Autopsy](http://blog.linoxide.com/wp-content/uploads/2015/03/autopsy-started.png) + +在浏览器中键入下面的地址来获取 autopsy 的界面: + + http://localhost:9999/autopsy + +下图展现了 autopsy 插件的主页面: + +![主页](http://blog.linoxide.com/wp-content/uploads/2015/03/main-interface.png) + +在 autopsy 工具中,点击 **新案例** 按钮来开始进行分析。键入案例名称,此次调查的描述和检查人的姓名,下图有具体的展示: + +![创建新事件](http://blog.linoxide.com/wp-content/uploads/2015/03/create-new-case1.png) + +在接下来的网页中,将展示在上一个的网页中键入的详细信息。接着点击 **增加主机** 按钮来添加有关要分析的机器的详细信息。 + +![增加主机](http://blog.linoxide.com/wp-content/uploads/2015/03/add-host1.png) + +在下一个网页中键入主机名,相关的描述和要分析的机器的时区设置。 + +![添加主机的详细信息](http://blog.linoxide.com/wp-content/uploads/2015/03/add-host-detial.png) + +点击 **增加映像** 按钮来为取证分析添加映像文件。 + +![添加映像](http://blog.linoxide.com/wp-content/uploads/2015/03/add-image.png) + +在接下来的网页中点击 **增加映像文件** 按钮。它将打开一个新的网页,来询问映像文件的路径和选择映像的类型以及导入的方法。 + +![添加映像文件](http://blog.linoxide.com/wp-content/uploads/2015/03/Add-image-file.png) + +正如下图中展示的那样,我们已经键入了 Linux 映像文件的路径。在我们这个例子中,映像文件是磁盘的分区。 + +![添加映像分区](http://blog.linoxide.com/wp-content/uploads/2015/03/add-image-parition.png) + +点击 下一步 按钮并在下一页中选择 **计算散列值** 的选项,这在下图中有展示。它也将检测所给映像的文件系统类型。 + +![映像和文件系统详情](http://blog.linoxide.com/wp-content/uploads/2015/03/image-and-file-system-detail.png) + +下面的图片展示了静态分析之前映像文件的 MD5 散列值。 + +![散列值](http://blog.linoxide.com/wp-content/uploads/2015/03/hash1.png) + +在下一个网页中, autopsy 展现了有关映像文件的如下信息: + +- 映像的挂载点 +- 映像的名称 +- 所给映像的文件系统类型 + +点击 **详情** 按钮来获取更多有关所给映像文件的信息。它还提供了从映像文件的卷中导出未分配的片段和字符串的数据信息,这在下图中有展现。 + +![映像的详细信息](http://blog.linoxide.com/wp-content/uploads/2015/03/image-details.png) + +在下图中那样,点击 **分析** 按钮来开始分析所给映像。它将开启另一个页面,其中包含了映像分析的多个选项。 + +![分析](http://blog.linoxide.com/wp-content/uploads/2015/03/analysis1.png) + +在映像分析过程中,Autopsy 提供了如下的功能: + +- 文件分析 +- 关键字搜索 +- 文件类型 +- 映像详情 +- 数据单元 + +下图展示的是在给定的 Linux 分区映像上进行文件分析: + +![映像的分析](http://blog.linoxide.com/wp-content/uploads/2015/03/Analysis-of-image.png) + +它将从所给映像中提取所有的文件和文件夹。在下图中也展示了已被删除的文件的提取: + +![已被删除的文件](http://blog.linoxide.com/wp-content/uploads/2015/03/deleted.png) + +### 结论 ### + +希望这篇文章能够给那些进入磁盘映像的静态分析领域的新手提供帮助。Autopsy 是 sleuth kit 的网页界面,提供了在 Windows 和 Linux 磁盘映像中进行诸如字符串提取,恢复被删文件,时间线分析,网络浏览历史,关键字搜索和邮件分析等功能。 + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/ubuntu-how-to/autopsy-sleuth-kit-installation-ubuntu/ + +作者:[nido][a] +译者:[FSSlc](https://github.com/FSSlc) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://linoxide.com/author/naveeda/ +[1]:http://www.sleuthkit.org/sleuthkit/download.php +[2]:http://www.sleuthkit.org/autopsy/download.php \ No newline at end of file From afe8c9fb4fe45674396c9e2714487c291a59e1ca Mon Sep 17 00:00:00 2001 From: wxy Date: Mon, 25 May 2015 22:21:03 +0800 Subject: [PATCH 158/965] PUB:20150512 Guake 0.7.0 Released--A Drop-Down Terminal for Gnome Desktops @wwy-hust --- ...A Drop-Down Terminal for Gnome Desktops.md | 121 ++++++++++++++++++ ...A Drop-Down Terminal for Gnome Desktops.md | 115 ----------------- 2 files changed, 121 insertions(+), 115 deletions(-) create mode 100644 published/20150512 Guake 0.7.0 Released--A Drop-Down Terminal for Gnome Desktops.md delete mode 100644 translated/share/20150512 Guake 0.7.0 Released--A Drop-Down Terminal for Gnome Desktops.md diff --git a/published/20150512 Guake 0.7.0 Released--A Drop-Down Terminal for Gnome Desktops.md b/published/20150512 Guake 0.7.0 Released--A Drop-Down Terminal for Gnome Desktops.md new file mode 100644 index 0000000000..421bc00a0b --- /dev/null +++ b/published/20150512 Guake 0.7.0 Released--A Drop-Down Terminal for Gnome Desktops.md @@ -0,0 +1,121 @@ +一个用于Gnome桌面的下拉式终端: Guake 0.7.0 发布 +================================================================================ +Linux的命令行是最好、最强大的东西,它使新手着迷,并为老手和极客的提供极其强大的功能。那些在服务器和生产环境下工作的人早已认识到了这个事实。有趣的是,Linux终端是Linus Torvald在1991年写内核时实现的第一批功能之一。 + +终端是个强大的工具,由于它没有什么可调整的部分,所以十分可靠。终端介于控制台环境和GUI环境之间。终端自身作为一个GUI程序,运行在桌面环境下。有许多终端是适用于特定的桌面环境的,其它的则是通用的。Terminator, Konsole, Gnome-Terminal, Terminology, XFCE terminal, xterm都是些常用的终端模拟器。 + +您可以从下面的链接中获得一份使用最广泛的终端模拟器的列表。 + +- [20 Useful Terminals for Linux][1] + +前几日上网时,我偶遇了名为‘Guake’的终端程序,它是用于gnome的终端模拟器。尽管这并不是我第一次听到Guake。实际上,我在大约一年前便知道了这个应用程序,但不知怎么搞的,我那时没有写写Guake,再后来我便渐渐忘掉了Guake,直到我再一次听到Guake。所以,最终,这篇文章诞生了。我将给你讲讲Guake的功能,在Debian、Ubuntu、Fedora上的安装过程以及一些测试。 + +#### 什么是Guake? #### + +Guake是应用于Gnome环境的下拉式终端。主要由Python编写,使用了一些C,它以GPL2+许可证发布,适用于Linux以及类似的系统。Guake的灵感来源于电脑游戏Quake(雷神之锤)中的终端,Quake的终端能通过按下特定按键(默认为F12)从屏幕上滑下来,并在按下同样的键后滑上去。 + +值得注意的是,Guake并不是第一个这样的应用。Yakuake(Yet Another Kuake)是一个运行于KDE的终端模拟器,Tilda是一个用GTK+写成的终端模拟器。它们的灵感都来自于雷神之锤那上下滑动的终端。 + +#### Guake的功能 #### + +- 轻量级 +- 简单而优雅 +- 功能众多 +- 强大 +- 美观 +- 将终端平滑地集成于GUI中 +- 在按下预定义的键后出现/消失 +- 支持热键、标签、透明化背景,这使得它适合所有Gnome用户 +- 可配置各种方面 +- 包括许多颜色的调色板 +- 设定透明度的快捷方式 +- 通过Guake配置,可在启动时运行一个脚本 +- 可以在多个显示器上运行 + +Guake 0.7.0最近发布,它带来了一些修正以及上面提到的一些功能。完整的版本历史和源代码包可以在[这里][2]找到。 + +### 在Linux中安装Guake终端 ### + +如果您对从源码编译Guake感兴趣,您可以从上面的链接处下载Guake,并在安装前进行编译。 + +然而Guake可以在许多的发行版中通过添加额外的仓库来安装。这里,我们将在Debian、Ubuntu、Linux Mint和Fedora下安装Guake。 + +首先从仓库获取最新的软件包列表,并从默认的仓库安装Guake,如下所示: + + ---------------- 在 Debian, Ubuntu 和 Linux Mint 上 ---------------- + $ sudo apt-get update + $ apt-get install guake + +---------- + + ---------------- 在 Fedora 19 及其以后版本 ---------------- + # yum update + # yum install guake + +安装后,可以从另一个终端中启动Guake: + + $ guake + +在启动它后,便可以在Gnome桌面中使用F12(默认配置)来拉下、收回终端。 + +看起来非常漂亮,尤其是透明背景。滑下来...滑上去...滑下来...滑上去...执行命令,打开另一个标签,执行命令,滑上去...滑下来...(作者已沉迷其中) + +![Guake Terminal in Action](http://www.tecmint.com/wp-content/uploads/2015/05/Guake.png) + +*Guake实战* + +如果您的壁纸或活动窗口的颜色和Guake的颜色有些不搭。您可以改变您的壁纸,减少透明度或者改变Guake的颜色。 + +下一步便是进入Guake的配置,根据每个人的需求修改设置。可以通过应用菜单或者下面的命令来运行Guake的配置。 + + $ guake --preferences + +![Guake Terminal Properties](http://www.tecmint.com/wp-content/uploads/2015/05/Guake-Properties.png) + +*Guake终端配置* + +设置滚动 + +![Guake Scrolling Settings](http://www.tecmint.com/wp-content/uploads/2015/05/Guake-Scrolling.png) + +*Guake滚动配置* + +外观设置 - 在这里您可以修改文字颜色和背景色以及透明度。 + +![Appearance Properties](http://www.tecmint.com/wp-content/uploads/2015/05/Appearance-Properties.png) + +*外观设置* + +键盘快捷键 - 在这里您可以修改Guake显示的开关快捷键。 + +![Keyboard Shortcuts](http://www.tecmint.com/wp-content/uploads/2015/05/Keyboard-Shortcuts.png) + +*键盘快捷键* + +兼容性设置 - 基本上不必设置它。 + +![Compatibility Setting](http://www.tecmint.com/wp-content/uploads/2015/05/Compatibility-Setting.png) + +*兼容性设置* + +### 结论 ### + +这个项目即不是太年轻也不是太古老,因此它已经达到了一定的成熟度,足够可靠,可以开箱即用。像我这样需要在GUI和终端间频繁切换的人来说,Guake是一个福利。我不需要管理一个多余的窗口,频繁的打开和关闭,使用tab在大量打开的应用程序中寻找终端或切换到不同的工作区来管理终端,现在我需要的只有F12。 + +我认为对任何同时使用GUI和终端的Linux用户来说,Guake都是必须的工具。同样的,我会向任何想要在系统中结合使用GUI和终端的人推荐它,因为它既平滑又没有任何障碍。 + +上面就是我要说的全部了。如果在安装和使用时有任何问题,请告诉我,我们会帮助您。也请您告诉我您使用Guake的经验。在下面的评论区反馈您宝贵的经验。点赞和分享以帮助我们宣传。 + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/install-guake-terminal-ubuntu-mint-fedora/ + +作者:[Avishek Kumar][a] +译者:[wwy-hust](https://github.com/wwy-hust) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/avishek/ +[1]:http://www.tecmint.com/linux-terminal-emulators/ +[2]:https://github.com/Guake/guake/releases/tag/0.7.0 diff --git a/translated/share/20150512 Guake 0.7.0 Released--A Drop-Down Terminal for Gnome Desktops.md b/translated/share/20150512 Guake 0.7.0 Released--A Drop-Down Terminal for Gnome Desktops.md deleted file mode 100644 index a4a3609cf0..0000000000 --- a/translated/share/20150512 Guake 0.7.0 Released--A Drop-Down Terminal for Gnome Desktops.md +++ /dev/null @@ -1,115 +0,0 @@ -Guake 0.7.0 ѷ - һGnomeʽն -================================================================================ -LinuxáǿĶʹԣΪֺͼ͵ṩǿĹܡЩڷ¹ʶʵȤǣLinuxնLinus Torvald1991дںʱʵֵĵһ֮һ - -նǸǿĹߣûпƶIJ֣ʮֿɿն˽ڿ̨GUI֮䡣նΪһGUI滷¡նض滷ģͨõġTerminator, Konsole, Gnome-Terminal, Terminology, XFCE terminal, xtermЩõնģ - -Դлһʹ㷺նģб - -- [20 Useful Terminals for Linux][1] - -ǰʱżΪGuakegnomeնģⲢҵһGuakeʵϣڴԼһǰ֪Ӧó򣬵֪ôģʱûддGuakeٺұ㽥GuakeֱһGuakeԣգƪµˡҽ㽲GuakeĹܣDebianUbuntuFedoraϵİװԼһЩԡ - -#### ʲôGuake #### - -GuakeӦGnomeʽնˡҪPythonдʹһЩCGPL2+֤鷢LinuxԼƵϵͳGuakeԴڵϷQuake֮նˣQuakeնͨضĬΪF12Ļϻڰͬļȥ - -ֵעǣGuakeǵһӦáYakuakeYet Another KuakeһKDEնģTildaһGTK+дɵնģǵж֮»նˡ - -#### GuakeĹ #### - -- -- 򵥶 -- ڶ๦ -- ǿ -- ÿ -- ƽļGUI -- ڰԤļ/ʧ -- ֧ȼǩ͸ʹʺGnomeû -- ˵ؿ -- ɫĵɫ -- 趨͸ȵĿݷʽ -- ͨGuakeãʱһű -- ڶ - -Guake 0.7.0һЩԼᵽһЩܡİ汾ʷԴ[][2]ҵ - -### LinuxаװGuakeն ### - -ԴԴGuakeȤԴӴGuakeڰװǰб롣 - -ȻGuakeķаͨӶIJֿװǽDebianUbuntuLinux MintFedora°װGuake - -ȴӲֿȡµбĬϵIJֿⰲװGuakeʾ - - ---------------- On Debian, Ubuntu and Linux Mint ---------------- - $ sudo apt-get update - $ apt-get install guake - ----------- - - ---------------- On Fedora 19 Onwards ---------------- - # yum update - # yum install guake - -װ󣬿ԴһնGuake - - $ guake - -󣬱GnomeʹF12Ĭã»ϻնˡ - -dzƯ͸...ȥ......ȥ...ִһǩִȥ......ѳУ - -![Guake Terminal in Action](http://www.tecmint.com/wp-content/uploads/2015/05/Guake.png) -Guakeʵս - -ıֽڵɫGuakeɫЩԸııֽ͸Ȼ߸ıGuakeɫ - -һǽGuakeãÿ˵޸áͨӦò˵Guakeá - - $ guake --preferences - -![Guake Terminal Properties](http://www.tecmint.com/wp-content/uploads/2015/05/Guake-Properties.png) -Guakeն - - - -![Guake Scrolling Settings](http://www.tecmint.com/wp-content/uploads/2015/05/Guake-Scrolling.png) -Guake - - - ޸ɫͱɫԼ͸ȡ - -![Appearance Properties](http://www.tecmint.com/wp-content/uploads/2015/05/Appearance-Properties.png) - - -̿ݼ - ޸GuakeʾĿؿݼ - -![Keyboard Shortcuts](http://www.tecmint.com/wp-content/uploads/2015/05/Keyboard-Shortcuts.png) -̿ݼ - - - ϲ - -![Compatibility Setting](http://www.tecmint.com/wp-content/uploads/2015/05/Compatibility-Setting.png) - - -### ### - -Ŀ̫Ҳ̫ϣѾﵽһijȣ㹻ɿԿ伴áҪGUIն˼Ƶл˵GuakeһҲҪһĴڣƵĴ򿪺͹رգʹtabڴ򿪵ӦóѰն˻лͬĹնˣҪֻF12 - -ΪκͬʱʹGUIն˵Linuxû˵GuakeDZĹߡͬģһκҪϵͳнʹGUIն˵ƼΪƽûκϰ - -Ҫ˵ȫˡڰװʹʱκ⣬ңǻҲʹGuakeľ顣ľ顣޺ͷ԰ - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/install-guake-terminal-ubuntu-mint-fedora/ - -ߣ[Avishek Kumar][a] -ߣ[wwy-hust](https://github.com/wwy-hust) -Уԣ[УID](https://github.com/УID) - - [LCTT](https://github.com/LCTT/TranslateProject) ԭ룬[Linuxй](https://linux.cn/) Ƴ - -[a]:http://www.tecmint.com/author/avishek/ -[1]:http://www.tecmint.com/linux-terminal-emulators/ -[2]:https://github.com/Guake/guake/releases/tag/0.7.0 From c0fefa23ccd4af616c87a98ba9cb0a40b57211c2 Mon Sep 17 00:00:00 2001 From: wxy Date: Mon, 25 May 2015 22:24:58 +0800 Subject: [PATCH 159/965] PUB:20150518 Linux FAQs with Answers--How to fix 'fatal error--security or pam_modules.h--No such file or directory' @ictlyh --- ...security or pam_modules.h--No such file or directory'.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename {translated/tech => published}/20150518 Linux FAQs with Answers--How to fix 'fatal error--security or pam_modules.h--No such file or directory'.md (80%) diff --git a/translated/tech/20150518 Linux FAQs with Answers--How to fix 'fatal error--security or pam_modules.h--No such file or directory'.md b/published/20150518 Linux FAQs with Answers--How to fix 'fatal error--security or pam_modules.h--No such file or directory'.md similarity index 80% rename from translated/tech/20150518 Linux FAQs with Answers--How to fix 'fatal error--security or pam_modules.h--No such file or directory'.md rename to published/20150518 Linux FAQs with Answers--How to fix 'fatal error--security or pam_modules.h--No such file or directory'.md index 0e2d0ab54c..6ede2366a8 100644 --- a/translated/tech/20150518 Linux FAQs with Answers--How to fix 'fatal error--security or pam_modules.h--No such file or directory'.md +++ b/published/20150518 Linux FAQs with Answers--How to fix 'fatal error--security or pam_modules.h--No such file or directory'.md @@ -1,6 +1,6 @@ -Linux 有问必答--如何修复 “fatal error: security/pam_modules.h: No such file or directory” +如何修复 “fatal error: security/pam_modules.h: No such file or directory” ================================================================================ -> **问题**: 我尝试在 [插入你的 Linux 发行版] 上编译程序,但是出现下面的编译错误: +> **问题**: 我尝试在 [某某 Linux 发行版] 上编译程序,但是出现下面的编译错误: > > "pam_otpw.c:27:34: fatal error: security/pam_modules.h: No such file or directory" > @@ -26,7 +26,7 @@ via: http://ask.xmodulo.com/fatal-error-security-pam-modules.html 作者:[Dan Nanni][a] 译者:[ictlyh](https://github.com/ictlyh) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 72cc509ec16646d65506b8228bef49c4facaded7 Mon Sep 17 00:00:00 2001 From: wxy Date: Mon, 25 May 2015 23:39:50 +0800 Subject: [PATCH 160/965] PUB:20150407 How To Install CentOS Web Panel In CentOS @wi-cuckoo --- ...w To Install CentOS Web Panel In CentOS.md | 146 +++++++++--------- 1 file changed, 71 insertions(+), 75 deletions(-) rename {translated/tech => published}/20150407 How To Install CentOS Web Panel In CentOS.md (61%) diff --git a/translated/tech/20150407 How To Install CentOS Web Panel In CentOS.md b/published/20150407 How To Install CentOS Web Panel In CentOS.md similarity index 61% rename from translated/tech/20150407 How To Install CentOS Web Panel In CentOS.md rename to published/20150407 How To Install CentOS Web Panel In CentOS.md index b3d5e2588f..fe038b4406 100644 --- a/translated/tech/20150407 How To Install CentOS Web Panel In CentOS.md +++ b/published/20150407 How To Install CentOS Web Panel In CentOS.md @@ -1,62 +1,61 @@ -如何在CentOS上面安装CentOS网页面板 +如何在CentOS上面安装“CentOS网页面板” =========================================================================== ![](http://1102047360.rsc.cdn77.org/wp-content/uploads/2015/04/centos-790x427.jpg) ### 关于CentOS网页面板 ### -目前有很多免费的或者付费的控制面板。今天,我们来讨论[CentOS网页面板(CWP)][1],这是特别为基于如CentOS,RHEL,科研用Linux系统等发行版的RPM设计的。**CWP** 是免费且开源的控制面板,可以被广泛用于简单地配置一个网页集群环境。不同于其他的控制面板,CWP是自动用高速缓存来配置LAMP的栈区。 +目前有很多免费的或者付费的控制面板。今天,我们来讨论[CentOS网页面板(CWP)][1],这是特别为基于RPM 的发行版,如CentOS,RHEL,Scientific Linux等设计的。**CWP** 是免费且开源的控制面板,可以被广泛用于简单地配置一个网页托管环境。不同于其他的控制面板,CWP能自动部署LAMP的软件栈及Varnish 缓存服务器。 ### 特性 ### -CWP有很多的特性和免费的服务。如我前面提到的一样,CWP自动在你的服务器上安装全套LAMP服务(apache,php,phpmyadmin,webmail,mailserver等等)。 +CWP有很多的特性和免费的服务。如我前面提到的一样,CWP会在你的服务器上自动安装全套的LAMP服务(apache,php,phpmyadmin,webmail,mailserver等等)。 ### CWP安装过程中会安装和配置的软件列表 ### -- Apache Web Server +- Apache 网页服务器 - PHP 5.4 - MySQL + phpMyAdmin - Postfix + Dovecot + roundcube webmail -- CSF Firewall -- File System Lock (no more website hacking, all your files are locked from changes) -- Backups; AutoFixer for server configuration +- CSF 防火墙 +- File System Lock (不需要修改网站,你的所有文件都会被锁定修改) +- Backups; AutoFixer ,用于服务器配置 ### 第三方应用: ### - - CloudLinux + CageFS + PHP Selector -- Softaculous – Script Installer (Free and Premium) +- Softaculous – 脚本安装器 (免费版和白金版) #### 网页服务器: #### -- Varnish Cache server -- Compiles Apache from source -- Apache reCompiler + Additional modules -- Apache server status, configuration -- Edit apache vhosts, vhosts templates, include configuration -- Rebuild all apache Virtual hosts +- Varnish 缓存服务器 +- 从代码编译 Apache +- Apache 重新编译+附加模块 +- Apache 服务器状态,配置 +- 编辑 Apache 虚拟主机、虚拟主机模版,包括配置 +- 重建所有 Apache 虚拟主机 - suPHP & suExec -- Mod Security + OWASP rules -- Tomcat 8 server management -- DoS protection -- Perl cgi script support +- Mod Security + OWASP 规则 +- Tomcat 8 服务器管理 +- DoS 防护 +- Perl cgi 脚本支持 #### PHP: #### -- PHP 切换器 (在PHP版本如: 5.2, 5.3, 5.4, 5.5之间切换) -- PHP选择器选择每个用户或者每个文件的PHP版本(PHP 4.4, 5.2, 5.3, 5.4, 5.5, 5.6) -- 简单的php编辑软件 +- PHP 切换器 (在PHP版本如: 5.2、 5.3、 5.4、 5.5之间切换) +- PHP选择器,选择每个用户或者每个文件的PHP版本(PHP 4.4、 5.2、 5.3、 5.4、5.5、 5.6) +- 简单的php编辑器 - 在用户面板下简单的php.ini生成器 - PHP 插件 -- PHP.ini editor & PHP info & List modules +- PHP.ini 编辑器 & PHP 信息 和列出模块 - 每个帐号一个php.ini -- FFMPEG,用于视频流网站 +- FFMPEG,用于视频流网站 - CloudLinux + PHP 选择器 #### 用户管理 #### -- 添加,列举,编辑和移除用户 +- 添加、列出、编辑和移除用户 - 用户监管 -- Shell接入管理 +- Shell访问管理 - 用户限制管理 - 限制进程 - 限制访问文件 @@ -67,85 +66,85 @@ CWP有很多的特性和免费的服务。如我前面提到的一样,CWP自 #### DNS: #### - FreeDNS -- 添加,编辑,列举和移除DNS区块 +- 添加、编辑、列出和移除DNS区块 - 编辑域名服务的IP - DNS区块模板编辑器 - 新的易用DNS区块管理器 (用ajax) -- 新的DNS区块列表,带有额外的修复信息 (同时检测 rDNS, 域名服务….) +- 新的DNS区块列表,带有额外的google解析信息 (同时检测 rDNS, 域名服务…) #### Email: #### - Postfix & dovecot -- MailBoxes, Alias +- 邮箱、别名 - Roundcube webmail -- Postfix Mail queue -- rDNS Checker Module +- Postfix 邮件队列 +- rDNS 检查器模块 - 垃圾邮件拦截 - SPF & DKIM集成 -- Re-Build Postfix/Dovecot Mail server with AntiVirus, AntiSpam Protection -- Email Auto Responder +- 重构带有反病毒、反垃圾邮件防护的 Postfix/Dovecot 的邮件服务器 +- Email 自动应答器 #### 系统: #### - CPU核心和时钟信息 - 内存使用信息 - 详细的磁盘状态 -- 软件信息如内核版本,正常运行时间等等. +- 软件信息如内核版本、正常运行时间等等. - 服务器状态 -- 检查配置管理 +- ChkConfig管理 - 网络端口使用 - 网络配置 -- SSHD配置 +- sshd 配置 - 自动修复(检查重要的配置并尝试自动修复问题) #### 监控: #### -- 监控服务 eg. top, apache stats, mysql etc. -- 在面板内使用Java SSH Terminal/Console -- 服务器配置 (eg. Apache, PHP, MySQL etc) +- 监控服务,例如 top、 apache 状态、 mysql 等 +- 在面板内使用Java SSH 终端/控制台 +- 服务器配置 (例如 Apache、 PHP、 MySQL 等) - 在屏幕/后台运行命令行 #### 安全: #### - CSF防火墙 -- SSL产生器 +- SSL生成器 - SSL证书管理 - CloudLinux + CageFS #### SQL: #### - MySQL 数据库管理 -- 添加本地或者远程接入用户 +- 添加本地或者远程访问的用户 - 实时监控MySQL进程列表 - 创建,移除数据库 - 为每个数据库添加额外的用户 - MySQL服务器配置 -- PhpMyAdmin(这个不知道要不要译过来) +- PhpMyAdmin - PostgreSQL, phpPgAdmin支持 #### 额外功能: #### -- 语言通话3 管理 -- 网络电台管理 +- TeamSpeak 3 管理器 +- Shoutcast 管理器 - 自动更新 -- 备份管理 -- 文件管理 +- 备份管理器 +- 文件管理器 - 每个域名的虚拟FTP用户 -- 控制面板帐号移植 (恢复文件,数据库和数据库用户) -- 还有更多. +- cPanel帐号迁移 (恢复文件,数据库和数据库用户) +- 还有更多 ### 在CentOS 6上安装CentOS网页面板 ### -写这篇教程的时候,CWP仅仅支持最高CentOS 6.x版本。在CentOS 7和更高的版本中是行不通的。 +写这篇教程的时候,CWP仅仅支持最高CentOS 6.x版本。在CentOS 7和更高的版本中是不支持的。 #### 前期准备: #### -**安装CWP之前,里必须知道以下的信息:** +**安装CWP之前,你必须知道以下的信息:** -- CWP 仅支持静态IP地址。它并不支持动态的,固定的,或者内部的IP地址。 -- CWP 并没有卸载程序。当你安装CWP后,里必须重新安装服务器来移除它。 -- 之安装CWP在一个新装的还没做任何配置改变的操作系统上。 -- 对与32位操作系统至少需要512MB RAM。 +- CWP 仅支持静态IP地址。它并不支持动态的,或者内部的IP地址。 +- CWP 并没有卸载程序。当你安装CWP后,你必须重新安装服务器来移除它。 +- 只能在一个新装的还没做任何配置改变的操作系统上安装CWP。 +- 对于32位操作系统至少需要512MB RAM。 - 64位系统需要1024MB RAM。 - 要求至少20GB的硬盘空间。 @@ -175,7 +174,7 @@ CWP有很多的特性和免费的服务。如我前面提到的一样,CWP自 如果上面的URL出现错误,用下面的链接代替。 - wget http://dll.centos-webpanle.com/files/cwp-latest + wget http://dl1.centos-webpanle.com/files/cwp-latest 然后,用命令开始安装CWP: @@ -189,8 +188,7 @@ CWP有很多的特性和免费的服务。如我前面提到的一样,CWP自 安装过程会持续到30分钟或者更多,取决于你的网速。 -最后,你会看到如下安装完成的信息。 -记下一些详细信息,如mysql超级用户密码和CWP的登录URLs。你随后会需要。然后,按下回车Enter重启系统。 +最后,你会看到如下安装完成的信息。记下一些详细信息,如mysql超级用户密码和CWP的登录URL,你随后会需要它们。然后,按下回车Enter重启系统。 ![](http://www.unixmen.com/wp-content/uploads/2015/04/root@server-usr-local-src_004.png) @@ -200,7 +198,7 @@ CWP有很多的特性和免费的服务。如我前面提到的一样,CWP自 #### 调整防火墙/路由: #### -CWP的默认网络控制接口是**2030(http)**和**2031(https)**。你应该通过防火墙/路由允许使用这两个端口,以便远程接入CWP网络控制台。 +CWP的默认网页控制界面的端口是**2030(http)**和**2031(https)**。你应该通过防火墙/路由允许使用这两个端口,以便远程接入CWP网络控制台。 编辑iptables文件: @@ -242,43 +240,42 @@ CWP的默认网络控制接口是**2030(http)**和**2031(https)**。你 接下来,我们得做一些事,比如: -1.建立域名服务 -1.建立ip共享(必须是你的公共IP地址) -1.建立至少一个集合包(或者编辑默认的包) -1.建立root电子邮件,等等。 +1. 设置域名服务器 +1. 设置 ip 共享(必须是你的公共IP地址) +1. 设置至少一个托管包(或者编辑默认的包) +1. 设置 root 电子邮件,等等。 -#### 建立域名服务: #### +#### 设置域名服务器: #### -为建立域名服务,找到**DNS Functions -> Edit nameservers IPs**。 +为建立域名服务器,找到**DNS Functions -> Edit nameservers IPs**。 ![](http://www.unixmen.com/wp-content/uploads/2015/04/CWP.admin-Mozilla-Firefox_009.png) 设置你的域名服务器,点击保存按钮。 - ![](http://www.unixmen.com/wp-content/uploads/2015/04/CWP.admin-Mozilla-Firefox_010.png) -#### 建立共享IP和Root邮箱ID: #### +#### 建立共享IP和Root邮件地址: #### -在你的主机上管理网站,这是非常重要的一步。为了建立共享IP,进入**CWP Setting -> Edit settings**。 +在你的主机上托管网站,这是非常重要的一步。为了建立共享IP,进入**CWP Setting -> Edit settings**。 ![](http://www.unixmen.com/wp-content/uploads/2015/04/CWP.admin-Mozilla-Firefox_011.png) -输入你的静态IP和邮箱ID,然后点击保存设置按钮。 +输入你的静态IP和邮件地址,然后点击保存设置按钮。 ![](http://www.unixmen.com/wp-content/uploads/2015/04/CWP.admin-Mozilla-Firefox_012.png) 现在,CWP可以进行网站维护了。 -#### 建立主机包 #### +#### 建立托管包 #### -一个主机包什么都没有,除了一个网站托管计划,包括允许访问的磁盘空间,带宽,但没有FTP帐号,邮箱IDs和数据库等等。你可以建立任意数量的网站托管计划,只要你喜欢。 +一个托管包就是一个网站托管计划,包括允许访问的磁盘空间,带宽,但没有FTP帐号,邮箱地址和数据库等等。你可以建立任意数量的网站托管计划,只要你喜欢。 -添加一个包,从CWP的控制台进入**Packages — Add a Package** +要添加一个包,从CWP的控制台进入**Packages — Add a Package** ![](http://www.unixmen.com/wp-content/uploads/2015/04/CWP.admin-Mozilla-Firefox_013.png) -输入包的名字,允许访问的磁盘配额/RAM数量,FTP/Email帐号,数据库和子域名等等。点击保持设置按钮,建立一个网站托管计划。 +输入包的名字,允许访问的磁盘配额/RAM数量,FTP/Email帐号,数据库和子域名等等。点击保存设置按钮,建立一个网站托管计划。 ![](http://www.unixmen.com/wp-content/uploads/2015/04/CWP.admin-Mozilla-Firefox_014.png) @@ -290,7 +287,7 @@ CWP的默认网络控制接口是**2030(http)**和**2031(https)**。你 而添加一个用户,请进入**User Account -> New Account**。 -输入域名(ex.unixmen.com),用户名,密码和邮箱id等等。最后,点击**Create**。 +输入域名(ex.unixmen.com),用户名,密码和邮箱地址等等。最后,点击**Create**。 ![](http://www.unixmen.com/wp-content/uploads/2015/04/CWP.admin-Mozilla-Firefox_016.png) @@ -312,12 +309,11 @@ CWP的默认网络控制接口是**2030(http)**和**2031(https)**。你 --------------------------------------------------------------------------- - via: http://www.unixmen.com/how-to-install-centos-web-panel-in-centos/ 作者:[SK][a] 译者:[wi-cuckoo](https://github.com/wi-cuckoo) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 From ec57d8aa64265fbcf828a751b3ccb1d8bad6894d Mon Sep 17 00:00:00 2001 From: wxy Date: Mon, 25 May 2015 23:45:28 +0800 Subject: [PATCH 161/965] PUB:20150505 Bodhi Linux Introduces Moksha Desktop @GOLinux --- ...50505 Bodhi Linux Introduces Moksha Desktop.md | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) rename {translated/tech => published}/20150505 Bodhi Linux Introduces Moksha Desktop.md (56%) diff --git a/translated/tech/20150505 Bodhi Linux Introduces Moksha Desktop.md b/published/20150505 Bodhi Linux Introduces Moksha Desktop.md similarity index 56% rename from translated/tech/20150505 Bodhi Linux Introduces Moksha Desktop.md rename to published/20150505 Bodhi Linux Introduces Moksha Desktop.md index 6ad0d04567..dcb724e7b1 100644 --- a/translated/tech/20150505 Bodhi Linux Introduces Moksha Desktop.md +++ b/published/20150505 Bodhi Linux Introduces Moksha Desktop.md @@ -1,25 +1,26 @@ -Bodhi Linux引入Moksha桌面 +Bodhi Linux 将引入 Moksha 桌面 ================================================================================ ![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/05/Bodhi_Linux.jpg) -基于Ubuntu的轻量级Linux发行版[Bodhi Linux][1]致力于构建其自家的桌面环境,这个全新桌面环境被称之为Moksha(梵文意为‘完全自由’)。Moksha将替换常用的[Enlightenment桌面环境][2]。 +基于Ubuntu的轻量级Linux发行版[Bodhi Linux][1]致力于构建其自家的桌面环境,这个全新桌面环境被称之为Moksha(梵文意为‘完全自由’)。Moksha将替换其原来的[Enlightenment桌面环境][2]。 ### 为何用Moksha替换Englightenment? ### -Bodhi Linux的Jeff Hoogland最近[表示][3]了他对新版Enlightenment的不满。直到E17,Enlightenment都十分稳定,并且能满足轻量级Linux的部署需求。而E18则到处都充满了问题,Bodhi Linux只好弃之不用了。 +Bodhi Linux的Jeff Hoogland最近[表示][3]了他对新版Enlightenment的不满。直到E17,Enlightenment都十分稳定,并且能满足轻量级Linux的部署需求。而E18则到处都充满了问题,Bodhi Linux只好弃之不用了。 虽然最新的[Bodhi Linux 3.0发行版][4]仍然使用了E19作为其桌面(除传统模式外,这意味着,对于旧的硬件,仍然会使用E17),Jeff对E19也十分不满。他说道: ->除了性能问题外,对于我个人而言,E19并没有给我带来与E17下相同的工作流程,因为它移除了很多E17的特性。鉴于此,我不得不将我所有的3台Bodhi计算机桌面改成E17——这3台机器都是我高端的了。这不由得让我想到,我们还有多少现存的Bodhi用户也怀着和我同样的感受,所以,我[在我们的用户论坛上开启一个与此相关的讨论][5]。 +> 除了性能问题外,对于我个人而言,E19并没有给我带来与E17下相同的工作流程,因为它移除了很多E17的特性。鉴于此,我不得不将我所有的3台Bodhi计算机桌面改成E17——这3台机器都是我高端的了。这不由得让我想到,我们还有多少现存的Bodhi用户也怀着和我同样的感受,所以,我[在我们的用户论坛上开启一个与此相关的讨论][5]。 ### Moksha是E17桌面的延续 ### Moksha将会是Bodhi所热衷的E17桌面的延续。Jeff进一步提到: ->我们将从整合所有Bodhi修改开始。多年来我们一直都只是给源代码打补丁,并修复桌面所具有的问题。如果该工作完成,我们将开始移植一些E18和E19引入的更为有用的特性,最后,我们将引入一些我们认为会改善最终用户体验的东西。 + +> 我们将从整合所有Bodhi修改开始。多年来我们一直都只是给源代码打补丁,并修复桌面所带有的问题。如果该工作完成,我们将开始移植一些E18和E19引入的更为有用的特性,最后,我们将引入一些我们认为会改善最终用户体验的东西。 ### Moksha何时发布? ### -下一个Bodhi更新将会是Bodhi 3.1.0,就在今年八月。这个新版本将为所有其缺省ISO带来Moksha。让我们拭目以待,看看Moksha是否是一个好的决定。 +下一个Bodhi更新将会是Bodhi 3.1.0,就在今年八月。这个新版本将为所有其默认安装镜像带来Moksha。让我们拭目以待,看看Moksha是否是一个好的决定。 -------------------------------------------------------------------------------- @@ -27,7 +28,7 @@ via: http://itsfoss.com/bodhi-linux-introduces-moksha-desktop/ 作者:[Abhishek][a] 译者:[GOLinux](https://github.com/GOLinux) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 6bba9e9854a3a519595fcdc3ef6d163db036f160 Mon Sep 17 00:00:00 2001 From: joeren Date: Tue, 26 May 2015 08:00:11 +0800 Subject: [PATCH 162/965] Update 20150324 7 Quirky' ls' Command Tricks Every Linux User Should Know.md --- ... Quirky' ls' Command Tricks Every Linux User Should Know.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150324 7 Quirky' ls' Command Tricks Every Linux User Should Know.md b/sources/tech/20150324 7 Quirky' ls' Command Tricks Every Linux User Should Know.md index 9878cc8cee..6dbd6096a7 100644 --- a/sources/tech/20150324 7 Quirky' ls' Command Tricks Every Linux User Should Know.md +++ b/sources/tech/20150324 7 Quirky' ls' Command Tricks Every Linux User Should Know.md @@ -1,3 +1,4 @@ +Translating by GOLinux! 7 Quirky ‘ls’ Command Tricks Every Linux User Should Know ================================================================================ We have covered most of the things on ‘ls‘ command in last two articles of our Interview series. This article is the last part of the ‘ls command‘ series. If you have not gone through last two articles of this series you may visit the links below. @@ -160,4 +161,4 @@ via: http://www.tecmint.com/linux-ls-command-tricks/ [a]:http://www.tecmint.com/author/avishek/ [1]:http://www.tecmint.com/15-basic-ls-command-examples-in-linux/ [2]:http://www.tecmint.com/ls-command-interview-questions/ -[3]:http://www.tecmint.com/ls-interview-questions/ \ No newline at end of file +[3]:http://www.tecmint.com/ls-interview-questions/ From 74f19e09cb2d8ffb934eddc972ecc609c7ea85e6 Mon Sep 17 00:00:00 2001 From: GOLinux Date: Tue, 26 May 2015 08:57:47 +0800 Subject: [PATCH 163/965] [Translated]20150324 7 Quirky 'ls' Command Tricks Every Linux User Should Know.md --- ...and Tricks Every Linux User Should Know.md | 164 ------------------ ...and Tricks Every Linux User Should Know.md | 163 +++++++++++++++++ 2 files changed, 163 insertions(+), 164 deletions(-) delete mode 100644 sources/tech/20150324 7 Quirky' ls' Command Tricks Every Linux User Should Know.md create mode 100644 translated/tech/20150324 7 Quirky' ls' Command Tricks Every Linux User Should Know.md diff --git a/sources/tech/20150324 7 Quirky' ls' Command Tricks Every Linux User Should Know.md b/sources/tech/20150324 7 Quirky' ls' Command Tricks Every Linux User Should Know.md deleted file mode 100644 index 6dbd6096a7..0000000000 --- a/sources/tech/20150324 7 Quirky' ls' Command Tricks Every Linux User Should Know.md +++ /dev/null @@ -1,164 +0,0 @@ -Translating by GOLinux! -7 Quirky ‘ls’ Command Tricks Every Linux User Should Know -================================================================================ -We have covered most of the things on ‘ls‘ command in last two articles of our Interview series. This article is the last part of the ‘ls command‘ series. If you have not gone through last two articles of this series you may visit the links below. - -注:以下三篇都做过源文,看看翻译了没有,如果发布了可适当改链接地址 -- [15 Basic ‘ls’ Command Examples in Linux][] -- [15 Interview Questions on Linux “ls” Command – Part 1][] -- [10 Useful ‘ls’ Command Interview Questions – Part 2][] - -![7 Quirky ls Command Tricks](http://www.tecmint.com/wp-content/uploads/2015/03/ls-command-tricks.jpg) -7 Quirky ls Command Tricks - -### 1. List the contents of a directory with time using various time styles. ### - -To list the contents of a directory with times using style, we need to choose any of the below two methods. - - # ls -l –time-style=[STYLE] (Method A) - -**Note** – The above switch (`--time` style must be run with switch `-l`, else it won’t serve the purpose). - - # ls –full-time (Method B) - -Replace `[STYLE]` with any of the below option. - - full-iso - long-iso - iso - locale - +%H:%M:%S:%D - -**Note** – In the above line H(Hour), M(Minute), S(Second), D(Date) can be used in any order. - -Moreover you just choose those relevant and not all options. E.g., `ls -l --time-style=+%H` will show only hour. - -`ls -l --time-style=+%H:%M:%D` will show Hour, Minute and date. - - # ls -l --time-style=full-iso - -![ls Command Full Time Style](http://www.tecmint.com/wp-content/uploads/2015/03/ls-Command-Full-Time-Style.gif) -ls Command Full Time Style - - # ls -l --time-style=long-iso - -![Long Time Style Listing](http://www.tecmint.com/wp-content/uploads/2015/03/Long-Time-Listing-Format.gif) -Long Time Style Listing - - # ls -l --time-style=iso - -![Time Style Listing](http://www.tecmint.com/wp-content/uploads/2015/03/Local-Time-Style-Listing.gif) -Time Style Listing - - # ls -l --time-style=locale - -![Locale Time Style Listing](http://www.tecmint.com/wp-content/uploads/2015/03/Hour-Mintue-Time-Style-Listing.gif) -Locale Time Style Listing - - # ls -l --time-style=+%H:%M:%S:%D - -![Date and Time Style Listing](http://www.tecmint.com/wp-content/uploads/2015/03/Full-Time-Style-Listing.gif) -Date and Time Style Listing - - # ls --full-time - -![Full Style Time Listing](http://www.tecmint.com/wp-content/uploads/2015/03/Full-Style-Time-Listing.gif) - -Full Style Time Listing - -### 2. Output the contents of a directory in various formats such as separated by commas, horizontal, long, vertical, across, etc. ### - -Contents of directory can be listed using ls command in various format as suggested below. - -- across -- comma -- horizontal -- long -- single-column -- verbose -- vertical - - # ls –-format=across - # ls --format=comma - # ls --format=horizontal - # ls --format=long - # ls --format=single-column - # ls --format=verbose - # ls --format=vertical - -![Listing Formats of ls Command](http://www.tecmint.com/wp-content/uploads/2015/03/ls-command-Listing-Formats.gif) -Listing Formats of ls Command - -### 3. Use ls command to append indicators like (/=@|) in output to the contents of the directory. ### - -The option `-p` with ‘ls‘ command will server the purpose. It will append one of the above indicator, based upon the type of file. - - # ls -p - -![Append Indicators to Content](http://www.tecmint.com/wp-content/uploads/2015/03/Append-Indicators.gif) -Append Indicators to Content - -### 4. Sort the contents of directory on the basis of extension, size, time and version. ### - -We can use options like `--extension` to sort the output by extension, size by extension `--size`, time by using extension `-t` and version using extension `-v`. - -Also we can use option `--none` which will output in general way without any sorting in actual. - - # ls --sort=extension - # ls --sort=size - # ls --sort=time - # ls --sort=version - # ls --sort=none - -![Sort Listing of Content by Options](http://www.tecmint.com/wp-content/uploads/2015/03/Sort-Content-by-Extensions.gif) -Sort Listing of Content by Options - -### 5. Print numeric UID and GID for every contents of a directory using ls command. ### - -The above scenario can be achieved using flag -n (Numeric-uid-gid) along with ls command. - - # ls -n - -![Print Listing of Content by UID and GID](http://www.tecmint.com/wp-content/uploads/2015/03/Print-UID-GID-of-Contents.gif) -Print Listing of Content by UID and GID - -### 6. Print the contents of a directory on standard output in more columns than specified by default. ### - -Well ls command output the contents of a directory according to the size of the screen automatically. - -We can however manually assign the value of screen width and control number of columns appearing. It can be done using switch ‘`--width`‘. - - # ls --width 80 - # ls --width 100 - # ls --width 150 - -![List Content Based on Window Sizes](http://www.tecmint.com/wp-content/uploads/2015/03/List-Content-By-More-Column.gif) -List Content Based on Window Sizes - -**Note**: You can experiment what value you should pass with width flag. - -### 7. Include manual tab size at the contents of directory listed by ls command instead of default 8. ### - - # ls --tabsize=[value] - -![List Content by Table Size](http://www.tecmint.com/wp-content/uploads/2015/03/List-Content-by-Table-Size.gif) -List Content by Table Size - -**Note**: Specify the `[Value]=` Numeric value. - -That’s all for now. Stay tuned to Tecmint till we come up with next article. Do not forget to provide us with your valuable feedback in the comments below. Like and share us and help us get spread. - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/linux-ls-command-tricks/ - -作者:[Avishek Kumar][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://www.tecmint.com/author/avishek/ -[1]:http://www.tecmint.com/15-basic-ls-command-examples-in-linux/ -[2]:http://www.tecmint.com/ls-command-interview-questions/ -[3]:http://www.tecmint.com/ls-interview-questions/ diff --git a/translated/tech/20150324 7 Quirky' ls' Command Tricks Every Linux User Should Know.md b/translated/tech/20150324 7 Quirky' ls' Command Tricks Every Linux User Should Know.md new file mode 100644 index 0000000000..7793b856c2 --- /dev/null +++ b/translated/tech/20150324 7 Quirky' ls' Command Tricks Every Linux User Should Know.md @@ -0,0 +1,163 @@ +Linux用户应知应会的7个‘ls’命令异用技巧 +================================================================================ +在前面我们系列报道的两篇文章中,我们已经涵盖了关于‘ls’命令的绝大多数内容。本文时‘ls命令’系列的最后一部分。如果你还没有读过该系列的其它两篇文章,你可以访问下面的链接。 + +注:以下三篇都做过源文,看看翻译了没有,如果发布了可适当改链接地址 + +- [Linux中的15个‘ls’命令基本用法实例][1] +- [关于Linux “ls”命令的15个面试问题 – 第一部分][2] +- [10个有用的‘ls’命令面试问题 – 第二部分][3] + +![7 Quirky ls Command Tricks](http://www.tecmint.com/wp-content/uploads/2015/03/ls-command-tricks.jpg) +7个ls命令异用技巧 + +### 1. 以各种时间格式附带时间戳列出目录中的内容 ### + +要以时间格式列出目录内容,我们需要选择以下两种方法中的任何一种。 + + # ls -l –time-style=[STYLE] (方法 A) + +**注意** - 上面的开关(`--time`格式必须和`-l`开关同时使用,否则达不到目的)。 + + # ls –full-time (方法 B) + +用以下任何一个选项替换`[STYLE]`。 + + full-iso + long-iso + iso + locale + +%H:%M:%S:%D + +**注意** - 在上面行中,H(时),M(分),S(秒),D(日期)的顺序可以任意调整。 + +此外,你只需选择那些相关的选项,而不是所有选项。例如,`ls -l --time-style=+%H`将只显示小时。 + +`ls -l --time-style=+%H:%M:%D`将显示小时、分钟和日期。 + + # ls -l --time-style=full-iso + +![ls Command Full Time Style](http://www.tecmint.com/wp-content/uploads/2015/03/ls-Command-Full-Time-Style.gif) +ls命令完整时间格式 + + # ls -l --time-style=long-iso + +![Long Time Style Listing](http://www.tecmint.com/wp-content/uploads/2015/03/Long-Time-Listing-Format.gif) +长时间格式列表 + + # ls -l --time-style=iso + +![Time Style Listing](http://www.tecmint.com/wp-content/uploads/2015/03/Local-Time-Style-Listing.gif) +时间格式列表 + + # ls -l --time-style=locale + +![Locale Time Style Listing](http://www.tecmint.com/wp-content/uploads/2015/03/Hour-Mintue-Time-Style-Listing.gif) +本地时间格式列表 + + # ls -l --time-style=+%H:%M:%S:%D + +![Date and Time Style Listing](http://www.tecmint.com/wp-content/uploads/2015/03/Full-Time-Style-Listing.gif) +日期和时间格式列表 + + # ls --full-time + +![Full Style Time Listing](http://www.tecmint.com/wp-content/uploads/2015/03/Full-Style-Time-Listing.gif) +完整格式时间列表 + +### 2. 以多种格式列出目录内容,如以逗号分隔、水平格式、长格式、垂直格式、交叉格式等列出。 ### + +目录内容可以用以下建议的ls命令各种格式列出。 + +- 交叉 +- 逗号 +- 水平 +- 长格式 +- 单栏 +- 详情 +- 垂直 + + # ls –-format=across + # ls --format=comma + # ls --format=horizontal + # ls --format=long + # ls --format=single-column + # ls --format=verbose + # ls --format=vertical + +![Listing Formats of ls Command](http://www.tecmint.com/wp-content/uploads/2015/03/ls-command-Listing-Formats.gif) +ls命令的列出格式 + +### 3. 使用ls命令为目录内容输出结果添加像(/=@|)这样的指示符。 ### + +带有`-p`选项的ls命令将实现该目的。它会根据文件类型添加上面这些指示符其中之一。 + + # ls -p + +![Append Indicators to Content](http://www.tecmint.com/wp-content/uploads/2015/03/Append-Indicators.gif) +添加指示符到内容 + +### 4. 根据扩展名、大小、时间和版本对目录内容排序。 ### + +我们可以使用`--extension`选项来按照扩展名对输出结果排序,`--size`扩展选项按照大小排序,`-t`扩展选项按照时间排序,`-v`扩展选项对版本排序。 + +我们也可以使用`--none`选项,它会以常规方式输出结果而不会进行排序。 + + # ls --sort=extension + # ls --sort=size + # ls --sort=time + # ls --sort=version + # ls --sort=none + +![Sort Listing of Content by Options](http://www.tecmint.com/wp-content/uploads/2015/03/Sort-Content-by-Extensions.gif) +通过选项对内容排序列出 + +### 5. 使用ls命令打印目录中各个内容的数字UID和GID。 ### + +上面的环境可以通过使用带有-n标识的ls命令来实现。 + + # ls -n + +![Print Listing of Content by UID and GID](http://www.tecmint.com/wp-content/uploads/2015/03/Print-UID-GID-of-Contents.gif) +通过UID和GID对打印内容列表 + +### 6. 标准输出结果中打印目录内容中比默认指定的更多栏目。 ### + +好吧,ls命令根据屏幕大小自动输出目录内容。 + +然而,我们可以手动分配屏幕宽度的值和出现的栏目的控制数。这可以通过使用‘`--width`’开关实现。 + + # ls --width 80 + # ls --width 100 + # ls --width 150 + +![List Content Based on Window Sizes](http://www.tecmint.com/wp-content/uploads/2015/03/List-Content-By-More-Column.gif) +根据窗口大小列出内容 + +**注意**: 你可以试验你可以给width标识传递什么值。 + +### 7. 通过ls命令为列出的目录内容手动指定的tab大小而不是默认的8。 ### + + # ls --tabsize=[value] + +![List Content by Table Size](http://www.tecmint.com/wp-content/uploads/2015/03/List-Content-by-Table-Size.gif) +按表尺寸列出内容 + +**注意**: 指定`[Value]=`的数值。 + +到目前为止,都讲完了。保持连线到Tecmint,我们会推出下一篇文章。别忘了在下面的评论中为我们提供有价值的反馈。为我们点赞并分享,帮我们推广。 + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/linux-ls-command-tricks/ + +作者:[Avishek 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.tecmint.com/author/avishek/ +[1]:http://www.tecmint.com/15-basic-ls-command-examples-in-linux/ +[2]:http://www.tecmint.com/ls-command-interview-questions/ +[3]:http://www.tecmint.com/ls-interview-questions/ From 256868dc935b283252a1d030983c04f65ec97e23 Mon Sep 17 00:00:00 2001 From: joeren Date: Tue, 26 May 2015 09:01:58 +0800 Subject: [PATCH 164/965] Update 20150119 Unity Greeter Badges Brings Missing Session Icons to Ubuntu Login Screen.md --- ...dges Brings Missing Session Icons to Ubuntu Login Screen.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150119 Unity Greeter Badges Brings Missing Session Icons to Ubuntu Login Screen.md b/sources/tech/20150119 Unity Greeter Badges Brings Missing Session Icons to Ubuntu Login Screen.md index 1aac09e11a..a71d60e25f 100644 --- a/sources/tech/20150119 Unity Greeter Badges Brings Missing Session Icons to Ubuntu Login Screen.md +++ b/sources/tech/20150119 Unity Greeter Badges Brings Missing Session Icons to Ubuntu Login Screen.md @@ -1,3 +1,4 @@ +Translating by GOLinux! ‘Unity Greeter Badges’ Brings Missing Session Icons to Ubuntu Login Screen ================================================================================ ![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/01/unity-greeter-badges-750x321.jpg) @@ -55,4 +56,4 @@ via: http://www.omgubuntu.co.uk/2015/01/unity-greeter-badges-brings-missing-sess [a]:https://plus.google.com/117485690627814051450/?rel=author [1]:https://launchpad.net/~profzoom [2]:https://launchpad.net/~profzoom/+archive/ubuntu/misc/+files/unity-greeter-badges_0.1-0ubuntu1%7E201412111501%7Eubuntu14.04.1_all.deb -[3]:https://launchpad.net/~profzoom/+archive/ubuntu/misc/+files/unity-greeter-badges_0.1-0ubuntu1%7E201412111501%7Eubuntu14.10.1_all.deb \ No newline at end of file +[3]:https://launchpad.net/~profzoom/+archive/ubuntu/misc/+files/unity-greeter-badges_0.1-0ubuntu1%7E201412111501%7Eubuntu14.10.1_all.deb From 061ac073b5b914e33647febf4695c650381e08eb Mon Sep 17 00:00:00 2001 From: GOLinux Date: Tue, 26 May 2015 10:06:37 +0800 Subject: [PATCH 165/965] [Translated]20150119 Unity Greeter Badges Brings Missing Session Icons to Ubuntu Login Screen.md --- ...ng Session Icons to Ubuntu Login Screen.md | 59 ------------------- ...ng Session Icons to Ubuntu Login Screen.md | 56 ++++++++++++++++++ 2 files changed, 56 insertions(+), 59 deletions(-) delete mode 100644 sources/tech/20150119 Unity Greeter Badges Brings Missing Session Icons to Ubuntu Login Screen.md create mode 100644 translated/tech/20150119 Unity Greeter Badges Brings Missing Session Icons to Ubuntu Login Screen.md diff --git a/sources/tech/20150119 Unity Greeter Badges Brings Missing Session Icons to Ubuntu Login Screen.md b/sources/tech/20150119 Unity Greeter Badges Brings Missing Session Icons to Ubuntu Login Screen.md deleted file mode 100644 index a71d60e25f..0000000000 --- a/sources/tech/20150119 Unity Greeter Badges Brings Missing Session Icons to Ubuntu Login Screen.md +++ /dev/null @@ -1,59 +0,0 @@ -Translating by GOLinux! -‘Unity Greeter Badges’ Brings Missing Session Icons to Ubuntu Login Screen -================================================================================ -![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/01/unity-greeter-badges-750x321.jpg) - -**A new package available in Ubuntu 15.04 solves a petty gripe I have with the Unity Greeter: the lack of branded icons for alternative desktop sessions like Cinnamon.** - -I know it’s a minor quibble; it’s a visual paper cut with minimal impact for most. But the inconsistency niggles me because Ubuntu ships with icons for a number of sessions, including Unity, GNOME and KDE. Other DEs, including some of its own flavors like Xubuntu, default to showing a plain white dot in the session switcher list and the main user pod. - -The inconsistency these dots create jars, even if it is only for a fleeting moment, not just in design. It’s in usability too. Branded glyphs are helpful in letting us know what session we’re about to log in to. - -For instance, can you tell what session this is? - -![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/01/what-session-is-this-750x247.jpg) - -Budgie? Maybe MATE? Could be Cinnamon…I’d have to click on it and check first. - -It doesn’t have to be this way. The Unity Greeter is built such that the developers of desktop environments can ship badges that appear in the Greeter (and some do). But in many cases, like MATE whose packages are imported from upstream Debian, the inclination to carry an “Ubuntu-specific patch” is either not desirable or not possible. - -### A Solution Is Badged ### - -Experienced Debian maintainer [Doug Torrance][1] has a solution to fix this usability paper cut. Rather than rely on desktop makers themselves to add branded badges to their packages, and rather than burden Ubuntu with the responsibility of maintaining it, Torrance has created a separate ‘unity-greeter-badges’ package to house them. - -In assuming responsibility for providing the session glyphs directly, this package ensure that new and old window managers, session and desktops alike are catered for. - -Among the 30 or so desktop environments it bundles new session badges for are: - -- Xubuntu -- Cinnamon -- MATE -- Cairo-Dock -- Xmonad -- Awesome -- OpenBox -- Pantheon - -The best part is that ‘**Unity-Greeter-Badges**’ has been accepted into Ubuntu 15.04. That means Torrance’s package will be available to install directly, no PPAs or downloads needed. In not being part of a core package like the Unity Greeter it can be updated with newer icons in a more efficient and timely manner. - -If you’re running Ubuntu 15.04 you will find the package available to install from the Software Center in the coming days. - -Don’t want to wait until 15.04? Torrance has made .deb installers for Ubuntu 14.04 LTS and Ubuntu 14.10 users. - -- [Download unity-greeter-badges for Ubuntu 14.04][2] -- [Download unity-greeter-badges for Ubuntu 14.10][3] - --------------------------------------------------------------------------------- - -via: http://www.omgubuntu.co.uk/2015/01/unity-greeter-badges-brings-missing-session-icons-ubuntu-login-screen - -作者:[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://launchpad.net/~profzoom -[2]:https://launchpad.net/~profzoom/+archive/ubuntu/misc/+files/unity-greeter-badges_0.1-0ubuntu1%7E201412111501%7Eubuntu14.04.1_all.deb -[3]:https://launchpad.net/~profzoom/+archive/ubuntu/misc/+files/unity-greeter-badges_0.1-0ubuntu1%7E201412111501%7Eubuntu14.10.1_all.deb diff --git a/translated/tech/20150119 Unity Greeter Badges Brings Missing Session Icons to Ubuntu Login Screen.md b/translated/tech/20150119 Unity Greeter Badges Brings Missing Session Icons to Ubuntu Login Screen.md new file mode 100644 index 0000000000..c6c195585e --- /dev/null +++ b/translated/tech/20150119 Unity Greeter Badges Brings Missing Session Icons to Ubuntu Login Screen.md @@ -0,0 +1,56 @@ +‘Unity Greeter标识卡’——将丢失的会话带回Ubuntu登录屏幕 +================================================================================ +![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/01/unity-greeter-badges-750x321.jpg) + +**Ubuntu 15.04中的一个新包解决了我对Unity Greeter抱有的微词:缺乏其它像Cinnamon这样的Linux桌面会话的标牌式图标。** + +我知道这有点吹毛求疵了;这只是对大多数人而言几乎毫无影响的视觉裂痕而已。但是这种不一致性时时刻刻缠绕着我,让我不胜其烦,因为Ubuntu自带了大量的会话,包括Unity、GNOME和KDE。其它桌面环境,包括它自己的一些跳制品,像Xubuntu,都默认在会话切换列表和主用户界面显示了一个朴素的白点。 + +这些点点们造成的这种不一致性刺激着神经,即使它只是稍纵即逝,但这种刺激不仅仅来自设计,也来自可用性方面。标牌式的标志符号对于让我们知道我们即将登陆到哪个会话很有帮助。 + +例如,你能告诉我们这个是个什么会话呢? + +![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/01/what-session-is-this-750x247.jpg) + +没有必要这样做啊。构建Unity Greeter,就是为了让桌面环境开发者能够部署标识卡到欢迎屏幕中(有些确实这样做了)。但在许多情况下,像MATE,它的包来自上游的Debian,想要移植一个“Ubuntu专用的补丁包”不太可取,也不太可能。 + +### 一个解决方案出炉了 ### + +有经验的Debian维护者[Doug Torrance][1]得到了修复该可用性裂痕的解决方案。与其依赖桌面制造者自己来添加品牌式标识卡到他们的包中,与其给Ubuntu增加维护它的责任重担,Torrance还不如自己创建了一个独立的‘unity-greeter-badges’包来收容它们。 + +承担起了直接提供会话标志的假定责任后,该包确保能同时迎合新旧窗口管理器、会话和桌面。 + +在30个左右的桌面环境中,它为以下桌面捆绑了新的会话标识卡: + +- Xubuntu +- Cinnamon +- MATE +- Cairo-Dock +- Xmonad +- Awesome +- OpenBox +- Pantheon + +最重要的是,‘**Unity-Greeter-Badges**’已经被Ubuntu 15.04收录进去。这就意味着Torrance的包将可以直接安装,不需要PPA,也不需要下载。没有像Unity Greeter一样成为核心包的一部分,它可以以更高效和更及时的方式更新新的图标。 + +如果你真运行着Ubuntu 15.04,在不久的将来,你就可以从软件中心获取并安装该包了。 + +不想等到15.04?Torrance已经为Ubuntu 14.04和Ubuntu 14.10用户做了个.deb安装器。 + +- [下载用于Ubuntu 14.04的unity-greeter-badges][2] +- [下载用于Ubuntu 14.10的unity-greeter-badges][3] + +-------------------------------------------------------------------------------- + +via: http://www.omgubuntu.co.uk/2015/01/unity-greeter-badges-brings-missing-session-icons-ubuntu-login-screen + +作者:[Joey-Elijah Sneddon][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/117485690627814051450/?rel=author +[1]:https://launchpad.net/~profzoom +[2]:https://launchpad.net/~profzoom/+archive/ubuntu/misc/+files/unity-greeter-badges_0.1-0ubuntu1%7E201412111501%7Eubuntu14.04.1_all.deb +[3]:https://launchpad.net/~profzoom/+archive/ubuntu/misc/+files/unity-greeter-badges_0.1-0ubuntu1%7E201412111501%7Eubuntu14.10.1_all.deb From 2288045799052ea7ee6ce37b131e6bf32b96f15f Mon Sep 17 00:00:00 2001 From: joeren Date: Tue, 26 May 2015 10:11:42 +0800 Subject: [PATCH 166/965] Update 20150525 Linux ntopng--Network Monitoring Tool Installation Screenshots.md --- ...ntopng--Network Monitoring Tool Installation Screenshots.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150525 Linux ntopng--Network Monitoring Tool Installation Screenshots.md b/sources/tech/20150525 Linux ntopng--Network Monitoring Tool Installation Screenshots.md index 01fc6f5e68..17c3add528 100644 --- a/sources/tech/20150525 Linux ntopng--Network Monitoring Tool Installation Screenshots.md +++ b/sources/tech/20150525 Linux ntopng--Network Monitoring Tool Installation Screenshots.md @@ -1,3 +1,4 @@ +Translating by GOLinux! Linux ntopng - Network Monitoring Tool Installation (Screenshots) ================================================================================ Nowdays computers are connected between each other. From the small area such as your home Local Area Network (LAN) until the the biggest one which we call - Internet. When you are managing a network computer, you are managing one of the most critical component. Since most of developed application is web based application, the network between critical. @@ -185,4 +186,4 @@ via: http://linoxide.com/monitoring-2/ntopng-network-monitoring-tool/ [2]:http://www.ntop.org/products/ntop/ [3]:http://www.nmon.net/packages/ [4]:http://yourserver.name:3000/ -[5]:http://www.ntop.org/ \ No newline at end of file +[5]:http://www.ntop.org/ From 5f44f9efdf760b3bf57fc4715a8856b27ee357f2 Mon Sep 17 00:00:00 2001 From: ZTinoZ Date: Tue, 26 May 2015 11:56:54 +0800 Subject: [PATCH 167/965] Translating by ZTinoZ --- ... Things to Do After Installing Ubuntu 15.04 Desktop.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sources/tech/20150427 15 Things to Do After Installing Ubuntu 15.04 Desktop.md b/sources/tech/20150427 15 Things to Do After Installing Ubuntu 15.04 Desktop.md index 9c897e60c4..f9c8bc9bc1 100644 --- a/sources/tech/20150427 15 Things to Do After Installing Ubuntu 15.04 Desktop.md +++ b/sources/tech/20150427 15 Things to Do After Installing Ubuntu 15.04 Desktop.md @@ -230,7 +230,7 @@ Add Cairo Dock at Startup $ sudo apt-get install compiz compizconfig-settings-manager compiz-plugins-extra -想要激活桌面Cube效果,search for ccsm on Dash, open CompizConfig Settings Manager, go to General Options – > Desktop Size and set Horizontal Virtual Size value to 4 and Vertical Virtual Size to 1. Then go back and check Desktop Cube (Disable Desktop Wall) and Rotate Cube boxes (Resolve Conflicts ->Disable Switch to Viewport 1) and press Ctrl+Alt+Left Mouse Click to view the cube effect. +想要激活桌面Cube效果,在Dash上查找ccsm,打开CompizConfig Settings Manager,找到General Options – > Desktop Size并设置Horizontal Virtual Size的值为4,Vertical Virtual Size的值为1。然后返回检查Desktop Cube框(禁用Desktop Wall)和Rotate Cube框(解决冲突 -> 禁止切换视图1)并Ctrl+Alt+鼠标左击来查看cube效果。 ![Enable Compiz](http://www.tecmint.com/wp-content/uploads/2015/04/enable-compiz.jpg) Enable Compiz @@ -246,7 +246,7 @@ Desktop Window Rotating ### 15. 添加额外浏览器支持 ### -Ubuntu 15.04 comes by default with Mozilla Firefox Web Browser. To install other browsers such as Google Chrome or Opera, visit their official web pages, download the provided .deb packages and install them on your system using the Gdebi Package Installer. +Ubuntu 15.04默认浏览器是Mozilla Firefox。想要安装其它浏览器比如Google Chrome或Opera,可以访问它们的官方网站,下载所提供的.deb包并用Gdebi Package Installer在你的系统上安装它们。 ![Enable Browser Support](http://www.tecmint.com/wp-content/uploads/2015/04/enable-browser-support.jpg) Enable Browser Support @@ -260,7 +260,7 @@ To install Chromium Open Source browser issue the following command on Terminal. ### 16. 安装Tweak工具 ### -Want extra applications for customizing Ubuntu? Then install Unity Tweak Tool and Gnome Tweak Tool by issuing the following commands on Terminal. +想要用额外的应用程序来自定义Ubuntu吗?在终端上输入以下命令来安装Unity Tweak工具和Gnome Tweak工具: $ sudo apt-get install unity-tweak-tool gnome-tweak-tool @@ -270,7 +270,7 @@ Install Tweak Tool ![Tweak Tool Settings](http://www.tecmint.com/wp-content/uploads/2015/04/tweak-settings.jpg) Tweak Tool Settings -Another interesting tweak tool is represented by the Ubuntu Tweak package which can be obtained and installed by visiting the webpage: [http://ubuntu-tweak.com/][2]. +另一个有趣的tweak工具主要是Ubuntu Tweak包,可以通过访问官方网站来获取并安装: [http://ubuntu-tweak.com/][2]. ![Tweak Tool: System Information](http://www.tecmint.com/wp-content/uploads/2015/04/tweak-system-info.jpg) Tweak Tool: System Information From 21a11465ae3944f4cd205caadbbd10f6dee56fa3 Mon Sep 17 00:00:00 2001 From: DeadFire Date: Tue, 26 May 2015 14:20:13 +0800 Subject: [PATCH 168/965] =?UTF-8?q?20150526-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... 20 Useful Terminal Emulators for Linux.md | 300 ++++++++++++++++++ 1 file changed, 300 insertions(+) create mode 100644 sources/tech/20150526 20 Useful Terminal Emulators for Linux.md diff --git a/sources/tech/20150526 20 Useful Terminal Emulators for Linux.md b/sources/tech/20150526 20 Useful Terminal Emulators for Linux.md new file mode 100644 index 0000000000..1615d3ca1a --- /dev/null +++ b/sources/tech/20150526 20 Useful Terminal Emulators for Linux.md @@ -0,0 +1,300 @@ +20 Useful Terminal Emulators for Linux +================================================================================ +A Terminal emulator is a computer program that reproduces a video terminal within some other display structure. In other words the Terminal emulator has an ability to make a dumb machine appear like a client computer networked to the server. The terminal emulator allows an end user to access console as well as its applications such as text user interface and command line interface. + +![Linux Terminal Emulators](http://www.tecmint.com/wp-content/uploads/2014/01/Linux-Terminal-Emulators1.jpeg) + +20 Linux Terminal Emulators + +You may find huge number of terminal emulators to choose from this open source world. Some of them offers large range of features while others offers less features. To give a better understanding to the quality of software that are available, we have gathered a list of marvelous terminal emulator for Linux. Each title provides its description and feature along with screenshot of the software with relevant download link. + +### 1. Terminator ### + +Terminator is an advanced and powerful terminal emulator which supports multiple terminals windows. This emulator is fully customizable. You can change the size, colour, give different shapes to the terminal. Its very user friendly and fun to use. + +#### Features of Terminator #### + +- Customize your profiles and colour schemes, set the size to fit your needs. +- Use plugins to get even more functionality. +- Several key-shortcuts are available to speed up common activities. +- Split the terminal window into several virtual terminals and re-size them as needed. + +![Terminator Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/Terminator-Emulator.jpeg) + +Terminator Terminal + +- [Terminator Homepage][1] +- [Download and Installation Instructions][2] + +### 2. Tilda ### + +Tilda is a stylish drop-down terminal based on GTK+. With the help of a single key press you can launch a new or hide Tilda window. However, you can add colors of your choice to change the look of the text and Terminal background. + +#### Features of Tilda #### + + Interface with Highly customization option. + You can set the transparency level for Tilda window. + Excellent built-in colour schemes. + +![Tilda Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/Tilda-Emulator.jpeg) + +Tilda Terminal + +- [Tilda Homepage][3] + +### 3. Guake ### + +Guake is a python based drop-down terminal created for the GNOME Desktop Environment. It is invoked by pressing a single keystroke, and can make it hidden by pressing same keystroke again. Its design was determined from FPS (First Person Shooter) games such as Quake and one of its main target is be easy to reach. + +Guake is very much similar to Yakuaka and Tilda, but it’s an experiment to mix the best of them into a single GTK-based program. Guake has been written in python from scratch using a little piece in C (global hotkeys stuff). + +![Guake Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/Guake-Terminal.jpeg) + +Guake Terminal + +- [Guake Homepage][4] + +### 4. Yakuake ### + +Yakuake (Yet Another Kuake) is a KDE based drop-down terminal emulator very much similar to Guake terminal emulator in functionality. It’s design was inspired from fps consoles games such as Quake. + +Yakuake is basically a KDE application, which can be easily installed on KDE desktop, but if you try to install Yakuake in GNOME desktop, it will prompt you to install huge number of dependency packages. + +#### Yakuake Features #### + +- Fluently turn down from the top of your screen +- Tabbed interface +- Configurable dimensions and animation speed +- Customizable + +![Yakuake Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/Yakuake-Terminal.jpeg) + +Yakuake Terminal + +- [Yakuake Homepage][5] + +### 5. ROXTerm ### + +ROXterm is yet another lightweight terminal emulator designed to provide similar features to gnome-terminal. It was originally constructed to have lesser footprints and faster start-up time by not using the Gnome libraries and by using a independent applet to bring the configuration interface (GUI), but over the time it’s role has shifted to bringing a higher range of features for power users. + +However, it is more customizable than gnome-terminal and anticipated more at “power” users who make excessive use of terminals. It is easily integrated with GNOME desktop environment and provides features like drag & drop of items into terminal. + +![Roxterm Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/Roxterm-Terminal.jpeg) + +Roxterm Terminal + +- [ROXTerm Homepage][6] + +### 6. Eterm ### + +Eterm is a lightest color terminal emulator designed as a replacement for xterm. It is developed with a Freedom of Choice ideology, leaving as much power, flexibility, and freedom as workable in the hands of the user. + +![Eterm Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/Eterm-Terminal.jpeg) + +Eterm Terminal + +- [Eterm Homepage][7] + +### 7. Rxvt ### + +Rxvt stands for extended virtual terminal is a color terminal emulator application for Linux intended as an xterm replacement for power users who don’t need to have a feature such as Tektronix 4014 emulation and toolkit-style configurability. + +![Rxvt Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/Rxvt-Terminal.jpeg) + +Rxvt Terminal + +- [Rxvt Homepage][8] + +### 8. Wterm ### + +Wterm is a another light weight color terminal emulator based on rxvt project. It includes features such as background images, transparency, reverse transparency and an considerable set or runtime options are accessible resulting in a very high customizable terminal emulator. + +![wterm Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/wterm-Terminal-.jpeg) + +wterm Terminal + +- [Wterm Homepage][9] + +### 9. LXTerminal ### + +LXTerminal is a default VTE-based terminal emulator for LXDE (Lightweight X Desktop Environment) without any unnecessary dependency. The terminal has got some nice features such as. +LXTerminal Features + +- Multiple tabs support +- Supports common commands like cp, cd, dir, mkdir, mvdir. +- Feature to hide the menu bar for saving space +- Change the color scheme. + +![lxterminal Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/lxterminal-Terminal.jpeg) + +lxterminal Terminal + +- [LXTerminal Homepage][10] + +### 10. Konsole ### + +Konsole is yet another powerful KDE based free terminal emulator was originally created by Lars Doelle. +Konsole Features + +- Multiple Tabbed terminals. +- Translucent backgrounds. +- Support for Split-view mode. +- Directory and SSH bookmarking. +- Customizable color schemes. +- Customizable key bindings. +- Notification alerts about activity in a terminal. +- Incremental search +- Support for Dolphin file manager +- Export of output in plain text or HTML format. + +![Konsole Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/Konsole-Terminal.jpeg) + +Konsole Terminal + +- [Konsole Homepage][11] + +### 11. TermKit ### + +TermKit is a elegant terminal that aims to construct aspects of the GUI with the command line based application using WebKit rendering engine mostly used in web browsers like Google Chrome and Chromium. TermKit is originally designed for Mac and Windows, but due to TermKit fork by Floby which you can now able to install it under Linux based distributions and experience the power of TermKit. + +![TermKit Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/TermKit-Terminal.jpeg) + +TermKit Terminal + +- [TermKit Homepage][12] + +12. st + +st is a simple terminal implementation for X Window. + +![st terminal](http://www.tecmint.com/wp-content/uploads/2014/01/st-terminal.png) + +st terminal + +- [st Homepage][13] + +### 13. Gnome-Terminal ### + +GNOME terminal is a built-in terminal emulator for GNOME desktop environment developed by Havoc Pennington and others. It allow users to run commands using a real Linux shell while remaining on the on the GNOME environment. GNOME Terminal emulates the xterm terminal emulator and brings a few similar features. + +The Gnome terminal supports multiple profiles, where users can able to create multiple profiles for his/her account and can customize configuration options such as fonts, colors, background image, behavior, etc. per account and define a name to each profile. It also supports mouse events, url detection, multiple tabs, etc. + +![Gnome Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/Gnome-terminal.jpg) + +Gnome Terminal + +- [Gnome Terminal][14] + +### 14. Final Term ### + +Final Term is a open source stylish terminal emulator that has some exciting capabilities and handy features into one single beautiful interface. It is still under development, but provides significant features such as Semantic text menus, Smart command completion, GUI terminal controls, Omnipotent keybindings, Color support and many more. The following animated screen grab demonstrates some of their features. Please click on image to view demo. + +![FinalTerm Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/FinalTerm.gif) + +FinalTerm Terminal + +- [Final Term][15] + +### 15. Terminology ### + +Terminology is yet another new modern terminal emulator created for the Enlightenment desktop, but also can be used in different desktop environments. It has some awesome unique features, which do not have in any other terminal emulator. + +Apart features, terminology offers even more things that you wouldn’t assume from a other terminal emulators, like preview thumbnails of images, videos and documents, it also allows you to see those files directly from Terminology. + +You can watch a following demonstrations video created by the Terminology developer (the video quality isn’t clear, but still it’s enough to get the idea about Terminology). + + + +- [Terminology][16] + +### 16. Xfce4 terminal ### + +Xfce terminal is a lightweight modern and easy to use terminal emulator specially designed for Xfce desktop environment. The latest release of xfce terminal has some new cool features such as search dialog, tab color changer, drop-down console like Guake or Yakuake and many more. + +![Xfce Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/xfce-terminal.jpg) + +Xfce Terminal + +- [Xfce4 Terminal][17] + +### 17. xterm ### + +The xterm application is a standard terminal emulator for the X Window System. It maintain DEC VT102 and Tektronix 4014 compatible terminals for applications that can’t use the window system directly. + +![xterm Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/xterm.jpg) + +xterm Terminal + +- [xterm][18] + +### 18. LilyTerm ### + +The LilyTerm is a another less known open source terminal emulator based off of libvte that desire to be fast and lightweight. LilyTerm also include some key features such as: + +- Support for tabbing, coloring and reordering tabs +- Ability to manage tabs through keybindings +- Support for background transparency and saturation. +- Support for user specific profile creation. +- Several customization options for profiles. +- Extensive UTF-8 support. + +![Lilyterm Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/Lilyterm.jpg) + +Lilyterm Terminal + +- [LilyTerm][19] + +### 19. Sakura ### + +The sakura is a another less known Unix style terminal emulator developed for command line purpose as well as text-based terminal programs. Sakura is based on GTK and livte and provides not more advanced features but some customization options such as multiple tab support, custom text color, font and background images, speedy command processing and few more. + +![Sakura Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/sakura.jpg) + +Sakura Terminal + +- [Sakura][20] + +### 20. rxvt-unicode ### + +The rxvt-unicode (also known as urxvt) is a yet another highly customizable, lightweight and fast terminal emulator with xft and unicode support was developed by Marc Lehmann. It got some outstanding features such as support for international language via Unicode, the ability to display multiple font types and support for Perl extensions. + +![rxvt unicode](http://www.tecmint.com/wp-content/uploads/2014/01/rxvt-unicode.png) + +rxvt unicode + +- [rxvt-unicode][21] + +If you know any other capable Linux terminal emulators that I’ve not included in the above list, please do share with me using our comment section. + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/linux-terminal-emulators/ + +作者:[Ravi Saive][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/admin/ +[1]:https://launchpad.net/terminator +[2]:http://www.tecmint.com/terminator-a-linux-terminal-emulator-to-manage-multiple-terminal-windows/ +[3]:http://tilda.sourceforge.net/tildaabout.php +[4]:https://github.com/Guake/guake +[5]:http://extragear.kde.org/apps/yakuake/ +[6]:http://roxterm.sourceforge.net/index.php?page=index&lang=en +[7]:http://www.eterm.org/ +[8]:http://sourceforge.net/projects/rxvt/ +[9]:http://sourceforge.net/projects/wterm/ +[10]:http://wiki.lxde.org/en/LXTerminal +[11]:http://konsole.kde.org/ +[12]:https://github.com/unconed/TermKit +[13]:http://st.suckless.org/ +[14]:https://help.gnome.org/users/gnome-terminal/stable/ +[15]:http://finalterm.org/ +[16]:http://www.enlightenment.org/p.php?p=about/terminology +[17]:http://docs.xfce.org/apps/terminal/start +[18]:http://invisible-island.net/xterm/ +[19]:http://lilyterm.luna.com.tw/ +[20]:https://launchpad.net/sakura +[21]:http://software.schmorp.de/pkg/rxvt-unicode \ No newline at end of file From b39dcdba744df75f2c91ef6f7b12153e1c560c73 Mon Sep 17 00:00:00 2001 From: ZTinoZ Date: Tue, 26 May 2015 15:13:31 +0800 Subject: [PATCH 169/965] Finish the translation by ZTinoZ --- ... Things to Do After Installing Ubuntu 15.04 Desktop.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) rename {sources => translated}/tech/20150427 15 Things to Do After Installing Ubuntu 15.04 Desktop.md (95%) diff --git a/sources/tech/20150427 15 Things to Do After Installing Ubuntu 15.04 Desktop.md b/translated/tech/20150427 15 Things to Do After Installing Ubuntu 15.04 Desktop.md similarity index 95% rename from sources/tech/20150427 15 Things to Do After Installing Ubuntu 15.04 Desktop.md rename to translated/tech/20150427 15 Things to Do After Installing Ubuntu 15.04 Desktop.md index f9c8bc9bc1..e806e8e436 100644 --- a/sources/tech/20150427 15 Things to Do After Installing Ubuntu 15.04 Desktop.md +++ b/translated/tech/20150427 15 Things to Do After Installing Ubuntu 15.04 Desktop.md @@ -1,4 +1,4 @@ -安装完Ubuntu 15.04桌面后要做的16件事 +安装完Ubuntu 15.04桌面后要做的15件事 ================================================================================ 本教程适用于新手和在自己的电脑上安装好Ubuntu 15.04 “Vivid Vervet” 桌面之后为了自定义自己的系统并安装一些基本程序作为日常使用的已经做了一些准备的人。 @@ -254,7 +254,7 @@ Enable Browser Support ![Opera Browser Support](http://www.tecmint.com/wp-content/uploads/2015/04/opera.jpg) Opera Browser Support -To install Chromium Open Source browser issue the following command on Terminal. +想要安装Chromium开源浏览器请在终端上输入以下命令: $ sudo apt-get install chromium-browser @@ -275,13 +275,13 @@ Tweak Tool Settings ![Tweak Tool: System Information](http://www.tecmint.com/wp-content/uploads/2015/04/tweak-system-info.jpg) Tweak Tool: System Information -After you have installed all this bunch of software, you might want to clean your system in order to free some space on the hard drive, by issuing the following commands: +在你安装好这一连串软件之后,你或许想要清理一下你的系统来释放一点硬盘上的空间,输入以下命令即可: $ sudo apt-get -y autoremove $ sudo apt-get -y autoclean $ sudo apt-get -y clean -This are just a few tweaks and programs that an average user might install and use on Ubuntu 15.04 Desktop for daily basic utilization. For more advanced programs, features and utilities use Ubuntu Software Center or consult Ubuntu Wiki webpage. +这只是tweaks工具中的其中一些和普通用户日常生活中可能会在Ubuntu 15.04桌面上安装使用的程序。想要了解更多高级的程序,特性和功能,请使用Ubuntu Software Center或查阅Ubuntu Wiki主页。 -------------------------------------------------------------------------------- From 83d09aabc862795bd30f75273b23c320fb5adb9e Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 26 May 2015 15:37:16 +0800 Subject: [PATCH 170/965] PUB:20150331 Linux Email App Geary Updated--How To Install It In Ubuntu @ictlyh --- ...ry Updated--How To Install It In Ubuntu.md | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) rename {translated/tech => published}/20150331 Linux Email App Geary Updated--How To Install It In Ubuntu.md (78%) diff --git a/translated/tech/20150331 Linux Email App Geary Updated--How To Install It In Ubuntu.md b/published/20150331 Linux Email App Geary Updated--How To Install It In Ubuntu.md similarity index 78% rename from translated/tech/20150331 Linux Email App Geary Updated--How To Install It In Ubuntu.md rename to published/20150331 Linux Email App Geary Updated--How To Install It In Ubuntu.md index c5920123c6..da976c42d0 100644 --- a/translated/tech/20150331 Linux Email App Geary Updated--How To Install It In Ubuntu.md +++ b/published/20150331 Linux Email App Geary Updated--How To Install It In Ubuntu.md @@ -1,20 +1,21 @@ -Linux Email应用 Geary 更新了 — 如何在Ubuntu上安装 +Linux Email应用 Geary 更新了 ================================================================================ **Geary,Linux上流行的桌面email客户端,更新到版本0.10了 — 并且有了很多新的功能。** ![elementary OS上运行的旧版本的Geary](http://www.omgubuntu.co.uk/wp-content/uploads/2015/01/geary.jpg) -elementary OS上运行的旧版本的Geary -Geary 0.10有一些可惜的用户界面改进以及额外的UI选项,包括: +*elementary OS上运行的旧版本的Geary* -- 新增: 可以对归档,删除以及移动做'Undo'操作 +Geary 0.10有一些不错的用户界面改进以及额外的UI功能,包括: + +- 新增: 可以撤销归档、删除以及移动等操作 - 新增: 在2列或者2列布局之间切换 - 新的 “split header bar” — 改进邮件列表,发件人布局 - 新的快捷键 — 使用j/k切换到上/下一封邮件 -根据Yorba介绍,这次更新还提出了一个 **全新的全文检索算法** ,用来改进Geary的搜索体验。 +根据Yorba介绍,这次更新还引入了一个**全新的全文检索算法** ,用来改进Geary的搜索体验。 -这个更新应该能平息一下对应用搜索能力的抱怨,那些经常觉得Geary返回的搜索结果仅仅是包装软件自身"看起来和查询语句毫不相关"的观点。 +这个更新应该能平息一下对该应用的搜索能力的抱怨:Geary返回的搜索结果就如同软件自己所宣称的“看起来和查询语句毫不相关”。 > ‘Yorba 建议所有这个软件客户端的用户升级到这个版本’ @@ -36,7 +37,7 @@ Yorba的最新版本可以从GNOME的Git账户下载可编译的源代码。但 Ubuntu用户想知道如何在 **14.04,14.10** 以及 **15.04**(那些更新爱好者) 上安装Geary 0.10。 -官方的Youba PPA包括了 **Geary最新版本** 以及Shotwell(照片管理器)和[California][2](日历应用)。请注意添加这个PPA会使你电脑上任何已经安装的这些应用更新到最近的版本。 +官方的Youba PPA包括了 **Geary 最新版本** 以及Shotwell(照片管理器)和[California][2](日历应用)。请注意添加这个PPA会使你电脑上任何已经安装的这些应用更新到最近的版本。 Capiche? Coolio. @@ -52,7 +53,7 @@ Capiche? Coolio. 完成后,打开你的桌面环境应用启动面板并查找‘Geary’图标。点击它,添加你的账户并查看[通过信息高速公路下载了什么][3],开始使用简单的图形界面吧。 -**别忘记:你可以通过电子邮件告诉我们你想看的新闻,应用建议,以及任何你想我们包括的东西,直接点击joey@oho.io** +**别忘记:你可以通过电子邮件告诉我们你想看的新闻,应用建议,以及任何你想我们包括的东西。** -------------------------------------------------------------------------------- @@ -60,7 +61,7 @@ via: http://www.omgubuntu.co.uk/2015/03/install-geary-ubuntu-linux-email-update 作者:[Joey-Elijah Sneddon][a] 译者:[ictlyh](https://github.com/ictlyh) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 From 78efea90018dd12a6dfccd6bde1c9cbb1aa2bf55 Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 26 May 2015 15:59:50 +0800 Subject: [PATCH 171/965] PUB:20150119 Unity Greeter Badges Brings Missing Session Icons to Ubuntu Login Screen @GOLinux --- ...ing Session Icons to Ubuntu Login Screen.md | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) rename {translated/tech => published}/20150119 Unity Greeter Badges Brings Missing Session Icons to Ubuntu Login Screen.md (61%) diff --git a/translated/tech/20150119 Unity Greeter Badges Brings Missing Session Icons to Ubuntu Login Screen.md b/published/20150119 Unity Greeter Badges Brings Missing Session Icons to Ubuntu Login Screen.md similarity index 61% rename from translated/tech/20150119 Unity Greeter Badges Brings Missing Session Icons to Ubuntu Login Screen.md rename to published/20150119 Unity Greeter Badges Brings Missing Session Icons to Ubuntu Login Screen.md index c6c195585e..fe25f3f6dc 100644 --- a/translated/tech/20150119 Unity Greeter Badges Brings Missing Session Icons to Ubuntu Login Screen.md +++ b/published/20150119 Unity Greeter Badges Brings Missing Session Icons to Ubuntu Login Screen.md @@ -1,26 +1,28 @@ -‘Unity Greeter标识卡’——将丢失的会话带回Ubuntu登录屏幕 +‘Unity Greeter Badges’:将丢失的会话图标带回Ubuntu登录屏幕 ================================================================================ ![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/01/unity-greeter-badges-750x321.jpg) -**Ubuntu 15.04中的一个新包解决了我对Unity Greeter抱有的微词:缺乏其它像Cinnamon这样的Linux桌面会话的标牌式图标。** +新出现在**Ubuntu 15.04中的一个软件包解决了我对Unity 欢迎屏的微词:像Cinnamon这样的其它Linux桌面会话没有徽章图标。** -我知道这有点吹毛求疵了;这只是对大多数人而言几乎毫无影响的视觉裂痕而已。但是这种不一致性时时刻刻缠绕着我,让我不胜其烦,因为Ubuntu自带了大量的会话,包括Unity、GNOME和KDE。其它桌面环境,包括它自己的一些跳制品,像Xubuntu,都默认在会话切换列表和主用户界面显示了一个朴素的白点。 +我知道这有点吹毛求疵了;这只是对大多数人而言几乎毫无影响的视觉瑕疵罢了。但是这种不一致性时时刻刻缠绕着我,让我不胜其烦,因为Ubuntu的一些会话带有徽章图标,包括Unity、GNOME和KDE。而剩下的其它桌面环境,包括它自己的一些旁系产品,像Xubuntu,只会在会话切换列表和主用户界面显示了一个不能再简单的白点。 -这些点点们造成的这种不一致性刺激着神经,即使它只是稍纵即逝,但这种刺激不仅仅来自设计,也来自可用性方面。标牌式的标志符号对于让我们知道我们即将登陆到哪个会话很有帮助。 +这些点点们造成的这种不一致性刺激着我的神经,即使它只是稍纵即逝,但这种刺激不仅仅来自设计,也来自可用性方面。标牌式的标志符号对于让我们知道我们即将登陆到哪个会话很有帮助。 例如,你能告诉我们这个是个什么会话呢? ![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/01/what-session-is-this-750x247.jpg) -没有必要这样做啊。构建Unity Greeter,就是为了让桌面环境开发者能够部署标识卡到欢迎屏幕中(有些确实这样做了)。但在许多情况下,像MATE,它的包来自上游的Debian,想要移植一个“Ubuntu专用的补丁包”不太可取,也不太可能。 +Budgie? 也许是 MATE? 也能是 Cinnamon……我必须点开它才能知道。 + +没有必要这样做啊。构建Unity Greeter,就是为了让桌面环境开发者能够部署徽章到欢迎屏幕中(有些确实这样做了)。但在许多情况下,像MATE,它的包来自上游的Debian,想要移植一个“Ubuntu专用的补丁包”不太可取,也不太可能。 ### 一个解决方案出炉了 ### -有经验的Debian维护者[Doug Torrance][1]得到了修复该可用性裂痕的解决方案。与其依赖桌面制造者自己来添加品牌式标识卡到他们的包中,与其给Ubuntu增加维护它的责任重担,Torrance还不如自己创建了一个独立的‘unity-greeter-badges’包来收容它们。 +一位有经验的Debian维护者[Doug Torrance][1]有了修复该可用性瑕疵的解决方案。与其依赖桌面制造者自己来添加品牌式徽章到他们的包中,与其给Ubuntu增加维护它的责任重担,Torrance还不如自己创建了一个独立的‘unity-greeter-badges’包来收容它们。 承担起了直接提供会话标志的假定责任后,该包确保能同时迎合新旧窗口管理器、会话和桌面。 -在30个左右的桌面环境中,它为以下桌面捆绑了新的会话标识卡: +在30个左右的桌面环境列表中,它为以下桌面捆绑了新的会话徽章: - Xubuntu - Cinnamon @@ -46,7 +48,7 @@ via: http://www.omgubuntu.co.uk/2015/01/unity-greeter-badges-brings-missing-sess 作者:[Joey-Elijah Sneddon][a] 译者:[GOLinux](https://github.com/GOLinux) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 From 82ddcd4baa595998803ef07247f826523e6f4a49 Mon Sep 17 00:00:00 2001 From: Gore Liu Date: Tue, 26 May 2015 20:30:47 +0800 Subject: [PATCH 172/965] [Translated] 20150520 How to Use Docker Machine with a Cloud Provider.md --- ...se Docker Machine with a Cloud Provider.md | 149 ------------------ ...se Docker Machine with a Cloud Provider.md | 148 +++++++++++++++++ 2 files changed, 148 insertions(+), 149 deletions(-) delete mode 100644 sources/tech/20150520 How to Use Docker Machine with a Cloud Provider.md create mode 100644 translated/tech/20150520 How to Use Docker Machine with a Cloud Provider.md diff --git a/sources/tech/20150520 How to Use Docker Machine with a Cloud Provider.md b/sources/tech/20150520 How to Use Docker Machine with a Cloud Provider.md deleted file mode 100644 index 1539b4e751..0000000000 --- a/sources/tech/20150520 How to Use Docker Machine with a Cloud Provider.md +++ /dev/null @@ -1,149 +0,0 @@ -Translating by goreliu ... - -How to Use Docker Machine with a Cloud Provider -================================================================================ -Hi everyone, today we'll learn how we can use Docker Machine to deploy Docker host in various Cloud Provider Platforms. Docker Machine is an application that helps to create Docker hosts on our computer, on cloud providers and inside our own data center. It provides easy solution for creating servers, installing Docker on them and then configuring the Docker client according the users configuration and requirements. The driver APIs works for provisioning Docker on a local machine, on a virtual machine in the data center, or on a public cloud instance. Docker Machine is supported on Windows, OSX, and Linux and is available for installation as one standalone binary. It enables us to take full advantage of ecosystem partners providing Docker-ready infrastructure, while still accessing everything through the same interface. It makes people able to deploy the docker containers in the respective cloud platform pretty fast and in pretty easy way with just a single command. - -### 1. Installing Docker Machine ### - -Docker Machine supports awesome on every Linux Operating System. First of all, we'll need to download the latest version of Docker Machine from the Github site . Here, we'll use curl to download the latest version of Docker Machine ie 0.2.0 . - -For 64 Bit Operating System - - # curl -L https://github.com/docker/machine/releases/download/v0.2.0/docker-machine_linux-amd64 > /usr/local/bin/docker-machine - -For 32 Bit Operating System - - # curl -L https://github.com/docker/machine/releases/download/v0.2.0/docker-machine_linux-i386 > /usr/local/bin/docker-machine - -After downloading the latest release of Docker Machine, we'll make the file named docker-machine under /usr/local/bin/ executable using the command below. - - # chmod +x /usr/local/bin/docker-machine - -After doing the above, we'll wanna ensure that we have successfully installed docker-machine. To check it, we can run the docker-machine -v which will give output of the version of docker-machine installed in our system. - - # docker-machine -v - -![Installing Docker Machine](http://blog.linoxide.com/wp-content/uploads/2015/05/installing-docker-machine.png) - -To enable Docker commands on our machines, make sure to install the Docker client as well by running the command below. - - # curl -L https://get.docker.com/builds/linux/x86_64/docker-latest > /usr/local/bin/docker - # chmod +x /usr/local/bin/docker - -### 2. Creating Machine ### - -After finish installing Docker Machine in our Linux box, we'll wanna deploy a docker host into the cloud server. Docker Machine includes drivers for several popular Cloud Platforms such as Digital Ocean, Amazon Web Services (AWS), Microsoft Azure, Google Cloud Computing and many other which enables us to create same interface of docker deployment in different platforms. So, here in this tutorial we'll gonna deploy the Docker Host into the Digital Ocean server using digitalocean driver API. Here, we'll need to run command docker-machine create followed by --driver flag as digitalocean with --digitalocean-access-token flag as the API Token provided by the [Digital Ocean Control Panel][1] and at last the name of the docker host we just created. To do so, we'll need to run the following command as. - - # docker-machine create --driver digitalocean --digitalocean-access-token linux-dev - - # eval "$(docker-machine env linux-dev)" - -![Docker Machine Digitalocean Cloud](http://blog.linoxide.com/wp-content/uploads/2015/05/docker-machine-digitalocean-cloud.png) - -**Note**: Here, linux-dev is the name of the machine we are wanting to create. is a security key which can be generated from the Digital Ocean Control Panel of the account holder of Digital Ocean Cloud Platform. To retrieve that key, we simply need to login to our Digital Ocean Control Panel then click on API, then click on Generate New Token and give it a name tick on both Read and Write. Then we'll get a long hex key, thats the now, simply replace it into the command above. - -After running the above command, we can see in our Digital Ocean Droplet Panel that a droplet has been created with default configuration. - -![DigitalOcean Droplet Panel](http://blog.linoxide.com/wp-content/uploads/2015/05/digitalocean-droplet-panel.png) - -For ease and convenience, docker-machine deploys the droplet with default configuration choosing setting such as images that the VPS is based on we can override the default configuration as our need. We can do that by simply adding the flags respective to our need and requirement of the Droplet. Here are some flags for digitalocean that we can add to override the default configuration of the Docker Machine. - - --digitalocean-image "ubuntu-14-04-x64" for Choosing Droplet Image - --digitalocean-ipv6 enable to enable IPv6 Networking - --digitalocean-private-networking enable to enable Private Networking - --digitalocean-region "nyc3" to choose Region to deploy the Droplet - --digitalocean-size "512mb" to select the RAM size and type of deployment. - -If you are wanting to use docker-machine with other cloud providers and need to override the default configuration, we can run following command to get the list of flags for every platforms supported by Docker Machine by default. - - # docker-machine create -h - -### 3. Selecting Active Host ### - -After deploying the droplet, we wanna run a docker container straight away but before that, we'll need to check whether the active host is the required machine or not. To see that, we can run the following command. - - # docker-machine ls - -![Docker Machine List](http://blog.linoxide.com/wp-content/uploads/2015/05/docker-machine-ls.png) - -The active host can be identified by "*" in the ACTIVE column. - -Now, if we need to switch the active host to the required machine, we can simply run the following command. - - # docker-machine active linux-dev - -**Note**: Here, linux-dev is the Machine name that we are wanting to make as ACTIVE and run Docker Container on top of it. - -### 4. Running a Docker Container ### - -Now, after selecting our active host, we'll wanna finally run a docker container out of the box. Now, to give it a test, we'll run a busybox container out of it by running docker run busybox command with echo hello world so that we can get the output of the container. - - # docker run busybox echo hello world - -Note: If you are trying to deploy a docker container using a 32 Bit Operating System running in the host, its good idea to use SSH to run the docker commands. So, you can simply skip this step and follow the SSH step. - -### 5. SSH with Docker Machine ### - -If we want to control over the machine or the droplet that we just deployed with Docker Machine, we can ssh into the server using docker-machine ssh as command. - - # docker-machine ssh - -![Docker Machine SSH](http://blog.linoxide.com/wp-content/uploads/2015/05/docker-machine-ssh.png) - -Now, after ssh into the machine, we can run any docker containers into it. Here we'll run an nginx server into it. - - # docker run -itd -p 80:80 nginx - -After finishing up with SSH, we need to run exit to exit from the droplet or server. - - # exit - -### 5. Removing Hosts ### - -In order to remove the active host and all its images, containers, we can use docker-machine rm command as shown below. - - # docker-machine rm linux-dev - -![Docker Machine Remove All](http://blog.linoxide.com/wp-content/uploads/2015/05/docker-machine-remove-machine.png) - -To check whether the host has been removed or not, we can run docker-machine ls command. - - # docker-machine ls - -![Docker Machine Remove Check](http://blog.linoxide.com/wp-content/uploads/2015/05/docker-machine-remove-check.png) - -### 6. Adding a host without a driver ### - -We can add a host to Docker which only has a URL and no driver. It can be used an alias for an existing host, so we don’t have to type out the URL every time we run a Docker command. - - $ docker-machine create --url=tcp://104.131.50.36:2376 custombox - -### 7. Managing the Hosts ### - -If you are finished working with the running docker, we can simply run **docker-machine stop** command to stop the whole hosts which are Active and if wanna start again, we can run **docker-machine start**. - - # docker-machine stop - # docker-machine start - -You can also specify a machine name to stop or start using the host name as an argument. - - $ docker-machine stop linux-dev - $ docker-machine start linux-dev - -### Conclusion ### - -Docker Machine is really and awesome tool for deploying servers with Docker Container running. In this article we demostrated with Digital Ocean Platform but there are other platforms also available like Amazon Web Service, Google Cloud Computing and more which is supported by Docker Machine and includes driver APIs of them. It has made easy for fast and secure deployment of Docker Containers into several different Platforms with Docker Machine. As Docker Machine is still under Beta, so it is recommended not to use docker-machine in production. If you have any questions, suggestions, feedback please write them in the comment box below so that we can improve or update our contents. Thank you ! Enjoy :-) - --------------------------------------------------------------------------------- - -via: http://linoxide.com/linux-how-to/use-docker-machine-cloud-provider/ - -作者:[Arun Pyasi][a] -译者:[goreliu](https://github.com/goreliu) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://linoxide.com/author/arunp/ -[1]:https://cloud.digitalocean.com/settings/applications \ No newline at end of file diff --git a/translated/tech/20150520 How to Use Docker Machine with a Cloud Provider.md b/translated/tech/20150520 How to Use Docker Machine with a Cloud Provider.md new file mode 100644 index 0000000000..acf052d493 --- /dev/null +++ b/translated/tech/20150520 How to Use Docker Machine with a Cloud Provider.md @@ -0,0 +1,148 @@ +如何在云服务提供商的机器使用Docker Machine +================================================================================ +大家好,今天我们来学习如何使用Docker Machine在各种云服务提供商的平台部署Docker。Docker Machine是一个可以帮助我们在自己的电脑、云服务提供商的机器以及我们数据中心的机器上创建Docker机器的应用程序。它为创建服务器、在服务器中安装Docker、根据用户需求配置Docker客户端提供了简单的解决方案。驱动API对本地机器、数据中心的虚拟机或者公用云机器都适用。Docker Machine支持Windows、OSX和Linux,并且提供一个独立的二进制文件,可以直接使用。它让我们可以充分利用支持Docker的基础设施的生态环境合作伙伴,并且使用相同的接口进行访问。它让人们可以使用一个命令来简单而迅速地在不同的云平台部署Docker容器。 + + +### 1. 安装Docker Machine ### + +Docker Machine可以很好地支持每一种Linux发行版。首先,我们需要从Github网站下载最新版本的。这里我们使用curl来下载目前最新0.2.0版本的Docker Machine。 + +在64位操作系统运行: + + # curl -L https://github.com/docker/machine/releases/download/v0.2.0/docker-machine_linux-amd64 > /usr/local/bin/docker-machine + +在32位操作系统运行: + + # curl -L https://github.com/docker/machine/releases/download/v0.2.0/docker-machine_linux-i386 > /usr/local/bin/docker-machine + +下载最新版本的Docker Machine并将docker-machine文件放到了/usr/local/bin/后,添加执行权限: + + # chmod +x /usr/local/bin/docker-machine + +完成如上操作后,我们需要确认已经成功安装docker-machine了。可以运行如下命令检查,它会输出系统中docker-machine的版本: + + # docker-machine -v + +![Installing Docker Machine](http://blog.linoxide.com/wp-content/uploads/2015/05/installing-docker-machine.png) + +另外机器上需要有docker命令,可以使用如下命令安装: + + # curl -L https://get.docker.com/builds/linux/x86_64/docker-latest > /usr/local/bin/docker + # chmod +x /usr/local/bin/docker + +### 2. 创建机器 ### + +在自己的Linux机器上安装好了Docker Machine之后,我们想要将一个docker虚拟机部署到云服务器上。Docker Machine支持几个流行的云平台,如igital Ocean、Amazon Web Services(AWS)、Microsoft Azure、Google Cloud Computing等等,所以我们可以在不同的平台使用相同的接口来部署Docker。本文中我们会使用digitalocean驱动在Digital Ocean的服务器上部署Docker,--driver选项指定digitalocean驱动,--digitalocean-access-token选项指定[Digital Ocean Control Panel][1]提供的API Token,命令最后的是我们创建的Docker虚拟机的机器名。运行如下命令: + + # docker-machine create --driver digitalocean --digitalocean-access-token linux-dev + + # eval "$(docker-machine env linux-dev)" + +![Docker Machine Digitalocean Cloud](http://blog.linoxide.com/wp-content/uploads/2015/05/docker-machine-digitalocean-cloud.png) + +**注意**: 这里linux-dev是我们将要创建的机器的名称。``是一个安全key,可以在Digtal Ocean Control Panel生成。要找到这个key,我们只需要登录到我们的Digital Ocean Control Panel,然后点击API,再点击Generate New Token,填写一个名称,选上Read和Write。然后我们就会得到一串十六进制的key,那就是``,简单地替换到上边的命令中即可。 + +运行如上命令后,我们可以在Digital Ocean Droplet Panel中看到一个具有默认配置的droplet已经被创建出来了。 + +![DigitalOcean Droplet Panel](http://blog.linoxide.com/wp-content/uploads/2015/05/digitalocean-droplet-panel.png) + +简便起见,docker-machine会使用默认配置来部署Droplet。我们可以通过增加选项来定制我们的Droplet。这里是一些digitalocean相关的选项,我们可以使用它们来覆盖Docker Machine所使用的默认配置。 + + --digitalocean-image "ubuntu-14-04-x64" 是选择Droplet的镜像 + --digitalocean-ipv6 enable 是启用IPv6网络支持 + --digitalocean-private-networking enable 是启用专用网络 + --digitalocean-region "nyc3" 是选择部署Droplet的区域 + --digitalocean-size "512mb" 是选择内存大小和部署的类型 + +如果你想在其他云服务使用docker-machine,并且想覆盖默认的配置,可以运行如下命令来获取Docker Mackine默认支持的对每种平台适用的参数。 + + # docker-machine create -h + +### 3. 选择活跃机器 ### + +部署Droplet后,我们想马上运行一个Docker容器,但在那之前,我们需要检查下活跃机器是否是我们需要的机器。可以运行如下命令查看。 + + # docker-machine ls + +![Docker Machine List](http://blog.linoxide.com/wp-content/uploads/2015/05/docker-machine-ls.png) + +ACTIVE一列有“*”标记的是活跃机器。 + +现在,如果我们想将活跃机器切换到需要的机器,运行如下命令: + + # docker-machine active linux-dev + +**注意**:这里,linux-dev是机器名,我们打算激活这个机器,并且在其中运行Docker容器。 + +### 4. 运行一个Docker容器 ### + +现在,我们已经选择了活跃机器,就可以运行Docker容器了。可以测试一下,运行一个busybox容器来执行`echo hello word`命令,这样就可以得到输出: + + # docker run busybox echo hello world + +注意:如果你试图在一个装有32位操作系统的宿主机部署Docker容器,使用SSH来运行docker是个好办法。这样你就可以简单跳过这一步,直接进入下一步。 + +### 5. SSH到Docker机器中 ### + +如果我们想在机器或者Droplet上控制之前部署的Docker机器,可以使用docker-machine ssh命令来SSH到机器上: + + # docker-machine ssh + +![Docker Machine SSH](http://blog.linoxide.com/wp-content/uploads/2015/05/docker-machine-ssh.png) + +SSH到机器上之后,我们可以在上边运行任何Docker容器。这里我们运行一个nginx: + + # docker run -itd -p 80:80 nginx + +操作完毕后,我们需要运行exit命令来退出Droplet或者服务器。 + + # exit + +### 5. 删除机器 ### + +删除在运行的机器以及它的所有镜像和容器,我们可以使用docker-machine rm命令: + + # docker-machine rm linux-dev + +![Docker Machine Remove All](http://blog.linoxide.com/wp-content/uploads/2015/05/docker-machine-remove-machine.png) + +使用docker-machine ls命令检查是否成功删除了: + + # docker-machine ls + +![Docker Machine Remove Check](http://blog.linoxide.com/wp-content/uploads/2015/05/docker-machine-remove-check.png) + +### 6. 在不使用驱动的情况新增一个机器 ### + +我们可以在不使用驱动的情况往Docker增加一台机器,只需要一个URL。它可以使用一个已有机器的别名,所以我们就不需要每次在运行docker命令时输入完整的URL了。 + + $ docker-machine create --url=tcp://104.131.50.36:2376 custombox + +### 7. 管理机器 ### + +如果你已经让Docker运行起来了,可以使用简单的**docker-machine stop**命令来停止所有正在运行的机器,如果需要再启动的话可以运行**docker-machine start**: + + # docker-machine stop + # docker-machine start + +你也可以使用如下命令来使用机器名作为参数来将其停止或启动: + + $ docker-machine stop linux-dev + $ docker-machine start linux-dev + +### 总结 ### + +Docker Machine是一个非常棒的工具,可以使用Docker容器快速地部署服务。文中我们使用Digital Ocean Platform作演示,但Docker Machine还支持其他平台,如Amazon Web Service、Google Cloud Computing。使用Docker Machine,快速、安全地在几种不同平台部署Docker容器变得很简单了。因为Docker Machine还是Beta版本,不建议在生产环境使用。如果你有任何问题、建议、反馈,请在下方的评论框中写下来,我们会改进或者更新我们的内容。谢谢!享受吧 :-) + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/linux-how-to/use-docker-machine-cloud-provider/ + +作者:[Arun Pyasi][a] +译者:[goreliu](https://github.com/goreliu) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://linoxide.com/author/arunp/ +[1]:https://cloud.digitalocean.com/settings/applications \ No newline at end of file From 5a16fa04d468135a0b189691cb3e550556700ed5 Mon Sep 17 00:00:00 2001 From: wwy-hust Date: Tue, 26 May 2015 22:47:57 +0800 Subject: [PATCH 173/965] finish translation --- ...u Linux Hit 200 Million Users This Year.md | 40 ------------------- ...u Linux Hit 200 Million Users This Year.md | 38 ++++++++++++++++++ 2 files changed, 38 insertions(+), 40 deletions(-) delete mode 100644 sources/talk/20150521 Will Ubuntu Linux Hit 200 Million Users This Year.md create mode 100644 translated/talk/20150521 Will Ubuntu Linux Hit 200 Million Users This Year.md diff --git a/sources/talk/20150521 Will Ubuntu Linux Hit 200 Million Users This Year.md b/sources/talk/20150521 Will Ubuntu Linux Hit 200 Million Users This Year.md deleted file mode 100644 index 8a79781a22..0000000000 --- a/sources/talk/20150521 Will Ubuntu Linux Hit 200 Million Users This Year.md +++ /dev/null @@ -1,40 +0,0 @@ -translating by wwy-hust - -Will Ubuntu Linux Hit 200 Million Users This Year? -================================================================================ -It's been four years and two weeks since Mark Shuttleworth expressed his goal of "200 million users of Ubuntu in 4 years." While Ubuntu's presence has continued to increase over the past four years, it doesn't look like that goal has been realized yet or will be by the end of the calendar year. - -It was back at [UDS Budapest][1] in May of 2011 when Shuttleworth expressed a goal of 200 million Ubuntu users in four years. - -![](http://www.phoronix.net/image.php?id=uds_budapest&image=budapest_phoronix_03_show&w=1920) - -Last I heard there was "tens of millions" of Ubuntu Linux users, but haven't seen any reliable reports anywhere of the Ubuntu user-base being close to 200 million. The latest monthly statistics from Valve show [the Linux gaming population being below 1%][2] compared to Windows and OS X. Most usage statistics based on web metrics and other data tend to put the total Linux user-base at just a few percent. - -Aside from desktop installations, Ubuntu at least has made substantial inroads with cloud and server deployments over the past four years and have proven to be a contender with Red Hat Enterprise Linux on such fronts. Ubuntu has also proven itself quite well on ARM hardware. When Mark was coming up with his goal in four years, he was probably thinking that Ubuntu Phone/Touch would be much further along than where it is now: just having one device available in the EU and [a second currently in China][3] and [the Ubuntu Touch software stack still maturing][4] with [major work on key apps still needed][5], etc. - -![](http://www.phoronix.net/image.php?id=0x2015&image=shuttleworth_200_million_show&w=1920) - -It's also been three years since the Canonical claim of [Ubuntu would soon ship on 5% of PCs][6]. The 5% claim was for worldwide PC shipments, but even three years later, I have a hard time believing that... At least in the US and Europe I still very rarely see Ubuntu preloads on systems within brick and mortar stores while the major Internet retailers / OEMs still tend to offer Linux on a few select PC models, sans Chrome OS / Android devices. - -Another lofty, unrelated goal that went unreached by the open-source community was [GNOME owning 10% of the global desktop market by 2010][7]. Five years later, there's no indication they're even close to reaching that 10x10 milestone. - -How large do you think the Ubuntu user-base is today? How large do you think the Ubuntu (or Linux) user-base will grow in the years to come? Share with us your thoughts by commenting on this article. - --------------------------------------------------------------------------------- - -via: http://www.phoronix.com/scan.php?page=news_item&px=2015-200-Million-Goal-Retro - -作者:[Michael Larabel][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.michaellarabel.com/ -[1]:http://www.phoronix.com/vr.php?view=16002 -[2]:http://www.phoronix.com/scan.php?page=news_item&px=Steam-April-2015-1-Drop -[3]:http://www.phoronix.com/scan.php?page=news_item&px=Ubuntu-MX4-In-China -[4]:http://www.phoronix.com/scan.php?page=news_item&px=Ubuntu-Calculator-Reboot -[5]:http://www.phoronix.com/scan.php?page=news_item&px=MTgzOTM -[6]:http://www.phoronix.com/scan.php?page=news_item&px=MTA5ODM -[7]:https://www.phoronix.com/scan.php?page=news_item&px=Nzg1Mw diff --git a/translated/talk/20150521 Will Ubuntu Linux Hit 200 Million Users This Year.md b/translated/talk/20150521 Will Ubuntu Linux Hit 200 Million Users This Year.md new file mode 100644 index 0000000000..45c572b1bb --- /dev/null +++ b/translated/talk/20150521 Will Ubuntu Linux Hit 200 Million Users This Year.md @@ -0,0 +1,38 @@ +Ubuntuڽﵽ2ûô +================================================================================ +Mark ShuttleworthĿꡰ4Ubuntuûﵽ2ڡѾȥܡUbuntuûڹȥһֱĿĿǰδʵ֣ҿڽʵ֡ + +20115[UDS ˹][1]ShuttleworthʾUbuntu4ڴﵽ2û + +![](http://www.phoronix.net/image.php?id=uds_budapest&image=budapest_phoronix_03_show&w=1920) + +һUbuntuС1ǧûDzûκοɿıUbuntuûӽ2ڡValveͳƱWindowsOS Xû[ʹLinuxϷûı1%][2]WebͳƷʽڱLinuxûֻռٵIJ֡ + +Ʋ治̸Ubuntuڹȥƺͷõ˴ռʣұ֤Red Hat EnterpriseߡUbuntu֤ԻARMӲʮѺáMarkǰĿʱܿǵUbuntu Phone/TouchĿǰ״áUbuntu Phone/TouchĿǰŷ޺[й][3]ã[Ubuntu Touchڳ·][4][ҪĹؼӦóĹ][5]ȡ + +![](http://www.phoronix.net/image.php?id=0x2015&image=shuttleworth_200_million_show&w=1920) + +Canonical[Ubuntuý½5%PC][6]Ҳѹȥ3ꡣ5%ĿȫPCװٹ3꣬ɺĿʵ֡ŷޣʵ꿴UbuntuΪԤװϵͳҪ/OEMضPCͺṩLinuxChrome OSAndroid豸 + +һɿԴĸ߰ءյĿ[GNOME2010ռȫг10%ķݶ][7]ǰûκμǽӽ10%̱ + +ڽ죬ΪUbuntuûжأδļUbuntuLinuxûжأͨǷ뷨ɡ + +-------------------------------------------------------------------------------- + +via: http://www.phoronix.com/scan.php?page=news_item&px=2015-200-Million-Goal-Retro + +ߣ[Michael Larabel][a] +ߣ[ID](https://github.com/ID) +Уԣ[УID](https://github.com/УID) + + [LCTT](https://github.com/LCTT/TranslateProject) ԭ룬[Linuxй](https://linux.cn/) Ƴ + +[a]:http://www.michaellarabel.com/ +[1]:http://www.phoronix.com/vr.php?view=16002 +[2]:http://www.phoronix.com/scan.php?page=news_item&px=Steam-April-2015-1-Drop +[3]:http://www.phoronix.com/scan.php?page=news_item&px=Ubuntu-MX4-In-China +[4]:http://www.phoronix.com/scan.php?page=news_item&px=Ubuntu-Calculator-Reboot +[5]:http://www.phoronix.com/scan.php?page=news_item&px=MTgzOTM +[6]:http://www.phoronix.com/scan.php?page=news_item&px=MTA5ODM +[7]:https://www.phoronix.com/scan.php?page=news_item&px=Nzg1Mw \ No newline at end of file From 533113d693c3e59adffeee8a84908a2d2a95b16b Mon Sep 17 00:00:00 2001 From: wwy Date: Tue, 26 May 2015 23:21:23 +0800 Subject: [PATCH 174/965] [Translating] 20150310 FAQ--BSD.md --- sources/talk/20150310 FAQ--BSD.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/talk/20150310 FAQ--BSD.md b/sources/talk/20150310 FAQ--BSD.md index 80f77ef656..65357e9559 100644 --- a/sources/talk/20150310 FAQ--BSD.md +++ b/sources/talk/20150310 FAQ--BSD.md @@ -1,3 +1,5 @@ +translating by wwy-hust + FAQ: BSD ================================================================================ ![](http://www.linuxvoice.com/wp-content/uploads/2015/02/faq1-large1.png) @@ -78,4 +80,4 @@ via: http://www.linuxvoice.com/faq-bsd-2/ [1]:http://www.openbsd.org/ [2]:http://www.freebsd.org/ [3]:http://www.netbsd.org/ -[4]:http://www.pcbsd.org/ \ No newline at end of file +[4]:http://www.pcbsd.org/ From d59b4519fee7086630e1b96f5ca2e9052e941f5a Mon Sep 17 00:00:00 2001 From: wxy Date: Wed, 27 May 2015 00:00:52 +0800 Subject: [PATCH 175/965] PUB:20150302 How to Limit the Network Bandwidth Used by Applications in a Linux System with Trickle @theo-l --- ...ications in a Linux System with Trickle.md | 300 +++++++++++++++++ ...ications in a Linux System with Trickle.md | 314 ------------------ 2 files changed, 300 insertions(+), 314 deletions(-) create mode 100644 published/20150302 How to Limit the Network Bandwidth Used by Applications in a Linux System with Trickle.md delete mode 100644 translated/tech/20150302 How to Limit the Network Bandwidth Used by Applications in a Linux System with Trickle.md diff --git a/published/20150302 How to Limit the Network Bandwidth Used by Applications in a Linux System with Trickle.md b/published/20150302 How to Limit the Network Bandwidth Used by Applications in a Linux System with Trickle.md new file mode 100644 index 0000000000..ee64fab44a --- /dev/null +++ b/published/20150302 How to Limit the Network Bandwidth Used by Applications in a Linux System with Trickle.md @@ -0,0 +1,300 @@ +指南:使用Trickle限制应用程序带宽占用 +================================================================================ + +有没有遇到过系统中的某个应用程序独占了你所有的网络带宽的情形?如果你有过这样的遭遇,那么你就会感受到Trickle这种带宽调整应用的价值。不管你是一个系统管理员还只是普通Linux用户,都需要学习如何控制应用程序的上下行速度,来确保你的网络带宽不会被某个程序霸占。 + +![Install Trickle Bandwidth Limit in Linux](http://www.tecmint.com/wp-content/uploads/2013/11/Bandwidth-limit-trickle.png) + +*在 Linux 上安装 Trickle 带宽限制* + +### 什么是 Trickle? ### + +Trickle是一个网络带宽调整工具,可以让我们管理应用程序的网络上下行速度,使得可以避免其中的某个应用程序霸占了全部或大部分可用的带宽。换句话说,Trickle可以让你基于单个应用程序来控制网络流量速率,而不是仅仅针对与单个用户——这是在客户端网络环境中经典的带宽调整情况。 + +### Trickle 是如何工作的?### + +另外,trickle 可以帮助我们基于应用来定义优先级,所以当对整个系统进行了全局限制设定,高优先级的应用依然会自动地获取更多的带宽。为了实现这个目标,trickle 对 TCP 连接上的套接字的数据发送、接收设置流量限制。我们必须注意到,除了影响传输速率之外,在这个过程中,trickle任何时候都不会以任何方式来改变其中的数据。 + +### Trickle不能做什么? ### + +这么说吧,唯一的限制就是,trickle不支持静态链接的应用程序或者具有SUID或SGID位设置的二进制程序,因为它使用动态链接的方式将其载入到需要调整的进程和其关联的网络套接字之间。 Trickle此时会在这两种软件组件之间扮演代理的角色。 + +由于trickle并不需要超级用户的权限来运行,所以用户可以设置他们自己的流量限制。可能这并不是你想要的,我们会探索如何使用全局设定来限制系统中的所有用户的流量限制。也即是说,此时系统中的每个用户具有管理各自的流量速率,但是无论如何,都会受到系统管理员给他们设置的总体限制。 + +在这篇文章中,我们会描述如何通过trickle在linux平台上管理应用程序使用的网络带宽。为了生成所需的流量,在此会在客户端(CentOS 7 server – dev1: 192.168.0.17)上使用 ncftpput 和 ncftpget, 在服务器(Debian Wheezy 7.5 – dev2: 192.168.0.15)上使用vsftpd 来进行演示。 相同的指令也可以在RedHat,Fedora和Ubuntu等系统使用。 + +#### 前提条件 #### + +1. 对于 RHEL/CentOS 7/6, [开启EPEL仓库][1]。这些用于企业版 Linux 的额外软件包是一个由Fedora项目维护的高质量、开源的软件仓库,而且百分之百与其衍生产品相兼容,如企业版本Linux和CentOS。 在这个仓库中trickle和ncftp两者都是可用的。 + +2. 按照如下方式安装ncftp: + + # yum update && sudo yum install ncftp [基于 RedHat 的系统] + # aptitude update && aptitude install ncftp [基于 Debian 的系统] + +3. 在单独的服务器上设置一个FTP服务器。需要注意的是,尽管FTP天生就不安全,但是仍然被广泛应用在安全性无关紧要的文件上传下载中。 在这篇文章中我们使用它来演示trickle的优点,同时它也会在客户端的标准输出流中显示传输速率。我们将是否在其它时间使用它放在一边讨论。 + + # yum update && yum install vsftpd [基于 RedHat 的系统] + # aptitude update && aptitude install vsftpd [基于 Debian 的系统] + + 现在,在FTP服务器上按照以下方式编辑 /etc/vsftpd/vsftpd.conf 文件。 + + anonymous_enable=NO + local_enable=YES + chroot_local_user=YES + allow_writeable_chroot=YES + + 在此之后,确保在你的当前会话中启动了vsftpd,并在之后的启动中让其自动启动。 + + # systemctl start vsftpd [基于 systemd 的系统] + # systemctl enable vsftpd + # service vsftpd start [基于 init 的系统] + # chkconfig vsftpd on + +4. 如果你选择在一个使用 SSH 密钥进行远程访问的 CentOS/RHEL 7中搭建FTP服务器,你需要一个密码受保护的用户账户,它能访问**root目录之外**的某个目录,并有能在其中上传和下载文件的权限。 + + 你可以通过在你的浏览器中输入以下的URL来浏览你的家目录。一个登录窗口会弹出来提示你输入FTP服务器中的有效的用户名和密码。 + + ftp://192.168.0.15 + + 如果验证成功,你就会看到你的家目录中的内容。该教程的稍后部分中,你将可以刷新页面来显示在你之前上传过的文件。 + + ![FTP Directory Tree](http://www.tecmint.com/wp-content/uploads/2013/11/FTP-Directory-Tree.png) + + *FTP 目录树* + +### 如何在Linux中安装 trickle ### + +1. 通过yum或aptitude来安装trickle. + + 为了确保能够成功安装,最好在安装工具之前,保证当前的安装包是最新的版本。 + + + # yum -y update && yum install trickle [基于 RedHat 的系统] + # aptitude -y update && aptitude install trickle [基于 Debian 的系统] + +2. 确认trickle是否对特定的二进制包有用。 + + 之前我们解释过,trickle只对使用动态或共享的库的二进制包有用。为了确认我们是否可以对某个特定的应用使用trickle,我们可以使用著名的ldd(列出动态依赖)工具。 特别地,我们会查看任何给定程序的动态依赖中其当前使用的glibc,因为其准确地定义了通过套接字通讯所使用的系统调用。 + + 对一个给定的二进制包执行以下命令来查看是否能对其使用trickle进行带宽调整: + + # ldd $(which [binary]) | grep libc.so + + 例如, + + # ldd $(which ncftp) | grep libc.so + + 其输出是: + + # libc.so.6 => /lib64/libc.so.6 (0x00007efff2e6c000) + + 输出中的括号中的字符可能在不同的系统平台有所不同,甚至相同的命令在不同的时候运行也会不同,因为其代表包加载到物理内存中的地址。 + + 如果上面的命令没有返回任何的结果,就说明这个二进制包没有使用libc包,因此trickle对其不能起到带宽调整的作用。 + +### 学习如何使用Trickle### + +最基本的用法就是使用其独立模式,通过这种方式,trickle用来显式地定义给定应用程序的上传下载速率。如前所述,为了简单,我们会使用相同的应用来进行上传下载测试。 + +#### 在独立模式下运行trickle#### + +我们会比较在有无trickle的情况下的上传下载速率, ‘-d’选项指示下载速率(KB/s单位),而'-u'选项指示相同单位的上传速率。另外我们会使用到‘-s’选项来指定trickle应该以独立模式运行。 + +以独立模式运行trickle的基本语法如下: + + # trickle -s -d [下载速率,KB/s] -u [上传速率,KB/s] + +为了能够让你自己运行以下样例,确保你在自己的客户端安装了trickle和ncftp(我的是192.168.0.17)。 + +**样例1:在有无trickle的情况下上传一个2.8 MB的PDF文件。** + +我们使用一个自由发布的[LInux基础知识PDF文件][2]来进行下面的测试。 + +你可以首先使用下面的命令将这个文件下载到你当前的工作目录中: + + # wget http://linux-training.be/files/books/LinuxFun.pdf + +下面是在没有trickle的情况下将一个文件上传到我们的FTP服务器的语法: + + # ncftpput -u username -p password 192.168.0.15 /remote_directory local-filename + +其中的 /remote_directory 是相对于该用户的家目录的上传路径,而local-filename是一个你当前工作目录中的文件。 + +特别的是,在没有trickle的情形下,我们可以得到上传峰值速率52.02MB/s(请注意,这个不是真正的平均上传速率,而是峰值开始的瞬时值),而且这个文件几乎在瞬间就完成了上传。 + + # ncftpput -u username -p password 192.168.0.15 /testdir LinuxFun.pdf + +输出: + + LinuxFun.pdf: 2.79 MB 52.02 MB/s + +在使用trickle的情况下,我们会限制上传速率在5KB/s。在第二次上传文件之前,我们需要在目标目录中删除这个文件,否则ncftp就会通知我们在目标目录中已经存在了与上传文件相同的文件,从而不会执行文件的传输: + + # rm /absolute/path/to/destination/directory/LinuxFun.pdf + +然后: + + # trickle -s -u 5 ncftpput -u username -p password 111.111.111.111 /testdir LinuxFun.pdf + +输出: + + LinuxFun.pdf: 2.79 MB 4.94 kB/s + +在上面的样例中,我们看到平均的上传速率下降到了5KB/s。 + +**样例2:在有无trickle的情况下下载相同的2.8MB的PDF文件** + +首先,记得从原来的源目录中删除这个PDF: + + # rm /absolute/path/to/source/directory/LinuxFun.pdf + +请注意,下面的样例中将远程的文件下载到客户端机器的当前目录下,这是由FTP服务器的IP地址后面的“.”决定的。 + +没有trickle的情况下: + + # ncftpget -u username -p password 111.111.111.111 . /testdir/LinuxFun.pdf + +输出: + + LinuxFun.pdf: 2.79 MB 260.53 MB/s + +在有trickle的情况下,限制下载速率在20KB/s: + + # trickle -s -d 30 ncftpget -u username -p password 111.111.111.111 . /testdir/LinuxFun.pdf + +输出: + + LinuxFun.pdf: 2.79 MB 17.76 kB/s + +### 在监督[非托管]模式下运行Trickle ### + +trickle也可以按照/etc/trickled.conf文件中定义的一系列参数运行在非托管模式下。 这个文件定义了守护线程 trickled的行为以及如何管理trickle。 + +另外,如果你想要全局设置被所有的应用程序使用的话,我们就会需要使用trickle命令。 这个命令运行守护进程,并允许我们通过trickle定义所有应用程序共享的上传下载限制,不需要我们每次来进行指定。 + +例如,运行: + + # trickled -d 50 -u 10 + +会导致任何通过trickle运行的应用程序的上传下载速率分别限制在30kb/s和10kb/s。 + +请注意,你可以在任何时间都能确认守护线程trickled是否正在运行以及其运行参数: + + # ps -ef | grep trickled | grep -v grep + +输出: + + root 16475 1 0 Dec24 ? 00:00:04 trickled -d 50 -u 10 + +**样例3:在使用/不使用trickle的情形下上传一个 19MB 的mp4文件到我们的FTP服务器。** + +在这个样例中,我们会使用“He is the gift”的自由分发视频,可以通过这个[链接][3]下载。 + +我们将会在开始时通过以下的命令将这个文件下载到你的当前工作目录中: + + # wget http://media2.ldscdn.org/assets/missionary/our-people-2014/2014-00-1460-he-is-the-gift-360p-eng.mp4 + +首先,我们会使用之前列出的命令来开启守护进程trickled: + + # trickled -d 30 -u 10 + +在不使用trickle时: + + # ncftpput -u username -p password 192.168.0.15 /testdir 2014-00-1460-he-is-the-gift-360p-eng.mp4 + +输出: + + 2014-00-1460-he-is-the-gift-360p-eng.mp4: 18.53 MB 36.31 MB/s + +在使用trickle时: + + # trickle ncftpput -u username -p password 192.168.0.15 /testdir 2014-00-1460-he-is-the-gift-360p-eng.mp4 + +输出: + + 2014-00-1460-he-is-the-gift-360p-eng.mp4: 18.53 MB 9.51 kB/s + +我们可以看到上面的输出,上传的速率下降到了约 10KB/s。 + +** 样例4:在使用/不使用trickle的情形下下载这个相同的视频 ** + +与样例2一样,我们会将该文件下载到当前工作目录中。 + +在没有trickle时: + + # ncftpget -u username -p password 192.168.0.15 . /testdir/2014-00-1460-he-is-the-gift-360p-eng.mp4 + +输出: + + 2014-00-1460-he-is-the-gift-360p-eng.mp4: 18.53 MB 108.34 MB/s + +有trickle的时: + + # trickle ncftpget -u username -p password 111.111.111.111 . /testdir/2014-00-1460-he-is-the-gift-360p-eng.mp4 + +输出: + + 2014-00-1460-he-is-the-gift-360p-eng.mp4: 18.53 MB 29.28 kB/s + +上面的结果与我们之前设置的下载限速相对应(30KB/s)。 + +**注意:** 一旦守护进程开启之后,就没有必要使用trickle来为每个应用程序来单独设置限制。 + +如前所述,人们可以进一步地通过trickled.conf来客制化trickle的带宽速率调整,该文件的一个典型的分段有以下部分组成: + + [service] + Priority = + Time-Smoothing = + Length-Smoothing = + +其中, + +- [service] 用来指示我们想要对其进行带宽使用调整的应用程序名称 +- Priority 用来让我们为某个服务制定一个相对于其他服务高的优先级,这样就不允许守护进程管理中的一个单独的应用程序来占用所有的带宽。越小的数字代表更高的优先级。 +- Time-Smoothing [以秒计]: 定义了trickled让各个应用程序传输或接收数据的时间间隔。小的间隔值(0.1-1秒)对于交互式应用程序是理想的,因为这样会具有一个更加平滑的会话体验,而一个相对较大的时间间隔值(1-10秒)对于需要批量传输应用程序就会显得更好。如果没有指定该值,默认是5秒。 +- Length-smoothing [KB 单位]: 该想法与Time-Smoothing如出一辙,但是是基于I/O操作而言。如果没有指定值,会使用默认的10KB。 + +上述平滑值(Time-Smoothing、 Length-smoothing)的改变会被翻译为将指定的服务的使用一个间隔值而不是一个固定值。不幸的是,没有一个特定的公式来计算间隔值的上下限,主要依赖于特定的应用场景。 + +下面是一个在CentOS 7 客户端中的trickled.conf 样例文件(192.168.0.17): + + [ssh] + Priority = 1 + Time-Smoothing = 0.1 + Length-Smoothing = 2 + + [ftp] + Priority = 2 + Time-Smoothing = 1 + Length-Smoothing = 3 + +使用该设置,trickled会为SSH赋予比FTP较高的传输优先级。值得注意的是,一个交互进程,例如SSH,使用了一个较小的时间间隔值,然而一个处理批量数据传输的服务如FTP,则使用一个较大的时间间隔来控制之前的样例中的上传下载速率,尽管不是百分百的由trickled指定的值,但是也已经非常接近了。 + +### 总结 ### + +在该文章中,我们探索了使用trickle在基于Fedora发行版和Debian衍生版平台上来限制应用程序的带宽使用。也包含了其他的可能用法,但是不对以下情形进行限制: + +- 限制系统工具的下载速度,例如[wget][4],或 BT客户端. +- 限制你的系统的包管理工具[`yum`][5]更新的速度 (如果是基于Debian系统的话,其包管理工具为[`aptitude`][6])。 +- 如果你的服务器是在一个代理或防火墙后面(或者其本身即是代理或防火墙的话),你可以使用trickle来同时设定下载和上传速率,或者客户端或外部通讯的速率。 + +欢迎提问或留言。 + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/manage-and-limit-downloadupload-bandwidth-with-trickle-in-linux/ + +作者:[Gabriel Cánepa][a] +译者:[theo-l](https://github.com/theo-l) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/gacanepa/ +[1]:https://linux.cn/article-2324-1.html +[2]:http://linux-training.be/files/books/LinuxFun.pdf +[3]:http://media2.ldscdn.org/assets/missionary/our-people-2014/2014-00-1460-he-is-the-gift-360p-eng.mp4 +[4]:http://www.tecmint.com/10-wget-command-examples-in-linux/ +[5]:http://www.tecmint.com/20-linux-yum-yellowdog-updater-modified-commands-for-package-mangement/ +[6]:http://www.tecmint.com/dpkg-command-examples/ diff --git a/translated/tech/20150302 How to Limit the Network Bandwidth Used by Applications in a Linux System with Trickle.md b/translated/tech/20150302 How to Limit the Network Bandwidth Used by Applications in a Linux System with Trickle.md deleted file mode 100644 index b8ed29b47c..0000000000 --- a/translated/tech/20150302 How to Limit the Network Bandwidth Used by Applications in a Linux System with Trickle.md +++ /dev/null @@ -1,314 +0,0 @@ -如何在linux上使用Trickle来限制应用程序的网络宽带使用. -================================================================================ -有没有遇到过系统中的某个应用程序独占了你所有的网络宽带的情形?如果你有过这样的遭遇,那么你就会感受到Trickle宽带调整应用角色的价值.不管你是一个系统管理员还是仅仅Linux用户,都需要学习如何控制应用程序的上下行速度,来确保你的网络宽带不会被某个程序 -霸占. - -![Install Trickle Bandwidth Limit in Linux](http://www.tecmint.com/wp-content/uploads/2013/11/Bandwidth-limit-trickle.png) -Install Trickle Bandwidth Limit in Linux - -### 什么是 Trickle? ### - -Trickle是一个网络宽带调整工具,可以让我们管理应用程序的网络上下行速度,使得可以避免其中的某个应用程序吃掉了全部或大部分可用的宽带.换句话说,Trickle可以让你基于单个应用程序来控制 -网络流量速率,而不是仅仅针对与单个用户--在客户端网络环境中经典的宽带调整样例, - -### Trickle是如何工作的?### - -另外,tricle可以帮助我们基于应用来定义优先级,所以当对整个系统进行了全局限制设定,高优先级的应用依然会自动地获取更多的宽带。为了实现这个目标,tricle设置通过TCP连接的套接字对数 -据发送、数据接收路径的流量限制。我们必须注意到,除了影响传输速率之外,tricle任何时候都不会以任何方式来改变其处理过程。 - -### Trickle不能做什么? ### - -这么说吧,唯一的限制就是,tricle静态连接的应用或者具有SUID或SGID位设置的二进制--因为他们使用动态链接并且将其自身加载到调整过程以及其关联的网络套接字之间。 Trickle此时会在这两种软件 -组件之间扮演代理的角色。 - -由于trickle并不会需要超级用户的权限来运行,所以用户可以设置用户独立的流量限制,可能这并不是你想要的,我们会探索如何使用全局设定来限制系统中的所有用户的流量限制。也即是说,此时系统中的每个用户具有管理 -各自的流量速率,但是无论如何,都会受到系统管理员给他们设置的边界限制。 - -在这边文章中,我们会描述如何通过trickle在linux平台上管理应用程序使用的网络宽带。为了生成必要流量,在此会在客户端(CentOS 7 server – dev1: 192.168.0.17)上使用 ncftpput 和 - ncftpget, 在服务器(Debian Wheezy 7.5 – dev2: 192.168.0.15)上使用vsftpd 来进行演示。 相同的指令也可以在RedHat,Fedora和Ubuntu等系统使用。 - -#### 前提条件 #### - -1. 对于 RHEL/CentOS 7/6, [开启EPEL仓库][1]。EPEL的Extra Packages是一个 有Fedora项目维护的高质量、开源的软件仓库,而且百分之百与其衍生产品相兼容,如 -企业版本Linux和CentOS. 在这个仓库中trickle和ncftp两者都是可用的。 - -2. 按照如下方式安装ncftp: - - # yum update && sudo yum install ncftp [On RedHat based systems] - # aptitude update && aptitude install ncftp [On Debian based systems] - -3. 在单独的服务器上设置一个FTP服务器。需要注意的是,尽管FTP天生就不安全,但是 -仍然被广泛应用在安全性无关紧要的文件上传下载中。 在这篇文章中我们使用它来演示 -trickle的优点,同时它也会在客户端的标准输出流中显示传输速率,我们将是否在另外 -的日期时间中使用放在一边讨论。 - - # yum update && yum install vsftpd [On RedHat based systems] - # aptitude update && aptitude install vsftpd [On Debian based systems] - -现在,在FTP服务器上按照以下方式编辑 /etc/vsftpd/vsftpd.conf 文件。 - - anonymous_enable=NO - local_enable=YES - chroot_local_user=YES - allow_writeable_chroot=YES - -在此之后,确保在你的当前会话中开启了vsftpd,并在之后的启动中让其自动启动。 - - # systemctl start vsftpd [For systemd-based systems] - # systemctl enable vsftpd - # service vsftpd start [For init-based systems] - # chkconfig vsftpd on - -4. 如果你选在在一个CentOS/RHEL 7中为FTP服务器的远程访问配备SSH秘钥,你需要 -一个具有适合访问root目录之外的目录和文件内容上传下载权限并密码受保护的用户账户。 - -你可以通过在你的浏览器中输入以下的URL来浏览你的Home目录。一个登陆窗口会弹出来 -提示你输入FTP服务器中的有效的用户名和密码。 - - ftp://192.168.0.15 - -如果验证成功,你就会看到你的home目录中的内容。该教程的稍后部分中,你将可以刷新 -页面来显示在你之前上传过的文件。 - -![FTP Directory Tree](http://www.tecmint.com/wp-content/uploads/2013/11/FTP-Directory-Tree.png) -FTP Directory Tree - -### 如何在Linux中安装 Tricle ### - -1. 通过yum或aptitude来安装tricle. - -为了确保能够成功安装,最好在安装工具之前,保证当前的安装包是最新的版本。 - - - # yum -y update && yum install trickle [On RedHat based systems] - # aptitude -y update && aptitude install trickle [On Debian based systems] - -2. 确认trickle是否对特定的二进制包有用。 - -之前我们解释过,trickle只对使用动态或共享包的二进制包有用。为了确认我们是否可以对某个特定的应用使用trickle,我们可以使用著名的ldd( -列出动态依赖)工具。 特别地,我们会查看任何给定程序的动态依赖中检查其当前使用的glibc,因为其准确地定义了使用套接字交流中使用的系统调用。 - -对一个给定的二进制包执行以下命令来查看是否能对其使用trickle进行宽带调整: - - # ldd $(which [binary]) | grep libc.so - -例如, - - # ldd $(which ncftp) | grep libc.so - -其输出是: - - # libc.so.6 => /lib64/libc.so.6 (0x00007efff2e6c000) - -输出中的括号中的字符可能在不同的系统平台中发生改变,甚至相同的命令在不同的时候运行也会,因为其代表包加载到物理内存中的地址。 - -如果上面的命令没有返回任何的结果,就说明这个二进制包没有使用libc包,因此tricle对其不能起到宽带调整的作用。 - -### 学习如何使用Trickle### - -最基本的用法就是使用其单模式,通过这种方式,trickle用来显示地定义给定应用程序的上传下载速率。如前所述,为了简单性,我们会使用相同的应用 -来进行上传下载测试。 - -#### 在单模式下运行trickle#### - -我们会比较在有无trickle的情况下的上传下载速率, ‘-d’选项指示下载速率(KB/s单位),而'-u'选项指示相同单位的上传速率。另外我们会使用到‘-s’ -选项来指定trickle应该以单模式运行。 - -以单模式运行trickle的基本语法如下: - - # trickle -s -d [download rate in KB/s] -u [upload rate in KB/s] - -为了能够让你自己运行以下样例,确保你在自己的客户端安装了trickle和ncftp(我的是192.168.0.17)。 - -**样例1:在有无trickle的情况下上传一个2.8 MB的PDF文件。** - -我们使用一个自由发布的LInux基础知识PDF文件来进行下面的测试[文件链接][2]。 - -你可以首先使用下面的命令将这个文件下载到你当前的工作目录中: - # wget http://linux-training.be/files/books/LinuxFun.pdf - -下面是在没有trickle的情况下将一个文件上传到我们的FTP服务器的语法: - - # ncftpput -u username -p password 192.168.0.15 /remote_directory local-filename - -其中的 /remote_directory 是相对于用户名的Home目录的上传路径,而local-filename是一个你当前工作目录中的文件。 - -特别的是,在没有trickle的情形下,我们可以得到上传峰值速率52.02MB/s(请注意,这个不是真正的平均上传速率,而是峰值开始的瞬时值),而且这个文件几乎 -在瞬间就完成了上传。 - - # ncftpput -u username -p password 192.168.0.15 /testdir LinuxFun.pdf - -输出: - - LinuxFun.pdf: 2.79 MB 52.02 MB/s - -在使用trickle的情况下,我们会限制上传速率在5KB/s。在第二次上传文件之前,我们需要在目标目录中删除这个文件,否则ncftp就会通知我们在目标 -目录中已经存在了与上传文件相同的文件,从而不会执行文件的传输: - # rm /absolute/path/to/destination/directory/LinuxFun.pdf - -然后: - - # trickle -s -u 5 ncftpput -u username -p password 111.111.111.111 /testdir LinuxFun.pdf - -输出: - - LinuxFun.pdf: 2.79 MB 4.94 kB/s - -在上面的样例中,我们看到平均的上传速率下降到了5KB/s。 - -**样例2:在有无trickle的情况下下载相同过得2.8MB的PDF文件** - -首先,记得从原来的源文目录中删除这个PDF: - - # rm /absolute/path/to/source/directory/LinuxFun.pdf - -请注意,下面的样例中将远程的文件下载到客户端机器的当前目录下,这是由FTP服务器的IP地址后面的·.·决定的。 - -没有trickle的情况下: - - # ncftpget -u username -p password 111.111.111.111 . /testdir/LinuxFun.pdf - -输出: - - LinuxFun.pdf: 2.79 MB 260.53 MB/s - -在有trickle的情况下,限制下载速率在20KB/s: - - # trickle -s -d 30 ncftpget -u username -p password 111.111.111.111 . /testdir/LinuxFun.pdf - -输出: - - LinuxFun.pdf: 2.79 MB 17.76 kB/s - -### 在有监督的模式下运行Trickle [未管理的]### - -Tricle也可以在未管理的模式下运行,通过跟随在/etc/tricled.conf文件中定义的一系列参数。 这个文件定义了守护线程 trickled的行为以及如何管理tricle。 - -另外,如果你想要全局设置被所有的应用程序使用的话,我们就会需要使用tricle命令。 这个命令运行守护线程并允许我们通过trickle定义所有应用程序共享的上传下载限制,不需要我们每次来进行指定。 - -例如,运行: - - # trickled -d 50 -u 10 - -会导致任何通过tricle运行的应用程序的上传下载速率分别限制在30kb/s和10kb/s。 - -请注意,你可以在任何时间都能确认守护线程tricled是否正在运行以及其运行参数: - - # ps -ef | grep trickled | grep -v grep - -输出: - - root 16475 1 0 Dec24 ? 00:00:04 trickled -d 50 -u 10 - -**样例3:在是否使用tricle的情形下上传一个 19MB 的mp4文件到我们的FTP服务器。** - -在这个样例中,我们会使用“He is the gift”的自由分布视频,可以通过这个[链接][3]下载。 - -我们将会在开始通过以下的命令将这个文件下载到你的当前工作目录中: - - # wget http://media2.ldscdn.org/assets/missionary/our-people-2014/2014-00-1460-he-is-the-gift-360p-eng.mp4 - -首先,我们会使用之前列出的命令来开启守护进程trickled: - - # trickled -d 30 -u 10 - -在没有trickle时: - - # ncftpput -u username -p password 192.168.0.15 /testdir 2014-00-1460-he-is-the-gift-360p-eng.mp4 - -输出: - - 2014-00-1460-he-is-the-gift-360p-eng.mp4: 18.53 MB 36.31 MB/s - -有trickle的时: - - # trickle ncftpput -u username -p password 192.168.0.15 /testdir 2014-00-1460-he-is-the-gift-360p-eng.mp4 - -输出: - - 2014-00-1460-he-is-the-gift-360p-eng.mp4: 18.53 MB 9.51 kB/s - -我们可以看到上面的输出,上传的速率下降到了约 10KB/s。 - -** 样例4:在有无trickle的情形下下载这个相同的视频 ** - -与样例2一样,我们会将该文件下载到当前工作目录中。 - -在没有trickle时: - - # ncftpget -u username -p password 192.168.0.15 . /testdir/2014-00-1460-he-is-the-gift-360p-eng.mp4 - -输出: - - 2014-00-1460-he-is-the-gift-360p-eng.mp4: 18.53 MB 108.34 MB/s - -有trickle的时: - - # trickle ncftpget -u username -p password 111.111.111.111 . /testdir/2014-00-1460-he-is-the-gift-360p-eng.mp4 - -输出: - 2014-00-1460-he-is-the-gift-360p-eng.mp4: 18.53 MB 29.28 kB/s - -上面的结果与我们之前设置的下载限速相对应(30KB/s)。 - -**注意:** 一旦守护进程开启之后,没有必要使用trickle来为每个应用程序来单独设置限制。 - -如前所述,每个人都可以进一步地通过tricled.conf来客制化tricle的宽带速率调整,该文件的一个典型的分区有以下部分组成: - - [service] - Priority = - Time-Smoothing = - Length-Smoothing = - -其中, - -- [service] 用来指示我们想要对其进行宽带使用调整的应用程序名称 -- Priority 用来让我们为某个服务制定一个相对于其他服务高的优先级,这样就不允许守护进程管理中的一个单独的应用程序来占用所有的宽带。越小的数字代表更高的优先级。 -- Time-Smoothing [以秒计]: 定义了trickled让各个应用程序传输或接收数据的时间间隔。小的间隔值(0.1-1秒)对于交互式应用程序是理想的,因为这样会具有一个更加平滑的会话体验,而一个相对较大 -的时间间隔值(1-10秒)对于需要批量传输应用程序就会显得更好。如果没有指定该值,默认是5秒。 -- Length-smoothing [KB 单位]: 该想法与Time-Smoothing如出一辙,但是是基于I/O操作而言。如果没有指定值,会使用默认的10KB。 - -平滑值的改变会被翻译为将指定的服务的使用一个间隔值而不是一个固定值。不幸的是,没有一个特定的公式来计算间隔值的上下限,主要依赖于特定的应用场景。 - -下面是一个在CentOS 7 客户端中的tricled.conf 样例文件(192.168.0.17): - - [ssh] - Priority = 1 - Time-Smoothing = 0.1 - Length-Smoothing = 2 - - [ftp] - Priority = 2 - Time-Smoothing = 1 - Length-Smoothing = 3 - -使用该设置,tricled会为SSH赋予比FTP较高的传输优先级。值得注意的是,一个交互进程,例如SSH,使用了一个较小的时间间隔值,然而一个处理批量数据传输的服务如FTP使用一个较大的时间 -间隔来负责之前的样例中的上传下载速率,尽管不是百分百的有trickled指定的值,但是也已经非常接近了。 - -### 总结 ### -在该文章中,我们探索了任何使用trickle在基于Fedora发行版和Debian衍生版平台上来限制应用程序的宽带使用.也包含了其他的可能用法,但是不对以下情形进行限制: - -- 限制系统下载工具的下载速度,例如[wget][4],或 BT客户端. - -- 限制你的系统的包管理工具`[yun][5]`更新的速度 (如果是基于Debian系统的话,其包管理工具为`[aptitude][6]`)。 - -- 如果你的服务器是在一个代理或防火墙后面(或者其本身即是代理或防火墙的话),你可以使用trickle来同时设定下载和上传速率,或者与客户端或外部交流速率。 - -欢迎提问或留言. --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/manage-and-limit-downloadupload-bandwidth-with-trickle-in-linux/ - -作者:[Gabriel Cánepa][a] -译者:[theo-l](https://github.com/theo-l) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://www.tecmint.com/author/gacanepa/ -[1]:http://www.tecmint.com/how-to-enable-epel-repository-for-rhel-centos-6-5/ -[2]:http://linux-training.be/files/books/LinuxFun.pdf -[3]:http://media2.ldscdn.org/assets/missionary/our-people-2014/2014-00-1460-he-is-the-gift-360p-eng.mp4 -[4]:http://www.tecmint.com/10-wget-command-examples-in-linux/ -[5]:http://www.tecmint.com/20-linux-yum-yellowdog-updater-modified-commands-for-package-mangement/ -[6]:http://www.tecmint.com/dpkg-command-examples/ From e383e70fc4abf2d5d4fbbc817fd5f492c95ae070 Mon Sep 17 00:00:00 2001 From: sevenot Date: Wed, 27 May 2015 02:33:09 +0800 Subject: [PATCH 176/965] sevenot traslating --- ...515 New to Linux 5 Apps You Didn't Know You Were Missing.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/share/20150515 New to Linux 5 Apps You Didn't Know You Were Missing.md b/sources/share/20150515 New to Linux 5 Apps You Didn't Know You Were Missing.md index 99b4b1915f..851ed5c676 100644 --- a/sources/share/20150515 New to Linux 5 Apps You Didn't Know You Were Missing.md +++ b/sources/share/20150515 New to Linux 5 Apps You Didn't Know You Were Missing.md @@ -1,3 +1,4 @@ +sevenot Translating New to Linux? 5 Apps You Didn’t Know You Were Missing ================================================================================ ![](http://cdn.makeuseof.com/wp-content/uploads/2015/05/linux-apps-840x420.jpg?92a7a3) @@ -100,4 +101,4 @@ via: http://www.makeuseof.com/tag/new-linux-5-apps-didnt-know-missing/ [11]:http://www.makeuseof.com/tag/4-ways-teach-terminal-commands-linux-si/ [12]:http://www.makeuseof.com/tag/10-top-linux-desktop-environments-available/ [13]:https://yakuake.kde.org/ -[14]:http://www.makeuseof.com/tag/linux-treasures-x-sublime-native-linux-apps-will-make-want-switch/ \ No newline at end of file +[14]:http://www.makeuseof.com/tag/linux-treasures-x-sublime-native-linux-apps-will-make-want-switch/ From 4bbad6c59bf905a466b5029b1d4885b4ea735dd2 Mon Sep 17 00:00:00 2001 From: GOLinux Date: Wed, 27 May 2015 10:01:57 +0800 Subject: [PATCH 177/965] [Translated]20150525 Linux ntopng--Network Monitoring Tool Installation Screenshots.md --- ...onitoring Tool Installation Screenshots.md | 189 ------------------ ...onitoring Tool Installation Screenshots.md | 189 ++++++++++++++++++ 2 files changed, 189 insertions(+), 189 deletions(-) delete mode 100644 sources/tech/20150525 Linux ntopng--Network Monitoring Tool Installation Screenshots.md create mode 100644 translated/tech/20150525 Linux ntopng--Network Monitoring Tool Installation Screenshots.md diff --git a/sources/tech/20150525 Linux ntopng--Network Monitoring Tool Installation Screenshots.md b/sources/tech/20150525 Linux ntopng--Network Monitoring Tool Installation Screenshots.md deleted file mode 100644 index 17c3add528..0000000000 --- a/sources/tech/20150525 Linux ntopng--Network Monitoring Tool Installation Screenshots.md +++ /dev/null @@ -1,189 +0,0 @@ -Translating by GOLinux! -Linux ntopng - Network Monitoring Tool Installation (Screenshots) -================================================================================ -Nowdays computers are connected between each other. From the small area such as your home Local Area Network (LAN) until the the biggest one which we call - Internet. When you are managing a network computer, you are managing one of the most critical component. Since most of developed application is web based application, the network between critical. - -There is why we need a network monitoring tool. One of the best network monitoring tool is called ntop. From [Wikipedia][1] “ntop is a network probe that shows network usage in a way similar to what top does for processes. In interactive mode, it displays the networkstatus on the user's terminal. In Web mode, it acts as a web server, creating a HTML dump of the network status. It supports a NetFlow/sFlowemitter/collector, a HTTP-based client interface for creating ntop-centric monitoring applications, and RRD for persistently storing traffic statistics” - -Now after 15 years, you will find ntopng - the next generation ntop. - -### What is ntopng ### - -Ntopng is a high-speed web-based traffic analysis and flow collection. Ntopng is based from ntop. It’s run on every Unix platform, MacOS X and Windows. - -### Features ### - -From [ntopng website][2], they said there are many features of it. Here’s some of the list : - -- Sort network traffic according to many protocols -- Show network traffic and IPv4/v6 active hosts -- Store on disk persistent traffic statistics in RRD format Geolocate hosts -- Discover application protocols by leveraging on nDPI, ntop’s DPI framework -- Show IP traffic distribution among the various protocols -- Analyse IP traffic and sort it according to the source/destination -- Display IP Traffic Subnet matrix (who’s talking to who?) -- Report IP protocol usage sorted by protocol type -- Produce HTML5/AJAX network traffic statistics - -### Installation ### - -Ntop is available in pre-compiled packages for CentOS dan Ubuntu **64-bit based**. You may find the packages in [their download page][3]. For 32-bit operating system, you have to compile it from the source. This article is **tested** on **CentOS 6.4 32-bit** version. But it may works also in other version of CentOS / RedHat based Linux. Let’s start. - -#### Prerequisites #### - -#### Development Tools #### - -You have to make sure that you have all development tools which is needed to compile ntopng. To install the development tools you can use yum command : - - # yum groupinstall ‘Development Tools’ - -#### Install TCL #### - - # yum install tcl - -#### Install libpcap #### - - # yum install libpcap libcap-devel - -#### Install Redis #### - - # wget http://redis.googlecode.com/files/redis-2.6.13.tar.gz - # tar zxfv redis-2.6.13.tar.gz - # cd redis-2.6.13 - # make 32bit - # make test - # make install - -### Install ntopng ### - -#### Method 1 : #### - - # wget http://sourceforge.net/projects/ntop/files/ntopng/ntopng-1.1_6932.tgz/download - # tar zxfv ntopng-1.1_6932.tgz - # cd ntopng-1.1_6932 - # ./configure - # make - # make install - -#### Method 2 : #### - -On my CentOS 6.4 , I got an error message when using Method 1. Here’s the error message : - - ./third-party/LuaJIT-2.0.2/src/libluajit.a : could not read symbols : File in wrong format - -So I **switch** to install it using **SVN**. Internet connection is required for this installation method. Here’s the steps : - - # svn co https://svn.ntop.org/svn/ntop/trunk/ntopng/ - # ./autogen.sh - # ./configure - # make - # make install - -*Since ntopng is a web-based application, your system must have a working web-server installed* - -### Create configuration files for ntopng ### - -If everything is installed, then it’s time for us to running it. By default, redis and ntopng will installed in /usr/local/ folder if we don’t change the installation folder explicitly in ./configure step. Next we need to create configuration files for ntopng. In this article we use vi as text editor. You can use your favorite text editor to create ntopng configuration files. - - # cd /usr/local/etc - # mkdir ntopng - # cd ntopng - # vi ntopng.start - - Put these lines : - --local-network “10.0.2.0/24” - --interface 1 - - # vi ntopng.pid - - Put this line : - -G=/var/run/ntopng.pid - -Save those files and we can continue to the next step - -### Run ntopng ### - -We assume that you have installed web server correctly, then the next step is to run redis server. - - # /usr/local/bin/redis-server - -![Starting Redis Server](http://blog.linoxide.com/wp-content/uploads/2013/11/redis-server-start.png) - -Then **run** ntopng - - # /usr/local/bin/ntopng - -![Starting Ntopng](http://blog.linoxide.com/wp-content/uploads/2013/11/ntopng-start.png) - -### Testing ntopng ### - -Now you can test your ntopng application by typing [http://yourserver.name:3000][4] . You will see ntopng login page. For the first time, you can use user ‘**admin**’ and password ‘**admin**’. - -![Ntop Login page](http://blog.linoxide.com/wp-content/uploads/2013/11/ntopng_login.png) - -The dashboard is quite simple. After you logged in, you will see an information about Top Flow Talkers. - -![Ntopng Flow Talker](http://blog.linoxide.com/wp-content/uploads/2013/11/ntopng_talkers.png) - -If you click **Flows menu** on the right top, ntopng will show you more detail about Active Flows. - -![Ntopng Flows](http://blog.linoxide.com/wp-content/uploads/2013/11/ntopng_flows.png) - -On **Hosts menu**, you can see all hosts which are connected to the flows - -![Ntopng Hosts List](http://blog.linoxide.com/wp-content/uploads/2013/11/ntopng_hoslist.png) - -If you click **Hosts > Interactions**, ntop will show you a nice graphic about interaction which happen between them. - -![Ntopng Hosts Interaction](http://blog.linoxide.com/wp-content/uploads/2013/11/ntopng_hosts_interaction.png) - -**Dashboard menu** consist of : - -#### Top Hosts (Send+Receive) #### - -![Ntopng Hosts](http://blog.linoxide.com/wp-content/uploads/2013/11/ntopng_hosts.png) - -#### Top Application Protocol #### - -![Ntopng Apps](http://blog.linoxide.com/wp-content/uploads/2013/11/ntopng_apps.png) - -**Interfaces menu** will bring you more menus inside. Packets menu shows you size distribution of packets. - -![Ntopng packets](http://blog.linoxide.com/wp-content/uploads/2013/11/ntopng_packets.png) - -**Protocols menus** will give you information about how many protocols that have been used and its percentage. - -![Ntopng protocol](http://blog.linoxide.com/wp-content/uploads/2013/11/ntopng_protocol.png) - -![Ntopng protocols - detail](http://blog.linoxide.com/wp-content/uploads/2013/11/ntopng_protocol_detail.png) - -You can also see the activity by using **Historical Activity menu** - -![Ntopng Historical Activity](http://blog.linoxide.com/wp-content/uploads/2013/11/ntopng_historical.png) - -![Ntopng Historical Activity detail](http://blog.linoxide.com/wp-content/uploads/2013/11/ntopng_historical_detail.png) - -Last but not least, you can also manage the user who can access ntopng via **Settings menu** on the top right area (the one that have a gear icon). Then click **Manage Users**. - -![Ntopng Users](http://blog.linoxide.com/wp-content/uploads/2013/11/ntopng_users.png) - -Ntopng provide you with a wide range of timeframe, from every 5 minutes until 1 year. You just need to click the timeframe you want to show. The graphic itself is clickable. You can click it to zoom it. - -Of course, ntopng is more than just pictures above. You can also integrates it with GeoLocation and GeoMap services. From ntopng website it self, there are a paid modul such as nprobe to enrich the information provided by ntopng. For more detail usage of ntopng, please visit [ntopng website][5]. - --------------------------------------------------------------------------------- - -via: http://linoxide.com/monitoring-2/ntopng-network-monitoring-tool/ - -作者:[Pungki Arianto][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://linoxide.com/author/pungki/ -[1]:http://en.wikipedia.org/wiki/Ntop -[2]:http://www.ntop.org/products/ntop/ -[3]:http://www.nmon.net/packages/ -[4]:http://yourserver.name:3000/ -[5]:http://www.ntop.org/ diff --git a/translated/tech/20150525 Linux ntopng--Network Monitoring Tool Installation Screenshots.md b/translated/tech/20150525 Linux ntopng--Network Monitoring Tool Installation Screenshots.md new file mode 100644 index 0000000000..dc039ba551 --- /dev/null +++ b/translated/tech/20150525 Linux ntopng--Network Monitoring Tool Installation Screenshots.md @@ -0,0 +1,189 @@ +Linux ntopng——网络监控工具的安装(附截图) +================================================================================ +当今世界,人们的计算机都相互连接,互联互通。小到你的家庭局域网(LAN),大到最大的一个被我们称为的——互联网。当你管理一台联网的计算机时,你就是在管理最关键的组件之一。由于大多数开发出的应用程序都基于网络,网络就连接起了这些关键点。 + +这就是为什么我们需要网络监控工具。最好的网络监控工具之一,它叫作ntop。来自[维基百科][1]的知识“ntop是一个网络探测器,它以与top显示进程般类似的方式显示网络使用率。在交互模式中,它显示了用户终端上的网络状态。在网页模式中,它作为网络服务器,创建网络状态的HTML转储文件。它支持NetFlow/sFlowemitter/collector,这是一个基于HTTP的客户端界面,用于创建ntop为中心的监控应用和RRD用于持续地存储通信数据” + +15年后的今天,你将见到ntopng——下一代ntop。 + +### ntopng是什么 ### + +Ntopng是一个基于网页的高速通信分析器和流量收集器。Ntopng基于ntop,它运行于所有Unix平台、MacOS X和Windows。 + +### 特性 ### + +从[ntopng网站][2]上,我们可以看到他们说它有众多的特性。这里列出了其中一些: + +- 按各种协议对网络通信排序 +- 显示网络通信和IPv4/v6激活的主机 +- 持续不断以RRD格式存储定位主机的通信数据到磁盘 +- 通过nDPI,ntop的DPI框架,发现应用协议 +- 显示各种协议间的IP通信分布 +- 分析IP通信,并根据源/目的地址进行排序 +- 显示IP通信子网的矩阵(谁在和谁通信?) +- 报告按协议类型排序的IP协议使用率 +- 生成HTML5/AJAX网络通信数据 + +### 安装 ### + +Ntop为CentOS和**基于64位**Ubuntu预编译好了包,你可以在[他们的下载页面][3]找到这些包。对于32位操作系统,你必须从源代码编译。本文在**CentOS 6.4 32位**版本上**测试过**。但是,它也可以在其它基于CentOS/RedHat的Linux版本上工作。让我们开始吧。 + +#### 先决条件 #### + +#### 开发工具 #### + +你必须确保你安装了编译ntopng所需的所有开发工具,要安装开发工具,你可以使用yum命令: + + # yum groupinstall ‘Development Tools’ + +#### 安装TCL #### + + # yum install tcl + +#### 安装libpcap #### + + # yum install libpcap libcap-devel + +#### 安装Redis #### + + # wget http://redis.googlecode.com/files/redis-2.6.13.tar.gz + # tar zxfv redis-2.6.13.tar.gz + # cd redis-2.6.13 + # make 32bit + # make test + # make install + +### 安装ntopng ### + +#### 方法 1 : #### + + # wget http://sourceforge.net/projects/ntop/files/ntopng/ntopng-1.1_6932.tgz/download + # tar zxfv ntopng-1.1_6932.tgz + # cd ntopng-1.1_6932 + # ./configure + # make + # make install + +#### 方法 2 : #### + +在我的CentOS 6.4上,我使用方法 1时收到了一个错误消息,错误消息内容如下: + + ./third-party/LuaJIT-2.0.2/src/libluajit.a : could not read symbols : File in wrong format + +所以,我**切换**到了**SVN**来安装。对于此方法,需要联网,步骤如下: + + # svn co https://svn.ntop.org/svn/ntop/trunk/ntopng/ + # ./autogen.sh + # ./configure + # make + # make install + +*由于ntopng是一个基于网页的应用,你的系统必须安装有工作良好的网络服务器* + +### 为ntopng创建配置文件 ### + +如果一切都已安装完毕,那么我们该来运行它了。默认情况下,如果我们在./configure这一步没有明确修改安装文件夹的话,redis和ntopng将安装到/usr/local/文件夹。接下来,我们需要为ntopng创建配置文件。在本文中,我们使用vi作为文本编辑器。你也可以使用你所中意的文本编辑器来创建ntopng的配置文件。 + + # cd /usr/local/etc + # mkdir ntopng + # cd ntopng + # vi ntopng.start + + 放入这些行: + --local-network “10.0.2.0/24” + --interface 1 + + # vi ntopng.pid + + 放入该行: + -G=/var/run/ntopng.pid + +保存这些文件,然后继续下一步。 + +### 运行ntopng ### + +我们假定你已正确安装了网络服务器,那么下一步就是运行redis服务器。 + + # /usr/local/bin/redis-server + +![Starting Redis Server](http://blog.linoxide.com/wp-content/uploads/2013/11/redis-server-start.png) + +然后,**运行**ntopng + + # /usr/local/bin/ntopng + +![Starting Ntopng](http://blog.linoxide.com/wp-content/uploads/2013/11/ntopng-start.png) + +### 测试ntopng ### + +现在,你可以通过访问[http://yourserver.name:3000][4]来测试ntopng应用,你将会看到ntopng登录页面。首次登录,你可以使用用户‘**admin**’和密码‘**admin**’。 + +![Ntop Login page](http://blog.linoxide.com/wp-content/uploads/2013/11/ntopng_login.png) + +仪表盘相当简洁。当你登入后,你将看到关于最高流量通信者页面。 + +![Ntopng Flow Talker](http://blog.linoxide.com/wp-content/uploads/2013/11/ntopng_talkers.png) + +如果你点击右侧顶部的**流量菜单**,ntopng将会显示活动流量的更多细节。 + +![Ntopng Flows](http://blog.linoxide.com/wp-content/uploads/2013/11/ntopng_flows.png) + +在**主机菜单**上,你可以看到连接到流的所有主机 + +![Ntopng Hosts List](http://blog.linoxide.com/wp-content/uploads/2013/11/ntopng_hoslist.png) + +如果你点击**主机 > 交互**,ntop将显示一个漂亮的主机间的交互信息图表。 + +![Ntopng Hosts Interaction](http://blog.linoxide.com/wp-content/uploads/2013/11/ntopng_hosts_interaction.png) + +**仪表盘菜单**组成部分: + +#### 顶级主机(发送+接收) #### + +![Ntopng Hosts](http://blog.linoxide.com/wp-content/uploads/2013/11/ntopng_hosts.png) + +#### 顶级应用协议 #### + +![Ntopng Apps](http://blog.linoxide.com/wp-content/uploads/2013/11/ntopng_apps.png) + +**界面菜单**将引领你进入更多内部菜单。 +包菜单将给你显示包的分布大小。 + +![Ntopng packets](http://blog.linoxide.com/wp-content/uploads/2013/11/ntopng_packets.png) + +**协议菜单**将为你显示使用了多少协议及其使用百分比。 + +![Ntopng protocol](http://blog.linoxide.com/wp-content/uploads/2013/11/ntopng_protocol.png) + +![Ntopng protocols - detail](http://blog.linoxide.com/wp-content/uploads/2013/11/ntopng_protocol_detail.png) + +你也可以通过使用**历史活跃度菜单**查看活跃度 + +![Ntopng Historical Activity](http://blog.linoxide.com/wp-content/uploads/2013/11/ntopng_historical.png) + +![Ntopng Historical Activity detail](http://blog.linoxide.com/wp-content/uploads/2013/11/ntopng_historical_detail.png) + +最后一项要点是,你也可以通过顶部右侧区域的**设置菜单**(齿轮图标的那一个)管理哪些用户可以访问ntopng。 + +![Ntopng Users](http://blog.linoxide.com/wp-content/uploads/2013/11/ntopng_users.png) + +Ntopng为你提供了一个范围宽广的时间线,从5分钟到1年都可以。你只需要点击你想要现实的时间线。图标本身是可以点击的,你可以点击它来进行缩放。 + +当然,ntopng能做的事比上面图片中展示的还要多得多。你也可以将定位和电子地图服务整合进来。在ntopng自己的网站上,有已付费的模块可供使用,如nprobe可以扩展ntopng可以提供给你的信息。更多关于ntopng的信息,你可以访问[ntopng网站][5]。 + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/monitoring-2/ntopng-network-monitoring-tool/ + +作者:[Pungki Arianto][a] +译者:[GOLinux](https://github.com/GOLinux) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://linoxide.com/author/pungki/ +[1]:http://en.wikipedia.org/wiki/Ntop +[2]:http://www.ntop.org/products/ntop/ +[3]:http://www.nmon.net/packages/ +[4]:http://yourserver.name:3000/ +[5]:http://www.ntop.org/ From 1b615c7983d05e50b02e9fe48884d8b6bef6a6be Mon Sep 17 00:00:00 2001 From: DeadFire Date: Wed, 27 May 2015 10:15:39 +0800 Subject: [PATCH 178/965] =?UTF-8?q?20150527-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...the Kubuntu Project Leader to Step Down.md | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 sources/news/20150527 Ubuntu Community Council Asks the Kubuntu Project Leader to Step Down.md diff --git a/sources/news/20150527 Ubuntu Community Council Asks the Kubuntu Project Leader to Step Down.md b/sources/news/20150527 Ubuntu Community Council Asks the Kubuntu Project Leader to Step Down.md new file mode 100644 index 0000000000..bdb44591fc --- /dev/null +++ b/sources/news/20150527 Ubuntu Community Council Asks the Kubuntu Project Leader to Step Down.md @@ -0,0 +1,33 @@ +Ubuntu Community Council Asks the Kubuntu Project Leader to Step Down +================================================================================ +> Jonathan Riddell refuses to step down as Kubuntu leader + +![](http://i1-news.softpedia-static.com/images/news2/Ubuntu-Community-Council-Asks-the-Kubuntu-Project-Leader-to-Step-Down-482384-2.jpg) + +**So this just happened. Scott Kitterman, a Debian developer and member of the Kubuntu Council, decided to make public some emails where it would appear that members of the Ubuntu Community Council asks Jonathan Riddell to step down from his position as a Kubuntu Project leader.** + +Jonathan Riddell, which is both a KDE and Kubuntu developer, as well as an important member of the Ubuntu community for many years now, is being accused by several members of the Ubuntu and Kubuntu community about his confrontational and aggressive behavior towards them, as [the email exchanges exposed today][1] by Scott Kitterman suggest. + +Long story short, after several email exchanges, the final decision of the Ubuntu Community Council, which is also backed by Canonical and Ubuntu founder Mark Shuttleworth, was for Jonathan Riddell to step down from all his positions as a leader within the Ubuntu and Kubuntu communities, for at least 12 months, but still being able to participate to discussions as any other member. + +"It is with regret that we write this email to discuss an issue that we feel is negatively impacting the Ubuntu Community. Over a long period of time Jonathan Riddell has become increasingly difficult to deal with. Jonathan raised valid issues and concerns, but reacted poorly when he received answers he did not agree with," reads the first email send to the Ubuntu Community Council regarding the "nasty" behavior of Jonathan Riddell. + +### Jonathan Riddell refuses to step down as a Kubuntu Project leader ### + +From the email exchanges exposed today by Scott Kitterman, who decided to write a second post on his blog, suggesting that he wants to resign from its position in the Ubuntu and Kubuntu community, it would appear that Jonathan Riddell refused to step down as a Kubuntu Project leader. + +As expected, Jonathan Riddell is being backed by members of the Kubuntu Community Council, who fired back at the Ubuntu Community Council's decision to take down the Kubuntu Project leader. "I’d like to thank all the Kubuntu members who just voted to re-affirm me on the Kubuntu Council," says Jonathan Riddell on [his blog][2]. + +-------------------------------------------------------------------------------- + +via: http://news.softpedia.com/news/Ubuntu-Community-Council-Asks-the-Kubuntu-Project-Leader-to-Step-Down-482384.shtml + +作者:[Marius Nestor][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://news.softpedia.com/editors/browse/marius-nestor +[1]:https://skitterman.wordpress.com/ +[2]:http://jriddell.org/ \ No newline at end of file From c3f16de2812d086ba81c6840c574cec8f4486df4 Mon Sep 17 00:00:00 2001 From: ZTinoZ Date: Wed, 27 May 2015 10:45:33 +0800 Subject: [PATCH 179/965] Translating by ZTinoZ --- .../tech/20150526 20 Useful Terminal Emulators for Linux.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150526 20 Useful Terminal Emulators for Linux.md b/sources/tech/20150526 20 Useful Terminal Emulators for Linux.md index 1615d3ca1a..436b28f79f 100644 --- a/sources/tech/20150526 20 Useful Terminal Emulators for Linux.md +++ b/sources/tech/20150526 20 Useful Terminal Emulators for Linux.md @@ -1,3 +1,4 @@ +Translating by ZTinoZ 20 Useful Terminal Emulators for Linux ================================================================================ A Terminal emulator is a computer program that reproduces a video terminal within some other display structure. In other words the Terminal emulator has an ability to make a dumb machine appear like a client computer networked to the server. The terminal emulator allows an end user to access console as well as its applications such as text user interface and command line interface. @@ -297,4 +298,4 @@ via: http://www.tecmint.com/linux-terminal-emulators/ [18]:http://invisible-island.net/xterm/ [19]:http://lilyterm.luna.com.tw/ [20]:https://launchpad.net/sakura -[21]:http://software.schmorp.de/pkg/rxvt-unicode \ No newline at end of file +[21]:http://software.schmorp.de/pkg/rxvt-unicode From c47e529ce6a34b5825099ca48108f08671e99270 Mon Sep 17 00:00:00 2001 From: DeadFire Date: Wed, 27 May 2015 10:45:47 +0800 Subject: [PATCH 180/965] =?UTF-8?q?20150527-2=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20150527 3 Open Source Python Shells.md | 99 ++++++++++++++ ... Adds Live Backgrounds To Linux Distros.md | 113 ++++++++++++++++ ...your documents collaboratively on Linux.md | 122 ++++++++++++++++++ 3 files changed, 334 insertions(+) create mode 100644 sources/share/20150527 3 Open Source Python Shells.md create mode 100644 sources/share/20150527 Animated Wallpaper Adds Live Backgrounds To Linux Distros.md create mode 100644 sources/tech/20150527 How to edit your documents collaboratively on Linux.md diff --git a/sources/share/20150527 3 Open Source Python Shells.md b/sources/share/20150527 3 Open Source Python Shells.md new file mode 100644 index 0000000000..c510096670 --- /dev/null +++ b/sources/share/20150527 3 Open Source Python Shells.md @@ -0,0 +1,99 @@ +3 Open Source Python Shells +================================================================================ +Python is a high-level, general-purpose, structured, powerful, open source programming language that is used for a wide variety of programming tasks. It features a fully dynamic type system and automatic memory management, similar to that of Scheme, Ruby, Perl, and Tcl, avoiding many of the complexities and overheads of compiled languages. The language was created by Guido van Rossum in 1991, and continues to grow in popularity. + +Python is a very useful and popular computer language. One of the benefits of using an interpreted language such as Python is exploratory programming with its interactive shell. You can try out code without having to write a script. But there are limitations with the Python shell. Fortunately, there are some excellent alternative Python shells that extend on the basic shell. They each offer an excellent interactive Python experience. + +---------- + +### bpython ### + +![](http://www.linuxlinks.com/portal/content/reviews/Programming/Screenshot-bpython.png) + +bpython is a fancy interface to the Python interpreter for Linux, BSD, OS X and Windows. + +The idea is to provide the user with all the features in-line, much like modern IDEs, but in a simple, lightweight package that can be run in a terminal window. + +bpython doesn't seek to create anything new or groundbreaking. Instead, it brings together a few neat ideas and focuses on practicality and usefulness. + +Features include: + +- In-line syntax highlighting - uses Pygments for lexing the code as you type, and colours appropriately +- Readline-like autocomplete with suggestions displayed as you type +- Expected parameter list for any Python function - seeks to display a list of parameters for any function you call +- "Rewind" function to pop the last line of code from memory and re-evaluate +- Send the code you've entered off to a pastebin +- Save the code you've entered to a file +- Auto-indentation +- Python 3 support + +- Website: [www.bpython-interpreter.org][1] +- Developer: Bob Farrell and contributors +- License: MIT License +- Version Number: 0.14.1 + +---------- + +### IPython ### + +![](http://www.linuxlinks.com/portal/content/reviews/Programming/Screenshot-ipython.png) + +IPython is an enhanced interactive Python shell. It provides a rich toolkit to help you make the most out of using Python interactively. + +IPython can be used as a replacement for the standard Python shell, or it can be used as a complete working environment for scientific computing (like Matlab or Mathematica) when paired with the standard Python scientific and numerical tools. It supports dynamic object introspections, numbered input/output prompts, a macro system, session logging, session restoring, complete system shell access, verbose and colored traceback reports, auto-parentheses, auto-quoting, and is embeddable in other Python programs. + +Features include: + +- Powerful interactive shells (terminal and Qt-based) +- A browser-based notebook with support for code, rich text, mathematical expressions, inline plots and other rich media +- Support for interactive data visualization and use of GUI toolkits +- Flexible, embeddable interpreters to load into your own projects +- Easy to use, high performance tools for parallel computing + +- Website: [ipython.org][2] +- Developer: The IPython Development Team +- License: BSD +- Version Number: 3.1 + +---------- + +### DreamPie ### + +![](http://www.linuxlinks.com/portal/content/reviews/Programming/Screenshot-DreamPie.png) + +DreamPie is a Python shell which is designed to be reliable and fun. + +DreamPie can use just about any Python interpreter (Jython, IronPython, PyPy). + +Features include: + +- New concept for an interactive shell: the window is divided into the history box, which lets you view previous commands and their output, and the code box, where you write your code. This allows you to edit any amount of code, just like in your favorite editor, and execute it when it's ready. You can also copy code from anywhere, edit it and run it instantly +- The Copy code only command will copy the code you want to keep, so you can save it in a file. The code is already formatted nicely with a four-space indentation +- Automatic completion of attributes and file names +- Automatically displays function arguments and documentation +- Keeps your recent results in the result history, for later use +- Can automatically fold long outputs, so you can concentrate on what's important +- Save the history of the session as an HTML file, for future reference. You can then load the history file into DreamPie, and quickly redo previous commands +- Automatically adds parentheses and optionally quotes when you press space after functions and methods. For example, type execfile fn and get execfile("fn") +- Supports interactive plotting with matplotlib +- Xupport for Python 2.5, Python 2.6, Python 3.1, Jython 2.5, IronPython 2.6, and PyPy +- Extremely fast and responsive. + +- Website: [www.dreampie.org][3] +- Developer: Noam Yorav-Raphael +- License: GNU GPL v3 +- Version Number: 1.2.1 + +-------------------------------------------------------------------------------- + +via: http://www.linuxlinks.com/article/20150523032756576/PythonShells.html + +作者:Frazer Kline +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[1]:http://www.bpython-interpreter.org/ +[2]:http://ipython.org/ +[3]:http://www.dreampie.org/ \ No newline at end of file diff --git a/sources/share/20150527 Animated Wallpaper Adds Live Backgrounds To Linux Distros.md b/sources/share/20150527 Animated Wallpaper Adds Live Backgrounds To Linux Distros.md new file mode 100644 index 0000000000..92eff36326 --- /dev/null +++ b/sources/share/20150527 Animated Wallpaper Adds Live Backgrounds To Linux Distros.md @@ -0,0 +1,113 @@ +Animated Wallpaper Adds Live Backgrounds To Linux Distros +================================================================================ +**We know a lot of you love having a stylish Ubuntu desktop to show off.** + +![Live Wallpaper](http://i.imgur.com/9JIUw5p.gif) + +Live Wallpaper + +And as Linux makes it so easy to create a stunning workspace with a minimal effort, that’s understandable! + +Today, we’re highlighting — [re-highlighting][2] for those of you with long memories — a free, open-source tool that can add extra bling your OS screenshots and screencasts. + +It’s called **Live Wallpaper** and (as you can probably guess) it will replace the standard static desktop background with an animated alternative powered by OpenGL. + +And the best bit: it can be installed in Ubuntu very easily. + +### Animated Wallpaper Themes ### + +![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/05/animated-wallpaper-ubuntu-750x383.jpg) + +Live Wallpaper is not the only app of this type, but it is one of the the best. + +It comes with a number of different themes out of the box. + +These range from the subtle (‘noise’) to frenetic (‘nexus’), and caters to everything in between. There’s even the obligatory clock wallpaper inspired by the welcome screen of the Ubuntu Phone: + +- Circles — Clock inspired by Ubuntu Phone with ‘evolving circle’ aura +- Galaxy — Spinning galaxy that can be resized/repositioned +- Gradient Clock — A polar clock overlaid on basic gradient +- Nexus — Brightly colored particles fire across screen +- Noise — A bokeh design similar to the iOS dynamic wallpaper +- Photoslide — Grid of photos from folder (default ~/Photos) animate in/out + +Live Wallpaper is **fully open-source** so there’s nothing to stop imaginative artists with the know-how (and patience) from creating some slick themes of their own. + +### Settings & Features ### + +![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/05/live-wallpaper-gui-settings.jpg) + +Each theme can be configured or customised in some way, though certain themes have more options than others. + +For example, in Nexus (pictured above) you can change the number and colour of the the pulse particles, their size, and their frequency. + +The preferences app also provides a set of **general options** that will apply to all themes. These include: + +- Setting live wallpaper to run on log-in +- Setting a custom background that the animation sits on +- Adjusting the FPS (including option to show FPS on screen) +- Specifying the multi-monitor behaviour + +With so many options available it should be easy to create a background set up that suits you. + +### Drawbacks ### + +#### No Desktop Icons #### + +You can’t add, open or edit files or folders on the desktop while Live Wallpaper is ‘On’. + +The Preferences app does list an option that will, supposedly, let you do this. It may work on really older releases but in our testing, on Ubuntu 14.10, it does nothing. + +One workaround that seems to work for some users of the app on Ubuntu is setting a .png image as the custom background. It doesn’t have to be a transparent .png, simply a .png. + +#### Resource Usage #### + +Animated wallpapers use more system resources than standard background images. + +We’re not talking about 50% load at all times —at least not with this app in our testing— but those on low-power devices and laptops will want to use apps like this cautiously. Use a [system monitoring tool][2] to keep an eye on CPU and GPU load. + +#### Quitting the app #### + +The biggest “bug” for me is the absolute lack of “quit” option. + +Sure, the animated wallpaper can be turned off from the Indicator Applet and the Preferences tool but quitting the app entirely, quitting the indicator applet? Nope. To do that I have to use the ‘pkill livewallpaper’ command in the Terminal. + +### How to Install Live Wallpaper in Ubuntu 14.04 LTS + ### + +![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/05/terminal-command-750x146.jpg) + +To install Live Wallpaper in Ubuntu 14.04 LTS and above you will first need to add the official PPA for the app to your Software Sources. + +The quickest way to do this is using the Terminal: + + sudo add-apt-repository ppa:fyrmir/livewallpaper-daily + + sudo apt-get update && sudo apt-get install livewallpaper + +You should also install the indicator applet, which lets you quickly and easily turn on/off the animated wallpaper and switch theme from the menu area, and the GUI settings tool so that you can configure each theme based on your tastes. + + sudo apt-get install livewallpaper-config livewallpaper-indicator + +When everything has installed you will be able to launch the app and its preferences tool from the Unity Dash. + +![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/05/live-wallpaper-app-launcher.png) + +Annoyingly, the Indicator Applet won’t automatically open after you install it. It does add itself to the start up list, so a quick log out > log in will get it to show. + +### Summary ### + +If you fancy breathing life into a dull desktop, give it a spin — and let us know what you think of it and what animated wallpapers you’d love to see added! + +-------------------------------------------------------------------------------- + +via: http://www.omgubuntu.co.uk/2015/05/animated-wallpaper-adds-live-backgrounds-to-linux-distros + +作者:[Joey-Elijah Sneddon][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://plus.google.com/117485690627814051450/?rel=author +[1]:http://www.omgubuntu.co.uk/2012/11/live-wallpaper-for-ubuntu +[2]:http://www.omgubuntu.co.uk/2011/11/5-system-monitoring-tools-for-ubuntu \ No newline at end of file diff --git a/sources/tech/20150527 How to edit your documents collaboratively on Linux.md b/sources/tech/20150527 How to edit your documents collaboratively on Linux.md new file mode 100644 index 0000000000..91d2bf6441 --- /dev/null +++ b/sources/tech/20150527 How to edit your documents collaboratively on Linux.md @@ -0,0 +1,122 @@ +How to edit your documents collaboratively on Linux +================================================================================ +> "Developed many years before by some high-strung, compulsive assistant, the Bulletin was simply a Word document that lived in a shared folder both Emily and I could access. Only one of us could open it at a time and add a new message, thought, or question to the itemized list. Then we'd print out the updated version and place it on the clipboard that sat on the shelf over my desk, removing the old ones as we went." ("The Devil Wears Prada" by Lauren Weisberger) + +Even today such a "collaborative editing" is in use where only one person can open a shared file, make changes to it, and then inform others about what and when was modified. + +ONLYOFFICE is an open source online office suite integrated with different management tools for documents, emails, events, tasks and client relations. + +Using ONLYOFFICE office suite, a group of people can edit text, spreadsheet or presentation within a browser simultaneously. Leave comments directly in their document and interact with each other using the integrated chat. And, finally, save the document as a PDF file for further printing. As an added bonus, it gives the possibility to view the document history and restore the previous revision/version if needed. + +In this tutorial, I will describe how to deploy your own online office suite using [ONLYOFFICE Free Edition][1], an ONLYOFFICE self-hosted version distributed under GNU AGPL v3. + +### Installing ONLYOFFICE on Linux ### + +ONLYOFFICE installation requires the presence of mono (version 4.0.0 or later), nodejs, libstdc++6, nginx and mysql-server in your Linux system. To simplify the installation process and avoid dependency errors, I install ONLYOFFICE using Docker. In this case there is only one dependency to be installed - [Docker][2]. + +Just to remind, Docker is an open-source project that automates the deployment of applications inside software containers. If Docker is not available on your Linux system, install it first by referring to Docker installation instructions for [Debian-based][3] or [Red-Hat based][4] systems. + +Note that you will need Docker 1.4.1 or later. To check the installed Docker version, use the following command. + + $ docker version + +To try ONLYOFFICE inside a Docker container, simply execute the following commands: + + $ sudo docker run -i -t -d --name onlyoffice-document-server onlyoffice/documentserver + $ sudo docker run -i -t -d -p 80:80 -p 443:443 --link onlyoffice-document-server:document_server onlyoffice/communityserver + +These commands will download the [official ONLYOFFICE Docker image][5] with all dependencies needed for its correct work. + +It's also possible to install [ONLYOFFICE Online Editors][6] separately on a Linux server, and easily integrate it into your website or cloud application via API provided. + +### Running a Self-Hosted Online Office ### + +To open your online office, enter localhost (http://IP-Address/) in the address bar of your browser. The Welcome page will open: + +![](https://farm9.staticflickr.com/8815/18116525656_795821c73b_c.jpg) + +Enter a password and specify the email address you will use to access your office the next time. + +### Editing Your Documents Online ### + +First, click the Documents link to open **the My Documents** folder. + +![](https://farm8.staticflickr.com/7781/17956640089_d3df0b18cd_c.jpg) + +#### STEP 1. Select a Document to Edit #### + +To create a new document right there, click on the **Create** button in the upper left corner, and choose the file type from the drop-down list. To edit a file stored on your hard disk drive, upload it to **Documents** clicking the **Upload** button next to **Create** button. + +![](https://farm9.staticflickr.com/8836/17956640109_ed8be735df_c.jpg) + +#### STEP 2. Share your Document #### + +Use the **Share** button to the right side if you are in the **My Documents** folder, or follow **File >> Document Info ... >> Change Access Rights** if you are inside your document. + +In the opened **Sharing Settings** window, click on the **People outside portal** link on the left, open the access to the document, and give full access to it by enabling the **Full Access** radio button. + +Finally, choose a way to share the link to your document, send it via email or one of the available social networks: Google+, Facebook, or Twitter. + +![](https://farm8.staticflickr.com/7766/17522306273_c8a9022c75_c.jpg) + +#### STEP 3. Start the Collaborative Editing #### + +To start co-editing the document, the invited person just needs to follow the provided link. + +The text passages edited by your co-editors will be automatically marked with dashed lines of different colors. + +![](https://farm8.staticflickr.com/7790/18139370292_7ef57aae8f_c.jpg) + +As soon as one of your collaborators saves his/her changes, you will see a note appearing in the left upper corner of the top toolbar, indicating that there areupdates. + +![](https://farm8.staticflickr.com/7778/18143984831_3dd42a9672_c.jpg) + +To save your changes and get updates, click on the **Save** icon. All the updates will then be highlighted. + +![](https://farm8.staticflickr.com/7796/17955172970_e53460b8a6_c.jpg) + +#### STEP 4. Interact with your Co-editors #### + +To leave some comments, select a text passage with the mouse, right-click on it and, and choose the **Add comment** option from the context menu. + +![](https://farm8.staticflickr.com/7771/17956640359_c4e2858dc8_c.jpg) + +To interact with co-editors in real time, use the integrated chat instead. All the users who currently edit the document will be listed on the **Chat** panel. To open it, click on the **Chat** icon at the left-side bar. To start a discussion, enter your message into an appropriate field on the **Chat** panel. + +![](https://farm8.staticflickr.com/7794/18116394026_d93b00e4f8_c.jpg) + +### Useful Tips ### + +As final notes, here are some useful tips for you to take full advantage of ONLYOFFICE. + +#### Tip #1. Editing your Docs from Cloud Storage Services, Like ownCloud #### + +If you store your documents in other web resources like Box, Dropbox, Google Drive, OneDrive, SharePoint or ownCloud, you can easily synchronize them with the ONLYOFFICE. + +In the opened 'Documents' module, click one of the icons under the **Add the account** caption: Google, Box, DropBox, OneDrive, ownCloud or 'Add account', and enter the requested data. + +#### Tip #2. Editing Your Docs on iPad #### + +To add some changes to your document on the go, I use ONLYOFFICE Documents app for iPad. You can download and install it from [iTune][7], then you need to enter your ONLYOFFICE portal address, email and password to access your documents. The feature set is almost the same. + +To evaluate ONLYOFFICE Online Editors features, you can use the [cloud version][8] for personal use. + +-------------------------------------------------------------------------------- + +via: http://xmodulo.com/edit-documents-collaboratively-linux.html + +作者:[Tatiana Kochedykova][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://xmodulo.com/author/tatiana +[1]:http://www.onlyoffice.org/ +[2]:http://xmodulo.com/recommend/dockerbook +[3]:http://xmodulo.com/manage-linux-containers-docker-ubuntu.html +[4]:http://xmodulo.com/docker-containers-centos-fedora.html +[5]:https://registry.hub.docker.com/u/onlyoffice/communityserver/ +[6]:http://onlyoffice.org/sources#document +[7]:https://itunes.apple.com/us/app/onlyoffice-documents/id944896972 +[8]:https://personal.onlyoffice.com/ \ No newline at end of file From ee1dc9ac5df93a17f9d0797dc9d9271d38b63eb2 Mon Sep 17 00:00:00 2001 From: ZTinoZ Date: Wed, 27 May 2015 10:53:16 +0800 Subject: [PATCH 181/965] Translating by ZTinoZ --- .../tech/20150526 20 Useful Terminal Emulators for Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20150526 20 Useful Terminal Emulators for Linux.md b/sources/tech/20150526 20 Useful Terminal Emulators for Linux.md index 436b28f79f..a77c665426 100644 --- a/sources/tech/20150526 20 Useful Terminal Emulators for Linux.md +++ b/sources/tech/20150526 20 Useful Terminal Emulators for Linux.md @@ -1,5 +1,5 @@ Translating by ZTinoZ -20 Useful Terminal Emulators for Linux +20款优秀的Linux终端仿真器 ================================================================================ A Terminal emulator is a computer program that reproduces a video terminal within some other display structure. In other words the Terminal emulator has an ability to make a dumb machine appear like a client computer networked to the server. The terminal emulator allows an end user to access console as well as its applications such as text user interface and command line interface. @@ -272,7 +272,7 @@ If you know any other capable Linux terminal emulators that I’ve not included via: http://www.tecmint.com/linux-terminal-emulators/ 作者:[Ravi Saive][a] -译者:[译者ID](https://github.com/译者ID) +译者:[ZTinoZ](https://github.com/ZTinoZ) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 7864340c42eee990b1d9bcc6413cb5cba06037c9 Mon Sep 17 00:00:00 2001 From: wxy Date: Wed, 27 May 2015 13:50:47 +0800 Subject: [PATCH 182/965] PUB:20150429 Synfig Studio 1.0--Open Source Animation Gets Serious @H-mudcup --- ...1.0--Open Source Animation Gets Serious.md | 23 ++++++++----------- 1 file changed, 9 insertions(+), 14 deletions(-) rename {translated/share => published}/20150429 Synfig Studio 1.0--Open Source Animation Gets Serious.md (53%) diff --git a/translated/share/20150429 Synfig Studio 1.0--Open Source Animation Gets Serious.md b/published/20150429 Synfig Studio 1.0--Open Source Animation Gets Serious.md similarity index 53% rename from translated/share/20150429 Synfig Studio 1.0--Open Source Animation Gets Serious.md rename to published/20150429 Synfig Studio 1.0--Open Source Animation Gets Serious.md index b4e41bd155..a216674d9b 100644 --- a/translated/share/20150429 Synfig Studio 1.0--Open Source Animation Gets Serious.md +++ b/published/20150429 Synfig Studio 1.0--Open Source Animation Gets Serious.md @@ -1,21 +1,16 @@ -Translating by H-mudcup - -Synfig Studio 1.0 —— 开源动画动真格的了 +Synfig Studio 1.0:开源动画动真格的了 ================================================================================ ![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/04/synfig-free-animations-750x467.jpg) **现在可以下载 Synfig Studio 这个自由、开源的2D动画软件的全新版本了。 ** -在第一次发行这个跨平台的软件一年以后,Synfig Studio 1.0 带着一套全新改和改进过的功能,实现它所承诺的“创造电影级别的动画的产业级解决方案”。 +在这个跨平台的软件首次发行一年之后,Synfig Studio 1.0 带着一套全新改进过的功能,实现它所承诺的“创造电影级的动画的工业级解决方案”。 -在众多功能之上的是一个改进过的用户界面,据工程开发者说那是个用起来‘更简单’、‘更直观’的界面。客户端添加了新的**单窗口模式**,让界面更整洁,而且**为了使用最新的 GTK3 库而被重新制作**。 +在众多功能之上的是一个改进过的用户界面,据项目开发者说那是个用起来‘更简单’、‘更直观’的界面。客户端添加了新的**单窗口模式**,让界面更整洁,而且**使用了最新的 GTK3 库重制**。 在功能方面有几个值得注意的变化,包括新加的全功能骨骼系统。 -这套**关节和转轴的‘骨骼’构架**非常适合2D剪纸动画,再配上这个版本新加的复杂的变形控制系统或是 Synfig 受欢迎的‘关键帧自动插入’(阅读:画面与画面间的变形)应该会变得非常有效率的。 - -注:youtube视频 - +这套**关节和转轴的‘骨骼’构架**非常适合2D剪纸动画,再配上这个版本新加的复杂的变形控制系统或是 Synfig 受欢迎的‘关键帧自动插入’(即:帧到帧之间的变形)应该会变得非常有效率的。(youtube视频 https://www.youtube.com/M8zW1qCq8ng ) 新的无损剪切工具,摩擦力效果和对逐帧位图动画的支持,可能会有助于释放开源动画师们的创造力,更别说新加的用于同步动画的时间线和声音的声效层! @@ -23,18 +18,18 @@ Synfig Studio 1.0 —— 开源动画动真格的了 Synfig Studio 并不是任何人都能用的工具套件,这最新发行版的最新一批改进应该能吸引一些动画制作者试一试这个软件。 -If you want to find out what open-source animation software is like for yourself, you can grab an installer for Ubuntu for the latest release direct from the project’s page using the links below. 如果你想看看开源动画制作软件是什么样的,你可以通过下面的链接直接从工程的 Sourceforge 页下载一个适用于 Ubuntu 的最新版本的安装器。 +如果你想看看开源动画制作软件是什么样的,你可以通过下面的链接直接从工程的 Sourceforge 页下载一个适用于 Ubuntu 的最新版本的安装器。 -- [Download Synfig 1.0 (64bit) .deb Installer][1] -- [Download Synfig 1.0 (32bit) .deb Installer][2] +- [下载 Synfig 1.0 (64bit) .deb 安装器][1] +- [下载 Synfig 1.0 (32bit) .deb 安装器][2] -------------------------------------------------------------------------------- via: http://www.omgubuntu.co.uk/2015/04/synfig-studio-new-release-features -作者:[oey-Elijah Sneddon][a] +作者:[Joey-Elijah Sneddon][a] 译者:[H-mudcup](https://github.com/H-mudcup) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 From c4c125648a2d04077011c367da5d2340f2350c15 Mon Sep 17 00:00:00 2001 From: DeadFire Date: Wed, 27 May 2015 14:09:33 +0800 Subject: [PATCH 183/965] =?UTF-8?q?20150527-3=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...st Using Docker Machine in a VirtualBox.md | 113 ++++++++++++++++++ ...-How to mount an LVM partition on Linux.md | 89 ++++++++++++++ 2 files changed, 202 insertions(+) create mode 100644 sources/tech/20150527 Howto Manage Host Using Docker Machine in a VirtualBox.md create mode 100644 sources/tech/20150527 Linux FAQs with Answers--How to mount an LVM partition on Linux.md diff --git a/sources/tech/20150527 Howto Manage Host Using Docker Machine in a VirtualBox.md b/sources/tech/20150527 Howto Manage Host Using Docker Machine in a VirtualBox.md new file mode 100644 index 0000000000..ea827ec74e --- /dev/null +++ b/sources/tech/20150527 Howto Manage Host Using Docker Machine in a VirtualBox.md @@ -0,0 +1,113 @@ +Howto Manage Host Using Docker Machine in a VirtualBox +================================================================================ +Hi all, today we'll learn how to create and manage a Docker host using Docker Machine in a VirtualBox. Docker Machine is an application that helps to create Docker hosts on our computer, on cloud providers and inside our own data center. It provides easy solution for creating servers, installing Docker on them and then configuring the Docker client according the users configuration and requirements. This API works for provisioning Docker on a local machine, on a virtual machine in the data center, or on a public cloud instance. Docker Machine is supported on Windows, OSX, and Linux and is available for installation as one standalone binary. It enables us to take full advantage of ecosystem partners providing Docker-ready infrastructure, while still accessing everything through the same interface. It makes people able to deploy the docker containers in the respective platform pretty fast and in pretty easy way with just a single command. + +Here are some easy and simple steps that helps us to deploy docker containers using Docker Machine. + +### 1. Installing Docker Machine ### + +Docker Machine supports awesome on every Linux Operating System. First of all, we'll need to download the latest version of Docker Machine from the [Github site][1] . Here, we'll use curl to download the latest version of Docker Machine ie 0.2.0 . + +**For 64 Bit Operating System** + + # curl -L https://github.com/docker/machine/releases/download/v0.2.0/docker-machine_linux-amd64 > /usr/local/bin/docker-machine + +**For 32 Bit Operating System** + + # curl -L https://github.com/docker/machine/releases/download/v0.2.0/docker-machine_linux-i386 > /usr/local/bin/docker-machine + +After downloading the latest release of Docker Machine, we'll make the file named **docker-machine** under **/usr/local/bin/** executable using the command below. + + # chmod +x /usr/local/bin/docker-machine + +After doing the above, we'll wanna ensure that we have successfully installed docker-machine. To check it, we can run the docker-machine -v which will give output of the version of docker-machine installed in our system. + + # docker-machine -v + +![Installing Docker Machine](http://blog.linoxide.com/wp-content/uploads/2015/05/installing-docker-machine.png) + +To enable Docker commands on our machines, make sure to install the Docker client as well by running the command below. + + # curl -L https://get.docker.com/builds/linux/x86_64/docker-latest > /usr/local/bin/docker + # chmod +x /usr/local/bin/docker + +### 2. Creating VirualBox VM ### + +After we have successfully installed Docker Machine in our Linux running machine, we'll definitely wanna go for creating a Virtual Machine using VirtualBox. To get started, we need to run docker-machine create command followed by --driver flag with string as virtualbox as we are trying to deploy docker inside of Virtual Box running VM and the final argument is the name of the machine, here we have machine name as "linux". This command will download [boot2docker][2] iso which is a light-weighted linux distribution based on Tiny Core Linux with the Docker daemon installed and will create and start a VirtualBox VM with Docker running as mentioned above. + +To do so, we'll run the following command in a terminal or shell in our box. + + # docker-machine create --driver virtualbox linux + +![Creating Docker Machine](http://blog.linoxide.com/wp-content/uploads/2015/05/creating-docker-machine.png) + +Now, to check whether we have successfully create a Virtualbox running Docker or not, we'll run the command **docker-machine** ls as shown below. + + # docker-machine ls + +![Docker Machine List](http://blog.linoxide.com/wp-content/uploads/2015/05/docker-machine-list.png) + +If the host is active, we can see * under the ACTIVE column in the output as shown above. + +### 3. Setting Environment Variables ### + +Now, we'll need to make docker talk with the machine. We can do that by running docker-machine env and then the machine name, here we have named **linux** as above. + + # eval "$(docker-machine env linux)" + # docker ps + +This will set environment variables that the Docker client will read which specify the TLS settings. Note that we'll need to do this every time we reboot our machine or start a new tab. We can see what variables will be set by running the following command. + + # docker-machine env linux + + export DOCKER_TLS_VERIFY=1 + export DOCKER_CERT_PATH=/Users//.docker/machine/machines/dev + export DOCKER_HOST=tcp://192.168.99.100:2376 + +### 4. Running Docker Containers ### + +Finally, after configuring the environment variables and Virtual Machine, we are able to run docker containers in the host running inside the Virtual Machine. To give it a test, we'll run a busybox container out of it run running **docker run busybox** command with **echo hello world** so that we can get the output of the container. + + # docker run busybox echo hello world + +![Running Docker Container](http://blog.linoxide.com/wp-content/uploads/2015/05/running-docker-container.png) + +### 5. Getting Docker Host's IP ### + +We can get the IP Address of the running Docker Host's using the **docker-machine ip** command. We can see any exposed ports that are available on the Docker host’s IP address. + + # docker-machine ip + +![Docker IP Address](http://blog.linoxide.com/wp-content/uploads/2015/05/docker-ip-address.png) + +### 6. Managing the Hosts ### + +Now we can manage as many local VMs running Docker as we desire by running docker-machine create command again and again as mentioned in above steps + +If you are finished working with the running docker, we can simply run **docker-machine stop** command to stop the whole hosts which are Active and if wanna start again, we can run **docker-machine start**. + + # docker-machine stop + # docker-machine start + +You can also specify a host to stop or start using the host name as an argument. + + $ docker-machine stop linux + $ docker-machine start linux + +### Conclusion ### + +Finally, we have successfully created and managed a Docker host inside a VirtualBox using Docker Machine. Really, Docker Machine enables people fast and easy to create, deploy and manage Docker hosts in different platforms as here we are running Docker hosts using Virtualbox platform. This virtualbox driver API works for provisioning Docker on a local machine, on a virtual machine in the data center. Docker Machine ships with drivers for provisioning Docker locally with Virtualbox as well as remotely on Digital Ocean instances whereas more drivers are in the work for AWS, Azure, VMware, and other infrastructure. If you have any questions, suggestions, feedback please write them in the comment box below so that we can improve or update our contents. Thank you ! Enjoy :-) + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/linux-how-to/host-virtualbox-docker-machine/ + +作者:[Arun Pyasi][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://linoxide.com/author/arunp/ +[1]:https://github.com/docker/machine/releases +[2]:https://github.com/boot2docker/boot2docker \ No newline at end of file diff --git a/sources/tech/20150527 Linux FAQs with Answers--How to mount an LVM partition on Linux.md b/sources/tech/20150527 Linux FAQs with Answers--How to mount an LVM partition on Linux.md new file mode 100644 index 0000000000..42cfb4b2ae --- /dev/null +++ b/sources/tech/20150527 Linux FAQs with Answers--How to mount an LVM partition on Linux.md @@ -0,0 +1,89 @@ +Linux FAQs with Answers--How to mount an LVM partition on Linux +================================================================================ +> **Question**: I have an external USB drive which contains several LVM partitions on it. I want to access some of those LVM partitions on my Linux. How can I mount an LVM partition on Linux? + +LVM is a logical volume management tool which allows you to manage disk space using the notion of logical volumes and volume groups. The biggest benefit of using LVM over classic partitions is the flexibility in allocating storage for users and applications without being constrained by the size of individual physical disks. + +In LVM, the physical storage, on which logical volumes are created, is traditional partitions (e.g., /dev/sda2, /dev/sdb1). These partitions must be initialized as "physical volumes" and labeled so (e.g., "Linux LVM") in order for them to be used in LVM. Once the partitions are labeled as LVM volumes, you cannot mount them directly with mount command. + +If you attempt to mount an LVM partition (e.g., /dev/sdb2), you will get the following error. + + $ mount /dev/sdb2 /mnt + +---------- + + mount: unknown filesystem type 'LVM2_member' + +![](https://farm8.staticflickr.com/7696/17749902190_0a6d36821f_b.jpg) + +If you want to mount an LVM partition properly, you must instead mount "logical volumes" created inside the partition. Here is how to to it. + +First, examine a list of available volume groups by running: + + $ sudo pvs + +---------- + + PV VG Fmt Attr PSize PFree + /dev/sdb2 vg_ezsetupsystem40a8f02fadd0 lvm2 a-- 237.60g 0 + +![](https://farm8.staticflickr.com/7657/17938136831_d9320b7bfc_b.jpg) + +The names of available physical volumes and volume groups are listed under PV and VG columns, respectively. In this example, there is a single volume group named "vg_ezsetupsystem40a8f02fadd0" created on /dev/sdb2. + +Next, let's check what logical volumes exist inside this volume group. For that, use lvdisplay command: + + $ sudo lvdisplay + +Running lvdisplay shows information about available logical volumes (e.g., device name, volume name, volume size, etc) as shown below. + + $ sudo lvdisplay /dev/vg_ezsetupsystem40a8f02fadd0 + +---------- + + --- Logical volume --- + LV Path /dev/vg_ezsetupsystem40a8f02fadd0/lv_root + LV Name lv_root + VG Name vg_ezsetupsystem40a8f02fadd0 + LV UUID imygta-P2rv-2SMU-5ugQ-g99D-A0Cb-m31eet + LV Write Access read/write + LV Creation host, time livecd.centos, 2015-03-16 18:38:18 -0400 + LV Status available + # open 0 + LV Size 50.00 GiB + Current LE 12800 + Segments 1 + Allocation inherit + Read ahead sectors auto + - currently set to 256 + Block device 252:0 + +![](https://farm8.staticflickr.com/7707/17938137591_cdb4cbfb43_b.jpg) + +If you want to mount a particular logical volume, use its device name shown in "LV Path" (e.g., /dev/vg_ezsetupsystem40a8f02fadd0/lv_home) as follows. + + $ sudo mount /dev/vg_ezsetupsystem40a8f02fadd0/lv_home /mnt + +You can check the mount status by running mount command without any argument, which will show you a list of all mounted filesystems. + + $ mount + +![](https://farm6.staticflickr.com/5449/17749903670_2ee617445d_c.jpg) + +If you want to have a logical volume to be mounted automatically on boot, add the following line in /etc/fstab. You need to specify the file system type (e.g., EXT4) of the volume, which you can find out from the output of mount command above. + + /dev/vg_ezsetupsystem40a8f02fadd0/lv_home /mnt ext4 defaults 0 0 + +Now the logical volume will be automatically mounted at /mnt upon boot. + +-------------------------------------------------------------------------------- + +via: http://ask.xmodulo.com/mount-lvm-partition-linux.html + +作者:[Dan Nanni][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://ask.xmodulo.com/author/nanni \ No newline at end of file From 21b64d40fad77558fea5f19ce0ff9eee939f1478 Mon Sep 17 00:00:00 2001 From: DeadFire Date: Wed, 27 May 2015 14:34:57 +0800 Subject: [PATCH 184/965] =?UTF-8?q?20150527-4=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... Custom Linux Distribution From Scratch.md | 65 +++++ ...Useful Hacks Every Linux User Must Know.md | 79 ++++++ ... Check Laptop CPU Temperature In Ubuntu.md | 82 +++++++ ...hopping Store Using 'OpenCart' in Linux.md | 225 ++++++++++++++++++ ...sive Applications Using 'xkill' Command.md | 92 +++++++ 5 files changed, 543 insertions(+) create mode 100644 sources/share/20150527 How to Develop Own Custom Linux Distribution From Scratch.md create mode 100644 sources/tech/20150527 3 Useful Hacks Every Linux User Must Know.md create mode 100644 sources/tech/20150527 How To Check Laptop CPU Temperature In Ubuntu.md create mode 100644 sources/tech/20150527 How to Create Own Online Shopping Store Using 'OpenCart' in Linux.md create mode 100644 sources/tech/20150527 How to Kill Linux Processes or Unresponsive Applications Using 'xkill' Command.md diff --git a/sources/share/20150527 How to Develop Own Custom Linux Distribution From Scratch.md b/sources/share/20150527 How to Develop Own Custom Linux Distribution From Scratch.md new file mode 100644 index 0000000000..9bf07333ea --- /dev/null +++ b/sources/share/20150527 How to Develop Own Custom Linux Distribution From Scratch.md @@ -0,0 +1,65 @@ +How to Develop Own Custom Linux Distribution From Scratch +================================================================================ +Have you ever thought of making your own Linux Distribution? Every Linux user in their journey to Linux thought of making their own Linux distribution, at-least once. Even I was not an exception as a newbie to Linux land and have given my considerable time developing my own Linux Distribution. Developing a Linux Distribution from scratch is called Linux From Scratch (LFS) + +Before starting, I concluded a few things about LFS which can be described as: + +### 1. Those who want to develop their own Linux Distribution should understand the difference between Developing a Linux distribution from scratch (by scratch means starting from the beginning) or all you want is just to tweak an already available Linux Distro. ### + +If you just want to tweak flash screen, customize login and preferably work on the look and feel of Linux OS, you can choose any fair Linux Distribution and customize it the way you want. Moreover a lots of tweaking tools there will help. + +If you want to put all the necessary files and boot-loaders and kernel and choose what to include and what not to include and then compile everything yourselves you need to develop Linux From Scratch (LFS). + +**Note**: If you just want to customize the look and feel of a Linux OS, this guide is not for you. If you really want to develop a Linux distribution from scratch and want to know where to start and other basic information, here is the guide for you. + +### 2. Pros of Developing own Linux Distribution (LFS): ### + +- You get to know the internal working of Linux OS. +- You develop a very flexible OS as per your need. +- Your developed OS (LFS) will be very compact as you have full control over what to include/exclude. +- You Development (LFS) will have added security. + +### 3. Cons of Developing own Linux Distribution (LFS): ### + +Developing a Linux OS from scratch means putting all the necessary things together and compile. This requires a lot of reading, patience and time. Also you should have a working Linux System to develop LFS and fairly enough disk space. + +### 4. Interesting to know, that Gentoo/GNU Linux is closest to LFS to certain extent. Both Gentoo and LFS is the customized Linux System built entirely out from compilation of Source. ### + +### 5. You should be experienced Linux user having good knowledge of package compilation, resolving dependencies, and pro in shell scripting language. Knowledge of a programming language (Preferably C) will ease things for you. Even if you are a newbie but a good learner and grasp the things quickly, you may start as well. The most important part is you should not loose your enthusiasm throughout the process of LFS development. ### + +If you are not determined enough, I fear you may leave building your LFS in the middle. + +### 6. Now you need a step-by-step guide, So that Linux can be developed from scratch. LFS is the official guide to develop Linux From Scratch. Our partner site tradepub has made available LFS guide to our readers and that too for free. ### + +You can download the Linux From Scratch book from the below link: + +[![](http://www.tecmint.com/wp-content/uploads/2015/05/Linux-From-Scratch.gif)][1] + +Download: [Linux From Scratch][1] + +### About: Linux From Scratch ### + +This book is created by Gerard Beekmans, who is the Project Leader of LFS and Edited by Matthew Burgess and Bruse Dubbs, both of whom are Co-leader of the Project. This book is extensive and expands over 338 pages. + +Having covered – Introduction to LFS, Preparing for the build, Build LFS from Scratch, Setting up of Boot scripts, Making LFS Bootable followed by Appendices, it has all you want to know on LFS Project. + +Also this book gives you the estimated time required for the compilation of a package. The estimated time are calculated based upon the reference of the compilation time of the first package. All the details are presented in a manner easy to understand and implement, even for newbies. + +If you have plenty of time and really interested in developing your own Linux Distribution you would never want to miss a chance to download this ebook and that too for free. All you need is, to start developing your own Linux OS using this ebook along with a working Linux OS (Any Linux Distribution with enough Disk Space), Time and Enthusiasm. + +If Linux fascinates you, if you want to understand Linux from scratch and want to develop your own Linux Distribution, then this is all you should know at this stage, for most of other things you may like to refer to the book, in the above link. + +Also let me know your experience with the book. How ease it was to get along the elaborated LFS guide? Also if you have already Developed a LFS and want to give some tips to our readers, your feedbacks are welcome. + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/create-custom-linux-distribution-from-scratch/ + +作者:[Avishek Kumar][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/avishek/ +[1]:http://tecmint.tradepub.com/free/w_linu01/prgm.cgi \ No newline at end of file diff --git a/sources/tech/20150527 3 Useful Hacks Every Linux User Must Know.md b/sources/tech/20150527 3 Useful Hacks Every Linux User Must Know.md new file mode 100644 index 0000000000..39546df146 --- /dev/null +++ b/sources/tech/20150527 3 Useful Hacks Every Linux User Must Know.md @@ -0,0 +1,79 @@ +3 Useful Hacks Every Linux User Must Know +================================================================================ +The world of Linux is filled with so much fun and interesting stuffs, the more we go in, the more we find stuffs. In our efforts to bring those little hacks and tips for you that makes you different from others, here we have came up with three little tricks. + +### 1. How to Schedule a Linux Job Without Cron ### + +Scheduling a job/command in Linux is acronym to cron. Whenever we need to schedule a job, we call cron, but do you know we can schedule a job at a later time without corn? You can do it as suggested below.. + +Run a command (say date) every 5 sec and write the output to a file (say date.txt). To achieve this scenario, we need to run the below one liner script directly on the command prompt. + + $ while true; do date >> date.txt ; sleep 5 ; done & + +Anatomy of the above one liner script: + +- while true – Ask script to run while the condition is true, it acts as a loop which makes the command to run again-and-again or say in a loop. +- do – do perform what follows, ie., execute command or set of commands that lies ahead of do statement. +- date >> date.txt – here the output of date command is being written to a file date.txt. Also note that we have used >> and not >. +- >> ensures that the file (date.txt) is not overwritten every time the script execute. It just append the changes. Whereas > overwrite the file again and again. +- sleep 5 – It ask the shell to keep a time difference of 5 seconds before it executed again. Note the time here is always measured in seconds. Say if you want to execute the command every 6 minutes, you should use (6*60) 360, in succession of sleep. +- done – marks the end of while loop. +- & – Put the whole process in loop to background. + +Similarly, we can execute any script in the same manner. Here is the command to call a script after certain interval (say 100 sec) and the name of script is `script_name.sh`. + +Also worth mentioning that the script above should be run in the directory where the script to be called lies, else you need to provide full path (`/home/$USER/…/script_name.sh`). The syntax for calling script at above described interval is: + + $ while true; do /bin/sh script_name.sh ; sleep 100 ; done & + +**Conclusion**: The above one liner is not a replacement of Cron, because Cron utility supports a whole lots of options, as compared and is very flexible as well as customizable. However if we want to run certain test cases or I/O benchmark, then the above singe command will serve the purpose. + +Read Also: [11 Linux Cron Job Scheduling Examples][1] + +### 2. How to Clear Terminal without Using ‘clear’ Command ### + +What we do to clear the screen? Well you may think how silly it is to ask such question. Well, we all know it’s ‘clear‘ command. However if we make a habit of using key combination ‘ctrl+l‘ to clear terminal, we will save a lot of time of ours. + +Key combination ‘Ctrl+l‘ has the same effect as ‘clear‘ command. So from next time use ctrl+l to clear your Linux Command Line Interface. + +**Conclusion**: Since ctrl+l is a key combination, so we can not use it inside a script. If we need to clear screen inside a shell script, call command ‘clear’, for all other cases I could think of now, ctrl+l is more than sufficient. + +### 3. Run a command and come back to the current working directory automatically. ### + +Well this is an amazing hack not many people know. You may run a command no matter what it return back to the current directory. All you need to do is to run the command in parentheses i.e., in between `( and )`. + +Let see the example, + + avi@deb:~$ (cd /home/avi/Downloads/) + +#### Sample Output #### + + avi@deb:~ + +First it cd to directory Downloads and then again return back to home directory in one go. May be you believe that the command didn’t executed and for some reason one or another it is not throwing error, since there is no change in prompt. Lets do a little more tweak.. + + avi@deb:~$ (cd /home/avi/Downloads/ && ls -l) + +#### Sample Output #### + + -rw-r----- 1 avi avi 54272 May 3 18:37 text1.txt + -rw-r----- 1 avi avi 54272 May 3 18:37 text2.txt + -rw-r----- 1 avi avi 54272 May 3 18:37 text3.txt + avi@deb:~$ + +So in the above command it first changed the current directory to Downloads and then list the content of that directory before returning back to current directory. Also, it proves that command executed successfully. You may run any sort of command in the parentheses and return back to your current working directory without a hitch. + +That’s all for now, if you know any such Linux hacks or tricks you may share with us via our comment section and don’t forget to share this article with your friends…. + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/useful-linux-hacks-commands/ + +作者:[Avishek Kumar][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/avishek/ +[1]:http://www.tecmint.com/11-cron-scheduling-task-examples-in-linux/ \ No newline at end of file diff --git a/sources/tech/20150527 How To Check Laptop CPU Temperature In Ubuntu.md b/sources/tech/20150527 How To Check Laptop CPU Temperature In Ubuntu.md new file mode 100644 index 0000000000..4dc3291ac9 --- /dev/null +++ b/sources/tech/20150527 How To Check Laptop CPU Temperature In Ubuntu.md @@ -0,0 +1,82 @@ +How To Check Laptop CPU Temperature In Ubuntu +================================================================================ +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/05/Monitor_temperature_Ubuntu.png) + +Overheating of laptops is a common issue one faces these days. Monitoring hardware temperature may help you to diagnose why laptop is getting overheated. In this article, we’ll see **how to check CPU temperature in Ubuntu**. + +We are going to use a GUI tool [Psensor][1] that allows you to monitor hardware temperature in Linux. With Psensor you can: + +- monitor the temperature of the motherboard and CPU sensors +- monitor the temperature of the NVidia GPUs +- monitor the temperature of the Hard Disk Drives +- monitor the rotation speed of the fans +- monitor the CPU usage + +Latest version of Psensor also provides applet indicator for Ubuntu and thus it makes the monitoring of hardware temperature even easier in Ubuntu. You can choose to display the temperature right in the top panel itself. It even sends a desktop notification when the temperature exceeds the limit. + +### How to install Psensor in Ubuntu 15.04 and 14.04 ### + +Before you install Psensor, you need to install and configure [lm-sensors][2], a command line utility for hardware monitoring. If you want to measure hard disk temperature, you need to install [hddtemp][3] as well. To install these tools, run the following command in a terminal: + + sudo apt-get install lm-sensors hddtemp + +Then start the detection of your hardware sensors: + + sudo sensors-detect + +To make sure that it works, run the command below: + + sensors + +It will give you an output like: + + acpitz-virtual-0 + Adapter: Virtual device + temp1: +43.0°C (crit = +98.0°C) + + coretemp-isa-0000 + Adapter: ISA adapter + Physical id 0: +44.0°C (high = +100.0°C, crit = +100.0°C) + Core 0: +41.0°C (high = +100.0°C, crit = +100.0°C) + Core 1: +40.0°C (high = +100.0°C, crit = +100.0°C) + +If everything seems alright, proceed with the installation of Psensor by using the command below: + + sudo apt-get install psensor + +Once installed, run the application by looking for it in Unity Dash. At first run, you should configure on what stats do you want to collect in Psensor. + +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/05/Psensor_Ubuntu.jpeg) + +### Display temperature in the panel ### + +If you want to show the temperature in the top panel, go to **Sensor Preferences**: + +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/05/Psensor_Ubuntu_1.jpeg) + +Then under the **Application Indicator** menu, select the component for which you want to display the temperature and then check the **Display sensor in the label** option. + +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/05/Psensor_Ubuntu_2.jpeg) + +### Start Psensor at each start up ### + +Go to **Preferences->Startup** and the check **Launch on session startup** to start Psensor at each boot. + +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/05/Psensor_Ubuntu_3.jpeg) + +That’s it. All you need to monitor the CPU temperature is here. You can keep an eye on it and it may help you find out which process is overheating your computer. + +-------------------------------------------------------------------------------- + +via: http://itsfoss.com/check-laptop-cpu-temperature-ubuntu/ + +作者:[Abhishek][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://itsfoss.com/author/abhishek/ +[1]:http://wpitchoune.net/blog/psensor/ +[2]:http://www.lm-sensors.org/ +[3]:https://wiki.archlinux.org/index.php/Hddtemp \ No newline at end of file diff --git a/sources/tech/20150527 How to Create Own Online Shopping Store Using 'OpenCart' in Linux.md b/sources/tech/20150527 How to Create Own Online Shopping Store Using 'OpenCart' in Linux.md new file mode 100644 index 0000000000..ad673a03e0 --- /dev/null +++ b/sources/tech/20150527 How to Create Own Online Shopping Store Using 'OpenCart' in Linux.md @@ -0,0 +1,225 @@ +How to Create Own Online Shopping Store Using “OpenCart” in Linux +================================================================================ +In the Internet world we are doing everything using a computer. Electronic Commerce aka e-commerce is one one of them. E-Commerce is nothing new and it started in the early days of ARPANET, where ARPANET used to arrange sale between students of Massachusetts Institute of Technology and Stanford Artificial Intelligence Laboratory. + +These days there are some 100’s of E-Commerce site viz., Flipcart, eBay, Alibaba, Zappos, IndiaMART, Amazon, etc. Have you thought of making your own Amazon and Flipcart like web-based Application Server? If yes! This article is for you. + +Opencart is a free and open source E-Commerce Application written in PHP, which can be used to develop a shopping cart system similar to Amazon and Flipcart. If you want to sell your products online or want to serve your customers even when you are closed Opencart is for you. You can build a successful online store (for online merchants) using reliable and professional Opencart Application. + +### OpenCart Web Panel Demo ### + +- Store Front – [http://demo.opencart.com/][1] +- Admin Login – [http://demo.opencart.com/admin/][2] + + ------------------ Admin Login ------------------ + Username: demo + Password: demo + +#### Features of Opencart #### + +Opencart is an application that meets all the requirements of an online merchant. It has all the features (see below) using which you can make your own E-Commerce Website. + +- It is a Free (as in beer) and Open Source (as in speech) Application released under GNU GPL License. +- Everything is well documented, means you don’t need to Google and shout for help. +- Free Life time support and updates. +- Unlimited number of categories, Products and manufacturer supported. +- Everything is Template based. +- Multi-Language and Multi-Currency Supported. It ensures your product gets a global reach. +- Built-in Product Review and Rating Features. +- Downloadable Products (viz., ebook) supported. +- Automatic Image Resizing supported. +- Features like Multi tax Rates (as in various country), Viewing Related Products, Information Page, Shipping Weight Calculation, Availing Discount Coupons, etc are well implemented by default. +- Built-in Backup and Restore tools. +- Well implemented SEO. +- Invoice Printing, Error Log and sales report are supported as well. + +#### System Requirements #### + +- Web Server (Apache HTTP Server Preferred) +- PHP (5.2 and above). +- Database (MySQLi Preferred but I am using MariaDB). + +#### Required PHP Libraries and Modules #### + +These extensions must be installed and enabled on your system to install Opencart properly on the web server. + +- Curl +- Zip +- Zlib +- GD Library +- Mcrypt +- Mbstrings + +### Step 1: Installing Apache, PHP and MariaDB ### + +1. As I said, OpenCart requires certain technical requirements such as Apache, PHP with extensions and Database (MySQL or MariaDB) to be installed on the system, in order to run Opencart properly. + +Let’s install Apache, PHP and MariaDB using following Command. + +**Install Apache** + + # apt-get install apache2 (On Debian based Systems) + # yum install httpd (On RedHat based Systems) + +**Install PHP and Extensions** + + # apt-get install php5 libapache2-mod-php5 php5-curl php5-mcrypt (On Debian based Systems) + # yum install php php-mysql php5-curl php5-mcrypt (On RedHat based Systems) + +**Install MariaDB** + + # apt-get install mariadb-server mariadb-client (On Debian based Systems) + # yum install mariadb-server mariadb (On RedHat based Systems) + +2. After installing all the above required things, you can start the Apache and MariaDB services using following commands. + + ------------------- On Debian based Systems ------------------- + # systemctl restart apache2.service + # systemctl restart mariadb.service + +---------- + + ------------------- On RedHat based Systems ------------------- + # systemctl restart httpd.service + # systemctl restart mariadb.service + +### Step 2: Downloading and Setting OpenCart ### + +3. The most recent version of OpenCart (2.0.2.0) can be obtained from [OpenCart website][3] or directly from github. + +Alternatively, you may use following wget command to download the latest version of OpenCart directly from github repository as shown below. + + # wget https://github.com/opencart/opencart/archive/master.zip + +4. After downloading zip file, copy to Apache Working directory (i.e. /var/www/html) and unzip the master.zip file. + + # cp master.zip /var/www/html/ + # cd /var/www/html + # unzip master.zip + +5. After extracting ‘master.zip‘ file, cd to extracted directory and move the content of upload directory to the root of the application folder (opencart-master). + + # cd opencart-master + # mv -v upload/* ../opencart-master/ + +6. Now you need to rename or copy OpenCart configuration files as shown below. + + # cp /var/www/html/opencart-master/admin/config-dist.php /var/www/html/opencart-master/admin/config.php + # cp /var/www/html/opencart-master/config-dist.php /var/www/html/opencart-master/config.php + +7. Next, set correct Permissions to the files and folders of /var/www/html/opencart-master. You need to provide RWX permission to all the files and folders there, recursively. + + # chmod 777 -R /var/www/html/opencart-master + +**Important**: Setting permission 777 may be dangerous, so as soon as you finish setting up everything, revert back to permission 755 recursively on the above folder. + +### Step 3: Creating OpenCart Database ### + +8. Next step is to create a database (say opencartdb) for the E-Commerce site to store data on the database. Connect to databaser server and create a database, user and grant correct privileges on the user to have full control over the database. + + # mysql -u root -p + CREATE DATABASE opencartdb; + CREATE USER 'opencartuser'@'localhost' IDENTIFIED BY 'mypassword'; + GRANT ALL PRIVILEDGES ON opencartdb.* TO 'opencartuser'@'localhost' IDENTIFIED by 'mypassword'; + +### Step 4: OpenCart Web Installation ### + +9. Once everything set correctly, navigate to the web browser and type `http://` to access the OpenCart web installation. + +Click ‘CONTINUE‘ to Agree the License Agreement. + +![Accept OpenCart License](http://www.tecmint.com/wp-content/uploads/2015/05/OpenCart-License.png) + +Accept OpenCart License + +10. The next screen is Pre-installation Server Setup Check, to see that the server has all the required modules are installed properly and have correct permission on the OpenCart files. + +If any red marks are highlighted on #1 or #2, that means you need to install those components properly on the server to meet web server requirements. + +If there are any red marks on #3 or #4, that means there is issue with your files. If everything is correctly configured you should see all green marks are visible (as seen below), you may press “Continue“. + +![Server Requirement Check](http://www.tecmint.com/wp-content/uploads/2015/05/Server-Checkup.png) + +Server Requirement Check + +11. On the next screen enter your Database Credentials like Database Driver, Hostname, User-name, Password, database. You should not touch db_port and Prefix, until and unless you know what you are doing. + +Also Enter User_name, Password and Email Address for Administrative account. Note these credentials will be used for logging in to Opencart Admin Panel as root, so keep it safe. Click continue when done! + +![OpenCart Database Details](http://www.tecmint.com/wp-content/uploads/2015/05/OpenCart-Database.png) + +OpenCart Database Details + +12. The next screen shows message like “Installation Complete” with the Tag Line Ready to Start Selling. Also it warns to delete the installation directory, as everything required to setup using this directory has been accomplished. + +![OpenCart Installation Completes](http://www.tecmint.com/wp-content/uploads/2015/05/OpenCart-Installation-Completes.png) + +OpenCart Installation Completes + +To Remove install directory, you may like to run the below command. + + # rm -rf /var/www/html/opencart-master/install + +### Step 4: Access OpenCart Web and Admin ### + +13. Now point your browser to `http:///opencart-master/` and you would see something like the below screenshot. + +![OpenCart Product Showcase](http://www.tecmint.com/wp-content/uploads/2015/05/OpenCart.jpg) + +OpenCart Product Showcase + +14. In order to login to Opencart Admin Panel, point your browser to http:///opencart-master/admin and fill the Admin Credentials you input, while setting it up. + +![OpenCart Admin Login](http://www.tecmint.com/wp-content/uploads/2015/05/OpenCart-Admin-Login.png) + +OpenCart Admin Login + +15. If everything ok! You should be able to see the Admin Dashboard of Opencart. + +![OpenCart Dashboard](http://www.tecmint.com/wp-content/uploads/2015/05/OpenCart-Dashboard.png) + +OpenCart Dashboard + +Here in Admin Dashboard you may set up a lots of options like categories, product, options, Manufacturers, Downloads, Review, Information, Extension Installer, Shipping, Payment options, order totals, gift voucher, Paypal, Coupons, Affiliates, marketing, mails, Design and Settings, Error logs, in-built analytics and what not. + +#### What after testing the tools? #### + +If you have already tested the Application and finds it customizable, flexible, Rock Solid, Easy to maintain and use, you may need a good hosting provider to host OpenCart application, that remains live 24X7 support. Though there are a lot of options for hosting providers we recommend Hostgator. + +Hostgator is a Domain Registrant and Hosting Provider that is very well known for the service and feature it provides. It Provides you with UNLIMITED Disk Space, UNLIMITED Bandwidth, Easy to install (1-click install script), 99.9% Uptime, Award winning 24x7x365 Technical Support and 45 days money back guarantee, which means if you didn’t like the product and service you get your money back within 45 days of purchasing and mind it 45 days is a long time to Test. + +So if you have something to sell you can do it for free (by free I mean, Think of the cost you would spend on getting a physical store and then compare it with virtual store setting-up cost. You will feel its free). + +**Note**: When you buy hosting (and/or Domain) from Hostgator you will get a **Flat 25% OFF**. This offer is valid only for the readers of Tecmint Site. + +All you have to do is to Enter Promocode “**TecMint025**” during the payment of hosting. For reference see the preview of payment screen with promo code. + +![Hostgator 25% Discount - TecMint025](http://www.tecmint.com/wp-content/uploads/2015/05/Hostgator-Discount-Code.png) + +[Sign up for Hostgator][4] (Coupon code: TecMint025) + +**Note**: Also worth mentioning, that for each hosting you buy from Hostgator to host OpenCart, we will get a small amount of commission, just to keep Tecmint Live (by Paying Bandwidth and hosting charges of server). + +So If you buy it using the above code, you get discount and we will get a small amount. Also note that you won’t pay anything extra, infact you will be paying 25% less on total bill. + +### Conclusion ### + +OpenCart is an application that performs out-of-the box. It is easy to install and you have the option to choose best suited templates, add your products and you become an online merchant. + +A lots of community made extensions(free and paid) makes it rich. It is a wonderful application for those who want to setup a virtual store and remain accessible to their customer 24X7. Let me know yours experience with the application. Any suggestion and feedback is welcome as well. + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/create-e-commerce-online-shopping-store-using-opencart-in-linux/ + +作者:[Avishek Kumar][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/avishek/ +[1]:http://demo.opencart.com/ +[2]:http://demo.opencart.com/admin/ +[3]:http://www.opencart.com/index.php?route=download/download/ +[4]:http://secure.hostgator.com/%7Eaffiliat/cgi-bin/affiliates/clickthru.cgi?id=tecmint \ No newline at end of file diff --git a/sources/tech/20150527 How to Kill Linux Processes or Unresponsive Applications Using 'xkill' Command.md b/sources/tech/20150527 How to Kill Linux Processes or Unresponsive Applications Using 'xkill' Command.md new file mode 100644 index 0000000000..ebbfe264bc --- /dev/null +++ b/sources/tech/20150527 How to Kill Linux Processes or Unresponsive Applications Using 'xkill' Command.md @@ -0,0 +1,92 @@ +How to Kill Linux Processes/Unresponsive Applications Using ‘xkill’ Command +================================================================================ +How do we kill a resource/process in Linux? Obviously we find the PID of the resource and then pass the PID to the kill command. + +Speaking more accurately, we can find PID of a resource (say terminal) as: + + $ ps -A | grep -i terminal + + 6228 ? 00:00:00 gnome-terminal + +In the above output, the number ‘6228‘ is the PID of process (gnome-terminal), use the kill command to kill the process as shown below. + + $ kill 6228 + +The kill command sends a signal to a process, whose PID is passed along with the command. + +Alternatively, we can use pkill command, which kills a process based upon name and other attributes of a process. To kill a process say whose name is terminal, we need to execute: + + $ pkill terminal + +**Note**: The process name length in pkill is limited to 15 characters. + +pkill seems more handy as you can kill a process without have to find out its PID. But if you want to have a better control on your system nothing beats ‘kill‘ command. Using kill you will have better insight of what process you are killing. + +We have already covered a detailed guide on [kill, pkill and killall commands][1]. + +For those who are running X server there is another tool called xkill which can kill a process from its X window without passing process name or its PID. + +xkill utility forces X server to close communications to its client which results into killing of client by its X resource. xkill which is a part of X11 utilities is very handy in killing unnecessary windows. + +It support options like connect to specific X Server (-display displayname) using display number when multiple X Servers are running on a host simultaneously and kill all the client (-all, not recommended) with top-level windows on the screen as well as take frame (-frame) into account. + +To get a list of all the clients you may run: + + $ xlsclients + +#### Sample Output #### + + ' ' /usr/lib/libreoffice/program/soffice + deb gnome-shell + deb Docky + deb google-chrome-stable + deb soffice + deb gnome-settings-daemon + deb gnome-terminal-server + +If no resource identifier is passed with id, xkill turns the mouse Pointer into special Symbol, similar to ‘X‘. Just click on the window you want to kill and this will kill its communication with server or say the program gets killed. + + $ xkill + +![Xkill Command](http://www.tecmint.com/wp-content/uploads/2015/05/Xkill.png) + +Kill Process Using xkill + +It is important to notice that xkill do not guarantee that closing its communication will kill/abort it successfully. Most of the application will get killed when it’s communication to server is closed. However a few may still be running. + +Points Needed to be mentioned here: + +- This tool works only when X11 server is running, as xkill is a part of X11 utility. +- Don’t confuse with Closing and killing a resource. While killing a resource you may expect it not to exit cleanly. +- This is not a replacement of kill utility. + +**Do I need to go to Linux command line to invoke xkill?** + +No, you don’t need to fire xkill from Linux Command Line. You may set a keyboard shortcut and call xkill just by punching same key combination. + +Here is how to setup a keyboard shortcut on a typical gnome3 Desktop Environment. + +Go to Settings –> Select Keyboard, click on ‘+’ and add name and command. Click on the new entry and press the key you want to use as shortcut key combination. I did Ctrl+Alt+Shift+x. + +![Gnome Settings](http://www.tecmint.com/wp-content/uploads/2015/05/22.png) + +Gnome Settings + +![Add Shortcut Key](http://www.tecmint.com/wp-content/uploads/2015/05/31.png) + +Add Shortcut Key + +The next time you want to kill a X resource just call the key combination (Ctrl+Alt+Shift+x), and you will notice your mouse pointer changed into x. Click on x resource you want to kill and all done! + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/kill-processes-unresponsive-programs-in-ubuntu/ + +作者:[Avishek Kumar][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/avishek/ +[1]:http://www.tecmint.com/how-to-kill-a-process-in-linux/ \ No newline at end of file From d8c51eaebb48f34ac1fe7fdf18a51df1b6a58980 Mon Sep 17 00:00:00 2001 From: wxy Date: Wed, 27 May 2015 15:02:55 +0800 Subject: [PATCH 185/965] PUB:20150205 zBackup--A versatile deduplicating backup tool @goreliu --- ...--A versatile deduplicating backup tool.md | 25 ++++++++----------- 1 file changed, 11 insertions(+), 14 deletions(-) rename {translated/tech => published}/20150205 zBackup--A versatile deduplicating backup tool.md (59%) diff --git a/translated/tech/20150205 zBackup--A versatile deduplicating backup tool.md b/published/20150205 zBackup--A versatile deduplicating backup tool.md similarity index 59% rename from translated/tech/20150205 zBackup--A versatile deduplicating backup tool.md rename to published/20150205 zBackup--A versatile deduplicating backup tool.md index 988db2d324..c0d9e85128 100644 --- a/translated/tech/20150205 zBackup--A versatile deduplicating backup tool.md +++ b/published/20150205 zBackup--A versatile deduplicating backup tool.md @@ -1,6 +1,6 @@ -zBackup——一个通用的重复数据备份工具 +zBackup:一个多功能的去重备份工具 ================================================================================ -zbackup是一个基于rsync思想的全局重复数据备份工具。给它传入一个大的tar文件后,它会存储该文件的重复区域(仅进行一次),然后对结果进行压缩,并根据参数确定是否对其加密。传入另一个tar文件后,它会从之前的已备份文件中复用重复的数据。只有新的改动会被保存,并且只要文件变动不是很大,需要的存储空间非常少。任何时候之前的已备份文件都可以被完整地读出来。 +zbackup是一个基于rsync思想的全局去重数据备份工具。给它传入一个大的tar文件后,它会仅存储一次该文件的重复部分,然后对结果进行压缩,并根据参数确定是否对其加密。传入另一个tar文件后,它会从之前的已备份文件中复用重复数据。只有新的改动会被保存,并且只要文件差异不是很大,需要的存储空间非常少。无论何时,之前的已备份文件都可以被完整地读出来。 ### zBackup特性 ### @@ -8,7 +8,7 @@ zbackup是一个基于rsync思想的全局重复数据备份工具。给它传 - 使用内置的AES加密算法加密已备份数据 - 可以删除旧的已备份数据 - 使用一个64位滚动哈希,保持软碰撞数量为0 -- 已备份数据由不可更改的文件组成。任何现有文件都没有被更改过 +- 备份库由不可更改的文件组成,只有库中不存在的文件才能修改 - 使用C++语言编写,并且只有适量的依赖库 - 可以在生产环境安全使用 - 可以在不同备份库中交换数据而无需重新压缩 @@ -25,7 +25,7 @@ zbackup是一个基于rsync思想的全局重复数据备份工具。给它传 zbackup init [--non-encrypted] [--password-file ~/.my_backup_password ] /my/backup/repo -`zbackup backup`命令备份一个由`tar c`创建的tar文件到刚才使用`zbackup init`初始化的备份库。(译注:实际使用时类似这样,tar c files | zbackup ...) +`zbackup backup`命令备份一个由`tar c`命令创建的tar文件到刚才使用`zbackup init`初始化的备份库。(LCTT 译注:实际使用时类似这样,tar c files | zbackup ...) zbackup [--password-file ~/.my_backup_password ] [--threads number_of_threads ] backup /my/backup/repo/backups/backup-`date ‘+%Y-%m-%d'` @@ -37,18 +37,15 @@ zbackup是一个基于rsync思想的全局重复数据备份工具。给它传 - -non-encrypted -- 不加密备份库。 - --password-file ~/.my_backup_password -- 使用位于~/.my_backup_password的口令文件来加密备份库和待备份文件,以及解密已备份文件。 -- --threads number_of_threads -- 限制并行LZMA压缩的线程数到number_of_threads。建议在32位的系统平台使用。 +- --threads number_of_threads -- 限制并行LZMA压缩的线程数为 number_of_threads。建议在32位的系统平台使用。 - --cache-size cache_size_in_mb -- 使用cache_size_in_mb中的缓存大小来加速恢复文件的过程。 -### zBackup相关文件 ### +### 上述命令中 zBackup 相关文件 ### -~/.my_backup_password 用来加密备份库和待备份文件,以及解密已备份文件。更多细节见zbackup。 - -/my/backup/repo 存放备份库的目录。 - -/my/precious/restored-tar 用来恢复已备份文件的tar文件。 - -/my/backup/repo/backups/backup-`date ‘+%Y-%m-%d'` 指定的之前已备份文件的文件名。 +- ~/.my_backup_password 用来加密备份库和待备份文件,以及解密已备份文件。更多细节见zbackup。 +- /my/backup/repo 存放备份库的目录。 +- /my/precious/restored-tar 用来恢复已备份文件的tar文件。 +- /my/backup/repo/backups/backup-`date ‘+%Y-%m-%d'` 指定的之前已备份文件的文件名。 -------------------------------------------------------------------------------- @@ -56,7 +53,7 @@ via: http://www.ubuntugeek.com/zbackup-a-versatile-deduplicating-backup-tool.htm 作者:[ruchi][a] 译者:[goreliu](https://github.com/goreliu) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 From a16010428a864e7b92cd73e133b4b691eda47f6d Mon Sep 17 00:00:00 2001 From: wxy Date: Wed, 27 May 2015 16:18:17 +0800 Subject: [PATCH 186/965] PUB:20150407 How to secure BGP sessions using authentication on Quagga @GOLinux --- ...sessions using authentication on Quagga.md | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) rename {translated/tech => published}/20150407 How to secure BGP sessions using authentication on Quagga.md (68%) diff --git a/translated/tech/20150407 How to secure BGP sessions using authentication on Quagga.md b/published/20150407 How to secure BGP sessions using authentication on Quagga.md similarity index 68% rename from translated/tech/20150407 How to secure BGP sessions using authentication on Quagga.md rename to published/20150407 How to secure BGP sessions using authentication on Quagga.md index be67b88ab1..9881d73c40 100644 --- a/translated/tech/20150407 How to secure BGP sessions using authentication on Quagga.md +++ b/published/20150407 How to secure BGP sessions using authentication on Quagga.md @@ -2,7 +2,7 @@ Quagga上使用验证加固BGP会话安全 ================================================================================ BGP协议运行于TCP之上,因而,它也继承了TCP连接的所有漏洞。例如,在一个BGP会话内,攻击者可以冒充一个合法的BGP邻居,然后说服另一端的BGP路由器共享路由信息给攻击者。在攻击者通告并向邻居路由注入伪造的路由时,就会发生这个问题。毫无戒备的邻居路由器就会开始向攻击者发送通信实况,实际上这些信息并没有去向任何地方,仅仅只是被丢弃了。回到2008年,YouTube实际上也[受害于][1]这样的BGP路由中毒,并遭受了长达一个小时的视频服务大量中断。一个更加糟糕的情况是,如果攻击者是个足够懂行的人,他们可以伪装成一台透明路由器,然后嗅探经过的通信以获取敏感数据。你可以想象,这会造成深远的影响。 -要保护活跃的BGP会话不受攻击,许多服务提供商在BGP会话中使用[MD5校验和并预共享密钥][2]。在受保护的BGP会话中,一台发送包的BGP路由器通过使用预共享的密钥生成MD5散列值、部分IP和TCP头以及有效负载。然后,MD5散列作为一个TCP选项字段存储。在收到包后,接受路由器用同样的方法使用预共享密钥生成它的MD5版本。它会将它的MD5散列和接收到的某个包的值进行对比,以决定是否接受该包。对于一个攻击者而言,几乎不可能猜测校验和或其密钥。对于BGP路由器而言,它们能在消耗包的内容前确保每个包的合法性。 +要保护活跃的BGP会话不受攻击,许多服务提供商在BGP会话中使用[MD5校验和及预共享密钥][2]。在受保护的BGP会话中,一台发送包的BGP路由器通过使用预共享的密钥生成MD5散列值、部分IP和TCP头以及有效载荷。然后,MD5散列作为一个TCP选项字段存储。在收到包后,接受路由器用同样的方法使用预共享密钥生成它的MD5版本。它会将它的MD5散列和接收到的某个包的值进行对比,以决定是否接受该包。对于一个攻击者而言,几乎不可能猜测到校验和或其密钥。对于BGP路由器而言,它们能在使用包的内容前确保每个包的合法性。 在本教程中,我们将为大家演示如何使用MD5校验和以及预共享密钥来加固两个邻居间的BGP会话的安全。 @@ -13,7 +13,7 @@ BGP协议运行于TCP之上,因而,它也继承了TCP连接的所有漏洞 - + @@ -28,7 +28,7 @@ BGP协议运行于TCP之上,因而,它也继承了TCP连接的所有漏洞
路由器名称ASAS 号 IP地址
-常用的Linux内核原生支持TCP的MD5选项用于IPv4和IPv6。因此,如果你从全新的[Linux盒子][3]构建了Quagga路由器,TCP的MD5功能会自动启用。剩下来的事情,仅仅是配置Quagga以使用它的功能。但是,如果你使用的是FreeBSD盒子或者为Quagga构建了一个自定义内核,请确保内核开启了TCP的MD5支持(如,Linux中的CONFIG_TCP_MD5SIG选项)。 +常用的Linux内核原生支持IPv4和IPv6的TCP MD5选项。因此,如果你从全新的[Linux机器][3]构建了一台Quagga路由器,TCP的MD5功能会自动启用。剩下来的事情,仅仅是配置Quagga以使用它的功能。但是,如果你使用的是FreeBSD机器或者为Quagga构建了一个自定义内核,请确保内核开启了TCP的MD5支持(如,Linux中的CONFIG_TCP_MD5SIG选项)。 ### 配置Router-A验证功能 ### @@ -43,7 +43,7 @@ BGP协议运行于TCP之上,因而,它也继承了TCP连接的所有漏洞 本例中使用的预共享密钥是‘xmodulo’。很明显,在生产环境中,你需要选择一个更健壮的密钥。 -**注意**: 在Quagga中,‘service password-encryption’命令是想加密配置文件中所有明文密码(如,登录密码)。然而,当我使用该命令时,我注意到BGP配置中的预共享密钥仍然是明文的。我不确定这是否是Quagga的限制,还是版本自身的问题。 +**注意**: 在Quagga中,‘service password-encryption’命令被用做加密配置文件中所有明文密码(如,登录密码)。然而,当我使用该命令时,我注意到BGP配置中的预共享密钥仍然是明文的。我不确定这是否是Quagga的限制,还是版本自身的问题。 ### 配置Router-B验证功能 ### @@ -58,15 +58,17 @@ BGP协议运行于TCP之上,因而,它也继承了TCP连接的所有漏洞 ### 验证BGP会话 ### -如果一切配置正确,那么BGP会话就会起来,两台路由器应该能交换路由表。这时候,TCP会话中的所有流出包都会携带一个MD5摘要的包内容和一个密钥,而摘要信息会被另一端自动验证。 +如果一切配置正确,那么BGP会话就应该起来了,两台路由器应该能交换路由表。这时候,TCP会话中的所有流出包都会携带一个MD5摘要的包内容和一个密钥,而摘要信息会被另一端自动验证。 -我们可以像平时一样通过查看BGP的概要来验证活跃的BGP会话。MD5校验和验证在Quagga内部是透明的,因此,你在BGP级别是无法看到的。 +我们可以像平时一样通过查看BGP的概要来验证活跃的BGP会话。MD5校验和的验证在Quagga内部是透明的,因此,你在BGP级别是无法看到的。 ![](https://farm8.staticflickr.com/7621/16837774368_e9ff66b370_c.jpg) 如果你想要测试BGP验证,你可以配置一个邻居路由,设置其密码为空,或者故意使用错误的预共享密钥,然后查看发生了什么。你也可以使用包嗅探器,像tcpdump或者Wireshark等,来分析通过BGP会话的包。例如,带有“-M ”选项的tcpdump将验证TCP选项字段的MD5摘要。 -小结之,在本教程中,我们演示了怎样简单地加固两台路由间的BGP会话安全。相对于其它协议而言,配置过程非常简明。强烈推荐你加固BGP会话安全,尤其是当你用另一个AS配置BGP会话的时候。预共享密钥也应该安全地保存。 +###小结### + +在本教程中,我们演示了怎样简单地加固两台路由间的BGP会话安全。相对于其它协议而言,配置过程非常简明。强烈推荐你加固BGP会话安全,尤其是当你用另一个AS配置BGP会话的时候。预共享密钥也应该安全地保存。 -------------------------------------------------------------------------------- @@ -74,11 +76,11 @@ via: http://xmodulo.com/bgp-authentication-quagga.html 作者:[Sarmed Rahman][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://xmodulo.com/author/sarmed [1]:http://research.dyn.com/2008/02/pakistan-hijacks-youtube-1/ [2]:http://tools.ietf.org/html/rfc2385 -[3]:http://xmodulo.com/centos-bgp-router-quagga.html +[3]:https://linux.cn/article-4232-1.html From e37355e82913d96431181583a08cb02867d93134 Mon Sep 17 00:00:00 2001 From: sevenot Date: Wed, 27 May 2015 21:08:23 +0800 Subject: [PATCH 187/965] translated --- ...5 Apps You Didn't Know You Were Missing.md | 114 ++++++++++++++++++ 1 file changed, 114 insertions(+) create mode 100644 translated/share/20150515 New to Linux 5 Apps You Didn't Know You Were Missing.md diff --git a/translated/share/20150515 New to Linux 5 Apps You Didn't Know You Were Missing.md b/translated/share/20150515 New to Linux 5 Apps You Didn't Know You Were Missing.md new file mode 100644 index 0000000000..2883dd7910 --- /dev/null +++ b/translated/share/20150515 New to Linux 5 Apps You Didn't Know You Were Missing.md @@ -0,0 +1,114 @@ +sevenot Translating +New to Linux? 5 Apps You Didn’t Know You Were Missing +初来乍到Linux? 你需要知道的5款好应用。 +================================================================================ +![](http://cdn.makeuseof.com/wp-content/uploads/2015/05/linux-apps-840x420.jpg?92a7a3) + +When you moved to Linux, you went straight for the obvious browsers, cloud clients, music players, email clients, and perhaps image editors, right? As a result, you’ve missed several vital, productive tools. Here’s a roundup of five umissable Linux apps that you really need to install. +当你刚刚迈入linux的世界时,你会立马动身开始使用著名的浏览器,云客户端,音乐播放器,邮件客户端,也许还有图形编辑器,对吗?可是,你却错过了几个非常重要的生产工具。这里将介绍你真的需要安装的5个不可错过的应用。 +### [Synergy][1] ### + +Synergy is a godsend if you use multiple desktops. It’s an open-source app that allows you to use a single mouse and keyboard across multiple computers, displays, and operating systems. Switching the mouse and keyboard functionality between the desktops is easy. Just move the mouse out the edge of one screen and into another. +Synergy 简直就是多桌面用户的福音。这是一个开源软件,它可以让你用一个鼠标和键盘在数台电脑里面,演示、操作你的系统。在桌面之间切换鼠标和键盘非常简单,你只要把鼠标从一个桌面的边缘移向另一个桌面即可。 + +![](http://cdn.makeuseof.com/wp-content/uploads/2015/04/multiple-monitors-640x431.jpg?92a7a3) + +When you open Synergy for the first time, it will run you through the setup wizard. The primary desktop is the one whose input devices you’ll be sharing with the other desktops. Configure that as the server. Add the remaining computers as clients. +当你第一次打开Synergy,它会带你进入一个安装引导。你的主显示屏即是你将与其它显示屏共享的输入设备。将主显示屏设为服务端,将其它显示屏设置为客户端。 + +![](http://cdn.makeuseof.com/wp-content/uploads/2015/04/synergy-setup-wizard-640x480.jpg?92a7a3) + +Synergy maintains a common clipboard across all connected desktops. It also merges the lock screen setup, i.e. you need to bypass the lock screen just once to log in to all the computers together. Under **Edit > Settings**, you can make a few more tweaks such as adding a password and setting Synergy to launch on startup. +Synergy在互连的各个桌面间维持同一张粘贴板,并且包含了锁屏功能,即你可以设置一键将互连的屏幕同时锁屏。你可以在Edit的Setting下调整更多的设置,比如设置密码或者将Synergy设置成开启自启动。 +### [BasKet Note Pads][2] ### + +Using BasKet Note Pads is somewhat like mapping your brain onto a computer. It helps make sense of all the ideas floating around in your head by allowing you to organize them in digestible chunks. You can use BasKet Note Pads for various tasks such as taking notes, creating idea maps and to-do lists, saving links, managing research, and keeping track of project data. +从某种意义上来讲,用BasKet Note Pads,就像把你的大脑刻画进里计算机一样。它把我们不经意间的想法记录下来,然后任由我们去把他们组织起来。你可以在变化多端的任务中用到BasKet Note Pads,比如记录笔记,制作概念图,记录代办事项,保存链接,管理你的科研,或者追踪程序数据。 +Each main idea or project goes into a section called a basket. To split ideas further, you can have one or more sub-baskets or sibling baskets. The baskets are further broken down into notes, which hold all the bits and pieces of a project. You can group them, tag them, and filter them. +在BasKet Note Pads中,每个主要的想法和工程被视作一个工作篮。至顶而下分支出去,你可以有一个或多个工作子篮或者兄弟篮。工作篮进一步分支成笔记,这些零零碎碎的笔记组成了一个工程。你可以自由组织它们,给它们打标签,筛选它们。 + +The left pane in the application’s two-pane structure displays a tree-like view of all the baskets you have created. +下图即是这款应用的界面,在左边的菜单中,展示了2个你创造的树形结构的工作篮。 +![](http://cdn.makeuseof.com/wp-content/uploads/2015/04/basket-note-pads-640x480.jpg?92a7a3) + +BasKet Note Pads might seem a little complex on day one, but you’ll get the hang of it soon. When you’re not using it, the app sits in the system tray, ready for quick access. +BasKet Note Pads第一次用起来可能有点复杂,但是如果你经常用它的话,你会觉得相当顺手。当你暂时不用它时,它会退出到系统托盘,方便你下次快速打开它。 +Want a [simpler note-taking alternative][3] on Linux? Try [Springseed][4]. +想在Linux上简单体验一番,试试Springseeds。 +### [Caffeine][5]### + +How do you ensure that your computer doesn’t go to sleep right in the middle of an [interesting movie][6]? Caffeine is the answer. No, you don’t need to brew a cup of coffee for your computer. You just need to install a lightweight indicator applet called Caffeine. It prevents the screen-saver, lock screen, or the Sleep mode from being activated when the computer is idle, only if the current window is in full-screen mode. +你怎样确定你的电脑不会在放一部精彩的电影中途突然休眠呢?Caffeine会帮助你解决这个问题。当然,你并不需要为你的电脑泡一杯咖啡。你只需要安装一个轻量级的指示器——Caffeine。只要当前你是全屏模式,它就会禁用你的屏幕保护程序例如锁屏,让你的电脑不会因为没有在任务中而进入睡眠模式。 + +To install the applet, [download its latest version][7]. If you want to go [the ppa way][8], here’s how you can: +点击下载安装最新版本的Caffeine。如果你想以PPA的方式安装,使用如下命令: + + $ sudo add-apt-repository ppa:caffeine-developers/ppa + $ sudo apt-get update + $ sudo apt-get install caffeine + +On Ubuntu versions 14.10 and 15.04 (and their derivatives), you’ll also need to install certain dependency packages: +如果你的Ubuntu版本是14.10或者15.04(或者其它衍生版本),你还需要安装下面的依赖包: + $ sudo apt-get install libappindicator3-1 gir1.2-appindicator3-0.1 + +After finishing the installation, add **caffeine-indicator** to your list of startup applications to make the indicator appear in the system tray. You can turn Caffeine’s functionality on and off via the app’s context menu, which pops up when you right-click on the tray icon. +完成安装以后,将Caffeine指示器设置成开机自启动,这样可以使指示器系统托盘里显示。你可以右键点击托盘图标打开应用目录,来开启或关闭Caffeine, + +![](http://cdn.makeuseof.com/wp-content/uploads/2015/04/caffeine-indicator-640x480.jpg?92a7a3) + +### Easystroke ### + +Easystroke makes an excellent [Linux mouse hack][9]. Use it to set up a series of customized mouse/touchpad/pen gestures to simulate common actions such as keystrokes, commands, and scrolls. Setting up Easystroke gestures is straightforward enough, thanks to the clear instructions that appear at all the right moments when you’re navigating the UI. +Easystroke是一个将鼠标全力开发出来的应用。通过一系列的设置,用鼠标、触摸屏、手势笔的动作来完成敲击键盘、执行命令和滑动屏幕。在Easystroke里能够设置的动作相当多,而且当你浏览界面时,你会发现应用的引导非常友善。 + +![](http://cdn.makeuseof.com/wp-content/uploads/2015/04/easystroke-record-640x480.jpg?92a7a3) + +Begin by choosing the mouse button you’d like to use for performing gestures. Throw in a modifier if you like. You’ll find this setting under **Preferences > Behavior > Gesture Button**. Now head to the **Actions** tab and record strokes for your most commonly used actions. +从选择一个你喜欢的动作来作为你的鼠标键开始。如果你喜欢,你可以把鼠标设置得更灵敏。通过Perferences>Behavior>Gesture Button来设置。现在把你最常用的键盘动作记录在动作表里吧。 +![](http://cdn.makeuseof.com/wp-content/uploads/2015/04/easytroke-actions-640x480.jpg?92a7a3) + +Using the **Preferences** and **Advanced** tabs, you can make other tweaks like setting Easystroke to autostart, adding a system tray icon, and changing scroll speed. +在Preferences和Advanced表中,你可以做一些其它的调整,比如将EasyStroke设置成自动启动,在系统托盘中显示图标,改变滑动速度。 + +### Guake ### + +I saved my favorite Linux find for last. Guake is a dropdown command line modeled after the one in the first-person shooter video game [Quake][10]. Whether you’re [learning about terminal commands][11] or executing them on a regular basis, Guake is a great way to keep the terminal handy. You can bring it up or hide it in a single keystroke. +我把我最喜欢的应用放在最后。Guake是根据第一人称射击视屏游戏Quake建模而来的下拉命令行工具。不管你是否在学习命令行终端,或者是有一定的基础,Guake都可以将终端变得更加方便。你可以一键将它弹出,也可以一键将它隐藏。 + +As you can see in the image below, when in action, Guake appears as an overlay on the current window. Right-click within the terminal to access the **Preferences** section, from where you can change Guake’s appearance, its scroll action, keyboard shortcuts, and more. +就像下面这张图,当在一个应用里时,Guake的界面会覆盖在当前的屏幕上。你可以右键点击终端的Preference来改变Guake的界面,它支持滑动,快捷键等等。 +![](http://cdn.makeuseof.com/wp-content/uploads/2015/04/guake-terminal-640x480.jpg?92a7a3) + +If KDE is your [Linux desktop of choice][12], do check out [Yakuake][13], which provides a similar functionality. +如果你的桌面是KDE,你可以选择一个类似的工具——Yakuake. +### Name Your Favorite Linux Discovery! ### +写下你最喜欢的Linux新发现! +There are many more [super useful Linux apps][14] waiting to be discovered. Rest assured that we’ll keep introducing you to them. +还有更多超级实用的Linux应用等待被发现。放心,我们将一直关注,并把它们带到你们的生活中。 +Which Linux app were you happiest to learn about? Which one do you consider a must-have? Tell us in the comments. +哪一个应用是你最喜欢学习的呢?哪一个是你觉得必不可少的呢?在评论里告诉给我们吧。 +-------------------------------------------------------------------------------- + +via: http://www.makeuseof.com/tag/new-linux-5-apps-didnt-know-missing/ + +作者:[Akshata][a] +译者:[sevenot](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.makeuseof.com/tag/author/akshata/ +[1]:http://synergy-project.org/ +[2]:http://basket.kde.org/ +[3]:http://www.makeuseof.com/tag/try-these-3-beautiful-note-taking-apps-that-work-offline/ +[4]:http://getspringseed.com/ +[5]:https://launchpad.net/caffeine +[6]:http://www.makeuseof.com/tag/popular-apps-movies-according-google/ +[7]:http://ppa.launchpad.net/caffeine-developers/ppa/ubuntu/pool/main/c/caffeine/ +[8]:http://www.makeuseof.com/tag/ubuntu-ppa-technology-explained/ +[9]:http://www.makeuseof.com/tag/4-astounding-linux-mouse-hacks/ +[10]:http://en.wikipedia.org/wiki/Quake_%28video_game%29 +[11]:http://www.makeuseof.com/tag/4-ways-teach-terminal-commands-linux-si/ +[12]:http://www.makeuseof.com/tag/10-top-linux-desktop-environments-available/ +[13]:https://yakuake.kde.org/ +[14]:http://www.makeuseof.com/tag/linux-treasures-x-sublime-native-linux-apps-will-make-want-switch/ From e8bd149ce6649277f7c75cdbb94009b20ae40092 Mon Sep 17 00:00:00 2001 From: sevenot Date: Wed, 27 May 2015 21:10:20 +0800 Subject: [PATCH 188/965] translated --- ...5 Apps You Didn't Know You Were Missing.md | 104 ------------------ 1 file changed, 104 deletions(-) delete mode 100644 sources/share/20150515 New to Linux 5 Apps You Didn't Know You Were Missing.md diff --git a/sources/share/20150515 New to Linux 5 Apps You Didn't Know You Were Missing.md b/sources/share/20150515 New to Linux 5 Apps You Didn't Know You Were Missing.md deleted file mode 100644 index 851ed5c676..0000000000 --- a/sources/share/20150515 New to Linux 5 Apps You Didn't Know You Were Missing.md +++ /dev/null @@ -1,104 +0,0 @@ -sevenot Translating -New to Linux? 5 Apps You Didn’t Know You Were Missing -================================================================================ -![](http://cdn.makeuseof.com/wp-content/uploads/2015/05/linux-apps-840x420.jpg?92a7a3) - -When you moved to Linux, you went straight for the obvious browsers, cloud clients, music players, email clients, and perhaps image editors, right? As a result, you’ve missed several vital, productive tools. Here’s a roundup of five umissable Linux apps that you really need to install. - -### [Synergy][1] ### - -Synergy is a godsend if you use multiple desktops. It’s an open-source app that allows you to use a single mouse and keyboard across multiple computers, displays, and operating systems. Switching the mouse and keyboard functionality between the desktops is easy. Just move the mouse out the edge of one screen and into another. - -![](http://cdn.makeuseof.com/wp-content/uploads/2015/04/multiple-monitors-640x431.jpg?92a7a3) - -When you open Synergy for the first time, it will run you through the setup wizard. The primary desktop is the one whose input devices you’ll be sharing with the other desktops. Configure that as the server. Add the remaining computers as clients. - -![](http://cdn.makeuseof.com/wp-content/uploads/2015/04/synergy-setup-wizard-640x480.jpg?92a7a3) - -Synergy maintains a common clipboard across all connected desktops. It also merges the lock screen setup, i.e. you need to bypass the lock screen just once to log in to all the computers together. Under **Edit > Settings**, you can make a few more tweaks such as adding a password and setting Synergy to launch on startup. - -### [BasKet Note Pads][2] ### - -Using BasKet Note Pads is somewhat like mapping your brain onto a computer. It helps make sense of all the ideas floating around in your head by allowing you to organize them in digestible chunks. You can use BasKet Note Pads for various tasks such as taking notes, creating idea maps and to-do lists, saving links, managing research, and keeping track of project data. - -Each main idea or project goes into a section called a basket. To split ideas further, you can have one or more sub-baskets or sibling baskets. The baskets are further broken down into notes, which hold all the bits and pieces of a project. You can group them, tag them, and filter them. - -The left pane in the application’s two-pane structure displays a tree-like view of all the baskets you have created. - -![](http://cdn.makeuseof.com/wp-content/uploads/2015/04/basket-note-pads-640x480.jpg?92a7a3) - -BasKet Note Pads might seem a little complex on day one, but you’ll get the hang of it soon. When you’re not using it, the app sits in the system tray, ready for quick access. - -Want a [simpler note-taking alternative][3] on Linux? Try [Springseed][4]. - -### [Caffeine][5]### - -How do you ensure that your computer doesn’t go to sleep right in the middle of an [interesting movie][6]? Caffeine is the answer. No, you don’t need to brew a cup of coffee for your computer. You just need to install a lightweight indicator applet called Caffeine. It prevents the screen-saver, lock screen, or the Sleep mode from being activated when the computer is idle, only if the current window is in full-screen mode. - -To install the applet, [download its latest version][7]. If you want to go [the ppa way][8], here’s how you can: - - $ sudo add-apt-repository ppa:caffeine-developers/ppa - $ sudo apt-get update - $ sudo apt-get install caffeine - -On Ubuntu versions 14.10 and 15.04 (and their derivatives), you’ll also need to install certain dependency packages: - - $ sudo apt-get install libappindicator3-1 gir1.2-appindicator3-0.1 - -After finishing the installation, add **caffeine-indicator** to your list of startup applications to make the indicator appear in the system tray. You can turn Caffeine’s functionality on and off via the app’s context menu, which pops up when you right-click on the tray icon. - -![](http://cdn.makeuseof.com/wp-content/uploads/2015/04/caffeine-indicator-640x480.jpg?92a7a3) - -### Easystroke ### - -Easystroke makes an excellent [Linux mouse hack][9]. Use it to set up a series of customized mouse/touchpad/pen gestures to simulate common actions such as keystrokes, commands, and scrolls. Setting up Easystroke gestures is straightforward enough, thanks to the clear instructions that appear at all the right moments when you’re navigating the UI. - -![](http://cdn.makeuseof.com/wp-content/uploads/2015/04/easystroke-record-640x480.jpg?92a7a3) - -Begin by choosing the mouse button you’d like to use for performing gestures. Throw in a modifier if you like. You’ll find this setting under **Preferences > Behavior > Gesture Button**. Now head to the **Actions** tab and record strokes for your most commonly used actions. - -![](http://cdn.makeuseof.com/wp-content/uploads/2015/04/easytroke-actions-640x480.jpg?92a7a3) - -Using the **Preferences** and **Advanced** tabs, you can make other tweaks like setting Easystroke to autostart, adding a system tray icon, and changing scroll speed. - -### Guake ### - -I saved my favorite Linux find for last. Guake is a dropdown command line modeled after the one in the first-person shooter video game [Quake][10]. Whether you’re [learning about terminal commands][11] or executing them on a regular basis, Guake is a great way to keep the terminal handy. You can bring it up or hide it in a single keystroke. - -As you can see in the image below, when in action, Guake appears as an overlay on the current window. Right-click within the terminal to access the **Preferences** section, from where you can change Guake’s appearance, its scroll action, keyboard shortcuts, and more. - -![](http://cdn.makeuseof.com/wp-content/uploads/2015/04/guake-terminal-640x480.jpg?92a7a3) - -If KDE is your [Linux desktop of choice][12], do check out [Yakuake][13], which provides a similar functionality. - -### Name Your Favorite Linux Discovery! ### - -There are many more [super useful Linux apps][14] waiting to be discovered. Rest assured that we’ll keep introducing you to them. - -Which Linux app were you happiest to learn about? Which one do you consider a must-have? Tell us in the comments. - --------------------------------------------------------------------------------- - -via: http://www.makeuseof.com/tag/new-linux-5-apps-didnt-know-missing/ - -作者:[Akshata][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.makeuseof.com/tag/author/akshata/ -[1]:http://synergy-project.org/ -[2]:http://basket.kde.org/ -[3]:http://www.makeuseof.com/tag/try-these-3-beautiful-note-taking-apps-that-work-offline/ -[4]:http://getspringseed.com/ -[5]:https://launchpad.net/caffeine -[6]:http://www.makeuseof.com/tag/popular-apps-movies-according-google/ -[7]:http://ppa.launchpad.net/caffeine-developers/ppa/ubuntu/pool/main/c/caffeine/ -[8]:http://www.makeuseof.com/tag/ubuntu-ppa-technology-explained/ -[9]:http://www.makeuseof.com/tag/4-astounding-linux-mouse-hacks/ -[10]:http://en.wikipedia.org/wiki/Quake_%28video_game%29 -[11]:http://www.makeuseof.com/tag/4-ways-teach-terminal-commands-linux-si/ -[12]:http://www.makeuseof.com/tag/10-top-linux-desktop-environments-available/ -[13]:https://yakuake.kde.org/ -[14]:http://www.makeuseof.com/tag/linux-treasures-x-sublime-native-linux-apps-will-make-want-switch/ From 6d5b259abb1e22bddb077a83c7ef0dc3a56a845b Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 27 May 2015 22:06:15 +0800 Subject: [PATCH 189/965] translating --- ...FAQs with Answers--How to mount an LVM partition on Linux.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20150527 Linux FAQs with Answers--How to mount an LVM partition on Linux.md b/sources/tech/20150527 Linux FAQs with Answers--How to mount an LVM partition on Linux.md index 42cfb4b2ae..3701452fee 100644 --- a/sources/tech/20150527 Linux FAQs with Answers--How to mount an LVM partition on Linux.md +++ b/sources/tech/20150527 Linux FAQs with Answers--How to mount an LVM partition on Linux.md @@ -1,3 +1,5 @@ +Translating----geekpi + Linux FAQs with Answers--How to mount an LVM partition on Linux ================================================================================ > **Question**: I have an external USB drive which contains several LVM partitions on it. I want to access some of those LVM partitions on my Linux. How can I mount an LVM partition on Linux? From 783f5d48a45abcc035b1bccec8e1a1dd3f11fcad Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 27 May 2015 22:35:25 +0800 Subject: [PATCH 190/965] translated --- ...-How to mount an LVM partition on Linux.md | 91 ------------------- ...-How to mount an LVM partition on Linux.md | 89 ++++++++++++++++++ 2 files changed, 89 insertions(+), 91 deletions(-) delete mode 100644 sources/tech/20150527 Linux FAQs with Answers--How to mount an LVM partition on Linux.md create mode 100644 translated/tech/20150527 Linux FAQs with Answers--How to mount an LVM partition on Linux.md diff --git a/sources/tech/20150527 Linux FAQs with Answers--How to mount an LVM partition on Linux.md b/sources/tech/20150527 Linux FAQs with Answers--How to mount an LVM partition on Linux.md deleted file mode 100644 index 3701452fee..0000000000 --- a/sources/tech/20150527 Linux FAQs with Answers--How to mount an LVM partition on Linux.md +++ /dev/null @@ -1,91 +0,0 @@ -Translating----geekpi - -Linux FAQs with Answers--How to mount an LVM partition on Linux -================================================================================ -> **Question**: I have an external USB drive which contains several LVM partitions on it. I want to access some of those LVM partitions on my Linux. How can I mount an LVM partition on Linux? - -LVM is a logical volume management tool which allows you to manage disk space using the notion of logical volumes and volume groups. The biggest benefit of using LVM over classic partitions is the flexibility in allocating storage for users and applications without being constrained by the size of individual physical disks. - -In LVM, the physical storage, on which logical volumes are created, is traditional partitions (e.g., /dev/sda2, /dev/sdb1). These partitions must be initialized as "physical volumes" and labeled so (e.g., "Linux LVM") in order for them to be used in LVM. Once the partitions are labeled as LVM volumes, you cannot mount them directly with mount command. - -If you attempt to mount an LVM partition (e.g., /dev/sdb2), you will get the following error. - - $ mount /dev/sdb2 /mnt - ----------- - - mount: unknown filesystem type 'LVM2_member' - -![](https://farm8.staticflickr.com/7696/17749902190_0a6d36821f_b.jpg) - -If you want to mount an LVM partition properly, you must instead mount "logical volumes" created inside the partition. Here is how to to it. - -First, examine a list of available volume groups by running: - - $ sudo pvs - ----------- - - PV VG Fmt Attr PSize PFree - /dev/sdb2 vg_ezsetupsystem40a8f02fadd0 lvm2 a-- 237.60g 0 - -![](https://farm8.staticflickr.com/7657/17938136831_d9320b7bfc_b.jpg) - -The names of available physical volumes and volume groups are listed under PV and VG columns, respectively. In this example, there is a single volume group named "vg_ezsetupsystem40a8f02fadd0" created on /dev/sdb2. - -Next, let's check what logical volumes exist inside this volume group. For that, use lvdisplay command: - - $ sudo lvdisplay - -Running lvdisplay shows information about available logical volumes (e.g., device name, volume name, volume size, etc) as shown below. - - $ sudo lvdisplay /dev/vg_ezsetupsystem40a8f02fadd0 - ----------- - - --- Logical volume --- - LV Path /dev/vg_ezsetupsystem40a8f02fadd0/lv_root - LV Name lv_root - VG Name vg_ezsetupsystem40a8f02fadd0 - LV UUID imygta-P2rv-2SMU-5ugQ-g99D-A0Cb-m31eet - LV Write Access read/write - LV Creation host, time livecd.centos, 2015-03-16 18:38:18 -0400 - LV Status available - # open 0 - LV Size 50.00 GiB - Current LE 12800 - Segments 1 - Allocation inherit - Read ahead sectors auto - - currently set to 256 - Block device 252:0 - -![](https://farm8.staticflickr.com/7707/17938137591_cdb4cbfb43_b.jpg) - -If you want to mount a particular logical volume, use its device name shown in "LV Path" (e.g., /dev/vg_ezsetupsystem40a8f02fadd0/lv_home) as follows. - - $ sudo mount /dev/vg_ezsetupsystem40a8f02fadd0/lv_home /mnt - -You can check the mount status by running mount command without any argument, which will show you a list of all mounted filesystems. - - $ mount - -![](https://farm6.staticflickr.com/5449/17749903670_2ee617445d_c.jpg) - -If you want to have a logical volume to be mounted automatically on boot, add the following line in /etc/fstab. You need to specify the file system type (e.g., EXT4) of the volume, which you can find out from the output of mount command above. - - /dev/vg_ezsetupsystem40a8f02fadd0/lv_home /mnt ext4 defaults 0 0 - -Now the logical volume will be automatically mounted at /mnt upon boot. - --------------------------------------------------------------------------------- - -via: http://ask.xmodulo.com/mount-lvm-partition-linux.html - -作者:[Dan Nanni][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://ask.xmodulo.com/author/nanni \ No newline at end of file diff --git a/translated/tech/20150527 Linux FAQs with Answers--How to mount an LVM partition on Linux.md b/translated/tech/20150527 Linux FAQs with Answers--How to mount an LVM partition on Linux.md new file mode 100644 index 0000000000..391769edc2 --- /dev/null +++ b/translated/tech/20150527 Linux FAQs with Answers--How to mount an LVM partition on Linux.md @@ -0,0 +1,89 @@ +Linux有问必答 -- 如何在Linux中挂载LVM分区 +================================================================================ +> **提问**: 我有一个USB盘包含了LVM分区。 我想要在Linux中访问这些LVM分区。我该如何在Linux中挂载LVM分区? + +】LVM是逻辑卷管理工具,它允许你使用逻辑卷和卷组的概念来管理磁盘空间。使用LVM相比传统分区最大的好处是弹性地位用户和程序分配空间而不用考虑每个物理磁盘的大小。 + +在LVM中,那些创建了逻辑分区的物理存储是传统的分区(比如:/dev/sda2,/dev/sdb1)。这些分区必须被初始化位“物理卷”并被标签(如,“Linux LVM”)来使它们可以在LVM中使用。一旦分区被标记被LVM分区,你不能直接用mount命令挂载。 + +如果你尝试挂载一个LVM分区(比如/dev/sdb2), 你会得到下面的错误。 + + $ mount /dev/sdb2 /mnt + +---------- + + mount: unknown filesystem type 'LVM2_member' + +![](https://farm8.staticflickr.com/7696/17749902190_0a6d36821f_b.jpg) + +要正确地挂载LVM分区,你必须挂载分区创建的“逻辑分区”。下面就是如何做的。 + +=首先,用下面的命令检查可用的卷组: + + $ sudo pvs + +---------- + + PV VG Fmt Attr PSize PFree + /dev/sdb2 vg_ezsetupsystem40a8f02fadd0 lvm2 a-- 237.60g 0 + +![](https://farm8.staticflickr.com/7657/17938136831_d9320b7bfc_b.jpg) + +物理卷的名字和卷组的名字分别在PV和VG列的下面。本例中,只有一个创建在dev/sdb2下的组“vg_ezsetupsystem40a8f02fadd0”。 + +接下来检查卷组中存在的逻辑卷,使用lvdisplay命令: + + $ sudo lvdisplay + +使用lvdisplay显示了可用卷的信息(如:设备名、卷名、卷大小等等)。 + + $ sudo lvdisplay /dev/vg_ezsetupsystem40a8f02fadd0 + +---------- + + --- Logical volume --- + LV Path /dev/vg_ezsetupsystem40a8f02fadd0/lv_root + LV Name lv_root + VG Name vg_ezsetupsystem40a8f02fadd0 + LV UUID imygta-P2rv-2SMU-5ugQ-g99D-A0Cb-m31eet + LV Write Access read/write + LV Creation host, time livecd.centos, 2015-03-16 18:38:18 -0400 + LV Status available + # open 0 + LV Size 50.00 GiB + Current LE 12800 + Segments 1 + Allocation inherit + Read ahead sectors auto + - currently set to 256 + Block device 252:0 + +![](https://farm8.staticflickr.com/7707/17938137591_cdb4cbfb43_b.jpg) + +如果你想要挂载一个特定的逻辑卷,使用“LV Path”下面的设备名(如:/dev/vg_ezsetupsystem40a8f02fadd0/lv_home)。 + + $ sudo mount /dev/vg_ezsetupsystem40a8f02fadd0/lv_home /mnt + +你可以用mount命令不带任何参数检查挂载状态,这会显示所有已挂载的文件系统。 + + $ mount + +![](https://farm6.staticflickr.com/5449/17749903670_2ee617445d_c.jpg) + +如果你想在每次启动时自动挂载逻辑卷,在/etc/fstab中添加下面的行,你可以指定卷的文件系统类型(如 ext4),它可以从mount命令的输出中找。 + + /dev/vg_ezsetupsystem40a8f02fadd0/lv_home /mnt ext4 defaults 0 0 + +现在逻辑卷会在每次启动时挂载到/mnt。 + +-------------------------------------------------------------------------------- + +via: http://ask.xmodulo.com/mount-lvm-partition-linux.html + +作者:[Dan Nanni][a] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://ask.xmodulo.com/author/nanni \ No newline at end of file From 15243e2dee06b67c771a57f21ec526711c6aab9c Mon Sep 17 00:00:00 2001 From: wxy Date: Wed, 27 May 2015 23:34:44 +0800 Subject: [PATCH 191/965] PUB:20150515 New to Linux 5 Apps You Didn't Know You Were Missing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @sevenot 校对并发布了: https://linux.cn/article-5526-1.html (明早可见) 总体来说,文字组织能力挺好,翻译的不错!有几点小小不足可以改进: 1、译文中不必保留英文了 2、要注意保留英文原文中的 markdown 格式,就是那些星号、括号之类的。关于 markdown,你可以在网上或本站找到很多资料,也可以使用一个 MD 编辑器。 谢谢你的贡献! --- ...5 Apps You Didn't Know You Were Missing.md | 105 ++++++++++++++++ ...5 Apps You Didn't Know You Were Missing.md | 114 ------------------ 2 files changed, 105 insertions(+), 114 deletions(-) create mode 100644 published/20150515 New to Linux 5 Apps You Didn't Know You Were Missing.md delete mode 100644 translated/share/20150515 New to Linux 5 Apps You Didn't Know You Were Missing.md diff --git a/published/20150515 New to Linux 5 Apps You Didn't Know You Were Missing.md b/published/20150515 New to Linux 5 Apps You Didn't Know You Were Missing.md new file mode 100644 index 0000000000..1d34cda0f4 --- /dev/null +++ b/published/20150515 New to Linux 5 Apps You Didn't Know You Were Missing.md @@ -0,0 +1,105 @@ +初来乍到Linux? 你需要知道的5款好应用 +================================================================================ +![](http://cdn.makeuseof.com/wp-content/uploads/2015/05/linux-apps-840x420.jpg?92a7a3) + +当你刚刚迈入linux的世界时,你会立马动身开始使用那些知名的浏览器、云客户端、音乐播放器、邮件客户端,也许还有图形编辑器,对吗?可是,你却错过了几个非常重要的生产工具。这里将介绍给你5个应该安装的不容错过的应用。 + +### [Synergy][1] ### + +Synergy 简直就是多桌面用户的福音。这是一个开源软件,它可以让你用一个鼠标和键盘跨越几台电脑、显示器和操作系统。在桌面之间切换鼠标和键盘非常简单,你只要把鼠标从一个桌面的边缘移向另一个桌面即可。 + +![](http://cdn.makeuseof.com/wp-content/uploads/2015/04/multiple-monitors-640x431.jpg?92a7a3) + +当你第一次打开 Synergy,它会引导你完成设置。你的主桌面就是你将与其它桌面共享输入设备的那个。将主桌面设为服务端,将其它桌面设置为客户端。 + +![](http://cdn.makeuseof.com/wp-content/uploads/2015/04/synergy-setup-wizard-640x480.jpg?92a7a3) + +Synergy 在互连的各个桌面间维持同一张粘贴板。它也将锁屏功能融合到了一起,例如,你可以跳过锁屏一次登录到所有桌面。你可以在 **Edit 菜单的 Setting** 下调整更多的设置,比如设置密码或者将 Synergy 设置成开机自启动。 + +(LCTT 译注:这是个[自由而开源][15]的好软件,但是如果你从它的网站下载,由于商业支持的缘故,是需要付费的;当然你可以自己[下载源代码并编译][15]。) + +### [BasKet Note Pads][2] ### + +从某种意义上来讲,用 BasKet Note Pads,就像把你的大脑刻画进计算机里一样。它把我们不经意间的想法记录下来,然后任由我们去把它们组织起来。你可以在各种任务中用到 BasKet Note Pads,比如记录笔记、制作脑图、记录代办事项、保存链接、管理你的发现、或者追踪项目数据。 + +在 BasKet Note Pads 中,每个放到一个区域的主要的想法或项目被称作一个篮子(basket)。你可以进一步拆分,成一个或多个子篮或者兄弟篮。篮子进一步分成笔记,这些零零碎碎的笔记组成了一个项目。你可以自由组织它们,给它们打标签,和筛选它们。 + +该应用的双面板结构的左侧以树形结构显示了你创建的所有篮子。 + +![](http://cdn.makeuseof.com/wp-content/uploads/2015/04/basket-note-pads-640x480.jpg?92a7a3) + +BasKet Note Pads 第一次用起来可能有点复杂,但是如果你经常用它的话,你会觉得相当顺手。当你暂时不用它时,它会退出到系统托盘,方便你下次快速打开它。 + +如果在 Linux 上想要一个[更简单的笔记本替代品][3]?可以试试[Springseed][4]。 + +### [Caffeine(咖啡因)][5]### + +你怎样确保你的电脑不会在放一部[精彩的电影][6]中途突然休眠呢?Caffeine 会帮助你解决这个问题。当然,你并不需要为你的电脑泡一杯咖啡。你只需要安装一个轻量级的指示器 —— Caffeine。只要当前你是全屏模式,它就会禁用你的屏幕保护程序、锁屏程序,让你的电脑不会因为没有在任务中而进入睡眠模式。 + +[点击下载][7]安装最新版本的 Caffeine。如果你想以[PPA的方式][8]安装,使用如下命令: + + $ sudo add-apt-repository ppa:caffeine-developers/ppa + $ sudo apt-get update + $ sudo apt-get install caffeine + +如果你的Ubuntu版本是14.10或者15.04(或者其它衍生版本),你还需要安装下面的依赖包: + + $ sudo apt-get install libappindicator3-1 gir1.2-appindicator3-0.1 + +完成安装以后,将**Caffeine指示器**设置成开机自启动,这样可以使指示器显示在系统托盘里。你可以右键点击托盘图标打开应用的关联菜单,来开启或关闭Caffeine, + +![](http://cdn.makeuseof.com/wp-content/uploads/2015/04/caffeine-indicator-640x480.jpg?92a7a3) + +### Easystroke ### + +Easystroke 是一个将[鼠标潜力][9]开发出来的应用。通过一系列的设置,用鼠标、触摸屏、手写笔的手势来完成敲击键盘、执行命令和滚动屏幕等通用操作。在 Easystroke 里能够设置的手势相当多,而且当你看到应用的界面时,你会发现应用的引导非常清晰。 + +![](http://cdn.makeuseof.com/wp-content/uploads/2015/04/easystroke-record-640x480.jpg?92a7a3) + +选择一个你喜欢的鼠标键开始设置手势。如果你喜欢,你还可以设置辅助功能键。通过Perferences>Behavior>Gesture Button 来设置。现在到**Action**选项卡里面,把你最常用的动作记录成手势吧。 + +![](http://cdn.makeuseof.com/wp-content/uploads/2015/04/easytroke-actions-640x480.jpg?92a7a3) + +在 Preferences 和 Advanced 选项卡中,你可以做一些其它的调整,比如将 EasyStroke 设置成自动启动,在系统托盘中显示图标,改变滚动速度。 + +### Guake ### + +我把我最喜欢的应用放在最后。Guake 是根据第一人称射击视屏游戏 [Quake][10] 模仿而来的下拉式命令行终端。不管你是否在[学习命令行终端][11],或者是有一定的基础,Guake 都可以将终端变得更加方便。你可以一键将它呼出,也可以一键将它隐藏。 + +就像下面这张图,当打开时,Guake 的界面会覆盖在当前的屏幕上。你可以在终端中右键点击,调出 Preference 来改变 Guake 的界面,滚动方式,快捷键等等。 + +![](http://cdn.makeuseof.com/wp-content/uploads/2015/04/guake-terminal-640x480.jpg?92a7a3) + +如果[你的桌面][12]是 KDE,你可以选择一个类似的工具——[Yakuake][13]. + +### 写下你最喜欢的Linux新发现!### + +还有更多[超级实用的 Linux 应用][14]等待被发现。放心,我们将一直关注,并把它们带到你们的生活中。 + +哪一个应用是你最喜欢研究的呢?哪一个是你觉得必不可少的呢?在评论里告诉给我们吧。 + +-------------------------------------------------------------------------------- + +via: http://www.makeuseof.com/tag/new-linux-5-apps-didnt-know-missing/ + +作者:[Akshata][a] +译者:[sevenot](https://github.com/sevenot) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.makeuseof.com/tag/author/akshata/ +[1]:http://synergy-project.org/ +[2]:http://basket.kde.org/ +[3]:http://www.makeuseof.com/tag/try-these-3-beautiful-note-taking-apps-that-work-offline/ +[4]:http://getspringseed.com/ +[5]:https://launchpad.net/caffeine +[6]:http://www.makeuseof.com/tag/popular-apps-movies-according-google/ +[7]:http://ppa.launchpad.net/caffeine-developers/ppa/ubuntu/pool/main/c/caffeine/ +[8]:http://www.makeuseof.com/tag/ubuntu-ppa-technology-explained/ +[9]:http://www.makeuseof.com/tag/4-astounding-linux-mouse-hacks/ +[10]:http://en.wikipedia.org/wiki/Quake_%28video_game%29 +[11]:http://www.makeuseof.com/tag/4-ways-teach-terminal-commands-linux-si/ +[12]:http://www.makeuseof.com/tag/10-top-linux-desktop-environments-available/ +[13]:https://yakuake.kde.org/ +[14]:http://www.makeuseof.com/tag/linux-treasures-x-sublime-native-linux-apps-will-make-want-switch/ diff --git a/translated/share/20150515 New to Linux 5 Apps You Didn't Know You Were Missing.md b/translated/share/20150515 New to Linux 5 Apps You Didn't Know You Were Missing.md deleted file mode 100644 index 2883dd7910..0000000000 --- a/translated/share/20150515 New to Linux 5 Apps You Didn't Know You Were Missing.md +++ /dev/null @@ -1,114 +0,0 @@ -sevenot Translating -New to Linux? 5 Apps You Didn’t Know You Were Missing -初来乍到Linux? 你需要知道的5款好应用。 -================================================================================ -![](http://cdn.makeuseof.com/wp-content/uploads/2015/05/linux-apps-840x420.jpg?92a7a3) - -When you moved to Linux, you went straight for the obvious browsers, cloud clients, music players, email clients, and perhaps image editors, right? As a result, you’ve missed several vital, productive tools. Here’s a roundup of five umissable Linux apps that you really need to install. -当你刚刚迈入linux的世界时,你会立马动身开始使用著名的浏览器,云客户端,音乐播放器,邮件客户端,也许还有图形编辑器,对吗?可是,你却错过了几个非常重要的生产工具。这里将介绍你真的需要安装的5个不可错过的应用。 -### [Synergy][1] ### - -Synergy is a godsend if you use multiple desktops. It’s an open-source app that allows you to use a single mouse and keyboard across multiple computers, displays, and operating systems. Switching the mouse and keyboard functionality between the desktops is easy. Just move the mouse out the edge of one screen and into another. -Synergy 简直就是多桌面用户的福音。这是一个开源软件,它可以让你用一个鼠标和键盘在数台电脑里面,演示、操作你的系统。在桌面之间切换鼠标和键盘非常简单,你只要把鼠标从一个桌面的边缘移向另一个桌面即可。 - -![](http://cdn.makeuseof.com/wp-content/uploads/2015/04/multiple-monitors-640x431.jpg?92a7a3) - -When you open Synergy for the first time, it will run you through the setup wizard. The primary desktop is the one whose input devices you’ll be sharing with the other desktops. Configure that as the server. Add the remaining computers as clients. -当你第一次打开Synergy,它会带你进入一个安装引导。你的主显示屏即是你将与其它显示屏共享的输入设备。将主显示屏设为服务端,将其它显示屏设置为客户端。 - -![](http://cdn.makeuseof.com/wp-content/uploads/2015/04/synergy-setup-wizard-640x480.jpg?92a7a3) - -Synergy maintains a common clipboard across all connected desktops. It also merges the lock screen setup, i.e. you need to bypass the lock screen just once to log in to all the computers together. Under **Edit > Settings**, you can make a few more tweaks such as adding a password and setting Synergy to launch on startup. -Synergy在互连的各个桌面间维持同一张粘贴板,并且包含了锁屏功能,即你可以设置一键将互连的屏幕同时锁屏。你可以在Edit的Setting下调整更多的设置,比如设置密码或者将Synergy设置成开启自启动。 -### [BasKet Note Pads][2] ### - -Using BasKet Note Pads is somewhat like mapping your brain onto a computer. It helps make sense of all the ideas floating around in your head by allowing you to organize them in digestible chunks. You can use BasKet Note Pads for various tasks such as taking notes, creating idea maps and to-do lists, saving links, managing research, and keeping track of project data. -从某种意义上来讲,用BasKet Note Pads,就像把你的大脑刻画进里计算机一样。它把我们不经意间的想法记录下来,然后任由我们去把他们组织起来。你可以在变化多端的任务中用到BasKet Note Pads,比如记录笔记,制作概念图,记录代办事项,保存链接,管理你的科研,或者追踪程序数据。 -Each main idea or project goes into a section called a basket. To split ideas further, you can have one or more sub-baskets or sibling baskets. The baskets are further broken down into notes, which hold all the bits and pieces of a project. You can group them, tag them, and filter them. -在BasKet Note Pads中,每个主要的想法和工程被视作一个工作篮。至顶而下分支出去,你可以有一个或多个工作子篮或者兄弟篮。工作篮进一步分支成笔记,这些零零碎碎的笔记组成了一个工程。你可以自由组织它们,给它们打标签,筛选它们。 - -The left pane in the application’s two-pane structure displays a tree-like view of all the baskets you have created. -下图即是这款应用的界面,在左边的菜单中,展示了2个你创造的树形结构的工作篮。 -![](http://cdn.makeuseof.com/wp-content/uploads/2015/04/basket-note-pads-640x480.jpg?92a7a3) - -BasKet Note Pads might seem a little complex on day one, but you’ll get the hang of it soon. When you’re not using it, the app sits in the system tray, ready for quick access. -BasKet Note Pads第一次用起来可能有点复杂,但是如果你经常用它的话,你会觉得相当顺手。当你暂时不用它时,它会退出到系统托盘,方便你下次快速打开它。 -Want a [simpler note-taking alternative][3] on Linux? Try [Springseed][4]. -想在Linux上简单体验一番,试试Springseeds。 -### [Caffeine][5]### - -How do you ensure that your computer doesn’t go to sleep right in the middle of an [interesting movie][6]? Caffeine is the answer. No, you don’t need to brew a cup of coffee for your computer. You just need to install a lightweight indicator applet called Caffeine. It prevents the screen-saver, lock screen, or the Sleep mode from being activated when the computer is idle, only if the current window is in full-screen mode. -你怎样确定你的电脑不会在放一部精彩的电影中途突然休眠呢?Caffeine会帮助你解决这个问题。当然,你并不需要为你的电脑泡一杯咖啡。你只需要安装一个轻量级的指示器——Caffeine。只要当前你是全屏模式,它就会禁用你的屏幕保护程序例如锁屏,让你的电脑不会因为没有在任务中而进入睡眠模式。 - -To install the applet, [download its latest version][7]. If you want to go [the ppa way][8], here’s how you can: -点击下载安装最新版本的Caffeine。如果你想以PPA的方式安装,使用如下命令: - - $ sudo add-apt-repository ppa:caffeine-developers/ppa - $ sudo apt-get update - $ sudo apt-get install caffeine - -On Ubuntu versions 14.10 and 15.04 (and their derivatives), you’ll also need to install certain dependency packages: -如果你的Ubuntu版本是14.10或者15.04(或者其它衍生版本),你还需要安装下面的依赖包: - $ sudo apt-get install libappindicator3-1 gir1.2-appindicator3-0.1 - -After finishing the installation, add **caffeine-indicator** to your list of startup applications to make the indicator appear in the system tray. You can turn Caffeine’s functionality on and off via the app’s context menu, which pops up when you right-click on the tray icon. -完成安装以后,将Caffeine指示器设置成开机自启动,这样可以使指示器系统托盘里显示。你可以右键点击托盘图标打开应用目录,来开启或关闭Caffeine, - -![](http://cdn.makeuseof.com/wp-content/uploads/2015/04/caffeine-indicator-640x480.jpg?92a7a3) - -### Easystroke ### - -Easystroke makes an excellent [Linux mouse hack][9]. Use it to set up a series of customized mouse/touchpad/pen gestures to simulate common actions such as keystrokes, commands, and scrolls. Setting up Easystroke gestures is straightforward enough, thanks to the clear instructions that appear at all the right moments when you’re navigating the UI. -Easystroke是一个将鼠标全力开发出来的应用。通过一系列的设置,用鼠标、触摸屏、手势笔的动作来完成敲击键盘、执行命令和滑动屏幕。在Easystroke里能够设置的动作相当多,而且当你浏览界面时,你会发现应用的引导非常友善。 - -![](http://cdn.makeuseof.com/wp-content/uploads/2015/04/easystroke-record-640x480.jpg?92a7a3) - -Begin by choosing the mouse button you’d like to use for performing gestures. Throw in a modifier if you like. You’ll find this setting under **Preferences > Behavior > Gesture Button**. Now head to the **Actions** tab and record strokes for your most commonly used actions. -从选择一个你喜欢的动作来作为你的鼠标键开始。如果你喜欢,你可以把鼠标设置得更灵敏。通过Perferences>Behavior>Gesture Button来设置。现在把你最常用的键盘动作记录在动作表里吧。 -![](http://cdn.makeuseof.com/wp-content/uploads/2015/04/easytroke-actions-640x480.jpg?92a7a3) - -Using the **Preferences** and **Advanced** tabs, you can make other tweaks like setting Easystroke to autostart, adding a system tray icon, and changing scroll speed. -在Preferences和Advanced表中,你可以做一些其它的调整,比如将EasyStroke设置成自动启动,在系统托盘中显示图标,改变滑动速度。 - -### Guake ### - -I saved my favorite Linux find for last. Guake is a dropdown command line modeled after the one in the first-person shooter video game [Quake][10]. Whether you’re [learning about terminal commands][11] or executing them on a regular basis, Guake is a great way to keep the terminal handy. You can bring it up or hide it in a single keystroke. -我把我最喜欢的应用放在最后。Guake是根据第一人称射击视屏游戏Quake建模而来的下拉命令行工具。不管你是否在学习命令行终端,或者是有一定的基础,Guake都可以将终端变得更加方便。你可以一键将它弹出,也可以一键将它隐藏。 - -As you can see in the image below, when in action, Guake appears as an overlay on the current window. Right-click within the terminal to access the **Preferences** section, from where you can change Guake’s appearance, its scroll action, keyboard shortcuts, and more. -就像下面这张图,当在一个应用里时,Guake的界面会覆盖在当前的屏幕上。你可以右键点击终端的Preference来改变Guake的界面,它支持滑动,快捷键等等。 -![](http://cdn.makeuseof.com/wp-content/uploads/2015/04/guake-terminal-640x480.jpg?92a7a3) - -If KDE is your [Linux desktop of choice][12], do check out [Yakuake][13], which provides a similar functionality. -如果你的桌面是KDE,你可以选择一个类似的工具——Yakuake. -### Name Your Favorite Linux Discovery! ### -写下你最喜欢的Linux新发现! -There are many more [super useful Linux apps][14] waiting to be discovered. Rest assured that we’ll keep introducing you to them. -还有更多超级实用的Linux应用等待被发现。放心,我们将一直关注,并把它们带到你们的生活中。 -Which Linux app were you happiest to learn about? Which one do you consider a must-have? Tell us in the comments. -哪一个应用是你最喜欢学习的呢?哪一个是你觉得必不可少的呢?在评论里告诉给我们吧。 --------------------------------------------------------------------------------- - -via: http://www.makeuseof.com/tag/new-linux-5-apps-didnt-know-missing/ - -作者:[Akshata][a] -译者:[sevenot](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.makeuseof.com/tag/author/akshata/ -[1]:http://synergy-project.org/ -[2]:http://basket.kde.org/ -[3]:http://www.makeuseof.com/tag/try-these-3-beautiful-note-taking-apps-that-work-offline/ -[4]:http://getspringseed.com/ -[5]:https://launchpad.net/caffeine -[6]:http://www.makeuseof.com/tag/popular-apps-movies-according-google/ -[7]:http://ppa.launchpad.net/caffeine-developers/ppa/ubuntu/pool/main/c/caffeine/ -[8]:http://www.makeuseof.com/tag/ubuntu-ppa-technology-explained/ -[9]:http://www.makeuseof.com/tag/4-astounding-linux-mouse-hacks/ -[10]:http://en.wikipedia.org/wiki/Quake_%28video_game%29 -[11]:http://www.makeuseof.com/tag/4-ways-teach-terminal-commands-linux-si/ -[12]:http://www.makeuseof.com/tag/10-top-linux-desktop-environments-available/ -[13]:https://yakuake.kde.org/ -[14]:http://www.makeuseof.com/tag/linux-treasures-x-sublime-native-linux-apps-will-make-want-switch/ From 5fb852737c5ac102b1f8fd18be08dc7c9b859bbc Mon Sep 17 00:00:00 2001 From: wxy Date: Thu, 28 May 2015 00:06:01 +0800 Subject: [PATCH 192/965] PUB:20150417 sshuttle--A transparent proxy-based VPN using ssh @geekpi --- ...le--A transparent proxy-based VPN using ssh.md | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) rename {translated/tech => published}/20150417 sshuttle--A transparent proxy-based VPN using ssh.md (76%) diff --git a/translated/tech/20150417 sshuttle--A transparent proxy-based VPN using ssh.md b/published/20150417 sshuttle--A transparent proxy-based VPN using ssh.md similarity index 76% rename from translated/tech/20150417 sshuttle--A transparent proxy-based VPN using ssh.md rename to published/20150417 sshuttle--A transparent proxy-based VPN using ssh.md index 297f411840..953fd343b8 100644 --- a/translated/tech/20150417 sshuttle--A transparent proxy-based VPN using ssh.md +++ b/published/20150417 sshuttle--A transparent proxy-based VPN using ssh.md @@ -1,9 +1,8 @@ -sshuttle - 一个使用ssh的基于VPN的透明代理 +sshuttle:一个使用ssh的基于VPN的透明代理 ================================================================================ -sshuttle允许你通过ssh创建一条从你电脑连接到任何远程服务器的VPN连接,只要你的服务器支持python2.3 或则更高的版本, 你必须有本机的root权限,但是你可以在服务端有普通账户即可。 - -你可以在一台机器上同时运行多次sshuttle来连接到不同的服务器上,这样你就可以一次使用多个VPN, sshuttle可以转发你子网所有流量到VPN中。 +sshuttle 允许你通过 ssh 创建一条从你电脑连接到任何远程服务器的 VPN 连接,只要你的服务器支持 python2.3 或则更高的版本。你必须有本机的 root 权限,但是你可以在服务端有普通账户即可。 +你可以在一台机器上同时运行多次 sshuttle 来连接到不同的服务器上,这样你就可以同时使用多个 VPN, sshuttle可以转发你子网中所有流量到VPN中。 ### 在Ubuntu中安装sshuttle ### @@ -17,7 +16,7 @@ sshuttle允许你通过ssh创建一条从你电脑连接到任何远程服务器 sshuttle [options...] [-r [username@]sshserver[:port]] [subnets] -#### Option 细节 #### +#### 选项细节 #### -r, —remote=[username@]sshserver[:port] @@ -29,9 +28,9 @@ sshuttle允许你通过ssh创建一条从你电脑连接到任何远程服务器 sudo sshuttle -r username@sshserver 0.0.0.0/0 -vv -当开始后,sshuttle会创建一个ssh会话到通过-r指定的服务器。如果-r被忽略了,它会在本地运行客户端和服务端,这个有时会在测试时有用。 +当开始后,sshuttle会创建一个ssh会话到由-r指定的服务器。如果-r被丢了,它会在本地运行客户端和服务端,这个有时会在测试时有用。 -连接到远程服务器后,sshuttle会上传它的(python)源码到远程服务器并执行。那么,你就不需要在远程服务器上安装sshuttle,并且客户端和服务器端间不会存在sshuttle版本冲突。 +连接到远程服务器后,sshuttle会上传它的(python)源码到远程服务器并执行。所以,你就不需要在远程服务器上安装sshuttle,并且客户端和服务器端间不会存在sshuttle版本冲突。 #### 手册中的更多例子 #### @@ -86,7 +85,7 @@ via: http://www.ubuntugeek.com/sshuttle-a-transparent-proxy-based-vpn-using-ssh. 作者:[ruchi][a] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 From fc017032f7225b5d57aba96844abea776c6d60f3 Mon Sep 17 00:00:00 2001 From: wxy Date: Thu, 28 May 2015 10:14:17 +0800 Subject: [PATCH 193/965] PUB:20150324 7 Quirky' ls' Command Tricks Every Linux User Should Know @GOLinux --- ...and Tricks Every Linux User Should Know.md | 102 +++++++++--------- 1 file changed, 51 insertions(+), 51 deletions(-) rename {translated/tech => published}/20150324 7 Quirky' ls' Command Tricks Every Linux User Should Know.md (66%) diff --git a/translated/tech/20150324 7 Quirky' ls' Command Tricks Every Linux User Should Know.md b/published/20150324 7 Quirky' ls' Command Tricks Every Linux User Should Know.md similarity index 66% rename from translated/tech/20150324 7 Quirky' ls' Command Tricks Every Linux User Should Know.md rename to published/20150324 7 Quirky' ls' Command Tricks Every Linux User Should Know.md index 7793b856c2..b41338034f 100644 --- a/translated/tech/20150324 7 Quirky' ls' Command Tricks Every Linux User Should Know.md +++ b/published/20150324 7 Quirky' ls' Command Tricks Every Linux User Should Know.md @@ -1,15 +1,15 @@ -Linux用户应知应会的7个‘ls’命令异用技巧 +Linux用户应知应会的7个‘ls’命令的独特技巧 ================================================================================ + 在前面我们系列报道的两篇文章中,我们已经涵盖了关于‘ls’命令的绝大多数内容。本文时‘ls命令’系列的最后一部分。如果你还没有读过该系列的其它两篇文章,你可以访问下面的链接。 -注:以下三篇都做过源文,看看翻译了没有,如果发布了可适当改链接地址 - -- [Linux中的15个‘ls’命令基本用法实例][1] -- [关于Linux “ls”命令的15个面试问题 – 第一部分][2] -- [10个有用的‘ls’命令面试问题 – 第二部分][3] +- [Linux中的15个基本‘ls’命令示例][1] +- [15 个‘ls’命令的面试问题(一)][2] +- [10 个‘ls’命令面试的问题(二)][3] ![7 Quirky ls Command Tricks](http://www.tecmint.com/wp-content/uploads/2015/03/ls-command-tricks.jpg) -7个ls命令异用技巧 + +*7个ls命令独特技巧* ### 1. 以各种时间格式附带时间戳列出目录中的内容 ### @@ -17,11 +17,11 @@ Linux用户应知应会的7个‘ls’命令异用技巧 # ls -l –time-style=[STYLE] (方法 A) -**注意** - 上面的开关(`--time`格式必须和`-l`开关同时使用,否则达不到目的)。 +**注意** - 上面的开关`--time`的格式必须和`-l`开关同时使用,否则达不到目的。 - # ls –full-time (方法 B) + # ls -full-time (方法 B) -用以下任何一个选项替换`[STYLE]`。 +可以用以下任何一个选项替换`[STYLE]`。 full-iso long-iso @@ -29,64 +29,59 @@ Linux用户应知应会的7个‘ls’命令异用技巧 locale +%H:%M:%S:%D -**注意** - 在上面行中,H(时),M(分),S(秒),D(日期)的顺序可以任意调整。 - -此外,你只需选择那些相关的选项,而不是所有选项。例如,`ls -l --time-style=+%H`将只显示小时。 - -`ls -l --time-style=+%H:%M:%D`将显示小时、分钟和日期。 +**注意** - 在上面行中,H(时),M(分),S(秒),D(日)的顺序可以任意调整。此外,你只需选择那些相关的选项,而不是所有选项。例如,`ls -l --time-style=+%H`将只显示小时。`ls -l --time-style=+%H:%M:%D`将显示小时、分钟和日。 # ls -l --time-style=full-iso ![ls Command Full Time Style](http://www.tecmint.com/wp-content/uploads/2015/03/ls-Command-Full-Time-Style.gif) -ls命令完整时间格式 + +*ls命令的完整 ISO时间格式* # ls -l --time-style=long-iso ![Long Time Style Listing](http://www.tecmint.com/wp-content/uploads/2015/03/Long-Time-Listing-Format.gif) -长时间格式列表 + +*长时间格式列表* # ls -l --time-style=iso ![Time Style Listing](http://www.tecmint.com/wp-content/uploads/2015/03/Local-Time-Style-Listing.gif) -时间格式列表 + +*时间格式列表* # ls -l --time-style=locale ![Locale Time Style Listing](http://www.tecmint.com/wp-content/uploads/2015/03/Hour-Mintue-Time-Style-Listing.gif) -本地时间格式列表 + +*本地时间格式列表* # ls -l --time-style=+%H:%M:%S:%D ![Date and Time Style Listing](http://www.tecmint.com/wp-content/uploads/2015/03/Full-Time-Style-Listing.gif) -日期和时间格式列表 + +*日期和时间格式列表* # ls --full-time ![Full Style Time Listing](http://www.tecmint.com/wp-content/uploads/2015/03/Full-Style-Time-Listing.gif) -完整格式时间列表 + +*完整格式时间列表* ### 2. 以多种格式列出目录内容,如以逗号分隔、水平格式、长格式、垂直格式、交叉格式等列出。 ### -目录内容可以用以下建议的ls命令各种格式列出。 +目录内容可以用以下建议的ls命令各种格式列出: -- 交叉 -- 逗号 -- 水平 -- 长格式 -- 单栏 -- 详情 -- 垂直 - - # ls –-format=across - # ls --format=comma - # ls --format=horizontal - # ls --format=long - # ls --format=single-column - # ls --format=verbose - # ls --format=vertical + # ls --format=across # 交叉 + # ls --format=comma # 逗号 + # ls --format=horizontal # 水平 + # ls --format=long # 长格式 + # ls --format=single-column # 单栏 + # ls --format=verbose # 详情 + # ls --format=vertical # 垂直 ![Listing Formats of ls Command](http://www.tecmint.com/wp-content/uploads/2015/03/ls-command-Listing-Formats.gif) -ls命令的列出格式 + +*ls命令的列出格式* ### 3. 使用ls命令为目录内容输出结果添加像(/=@|)这样的指示符。 ### @@ -95,7 +90,8 @@ ls命令的列出格式 # ls -p ![Append Indicators to Content](http://www.tecmint.com/wp-content/uploads/2015/03/Append-Indicators.gif) -添加指示符到内容 + +*添加指示符到内容* ### 4. 根据扩展名、大小、时间和版本对目录内容排序。 ### @@ -110,16 +106,18 @@ ls命令的列出格式 # ls --sort=none ![Sort Listing of Content by Options](http://www.tecmint.com/wp-content/uploads/2015/03/Sort-Content-by-Extensions.gif) -通过选项对内容排序列出 -### 5. 使用ls命令打印目录中各个内容的数字UID和GID。 ### +*通过选项对内容排序列出* + +### 5. 使用ls命令打印目录中各个项的数字UID和GID。 ### 上面的环境可以通过使用带有-n标识的ls命令来实现。 # ls -n ![Print Listing of Content by UID and GID](http://www.tecmint.com/wp-content/uploads/2015/03/Print-UID-GID-of-Contents.gif) -通过UID和GID对打印内容列表 + +*通过UID和GID对打印内容列表* ### 6. 标准输出结果中打印目录内容中比默认指定的更多栏目。 ### @@ -132,20 +130,22 @@ ls命令的列出格式 # ls --width 150 ![List Content Based on Window Sizes](http://www.tecmint.com/wp-content/uploads/2015/03/List-Content-By-More-Column.gif) -根据窗口大小列出内容 + +*根据窗口大小列出内容* **注意**: 你可以试验你可以给width标识传递什么值。 -### 7. 通过ls命令为列出的目录内容手动指定的tab大小而不是默认的8。 ### +### 7. 通过ls命令为列出的目录内容手动指定的制表符大小而不是默认的8。 ### # ls --tabsize=[value] ![List Content by Table Size](http://www.tecmint.com/wp-content/uploads/2015/03/List-Content-by-Table-Size.gif) -按表尺寸列出内容 -**注意**: 指定`[Value]=`的数值。 +*按表尺寸列出内容* -到目前为止,都讲完了。保持连线到Tecmint,我们会推出下一篇文章。别忘了在下面的评论中为我们提供有价值的反馈。为我们点赞并分享,帮我们推广。 +**注意**: 指定`[Value]`的数值。 + +到目前为止,都讲完了。保持连线,我们会推出下一篇文章。别忘了在下面的评论中为我们提供有价值的反馈。为我们点赞并分享,帮我们推广。 -------------------------------------------------------------------------------- @@ -153,11 +153,11 @@ via: http://www.tecmint.com/linux-ls-command-tricks/ 作者:[Avishek Kumar][a] 译者:[GOLinux](https://github.com/GOLinux) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 [a]:http://www.tecmint.com/author/avishek/ -[1]:http://www.tecmint.com/15-basic-ls-command-examples-in-linux/ -[2]:http://www.tecmint.com/ls-command-interview-questions/ -[3]:http://www.tecmint.com/ls-interview-questions/ +[1]:https://linux.cn/article-5109-1.html +[2]:https://linux.cn/article-5349-1.html +[3]:https://linux.cn/article-5350-1.html From 70bb082113ed0291b8417168dc0004cf5863a388 Mon Sep 17 00:00:00 2001 From: KayGuoWhu Date: Thu, 28 May 2015 10:58:08 +0800 Subject: [PATCH 194/965] translated --- ...n Source History--Why Did Linux Succeed.md | 74 ------------------- ...n Source History--Why Did Linux Succeed.md | 73 ++++++++++++++++++ 2 files changed, 73 insertions(+), 74 deletions(-) delete mode 100644 sources/talk/20150511 Open Source History--Why Did Linux Succeed.md create mode 100644 translated/talk/20150511 Open Source History--Why Did Linux Succeed.md diff --git a/sources/talk/20150511 Open Source History--Why Did Linux Succeed.md b/sources/talk/20150511 Open Source History--Why Did Linux Succeed.md deleted file mode 100644 index e50eb38cb7..0000000000 --- a/sources/talk/20150511 Open Source History--Why Did Linux Succeed.md +++ /dev/null @@ -1,74 +0,0 @@ -[translating by KayGuoWhu] -Open Source History: Why Did Linux Succeed? -================================================================================ -> Why did Linux, the Unix-like operating system kernel started by Linus Torvalds in 1991 that became central to the open source world, succeed where so many similar projects, including GNU HURD and the BSDs, fail? - -![](http://thevarguy.com/site-files/thevarguy.com/files/imagecache/medium_img/uploads/2015/05/linux.jpg) - -One of the most puzzling questions about the history of free and open source is this: Why did Linux succeed so spectacularly, whereas similar attempts to build a free or open source, Unix-like operating system kernel met with considerably less success? I don't know the answer to that question. But I have rounded up some theories, which I'd like to lay out here. - -First, though, let me make clear what I mean when I write that Linux was a great success. I am defining it in opposition primarily to the variety of other Unix-like operating system kernels, some of them open and some not, that proliferated around the time Linux was born. [GNU][1] HURD, the free-as-in-freedom kernel whose development began in [May 1991][2], is one of them. Others include Unices that most people today have never heard of, such as various derivatives of the Unix variant developed at the University of California at Berkeley, BSD; Xenix, Microsoft's take on Unix; academic Unix clones including Minix; and the original Unix developed under the auspices of AT&T, which was vitally important in academic and commercial computing circles during earlier decades, but virtually disappeared from the scene by the 1990s. - -#### Related #### - -- [Open Source History: Tracing the Origins of Hacker Culture and the Hacker Ethic][3] -- [Unix and Personal Computers: Reinterpreting the Origins of Linux][4] - -I'd also like to make clear that I'm writing here about kernels, not complete operating systems. To a great extent, the Linux kernel owes its success to the GNU project as a whole, which produced the crucial tools, including compilers, a debugger and a BASH shell implementation, that are necessary to build a Unix-like operating system. But GNU developers never created a viable version of the the HURD kernel (although they are [still trying][5]). Instead, Linux ended up as the kernel that glued the rest of the GNU pieces together, even though that had never been in the GNU plans. - -So it's worth asking why Linux, a kernel launched by Linus Torvalds, an obscure programmer in Finland, in 1991—the same year as HURD—endured and thrived within a niche where so many other Unix-like kernels, many of which enjoyed strong commercial backing and association with the leading Unix hackers of the day, failed to take off. To that end, here are a few theories pertaining to that question that I've come across as I've researched the history of the free and open source software worlds, along with the respective strengths and weaknesses of these various explanations. - -### Linux Adopted a Decentralized Development Approach ### - -This is the argument that comes out of Eric S. Raymond's essay, "[The Cathedral and the Bazaar][6]," and related works, which make the case that software develops best when a large number of contributors collaborate continuously within a relatively decentralized organizational structure. That was generally true of Linux, in contrast to, for instance, GNU HURD, which took a more centrally directed approach to code development—and, as a result, "had been evidently failing" to build a complete operating system for a decade, in Raymond's view. - -To an extent, this explanation makes sense, but it has some significant flaws. For one, Torvalds arguably assumed a more authoritative role in directing Linux code development—deciding which contributions to include and reject—than Raymond and others have wanted to recognize. For another, this reasoning does not explain why GNU succeeded in producing so much software besides a working kernel. If only decentralized development works well in the free/open source software world, then all of GNU's programming efforts should have been a bust—which they most certainly were not. - -### Linux is Pragmatic; GNU is Ideological ### - -Personally, I find this explanation—which supposes that Linux grew so rapidly because its founder was a pragmatist who initially wrote the kernel just to be able to run a tailored Unix OS on his computer at home, not as part of a crusade to change the world through free software, as the GNU project aimed to do—the most compelling. - -Still, it has some weaknesses that make it less than completely satisfying. In particular, while Torvalds himself adopted pragmatic principles, not all members of the community that coalesced around his project, then or today, have done the same. Yet, Linux has succeeded all the same. - -Moreover, if pragmatism was the key to Linux's endurance, then why, again, was GNU successful in building so many other tools besides a kernel? If having strong political beliefs about software prevents you from pursuing successful projects, GNU should have been an outright failure, not an endeavor that produced a number of software packages that remain foundational to the IT world today. - -Last but not least, many of the other Unix variants of the late 1980s and early 1990s, especially several BSD off-shoots, were the products of pragmatism. Their developers aimed to build Unix variants that could be more freely shared than those restricted by expensive commercial licenses, but they were not deeply ideological about programming or sharing code. Neither was Torvalds, and it is therefore difficult to explain Linux's success, and the failure of other Unix projects, in terms of ideological zeal. - -### Operating System Design ### - -There are technical differences between Linux and some other Unix variants that are important to keep in mind when considering the success of Linux. Richard Stallman, the founder of the GNU project, pointed to these in explaining, in an email to me, why HURD development had lagged: "It is true that the GNU Hurd is not a practical success. Part of the reason is that its basic design made it somewhat of a research project. (I chose that design thinking it was a shortcut to get a working kernel in a hurry.)" - -Linux is also different from other Unix variants in the sense that Torvalds wrote all of the Linux code himself. Having a Unix of his own, free of other people's code, was one of his stated intentions when he [first announced Linux][7] in August 1991. This characteristic sets Linux apart from most of the other Unix variants that existed at that time, which derived their code bases from either AT&T Unix or Berkeley's BSD. - -I'm not a computer scientist, so I'm not qualified to decide whether the Linux code was simply superior to that of the other Unices, explaining why Linux succeeded. But that's an argument someone might make—although it does not account for the disparity in culture and personnel between Linux and other Unix kernels, which, to me, seem more important than code in understanding Linux's success. - -### The "Community" Put Its Support Behind Linux ### - -Stallman also wrote that "mainly the reason" for Linux's success was that "Torvalds made Linux free software, and since then more of the community's effort has gone into Linux than into the Hurd." That's not exactly a complete explanation for Linux's trajectory, since it does not account for why the community of free software developers followed Torvalds instead of HURD or another Unix. But it nonetheless highlights this shift as a large part of how Linux prevailed. - -A fuller account of the free software community's decision to endorse Linux would have to explain why developers did so even though, at first, Linux was a very obscure project—much more so, by any measure, than some of the other attempts at the time to create a freer Unix, such as NET BSD and 386/BSD—as well as one whose affinity with the goals of the free software movement was not at first clear. Originally, Torvalds released Linux under a license that simply prevented its commercial use. It was considerably later that he switched to the GNU General Public License, which protects the openness of source code. - -So, those are the explanations I've found for Linux's success as an open source operating system kernel—a success which, to be sure, has been measured in some respects (desktop Linux never became what its proponents hoped, for instance). But Linux has also become foundational to the computing world in ways that no other Unix-like OS has. Maybe Apple OS X and iOS, which derive from BSD, come close, but they don't play such a central role as Linux in powering the Internet, among other things. - -Have other ideas on why Linux became what it did, or why its counterparts in the Unix world have now almost all sunk into obscurity? (I know: BSD variants still have a following today, and some commercial Unices remain important enough for [Red Hat][8] (RHT) to be [courting their users][9]. But none of these Unix holdouts have conquered everything from Web servers to smartphones in the way Linux has.) I'd be delighted to hear them. - --------------------------------------------------------------------------------- - -via: http://thevarguy.com/open-source-application-software-companies/050415/open-source-history-why-did-linux-succeed - -作者:[hristopher Tozzi][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://thevarguy.com/author/christopher-tozzi -[1]:http://gnu.org/ -[2]:http://www.gnu.org/software/hurd/history/hurd-announce -[3]:http://thevarguy.com/open-source-application-software-companies/042915/open-source-history-tracing-origins-hacker-culture-and-ha -[4]:http://thevarguy.com/open-source-application-software-companies/042715/unix-and-personal-computers-reinterpreting-origins-linux -[5]:http://thevarguy.com/open-source-application-software-companies/042015/30-years-hurd-lives-gnu-updates-open-source- -[6]:http://www.catb.org/esr/writings/cathedral-bazaar/cathedral-bazaar/ -[7]:https://groups.google.com/forum/#!topic/comp.os.minix/dlNtH7RRrGA[1-25] -[8]:http://www.redhat.com/ -[9]:http://thevarguy.com/open-source-application-software-companies/032614/red-hat-grants-certification-award-unix-linux-migration-a \ No newline at end of file diff --git a/translated/talk/20150511 Open Source History--Why Did Linux Succeed.md b/translated/talk/20150511 Open Source History--Why Did Linux Succeed.md new file mode 100644 index 0000000000..85b2473719 --- /dev/null +++ b/translated/talk/20150511 Open Source History--Why Did Linux Succeed.md @@ -0,0 +1,73 @@ +开源旧事:Linux为什么能成功? +================================================================================ +> Linux,这个始于1991年由Lnius Torvalds开发的类Unix操作系统内核已经成为开源世界的中心,人们不禁追问为什么Linux成功了,而包括GNU HURD和BSD在内的那么多相似的项目却失败了? + +![](http://thevarguy.com/site-files/thevarguy.com/files/imagecache/medium_img/uploads/2015/05/linux.jpg) + +自由软件和开源世界的发展史中最令人不解的问题之一是为什么Linux取得了如此辉煌的成功,然而其它同样尝试打造自由开源、类Unix操作系统内核的项目却没能那么成功?这个问题难以回答,但我总结了一些原因,在下面与大家分享。 + +不过,首先得明确:当我谈论Linux是一个巨大的成功时所表达的含义。我对Linux成功的定义和对其它类Unix操作系统内核不一样,后者中一些是开源的,一些不是,而且它们繁荣发展的时期是Linux诞生的时期。[GNU][1]的HURD,一个发起于[1991年5月][1]的自由但不是免费的内核,便是其中之一。其它的包括现在大部分人都没听说过的Unix,比如由加州大学伯克利分校开发出来的BSD的各种各样Unix衍生版,由微软主导的Unix系统Xenix,包括Minix在内的学术版本Unix,和在AT&T赞助下开发的最初的Unix。在更早的数十年内,它对于学术界和商业届的计算发展至关重要,但到19世纪90年代就已经几乎已经消失在人们的视野里。 + +#### 相关阅读 #### + +- [Open Source History: Tracing the Origins of Hacker Culture and the Hacker Ethic][3] +- [Unix and Personal Computers: Reinterpreting the Origins of Linux][4] + +因此,得说明的是,我所写的是关于内核,而不是完整的操作系统。在很大程度上,Linux内核的成功归功于GNU整个项目。GNU这个项目产生了一套至关重要的工具,包括编译器、调试器和BASH shell的实现,这些对于构建一个类Unix操作系统是必需的。但是GNU的开发者们从没开发出一个HURD内核的可行版本(尽管他们仍在[不懈努力中][5])。相反,Linux呈现出来的则是一个将GNU各个部分紧密连接在一起的内核,尽管这超出了GNU的初衷。 + +因此,值得人们去追问为什么Linux,一个由Linus Torvalds这个芬兰的无名程序员于1991年——和HURD同一年——发起的内核,能够禁受考验并发展壮大?在当时的大环境下,很多拥有强力商业支持的、由当时炙手可热的黑客领头的类Unix内核都没能够发展起来。为了说明这个问题,我找到了一些和这个问题相关的解释。为此我研究了自由软件和开源世界的发展史,和不同解释的优缺点。 + +### Linux采用去中心化的开发方式 ### + +这个观点来源于Eric S. Raymond的文章,“[大教堂与市集][6]”和其相关资料。这些资料验证了一种情形:当大量的贡献者以一种去中心化的组织结构持续不断地协同合作时,软件开发的效率最佳。Linux的开发证明了这一点,与之相反的是,比如,GNU HURD采用了一种相对更集中化的方法来管理代码开发。其结果如同Raymond所言,显然在十年的时间里都没能成功构建出一个完整的操作系统。 + +在一定程度上,这个解释有道理,但仍有一些明显的不足。举例来说,Torvalds在指导Linux代码开发过程中毫无争议地承担起一个更加有权威的角色,他可以决定接受或拒绝代码,这一点并非Raymond和其他人所想的那样。其次,这个观点不能解释除了没能开发出一个可行的系统内核外GNU仍然成功地生产出那么多优秀的软件。如果只有去中心化的开发方式才能很好地指导开源软件世界里的项目,那么GNU所有的编程工作都应该是徒劳无功的,但事实并非如此。 + +### Linux是实用型的,而GNU是空想型的 ### + +个人而言,我觉得下面这个说法是最引人注目的,即Linux之所发展得如此迅速是因为它的创建者是一个实用主义者,他起初只是想写一个内核,使其能够在他家里的电脑上运行一个裁剪过的Unix操作系统,而不是成为以改变世界为目标的自由软件的一部分,而后者正是GNU项目的一贯目标。 + +然而,这个解释仍然有一些不能完全让人信服的地方。特别是,尽管Torvalds本人信奉实用主义的原则,但无论以前还是现在,并非所有参与到他的项目中的成员都和他一样信奉这一原则。尽管如此,Linux仍然取得了成功。 + +而且,如果实用主义是Linux持续发展的关键,那么就要再问一遍:为什么GNU除了没能开发出一个内核外还是成功地开发出这么多有用的工具?如果拥有某一种对软件的坚定政治信仰是追求成功的项目路上的绊脚石,那么GNU早应该是一个彻头彻尾的失败者,而不会是一个开发了那么多如今依然为IT世界提供坚实基础的优秀软件包的开拓者。 + +最后(但并不是最不重要),许多诞生于19世纪80年代末期和90年代初期的Unix变体,尤其是一些BSD分支,都是实用主义的产物。它们的开发者们致力于开发出可以自由分享而不是受到高昂商业证书限制的Unix变体,但他们对于编程或者共享代码并非完全局限于意识形态。Torvalds同样如此,因此很难说Linux和成功和其它Unix项目的失败是意识形态在作怪。 + +### 操作系统设计 ### + +当谈到Linux的成功时,不可忽视的是Linux和其它Unix变体之间的诸多技术差异。Richard Stallman,GNU项目的创始人,在一封给我的电子邮件中解释了为什么HURD的开发进度频频滞后:“GNU Hurd确实不是一次实用上的成功。部分原因是它的基本设计使它像是一个研究项目。(我之所以选择这样的设计,是考虑到这是快速实现一个可用内核的捷径。)” + +就Torvalds独自编写出Linux的所有代码这点而言,Linux也有别于其它Unix变体。当他在1991年8月[第一次发布Linux][7]时他的一个初衷就是拥有一个属于他自己的Unix,免费共享代码。这点特性使得Linux区别于同时期的大部分Unix变体,后者一般是从AT&T Unix或伯克利的BSD中衍生出基础代码。 + +我并不是一个计算机科学家,所以我没有资格去评判是否Lunux代码就优于其他Unix代码,以此来解释Linux的成功。虽然这并不能解释Linux和其它Unix内核在文化和人力上的不同,但这个观点对我来说解释得通,因为似乎在理解Linux成功这一点上它比代码更加重要。(译者尽力了+_+) + +### Linux背后的社区提供了有力支持 ### + +Stallman也写到Linux成功的“主要原因”是“Torvalds使Linux成为一个自由软件,所以相比Hurd有更多来自社区的支持涌入Linux的发展中。”但这对于Linux的成长轨迹并非是一个完美的解释,因为它不能说明为什么自由软件的开发者们追随了Torvalds而不是HURD或其它某个Unix。但它仍然突出了这个转变是Linux盛行的很大一部分。(译者尽力了) + +对于自由软件社区支持Linux的决定有一个更全面的理由可以用来解释为什么开发者们这么做。起初,Linux只是一个默默无闻的小项目,以任何标准来衡量,它比同时期其它的一些尝试创建一个更加自由的Unix,比如NET BSD和386/BSD,都要显得微不足道。同样,最初并不清楚Linux和自由软件运行目标的亲和力是怎样。创建伊始,Torvalds只是在一份防止Linux不被商业使用的证书下发布了Linux。至于后来他为了保护源代码的开放性转向使用GNU的通用公开证书则是后话了。 + +所以,这些就是我所找到的Linux作为一个开源操作系统之所以取得成功的解释,可以肯定Linux的成就在某些方面(但比如桌面版的Linux从未成为它的支持者希望成为的样子)已经是可以衡量的成功。总之,Linux业已以其它任何类Unix操作系统都没有实现的方式成为了计算机世界的基石。也许源于BSD的苹果公司的OS X和iOS系统也很接近这一点,但它们没有在其它方面像Linux影响互联网一样扮演着如此重要的中心角色。 + +对于为什么Linux能成为它已经成为的样子,或者为什么它在Unix世界的竞争对手们几乎全部变得默默无闻的问题你有其它的想法吗?如果有,我很乐意听到你的想法。(诚然,BSD的变体如今仍有一批追随者,而一些商用的Unix对于[Red Hat][8](RHT)为[他们的用户提供支持][9]来说也仍然十分重要。但这些Unix中没有一个能够像Linux一样几乎征服了从Web服务器到智能手机的每一个领域。) + +-------------------------------------------------------------------------------- + +via: http://thevarguy.com/open-source-application-software-companies/050415/open-source-history-why-did-linux-succeed + +作者:[hristopher Tozzi][a] +译者:[KayGuoWhu](https://github.com/KayGuoWhu) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://thevarguy.com/author/christopher-tozzi +[1]:http://gnu.org/ +[2]:http://www.gnu.org/software/hurd/history/hurd-announce +[3]:http://thevarguy.com/open-source-application-software-companies/042915/open-source-history-tracing-origins-hacker-culture-and-ha +[4]:http://thevarguy.com/open-source-application-software-companies/042715/unix-and-personal-computers-reinterpreting-origins-linux +[5]:http://thevarguy.com/open-source-application-software-companies/042015/30-years-hurd-lives-gnu-updates-open-source- +[6]:http://www.catb.org/esr/writings/cathedral-bazaar/cathedral-bazaar/ +[7]:https://groups.google.com/forum/#!topic/comp.os.minix/dlNtH7RRrGA[1-25] +[8]:http://www.redhat.com/ +[9]:http://thevarguy.com/open-source-application-software-companies/032614/red-hat-grants-certification-award-unix-linux-migration-a \ No newline at end of file From abeb7ba4649ea50acd04dd2102ad4ce30e2877a7 Mon Sep 17 00:00:00 2001 From: DeadFire Date: Thu, 28 May 2015 15:59:04 +0800 Subject: [PATCH 195/965] =?UTF-8?q?20150528-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...tless but awesome Linux terminal tricks.md | 106 +++++++ ...nds for RPM Package Management in Linux.md | 287 ++++++++++++++++++ ...Things To Do After Installing Fedora 22.md | 114 +++++++ 3 files changed, 507 insertions(+) create mode 100644 sources/tech/20150528 11 pointless but awesome Linux terminal tricks.md create mode 100644 sources/tech/20150528 27 'DNF' Fork of Yum Commands for RPM Package Management in Linux.md create mode 100644 sources/tech/20150528 Things To Do After Installing Fedora 22.md diff --git a/sources/tech/20150528 11 pointless but awesome Linux terminal tricks.md b/sources/tech/20150528 11 pointless but awesome Linux terminal tricks.md new file mode 100644 index 0000000000..731f28df10 --- /dev/null +++ b/sources/tech/20150528 11 pointless but awesome Linux terminal tricks.md @@ -0,0 +1,106 @@ +11 pointless but awesome Linux terminal tricks +================================================================================ +Here are some great Linux terminal tips and tricks, each one as pointless as it is awesome. + +![](http://images.techhive.com/images/article/2015/05/slide_01-100587352-orig.png) + +### All work and no play... ### + +Linux is one of the most astoundingly functional and utilitarian Operating Systems around when it comes to working from the command line. Need to perform a particular task? Odds are there is an application or script you can use to get it done. Right from the terminal. But, as they say in the good book, "All work and no play make Jack really bored or something." So here is a collection of my favorite pointless, stupid, annoying or amusing things that you can do right in your Linux Terminal. + +![](http://images.techhive.com/images/article/2015/05/slide_02-100587353-orig.png) + +### Give the terminal an attitude ### + +Step 1) Type "sudo visudo". + +Step 2) At the bottom of the "Defaults" (near the top of the file) add, on a new line, "Defaults insults". + +Step 3) Save the file. + +"What did I just do to my computer?" you may be asking yourself. Something wonderful. Now, whenever you issue a sudo command and misstype your password, your computer will call you names. My favorite: "Listen, burrito brains, I don't have time to listen to this trash." + +![](http://images.techhive.com/images/article/2015/05/slide_03-100587354-orig.png) + +### apt-get moo ### + +That screenshot you see? That's what typing "apt-get moo" (on a Debian-based system) does. That's it. Don't go looking for this to do something fancy. It won't. That, I kid you not, is it. But it's one of the most commonly known little Easter eggs on Linux. So I include it here, right near the beginning, so I won't get 5,000 emails telling me I missed it in this list. + +![](http://images.techhive.com/images/article/2015/05/slide_04-100587355-orig.png) + +### aptitude moo ### + +A bit more entertaining is aptitude's take on "moo." Type "aptitude moo" (on Ubuntu and the like) and you'll be corrected about thinking "moo" would do anything. But you know better. Try the same command again, this time with an optional "-v" attribute. Don't stop there. Add v's, one at a time, until aptitude gives you what you want. + +![](http://images.techhive.com/images/article/2015/05/slide_05-100587356-orig.png) + +### Arch: Put Pac-Man in pacman ### + +This is one just for the Arch-lovers out there. The de facto package manager, pacman, is pretty fantastic already. Let's make it even better. + +Step 1) Open "/etc/pacman.conf". + +Step 2) In the "# Misc options", remove the "#" from in front of "Color". + +Step 3) Add "ILoveCandy". + +Now the progress for installing new packages, in pacman, will include a little tiny Pac-Man. Which should really just be the default anyway. + +![](http://images.techhive.com/images/article/2015/05/slide_06-100587358-orig.png) + +### Cowsay! ### + +Making aptitude moo is neat, I guess, but you really can't use it for much. Enter "cowsay." It does what you think. You make a cow say things. Anything you like. And it's not even limited to cows. Calvin, Beavis, and the Ghostbusters logo are all available in full ASCII art glory – type "cowsay -l" for a full list of what's available in this, Linux's most powerful tool. Remember that, like most great terminal applications, you can pipe the output from other applications straight into cowsay (ala "fortune | cowsay"). + +![](http://images.techhive.com/images/article/2015/05/slide_07-100587359-orig.png) + +### Become an 3l33t h@x0r ### + +Typing "nmap" isn't something one typically needs to do on a day-to-day basis. But when one does need to "whip out the nmap," one wants to look as l33t as humanly possible. Add a "-oS" to any nmap command (such as "nmap -oS - google.com"). Bam. You're now in what is officially known as "[Script Kiddie Mode][1]." Angelina Jolie and Keanu Reeves would be proud. + +![](http://images.techhive.com/images/article/2015/05/slide_08-100587360-orig.png) + +### Getting all Discordian ddate ### + +If you've ever been sitting around thinking, "Hey! I want today's date to be written in an essentially useless, but whimsical, way"…try typing "ddate". Results like "Today is Setting Orange, the 72nd day of Discord in the YOLD 3181," can really spice up your server logs. + +Note: Technically, this is a real thing called the [Discordian Calendar][2], used (in theory) by the followers of [Discordianism][3]. Which means I probably offended somebody. Or maybe not. I'm not really sure. Either way, ddate is a handy tool in any office. + +![](http://images.techhive.com/images/article/2015/05/slide_09-100587361-orig.png) + +### I See Colors Everywhere! ### + +Tired of boring old text? Looking to spruce things up and show the world your true style? lolcat. Install it. Use it. Everywhere. It takes any text input and turns it into a rainbow of wonder and enchantment. Piping text into lolcat (ala "fortune | lolcat") is sure to liven up any party. + +![](http://images.techhive.com/images/article/2015/05/slide_10-100587362-orig.png) + +### The Steam Locomotive ### + +Animated ASCII art steam locomotive in your terminal. You want this. You need this. Install and run "sl". Use "sl -l" for a tiny version. Or, if you want to really spend some time on this, "sl-h". This is the full train, including passenger cars. + +![](http://images.techhive.com/images/article/2015/05/slide_11-100587364-orig.png) + +### Reverse any text ### + +Pipe the output of any text into "rev" and it will reverse the text. "fortune | rev" gives you a fortune. In reverse. Which is, as odd as it may seem, not a misfortune. + +![](http://images.techhive.com/images/article/2015/05/slide_12-100587366-orig.png) + +### The Matrix is still cool, right? ### + +Want your terminal to do that scrolling text, l33t, Matrix-y thing? "cmatrix" is your friend. You can even have it output different colors, which is snazzy. Learn how by typing "man cmatrix". Or, better yet, "man cmatrix | lolcat". Which, really, is the most pointless (but wonderful) thing you can do in the Linux Terminal. So that's where I leave you. + +-------------------------------------------------------------------------------- + +via: http://www.networkworld.com/article/2926630/linux/11-pointless-but-awesome-linux-terminal-tricks.html + +作者:[Bryan Lunduke][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.networkworld.com/author/Bryan-Lunduke/ +[1]:http://nmap.org/book/output-formats-script-kiddie.html +[2]:http://en.wikipedia.org/wiki/Discordian_calendar +[3]:http://en.wikipedia.org/wiki/Discordianism \ No newline at end of file diff --git a/sources/tech/20150528 27 'DNF' Fork of Yum Commands for RPM Package Management in Linux.md b/sources/tech/20150528 27 'DNF' Fork of Yum Commands for RPM Package Management in Linux.md new file mode 100644 index 0000000000..dc81fef219 --- /dev/null +++ b/sources/tech/20150528 27 'DNF' Fork of Yum Commands for RPM Package Management in Linux.md @@ -0,0 +1,287 @@ +27 ‘DNF’ (Fork of Yum) Commands for RPM Package Management in Linux +================================================================================ +DNF aka Dandified YUM is a next generation Package Manager for RPM based Distribution. It was first introduced in Fedora 18 and it is replaced [YUM utility][1] in recent release of Fedora 22. + +![](http://www.tecmint.com/wp-content/uploads/2015/05/linux-dnf-command-examples.jpg) + +DNF aims at improving the bottlenecks of YUM viz., Performance, Memory Usages, Dependency Resolution, Speed and lots of other factors. DNF does Package Management using RPM, libsolv and hawkey library. Though it does not come per-installed in CentOS and RHEL 7 you can yum, dnf and use it alongside the yum. + +You may like to read more about DNF here: + +- [Reasons Behind Replacing Yum with DNF][2] + +The latest stable release of DNF is 1.0 (at the time of writing of post) which was released on May 11, 2015. It (and all previous version of DNF) is mostly written in Python and is released under GPL v2 License. + +### Installation of DNF ### + +DNF in not available in the default repository of RHEL/CentOS 7. However Fedora 22 ships with DNF implemented officially. + +To install DNF on RHEL/CentOS systems, you need to first install and enable epel-release repository. + + # yum install epel-release + OR + # yum install epel-release -y + +Though it is not ethical to use ‘-y‘ with yum as it is recommended to see what is being installed in your system. However if this does not matter you much you may use ‘-y’ with yum to install everything automatically without user’s intervention. + +Next, install DNS package using yum command from epel-release repository. + + # yum install dnf + +After dnf installed successfully, it’s time to show you 27 practical usage of dnf commands with examples that will help you to manage packages in RPM based distribution easily and effectively. + +### 1. Check DNF Version ### + +Check the version of DNF installed on your System. + + # dnf --version + +![Check DNF Version](http://www.tecmint.com/wp-content/uploads/2015/05/Check-DNF-Version.gif) + +### 2. List Enabled DNF Repositories ### + +The option ‘repolist‘ with dnf command, will display all enabled repositories under your system. + + # dnf repolist + +![Check All Enabled Repositories](http://www.tecmint.com/wp-content/uploads/2015/05/Check-All-Enabled-Repositories.gif) + +### 3. List all Enabled and Disabled DNF Repositories ### + +The option ‘repolist all‘ will print all the enabled/disabled repositories under your system. + + # dnf repolist all + +![List All Enabled/Disabled Repositories](http://www.tecmint.com/wp-content/uploads/2015/05/Check-All-Repositories.gif) + +### 4. List all Available and Installed Packages using DNF ### + +The command “dnf list” will list all the available packages from all the repositories and installed packages on your Linux system. + + # dnf list + +![List All Packages using DNF](http://www.tecmint.com/wp-content/uploads/2015/05/List-All-Packages.png) + +### 5. List all Installed Packages using DNF ### + +While the “dnf list” command shows all the available/installed packages from all the repositories. However, you have the option to list only the installed packages using option “list installed” as shown below. + + # dnf list installed + +![List All Installed Packages](http://www.tecmint.com/wp-content/uploads/2015/05/List-Installed-Packages.png) + +### 6. List all Available Packages using DNF ### + +Similarly, the “list available” option, will list all the packages available to be installed from all the enabled repositories. + + # dnf list available + +![List Available Packages using DNF](http://www.tecmint.com/wp-content/uploads/2015/05/List-Available-Packages.png) + +### 7. Search for a Package using DNF ### + +If incase, you’ve no idea about the package that you want install, in such situation you may use ‘search‘ option with dnf command to search for the package that matches the word or string (say nano). + + # dnf search nano + +![Search Package by Word](http://www.tecmint.com/wp-content/uploads/2015/05/Search-Package.gif) + +### 8. See what Provides a file/sub-package? ### + +The dnf option “provides” find the name of the package that provides specific file/sub-package. For example, if you would like to find what provides ‘/bin/bash‘ on your system? + + # dnf provides /bin/bash + +![Find File Sub Package](http://www.tecmint.com/wp-content/uploads/2015/05/Find-Package-Sub-Package.gif) + +### 9. Get Details of a Package using DNF ### + +Let’s assume you want to know the information of a package before installing it on the system, you may use “info” switch to get a detailed information about a package (say nano) as below. + + # dnf info nano + +![Check Package Information with DNF](http://www.tecmint.com/wp-content/uploads/2015/05/Check-Package-Information.gif) + +### 10. Install a Package with DNF ### + +To install a package called nano, just run the below command it will automatically resolve and install all required dependencies for package nano. + + # dnf install nano + +![Install Package using DNF](http://www.tecmint.com/wp-content/uploads/2015/05/Install-Package-DNF.gif) + +### 11. Updating a Package using DNF ### + +You may update only a specific package (say systemd) and leave everything on the system untouched. + + # dnf update systemd + +![Update a Specific Package](http://www.tecmint.com/wp-content/uploads/2015/05/Update-a-Package.gif) + +### 12. Check for System Updates using DNF ### + +Check updates for all the system packages installed into the system simply as. + + # dnf check-update + +![Check For System Update](http://www.tecmint.com/wp-content/uploads/2015/05/Check-For-System-Update.gif) + +### 13. Update All System Packages using DNF ### + +You may update the whole system including all the installed packages with following commands. + + # dnf update + OR + # dnf upgrade + +![Update System](http://www.tecmint.com/wp-content/uploads/2015/05/Update-System.gif) + +### 14. Remove/Erase a Package using DNF ### + +To remove or erase any unwanted package (say nano), you may use “remove” or “erase” switch with dnf command to remove it. + + # dnf remove nano + OR + # dnf erase nano + +![Remove Package in Linux](http://www.tecmint.com/wp-content/uploads/2015/05/Remove-Package.gif) + +### 15. Remove Orphan Packages using DNF ### + +Those packages that were installed to satisfy dependency may be useless if not being used by other applications. To remove those orphan packages execute the below command. + + # dnf autoremove + +![Remove Orphan Packages](http://www.tecmint.com/wp-content/uploads/2015/05/Autoremove-Packages.gif) + +### 16. Remove Cached Packages using DNF ### + +A lot of time we encounter out-of-date headers and unfinished transactions which results into error while executing dnf. We may clean all the cached packages and headers containing remote package information simply by executing. + + # dnf clean all + +![Remove DNF Cache](http://www.tecmint.com/wp-content/uploads/2015/05/Remove-Cache-Packages.gif) + +### 17. Get Help on Specific DNF Command ### + +You may get help of any specific dnf command (say clean) just by executing the below command. + + # dnf help clean + +![Get DNF Command Help](http://www.tecmint.com/wp-content/uploads/2015/05/Help-on-DNF-Command.gif) + +### 18. List all DNF Commands and Options ### + +To list help on all available dnf commands and option simply type. + + # dnf help + +![Get Help on DNF Options](http://www.tecmint.com/wp-content/uploads/2015/05/DNF-Options.gif) + +### 19. View History of DNF ### + +You may call dnf history to look at the list of already executed dnf commands. This way you can be aware of what was installed/removed with time stamp. + + # dnf history + +![Check DNF History](http://www.tecmint.com/wp-content/uploads/2015/05/Check-DNF-History.gif) + +### 20. List all Group Packages ### + +The command “dnf grouplist” will print all available or installed packages, if nothing is mentioned, it will list all known groups. + + # dnf grouplist + +![List All Group Packages](http://www.tecmint.com/wp-content/uploads/2015/05/List-All-Group-Packages.gif) + +### 21. Install a Group Package using DNF ### + +To install a Group of packages bundled together as group package (say Educational Software) simply as. + + # dnf groupinstall 'Educational Software' + +![Install Group Packages](http://www.tecmint.com/wp-content/uploads/2015/05/Install-Group-Packages.gif) + +### 22. Update a Group Package ### + +Let’s update a Group Package (say Educational Software) by executing the below command. + + # dnf groupupdate 'Educational Software' + +![Update Group Package](http://www.tecmint.com/wp-content/uploads/2015/05/Update-Group-Package.gif) + +### 23. Remove a Group Package ### + +We can remove the group Package (say Educational Software) as. + + # dnf groupremove 'Educational Software' + +![Remove Group Package](http://www.tecmint.com/wp-content/uploads/2015/05/Remove-Group-Package.gif) + +### 24. Install a Package from Specific Repository ### + +DNF makes it possible to install any specific package (say phpmyadmin) from a repo (epel) as simply as, + + # dnf --enablerepo=epel install phpmyadmin + +![Install Package From Specific Repo](http://www.tecmint.com/wp-content/uploads/2015/05/Install-Package-From-Specific-Repo.gif) + +### 25. Synchronize Installed Packages to Stable Release ### + +The command “dnf distro-sync” will provides necessary options to synchronize all installed packages to most recent stable version available from any enabled repository. If no package is selected, all installed packages are synchronized. + + # dnf distro-sync + +![Synchronize Packages to Stable Version](http://www.tecmint.com/wp-content/uploads/2015/05/Synchronize-Packages.gif) + +### 26. Reinstall a Package ### + +The command “dnf reinstall nano” will reinstall an already installed package (say nano). + + # dnf reinstall nano + +![ReInstall Package](http://www.tecmint.com/wp-content/uploads/2015/05/Re-Install-Package.gif) + +### 27. Downgrade a Package ### + +The option “downgrade” will downgrades the named package (say acpid) to lower version if possible. + + # dnf downgrade acpid + +Sample Output + + Using metadata from Wed May 20 12:44:59 2015 + No match for available package: acpid-2.0.19-5.el7.x86_64 + Error: Nothing to do. + +**My observation**: DNF does not downgraded the package as it is supposed to. It has also been reported as bug. + +### Conclusion ### + +DNF is the upper state of the end of the art Package Manager YUM. It tends to do a lot of processing automatically which is not going to be praised by many experienced Linux System Administrator, as I believe. As a matter of example: + +- `--skip-broken` is not recognized by DNF and there is no alternative. +- There is nothing like ‘resolvedep‘ command however you may run dnf provides. +- There is no ‘deplist‘ command to find package dependency. +- You exclude a repo, means the exclusion apply on all operations, unlike yum which excludes those repos only at the time of install and updates, etc. + +Several Linux users are not happy the way Linux Ecosystem is moving. First [Systemd removed init system][3] v and now DNF will be replacing YUM sooner in Fedora 22 and later in RHEL and CentOS. + +What do you think? are distributions and the whole Linux ecosystem is not valuing it’s users and moving against their will. Also it is often said in IT industry – “Why fix, If not broken?”, and neither init System V is broken nor YUM. + +That’s all for now. Please let me know your valuable thoughts in the comments below. Like and share us and help us get spread. + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/dnf-commands-for-fedora-rpm-package-management/ + +作者:[Avishek Kumar][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/avishek/ +[1]:http://www.tecmint.com/20-linux-yum-yellowdog-updater-modified-commands-for-package-mangement/ +[2]:http://www.tecmint.com/dnf-next-generation-package-management-utility-for-linux/ +[3]:http://www.tecmint.com/systemd-replaces-init-in-linux/ \ No newline at end of file diff --git a/sources/tech/20150528 Things To Do After Installing Fedora 22.md b/sources/tech/20150528 Things To Do After Installing Fedora 22.md new file mode 100644 index 0000000000..27b37f86ee --- /dev/null +++ b/sources/tech/20150528 Things To Do After Installing Fedora 22.md @@ -0,0 +1,114 @@ +Things To Do After Installing Fedora 22 +================================================================================ +Fedora 22 the latest entrant in the community developed line of Red hat operating systems is released on the 26th of May 2015. A lot of speculation and anticipation has been associated with this release of the venerable fedora. Well there are some major changes that are being proposed for Fedora 22. + +Systemd is the new kid in the block when it comes to initialization daemons, it is poised to replace the venerable sysvinit module that has long been a part of the Linux ecosystem. Another major change that users will come across in the base python version. Its just that python in available in two different flavors the 2.x and 3.x lines. Each has its fair share of quirks and benefits. So users who might prefer the 2.x flavor might want to install their favorite python. The dandified Yum installer that has been around since Fedora 18 is all set to replace the age old YUM installer. Fedora has finally decided that it is time that DNF replace YUM. + +### 1) Install VLC media player ### + +Fedora 22 comes with a default media player viz. gnome videos (previously known as totem). If that is fine by you we can skip this step and move ahead. However if you like me prefer the most widely used VLC you can go ahead and install it from the RPMFusion repos. You can do that with : + + sudo dnf install vlc -y + +### 2) Configure RPMFusion Repos ### + +As I already mentioned Fedora is very strict with its ideologies, it does not ship with any non-free components with it. The official repositories does not provide some essential software containing non-free components like multimedia codes. So it is necessary to install some 3rd party repositories which will provide us some essential software. Luckily RPMFusion repositories come to the rescue. + + $ sudo dnf install --nogpgcheck http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-22.noarch.rpm + +### 3) Install Multimedia Codecs ### + +As is said some multimedia codecs and plugins don't ship with fedora. Now who would like to miss out on their favorite shows and movies just because the codes are proprietary. Try this: + + $ sudo dnf install gstreamer-plugins-bad gstreamer-plugins-bad-free-extras gstreamer-plugins-ugly gstreamer-ffmpeg gstreamer1-libav gstreamer1-plugins-bad-free-extras gstreamer1-plugins-bad-freeworld gstreamer-plugins-base-tools gstreamer1-plugins-good-extras gstreamer1-plugins-ugly gstreamer1-plugins-bad-free gstreamer1-plugins-good gstreamer1-plugins-base gstreamer1 + +### 4) Update your system ### + +Fedora is a bleeding edge distribution and hence it releases updates which will fix bugs and loopholes present in your system continuously. Hence it is a good practice to keep your system up to date. + + $ sudo dnf update -y + +### 5) Uninstall software you may not need ### + +Fedora comes with a set of pre-chosen packages that most users can utilize, however for more advanced users, you may recognize that you do not need all of it. It's easy enough to remove any packages you don't need using the following command - I chose to uninstall rhythmbox because I know I won't use it: + + $ sudo dnf remove rhythmbox + +### 6) Install Adobe Flash ### + +We all wish Adobe Flash didn't exist anymore since it is not always know for being the most secure or resource efficient, but for awhile it's here to stay. The only way to install Adobe Flash for Fedora 22 is to install the official RPM from Adobe, as shown below. + +You can download the RPM [here][1]. After downloading the file, you can right click and open it like this: + +![Install Adobe Flash](http://blog.linoxide.com/wp-content/uploads/2015/05/Screen-Shot-2015-05-27-at-9.50.42-PM.png) + +Right click and select "Open With Software Install" + +Then, simply click install on the window that pops up: + +![Install Adobe](http://blog.linoxide.com/wp-content/uploads/2015/05/Screen-Shot-2015-05-27-at-9.51.07-PM.png) + +Click on "Install" to complete the process of installing the custom RPM from Adobe + +Once the process completes, the "Install" button will change to "Remove" and the installation should have finished. If your browser is open during the process, it may ask you to close it first or restart it after the install for the changes to take effect. + +### 7) Spin Up a VM with Gnome Boxes ### + +So you just installed Fedora and you're loving it, but maybe you need Windows still for something proprietary, or maybe you just want to play with another Linux distro. In any situation, you can use Gnome Boxes, provided with Fedora 22, to easily create a VM or use a live distribution. Follow the steps below to get started using an ISO of your choice! Who knows, maybe you can even check out a [Fedora Spin][2]. + +First open Gnome Boxes and select "New" in the top left: + +![Add a new virtual machine (box)](http://blog.linoxide.com/wp-content/uploads/2015/05/Screen-Shot-2015-05-27-at-10.24.46-PM.png) + +Click "New" to start the process of adding a new virtual machine. + +Next, click to open a file and choose an ISO: + +![Choose ISO](http://blog.linoxide.com/wp-content/uploads/2015/05/Screen-Shot-2015-05-27-at-10.28.44-PM.png) + +After choosing to select a file or ISO, select your ISO. In this case, I had a Debian ISO I installed + +Finally, customize the VM settings or use the defaults and click "Create." The VM will start by default and the available VMs will be available in Gnome Boxes as little thumbnails. + +![Create VM](http://blog.linoxide.com/wp-content/uploads/2015/05/Screen-Shot-2015-05-27-at-10.31.11-PM.png) + +Customize the settings to whatever you choose, or keep the defaults. Click "Create" when you are done and the VM will be ready to go. + +### 8) Install Google Chrome ### + +Firefox is included with Fedora 22, but as with most software, everyone has their browser of choice. If yours happens to be Google Chrome, you can follow the instructions above for Adobe Flash player, however, obviously use the RPM from Google for whichever version of Chrome you download. The latest version can usually be found [here][3]. + +### 9) Add Social Media and Other Online Accounts ### + +Gnome has some nice built in functionality to accommodate accounts for things like Facebook, Google, and other online accounts. You can access the Online Accounts settings through the main Gnome Settings application. You can access the settings by right clicking on the desktop or by finding it in the applications. Then, simply click on Online Accounts and add the accounts of your choosing. If you add an account like Google, for example, you can use it as the default for things like sending email, calendar appointments, interacting with photos and documents, and more. + +### 10) Install KDE or another Desktop Environment ### + +Some of us just don't like Gnome, and that's okay. Run the following command in Terminal to install everything necessary to use KDE instead. The same instructions can be applied to xfce, lxde, or other desktop environments as well. + + $ sudo dnf install @kde-desktop + +After the install finishes, log out. When you click on your username, notice the little gear wheel that indicates settings. Click it and select "Plasma." When you log in again, you will be greeted by a fresh KDE desktop. + +![Plasma on Fedora 22](http://blog.linoxide.com/wp-content/uploads/2015/05/Screen-Shot-2015-05-27-at-11.32.27-PM.png) + +The Plasma environment after just installing it on Fedora 22 + +### Conclusion ### + +That’s it you are all set to go. Use the system and try out things. If you don't find something according to your liking, linux gives you the freedom to change them. Fedora comes with the latest Gnome shell as its desktop environment, too heavy for you and don't like it. Try KDE or some light weight DE like cinnamon, xfce etc. Wish you a very happy and hassle free Fedora experience. !! + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/linux-how-to/things-do-after-installing-fedora-22/ + +作者:[Jonathan DeMasi][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://linoxide.com/author/jonathande/ +[1]:https://get.adobe.com/flashplayer/ +[2]:http://spins.fedoraproject.org/ +[3]:https://www.google.com/intl/en/chrome/browser/desktop/index.html \ No newline at end of file From 2f85a93f0944070b9a16017470e0d1d2835d2965 Mon Sep 17 00:00:00 2001 From: ZTinoZ Date: Thu, 28 May 2015 18:01:24 +0800 Subject: [PATCH 196/965] Translating by ZTinoZ --- sources/tech/20150526 20 Useful Terminal Emulators for Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20150526 20 Useful Terminal Emulators for Linux.md b/sources/tech/20150526 20 Useful Terminal Emulators for Linux.md index a77c665426..9103f53b4d 100644 --- a/sources/tech/20150526 20 Useful Terminal Emulators for Linux.md +++ b/sources/tech/20150526 20 Useful Terminal Emulators for Linux.md @@ -1,7 +1,7 @@ Translating by ZTinoZ 20款优秀的Linux终端仿真器 ================================================================================ -A Terminal emulator is a computer program that reproduces a video terminal within some other display structure. In other words the Terminal emulator has an ability to make a dumb machine appear like a client computer networked to the server. The terminal emulator allows an end user to access console as well as its applications such as text user interface and command line interface. +终端仿真器是一款计算机程序A Terminal emulator is a computer program that reproduces a video terminal within some other display structure. In other words the Terminal emulator has an ability to make a dumb machine appear like a client computer networked to the server. The terminal emulator allows an end user to access console as well as its applications such as text user interface and command line interface. ![Linux Terminal Emulators](http://www.tecmint.com/wp-content/uploads/2014/01/Linux-Terminal-Emulators1.jpeg) From 1b0ba05412dedf874452d1e51704cc8c98c4f398 Mon Sep 17 00:00:00 2001 From: alim0x Date: Thu, 28 May 2015 20:43:56 +0800 Subject: [PATCH 197/965] [translating]20150527 Ubuntu Community Council... --- ...ty Council Asks the Kubuntu Project Leader to Step Down.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/news/20150527 Ubuntu Community Council Asks the Kubuntu Project Leader to Step Down.md b/sources/news/20150527 Ubuntu Community Council Asks the Kubuntu Project Leader to Step Down.md index bdb44591fc..fc60386ae5 100644 --- a/sources/news/20150527 Ubuntu Community Council Asks the Kubuntu Project Leader to Step Down.md +++ b/sources/news/20150527 Ubuntu Community Council Asks the Kubuntu Project Leader to Step Down.md @@ -1,3 +1,5 @@ +alim0x translating + Ubuntu Community Council Asks the Kubuntu Project Leader to Step Down ================================================================================ > Jonathan Riddell refuses to step down as Kubuntu leader @@ -30,4 +32,4 @@ via: http://news.softpedia.com/news/Ubuntu-Community-Council-Asks-the-Kubuntu-Pr [a]:http://news.softpedia.com/editors/browse/marius-nestor [1]:https://skitterman.wordpress.com/ -[2]:http://jriddell.org/ \ No newline at end of file +[2]:http://jriddell.org/ From a47f588c4e5eaebd9feb959bfa40f657f2f7462e Mon Sep 17 00:00:00 2001 From: alim0x Date: Thu, 28 May 2015 22:17:59 +0800 Subject: [PATCH 198/965] [translated]20150527 Ubuntu Community Council... --- ...the Kubuntu Project Leader to Step Down.md | 35 ------------------- ...the Kubuntu Project Leader to Step Down.md | 33 +++++++++++++++++ 2 files changed, 33 insertions(+), 35 deletions(-) delete mode 100644 sources/news/20150527 Ubuntu Community Council Asks the Kubuntu Project Leader to Step Down.md create mode 100644 translated/news/20150527 Ubuntu Community Council Asks the Kubuntu Project Leader to Step Down.md diff --git a/sources/news/20150527 Ubuntu Community Council Asks the Kubuntu Project Leader to Step Down.md b/sources/news/20150527 Ubuntu Community Council Asks the Kubuntu Project Leader to Step Down.md deleted file mode 100644 index fc60386ae5..0000000000 --- a/sources/news/20150527 Ubuntu Community Council Asks the Kubuntu Project Leader to Step Down.md +++ /dev/null @@ -1,35 +0,0 @@ -alim0x translating - -Ubuntu Community Council Asks the Kubuntu Project Leader to Step Down -================================================================================ -> Jonathan Riddell refuses to step down as Kubuntu leader - -![](http://i1-news.softpedia-static.com/images/news2/Ubuntu-Community-Council-Asks-the-Kubuntu-Project-Leader-to-Step-Down-482384-2.jpg) - -**So this just happened. Scott Kitterman, a Debian developer and member of the Kubuntu Council, decided to make public some emails where it would appear that members of the Ubuntu Community Council asks Jonathan Riddell to step down from his position as a Kubuntu Project leader.** - -Jonathan Riddell, which is both a KDE and Kubuntu developer, as well as an important member of the Ubuntu community for many years now, is being accused by several members of the Ubuntu and Kubuntu community about his confrontational and aggressive behavior towards them, as [the email exchanges exposed today][1] by Scott Kitterman suggest. - -Long story short, after several email exchanges, the final decision of the Ubuntu Community Council, which is also backed by Canonical and Ubuntu founder Mark Shuttleworth, was for Jonathan Riddell to step down from all his positions as a leader within the Ubuntu and Kubuntu communities, for at least 12 months, but still being able to participate to discussions as any other member. - -"It is with regret that we write this email to discuss an issue that we feel is negatively impacting the Ubuntu Community. Over a long period of time Jonathan Riddell has become increasingly difficult to deal with. Jonathan raised valid issues and concerns, but reacted poorly when he received answers he did not agree with," reads the first email send to the Ubuntu Community Council regarding the "nasty" behavior of Jonathan Riddell. - -### Jonathan Riddell refuses to step down as a Kubuntu Project leader ### - -From the email exchanges exposed today by Scott Kitterman, who decided to write a second post on his blog, suggesting that he wants to resign from its position in the Ubuntu and Kubuntu community, it would appear that Jonathan Riddell refused to step down as a Kubuntu Project leader. - -As expected, Jonathan Riddell is being backed by members of the Kubuntu Community Council, who fired back at the Ubuntu Community Council's decision to take down the Kubuntu Project leader. "I’d like to thank all the Kubuntu members who just voted to re-affirm me on the Kubuntu Council," says Jonathan Riddell on [his blog][2]. - --------------------------------------------------------------------------------- - -via: http://news.softpedia.com/news/Ubuntu-Community-Council-Asks-the-Kubuntu-Project-Leader-to-Step-Down-482384.shtml - -作者:[Marius Nestor][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://news.softpedia.com/editors/browse/marius-nestor -[1]:https://skitterman.wordpress.com/ -[2]:http://jriddell.org/ diff --git a/translated/news/20150527 Ubuntu Community Council Asks the Kubuntu Project Leader to Step Down.md b/translated/news/20150527 Ubuntu Community Council Asks the Kubuntu Project Leader to Step Down.md new file mode 100644 index 0000000000..cb29a1e815 --- /dev/null +++ b/translated/news/20150527 Ubuntu Community Council Asks the Kubuntu Project Leader to Step Down.md @@ -0,0 +1,33 @@ +Ubuntu社区委员会要求Kubuntu项目领导人下台 +================================================================================ +> Jonathan Riddell拒绝从Kubuntu领导人位置退出 + +![](http://i1-news.softpedia-static.com/images/news2/Ubuntu-Community-Council-Asks-the-Kubuntu-Project-Leader-to-Step-Down-482384-2.jpg) + +**这一切刚刚发生。Scott Kitterman,一名Debian开发者以及Kubuntu委员会成员,决定公开一些电子邮件,邮件披露了Ubuntu社区委员会成员要求Jonathan Riddell从Kubuntu项目领导人位置退出。** + +Jonathan Riddell是KDE以及Kubuntu的一名开发者,多年来也是Ubuntu社区的一名重要成员。从Scott Kitterman[今天曝光的社区邮件往来][1]中来看,他被指责对Ubuntu以及Kubuntu社区的一些成员有对抗性和侵略性的行为。 + +长话短说,经过多轮邮件往来之后,Ubuntu社区委员会的最终决定是让Jonathan Riddell退出他在Ubuntu以及Kubuntu社区的领导人位置至少12个月,但仍可以像其他成员一样参与讨论。这个决定同时也得到了Canonical和Ubuntu创始人Mark Shuttleworth的支持。 + +“很遗憾写下了讨论这个我们觉得对Ubuntu社区有着消极影响的问题的邮件。长期以来,Jonathan Riddell变得越来越难以交往。Jonathan提出正当的问题及关切,但当收到他不赞同的答案时反应就不那么让人愉快了。”在发给Ubuntu社区委员会的认为Jonathan Riddell行为“不友好”的邮件中这么写道。 + +### Jonathan Riddell拒绝从Kubuntu领导人位置退出 ### + +今天Scott Kitterman披露了邮件往来,并决定在博客上写第二篇博文,表明了他想从他在Ubuntu和Kubuntu的位置退出,这表明Jonathan Riddell可能拒绝从Kubuntu领导人位置退出。 + +正如预料之中,Kubuntu社区委员会的成员们支持Jonathan Riddell,并且回击了Ubuntu社区委员会罢免Kubuntu项目领导人的决定。Jonathan Riddell在[他的博客][2]上写道:“我要感谢所有在Kubuntu委员会投票再次肯定我的Kubuntu成员。” + +-------------------------------------------------------------------------------- + +via: http://news.softpedia.com/news/Ubuntu-Community-Council-Asks-the-Kubuntu-Project-Leader-to-Step-Down-482384.shtml + +作者:[Marius Nestor][a] +译者:[alim0x](https://github.com/alim0x) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://news.softpedia.com/editors/browse/marius-nestor +[1]:https://skitterman.wordpress.com/ +[2]:http://jriddell.org/ From 30e18aebe81455df5a48fdde4a31510b49f5a5da Mon Sep 17 00:00:00 2001 From: wxy Date: Fri, 29 May 2015 06:25:58 +0800 Subject: [PATCH 199/965] PUB:20150527 Ubuntu Community Council Asks the Kubuntu Project Leader to Step Down @alim0x --- ...the Kubuntu Project Leader to Step Down.md | 33 +++++++++++++++++++ ...the Kubuntu Project Leader to Step Down.md | 33 ------------------- 2 files changed, 33 insertions(+), 33 deletions(-) create mode 100644 published/20150527 Ubuntu Community Council Asks the Kubuntu Project Leader to Step Down.md delete mode 100644 translated/news/20150527 Ubuntu Community Council Asks the Kubuntu Project Leader to Step Down.md diff --git a/published/20150527 Ubuntu Community Council Asks the Kubuntu Project Leader to Step Down.md b/published/20150527 Ubuntu Community Council Asks the Kubuntu Project Leader to Step Down.md new file mode 100644 index 0000000000..a47014fc9b --- /dev/null +++ b/published/20150527 Ubuntu Community Council Asks the Kubuntu Project Leader to Step Down.md @@ -0,0 +1,33 @@ +Ubuntu 社区委员会要求 Kubuntu 项目领导人下台 +================================================================================ +> 而Jonathan Riddell拒绝从Kubuntu领导人位置退出 + +![](http://i1-news.softpedia-static.com/images/news2/Ubuntu-Community-Council-Asks-the-Kubuntu-Project-Leader-to-Step-Down-482384-2.jpg) + +**这一切刚刚发生。一名Debian开发者以及Kubuntu委员会成员 Scott Kitterman 决定公开一些电子邮件,邮件披露了Ubuntu 社区委员会成员要求 Jonathan Riddell 从 Kubuntu 项目领导人位置退出的过程。** + +Jonathan Riddell 是 KDE 以及 Kubuntu 的一名开发者,多年来也是 Ubuntu 社区的一名重要成员。从 Scott Kitterman [今天曝光的社区邮件往来][1]中来看,Jonathan Riddell 被指责对 Ubuntu 以及 Kubuntu 社区的一些成员咄咄逼人和挑衅。 + +长话短说,经过多轮邮件往来之后,Ubuntu 社区委员会的最终决定是让 Jonathan Riddell 退出他在 Ubuntu 以及Kubuntu 社区的领导人位置至少12个月,但仍可以像其他成员一样参与讨论。这个决定同时也得到了 Canonical 和Ubuntu 的创始人 Mark Shuttleworth 的支持。 + +“很遗憾写下了讨论这个我们觉得对 Ubuntu 社区有着消极影响的问题的邮件。长期以来,Jonathan Riddell 变得越来越难以交往。Jonathan 提出了有效的问题及关注,但当收到他不赞同的答案时,他的反应就不那么让人愉快了。”在 Ubuntu 社区委员会发出的第一封认为 Jonathan Riddell 行为“不友好”的邮件中这么写道。 + +### Jonathan Riddell拒绝从Kubuntu领导人位置退出 ### + +从今天 Scott Kitterman 披露邮件往来,并决定在博客上写第二篇博文来看,表明了他想从他在 Ubuntu 和 Kubuntu 的位置退出,这表明 Jonathan Riddell 可能拒绝从 Kubuntu 领导人位置退出。 + +正如预料之中,Kubuntu 社区委员会的成员们支持 Jonathan Riddell,并且回击了 Ubuntu 社区委员会罢免 Kubuntu 项目领导人的决定。“我要感谢所有在 Kubuntu 委员会投票再次肯定我的 Kubuntu 成员。”,Jonathan Riddell 在[他的博客][2]上写道,“希望 Kubuntu 能够继续走下去,我也计划和我深爱的社区伙伴们一起为 15.10 发布而努力。” + +-------------------------------------------------------------------------------- + +via: http://news.softpedia.com/news/Ubuntu-Community-Council-Asks-the-Kubuntu-Project-Leader-to-Step-Down-482384.shtml + +作者:[Marius Nestor][a] +译者:[alim0x](https://github.com/alim0x) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://news.softpedia.com/editors/browse/marius-nestor +[1]:https://skitterman.wordpress.com/ +[2]:http://jriddell.org/ diff --git a/translated/news/20150527 Ubuntu Community Council Asks the Kubuntu Project Leader to Step Down.md b/translated/news/20150527 Ubuntu Community Council Asks the Kubuntu Project Leader to Step Down.md deleted file mode 100644 index cb29a1e815..0000000000 --- a/translated/news/20150527 Ubuntu Community Council Asks the Kubuntu Project Leader to Step Down.md +++ /dev/null @@ -1,33 +0,0 @@ -Ubuntu社区委员会要求Kubuntu项目领导人下台 -================================================================================ -> Jonathan Riddell拒绝从Kubuntu领导人位置退出 - -![](http://i1-news.softpedia-static.com/images/news2/Ubuntu-Community-Council-Asks-the-Kubuntu-Project-Leader-to-Step-Down-482384-2.jpg) - -**这一切刚刚发生。Scott Kitterman,一名Debian开发者以及Kubuntu委员会成员,决定公开一些电子邮件,邮件披露了Ubuntu社区委员会成员要求Jonathan Riddell从Kubuntu项目领导人位置退出。** - -Jonathan Riddell是KDE以及Kubuntu的一名开发者,多年来也是Ubuntu社区的一名重要成员。从Scott Kitterman[今天曝光的社区邮件往来][1]中来看,他被指责对Ubuntu以及Kubuntu社区的一些成员有对抗性和侵略性的行为。 - -长话短说,经过多轮邮件往来之后,Ubuntu社区委员会的最终决定是让Jonathan Riddell退出他在Ubuntu以及Kubuntu社区的领导人位置至少12个月,但仍可以像其他成员一样参与讨论。这个决定同时也得到了Canonical和Ubuntu创始人Mark Shuttleworth的支持。 - -“很遗憾写下了讨论这个我们觉得对Ubuntu社区有着消极影响的问题的邮件。长期以来,Jonathan Riddell变得越来越难以交往。Jonathan提出正当的问题及关切,但当收到他不赞同的答案时反应就不那么让人愉快了。”在发给Ubuntu社区委员会的认为Jonathan Riddell行为“不友好”的邮件中这么写道。 - -### Jonathan Riddell拒绝从Kubuntu领导人位置退出 ### - -今天Scott Kitterman披露了邮件往来,并决定在博客上写第二篇博文,表明了他想从他在Ubuntu和Kubuntu的位置退出,这表明Jonathan Riddell可能拒绝从Kubuntu领导人位置退出。 - -正如预料之中,Kubuntu社区委员会的成员们支持Jonathan Riddell,并且回击了Ubuntu社区委员会罢免Kubuntu项目领导人的决定。Jonathan Riddell在[他的博客][2]上写道:“我要感谢所有在Kubuntu委员会投票再次肯定我的Kubuntu成员。” - --------------------------------------------------------------------------------- - -via: http://news.softpedia.com/news/Ubuntu-Community-Council-Asks-the-Kubuntu-Project-Leader-to-Step-Down-482384.shtml - -作者:[Marius Nestor][a] -译者:[alim0x](https://github.com/alim0x) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://news.softpedia.com/editors/browse/marius-nestor -[1]:https://skitterman.wordpress.com/ -[2]:http://jriddell.org/ From b2863934258d63e14badcc40269dded1a033b0c6 Mon Sep 17 00:00:00 2001 From: wwy-hust Date: Fri, 29 May 2015 12:37:47 +0800 Subject: [PATCH 200/965] finish translation --- sources/talk/20150310 FAQ--BSD.md | 83 ---------------------------- translated/talk/20150310 FAQ--BSD.md | 75 +++++++++++++++++++++++++ 2 files changed, 75 insertions(+), 83 deletions(-) delete mode 100644 sources/talk/20150310 FAQ--BSD.md create mode 100644 translated/talk/20150310 FAQ--BSD.md diff --git a/sources/talk/20150310 FAQ--BSD.md b/sources/talk/20150310 FAQ--BSD.md deleted file mode 100644 index 65357e9559..0000000000 --- a/sources/talk/20150310 FAQ--BSD.md +++ /dev/null @@ -1,83 +0,0 @@ -translating by wwy-hust - -FAQ: BSD -================================================================================ -![](http://www.linuxvoice.com/wp-content/uploads/2015/02/faq1-large1.png) - -### Had history been slightly different, you’d be reading FreeBSD Voice today… ### - -#### So what’s the deal with this Birsa Seva Dal then? Isn’t it a political group in India? #### - -Very funny – you looked up the “BSD” disambiguation page on Wikipedia just to make that joke, didn’t you? Here we’re talking about the Berkeley Software Distribution, a family of operating systems that are much more widely used than you might think. - -#### Sorry, I couldn’t help myself. OK, so what’s the deal with these OSes? #### - -There are three main BSD operating systems in use today. They are based on Unix, they are open source, they tend to be used in server roles, but can also make good desktops and workstations as well. They run KDE, Firefox, LibreOffice, Apache, MySQL and pretty much any open source application you can name. They’re reliable, secure and support a lot of different hardware. - -#### Congratulations – you’ve just described GNU/Linux… #### - -True. Linux has all of the things I’ve just mentioned, and that’s why a lot of people never investigate BSD. In day-to-day usage, there isn’t a lot of difference between the BSD family and Linux, largely because they all have Unix underpinnings, and also because they share a lot of software. You could be logged into a remote machine, hacking some Python code in Vim, and checking your email in Mutt, and you wouldn’t know you were running BSD. Or you could be using an internet terminal in a cafe somewhere and not know it’s BSD. - -The biggest differences are in the development model and licence, and to understand this, we need to step back in time. The B in BSD refers to the University of California, Berkeley, which was a hotbed of open source Unix development back in the 1980s. As the 90s came, x86-based PCs were becoming popular and many people were interested in having a Unix-like OS on their home computers. A project called 386BSD was released in 1992 to provide just that. - -#### And where were all the Linux distributions at this time? #### - -Good question! You might know that one year before, Linus Torvalds had announced his kernel, which, when paired with the GNU project, formed a complete open source operating system. Linus had been following GNU’s own kernel (Hurd) and 386BSD, and said that had either of them been ready for daily use, he probably wouldn’t have created Linux. So the first few years of the 90s were tremendously lively for open source operating systems, and nobody was really sure which ones would succeed. - -Then it got messy for BSD. AT&T, the original developer of Unix, was trying to monetise its work on the operating system and claimed that BSD infringed its intellectual property rights. This culminated in a lawsuit in 1992 which severely held back BSD development. In the end, various chunks of the BSD source code had to be rewritten – while all this time, GNU/Linux was gaining features, stability and popularity. - -BSD was arguably in a more mature state than GNU/Linux in the early 1990s, and without these legal complications it could have become the standard on x86 PCs. We could all be using it today instead of Linux. - -#### But you said earlier that BSD is still widely used, so things improved after that? #### - -Yes. 386BSD development stagnated, but two teams of developers working over the internet created separate successor projects. FreeBSD became the most widely used flavour of BSD, and is now the closest to Linux as a desktop and server operating system, while NetBSD focused on portability (today it runs on over 50 platforms, all built from the same codebase). The third flavour, OpenBSD, forked off from NetBSD just a few years after NetBSD started due to a developer spat, and today it’s well known for its concentration on security. Over the years, OpenBSD has created many programs that have become standard on Linux, such as OpenSSH – and now we have LibreSSL too. - -#### So these three flavours of BSD are like Linux distributions? #### - -Yes and no. Each BSD has a separate codebase and separate development teams, although there is a lot of code-flow between them (especially for hardware drivers). But they are standalone operating systems with their own features, pros and cons. - -We mentioned that the development model of the BSDs is one feature that really distinguishes them from GNU/Linux. There’s nobody in charge of GNU/Linux as a whole: some teams are working on the GNU components, some are working on the kernel, some on boot scripts, some on manual pages, some on libraries, and so forth. The development model is often called “wild west”, with a lack of central authority, and distributions do all the hard work of fitting everything together. - -The BSDs, in contrast, are developed as complete projects from centralised source code trees. The kernel, the libraries, the system utilities and the manual pages are all stored and worked on in the same place. Many BSD fans argue that this gives the operating systems more coherency and stability, and from our years of dabbling with BSD we can attest that the manual pages are largely superb. - -![](http://www.linuxvoice.com/wp-content/uploads/2015/02/faq2-large1.png) - -#### Don’t the BSDs use anything from GNU/Linux? #### - -Yes, especially GCC. The GNU Compiler Collection has been the de-facto standard compiler on free Unix systems for decades, although FreeBSD has recently moved to LLVM/Clang. It’s important to note that the BSDs also use other open source projects that aren’t specifically GNU or Linux, such as the X Window System (XFree86 and X.org), Perl and so forth. And thanks to standards such as POSIX, most programs that run on Linux can be recompiled to run on the various BSD flavours. - -So, you could replace the L in a LAMP (Linux, Apache, MySQL and PHP) stack with FreeBSD, and get pretty much the same environment, with a different set of features (eg variations in filesystem and driver support). And there are some mega, super, huge users of FreeBSD, such as Netflix, which serve up ridiculous amounts of data every day. While FreeBSD makes a good desktop OS, its strengths really lie in the server room, with exceptional reliability and network performance. - -OpenBSD tends to be used in smaller web serving, file hosting, firewall and gateway roles where security is imperative. NetBSD is the least popular of the main BSD flavours – it can run on almost anything though, including old Amigas and Acorn boxes, and sometimes finds itself inside closed-source network devices. - -#### Hang on – how can someone close the source code? That ain’t kosher in Linux! #### - -Correct, and here we come to the other major difference with GNU/Linux. The licence for the BSD flavours (called, funnily enough, the BSD Licence) is very different to the GPL that we know. For starters, it’s much shorter. The BSD Licence essentially says: do what you want with this code, but give the original developers credit for writing it, and don’t try to sue them if it blows up your computer. - -So there’s nothing in the licence that forces the code to stay open, unlike with the GPL, which requires that users of the code also make their modifications freely available. This crucial difference has sparked countless flame wars over the years, with BSD fans saying that their licence is more free (because it’s less restrictive), while GNU/GPL fans say that their licence is actually more free (because it preserves freedom down the road). - -#### Blimey. Anyway, now that you’ve piqued my interest, where can I try out all these lovely BSD flavours? #### - -You can probably guess the websites – [www.openbsd.org][1], [www.freebsd.org][2] and [www.netbsd.org][3] – where you can download ISO images, boot them in VirtualBox, and play around. If you’ve been using Linux for a while, you won’t find any of them too difficult, although you’re expected to know your way around the command line. If you’re looking for something more newbie-friendly, PC-BSD - -([www.pcbsd.org][4]) is a customised version of FreeBSD focused on the desktop, with a fancy graphical installer and super-simple management of software. Have fun exploring! - - - - - --------------------------------------------------------------------------------- - -via: http://www.linuxvoice.com/faq-bsd-2/ - -作者:[Mike Saunders][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://www.linuxvoice.com/author/mike/ -[1]:http://www.openbsd.org/ -[2]:http://www.freebsd.org/ -[3]:http://www.netbsd.org/ -[4]:http://www.pcbsd.org/ diff --git a/translated/talk/20150310 FAQ--BSD.md b/translated/talk/20150310 FAQ--BSD.md new file mode 100644 index 0000000000..97bcd4f246 --- /dev/null +++ b/translated/talk/20150310 FAQ--BSD.md @@ -0,0 +1,75 @@ +BSD +================================================================================ +![](http://www.linuxvoice.com/wp-content/uploads/2015/02/faq1-large1.png) + +### ʷвͬڽFreeBSD... ### + +#### ôBirsa Seva Dalôأѵһӡȵ֯ô #### + +ȤάٿϡBSDҳΪ˽Цô۲а棨Berkeley Software Distributionһõĸ㷺IJϵͳ塣 + +#### ǸҿƲסԼôЩϵͳôأ #### + +죬ҪʹõBSDϵͳ֡ǶUnixǶԴҴൣηĽɫҲܵ͹վKDEFirefoxLibreOfficeApacheMySQL˵óֵĿԴǶȶȫ֧಻ͬӲ + +#### ϲ㣡ղGNU/Linux #### + +ǵģLinuxӵҸղᵽжҲΪʲôܶ˴BSDճʹУLinuxBSDû̫IJͬҪΪǶUnixΪúܶԵ¼ԶVimдһЩPython룬ʹMuttemailܲδʶʹBSDڿȹͨնʹ֪BSD + +ڿģͺ֤Ϊ˽ЩҪصȥBSDУBżǴѧУUniversity of California, Berkeley1980ǿԴUnixķԴء90x86PCУ˶ǵļͥаװUnixϵͳȤһ386BSDĿʱṩĹܡ + +#### ôеLinuxаǸʱأ #### + +ʵúãҲ֪һǰLinus TorvaldsѾںˣGNUĿʱĿԴϵͳLinusʱѾڸGNUںˣHurd386BSD̸ʱںһԱճܾͲᴴLinuxˡԣ90ͷ꣬Դϵͳû֪ĸϵͳʤ + +BSDһЩ鷳UnixĿAT&TͼǵĹлһЩ棬BSDַǵ֪ʶȨ1992һ׮ϽBSDĿ̡BSDԴķ֧뱻дʱGNU/LinuxѾḻ˹ܣȶˡ + +90BSD֤GNU/Linuxӳ죬ûЩ鷳ѾΪx86 PCı׼ˡ죬ǿܶʹLinux + +#### ᵽBSDȻ㷺ʹãô #### + +ǵġ386BSDĿͣˣֻŶķʽijɹĿFreeBSDΪʹ㷺BSD汾ĿǰǺLinuxƵϵͳͷ汾ȻNetBSD۽ڿֲԣڳ50ֲͬƽ̨ϣͬĴ汾һ汾OpenBSDNetBSDʼþΪߵĿڽǶΪNetBSDķ֧ˣ죬רעڰȫOpenBSDǶLinuxı׼˵OpenSSH - ԣLibreSSL + +#### ԣְ汾BSDLinuxаô #### + +ҲҲǣÿBSD汾ԼĴ⡢ͬĿŶӡǼ๲õĴ루ӲǸӵɫŵȱ໥IJϵͳ + +ᵽBSDĿģGNU/LinuxҪص㡣GNU/Linuxû˶иһЩŶGNU湤һЩŶڿںˣһЩڿűһЩдֲᣬһЩдȵȡĿģͨȱȨġɷа渺ʹжƺϡ + +BSD෴Ǵ뻯ԴпΪһ塣ںˡ⡢ϵͳĵҳһطͬķʽʹáBSD˿ƣص˲ϵͳһԺȶԡͨЩʹBSDľǿֲ֤ҳѾ÷dz걸 + +![](http://www.linuxvoice.com/wp-content/uploads/2015/02/faq2-large1.png) + +#### ѵBSDûʹGNU/Linuxκζô #### + +ǵģGCCʮGNU Compiler CollectionѾΪʵϵUnixϵͳ׼FreeBSDѾתʹLLVM/ClangˡֵעBSDһЩĿԴĿDzGNULinux˵X Window SystemXFree86X.orgPerlȵȡҿPOSIXһı׼LinuxϵijBSD汾ϱС + +ˣ԰LAMPLinuxApacheMySQLPHPеLijFreeBSDԻüͬĻԼһЩͬԣ磬ļϵͳַ֧棩FreeBSDдûNetflixÿṩݡFreeBSDһõ滷ijڷ棬ӵгѰĿɿԺܡ + +OpenBSDڰȫʮֱҪijϣСWebļйܡǽءNetBSDBSDҪаеһڼƽ̨ϣϵAmigasAcorn boxesʱڱԴ豸ҵӰ + +#### ȵȣô˽ԴԴأLinuxDzʵ #### + +Եģ̸GNU/LinuxҪͬBSD汾֤ȤBSD֤dz֪ͬGPL˵BSD̡BSD֤Ҫǣݴ룬£ĿԱȨ㻵ĵʱҪϡ + +ˣ֤ûκǿƴ뿪ԴGPLҪʹݴûǵ޸ҲԴһҪIJͬ˻ļۣBSDķ˿˵ǵ֤ɣΪôϸ񣩣GNU/GPLķ˿˵ǵ֤ŸɣΪɣ + +#### ѽô˵ѾҵȤܳЩɰBSD汾أ #### + +ѾԲµЩվ C [www.openbsd.org][1][www.freebsd.org][2][www.netbsd.org][3]ISOVirtualBoxǣȻʼˣѾһʱLinuxҪ˽Щⲻ̫ѡѰһЩָѺõĶPC-BSDPC-BSD([www.pcbsd.org][4])һFreeBSDĸԻư汾רע棬۵ͼλװͳ򵥵ף죡 + +-------------------------------------------------------------------------------- + +via: http://www.linuxvoice.com/faq-bsd-2/ + +ߣ[Mike Saunders][a] +ߣ[wwy-hust](https://github.com/wwy-hust) +Уԣ[УID](https://github.com/УID) + + [LCTT](https://github.com/LCTT/TranslateProject) ԭ룬[Linuxй](http://linux.cn/) Ƴ + +[a]:http://www.linuxvoice.com/author/mike/ +[1]:http://www.openbsd.org/ +[2]:http://www.freebsd.org/ +[3]:http://www.netbsd.org/ +[4]:http://www.pcbsd.org/ From 37241b9d7d1666c1238b82800d25757965c30024 Mon Sep 17 00:00:00 2001 From: wwy Date: Fri, 29 May 2015 12:40:33 +0800 Subject: [PATCH 201/965] [Translating] 20150527 How to Develop Own Custom Linux Distribution From Scratch.md --- ...w to Develop Own Custom Linux Distribution From Scratch.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/share/20150527 How to Develop Own Custom Linux Distribution From Scratch.md b/sources/share/20150527 How to Develop Own Custom Linux Distribution From Scratch.md index 9bf07333ea..2314ec9615 100644 --- a/sources/share/20150527 How to Develop Own Custom Linux Distribution From Scratch.md +++ b/sources/share/20150527 How to Develop Own Custom Linux Distribution From Scratch.md @@ -1,3 +1,5 @@ +translating by wwy-hust + How to Develop Own Custom Linux Distribution From Scratch ================================================================================ Have you ever thought of making your own Linux Distribution? Every Linux user in their journey to Linux thought of making their own Linux distribution, at-least once. Even I was not an exception as a newbie to Linux land and have given my considerable time developing my own Linux Distribution. Developing a Linux Distribution from scratch is called Linux From Scratch (LFS) @@ -62,4 +64,4 @@ via: http://www.tecmint.com/create-custom-linux-distribution-from-scratch/ 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 [a]:http://www.tecmint.com/author/avishek/ -[1]:http://tecmint.tradepub.com/free/w_linu01/prgm.cgi \ No newline at end of file +[1]:http://tecmint.tradepub.com/free/w_linu01/prgm.cgi From 9e0e5e4a48516cd2544088b7eb750ca67bc82bb1 Mon Sep 17 00:00:00 2001 From: Gore Liu Date: Fri, 29 May 2015 15:28:46 +0800 Subject: [PATCH 202/965] [Translating] 20150527 3 Useful Hacks Every Linux User Must Know.md --- .../20150527 3 Useful Hacks Every Linux User Must Know.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150527 3 Useful Hacks Every Linux User Must Know.md b/sources/tech/20150527 3 Useful Hacks Every Linux User Must Know.md index 39546df146..0107840a1b 100644 --- a/sources/tech/20150527 3 Useful Hacks Every Linux User Must Know.md +++ b/sources/tech/20150527 3 Useful Hacks Every Linux User Must Know.md @@ -1,3 +1,5 @@ +Translating by goreliu ... + 3 Useful Hacks Every Linux User Must Know ================================================================================ The world of Linux is filled with so much fun and interesting stuffs, the more we go in, the more we find stuffs. In our efforts to bring those little hacks and tips for you that makes you different from others, here we have came up with three little tricks. @@ -70,7 +72,7 @@ That’s all for now, if you know any such Linux hacks or tricks you may share w via: http://www.tecmint.com/useful-linux-hacks-commands/ 作者:[Avishek Kumar][a] -译者:[译者ID](https://github.com/译者ID) +译者:[goreliu](https://github.com/goreliu) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 55687763593a0429a8780aca729735d504226797 Mon Sep 17 00:00:00 2001 From: Gore Liu Date: Fri, 29 May 2015 16:41:40 +0800 Subject: [PATCH 203/965] [Translated] 20150527 3 Useful Hacks Every Linux User Must Know.md --- ...Useful Hacks Every Linux User Must Know.md | 81 ------------------- ...Useful Hacks Every Linux User Must Know.md | 78 ++++++++++++++++++ 2 files changed, 78 insertions(+), 81 deletions(-) delete mode 100644 sources/tech/20150527 3 Useful Hacks Every Linux User Must Know.md create mode 100644 translated/tech/20150527 3 Useful Hacks Every Linux User Must Know.md diff --git a/sources/tech/20150527 3 Useful Hacks Every Linux User Must Know.md b/sources/tech/20150527 3 Useful Hacks Every Linux User Must Know.md deleted file mode 100644 index 0107840a1b..0000000000 --- a/sources/tech/20150527 3 Useful Hacks Every Linux User Must Know.md +++ /dev/null @@ -1,81 +0,0 @@ -Translating by goreliu ... - -3 Useful Hacks Every Linux User Must Know -================================================================================ -The world of Linux is filled with so much fun and interesting stuffs, the more we go in, the more we find stuffs. In our efforts to bring those little hacks and tips for you that makes you different from others, here we have came up with three little tricks. - -### 1. How to Schedule a Linux Job Without Cron ### - -Scheduling a job/command in Linux is acronym to cron. Whenever we need to schedule a job, we call cron, but do you know we can schedule a job at a later time without corn? You can do it as suggested below.. - -Run a command (say date) every 5 sec and write the output to a file (say date.txt). To achieve this scenario, we need to run the below one liner script directly on the command prompt. - - $ while true; do date >> date.txt ; sleep 5 ; done & - -Anatomy of the above one liner script: - -- while true – Ask script to run while the condition is true, it acts as a loop which makes the command to run again-and-again or say in a loop. -- do – do perform what follows, ie., execute command or set of commands that lies ahead of do statement. -- date >> date.txt – here the output of date command is being written to a file date.txt. Also note that we have used >> and not >. -- >> ensures that the file (date.txt) is not overwritten every time the script execute. It just append the changes. Whereas > overwrite the file again and again. -- sleep 5 – It ask the shell to keep a time difference of 5 seconds before it executed again. Note the time here is always measured in seconds. Say if you want to execute the command every 6 minutes, you should use (6*60) 360, in succession of sleep. -- done – marks the end of while loop. -- & – Put the whole process in loop to background. - -Similarly, we can execute any script in the same manner. Here is the command to call a script after certain interval (say 100 sec) and the name of script is `script_name.sh`. - -Also worth mentioning that the script above should be run in the directory where the script to be called lies, else you need to provide full path (`/home/$USER/…/script_name.sh`). The syntax for calling script at above described interval is: - - $ while true; do /bin/sh script_name.sh ; sleep 100 ; done & - -**Conclusion**: The above one liner is not a replacement of Cron, because Cron utility supports a whole lots of options, as compared and is very flexible as well as customizable. However if we want to run certain test cases or I/O benchmark, then the above singe command will serve the purpose. - -Read Also: [11 Linux Cron Job Scheduling Examples][1] - -### 2. How to Clear Terminal without Using ‘clear’ Command ### - -What we do to clear the screen? Well you may think how silly it is to ask such question. Well, we all know it’s ‘clear‘ command. However if we make a habit of using key combination ‘ctrl+l‘ to clear terminal, we will save a lot of time of ours. - -Key combination ‘Ctrl+l‘ has the same effect as ‘clear‘ command. So from next time use ctrl+l to clear your Linux Command Line Interface. - -**Conclusion**: Since ctrl+l is a key combination, so we can not use it inside a script. If we need to clear screen inside a shell script, call command ‘clear’, for all other cases I could think of now, ctrl+l is more than sufficient. - -### 3. Run a command and come back to the current working directory automatically. ### - -Well this is an amazing hack not many people know. You may run a command no matter what it return back to the current directory. All you need to do is to run the command in parentheses i.e., in between `( and )`. - -Let see the example, - - avi@deb:~$ (cd /home/avi/Downloads/) - -#### Sample Output #### - - avi@deb:~ - -First it cd to directory Downloads and then again return back to home directory in one go. May be you believe that the command didn’t executed and for some reason one or another it is not throwing error, since there is no change in prompt. Lets do a little more tweak.. - - avi@deb:~$ (cd /home/avi/Downloads/ && ls -l) - -#### Sample Output #### - - -rw-r----- 1 avi avi 54272 May 3 18:37 text1.txt - -rw-r----- 1 avi avi 54272 May 3 18:37 text2.txt - -rw-r----- 1 avi avi 54272 May 3 18:37 text3.txt - avi@deb:~$ - -So in the above command it first changed the current directory to Downloads and then list the content of that directory before returning back to current directory. Also, it proves that command executed successfully. You may run any sort of command in the parentheses and return back to your current working directory without a hitch. - -That’s all for now, if you know any such Linux hacks or tricks you may share with us via our comment section and don’t forget to share this article with your friends…. - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/useful-linux-hacks-commands/ - -作者:[Avishek Kumar][a] -译者:[goreliu](https://github.com/goreliu) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.tecmint.com/author/avishek/ -[1]:http://www.tecmint.com/11-cron-scheduling-task-examples-in-linux/ \ No newline at end of file diff --git a/translated/tech/20150527 3 Useful Hacks Every Linux User Must Know.md b/translated/tech/20150527 3 Useful Hacks Every Linux User Must Know.md new file mode 100644 index 0000000000..25c1ef3e3d --- /dev/null +++ b/translated/tech/20150527 3 Useful Hacks Every Linux User Must Know.md @@ -0,0 +1,78 @@ +每个Linux用户都应该知道的3个有用技巧 +================================================================================ +Linux世界充满了乐趣,我们越深入进去,就会发现越多有趣的事物。我们会努力给你提供一些小技巧,让你和其他人有所不同,下面就是我们准备的3个小技巧。 + +### 1. 如何在不使用Cron的情况调度Linux下的作业 ### +在Linux下,调度一个作业/命令可以缩写为Cron。当我们需要调度一个作业时,我们会使用Cron,但你知道我们在不使用Cron的情况也可以调度一个在将来时间运行的作业吗?你可以按照如下建议操作…… + +每5秒钟运行一个命令(date)然后将结果写入到一个文件(data.txt)。为了实现这一点,我们可以直接在命令提示符运行如下单行脚本。 + + $ while true; do date >> date.txt ; sleep 5 ; done & + +上述脚本的解释: + +- `while true` :让脚本进入一个条件总为真的循环中,也就是制造一个死循环,将里边的命令一遍遍地重复运行。 +- `do` :`do`是`while`语句中的关键字,它之后的命令会被执行,在它后边可以放置一个或一系列命令。 +- `date >> date.txt` :运行date命令,并将其输出写入到data.txt文件中。注意我们使用`>>`,而不是`>`。 +- `>>` :对文件(date.txt)进行追加写的操作,这样每次运行命令后,输出内容会被追加到文件中。如果使用`>`的话,则会一遍遍地覆盖之前的内容。 +- `sleep 5` :让脚本处于5秒睡眠状态,然后再运行之后的命令。注意这里的时间单位只能用秒。也就是说如果你想让命令每6分钟运行一次,你应该使用`sleep 360`。 +- `done` :`while`循环语句块结束的标记。 +- `&` :将整个进程放到后台运行。 + +类似地,我们可以这样运行任何脚本。下边的例子是每100秒运行一个名为`script_name.sh`的脚本。 + +另外值得一提的是上边的脚本文件必须处于当前目录中,否则需要使用完整路径(`/home/$USER/…/script_name.sh`)。实现如上功能的单行脚本如下: + + $ while true; do /bin/sh script_name.sh ; sleep 100 ; done & + +**总结**:上述的单行脚本并不是Cron的替代品,因为Cron工具支持众多选项,更加灵活,可定制性也更高。然而如果我们想运行某些测试,比如I/O评测,上述的单行脚本也管用。 + +还可以参考:[11 Linux Cron Job Scheduling Examples][1] + +### 2. 如何不使用clear命令清空终端的内容 ### + +你如何清空终端的内容?你可能会认为这是一个傻问题。好吧,大家都清楚可以使用`clear`命令。如果养成使用`ctrl + l`快捷键的习惯,我们会节省大量时间。 + +`Ctrl + l`快捷键的效果和`clear`命令一样。所以下一次你就可以使用`ctrl + l`来清空终端的内容了。 + +**总结**:因为`ctrl + l`是一个快捷键,我们不可以在脚本中使用。所以如果我们需要在脚本中清空屏幕内容,还是需要使用`clear`命令。但我能想到的所有其他情况,`ctrl + l`都更加有效。 + +### 3. 运行一个命令,然后自动回到当前的工作目录 ### + +这是一个很多人可能不知道的令人吃惊的技巧。你可能想运行任何一个命令,然后再回到当前目录。你只需要将命令放在一个圆括号里。 + +我们来看一个例子: + + avi@deb:~$ (cd /home/avi/Downloads/) + +#### 示例输出 #### + + avi@deb:~ + +它首先会cd到Downloads目录,然后又回到了之前的家目录。也许你认为里边的命令根本没有执行,或者是出了某种错误,因为从命令提示符看不出任何变化。让我们简单修改一下这个命令: + + avi@deb:~$ (cd /home/avi/Downloads/ && ls -l) + +#### 示例输出 #### + + -rw-r----- 1 avi avi 54272 May 3 18:37 text1.txt + -rw-r----- 1 avi avi 54272 May 3 18:37 text2.txt + -rw-r----- 1 avi avi 54272 May 3 18:37 text3.txt + avi@deb:~$ + +在上述命令中,它首先进入Downloads目录,然后列出文件内容,最后又回到了当前目录。并且它证明了命令成功执行了。你可以在括号中包含任何命令,执行完都会顺利返回到当前目录。 + +这就是全部内容了,如果你知道任何类似的Linux技巧,你可以在文章下面的评论框中分享给我们,不要忘记将本文和朋友分享 :) + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/useful-linux-hacks-commands/ + +作者:[Avishek Kumar][a] +译者:[goreliu](https://github.com/goreliu) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/avishek/ +[1]:http://www.tecmint.com/11-cron-scheduling-task-examples-in-linux/ \ No newline at end of file From 001753bb0afc2a3eaeb1bfab83e1e0f006754213 Mon Sep 17 00:00:00 2001 From: Gore Liu Date: Fri, 29 May 2015 17:05:00 +0800 Subject: [PATCH 204/965] [Translating] 20150528 11 pointless but awesome Linux terminal tricks.md --- ...20150528 11 pointless but awesome Linux terminal tricks.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150528 11 pointless but awesome Linux terminal tricks.md b/sources/tech/20150528 11 pointless but awesome Linux terminal tricks.md index 731f28df10..74baa5fb5b 100644 --- a/sources/tech/20150528 11 pointless but awesome Linux terminal tricks.md +++ b/sources/tech/20150528 11 pointless but awesome Linux terminal tricks.md @@ -1,3 +1,5 @@ +Translating by goreliu ... + 11 pointless but awesome Linux terminal tricks ================================================================================ Here are some great Linux terminal tips and tricks, each one as pointless as it is awesome. @@ -95,7 +97,7 @@ Want your terminal to do that scrolling text, l33t, Matrix-y thing? "cmatrix" is via: http://www.networkworld.com/article/2926630/linux/11-pointless-but-awesome-linux-terminal-tricks.html 作者:[Bryan Lunduke][a] -译者:[译者ID](https://github.com/译者ID) +译者:[goreliu](https://github.com/goreliu) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 1bcacc03f439f78d08a9dab84bf6c7d57e70818b Mon Sep 17 00:00:00 2001 From: ZTinoZ Date: Fri, 29 May 2015 18:07:42 +0800 Subject: [PATCH 205/965] Translating by ZTinoZ --- ...0150526 20 Useful Terminal Emulators for Linux.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sources/tech/20150526 20 Useful Terminal Emulators for Linux.md b/sources/tech/20150526 20 Useful Terminal Emulators for Linux.md index 9103f53b4d..d3f974bd05 100644 --- a/sources/tech/20150526 20 Useful Terminal Emulators for Linux.md +++ b/sources/tech/20150526 20 Useful Terminal Emulators for Linux.md @@ -1,11 +1,11 @@ Translating by ZTinoZ 20款优秀的Linux终端仿真器 ================================================================================ -终端仿真器是一款计算机程序A Terminal emulator is a computer program that reproduces a video terminal within some other display structure. In other words the Terminal emulator has an ability to make a dumb machine appear like a client computer networked to the server. The terminal emulator allows an end user to access console as well as its applications such as text user interface and command line interface. +终端仿真器是一款用其它显示结构重现可视终端的计算机程序。换句话说就是终端仿真器能使哑终端看似像一台客户机连接上了服务器。终端仿真器允许最终用户像文本用户界面和命令行界面一样连接控制台和应用程序。 ![Linux Terminal Emulators](http://www.tecmint.com/wp-content/uploads/2014/01/Linux-Terminal-Emulators1.jpeg) -20 Linux Terminal Emulators +20款Linux终端仿真器 You may find huge number of terminal emulators to choose from this open source world. Some of them offers large range of features while others offers less features. To give a better understanding to the quality of software that are available, we have gathered a list of marvelous terminal emulator for Linux. Each title provides its description and feature along with screenshot of the software with relevant download link. @@ -13,7 +13,7 @@ You may find huge number of terminal emulators to choose from this open source w Terminator is an advanced and powerful terminal emulator which supports multiple terminals windows. This emulator is fully customizable. You can change the size, colour, give different shapes to the terminal. Its very user friendly and fun to use. -#### Features of Terminator #### +#### Terminator的特性 #### - Customize your profiles and colour schemes, set the size to fit your needs. - Use plugins to get even more functionality. @@ -31,7 +31,7 @@ Terminator Terminal Tilda is a stylish drop-down terminal based on GTK+. With the help of a single key press you can launch a new or hide Tilda window. However, you can add colors of your choice to change the look of the text and Terminal background. -#### Features of Tilda #### +#### Tilda的特性 #### Interface with Highly customization option. You can set the transparency level for Tilda window. @@ -61,7 +61,7 @@ Yakuake (Yet Another Kuake) is a KDE based drop-down terminal emulator very much Yakuake is basically a KDE application, which can be easily installed on KDE desktop, but if you try to install Yakuake in GNOME desktop, it will prompt you to install huge number of dependency packages. -#### Yakuake Features #### +#### Yakuake的特性 #### - Fluently turn down from the top of your screen - Tabbed interface @@ -164,7 +164,7 @@ TermKit Terminal - [TermKit Homepage][12] -12. st +### 12. st ### st is a simple terminal implementation for X Window. From 7eda3a3ef805e70890da5efbc4cc15d180457a5f Mon Sep 17 00:00:00 2001 From: sevenot Date: Fri, 29 May 2015 22:03:45 +0800 Subject: [PATCH 206/965] sevenot translating --- ...Material Design Inspired GTK And Icon Theme Paper in Linux.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/share/20150225 Install Google's Material Design Inspired GTK And Icon Theme Paper in Linux.md b/sources/share/20150225 Install Google's Material Design Inspired GTK And Icon Theme Paper in Linux.md index 33aa731843..105332bb07 100644 --- a/sources/share/20150225 Install Google's Material Design Inspired GTK And Icon Theme Paper in Linux.md +++ b/sources/share/20150225 Install Google's Material Design Inspired GTK And Icon Theme Paper in Linux.md @@ -1,3 +1,4 @@ +sevenot translating Install Google’s Material Design Inspired GTK And Icon Theme Paper in Linux ================================================================================ ![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/02/Paper_theme_Material_Design.jpg) From a6f570d80a49be8fa4534550899dd6cd8bb3c7bd Mon Sep 17 00:00:00 2001 From: geekpi Date: Sat, 30 May 2015 10:09:31 +0800 Subject: [PATCH 207/965] translating --- ...sses or Unresponsive Applications Using 'xkill' Command.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150527 How to Kill Linux Processes or Unresponsive Applications Using 'xkill' Command.md b/sources/tech/20150527 How to Kill Linux Processes or Unresponsive Applications Using 'xkill' Command.md index ebbfe264bc..2448e7ef26 100644 --- a/sources/tech/20150527 How to Kill Linux Processes or Unresponsive Applications Using 'xkill' Command.md +++ b/sources/tech/20150527 How to Kill Linux Processes or Unresponsive Applications Using 'xkill' Command.md @@ -1,3 +1,5 @@ +translating---geekpi + How to Kill Linux Processes/Unresponsive Applications Using ‘xkill’ Command ================================================================================ How do we kill a resource/process in Linux? Obviously we find the PID of the resource and then pass the PID to the kill command. @@ -89,4 +91,4 @@ via: http://www.tecmint.com/kill-processes-unresponsive-programs-in-ubuntu/ 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 [a]:http://www.tecmint.com/author/avishek/ -[1]:http://www.tecmint.com/how-to-kill-a-process-in-linux/ \ No newline at end of file +[1]:http://www.tecmint.com/how-to-kill-a-process-in-linux/ From a59590989e1842bb29cf88a38d29b2f8c7b5d84f Mon Sep 17 00:00:00 2001 From: geekpi Date: Sat, 30 May 2015 10:51:17 +0800 Subject: [PATCH 208/965] translated --- ...sive Applications Using 'xkill' Command.md | 94 ------------------- ...sive Applications Using 'xkill' Command.md | 93 ++++++++++++++++++ 2 files changed, 93 insertions(+), 94 deletions(-) delete mode 100644 sources/tech/20150527 How to Kill Linux Processes or Unresponsive Applications Using 'xkill' Command.md create mode 100644 translated/tech/20150527 How to Kill Linux Processes or Unresponsive Applications Using 'xkill' Command.md diff --git a/sources/tech/20150527 How to Kill Linux Processes or Unresponsive Applications Using 'xkill' Command.md b/sources/tech/20150527 How to Kill Linux Processes or Unresponsive Applications Using 'xkill' Command.md deleted file mode 100644 index 2448e7ef26..0000000000 --- a/sources/tech/20150527 How to Kill Linux Processes or Unresponsive Applications Using 'xkill' Command.md +++ /dev/null @@ -1,94 +0,0 @@ -translating---geekpi - -How to Kill Linux Processes/Unresponsive Applications Using ‘xkill’ Command -================================================================================ -How do we kill a resource/process in Linux? Obviously we find the PID of the resource and then pass the PID to the kill command. - -Speaking more accurately, we can find PID of a resource (say terminal) as: - - $ ps -A | grep -i terminal - - 6228 ? 00:00:00 gnome-terminal - -In the above output, the number ‘6228‘ is the PID of process (gnome-terminal), use the kill command to kill the process as shown below. - - $ kill 6228 - -The kill command sends a signal to a process, whose PID is passed along with the command. - -Alternatively, we can use pkill command, which kills a process based upon name and other attributes of a process. To kill a process say whose name is terminal, we need to execute: - - $ pkill terminal - -**Note**: The process name length in pkill is limited to 15 characters. - -pkill seems more handy as you can kill a process without have to find out its PID. But if you want to have a better control on your system nothing beats ‘kill‘ command. Using kill you will have better insight of what process you are killing. - -We have already covered a detailed guide on [kill, pkill and killall commands][1]. - -For those who are running X server there is another tool called xkill which can kill a process from its X window without passing process name or its PID. - -xkill utility forces X server to close communications to its client which results into killing of client by its X resource. xkill which is a part of X11 utilities is very handy in killing unnecessary windows. - -It support options like connect to specific X Server (-display displayname) using display number when multiple X Servers are running on a host simultaneously and kill all the client (-all, not recommended) with top-level windows on the screen as well as take frame (-frame) into account. - -To get a list of all the clients you may run: - - $ xlsclients - -#### Sample Output #### - - ' ' /usr/lib/libreoffice/program/soffice - deb gnome-shell - deb Docky - deb google-chrome-stable - deb soffice - deb gnome-settings-daemon - deb gnome-terminal-server - -If no resource identifier is passed with id, xkill turns the mouse Pointer into special Symbol, similar to ‘X‘. Just click on the window you want to kill and this will kill its communication with server or say the program gets killed. - - $ xkill - -![Xkill Command](http://www.tecmint.com/wp-content/uploads/2015/05/Xkill.png) - -Kill Process Using xkill - -It is important to notice that xkill do not guarantee that closing its communication will kill/abort it successfully. Most of the application will get killed when it’s communication to server is closed. However a few may still be running. - -Points Needed to be mentioned here: - -- This tool works only when X11 server is running, as xkill is a part of X11 utility. -- Don’t confuse with Closing and killing a resource. While killing a resource you may expect it not to exit cleanly. -- This is not a replacement of kill utility. - -**Do I need to go to Linux command line to invoke xkill?** - -No, you don’t need to fire xkill from Linux Command Line. You may set a keyboard shortcut and call xkill just by punching same key combination. - -Here is how to setup a keyboard shortcut on a typical gnome3 Desktop Environment. - -Go to Settings –> Select Keyboard, click on ‘+’ and add name and command. Click on the new entry and press the key you want to use as shortcut key combination. I did Ctrl+Alt+Shift+x. - -![Gnome Settings](http://www.tecmint.com/wp-content/uploads/2015/05/22.png) - -Gnome Settings - -![Add Shortcut Key](http://www.tecmint.com/wp-content/uploads/2015/05/31.png) - -Add Shortcut Key - -The next time you want to kill a X resource just call the key combination (Ctrl+Alt+Shift+x), and you will notice your mouse pointer changed into x. Click on x resource you want to kill and all done! - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/kill-processes-unresponsive-programs-in-ubuntu/ - -作者:[Avishek Kumar][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.tecmint.com/author/avishek/ -[1]:http://www.tecmint.com/how-to-kill-a-process-in-linux/ diff --git a/translated/tech/20150527 How to Kill Linux Processes or Unresponsive Applications Using 'xkill' Command.md b/translated/tech/20150527 How to Kill Linux Processes or Unresponsive Applications Using 'xkill' Command.md new file mode 100644 index 0000000000..20211ab6bf --- /dev/null +++ b/translated/tech/20150527 How to Kill Linux Processes or Unresponsive Applications Using 'xkill' Command.md @@ -0,0 +1,93 @@ +如何使用xkill命令傻点Linux进程/未响应的程序 +================================================================================ +我们如何在Linux中杀掉一个资源/进程?很明显我们会找出资源的pid然后用kill命令。 + +更准确一点,我们可以找到资源(这里就是terminal)的PID: + + $ ps -A | grep -i terminal + + 6228 ? 00:00:00 gnome-terminal + +上面的输出中,‘6288’就是进程(gnome-terminal)的pid, 使用下面的命令来杀掉进程。 + + $ kill 6228 + +kill命令会发送一个信号给该pid的进程。 + +另外一个方法是我们可以使用pkill命令,它可以基于进程的名字或者其他的属性来杀掉进程。同样我们要杀掉一个叫terminal的进程可以这么做: + + $ pkill terminal + +**注意**: pkill命令后面进程名的长度不大于15个字符 + +pkill看上去更加容易上手,因为你你不用找出进程的pid。但是如果你要对系统做更好的控制,那么没有什么可以打败'kill'。使用kill命令可以更好地审视你要杀掉的进程。 + +我们已经有一篇覆盖了[kill、pkill和killall命令][1]间细节的指导了。 + +对于那些运行X Server的人而言,有另外一个工具称为xkill可以将进程从X Window中杀掉而不必传递它的名字或者pid。 + +xkill工具强制X server关闭于它客户端之间的联系,这可以让X resource关闭这个客户端。xkill是X11工具集中一个非常容易上手的杀掉无用窗口的工具。 + +它支持的选项如在同时运行多个X Server时使用-display选项后面跟上显示号连接到指定的X server,使用-all(并不建议)杀掉所有在屏幕上的所遇顶层窗口,同时将帧(-frame)也计算在内。 + +要得到所有的客户端你可以运行: + + $ xlsclients + +#### 示例输出 #### + + ' ' /usr/lib/libreoffice/program/soffice + deb gnome-shell + deb Docky + deb google-chrome-stable + deb soffice + deb gnome-settings-daemon + deb gnome-terminal-server + +如果后面没有跟上资源id,xkill会将鼠标指针变成一个特殊符号,类似于“X”。只需在你要杀掉的窗口上点击,它就会杀掉它与server端的通信,这个程序就被杀掉了。 + + + $ xkill + +![Xkill Command](http://www.tecmint.com/wp-content/uploads/2015/05/Xkill.png) + +使用xkill杀掉进程 + +需要注意的是xkill并不能保证它的通信会被成功杀掉/退出。大多数程序会在与服务端的通信被关闭后杀掉。然而仍有少部分会继续运行。 + +需要指出的点是: + +- 这个工具只能在X11 server运行的时候才能使用,因为这是X11工具的一部分。 +- 不要在你杀掉一个资源而它没有完全退出时而困惑。 +- 这不是kill的替代品 + +**我需要在linux命令行中使用xkill么** + +不是,你不必在命令行中运行xkill。你可以设置一个快捷键,并用它来调用xkill。 + +下面是如何在典型的gnome3桌面中设置键盘快捷键。 + +进入设置-> 选择键盘。点击'+'并添加一个名字和命令。点击点击新条目并按下你想要的组合键。我的是Ctrl+Alt+Shift+x。 + +![Gnome Settings](http://www.tecmint.com/wp-content/uploads/2015/05/22.png) + +Gnome 设置 + +![Add Shortcut Key](http://www.tecmint.com/wp-content/uploads/2015/05/31.png) + +添加快捷键 + +下次你要杀掉X资源只要用组合键就行了(Ctrl+Alt+Shift+x),你看到你的鼠标变成x了。点击想要杀掉的x资源就行了。 + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/kill-processes-unresponsive-programs-in-ubuntu/ + +作者:[Avishek Kumar][a] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/avishek/ +[1]:http://www.tecmint.com/how-to-kill-a-process-in-linux/ From e6282faa6b89a9a474a5320bd70fe1182fa1ac74 Mon Sep 17 00:00:00 2001 From: Chang Liu Date: Sat, 30 May 2015 22:06:27 +0800 Subject: [PATCH 209/965] =?UTF-8?q?Update=2020150515=20Install=20'Tails=20?= =?UTF-8?q?1.4=E2=80=B2=20Linux=20Operating=20System=20to=20Preserve=20Pri?= =?UTF-8?q?vacy=20and=20Anonymity.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... Linux Operating System to Preserve Privacy and Anonymity.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150515 Install 'Tails 1.4′ Linux Operating System to Preserve Privacy and Anonymity.md b/sources/tech/20150515 Install 'Tails 1.4′ Linux Operating System to Preserve Privacy and Anonymity.md index 8d0d5ccbdf..5731cd69f4 100644 --- a/sources/tech/20150515 Install 'Tails 1.4′ Linux Operating System to Preserve Privacy and Anonymity.md +++ b/sources/tech/20150515 Install 'Tails 1.4′ Linux Operating System to Preserve Privacy and Anonymity.md @@ -1,3 +1,5 @@ +FSSlc translating + Install ‘Tails 1.4′ Linux Operating System to Preserve Privacy and Anonymity ================================================================================ In this Internet world and the world of Internet we perform most of our task online be it Ticket booking, Money transfer, Studies, Business, Entertainment, Social Networking and what not. We spend a major part of our time online daily. It has been getting hard to remain anonymous with each passing day specially when backdoors are being planted by organizations like NSA (National Security Agency) who are putting their nose in between every thing that we come across online. We have least or no privacy online. All the searches are logged upon the basis of user Internet surfing activity and machine activity. @@ -176,4 +178,4 @@ via: http://www.tecmint.com/install-tails-1-4-linux-operating-system-to-preserve [5]:https://tails.boum.org/download/index.en.html#verify [6]:http://www.tecmint.com/install-linux-from-usb-device/ [7]:https://tails.boum.org/doc/index.en.html -[8]:http://www.tecmint.com/install-virtualbox-on-redhat-centos-fedora/ \ No newline at end of file +[8]:http://www.tecmint.com/install-virtualbox-on-redhat-centos-fedora/ From 866eb2c6b7e32d40037f6205ee276406acddb2d0 Mon Sep 17 00:00:00 2001 From: wxy Date: Sat, 30 May 2015 22:27:40 +0800 Subject: [PATCH 210/965] PUB:20150320 Sleuth Kit--Open Source Forensic Tool to Analyze Disk Images and Recover Files @FSSlc --- ...o Analyze Disk Images and Recover Files.md | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) rename {translated/tech => published}/20150320 Sleuth Kit--Open Source Forensic Tool to Analyze Disk Images and Recover Files.md (80%) diff --git a/translated/tech/20150320 Sleuth Kit--Open Source Forensic Tool to Analyze Disk Images and Recover Files.md b/published/20150320 Sleuth Kit--Open Source Forensic Tool to Analyze Disk Images and Recover Files.md similarity index 80% rename from translated/tech/20150320 Sleuth Kit--Open Source Forensic Tool to Analyze Disk Images and Recover Files.md rename to published/20150320 Sleuth Kit--Open Source Forensic Tool to Analyze Disk Images and Recover Files.md index e86a8f3c10..ba4da99105 100644 --- a/translated/tech/20150320 Sleuth Kit--Open Source Forensic Tool to Analyze Disk Images and Recover Files.md +++ b/published/20150320 Sleuth Kit--Open Source Forensic Tool to Analyze Disk Images and Recover Files.md @@ -1,8 +1,8 @@ -Sleuth Kit -- 一个用来分析磁盘映像和恢复文件的开源取证工具 +Sleuth Kit:一个用来分析磁盘映像和恢复文件的开源取证工具 ================================================================================ -SIFT 是一个由 SANS 公司提供的基于 Ubuntu 的取证发行版本。它包含许多取证工具,如 Sleuth kit/Autopsy 。但 Sleuth kit / Autopsy 可以直接在 Ubuntu 或 Fedora 发行版本上直接安装,而不必下载 SIFT 的整个发行版本。 +SIFT 是一个由 SANS 公司提供的基于 Ubuntu 的取证发行版。它包含许多取证工具,如 Sleuth kit/Autopsy 。但 Sleuth kit/Autopsy 可以直接在 Ubuntu 或 Fedora 发行版本上直接安装,而不必下载 SIFT 的整个发行版本。 -Sleuth Kit/Autopsy 是一个开源的电子取证调查工具,它被用于从磁盘映像中恢复丢失的文件,基于事件响应的磁盘映像的分析。 Autopsy 工具是 sleuth kit 的一个网页接口,支持 sleuth kit 的所有功能。这个工具在 Windows 和 Linux 平台下都可获取到。 +Sleuth Kit/Autopsy 是一个开源的电子取证调查工具,它可以用于从磁盘映像中恢复丢失的文件,以及为了特殊事件进行磁盘映像分析。 Autopsy 工具是 sleuth kit 的一个网页接口,支持 sleuth kit 的所有功能。这个工具在 Windows 和 Linux 平台下都可获取到。 ### 安装 Sleuth kit ### @@ -38,7 +38,7 @@ Sleuth Kit/Autopsy 是一个开源的电子取证调查工具,它被用于从 ### 安装 Autopsy 工具 ### -Sleuth kit 已经安装完毕,现在我们将为它安装 autopsy 界面。从 [sleuthkit 的 autopsy 页面][2] 下载 Autopsy 软件。使用下面的命令在虚拟终端下使用 wget 命令来下载它,下图展示了这个过程。 +Sleuth kit 已经安装完毕,现在我们将为它安装 autopsy 界面。从 [sleuthkit 的 autopsy 页面][2]下载 Autopsy 软件。使用下面的命令在虚拟终端下使用 wget 命令来下载它,下图展示了这个过程。 # wget http://kaz.dl.sourceforge.net/project/autopsy/autopsy/2.24/autopsy-2.24.tar.gz @@ -70,7 +70,7 @@ autopsy 的配置脚本将询问 NSRL (National Software Reference Library) 和 ![Autopsy](http://blog.linoxide.com/wp-content/uploads/2015/03/autopsy-started.png) -在浏览器中键入下面的地址来获取 autopsy 的界面: +在浏览器中键入下面的地址来访问 autopsy 的界面: http://localhost:9999/autopsy @@ -90,7 +90,7 @@ autopsy 的配置脚本将询问 NSRL (National Software Reference Library) 和 ![添加主机的详细信息](http://blog.linoxide.com/wp-content/uploads/2015/03/add-host-detial.png) -点击 **增加映像** 按钮来为取证分析添加映像文件。 +添加主机后,点击 **增加映像** 按钮来为取证分析添加映像文件。 ![添加映像](http://blog.linoxide.com/wp-content/uploads/2015/03/add-image.png) @@ -98,11 +98,11 @@ autopsy 的配置脚本将询问 NSRL (National Software Reference Library) 和 ![添加映像文件](http://blog.linoxide.com/wp-content/uploads/2015/03/Add-image-file.png) -正如下图中展示的那样,我们已经键入了 Linux 映像文件的路径。在我们这个例子中,映像文件是磁盘的分区。 +正如下图中展示的那样,我们已经键入了 Linux 映像文件的路径。在我们这个例子中,映像文件类型是磁盘分区。 ![添加映像分区](http://blog.linoxide.com/wp-content/uploads/2015/03/add-image-parition.png) -点击 下一步 按钮并在下一页中选择 **计算散列值** 的选项,这在下图中有展示。它也将检测所给映像的文件系统类型。 +点击“下一步”按钮并在下一页中选择 **计算散列值** 的选项,这在下图中有展示。它也将检测所给映像的文件系统类型。 ![映像和文件系统详情](http://blog.linoxide.com/wp-content/uploads/2015/03/image-and-file-system-detail.png) @@ -142,7 +142,7 @@ autopsy 的配置脚本将询问 NSRL (National Software Reference Library) 和 ### 结论 ### -希望这篇文章能够给那些进入磁盘映像的静态分析领域的新手提供帮助。Autopsy 是 sleuth kit 的网页界面,提供了在 Windows 和 Linux 磁盘映像中进行诸如字符串提取,恢复被删文件,时间线分析,网络浏览历史,关键字搜索和邮件分析等功能。 +希望这篇文章能够给那些进入磁盘映像静态分析领域的新手提供帮助。Autopsy 是 sleuth kit 的网页界面,提供了在 Windows 和 Linux 磁盘映像中进行诸如字符串提取,恢复被删文件,时间线分析,网络浏览历史,关键字搜索和邮件分析等功能。 -------------------------------------------------------------------------------- @@ -150,7 +150,7 @@ via: http://linoxide.com/ubuntu-how-to/autopsy-sleuth-kit-installation-ubuntu/ 作者:[nido][a] 译者:[FSSlc](https://github.com/FSSlc) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 From 80190da704f19884d954dd4ae43cc7b11addb754 Mon Sep 17 00:00:00 2001 From: wxy Date: Sat, 30 May 2015 22:54:55 +0800 Subject: [PATCH 211/965] PUB:20150326 How to set up server monitoring system with Monit @goreliu --- ... up server monitoring system with Monit.md | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) rename {translated/tech => published}/20150326 How to set up server monitoring system with Monit.md (88%) diff --git a/translated/tech/20150326 How to set up server monitoring system with Monit.md b/published/20150326 How to set up server monitoring system with Monit.md similarity index 88% rename from translated/tech/20150326 How to set up server monitoring system with Monit.md rename to published/20150326 How to set up server monitoring system with Monit.md index 5fbce3aa70..6886e83ef2 100755 --- a/translated/tech/20150326 How to set up server monitoring system with Monit.md +++ b/published/20150326 How to set up server monitoring system with Monit.md @@ -6,7 +6,7 @@ ### Monit是什么? ### -[Monit][3]是一个跨平台的用来监控Unix/linux系统(比如Linux、BSD、OSX、Solaris)的工具。Monit特别易于安装,而且非常轻量级(只有500KB大小),并且不依赖任何第三方程序、插件或者库。然而,Monit可以胜任全面监控、进程状态监控、文件系统变动监控、邮件通知和对核心服务的自定义回调等场景。易于安装、轻量级的实现以及强大的功能,让Monit成为一个理想的后备监控工具。 +[Monit][3]是一个跨平台的用来监控Unix/linux系统(比如Linux、BSD、OSX、Solaris)的工具。Monit特别易于安装,而且非常轻量级(只有500KB大小),并且不依赖任何第三方程序、插件或者库。然而,Monit可以胜任全面监控、进程状态监控、文件系统变动监控、邮件通知和对核心服务的自定义动作等场景。易于安装、轻量级的实现以及强大的功能,让Monit成为一个理想的后备监控工具。 我已经在一些机器使用Monit几年了,而且我对它的可靠性非常满意。甚至作为全面的监控系统,对任何Linux系统管理员来说Monit也是非常有用和强大的。在这篇教程中,我会展示如何在一个本地服务器部署Monit(作为后备监控系统)来监控常见的服务。在部署过程中,我只会展示我们用到的部分。 @@ -24,16 +24,16 @@ Fedora或者CentOS/RHEL: # yum install monit -Monit自带一个文档完善的配置文件,其中包含了很多例子。主配置文件在/etc/monit.conf(Fedora/CentOS/RHEL),或者/etc/monit/monitrc(Debian/Ubuntu/Mint)。Monit配置文件有两部分:“Global”(全局)和“Services”(服务)。 +Monit自带一个文档完善的配置文件,其中包含了很多例子。主配置文件在/etc/monit.conf(Fedora/CentOS/RHEL 中),或者/etc/monit/monitrc(Debian/Ubuntu/Mint 中)。Monit配置文件有两部分:“Global”(全局)和“Services”(服务)。 -### Global Configuration: Web Status Page (全局配置:Web状态页面。LCTT 译注:保留原文是因为和配置文件中的字段对应) ### +### Global Configuration: Web Status Page (全局配置:Web状态页面) ### -Monit可以使用邮件服务来发送通知,也可以使用HTTP/HTTPS页面来展示。我们先使用符合以下要求的web状态页面吧: +Monit可以使用邮件服务来发送通知,也可以使用HTTP/HTTPS页面来展示。我们先使用如下配置的web状态页面吧: - Monit监听1966端口。 - 对web状态页面的访问是通过SSL加密的。 - 使用monituser/romania作为用户名/口令登录。 -- 只允许使用localhost、myhost.mydomain.ro和在局域网内部(192.168.0.0/16)访问。 +- 只允许通过localhost、myhost.mydomain.ro和在局域网内部(192.168.0.0/16)访问。 - Monit使用pem格式的SSL证书。 之后的步骤,我会使用一个基于Red Hat的系统。在基于Debian的系统中的步骤也是类似的。 @@ -99,10 +99,10 @@ Monit可以使用邮件服务来发送通知,也可以使用HTTP/HTTPS页面 我们必须定义“idfile”,Monit守护进程的一个独一无二的ID文件;以及“eventqueue”,当monit的邮件因为SMTP或者网络故障发不出去,邮件会暂存在这里;以及确保/var/monit路径是存在的。然后使用下边的配置就可以了。 set idfile /var/monit/id - set eventqueue + set eventqueue basedir /var/monit -### 测试Global Configuration(全局配置) ### +### 测试全局配置 ### 现在“Global”部分就完成了。Monit配置文件看起来像这样: @@ -163,11 +163,11 @@ Monit可以使用邮件服务来发送通知,也可以使用HTTP/HTTPS页面 现在打开一个浏览器窗口,然后访问`https://:1966`。将``替换成Monit所在机器的机器名或者IP地址。 -如果你使用的是自签名的SSL证书,你会在浏览器中看到一个警告信息。 +如果你使用的是自签名的SSL证书,你会在浏览器中看到一个警告信息。继续访问即可。 ![](https://farm8.staticflickr.com/7596/16737206479_96b9f7dfdb_c.jpg) -你完成登录后,一定要看这个页面。 +你完成登录后,就会看到这个页面。 ![](https://farm8.staticflickr.com/7594/16303369973_6019482dea_c.jpg) @@ -209,7 +209,7 @@ Monit可以使用邮件服务来发送通知,也可以使用HTTP/HTTPS页面 if failed port 22 protocol ssh then restart if 5 restarts within 5 cycles then timeout -我们可以这样解释上述配置。我们检查是否存在名为sshd的进程,并且有一个保存pid的文件存在(/var/run/sshd.pid)。如果任何一个不存在,我们就使用启动脚本重启sshd。我们检查是否有进程在监听22端口,并且使用的是SSH协议。如果没有,我们还是重启sshd。如果在最近的5个监控周期(5x120秒)至少重启5次了,sshd就被认为是不能用的,我们就不再检查了。 +我们可以这样解释上述配置:我们检查是否存在名为sshd的进程,并且有一个保存其pid的文件存在(/var/run/sshd.pid)。如果任何一个不存在,我们就使用启动脚本重启sshd。我们检查是否有进程在监听22端口,并且使用的是SSH协议。如果没有,我们还是重启sshd。如果在最近的5个监控周期(5x120秒)至少重启5次了,sshd就被认为是不能用的,我们就不再检查了。 ![](https://farm9.staticflickr.com/8685/16735725998_62c26a24bc_c.jpg) @@ -236,7 +236,7 @@ via: http://xmodulo.com/server-monitoring-system-monit.html 作者:[Iulian Murgulet][a] 译者:[goreliu](https://github.com/goreliu) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 @@ -244,7 +244,7 @@ via: http://xmodulo.com/server-monitoring-system-monit.html [1]:http://xmodulo.com/monitor-common-services-nagios.html [2]:http://xmodulo.com/monitor-linux-servers-snmp-cacti.html [3]:http://mmonit.com/monit/ -[4]:http://xmodulo.com/how-to-set-up-epel-repository-on-centos.html +[4]:https://linux.cn/article-2324-1.html [5]:http://xmodulo.com/how-to-set-up-rpmforge-repoforge-repository-on-centos.html [6]:http://xmodulo.com/mail-server-ubuntu-debian.html [7]:http://mmonit.com/wiki/Monit/ConfigurationExamples \ No newline at end of file From 2ed75b5db2131ba061e9f384247773e4df774d57 Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 31 May 2015 00:05:53 +0800 Subject: [PATCH 212/965] PUB:20150227 Enjoy Android Apps on Ubuntu using ARChon Runtime @KayGuoWhu --- ...oid Apps on Ubuntu using ARChon Runtime.md | 28 ++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-) rename {translated/tech => published}/20150227 Enjoy Android Apps on Ubuntu using ARChon Runtime.md (79%) diff --git a/translated/tech/20150227 Enjoy Android Apps on Ubuntu using ARChon Runtime.md b/published/20150227 Enjoy Android Apps on Ubuntu using ARChon Runtime.md similarity index 79% rename from translated/tech/20150227 Enjoy Android Apps on Ubuntu using ARChon Runtime.md rename to published/20150227 Enjoy Android Apps on Ubuntu using ARChon Runtime.md index 4995eec9d1..4776f5c10d 100644 --- a/translated/tech/20150227 Enjoy Android Apps on Ubuntu using ARChon Runtime.md +++ b/published/20150227 Enjoy Android Apps on Ubuntu using ARChon Runtime.md @@ -1,18 +1,19 @@ -使用ARChon环境在Ubuntu上运行Android应用 +使用 ARChon 运行时环境在 Ubuntu 上运行 Android 应用 ================================================================================ -在此之前,我们尝试过在多款安卓应用模拟器工具上运行安卓应用,比如Genymotion、VirtualBox和Android SDK等。但是,有了这套全新的Chrome安卓运行环境,就可以在Chrome浏览器中运行安卓应用了。所以,下面是一些步骤来指导如何使用ARChon运行环境在Ubuntu上安装安卓应用。 -谷歌已经公布了[首批支持原生运行在Chrome OS的安卓应用][1],而使用一个全新的“**安卓运行环境**”扩展程序使其成为可能。如今,一位名为Vlad Filippov的开发者已经找到了一种把安卓应用移植到桌面端Chrome浏览器的方法。他把chromeos-apk脚本和ARChon安卓运行环境扩展程序两者紧密结合在一起,使得安卓应用可以运行在Windows、Max和Linux系统的桌面端Chrome浏览器中。 +在此之前,我们尝试过在多款安卓应用模拟器工具上运行安卓应用,比如Genymotion、VirtualBox和Android SDK等。但是,有了这套全新的Chrome安卓运行环境,就可以在Chrome浏览器中运行安卓应用了。所以,下面是一些步骤来指导你如何使用ARChon运行时环境在Ubuntu上安装安卓应用。 -应用借助这种运行环境时的性能并不是很好。同样,由于它是官方运行环境的非官方二次开发包,而且运行在Google的Chrome OS之外,因此一些如webcam和speaker等系统集成工具可能需要通过打补丁获得或者根本就没有。 +谷歌已经公布了[首批支持原生运行在Chrome OS的安卓应用][1],而这个全新的“**安卓运行时环境**”扩展程序使其成为可能。如今,一位名为Vlad Filippov的开发者已经找到了一种把安卓应用移植到桌面端Chrome浏览器的方法。他把chromeos-apk脚本和ARChon安卓运行环境扩展程序两者紧密结合在一起,使得安卓应用可以运行在Windows、Max和Linux系统的桌面端Chrome浏览器中。 + +应用借助这种运行环境时的性能并不是很好。同样,由于它是官方运行环境的非官方二次开发包,而且运行在Google的Chrome OS之外,因此一些如摄像头和喇叭等系统内置设备可能需要通过打补丁获得或者根本不支持。 ### 安装Chrome ### 首先,需要在机器上安装Chrome,版本要求是Chrome 37或者更高。可以从[Chrome浏览器的下载页面][2]下载。 -如果打算安装Dev Channel版本,按照如下操作。 +如果打算安装开发通道版本,按照如下操作。 -首先,使用这个命令为Google Chrome添加软件源列表: +使用这个命令为Google Chrome添加软件源列表: $ wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add - $ sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list' @@ -23,7 +24,8 @@ $ sudo apt-get update -现在,就可以安装非稳定版的google chrome,即开发版。 +现在,就可以安装非稳定版的google chrome,即开发版: + $ sudo apt-get install google-chrome-unstable ![Installing Google chrome unstable](http://blog.linoxide.com/wp-content/uploads/2015/02/installing-google-chrome-unstable.png) @@ -34,11 +36,11 @@ **32位** Ubntu发行版: -- [Download Archron for 32-bit Ubuntu][3] +- [下载 32 位版 Ubuntu 上的 Archron][3] **64位** Ubntu发行版: -- [Download Archron for 64-bit Ubuntu][4] +- [下载 64 位版 Ubuntu 上的 Archron][4] 下载好运行环境安装包后,从.zip文件中解压,并将解压得到的目录移动到Home目录。操作命令如下: @@ -48,11 +50,11 @@ $ unzip ARChon-v1.1-x86_32.zip ~/ -接下来是安装运行时环境,首先打开Google Chrome浏览器,在地址栏键入**chrome://extensions**。然后,选中“**开发者模式**”。最后,点击“**载入未打包扩展程序**”,选择刚才放置在**~/Home**下面的文件夹。 +接下来是安装运行时环境,首先打开Google Chrome浏览器,在地址栏键入**chrome://extensions**。然后,选中“**开发者模式**”。最后,点击“**载入未打包扩展程序**”,选择刚才放置在**~/Home**下面的文件夹。 ### 安装 ChromeOS-APK ### -如果要用到上面提到的应用,那么手动转换这些APKs无需复杂的操作——只需要安装“[chromeos-apk][5]”命令行JavaScript工具。可以在Node Package Modules(npm)管理器中安装它。为了安装npm和chromeos-apk,在shell或终端中运行下面命令: +如果要用到上面提到的那些应用,那么手动转换这些APK无需复杂的操作——只需要安装“[chromeos-apk][5]”命令行JavaScript工具。可以在Node Package Modules(npm)管理器中安装它。为了安装npm和chromeos-apk,在shell或终端中运行下面命令: $ sudo apt-get install npm nodejs nodejs-legacy @@ -86,7 +88,7 @@ ### 运行安卓Apk ### -最后,打开chrome浏览器,然后进入chrome://extensions页面,勾选开发者模式。点击“载入未打包扩展程序”按钮,选择文件夹载入刚创建的脚本。 +最后,打开chrome浏览器,然后进入chrome://extensions页面,勾选开发者模式。点击“载入未打包扩展程序”按钮,选择上面脚本刚创建的文件夹。 至此,就可以打开Chrome应用启动器运行安卓应用了。 @@ -100,7 +102,7 @@ via: http://linoxide.com/ubuntu-how-to/android-apps-ubuntu-archon-runtime/ 作者:[Arun Pyasi][a] 译者:[KayGuoWhu](https://github.com/KayGuoWhu) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 From ae08bb24fcc6f3f6b9f3d13caea85cc4bf76c8a4 Mon Sep 17 00:00:00 2001 From: sevenot Date: Sun, 31 May 2015 02:15:20 +0800 Subject: [PATCH 213/965] sevenot translated --- ...pired GTK And Icon Theme Paper in Linux.md | 31 ++++++++++++++----- 1 file changed, 23 insertions(+), 8 deletions(-) rename {sources => translated}/share/20150225 Install Google's Material Design Inspired GTK And Icon Theme Paper in Linux.md (63%) diff --git a/sources/share/20150225 Install Google's Material Design Inspired GTK And Icon Theme Paper in Linux.md b/translated/share/20150225 Install Google's Material Design Inspired GTK And Icon Theme Paper in Linux.md similarity index 63% rename from sources/share/20150225 Install Google's Material Design Inspired GTK And Icon Theme Paper in Linux.md rename to translated/share/20150225 Install Google's Material Design Inspired GTK And Icon Theme Paper in Linux.md index 105332bb07..4986ffadf8 100644 --- a/sources/share/20150225 Install Google's Material Design Inspired GTK And Icon Theme Paper in Linux.md +++ b/translated/share/20150225 Install Google's Material Design Inspired GTK And Icon Theme Paper in Linux.md @@ -1,54 +1,69 @@ -sevenot translating +sevenot translated Install Google’s Material Design Inspired GTK And Icon Theme Paper in Linux +来试试谷歌全新的设计语言Material Design和Linux下的图标主题Paper吧!灵感来源于图形工具包GTK。 ================================================================================ ![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/02/Paper_theme_Material_Design.jpg) [Paper][1] is a new upcoming GTK and icon theme inspired by Google’s [Material design][2] guidelines. It is developed by Sam Hewitt, the man behind [Moka Project][3]. Moka has always been in the list of [best themes for Ubuntu][4] and looking at Paper, I can say that once it is developed completely, it will surely be listed as one of the [best GTK themes][5]. +Paper是一款即将与广大朋友们见面的一个图形工具包和图标主题,它的设计灵感来自于谷歌的设计语言Material design。Paper由Sam Hewitt发起,Sam是Moka项目的一员,Moka总会设计出让人满意的Ubuntu主题。对于Paper,我敢说只要它一经推出,它必将是最好的主题开发包之一。 Yes, you heard it right. The theme is still under development. Therefore I suggest that if you want to install Paper theme in Ubuntu or any other Linux distributions, do it only for experimentation purpose. You may see some broken icons here and there but the over all experience is nice. +对的,你没有听错,Paper主题还在开发阶段。因此我建议,如果你想在你的Ubuntu或者它的衍生版本上安装Paper,最好抱着试一试的实验心态。因为你多多少少会发现一些破损的图标,但这并不影响整个实验的运行。 ### Install Paper theme in Ubuntu based distributions via PPA ### - +通过PPA在Ubuntu及其衍生版本上安装Paper主题 Sam has a dedicated PPA for Ubuntu based distributions. I recommend that you use this PPA instead of downloading the theme because you’ll be getting the updates on the themes regularly. This PPA is available for Ubuntu 15.04, Ubuntu 14.10, Ubuntu 14.04, Elementary OS Freya, Elementary OS Luna, Linux Mint 17, Linux Mint 16 and other Linux distributions based on Ubuntu. +Sam为Ubuntu和它的衍生版本设置了一个专用的PPA(PresonalPackgeArchives,个人软件包档案)。我会介绍通过PPA安装而不是下载Paper主题,因为你将会定期更新主题。这个PPA可供使用的系统有Ubuntu 15.04, Ubuntu 14.10, Ubuntu 14.04, Elementary OS Freya, Elementary OS Luna, Linux Mint 17, Linux Mint 16 和其它的Ubuntu衍生版本。 Open a terminal and use the following commands: - +打开终端,输入下列命令: sudo add-apt-repository ppa:snwh/pulp sudo apt-get update sudo apt-get install paper-gtk-theme paper-icon-theme ### Download Paper GTK and icon theme ### +下载Paper图形工具包和图标主题 If you do not want to use the PPA, you can download the themes and icons manually. As I said previously, you won’t get the updates automatically this way. +如果你不想用PPA,你可以手动下载主题和图标。但是就像刚才所说,这样你就无法自动更新。 - [Download Paper icon themes][6] - [Download Paper GTK themes][7] - +下载Paper图标主题 +下载Paper的GTK工具包 #### Using Paper themes and icons #### - +把它们用起来吧 I hope that you know how to change or install themes in your respective Linux distributions. If you are not unaware of it, below are few tutorials that could help you to install new themes: - +我希望你知道怎么在你的Ubuntu中安装或者更改主题。如果你不知道,下面几个教程将帮助你安装一个新的主题。 - [How to change themes in Ubuntu Unity][8] - [How to change themes in GNOME Shell][9] - [How to change themes in Linux Mint][10] - [How to change theme in Elementary OS Freya][11] +如何在标准Ubuntu中更改主题 +如何在GNOME桌面的Ubuntu中更改主题 +如何在Ubuntu Mint中更改主题 +如何在Elementary OS Freya中更改主题 #### Here is what Paper theme looks like #### +就是这样! Since I am using [Elementary OS Freya][12] these days, here are some of the screenshots of how Paper theme and icons look like in Elementary OS Freya. I have used a wallpaper with Material design look so that it blends well with the icon and themes. +自从我开始用Elementary OS Freya以来,这里就存有一些Paper主题和图标的截图。我用了Material Design做了一个桌面,这样可以更好的兼容主题和图标。 ![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/02/Material_Design_Paper_Theme_Elementary_OS_Freya_1.jpeg) ![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/02/Material_Design_Paper_Theme_Elementary_OS_Freya.jpeg) How do you find this Material design inspired theme? If you did use it, do share the screenshot of your desktop with rest of us here. +你的Material design 设计灵感是什么呢?如果你在使用Material design ,在评论里和我们分享你的桌面截图吧! + -------------------------------------------------------------------------------- via: http://itsfoss.com/install-paper-theme-linux/ 作者:[Abhishek][a] -译者:[译者ID](https://github.com/译者ID) +译者:[sevenot](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 @@ -65,4 +80,4 @@ via: http://itsfoss.com/install-paper-theme-linux/ [9]:http://itsfoss.com/install-switch-themes-gnome-shell/ [10]:http://itsfoss.com/install-icon-linux-mint/ [11]:http://itsfoss.com/install-themes-icons-elementary-os-freya/ -[12]:http://itsfoss.com/tag/elementary-os-freya/ \ No newline at end of file +[12]:http://itsfoss.com/tag/elementary-os-freya/ From 198d72f0ae3439131c8d311356b10bffdbe61f4a Mon Sep 17 00:00:00 2001 From: wwy-hust Date: Sun, 31 May 2015 15:42:36 +0800 Subject: [PATCH 214/965] finish translation of one article --- ... Custom Linux Distribution From Scratch.md | 65 ------------------- ... Custom Linux Distribution From Scratch.md | 65 +++++++++++++++++++ 2 files changed, 65 insertions(+), 65 deletions(-) delete mode 100644 sources/share/20150527 How to Develop Own Custom Linux Distribution From Scratch.md create mode 100644 translated/share/20150527 How to Develop Own Custom Linux Distribution From Scratch.md diff --git a/sources/share/20150527 How to Develop Own Custom Linux Distribution From Scratch.md b/sources/share/20150527 How to Develop Own Custom Linux Distribution From Scratch.md deleted file mode 100644 index 9bf07333ea..0000000000 --- a/sources/share/20150527 How to Develop Own Custom Linux Distribution From Scratch.md +++ /dev/null @@ -1,65 +0,0 @@ -How to Develop Own Custom Linux Distribution From Scratch -================================================================================ -Have you ever thought of making your own Linux Distribution? Every Linux user in their journey to Linux thought of making their own Linux distribution, at-least once. Even I was not an exception as a newbie to Linux land and have given my considerable time developing my own Linux Distribution. Developing a Linux Distribution from scratch is called Linux From Scratch (LFS) - -Before starting, I concluded a few things about LFS which can be described as: - -### 1. Those who want to develop their own Linux Distribution should understand the difference between Developing a Linux distribution from scratch (by scratch means starting from the beginning) or all you want is just to tweak an already available Linux Distro. ### - -If you just want to tweak flash screen, customize login and preferably work on the look and feel of Linux OS, you can choose any fair Linux Distribution and customize it the way you want. Moreover a lots of tweaking tools there will help. - -If you want to put all the necessary files and boot-loaders and kernel and choose what to include and what not to include and then compile everything yourselves you need to develop Linux From Scratch (LFS). - -**Note**: If you just want to customize the look and feel of a Linux OS, this guide is not for you. If you really want to develop a Linux distribution from scratch and want to know where to start and other basic information, here is the guide for you. - -### 2. Pros of Developing own Linux Distribution (LFS): ### - -- You get to know the internal working of Linux OS. -- You develop a very flexible OS as per your need. -- Your developed OS (LFS) will be very compact as you have full control over what to include/exclude. -- You Development (LFS) will have added security. - -### 3. Cons of Developing own Linux Distribution (LFS): ### - -Developing a Linux OS from scratch means putting all the necessary things together and compile. This requires a lot of reading, patience and time. Also you should have a working Linux System to develop LFS and fairly enough disk space. - -### 4. Interesting to know, that Gentoo/GNU Linux is closest to LFS to certain extent. Both Gentoo and LFS is the customized Linux System built entirely out from compilation of Source. ### - -### 5. You should be experienced Linux user having good knowledge of package compilation, resolving dependencies, and pro in shell scripting language. Knowledge of a programming language (Preferably C) will ease things for you. Even if you are a newbie but a good learner and grasp the things quickly, you may start as well. The most important part is you should not loose your enthusiasm throughout the process of LFS development. ### - -If you are not determined enough, I fear you may leave building your LFS in the middle. - -### 6. Now you need a step-by-step guide, So that Linux can be developed from scratch. LFS is the official guide to develop Linux From Scratch. Our partner site tradepub has made available LFS guide to our readers and that too for free. ### - -You can download the Linux From Scratch book from the below link: - -[![](http://www.tecmint.com/wp-content/uploads/2015/05/Linux-From-Scratch.gif)][1] - -Download: [Linux From Scratch][1] - -### About: Linux From Scratch ### - -This book is created by Gerard Beekmans, who is the Project Leader of LFS and Edited by Matthew Burgess and Bruse Dubbs, both of whom are Co-leader of the Project. This book is extensive and expands over 338 pages. - -Having covered – Introduction to LFS, Preparing for the build, Build LFS from Scratch, Setting up of Boot scripts, Making LFS Bootable followed by Appendices, it has all you want to know on LFS Project. - -Also this book gives you the estimated time required for the compilation of a package. The estimated time are calculated based upon the reference of the compilation time of the first package. All the details are presented in a manner easy to understand and implement, even for newbies. - -If you have plenty of time and really interested in developing your own Linux Distribution you would never want to miss a chance to download this ebook and that too for free. All you need is, to start developing your own Linux OS using this ebook along with a working Linux OS (Any Linux Distribution with enough Disk Space), Time and Enthusiasm. - -If Linux fascinates you, if you want to understand Linux from scratch and want to develop your own Linux Distribution, then this is all you should know at this stage, for most of other things you may like to refer to the book, in the above link. - -Also let me know your experience with the book. How ease it was to get along the elaborated LFS guide? Also if you have already Developed a LFS and want to give some tips to our readers, your feedbacks are welcome. - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/create-custom-linux-distribution-from-scratch/ - -作者:[Avishek Kumar][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.tecmint.com/author/avishek/ -[1]:http://tecmint.tradepub.com/free/w_linu01/prgm.cgi \ No newline at end of file diff --git a/translated/share/20150527 How to Develop Own Custom Linux Distribution From Scratch.md b/translated/share/20150527 How to Develop Own Custom Linux Distribution From Scratch.md new file mode 100644 index 0000000000..059f07b195 --- /dev/null +++ b/translated/share/20150527 How to Develop Own Custom Linux Distribution From Scratch.md @@ -0,0 +1,65 @@ +δԼLinuxа +================================================================================ +ǷԼLinuxа棿ÿLinuxûʹLinuxĹжһԼķа棬һΡҲ⣬ΪһLinuxҲǹһԼLinuxа档һLinuxа汻Linux From Scratch (LFS) + +ڿʼ֮ǰܽһЩLFSݣ£ + +### 1. ЩҪԼLinuxаӦ˽һLinuxа棨ζŴͷʼһеLinuxаIJͬ ### + +ֻĻʾƵ¼Լӵиõʹ顣ѡκһLinuxа沢ҰϲýиԻá⣬ù߿԰ + +бļboot-loadersںˣѡʲôñȻԼһжôҪLinux From Scratch (LFS) + +**ע**ֻҪLinuxϵͳ飬ָϲʺһLinuxа棬˽ôʼԼһЩϢôָΪд + +### 2. һLinuxа棨LFSĺô ### + +- ˽Linuxϵͳڲ +- һӦϵͳ +- ϵͳLFSdzգΪԸð/ðʲôӵоԵƿ +- ϵͳLFSڰȫϻ + +### 3. һLinuxа棨LFSĻ ### + +һLinuxϵͳζŽҪĶһұ֮Ҫġĺʱ䡣ҪһõLinuxϵͳ㹻Ĵ̿ռLinuxϵͳ + +### 4. ȤǣGentoo/GNU LinuxijӽLFSGentooLFSȫԴĶƵLinuxϵͳ ### + +### 5. ӦһоLinuxûԱ൱˽⣬Ǹshellűרҡ˽һűԣCãʹЩһֻ֣ҪһѧϰߣԺ֪ܿʶҲԿʼҪDzҪLFSжʧ顣 ### + +ᶨ»LFSеһʱ + +### 6. ҪһһָһLinuxLFSǴLinuxĹٷָϡǵĴվtradepubҲΪǵĶLFSָϣͬѵġ ### + +ԴLinux From Scratch鼮 + +[![](http://www.tecmint.com/wp-content/uploads/2015/05/Linux-From-Scratch.gif)][1] + +: [Linux From Scratch][1] + +### ڣLinux From Scratch ### + +ⱾLFSĿͷGerard BeekmansģMatthew BurgessBruse Dubbs༭˶LFSĿ쵼ˡⱾݺܹ㷺338ҳ + +ݰLFS׼LinuxLFSűʹLFS͸¼к֪LFSĿж + +Ȿ黹˱һԤʱ䡣ԤʱԱһʱΪοеĶķʽ֣˵ + +гԣʱ䲢ԹԼLinuxаȤôԲ飨أĻᡣҪģⱾһLinuxϵͳκLinuxа棬㹻Ĵ̿ռ伴ɣпʼԼLinuxϵͳʱ顣 + +LinuxʹԣԼֹһԼLinuxа棬ֽ׶Ӧ֪ȫˣϢԲοӵеݡ + +˽Ķ/ʹⱾľⱾ꾡LFSָϵʹǷ㹻򵥣ѾһLFSǵĶһЩ飬ӭԺͷ + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/create-custom-linux-distribution-from-scratch/ + +ߣ[Avishek Kumar][a] +ߣ[wwy-hust](https://github.com/wwy-hust) +Уԣ[УID](https://github.com/УID) + + [LCTT](https://github.com/LCTT/TranslateProject) ԭ룬[Linuxй](https://linux.cn/) Ƴ + +[a]:http://www.tecmint.com/author/avishek/ +[1]:http://tecmint.tradepub.com/free/w_linu01/prgm.cgi From df3f55150a670df304e6bcb79811f2c8c6ce8b40 Mon Sep 17 00:00:00 2001 From: geekpi Date: Sun, 31 May 2015 15:53:23 +0800 Subject: [PATCH 215/965] translating --- .../20150527 How To Check Laptop CPU Temperature In Ubuntu.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150527 How To Check Laptop CPU Temperature In Ubuntu.md b/sources/tech/20150527 How To Check Laptop CPU Temperature In Ubuntu.md index 4dc3291ac9..6c28b189da 100644 --- a/sources/tech/20150527 How To Check Laptop CPU Temperature In Ubuntu.md +++ b/sources/tech/20150527 How To Check Laptop CPU Temperature In Ubuntu.md @@ -1,3 +1,5 @@ +Translating----geekpi + How To Check Laptop CPU Temperature In Ubuntu ================================================================================ ![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/05/Monitor_temperature_Ubuntu.png) @@ -79,4 +81,4 @@ via: http://itsfoss.com/check-laptop-cpu-temperature-ubuntu/ [a]:http://itsfoss.com/author/abhishek/ [1]:http://wpitchoune.net/blog/psensor/ [2]:http://www.lm-sensors.org/ -[3]:https://wiki.archlinux.org/index.php/Hddtemp \ No newline at end of file +[3]:https://wiki.archlinux.org/index.php/Hddtemp From c330f2009bc84c8672367ad3142ef3e980c3bfc2 Mon Sep 17 00:00:00 2001 From: geekpi Date: Sun, 31 May 2015 16:27:20 +0800 Subject: [PATCH 216/965] translated --- ... Check Laptop CPU Temperature In Ubuntu.md | 84 ------------------- ... Check Laptop CPU Temperature In Ubuntu.md | 83 ++++++++++++++++++ 2 files changed, 83 insertions(+), 84 deletions(-) delete mode 100644 sources/tech/20150527 How To Check Laptop CPU Temperature In Ubuntu.md create mode 100644 translated/tech/20150527 How To Check Laptop CPU Temperature In Ubuntu.md diff --git a/sources/tech/20150527 How To Check Laptop CPU Temperature In Ubuntu.md b/sources/tech/20150527 How To Check Laptop CPU Temperature In Ubuntu.md deleted file mode 100644 index 6c28b189da..0000000000 --- a/sources/tech/20150527 How To Check Laptop CPU Temperature In Ubuntu.md +++ /dev/null @@ -1,84 +0,0 @@ -Translating----geekpi - -How To Check Laptop CPU Temperature In Ubuntu -================================================================================ -![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/05/Monitor_temperature_Ubuntu.png) - -Overheating of laptops is a common issue one faces these days. Monitoring hardware temperature may help you to diagnose why laptop is getting overheated. In this article, we’ll see **how to check CPU temperature in Ubuntu**. - -We are going to use a GUI tool [Psensor][1] that allows you to monitor hardware temperature in Linux. With Psensor you can: - -- monitor the temperature of the motherboard and CPU sensors -- monitor the temperature of the NVidia GPUs -- monitor the temperature of the Hard Disk Drives -- monitor the rotation speed of the fans -- monitor the CPU usage - -Latest version of Psensor also provides applet indicator for Ubuntu and thus it makes the monitoring of hardware temperature even easier in Ubuntu. You can choose to display the temperature right in the top panel itself. It even sends a desktop notification when the temperature exceeds the limit. - -### How to install Psensor in Ubuntu 15.04 and 14.04 ### - -Before you install Psensor, you need to install and configure [lm-sensors][2], a command line utility for hardware monitoring. If you want to measure hard disk temperature, you need to install [hddtemp][3] as well. To install these tools, run the following command in a terminal: - - sudo apt-get install lm-sensors hddtemp - -Then start the detection of your hardware sensors: - - sudo sensors-detect - -To make sure that it works, run the command below: - - sensors - -It will give you an output like: - - acpitz-virtual-0 - Adapter: Virtual device - temp1: +43.0°C (crit = +98.0°C) - - coretemp-isa-0000 - Adapter: ISA adapter - Physical id 0: +44.0°C (high = +100.0°C, crit = +100.0°C) - Core 0: +41.0°C (high = +100.0°C, crit = +100.0°C) - Core 1: +40.0°C (high = +100.0°C, crit = +100.0°C) - -If everything seems alright, proceed with the installation of Psensor by using the command below: - - sudo apt-get install psensor - -Once installed, run the application by looking for it in Unity Dash. At first run, you should configure on what stats do you want to collect in Psensor. - -![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/05/Psensor_Ubuntu.jpeg) - -### Display temperature in the panel ### - -If you want to show the temperature in the top panel, go to **Sensor Preferences**: - -![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/05/Psensor_Ubuntu_1.jpeg) - -Then under the **Application Indicator** menu, select the component for which you want to display the temperature and then check the **Display sensor in the label** option. - -![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/05/Psensor_Ubuntu_2.jpeg) - -### Start Psensor at each start up ### - -Go to **Preferences->Startup** and the check **Launch on session startup** to start Psensor at each boot. - -![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/05/Psensor_Ubuntu_3.jpeg) - -That’s it. All you need to monitor the CPU temperature is here. You can keep an eye on it and it may help you find out which process is overheating your computer. - --------------------------------------------------------------------------------- - -via: http://itsfoss.com/check-laptop-cpu-temperature-ubuntu/ - -作者:[Abhishek][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://itsfoss.com/author/abhishek/ -[1]:http://wpitchoune.net/blog/psensor/ -[2]:http://www.lm-sensors.org/ -[3]:https://wiki.archlinux.org/index.php/Hddtemp diff --git a/translated/tech/20150527 How To Check Laptop CPU Temperature In Ubuntu.md b/translated/tech/20150527 How To Check Laptop CPU Temperature In Ubuntu.md new file mode 100644 index 0000000000..ace8999edb --- /dev/null +++ b/translated/tech/20150527 How To Check Laptop CPU Temperature In Ubuntu.md @@ -0,0 +1,83 @@ +如何在Ubuntu中检查笔记本CPU的温度 +================================================================================ +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/05/Monitor_temperature_Ubuntu.png) + +笔记本过热是最近一个常见的问题。监控硬件温度或许可以帮助你诊断笔记本为什么会过热。本篇中,我们会**了解如何在Ubuntu中检查CPU的温度**。 + +我们将使用一个GUI工具[Psensor][1],它允许你在Linux中监控硬件温度。用Psensor你可以: + +- 监控cpu和主板的温度 +- 监控NVidia GPU的文档 +- 监控硬盘的温度 +- 监控风扇的速度 +- 监控CPU的利用率 + +Psensor最新的版本同样提供了Ubuntu中的指示小程序,这样使得在Ubuntu中监控温度变得更加容易。你可以选择在面板的右上角显示温度。它还会在温度上过阈值后通知。 + + +### 如何在Ubuntu 15.04 和 14.04中安装Psensor ### + +在安装Psensor前,你需要安装和配置[lm-sensors][2],一个用于硬件监控的命令行工具。如果你想要测量磁盘温度,你还需要安装[hddtemp][3]。要安装这些工具,运行下面的这些命令: + + sudo apt-get install lm-sensors hddtemp + +接着开始检测硬件传感器: + + sudo sensors-detect + +要确保已经工作,运行下面的命令: + + sensors + +它会给出下面这样的输出: + + acpitz-virtual-0 + Adapter: Virtual device + temp1: +43.0°C (crit = +98.0°C) + + coretemp-isa-0000 + Adapter: ISA adapter + Physical id 0: +44.0°C (high = +100.0°C, crit = +100.0°C) + Core 0: +41.0°C (high = +100.0°C, crit = +100.0°C) + Core 1: +40.0°C (high = +100.0°C, crit = +100.0°C) + +如果一切看上去没问题,使用下面的命令安装Psensor: + + sudo apt-get install psensor + +安装完成后,在Unity Dash中运行程序。第一次运行时,你应该配置Psensor该监控什么状态。 + +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/05/Psensor_Ubuntu.jpeg) + +### 在面板显示温度 ### + +如果你想要在面板中显示温度,进入**Sensor Preferences**: + +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/05/Psensor_Ubuntu_1.jpeg) + +在 **Application Indicator** 菜单下,选择你想要显示温度的组件并勾上 **Display sensor in the label** 选项。 + +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/05/Psensor_Ubuntu_2.jpeg) + +### 每次启动启动Psensor ### + +进入 **Preferences->Startup** 并选择 **Launch on session startup** 使每次启动时启动Psensor。 + +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/05/Psensor_Ubuntu_3.jpeg) + +就是这样。你所要做的就是在这里监控CPU温度。你可以时刻注意并帮助你找出使计算机过热的进程。 + +-------------------------------------------------------------------------------- + +via: http://itsfoss.com/check-laptop-cpu-temperature-ubuntu/ + +作者:[Abhishek][a] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://itsfoss.com/author/abhishek/ +[1]:http://wpitchoune.net/blog/psensor/ +[2]:http://www.lm-sensors.org/ +[3]:https://wiki.archlinux.org/index.php/Hddtemp From ca4a1920a63e9e116c843502502b77906a0aca2d Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 31 May 2015 21:27:16 +0800 Subject: [PATCH 217/965] =?UTF-8?q?=E5=9B=9E=E6=94=B6=E6=9C=AA=E8=B6=85?= =?UTF-8?q?=E6=9C=9F=E6=96=87=E7=AB=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @wyangsun @KevinSJ @DongShuaike @createyuan @runningwater @wangjiezhe --- ...k Interface Names for Ubuntu and Debian.md | 31 ------ ... Great for Remote Editing and Much More.md | 1 - ...7 10 Truly Amusing Easter Eggs in Linux.md | 1 - ...nd Downstream--why packaging takes time.md | 97 ------------------- ...rity Bug Hits Linux, But is it That Bad.md | 34 ------- ...Installing Cisco Packet tracer in Linux.md | 2 - ...A TCP or UDP Network Monitoring Utility.md | 2 - ...Command Line Using 'Speedtest-CLI' Tool.md | 2 - ...M (Logical Volume Management) in Ubuntu.md | 1 - ...r Easy Partition Resizing and Snapshots.md | 1 + ... remote desktop on Linux VPS using x2go.md | 2 - ...Websites and Downloading Files in Linux.md | 1 - ...erver behind NAT via reverse SSH tunnel.md | 2 - 13 files changed, 1 insertion(+), 176 deletions(-) delete mode 100644 sources/news/20150511 Ubuntu Devs Propose Stateless Persistent Network Interface Names for Ubuntu and Debian.md delete mode 100644 sources/talk/20140818 Upstream and Downstream--why packaging takes time.md delete mode 100644 sources/talk/20150205 GHOST--Another Security Bug Hits Linux, But is it That Bad.md diff --git a/sources/news/20150511 Ubuntu Devs Propose Stateless Persistent Network Interface Names for Ubuntu and Debian.md b/sources/news/20150511 Ubuntu Devs Propose Stateless Persistent Network Interface Names for Ubuntu and Debian.md deleted file mode 100644 index d3d8014817..0000000000 --- a/sources/news/20150511 Ubuntu Devs Propose Stateless Persistent Network Interface Names for Ubuntu and Debian.md +++ /dev/null @@ -1,31 +0,0 @@ -Ubuntu Devs Propose Stateless Persistent Network Interface Names for Ubuntu and Debian -====================================================================================== -*Networks are detected in an unpredictable and unstable order* - -**Martin Pitt, a renown Ubuntu and Debian developer, came with the proposal of enabling stateless persistent network interface names in the upcoming versions of the Ubuntu Linux and Debian GNU/Linux operating systems.** - -According to Mr. Pitt, it appears that the problem lies in the automatic detection of network interfaces within the Linux kernel. As such, network interfaces are detected in an unstable and unpredictable order. However, it order to connect to a certain network interface in ifupdown or networkd users will need to identify it first using a stable name. - -"The general schema for this is to have an udev rule which does some matches to identify a particular interface, and assings a NAME="foo" to it," says Martin Pitt in an email to the Ubuntu mailinglist. "Interfaces with an explicit NAME= get called just like this, and others just get a kernel driver default, usually ethN, wlanN, or sometimes others (some wifi drivers have their own naming schemas)." - -**Sever solutions appeared over the years: mac, biosdevname, and ifnames** - -Apparently, several solutions are available for this problem, including an installation of an udev rule in /lib/udev/rules.d/75-persistent-net-generator.rules that creates a MAC address at first boot and writes it to /etc/udev/rules.d/70-persistent-net.rules, which is currently used by default in Ubuntu and applies to most hardware components. - -Other solutions include biosdevname, a package that reads port or index numbers, and slot names from the BIOS and writes them to /lib/udev/rules.d/71-biosdevname.rules, and ifnames, a persistent name generator that automatically checks the BIOS and/or firmware for index numbers or slot names, similar to biosdevname. - -However, the difference between ifnames and biosdevname is that the latter falls back to slot names, such as PCI numbers, and then to the MAC address and writes to /lib/udev/rules.d/80-net-setup-link.rules. All of these solutions can be combined, and Martin Pitt proposes to replace the first solution that is now used by default with the ifnames one. - -If a new solution is implemented, a lot of networking issues will be resolved in Ubuntu, especially the cloud version. In addition, it will provide for stable network interface names for all new Ubuntu installations, and resolve many other problems related to system-image, etc. - --------------------------------------------------------------------------------- - -via: http://news.softpedia.com/news/Ubuntu-Devs-Propose-Stateless-Persistent-Network-Interface-Names-for-Ubuntu-and-Debian-480730.shtml - -作者:[Marius Nestor][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://news.softpedia.com/editors/browse/marius-nestor diff --git a/sources/share/20141013 Compact Text Editors Great for Remote Editing and Much More.md b/sources/share/20141013 Compact Text Editors Great for Remote Editing and Much More.md index 21b0756b9a..3cdb43d879 100644 --- a/sources/share/20141013 Compact Text Editors Great for Remote Editing and Much More.md +++ b/sources/share/20141013 Compact Text Editors Great for Remote Editing and Much More.md @@ -1,4 +1,3 @@ -wyangsun翻译中 Compact Text Editors Great for Remote Editing and Much More ================================================================================ A text editor is software used for editing plain text files. This type of software has many different uses including modifying configuration files, writing programming language source code, jotting down thoughts, or even making a grocery list. Given that editors can be used for such a diverse range of activities, it is worth spending the time finding an editor that best suites your preferences. diff --git a/sources/share/20150407 10 Truly Amusing Easter Eggs in Linux.md b/sources/share/20150407 10 Truly Amusing Easter Eggs in Linux.md index 413d50d6d6..3ab7f47b79 100644 --- a/sources/share/20150407 10 Truly Amusing Easter Eggs in Linux.md +++ b/sources/share/20150407 10 Truly Amusing Easter Eggs in Linux.md @@ -1,4 +1,3 @@ -KevinSJ translating 10 Truly Amusing Easter Eggs in Linux ================================================================================ ![](http://en.wikipedia.org/wiki/File:Adventure_Easteregg.PNG) 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 deleted file mode 100644 index fc1c708b14..0000000000 --- a/sources/talk/20140818 Upstream and Downstream--why packaging takes time.md +++ /dev/null @@ -1,97 +0,0 @@ -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. - -"KDE" used to be released once every nine months or less frequently. But yesterday I released the [first bugfix update to Plasma][1], to make that happen I spent some time on Thursday with David making the [first update to Frameworks 5][2]. But Plasma 5 is still a work in progress for us distros, let's not forget about [KDE SC 4.13.3][3] which Philip has done his usual spectacular job of updating in the 14.04 LTS archive or [KDE SC 4.14 betas][4] which Scarlett has been packaging for utopic and backporting to 14.04 LTS. KDE SC used to be 20 tars, now it's 169 and over 50 langauge packs. - -### Patches ### - -If we were packaging it without any automation as used to be done it would take an age but of course we do automate the repetative tasks, the [KDE SC 4.13.97 status][5] page shows all the packages and highlights obvious problems. But with 169 tars even running the automated script takes a while, then you have to fix any patches that no longer apply. We have [policies][6] to disuade having patches, any patches should be upstream in KDE or on their way upstream, but sometimes it's unavoidable that we have some to maintain which often need small changes for each upstream release. - -### Symbols ### - -Much of what we package are libraries and if one small bit changes in the library, any applications which use that library will crash. This is ABI and the rules for [binary compatibility][7] in C++ are nuts. Not infrequently someone in KDE will alter a library ABI without realising. So we maintain symbol files to list all the symbols, these can often feel like more trouble than they're worth because they need updated when a new version of GCC produces different symbols or when symbols disappear and on investigation they turn out to be marked private and nobody will be using them anyway, but if you miss a change and apps start crashing as nearly happened in KDE PIM last week then people get grumpy. - -### Copyright ### - -Debian, and so Ubuntu, documents the copyright licence of every files in every package. This is a very slow and tedious job but it's important that it's done both upstream and downstream because it you don't people won't want to use your software in a commercial setting and at worst you could end up in court. So I maintain the [licensing policy][8] and not infrequently have to fix bits which are incorrectly or unclearly licenced and answer questions such as today I was reviewing whether a kcm in frameworks had to be LGPL licenced for Eike. We write a copyright file for every package and again this can feel like more trouble than its worth, there's no easy way to automate it but by some readings of the licence texts it's necessary to comply with them and it's just good practice. It also means that if someone starts making claims like requiring licencing for already distributed binary packages I'm in an informed position to correct such nonsense. - -### Descriptions ### - -When we were packaging KDE Frameworks from scratch we had to find a descirption of each Framework. Despite policies for metadata some were quite underdescribed so we had to go and search for a sensible descirption for them. Infact not infrequently we'll need to use a new library which doesn't even have a sensible paragraph describing what it does. We need to be able to make a package show something of a human face. - -### Multiarch ### - -A recent addition to the world of .deb packaging is [MultiArch][9] which allows i386 packages to be installed on amd64 computers as well as some even more obscure combinations (powerpc on ppcel64 anyone?). This lets you run Skype on your amd64 computer without messy cludges like the ia32-libs package. However it needs quite a lot of attention from packagers of libraries marking which packages are multiarch, which depend on other multiarch or arch independent packages and even after packaging KDE Frameworks I'm not entirely comfortable with doing it. - -### Splitting up Packages ### - -We spend lots of time splitting up packages. When say Calligra gets released it's all in one big tar but you don't want all of it on your system because you just want to write a letter in Calligra Words and Krita has lots of image and other data files which take up lots of space you don't care for. So for each new release we have to work out which of the installed files go into which .deb package. It takes time and even worse occationally we can get it wrong but if you don't want heaps of stuff on your computer you don't need then it needs to be done. It's also needed for library upgrades, if there's a new version of libfoo and not all the programs have been ported to it then you can install libfoo1 and libfoo2 on the same system without problems. That's not possible with distros which don't split up packages. - -One messy side effect of this is that when a file moves from one .deb to another .deb made by the same sources, maybe Debian chose to split it another way and we want to follow them, then it needs a Breaks/Replaces/Conflicts added. This is a pretty messy part of .deb packaging, you need to specify which version it Breaks/Replaces/Conflicts and depending on the type of move you need to specify some combination of these three fields but even experienced packages seem to be unclear on which. And then if a backport (with files in original places) is released which has a newer version than the version you specify in the Breaks/Replaces/Conflicts it just refuses to install and stops half way through installing until a new upload is made which updates the Breaks/Replaces/Conflicts version in the packaging. I'd be interested in how this is solved in the RPM world. - -### Debian Merges ### - -Ubuntu is forked from Debian and to piggy back on their work (and add our own bugs while taking the credit) we merge in Debian's packaging at the start of each cycle. This is fiddly work involving going through the diff (and for patches that's often a diff of a diff) and changelog to work out why each alternation was made. Then we merge them together, it takes time and it's error prone but it's what allows Ubuntu to be one of the most up to date distros around even while much of the work gone into maintaining universe packages not part of some flavour has slowed down. - -### Stable Release Updates ### - -You have Kubuntu 14.04 LTS but you want more? You want bugfixes too? Oh but you want them without the possibility of regressions? Ubuntu has quite strict definition of what's allowed in after an Ubuntu release is made, this is because once upon a time someone uploaded a fix for X which had the side effect of breaking X on half the installs out there. So for any updates to get into the archive they can only be for certain packages with a track record of making bug fix releases without sneaking in new features or breaking bits. They need to be tested, have some time passed to allow for wider testing, be tested again using the versions compiled in Launchpad and then released. KDE makes bugfix releases of KDE SC every month and we update them in the latest stable and LTS releases as [4.13.3 was this week][10]. But it's not a process you can rush and will take a couple of weeks usually. That 4.13.3 update was even later then usual because we were busy with Plasma 5 and whatnot. And it's not perfect, a bug in Baloo did get through with 4.13.2. But it would be even worse if we did rush it. - -### Backports ### - -Ah but you want new features too? We don't allow in new features into the normal updates because they will have more chance of having regressions. That's why we make backports, either in the kubuntu-ppa/backports archive or in the ubuntu backports archive. This involves running the package through another automation script to change whever needs changed for the backport then compiling it all, testing it and releasing it. Maintaining and running that backport script is quite faffy so sending your thanks is always appreciated. - -We have an allowance to upload new bugfix (micro releases) of KDE SC to the ubuntu archive because KDE SC has a good track record of fixing things and not breaking them. When we come to wanting to update Plasma we'll need to argue for another allowance. One controvertial issue in KDE Frameworks is that there's no bugfix releases, only monthly releases with new features. These are unlikely to get into the Ubuntu archive, we can try to argue the case that with automated tests and other processes the quality is high enough, but it'll be a hard sell. - -### Crack of the Day ### - -Project Neon provides packages of daily builds of parts of KDE from Git. And there's weekly ISOs that are made from this too. These guys rock. The packages are monolithic and install in /opt to be able to live alongside your normal KDE software. - -### Co-installability ### - -You should be able to run KDELibs 4 software on a Plasma 5 desktop. I spent quite a bit of time ensuring this is possible by having no overlapping files in kdelibs/kde-runtime and kde frameworks and some parts of Plasma. This wasn't done primarily for Kubuntu, many of the files could have been split out into .deb packages that could be shared between KDELibs 4 and Plasma 5, but other disros which just installs packages in a monolithic style benefitted. Some projects like Baloo didn't ensure they were co-installable, fine for Kubuntu as we can separate the libraries that need to be coinstalled from the binaries, but other distros won't be so happy. - -### Automated Testing ### - -Increasingly KDE software comes with its own test suite. Test suites are something that has been late coming to free software (and maybe software in general) but now it's here we can have higher confidence that the software is bug free. We run these test suites as part of the package compilation process and not infrequently find that the test suite doesn't run, I've been told that it's not expected for packagers to use it in the past. And of course tests fail. - -### Obscure Architectures ### - -In Ubuntu we have some obscure architectures. 64-bit Arm is likely to be a useful platform in the years to come. I'm not sure why we care about 64-bit powerpc, I can only assume someone has paid Canonical to care about it. Not infrequently we find software compiles fine on normal PCs but breaks on these obscure platforms and we need to debug why they is. This can be a slow process on ARM which takes an age to do anything, or very slow where I don't even have access to a machine to test on, but it's all part of being part of a distro with many use-cases. - -### Future Changes ### - -At Kubuntu we've never shared infrstructure with Debian despite having 99% the same packaging. This is because Ubuntu to an extent defines itself as being the technical awesomeness of Debian with smoother processes. But for some time Debian has used git while we've used the slower bzr (it was an early plan to make Ubuntu take over the world of distributed revision control with Bzr but then Git came along and turned out to be much faster even if harder to get your head around) and they've also moved to team maintainership so at last we're planning [shared repositories][11]. That'll mean many changes in our scripts but should remove much of the headache of merges each cycle. - -There's also a proposal to [move our packaging to daily builds][12] so we won't have to spend a lot of time updating packaging at every release. I'm skeptical if the hassle of the infrastructure for this plus fixing packaging problems as they occur each day will be less work than doing it for each release but it's worth a try. - -### ISO Testing ### - -Every 6 months we make an Ubuntu release (which includes all the flavours of which Ubuntu [Unity] is the flagship and Kubuntu is the most handsome) and there's alphas and betas before that which all need to be tested to ensure they actually install and run. Some of the pain of this has reduced since we've done away with the alternative (text debian-installer) images but we're nowhere near where Ubuntu [Unity] or OpenSUSE is with OpenQA where there are automated installs running all the time in various setups and some magic detects problems. I'd love to have this set up. - -I'd welcome comments on how any workflow here can be improved or how it compares to other distributions. It takes time but in Kubuntu we have a good track record of contributing fixes upstream and we all are part of KDE as well as Kubuntu. As well as the tasks I list above about checking copyright or co-installability I do Plasma releases currently, I just saw Harald do a Phonon release and Scott's just applied for a KDE account for fixes to PyKDE. And as ever we welcome more people to join us, we're in #kubuntu-devel where free hugs can be found, and we're having a whole day of Kubuntu love at Akademy. - --------------------------------------------------------------------------------- - -via: https://blogs.kde.org/2014/08/13/upstream-and-downstream-why-packaging-takes-time - -作者:[Jonathan Riddell][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:https://blogs.kde.org/users/jriddell -[1]:https://dot.kde.org/2014/08/12/first-bugfix-update-plasma-5 -[2]:https://dot.kde.org/2014/08/07/kde-frameworks-5.1 -[3]:http://www.kubuntu.org/news/kde-sc-4.13.3 -[4]:https://dot.kde.org/2014/07/18/kde-ships-july-updates-and-second-beta-applications-and-platform-414 -[5]:http://qa.kubuntu.co.uk/ninjas-status/build_status_4.13.97_utopic.html -[6]:https://community.kde.org/Kubuntu/Policies -[7]:https://techbase.kde.org/Policies/Binary_Compatibility_Issues_With_C++ -[8]:https://techbase.kde.org/Policies/Licensing_Policy -[9]:https://help.ubuntu.com/community/MultiArch -[10]:http://www.kubuntu.org/news/kde-sc-4.13.3 -[11]:http://lists.alioth.debian.org/pipermail/pkg-kde-talk/2014-August/001934.html -[12]:https://lists.ubuntu.com/archives/kubuntu-devel/2014-August/008651.html \ No newline at end of file diff --git a/sources/talk/20150205 GHOST--Another Security Bug Hits Linux, But is it That Bad.md b/sources/talk/20150205 GHOST--Another Security Bug Hits Linux, But is it That Bad.md deleted file mode 100644 index 90923c1aae..0000000000 --- a/sources/talk/20150205 GHOST--Another Security Bug Hits Linux, But is it That Bad.md +++ /dev/null @@ -1,34 +0,0 @@ -GHOST: Another Security Bug Hits Linux, But is it That Bad? -================================================================================ -> GHOST, a newly announced security vulnerability that affects Linux servers and other systems that use the open source glibc library, is not as dangerous to data privacy as the Shellshock or Heartbleed bugs. - -![](http://thevarguy.com/site-files/thevarguy.com/files/imagecache/medium_img/uploads/2015/01/ghost-costume.jpg) - -Heartbleed is not even a year behind us, and the open source world has been hit with another major security vulnerability in the form of [GHOST][1], which involves holes in the Linux glibc library. This time, though, the actual danger may not live up to the hype. - -The GHOST vulnerability, which was announced last week by security researchers at [Qualys][2], resides in the gethostbyname*() functions of the glibc library. glibc is one of the core building blocks of most Linux systems, and gethostbyname*(), which resolves domain names into IP addresses, is widely used in open source applications. - -Attackers can exploit the GHOST security hole to create a buffer overflow, making it possible to execute any kind of code they want and do all sorts of nasty things. - -All of the above suggests that GHOST is bad news indeed. Fortunately for the open source community, however, the actual risk appears small. As TrendMicro [points out][3], the bug that makes the exploit possible has been fixed in glibc since May 2013, meaning that any Linux servers or PCs running more recent versions of the software are safe from attack. - -In addition, gethostbyname*() has been superseded by newer glibc functions that can better handle modern networking environments. Those include ones that use the IPv6 protocol, which gethostbyname*() doesn't support. As a result, newer applications often don't use the gethostbyname*() functions, and are not at risk. - -And perhaps most importantly, there's currently no known way of executing GHOST attacks through the Web. That greatly reduces opportunities for using this vulnerability to steal the data of unsuspecting users or otherwise wreak havoc. - -All in all, then, GHOST doesn't seem like a vulnerability that will prove as serious as Heartbleed or Shellshock, two other recent security problems that affected widely used open source software. - --------------------------------------------------------------------------------- - -via: http://thevarguy.com/open-source-application-software-companies/020415/ghost-another-security-bug-hits-linux-it-bad - -作者:[Christopher Tozzi][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://thevarguy.com/author/christopher-tozzi -[1]:https://community.qualys.com/blogs/laws-of-vulnerabilities/2015/01/27/the-ghost-vulnerability -[2]:http://qualys.com/ -[3]:http://blog.trendmicro.com/trendlabs-security-intelligence/not-so-spooky-linux-ghost-vulnerability/ \ No newline at end of file diff --git a/sources/tech/20150126 Installing Cisco Packet tracer in Linux.md b/sources/tech/20150126 Installing Cisco Packet tracer in Linux.md index 539a624e1f..c55a04c12c 100644 --- a/sources/tech/20150126 Installing Cisco Packet tracer in Linux.md +++ b/sources/tech/20150126 Installing Cisco Packet tracer in Linux.md @@ -1,5 +1,3 @@ -[Translating by DongShuaike] - Installing Cisco Packet tracer in Linux ================================================================================ ![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/Main_picture.png) diff --git a/sources/tech/20150126 iptraf--A TCP or UDP Network Monitoring Utility.md b/sources/tech/20150126 iptraf--A TCP or UDP Network Monitoring Utility.md index 01a9dc18f9..1d5d3cd0d9 100644 --- a/sources/tech/20150126 iptraf--A TCP or UDP Network Monitoring Utility.md +++ b/sources/tech/20150126 iptraf--A TCP or UDP Network Monitoring Utility.md @@ -1,5 +1,3 @@ -[Trnslating by DongShuaike] - iptraf: A TCP/UDP Network Monitoring Utility ================================================================================ [iptraf][1] is an ncurses-based IP LAN monitor that generates various network statistics including TCP info, UDP counts, ICMP and OSPF information, Ethernet load info, node stats, IP checksum errors, and others. diff --git a/sources/tech/20150316 How to Test Your Internet Speed Bidirectionally from Command Line Using 'Speedtest-CLI' Tool.md b/sources/tech/20150316 How to Test Your Internet Speed Bidirectionally from Command Line Using 'Speedtest-CLI' Tool.md index ee125e70a6..a0c77c21f9 100644 --- a/sources/tech/20150316 How to Test Your Internet Speed Bidirectionally from Command Line Using 'Speedtest-CLI' Tool.md +++ b/sources/tech/20150316 How to Test Your Internet Speed Bidirectionally from Command Line Using 'Speedtest-CLI' Tool.md @@ -1,5 +1,3 @@ -translating by createyuan - How to Test Your Internet Speed Bidirectionally from Command Line Using ‘Speedtest-CLI’ Tool ================================================================================ We always need to check the speed of the Internet connection at home and office. What we do for this? Go to websites like Speedtest.net and begin test. It loads JavaScript in the web browser and then select best server based upon ping and output the result. It also uses a Flash player to produce graphical results. diff --git a/sources/tech/20150318 How to Manage and Use LVM (Logical Volume Management) in Ubuntu.md b/sources/tech/20150318 How to Manage and Use LVM (Logical Volume Management) in Ubuntu.md index d062a85336..ecfb639d54 100644 --- a/sources/tech/20150318 How to Manage and Use LVM (Logical Volume Management) in Ubuntu.md +++ b/sources/tech/20150318 How to Manage and Use LVM (Logical Volume Management) in Ubuntu.md @@ -1,4 +1,3 @@ -translating by runningwater How to Manage and Use LVM (Logical Volume Management) in Ubuntu ================================================================================ ![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/652x202xbanner-1.png.pagespeed.ic.VGSxDeVS9P.png) diff --git a/sources/tech/20150318 How to Use LVM on Ubuntu for Easy Partition Resizing and Snapshots.md b/sources/tech/20150318 How to Use LVM on Ubuntu for Easy Partition Resizing and Snapshots.md index 7554abd392..883c5e3203 100644 --- a/sources/tech/20150318 How to Use LVM on Ubuntu for Easy Partition Resizing and Snapshots.md +++ b/sources/tech/20150318 How to Use LVM on Ubuntu for Easy Partition Resizing and Snapshots.md @@ -1,3 +1,4 @@ + How to Use LVM on Ubuntu for Easy Partition Resizing and Snapshots ================================================================================ ![](http://cdn5.howtogeek.com/wp-content/uploads/2015/03/ximg_55035707bbd74.png.pagespeed.ic.9_yebxUF1C.png) diff --git a/sources/tech/20150331 How to set up remote desktop on Linux VPS using x2go.md b/sources/tech/20150331 How to set up remote desktop on Linux VPS using x2go.md index 8b3eed8330..d89c91832e 100644 --- a/sources/tech/20150331 How to set up remote desktop on Linux VPS using x2go.md +++ b/sources/tech/20150331 How to set up remote desktop on Linux VPS using x2go.md @@ -1,5 +1,3 @@ -translating by createyuan - How to set up remote desktop on Linux VPS using x2go ================================================================================ As everything is moved to the cloud, virtualized remote desktop becomes increasingly popular in the industry as a way to enhance employee's productivity. Especially for those who need to roam constantly across multiple locations and devices, remote desktop allows them to stay connected seamlessly to their work environment. Remote desktop is attractive for employers as well, achieving increased agility and flexibility in work environments, lower IT cost due to hardware consolidation, desktop security hardening, and so on. diff --git a/sources/tech/20150410 7 Command Line Tools for Browsing Websites and Downloading Files in Linux.md b/sources/tech/20150410 7 Command Line Tools for Browsing Websites and Downloading Files in Linux.md index f736d8bae1..d291f34511 100644 --- a/sources/tech/20150410 7 Command Line Tools for Browsing Websites and Downloading Files in Linux.md +++ b/sources/tech/20150410 7 Command Line Tools for Browsing Websites and Downloading Files in Linux.md @@ -1,4 +1,3 @@ -wangjiezhe translating... 7 Command Line Tools for Browsing Websites and Downloading Files in Linux ================================================================================ In the last article, we have covered few useful tools like ‘rTorrent‘, ‘wget‘, ‘cURL‘, ‘w3m‘, and ‘Elinks‘. We got lots of response to cover few other tools of same genre, if you’ve missed the first part you can go through it.. diff --git a/sources/tech/20150504 How to access a Linux server behind NAT via reverse SSH tunnel.md b/sources/tech/20150504 How to access a Linux server behind NAT via reverse SSH tunnel.md index d6a1df43c5..b67f5aee26 100644 --- a/sources/tech/20150504 How to access a Linux server behind NAT via reverse SSH tunnel.md +++ b/sources/tech/20150504 How to access a Linux server behind NAT via reverse SSH tunnel.md @@ -1,5 +1,3 @@ -translating by createyuan - How to access a Linux server behind NAT via reverse SSH tunnel ================================================================================ You are running a Linux server at home, which is behind a NAT router or restrictive firewall. Now you want to SSH to the home server while you are away from home. How would you set that up? SSH port forwarding will certainly be an option. However, port forwarding can become tricky if you are dealing with multiple nested NAT environment. Besides, it can be interfered with under various ISP-specific conditions, such as restrictive ISP firewalls which block forwarded ports, or carrier-grade NAT which shares IPv4 addresses among users. From 265dcb2df3de32515cc0cab64c94ab7c1393d430 Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 31 May 2015 21:57:34 +0800 Subject: [PATCH 218/965] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E8=8D=A3=E8=AA=89?= =?UTF-8?q?=E6=A6=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 194 +++++++++++++++++++++++++++++++----------------------- 1 file changed, 113 insertions(+), 81 deletions(-) diff --git a/README.md b/README.md index 02fc5a8227..26ea32fd81 100644 --- a/README.md +++ b/README.md @@ -49,93 +49,125 @@ LCTT的组成 * 2014/10/08 提升bazz2为Core Translators成员。 * 2014/11/04 提升zpl1025为Core Translators成员。 * 2014/12/25 提升runningwater为Core Translators成员。 +* 2015/04/19 发起 LFS-BOOK-7.7-systemd 项目。 活跃成员 ------------------------------- -目前活跃成员有: -- CORE [wxy](https://github.com/wxy), -- CORE [carolinewuyan](https://github.com/carolinewuyan), -- CORE [DeadFire](https://github.com/DeadFire), -- CORE [geekpi](https://github.com/geekpi), -- CORE [GOLinux](https://github.com/GOLinux), -- CORE [reinoir](https://github.com/reinoir), -- CORE [bazz2](https://github.com/bazz2), -- CORE [zpl1025](https://github.com/zpl1025), -- Senior [tinyeyeser](https://github.com/tinyeyeser), -- Senior [vito-L](https://github.com/vito-L), -- Senior [jasminepeng](https://github.com/jasminepeng), -- Senior [willqian](https://github.com/willqian), -- Senior [vizv](https://github.com/vizv), -- [runningwater](https://github.com/runningwater), -- [luoxcat](https://github.com/Luoxcat), -- [Vic020](https://github.com/Vic020), -- [KayGuoWhu](https://github.com/KayGuoWhu), -- [alim0x](https://github.com/alim0x), -- [ZTinoZ](https://github.com/ZTinoZ), -- [2q1w2007](https://github.com/2q1w2007), -- [flsf](https://github.com/flsf), -- [blueabysm](https://github.com/blueabysm), -- [barney-ro](https://github.com/barney-ro), -- [su-kaiyao](https://github.com/su-kaiyao), -- [crowner](https://github.com/crowner), -- [Linchenguang](https://github.com/Linchenguang), -- [Linux-pdz](https://github.com/Linux-pdz), -- [linuhap](https://github.com/linuhap), -- [yechunxiao19](https://github.com/yechunxiao19), -- [woodboow](https://github.com/woodboow), -- [SPccman](https://github.com/SPccman), -- [disylee](https://github.com/disylee), -- [cvsher](https://github.com/cvsher), -- [ThomazL](https://github.com/ThomazL), -- [Stevearzh](https://github.com/Stevearzh), -- [felixonmars](https://github.com/felixonmars), -- [scusjs](https://github.com/scusjs), -- [johnhoow](https://github.com/johnhoow), -- [hyaocuk](https://github.com/hyaocuk), -- [MikeCoder](https://github.com/MikeCoder), -- [theo-l](https://github.com/theo-l), -- [wangjiezhe](https://github.com/wangjiezhe), -- [jiajia9linuxer](https://github.com/jiajia9linuxer), -- [NearTan](https://github.com/NearTan), -- [l3b2w1](https://github.com/l3b2w1), -- [shipsw](https://github.com/shipsw), -- [boredivan](https://github.com/boredivan), -- [Love-xuan](https://github.com/Love-xuan), -- [JonathanKang](https://github.com/JonathanKang), -- [luoyutiantang](https://github.com/luoyutiantang), -- [owen-carter](https://github.com/owen-carter), -- [icybreaker](https://github.com/icybreaker), -- [tenght](https://github.com/tenght), -- [rogetfan](https://github.com/rogetfan), -- [liuaiping](https://github.com/liuaiping), -- [nd0104](https://github.com/nd0104), -- [szrlee](https://github.com/szrlee), -- [lfzark](https://github.com/lfzark), -- [ggaaooppeenngg](https://github.com/ggaaooppeenngg), -- [CNprober](https://github.com/CNprober), -- [coloka](https://github.com/coloka), -- [213edu](https://github.com/213edu), -- [guodongxiaren](https://github.com/guodongxiaren), -- [Tanete](https://github.com/Tanete), -- [zzlyzq](https://github.com/zzlyzq), -- [yujianxuechuan](https://github.com/yujianxuechuan), -- [ailurus1991](https://github.com/ailurus1991), -- [FineFan](https://github.com/FineFan), -- [shaohaolin](https://github.com/shaohaolin), -- [tomatoKiller](https://github.com/tomatoKiller), -- [CHINAANSHE](https://github.com/CHINAANSHE), -- [stduolc](https://github.com/stduolc), -- [Maclauring](https://github.com/Maclauring), -- [Hao-Ding](https://github.com/Hao-Ding), -- [zsJacky](https://github.com/zsJacky), -- [small-Wood](https://github.com/small-Wood), -- [cereuz](https://github.com/cereuz), -- [lijhg](https://github.com/lijhg), -- [fbigun](https://github.com/fbigun), +目前 TP 活跃成员有: +- CORE @wxy, +- CORE @carolinewuyan, +- CORE @DeadFire, +- CORE @geekpi, +- CORE @GOLinux, +- CORE @reinoir, +- CORE @bazz2, +- CORE @zpl1025, +- Senior @tinyeyeser, +- Senior @vito-L, +- Senior @jasminepeng, +- Senior @willqian, +- Senior @vizv, +- @ZTinoZ, +- @Vic020, +- @runningwater, +- @KayGuoWhu, +- @luoxcat, +- @alim0x, +- @2q1w2007, +- @theo-l, +- @ictlyh, +- @FSSlc, +- @su-kaiyao, +- @blueabysm, +- @flsf, +- @martin2011qi, +- @SPccman, +- @wi-cuckoo, +- @Linchenguang, +- @linuhap, +- @crowner, +- @Linux-pdz, +- @H-mudcup, +- @yechunxiao19, +- @woodboow, +- @Stevearzh, +- @disylee, +- @cvsher, +- @wwy-hust, +- @johnhoow, +- @felixonmars, +- @TxmszLou, +- @shipsw, +- @scusjs, +- @wangjiezhe, +- @hyaocuk, +- @MikeCoder, +- @ZhouJ-sh, +- @boredivan, +- @goreliu, +- @l3b2w1, +- @JonathanKang, +- @NearTan, +- @jiajia9linuxer, +- @Love-xuan, +- @coloka, +- @owen-carter, +- @luoyutiantang, +- @JeffDing, +- @icybreaker, +- @tenght, +- @liuaiping, +- @mtunique, +- @rogetfan, +- @nd0104, +- @mr-ping, +- @szrlee, +- @lfzark, +- @CNprober, +- @DongShuaike, +- @ggaaooppeenngg, +- @haimingfg, +- @213edu, +- @Tanete, +- @guodongxiaren, +- @zzlyzq, +- @FineFan, +- @yujianxuechuan, +- @Medusar, +- @shaohaolin, +- @ailurus1991, +- @liaoishere, +- @CHINAANSHE, +- @stduolc, +- @yupmoon, +- @tomatoKiller, +- @zhangboyue, +- @kingname, +- @KevinSJ, +- @zsJacky, +- @willqian, +- @Hao-Ding, +- @JygjHappy, +- @Maclauring, +- @small-Wood, +- @cereuz, +- @fbigun, +- @lijhg, +- @soooogreen, -(更新于2014/12/02,以Github contributors列表排名) +LFS 项目活跃成员有: + +- @ictlyh +- @dongfengweixiao +- @wxy +- @H-mudcup +- @zpl1025 +- @KevinSJ +- @Yuking-net + +(更新于2015/05/31,以Github contributors列表排名) 谢谢大家的支持! From 4622f7f434b998e4c1ac12077414d5efda46f929 Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 31 May 2015 22:54:55 +0800 Subject: [PATCH 219/965] PUB:20150407 5 Linux Command Line Based Tools for Downloading Files and Browsing Websites @ictlyh --- ...Downloading Files and Browsing Websites.md | 46 +++++++++++-------- 1 file changed, 27 insertions(+), 19 deletions(-) rename {translated/tech => published}/20150407 5 Linux Command Line Based Tools for Downloading Files and Browsing Websites.md (72%) diff --git a/translated/tech/20150407 5 Linux Command Line Based Tools for Downloading Files and Browsing Websites.md b/published/20150407 5 Linux Command Line Based Tools for Downloading Files and Browsing Websites.md similarity index 72% rename from translated/tech/20150407 5 Linux Command Line Based Tools for Downloading Files and Browsing Websites.md rename to published/20150407 5 Linux Command Line Based Tools for Downloading Files and Browsing Websites.md index 631c1992c6..4e6f6f83d0 100644 --- a/translated/tech/20150407 5 Linux Command Line Based Tools for Downloading Files and Browsing Websites.md +++ b/published/20150407 5 Linux Command Line Based Tools for Downloading Files and Browsing Websites.md @@ -1,9 +1,11 @@ -5个基于Linux命令行的文件下载和网站浏览工具 +5 个基于Linux命令行的文件下载和网站浏览工具 ================================================================================ -GNU/Linux最冒险迷人的部分,Linux命令行,是非常强大的工具。命令行本身功能多样,多种内建或者第三方的命令行应用使得Linux变得更加健壮和强大。Linux Shell支持多种不同类型的网络应用,无论是BT下载软件,专用下载器或者互联网冲浪。 + +Linux命令行是GNU/Linux中最神奇迷人的部分,它是非常强大的工具。命令行本身功能多样,多种内建或者第三方的命令行应用使得Linux变得更加健壮和强大。Linux Shell支持多种不同类型的网络应用,无论是BT下载软件,专用下载器或者互联网冲浪。 ![命令行互联网工具](http://www.tecmint.com/wp-content/uploads/2014/02/Command-Line-Internet-Tools.jpg) -5个命令行互联网工具 + +*5个命令行互联网工具* 这里我们介绍了5个很好的命令行互联网工具,它们非常有用,也很容易上手。 @@ -24,7 +26,8 @@ rTorrent是基于文本,用C++编写,追求高性能的Torrent客户端。 # rtorrent ![命令行torrent下载器](http://www.tecmint.com/wp-content/uploads/2014/02/rTorrent.jpeg) -rTorrent命令行工具 + +*rTorrent命令行工具* #### rTorrent的功能 #### @@ -34,18 +37,18 @@ rTorrent命令行工具 - CTRL+ s – 开始下载 - CTRL+ d – 停止运行中的下载或者移除已完成的下载 - CTRL+ k – 停止并关闭运行中的下载 -- CTRL+ r – 在上传/下载torrent之前进行Hash检查 -- CTRL+ q – 执行两次这个命令,rTorrent会直接退出而不发送停止信号 +- CTRL+ r – 在上传/下载种子之前进行Hash检查 +- CTRL+ q – 执行两次这个命令,rTorrent会直接退出而不发送“停止”信号 - Left Arrow Key – 跳到上一屏幕 - Right Arrow Key – 跳到下一屏幕 ### 2. Wget ### -Wget是GNU项目的一部分,名字由World Wide Web (WWW)衍生而来。Wget是用来递归下载,离线查看本地服务器HTML文件一个很好的工具,它可用于Windows, Max,以及Linux等大部分平台。Wget能通过HTTP,HTTPS和FTP下载文件。另外,能镜像整个网站,支持代理浏览以及暂停/回复下载使得它更为有用。 +Wget是GNU项目的一部分,名字由World Wide Web (WWW)衍生而来。Wget是用来递归下载、离线查看本地服务器HTML文件一个很好的工具,它可用于Windows, Mac,以及Linux等大部分平台。Wget能通过HTTP,HTTPS和FTP下载文件。另外,能镜像整个网站,支持代理浏览以及暂停/回复下载使得它更为有用。 #### 安装Wget #### -由于是GNE项目的一部分,Wget在大部分标准Linux发行版中都绑定发布,不再需要独立下载安装。如果默认没有安装,你也可以使用apt或者yum安装。 +由于是GNU项目的一部分,Wget捆绑在大部分标准Linux发行版中,不再需要独立下载安装。如果默认没有安装,你也可以使用apt或者yum安装。 # apt­-get install wget (基于 APT 的系统) @@ -70,13 +73,14 @@ Wget是GNU项目的一部分,名字由World Wide Web (WWW)衍生而来。Wget Wget是一个很棒的工具,它允许在资源有限的机器上自定义或者过滤下载。这是镜像一个网站(Yahoo.com)的wget下载截图。 ![Wget 下载文件](http://www.tecmint.com/wp-content/uploads/2014/02/Wget.jpeg) -Wget 命令行文件下载 -要获取更多wget下载的例子,可以阅读我们的文章[10个Wget下载命令例子][1]。 +*Wget 命令行文件下载* + +要获取更多wget下载的例子,可以阅读我们的文章[Wget下载命令例子][1]。 ### 3. cURL ### -cURL是在多种协议上传输数据的命令行工具。cURL是支持FTP, HTTP, FTPS, TFTP, TELNET, IMAP, POP3等协议的客户端应用。和其它相对比,在支持LDAP,POP3方面,cURL是和wget不同的简单下载器。cURL也很好的支持代理下载,暂停下载以及恢复下载。 +cURL是在多种协议上传输数据的命令行工具。cURL是支持FTP, HTTP, FTPS, TFTP, TELNET, IMAP, POP3等协议的客户端应用。cURL是一个不同于wget 的简单下载器,和其它的相比,它支持LDAP,POP3。cURL也很好的支持代理下载,暂停下载以及恢复下载。 #### 安装cURL #### @@ -93,14 +97,16 @@ cURL的基本使用方法 # curl www.tecmint.com ![Curl 下载](http://www.tecmint.com/wp-content/uploads/2014/02/Curl.jpeg) -Curl 下载数据 + +*Curl 下载* ![Curl 下载数据](http://www.tecmint.com/wp-content/uploads/2014/02/Curl-2.jpeg) -Curl 下载 + +*Curl 下载* ### 4. w3m ### -W3m是GPL协议下发布的基于文本的web浏览器。W3m支持表格,帧,颜色,SSL连接以及内联图像。W3m由于快速浏览而出名。 +W3m是GPL协议下发布的基于文本的web浏览器。W3m支持表格,帧,颜色,SSL连接以及内联图像。W3m以快速浏览而出名。 #### 安装w3m #### @@ -117,11 +123,12 @@ W3m在大部分Linux发行版中也是默认可用的。如果不可用的话可 # w3m www.tecmint.com ![命令行浏览器](http://www.tecmint.com/wp-content/uploads/2014/02/w3m.jpeg) -基于文本的web浏览器w3m + +*基于文本的web浏览器w3m* ### 5. Elinks ### -Elinks是基于文本,给基于Unix和基于Unix的系统使用的免费web浏览器。Elinks支持 HTTP,HTTP Cookies以及支持浏览Pery和Ruby脚本。也很好的支持基于标签的浏览。最棒的是它支持鼠标,颜色显示以及支持一系列的协议,例如HTTP, FTP, SMB, Ipv4 和 Ipv6。 +Elinks是基于文本的免费浏览器,用于Unix及基于Unix的系统。Elinks支持 HTTP,HTTP Cookies以及支持浏览Perl和Ruby脚本(LCTT 译注:应该是指 CGI)。也很好的支持选项卡浏览。最棒的是它支持鼠标、彩色以及支持一系列的协议,例如HTTP, FTP, SMB, Ipv4 和 Ipv6。 #### 安装Elinks #### @@ -138,7 +145,8 @@ Elinks的基本使用方法 # elinks www.tecmint.com ![命令行互联网浏览](http://www.tecmint.com/wp-content/uploads/2014/02/Elinks.jpeg) -Elinks命令行浏览互联网 + +*Elinks命令行浏览互联网* 就是这些了。有你们喜欢读的有趣的文章,我会再次来到这里。到那时尽请关注并保持和Tecmint的联系,别忘了在评论部分给我们你的宝贵的反馈。 @@ -148,9 +156,9 @@ via: http://www.tecmint.com/linux-command-line-tools-for-downloading-files/ 作者:[Avishek Kumar][a] 译者:[ictlyh](https://github.com/ictlyh) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 [a]:http://www.tecmint.com/author/avishek/ -[1]:http://www.tecmint.com/10-wget-command-examples-in-linux/ \ No newline at end of file +[1]:https://linux.cn/article-4129-1.html \ No newline at end of file From 3cdd5634a088e2e218d1a5ec8dc2d117527cdb4b Mon Sep 17 00:00:00 2001 From: wi-cuckoo Date: Sun, 31 May 2015 23:04:08 +0800 Subject: [PATCH 220/965] translating wi-cuckoo --- ...ux Better than OS X GNU Open Source and Apple in History.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/talk/20150520 Is Linux Better than OS X GNU Open Source and Apple in History.md b/sources/talk/20150520 Is Linux Better than OS X GNU Open Source and Apple in History.md index 4a602997ad..9abc2f721f 100644 --- a/sources/talk/20150520 Is Linux Better than OS X GNU Open Source and Apple in History.md +++ b/sources/talk/20150520 Is Linux Better than OS X GNU Open Source and Apple in History.md @@ -1,3 +1,4 @@ +translating wi-cuckoo Is Linux Better than OS X? GNU, Open Source and Apple in History ================================================================================ > Tensions between the free software/open source community and Apple date back to the 1980s, Linux's founder called the core of Mac OS X "a piece of crap" and other anecdotes from software history. @@ -54,4 +55,4 @@ via: http://thevarguy.com/open-source-application-software-companies/051815/linu [7]:http://www.duntemann.com/AppleSnakeButton.jpg [8]:http://www.freibrun.com/articles/articl12.htm [9]:https://www.gnu.org/bulletins/bull18.html#SEC6 -[10]:https://www.gnu.org/bulletins/bull12.html \ No newline at end of file +[10]:https://www.gnu.org/bulletins/bull12.html From ec699b4df2020935de338d91c15755d73a73a1e5 Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 31 May 2015 23:52:47 +0800 Subject: [PATCH 221/965] PUB:20150318 How to share a directory with Samba on Fedora or CentOS @wwy-hust --- ...irectory with Samba on Fedora or CentOS.md | 144 ++++++++++++++++++ ...irectory with Samba on Fedora or CentOS.md | 144 ------------------ 2 files changed, 144 insertions(+), 144 deletions(-) create mode 100644 published/20150318 How to share a directory with Samba on Fedora or CentOS.md delete mode 100644 translated/tech/20150318 How to share a directory with Samba on Fedora or CentOS.md diff --git a/published/20150318 How to share a directory with Samba on Fedora or CentOS.md b/published/20150318 How to share a directory with Samba on Fedora or CentOS.md new file mode 100644 index 0000000000..e8e48ba76d --- /dev/null +++ b/published/20150318 How to share a directory with Samba on Fedora or CentOS.md @@ -0,0 +1,144 @@ +如何在Fedora或CentOS上使用Samba共享文件夹 +================================================================================ +如今,无论在家里或者是办公场所,不同的电脑之间共享文件夹已不是什么新鲜事了。在这种趋势下,现代操作系统通过网络文件系统的方式使得电脑间数据的交换变得简单而透明。如果您工作的环境中既有微软的Windows又有Linux,那么,一个共享文件及目录的方式便是通过一个跨平台网络文件共享协议:SMB/CIFS。Windows原生的支持SMB/CIFS,Linux也通过开源的软件Samba实现了SMB/CIFS协议。 + +在这篇文章中,我们将展示**如何使用Samba共享文件夹**。我们使用的Linux平台是**Fedora或CentOS**。这篇文章分为四部分。首先,我们在Fedora/CentOS环境下安装Sambe。接着,我们讨论如何调整SELinux和防火墙配置以允许Samba的文件共享。最后我们介绍如何使用Samba来共享文件夹。 + +### 步骤1:在Fedora和CentOS上安装Samba ### + +首先,安装Samba以及进行一些基本的配置。 + +检验Samba是否已经安装在您的系统中: + + $ rpm -q samba samba-common samba-client + +如果上面的命令没有任何输出,这意味着Samba并未安装。这时,应使用下面的命令来安装Samba。 + + $ sudo yum install samba samba-common samba-client + +接下来,创建一个用于在网络中共享的本地文件夹。这个文件夹应该以Samba共享的方式导出到远程的用户。在这个指南中,我们会在顶层文件夹'/'中创建这个文件夹,因此,请确保您有相应的权限。 + + $ sudo mkdir /shared + +如果您想在您的home文件夹内创建共享文件夹(例如,~/shared),您必须激活SELinux中Samba的home文件夹共享选项,具体将在后面提到。 + +在创建/shared文件夹后,设置文件夹权限以保证其余用户可以访问它。 + + $ sudo chmod o+rw /shared + +如果您不想其他用户对该文件夹拥有写权限,您需要移除命令中的'w'选项。 + + $ sudo chmod o+r /shared + +接下来,创建一个空文件来测试。这个文件可以被用来验证Samba的共享已经被挂载。 + + $ sudo touch /shared/file1 + +### 步骤2:为Samba配置SELinux ### + +接下来,我们需要再次配置SELinux。在Fedora和CentOS发行版中SELinux是默认开启的。SELinux仅在正确的安全配置下才允许Samba读取和修改文件或文件夹。(例如,加上'samba_share_t'属性标签)。 + +下面的命令为文件的配置添加必要的标签: + + $ sudo semanage fcontext -a -t samba_share_t "(/.*)?" + +将替换为我们之前为Samba共享创建的本地文件夹(例如,/shared): + + $ sudo semanage fcontext -a -t samba_share_t "/shared(/.*)?" + +我们必须执行restorecon命令来激活修改的标签,命令如下: + + $ sudo restorecon -R -v /shared + +![](https://farm9.staticflickr.com/8584/16652774078_2055f45f70_b.jpg) + +为了通过Samba共享在我们home文件夹内的文件夹,我们必须在SELinux中开启共享home文件夹的选项,该选项默认被关闭。下面的命令能达到该效果。如果您并未共享您的home文件夹,那么您可以跳过该步骤。 + + $ sudo setsebool -P samba_enable_home_dirs 1 + +### 步骤3:为Samba配置防火墙 ### + +下面的命令用来打开防火墙中Samba共享所需的TCP/UDP端口。 + +如果您在使用firewalld(例如,在Fedora和CentOS7下),接下来的命令将会永久的修改Samba相关的防火墙规则。 + + $ sudo firewall-cmd --permanent --add-service=samba + +如果您在防火墙中使用iptables(例如,CentOS6或者更早的版本),可以使用下面的命令来打开Samba必要的向外的端口。 + + $ sudo vi /etc/sysconfig/iptables + +---------- + + -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 445 -j ACCEPT + -A RH-Firewall-1-INPUT -m state --state NEW -m udp -p udp --dport 445 -j ACCEPT + -A RH-Firewall-1-INPUT -m state --state NEW -m udp -p udp --dport 137 -j ACCEPT + -A RH-Firewall-1-INPUT -m state --state NEW -m udp -p udp --dport 138 -j ACCEPT + -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 139 -j ACCEPT + +然后重启iptables服务: + + $ sudo service iptables restart + +### 步骤4:更改Samba配置 ### + +后面的步骤用来配置Samba以将本地文件夹导出为Samba共享文件夹。 + +使用文件编辑器打开Samba配置文件,并将下面的行添加到文件的末尾。 + + $ sudo nano /etc/samba/smb.conf + +---------- + + [myshare] + comment=my shared files + path=/shared + public=yes + writeable=yes + +上面在括号内的文本(例如,"myshare")是Samba共享的资源的名字,它被用来从远程主机存取Samba共享。 + +创建Samba用户帐户,这是挂载和导出Samba文件系统所必须的。我们可以使用smbpasswd工具来创建一个Samba用户。注意,Samba用户帐户必须是已有的Linux用户。如果您尝试使用smbpasswd添加一个不存在的用户,它会返回一个错误的消息。 + +如果您不想使用任何已存在的Linux用户作为Samba用户,您可以在您的系统中创建一个新的用户。为安全起见,设置新用户的登录脚本为/sbin/nologin,并且不创建该用户的home文件夹。 + +在这个例子中,我们创建了一个名叫"sambaguest"的用户,如下: + + $ sudo useradd -M -s /sbin/nologin sambaguest + $ sudo passwd sambaguest + +![](https://farm9.staticflickr.com/8702/16814479366_53f540d3ba_b.jpg) + +在创建一个新用户后,使用smbpasswd命令添加Samba用户。当这个命令询问一个密码时,您可以键入一个与其用户密码不同的密码。 + + $ sudo smbpasswd -a sambaguest + +激活Samba服务,并检测Samba服务是否在运行。 + + $ sudo systemctl enable smb.service + $ sudo systemctl start smb.service + $ sudo systemctl is-active smb + +![](https://farm8.staticflickr.com/7607/16652984770_622f24bccc_b.jpg) + +使用下面的命令来查看Samba中共享的文件夹列表。 + + $ smbclient -U sambaguest -L localhost + +![](https://farm8.staticflickr.com/7281/16220411103_06bf585901_b.jpg) + +接下来是在Thunar文件管理器中访问Samba共享文件夹以及对file1进行拷贝复制的截图。注意,Samba的共享内容可以通过在Thunar中通过 `smb:///myshare` 这个地址来访问。 + +![](https://farm8.staticflickr.com/7644/16218011174_c8b34fcedc_b.jpg) + +-------------------------------------------------------------------------------- + +via: http://xmodulo.com/share-directory-samba-fedora-centos.html + +作者:[Kristophorus Hadiono][a] +译者:[wwy-hust](https://github.com/wwy-hust) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://xmodulo.com/author/kristophorus diff --git a/translated/tech/20150318 How to share a directory with Samba on Fedora or CentOS.md b/translated/tech/20150318 How to share a directory with Samba on Fedora or CentOS.md deleted file mode 100644 index 901fbf603e..0000000000 --- a/translated/tech/20150318 How to share a directory with Samba on Fedora or CentOS.md +++ /dev/null @@ -1,144 +0,0 @@ -FedoraCentOSʹSambaļ -================================================================================ -ڼǰ칫ͬĵ֮乲ļѲʲôˡ£ִϵͳͨļϵͳķʽʹõԼݵĽü򵥶͸Ļм΢WindowsLinuxôһļĿ¼ķʽͨһƽ̨ļЭ,SMB/CIFSWindowsȻ֧SMB/CIFSLinuxҲͨԴSambaʵSMB/CIFSЭ顣 - -ƪУǽչʾ**ʹSambaļ**ʹõLinuxƽ̨**FedoraCentOS**ƪ·ΪIJ֡ȣFedora/CentOS°װSambeţεSELinuxͷǽSambaļǽʹSambaļС - -### 1FedoraCentOSϰװSamba ### - -ȣװSambaԼһЩá - -SambaǷѾװϵͳУ - - $ rpm -q samba samba-common samba-client - -ûκζSambaδװʱӦʹװSamba - - $ sudo yum install samba samba-common samba-client - -һйıļСļӦSambaķʽԶ̵ûָУǻڶļ'/'дļУˣȷӦȨޡ - - $ sudo mkdir /shared - -homeļڴļУ磬~/shared뼤SELinuxSambahomeļйѡ彫ںᵽ - -ڴ/sharedļкļȨԱ֤ûԷ - - $ sudo chmod o+rw /shared - -ûԸļӵдȨޣҪƳе'w'ѡ - - $ sudo chmod o+r /shared - -һļԡļԱ֤SambaĹѾء - - $ sudo touch /shared/file1 - -### 2ΪSambaSELinux ### - -ҪٴSELinuxFedoraCentOSаSELinuxĬϿġSELinuxȷİȫ²Sambaȡ޸ļļС磬'samba_share_t'Աǩ - -ΪļӱҪıǩ - - $ sudo semanage fcontext -a -t samba_share_t "(/.*)?" - -滻Ϊ֮ǰΪSambaıļУ磬/shared - - $ sudo semanage fcontext -a -t samba_share_t "/shared(/.*)?" - -DZִrestorecon޸ĵıǩ£ - - $ sudo restorecon -R -v /shared - -![](https://farm9.staticflickr.com/8584/16652774078_2055f45f70_b.jpg) - -ΪͨSambahomeļڵļУDZSELinuxпhomeļеѡѡĬϱرաܴﵽЧδhomeļУôò衣 - - $ sudo setsebool -P samba_enable_home_dirs 1 - -### 3ΪSamba÷ǽ ### - -򿪷ǽSambaΪҪTCP/UDP˿ڡ - -ʹfirewalld磬FedoraCentOS7£õ޸Sambaصķǽ - - $ sudo firewall-cmd --permanent --add-service=samba - -ڷǽʹiptables磬CentOS6߸İ汾ʹSambaҪĶ˿ڡ - - $ sudo vi /etc/sysconfig/iptables - ----------- - - -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 445 -j ACCEPT - -A RH-Firewall-1-INPUT -m state --state NEW -m udp -p udp --dport 445 -j ACCEPT - -A RH-Firewall-1-INPUT -m state --state NEW -m udp -p udp --dport 137 -j ACCEPT - -A RH-Firewall-1-INPUT -m state --state NEW -m udp -p udp --dport 138 -j ACCEPT - -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 139 -j ACCEPT - -Ȼiptables - - $ sudo service iptables restart - -### 4Samba ### - -IJSambaԽļеΪSambaļС - -ʹļ༭Sambaļӵļĩβ - - $ sudo nano /etc/samba/smb.conf - ----------- - - [myshare] - comment=my shared files - path=/shared - public=yes - writeable=yes - -ڵı磬"myshare"SambaԴ֣ԶȡSamba - -Sambaûʻǹغ͵SambaļϵͳġǿʹsmbpasswdһSambaûע⣬SambaûʻLinuxûѴڵġʹsmbpasswdһڵû᷵һϢ - -ʹκѴڵLinuxûΪSambaûϵͳдһµûΪȫûĵ¼űΪ/sbin/nologinҲûhomeļС - -Уڴһ"sambaguest"û£ - - $ sudo useradd -M -s /sbin/nologin sambaguest - $ sudo passwd sambaguest - -![](https://farm9.staticflickr.com/8702/16814479366_53f540d3ba_b.jpg) - -ڴһûʹsmbpasswdSambaûѯһʱԼһͬڸû롣 - - $ sudo smbpasswd -a sambaguest - -4. Samba񣬲SambaǷС - - $ sudo systemctl enable smb.service - $ sudo systemctl start smb.service - $ sudo systemctl is-active smb - -![](https://farm8.staticflickr.com/7607/16652984770_622f24bccc_b.jpg) - -ʹ鿴Sambaйļб - - $ smbclient -U sambaguest -L localhost - -![](https://farm8.staticflickr.com/7281/16220411103_06bf585901_b.jpg) - -ThunarļдȡSambaļԼfile1пƵĽͼע⣬SambaĹݿͨThunarͨ"smb:///myshare"ַȡ - -![](https://farm8.staticflickr.com/7644/16218011174_c8b34fcedc_b.jpg) - --------------------------------------------------------------------------------- - -via: http://xmodulo.com/share-directory-samba-fedora-centos.html - -ߣ[Kristophorus Hadiono][a] -ߣ[wwy-hust](https://github.com/wwy-hust) -Уԣ[УID](https://github.com/УID) - - [LCTT](https://github.com/LCTT/TranslateProject) ԭ룬[Linuxй](http://linux.cn/) Ƴ - -[a]:http://xmodulo.com/author/kristophorus From e011f9fb2222fcee4774a83091409d298c780080 Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 31 May 2015 23:54:32 +0800 Subject: [PATCH 222/965] =?UTF-8?q?=E5=BD=92=E6=A1=A3=20201505?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- published/{ => 201505}/20140804 Group Test--Linux Text Editors.md | 0 .../20150108 Interface (NICs) Bonding in Linux using nmcli.md | 0 ...0112 What are useful command-line network monitors on Linux.md | 0 ... Badges Brings Missing Session Icons to Ubuntu Login Screen.md | 0 .../20150123 How to make a file immutable on Linux.md | 0 ...int to a float when a float cannot represent all int values.md | 0 .../20150126 iptraf--A TCP or UDP Network Monitoring Utility.md | 0 .../20150128 Docker-2 Setting up a private Docker registry.md | 0 .../20150128 Docker-3 Automated Docker-based Rails deployments.md | 0 ...0150205 Inxi--Find System And Hardware Information On Linux.md | 0 .../20150205 zBackup--A versatile deduplicating backup tool.md | 0 .../{ => 201505}/20150211 25 Tips for Intermediate Git Users.md | 0 ...stall Linux-Dash (Web Based Monitoring tool) on Ubntu 14.10.md | 0 ...50225 Linux FAQs with Answers--How to disable IPv6 on Linux.md | 0 ...20150227 Bringing a Bunch of Best Known Linux Network Tools.md | 0 .../20150227 Enjoy Android Apps on Ubuntu using ARChon Runtime.md | 0 ...etch cdrom apt-get update cannot be used to add new CD-ROMs.md | 0 ...ow to Install Lightweight Budgie v8 Desktop in Ubuntu 14.04.md | 0 ...ndwidth Used by Applications in a Linux System with Trickle.md | 0 ...ge KVM Virtual Environment using Commandline Tools in Linux.md | 0 ... pre-removal script returned error exit status 1' In Ubuntu.md | 0 ...20150304 Monitoring Your Network And Servers With Observium.md | 0 ...4 Share Folders On Local Network Between Ubuntu And Windows.md | 0 ...150306 How to Setup lftp--A Simple Command line FTP Program.md | 0 ...e Windows SSH Client Tools To Connect To Your Linux Server .md | 0 ... And Mouse Freeze After Suspend In Ubuntu 14.04 [Quick Tip].md | 0 ...5 Interesting Command Line Tips and Tricks in Linux--Part 1.md | 0 ... to access Gmail from the command line on Linux with Alpine.md | 0 .../{ => 201505}/20150316 Install Mate desktop in FreeBSD 10.1.md | 0 .../20150316 Systemd Boot Process a Close Look in Linux.md | 0 ...150318 11 Linux Terminal Commands That Will Rock Your World.md | 0 ...318 How to share a directory with Samba on Fedora or CentOS.md | 0 ...e Stolen laptops and Smart phones Using Prey Tool in Ubuntu.md | 0 ...urce Forensic Tool to Analyze Disk Images and Recover Files.md | 0 .../20150323 How to enable ssh login without entering password.md | 0 ...-How to compress JPEG images from the command line on Linux.md | 0 ...ers--How to install and access CentOS remote desktop on VPS.md | 0 .../20150323 Square 2.0 Icon Pack Is Twice More Beautiful.md | 0 .../20150324 4 Tools to Securely Delete Files from Linux.md | 0 ...4 7 Quirky' ls' Command Tricks Every Linux User Should Know.md | 0 .../20150324 How to Host Open Source Code Repository in github.md | 0 .../20150324 How to Interactively Create a Docker Container.md | 0 .../20150326 How to set up server monitoring system with Monit.md | 0 .../20150330 2 Ways to Create Your Own Docker Base Image.md | 0 ...30 How to secure SSH login with one-time passwords on Linux.md | 0 ...30 Linux FAQs with Answers--How to upgrade Docker on Ubuntu.md | 0 ...0331 Conky--The Ultimate X Based System Monitor Application.md | 0 ...to Generate or Encrypt or Decrypt Random Passwords in Linux.md | 0 ...Now Worth Try Installing PHP 7.0 on CentOS 7.x or Fedora 21.md | 0 ... Linux Email App Geary Updated--How To Install It In Ubuntu.md | 0 ...ine Based Tools for Downloading Files and Browsing Websites.md | 0 ...layer for Ubuntu Plays Relaxing Sounds to Keep You Creative.md | 0 .../20150407 How To Install CentOS Web Panel In CentOS.md | 0 ...7 How to secure BGP sessions using authentication on Quagga.md | 0 ...Tools Send Email with Subject, Body and Attachment in Linux.md | 0 ...150409 Install Inkscape - Open Source Vector Graphic Editor.md | 0 ...ool can alert you about evil twin access points in the area.md | 0 ...0150410 What is a good alternative to wget or curl on Linux.md | 0 .../20150413 A Walk Through Some Important Docker Commands.md | 0 ...h Answers--How to change PATH environment variable on Linux.md | 0 ...50413 [Solved] Ubuntu Does Not Remember Brightness Settings.md | 0 published/{ => 201505}/20150415 Strong SSL Security on nginx.md | 0 ...20150417 14 Useful Examples of Linux 'sort' Command--Part 1.md | 0 ...150417 How to Configure MariaDB Replication on CentOS Linux.md | 0 .../20150417 sshuttle--A transparent proxy-based VPN using ssh.md | 0 ...0150420 7 Interesting Linux 'sort' Command Examples--Part 2.md | 0 ...eleased--The Best Racing Game on Linux Just Got Even Better.md | 0 ...429 Docker 1.6 Released--How to Upgrade on Fedora or CentOS.md | 0 ...50429 Synfig Studio 1.0--Open Source Animation Gets Serious.md | 0 ...hing basics terminology http headers and caching strategies.md | 0 .../20150504 How To Install Visual Studio Code On Ubuntu.md | 0 .../20150505 Bodhi Linux Introduces Moksha Desktop.md | 0 ...06 How to Securely Store Passwords and Api Keys Using Vault.md | 0 ... to configure a Linux bridge with Network Manager on Ubuntu.md | 0 ...06 Linux FAQs with Answers--How to install autossh on Linux.md | 0 ...7 Command Line Tool to Monitor Linux Containers Performance.md | 0 ...Root and Intermediate CA including OCSP, CRL and revocation.md | 0 ...ake 0.7.0 Released--A Drop-Down Terminal for Gnome Desktops.md | 0 ...150515 New to Linux 5 Apps You Didn't Know You Were Missing.md | 0 ...wers--How to block specific user agents on nginx web server.md | 0 ...rror--security or pam_modules.h--No such file or directory'.md | 0 ...Microsoft Open-Sources The Windows Communication Foundation.md | 0 ...munity Council Asks the Kubuntu Project Leader to Step Down.md | 0 ...Things to Do After Minimal RHEL or CentOS 7 Installation--4.md | 0 ...Things to Do After Minimal RHEL or CentOS 7 Installation--5.md | 0 ...Things to Do After Minimal RHEL or CentOS 7 Installation--6.md | 0 ...How to Manage Network using nmcli Tool in RedHat CentOS 7.x.md | 0 .../{ => 201505}/Linux grep command with 14 different examples.md | 0 88 files changed, 0 insertions(+), 0 deletions(-) rename published/{ => 201505}/20140804 Group Test--Linux Text Editors.md (100%) rename published/{ => 201505}/20150108 Interface (NICs) Bonding in Linux using nmcli.md (100%) rename published/{ => 201505}/20150112 What are useful command-line network monitors on Linux.md (100%) rename published/{ => 201505}/20150119 Unity Greeter Badges Brings Missing Session Icons to Ubuntu Login Screen.md (100%) rename published/{ => 201505}/20150123 How to make a file immutable on Linux.md (100%) rename published/{ => 201505}/20150124 Why does C++ promote an int to a float when a float cannot represent all int values.md (100%) rename published/{ => 201505}/20150126 iptraf--A TCP or UDP Network Monitoring Utility.md (100%) rename published/{ => 201505}/20150128 Docker-2 Setting up a private Docker registry.md (100%) rename published/{ => 201505}/20150128 Docker-3 Automated Docker-based Rails deployments.md (100%) rename published/{ => 201505}/20150205 Inxi--Find System And Hardware Information On Linux.md (100%) rename published/{ => 201505}/20150205 zBackup--A versatile deduplicating backup tool.md (100%) rename published/{ => 201505}/20150211 25 Tips for Intermediate Git Users.md (100%) rename published/{ => 201505}/20150211 Install Linux-Dash (Web Based Monitoring tool) on Ubntu 14.10.md (100%) rename published/{ => 201505}/20150225 Linux FAQs with Answers--How to disable IPv6 on Linux.md (100%) rename published/{ => 201505}/20150227 Bringing a Bunch of Best Known Linux Network Tools.md (100%) rename published/{ => 201505}/20150227 Enjoy Android Apps on Ubuntu using ARChon Runtime.md (100%) rename published/{ => 201505}/20150227 How To Fix--Failed to fetch cdrom apt-get update cannot be used to add new CD-ROMs.md (100%) rename published/{ => 201505}/20150227 How to Install Lightweight Budgie v8 Desktop in Ubuntu 14.04.md (100%) rename published/{ => 201505}/20150302 How to Limit the Network Bandwidth Used by Applications in a Linux System with Trickle.md (100%) rename published/{ => 201505}/20150302 How to Manage KVM Virtual Environment using Commandline Tools in Linux.md (100%) rename published/{ => 201505}/20150304 Linux Basics--How To Fix 'E-- var cache apt archives subprocess new pre-removal script returned error exit status 1' In Ubuntu.md (100%) rename published/{ => 201505}/20150304 Monitoring Your Network And Servers With Observium.md (100%) rename published/{ => 201505}/20150304 Share Folders On Local Network Between Ubuntu And Windows.md (100%) rename published/{ => 201505}/20150306 How to Setup lftp--A Simple Command line FTP Program.md (100%) rename published/{ => 201505}/20150309 List Of Free Windows SSH Client Tools To Connect To Your Linux Server .md (100%) rename published/{ => 201505}/20150310 [Fixed] Keyboard And Mouse Freeze After Suspend In Ubuntu 14.04 [Quick Tip].md (100%) rename published/{ => 201505}/20150316 5 Interesting Command Line Tips and Tricks in Linux--Part 1.md (100%) rename published/{ => 201505}/20150316 How to access Gmail from the command line on Linux with Alpine.md (100%) rename published/{ => 201505}/20150316 Install Mate desktop in FreeBSD 10.1.md (100%) rename published/{ => 201505}/20150316 Systemd Boot Process a Close Look in Linux.md (100%) rename published/{ => 201505}/20150318 11 Linux Terminal Commands That Will Rock Your World.md (100%) rename published/{ => 201505}/20150318 How to share a directory with Samba on Fedora or CentOS.md (100%) rename published/{ => 201505}/20150320 Locate Stolen laptops and Smart phones Using Prey Tool in Ubuntu.md (100%) rename published/{ => 201505}/20150320 Sleuth Kit--Open Source Forensic Tool to Analyze Disk Images and Recover Files.md (100%) rename published/{ => 201505}/20150323 How to enable ssh login without entering password.md (100%) rename published/{ => 201505}/20150323 Linux FAQs with Answers--How to compress JPEG images from the command line on Linux.md (100%) rename published/{ => 201505}/20150323 Linux FAQs with Answers--How to install and access CentOS remote desktop on VPS.md (100%) rename published/{ => 201505}/20150323 Square 2.0 Icon Pack Is Twice More Beautiful.md (100%) rename published/{ => 201505}/20150324 4 Tools to Securely Delete Files from Linux.md (100%) rename published/{ => 201505}/20150324 7 Quirky' ls' Command Tricks Every Linux User Should Know.md (100%) rename published/{ => 201505}/20150324 How to Host Open Source Code Repository in github.md (100%) rename published/{ => 201505}/20150324 How to Interactively Create a Docker Container.md (100%) rename published/{ => 201505}/20150326 How to set up server monitoring system with Monit.md (100%) rename published/{ => 201505}/20150330 2 Ways to Create Your Own Docker Base Image.md (100%) rename published/{ => 201505}/20150330 How to secure SSH login with one-time passwords on Linux.md (100%) rename published/{ => 201505}/20150330 Linux FAQs with Answers--How to upgrade Docker on Ubuntu.md (100%) rename published/{ => 201505}/20150331 Conky--The Ultimate X Based System Monitor Application.md (100%) rename published/{ => 201505}/20150331 How to Generate or Encrypt or Decrypt Random Passwords in Linux.md (100%) rename published/{ => 201505}/20150331 Its Now Worth Try Installing PHP 7.0 on CentOS 7.x or Fedora 21.md (100%) rename published/{ => 201505}/20150331 Linux Email App Geary Updated--How To Install It In Ubuntu.md (100%) rename published/{ => 201505}/20150407 5 Linux Command Line Based Tools for Downloading Files and Browsing Websites.md (100%) rename published/{ => 201505}/20150407 Ambient Noise Player for Ubuntu Plays Relaxing Sounds to Keep You Creative.md (100%) rename published/{ => 201505}/20150407 How To Install CentOS Web Panel In CentOS.md (100%) rename published/{ => 201505}/20150407 How to secure BGP sessions using authentication on Quagga.md (100%) rename published/{ => 201505}/20150409 4 Tools Send Email with Subject, Body and Attachment in Linux.md (100%) rename published/{ => 201505}/20150409 Install Inkscape - Open Source Vector Graphic Editor.md (100%) rename published/{ => 201505}/20150410 This tool can alert you about evil twin access points in the area.md (100%) rename published/{ => 201505}/20150410 What is a good alternative to wget or curl on Linux.md (100%) rename published/{ => 201505}/20150413 A Walk Through Some Important Docker Commands.md (100%) rename published/{ => 201505}/20150413 Linux FAQs with Answers--How to change PATH environment variable on Linux.md (100%) rename published/{ => 201505}/20150413 [Solved] Ubuntu Does Not Remember Brightness Settings.md (100%) rename published/{ => 201505}/20150415 Strong SSL Security on nginx.md (100%) rename published/{ => 201505}/20150417 14 Useful Examples of Linux 'sort' Command--Part 1.md (100%) rename published/{ => 201505}/20150417 How to Configure MariaDB Replication on CentOS Linux.md (100%) rename published/{ => 201505}/20150417 sshuttle--A transparent proxy-based VPN using ssh.md (100%) rename published/{ => 201505}/20150420 7 Interesting Linux 'sort' Command Examples--Part 2.md (100%) rename published/{ => 201505}/20150423 uperTuxKart 0.9 Released--The Best Racing Game on Linux Just Got Even Better.md (100%) rename published/{ => 201505}/20150429 Docker 1.6 Released--How to Upgrade on Fedora or CentOS.md (100%) rename published/{ => 201505}/20150429 Synfig Studio 1.0--Open Source Animation Gets Serious.md (100%) rename published/{ => 201505}/20150429 web caching basics terminology http headers and caching strategies.md (100%) rename published/{ => 201505}/20150504 How To Install Visual Studio Code On Ubuntu.md (100%) rename published/{ => 201505}/20150505 Bodhi Linux Introduces Moksha Desktop.md (100%) rename published/{ => 201505}/20150506 How to Securely Store Passwords and Api Keys Using Vault.md (100%) rename published/{ => 201505}/20150506 Linux FAQs with Answers--How to configure a Linux bridge with Network Manager on Ubuntu.md (100%) rename published/{ => 201505}/20150506 Linux FAQs with Answers--How to install autossh on Linux.md (100%) rename published/{ => 201505}/20150507 Command Line Tool to Monitor Linux Containers Performance.md (100%) rename published/{ => 201505}/20150511 OpenSSL command line Root and Intermediate CA including OCSP, CRL and revocation.md (100%) rename published/{ => 201505}/20150512 Guake 0.7.0 Released--A Drop-Down Terminal for Gnome Desktops.md (100%) rename published/{ => 201505}/20150515 New to Linux 5 Apps You Didn't Know You Were Missing.md (100%) rename published/{ => 201505}/20150518 Linux FAQs with Answers--How to block specific user agents on nginx web server.md (100%) rename published/{ => 201505}/20150518 Linux FAQs with Answers--How to fix 'fatal error--security or pam_modules.h--No such file or directory'.md (100%) rename published/{ => 201505}/20150521 Microsoft Open-Sources The Windows Communication Foundation.md (100%) rename published/{ => 201505}/20150527 Ubuntu Community Council Asks the Kubuntu Project Leader to Step Down.md (100%) rename published/{ => 201505}/30 Things to Do After Minimal RHEL or CentOS 7 Installation--4.md (100%) rename published/{ => 201505}/30 Things to Do After Minimal RHEL or CentOS 7 Installation--5.md (100%) rename published/{ => 201505}/30 Things to Do After Minimal RHEL or CentOS 7 Installation--6.md (100%) rename published/{ => 201505}/How to Manage Network using nmcli Tool in RedHat CentOS 7.x.md (100%) rename published/{ => 201505}/Linux grep command with 14 different examples.md (100%) diff --git a/published/20140804 Group Test--Linux Text Editors.md b/published/201505/20140804 Group Test--Linux Text Editors.md similarity index 100% rename from published/20140804 Group Test--Linux Text Editors.md rename to published/201505/20140804 Group Test--Linux Text Editors.md diff --git a/published/20150108 Interface (NICs) Bonding in Linux using nmcli.md b/published/201505/20150108 Interface (NICs) Bonding in Linux using nmcli.md similarity index 100% rename from published/20150108 Interface (NICs) Bonding in Linux using nmcli.md rename to published/201505/20150108 Interface (NICs) Bonding in Linux using nmcli.md diff --git a/published/20150112 What are useful command-line network monitors on Linux.md b/published/201505/20150112 What are useful command-line network monitors on Linux.md similarity index 100% rename from published/20150112 What are useful command-line network monitors on Linux.md rename to published/201505/20150112 What are useful command-line network monitors on Linux.md diff --git a/published/20150119 Unity Greeter Badges Brings Missing Session Icons to Ubuntu Login Screen.md b/published/201505/20150119 Unity Greeter Badges Brings Missing Session Icons to Ubuntu Login Screen.md similarity index 100% rename from published/20150119 Unity Greeter Badges Brings Missing Session Icons to Ubuntu Login Screen.md rename to published/201505/20150119 Unity Greeter Badges Brings Missing Session Icons to Ubuntu Login Screen.md diff --git a/published/20150123 How to make a file immutable on Linux.md b/published/201505/20150123 How to make a file immutable on Linux.md similarity index 100% rename from published/20150123 How to make a file immutable on Linux.md rename to published/201505/20150123 How to make a file immutable on Linux.md diff --git a/published/20150124 Why does C++ promote an int to a float when a float cannot represent all int values.md b/published/201505/20150124 Why does C++ promote an int to a float when a float cannot represent all int values.md similarity index 100% rename from published/20150124 Why does C++ promote an int to a float when a float cannot represent all int values.md rename to published/201505/20150124 Why does C++ promote an int to a float when a float cannot represent all int values.md diff --git a/published/20150126 iptraf--A TCP or UDP Network Monitoring Utility.md b/published/201505/20150126 iptraf--A TCP or UDP Network Monitoring Utility.md similarity index 100% rename from published/20150126 iptraf--A TCP or UDP Network Monitoring Utility.md rename to published/201505/20150126 iptraf--A TCP or UDP Network Monitoring Utility.md diff --git a/published/20150128 Docker-2 Setting up a private Docker registry.md b/published/201505/20150128 Docker-2 Setting up a private Docker registry.md similarity index 100% rename from published/20150128 Docker-2 Setting up a private Docker registry.md rename to published/201505/20150128 Docker-2 Setting up a private Docker registry.md diff --git a/published/20150128 Docker-3 Automated Docker-based Rails deployments.md b/published/201505/20150128 Docker-3 Automated Docker-based Rails deployments.md similarity index 100% rename from published/20150128 Docker-3 Automated Docker-based Rails deployments.md rename to published/201505/20150128 Docker-3 Automated Docker-based Rails deployments.md diff --git a/published/20150205 Inxi--Find System And Hardware Information On Linux.md b/published/201505/20150205 Inxi--Find System And Hardware Information On Linux.md similarity index 100% rename from published/20150205 Inxi--Find System And Hardware Information On Linux.md rename to published/201505/20150205 Inxi--Find System And Hardware Information On Linux.md diff --git a/published/20150205 zBackup--A versatile deduplicating backup tool.md b/published/201505/20150205 zBackup--A versatile deduplicating backup tool.md similarity index 100% rename from published/20150205 zBackup--A versatile deduplicating backup tool.md rename to published/201505/20150205 zBackup--A versatile deduplicating backup tool.md diff --git a/published/20150211 25 Tips for Intermediate Git Users.md b/published/201505/20150211 25 Tips for Intermediate Git Users.md similarity index 100% rename from published/20150211 25 Tips for Intermediate Git Users.md rename to published/201505/20150211 25 Tips for Intermediate Git Users.md diff --git a/published/20150211 Install Linux-Dash (Web Based Monitoring tool) on Ubntu 14.10.md b/published/201505/20150211 Install Linux-Dash (Web Based Monitoring tool) on Ubntu 14.10.md similarity index 100% rename from published/20150211 Install Linux-Dash (Web Based Monitoring tool) on Ubntu 14.10.md rename to published/201505/20150211 Install Linux-Dash (Web Based Monitoring tool) on Ubntu 14.10.md diff --git a/published/20150225 Linux FAQs with Answers--How to disable IPv6 on Linux.md b/published/201505/20150225 Linux FAQs with Answers--How to disable IPv6 on Linux.md similarity index 100% rename from published/20150225 Linux FAQs with Answers--How to disable IPv6 on Linux.md rename to published/201505/20150225 Linux FAQs with Answers--How to disable IPv6 on Linux.md diff --git a/published/20150227 Bringing a Bunch of Best Known Linux Network Tools.md b/published/201505/20150227 Bringing a Bunch of Best Known Linux Network Tools.md similarity index 100% rename from published/20150227 Bringing a Bunch of Best Known Linux Network Tools.md rename to published/201505/20150227 Bringing a Bunch of Best Known Linux Network Tools.md diff --git a/published/20150227 Enjoy Android Apps on Ubuntu using ARChon Runtime.md b/published/201505/20150227 Enjoy Android Apps on Ubuntu using ARChon Runtime.md similarity index 100% rename from published/20150227 Enjoy Android Apps on Ubuntu using ARChon Runtime.md rename to published/201505/20150227 Enjoy Android Apps on Ubuntu using ARChon Runtime.md diff --git a/published/20150227 How To Fix--Failed to fetch cdrom apt-get update cannot be used to add new CD-ROMs.md b/published/201505/20150227 How To Fix--Failed to fetch cdrom apt-get update cannot be used to add new CD-ROMs.md similarity index 100% rename from published/20150227 How To Fix--Failed to fetch cdrom apt-get update cannot be used to add new CD-ROMs.md rename to published/201505/20150227 How To Fix--Failed to fetch cdrom apt-get update cannot be used to add new CD-ROMs.md diff --git a/published/20150227 How to Install Lightweight Budgie v8 Desktop in Ubuntu 14.04.md b/published/201505/20150227 How to Install Lightweight Budgie v8 Desktop in Ubuntu 14.04.md similarity index 100% rename from published/20150227 How to Install Lightweight Budgie v8 Desktop in Ubuntu 14.04.md rename to published/201505/20150227 How to Install Lightweight Budgie v8 Desktop in Ubuntu 14.04.md diff --git a/published/20150302 How to Limit the Network Bandwidth Used by Applications in a Linux System with Trickle.md b/published/201505/20150302 How to Limit the Network Bandwidth Used by Applications in a Linux System with Trickle.md similarity index 100% rename from published/20150302 How to Limit the Network Bandwidth Used by Applications in a Linux System with Trickle.md rename to published/201505/20150302 How to Limit the Network Bandwidth Used by Applications in a Linux System with Trickle.md diff --git a/published/20150302 How to Manage KVM Virtual Environment using Commandline Tools in Linux.md b/published/201505/20150302 How to Manage KVM Virtual Environment using Commandline Tools in Linux.md similarity index 100% rename from published/20150302 How to Manage KVM Virtual Environment using Commandline Tools in Linux.md rename to published/201505/20150302 How to Manage KVM Virtual Environment using Commandline Tools in Linux.md diff --git a/published/20150304 Linux Basics--How To Fix 'E-- var cache apt archives subprocess new pre-removal script returned error exit status 1' In Ubuntu.md b/published/201505/20150304 Linux Basics--How To Fix 'E-- var cache apt archives subprocess new pre-removal script returned error exit status 1' In Ubuntu.md similarity index 100% rename from published/20150304 Linux Basics--How To Fix 'E-- var cache apt archives subprocess new pre-removal script returned error exit status 1' In Ubuntu.md rename to published/201505/20150304 Linux Basics--How To Fix 'E-- var cache apt archives subprocess new pre-removal script returned error exit status 1' In Ubuntu.md diff --git a/published/20150304 Monitoring Your Network And Servers With Observium.md b/published/201505/20150304 Monitoring Your Network And Servers With Observium.md similarity index 100% rename from published/20150304 Monitoring Your Network And Servers With Observium.md rename to published/201505/20150304 Monitoring Your Network And Servers With Observium.md diff --git a/published/20150304 Share Folders On Local Network Between Ubuntu And Windows.md b/published/201505/20150304 Share Folders On Local Network Between Ubuntu And Windows.md similarity index 100% rename from published/20150304 Share Folders On Local Network Between Ubuntu And Windows.md rename to published/201505/20150304 Share Folders On Local Network Between Ubuntu And Windows.md diff --git a/published/20150306 How to Setup lftp--A Simple Command line FTP Program.md b/published/201505/20150306 How to Setup lftp--A Simple Command line FTP Program.md similarity index 100% rename from published/20150306 How to Setup lftp--A Simple Command line FTP Program.md rename to published/201505/20150306 How to Setup lftp--A Simple Command line FTP Program.md diff --git a/published/20150309 List Of Free Windows SSH Client Tools To Connect To Your Linux Server .md b/published/201505/20150309 List Of Free Windows SSH Client Tools To Connect To Your Linux Server .md similarity index 100% rename from published/20150309 List Of Free Windows SSH Client Tools To Connect To Your Linux Server .md rename to published/201505/20150309 List Of Free Windows SSH Client Tools To Connect To Your Linux Server .md diff --git a/published/20150310 [Fixed] Keyboard And Mouse Freeze After Suspend In Ubuntu 14.04 [Quick Tip].md b/published/201505/20150310 [Fixed] Keyboard And Mouse Freeze After Suspend In Ubuntu 14.04 [Quick Tip].md similarity index 100% rename from published/20150310 [Fixed] Keyboard And Mouse Freeze After Suspend In Ubuntu 14.04 [Quick Tip].md rename to published/201505/20150310 [Fixed] Keyboard And Mouse Freeze After Suspend In Ubuntu 14.04 [Quick Tip].md diff --git a/published/20150316 5 Interesting Command Line Tips and Tricks in Linux--Part 1.md b/published/201505/20150316 5 Interesting Command Line Tips and Tricks in Linux--Part 1.md similarity index 100% rename from published/20150316 5 Interesting Command Line Tips and Tricks in Linux--Part 1.md rename to published/201505/20150316 5 Interesting Command Line Tips and Tricks in Linux--Part 1.md diff --git a/published/20150316 How to access Gmail from the command line on Linux with Alpine.md b/published/201505/20150316 How to access Gmail from the command line on Linux with Alpine.md similarity index 100% rename from published/20150316 How to access Gmail from the command line on Linux with Alpine.md rename to published/201505/20150316 How to access Gmail from the command line on Linux with Alpine.md diff --git a/published/20150316 Install Mate desktop in FreeBSD 10.1.md b/published/201505/20150316 Install Mate desktop in FreeBSD 10.1.md similarity index 100% rename from published/20150316 Install Mate desktop in FreeBSD 10.1.md rename to published/201505/20150316 Install Mate desktop in FreeBSD 10.1.md diff --git a/published/20150316 Systemd Boot Process a Close Look in Linux.md b/published/201505/20150316 Systemd Boot Process a Close Look in Linux.md similarity index 100% rename from published/20150316 Systemd Boot Process a Close Look in Linux.md rename to published/201505/20150316 Systemd Boot Process a Close Look in Linux.md diff --git a/published/20150318 11 Linux Terminal Commands That Will Rock Your World.md b/published/201505/20150318 11 Linux Terminal Commands That Will Rock Your World.md similarity index 100% rename from published/20150318 11 Linux Terminal Commands That Will Rock Your World.md rename to published/201505/20150318 11 Linux Terminal Commands That Will Rock Your World.md diff --git a/published/20150318 How to share a directory with Samba on Fedora or CentOS.md b/published/201505/20150318 How to share a directory with Samba on Fedora or CentOS.md similarity index 100% rename from published/20150318 How to share a directory with Samba on Fedora or CentOS.md rename to published/201505/20150318 How to share a directory with Samba on Fedora or CentOS.md diff --git a/published/20150320 Locate Stolen laptops and Smart phones Using Prey Tool in Ubuntu.md b/published/201505/20150320 Locate Stolen laptops and Smart phones Using Prey Tool in Ubuntu.md similarity index 100% rename from published/20150320 Locate Stolen laptops and Smart phones Using Prey Tool in Ubuntu.md rename to published/201505/20150320 Locate Stolen laptops and Smart phones Using Prey Tool in Ubuntu.md diff --git a/published/20150320 Sleuth Kit--Open Source Forensic Tool to Analyze Disk Images and Recover Files.md b/published/201505/20150320 Sleuth Kit--Open Source Forensic Tool to Analyze Disk Images and Recover Files.md similarity index 100% rename from published/20150320 Sleuth Kit--Open Source Forensic Tool to Analyze Disk Images and Recover Files.md rename to published/201505/20150320 Sleuth Kit--Open Source Forensic Tool to Analyze Disk Images and Recover Files.md diff --git a/published/20150323 How to enable ssh login without entering password.md b/published/201505/20150323 How to enable ssh login without entering password.md similarity index 100% rename from published/20150323 How to enable ssh login without entering password.md rename to published/201505/20150323 How to enable ssh login without entering password.md diff --git a/published/20150323 Linux FAQs with Answers--How to compress JPEG images from the command line on Linux.md b/published/201505/20150323 Linux FAQs with Answers--How to compress JPEG images from the command line on Linux.md similarity index 100% rename from published/20150323 Linux FAQs with Answers--How to compress JPEG images from the command line on Linux.md rename to published/201505/20150323 Linux FAQs with Answers--How to compress JPEG images from the command line on Linux.md diff --git a/published/20150323 Linux FAQs with Answers--How to install and access CentOS remote desktop on VPS.md b/published/201505/20150323 Linux FAQs with Answers--How to install and access CentOS remote desktop on VPS.md similarity index 100% rename from published/20150323 Linux FAQs with Answers--How to install and access CentOS remote desktop on VPS.md rename to published/201505/20150323 Linux FAQs with Answers--How to install and access CentOS remote desktop on VPS.md diff --git a/published/20150323 Square 2.0 Icon Pack Is Twice More Beautiful.md b/published/201505/20150323 Square 2.0 Icon Pack Is Twice More Beautiful.md similarity index 100% rename from published/20150323 Square 2.0 Icon Pack Is Twice More Beautiful.md rename to published/201505/20150323 Square 2.0 Icon Pack Is Twice More Beautiful.md diff --git a/published/20150324 4 Tools to Securely Delete Files from Linux.md b/published/201505/20150324 4 Tools to Securely Delete Files from Linux.md similarity index 100% rename from published/20150324 4 Tools to Securely Delete Files from Linux.md rename to published/201505/20150324 4 Tools to Securely Delete Files from Linux.md diff --git a/published/20150324 7 Quirky' ls' Command Tricks Every Linux User Should Know.md b/published/201505/20150324 7 Quirky' ls' Command Tricks Every Linux User Should Know.md similarity index 100% rename from published/20150324 7 Quirky' ls' Command Tricks Every Linux User Should Know.md rename to published/201505/20150324 7 Quirky' ls' Command Tricks Every Linux User Should Know.md diff --git a/published/20150324 How to Host Open Source Code Repository in github.md b/published/201505/20150324 How to Host Open Source Code Repository in github.md similarity index 100% rename from published/20150324 How to Host Open Source Code Repository in github.md rename to published/201505/20150324 How to Host Open Source Code Repository in github.md diff --git a/published/20150324 How to Interactively Create a Docker Container.md b/published/201505/20150324 How to Interactively Create a Docker Container.md similarity index 100% rename from published/20150324 How to Interactively Create a Docker Container.md rename to published/201505/20150324 How to Interactively Create a Docker Container.md diff --git a/published/20150326 How to set up server monitoring system with Monit.md b/published/201505/20150326 How to set up server monitoring system with Monit.md similarity index 100% rename from published/20150326 How to set up server monitoring system with Monit.md rename to published/201505/20150326 How to set up server monitoring system with Monit.md diff --git a/published/20150330 2 Ways to Create Your Own Docker Base Image.md b/published/201505/20150330 2 Ways to Create Your Own Docker Base Image.md similarity index 100% rename from published/20150330 2 Ways to Create Your Own Docker Base Image.md rename to published/201505/20150330 2 Ways to Create Your Own Docker Base Image.md diff --git a/published/20150330 How to secure SSH login with one-time passwords on Linux.md b/published/201505/20150330 How to secure SSH login with one-time passwords on Linux.md similarity index 100% rename from published/20150330 How to secure SSH login with one-time passwords on Linux.md rename to published/201505/20150330 How to secure SSH login with one-time passwords on Linux.md diff --git a/published/20150330 Linux FAQs with Answers--How to upgrade Docker on Ubuntu.md b/published/201505/20150330 Linux FAQs with Answers--How to upgrade Docker on Ubuntu.md similarity index 100% rename from published/20150330 Linux FAQs with Answers--How to upgrade Docker on Ubuntu.md rename to published/201505/20150330 Linux FAQs with Answers--How to upgrade Docker on Ubuntu.md diff --git a/published/20150331 Conky--The Ultimate X Based System Monitor Application.md b/published/201505/20150331 Conky--The Ultimate X Based System Monitor Application.md similarity index 100% rename from published/20150331 Conky--The Ultimate X Based System Monitor Application.md rename to published/201505/20150331 Conky--The Ultimate X Based System Monitor Application.md diff --git a/published/20150331 How to Generate or Encrypt or Decrypt Random Passwords in Linux.md b/published/201505/20150331 How to Generate or Encrypt or Decrypt Random Passwords in Linux.md similarity index 100% rename from published/20150331 How to Generate or Encrypt or Decrypt Random Passwords in Linux.md rename to published/201505/20150331 How to Generate or Encrypt or Decrypt Random Passwords in Linux.md diff --git a/published/20150331 Its Now Worth Try Installing PHP 7.0 on CentOS 7.x or Fedora 21.md b/published/201505/20150331 Its Now Worth Try Installing PHP 7.0 on CentOS 7.x or Fedora 21.md similarity index 100% rename from published/20150331 Its Now Worth Try Installing PHP 7.0 on CentOS 7.x or Fedora 21.md rename to published/201505/20150331 Its Now Worth Try Installing PHP 7.0 on CentOS 7.x or Fedora 21.md diff --git a/published/20150331 Linux Email App Geary Updated--How To Install It In Ubuntu.md b/published/201505/20150331 Linux Email App Geary Updated--How To Install It In Ubuntu.md similarity index 100% rename from published/20150331 Linux Email App Geary Updated--How To Install It In Ubuntu.md rename to published/201505/20150331 Linux Email App Geary Updated--How To Install It In Ubuntu.md diff --git a/published/20150407 5 Linux Command Line Based Tools for Downloading Files and Browsing Websites.md b/published/201505/20150407 5 Linux Command Line Based Tools for Downloading Files and Browsing Websites.md similarity index 100% rename from published/20150407 5 Linux Command Line Based Tools for Downloading Files and Browsing Websites.md rename to published/201505/20150407 5 Linux Command Line Based Tools for Downloading Files and Browsing Websites.md diff --git a/published/20150407 Ambient Noise Player for Ubuntu Plays Relaxing Sounds to Keep You Creative.md b/published/201505/20150407 Ambient Noise Player for Ubuntu Plays Relaxing Sounds to Keep You Creative.md similarity index 100% rename from published/20150407 Ambient Noise Player for Ubuntu Plays Relaxing Sounds to Keep You Creative.md rename to published/201505/20150407 Ambient Noise Player for Ubuntu Plays Relaxing Sounds to Keep You Creative.md diff --git a/published/20150407 How To Install CentOS Web Panel In CentOS.md b/published/201505/20150407 How To Install CentOS Web Panel In CentOS.md similarity index 100% rename from published/20150407 How To Install CentOS Web Panel In CentOS.md rename to published/201505/20150407 How To Install CentOS Web Panel In CentOS.md diff --git a/published/20150407 How to secure BGP sessions using authentication on Quagga.md b/published/201505/20150407 How to secure BGP sessions using authentication on Quagga.md similarity index 100% rename from published/20150407 How to secure BGP sessions using authentication on Quagga.md rename to published/201505/20150407 How to secure BGP sessions using authentication on Quagga.md diff --git a/published/20150409 4 Tools Send Email with Subject, Body and Attachment in Linux.md b/published/201505/20150409 4 Tools Send Email with Subject, Body and Attachment in Linux.md similarity index 100% rename from published/20150409 4 Tools Send Email with Subject, Body and Attachment in Linux.md rename to published/201505/20150409 4 Tools Send Email with Subject, Body and Attachment in Linux.md diff --git a/published/20150409 Install Inkscape - Open Source Vector Graphic Editor.md b/published/201505/20150409 Install Inkscape - Open Source Vector Graphic Editor.md similarity index 100% rename from published/20150409 Install Inkscape - Open Source Vector Graphic Editor.md rename to published/201505/20150409 Install Inkscape - Open Source Vector Graphic Editor.md diff --git a/published/20150410 This tool can alert you about evil twin access points in the area.md b/published/201505/20150410 This tool can alert you about evil twin access points in the area.md similarity index 100% rename from published/20150410 This tool can alert you about evil twin access points in the area.md rename to published/201505/20150410 This tool can alert you about evil twin access points in the area.md diff --git a/published/20150410 What is a good alternative to wget or curl on Linux.md b/published/201505/20150410 What is a good alternative to wget or curl on Linux.md similarity index 100% rename from published/20150410 What is a good alternative to wget or curl on Linux.md rename to published/201505/20150410 What is a good alternative to wget or curl on Linux.md diff --git a/published/20150413 A Walk Through Some Important Docker Commands.md b/published/201505/20150413 A Walk Through Some Important Docker Commands.md similarity index 100% rename from published/20150413 A Walk Through Some Important Docker Commands.md rename to published/201505/20150413 A Walk Through Some Important Docker Commands.md diff --git a/published/20150413 Linux FAQs with Answers--How to change PATH environment variable on Linux.md b/published/201505/20150413 Linux FAQs with Answers--How to change PATH environment variable on Linux.md similarity index 100% rename from published/20150413 Linux FAQs with Answers--How to change PATH environment variable on Linux.md rename to published/201505/20150413 Linux FAQs with Answers--How to change PATH environment variable on Linux.md diff --git a/published/20150413 [Solved] Ubuntu Does Not Remember Brightness Settings.md b/published/201505/20150413 [Solved] Ubuntu Does Not Remember Brightness Settings.md similarity index 100% rename from published/20150413 [Solved] Ubuntu Does Not Remember Brightness Settings.md rename to published/201505/20150413 [Solved] Ubuntu Does Not Remember Brightness Settings.md diff --git a/published/20150415 Strong SSL Security on nginx.md b/published/201505/20150415 Strong SSL Security on nginx.md similarity index 100% rename from published/20150415 Strong SSL Security on nginx.md rename to published/201505/20150415 Strong SSL Security on nginx.md diff --git a/published/20150417 14 Useful Examples of Linux 'sort' Command--Part 1.md b/published/201505/20150417 14 Useful Examples of Linux 'sort' Command--Part 1.md similarity index 100% rename from published/20150417 14 Useful Examples of Linux 'sort' Command--Part 1.md rename to published/201505/20150417 14 Useful Examples of Linux 'sort' Command--Part 1.md diff --git a/published/20150417 How to Configure MariaDB Replication on CentOS Linux.md b/published/201505/20150417 How to Configure MariaDB Replication on CentOS Linux.md similarity index 100% rename from published/20150417 How to Configure MariaDB Replication on CentOS Linux.md rename to published/201505/20150417 How to Configure MariaDB Replication on CentOS Linux.md diff --git a/published/20150417 sshuttle--A transparent proxy-based VPN using ssh.md b/published/201505/20150417 sshuttle--A transparent proxy-based VPN using ssh.md similarity index 100% rename from published/20150417 sshuttle--A transparent proxy-based VPN using ssh.md rename to published/201505/20150417 sshuttle--A transparent proxy-based VPN using ssh.md diff --git a/published/20150420 7 Interesting Linux 'sort' Command Examples--Part 2.md b/published/201505/20150420 7 Interesting Linux 'sort' Command Examples--Part 2.md similarity index 100% rename from published/20150420 7 Interesting Linux 'sort' Command Examples--Part 2.md rename to published/201505/20150420 7 Interesting Linux 'sort' Command Examples--Part 2.md diff --git a/published/20150423 uperTuxKart 0.9 Released--The Best Racing Game on Linux Just Got Even Better.md b/published/201505/20150423 uperTuxKart 0.9 Released--The Best Racing Game on Linux Just Got Even Better.md similarity index 100% rename from published/20150423 uperTuxKart 0.9 Released--The Best Racing Game on Linux Just Got Even Better.md rename to published/201505/20150423 uperTuxKart 0.9 Released--The Best Racing Game on Linux Just Got Even Better.md diff --git a/published/20150429 Docker 1.6 Released--How to Upgrade on Fedora or CentOS.md b/published/201505/20150429 Docker 1.6 Released--How to Upgrade on Fedora or CentOS.md similarity index 100% rename from published/20150429 Docker 1.6 Released--How to Upgrade on Fedora or CentOS.md rename to published/201505/20150429 Docker 1.6 Released--How to Upgrade on Fedora or CentOS.md diff --git a/published/20150429 Synfig Studio 1.0--Open Source Animation Gets Serious.md b/published/201505/20150429 Synfig Studio 1.0--Open Source Animation Gets Serious.md similarity index 100% rename from published/20150429 Synfig Studio 1.0--Open Source Animation Gets Serious.md rename to published/201505/20150429 Synfig Studio 1.0--Open Source Animation Gets Serious.md diff --git a/published/20150429 web caching basics terminology http headers and caching strategies.md b/published/201505/20150429 web caching basics terminology http headers and caching strategies.md similarity index 100% rename from published/20150429 web caching basics terminology http headers and caching strategies.md rename to published/201505/20150429 web caching basics terminology http headers and caching strategies.md diff --git a/published/20150504 How To Install Visual Studio Code On Ubuntu.md b/published/201505/20150504 How To Install Visual Studio Code On Ubuntu.md similarity index 100% rename from published/20150504 How To Install Visual Studio Code On Ubuntu.md rename to published/201505/20150504 How To Install Visual Studio Code On Ubuntu.md diff --git a/published/20150505 Bodhi Linux Introduces Moksha Desktop.md b/published/201505/20150505 Bodhi Linux Introduces Moksha Desktop.md similarity index 100% rename from published/20150505 Bodhi Linux Introduces Moksha Desktop.md rename to published/201505/20150505 Bodhi Linux Introduces Moksha Desktop.md diff --git a/published/20150506 How to Securely Store Passwords and Api Keys Using Vault.md b/published/201505/20150506 How to Securely Store Passwords and Api Keys Using Vault.md similarity index 100% rename from published/20150506 How to Securely Store Passwords and Api Keys Using Vault.md rename to published/201505/20150506 How to Securely Store Passwords and Api Keys Using Vault.md diff --git a/published/20150506 Linux FAQs with Answers--How to configure a Linux bridge with Network Manager on Ubuntu.md b/published/201505/20150506 Linux FAQs with Answers--How to configure a Linux bridge with Network Manager on Ubuntu.md similarity index 100% rename from published/20150506 Linux FAQs with Answers--How to configure a Linux bridge with Network Manager on Ubuntu.md rename to published/201505/20150506 Linux FAQs with Answers--How to configure a Linux bridge with Network Manager on Ubuntu.md diff --git a/published/20150506 Linux FAQs with Answers--How to install autossh on Linux.md b/published/201505/20150506 Linux FAQs with Answers--How to install autossh on Linux.md similarity index 100% rename from published/20150506 Linux FAQs with Answers--How to install autossh on Linux.md rename to published/201505/20150506 Linux FAQs with Answers--How to install autossh on Linux.md diff --git a/published/20150507 Command Line Tool to Monitor Linux Containers Performance.md b/published/201505/20150507 Command Line Tool to Monitor Linux Containers Performance.md similarity index 100% rename from published/20150507 Command Line Tool to Monitor Linux Containers Performance.md rename to published/201505/20150507 Command Line Tool to Monitor Linux Containers Performance.md diff --git a/published/20150511 OpenSSL command line Root and Intermediate CA including OCSP, CRL and revocation.md b/published/201505/20150511 OpenSSL command line Root and Intermediate CA including OCSP, CRL and revocation.md similarity index 100% rename from published/20150511 OpenSSL command line Root and Intermediate CA including OCSP, CRL and revocation.md rename to published/201505/20150511 OpenSSL command line Root and Intermediate CA including OCSP, CRL and revocation.md diff --git a/published/20150512 Guake 0.7.0 Released--A Drop-Down Terminal for Gnome Desktops.md b/published/201505/20150512 Guake 0.7.0 Released--A Drop-Down Terminal for Gnome Desktops.md similarity index 100% rename from published/20150512 Guake 0.7.0 Released--A Drop-Down Terminal for Gnome Desktops.md rename to published/201505/20150512 Guake 0.7.0 Released--A Drop-Down Terminal for Gnome Desktops.md diff --git a/published/20150515 New to Linux 5 Apps You Didn't Know You Were Missing.md b/published/201505/20150515 New to Linux 5 Apps You Didn't Know You Were Missing.md similarity index 100% rename from published/20150515 New to Linux 5 Apps You Didn't Know You Were Missing.md rename to published/201505/20150515 New to Linux 5 Apps You Didn't Know You Were Missing.md diff --git a/published/20150518 Linux FAQs with Answers--How to block specific user agents on nginx web server.md b/published/201505/20150518 Linux FAQs with Answers--How to block specific user agents on nginx web server.md similarity index 100% rename from published/20150518 Linux FAQs with Answers--How to block specific user agents on nginx web server.md rename to published/201505/20150518 Linux FAQs with Answers--How to block specific user agents on nginx web server.md diff --git a/published/20150518 Linux FAQs with Answers--How to fix 'fatal error--security or pam_modules.h--No such file or directory'.md b/published/201505/20150518 Linux FAQs with Answers--How to fix 'fatal error--security or pam_modules.h--No such file or directory'.md similarity index 100% rename from published/20150518 Linux FAQs with Answers--How to fix 'fatal error--security or pam_modules.h--No such file or directory'.md rename to published/201505/20150518 Linux FAQs with Answers--How to fix 'fatal error--security or pam_modules.h--No such file or directory'.md diff --git a/published/20150521 Microsoft Open-Sources The Windows Communication Foundation.md b/published/201505/20150521 Microsoft Open-Sources The Windows Communication Foundation.md similarity index 100% rename from published/20150521 Microsoft Open-Sources The Windows Communication Foundation.md rename to published/201505/20150521 Microsoft Open-Sources The Windows Communication Foundation.md diff --git a/published/20150527 Ubuntu Community Council Asks the Kubuntu Project Leader to Step Down.md b/published/201505/20150527 Ubuntu Community Council Asks the Kubuntu Project Leader to Step Down.md similarity index 100% rename from published/20150527 Ubuntu Community Council Asks the Kubuntu Project Leader to Step Down.md rename to published/201505/20150527 Ubuntu Community Council Asks the Kubuntu Project Leader to Step Down.md diff --git a/published/30 Things to Do After Minimal RHEL or CentOS 7 Installation--4.md b/published/201505/30 Things to Do After Minimal RHEL or CentOS 7 Installation--4.md similarity index 100% rename from published/30 Things to Do After Minimal RHEL or CentOS 7 Installation--4.md rename to published/201505/30 Things to Do After Minimal RHEL or CentOS 7 Installation--4.md diff --git a/published/30 Things to Do After Minimal RHEL or CentOS 7 Installation--5.md b/published/201505/30 Things to Do After Minimal RHEL or CentOS 7 Installation--5.md similarity index 100% rename from published/30 Things to Do After Minimal RHEL or CentOS 7 Installation--5.md rename to published/201505/30 Things to Do After Minimal RHEL or CentOS 7 Installation--5.md diff --git a/published/30 Things to Do After Minimal RHEL or CentOS 7 Installation--6.md b/published/201505/30 Things to Do After Minimal RHEL or CentOS 7 Installation--6.md similarity index 100% rename from published/30 Things to Do After Minimal RHEL or CentOS 7 Installation--6.md rename to published/201505/30 Things to Do After Minimal RHEL or CentOS 7 Installation--6.md diff --git a/published/How to Manage Network using nmcli Tool in RedHat CentOS 7.x.md b/published/201505/How to Manage Network using nmcli Tool in RedHat CentOS 7.x.md similarity index 100% rename from published/How to Manage Network using nmcli Tool in RedHat CentOS 7.x.md rename to published/201505/How to Manage Network using nmcli Tool in RedHat CentOS 7.x.md diff --git a/published/Linux grep command with 14 different examples.md b/published/201505/Linux grep command with 14 different examples.md similarity index 100% rename from published/Linux grep command with 14 different examples.md rename to published/201505/Linux grep command with 14 different examples.md From 78f496e6936aa51572a1a3c4a481f5deb2df15ac Mon Sep 17 00:00:00 2001 From: wwy Date: Mon, 1 Jun 2015 08:54:41 +0800 Subject: [PATCH 223/965] Update 20150528 27 'DNF' Fork of Yum Commands for RPM Package Management in Linux.md --- ...ork of Yum Commands for RPM Package Management in Linux.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150528 27 'DNF' Fork of Yum Commands for RPM Package Management in Linux.md b/sources/tech/20150528 27 'DNF' Fork of Yum Commands for RPM Package Management in Linux.md index dc81fef219..2ada2ac4cd 100644 --- a/sources/tech/20150528 27 'DNF' Fork of Yum Commands for RPM Package Management in Linux.md +++ b/sources/tech/20150528 27 'DNF' Fork of Yum Commands for RPM Package Management in Linux.md @@ -1,3 +1,5 @@ +translating by wwy-hust + 27 ‘DNF’ (Fork of Yum) Commands for RPM Package Management in Linux ================================================================================ DNF aka Dandified YUM is a next generation Package Manager for RPM based Distribution. It was first introduced in Fedora 18 and it is replaced [YUM utility][1] in recent release of Fedora 22. @@ -284,4 +286,4 @@ via: http://www.tecmint.com/dnf-commands-for-fedora-rpm-package-management/ [a]:http://www.tecmint.com/author/avishek/ [1]:http://www.tecmint.com/20-linux-yum-yellowdog-updater-modified-commands-for-package-mangement/ [2]:http://www.tecmint.com/dnf-next-generation-package-management-utility-for-linux/ -[3]:http://www.tecmint.com/systemd-replaces-init-in-linux/ \ No newline at end of file +[3]:http://www.tecmint.com/systemd-replaces-init-in-linux/ From c30cd779d5c4c4c1a36284e4cd716c43d4e7dc84 Mon Sep 17 00:00:00 2001 From: joeren Date: Mon, 1 Jun 2015 09:19:48 +0800 Subject: [PATCH 224/965] Update 20150528 Things To Do After Installing Fedora 22.md --- .../tech/20150528 Things To Do After Installing Fedora 22.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150528 Things To Do After Installing Fedora 22.md b/sources/tech/20150528 Things To Do After Installing Fedora 22.md index 27b37f86ee..023869a9f3 100644 --- a/sources/tech/20150528 Things To Do After Installing Fedora 22.md +++ b/sources/tech/20150528 Things To Do After Installing Fedora 22.md @@ -1,3 +1,4 @@ +Translating by GOLinux! Things To Do After Installing Fedora 22 ================================================================================ Fedora 22 the latest entrant in the community developed line of Red hat operating systems is released on the 26th of May 2015. A lot of speculation and anticipation has been associated with this release of the venerable fedora. Well there are some major changes that are being proposed for Fedora 22. @@ -111,4 +112,4 @@ via: http://linoxide.com/linux-how-to/things-do-after-installing-fedora-22/ [a]:http://linoxide.com/author/jonathande/ [1]:https://get.adobe.com/flashplayer/ [2]:http://spins.fedoraproject.org/ -[3]:https://www.google.com/intl/en/chrome/browser/desktop/index.html \ No newline at end of file +[3]:https://www.google.com/intl/en/chrome/browser/desktop/index.html From 2cc762a6f22daa5b16aa6dc0b21d014a20ffc074 Mon Sep 17 00:00:00 2001 From: wxy Date: Mon, 1 Jun 2015 09:58:26 +0800 Subject: [PATCH 225/965] PUB:20150225 Install Google's Material Design Inspired GTK And Icon Theme Paper in Linux MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @sevenot 如我 QQ 上和你说到,请下次要注意格式。https://linux.cn/article-5548-1.html --- ...pired GTK And Icon Theme Paper in Linux.md | 70 ++++++++++++++++ ...pired GTK And Icon Theme Paper in Linux.md | 83 ------------------- 2 files changed, 70 insertions(+), 83 deletions(-) create mode 100644 published/20150225 Install Google's Material Design Inspired GTK And Icon Theme Paper in Linux.md delete mode 100644 translated/share/20150225 Install Google's Material Design Inspired GTK And Icon Theme Paper in Linux.md diff --git a/published/20150225 Install Google's Material Design Inspired GTK And Icon Theme Paper in Linux.md b/published/20150225 Install Google's Material Design Inspired GTK And Icon Theme Paper in Linux.md new file mode 100644 index 0000000000..a4ca97ed5a --- /dev/null +++ b/published/20150225 Install Google's Material Design Inspired GTK And Icon Theme Paper in Linux.md @@ -0,0 +1,70 @@ +在 Linux 下体验谷歌 Material风格的GTK和图标主题Paper +================================================================================ +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/02/Paper_theme_Material_Design.jpg) + +[Paper][1]是一款即将与广大朋友们见面的一个图形工具包和图标主题,它的设计灵感来自于谷歌的设计语言[Material风格][2]。Paper由Sam Hewitt发起,Sam是[Moka项目][3]的一员,Moka总会设计出[让人满意的Ubuntu主题][4]。对于Paper,我敢说只要它一经推出,它必将是[最好的GTK主题开发包][5]之一。 + +对的,你没有听错,Paper主题还在开发阶段。因此我建议,如果你想在你的Ubuntu或者它的衍生版本上安装Paper,最好抱着试一试的实验心态。因为你多多少少会发现一些破损的图标,但这并不影响整体体验非常棒! + +### 通过PPA在Ubuntu及其衍生版本上安装Paper主题 ### + +Sam为Ubuntu和它的衍生版本设置了一个专用的PPA(Presonal Package Archives,个人软件包档案)。我推荐你通过PPA安装而不是下载Paper主题,因为你将会定期更新主题。这个PPA可供使用的系统有Ubuntu 15.04, Ubuntu 14.10, Ubuntu 14.04, Elementary OS Freya, Elementary OS Luna, Linux Mint 17, Linux Mint 16 和其它的Ubuntu衍生版本。 + +打开终端,输入下列命令: + + sudo add-apt-repository ppa:snwh/pulp + sudo apt-get update + sudo apt-get install paper-gtk-theme paper-icon-theme + +### 下载Paper GTK和图标主题 ### + + +如果你不想用PPA,你可以手动下载主题和图标。但是就像刚才所说,这样你就无法自动更新。 + +- [下载Paper图标主题][6] +- [下载Paper的GTK主题][7] + +#### 把它们用起来吧 #### + +我希望你知道怎么在你的Ubuntu中安装或者更改主题。如果你不知道,下面几个教程将帮助你安装一个新的主题。 + +- [如何在标准Ubuntu中更改主题][8] +- [如何在GNOME Shell中更改主题][9] +- [如何在Ubuntu Mint中更改主题][10] +- [如何在Elementary OS Freya中更改主题][11] + +#### 就是这样! #### + +因为我用过[Elementary OS Freya][12]一段时间,这里有一些看起来像Elementary OS Freya的Paper主题和图标的截图。我使用了一张Material Design风格的墙纸,这样可以更好的匹配主题和图标。 + +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/02/Material_Design_Paper_Theme_Elementary_OS_Freya_1.jpeg) + +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/02/Material_Design_Paper_Theme_Elementary_OS_Freya.jpeg) + +How do you find this Material design inspired theme? If you did use it, do share the screenshot of your desktop with rest of us here. + +你觉得这个Material风格的主题怎么样?如果你使用它的话,在评论里和我们分享你的桌面截图吧! + +-------------------------------------------------------------------------------- + +via: http://itsfoss.com/install-paper-theme-linux/ + +作者:[Abhishek][a] +译者:[sevenot](https://github.com/sevenot) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://itsfoss.com/author/abhishek/ +[1]:http://snwh.org/paper/ +[2]:http://www.google.fr/design/spec/material-design/introduction.html +[3]:http://mokaproject.com/moka-icon-theme/ +[4]:http://itsfoss.com/best-icon-themes-ubuntu-1404/ +[5]:http://itsfoss.com/gnome-shell-themes-ubuntu-1404/ +[6]:https://github.com/snwh/paper-icon-theme +[7]:https://github.com/snwh/paper-gtk-theme +[8]:http://itsfoss.com/how-to-install-themes-in-ubuntu-13-10/ +[9]:http://itsfoss.com/install-switch-themes-gnome-shell/ +[10]:http://itsfoss.com/install-icon-linux-mint/ +[11]:http://itsfoss.com/install-themes-icons-elementary-os-freya/ +[12]:http://itsfoss.com/tag/elementary-os-freya/ diff --git a/translated/share/20150225 Install Google's Material Design Inspired GTK And Icon Theme Paper in Linux.md b/translated/share/20150225 Install Google's Material Design Inspired GTK And Icon Theme Paper in Linux.md deleted file mode 100644 index 4986ffadf8..0000000000 --- a/translated/share/20150225 Install Google's Material Design Inspired GTK And Icon Theme Paper in Linux.md +++ /dev/null @@ -1,83 +0,0 @@ -sevenot translated -Install Google’s Material Design Inspired GTK And Icon Theme Paper in Linux -来试试谷歌全新的设计语言Material Design和Linux下的图标主题Paper吧!灵感来源于图形工具包GTK。 -================================================================================ -![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/02/Paper_theme_Material_Design.jpg) - -[Paper][1] is a new upcoming GTK and icon theme inspired by Google’s [Material design][2] guidelines. It is developed by Sam Hewitt, the man behind [Moka Project][3]. Moka has always been in the list of [best themes for Ubuntu][4] and looking at Paper, I can say that once it is developed completely, it will surely be listed as one of the [best GTK themes][5]. -Paper是一款即将与广大朋友们见面的一个图形工具包和图标主题,它的设计灵感来自于谷歌的设计语言Material design。Paper由Sam Hewitt发起,Sam是Moka项目的一员,Moka总会设计出让人满意的Ubuntu主题。对于Paper,我敢说只要它一经推出,它必将是最好的主题开发包之一。 - -Yes, you heard it right. The theme is still under development. Therefore I suggest that if you want to install Paper theme in Ubuntu or any other Linux distributions, do it only for experimentation purpose. You may see some broken icons here and there but the over all experience is nice. -对的,你没有听错,Paper主题还在开发阶段。因此我建议,如果你想在你的Ubuntu或者它的衍生版本上安装Paper,最好抱着试一试的实验心态。因为你多多少少会发现一些破损的图标,但这并不影响整个实验的运行。 - -### Install Paper theme in Ubuntu based distributions via PPA ### -通过PPA在Ubuntu及其衍生版本上安装Paper主题 -Sam has a dedicated PPA for Ubuntu based distributions. I recommend that you use this PPA instead of downloading the theme because you’ll be getting the updates on the themes regularly. This PPA is available for Ubuntu 15.04, Ubuntu 14.10, Ubuntu 14.04, Elementary OS Freya, Elementary OS Luna, Linux Mint 17, Linux Mint 16 and other Linux distributions based on Ubuntu. -Sam为Ubuntu和它的衍生版本设置了一个专用的PPA(PresonalPackgeArchives,个人软件包档案)。我会介绍通过PPA安装而不是下载Paper主题,因为你将会定期更新主题。这个PPA可供使用的系统有Ubuntu 15.04, Ubuntu 14.10, Ubuntu 14.04, Elementary OS Freya, Elementary OS Luna, Linux Mint 17, Linux Mint 16 和其它的Ubuntu衍生版本。 - -Open a terminal and use the following commands: -打开终端,输入下列命令: - sudo add-apt-repository ppa:snwh/pulp - sudo apt-get update - sudo apt-get install paper-gtk-theme paper-icon-theme - -### Download Paper GTK and icon theme ### -下载Paper图形工具包和图标主题 - -If you do not want to use the PPA, you can download the themes and icons manually. As I said previously, you won’t get the updates automatically this way. -如果你不想用PPA,你可以手动下载主题和图标。但是就像刚才所说,这样你就无法自动更新。 - -- [Download Paper icon themes][6] -- [Download Paper GTK themes][7] -下载Paper图标主题 -下载Paper的GTK工具包 -#### Using Paper themes and icons #### -把它们用起来吧 -I hope that you know how to change or install themes in your respective Linux distributions. If you are not unaware of it, below are few tutorials that could help you to install new themes: -我希望你知道怎么在你的Ubuntu中安装或者更改主题。如果你不知道,下面几个教程将帮助你安装一个新的主题。 -- [How to change themes in Ubuntu Unity][8] -- [How to change themes in GNOME Shell][9] -- [How to change themes in Linux Mint][10] -- [How to change theme in Elementary OS Freya][11] -如何在标准Ubuntu中更改主题 -如何在GNOME桌面的Ubuntu中更改主题 -如何在Ubuntu Mint中更改主题 -如何在Elementary OS Freya中更改主题 - -#### Here is what Paper theme looks like #### -就是这样! - -Since I am using [Elementary OS Freya][12] these days, here are some of the screenshots of how Paper theme and icons look like in Elementary OS Freya. I have used a wallpaper with Material design look so that it blends well with the icon and themes. -自从我开始用Elementary OS Freya以来,这里就存有一些Paper主题和图标的截图。我用了Material Design做了一个桌面,这样可以更好的兼容主题和图标。 - -![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/02/Material_Design_Paper_Theme_Elementary_OS_Freya_1.jpeg) - -![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/02/Material_Design_Paper_Theme_Elementary_OS_Freya.jpeg) - -How do you find this Material design inspired theme? If you did use it, do share the screenshot of your desktop with rest of us here. -你的Material design 设计灵感是什么呢?如果你在使用Material design ,在评论里和我们分享你的桌面截图吧! - - --------------------------------------------------------------------------------- - -via: http://itsfoss.com/install-paper-theme-linux/ - -作者:[Abhishek][a] -译者:[sevenot](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://itsfoss.com/author/abhishek/ -[1]:http://snwh.org/paper/ -[2]:http://www.google.fr/design/spec/material-design/introduction.html -[3]:http://mokaproject.com/moka-icon-theme/ -[4]:http://itsfoss.com/best-icon-themes-ubuntu-1404/ -[5]:http://itsfoss.com/gnome-shell-themes-ubuntu-1404/ -[6]:https://github.com/snwh/paper-icon-theme -[7]:https://github.com/snwh/paper-gtk-theme -[8]:http://itsfoss.com/how-to-install-themes-in-ubuntu-13-10/ -[9]:http://itsfoss.com/install-switch-themes-gnome-shell/ -[10]:http://itsfoss.com/install-icon-linux-mint/ -[11]:http://itsfoss.com/install-themes-icons-elementary-os-freya/ -[12]:http://itsfoss.com/tag/elementary-os-freya/ From 290c490c69946a92d613503f66d853e412093bd8 Mon Sep 17 00:00:00 2001 From: wxy Date: Mon, 1 Jun 2015 10:06:44 +0800 Subject: [PATCH 226/965] PUB:20150521 Will Ubuntu Linux Hit 200 Million Users This Year MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @wwy-hust 做好事不留名~~ --- ...u Linux Hit 200 Million Users This Year.md | 38 +++++++++++++++++++ ...u Linux Hit 200 Million Users This Year.md | 38 ------------------- 2 files changed, 38 insertions(+), 38 deletions(-) create mode 100644 published/20150521 Will Ubuntu Linux Hit 200 Million Users This Year.md delete mode 100644 translated/talk/20150521 Will Ubuntu Linux Hit 200 Million Users This Year.md diff --git a/published/20150521 Will Ubuntu Linux Hit 200 Million Users This Year.md b/published/20150521 Will Ubuntu Linux Hit 200 Million Users This Year.md new file mode 100644 index 0000000000..e06a6e98bb --- /dev/null +++ b/published/20150521 Will Ubuntu Linux Hit 200 Million Users This Year.md @@ -0,0 +1,38 @@ +Ubuntu会在今年达到2亿用户么? +================================================================================ +距离Mark Shuttleworth表达他的目标“在4年内Ubuntu的用户达到2亿”已经过去了四年零两周。尽管Ubuntu的用户数量在过去的四年中一直在上升,但这个目标目前并未实现,并且看起来不会在今年年底实现。 + +那是2011年5月在[UDS 布达佩斯][1],Shuttleworth表示Ubuntu将在4年内达到2亿用户。 + +![](http://www.phoronix.net/image.php?id=uds_budapest&image=budapest_phoronix_03_show&w=1920) + +上一次我听到Ubuntu有“1千万”用户,但是并没有任何可靠的报道表明Ubuntu的用户数接近2亿。来自Valve最近的统计表明相比于Windows和OS X的用户[使用Linux的游戏用户的比重少于1%][2]。大多数基于Web计量和其他统计方式的数据倾向于表明Linux的用户总数只占很少的部分。 + +撇开桌面版不谈,Ubuntu在过去的四年来至少在云和服务器部署方面得到了大量的占有率,并且被证明是Red Hat Enterprise的有力竞争者。Ubuntu还证明了它对基于ARM的硬件十分友好。当Mark在四年前提出他的目标时,他可能考虑到Ubuntu Phone/Touch会比目前的状况更好。可是Ubuntu Phone/Touch目前仅仅在欧洲和[中国][3]可用,并且[Ubuntu Touch软件依旧在成熟的路上][4],[仍需要大量的关键应用程序方面的工作][5]等。 + +![](http://www.phoronix.net/image.php?id=0x2015&image=shuttleworth_200_million_show&w=1920) + +距离Canonical宣布[Ubuntu不久将登陆5%的PC][6]也已过去了3年。5%的目标是全球的PC装机量,但哪怕再过3年,我依旧很难相信这个目标会实现。至少在美国和欧洲,我仍难以在实体店看到Ubuntu作为预装的系统,主要的网络零售商/OEM厂商仍倾向于在特定的PC型号中提供Linux,比如Chrome OS、Android设备。 + +另一个由开源社区提出的高傲地、落空的目标便是[GNOME将在2010年占有全球桌面市场10%的份额][7]。五年了,没有任何迹象表明他们接近了那10%的里程碑。 + +在今天,您认为Ubuntu用户有多少呢?在未来的几年里,Ubuntu(或者Linux)的用户会有多大增长呢?通过评论来与我们分享您的想法吧。 + +-------------------------------------------------------------------------------- + +via: http://www.phoronix.com/scan.php?page=news_item&px=2015-200-Million-Goal-Retro + +作者:[Michael Larabel][a] +译者:[wwy-hust](https://github.com/wwy-hust) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.michaellarabel.com/ +[1]:http://www.phoronix.com/vr.php?view=16002 +[2]:http://www.phoronix.com/scan.php?page=news_item&px=Steam-April-2015-1-Drop +[3]:http://www.phoronix.com/scan.php?page=news_item&px=Ubuntu-MX4-In-China +[4]:http://www.phoronix.com/scan.php?page=news_item&px=Ubuntu-Calculator-Reboot +[5]:http://www.phoronix.com/scan.php?page=news_item&px=MTgzOTM +[6]:http://www.phoronix.com/scan.php?page=news_item&px=MTA5ODM +[7]:https://www.phoronix.com/scan.php?page=news_item&px=Nzg1Mw \ No newline at end of file diff --git a/translated/talk/20150521 Will Ubuntu Linux Hit 200 Million Users This Year.md b/translated/talk/20150521 Will Ubuntu Linux Hit 200 Million Users This Year.md deleted file mode 100644 index 45c572b1bb..0000000000 --- a/translated/talk/20150521 Will Ubuntu Linux Hit 200 Million Users This Year.md +++ /dev/null @@ -1,38 +0,0 @@ -Ubuntuڽﵽ2ûô -================================================================================ -Mark ShuttleworthĿꡰ4Ubuntuûﵽ2ڡѾȥܡUbuntuûڹȥһֱĿĿǰδʵ֣ҿڽʵ֡ - -20115[UDS ˹][1]ShuttleworthʾUbuntu4ڴﵽ2û - -![](http://www.phoronix.net/image.php?id=uds_budapest&image=budapest_phoronix_03_show&w=1920) - -һUbuntuС1ǧûDzûκοɿıUbuntuûӽ2ڡValveͳƱWindowsOS Xû[ʹLinuxϷûı1%][2]WebͳƷʽڱLinuxûֻռٵIJ֡ - -Ʋ治̸Ubuntuڹȥƺͷõ˴ռʣұ֤Red Hat EnterpriseߡUbuntu֤ԻARMӲʮѺáMarkǰĿʱܿǵUbuntu Phone/TouchĿǰ״áUbuntu Phone/TouchĿǰŷ޺[й][3]ã[Ubuntu Touchڳ·][4][ҪĹؼӦóĹ][5]ȡ - -![](http://www.phoronix.net/image.php?id=0x2015&image=shuttleworth_200_million_show&w=1920) - -Canonical[Ubuntuý½5%PC][6]Ҳѹȥ3ꡣ5%ĿȫPCװٹ3꣬ɺĿʵ֡ŷޣʵ꿴UbuntuΪԤװϵͳҪ/OEMضPCͺṩLinuxChrome OSAndroid豸 - -һɿԴĸ߰ءյĿ[GNOME2010ռȫг10%ķݶ][7]ǰûκμǽӽ10%̱ - -ڽ죬ΪUbuntuûжأδļUbuntuLinuxûжأͨǷ뷨ɡ - --------------------------------------------------------------------------------- - -via: http://www.phoronix.com/scan.php?page=news_item&px=2015-200-Million-Goal-Retro - -ߣ[Michael Larabel][a] -ߣ[ID](https://github.com/ID) -Уԣ[УID](https://github.com/УID) - - [LCTT](https://github.com/LCTT/TranslateProject) ԭ룬[Linuxй](https://linux.cn/) Ƴ - -[a]:http://www.michaellarabel.com/ -[1]:http://www.phoronix.com/vr.php?view=16002 -[2]:http://www.phoronix.com/scan.php?page=news_item&px=Steam-April-2015-1-Drop -[3]:http://www.phoronix.com/scan.php?page=news_item&px=Ubuntu-MX4-In-China -[4]:http://www.phoronix.com/scan.php?page=news_item&px=Ubuntu-Calculator-Reboot -[5]:http://www.phoronix.com/scan.php?page=news_item&px=MTgzOTM -[6]:http://www.phoronix.com/scan.php?page=news_item&px=MTA5ODM -[7]:https://www.phoronix.com/scan.php?page=news_item&px=Nzg1Mw \ No newline at end of file From 7aa580a4066131acdd78076ccc7687ac2917798f Mon Sep 17 00:00:00 2001 From: GOLinux Date: Mon, 1 Jun 2015 12:53:34 +0800 Subject: [PATCH 227/965] [Translated]20150528 Things To Do After Installing Fedora 22.md --- ...Things To Do After Installing Fedora 22.md | 115 ------------------ ...Things To Do After Installing Fedora 22.md | 113 +++++++++++++++++ 2 files changed, 113 insertions(+), 115 deletions(-) delete mode 100644 sources/tech/20150528 Things To Do After Installing Fedora 22.md create mode 100644 translated/tech/20150528 Things To Do After Installing Fedora 22.md diff --git a/sources/tech/20150528 Things To Do After Installing Fedora 22.md b/sources/tech/20150528 Things To Do After Installing Fedora 22.md deleted file mode 100644 index 023869a9f3..0000000000 --- a/sources/tech/20150528 Things To Do After Installing Fedora 22.md +++ /dev/null @@ -1,115 +0,0 @@ -Translating by GOLinux! -Things To Do After Installing Fedora 22 -================================================================================ -Fedora 22 the latest entrant in the community developed line of Red hat operating systems is released on the 26th of May 2015. A lot of speculation and anticipation has been associated with this release of the venerable fedora. Well there are some major changes that are being proposed for Fedora 22. - -Systemd is the new kid in the block when it comes to initialization daemons, it is poised to replace the venerable sysvinit module that has long been a part of the Linux ecosystem. Another major change that users will come across in the base python version. Its just that python in available in two different flavors the 2.x and 3.x lines. Each has its fair share of quirks and benefits. So users who might prefer the 2.x flavor might want to install their favorite python. The dandified Yum installer that has been around since Fedora 18 is all set to replace the age old YUM installer. Fedora has finally decided that it is time that DNF replace YUM. - -### 1) Install VLC media player ### - -Fedora 22 comes with a default media player viz. gnome videos (previously known as totem). If that is fine by you we can skip this step and move ahead. However if you like me prefer the most widely used VLC you can go ahead and install it from the RPMFusion repos. You can do that with : - - sudo dnf install vlc -y - -### 2) Configure RPMFusion Repos ### - -As I already mentioned Fedora is very strict with its ideologies, it does not ship with any non-free components with it. The official repositories does not provide some essential software containing non-free components like multimedia codes. So it is necessary to install some 3rd party repositories which will provide us some essential software. Luckily RPMFusion repositories come to the rescue. - - $ sudo dnf install --nogpgcheck http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-22.noarch.rpm - -### 3) Install Multimedia Codecs ### - -As is said some multimedia codecs and plugins don't ship with fedora. Now who would like to miss out on their favorite shows and movies just because the codes are proprietary. Try this: - - $ sudo dnf install gstreamer-plugins-bad gstreamer-plugins-bad-free-extras gstreamer-plugins-ugly gstreamer-ffmpeg gstreamer1-libav gstreamer1-plugins-bad-free-extras gstreamer1-plugins-bad-freeworld gstreamer-plugins-base-tools gstreamer1-plugins-good-extras gstreamer1-plugins-ugly gstreamer1-plugins-bad-free gstreamer1-plugins-good gstreamer1-plugins-base gstreamer1 - -### 4) Update your system ### - -Fedora is a bleeding edge distribution and hence it releases updates which will fix bugs and loopholes present in your system continuously. Hence it is a good practice to keep your system up to date. - - $ sudo dnf update -y - -### 5) Uninstall software you may not need ### - -Fedora comes with a set of pre-chosen packages that most users can utilize, however for more advanced users, you may recognize that you do not need all of it. It's easy enough to remove any packages you don't need using the following command - I chose to uninstall rhythmbox because I know I won't use it: - - $ sudo dnf remove rhythmbox - -### 6) Install Adobe Flash ### - -We all wish Adobe Flash didn't exist anymore since it is not always know for being the most secure or resource efficient, but for awhile it's here to stay. The only way to install Adobe Flash for Fedora 22 is to install the official RPM from Adobe, as shown below. - -You can download the RPM [here][1]. After downloading the file, you can right click and open it like this: - -![Install Adobe Flash](http://blog.linoxide.com/wp-content/uploads/2015/05/Screen-Shot-2015-05-27-at-9.50.42-PM.png) - -Right click and select "Open With Software Install" - -Then, simply click install on the window that pops up: - -![Install Adobe](http://blog.linoxide.com/wp-content/uploads/2015/05/Screen-Shot-2015-05-27-at-9.51.07-PM.png) - -Click on "Install" to complete the process of installing the custom RPM from Adobe - -Once the process completes, the "Install" button will change to "Remove" and the installation should have finished. If your browser is open during the process, it may ask you to close it first or restart it after the install for the changes to take effect. - -### 7) Spin Up a VM with Gnome Boxes ### - -So you just installed Fedora and you're loving it, but maybe you need Windows still for something proprietary, or maybe you just want to play with another Linux distro. In any situation, you can use Gnome Boxes, provided with Fedora 22, to easily create a VM or use a live distribution. Follow the steps below to get started using an ISO of your choice! Who knows, maybe you can even check out a [Fedora Spin][2]. - -First open Gnome Boxes and select "New" in the top left: - -![Add a new virtual machine (box)](http://blog.linoxide.com/wp-content/uploads/2015/05/Screen-Shot-2015-05-27-at-10.24.46-PM.png) - -Click "New" to start the process of adding a new virtual machine. - -Next, click to open a file and choose an ISO: - -![Choose ISO](http://blog.linoxide.com/wp-content/uploads/2015/05/Screen-Shot-2015-05-27-at-10.28.44-PM.png) - -After choosing to select a file or ISO, select your ISO. In this case, I had a Debian ISO I installed - -Finally, customize the VM settings or use the defaults and click "Create." The VM will start by default and the available VMs will be available in Gnome Boxes as little thumbnails. - -![Create VM](http://blog.linoxide.com/wp-content/uploads/2015/05/Screen-Shot-2015-05-27-at-10.31.11-PM.png) - -Customize the settings to whatever you choose, or keep the defaults. Click "Create" when you are done and the VM will be ready to go. - -### 8) Install Google Chrome ### - -Firefox is included with Fedora 22, but as with most software, everyone has their browser of choice. If yours happens to be Google Chrome, you can follow the instructions above for Adobe Flash player, however, obviously use the RPM from Google for whichever version of Chrome you download. The latest version can usually be found [here][3]. - -### 9) Add Social Media and Other Online Accounts ### - -Gnome has some nice built in functionality to accommodate accounts for things like Facebook, Google, and other online accounts. You can access the Online Accounts settings through the main Gnome Settings application. You can access the settings by right clicking on the desktop or by finding it in the applications. Then, simply click on Online Accounts and add the accounts of your choosing. If you add an account like Google, for example, you can use it as the default for things like sending email, calendar appointments, interacting with photos and documents, and more. - -### 10) Install KDE or another Desktop Environment ### - -Some of us just don't like Gnome, and that's okay. Run the following command in Terminal to install everything necessary to use KDE instead. The same instructions can be applied to xfce, lxde, or other desktop environments as well. - - $ sudo dnf install @kde-desktop - -After the install finishes, log out. When you click on your username, notice the little gear wheel that indicates settings. Click it and select "Plasma." When you log in again, you will be greeted by a fresh KDE desktop. - -![Plasma on Fedora 22](http://blog.linoxide.com/wp-content/uploads/2015/05/Screen-Shot-2015-05-27-at-11.32.27-PM.png) - -The Plasma environment after just installing it on Fedora 22 - -### Conclusion ### - -That’s it you are all set to go. Use the system and try out things. If you don't find something according to your liking, linux gives you the freedom to change them. Fedora comes with the latest Gnome shell as its desktop environment, too heavy for you and don't like it. Try KDE or some light weight DE like cinnamon, xfce etc. Wish you a very happy and hassle free Fedora experience. !! - --------------------------------------------------------------------------------- - -via: http://linoxide.com/linux-how-to/things-do-after-installing-fedora-22/ - -作者:[Jonathan DeMasi][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://linoxide.com/author/jonathande/ -[1]:https://get.adobe.com/flashplayer/ -[2]:http://spins.fedoraproject.org/ -[3]:https://www.google.com/intl/en/chrome/browser/desktop/index.html diff --git a/translated/tech/20150528 Things To Do After Installing Fedora 22.md b/translated/tech/20150528 Things To Do After Installing Fedora 22.md new file mode 100644 index 0000000000..172c7612ae --- /dev/null +++ b/translated/tech/20150528 Things To Do After Installing Fedora 22.md @@ -0,0 +1,113 @@ +安装Fedora 22后要做的事 +================================================================================ +Fedora 22,Red Hat操作系统的社区开发版的最新成员,已经于2015年5月26日发布了。这个令人神圣的Fedora发行版充斥着各种炒作和预期,Fedora 22推出了大量的重大变化。 + +就初始化进程而言,Systemd还是个新生儿,但它已经准备好替换脆弱的sysvinit这个一直是Linux生态系统一部分的模块。另外一个用户会碰到的重大改变存在于基本仓库的python版本中,这里提供了两种不同口味的python版本2.x和3.x分线,各个都有其不同的癖好和优点。所以,那些偏好2.x口味的用户可能想要安装他们喜爱的python版本。自从Fedora 18开始被打扮得更加时髦的Yum安装器也被设置来替换过时陈旧的YUM安装器后。Fedora也已最后决定,现在是时候用DNF来替换YUM了。 +### 1) 安装VLC媒体播放器 ### + +Fedora 22默认自带了媒体播放器viz gnome视频播放器(前身是totem)。如果你对此不感冒,那么我们可以跳过这一步继续往前走。但是,如果你像我一样,偏好使用最广泛的VLC,那么就去从RPMFusion仓库安装吧。安装方法如下: + + sudo dnf install vlc -y + +### 2) 配置RPMFusion仓库 ### + +正如我已经提到过的,Fedora的意识形态很是严谨,它不会自带任何非自由组件。官方仓库不会提供一些包含有非自由组件的基本软件,比如像多媒体编码。因此,安装一些第三方仓库很有必要,这些仓库会为我们提供一些基本的软件。幸运的是,RPMFusion仓库前来拯救我们了。 + + $ sudo dnf install --nogpgcheck http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-22.noarch.rpm + +### 3) 安装多媒体编码 ### + +刚刚我们说过,一些多媒体编码和插件不会随Fedora一起发送。现在,有谁想仅仅是因为专有编码而错过他们最爱的节目和电影?试试这个吧: + + $ sudo dnf install gstreamer-plugins-bad gstreamer-plugins-bad-free-extras gstreamer-plugins-ugly gstreamer-ffmpeg gstreamer1-libav gstreamer1-plugins-bad-free-extras gstreamer1-plugins-bad-freeworld gstreamer-plugins-base-tools gstreamer1-plugins-good-extras gstreamer1-plugins-ugly gstreamer1-plugins-bad-free gstreamer1-plugins-good gstreamer1-plugins-base gstreamer1 + +### 4) 更新系统 ### + +Fedora是一个尖端的发行版,因此它会持续发布更新用以修复系统中出现的错误和漏洞。因而,保持系统更新到最新,是个不错的做法。 + + $ sudo dnf update -y + +### 5) 卸载你不需要的软件 ### + +Fedora预装了一些大多数用户可以利用的包,但是对于更高级的用户,你可能意识到你并不需要它。要移除你不需要的包相当容易,只需使用以下命令——我选择卸载rhythmbox,因为我知道我不会用到它: + + $ sudo dnf remove rhythmbox + +### 6) 安装Adobe Flash ### + +我们都希望Adobe Flash不要再存在了,因为它并不被认为是最安全的,或者资源利用最好的,但是暂时先让它待着吧。Fedora 22安装Adobe Flash的唯一途径是从Adobe安装官方RPM,就像下面这样。 + +你可以从[这里][1]下载RPM。下载完后,你可以直接右击并像下面这样打开: + +![Install Adobe Flash](http://blog.linoxide.com/wp-content/uploads/2015/05/Screen-Shot-2015-05-27-at-9.50.42-PM.png) + +右击并选择“用软件安装打开” + +然后,只需在弹出窗口中点击安装: + +![Install Adobe](http://blog.linoxide.com/wp-content/uploads/2015/05/Screen-Shot-2015-05-27-at-9.51.07-PM.png) + +点击“安装”来完成从Adobe安装自定义RPM的过程 + +该过程完成后,“安装”按钮会变成“移除”,而此时安装也完成了。如果在此过程中你的浏览器开着,会提示你先把它关掉或在安装完成后重启以使修改生效。 + +### 7) 用Gnome Boxes加速虚拟机 ### + +你刚刚安装了Fedora,你也很是喜欢,但是出于某些私人原因,你也许仍然需要Windows,或者你只是想玩玩另外一个Linux发行版。不管哪种情况,你都可以使用Gnome Boxes来简单地创建一个虚拟机或使用一个live发行版,Fedora 22提供了该软件。遵循以下步骤,使用你所选的ISO来开始吧!谁知道呢,也许你可以检验一下某个[Fedora Spin][2]。 + +首先,打开Gnome Boxes,然后在顶部左边选择“新建”: + +![Add a new virtual machine (box)](http://blog.linoxide.com/wp-content/uploads/2015/05/Screen-Shot-2015-05-27-at-10.24.46-PM.png) + +点击“新建”来开始添加一个新虚拟机的进程吧。 + +接下来,点击打开文件并选择一个ISO: + +![Choose ISO](http://blog.linoxide.com/wp-content/uploads/2015/05/Screen-Shot-2015-05-27-at-10.28.44-PM.png) + +在选择选择了选择文件或ISO后,选择你的ISO。这里,我已经安装了一个Debian ISO。 + +最后,自定义VM设置或使用默认,然后点击“创建”。VM会以默认方式启动,可用的VM会在Gnome Boxes以小缩略图的方式显示。 + +![Create VM](http://blog.linoxide.com/wp-content/uploads/2015/05/Screen-Shot-2015-05-27-at-10.31.11-PM.png) + +自定义设置为你所选择的,或者也可以保持默认。完成后,点击“创建”,VM就一切就绪了。 + +### 8) 安装Google Chrome ### + +Firefox被包含在Fedora 22中,但是就跟大多数软件一样,每个人都有他们自己的选择。如果你所喜爱的浏览器恰好是Google Chrome,你可以使用和上面安装Adobe Flash Player类似的指令。然而,很明显,你得使用来自Google的任何你所下载的版本的RPM。最新的版本通常可以在[这里][3]找到。 + +### 9) 添加社交媒体和其它在线帐号 ### + +Gnome自带有不错的内建功能用于容纳帐号相关的东西,像Facebook,Google以及其它在线帐号。你可以通过主Gnome设置应用访问在线帐号设置。然后,只需点击在线帐号,并添加你所选择的帐号。如果你要添加一个帐号,比如像Google,你可以用它来作为默认帐号,用来完成诸如发送邮件、日历提醒、相片和文档交互,以及诸如此类的更多事情。 + +### 10) 安装KDE或另一个桌面环境 ### + +我们中的某些人不喜欢Gnome,那也没问题。在终端中运行以下命令来安装KDE所需的一切来替换它。这些指令也可以用以安装xfce、lxde或其它桌面环境。 + + $ sudo dnf install @kde-desktop + +安装完成后,登出。当你点击你的用户名时,注意那个表示设置的小齿轮。点击它,然后选择“Plasma”。当你再次登录时,一个全新的KDE桌面就会欢迎你。 + +![Plasma on Fedora 22](http://blog.linoxide.com/wp-content/uploads/2015/05/Screen-Shot-2015-05-27-at-11.32.27-PM.png) + +刚刚安装到Fedora 22上的Plasma环境 + +### 尾声 ### + +就是这样了,一切就绪。使用新系统吧,试试新东西。如果你找不到与你喜好相关的东西,linux赋予你自由修改它的权利。Fedora自带有最新的Gnome Shell作为其桌面环境,如果你觉得太臃肿而不喜欢,那么试试KDE或一些轻量级的DE,像Cinnamon、xfce之类。愿你的Fedora之旅十分开心并且没有困扰。!! + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/linux-how-to/things-do-after-installing-fedora-22/ + +作者:[Jonathan DeMasi][a] +译者:[GOLinux](https://github.com/GOLinux) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://linoxide.com/author/jonathande/ +[1]:https://get.adobe.com/flashplayer/ +[2]:http://spins.fedoraproject.org/ +[3]:https://www.google.com/intl/en/chrome/browser/desktop/index.html From f251d0ee4f5ce34bfe630a94c77c9d0d7ff335bf Mon Sep 17 00:00:00 2001 From: DeadFire Date: Mon, 1 Jun 2015 16:09:12 +0800 Subject: [PATCH 228/965] =?UTF-8?q?20150601-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...nitor Linux servers with SNMP and Cacti.md | 181 ++++++++++++ ... to monitor common services with Nagios.md | 267 ++++++++++++++++++ 2 files changed, 448 insertions(+) create mode 100644 sources/tech/20150601 How to monitor Linux servers with SNMP and Cacti.md create mode 100644 sources/tech/20150601 How to monitor common services with Nagios.md diff --git a/sources/tech/20150601 How to monitor Linux servers with SNMP and Cacti.md b/sources/tech/20150601 How to monitor Linux servers with SNMP and Cacti.md new file mode 100644 index 0000000000..ab6c7f0f30 --- /dev/null +++ b/sources/tech/20150601 How to monitor Linux servers with SNMP and Cacti.md @@ -0,0 +1,181 @@ +How to monitor Linux servers with SNMP and Cacti +================================================================================ +SNMP (or Simple Network Management Protocol) is used to gather data on what is going on within a device, such as load, hard disk states, bandwidth. These data are used by network monitoring tools such as Cacti to generate graphs for monitoring purposes. + +In a typical deployment of Cacti and SNMP, there will be one or more SNMP-enabled devices, and a separate monitoring server where Cacti collects SNMP feeds from those devices. Please keep in mind that all the devices that need to be monitored must be SNMP enabled. In this tutorial, we will be configuring Cacti and SNMP on the same Linux server for demonstration purpose. + +### Configure SNMP on Debian or Ubuntu ### + +To install SNMP agent (snmpd) on a Debian-based system, run the following command. + + root@server:~# apt-get install snmpd + +Then edit its configuration like the following. + + root@server:~# vim /etc/snmp/snmpd.conf + +---------- + + # this will make snmpd listen on all interfaces + agentAddress udp:161 + + # a read only community 'myCommunity' and the source network is defined + rocommunity myCommunity 172.17.1.0/24 + + sysLocation Earth + sysContact email@domain.tld + +After editing the config file, restart snmpd. + + root@server:~# service snmpd restart + +### Configure SNMP on CentOS or RHEL ### + +To install SNMP tools and libraries, run the following command. + + root@server:~# sudo yum install net-snmp + +Then edit an SNMP config file like the following. + + root@server:~# vim /etc/snmp/snmpd.conf + +---------- + + # A user 'myUser' is being defined with the community string 'myCommunity' and source network 172.17.1.0/24 + com2sec myUser 172.17.1.0/24 myCommunity + + # myUser is added into the group 'myGroup' and the permission of the group is defined + group myGroup v1 myUser + group myGroup v2c myUser + view all included .1 + access myGroup "" any noauth exact all all none + +---------- + + root@server:~# service snmpd restart + root@server:~# chkconfig snmpd on + +Restart snmpd service, and add it to startup service list. + +### Testing SNMP ### + +SNMP can be tested by running the snmpwalk command. If SNMP has been successfully configured, this command will generate a ton of output. + + root@server:~# snmpwalk -c myCommunity 172.17.1.44 -v1 + +---------- + + iso.3.6.1.2.1.1.1.0 = STRING: "Linux mrtg 3.5.0-17-generic #28-Ubuntu SMP Tue Oct 9 19:31:23 UTC 2012 x86_64" + iso.3.6.1.2.1.1.2.0 = OID: iso.3.6.1.4.1.8072.3.2.10 + iso.3.6.1.2.1.1.3.0 = Timeticks: (2097) 0:00:20.97 + + ~~ OUTPUT TRUNCATED ~~ + + iso.3.6.1.2.1.92.1.1.2.0 = Gauge32: 1440 + iso.3.6.1.2.1.92.1.2.1.0 = Counter32: 1 + iso.3.6.1.2.1.92.1.2.2.0 = Counter32: 0 + iso.3.6.1.2.1.92.1.3.1.1.2.7.100.101.102.97.117.108.116.1 = Timeticks: (1) 0:00:00.01 + iso.3.6.1.2.1.92.1.3.1.1.3.7.100.101.102.97.117.108.116.1 = Hex-STRING: 07 DD 0B 12 00 39 27 00 2B 06 00 + +### Configure Cacti with SNMP ### + +In this tutorial, we are setting up both Cacti and SNMP on the same Linux server. So go ahead and [install Cacti][2] on your Linux server on which SNMP was just configured. + +After installation, Cacti web interface can be accessed using the link "http://172.17.1.44/cacti", of course, in your case, the IP address of your server. + +![](http://farm6.staticflickr.com/5512/10972747655_0298f6ce6c_z.jpg) + +![](http://farm6.staticflickr.com/5532/10972982543_67e15433b8_z.jpg) + +The paths during Cacti installation are usually correct. But they can be double checked if necessary. + +![](http://farm4.staticflickr.com/3764/10972920304_138670d3cf_z.jpg) + +During the first-time installation, the default username and password for Cacti are "admin" and "admin". You will be forced to change the password after first login. + +![](http://farm6.staticflickr.com/5542/10972747775_531fe445ef_o.png) + +### Add and Manage Devices to Cacti ### + +Cacti will poll devices based on SNMP string that was configured earlier. In this tutorial, we will add only the local server where SNMP is already enabled. + +To add devices, we login as admin and go to console in the Cacti admin panel. We click Console > Devices. + +![](http://farm8.staticflickr.com/7411/10972747855_b464972e56_z.jpg) + +There may already be a device named 'localhost'. We do not need it as we will create fresh graphs. We can delete this device from the list. We add a new device by using the 'add' button. + +![](http://farm8.staticflickr.com/7373/10972747895_977e0eccd6_z.jpg) + +Next, we set the device parameters. + +![](http://farm8.staticflickr.com/7400/10972747935_df03500de7_z.jpg) + +Now that the device has been added, we specify the graph templates that we want to create. This section can be found in the bottom section of the page. + +![](http://farm4.staticflickr.com/3773/10972747955_083101e6ab_z.jpg) + +And then we proceed to creating the graphs. + +![](http://farm4.staticflickr.com/3734/10972747985_fae6b78888.jpg) + +Here, we create graphs for load average, RAM and hard disk, processor. + +![](http://farm8.staticflickr.com/7374/10972920484_ed6b33b8b8_z.jpg) + +### Interface Graphs and 64-bit Counters ### + +By default, Cacti uses 32-bit counters in SNMP queries. 32-bit counters are sufficient for most bandwidth graphs, but they do not work correctly for graphs greater than 100 Mbps. If it is known that the bandwidth will exceed more than 100 Mbps, it is always advisable to use 64-bit counters. Using 64-bit counters is not hard at all. + +![](http://farm8.staticflickr.com/7320/10972982813_120fe1f3d0_z.jpg) + +**Note**: It takes around 15 minutes for Cacti to populate new graphs. There are not alternatives to being patient. + +### Creating Graph Trees ### + +These snapshots illustrate how to create graph trees and how to add graph to those trees. + +![](http://farm8.staticflickr.com/7429/10972748045_ca06bec889_z.jpg) + +![](http://farm3.staticflickr.com/2833/10972920584_f33624862a_z.jpg) + +![](http://farm6.staticflickr.com/5548/10972836666_f31e4de0e7_z.jpg) + +![](http://farm4.staticflickr.com/3786/10972836776_1675611740_z.jpg) + +We can verify the graph in the graph tree. + +![](http://farm4.staticflickr.com/3707/10972836836_3dabe56765_z.jpg) + +### User Management ### + +Finally, we create a user with view permission to only the graph that we have created. Cacti has built in user management system, and it is highly customizable. + +![](http://farm8.staticflickr.com/7313/10972920624_61e13157f9_z.jpg) + +![](http://farm6.staticflickr.com/5536/10972920644_59a9797685_z.jpg) + +![](http://farm3.staticflickr.com/2872/10972920744_24f75fb5a8_z.jpg) + +After completing these steps, we can log in with the user 'user1' and verify that only this user is able to view the graph. + +![](http://farm8.staticflickr.com/7423/10972748265_c2608b3683_z.jpg) + +![](http://farm4.staticflickr.com/3763/10972748335_9cd012c6fe_z.jpg) + +And thus we have deployed a Cacti server in the network monitoring system. Cacti servers are stable, and can deal with tons of graphs without any problems. + +Hope this helps. + +-------------------------------------------------------------------------------- + +via: http://xmodulo.com/monitor-linux-servers-snmp-cacti.html + +作者:[Sarmed Rahman][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://xmodulo.com/author/sarmed +[1]:http://xmodulo.com/install-configure-cacti-linux.html \ No newline at end of file diff --git a/sources/tech/20150601 How to monitor common services with Nagios.md b/sources/tech/20150601 How to monitor common services with Nagios.md new file mode 100644 index 0000000000..95b0984adb --- /dev/null +++ b/sources/tech/20150601 How to monitor common services with Nagios.md @@ -0,0 +1,267 @@ +How to monitor common services with Nagios +================================================================================ +Nagios comes with a wide range of built-in scripts for monitoring services. This tutorial will cover the process of using some of these scripts for checking common services, such as MySQL, Apache web server, DNS, etc. + +To keep the article focused on service monitoring, we will not be configuring hostgroups or templates, as they have been covered in a [previous tutorial][1]. Nonetheless, they can be tuned to match the requirements. + +### Running Nagios Check in CLI ### + +It is generally recommended to run the Nagios service check scripts in CLI before adding them to Nagios. This will give an idea on whether the execution will be successful and what the output of the script will look like. + +All of the scripts are located at /etc/nagios-plugins/config/ with the executable files stored at /usr/lib/nagios/plugins/ + +Here is how it is done. + + root@nagios:~# cd /etc/nagios-plugins/config/ + +The provided scripts contain help on the syntax. The example contains partial output. + + root@nagios:~# cat /etc/nagios-plugins/config/tcp_udp.cfg + +---------- + + # 'check_tcp' command definition + define command{ + command_name check_tcp + command_line /usr/lib/nagios/plugins/check_tcp -H '$HOSTADDRESS$' -p '$ARG1$' + +Now that the syntax is available, TCP port 80 can be checked as follows. + + root@nagios:~# /usr/lib/nagios/plugins/check_tcp -H 10.10.10.1 -p 80 + +---------- + + TCP OK - 0.000 second response time on port 80|time=0.000222s;;;0.000000;10.000000 + +### Example Topology ### + +In this tutorial, the following three servers are being used. Each server runs one or more common services. The Nagios server is running on Ubuntu. + +- Server 1 (10.10.10.1) : MySQL, Apache2 +- Server 2 (10.10.10.2) : Postfix, Apache2 +- Server 3 (10.10.10.3): DNS + +First, the servers are defined in Nagios. + + root@nagios:~# vim /etc/nagios3/conf.d/example.cfg + +---------- + + define host{ + use generic-host + host_name test-server-1 + alias test-server-1 + address 10.10.10.1 + } + + define host{ + use generic-host + host_name test-server-2 + alias test-server-2 + address 10.10.10.2 + } + + define host{ + use generic-host + host_name test-server-3 + alias test-server-3 + address 10.10.10.3 + } + +### Monitor MySQL Service ### + +#### MySQL Monitoring Requirements #### + +- Monitor whether MySQL is running by checking port 3306. +- Monitor the availability of certain database 'testDB'. + +#### MySQL Server Setting #### + +When it comes to checking MySQL, it should be kept in mind that MySQL, by default, listens on only the loopback interface 127.0.0.1. This increases the security of the database. Manual tuning is needed to tell MySQL to listen on other interfaces as well. Here is how it can be done. + +This setting is done on all MySQL servers. + + root@nagios:~# vim /etc/mysql/my.cnf + +The following line is commented out to make MySQL listens on all interfaces. + + #bind-address = 127.0.0.1 + +Also, MySQL would not let just any host to connect to it. A user 'nagios' is created for both localhost and for 'any' host. This user is then granted all permission to all databases and will be used for monitoring. + +The following settings are done for all MySQL servers. + + root@nagios:~# mysql -u root –p + ## MySQL root password here ## + +A user 'nagios@localhost' is created in MySQL server. + + mysql> CREATE USER 'nagios'@'localhost' IDENTIFIED BY 'nagios-pass'; + mysql> GRANT ALL PRIVILEGES ON *.* TO 'nagios'@'localhost'; + +A user 'nagios@any-host' is created. + + mysql> CREATE USER 'nagios'@'%' IDENTIFIED BY 'nagios-pass'; + mysql> GRANT ALL PRIVILEGES ON *.* TO 'nagios'@'%'; + + mysql> FLUSH PRIVILEGES; + +This should enable MySQL to listen on all interfaces, as well as accept incoming connections from user 'nagios' at any host. + +Note that there are possible security implications of this change, so it's worth mentioning a few words: + +- This setting will expose MySQL to all available interfaces, including WAN. It is vital to make sure only legitimate networks have access to the database. Filters such as firewall and TCP wrappers should be used. +- The MySQL 'nagios' user password should be very strong. If there are few Nagios servers, then MySQL user 'nagios@servername' should be created instead of 'nagios@%' i.e., any host. + +#### Nagios Configuration for MySQL #### + +The following tuning should do the trick. + + root@nagios:~# vim /etc/nagios3/conf.d/services_nagios2.cfg + +---------- + + define service{ + use generic-service + host_name test-server-1 + ;hostgroup can be used instead as well + + service_description Check MYSQL via TCP port + check_command check_tcp!3306 + } + + define service{ + use generic-service + host_name test-server-1 + ;hostgroup can be used instead as well + + service_description Check availability of database 'testDB' + check_command check_mysql_database!nagios!nagios-pass!testDB + ;check_mysql!userName!userPassword!databaseName + } + +This way, Nagios can help monitor the accessibility of both MySQL servers and the database stored within the servers. + +### Monitor Apache Web Server ### + +Nagios can be used to monitor Apache web server as well. + +#### Apache Monitoring Requirements #### + +- Monitor whether the apache server is available. + +This task is really easy as Nagios has a built-in command for this. + + root@nagios:~# vim /etc/nagios3/conf.d/services_nagios2.cfg + +---------- + + define service{ + use generic-service + host_name test-server-1, test-server-2 + service_description Check Apache Web Server + check_command check_http + } + +Now that was really simple. + +### Monitor DNS Service ### + +Nagios can monitor DNS service by asking the DNS server to either resolve a specific fully qualified domain name (FQDN), or by asking the server to use the dig tool. The default FQDN used for testing is www.google.com, but it can be changed as needed. The following file can be modified to do the job. + + root@nagios:~# vim /etc/nagios-plugins/config/dns.cfg + +---------- + + ## The -H portion can be modified to replace Google ## + define command{ + command_name check_dns + command_line /usr/lib/nagios/plugins/check_dns -H www.google.com -s '$HOSTADDRESS$' + } + +Then edit the following file. + + root@nagios:~# vim /etc/nagios3/conf.d/services_nagios2.cfg + +---------- + + ## Nagios asks server-3 to resolve the IP for google.com ## + define service{ + use generic-service + host_name test-server-3 + service_description Check DNS + check_command check_dns + } + + ## Nagios asks server-3 to dig google.com ## + define service{ + use generic-service + host_name test-server-3 + service_description Check DNS via dig + check_command check_dig!www.google.com + } + +### Monitor Mail Server ### + +Nagios can monitor different mail server components like SMTP, POP, IMAP and mailq. As mentioned earlier, server-2 has postfix mail server set up on it. Nagios will be configured to monitor SMTP and mail queue of the server. + + root@nagios:~# vim /etc/nagios3/conf.d/services_nagios2.cfg + +---------- + + define service{ + use generic-service + host_name test-server-2 + service_description Check SMTP + check_command check_smtp + } + + define service{ + use generic-service + host_name test-server-2 + service_description Check Mail Queue + check_command check_mailq_postfix!50!100 + ;warning at 50, critical at 100 + } + +The following screenshot shows a complete overview of all the service checks that have been configured so far. + +![](http://farm8.staticflickr.com/7333/11428095956_2868bbdfcc_z.jpg) + +### Port Based Monitoring for Custom Applications ### + +Let us assume that the following custom application is also running in the network, listening on a particular port. + +- Test Server 1: custom application (TCP Port 12345) + +With a little tweaking, Nagios can help monitor this application port as well. + + root@nagios:~# vim /etc/nagios3/conf.d/services_nagios2.cfg + +---------- + + define service{ + use generic-service + host_name test-server-1 + service_description Check server 1 custom application + check_command check_tcp!12345 + } + +On a finishing note, Nagios can monitor many other sectors of a network. The scripts stored in /etc/nagios-plugins/config/ can shed some light on the awesome capabilities of Nagios. + +Some of the scripts provided with Nagios are restricted to the local server only. Examples include server load, number of concurrent processes, number of logged in users. These checks can provide useful insight on what is going on within the Nagios server. + +Hope this helps. + +-------------------------------------------------------------------------------- + +via: http://xmodulo.com/monitor-common-services-nagios.html + +作者:[Sarmed Rahman][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://xmodulo.com/author/sarmed +[1]:http://xmodulo.com/install-configure-nagios-linux.html \ No newline at end of file From d0b4c00bcf19407c00311a5b18d61cdc966dd93d Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 1 Jun 2015 20:44:34 +0800 Subject: [PATCH 229/965] translating --- .../tech/20150601 How to monitor common services with Nagios.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20150601 How to monitor common services with Nagios.md b/sources/tech/20150601 How to monitor common services with Nagios.md index 95b0984adb..4d6eda7719 100644 --- a/sources/tech/20150601 How to monitor common services with Nagios.md +++ b/sources/tech/20150601 How to monitor common services with Nagios.md @@ -1,3 +1,5 @@ +translating----geekpi + How to monitor common services with Nagios ================================================================================ Nagios comes with a wide range of built-in scripts for monitoring services. This tutorial will cover the process of using some of these scripts for checking common services, such as MySQL, Apache web server, DNS, etc. From 07975c3b218b8db7d94329d27104283b12c6ba5b Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 1 Jun 2015 21:44:54 +0800 Subject: [PATCH 230/965] translating --- ... to monitor common services with Nagios.md | 106 +++++++++--------- 1 file changed, 53 insertions(+), 53 deletions(-) rename {sources => translated}/tech/20150601 How to monitor common services with Nagios.md (51%) diff --git a/sources/tech/20150601 How to monitor common services with Nagios.md b/translated/tech/20150601 How to monitor common services with Nagios.md similarity index 51% rename from sources/tech/20150601 How to monitor common services with Nagios.md rename to translated/tech/20150601 How to monitor common services with Nagios.md index 4d6eda7719..2898a57ad0 100644 --- a/sources/tech/20150601 How to monitor common services with Nagios.md +++ b/translated/tech/20150601 How to monitor common services with Nagios.md @@ -1,22 +1,20 @@ -translating----geekpi - -How to monitor common services with Nagios +如何用Nagios监控服务 ================================================================================ -Nagios comes with a wide range of built-in scripts for monitoring services. This tutorial will cover the process of using some of these scripts for checking common services, such as MySQL, Apache web server, DNS, etc. +Nagios内置了很多脚本来监控服务。本篇会使用其中一些来检查通用服务如MySql、Apache、DNS等等。 -To keep the article focused on service monitoring, we will not be configuring hostgroups or templates, as they have been covered in a [previous tutorial][1]. Nonetheless, they can be tuned to match the requirements. +为了保证本篇集中在系统监控,我们不会配置hostgroup或者模板,它们已经在 [前面的教程][1]中覆盖了,它们可以满足这些条件了。 -### Running Nagios Check in CLI ### +### 在命令行中运行Nagios ### -It is generally recommended to run the Nagios service check scripts in CLI before adding them to Nagios. This will give an idea on whether the execution will be successful and what the output of the script will look like. +通常建议在添加到Nagios前现在命令行中运行Nagios服务检测脚本。它会给出执行是否成功以及脚本的输出将会看上去的样子。 -All of the scripts are located at /etc/nagios-plugins/config/ with the executable files stored at /usr/lib/nagios/plugins/ +这些脚本存储在 /etc/nagios-plugins/config/ ,可执行文件在 /usr/lib/nagios/plugins/。 -Here is how it is done. +下面就是该怎么做 root@nagios:~# cd /etc/nagios-plugins/config/ -The provided scripts contain help on the syntax. The example contains partial output. +提供的脚本包含了语法帮助。示例包含了部分输出。 root@nagios:~# cat /etc/nagios-plugins/config/tcp_udp.cfg @@ -27,7 +25,7 @@ The provided scripts contain help on the syntax. The example contains partial ou command_name check_tcp command_line /usr/lib/nagios/plugins/check_tcp -H '$HOSTADDRESS$' -p '$ARG1$' -Now that the syntax is available, TCP port 80 can be checked as follows. +了解了语法,TCP 80端口可以用下面的方法检查。 root@nagios:~# /usr/lib/nagios/plugins/check_tcp -H 10.10.10.1 -p 80 @@ -35,15 +33,15 @@ Now that the syntax is available, TCP port 80 can be checked as follows. TCP OK - 0.000 second response time on port 80|time=0.000222s;;;0.000000;10.000000 -### Example Topology ### +### 示例拓扑 ### -In this tutorial, the following three servers are being used. Each server runs one or more common services. The Nagios server is running on Ubuntu. +本片中使用下面三台服务器。每台服务器运行多个通用服务。Nagios服务器现在运行的是Ubuntu。 - Server 1 (10.10.10.1) : MySQL, Apache2 - Server 2 (10.10.10.2) : Postfix, Apache2 - Server 3 (10.10.10.3): DNS -First, the servers are defined in Nagios. +首先,服务器被定义在了Nagios中。 root@nagios:~# vim /etc/nagios3/conf.d/example.cfg @@ -70,54 +68,54 @@ First, the servers are defined in Nagios. address 10.10.10.3 } -### Monitor MySQL Service ### +### 监控MySQL服务 ### -#### MySQL Monitoring Requirements #### +#### MySQL 监控需要 #### -- Monitor whether MySQL is running by checking port 3306. -- Monitor the availability of certain database 'testDB'. +- 通过检查3306端口来检测MySQL是否运行中。 +- 检测特定的数据库'testDB'是否可用。 -#### MySQL Server Setting #### +#### MySQL 服务器设置 #### -When it comes to checking MySQL, it should be kept in mind that MySQL, by default, listens on only the loopback interface 127.0.0.1. This increases the security of the database. Manual tuning is needed to tell MySQL to listen on other interfaces as well. Here is how it can be done. +开始检测MySQL时,需要记住MySQL默认只监听回环接口127.0.0.1。这增加了数据库的安全。手动调节需要告诉MySQL该监听什么其他接口。下面是该怎么做。 -This setting is done on all MySQL servers. +这个设置在所有的MySQL服务器上已经做了。 root@nagios:~# vim /etc/mysql/my.cnf -The following line is commented out to make MySQL listens on all interfaces. +下面这行被注释掉了来监听所有接口。 #bind-address = 127.0.0.1 -Also, MySQL would not let just any host to connect to it. A user 'nagios' is created for both localhost and for 'any' host. This user is then granted all permission to all databases and will be used for monitoring. +同样,MySQL将不会运行任何主机来连接到它。在本机和任意主机都创建了用户‘nagios’。这个用户接着在所有的数据库中被授予所有的权限,这将在会用在监控中。 -The following settings are done for all MySQL servers. +下面的设置对所有的MySQL服务器都已经设置。 root@nagios:~# mysql -u root –p ## MySQL root password here ## -A user 'nagios@localhost' is created in MySQL server. +'nagios@localhost'用户在MySQL服务器中创建了。 mysql> CREATE USER 'nagios'@'localhost' IDENTIFIED BY 'nagios-pass'; mysql> GRANT ALL PRIVILEGES ON *.* TO 'nagios'@'localhost'; -A user 'nagios@any-host' is created. +'nagios@any-host'用户创建了。 mysql> CREATE USER 'nagios'@'%' IDENTIFIED BY 'nagios-pass'; mysql> GRANT ALL PRIVILEGES ON *.* TO 'nagios'@'%'; mysql> FLUSH PRIVILEGES; -This should enable MySQL to listen on all interfaces, as well as accept incoming connections from user 'nagios' at any host. +这使MySQL监听所有的接口,同样接受来自用户'nagios'的进入链接。 -Note that there are possible security implications of this change, so it's worth mentioning a few words: +请注意,这种变化可能有安全隐患,所以需要说几句话: -- This setting will expose MySQL to all available interfaces, including WAN. It is vital to make sure only legitimate networks have access to the database. Filters such as firewall and TCP wrappers should be used. -- The MySQL 'nagios' user password should be very strong. If there are few Nagios servers, then MySQL user 'nagios@servername' should be created instead of 'nagios@%' i.e., any host. +- 这个设置将会暴露MySQL给所有的接口,包括WAN。确保只有合法的网络访问是非常重要的。应该使用防火墙和TCP封装器等过滤器。 +- MySQL用户‘nagios’的密码应该非常强。如果只有几台Nagios服务器,那么应该创建'nagios@servername'用户而不是任意用户的'nagios@%'。 -#### Nagios Configuration for MySQL #### +#### 对MySQL的NAgios配置 #### -The following tuning should do the trick. +用下面的来做一些调整。 root@nagios:~# vim /etc/nagios3/conf.d/services_nagios2.cfg @@ -142,17 +140,17 @@ The following tuning should do the trick. ;check_mysql!userName!userPassword!databaseName } -This way, Nagios can help monitor the accessibility of both MySQL servers and the database stored within the servers. +这样,Nagios就可以同时监控MySQL服务器和数据库的可用性。 -### Monitor Apache Web Server ### +### 监控Apache服务器 ### -Nagios can be used to monitor Apache web server as well. +Nagios同样也可以监控Apache服务。 -#### Apache Monitoring Requirements #### +#### Apache监控需要 #### -- Monitor whether the apache server is available. +- 监控apache是否可用 -This task is really easy as Nagios has a built-in command for this. +这个任务非常简单因为Nagios有一个内置命令。 root@nagios:~# vim /etc/nagios3/conf.d/services_nagios2.cfg @@ -165,11 +163,11 @@ This task is really easy as Nagios has a built-in command for this. check_command check_http } -Now that was really simple. +现在就非常简单了。 -### Monitor DNS Service ### +### 监控DNS服务 ### -Nagios can monitor DNS service by asking the DNS server to either resolve a specific fully qualified domain name (FQDN), or by asking the server to use the dig tool. The default FQDN used for testing is www.google.com, but it can be changed as needed. The following file can be modified to do the job. +Nagios通过向DNS服务器查询一个完全合格域名(FQDN),或者使用dig工具来查询。默认用于FQDN的是www.google.com,但是这个可以按需改变。按照下面的文件修改来完成这个任务。 root@nagios:~# vim /etc/nagios-plugins/config/dns.cfg @@ -181,7 +179,7 @@ Nagios can monitor DNS service by asking the DNS server to either resolve a spec command_line /usr/lib/nagios/plugins/check_dns -H www.google.com -s '$HOSTADDRESS$' } -Then edit the following file. +编辑下面的行。 root@nagios:~# vim /etc/nagios3/conf.d/services_nagios2.cfg @@ -203,9 +201,10 @@ Then edit the following file. check_command check_dig!www.google.com } -### Monitor Mail Server ### +### 监控邮件服务器 ### + +Nagios可以监控不同的邮件服务组件如SMTP、POP、IMAP和mailq。之前提过,server-2设置了后缀邮件服务。Nagios将被配置来监控SMTP和邮件队列。 -Nagios can monitor different mail server components like SMTP, POP, IMAP and mailq. As mentioned earlier, server-2 has postfix mail server set up on it. Nagios will be configured to monitor SMTP and mail queue of the server. root@nagios:~# vim /etc/nagios3/conf.d/services_nagios2.cfg @@ -226,17 +225,17 @@ Nagios can monitor different mail server components like SMTP, POP, IMAP and mai ;warning at 50, critical at 100 } -The following screenshot shows a complete overview of all the service checks that have been configured so far. +下面的截屏显示了目前配置监控服务的概览。 ![](http://farm8.staticflickr.com/7333/11428095956_2868bbdfcc_z.jpg) -### Port Based Monitoring for Custom Applications ### +### 基于端口自定义监控程序 ### -Let us assume that the following custom application is also running in the network, listening on a particular port. +让我们假设下面的自定义程序同样运行在网络中,监听一个特定的端口。 -- Test Server 1: custom application (TCP Port 12345) +- 测试1号服务器:自定义程序(TCP端口 12345) -With a little tweaking, Nagios can help monitor this application port as well. +过一些小的调整,Nagios也可以帮助监控这个程序。 root@nagios:~# vim /etc/nagios3/conf.d/services_nagios2.cfg @@ -249,18 +248,19 @@ With a little tweaking, Nagios can help monitor this application port as well. check_command check_tcp!12345 } -On a finishing note, Nagios can monitor many other sectors of a network. The scripts stored in /etc/nagios-plugins/config/ can shed some light on the awesome capabilities of Nagios. +在完结之前,Nagios可以监控网络很多其他的方面。存储在/etc/nagios-plugins/config/中的脚本为Nagios很棒的能力。 -Some of the scripts provided with Nagios are restricted to the local server only. Examples include server load, number of concurrent processes, number of logged in users. These checks can provide useful insight on what is going on within the Nagios server. -Hope this helps. +一些Nagios提供的脚本被限制在本地服务器。例子包含服务负载、进程并发数量、登录用户数量。这些检查可以提供Nagios服务器内有用的信息。 + +希望这篇有用。 -------------------------------------------------------------------------------- via: http://xmodulo.com/monitor-common-services-nagios.html 作者:[Sarmed Rahman][a] -译者:[译者ID](https://github.com/译者ID) +译者:[geekpi](https://github.com/geekpi) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 0be6f529e6ad5fa16e56ae9d23c6c96848d1e9bb Mon Sep 17 00:00:00 2001 From: joeren Date: Tue, 2 Jun 2015 08:21:55 +0800 Subject: [PATCH 231/965] Update 20150601 How to monitor Linux servers with SNMP and Cacti.md --- ...0150601 How to monitor Linux servers with SNMP and Cacti.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150601 How to monitor Linux servers with SNMP and Cacti.md b/sources/tech/20150601 How to monitor Linux servers with SNMP and Cacti.md index ab6c7f0f30..82998d5ba4 100644 --- a/sources/tech/20150601 How to monitor Linux servers with SNMP and Cacti.md +++ b/sources/tech/20150601 How to monitor Linux servers with SNMP and Cacti.md @@ -1,3 +1,4 @@ +Translating by GOLinux! How to monitor Linux servers with SNMP and Cacti ================================================================================ SNMP (or Simple Network Management Protocol) is used to gather data on what is going on within a device, such as load, hard disk states, bandwidth. These data are used by network monitoring tools such as Cacti to generate graphs for monitoring purposes. @@ -178,4 +179,4 @@ via: http://xmodulo.com/monitor-linux-servers-snmp-cacti.html 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 [a]:http://xmodulo.com/author/sarmed -[1]:http://xmodulo.com/install-configure-cacti-linux.html \ No newline at end of file +[1]:http://xmodulo.com/install-configure-cacti-linux.html From 8bafe42245e29851585d573fa5f716988e520cf0 Mon Sep 17 00:00:00 2001 From: GOLinux Date: Tue, 2 Jun 2015 09:27:03 +0800 Subject: [PATCH 232/965] [Translated]20150601 How to monitor Linux servers with SNMP and Cacti.md --- ...nitor Linux servers with SNMP and Cacti.md | 182 ------------------ ...nitor Linux servers with SNMP and Cacti.md | 181 +++++++++++++++++ 2 files changed, 181 insertions(+), 182 deletions(-) delete mode 100644 sources/tech/20150601 How to monitor Linux servers with SNMP and Cacti.md create mode 100644 translated/tech/20150601 How to monitor Linux servers with SNMP and Cacti.md diff --git a/sources/tech/20150601 How to monitor Linux servers with SNMP and Cacti.md b/sources/tech/20150601 How to monitor Linux servers with SNMP and Cacti.md deleted file mode 100644 index 82998d5ba4..0000000000 --- a/sources/tech/20150601 How to monitor Linux servers with SNMP and Cacti.md +++ /dev/null @@ -1,182 +0,0 @@ -Translating by GOLinux! -How to monitor Linux servers with SNMP and Cacti -================================================================================ -SNMP (or Simple Network Management Protocol) is used to gather data on what is going on within a device, such as load, hard disk states, bandwidth. These data are used by network monitoring tools such as Cacti to generate graphs for monitoring purposes. - -In a typical deployment of Cacti and SNMP, there will be one or more SNMP-enabled devices, and a separate monitoring server where Cacti collects SNMP feeds from those devices. Please keep in mind that all the devices that need to be monitored must be SNMP enabled. In this tutorial, we will be configuring Cacti and SNMP on the same Linux server for demonstration purpose. - -### Configure SNMP on Debian or Ubuntu ### - -To install SNMP agent (snmpd) on a Debian-based system, run the following command. - - root@server:~# apt-get install snmpd - -Then edit its configuration like the following. - - root@server:~# vim /etc/snmp/snmpd.conf - ----------- - - # this will make snmpd listen on all interfaces - agentAddress udp:161 - - # a read only community 'myCommunity' and the source network is defined - rocommunity myCommunity 172.17.1.0/24 - - sysLocation Earth - sysContact email@domain.tld - -After editing the config file, restart snmpd. - - root@server:~# service snmpd restart - -### Configure SNMP on CentOS or RHEL ### - -To install SNMP tools and libraries, run the following command. - - root@server:~# sudo yum install net-snmp - -Then edit an SNMP config file like the following. - - root@server:~# vim /etc/snmp/snmpd.conf - ----------- - - # A user 'myUser' is being defined with the community string 'myCommunity' and source network 172.17.1.0/24 - com2sec myUser 172.17.1.0/24 myCommunity - - # myUser is added into the group 'myGroup' and the permission of the group is defined - group myGroup v1 myUser - group myGroup v2c myUser - view all included .1 - access myGroup "" any noauth exact all all none - ----------- - - root@server:~# service snmpd restart - root@server:~# chkconfig snmpd on - -Restart snmpd service, and add it to startup service list. - -### Testing SNMP ### - -SNMP can be tested by running the snmpwalk command. If SNMP has been successfully configured, this command will generate a ton of output. - - root@server:~# snmpwalk -c myCommunity 172.17.1.44 -v1 - ----------- - - iso.3.6.1.2.1.1.1.0 = STRING: "Linux mrtg 3.5.0-17-generic #28-Ubuntu SMP Tue Oct 9 19:31:23 UTC 2012 x86_64" - iso.3.6.1.2.1.1.2.0 = OID: iso.3.6.1.4.1.8072.3.2.10 - iso.3.6.1.2.1.1.3.0 = Timeticks: (2097) 0:00:20.97 - - ~~ OUTPUT TRUNCATED ~~ - - iso.3.6.1.2.1.92.1.1.2.0 = Gauge32: 1440 - iso.3.6.1.2.1.92.1.2.1.0 = Counter32: 1 - iso.3.6.1.2.1.92.1.2.2.0 = Counter32: 0 - iso.3.6.1.2.1.92.1.3.1.1.2.7.100.101.102.97.117.108.116.1 = Timeticks: (1) 0:00:00.01 - iso.3.6.1.2.1.92.1.3.1.1.3.7.100.101.102.97.117.108.116.1 = Hex-STRING: 07 DD 0B 12 00 39 27 00 2B 06 00 - -### Configure Cacti with SNMP ### - -In this tutorial, we are setting up both Cacti and SNMP on the same Linux server. So go ahead and [install Cacti][2] on your Linux server on which SNMP was just configured. - -After installation, Cacti web interface can be accessed using the link "http://172.17.1.44/cacti", of course, in your case, the IP address of your server. - -![](http://farm6.staticflickr.com/5512/10972747655_0298f6ce6c_z.jpg) - -![](http://farm6.staticflickr.com/5532/10972982543_67e15433b8_z.jpg) - -The paths during Cacti installation are usually correct. But they can be double checked if necessary. - -![](http://farm4.staticflickr.com/3764/10972920304_138670d3cf_z.jpg) - -During the first-time installation, the default username and password for Cacti are "admin" and "admin". You will be forced to change the password after first login. - -![](http://farm6.staticflickr.com/5542/10972747775_531fe445ef_o.png) - -### Add and Manage Devices to Cacti ### - -Cacti will poll devices based on SNMP string that was configured earlier. In this tutorial, we will add only the local server where SNMP is already enabled. - -To add devices, we login as admin and go to console in the Cacti admin panel. We click Console > Devices. - -![](http://farm8.staticflickr.com/7411/10972747855_b464972e56_z.jpg) - -There may already be a device named 'localhost'. We do not need it as we will create fresh graphs. We can delete this device from the list. We add a new device by using the 'add' button. - -![](http://farm8.staticflickr.com/7373/10972747895_977e0eccd6_z.jpg) - -Next, we set the device parameters. - -![](http://farm8.staticflickr.com/7400/10972747935_df03500de7_z.jpg) - -Now that the device has been added, we specify the graph templates that we want to create. This section can be found in the bottom section of the page. - -![](http://farm4.staticflickr.com/3773/10972747955_083101e6ab_z.jpg) - -And then we proceed to creating the graphs. - -![](http://farm4.staticflickr.com/3734/10972747985_fae6b78888.jpg) - -Here, we create graphs for load average, RAM and hard disk, processor. - -![](http://farm8.staticflickr.com/7374/10972920484_ed6b33b8b8_z.jpg) - -### Interface Graphs and 64-bit Counters ### - -By default, Cacti uses 32-bit counters in SNMP queries. 32-bit counters are sufficient for most bandwidth graphs, but they do not work correctly for graphs greater than 100 Mbps. If it is known that the bandwidth will exceed more than 100 Mbps, it is always advisable to use 64-bit counters. Using 64-bit counters is not hard at all. - -![](http://farm8.staticflickr.com/7320/10972982813_120fe1f3d0_z.jpg) - -**Note**: It takes around 15 minutes for Cacti to populate new graphs. There are not alternatives to being patient. - -### Creating Graph Trees ### - -These snapshots illustrate how to create graph trees and how to add graph to those trees. - -![](http://farm8.staticflickr.com/7429/10972748045_ca06bec889_z.jpg) - -![](http://farm3.staticflickr.com/2833/10972920584_f33624862a_z.jpg) - -![](http://farm6.staticflickr.com/5548/10972836666_f31e4de0e7_z.jpg) - -![](http://farm4.staticflickr.com/3786/10972836776_1675611740_z.jpg) - -We can verify the graph in the graph tree. - -![](http://farm4.staticflickr.com/3707/10972836836_3dabe56765_z.jpg) - -### User Management ### - -Finally, we create a user with view permission to only the graph that we have created. Cacti has built in user management system, and it is highly customizable. - -![](http://farm8.staticflickr.com/7313/10972920624_61e13157f9_z.jpg) - -![](http://farm6.staticflickr.com/5536/10972920644_59a9797685_z.jpg) - -![](http://farm3.staticflickr.com/2872/10972920744_24f75fb5a8_z.jpg) - -After completing these steps, we can log in with the user 'user1' and verify that only this user is able to view the graph. - -![](http://farm8.staticflickr.com/7423/10972748265_c2608b3683_z.jpg) - -![](http://farm4.staticflickr.com/3763/10972748335_9cd012c6fe_z.jpg) - -And thus we have deployed a Cacti server in the network monitoring system. Cacti servers are stable, and can deal with tons of graphs without any problems. - -Hope this helps. - --------------------------------------------------------------------------------- - -via: http://xmodulo.com/monitor-linux-servers-snmp-cacti.html - -作者:[Sarmed Rahman][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://xmodulo.com/author/sarmed -[1]:http://xmodulo.com/install-configure-cacti-linux.html diff --git a/translated/tech/20150601 How to monitor Linux servers with SNMP and Cacti.md b/translated/tech/20150601 How to monitor Linux servers with SNMP and Cacti.md new file mode 100644 index 0000000000..cc76945bd8 --- /dev/null +++ b/translated/tech/20150601 How to monitor Linux servers with SNMP and Cacti.md @@ -0,0 +1,181 @@ +使用SNMP和Cacti监控Linux服务器 +================================================================================ +SNMP(或者叫简单网络管理协议)用于收集设备内部发生的数据,如负载、磁盘状态、带宽之类。像Cacti这样的网络监控工具用这些数据来生成图标以达到监控的目的。 + +在一个典型的Cacti和SNMP部署中,会有一台或多台启用了SNMP的设备,以及一台独立的用来从那些设备收集SNMP回馈的监控服务器。请记住,所有需要监控的设备必须启用SNMP。在本教程中,出于演示目的,我们将在同一台Linux服务器上配置Cacti和SNMP。 + +### 在Debian或Ubuntu上配置SNMP ### + +要安装SNMP代理(snmpd)到基于Debian的系统,请运行以下命令: + + root@server:~# apt-get install snmpd + +然后,如下编辑配置文件。 + + root@server:~# vim /etc/snmp/snmpd.conf + +---------- + + # this will make snmpd listen on all interfaces + agentAddress udp:161 + + # a read only community 'myCommunity' and the source network is defined + rocommunity myCommunity 172.17.1.0/24 + + sysLocation Earth + sysContact email@domain.tld + +在编辑完配置文件后,重启snmpd。 + + root@server:~# service snmpd restart + +### 在CentOS或RHEL上配置SNMP ### + +要安装SNMP工具和库,请运行以下命令。 + + root@server:~# sudo yum install net-snmp + +然后,如下编辑SNMP配置文件。 + + root@server:~# vim /etc/snmp/snmpd.conf + +---------- + + # A user 'myUser' is being defined with the community string 'myCommunity' and source network 172.17.1.0/24 + com2sec myUser 172.17.1.0/24 myCommunity + + # myUser is added into the group 'myGroup' and the permission of the group is defined + group myGroup v1 myUser + group myGroup v2c myUser + view all included .1 + access myGroup "" any noauth exact all all none + +---------- + + root@server:~# service snmpd restart + root@server:~# chkconfig snmpd on + +重启snmpd服务,然后添加到启动服务列表。 + +### 测试SNMP ### + +SNMP可以通过运行snmpwalk命令进行测试。如果SNMP已经配置成功,该命令会生成大量输出。 + + root@server:~# snmpwalk -c myCommunity 172.17.1.44 -v1 + +---------- + + iso.3.6.1.2.1.1.1.0 = STRING: "Linux mrtg 3.5.0-17-generic #28-Ubuntu SMP Tue Oct 9 19:31:23 UTC 2012 x86_64" + iso.3.6.1.2.1.1.2.0 = OID: iso.3.6.1.4.1.8072.3.2.10 + iso.3.6.1.2.1.1.3.0 = Timeticks: (2097) 0:00:20.97 + + ~~ OUTPUT TRUNCATED ~~ + + iso.3.6.1.2.1.92.1.1.2.0 = Gauge32: 1440 + iso.3.6.1.2.1.92.1.2.1.0 = Counter32: 1 + iso.3.6.1.2.1.92.1.2.2.0 = Counter32: 0 + iso.3.6.1.2.1.92.1.3.1.1.2.7.100.101.102.97.117.108.116.1 = Timeticks: (1) 0:00:00.01 + iso.3.6.1.2.1.92.1.3.1.1.3.7.100.101.102.97.117.108.116.1 = Hex-STRING: 07 DD 0B 12 00 39 27 00 2B 06 00 + +### 配置带有SNMP的Cacti ### + +在本教程中,我们将在同一台Linux服务器上设置Cacti和SNMP。所以,去[安装Cacti][2]到刚刚配置SNMP的Linux服务器上吧。 + +安装完后,Cacti网页接口可以通过“http://172.17.1.44/cacti”来访问,当然,在你的环境中,请将IP地址换成你的服务器的地址。 + +![](http://farm6.staticflickr.com/5512/10972747655_0298f6ce6c_z.jpg) + +![](http://farm6.staticflickr.com/5532/10972982543_67e15433b8_z.jpg) + +安装过程中Cacti的路径一般都是正确的,但是如有必要,请再次检查以下。 + +![](http://farm4.staticflickr.com/3764/10972920304_138670d3cf_z.jpg) + +在首次安装过程中,Cacti默认的用户名和密码是“admin”和“admin”。在首次登录后会强制你修改密码。 + +![](http://farm6.staticflickr.com/5542/10972747775_531fe445ef_o.png) + +### 添加设备到Cacti并管理 ### + +Cacti将根据先前配置的SNMP字符串注册设备。在本教程中,我们将只添加启用了SNMP的本地服务器。 + +要添加设备,我们必须以管理员登录,然后转到Cacti管理员面板中的控制台。点击控制台 > 设备。 + +![](http://farm8.staticflickr.com/7411/10972747855_b464972e56_z.jpg) + +那里可能已经有一个名为‘localhost’的设备。我们不需要它,因为我们要创建全新的图表。我们可以将该设备从列表中删除,使用“添加”按钮来添加新设备。 + +![](http://farm8.staticflickr.com/7373/10972747895_977e0eccd6_z.jpg) + +接下来,我们设置设备参数。 + +![](http://farm8.staticflickr.com/7400/10972747935_df03500de7_z.jpg) + +由于设备已经添加,我们来指定想要创建的图表模板。你可以在该页的最后章节中找到本节内容。 + +![](http://farm4.staticflickr.com/3773/10972747955_083101e6ab_z.jpg) + +然后,我们继续来创建图表。 + +![](http://farm4.staticflickr.com/3734/10972747985_fae6b78888.jpg) + +这里,我们创建用于平均负载、RAM和硬盘、处理器的图表。 + +![](http://farm8.staticflickr.com/7374/10972920484_ed6b33b8b8_z.jpg) + +### 接口图表和64位计数器 ### + +默认情况下,Cacti在SNMP查询中使用32位计数器。32位计数器对于大多数带宽图表而言已经足够了,但是对于超过100Mbps的带宽,它就无能为力了。如果已经知道带宽会超过100Mbps,建议你使用64位计数器。使用64位计数器一点也不麻烦。 + +![](http://farm8.staticflickr.com/7320/10972982813_120fe1f3d0_z.jpg) + +**注意**: Cacti会花费大约15分钟来产生新图表,除了耐心等待,你别无选择。 + +### 创建图表树 ### + +这些截图展示了如何创建图表树,以及如何添加图表到这些树中。 + +![](http://farm8.staticflickr.com/7429/10972748045_ca06bec889_z.jpg) + +![](http://farm3.staticflickr.com/2833/10972920584_f33624862a_z.jpg) + +![](http://farm6.staticflickr.com/5548/10972836666_f31e4de0e7_z.jpg) + +![](http://farm4.staticflickr.com/3786/10972836776_1675611740_z.jpg) + +我们可以验证图表树中的图表。 + +![](http://farm4.staticflickr.com/3707/10972836836_3dabe56765_z.jpg) + +### 用户管理 ### + +最后,我们创建一个只具有查看我们刚创建的图表权限的用户。Cacti内建了用户管理系统,而且是高度可定制的。 + +![](http://farm8.staticflickr.com/7313/10972920624_61e13157f9_z.jpg) + +![](http://farm6.staticflickr.com/5536/10972920644_59a9797685_z.jpg) + +![](http://farm3.staticflickr.com/2872/10972920744_24f75fb5a8_z.jpg) + +在完成这些步骤后,我们可以使用‘user1’来登录进去,并验证只有该用户可以查看该图表。 + +![](http://farm8.staticflickr.com/7423/10972748265_c2608b3683_z.jpg) + +![](http://farm4.staticflickr.com/3763/10972748335_9cd012c6fe_z.jpg) + +至此,我们在网络监控系统中部署了一台Cacti服务器。Cacti服务器比较稳定,可以处理大量图表而不会出问题。 + +希望本文对你有所帮助。 + +-------------------------------------------------------------------------------- + +via: http://xmodulo.com/monitor-linux-servers-snmp-cacti.html + +作者:[Sarmed Rahman][a] +译者:[GOLinux](https://github.com/GOLinux) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://xmodulo.com/author/sarmed +[1]:http://xmodulo.com/install-configure-cacti-linux.html From 3ef2c75aaccdbb960782195af57b2a27c3ce84ce Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 2 Jun 2015 09:41:34 +0800 Subject: [PATCH 233/965] PUB:20150310 FAQ--BSD MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @wwy-hust 翻译的真不错!赞一个 --- published/20150310 FAQ--BSD.md | 78 ++++++++++++++++++++++++++++ translated/talk/20150310 FAQ--BSD.md | 75 -------------------------- 2 files changed, 78 insertions(+), 75 deletions(-) create mode 100644 published/20150310 FAQ--BSD.md delete mode 100644 translated/talk/20150310 FAQ--BSD.md diff --git a/published/20150310 FAQ--BSD.md b/published/20150310 FAQ--BSD.md new file mode 100644 index 0000000000..e9f3d8fedb --- /dev/null +++ b/published/20150310 FAQ--BSD.md @@ -0,0 +1,78 @@ +BSD 的那些事 +================================================================================ +![](http://www.linuxvoice.com/wp-content/uploads/2015/02/faq1-large1.png) + +### 假如历史稍有不同,今天你将听到的是“FreeBSD之声”... ### +(LCTT 译注:本文来自“Linux之声(LinuxVoice)”。) + +#### 那么,这个Birsa Seva Dal是怎么回事呢?难道不是一个印度的政治组织么? #### + +真有趣,您查阅了维基百科上“BSD”的消除分歧页面是为了讲上面这个笑话,对么?这里我们在讨论伯克利软件发行版(Berkeley Software Distribution),一个比您想象中用的更广泛的操作系统家族。 + +#### 抱歉,我有点 Hold 不住自己。那么,这些操作系统是怎么回事呢? #### + +今天,主要使用的BSD操作系统有三种。他们都基于Unix,他们都开源,并且大多担任服务器的角色,但也能当作优秀的桌面和工作站。他们运行KDE,Firefox,LibreOffice,Apache,MySQL和许多你能说得出名字的开源软件。它们都很稳定、安全、支持许多不同的硬件。 + +#### 真棒!你刚才在描述GNU/Linux吧 #### + +是的,Linux拥有我刚才提到的所有东西,这也是为什么很多人从来不讨论BSD。在日常的使用中,Linux和BSD并没有太多的不同,这主要是因为他们都以Unix为基础,并共用很多软件。您可以登录进远程主机,在Vim中写一些Python代码,使用Mutt检查您的email,您可能并未意识到您在使用BSD。或许您在咖啡馆里正通过网络终端使用它,但不知道他是BSD。 + +两者最大的区别在于开发模式和许可证,为了解这些,我们需要回到过去。在BSD中,B代表着加利福尼亚大学伯克利分校(University of California, Berkeley),在1980年代,那里是开源的Unix软件的发源地。到了90年代,基于x86的PC变得流行,许多人对在他们的家庭电脑中安装Unix类操作系统产生了兴趣。1992年,一个叫做386BSD的项目在那时发布,提供了上述功能。 + +#### 那么,所有的Linux发行版那个时候在哪里呢? #### + +问得好!您也许知道这一年的前一年(1991),Linus Torvalds已经发布了他的内核,当它与GNU项目结合时,变成了完整的开源操作系统。Linus那时也在关注GNU的内核(Hurd)和386BSD,并且他说过,如果那时两个内核有一个可以正常使用,他可能就不会创造Linux了。所以,90年代的头几年,开源操作系统生机勃勃,没有人知道哪个系统会最终胜出。 + +接下来,BSD遇到了一些麻烦。Unix最初的开发方AT&T试图从他们在操作系统方面的付出中获得一些利益,他们声称BSD侵犯了他们的知识产权。此事最终以1992年的一桩诉讼结束,它极大的抑制了BSD的开发进程。其结果就是,许多BSD源码必须重写,与此同时,GNU/Linux已经丰富了功能,变得稳定和流行了。 + +在90年代早期,BSD被认为比GNU/Linux更加成熟,如果没有那些法律麻烦,他可能已经成为了x86 PC的标准了。今天,我们可能都在使用它而不是Linux。 + +#### 但你提到BSD仍然被广泛的使用,所以它后来有提升么? #### + +是的。386BSD的开发停滞了,但有两只开发团队通过互联网协作并创造了两个独立的成功的项目。FreeBSD成为了使用最广泛的BSD版本,它目前是和Linux最相似的系统,包括桌面和服务器版本。而NetBSD则聚焦于可移植性(今天它可以运行在超过50种不同平台上,均基于同样的代码版本)。另一个版本是OpenBSD,它在NetBSD开始不久就因为开发者的口角而作为NetBSD的分支诞生了,今天,它以专注于安全闻名。多年以来,OpenBSD创建了许多程序,它们都成了Linux的标准部分,比如说OpenSSH - 甚至,现在我们还有了LibreSSL。 + +#### 所以,这三种版本的BSD和Linux发行版相似么? #### + +也是也不是,每个BSD版本都有自己的代码库、不同的开发团队。尽管他们间有许多共用的代码(尤其是硬件驱动)。但他们是各自拥有其特色、优点和缺点的相互独立的操作系统。 + +我们提到过,BSD的开发模式是他们真正和GNU/Linux区别的重要特点。在GNU/Linux中没有人对其整体进行掌控:一些团队在GNU组件方面工作,一些团队在开发内核,一些在开发启动脚本,一些在写手册,一些在写库等等。这样的开发模式通常被称作缺少中央权利的“荒蛮的美国西部”,由发行版负责将所有的东西各自锲合。 + +而BSD则相反,它们从中央化的源代码树中开发并作为一个整体。内核、库、系统组件和文档页都存在一个地方,且以同样的方式使用。许多BSD粉丝声称,这个特点给了操作系统更多的一致性和稳定性。通过我这些年使用BSD的经验来看,我们可以证明手册页已经变得非常完备。 + +![](http://www.linuxvoice.com/wp-content/uploads/2015/02/faq2-large1.png) + +#### 难道BSD没有使用GNU/Linux的任何东西么? #### + +是的,但除了GCC。几十年来,GNU Compiler Collection已经成为了实际上的Unix系统标准编译器,但FreeBSD最近已经转而使用LLVM/Clang了。值得注意的是BSD还是用了一些其他的开源项目,但它们并属于GNU或者Linux,比如说X Window System(XFree86和X.org)、Perl等等。并且幸亏有像POSIX一样的标准,许多运行在Linux上的程序可以在BSD的许多版本上编译和运行。 + +因此,您可以把LAMP(Linux、Apache、MySQL和PHP)中的L改成FreeBSD,这样可以获得几乎同样的环境,以及一些不同的特性(例如,在文件系统和驱动支持方面)。FreeBSD有一些大型、海量的用户,例如Netflix,每天提供海量的数据。尽管FreeBSD可以做为一个不错的桌面环境,但它的长处在于服务器方面,它拥有超乎寻常的可靠性和网络性能。 + +OpenBSD更倾向用于安全性十分必要的场合,如小型Web服务、文件托管、防火墙和网关。NetBSD是BSD主要发行版中最不流行的一个,它能运行在几乎所有平台上,包括古老的Amigas和Acorn boxes,有时您可以在闭源的网络设备中找到它的身影。 + +#### 等等,怎么会有人将开源代码闭源呢?那在Linux中是不合适的 #### + +对的,这里我们谈到了它与GNU/Linux的主要不同。BSD版本的许可证(很有趣,就叫做BSD许可证)非常不同于我们所知的GPL。对于新手来说,BSD更简短。BSD许可证主要内容是:对这份代码做你想做的事,但要保留它的初始开发者的荣誉,并且如果它搞坏你的电脑时不要提出诉讼。 + +因此,该许可证中没有任何条款强制代码开源,不像GPL,它要求使用这份代码的用户将他们的修改也开源。这一重要的不同引起了互联网上无数的激烈讨论,BSD的粉丝们说他们的许可证更加自由(因为它不那么严格),而GNU/GPL的粉丝说他们的证书才更自由(因为它保留了真正的自由) + +#### 啊呀,不管怎么说,你已经引起了我的兴趣,我在哪里能尝试这些可爱的BSD版本呢? #### + +您大概已经可以猜到这些网站了 – [www.openbsd.org][1]、[www.freebsd.org][2]、[www.netbsd.org][3]。在那里,您可以下载ISO镜像,在VirtualBox中启动它们,然后开始玩耍。如果您已经用了一段时间的Linux,你就会发现这并不难,虽然您需要了解命令行。如果您在寻找一些对新手更加友好的东西,可以试试PC-BSD,PC-BSD([www.pcbsd.org][4])是一个基于FreeBSD的个性化定制版本,它专注于桌面,有美观的图形化安装器和超级简单的软件管理器。 + +祝你玩的愉快! + +-------------------------------------------------------------------------------- + +via: http://www.linuxvoice.com/faq-bsd-2/ + +作者:[Mike Saunders][a] +译者:[wwy-hust](https://github.com/wwy-hust) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://www.linuxvoice.com/author/mike/ +[1]:http://www.openbsd.org/ +[2]:http://www.freebsd.org/ +[3]:http://www.netbsd.org/ +[4]:http://www.pcbsd.org/ diff --git a/translated/talk/20150310 FAQ--BSD.md b/translated/talk/20150310 FAQ--BSD.md deleted file mode 100644 index 97bcd4f246..0000000000 --- a/translated/talk/20150310 FAQ--BSD.md +++ /dev/null @@ -1,75 +0,0 @@ -BSD -================================================================================ -![](http://www.linuxvoice.com/wp-content/uploads/2015/02/faq1-large1.png) - -### ʷвͬڽFreeBSD... ### - -#### ôBirsa Seva Dalôأѵһӡȵ֯ô #### - -ȤάٿϡBSDҳΪ˽Цô۲а棨Berkeley Software Distributionһõĸ㷺IJϵͳ塣 - -#### ǸҿƲסԼôЩϵͳôأ #### - -죬ҪʹõBSDϵͳ֡ǶUnixǶԴҴൣηĽɫҲܵ͹վKDEFirefoxLibreOfficeApacheMySQL˵óֵĿԴǶȶȫ֧಻ͬӲ - -#### ϲ㣡ղGNU/Linux #### - -ǵģLinuxӵҸղᵽжҲΪʲôܶ˴BSDճʹУLinuxBSDû̫IJͬҪΪǶUnixΪúܶԵ¼ԶVimдһЩPython룬ʹMuttemailܲδʶʹBSDڿȹͨնʹ֪BSD - -ڿģͺ֤Ϊ˽ЩҪصȥBSDУBżǴѧУUniversity of California, Berkeley1980ǿԴUnixķԴء90x86PCУ˶ǵļͥаװUnixϵͳȤһ386BSDĿʱṩĹܡ - -#### ôеLinuxаǸʱأ #### - -ʵúãҲ֪һǰLinus TorvaldsѾںˣGNUĿʱĿԴϵͳLinusʱѾڸGNUںˣHurd386BSD̸ʱںһԱճܾͲᴴLinuxˡԣ90ͷ꣬Դϵͳû֪ĸϵͳʤ - -BSDһЩ鷳UnixĿAT&TͼǵĹлһЩ棬BSDַǵ֪ʶȨ1992һ׮ϽBSDĿ̡BSDԴķ֧뱻дʱGNU/LinuxѾḻ˹ܣȶˡ - -90BSD֤GNU/Linuxӳ죬ûЩ鷳ѾΪx86 PCı׼ˡ죬ǿܶʹLinux - -#### ᵽBSDȻ㷺ʹãô #### - -ǵġ386BSDĿͣˣֻŶķʽijɹĿFreeBSDΪʹ㷺BSD汾ĿǰǺLinuxƵϵͳͷ汾ȻNetBSD۽ڿֲԣڳ50ֲͬƽ̨ϣͬĴ汾һ汾OpenBSDNetBSDʼþΪߵĿڽǶΪNetBSDķ֧ˣ죬רעڰȫOpenBSDǶLinuxı׼˵OpenSSH - ԣLibreSSL - -#### ԣְ汾BSDLinuxаô #### - -ҲҲǣÿBSD汾ԼĴ⡢ͬĿŶӡǼ๲õĴ루ӲǸӵɫŵȱ໥IJϵͳ - -ᵽBSDĿģGNU/LinuxҪص㡣GNU/Linuxû˶иһЩŶGNU湤һЩŶڿںˣһЩڿűһЩдֲᣬһЩдȵȡĿģͨȱȨġɷа渺ʹжƺϡ - -BSD෴Ǵ뻯ԴпΪһ塣ںˡ⡢ϵͳĵҳһطͬķʽʹáBSD˿ƣص˲ϵͳһԺȶԡͨЩʹBSDľǿֲ֤ҳѾ÷dz걸 - -![](http://www.linuxvoice.com/wp-content/uploads/2015/02/faq2-large1.png) - -#### ѵBSDûʹGNU/Linuxκζô #### - -ǵģGCCʮGNU Compiler CollectionѾΪʵϵUnixϵͳ׼FreeBSDѾתʹLLVM/ClangˡֵעBSDһЩĿԴĿDzGNULinux˵X Window SystemXFree86X.orgPerlȵȡҿPOSIXһı׼LinuxϵijBSD汾ϱС - -ˣ԰LAMPLinuxApacheMySQLPHPеLijFreeBSDԻüͬĻԼһЩͬԣ磬ļϵͳַ֧棩FreeBSDдûNetflixÿṩݡFreeBSDһõ滷ijڷ棬ӵгѰĿɿԺܡ - -OpenBSDڰȫʮֱҪijϣСWebļйܡǽءNetBSDBSDҪаеһڼƽ̨ϣϵAmigasAcorn boxesʱڱԴ豸ҵӰ - -#### ȵȣô˽ԴԴأLinuxDzʵ #### - -Եģ̸GNU/LinuxҪͬBSD汾֤ȤBSD֤dz֪ͬGPL˵BSD̡BSD֤Ҫǣݴ룬£ĿԱȨ㻵ĵʱҪϡ - -ˣ֤ûκǿƴ뿪ԴGPLҪʹݴûǵ޸ҲԴһҪIJͬ˻ļۣBSDķ˿˵ǵ֤ɣΪôϸ񣩣GNU/GPLķ˿˵ǵ֤ŸɣΪɣ - -#### ѽô˵ѾҵȤܳЩɰBSD汾أ #### - -ѾԲµЩվ C [www.openbsd.org][1][www.freebsd.org][2][www.netbsd.org][3]ISOVirtualBoxǣȻʼˣѾһʱLinuxҪ˽Щⲻ̫ѡѰһЩָѺõĶPC-BSDPC-BSD([www.pcbsd.org][4])һFreeBSDĸԻư汾רע棬۵ͼλװͳ򵥵ף죡 - --------------------------------------------------------------------------------- - -via: http://www.linuxvoice.com/faq-bsd-2/ - -ߣ[Mike Saunders][a] -ߣ[wwy-hust](https://github.com/wwy-hust) -Уԣ[УID](https://github.com/УID) - - [LCTT](https://github.com/LCTT/TranslateProject) ԭ룬[Linuxй](http://linux.cn/) Ƴ - -[a]:http://www.linuxvoice.com/author/mike/ -[1]:http://www.openbsd.org/ -[2]:http://www.freebsd.org/ -[3]:http://www.netbsd.org/ -[4]:http://www.pcbsd.org/ From 4c2cd82c481a214af932b8044698dfbd1e91999f Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 2 Jun 2015 11:19:30 +0800 Subject: [PATCH 234/965] PUB:20150511 Open Source History--Why Did Linux Succeed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @KayGuoWhu 翻译的很不错,点赞 --- ...n Source History--Why Did Linux Succeed.md | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) rename {translated/talk => published}/20150511 Open Source History--Why Did Linux Succeed.md (61%) diff --git a/translated/talk/20150511 Open Source History--Why Did Linux Succeed.md b/published/20150511 Open Source History--Why Did Linux Succeed.md similarity index 61% rename from translated/talk/20150511 Open Source History--Why Did Linux Succeed.md rename to published/20150511 Open Source History--Why Did Linux Succeed.md index 85b2473719..76b6d03ebe 100644 --- a/translated/talk/20150511 Open Source History--Why Did Linux Succeed.md +++ b/published/20150511 Open Source History--Why Did Linux Succeed.md @@ -1,21 +1,21 @@ 开源旧事:Linux为什么能成功? ================================================================================ -> Linux,这个始于1991年由Lnius Torvalds开发的类Unix操作系统内核已经成为开源世界的中心,人们不禁追问为什么Linux成功了,而包括GNU HURD和BSD在内的那么多相似的项目却失败了? +> Linux,这个始于1991年由Linus Torvalds开发的类Unix操作系统内核已经成为开源世界的中心,人们不禁追问为什么Linux成功了,而包括GNU HURD和BSD在内的那么多相似的项目却失败了? ![](http://thevarguy.com/site-files/thevarguy.com/files/imagecache/medium_img/uploads/2015/05/linux.jpg) 自由软件和开源世界的发展史中最令人不解的问题之一是为什么Linux取得了如此辉煌的成功,然而其它同样尝试打造自由开源、类Unix操作系统内核的项目却没能那么成功?这个问题难以回答,但我总结了一些原因,在下面与大家分享。 -不过,首先得明确:当我谈论Linux是一个巨大的成功时所表达的含义。我对Linux成功的定义和对其它类Unix操作系统内核不一样,后者中一些是开源的,一些不是,而且它们繁荣发展的时期是Linux诞生的时期。[GNU][1]的HURD,一个发起于[1991年5月][1]的自由但不是免费的内核,便是其中之一。其它的包括现在大部分人都没听说过的Unix,比如由加州大学伯克利分校开发出来的BSD的各种各样Unix衍生版,由微软主导的Unix系统Xenix,包括Minix在内的学术版本Unix,和在AT&T赞助下开发的最初的Unix。在更早的数十年内,它对于学术界和商业届的计算发展至关重要,但到19世纪90年代就已经几乎已经消失在人们的视野里。 +不过,首先得明确:当我谈论Linux是一个巨大的成功时所表达的含义。我这样说是相对于其它类Unix操作系统内核的,后者中一些是开源的,一些不是,而且它们繁荣发展的时期是Linux诞生的时期。[GNU][1]的HURD,一个发起于[1991年5月][1]的Free(自由)的内核,便是其中之一。其它的包括现在大部分人都没听说过的Unix,比如由加州大学伯克利分校开发出来的BSD的各种各样Unix衍生版,由微软主导的Unix系统Xenix,包括Minix在内的学术版本Unix,和在AT&T赞助下开发的最初的Unix。在更早的数十年内,它对于学术界和商业界的计算发展至关重要,但到19世纪90年代就已经几乎已经消失在人们的视野里。 #### 相关阅读 #### -- [Open Source History: Tracing the Origins of Hacker Culture and the Hacker Ethic][3] -- [Unix and Personal Computers: Reinterpreting the Origins of Linux][4] +- [开源旧事:黑客文化和黑客伦理的起源追踪][3] +- [Unix和个人计算机:重新诠释Linux起源][4] -因此,得说明的是,我所写的是关于内核,而不是完整的操作系统。在很大程度上,Linux内核的成功归功于GNU整个项目。GNU这个项目产生了一套至关重要的工具,包括编译器、调试器和BASH shell的实现,这些对于构建一个类Unix操作系统是必需的。但是GNU的开发者们从没开发出一个HURD内核的可行版本(尽管他们仍在[不懈努力中][5])。相反,Linux呈现出来的则是一个将GNU各个部分紧密连接在一起的内核,尽管这超出了GNU的初衷。 +此外,得说明的是,我这里说的是内核,而不是完整的操作系统。在很大程度上,Linux内核的成功归功于GNU整个项目。GNU这个项目产生了一套至关重要的工具,包括编译器、调试器和BASH shell的实现,这些对于构建一个类Unix操作系统是必需的。但是GNU的开发者们从没开发出一个HURD内核的可行版本(尽管他们仍在[不懈努力中][5])。相反,Linux呈现出来的则是一个将GNU各个部分紧密连接在一起的内核,尽管这超出了GNU的初衷。 -因此,值得人们去追问为什么Linux,一个由Linus Torvalds这个芬兰的无名程序员于1991年——和HURD同一年——发起的内核,能够禁受考验并发展壮大?在当时的大环境下,很多拥有强力商业支持的、由当时炙手可热的黑客领头的类Unix内核都没能够发展起来。为了说明这个问题,我找到了一些和这个问题相关的解释。为此我研究了自由软件和开源世界的发展史,和不同解释的优缺点。 +因此,值得人们去追问为什么Linux,一个由Linus Torvalds这个芬兰的无名程序员于1991年——和HURD同一年——发起的内核,能够经受考验并发展壮大?在当时的大环境下,很多拥有强力商业支持的、由当时炙手可热的黑客领头的类Unix内核都没能够发展起来。为了说明这个问题,我找到了一些和这个问题相关的解释。为此我研究了自由软件和开源世界的发展史,和不同解释的优缺点。 ### Linux采用去中心化的开发方式 ### @@ -25,7 +25,7 @@ ### Linux是实用型的,而GNU是空想型的 ### -个人而言,我觉得下面这个说法是最引人注目的,即Linux之所发展得如此迅速是因为它的创建者是一个实用主义者,他起初只是想写一个内核,使其能够在他家里的电脑上运行一个裁剪过的Unix操作系统,而不是成为以改变世界为目标的自由软件的一部分,而后者正是GNU项目的一贯目标。 +个人而言,我觉得这个说法是最引人注目的,即Linux之所发展得如此迅速是因为它的创建者是一个实用主义者,他起初只是想写一个内核,使其能够在他家里的电脑上运行一个裁剪过的Unix操作系统,而不是成为以改变世界为目标的自由软件的一部分,而后者正是GNU项目的一贯目标。 然而,这个解释仍然有一些不能完全让人信服的地方。特别是,尽管Torvalds本人信奉实用主义的原则,但无论以前还是现在,并非所有参与到他的项目中的成员都和他一样信奉这一原则。尽管如此,Linux仍然取得了成功。 @@ -37,27 +37,27 @@ 当谈到Linux的成功时,不可忽视的是Linux和其它Unix变体之间的诸多技术差异。Richard Stallman,GNU项目的创始人,在一封给我的电子邮件中解释了为什么HURD的开发进度频频滞后:“GNU Hurd确实不是一次实用上的成功。部分原因是它的基本设计使它像是一个研究项目。(我之所以选择这样的设计,是考虑到这是快速实现一个可用内核的捷径。)” -就Torvalds独自编写出Linux的所有代码这点而言,Linux也有别于其它Unix变体。当他在1991年8月[第一次发布Linux][7]时他的一个初衷就是拥有一个属于他自己的Unix,免费共享代码。这点特性使得Linux区别于同时期的大部分Unix变体,后者一般是从AT&T Unix或伯克利的BSD中衍生出基础代码。 +就Torvalds独自编写出Linux的所有代码这点而言,Linux也有别于其它Unix变体。当他在1991年8月[第一次发布Linux][7]时他的一个初衷就是拥有一个属于他自己的Unix,而不用别人的代码。这点特性使得Linux区别于同时期的大部分Unix变体,后者一般是从AT&T Unix或伯克利的BSD中衍生出基础代码。 -我并不是一个计算机科学家,所以我没有资格去评判是否Lunux代码就优于其他Unix代码,以此来解释Linux的成功。虽然这并不能解释Linux和其它Unix内核在文化和人力上的不同,但这个观点对我来说解释得通,因为似乎在理解Linux成功这一点上它比代码更加重要。(译者尽力了+_+) +我并不是一个计算机科学家,所以我没有资格去评判是否Linux代码就优于其他Unix代码,以此来解释Linux的成功。虽然这并不能解释Linux和其它Unix内核在文化和人员上的不同,但这个观点对我来说解释得通,因为似乎在理解Linux成功这一点上操作系统设计比代码更加重要。 ### Linux背后的社区提供了有力支持 ### -Stallman也写到Linux成功的“主要原因”是“Torvalds使Linux成为一个自由软件,所以相比Hurd有更多来自社区的支持涌入Linux的发展中。”但这对于Linux的成长轨迹并非是一个完美的解释,因为它不能说明为什么自由软件的开发者们追随了Torvalds而不是HURD或其它某个Unix。但它仍然突出了这个转变是Linux盛行的很大一部分。(译者尽力了) +Stallman也写到Linux成功的“主要原因”是“Torvalds使Linux成为一个自由软件,所以相比Hurd有更多来自社区的支持涌入Linux的发展中。”但这对于Linux的成长轨迹并非是一个完美的解释,因为它不能说明为什么自由软件的开发者们追随了Torvalds而不是HURD或其它某个Unix,但它仍然点明了这种变化是Linux盛行的很大一部分原因。 -对于自由软件社区支持Linux的决定有一个更全面的理由可以用来解释为什么开发者们这么做。起初,Linux只是一个默默无闻的小项目,以任何标准来衡量,它比同时期其它的一些尝试创建一个更加自由的Unix,比如NET BSD和386/BSD,都要显得微不足道。同样,最初并不清楚Linux和自由软件运行目标的亲和力是怎样。创建伊始,Torvalds只是在一份防止Linux不被商业使用的证书下发布了Linux。至于后来他为了保护源代码的开放性转向使用GNU的通用公开证书则是后话了。 +对于自由软件社区决定支持Linux有一个更全面的理由可以用来解释为什么开发者们这么做。起初,Linux只是一个默默无闻的小项目,以任何标准来衡量,它比同时期其它的一些尝试创建一个更加自由的Unix,比如NET BSD和386/BSD,都要显得微不足道。同样,最初并不清楚Linux和自由软件运动的目标是否一致。创建伊始,Torvalds只是在一份防止Linux不被商业使用的证书下发布了Linux。至于后来他为了保护源代码的开放性转向使用GNU的通用公开证书则是后话了。 -所以,这些就是我所找到的Linux作为一个开源操作系统之所以取得成功的解释,可以肯定Linux的成就在某些方面(但比如桌面版的Linux从未成为它的支持者希望成为的样子)已经是可以衡量的成功。总之,Linux业已以其它任何类Unix操作系统都没有实现的方式成为了计算机世界的基石。也许源于BSD的苹果公司的OS X和iOS系统也很接近这一点,但它们没有在其它方面像Linux影响互联网一样扮演着如此重要的中心角色。 +所以,这些就是我所找到的Linux作为一个开源操作系统之所以取得成功的解释,可以肯定Linux的成就在某些方面(但比如桌面版的Linux从未成为它的支持者希望成为的样子)已经是可以衡量的成功。总之,Linux业已与其它任何类Unix操作系统不同的方式成为了计算机世界的基石。也许源于BSD的苹果公司的OS X和iOS系统也很接近这一点,但它们没有在其它方面像Linux影响互联网一样扮演着如此重要的中心角色。 -对于为什么Linux能成为它已经成为的样子,或者为什么它在Unix世界的竞争对手们几乎全部变得默默无闻的问题你有其它的想法吗?如果有,我很乐意听到你的想法。(诚然,BSD的变体如今仍有一批追随者,而一些商用的Unix对于[Red Hat][8](RHT)为[他们的用户提供支持][9]来说也仍然十分重要。但这些Unix中没有一个能够像Linux一样几乎征服了从Web服务器到智能手机的每一个领域。) +对于为什么Linux能成为现在的样子,或者为什么它在Unix世界的竞争对手们几乎全部变得默默无闻的问题,你有其它的想法吗?如果有,我很乐意听到你的想法。(诚然,BSD的变体如今仍有一批追随者,而一些商用的Unix对于[Red Hat][8](RHT)为[他们的用户提供支持][9]来说也仍然十分重要。但这些Unix中没有一个能够像Linux一样几乎征服了从Web服务器到智能手机的每一个领域。) -------------------------------------------------------------------------------- via: http://thevarguy.com/open-source-application-software-companies/050415/open-source-history-why-did-linux-succeed -作者:[hristopher Tozzi][a] +作者:[Christopher Tozzi][a] 译者:[KayGuoWhu](https://github.com/KayGuoWhu) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From c37b9c324fca48aae1702077fbafabf1f2a96159 Mon Sep 17 00:00:00 2001 From: wwy-hust Date: Tue, 2 Jun 2015 15:25:12 +0800 Subject: [PATCH 235/965] finish translation --- ...nds for RPM Package Management in Linux.md | 287 ++++++++++++++++++ 1 file changed, 287 insertions(+) create mode 100644 translated/tech/20150528 27 'DNF' Fork of Yum Commands for RPM Package Management in Linux.md diff --git a/translated/tech/20150528 27 'DNF' Fork of Yum Commands for RPM Package Management in Linux.md b/translated/tech/20150528 27 'DNF' Fork of Yum Commands for RPM Package Management in Linux.md new file mode 100644 index 0000000000..48dd213d68 --- /dev/null +++ b/translated/tech/20150528 27 'DNF' Fork of Yum Commands for RPM Package Management in Linux.md @@ -0,0 +1,287 @@ +27LinuxߡDNFYumķ֧ +================================================================================ +DNFDandified YUMǻRPMķаһߡFedora 18г֣еFedora 22[YUM߼][1] + +![](http://www.tecmint.com/wp-content/uploads/2015/05/linux-dnf-command-examples.jpg) + +DNFڸYUMƿܡڴռáٶȺ档DNFʹRPMlibsolvhawkeyаδԤװCentOSRHEL 7Уͨyumװͬʱʹöߡ + +ҲĶDNFϢ + +- [ʹDNFȡYumԭ][2] + +µDNFȶ汾2015511շ1.0дƪ֮ǰԼDNF֮ǰ汾ҪPythonдGPL v2֤ + +### װDNF ### + +Fedora 22ٷѾɵDNFDNFRHEL/CentOS 7ĬϲֿС + +ΪRHEL/CentOSϵͳаװDNFҪȰװͿepel-releaseֿ⡣ + + # yum install epel-release + + # yum install epel-release -y + +ܲʹyumʱ'-y'ѡΪûǿʲôװϵͳСԴ˲⣬ʹ'-y'ѡԶİװûԤ + +ʹyumepel-realeaseֿⰲװDNF + + # yum install dnf + +װdnfһչʾ27ʵõdnfӣԱ׺͸ЧĹRPMķа档 + +### 1. DNF汾 ### + +ϵͳϰװDNF汾 + + # dnf --version + +![DNF汾](http://www.tecmint.com/wp-content/uploads/2015/05/Check-DNF-Version.gif) + +### 2. гDNFֿ ### + +dnfе'repolist'ѡʾϵͳпIJֿ⡣ + + # dnf repolist + +![пIJֿ](http://www.tecmint.com/wp-content/uploads/2015/05/Check-All-Enabled-Repositories.gif) + +### 3. гп͹رյDNFֿ ### + +'repolist all'ѡʾϵͳп/رյIJֿ⡣ + + # dnf repolist all + +![гп/رյIJֿ](http://www.tecmint.com/wp-content/uploads/2015/05/Check-All-Repositories.gif) + +### 4. DNFгпõѰװ ### + +'dnf list'гвֿпõLinuxϵͳѰװ + + # dnf list + +![DNFге](http://www.tecmint.com/wp-content/uploads/2015/05/List-All-Packages.png) + +### 5. DNFгѰװ ### + +'dnf list'гвֿпõѰװȻһʹ'list installed'ѡֻгѰװ + + # dnf list installed + +![гѰװ](http://www.tecmint.com/wp-content/uploads/2015/05/List-Installed-Packages.png) + +### 6. DNFгпõ ### + +Ƶģ'list available'ѡгпIJֿпõ + + # dnf list available + +![DNFгõ](http://www.tecmint.com/wp-content/uploads/2015/05/List-Available-Packages.png) + +### 7. ʹDNF ### + +̫밲װ֣£ʹ'search'ѡƥַ磬nanoַ + + # dnf search nano + +![ͨؼ](http://www.tecmint.com/wp-content/uploads/2015/05/Search-Package.gif) + +### 8. 鿴ĸṩijļ/ ### + +dnfѡ'provides'ܲṩijļ/磬Ǹṩϵͳе'/bin/bash'ļʹ + + # dnf provides /bin/bash + +![ṩļ](http://www.tecmint.com/wp-content/uploads/2015/05/Find-Package-Sub-Package.gif) + +### 9. ʹDNFһϸϢ ### + +ڰװһǰ֪ϸϢʹ'info'һϸϢ磺 + + # dnf info nano + +![DNF鿴Ϣ](http://www.tecmint.com/wp-content/uploads/2015/05/Check-Package-Information.gif) + +### 10. ʹDNFװ ### + +밲װһnanoֻΪnanoԶĽͰװе + + # dnf install nano + +![DNFװ](http://www.tecmint.com/wp-content/uploads/2015/05/Install-Package-DNF.gif) + +### 11. ʹDNFһ ### + +ֻһضİ磬systemdұϵͳʣ䡣 + + # dnf update systemd + +![һ](http://www.tecmint.com/wp-content/uploads/2015/05/Update-a-Package.gif) + +### 12. ʹDNFϵͳ ### + +ϵͳаװĸ¿Լ򵥵ʹdnfУ + + # dnf check-update + +![ϵͳ](http://www.tecmint.com/wp-content/uploads/2015/05/Check-For-System-Update.gif) + +### 13. ʹDNFװϵͳе ### + +ʹϵͳѰװ + + # dnf update + + # dnf upgrade + +![ϵͳ](http://www.tecmint.com/wp-content/uploads/2015/05/Update-System.gif) + +### 14. ʹDNFƳ/ɾһ ### + +dnfʹ'remove''erase'ѡƳκβҪ + + # dnf remove nano + + # dnf erase nano + +![Ƴϵͳе](http://www.tecmint.com/wp-content/uploads/2015/05/Remove-Package.gif) + +### 15. ʹDNFƳõOrphan Packages ### + +ЩΪװӦijɾ㲻Ҫˡùɾ + + # dnf autoremove + +![Ƴõ](http://www.tecmint.com/wp-content/uploads/2015/05/Autoremove-Packages.gif) + +### 16. ʹDNFƳ ### + +ʹdnfʱڵͷͲǻᵼ´ǿʹͰԶ̰Ϣͷ + + # dnf clean all + +![ƳDNF](http://www.tecmint.com/wp-content/uploads/2015/05/Remove-Cache-Packages.gif) + +### 17. ضDNFİ ### + +ҪضDNFİ磬cleanͨõ + + # dnf help clean + +![ijһ](http://www.tecmint.com/wp-content/uploads/2015/05/Help-on-DNF-Command.gif) + +### 18. гDNFѡ ### + +ҪʾdnfѡֻҪ + + # dnf help + +![ѡ](http://www.tecmint.com/wp-content/uploads/2015/05/DNF-Options.gif) + +### 19. 鿴DNFʷ¼ ### + +Ե'dnf history'鿴Ѿִйdnfб֪ʲôװ/ƳԼʱ + + # dnf history + +![鿴ʷ¼](http://www.tecmint.com/wp-content/uploads/2015/05/Check-DNF-History.gif) + +### 20. ʾ ### + +'dnf grouplist'ԴӡпõĻѰװûʲôг֪顣 + + # dnf grouplist + +![г](http://www.tecmint.com/wp-content/uploads/2015/05/List-All-Group-Packages.gif) + +### 21. ʹDNFװһ ### + +Ҫװһһ飨磬Educational SoftawareֻҪִУ + + # dnf groupinstall 'Educational Software' + +![װһ](http://www.tecmint.com/wp-content/uploads/2015/05/Install-Group-Packages.gif) + +### 22. һ ### + +ͨһ飨磬Educational Software + + # dnf groupupdate 'Educational Software' + +![](http://www.tecmint.com/wp-content/uploads/2015/05/Update-Group-Package.gif) + +### 23. Ƴһ ### + +ʹƳһ飨磬Educational Software + + # dnf groupremove 'Educational Software' + +![Ƴ](http://www.tecmint.com/wp-content/uploads/2015/05/Remove-Group-Package.gif) + +### 24. ijضIJֿⰲװһ ### + +DNFԴκضIJֿⰲװһ磬phpmyadmin + + # dnf --enablerepo=epel install phpmyadmin + +![ضIJֿⰲװ](http://www.tecmint.com/wp-content/uploads/2015/05/Install-Package-From-Specific-Repo.gif) + +### 25. Ѱװͬȶа ### + +'dnf distro-sync'ͬѰװпIJֿȶ汾ûѡͬѰװ + + # dnf distro-sync + +![ͬȶ](http://www.tecmint.com/wp-content/uploads/2015/05/Synchronize-Packages.gif) + +### 26. °װһ ### + +'dnf reinstall nano'°װһѾװ磬nano + + # dnf reinstall nano + +![°װ](http://www.tecmint.com/wp-content/uploads/2015/05/Re-Install-Package.gif) + +### 27. һ ### + +ѡ'downgrade'ʹһ磬acpid˵Ͱ汾 + + # dnf downgrade acpid + +ʾ + + Using metadata from Wed May 20 12:44:59 2015 + No match for available package: acpid-2.0.19-5.el7.x86_64 + Error: Nothing to do. + +**ҵĹ۲**dnfᰴԤһΪһbugύ + +### ### + +DNFYUMƷԶоLinuxϵͳԱĹ磺 + +- `--skip-broken`DNFʶ𣬲DNFû +- ܻdnf providesҲû'resolvedep'ˡ +- û'deplist' +- ųһֿζвųòֿ⣬yumУųһֻֿڰװʱųǡ + +LinuxûLinux̬ϵͳ⡣[Systemd滻init system][3]vDNFڲú滻YUMFedora 22RHELCentOS + +ôأDzǷаLinux̬ϵͳעûڳûԸ㣵ķǰأITҵһ仰 - ûлΪʲôҪأSystem VYUMûл + +ƪµȫˡ·˽ı뷨޺ͷ԰Ǵлл + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/dnf-commands-for-fedora-rpm-package-management/ + +ߣ[Avishek Kumar][a] +ߣ[wwy-hust](https://github.com/wwy-hust) +Уԣ[УID](https://github.com/УID) + + [LCTT](https://github.com/LCTT/TranslateProject) ԭ룬[Linuxй](https://linux.cn/) Ƴ + +[a]:http://www.tecmint.com/author/avishek/ +[1]:http://www.tecmint.com/20-linux-yum-yellowdog-updater-modified-commands-for-package-mangement/ +[2]:http://www.tecmint.com/dnf-next-generation-package-management-utility-for-linux/ +[3]:http://www.tecmint.com/systemd-replaces-init-in-linux/ From 56650caab09ac1277b971b59cedb6c5967b046da Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 2 Jun 2015 15:26:20 +0800 Subject: [PATCH 236/965] PUB:20150323 How to set up networking between Docker containers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @bazz2 翻译的不错! --- ...up networking between Docker containers.md | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) rename {translated/tech => published}/20150323 How to set up networking between Docker containers.md (76%) diff --git a/translated/tech/20150323 How to set up networking between Docker containers.md b/published/20150323 How to set up networking between Docker containers.md similarity index 76% rename from translated/tech/20150323 How to set up networking between Docker containers.md rename to published/20150323 How to set up networking between Docker containers.md index 3481dd8faa..6d8434041e 100644 --- a/translated/tech/20150323 How to set up networking between Docker containers.md +++ b/published/20150323 How to set up networking between Docker containers.md @@ -12,13 +12,13 @@ ![](https://farm8.staticflickr.com/7288/16662287067_27888684a7_b.jpg) -让我们先来看看 weave 怎么工作:先创建一个由多个 peer 组成的对等网络,每个 peer 是一个虚拟路由器容器,叫做“weave 路由器”,它们分布在不同的宿主机上。这个对等网络的每个 peer 之间会维持一个 TCP 链接,用于互相交换拓扑信息,它们也会建立 UDP 链接用于容器间通信。一个 weave 路由器通过桥接技术连接到其他本宿主机上的其他容器。当处于不同宿主机上的两个容器想要通信,一台宿主机上的 weave 路由器通过网桥截获数据包,使用 UDP 协议封装后发给另一台宿主机上的 weave 路由器。 +让我们先来看看 weave 怎么工作:先创建一个由多个 peer 组成的对等网络,每个 peer 是一个虚拟路由器容器,叫做“weave 路由器”,它们分布在不同的宿主机上。这个对等网络的每个 peer 之间会维持一个 TCP 链接,用于互相交换拓扑信息,它们也会建立 UDP 链接用于容器间通信。一个 weave 路由器通过桥接技术连接到本宿主机上的其他容器。当处于不同宿主机上的两个容器想要通信,一台宿主机上的 weave 路由器通过网桥截获数据包,使用 UDP 协议封装后发给另一台宿主机上的 weave 路由器。 -每个 weave 路由器会刷新整个对等网络的拓扑信息,像容器的 MAC 地址(就像交换机的 MAC 地址学习一样获取其他容器的 MAC 地址),因此它可以决定数据包的下一跳是往哪个容器的。weave 能让两个处于不同宿主机的容器进行通信,只要这两台宿主机在 weave 拓扑结构内连到同一个 weave 路由器。另外,weave 路由器还能使用公钥加密技术将 TCP 和 UDP 数据包进行加密。 +每个 weave 路由器会刷新整个对等网络的拓扑信息,可以称作容器的 MAC 地址(如同交换机的 MAC 地址学习一样获取其他容器的 MAC 地址),因此它可以决定数据包的下一跳是往哪个容器的。weave 能让两个处于不同宿主机的容器进行通信,只要这两台宿主机在 weave 拓扑结构内连到同一个 weave 路由器。另外,weave 路由器还能使用公钥加密技术将 TCP 和 UDP 数据包进行加密。 ### 准备工作 ### -在使用 weave 之前,你需要在所有宿主机上安装 Docker[2] 环境,参考[这些][3][教程][4],在 Ubuntu 或 CentOS/Fedora 发行版中安装 Docker。 +在使用 weave 之前,你需要在所有宿主机上安装 [Docker][2] 环境,参考[这些][3][教程][4],在 Ubuntu 或 CentOS/Fedora 发行版中安装 Docker。 Docker 环境部署完成后,使用下面的命令安装 weave: @@ -26,7 +26,7 @@ Docker 环境部署完成后,使用下面的命令安装 weave: $ chmod a+x weave $ sudo cp weave /usr/local/bin -注意你的 PATH 环境变量要包含 /usr/local/bin 这个路径,请在 /etc/profile 文件中加入一行(LCTT 注:要使环境变量生效,你需要执行这个命令: src /etc/profile): +注意你的 PATH 环境变量要包含 /usr/local/bin 这个路径,请在 /etc/profile 文件中加入一行(LCTT 译注:要使环境变量生效,你需要执行这个命令: source /etc/profile): export PATH="$PATH:/usr/local/bin" @@ -34,15 +34,15 @@ Docker 环境部署完成后,使用下面的命令安装 weave: Weave 在 TCP 和 UDP 上都使用 6783 端口,如果你的系统开启了防火墙,请确保这两个端口不会被防火墙挡住。 -### 在每台宿主机上开启 Weave 路由器 ### +### 在每台宿主机上启动 Weave 路由器 ### -当你想要让处于在不同宿主机上的容器能够互相通信,第一步要做的就是在每台宿主机上开启 weave 路由器。 +当你想要让处于在不同宿主机上的容器能够互相通信,第一步要做的就是在每台宿主机上启动 weave 路由器。 -第一台宿主机,运行下面的命令,就会创建并开启一个 weave 路由器容器(LCTT 注:前面说过了,weave 路由器也是一个容器): +第一台宿主机,运行下面的命令,就会创建并开启一个 weave 路由器容器(LCTT 译注:前面说过了,weave 路由器也是一个容器): $ sudo weave launch -第一次运行这个命令的时候,它会下载一个 weave 镜像,这会花一些时间。下载完成后就会自动运行这个镜像。成功启动后,终端会打印这个 weave 路由器的 ID 号。 +第一次运行这个命令的时候,它会下载一个 weave 镜像,这会花一些时间。下载完成后就会自动运行这个镜像。成功启动后,终端会输出这个 weave 路由器的 ID 号。 下面的命令用于查看路由器状态: @@ -52,7 +52,7 @@ Weave 在 TCP 和 UDP 上都使用 6783 端口,如果你的系统开启了防 第一个 weave 路由器就绪了,目前为止整个 peer 对等网络中只有一个 peer 成员。 -你也可以使用 doceker 的命令来查看 weave 路由器的状态: +你也可以使用 docker 的命令来查看 weave 路由器的状态: $ docker ps @@ -66,7 +66,7 @@ Weave 在 TCP 和 UDP 上都使用 6783 端口,如果你的系统开启了防 ![](https://farm8.staticflickr.com/7608/16868571891_e66d4b8841_c.jpg) -当你开启更多路由器,这个 peer 成员列表会更长。当你新开一个路由器时,要指定前一个宿主机的 IP 地址,请注意不是第一个宿主机的 IP 地址。 +当你开启更多路由器,这个 peer 成员列表会更长。当你新开一个路由器时,要指定前一个宿主机的 IP 地址,请注意不是第一个宿主机的 IP 地址(LCTT 译注:链状结构)。 现在你已经有了一个 weave 网络了,它由位于不同宿主机的 weave 路由器组成。 @@ -82,7 +82,7 @@ Weave 在 TCP 和 UDP 上都使用 6783 端口,如果你的系统开启了防 hostA:~$ sudo weave run 10.0.0.1/24 -t -i ubuntu -成功运行后,终端会打印出容器的 ID 号。你可以使用这个 ID 来访问这个容器: +成功运行后,终端会显示出容器的 ID 号。你可以使用这个 ID 来访问这个容器: hostA:~$ docker attach @@ -124,7 +124,7 @@ weave 提供了一些非常巧妙的特性,我在这里作下简单的介绍 ![](https://farm8.staticflickr.com/7639/16247212144_c31a49714d_c.jpg) -现在这个容器可以与 10.10.0.0/24 网络上的其它容器进行通信了。当你要把容器加入一个网络,而这个网络暂时不可用时,上面的步骤就很有帮助了。 +现在这个容器可以与 10.10.0.0/24 网络上的其它容器进行通信了。这在当你创建一个容器而网络信息还不确定时就很有帮助了。 #### 将 weave 网络与宿主机网络整合起来 #### @@ -134,13 +134,13 @@ weave 提供了一些非常巧妙的特性,我在这里作下简单的介绍 hostA:~$ sudo weave expose 10.0.0.100/24 -这个命令把 IP 地址 10.0.0.100 分配给宿主机 hostA,这样一来 hostA 也连到了 10.0.0.0/24 网络上了。很明显,你在为宿主机选择 IP 地址的时候,需要选一个没有被其他容器使用的地址。 +这个命令把 IP 地址 10.0.0.100 分配给宿主机 hostA,这样一来宿主机 hostA 也连到了 10.0.0.0/24 网络上了。显然,你在为宿主机选择 IP 地址的时候,需要选一个没有被其他容器使用的地址。 现在 hostA 就可以访问 10.0.0.0/24 上的所有容器了,不管这些容器是否位于 hostA 上。好巧妙的设定啊,32 个赞! ### 总结 ### -如你所见,weave 是一个很有用的 docker 网络配置工具。这个教程只是[它强悍功能][5]的冰山一角。如果你想进一步玩玩,你可以试试它的以下功能:多跳路由功能,这个在 multi-cloud 环境(LCTT 注:多云,企业使用多个不同的云服务提供商的产品,比如 IaaS 和 SaaS,来承载不同的业务)下还是很有用的;动态重路由功能是一个很巧妙的容错技术;或者它的分布式 DNS 服务,它允许你为你的容器命名。如果你决定使用这个好东西,欢迎分享你的使用心得。 +如你所见,weave 是一个很有用的 docker 网络配置工具。这个教程只是它[强悍功能][5]的冰山一角。如果你想进一步玩玩,你可以试试它的以下功能:多跳路由功能,这个在 multi-cloud 环境(LCTT 译注:多云,企业使用多个不同的云服务提供商的产品,比如 IaaS 和 SaaS,来承载不同的业务)下还是很有用的;动态重路由功能是一个很巧妙的容错技术;或者它的分布式 DNS 服务,它允许你为你的容器命名。如果你决定使用这个好东西,欢迎分享你的使用心得。 -------------------------------------------------------------------------------- From a73979b7f8589bf096efd86edda67678e327e5d6 Mon Sep 17 00:00:00 2001 From: wwy Date: Tue, 2 Jun 2015 15:30:16 +0800 Subject: [PATCH 237/965] Update 20150211 Protect Apache Against Brute Force or DDoS Attacks Using Mod_Security and Mod_evasive Modules.md --- ...DDoS Attacks Using Mod_Security and Mod_evasive Modules.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150211 Protect Apache Against Brute Force or DDoS Attacks Using Mod_Security and Mod_evasive Modules.md b/sources/tech/20150211 Protect Apache Against Brute Force or DDoS Attacks Using Mod_Security and Mod_evasive Modules.md index 29bb770e5d..325aad1068 100644 --- a/sources/tech/20150211 Protect Apache Against Brute Force or DDoS Attacks Using Mod_Security and Mod_evasive Modules.md +++ b/sources/tech/20150211 Protect Apache Against Brute Force or DDoS Attacks Using Mod_Security and Mod_evasive Modules.md @@ -1,3 +1,5 @@ +translating by wwy-hust + Protect Apache Against Brute Force or DDoS Attacks Using Mod_Security and Mod_evasive Modules ================================================================================ For those of you in the hosting business, or if you’re hosting your own servers and exposing them to the Internet, securing your systems against attackers must be a high priority. @@ -267,4 +269,4 @@ via: http://www.tecmint.com/protect-apache-using-mod_security-and-mod_evasive-on [4]:https://www.owasp.org/index.php/Category:OWASP_ModSecurity_Core_Rule_Set_Project [5]:https://github.com/SpiderLabs/ModSecurity/wiki/Reference-Manual#Configuration_Directives [6]:https://www.modsecurity.org/ -[7]:http://www.zdziarski.com/blog/?page_id=442 \ No newline at end of file +[7]:http://www.zdziarski.com/blog/?page_id=442 From 98a9939762e13e70cdb70b3426a23f6183d4b83d Mon Sep 17 00:00:00 2001 From: DeadFire Date: Tue, 2 Jun 2015 15:57:25 +0800 Subject: [PATCH 238/965] =?UTF-8?q?20150602-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...e OpenVPN Server-Client on Ubuntu 15.04.md | 305 ++++++++++++++++++ 1 file changed, 305 insertions(+) create mode 100644 sources/tech/20150602 Howto Configure OpenVPN Server-Client on Ubuntu 15.04.md diff --git a/sources/tech/20150602 Howto Configure OpenVPN Server-Client on Ubuntu 15.04.md b/sources/tech/20150602 Howto Configure OpenVPN Server-Client on Ubuntu 15.04.md new file mode 100644 index 0000000000..062a87b211 --- /dev/null +++ b/sources/tech/20150602 Howto Configure OpenVPN Server-Client on Ubuntu 15.04.md @@ -0,0 +1,305 @@ +Howto Configure OpenVPN Server-Client on Ubuntu 15.04 +================================================================================ +Virtual private network (VPN) is a common name of several technologies which allows to establish a network connection over other network. It called virtual because nodes connected between each over through non physical lines. And it is private due to absence of public access to network without proper rights from of the network owner. + +![](http://blog.linoxide.com/wp-content/uploads/2015/05/vpn_custom_illustration.jpg) + +[OpenVPN][1] software transfer data using TCP and UDP protocols and with help of TUN/TAP drivers. UDP protocol and TUN driver allows to establish connection to OpenVPN server for clients behind NAT. Additionally OpenVPN allows to specify custom port. It provide additional flexibility of configuration and may help in avoiding of firewall restrictions. + +Security and encryption in OpenVPN provided by library OpenSSL and by Transport Layer Security (TLS). TLS is an improved version of SSL protocol. + +OpenSSL provide two kinds of encryption: symmetric and asymmetric. Below we show how to configure server side of OpenVPN and how to make all preparations for use asymmetric cryptography and TLS protocol with Public Key Infrastructure (PKI). + +### Server side configuration ### + +First of all we must install OpenVPN. In Ubuntu 15.04 and other Unix systems with 'apt' package manager this can be done as follows: + + sudo apt-get install openvpn + +Then we must setup a keys. This can be done using default tools "openssl". But this way is rather difficult. That is why we can use "easy-rsa" for this purpose. Next command installs the "easy-rsa" into our system + + sudo apt-get unstall easy-rsa + +**Remark**: all next commands executed with superuser rights, i.e. after command "sudo -i"; otherwise you can use "sudo -E" as prefix for all next commands. + +For beginning we need to copy "easy-rsa" into openvpn folder + + mkdir /etc/openvpn/easy-rsa + cp -r /usr/share/easy-rsa /etc/openvpn/easy-rsa + mv /etc/openvpn/easy-rsa/easy-rsa /etc/openvpn/easy-rsa/2.0 + +and goes into it + + cd /etc/openvpn/easy-rsa/2.0 + +Here we start a process of key generation. + +Firstly we edit a "var" file. For simplify generation process we need to specify our data in it. Here is an example of "var" file: + + export KEY_COUNTRY="US" + export KEY_PROVINCE="CA" + export KEY_CITY="SanFrancisco" + export KEY_ORG="Fort-Funston" + export KEY_EMAIL="my@myhost.mydomain" + export KEY_OU=server + +Hope, field names is clear and there is no need of additional description of them. + +Secondly we need to copy the openssl config. There is config from different version. If you haven't any certain requirement use last version of it. This is a 1.0.0 version. + + cp openssl-1.0.0.cnf openssl.cnf + +Thirdly we need load environment variables, which we edited on previous step + + source ./vars + +Final step of preparation for key generation is in flushing of old certificates and keys and in generation of serial and index files for new keys. This can be done by using command + + ./clean-all + +Now we finish preparation and ready to start generation process. Lets generate certificate first + + ./build-ca + +In dialog we see default variants, which we specified in "vars" file before. We may check them, edit if needed and then press ENTER couple of times. Dialog looks as follows + + Generating a 2048 bit RSA private key + .............................................+++ + ...................................................................................................+++ + writing new private key to 'ca.key' + ----- + You are about to be asked to enter information that will be incorporated + into your certificate request. + What you are about to enter is what is called a Distinguished Name or a DN. + There are quite a few fields but you can leave some blank + For some fields there will be a default value, + If you enter '.', the field will be left blank. + ----- + Country Name (2 letter code) [US]: + State or Province Name (full name) [CA]: + Locality Name (eg, city) [SanFrancisco]: + Organization Name (eg, company) [Fort-Funston]: + Organizational Unit Name (eg, section) [MyOrganizationalUnit]: + Common Name (eg, your name or your server's hostname) [Fort-Funston CA]: + Name [EasyRSA]: + Email Address [me@myhost.mydomain]: + +Next we need to generate a server key + + ./build-key-server server + +Dialog of this command is shown below: + + Generating a 2048 bit RSA private key + ........................................................................+++ + ............................+++ + writing new private key to 'server.key' + ----- + You are about to be asked to enter information that will be incorporated + into your certificate request. + What you are about to enter is what is called a Distinguished Name or a DN. + There are quite a few fields but you can leave some blank + For some fields there will be a default value, + If you enter '.', the field will be left blank. + ----- + Country Name (2 letter code) [US]: + State or Province Name (full name) [CA]: + Locality Name (eg, city) [SanFrancisco]: + Organization Name (eg, company) [Fort-Funston]: + Organizational Unit Name (eg, section) [MyOrganizationalUnit]: + Common Name (eg, your name or your server's hostname) [server]: + Name [EasyRSA]: + Email Address [me@myhost.mydomain]: + + Please enter the following 'extra' attributes + to be sent with your certificate request + A challenge password []: + An optional company name []: + Using configuration from /etc/openvpn/easy-rsa/2.0/openssl-1.0.0.cnf + Check that the request matches the signature + Signature ok + The Subject's Distinguished Name is as follows + countryName :PRINTABLE:'US' + stateOrProvinceName :PRINTABLE:'CA' + localityName :PRINTABLE:'SanFrancisco' + organizationName :PRINTABLE:'Fort-Funston' + organizationalUnitName:PRINTABLE:'MyOrganizationalUnit' + commonName :PRINTABLE:'server' + name :PRINTABLE:'EasyRSA' + emailAddress :IA5STRING:'me@myhost.mydomain' + Certificate is to be certified until May 22 19:00:25 2025 GMT (3650 days) + Sign the certificate? [y/n]:y + 1 out of 1 certificate requests certified, commit? [y/n]y + Write out database with 1 new entries + Data Base Updated + +Here we must answer "yes" on last two questions about "sign the certificate" and about "commit". + +Now we have certificate and server key. Next step is to generate Diffie-Hellman key. Execute the below command and be patient. During next couple minutes we will see a lots of dots and pluses symbols. + + ./build-dh + +Example of the output of this command you can find below + + Generating DH parameters, 2048 bit long safe prime, generator 2 + This is going to take a long time + ................................+................ + +After a long wait we can move to generation of the last key. This is key for TLS-authentication. Here is a command for it: + + openvpn --genkey --secret keys/ta.key + +Now, generation completed and we can move all generated files to the final location. + + cp -r /etc/openvpn/easy-rsa/2.0/keys/ /etc/openvpn/ + +Finally we create OpenVPN configuration file. Let's copy it from example: + + cp /usr/share/doc/openvpn/examples/sample-config-files/server.conf.gz /etc/openvpn/ + cd /etc/openvpn + gunzip -d /etc/openvpn/server.conf.gz + +Then edit it + + vim /etc/openvpn/server.conf + +We need to specify custom paths to keys + + ca /etc/openvpn/keys/ca.crt + cert /etc/openvpn/keys/server.crt + key /etc/openvpn/keys/server.key # This file should be kept secret + dh /etc/openvpn/keys/dh2048.pem + +That's all. After restart of OpenVPN configuration of server side is complete. + + service openvpn restart + +### Client side configuration for Unix ### + +Suppose we have a device with Unix like operation system, for example Ubuntu 15.04, and with installed OpenVPN. We want to connect to OpenVPN server from previous section. Firstly we need a key for the client. For generation of this key go to folder on server: + + cd /etc/openvpn/easy-rsa/2.0 + +Load environment variables + + source vars + +and create a client key + + ./build-key client + +We will see a same dialog as described in previous section on part about server key generation. Fill actual information about client in it. + +You need run other command in case of requirement of password protect key. Here it is + + ./build-key-pass client + +In this case you will be prompted to input password in beginning of establishing of VPN connection. + +Now we need to copy follows files from server to client into /etc/openvpn/keys/ folder. + +List of files from server: + +- ca.crt, +- dh2048.pem, +- client.crt, +- client.key, +- ta.key. + +After that we go to the client and prepare configuration file. Location of file is /etc/openvpn/client.conf and content of it presents below + + dev tun + proto udp + + # IP and Port of remote host with OpenVPN server + remote 111.222.333.444 1194 + + resolv-retry infinite + + ca /etc/openvpn/keys/ca.crt + cert /etc/openvpn/keys/client.crt + key /etc/openvpn/keys/client.key + tls-client + tls-auth /etc/openvpn/keys/ta.key 1 + auth SHA1 + cipher BF-CBC + remote-cert-tls server + comp-lzo + persist-key + persist-tun + + status openvpn-status.log + log /var/log/openvpn.log + verb 3 + mute 20 + +After that we need to restart OpenVPN for accepting a new configuration. + + service openvpn restart + +That's it, the configuration of the client is over. + +### Client side configuration for Android ### + +Configuration of OpenVPN on Android devices is quite similar to configuration on Unix system. We need a pack with a configuration file, with a keys and with a certificates. Here is a list of them: + +- configuration file (.ovpn), +- ca.crt, +- dh2048.pem, +- client.crt, +- client.key. + +Client key can be generated by the same way as described in previous section. + +Configuration file has a follows content + + client tls-client + dev tun + proto udp + + # IP and Port of remote host with OpenVPN server + remote 111.222.333.444 1194 + + resolv-retry infinite + nobind + ca ca.crt + cert client.crt + key client.key + dh dh2048.pem + persist-tun + persist-key + + verb 3 + mute 20 + +All this files we must to move on SD-card of our device. + +Then we need to install [OpenVPN Connect][2]. + +Next configuration process is very simple: + + open setting of OpenVPN and select Import options + select Import Profile from SD card option + in opened window go to folder with prepared files and select .ovpn file + application offered us to create a new profile + tap on the Connect button and wait a second + +And thats all. Now our Android device has connection to our private network using secure VPN connection. + +### Conclusion ### + +So, initial configuration of OpenVPN takes a time, but it is compensated by easy clients configuration and the ability to connect from any device. Moreover OpenVPN provided a high security level and ability to connection from different places including clients located behind NAT. Therefore OpenVPN may equally well be used both at home and in enterprise. + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/ubuntu-how-to/configure-openvpn-server-client-ubuntu-15-04/ + +作者:[Ivan Zabrovskiy][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://linoxide.com/author/ivanz/ +[1]:https://openvpn.net/ +[2]:https://play.google.com/store/apps/details?id=net.openvpn.openvpn \ No newline at end of file From 4ac12f9e92abfc978f70127c197badf727160f60 Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 2 Jun 2015 17:07:15 +0800 Subject: [PATCH 239/965] PUB:20150326 A Peep into Process Management Commands in Linux @Vic020 --- ...to Process Management Commands in Linux.md | 62 +++++++++---------- 1 file changed, 30 insertions(+), 32 deletions(-) rename {translated/tech => published}/20150326 A Peep into Process Management Commands in Linux.md (53%) diff --git a/translated/tech/20150326 A Peep into Process Management Commands in Linux.md b/published/20150326 A Peep into Process Management Commands in Linux.md similarity index 53% rename from translated/tech/20150326 A Peep into Process Management Commands in Linux.md rename to published/20150326 A Peep into Process Management Commands in Linux.md index f8c92f871d..705ec14d6d 100644 --- a/translated/tech/20150326 A Peep into Process Management Commands in Linux.md +++ b/published/20150326 A Peep into Process Management Commands in Linux.md @@ -1,46 +1,44 @@ -12个进程管理命令 +12个进程管理命令介绍 ================================================================================ -每个程序在执行时叫进程。当程序是在存储中是可执行文件并且运行的时候,每个进程会被动态得分配系统资源,内存,安全属性和与之相关的状态。可以有多个进程关联同一个程序,并同时执行不会互相干扰。操作系统会有效地管理和追踪所有运行着的进程。 +执行中的程序在称作进程。当程序以可执行文件存放在存储中,并且运行的时候,每个进程会被动态得分配系统资源、内存、安全属性和与之相关的状态。可以有多个进程关联到同一个程序,并同时执行不会互相干扰。操作系统会有效地管理和追踪所有运行着的进程。 为了管理这些进程,用户应该能够: - 查看所有运行中的进程 - 查看进程消耗资源 -- 定位个别进程并且可以执行指定动作 +- 定位个别进程并且对其执行指定操作 - 改变进程的优先级 - 杀死指定进程 -- 限制进程的有效系统资源 -- 等 +- 限制进程可用的系统资源等 -Linux提供了许多命令给用户来高效掌控上述的操作。接下来,一个一个的来讲解下。 +Linux提供了许多命令来让用户来高效掌控上述的操作。接下来,一个一个的来讲解下。 ### 1. ps ### -'ps'是最基础浏览系统中的进程的命令。能列出系统中运行的进程,包括进程号,命令,CPU使用量,内存使用量等。下述选项可以得到更多有用的消息。 +'ps'是Linux 中最基础的浏览系统中的进程的命令。能列出系统中运行的进程,包括进程号、命令、CPU使用量、内存使用量等。下述选项可以得到更多有用的消息。 ps -a - 列出所有运行中/激活进程 ![Output of "ps -a" command](http://blog.linoxide.com/wp-content/uploads/2015/02/ps-a2.png) ps -ef |grep - 列出需要进程 - - ps -aux - 展示进程包括、终端(x)和用户(u)信息,如USER, PID, %CPU, %MEM等 + ps -aux - 显示进程信息,包括无终端的(x)和针对用户(u)的进程:如USER, PID, %CPU, %MEM等 ### 2. pstree ### -linux中,每一个进程都是由父进程创建的。此命令帮助可视化进程,通过显示进程树状图表展示进程间关系。如果使用pid了,那么树的根是pid。不然将会是init。 +linux中,每一个进程都是由其父进程创建的。此命令以可视化方式显示进程,通过显示进程的树状图来展示进程间关系。如果指定了pid了,那么树的根是该pid,不然将会是init(pid: 1)。 ![pstree](http://blog.linoxide.com/wp-content/uploads/2015/02/pstree.png) ### 3. top ### -‘top’是一个更加有用的命令,通过不同的进程所使用的资源可以监视系统。它提供实时的系统状态信息。显示进程的数据包括PID,进程用户,优先值,%CPU,%memory等。可以使用这些显示指示出资源使用量。 +‘top’是一个更加有用的命令,可以监视系统中不同的进程所使用的资源。它提供实时的系统状态信息。显示进程的数据包括 PID、进程属主、优先级、%CPU、%memory等。可以使用这些显示指示出资源使用量。 ![top](http://blog.linoxide.com/wp-content/uploads/2015/02/top.png) ### 4. htop ### -htop与top很类似,但是htop是交互式的模式进程查看器。它通过文字图像显示每一个CPU和内存使用量、swap使用量。上下键选择进程,F7和F8改变优先级,F9杀死进程。Htop不是系统默认,所以需要额外安装。 +htop与top很类似,但是htop是交互式的文本模式的进程查看器。它通过文字图形化地显示每一个进程的CPU和内存使用量、swap使用量。使用上下光标键选择进程,F7和F8改变优先级,F9杀死进程。Htop不是系统默认安装的,所以需要额外安装。 ![htop output](http://blog.linoxide.com/wp-content/uploads/2015/03/htop1.png) @@ -48,7 +46,7 @@ htop与top很类似,但是htop是交互式的模式进程查看器。它通过 通过nice命令的帮助,用户可以设置和改变进程的优先级。提高一个进程的优先级,内核会分配更多CPU时间片给这个进程。默认情况下,进程以0的优先级启动。进程优先级可以通过top命令显示的NI(nice value)列查看。 -进程优先级值的范围从-20到19。值越低,越优先。 +进程优先级值的范围从-20到19。值越低,优先级越高。 nice <优先值> <进程名> - 通过给定的优先值启动一个程序 @@ -56,17 +54,17 @@ htop与top很类似,但是htop是交互式的模式进程查看器。它通过 ![changed nice value of 'top'](http://blog.linoxide.com/wp-content/uploads/2015/02/top-nice.png) -上述命令例子,可以看到‘top’命令获得了-3的优先值。 +上述命令例子中,可以看到‘top’命令获得了-3的优先值。 ### 6. renice ### -renice命令类似nice命令。使用这个命令可以改变正在运行的进程优先值。注意,用户只能改变属于他们的进程的优先值。 +renice命令类似nice命令。使用这个命令可以改变正在运行的进程优先值。注意,用户只能改变属于他们自己的进程的优先值。 renice -n -p - 改变指定进程的优先值 ![renice command](http://blog.linoxide.com/wp-content/uploads/2015/02/renice2.png) -优先值初始化为0的3806号进程优先值已经变成了4. +初始优先值为0的3806号进程优先值已经变成了4. renice -u -g - 通过指定用户和组来改变进程优先值 @@ -76,7 +74,7 @@ renice命令类似nice命令。使用这个命令可以改变正在运行的进 ### 7. kill ### -这个命令通过发送信号结束进程。如果一个进程没有响应杀死命令,这也许就需要强制杀死,使用-9参数来执行。注意,使用强制杀死的时候一定要小心,因为没有机会确定是否写入完成、是否结束等。如果我们不知道进程PID或者打算用名字杀死进程时候,killall就能派上用场。 +这个命令用于发送信号来结束进程。如果一个进程没有响应杀死命令,这也许就需要强制杀死,使用-9参数来执行。注意,使用强制杀死的时候一定要小心,因为进程没有时机清理现场,也许写入文件没有完成。如果我们不知道进程PID或者打算用名字杀死进程时候,killall就能派上用场。 kill @@ -84,7 +82,7 @@ renice命令类似nice命令。使用这个命令可以改变正在运行的进 killall -9 - 杀死所有拥有同样名字的进程 -如果你使用kill,你需要知道进程ID号。pkill是类似的命令但只需要一个模式,如果进程名,进程拥有者等 +如果你使用kill,你需要知道进程ID号。pkill是类似的命令,但使用模式匹配,如进程名,进程拥有者等。 pkill <进程名> @@ -94,17 +92,17 @@ renice命令类似nice命令。使用这个命令可以改变正在运行的进 ### 8. ulimit ### -命令在控制系统资源在shell和进程上的分配量。对于系统管理员是最有用的,可以管理系统倾向和性能问题。限制资源大小可以确保重要进程持续运行,其他进程不会占用过多资源。 +该命令用于控制系统资源在shell和进程上的分配量。对于系统管理员是最有用的,可以管理重度使用和存在性能问题的系统。限制资源大小可以确保重要进程持续运行,其他进程不会占用过多资源。 ulimit -a - 显示当前用户关联的资源限制 ![ulimit -a](http://blog.linoxide.com/wp-content/uploads/2015/02/ulimit-a.png) - -f - 最大文件大小 + -f - 最大文件尺寸大小 -v - 最大虚拟内存大小(KB) - -n - 最大文件描述符加1 + -n - 增加最大文件描述符数量 -H : 改变和报告硬限制 @@ -114,13 +112,13 @@ renice命令类似nice命令。使用这个命令可以改变正在运行的进 ### 9. w ### -w提供正确登录的用户和其执行的进程的信息。显示信息头包含信息像现在时间,系统运行时长,登录用户总数,过去1,5,15分钟负载均衡数。 +w 提供当前登录的用户及其正在执行的进程的信息。显示信息头包含信息,如当前时间、系统运行时长、登录用户总数、过去的1,5,15分钟内的负载均衡数。 -基于这些用户信息,用户可以在终止进程前查看不属于他们的进程。 +基于这些用户信息,用户在终止不属于他们的进程时要小心。 !['w' command](http://blog.linoxide.com/wp-content/uploads/2015/02/w.png) -**who**是类似命令,提供列表,包含当前登录用户,系统启动时间,运行级别等。 +**who**是类似命令,提供当前登录用户列表、系统启动时间、运行级别等。 !['who' command](http://blog.linoxide.com/wp-content/uploads/2015/02/who.png) @@ -130,7 +128,7 @@ w提供正确登录的用户和其执行的进程的信息。显示信息头包 ### 10. pgrep ### -pgrep为"进程号全局正则匹配打印"。命令扫描当前运行进程,然后列出选择标准匹配出的进程ID到标准输出。对于通过名字检索进程号是很有用。 +pgrep的意思是"进程号全局正则匹配输出"。该命令扫描当前运行进程,然后按照命令匹配条件列出匹配结果到标准输出。对于通过名字检索进程号是很有用。 pgrep -u mint sh @@ -140,9 +138,9 @@ pgrep为"进程号全局正则匹配打印"。命令扫描当前运行进程, ### 11. fg , bg ### -有时,命令需要很长的时间才能执行完成。对于这种情况,我们使用‘bg’命令可以将任务放在后台执行,而是用‘fg’可以调到前台来使用。 +有时,命令需要很长的时间才能执行完成。对于这种情况,我们使用‘bg’命令可以将任务放在后台执行,而用‘fg’可以调到前台来使用。 -通过‘&’,我们后台启动一个程序: +我们可以通过‘&’在后台启动一个程序: find . -name *iso > /tmp/res.txt & @@ -152,7 +150,7 @@ pgrep为"进程号全局正则匹配打印"。命令扫描当前运行进程, ctrl+z - 挂起当前执行程序 - bg - 将程序发送到后台运行 + bg - 将程序放到后台运行 我们可以使用‘jobs’命令列出所有后台进程。 @@ -160,7 +158,7 @@ pgrep为"进程号全局正则匹配打印"。命令扫描当前运行进程, 使用‘fg’命令可以将后台程序调到前台执行。 - fg % + fg %进程id ![output of fg, bg and jobscommands](http://blog.linoxide.com/wp-content/uploads/2015/03/fg-bg-jobs.png) @@ -172,13 +170,13 @@ ipcs命令报告进程间通信设施状态。(共享内存,信号量和消 ipcs -p -m -下面屏幕截图列出了共享内存段的创建者ID和进程ID。 +下面屏幕截图列出了最近访问了共享内存段的进程的创建者的ID和进程ID。 ![ipcs command](http://blog.linoxide.com/wp-content/uploads/2015/03/ipcs.png) ### 总结 ### -总之 ,这些命令可以帮助管理员修复问题和改善性能。同样作为一名普通用户也需要解决进程间出现的问题。所以,熟悉如此繁多的命令,从能有效管理进程是行之有效。 +总之 ,这些命令可以帮助管理员修复问题和改善性能。同样作为一名普通用户也需要解决进程出现的问题。所以,熟悉如此繁多的命令,从能有效管理进程是行之有效。 -------------------------------------------------------------------------------- @@ -186,7 +184,7 @@ via: http://linoxide.com/linux-command/process-management-commands-linux/ 作者:[B N Poornima][a] 译者:[VicYu/Vic020](http://vicyu.net) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 From cd5aa96cccf4e0f4a499bebb8d14c75604da42f5 Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 2 Jun 2015 20:17:03 +0800 Subject: [PATCH 240/965] =?UTF-8?q?=E8=A1=A5=E5=85=85=E5=88=A0=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @wwy-hust --- ...nds for RPM Package Management in Linux.md | 289 ------------------ 1 file changed, 289 deletions(-) delete mode 100644 sources/tech/20150528 27 'DNF' Fork of Yum Commands for RPM Package Management in Linux.md diff --git a/sources/tech/20150528 27 'DNF' Fork of Yum Commands for RPM Package Management in Linux.md b/sources/tech/20150528 27 'DNF' Fork of Yum Commands for RPM Package Management in Linux.md deleted file mode 100644 index 2ada2ac4cd..0000000000 --- a/sources/tech/20150528 27 'DNF' Fork of Yum Commands for RPM Package Management in Linux.md +++ /dev/null @@ -1,289 +0,0 @@ -translating by wwy-hust - -27 ‘DNF’ (Fork of Yum) Commands for RPM Package Management in Linux -================================================================================ -DNF aka Dandified YUM is a next generation Package Manager for RPM based Distribution. It was first introduced in Fedora 18 and it is replaced [YUM utility][1] in recent release of Fedora 22. - -![](http://www.tecmint.com/wp-content/uploads/2015/05/linux-dnf-command-examples.jpg) - -DNF aims at improving the bottlenecks of YUM viz., Performance, Memory Usages, Dependency Resolution, Speed and lots of other factors. DNF does Package Management using RPM, libsolv and hawkey library. Though it does not come per-installed in CentOS and RHEL 7 you can yum, dnf and use it alongside the yum. - -You may like to read more about DNF here: - -- [Reasons Behind Replacing Yum with DNF][2] - -The latest stable release of DNF is 1.0 (at the time of writing of post) which was released on May 11, 2015. It (and all previous version of DNF) is mostly written in Python and is released under GPL v2 License. - -### Installation of DNF ### - -DNF in not available in the default repository of RHEL/CentOS 7. However Fedora 22 ships with DNF implemented officially. - -To install DNF on RHEL/CentOS systems, you need to first install and enable epel-release repository. - - # yum install epel-release - OR - # yum install epel-release -y - -Though it is not ethical to use ‘-y‘ with yum as it is recommended to see what is being installed in your system. However if this does not matter you much you may use ‘-y’ with yum to install everything automatically without user’s intervention. - -Next, install DNS package using yum command from epel-release repository. - - # yum install dnf - -After dnf installed successfully, it’s time to show you 27 practical usage of dnf commands with examples that will help you to manage packages in RPM based distribution easily and effectively. - -### 1. Check DNF Version ### - -Check the version of DNF installed on your System. - - # dnf --version - -![Check DNF Version](http://www.tecmint.com/wp-content/uploads/2015/05/Check-DNF-Version.gif) - -### 2. List Enabled DNF Repositories ### - -The option ‘repolist‘ with dnf command, will display all enabled repositories under your system. - - # dnf repolist - -![Check All Enabled Repositories](http://www.tecmint.com/wp-content/uploads/2015/05/Check-All-Enabled-Repositories.gif) - -### 3. List all Enabled and Disabled DNF Repositories ### - -The option ‘repolist all‘ will print all the enabled/disabled repositories under your system. - - # dnf repolist all - -![List All Enabled/Disabled Repositories](http://www.tecmint.com/wp-content/uploads/2015/05/Check-All-Repositories.gif) - -### 4. List all Available and Installed Packages using DNF ### - -The command “dnf list” will list all the available packages from all the repositories and installed packages on your Linux system. - - # dnf list - -![List All Packages using DNF](http://www.tecmint.com/wp-content/uploads/2015/05/List-All-Packages.png) - -### 5. List all Installed Packages using DNF ### - -While the “dnf list” command shows all the available/installed packages from all the repositories. However, you have the option to list only the installed packages using option “list installed” as shown below. - - # dnf list installed - -![List All Installed Packages](http://www.tecmint.com/wp-content/uploads/2015/05/List-Installed-Packages.png) - -### 6. List all Available Packages using DNF ### - -Similarly, the “list available” option, will list all the packages available to be installed from all the enabled repositories. - - # dnf list available - -![List Available Packages using DNF](http://www.tecmint.com/wp-content/uploads/2015/05/List-Available-Packages.png) - -### 7. Search for a Package using DNF ### - -If incase, you’ve no idea about the package that you want install, in such situation you may use ‘search‘ option with dnf command to search for the package that matches the word or string (say nano). - - # dnf search nano - -![Search Package by Word](http://www.tecmint.com/wp-content/uploads/2015/05/Search-Package.gif) - -### 8. See what Provides a file/sub-package? ### - -The dnf option “provides” find the name of the package that provides specific file/sub-package. For example, if you would like to find what provides ‘/bin/bash‘ on your system? - - # dnf provides /bin/bash - -![Find File Sub Package](http://www.tecmint.com/wp-content/uploads/2015/05/Find-Package-Sub-Package.gif) - -### 9. Get Details of a Package using DNF ### - -Let’s assume you want to know the information of a package before installing it on the system, you may use “info” switch to get a detailed information about a package (say nano) as below. - - # dnf info nano - -![Check Package Information with DNF](http://www.tecmint.com/wp-content/uploads/2015/05/Check-Package-Information.gif) - -### 10. Install a Package with DNF ### - -To install a package called nano, just run the below command it will automatically resolve and install all required dependencies for package nano. - - # dnf install nano - -![Install Package using DNF](http://www.tecmint.com/wp-content/uploads/2015/05/Install-Package-DNF.gif) - -### 11. Updating a Package using DNF ### - -You may update only a specific package (say systemd) and leave everything on the system untouched. - - # dnf update systemd - -![Update a Specific Package](http://www.tecmint.com/wp-content/uploads/2015/05/Update-a-Package.gif) - -### 12. Check for System Updates using DNF ### - -Check updates for all the system packages installed into the system simply as. - - # dnf check-update - -![Check For System Update](http://www.tecmint.com/wp-content/uploads/2015/05/Check-For-System-Update.gif) - -### 13. Update All System Packages using DNF ### - -You may update the whole system including all the installed packages with following commands. - - # dnf update - OR - # dnf upgrade - -![Update System](http://www.tecmint.com/wp-content/uploads/2015/05/Update-System.gif) - -### 14. Remove/Erase a Package using DNF ### - -To remove or erase any unwanted package (say nano), you may use “remove” or “erase” switch with dnf command to remove it. - - # dnf remove nano - OR - # dnf erase nano - -![Remove Package in Linux](http://www.tecmint.com/wp-content/uploads/2015/05/Remove-Package.gif) - -### 15. Remove Orphan Packages using DNF ### - -Those packages that were installed to satisfy dependency may be useless if not being used by other applications. To remove those orphan packages execute the below command. - - # dnf autoremove - -![Remove Orphan Packages](http://www.tecmint.com/wp-content/uploads/2015/05/Autoremove-Packages.gif) - -### 16. Remove Cached Packages using DNF ### - -A lot of time we encounter out-of-date headers and unfinished transactions which results into error while executing dnf. We may clean all the cached packages and headers containing remote package information simply by executing. - - # dnf clean all - -![Remove DNF Cache](http://www.tecmint.com/wp-content/uploads/2015/05/Remove-Cache-Packages.gif) - -### 17. Get Help on Specific DNF Command ### - -You may get help of any specific dnf command (say clean) just by executing the below command. - - # dnf help clean - -![Get DNF Command Help](http://www.tecmint.com/wp-content/uploads/2015/05/Help-on-DNF-Command.gif) - -### 18. List all DNF Commands and Options ### - -To list help on all available dnf commands and option simply type. - - # dnf help - -![Get Help on DNF Options](http://www.tecmint.com/wp-content/uploads/2015/05/DNF-Options.gif) - -### 19. View History of DNF ### - -You may call dnf history to look at the list of already executed dnf commands. This way you can be aware of what was installed/removed with time stamp. - - # dnf history - -![Check DNF History](http://www.tecmint.com/wp-content/uploads/2015/05/Check-DNF-History.gif) - -### 20. List all Group Packages ### - -The command “dnf grouplist” will print all available or installed packages, if nothing is mentioned, it will list all known groups. - - # dnf grouplist - -![List All Group Packages](http://www.tecmint.com/wp-content/uploads/2015/05/List-All-Group-Packages.gif) - -### 21. Install a Group Package using DNF ### - -To install a Group of packages bundled together as group package (say Educational Software) simply as. - - # dnf groupinstall 'Educational Software' - -![Install Group Packages](http://www.tecmint.com/wp-content/uploads/2015/05/Install-Group-Packages.gif) - -### 22. Update a Group Package ### - -Let’s update a Group Package (say Educational Software) by executing the below command. - - # dnf groupupdate 'Educational Software' - -![Update Group Package](http://www.tecmint.com/wp-content/uploads/2015/05/Update-Group-Package.gif) - -### 23. Remove a Group Package ### - -We can remove the group Package (say Educational Software) as. - - # dnf groupremove 'Educational Software' - -![Remove Group Package](http://www.tecmint.com/wp-content/uploads/2015/05/Remove-Group-Package.gif) - -### 24. Install a Package from Specific Repository ### - -DNF makes it possible to install any specific package (say phpmyadmin) from a repo (epel) as simply as, - - # dnf --enablerepo=epel install phpmyadmin - -![Install Package From Specific Repo](http://www.tecmint.com/wp-content/uploads/2015/05/Install-Package-From-Specific-Repo.gif) - -### 25. Synchronize Installed Packages to Stable Release ### - -The command “dnf distro-sync” will provides necessary options to synchronize all installed packages to most recent stable version available from any enabled repository. If no package is selected, all installed packages are synchronized. - - # dnf distro-sync - -![Synchronize Packages to Stable Version](http://www.tecmint.com/wp-content/uploads/2015/05/Synchronize-Packages.gif) - -### 26. Reinstall a Package ### - -The command “dnf reinstall nano” will reinstall an already installed package (say nano). - - # dnf reinstall nano - -![ReInstall Package](http://www.tecmint.com/wp-content/uploads/2015/05/Re-Install-Package.gif) - -### 27. Downgrade a Package ### - -The option “downgrade” will downgrades the named package (say acpid) to lower version if possible. - - # dnf downgrade acpid - -Sample Output - - Using metadata from Wed May 20 12:44:59 2015 - No match for available package: acpid-2.0.19-5.el7.x86_64 - Error: Nothing to do. - -**My observation**: DNF does not downgraded the package as it is supposed to. It has also been reported as bug. - -### Conclusion ### - -DNF is the upper state of the end of the art Package Manager YUM. It tends to do a lot of processing automatically which is not going to be praised by many experienced Linux System Administrator, as I believe. As a matter of example: - -- `--skip-broken` is not recognized by DNF and there is no alternative. -- There is nothing like ‘resolvedep‘ command however you may run dnf provides. -- There is no ‘deplist‘ command to find package dependency. -- You exclude a repo, means the exclusion apply on all operations, unlike yum which excludes those repos only at the time of install and updates, etc. - -Several Linux users are not happy the way Linux Ecosystem is moving. First [Systemd removed init system][3] v and now DNF will be replacing YUM sooner in Fedora 22 and later in RHEL and CentOS. - -What do you think? are distributions and the whole Linux ecosystem is not valuing it’s users and moving against their will. Also it is often said in IT industry – “Why fix, If not broken?”, and neither init System V is broken nor YUM. - -That’s all for now. Please let me know your valuable thoughts in the comments below. Like and share us and help us get spread. - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/dnf-commands-for-fedora-rpm-package-management/ - -作者:[Avishek Kumar][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.tecmint.com/author/avishek/ -[1]:http://www.tecmint.com/20-linux-yum-yellowdog-updater-modified-commands-for-package-mangement/ -[2]:http://www.tecmint.com/dnf-next-generation-package-management-utility-for-linux/ -[3]:http://www.tecmint.com/systemd-replaces-init-in-linux/ From 559efb585d2be1b7f046818c866ab098dc9bad99 Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 2 Jun 2015 20:36:32 +0800 Subject: [PATCH 241/965] PUB:20150413 How to Show Dialog Box from Bash Shell Script with Examples @ictlyh --- ...ox from Bash Shell Script with Examples.md | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) rename {translated/tech => published}/20150413 How to Show Dialog Box from Bash Shell Script with Examples.md (80%) diff --git a/translated/tech/20150413 How to Show Dialog Box from Bash Shell Script with Examples.md b/published/20150413 How to Show Dialog Box from Bash Shell Script with Examples.md similarity index 80% rename from translated/tech/20150413 How to Show Dialog Box from Bash Shell Script with Examples.md rename to published/20150413 How to Show Dialog Box from Bash Shell Script with Examples.md index e115f85772..789a56688d 100644 --- a/translated/tech/20150413 How to Show Dialog Box from Bash Shell Script with Examples.md +++ b/published/20150413 How to Show Dialog Box from Bash Shell Script with Examples.md @@ -1,6 +1,7 @@ -如何在Bash Shell脚本中显示对话框以及事例 +如何在Bash Shell脚本中显示对话框 ================================================================================ -这个教程给出几个如何使用类似zenity和whiptail的工具在Bash Shell 脚本中提供消息/对话框的例子。使用这些工具,你的脚本能够告知用户当前程序运行的状态以及有与其交互的能力。这两个工具的不同之处在于显示消息框或者对话框的方式。Zenity用GTK工具包创建图形用户界面,而whiptail在终端内部创建消息框。 + +这个教程给出几个如何使用类似zenity和whiptail的工具在Bash Shell 脚本中提供消息/对话框的例子。使用这些工具,你的脚本能够告知用户当前程序运行的状态并能与用户进行交互。这两个工具的不同之处在于显示消息框或者对话框的方式。Zenity用GTK工具包创建图形用户界面,而whiptail则在终端窗口内创建消息框。 ### Zenity 工具 ### @@ -8,21 +9,21 @@ sudo apt-get install zenity -由于用zenity创建消息框或者对话框的命令是相当自解释的,我们会给你提供一些例子。 +用zenity创建消息框或者对话框的命令是不言自明的,我们会给你提供一些例子来参考。 ### 创建消息框 ### -zenity --info --title "Information Box" --text "This should be information" --width=300 --height=200 + zenity --info --title "Information Box" --text "This should be information" --width=300 --height=200 ![消息框截图](http://blog.linoxide.com/wp-content/uploads/2015/03/Screenshot-Information-Box.png) -创建 Yes/No 对话框 +创建 Yes/No 询问对话框 zenity --question --text "Do you want this?" --ok-label "Yeah" --cancel-label="Nope" ![问题截图](http://blog.linoxide.com/wp-content/uploads/2015/03/Screenshot-Question.png) -创建输入框并在变量中保存值 +创建输入框并将输入值保存到变量中 a=$(zenity --entry --title "Entry box" --text "Please enter the value" --width=300 --height=200) echo $a @@ -75,7 +76,7 @@ zenity --info --title "Information Box" --text "This should be information" --wi 信息框 -别忘了查看也许能帮助到你的有用的[zenity 选项][1] +别忘了查看也许能帮助到你的有用的[zenity 选项][1]。 ### Whiptail 工具 ### @@ -83,7 +84,7 @@ zenity --info --title "Information Box" --text "This should be information" --wi sudo apt-get install whiptail -用whiptail创建消息框或者对话框的命令也是相当自解释的,我们会给你提供一些基本例子。 +用whiptail创建消息框或者对话框的命令也是无需解释的,我们会给你提供一些基本例子作为参考。 ### 创建消息框 ### @@ -103,7 +104,7 @@ zenity --info --title "Information Box" --text "This should be information" --wi ![whiptail输入框截图](http://blog.linoxide.com/wp-content/uploads/2015/03/Screenshot-whiptail-entry.png) -尝试使用输入值要注意的一点是whiptail用stdout显示对话框,用stderr输出值。那样的话,如果你用 var=$(...),你不会看到对话框,也不能获得输入的值。解决方法是交换stdout和stderr。在whiptail命令后面添加 **3>&1 1>&2 2>&3** 就可以做到。你想获取输入值的任何whiptail命令也是如此。 +尝试使用输入值要注意的一点是whiptail用stdout显示对话框,用stderr输出值。这样的话,如果你用 var=$(...),你就根本不会看到对话框,也不能获得输入的值。解决方法是交换stdout和stderr。在whiptail命令后面添加 **3>&1 1>&2 2>&3** 就可以做到。你想获取输入值的任何whiptail命令也是如此。 ### 创建菜单对话框 ### @@ -157,7 +158,7 @@ zenity --info --title "Information Box" --text "This should be information" --wi ### 结论 ### -选择合适的工具显示对话框取决于你期望在桌面机器还是服务器上运行你的脚本。桌面机器用户通常使用窗口环境,更可能用显示的窗口运行脚本和交互。然而,如果你期望用户是在服务器上工作的,你也许会希望安全地显示,并使用whiptail或者任何其它在纯终端窗口显示对话框的工具。 +选择合适的工具显示对话框取决于你期望在桌面机器还是服务器上运行你的脚本。桌面机器用户通常使用GUI窗口环境,也可能运行脚本并与显示的窗口进行交互。然而,如果你期望用户是在服务器上工作的,(在没有图形界面时,)你也许希望能确保总能显示,那就使用whiptail或者任何其它在纯终端窗口显示对话框的工具。 -------------------------------------------------------------------------------- @@ -165,7 +166,7 @@ via: http://linoxide.com/linux-shell-script/bash-shell-script-show-dialog-box/ 作者:[Ilija Lazarevic][a] 译者:[ictlyh](https://github.com/ictlyh) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 From 603464c095fff41ff5767ded953b5e17ad8d39df Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 2 Jun 2015 21:49:32 +0800 Subject: [PATCH 242/965] PUB:20150330 How to Serve Git Repositories Using Gitblit Tool in Linux @wwy-hust --- ...epositories Using Gitblit Tool in Linux.md | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) rename {translated/tech => published}/20150330 How to Serve Git Repositories Using Gitblit Tool in Linux.md (75%) diff --git a/translated/tech/20150330 How to Serve Git Repositories Using Gitblit Tool in Linux.md b/published/20150330 How to Serve Git Repositories Using Gitblit Tool in Linux.md similarity index 75% rename from translated/tech/20150330 How to Serve Git Repositories Using Gitblit Tool in Linux.md rename to published/20150330 How to Serve Git Repositories Using Gitblit Tool in Linux.md index 45c09f3475..ef30371412 100644 --- a/translated/tech/20150330 How to Serve Git Repositories Using Gitblit Tool in Linux.md +++ b/published/20150330 How to Serve Git Repositories Using Gitblit Tool in Linux.md @@ -1,18 +1,18 @@ -如何在Linux下使用Gitblit工具创建Git仓库服务 +如何在Linux下使用Gitblit工具创建Git仓库服务 ================================================================================ -嗨!朋友,今天我们将学习如何在你的Linux服务器或者PC上安装Gitblit工具。首先,我们看看什么是Git,它的功能以及安装Gitblit的步骤。[Git是分布式版本控制系统][1],它强调速度、数据一致性,并且支持分布式、非线性工作流。它最初由Linus Torvalds在2005年为Linux内核设计和开发,使用GPL2证书,并因此成为软件开发中使用最广泛的版本控制系统。 +嗨!朋友,今天我们将学习如何在你的Linux服务器或者PC上安装Gitblit工具。首先,我们看看什么是Git,它的功能以及安装Gitblit的步骤。[Git是分布式版本控制系统][1],它强调速度、数据一致性,并且支持分布式、非线性工作流。它最初由Linus Torvalds在2005年为Linux内核设计和开发,使用GPLv2证书,并从此成为软件开发中使用最广泛的版本控制系统。 -[Gitblit是完全开源的软件][2],它基于纯粹的Java堆栈,被设计以在Git仓库速度和效率方面胜任从小型到极大型的项目。它很容易学习和上手,并有着闪电般的性能。它在廉价的本地分支、便于staging、多工作流等方面远胜过一些SCM(版本控制)工具,比如Subversion、CVS、Perforce和ClearCase。 +[Gitblit是完全开源的软件][2],它基于纯粹的Java堆栈,被设计以在Git仓库速度和效率方面胜任从小型到极大型的项目。它很容易学习和上手,并有着闪电般的性能。它在很多方面远胜 Subversion、CVS、Perforce和ClearCase等SCM(版本控制)工具,比如,如快速本地分支、易于暂存、多工作流等。 #### Gitblit的功能 #### -- 它可以做为一个无声的仓库视图,没有管理控制以及用户账户。 -- 它可以做为完整的Git堆栈,拥有clone, pushing和仓库存取控制。 -- 它能独立于其他Git工具使用(包括实际的Git),它能和您已创建的工具合作。 +- 它可以做为一个哑仓库视图,没有管理控制以及用户账户。 +- 它可以做为完整的Git服务,拥有克隆、推送和仓库访问控制。 +- 它能独立于其他Git工具使用(包括实际的Git),它能和您已有的工具协作。 ### 1.创建Gitblit安装目录 ### -首先我们将在我们的服务器上建立一个目录,我们将在该目录下安装最新的Gitblit。 +首先我们将在我们的服务器上建立一个目录,并在该目录下安装最新的Gitblit。 $ sudo mkdir -p /opt/gitblit @@ -28,7 +28,7 @@ ![下载gitblit安装包](http://blog.linoxide.com/wp-content/uploads/2015/01/downloading-gitblit.png) -接下来,我们将解压下载到的tarball压缩包至之前创建的目录 /opt/gitblit/ +接下来,我们将下载到的tar压缩包解压至之前创建的目录 /opt/gitblit/ $ sudo tar -zxvf gitblit-1.6.2.tar.gz @@ -42,7 +42,7 @@ 另一种是将gitblit添加为服务。下面是在linux下将gitblit添加为服务的步骤。 -由于我在使用Ubuntu,下面的命令将是 sudo cp service-ubuntu.sh /etc/init.d/gitblit。所以请根据你的发行版修改文件名service-ubuntu.sh为相应的你运行的发行版。 +由于我在使用Ubuntu,下面的命令将是 sudo cp service-ubuntu.sh /etc/init.d/gitblit,所以请根据你的发行版修改文件名service-ubuntu.sh为相应的你运行的发行版。 $ sudo ./install-service-ubuntu.sh @@ -50,13 +50,13 @@ ![启动gitblit服务](http://blog.linoxide.com/wp-content/uploads/2015/01/starting-gitblit-service.png) -在你的浏览器中打开http://localhost:8080或https://localhost:8443,也可以将localhost根据本地配置替换为IP地址。输入默认的管理员凭证:admin/admin并点击login按钮。 +在你的浏览器中打开`http://localhost:8080`或`https://localhost:8443`,也可以将localhost根据本地配置替换为IP地址。输入默认的管理员凭证:admin / admin并点击login按钮。 ![gitblit欢迎页面](http://blog.linoxide.com/wp-content/uploads/2015/01/gitblit-welcome.png) 现在,我们将添加一个新的用户。首先,你需要以admin用户登录,username = **admin**,password = **admin**。 -然后,点击 user icon > users > (+) new user 来创建一个新用户,如下图所示。 +然后,点击用户图标 > users > (+) new user 来创建一个新用户,如下图所示。 ![添加新用户](http://blog.linoxide.com/wp-content/uploads/2015/01/add-user.png) @@ -73,7 +73,7 @@ git remote add origin ssh://arunlinoxide@localhost:29418/linoxide.com.git git push -u origin master -请将用户名arunlinoxide替换为你添加的用户名。 +请将其中的用户名arunlinoxide替换为你添加的用户名。 #### 在命令行中push一个已存在的仓库 #### @@ -84,7 +84,7 @@ ### 结论 ### -欢呼吧!我们已经在Linux电脑中安装好了最新版本的Gitblit。接下来我们便可以在我们的大小工程中享受这样一个优美的版本控制系统。有了Gitblit,版本控制便再容易不过了。它有易于学习、轻量级、高性能的特点。因此,如果你有任何的问题、建议和反馈,请在留言处留言。 +欢呼吧!我们已经在Linux电脑中安装好了最新版本的Gitblit。接下来我们便可以在我们的大小项目中享受这样一个优美的版本控制系统。有了Gitblit,版本控制便再容易不过了。它有易于学习、轻量级、高性能的特点。因此,如果你有任何的问题、建议和反馈,请在留言处留言。 -------------------------------------------------------------------------------- @@ -92,7 +92,7 @@ via: http://linoxide.com/linux-how-to/serve-git-repositories-gitblit/ 作者:[Arun Pyasi][a] 译者:[wwy-hust](https://github.com/wwy-hust) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 From 6543de8a748170c10ee20bf4a16964082d1d0d2f Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 2 Jun 2015 22:14:33 +0800 Subject: [PATCH 243/965] PUB:20150331 How to Install WordPress with Nginx in a Docker Container @ictlyh --- ...dPress with Nginx in a Docker Container.md | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) rename {translated/tech => published}/20150331 How to Install WordPress with Nginx in a Docker Container.md (86%) diff --git a/translated/tech/20150331 How to Install WordPress with Nginx in a Docker Container.md b/published/20150331 How to Install WordPress with Nginx in a Docker Container.md similarity index 86% rename from translated/tech/20150331 How to Install WordPress with Nginx in a Docker Container.md rename to published/20150331 How to Install WordPress with Nginx in a Docker Container.md index 849dd4a853..e24767bd84 100644 --- a/translated/tech/20150331 How to Install WordPress with Nginx in a Docker Container.md +++ b/published/20150331 How to Install WordPress with Nginx in a Docker Container.md @@ -1,6 +1,7 @@ -如何在 Docker 容器里的 Nginx 中安装 WordPress +如何在 Docker 容器中架设一个完整的 WordPress 站点 ================================================================================ -大家好,今天我们来学习一下如何在 Docker 容器上运行的 Nginx Web 服务器中安装 WordPress。WordPress 是一个很好的免费开源的内容管理系统,全球成千上万的网站都在使用它。[Docker][1] 是一个提供开放平台来打包,分发和运行任何应用的开源轻量级容器项目。它没有语言支持,框架或打包系统的限制,可以在从小的家用电脑到高端服务器的任何地方任何时间运行。这让它们成为可以用于部署和扩展网络应用,数据库和后端服务而不必依赖于特定的栈或者提供商的很好的构建块。 + +大家好,今天我们来学习一下如何在 Docker 容器里运行的 Nginx Web 服务器中安装 WordPress。WordPress 是一个很好的免费开源的内容管理系统,全球成千上万的网站都在使用它。[Docker][1] 是一个开源项目,提供了一个可以打包、装载和运行任何应用的轻量级容器的开放平台。它没有语言支持、框架和打包系统的限制,从小型的家用电脑到高端服务器,在何时何地都可以运行。这使它们可以不依赖于特定软件栈和供应商,像一块块积木一样部署和扩展网络应用、数据库和后端服务。 今天,我们会在 docker 容器上部署最新的 WordPress 软件包,包括需要的前提条件,例如 Nginx Web 服务器、PHP5、MariaDB 服务器等。下面是在运行在 Docker 容器上成功安装 WordPress 的简单步骤。 @@ -14,13 +15,13 @@ # systemctl restart docker.service -### 2. 创建 WordPress Docker 文件 ### +### 2. 创建 WordPress 的 Dockerfile ### -我们需要创建用于自动安装 wordpress 以及前提条件的 docker 文件。这个 docker 文件将用于构建 WordPress 的安装镜像。这个 WordPress docker 文件会从 Docker 库中心获取 CentOS 7 镜像并用最新的可用更新升级系统。然后它会安装必要的软件,例如 Nginx Web 服务器、PHP、MariaDB、Open SSH 服务器以及其它保证 Docker 容器正常运行不可缺少的组件。最后它会执行一个初始化 WordPress 安装的脚本。 +我们需要创建用于自动安装 wordpress 以及其前置需求的 Dockerfile。这个 Dockerfile 将用于构建 WordPress 的安装镜像。这个 WordPress Dockerfile 会从 Docker Registry Hub 获取 CentOS 7 镜像并用最新的可用更新升级系统。然后它会安装必要的软件,例如 Nginx Web 服务器、PHP、MariaDB、Open SSH 服务器,以及其它保证 Docker 容器正常运行不可缺少的组件。最后它会执行一个初始化 WordPress 安装的脚本。 # nano Dockerfile -然后,我们需要将下面的配置行添加到 Docker 文件中。 +然后,我们需要将下面的配置行添加到 Dockerfile中。 FROM centos:centos7 MAINTAINER The CentOS Project @@ -50,9 +51,9 @@ ![Wordpress Docker 文件](http://blog.linoxide.com/wp-content/uploads/2015/03/Dockerfile-wordpress.png) -### 3. 创建启动 script ### +### 3. 创建启动脚本 ### -我们创建了 docker 文件之后,我们需要创建用于运行和配置 WordPress 安装的脚本,名称为 start.sh。它会为 WordPress 创建并配置数据库和密码。用我们喜欢的文本编辑器打开 start.sh。 +我们创建了 Dockerfile 之后,我们需要创建用于运行和配置 WordPress 安装的脚本,名称为 start.sh。它会为 WordPress 创建并配置数据库和密码。用我们喜欢的文本编辑器打开 start.sh。 # nano start.sh @@ -86,7 +87,7 @@ } __handle_passwords() { - # 在这里我们生成随机密码(感谢 pwgen)。前面两个用于 mysql 用户,最后一个用于 wp-config.php 的随机密钥。 + # 在这里我们生成随机密码(多亏了 pwgen)。前面两个用于 mysql 用户,最后一个用于 wp-config.php 的随机密钥。 WORDPRESS_DB="wordpress" MYSQL_PASSWORD=`pwgen -c -n -1 12` WORDPRESS_PASSWORD=`pwgen -c -n -1 12` @@ -292,7 +293,7 @@ ### 5. 构建 WordPress 容器 ### -现在,完成了创建配置文件和脚本之后,我们终于要使用 docker 文件来创建安装最新的 WordPress CMS(译者注:Content Management System,内容管理系统)所需要的容器,并根据配置文件进行配置。做到这点,我们需要在对应的目录中运行以下命令。 +现在,完成了创建配置文件和脚本之后,我们终于要使用 Dockerfile 来创建安装最新的 WordPress CMS(译者注:Content Management System,内容管理系统)所需要的容器,并根据配置文件进行配置。做到这点,我们需要在对应的目录中运行以下命令。 # docker build --rm -t wordpress:centos7 . @@ -340,7 +341,7 @@ via: http://linoxide.com/linux-how-to/install-wordpress-nginx-docker-container/ 作者:[Arun Pyasi][a] 译者:[ictlyh](https://github.com/ictlyh) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 From 0c6aa99c92cfc4fe769e387b9ed482cfa4494a08 Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 2 Jun 2015 22:26:35 +0800 Subject: [PATCH 244/965] PUB:20150429 KDE Plasma 5.3 Released, Here' s How To Upgrade in Kubuntu 15.04 @GOLinux --- ...Here' s How To Upgrade in Kubuntu 15.04.md | 33 ++++++++++--------- 1 file changed, 17 insertions(+), 16 deletions(-) rename {translated/tech => published}/20150429 KDE Plasma 5.3 Released, Here' s How To Upgrade in Kubuntu 15.04.md (75%) diff --git a/translated/tech/20150429 KDE Plasma 5.3 Released, Here' s How To Upgrade in Kubuntu 15.04.md b/published/20150429 KDE Plasma 5.3 Released, Here' s How To Upgrade in Kubuntu 15.04.md similarity index 75% rename from translated/tech/20150429 KDE Plasma 5.3 Released, Here' s How To Upgrade in Kubuntu 15.04.md rename to published/20150429 KDE Plasma 5.3 Released, Here' s How To Upgrade in Kubuntu 15.04.md index 1e2a36a0a7..5dba39a1d3 100644 --- a/translated/tech/20150429 KDE Plasma 5.3 Released, Here' s How To Upgrade in Kubuntu 15.04.md +++ b/published/20150429 KDE Plasma 5.3 Released, Here' s How To Upgrade in Kubuntu 15.04.md @@ -1,7 +1,6 @@ - -KDE Plasma 5.3已发布,Kubuntu 15.04升级攻略 +在 Kubuntu 15.04 中升级 KDE Plasma 5.3 ================================================================================ -**KDE[已经宣布][1]Plasma 5.3的稳定版已经准备就绪,它包含了一个新的电源管理方面的稳定特性。** +**KDE[已经发布了][1]Plasma 5.3的稳定版,它包含了一个新的电源管理方面的稳定特性。** [先前四月份的beta版][2]已经让我们印象深刻,甚至跃跃欲试了,Plasma 5桌面环境的稳定版更新的最新更新已经稳定,并且可以下载了。 @@ -10,7 +9,8 @@ Plasma 5.3继续改善和细化了全新的KDE桌面,它添加了大量的特 ### Plasma 5.3中的新东西 ### ![Better Bluetooth Management in Plasma 5.3](http://www.omgubuntu.co.uk/wp-content/uploads/2015/04/bluetooth-applet-in-kde.jpg) -Plasma 5.3中更好的蓝牙管理 + +*Plasma 5.3中更好的蓝牙管理* 而[在早期关于Plasma 5.3的文章][3]中,我们触及了大量**新特性**,这其中很多都值得反复说道说道。 @@ -18,19 +18,21 @@ Plasma 5.3中更好的蓝牙管理 在连接了外部监视器的时候合上笔记本盖子时,不会再触发‘挂起’操作。这个新的行为被称之为‘**影院模式**’,并且默认开启。但是,可以通功过电源管理设置中的相关选项禁用。 -**蓝牙功能被改善**,带来了一个全新的面板小程序,使得在连接到并配置配对的蓝牙设备,如只能手机、键盘和扬声器时,比以往更为便捷。 +**蓝牙功能被改善**,带来了一个全新的面板小程序,使得在连接到并配置配对的蓝牙设备,如智能手机、键盘和扬声器时,比以往更为便捷。 同样,对于Plasma 5.3,**KDE中的轨迹板配置更为方便**,这多亏了新的安装和设置模块。 + ![Trackpad, Touchpad. Tomato, Tomayto.](http://www.omgubuntu.co.uk/wp-content/uploads/2015/04/touchpad-kde.jpg) -轨迹板、触控板。Tomato, Tomayto。 -对于Plasma小部件狂热者,带来了一个**按住并锁定**手势。当启用该功能,会隐藏移动鼠标时出现的设置处理。取而代之的是,它只会在长点击小部件时发生该行为。 +*轨迹板、触控板。Tomato, Tomayto。* -谈到widget-y这类事情时,该发布版中**再次引入了几个旧的Plasmoid最受欢迎的东西**,包括一个有用的系统监视器、便利的硬盘驱动器统计和一个漫画阅读器。 +对于Plasma小部件狂热者,它带来了一个**按住并锁定**手势。当启用该功能,会隐藏移动鼠标时出现的设置处理。取而代之的是,它只会在长点击小部件时发生该行为。 + +谈到widget-y这类事情时,该发布版中**再次引入了几个旧的Plasmoid中最受欢迎的东西**,包括一个有用的系统监视器、便利的硬盘驱动器统计和一个漫画阅读器。 ### 了解更多&尝试 ### -![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/04/plasma-5.3-beta.jpg\) +![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/04/plasma-5.3-beta.jpg) 一张全部内容的完整列表——我说全部内容——是指Plasma 5.3中[在官方修改日志中][4]列出的新的和改进的内容。 @@ -40,7 +42,7 @@ Plasma 5.3中更好的蓝牙管理 如果你需要超级稳定的系统,你可以使用这些镜像来尝试新特性,但是你可以继续使用你的主要计算机上与你的版本对应的KDE版本。 -但是,如果你对实验版满意——请阅:能够处理任何包冲突,或者由尝试升级桌面环境而导致的系统问题——那么你可以安装。 +不过,如果你对实验版满意——请注意:能够处理任何包冲突,或者由尝试升级桌面环境而导致的系统问题——那么你可以安装。 ### 安装Plasma 5.3到Kubuntu 15.04 ### @@ -52,20 +54,19 @@ Kubuntu移植PPA可能也会升级除了安装在你系统上的Plasma外的其 目前为止,使用命令行来升级Kubuntu中的到Plasma 5.3是最快速的方法: - sudo add-apt-repository ppa:kubuntu-ppa/backports - + sudo add-apt-repository ppa:kubuntu-ppa/backports sudo apt-get update && sudo apt-get dist-upgrade 在升级过程完成后,如果一切顺利,你应该重启计算机。 如果你正在使用一个备用桌面环境,比如LXDE、Unity或者GNOME,则你需要在运行完上面的两个命令后安装Kubuntu桌面包(你可以在Ubuntu软件中心找到)。 -To downgrade to the stock version of Plasma in 15.04 you can use the PPA-Purge tool: + +要降级到15.04中自带的 Plasma 版本的话,你可以使用 PPA-Purge 工具: sudo apt-get install ppa-purge - sudo ppa-purge ppa:kubuntu-ppa/backports -请在下面的评论中留言,让我们知道你怎么升级/测试过程是怎样的,别忘了告诉我们你在下一个Plasma 5桌面中要看到的特性。 +请在下面的评论中留言,让我们知道你怎么升级,测试过程是怎样的,别忘了告诉我们你在下一个Plasma 5桌面中要看到的特性。 -------------------------------------------------------------------------------- @@ -73,7 +74,7 @@ via: http://www.omgubuntu.co.uk/2015/04/kde-plasma-5-3-released-heres-how-to-upg 作者:[Joey-Elijah Sneddon][a] 译者:[GOLinux](https://github.com/GOLinux) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 From 755abbca2c78534113313e2494f77804434c3d85 Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 2 Jun 2015 22:35:56 +0800 Subject: [PATCH 245/965] PUB:20150413 Linux FAQs with Answers--How to compile ixgbe driver on CentOS, RHEL or Fedora @Vic020 --- ... ixgbe driver on CentOS, RHEL or Fedora.md | 23 ++++++++----------- 1 file changed, 10 insertions(+), 13 deletions(-) rename {translated/tech => published}/20150413 Linux FAQs with Answers--How to compile ixgbe driver on CentOS, RHEL or Fedora.md (90%) diff --git a/translated/tech/20150413 Linux FAQs with Answers--How to compile ixgbe driver on CentOS, RHEL or Fedora.md b/published/20150413 Linux FAQs with Answers--How to compile ixgbe driver on CentOS, RHEL or Fedora.md similarity index 90% rename from translated/tech/20150413 Linux FAQs with Answers--How to compile ixgbe driver on CentOS, RHEL or Fedora.md rename to published/20150413 Linux FAQs with Answers--How to compile ixgbe driver on CentOS, RHEL or Fedora.md index e5f8f6bcc7..52ce998473 100644 --- a/translated/tech/20150413 Linux FAQs with Answers--How to compile ixgbe driver on CentOS, RHEL or Fedora.md +++ b/published/20150413 Linux FAQs with Answers--How to compile ixgbe driver on CentOS, RHEL or Fedora.md @@ -1,17 +1,14 @@ -Linux 有问必答 -- 如何在红帽系linux中编译Ixgbe - +Linux 有问必答: 如何在红帽系linux中编译Ixgbe驱动 ================================================================================ > **提问**:我想要安装最新版的ixgbe 10G网卡驱动。在CentOS, Fedora 或 RHEL中,我应该如何编译ixgbe驱动? +想要在linux使用Intel的PCI Express 10G网卡(例如,82598,82599,x540),需要安装Ixgbe驱动。如今的Linux发行版都会预安装ixgbe的可加载模块,但是预安装的ixgbe驱动不是完整功能版。如果想要开启和定制所有10G网卡的功能(如,RSS、多队列、虚拟化功能、硬件 offload 等),需要从源码编译安装。 -想要在linux使用Intel的PCI Express 10G网卡(例如,82598,82599,x540),需要安装Ixgbe驱动。如今的Linux发行版都会欲安装ixgbe作为可加载模块,但是预安装的ixgbe驱动不是完整功能版。如果想要开启和定制所有10G网卡(如,RSS,多)的功能,需要源码编译安装。 - -本文基于红帽系平台(如,CentOS,RHEL或Fedora)。Debian系系统,请看[这篇文章][1] - +本文基于红帽系平台(如,CentOS,RHEL或Fedora)。Debian系平台,请看[这篇文章][1] ### 第一步: 安装依赖 ### -首先,安装必要的开发环境和安装匹配的内核头 +首先,安装必要的开发环境和安装匹配的内核头文件 $ sudo yum install gcc make $ sudo yum install kernel-devel @@ -22,7 +19,7 @@ Linux 有问必答 -- 如何在红帽系linux中编译Ixgbe $ wget http://downloads.sourceforge.net/project/e1000/ixgbe%20stable/3.23.2/ixgbe-3.23.2.tar.gz -确保检查支持内核版本。例如,Ixgbe3.23.2版本支持Linux内核版本2.6.18以上到3.18.1. +请检查支持的内核版本。例如,Ixgbe3.23.2版本支持Linux内核版本2.6.18到3.18.1。 提取压缩包并编译 @@ -30,7 +27,7 @@ Linux 有问必答 -- 如何在红帽系linux中编译Ixgbe $ cd ixgbe-3.23.2/src $ make -如果成功,编译完成的驱动(ixgbe.ko)可以在当前目录找到。 +如果成功,可以在当前目录找到编译完成的驱动(ixgbe.ko)。 可以运行这个命令来查看编译信息: @@ -44,7 +41,7 @@ Linux 有问必答 -- 如何在红帽系linux中编译Ixgbe 这步准备加载已经编译好的驱动。 -如果系统已经加载了Ixgbe驱动,首先需要卸载掉老版本。否者,新版本不能够加载。 +如果系统已经加载了Ixgbe驱动,首先需要卸载掉老版本。否则,新版本不能加载。 $ sudo rmmod ixgbe.ko @@ -178,7 +175,7 @@ ixgbe.ko将会安装在下列目录 /lib/modules//kernel/drivers/net/ixgbe -此时,编译完蛋程序将在启动时自动加载,也可以通过运行命令加载它: +此时,编译好的驱动将在启动时自动加载,也可以通过运行命令加载它: $ sudo modprobe ixgbe @@ -190,10 +187,10 @@ via: http://ask.xmodulo.com/compile-ixgbe-driver-centos-rhel-fedora.html 作者:[Dan Nanni][a] 译者:[Vic020](http://vicyu.net) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 [a]:http://ask.xmodulo.com/author/nanni -[1]:http://ask.xmodulo.com/download-install-ixgbe-driver-ubuntu-debian.html +[1]:https://linux.cn/article-5149-1.html [2]:http://sourceforge.net/projects/e1000/files/ixgbe%20stable/ From bd468f8dbd319bde639df0803aba356434b56e86 Mon Sep 17 00:00:00 2001 From: DeadFire Date: Wed, 3 Jun 2015 16:11:45 +0800 Subject: [PATCH 246/965] =?UTF-8?q?20150603-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...a Gorgeous GTK Theme for Linux Desktops.md | 52 ++++++ ... Beautiful Arc GTK+ Flat Theme on Linux.md | 61 +++++++ ...by on Rails using rbenv on Ubuntu 15.04.md | 152 ++++++++++++++++++ 3 files changed, 265 insertions(+) create mode 100644 sources/share/20150603 Arc Is a Gorgeous GTK Theme for Linux Desktops.md create mode 100644 sources/share/20150603 Here's How to Install the Beautiful Arc GTK+ Flat Theme on Linux.md create mode 100644 sources/tech/20150603 Installing Ruby on Rails using rbenv on Ubuntu 15.04.md diff --git a/sources/share/20150603 Arc Is a Gorgeous GTK Theme for Linux Desktops.md b/sources/share/20150603 Arc Is a Gorgeous GTK Theme for Linux Desktops.md new file mode 100644 index 0000000000..44433a3789 --- /dev/null +++ b/sources/share/20150603 Arc Is a Gorgeous GTK Theme for Linux Desktops.md @@ -0,0 +1,52 @@ +Arc Is a Gorgeous GTK Theme for Linux Desktops +================================================================================ +![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/06/arc-gtk-theme.jpg) + +It has been a veritable eon since we last highlighted a GTK theme here on this site. + +But seeing Arc, pictured above, rectifies that. + +We couldn’t not mention it. + +### Arc GTK Theme ### + +![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/06/see-through-theme.png) + +Transparency. Not to everyones’ taste. + +Arc is a flat theme with a subtle color scheme and transparency in select parts of the window, like GTK Header Bars and the Nautilus sidebar. + +The see through effect does not, as in themes we past, render the entire app a peek-a-boo mess. Like on OS X Yosemite, the effect is used sparingly and to great effect. + +A companion icon set (called Vertex, and pictured) is also in the works. + +**Yes, it supports Unity** + +The Arc theme supports GTK3 and GTK2 based desktop environments, including GNOME Shell (of course) and the standard Ubuntu Unity desktop. + +It also works just dandy with lightweight Budgie and elementary’s Pantheon desktops and should work fine on Cinnamon. + +![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/06/Screen-Shot-2015-06-02-at-18.07.15.png) + +Switches, sliders and widgets in Arc + +For all its style it is not the easiest theme to download and install — *understatement klaxon* — because it’s still under active development. + +The package requirements of GTK 3.14 or later also mean Ubuntu 14.04 LTS and 14.10 users are left out in the cold on this one. + +Those of you running Ubuntu 15.04 can use the theme. You can’t (yet) add a PPA or double-click a .Deb package. If you like what you see you’ll need to roll up your sleeves and check out the compile instructions on the project Github page. + +- [Arc Theme Install Instructions on Github][1] + +-------------------------------------------------------------------------------- + +via: http://www.omgubuntu.co.uk/2015/06/arc-gtk-theme + +作者:[Joey-Elijah Sneddon][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://plus.google.com/117485690627814051450/?rel=author +[1]:https://github.com/horst3180/Arc-theme \ No newline at end of file diff --git a/sources/share/20150603 Here's How to Install the Beautiful Arc GTK+ Flat Theme on Linux.md b/sources/share/20150603 Here's How to Install the Beautiful Arc GTK+ Flat Theme on Linux.md new file mode 100644 index 0000000000..7f6c36147a --- /dev/null +++ b/sources/share/20150603 Here's How to Install the Beautiful Arc GTK+ Flat Theme on Linux.md @@ -0,0 +1,61 @@ +Here's How to Install the Beautiful Arc GTK+ Flat Theme on Linux +================================================================================ +> Step-by-step tutorial with easy-to-follow instructions + +**Today we're introducing you to a newly released GTK+ theme that features transparent and flat elements and is compatible with multiple desktop environments and Linux distributions. [The theme is called Arc][1].** + +Before going into detail, we suggest that you take a quick look at the gallery attached below, so you have a basic idea of what the theme looks like. Also, you should be aware that it currently works with GTK+ 2.x, GTK+ 3.x, GNOME-Shell, Budgie, Unity, and Pantheon user interfaces, all of them using the GNOME Stack. + +Also, the developer of the Arc theme informs us that it has been successfully tested on the Ubuntu 15.04 (Vivid Vervet), Arch Linux, elementary OS 0.3 Freya, Fedora 21, Fedora 22, Debian GNU/Linux 8.0 (Jessie), Debian Testing, Debian Unstable, openSUSE 13.2, openSUSE Tumbleweed, and Gentoo Linux operating systems. + +### Requirements and installation instructions ### + +To build the Arc theme, you will need to first install some packages, such as autoconf, automake, pkg-config (pkgconfig for Fedora), libgtk-3-dev for Debian/Ubuntu-based distros or gtk3-devel for RPM-based ones, git, gtk2-engines-pixbuf, and gtk-engine-murrine (gtk-murrine-engine for Fedora). + +The Arc theme does not yet have binary packages, so you will need to grab the latest source code from the project's Git repository and compile it. Therefore, open a Terminal app and run the following commands, one by one, hitting the Enter key after each one and waiting for the previous command to finish before adding the next. + + git clone https://github.com/horst3180/arc-theme --depth 1 && cd arc-theme + git fetch --tags + git checkout $(git describe --tags `git rev-list --tags --max-count=1`) + ./autogen.sh --prefix=/usr + sudo make install + +That's it! At this moment, the Arc theme is currently installed on your GNU/Linux distribution and you can activate it using either the GNOME Tweak Tool utility if you're using GNOME or the Unity Tweak Tool software if you are running Ubuntu's Unity desktop. Have fun and don't forget to drop a screenshot with your setup in the comments section below. + +![](http://i1-news.softpedia-static.com/images/news2/Here-s-How-to-Install-the-Beautiful-Arc-GTK-plus-Flat-Theme-on-Linux-483143-2.jpg) + +![](http://i1-news.softpedia-static.com/images/news2/Here-s-How-to-Install-the-Beautiful-Arc-GTK-plus-Flat-Theme-on-Linux-483143-3.jpg) + +![](http://i1-news.softpedia-static.com/images/news2/Here-s-How-to-Install-the-Beautiful-Arc-GTK-plus-Flat-Theme-on-Linux-483143-4.jpg) + +-------------------------------------------------------------------------------- + +via: http://news.softpedia.com/news/Here-s-How-to-Install-the-Beautiful-Arc-GTK-plus-Flat-Theme-on-Linux-483143.shtml + +作者:[Marius Nestor][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://news.softpedia.com/editors/browse/marius-nestor +[1]:https://github.com/horst3180/Arc-theme +[2]: +[3]: +[4]: +[5]: +[6]: +[7]: +[8]: +[9]: +[10]: +[11]: +[12]: +[13]: +[14]: +[15]: +[16]: +[17]: +[18]: +[19]: +[20]: \ No newline at end of file diff --git a/sources/tech/20150603 Installing Ruby on Rails using rbenv on Ubuntu 15.04.md b/sources/tech/20150603 Installing Ruby on Rails using rbenv on Ubuntu 15.04.md new file mode 100644 index 0000000000..a4c5f61104 --- /dev/null +++ b/sources/tech/20150603 Installing Ruby on Rails using rbenv on Ubuntu 15.04.md @@ -0,0 +1,152 @@ +Installing Ruby on Rails using rbenv on Ubuntu 15.04 +================================================================================ +This article we will learn about how to Install Ruby on Rails with rbenv on Ubuntu 15.04. We choose Ubuntu as operating system because Ubuntu is one of Linux distribution that easy to use with a lots of package support and complete documentations , so I think this is the right choice. If you don't install the latest version Ubuntu yet, you can [download the ISO file][1] to start off. + +### Installing Ruby ### + +First thing we need to update ubuntu packages and install some dependencies for Ruby. + + sudo apt-get update + sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libffi-dev + +There are three methods to install Ruby such rbenv, rvm and from the source. Each have their own benefits, but these days many developers prefer to use rbenv installation method than rvm or from source. We will install the latest version of Ruby, version 2.2.2. + +Installing with rbenv is a simple two step process. First you install rbenv, and then ruby-build : + + cd + git clone git://github.com/sstephenson/rbenv.git .rbenv + echo 'eval "$(rbenv init -)"' >> ~/.bashrc + exec $SHELL + + git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build + echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.bashrc + exec $SHELL + + git clone https://github.com/sstephenson/rbenv-gem-rehash.git ~/.rbenv/plugins/rbenv-gem-rehash + + rbenv install 2.2.2 + rbenv global 2.2.2 + ruby -v + +We need to install Bundler but before that we tell Rubygems not to install the documentation for each package locally. + + echo "gem: --no-ri --no-rdoc" > ~/.gemrc + gem install bundler + +### Configuring GIT ### + +Before configuring GIT you have to create github account first, you can register [Git][2]. We need Git for our version control system so we are going to set it up to match our Github account. + +Replace **Name** and **Email address** in the following steps with the ones you used for your Github account. + + git config --global color.ui true + git config --global user.name "YOUR NAME" + git config --global user.email "YOUR@EMAIL.com" + ssh-keygen -t rsa -C "YOUR@EMAIL.com" + +After that take the newly generated SSH key and add it to your Github account. And then you need to copy and paste the output of the following command and [paste it here][3]. + + cat ~/.ssh/id_rsa.pub + +If you done of this, check and see if it worked + + ssh -T git@github.com + +You should get a message like this + + Hi excid3! You've successfully authenticated, but GitHub does not provide shell access. + +### Installing Rails ### + +We need to install javascript runtime like NodeJS because these days Rails ships with so many dependencies. With this way we can combines and minify your javascript to provide a faster production environment. + +We need to add PPA repository for installing nodeJS + + sudo add-apt-repository ppa:chris-lea/node.js + sudo apt-get update + sudo apt-get install nodejs + +If you find a problem while updating repository packages, you should try to do this command : + + # Note the new setup script name for Node.js v0.12 + curl -sL https://deb.nodesource.com/setup_0.12 | sudo bash - + + # Then install with: + sudo apt-get install -y nodejs + +Next step, follow this command : + + gem install rails -v 4.2.1 + +Because we are using rbenv, make the rails executable available with the following command below + + rbenv rehash + +To make sure the Rails have installed correcly, you can run the rails -v and this will show like this + + rails -v + # Rails 4.2.1 + +For some reason your environment may not be setup properly if you get different result. + +### Setting Up MySQL ### + +You may already be familiar with MySQL, you can install MySQL server and client from Ubuntu repository. You will set the password for the root user on installation process. This information will go into your Rails app's database.yml file in the future. Follow the command line below : + + sudo apt-get install mysql-server mysql-client libmysqlclient-dev + +Installing the libmysqlclient-dev gives you the necessary files to compile the mysql2 gem which is what Rails will use to connect to MySQL when you setup your Rails app. + +### Last Step ### + +Let's try to create your first Rails Application : + + # Use MySQL + + rails new myapp -d mysql + + # Move into the application directory + + cd myapp + + # Create Database + + rake db:create + + rails server + +Visit http://localhost:3000 to view your new website. Now you have got machine setup and ready to build some Rails application. + +![](http://blog.linoxide.com/wp-content/uploads/2015/05/localhost_3000.png) + +If you received an error message when you create database that said Access denied for user 'root'@'localhost' (Using password: NO) then you need to update your config/database.yml file to match the database **username** and **password**. + + # Edit your database.yml in config folder + + nano config/database.yml + +and then fill the password field with your MySQL root password. + +![](http://blog.linoxide.com/wp-content/uploads/2015/05/root_passw.png) + +Exit (Ctrl+X) and save. + +### Conclusion ### + +Rails is written in Ruby, the programming language which is also used alongside Rails. Ruby on Rails can be installed in three methods such rbenv, rvm and from the source on Ubuntu 15.04. Here in this tutorial we've used rbenv method and MySQL as database. If any question or suggestion, please write them in the comment below. + + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/ubuntu-how-to/installing-ruby-rails-using-rbenv-ubuntu-15-04/ + +作者:[Obet][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://linoxide.com/author/obetp/ +[1]:http://release.ubuntu.com/15.04 +[2]:http://github.com +[3]:https://github.com/settings/ssh \ No newline at end of file From 18a8430dc7b179a5935adde391a978b6635db2bb Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 3 Jun 2015 20:46:36 +0800 Subject: [PATCH 247/965] translating --- .../20150603 Arc Is a Gorgeous GTK Theme for Linux Desktops.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/share/20150603 Arc Is a Gorgeous GTK Theme for Linux Desktops.md b/sources/share/20150603 Arc Is a Gorgeous GTK Theme for Linux Desktops.md index 44433a3789..8b19ac119e 100644 --- a/sources/share/20150603 Arc Is a Gorgeous GTK Theme for Linux Desktops.md +++ b/sources/share/20150603 Arc Is a Gorgeous GTK Theme for Linux Desktops.md @@ -1,3 +1,5 @@ +Translating---geekpi + Arc Is a Gorgeous GTK Theme for Linux Desktops ================================================================================ ![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/06/arc-gtk-theme.jpg) From 986d8d08120fd04a8a2785d00943c1a7b9e4a187 Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 3 Jun 2015 21:29:47 +0800 Subject: [PATCH 248/965] translated --- ...a Gorgeous GTK Theme for Linux Desktops.md | 54 ------------------ ...a Gorgeous GTK Theme for Linux Desktops.md | 55 +++++++++++++++++++ 2 files changed, 55 insertions(+), 54 deletions(-) delete mode 100644 sources/share/20150603 Arc Is a Gorgeous GTK Theme for Linux Desktops.md create mode 100644 translated/share/20150603 Arc Is a Gorgeous GTK Theme for Linux Desktops.md diff --git a/sources/share/20150603 Arc Is a Gorgeous GTK Theme for Linux Desktops.md b/sources/share/20150603 Arc Is a Gorgeous GTK Theme for Linux Desktops.md deleted file mode 100644 index 8b19ac119e..0000000000 --- a/sources/share/20150603 Arc Is a Gorgeous GTK Theme for Linux Desktops.md +++ /dev/null @@ -1,54 +0,0 @@ -Translating---geekpi - -Arc Is a Gorgeous GTK Theme for Linux Desktops -================================================================================ -![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/06/arc-gtk-theme.jpg) - -It has been a veritable eon since we last highlighted a GTK theme here on this site. - -But seeing Arc, pictured above, rectifies that. - -We couldn’t not mention it. - -### Arc GTK Theme ### - -![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/06/see-through-theme.png) - -Transparency. Not to everyones’ taste. - -Arc is a flat theme with a subtle color scheme and transparency in select parts of the window, like GTK Header Bars and the Nautilus sidebar. - -The see through effect does not, as in themes we past, render the entire app a peek-a-boo mess. Like on OS X Yosemite, the effect is used sparingly and to great effect. - -A companion icon set (called Vertex, and pictured) is also in the works. - -**Yes, it supports Unity** - -The Arc theme supports GTK3 and GTK2 based desktop environments, including GNOME Shell (of course) and the standard Ubuntu Unity desktop. - -It also works just dandy with lightweight Budgie and elementary’s Pantheon desktops and should work fine on Cinnamon. - -![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/06/Screen-Shot-2015-06-02-at-18.07.15.png) - -Switches, sliders and widgets in Arc - -For all its style it is not the easiest theme to download and install — *understatement klaxon* — because it’s still under active development. - -The package requirements of GTK 3.14 or later also mean Ubuntu 14.04 LTS and 14.10 users are left out in the cold on this one. - -Those of you running Ubuntu 15.04 can use the theme. You can’t (yet) add a PPA or double-click a .Deb package. If you like what you see you’ll need to roll up your sleeves and check out the compile instructions on the project Github page. - -- [Arc Theme Install Instructions on Github][1] - --------------------------------------------------------------------------------- - -via: http://www.omgubuntu.co.uk/2015/06/arc-gtk-theme - -作者:[Joey-Elijah Sneddon][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://plus.google.com/117485690627814051450/?rel=author -[1]:https://github.com/horst3180/Arc-theme \ No newline at end of file diff --git a/translated/share/20150603 Arc Is a Gorgeous GTK Theme for Linux Desktops.md b/translated/share/20150603 Arc Is a Gorgeous GTK Theme for Linux Desktops.md new file mode 100644 index 0000000000..14dd88ef70 --- /dev/null +++ b/translated/share/20150603 Arc Is a Gorgeous GTK Theme for Linux Desktops.md @@ -0,0 +1,55 @@ +Arc是一个很棒的Linux桌面的GTK主题 +================================================================================ +![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/06/arc-gtk-theme.jpg) + +距离本站上次推荐的GTK主题已经过了很久了。 + +但是看到上面的Arc后,需要纠正这点了。 + +我们不能不提到它。 + +### Arc GTK主题 ### + +![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/06/see-through-theme.png) + +Transparency. Not to everyones’ taste. +透明并不符合每个人的口味 + +Arc是一个扁平化主题并有微妙的配色并部分选中的窗口透明,就像GTK的顶拦和Nautilus的侧边栏。 + + +它的效果不像我们之前的主题那样将程序渲染的像躲猫猫那样混乱。像OSX Yosemite,效果用的不变多但是很好。 + +随之的图标集(称为Vertex)同样可用。 + +**是的它支持Unity** + +Arc主题支持基于GTK3和GTK2桌面环境,包含Gnome Shell(当然)和标准的Ubuntu Unity。 + +它也可以很好地与轻量级的Budgie和elementary的Pantheon桌面以及也可以工作在Cinnamon上。 + +![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/06/Screen-Shot-2015-06-02-at-18.07.15.png) + +Arc中的开关、滑块和小挂件。 + +它并不容易下载与安装- *understatement klaxon* - 因为它还在密集开发中。 + + +安装包需要GTK 3.14或者更新,这意味着Ubuntu 14.04 LTS和14.10的用户无法使用了。 + +那些使用Ubuntu 15.04的用户可以使用这个主题。你还不能添加ppa或者双击.deb包。如果你喜欢你看见的你需要卷起你的袖子并查看github上的编译指导。 + +- [Github中Arc安装指导][1] + +-------------------------------------------------------------------------------- + +via: http://www.omgubuntu.co.uk/2015/06/arc-gtk-theme + +作者:[Joey-Elijah Sneddon][a] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://plus.google.com/117485690627814051450/?rel=author +[1]:https://github.com/horst3180/Arc-theme From a92d9b2f90f4afa014a394374666fbd8e636457f Mon Sep 17 00:00:00 2001 From: wxy Date: Wed, 3 Jun 2015 22:41:59 +0800 Subject: [PATCH 249/965] PUB:20150407 Top 6 Ways To Get Your iTunes Experience On Linux @KevinSJ --- ... To Get Your iTunes Experience On Linux.md | 88 ++++++++++++++ ... To Get Your iTunes Experience On Linux.md | 115 ------------------ 2 files changed, 88 insertions(+), 115 deletions(-) create mode 100644 published/20150407 Top 6 Ways To Get Your iTunes Experience On Linux.md delete mode 100644 translated/share/20150407 Top 6 Ways To Get Your iTunes Experience On Linux.md diff --git a/published/20150407 Top 6 Ways To Get Your iTunes Experience On Linux.md b/published/20150407 Top 6 Ways To Get Your iTunes Experience On Linux.md new file mode 100644 index 0000000000..dee56ed250 --- /dev/null +++ b/published/20150407 Top 6 Ways To Get Your iTunes Experience On Linux.md @@ -0,0 +1,88 @@ +六种在 Linux 上为你带来 iTunes 般体验的方法 +================================================================================ +![](http://cdn.makeuseof.com/wp-content/uploads/2015/04/itunes-linux-840x420.jpg?35dc20) + +随着你对 Linux 的熟悉(也许会成为你首要使用的操作系统),你终将会寻找能在 Linux 上有效管理音乐的工具。你首先想到 iTunes,因为它是近几年最流行的音乐管理工具,但你马上会发现 iTunes 并没有 Linux 版本。而且,现在,你会发现还有比 iTunes 更好的音乐管理工具。 + +尽管如此,这并不意味着你就不能使用你喜欢的方式管理音乐。Linux 上有很多方式可以让你整理你的曲库。以下六种,仅供参考: + +### 通过WINE运行iTunes ### + +尽管 iTunes 没有Linux版,你还是可以试试 [使用 WINE 运行 iTunes ][1] 或 PlayOnLinux 的。这些软件给本来只能运行于Windows下的应用程序添加一个兼容层,这样就能让他们运行在Linux上了,但这样的方法效果十有分限。因此,[并非所有 Windows 应用程序都能使用WINE运行][2] - 但这还是一个值得尝试的方法。 + +各个版本的iTunes结果可能给你不同的结果,但一般都遵循以下方法: + +1. 安装WINE +2. 在WINE里运行iTunes安装程序 +3. 在网上搜索并解决你遇到的问题。 + +如果你在安装时遇到无法解决的问题,比如安装程序错误,或者安装好的程序运行不了,那是没办法的,WINE 就是这样。 + +如果你想在 WINE 上运行 iTunes 而且运气很好的跑起来了,那真是很棒。但如果你还想考虑运行一个原生的Linux应用,或者 WINE 不工作的话,还有很多其他选择的。有几个曲库管理软件能让你很方便的管理你的音乐并直接进行播放,还可以制作播放列表。 + +### [Amarok][3] ### + +![](http://cdn.makeuseof.com/wp-content/uploads/2015/03/amarok_main.jpg?35dc20) + +如果你使用KDE环境,我推荐 Amarok。它具有 [很多管理音乐的特性][4] 而且它还能与KDE桌面环境无缝兼容。它有很多实用的特性如集成了 Last.FM、文件跟踪、动态播放列表及脚本支持。它甚至会自动在你播放曲目时,自动下载艺术家封面。 + +### [Banshee][5] ### + +![](http://cdn.makeuseof.com/wp-content/uploads/2015/03/banshee_main.jpg?35dc20) + +如果你使用 GNOME 或其他任何基于 GTK 的桌面环境(它们十分常见)的话,我推荐使用使用Bansee作为 [全功能曲库管理工具][6] 。它的功能与Amarok类似,也集成了Last.FM,支持互联网广播,支持podcast等等。选择 Amarok 还是 Bansee 要看你使用的桌面环境(这样才能无缝整合)。 + +### [Rhythmbox][7] ### + +![](http://cdn.makeuseof.com/wp-content/uploads/2015/03/rhythmbox_main.jpg?35dc20) + +Rhythmbox是一个更好基于GTK的桌面环境的[轻量级的曲库替代品][8]。尽管如此,它也还是有一些自己的特性的。它也支持Last.FM,同时还能无缝播放并与其它如 Nautilus、XChat及Pidgin 等进行整合。 + +### [Clementine][9] ### + +![](http://cdn.makeuseof.com/wp-content/uploads/2015/03/clementine_main.jpg?35dc20) + +另一款叫 Clementine 的软件也值得我推荐,因为它的界面简洁、易用。它支持非常多的第三方服务例如Spotify,Digtal Imported 及Dropbox。Android系统上还有一款用作 Clementine 遥控的app。[Clementine是跨平台的][10] , 还支持Mac OS X 及 Windows。 + +这些程序都能很好的管理并播放你的音乐。唯一的问题是这些程序都不支持与 iOS 设备的整合, 而且目前Linux 上还没有程序能做到这一点。但 iOS 经过很多改进后,已经并不需要再连接到电脑了。 + +### [Google Play Music][11] ### + +![](http://cdn.makeuseof.com/wp-content/uploads/2015/03/google_music.jpg?35dc20) + +最后,如果上面的那些程序还不能满足你的需求的话,你可以试试 Google Play Music。这个在线服务也可以用作播放音乐的曲库管理工具,但它还有几个额外的好处。你可以上传所有的音乐,并且在所有能上网的设备上获取这些音乐。这也意味着你不需要在电脑或者移动设备之间同步你的音乐(无论是 Android 还是 iOS 设备),因为你可以这些设备中使用Google Play Music。 如果你想要扩展你的曲库,你可以订阅 All Access 服务,但这并不是必须的。你不需要支付任何费用也可在你的曲库中储存20,000首 + +#### 靠,居然没有 Spotify ?! #### + +尽管 Spotify 也是一款管理和听音乐的方法,我不推荐它的唯一原因是它事实上并不让你管理你的音乐。你不能将曲目上传到 Spotify - 只能它们给你提供的曲目。尽管它们提供了很多,但口味未必一样。 + + +### 你还有其他选择 ### + +以上六个软件应该可以在给你带来类似 iTunes 的功能了。这些软件主要是能让你管理和播放你的曲库,但如果你还需要 iTunes 里的其他特性,其他Linux原生软件或许能满足这类需求。 + +**你通常在Linux上使用哪些音乐?**在下方评论与我们分享吧! + + +-------------------------------------------------------------------------------- + +via: http://www.makeuseof.com/tag/top-6-ways-get-itunes-experience-linux/ + +作者:[Danny Stieben][a] +译者:[KevinSJ](https://github.com/KevinSJ) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://www.makeuseof.com/tag/author/danny/ +[1]:http://www.makeuseof.com/tag/how-about-some-wine-with-your-linux/ +[2]:http://www.makeuseof.com/answers/does-wine-runs-all-windows-apps/ +[3]:https://amarok.kde.org/ +[4]:http://www.makeuseof.com/tag/control-music-amarok-linux/ +[5]:http://banshee.fm/ +[6]:http://www.makeuseof.com/tag/banshee-20-comprehensive-media-player-streamer-podcast-tool-linux/ +[7]:https://wiki.gnome.org/Apps/Rhythmbox +[8]:http://www.makeuseof.com/tag/play-manage-music-collection-rhythmbox-linux/ +[9]:https://www.clementine-player.org/ +[10]:http://www.makeuseof.com/tag/need-a-lightweight-music-player-without-sacrificing-features-clementine-cross-platform/ +[11]:http://music.google.com/ diff --git a/translated/share/20150407 Top 6 Ways To Get Your iTunes Experience On Linux.md b/translated/share/20150407 Top 6 Ways To Get Your iTunes Experience On Linux.md deleted file mode 100644 index 5e5d0e213a..0000000000 --- a/translated/share/20150407 Top 6 Ways To Get Your iTunes Experience On Linux.md +++ /dev/null @@ -1,115 +0,0 @@ -六种在 Linux 上带来 iTunes 体验的方法 -Top 6 Ways To Get Your iTunes Experience On Linux -================================================================================ -![](http://cdn.makeuseof.com/wp-content/uploads/2015/04/itunes-linux-840x420.jpg?35dc20) - -随着你对 Linux 的熟悉(也许会成为你首要使用的操作系统),你最终会寻找能在Linux上有效管理音乐的工具。你首先想到了 iTunes,因为它是近几年最流行的音乐管理工具,但你马上会发现iTunes并没有Linux版本。而且,你会发现还有比 iTunes 更好的音乐管理工具。 -As you’re getting used to Linux (potentially as your new main operating system), you’ll eventually try to find a way to efficiently manage your music. iTunes comes to mind because it’s been the most popular way to manage music over the years, but you’ll quickly find out that iTunes isn’t available natively on Linux. Plus, better ways exist to manage your music now that it’s 2015. - -尽管如此,这并不意味着你就不能使用你喜欢的方式管理音乐。Linux 上有很多方式可以让你整理你的音乐库。以下六种,仅供参考: -However, that doesn’t automatically mean that you won’t be able to manage your music the way you want to. There’s plenty of other ways to keep tabs on your music library. Here’s six great ways to get it done. - -### 在WINE上运行iTunes ### -### iTunes via WINE ### - -尽管 iTunes 没有Linux版,你还是可以试试 [使用 WINE 运行 iTunes ][1] 或 PlayOnLinux 的。这些软件给本来只能运行于Windows下的应用程序添加了一个兼容层,这样就能让他们运行在Linux上了,但这样的方法效果十有分限。因此 [并非所有 Windows 应用程序都能使用WINE运行][2] - 但这还是一个值得尝试的方法。 -Even if iTunes isn’t available in Linux as a native application, you can still try to [get it to work under WINE][1] or PlayOnLinux. These pieces of software try to add a compatibility layer so that Windows applications work on Linux, but the results are far from perfect. Therefore, [not all Windows applications will run with WINE][2] — but it’s still worth a try. - -各个版本的iTunes结果可能给你不同的结果,但一般都遵循以下方法: -1. 安装WINE -1. 在WINE里运行iTunes安装程序 -1. 在网上搜索并解决你遇到的问题。 - -如果你在安装时遇到无法解决的问题,比如安装程序错误,或者安装好的程序运行不了,那是没办法的,WINE 就是这样 - -如果你想在 WINE 上运行 iTunes 但恰好运行不了的话,没问题。但如果你还想考虑运行一个原生的Linux的话,还有很多其他选择的。这些音乐管理软件狗能让你很方便的管理你的音乐并直接进行播放,还可以制作播放列表。 - -Each version of iTunes can give you different results, but the general process is as follows: - -1. Install WINE -1. Run the iTunes installer via WINE -1. Google and try to solve any problems you come across. - -Again, you might come across issues somewhere along the way which cannot be solved, such as the installer failing or the installed application refusing to run. That’s just how it is with WINE. - -If you really want to use iTunes and you happen to luck out with WINE, then that’s great. However, if you’d rather use a native Linux application or WINE didn’t work for you, then there are options here as well. Several “music library manager” programs are available to give you a quick oversight of your music and play it directly in the application, as well as make playlists. - -### [Amarok][3] ### - -![](http://cdn.makeuseof.com/wp-content/uploads/2015/03/amarok_main.jpg?35dc20) - -如果你使用KDE环境,我推荐 Amarok。它具有 [很多管理音乐的特性][4] 而且他还能与KDE桌面环境无缝兼容。它很有很多实用的特性如无缝兼容 Last.FM,文件跟踪,动态播放列表及个吃支持。它甚至会自动在你播放曲目时,自动下载艺术家封面。 - -If you use KDE, then I’d recommend Amarok. It has [plenty of features to manage your music][4] and tight desktop integration with KDE. It also has useful features such as Last.FM integration, file tracking, dynamic playlists, and script support. It can even pull up biographies of artists as you play their songs. - -### [Banshee][5] ### - -![](http://cdn.makeuseof.com/wp-content/uploads/2015/03/banshee_main.jpg?35dc20) - -如果你使用 GNOME 或其他任何基于 GTK 的桌面环境(他们十分常见)的话,我推荐使用使用Bansee作为 [全功能音乐库管理工具][6] 。它的功能与Amarok类似,也与Last.FM无缝兼容,支持网络广播,支持podcast,还有很多其他功能。选择 Amarok 还是 Bansee 要看你使用的桌面环境(这样才能无缝整合)。 - -If you use GNOME or any GTK-based desktop environment (they’re quite common), then I’d recommend Banshee as a [full-featured music library][6] manager. It has a very similar feature set as Amarok, including Last.FM integration, Internet radio support, podcast support, and much more. Amarok and Banshee are really among the top two choices, so which one you choose should depend on which desktop environment you’re using (for integration’s sake). - -### [Rhythmbox][7] ### - -![](http://cdn.makeuseof.com/wp-content/uploads/2015/03/rhythmbox_main.jpg?35dc20) - -Rhythmbox是一个 基于GTK的桌环境下更 [轻量级的音乐库替代品][8]。尽管如此,它也还是有一些特性的。它也支持Last.FM,同时还能无缝播放并与其他如 Nautilus, XChat,及Pidgin 等进行整合。 -Rhythmbox as a more [lightweight music library alternative][8] that is best used on GTK-based desktop environments. However, it still has quite a few features. You also get Last.FM support here, plus gapless playback and integration with various other applications such as Nautilus, XChat, and Pidgin. - -### [Clementine][9] ### - -![](http://cdn.makeuseof.com/wp-content/uploads/2015/03/clementine_main.jpg?35dc20) - -另一款叫 Clementine 的软件也值得我推荐,因为它的见面简洁、易用。它支持非常多的第三方服务例如Spotify,Digtal Imported 及Dropbox。Android系统上还有一款用作 Clementine 遥控的app。[Clementine是一个跨平台的][10] , 还支持Mac OS X 及 Windows。 -Another application called Clementine also gets my recommendation with its clean and intuitive interface. It has tons of support for third-party services such as Spotify, Digitally Imported, and Dropbox. There’s also an Android app you can use as a remote control for Clementine. [Clementine is cross-platform][10] and available for Windows and Mac OS X. - -这些程序都能很好的管理并播放你的音乐。唯一的问题是这些程序都不支持与 iOS 设备的整合, 而且目前还没有程序能做到这一点。但 iOS 经过很多改进后,已经足以不需要再连接到电脑了。 -They all are excellent at managing and playing your music. The only downside to all of these is that there is no iOS device integration, and there’s currently no modern application that can do that. However, iOS has received enough improvements that it’s virtually unnecessary to connect it to a computer anymore. - -### [Google Play Music][11] ### - -![](http://cdn.makeuseof.com/wp-content/uploads/2015/03/google_music.jpg?35dc20) - -最后,如果上面的那些程序还不能满足你的需求的花,你可以试试 Google Play Music。这个在线服务也可以用作能播放音乐的音乐库管理工具,但他还有几个额外的好处。你可以上传所有的音乐,并且在所有能上网的设备上获取这些音乐。这也意味着你不需要在电脑或者移动设备之间同步你的音乐(无论是 Android 还是 iOS 设备),因为你可以这些设备中使用Google Play Music。 如果你想要扩展你的去库,你可以订阅 All Access,但这并不是必须的。你不需要支付任何费用也可在你的曲库中储存20,000首 -Lastly, if none of those applications satisfy your needs, you can take a look at Google Play Music. This online service acts as a music library manager that can play your music, but it also has some extra benefits. You can upload all your music to it and have access on any device connected to the Internet. That also means that you won’t have to sync your music between your computer and your mobile device (no matter if Android or iOS) because you have access to Google Play Music from both. If you want to expand your library you can get the All Access subscription, but it’s not a requirement. You can use it simply as a music library completely free for up to 20,000 songs. - -#### 靠,居然没有 Spotify ?! #### -#### Wot, no Spotify?! #### - -尽管 Spotify 也是一款管理和听音乐的方法,我不推荐它的唯一原因是它事实上并不让你管理你的音乐。你不能将曲目上传到 Spotify - 只能它们给你提供的曲目。尽管它们提供了很多,但原理都不尽相同。 -The only reason why I don’t mention Spotify is that, although it’s also a great way to access and listen to music, it doesn’t really let you manage your own music. You can’t upload trakcs to Spotify — you have to listen to what they give you. Albeit they give you a lot, but it’s nonetheless a different mechanism. - -### 你还有其他选择 ### -### You Have Options ### - -以上六个软件应该可以在给你带来类似 iTunes 的功能了。这些软件主要是能让你管理和播放你的音乐库,但如果你还需要 iTunes 里的其他特性,其他Linux原生软件或许能满足这类需求。 - -With these six options, you should be able to get iTunes-like functionality on your desktop. These options focused mainly on managing and playing your music library, but if there are any other features that you need from iTunes, other Linux-native applications can take care of those needs. - -**你通常在Linux上使用哪些音乐?**在下方评论与我们分享吧! -**What music applications do you regularly use on Linux?** Let us know in the comments! - - --------------------------------------------------------------------------------- - -via: http://www.makeuseof.com/tag/top-6-ways-get-itunes-experience-linux/ - -作者:[Danny Stieben][a] -译者:[KevinSJ](https://github.com/KevinSJ) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://www.makeuseof.com/tag/author/danny/ -[1]:http://www.makeuseof.com/tag/how-about-some-wine-with-your-linux/ -[2]:http://www.makeuseof.com/answers/does-wine-runs-all-windows-apps/ -[3]:https://amarok.kde.org/ -[4]:http://www.makeuseof.com/tag/control-music-amarok-linux/ -[5]:http://banshee.fm/ -[6]:http://www.makeuseof.com/tag/banshee-20-comprehensive-media-player-streamer-podcast-tool-linux/ -[7]:https://wiki.gnome.org/Apps/Rhythmbox -[8]:http://www.makeuseof.com/tag/play-manage-music-collection-rhythmbox-linux/ -[9]:https://www.clementine-player.org/ -[10]:http://www.makeuseof.com/tag/need-a-lightweight-music-player-without-sacrificing-features-clementine-cross-platform/ -[11]:http://music.google.com/ From 5d9e0be0f27737dd4fd077d568cfb8dc3574273e Mon Sep 17 00:00:00 2001 From: wxy Date: Wed, 3 Jun 2015 23:33:35 +0800 Subject: [PATCH 250/965] PUB:20150413 How to manage remote MySQL databases on Linux VPS using a GUI tool @tyzy313481929 --- ...databases on Linux VPS using a GUI tool.md | 176 ++++++++++++++++++ ...databases on Linux VPS using a GUI tool.md | 171 ----------------- 2 files changed, 176 insertions(+), 171 deletions(-) create mode 100644 published/20150413 How to manage remote MySQL databases on Linux VPS using a GUI tool.md delete mode 100644 translated/tech/20150413 How to manage remote MySQL databases on Linux VPS using a GUI tool.md diff --git a/published/20150413 How to manage remote MySQL databases on Linux VPS using a GUI tool.md b/published/20150413 How to manage remote MySQL databases on Linux VPS using a GUI tool.md new file mode 100644 index 0000000000..a0114d5382 --- /dev/null +++ b/published/20150413 How to manage remote MySQL databases on Linux VPS using a GUI tool.md @@ -0,0 +1,176 @@ +如何使用图形化工具远程管理 Linux上的MySQL +================================================================================ +如果你在一个远程的VPS上运行了MySQL服务器,你会如何管理你的远程数据库主机呢?基于web的数据库管理工具例如[phpMyAdmin][2]或者[Adminer][3]可能会是你第一个想起的。这些基于web的管理工具需要一个正常运行的后端的web服务和PHP引擎。但是,如果你的VPS仅仅用来做数据库服务(例如,数据库与其它服务独立存放的分布式结构),为偶尔的数据库管理提供一整套的LAMP是浪费VPS资源的。更糟的是,LAMP所打开的HTTP端口可能会成为你VPS资源的安全漏洞。 + +作为一种选择,你可以使用在一台客户机上运行本地的MySQL客户端,当然,如果没有别的选择,一个纯净的MySQL命令行客户端将是你的默认选择。但是命令行客户端的功能是有限的,因为它没有生产级数据库管理功能,例如:可视化SQL开发、性能调优、模式验证等等。你是否在寻找一个成熟的MySQL管理工具,那么一个MySQL的图形化管理工具将会更好的满足你的需求。 + +###什么是MySQL Workbench? + +作为一个由Oracle开发的集成的数据库管理工具,[MySQL Workbench][4]不仅仅是一个简单的MySQL客户端。简而言之,Workbench是一个跨平台的(如:Linux,MacOX,Windows)数据库设计、开发和管理的图形化工具。MySQL Workbench 社区版是遵循GPL协议的。作为一个数据库管理者,你可以使用Workbench去配置MySQL服务、管理MySQL用户、进行数据库的备份与还原、监视数据库的健康状况,所有的都在对用户友好的图形化环境下处理。 + +在这个手册里,让我们演示下如何在Linux下安装和使用MySQL Workbench。 + +###在Linux上安装MySQL Workbench + +你可以在任何一个桌面linux机器上运行MySQL Workbench来设置你的数据库管理环境。虽然一些Linux发行版(例如:Debian/Ubuntu)在他们的软件源中已经有了MySQL Workbench,但是从官方源中安装是一个好的方法,因为他们提供了最新的版本。这里介绍了如何设置一个官方的Workbench软件源和从中安装它。 + +#### 基于 Debian 的桌面 (Debia, Ubuntu, Mint): #### + +到其[官方站点][5],选择一个和你环境匹配的DEB文件,并下载安装: + +例如,对于 Ubuntu 14.10: + + $ wget http://dev.mysql.com/get/mysql-apt-config_0.3.4-2ubuntu14.10_all.deb + $ sudo dpkg -i mysql-apt-config_0.3.4-2ubuntu14.10_all.deb + +对于 Debian 7: + + $ wget http://dev.mysql.com/get/mysql-apt-config_0.3.3-1debian7_all.deb + $ sudo dpkg -i mysql-apt-config_0.3.3-1debian7_all.deb + +当你安装DEB文件时,你会看到下面的配置菜单,并且选择配置那个MySQL产品 + +![](https://farm8.staticflickr.com/7702/16928715218_b1fcbcdbf3_c.jpg) + +选择“Utilities”。完成配置后,选择“Apply”去保存配置。然后,更新包索引,并且安装Workbench。 + + $ sudo apt-get update + $ sudo apt-get install mysql-workbench + +#### 基于 Red Hat 的桌面 (CentOS, Fedora, RHEL): #### + +去官网下载并安装适合你Linux环境的RPM源包。 + +例如,对于 CentOS 7: + + $ wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm + $ sudo yum localinstall mysql-community-release-el7-5.noarch.rpm + +对于 Fedora 21: + + $ wget http://dev.mysql.com/get/mysql-community-release-fc21-6.noarch.rpm + $ sudo yum localinstall mysql-community-release-fc21-6.noarch.rpm + +验证"MySQL Tools Community"源是否被安装: + + $ yum repolis enabled + +![](https://farm9.staticflickr.com/8826/16494069254_15458ace52_c.jpg) + +安装Workbench + + $ sudo yum install mysql-workbench-community + +###设置远程数据库的安全连接 + +接下来是为你运行MySQL服务的VPS设置一个远程连接。当然,你可以直接通过图形化的Workbench连接你的远程MySQL服务器(在数据库开放了远程连接后)。然而,这样做有很大的安全风险,因为有些人很容易窃听你的数据库传输信息,并且一个公开的MySQL端口(默认为3306)会是另外一个攻击入口。 + +一个比较好的方法是关掉远程访问数据库服务功能,(仅允许在VPS 上的127.0.0.1访问)。然后在本地客户机和远程VPS之间设置一个SSH隧道,这样的话,和MySQL之间的数据能安全地通过它的本地回环接口上中继。相比较设置一个SSL加密的连接来说,配置SSH隧道需要很少的操作,因为它仅仅需要SSH服务,并且在大多数的VPS上已经部署了。 + +让我们来看看如何来为一个MySQL Workbench设置一个SSH隧道。 + +在这个设置里,不需要你开放远程访问MySQL服务。 + +在一个运行了Workbench的本地客户机上,键入下面的命令,替换'user'(远程 VPS 的用户名)和'remote_vps'(远程 VPS 的地址)为你自己的信息: + + $ ssh user@remote_vps -L 3306:127.0.0.1:3306 -N + +你会被要求输入你VPS的SSH密码,当你成功登陆VPS后,在本地的3306端口和远程VPS的3306端口之间将会建立一个SSH隧道。这里你不会在前台看到任何信息显示。 + +或者你可以选择在后台运行SSH隧道,按CTRL+Z停止当前的命令,然后输入bg并且ENTER + +![](https://farm8.staticflickr.com/7714/16928715438_bf0db49b3b_c.jpg) + +这样SSH隧道就会在后台运行了。 + +###使用MySQL Workbench远程管理MySQL服务 + +在建立好SSH隧道后,你可以通过MySQL Workbench去远程连接MySQL服务了。 + +输入下面命令启动Workbench: + + $ mysql-workbench + +![](https://farm9.staticflickr.com/8768/16494069294_0fce571ddb_c.jpg) + +点击Workbench页面上面的“加号”图标去创建一个新的数据库连接,接着会出现下面的连接信息。 + +- **Connection Name**: 任意描述 (例如: My remote VPS database) +- **Hostname**: 127.0.0.1 +- **Port**: 3306 +- **Username**: MySQL 用户名 (例如 root) + +![](https://farm8.staticflickr.com/7727/16928715288_d9ac3bfc7a_c.jpg) + +注意:因为隧道设置的是127.0.0.1:3306,所以主机名字段必须是127.0.0.1,而不能是远程VPS的IP地址或者主机名。 + +当你设置好一个新的数据库连接后,你会在Workbench窗口看到一个新的框,点击那个框就会实际去连接远程的MySQL服务了。 + +![](https://farm8.staticflickr.com/7650/17114969532_0252ffcd31_c.jpg) + +当你登录到MySQL 服务器后,你可以再左侧面板看到各种管理任务。让我们来看一些常见的管理任务。 + +#### MySQL Server Status #### + +该菜单显示了展示数据库服务器的资源使用情况的实时监控面板。(例如:流量、链接、读写) + +![](https://farm8.staticflickr.com/7627/16494069414_9d838d4138_c.jpg) + +#### Client Connections #### + +客户端连接数是一个极其重要的监控的资源,这个菜单显示了每个连接的详细信息。 + +![](https://farm9.staticflickr.com/8747/16909119337_a8d89772dd_c.jpg) + +#### 用户和权限 #### + +这个菜单允许你管理MySQL用户,包括他们的资源限制和权限。 + +![](https://farm9.staticflickr.com/8765/16494069384_760fc17c8f_c.jpg) + +#### MySQL Server Administration #### + +你可以启动或关闭MySQL服务,并且检查它的服务日志。 + +![](https://farm8.staticflickr.com/7588/17114969592_54526dfb32_c.jpg) + +#### Database Schema Management #### + +可以可视化的查看、更改、检查数据库结构,在“Schemas”标题下选择任何一个数据库或表,然后右击 + +![](https://farm8.staticflickr.com/7665/16496363973_fd03a96198_c.jpg) + +![](https://farm9.staticflickr.com/8744/16909119497_7c884617b8_c.jpg) + +#### Database Query #### + +你可以执行任何的语句(只要你的权限允许),并且检查其结果。 + +![](https://farm8.staticflickr.com/7716/17114969692_c0f02bb277_c.jpg) + +此外,性能统计数据和报表仅用于MySQL5.6以上的版本。对于5.5及其以下的版本,性能部分会以灰色显示。 + +### 结论 ### + +简介且直观的选项卡界面,丰富的特性,开源,使MySQL Workbench成为一个非常好的可视化数据库设计和管理工具。为其减分的是它的性能。我注意到在一台运行繁忙的服务器上,Workbench有时会变得异常缓慢,尽管它的性能差强人意,我依然认为MySQL Workbench是MySQL数据库管理员和设计人员必备的工具之一。 + +你曾在你的生产环境中用过Workbench吗?或者你还有别的GUI工具可以推荐?请分享你的经验吧。 + +-------------------------------------------------------------------------------- + +via: http://xmodulo.com/remote-mysql-databases-gui-tool.html + +作者:[Dan Nanni][a] +译者:[tyzy313481929](https://github.com/tyzy313481929) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://xmodulo.com/author/nanni +[1]:http://xmodulo.com/go/digitalocean +[2]:http://ask.xmodulo.com/install-phpmyadmin-centos.html +[3]:http://xmodulo.com/set-web-based-database-management-system-adminer.html +[4]:http://mysqlworkbench.org/ +[5]:http://dev.mysql.com/downloads/repo/apt/ +[6]:http://dev.mysql.com/downloads/repo/yum/ +[7]:http://xmodulo.com/how-to-allow-remote-access-to-mysql.html diff --git a/translated/tech/20150413 How to manage remote MySQL databases on Linux VPS using a GUI tool.md b/translated/tech/20150413 How to manage remote MySQL databases on Linux VPS using a GUI tool.md deleted file mode 100644 index 580e68e9d7..0000000000 --- a/translated/tech/20150413 How to manage remote MySQL databases on Linux VPS using a GUI tool.md +++ /dev/null @@ -1,171 +0,0 @@ -Translating by demon -如何使用图形化工具远程管理Linux Vps上的MySql -================================================================================ -如果你在一个远程的VPS上运行了MYSQL server,你会如何管理你的远程数据库主机呢?基于web的数据库管理工具例如phpMyAdmin或者Adminer可能会是你一个想起的。这些基于web的管理工具需要一个后端的web服务和PHP引擎在正常运行。但是,如果你的VPS仅仅用来做数据库服务(e.g., for a multi-tier app),为临时的数据库管理提供一整套的LAMP是浪费VPS资源的。更糟的是,LAMP带有的HTTP端口可能会成为你VPS资源的安全漏洞。 - -作为一种选择,你可以使用在一台客户机上运行本地的Mysql客户端,当然,如果没有别的选择,一个纯净的命令行mysql客户端将是你的默认选择。但是命令行客户端的功能是有限的,因此它不适合在生产环境中使用,例如:sql开发,性能调优,模式验证等等。你是否在寻找一个成熟的MYSQL管理工具,那么一个MYSQL的图形化管理工具将会更好的满足你的需求。 - -什么是MySQL Workbench? - -作为一个由Oracle开发的成熟数据库管理工具,mysql workbench不仅仅是一个MySQL客户端。简而言之,Workbench是一个跨平台的(eg:Linux,MacOX,Windows)数据库设计,开发和管理图形工具。社区版本的Msyql Workbench是遵循GPL协议的。作为一个数据库管理者,你可以使用Workbench去配置Mysql服务,管理Mysql用户,完成数据库的备份与还原,监视数据库的健康状况,所有的都在对用户友好的图形化环境下处理。 - -在这个手册里,让我们演示下如何在Linux下安装和使用Mysql Workbench. - -在Linux上安装MySQL Workbench - -你可以在任何一个桌面linux机器上运行Mysql Workbench去设置你的数据库管理环境。然而一些Linux发行版(例如:Debian/Ubuntu)在他们的软件源中已经有了Mysql Workbench.从官方源中安装是一个好的方法,因为他们提供了最新的版本。这里介绍了如何设置一个官方的Workbench源和从中安装它。 - -#### Debian-based Desktop (Debia, Ubuntu, Mint): #### - -到其官方站点,选择一个和你环境匹配的DEB file源,并下载安装 - -For example, on Ubuntu 14.10: - - $ wget http://dev.mysql.com/get/mysql-apt-config_0.3.4-2ubuntu14.10_all.deb - $ sudo dpkg -i mysql-apt-config_0.3.4-2ubuntu14.10_all.deb - -on Debian 7: - - $ wget http://dev.mysql.com/get/mysql-apt-config_0.3.3-1debian7_all.deb - $ sudo dpkg -i mysql-apt-config_0.3.3-1debian7_all.deb - -当你安装DEB文件时,你会看到下面的配置菜单,并且选择配置那个Mysql产品 - -![](https://farm8.staticflickr.com/7702/16928715218_b1fcbcdbf3_c.jpg) - -选择“Utilities”.完成配置后,选择“Apply”去保存配置。然后,更新包索引,并且安装Workbench - - $ sudo apt-get update - $ sudo apt-get install mysql-workbench - -#### Red Hat-based Desktop (CentOS, Fedora, RHEL): #### - -去官网下载并安装适合你Linux环境的RPM源包 -For example, on CentOS 7: - - $ wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm - $ sudo yum localinstall mysql-community-release-el7-5.noarch.rpm - -on Fedora 21: - - $ wget http://dev.mysql.com/get/mysql-community-release-fc21-6.noarch.rpm - $ sudo yum localinstall mysql-community-release-fc21-6.noarch.rpm - -验证"MySQL Tools Community"源是否被安装 - $ yum repolis enabled - -![](https://farm9.staticflickr.com/8826/16494069254_15458ace52_c.jpg) - -安装Workbench - - $ sudo yum install mysql-workbench-community - -设置远程数据库的安全连接 - -接下来是为你运行Mysql服务的VPS设置一个远程连接,当然你可以直接通过图形化的Workbench连接你的远程Mysql服务器(在数据库开放了远程连接后)。然而,这样做有很大的安全风险,因为有些人很容易窃听你的数据库传输信息,并且一个公开的Mysql端口(默认为3306)被作为攻击入口。 - -一个比较好的方法是关掉远程访问数据库服务功能,(仅允许在127.0.0.1访问)。然后在本地客户机和远程Vps直接设置一个SSH隧道,这样的话,和mysql之间的数据能被安全的传输,仅在它的本地回环接口上。相比较设置一个SSL加密的连接来说,配置SSH隧道需要很少的操作,因为他仅仅需要SSH服务,并且在大多数的VPS上已经部署了。 - -让我们来看看如何来为一个Mysql Workbench设置一个SSH隧道,这里的设置,不需要你开放远程访问Mysql服务。 -在一个运行了Workbench的本地客户机上,键入下面的命令,替换'user' and 'remote_vps'为你自己的信息 - - $ ssh user@remote_vps -L 3306:127.0.0.1:3306 -N - -你会被要求输入你VPS的SSH密码,当你成功登陆VPS后,一个SSH隧道将会在本地的3306端口和远程VPS的3306端口将会被建立。这里你不会看到任何信息。 - -或者你可以选择在后台运行SSH隧道,按CTRL+Z停止当前的命令,然后输入bg并且ENTER - -![](https://farm8.staticflickr.com/7714/16928715438_bf0db49b3b_c.jpg) - -这样SSH隧道就会在后台运行了。 - -使用MySQL Workbench远程管理MySQL服务 - -在建立好SSH隧道后,你可以通过MySQL Workbench去远程连接Mysql服务了。 - -输入下面命令启动Workbench - - $ mysql-workbench - -![](https://farm9.staticflickr.com/8768/16494069294_0fce571ddb_c.jpg) - -点击Workbench页面上面的加号图标去创建一个新的数据库连接,接着会出现下面的连接信息。 - -- **Connection Name**: any description (e.g., My remote VPS database) -- **Hostname**: 127.0.0.1 -- **Port**: 3306 -- **Username**: MySQL username (e.g., root) - -![](https://farm8.staticflickr.com/7727/16928715288_d9ac3bfc7a_c.jpg) - -注意:因为隧道设置的是127.0.0.1:3306,所以主机名哪里必须是127.0.0.1,而不能是远程VPS的IP地址或者主机名 - -当你设置好一个新的数据库连接后,你会在Workbench窗口看到一个新的框,点击那个框就会实际去连接远程的MySQL服务了。 - -![](https://farm8.staticflickr.com/7650/17114969532_0252ffcd31_c.jpg) - -当你设置好一个新的数据库连接后,你会在Workbench窗口看到一个新的框,点击那个框就会实际去连接远程的MySQL服务了。 - -#### MySQL Server Status #### - -当你设置好一个新的数据库连接后,你会在Workbench窗口看到一个新的框,点击那个框就会实际去连接远程的MySQL服务了。 - -![](https://farm8.staticflickr.com/7627/16494069414_9d838d4138_c.jpg) - -#### Client Connections #### - -连接数是一个极其重要的监视资源,这个菜单显示了每个连接的详细信息。 - -![](https://farm9.staticflickr.com/8747/16909119337_a8d89772dd_c.jpg) - -#### 用户和权限 #### - -这个菜单允许你管理MySQL用户,包括他们的资源限制和权限。 - -![](https://farm9.staticflickr.com/8765/16494069384_760fc17c8f_c.jpg) - -#### MySQL Server Administration #### - -你可以启动或关闭MySQL服务,并且检查它的服务日志。 - -![](https://farm8.staticflickr.com/7588/17114969592_54526dfb32_c.jpg) - -#### Database Schema Management #### - -可以可视化的查看,更改,检查数据库结构,在“Schemas”标题下选择任何一个数据库或表,然后右击 - -![](https://farm8.staticflickr.com/7665/16496363973_fd03a96198_c.jpg) - -![](https://farm9.staticflickr.com/8744/16909119497_7c884617b8_c.jpg) - -#### Database Query #### - -你可以执行任何的语句(只要你的权限允许),并且检查他的结果。 - -![](https://farm8.staticflickr.com/7716/17114969692_c0f02bb277_c.jpg) - -此外,性能统计数据和报表仅用于MySQL5.6以上的版本。对于5.5及其以下的版本,性能部分会以灰色显示。 -### 结论 ### - -简介且直观的选项卡界面,丰富的特性,开源,使MySQL Workbench成为一个非常好的可视化数据库设计和管理工具。为其减分的是它的性能。我注意到在一台运行繁忙的服务器上,Workbench优势会变得异常缓慢,尽管它的性能差强人意,我依然认为MySQL Workbench是MySQL数据库管理员和设计人员必备的工具之一。 - -你曾在你的生产环境中用过Workbench吗?或者你还有别的GUI工具可以推荐?请分享你的经验吧。 - --------------------------------------------------------------------------------- - -via: http://xmodulo.com/remote-mysql-databases-gui-tool.html - -作者:[Dan Nanni][a] -译者:[译者ID](https://github.com/tyzy313481929译者demon) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://xmodulo.com/author/nanni -[1]:http://xmodulo.com/go/digitalocean -[2]:http://ask.xmodulo.com/install-phpmyadmin-centos.html -[3]:http://xmodulo.com/set-web-based-database-management-system-adminer.html -[4]:http://mysqlworkbench.org/ -[5]:http://dev.mysql.com/downloads/repo/apt/ -[6]:http://dev.mysql.com/downloads/repo/yum/ -[7]:http://xmodulo.com/how-to-allow-remote-access-to-mysql.html From b64a24f7f903571bdbfe7b1a38159aca93dfceb8 Mon Sep 17 00:00:00 2001 From: joeren Date: Thu, 4 Jun 2015 08:21:32 +0800 Subject: [PATCH 251/965] Update 20150602 Howto Configure OpenVPN Server-Client on Ubuntu 15.04.md --- ...02 Howto Configure OpenVPN Server-Client on Ubuntu 15.04.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150602 Howto Configure OpenVPN Server-Client on Ubuntu 15.04.md b/sources/tech/20150602 Howto Configure OpenVPN Server-Client on Ubuntu 15.04.md index 062a87b211..cc2aabc19b 100644 --- a/sources/tech/20150602 Howto Configure OpenVPN Server-Client on Ubuntu 15.04.md +++ b/sources/tech/20150602 Howto Configure OpenVPN Server-Client on Ubuntu 15.04.md @@ -1,3 +1,4 @@ +Translating by GOLinux! Howto Configure OpenVPN Server-Client on Ubuntu 15.04 ================================================================================ Virtual private network (VPN) is a common name of several technologies which allows to establish a network connection over other network. It called virtual because nodes connected between each over through non physical lines. And it is private due to absence of public access to network without proper rights from of the network owner. @@ -302,4 +303,4 @@ via: http://linoxide.com/ubuntu-how-to/configure-openvpn-server-client-ubuntu-15 [a]:http://linoxide.com/author/ivanz/ [1]:https://openvpn.net/ -[2]:https://play.google.com/store/apps/details?id=net.openvpn.openvpn \ No newline at end of file +[2]:https://play.google.com/store/apps/details?id=net.openvpn.openvpn From 7627973a0e25bc643e76a36c2ded7e4c2ed24491 Mon Sep 17 00:00:00 2001 From: GOLinux Date: Thu, 4 Jun 2015 10:06:20 +0800 Subject: [PATCH 252/965] [Translated]20150602 How to Configure OpenVPN Server-Client on Ubuntu 15.04.md --- ...e OpenVPN Server-Client on Ubuntu 15.04.md | 107 +++++++++--------- 1 file changed, 53 insertions(+), 54 deletions(-) rename {sources => translated}/tech/20150602 Howto Configure OpenVPN Server-Client on Ubuntu 15.04.md (52%) diff --git a/sources/tech/20150602 Howto Configure OpenVPN Server-Client on Ubuntu 15.04.md b/translated/tech/20150602 Howto Configure OpenVPN Server-Client on Ubuntu 15.04.md similarity index 52% rename from sources/tech/20150602 Howto Configure OpenVPN Server-Client on Ubuntu 15.04.md rename to translated/tech/20150602 Howto Configure OpenVPN Server-Client on Ubuntu 15.04.md index cc2aabc19b..5b6c2fc6bd 100644 --- a/sources/tech/20150602 Howto Configure OpenVPN Server-Client on Ubuntu 15.04.md +++ b/translated/tech/20150602 Howto Configure OpenVPN Server-Client on Ubuntu 15.04.md @@ -1,41 +1,40 @@ -Translating by GOLinux! -Howto Configure OpenVPN Server-Client on Ubuntu 15.04 +Ubuntu 15.04上配置OpenVPN服务器-客户端 ================================================================================ -Virtual private network (VPN) is a common name of several technologies which allows to establish a network connection over other network. It called virtual because nodes connected between each over through non physical lines. And it is private due to absence of public access to network without proper rights from of the network owner. +虚拟专用网(VPN)是几种用于建立与其它网络连接的网络技术中常见的一个名称。它被称为虚拟网,因为各个节点的连接不是通过物理线路实现的。而由于没有网络所有者的正确授权是不能通过公共线路访问到网络,所以它是专用的。 ![](http://blog.linoxide.com/wp-content/uploads/2015/05/vpn_custom_illustration.jpg) -[OpenVPN][1] software transfer data using TCP and UDP protocols and with help of TUN/TAP drivers. UDP protocol and TUN driver allows to establish connection to OpenVPN server for clients behind NAT. Additionally OpenVPN allows to specify custom port. It provide additional flexibility of configuration and may help in avoiding of firewall restrictions. +[OpenVPN][1]软件通过TUN/TAP驱动的帮助,使用TCP和UDP协议来传输数据。UDP协议和TUN驱动允许NAT后的用户建立到OpenVPN服务器的连接。此外,OpenVPN允许指定自定义端口。它提额外提供了灵活的配置,可以帮助你避免防火墙限制。 -Security and encryption in OpenVPN provided by library OpenSSL and by Transport Layer Security (TLS). TLS is an improved version of SSL protocol. +OpenVPN中,由OpenSSL库和传输层安全协议(TLS)提供了安全和加密。TLS是SSL协议的一个改进版本。 -OpenSSL provide two kinds of encryption: symmetric and asymmetric. Below we show how to configure server side of OpenVPN and how to make all preparations for use asymmetric cryptography and TLS protocol with Public Key Infrastructure (PKI). +OpenSSL提供了两种加密方法:对称和非对称。下面,我们展示了如何配置OpenVPN的服务器端,以及如何预备使用带有公共密钥非对称加密和TLS协议基础结构(PKI)。 -### Server side configuration ### +### 服务器端配置 ### -First of all we must install OpenVPN. In Ubuntu 15.04 and other Unix systems with 'apt' package manager this can be done as follows: +首先,我们必须安装OpenVPN。在Ubuntu 15.04和其它带有‘apt’报管理器的Unix系统中,可以通过如下命令安装: sudo apt-get install openvpn -Then we must setup a keys. This can be done using default tools "openssl". But this way is rather difficult. That is why we can use "easy-rsa" for this purpose. Next command installs the "easy-rsa" into our system +然后,我们必须配置一个密钥对,这可以通过默认的“openssl”工具完成。但是,这种方式十分难。这也是我们使用“easy-rsa”来实现此目的的原因。接下来的命令会将“easy-rsa”安装到系统中。 sudo apt-get unstall easy-rsa -**Remark**: all next commands executed with superuser rights, i.e. after command "sudo -i"; otherwise you can use "sudo -E" as prefix for all next commands. +**注意**: 所有接下来的命令要以超级用户权限执行,如在“sudo -i”命令后;此外,你可以使用“sudo -E”作为接下来所有命令的前缀。 -For beginning we need to copy "easy-rsa" into openvpn folder +开始之前,我们需要拷贝“easy-rsa”到openvpn文件夹。 mkdir /etc/openvpn/easy-rsa cp -r /usr/share/easy-rsa /etc/openvpn/easy-rsa mv /etc/openvpn/easy-rsa/easy-rsa /etc/openvpn/easy-rsa/2.0 -and goes into it +然后进入到该目录 cd /etc/openvpn/easy-rsa/2.0 -Here we start a process of key generation. +这里,我们开启了一个密钥生成进程。 -Firstly we edit a "var" file. For simplify generation process we need to specify our data in it. Here is an example of "var" file: +首先,我们编辑一个“var”文件。为了简化生成过程,我们需要在里面指定数据。这里是“var”文件的一个样例: export KEY_COUNTRY="US" export KEY_PROVINCE="CA" @@ -44,25 +43,25 @@ Firstly we edit a "var" file. For simplify generation process we need to specify export KEY_EMAIL="my@myhost.mydomain" export KEY_OU=server -Hope, field names is clear and there is no need of additional description of them. +希望这些字段名称对你而言已经很清楚,不需要进一步说明了。 -Secondly we need to copy the openssl config. There is config from different version. If you haven't any certain requirement use last version of it. This is a 1.0.0 version. +其次,我们需要拷贝openssl配置。另外一个版本已经有现成的配置文件,如果你没有特定要求,你可以使用它的上一个版本。这里是1.0.0版本。 cp openssl-1.0.0.cnf openssl.cnf -Thirdly we need load environment variables, which we edited on previous step +第三,我们需要加载环境变量,这些变量已经在前面一步中编辑好了。 source ./vars -Final step of preparation for key generation is in flushing of old certificates and keys and in generation of serial and index files for new keys. This can be done by using command +生成密钥的最后一步准备工作是清空旧的证书和密钥,以及生成新密钥的序列号和索引文件。可以通过以下命令完成。 ./clean-all -Now we finish preparation and ready to start generation process. Lets generate certificate first +现在,我们完成了准备工作,准备好启动生成进程了。让我们先来生成证书。 ./build-ca -In dialog we see default variants, which we specified in "vars" file before. We may check them, edit if needed and then press ENTER couple of times. Dialog looks as follows +在对话中,我们可以看到默认的变量,这些变量是我们先前在“vars”中指定的。我们可以检查以下,如有必要进行编辑,然后按回车几次。对话如下 Generating a 2048 bit RSA private key .............................................+++ @@ -85,11 +84,11 @@ In dialog we see default variants, which we specified in "vars" file before. We Name [EasyRSA]: Email Address [me@myhost.mydomain]: -Next we need to generate a server key +接下来,我们需要生成一个服务器密钥 ./build-key-server server -Dialog of this command is shown below: +该命令的对话如下: Generating a 2048 bit RSA private key ........................................................................+++ @@ -134,72 +133,72 @@ Dialog of this command is shown below: Write out database with 1 new entries Data Base Updated -Here we must answer "yes" on last two questions about "sign the certificate" and about "commit". +这里,最后两个关于“签署证书”和“提交”的问题,我们必须回答“yes”。 -Now we have certificate and server key. Next step is to generate Diffie-Hellman key. Execute the below command and be patient. During next couple minutes we will see a lots of dots and pluses symbols. +现在,我们已经有了证书和服务器密钥。下一步,就是去省城Diffie-Hellman密钥。执行以下命令,耐心等待。在接下来的几分钟内,我们将看到许多点和加号。 ./build-dh -Example of the output of this command you can find below +该命令的输出样例如下 Generating DH parameters, 2048 bit long safe prime, generator 2 This is going to take a long time ................................+................ -After a long wait we can move to generation of the last key. This is key for TLS-authentication. Here is a command for it: +在漫长的等待之后,我们可以继续生成最后的密钥了,该密钥用于TLS验证。命令如下: openvpn --genkey --secret keys/ta.key -Now, generation completed and we can move all generated files to the final location. +现在,生成完毕,我们可以移动所有生成的文件到最后的位置中。 cp -r /etc/openvpn/easy-rsa/2.0/keys/ /etc/openvpn/ -Finally we create OpenVPN configuration file. Let's copy it from example: +最后,我们来创建OpenVPN配置文件。让我们从样例中拷贝过来吧: cp /usr/share/doc/openvpn/examples/sample-config-files/server.conf.gz /etc/openvpn/ cd /etc/openvpn gunzip -d /etc/openvpn/server.conf.gz -Then edit it +然后编辑 vim /etc/openvpn/server.conf -We need to specify custom paths to keys +我们需要指定密钥的自定义路径 ca /etc/openvpn/keys/ca.crt cert /etc/openvpn/keys/server.crt key /etc/openvpn/keys/server.key # This file should be kept secret dh /etc/openvpn/keys/dh2048.pem -That's all. After restart of OpenVPN configuration of server side is complete. +一切就绪。在重启OpenVPN后,服务器端配置就完成了。 service openvpn restart -### Client side configuration for Unix ### +### Unix的客户端配置 ### -Suppose we have a device with Unix like operation system, for example Ubuntu 15.04, and with installed OpenVPN. We want to connect to OpenVPN server from previous section. Firstly we need a key for the client. For generation of this key go to folder on server: +假定我们有一台装有类Unix操作系统的设备,比如Ubuntu 15.04,并安装有OpenVPN。我们想要从先前的部分连接到OpenVPN服务器。首先,我们需要为客户端生成密钥。为了生成该密钥,请转到服务器上的目录中: cd /etc/openvpn/easy-rsa/2.0 -Load environment variables +加载环境变量 source vars -and create a client key +然后创建客户端密钥 ./build-key client -We will see a same dialog as described in previous section on part about server key generation. Fill actual information about client in it. +我们将看到一个与先前关于服务器密钥生成部分的章节描述一样的对话,填入客户端的实际信息。 -You need run other command in case of requirement of password protect key. Here it is +如果需要密码保护密钥,你需要运行另外一个命令,命令如下 ./build-key-pass client -In this case you will be prompted to input password in beginning of establishing of VPN connection. +在此种情况下,在建立VPN连接时,会提示你输入密码。 -Now we need to copy follows files from server to client into /etc/openvpn/keys/ folder. +现在,我们需要将以下文件从服务器拷贝到客户端/etc/openvpn/keys/文件夹。 -List of files from server: +服务器文件列表: - ca.crt, - dh2048.pem, @@ -207,7 +206,7 @@ List of files from server: - client.key, - ta.key. -After that we go to the client and prepare configuration file. Location of file is /etc/openvpn/client.conf and content of it presents below +在此之后,我们转到客户端,准备配置文件。配置文件位于/etc/openvpn/client.conf,内容如下 dev tun proto udp @@ -234,15 +233,15 @@ After that we go to the client and prepare configuration file. Location of file verb 3 mute 20 -After that we need to restart OpenVPN for accepting a new configuration. +在此之后,我们需要重启OpenVPN以接受新配置。 service openvpn restart -That's it, the configuration of the client is over. +好了,客户端配置完成。 -### Client side configuration for Android ### +### 安卓客户端配置 ### -Configuration of OpenVPN on Android devices is quite similar to configuration on Unix system. We need a pack with a configuration file, with a keys and with a certificates. Here is a list of them: +安卓设备上的OpenVPN配置和Unix系统上的十分类似,我们需要一个含有配置文件、密钥和证书的包。文件列表如下: - configuration file (.ovpn), - ca.crt, @@ -250,9 +249,9 @@ Configuration of OpenVPN on Android devices is quite similar to configuration on - client.crt, - client.key. -Client key can be generated by the same way as described in previous section. +客户端密钥生成方式和先前章节所述的一样。 -Configuration file has a follows content +配置文件内容如下 client tls-client dev tun @@ -273,11 +272,11 @@ Configuration file has a follows content verb 3 mute 20 -All this files we must to move on SD-card of our device. +所有这些文件我们必须移动我们设备的SD卡上。 -Then we need to install [OpenVPN Connect][2]. +然后,我们需要安装[OpenVPN连接][2]。 -Next configuration process is very simple: +接下来,配置过程很是简单: open setting of OpenVPN and select Import options select Import Profile from SD card option @@ -285,18 +284,18 @@ Next configuration process is very simple: application offered us to create a new profile tap on the Connect button and wait a second -And thats all. Now our Android device has connection to our private network using secure VPN connection. +搞定。现在,我们的安卓设备已经通过安全的VPN连接连接到我们的专用网。 -### Conclusion ### +### 尾声 ### -So, initial configuration of OpenVPN takes a time, but it is compensated by easy clients configuration and the ability to connect from any device. Moreover OpenVPN provided a high security level and ability to connection from different places including clients located behind NAT. Therefore OpenVPN may equally well be used both at home and in enterprise. +虽然OpenVPN初始配置花费不少时间,但是简易客户端配置为我们弥补了时间上的损失,也提供了从任何设备连接的能力。此外,OpenVPN提供了一个很高的安全等级,以及从不同地方连接的能力,包括位于NAT后面的客户端。因此,OpenVPN可以同时在家和在企业中使用。 -------------------------------------------------------------------------------- via: http://linoxide.com/ubuntu-how-to/configure-openvpn-server-client-ubuntu-15-04/ 作者:[Ivan Zabrovskiy][a] -译者:[译者ID](https://github.com/译者ID) +译者:[GOLinux](https://github.com/GOLinux) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 3950a2433fea940a701e303e734a357abc88c69c Mon Sep 17 00:00:00 2001 From: wi-cuckoo Date: Thu, 4 Jun 2015 10:24:27 +0800 Subject: [PATCH 253/965] translated wi-cuckoo --- ... X GNU Open Source and Apple in History.md | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 translated/talk/20150520 Is Linux Better than OS X GNU Open Source and Apple in History.md diff --git a/translated/talk/20150520 Is Linux Better than OS X GNU Open Source and Apple in History.md b/translated/talk/20150520 Is Linux Better than OS X GNU Open Source and Apple in History.md new file mode 100644 index 0000000000..667a951f39 --- /dev/null +++ b/translated/talk/20150520 Is Linux Better than OS X GNU Open Source and Apple in History.md @@ -0,0 +1,57 @@ +Linux比Mac OS X更好吗?历史中的GNU,开源和Apple +============================================================================== +> 自由软件/开源社区与Apple之间的争论可以回溯到上世纪80年代,当时Linux的创始人称Mac OS X的核心就是"一个废物",还有其他一些软件历史上的轶事。 + +![](http://thevarguy.com/site-files/thevarguy.com/files/imagecache/medium_img/uploads/2015/05/untitled_2.png) + +开源拥护者们与微软之间有着很长,而且摇摆的关系。每个人都知道这个。但是,在许多方面,自由或者开源软件的支持者们与Apple之间的紧张关系则更加突出——尽管这很少受到媒体的关注。 + +需要说明的是,并不是所有的开源拥护者都厌恶苹果。Anecdotally(待译),我已经见过很多Linux的黑客玩弄iPhones和iPads。实际上,许多Linux用户是十分喜欢Apple的OS X系统的,以至于他们[创造了很多Linux的发行版][1],都设计得看起来像OS X。(顺便说下,[北朝鲜政府][2]就这样做了。) + +但是Mac的信徒与企鹅——即Linux社区(未提及自由与开源软件世界的小众群体)的信徒之间的关系,并不一直是完全的和谐。并且这绝不是一个新的现象,在我研究Linux历史和开源基金会的时候就发现了。 + +### GNU vs. Apple ### + +这场战争将回溯到至少上世界80年代后期。1988年6月,Richard Stallman发起了[GNU][3]项目,希望建立一个完全自由的类Unix操作系统,其源代码讲会免费共享,[[强烈指责][4]Apple对[Hewlett-Packard][5](HPQ)和[Microsoft][6](MSFT)的诉讼,称Apple的声明中,说别人对Macintosh操作系统的界面和体验的抄袭是不正确。如果Apple流行,GNU警告到,这家公司“将会借助大众的新力量终结掉自由软件,而自由软件可以成为商业软件的替代品。” + +那个时候,GNU对抗Apple的诉讼(这意味着,十分讽刺的是,GNU正在支持Microsoft,尽管当时的情况不一样),通过发布["让你的律师远离我的电脑”按钮][7]。同时呼吁GNU的支持者们抵制Apple,警告如果Macintoshes看起来是不错的计算机,但Apple一旦赢得了诉讼就会给市场带来垄断,这会极大地提高计算机的售价。 + +Apple最终[输掉了诉讼][8],但是直到1994年之后,GNU才[撤销对Apple的抵制][9]。这期间,GNU一直不断指责Apple。在上世纪90年代早期甚至之后,GNU开始发展GNU软件项目,可以在其他个人电脑平台包括MS-DOS上使用。[GNU 宣称][10],除非Apple停止在计算机领域垄断的野心,让用户界面可以模仿Macintosh的一些东西,否则“我们不会提供任何对Apple机器的支持。”(因此讽刺的是一大堆软件都开发了OS X和类Unix系统的版本,于是Apple在90年代后期介绍这些软件来自GNU。但是那是另外的故事了。) + +### Trovalds on Jobs ### + +除去他对大多数发行版比较自由放任的态度,Liuns Trovalds,Linux内核的创造者,相较于Stallman和GNU过去对Apple的态度没有多一点仁慈。在他2001年出版的书"Just For Fun: The Story of an Accidental Revolutionary"中,Trovalds描述到与Steve Jobs的一个会面,大约是1997年收到后者的邀请去讨论Mac OS X,Apple正在开发,但还没有公开发布。 + +"基本上,Jobs一开始就试图告诉我在桌面上的玩家就两个,Microsoft和Apple,而且他认为我能为Linux做的最好的事,就是从了Apple,努力让开源用户站到Mac OS X后面去"Trovalds写道。 + +这次谈判显然让Trovalds很不爽。争吵的一点集中在Trovalds对Mach技术上的藐视,对于Apple正在用于构建新的OS X操作系统的内核,Trovalds称其“一推废物。它包含了所有你能做到的设计错误,并且甚至打算只弥补一小部分。” + +但是更令人不快的是,显然是Jobs在开发OS X时入侵开源的方式(OS X的核心里上有很多开源程序):“他有点贬低了结构的瑕疵:谁在乎基础操作系统,真正的low-core东西是不是开源,如果你有Mac层在最上面,这不是开源?” + +一切的一切,Trovalds总结到,Jobs“并没有使用太多争论。他仅仅很简单地说着,胸有成竹地认为我会对与Apple合作感兴趣”。“他没有任何线索,不能去想像还会有人并不关心Mac市场份额的增长。我认为他真的感到惊讶了,当我表现出对Mac的市场有多大,或者Microsoft市场有多大的可怜的关心时。” + +当然,Trovalds并没有对所有Linux用户说起。他对于OS X和Apple的看法从2001年开始就渐渐软化了。但实际上,早在2000年,Linux社区的领导角色表现出对Apple和其高层的傲慢的深深的鄙视,可以看出一些重要的东西,关于Apple和开源/自由软件世界的矛盾是多么的根深蒂固。 + +从以上两则历史上的花边新闻中,可以看到关于Apple产品价值的重大争议,即是否该公司致力于提升软硬件的质量,或者仅仅是借市场的小聪明获利,后者会让Apple产品卖出更多的钱,**********(该处不知如何翻译)。但是不管怎样,我会暂时置身讨论之外。 + +-------------------------------------------------------------------------------- + +via: http://thevarguy.com/open-source-application-software-companies/051815/linux-better-os-x-gnu-open-source-and-apple- + +作者:[Christopher Tozzi][a] +译者:[wi-cuckoo](https://github.com/wi-cuckoo) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://thevarguy.com/author/christopher-tozzi +[1]:https://www.linux.com/news/software/applications/773516-the-mac-ifying-of-the-linux-desktop/ +[2]:http://thevarguy.com/open-source-application-software-companies/010615/north-koreas-red-star-linux-os-made-apples-image +[3]:http://gnu.org/ +[4]:https://www.gnu.org/bulletins/bull5.html +[5]:http://www.hp.com/ +[6]:http://www.microsoft.com/ +[7]:http://www.duntemann.com/AppleSnakeButton.jpg +[8]:http://www.freibrun.com/articles/articl12.htm +[9]:https://www.gnu.org/bulletins/bull18.html#SEC6 +[10]:https://www.gnu.org/bulletins/bull12.html From 3c66fcac4841a287294529ba8f258db431e7e7da Mon Sep 17 00:00:00 2001 From: joeren Date: Thu, 4 Jun 2015 12:53:11 +0800 Subject: [PATCH 254/965] Update 20150126 Installing Cisco Packet tracer in Linux.md --- sources/tech/20150126 Installing Cisco Packet tracer in Linux.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20150126 Installing Cisco Packet tracer in Linux.md b/sources/tech/20150126 Installing Cisco Packet tracer in Linux.md index c55a04c12c..0e5b7ba519 100644 --- a/sources/tech/20150126 Installing Cisco Packet tracer in Linux.md +++ b/sources/tech/20150126 Installing Cisco Packet tracer in Linux.md @@ -1,3 +1,4 @@ +Translating by GOLinux! Installing Cisco Packet tracer in Linux ================================================================================ ![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/Main_picture.png) From 79ca3d1f697e56265c4d18f61f460a967486a22c Mon Sep 17 00:00:00 2001 From: GOLinux Date: Thu, 4 Jun 2015 13:32:15 +0800 Subject: [PATCH 255/965] [Translated]20150126 Installing Cisco Packet tracer in Linux.md --- ...Installing Cisco Packet tracer in Linux.md | 198 ------------------ ...Installing Cisco Packet tracer in Linux.md | 197 +++++++++++++++++ 2 files changed, 197 insertions(+), 198 deletions(-) delete mode 100644 sources/tech/20150126 Installing Cisco Packet tracer in Linux.md create mode 100644 translated/tech/20150126 Installing Cisco Packet tracer in Linux.md diff --git a/sources/tech/20150126 Installing Cisco Packet tracer in Linux.md b/sources/tech/20150126 Installing Cisco Packet tracer in Linux.md deleted file mode 100644 index 0e5b7ba519..0000000000 --- a/sources/tech/20150126 Installing Cisco Packet tracer in Linux.md +++ /dev/null @@ -1,198 +0,0 @@ -Translating by GOLinux! -Installing Cisco Packet tracer in Linux -================================================================================ -![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/Main_picture.png) - -### What is Cisco Packet tracer ? ### - -**Cisco Packet tracer** is a powerful network simulator tool which used to trained while we do some Cisco certifications. It provide us good Interface view for every router’s, and networking devices which with many options same as using the physical machines we can use unlimited devices in a network. We can create multiple network in single project to get trained like a professionals. packet tracer will provide us with simulated application layer protocols such as **HTTP**, **DNS**, Routing with **RIP**, **OSPF**, **EIGRP** etc. - -Now it has been released including **ASA 5505 firewall** with command line configurations. Packet tracer available commonly for Windows, but not for Linux distributions. Here we can download and get install Cisco package tracer. - -#### Newly released version of Cisco packet tracer: #### - -The next Cisco Packet Tracer version will be Cisco Packet Tracer 6.2 currently it’s under development. - -### My Environment Setup: ### - -**Hostname** : desktop1.unixmen.com - -**IP address** : 192.168.0.167 - -**Operating system** : Ubuntu 14.04 LTS Desktop - - # hostname - - # ifconfig | grep inet - - # lsb_release -a - -![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/pkt_001.png) - -### Step 1: First we need to download the Cisco Packet tracer. ### - -To download Packet Tracer from official website we need to have a token, sign into Cisco NetSpace and select CCNA > Cisco Packet Tracer from the Offerings menu to start the download. If we don’t have a token you can get from below link which i have uploaded in Dropbox. - -Official Website: [https://www.netacad.com/][1] - -Many of them don’t have a token to download packet tracer. For that i have uploaded it in dropbox you can get packet tracer from below URL. - -[Download Cisco Packet Tracer 6.1.1][2] - -![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/pkt_002.png) - -### Step 2: Install Java: ### - -To get install packet tracer we need to have install Java, To get install java we can use the default or add the PPA repository and update the package cache to get install java. - -Install the default jre using - - # sudo apt-get install default-jre - -![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/pkt_003.png) - -(or) - -Use the below step to get install Java Run-time and set the Environment. - -Download Java from official website : [Download Java][3] - - # tar -zxvf jre-8u31-linux-x64.tar.gz - - # sudo mkdir -p /usr/lib/jvm - - # sudo mv -v jre1.8.0_31 /usr/lib/jvm/ - - # cd /usr/lib/jvm/ - - # sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jre1.8.0_31/bin/java" 1 - - # sudo update-alternatives --set "java" "/usr/lib/jvm/jre1.8.0_31/bin/java" - -Set the environment for java by editing the profile file and add the location. While we adding in profile file java will available for every user’s in our machine. - - # sudo vi /etc/profile - -Add the following entries to the bottom of your /etc/profile file: - - export JAVA_HOME=/usr/lib/jvm/jre1.8.0_31 - export PATH=$PATH:/usr/java/jre1.8.0_31/bin - -Run the below command to activate java path immediately. - - # . /etc/profile - -Check for the Java version and Environment: - - # echo $JAVA_HOME - - # java -version - -![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/pkt_004.png) - -### Step 3: Enable 32bit architecture support: ### - -For Packet tracer we need some of 32bit packages. To get install 32bit packages we need to install some of dependencies using below commands. - - # sudo dpkg --add-architecture i386 - # sudo apt-get update - -![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/pkt_005.png) - - # sudo apt-get install libc6:i386 - - # sudo apt-get install lib32z1 lib32ncurses5 lib32bz2-1.0 - - # sudo apt-get install libnss3-1d:i386 libqt4-qt3support:i386 libssl1.0.0:i386 libqtwebkit4:i386 libqt4-scripttools:i386 - -![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/pkt_006.png) - -### Step 4: Extract and install the package: ### - -Extract the downloaded package using tar command. - - # mv Cisco\ Packet\ Tracer\ 6.1.1\ Linux.tar.gz\?dl\=0 Cisco_Packet_tracer.tar.gz - - # tar -zxvf Cisco_Packet_tracer.tar.gz - -![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/pkt_007.png) - -Navigate to the extracted directory - - # cd PacketTracer611Student - -Now it’s time to start the installation , Installation is very simple and just take few seconds. - - # sudo ./install - -![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/pkt_008.png) - -![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/pkt_009.png) - -To working with Package tracer we need to set the environment for that Cisco have provided the environment script, We need to run the script using root user to set the environment variable. - - # sudo ./set_ptenv.sh - -![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/pkt_010.png) - -That’s it for installation step’s. next we need to create a Desktop Icon for Packet tracer. - -Create the Desktop Icon by creating desktop file under. - - # sudo su - - # cd /usr/share/applications - - # sudo vim packettracer.desktop - -![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/pkt_011.png) - -Append the Below content to the file using vim editor or your favourite one. - - [Desktop Entry] - Name= Packettracer - Comment=Networking - GenericName=Cisco Packettracer - Exec=/opt/packettracer/packettracer - Icon=/usr/share/icons/packettracer.jpeg - StartupNotify=true - Terminal=false - Type=Application - -Save and quit using wq! - -![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/pkt_012.png) - -### Step 5: Run the packet tracer ### - - # sudo packettracer - -That’s it we have successfully installed the packet tracer in Linux, These above steps are suitable for every debian based Linux distributions. - -![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/pkt_013.png) - -![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/pkt_014.png) - -### Resources ### - -Home page:[Netacad][4] - -### Conclusion: ### - -Here we have seen how to install packet tracer in Linux distribution, Hope you have find a way to get install your favorite Simulator in Linux. - --------------------------------------------------------------------------------- - -via: http://www.unixmen.com/installing-cisco-packet-tracer-linux/ - -作者:[babin][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://www.unixmen.com/author/babin/ -[1]:https://www.netacad.com/ -[2]:https://www.dropbox.com/s/5evz8gyqqvq3o3v/Cisco%20Packet%20Tracer%206.1.1%20Linux.tar.gz?dl=0 -[3]:http://www.oracle.com/technetwork/java/javase/downloads/jre8-downloads-2133155.html -[4]:https://www.netacad.com/ diff --git a/translated/tech/20150126 Installing Cisco Packet tracer in Linux.md b/translated/tech/20150126 Installing Cisco Packet tracer in Linux.md new file mode 100644 index 0000000000..e37d8c6b94 --- /dev/null +++ b/translated/tech/20150126 Installing Cisco Packet tracer in Linux.md @@ -0,0 +1,197 @@ +Linux中安装Cisco Packet Tracer +================================================================================ +![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/Main_picture.png) + +### Cisco Packet tracer是什么? ### + +**Cisco Packet Tracer**是一个强大的网络模拟工具,用于进行Cisco认证时的训练。它为我们提供了各个路由器和网络设备的良好的接口视图,这些模拟设备带有很多选项,跟使用物理机一样,我们可以在网络中使用无限的设备。我们能在单个工程中创建多个网络,以获得专业化的训练。Packet Tracer将提供给我们模拟的应用层协议,如**HTTP**,**DNS**,以及像**RIP**,**OSPF**,**EIGRP**等路由协议。 + +现在,它发布了包含有**ASA 5505防火墙**命令行配置的版本。Packet Tracer通常用于Windows版本,但没有Linux版本。这里,我们可以下载并安装Cisco Packet Tracer。 + +#### 新发布的Cisco Packet Tracer版本: #### + +下一代Cisco Packet Tracer版本将会是Cisco Packet Tracer 6.2,当前还处于开发中。 + +### 我的环境设置: ### + +**主机名** : desktop1.unixmen.com + +**IP地址** : 192.168.0.167 + +**操作系统** : Ubuntu 14.04 LTS Desktop + + # hostname + + # ifconfig | grep inet + + # lsb_release -a + +![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/pkt_001.png) + +### 步骤 1: 首先,我们需要下载Cisco Packet Tracer。 ### + +要从官方网站下载Packet Tracer,我们需要持有一个令牌,登入Cisco NetSpace,然后从Offering菜单选择CCNA > Cisco Packet Tracer来开始下载。如果我们没有令牌,可以从下面的链接中获得,我已经将它上传到了Droppox。 + +官方站点: [https://www.netacad.com/][1] + +大多数人没有下载Packet Tracer的令牌,出于该原因,我已经将它上传到了dropbox,你可以从下面的URL获得Packet Tracer。 + +[下载Cisco Packet Tracer 6.1.1][2] + +![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/pkt_002.png) + +### 步骤 2: 安装Java: ### + +要安装Packet Tracer,我们需要安装java。要安装java,我们可以使用默认的仓库,或者添加PPA仓库,然后更新包缓存来安装java。 + +使用以下命令来安装默认的jre + + # sudo apt-get install default-jre + +![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/pkt_003.png) + +(或者) + +使用下面的步骤来安装Java Run-time并设置环境。 + +从官方站点下载Java:[下载Java][3] + + # tar -zxvf jre-8u31-linux-x64.tar.gz + + # sudo mkdir -p /usr/lib/jvm + + # sudo mv -v jre1.8.0_31 /usr/lib/jvm/ + + # cd /usr/lib/jvm/ + + # sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jre1.8.0_31/bin/java" 1 + + # sudo update-alternatives --set "java" "/usr/lib/jvm/jre1.8.0_31/bin/java" + +通过编辑用户参数文件来设置Java环境,并添加位置参数。当我们添加进用户参数文件后,我们机器上的每个用户都可以用java了。 + + # sudo vi /etc/profile + +将以下条目添加到/etc/profile文件中: + + export JAVA_HOME=/usr/lib/jvm/jre1.8.0_31 + export PATH=$PATH:/usr/java/jre1.8.0_31/bin + +运行以下命令来立即激活java路径。 + + # . /etc/profile + +检查Java版本和环境: + + # echo $JAVA_HOME + + # java -version + +![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/pkt_004.png) + +### 步骤 3: 启用32位架构支持: ### + +对于Packet Tracer,我们需要一系32位包。要安装32位包,我们需要使用以下命令来安装一些依赖。 + + # sudo dpkg --add-architecture i386 + # sudo apt-get update + +![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/pkt_005.png) + + # sudo apt-get install libc6:i386 + + # sudo apt-get install lib32z1 lib32ncurses5 lib32bz2-1.0 + + # sudo apt-get install libnss3-1d:i386 libqt4-qt3support:i386 libssl1.0.0:i386 libqtwebkit4:i386 libqt4-scripttools:i386 + +![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/pkt_006.png) + +### 步骤 4: 解压并安装软件包: ### + +使用tar命令来解压下载的包。 + + # mv Cisco\ Packet\ Tracer\ 6.1.1\ Linux.tar.gz\?dl\=0 Cisco_Packet_tracer.tar.gz + + # tar -zxvf Cisco_Packet_tracer.tar.gz + +![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/pkt_007.png) + +导航到解压后的目录 + + # cd PacketTracer611Student + +现在,该开始安装了。安装过程很简单,只需几秒钟即可搞定。 + + # sudo ./install + +![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/pkt_008.png) + +![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/pkt_009.png) + +要使用Packet Tracer工作,我们需要设置环境,Cisco已经提供了环境脚本,我们需要以root用户来运行该脚本以设置环境变量。 + + # sudo ./set_ptenv.sh + +![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/pkt_010.png) + +安装到此结束。接下来,我们需要为Packet Tracer创建桌面图标。 + +通过创建下面的桌面文件来创建桌面图标。 + + # sudo su + + # cd /usr/share/applications + + # sudo vim packettracer.desktop + +![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/pkt_011.png) + +使用vim编辑器或你喜爱的那个编辑器来添加以下内容到文件。 + + [Desktop Entry] + Name= Packettracer + Comment=Networking + GenericName=Cisco Packettracer + Exec=/opt/packettracer/packettracer + Icon=/usr/share/icons/packettracer.jpeg + StartupNotify=true + Terminal=false + Type=Application + +使用wq!来保存并退出。 + +![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/pkt_012.png) + +### 步骤 5: 运行Packet Tracer ### + + # sudo packettracer + +好了,我们已经成功将Packet Tracer安装到Linux中。上述安装步骤适用于所有基于Debian的Linux发行版。 + +![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/pkt_013.png) + +![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/pkt_014.png) + +### 资源 ### + +主页:[Netacad][4] + +### 尾声: ### + +这里,我们展示了如何安装Packet Tracer到Linux发行版中。希望你们找到了将你们所钟爱的模拟器安装到Linux中的方法。 + +-------------------------------------------------------------------------------- + +via: http://www.unixmen.com/installing-cisco-packet-tracer-linux/ + +作者:[babin][a] +译者:[GOLinux](https://github.com/GOLinux) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://www.unixmen.com/author/babin/ +[1]:https://www.netacad.com/ +[2]:https://www.dropbox.com/s/5evz8gyqqvq3o3v/Cisco%20Packet%20Tracer%206.1.1%20Linux.tar.gz?dl=0 +[3]:http://www.oracle.com/technetwork/java/javase/downloads/jre8-downloads-2133155.html +[4]:https://www.netacad.com/ From 62df253c12a3198b773c52006e4344bf25a81213 Mon Sep 17 00:00:00 2001 From: DeadFire Date: Thu, 4 Jun 2015 15:25:54 +0800 Subject: [PATCH 256/965] =?UTF-8?q?20150604-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ports systemd and Google Cloud Platform.md | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 sources/news/20150604 Ubuntu's Juju Now Supports systemd and Google Cloud Platform.md diff --git a/sources/news/20150604 Ubuntu's Juju Now Supports systemd and Google Cloud Platform.md b/sources/news/20150604 Ubuntu's Juju Now Supports systemd and Google Cloud Platform.md new file mode 100644 index 0000000000..6061e78c87 --- /dev/null +++ b/sources/news/20150604 Ubuntu's Juju Now Supports systemd and Google Cloud Platform.md @@ -0,0 +1,29 @@ +Ubuntu's Juju Now Supports systemd and Google Cloud Platform +================================================================================ +> The Juju tool has been updated to version 1.23.3 + +**Udi Nachmany, Director of Ubuntu Certified Public Cloud at Canonical, announced the release of a new version of Juju, an open-source, solution-driven orchestration tool for Ubuntu Linux.** + +According to the [announcement][1] and the official [release notes][2], Juju 1.23.3 is quite a major version that packs a lot of goodies for those of you who want to scale and manage environments on any cloud without too much hassle. + +Prominent features of Juju 1.23.3 include support for Google Compute Engine (GCE), support for the systemd init system, support for Ubuntu 15.04 (Vivid Vervet), new charm actions, as well as better proxy support for for restrictive networks. + +Additionally, the recently announced Juju release brings a new style restore, new messages, new blocks, and experimental support for Service Leader Elections, as well as addressable LXC containers and KVM instances on Ubuntu MAAS and AWS. + +"On a related note, if you’re using Google Cloud Platform you’ve probably taken a look at the sleek Cloud Launcher Google have released recently. And if you looked closely, you also noticed that you can now spin up your Ubuntu VMs using this very friendly UI," says Udi Nachmany. + +![](http://i1-news.softpedia-static.com/images/news2/Ubuntu-s-Juju-Now-Supports-systemd-and-Google-Cloud-Platform-483279-2.jpg) + +-------------------------------------------------------------------------------- + +via: http://linux.softpedia.com/blog/Ubuntu-s-Juju-Now-Supports-systemd-and-Google-Cloud-Platform-483279.shtml + +作者:[Marius Nestor][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://news.softpedia.com/editors/browse/marius-nestor +[1]:http://insights.ubuntu.com/2015/06/03/juju-support-for-google-cloud-platform/ +[2]:https://jujucharms.com/docs/devel/reference-release-notes \ No newline at end of file From 217963ac06084eab40603a86277ff7d159497738 Mon Sep 17 00:00:00 2001 From: DeadFire Date: Thu, 4 Jun 2015 15:42:20 +0800 Subject: [PATCH 257/965] =?UTF-8?q?20150604-2=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...nts in 2014--download the Annual Report.md | 33 ++++ ...stall Unity 8 Desktop Preview In Ubuntu.md | 77 ++++++++ ...4 How to access SQLite database in Perl.md | 171 ++++++++++++++++++ 3 files changed, 281 insertions(+) create mode 100644 sources/share/20150604 Read about The Document Foundation achievements in 2014--download the Annual Report.md create mode 100644 sources/tech/20150604 How To Install Unity 8 Desktop Preview In Ubuntu.md create mode 100644 sources/tech/20150604 How to access SQLite database in Perl.md diff --git a/sources/share/20150604 Read about The Document Foundation achievements in 2014--download the Annual Report.md b/sources/share/20150604 Read about The Document Foundation achievements in 2014--download the Annual Report.md new file mode 100644 index 0000000000..518e96c171 --- /dev/null +++ b/sources/share/20150604 Read about The Document Foundation achievements in 2014--download the Annual Report.md @@ -0,0 +1,33 @@ +Read about The Document Foundation achievements in 2014: download the Annual Report! +================================================================================ +![](https://documentfoundation.files.wordpress.com/2015/06/tdf-report.jpg) + +TDF ReportThe Document Foundation (TDF) is proud to announce its 2014 Annual Report, which can be downloaded from the following link: [http://tdf.io/report2014][1] (3.2 MB PDF). The version with HD images can be downloaded from [http://tdf.io/report2014hq][2] (15.9 MB PDF). + +TDF Annual Report starts with a Review of 2014, with highlights about TDF and LibreOffice, and a summary of financials and budget. + +Community, Projects & Events covers the LibreOffice Conference 2014 in Bern, Certification, Website and QA, Hackfests in Brussels, Gran Canaria, Paris, Boston and Tolouse, Native-Language Projects, Infrastructure, Documentation, Marketing and Design. + +Software, Development & Code reports about the activities of the Engineering Steering Committee, LibreOffice Development, the Document Liberation Project and LibreOffice on Android. + +The last section focuses on People, starting with Top Contributors, followed by TDF Staff, the Board of Directors and the Membership Committee, the Board of Trustees, or the body of TDF Members, and the Advisory Board. + +TDF 2014 Annual Report has been edited by Sophie Gautier, Alexander Werner, Christian Lohmaier, Florian Effenberger, Italo Vignoli and Robinson Tryon, and designed by Barak Paz, with the help of the fantastic LibreOffice community. + +To allow the widest distribution of the document, this is released with a CC BY 3.0 DE License, unless otherwise noted, to TDF Members and free software advocates worldwide. + +[The German version of TDF Annual Report is available from [http://tdf.io/bericht2014][3]]. + +-------------------------------------------------------------------------------- + +via: http://blog.documentfoundation.org/2015/06/03/read-about-the-document-foundation-achievements-in-2014-download-the-annual-report/ + +作者:italovignoli +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[1]:https://wiki.documentfoundation.org/File:TDF2014AnnualReport.pdf +[2]:https://wiki.documentfoundation.org/File:TDF2014AnnualReportHQ.pdf +[3]:https://wiki.documentfoundation.org/File:TDF2014AnnualReportDE.pdf \ No newline at end of file diff --git a/sources/tech/20150604 How To Install Unity 8 Desktop Preview In Ubuntu.md b/sources/tech/20150604 How To Install Unity 8 Desktop Preview In Ubuntu.md new file mode 100644 index 0000000000..219433905e --- /dev/null +++ b/sources/tech/20150604 How To Install Unity 8 Desktop Preview In Ubuntu.md @@ -0,0 +1,77 @@ +How To Install Unity 8 Desktop Preview In Ubuntu +================================================================================ +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/06/Unity_8.jpeg) + +If you have been following the news, Ubuntu will be switching to [Mir display server][1] along with [Unity 8][2] desktop. While it is still not certain if Unity 8 running on Mir will be available in [Ubuntu 15.10 Willy Werewolf][3], a preview version of Unity 8 is available for you to try and test. With the official PPA, it is really easy to **install Unity 8 in Ubuntu 14.04, 14.10 and 15.04**. + +Until now, this Unity 8 desktop preview has been available via an [ISO][4] for (primarily) developers to test it. But Canonical has made it available through [LXC containers][5]. By using this method you get a Unity 8 desktop session running on Mir display server as any desktop environment. It’s like as if you [install Mate desktop in Ubuntu][6] and choose the desktop session from the LightDm login screen. + +Curious to give Unity 8 a try? Let’s see how to install it. + +**Note: It’s an experimental preview and may not work properly for everyone.** + +### Install Unity 8 desktop in Ubuntu ### + +Following are the steps to install and use Unity 8: + +#### Step 1: Install Unity 8 in Ubuntu 12.04 and 14.04 #### + +If you are running Ubuntu 12.04 and 14.04, you’ll have to use the official PPA to install Unity 8. Use the following command: + + sudo apt-add-repository ppa:unity8-desktop-session-team/unity8-preview-lxc + sudo apt-get update + sudo apt-get upgrade + sudo apt-get install unity8-lxc + +#### Step 1: Install Unity 8 in Ubuntu 14.10 and 15.04 #### + +If you are running Ubuntu 14.10 or 15.04, Unity 8 LXC is already in the sources. You just need to run the following commands: + + sudo apt-get update + sudo apt-get install unity8-lxc + +#### Step 2: Set up Unity 8 desktop preview LXC #### + +Once you have installed Unity 8 LXC, it’s time to set it up. Use the following command for this purpose: + + sudo unity8-lxc-setup + +It will take some time in set up, so have some patience. It downloads the ISO and then extracts it, and then any last bits of setup necessary to make it work. It will also install a slightly modified version of LightDM. Once everything is done, a restart is required. + +#### Step 3: Select Unity 8 #### + +After restarting, at login screen, click on the Ubuntu icon beside your login name: + +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2014/08/Change_Desktop_Environment_Ubuntu.jpeg) + +You should see the option of Unity 8 here. Select it: + +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/06/Select_Unity8.jpeg) + +### Uninstall Unity 8 LXC ### + +If you find Unity 8 too buggy or if you don’t like it, you can simply switch back to the default Unity version in similar fashion. Additionally, you can also remove Unity 8 using this command: + + sudo apt-get remove unity8-lxc + +This will remove the Unity 8 option from LightDM screen but the set-up will remain there. + +That’s all you need to do to install Unity 8 with Mir in Ubuntu. Do share what you think of Unity 8 when you try it out. + +-------------------------------------------------------------------------------- + +via: http://itsfoss.com/install-unity-8-desktop-ubuntu/ + +作者:[Abhishek][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://itsfoss.com/author/abhishek/ +[1]:http://en.wikipedia.org/wiki/Mir_%28software%29 +[2]:https://wiki.ubuntu.com/Unity8Desktop +[3]:http://itsfoss.com/ubuntu-15-10-codename/ +[4]:https://wiki.ubuntu.com/Unity8DesktopIso +[5]:https://wiki.ubuntu.com/Unity8inLXC +[6]:http://itsfoss.com/install-mate-desktop-ubuntu-14-04/ \ No newline at end of file diff --git a/sources/tech/20150604 How to access SQLite database in Perl.md b/sources/tech/20150604 How to access SQLite database in Perl.md new file mode 100644 index 0000000000..980917a3c5 --- /dev/null +++ b/sources/tech/20150604 How to access SQLite database in Perl.md @@ -0,0 +1,171 @@ +How to access SQLite database in Perl +================================================================================ +SQLite is a zero-configuration, server-less, file-based transactional database system. Due to its lightweight, self-contained, and compact design, SQLite is an extremely popular choice when you want to integrate a database into your application. In this post, I am going to show you how to create and access a SQLite database in Perl script. The Perl code snippet I present is fully functional, so you can easily modify and integrate it into your project. + +![](https://farm1.staticflickr.com/552/18444614631_9e7fce8243_c.jpg) + +### Preparation for SQLite Access ### + +I am going to use SQLite DBI Perl driver to connect to SQLite3. Thus you need to install it (along with SQLite3) on your Linux system. + +**Debian, Ubuntu or Linux Mint** + + $ sudo apt-get install sqlite3 libdbd-sqlite3-perl + +**CentOS, Fedora or RHEL** + + $ sudo yum install sqlite perl-DBD-SQLite + +After installation, you can check if the SQLite driver is indeed available by using the following script. + + #!/usr/bin/perl + + my @drv = DBI->available_drivers(); + print join("\n", @drv), "\n"; + +If you run the script, you should see SQLite in the output. + + DBM + ExampleP + File + Gofer + Proxy + SQLite + Sponge + +### Perl SQLite Access Example ### + +Here is the full-blown Perl code example of SQLite access. This Perl script will demonstrate the following SQLite database management routines. + +- Create and connect to a SQLite database. +- Create a new table in a SQLite database. +- Insert rows into a table. +- Search and iterate rows in a table. +- Update rows in a table. +- Delete rows in a table. + + use DBI; + use strict; + + # define database name and driver + my $driver = "SQLite"; + my $db_name = "xmodulo.db"; + my $dbd = "DBI:$driver:dbname=$db_name"; + + # sqlite does not have a notion of username/password + my $username = ""; + my $password = ""; + + # create and connect to a database. + # this will create a file named xmodulo.db + my $dbh = DBI->connect($dbd, $username, $password, { RaiseError => 1 }) + or die $DBI::errstr; + print STDERR "Database opened successfully\n"; + + # create a table + my $stmt = qq(CREATE TABLE IF NOT EXISTS NETWORK + (ID INTEGER PRIMARY KEY AUTOINCREMENT, + HOSTNAME TEXT NOT NULL, + IPADDRESS INT NOT NULL, + OS CHAR(50), + CPULOAD REAL);); + my $ret = $dbh->do($stmt); + if($ret < 0) { + print STDERR $DBI::errstr; + } else { + print STDERR "Table created successfully\n"; + } + + # insert three rows into the table + $stmt = qq(INSERT INTO NETWORK (HOSTNAME,IPADDRESS,OS,CPULOAD) + VALUES ('xmodulo', 16843009, 'Ubuntu 14.10', 0.0)); + $ret = $dbh->do($stmt) or die $DBI::errstr; + + $stmt = qq(INSERT INTO NETWORK (HOSTNAME,IPADDRESS,OS,CPULOAD) + VALUES ('bert', 16843010, 'CentOS 7', 0.0)); + $ret = $dbh->do($stmt) or die $DBI::errstr; + + $stmt = qq(INSERT INTO NETWORK (HOSTNAME,IPADDRESS,OS,CPULOAD) + VALUES ('puppy', 16843011, 'Ubuntu 14.10', 0.0)); + $ret = $dbh->do($stmt) or die $DBI::errstr; + + # search and iterate row(s) in the table + $stmt = qq(SELECT id, hostname, os, cpuload from NETWORK;); + my $obj = $dbh->prepare($stmt); + $ret = $obj->execute() or die $DBI::errstr; + + if($ret < 0) { + print STDERR $DBI::errstr; + } + while(my @row = $obj->fetchrow_array()) { + print "ID: ". $row[0] . "\n"; + print "HOSTNAME: ". $row[1] ."\n"; + print "OS: ". $row[2] ."\n"; + print "CPULOAD: ". $row[3] ."\n\n"; + } + + # update specific row(s) in the table + $stmt = qq(UPDATE NETWORK set CPULOAD = 50 where OS='Ubuntu 14.10';); + $ret = $dbh->do($stmt) or die $DBI::errstr; + + if( $ret < 0 ) { + print STDERR $DBI::errstr; + } else { + print STDERR "A total of $ret rows updated\n"; + } + + # delete specific row(s) from the table + $stmt = qq(DELETE from NETWORK where ID=2;); + $ret = $dbh->do($stmt) or die $DBI::errstr; + + if($ret < 0) { + print STDERR $DBI::errstr; + } else { + print STDERR "A total of $ret rows deleted\n"; + } + + # quit the database + $dbh->disconnect(); + print STDERR "Exit the database\n"; + +A successful run of the above Perl script will create a SQLite database file named "xmodulo.db", and show the following output. + + Database opened successfully + Table created successfully + ID: 1 + HOSTNAME: xmodulo + OS: Ubuntu 14.10 + CPULOAD: 0 + + ID: 2 + HOSTNAME: bert + OS: CentOS 7 + CPULOAD: 0 + + ID: 3 + HOSTNAME: puppy + OS: Ubuntu 14.10 + CPULOAD: 0 + + A total of 2 rows updated + A total of 1 rows deleted + Exit the database + +### Troubleshooting ### + +If you attempt to access SQLite in Perl without installing SQLite DBI driver, you will encounter the following error. You must install DBI driver as describe at the beginning to fix this error. + + Can't locate DBI.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at ./script.pl line 3. + BEGIN failed--compilation aborted at ./script.pl line 3. + +-------------------------------------------------------------------------------- + +via: http://xmodulo.com/access-sqlite-database-perl.html + +作者:[Dan Nanni][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://xmodulo.com/author/nanni \ No newline at end of file From 382a929890b2566c7b8a9557abd4606a837a0401 Mon Sep 17 00:00:00 2001 From: DeadFire Date: Thu, 4 Jun 2015 15:59:38 +0800 Subject: [PATCH 258/965] =?UTF-8?q?20150604-3=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...lobally Recognized Linux Certifications.md | 172 +++++++++++++++ ...Experience on Linux 'iptables' Firewall.md | 207 ++++++++++++++++++ 2 files changed, 379 insertions(+) create mode 100644 sources/share/20150604 12 Globally Recognized Linux Certifications.md create mode 100644 sources/tech/20150604 Nishita Agarwal Shares Her Interview Experience on Linux 'iptables' Firewall.md diff --git a/sources/share/20150604 12 Globally Recognized Linux Certifications.md b/sources/share/20150604 12 Globally Recognized Linux Certifications.md new file mode 100644 index 0000000000..714ff31fea --- /dev/null +++ b/sources/share/20150604 12 Globally Recognized Linux Certifications.md @@ -0,0 +1,172 @@ +12 Globally Recognized Linux Certifications +================================================================================ +Hi everyone, today we'll learn about some of the very precious globally recognized Linux Certifications. Linux Certifications are the certification programme hosted by different Linux Professional Institutes across the globe. Linux Certifications allows Linux Professionals to get easily enrolled with the Linux related jobs in servers, companies, etc. Linux Certifications enables how much a person is expertise in that respective field of Linux. There are pretty many Linux Professional Institutes providing different Linux Certifications. But there are some few well recognized Linux Certification Programmes running across the globe which are at high priority while getting a job in companies where we need to manage servers, virtualizations, installations, configurations, application support and other stuffs with Linux Operating System. With the increment of servers running Linux Operating System throughout the globe, the demand of Linux Professional are increasing. For better authenticated and authorized Linux Professional, better and renowned Certifications are always at higher priority by the companies across the globe. + +Here are some globally recognized Linux Certifications that we'll discuss about. + +### 1. CompTIA Linux+ ### + +CompTIA Linux+ is a Linux Certification programme hosted by LPI "Linux Professional Institute" providing knowledge all over the world. It provides knowledge on Linux which enables to produce a bunch of Linux related Professional jobs like Linux Administrators, Junior Network Administrators, Systems Administrators, Linux Database Administrators and Web Administrators. If anyone is aware of installing and maintaining Linux Operating System, this course will help to meet the certification requirements and prepare for the exam by providing with a broad awareness of Linux operating systems. The main objective of CompTIA Linux+ Certification by LPI is to provide the certificate holders enough knowledge on a critical knowledge of installation, operation, administration and troubleshooting devices. We can earn three industry-recognized certifications for the cost, time, and effort of one, by completing the CompTIA Linux+ powered by LPI certification, we can automatically receive the **LPI LPIC-1** and the **SUSE Certified Linux Administrator (CLA)** certifications. + +- **Certification Codes** : LX0-103 and LX0-104 (launches March 30, 2015) OR LX0-101 and LX0-102 +- Number of questions: 60 questions per exam +- Type of Questions: Multiple choice +- Length of test period: 90 minutes +- Prerequisites: A+, Network+ and at least 12 months of Linux administration experience +- Passing score: 500 (on a scale of 200-800) +- Languages: English. Coming soon on German, Portuguese (Brazilian), Traditional Chinese, Spanish. +- Validity: Valid till 3 Years after certified. + +**Note**: Exams from different series cannot be combined. If you start with LX0-101, you MUST take LX0-102 to complete your certification. The same applies for the LX0-103 and LX0-104 series. The LX0-103 and LX0-104 series is an update to the LX0-101 and LX0-102 series. + +### 2. LPIC ### + +LPIC stands for Linux Professional Institute Certification which is a Linux certification programme by Linux Professional Institute. It is a multi level certification program which requires passing of a number (usually two) certification exams for each level. There are three levels of certification which includes Junior Level Certification **LPIC-1**, Advanced Level Certification **LPIC-2** and Senior Level Certification **LPIC-3**. The first two certification aims on **Linux System Administration** whereas the final certification aims on several specialties including Virtualization and Security. To become **LPIC-3** certified, a candidate with an active **LPIC-1** and **LPIC-2** certification must pass at least one of 300 Mixed Environment, 303 Security and 304 Virtualization and High Availability. LPIC-1 certification is designed in such a way that the certification holder will be able to install, maintain, configure tasks running Linux with command line interface with basic networking where as LPIC-2 certification validates candidate to administer small to medium–sized mixed networks. LPIC-3 certification is designed for enterprise-level Linux professional and represents the highest level of professional, distribution-neutral Linux certification within the industry. + +- **Certification Codes** : LPIC-1 (101 and 102), LPIC-2 (201 and 202) and LPIC-3 (300, 303 or 304) +- Type of Questions: 60 Multiple choice questions +- Length of Test Period: 90 minutes +- Prerequisites: None, Linux Essentials is recommended +- Passing Score: 500 (on a scale of 200-800) +- Languages: LPIC-1: English, German, Italian, Portuguese (Brazilian), Spanish (Modern), Chinese (Simplified), Chinese (Traditional), Japanese +- LPIC-2: English, German, Portuguese (Brazilian), Japanese +- LPIC-3: English, Japanese +- Validity: Valid till 5 years of Retirement. + +### 3. Oracle Linux OCA ### + +Oracle Certified Associate (OCA) is designed for the individuals who are interested for a strong foundation of knowledge to implement and administer the Oracle Linux Operating System. This certification expertise individuals on the Oracle Linux distribution that's fully optimized for Oracle products and for running on Oracle's engineered systems including Oracle Exadata Database Machine, Oracle Exalytics In-Memory Machine, Oracle Exalogic Elastic Cloud, and Oracle Database Appliance. Oracle Linux's Unbreakable Enterprise Kernel delivers extreme performance, advanced scalability and reliability for enterprise applications. The OCA certification covers objectives such as managing local disk devices, managing file systems, installing and removing Solaris packages and patches, performing system boot procedures and system processes. It is initial step in achievement of flagship of OCP credential. This certification was formerly known as Sun Certified Solaris Associate (SCSAS). + +- **Certification Codes** : OCA +- Type of Questions: 75 Multiple choice questions +- Length of Test Period: 120 minutes +- Prerequisites: None +- Passing Score: 64% +- Validity: Never Expires + +### 4. Oracle Linux OCP ### + +Oracle Certified Professional (OCP) is the certification provided by Oracle Corporation for Oracle Linux which covers more advanced knowledge and skills of an Oracle Linux Administrator. It covers knowledge such as configuring network interfaces, managing swap configurations, crash dumps, managing applications, databases and core files. OCP certification is benchmark of technical expertise and professional skill needed for developing, implementing, and managing applications, middleware and databases widely in enterprise. Job opportunities for Oracle Linux OCP are increased depending on job market and economy. It is designed such a way that the certificate holder has the ability to perform security administration, prepare Oracle Linux system for Oracle database, troubleshoot problems and perform corrective action, install software packages, installing and configuring kernel modules, maintain swap space, perform User and Group administration, creating file systems, configuring logical volume manager (LVM), file sharing services and more. + +- **Certification Codes** : OCP +- Type of Questions: 60 to 80 Multiple choice questions +- Length of Test Period: 120 minutes +- Prerequisites: Oracle Linux OCA +- Passing Score: 64% +- Validity: Never Expires + +### 5. RHCSA ### + +RHCSA is a certification programme by Red Hat Incorporation as Red Hat Certified System Administrator. RHCSAs are the person who has the skill, and ability to perform core system administrations in the renowned Red Hat Linux environments. It is an initial entry-level certification programme that focuses on actual competencies at system administration, including installation and configuration of a Red Hat Linux system and attaching it to a live network running network services. A Red Hat Certified System Administrator (RHCSA) is able to understand and use essential tools for handling files, directories, command-line environments, and documentation, operate running systems, including booting into different run levels, identifying processes, starting and stopping virtual machines, and controlling services, configure local storage using partitions and logical volumes, create and configure file systems and file system attributes, such as permissions, encryption, access control lists, and network file systemsm, deploy, configure, and maintain systems, including software installation, update, and core services, manage users and groups, including use of a centralized directory for authentication, security, including basic firewall and SELinux configuration. One should be RHCSA certified to gain RHCE and other certifications. + +- **Certification Codes** : RHCSA +- Course Codes: RH124, RH134 and RH199 +- Exam Codes: EX200 +- Length of Test Period: 21-22 hours depending on the elective course choosen. +- Prerequisites: None. Better if has some fundamental knowledge of Linux. +- Passing Score: 210 out of 300 points (70%) +- Validity: 3 years + +### 6. RHCE ### + +RHCE, also known as Red Hat Certified Engineer is a mid to advanced level certification programme for Red Hat Certified System Administrator (RHCSA) who wants to acquire additional skills and knowledge required of a senior system administrator responsible for Red Hat Enterprise Linux. RHCE has the ability, knowledge and skills of configuring static routes, packet filtering, and network address translation, setting kernel runtime parameters, configuring an Internet Small Computer System Interface (iSCSI) initiator, producing and delivering reports on system utilization, using shell scripting to automate system maintenance tasks, configuring system logging, including remote logging, system to provide networking services including HTTP/HTTPS, File Transfer Protocol (FTP), network file system (NFS), server message block (SMB), Simple Mail Transfer Protocol (SMTP), secure shell (SSH) and Network Time Protocol (NTP) and more. RHCSAs who wish to earn a more senior-level credential and who have completed System Administration I, II, and II, or who have completed the RHCE Rapid Track Course is recommended to go for RHCE certification. + +- **Certification Codes** : RHCE +- Course Codes: RH124, RH134, RH254 and RH199 +- Exam Codes: EX200 and EX300 +- Length of Test Period: 21-22 hours depending on the elective course choosen. +- Prerequisites: A RHCSA credential +- Passing Score: 210 out of 300 (70%) +- Validity: 3 years + +### 7. RHCA ### + +RHCA stands for Red Hat Certified Architect which is a certification programme by Red Hat Incorporation. It focuses on actual competencies at system administration, including installation and configuration of a Red Hat Linux system and attaching it to a live network running network services. RHCA is the highest level of certification of all the Red Hat Certifications. Candidates are required to choose the concentration they wish to focus on or can choose any combination of eligible Red Hat certifications to create a custom concentration of their own. There are three main concentration Datacenter, Cloud and Application Platform. RHCA with the concentration of Datacenter has the skills and ability to work, manage a datacenter whereas with the concentration of Cloud has the ability create, configure and manage private, hybrid clouds, cloud application platforms, flexible storage solutions using Red Hat Enterprise Linux Platform. RHCA with the concentration of Application Platform includes skills like installing, configuring and managing Red Hat JBoss Enterprise Application Platform and applications, cloud application platforms and hybrid cloud environments with OpenShift Enterprise by Red Hat and federating data from multiple sources using Red Hat JBoss Data Virtualization. + +- **Certification Codes** : RHCA +- Course Codes: CL210,CL220,CL280, RH236, RH318,RH401,RH413, RH436,RH442,JB248 and JB450 +- Exam Codes: EX333, EX401, EX423 or EX318, EX436 and EX442 +- Length of Test Period: 21-22 hours depending on the elective course choosen. +- Prerequisites: Active RHCE credential +- Passing Score: 210 out of 300 (70%) +- Validity: 3 years + +### 8. SUSE CLA ### + +SUSE Certified Linux Administrator (SUSE CLA) is a initialcertification by SUSE which focuses on daily administration tasks in SUSE Linux Enterprise Server environments. To gain SUSE CLA certification, it is not necessary to perform the course work, one has to pass the examination to get certified. SUSE CLA are capable and has skills to use Linux Desktop, locate and use help resources, manage Linux File System, work with the Linux Shell and Command Line, install SLE 11 SP22, manage system installation, hardware, backup and recovery, administer Linux with YaST, linux processes and services, storage, configure network, remote access, monitor SLE 11 SP2, automate tasks and manage user access and security. We can gain dual certificates of SUSE CLA and LPIC-1 and CompTIA Linux powered by LPI as SUSE, Linux Professional Institute and CompTIA have teamed up to offer you the chance to earn three Linux certifications. + +- **Certification Codes** : SUSE CLA +- Course Codes: 3115, 3116 +- Exam Codes: 050-720, 050-710 +- Type of Questions: multiple choice exams +- Length of Test Period: 90 minutes +- Prerequisites: None +- Passing Score: 512 + +### 9. SUSE CLP ### + +SUSE Certified Linux Professional (CLP) is a certification programme for the one who is interested to gain more seniority and professionalism in SUSE Linux Enterprise Servers. SUSE CLP is the next step after receiving the SUSE CLA certificate. One should pass the examination and should have certification of CLA to gain the certification of CLP thought the candidate has passed the examination of CLP. SUSE CLP certified person has the skills and ability of installing and configuring SUSE Linux Enterprise Server 11 systems, maintaining the file system, managing softwarepackages, processes, printing, configuring fundamental network services, samba, web servers, using IPv6 and creating and running bash shell scripts. + +- **Certification Codes** : SUSE CLP +- Course Codes: 3115, 3116 and 3117 +- Exam Codes: 050-721, 050-697 +- Type of Test: hands on +- Length of Test Period: 180 minute practicum +- Prerequisites: SUSE CLA Certified + +### 10. SUSE CLE ### + +SUSE Certified Linux Engineer (CLE) is an engineer level advanced certification for those candidates who have passed the examination of CLE. To acquire a CLE certificate, one should gain the certificates of SUSE CLA and SUSE CLP. The candidate gaining the CLE certification has the skills of architecting complex SUSE Linux Enterprise Server environments. CLE certified person has the skill to configure fundamental networking services, manage printing, configure and use Open LDAP, samba, web servers, IPv6, perform Health Check and Performance Tuning, create and execute Shell Scripts, deploy SUSE Linux Enterprise, virtualization with Xen and more. + +- **Certification Codes** : SUSE CLE +- Course Codes: 3107 +- Exam Codes: 050-723 +- Type of Test: hands on +- Length of Test Period: 120 minute practicum +- Prerequisites: SUSE CLP 10 or 11 Certified + +### 11. LFCS ### + +Linux Foundation Certified System Admin (LFCS) certified candidates possesses knowledge on the use of Linux and using Linux with the terminal environment. LFCS is a certification programme by Linux Foundation for system administrators and engineers working with the Linux operating system. The Linux Foundation collaborated with industry experts and the Linux kernel community to identify the core domains and the critical skills, knowledge and abilities applicable for the certification. LFCS certified candidates has the skills, knowledge and ability of editing and manipulating text files on the command line, managing and troubleshooting File Systems and Storage, assembling partitions as LVM devices, configuring SWAP partitions, managing networked filesystems, managing user accounts, permissions and ownerships, maintaining security, creating and executing bash shell scripts, installing, upgrading, removing software packages and more. + +- **Certification Codes** : LFCS +- Course Codes: LFS201, LFS220 (Optional) +- Exam Codes: LFCS exam +- Length of Test Period: 2 hours +- Prerequisites: None. +- Passing Score: 74% +- Languages: English +- Validity: 2 years + +### 12. LFCE ### + +Linux Foundation Certified Engineer (LFCE), a certification for Linux Engineers by Linux Foundation. LFCE certified candidates possesses a wider range of skills on Linux than LFCS. It is a engineer-level advanced certification programme. The LFCE certified candidates possesses skills and abilities of Network Administraton like configuring network services, configuring packet filtering, monitor network performance, IP traffics, configuring filesystems and file services, network filesystems, install, update packages from the repositories, managing network security, configuring iptables, http services, proxy servers, email servers and many more. It is believed that LFCE is pretty difficult to pass and study than LFCS as its advanced engineering level certification programme. + +- **Certification Codes** : LFCE +- Course Codes: LFS230 +- Exam Codes: LFCE exam +- Length of Test Period: 2 hours +- Prerequisites: LFCS certified. +- Passing Score: 72% +- Languages: English +- Validity: 2 years + +### Facts we found (This is only our views) ### + +Recent surveys conducted on different top recruitment agency, says 80% of linux job profile preferred Redhat certification. If you are a student / newbie and want to learn linux then we prefer Linux Foundation Certifications as its getting much popular or CompTIA Linux would be also a choice. If you already know oracle or suse or working on their products then would prefer oracle / suse linux or if you working in an company these certification might enhance your career growth :-) + +### Conclusion ### + +There are thousands of big companies in this world running servers and mainframes running Linux Operating System, to handle, configure and work on those servers there is always a need of highly qualified and certified Linux Technical/Professional. These globally recognized Linux certificates has a big role of someones career in Linux. The companies around the world running Linux and wanting Linux Engineers, System Administrators and ethusiasts chooses one who has gained certificates and has good score in the related field of Linux. Globally recognized certifications are highly essential for excellence in the profession and career in Linux, so preparing best for the examination and getting the certification is a good choice for building career in Linux. If you have any questions, comments, feedback please do write on the comment box below and let us know what stuffs needs to be added or improved. Thank You! :-) + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/linux-how-to/12-globally-recognized-linux-certifications/ + +作者:[Arun Pyasi][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://linoxide.com/author/arunp/ \ No newline at end of file diff --git a/sources/tech/20150604 Nishita Agarwal Shares Her Interview Experience on Linux 'iptables' Firewall.md b/sources/tech/20150604 Nishita Agarwal Shares Her Interview Experience on Linux 'iptables' Firewall.md new file mode 100644 index 0000000000..2ba7334580 --- /dev/null +++ b/sources/tech/20150604 Nishita Agarwal Shares Her Interview Experience on Linux 'iptables' Firewall.md @@ -0,0 +1,207 @@ +Nishita Agarwal Shares Her Interview Experience on Linux ‘iptables’ Firewall +================================================================================ +Nishita Agarwal, a frequent Tecmint Visitor shared her experience (Question and Answer) with us regarding the job interview she had just given in a privately owned hosting company in Pune, India. She was asked a lot of questions on a variety of topics however she is an expert in iptables and she wanted to share those questions and their answer (she gave) related to iptables to others who may be going to give interview in near future. + +![Linux Firewall Iptables Interview Questions](http://www.tecmint.com/wp-content/uploads/2015/05/Linux-iptables-Interview-Questions.jpg) + +All the questions and their Answer are rewritten based upon the memory of Nishita Agarwal. + +> “Hello Friends! My name is **Nishita Agarwal**. I have Pursued Bachelor Degree in Technology. My area of Specialization is UNIX and Variants of UNIX (BSD, Linux) fascinates me since the time I heard it. I have 1+ years of experience in storage. I was looking for a job change which ended with a hosting company in Pune, India.” + +Here is the collection of what I was asked during the Interview. I’ve documented only those questions and their answer that were related to iptables based upon my memory. Hope this will help you in cracking your Interview. + +### 1. Have you heard of iptables and firewall in Linux? Any idea of what they are and for what it is used? ### + +> **Answer** : I’ve been using iptables for quite long time and I am aware of both iptables and firewall. Iptables is an application program mostly written in C Programming Language and is released under GNU General Public License. Written for System administration point of view, the latest stable release if iptables 1.4.21.iptables may be considered as firewall for UNIX like operating system which can be called as iptables/netfilter, more accurately. The Administrator interact with iptables via console/GUI front end tools to add and define firewall rules into predefined tables. Netfilter is a module built inside of kernel that do the job of filtering. +> +> Firewalld is the latest implementation of filtering rules in RHEL/CentOS 7 (may be implemented in other distributions which I may not be aware of). It has replaced iptables interface and connects to netfilter. + +### 2. Have you used some kind of GUI based front end tool for iptables or the Linux Command Line? ### + +> **Answer** : Though I have used both the GUI based front end tools for iptables like Shorewall in conjugation of [Webmin][1] in GUI and Direct access to iptables via console.And I must admit that direct access to iptables via Linux console gives a user immense power in the form of higher degree of flexibility and better understanding of what is going on in the background, if not anything other. GUI is for novice administrator while console is for experienced. + +### 3. What are the basic differences between between iptables and firewalld? ### + +> **Answer** : iptables and firewalld serves the same purpose (Packet Filtering) but with different approach. iptables flush the entire rules set each time a change is made unlike firewalld. Typically the location of iptables configuration lies at ‘/etc/sysconfig/iptables‘ whereas firewalld configuration lies at ‘/etc/firewalld/‘, which is a set of XML files.Configuring a XML based firewalld is easier as compared to configuration of iptables, however same task can be achieved using both the packet filtering application ie., iptables and firewalld. Firewalld runs iptables under its hood along with it’s own command line interface and configuration file that is XML based and said above. + +### 4. Would you replace iptables with firewalld on all your servers, if given a chance? ### + +> **Answer** : I am familiar with iptables and it’s working and if there is nothing that requires dynamic aspect of firewalld, there seems no reason to migrate all my configuration from iptables to firewalld.In most of the cases, so far I have never seen iptables creating an issue. Also the general rule of Information technology says “why fix if it is not broken”. However this is my personal thought and I would never mind implementing firewalld if the Organization is going to replace iptables with firewalld. + +### 5. You seems confident with iptables and the plus point is even we are using iptables on our server. ### + +What are the tables used in iptables? Give a brief description of the tables used in iptables and the chains they support. + +> **Answer** : Thanks for the recognition. Moving to question part, There are four tables used in iptables, namely they are: +> +> Nat Table +> Mangle Table +> Filter Table +> Raw Table +> +> Nat Table : Nat table is primarily used for Network Address Translation. Masqueraded packets get their IP address altered as per the rules in the table. Packets in the stream traverse Nat Table only once. ie., If a packet from a jet of Packets is masqueraded they rest of the packages in the stream will not traverse through this table again. It is recommended not to filter in this table. Chains Supported by NAT Table are PREROUTING Chain, POSTROUTING Chain and OUTPUT Chain. +> +> Mangle Table : As the name suggests, this table serves for mangling the packets. It is used for Special package alteration. It can be used to alter the content of different packets and their headers. Mangle table can’t be used for Masquerading. Supported chains are PREROUTING Chain, OUTPUT Chain, Forward Chain, INPUT Chain, POSTROUTING Chain. +> +> Filter Table : Filter Table is the default table used in iptables. It is used for filtering Packets. If no rules are defined, Filter Table is taken as default table and filtering is done on the basis of this table. Supported Chains are INPUT Chain, OUTPUT Chain, FORWARD Chain. +> +> Raw Table : Raw table comes into action when we want to configure packages that were exempted earlier. It supports PREROUTING Chain and OUTPUT Chain. + +### 6. What are the target values (that can be specified in target) in iptables and what they do, be brief! ### + +> **Answer** : Following are the target values that we can specify in target in iptables: +> +> ACCEPT : Accept Packets +> QUEUE : Paas Package to user space (place where application and drivers reside) +> DROP : Drop Packets +> RETURN : Return Control to calling chain and stop executing next set of rules for the current Packets in the chain. + + +### 7. Lets move to the technical aspects of iptables, by technical I means practical. ### + +How will you Check iptables rpm that is required to install iptables in CentOS?. + +> **Answer** : iptables rpm are included in standard CentOS installation and we do not need to install it separately. We can check the rpm as: +> +> # rpm -qa iptables +> +> iptables-1.4.21-13.el7.x86_64 +> +> If you need to install it, you may do yum to get it. +> +> # yum install iptables-services + +### 8. How to Check and ensure if iptables service is running? ### + +> **Answer** : To check the status of iptables, you may run the following command on the terminal. +> +> # service status iptables [On CentOS 6/5] +> # systemctl status iptables [On CentOS 7] +> +> If it is not running, the below command may be executed. +> +> ---------------- On CentOS 6/5 ---------------- +> # chkconfig --level 35 iptables on +> # service iptables start +> +> ---------------- On CentOS 7 ---------------- +> # systemctl enable iptables +> # systemctl start iptables +> +> We may also check if the iptables module is loaded or not, as: +> +> # lsmod | grep ip_tables + +### 9. How will you review the current Rules defined in iptables? ### + +> **Answer** : The current rules in iptables can be review as simple as: +> +> # iptables -L +> +> Sample Output +> +> Chain INPUT (policy ACCEPT) +> target prot opt source destination +> ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED +> ACCEPT icmp -- anywhere anywhere +> ACCEPT all -- anywhere anywhere +> ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:ssh +> REJECT all -- anywhere anywhere reject-with icmp-host-prohibited +> +> Chain FORWARD (policy ACCEPT) +> target prot opt source destination +> REJECT all -- anywhere anywhere reject-with icmp-host-prohibited +> +> Chain OUTPUT (policy ACCEPT) +> target prot opt source destination + +### 10. How will you flush all iptables rules or a particular chain? ### + +> **Answer** : To flush a particular iptables chain, you may use following commands. +> +> +> # iptables --flush OUTPUT +> +> To Flush all the iptables rules. +> +> # iptables --flush + +### 11. Add a rule in iptables to accept packets from a trusted IP Address (say 192.168.0.7) ### + +> **Answer** : The above scenario can be achieved simply by running the below command. +> +> # iptables -A INPUT -s 192.168.0.7 -j ACCEPT +> +> We may include standard slash or subnet mask in the source as: +> +> # iptables -A INPUT -s 192.168.0.7/24 -j ACCEPT +> # iptables -A INPUT -s 192.168.0.7/255.255.255.0 -j ACCEPT + +### 12. How to add rules to ACCEPT, REJECT, DENY and DROP ssh service in iptables. ### + +> **Answer** : Hoping ssh is running on port 22, which is also the default port for ssh, we can add rule to iptables as:To ACCEPT tcp packets for ssh service (port 22). +> +> # iptables -A INPUT -s -p tcp - -dport -j ACCEPT +> +> To REJECT tcp packets for ssh service (port 22). +> +> # iptables -A INPUT -s -p tcp - -dport -j REJECT +> +> To DENY tcp packets for ssh service (port 22). +> +> +> # iptables -A INPUT -s -p tcp - -dport -j DENY +> +> To DROP tcp packets for ssh service (port 22). +> +> +> # iptables -A INPUT -s -p tcp - -dport -j DROP + +### 13. Let me give you a scenario. Say there is a machine the local ip address of which is 192.168.0.6. You need to block connections on port 21, 22, 23, and 80 to your machine. What will you do? ### + +> **Answer** : Well all I need to use is the ‘multiport‘ option with iptables followed by port numbers to be blocked and the above scenario can be achieved in a single go as. +> +> # iptables -A INPUT -s 192.168.0.6 -p tcp -m multiport --dport 22,23,80,8080 -j DROP +> +> The written rules can be checked using the below command. +> +> # iptables -L +> +> Chain INPUT (policy ACCEPT) +> target prot opt source destination +> ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED +> ACCEPT icmp -- anywhere anywhere +> ACCEPT all -- anywhere anywhere +> ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:ssh +> REJECT all -- anywhere anywhere reject-with icmp-host-prohibited +> DROP tcp -- 192.168.0.6 anywhere multiport dports ssh,telnet,http,webcache +> +> Chain FORWARD (policy ACCEPT) +> target prot opt source destination +> REJECT all -- anywhere anywhere reject-with icmp-host-prohibited +> +> Chain OUTPUT (policy ACCEPT) +> target prot opt source destination + +**Interviewer** : That’s all I wanted to ask. You are a valuable employee we won’t like to miss. I will recommend your name to the HR. If you have any question you may ask me. + +As a candidate I don’t wanted to kill the conversation hence keep asking about the projects I would be handling if selected and what are the other openings in the company. Not to mention HR round was not difficult to crack and I got the opportunity. + +Also I would like to thank Avishek and Ravi (whom I am a friend since long) for taking the time to document my interview. + +Friends! If you had given any such interview and you would like to share your interview experience to millions of Tecmint readers around the globe? then send your questions and answers to admin@tecmint.com. + +Thank you! Keep Connected. Also let me know if I could have answered a question more correctly than what I did. + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/linux-firewall-iptables-interview-questions-and-answers/ + +作者:[Avishek Kumar][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/avishek/ +[1]:http://www.tecmint.com/install-webmin-web-based-system-administration-tool-for-rhel-centos-fedora/ \ No newline at end of file From e4b49322dd36a373e45817b15797bf4d51d2af6b Mon Sep 17 00:00:00 2001 From: ZTinoZ Date: Thu, 4 Jun 2015 18:14:37 +0800 Subject: [PATCH 259/965] Translating by ZTinoZ --- .../tech/20150526 20 Useful Terminal Emulators for Linux.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sources/tech/20150526 20 Useful Terminal Emulators for Linux.md b/sources/tech/20150526 20 Useful Terminal Emulators for Linux.md index d3f974bd05..4ac5708fa6 100644 --- a/sources/tech/20150526 20 Useful Terminal Emulators for Linux.md +++ b/sources/tech/20150526 20 Useful Terminal Emulators for Linux.md @@ -1,4 +1,3 @@ -Translating by ZTinoZ 20款优秀的Linux终端仿真器 ================================================================================ 终端仿真器是一款用其它显示结构重现可视终端的计算机程序。换句话说就是终端仿真器能使哑终端看似像一台客户机连接上了服务器。终端仿真器允许最终用户像文本用户界面和命令行界面一样连接控制台和应用程序。 @@ -7,11 +6,11 @@ Translating by ZTinoZ 20款Linux终端仿真器 -You may find huge number of terminal emulators to choose from this open source world. Some of them offers large range of features while others offers less features. To give a better understanding to the quality of software that are available, we have gathered a list of marvelous terminal emulator for Linux. Each title provides its description and feature along with screenshot of the software with relevant download link. +你能从开源世界中找到大量的终端仿真器来使用,有些拥有大量的特性而有些则反之。为了能更好地理解它们所能提供的质量,我们收集了一份不可思议的Linux终端仿真器清单。每一款都列出了它们各自的描述和特性以及软件界面截图和下载链接。 ### 1. Terminator ### -Terminator is an advanced and powerful terminal emulator which supports multiple terminals windows. This emulator is fully customizable. You can change the size, colour, give different shapes to the terminal. Its very user friendly and fun to use. +Terminator是一款先进且强大的终端仿真器,它支持多终端窗口。这款仿真器可以完全自定义。你可以更改它的界面尺寸、颜色,给它设置不同的形状。拥有高用户友好性且使用起来很有乐趣。 #### Terminator的特性 #### From 1ce23012c0c88194f65ec37258b81ebba2eb8dcc Mon Sep 17 00:00:00 2001 From: wxy Date: Thu, 4 Jun 2015 21:16:17 +0800 Subject: [PATCH 260/965] =?UTF-8?q?=E8=A1=A5=E5=85=85=E5=88=A0=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @wi-cuckoo --- ... X GNU Open Source and Apple in History.md | 58 ------------------- 1 file changed, 58 deletions(-) delete mode 100644 sources/talk/20150520 Is Linux Better than OS X GNU Open Source and Apple in History.md diff --git a/sources/talk/20150520 Is Linux Better than OS X GNU Open Source and Apple in History.md b/sources/talk/20150520 Is Linux Better than OS X GNU Open Source and Apple in History.md deleted file mode 100644 index 9abc2f721f..0000000000 --- a/sources/talk/20150520 Is Linux Better than OS X GNU Open Source and Apple in History.md +++ /dev/null @@ -1,58 +0,0 @@ -translating wi-cuckoo -Is Linux Better than OS X? GNU, Open Source and Apple in History -================================================================================ -> Tensions between the free software/open source community and Apple date back to the 1980s, Linux's founder called the core of Mac OS X "a piece of crap" and other anecdotes from software history. - -![](http://thevarguy.com/site-files/thevarguy.com/files/imagecache/medium_img/uploads/2015/05/untitled_2.png) - -Open source fans have long had a rocky relationship with Microsoft. Everyone knows that. But, in many ways, the tension between Apple and supporters of free or open source software is even starker—even if it receives much less attention in the press. - -To be sure, not all open source advocates have an aversion to Apple. Anecdotally, I've seen plenty of Linux hackers sporting iPhones and iPads. In fact, some Linux users like Apple's OS X so much that they've [created a number of Linux distributions][1] designed to look just like it. (So has the [North Korean government][2], incidentally.) - -But relations between the Cult of Mac and the Cult of Tux—that is, the Linux community (not to mention the other, smaller segments of the free and open source software world)—have not always been completely peaceable. And that's by no means a new phenomenon, as I'm discovering as I research the history of Linux and the Free Software Foundation. - -### GNU vs. Apple ### - -The ill will dates to at least the late 1980s. By June 1988, [GNU][3], the project launched by Richard Stallman to build a completely free Unix-like operating system whose source code would be freely shared, was [strongly criticizing][4] Apple's lawsuit against [Hewlett-Packard][5] (HPQ) and [Microsoft][6] (MSFT) over what Apple claimed was improper copying of the "look and feel" of the Macintosh operating system. If Apple prevailed, GNU warned, the company "will use this new power over the public to put an end to free software that could substitute for commercial software." - -At the time, GNU fought against the lawsuit (which meant, ironically, that GNU was supporting Microsoft, though those were different times) by distributing "[Keep Your Lawyers Off My Computer" buttons][7]. It also urged GNU supporters to boycott Apple, warning that, even if Macintoshes seemed like good computers, Apple's success in the lawsuit could provide the company with a monopoly in the market that would greatly increase the price of computers. - -Apple eventually [lost the lawsuit][8], but not until 1994, after which GNU [dropped its Apple boycott][9]. In the interim, GNU remained critical of the company. In the early 1990s, even after it began promoting GNU software programs for use on other personal computing platforms, including MS-DOS PCs, [GNU affirmed][10] that, until Apple ceased pursuing a "monopoly" over computers with user interfaces similar to those of the Macintosh, "we will not provide any support for Apple machines." (It's therefore ironic that a fair amount of the software that made it into OS X, the Unix-like operating system that Apple introduced later in the 1990s, came from GNU. But that's another story.) - -### Torvalds on Jobs ### - -Despite his more laissez-faire attitude toward most issues, Linus Torvalds, the creator of the Linux kernel, was no less charitable in his attitudes toward Apple than Stallman and GNU had been. In his 2001 book "Just for Fun: The Story of an Accidental Revolutionary," Torvalds described meeting with Steve Jobs circa 1997, at the latter's invitation, to discuss Mac OS X, which Apple was then developing but had not yet released publicly. - -"Basically, Jobs started off by trying to tell me that on the desktop there were just two players, Microsoft and Apple, and that he thought that the best thing I could do for Linux was to get in bed with Apple and try to get the open source people behind Mac OS X," Torvalds wrote. - -This courting apparently turned Torvalds off quite a bit. One point of disagreement centered on Torvalds's technical disdain for Mach, the kernel on which Apple was then building its new OS X operating system, which Torvalds called "a piece of crap. It contains all the design mistakes you can make, and managed to even make up a few of its own." - -But more off-putting, apparently, was the way Jobs was approaching open source in developing OS X (which had many open source programs at its core): "He sort of played down the flaw in the setup: Who cares if the basic operating system, the real low-core stuff, is open source if you then have the Mac layer on top, which is not open source?" - -All in all, Torvalds concluded, Jobs "didn't use very many arguments. He just basically took it for granted that I would be interested" in collaborating with Apple. "He was clueless, unable to imagine that there could be entire segments of the human race who weren't the least bit concerned about increasing the Mac's market share. I think he was truly surprised at how little I cared about how big a market the Mac had—or how big a market Microsoft has." - -Torvalds doesn't speak for all Linux users, of course. And his views on OS X and Apple may have softened since 2001. But the fact that, in the early 2000s, the Linux community's leading figure exhibited so much disdain for Apple and the hubris of its chief says something significant about how deeply seated tensions between the Apple world and the open source/free software world are. - -Both of these historical tidbits offer insight into the great debate regarding the actual value of Apple's products—whether the company thrives on the quality of the hardware and software it creates, or merely benefits from exceptional marketing acumen that allows it to sell products for much more than their non-Apple functional equivalents are worth. But I'll stay out of that debate, for now. - --------------------------------------------------------------------------------- - -via: http://thevarguy.com/open-source-application-software-companies/051815/linux-better-os-x-gnu-open-source-and-apple- - -作者:[Christopher Tozzi][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://thevarguy.com/author/christopher-tozzi -[1]:https://www.linux.com/news/software/applications/773516-the-mac-ifying-of-the-linux-desktop/ -[2]:http://thevarguy.com/open-source-application-software-companies/010615/north-koreas-red-star-linux-os-made-apples-image -[3]:http://gnu.org/ -[4]:https://www.gnu.org/bulletins/bull5.html -[5]:http://www.hp.com/ -[6]:http://www.microsoft.com/ -[7]:http://www.duntemann.com/AppleSnakeButton.jpg -[8]:http://www.freibrun.com/articles/articl12.htm -[9]:https://www.gnu.org/bulletins/bull18.html#SEC6 -[10]:https://www.gnu.org/bulletins/bull12.html From 4f95b88fb47686d7e7c432fedc062ec4a0abb0bd Mon Sep 17 00:00:00 2001 From: wxy Date: Thu, 4 Jun 2015 22:25:45 +0800 Subject: [PATCH 261/965] PUB:20150413 Linux FAQs with Answers--How to configure PCI-passthrough on virt-manager @Vic020 --- ...nfigure PCI-passthrough on virt-manager.md | 55 ++++++++++++++++++ ...nfigure PCI-passthrough on virt-manager.md | 56 ------------------- 2 files changed, 55 insertions(+), 56 deletions(-) create mode 100644 published/20150413 Linux FAQs with Answers--How to configure PCI-passthrough on virt-manager.md delete mode 100644 translated/tech/20150413 Linux FAQs with Answers--How to configure PCI-passthrough on virt-manager.md diff --git a/published/20150413 Linux FAQs with Answers--How to configure PCI-passthrough on virt-manager.md b/published/20150413 Linux FAQs with Answers--How to configure PCI-passthrough on virt-manager.md new file mode 100644 index 0000000000..c7c2d21fa3 --- /dev/null +++ b/published/20150413 Linux FAQs with Answers--How to configure PCI-passthrough on virt-manager.md @@ -0,0 +1,55 @@ +Linux有问必答:如何在虚拟机上配置PCI直通 +================================================================================ +> **提问**:我想要分配一块物理网卡到用KVM创建的虚拟机上。我打算为这台虚拟机启用网卡的PCI直通。请问,我如何才能在virt-manager里面通过PCI直通增加一个PCI设备到虚拟机上? + +如今的hypervisor能够高效地在多个虚拟操作系统间共享和模拟硬件资源。然而,虚拟资源共享不是总能使人满意,甚至在虚拟机性能是重点考量时,或者是虚拟机需要硬件DMA的完全控制时,应该避免共享。一项名叫“PCI直通”的技术可以用在一个虚拟机需要独享PCI设备时(例如:网卡、声卡、显卡)。本质上,PCI直通穿透了虚拟层,直接将PCI设备放到虚拟机里,而其他虚拟机则不能访问该设备。 + +### 开启“PCI直通”的准备 ### + +如果你想要为一台HVM实例开启PCI直通(例如,一台KVM创建的全虚拟化的虚拟机),你的母系统(包括CPU和主板)必须满足以下条件。如果你的虚拟机是半虚拟化的(由Xen创建),你可以跳过这步。 + +为了在 HVM虚拟机上开启PCI直通,系统需要支持**VT-d** (Intel处理器)或者**AMD-Vi** (AMD处理器)。Intel的VT-D(“英特尔直接I/O虚拟化技术”)是适用于最高端的Nehalem处理器和它的后继者(例如,Westmere、Sandy Bridge的,Ivy Bridge)。注意:VT-d和VT-x是两个独立功能。intel/AMD处理器支持VT-D/AMD-VI功能的列表可以[查看这里][1]。 + +在确认你的设备支持VT-d/AMD-Vi后,还有两件事情需要做。首先,确保VT-d/AMD-Vi已经在BIOS中开启。然后,在内核启动过程中开启IOMMU。IOMMU服务,是由VT-d/AMD-Vi提供的,可以保护虚拟机访问的主机内存,同时它也是全虚拟化虚拟机支持PCI直通的前提。 + +Intel处理器中,通过将“**intel_iommu=on**传给内核启动参数来开启IOMMU。参看[这篇教程][2]了解如何通过GRUB修改内核启动参数。 + +配置完启动参数后,重启电脑。 + +### 添加PCI设备到虚拟机 ### + +我们已经完成了开启PCI直通的准备。事实上,只需通过virt-manager就可以给虚拟机分配一个PCI设备。 + +打开virt-manager的虚拟机设置,在左边工具栏点击‘增加硬件’按钮。 + +选择从PCI设备表一个PCI设备来分配,点击“完成”按钮 + +![](https://farm8.staticflickr.com/7587/17015584385_db49e96372_c.jpg) + +最后,启动实例。这样,主机的PCI设备已经可以由虚拟机直接访问了。 + +### 常见问题 ### + +在虚拟机启动时,如果你看见下列任何一个错误,这个错误有可能由于母机VT-d (或 IOMMU)未开启导致。 + + Error starting domain: unsupported configuration: host doesn't support passthrough of host PCI devices + +---------- + + Error starting domain: Unable to read from monitor: Connection reset by peer + +请确保"**intel_iommu=on**"启动参数已经按上文叙述开启。 + +-------------------------------------------------------------------------------- + +via: http://ask.xmodulo.com/pci-passthrough-virt-manager.html + +作者:[Dan Nanni][a] +译者:[Vic020/VicYu](http://vicyu.net) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://ask.xmodulo.com/author/nanni +[1]:http://wiki.xenproject.org/wiki/VTdHowTo +[2]:http://xmodulo.com/add-kernel-boot-parameters-via-grub-linux.html diff --git a/translated/tech/20150413 Linux FAQs with Answers--How to configure PCI-passthrough on virt-manager.md b/translated/tech/20150413 Linux FAQs with Answers--How to configure PCI-passthrough on virt-manager.md deleted file mode 100644 index 0344095bc2..0000000000 --- a/translated/tech/20150413 Linux FAQs with Answers--How to configure PCI-passthrough on virt-manager.md +++ /dev/null @@ -1,56 +0,0 @@ -Linux有问必答:如何在虚拟机上配置PCI-passthrough -================================================================================ -> **提问**:我想要设置一块物理网卡到用KVM创建的虚拟机上。我打算开启网卡的PCI passthrough给这台虚拟机。请问,我如何才能增加一个PCI设备通过PCI直通到虚拟机上? - -如今的hypervisor能够高效地在多个虚拟操作系统分享和模拟硬件资源。然而,虚拟资源分享,虚拟机的性能,或者是虚拟机需要硬件DMA的完全控制,不是总能使人满意。一项名叫“PCI passthrough”的技术可以用在一个虚拟机需要独享PCI设备时(例如:network/sound/video card)。本质上,PCI passthrough越过了虚拟层,直接扩展PCI设备到虚拟机。但是其他虚拟机不能同时共享。 - - -### 开启“PCI Passthrough”的准备 ### - -如果你想要为一台HVM实例开启PCI passthrough(例如,一台KVM创建的full虚拟机),你的母系统(包括CPU和主板)必须满足以下条件。但是如果你的虚拟机是para-V(由Xen创建),你可以挑过这步。 - -为了开启PCI passthrough,系统需要支持**VT-d** (Intel处理器)或者**AMD-Vi** (AMD处理器)。Intel的VT-D(“英特尔虚拟化技术支持直接I/ O”)是适用于最高端的Nehalem处理器和它的后继者(例如,Westmere、Sandy Bridge的,Ivy Bridge)。注意:VT-d和VT-x是两个独立功能。intel/AMD处理器支持VT-D/AMD-VI功能的列表可以[点击这里][1]。 - -完成验证你的设备支持VT-d/AMD-Vi后,还有两件事情需要做。首先,确保VT-d/AMD-Vi已经在BIOS中开启。然后,在内核启动过程中开启IOMMU。IOMMU服务,是VT-d,/AMD-Vi提供,可以保护虚拟机访问的主机内存,同时它也是full虚拟机支持PCI passthrough的前提。 - -Intel处理器中,内核开启IOMMU通过在启动参数中修改“**intel_iommu=on**”。参看[这篇教程][2]获得如何通过GRUB修改内核启动参数。 - -配置完成启动参数后,重启电脑。 - -### 添加PCI设备到虚拟机 ### - -我们已经完成了开启PCI Passthrough的准备。事实上,只需通过虚拟机管理就可以给虚拟机分配一个PCI设备。 - -打开虚拟机设置,在左边工具栏点击‘增加硬件’按钮。 - -选择从PCI设备表一个PCI设备来分配,点击“完成”按钮 - -![](https://farm8.staticflickr.com/7587/17015584385_db49e96372_c.jpg) - -最后,开启实例。目前为止,主机的PCI设备已经可以由虚拟机直接访问了。 - -### 常见问题 ### - -在虚拟机启动时,如果你看见下列任何一个错误,这个错误有可能由于母机VT-d (或 IOMMU)未开启导致。 - - Error starting domain: unsupported configuration: host doesn't support passthrough of host PCI devices - ----------- - - Error starting domain: Unable to read from monitor: Connection reset by peer - -请确保"**intel_iommu=on**"启动参数已经按上文叙述开启。 - --------------------------------------------------------------------------------- - -via: http://ask.xmodulo.com/pci-passthrough-virt-manager.html - -作者:[Dan Nanni][a] -译者:[Vic020/VicYu](http://vicyu.net) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://ask.xmodulo.com/author/nanni -[1]:http://wiki.xenproject.org/wiki/VTdHowTo -[2]:http://xmodulo.com/add-kernel-boot-parameters-via-grub-linux.html From 0fce13258a57624c4b3ed2a642242d2bb6a792f8 Mon Sep 17 00:00:00 2001 From: joeren Date: Fri, 5 Jun 2015 08:38:16 +0800 Subject: [PATCH 262/965] Update 20150126 iptraf--A TCP or UDP Network Monitoring Utility.md --- .../20150126 iptraf--A TCP or UDP Network Monitoring Utility.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20150126 iptraf--A TCP or UDP Network Monitoring Utility.md b/sources/tech/20150126 iptraf--A TCP or UDP Network Monitoring Utility.md index 1d5d3cd0d9..fcfc6123e0 100644 --- a/sources/tech/20150126 iptraf--A TCP or UDP Network Monitoring Utility.md +++ b/sources/tech/20150126 iptraf--A TCP or UDP Network Monitoring Utility.md @@ -1,3 +1,4 @@ +Translating by GOLinux! iptraf: A TCP/UDP Network Monitoring Utility ================================================================================ [iptraf][1] is an ncurses-based IP LAN monitor that generates various network statistics including TCP info, UDP counts, ICMP and OSPF information, Ethernet load info, node stats, IP checksum errors, and others. From 75da6072332a8e59e4aa33aaf91885355034cc7e Mon Sep 17 00:00:00 2001 From: GOLinux Date: Fri, 5 Jun 2015 08:58:25 +0800 Subject: [PATCH 263/965] [Translated]20150126 iptraf--A TCP or UDP Network Monitoring Utility.md --- ...A TCP or UDP Network Monitoring Utility.md | 65 ------------------- ...A TCP or UDP Network Monitoring Utility.md | 64 ++++++++++++++++++ 2 files changed, 64 insertions(+), 65 deletions(-) delete mode 100644 sources/tech/20150126 iptraf--A TCP or UDP Network Monitoring Utility.md create mode 100644 translated/tech/20150126 iptraf--A TCP or UDP Network Monitoring Utility.md diff --git a/sources/tech/20150126 iptraf--A TCP or UDP Network Monitoring Utility.md b/sources/tech/20150126 iptraf--A TCP or UDP Network Monitoring Utility.md deleted file mode 100644 index fcfc6123e0..0000000000 --- a/sources/tech/20150126 iptraf--A TCP or UDP Network Monitoring Utility.md +++ /dev/null @@ -1,65 +0,0 @@ -Translating by GOLinux! -iptraf: A TCP/UDP Network Monitoring Utility -================================================================================ -[iptraf][1] is an ncurses-based IP LAN monitor that generates various network statistics including TCP info, UDP counts, ICMP and OSPF information, Ethernet load info, node stats, IP checksum errors, and others. - -Its ncurses-based user interface also saves users from remembering command line switches. - -### Features ### - -- An IP traffic monitor that shows information on the IP traffic passing over your network. Includes TCP flag information, packet and byte counts, ICMP details, OSPF packet types. -- General and detailed interface statistics showing IP, TCP, UDP, ICMP, non-IP and other IP packet counts, IP checksum errors, interface activity, packet size counts. -- A TCP and UDP service monitor showing counts of incoming and outgoing packets for common TCP and UDP application ports -- A LAN statistics module that discovers active hosts and shows statistics showing the data activity on them -- TCP, UDP, and other protocol display filters, allowing you to view only traffic you’re interested in. -- Logging -- Supports Ethernet, FDDI, ISDN, SLIP, PPP, and loopback interface types. -- Utilizes the built-in raw socket interface of the Linux kernel, allowing it to be used over a wide range of supported network cards. -- Full-screen, menu-driven operation. - -To install - -### Ubuntu and it’s derivatives ### - - sudo apt-get install iptraf - -### Arch Linux and Its derivatives ### - - sudo pacman -S iptra - -### Fedora and its derivatives ### - - sudo yum install iptraf - -### Usage ### - -If the **iptraf** command is issued without any command-line options, the program comes up in interactive mode, with the various facilities accessed through the main menu. - -![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/iptraf_1.png) - -Menu for easy navigation. - -![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/iptraf_2.png) - -Selecting interfaces to monitor. - -![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/iptraf_3.png) - -Traffic from interface **ppp0** - -![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/iptraf_4.png) - -Enjoy! - --------------------------------------------------------------------------------- - -via: http://www.unixmen.com/iptraf-tcpudp-network-monitoring-utility/ - -作者:[Enock Seth Nyamador][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://www.unixmen.com/author/seth/ -[1]:http://iptraf.seul.org/about.html diff --git a/translated/tech/20150126 iptraf--A TCP or UDP Network Monitoring Utility.md b/translated/tech/20150126 iptraf--A TCP or UDP Network Monitoring Utility.md new file mode 100644 index 0000000000..5f808b562a --- /dev/null +++ b/translated/tech/20150126 iptraf--A TCP or UDP Network Monitoring Utility.md @@ -0,0 +1,64 @@ +iptraf:TCP/UDP网络监控工具 +================================================================================ +[iptraf][1]是一个基于ncurses的IP局域网监控工具,它可以生成各种网络统计数据,包括TCP信息、UDP统计、ICMP和OSPF信息、以太网负载信息、节点统计、IP校验和错误和其它一些信息。 + +它基于ncurses的用户界面也会保存来自命令行切换记忆的用户。 + +### 功能 ### + +- 一个用于显示通过网络的IP流量信息的IP流量监控器,包括TCP标识信息、包河字节统计、ICMP详情、OSPF包类型 +- 显示IP、TCP、UDP、ICMP、非IP和其它IP包计数、IP校验和错误、接口活动、包大小计数的综合详细的接口统计数据 +- 一个用于显示流入和流出包常用TCP和UDP应用端口的TCP和UDP服务监控器 +- 一个用于发现活动主机和显示这些活动主机的数据活动的局域网统计模块 +- TCP、UDP和其它协议的显示过滤器,允许你查看你做感兴趣的通信 +- 日志记录 +- 支持以太网、FDDI、ISDN、SLIP、PPP和回环接口类型 +- 利用Linux内核内建的原生套接口界面,可以用于大范围支持的网卡 +- 全屏、菜单驱动操作 + +要安装 + +### Ubuntu及其衍生版 ### + + sudo apt-get install iptraf + +### Arch Linux及其衍生版 ### + + sudo pacman -S iptra + +### Fedora及其衍生版 ### + + sudo yum install iptraf + +### 用法 ### + +如果**iptraf**命令不带任何命令行选项执行,该程序就会以交互模式显现,可以通过主菜单获得各种各样的工具。 + +![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/iptraf_1.png) + +易于导航的菜单。 + +![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/iptraf_2.png) + +选择监控的接口。 + +![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/iptraf_3.png) + +来自**ppp0**接口的通信 + +![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/iptraf_4.png) + +好好乐一把吧! + +-------------------------------------------------------------------------------- + +via: http://www.unixmen.com/iptraf-tcpudp-network-monitoring-utility/ + +作者:[Enock Seth Nyamador][a] +译者:[GOLinux](https://github.com/GOLinux) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://www.unixmen.com/author/seth/ +[1]:http://iptraf.seul.org/about.html From bbe176992d908f6c47714efb574002c988475e95 Mon Sep 17 00:00:00 2001 From: joeren Date: Fri, 5 Jun 2015 09:00:20 +0800 Subject: [PATCH 264/965] Update 20150604 How To Install Unity 8 Desktop Preview In Ubuntu.md --- ...0150604 How To Install Unity 8 Desktop Preview In Ubuntu.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150604 How To Install Unity 8 Desktop Preview In Ubuntu.md b/sources/tech/20150604 How To Install Unity 8 Desktop Preview In Ubuntu.md index 219433905e..3de67a946c 100644 --- a/sources/tech/20150604 How To Install Unity 8 Desktop Preview In Ubuntu.md +++ b/sources/tech/20150604 How To Install Unity 8 Desktop Preview In Ubuntu.md @@ -1,3 +1,4 @@ +Translating by GOLinux! How To Install Unity 8 Desktop Preview In Ubuntu ================================================================================ ![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/06/Unity_8.jpeg) @@ -74,4 +75,4 @@ via: http://itsfoss.com/install-unity-8-desktop-ubuntu/ [3]:http://itsfoss.com/ubuntu-15-10-codename/ [4]:https://wiki.ubuntu.com/Unity8DesktopIso [5]:https://wiki.ubuntu.com/Unity8inLXC -[6]:http://itsfoss.com/install-mate-desktop-ubuntu-14-04/ \ No newline at end of file +[6]:http://itsfoss.com/install-mate-desktop-ubuntu-14-04/ From 208e40254c3f64364a29ef2467c14724c74d341f Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 5 Jun 2015 10:15:58 +0800 Subject: [PATCH 265/965] translating --- sources/tech/20150604 How to access SQLite database in Perl.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20150604 How to access SQLite database in Perl.md b/sources/tech/20150604 How to access SQLite database in Perl.md index 980917a3c5..0e0723c219 100644 --- a/sources/tech/20150604 How to access SQLite database in Perl.md +++ b/sources/tech/20150604 How to access SQLite database in Perl.md @@ -1,3 +1,5 @@ +Translating---geekpi + How to access SQLite database in Perl ================================================================================ SQLite is a zero-configuration, server-less, file-based transactional database system. Due to its lightweight, self-contained, and compact design, SQLite is an extremely popular choice when you want to integrate a database into your application. In this post, I am going to show you how to create and access a SQLite database in Perl script. The Perl code snippet I present is fully functional, so you can easily modify and integrate it into your project. From bee040b4ada57d77b8c02b41159818e5e1132cf4 Mon Sep 17 00:00:00 2001 From: GOLinux Date: Fri, 5 Jun 2015 10:19:49 +0800 Subject: [PATCH 266/965] [Translated]20150604 How To Install Unity 8 Desktop Preview In Ubuntu.md --- ...stall Unity 8 Desktop Preview In Ubuntu.md | 78 ------------------- ...stall Unity 8 Desktop Preview In Ubuntu.md | 77 ++++++++++++++++++ 2 files changed, 77 insertions(+), 78 deletions(-) delete mode 100644 sources/tech/20150604 How To Install Unity 8 Desktop Preview In Ubuntu.md create mode 100644 translated/tech/20150604 How To Install Unity 8 Desktop Preview In Ubuntu.md diff --git a/sources/tech/20150604 How To Install Unity 8 Desktop Preview In Ubuntu.md b/sources/tech/20150604 How To Install Unity 8 Desktop Preview In Ubuntu.md deleted file mode 100644 index 3de67a946c..0000000000 --- a/sources/tech/20150604 How To Install Unity 8 Desktop Preview In Ubuntu.md +++ /dev/null @@ -1,78 +0,0 @@ -Translating by GOLinux! -How To Install Unity 8 Desktop Preview In Ubuntu -================================================================================ -![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/06/Unity_8.jpeg) - -If you have been following the news, Ubuntu will be switching to [Mir display server][1] along with [Unity 8][2] desktop. While it is still not certain if Unity 8 running on Mir will be available in [Ubuntu 15.10 Willy Werewolf][3], a preview version of Unity 8 is available for you to try and test. With the official PPA, it is really easy to **install Unity 8 in Ubuntu 14.04, 14.10 and 15.04**. - -Until now, this Unity 8 desktop preview has been available via an [ISO][4] for (primarily) developers to test it. But Canonical has made it available through [LXC containers][5]. By using this method you get a Unity 8 desktop session running on Mir display server as any desktop environment. It’s like as if you [install Mate desktop in Ubuntu][6] and choose the desktop session from the LightDm login screen. - -Curious to give Unity 8 a try? Let’s see how to install it. - -**Note: It’s an experimental preview and may not work properly for everyone.** - -### Install Unity 8 desktop in Ubuntu ### - -Following are the steps to install and use Unity 8: - -#### Step 1: Install Unity 8 in Ubuntu 12.04 and 14.04 #### - -If you are running Ubuntu 12.04 and 14.04, you’ll have to use the official PPA to install Unity 8. Use the following command: - - sudo apt-add-repository ppa:unity8-desktop-session-team/unity8-preview-lxc - sudo apt-get update - sudo apt-get upgrade - sudo apt-get install unity8-lxc - -#### Step 1: Install Unity 8 in Ubuntu 14.10 and 15.04 #### - -If you are running Ubuntu 14.10 or 15.04, Unity 8 LXC is already in the sources. You just need to run the following commands: - - sudo apt-get update - sudo apt-get install unity8-lxc - -#### Step 2: Set up Unity 8 desktop preview LXC #### - -Once you have installed Unity 8 LXC, it’s time to set it up. Use the following command for this purpose: - - sudo unity8-lxc-setup - -It will take some time in set up, so have some patience. It downloads the ISO and then extracts it, and then any last bits of setup necessary to make it work. It will also install a slightly modified version of LightDM. Once everything is done, a restart is required. - -#### Step 3: Select Unity 8 #### - -After restarting, at login screen, click on the Ubuntu icon beside your login name: - -![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2014/08/Change_Desktop_Environment_Ubuntu.jpeg) - -You should see the option of Unity 8 here. Select it: - -![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/06/Select_Unity8.jpeg) - -### Uninstall Unity 8 LXC ### - -If you find Unity 8 too buggy or if you don’t like it, you can simply switch back to the default Unity version in similar fashion. Additionally, you can also remove Unity 8 using this command: - - sudo apt-get remove unity8-lxc - -This will remove the Unity 8 option from LightDM screen but the set-up will remain there. - -That’s all you need to do to install Unity 8 with Mir in Ubuntu. Do share what you think of Unity 8 when you try it out. - --------------------------------------------------------------------------------- - -via: http://itsfoss.com/install-unity-8-desktop-ubuntu/ - -作者:[Abhishek][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://itsfoss.com/author/abhishek/ -[1]:http://en.wikipedia.org/wiki/Mir_%28software%29 -[2]:https://wiki.ubuntu.com/Unity8Desktop -[3]:http://itsfoss.com/ubuntu-15-10-codename/ -[4]:https://wiki.ubuntu.com/Unity8DesktopIso -[5]:https://wiki.ubuntu.com/Unity8inLXC -[6]:http://itsfoss.com/install-mate-desktop-ubuntu-14-04/ diff --git a/translated/tech/20150604 How To Install Unity 8 Desktop Preview In Ubuntu.md b/translated/tech/20150604 How To Install Unity 8 Desktop Preview In Ubuntu.md new file mode 100644 index 0000000000..bf1c3ea0bb --- /dev/null +++ b/translated/tech/20150604 How To Install Unity 8 Desktop Preview In Ubuntu.md @@ -0,0 +1,77 @@ +Ubuntu中安装Unity 8桌面预览版 +================================================================================ +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/06/Unity_8.jpeg) + +如果你一直关注新闻,那么Ubuntu将会切换到[Mir显示服务器][1],并随同发布[Unity 8][2]桌面。然而,在尚未确定Unity 8是否会在[Ubuntu 15.10 Willy Werewolf][3]中部署到Mir上之前,提供了一个Unity 8的预览版本供你体验和测试。通过官方PPA,可以很容地**安装Unity 8到Ubuntu 14.04,14.10和15.04中**。 + +到目前为止,开发者已经可以通过[ISO][4]获得该Unity 8预览来进行测试。但是Canonical已经通过[LXC容器][5]发布了。通过该方法,你可以获取Unity 8桌面会话,让它作为任何一个桌面环境运行在Mir显示服务器上。就像你[在Ubuntu中安装Mate桌面][6],然后从LightDm登录屏幕选择桌面会话一样。 + +好奇?想要试试Unity 8?让我们来看怎样安装它吧。 + +**注意: 它是一个实验性预览,可能不是所有人都可以让它正确工作的。** + +### 安装Unity 8桌面到Ubuntu ### + +下面是安装并使用Unity 8的步骤: + +#### 步骤 1: 安装Unity 8到Ubuntu 12.04和14.04 #### + +如果你真运行着Ubuntu 12.04和14.04,那么你必须使用官方PPA来安装Unity 8。使用以下命令进行安装: + + sudo apt-add-repository ppa:unity8-desktop-session-team/unity8-preview-lxc + sudo apt-get update + sudo apt-get upgrade + sudo apt-get install unity8-lxc + +#### 步骤 1: 安装Unity 8到Ubuntu 14.10和15.04 #### + +如果你真运行着Ubuntu 14.10或15.04,那么Unity 8 LXC已经在源中准备好。你只需要运行以下命令: + + sudo apt-get update + sudo apt-get install unity8-lxc + +#### 步骤 2: 设置Unity 8桌面预览LXC #### + +安装Unity 8 LXC后,该对它进行设置,下面的命令就可达到目的: + + sudo unity8-lxc-setup + +它将花费一些时间来设置,所以,给点耐心吧。它会下载ISO,然后解压缩,接着完整最后一些必要的设置来让它工作。它也会安装一个LightDM的轻度修改版本。这一切都搞定后,需要重启。 + +#### 步骤 3: 选择Unity 8 #### + +重启后,在登录屏幕,点击你的登录旁边的Ubuntu图标: + +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2014/08/Change_Desktop_Environment_Ubuntu.jpeg) + +你应该可以在这看到Unity 8的选项,选择它: + +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/06/Select_Unity8.jpeg) + +### 卸载Unity 8 LXC ### + +如果你发现Unity 8毛病太多,或者你不喜欢它,那么你可以以相同的方式切换会默认Unity版本。此外,你也可以通过下面的命令移除Unity 8: + + sudo apt-get remove unity8-lxc + +该命令会将Unity 8选项从LightDM屏幕移除,但是配置仍然保留着。 + +以上就是你在Ubuntu中安装嗲有Mir的Unity 8的全部过程,试玩后请分享你关于Unity 8的想法哦! + +-------------------------------------------------------------------------------- + +via: http://itsfoss.com/install-unity-8-desktop-ubuntu/ + +作者:[Abhishek][a] +译者:[GOLinux](https://github.com/GOLinux) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://itsfoss.com/author/abhishek/ +[1]:http://en.wikipedia.org/wiki/Mir_%28software%29 +[2]:https://wiki.ubuntu.com/Unity8Desktop +[3]:http://itsfoss.com/ubuntu-15-10-codename/ +[4]:https://wiki.ubuntu.com/Unity8DesktopIso +[5]:https://wiki.ubuntu.com/Unity8inLXC +[6]:http://itsfoss.com/install-mate-desktop-ubuntu-14-04/ From f2a275e7d04fd30f0d0056d210955c8aed7feb64 Mon Sep 17 00:00:00 2001 From: ZTinoZ Date: Fri, 5 Jun 2015 16:53:11 +0800 Subject: [PATCH 267/965] Translating by ZTinoZ --- ...526 20 Useful Terminal Emulators for Linux.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/sources/tech/20150526 20 Useful Terminal Emulators for Linux.md b/sources/tech/20150526 20 Useful Terminal Emulators for Linux.md index 4ac5708fa6..4d2f8cfc16 100644 --- a/sources/tech/20150526 20 Useful Terminal Emulators for Linux.md +++ b/sources/tech/20150526 20 Useful Terminal Emulators for Linux.md @@ -14,10 +14,10 @@ Terminator是一款先进且强大的终端仿真器,它支持多终端窗口 #### Terminator的特性 #### -- Customize your profiles and colour schemes, set the size to fit your needs. -- Use plugins to get even more functionality. -- Several key-shortcuts are available to speed up common activities. -- Split the terminal window into several virtual terminals and re-size them as needed. +- 自定义外形和色彩设计,根据你的需要设置尺寸。 +- 使用插件来获取更多功能。 +- 快捷键可以加快普通操作。 +- 可以把终端窗口分裂成几个虚拟终端并把它们重新设置成你需要的尺寸。 ![Terminator Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/Terminator-Emulator.jpeg) @@ -28,13 +28,13 @@ Terminator Terminal ### 2. Tilda ### -Tilda is a stylish drop-down terminal based on GTK+. With the help of a single key press you can launch a new or hide Tilda window. However, you can add colors of your choice to change the look of the text and Terminal background. +Tilda是一款漂亮的基于GTK+的下拉式终端。敲击一个键你就可以打开一个新的或隐藏着的Tilda窗口。然而,你可以添加你所选择的颜色来更改文本颜色和终端背景颜色。 #### Tilda的特性 #### - Interface with Highly customization option. - You can set the transparency level for Tilda window. - Excellent built-in colour schemes. +- 高度定制的选项界面设置。 +- 你可以给Tilda设置透明度。 +- 优秀的嵌入式色彩设计。 ![Tilda Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/Tilda-Emulator.jpeg) From e75c5aaea9e2a025215967e8b35701658d44c8f9 Mon Sep 17 00:00:00 2001 From: wxy Date: Fri, 5 Jun 2015 20:40:44 +0800 Subject: [PATCH 268/965] PUB:20150427 15 Things to Do After Installing Ubuntu 15.04 Desktop @ZTinoZ --- ...o After Installing Ubuntu 15.04 Desktop.md | 162 +++++++++++------- 1 file changed, 98 insertions(+), 64 deletions(-) rename {translated/tech => published}/20150427 15 Things to Do After Installing Ubuntu 15.04 Desktop.md (71%) diff --git a/translated/tech/20150427 15 Things to Do After Installing Ubuntu 15.04 Desktop.md b/published/20150427 15 Things to Do After Installing Ubuntu 15.04 Desktop.md similarity index 71% rename from translated/tech/20150427 15 Things to Do After Installing Ubuntu 15.04 Desktop.md rename to published/20150427 15 Things to Do After Installing Ubuntu 15.04 Desktop.md index e806e8e436..de0f973cc8 100644 --- a/translated/tech/20150427 15 Things to Do After Installing Ubuntu 15.04 Desktop.md +++ b/published/20150427 15 Things to Do After Installing Ubuntu 15.04 Desktop.md @@ -1,74 +1,87 @@ 安装完Ubuntu 15.04桌面后要做的15件事 ================================================================================ -本教程适用于新手和在自己的电脑上安装好Ubuntu 15.04 “Vivid Vervet” 桌面之后为了自定义自己的系统并安装一些基本程序作为日常使用的已经做了一些准备的人。 +本教程适用于在自己的电脑上安装了 Ubuntu 15.04 “Vivid Vervet” 桌面的新手,这里会告诉你安装之后应该做哪些事情,来自定义你的系统和安装一些基本程序作为日常使用。 ![Things to Do After Installing Ubuntu 15.04](http://www.tecmint.com/wp-content/uploads/2015/04/things-to-do-after-installing-ubuntu-15.04.jpeg) -安装完Ubuntu 15.04桌面后要做的15件事 + +*安装完Ubuntu 15.04桌面后要做的15件事* ### 1. 启用Ubuntu额外软件库并更新系统 ### -在刚装好Ubuntu之后你应该要关心的第一件事是启用官方合作伙伴提供的Ubuntu额外软件库并且通过最近一次的安全补丁和软件更新来保持系统是最新状态。 +在刚装好Ubuntu之后你应该要关心的第一件事是启用Canonical的官方合作伙伴提供的Ubuntu额外软件库,并且通过最近一次的安全补丁和软件更新来保持系统是最新状态。 -要完成这一步,依次从左边菜单中打开System Settings -> Software and Updates工具并检查所有Ubuntu软件和其他软件库(官方合作伙伴所提供),点击关闭按钮并等待重新加载缓存源树。 +要完成这一步,依次从左边菜单中打开System Settings -> Software and Updates工具,并检查所有Ubuntu软件和其他软件库(Canonical 的合作伙伴所提供),点击关闭按钮并等待重新加载缓存源树。 ![Software Updates](http://www.tecmint.com/wp-content/uploads/2015/04/Software-Updates.jpg) -Software Updates + +*软件更新* ![Other Software (Canonical Partners)](http://www.tecmint.com/wp-content/uploads/2015/04/Other-Software.jpg) -Other Software (Canonical Partners) -经过一系列快速平滑的更新过程之后,打开终端并输入以下命令来让系统使用新软件库: +*其它软件(Canonical 合作伙伴)* + +为了快速而顺畅的更新,打开终端并输入以下命令来让系统使用新软件库: $ sudo apt-get update $ sudo apt-get upgrade ![Ubuntu Upgrade](http://www.tecmint.com/wp-content/uploads/2015/04/Ubuntu-Upgrade.jpg) -Ubuntu Upgrade + +*Ubuntu 升级* ### 2. 安装额外驱动 ### 为了能让系统扫描并安装额外的硬件专有驱动,我们依然从System Settings打开Software and Updates工具,选择Additional Drivers标签并等待该工具扫描驱动。 -如果有驱动匹配到了你的硬件,查看你想要安装的驱动并点击Apply按钮来安装它,以防专有驱动没有如期工作,用Revert按钮就能卸载它们或勾选Do not use the device后点击Apply按钮。 +如果有驱动匹配到了你的硬件,查看你想要安装的驱动并点击Apply按钮来安装它。如果专有驱动没有如预期的工作,用Revert按钮就能卸载它们或勾选Do not use the device后点击Apply按钮。 ![Install Drivers in Ubuntu](http://www.tecmint.com/wp-content/uploads/2015/04/install-drivers.jpg) -Install Drivers + +*安装驱动* ### 3. 安装Synaptic和Gdebi工具 ### -除了Ubuntu Software Center,Synaptic是一个apt图形化工具,通过它你能管理、安装、卸载、搜索和升级软件库并配置软件包。同样的,Gdebi在功能上也有相同的地方。在终端上输入以下命令来安装这两个包: +除了Ubuntu Software Center之外,Synaptic也是一个apt的图形化工具,通过它你能管理、安装、卸载、搜索和升级软件库并配置软件包。同样的,Gdebi对本地的.deb 包也有类似功能。在终端上输入以下命令来安装这两个包: $ sudo apt-get install synaptic gdebi ![Install Synaptic and Gdebi](http://www.tecmint.com/wp-content/uploads/2015/04/install-synaptic-gdebi.jpg) -Install Synaptic and Gdebi + +*安装 Synaptic 和 Gdebi* ![Synaptic Package Manager](http://www.tecmint.com/wp-content/uploads/2015/04/synaptic-package-manager.jpg) -Synaptic Package Manager -### 4. 更改系统外观和运行状态 ### +*Synaptic 包管理器* -如果你想要更改桌面背景或图标大小,依次打开System Settings –> Appearance –> Look并对桌面进行个性化设置,把菜单移动到窗口标题栏,在Behavior标签中启动workspaces和desktop icons或开关auto-hide the Launcher。 +### 4. 更改系统外观和行为 ### + +如果你想要更改桌面背景或图标大小,依次打开System Settings –> Appearance –> Look,并对桌面进行个性化设置。要把菜单移动到窗口标题栏,在Behavior标签中设置即可。 ![System Appearances](http://www.tecmint.com/wp-content/uploads/2015/04/system-appearance.jpg) -System Appearances + +*系统外观* ### 5. 提升系统安全性和隐私性 ### ![System Security Enhancement](http://www.tecmint.com/wp-content/uploads/2015/04/system-security-1.jpg) -System Security Enhancement + +*增强系统安全* ![System Security Options](http://www.tecmint.com/wp-content/uploads/2015/04/system-security-2.jpg) -System Security Options + +*系统安全选项* ### 6. 禁用不需要开机自启动的应用程序 ### -要提高登录系统的速度,通过输入以下命令来显示被隐藏的开机启动应用程序,在Dash中搜索它就能打开Startup Applications工具并反选不需要再登录系统的过程中启动的程序。 +要提高登录系统的速度,通过输入以下命令来显示被隐藏的开机启动应用程序。 - $ sudo sed -i ‘s/NoDisplay=true/NoDisplay=false/g’ /etc/xdg/autostart/*.desktop + $ sudo sed -i 's/NoDisplay=true/NoDisplay=false/g' /etc/xdg/autostart/*.desktop + +在Dash中搜索打开Startup Applications工具,并反选不需要在登录系统的过程中启动的程序。 ![Disable Unwanted Applications](http://www.tecmint.com/wp-content/uploads/2015/04/disable-unwanted-applications.jpg) -Disable Unwanted Applications + +*禁用不需要的应用程序* ### 7. 添加扩展多媒体支持 ### @@ -88,50 +101,54 @@ Disable Unwanted Applications $ sudo apt-get install vlc smplayer audacious qmmp mixxx xbmc handbrake openshot ![Install Media Players](http://www.tecmint.com/wp-content/uploads/2015/04/install-media-players.jpg) -Install Media Players + +*安装媒体播放器* ![Media Player Playlist](http://www.tecmint.com/wp-content/uploads/2015/04/media-playllist.jpg) -Media Player Playlist -除了多媒体播放器,安装ubuntu-restricted-extras和Java支持包也可以解码并支持其它受约束的多媒体格式。 +*媒体播放器的播放列表* + +除了多媒体播放器,安装ubuntu-restricted-extras和Java支持包也可以解码并支持其它受限制的多媒体格式。 $ sudo apt-get install ubuntu-restricted-extras openjdk-8-jdk ![Install Ubuntu Extras](http://www.tecmint.com/wp-content/uploads/2015/04/install-ubuntu-extras.jpg) -Install Ubuntu Extras -在终端上输入以下命令来启用DVD Playback和其它多媒体解码器: +*安装 Ubuntu Extras* + +在终端上输入以下命令来启用DVD 回放和其它多媒体解码器: $ sudo apt-get install ffmpeg gstreamer0.10-plugins-bad lame libavcodec-extra $ sudo /usr/share/doc/libdvdread4/install-css.sh ![Enable Video Codes](http://www.tecmint.com/wp-content/uploads/2015/04/enable-video-playbacks.jpg) -Enable Video Codes -### 8. 安装图像处理应用程序 ### +*启用视频解码器* + +### 8. 安装图像处理应用程序和安装媒体烧录软件 ### 如果你是一个摄影爱好者,想在Ubuntu上处理调整图像,或许需要安装一下图像处理程序: -- GIMP (alternative for Adobe Photoshop) +- GIMP (一个 Adobe Photoshop 替代品) - Darktable - Rawtherapee - Pinta - Shotwell -- Inkscape (alternative for Adobe Illustrator) +- Inkscape (一个 Adobe Illustrator 替代品) - Digikam - Cheese -这些应用程序能从Ubuntu Software Center中安装或者立刻在终端上使用以下命令: +这些应用程序能从Ubuntu Software Center中安装,或者立刻在终端上使用以下命令: $ sudo apt-get install gimp gimp-plugin-registry gimp-data-extras darktable rawtherapee pinta shotwell inkscape ![Install Image Applications](http://www.tecmint.com/wp-content/uploads/2015/04/install-image-applications.jpg) -Install Image Applications + +*安装图像处理应用程序* ![Rawtherapee Tool](http://www.tecmint.com/wp-content/uploads/2015/04/rawtherapee.jpg) -Rawtherapee Tool -### 9. 安装媒体烧录软件 ### +*Rawtherapee Tool* 如果要挂载ISO镜像或烧录一张CD或DVD,你可以选择并安装以下软件中的一款: @@ -146,18 +163,20 @@ Rawtherapee Tool $ sudo apt-get install furiusisomount ![Install Media Burners](http://www.tecmint.com/wp-content/uploads/2015/04/install-media-burners.jpg) -Install Media Burners -### 10. 安装压缩应用程序 ### +*安装媒体烧录软件* + +### 9. 安装压缩应用程序 ### 如果要处理大多数归档格式的文件(zip, tar.gz, zip, 7zip rar等等),输入以下命令来安装这些包: $ sudo apt-get install unace unrar zip unzip p7zip-full p7zip-rar sharutils rar uudeview mpack arj cabextract file-roller ![Install Archive Applications](http://www.tecmint.com/wp-content/uploads/2015/04/install-archive-apps.jpg) -Install Archive Applications -### 11. 安装聊天应用程序 ### +*安装压缩应用程序* + +### 10. 安装聊天应用程序 ### 如果你想要和世界各地的人们聊天,这里有一份最流行的Linux聊天应用程序列表: @@ -179,14 +198,16 @@ Install Archive Applications $ sudo apt-get install telegram ![Install Chat Applications](http://www.tecmint.com/wp-content/uploads/2015/04/install-chat-apps.jpg) -Install Chat Applications -想要在Ubuntu上安装Viber可以访问[Viber官方网站][1]下载Debian安装包到本地并用Gdebi包管理工具来安装viber.deb应用程序(右击 –> 打开 -> GDebi Package Installer). +*安装聊天应用程序* + +想要在Ubuntu上安装Viber可以访问[Viber官方网站][1]下载Debian安装包到本地,并用Gdebi包管理工具来安装viber.deb应用程序(右击 –> 打开 -> GDebi Package Installer). ![Install Viber in Ubuntu](http://www.tecmint.com/wp-content/uploads/2015/04/install-viber.jpg) -Install Viber -### 12. 安装种子软件 ### +*安装 Viber* + +### 11. 安装种子软件 ### 在Ubuntu最流行的种子应用程序和P2P文件共享程序是: @@ -203,77 +224,90 @@ Install Viber $ sudo apt-get install linuxdcpp ![Install Torrent](http://www.tecmint.com/wp-content/uploads/2015/04/install-torrent.jpg) -Install Torrent -### 13. 安装Windows仿真器-Wine和游戏支持平台-Steam ### +*安装种子软件* -Wine仿真器允许你在Linux上安装并运行Window应用程序。在另一方面,Steam是一款Valve开发的流行于Linux系统的游戏平台。想要在你的机器上安装它们,可以输入以下命令或使用Ubuntu Software Center。 +### 12. 安装Windows仿真器-Wine和游戏支持平台-Steam ### + +Wine仿真器允许你在Linux上安装并运行Window应用程序。在另一方面,Steam是一款Valve开发的基于Linux系统的流行游戏平台。想要在你的机器上安装它们,可以输入以下命令或使用Ubuntu Software Center。 $ sudo apt-get install steam wine winetricks ![Install Wine](http://www.tecmint.com/wp-content/uploads/2015/04/install-wine.jpg) -Install Wine -### 14. 安装Cairo-Dock并启用桌面视觉效果 ### +*安装 Wine* + +### 13. 安装Cairo-Dock并启用桌面视觉效果 ### Cairo-Dock是一款漂亮且灵巧的用于Linux桌面上的启动条,类似于Mac OS X dock。想要在Ubuntu上安装它,可以在终端上运行以下命令: $ sudo apt-get install cairo-dock cairo-dock-plug-ins ![Install Cairo Dock](http://www.tecmint.com/wp-content/uploads/2015/04/install-cairo-dock.jpg) -Install Cairo Dock + +*安装Cairo-Dock* ![Add Cairo Dock at Startup](http://www.tecmint.com/wp-content/uploads/2015/04/add-cairo-dock-startup.jpg) -Add Cairo Dock at Startup + +*让 Cairo Dock 自动启动* 想要启用某一套桌面效果,例如Cube效果,可以使用以下命令来安装Compiz包: $ sudo apt-get install compiz compizconfig-settings-manager compiz-plugins-extra -想要激活桌面Cube效果,在Dash上查找ccsm,打开CompizConfig Settings Manager,找到General Options – > Desktop Size并设置Horizontal Virtual Size的值为4,Vertical Virtual Size的值为1。然后返回检查Desktop Cube框(禁用Desktop Wall)和Rotate Cube框(解决冲突 -> 禁止切换视图1)并Ctrl+Alt+鼠标左击来查看cube效果。 +想要激活桌面Cube效果,在Dash上查找ccsm来打开CompizConfig Settings Manager,找到General Options – > Desktop Size并设置Horizontal Virtual Size的值为4,Vertical Virtual Size的值为1。然后返回检查Desktop Cube框(禁用Desktop Wall)和Rotate Cube框(解决冲突 -> 禁止切换视图1)并Ctrl+Alt+鼠标左击来查看cube效果。 ![Enable Compiz](http://www.tecmint.com/wp-content/uploads/2015/04/enable-compiz.jpg) -Enable Compiz + +*启用Compiz* ![Compiz Settings](http://www.tecmint.com/wp-content/uploads/2015/04/compiz-settings.jpg) -Compiz Settings + +*Compiz设置* ![Compiz Settings Addons](http://www.tecmint.com/wp-content/uploads/2015/04/compiz-settings-1.jpg) -Compiz Settings Addons + +*Compiz设置插件* ![Desktop Window Rotating](http://www.tecmint.com/wp-content/uploads/2015/04/desktop-cube.jpg) -Desktop Window Rotating -### 15. 添加额外浏览器支持 ### +*桌面窗口旋转* + +### 14. 添加其它浏览器 ### Ubuntu 15.04默认浏览器是Mozilla Firefox。想要安装其它浏览器比如Google Chrome或Opera,可以访问它们的官方网站,下载所提供的.deb包并用Gdebi Package Installer在你的系统上安装它们。 ![Enable Browser Support](http://www.tecmint.com/wp-content/uploads/2015/04/enable-browser-support.jpg) -Enable Browser Support + +*启用浏览器支持* ![Opera Browser Support](http://www.tecmint.com/wp-content/uploads/2015/04/opera.jpg) -Opera Browser Support + +*Opera Browser* 想要安装Chromium开源浏览器请在终端上输入以下命令: $ sudo apt-get install chromium-browser -### 16. 安装Tweak工具 ### +### 15. 安装Tweak工具 ### 想要用额外的应用程序来自定义Ubuntu吗?在终端上输入以下命令来安装Unity Tweak工具和Gnome Tweak工具: $ sudo apt-get install unity-tweak-tool gnome-tweak-tool ![Install Tweak Tool](http://www.tecmint.com/wp-content/uploads/2015/04/install-tweak-tool.jpg) -Install Tweak Tool + +*安装Tweak Tool* ![Tweak Tool Settings](http://www.tecmint.com/wp-content/uploads/2015/04/tweak-settings.jpg) -Tweak Tool Settings -另一个有趣的tweak工具主要是Ubuntu Tweak包,可以通过访问官方网站来获取并安装: [http://ubuntu-tweak.com/][2]. +*Tweak Tool 设置* + +另一个有趣的tweak工具主要是Ubuntu Tweak包,可以通过访问官方网站来获取并安装: [http://ubuntu-tweak.com/][2]。 ![Tweak Tool: System Information](http://www.tecmint.com/wp-content/uploads/2015/04/tweak-system-info.jpg) -Tweak Tool: System Information + +*Tweak Tool: 系统信息* 在你安装好这一连串软件之后,你或许想要清理一下你的系统来释放一点硬盘上的空间,输入以下命令即可: @@ -281,7 +315,7 @@ Tweak Tool: System Information $ sudo apt-get -y autoclean $ sudo apt-get -y clean -这只是tweaks工具中的其中一些和普通用户日常生活中可能会在Ubuntu 15.04桌面上安装使用的程序。想要了解更多高级的程序,特性和功能,请使用Ubuntu Software Center或查阅Ubuntu Wiki主页。 +这只是一些普通用户日常使用Ubuntu 15.04桌面是需要调整和安装的程序。想要了解更多高级的程序,特性和功能,请使用Ubuntu Software Center或查阅Ubuntu Wiki主页。 -------------------------------------------------------------------------------- @@ -289,7 +323,7 @@ via: http://www.tecmint.com/things-to-do-after-installing-ubuntu-15-04-desktop/ 作者:[Matei Cezar][a] 译者:[ZTinoZ](https://github.com/ZTinoZ) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 From 4d6185d8133d835aadacf712d7e686f7bff9f5cb Mon Sep 17 00:00:00 2001 From: sevenot Date: Fri, 5 Jun 2015 22:07:40 +0800 Subject: [PATCH 269/965] sevenot translating --- ...oundation achievements in 2014--download the Annual Report.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/share/20150604 Read about The Document Foundation achievements in 2014--download the Annual Report.md b/sources/share/20150604 Read about The Document Foundation achievements in 2014--download the Annual Report.md index 518e96c171..28b0a76083 100644 --- a/sources/share/20150604 Read about The Document Foundation achievements in 2014--download the Annual Report.md +++ b/sources/share/20150604 Read about The Document Foundation achievements in 2014--download the Annual Report.md @@ -1,3 +1,4 @@ +sevenot translating Read about The Document Foundation achievements in 2014: download the Annual Report! ================================================================================ ![](https://documentfoundation.files.wordpress.com/2015/06/tdf-report.jpg) From ce19dc8a8caf8169a086a8ce0ebc319cd9ba5beb Mon Sep 17 00:00:00 2001 From: wxy Date: Fri, 5 Jun 2015 22:16:51 +0800 Subject: [PATCH 270/965] PUB:20150417 How to Install Discourse in a Docker Container @wi-cuckoo --- ...Install Discourse in a Docker Container.md | 72 ++++++++++--------- 1 file changed, 38 insertions(+), 34 deletions(-) rename {translated/tech => published}/20150417 How to Install Discourse in a Docker Container.md (54%) diff --git a/translated/tech/20150417 How to Install Discourse in a Docker Container.md b/published/20150417 How to Install Discourse in a Docker Container.md similarity index 54% rename from translated/tech/20150417 How to Install Discourse in a Docker Container.md rename to published/20150417 How to Install Discourse in a Docker Container.md index e4dcf8f3c5..cb3351a77e 100644 --- a/translated/tech/20150417 How to Install Discourse in a Docker Container.md +++ b/published/20150417 How to Install Discourse in a Docker Container.md @@ -1,8 +1,10 @@ 如何在一个Docker容器里安装Discourse ============================================================================= -大家好,今天我们将会学习如何利用Docker平台安装Discourse。Discourse是完全开源的讨论平台,为互联网的下一个十年而搭建,拥有一个邮件列表,一个论坛和一个long-form(此处不明白)聊天室。不管从技术角度还是社会学角度,当你试图去重新想象当今一个现代的,可持续的,完全开源的互联网讨论平台该是什么样子,Discourse都是一个不错的途径。Discourse简洁,直接之于讨论。它确实是一个令人称赞的平台,对于互联网上各种各样的讨论来说,提供了在机器之外如此酷的一个服务。Docker是一个开源平台,提供打包,运输和运行任何应用的平台,如一个轻量级容器。Docker容器技术使得Discourse更加方便和容易去建立应用程序。 +大家好,今天我们将会学习如何利用Docker平台安装Discourse。Discourse是一个完全开源的讨论平台,以未来十年的互联网理念设计,拥有一个邮件列表,一个论坛和一个长篇聊天室。不管从技术角度还是社会学角度,如今要体验一个现代的、勃勃生机的、完全开源的互联网讨论平台,Discourse都是一个不错的途径。Discourse是一个简单、简明、简易的讨论方式。它确实是一个令人称赞的平台,对于互联网上各种各样的论坛来说,提供了一个上手可用的很酷的服务。 -所以,下面是一些快速且容易的步骤,用来安装Discourse在一个Docker环境里面。 +Docker是一个开源的、可以将任何应用以轻量级容器的方式打包、传输和运行的开放平台。Docker容器技术使得可以更加方便和容易构建Discourse。 + +所以,下面是一些快速且容易的步骤,用来在一个Docker环境里面安装Discourse。 ### 1. 安装Docker ### @@ -16,7 +18,7 @@ docker安装包在Ubuntu的仓库里面是可用的,所以我们将会使用ap #### 在CentOS 7上 #### -在CentOS 7的主机上,我们使用yum管理器安装docker,因为CentOS的仓库里同样有docker安装包 +在CentOS 7的主机上,我们使用yum管理器安装docker,因为CentOS的仓库里同样有docker安装包 # yum install docker @@ -24,7 +26,7 @@ docker安装包在Ubuntu的仓库里面是可用的,所以我们将会使用ap ### 2. 设定交换内存 ### -如果你的RAM容量小于1GB,那么确保升级你的系统达到1GB或者以上,否则Discourse不会在512MB的RAM下安装。如果你现在准备好了安装Discourse,根据下面的步骤为你的VPS(Virtual Private Servers)或者服务器设定交换内存 +如果你的RAM容量小于1GB,那么确保升级你的系统达到1GB或者以上,Discourse不能在512MB的RAM下安装。如果你现在准备好了安装Discourse,根据下面的步骤为你的VPS(Virtual Private Servers)或者服务器设定交换内存: 运行下面的命令,创建一个空的交换文件。 @@ -34,7 +36,7 @@ docker安装包在Ubuntu的仓库里面是可用的,所以我们将会使用ap # dd if=/dev/zero of=/swapfile bs=1k count=1024k -如果你想达到2GB,跳过上面的所有步骤,跟着下面做 +如果你想达到2GB,跳过上一步,跟着下面做 # dd if=/dev/zero of=/swapfile bs=1k count=2014k @@ -50,14 +52,14 @@ docker安装包在Ubuntu的仓库里面是可用的,所以我们将会使用ap # echo "/swapfile swap swap auto 0 0" | sudo tee -a /etc/fstab -设置swappiness为10,这样交换内存仅作为一个紧急缓冲区用。 +设置swappiness参数为10,这样交换内存仅作为一个紧急缓冲区用。 # sudo sysctl -w vm.swappiness=10 # echo vm.swappiness = 10 | sudo tee -a /etc/sysctl.conf ### 3. 安装Discourse ### -在我们的主机上安装Docker后,我们将会安装Discourse。现在,我们从官方的Discourse GitHub仓库克隆一份到/var/discourse目录下。我们需要运行下面的命令完成这一步。 +在我们的主机上安装好Docker后,我们将会安装Discourse。现在,我们从官方的Discourse GitHub仓库克隆一份到`/var/discourse`目录下。我们需要运行下面的命令完成这一步。 # mkdir /var/discourse/ @@ -65,7 +67,7 @@ docker安装包在Ubuntu的仓库里面是可用的,所以我们将会使用ap # git clone https://github.com/discourse/discourse_docker.git /var/discourse/ -克隆好仓库后,我们会为discourse服务器复制配置文件 +克隆好仓库后,我们给discourse服务器复制配置文件 # cp samples/standalone.yml containers/app.yml @@ -77,15 +79,15 @@ docker安装包在Ubuntu的仓库里面是可用的,所以我们将会使用ap # nano containers/app.yml -现在,我们需要设置开发者的邮箱地址为DISCOURSE_DEVELOPER_EMAILS,如下。 +现在,我们需要将开发者邮箱地址DISCOURSE_DEVELOPER_EMAILS修改为自己的,如下。 DISCOURSE_DEVELOPER_EMAILS: 'arun@linoxide.com' -然后,我们会设置主机名为服务器的域名。 +然后,我们设置主机名为服务器的域名。 DISCOURSE_HOSTNAME: 'discourse.linoxide.com' -接着,为每个托管在相同discourse主机或者vps上的SMTP服务器设定邮箱证书。SMTP设置需要从你的Discourse发送邮件 +接着,设置放在相同的discourse主机或vps上的SMTP服务器的认证信息。这些SMTP设置用于你的Discourse发送邮件。 DISCOURSE_SMTP_ADDRESS: smtp.linoxide.com DISCOURSE_SMTP_PORT: 587 # (optional) @@ -94,11 +96,9 @@ docker安装包在Ubuntu的仓库里面是可用的,所以我们将会使用ap ![](http://blog.linoxide.com/wp-content/uploads/2015/04/discourse-configuration.png) - Discourse 配置 - 如果你在使用一个1GB的Discourse,设定UNICORN_WORKERS为2,db_shared_buffers为128MB,这样你会有更多的内存空间。 -运行Discourse需要强制性地创建一个邮件服务器。如果你已经有一个服务器了那就好办多了,我们可以使用它的证书。如果你没有现成的邮件服务器,或者你不知道那是什么。没关系,创建一个免费的帐号在[Mandrill][1] ([Mailgun][2],或者[Mailjet][3]),然后使用面板上提供的证书。 +运行Discourse需要强制性地创建一个邮件服务器。如果你已经有一个服务器了那就好办多了,我们可以使用它的认证信息。如果你没有现成的邮件服务器,或者你不知道那是什么。没关系,可以在[Mandrill][1] (或[Mailgun][2]和 [Mailjet][3])创建一个免费的帐号,然后使用其提供的认证信息。 ### 5. 启动Discourse应用 ### @@ -110,35 +110,39 @@ docker安装包在Ubuntu的仓库里面是可用的,所以我们将会使用ap 上述命令可能会花去几分钟时间,会自动配置我们的Discourse环境。然后,该进程完成后,我们需要运行下面的命令启动Discourse App - #./launch start app + #./launcher start app ![Starting Discourse](http://blog.linoxide.com/wp-content/uploads/2015/04/starting-discourse.png) +如果一切都正常,我们就能使用惯用的浏览器来访问我们新鲜出炉的 Discourse 的 Web 界面了: http://ip-address/ or http://discourse.linoxide.com/ 。然后,我们就可以创建一个新账号并成为管理员。 + +![](http://blog.linoxide.com/wp-content/uploads/2015/04/Discourse-web-interface.png) + ### 维护 ### -这里往下是/var/discourse/目录里加载命令的使用,这使得我们可以承担维护的任务,通过Docker 容器控制Disourse。(这里不太明白原文表达意思) +这里往下是/var/discourse/目录里的 launcher 命令的用法,它可以用于我们在Docker 容器里面控制和维护Disourse。 - Usage: launcher COMMAND CONFIG [--skip-prereqs] - Commands: - start: Start/initialize a container - stop: Stop a running container - restart: Restart a container - destroy: Stop and remove a container - enter: Use nsenter to enter a container - ssh: Start a bash shell in a running container - logs: Docker logs for container - mailtest: Test the mail settings in a container - bootstrap: Bootstrap a container for the config based on a template - rebuild: Rebuild a container (destroy old, bootstrap, start new) - cleanup: Remove all containers that have stopped for > 24 hours + 用法: launcher 命令 配置 [--skip-prereqs] + 命令: + start: 启动/初始化一个容器 + stop: 停止一个运行的容器 + restart: 重启一个容器 + destroy:停止并删除一个容器 + enter: 使用 nsenter 进入容器 + ssh: 在一个运行的容器中启动一个 bash shell + logs: 容器的 Docker l日志 + mailtest: 在容器中测试邮件设置 + bootstrap: 基于配置模版来引导一个容器 + rebuild: 重建一个容器(摧毁旧的,初始化,启动新的) + cleanup: 清理所有停止了24小时以上的容器 - Options: - --skip-prereqs Don't check prerequisites - --docker-args Extra arguments to pass when running docker + 选项: + --skip-prereqs 不检查前置需求 + --docker-args 当运行 docker 时,展开并传入参数 ### 总结 ### -Hurray!我们已经成功使用Docker技术安装了Discourse。Docker技术使得Discourse十分容易安装在任何平台,并且包含所有的要求。我们需要自己的邮件服务器或者邮件服务器的证书来启动它。对于便捷的现代邮件列表,论坛来说,Discourse是一个伟大的平台。(最后这句有些别扭) +哈哈!我们已经成功使用Docker技术安装了Discourse。Docker技术使得Discourse十分容易安装在任何平台,并且包含所有的要求。我们需要自己的邮件服务器或者邮件服务器的证书来启动它。对于便捷的现代邮件列表,论坛来说,Discourse是一个伟大的平台。(最后这句有些别扭) -------------------------------------------------------------------------------- @@ -146,7 +150,7 @@ via: http://linoxide.com/how-tos/install-discourse-docker-container/ 作者:[Arun Pyasi][a] 译者:[wi-cuckoo](https://github.com/wi-cuckoo) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 From 1b9dad63917ac0230a59a10103cb3e9e6d1453ab Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 5 Jun 2015 22:32:20 +0800 Subject: [PATCH 271/965] translated --- ...4 How to access SQLite database in Perl.md | 44 +++++++++---------- 1 file changed, 21 insertions(+), 23 deletions(-) rename {sources => translated}/tech/20150604 How to access SQLite database in Perl.md (70%) diff --git a/sources/tech/20150604 How to access SQLite database in Perl.md b/translated/tech/20150604 How to access SQLite database in Perl.md similarity index 70% rename from sources/tech/20150604 How to access SQLite database in Perl.md rename to translated/tech/20150604 How to access SQLite database in Perl.md index 0e0723c219..76cc1f01f0 100644 --- a/sources/tech/20150604 How to access SQLite database in Perl.md +++ b/translated/tech/20150604 How to access SQLite database in Perl.md @@ -1,31 +1,29 @@ -Translating---geekpi - -How to access SQLite database in Perl +如何用Perl访问SQLite数据库 ================================================================================ -SQLite is a zero-configuration, server-less, file-based transactional database system. Due to its lightweight, self-contained, and compact design, SQLite is an extremely popular choice when you want to integrate a database into your application. In this post, I am going to show you how to create and access a SQLite database in Perl script. The Perl code snippet I present is fully functional, so you can easily modify and integrate it into your project. +SQLite是一个零配置,无服务端,基于文件的事务文件系统。由于它的轻量级,自包含和紧凑的设计,所以当你想要集成数据库到你的程序中时,SQLite是一个非常流行的选择。在这篇文章中,我会展示如何用Perl脚本来创建和访问SQLite数据库。我演示的Perl代码片段是完整的,所以你可以很简单地修改并集成到你的项目中。 ![](https://farm1.staticflickr.com/552/18444614631_9e7fce8243_c.jpg) -### Preparation for SQLite Access ### +### 访问SQLite的准备 ### -I am going to use SQLite DBI Perl driver to connect to SQLite3. Thus you need to install it (along with SQLite3) on your Linux system. +我会使用SQLite DBI Perl驱动来连接到SQLite3。因此你需要在Linux中安装它(和SQLite3一起)。 -**Debian, Ubuntu or Linux Mint** +**Debian、 Ubuntu 或者 Linux Mint** $ sudo apt-get install sqlite3 libdbd-sqlite3-perl -**CentOS, Fedora or RHEL** +**CentOS、 Fedora 或者 RHEL** $ sudo yum install sqlite perl-DBD-SQLite -After installation, you can check if the SQLite driver is indeed available by using the following script. +安装后,你可以检查SQLite驱动可以通过下面的脚本访问到。 #!/usr/bin/perl my @drv = DBI->available_drivers(); print join("\n", @drv), "\n"; -If you run the script, you should see SQLite in the output. +如果你运行脚本,你应该会看见下面的输出。 DBM ExampleP @@ -35,16 +33,16 @@ If you run the script, you should see SQLite in the output. SQLite Sponge -### Perl SQLite Access Example ### +### Perl SQLite 访问示例 ### -Here is the full-blown Perl code example of SQLite access. This Perl script will demonstrate the following SQLite database management routines. +下面就是Perl访问SQLite的示例。这个Perl脚本会演示下面这些SQLite数据库的常规管理。 -- Create and connect to a SQLite database. -- Create a new table in a SQLite database. -- Insert rows into a table. -- Search and iterate rows in a table. -- Update rows in a table. -- Delete rows in a table. +- 创建和连接SQLite数据库 +- 在SQLite数据库中创建新表 +- 在表中插入行 +- 在表中搜索和迭代行 +- 在表中更新行 +- 在表中删除行 use DBI; use strict; @@ -130,7 +128,7 @@ Here is the full-blown Perl code example of SQLite access. This Perl script will $dbh->disconnect(); print STDERR "Exit the database\n"; -A successful run of the above Perl script will create a SQLite database file named "xmodulo.db", and show the following output. +上面的Perl脚本运行成功后会创建一个叫“xmodulo.db”的数据库文件,并会有下面的输出。 Database opened successfully Table created successfully @@ -153,9 +151,9 @@ A successful run of the above Perl script will create a SQLite database file nam A total of 1 rows deleted Exit the database -### Troubleshooting ### +### 错误定位 ### -If you attempt to access SQLite in Perl without installing SQLite DBI driver, you will encounter the following error. You must install DBI driver as describe at the beginning to fix this error. +如果你尝试没有安装SQLite DBI驱动的情况下使用Perl访问SQLite的话,你会遇到下面的错误。你必须按开始说的安装DBI驱动。 Can't locate DBI.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at ./script.pl line 3. BEGIN failed--compilation aborted at ./script.pl line 3. @@ -165,9 +163,9 @@ If you attempt to access SQLite in Perl without installing SQLite DBI driver, yo via: http://xmodulo.com/access-sqlite-database-perl.html 作者:[Dan Nanni][a] -译者:[译者ID](https://github.com/译者ID) +译者:[geekpi](https://github.com/geekpi) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 -[a]:http://xmodulo.com/author/nanni \ No newline at end of file +[a]:http://xmodulo.com/author/nanni From 2fcfc3c8bbe67e952fc710af3e6a9237221f662d Mon Sep 17 00:00:00 2001 From: wxy Date: Sat, 6 Jun 2015 08:27:55 +0800 Subject: [PATCH 272/965] PUB:20150126 Installing Cisco Packet tracer in Linux @GOLinux --- ...Installing Cisco Packet tracer in Linux.md | 52 ++++++++----------- 1 file changed, 21 insertions(+), 31 deletions(-) rename {translated/tech => published}/20150126 Installing Cisco Packet tracer in Linux.md (75%) diff --git a/translated/tech/20150126 Installing Cisco Packet tracer in Linux.md b/published/20150126 Installing Cisco Packet tracer in Linux.md similarity index 75% rename from translated/tech/20150126 Installing Cisco Packet tracer in Linux.md rename to published/20150126 Installing Cisco Packet tracer in Linux.md index e37d8c6b94..578f65f756 100644 --- a/translated/tech/20150126 Installing Cisco Packet tracer in Linux.md +++ b/published/20150126 Installing Cisco Packet tracer in Linux.md @@ -1,10 +1,10 @@ Linux中安装Cisco Packet Tracer ================================================================================ -![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/Main_picture.png) +![](http://1102047360.rsc.cdn77.org/wp-content/uploads/2015/01/Main_picture.png) ### Cisco Packet tracer是什么? ### -**Cisco Packet Tracer**是一个强大的网络模拟工具,用于进行Cisco认证时的训练。它为我们提供了各个路由器和网络设备的良好的接口视图,这些模拟设备带有很多选项,跟使用物理机一样,我们可以在网络中使用无限的设备。我们能在单个工程中创建多个网络,以获得专业化的训练。Packet Tracer将提供给我们模拟的应用层协议,如**HTTP**,**DNS**,以及像**RIP**,**OSPF**,**EIGRP**等路由协议。 +**Cisco Packet Tracer**是一个强大的网络模拟工具,用于进行Cisco认证时的培训。它为我们提供了各个路由器和网络设备的良好的接口视图,这些模拟设备带有很多选项,跟使用物理机一样,我们可以在网络中使用无限的设备。我们能在单个工程中创建多个网络,以获得专业化的训练。Packet Tracer将提供给我们模拟的应用层协议,如**HTTP**,**DNS**,以及像**RIP**,**OSPF**,**EIGRP**等路由协议。 现在,它发布了包含有**ASA 5505防火墙**命令行配置的版本。Packet Tracer通常用于Windows版本,但没有Linux版本。这里,我们可以下载并安装Cisco Packet Tracer。 @@ -26,7 +26,7 @@ Linux中安装Cisco Packet Tracer # lsb_release -a -![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/pkt_001.png) +![](http://1102047360.rsc.cdn77.org/wp-content/uploads/2015/01/pkt_001.png) ### 步骤 1: 首先,我们需要下载Cisco Packet Tracer。 ### @@ -38,17 +38,17 @@ Linux中安装Cisco Packet Tracer [下载Cisco Packet Tracer 6.1.1][2] -![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/pkt_002.png) +![](http://1102047360.rsc.cdn77.org/wp-content/uploads/2015/01/pkt_002.png) ### 步骤 2: 安装Java: ### -要安装Packet Tracer,我们需要安装java。要安装java,我们可以使用默认的仓库,或者添加PPA仓库,然后更新包缓存来安装java。 +要安装Packet Tracer,我们需要安装java。我们可以使用默认的仓库安装java;或者添加PPA仓库,然后更新包缓存来安装java。 使用以下命令来安装默认的jre # sudo apt-get install default-jre -![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/pkt_003.png) +![](http://1102047360.rsc.cdn77.org/wp-content/uploads/2015/01/pkt_003.png) (或者) @@ -57,18 +57,13 @@ Linux中安装Cisco Packet Tracer 从官方站点下载Java:[下载Java][3] # tar -zxvf jre-8u31-linux-x64.tar.gz - # sudo mkdir -p /usr/lib/jvm - # sudo mv -v jre1.8.0_31 /usr/lib/jvm/ - # cd /usr/lib/jvm/ - # sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jre1.8.0_31/bin/java" 1 - # sudo update-alternatives --set "java" "/usr/lib/jvm/jre1.8.0_31/bin/java" -通过编辑用户参数文件来设置Java环境,并添加位置参数。当我们添加进用户参数文件后,我们机器上的每个用户都可以用java了。 +通过编辑用户参数文件来设置Java环境,并添加路径相关的参数。当我们添加进用户参数文件后,我们机器上的每个用户都可以用java了。 # sudo vi /etc/profile @@ -84,27 +79,24 @@ Linux中安装Cisco Packet Tracer 检查Java版本和环境: # echo $JAVA_HOME - # java -version -![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/pkt_004.png) +![](http://1102047360.rsc.cdn77.org/wp-content/uploads/2015/01/pkt_004.png) ### 步骤 3: 启用32位架构支持: ### -对于Packet Tracer,我们需要一系32位包。要安装32位包,我们需要使用以下命令来安装一些依赖。 +对于Packet Tracer,我们需要一些32位包。要安装32位包,我们需要使用以下命令来安装一些依赖。 # sudo dpkg --add-architecture i386 # sudo apt-get update -![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/pkt_005.png) +![](http://1102047360.rsc.cdn77.org/wp-content/uploads/2015/01/pkt_005.png) # sudo apt-get install libc6:i386 - # sudo apt-get install lib32z1 lib32ncurses5 lib32bz2-1.0 - # sudo apt-get install libnss3-1d:i386 libqt4-qt3support:i386 libssl1.0.0:i386 libqtwebkit4:i386 libqt4-scripttools:i386 -![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/pkt_006.png) +![](http://1102047360.rsc.cdn77.org/wp-content/uploads/2015/01/pkt_006.png) ### 步骤 4: 解压并安装软件包: ### @@ -114,7 +106,7 @@ Linux中安装Cisco Packet Tracer # tar -zxvf Cisco_Packet_tracer.tar.gz -![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/pkt_007.png) +![](http://1102047360.rsc.cdn77.org/wp-content/uploads/2015/01/pkt_007.png) 导航到解压后的目录 @@ -124,27 +116,25 @@ Linux中安装Cisco Packet Tracer # sudo ./install -![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/pkt_008.png) +![](http://1102047360.rsc.cdn77.org/wp-content/uploads/2015/01/pkt_008.png) -![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/pkt_009.png) +![](http://1102047360.rsc.cdn77.org/wp-content/uploads/2015/01/pkt_009.png) 要使用Packet Tracer工作,我们需要设置环境,Cisco已经提供了环境脚本,我们需要以root用户来运行该脚本以设置环境变量。 # sudo ./set_ptenv.sh -![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/pkt_010.png) +![](http://1102047360.rsc.cdn77.org/wp-content/uploads/2015/01/pkt_010.png) 安装到此结束。接下来,我们需要为Packet Tracer创建桌面图标。 通过创建下面的桌面文件来创建桌面图标。 # sudo su - # cd /usr/share/applications - # sudo vim packettracer.desktop -![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/pkt_011.png) +![](http://1102047360.rsc.cdn77.org/wp-content/uploads/2015/01/pkt_011.png) 使用vim编辑器或你喜爱的那个编辑器来添加以下内容到文件。 @@ -158,9 +148,9 @@ Linux中安装Cisco Packet Tracer Terminal=false Type=Application -使用wq!来保存并退出。 +使用wq!来保存并退出vim。 -![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/pkt_012.png) +![](http://1102047360.rsc.cdn77.org/wp-content/uploads/2015/01/pkt_012.png) ### 步骤 5: 运行Packet Tracer ### @@ -168,9 +158,9 @@ Linux中安装Cisco Packet Tracer 好了,我们已经成功将Packet Tracer安装到Linux中。上述安装步骤适用于所有基于Debian的Linux发行版。 -![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/pkt_013.png) +![](http://1102047360.rsc.cdn77.org/wp-content/uploads/2015/01/pkt_013.png) -![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/pkt_014.png) +![](http://1102047360.rsc.cdn77.org/wp-content/uploads/2015/01/pkt_014.png) ### 资源 ### @@ -186,7 +176,7 @@ via: http://www.unixmen.com/installing-cisco-packet-tracer-linux/ 作者:[babin][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/) 荣誉推出 From 8ca4ea99c84e947ea54919b18e40757e67e2fab3 Mon Sep 17 00:00:00 2001 From: wxy Date: Sat, 6 Jun 2015 08:56:59 +0800 Subject: [PATCH 273/965] PUB:20150126 iptraf--A TCP or UDP Network Monitoring Utility @GOLinux --- ...A TCP or UDP Network Monitoring Utility.md | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) rename {translated/tech => published}/20150126 iptraf--A TCP or UDP Network Monitoring Utility.md (59%) diff --git a/translated/tech/20150126 iptraf--A TCP or UDP Network Monitoring Utility.md b/published/20150126 iptraf--A TCP or UDP Network Monitoring Utility.md similarity index 59% rename from translated/tech/20150126 iptraf--A TCP or UDP Network Monitoring Utility.md rename to published/20150126 iptraf--A TCP or UDP Network Monitoring Utility.md index 5f808b562a..31d432f445 100644 --- a/translated/tech/20150126 iptraf--A TCP or UDP Network Monitoring Utility.md +++ b/published/20150126 iptraf--A TCP or UDP Network Monitoring Utility.md @@ -1,32 +1,32 @@ iptraf:TCP/UDP网络监控工具 ================================================================================ -[iptraf][1]是一个基于ncurses的IP局域网监控工具,它可以生成各种网络统计数据,包括TCP信息、UDP统计、ICMP和OSPF信息、以太网负载信息、节点统计、IP校验和错误和其它一些信息。 +[iptraf][1]是一个基于ncurses开发的IP局域网监控工具,它可以生成各种网络统计数据,包括TCP信息、UDP统计、ICMP和OSPF信息、以太网负载信息、节点统计、IP校验和错误和其它一些信息。 -它基于ncurses的用户界面也会保存来自命令行切换记忆的用户。 +它基于ncurses的用户界面也会把使用者从命令行选项的梦靥中拯救出来。 ### 功能 ### -- 一个用于显示通过网络的IP流量信息的IP流量监控器,包括TCP标识信息、包河字节统计、ICMP详情、OSPF包类型 +- 一个用于显示通过网络的IP流量信息的IP流量监控器,包括TCP标识信息、包和字节统计、ICMP详情、OSPF包类型 - 显示IP、TCP、UDP、ICMP、非IP和其它IP包计数、IP校验和错误、接口活动、包大小计数的综合详细的接口统计数据 -- 一个用于显示流入和流出包常用TCP和UDP应用端口的TCP和UDP服务监控器 +- 一个用于计数常用TCP和UDP应用端口的流入和流出包的TCP和UDP服务监控器 - 一个用于发现活动主机和显示这些活动主机的数据活动的局域网统计模块 -- TCP、UDP和其它协议的显示过滤器,允许你查看你做感兴趣的通信 +- TCP、UDP和其它协议的显示过滤器,允许你查看你做感兴趣的流量 - 日志记录 - 支持以太网、FDDI、ISDN、SLIP、PPP和回环接口类型 - 利用Linux内核内建的原生套接口界面,可以用于大范围支持的网卡 - 全屏、菜单驱动操作 -要安装 +###要安装### -### Ubuntu及其衍生版 ### +**Ubuntu及其衍生版** sudo apt-get install iptraf -### Arch Linux及其衍生版 ### +**Arch Linux及其衍生版** sudo pacman -S iptra -### Fedora及其衍生版 ### +**Fedora及其衍生版** sudo yum install iptraf @@ -34,21 +34,21 @@ iptraf:TCP/UDP网络监控工具 如果**iptraf**命令不带任何命令行选项执行,该程序就会以交互模式显现,可以通过主菜单获得各种各样的工具。 -![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/iptraf_1.png) +![](http://1102047360.rsc.cdn77.org/wp-content/uploads/2015/01/iptraf_1.png) 易于导航的菜单。 -![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/iptraf_2.png) +![](http://1102047360.rsc.cdn77.org/wp-content/uploads/2015/01/iptraf_2.png) 选择监控的接口。 -![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/iptraf_3.png) +![](http://1102047360.rsc.cdn77.org/wp-content/uploads/2015/01/iptraf_3.png) -来自**ppp0**接口的通信 +来自**ppp0**接口的流量 -![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/iptraf_4.png) +![](http://1102047360.rsc.cdn77.org/wp-content/uploads/2015/01/iptraf_4.png) -好好乐一把吧! +希望你喜欢。 -------------------------------------------------------------------------------- @@ -56,7 +56,7 @@ via: http://www.unixmen.com/iptraf-tcpudp-network-monitoring-utility/ 作者:[Enock Seth Nyamador][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/) 荣誉推出 From 6a6ff44aeba7efce6daffb73745566ca1ee2aef6 Mon Sep 17 00:00:00 2001 From: wxy Date: Sat, 6 Jun 2015 09:29:08 +0800 Subject: [PATCH 274/965] PUB:20150416 Linux Network Statistics Tools or Commands @ictlyh --- ...0150416 Linux Network Statistics Tools or Commands.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) rename {translated/tech => published}/20150416 Linux Network Statistics Tools or Commands.md (98%) diff --git a/translated/tech/20150416 Linux Network Statistics Tools or Commands.md b/published/20150416 Linux Network Statistics Tools or Commands.md similarity index 98% rename from translated/tech/20150416 Linux Network Statistics Tools or Commands.md rename to published/20150416 Linux Network Statistics Tools or Commands.md index 1dcad55baf..e4ce5db81d 100644 --- a/translated/tech/20150416 Linux Network Statistics Tools or Commands.md +++ b/published/20150416 Linux Network Statistics Tools or Commands.md @@ -72,7 +72,7 @@ Linux网络统计工具/命令 查看[ss 命令教程][1] 获取更多信息。 -### netstat 命令 : 显示套接字信息的旧的好工具 ### +### netstat 命令 : 不错的显示套接字信息的旧工具 ### 查看所有网络端口以及汇总信息表,输入: @@ -268,6 +268,7 @@ Linux网络统计工具/命令 ### sar 命令: 显示网络统计信息 ### 输入以下命令 (你需要 [通过sysstat包安装并启用sar][3]): + sar -n DEV Linux 2.6.32-220.2.1.el6.x86_64 (www.cyberciti.biz) Tuesday 13 March 2012 _x86_64_ (2 CPU) @@ -345,11 +346,11 @@ via: http://www.cyberciti.biz/faq/network-statistics-tools-rhel-centos-debian-li 作者:[nixCraft][a] 译者:[ictlyh](https://github.com/ictlyh) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 [a]:http://www.cyberciti.biz/tips/about-us -[1]:http://www.cyberciti.biz/tips/linux-investigate-sockets-network-connections.html -[2]:http://www.cyberciti.biz/tips/netstat-command-tutorial-examples.html +[1]:https://linux.cn/article-4372-1.html +[2]:https://linux.cn/article-2434-1.html [3]:http://www.cyberciti.biz/tips/identifying-linux-bottlenecks-sar-graphs-with-ksar.html \ No newline at end of file From 33f4509c815b9cbc90f6a8d82333c6a48b5c888e Mon Sep 17 00:00:00 2001 From: wxy Date: Sat, 6 Jun 2015 09:57:57 +0800 Subject: [PATCH 275/965] PUB:20150423 20 Awesome Docker Containers for a Desktop User @goreliu --- ...me Docker Containers for a Desktop User.md | 36 ++++++++++--------- 1 file changed, 19 insertions(+), 17 deletions(-) rename {translated/tech => published}/20150423 20 Awesome Docker Containers for a Desktop User.md (68%) diff --git a/translated/tech/20150423 20 Awesome Docker Containers for a Desktop User.md b/published/20150423 20 Awesome Docker Containers for a Desktop User.md similarity index 68% rename from translated/tech/20150423 20 Awesome Docker Containers for a Desktop User.md rename to published/20150423 20 Awesome Docker Containers for a Desktop User.md index 055c1eb9b5..a0ef45f433 100644 --- a/translated/tech/20150423 20 Awesome Docker Containers for a Desktop User.md +++ b/published/20150423 20 Awesome Docker Containers for a Desktop User.md @@ -1,12 +1,13 @@ -20个为桌面用户准备的令人惊叹的Docker容器 +20个令人惊叹的桌面Docker容器 ================================================================================ -大家好,今天我们会列出一些很棒的运行在Docker容器中的桌面软件,我们可以在自己的桌面系统中运行它们。Docker是一个开源的项目,它提供可以将应用程序作为一个轻量级容器来打包、传送和运行的开放平台。它没有语言支持、框架或打包系统的限制,可以运行在任何地方,从小型的家用电脑到高端的服务器。它可以使部署和扩展web应用程序、数据库和后端服务像搭积木一样容易,而不依赖特定技术栈或提供商。它主要是由开发、运维工程师使用的,因为它简单、快速和方便,可以用来测试和辅助开发他们产品,但是我们也可以在桌面环境使用Docker,这样一些桌面程序可以开箱即用。 + +大家好,今天我们会列出一些运行在Docker容器中的很棒的桌面软件,我们可以在自己的桌面系统中运行它们。Docker 是一个开源项目,提供了一个可以打包、装载和运行任何应用的轻量级容器的开放平台。它没有语言支持、框架和打包系统的限制,从小型的家用电脑到高端服务器,在何时何地都可以运行。它可以使部署和扩展web应用程序、数据库和后端服务像搭积木一样容易,而不依赖特定技术栈或提供商。它主要是由开发、运维工程师使用的,因为它简单、快速和方便,可以用来测试和辅助开发他们产品,但是我们也可以在桌面环境使用Docker,这样一些桌面程序可以开箱即用。 下边是20个非常棒的桌面软件docker镜像,我们可以使用Docker来运行。 ### 1. Lynx ### -Lynx是一个一直以来最受欢迎的文本界面网页浏览器,它对多数Linux用户来说都很熟悉。它应该是现在还在日常和开发环境中被使用的最古老的网页浏览器了。可以使用如下命令运行Lync。 +Lynx是一个一直以来最受欢迎的文本界面网页浏览器,很多Linux用户都很熟悉它。它应该是现在还在日常和开发环境中被使用的最古老的网页浏览器了。可以使用如下命令运行Lync。 $ docker run -it \ --name lynx \ @@ -39,7 +40,7 @@ Chrome是一个令人惊叹的图形界面网页浏览器,由Google开发, ### 4. Tor浏览器 ### -Tor浏览器是一个支持匿名访问的网页浏览器。它让我们可以自由地在网络世界遨游,或者浏览被特定组织或者网络服务提供商封锁的网站。它会阻止有人通过监视我们的网络连接来窃取我们在网络上的一举一动以及我们的确切位置。运行如下命令运行Tor浏览器。 +Tor浏览器是一个支持匿名访问的网页浏览器。它让我们可以自由地在网络世界遨游,或者浏览被特定组织或者网络服务提供商封锁的网站。它会阻止别人通过监视我们的网络连接来窃取我们在网络上的一举一动以及我们的确切位置。运行如下命令运行Tor浏览器。 $ docker run -it \ -v /tmp/.X11-unix:/tmp/.X11-unix \ @@ -50,7 +51,7 @@ Tor浏览器是一个支持匿名访问的网页浏览器。它让我们可以 ### 5. Firefox浏览器 ### -Firefox浏览器是一个自由并且开源的网页浏览器,它由Mozilla基金会开发。它使用Gecko和SpiderMonkey引擎。Firefox浏览器有很多新特性,并且它以性能和安全性著称。 +Firefox浏览器是一个自由开源的网页浏览器,它由Mozilla基金会开发。它使用Gecko和SpiderMonkey引擎。Firefox浏览器有很多新特性,并且它以性能和安全性著称。 $ docker run -d \ --name firefox \ @@ -71,12 +72,12 @@ Rainbow Stream是一个文本界面的Twitter客户端,有实时显示tweetstr ### 7. Gparted ### -Gparted是一个用来给磁盘分区的开源软件。现在可以在Docker容器里享受分区的乐趣。可以使用如下命令运行gparted。 +Gparted是一个用来给磁盘分区的开源软件。现在可以在Docker容器里享受分区的乐趣了。可以使用如下命令运行gparted。 $ docker run -it \ -v /tmp/.X11-unix:/tmp/.X11-unix \ -e DISPLAY=unix$DISPLAY \ - --device /dev/sda:/dev/sda \ # mount the device to partition + --device /dev/sda:/dev/sda \ # 将设备挂载为分区 --name gparted \ jess/gparted @@ -91,7 +92,7 @@ GIMP(Gnu Image Manipulation Program)是一个令人惊叹的Linux图片编 ### 9. Thunderbird ### -Thunderbird是一个自由并且开源的电子邮件软件,它由Mozilla基金会开发和维护。它有众多一个电子邮件软件应该具有的功能。Thunderbird非常易于安装和定制。使用如下命令在Docker中运行Thunderbird。 +Thunderbird是一个自由开源的电子邮件软件,它由Mozilla基金会开发和维护。它有众多一个电子邮件软件应该具有的功能。Thunderbird非常易于安装和定制。使用如下命令在Docker中运行Thunderbird。 $ docker run -d \ -e DISPLAY \ @@ -102,7 +103,7 @@ Thunderbird是一个自由并且开源的电子邮件软件,它由Mozilla基 ### 10. Mutt ### -Mutt是一个文本界面的电子邮件客户端,有很多很酷的功能,如颜色支持,IMAP、POP3、SMTP支持,邮件存储支持等。 使用如下命令运行Mutt。 +Mutt是一个文本界面的电子邮件客户端,有很多很酷的功能,如彩色支持,IMAP、POP3、SMTP支持,邮件存储支持等。 使用如下命令运行Mutt。 $ docker run -it \ -v /etc/localtime:/etc/localtime \ @@ -114,7 +115,7 @@ Mutt是一个文本界面的电子邮件客户端,有很多很酷的功能, ### 11. Skype ### -Skype是一个支持文字、语音和视频的即时通讯软件,它不是开源的,但在Linux下可以很棒地运行。我们同样可以在Docker中运行Skype,使用如下命令。 +Skype是一个支持文字、语音和视频的即时通讯软件,它不是开源的,但在Linux下可以运行的很好。我们同样可以在Docker中运行Skype,使用如下命令。 $ docker run -it \ -v /tmp/.X11-unix:/tmp/.X11-unix:ro \ @@ -124,7 +125,7 @@ Skype是一个支持文字、语音和视频的即时通讯软件,它不是开 ### 12. Cathode ### -Cathode是一个漂亮并且高度可定制的终端模拟器,灵感来自经典的计算机。使用如下命令运行Cathode。 +Cathode是一个漂亮并且高度可定制的终端模拟器,灵感来自古典计算机。使用如下命令运行Cathode。 $ docker run -it \ -v /tmp/.X11-unix:/tmp/.X11-unix \ @@ -134,7 +135,8 @@ Cathode是一个漂亮并且高度可定制的终端模拟器,灵感来自经 ### 13. LibreOffice ### -LibreOffice是一个功能强大的办公套件,它是自由和开源的,现在由The Document基金会维护。它有干净的界面和强大的功能,让我们释放创造力和提升生产力。LibreOffice将数个应用程序集成在一起,是市面上最强大的自由并且开源的办公套件。 +LibreOffice是一个功能强大的办公套件,它是自由开源的,现在由The Document基金会维护。它有干净的界面和强大的功能,让我们释放创造力和提升生产力。LibreOffice将数个应用程序集成在一起,是市面上最强大的自由并且开源的办公套件。 + $docker run \ -v $HOME/Documents:/home/libreoffice/Documents:rw \ -v /tmp/.X11-unix:/tmp/.X11-unix \ @@ -155,7 +157,7 @@ Spotify可以即时访问数百万的歌曲,从经典老歌到最新单曲。 ### 15. Audacity ### -Audacity是一个自由并且开源的跨平台软件,用来录制和编辑音频。Audacity可以用来做所有类型音频(例如podcast)的后期处理,如归一化、调整、淡入淡出。使用如下命令来运行Audacity。 +Audacity是一个自由开源的跨平台软件,用来录制和编辑音频。Audacity可以用来做所有类型音频(例如podcast)的后期处理,如归一化、调整、淡入淡出。使用如下命令来运行Audacity。 $ docker run --rm \ -u $(id -u):$(id -g) \ @@ -178,7 +180,7 @@ Eclipse是一个集成开发环境。它包含基本的工作区和用来定制 ### 17. VLC媒体播放器 ### -VLC是一个自由并且开源的跨平台多媒体播放器,可以播放本地文件、DVD、CD、VCD和各种流媒体。VLC由VideoLAN组织开发和维护。使用如下命令运行VLC。 +VLC是一个自由开源的跨平台多媒体播放器,可以播放本地文件、DVD、CD、VCD和各种流媒体。VLC由VideoLAN组织开发和维护。使用如下命令运行VLC。 $ docker run -v\ $HOME/Documents:/home/vlc/Documents:rw \ @@ -196,7 +198,7 @@ Vim是一个高度可配置的文本界面文字编辑器,为高效的文本 ### 19. Inkscape ### -Inkscape是一个自由并且开源的矢量图形编辑器。它可以创建、编辑矢量图形,如插图、图示、线条艺术、图表、徽标以及更复杂的绘画。Inkscape使用的主要矢量图形格式是SVG 1.1版本。它也可以导入和导出一些其他的格式,但实际编辑使用的还是SVG格式。 +Inkscape是一个自由开源的矢量图形编辑器。它可以创建、编辑矢量图形,如插图、图示、线条艺术、图表、徽标以及更复杂的绘画。Inkscape使用的主要矢量图形格式是SVG 1.1版本。它也可以导入和导出一些其他的格式,但实际编辑使用的还是SVG格式。 $docker build -t rasch/inkscape --rm . $ docker run --rm -e DISPLAY \ @@ -207,7 +209,7 @@ Inkscape是一个自由并且开源的矢量图形编辑器。它可以创建、 ### 20. Filezilla ### -Filezilla是一个自由的FTP解决方案,支持FTP、SFTP、FTPS协议。它的客户端是一个功能强大的文件管理工具。它是一个很棒的高度可靠和易用的开源FTP解决方案。 +Filezilla是一个免费的FTP解决方案,支持FTP、SFTP、FTPS协议。它的客户端是一个功能强大的文件管理工具。它是一个很棒的高度可靠和易用的开源FTP解决方案。 $ xhost +si:localuser:$(whoami) $ docker run \ @@ -229,7 +231,7 @@ via: http://linoxide.com/how-tos/20-docker-containers-desktop-user/ 作者:[Arun Pyasi][a] 译者:[goreliu](https://github.com/goreliu) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 From 677195d81f47839d63f372ccee9331b4a675b81b Mon Sep 17 00:00:00 2001 From: wi-cuckoo Date: Sat, 6 Jun 2015 09:58:44 +0800 Subject: [PATCH 276/965] translating wi-cuckoo --- .../20150604 12 Globally Recognized Linux Certifications.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/share/20150604 12 Globally Recognized Linux Certifications.md b/sources/share/20150604 12 Globally Recognized Linux Certifications.md index 714ff31fea..4ec185770b 100644 --- a/sources/share/20150604 12 Globally Recognized Linux Certifications.md +++ b/sources/share/20150604 12 Globally Recognized Linux Certifications.md @@ -1,3 +1,4 @@ +translating wi-cuckoo 12 Globally Recognized Linux Certifications ================================================================================ Hi everyone, today we'll learn about some of the very precious globally recognized Linux Certifications. Linux Certifications are the certification programme hosted by different Linux Professional Institutes across the globe. Linux Certifications allows Linux Professionals to get easily enrolled with the Linux related jobs in servers, companies, etc. Linux Certifications enables how much a person is expertise in that respective field of Linux. There are pretty many Linux Professional Institutes providing different Linux Certifications. But there are some few well recognized Linux Certification Programmes running across the globe which are at high priority while getting a job in companies where we need to manage servers, virtualizations, installations, configurations, application support and other stuffs with Linux Operating System. With the increment of servers running Linux Operating System throughout the globe, the demand of Linux Professional are increasing. For better authenticated and authorized Linux Professional, better and renowned Certifications are always at higher priority by the companies across the globe. @@ -169,4 +170,4 @@ via: http://linoxide.com/linux-how-to/12-globally-recognized-linux-certification 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 -[a]:http://linoxide.com/author/arunp/ \ No newline at end of file +[a]:http://linoxide.com/author/arunp/ From 9b880e94b4244b36730a1c602ce1e98b6c62d06c Mon Sep 17 00:00:00 2001 From: wwy-hust Date: Sat, 6 Jun 2015 10:19:27 +0800 Subject: [PATCH 277/965] finish translation --- ...ng Mod_Security and Mod_evasive Modules.md | 272 ------------------ ...ng Mod_Security and Mod_evasive Modules.md | 271 +++++++++++++++++ 2 files changed, 271 insertions(+), 272 deletions(-) delete mode 100644 sources/tech/20150211 Protect Apache Against Brute Force or DDoS Attacks Using Mod_Security and Mod_evasive Modules.md create mode 100644 translated/tech/20150211 Protect Apache Against Brute Force or DDoS Attacks Using Mod_Security and Mod_evasive Modules.md diff --git a/sources/tech/20150211 Protect Apache Against Brute Force or DDoS Attacks Using Mod_Security and Mod_evasive Modules.md b/sources/tech/20150211 Protect Apache Against Brute Force or DDoS Attacks Using Mod_Security and Mod_evasive Modules.md deleted file mode 100644 index 325aad1068..0000000000 --- a/sources/tech/20150211 Protect Apache Against Brute Force or DDoS Attacks Using Mod_Security and Mod_evasive Modules.md +++ /dev/null @@ -1,272 +0,0 @@ -translating by wwy-hust - -Protect Apache Against Brute Force or DDoS Attacks Using Mod_Security and Mod_evasive Modules -================================================================================ -For those of you in the hosting business, or if you’re hosting your own servers and exposing them to the Internet, securing your systems against attackers must be a high priority. - -mod_security (an open source intrusion detection and prevention engine for web applications that integrates seamlessly with the web server) and mod_evasive are two very important tools that can be used to protect a web server against brute force or (D)DoS attacks. - -mod_evasive, as its name suggests, provides evasive capabilities while under attack, acting as an umbrella that shields web servers from such threats. - -![](http://www.tecmint.com/wp-content/uploads/2012/06/Install-Mod_Security-Mod_evasive-in-CentOS.jpg) -Install Mod_Security and Mod_Evasive to Protect Apache - -In this article we will discuss how to install, configure, and put them into play along with Apache on RHEL/CentOS 6 and 7 as well as Fedora 21-15. In addition, we will simulate attacks in order to verify that the server reacts accordingly. - -This assumes that you have a LAMP server installed on your system. If not, please check this article before proceeding further. - -- [Install LAMP stack in RHEL/CentOS 7][1] - -You will also need to setup iptables as the default [firewall][2] front-end instead of firewalld if you’re running RHEL/CentOS 7 or Fedora 21. We do this in order to use the same tool in both RHEL/CentOS 7/6 and Fedora 21. - -### Step 1: Installing Iptables Firewall on RHEL/CentOS 7 and Fedora 21 ### - -To begin, stop and disable firewalld: - - # systemctl stop firewalld - # systemctl disable firewalld - -![](http://www.tecmint.com/wp-content/uploads/2012/06/Disable-Firewalld-Service.png) -Disable Firewalld Service - -Then install the iptables-services package before enabling iptables: - - # yum update && yum install iptables-services - # systemctl enable iptables - # systemctl start iptables - # systemctl status iptables - -![](http://www.tecmint.com/wp-content/uploads/2012/06/Install-Iptables-Firewall.png) -Install Iptables Firewall - -### Step 2: Installing Mod_Security and Mod_evasive ### - -In addition to having a LAMP setup already in place, you will also have to [enable the EPEL repository][3] in RHEL/CentOS 7/6 in order to install both packages. Fedora users don’t need to enable any repo, because epel is a already part of Fedora project. - - # yum update && yum install mod_security mod_evasive - -When the installation is complete, you will find the configuration files for both tools in /etc/httpd/conf.d. - - # ls -l /etc/httpd/conf.d - -![](http://www.tecmint.com/wp-content/uploads/2012/06/mod_security-mod_evasive-Configurations.png) -mod_security + mod_evasive Configurations - -Now, in order to integrate these two modules with Apache and have it load them when it starts, make sure the following lines appear in the top level section of mod_evasive.conf and mod_security.conf, respectively: - - LoadModule evasive20_module modules/mod_evasive24.so - LoadModule security2_module modules/mod_security2.so - -Note that modules/mod_security2.so and modules/mod_evasive24.so are the relative paths, from the /etc/httpd directory to the source file of the module. You can verify this (and change it, if needed) by listing the contents of the /etc/httpd/modules directory: - - # cd /etc/httpd/modules - # pwd - # ls -l | grep -Ei '(evasive|security)' - -![](http://www.tecmint.com/wp-content/uploads/2012/06/Verify-mod_security-mod_evasive-Modules.png) -Verify mod_security + mod_evasive Modules - -Then restart Apache and verify that it loads mod_evasive and mod_security: - - # service httpd restart [On RHEL/CentOS 6 and Fedora 20-18] - # systemctl restart httpd [On RHEL/CentOS 7 and Fedora 21] - ----------- - - [Dump a list of loaded Static and Shared Modules] - - # httpd -M | grep -Ei '(evasive|security)' - -![](http://www.tecmint.com/wp-content/uploads/2012/06/Check-mod_security-mod_evasive-Loaded.png) -Check mod_security + mod_evasive Modules Loaded - -### Step 3: Installing A Core Rule Set and Configuring Mod_Security ### - -In few words, a Core Rule Set (aka CRS) provides the web server with instructions on how to behave under certain conditions. The developer firm of mod_security provide a free CRS called OWASP ([Open Web Application Security Project][4]) ModSecurity CRS that can be downloaded and installed as follows. - -1. Download the OWASP CRS to a directory created for that purpose. - - # mkdir /etc/httpd/crs-tecmint - # cd /etc/httpd/crs-tecmint - # wget https://github.com/SpiderLabs/owasp-modsecurity-crs/tarball/master - -![](http://www.tecmint.com/wp-content/uploads/2012/06/Download-mod_security-Core-Rules.png) -Download mod_security Core Rules - -2. Untar the CRS file and change the name of the directory for one of our convenience. - - # tar xzf master - # mv SpiderLabs-owasp-modsecurity-crs-ebe8790 owasp-modsecurity-crs - -![](http://www.tecmint.com/wp-content/uploads/2012/06/Extract-mod_security-Core-Rules.png) -Extract mod_security Core Rules - -3. Now it’s time to configure mod_security. Copy the sample file with rules (owasp-modsecurity-crs/modsecurity_crs_10_setup.conf.example) into another file without the .example extension: - - # cp modsecurity_crs_10_setup.conf.example modsecurity_crs_10_setup.conf - -and tell Apache to use this file along with the module by inserting the following lines in the web server’s main configuration file /etc/httpd/conf/httpd.conf file. If you chose to unpack the tarball in another directory you will need to edit the paths following the Include directives: - - - Include crs-tecmint/owasp-modsecurity-crs/modsecurity_crs_10_setup.conf - Include crs-tecmint/owasp-modsecurity-crs/base_rules/*.conf - - -Finally, it is recommended that we create our own configuration file within the /etc/httpd/modsecurity.d directory where we will place our customized directives (we will name it tecmint.conf in the following example) instead of modifying the CRS files directly. Doing so will allow for easier upgrading the CRSs as new versions are released. - - - SecRuleEngine On - SecRequestBodyAccess On - SecResponseBodyAccess On - SecResponseBodyMimeType text/plain text/html text/xml application/octet-stream - SecDataDir /tmp - - -You can refer to the [SpiderLabs’ ModSecurity GitHub][5] repository for a complete explanatory guide of mod_security configuration directives. - -### Step 4: Configuring Mod_Evasive ### - -mod_evasive is configured using directives in /etc/httpd/conf.d/mod_evasive.conf. Since there are no rules to update during a package upgrade, we don’t need a separate file to add customized directives, as opposed to mod_security. - -The default mod_evasive.conf file has the following directives enabled (note that this file is heavily commented, so we have stripped out the comments to highlight the configuration directives below): - - - DOSHashTableSize 3097 - DOSPageCount 2 - DOSSiteCount 50 - DOSPageInterval 1 - DOSSiteInterval 1 - DOSBlockingPeriod 10 - - -Explanation of the directives: - -- DOSHashTableSize: This directive specifies the size of the hash table that is used to keep track of activity on a per-IP address basis. Increasing this number will provide a faster look up of the sites that the client has visited in the past, but may impact overall performance if it is set too high. -- DOSPageCount: Legitimate number of identical requests to a specific URI (for example, any file that is being served by Apache) that can be made by a visitor over the DOSPageInterval interval. -- DOSSiteCount: Similar to DOSPageCount, but refers to how many overall requests can be made to the entire site over the DOSSiteInterval interval. -- DOSBlockingPeriod: If a visitor exceeds the limits set by DOSSPageCount or DOSSiteCount, his source IP address will be blacklisted during the DOSBlockingPeriod amount of time. During DOSBlockingPeriod, any requests coming from that IP address will encounter a 403 Forbidden error. - -Feel free to experiment with these values so that your web server will be able to handle the required amount and type of traffic. - -**Only a small caveat**: if these values are not set properly, you run the risk of ending up blocking legitimate visitors. - -You may also want to consider other useful directives: - -#### DOSEmailNotify #### - -If you have a mail server up and running, you can send out warning messages via Apache. Note that you will need to grant the apache user SELinux permission to send emails if SELinux is set to enforcing. You can do so by running - - # setsebool -P httpd_can_sendmail 1 - -Next, add this directive in the mod_evasive.conf file with the rest of the other directives: - - DOSEmailNotify you@yourdomain.com - -If this value is set and your mail server is working properly, an email will be sent to the address specified whenever an IP address becomes blacklisted. - -#### DOSSystemCommand #### - -This needs a valid system command as argument, - - DOSSystemCommand
- -This directive specifies a command to be executed whenever an IP address becomes blacklisted. It is often used in conjunction with a shell script that adds a firewall rule to block further connections coming from that IP address. - -**Write a shell script that handles IP blacklisting at the firewall level** - -When an IP address becomes blacklisted, we need to block future connections coming from it. We will use the following shell script that performs this job. Create a directory named scripts-tecmint (or whatever name of your choice) in /usr/local/bin and a file called ban_ip.sh in that directory. - - #!/bin/sh - # IP that will be blocked, as detected by mod_evasive - IP=$1 - # Full path to iptables - IPTABLES="/sbin/iptables" - # mod_evasive lock directory - MOD_EVASIVE_LOGDIR=/var/log/mod_evasive - # Add the following firewall rule (block all traffic coming from $IP) - $IPTABLES -I INPUT -s $IP -j DROP - # Remove lock file for future checks - rm -f "$MOD_EVASIVE_LOGDIR"/dos-"$IP" - -Our DOSSystemCommand directive should read as follows: - - DOSSystemCommand "sudo /usr/local/bin/scripts-tecmint/ban_ip.sh %s" - -In the line above, %s represents the offending IP as detected by mod_evasive. - -**Add the apache user to the sudoers file** - -Note that all of this just won’t work unless you to give permissions to user apache to run our script (and that script only!) without a terminal and password. As usual, you can just type visudo as root to access the /etc/sudoers file and then add the following 2 lines as shown in the image below: - - apache ALL=NOPASSWD: /usr/local/bin/scripts-tecmint/ban_ip.sh - Defaults:apache !requiretty - -![](http://www.tecmint.com/wp-content/uploads/2012/06/Add-Apache-User-to-Sudoers.png) -Add Apache User to Sudoers - -**IMPORTANT**: As a default security policy, you can only run sudo in a terminal. Since in this case we need to use sudo without a tty, we have to comment out the line that is highlighted in the following image: - - #Defaults requiretty - -![](http://www.tecmint.com/wp-content/uploads/2012/06/Disable-tty-for-Sudo.png) -Disable tty for Sudo - -Finally, restart the web server: - - # service httpd restart [On RHEL/CentOS 6 and Fedora 20-18] - # systemctl restart httpd [On RHEL/CentOS 7 and Fedora 21] - -### Step 4: Simulating an DDoS Attacks on Apache ### - -There are several tools that you can use to simulate an external attack on your server. You can just google for “tools for simulating ddos attacks” to find several of them. - -Note that you, and only you, will be held responsible for the results of your simulation. Do not even think of launching a simulated attack to a server that you’re not hosting within your own network. - -Should you want to do the same with a VPS that is hosted by someone else, you need to appropriately warn your hosting provider or ask permission for such a traffic flood to go through their networks. Tecmint.com is not, by any means, responsible for your acts! - -In addition, launching a simulated DoS attack from only one host does not represent a real life attack. To simulate such, you would need to target your server from several clients at the same time. - -Our test environment is composed of a CentOS 7 server [IP 192.168.0.17] and a Windows host from which we will launch the attack [IP 192.168.0.103]: - -![](http://www.tecmint.com/wp-content/uploads/2012/06/Confirm-Host-IPAddress.png) -Confirm Host IPAddress - -Please play the video below and follow the steps outlined in the indicated order to simulate a simple DoS attack: - -注:youtube视频,发布的时候不行做个链接吧 - - -Then the offending IP is blocked by iptables: - -![](http://www.tecmint.com/wp-content/uploads/2012/06/Blocked-Attacker-IP.png) -Blocked Attacker IP - -### Conclusion ### - -With mod_security and mod_evasive enabled, the simulated attack causes the CPU and RAM to experiment a temporary usage peak for only a couple of seconds before the source IPs are blacklisted and blocked by the firewall. Without these tools, the simulation will surely knock down the server very fast and render it unusable during the duration of the attack. - -We would love to hear if you’re planning on using (or have used in the past) these tools. We always look forward to hearing from you, so don’t hesitate to leave your comments and questions, if any, using the form below. - -### Reference Links ### - -- [https://www.modsecurity.org/][6] -- [http://www.zdziarski.com/blog/?page_id=442][7] - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/protect-apache-using-mod_security-and-mod_evasive-on-rhel-centos-fedora/ - -作者:[Gabriel Cánepa][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://www.tecmint.com/author/gacanepa/ -[1]:http://www.tecmint.com/install-lamp-in-centos-7/ -[2]:http://www.tecmint.com/configure-firewalld-in-centos-7/ -[3]:http://www.tecmint.com/how-to-enable-epel-repository-for-rhel-centos-6-5/ -[4]:https://www.owasp.org/index.php/Category:OWASP_ModSecurity_Core_Rule_Set_Project -[5]:https://github.com/SpiderLabs/ModSecurity/wiki/Reference-Manual#Configuration_Directives -[6]:https://www.modsecurity.org/ -[7]:http://www.zdziarski.com/blog/?page_id=442 diff --git a/translated/tech/20150211 Protect Apache Against Brute Force or DDoS Attacks Using Mod_Security and Mod_evasive Modules.md b/translated/tech/20150211 Protect Apache Against Brute Force or DDoS Attacks Using Mod_Security and Mod_evasive Modules.md new file mode 100644 index 0000000000..1f645595b7 --- /dev/null +++ b/translated/tech/20150211 Protect Apache Against Brute Force or DDoS Attacks Using Mod_Security and Mod_evasive Modules.md @@ -0,0 +1,271 @@ +在Apache中使用Mod_Security和Mod_evasive来抵御暴力破解和DDos攻击 +================================================================================ +对于那些托管主机或者需要将您的主机暴露在因特网中的人来说,保证您的系统在面对攻击时安全是一个重要的事情。 + +mod_security(一个开源的可以无缝接入Web服务器的用于Web应用入侵检测和防护的引擎)和mod_evasive是两个在服务器端对抗暴力破解和(D)Dos攻击的非常重要的工具。 + +mod_evasive,如它的名字一样,在受攻击时提供避实就虚的功能,它像一个雨伞一样保护Web服务器免受那些威胁。 + +![](http://www.tecmint.com/wp-content/uploads/2012/06/Install-Mod_Security-Mod_evasive-in-CentOS.jpg) + +安装Mod_Security和Mod_Evasive来保护Apache + +在这篇文章中我们将讨论如何安装、配置以及在RHEL/CentOS6、7和Fedora 21-15上将它们整合到Apache。另外,我们会模拟攻击以便验证服务器做出了正确的反应。 + +以上以您的系统中安装有LAMP服务器为基础,所以,如果您没有安装,请先阅读下面链接的文章再开始阅读本文。 + +- [在RHEL/CentOS 7中安装LAMP][1] + +如果您在运行RHEL/CentOS 7或Fedora 21,您还需要安装iptables作为默认[防火墙][2]前端以取代firewalld。这样做是为了在RHEL/CentOS 7或Fedora 21中使用同样的工具。 + +### 步骤 1: 在RHEL/CentOS 7和Fedora 21上安装Iptables防火墙 ### + +用下面的命令停止和禁用firewalld: + + # systemctl stop firewalld + # systemctl disable firewalld + +![](http://www.tecmint.com/wp-content/uploads/2012/06/Disable-Firewalld-Service.png) +禁用firewalld服务 + +接下来在使能iptables之前安装iptables-services包: + + # yum update && yum install iptables-services + # systemctl enable iptables + # systemctl start iptables + # systemctl status iptables + +![](http://www.tecmint.com/wp-content/uploads/2012/06/Install-Iptables-Firewall.png) +安装Iptables防火墙 + +### 步骤 2: 安装Mod_Security和Mod_evasive ### + +另外,在安装LAMP后,您还需要在RHEL/CentOS 7/6中[开启EPEL仓库][3]来安装这两个包。Fedora用户不需要开启这个仓库,因为epel已经是Fedora项目的一部分了。 + + # yum update && yum install mod_security mod_evasive + +当安装结束后,您会在/etc/httpd/conf.d下找到两个工具的配置文件。 + + # ls -l /etc/httpd/conf.d + +![](http://www.tecmint.com/wp-content/uploads/2012/06/mod_security-mod_evasive-Configurations.png) +mod_security + mod_evasive 配置文件 + +现在,为了整合这两个模块到Apache,并在启动时加载它们。请确保下面几行出现在mod_evasive.conf和mod_security.conf的顶层部分,它们分别为: + + LoadModule evasive20_module modules/mod_evasive24.so + LoadModule security2_module modules/mod_security2.so + +请注意modules/mod_security2.so和modules/mod_evasive24.so都是从/etc/httpd到模块源文件的相对路径。您可以通过列出/etc/httpd/modules的内容来验证(如果需要的话,修改它): + + # cd /etc/httpd/modules + # pwd + # ls -l | grep -Ei '(evasive|security)' + +![](http://www.tecmint.com/wp-content/uploads/2012/06/Verify-mod_security-mod_evasive-Modules.png) +验证mod_security + mod_evasive模块 + +接下来重启Apache并且核实它已加载了mod_evasive和mod_security: + + # service httpd restart [在RHEL/CentOS 6和Fedora 20-18上] + # systemctl restart httpd [在RHEL/CentOS 7和Fedora 21上] + +---------- + + [输出已加载的静态模块和动态模块列表] + + # httpd -M | grep -Ei '(evasive|security)' + +![](http://www.tecmint.com/wp-content/uploads/2012/06/Check-mod_security-mod_evasive-Loaded.png) +检查mod_security + mod_evasive模块已加载 + +### 步骤 3: 安装一个核心规则集并且配置Mod_Security ### + +简单来说,一个核心规则集(即CRS)为web服务器提供特定状况下如何反应的指令。mod_security的开发者们提供了一个免费的CRS,叫做OWASP([开放Web应用安全项目])ModSecurity CRS,可以从下面的地址下载和安装。 + +1. 下载OWASP CRS到为之创建的目录 + + # mkdir /etc/httpd/crs-tecmint + # cd /etc/httpd/crs-tecmint + # wget https://github.com/SpiderLabs/owasp-modsecurity-crs/tarball/master + +![](http://www.tecmint.com/wp-content/uploads/2012/06/Download-mod_security-Core-Rules.png) +下载mod_security核心规则 + +2. 解压CRS文件并修改文件夹名称 + + # tar xzf master + # mv SpiderLabs-owasp-modsecurity-crs-ebe8790 owasp-modsecurity-crs + +![](http://www.tecmint.com/wp-content/uploads/2012/06/Extract-mod_security-Core-Rules.png) +解压mod_security核心规则 + +3. 现在,是时候配置mod_security了。将同样的规则文件(owasp-modsecurity-crs/modsecurity_crs_10_setup.conf.example)拷贝至另一个没有.example扩展的文件。 + + # cp modsecurity_crs_10_setup.conf.example modsecurity_crs_10_setup.conf + +并通过将下面的几行插入到web服务器的主配置文件/etc/httpd/conf/httpd.conf来告诉Apache将这个文件和该模块放在一起使用。如果您选择解压打包文件到另一个文件夹,那么您需要修改Include的路径: + + + Include crs-tecmint/owasp-modsecurity-crs/modsecurity_crs_10_setup.conf + Include crs-tecmint/owasp-modsecurity-crs/base_rules/*.conf + + +最后,建议您在/etc/httpd/modsecurity.d目录下创建自己的配置文件,在那里我们可以用我们自定义的文件夹(接下来的示例中,我们会将其命名为tecmint.conf)而无需修改CRS文件的目录。这样做能够在CRSs发布新版本时更加容易的升级。 + + + SecRuleEngine On + SecRequestBodyAccess On + SecResponseBodyAccess On + SecResponseBodyMimeType text/plain text/html text/xml application/octet-stream + SecDataDir /tmp + + +您可以在[SpiderLabs的ModSecurity GitHub][5]仓库中参考关于mod_security目录的更完整的解释。 + +### 步骤 4: 配置Mod_Evasive ### + +mod_evasive被配置为使用/etc/httpd/conf.d/mod_evasive.conf中的指令。与mod_security不同,由于在包升级时没有规则来更新,因此我们不需要独立的文件来添加自定义指令。 + +默认的mod_evasive.conf开启了下列的目录(注意这个文件被详细的注释了,因此我们剔掉了注释以重点显示配置指令): + + + DOSHashTableSize 3097 + DOSPageCount 2 + DOSSiteCount 50 + DOSPageInterval 1 + DOSSiteInterval 1 + DOSBlockingPeriod 10 + + +这些指令的解释: + +- DOSHashTableSize: 这个指令指明了哈希表的大小,它用来追踪基于IP地址的活动。增加这个数字将使查询站点访问历史变得更快,但如果被设置的太高则会影响整体性能。 +- DOSPageCount: 在DOSPageInterval间隔内可由一个用户发起的面向特定的URI(例如,一个Apache托管的文件)的同一个请求的数量。 +- DOSSiteCount: 类似DOSPageCount,但涉及到整个站点总共有多少的请求可以在DOSSiteInterval间隔内被发起。 +- DOSBlockingPeriod: 如果一个用户超过了DOSSPageCount的限制或者DOSSiteCount,他的源IP地址将会在DOSBlockingPeriod期间内被加入黑名单。在DOSBlockingPeriod期间,任何从这个IP地址发起的请求将会遭遇一个403禁止错误。 + +尽可能的试验这些值,以使您的web服务器有能力处理特定大小的负载。 + +**一个小警告**: 如果这些值设置的不合适,则您会蒙受阻挡合法用户的风险。 + +您也许想考虑下其他有用的指令: + +#### DOSEmailNotify #### + +如果您运行有一个邮件服务器,您可以通过Apache发送警告消息。注意,如果SELinux已开启,您需要授权apache用户SELinux的权限来发送email。您可以通过下面的命令来授予权限: + + # setsebool -P httpd_can_sendmail 1 + +接下来,将这个指令和其他指令一起加入到mod_evasive.conf文件。 + + DOSEmailNotify you@yourdomain.com + +如果这个值被合适的设置并且您的邮件服务器在正常的运行,则当一个IP地址被加入黑名单时,会有一封邮件被发送到相应的地址。 + +#### DOSSystemCommand #### + +它需要一个有效的系统命令作为参数, + + DOSSystemCommand + +这个指令指定当一个IP地址被加入黑名单时执行的命令。它通常结合shell脚本来使用,在脚本中添加一条防火墙规则来阻挡某个IP进一步的连接。 + +**写一个shell脚本在防火墙阶段处理IP黑名单** + +当一个IP地址被加入黑名单,我们需要阻挡它进一步的连接。我们需要下面的shell脚本来执行这个任务。在/usr/local/bin下创建一个叫做scripts-tecmint的文件夹(或其他的名字),以及一个叫做ban_ip.sh的文件。 + + #!/bin/sh + # 由mod_evasive检测出,将被阻挡的IP地址 + IP=$1 + # iptables的完整路径 + IPTABLES="/sbin/iptables" + # mod_evasive锁文件夹 + MOD_EVASIVE_LOGDIR=/var/log/mod_evasive + # 添加下面的防火墙规则 (阻止所有从$IP流入的流量) + $IPTABLES -I INPUT -s $IP -j DROP + # 为了未来的检测,移除锁文件 + rm -f "$MOD_EVASIVE_LOGDIR"/dos-"$IP" + +我们的DOSSystemCommand指令应该是这样的: + + DOSSystemCommand "sudo /usr/local/bin/scripts-tecmint/ban_ip.sh %s" + +上面一行的%s代表了由mod_evasive检测到的攻击IP地址。 + +**将apache用户添加到sudoers文件** + +请注意,如果您不给予apache用户以无需终端和密码的方式运行我们脚本(关键就是这个脚本)的权限,则这一切都不起作用。通常,您只需要以root权限键入visudo来存取/etc/sudoers文件,接下来添加下面的两行即可: + + apache ALL=NOPASSWD: /usr/local/bin/scripts-tecmint/ban_ip.sh + Defaults:apache !requiretty + +![](http://www.tecmint.com/wp-content/uploads/2012/06/Add-Apache-User-to-Sudoers.png) +添加Apache用户到Sudoers + +**重要**: 作为默认的安全策略,您只能在终端中运行sudo。由于这个时候我们需要在没有tty的时候运行sudo,我们像下面图片中那样必须注释掉下面这一行: + + #Defaults requiretty + +![](http://www.tecmint.com/wp-content/uploads/2012/06/Disable-tty-for-Sudo.png) +为Sudo禁用tty + +最后,重启web服务器: + + # service httpd restart [在RHEL/CentOS 6和Fedora 20-18上] + # systemctl restart httpd [在RHEL/CentOS 7和Fedora 21上] + +### 步骤4: 在Apache上模拟DDos攻击 ### + +有许多工具可以在您的服务器上模拟外部的攻击。您可以google下“tools for simulating ddos attacks”来找一找相关的工具。 + +注意,您(也只有您)将负责您模拟所造成的结果。请不要考虑向不在您网络中的服务器发起模拟攻击。 + +假如您想对一个由别人托管的VPS做这些事情,您需要向您的托管商发送适当的警告或就那样的流量通过他们的网络获得允许。Tecmint.com不会为您的行为负责! + +另外,仅从一个主机发起一个Dos攻击的模拟无法代表真实的攻击。为了模拟真实的攻击,您需要使用许多客户端在同一时间将您的服务器作为目标。 + +我们的测试环境由一个CentOS 7服务器[IP 192.168.0.17]和一个Windows组成,在Windows[IP 192.168.0.103]上我们发起攻击: + +![](http://www.tecmint.com/wp-content/uploads/2012/06/Confirm-Host-IPAddress.png) +确认主机IP地址 + +请播放下面的视频,并跟从列出的步骤来模拟一个Dos攻击: + +注:youtube视频,发布的时候不行做个链接吧 + + +然后攻击者的IP将被iptables阻挡: + +![](http://www.tecmint.com/wp-content/uploads/2012/06/Blocked-Attacker-IP.png) +阻挡攻击者的IP地址 + +### 结论 ### + +在开启mod_security和mod_evasive的情况下,模拟攻击会导致CPU和RAM用量在源IP地址被加入黑名单之前出现短暂几秒的使用峰值。如果没有这些模块,模拟攻击绝对会很快将服务器击溃,并使服务器在攻击期间无法提供服务。 + +我们很高兴听见您打算使用(或已经使用过)这些工具。我们期望得到您的反馈,所以,请在留言处留下您的评价和问题,谢谢! + +### 参考链接 ### + +- [https://www.modsecurity.org/][6] +- [http://www.zdziarski.com/blog/?page_id=442][7] + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/protect-apache-using-mod_security-and-mod_evasive-on-rhel-centos-fedora/ + +作者:[Gabriel Cánepa][a] +译者:[wwy-hust](https://github.com/wwy-hust) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/gacanepa/ +[1]:http://www.tecmint.com/install-lamp-in-centos-7/ +[2]:http://www.tecmint.com/configure-firewalld-in-centos-7/ +[3]:http://www.tecmint.com/how-to-enable-epel-repository-for-rhel-centos-6-5/ +[4]:https://www.owasp.org/index.php/Category:OWASP_ModSecurity_Core_Rule_Set_Project +[5]:https://github.com/SpiderLabs/ModSecurity/wiki/Reference-Manual#Configuration_Directives +[6]:https://www.modsecurity.org/ +[7]:http://www.zdziarski.com/blog/?page_id=442 \ No newline at end of file From 00b8843d6fa2e2b70ba4c1ac0a4974cca4436a0d Mon Sep 17 00:00:00 2001 From: wwy Date: Sat, 6 Jun 2015 12:07:27 +0800 Subject: [PATCH 278/965] [Translating] 20141013 Compact Text Editors Great for Remote Editing and Much More.md --- ...mpact Text Editors Great for Remote Editing and Much More.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/share/20141013 Compact Text Editors Great for Remote Editing and Much More.md b/sources/share/20141013 Compact Text Editors Great for Remote Editing and Much More.md index 3cdb43d879..b54a7b158f 100644 --- a/sources/share/20141013 Compact Text Editors Great for Remote Editing and Much More.md +++ b/sources/share/20141013 Compact Text Editors Great for Remote Editing and Much More.md @@ -1,3 +1,5 @@ +translating by wwy-hust + Compact Text Editors Great for Remote Editing and Much More ================================================================================ A text editor is software used for editing plain text files. This type of software has many different uses including modifying configuration files, writing programming language source code, jotting down thoughts, or even making a grocery list. Given that editors can be used for such a diverse range of activities, it is worth spending the time finding an editor that best suites your preferences. From 6fb54dd45272ed4be32b43d94b87730f5b0cf3de Mon Sep 17 00:00:00 2001 From: geekpi Date: Sat, 6 Jun 2015 13:42:55 +0800 Subject: [PATCH 279/965] translating --- ...u's Juju Now Supports systemd and Google Cloud Platform.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/news/20150604 Ubuntu's Juju Now Supports systemd and Google Cloud Platform.md b/sources/news/20150604 Ubuntu's Juju Now Supports systemd and Google Cloud Platform.md index 6061e78c87..2a3e919291 100644 --- a/sources/news/20150604 Ubuntu's Juju Now Supports systemd and Google Cloud Platform.md +++ b/sources/news/20150604 Ubuntu's Juju Now Supports systemd and Google Cloud Platform.md @@ -1,3 +1,5 @@ +translating---geekpi + Ubuntu's Juju Now Supports systemd and Google Cloud Platform ================================================================================ > The Juju tool has been updated to version 1.23.3 @@ -26,4 +28,4 @@ via: http://linux.softpedia.com/blog/Ubuntu-s-Juju-Now-Supports-systemd-and-Goog [a]:http://news.softpedia.com/editors/browse/marius-nestor [1]:http://insights.ubuntu.com/2015/06/03/juju-support-for-google-cloud-platform/ -[2]:https://jujucharms.com/docs/devel/reference-release-notes \ No newline at end of file +[2]:https://jujucharms.com/docs/devel/reference-release-notes From 5336aba920399d91a1c9bae1b4a231c20e231061 Mon Sep 17 00:00:00 2001 From: geekpi Date: Sat, 6 Jun 2015 14:02:34 +0800 Subject: [PATCH 280/965] translated --- ...ports systemd and Google Cloud Platform.md | 31 ------------------- ...ports systemd and Google Cloud Platform.md | 29 +++++++++++++++++ 2 files changed, 29 insertions(+), 31 deletions(-) delete mode 100644 sources/news/20150604 Ubuntu's Juju Now Supports systemd and Google Cloud Platform.md create mode 100644 translated/news/20150604 Ubuntu's Juju Now Supports systemd and Google Cloud Platform.md diff --git a/sources/news/20150604 Ubuntu's Juju Now Supports systemd and Google Cloud Platform.md b/sources/news/20150604 Ubuntu's Juju Now Supports systemd and Google Cloud Platform.md deleted file mode 100644 index 2a3e919291..0000000000 --- a/sources/news/20150604 Ubuntu's Juju Now Supports systemd and Google Cloud Platform.md +++ /dev/null @@ -1,31 +0,0 @@ -translating---geekpi - -Ubuntu's Juju Now Supports systemd and Google Cloud Platform -================================================================================ -> The Juju tool has been updated to version 1.23.3 - -**Udi Nachmany, Director of Ubuntu Certified Public Cloud at Canonical, announced the release of a new version of Juju, an open-source, solution-driven orchestration tool for Ubuntu Linux.** - -According to the [announcement][1] and the official [release notes][2], Juju 1.23.3 is quite a major version that packs a lot of goodies for those of you who want to scale and manage environments on any cloud without too much hassle. - -Prominent features of Juju 1.23.3 include support for Google Compute Engine (GCE), support for the systemd init system, support for Ubuntu 15.04 (Vivid Vervet), new charm actions, as well as better proxy support for for restrictive networks. - -Additionally, the recently announced Juju release brings a new style restore, new messages, new blocks, and experimental support for Service Leader Elections, as well as addressable LXC containers and KVM instances on Ubuntu MAAS and AWS. - -"On a related note, if you’re using Google Cloud Platform you’ve probably taken a look at the sleek Cloud Launcher Google have released recently. And if you looked closely, you also noticed that you can now spin up your Ubuntu VMs using this very friendly UI," says Udi Nachmany. - -![](http://i1-news.softpedia-static.com/images/news2/Ubuntu-s-Juju-Now-Supports-systemd-and-Google-Cloud-Platform-483279-2.jpg) - --------------------------------------------------------------------------------- - -via: http://linux.softpedia.com/blog/Ubuntu-s-Juju-Now-Supports-systemd-and-Google-Cloud-Platform-483279.shtml - -作者:[Marius Nestor][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://news.softpedia.com/editors/browse/marius-nestor -[1]:http://insights.ubuntu.com/2015/06/03/juju-support-for-google-cloud-platform/ -[2]:https://jujucharms.com/docs/devel/reference-release-notes diff --git a/translated/news/20150604 Ubuntu's Juju Now Supports systemd and Google Cloud Platform.md b/translated/news/20150604 Ubuntu's Juju Now Supports systemd and Google Cloud Platform.md new file mode 100644 index 0000000000..4ff1fa23a0 --- /dev/null +++ b/translated/news/20150604 Ubuntu's Juju Now Supports systemd and Google Cloud Platform.md @@ -0,0 +1,29 @@ +Ubuntu下的Juju现在支持systemd和Google Cloud Platform了 +================================================================================ +> Juju已经更新到1.23.3了 + +**Cononical旗下的Ubuntu认证公共云总监,Udi Nachmany宣布了juju新版本的发布,一个开源的、解决方案驱动的Ubuntu下的协同工具。** + +根据[声明][1]和官方[发布公告][2],Juju 1.23.3是一个非常主流的版本,它打包了那些你想要在云上扩展和管理的包,而没有太多的麻烦。 + +Juju 1.23.3显著的功能是包含了对GCE的支持,支持systemd初始化系统,支持Ubuntu 15.04(Vivid Vervet),新的好玩的功能和对受限网络的支持。 + +另外,juju的发布带来了一个新的恢复、新的消息、新的块和实验性地支持Service Leader Elections,还有Ubuntu MAS和AWS上的可寻址的LXC和KVM。 + +Udi Nachmany说:“在一个相关告示中,如果你正在使用Google云平台,你可能已经注意到了Google最近发布了云启动器。如果你密切关注,你同样注意到你说可以使用这个非常友好的UI来启动你的Ubuntu虚拟机。” + +![](http://i1-news.softpedia-static.com/images/news2/Ubuntu-s-Juju-Now-Supports-systemd-and-Google-Cloud-Platform-483279-2.jpg) + +-------------------------------------------------------------------------------- + +via: http://linux.softpedia.com/blog/Ubuntu-s-Juju-Now-Supports-systemd-and-Google-Cloud-Platform-483279.shtml + +作者:[Marius Nestor][a] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://news.softpedia.com/editors/browse/marius-nestor +[1]:http://insights.ubuntu.com/2015/06/03/juju-support-for-google-cloud-platform/ +[2]:https://jujucharms.com/docs/devel/reference-release-notes From 3cdf627d6a096ddc3124e210a5c9e7200bdfb3ed Mon Sep 17 00:00:00 2001 From: geekpi Date: Sat, 6 Jun 2015 14:03:48 +0800 Subject: [PATCH 281/965] translating --- ...3 Installing Ruby on Rails using rbenv on Ubuntu 15.04.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150603 Installing Ruby on Rails using rbenv on Ubuntu 15.04.md b/sources/tech/20150603 Installing Ruby on Rails using rbenv on Ubuntu 15.04.md index a4c5f61104..b9944eeb74 100644 --- a/sources/tech/20150603 Installing Ruby on Rails using rbenv on Ubuntu 15.04.md +++ b/sources/tech/20150603 Installing Ruby on Rails using rbenv on Ubuntu 15.04.md @@ -1,3 +1,6 @@ +translating----geekpi + + Installing Ruby on Rails using rbenv on Ubuntu 15.04 ================================================================================ This article we will learn about how to Install Ruby on Rails with rbenv on Ubuntu 15.04. We choose Ubuntu as operating system because Ubuntu is one of Linux distribution that easy to use with a lots of package support and complete documentations , so I think this is the right choice. If you don't install the latest version Ubuntu yet, you can [download the ISO file][1] to start off. @@ -149,4 +152,4 @@ via: http://linoxide.com/ubuntu-how-to/installing-ruby-rails-using-rbenv-ubuntu- [a]:http://linoxide.com/author/obetp/ [1]:http://release.ubuntu.com/15.04 [2]:http://github.com -[3]:https://github.com/settings/ssh \ No newline at end of file +[3]:https://github.com/settings/ssh From 7648c679f9a42dfc46d95740e45078034cc32cb2 Mon Sep 17 00:00:00 2001 From: geekpi Date: Sat, 6 Jun 2015 14:40:10 +0800 Subject: [PATCH 282/965] translated --- ...by on Rails using rbenv on Ubuntu 15.04.md | 155 ------------------ ...by on Rails using rbenv on Ubuntu 15.04.md | 151 +++++++++++++++++ 2 files changed, 151 insertions(+), 155 deletions(-) delete mode 100644 sources/tech/20150603 Installing Ruby on Rails using rbenv on Ubuntu 15.04.md create mode 100644 translated/tech/20150603 Installing Ruby on Rails using rbenv on Ubuntu 15.04.md diff --git a/sources/tech/20150603 Installing Ruby on Rails using rbenv on Ubuntu 15.04.md b/sources/tech/20150603 Installing Ruby on Rails using rbenv on Ubuntu 15.04.md deleted file mode 100644 index b9944eeb74..0000000000 --- a/sources/tech/20150603 Installing Ruby on Rails using rbenv on Ubuntu 15.04.md +++ /dev/null @@ -1,155 +0,0 @@ -translating----geekpi - - -Installing Ruby on Rails using rbenv on Ubuntu 15.04 -================================================================================ -This article we will learn about how to Install Ruby on Rails with rbenv on Ubuntu 15.04. We choose Ubuntu as operating system because Ubuntu is one of Linux distribution that easy to use with a lots of package support and complete documentations , so I think this is the right choice. If you don't install the latest version Ubuntu yet, you can [download the ISO file][1] to start off. - -### Installing Ruby ### - -First thing we need to update ubuntu packages and install some dependencies for Ruby. - - sudo apt-get update - sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libffi-dev - -There are three methods to install Ruby such rbenv, rvm and from the source. Each have their own benefits, but these days many developers prefer to use rbenv installation method than rvm or from source. We will install the latest version of Ruby, version 2.2.2. - -Installing with rbenv is a simple two step process. First you install rbenv, and then ruby-build : - - cd - git clone git://github.com/sstephenson/rbenv.git .rbenv - echo 'eval "$(rbenv init -)"' >> ~/.bashrc - exec $SHELL - - git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build - echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.bashrc - exec $SHELL - - git clone https://github.com/sstephenson/rbenv-gem-rehash.git ~/.rbenv/plugins/rbenv-gem-rehash - - rbenv install 2.2.2 - rbenv global 2.2.2 - ruby -v - -We need to install Bundler but before that we tell Rubygems not to install the documentation for each package locally. - - echo "gem: --no-ri --no-rdoc" > ~/.gemrc - gem install bundler - -### Configuring GIT ### - -Before configuring GIT you have to create github account first, you can register [Git][2]. We need Git for our version control system so we are going to set it up to match our Github account. - -Replace **Name** and **Email address** in the following steps with the ones you used for your Github account. - - git config --global color.ui true - git config --global user.name "YOUR NAME" - git config --global user.email "YOUR@EMAIL.com" - ssh-keygen -t rsa -C "YOUR@EMAIL.com" - -After that take the newly generated SSH key and add it to your Github account. And then you need to copy and paste the output of the following command and [paste it here][3]. - - cat ~/.ssh/id_rsa.pub - -If you done of this, check and see if it worked - - ssh -T git@github.com - -You should get a message like this - - Hi excid3! You've successfully authenticated, but GitHub does not provide shell access. - -### Installing Rails ### - -We need to install javascript runtime like NodeJS because these days Rails ships with so many dependencies. With this way we can combines and minify your javascript to provide a faster production environment. - -We need to add PPA repository for installing nodeJS - - sudo add-apt-repository ppa:chris-lea/node.js - sudo apt-get update - sudo apt-get install nodejs - -If you find a problem while updating repository packages, you should try to do this command : - - # Note the new setup script name for Node.js v0.12 - curl -sL https://deb.nodesource.com/setup_0.12 | sudo bash - - - # Then install with: - sudo apt-get install -y nodejs - -Next step, follow this command : - - gem install rails -v 4.2.1 - -Because we are using rbenv, make the rails executable available with the following command below - - rbenv rehash - -To make sure the Rails have installed correcly, you can run the rails -v and this will show like this - - rails -v - # Rails 4.2.1 - -For some reason your environment may not be setup properly if you get different result. - -### Setting Up MySQL ### - -You may already be familiar with MySQL, you can install MySQL server and client from Ubuntu repository. You will set the password for the root user on installation process. This information will go into your Rails app's database.yml file in the future. Follow the command line below : - - sudo apt-get install mysql-server mysql-client libmysqlclient-dev - -Installing the libmysqlclient-dev gives you the necessary files to compile the mysql2 gem which is what Rails will use to connect to MySQL when you setup your Rails app. - -### Last Step ### - -Let's try to create your first Rails Application : - - # Use MySQL - - rails new myapp -d mysql - - # Move into the application directory - - cd myapp - - # Create Database - - rake db:create - - rails server - -Visit http://localhost:3000 to view your new website. Now you have got machine setup and ready to build some Rails application. - -![](http://blog.linoxide.com/wp-content/uploads/2015/05/localhost_3000.png) - -If you received an error message when you create database that said Access denied for user 'root'@'localhost' (Using password: NO) then you need to update your config/database.yml file to match the database **username** and **password**. - - # Edit your database.yml in config folder - - nano config/database.yml - -and then fill the password field with your MySQL root password. - -![](http://blog.linoxide.com/wp-content/uploads/2015/05/root_passw.png) - -Exit (Ctrl+X) and save. - -### Conclusion ### - -Rails is written in Ruby, the programming language which is also used alongside Rails. Ruby on Rails can be installed in three methods such rbenv, rvm and from the source on Ubuntu 15.04. Here in this tutorial we've used rbenv method and MySQL as database. If any question or suggestion, please write them in the comment below. - - --------------------------------------------------------------------------------- - -via: http://linoxide.com/ubuntu-how-to/installing-ruby-rails-using-rbenv-ubuntu-15-04/ - -作者:[Obet][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://linoxide.com/author/obetp/ -[1]:http://release.ubuntu.com/15.04 -[2]:http://github.com -[3]:https://github.com/settings/ssh diff --git a/translated/tech/20150603 Installing Ruby on Rails using rbenv on Ubuntu 15.04.md b/translated/tech/20150603 Installing Ruby on Rails using rbenv on Ubuntu 15.04.md new file mode 100644 index 0000000000..65ff38744e --- /dev/null +++ b/translated/tech/20150603 Installing Ruby on Rails using rbenv on Ubuntu 15.04.md @@ -0,0 +1,151 @@ +在Ubuntu 15.04中安装RUby on Rails +================================================================================ +本篇我们会学习如何用rbenv在Ubuntu 15.04中安装Ruby on Rails。我们选择Ubuntu作为操作系统因为Ubuntu是Linux发行版中自带很多包和完整文档的操作系统,因此我认为这是正确的选择。如果你不想安装最新的Ubuntu,你可以从[下载iso文件][1]开始。 + +### 安装 Ruby ### + +我们要做的第一件事是更新Ubuntu包并且为Ruby安装一些依赖。 + + sudo apt-get update + sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libffi-dev + +有三种方法来安装Ruby比如rbenv,rvm和从源码安装。每种都有各自的好处,但是这些天开发者们更倾向使用rbenv而不是rvm和源码来安装。我们将安装最新的Ruby版本,2.2.2。 + +用rbenv来安装只有简单的两步。第一步安装rbenv接着是ruby-build: + + cd + git clone git://github.com/sstephenson/rbenv.git .rbenv + echo 'eval "$(rbenv init -)"' >> ~/.bashrc + exec $SHELL + + git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build + echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.bashrc + exec $SHELL + + git clone https://github.com/sstephenson/rbenv-gem-rehash.git ~/.rbenv/plugins/rbenv-gem-rehash + + rbenv install 2.2.2 + rbenv global 2.2.2 + ruby -v + +我们需要安装Bundler但是我们要在安装之前告诉rubygems不要为每个包本地安装文档。 + + echo "gem: --no-ri --no-rdoc" > ~/.gemrc + gem install bundler + +### 配置 GIT ### + +配置git之前,你要创建一个github账号,你可以注册[git][2]。我们需要git作为版本控制系统,因此我们要设置来匹配github账号。 + +用户的github账号来代替下面的**Name** 和 **Email address** 。 + + git config --global color.ui true + git config --global user.name "YOUR NAME" + git config --global user.email "YOUR@EMAIL.com" + ssh-keygen -t rsa -C "YOUR@EMAIL.com" + +接下来用新生成的ssh key添加到github账号中。这样你需要复制下面命令的输出并[粘贴在这][3]。 + + cat ~/.ssh/id_rsa.pub + +如果你做完了,检查是否已经成功。 + + ssh -T git@github.com + +你应该得到下面这样的信息。 + + Hi excid3! You've successfully authenticated, but GitHub does not provide shell access. + +### 安装 Rails ### + +我们需要安装javascript运行时,像NodeJS因为这些天Rails带来很多依赖。这样我们可以结合并缩小你的javascript来提供一个更快的生产环境。 + +我们需要添加PPA来安装nodeJS。 + + sudo add-apt-repository ppa:chris-lea/node.js + sudo apt-get update + sudo apt-get install nodejs + +如果在更新是晕倒了问题,你可以试试这个命令: + + # Note the new setup script name for Node.js v0.12 + curl -sL https://deb.nodesource.com/setup_0.12 | sudo bash - + + # Then install with: + sudo apt-get install -y nodejs + +下一步,用这个命令: + + gem install rails -v 4.2.1 + +因为我们正在使用rbenv,用下面的命令来安装rails。 + + rbenv rehash + +要确保rails已经正确安炸u哪个,你可以运行rails -v,显示如下: + + rails -v + # Rails 4.2.1 + +如果你得到的是不同的结果可能是环境没有设置正确。 + +### 设置 MySQL ### + +或许你已经熟悉MySQL了,你可以从Ubuntu的仓库中安装MySQL的客户端与服务端。你可以在安装时设置root用户密码。这个信息将来会进入你rails程序的database.yml文件中、用下面的命令来安装mysql。 + + sudo apt-get install mysql-server mysql-client libmysqlclient-dev + +安装libmysqlclient-dev用于提供在设置rails程序时,rails在连接mysql所需要用到的用于编译mysql2 gem的文件。 + +### 最后一步 ### + +让我们尝试创建你的第一个rails程序: + + # Use MySQL + + rails new myapp -d mysql + + # Move into the application directory + + cd myapp + + # Create Database + + rake db:create + + rails server + +访问http://localhost:3000来访问你的新网站。现在你的电脑上已经可以构建rails程序了。 + +![](http://blog.linoxide.com/wp-content/uploads/2015/05/localhost_3000.png) + +如果你在创建数据库时遇到了“Access denied for user 'root'@'localhost' (Using password: NO)”这个错误信息,你需要更新你的config/database.yml文件来匹配数据库的**用户名**和**密码**。 + + # Edit your database.yml in config folder + + nano config/database.yml + +接着输入MySql root用户的密码。 + +![](http://blog.linoxide.com/wp-content/uploads/2015/05/root_passw.png) + +退出 (Ctrl+X)并保存。 + +### 总结 ### + +Rails是用Ruby写的, 也就是随着rails一起使用的编程语言。在Ubuntu 15.04中Ruby on Rails可以用rbenv、 rvm和源码的方式来安装。本篇我们使用的是rbenv方式并用了MySQL作为数据库。有任何的问题或建议,请在评论栏指出。 + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/ubuntu-how-to/installing-ruby-rails-using-rbenv-ubuntu-15-04/ + +作者:[Obet][a] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://linoxide.com/author/obetp/ +[1]:http://release.ubuntu.com/15.04 +[2]:http://github.com +[3]:https://github.com/settings/ssh From 127bf73eac1f836e32215f0840a5a53c26915a18 Mon Sep 17 00:00:00 2001 From: wxy Date: Sat, 6 Jun 2015 21:41:01 +0800 Subject: [PATCH 283/965] PUB:20150427 How to set up NTP server in CentOS @ictlyh --- ...0427 How to set up NTP server in CentOS.md | 48 +++++++++---------- 1 file changed, 24 insertions(+), 24 deletions(-) rename {translated/tech => published}/20150427 How to set up NTP server in CentOS.md (60%) diff --git a/translated/tech/20150427 How to set up NTP server in CentOS.md b/published/20150427 How to set up NTP server in CentOS.md similarity index 60% rename from translated/tech/20150427 How to set up NTP server in CentOS.md rename to published/20150427 How to set up NTP server in CentOS.md index 3924edd93f..deb5cc3ca6 100644 --- a/translated/tech/20150427 How to set up NTP server in CentOS.md +++ b/published/20150427 How to set up NTP server in CentOS.md @@ -1,30 +1,31 @@ 如何在 CentOS 中设置 NTP 服务器 ================================================================================ -网络时间协议(NTP)用来同步网络上不同主机的系统时间。所有托管的主机都可以和一个指定的被称为 NTP 服务器的时间服务器同步它们的时间。另一方面一个 NTP 服务器将它的时间和任何公共 NTP 服务器,或者你选定的服务器同步。NTP 托管的所有系统时钟都同步精确到毫秒级。 -在一个协作环境中,如果他们不想为 NTP 传输打开防火墙,就有必要设置一个内部 NTP 服务器,然后让员工使用内部服务器而不是公共 NTP 服务器。在这个指南中,我们会介绍如何将一个 CentOS 系统配置为 NTP 服务器。在介绍详细内容之前,让我们先来简单了解一下 NTP 的概念。 +网络时间协议(NTP)用来同步网络上不同主机的系统时间。你管理的所有主机都可以和一个指定的被称为 NTP 服务器的时间服务器同步它们的时间。而另一方面,一个 NTP 服务器会将它的时间和任意公共 NTP 服务器,或者你选定的服务器同步。由 NTP 管理的所有系统时钟都会同步精确到毫秒级。 + +在公司环境中,如果他们不想为 NTP 传输打开防火墙,就有必要设置一个内部 NTP 服务器,然后让员工使用内部服务器而不是公共 NTP 服务器。在这个指南中,我们会介绍如何将一个 CentOS 系统配置为 NTP 服务器。在介绍详细内容之前,让我们先来简单了解一下 NTP 的概念。 ### 为什么我们需要 NTP? ### -由于制造工艺多种多样,所有的(非原子)时钟并不按照完全一致的速度行走。有一些时钟走的比较快而有一些走的比较慢。因此经过很长一段时间以后,一个时钟的时间慢慢的偏移于其它,导致有名的 “时钟漂移” 或 “时间漂移”。为了最小化时钟漂移的影响,使用 NTP 的主机应该周期性地和指定的 NTP 服务器交互以保持它们的时钟同步。 +由于制造工艺多种多样,所有的(非原子)时钟并不按照完全一致的速度行走。有一些时钟走的比较快而有一些走的比较慢。因此经过很长一段时间以后,一个时钟的时间慢慢的和其它的发生偏移,这就是常说的 “时钟漂移” 或 “时间漂移”。为了将时钟漂移的影响最小化,使用 NTP 的主机应该周期性地和指定的 NTP 服务器交互以保持它们的时钟同步。 -在不同的主机之间进行时间同步对于计划备份、[干扰检测][1]日志、[分布式任务调度][2]或者事务订单管理来说是很重要的事情。它甚至可能要求作为日常任务的一部分。 +在不同的主机之间进行时间同步对于计划备份、[入侵检测][1]记录、[分布式任务调度][2]或者事务订单管理来说是很重要的事情。它甚至应该作为日常任务的一部分。 -### NTP 层次 ### +### NTP 的层次结构 ### -NTP 时钟以层次模型组织。层级中的每层被称为一个 *stratum*。stratum 的概念说明了一台机器到授权的时间源有多少 NTP 跳。 +NTP 时钟以层次模型组织。层级中的每层被称为一个 *stratum(阶层)*。stratum 的概念说明了一台机器到授权的时间源有多少 NTP 跳。 ![](https://farm8.staticflickr.com/7590/16645732413_3b7af58186_c.jpg) -Stratum 0 由没有时间漂移的时钟组成,例如原子时钟。这种时钟不能在网络上直接使用。Stratum N (N > 1) 层服务器从 Stratum N-1 层服务器同步时间。Stratum N 时钟可能通过网络和彼此互联。 +Stratum 0 由没有时间漂移的时钟组成,例如原子时钟。这种时钟不能在网络上直接使用。Stratum N (N > 1) 层服务器从 Stratum N-1 层服务器同步时间。Stratum N 时钟能通过网络和彼此互联。 -NTP 支持多达 15 stratums 的层级。Stratum 16 被认为是没有同步不能使用的。 +NTP 支持多达 15 个 stratum 的层级。Stratum 16 被认为是未同步的,不能使用的。 ### 准备 CentOS 服务器 ### 现在让我们来开始在 CentOS 上设置 NTP 服务器。 -首先,我们需要保证正确设置了服务器的时区。在 CentOS 7 中,我们可以使用 timedatectl 命令查看和更改服务器的时区(比如,"Australia/Adelaide") +首先,我们需要保证正确设置了服务器的时区。在 CentOS 7 中,我们可以使用 timedatectl 命令查看和更改服务器的时区(比如,"Australia/Adelaide",LCTT 译注:中国可设置为 Asia/Shanghai ) # timedatectl list-timezones | grep Australia # timedatectl set-timezone Australia/Adelaide @@ -56,7 +57,7 @@ NTP 支持多达 15 stratums 的层级。Stratum 16 被认为是没有同步不 # chown ntp:ntp /var/log/ntpd.log # chcon -t ntpd_log_t /var/log/ntpd.log -现在初始化 NTP 服务并确保把它添加到了随机启动。 +现在初始化 NTP 服务并确保把它添加到了开机启动。 # systemctl restart ntp # systemctl enable ntp @@ -69,19 +70,18 @@ NTP 支持多达 15 stratums 的层级。Stratum 16 被认为是没有同步不 下面的表格解释了输出列。 -注:表格 - + - + - + @@ -89,15 +89,15 @@ NTP 支持多达 15 stratums 的层级。Stratum 16 被认为是没有同步不 - + - + - + @@ -109,7 +109,7 @@ NTP 支持多达 15 stratums 的层级。Stratum 16 被认为是没有同步不 - +
remote源在 ntp.conf 中定义。‘*’ 表示当前使用的最好的源;‘+’ 表示可作为 NTP 源的源;‘-’ 标记的源是不可用的。源在 ntp.conf 中定义。‘*’ 表示当前使用的,也是最好的源;‘+’ 表示这些源可作为 NTP 源;‘-’ 标记的源是不可用的。
refid和远程服务器时钟同步的时钟的 IP 地址。用于和本地时钟同步的远程服务器的 IP 地址。
stStratumStratum(阶层)
t
when自从上次和服务器交互经过的时间(以秒数计)。自从上次和服务器交互后经过的时间(以秒数计)。
poll和服务器的轮询频率,以秒数计。和服务器的轮询间隔,以秒数计。
reach表示和服务器交互是否有任何错误的十进制数。值 337 表示 100% 成功。表示和服务器交互是否有任何错误的八进制数。值 337 表示 100% 成功(即十进制的255)。
delay
jitter两个例子之间平局时间差异,以毫秒数计。两次取样之间平均时差,以毫秒数计。
@@ -120,13 +120,13 @@ NTP 支持多达 15 stratums 的层级。Stratum 16 被认为是没有同步不 # iptables -A INPUT -s 192.168.1.0/24 -p udp --dport 123 -j ACCEPT # iptables -A INPUT -p udp --dport 123 -j DROP -该规则允许从 192.168.1.0/24 来的 NTP 流量(端口 UDP/123),任何其它网络的流量会被截停。你可以根据需要更改规则。 +该规则允许从 192.168.1.0/24 来的 NTP 流量(端口 UDP/123),任何其它网络的流量会被丢弃。你可以根据需要更改规则。 ### 配置 NTP 客户端 ### #### 1. Linux #### -NTP 客户端主机需要 ntpupdate 软件包和服务器同步时间。可以轻松地使用 yum 或 apt-get 安装这个软件包。安装完软件包之后,用服务器的 IP 地址运行下面的命令。 +NTP 客户端主机需要 ntpupdate 软件包来和服务器同步时间。可以轻松地使用 yum 或 apt-get 安装这个软件包。安装完软件包之后,用服务器的 IP 地址运行下面的命令。 # ntpdate @@ -138,17 +138,17 @@ NTP 客户端主机需要 ntpupdate 软件包和服务器同步时间。可以 #### 3. Cisco 设备 #### -如果你想和 Cisco 设备同步时间,你可以在全局配置模式下使用下面的命令。 +如果你想要同步 Cisco 设备的时间,你可以在全局配置模式下使用下面的命令。 # ntp server -其它有支持 NTP 的卖家有自己的参数用于网络时间。如果你想将设备和 NTP服务器同步时间,请查看设备的说明文档。 +来自其它厂家的支持 NTP 的设备有自己的用于网络时间的参数。如果你想将设备和 NTP服务器同步时间,请查看设备的说明文档。 ### 结论 ### 总而言之,NTP 是在你的所有主机上同步时钟的一个协议。我们已经介绍了如何设置 NTP 服务器并使支持 NTP 的设备和服务器同步时间。 -希望能对你有所帮助 +希望能对你有所帮助。 -------------------------------------------------------------------------------- @@ -156,7 +156,7 @@ via: http://xmodulo.com/setup-ntp-server-centos.html 作者:[Sarmed Rahman][a] 译者:[ictlyh](https://github.com/ictlyh) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 From 2758f1ef4ad39fdcb143123d483a18575fe4546c Mon Sep 17 00:00:00 2001 From: wxy Date: Sat, 6 Jun 2015 22:08:59 +0800 Subject: [PATCH 284/965] PUB:20150423 How to Change Default Web Browser and Email Client in Ubuntu @ictlyh --- ... Web Browser and Email Client in Ubuntu.md | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) rename {translated/tech => published}/20150423 How to Change Default Web Browser and Email Client in Ubuntu.md (75%) diff --git a/translated/tech/20150423 How to Change Default Web Browser and Email Client in Ubuntu.md b/published/20150423 How to Change Default Web Browser and Email Client in Ubuntu.md similarity index 75% rename from translated/tech/20150423 How to Change Default Web Browser and Email Client in Ubuntu.md rename to published/20150423 How to Change Default Web Browser and Email Client in Ubuntu.md index 5e7413e37d..958ce87fae 100644 --- a/translated/tech/20150423 How to Change Default Web Browser and Email Client in Ubuntu.md +++ b/published/20150423 How to Change Default Web Browser and Email Client in Ubuntu.md @@ -4,19 +4,17 @@ Ubuntu 自带了一些已经预装的默认应用程序,包括非常流行的 ![](http://www.omgubuntu.co.uk/wp-content/uploads/2014/07/web-browser.png) -尽管这两个应用都有它们自己的粉丝,但是没有一个应用能符合每个人的口味和需要。我们经常收到邮件或者推文,询问我们怎样可以在 Ubuntu 上更改默认浏览器或者设置处理邮件链接的不同的电子邮件客户端等。 +尽管这两个应用都有它们自己的粉丝,但是没有一个应用能符合每个人的口味和需要。我们经常收到邮件或者推文,询问我们可以怎样在 Ubuntu 上更改默认浏览器或者设置处理邮件链接为不同的电子邮件客户端等。 -我们在这里不仅讨论如何安装不同的软件,还包括如何给一个特定的文件,链接或者内容类型设置系统处理应用。 +我们在这里不仅讨论如何安装不同的软件,还包括如何给一个特定的文件,链接或者内容类型设置其系统处理应用。 在 Ubuntu 中更改默认应用程序,包括浏览器、电子邮件客户端、文本编辑器、音乐和视频播放器都非常的简单。但并不是每个人都知道更改这些的设置面板在哪里,让我们来快速看一下吧。 ### 如何在 Ubuntu 上更改默认浏览器 ### -![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/04/change-default-browser-in-ubuntu-750x402.jpg) +Mozilla 火狐浏览器是一扇稳定、开源而且可靠的互联网之窗,但它并不是每个人的选择。这都没关系。 -Mozilla 火狐浏览器是万维网上稳定、开源而且可依赖的窗口,但它并不是每个人的选择。这都没关系。 - -在 Ubuntu 上使用不同的默认浏览器,首先,显而易见,你需要安装一个新的浏览器。你该怎么做取决于你想要的浏览器: +要在 Ubuntu 上使用不同的默认浏览器,首先,显而易见,你需要安装一个新的浏览器。你该怎么做取决于你想要的浏览器: - 开源浏览器,例如 [Epiphany][1], [Chromium][2] 和 [IceWeasel][3],可以从 Ubuntu 软件中心安装。 @@ -24,9 +22,9 @@ Mozilla 火狐浏览器是万维网上稳定、开源而且可依赖的窗口, 不管你选择哪个浏览器,不管你选择怎样安装,完成之后你就可以继续了。 -![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/04/system-settings-ubuntu-300x215.jpg) +要更改在点击其它应用(如即时通讯软件、Twitter 客户端、 e-mail 中)中的链接时打开的默认网页浏览器,你需要用到 Ubuntu 系统设置工具。 -点击其它应用上的链接,例如及时通讯软件、Twitter 客户端、 e-mail,要更改打开网页的默认浏览器,你需要用到 Ubuntu 系统设置工具。 +![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/04/system-settings-ubuntu-300x215.jpg) 你可以用多种方法打开系统设置。其中一种最快的方式是点击右上角(RTL系统是左上角)的 Cog 图标并选择‘系统设置’菜单快捷方式。 @@ -35,25 +33,27 @@ Mozilla 火狐浏览器是万维网上稳定、开源而且可依赖的窗口, 1. 在侧边栏选择‘默认应用程序’ 1. 把 ‘Web’ 条目的 ‘火狐’ 改为你想要的选项 +![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/04/change-default-browser-in-ubuntu-750x402.jpg) + 就是这样。 ### 如何在 Ubuntu 上更改默认的邮件客户端 ### -![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/04/CHANGE-DEFAULT-APPS-UBUNTU.jpg) - -Ubuntu 用 Thunderbird 作为默认的邮件应用程序。这意味着 当你点击大部分浏览器、 PDF文件、及时通讯软件等上的 **电子邮件地址或者一个 [mailto 链接][7] 的时候会自动打开** 这个应用。 +Ubuntu 用 Thunderbird 作为默认的邮件应用程序。这意味着当你点击大部分浏览器、 PDF文件、及时通讯软件等上的 **电子邮件地址或者一个 [mailto 链接][7] 的时候会自动打开** 这个应用。 当然,如果你使用 Thunderbird,这真的很方便。但是我们很多人并非如此; 我们可能**[使用像 Geary 这样的轻量级客户端][8]**,GNOME stalwart Evolution,或者依靠像 Gmail 或者 Outlook 这样的网络邮件服务。 在 Ubuntu 上从 Thunderbird **更改默认邮件客户端** 到另一个应用程序,打开系统设置 > 详细 > 默认应用程序。点击下拉菜单到 ‘Mail’ 并选择从列表中选择你喜欢的客户端。 -**在 Ubuntu 上设置 Gmail 为默认的邮件客户端**,你首先需要点击下面的按钮安装 ‘gnome-gmail’ 软件包。安装完后打开系统设置 > 详细 > 默认应用程序。点击下拉菜单到 ‘Mail’ 并选择从列表中选择 ‘Gmail’。 +**在 Ubuntu 上设置 Gmail 为默认的邮件客户端**,你首先需要点击下面的按钮安装 ‘gnome-gmail’ 软件包。安装完后打开系统设置 > 详细 > 默认应用程序。然后点击‘Mail’ 的下拉菜单,并选择从列表中选择 ‘Gmail’。 + +![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/04/CHANGE-DEFAULT-APPS-UBUNTU.jpg) - [在 Ubuntu 上安装 GNOME Gmail][9] ### 更多 ### -上述同样的步骤可以用来设置你双击音乐文件时打开你喜欢的音乐播放器,用比如 VLC 应用程序处理 .avi 和 .mp4 文件,等等。 +上述同样的步骤也可以用来设置你双击音乐文件时打开你喜欢的音乐播放器,用比如 VLC 应用程序处理 .avi 和 .mp4 文件,等等。 -------------------------------------------------------------------------------- @@ -61,7 +61,7 @@ via: http://www.omgubuntu.co.uk/2015/04/change-your-default-web-browser-in-ubunt 作者:[Joey-Elijah Sneddon][a] 译者:[ictlyh](https://github.com/ictlyh) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 @@ -73,5 +73,5 @@ via: http://www.omgubuntu.co.uk/2015/04/change-your-default-web-browser-in-ubunt [5]:http://www.opera.com/computer/linux [6]:https://vivaldi.com/#Download [7]:http://en.wikipedia.org/wiki/Mailto -[8]:http://www.omgubuntu.co.uk/2015/03/install-geary-ubuntu-linux-email-update +[8]:https://linux.cn/article-5511-1.html [9]:apt://gnome-gmail \ No newline at end of file From 4a0f7813e23c67ddfdf8a39874c824681a706d6c Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 7 Jun 2015 08:07:31 +0800 Subject: [PATCH 285/965] PUB:20150506 How to Setup OpenERP (Odoo) on CentOS 7.x @geekpi --- ...w to Setup OpenERP (Odoo) on CentOS 7.x.md | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) rename {translated/tech => published}/20150506 How to Setup OpenERP (Odoo) on CentOS 7.x.md (69%) diff --git a/translated/tech/20150506 How to Setup OpenERP (Odoo) on CentOS 7.x.md b/published/20150506 How to Setup OpenERP (Odoo) on CentOS 7.x.md similarity index 69% rename from translated/tech/20150506 How to Setup OpenERP (Odoo) on CentOS 7.x.md rename to published/20150506 How to Setup OpenERP (Odoo) on CentOS 7.x.md index 0cd972b425..0035432ecb 100644 --- a/translated/tech/20150506 How to Setup OpenERP (Odoo) on CentOS 7.x.md +++ b/published/20150506 How to Setup OpenERP (Odoo) on CentOS 7.x.md @@ -2,7 +2,7 @@ ================================================================================ 各位好,这篇教程关于的是如何在CentOS 7中安装Odoo(就是我们所知的OpenERP)。你是不是在考虑为你的业务安装一个不错的ERP(企业资源规划)软件?那么OpenERP就是你寻找的最好的程序,因为它是一款为你的商务提供杰出特性的自由开源软件。 -[OpenERP][1]是一款自由开源的传统的OpenERP(企业资源规划),它包含了开源CRM、网站构建、电子商务、项目管理、计费账务、销售点、人力资源、市场、生产、采购管理以及其他模块用于提高效率及销售。Odoo可以作为独立程序,但是它可以无缝集成因此你可以在安装数个程序后得到一个全功能的开源ERP。 +[OpenERP][1]是一款自由开源的传统的OpenERP(企业资源规划),它包含了开源CRM、网站构建、电子商务、项目管理、计费账务、POS、人力资源、市场、生产、采购管理以及其它模块用于提高效率及销售。Odoo中的应用可以作为独立程序使用,它们也可以无缝集成到一起,因此你可以在安装几个程序来得到一个全功能的开源ERP。 因此,下面是在你的CentOS上安装OpenERP的步骤。 @@ -13,13 +13,13 @@ # yum clean all # yum update -现在我们要安装PostgreSQL,因为OpenERP使用PostgreSQL作为他的数据库。要安装它,我们需要运行下面的命令。 +现在我们要安装PostgreSQL,因为OpenERP使用PostgreSQL作为它的数据库。要安装它,我们需要运行下面的命令。 # yum install postgresql postgresql-server postgresql-libs ![Installing postgresql](http://blog.linoxide.com/wp-content/uploads/2015/03/installing-postgresql.png) -、安装完成后,我们需要用下面的命令初始化数据库。 +安装完成后,我们需要用下面的命令初始化数据库。 # postgresql-setup initdb @@ -42,13 +42,13 @@ ### 2. 设置Odoo仓库 ### -在初始化数据库初始化完成后,我们要添加EPEL(企业版Linux的额外包)到我们的CentOS中。Odoo(或者OpenERP)依赖于Python运行时以及其他包没有包含在标准仓库中。这样我们要位企业版Linux添加额外的包仓库支持来解决Odoo所需要的依赖。要安装完成,我们需要运行下面的命令。 +在初始化数据库初始化完成后,我们要添加 EPEL(企业版Linux的额外包)到我们的CentOS中。Odoo(或者OpenERP)依赖的Python运行时环境以及其他包没有包含在标准仓库中。这样我们要为企业版Linux添加额外的包仓库支持来解决Odoo所需要的依赖。要安装完成,我们需要运行下面的命令。 # yum install epel-release ![Installing EPEL Release](http://blog.linoxide.com/wp-content/uploads/2015/03/installing-epel-release.png) -现在,安装EPEL后,我们现在使用yum-config-manager添加Odoo(OpenERp)的仓库。 +现在,安装EPEL后,我们现在使用yum-config-manager添加Odoo(OpenERP)的仓库。 # yum install yum-utils @@ -73,16 +73,16 @@ ![Starting Odoo](http://blog.linoxide.com/wp-content/uploads/2015/03/starting-odoo.png) -### 4. 防火墙允许 ### +### 4. 打开防火墙 ### -因为Odoo使用8069端口,我们需要在防火墙中允许远程访问。我们使用下面的命令来在防火墙中允许8069防火墙。 +因为Odoo使用8069端口,我们需要在防火墙中允许远程访问。我们使用下面的命令来在防火墙中允许8069端口访问。 # firewall-cmd --zone=public --add-port=8069/tcp --permanent # firewall-cmd --reload ![Allowing firewall Port](http://blog.linoxide.com/wp-content/uploads/2015/03/allowing-firewall-port.png) -**注意:默认上,只有本地的连接才允许。如果我们要允许PostgreSQL的远程访问,我们需要在pg_hba.conf添加下面图片中一行** +**注意:默认情况下只有本地才允许连接数据库。如果我们要允许PostgreSQL的远程访问,我们需要在pg_hba.conf添加下面图片中一行** # nano /var/lib/pgsql/data/pg_hba.conf @@ -90,13 +90,13 @@ ### 5. Web接口 ### -我们已经在CentOS 7中安装了最新的Odoo 8(OpenERP),我们可以在浏览器中输入http://ip-address:8069来访问Odoo。 接着,我们要做的第一件事就是创建一个新的数据库和新的密码。注意,主密码默认是管理员密码。接着,我们可以在面板中输入用户名和密码。 +我们已经在CentOS 7中安装了最新的Odoo 8(OpenERP),我们可以在浏览器中输入`http://ip-address:8069`来访问Odoo。 接着,我们要做的第一件事就是创建一个新的数据库和新的密码。注意,主密码默认是‘admin’。接着,我们可以在面板中输入用户名和密码。 ![Odoo Panel](http://blog.linoxide.com/wp-content/uploads/2015/03/odoo-panel.png) ### 总结 ### -Odoo 8(OpenERP)是世界上最好的开源ERP程序。我们做了一件出色的工作来安装它因为OpenERP是由许多模块组成的针对商务和公司的完整ERP程序。因此,如果你有任何问题、建议、反馈请在下面的评论栏写下。谢谢你!享受OpenERP(Odoo 8)吧 :-) +Odoo 8(OpenERP)是世界上最好的开源ERP程序。OpenERP是由许多模块组成的针对商务和公司的完整ERP程序,我们已经把它安装好了。因此,如果你有任何问题、建议、反馈请在下面的评论栏写下。谢谢你!享受OpenERP(Odoo 8)吧 :-) -------------------------------------------------------------------------------- @@ -104,7 +104,7 @@ via: http://linoxide.com/linux-how-to/setup-openerp-odoo-centos-7/ 作者:[Arun Pyasi][a] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From fdbb337b1c38936e731faba3de6c7020c58e6cd0 Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 7 Jun 2015 08:15:32 +0800 Subject: [PATCH 286/965] PUB:20150506 Linux FAQs with Answers--How to disable entering password for default keyring to unlock on Ubuntu desktop @GOLinux --- ...for default keyring to unlock on Ubuntu desktop.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) rename {translated/tech => published}/20150506 Linux FAQs with Answers--How to disable entering password for default keyring to unlock on Ubuntu desktop.md (76%) diff --git a/translated/tech/20150506 Linux FAQs with Answers--How to disable entering password for default keyring to unlock on Ubuntu desktop.md b/published/20150506 Linux FAQs with Answers--How to disable entering password for default keyring to unlock on Ubuntu desktop.md similarity index 76% rename from translated/tech/20150506 Linux FAQs with Answers--How to disable entering password for default keyring to unlock on Ubuntu desktop.md rename to published/20150506 Linux FAQs with Answers--How to disable entering password for default keyring to unlock on Ubuntu desktop.md index 2871298396..fb67d3dd34 100644 --- a/translated/tech/20150506 Linux FAQs with Answers--How to disable entering password for default keyring to unlock on Ubuntu desktop.md +++ b/published/20150506 Linux FAQs with Answers--How to disable entering password for default keyring to unlock on Ubuntu desktop.md @@ -1,12 +1,12 @@ -Linux有问必答——Ubuntu桌面上如何禁用默认的密钥环解锁密码输入 +Linux有问必答:Ubuntu桌面上如何禁用默认的密钥环解锁提示 ================================================================================ >**问题**:当我启动我的Ubuntu桌面时,出现了一个弹出对话框,要求我输入密码来解锁默认的密钥环。我怎样才能禁用这个“解锁默认密钥环”弹出窗口,并自动解锁我的密钥环? -密钥环被认为是用来以加密方式存储你的登录信息的本地数据库。各种桌面应用(如浏览器、电子邮件客户端)使用密钥环来安全地存储并管理你的登录凭证、机密、密码、证书或密钥。对于那些需要检索存储在密钥环中的信息的应用程序,需要解锁该密钥环。 +密钥环是一个以加密方式存储你的登录信息的本地数据库。各种桌面应用(如浏览器、电子邮件客户端)使用密钥环来安全地存储并管理你的登录凭证、机密、密码、证书或密钥。对于那些需要检索存储在密钥环中的信息的应用程序,需要解锁该密钥环。 Ubuntu桌面所使用的GNOME密钥环被整合到了桌面登录中,该密钥环会在你验证进入桌面后自动解锁。但是,如果你设置了自动登录桌面或者是从休眠中唤醒,你默认的密钥环仍然可能“被锁定”的。在这种情况下,你会碰到这一提示: ->“为密钥环‘默认密钥环’输入密码来解锁。某个应用想要访问密钥环‘默认密钥环’,但它被锁定了。” +>“输入密码来解锁密钥环‘默认密钥环’。某个应用想要访问密钥环‘默认密钥环’,但它被锁定了。” > ![](https://farm9.staticflickr.com/8787/16716456754_309c39513c_o.png) @@ -16,7 +16,7 @@ Ubuntu桌面所使用的GNOME密钥环被整合到了桌面登录中,该密钥 ### 禁用默认密钥环解锁密码 ### -打开Dash,然后输入“密码”来启动“密码和密钥”应用。 +打开Dash,然后输入“password”来启动“密码和密钥”应用。 ![](https://farm8.staticflickr.com/7709/17312949416_ed9c4fbe2d_b.jpg) @@ -31,6 +31,7 @@ Ubuntu桌面所使用的GNOME密钥环被整合到了桌面登录中,该密钥 输入你的当前登录密码。 ![](https://farm8.staticflickr.com/7775/17347551135_ce09260818_b.jpg) + 在设置“默认”密钥环新密码的密码框中留空。 ![](https://farm8.staticflickr.com/7669/17345663222_c9334c738b_c.jpg) @@ -47,7 +48,7 @@ via: http://ask.xmodulo.com/disable-entering-password-unlock-default-keyring.htm 作者:[Dan Nanni][a] 译者:[GOLinux](https://github.com/GOLinux) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From ac35ae8dc9d9df5026f013f0d3c1acbae4384d94 Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 7 Jun 2015 08:23:11 +0800 Subject: [PATCH 287/965] PUB:20150512 Linux FAQs with Answers--How to view torrent file content on Linux @GOLinux --- ...wers--How to view torrent file content on Linux.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) rename {translated/tech => published}/20150512 Linux FAQs with Answers--How to view torrent file content on Linux.md (85%) diff --git a/translated/tech/20150512 Linux FAQs with Answers--How to view torrent file content on Linux.md b/published/20150512 Linux FAQs with Answers--How to view torrent file content on Linux.md similarity index 85% rename from translated/tech/20150512 Linux FAQs with Answers--How to view torrent file content on Linux.md rename to published/20150512 Linux FAQs with Answers--How to view torrent file content on Linux.md index 8b5ba22907..8f2a9c2ecd 100644 --- a/translated/tech/20150512 Linux FAQs with Answers--How to view torrent file content on Linux.md +++ b/published/20150512 Linux FAQs with Answers--How to view torrent file content on Linux.md @@ -1,6 +1,6 @@ -Linux有问必答——Linux上如何查看torrent文件内容 +Linux有问必答:Linux上如何查看种子文件的内容 ================================================================================ -> **问题**: 我从网站上下载了一个torrent文件。Linux上有没有工具让我查看torrent文件的内容?例如,我想知道torrent里面都有什么文件。 +> **问题**: 我从网站上下载了一个torrent(种子)文件。Linux上有没有工具让我查看torrent文件的内容?例如,我想知道torrent里面都包含什么文件。 torrent文件(也就是扩展名为**.torrent**的文件)是BitTorrent元数据文件,里面存储了BitTorrent客户端用来从BitTorrent点对点网络下载共享文件的信息(如,追踪器URL、文件列表、大小、校验和、创建日期等)。在单个torrent文件里面,可以列出一个或多个文件用于共享。 @@ -8,7 +8,7 @@ torrent文件内容由BEncode编码为BitTorrent数据序列化格式,因此 事实上,任何图形化的BitTorrent客户端(如Transmission或uTorrent)都带有BEncode解码器,所以,你可以用它们直接打开来查看torrent文件的内容。然而,如果你不想要使用BitTorrent客户端来检查torrent文件,你可以试试这个命令行torrent查看器,它叫[dumptorrent][1]。 -**dumptorrent**命令可以使用内建的BEncode解码器打印torrent文件的详细信息(如,文件名、大小、跟踪器URL、创建日期、信息散列等等)。 +**dumptorrent**命令可以使用内建的BEncode解码器打印出torrent文件的详细信息(如,文件名、大小、跟踪器URL、创建日期、信息散列等等)。 ### 安装DumpTorrent到Linux ### @@ -32,7 +32,7 @@ torrent文件内容由BEncode编码为BitTorrent数据序列化格式,因此 $ make $ sudo cp dumptorrent /usr/local/bin -确保你的路径中[包含][2]了/usr/local/bin。 +确保你的搜索路径 PATH 中[包含][2]了/usr/local/bin。 ### 查看torrent的内容 ### @@ -41,6 +41,7 @@ torrent文件内容由BEncode编码为BitTorrent数据序列化格式,因此 $ dumptorrent ![](https://farm8.staticflickr.com/7729/16816455904_b051e29972_b.jpg) + 要查看torrent的完整内容,请添加“-v”选项。它会打印更多关于torrent的详细信息,包括信息散列、片长度、创建日期、创建者,以及完整的声明列表。 $ dumptorrent -v @@ -53,7 +54,7 @@ via: http://ask.xmodulo.com/view-torrent-file-content-linux.html 作者:[Dan Nanni][a] 译者:[GOLinux](https://github.com/GOLinux) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From c985ad3f4b4fa5128cd0ac2099114ba9fd0baf2e Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 7 Jun 2015 09:12:19 +0800 Subject: [PATCH 288/965] PUB:20150512 How To Run Docker Client Inside Windows OS @ictlyh --- ... To Run Docker Client Inside Windows OS.md | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) rename {translated/tech => published}/20150512 How To Run Docker Client Inside Windows OS.md (70%) diff --git a/translated/tech/20150512 How To Run Docker Client Inside Windows OS.md b/published/20150512 How To Run Docker Client Inside Windows OS.md similarity index 70% rename from translated/tech/20150512 How To Run Docker Client Inside Windows OS.md rename to published/20150512 How To Run Docker Client Inside Windows OS.md index f23c109149..050ed636f3 100644 --- a/translated/tech/20150512 How To Run Docker Client Inside Windows OS.md +++ b/published/20150512 How To Run Docker Client Inside Windows OS.md @@ -1,6 +1,7 @@ 如何在 Windows 操作系统中运行 Docker 客户端 ================================================================================ -大家好,今天我们来了解一下 Windows 操作系统中的 Docker 以及在其中安装 Docker Windows 客户端的知识。Docker 引擎使用 Linux 特定内核特性,因此不能通过 Windows 内核运行,Docker 引擎创建一个小的虚拟系统运行 Linux 并利用它的资源和内核。Windows Docker 客户端用虚拟化 Docker 引擎构建,运行以及管理 盒子以外的 Docker 容器。这里有个由 Boot2Docker 团队开发的名为 Boot2Docker 的应用程序,它创建运行在基于[Linux 微内核][1]的小型 Linux 系统上的虚拟机,是特意为在 Windows 上运行 [Docker][2] 容器开发的。它完全运行在 RAM 中,需要大约 27M 内存并能在 5s(YMMV,译者注:your mileage may vary,因人而异) 内启动。因此,在用于 Windows 的 Docker 引擎被开发出来之前,我们在 Windows 机器里只能运行 Linux 容器。 + +大家好,今天我们来了解一下 Windows 操作系统中的 Docker 以及在其中安装 Docker Windows 客户端的知识。Docker 引擎使用 Linux 特有的内核特性,因此不能通过 Windows 内核运行,所以,(在 Windows 上)Docker 引擎创建了一个小的虚拟系统运行 Linux 并利用它的资源和内核。这样,Windows Docker 客户端就可以用这个虚拟的 Docker 引擎来构建、运行以及管理 Docker 容器。有个叫 Boot2Docker 的团队开发了一个同名的应用程序,它创建了一个虚拟机来运行基于[Tiny Core Linux][1]特制的小型 Linux,来在 Windows 上运行 [Docker][2] 容器。它完全运行在内存中,需要大约 27M 内存并能在 5秒 (因人而异) 内启动。因此,在用于 Windows 的 Docker 引擎被开发出来之前,我们在 Windows 机器里只能运行 Linux 容器。 下面是安装 Docker 客户端并在上面运行容器的简单步骤。 @@ -12,7 +13,7 @@ ### 2. 安装 Boot2Docker ### -现在我们运行安装文件,它会安装 Window Docker 客户端、用于 Windows 的 Git(MSYS-git)、VirtualBox、Boot2Docker Linux ISO 以及 Boot2Docker 管理工具,这些对于在盒子之外运行 Docker 引擎都至关重要。 +现在我们运行安装文件,它会安装 Window Docker 客户端、用于 Windows 的 Git(MSYS-git)、VirtualBox、Boot2Docker Linux ISO 以及 Boot2Docker 管理工具,这些对于开箱即用地运行全功能的 Docker 引擎都至关重要。 ![](http://blog.linoxide.com/wp-content/uploads/2015/05/boot2docker-installer.png) @@ -20,7 +21,7 @@ ![](http://blog.linoxide.com/wp-content/uploads/2015/05/boot2docker-start-icon-e1431322598697.png) -安装完成必要的组件之后,我们从桌面 Boot2Docker 快捷方式启动 Boot2Docker。它会要求你输入以后用于验证的 SSH 密钥。然后会启动一个配置好的用于管理在虚拟机中运行的 Docker 的 unix shell。 +安装完成必要的组件之后,我们从桌面上的“Boot2Docker Start”快捷方式启动 Boot2Docker。它会要求你输入以后用于验证的 SSH 密钥。然后会启动一个配置好的用于管理在虚拟机中运行的 Docker 的 unix shell。 ![](http://blog.linoxide.com/wp-content/uploads/2015/05/starting-boot2docker.png) @@ -32,7 +33,7 @@ ### 4. 运行 Docker ### -由于 **Boot2Docker Start** 自动启动了一个已经正确设置好环境变量的 shell,我们可以马上开始使用 Docker。**请注意,如果我们将 Boot2Docker 作为一个远程 Docker 守护进程,那么不要在 docker 命令之前加 sudo。** +由于 **Boot2Docker Start** 自动启动了一个已经正确设置好环境变量的 shell,我们可以马上开始使用 Docker。**请注意,如果我们要将 Boot2Docker 作为一个远程 Docker 守护进程,那么不要在 docker 命令之前加 sudo。** 现在,让我们来试试 **hello-world** 例子镜像,它会下载 hello-world 镜像,运行并输出 "Hello from Docker" 信息。 @@ -56,7 +57,7 @@ **注意**: 如果你看到 machine does no exist 的错误信息,就运行 **boot2docker init** 命令。 -然后复制控制台中的命令到 cmd.exe 中为控制台窗口设置环境变量,然后我们就可以像平常一样运行 docker 容器了。 +然后复制上图中控制台标出命令到 cmd.exe 中为控制台窗口设置环境变量,然后我们就可以像平常一样运行 docker 容器了。 ### 6. 使用 PowerShell 运行 Docker ### @@ -74,7 +75,7 @@ ### 7. 用 PUTTY 登录 ### -Boot2Docker 在%USERPROFILE%\.ssh 目录生成和使用用于登录的公共和私有密钥,我们也需要使用这个文件夹中的私有密钥。私有密钥需要转换为 PuTTY 的格式。我们可以通过 puttygen.exe 实现。 +Boot2Docker 会在%USERPROFILE%\.ssh 目录生成和使用用于登录的公共和私有密钥,我们也需要使用这个文件夹中的私有密钥。私有密钥需要转换为 PuTTY 的格式。我们可以通过 puttygen.exe 实现。 我们需要打开 puttygen.exe 并从 %USERPROFILE%\.ssh\id_boot2docker 中导入("File"->"Load" 菜单)私钥,然后点击 "Save Private Key"。然后用保存的文件通过 PuTTY 用 docker@127.0.0.1:2022 登录。 @@ -88,7 +89,9 @@ Boot2Docker 管理工具提供了一些命令,如下所示。 ### 总结 ### -通过 Docker Windows 客户端使用 Docker 很有趣。Boot2Docker 管理工具是一个能使任何 Docker 容器能像在 Linux 主机上平稳运行的很棒的应用程序。如果你更仔细的话,你会发现 boot2docker 默认用户的用户名是 docker,密码是 tcuser。最新版本的 boot2docker 设置了一个 host-only 的网络适配器提供访问容器的端口。一般来说是 192.168.59.103,但可以通过 VirtualBox 的 DHCP 实现改变。如果你有任何问题、建议、反馈,请在下面的评论框中写下来然后我们可以改进或者更新我们的内容。非常感谢!Enjoy:-) +通过 Docker Windows 客户端使用 Docker 很有趣。Boot2Docker 管理工具是一个能使任何 Docker 容器能像在 Linux 主机上平滑运行的很棒的应用程序。如果你更仔细的话,你会发现 boot2docker 默认用户的用户名是 docker,密码是 tcuser。最新版本的 boot2docker 设置了一个 host-only 的网络适配器提供访问容器的端口。一般来说是 192.168.59.103,但可以通过 VirtualBox 的 DHCP 实现改变。 + +如果你有任何问题、建议、反馈,请在下面的评论框中写下来然后我们可以改进或者更新我们的内容。非常感谢!Enjoy:-) -------------------------------------------------------------------------------- @@ -96,7 +99,7 @@ via: http://linoxide.com/linux-how-to/run-docker-client-inside-windows-os/ 作者:[Arun Pyasi][a] 译者:[ictlyh](https://github.com/ictlyh) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 06b97f867836d0f9d3ae3cf5b51bbb323620f641 Mon Sep 17 00:00:00 2001 From: geekpi Date: Sun, 7 Jun 2015 11:52:35 +0800 Subject: [PATCH 289/965] translating --- ...w to Install the Beautiful Arc GTK+ Flat Theme on Linux.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/share/20150603 Here's How to Install the Beautiful Arc GTK+ Flat Theme on Linux.md b/sources/share/20150603 Here's How to Install the Beautiful Arc GTK+ Flat Theme on Linux.md index 7f6c36147a..348d74bd30 100644 --- a/sources/share/20150603 Here's How to Install the Beautiful Arc GTK+ Flat Theme on Linux.md +++ b/sources/share/20150603 Here's How to Install the Beautiful Arc GTK+ Flat Theme on Linux.md @@ -1,3 +1,5 @@ +translating----geekpi + Here's How to Install the Beautiful Arc GTK+ Flat Theme on Linux ================================================================================ > Step-by-step tutorial with easy-to-follow instructions @@ -58,4 +60,4 @@ via: http://news.softpedia.com/news/Here-s-How-to-Install-the-Beautiful-Arc-GTK- [17]: [18]: [19]: -[20]: \ No newline at end of file +[20]: From f67f116b5936158823d513a3dd4832ec6557c884 Mon Sep 17 00:00:00 2001 From: geekpi Date: Sun, 7 Jun 2015 12:47:08 +0800 Subject: [PATCH 290/965] translated --- ... Beautiful Arc GTK+ Flat Theme on Linux.md | 63 ------------------- ... Beautiful Arc GTK+ Flat Theme on Linux.md | 61 ++++++++++++++++++ 2 files changed, 61 insertions(+), 63 deletions(-) delete mode 100644 sources/share/20150603 Here's How to Install the Beautiful Arc GTK+ Flat Theme on Linux.md create mode 100644 translated/share/20150603 Here's How to Install the Beautiful Arc GTK+ Flat Theme on Linux.md diff --git a/sources/share/20150603 Here's How to Install the Beautiful Arc GTK+ Flat Theme on Linux.md b/sources/share/20150603 Here's How to Install the Beautiful Arc GTK+ Flat Theme on Linux.md deleted file mode 100644 index 348d74bd30..0000000000 --- a/sources/share/20150603 Here's How to Install the Beautiful Arc GTK+ Flat Theme on Linux.md +++ /dev/null @@ -1,63 +0,0 @@ -translating----geekpi - -Here's How to Install the Beautiful Arc GTK+ Flat Theme on Linux -================================================================================ -> Step-by-step tutorial with easy-to-follow instructions - -**Today we're introducing you to a newly released GTK+ theme that features transparent and flat elements and is compatible with multiple desktop environments and Linux distributions. [The theme is called Arc][1].** - -Before going into detail, we suggest that you take a quick look at the gallery attached below, so you have a basic idea of what the theme looks like. Also, you should be aware that it currently works with GTK+ 2.x, GTK+ 3.x, GNOME-Shell, Budgie, Unity, and Pantheon user interfaces, all of them using the GNOME Stack. - -Also, the developer of the Arc theme informs us that it has been successfully tested on the Ubuntu 15.04 (Vivid Vervet), Arch Linux, elementary OS 0.3 Freya, Fedora 21, Fedora 22, Debian GNU/Linux 8.0 (Jessie), Debian Testing, Debian Unstable, openSUSE 13.2, openSUSE Tumbleweed, and Gentoo Linux operating systems. - -### Requirements and installation instructions ### - -To build the Arc theme, you will need to first install some packages, such as autoconf, automake, pkg-config (pkgconfig for Fedora), libgtk-3-dev for Debian/Ubuntu-based distros or gtk3-devel for RPM-based ones, git, gtk2-engines-pixbuf, and gtk-engine-murrine (gtk-murrine-engine for Fedora). - -The Arc theme does not yet have binary packages, so you will need to grab the latest source code from the project's Git repository and compile it. Therefore, open a Terminal app and run the following commands, one by one, hitting the Enter key after each one and waiting for the previous command to finish before adding the next. - - git clone https://github.com/horst3180/arc-theme --depth 1 && cd arc-theme - git fetch --tags - git checkout $(git describe --tags `git rev-list --tags --max-count=1`) - ./autogen.sh --prefix=/usr - sudo make install - -That's it! At this moment, the Arc theme is currently installed on your GNU/Linux distribution and you can activate it using either the GNOME Tweak Tool utility if you're using GNOME or the Unity Tweak Tool software if you are running Ubuntu's Unity desktop. Have fun and don't forget to drop a screenshot with your setup in the comments section below. - -![](http://i1-news.softpedia-static.com/images/news2/Here-s-How-to-Install-the-Beautiful-Arc-GTK-plus-Flat-Theme-on-Linux-483143-2.jpg) - -![](http://i1-news.softpedia-static.com/images/news2/Here-s-How-to-Install-the-Beautiful-Arc-GTK-plus-Flat-Theme-on-Linux-483143-3.jpg) - -![](http://i1-news.softpedia-static.com/images/news2/Here-s-How-to-Install-the-Beautiful-Arc-GTK-plus-Flat-Theme-on-Linux-483143-4.jpg) - --------------------------------------------------------------------------------- - -via: http://news.softpedia.com/news/Here-s-How-to-Install-the-Beautiful-Arc-GTK-plus-Flat-Theme-on-Linux-483143.shtml - -作者:[Marius Nestor][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://news.softpedia.com/editors/browse/marius-nestor -[1]:https://github.com/horst3180/Arc-theme -[2]: -[3]: -[4]: -[5]: -[6]: -[7]: -[8]: -[9]: -[10]: -[11]: -[12]: -[13]: -[14]: -[15]: -[16]: -[17]: -[18]: -[19]: -[20]: diff --git a/translated/share/20150603 Here's How to Install the Beautiful Arc GTK+ Flat Theme on Linux.md b/translated/share/20150603 Here's How to Install the Beautiful Arc GTK+ Flat Theme on Linux.md new file mode 100644 index 0000000000..f8d1c56d41 --- /dev/null +++ b/translated/share/20150603 Here's How to Install the Beautiful Arc GTK+ Flat Theme on Linux.md @@ -0,0 +1,61 @@ +如何在Linux中安装漂亮的扁平化Arc GTK+主题 +================================================================================ +> 易于看懂的每步都有的教程 + +**今天我们将向你介绍最新发布的GTK+主题,它拥有透明和扁平元素,并且与多个桌面环境和Linux发行版见荣发。[这个主题叫Arc][1]。** + +开始讲细节之前,我建议你快速地看一下下面的图,这样你有会对这个主题就会有一个基本的概念了。同样你应该意识到它目前可以工作在GTK+ 2.x、GTK+ 3.x、GNOME-Shell、 Budgie、 Unity和Pantheon用户界面,它们都使用了GNOME栈。 + +同样、Arc主题的开发者提醒我们它已经成功地在Ubuntu 15.04(Vivid Vervet)、 Arch Linux、 elementary OS 0.3 Freya、 Fedora 21、 Fedora 22、 Debian GNU/Linux 8.0 (Jessie)、 Debian Testing、 Debian Unstable、 openSUSE 13.2、 openSUSE Tumbleweed和Gentoo测试过了。 + +### 要求和安装指导 ### + +要构建Arc主题,你需要先安装一些包,比如autoconf、 automake、 pkg-config (对Fedora的pkgconfig)、基于Debian/Ubuntu-based发行版的libgtk-3-dev或者基于RPM的gtk3-devel、 git、 gtk2-engines-pixbuf和gtk-engine-murrine (对Fedora的gtk-murrine-engine)。 + +Arc主题还没有二进制包,因此你需要从git仓库中取下最新的源码并编译。这样,打开终端并运行下面的命令,一行行地,并在每行的末尾按下回车键并等待上一步完成来继续一步。 + + git clone https://github.com/horst3180/arc-theme --depth 1 && cd arc-theme + git fetch --tags + git checkout $(git describe --tags `git rev-list --tags --max-count=1`) + ./autogen.sh --prefix=/usr + sudo make install + +就是这样!此时你已经在你的GNU/Linux发行版中安装了Arc主题,如果你使用GNOME可以使用GONME Tweak工具或者如果你使用Unity可以使用Unity Tweak工具来激活主题。玩得开心也不要忘了在下面的评论栏里留下你的截图。 + +![](http://i1-news.softpedia-static.com/images/news2/Here-s-How-to-Install-the-Beautiful-Arc-GTK-plus-Flat-Theme-on-Linux-483143-2.jpg) + +![](http://i1-news.softpedia-static.com/images/news2/Here-s-How-to-Install-the-Beautiful-Arc-GTK-plus-Flat-Theme-on-Linux-483143-3.jpg) + +![](http://i1-news.softpedia-static.com/images/news2/Here-s-How-to-Install-the-Beautiful-Arc-GTK-plus-Flat-Theme-on-Linux-483143-4.jpg) + +-------------------------------------------------------------------------------- + +via: http://news.softpedia.com/news/Here-s-How-to-Install-the-Beautiful-Arc-GTK-plus-Flat-Theme-on-Linux-483143.shtml + +作者:[Marius Nestor][a] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://news.softpedia.com/editors/browse/marius-nestor +[1]:https://github.com/horst3180/Arc-theme +[2]: +[3]: +[4]: +[5]: +[6]: +[7]: +[8]: +[9]: +[10]: +[11]: +[12]: +[13]: +[14]: +[15]: +[16]: +[17]: +[18]: +[19]: +[20]: From 7a1ebd4b153eb013272d6802f09cba3ec045eeda Mon Sep 17 00:00:00 2001 From: wxy Date: Mon, 8 Jun 2015 10:19:12 +0800 Subject: [PATCH 291/965] PUB:20150420 Managing file and directory attributes in linux using chattr and lsattr command @ictlyh --- ...n linux using chattr and lsattr command.md | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) rename {translated/tech => published}/20150420 Managing file and directory attributes in linux using chattr and lsattr command.md (85%) diff --git a/translated/tech/20150420 Managing file and directory attributes in linux using chattr and lsattr command.md b/published/20150420 Managing file and directory attributes in linux using chattr and lsattr command.md similarity index 85% rename from translated/tech/20150420 Managing file and directory attributes in linux using chattr and lsattr command.md rename to published/20150420 Managing file and directory attributes in linux using chattr and lsattr command.md index 0aaef749c8..052103ddda 100644 --- a/translated/tech/20150420 Managing file and directory attributes in linux using chattr and lsattr command.md +++ b/published/20150420 Managing file and directory attributes in linux using chattr and lsattr command.md @@ -1,11 +1,11 @@ 在Linux中用chattr和lsattr命令管理文件和目录属性 ================================================================================ -为了允许添加数据,防止更改或者删除等,文件和文件夹中设定了一定的控制属性。例如,你可以在关键系统文件或者文件夹中启用属性,然后没有用户,包括root,可以删除或者修改它,不允许比如dump命令等备份工具去备份一个特定的文件或者文件夹,等等。这些属性只可以在ext2,ext3或者ext4文件系统中的文件和文件夹上设定。 +为了允许添加数据,防止更改或者删除等,文件和文件夹可以设定了特定的控制属性。例如,你可以在关键的系统文件或者文件夹中启用属性,然后没有任何用户,包括root,可以删除或者修改它,比如不允许使用像dump这样的命令等备份工具去备份一个特定的文件或者文件夹,等等。这些属性只可以在ext2,ext3或者ext4文件系统中的文件和文件夹上设定。 有两个命令 **lsattr** 和 **chattr** 用来管理属性。下面是常用属性的列表。 注:表格代码 - +
@@ -63,7 +63,7 @@

e (extent format)

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

i (immutable)

@@ -96,14 +96,14 @@ chattr属性中可以使用的不同选项 : - **-R** 递归地修改文件夹和子文件夹的属性 -- **-V** chattr命令的输出伴随版本信息 -- **-f** 压缩大部分错误信息 +- **-V** chattr命令会输出带有版本信息的冗余信息 +- **-f** 忽略大部分错误信息 在chattr中用于设置或者取消属性的 **操作符** -- ‘+’ 符号用来为文件和文件夹设置属性, -- ‘-‘ 符号用来移除或者取消属性 -- ‘=’ 使它们成为文件有的唯一属性。 +- '+' 符号用来为文件和文件夹设置属性, +- '-' 符号用来移除或者取消属性 +- '=' 使它们成为文件有的唯一属性。 **chattr** 和 **lsattr** 命令的基本语法 : @@ -120,7 +120,7 @@ chattr属性中可以使用的不同选项 : 现在试着删除或者修改文件 [root@linuxtechi ~]# rm -f dummy_data - rm: cannot remove ‘dummy_data’: Operation not permitted + rm: cannot remove 'dummy_data': Operation not permitted [root@linuxtechi ~]# echo "test" >> dummy_data -bash: dummy_data: Permission denied @@ -193,7 +193,7 @@ via: http://www.linuxtechi.com/file-directory-attributes-in-linux-using-chattr-l 作者:[Pradeep Kumar][a] 译者:[ictlyh](https://github.com/ictlyh) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 From 210c1637e5e3734a5485859ffa015f4caaf96ac6 Mon Sep 17 00:00:00 2001 From: wxy Date: Mon, 8 Jun 2015 11:38:07 +0800 Subject: [PATCH 292/965] PUB:20150506 First Step Guide for Learning Shell Scripting @GOLinux --- ...Step Guide for Learning Shell Scripting.md | 60 +++++++++---------- 1 file changed, 30 insertions(+), 30 deletions(-) rename {translated/tech => published}/20150506 First Step Guide for Learning Shell Scripting.md (85%) diff --git a/translated/tech/20150506 First Step Guide for Learning Shell Scripting.md b/published/20150506 First Step Guide for Learning Shell Scripting.md similarity index 85% rename from translated/tech/20150506 First Step Guide for Learning Shell Scripting.md rename to published/20150506 First Step Guide for Learning Shell Scripting.md index af71b8f4ca..6369c96c8a 100644 --- a/translated/tech/20150506 First Step Guide for Learning Shell Scripting.md +++ b/published/20150506 First Step Guide for Learning Shell Scripting.md @@ -1,4 +1,4 @@ -Shell脚本学习初次操作指南 +Shell脚本编程初体验 ================================================================================ ![](http://blog.linoxide.com/wp-content/uploads/2015/04/myfirstshellscript.jpg) @@ -18,33 +18,33 @@ Linux世界中最为流行的shell脚本语言之一,就是bash。而我认为 shell脚本语言就跟和几个人聊天类似。你只需把所有命令想象成能帮你做事的那些人,只要你用正确的方式来请求他们去做。比如说,你想要写文档。首先,你需要纸。然后,你需要把内容说给某个人听,让他帮你写。最后,你想要把它存放到某个地方。或者说,你想要造一所房子,因而你需要请合适的人来清空场地。在他们说“事情干完了”,那么另外一些工程师就可以帮你来砌墙。最后,当这些工程师们也告诉你“事情干完了”的时候,你就可以叫油漆工来给房子粉饰了。如果你让油漆工在墙砌好前就来粉饰,会发生什么呢?我想,他们会开始发牢骚了。几乎所有这些像人一样的命令都会说话,如果它们完成了工作而没有发生什么问题,那么它们就会告诉“标准输出”。如果它们不能做你叫它们做的事——它们会告诉“标准错误”。这样,最后,所有的命令都通过“标准输入”来听你的话。 -快速实例——当你打开linux终端并写一些文本时——你正通过“标准输入”和bash说话。那么,让我们来问问bash shell **who am i**吧。 +快速实例——当你打开linux终端并写一些文本时——你正通过“标准输入”和bash说话。那么,让我们来问问bash shell **who am i(我是谁?)**吧。 - root@localhost ~]# who am i <--- you speaking through the standard input to bash shell - root pts/0 2015-04-22 20:17 (192.168.1.123) <--- bash shell answering to you through the standard output + root@localhost ~]# who am i <--- 你通过标准输入对 bash shell 说 + root pts/0 2015-04-22 20:17 (192.168.1.123) <--- bash shell通过标准输出回答你 现在,让我们说一些bash听不懂的问题: [root@localhost ~]# blablabla <--- 哈,你又在和标准输入说话了 -bash: blablabla: command not found <--- bash通过标准错误在发牢骚了 -“:”之前的第一个单词通常是向你发牢骚的命令。实际上,这些流中的每一个都有它们自己的索引号: +“:”之前的第一个单词通常是向你发牢骚的命令。实际上,这些流中的每一个都有它们自己的索引号(LCTT 译注:文件句柄号): - 标准输入(**stdin**) - 0 - 标准输出(**stdout**) - 1 - 标准错误(**stderr**) - 2 -如果你真的想要知道哪个输出命令说了些什么——你需要重定向(在命令后使用大于号“>”和流索引)那次发言到文件: +如果你真的想要知道哪个输出命令说了些什么——你需要将那次发言重定向到(在命令后使用大于号“>”和流索引)文件: [root@localhost ~]# blablabla 1> output.txt -bash: blablabla: command not found -在本例中,我们试着重定向1(**stdout**)流到名为output.txt的文件。让我们来看对该文件内容所做的事情吧,使用cat命令可以做这事: +在本例中,我们试着重定向流1(**stdout**)到名为output.txt的文件。让我们来看对该文件内容所做的事情吧,使用cat命令可以做这事: [root@localhost ~]# cat output.txt [root@localhost ~]# -看起来似乎是空的。好吧,现在让我们来重定向2(**stderr**)流: +看起来似乎是空的。好吧,现在让我们来重定向流2(**stderr**): [root@localhost ~]# blablabla 2> error.txt [root@localhost ~]# @@ -77,17 +77,17 @@ shell脚本语言就跟和几个人聊天类似。你只需把所有命令想象 rm: cannot remove `folder1': Is a directory [root@localhost ~]# -正如我们所看到的,不同的流被分离到了不同的文件。有时候,这也不似很方便,因为我们想要查看出现错误时,在某些操作前面或后面所连续发生的事情。要实现这一目的,我们可以重定向两个流到同一个文件: +正如我们所看到的,不同的流被分离到了不同的文件。有时候,这也不是很方便,因为我们想要查看出现错误时,在某些操作前面或后面所连续发生的事情。要实现这一目的,我们可以重定向两个流到同一个文件: command >>out_err.txt 2>>out_err.txt 注意:请注意,我使用“>>”替代了“>”。它允许我们附加到文件,而不是覆盖文件。 -我们可以重定向一个流到另一个: +我们也可以重定向一个流到另一个: command >out_err.txt 2>&1 -让我来解释一下吧。所有命令的标准输出将被重定向到out_err.txt,错误输出将被重定向到1-st流(上面已经解释过了),而该流会被重定向到同一个文件。让我们看这个实例: +让我来解释一下吧。所有命令的标准输出将被重定向到out_err.txt,错误输出将被重定向到流1(上面已经解释过了),而该流会被重定向到同一个文件。让我们看这个实例: [root@localhost ~]# rm -fv folder2 file2 >out_err.txt 2>&1 [root@localhost ~]# cat out_err.txt @@ -127,7 +127,7 @@ shell脚本语言就跟和几个人聊天类似。你只需把所有命令想象 如果你打算grep一些双引号引起来带有空格的内容呢! -注意: fdisk命令显示关于Linux操作系统磁盘驱动器的信息 +注意:fdisk命令显示关于Linux操作系统磁盘驱动器的信息。 就像我们看到的,这种方式很不方便,因为我们不一会儿就把临时文件空间给搞乱了。要完成该任务,我们可以使用管道。它们允许我们重定向一个命令的**stdout**到另一个命令的**stdin**流: @@ -147,11 +147,11 @@ shell脚本语言就跟和几个人聊天类似。你只需把所有命令想象 正如我们所知道的,通常,与shell的交流以及shell内的交流是以对话的方式进行的。因此,让我们创建一些真正的脚本吧,这些脚本也会和我们讲话。这会让你学到一些简单的命令,并对脚本的概念有一个更好的理解。 -假设我们是某个公司的总服务台经理,我们想要创建某个shell脚本来注册呼叫信息:电话号码、用户名以及问题的简要描述。我们打算把这些信息存储到普通文本文件data.txt中,以便今后统计。脚本它自己就是以对话的方式工作,这会让总服务台的工作人员的小日子过得轻松点。那么,首先我们需要显示问题。对于现实信息,我们可以用echo和printf命令。这两个都是用来显示信息的,但是printf更为强大,因为我们可以通过它很好地格式化输出,我们可以让它右对齐、左对齐或者为信息留出专门的空间。让我们从一个简单的例子开始吧。要创建文件,请使用你喜欢的文本编辑器(kate,nano,vi,……),然后创建名为note.sh的文件,里面写入这些命令: +假设我们是某个公司的总服务台经理,我们想要创建某个shell脚本来注册呼叫信息:电话号码、用户名以及问题的简要描述。我们打算把这些信息存储到普通文本文件data.txt中,以便今后统计。脚本它自己就是以对话的方式工作,这会让总服务台的工作人员的小日子过得轻松点。那么,首先我们需要显示提问。对于显示信息,我们可以用echo和printf命令。这两个都是用来显示信息的,但是printf更为强大,因为我们可以通过它很好地格式化输出,我们可以让它右对齐、左对齐或者为信息留出专门的空间。让我们从一个简单的例子开始吧。要创建文件,请使用你惯用的文本编辑器(kate,nano,vi,……),然后创建名为note.sh的文件,里面写入这些命令: echo "Phone number ?" - -### Script执行 ### + +### 如何运行/执行脚本? ### 在保存文件后,我们可以使用bash命令来运行,把我们的文件作为它的参数: @@ -176,7 +176,7 @@ shell脚本语言就跟和几个人聊天类似。你只需把所有命令想象 [root@localhost ~]# ./note.sh Phone number ? -在脚本名前,我添加了./组合。.(点)在unix世界中意味着当前位置(当前文件夹),/(斜线)是文件夹分隔符。(在Windows系统中,我们使用\(反斜线)实现同样功能)所以,这整个组合的意思是说:“从当前文件夹执行note.sh脚本”。我想,如果我用完整路径来运行这个脚本的话,你会更加清楚一些: +在脚本名前,我添加了 ./ 组合。.(点)在unix世界中意味着当前位置(当前文件夹),/(斜线)是文件夹分隔符。(在Windows系统中,我们使用反斜线 \ 表示同样功能)所以,这整个组合的意思是说:“从当前文件夹执行note.sh脚本”。我想,如果我用完整路径来运行这个脚本的话,你会更加清楚一些: [root@localhost ~]# /root/note.sh Phone number ? @@ -184,7 +184,7 @@ shell脚本语言就跟和几个人聊天类似。你只需把所有命令想象 它也能工作。 -如果所有linux用户都有相同的默认shell,那就万事OK。如果我们只是执行该脚本,默认的用户shell就会用于解析脚本内容并运行命令。不同的shell有着一丁点不同的语法、内部命令等等,所以,为了保证我们的脚本会使用**bash**,我们应该添加**#!/bin/bash**到文件首行。这样,默认的用户shell将调用**/bin/bash**,而只有在那时候,脚本中的命令才会被执行: +如果所有linux用户都有相同的默认shell,那就万事OK。如果我们只是执行该脚本,默认的用户shell就会用于解析脚本内容并运行命令。不同的shell的语法、内部命令等等有着一丁点不同,所以,为了保证我们的脚本会使用**bash**,我们应该添加**#!/bin/bash**到文件首行。这样,默认的用户shell将调用**/bin/bash**,而只有在那时候,脚本中的命令才会被执行: [root@localhost ~]# cat note.sh #!/bin/bash @@ -194,13 +194,13 @@ shell脚本语言就跟和几个人聊天类似。你只需把所有命令想象 ### 读取输入 ### -在现实信息后,脚本会等待用户回答。那儿有个**read**命令用来接收用户的回答: +在显示信息后,脚本会等待用户回答。有个**read**命令用来接收用户的回答: #!/bin/bash echo "Phone number ?" read phone -在执行后,脚本会等待用户输入,直到用户按[ENTER]键: +在执行后,脚本会等待用户输入,直到用户按[ENTER]键结束输入: [root@localhost ~]# ./note.sh Phone number ? @@ -220,7 +220,7 @@ shell脚本语言就跟和几个人聊天类似。你只需把所有命令想象 You have entered 123456 as a phone number [root@localhost ~]# -在**bash** shell中,我们使用**$**(美元)符号作为变量标示,除了读入到变量和其它为数不多的时候(将在今后说明)。 +在**bash** shell中,一般我们使用**$**(美元)符号来表明这是一个变量,除了读入到变量和其它为数不多的时候才不用这个$(将在今后说明)。 好了,现在我们准备添加剩下的问题了: @@ -244,7 +244,7 @@ shell脚本语言就跟和几个人聊天类似。你只需把所有命令想象 太完美了!剩下来就是重定向所有东西到文件data.txt了。作为字段分隔符,我们将使用/(斜线)符号。 -**注意** : 你可以选择任何你认为是最好,但是确保文件内容不会包含这些符号在内。它会导致在文本行中产生额外字段。 +**注意** : 你可以选择任何你认为是最好的分隔符,但是确保文件内容不会包含这些符号在内,否则它会导致在文本行中产生额外字段。 别忘了使用“>>”来代替“>”,因为我们想要将输出内容附加到文件末! @@ -262,7 +262,7 @@ shell脚本语言就跟和几个人聊天类似。你只需把所有命令想象 987/Jimmy/Keybord issue. [root@localhost ~]# -**注意** : **tail**命令显示了文件的最后**-n**行。 +**注意** : **tail**命令显示了文件的最后的**n**行。 搞定。让我们再来运行一次看看: @@ -285,7 +285,7 @@ shell脚本语言就跟和几个人聊天类似。你只需把所有命令想象 [root@localhost ~]# date "+%Y.%m.%d %H:%M:%S" 2015.04.23 21:33:18 <---- 格式化后的输出 -有几种方式可以读取命令输出到变脸,在这种简单的情况下,我们将使用`(反引号): +有几种方式可以读取命令的输出到变量,在这种简单的情况下,我们将使用`(是反引号,不是单引号,和波浪号~在同一个键位): [root@localhost ~]# cat note.sh #!/bin/bash @@ -320,7 +320,7 @@ shell脚本语言就跟和几个人聊天类似。你只需把所有命令想象 你可以直接从控制台查找到各个命令的大量有趣的信息,只需输入:**man read, man echo, man date, man ……** -同意吗?它看上去是好多了! +同意吗?它看上去是舒服多了! [root@localhost ~]# ./note.sh Phone number: 321 @@ -331,9 +331,9 @@ shell脚本语言就跟和几个人聊天类似。你只需把所有命令想象 2015.04.23 21:43:50/321/Susane/Mouse was stolen [root@localhost ~]# -光标在消息的后面(不是在新的一行中),这有点意思。 +光标在消息的后面(不是在新的一行中),这有点意思。(LCTT 译注:如果用 echo 命令输出显示的话,可以用 -n 参数来避免换行。) -循环 +### 循环 ### 是时候来改进我们的脚本了。如果用户一整天都在接电话,如果每次都要去运行,这岂不是很麻烦?让我们让这些活动都永无止境地循环去吧: @@ -348,7 +348,7 @@ shell脚本语言就跟和几个人聊天类似。你只需把所有命令想象 echo "$now/$phone/$name/$issue">>data.txt done -我已经交换了**read phone**和**now=`date`**行。这是因为我想要在输入电话号码后再获得时间。如果我把它放在循环**- the**的首行,变量就会在数据存储到文件中后获得时间。而这并不好,因为下一次呼叫可能在20分钟后,甚至更晚。 +我已经交换了**read phone**和**now=`date`**行的位置。这是因为我想要在输入电话号码后再获得时间。如果我把它放在循环的首行,那么循环一次后,变量 now 就会在数据存储到文件中后马上获得时间。而这并不好,因为下一次呼叫可能在20分钟后,甚至更晚。 [root@localhost ~]# ./note.sh Phone number: 123 @@ -365,11 +365,11 @@ shell脚本语言就跟和几个人聊天类似。你只需把所有命令想象 2015.04.23 21:48:16/777/Daniel/I broke my monitor [root@localhost ~]# -注意: 要从无限循环中退出,你可以按[Ctrl]+[C]键。Shell会显示^表示Ctrl键。 +注意: 要从无限循环中退出,你可以按[Ctrl]+[C]键。Shell会显示\^表示Ctrl键。 ### 使用管道重定向 ### -让我们添加更多功能到我们的“弗兰肯斯坦”,我想要脚本在每次呼叫后显示某个统计数据。比如说,我想要查看各个号码呼叫了我几次。对于这个,我们应该cat文件data.txt: +让我们添加更多功能到我们的“弗兰肯斯坦(Frankenstein)”,我想要脚本在每次呼叫后显示某个统计数据。比如说,我想要查看各个号码呼叫了我几次。对于这个,我们应该cat文件data.txt: [root@localhost ~]# cat data.txt 2015.04.23 21:38:56/123/Jim/Script hanging. @@ -453,7 +453,7 @@ via: http://linoxide.com/linux-shell-script/guide-start-learning-shell-scripting 作者:[Petras Liumparas][a] 译者:[GOLinux](https://github.com/GOLinux) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From b9e86d827951075cc56e6e80f0d63dc3eafae148 Mon Sep 17 00:00:00 2001 From: ZTinoZ Date: Mon, 8 Jun 2015 16:02:17 +0800 Subject: [PATCH 293/965] Translating by ZTinoZ --- .../20150526 20 Useful Terminal Emulators for Linux.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sources/tech/20150526 20 Useful Terminal Emulators for Linux.md b/sources/tech/20150526 20 Useful Terminal Emulators for Linux.md index 4d2f8cfc16..bafcc15d71 100644 --- a/sources/tech/20150526 20 Useful Terminal Emulators for Linux.md +++ b/sources/tech/20150526 20 Useful Terminal Emulators for Linux.md @@ -28,7 +28,7 @@ Terminator Terminal ### 2. Tilda ### -Tilda是一款漂亮的基于GTK+的下拉式终端。敲击一个键你就可以打开一个新的或隐藏着的Tilda窗口。然而,你可以添加你所选择的颜色来更改文本颜色和终端背景颜色。 +Tilda是一款漂亮的基于GTK+的下拉式终端,敲击一个键你就可以呼出一个新的或隐藏着的Tilda窗口。你也可以添加你所选择的颜色来更改文本颜色和终端背景颜色。 #### Tilda的特性 #### @@ -44,9 +44,9 @@ Tilda Terminal ### 3. Guake ### -Guake is a python based drop-down terminal created for the GNOME Desktop Environment. It is invoked by pressing a single keystroke, and can make it hidden by pressing same keystroke again. Its design was determined from FPS (First Person Shooter) games such as Quake and one of its main target is be easy to reach. +Guake是一款基于python的下拉式终端,诞生于GNOME桌面环境。按一个键就能调出,再按一下就能隐藏。它的设计构思来源于FPS (第一人称射击) 游戏例如Quake,其目标显而易见。 -Guake is very much similar to Yakuaka and Tilda, but it’s an experiment to mix the best of them into a single GTK-based program. Guake has been written in python from scratch using a little piece in C (global hotkeys stuff). +Guake与Yakuaka和Tilda非常相似,不过它是一个集上述二者的优点于一体的基于GTK的程序。Guake完全是用Python和小片的C写成的(全局热键部分)。 ![Guake Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/Guake-Terminal.jpeg) @@ -56,7 +56,7 @@ Guake Terminal ### 4. Yakuake ### -Yakuake (Yet Another Kuake) is a KDE based drop-down terminal emulator very much similar to Guake terminal emulator in functionality. It’s design was inspired from fps consoles games such as Quake. +Yakuake (Yet Another Kuake) 是一款基于KDE的下拉式终端仿真器,它与Guake再功能上非常相似。它的射击构思也是受FPS游戏的启发例如Quake。 Yakuake is basically a KDE application, which can be easily installed on KDE desktop, but if you try to install Yakuake in GNOME desktop, it will prompt you to install huge number of dependency packages. From 1fe543421b67080516ee3775ba44f512df143f3b Mon Sep 17 00:00:00 2001 From: DeadFire Date: Mon, 8 Jun 2015 16:39:28 +0800 Subject: [PATCH 294/965] =?UTF-8?q?2015-06-08-1=20=E9=80=89=E9=A2=98=20RHC?= =?UTF-8?q?SA=20Series=201-6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ntial Commands and System Documentation.md | 313 +++++++++++++++++ ...o Perform File and Directory Management.md | 322 ++++++++++++++++++ ...ow to Manage Users and Groups in RHEL 7.md | 248 ++++++++++++++ ...or Analyzing text with grep and regexps.md | 254 ++++++++++++++ ...Boot Shutdown and Everything in Between.md | 216 ++++++++++++ ...to Configure and Encrypt System Storage.md | 269 +++++++++++++++ 6 files changed, 1622 insertions(+) create mode 100644 sources/tech/RHCSA Series/RHCSA Series--Part 01--Reviewing Essential Commands and System Documentation.md create mode 100644 sources/tech/RHCSA Series/RHCSA Series--Part 02--How to Perform File and Directory Management.md create mode 100644 sources/tech/RHCSA Series/RHCSA Series--Part 03--How to Manage Users and Groups in RHEL 7.md create mode 100644 sources/tech/RHCSA Series/RHCSA Series--Part 04--Editing Text Files with Nano and Vim or Analyzing text with grep and regexps.md create mode 100644 sources/tech/RHCSA Series/RHCSA Series--Part 05--Process Management in RHEL 7--Boot Shutdown and Everything in Between.md create mode 100644 sources/tech/RHCSA Series/RHCSA Series--Part 06--Using 'Parted' and 'SSM' to Configure and Encrypt System Storage.md diff --git a/sources/tech/RHCSA Series/RHCSA Series--Part 01--Reviewing Essential Commands and System Documentation.md b/sources/tech/RHCSA Series/RHCSA Series--Part 01--Reviewing Essential Commands and System Documentation.md new file mode 100644 index 0000000000..9b32c93453 --- /dev/null +++ b/sources/tech/RHCSA Series/RHCSA Series--Part 01--Reviewing Essential Commands and System Documentation.md @@ -0,0 +1,313 @@ +RHCSA Series: Reviewing Essential Commands & System Documentation – Part 1 +================================================================================ +RHCSA (Red Hat Certified System Administrator) is a certification exam from Red Hat company, which provides an open source operating system and software to the enterprise community, It also provides support, training and consulting services for the organizations. + +![RHCSA Exam Guide](http://www.tecmint.com/wp-content/uploads/2015/02/RHCSA-Series-by-Tecmint.png) + +RHCSA Exam Preparation Guide + +RHCSA exam is the certification obtained from Red Hat Inc, after passing the exam (codename EX200). RHCSA exam is an upgrade to the RHCT (Red Hat Certified Technician) exam, and this upgrade is compulsory as the Red Hat Enterprise Linux was upgraded. The main variation between RHCT and RHCSA is that RHCT exam based on RHEL 5, whereas RHCSA certification is based on RHEL 6 and 7, the courseware of these two certifications are also vary to a certain level. + +This Red Hat Certified System Administrator (RHCSA) is essential to perform the following core system administration tasks needed in Red Hat Enterprise Linux environments: + +- Understand and use necessary tools for handling files, directories, command-environments line, and system-wide / packages documentation. +- Operate running systems, even in different run levels, identify and control processes, start and stop virtual machines. +- Set up local storage using partitions and logical volumes. +- Create and configure local and network file systems and its attributes (permissions, encryption, and ACLs). +- Setup, configure, and control systems, including installing, updating and removing software. +- Manage system users and groups, along with use of a centralized LDAP directory for authentication. +- Ensure system security, including basic firewall and SELinux configuration. + +To view fees and register for an exam in your country, check the [RHCSA Certification page][1]. + +To view fees and register for an exam in your country, check the RHCSA Certification page. + +In this 15-article RHCSA series, titled Preparation for the RHCSA (Red Hat Certified System Administrator) exam, we will going to cover the following topics on the latest releases of Red Hat Enterprise Linux 7. + +- Part 1: Reviewing Essential Commands & System Documentation +- Part 2: How to Perform File and Directory Management in RHEL 7 +- Part 3: How to Manage Users and Groups in RHEL 7 +- Part 4: Editing Text Files with Nano and Vim / Analyzing text with grep and regexps +- Part 5: Process Management in RHEL 7: boot, shutdown, and everything in between +- Part 6: Using ‘Parted’ and ‘SSM’ to Configure and Encrypt System Storage +- Part 7: Using ACLs (Access Control Lists) and Mounting Samba / NFS Shares +- Part 8: Securing SSH, Setting Hostname and Enabling Network Services +- Part 9: Installing, Configuring and Securing a Web and FTP Server +- Part 10: Yum Package Management, Automating Tasks with Cron and Monitoring System Logs +- Part 11: Firewall Essentials and Control Network Traffic Using FirewallD and Iptables +- Part 12: Automate RHEL 7 Installations Using ‘Kickstart’ +- Part 13: RHEL 7: What is SELinux and how it works? +- Part 14: Use LDAP-based authentication in RHEL 7 +- Part 15: Virtualization in RHEL 7: KVM and Virtual machine management + +In this Part 1 of the RHCSA series, we will explain how to enter and execute commands with the correct syntax in a shell prompt or terminal, and explained how to find, inspect, and use system documentation. + +![RHCSA: Reviewing Essential Linux Commands – Part 1](http://www.tecmint.com/wp-content/uploads/2015/02/Reviewing-Essential-Linux-Commands.png) + +RHCSA: Reviewing Essential Linux Commands – Part 1 + +#### Prerequisites: #### + +At least a slight degree of familiarity with basic Linux commands such as: + +- [cd command][2] (change directory) +- [ls command][3] (list directory) +- [cp command][4] (copy files) +- [mv command][5] (move or rename files) +- [touch command][6] (create empty files or update the timestamp of existing ones) +- rm command (delete files) +- mkdir command (make directory) + +The correct usage of some of them are anyway exemplified in this article, and you can find further information about each of them using the suggested methods in this article. + +Though not strictly required to start, as we will be discussing general commands and methods for information search in a Linux system, you should try to install RHEL 7 as explained in the following article. It will make things easier down the road. + +- [Red Hat Enterprise Linux (RHEL) 7 Installation Guide][7] + +### Interacting with the Linux Shell ### + +If we log into a Linux box using a text-mode login screen, chances are we will be dropped directly into our default shell. On the other hand, if we login using a graphical user interface (GUI), we will have to open a shell manually by starting a terminal. Either way, we will be presented with the user prompt and we can start typing and executing commands (a command is executed by pressing the Enter key after we have typed it). + +Commands are composed of two parts: + +- the name of the command itself, and +- arguments + +Certain arguments, called options (usually preceded by a hyphen), alter the behavior of the command in a particular way while other arguments specify the objects upon which the command operates. + +The type command can help us identify whether another certain command is built into the shell or if it is provided by a separate package. The need to make this distinction lies in the place where we will find more information about the command. For shell built-ins we need to look in the shell’s man page, whereas for other binaries we can refer to its own man page. + +![Check Shell built in Commands](http://www.tecmint.com/wp-content/uploads/2015/02/Check-shell-built-in-Commands.png) + +Check Shell built in Commands + +In the examples above, cd and type are shell built-ins, while top and less are binaries external to the shell itself (in this case, the location of the command executable is returned by type). + +Other well-known shell built-ins include: + +- [echo command][8]: Displays strings of text. +- [pwd command][9]: Prints the current working directory. + +![More Built in Shell Commands](http://www.tecmint.com/wp-content/uploads/2015/02/More-Built-in-Shell-Commands.png) + +More Built in Shell Commands + +**exec command** + +Runs an external program that we specify. Note that in most cases, this is better accomplished by just typing the name of the program we want to run, but the exec command has one special feature: rather than create a new process that runs alongside the shell, the new process replaces the shell, as can verified by subsequent. + + # ps -ef | grep [original PID of the shell process] + +When the new process terminates, the shell terminates with it. Run exec top and then hit the q key to quit top. You will notice that the shell session ends when you do, as shown in the following screencast: + +注:youtube视频 + + +**export command** + +Exports variables to the environment of subsequently executed commands. + +**history Command** + +Displays the command history list with line numbers. A command in the history list can be repeated by typing the command number preceded by an exclamation sign. If we need to edit a command in history list before executing it, we can press Ctrl + r and start typing the first letters associated with the command. When we see the command completed automatically, we can edit it as per our current need: + +注:youtube视频 + + +This list of commands is kept in our home directory in a file called .bash_history. The history facility is a useful resource for reducing the amount of typing, especially when combined with command line editing. By default, bash stores the last 500 commands you have entered, but this limit can be extended by using the HISTSIZE environment variable: + +![Linux history Command](http://www.tecmint.com/wp-content/uploads/2015/02/Linux-history-Command.png) + +Linux history Command + +But this change as performed above, will not be persistent on our next boot. In order to preserve the change in the HISTSIZE variable, we need to edit the .bashrc file by hand: + + # for setting history length see HISTSIZE and HISTFILESIZE in bash(1) + HISTSIZE=1000 + +**Important**: Keep in mind that these changes will not take effect until we restart our shell session. + +**alias command** + +With no arguments or with the -p option prints the list of aliases in the form alias name=value on standard output. When arguments are provided, an alias is defined for each name whose value is given. + +With alias, we can make up our own commands or modify existing ones by including desired options. For example, suppose we want to alias ls to ls –color=auto so that the output will display regular files, directories, symlinks, and so on, in different colors: + + # alias ls='ls --color=auto' + +![Linux alias Command](http://www.tecmint.com/wp-content/uploads/2015/02/Linux-alias-Command.png) + +Linux alias Command + +**Note**: That you can assign any name to your “new command” and enclose as many commands as desired between single quotes, but in that case you need to separate them by semicolons, as follows: + + # alias myNewCommand='cd /usr/bin; ls; cd; clear' + +**exit command** + +The exit and logout commands both terminate the shell. The exit command terminates any shell, but the logout command terminates only login shells—that is, those that are launched automatically when you initiate a text-mode login. + +If we are ever in doubt as to what a program does, we can refer to its man page, which can be invoked using the man command. In addition, there are also man pages for important files (inittab, fstab, hosts, to name a few), library functions, shells, devices, and other features. + +#### Examples: #### + +- man uname (print system information, such as kernel name, processor, operating system type, architecture, and so on). +- man inittab (init daemon configuration). + +Another important source of information is provided by the info command, which is used to read info documents. These documents often provide more information than the man page. It is invoked by using the info keyword followed by a command name, such as: + + # info ls + # info cut + +In addition, the /usr/share/doc directory contains several subdirectories where further documentation can be found. They either contain plain-text files or other friendly formats. + +Make sure you make it a habit to use these three methods to look up information for commands. Pay special and careful attention to the syntax of each of them, which is explained in detail in the documentation. + +**Converting Tabs into Spaces with expand Command** + +Sometimes text files contain tabs but programs that need to process the files don’t cope well with tabs. Or maybe we just want to convert tabs into spaces. That’s where the expand tool (provided by the GNU coreutils package) comes in handy. + +For example, given the file NumbersList.txt, let’s run expand against it, changing tabs to one space, and display on standard output. + + # expand --tabs=1 NumbersList.txt + +![Linux expand Command](http://www.tecmint.com/wp-content/uploads/2015/02/Linux-expand-Command.png) + +Linux expand Command + +The unexpand command performs the reverse operation (converts spaces into tabs). + +**Display the first lines of a file with head and the last lines with tail** + +By default, the head command followed by a filename, will display the first 10 lines of the said file. This behavior can be changed using the -n option and specifying a certain number of lines. + + # head -n3 /etc/passwd + # tail -n3 /etc/passwd + +![Linux head and tail Command](http://www.tecmint.com/wp-content/uploads/2015/02/Linux-head-and-tail-Command.png) + +Linux head and tail Command + +One of the most interesting features of tail is the possibility of displaying data (last lines) as the input file grows (tail -f my.log, where my.log is the file under observation). This is particularly useful when monitoring a log to which data is being continually added. + +Read More: [Manage Files Effectively using head and tail Commands][10] + +**Merging Lines with paste** + +The paste command merges files line by line, separating the lines from each file with tabs (by default), or another delimiter that can be specified (in the following example the fields in the output are separated by an equal sign). + + # paste -d= file1 file2 + +![Merge Files in Linux](http://www.tecmint.com/wp-content/uploads/2015/02/Merge-Files-in-Linux-with-paste-command.png) + +Merge Files in Linux + +**Breaking a file into pieces using split command** + +The split command is used split a file into two (or more) separate files, which are named according to a prefix of our choosing. The splitting can be defined by size, chunks, or number of lines, and the resulting files can have a numeric or alphabetic suffixes. In the following example, we will split bash.pdf into files of size 50 KB (-b 50KB), using numeric suffixes (-d): + + # split -b 50KB -d bash.pdf bash_ + +![Split Files in Linux](http://www.tecmint.com/wp-content/uploads/2015/02/Split-Files-in-Linux-with-split-command.png) + +Split Files in Linux + +You can merge the files to recreate the original file with the following command: + + # cat bash_00 bash_01 bash_02 bash_03 bash_04 bash_05 > bash.pdf + +**Translating characters with tr command** + +The tr command can be used to translate (change) characters on a one-by-one basis or using character ranges. In the following example we will use the same file2 as previously, and we will change: + +- lowercase o’s to uppercase, +- and all lowercase to uppercase + + # cat file2 | tr o O + # cat file2 | tr [a-z] [A-Z] + +![Translate Characters in Linux](http://www.tecmint.com/wp-content/uploads/2015/02/Translate-characters-in-Linux-with-tr-command.png) + +Translate Characters in Linux + +**Reporting or deleting duplicate lines with uniq and sort command** + +The uniq command allows us to report or remove duplicate lines in a file, writing to stdout by default. We must note that uniq does not detect repeated lines unless they are adjacent. Thus, uniq is commonly used along with a preceding sort (which is used to sort lines of text files). + +By default, sort takes the first field (separated by spaces) as key field. To specify a different key field, we need to use the -k option. Please note how the output returned by sort and uniq change as we change the key field in the following example: + + # cat file3 + # sort file3 | uniq + # sort -k2 file3 | uniq + # sort -k3 file3 | uniq + +![Remove Duplicate Lines in Linux](http://www.tecmint.com/wp-content/uploads/2015/02/Remove-Duplicate-Lines-in-file.png) + +Remove Duplicate Lines in Linux + +**Extracting text with cut command** + +The cut command extracts portions of input lines (from stdin or files) and displays the result on standard output, based on number of bytes (-b), characters (-c), or fields (-f). + +When using cut based on fields, the default field separator is a tab, but a different separator can be specified by using the -d option. + + # cut -d: -f1,3 /etc/passwd # Extract specific fields: 1 and 3 in this case + # cut -d: -f2-4 /etc/passwd # Extract range of fields: 2 through 4 in this example + +![Extract Text From a File in Linux](http://www.tecmint.com/wp-content/uploads/2015/02/Extract-Text-from-a-file.png) + +Extract Text From a File in Linux + +Note that the output of the two examples above was truncated for brevity. + +**Reformatting files with fmt command** + +fmt is used to “clean up” files with a great amount of content or lines, or with varying degrees of indentation. The new paragraph formatting defaults to no more than 75 characters wide. You can change this with the -w (width) option, which set the line length to the specified number of characters. + +For example, let’s see what happens when we use fmt to display the /etc/passwd file setting the width of each line to 100 characters. Once again, output has been truncated for brevity. + + # fmt -w100 /etc/passwd + +![File Reformatting in Linux](http://www.tecmint.com/wp-content/uploads/2015/02/File-Reformatting-in-Linux-with-fmt-command.png) + +File Reformatting in Linux + +**Formatting content for printing with pr command** + +pr paginates and displays in columns one or more files for printing. In other words, pr formats a file to make it look better when printed. For example, the following command: + + # ls -a /etc | pr -n --columns=3 -h "Files in /etc" + +Shows a listing of all the files found in /etc in a printer-friendly format (3 columns) with a custom header (indicated by the -h option), and numbered lines (-n). + +![File Formatting in Linux](http://www.tecmint.com/wp-content/uploads/2015/02/File-Formatting-in-Linux-with-pr-command.png) + +File Formatting in Linux + +### Summary ### + +In this article we have discussed how to enter and execute commands with the correct syntax in a shell prompt or terminal, and explained how to find, inspect, and use system documentation. As simple as it seems, it’s a large first step in your way to becoming a RHCSA. + +If you would like to add other commands that you use on a periodic basis and that have proven useful to fulfill your daily responsibilities, feel free to share them with the world by using the comment form below. Questions are also welcome. We look forward to hearing from you! + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/rhcsa-exam-reviewing-essential-commands-system-documentation/ + +作者:[Gabriel Cánepa][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/gacanepa/ +[1]:https://www.redhat.com/en/services/certification/rhcsa +[2]:http://www.tecmint.com/cd-command-in-linux/ +[3]:http://www.tecmint.com/ls-command-interview-questions/ +[4]:http://www.tecmint.com/advanced-copy-command-shows-progress-bar-while-copying-files/ +[5]:http://www.tecmint.com/rename-multiple-files-in-linux/ +[6]:http://www.tecmint.com/8-pratical-examples-of-linux-touch-command/ +[7]:http://www.tecmint.com/redhat-enterprise-linux-7-installation/ +[8]:http://www.tecmint.com/echo-command-in-linux/ +[9]:http://www.tecmint.com/pwd-command-examples/ +[10]:http://www.tecmint.com/view-contents-of-file-in-linux/ \ No newline at end of file diff --git a/sources/tech/RHCSA Series/RHCSA Series--Part 02--How to Perform File and Directory Management.md b/sources/tech/RHCSA Series/RHCSA Series--Part 02--How to Perform File and Directory Management.md new file mode 100644 index 0000000000..7566862597 --- /dev/null +++ b/sources/tech/RHCSA Series/RHCSA Series--Part 02--How to Perform File and Directory Management.md @@ -0,0 +1,322 @@ +RHCSA Series: How to Perform File and Directory Management – Part 2 +================================================================================ +In this article, RHCSA Part 2: File and directory management, we will review some essential skills that are required in the day-to-day tasks of a system administrator. + +![RHCSA: Perform File and Directory Management – Part 2](http://www.tecmint.com/wp-content/uploads/2015/03/RHCSA-Part2.png) + +RHCSA: Perform File and Directory Management – Part 2 + +### Create, Delete, Copy, and Move Files and Directories ### + +File and directory management is a critical competence that every system administrator should possess. This includes the ability to create / delete text files from scratch (the core of each program’s configuration) and directories (where you will organize files and other directories), and to find out the type of existing files. + +The [touch command][1] can be used not only to create empty files, but also to update the access and modification times of existing files. + +![touch command example](http://www.tecmint.com/wp-content/uploads/2015/03/touch-command-example.png) + +touch command example + +You can use `file [filename]` to determine a file’s type (this will come in handy before launching your preferred text editor to edit it). + +![file command example](http://www.tecmint.com/wp-content/uploads/2015/03/file-command-example.png) + +file command example + +and `rm [filename]` to delete it. + +![Linux rm command examples](http://www.tecmint.com/wp-content/uploads/2015/03/rm-command-examples.png) + +rm command example + +As for directories, you can create directories inside existing paths with `mkdir [directory]` or create a full path with `mkdir -p [/full/path/to/directory].` + +![mkdir command example](http://www.tecmint.com/wp-content/uploads/2015/03/mkdir-command-example.png) + +mkdir command example + +When it comes to removing directories, you need to make sure that they’re empty before issuing the `rmdir [directory]` command, or use the more powerful (handle with care!) `rm -rf [directory]`. This last option will force remove recursively the `[directory]` and all its contents – so use it at your own risk. + +### Input and Output Redirection and Pipelining ### + +The command line environment provides two very useful features that allows to redirect the input and output of commands from and to files, and to send the output of a command to another, called redirection and pipelining, respectively. + +To understand those two important concepts, we must first understand the three most important types of I/O (Input and Output) streams (or sequences) of characters, which are in fact special files, in the *nix sense of the word. + +- Standard input (aka stdin) is by default attached to the keyboard. In other words, the keyboard is the standard input device to enter commands to the command line. +- Standard output (aka stdout) is by default attached to the screen, the device that “receives” the output of commands and display them on the screen. +- Standard error (aka stderr), is where the status messages of a command is sent to by default, which is also the screen. + +In the following example, the output of `ls /var` is sent to stdout (the screen), as well as the result of ls /tecmint. But in the latter case, it is stderr that is shown. + +![Linux input output redirect](http://www.tecmint.com/wp-content/uploads/2015/03/Linux-input-output-redirect.png) + +Input and Output Example + +To more easily identify these special files, they are each assigned a file descriptor, an abstract representation that is used to access them. The essential thing to understand is that these files, just like others, can be redirected. What this means is that you can capture the output from a file or script and send it as input to another file, command, or script. This will allow you to store on disk, for example, the output of commands for later processing or analysis. + +To redirect stdin (fd 0), stdout (fd 1), or stderr (fd 2), the following operators are available. + +注:表格 +
-

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

+

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

-

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

+

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

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Redirection OperatorEffect
>Redirects standard output to a file containing standard output. If the destination file exists, it will be overwritten.
>>Appends standard output to a file.
2>Redirects standard error to a file containing standard output. If the destination file exists, it will be overwritten.
2>>Appends standard error to the existing file.
&>Redirects both standard output and standard error to a file; if the specified file exists, it will be overwritten.
<Uses the specified file as standard input.
<>The specified file is used for both standard input and standard output.
+ +As opposed to redirection, pipelining is performed by adding a vertical bar `(|)` after a command and before another one. + +Remember: + +- Redirection is used to send the output of a command to a file, or to send a file as input to a command. +- Pipelining is used to send the output of a command to another command as input. + +#### Examples Of Redirection and Pipelining #### + +**Example 1: Redirecting the output of a command to a file** + +There will be times when you will need to iterate over a list of files. To do that, you can first save that list to a file and then read that file line by line. While it is true that you can iterate over the output of ls directly, this example serves to illustrate redirection. + + # ls -1 /var/mail > mail.txt + +![Redirect output of command tot a file](http://www.tecmint.com/wp-content/uploads/2015/03/Redirect-output-to-a-file.png) + +Redirect output of command tot a file + +**Example 2: Redirecting both stdout and stderr to /dev/null** + +In case we want to prevent both stdout and stderr to be displayed on the screen, we can redirect both file descriptors to `/dev/null`. Note how the output changes when the redirection is implemented for the same command. + + # ls /var /tecmint + # ls /var/ /tecmint &> /dev/null + +![Redirecting stdout and stderr ouput to /dev/null](http://www.tecmint.com/wp-content/uploads/2015/03/Redirecting-stdout-stderr-ouput.png) + +Redirecting stdout and stderr ouput to /dev/null + +#### Example 3: Using a file as input to a command #### + +While the classic syntax of the [cat command][2] is as follows. + + # cat [file(s)] + +You can also send a file as input, using the correct redirection operator. + + # cat < mail.txt + +![Linux cat command examples](http://www.tecmint.com/wp-content/uploads/2015/03/cat-command-examples.png) + +cat command example + +#### Example 4: Sending the output of a command as input to another #### + +If you have a large directory or process listing and want to be able to locate a certain file or process at a glance, you will want to pipeline the listing to grep. + +Note that we use to pipelines in the following example. The first one looks for the required keyword, while the second one will eliminate the actual `grep command` from the results. This example lists all the processes associated with the apache user. + + # ps -ef | grep apache | grep -v grep + +![Send output of command as input to another](http://www.tecmint.com/wp-content/uploads/2015/03/Send-output-of-command-as-input-to-another1.png) + +Send output of command as input to another + +### Archiving, Compressing, Unpacking, and Uncompressing Files ### + +If you need to transport, backup, or send via email a group of files, you will use an archiving (or grouping) tool such as [tar][3], typically used with a compression utility like gzip, bzip2, or xz. + +Your choice of a compression tool will be likely defined by the compression speed and rate of each one. Of these three compression tools, gzip is the oldest and provides the least compression, bzip2 provides improved compression, and xz is the newest and provides the best compression. Typically, files compressed with these utilities have .gz, .bz2, or .xz extensions, respectively. + +注:表格 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CommandAbbreviationDescription
–createcCreates a tar archive
–concatenateAAppends tar files to an archive
–appendrAppends non-tar files to an archive
–updateuAppends files that are newer than those in an archive
–diff or –comparedCompares an archive to files on disk
–listtLists the contents of a tarball
–extract or –getxExtracts files from an archive
+ +注:表格 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Operation modifierAbbreviationDescription
directory dir CChanges to directory dir before performing operations
same-permissions and same-owner pPreserves permissions and ownership information, respectively.
–verbose vLists all files as they are read or extracted; if combined with –list, it also displays file sizes, ownership, and timestamps
exclude fileExcludes file from the archive. In this case, file can be an actual file or a pattern.
gzip or gunzip zCompresses an archive through gzip
–bzip2 jCompresses an archive through bzip2
–xz JCompresses an archive through xz
+ +#### Example 5: Creating a tarball and then compressing it using the three compression utilities #### + +You may want to compare the effectiveness of each tool before deciding to use one or another. Note that while compressing small files, or a few files, the results may not show much differences, but may give you a glimpse of what they have to offer. + + # tar cf ApacheLogs-$(date +%Y%m%d).tar /var/log/httpd/* # Create an ordinary tarball + # tar czf ApacheLogs-$(date +%Y%m%d).tar.gz /var/log/httpd/* # Create a tarball and compress with gzip + # tar cjf ApacheLogs-$(date +%Y%m%d).tar.bz2 /var/log/httpd/* # Create a tarball and compress with bzip2 + # tar cJf ApacheLogs-$(date +%Y%m%d).tar.xz /var/log/httpd/* # Create a tarball and compress with xz + +![Linux tar command examples](http://www.tecmint.com/wp-content/uploads/2015/03/tar-command-examples.png) + +tar command examples + +#### Example 6: Preserving original permissions and ownership while archiving and when #### + +If you are creating backups from users’ home directories, you will want to store the individual files with the original permissions and ownership instead of changing them to that of the user account or daemon performing the backup. The following example preserves these attributes while taking the backup of the contents in the `/var/log/httpd` directory: + + # tar cJf ApacheLogs-$(date +%Y%m%d).tar.xz /var/log/httpd/* --same-permissions --same-owner + +### Create Hard and Soft Links ### + +In Linux, there are two types of links to files: hard links and soft (aka symbolic) links. Since a hard link represents another name for an existing file and is identified by the same inode, it then points to the actual data, as opposed to symbolic links, which point to filenames instead. + +In addition, hard links do not occupy space on disk, while symbolic links do take a small amount of space to store the text of the link itself. The downside of hard links is that they can only be used to reference files within the filesystem where they are located because inodes are unique inside a filesystem. Symbolic links save the day, in that they point to another file or directory by name rather than by inode, and therefore can cross filesystem boundaries. + +The basic syntax to create links is similar in both cases: + + # ln TARGET LINK_NAME # Hard link named LINK_NAME to file named TARGET + # ln -s TARGET LINK_NAME # Soft link named LINK_NAME to file named TARGET + +#### Example 7: Creating hard and soft links #### + +There is no better way to visualize the relation between a file and a hard or symbolic link that point to it, than to create those links. In the following screenshot you will see that the file and the hard link that points to it share the same inode and both are identified by the same disk usage of 466 bytes. + +On the other hand, creating a hard link results in an extra disk usage of 5 bytes. Not that you’re going to run out of storage capacity, but this example is enough to illustrate the difference between a hard link and a soft link. + +![Difference between a hard link and a soft link](http://www.tecmint.com/wp-content/uploads/2015/03/hard-soft-link.png) + +Difference between a hard link and a soft link + +A typical usage of symbolic links is to reference a versioned file in a Linux system. Suppose there are several programs that need access to file fooX.Y, which is subject to frequent version updates (think of a library, for example). Instead of updating every single reference to fooX.Y every time there’s a version update, it is wiser, safer, and faster, to have programs look to a symbolic link named just foo, which in turn points to the actual fooX.Y. + +Thus, when X and Y change, you only need to edit the symbolic link foo with a new destination name instead of tracking every usage of the destination file and updating it. + +### Summary ### + +In this article we have reviewed some essential file and directory management skills that must be a part of every system administrator’s tool-set. Make sure to review other parts of this series as well in order to integrate these topics with the content covered in this tutorial. + +Feel free to let us know if you have any questions or comments. We are always more than glad to hear from our readers. + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/file-and-directory-management-in-linux/ + +作者:[Gabriel Cánepa][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/gacanepa/ +[1]:http://www.tecmint.com/8-pratical-examples-of-linux-touch-command/ +[2]:http://www.tecmint.com/13-basic-cat-command-examples-in-linux/ +[3]:http://www.tecmint.com/18-tar-command-examples-in-linux/ \ No newline at end of file diff --git a/sources/tech/RHCSA Series/RHCSA Series--Part 03--How to Manage Users and Groups in RHEL 7.md b/sources/tech/RHCSA Series/RHCSA Series--Part 03--How to Manage Users and Groups in RHEL 7.md new file mode 100644 index 0000000000..be78c87e3a --- /dev/null +++ b/sources/tech/RHCSA Series/RHCSA Series--Part 03--How to Manage Users and Groups in RHEL 7.md @@ -0,0 +1,248 @@ +RHCSA Series: How to Manage Users and Groups in RHEL 7 – Part 3 +================================================================================ +Managing a RHEL 7 server, as it is the case with any other Linux server, will require that you know how to add, edit, suspend, or delete user accounts, and grant users the necessary permissions to files, directories, and other system resources to perform their assigned tasks. + +![User and Group Management in Linux](http://www.tecmint.com/wp-content/uploads/2015/03/User-and-Group-Management-in-Linux.png) + +RHCSA: User and Group Management – Part 3 + +### Managing User Accounts ### + +To add a new user account to a RHEL 7 server, you can run either of the following two commands as root: + + # adduser [new_account] + # useradd [new_account] + +When a new user account is added, by default the following operations are performed. + +- His/her home directory is created (`/home/username` unless specified otherwise). +- These `.bash_logout`, `.bash_profile` and `.bashrc` hidden files are copied inside the user’s home directory, and will be used to provide environment variables for his/her user session. You can explore each of them for further details. +- A mail spool directory is created for the added user account. +- A group is created with the same name as the new user account. + +The full account summary is stored in the `/etc/passwd `file. This file holds a record per system user account and has the following format (fields are separated by a colon): + + [username]:[x]:[UID]:[GID]:[Comment]:[Home directory]:[Default shell] + +- These two fields `[username]` and `[Comment]` are self explanatory. +- The second filed ‘x’ indicates that the account is secured by a shadowed password (in `/etc/shadow`), which is used to logon as `[username]`. +- The fields `[UID]` and `[GID]` are integers that shows the User IDentification and the primary Group IDentification to which `[username]` belongs, equally. + +Finally, + +- The `[Home directory]` shows the absolute location of `[username]’s` home directory, and +- `[Default shell]` is the shell that is commit to this user when he/she logins into the system. + +Another important file that you must become familiar with is `/etc/group`, where group information is stored. As it is the case with `/etc/passwd`, there is one record per line and its fields are also delimited by a colon: + + [Group name]:[Group password]:[GID]:[Group members] + +where, + +- `[Group name]` is the name of group. +- Does this group use a group password? (An “x” means no). +- `[GID]`: same as in `/etc/passwd`. +- `[Group members]`: a list of users, separated by commas, that are members of each group. + +After adding an account, at anytime, you can edit the user’s account information using usermod, whose basic syntax is: + + # usermod [options] [username] + +Read Also: + +- [15 ‘useradd’ Command Examples][1] +- [15 ‘usermod’ Command Examples][2] + +#### EXAMPLE 1: Setting the expiry date for an account #### + +If you work for a company that has some kind of policy to enable account for a certain interval of time, or if you want to grant access to a limited period of time, you can use the `--expiredate` flag followed by a date in YYYY-MM-DD format. To verify that the change has been applied, you can compare the output of + + # chage -l [username] + +before and after updating the account expiry date, as shown in the following image. + +![Change User Account Information](http://www.tecmint.com/wp-content/uploads/2015/03/Change-User-Account-Information.png) + +Change User Account Information + +#### EXAMPLE 2: Adding the user to supplementary groups #### + +Besides the primary group that is created when a new user account is added to the system, a user can be added to supplementary groups using the combined -aG, or –append –groups options, followed by a comma separated list of groups. + +#### EXAMPLE 3: Changing the default location of the user’s home directory and / or changing its shell #### + +If for some reason you need to change the default location of the user’s home directory (other than /home/username), you will need to use the -d, or –home options, followed by the absolute path to the new home directory. + +If a user wants to use another shell other than bash (for example, sh), which gets assigned by default, use usermod with the –shell flag, followed by the path to the new shell. + +#### EXAMPLE 4: Displaying the groups an user is a member of #### + +After adding the user to a supplementary group, you can verify that it now actually belongs to such group(s): + + # groups [username] + # id [username] + +The following image depicts Examples 2 through 4: + +![Adding User to Supplementary Group](http://www.tecmint.com/wp-content/uploads/2015/03/Adding-User-to-Supplementary-Group.png) + +Adding User to Supplementary Group + +In the example above: + + # usermod --append --groups gacanepa,users --home /tmp --shell /bin/sh tecmint + +To remove a user from a group, omit the `--append` switch in the command above and list the groups you want the user to belong to following the `--groups` flag. + +#### EXAMPLE 5: Disabling account by locking password #### + +To disable an account, you will need to use either the -l (lowercase L) or the –lock option to lock a user’s password. This will prevent the user from being able to log on. + +#### EXAMPLE 6: Unlocking password #### + +When you need to re-enable the user so that he can log on to the server again, use the -u or the –unlock option to unlock a user’s password that was previously blocked, as explained in Example 5 above. + + # usermod --unlock tecmint + +The following image illustrates Examples 5 and 6: + +![Lock Unlock User Account](http://www.tecmint.com/wp-content/uploads/2015/03/Lock-Unlock-User-Account.png) + +Lock Unlock User Account + +#### EXAMPLE 7: Deleting a group or an user account #### + +To delete a group, you’ll want to use groupdel, whereas to delete a user account you will use userdel (add the –r switch if you also want to delete the contents of its home directory and mail spool): + + # groupdel [group_name] # Delete a group + # userdel -r [user_name] # Remove user_name from the system, along with his/her home directory and mail spool + +If there are files owned by group_name, they will not be deleted, but the group owner will be set to the GID of the group that was deleted. + +### Listing, Setting and Changing Standard ugo/rwx Permissions ### + +The well-known [ls command][3] is one of the best friends of any system administrator. When used with the -l flag, this tool allows you to view a list a directory’s contents in long (or detailed) format. + +However, this command can also be applied to a single file. Either way, the first 10 characters in the output of `ls -l` represent each file’s attributes. + +The first char of this 10-character sequence is used to indicate the file type: + +- – (hyphen): a regular file +- d: a directory +- l: a symbolic link +- c: a character device (which treats data as a stream of bytes, i.e. a terminal) +- b: a block device (which handles data in blocks, i.e. storage devices) + +The next nine characters of the file attributes, divided in groups of three from left to right, are called the file mode and indicate the read (r), write(w), and execute (x) permissions granted to the file’s owner, the file’s group owner, and the rest of the users (commonly referred to as “the world”), respectively. + +While the read permission on a file allows the same to be opened and read, the same permission on a directory allows its contents to be listed if the execute permission is also set. In addition, the execute permission in a file allows it to be handled as a program and run. + +File permissions are changed with the chmod command, whose basic syntax is as follows: + + # chmod [new_mode] file + +where new_mode is either an octal number or an expression that specifies the new permissions. Feel free to use the mode that works best for you in each case. Or perhaps you already have a preferred way to set a file’s permissions – so feel free to use the method that works best for you. + +The octal number can be calculated based on the binary equivalent, which can in turn be obtained from the desired file permissions for the owner of the file, the owner group, and the world.The presence of a certain permission equals a power of 2 (r=22, w=21, x=20), while its absence means 0. For example: + +![File Permissions](http://www.tecmint.com/wp-content/uploads/2015/03/File-Permissions.png) + +File Permissions + +To set the file’s permissions as indicated above in octal form, type: + + # chmod 744 myfile + +Please take a minute to compare our previous calculation to the actual output of `ls -l` after changing the file’s permissions: + +![Long List Format](http://www.tecmint.com/wp-content/uploads/2015/03/Long-List-Format.png) + +Long List Format + +#### EXAMPLE 8: Searching for files with 777 permissions #### + +As a security measure, you should make sure that files with 777 permissions (read, write, and execute for everyone) are avoided like the plague under normal circumstances. Although we will explain in a later tutorial how to more effectively locate all the files in your system with a certain permission set, you can -by now- combine ls with grep to obtain such information. + +In the following example, we will look for file with 777 permissions in the /etc directory only. Note that we will use pipelining as explained in [Part 2: File and Directory Management][4] of this RHCSA series: + + # ls -l /etc | grep rwxrwxrwx + +![Find All Files with 777 Permission](http://www.tecmint.com/wp-content/uploads/2015/03/Find-All-777-Files.png) + +Find All Files with 777 Permission + +#### EXAMPLE 9: Assigning a specific permission to all users #### + +Shell scripts, along with some binaries that all users should have access to (not just their corresponding owner and group), should have the execute bit set accordingly (please note that we will discuss a special case later): + + # chmod a+x script.sh + +**Note**: That we can also set a file’s mode using an expression that indicates the owner’s rights with the letter `u`, the group owner’s rights with the letter `g`, and the rest with `o`. All of these rights can be represented at the same time with the letter `a`. Permissions are granted (or revoked) with the `+` or `-` signs, respectively. + +![Set Execute Permission on File](http://www.tecmint.com/wp-content/uploads/2015/03/Set-Execute-Permission-on-File.png) + +Set Execute Permission on File + +A long directory listing also shows the file’s owner and its group owner in the first and second columns, respectively. This feature serves as a first-level access control method to files in a system: + +![Check File Owner and Group](http://www.tecmint.com/wp-content/uploads/2015/03/Check-File-Owner-and-Group.png) + +Check File Owner and Group + +To change file ownership, you will use the chown command. Note that you can change the file and group ownership at the same time or separately: + + # chown user:group file + +**Note**: That you can change the user or group, or the two attributes at the same time, as long as you don’t forget the colon, leaving user or group blank if you want to update the other attribute, for example: + + # chown :group file # Change group ownership only + # chown user: file # Change user ownership only + +#### EXAMPLE 10: Cloning permissions from one file to another #### + +If you would like to “clone” ownership from one file to another, you can do so using the –reference flag, as follows: + + # chown --reference=ref_file file + +where the owner and group of ref_file will be assigned to file as well: + +![Clone File Ownership](http://www.tecmint.com/wp-content/uploads/2015/03/Clone-File-Ownership.png) + +Clone File Ownership + +### Setting Up SETGID Directories for Collaboration ### + +Should you need to grant access to all the files owned by a certain group inside a specific directory, you will most likely use the approach of setting the setgid bit for such directory. When the setgid bit is set, the effective GID of the real user becomes that of the group owner. + +Thus, any user can access a file under the privileges granted to the group owner of such file. In addition, when the setgid bit is set on a directory, newly created files inherit the same group as the directory, and newly created subdirectories will also inherit the setgid bit of the parent directory. + + # chmod g+s [filename] + +To set the setgid in octal form, prepend the number 2 to the current (or desired) basic permissions. + + # chmod 2755 [directory] + +### Conclusion ### + +A solid knowledge of user and group management, along with standard and special Linux permissions, when coupled with practice, will allow you to quickly identify and troubleshoot issues with file permissions in your RHEL 7 server. + +I assure you that as you follow the steps outlined in this article and use the system documentation (as explained in [Part 1: Reviewing Essential Commands & System Documentation][5] of this series) you will master this essential competence of system administration. + +Feel free to let us know if you have any questions or comments using the form below. + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/rhcsa-exam-manage-users-and-groups/ + +作者:[Gabriel Cánepa][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/gacanepa/ +[1]:http://www.tecmint.com/add-users-in-linux/ +[2]:http://www.tecmint.com/usermod-command-examples/ +[3]:http://www.tecmint.com/ls-interview-questions/ +[4]:http://www.tecmint.com/file-and-directory-management-in-linux/ +[5]:http://www.tecmint.com/rhcsa-exam-reviewing-essential-commands-system-documentation/ \ No newline at end of file diff --git a/sources/tech/RHCSA Series/RHCSA Series--Part 04--Editing Text Files with Nano and Vim or Analyzing text with grep and regexps.md b/sources/tech/RHCSA Series/RHCSA Series--Part 04--Editing Text Files with Nano and Vim or Analyzing text with grep and regexps.md new file mode 100644 index 0000000000..1529fecf2e --- /dev/null +++ b/sources/tech/RHCSA Series/RHCSA Series--Part 04--Editing Text Files with Nano and Vim or Analyzing text with grep and regexps.md @@ -0,0 +1,254 @@ +RHCSA Series: Editing Text Files with Nano and Vim / Analyzing text with grep and regexps – Part 4 +================================================================================ +Every system administrator has to deal with text files as part of his daily responsibilities. That includes editing existing files (most likely configuration files), or creating new ones. It has been said that if you want to start a holy war in the Linux world, you can ask sysadmins what their favorite text editor is and why. We are not going to do that in this article, but will present a few tips that will be helpful to use two of the most widely used text editors in RHEL 7: nano (due to its simplicity and easiness of use, specially to new users), and vi/m (due to its several features that convert it into more than a simple editor). I am sure that you can find many more reasons to use one or the other, or perhaps some other editor such as emacs or pico. It’s entirely up to you. + +![Learn Nano and vi Editors](http://www.tecmint.com/wp-content/uploads/2015/03/Learn-Nano-and-vi-Editors.png) + +RHCSA: Editing Text Files with Nano and Vim – Part 4 + +### Editing Files with Nano Editor ### + +To launch nano, you can either just type nano at the command prompt, optionally followed by a filename (in this case, if the file exists, it will be opened in edition mode). If the file does not exist, or if we omit the filename, nano will also be opened in edition mode but will present a blank screen for us to start typing: + +![Nano Editor](http://www.tecmint.com/wp-content/uploads/2015/03/Nano-Editor.png) + +Nano Editor + +As you can see in the previous image, nano displays at the bottom of the screen several functions that are available via the indicated shortcuts (^, aka caret, indicates the Ctrl key). To name a few of them: + +- Ctrl + G: brings up the help menu with a complete list of functions and descriptions:Ctrl + X: exits the current file. If changes have not been saved, they are discarded. +- Ctrl + R: lets you choose a file to insert its contents into the present file by specifying a full path. + +![Nano Editor Help Menu](http://www.tecmint.com/wp-content/uploads/2015/03/Nano-Help.png) + +Nano Editor Help Menu + +- Ctrl + O: saves changes made to a file. It will let you save the file with the same name or a different one. Then press Enter to confirm. + +![Nano Editor Save Changes Mode](http://www.tecmint.com/wp-content/uploads/2015/03/Nano-Save-Changes.png) + +Nano Editor Save Changes Mode + +- Ctrl + X: exits the current file. If changes have not been saved, they are discarded. +- Ctrl + R: lets you choose a file to insert its contents into the present file by specifying a full path. + +![Nano: Insert File Content to Parent File](http://www.tecmint.com/wp-content/uploads/2015/03/Insert-File-Content.png) + +Nano: Insert File Content to Parent File + +will insert the contents of /etc/passwd into the current file. + +- Ctrl + K: cuts the current line. +- Ctrl + U: paste. +- Ctrl + C: cancels the current operation and places you at the previous screen. + +To easily navigate the opened file, nano provides the following features: + +- Ctrl + F and Ctrl + B move the cursor forward or backward, whereas Ctrl + P and Ctrl + N move it up or down one line at a time, respectively, just like the arrow keys. +- Ctrl + space and Alt + space move the cursor forward and backward one word at a time. + +Finally, + +- Ctrl + _ (underscore) and then entering X,Y will take you precisely to Line X, column Y, if you want to place the cursor at a specific place in the document. + +![Navigate to Line Numbers in Nano](http://www.tecmint.com/wp-content/uploads/2015/03/Column-Numbers.png) + +Navigate to Line Numbers in Nano + +The example above will take you to line 15, column 14 in the current document. + +If you can recall your early Linux days, specially if you came from Windows, you will probably agree that starting off with nano is the best way to go for a new user. + +### Editing Files with Vim Editor ### + +Vim is an improved version of vi, a famous text editor in Linux that is available on all POSIX-compliant *nix systems, such as RHEL 7. If you have the chance and can install vim, go ahead; if not, most (if not all) the tips given in this article should also work. + +One of vim’s distinguishing features is the different modes in which it operates: + + +- Command mode will allow you to browse through the file and enter commands, which are brief and case-sensitive combinations of one or more letters. If you need to repeat one of them a certain number of times, you can prefix it with a number (there are only a few exceptions to this rule). For example, yy (or Y, short for yank) copies the entire current line, whereas 4yy (or 4Y) copies the entire current line along with the next three lines (4 lines in total). +- In ex mode, you can manipulate files (including saving a current file and running outside programs or commands). To enter ex mode, we must type a colon (:) starting from command mode (or in other words, Esc + :), directly followed by the name of the ex-mode command that you want to use. +- In insert mode, which is accessed by typing the letter i, we simply enter text. Most keystrokes result in text appearing on the screen. +- We can always enter command mode (regardless of the mode we’re working on) by pressing the Esc key. + +Let’s see how we can perform the same operations that we outlined for nano in the previous section, but now with vim. Don’t forget to hit the Enter key to confirm the vim command! + +To access vim’s full manual from the command line, type :help while in command mode and then press Enter: + +![vim Edito Help Menu](http://www.tecmint.com/wp-content/uploads/2015/03/vim-Help-Menu.png) + +vim Edito Help Menu + +The upper section presents an index list of contents, with defined sections dedicated to specific topics about vim. To navigate to a section, place the cursor over it and press Ctrl + ] (closing square bracket). Note that the bottom section displays the current file. + +1. To save changes made to a file, run any of the following commands from command mode and it will do the trick: + + :wq! + :x! + ZZ (yes, double Z without the colon at the beginning) + +2. To exit discarding changes, use :q!. This command will also allow you to exit the help menu described above, and return to the current file in command mode. + +3. Cut N number of lines: type Ndd while in command mode. + +4. Copy M number of lines: type Myy while in command mode. + +5. Paste lines that were previously cutted or copied: press the P key while in command mode. + +6. To insert the contents of another file into the current one: + + :r filename + +For example, to insert the contents of `/etc/fstab`, do: + +![Insert Content of File in vi Editor](http://www.tecmint.com/wp-content/uploads/2015/03/Insert-Content-vi-Editor.png) + +Insert Content of File in vi Editor + +7. To insert the output of a command into the current document: + + :r! command + +For example, to insert the date and time in the line below the current position of the cursor: + +![Insert Time an Date in vi Editor](http://www.tecmint.com/wp-content/uploads/2015/03/Insert-Time-and-Date-in-vi-Editor.png) + +Insert Time an Date in vi Editor + +In another article that I wrote for, ([Part 2 of the LFCS series][1]), I explained in greater detail the keyboard shortcuts and functions available in vim. You may want to refer to that tutorial for further examples on how to use this powerful text editor. + +### Analyzing Text with Grep and Regular Expressions ### + +By now you have learned how to create and edit files using nano or vim. Say you become a text editor ninja, so to speak – now what? Among other things, you will also need how to search for regular expressions inside text. + +A regular expression (also known as “regex” or “regexp“) is a way of identifying a text string or pattern so that a program can compare the pattern against arbitrary text strings. Although the use of regular expressions along with grep would deserve an entire article on its own, let us review the basics here: + +**1. The simplest regular expression is an alphanumeric string (i.e., the word “svm”) or two (when two are present, you can use the | (OR) operator):** + + # grep -Ei 'svm|vmx' /proc/cpuinfo + +The presence of either of those two strings indicate that your processor supports virtualization: + +![Regular Expression Example](http://www.tecmint.com/wp-content/uploads/2015/03/Regular-Expression-Example.png) + +Regular Expression Example + +**2. A second kind of a regular expression is a range list, enclosed between square brackets.** + +For example, `c[aeiou]t` matches the strings cat, cet, cit, cot, and cut, whereas `[a-z]` and `[0-9]` match any lowercase letter or decimal digit, respectively. If you want to repeat the regular expression X certain number of times, type `{X}` immediately following the regexp. + +For example, let’s extract the UUIDs of storage devices from `/etc/fstab`: + + # grep -Ei '[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}' -o /etc/fstab + +![Extract String from a File in Linux](http://www.tecmint.com/wp-content/uploads/2015/03/Extract-String-from-a-File.png) + +Extract String from a File + +The first expression in brackets `[0-9a-f]` is used to denote lowercase hexadecimal characters, and `{8}` is a quantifier that indicates the number of times that the preceding match should be repeated (the first sequence of characters in an UUID is a 8-character long hexadecimal string). + +The parentheses, the `{4}` quantifier, and the hyphen indicate that the next sequence is a 4-character long hexadecimal string, and the quantifier that follows `({3})` denote that the expression should be repeated 3 times. + +Finally, the last sequence of 12-character long hexadecimal string in the UUID is retrieved with `[0-9a-f]{12}`, and the -o option prints only the matched (non-empty) parts of the matching line in /etc/fstab. + +**3. POSIX character classes.** + +注:表格 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Character ClassMatches…
 [[:alnum:]] Any alphanumeric [a-zA-Z0-9] character
 [[:alpha:]] Any alphabetic [a-zA-Z] character
 [[:blank:]] Spaces or tabs
 [[:cntrl:]] Any control characters (ASCII 0 to 32)
 [[:digit:]] Any numeric digits [0-9]
 [[:graph:]] Any visible characters
 [[:lower:]] Any lowercase [a-z] character
 [[:print:]] Any non-control characters
 [[:space:]] Any whitespace
 [[:punct:]] Any punctuation marks
 [[:upper:]] Any uppercase [A-Z] character
 [[:xdigit:]] Any hex digits [0-9a-fA-F]
 [:word:] Any letters, numbers, and underscores [a-zA-Z0-9_]
+ +For example, we may be interested in finding out what the used UIDs and GIDs (refer to [Part 2][2] of this series to refresh your memory) are for real users that have been added to our system. Thus, we will search for sequences of 4 digits in /etc/passwd: + + # grep -Ei [[:digit:]]{4} /etc/passwd + +![Search For a String in File](http://www.tecmint.com/wp-content/uploads/2015/03/Search-For-String-in-File.png) + +Search For a String in File + +The above example may not be the best case of use of regular expressions in the real world, but it clearly illustrates how to use POSIX character classes to analyze text along with grep. + +### Conclusion ### + +In this article we have provided some tips to make the most of nano and vim, two text editors for the command-line users. Both tools are supported by extensive documentation, which you can consult in their respective official web sites (links given below) and using the suggestions given in [Part 1][3] of this series. + +#### Reference Links #### + +- [http://www.nano-editor.org/][4] +- [http://www.vim.org/][5] + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/rhcsa-exam-how-to-use-nano-vi-editors/ + +作者:[Gabriel Cánepa][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/gacanepa/ +[1]:http://www.tecmint.com/vi-editor-usage/ +[2]:http://www.tecmint.com/file-and-directory-management-in-linux/ +[3]:http://www.tecmint.com/rhcsa-exam-reviewing-essential-commands-system-documentation/ +[4]:http://www.nano-editor.org/ +[5]:http://www.vim.org/ \ No newline at end of file diff --git a/sources/tech/RHCSA Series/RHCSA Series--Part 05--Process Management in RHEL 7--Boot Shutdown and Everything in Between.md b/sources/tech/RHCSA Series/RHCSA Series--Part 05--Process Management in RHEL 7--Boot Shutdown and Everything in Between.md new file mode 100644 index 0000000000..2befb7bc55 --- /dev/null +++ b/sources/tech/RHCSA Series/RHCSA Series--Part 05--Process Management in RHEL 7--Boot Shutdown and Everything in Between.md @@ -0,0 +1,216 @@ +RHCSA Series: Process Management in RHEL 7: Boot, Shutdown, and Everything in Between – Part 5 +================================================================================ +We will start this article with an overall and brief revision of what happens since the moment you press the Power button to turn on your RHEL 7 server until you are presented with the login screen in a command line interface. + +![RHEL 7 Boot Process](http://www.tecmint.com/wp-content/uploads/2015/03/RHEL-7-Boot-Process.png) + +Linux Boot Process + +**Please note that:** + +1. the same basic principles apply, with perhaps minor modifications, to other Linux distributions as well, and +2. the following description is not intended to represent an exhaustive explanation of the boot process, but only the fundamentals. + +### Linux Boot Process ### + +1. The POST (Power On Self Test) initializes and performs hardware checks. + +2. When the POST finishes, the system control is passed to the first stage boot loader, which is stored on either the boot sector of one of the hard disks (for older systems using BIOS and MBR), or a dedicated (U)EFI partition. + +3. The first stage boot loader then loads the second stage boot loader, most usually GRUB (GRand Unified Boot Loader), which resides inside /boot, which in turn loads the kernel and the initial RAM–based file system (also known as initramfs, which contains programs and binary files that perform the necessary actions needed to ultimately mount the actual root filesystem). + +4. We are presented with a splash screen that allows us to choose an operating system and kernel to boot: + +![RHEL 7 Boot Screen](http://www.tecmint.com/wp-content/uploads/2015/03/RHEL-7-Boot-Screen.png) + +Boot Menu Screen + +5. The kernel sets up the hardware attached to the system and once the root filesystem has been mounted, launches process with PID 1, which in turn will initialize other processes and present us with a login prompt. + +Note: That if we wish to do so at a later time, we can examine the specifics of this process using the [dmesg command][1] and filtering its output using the tools that we have explained in previous articles of this series. + +![Login Screen and Process PID](http://www.tecmint.com/wp-content/uploads/2015/03/Login-Screen-Process-PID.png) + +Login Screen and Process PID + +In the example above, we used the well-known ps command to display a list of current processes whose parent process (or in other words, the process that started them) is systemd (the system and service manager that most modern Linux distributions have switched to) during system startup: + + # ps -o ppid,pid,uname,comm --ppid=1 + +Remember that the -o flag (short for –format) allows you to present the output of ps in a customized format to suit your needs using the keywords specified in the STANDARD FORMAT SPECIFIERS section in man ps. + +Another case in which you will want to define the output of ps instead of going with the default is when you need to find processes that are causing a significant CPU and / or memory load, and sort them accordingly: + + # ps aux --sort=+pcpu # Sort by %CPU (ascending) + # ps aux --sort=-pcpu # Sort by %CPU (descending) + # ps aux --sort=+pmem # Sort by %MEM (ascending) + # ps aux --sort=-pmem # Sort by %MEM (descending) + # ps aux --sort=+pcpu,-pmem # Combine sort by %CPU (ascending) and %MEM (descending) + +![http://www.tecmint.com/wp-content/uploads/2015/03/ps-command-output.png](http://www.tecmint.com/wp-content/uploads/2015/03/ps-command-output.png) + +Customize ps Command Output + +### An Introduction to SystemD ### + +Few decisions in the Linux world have caused more controversies than the adoption of systemd by major Linux distributions. Systemd’s advocates name as its main advantages the following facts: + +Read Also: [The Story Behind ‘init’ and ‘systemd’][2] + +1. Systemd allows more processing to be done in parallel during system startup (as opposed to older SysVinit, which always tends to be slower because it starts processes one by one, checks if one depends on another, and then waits for daemons to launch so more services can start), and + +2. It works as a dynamic resource management in a running system. Thus, services are started when needed (to avoid consuming system resources if they are not being used) instead of being launched without a valid reason during boot. + +3. Backwards compatibility with SysVinit scripts. + +Systemd is controlled by the systemctl utility. If you come from a SysVinit background, chances are you will be familiar with: + +- the service tool, which -in those older systems- was used to manage SysVinit scripts, and +- the chkconfig utility, which served the purpose of updating and querying runlevel information for system services. +- shutdown, which you must have used several times to either restart or halt a running system. + +The following table shows the similarities between the use of these legacy tools and systemctl: + +注:表格 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Legacy toolSystemctl equivalentDescription
service name startsystemctl start nameStart name (where name is a service)
service name stopsystemctl stop nameStop name
service name condrestartsystemctl try-restart nameRestarts name (if it’s already running)
service name restartsystemctl restart nameRestarts name
service name reloadsystemctl reload nameReloads the configuration for name
service name statussystemctl status nameDisplays the current status of name
service –status-allsystemctlDisplays the status of all current services
chkconfig name onsystemctl enable nameEnable name to run on startup as specified in the unit file (the file to which the symlink points). The process of enabling or disabling a service to start automatically on boot consists in adding or removing symbolic links inside the /etc/systemd/system directory.
chkconfig name offsystemctl disable nameDisables name to run on startup as specified in the unit file (the file to which the symlink points)
chkconfig –list namesystemctl is-enabled nameVerify whether name (a specific service) is currently enabled
chkconfig –listsystemctl –type=serviceDisplays all services and tells whether they are enabled or disabled
shutdown -h nowsystemctl poweroffPower-off the machine (halt)
shutdown -r nowsystemctl rebootReboot the system
+ +Systemd also introduced the concepts of units (which can be either a service, a mount point, a device, or a network socket) and targets (which is how systemd manages to start several related process at the same time, and can be considered -though not equal- as the equivalent of runlevels in SysVinit-based systems. + +### Summing Up ### + +Other tasks related with process management include, but may not be limited to, the ability to: + +**1. Adjust the execution priority as far as the use of system resources is concerned of a process:** + +This is accomplished through the renice utility, which alters the scheduling priority of one or more running processes. In simple terms, the scheduling priority is a feature that allows the kernel (present in versions => 2.6) to allocate system resources as per the assigned execution priority (aka niceness, in a range from -20 through 19) of a given process. + +The basic syntax of renice is as follows: + + # renice [-n] priority [-gpu] identifier + +In the generic command above, the first argument is the priority value to be used, whereas the other argument can be interpreted as process IDs (which is the default setting), process group IDs, user IDs, or user names. A normal user (other than root) can only modify the scheduling priority of a process he or she owns, and only increase the niceness level (which means taking up less system resources). + +![Renice Process in Linux](http://www.tecmint.com/wp-content/uploads/2015/03/Process-Scheduling-Priority.png) + +Process Scheduling Priority + +**2. Kill (or interrupt the normal execution) of a process as needed:** + +In more precise terms, killing a process entitles sending it a signal to either finish its execution gracefully (SIGTERM=15) or immediately (SIGKILL=9) through the [kill or pkill commands][3]. + +The difference between these two tools is that the former is used to terminate a specific process or a process group altogether, while the latter allows you to do the same based on name and other attributes. + +In addition, pkill comes bundled with pgrep, which shows you the PIDs that will be affected should pkill be used. For example, before running: + + # pkill -u gacanepa + +It may be useful to view at a glance which are the PIDs owned by gacanepa: + + # pgrep -l -u gacanepa + +![Find PIDs of User](http://www.tecmint.com/wp-content/uploads/2015/03/Find-PIDs-of-User.png) + +Find PIDs of User + +By default, both kill and pkill send the SIGTERM signal to the process. As we mentioned above, this signal can be ignored (while the process finishes its execution or for good), so when you seriously need to stop a running process with a valid reason, you will need to specify the SIGKILL signal on the command line: + + # kill -9 identifier # Kill a process or a process group + # kill -s SIGNAL identifier # Idem + # pkill -s SIGNAL identifier # Kill a process by name or other attributes + +### Conclusion ### + +In this article we have explained the basics of the boot process in a RHEL 7 system, and analyzed some of the tools that are available to help you with managing processes using common utilities and systemd-specific commands. + +Note that this list is not intended to cover all the bells and whistles of this topic, so feel free to add your own preferred tools and commands to this article using the comment form below. Questions and other comments are also welcome. + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/rhcsa-exam-boot-process-and-process-management/ + +作者:[Gabriel Cánepa][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/gacanepa/ +[1]:http://www.tecmint.com/dmesg-commands/ +[2]:http://www.tecmint.com/systemd-replaces-init-in-linux/ +[3]:http://www.tecmint.com/how-to-kill-a-process-in-linux/ \ No newline at end of file diff --git a/sources/tech/RHCSA Series/RHCSA Series--Part 06--Using 'Parted' and 'SSM' to Configure and Encrypt System Storage.md b/sources/tech/RHCSA Series/RHCSA Series--Part 06--Using 'Parted' and 'SSM' to Configure and Encrypt System Storage.md new file mode 100644 index 0000000000..474b707d23 --- /dev/null +++ b/sources/tech/RHCSA Series/RHCSA Series--Part 06--Using 'Parted' and 'SSM' to Configure and Encrypt System Storage.md @@ -0,0 +1,269 @@ +RHCSA Series: Using ‘Parted’ and ‘SSM’ to Configure and Encrypt System Storage – Part 6 +================================================================================ +In this article we will discuss how to set up and configure local system storage in Red Hat Enterprise Linux 7 using classic tools and introducing the System Storage Manager (also known as SSM), which greatly simplifies this task. + +![Configure and Encrypt System Storage](http://www.tecmint.com/wp-content/uploads/2015/04/Configure-and-Encrypt-System-Storage.png) + +RHCSA: Configure and Encrypt System Storage – Part 6 + +Please note that we will present this topic in this article but will continue its description and usage on the next one (Part 7) due to vastness of the subject. + +### Creating and Modifying Partitions in RHEL 7 ### + +In RHEL 7, parted is the default utility to work with partitions, and will allow you to: + +- Display the current partition table +- Manipulate (increase or decrease the size of) existing partitions +- Create partitions using free space or additional physical storage devices + +It is recommended that before attempting the creation of a new partition or the modification of an existing one, you should ensure that none of the partitions on the device are in use (`umount /dev/partition`), and if you’re using part of the device as swap you need to disable it (`swapoff -v /dev/partition`) during the process. + +The easiest way to do this is to boot RHEL in rescue mode using an installation media such as a RHEL 7 installation DVD or USB (Troubleshooting → Rescue a Red Hat Enterprise Linux system) and Select Skip when you’re prompted to choose an option to mount the existing Linux installation, and you will be presented with a command prompt where you can start typing the same commands as shown as follows during the creation of an ordinary partition in a physical device that is not being used. + +![RHEL 7 Rescue Mode](http://www.tecmint.com/wp-content/uploads/2015/04/RHEL-7-Rescue-Mode.png) + +RHEL 7 Rescue Mode + +To start parted, simply type. + + # parted /dev/sdb + +Where `/dev/sdb` is the device where you will create the new partition; next, type print to display the current drive’s partition table: + +![Creat New Partition](http://www.tecmint.com/wp-content/uploads/2015/04/Create-New-Partition.png) + +Creat New Partition + +As you can see, in this example we are using a virtual drive of 5 GB. We will now proceed to create a 4 GB primary partition and then format it with the xfs filesystem, which is the default in RHEL 7. + +You can choose from a variety of file systems. You will need to manually create the partition with mkpart and then format it with mkfs.fstype as usual because mkpart does not support many modern filesystems out-of-the-box. + +In the following example we will set a label for the device and then create a primary partition `(p)` on `/dev/sdb`, which starts at the 0% percentage of the device and ends at 4000 MB (4 GB): + +![Set Partition Name in Linux](http://www.tecmint.com/wp-content/uploads/2015/04/Label-Partition.png) + +Label Partition Name + +Next, we will format the partition as xfs and print the partition table again to verify that changes were applied: + + # mkfs.xfs /dev/sdb1 + # parted /dev/sdb print + +![Format Partition in Linux](http://www.tecmint.com/wp-content/uploads/2015/04/Format-Partition-in-Linux.png) + +Format Partition as XFS Filesystem + +For older filesystems, you could use the resize command in parted to resize a partition. Unfortunately, this only applies to ext2, fat16, fat32, hfs, linux-swap, and reiserfs (if libreiserfs is installed). + +Thus, the only way to resize a partition is by deleting it and creating it again (so make sure you have a good backup of your data!). No wonder the default partitioning scheme in RHEL 7 is based on LVM. + +To remove a partition with parted: + + # parted /dev/sdb print + # parted /dev/sdb rm 1 + +![Remove Partition in Linux](http://www.tecmint.com/wp-content/uploads/2015/04/Remove-Partition-in-Linux.png) + +Remove or Delete Partition + +### The Logical Volume Manager (LVM) ### + +Once a disk has been partitioned, it can be difficult or risky to change the partition sizes. For that reason, if we plan on resizing the partitions on our system, we should consider the possibility of using LVM instead of the classic partitioning system, where several physical devices can form a volume group that will host a defined number of logical volumes, which can be expanded or reduced without any hassle. + +In simple terms, you may find the following diagram useful to remember the basic architecture of LVM. + +![Basic Architecture of LVM](http://www.tecmint.com/wp-content/uploads/2015/04/LVM-Diagram.png) + +Basic Architecture of LVM + +#### Creating Physical Volumes, Volume Group and Logical Volumes #### + +Follow these steps in order to set up LVM using classic volume management tools. Since you can expand this topic reading the [LVM series on this site][1], I will only outline the basic steps to set up LVM, and then compare them to implementing the same functionality with SSM. + +**Note**: That we will use the whole disks `/dev/sdb` and `/dev/sdc` as PVs (Physical Volumes) but it’s entirely up to you if you want to do the same. + +**1. Create partitions `/dev/sdb1` and `/dev/sdc1` using 100% of the available disk space in /dev/sdb and /dev/sdc:** + + # parted /dev/sdb print + # parted /dev/sdc print + +![Create New Partitions](http://www.tecmint.com/wp-content/uploads/2015/04/Create-New-Partitions.png) + +Create New Partitions + +**2. Create 2 physical volumes on top of /dev/sdb1 and /dev/sdc1, respectively.** + + # pvcreate /dev/sdb1 + # pvcreate /dev/sdc1 + +![Create Two Physical Volumes](http://www.tecmint.com/wp-content/uploads/2015/04/Create-Physical-Volumes.png) + +Create Two Physical Volumes + +Remember that you can use pvdisplay /dev/sd{b,c}1 to show information about the newly created PVs. + +**3. Create a VG on top of the PV that you created in the previous step:** + + # vgcreate tecmint_vg /dev/sd{b,c}1 + +![Create Volume Group in Linux](http://www.tecmint.com/wp-content/uploads/2015/04/Create-Volume-Group.png) + +Create Volume Group + +Remember that you can use vgdisplay tecmint_vg to show information about the newly created VG. + +**4. Create three logical volumes on top of VG tecmint_vg, as follows:** + + # lvcreate -L 3G -n vol01_docs tecmint_vg [vol01_docs → 3 GB] + # lvcreate -L 1G -n vol02_logs tecmint_vg [vol02_logs → 1 GB] + # lvcreate -l 100%FREE -n vol03_homes tecmint_vg [vol03_homes → 6 GB] + +![Create Logical Volumes in LVM](http://www.tecmint.com/wp-content/uploads/2015/04/Create-Logical-Volumes.png) + +Create Logical Volumes + +Remember that you can use lvdisplay tecmint_vg to show information about the newly created LVs on top of VG tecmint_vg. + +**5. Format each of the logical volumes with xfs (do NOT use xfs if you’re planning on shrinking volumes later!):** + + # mkfs.xfs /dev/tecmint_vg/vol01_docs + # mkfs.xfs /dev/tecmint_vg/vol02_logs + # mkfs.xfs /dev/tecmint_vg/vol03_homes + +**6. Finally, mount them:** + + # mount /dev/tecmint_vg/vol01_docs /mnt/docs + # mount /dev/tecmint_vg/vol02_logs /mnt/logs + # mount /dev/tecmint_vg/vol03_homes /mnt/homes + +#### Removing Logical Volumes, Volume Group and Physical Volumes #### + +**7. Now we will reverse the LVM implementation and remove the LVs, the VG, and the PVs:** + + # lvremove /dev/tecmint_vg/vol01_docs + # lvremove /dev/tecmint_vg/vol02_logs + # lvremove /dev/tecmint_vg/vol03_homes + # vgremove /dev/tecmint_vg + # pvremove /dev/sd{b,c}1 + +**8. Now let’s install SSM and we will see how to perform the above in ONLY 1 STEP!** + + # yum update && yum install system-storage-manager + +We will use the same names and sizes as before: + + # ssm create -s 3G -n vol01_docs -p tecmint_vg --fstype ext4 /mnt/docs /dev/sd{b,c}1 + # ssm create -s 1G -n vol02_logs -p tecmint_vg --fstype ext4 /mnt/logs /dev/sd{b,c}1 + # ssm create -n vol03_homes -p tecmint_vg --fstype ext4 /mnt/homes /dev/sd{b,c}1 + +Yes! SSM will let you: + +- initialize block devices as physical volumes +- create a volume group +- create logical volumes +- format LVs, and +- mount them using only one command + +**9. We can now display the information about PVs, VGs, or LVs, respectively, as follows:** + + # ssm list dev + # ssm list pool + # ssm list vol + +![Check Information of PVs, VGs, or LVs](http://www.tecmint.com/wp-content/uploads/2015/04/Display-LVM-Information.png) + +Check Information of PVs, VGs, or LVs + +**10. As we already know, one of the distinguishing features of LVM is the possibility to resize (expand or decrease) logical volumes without downtime.** + +Say we are running out of space in vol02_logs but have plenty of space in vol03_homes. We will resize vol03_homes to 4 GB and expand vol02_logs to use the remaining space: + + # ssm resize -s 4G /dev/tecmint_vg/vol03_homes + +Run ssm list pool again and take note of the free space in tecmint_vg: + +![Check Volume Size](http://www.tecmint.com/wp-content/uploads/2015/04/Check-LVM-Free-Space.png) + +Check Volume Size + +Then do: + + # ssm resize -s+1.99 /dev/tecmint_vg/vol02_logs + +**Note**: that the plus sign after the -s flag indicates that the specified value should be added to the present value. + +**11. Removing logical volumes and volume groups is much easier with ssm as well. A simple,** + + # ssm remove tecmint_vg + +will return a prompt asking you to confirm the deletion of the VG and the LVs it contains: + +![Remove Logical Volume and Volume Group](http://www.tecmint.com/wp-content/uploads/2015/04/Remove-LV-VG.png) + +Remove Logical Volume and Volume Group + +### Managing Encrypted Volumes ### + +SSM also provides system administrators with the capability of managing encryption for new or existing volumes. You will need the cryptsetup package installed first: + + # yum update && yum install cryptsetup + +Then issue the following command to create an encrypted volume. You will be prompted to enter a passphrase to maximize security: + + # ssm create -s 3G -n vol01_docs -p tecmint_vg --fstype ext4 --encrypt luks /mnt/docs /dev/sd{b,c}1 + # ssm create -s 1G -n vol02_logs -p tecmint_vg --fstype ext4 --encrypt luks /mnt/logs /dev/sd{b,c}1 + # ssm create -n vol03_homes -p tecmint_vg --fstype ext4 --encrypt luks /mnt/homes /dev/sd{b,c}1 + +Our next task consists in adding the corresponding entries in /etc/fstab in order for those logical volumes to be available on boot. Rather than using the device identifier (/dev/something). + +We will use each LV’s UUID (so that our devices will still be uniquely identified should we add other logical volumes or devices), which we can find out with the blkid utility: + + # blkid -o value UUID /dev/tecmint_vg/vol01_docs + # blkid -o value UUID /dev/tecmint_vg/vol02_logs + # blkid -o value UUID /dev/tecmint_vg/vol03_homes + +In our case: + +![Find Logical Volume UUID](http://www.tecmint.com/wp-content/uploads/2015/04/Logical-Volume-UUID.png) + +Find Logical Volume UUID + +Next, create the /etc/crypttab file with the following contents (change the UUIDs for the ones that apply to your setup): + + docs UUID=ba77d113-f849-4ddf-8048-13860399fca8 none + logs UUID=58f89c5a-f694-4443-83d6-2e83878e30e4 none + homes UUID=92245af6-3f38-4e07-8dd8-787f4690d7ac none + +And insert the following entries in /etc/fstab. Note that device_name (/dev/mapper/device_name) is the mapper identifier that appears in the first column of /etc/crypttab. + + # Logical volume vol01_docs: + /dev/mapper/docs /mnt/docs ext4 defaults 0 2 + # Logical volume vol02_logs + /dev/mapper/logs /mnt/logs ext4 defaults 0 2 + # Logical volume vol03_homes + /dev/mapper/homes /mnt/homes ext4 defaults 0 2 + +Now reboot (systemctl reboot) and you will be prompted to enter the passphrase for each LV. Afterwards you can confirm that the mount operation was successful by checking the corresponding mount points: + +![Verify Logical Volume Mount Points](http://www.tecmint.com/wp-content/uploads/2015/04/Verify-LV-Mount-Points.png) + +Verify Logical Volume Mount Points + +### Conclusion ### + +In this tutorial we have started to explore how to set up and configure system storage using classic volume management tools and SSM, which also integrates filesystem and encryption capabilities in one package. This makes SSM an invaluable tool for any sysadmin. + +Let us know if you have any questions or comments – feel free to use the form below to get in touch with us! + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/rhcsa-exam-create-format-resize-delete-and-encrypt-partitions-in-linux/ + +作者:[Gabriel Cánepa][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/gacanepa/ +[1]:http://www.tecmint.com/create-lvm-storage-in-linux/ \ No newline at end of file From b2f12c57e60872a6fffbce963039d81e4d9acaf3 Mon Sep 17 00:00:00 2001 From: wxy Date: Mon, 8 Jun 2015 20:32:51 +0800 Subject: [PATCH 295/965] PUB:20150604 Ubuntu's Juju Now Supports systemd and Google Cloud Platform @geekpi --- ...Now Supports systemd and Google Cloud Platform.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) rename {translated/news => published}/20150604 Ubuntu's Juju Now Supports systemd and Google Cloud Platform.md (63%) diff --git a/translated/news/20150604 Ubuntu's Juju Now Supports systemd and Google Cloud Platform.md b/published/20150604 Ubuntu's Juju Now Supports systemd and Google Cloud Platform.md similarity index 63% rename from translated/news/20150604 Ubuntu's Juju Now Supports systemd and Google Cloud Platform.md rename to published/20150604 Ubuntu's Juju Now Supports systemd and Google Cloud Platform.md index 4ff1fa23a0..952b673c41 100644 --- a/translated/news/20150604 Ubuntu's Juju Now Supports systemd and Google Cloud Platform.md +++ b/published/20150604 Ubuntu's Juju Now Supports systemd and Google Cloud Platform.md @@ -2,15 +2,15 @@ Ubuntu下的Juju现在支持systemd和Google Cloud Platform了 ================================================================================ > Juju已经更新到1.23.3了 -**Cononical旗下的Ubuntu认证公共云总监,Udi Nachmany宣布了juju新版本的发布,一个开源的、解决方案驱动的Ubuntu下的协同工具。** +**Cononical旗下的Ubuntu认证公共云总监Udi Nachmany宣布了juju新版本的发布,一个开源的、解决方案驱动的Ubuntu下的协同工具。** -根据[声明][1]和官方[发布公告][2],Juju 1.23.3是一个非常主流的版本,它打包了那些你想要在云上扩展和管理的包,而没有太多的麻烦。 +根据[声明][1]和官方[发布公告][2],Juju 1.23.3是一个主要版本,它打包了那些你想要在云上扩展和管理的包,而不需太多操作。 -Juju 1.23.3显著的功能是包含了对GCE的支持,支持systemd初始化系统,支持Ubuntu 15.04(Vivid Vervet),新的好玩的功能和对受限网络的支持。 +Juju 1.23.3显著的功能是包含了对GCE的支持,支持systemd初始化系统,支持Ubuntu 15.04(Vivid Vervet),新的好玩的功能和对受限网络的代理支持。 -另外,juju的发布带来了一个新的恢复、新的消息、新的块和实验性地支持Service Leader Elections,还有Ubuntu MAS和AWS上的可寻址的LXC和KVM。 +另外,juju的发布带来了一个新的样式恢复、新的消息、新的块和实验性地支持Service Leader Elections,还有Ubuntu MAS和AWS上的LXC容器和KVM实例。 -Udi Nachmany说:“在一个相关告示中,如果你正在使用Google云平台,你可能已经注意到了Google最近发布了云启动器。如果你密切关注,你同样注意到你说可以使用这个非常友好的UI来启动你的Ubuntu虚拟机。” +Udi Nachmany说:“在一个相关告示中,如果你正在使用Google云平台,你可能已经注意到了Google最近发布了云启动器。如果你观察的足够仔细,你也会注意到你可以使用这个非常友好的UI来启动你的Ubuntu虚拟机。” ![](http://i1-news.softpedia-static.com/images/news2/Ubuntu-s-Juju-Now-Supports-systemd-and-Google-Cloud-Platform-483279-2.jpg) @@ -20,7 +20,7 @@ via: http://linux.softpedia.com/blog/Ubuntu-s-Juju-Now-Supports-systemd-and-Goog 作者:[Marius Nestor][a] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 89c6e75408abd4096e206ef12cb69cbce3446073 Mon Sep 17 00:00:00 2001 From: wxy Date: Mon, 8 Jun 2015 21:34:46 +0800 Subject: [PATCH 296/965] PUB:20150423 How IP forwarding Helps Connecting Private interface to Internet in Linux @ictlyh --- ...ng Private interface to Internet in Linux.md | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) rename {translated/tech => published}/20150423 How IP forwarding Helps Connecting Private interface to Internet in Linux.md (70%) diff --git a/translated/tech/20150423 How IP forwarding Helps Connecting Private interface to Internet in Linux.md b/published/20150423 How IP forwarding Helps Connecting Private interface to Internet in Linux.md similarity index 70% rename from translated/tech/20150423 How IP forwarding Helps Connecting Private interface to Internet in Linux.md rename to published/20150423 How IP forwarding Helps Connecting Private interface to Internet in Linux.md index a8ba20fff0..0b141dcf33 100644 --- a/translated/tech/20150423 How IP forwarding Helps Connecting Private interface to Internet in Linux.md +++ b/published/20150423 How IP forwarding Helps Connecting Private interface to Internet in Linux.md @@ -1,12 +1,13 @@ -Linux 上IP转发如何帮助专用接口连接到互联网 +如何在 Linux 上用 IP转发使内部网络连接到互联网 ================================================================================ -大家好,今天我们学习一下在 Linux 上用 iptables 实现从一个网络接口到另一个接口的IP转发或者数据包转发。IP转发的概念是,使 Linux 机器像路由器一样将数据从一个网络发送到另一个网络。所以,它能作为一个**路由器**或者代理服务器,实现从一个连接到多个客户端机器的共享互联网或者网络连接。 + +大家好,今天我们学习一下在 Linux 上用 iptables 实现从一个网络接口到另一个接口的IP转发(数据包转发)。IP转发的概念是,使 Linux 机器像路由器一样将数据从一个网络发送到另一个网络。所以,它能作为一个**路由器**或者代理服务器,实现将一个连接的互联网或者网络连接共享给多个客户端机器。 这是一些启用IP转发或网络包转发方法的简单步骤。 ### 1. 启用 IPv4 转发 ### -首先,我们打算在我们的 Linux 操作系统上启用 IPv4 转发。要做到这点,我们需要用 sudo 模式在 shell 或终端下执行下面的命令。 +首先,我们需要在我们的 Linux 操作系统上启用 IPv4 转发。要做到这点,我们需要用 sudo 模式在 shell 或终端下执行下面的命令。 $ sudo -s @@ -14,7 +15,7 @@ Linux 上IP转发如何帮助专用接口连接到互联网 ![临时IP转发](http://blog.linoxide.com/wp-content/uploads/2015/03/ip-forward-temporary.png) -**注意:上面的命令能马上启用ip转发,但只是临时的,直到下一次重启。要永久启用,我们需要使用我们喜欢的文本编辑器打开 /etc/sysctl.conf 文件。** +**注意:上面的命令能马上启用ip转发,但只是临时的,直到下一次重启。要永久启用,我们需要使用我们惯用的文本编辑器打开 /etc/sysctl.conf 文件。** # nano /etc/sysctl.conf @@ -38,13 +39,13 @@ Linux 上IP转发如何帮助专用接口连接到互联网 ![Ifconfig](http://blog.linoxide.com/wp-content/uploads/2015/03/ifconfig.png) -这里,在我们的机器中, eth2 是连接到互联网或者网络的网卡接口, wlan2 是我们要使用 iptables 从 eth2 转发数据包的接口。要做到这点,我们需要运行以下命令。 +这里,在我们的机器中, eth2 是连接到互联网或者网络的网卡接口, wlan2 是我们要使用 iptables 从 eth2 转发数据包的接口。要实现转发,我们需要运行以下命令。 # iptables -A FORWARD -i wlan2 -o eth2 -j ACCEPT 注意:请用你 Linux 机器中的可用设备名称替换 wlan2 和 eth2。 -现在,由于网络过滤器是一个无状态的防火墙,我们要用 iptables 允许已建立的连接通过。要做到这点,我们要运行下面的命令。 +现在,由于netfilter/iptables是一个无状态的防火墙,我们需要让 iptables 允许已建立的连接通过。要做到这点,我们要运行下面的命令。 # iptables -A FORWARD -i eth2 -o wlan2 -m state --state ESTABLISHED,RELATED -j ACCEPT @@ -60,7 +61,7 @@ Linux 上IP转发如何帮助专用接口连接到互联网 ### 总结 ### -最后,用安装的 iptables 作为防火墙解决方案,我们在我们的 Linux 机器上成功的配置了从一个接口到另一个接口的数据包转发。这篇文章允许你的专用接口连接到互联网,你不需要桥接接口,而是路由从一个接口进来的数据包到另一个接口,就是这些。如果你有任何问题、建议、反馈,请写到下面的评论框中,然后我们可以改进或更新我们的内容。非常感谢!享受吧 :-) +最后,我们在我们以 iptables 作为防火墙 Linux 机器上成功的配置了从一个接口到另一个接口的数据包转发。这篇文章教给你将你的私有接口连接到互联网,不需要桥接接口,而是将从一个接口进来的数据包路由到另一个接口。就是这些,如果你有任何问题、建议、反馈,请写到下面的评论框中,然后我们可以改进或更新我们的内容。非常感谢!享受吧 :-) -------------------------------------------------------------------------------- @@ -68,7 +69,7 @@ via: http://linoxide.com/firewall/ip-forwarding-connecting-private-interface-int 作者:[Arun Pyasi][a] 译者:[ictlyh](https://github.com/ictlyh) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 From 7c5b82e7d16d6dd6b3f0f59343c26dccd3e7e9bf Mon Sep 17 00:00:00 2001 From: wxy Date: Mon, 8 Jun 2015 23:58:07 +0800 Subject: [PATCH 297/965] PUB:20150429 How To Integrate Apache2 With Tomcat 7 Using mod_jk Connector @geekpi --- ...e2 With Tomcat 7 Using mod_jk Connector.md | 54 +++++++++---------- 1 file changed, 26 insertions(+), 28 deletions(-) rename {translated/tech => published}/20150429 How To Integrate Apache2 With Tomcat 7 Using mod_jk Connector.md (54%) diff --git a/translated/tech/20150429 How To Integrate Apache2 With Tomcat 7 Using mod_jk Connector.md b/published/20150429 How To Integrate Apache2 With Tomcat 7 Using mod_jk Connector.md similarity index 54% rename from translated/tech/20150429 How To Integrate Apache2 With Tomcat 7 Using mod_jk Connector.md rename to published/20150429 How To Integrate Apache2 With Tomcat 7 Using mod_jk Connector.md index be9297c370..dff5090cfc 100644 --- a/translated/tech/20150429 How To Integrate Apache2 With Tomcat 7 Using mod_jk Connector.md +++ b/published/20150429 How To Integrate Apache2 With Tomcat 7 Using mod_jk Connector.md @@ -1,65 +1,63 @@ 如何用mod_jk连接器来集成Apache2和Tomcat 7 ================================================================================ -Apache是最流行的web服务器。通常用来接收客户端的请求并响应。它得到一个URL并将它翻译成一个文件名(或者静态请求),并将文件从本地磁盘中通过因特网返回,或者将它翻译成程序名执行它,接着将输出返回给请求方。如果web服务器不能处理和完成请求,它会返回一个错误信息。 +Apache是最流行的web服务器,它通常用来接收客户端的请求并响应。它得到一个URL并将它翻译成一个文件名(或者静态请求),并将文件从本地磁盘中取出,通过因特网返回;或者将它翻译成程序执行它,接着将输出返回给请求方。如果web服务器不能处理和完成请求,它会返回一个错误信息。 -在本篇中,我们会列出Apache的特性以及我们该如何用mod_jk连接器来集成Tomcat7和Tomcat8. +在本篇中,我们会列出Apache的特性以及我们该如何用mod\_jk连接器来集成Tomcat 7和Tomcat 8. ### Apache的特性 ### 如我们所说Apache是最流行的web服务器。下面是流行背后的原因: - 它是自由工具,你可以很简单地下载和安装 -- 它开放源码因此你可以查看源码,调整它,优化它,并且修复错误和安全漏洞。也可以增加新的功能和模块。 +- 它开放源码,因此你可以查看源码,调整它,优化它,并且修复错误和安全漏洞。也可以增加新的功能和模块。 - 它可以用在只有一两个页面的小网站,或者是有成千上万个页面的大网站,每月处理上百万的常规访问者的请求。它可以同时处理静态和动态内容。 -- 提高的缓存模块(mod_cache、 mod_disk_cache、 mod_mem_cache)。 +- 改进的缓存模块(mod\_cache、 mod\_disk\_cache、 mod\_mem\_cache)。 - Apache 2 支持 IPv6. -### Tomcat 目录 ### +### Tomcat 的目录 ### ${tomcat_home} 是tomcat的根目录。你的tomcat安装应该有下面的子目录: - ${tomcat_home}\conf – 存放不同配置文件的地方 - ${tomcat_home}\webapps – 包含示例程序 -- ${tomcat_home}\bin – 存放插件的地方 +- ${tomcat_home}\bin – 存放你的Web服务器的插件的地方 ### Mod_jk 模块 ### -mod_jk有两种可接受的方式:二进制或者源码。取决于你运行的web服务器的平台,二进制版本的mod_jk也许可以找到。如果有二进制版本的话建议使用这个。 +mod\_jk有两种可接受的方式:二进制或者源码。取决于你运行的web服务器的平台,也许有符合你的平台的二进制版本的mod\_jk。如果有的话建议使用这个。 -mod_jk模块在这些平台上开发及测试过: +mod\_jk模块在这些平台上开发及测试过: -- Linux、 FreeBSD、 AIX、 HP-UX、 MacOS X、 Solaris ,应该在主流的Unix平台上都支持Apache 1.3 和/或者 2.x。 -- 0-i386 SP4/SP5/SP6a (应该可以于其他的服务包一起工作), Win2K and WinXP and Win98 +- Linux、 FreeBSD、 AIX、 HP-UX、 MacOS X、 Solaris ,应该在主流的支持Apache 1.3 和/或者 2.x的Unix平台上都工作。 +- WinNT 4.0-i386 SP4/SP5/SP6a (应该可以与其他的服务包一起工作), Win2K 和 WinXP 和 Win98 - Cygwin (需要你有apache服务器及autoconf/automake支持工具) - Netware -- i5/OS V5R4 (System I) 中的 Apache HTTP Server 2.0.58。 确保已经安装了Apache PTF -- Tomcat 3.2 到 Tomcat 8. +- i5/OS V5R4 (System I) ,带有 Apache HTTP Server 2.0.58。 确保已经安装了最新的 Apache PTF +- Tomcat 3.2 到 Tomcat 8 -The mod_jk 需要两个组件: +The mod\_jk 需要两个组件: -- **mod_jk.xxx** – Apache HTTP服务器模块,取决于你的操作系统,它可能是mod_jk.so、mod_jk.nlm或者MOD_JK.SRVPGM。 -- **workers.properties** - 描述主机以及处理器使用的端口(Tomcat进程)。在下载的源码内可以在conf目录下找到workers.properties文件。 +- **mod\_jk.xxx** – Apache HTTP服务器模块,取决于你的操作系统,它可能是mod\_jk.so、mod\_jk.nlm或者mod\_jk.SRVPGM。 +- **workers.properties** - 描述Worker (Tomcat进程)所用的主机以及处理器使用的端口。在下载的源码的conf目录下找到示例的workers.properties文件。 -和Apache HTTP服务器其他的模块一样,mod_jk应该安装在你的Apache服务器下的模块目录下:/usr/lib/apache,你应该更新你的**httpd.conf**文件。 +和Apache HTTP服务器其他的模块一样,mod\_jk应该安装在你的Apache服务器下的模块目录下:/usr/lib/apache,而且你应该更新你的**httpd.conf**文件。 ### 安装 ### -它需要非root用户在安装钱使用“sudo”特权。现在我们开始安装,我们将使用下面的命令来安装Apache2和Tomcat: +在开始安装前,非root用户需要使用“sudo”特权。现在我们开始安装,我们将使用下面的命令来安装Apache2和Tomcat: - sudo apt-get install apache2 - + sudo apt-get install apache2 sudo apt-get install tomcat7 - sudo apt-get install tomcat7-admin -下面在我们将会使用下面的命令来创建一个测试程序: +下面,我们将会使用如下的命令来创建一个测试程序: cd /var/lib/tomcat7/webapps sudo mkdir tomcat-demo sudo mkdir tomcat-demo/goodmoring sudo vim tomcat-demo/helloworld/index.jsp -粘贴下面的代码: +并粘贴下面的代码到上述的 index.jsp: @@ -71,19 +69,19 @@ The mod_jk 需要两个组件: -一切完毕后,我们将使用下面的命令安装和配置mod_jk: +一切完毕后,我们将使用下面的命令安装和配置mod\_jk: sudo apt-get install libapache2-mod-jk -我们将使用下面的命令启用Tomcat的8443转发端口: +我们需要使用下面的命令启用Tomcat的8443转发端口: sudo vim /etc/tomcat7/server.xml -我们将解除下面的注释行: +解除下面的注释行: -之后,我们将用下面的命令位Apache创建workers.properties文件: +之后,我们将用下面的命令为Apache创建workers.properties文件: sudo vim /etc/apache2/workers.properties @@ -123,7 +121,7 @@ The mod_jk 需要两个组件: ### 总结 ### -在本篇中我们展示了你该如何使用mod_jk连接器配置和安装Apache2以及Tomcat7。 +在本篇中我们展示了你该如何使用mod\_jk连接器配置和安装Apache2以及Tomcat7。 -------------------------------------------------------------------------------- @@ -131,7 +129,7 @@ via: http://www.unixmen.com/integrate-apache2-tomcat-7-using-mod_jk-connector/ 作者:[anismaj][a] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 From 48f8b8987bf3e73d3f7b9838aec87651f1abd897 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 9 Jun 2015 10:01:42 +0800 Subject: [PATCH 298/965] Update README.md --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 26ea32fd81..968c8434a1 100644 --- a/README.md +++ b/README.md @@ -50,6 +50,7 @@ LCTT的组成 * 2014/11/04 提升zpl1025为Core Translators成员。 * 2014/12/25 提升runningwater为Core Translators成员。 * 2015/04/19 发起 LFS-BOOK-7.7-systemd 项目。 +* 2015/06/09 提升ictlyh和dongfengweixiao为Core Translators成员。 活跃成员 ------------------------------- @@ -63,6 +64,8 @@ LCTT的组成 - CORE @reinoir, - CORE @bazz2, - CORE @zpl1025, +- CORE @ictlyh, +- CORE @dongfengweixiao - Senior @tinyeyeser, - Senior @vito-L, - Senior @jasminepeng, @@ -76,7 +79,6 @@ LCTT的组成 - @alim0x, - @2q1w2007, - @theo-l, -- @ictlyh, - @FSSlc, - @su-kaiyao, - @blueabysm, @@ -167,7 +169,7 @@ LFS 项目活跃成员有: - @KevinSJ - @Yuking-net -(更新于2015/05/31,以Github contributors列表排名) +(更新于2015/06/09,以Github contributors列表排名) 谢谢大家的支持! From 4844e99b918c2c330d82bc2c261c1771c89e09bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=A7=E5=87=AF?= <2q1w2007@users.noreply.github.com> Date: Tue, 9 Jun 2015 10:23:47 +0800 Subject: [PATCH 299/965] =?UTF-8?q?2q1w2007=E7=94=B3=E9=A2=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit How to access a Linux server behind NAT via reverse SSH tunnel --- ...to access a Linux server behind NAT via reverse SSH tunnel.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20150504 How to access a Linux server behind NAT via reverse SSH tunnel.md b/sources/tech/20150504 How to access a Linux server behind NAT via reverse SSH tunnel.md index b67f5aee26..7eeb33676b 100644 --- a/sources/tech/20150504 How to access a Linux server behind NAT via reverse SSH tunnel.md +++ b/sources/tech/20150504 How to access a Linux server behind NAT via reverse SSH tunnel.md @@ -1,3 +1,4 @@ +2q1w2007申领 How to access a Linux server behind NAT via reverse SSH tunnel ================================================================================ You are running a Linux server at home, which is behind a NAT router or restrictive firewall. Now you want to SSH to the home server while you are away from home. How would you set that up? SSH port forwarding will certainly be an option. However, port forwarding can become tricky if you are dealing with multiple nested NAT environment. Besides, it can be interfered with under various ISP-specific conditions, such as restrictive ISP firewalls which block forwarded ports, or carrier-grade NAT which shares IPv4 addresses among users. From a8c214b343fdda47f70aa777b8f3f6e53a2b0a57 Mon Sep 17 00:00:00 2001 From: Chang Liu Date: Tue, 9 Jun 2015 12:23:20 +0800 Subject: [PATCH 300/965] [Translated]20150515 Install Tails 1.4 Linux Operating System to Preserve Privacy and Anonymity.md --- ... System to Preserve Privacy and Anonymity.md | 181 ------------------ ... System to Preserve Privacy and Anonymity.md | 180 +++++++++++++++++ 2 files changed, 180 insertions(+), 181 deletions(-) delete mode 100644 sources/tech/20150515 Install 'Tails 1.4′ Linux Operating System to Preserve Privacy and Anonymity.md create mode 100644 translated/tech/20150515 Install 'Tails 1.4′ Linux Operating System to Preserve Privacy and Anonymity.md diff --git a/sources/tech/20150515 Install 'Tails 1.4′ Linux Operating System to Preserve Privacy and Anonymity.md b/sources/tech/20150515 Install 'Tails 1.4′ Linux Operating System to Preserve Privacy and Anonymity.md deleted file mode 100644 index 5731cd69f4..0000000000 --- a/sources/tech/20150515 Install 'Tails 1.4′ Linux Operating System to Preserve Privacy and Anonymity.md +++ /dev/null @@ -1,181 +0,0 @@ -FSSlc translating - -Install ‘Tails 1.4′ Linux Operating System to Preserve Privacy and Anonymity -================================================================================ -In this Internet world and the world of Internet we perform most of our task online be it Ticket booking, Money transfer, Studies, Business, Entertainment, Social Networking and what not. We spend a major part of our time online daily. It has been getting hard to remain anonymous with each passing day specially when backdoors are being planted by organizations like NSA (National Security Agency) who are putting their nose in between every thing that we come across online. We have least or no privacy online. All the searches are logged upon the basis of user Internet surfing activity and machine activity. - -A wonderful browser from Tor project is used by millions which help us surfing the web anonymously however it is not difficult to trace your browsing habits and hence tor alone is not the guarantee of your safety online. You may like to check Tor features and installation instructions here: - -- [Anonymous Web Browsing using Tor][1] - -There is a operating system named Tails by Tor Projects. Tails (The Amnesic Incognito Live System) is a live operating system, based on Debian Linux distribution, which mainly focused on preserving privacy and anonymity on the web while browsing internet, means all it’s outgoing connection are forced to pass through the Tor and direct (non-anonymous) requests are blocked. The system is designed to run from any boot-able media be it USB stick or DVD. - -The latest stable release of Tails OS is 1.4 which was released on May 12, 2015. Powered by open source Monolithic Linux Kernel and built on top of Debian GNU/Linux Tails aims at Personal Computer Market and includes GNOME 3 as default user Interface. - -#### Features of Tails OS 1.4 #### - -- Tails is a free operating system, free as in beer and free as in speech. -- Built on top of Debian/GNU Linux. The most widely used OS that is Universal. -- Security Focused Distribution. -- Windows 8 camouflage. -- Need not to be installed and browse Internet anonymously using Live Tails CD/DVD. -- Leave no trace on the computer, while tails is running. -- Advanced cryptographic tools used to encrypt everything that concerns viz., files, emails, etc. -- Sends and Receive traffic through tor network. -- In true sense it provides privacy for anyone, anywhere. -- Comes with several applications ready to be used from Live Environment. -- All the softwares comes per-configured to connect to INTERNET only through Tor network. -- Any application that tries to connect to Internet without Tor Network is blocked, automatically. -- Restricts someone who is watching what sites you visit and restricts sites to learn your geographical location. -- Connect to websites that are blocked and/or censored. -- Designed specially not to use space used by parent OS even when there is free swap space. -- The whole OS loads on RAM and is flushed when we reboot/shutdown. Hence no trace of running. -- Advanced security implementation by encrypting USB disk, HTTPS ans Encrypt and sign emails and documents. - -#### What can you expect in Tails 1.4 #### - -- Tor Browser 4.5 with a security Slider. -- Tor Upgraded to version 0.2.6.7. -- Several Security holes fixed. -- Many of the bug fixed and patches applied to Applications like curl, OpenJDK 7, tor Network, openldap, etc. - -To get a complete list of change logs you may visit [HERE][2] - -**Note**: It is strongly recommended to upgrade to Tails 1.4, if you’re using any older version of Tails. - -#### Why should I use Tails Operating System #### - -You need Tails because you need: - -- Freedom from network surveillance -- Defend freedom, privacy and confidentiality -- Security aka traffic analysis - -This tutorial will walk through the installation of Tails 1.4 OS with a short review. - -### Tails 1.4 Installation Guide ### - -1. To download the latest Tails OS 1.4, you may use wget command to download directly. - - $ wget http://dl.amnesia.boum.org/tails/stable/tails-i386-1.4/tails-i386-1.4.iso - -Alternatively you may download Tails 1.4 Direct ISO image or use a Torrent Client to pull the iso image file for you. Here is the link to both downloads: - -- [tails-i386-1.4.iso][3] -- [tails-i386-1.4.torrent][4] - -2. After downloading, verify ISO Integrity by matching SHA256 checksum with the SHA256SUM provided on the official website.. - - $ sha256sum tails-i386-1.4.iso - - 339c8712768c831e59c4b1523002b83ccb98a4fe62f6a221fee3a15e779ca65d - -If you are interested in knowing OpenPGP, checking Tails signing key against Debian keyring and anything related to Tails cryptographic signature, you may like to point your browser [HERE][5]. - -3. Next you need to write the image to USB stick or DVD ROM. You may like to check the article, [How to Create Live Bootable USB][6] for details on how to make a flash drive bootable and write ISO to it. - -4. Insert the Tails OS Bootable flash drive or DVD ROM in the disk and boot from it (select from BIOS to boot). The first screen – two options to select from ‘Live‘ and ‘Live (failsafe)‘. Select ‘Live‘ and press Enter. - -![Tails Boot Menu](http://www.tecmint.com/wp-content/uploads/2015/05/1.png) -Tails Boot Menu - -5. Just before login. You have two options. Click ‘More Options‘ if you want to configure and set advanced options else click ‘No‘. - -![Tails Welcome Screen](http://www.tecmint.com/wp-content/uploads/2015/05/2.png) -Tails Welcome Screen - -6. After clicking Advanced option, you need to setup root password. This is important if you want to upgrade it. This root password is valid till you shutdown/reboot the machine. - -Also you may enable Windows Camouflage, if you want to run this OS on a public place, so that it seems as you are running Windows 8 operating system. Good option indeed! Is not it? Also you have a option to configure Network and Mac Address. Click ‘Login‘ when done!. - -![Tails OS Configuration](http://www.tecmint.com/wp-content/uploads/2015/05/3.png) -Tails OS Configuration - -7. This is Tails GNU/Linux OS camouflaged by Windows Skin. - -![Tails Windows Look](http://www.tecmint.com/wp-content/uploads/2015/05/4.jpg) -Tails Windows Look - -8. It will start Tor Network in the background. Check the Notification on the top-right corner of the screen – Tor is Ready / You are now connected to the Internet. - -Also check what it contains under Internet Menu. Notice – It has Tor Browser (safe) and Unsafe Web Browser (Where incoming and outgoing data don’t pass through TOR Network) along with other applications. - -![Tails Menu and Tools](http://www.tecmint.com/wp-content/uploads/2015/05/5.jpg) -Tails Menu and Tools - -9. Click Tor and check your IP Address. It confirms my physical location is not shared and my privacy is intact. - -![Check Privacy on Tails](http://www.tecmint.com/wp-content/uploads/2015/05/6.jpg) -Check Privacy on Tails - -10. You may Invoke Tails Installer to clone & Install, Clone & Upgrade and Upgrade from ISO. - -![Tails Installer Options](http://www.tecmint.com/wp-content/uploads/2015/05/7.jpg) -Tails Installer Options - -11. The other option was to select Tor without any advanced option, just before login (Check step #5 above). - -![Tails Without Advance Option](http://www.tecmint.com/wp-content/uploads/2015/05/8.png) -Tails Without Advance Option - -12. You will get log-in to Gnome3 Desktop Environment. - -![Tails Gnome Desktop](http://www.tecmint.com/wp-content/uploads/2015/05/9.png) -Tails Gnome Desktop - -13. If you click to Launch Unsafe browser in Camouflage or without Camouflage, you will be notified. - -![Tails Browsing Notification](http://www.tecmint.com/wp-content/uploads/2015/05/10.png) -Tails Browsing Notification - -If you do, this is what you get in a Browser. - -![Tails Browsing Alert](http://www.tecmint.com/wp-content/uploads/2015/05/11.png) -Tails Browsing Alert - -#### Is Tails for me? #### - -To get the above question answered, first answer a few question. - -- Do you need your privacy to be intact while you are online? -- Do you want to remain hidden from Identity thieves? -- Do you want somebody to put your nose in between your private chat online? -- Do you really want to show your geographical location to anybody there? -- Do you carry out banking transactions online? -- Are you happy with the censorship by government and ISP? - -If the answer to any of the above question is ‘YES‘ you preferably need Tails. If answer to all the above question is ‘NO‘ you perhaps don’t need it. - -To know more about Tails? Point your browser to user Documentation : [https://tails.boum.org/doc/index.en.html][7] - -### Conclusion ### - -Tails is an OS which is must for those who work in an unsafe environment. An OS focused on security yet contains bundles of Application – Gnome Desktop, Tor, Firefox (Iceweasel), Network Manager, Pidgin, Claws mail, Liferea feed addregator, Gobby, Aircrack-ng, I2P. - -It also contain several tools for Encryption and Privacy Under the Hood, viz., LUKS, GNUPG, PWGen, Shamir’s Secret Sharing, Virtual Keyboard (against Hardware Keylogging), MAT, KeePassX Password Manager, etc. - -That’s all for now. Keep Connected to Tecmint. Share your thoughts on Tails GNU/Linux Operating System. What do you think about the future of the Project? Also test it Locally and let us know your experience. - -You may run it in [Virtualbox][8] as well. Remember Tails loads the whole OS in RAM hence give enough RAM to run Tails in VM. - -I tested in 1GB Environment and it worked without lagging. Thanks to all our readers for their Support. In making Tecmint a one place for all Linux related stuffs your co-operation is needed. Kudos! - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/install-tails-1-4-linux-operating-system-to-preserve-privacy-and-anonymity/ - -作者:[Avishek Kumar][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.tecmint.com/author/avishek/ -[1]:http://www.tecmint.com/tor-browser-for-anonymous-web-browsing/ -[2]:https://tails.boum.org/news/version_1.4/index.en.html -[3]:http://dl.amnesia.boum.org/tails/stable/tails-i386-1.4/tails-i386-1.4.iso -[4]:https://tails.boum.org/torrents/files/tails-i386-1.4.torrent -[5]:https://tails.boum.org/download/index.en.html#verify -[6]:http://www.tecmint.com/install-linux-from-usb-device/ -[7]:https://tails.boum.org/doc/index.en.html -[8]:http://www.tecmint.com/install-virtualbox-on-redhat-centos-fedora/ diff --git a/translated/tech/20150515 Install 'Tails 1.4′ Linux Operating System to Preserve Privacy and Anonymity.md b/translated/tech/20150515 Install 'Tails 1.4′ Linux Operating System to Preserve Privacy and Anonymity.md new file mode 100644 index 0000000000..a7e9d4e6b8 --- /dev/null +++ b/translated/tech/20150515 Install 'Tails 1.4′ Linux Operating System to Preserve Privacy and Anonymity.md @@ -0,0 +1,180 @@ +安装 Tails 1.4 Linux 操作系统来保护隐私和保持匿名 +================================================================================ +在这个互联网世界和互联网的世界中,我们在线执行我们的大多数任务,无论是订票,汇款,研究,商务,娱乐,社交网络,还是其他。每天我们花费大部分时间在网络上。在每个逝去的日子里,在网络中保持匿名变得越来越难,尤其是在被某些机构例如 NSA (National Security Agency,国安局) 植入后门的情况下,这些机构嗅探着我们在网络中的所有动作。在网络中,我们有着极少,或者说根本就没有隐私。基于用户浏览网络的活动和机器的活动的搜索都被记录了下来。 + +一个来自于 Tor 项目的绝妙浏览器正被上百万人使用,它帮助我们匿名地浏览网络,即使这样,跟踪你的浏览习惯也并不难,所以只使用 Tor 并不能保证你的网络安全。你可以从下面的链接中查看 Tor 的特点及安装指南。 + +- [使用 Tor 来进行匿名网络浏览][1] + +Tor 项目中有一个名为 Tails 的操作系统。Tails (The Amnesic Incognito Live System) 是一个 live 操作系统,基于 Debian Linux 发行版本,主要着眼于在浏览网络时在网络中保护隐私和匿名,这意味着所有的外向连接都强制通过 Tor 来连接,直接的(非匿名的) 连接请求都会被阻挡。该系统被设计为可在任何可启动介质上运行,例如 USB 或 DVD。 + +Tails OS 的最新稳定发行版本为 1.4 , 于 2015 年 5 月 12 日发行。Tails 由开源单片 Linux 内核支持,构建在 Debian GNU/Linux 之上,着眼于个人电脑市场, 使用 GNOME 3 作为其默认的用户界面。 + +#### Tails OS 1.4 的特点 #### + +- Tails 是一个 free 的操作系统, free 的意义正如 免费(free)啤酒和言论自由(free) 中的 free +- 构建在 Debian/GNU Linux 操作系统之上, Debian 是使用最广泛的通用操作系统 +- 着眼于安全的发行版本 +- 有 Windows 8 外观作为其伪装 +- 不必安装就可以使用 Live Tails CD/DVD 来匿名浏览网络 +- 当 Tails 运行时,不留下任何痕迹 +- 使用先进的加密工具来加密任何相关文件,邮件等内容 +- 通过 Tor 网络来发送和接收流量 +- 在真正意义上为任何人在任何地方保护隐私 +- 在 Live 环境中带有一些可用的应用 +- 系统自带的所有软件都预先配置好只通过 Tor 网络来连接到互联网 +- 任何不通过 Tor 网络而尝试连接网络的应用都将被自动阻拦。 +- 限制那些想查看你正在浏览什么网站的人的行动,并限制网站获取你的地理位置 +- 连接到那些被墙或被审查的网站 +- 特别设计不使用主操作系统的空间,即使在 swap 空间还有空余的情况下 +- 整个操作系统加载在 RAM 中,在每次重启或关机后会自动擦除掉,所以不会留下任何运行的痕迹。 +- 先进的安全实现,通过加密 USB 磁盘, HTTPS 应答加密和对邮件,文档进行签名。 + +#### 在 Tails 1.4 中可期待的东西 #### + +- 带有安全滑块的 Tor 浏览器 4.5 +- Tor 被升级到版本 0.2.6.7 +- 修补了几个安全漏洞 +- 针对诸如 curl, OpenJDK 7, tor Network, openldap 等应用, 许多漏洞被修复并打上了补丁 + +要得到完整的更改记录,你需要访问 [这里][2] + +**注意**: 假如你使用 Tails 的任何旧版本,强烈建议升级到 Tails 1.4 。 + +#### 为什么我应该使用 Tails 操作系统 #### + +你需要 Tails 因为你想: + +- 在网络监控下保持自由 +- 捍卫自由,隐私和秘密 +- 流量分析下保持安全 + +这个教程将带你了解 Tails 1.4 操作系统的安装并给出一个简短的评论。 + +### Tails 1.4 安装指南 ### + +1. 为了下载最新的 Tails OS 1.4,你可以使用 wget 命令来直接下载它 + + $ wget http://dl.amnesia.boum.org/tails/stable/tails-i386-1.4/tails-i386-1.4.iso + +或者你可以直接下载 Tails 1.4 的 ISO 镜像文件,或使用一个 Torrent 客户端来为你获取 ISO 镜像文件: + +- [tails-i386-1.4.iso][3] +- [tails-i386-1.4.torrent][4] + +2. 下载后,可使用 SHA256SUM 来获取 ISO 文件的哈希值并与官方提供的值相比较,以核实 ISO 文件的完整性 + + $ sha256sum tails-i386-1.4.iso + + 339c8712768c831e59c4b1523002b83ccb98a4fe62f6a221fee3a15e779ca65d + +假如你熟悉 OpenPGP ,将 Tails 的签名密钥与 Debian 的 keyring 相比较以验证其签名,若想了解任何有关 Tails 的加密签名,请将浏览器指向 [这里][5] + +3. 下一步,你需要将镜像写入 USB 或 DVD ROM 中。或许你需要看看这篇文章 [如何创建一个 Live 可启动的 USB][6] 以了解如何使得一个闪存驱动器变得可启动并向它写入 ISO 镜像文件。 + +4. 插入 Tails OS 可启动闪存驱动器或 DVD ROM,并从那里启动 (在 BIOS 中选择该介质来启动)。第一个屏幕中会有两个选项 'Live' 和 'Live (failsafe)' 让你选择。选择 'Live' 并确定。 + +![Tails 启动菜单](http://www.tecmint.com/wp-content/uploads/2015/05/1.png) +Tails 启动菜单 + +5. 在登录之前,你有两个选项, 假如你想配置并设定高级选项,点击 '更多选项' 否则点击 'NO'。 + +![Tails 欢迎界面](http://www.tecmint.com/wp-content/uploads/2015/05/2.png) +Tails 欢迎界面 + +6. 在点击高级选项后,你需要设置 root 密码。假如你想升级它,这是非常重要的。这个 root 密码将会一直有效,知道你关机或重启。 + +另外,若你想开启 Windows 伪装,假如你想在一个公共场所运行这个操作系统,这将使得看起来你正在运行 Windows 8 操作系统。这真是一个好的选项!不是吗?另外,你还有一个选项来配置 网络和 Mac 地址,当一切准备完毕后,点击 '登录' ! + +![Tails OS 的配置](http://www.tecmint.com/wp-content/uploads/2015/05/3.png) +Tails OS 的配置 + +7. 这是使用 Windows 皮肤伪装的 Tails GNU/Linux OS: + +![Tails 的 Windows 伪装](http://www.tecmint.com/wp-content/uploads/2015/05/4.jpg) +Tails 的 Windows 伪装 + +8. 系统将在后台启动 Tor 网络。在屏幕的右上角查看通知 – Tor 已经准备好了 或现在你已经连接上了互联网。 + +你也可以在 Internet 菜单下查看它包含了哪些东西。 注意 – 它包含有 Tor 浏览器(安全的) 和 不安全的网络浏览器(其中的向内和向外数据不通过 Tor 网络) 和其他应用。 + +![Tails 菜单和工具](http://www.tecmint.com/wp-content/uploads/2015/05/5.jpg) +Tails 菜单和工具 + +9. 点击 Tor 并检查你的 IP 地址。 它确认我的物理位置没有被分享以及我的隐私未被触动。 + +![在 Tails 上检查隐私](http://www.tecmint.com/wp-content/uploads/2015/05/6.jpg) +在 Tails 上检查隐私 + +10. 你还可以激活 Tails 安装器来从 ISO 镜像文件中 克隆和安装, 克隆和升级以及升级系统。 + +![Tails 安装器选项](http://www.tecmint.com/wp-content/uploads/2015/05/7.jpg) +Tails 安装器选项 + +11. 其他选项为选择 Tor 不带有高级选项,就在登录之前。(查看上面的第 5 步). + +![Tails 未带有高级选项](http://www.tecmint.com/wp-content/uploads/2015/05/8.png) +Tails 未带有高级选项 + +12. 你将登录到 Gnome3 桌面环境。 + +![Tails Gnome 桌面](http://www.tecmint.com/wp-content/uploads/2015/05/9.png) +Tails Gnome 桌面 + +13. 假如你点击启动不安全的浏览器,无论在带有伪装,还是没有带有伪装的情况下,你都将会收到弹窗通知。 + +![Tails 浏览通知](http://www.tecmint.com/wp-content/uploads/2015/05/10.png) +Tails 浏览通知 + +假如你仍启动不安全的浏览器,你将在浏览器中看到如下网页: + +![Tails 浏览警告](http://www.tecmint.com/wp-content/uploads/2015/05/11.png) +Tails 浏览警告 + +#### Tails 适合我吗?#### + +要想得到上面问题的答案,首先回答如下的问题: + +- 在上网时,你想你的隐私未被触动吗? +- 你想在身份信息窃取者的眼皮底下保持隐身吗? +- 你想在你的网上私人聊天过程中被他人嗅探吗? +- 你真的想向任何人展示你的地理位置吗? +- 你开展银行网上交易吗? +- 你愿意受政府和 ISP(注:网络提供商) 的审查吗? + +假如以上问题中,任意一个问题的答案为 'YES',则你最好需要 Tails。假如上面所有的问题的答案都是 'NO',则或许你不需要它。 + +想对 Tails 了解更多?请将你的浏览器指向它的用户文档页面: + +文档: [https://tails.boum.org/doc/index.en.html][7] + +### 总结 ### + +对于那些工作在不安全环境中的人来说,Tails 是一个必需的操作系统。Tails 还是一个着眼于安全的操作系统,现在为止,包含一大批应用 – Gnome 桌面, Tor, Firefox (Iceweasel), Network Manager, Pidgin, Claws mail, Liferea feed addregator, Gobby, Aircrack-ng, I2P。 + +同时,它含有一些有关加密和隐私的工具,即 UKS, GNUPG, PWGen, Shamir’s Secret Sharing, Virtual Keyboard (against Hardware Keylogging), MAT, KeePassX Password Manager 等。 + +这就是全部了。关注 Tecmint。请分享你的有关 Tails GNU/Linux 操作系统的想法。对于这个项目的未来,你怎么看?同时在实际中测试它,并让我们获知你的体验感受。 + +你也可以在 [Virtualbox][8] 中运行它。 Tails 在 RAM 中加载整个操作系统,所以在 VM 中你需要给定足够的 RAM 来运行 Tails。 + +我在 1GB 的环境中测试了 Tails,它工作起来毫无滞后感。谢谢我们的所有用户的支持。使 Tecmint 成为一个包含所有 Linux 相关信息的地方,你的合作是必需的。 Kudos! +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/install-tails-1-4-linux-operating-system-to-preserve-privacy-and-anonymity/ + +作者:[Avishek Kumar][a] +译者:[FSSlc](https://github.com/FSSlc) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/avishek/ +[1]:http://www.tecmint.com/tor-browser-for-anonymous-web-browsing/ +[2]:https://tails.boum.org/news/version_1.4/index.en.html +[3]:http://dl.amnesia.boum.org/tails/stable/tails-i386-1.4/tails-i386-1.4.iso +[4]:https://tails.boum.org/torrents/files/tails-i386-1.4.torrent +[5]:https://tails.boum.org/download/index.en.html#verify +[6]:http://www.tecmint.com/install-linux-from-usb-device/ +[7]:https://tails.boum.org/doc/index.en.html +[8]:http://www.tecmint.com/install-virtualbox-on-redhat-centos-fedora/ \ No newline at end of file From a6fa2fa8add0d23d688ecad4b491e1540e3d5c45 Mon Sep 17 00:00:00 2001 From: DeadFire Date: Tue, 9 Jun 2015 14:10:03 +0800 Subject: [PATCH 301/965] =?UTF-8?q?20150609-1=20=E9=80=89=E9=A2=98=20RHCSA?= =?UTF-8?q?=20Series=207-13?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...Lists) and Mounting Samba or NFS Shares.md | 212 +++++++++++++++++ ... Hostname and Enabling Network Services.md | 215 ++++++++++++++++++ ...uring and Securing a Web and FTP Server.md | 176 ++++++++++++++ ...ks with Cron and Monitoring System Logs.md | 197 ++++++++++++++++ ...ic Control Using FirewallD and Iptables.md | 191 ++++++++++++++++ ... RHEL 7 Installations Using 'Kickstart'.md | 142 ++++++++++++ ...ntrol Essentials with SELinux in RHEL 7.md | 176 ++++++++++++++ 7 files changed, 1309 insertions(+) create mode 100644 sources/tech/RHCSA Series/RHCSA Series--Part 07--Using ACLs (Access Control Lists) and Mounting Samba or NFS Shares.md create mode 100644 sources/tech/RHCSA Series/RHCSA Series--Part 08--Securing SSH, Setting Hostname and Enabling Network Services.md create mode 100644 sources/tech/RHCSA Series/RHCSA Series--Part 09--Installing, Configuring and Securing a Web and FTP Server.md create mode 100644 sources/tech/RHCSA Series/RHCSA Series--Part 10--Yum Package Management, Automating Tasks with Cron and Monitoring System Logs.md create mode 100644 sources/tech/RHCSA Series/RHCSA Series--Part 11--Firewall Essentials and Network Traffic Control Using FirewallD and Iptables.md create mode 100644 sources/tech/RHCSA Series/RHCSA Series--Part 12--Automate RHEL 7 Installations Using 'Kickstart'.md create mode 100644 sources/tech/RHCSA Series/RHCSA Series--Part 13--Mandatory Access Control Essentials with SELinux in RHEL 7.md diff --git a/sources/tech/RHCSA Series/RHCSA Series--Part 07--Using ACLs (Access Control Lists) and Mounting Samba or NFS Shares.md b/sources/tech/RHCSA Series/RHCSA Series--Part 07--Using ACLs (Access Control Lists) and Mounting Samba or NFS Shares.md new file mode 100644 index 0000000000..d4801d9923 --- /dev/null +++ b/sources/tech/RHCSA Series/RHCSA Series--Part 07--Using ACLs (Access Control Lists) and Mounting Samba or NFS Shares.md @@ -0,0 +1,212 @@ +RHCSA Series: Using ACLs (Access Control Lists) and Mounting Samba / NFS Shares – Part 7 +================================================================================ +In the last article ([RHCSA series Part 6][1]) we started explaining how to set up and configure local system storage using parted and ssm. + +![Configure ACL's and Mounting NFS / Samba Shares](http://www.tecmint.com/wp-content/uploads/2015/04/Configure-ACLs-and-Mounting-NFS-Samba-Shares.png) + +RHCSA Series:: Configure ACL’s and Mounting NFS / Samba Shares – Part 7 + +We also discussed how to create and mount encrypted volumes with a password during system boot. In addition, we warned you to avoid performing critical storage management operations on mounted filesystems. With that in mind we will now review the most used file system formats in Red Hat Enterprise Linux 7 and then proceed to cover the topics of mounting, using, and unmounting both manually and automatically network filesystems (CIFS and NFS), along with the implementation of access control lists for your system. + +#### Prerequisites #### + +Before proceeding further, please make sure you have a Samba server and a NFS server available (note that NFSv2 is no longer supported in RHEL 7). + +During this guide we will use a machine with IP 192.168.0.10 with both services running in it as server, and a RHEL 7 box as client with IP address 192.168.0.18. Later in the article we will tell you which packages you need to install on the client. + +### File System Formats in RHEL 7 ### + +Beginning with RHEL 7, XFS has been introduced as the default file system for all architectures due to its high performance and scalability. It currently supports a maximum filesystem size of 500 TB as per the latest tests performed by Red Hat and its partners for mainstream hardware. + +Also, XFS enables user_xattr (extended user attributes) and acl (POSIX access control lists) as default mount options, unlike ext3 or ext4 (ext2 is considered deprecated as of RHEL 7), which means that you don’t need to specify those options explicitly either on the command line or in /etc/fstab when mounting a XFS filesystem (if you want to disable such options in this last case, you have to explicitly use no_acl and no_user_xattr). + +Keep in mind that the extended user attributes can be assigned to files and directories for storing arbitrary additional information such as the mime type, character set or encoding of a file, whereas the access permissions for user attributes are defined by the regular file permission bits. + +#### Access Control Lists #### + +As every system administrator, either beginner or expert, is well acquainted with regular access permissions on files and directories, which specify certain privileges (read, write, and execute) for the owner, the group, and “the world” (all others). However, feel free to refer to [Part 3 of the RHCSA series][2] if you need to refresh your memory a little bit. + +However, since the standard ugo/rwx set does not allow to configure different permissions for different users, ACLs were introduced in order to define more detailed access rights for files and directories than those specified by regular permissions. + +In fact, ACL-defined permissions are a superset of the permissions specified by the file permission bits. Let’s see how all of this translates is applied in the real world. + +1. There are two types of ACLs: access ACLs, which can be applied to either a specific file or a directory), and default ACLs, which can only be applied to a directory. If files contained therein do not have a ACL set, they inherit the default ACL of their parent directory. + +2. To begin, ACLs can be configured per user, per group, or per an user not in the owning group of a file. + +3. ACLs are set (and removed) using setfacl, with either the -m or -x options, respectively. + +For example, let us create a group named tecmint and add users johndoe and davenull to it: + + # groupadd tecmint + # useradd johndoe + # useradd davenull + # usermod -a -G tecmint johndoe + # usermod -a -G tecmint davenull + +And let’s verify that both users belong to supplementary group tecmint: + + # id johndoe + # id davenull + +![Verify Users](http://www.tecmint.com/wp-content/uploads/2015/04/Verify-Users.png) + +Verify Users + +Let’s now create a directory called playground within /mnt, and a file named testfile.txt inside. We will set the group owner to tecmint and change its default ugo/rwx permissions to 770 (read, write, and execute permissions granted to both the owner and the group owner of the file): + + # mkdir /mnt/playground + # touch /mnt/playground/testfile.txt + # chmod 770 /mnt/playground/testfile.txt + +Then switch user to johndoe and davenull, in that order, and write to the file: + + echo "My name is John Doe" > /mnt/playground/testfile.txt + echo "My name is Dave Null" >> /mnt/playground/testfile.txt + +So far so good. Now let’s have user gacanepa write to the file – and the write operation will, which was to be expected. + +But what if we actually need user gacanepa (who is not a member of group tecmint) to have write permissions on /mnt/playground/testfile.txt? The first thing that may come to your mind is adding that user account to group tecmint. But that will give him write permissions on ALL files were the write bit is set for the group, and we don’t want that. We only want him to be able to write to /mnt/playground/testfile.txt. + + # touch /mnt/playground/testfile.txt + # chown :tecmint /mnt/playground/testfile.txt + # chmod 777 /mnt/playground/testfile.txt + # su johndoe + $ echo "My name is John Doe" > /mnt/playground/testfile.txt + $ su davenull + $ echo "My name is Dave Null" >> /mnt/playground/testfile.txt + $ su gacanepa + $ echo "My name is Gabriel Canepa" >> /mnt/playground/testfile.txt + +![Manage User Permissions](http://www.tecmint.com/wp-content/uploads/2015/04/User-Permissions.png) + +Manage User Permissions + +Let’s give user gacanepa read and write access to /mnt/playground/testfile.txt. + +Run as root, + + # setfacl -R -m u:gacanepa:rwx /mnt/playground + +and you’ll have successfully added an ACL that allows gacanepa to write to the test file. Then switch to user gacanepa and try to write to the file again: + + $ echo "My name is Gabriel Canepa" >> /mnt/playground/testfile.txt + +To view the ACLs for a specific file or directory, use getfacl: + + # getfacl /mnt/playground/testfile.txt + +![Check ACLs of Files](http://www.tecmint.com/wp-content/uploads/2015/04/Check-ACL-of-File.png) + +Check ACLs of Files + +To set a default ACL to a directory (which its contents will inherit unless overwritten otherwise), add d: before the rule and specify a directory instead of a file name: + + # setfacl -m d:o:r /mnt/playground + +The ACL above will allow users not in the owner group to have read access to the future contents of the /mnt/playground directory. Note the difference in the output of getfacl /mnt/playground before and after the change: + +![Set Default ACL in Linux](http://www.tecmint.com/wp-content/uploads/2015/04/Set-Default-ACL-in-Linux.png) + +Set Default ACL in Linux + +[Chapter 20 in the official RHEL 7 Storage Administration Guide][3] provides more ACL examples, and I highly recommend you take a look at it and have it handy as reference. + +#### Mounting NFS Network Shares #### + +To show the list of NFS shares available in your server, you can use the showmount command with the -e option, followed by the machine name or its IP address. This tool is included in the nfs-utils package: + + # yum update && yum install nfs-utils + +Then do: + + # showmount -e 192.168.0.10 + +and you will get a list of the available NFS shares on 192.168.0.10: + +![Check Available NFS Shares](http://www.tecmint.com/wp-content/uploads/2015/04/Mount-NFS-Shares.png) + +Check Available NFS Shares + +To mount NFS network shares on the local client using the command line on demand, use the following syntax: + + # mount -t nfs -o [options] remote_host:/remote/directory /local/directory + +which, in our case, translates to: + + # mount -t nfs 192.168.0.10:/NFS-SHARE /mnt/nfs + +If you get the following error message: “Job for rpc-statd.service failed. See “systemctl status rpc-statd.service” and “journalctl -xn” for details.”, make sure the rpcbind service is enabled and started in your system first: + + # systemctl enable rpcbind.socket + # systemctl restart rpcbind.service + +and then reboot. That should do the trick and you will be able to mount your NFS share as explained earlier. If you need to mount the NFS share automatically on system boot, add a valid entry to the /etc/fstab file: + + remote_host:/remote/directory /local/directory nfs options 0 0 + +The variables remote_host, /remote/directory, /local/directory, and options (which is optional) are the same ones used when manually mounting an NFS share from the command line. As per our previous example: + + 192.168.0.10:/NFS-SHARE /mnt/nfs nfs defaults 0 0 + +#### Mounting CIFS (Samba) Network Shares #### + +Samba represents the tool of choice to make a network share available in a network with *nix and Windows machines. To show the Samba shares that are available, use the smbclient command with the -L flag, followed by the machine name or its IP address. This tool is included in the samba-client package: + +You will be prompted for root’s password in the remote host: + + # smbclient -L 192.168.0.10 + +![Check Samba Shares](http://www.tecmint.com/wp-content/uploads/2015/04/Check-Samba-Shares.png) + +Check Samba Shares + +To mount Samba network shares on the local client you will need to install first the cifs-utils package: + + # yum update && yum install cifs-utils + +Then use the following syntax on the command line: + + # mount -t cifs -o credentials=/path/to/credentials/file //remote_host/samba_share /local/directory + +which, in our case, translates to: + + # mount -t cifs -o credentials=~/.smbcredentials //192.168.0.10/gacanepa /mnt/samba + +where smbcredentials: + + username=gacanepa + password=XXXXXX + +is a hidden file inside root’s home (/root/) with permissions set to 600, so that no one else but the owner of the file can read or write to it. + +Please note that the samba_share is the name of the Samba share as returned by smbclient -L remote_host as shown above. + +Now, if you need the Samba share to be available automatically on system boot, add a valid entry to the /etc/fstab file as follows: + + //remote_host:/samba_share /local/directory cifs options 0 0 + +The variables remote_host, /samba_share, /local/directory, and options (which is optional) are the same ones used when manually mounting a Samba share from the command line. Following the definitions given in our previous example: + + //192.168.0.10/gacanepa /mnt/samba cifs credentials=/root/smbcredentials,defaults 0 0 + +### Conclusion ### + +In this article we have explained how to set up ACLs in Linux, and discussed how to mount CIFS and NFS network shares in a RHEL 7 client. + +I recommend you to practice these concepts and even mix them (go ahead and try to set ACLs in mounted network shares) until you feel comfortable. If you have questions or comments feel free to use the form below to contact us anytime. Also, feel free to share this article through your social networks. + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/rhcsa-exam-configure-acls-and-mount-nfs-samba-shares/ + +作者:[Gabriel Cánepa][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/gacanepa/ +[1]:http://www.tecmint.com/rhcsa-exam-create-format-resize-delete-and-encrypt-partitions-in-linux/ +[2]:http://www.tecmint.com/rhcsa-exam-manage-users-and-groups/ +[3]:https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Storage_Administration_Guide/ch-acls.html \ No newline at end of file diff --git a/sources/tech/RHCSA Series/RHCSA Series--Part 08--Securing SSH, Setting Hostname and Enabling Network Services.md b/sources/tech/RHCSA Series/RHCSA Series--Part 08--Securing SSH, Setting Hostname and Enabling Network Services.md new file mode 100644 index 0000000000..a381b1c94a --- /dev/null +++ b/sources/tech/RHCSA Series/RHCSA Series--Part 08--Securing SSH, Setting Hostname and Enabling Network Services.md @@ -0,0 +1,215 @@ +RHCSA Series: Securing SSH, Setting Hostname and Enabling Network Services – Part 8 +================================================================================ +As a system administrator you will often have to log on to remote systems to perform a variety of administration tasks using a terminal emulator. You will rarely sit in front of a real (physical) terminal, so you need to set up a way to log on remotely to the machines that you will be asked to manage. + +In fact, that may be the last thing that you will have to do in front of a physical terminal. For security reasons, using Telnet for this purpose is not a good idea, as all traffic goes through the wire in unencrypted, plain text. + +In addition, in this article we will also review how to configure network services to start automatically at boot and learn how to set up network and hostname resolution statically or dynamically. + +![RHCSA: Secure SSH and Enable Network Services](http://www.tecmint.com/wp-content/uploads/2015/05/Secure-SSH-Server-and-Enable-Network-Services.png) + +RHCSA: Secure SSH and Enable Network Services – Part 8 + +### Installing and Securing SSH Communication ### + +For you to be able to log on remotely to a RHEL 7 box using SSH, you will have to install the openssh, openssh-clients and openssh-servers packages. The following command not only will install the remote login program, but also the secure file transfer tool, as well as the remote file copy utility: + + # yum update && yum install openssh openssh-clients openssh-servers + +Note that it’s a good idea to install the server counterparts as you may want to use the same machine as both client and server at some point or another. + +After installation, there is a couple of basic things that you need to take into account if you want to secure remote access to your SSH server. The following settings should be present in the `/etc/ssh/sshd_config` file. + +1. Change the port where the sshd daemon will listen on from 22 (the default value) to a high port (2000 or greater), but first make sure the chosen port is not being used. + +For example, let’s suppose you choose port 2500. Use [netstat][1] in order to check whether the chosen port is being used or not: + + # netstat -npltu | grep 2500 + +If netstat does not return anything, you can safely use port 2500 for sshd, and you should change the Port setting in the configuration file as follows: + + Port 2500 + +2. Only allow protocol 2: + +Protocol 2 + +3. Configure the authentication timeout to 2 minutes, do not allow root logins, and restrict to a minimum the list of users which are allowed to login via ssh: + + LoginGraceTime 2m + PermitRootLogin no + AllowUsers gacanepa + +4. If possible, use key-based instead of password authentication: + + PasswordAuthentication no + RSAAuthentication yes + PubkeyAuthentication yes + +This assumes that you have already created a key pair with your user name on your client machine and copied it to your server as explained here. + +- [Enable SSH Passwordless Login][2] + +### Configuring Networking and Name Resolution ### + +1. Every system administrator should be well acquainted with the following system-wide configuration files: + +- /etc/hosts is used to resolve names <---> IPs in small networks. + +Every line in the `/etc/hosts` file has the following structure: + + IP address - Hostname - FQDN + +For example, + + 192.168.0.10 laptop laptop.gabrielcanepa.com.ar + +2. `/etc/resolv.conf` specifies the IP addresses of DNS servers and the search domain, which is used for completing a given query name to a fully qualified domain name when no domain suffix is supplied. + +Under normal circumstances, you don’t need to edit this file as it is managed by the system. However, should you want to change DNS servers, be advised that you need to stick to the following structure in each line: + + nameserver - IP address + +For example, + + nameserver 8.8.8.8 + +3. 3. `/etc/host.conf` specifies the methods and the order by which hostnames are resolved within a network. In other words, tells the name resolver which services to use, and in what order. + +Although this file has several options, the most common and basic setup includes a line as follows: + + order bind,hosts + +Which indicates that the resolver should first look in the nameservers specified in `resolv.conf` and then to the `/etc/hosts` file for name resolution. + +4. `/etc/sysconfig/network` contains routing and global host information for all network interfaces. The following values may be used: + + NETWORKING=yes|no + HOSTNAME=value + +Where value should be the Fully Qualified Domain Name (FQDN). + + GATEWAY=XXX.XXX.XXX.XXX + +Where XXX.XXX.XXX.XXX is the IP address of the network’s gateway. + + GATEWAYDEV=value + +In a machine with multiple NICs, value is the gateway device, such as enp0s3. + +5. Files inside `/etc/sysconfig/network-scripts` (network adapters configuration files). + +Inside the directory mentioned previously, you will find several plain text files named. + + ifcfg-name + +Where name is the name of the NIC as returned by ip link show: + +![Check Network Link Status](http://www.tecmint.com/wp-content/uploads/2015/05/Check-IP-Address.png) + +Check Network Link Status + +For example: + +![Network Files](http://www.tecmint.com/wp-content/uploads/2015/05/Network-Files.png) + +Network Files + +Other than for the loopback interface, you can expect a similar configuration for your NICs. Note that some variables, if set, will override those present in `/etc/sysconfig/network` for this particular interface. Each line is commented for clarification in this article but in the actual file you should avoid comments: + + HWADDR=08:00:27:4E:59:37 # The MAC address of the NIC + TYPE=Ethernet # Type of connection + BOOTPROTO=static # This indicates that this NIC has been assigned a static IP. If this variable was set to dhcp, the NIC will be assigned an IP address by a DHCP server and thus the next two lines should not be present in that case. + IPADDR=192.168.0.18 + NETMASK=255.255.255.0 + GATEWAY=192.168.0.1 + NM_CONTROLLED=no # Should be added to the Ethernet interface to prevent NetworkManager from changing the file. + NAME=enp0s3 + UUID=14033805-98ef-4049-bc7b-d4bea76ed2eb + ONBOOT=yes # The operating system should bring up this NIC during boot + +### Setting Hostnames ### + +In Red Hat Enterprise Linux 7, the hostnamectl command is used to both query and set the system’s hostname. + +To display the current hostname, type: + + # hostnamectl status + +![Check System hostname in CentOS 7](http://www.tecmint.com/wp-content/uploads/2015/05/Check-System-hostname.png) + +Check System Hostname + +To change the hostname, use + + # hostnamectl set-hostname [new hostname] + +For example, + + # hostnamectl set-hostname cinderella + +For the changes to take effect you will need to restart the hostnamed daemon (that way you will not have to log off and on again in order to apply the change): + + # systemctl restart systemd-hostnamed + +![Set System Hostname in CentOS 7](http://www.tecmint.com/wp-content/uploads/2015/05/Set-System-Hostname.png) + +Set System Hostname + +In addition, RHEL 7 also includes the nmcli utility that can be used for the same purpose. To display the hostname, run: + + # nmcli general hostname + +and to change it: + + # nmcli general hostname [new hostname] + +For example, + + # nmcli general hostname rhel7 + +![Set Hostname Using nmcli Command](http://www.tecmint.com/wp-content/uploads/2015/05/nmcli-command.png) + +Set Hostname Using nmcli Command + +### Starting Network Services on Boot ### + +To wrap up, let us see how we can ensure that network services are started automatically on boot. In simple terms, this is done by creating symlinks to certain files specified in the [Install] section of the service configuration files. + +In the case of firewalld (/usr/lib/systemd/system/firewalld.service): + + [Install] + WantedBy=basic.target + Alias=dbus-org.fedoraproject.FirewallD1.service + +To enable the service: + + # systemctl enable firewalld + +On the other hand, disabling firewalld entitles removing the symlinks: + + # systemctl disable firewalld + +![Enable Service at System Boot](http://www.tecmint.com/wp-content/uploads/2015/05/Enable-Service-at-System-Boot.png) + +Enable Service at System Boot + +### Conclusion ### + +In this article we have summarized how to install and secure connections via SSH to a RHEL server, how to change its name, and finally how to ensure that network services are started on boot. If you notice that a certain service has failed to start properly, you can use systemctl status -l [service] and journalctl -xn to troubleshoot it. + +Feel free to let us know what you think about this article using the comment form below. Questions are also welcome. We look forward to hearing from you! + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/rhcsa-series-secure-ssh-set-hostname-enable-network-services-in-rhel-7/ + +作者:[Gabriel Cánepa][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/gacanepa/ +[1]:http://www.tecmint.com/20-netstat-commands-for-linux-network-management/ +[2]:http://www.tecmint.com/ssh-passwordless-login-using-ssh-keygen-in-5-easy-steps/ \ No newline at end of file diff --git a/sources/tech/RHCSA Series/RHCSA Series--Part 09--Installing, Configuring and Securing a Web and FTP Server.md b/sources/tech/RHCSA Series/RHCSA Series--Part 09--Installing, Configuring and Securing a Web and FTP Server.md new file mode 100644 index 0000000000..6a1e544de3 --- /dev/null +++ b/sources/tech/RHCSA Series/RHCSA Series--Part 09--Installing, Configuring and Securing a Web and FTP Server.md @@ -0,0 +1,176 @@ +RHCSA Series: Installing, Configuring and Securing a Web and FTP Server – Part 9 +================================================================================ +A web server (also known as a HTTP server) is a service that handles content (most commonly web pages, but other types of documents as well) over to a client in a network. + +A FTP server is one of the oldest and most commonly used resources (even to this day) to make files available to clients on a network in cases where no authentication is necessary since FTP uses username and password without encryption. + +The web server available in RHEL 7 is version 2.4 of the Apache HTTP Server. As for the FTP server, we will use the Very Secure Ftp Daemon (aka vsftpd) to establish connections secured by TLS. + +![Configuring and Securing Apache and FTP Server](http://www.tecmint.com/wp-content/uploads/2015/05/Install-Configure-Secure-Apache-FTP-Server.png) + +RHCSA: Installing, Configuring and Securing Apache and FTP – Part 9 + +In this article we will explain how to install, configure, and secure a web server and a FTP server in RHEL 7. + +### Installing Apache and FTP Server ### + +In this guide we will use a RHEL 7 server with a static IP address of 192.168.0.18/24. To install Apache and VSFTPD, run the following command: + + # yum update && yum install httpd vsftpd + +When the installation completes, both services will be disabled initially, so we need to start them manually for the time being and enable them to start automatically beginning with the next boot: + + # systemctl start httpd + # systemctl enable httpd + # systemctl start vsftpd + # systemctl enable vsftpd + +In addition, we have to open ports 80 and 21, where the web and ftp daemons are listening, respectively, in order to allow access to those services from the outside: + + # firewall-cmd --zone=public --add-port=80/tcp --permanent + # firewall-cmd --zone=public --add-service=ftp --permanent + # firewall-cmd --reload + +To confirm that the web server is working properly, fire up your browser and enter the IP of the server. You should see the test page: + +![Confirm Apache Web Server](http://www.tecmint.com/wp-content/uploads/2015/05/Confirm-Apache-Web-Server.png) + +Confirm Apache Web Server + +As for the ftp server, we will have to configure it further, which we will do in a minute, before confirming that it’s working as expected. + +### Configuring and Securing Apache Web Server ### + +The main configuration file for Apache is located in `/etc/httpd/conf/httpd.conf`, but it may rely on other files present inside `/etc/httpd/conf.d`. + +Although the default configuration should be sufficient for most cases, it’s a good idea to become familiar with all the available options as described in the [official documentation][1]. + +As always, make a backup copy of the main configuration file before editing it: + + # cp /etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf.$(date +%Y%m%d) + +Then open it with your preferred text editor and look for the following variables: + +- ServerRoot: the directory where the server’s configuration, error, and log files are kept. +- Listen: instructs Apache to listen on specific IP address and / or ports. +- Include: allows the inclusion of other configuration files, which must exist. Otherwise, the server will fail, as opposed to the IncludeOptional directive, which is silently ignored if the specified configuration files do not exist. +- User and Group: the name of the user/group to run the httpd service as. +- DocumentRoot: The directory out of which Apache will serve your documents. By default, all requests are taken from this directory, but symbolic links and aliases may be used to point to other locations. +- ServerName: this directive sets the hostname (or IP address) and port that the server uses to identify itself. + +The first security measure will consist of creating a dedicated user and group (i.e. tecmint/tecmint) to run the web server as and changing the default port to a higher one (9000 in this case): + + ServerRoot "/etc/httpd" + Listen 192.168.0.18:9000 + User tecmint + Group tecmint + DocumentRoot "/var/www/html" + ServerName 192.168.0.18:9000 + +You can test the configuration file with. + + # apachectl configtest + +and if everything is OK, then restart the web server. + + # systemctl restart httpd + +and don’t forget to enable the new port (and disable the old one) in the firewall: + + # firewall-cmd --zone=public --remove-port=80/tcp --permanent + # firewall-cmd --zone=public --add-port=9000/tcp --permanent + # firewall-cmd --reload + +Note that, due to SELinux policies, you can only use the ports returned by + + # semanage port -l | grep -w '^http_port_t' + +for the web server. + +If you want to use another port (i.e. TCP port 8100), you will have to add it to SELinux port context for the httpd service: + +# semanage port -a -t http_port_t -p tcp 8100 + +![Add Apache Port to SELinux Policies](http://www.tecmint.com/wp-content/uploads/2015/05/Add-Apache-Port-to-SELinux-Policies.png) + +Add Apache Port to SELinux Policies + +To further secure your Apache installation, follow these steps: + +1. The user Apache is running as should not have access to a shell: + + # usermod -s /sbin/nologin tecmint + +2. Disable directory listing in order to prevent the browser from displaying the contents of a directory if there is no index.html present in that directory. + +Edit `/etc/httpd/conf/httpd.conf` (and the configuration files for virtual hosts, if any) and make sure that the Options directive, both at the top and at Directory block levels, is set to None: + + Options None + +3. Hide information about the web server and the operating system in HTTP responses. Edit /etc/httpd/conf/httpd.conf as follows: + + ServerTokens Prod + ServerSignature Off + +Now you are ready to start serving content from your /var/www/html directory. + +### Configuring and Securing FTP Server ### + +As in the case of Apache, the main configuration file for Vsftpd `(/etc/vsftpd/vsftpd.conf)` is well commented and while the default configuration should suffice for most applications, you should become acquainted with the documentation and the man page `(man vsftpd.conf)` in order to operate the ftp server more efficiently (I can’t emphasize that enough!). + +In our case, these are the directives used: + + anonymous_enable=NO + local_enable=YES + write_enable=YES + local_umask=022 + dirmessage_enable=YES + xferlog_enable=YES + connect_from_port_20=YES + xferlog_std_format=YES + chroot_local_user=YES + allow_writeable_chroot=YES + listen=NO + listen_ipv6=YES + pam_service_name=vsftpd + userlist_enable=YES + tcp_wrappers=YES + +By using `chroot_local_user=YES`, local users will be (by default) placed in a chroot’ed jail in their home directory right after login. This means that local users will not be able to access any files outside their corresponding home directories. + +Finally, to allow ftp to read files in the user’s home directory, set the following SELinux boolean: + + # setsebool -P ftp_home_dir on + +You can now connect to the ftp server using a client such as Filezilla: + +![Check FTP Connection](http://www.tecmint.com/wp-content/uploads/2015/05/Check-FTP-Connection.png) + +Check FTP Connection + +Note that the `/var/log/xferlo`g log records downloads and uploads, which concur with the above directory listing: + +![Monitor FTP Download and Upload](http://www.tecmint.com/wp-content/uploads/2015/05/Monitor-FTP-Download-Upload.png) + +Monitor FTP Download and Upload + +Read Also: [Limit FTP Network Bandwidth Used by Applications in a Linux System with Trickle][2] + +### Summary ### + +In this tutorial we have explained how to set up a web and a ftp server. Due to the vastness of the subject, it is not possible to cover all the aspects of these topics (i.e. virtual web hosts). Thus, I recommend you also check other excellent articles in this website about [Apache][3]. + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/rhcsa-series-install-and-secure-apache-web-server-and-ftp-in-rhel/ + +作者:[Gabriel Cánepa][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/gacanepa/ +[1]:http://httpd.apache.org/docs/2.4/ +[2]:http://www.tecmint.com/manage-and-limit-downloadupload-bandwidth-with-trickle-in-linux/ +[3]:http://www.google.com/cse?cx=partner-pub-2601749019656699:2173448976&ie=UTF-8&q=virtual+hosts&sa=Search&gws_rd=cr&ei=Dy9EVbb0IdHisASnroG4Bw#gsc.tab=0&gsc.q=apache \ No newline at end of file diff --git a/sources/tech/RHCSA Series/RHCSA Series--Part 10--Yum Package Management, Automating Tasks with Cron and Monitoring System Logs.md b/sources/tech/RHCSA Series/RHCSA Series--Part 10--Yum Package Management, Automating Tasks with Cron and Monitoring System Logs.md new file mode 100644 index 0000000000..04c7d7a29e --- /dev/null +++ b/sources/tech/RHCSA Series/RHCSA Series--Part 10--Yum Package Management, Automating Tasks with Cron and Monitoring System Logs.md @@ -0,0 +1,197 @@ +RHCSA Series: Yum Package Management, Automating Tasks with Cron and Monitoring System Logs – Part 10 +================================================================================ +In this article we will review how to install, update, and remove packages in Red Hat Enterprise Linux 7. We will also cover how to automate tasks using cron, and will finish this guide explaining how to locate and interpret system logs files with the focus of teaching you why all of these are essential skills for every system administrator. + +![Yum Package Management Cron Jobs Log Monitoring Linux](http://www.tecmint.com/wp-content/uploads/2015/05/Yum-Package-Management-Cron-Job-Log-Monitoring-Linux.jpg) + +RHCSA: Yum Package Management, Cron Job Scheduling and Log Monitoring – Part 10 + +### Managing Packages Via Yum ### + +To install a package along with all its dependencies that are not already installed, you will use: + + # yum -y install package_name(s) + +Where package_name(s) represent at least one real package name. + +For example, to install httpd and mlocate (in that order), type. + + # yum -y install httpd mlocate + +**Note**: That the letter y in the example above bypasses the confirmation prompts that yum presents before performing the actual download and installation of the requested programs. You can leave it out if you want. + +By default, yum will install the package with the architecture that matches the OS architecture, unless overridden by appending the package architecture to its name. + +For example, on a 64 bit system, yum install package will install the x86_64 version of package, whereas yum install package.x86 (if available) will install the 32-bit one. + +There will be times when you want to install a package but don’t know its exact name. The search all or search options can search the currently enabled repositories for a certain keyword in the package name and/or in its description as well, respectively. + +For example, + + # yum search log + +will search the installed repositories for packages with the word log in their names and summaries, whereas + + # yum search all log + +will look for the same keyword in the package description and url fields as well. + +Once the search returns a package listing, you may want to display further information about some of them before installing. That is when the info option will come in handy: + + # yum info logwatch + +![Search Package Information](http://www.tecmint.com/wp-content/uploads/2015/05/Search-Package-Information.png) + +Search Package Information + +You can regularly check for updates with the following command: + + # yum check-update + +The above command will return all the installed packages for which an update is available. In the example shown in the image below, only rhel-7-server-rpms has an update available: + +![Check For Package Updates](http://www.tecmint.com/wp-content/uploads/2015/05/Check-For-Updates.png) + +Check For Package Updates + +You can then update that package alone with, + + # yum update rhel-7-server-rpms + +If there are several packages that can be updated, yum update will update all of them at once. + +Now what happens when you know the name of an executable, such as ps2pdf, but don’t know which package provides it? You can find out with `yum whatprovides “*/[executable]”`: + + # yum whatprovides “*/ps2pdf” + +![Find Package Belongs to Which Package](http://www.tecmint.com/wp-content/uploads/2015/05/Find-Package-Information.png) + +Find Package Belongs to Which Package + +Now, when it comes to removing a package, you can do so with yum remove package. Easy, huh? This goes to show that yum is a complete and powerful package manager. + + # yum remove httpd + +Read Also: [20 Yum Commands to Manage RHEL 7 Package Management][1] + +### Good Old Plain RPM ### + +RPM (aka RPM Package Manager, or originally RedHat Package Manager) can also be used to install or update packages when they come in form of standalone `.rpm` packages. + +It is often utilized with the `-Uvh` flags to indicate that it should install the package if it’s not already present or attempt to update it if it’s installed `(-U)`, producing a verbose output `(-v)` and a progress bar with hash marks `(-h)` while the operation is being performed. For example, + + # rpm -Uvh package.rpm + +Another typical use of rpm is to produce a list of currently installed packages with code>rpm -qa (short for query all): + + # rpm -qa + +![Query All RPM Packages](http://www.tecmint.com/wp-content/uploads/2015/05/Query-All-RPM-Packages.png) + +Query All RPM Packages + +Read Also: [20 RPM Commands to Install Packages in RHEL 7][2] + +### Scheduling Tasks using Cron ### + +Linux and other Unix-like operating systems include a tool called cron that allows you to schedule tasks (i.e. commands or shell scripts) to run on a periodic basis. Cron checks every minute the /var/spool/cron directory for files which are named after accounts in /etc/passwd. + +When executing commands, any output is mailed to the owner of the crontab (or to the user specified in the MAILTO environment variable in the /etc/crontab, if it exists). + +Crontab files (which are created by typing crontab -e and pressing Enter) have the following format: + +![Crontab Entries](http://www.tecmint.com/wp-content/uploads/2015/05/Crontab-Format.png) + +Crontab Entries + +Thus, if we want to update the local file database (which is used by locate to find files by name or pattern) every second day of the month at 2:15 am, we need to add the following crontab entry: + + 15 02 2 * * /bin/updatedb + +The above crontab entry reads, “Run /bin/updatedb on the second day of the month, every month of the year, regardless of the day of the week, at 2:15 am”. As I’m sure you already guessed, the star symbol is used as a wildcard character. + +After adding a cron job, you can see that a file named root was added inside /var/spool/cron, as we mentioned earlier. That file lists all the tasks that the crond daemon should run: + + # ls -l /var/spool/cron + +![Check All Cron Jobs](http://www.tecmint.com/wp-content/uploads/2015/05/Check-All-Cron-Jobs.png) + +Check All Cron Jobs + +In the above image, the current user’s crontab can be displayed either using cat /var/spool/cron/root or, + + # crontab -l + +If you need to run a task on a more fine-grained basis (for example, twice a day or three times each month), cron can also help you to do that. + +For example, to run /my/script on the 1st and 15th of each month and send any output to /dev/null, you can add two crontab entries as follows: + + 01 00 1 * * /myscript > /dev/null 2>&1 + 01 00 15 * * /my/script > /dev/null 2>&1 + +But in order for the task to be easier to maintain, you can combine both entries into one: + + 01 00 1,15 * * /my/script > /dev/null 2>&1 + +Following the previous example, we can run /my/other/script at 1:30 am on the first day of the month every three months: + + 30 01 1 1,4,7,10 * /my/other/script > /dev/null 2>&1 + +But when you have to repeat a certain task every “x” minutes, hours, days, or months, you can divide the right position by the desired frequency. The following crontab entry has the exact same meaning as the previous one: + + 30 01 1 */3 * /my/other/script > /dev/null 2>&1 + +Or perhaps you need to run a certain job on a fixed frequency or after the system boots, for example. You can use one of the following string instead of the five fields to indicate the exact time when you want your job to run: + + @reboot Run when the system boots. + @yearly Run once a year, same as 00 00 1 1 *. + @monthly Run once a month, same as 00 00 1 * *. + @weekly Run once a week, same as 00 00 * * 0. + @daily Run once a day, same as 00 00 * * *. + @hourly Run once an hour, same as 00 * * * *. + +Read Also: [11 Commands to Schedule Cron Jobs in RHEL 7][3] + +### Locating and Checking Logs ### + +System logs are located (and rotated) inside the /var/log directory. According to the Linux Filesystem Hierarchy Standard, this directory contains miscellaneous log files, which are written to it or an appropriate subdirectory (such as audit, httpd, or samba in the image below) by the corresponding daemons during system operation: + + # ls /var/log + +![Linux Log Files Location](http://www.tecmint.com/wp-content/uploads/2015/05/Linux-Log-Files.png) + +Linux Log Files Location + +Other interesting logs are [dmesg][4] (contains all messages from kernel ring buffer), secure (logs connection attempts that require user authentication), messages (system-wide messages) and wtmp (records of all user logins and logouts). + +Logs are very important in that they allow you to have a glimpse of what is going on at all times in your system, and what has happened in the past. They represent a priceless tool to troubleshoot and monitor a Linux server, and thus are often used with the `tail -f command` to display events, in real time, as they happen and are recorded in a log. + +For example, if you want to display kernel-related events, type the following command: + + # tail -f /var/log/dmesg + +Same if you want to view access to your web server: + + # tail -f /var/log/httpd/access.log + +### Summary ### + +If you know how to efficiently manage packages, schedule tasks, and where to look for information about the current and past operation of your system you can rest assure that you will not run into surprises very often. I hope this article has helped you learn or refresh your knowledge about these basic skills. + +Don’t hesitate to drop us a line using the contact form below if you have any questions or comments. + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/yum-package-management-cron-job-scheduling-monitoring-linux-logs/ + +作者:[Gabriel Cánepa][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/gacanepa/ +[1]:http://www.tecmint.com/20-linux-yum-yellowdog-updater-modified-commands-for-package-mangement/ +[2]:http://www.tecmint.com/20-practical-examples-of-rpm-commands-in-linux/ +[3]:http://www.tecmint.com/11-cron-scheduling-task-examples-in-linux/ +[4]:http://www.tecmint.com/dmesg-commands/ \ No newline at end of file diff --git a/sources/tech/RHCSA Series/RHCSA Series--Part 11--Firewall Essentials and Network Traffic Control Using FirewallD and Iptables.md b/sources/tech/RHCSA Series/RHCSA Series--Part 11--Firewall Essentials and Network Traffic Control Using FirewallD and Iptables.md new file mode 100644 index 0000000000..fd27f4c6fc --- /dev/null +++ b/sources/tech/RHCSA Series/RHCSA Series--Part 11--Firewall Essentials and Network Traffic Control Using FirewallD and Iptables.md @@ -0,0 +1,191 @@ +RHCSA Series: Firewall Essentials and Network Traffic Control Using FirewallD and Iptables – Part 11 +================================================================================ +In simple words, a firewall is a security system that controls the incoming and outgoing traffic in a network based on a set of predefined rules (such as the packet destination / source or type of traffic, for example). + +![Control Network Traffic with FirewallD and Iptables](http://www.tecmint.com/wp-content/uploads/2015/05/Control-Network-Traffic-Using-Firewall.png) + +RHCSA: Control Network Traffic with FirewallD and Iptables – Part 11 + +In this article we will review the basics of firewalld, the default dynamic firewall daemon in Red Hat Enterprise Linux 7, and iptables service, the legacy firewall service for Linux, with which most system and network administrators are well acquainted, and which is also available in RHEL 7. + +### A Comparison Between FirewallD and Iptables ### + +Under the hood, both firewalld and the iptables service talk to the netfilter framework in the kernel through the same interface, not surprisingly, the iptables command. However, as opposed to the iptables service, firewalld can change the settings during normal system operation without existing connections being lost. + +Firewalld should be installed by default in your RHEL system, though it may not be running. You can verify with the following commands (firewall-config is the user interface configuration tool): + + # yum info firewalld firewall-config + +![Check FirewallD Information](http://www.tecmint.com/wp-content/uploads/2015/05/Check-FirewallD-Information.png) + +Check FirewallD Information + +and, + + # systemctl status -l firewalld.service + +![Check FirewallD Status](http://www.tecmint.com/wp-content/uploads/2015/05/Check-FirewallD-Status.png) + +Check FirewallD Status + +On the other hand, the iptables service is not included by default, but can be installed through. + + # yum update && yum install iptables-services + +Both daemons can be started and enabled to start on boot with the usual systemd commands: + + # systemctl start firewalld.service | iptables-service.service + # systemctl enable firewalld.service | iptables-service.service + +Read Also: [Useful Commands to Manage Systemd Services][1] + +As for the configuration files, the iptables service uses `/etc/sysconfig/iptables` (which will not exist if the package is not installed in your system). On a RHEL 7 box used as a cluster node, this file looks as follows: + +![Iptables Firewall Configuration](http://www.tecmint.com/wp-content/uploads/2015/05/Iptables-Rules.png) + +Iptables Firewall Configuration + +Whereas firewalld store its configuration across two directories, `/usr/lib/firewalld` and `/etc/firewalld`: + + # ls /usr/lib/firewalld /etc/firewalld + +![FirewallD Configuration](http://www.tecmint.com/wp-content/uploads/2015/05/Firewalld-configuration.png) + +FirewallD Configuration + +We will examine these configuration files further later in this article, after we add a few rules here and there. By now it will suffice to remind you that you can always find more information about both tools with. + + # man firewalld.conf + # man firewall-cmd + # man iptables + +Other than that, remember to take a look at [Reviewing Essential Commands & System Documentation – Part 1][2] of the current series, where I described several sources where you can get information about the packages installed on your RHEL 7 system. + +### Using Iptables to Control Network Traffic ### + +You may want to refer to [Configure Iptables Firewall – Part 8][3] of the Linux Foundation Certified Engineer (LFCE) series to refresh your memory about iptables internals before proceeding further. Thus, we will be able to jump in right into the examples. + +**Example 1: Allowing both incoming and outgoing web traffic** + +TCP ports 80 and 443 are the default ports used by the Apache web server to handle normal (HTTP) and secure (HTTPS) web traffic. You can allow incoming and outgoing web traffic through both ports on the enp0s3 interface as follows: + + # iptables -A INPUT -i enp0s3 -p tcp --dport 80 -m state --state NEW,ESTABLISHED -j ACCEPT + # iptables -A OUTPUT -o enp0s3 -p tcp --sport 80 -m state --state ESTABLISHED -j ACCEPT + # iptables -A INPUT -i enp0s3 -p tcp --dport 443 -m state --state NEW,ESTABLISHED -j ACCEPT + # iptables -A OUTPUT -o enp0s3 -p tcp --sport 443 -m state --state ESTABLISHED -j ACCEPT + +**Example 2: Block all (or some) incoming connections from a specific network** + +There may be times when you need to block all (or some) type of traffic originating from a specific network, say 192.168.1.0/24 for example: + + # iptables -I INPUT -s 192.168.1.0/24 -j DROP + +will drop all packages coming from the 192.168.1.0/24 network, whereas, + + # iptables -A INPUT -s 192.168.1.0/24 --dport 22 -j ACCEPT + +will only allow incoming traffic through port 22. + +**Example 3: Redirect incoming traffic to another destination** + +If you use your RHEL 7 box not only as a software firewall, but also as the actual hardware-based one, so that it sits between two distinct networks, IP forwarding must have been already enabled in your system. If not, you need to edit `/etc/sysctl.conf` and set the value of net.ipv4.ip_forward to 1, as follows: + + net.ipv4.ip_forward = 1 + +then save the change, close your text editor and finally run the following command to apply the change: + + # sysctl -p /etc/sysctl.conf + +For example, you may have a printer installed at an internal box with IP 192.168.0.10, with the CUPS service listening on port 631 (both on the print server and on your firewall). In order to forward print requests from clients on the other side of the firewall, you should add the following iptables rule: + + # iptables -t nat -A PREROUTING -i enp0s3 -p tcp --dport 631 -j DNAT --to 192.168.0.10:631 + +Please keep in mind that iptables reads its rules sequentially, so make sure the default policies or later rules do not override those outlined in the examples above. + +### Getting Started with FirewallD ### + +One of the changes introduced with firewalld are zones. This concept allows to separate networks into different zones level of trust the user has decided to place on the devices and traffic within that network. + +To list the active zones: + + # firewall-cmd --get-active-zones + +In the example below, the public zone is active, and the enp0s3 interface has been assigned to it automatically. To view all the information about a particular zone: + + # firewall-cmd --zone=public --list-all + +![List all FirewallD Zones](http://www.tecmint.com/wp-content/uploads/2015/05/View-FirewallD-Zones.png) + +List all FirewallD Zones + +Since you can read more about zones in the [RHEL 7 Security guide][4], we will only list some specific examples here. + +**Example 4: Allowing services through the firewall** + +To get a list of the supported services, use. + + # firewall-cmd --get-services + +![List All Supported Services](http://www.tecmint.com/wp-content/uploads/2015/05/List-All-Supported-Services.png) + +List All Supported Services + +To allow http and https web traffic through the firewall, effective immediately and on subsequent boots: + + # firewall-cmd --zone=MyZone --add-service=http + # firewall-cmd --zone=MyZone --permanent --add-service=http + # firewall-cmd --zone=MyZone --add-service=https + # firewall-cmd --zone=MyZone --permanent --add-service=https + # firewall-cmd --reload + +If code>–zone is omitted, the default zone (you can check with firewall-cmd –get-default-zone) is used. + +To remove the rule, replace the word add with remove in the above commands. + +**Example 5: IP / Port forwarding** + +First off, you need to find out if masquerading is enabled for the desired zone: + + # firewall-cmd --zone=MyZone --query-masquerade + +In the image below, we can see that masquerading is enabled for the external zone, but not for public: + +![Check Masquerading Status in Firewalld](http://www.tecmint.com/wp-content/uploads/2015/05/Check-masquerading.png) + +Check Masquerading Status + +You can either enable masquerading for public: + + # firewall-cmd --zone=public --add-masquerade + +or use masquerading in external. Here’s what we would do to replicate Example 3 with firewalld: + + # firewall-cmd --zone=external --add-forward-port=port=631:proto=tcp:toport=631:toaddr=192.168.0.10 + +And don’t forget to reload the firewall. + +You can find further examples on [Part 9][5] of the RHCSA series, where we explained how to allow or disable the ports that are usually used by a web server and a ftp server, and how to change the corresponding rule when the default port for those services are changed. In addition, you may want to refer to the firewalld wiki for further examples. + +Read Also: [Useful FirewallD Examples to Configure Firewall in RHEL 7][6] + +### Conclusion ### + +In this article we have explained what a firewall is, what are the available services to implement one in RHEL 7, and provided a few examples that can help you get started with this task. If you have any comments, suggestions, or questions, feel free to let us know using the form below. Thank you in advance! + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/firewalld-vs-iptables-and-control-network-traffic-in-firewall/ + +作者:[Gabriel Cánepa][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/gacanepa/ +[1]:http://www.tecmint.com/manage-services-using-systemd-and-systemctl-in-linux/ +[2]:http://www.tecmint.com/rhcsa-exam-reviewing-essential-commands-system-documentation/ +[3]:http://www.tecmint.com/configure-iptables-firewall/ +[4]:https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Security_Guide/sec-Using_Firewalls.html +[5]:http://www.tecmint.com/rhcsa-series-install-and-secure-apache-web-server-and-ftp-in-rhel/ +[6]:http://www.tecmint.com/firewalld-rules-for-centos-7/ \ No newline at end of file diff --git a/sources/tech/RHCSA Series/RHCSA Series--Part 12--Automate RHEL 7 Installations Using 'Kickstart'.md b/sources/tech/RHCSA Series/RHCSA Series--Part 12--Automate RHEL 7 Installations Using 'Kickstart'.md new file mode 100644 index 0000000000..a4365e311e --- /dev/null +++ b/sources/tech/RHCSA Series/RHCSA Series--Part 12--Automate RHEL 7 Installations Using 'Kickstart'.md @@ -0,0 +1,142 @@ +RHCSA Series: Automate RHEL 7 Installations Using ‘Kickstart’ – Part 12 +================================================================================ +Linux servers are rarely standalone boxes. Whether it is in a datacenter or in a lab environment, chances are that you have had to install several machines that will interact one with another in some way. If you multiply the time that it takes to install Red Hat Enterprise Linux 7 manually on a single server by the number of boxes that you need to set up, this can lead to a rather lengthy effort that can be avoided through the use of an unattended installation tool known as kickstart. + +In this article we will show what you need to use kickstart utility so that you can forget about babysitting servers during the installation process. + +![Automatic Kickstart Installation of RHEL 7](http://www.tecmint.com/wp-content/uploads/2015/05/Automatic-Kickstart-Installation-of-RHEL-7.jpg) + +RHCSA: Automatic Kickstart Installation of RHEL 7 + +#### Introducing Kickstart and Automated Installations #### + +Kickstart is an automated installation method used primarily by Red Hat Enterprise Linux (and other Fedora spin-offs, such as CentOS, Oracle Linux, etc.) to execute unattended operating system installation and configuration. Thus, kickstart installations allow system administrators to have identical systems, as far as installed package groups and system configuration are concerned, while sparing them the hassle of having to manually install each of them. + +### Preparing for a Kickstart Installation ### + +To perform a kickstart installation, we need to follow these steps: + +1. Create a Kickstart file, a plain text file with several predefined configuration options. + +2. Make the Kickstart file available on removable media, a hard drive or a network location. The client will use the rhel-server-7.0-x86_64-boot.iso file, whereas you will need to make the full ISO image (rhel-server-7.0-x86_64-dvd.iso) available from a network resource, such as a HTTP of FTP server (in our present case, we will use another RHEL 7 box with IP 192.168.0.18). + +3. Start the Kickstart installation + +To create a kickstart file, login to your Red Hat Customer Portal account, and use the [Kickstart configuration tool][1] to choose the desired installation options. Read each one of them carefully before scrolling down, and choose what best fits your needs: + +![Kickstart Configuration Tool](http://www.tecmint.com/wp-content/uploads/2015/05/Kickstart-Configuration-Tool.png) + +Kickstart Configuration Tool + +If you specify that the installation should be performed either through HTTP, FTP, or NFS, make sure the firewall on the server allows those services. + +Although you can use the Red Hat online tool to create a kickstart file, you can also create it manually using the following lines as reference. You will notice, for example, that the installation process will be in English, using the latin american keyboard layout and the America/Argentina/San_Luis time zone: + + lang en_US + keyboard la-latin1 + timezone America/Argentina/San_Luis --isUtc + rootpw $1$5sOtDvRo$In4KTmX7OmcOW9HUvWtfn0 --iscrypted + #platform x86, AMD64, or Intel EM64T + text + url --url=http://192.168.0.18//kickstart/media + bootloader --location=mbr --append="rhgb quiet crashkernel=auto" + zerombr + clearpart --all --initlabel + autopart + auth --passalgo=sha512 --useshadow + selinux --enforcing + firewall --enabled + firstboot --disable + %packages + @base + @backup-server + @print-server + %end + +In the online configuration tool, use 192.168.0.18 for HTTP Server and `/kickstart/tecmint.bin` for HTTP Directory in the Installation section after selecting HTTP as installation source. Finally, click the Download button at the right top corner to download the kickstart file. + +In the kickstart sample file above, you need to pay careful attention to. + + url --url=http://192.168.0.18//kickstart/media + +That directory is where you need to extract the contents of the DVD or ISO installation media. Before doing that, we will mount the ISO installation file in /media/rhel as a loop device: + + # mount -o loop /var/www/html/kickstart/rhel-server-7.0-x86_64-dvd.iso /media/rhel + +![Mount RHEL ISO Image](http://www.tecmint.com/wp-content/uploads/2015/05/Mount-RHEL-ISO-Image.png) + +Mount RHEL ISO Image + +Next, copy all the contents of /media/rhel to /var/www/html/kickstart/media: + + # cp -R /media/rhel /var/www/html/kickstart/media + +When you’re done, the directory listing and disk usage of /var/www/html/kickstart/media should look as follows: + +![Kickstart Media Files](http://www.tecmint.com/wp-content/uploads/2015/05/Kickstart-media-Files.png) + +Kickstart Media Files + +Now we’re ready to kick off the kickstart installation. + +Regardless of how you choose to create the kickstart file, it’s always a good idea to check its syntax before proceeding with the installation. To do that, install the pykickstart package. + + # yum update && yum install pykickstart + +And then use the ksvalidator utility to check the file: + + # ksvalidator /var/www/html/kickstart/tecmint.bin + +If the syntax is correct, you will not get any output, whereas if there’s an error in the file, you will get a warning notice indicating the line where the syntax is not correct or unknown. + +### Performing a Kickstart Installation ### + +To start, boot your client using the rhel-server-7.0-x86_64-boot.iso file. When the initial screen appears, select Install Red Hat Enterprise Linux 7.0 and press the Tab key to append the following stanza and press Enter: + + # inst.ks=http://192.168.0.18/kickstart/tecmint.bin + +![RHEL Kickstart Installation](http://www.tecmint.com/wp-content/uploads/2015/05/RHEL-Kickstart-Installation.png) + +RHEL Kickstart Installation + +Where tecmint.bin is the kickstart file created earlier. + +When you press Enter, the automated installation will begin, and you will see the list of packages that are being installed (the number and the names will differ depending on your choice of programs and package groups): + +![Automatic Kickstart Installation of RHEL 7](http://www.tecmint.com/wp-content/uploads/2015/05/Kickstart-Automatic-Installation.png) + +Automatic Kickstart Installation of RHEL 7 + +When the automated process ends, you will be prompted to remove the installation media and then you will be able to boot into your newly installed system: + +![RHEL 7 Boot Screen](http://www.tecmint.com/wp-content/uploads/2015/05/RHEL-7.png) + +RHEL 7 Boot Screen + +Although you can create your kickstart files manually as we mentioned earlier, you should consider using the recommended approach whenever possible. You can either use the online configuration tool, or the anaconda-ks.cfg file that is created by the installation process in root’s home directory. + +This file actually is a kickstart file, so you may want to install the first box manually with all the desired options (maybe modify the logical volumes layout or the file system on top of each one) and then use the resulting anaconda-ks.cfg file to automate the installation of the rest. + +In addition, using the online configuration tool or the anaconda-ks.cfg file to guide future installations will allow you to perform them using an encrypted root password out-of-the-box. + +### Conclusion ### + +Now that you know how to create kickstart files and how to use them to automate the installation of Red Hat Enterprise Linux 7 servers, you can forget about babysitting the installation process. This will give you time to do other things, or perhaps some leisure time if you’re lucky. + +Either way, let us know what you think about this article using the form below. Questions are also welcome! + +Read Also: [Automated Installations of Multiple RHEL/CentOS 7 Distributions using PXE and Kickstart][2] + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/automatic-rhel-installations-using-kickstart/ + +作者:[Gabriel Cánepa][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/gacanepa/ +[1]:https://access.redhat.com/labs/kickstartconfig/ +[2]:http://www.tecmint.com/multiple-centos-installations-using-kickstart/ \ No newline at end of file diff --git a/sources/tech/RHCSA Series/RHCSA Series--Part 13--Mandatory Access Control Essentials with SELinux in RHEL 7.md b/sources/tech/RHCSA Series/RHCSA Series--Part 13--Mandatory Access Control Essentials with SELinux in RHEL 7.md new file mode 100644 index 0000000000..1a0d08df8f --- /dev/null +++ b/sources/tech/RHCSA Series/RHCSA Series--Part 13--Mandatory Access Control Essentials with SELinux in RHEL 7.md @@ -0,0 +1,176 @@ +RHCSA Series: Mandatory Access Control Essentials with SELinux in RHEL 7 – Part 13 +================================================================================ +During this series we have explored in detail at least two access control methods: standard ugo/rwx permissions ([Manage Users and Groups – Part 3][1]) and access control lists ([Configure ACL’s on File Systems – Part 7][2]). + +![RHCSA Exam: SELinux Essentials and Control FileSystem Access](http://www.tecmint.com/wp-content/uploads/2015/06/SELinux-Control-File-System-Access.png) + +RHCSA Exam: SELinux Essentials and Control FileSystem Access + +Although necessary as first level permissions and access control mechanisms, they have some limitations that are addressed by Security Enhanced Linux (aka SELinux for short). + +One of such limitations is that a user can expose a file or directory to a security breach through a poorly elaborated chmod command and thus cause an unexpected propagation of access rights. As a result, any process started by that user can do as it pleases with the files owned by the user, where finally a malicious or otherwise compromised software can achieve root-level access to the entire system. + +With those limitations in mind, the United States National Security Agency (NSA) first devised SELinux, a flexible mandatory access control method, to restrict the ability of processes to access or perform other operations on system objects (such as files, directories, network ports, etc) to the least permission model, which can be modified later as needed. In few words, each element of the system is given only the access required to function. + +In RHEL 7, SELinux is incorporated into the kernel itself and is enabled in Enforcing mode by default. In this article we will explain briefly the basic concepts associated with SELinux and its operation. + +### SELinux Modes ### + +SELinux can operate in three different ways: + +- Enforcing: SELinux denies access based on SELinux policy rules, a set of guidelines that control the security engine. +- Permissive: SELinux does not deny access, but denials are logged for actions that would have been denied if running in enforcing mode. +- Disabled (self-explanatory). + +The `getenforce` command displays the current mode of SELinux, whereas `setenforce` (followed by a 1 or a 0) is used to change the mode to Enforcing or Permissive, respectively, during the current session only. + +In order to achieve persistence across logouts and reboots, you will need to edit the `/etc/selinux/config` file and set the SELINUX variable to either enforcing, permissive, or disabled: + + # getenforce + # setenforce 0 + # getenforce + # setenforce 1 + # getenforce + # cat /etc/selinux/config + +![Set SELinux Mode](http://www.tecmint.com/wp-content/uploads/2015/05/Set-SELinux-Mode.png) + +Set SELinux Mode + +Typically you will use setenforce to toggle between SELinux modes (enforcing to permissive and back) as a first troubleshooting step. If SELinux is currently set to enforcing while you’re experiencing a certain problem, and the same goes away when you set it to permissive, you can be confident you’re looking at a SELinux permissions issue. + +### SELinux Contexts ### + +A SELinux context consists of an access control environment where decisions are made based on SELinux user, role, and type (and optionally a level): + +- A SELinux user complements a regular Linux user account by mapping it to a SELinux user account, which in turn is used in the SELinux context for processes in that session, in order to explicitly define their allowed roles and levels. +- The concept of role acts as an intermediary between domains and SELinux users in that it defines which process domains and file types can be accessed. This will shield your system against vulnerability to privilege escalation attacks. +- A type defines an SELinux file type or an SELinux process domain. Under normal circumstances, processes are prevented from accessing files that other processes use, and and from accessing other processes, thus access is only allowed if a specific SELinux policy rule exists that allows it. + +Let’s see how all of that works through the following examples. + +**EXAMPLE 1: Changing the default port for the sshd daemon** + +In [Securing SSH – Part 8][3] we explained that changing the default port where sshd listens on is one of the first security measures to secure your server against external attacks. Let’s edit the `/etc/ssh/sshd_config` file and set the port to 9999: + + Port 9999 + +Save the changes, and restart sshd: + + # systemctl restart sshd + # systemctl status sshd + +![Change SSH Port](http://www.tecmint.com/wp-content/uploads/2015/05/Change-SSH-Port.png) + +Restart SSH Service + +As you can see, sshd has failed to start. But what happened? + +A quick inspection of `/var/log/audit/audit.log` indicates that sshd has been denied permissions to start on port 9999 (SELinux log messages include the word “AVC” so that they might be easily identified from other messages) because that is a reserved port for the JBoss Management service: + + # cat /var/log/audit/audit.log | grep AVC | tail -1 + +![Inspect SSH Logs](http://www.tecmint.com/wp-content/uploads/2015/05/Inspect-SSH-Logs.png) + +Inspect SSH Logs + +At this point you could disable SELinux (but don’t!) as explained earlier and try to start sshd again, and it should work. However, the semanage utility can tell us what we need to change in order for us to be able to start sshd in whatever port we choose without issues. + +Run, + + # semanage port -l | grep ssh + +to get a list of the ports where SELinux allows sshd to listen on. + +![Semanage Tool](http://www.tecmint.com/wp-content/uploads/2015/05/SELinux-Permission.png) + +Semanage Tool + +So let’s change the port in /etc/ssh/sshd_config to Port 9998, add the port to the ssh_port_t context, and then restart the service: + + # semanage port -a -t ssh_port_t -p tcp 9998 + # systemctl restart sshd + # systemctl is-active sshd + +![Semanage Add Port](http://www.tecmint.com/wp-content/uploads/2015/05/Semenage-Add-Port.png) + +Semanage Add Port + +As you can see, the service was started successfully this time. This example illustrates the fact that SELinux controls the TCP port number to its own port type internal definitions. + +**EXAMPLE 2: Allowing httpd to send access sendmail** + +This is an example of SELinux managing a process accessing another process. If you were to implement mod_security and mod_evasive along with Apache in your RHEL 7 server, you need to allow httpd to access sendmail in order to send a mail notification in the wake of a (D)DoS attack. In the following command, omit the -P flag if you do not want the change to be persistent across reboots. + + # semanage boolean -1 | grep httpd_can_sendmail + # setsebool -P httpd_can_sendmail 1 + # semanage boolean -1 | grep httpd_can_sendmail + +![Allow Apache to Send Mails](http://www.tecmint.com/wp-content/uploads/2015/05/Allow-Apache-to-Send-Mails.png) + +Allow Apache to Send Mails + +As you can tell from the above example, SELinux boolean settings (or just booleans) are true / false rules embedded into SELinux policies. You can list all the booleans with `semanage boolean -l`, and alternatively pipe it to grep in order to filter the output. + +**EXAMPLE 3: Serving a static site from a directory other than the default one** + +Suppose you are serving a static website using a different directory than the default one (`/var/www/html`), say /websites (this could be the case if you’re storing your web files in a shared network drive, for example, and need to mount it at /websites). + +a). Create an index.html file inside /websites with the following contents: + + +

SELinux test

+ + +If you do, + + # ls -lZ /websites/index.html + +you will see that the index.html file has been labeled with the default_t SELinux type, which Apache can’t access: + +![Check SELinux File Permission](http://www.tecmint.com/wp-content/uploads/2015/05/Check-File-Permssion.png) + +Check SELinux File Permission + +b). Change the DocumentRoot directive in `/etc/httpd/conf/httpd.conf` to /websites and don’t forget to update the corresponding Directory block. Then, restart Apache. + +c). Browse to `http://`, and you should get a 503 Forbidden HTTP response. + +d). Next, change the label of /websites, recursively, to the httpd_sys_content_t type in order to grant Apache read-only access to that directory and its contents: + + # semanage fcontext -a -t httpd_sys_content_t "/websites(/.*)?" + +e). Finally, apply the SELinux policy created in d): + + # restorecon -R -v /websites + +Now restart Apache and browse to `http://` again and you will see the html file displayed correctly: + +![Verify Apache Page](http://www.tecmint.com/wp-content/uploads/2015/05/08part13.png) + +Verify Apache Page + +### Summary ### + +In this article we have gone through the basics of SELinux. Note that due to the vastness of the subject, a full detailed explanation is not possible in a single article, but we believe that the principles outlined in this guide will help you to move on to more advanced topics should you wish to do so. + +If I may, let me recommend two essential resources to start with: the [NSA SELinux page][4] and the [RHEL 7 SELinux User’s and Administrator’s][5] guide. + +Don’t hesitate to let us know if you have any questions or comments. + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/selinux-essentials-and-control-filesystem-access/ + +作者:[Gabriel Cánepa][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/gacanepa/ +[1]:http://www.tecmint.com/rhcsa-exam-manage-users-and-groups +[2]:http://www.tecmint.com/rhcsa-exam-configure-acls-and-mount-nfs-samba-shares/ +[3]:http://www.tecmint.com/rhcsa-series-secure-ssh-set-hostname-enable-network-services-in-rhel-7/ +[4]:https://www.nsa.gov/research/selinux/index.shtml +[5]:https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/SELinux_Users_and_Administrators_Guide/part_I-SELinux.html \ No newline at end of file From 052047b2f0a378904493f2bfc9f42b87c6c22799 Mon Sep 17 00:00:00 2001 From: wolf <522858454@qq.com> Date: Tue, 9 Jun 2015 14:55:26 +0800 Subject: [PATCH 302/965] translating by chenzhijun --- ...o access Feedly RSS feed from the command line on Linux.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150209 How to access Feedly RSS feed from the command line on Linux.md b/sources/tech/20150209 How to access Feedly RSS feed from the command line on Linux.md index 58a0841280..16dccd8f8e 100644 --- a/sources/tech/20150209 How to access Feedly RSS feed from the command line on Linux.md +++ b/sources/tech/20150209 How to access Feedly RSS feed from the command line on Linux.md @@ -1,3 +1,5 @@ +translating by chenzhijun + How to access Feedly RSS feed from the command line on Linux ================================================================================ In case you didn't know, [Feedly][1] is one of the most popular online news aggregation services. It offers seamlessly unified news reading experience across desktops, Android and iOS devices via browser extensions and mobile apps. Feedly took on the demise of Google Reader in 2013, quickly gaining a lot of then Google Reader users. I was one of them, and Feedly has remained my default RSS reader since then. @@ -103,4 +105,4 @@ via: http://xmodulo.com/feedly-rss-feed-command-line-linux.html [a]:http://xmodulo.com/author/nanni [1]:https://feedly.com/ [2]:https://github.com/Jarkore/Feednix -[3]:https://aur.archlinux.org/packages/feednix/ \ No newline at end of file +[3]:https://aur.archlinux.org/packages/feednix/ From d8936df91b3097514e9fe8686beef2e2b028eed0 Mon Sep 17 00:00:00 2001 From: wwy-hust Date: Tue, 9 Jun 2015 16:13:34 +0800 Subject: [PATCH 303/965] finish translation --- ... Great for Remote Editing and Much More.md | 221 ------------------ ... Great for Remote Editing and Much More.md | 214 +++++++++++++++++ 2 files changed, 214 insertions(+), 221 deletions(-) delete mode 100644 sources/share/20141013 Compact Text Editors Great for Remote Editing and Much More.md create mode 100644 translated/share/20141013 Compact Text Editors Great for Remote Editing and Much More.md diff --git a/sources/share/20141013 Compact Text Editors Great for Remote Editing and Much More.md b/sources/share/20141013 Compact Text Editors Great for Remote Editing and Much More.md deleted file mode 100644 index b54a7b158f..0000000000 --- a/sources/share/20141013 Compact Text Editors Great for Remote Editing and Much More.md +++ /dev/null @@ -1,221 +0,0 @@ -translating by wwy-hust - -Compact Text Editors Great for Remote Editing and Much More -================================================================================ -A text editor is software used for editing plain text files. This type of software has many different uses including modifying configuration files, writing programming language source code, jotting down thoughts, or even making a grocery list. Given that editors can be used for such a diverse range of activities, it is worth spending the time finding an editor that best suites your preferences. - -Whatever the level of sophistication of the editor, they typically have a common set of functionality, such as searching/replacing text, formatting text, importing files, as well as moving text within the file. - -All of these text editors are console based applications which make them ideal for editing files on remote machines. Textadept also provides a graphical user interface, but remains fast and minimalist. - -Console based applications are also light on system resources (very useful on low spec machines), can be faster and more efficient than their graphical counterparts, they do not stop working when X needs to be restarted, and are great for scripting purposes. - -I have selected my favorite open source text editors that are frugal on system resources. - ----------- - -### Textadept ### - -![](http://www.linuxlinks.com/portal/content/reviews/Editors/Screenshot-Textadept.png) - -Textadept is a fast, minimalist, and extensible cross-platform open source text editor for programmers. This open source application is written in a mixture of C and Lua and has been optimized for speed and minimalism over the years. - -Textadept is an ideal editor for programmers who want endless extensibility options without sacrificing speed or succumbing to code bloat and featuritis. - -There is also a version available for the terminal, which only depends on ncurses; great for editing on remote machines. - -#### Features include: #### - - -- Lightweight -- Minimal design maximizes screen real estate -- Self-contained executable – no installation necessary -- Entirely keyboard driven -- Unlimited split views (GUI version) split the editor window as many times as you like either horizontally or vertically. Please note that Textadept is not a tabbed editor -- Support for over 80 programming languages -- Powerful snippets and key commands -- Code autocompletion and API lookup -- Unparalleled extensibility -- Bookmarks -- Find and Replace -- Find in Files -- Buffer-based word completion -- Adeptsense autocomplete symbols for programming languages and display API documentation -- Themes: light, dark, and term -- Uses lexers to assign names to buffer elements like comments, strings, and keywords -- Sessions -- Snapopen -- Available modules include support for Java, Python, Ruby and recent file lists -- Conforms with the Gnome HIG Human Interface Guidelines -- Modules include support for Java, Python, Ruby and recent file lists -- Support for editing Lua code. Syntax autocomplete and LuaDoc is available for many Textadept objects as well as Lua’s standard libraries - -- Website: [foicica.com/textadept][1] -- Developer: Mitchell and contributors -- License: MIT License -- Version Number: 7.7 - ----------- - -### Vim ### - -![](http://www.linuxlinks.com/portal/content/reviews/Editors/Screenshot-vim.png) - -Vim is an advanced text editor that seeks to provide the power of the editor 'Vi', with a more complete feature set. - -This editor is very useful for editing programs and other plain ASCII files. All commands are given with normal keyboard characters, so those who can type with ten fingers can work very fast. Additionally, function keys can be defined by the user, and the mouse can be used. - -Vim is often called a "programmer's editor," and is so useful for programming that many consider it to be an entire Integrated Development Environment. However, this application is not only intended for programmers. Vim is highly regarded for all kinds of text editing, from composing email to editing configuration files. - -Vim's interface is based on commands given in a text user interface. Although its graphical user interface, gVim, adds menus and toolbars for commonly used commands, the software's entire functionality is still reliant on its command line mode. - -#### Features include: #### - - -- 3 modes: -- - Command mode -- - Insert mode -- - Command line mode -- Unlimited undo -- Multiple windows and buffers -- Flexible insert mode -- Syntax highlighting highlight portions of the buffer in different colors or styles, based on the type of file being edited -- Interactive commands -- - Marking a line -- - vi line buffers -- - Shift a block of code -- Block operators -- Command line history -- Extended regular expressions -- Edit compressed/archive files (gzip, bzip2, zip, tar) -- Filename completion -- Block operations -- Jump tags -- Folding text -- Indenting -- ctags and cscope intergration -- 100% vi compatibility mode -- Plugins to add/extend functionality -- Macros -- vimscript, Vim's internal scripting language -- Unicode support -- Multi-language support -- Integrated On-line help - -- Website: [www.vim.org][2] -- Developer: Bram Moolenaar -- License: GNU GPL compatible (charityware) -- Version Number: 7.4 - ----------- - -### ne ### - -![](http://www.linuxlinks.com/portal/content/reviews/Editors/Screenshot-ne.png) - -ne is a full screen open source text editor. It is intended to be an easier to learn alternative to vi, yet still portable across POSIX-compliant operating systems. - -ne is easy to use for the beginner, but powerful and fully configurable for the wizard, and most sparing in its resource usage. - -#### Features include: #### - - -- Three user interfaces: control keystrokes, command line, and menus; keystrokes and menus are completely configurable -- Syntax highlighting -- Full support for UTF-8 files, including multiple-column characters -- The number of documents and clips, the dimensions of the display, and the file/line lengths are limited only by the integer size of the machine -- Simple scripting language where scripts can be generated via an idiotproof record/play method -- Unlimited undo/redo capability (can be disabled with a command) -- Automatic preferences system based on the extension of the file name being edited -- Automatic completion of prefixes using words in your documents as dictionary -- File requester with completion features for easy file retrieval; -- Extended regular expression search and replace à la emacs and vi -- A very compact memory model easily load and modify very large files -- Editing of binary files - -- Website: [ne.di.unimi.it][3] -- Developer: Sebastiano Vigna (original developer). Additional features added by Todd M. Lewis -- License: GNU GPL v3 -- Version Number: 2.5 - ----------- - -### Zile ### - -![](http://www.linuxlinks.com/portal/content/reviews/Editors/Screenshot-Zile.png) - -Zile Is Lossy Emacs (Zile) is a small Emacs clone. Zile is a customizable, self-documenting real-time display editor. Zile was written to be as similar as possible to Emacs; every Emacs user should feel comfortable with Zile. - -Zile is distinguished by a very small RAM memory footprint, of approximately 130kB, and quick editing sessions. It is 8-bit clean, allowing it to be used on any sort of file. - -#### Features include: #### - -- Small but fast and powerful -- Multi buffer editing with multi level undo -- Multi window -- Killing, yanking and registers -- Minibuffer completion -- Auto fill (word wrap) -- Registers -- Looks like Emacs. Key sequences, function and variable names are identical with Emacs's -- Killing -- Yanking -- Auto line ending detection - -- Website: [www.gnu.org/software/zile][4] -- Developer: Reuben Thomas, Sandro Sigala, David A. Capello -- License: GNU GPL v2 -- Version Number: 2.4.11 - ----------- - -### nano ### - -![](http://www.linuxlinks.com/portal/content/reviews/Editors/Screenshot-nano.png) - -nano is a curses-based text editor. It is a clone of Pico, the editor of the Pine email client. - -The nano project was started in 1999 due to licensing issues with the Pine suite (Pine was not distributed under a free software license), and also because Pico lacked some essential features. - -nano aims to emulate the functionality and easy-to-use interface of Pico, while offering additional functionality, but without the tight mailer integration of the Pine/Pico package. - -nano, like Pico, is keyboard-oriented, controlled with control keys. - -#### Features include: #### - -- Interactive search and replace -- Color syntax highlighting -- Go to line and column number -- Auto-indentation -- Feature toggles -- UTF-8 support -- Mixed file format auto-conversion -- Verbatim input mode -- Multiple file buffers -- Smooth scrolling -- Bracket matching -- Customizable quoting string -- Backup files -- Internationalization support -- Filename tab completion - -- Website: [nano-editor.org][5] -- Developer: Chris Allegretta, David Lawrence, Jordi Mallach, Adam Rogoyski, Robert Siemborski, Rocco Corsi, David Benbennick, Mike Frysinger -- License: GNU GPL v3 -- Version Number: 2.2.6 - --------------------------------------------------------------------------------- - -via: http://www.linuxlinks.com/article/20141011073917230/TextEditors.html - -作者:Frazer Kline -译者:[runningwater](https://github.com/runningwater) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[1]:http://foicica.com/textadept/ -[2]:http://www.vim.org/ -[3]:http://ne.di.unimi.it/ -[4]:http://www.gnu.org/software/zile/ -[5]:http://nano-editor.org/ diff --git a/translated/share/20141013 Compact Text Editors Great for Remote Editing and Much More.md b/translated/share/20141013 Compact Text Editors Great for Remote Editing and Much More.md new file mode 100644 index 0000000000..766f429ba0 --- /dev/null +++ b/translated/share/20141013 Compact Text Editors Great for Remote Editing and Much More.md @@ -0,0 +1,214 @@ +ʺԶ̱༭Լ໷ļı༭ +================================================================================ +ı༭༭ıô޸ļдԴ룬һЩ뷨дһݹбֱ༭ܶ಻ͬĻֵûЩʱһʺϲõı༭ + +۱༭жôӣͨһͬĹܼ/滻ıʽıļԼļƶı + +Щı༭ǻն˵ӦãǺʺԶϱ༭ļı༭ͨҲṩһͼλû棬ɻᱣ֤ٺС + +ն˵ӦóϵͳԴҲģڵûϺãͼλ汾Ҳ졢ЧXҪʱҲֹͣ˷dzʺϱдű + +ѡһЩϲĿԴı༭ʹϵͳԴ涼dzڼ + +---------- + +### Textadept ### + +![](http://www.linuxlinks.com/portal/content/reviews/Editors/Screenshot-Textadept.png) + +TextadeptһʺϳԱģ١Сչƽ̨ĿԴı༭ԴCLuaдͣЩٶȺСŻ + +TextadeptЩҪ޵չҲԸٶȻڴ͵ijԱǵ༭ + +Ҳһն˵İ汾ncursesʺԶϽб༭ + +#### ܰ: #### + +- +- СĻ +- ԰ִļ - 谲װ +- ȫ +- ƵķָͼGUI汾ˮƽֱķָ༭ڡעTextadeptûдļǩ +- ֶ֧80ֵı +- ǿƬο +- ԶȫAPIѯ +- ױȵչ +- ǩ +- Һ滻 +- ļв +- ڻĵʲȫ +- ıԷԶȫԼʾAPIĵĹ +- ⣺ڰն +- ʹôʷƷԪأַۡؼ +- Զ̻Ự +- ٴ +- õģ飬JavaPythonRubyͽڴļб֧ +- Gnome HIGûӿڵָ +- ֱ֧༭Lua롣﷨ԶȫLuaDocTextadeptLuaı׼⡣ + +- ַ: [foicica.com/textadept][1] +- : Mitchell and contributors +- ֤: MIT License +- 汾: 7.7 + +---------- + +### Vim ### + +![](http://www.linuxlinks.com/portal/content/reviews/Editors/Screenshot-vim.png) + +vimһ߼ı༭'vi'ǿ󣬲ӵиȫĹܼ + +༭Ա̺ͱ༭ASCIIļʮáеͨļַṩܹʹʮָ룬ʮֿݡ⣬ܼû壬ҿҲʹꡣ + +Vimͨ"Աı༭"ʮʺڱ̣ΪΪļɿȻǽԱVim߶Ӹı༭ӱдemail޸ļ + +VimĽӿڻıµСͼλ汾gVimΪõ˲˵͹ģʽ + +#### ܰ: #### + +- 3 ģʽ: +- - Command ģʽ +- - Insert ģʽ +- - Command line ģʽ +- Ƶij +- ںͻ +- ƽģʽ +- ༭ļʹòͬɫ﷨ +- +- - һ +- - vi л +- - ƶ +- +- ʷ +- չʽ +- ༭ѹ/ļ (gzip, bzip2, zip, tar) +- ļȫ +- ת +- ۵ı +- +- ctagscscope +- 100%viģʽ +- /չ +- +- vimscript, Vimڲű +- Unicode֧ +- ֧ +- ֧߰ + +- ַ: [www.vim.org][2] +- : Bram Moolenaar +- ֤: GNU GPL compatible (charityware) +- 汾: 7.4 + +---------- + +### ne ### + +![](http://www.linuxlinks.com/portal/content/reviews/Editors/Screenshot-ne.png) + +neһȫĻĿԴı༭һviѧϰviҿPOSIX-ݵϵͳбЯʹá + +ne˵ʹãҲdzǿȫõ򣬲ԴʹʮֽԼ + +#### ܰ: #### + +- ûӿڣ ƻкͲ˵Ͳ˵ +- ﷨ +- UTF-8ļȫַ֧֣ +- ĵУʾάȺļ/кųȶбţҽڻֳ +- 򵥵Ľűԣűü¼/ŵķʽ +- Ƶij/ܣͨã +- ڱ༭ļչԶԻϵͳ +- ʹĵеĴֵԶǰ׺ȫ +- õļȡ +- չʽڲҺ滻emacsvi +- dzյڴģͣڼغ޸Ĵļʱʮֿ +- ɱ༭ļ + +- ַ: [ne.di.unimi.it][3] +- : Sebastiano Vigna (original developer). Additional features added by Todd M. Lewis +- ֤: GNU GPL v3 +- 汾: 2.5 + +---------- + +### Zile ### + +![](http://www.linuxlinks.com/portal/content/reviews/Editors/Screenshot-Zile.png) + +ZileLossy EmacsEmacs棩һС͵EmacsĿ¡档ZileһɶƵģĵʵʱʾı༭ڱдZileʱEmacsһܵСÿEmacsûZileеС + +ZileСRAMԼ130KBԼٿʼ༭8ģڱдκļ + +#### ܰ: #### + +- С͵١ǿ +- ༶ij +- ര +- ã̫ô롿 +- СĻɲȫ +- Զ (Զ) +- Ĵͼ +- EmacsСܺͱEmacsͬ +- Killing +- Yanking +- Զĩ + +- ַ: [www.gnu.org/software/zile][4] +- : Reuben Thomas, Sandro Sigala, David A. Capello +- ֤: GNU GPL v2 +- 汾: 2.4.11 + +---------- + +### nano ### + +![](http://www.linuxlinks.com/portal/content/reviews/Editors/Screenshot-nano.png) + +nanoǻcursesı༭PicoPineʼͻ˱༭һ̰档 + +Pine֤ϰPineδԿԴ֤ҲΪPineȱһЩҪĹܣnanoĿ1999꿪ʼ + +nanoڸPicoĹܺԣͬʱṩĹܣPine/Picoʼͻˡ + +nanoPicoһԼΪƣÿƼơ + +#### ܰ: #### + +- ʽIJҺ滻 +- ɫ﷨ +- תкźкŴ +- Զ +- ܿ +- ֧UTF-8 +- ͵ļԶת +- ģʽ +- ļ +- ƽ +- ƥ +- Զַ +- ļ +- ʻ֧ +- tabȫļ + +- ַ: [nano-editor.org][5] +- : Chris Allegretta, David Lawrence, Jordi Mallach, Adam Rogoyski, Robert Siemborski, Rocco Corsi, David Benbennick, Mike Frysinger +- ֤: GNU GPL v3 +- 汾: 2.2.6 + +-------------------------------------------------------------------------------- + +via: http://www.linuxlinks.com/article/20141011073917230/TextEditors.html + +ߣFrazer Kline +ߣ[wwy-hust](https://github.com/wwy-hust) +Уԣ[УID](https://github.com/УID) + + [LCTT](https://github.com/LCTT/TranslateProject) ԭ룬[Linuxй](http://linux.cn/) Ƴ + +[1]:http://foicica.com/textadept/ +[2]:http://www.vim.org/ +[3]:http://ne.di.unimi.it/ +[4]:http://www.gnu.org/software/zile/ +[5]:http://nano-editor.org/ From 30385454a87058b0b152370a48edc81bb22cfa65 Mon Sep 17 00:00:00 2001 From: ZTinoZ Date: Tue, 9 Jun 2015 16:45:22 +0800 Subject: [PATCH 304/965] Translating by ZTinoZ --- ...526 20 Useful Terminal Emulators for Linux.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/sources/tech/20150526 20 Useful Terminal Emulators for Linux.md b/sources/tech/20150526 20 Useful Terminal Emulators for Linux.md index bafcc15d71..5d8b38e80c 100644 --- a/sources/tech/20150526 20 Useful Terminal Emulators for Linux.md +++ b/sources/tech/20150526 20 Useful Terminal Emulators for Linux.md @@ -58,14 +58,14 @@ Guake Terminal Yakuake (Yet Another Kuake) 是一款基于KDE的下拉式终端仿真器,它与Guake再功能上非常相似。它的射击构思也是受FPS游戏的启发例如Quake。 -Yakuake is basically a KDE application, which can be easily installed on KDE desktop, but if you try to install Yakuake in GNOME desktop, it will prompt you to install huge number of dependency packages. +Yakuake主要是一款KDE应用程序,它能非常轻松地安装在KDE桌面上,但是如果你试着将它安装在GNOME桌面上,你将会安装大量的依赖包。 #### Yakuake的特性 #### -- Fluently turn down from the top of your screen -- Tabbed interface -- Configurable dimensions and animation speed -- Customizable +- 从屏幕顶端弹回顺畅 +- 选项卡式界面 +- 可配置的尺寸和动画速度 +- 可定制 ![Yakuake Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/Yakuake-Terminal.jpeg) @@ -75,9 +75,9 @@ Yakuake Terminal ### 5. ROXTerm ### -ROXterm is yet another lightweight terminal emulator designed to provide similar features to gnome-terminal. It was originally constructed to have lesser footprints and faster start-up time by not using the Gnome libraries and by using a independent applet to bring the configuration interface (GUI), but over the time it’s role has shifted to bringing a higher range of features for power users. +ROXterm又是一款轻量级终端仿真器,旨在提供与GNOME终端相似的特性。它原本创造出来是为了通过不使用Gnome库从而拥有更少的占用空间和更快的启动速度并使用独立的小程序来建立配置界面(GUI), 但是随着时间的流逝,它的角色就转变为给那些老牌用户带来更高一层的特性。 -However, it is more customizable than gnome-terminal and anticipated more at “power” users who make excessive use of terminals. It is easily integrated with GNOME desktop environment and provides features like drag & drop of items into terminal. +然而,它比GNOME终端更加具有可制定性并且对于那些经常使用终端的老牌用户更令人期望。它能和GNOME桌面环境完美结合并在终端中提供像拖拽项目那样的特性。 ![Roxterm Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/Roxterm-Terminal.jpeg) @@ -264,7 +264,7 @@ rxvt unicode - [rxvt-unicode][21] -If you know any other capable Linux terminal emulators that I’ve not included in the above list, please do share with me using our comment section. +如果你知道任何其它强大的Linux终端仿真器而上文未提及,欢迎在评论中与我们分享。 -------------------------------------------------------------------------------- From 81671c6898ca1688f9266bb5d9a9e7fc939a4325 Mon Sep 17 00:00:00 2001 From: wwy Date: Tue, 9 Jun 2015 23:46:00 +0800 Subject: [PATCH 305/965] Update 20150604 Nishita Agarwal Shares Her Interview Experience on Linux 'iptables' Firewall.md --- ...s Her Interview Experience on Linux 'iptables' Firewall.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150604 Nishita Agarwal Shares Her Interview Experience on Linux 'iptables' Firewall.md b/sources/tech/20150604 Nishita Agarwal Shares Her Interview Experience on Linux 'iptables' Firewall.md index 2ba7334580..ca51791986 100644 --- a/sources/tech/20150604 Nishita Agarwal Shares Her Interview Experience on Linux 'iptables' Firewall.md +++ b/sources/tech/20150604 Nishita Agarwal Shares Her Interview Experience on Linux 'iptables' Firewall.md @@ -1,3 +1,5 @@ +translating by wwy-hust + Nishita Agarwal Shares Her Interview Experience on Linux ‘iptables’ Firewall ================================================================================ Nishita Agarwal, a frequent Tecmint Visitor shared her experience (Question and Answer) with us regarding the job interview she had just given in a privately owned hosting company in Pune, India. She was asked a lot of questions on a variety of topics however she is an expert in iptables and she wanted to share those questions and their answer (she gave) related to iptables to others who may be going to give interview in near future. @@ -204,4 +206,4 @@ via: http://www.tecmint.com/linux-firewall-iptables-interview-questions-and-answ 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 [a]:http://www.tecmint.com/author/avishek/ -[1]:http://www.tecmint.com/install-webmin-web-based-system-administration-tool-for-rhel-centos-fedora/ \ No newline at end of file +[1]:http://www.tecmint.com/install-webmin-web-based-system-administration-tool-for-rhel-centos-fedora/ From 05a0ac68326f2d3c7e72686a706f79f958e903dc Mon Sep 17 00:00:00 2001 From: wxy Date: Wed, 10 Jun 2015 09:50:01 +0800 Subject: [PATCH 306/965] PUB:20150506 Linux FAQs with Answers--How to install Shrew Soft IPsec VPN client on Linux @GOLinux --- ... to install Shrew Soft IPsec VPN client on Linux.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) rename {translated/tech => published}/20150506 Linux FAQs with Answers--How to install Shrew Soft IPsec VPN client on Linux.md (88%) diff --git a/translated/tech/20150506 Linux FAQs with Answers--How to install Shrew Soft IPsec VPN client on Linux.md b/published/20150506 Linux FAQs with Answers--How to install Shrew Soft IPsec VPN client on Linux.md similarity index 88% rename from translated/tech/20150506 Linux FAQs with Answers--How to install Shrew Soft IPsec VPN client on Linux.md rename to published/20150506 Linux FAQs with Answers--How to install Shrew Soft IPsec VPN client on Linux.md index abe1d3943d..56f57a5020 100644 --- a/translated/tech/20150506 Linux FAQs with Answers--How to install Shrew Soft IPsec VPN client on Linux.md +++ b/published/20150506 Linux FAQs with Answers--How to install Shrew Soft IPsec VPN client on Linux.md @@ -1,9 +1,9 @@ -Linux有问必答——Linux上如何安装Shrew Soft IPsec VPN +Linux有问必答:Linux上如何安装Shrew Soft IPsec VPN ================================================================================ -> **Question**: I need to connect to an IPSec VPN gateway. For that, I'm trying to use Shrew Soft VPN client, which is available for free. How can I install Shrew Soft VPN client on [insert your Linux distro]? -> **问题**:我需要连接到一个IPSec VPN网关,鉴于此,我尝试使用Shrew Soft VPN客户端,它是一个免费版本。我怎样才能安装Shrew Soft VPN客户端到[插入你的Linux发行版]? -市面上有许多商业VPN网关,同时附带有他们自己的专有VPN客户端软件。虽然也有许多开源的VPN服务器/客户端备选方案,但它们通常缺乏复杂的IPsec支持,比如互联网密钥交换(IKE),这是一个标准的IPsec协议,用于加固VPN密钥交换和验证安全。Shrew Soft VPN是一个免费的IPsec VPN客户端,它支持多种验证方法、密钥交换、加密以及防火墙穿越选项。 +> **问题**:我需要连接到一个IPSec VPN网关,鉴于此,我尝试使用Shrew Soft VPN客户端,它是一个免费版本。我怎样才能安装Shrew Soft VPN客户端到[某个Linux发行版]? + +市面上有许多商业VPN网关,同时附带有他们自己的专有VPN客户端软件。虽然也有许多开源的VPN服务器/客户端备选方案,但它们通常缺乏复杂的IPsec支持,比如互联网密钥交换(IKE),这是一个标准的IPsec协议,用于加固VPN密钥交换和验证安全。Shrew Soft VPN是一个免费的IPsec VPN客户端,它支持多种验证方法、密钥交换、加密以及防火墙穿透选项。 下面介绍如何安装Shrew Soft VPN客户端到Linux平台。 @@ -90,7 +90,7 @@ via: http://ask.xmodulo.com/install-shrew-soft-ipsec-vpn-client-linux.html 作者:[Dan Nanni][a] 译者:[GOLinux](https://github.com/GOLinux) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 2c5488546d748c77e004f68908dc55abd32d2fbe Mon Sep 17 00:00:00 2001 From: wxy Date: Wed, 10 Jun 2015 10:05:21 +0800 Subject: [PATCH 307/965] PUB:20150518 Linux FAQs with Answers--How to fix '404 Not Found' error with 'apt-get update' on old Ubuntu @GOLinux --- ... Not Found' error with 'apt-get update' on old Ubuntu.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename {translated/tech => published}/20150518 Linux FAQs with Answers--How to fix '404 Not Found' error with 'apt-get update' on old Ubuntu.md (92%) diff --git a/translated/tech/20150518 Linux FAQs with Answers--How to fix '404 Not Found' error with 'apt-get update' on old Ubuntu.md b/published/20150518 Linux FAQs with Answers--How to fix '404 Not Found' error with 'apt-get update' on old Ubuntu.md similarity index 92% rename from translated/tech/20150518 Linux FAQs with Answers--How to fix '404 Not Found' error with 'apt-get update' on old Ubuntu.md rename to published/20150518 Linux FAQs with Answers--How to fix '404 Not Found' error with 'apt-get update' on old Ubuntu.md index 9880f7953f..81bf2cbbf6 100644 --- a/translated/tech/20150518 Linux FAQs with Answers--How to fix '404 Not Found' error with 'apt-get update' on old Ubuntu.md +++ b/published/20150518 Linux FAQs with Answers--How to fix '404 Not Found' error with 'apt-get update' on old Ubuntu.md @@ -1,4 +1,4 @@ -Linux有问必答——在旧的Ubuntu上如何修复“apt-get update”的“404 Not Found”错误 +Linux有问必答:如何更新过期版本的Ubuntu ================================================================================ > **问题**: 我的PC上安装了旧版的Ubuntu 13.04(急切的浣熊)。当我在上面运行“sudo apt-get update”时,它丢给了我一大堆“404 Not Found”错误,结果是我不能使用apt-get或aptitude来安装或更新任何软件包了。由于该错误的原因,我甚至不能将它升级到更新的版本。我怎样才能修复这个问题啊? > @@ -20,7 +20,7 @@ Linux有问必答——在旧的Ubuntu上如何修复“apt-get update”的“4 这里,通过切换到旧版本仓库提供了一个快速修复“404 Not Found”错误的便捷方式。 -首先,使用旧版本仓库替换main/security仓库,就像下面这样。 +首先,使用old-releases仓库替换main/security仓库,就像下面这样。 $ sudo sed -i -r 's/([a-z]{2}\.)?archive.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list $ sudo sed -i -r 's/security.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list @@ -38,7 +38,7 @@ via: http://ask.xmodulo.com/404-not-found-error-apt-get-update-ubuntu.html 作者:[Dan Nanni][a] 译者:[GOLinux](https://github.com/GOLinux) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From a129fb3f088e16f22cea1e526b8126106fec8d6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=AE=A6=E6=88=90?= Date: Wed, 10 Jun 2015 10:15:26 +0800 Subject: [PATCH 308/965] Update RHCSA Series--Part 01--Reviewing Essential Commands and System Documentation.md --- ...--Reviewing Essential Commands and System Documentation.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/tech/RHCSA Series/RHCSA Series--Part 01--Reviewing Essential Commands and System Documentation.md b/sources/tech/RHCSA Series/RHCSA Series--Part 01--Reviewing Essential Commands and System Documentation.md index 9b32c93453..f1ee36576d 100644 --- a/sources/tech/RHCSA Series/RHCSA Series--Part 01--Reviewing Essential Commands and System Documentation.md +++ b/sources/tech/RHCSA Series/RHCSA Series--Part 01--Reviewing Essential Commands and System Documentation.md @@ -1,3 +1,5 @@ +translating by xiqingongzi + RHCSA Series: Reviewing Essential Commands & System Documentation – Part 1 ================================================================================ RHCSA (Red Hat Certified System Administrator) is a certification exam from Red Hat company, which provides an open source operating system and software to the enterprise community, It also provides support, training and consulting services for the organizations. @@ -310,4 +312,4 @@ via: http://www.tecmint.com/rhcsa-exam-reviewing-essential-commands-system-docum [7]:http://www.tecmint.com/redhat-enterprise-linux-7-installation/ [8]:http://www.tecmint.com/echo-command-in-linux/ [9]:http://www.tecmint.com/pwd-command-examples/ -[10]:http://www.tecmint.com/view-contents-of-file-in-linux/ \ No newline at end of file +[10]:http://www.tecmint.com/view-contents-of-file-in-linux/ From ba38c7e9b57a510d5c75c0aebbfe0d4d18b9eb45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=AE=A6=E6=88=90?= Date: Wed, 10 Jun 2015 10:17:41 +0800 Subject: [PATCH 309/965] =?UTF-8?q?=E3=80=90=E7=BF=BB=E8=AF=91=E4=B8=AD?= =?UTF-8?q?=E3=80=91RHCSA=20Series--Part=2001--Reviewing=20Essential=20Com?= =?UTF-8?q?mands=20and=20System=20Documentation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Translating By xiqingongzi RHCSA Series--Part 01--Reviewing Essential Commands and System Documentation.md --- ...01--Reviewing Essential Commands and System Documentation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/RHCSA Series/RHCSA Series--Part 01--Reviewing Essential Commands and System Documentation.md b/sources/tech/RHCSA Series/RHCSA Series--Part 01--Reviewing Essential Commands and System Documentation.md index f1ee36576d..0155034c35 100644 --- a/sources/tech/RHCSA Series/RHCSA Series--Part 01--Reviewing Essential Commands and System Documentation.md +++ b/sources/tech/RHCSA Series/RHCSA Series--Part 01--Reviewing Essential Commands and System Documentation.md @@ -1,4 +1,4 @@ -translating by xiqingongzi +[translating by xiqingongzi] RHCSA Series: Reviewing Essential Commands & System Documentation – Part 1 ================================================================================ From f2a590ffb2f2712ca6f7f01c242f30b717cddcbc Mon Sep 17 00:00:00 2001 From: yajun Date: Wed, 10 Jun 2015 10:29:42 +0800 Subject: [PATCH 310/965] =?UTF-8?q?fyh=E7=94=B3=E9=A2=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ools for Browsing Websites and Downloading Files in Linux.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20150410 7 Command Line Tools for Browsing Websites and Downloading Files in Linux.md b/sources/tech/20150410 7 Command Line Tools for Browsing Websites and Downloading Files in Linux.md index d291f34511..27c3e388ef 100644 --- a/sources/tech/20150410 7 Command Line Tools for Browsing Websites and Downloading Files in Linux.md +++ b/sources/tech/20150410 7 Command Line Tools for Browsing Websites and Downloading Files in Linux.md @@ -1,3 +1,5 @@ +fyh翻译中。。。 + 7 Command Line Tools for Browsing Websites and Downloading Files in Linux ================================================================================ In the last article, we have covered few useful tools like ‘rTorrent‘, ‘wget‘, ‘cURL‘, ‘w3m‘, and ‘Elinks‘. We got lots of response to cover few other tools of same genre, if you’ve missed the first part you can go through it.. From 401c0389932f7d210dad2d2d6f021b60ff4ee142 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=AE=A6=E6=88=90?= Date: Wed, 10 Jun 2015 10:43:58 +0800 Subject: [PATCH 311/965] From Row 1 to Row 11 --- ...viewing Essential Commands and System Documentation.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sources/tech/RHCSA Series/RHCSA Series--Part 01--Reviewing Essential Commands and System Documentation.md b/sources/tech/RHCSA Series/RHCSA Series--Part 01--Reviewing Essential Commands and System Documentation.md index 0155034c35..4bb5948d5d 100644 --- a/sources/tech/RHCSA Series/RHCSA Series--Part 01--Reviewing Essential Commands and System Documentation.md +++ b/sources/tech/RHCSA Series/RHCSA Series--Part 01--Reviewing Essential Commands and System Documentation.md @@ -1,14 +1,14 @@ [translating by xiqingongzi] -RHCSA Series: Reviewing Essential Commands & System Documentation – Part 1 +RHCSA系列: 复习基础命令及系统文档 – 第一部分 ================================================================================ -RHCSA (Red Hat Certified System Administrator) is a certification exam from Red Hat company, which provides an open source operating system and software to the enterprise community, It also provides support, training and consulting services for the organizations. +RHCSA (红帽认证系统工程师) 是由给商业公司提供开源操作系统和软件的RedHat公司举行的认证考试, 除此之外,红帽公司还为这些企业和机构提供支持、训练以及咨询服务 ![RHCSA Exam Guide](http://www.tecmint.com/wp-content/uploads/2015/02/RHCSA-Series-by-Tecmint.png) -RHCSA Exam Preparation Guide +RHCSA 考试准备指南 -RHCSA exam is the certification obtained from Red Hat Inc, after passing the exam (codename EX200). RHCSA exam is an upgrade to the RHCT (Red Hat Certified Technician) exam, and this upgrade is compulsory as the Red Hat Enterprise Linux was upgraded. The main variation between RHCT and RHCSA is that RHCT exam based on RHEL 5, whereas RHCSA certification is based on RHEL 6 and 7, the courseware of these two certifications are also vary to a certain level. +RHCSA 考试(考试编号 EX200)通过后可以获取由Red Hat 公司颁发的证书. RHCSA 考试是RHCT(红帽认证技师)的升级版,而且RHCSA必须在新的Red Hat Enterprise Linux(红帽企业版)下完成.RHCT和RHCSA的主要变化就是RHCT基于 RHEL5 , 而RHCSA基于RHEL6或者7, 这两个认证的等级也有所不同. This Red Hat Certified System Administrator (RHCSA) is essential to perform the following core system administration tasks needed in Red Hat Enterprise Linux environments: From 5ce725050046e89248644cfcbeb9df556b612bdb Mon Sep 17 00:00:00 2001 From: KS Date: Wed, 10 Jun 2015 11:06:58 +0800 Subject: [PATCH 312/965] =?UTF-8?q?wyangsun=E7=94=B3=E8=AF=B7=E7=BF=BB?= =?UTF-8?q?=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit wyangsun申请翻译 --- ...eate Own Online Shopping Store Using 'OpenCart' in Linux.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150527 How to Create Own Online Shopping Store Using 'OpenCart' in Linux.md b/sources/tech/20150527 How to Create Own Online Shopping Store Using 'OpenCart' in Linux.md index ad673a03e0..39db75746a 100644 --- a/sources/tech/20150527 How to Create Own Online Shopping Store Using 'OpenCart' in Linux.md +++ b/sources/tech/20150527 How to Create Own Online Shopping Store Using 'OpenCart' in Linux.md @@ -1,3 +1,4 @@ +wyangsun翻译中 How to Create Own Online Shopping Store Using “OpenCart” in Linux ================================================================================ In the Internet world we are doing everything using a computer. Electronic Commerce aka e-commerce is one one of them. E-Commerce is nothing new and it started in the early days of ARPANET, where ARPANET used to arrange sale between students of Massachusetts Institute of Technology and Stanford Artificial Intelligence Laboratory. @@ -222,4 +223,4 @@ via: http://www.tecmint.com/create-e-commerce-online-shopping-store-using-openca [1]:http://demo.opencart.com/ [2]:http://demo.opencart.com/admin/ [3]:http://www.opencart.com/index.php?route=download/download/ -[4]:http://secure.hostgator.com/%7Eaffiliat/cgi-bin/affiliates/clickthru.cgi?id=tecmint \ No newline at end of file +[4]:http://secure.hostgator.com/%7Eaffiliat/cgi-bin/affiliates/clickthru.cgi?id=tecmint From cb19d06bd25774e7b3338929d624a322cca65cd8 Mon Sep 17 00:00:00 2001 From: Alan You <1058413893@qq.com> Date: Wed, 10 Jun 2015 13:28:18 +0800 Subject: [PATCH 313/965] Update 20150515 How to Install Percona Server on CentOS 7.md --- .../20150515 How to Install Percona Server on CentOS 7.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150515 How to Install Percona Server on CentOS 7.md b/sources/tech/20150515 How to Install Percona Server on CentOS 7.md index 03affe787e..9bfd676f92 100644 --- a/sources/tech/20150515 How to Install Percona Server on CentOS 7.md +++ b/sources/tech/20150515 How to Install Percona Server on CentOS 7.md @@ -1,3 +1,5 @@ +translating by FatJoe123 + How to Install Percona Server on CentOS 7 ================================================================================ In this article we are going to learn about percona server, an opensource drop-in replacement for MySQL and also for MariaDB. The InnoDB database engine make it very attractive and a good alternative if you need performance, reliability and a cost efficient solution @@ -185,4 +187,4 @@ via: http://linoxide.com/linux-how-to/percona-server-centos-7/ 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 -[a]:http://linoxide.com/author/carlosal/ \ No newline at end of file +[a]:http://linoxide.com/author/carlosal/ From bbf84f32ce44238355ea24e9faffa0ecfc67f35c Mon Sep 17 00:00:00 2001 From: DeadFire Date: Wed, 10 Jun 2015 14:13:35 +0800 Subject: [PATCH 314/965] =?UTF-8?q?20150610-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...urce RSS News Ticker for Linux Desktops.md | 95 ++++ ...ry Cache Buffer and Swap Space on Linux.md | 99 ++++ ... Spaces and Special Characters in Linux.md | 435 ++++++++++++++++++ ...Experience on Linux 'iptables' Firewall.md | 212 +++++++++ ...inux or Unix Commands Regular Intervals.md | 133 ++++++ 5 files changed, 974 insertions(+) create mode 100644 sources/share/20150610 Tickr Is An Open-Source RSS News Ticker for Linux Desktops.md create mode 100644 sources/tech/20150610 How to Clear RAM Memory Cache Buffer and Swap Space on Linux.md create mode 100644 sources/tech/20150610 How to Manipulate Filenames Having Spaces and Special Characters in Linux.md create mode 100644 sources/tech/20150610 Nishita Agarwal Shares Her Interview Experience on Linux 'iptables' Firewall.md create mode 100644 sources/tech/20150610 watch--Repeat Linux or Unix Commands Regular Intervals.md diff --git a/sources/share/20150610 Tickr Is An Open-Source RSS News Ticker for Linux Desktops.md b/sources/share/20150610 Tickr Is An Open-Source RSS News Ticker for Linux Desktops.md new file mode 100644 index 0000000000..638482a144 --- /dev/null +++ b/sources/share/20150610 Tickr Is An Open-Source RSS News Ticker for Linux Desktops.md @@ -0,0 +1,95 @@ +Tickr Is An Open-Source RSS News Ticker for Linux Desktops +================================================================================ +![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/05/rss-tickr.jpg) + +**Latest! Latest! Read all about it!** + +Alright, so the app we’re highlighting today isn’t quite the binary version of an old newspaper seller — but it is a great way to have the latest news brought to you, on your desktop. + +Tick is a GTK-based news ticker for the Linux desktop that scrolls the latest headlines and article titles from your favourite RSS feeds in horizontal strip that you can place anywhere on your desktop. + +Call me Joey Calamezzo; I put mine on the bottom TV news station style. + +“Over to you, sub-heading.” + +### RSS — Remember That? ### + +“Thanks paragraph ending.” + +In an era of push notifications, social media, and clickbait, cajoling us into reading the latest mind-blowing, humanity saving listicle ASAP, RSS can seem a bit old hat. + +For me? Well, RSS lives up to its name of Really Simple Syndication. It’s the easiest, most manageable way to have news come to me. I can manage and read stuff when I want; there’s no urgency to view lest the tweet vanish into the stream or the push notification vanish. + +The beauty of Tickr is in its utility. You can have a constant stream of news trundling along the bottom of your screen, which you can passively glance at from time to time. + +![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/05/tickr-close-up-750x58.jpg) + +There’s no pressure to ‘read’ or ‘mark all read’ or any of that. When you see something you want to read you just click it to open it in a web browser. + +### Setting it Up ### + +![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/05/tickr-rss-settings.jpg) + +Although Tickr is available to install from the Ubuntu Software Centre it hasn’t been updated for a long time. Nowhere is this sense of abandonment more keenly felt than when opening the unwieldy and unintuitive configuration panel. + +To open it: + +1. Right click on the Tickr bar +1. Go to Edit > Preferences +1. Adjust the various settings + +Row after row of options and settings, few of which seem to make sense at first. But poke and prod around and you’ll controls for pretty much everything, including: + +- Set scrolling speed +- Choose behaviour when mousing over +- Feed update frequency +- Font, including font sizes and color +- Separator character (‘delineator’) +- Position of Tickr on screen +- Color and opacity of Tickr bar +- Choose how many articles each feed displays + +One ‘quirk’ worth mentioning is that pressing the ‘Apply’ only updates the on-screen Tickr to preview changes. For changes to take effect when you exit the Preferences window you need to click ‘OK’. + +Getting the bar to sit flush on your display can also take a fair bit of tweaking, especially on Unity. + +Press the “full width button” to have the app auto-detect your screen width. By default when placed at the top or bottom it leaves a 25px gap (the app was created back in the days of GNOME 2.x desktops). After hitting the top or bottom buttons just add an extra 25 pixels to the input box compensate for this. + +Other options available include: choose which browser articles open in; whether Tickr appears within a regular window frame; whether a clock is shown; and how often the app checks feed for articles. + +#### Adding Feeds #### + +Tickr comes with a built-in list of over 30 different feeds, ranging from technology blogs to mainstream news services. + +![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/05/feed-picker-750x398.jpg) + +You can select as many of these as you like to show headlines in the on screen ticker. If you want to add your own feeds you can: – + +1. Right click on the Tickr bar +1. Go to File > Open Feed +1. Enter Feed URL +1. Click ‘Add/Upd’ button +1. Click ‘OK (select)’ + +To set how many items from each feed shows in the ticker change the “Read N items max per feed” in the other preferences window. + +### Install Tickr in Ubuntu 14.04 LTS and Up ### + +So that’s Tickr. It’s not going to change the world but it will keep you abreast of what’s happening in it. + +To install it in Ubuntu 14.04 LTS or later head to the Ubuntu Software Centre but clicking the button below. + +- [Click to install Tickr form the Ubuntu Software Center][1] + +-------------------------------------------------------------------------------- + +via: http://www.omgubuntu.co.uk/2015/06/tickr-open-source-desktop-rss-news-ticker + +作者:[Joey-Elijah Sneddon][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://plus.google.com/117485690627814051450/?rel=author +[1]:apt://tickr \ No newline at end of file diff --git a/sources/tech/20150610 How to Clear RAM Memory Cache Buffer and Swap Space on Linux.md b/sources/tech/20150610 How to Clear RAM Memory Cache Buffer and Swap Space on Linux.md new file mode 100644 index 0000000000..e668e5d9ec --- /dev/null +++ b/sources/tech/20150610 How to Clear RAM Memory Cache Buffer and Swap Space on Linux.md @@ -0,0 +1,99 @@ +How to Clear RAM Memory Cache, Buffer and Swap Space on Linux +================================================================================ +Like any other operating system, GNU/Linux has implemented a memory management efficiently and even more than that. But if any process is eating away your memory and you want to clear it, Linux provides a way to flush or clear ram cache. + +![Clear RAM Cache and Swap in Linux](http://www.tecmint.com/wp-content/uploads/2015/05/Clear-RAM-Cache-in-Linux.jpg) + +### How to Clear Cache in Linux? ### + +Every Linux System has three options to clear cache without interrupting any processes or services. + +1. Clear PageCache only. + + # sync; echo 1 > /proc/sys/vm/drop_caches + +2. Clear dentries and inodes. + + # sync; echo 2 > /proc/sys/vm/drop_caches + +3. Clear PageCache, dentries and inodes. + + # sync; echo 3 > /proc/sys/vm/drop_caches + +Explanation of above command. + +sync will flush the file system buffer. Command Separated by `“;”` run sequentially. The shell wait for each command to terminate before executing the next command in the sequence. As mentioned in kernel documentation, writing to drop_cache will clean cache without killing any application/service, [command echo][1] is doing the job of writing to file. + +If you have to clear the disk cache, the first command is safest in enterprise and production as `“...echo 1 > ….”` will clear the PageCache only. It is not recommended to use third option above `“...echo 3 >”` in production until you know what you are doing, as it will clear PageCache, dentries and inodes. + +**Is it a good idea to free Buffer and Cache in Linux that might be used by Linux Kernel?** + +When you are applying various settings and want to check, if it is actually implemented specially on I/O-extensive benchmark, then you may need to clear buffer cache. You can drop cache as explained above without rebooting the System i.e., no downtime required. + +Linux is designed in such a way that it looks into disk cache before looking onto the disk. If it finds the resource in the cache, then the request doesn’t reach the disk. If we clean the cache, the disk cache will be less useful as the OS will look for the resource on the disk. + +Moreover it will also slow the system for a few seconds while the cache is cleaned and every resource required by OS is loaded again in the disk-cache. + +Now we will be creating a shell script to auto clear RAM cache daily at 2PM via a cron scheduler task. Create a shell script clearcache.sh and add the following lines. + + #!/bin/bash + # Note, we are using "echo 3", but it is not recommended in production instead use "echo 1" + echo "echo 3 > /proc/sys/vm/drop_caches" + +Set execute permission on the clearcache.sh file. + + # chmod 755 clearcache.sh + +Now you may call the script whenever you required to clear ram cache. + +Now set a cron to clear RAM cache everyday at 2PM. Open crontab for editing. + + # crontab -e + +Append the below line, save and exit to run it at 2PM daily. + + 0 3 * * * /path/to/clearcache.sh + +For more details on how to cron a job you may like to check our article on [11 Cron Scheduling Jobs][2]. + +**Is it good idea to auto clear RAM cache on production server?** + +No! it is not. Think of a situation when you have scheduled the script to clear ram cache everyday at 2PM. Everyday at 2PM the script is executed and it flushes your RAM cache. One day for whatsoever reason, may be more than expected users are online on your website and seeking resource from your server. + +At the same time scheduled script run and clears everything in cache. Now all the user are fetching data from disk. It will result in server crash and corrupt the database. So clear ram-cache only when required,and known your foot steps, else you are a Cargo Cult System Administrator. + +#### How to Clear Swap Space in Linux? #### + +If you want to clear Swap space, you may like to run the below command. + + # swapoff -a && swapon -a + +Also you may add above command to a cron script above, after understanding all the associated risk. + +Now we will be combining both above commands into one single command to make a proper script to clear RAM Cache and Swap Space. + + # echo 3 > /proc/sys/vm/drop_caches && swapoff -a && swapon -a && printf '\n%s\n' 'Ram-cache and Swap Cleared' + + OR + + su -c 'echo 3 >/proc/sys/vm/drop_caches' && swapoff -a && swapon -a && printf '\n%s\n' 'Ram-cache and Swap Cleared' + +After testing both above command, we will run command “free -h” before and after running the script and will check cache. + +![Clear RAM Cache and Swap Space](http://www.tecmint.com/wp-content/uploads/2015/05/Clear-RAM-Cache.gif) + +That’s all for now, if you liked the article, don’t forget to provide us with your valuable feedback in the comments to let us know, what you think is it a good idea to clear ram cache and buffer in production and Enterprise? + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/clear-ram-memory-cache-buffer-and-swap-space-on-linux/ + +作者:[Avishek Kumar][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/avishek/ +[1]:http://www.tecmint.com/echo-command-in-linux/ +[2]:http://www.tecmint.com/11-cron-scheduling-task-examples-in-linux/ \ No newline at end of file diff --git a/sources/tech/20150610 How to Manipulate Filenames Having Spaces and Special Characters in Linux.md b/sources/tech/20150610 How to Manipulate Filenames Having Spaces and Special Characters in Linux.md new file mode 100644 index 0000000000..03bbb69005 --- /dev/null +++ b/sources/tech/20150610 How to Manipulate Filenames Having Spaces and Special Characters in Linux.md @@ -0,0 +1,435 @@ +How to Manipulate Filenames Having Spaces and Special Characters in Linux +================================================================================ +We come across files and folders name very regularly. In most of the cases file/folder name are related to the content of the file/folder and starts with number and characters. Alpha-Numeric file name are pretty common and very widely used, but this is not the case when we have to deal with file/folder name that has special characters in them. + +**Note**: We can have files of any type but for simplicity and easy implementation we will be dealing with Text file (.txt), throughout the article. + +Example of most common file names are: + + abc.txt + avi.txt + debian.txt + ... + +Example of numeric file names are: + + 121.txt + 3221.txt + 674659.txt + ... + +Example of Alpha-Numeric file names are: + + eg84235.txt + 3kf43nl2.txt + 2323ddw.txt + ... + +Examples of file names that has special character and is not very common: + + #232.txt + #bkf.txt + #bjsd3469.txt + #121nkfd.txt + -2232.txt + -fbjdew.txt + -gi32kj.txt + --321.txt + --bk34.txt + ... + +One of the most obvious question here is – who on earth create/deal with files/folders name having a Hash `(#)`, a semi-colon `(;)`, a dash `(-)` or any other special character. + +I Agree to you, that such file names are not common still your shell should not break/give up when you have to deal with any such file names. Also speaking technically every thing be it folder, driver or anything else is treated as file in Linux. + +### Dealing with file that has dash (-) in it’s name ### + +Create a file that starts with a dash `(-)`, say -abx.txt. + + $ touch -abc.txt + +#### Sample Output #### + + touch: invalid option -- 'b' + Try 'touch --help' for more information. + +The reason for above error, that shell interprets anything after a dash `(-)`, as option, and obviously there is no such option, hence is the error. + +To resolve such error, we have to tell the Bash shell (yup this and most of the other examples in the article is for BASH) not to interpret anything after special character (here dash), as option. + +There are two ways to resolve this error as: + + $ touch -- -abc.txt [Option #1] + $ touch ./-abc.txt [Option #2] + +You may verify the file thus created by both the above ways by running commands ls or [ls -l][1] for long listing. + + $ ls -l + + total 0 + -rw-r--r-- 1 avi avi 0 Jun 8 11:05 -abc.txt + +To edit the above file you may do: + + $ nano -- -abc.txt + or + $ nano ./-abc.txt + +**Note**: You may replace nano with any other editor of your choice say vim as: + + $ vim -- -abc.txt + or + $ vim ./-abc.txt + +Similarly to move such file you have to do: + + $ mv -- -abc.txt -a.txt + or + $ mv -- -a.txt -abc.txt + +and to Delete this file, you have to do: + + $ rm -- -abc.txt + or + $ rm ./-abc.txt + +If you have lots of files in a folder the name of which contains dash, and you want to delete all of them at once, do as: + + $ rm ./-* + +**Important to Note:** + +1. The same rule as discussed above follows for any number of hypen in the name of the file and their occurrence. Viz., -a-b-c.txt, ab-c.txt, abc-.txt, etc. + +2. The same rule as discussed above follows for the name of the folder having any number of hypen and their occurrence, except the fact that for deleting the folder you have to use ‘rm -rf‘ as: + + $ rm -rf -- -abc + or + $ rm -rf ./-abc + +### Dealing with files having HASH (#) in the name ### + +The symbol `#` has a very different meaning in BASH. Anything after a `#` is interpreted as comment and hence neglected by BASH. + +**Understand it using examples:** + +create a file #abc.txt. + + $ touch #abc.txt + +#### Sample Output #### + + touch: missing file operand + Try 'touch --help' for more information. + +The reason for above error, that Bash is interpreting #abc.txt a comment and hence ignoring. So the [command touch][2] has been passed without any file Operand, and hence is the error. + +To resolve such error, you may ask BASH not to interpret # as comment. + + $ touch ./#abc.txt + or + $ touch '#abc.txt' + +and verify the file just created as: + + $ ls -l + + total 0 + -rw-r--r-- 1 avi avi 0 Jun 8 12:14 #abc.txt + +Now create a file the name of which contains # anywhere except at the begging. + + $ touch ./a#bc.txt + $ touch ./abc#.txt + + or + $ touch 'a#bc.txt' + $ touch 'abc#.txt' + +Run ‘ls -l‘ to verify it: + + $ ls -l + + total 0 + -rw-r--r-- 1 avi avi 0 Jun 8 12:16 a#bc.txt + -rw-r--r-- 1 avi avi 0 Jun 8 12:16 abc#.txt + +What happens when you create two files (say a and #bc) at once: + + $ touch a.txt #bc.txt + +Verify the file just created: + + $ ls -l + + total 0 + -rw-r--r-- 1 avi avi 0 Jun 8 12:18 a.txt + +Obvious from the above example it only created file ‘a‘ and file ‘#bc‘ has been ignored. To execute the above situation successfully we can do, + + $ touch a.txt ./#bc.txt + or + $ touch a.txt '#bc.txt' + +and verify it as: + + $ ls -l + + total 0 + -rw-r--r-- 1 avi avi 0 Jun 8 12:20 a.txt + -rw-r--r-- 1 avi avi 0 Jun 8 12:20 #bc.txt + +You can move the file as: + + $ mv ./#bc.txt ./#cd.txt + or + $ mv '#bc.txt' '#cd.txt' + +Copy it as: + + $ cp ./#cd.txt ./#de.txt + or + $ cp '#cd.txt' '#de.txt' + +You may edit it as using your choice of editor as: + + $ vi ./#cd.txt + or + $ vi '#cd.txt' + +---------- + + $ nano ./#cd.txt + or + $ nano '#cd.txt' + +And Delete it as: + + $ rm ./#bc.txt + or + $ rm '#bc.txt' + +To delete all the files that has hash (#) in the file name, you may use: + + # rm ./#* + +### Dealing with files having semicolon (;) in its name ### + +In case you are not aware, semicolon acts as a command separator in BASH and perhaps other shell as well. Semicolon lets you execute several command in one go and acts as separator. Have you ever deal with any file name having semicolon in it? If not here you will. + +Create a file having semi-colon in it. + + $ touch ;abc.txt + +#### Sample Output #### + + touch: missing file operand + Try 'touch --help' for more information. + bash: abc.txt: command not found + +The reason for above error, that when you run the above command BASH interpret touch as a command but could not find any file operand before semicolon and hence it reports error. It also reports another error that ‘abc.txt‘ command not found, only because after semicolon BASH was expecting another command and ‘abc.txt‘, is not a command. + +To resolve such error, tell BASH not to interpret semicolon as command separator, as: + + $ touch ./';abc.txt' + or + $ touch ';abc.txt' + +**Note**: We have enclosed the file name with single quote ''. It tells BASH that ; is a part of file name and not command separator. + +Rest of the action (viz., copy, move, delete) on the file and folder having semicolon in its name can be carried out straight forward by enclosing the name in single quote. + +### Dealing with other special characters in file/folder name ### + +#### Plus Sign (+) in file name #### + +Don’t requires anything extra, just do it normal way, as simple file name as shown below. + + $ touch +12.txt + +#### Dollar sign ($) in file name #### + +You have to enclose file name in single quote, as we did in the case of semicolon. Rest of the things are straight forward.. + + $ touch '$12.txt' + +#### Percent (%) in file name #### + +You don’t need to do anything differently, treat it as normal file. + + $ touch %12.txt + +#### Asterisk (*) in file name #### + +Having Asterisk in file name don’t change anything and you can continue using it as normal file. + + $ touch *12.txt + +Note: When you have to delete a file that starts with *, Never use following commands to delete such files. + + $ rm * + or + $ rm -rf * + +Instead use, + + $ rm ./*.txt + +#### Exclamation mark (!) in file name #### + +Just Enclose the file name in single quote and rest of the things are same. + + $ touch '!12.txt' + +#### At Sign (@) in file name #### + +Nothing extra, treat a filename having At Sign as nonrmal file. + + $ touch '@12.txt' + +#### ^ in file name #### + +No extra attention required. Use a file having ^ in filename as normal file. + + $ touch ^12.txt + +#### Ampersand (&) in file name #### + +Filename should be enclosed in single quotes and you are ready to go. + + $ touch '&12.txt' + +#### Parentheses () in file name #### + +If the file name has Parenthesis, you need to enclose filename with single quotes. + + $ touch '(12.txt)' + +#### Braces {} in file name #### + +No Extra Care needed. Just treat it as just another file. + + $ touch {12.txt} + +#### Chevrons <> in file name #### + +A file name having Chevrons must be enclosed in single quotes. + + $ touch '<12.txt>' + +#### Square Brackets [ ] in file name #### + +Treat file name having Square Brackets as normal files and you need not take extra care of it. + + $ touch [12.txt] + +#### Under score (_) in file name #### + +They are very common and don’t require anything extra. Just do what you would have done with a normal file. + + $ touch _12.txt + +#### Equal-to (=) in File name #### + +Having an Equal-to sign do not change anything, you can use it as normal file. + + $ touch =12.txt + +#### Dealing with back slash (\) #### + +Backslash tells shell to ignore the next character. You have to enclose file name in single quote, as we did in the case of semicolon. Rest of the things are straight forward. + + $ touch '\12.txt' + +#### The Special Case of Forward Slash #### + +You cannot create a file the name of which includes a forward slash (/), until your file system has bug. There is no way to escape a forward slash. + +So if you can create a file such as ‘/12.txt’ or ‘b/c.txt’ then either your File System has bug or you have Unicode support, which lets you create a file with forward slash. In this case the forward slash is not a real forward slash but a Unicode character that looks alike a forward slash. + +#### Question Mark (?) in file name #### + +Again, an example where you don’t need to put any special attempt. A file name having Question mark can be treated in the most general way. + + $ touch ?12.txt + +#### Dot Mark (.) in file name #### + +The files starting with dot `(.)` are very special in Linux and are called dot files. They are hidden files generally a configuration or system files. You have to use switch ‘-a‘ or ‘-A‘ with ls command to view such files. + +Creating, editing, renaming and deleting of such files are straight forward. + + $ touch .12.txt + +Note: In Linux you may have as many dots `(.)` as you need in a file name. Unlike other system dots in file name don’t means to separate name and extension. You can create a file having multiple dots as: + + $ touch 1.2.3.4.5.6.7.8.9.10.txt + +and check it as: + + $ ls -l + + total 0 + -rw-r--r-- 1 avi avi 0 Jun 8 14:32 1.2.3.4.5.6.7.8.9.10.txt + +#### Comma (,) in file name #### + +You can have comma in a file name, as many as you want and you Don’t requires anything extra. Just do it normal way, as simple file name. + + $ touch ,12.txt + or + $ touch ,12,.txt + +#### Colon (:) in File name #### + +You can have colon in a file name, as many as you want and you Don’t requires anything extra. Just do it normal way, as simple file name. + + $ touch :12.txt + or + $ touch :12:.txt + +#### Having Quotes (single and Double) in file name #### + +To have quotes in file name, we have to use the rule of exchange. I.e, if you need to have single quote in file name, enclose the file name with double quotes and if you need to have double quote in file name, enclose it with single quote. + + $ touch "15'.txt" + + and + + $ touch '15”.txt' + +#### Tilde (~) in file name #### + +Some Editors in Linux like emacs create a backup file of the file being edited. The backup file has the name of the original file plus a tilde at the end of the file name. You can have a file that name of which includes tilde, at any location simply as: + + $ touch ~1a.txt + or + $touch 2b~.txt + +#### White Space in file name #### + +Create a file the name of which has space between character/word, say “hi my name is avishek.txt”. + +It is not a good idea to have file name with spaces and if you have to distinct readable name, you should use, underscore or dash. However if you have to create such a file, you have to use backward slash which ignores the next character to it. To create above file we have to do it this way.. + + $ touch hi\ my\ name\ is\ avishek.txt + + hi my name is avishek.txt + +I have tried covering all the scenario you may come across. Most of the above implementation are explicitly for BASH Shell and may not work in other shell. + +If you feel that I missed something (that is very common and human nature), you may include your suggestion in the comments below. Keep Connected, Keep Commenting. Stay Tuned and connected! Like and share us and help us get spread! + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/manage-linux-filenames-with-special-characters/ + +作者:[Avishek Kumar][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/avishek/ +[1]:http://www.tecmint.com/15-basic-ls-command-examples-in-linux/ +[2]:http://www.tecmint.com/8-pratical-examples-of-linux-touch-command/ \ No newline at end of file diff --git a/sources/tech/20150610 Nishita Agarwal Shares Her Interview Experience on Linux 'iptables' Firewall.md b/sources/tech/20150610 Nishita Agarwal Shares Her Interview Experience on Linux 'iptables' Firewall.md new file mode 100644 index 0000000000..455b994975 --- /dev/null +++ b/sources/tech/20150610 Nishita Agarwal Shares Her Interview Experience on Linux 'iptables' Firewall.md @@ -0,0 +1,212 @@ +Nishita Agarwal Shares Her Interview Experience on Linux ‘iptables’ Firewall +================================================================================ +Nishita Agarwal, a frequent Tecmint Visitor shared her experience (Question and Answer) with us regarding the job interview she had just given in a privately owned hosting company in Pune, India. She was asked a lot of questions on a variety of topics however she is an expert in iptables and she wanted to share those questions and their answer (she gave) related to iptables to others who may be going to give interview in near future. + +![Linux Firewall Iptables Interview Questions](http://www.tecmint.com/wp-content/uploads/2015/05/Linux-iptables-Interview-Questions.jpg) + +All the questions and their Answer are rewritten based upon the memory of Nishita Agarwal. + +> “Hello Friends! My name is **Nishita Agarwal**. I have Pursued Bachelor Degree in Technology. My area of Specialization is UNIX and Variants of UNIX (BSD, Linux) fascinates me since the time I heard it. I have 1+ years of experience in storage. I was looking for a job change which ended with a hosting company in Pune, India.” + +Here is the collection of what I was asked during the Interview. I’ve documented only those questions and their answer that were related to iptables based upon my memory. Hope this will help you in cracking your Interview. + +**1. Have you heard of iptables and firewall in Linux? Any idea of what they are and for what it is used?** + +> **Answer** : I’ve been using iptables for quite long time and I am aware of both iptables and firewall. Iptables is an application program mostly written in C Programming Language and is released under GNU General Public License. Written for System administration point of view, the latest stable release if iptables 1.4.21.iptables may be considered as firewall for UNIX like operating system which can be called as iptables/netfilter, more accurately. The Administrator interact with iptables via console/GUI front end tools to add and define firewall rules into predefined tables. Netfilter is a module built inside of kernel that do the job of filtering. +> +> Firewalld is the latest implementation of filtering rules in RHEL/CentOS 7 (may be implemented in other distributions which I may not be aware of). It has replaced iptables interface and connects to netfilter. + +**2. Have you used some kind of GUI based front end tool for iptables or the Linux Command Line?** + +> **Answer** : Though I have used both the GUI based front end tools for iptables like Shorewall in conjugation of [Webmin][1] in GUI and Direct access to iptables via console.And I must admit that direct access to iptables via Linux console gives a user immense power in the form of higher degree of flexibility and better understanding of what is going on in the background, if not anything other. GUI is for novice administrator while console is for experienced. + +**3. What are the basic differences between between iptables and firewalld?** + +> **Answer** : iptables and firewalld serves the same purpose (Packet Filtering) but with different approach. iptables flush the entire rules set each time a change is made unlike firewalld. Typically the location of iptables configuration lies at ‘/etc/sysconfig/iptables‘ whereas firewalld configuration lies at ‘/etc/firewalld/‘, which is a set of XML files.Configuring a XML based firewalld is easier as compared to configuration of iptables, however same task can be achieved using both the packet filtering application ie., iptables and firewalld. Firewalld runs iptables under its hood along with it’s own command line interface and configuration file that is XML based and said above. + +**4. Would you replace iptables with firewalld on all your servers, if given a chance?** + +> **Answer** : I am familiar with iptables and it’s working and if there is nothing that requires dynamic aspect of firewalld, there seems no reason to migrate all my configuration from iptables to firewalld.In most of the cases, so far I have never seen iptables creating an issue. Also the general rule of Information technology says “why fix if it is not broken”. However this is my personal thought and I would never mind implementing firewalld if the Organization is going to replace iptables with firewalld. + +**5. You seems confident with iptables and the plus point is even we are using iptables on our server.** + +What are the tables used in iptables? Give a brief description of the tables used in iptables and the chains they support. + +> **Answer** : Thanks for the recognition. Moving to question part, There are four tables used in iptables, namely they are: +> +> - Nat Table +> - Mangle Table +> - Filter Table +> - Raw Table +> +> Nat Table : Nat table is primarily used for Network Address Translation. Masqueraded packets get their IP address altered as per the rules in the table. Packets in the stream traverse Nat Table only once. ie., If a packet from a jet of Packets is masqueraded they rest of the packages in the stream will not traverse through this table again. It is recommended not to filter in this table. Chains Supported by NAT Table are PREROUTING Chain, POSTROUTING Chain and OUTPUT Chain. +> +> Mangle Table : As the name suggests, this table serves for mangling the packets. It is used for Special package alteration. It can be used to alter the content of different packets and their headers. Mangle table can’t be used for Masquerading. Supported chains are PREROUTING Chain, OUTPUT Chain, Forward Chain, INPUT Chain, POSTROUTING Chain. +> +> Filter Table : Filter Table is the default table used in iptables. It is used for filtering Packets. If no rules are defined, Filter Table is taken as default table and filtering is done on the basis of this table. Supported Chains are INPUT Chain, OUTPUT Chain, FORWARD Chain. +> +> Raw Table : Raw table comes into action when we want to configure packages that were exempted earlier. It supports PREROUTING Chain and OUTPUT Chain. + +**6. What are the target values (that can be specified in target) in iptables and what they do, be brief!** + +> **Answer** : Following are the target values that we can specify in target in iptables: +> +> - ACCEPT : Accept Packets +> - QUEUE : Paas Package to user space (place where application and drivers reside) +> - DROP : Drop Packets +> - RETURN : Return Control to calling chain and stop executing next set of rules for the current Packets in the chain. + + +**7. Lets move to the technical aspects of iptables, by technical I means practical.** + +How will you Check iptables rpm that is required to install iptables in CentOS?. + +> **Answer** : iptables rpm are included in standard CentOS installation and we do not need to install it separately. We can check the rpm as: +> +> # rpm -qa iptables +> +> iptables-1.4.21-13.el7.x86_64 +> +> If you need to install it, you may do yum to get it. +> +> # yum install iptables-services + +**8. How to Check and ensure if iptables service is running?** + +> **Answer** : To check the status of iptables, you may run the following command on the terminal. +> +> # service status iptables [On CentOS 6/5] +> # systemctl status iptables [On CentOS 7] +> +> If it is not running, the below command may be executed. +> +> ---------------- On CentOS 6/5 ---------------- +> # chkconfig --level 35 iptables on +> # service iptables start +> +> ---------------- On CentOS 7 ---------------- +> # systemctl enable iptables +> # systemctl start iptables +> +> We may also check if the iptables module is loaded or not, as: +> +> # lsmod | grep ip_tables + +**9. How will you review the current Rules defined in iptables?** + +> **Answer** : The current rules in iptables can be review as simple as: +> +> # iptables -L +> +> Sample Output +> +> Chain INPUT (policy ACCEPT) +> target prot opt source destination +> ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED +> ACCEPT icmp -- anywhere anywhere +> ACCEPT all -- anywhere anywhere +> ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:ssh +> REJECT all -- anywhere anywhere reject-with icmp-host-prohibited +> +> Chain FORWARD (policy ACCEPT) +> target prot opt source destination +> REJECT all -- anywhere anywhere reject-with icmp-host-prohibited +> +> Chain OUTPUT (policy ACCEPT) +> target prot opt source destination + +**10. How will you flush all iptables rules or a particular chain?** + +> **Answer** : To flush a particular iptables chain, you may use following commands. +> +> +> # iptables --flush OUTPUT +> +> To Flush all the iptables rules. +> +> # iptables --flush + +**11. Add a rule in iptables to accept packets from a trusted IP Address (say 192.168.0.7)** + +> **Answer** : The above scenario can be achieved simply by running the below command. +> +> # iptables -A INPUT -s 192.168.0.7 -j ACCEPT +> +> We may include standard slash or subnet mask in the source as: +> +> # iptables -A INPUT -s 192.168.0.7/24 -j ACCEPT +> # iptables -A INPUT -s 192.168.0.7/255.255.255.0 -j ACCEPT + +**12. How to add rules to ACCEPT, REJECT, DENY and DROP ssh service in iptables.** + +> **Answer** : Hoping ssh is running on port 22, which is also the default port for ssh, we can add rule to iptables as: +> +> To ACCEPT tcp packets for ssh service (port 22). +> +> # iptables -A INPUT -s -p tcp --dport 22 -j ACCEPT +> +> To REJECT tcp packets for ssh service (port 22). +> +> # iptables -A INPUT -s -p tcp --dport 22 -j REJECT +> +> To DENY tcp packets for ssh service (port 22). +> +> +> # iptables -A INPUT -s -p tcp --dport 22 -j DENY +> +> To DROP tcp packets for ssh service (port 22). +> +> +> # iptables -A INPUT -s -p tcp --dport 22 -j DROP + +**13. Let me give you a scenario. Say there is a machine the local ip address of which is 192.168.0.6. You need to block connections on port 21, 22, 23, and 80 to your machine. What will you do?** + +> **Answer** : Well all I need to use is the ‘multiport‘ option with iptables followed by port numbers to be blocked and the above scenario can be achieved in a single go as. +> +> # iptables -A INPUT -s 192.168.0.6 -p tcp -m multiport --dport 21,22,23,80 -j DROP +> +> The written rules can be checked using the below command. +> +> # iptables -L +> +> Chain INPUT (policy ACCEPT) +> target prot opt source destination +> ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED +> ACCEPT icmp -- anywhere anywhere +> ACCEPT all -- anywhere anywhere +> ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:ssh +> REJECT all -- anywhere anywhere reject-with icmp-host-prohibited +> DROP tcp -- 192.168.0.6 anywhere multiport dports ssh,telnet,http,webcache +> +> Chain FORWARD (policy ACCEPT) +> target prot opt source destination +> REJECT all -- anywhere anywhere reject-with icmp-host-prohibited +> +> Chain OUTPUT (policy ACCEPT) +> target prot opt source destination + +**Interviewer** : That’s all I wanted to ask. You are a valuable employee we won’t like to miss. I will recommend your name to the HR. If you have any question you may ask me. + +As a candidate I don’t wanted to kill the conversation hence keep asking about the projects I would be handling if selected and what are the other openings in the company. Not to mention HR round was not difficult to crack and I got the opportunity. + +Also I would like to thank Avishek and Ravi (whom I am a friend since long) for taking the time to document my interview. + +Friends! If you had given any such interview and you would like to share your interview experience to millions of Tecmint readers around the globe? then send your questions and answers to admin@tecmint.com or you may submit your interview experience using following form. + +- [Share Your Interview Experience][2] + +Thank you! Keep Connected. Also let me know if I could have answered a question more correctly than what I did. + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/linux-firewall-iptables-interview-questions-and-answers/ + +作者:[Avishek Kumar][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/avishek/ +[1]:http://www.tecmint.com/install-webmin-web-based-system-administration-tool-for-rhel-centos-fedora/ +[2]:https://docs.google.com/a/tecmint.com/forms/d/1jfu1Kg8_qToqvyi6pOT1HQb0dAFvRE-Yc_aOkj0RoSg/viewform \ No newline at end of file diff --git a/sources/tech/20150610 watch--Repeat Linux or Unix Commands Regular Intervals.md b/sources/tech/20150610 watch--Repeat Linux or Unix Commands Regular Intervals.md new file mode 100644 index 0000000000..65d844a296 --- /dev/null +++ b/sources/tech/20150610 watch--Repeat Linux or Unix Commands Regular Intervals.md @@ -0,0 +1,133 @@ +watch - Repeat Linux / Unix Commands Regular Intervals +================================================================================ +A server administrator needs to maintain the system and keep it updated and safe. A number of intrusion attempts may happen every day. There are some other activities that maintain their log. These logs are updated regularly. In order to check these updates, the commands are executed repeatedly. For example, for simply reading a file, commands like head, tail, cat etc are used. These commands need to be executed repeatedly. The watch command can be used to repeat a command at regular intervals. + +### Watch Command ### + +Watch is a simple command, with a few options. The basic syntax of watch command is: + + watch [-dhvt] [-n ] [--differences[=cumulative]] [--help] [--interval=] [--no-title] [--version] + +Watch command runs the command specified to it after every 2 seconds by default. This time is counted between the completion of command and beginning of next execution. As a simple example, watch command can be used to watch the log updates, The updates are appended at the end of the file, so tail command can be used with watch to see the updates to the file. This command continues to run until you hit CTRL + C to return to the prompt. + +### Examples ### + +> Keep an eye on errors/notices/warning being generated at run time every couple of seconds. + + watch tail /var/log/messages + +![tail messages](http://blog.linoxide.com/wp-content/uploads/2015/06/1.png) + +> Keep an eye on disk usage after specified time interval. + + watch df -h + +![df -h](http://blog.linoxide.com/wp-content/uploads/2015/06/2.png) + +> It is very important for administrators to keep an eye on high I/O wait causing disk operations especially the Mysql transactions. + + watch mysqladmin processlist + +![processlist](http://blog.linoxide.com/wp-content/uploads/2015/06/3.png) + +> Keep an eye on server load and uptime at runtime. + + watch uptime + +![uptime](http://blog.linoxide.com/wp-content/uploads/2015/06/10.png) + +> Keep an eye on queue size for Exim at the time a cron is run to send notices to subscribers. + + watch exim -bpc + +![exim -bpc](http://blog.linoxide.com/wp-content/uploads/2015/06/9.png) + +### 1) Iteration delay ### + + watch [-n ] + +The default interval between the commands can be changed with -n switch. The following command will run the tail command after 5 seconds: + + watch -n 5 date + +![date 5 seconds](http://blog.linoxide.com/wp-content/uploads/2015/06/4b.png) + +### 2) Successive output comparison ### + +If you use -d option with watch command, it will highlight the differences between the first command output to every next command output cumulatively. + + watch [-d or --differences[=cumulative]] + +#### Example1 #### + +Let’s see the successive time outputs extracted using following watch command and observe how the difference is highlighted. + + watch -n 15 -d date + +First time date is capture when command is executed, the next iteration will be repeated after 15 seconds. + +![Difference A](http://blog.linoxide.com/wp-content/uploads/2015/06/6.png) + +Upon the execution of next iteration, it can be seen that all output is exactly same except the seconds have increased from 14 to 29 which is highlighted. + +![Difference A](http://blog.linoxide.com/wp-content/uploads/2015/06/6b.png) + +#### Example 2 #### + +Let’s experience in difference between two successive outputs of “uptime” command repeated by watch. + + watch -n 20 -d uptime + +![uptime](http://blog.linoxide.com/wp-content/uploads/2015/06/10.png) + +Now the difference between the time is highlighted as well as the three load snapshots as well. + +![10b](http://blog.linoxide.com/wp-content/uploads/2015/06/10b.png) + +### 3) Output without title ### + +If you don’t want to display extra details about the iteration delay and actual command run by watch then –t switch can be used. + + watch [-t or --no-title] + +Let’s see the output of following command as an example. + + watch -t date + +![watch without title](http://blog.linoxide.com/wp-content/uploads/2015/06/7t.png) + +### Watch help ### + +Brief details of the watch command can be found by typing the following command in SSH. + + watch -h [or --help] + +![watch help](http://blog.linoxide.com/wp-content/uploads/2015/06/8h.png) + +### Watch version ### + +Run the following command in SSH terminal to check the version of watch. + + watch -v [--version] + +![version](http://blog.linoxide.com/wp-content/uploads/2015/06/11.png) + +**BUGS** + +Unfortunately, upon terminal resize, the screen will not be correctly repainted until the next scheduled update. All --differences highlight-ing is lost on that update as well. + +### Summary ### + +Watch is a very powerful utility for system administrators because it can be used to monitor, logs, operations, performance and throughput of the system at run time. One can easily format and delay the output of watch utility. Any Linux command / utility or script and be supplied to watch for desired and continuous output. + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/linux-command/linux-watch-command/ + +作者:[Aun Raza][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://linoxide.com/author/arunrz/ \ No newline at end of file From 618e7ccd3f2125f3e8c922f63514a0a405d5be53 Mon Sep 17 00:00:00 2001 From: DeadFire Date: Wed, 10 Jun 2015 15:49:30 +0800 Subject: [PATCH 315/965] =?UTF-8?q?20150610-2=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... pagespeed on Ubuntu 15.04 Vivid Vervet.md | 129 ++++++++++ ...0150610 How to secure your Linux server.md | 233 ++++++++++++++++++ ... Install Android Studio on Ubuntu 15.04.md | 65 +++++ 3 files changed, 427 insertions(+) create mode 100644 sources/tech/20150610 How to Install nginx and google pagespeed on Ubuntu 15.04 Vivid Vervet.md create mode 100644 sources/tech/20150610 How to secure your Linux server.md create mode 100644 sources/tech/20150610 Install Android Studio on Ubuntu 15.04.md diff --git a/sources/tech/20150610 How to Install nginx and google pagespeed on Ubuntu 15.04 Vivid Vervet.md b/sources/tech/20150610 How to Install nginx and google pagespeed on Ubuntu 15.04 Vivid Vervet.md new file mode 100644 index 0000000000..e98bb00523 --- /dev/null +++ b/sources/tech/20150610 How to Install nginx and google pagespeed on Ubuntu 15.04 Vivid Vervet.md @@ -0,0 +1,129 @@ +How to Install nginx and google pagespeed on Ubuntu 15.04 (Vivid Vervet) +================================================================================ +Nginx (engine-x) is a open source and high performance HTTP server, reverse proxy and IMAP/POP3 proxy server. The outstanding features of Nginx are: stability, rich feature set, simple configuration and low resource consumption. Nginx is being used by some of the largest websites on the internet and is gaining more and more popularity in the webmaster community. This tutorials shows how to build a nginx .deb package for Ubuntu 15.04 from source that has Google pagespeed module compiled in. + + +Pagespeed is a web server module developed by Google to speed up a website response times, optimize html and reduce the page load time. ngx_pagespeed features include : + +- Image optimization: stripping meta-data, dynamic resizing, recompression. +- CSS & JavaScript minification, concatenation, inlining, and outlining. +- Small resource inlining. +- Deferring image and JavaScript loading. +- HTML rewriting. +- Cache lifetime extension. + +see more [https://developers.google.com/speed/pagespeed/module/][1]. + +### Prerequisites ### + +Ubuntu Server 15.04 64 bit +root privileges + +What we will do in this tutorial : + +- Install the prerequisite packages. +- Installing nginx with ngx_pagespeed. +- Testing. + +#### Install the prerequisite packages #### + +sudo apt-get install dpkg-dev build-essential zlib1g-dev libpcre3 libpcre3-dev + +#### Installing nginx with ngx_pagespeed #### + +**Step 1 - Adding nginx repository** + + vim /etc/apt/sources.list.d/nginx.list + +add the line: + + deb http://nginx.org/packages/ubuntu/ trusty nginx + deb-src http://nginx.org/packages/ubuntu/ trusty nginx + +Update your repository: + + sudo apt-get update + +note : if you get the messege : GPG error [...] NO_PUBKEY [...] bla bla + +please add the the key: + + sudo sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys KEYNUMBER + sudo apt-get update + +**Step 2 - Download nginx 1.8 from ubuntu repository** + + sudo su + cd ~ + mkdir -p ~/new/nginx_source/ + cd ~/new/nginx_source/ + apt-get source nginx + apt-get build-dep nginx + +**Step 3 - Download Pagespeed** + + cd ~ + mkdir -p ~/new/ngx_pagespeed/ + cd ~/new/ngx_pagespeed/ + ngx_version=1.9.32.3 + wget https://github.com/pagespeed/ngx_pagespeed/archive/release-${ngx_version}-beta.zip + unzip release-${ngx_version}-beta.zip + + cd ngx_pagespeed-release-1.9.32.3-beta/ + wget https://dl.google.com/dl/page-speed/psol/${ngx_version}.tar.gz + tar -xzf 1.9.32.3.tar.gz + +**Step 4 - Configure nginx to build with Pagespeed** + + cd ~/new/nginx_source/nginx-1.8.0/debin/ + vim rules + +add the module under CFLAGS `.configure` : + + --add-module=../../ngx_pagespeed/ngx_pagespeed-release-1.9.32.3-beta \ + +![adding pagespeed to nginx](https://www.howtoforge.com/images/nginx_pagespeed_ubuntu_15_04/big/1.png) + +![adding pagespeed to nginx](https://www.howtoforge.com/images/nginx_pagespeed_ubuntu_15_04/big/2.png) + +**Step 5 - Build nginx package and Install** + + cd ~/new/nginx_source/nginx-1.8.0/ + dpkg-buildpackage -b + +The dpkg-buildpackage command will build the nginx.deb under ~/new/ngix_source/ Once package building is complete, please look in the directory: + + cd ~/new/ngix_source/ + ls + +![nginx builded with pagespeed](https://www.howtoforge.com/images/nginx_pagespeed_ubuntu_15_04/big/3.png) + +And then install nginx. + + dpkg -i nginx_1.8.0-1~trusty_amd64.deb + +![Install nginx](https://www.howtoforge.com/images/nginx_pagespeed_ubuntu_15_04/big/4.png) + +#### Testing #### + +Run nginx -V to see the ngx_pagespeed was builted with nginx. + + nginx -V + +![nginx -V](https://www.howtoforge.com/images/nginx_pagespeed_ubuntu_15_04/big/5.png) + +### Conclusion ### + +The nginx web server there is a stable and fast open source http server that supports a variety of modules for optimization. One of these modules is the 'PageSpeed module' which is developed by google. Unlike apache, nginx modules are not dynamically loadable, so you have to select the desired modules before you build the nginx package. + +-------------------------------------------------------------------------------- + +via: https://www.howtoforge.com/tutorial/how-to-install-nginx-and-google-pagespeed-on-ubuntu-15-04/#step-build-nginx-package-and-install + +作者:Muhammad Arul +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[1]:https://developers.google.com/speed/pagespeed/module/ \ No newline at end of file diff --git a/sources/tech/20150610 How to secure your Linux server.md b/sources/tech/20150610 How to secure your Linux server.md new file mode 100644 index 0000000000..1668dae934 --- /dev/null +++ b/sources/tech/20150610 How to secure your Linux server.md @@ -0,0 +1,233 @@ +How to secure your Linux server +================================================================================ +> A server is made up of so many different components that makes it hard to offer one solution for everyone's needs. This articles tries to cover some useful tips and tricks to help you keep your server and users protected. + +No doubt improving server security is one of the most important things system administrators should always look for. This of course has been a topic of many different articles, blogs and forum threads. + +A server is made up of so many different components that makes it hard to offer one solution for everyone’s needs. This articles tries to cover some useful tips and tricks to help you keep your server and users protected. + +There are a few things that every system administrator should know and there is no way to talk about security without mentioning: + +- Keep your system **up to date** +- Change passwords frequently – use numeric, alphabetical and non-alphabetical symbols +- Give users the **minimum** permissions they need to do their job. +- Install only packages that you really need + +Here comes the more interesting part: + +### Change default SSH port ### + +The first thing that I would like to change when setting up a new server is the default SSH port. This simple change can save your server from thousands of brute force attempts. + +To change the default SSH port, open your sshd_config: + + sudo vim /etc/ssh/sshd_config + +Find the following line: + + #Port 22 + +The “#” symbol means that this line is a comment. Remove the # symbol then change the port to a number of your choice. The port number should not be larger than 65535. Make sure not to use any port already used by your system or other services. You can see a list of commonly used ports in [Wikipedia][1]. For the purpose of this article I will use: + + Port 16543 + +Now save the file and close it for a moment. + +Next important step is to: + +### Use SSH Keys ### + +It is extremely important to use SSH keys when accessing the server over SSH. This adds additional protection and ensure that only people who have the key can access the server. + +To generate SSH key on your local computer run: + + ssh-keygen -t rsa + +You will receive an output asking you to setup the file name where the key should be written as well as setup a password: + + Generating public/private rsa key pair. + Enter file in which to save the key (/root/.ssh/id_rsa): my_key + Enter passphrase (empty for no passphrase): + Enter same passphrase again: + Your identification has been saved in my_key. + Your public key has been saved in my_key.pub. + The key fingerprint is: + SHA256:MqD/pzzTRsCjZb6mpfjyrr5v1pJLBcgprR5tjNoI20A + +When compete, you will have two files: + +my_key + +my_key.pub + +Now copy the my_key.pub to ~/.ssh/authorized_keys + + cp my_key.pub ~/.ssh/authorized_keys + +Now upload your key on the server by using: + + scp -P16543 authorized_keys user@yourserver-ip:/home/user/.ssh/ + +Now you can access the server from the same local machine without having to enter any password. + +### Disable password authentication for SSH ### + +Now that we have SSH keys, it is safe to disable the password authentication for SSH. Open again the sshd_config file and set the following changes: + + ChallengeResponseAuthentication no + PasswordAuthentication no + UsePAM no + +### Disable Root login ### + +The next important step is to disable direct access with root user. Instead you should use sudo or su to perform administrative jobs. To do this you will need to add a new user that has root privileges. To do this you will need to edit the sudoers file located in: + + /etc/sudoers/ + +You may edit that file with command such as **visudo**. I would recommend you using this command as it will check the file for any syntax errors prior closing the file. This is useful if you have wrongly edited the file. + +Now to give root privileges to a user. For the purpose of this tutorial I will use user **sysadmin**. Make sure you are using an existing user on your system when you edit your own file. Now find the following line: + + root ALL=(ALL) ALL + +Copy that line and paste it below. In the new line change “root” with “sysadmin”. You should now have these two lines: + + root ALL=(ALL) ALL + sysadmin ALL=(ALL) ALL + +I would like to explain what each of the options in the above line represents: + + (1) root (2)ALL=(3)(ALL) (4)ALL + +(1) User + +(2) Terminal from which user can use sudo + +(3) Which users User may act as + +(4) Which commands he may use + + +You can use this settings to give access to users to some of the system tools. + +At this point it is safe to save your file. + +To disable direct root access over SSH open again the **sshd_config** file and find the following line: + + #PermitRootLogin yes + +and change it to: + + PermitRootLogin no + +Now save the file and restart the sshd daemon so the changes can take effect. Simply run the following command: + + sudo /etc/init.d/sshd restart + +### Setup firewall ### + +A firewall can help you block incoming and outgoing ports as well as block brute force login attempts. I like using SCF (Config Server Firewall) as it a powerful solution that uses iptables, it’s easy to manage and has a web interface for people who don’t like typing too many commands. + +To install CSF access your server and navigate to: + + cd /usr/local/src/ + +Then execute the following commands as root: + + wget https://download.configserver.com/csf.tgz + tar -xzf csf.tgz + csf + sh install.sh + +You will need to wait for the installer to finish its job. We will edit CSF configuration by editing: + + /etc/csf/csf.conf + +By default CSF will be started in testing mode. You will need to set it to product by changing the “TESTING” value to 0 + + TESTING = "0" + +Next thing you can edit are the allowed ports on your server. For that purpose find the following section of the csf.conf file and modify the ports per your needs: + + # Allow incoming TCP ports + TCP_IN = "20,21,25,53,80,110,143,443,465,587,993,995,16543" + # Allow outgoing TCP ports + TCP_OUT = "20,21,22,25,53,80,110,113,443,587,993,995,16543" + # Allow incoming UDP ports + UDP_IN = "20,21,53" + # Allow outgoing UDP ports + # To allow outgoing traceroute add 33434:33523 to this list + UDP_OUT = "20,21,53,113,123" + +Setup these per your requirements. I would recommend you using only the ports you need and avoiding allowing huge ranges of ports. Additionally you can avoid using the unsecured services unsecured ports. For example instead of allowing the default SMTP port 25 you can only allow ports 465 and 587 for outgoing emails. + +**IMPORTANT**: Do not forget to allow your customized SSH port. + +It is important to allow your IP address so it will never get blocked. Such IP addresses can be defined in: + + /etc/csf/csf.ignore + +The blocked IP address will appear in: + + /etc/csf/csf.deny + +When you have finished making changes – restart csf with: + + sudo /etc/init.d/csf restart + +Just to show you how useful CSF is I will show you part of csf.deny on one of my servers: + + 211.216.48.205 # lfd: (sshd) Failed SSH login from 211.216.48.205 (KR/Korea, Republic of/-): 5 in the last 3600 secs - Fri Mar 6 00:30:35 2015 + 103.41.124.53 # lfd: (sshd) Failed SSH login from 103.41.124.53 (HK/Hong Kong/-): 5 in the last 3600 secs - Fri Mar 6 01:06:46 2015 + 103.41.124.42 # lfd: (sshd) Failed SSH login from 103.41.124.42 (HK/Hong Kong/-): 5 in the last 3600 secs - Fri Mar 6 01:59:04 2015 + 103.41.124.26 # lfd: (sshd) Failed SSH login from 103.41.124.26 (HK/Hong Kong/-): 5 in the last 3600 secs - Fri Mar 6 02:48:26 2015 + 109.169.74.58 # lfd: (sshd) Failed SSH login from 109.169.74.58 (GB/United Kingdom/mail2.algeos.com): 5 in the last 3600 secs - Fri Mar 6 03:49:03 2015 + +The IP addresses that performed the brute force login attempt got blocked and they will not bother me again. + +#### Lock accounts #### + +In case an account is not going to be used for a long period of time you can lock it in order to prevent access to it. You can do this with: + + passwd -l accountName + +Account can still be used by the root user. + +### Know your services ### + +The whole idea of a server is to provide access to different services. Limit those to only the ones you need and disable the unused ones. This will not only free some resources, but will make your server a little bit more secured. For example if you are running a headless server you will definitely not need X display or a desktop environment. If there are no Windows network shares, you can safely disable Samba. + +You can use the commands below to see which services are started upon system boot: + + chkconfig --list | grep "3:on" + +If your system runs with **systemd**: + + systemctl list-unit-files --type=service | grep enabled + +To disable a service you can use commands such as: + + chkconfig service off + systemctl disable service + +In the above example change “service” with the name of the actual service you wish to stop. Here is an example: + + chkconfig httpd off + systemctl disable httpd + +### Conclusion ### + +This article was meant to cover some of the general security steps you can take to start securing your server. You can always take additional actions to increase the server protection. Remember that it is your responsibility to keep your server secured and make the wise decision while doing it. Unfortunately there is no easy way to do this and the “perfect” setup requires lots of time and tests until you achieve the desired result. + +-------------------------------------------------------------------------------- + +via: http://www.linuxveda.com/2015/06/03/secure-linux-server/ + +作者:[Marin Todorow][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.linuxveda.com/author/marin_todorov/ +[1]:http://en.wikipedia.org/wiki/Port_%28computer_networking%29#Common_port_numbers \ No newline at end of file diff --git a/sources/tech/20150610 Install Android Studio on Ubuntu 15.04.md b/sources/tech/20150610 Install Android Studio on Ubuntu 15.04.md new file mode 100644 index 0000000000..a570a83174 --- /dev/null +++ b/sources/tech/20150610 Install Android Studio on Ubuntu 15.04.md @@ -0,0 +1,65 @@ +Install Android Studio on Ubuntu 15.04 +================================================================================ +Android Studio is the official IDE for Android application development, based on IntelliJ IDEA. + +### Android Studio Features ### + +Flexible Gradle-based build system +Build variants and multiple apk file generation +Code templates to help you build common app features +Rich layout editor with support for drag and drop theme editing +lint tools to catch performance, usability, version compatibility, and other problems +ProGuard and app-signing capabilities +Built-in support for Google Cloud Platform, making it easy to integrate Google Cloud Messaging and App Engine +And much more + +### Install Android Studio on Ubuntu 15.04 ### + +Flexible Gradle-based build system +Build variants and multiple apk file generation +Code templates to help you build common app features +Rich layout editor with support for drag and drop theme editing +lint tools to catch performance, usability, version compatibility, and other problems +ProGuard and app-signing capabilities +Built-in support for Google Cloud Platform, making it easy to integrate Google Cloud Messaging and App Engine +And much more + +### Install Android Studio on Ubuntu 15.04 ### + +Open the terminal and run the following commands + + sudo apt-add-repository ppa:paolorotolo/android-studio + sudo apt-get update + sudo apt-get install android-studio + +If you want to add Android Studio to the launcher use the following procedure + +Open Android Studio, click on Configure -> Create Desktop Entry. This should create an entry on the dash + +### Screenshots ### + +![](http://www.ubuntugeek.com/wp-content/uploads/2015/05/12.png) + +![](http://www.ubuntugeek.com/wp-content/uploads/2015/05/23.png) + +![](http://www.ubuntugeek.com/wp-content/uploads/2015/05/31.png) + +![](http://www.ubuntugeek.com/wp-content/uploads/2015/05/41.png) + +![](http://www.ubuntugeek.com/wp-content/uploads/2015/05/5.png) + +![](http://www.ubuntugeek.com/wp-content/uploads/2015/05/6.png) + +![](http://www.ubuntugeek.com/wp-content/uploads/2015/05/7.png) + +-------------------------------------------------------------------------------- + +via: http://www.ubuntugeek.com/install-android-studio-on-ubuntu-15-04.html + +作者:[ruchi][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.ubuntugeek.com/author/ubuntufix \ No newline at end of file From 3ec806c2c11898c91b9fe310e977968a3079c8fe Mon Sep 17 00:00:00 2001 From: Alan You <1058413893@qq.com> Date: Wed, 10 Jun 2015 15:59:51 +0800 Subject: [PATCH 316/965] Update 20150515 How to Install Percona Server on CentOS 7.md --- ...w to Install Percona Server on CentOS 7.md | 42 ++++++++++++++++--- 1 file changed, 37 insertions(+), 5 deletions(-) diff --git a/sources/tech/20150515 How to Install Percona Server on CentOS 7.md b/sources/tech/20150515 How to Install Percona Server on CentOS 7.md index 9bfd676f92..141649b4fa 100644 --- a/sources/tech/20150515 How to Install Percona Server on CentOS 7.md +++ b/sources/tech/20150515 How to Install Percona Server on CentOS 7.md @@ -1,13 +1,23 @@ translating by FatJoe123 - +如何在CentOS 7上安装Percona Server How to Install Percona Server on CentOS 7 ================================================================================ +在这篇文章中我们将了解关于Percona Server,一个开源简易的MySQL,MariaDB的替代。InnoDB的数据库引擎使得Percona Server非常有吸引力,如果你需要的高性能,高可靠性和高性价比的解决方案,它将是一个很好的选择。 In this article we are going to learn about percona server, an opensource drop-in replacement for MySQL and also for MariaDB. The InnoDB database engine make it very attractive and a good alternative if you need performance, reliability and a cost efficient solution - +在接下来的文节中将涵盖在CentOS的7 Percona的服务器的安装,以及备份当前数据,配置的步骤和如何恢复备份。 In the following sections I am going to cover the installation of the percona server on the CentOS 7, I will also cover the steps needed to make backup of your current data, configuration and how to restore your backup. +###目录### ### Table of contents ### +1.什么是Percona,为什么使用它 +2.备份你的数据库 +3.删除之前的SQL服务器 +4.使用二进制包安装Percona +5.配置Percona +6. +7.恢复你的备份 + 1. What is and why use percona 1. Backup your databases 1. Remove previous SQL server @@ -16,52 +26,74 @@ In the following sections I am going to cover the installation of the percona se 1. Securing your environment 1. Restore your backup +### 1.什么是Percona,为什么使用它 ### 1. What is and why use Percona ### +Percona是一个开源简易的MySQL,MariaDB数据库的替代,它是MYSQL的一个分支,相当多的改进和独特的功能使得它比MYSQL更可靠,性能更强,速度更快,它与MYSQL完全兼容,在Oracle的MYSQL与Percona之间你甚至都可以使用复制命令。 Percona is an opensource alternative to the MySQL and MariaDB databases, it's a fork of the MySQL with many improvements and unique features that makes it more reliable, powerful and faster than MySQL, and yet is fully compatible with it, you can even use replication between Oracle's MySQL and Percona. - +#### 在Percona中独特的功能 #### #### Features exclusive to Percona #### +-分段自适应哈希搜索 +-快速校验算法 +-缓冲池预加载 +-支持FlashCache - Partitioned Adaptive Hash Search - Fast Checksum Algorithm - Buffer Pool Pre-Load - Support for FlashCache +#### MySQL企业版和Percona的特定功能 #### #### MySQL Enterprise and Percona specific features #### +-从不同的服务器导入表 +-PAM认证 +-审计日志 +-线程池 + - Import Tables From Different Servers - PAM authentication - Audit Log - Threadpool +现在,你肯定很兴奋地看到这些好的东西整理在一起,我们将告诉你如何安装和做些的Percona Server的基本配置。 Now that you are pretty excited to see all these good things together, we are going show you how to install and do basic configuration of Percona Server. +### 2. 备份你的数据库 ### ### 2. Backup your databases ### +接下来,在命令行下使用SQL命令创建一个mydatabases.sql文件来重建/恢复salesdb和employeedb数据库,重命名数据库以便反映你的设置,如果没有安装MYSQL跳过此步 The following, command creates a mydatabases.sql file with the SQL commands to recreate/restore salesdb and employeedb databases, replace the databases names to reflect your setup, skip if this is a brand new setup mysqldump -u root -p --databases employeedb salesdb > mydatabases.sql +复制当前的配置文件,如果你没有安装MYSQL也可跳过 Copy the current configuration file, you can also skip this in fresh setups cp my.cnf my.cnf.bkp +### 3.删除之前的SQL服务器 ### ### 3. Remove your previous SQL Server ### +停止MYSQL/MariaDB如果它们还在运行 Stop the MySQL/MariaDB if it's running. systemctl stop mysql.service - + +卸载MariaDB和MYSQL Uninstall MariaDB and MySQL yum remove MariaDB-server MariaDB-client MariaDB-shared mysql mysql-server +移动重命名在/var/lib/mysql当中的MariaDB文件,这比仅仅只是移除更为安全快速,这就像2级即时备份。:) Move / Rename the MariaDB files in **/var/lib/mysql**, it's a safer and faster than just removing, it's like a 2nd level instant backup. :) mv /var/lib/mysql /var/lib/mysql_mariadb - + +### 4.使用二进制包安装Percona ### ### 4. Installing Percona binaries ### +你可以在众多Percona安装方法中选择,在CentOS中使用Yum或者RPM包安装通常是更好的选择 You can choose from a number of options on how to install Percona, in a CentOS system it's generally a better idea to use yum or RPM, so these are the way that are covered by this article, compiling and install from sources are not covered by this article. Installing from Yum repository: From b38abdc36214c0e843efc00f233a2841534e8de3 Mon Sep 17 00:00:00 2001 From: Alan You <1058413893@qq.com> Date: Wed, 10 Jun 2015 17:47:43 +0800 Subject: [PATCH 317/965] Update 20150515 How to Install Percona Server on CentOS 7.md --- .../20150515 How to Install Percona Server on CentOS 7.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150515 How to Install Percona Server on CentOS 7.md b/sources/tech/20150515 How to Install Percona Server on CentOS 7.md index 141649b4fa..1ac8d71901 100644 --- a/sources/tech/20150515 How to Install Percona Server on CentOS 7.md +++ b/sources/tech/20150515 How to Install Percona Server on CentOS 7.md @@ -93,19 +93,24 @@ Move / Rename the MariaDB files in **/var/lib/mysql**, it's a safer and faster t ### 4.使用二进制包安装Percona ### ### 4. Installing Percona binaries ### -你可以在众多Percona安装方法中选择,在CentOS中使用Yum或者RPM包安装通常是更好的选择 +你可以在众多Percona安装方法中选择,在CentOS中使用Yum或者RPM包安装通常是更好的主意,所以这些是本文介绍的方式,下载源文件编译后安装在本文中并没有介绍。 + You can choose from a number of options on how to install Percona, in a CentOS system it's generally a better idea to use yum or RPM, so these are the way that are covered by this article, compiling and install from sources are not covered by this article. +从Yum仓库中安装: Installing from Yum repository: +首先,你需要用这个设置的Percona的Yum库: First you need to set the Percona's Yum repository with this: yum install http://www.percona.com/downloads/percona-release/redhat/0.1-3/percona-release-0.1-3.noarch.rpm +接下来安装Percona: And then install Percona with: yum install Percona-Server-client-56 Percona-Server-server-56 +上面的命令安装Percona的服务器和客户端,共享库,可能需要Perl和Perl模块,如DBI::MySQL的,如果尚未安装,以及其他依赖的需要。 The above command installs Percona server and clients, shared libraries, possibly Perl and perl modules such as DBI::MySQL, if that are not already installed, and also other dependencies as needed. Installing from RPM package: From 996528087d801c0ca2efd9dff573f996eb4d6814 Mon Sep 17 00:00:00 2001 From: NearTan Date: Wed, 10 Jun 2015 19:16:07 +0800 Subject: [PATCH 318/965] Update 20150610 Install Android Studio on Ubuntu 15.04.md --- .../tech/20150610 Install Android Studio on Ubuntu 15.04.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150610 Install Android Studio on Ubuntu 15.04.md b/sources/tech/20150610 Install Android Studio on Ubuntu 15.04.md index a570a83174..a77a50ebcf 100644 --- a/sources/tech/20150610 Install Android Studio on Ubuntu 15.04.md +++ b/sources/tech/20150610 Install Android Studio on Ubuntu 15.04.md @@ -1,3 +1,5 @@ +NearTan 翻译中 + Install Android Studio on Ubuntu 15.04 ================================================================================ Android Studio is the official IDE for Android application development, based on IntelliJ IDEA. @@ -62,4 +64,4 @@ via: http://www.ubuntugeek.com/install-android-studio-on-ubuntu-15-04.html 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 -[a]:http://www.ubuntugeek.com/author/ubuntufix \ No newline at end of file +[a]:http://www.ubuntugeek.com/author/ubuntufix From 41748dc3df8c962939557c4ffca1a8b7318ef79a Mon Sep 17 00:00:00 2001 From: NearTan Date: Wed, 10 Jun 2015 19:17:25 +0800 Subject: [PATCH 319/965] Update 20150610 Install Android Studio on Ubuntu 15.04.md --- sources/tech/20150610 Install Android Studio on Ubuntu 15.04.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20150610 Install Android Studio on Ubuntu 15.04.md b/sources/tech/20150610 Install Android Studio on Ubuntu 15.04.md index a77a50ebcf..c7fc919743 100644 --- a/sources/tech/20150610 Install Android Studio on Ubuntu 15.04.md +++ b/sources/tech/20150610 Install Android Studio on Ubuntu 15.04.md @@ -1,4 +1,4 @@ -NearTan 翻译中 +translating by NearTan Install Android Studio on Ubuntu 15.04 ================================================================================ From 133c3df3e9f7bd2a2a4a041fcf88d5726c8a2516 Mon Sep 17 00:00:00 2001 From: yajun Date: Wed, 10 Jun 2015 19:44:38 +0800 Subject: [PATCH 320/965] =?UTF-8?q?=20=E7=BF=BB=E8=AF=91=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...Websites and Downloading Files in Linux.md | 154 ------------------ ...Websites and Downloading Files in Linux.md | 149 +++++++++++++++++ 2 files changed, 149 insertions(+), 154 deletions(-) delete mode 100644 sources/tech/20150410 7 Command Line Tools for Browsing Websites and Downloading Files in Linux.md create mode 100644 translated/tech/20150410 7 Command Line Tools for Browsing Websites and Downloading Files in Linux.md diff --git a/sources/tech/20150410 7 Command Line Tools for Browsing Websites and Downloading Files in Linux.md b/sources/tech/20150410 7 Command Line Tools for Browsing Websites and Downloading Files in Linux.md deleted file mode 100644 index 27c3e388ef..0000000000 --- a/sources/tech/20150410 7 Command Line Tools for Browsing Websites and Downloading Files in Linux.md +++ /dev/null @@ -1,154 +0,0 @@ -fyh翻译中。。。 - -7 Command Line Tools for Browsing Websites and Downloading Files in Linux -================================================================================ -In the last article, we have covered few useful tools like ‘rTorrent‘, ‘wget‘, ‘cURL‘, ‘w3m‘, and ‘Elinks‘. We got lots of response to cover few other tools of same genre, if you’ve missed the first part you can go through it.. - -- [5 Command Line Tools for Downloading Files and Browsing Websites][1] - -This article aims at making you aware of several other Linux command Line browsing and downloading applications, which will help you to browse and download files within the Linux shell. - -### 1. links ### - -Links is an open source web browser written in C programming Language. It is available for all major platforms viz., Linux, Windows, OS X and OS/2. This browser is text based as well as graphical. The text based links web browser is shipped by most of the standard Linux distributions by default. If links is not installed in your system by default you may install it from the repo. Elinks is a fork of links. - - # apt-get install links - # yum install links - -After installing links, you can browse any websites within the terminal as shown below in the screen cast.. - - # links www.tecmint.com - -Use UP and DOWN arrow keys to navigate. Right arrow Key on a link will redirect you to that link and Left arrow key will bring you back to the last page. To QUIT press q. - -Here is how it seems to access Tecmint using links tool. - -![](http://www.tecmint.com/wp-content/uploads/2015/04/links-browse-websites-terminal.gif) - -If you are interested in installing GUI of links, you may need to download latest source tarball (i.e. version 2.9) from [http://links.twibright.com/download/][2]. - -Alternatively, you may use following wget command to download and install as suggested below. - - # wget http://links.twibright.com/download/links-2.9.tar.gz - # tar -xvf links-2.9.tar.gz - # cd links-2.9 - # ./configure –enable-graphics - # make - # make install - -**Note**: You need to install packages (libpng, libjpeg, TIFF library, SVGAlib, XFree86, C Compiler and make), if not already installed to successfully compile the package. - -### 2. links2 ### - -Links2 is a graphical web browser version of Twibright Labs Links web browser. This browser has support for mouse and clicks. Designed specially for speed without any CSS support, fairly good HTML and JavaScript support with limitations. - -To install links2. - - # apt-get install links2 - # yum install links2 - -### 3. lynx ### - -A text based web browser released under GNU GPLv2 license and written in ISO C. lynx is highly configurable web browser and Savior for many SYSAdmin. It has the reputation of being the oldest web browser that is being used and still actively developed. - -To install lynx. - - # apt-get install lynx - # yum install lynx - -After installing lynx, type the following command to browse the website as shown below in the screen cast.. - - # lynx www.tecmint.com - -![](http://www.tecmint.com/wp-content/uploads/2015/04/lynx-commandline-web-browsing.gif) - -If you are interested in knowing a bit more about links and lynx web browser, you may like to visit the below link: - -- [Web Browsing with Lynx and Links Command Line Tools][3] - -### 4. youtube-dl ### - -youtube-dl is a platform independent application which can be used to download videos from youtube and a few other sites. Written primarily in python and released under GNU GPL License, the application works out of the box. (Since youtube don’t allow you to download videos, it may be illegal to use it. Check the laws before you start using this.) - -To install youtube-dl. - - # apt-get install youtube-dl - # yum install youtube-dl - -After installing, try to download files from the Youtube site, as shown in the below screen cast. - - # youtube-dl https://www.youtube.com/watch?v=ql4SEy_4xws - -![](http://www.tecmint.com/wp-content/uploads/2015/04/download-youtube-videos-from-terminal.gif) - -If you are interested in knowing more about youtube-dl you may like to visit the below link: - -- [YouTube-DL – A Command Line Youtube Video Downloader for Linux][4] - -### 5. fetch ### - -It is a command utility for unix-like operating system that is used for URL retrieval. It supports a lot of options like fetching ipv4 only address, ipv6 only address, no redirect, exit after successful file retrieval request, retry, etc. - -Fetch can be Downloaded and installed from the link below - -- [http://sourceforge.net/projects/fetch/?source=typ_redirect][5] - -But before you compile and run it, you should install HTTP Fetcher. Download HTTP Fetcher from the link below. - -- [http://sourceforge.net/projects/http-fetcher/?source=typ_redirect][6] - -### 6. Axel ### - -Axel is a command-line based download accelerator for Linux. Axel makes it possible to download a file at much faster speed through single connection request for multiple copies of files in small chunks through multiple http and ftp connections. - -To install Axel. - - # apt-get install axel - # yum install axel - -After axel installed, you may use following command to download any given file, as shown in the screen cast. - - # axel http://mirror.cse.iitk.ac.in/archlinux/iso/2015.04.01/archlinux-2015.04.01-dual.iso - -![](http://www.tecmint.com/wp-content/uploads/2015/04/download-accelarator-for-linux.gif) - -### 7. aria2 ### - -aria2 is a command-line based download utility that is lightweight and support multi-protocol (HTTP, HTTPS, FTP, BitTorrent and Metalink). It can use metalinks files to simultaneously download ISO files from more than one server. It can serve as a Bit torrent client as well. - -To install aria2. - - # apt-get install aria2 - # yum install aria2 - -Once aria2 installed, you can fire up the following command to download any given file… - - # aria2c http://cdimage.debian.org/debian-cd/7.8.0/multi-arch/iso-cd/debian-7.8.0-amd64-i386-netinst.iso - -![Aria2: Command Line Download Manager for Linux](http://www.tecmint.com/wp-content/uploads/2015/04/Download-Files-in-Terminal.gif) -Aria2: Command Line Download Manager for Linux - -If you’re interested to know more at aria2 and their switches, read the following article. - -- [Aria2 – A Multi-Protocol Command-Line Download Manager for Linux][7] - -That’s all for now. I’ll be here again with another interesting topic you people will love to read. Till then stay tuned and connected to Tecmint. Don’t forget to provide us with your valuable feedback in the comments below. Like and share us and help us get spread. - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/command-line-web-browser-download-file-in-linux/ - -作者:[Avishek Kumar][a] -译者:[wangjiezhe](https://github.com/wangjiezhe) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://www.tecmint.com/author/avishek/ -[1]:http://www.tecmint.com/linux-command-line-tools-for-downloading-files/ -[2]:http://links.twibright.com/download/ -[3]:http://www.tecmint.com/command-line-web-browsers/ -[4]:http://www.tecmint.com/install-youtube-dl-command-line-video-download-tool/ -[5]:http://sourceforge.net/projects/fetch/?source=typ_redirect -[6]:http://sourceforge.net/projects/http-fetcher/?source=typ_redirect -[7]:http://www.tecmint.com/install-aria2-a-multi-protocol-command-line-download-manager-in-rhel-centos-fedora/ diff --git a/translated/tech/20150410 7 Command Line Tools for Browsing Websites and Downloading Files in Linux.md b/translated/tech/20150410 7 Command Line Tools for Browsing Websites and Downloading Files in Linux.md new file mode 100644 index 0000000000..0d73e957de --- /dev/null +++ b/translated/tech/20150410 7 Command Line Tools for Browsing Websites and Downloading Files in Linux.md @@ -0,0 +1,149 @@ +Linux中7个用来浏览网页和下载文件的命令 +================================================================================ +上一篇文章中,我们提到了`rTorrent`、`wget`、`cURL`、`w3m`、`Elinks`等几个有用的工具,很多人回信说还有其它几个类似的工具也值得讨论,所以就有了这篇文章。如果错过了第一部分的讨论,可以通过下面的链接来回顾。 + +- [5个下载文件和浏览网页的命令行工具][1] + +这篇文章介绍了Linux下用于浏览网页和下载文件的其它几个命令行工具。 + +### 1. links ### + +Links是用C语言写的一个开源web浏览器,支持包括Linux、Windows、OS X和OS/2在内的所有主流平台。它提供了基于文本和图形界面两种版本。大多数标准的Linux发行版都默认包含了基于文本的版本。如果您的发行版中默认没有安装links,可以通过包管理工具进行安装。Elinks是links的一个衍生版本。 + + # apt-get install links + # yum install links + +安装完成后,您可以像下图中那样使用命令浏览任意网页。 + + # links www.tecmint.com + +在links中,可以使用键盘上的上下箭头键进行浏览。在超链接上按下右箭头会打开它,按下左箭头会返回到上一页面,按q键退出。 + +下图展示了如何使用links访问Tecmint的网站。 + +![](http://www.tecmint.com/wp-content/uploads/2015/04/links-browse-websites-terminal.gif) + +如何你想安装links的图形界面版本,可能需要从[http://links.twibright.com/download/][2]下载最新的版本tarball(version 2.9)的源代码。 + +同样,也可以像下面那样使用wget下载安装。 + + # wget http://links.twibright.com/download/links-2.9.tar.gz + # tar -xvf links-2.9.tar.gz + # cd links-2.9 + # ./configure –enable-graphics + # make + # make install + +**注意**:links源代码的编译需要安装libpng, libjpeg, TIFF library, SVGAlib, XFree86, C Compiler and make这几个包。 + +### 2. links2 ### + +Links是Twibright实验室编写的web浏览器,而Links2是基于它的一个图形化版本。Links2支持鼠标点击,设计强调速度,不支持任何CSS,在一定程度上很好地支持了HTML和JavaScript。 + +通过下面的命令安装Links2。 + + # apt-get install links2 + # yum install links2 + +### 3. lynx ### + +lynx是一个基于文本的web浏览器,使用GNU GPLv2协议发布,用ISO C编写。lynx是一个可高度配置的web浏览器,是许多系统管理员的救世主,有最悠久的web浏览器之称,并且至今仍然处在积极开发中。 + +通过下面的命令安装lyns。 + + # apt-get install lynx + # yum install lynx + +安装完成后,可以像下图中那样使用这个命令浏览网页。 + + # lynx www.tecmint.com + +![](http://www.tecmint.com/wp-content/uploads/2015/04/lynx-commandline-web-browsing.gif) + +如果你想对links和lyns了解更多,可以访问下面的链接。 + +- [使用Lynx和Links命令浏览网页][3] + +### 4. youtube-dl ### + +youtube-dl是一个跨平台的应用,可以用来下载youtube和另外几个网站上的视频。它主要使用python开发,使用GNU GPL协议发布,并且超越了法律约束。(youtube不允许用户下载视频,因此使用youtube-dl可能会导致违法。使用该工具之前请您仔细阅读相关法律。) + +使用如下命令安装youtube-dl。 + + # apt-get install youtube-dl + # yum install youtube-dl + +安装完成后,可以用如下命令像图中那样从youtube网站下载视频。 + + # youtube-dl https://www.youtube.com/watch?v=ql4SEy_4xws + +![](http://www.tecmint.com/wp-content/uploads/2015/04/download-youtube-videos-from-terminal.gif) + +如果你想对youtube-dl了解更多,可以访问如下链接。 + +- [YouTube-DL – Linux下的youtube视频下载工具][4] + +### 5. fetch ### + +fetch是类unix系统下的一个检索URL的命令,支持许多选项,例如只检索ipv4或ipv6地址,无重定向,检索请求成功时退出,自动重试等。 + +fetch可以从通过下面的链接下载和安装。 + +- [http://sourceforge.net/projects/fetch/?source=typ_redirect][5] + +编译安装之前,需要安装HTTP Fetcher,可以通过下面的链接下载。 + +- [http://sourceforge.net/projects/http-fetcher/?source=typ_redirect][6] + +### 6. Axel ### + +Axel是Linux下的一个基于命令行的下载加速器,可以对请求使用多线程和多个http和ftp连接加速。 + +使用下面的命令安装Axel。 + + # apt-get install axel + # yum install axel + +Axel安装完成后,可以像下图那样使用这个命令下载任意文件。 + + # axel http://mirror.cse.iitk.ac.in/archlinux/iso/2015.04.01/archlinux-2015.04.01-dual.iso + +![](http://www.tecmint.com/wp-content/uploads/2015/04/download-accelarator-for-linux.gif) + +### 7. aria2 ### + +aria2是一个轻量级的基于命令行的下载工具,并且支持多种协议((HTTP, HTTPS, FTP, BitTorrent以及Metalink)。它可以使用.metalinks文件从多台服务器同时下载ISO文件。 + +使用下面的命令安装aria2。 + + # apt-get install aria2 + # yum install aria2 + +aria2安装完成后,可以像下图那样运行这个命令下载任意文件。 + + # aria2c http://cdimage.debian.org/debian-cd/7.8.0/multi-arch/iso-cd/debian-7.8.0-amd64-i386-netinst.iso + +![Aria2: Linux的命令行下载工具 ](http://www.tecmint.com/wp-content/uploads/2015/04/Download-Files-in-Terminal.gif) + +Aria2: Linux命令行下载工具 + +目前就这么多了。稍后咱们讨论另一个有意思的话题。请保持联系,常来Tecmint逛逛。别忘了在评论中给我们提供您的宝贵反馈,您的喜爱和分享帮助我们不断前行。 + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/command-line-web-browser-download-file-in-linux/ + +作者:[Avishek Kumar][a] +译者:[fyh](https://github.com/fyh) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/avishek/ +[1]:http://www.tecmint.com/linux-command-line-tools-for-downloading-files/ +[2]:http://links.twibright.com/download/ +[3]:http://www.tecmint.com/command-line-web-browsers/ +[4]:http://www.tecmint.com/install-youtube-dl-command-line-video-download-tool/ +[5]:http://sourceforge.net/projects/fetch/?source=typ_redirect +[6]:http://sourceforge.net/projects/http-fetcher/?source=typ_redirect +[7]:http://www.tecmint.com/install-aria2-a-multi-protocol-command-line-download-manager-in-rhel-centos-fedora/ From 880c256f67ea55fc53fdd3a8c9684d647421e71b Mon Sep 17 00:00:00 2001 From: NearTan Date: Wed, 10 Jun 2015 20:34:00 +0800 Subject: [PATCH 321/965] translated --- ... Install Android Studio on Ubuntu 15.04.md | 67 ------------------- ... Install Android Studio on Ubuntu 15.04.md | 67 +++++++++++++++++++ 2 files changed, 67 insertions(+), 67 deletions(-) delete mode 100644 sources/tech/20150610 Install Android Studio on Ubuntu 15.04.md create mode 100644 translated/tech/20150610 Install Android Studio on Ubuntu 15.04.md diff --git a/sources/tech/20150610 Install Android Studio on Ubuntu 15.04.md b/sources/tech/20150610 Install Android Studio on Ubuntu 15.04.md deleted file mode 100644 index c7fc919743..0000000000 --- a/sources/tech/20150610 Install Android Studio on Ubuntu 15.04.md +++ /dev/null @@ -1,67 +0,0 @@ -translating by NearTan - -Install Android Studio on Ubuntu 15.04 -================================================================================ -Android Studio is the official IDE for Android application development, based on IntelliJ IDEA. - -### Android Studio Features ### - -Flexible Gradle-based build system -Build variants and multiple apk file generation -Code templates to help you build common app features -Rich layout editor with support for drag and drop theme editing -lint tools to catch performance, usability, version compatibility, and other problems -ProGuard and app-signing capabilities -Built-in support for Google Cloud Platform, making it easy to integrate Google Cloud Messaging and App Engine -And much more - -### Install Android Studio on Ubuntu 15.04 ### - -Flexible Gradle-based build system -Build variants and multiple apk file generation -Code templates to help you build common app features -Rich layout editor with support for drag and drop theme editing -lint tools to catch performance, usability, version compatibility, and other problems -ProGuard and app-signing capabilities -Built-in support for Google Cloud Platform, making it easy to integrate Google Cloud Messaging and App Engine -And much more - -### Install Android Studio on Ubuntu 15.04 ### - -Open the terminal and run the following commands - - sudo apt-add-repository ppa:paolorotolo/android-studio - sudo apt-get update - sudo apt-get install android-studio - -If you want to add Android Studio to the launcher use the following procedure - -Open Android Studio, click on Configure -> Create Desktop Entry. This should create an entry on the dash - -### Screenshots ### - -![](http://www.ubuntugeek.com/wp-content/uploads/2015/05/12.png) - -![](http://www.ubuntugeek.com/wp-content/uploads/2015/05/23.png) - -![](http://www.ubuntugeek.com/wp-content/uploads/2015/05/31.png) - -![](http://www.ubuntugeek.com/wp-content/uploads/2015/05/41.png) - -![](http://www.ubuntugeek.com/wp-content/uploads/2015/05/5.png) - -![](http://www.ubuntugeek.com/wp-content/uploads/2015/05/6.png) - -![](http://www.ubuntugeek.com/wp-content/uploads/2015/05/7.png) - --------------------------------------------------------------------------------- - -via: http://www.ubuntugeek.com/install-android-studio-on-ubuntu-15-04.html - -作者:[ruchi][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.ubuntugeek.com/author/ubuntufix diff --git a/translated/tech/20150610 Install Android Studio on Ubuntu 15.04.md b/translated/tech/20150610 Install Android Studio on Ubuntu 15.04.md new file mode 100644 index 0000000000..25fe29e043 --- /dev/null +++ b/translated/tech/20150610 Install Android Studio on Ubuntu 15.04.md @@ -0,0 +1,67 @@ + +在Ubuntu 15.04下安装Android Studio +PS 原MD文件有大段重复并且排版错误,译者已修复 +================================================================================ + +Android Studio是官方为了Android应用开发者而发布的IDE,它基于IntelliJ的IDEA。 + +### Android Studio的功能 ### + +灵活的基于Gradle的建构系统 + +针对不同手机编译多个版本的apk + +代码模板功能构建出各种常用的应用 + +支持拖动编辑主题的富布局编辑器 + +lint工具可以捕捉到应用的性能、可用性、版本冲突或者其他问题 + +代码混淆和应用签名功能 + +内置 Google Cloud Platform 的支持,可以轻易的融入Google Cloud Messaging 和 App Engine支持 + +还有更多 + + + +### 在 Ubuntu 15.04 上安装 Android Studio ### + +打开terminal,输入以下命令 + + sudo apt-add-repository ppa:paolorotolo/android-studio + sudo apt-get update + sudo apt-get install android-studio + + +如果要把Android Studio添加到启动栏,你需要如下操作 + +打开Android Studio,点击Configure选择Create Desktop Entry,这样Android Studio应该在dash中创建快捷方式了。 + +### 截图 ### + +![](http://www.ubuntugeek.com/wp-content/uploads/2015/05/12.png) + +![](http://www.ubuntugeek.com/wp-content/uploads/2015/05/23.png) + +![](http://www.ubuntugeek.com/wp-content/uploads/2015/05/31.png) + +![](http://www.ubuntugeek.com/wp-content/uploads/2015/05/41.png) + +![](http://www.ubuntugeek.com/wp-content/uploads/2015/05/5.png) + +![](http://www.ubuntugeek.com/wp-content/uploads/2015/05/6.png) + +![](http://www.ubuntugeek.com/wp-content/uploads/2015/05/7.png) + +-------------------------------------------------------------------------------- + +via: http://www.ubuntugeek.com/install-android-studio-on-ubuntu-15-04.html + +作者:[ruchi][a] +译者:[NearTan](https://github.com/NearTan) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.ubuntugeek.com/author/ubuntufix \ No newline at end of file From c91ab0dbc81d1fda805d4fdd5bef0ba4ab73ca1b Mon Sep 17 00:00:00 2001 From: wxy Date: Wed, 10 Jun 2015 23:49:37 +0800 Subject: [PATCH 322/965] PUB:20150515 Basic Networking Commands with Docker Containers @geekpi --- ...working Commands with Docker Containers.md | 108 ++++++++++++++++++ ...working Commands with Docker Containers.md | 106 ----------------- 2 files changed, 108 insertions(+), 106 deletions(-) create mode 100644 published/20150515 Basic Networking Commands with Docker Containers.md delete mode 100644 translated/tech/20150515 Basic Networking Commands with Docker Containers.md diff --git a/published/20150515 Basic Networking Commands with Docker Containers.md b/published/20150515 Basic Networking Commands with Docker Containers.md new file mode 100644 index 0000000000..fd81249f10 --- /dev/null +++ b/published/20150515 Basic Networking Commands with Docker Containers.md @@ -0,0 +1,108 @@ +基础的Docker容器网络命令 +================================================================================ +各位好,今天我们将学习一些Docker容器的基础命令。Docker 是一个开源项目,提供了一个可以打包、装载和运行任何应用的轻量级容器的开放平台。它没有语言支持、框架和打包系统的限制,从小型的家用电脑到高端服务器,在何时何地都可以运行。它可以使部署和扩展web应用程序、数据库和后端服务像搭积木一样容易,而不依赖特定技术栈或提供商。Docker适用于网络环境,它正应用于数据中心、ISP和越来越多的网络服务。 + +因此,这里有一些你在管理Docker容器的时候会用到的一些命令。 + +### 1. 找到Docker接口 ### + +Docker默认会创建一个名为docker0的网桥接口作为连接外部世界的基础。运行中的docker容器直接连接到网桥接口docker0。默认上,docker会分配172.17.42.1/16给docker0,它是所有运行中的容器ip地址的子网。找到Docker接口的ip地址非常简单。要找出docker0网桥接口和连接到网桥上的docker容器,我们可以在安装了docker的终端或者shell中运行ip命令。 + + # ip a + +![Docker Interface](http://blog.linoxide.com/wp-content/uploads/2015/05/docker-interface.png) + +### 2. 得到Docker容器的ip地址 ### + +如我们上面读到的,docker在宿主机中创建了一个叫docker0的网桥接口。在我们创建一个新的docker容器时,它自动被默认分配了一个在该子网范围内的ip地址。因此,要检测运行中的Docker容器的ip地址,我们需要进入一个正在运行的容器并用下面的命令检查ip地址。首先,我们运行一个新的容器并进入其中。如果你已经有一个正在运行的容器,你可以跳过这个步骤。 + + # docker run -it ubuntu + +现在,我们可以运行ip a来得到容器的ip地址了。 + + # ip a + +![Docker Container IP](http://blog.linoxide.com/wp-content/uploads/2015/05/docker-container-ip.png) + +### 3. 映射暴露的端口 ### + +要映射配置在Dockerfile的暴露端口到宿主机的高位端口,我们只需用下面带上-P标志的命令。这会打开docker容器的随机端口并映射到Dockerfile中定义的端口。下面是使用-P来打开/暴露定义的端口的例子。 + + # docker run -itd -P httpd + +![Mapping Expose Port](http://blog.linoxide.com/wp-content/uploads/2015/05/mapping-expose-port.png) + +上面的命令会映射容器的端口到 httpd 容器的 Dockerfile 中定义的80端口上。我们用下面的命令来查看正在运行的容器暴露的端口。 + + # docker ps + +并且可以用下面的curl命令来检查。 + + # curl http://localhost:49153 + +![Curl Exposed Port](http://blog.linoxide.com/wp-content/uploads/2015/05/curl-exposed-port-e1431034586219.png) + +### 4. 映射到特定的端口上 ### + +我们也可以映射暴露端口或者docker容器端口到我们指定的端口上。要实现这个,我们用-p标志来定义我们所需的端口。这里是我们的一个例子。 + + # docker run -itd -p 8080:80 httpd + +上面的命令会映射(宿主机的)8080端口到(容器的)80上。我们可以运行curl来检查这点。 + + # curl http://localhost:8080 + +![Mapping Specific Port](http://blog.linoxide.com/wp-content/uploads/2015/05/mapping-specific-port.png) + +### 5. 创建自己的网桥 ### + +要给容器创建一个自定义的IP地址,在本篇中我们会创建一个名为br0的新网桥。要分配需要的ip地址,我们需要在运行docker的宿主机中运行下面的命令。 + + # stop docker.io + # ip link add br0 type bridge + # ip addr add 172.30.1.1/20 dev br0 + # ip link set br0 up + # docker -d -b br0 + +![Creating Bridge Interface](http://blog.linoxide.com/wp-content/uploads/2015/05/creating-bridge-interface.png) + +创建完docker网桥之后,我们要让docker的守护进程知道它。 + + # echo 'DOCKER_OPTS="-b=br0"' >> /etc/default/docker + # service docker.io start + +![Adding Interface to Docker](http://blog.linoxide.com/wp-content/uploads/2015/05/adding-interface-to-docker.png) + +到这里,桥接后的接口将会分配给容器在桥接子网内的新ip地址。 + +### 6. 链接到另外一个容器上 ### + +我们可以用Docker将一个容器连接到另外一个上。我们可以在不同的容器上运行不同的程序,并且相互连接或链接。链接允许容器间相互连接并从一个容器上安全地传输信息给另一个容器。要做到这个,我们可以使用--link标志。首先,我们使用--name标志来标示training/postgres镜像。 + + # docker run -d --name db training/postgres + +![Running db Container](http://blog.linoxide.com/wp-content/uploads/2015/05/running-db-container.png) + +完成之后,我们将容器db与training/webapp链接来形成新的叫web的容器。 + + # docker run -d -P --name web --link db:db training/webapp python app.py + +![linking two containers](http://blog.linoxide.com/wp-content/uploads/2015/05/linking-two-containers.png) + +### 总结 ### + +Docker网络很神奇也好玩,我们可以对docker容器做很多事情。我们可以把玩这些简单而基础的docker网络命令。docker的网络是非常先进的,我们可以用它做很多事情。 + +如果你有任何的问题、建议、反馈请在下面的评论栏写下来以便于我们我们可以提升或者更新文章的内容。谢谢! 玩得开心!:-) + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/linux-how-to/networking-commands-docker-containers/ + +作者:[Arun Pyasi][a] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://linoxide.com/author/arunp/ diff --git a/translated/tech/20150515 Basic Networking Commands with Docker Containers.md b/translated/tech/20150515 Basic Networking Commands with Docker Containers.md deleted file mode 100644 index d4b90aa7f2..0000000000 --- a/translated/tech/20150515 Basic Networking Commands with Docker Containers.md +++ /dev/null @@ -1,106 +0,0 @@ -关于Docker容器的基础网络命令 -================================================================================ -各位好,今天我们将学习一些Docker容器的基础命令。Docker是一个提供了开放平台来打包、发布并以一个轻量级容器运行任意程序的开放平台。它没有语言支持、框架或者打包系统的限制,可在任何时间、任何地方在小到家用电脑大到高端服务器上运行。这使得在部署和扩展网络应用、数据库和终端服务时不依赖于特定的栈或者提供商。Docker注定是用于网络的如它正应用于数据中心、ISP和越来越多的网络服务。 - -因此,这里有一些你在管理Docker容器的时候会用到的一些命令。 - -### 1. 找到Docker接口 ### - -Docker默认会创建一个名为docker0的网桥接口来连接外部的世界。docker容器运行时直接连接到网桥接口docker0。默认上,docker会分配172.17.42.1/16给docker0,它是所有运行容器ip地址的子网。得到Docker接口的ip地址非常简单。要找出docker0网桥接口和连接到网桥上的docker容器,我们可以在终端或者安装了docker的shell中运行ip命令。 - - # ip a - -![Docker Interface](http://blog.linoxide.com/wp-content/uploads/2015/05/docker-interface.png) - -### 2. 得到Docker容器的ip地址 ### - -如我们上面读到的,docker在主机中创建了一个叫docker0的网桥接口。如我们创建一个心的docker容器一样,它自动被默认分配了一个在子网范围内的ip地址。因此,要检测运行中的Docker容器的ip地址,我们需要进入一个正在运行的容器并用下面的命令检查ip地址。首先,我们运行一个新的容器并进入。如果你已经有一个正在运行的容器,你可以跳过这个步骤。 - - # docker run -it ubuntu - -现在,我们可以运行ip a来得到容器的ip地址了。 - - # ip a - -![Docker Container IP](http://blog.linoxide.com/wp-content/uploads/2015/05/docker-container-ip.png) - -### 3. 映射暴露的端口 ### - -要映射配置在Dockerfile的暴露端口,我们只需用下面带上-P标志的命令。这会打开docker容器的随机端口并映射到Dockerfile中定义的端口。下面是使用-P来打开/映射定义的端口的例子。 - - # docker run -itd -P httpd - -![Mapping Expose Port](http://blog.linoxide.com/wp-content/uploads/2015/05/mapping-expose-port.png) - -上面的命令会映射Dockerfile中定义的httpd 80端口到容器的端口上。我们用下面的命令来查看正在运行的容器暴露的端口。 - - # docker ps - -并且可以用下面的curl命令来检查。 - - # curl http://localhost:49153 - -![Curl Exposed Port](http://blog.linoxide.com/wp-content/uploads/2015/05/curl-exposed-port-e1431034586219.png) - -### 4. 映射到特定的端口上 ### - -我们也可以映射暴露端口或者docker容器端口到我们指定的端口上。要实现这个,我们用-p标志来定义我们的需要。这里是我们的一个例子。 - - # docker run -itd -p 8080:80 httpd - -上面的命令会映射8080端口到80上。我们可以运行curl来检查这点。 - - # curl http://localhost:8080 - -![Mapping Specific Port](Curl Exposed Port) - -### 5. 创建自己的网桥 ### - -要给容器创建一个自定义的IP地址,在本篇中我们会创建一个名为bro的新网桥。要分配需要的ip地址,我们需要在运行docker的主机中运行下面的命令。 - - # stop docker.io - # ip link add br0 type bridge - # ip addr add 172.30.1.1/20 dev br0 - # ip link set br0 up - # docker -d -b br0 - -![Creating Bridge Interface](http://blog.linoxide.com/wp-content/uploads/2015/05/creating-bridge-interface.png) - -创建完docker网桥之后,我们要让docker的守护进程知道它。 - - # echo 'DOCKER_OPTS="-b=br0"' >> /etc/default/docker - # service docker.io start - -![Adding Interface to Docker](http://blog.linoxide.com/wp-content/uploads/2015/05/adding-interface-to-docker.png) - -到这里,桥接后的接口将会分配给容器新的在桥接子网内的ip地址。 - -### 6. 链接到另外一个容器上 ### - -我们可以用Dokcer连接一个容器到另外一个上。我们可以在不容的容器上运行不同的程序,并且相互连接或链接。链接允许容器间相互连接并安全地从一个容器上传输信息给另一个容器。要做到这个,我们可以使用--link标志。首先,我们使用--name标志来表示training/postgres镜像。 - - # docker run -d --name db training/postgres - -![Running db Container](http://blog.linoxide.com/wp-content/uploads/2015/05/running-db-container.png) - -完成之后,我们将容器db与training/webapp链接来形成新的叫web的容器。 - - # docker run -d -P --name web --link db:db training/webapp python app.py - -![linking two containers](http://blog.linoxide.com/wp-content/uploads/2015/05/linking-two-containers.png) - -### 总结 ### - -Docker网络很神奇也好玩,因为有我们可以对docker容器做很多事情。这里有些简单和基础的我们可以把玩docker网络命令。docker的网络是非常高级的。我们可以用它做很多事情。如果你有任何的问题、建议、反馈请在下面的评论栏写下来以便于我们我们可以提升或者更新文章的内容。谢谢! 玩得开心!:-) - --------------------------------------------------------------------------------- - -via: http://linoxide.com/linux-how-to/networking-commands-docker-containers/ - -作者:[Arun Pyasi][a] -译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://linoxide.com/author/arunp/ From 1c4dbb48cc7b7ae59fbead08a63160fb59192620 Mon Sep 17 00:00:00 2001 From: wxy Date: Thu, 11 Jun 2015 00:02:31 +0800 Subject: [PATCH 323/965] PUB:20150511 Fix Various Update Errors In Ubuntu 14.04 @GOLinux --- ...0511 Fix Various Update Errors In Ubuntu 14.04.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) rename {translated/tech => published}/20150511 Fix Various Update Errors In Ubuntu 14.04.md (90%) diff --git a/translated/tech/20150511 Fix Various Update Errors In Ubuntu 14.04.md b/published/20150511 Fix Various Update Errors In Ubuntu 14.04.md similarity index 90% rename from translated/tech/20150511 Fix Various Update Errors In Ubuntu 14.04.md rename to published/20150511 Fix Various Update Errors In Ubuntu 14.04.md index 3780b4f948..085869bde6 100644 --- a/translated/tech/20150511 Fix Various Update Errors In Ubuntu 14.04.md +++ b/published/20150511 Fix Various Update Errors In Ubuntu 14.04.md @@ -1,8 +1,8 @@ -修复Ubuntu 14.04中各种更新错误 +Ubuntu 更新错误修复大全 ================================================================================ ![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2014/09/Fix_Ubuntu_Update_Error.jpeg) -在Ubuntu更新中,谁没有碰见个错误?在Ubuntu和其它基于Ubuntu的Linux发行版中,更新错误很常见,也为数不少。这些错误出现的原因多种多样,修复起来也很简单。在本文中,我们将见到Ubuntu中各种类型频繁发生的更新错误以及它们的修复方法。 +在Ubuntu更新中,谁没有碰见个错误?在Ubuntu和其它基于Ubuntu的Linux发行版中,更新错误是一个共性的错误,也经常发生。这些错误出现的原因多种多样,修复起来也很简单。在本文中,我们将见到Ubuntu中各种类型频繁发生的更新错误以及它们的修复方法。 ### 合并列表问题 ### @@ -38,7 +38,7 @@ 下载仓库信息失败的另外一种类型是由于PPA过时导致的。通常,当你运行更新管理器,并看到这样的错误时: -![](Th other type of failed to download repository information error is because of outdated PPA. Usually, when you run Update Manager and see an error like this:) +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2013/04/Failed-to-download-repository-information-Ubuntu-13.04.png) 你可以运行sudo apt-get update来查看哪个PPA更新失败,你可以把它从源列表中删除。你可以按照这个截图指南来[修复下载仓库信息失败错误][3]。 @@ -48,7 +48,7 @@ ![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2014/09/Ubuntu_Update_error.jpeg) -该错误很容易修复,只需修改软件源为主服务器即可。转到软件和更新,在那里你可以修改下载服务器为主服务器: +该错误很容易修复,只需修改软件源为主服务器即可。转到“软件和更新”,在那里你可以修改下载服务器为主服务器: ![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2014/09/Change_server_Ubuntu.jpeg) @@ -78,7 +78,7 @@ 你可以在这里查找到更多详细内容[加载共享库时发生错误][6]。 -### 无法获取锁/var/cache/apt/archives/lock ### +### 无法获取锁 /var/cache/apt/archives/lock ### 在另一个程序在使用APT时,会发生该错误。假定你正在Ubuntu软件中心安装某个东西,然后你又试着在终端中运行apt。 @@ -135,7 +135,7 @@ via: http://itsfoss.com/fix-update-errors-ubuntu-1404/ 作者:[Abhishek][a] 译者:[GOLinux](https://github.com/GOLinux) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From d00240269dfae5b99c65514ae39ce77b5bd1e92a Mon Sep 17 00:00:00 2001 From: wxy Date: Thu, 11 Jun 2015 00:15:27 +0800 Subject: [PATCH 324/965] PUB:20150512 A Shell Script to Monitor Network, Disk Usage, Uptime, Load Average and RAM Usage in Linux @GOLinux --- ...me, Load Average and RAM Usage in Linux.md | 27 ++++++++++--------- 1 file changed, 14 insertions(+), 13 deletions(-) rename {translated/tech => published}/20150512 A Shell Script to Monitor Network, Disk Usage, Uptime, Load Average and RAM Usage in Linux.md (60%) diff --git a/translated/tech/20150512 A Shell Script to Monitor Network, Disk Usage, Uptime, Load Average and RAM Usage in Linux.md b/published/20150512 A Shell Script to Monitor Network, Disk Usage, Uptime, Load Average and RAM Usage in Linux.md similarity index 60% rename from translated/tech/20150512 A Shell Script to Monitor Network, Disk Usage, Uptime, Load Average and RAM Usage in Linux.md rename to published/20150512 A Shell Script to Monitor Network, Disk Usage, Uptime, Load Average and RAM Usage in Linux.md index 58eb9f18ca..723cf72ddf 100644 --- a/translated/tech/20150512 A Shell Script to Monitor Network, Disk Usage, Uptime, Load Average and RAM Usage in Linux.md +++ b/published/20150512 A Shell Script to Monitor Network, Disk Usage, Uptime, Load Average and RAM Usage in Linux.md @@ -1,21 +1,22 @@ -Linux中用于监控网络、磁盘使用、开机时间、平均负载和内存使用率的shell脚本 +一个Linux中用于监控的简易shell脚本 ================================================================================ -系统管理员的任务真的很艰难,因为他/她必须监控服务器、用户、日志,还得创建备份,等等等等。对于大多数重复性的任务,大多数管理员都会写一个自动化脚本来日复一日重复这些任务。这里,我们已经写了一个shell脚本给大家,用来自动化完成系统管理员所要完成的常规任务,这可能在多数情况下,尤其是对于新手而言十分有用,他们能通过该脚本获取到大多数的他们想要的信息,包括系统、网络、用户、负载、内存、主机、内部IP、外部IP、开机时间等。 +系统管理员的任务真的很艰难,因为他/她必须监控服务器、用户、日志,还得创建备份,等等等等。对于大多数重复性的任务,大多数管理员都会写一个自动化脚本来日复一日地重复这些任务。这里,我们已经写了一个shell脚本给大家,用来自动化完成系统管理员所要完成的常规任务,这可能在多数情况下,尤其是对于新手而言十分有用,他们能通过该脚本获取到大多数的他们想要的信息,包括系统、网络、用户、负载、内存、主机、内部IP、外部IP、开机时间等。 我们已经注意并进行了格式化输出(在一定程度上哦)。此脚本不包含任何恶意内容,并且它能以普通用户帐号运行。事实上,我们也推荐你以普通用户运行该脚本,而不是root。 ![Linux Server Health Monitoring](http://www.tecmint.com/wp-content/uploads/2015/05/Linux-Health-Monitoring.png) -监控Linux系统健康的Shell脚本 -你可以通过给Tecmint和脚本作者合适的积分,获得自由使用/修改/再分发下面代码的权利。我们已经试着在一定程度上自定义了输出结果,除了要求的输出内容外,其它内容都不会生成。我们也已经试着使用了那些Linux系统中通常不使用的变量,这些变量可能也是自由代码。 +*监控Linux系统健康的Shell脚本* + +在保留Tecmint和脚本作者应得荣誉的前提下,可以自由使用/修改/再分发下面代码。我们已经试着在一定程度上自定义了输出结果,除了要求的输出内容外,其它内容都不会生成。我们也已经试着使用了那些Linux系统中通常不使用的变量,这些变量应该是可以随便用的。 #### 最小系统要求 #### -你所需要的一切,就是一台正常运转的Linux盒子。 +你所需要的一切,就是一台正常运转的Linux机器。 #### 依赖性 #### -对于一个标准的Linux发行版,使用此包时没有任何依赖。此外,该脚本不需要root权限来执行。但是,如果你想要安装,则必须输入一次root密码。 +对于一个标准的Linux发行版,使用此软件包不需任何依赖。此外,该脚本不需要root权限来执行。但是,如果你想要安装,则必须输入一次root密码。 #### 安全性 #### @@ -30,16 +31,16 @@ Linux中用于监控网络、磁盘使用、开机时间、平均负载和内存 强烈建议你以普通用户身份安装该脚本,而不是root。安装过程中会询问root密码,并且在需要的时候安装必要的组件。 -要安装`“tecmint_monitor.sh”`脚本,只需像下面这样使用-i(安装)选项就可以了。 +要安装“`tecmint_monitor.sh`”脚本,只需像下面这样使用-i(安装)选项就可以了。 - /tecmint_monitor.sh -i + ./tecmint_monitor.sh -i 在提示你输入root密码时输入该密码。如果一切顺利,你会看到像下面这样的安装成功信息。 Password: Congratulations! Script Installed, now run monitor Command -安装完毕后,你可以通过在任何位置,以任何用户调用命令`‘monitor’`来运行该脚本。如果你不喜欢安装,你需要在每次运行时输入路径。 +安装完毕后,你可以在任何位置,以任何用户调用命令`‘monitor’`来运行该脚本。如果你不喜欢安装,你需要在每次运行时输入路径。 # ./Path/to/script/tecmint_monitor.sh @@ -49,7 +50,7 @@ Linux中用于监控网络、磁盘使用、开机时间、平均负载和内存 ![TecMint Monitor Script in Action](http://www.tecmint.com/wp-content/uploads/2015/05/TecMint-Monitor-Script.gif) -你一运行命令,就会获得下面这些各种各样和系统相关的信息: +你运行命令就会获得下面这些各种各样和系统相关的信息: - 互联网连通性 - 操作系统类型 @@ -78,9 +79,9 @@ Linux中用于监控网络、磁盘使用、开机时间、平均负载和内存 ### 小结 ### -该脚本在一些机器上可以开机即用,这一点我已经检查过。相信对于你而言,它也会正常工作。如果你们发现了什么毛病,可以在评论中告诉我。这个脚本还不是结束,这仅仅是个开始。从这里开始,你可以将它提升到任何等级。如果你想要编辑脚本,将它带入一个更深的层次,尽管随意去做吧,别忘了给我们合适的积分,也别忘了把你更新后的脚本拿出来和我们分享哦,这样,我们也能通过给你合适的积分来更新此文。 +该脚本在一些机器上可以开机即用,这一点我已经检查过。相信对于你而言,它也会正常工作。如果你们发现了什么毛病,可以在评论中告诉我。这个脚本还不完善,这仅仅是个开始。从这里开始,你可以将它改进到任何程度。如果你想要编辑脚本,将它带入一个更深的层次,尽管随意去做吧,别忘了给我们应的的荣誉,也别忘了把你更新后的脚本拿出来和我们分享哦,这样,我们也会更新此文来给你应得的荣誉。 -别忘了和我们分享你的想法或者脚本,我们会在这儿帮助你。谢谢你们给予的所有挚爱。保持连线,不要走开哦。 +别忘了和我们分享你的想法或者脚本,我们会在这儿帮助你。谢谢你们给予的所有挚爱。继续浏览,不要走开哦。 -------------------------------------------------------------------------------- @@ -88,7 +89,7 @@ via: http://www.tecmint.com/linux-server-health-monitoring-script/ 作者:[Avishek Kumar][a] 译者:[GOLinux](https://github.com/GOLinux) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 30c2f196d396c6dee08de1ac3ee65325a5b0887e Mon Sep 17 00:00:00 2001 From: wxy Date: Thu, 11 Jun 2015 00:42:49 +0800 Subject: [PATCH 325/965] PUB:20150527 How to Kill Linux Processes or Unresponsive Applications Using 'xkill' Command @geekpi --- ...sive Applications Using 'xkill' Command.md | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) rename {translated/tech => published}/20150527 How to Kill Linux Processes or Unresponsive Applications Using 'xkill' Command.md (70%) diff --git a/translated/tech/20150527 How to Kill Linux Processes or Unresponsive Applications Using 'xkill' Command.md b/published/20150527 How to Kill Linux Processes or Unresponsive Applications Using 'xkill' Command.md similarity index 70% rename from translated/tech/20150527 How to Kill Linux Processes or Unresponsive Applications Using 'xkill' Command.md rename to published/20150527 How to Kill Linux Processes or Unresponsive Applications Using 'xkill' Command.md index 20211ab6bf..91127c7e74 100644 --- a/translated/tech/20150527 How to Kill Linux Processes or Unresponsive Applications Using 'xkill' Command.md +++ b/published/20150527 How to Kill Linux Processes or Unresponsive Applications Using 'xkill' Command.md @@ -1,8 +1,9 @@ -如何使用xkill命令傻点Linux进程/未响应的程序 +如何使用xkill命令杀掉Linux进程/未响应的程序 ================================================================================ + 我们如何在Linux中杀掉一个资源/进程?很明显我们会找出资源的pid然后用kill命令。 -更准确一点,我们可以找到资源(这里就是terminal)的PID: +说的更明白一点,我们可以找到某个资源(比如terminal)的PID: $ ps -A | grep -i terminal @@ -14,7 +15,7 @@ kill命令会发送一个信号给该pid的进程。 -另外一个方法是我们可以使用pkill命令,它可以基于进程的名字或者其他的属性来杀掉进程。同样我们要杀掉一个叫terminal的进程可以这么做: +另外一个方法是我们可以使用pkill命令,它可以基于进程的名字或者其他的属性来杀掉进程。同样我们要杀掉一个叫terminal的进程可以这么做: $ pkill terminal @@ -22,15 +23,15 @@ kill命令会发送一个信号给该pid的进程。 pkill看上去更加容易上手,因为你你不用找出进程的pid。但是如果你要对系统做更好的控制,那么没有什么可以打败'kill'。使用kill命令可以更好地审视你要杀掉的进程。 -我们已经有一篇覆盖了[kill、pkill和killall命令][1]间细节的指导了。 +我们已经有一篇覆盖了[kill、pkill和killall命令][1]细节的指导了。 对于那些运行X Server的人而言,有另外一个工具称为xkill可以将进程从X Window中杀掉而不必传递它的名字或者pid。 -xkill工具强制X server关闭于它客户端之间的联系,这可以让X resource关闭这个客户端。xkill是X11工具集中一个非常容易上手的杀掉无用窗口的工具。 +xkill工具强制X server关闭与它的客户程序之间的联系,其结果就是X resource关闭了这个客户程序。xkill是X11工具集中一个非常容易上手的杀掉无用窗口的工具。 -它支持的选项如在同时运行多个X Server时使用-display选项后面跟上显示号连接到指定的X server,使用-all(并不建议)杀掉所有在屏幕上的所遇顶层窗口,同时将帧(-frame)也计算在内。 +它支持的选项如在同时运行多个X Server时使用-display选项后面跟上显示号连接到指定的X server,使用-all(并不建议)杀掉所有在屏幕上的所有顶层窗口,以及帧(-frame)参数。 -要得到所有的客户端你可以运行: +要列出所有的客户程序你可以运行: $ xlsclients @@ -46,12 +47,11 @@ xkill工具强制X server关闭于它客户端之间的联系,这可以让X re 如果后面没有跟上资源id,xkill会将鼠标指针变成一个特殊符号,类似于“X”。只需在你要杀掉的窗口上点击,它就会杀掉它与server端的通信,这个程序就被杀掉了。 - $ xkill ![Xkill Command](http://www.tecmint.com/wp-content/uploads/2015/05/Xkill.png) -使用xkill杀掉进程 +*使用xkill杀掉进程* 需要注意的是xkill并不能保证它的通信会被成功杀掉/退出。大多数程序会在与服务端的通信被关闭后杀掉。然而仍有少部分会继续运行。 @@ -63,7 +63,7 @@ xkill工具强制X server关闭于它客户端之间的联系,这可以让X re **我需要在linux命令行中使用xkill么** -不是,你不必在命令行中运行xkill。你可以设置一个快捷键,并用它来调用xkill。 +不是,你不必非在命令行中运行xkill。你可以设置一个快捷键,并用它来调用xkill。 下面是如何在典型的gnome3桌面中设置键盘快捷键。 @@ -71,13 +71,13 @@ xkill工具强制X server关闭于它客户端之间的联系,这可以让X re ![Gnome Settings](http://www.tecmint.com/wp-content/uploads/2015/05/22.png) -Gnome 设置 +*Gnome 设置* ![Add Shortcut Key](http://www.tecmint.com/wp-content/uploads/2015/05/31.png) -添加快捷键 +*添加快捷键* -下次你要杀掉X资源只要用组合键就行了(Ctrl+Alt+Shift+x),你看到你的鼠标变成x了。点击想要杀掉的x资源就行了。 +下次你要杀掉一个X资源只要用组合键就行了(Ctrl+Alt+Shift+x),你看到你的鼠标变成x了。点击想要杀掉的x资源就行了。 -------------------------------------------------------------------------------- @@ -85,9 +85,9 @@ via: http://www.tecmint.com/kill-processes-unresponsive-programs-in-ubuntu/ 作者:[Avishek Kumar][a] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 [a]:http://www.tecmint.com/author/avishek/ -[1]:http://www.tecmint.com/how-to-kill-a-process-in-linux/ +[1]:https://linux.cn/article-2116-1.html From 3845863c321c307e2f8796bc523c5c64c2ab15cf Mon Sep 17 00:00:00 2001 From: yajun Date: Thu, 11 Jun 2015 09:12:18 +0800 Subject: [PATCH 326/965] =?UTF-8?q?fyh=E7=94=B3=E9=A2=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sources/talk/20141211 Open source all over the world.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/talk/20141211 Open source all over the world.md b/sources/talk/20141211 Open source all over the world.md index bd306edd5a..1ef32bf1de 100644 --- a/sources/talk/20141211 Open source all over the world.md +++ b/sources/talk/20141211 Open source all over the world.md @@ -1,3 +1,5 @@ +fyh 翻译中。。。 + Open source all over the world ================================================================================ ![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/BUS_OpenSourceExperience_520x292_cm.png) From ed235a6fd2837786aa4b3e4dbe79fe678c8a954d Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 11 Jun 2015 09:38:35 +0800 Subject: [PATCH 327/965] translating --- ...nginx and google pagespeed on Ubuntu 15.04 Vivid Vervet.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150610 How to Install nginx and google pagespeed on Ubuntu 15.04 Vivid Vervet.md b/sources/tech/20150610 How to Install nginx and google pagespeed on Ubuntu 15.04 Vivid Vervet.md index e98bb00523..dd3478c903 100644 --- a/sources/tech/20150610 How to Install nginx and google pagespeed on Ubuntu 15.04 Vivid Vervet.md +++ b/sources/tech/20150610 How to Install nginx and google pagespeed on Ubuntu 15.04 Vivid Vervet.md @@ -1,3 +1,5 @@ +translating----geekpi + How to Install nginx and google pagespeed on Ubuntu 15.04 (Vivid Vervet) ================================================================================ Nginx (engine-x) is a open source and high performance HTTP server, reverse proxy and IMAP/POP3 proxy server. The outstanding features of Nginx are: stability, rich feature set, simple configuration and low resource consumption. Nginx is being used by some of the largest websites on the internet and is gaining more and more popularity in the webmaster community. This tutorials shows how to build a nginx .deb package for Ubuntu 15.04 from source that has Google pagespeed module compiled in. @@ -126,4 +128,4 @@ via: https://www.howtoforge.com/tutorial/how-to-install-nginx-and-google-pagespe 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 -[1]:https://developers.google.com/speed/pagespeed/module/ \ No newline at end of file +[1]:https://developers.google.com/speed/pagespeed/module/ From 4efcae369ed64e3575dcb54e7e51511f284c1ffb Mon Sep 17 00:00:00 2001 From: wxy Date: Thu, 11 Jun 2015 10:06:26 +0800 Subject: [PATCH 328/965] PUB:20150512 45 Zypper Commands to Manage 'Suse' Linux Package Management MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @zhangboyue 翻译的不错! --- ... Manage 'Suse' Linux Package Management.md | 150 +++++++++--------- 1 file changed, 78 insertions(+), 72 deletions(-) rename {translated/tech => published}/20150512 45 Zypper Commands to Manage 'Suse' Linux Package Management.md (89%) diff --git a/translated/tech/20150512 45 Zypper Commands to Manage 'Suse' Linux Package Management.md b/published/20150512 45 Zypper Commands to Manage 'Suse' Linux Package Management.md similarity index 89% rename from translated/tech/20150512 45 Zypper Commands to Manage 'Suse' Linux Package Management.md rename to published/20150512 45 Zypper Commands to Manage 'Suse' Linux Package Management.md index efa807f2f3..0280635408 100644 --- a/translated/tech/20150512 45 Zypper Commands to Manage 'Suse' Linux Package Management.md +++ b/published/20150512 45 Zypper Commands to Manage 'Suse' Linux Package Management.md @@ -1,14 +1,14 @@ -45 个用于 ‘Suse‘ Linux 包管理的 Zypper 命令 +用于 ‘Suse‘ Linux 包管理的 Zypper 命令大全 ====================================================================== -SUSE( Software and System Entwicklung,即软件和系统开发。其中‘entwicklung‘是德语,意为开发)Linux是 Novell 公司在 Linux 内核基础上发布的操作系统。SUSE Linux 有两个发行分支。其中之一名为 OpenSUSE,这是一款自由而且免费的操作系统。该系统由开源社区开发维护,支持一些最新版本的应用软件,其最新的稳定版本为 13.2。 +SUSE( Software and System Entwicklung,即软件和系统开发。其中‘entwicklung‘是德语,意为开发)Linux 是由 Novell 公司在 Linux 内核基础上建立的操作系统。SUSE Linux 有两个发行分支。其中之一名为 openSUSE,这是一款自由而且免费的操作系统 (free as in speech as well as free as in wine)。该系统由开源社区开发维护,支持一些最新版本的应用软件,其最新的稳定版本为 13.2。 -另外一个分支是SUSE Linux 企业版。该分支是一个为企业及商业化产品设计的 Linux 发行版,包含了大量的企业应用以及适用于商业产品生产环境的特性。其最新的稳定版本为 12。 +另外一个分支是 SUSE Linux 企业版。该分支是一个为企业及商业化产品设计的 Linux 发行版,包含了大量的企业应用以及适用于商业产品生产环境的特性。其最新的稳定版本为 12。 以下的链接包含了安装企业版 SUSE Linux 服务器的详细信息。 - [如何安装企业版 SUSE Linux 12][1] -Zypper 和 Yast 是 SUSE Linux 平台上的软件包管理工具,他们的底层使用了 RPM(译者注:RPM 最初指 Redhat Pacakge Manager ,现普遍解释为递归短语 RPM Package Manager 的缩写)。 +Zypper 和 Yast 是 SUSE Linux 平台上的软件包管理工具,他们的底层使用了 RPM(LCTT 译者注:RPM 最初指 Redhat Pacakge Manager ,现普遍解释为递归短语 RPM Package Manager 的缩写)。 Yast(Yet another Setup Tool )是 OpenSUSE 以及企业版 SUSE 上用于系统管理、设置和配置的工具。 @@ -16,21 +16,21 @@ Zypper 是软件包管理器ZYpp的命令行接口,可用于安装、删除SUS 本文将介绍实际应用中常见的一些Zypper命令。这些命令用来进行安装、更新、删除等任何软件包管理器所能够胜任的工作。 -**重要** : 切记所有的这些指令都将在系统全局范围内产生影响,所以必须以 root 身份执行,否则命令将失败。 +**重要** : 切记所有的这些命令都将在系统全局范围内产生影响,所以必须以 root 身份执行,否则命令将失败。 ### 获取基本的 Zypper 帮助信息 ### -1. 不带任何选项的执行 zypper, 将输出该命令的全局选项以及子命令列表(译者注:全局选项,global option,控制台命令的输入分为可选参数和位置参数两大类。按照习惯,一般可选参数称为选项'option',而位置参数称为参数 'argument')。 +1. 不带任何选项的执行 zypper, 将输出该命令的全局选项以及子命令列表(LCTT 译者注:全局选项,global option,控制台命令的输入分为可选参数和位置参数两大类。按照习惯,一般可选参数称为选项'option',而位置参数称为参数 'argument')。 -
%>  zypper
+    
#  zypper
         Usage:
         zypper [--global-options]
2. 获取一个具体的子命令的帮助信息,比如 'in' (install),可以执行下面的命令 -
%> zypper help in
+
# zypper help in
或者 -
%> zypper help install
+    
# zypper help install
     install (in) [options] {capability | rpm_file_uri}
     
     Install packages with specified capabilities or RPM files with specified
@@ -96,7 +96,7 @@ Zypper 是软件包管理器ZYpp的命令行接口,可用于安装、删除SUS
 
 4. 获取一个模式包的信息(以 lamp_server 为例)。
 
-    
%> zypper info -t pattern lamp_server
+    
# zypper info -t pattern lamp_server
     
     Loading repository data...
     Reading installed packages...
@@ -136,9 +136,9 @@ Zypper 是软件包管理器ZYpp的命令行接口,可用于安装、删除SUS
 
 5. 开启一个Zypper Shell 的会话。
 
-    
 %>zypper shell 
+
# zypper shell 
或者 -
 %>zypper sh 
+
# zypper sh 
zypper> help
       Usage:
@@ -151,9 +151,9 @@ Zypper 是软件包管理器ZYpp的命令行接口,可用于安装、删除SUS
 
 6. 使用 'zypper repos' 或者 'zypper lr' 来列举所有已定以的软件库。
 
-    
%> zypper repos
+
# zypper repos
或者 -
%> zypper lr
+    
# zypper lr
       | Alias                     | Name                               | Enabled | Refresh
     --+---------------------------+------------------------------------+---------+--------
     1 | openSUSE-13.2-0           | openSUSE-13.2-0                    | Yes     | No
@@ -183,7 +183,7 @@ Zypper 是软件包管理器ZYpp的命令行接口,可用于安装、删除SUS
 
 8. 根据优先级列举软件库。
 
-    
%> zypper lr -P
+    
# zypper lr -P
       | Alias                     | Name                               | Enabled | Refresh | Priority
     --+---------------------------+------------------------------------+---------+---------+---------
     1 | openSUSE-13.2-0           | openSUSE-13.2-0                    | Yes     | No      |   99
@@ -200,9 +200,9 @@ Zypper 是软件包管理器ZYpp的命令行接口,可用于安装、删除SUS
 
 9. 使用 'zypper refresh' or 'zypper ref' 来刷新 zypper 软件库。
 
-    
%> zypper refresh 
+
# zypper refresh 
或者 -
%> zypper ref
+    
# zypper ref
     Repository 'openSUSE-13.2-0' is up to date.
     Repository 'openSUSE-13.2-Debug' is up to date.
     Repository 'openSUSE-13.2-Non-Oss' is up to date.
@@ -213,13 +213,13 @@ Zypper 是软件包管理器ZYpp的命令行接口,可用于安装、删除SUS
 
 10. 刷新一个指定的软件库(以 'repo-non-oss' 为例 )。
 
-    
%> zypper refresh repo-non-oss
+    
# zypper refresh repo-non-oss
     Repository 'openSUSE-13.2-Non-Oss' is up to date.
     Specified repositories have been refreshed. 
11. 强制更新一个软件库(以 'repo-non-oss' 为例 )。 -
%> zypper ref -f repo-non-oss 
+    
# zypper ref -f repo-non-oss 
     Forcing raw metadata refresh
     Retrieving repository 'openSUSE-13.2-Non-Oss' metadata ............................................................[done]
     Forcing building of repository cache
@@ -230,9 +230,9 @@ Zypper 是软件包管理器ZYpp的命令行接口,可用于安装、删除SUS
 
 本文中我们使用‘zypper modifyrepo‘ 或者 ‘zypper mr‘ 来关闭或者开启 zypper 软件库。
 
-12. 在关闭一个软件库之前,我们需要知道在 zypper中,每一个软件库有一个唯一的标示数字与之关联,该数字用于打开或者关闭与之相联系的软件库。假设我们需要关闭 'repo-oss' 软件库,那么我们可以通过以下的法来获得该软件库的标志数字。
+12. 在关闭一个软件库之前,我们需要知道在 zypper 中,每一个软件库有一个唯一的标示数字与之关联,该数字用于打开或者关闭与之相联系的软件库。假设我们需要关闭 'repo-oss' 软件库,那么我们可以通过以下的法来获得该软件库的标志数字。
 
-    
%> zypper lr
+    
# zypper lr
       | Alias                     | Name                               | Enabled | Refresh
     --+---------------------------+------------------------------------+---------+--------
     1 | openSUSE-13.2-0           | openSUSE-13.2-0                    | Yes     | No
@@ -246,23 +246,23 @@ Zypper 是软件包管理器ZYpp的命令行接口,可用于安装、删除SUS
     9 | repo-update-non-oss       | openSUSE-13.2-Update-Non-Oss       | Yes     | Yes
从以上输出的列表中我们可以看到 'repo-oss' 库的标示数字是 6,因此通过以下的命令来关闭该库。 -
%> zypper mr -d 6
+    
# zypper mr -d 6
     Repository 'repo-oss' has been successfully disabled.
13. 如果需要再次开启软件库 ‘repo-oss‘, 接上例,与之相关联的标示数字为 6。 -
%> zypper mr -e 6
+    
# zypper mr -e 6
     Repository 'repo-oss' has been successfully enabled.
14. 针对某一个软件库(以 'repo-non-oss' 为例 )开启自动刷新( auto-refresh )和 rpm 缓存,并设置该软件库的优先级,比如85。 -
%> zypper mr -rk -p 85 repo-non-oss
+    
# zypper mr -rk -p 85 repo-non-oss
     Repository 'repo-non-oss' priority has been left unchanged (85)
     Nothing to change for repository 'repo-non-oss'.
15. 对所有的软件库关闭 rpm 文件缓存。 -
%> zypper mr -Ka
+    
# zypper mr -Ka
     RPM files caching has been disabled for repository 'openSUSE-13.2-0'.
     RPM files caching has been disabled for repository 'repo-debug'.
     RPM files caching has been disabled for repository 'repo-debug-update'.
@@ -274,7 +274,7 @@ Zypper 是软件包管理器ZYpp的命令行接口,可用于安装、删除SUS
     RPM files caching has been disabled for repository 'repo-update-non-oss'.
16. 对所有的软件库开启 rpm 文件缓存。 -
 zypper mr -ka
+    
# zypper mr -ka
     RPM files caching has been enabled for repository 'openSUSE-13.2-0'.
     RPM files caching has been enabled for repository 'repo-debug'.
     RPM files caching has been enabled for repository 'repo-debug-update'.
@@ -285,8 +285,8 @@ Zypper 是软件包管理器ZYpp的命令行接口,可用于安装、删除SUS
     RPM files caching has been enabled for repository 'repo-update'.
     RPM files caching has been enabled for repository 'repo-update-non-oss'.
-17. 关闭远程库的rpm 文件缓存 -
%> zypper mr -Kt
+17. 关闭远程库的 rpm 文件缓存
+    
# zypper mr -Kt
     RPM files caching has been disabled for repository 'repo-debug'.
     RPM files caching has been disabled for repository 'repo-debug-update'.
     RPM files caching has been disabled for repository 'repo-debug-update-non-oss'.
@@ -297,7 +297,7 @@ Zypper 是软件包管理器ZYpp的命令行接口,可用于安装、删除SUS
     RPM files caching has been disabled for repository 'repo-update-non-oss'.
18. 开启远程软件库的 rpm 文件缓存。 -
%> zypper mr -kt
+    
# zypper mr -kt
     RPM files caching has been enabled for repository 'repo-debug'.
     RPM files caching has been enabled for repository 'repo-debug-update'.
     RPM files caching has been enabled for repository 'repo-debug-update-non-oss'.
@@ -313,7 +313,7 @@ Zypper 是软件包管理器ZYpp的命令行接口,可用于安装、删除SUS
 
 19. 增加一个新的软件库( 以 “http://download.opensuse.org/update/12.3/” 为例 )。
 
-    
%>  zypper ar http://download.opensuse.org/update/11.1/ update
+    
# zypper ar http://download.opensuse.org/update/11.1/ update
     Adding repository 'update' .............................................................................................................................................................[done]
     Repository 'update' successfully added
     Enabled     : Yes
@@ -323,14 +323,14 @@ Zypper 是软件包管理器ZYpp的命令行接口,可用于安装、删除SUS
 
 20. 更改一个软件库的名字,这将仅仅改变软件库的别名。 命令 'zypper namerepo' 或者 'zypperr nr' 可以胜任此工作。例如更改标示数字为10的软件库的名字为 'upd8',或者说将标示数字为10的软件库的别名改为 'upd8',可以使用下面的命令。
 
-    
%> zypper nr 10 upd8
+    
# zypper nr 10 upd8
     Repository 'update' renamed to 'upd8'.
#### 删除软件库 #### 21. 删除一个软件库。要从系统删除一个软件库可以使 'zypper removerepo' 或者 'zypper rr'。例如以下的命令可以删除软件库 'upd8' -
%> zypper rr upd8
+    
# zypper rr upd8
     # Removing repository 'upd8' .........................................................................................[done]
     Repository 'upd8' has been removed.
@@ -339,7 +339,8 @@ Zypper 是软件包管理器ZYpp的命令行接口,可用于安装、删除SUS #### 用 zypper 安装一个软件包 #### 22. 在 zypper 中,我们可以通过软件包的功能名称来安装一个软件包。以 Firefox 为例,以下的命令可以用来安装该软件包。 -
%> zypper in MozillaFirefox
+
+    
# zypper in MozillaFirefox
     Loading repository data...
     Reading installed packages...
     Resolving package dependencies...
@@ -370,8 +371,9 @@ Zypper 是软件包管理器ZYpp的命令行接口,可用于安装、删除SUS
     Retrieving: hicolor-icon-theme-0.13-2.1.2.noarch.rpm ...................................................................................................................................[done]
     Retrieving package sound-theme-freedesktop-0.8-7.1.2.noarch                                                                                            (3/128), 372.6 KiB (460.3 KiB unpacked) 
-23. 安装指定版本号的软件包,(以 gcc 5.1 为例)。 -
 %>zypper in 'gcc<5.1'
+23. 安装指定版本号的软件包,(以 gcc 5.1 为例)。
+
+    
# zypper in 'gcc<5.1'
     Loading repository data...
     Reading installed packages...
     Resolving package dependencies...
@@ -385,7 +387,7 @@ Zypper 是软件包管理器ZYpp的命令行接口,可用于安装、删除SUS
 
 24. 为特定的CPU架构安装软件包(以兼容 i586 的 gcc 为例)。
 
-    
%> zypper in gcc.i586
+    
# zypper in gcc.i586
     Loading repository data...
     Reading installed packages...
     Resolving package dependencies...
@@ -403,7 +405,7 @@ Zypper 是软件包管理器ZYpp的命令行接口,可用于安装、删除SUS
  
 25. 为特定的CPU架构安装指定版本号的软件包(以兼容 i586 且版本低于5.1的 gcc 为例)
 
-    
%> zypper in 'gcc.i586<5.1'
+    
# zypper in 'gcc.i586<5.1'
     Loading repository data...
     Reading installed packages...
     Resolving package dependencies...
@@ -418,8 +420,9 @@ Zypper 是软件包管理器ZYpp的命令行接口,可用于安装、删除SUS
     In cache libatomic1-gcc49-4.9.0+r211729-2.1.7.x86_64.rpm                                           (2/13),  14.3 KiB ( 26.1 KiB unpacked)
     In cache libgomp1-gcc49-4.9.0+r211729-2.1.7.x86_64.rpm                                             (3/13),  41.1 KiB ( 90.7 KiB unpacked) 
-26. 从指定的软件库里面安装一个软件包,例如从 amarok 中安装 libxine。 -
%> zypper in amarok upd:libxine1
+26. 从指定的软件库里面安装一个软件包,例如从 amarok 中安装 libxine。
+
+    
# zypper in amarok upd:libxine1
     Loading repository data...
     Reading installed packages...
     Resolving package dependencies...
@@ -431,7 +434,7 @@ Zypper 是软件包管理器ZYpp的命令行接口,可用于安装、删除SUS
 
 27. 通过指定软件包的名字安装软件包。
 
-    
%> zypper in -n git
+    
# zypper in -n git
     Loading repository data...
     Reading installed packages...
     Resolving package dependencies...
@@ -451,8 +454,9 @@ Zypper 是软件包管理器ZYpp的命令行接口,可用于安装、删除SUS
     Overall download size: 15.6 MiB. Already cached: 0 B  After the operation, additional 56.7 MiB will be used.
     Continue? [y/n/? shows all options] (y): y 
-28. 通过通配符来安装软件包,例如,安装所有 php5 的软件包。 -
%> zypper in php5*
+28. 通过通配符来安装软件包,例如,安装所有 php5 的软件包。
+
+    
# zypper in php5*
     Loading repository data...
     Reading installed packages...
     Resolving package dependencies...
@@ -484,9 +488,9 @@ Zypper 是软件包管理器ZYpp的命令行接口,可用于安装、删除SUS
       do not install php5-pear-Horde_Pdf-2.0.1-6.1.3.noarch
     ....
-29. 使用模式名称(模式名称是一类软件包的名字)来批量安装软件包 +29. 使用模式名称(模式名称是一类软件包的名字)来批量安装软件包。 -
%> zypper in -t pattern lamp_server
+    
# zypper in -t pattern lamp_server
     ading repository data...
     Reading installed packages...
     Resolving package dependencies...
@@ -506,7 +510,7 @@ Zypper 是软件包管理器ZYpp的命令行接口,可用于安装、删除SUS
     Overall download size: 7.2 MiB. Already cached: 1.2 MiB  After the operation, additional 34.7 MiB will be used.
     Continue? [y/n/? shows all options] (y): 
-30. 使用一行命令安转一个软件包同时卸载另一个软件包,例如在安装 nano 的同时卸载 vi +30. 使用一行命令安装一个软件包同时卸载另一个软件包,例如在安装 nano 的同时卸载 vi
# zypper in nano -vi
     Loading repository data...
@@ -530,7 +534,7 @@ Zypper 是软件包管理器ZYpp的命令行接口,可用于安装、删除SUS
 
 31. 使用 zypper 安装 rpm 软件包。
 
-    
%> zypper in teamviewer*.rpm
+    
# zypper in teamviewer*.rpm
     Loading repository data...
     Reading installed packages...
     Resolving package dependencies...
@@ -552,9 +556,9 @@ Zypper 是软件包管理器ZYpp的命令行接口,可用于安装、删除SUS
 
 32. 命令 ‘zypper remove‘ 和 ‘zypper rm‘ 用于卸载软件包。例如卸载 apache2:
 
-    
%> zypper remove apache2 
+
# zypper remove apache2 
或者 -
%> zypper rm apache2
+    
# zypper rm apache2
     Loading repository data...
     Reading installed packages...
     Resolving package dependencies...
@@ -572,9 +576,9 @@ Zypper 是软件包管理器ZYpp的命令行接口,可用于安装、删除SUS
 
 33. 更新所有的软件包,可以使用 ‘zypper update‘ 或者 ‘zypper up‘。
 
-    
%> zypper up 
+
# zypper up 
或者 -
%> zypper update
+    
# zypper update
 
     Loading repository data...
     Reading installed packages...
@@ -591,9 +595,9 @@ Zypper 是软件包管理器ZYpp的命令行接口,可用于安装、删除SUS
 
     Nothing to do.
-35. 安装一个软件库,例如 ariadb,如果该库存在则更新之。 +35. 安装一个软件库,例如 mariadb,如果该库存在则更新之。 -
%> zypper in mariadb
+    
# zypper in mariadb
     Loading repository data...
     Reading installed packages...
     'mariadb' is already installed.
@@ -608,7 +612,7 @@ Zypper 是软件包管理器ZYpp的命令行接口,可用于安装、删除SUS
 
 36. 安装某一个软件包的源文件及其依赖关系,例如 mariadb。
 
-    
%> zypper si mariadb
+    
# zypper si mariadb
     Reading installed packages...
     Loading repository data...
     Resolving package dependencies...
@@ -626,7 +630,7 @@ Zypper 是软件包管理器ZYpp的命令行接口,可用于安装、删除SUS
 
 37. 仅为某一个软件包安装源文件,例如 mariadb
 
-    
%> zypper in -D mariadb
+    
# zypper in -D mariadb
     Loading repository data...
     Reading installed packages...
     'mariadb' is already installed.
@@ -637,7 +641,7 @@ Zypper 是软件包管理器ZYpp的命令行接口,可用于安装、删除SUS
 
 38. 仅为某一个软件包安装依赖关系,例如 mariadb
 
-    
%> zypper si -d mariadb
+    
# zypper si -d mariadb
     Reading installed packages...
     Loading repository data...
     Resolving package dependencies...
@@ -653,11 +657,11 @@ Zypper 是软件包管理器ZYpp的命令行接口,可用于安装、删除SUS
     Overall download size: 33.7 MiB. Already cached: 129.5 KiB  After the operation, additional 144.3 MiB will be used.
     Continue? [y/n/? shows all options] (y): y
-#### Zypper in Scripts and Applications #### +#### 在脚本和应用中调用 Zypper (非交互式) #### 39. 安装一个软件包,并且在安装过程中跳过与用户的交互, 例如 mariadb。 -
%> zypper --non-interactive in mariadb
+    
# zypper --non-interactive in mariadb
     Loading repository data...
     Reading installed packages...
     'mariadb' is already installed.
@@ -668,7 +672,7 @@ Zypper 是软件包管理器ZYpp的命令行接口,可用于安装、删除SUS
 
 40. 卸载一个软件包,并且在卸载过程中跳过与用户的交互,例如 mariadb
 
-    
%> zypper --non-interactive rm mariadb
+    
# zypper --non-interactive rm mariadb
     Loading repository data...
     Reading installed packages...
     Resolving package dependencies...
@@ -681,18 +685,18 @@ Zypper 是软件包管理器ZYpp的命令行接口,可用于安装、删除SUS
     Continue? [y/n/? shows all options] (y): y
     (1/1) Removing mariadb-10.0.13-2.6.1 .............................................................................[done] 
-41. 将 zypper 输出用 XML 格式打印。 +41. 以 XML 格式显示 zypper 的输出。 -
%> zypper --xmlout
+    
# zypper --xmlout
       Usage:
     	zypper [--global-options]  [--command-options] [arguments]
 
       Global Options
     ....
-42. 禁止详细信息输出到屏幕。 +42. 在安装过程中禁止详细信息输出到屏幕。 -
%> zypper --quiet in mariadb
+    
# zypper --quiet in mariadb
     The following NEW package is going to be installed:
       mariadb
 
@@ -703,10 +707,11 @@ Zypper 是软件包管理器ZYpp的命令行接口,可用于安装、删除SUS
 
 43. 在卸载过程中禁止详细信息输出到屏幕
 
-    
%> zypper --quiet rm mariadb 
+
# zypper --quiet rm mariadb 
-44. 自动地同意版权或者协议。 -
%> zypper patch --auto-agree-with-licenses
+44. 自动地同意版权或者协议。
+
+    
# zypper patch --auto-agree-with-licenses
     Loading repository data...
     Reading installed packages...
     Resolving package dependencies...
@@ -717,15 +722,15 @@ Zypper 是软件包管理器ZYpp的命令行接口,可用于安装、删除SUS
 
 45. 以下指令可以用来清理Zypper缓存。
 
-    
%> zypper clean
+    
# zypper clean
     All repositories have been cleaned up.
-如果需要一次性地清理元数据以及软件包缓存,可以通过 -all/-a 选项来达到目的 +如果需要一次性地清理元数据以及软件包缓存,可以通过 -all 或 -a 选项来达到目的 -
%> zypper clean -a
+    
# zypper clean -a
     All repositories have been cleaned up.
-46. 查看 Zypper 的历史信息。籍由 Zypper 所有的软件包管理动作,包括安装、更新以及卸载都会在 /var/log/zypp/history中保留历史信息。可以通过 cat 来查看此文件,或者通过过滤器来筛选希望看到的信息。 +46. 查看 Zypper 的历史信息。任何通过 Zypper 进行的软件包管理动作,包括安装、更新以及卸载都会在 /var/log/zypp/history中保留历史信息。可以通过 cat 来查看此文件,或者通过过滤器来筛选希望看到的信息。
 cat /var/log/zypp/history
     2015-05-07 15:43:03|install|boost-license1_54_0|1.54.0-10.1.3|noarch||openSUSE-13.2-0|0523b909d2aae5239f9841316dafaf3a37b4f096|
@@ -742,7 +747,8 @@ Zypper 是软件包管理器ZYpp的命令行接口,可用于安装、删除SUS
 
 #### 使用 Zypper 进行SUSE系统升级 ####
 
-47. 可以使用 Zypper 命令的 'dist-upgrade' 选项来将当前的SUSE Linux升级至最新版本。
+47. 可以使用 Zypper 命令的 'dist-upgrade' 选项来将当前的 SUSE Linux 升级至最新版本。
+
     
# zypper dist-upgrade
     You are about to do a distribution upgrade with all enabled repositories. Make sure these repositories are compatible before you continue. See 'man zypper' for more information about this command.
     Building repository 'openSUSE-13.2-0' cache .....................................................................[done]
@@ -755,11 +761,11 @@ Zypper 是软件包管理器ZYpp的命令行接口,可用于安装、删除SUS
 
 --------------------------------------------------------------------------------
 
-原文地址: http://www.tecmint.com/zypper-commands-to-manage-suse-linux-package-management/
+via: http://www.tecmint.com/zypper-commands-to-manage-suse-linux-package-management/
 
 作者:[Avishek Kumar][a]
 译者:[张博约](https://github.com/zhangboyue)
-校对:[校对者ID](https://github.com/校对者ID)
+校对:[wxy](https://github.com/wxy)
 
 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出
 

From c7510e2e6a2fb55db65dcfdfa5dbb0df98cbd730 Mon Sep 17 00:00:00 2001
From: wxy 
Date: Thu, 11 Jun 2015 10:35:29 +0800
Subject: [PATCH 329/965] PUB:20150518 70 Expected Shell Scripting Interview
 Questions and Answers

@ictlyh
---
 ...ripting Interview Questions and Answers.md | 301 +++++++++---------
 1 file changed, 159 insertions(+), 142 deletions(-)
 rename {translated/tech => published}/20150518 70 Expected Shell Scripting Interview Questions and Answers.md (50%)

diff --git a/translated/tech/20150518 70 Expected Shell Scripting Interview Questions and Answers.md b/published/20150518 70 Expected Shell Scripting Interview Questions and Answers.md
similarity index 50%
rename from translated/tech/20150518 70 Expected Shell Scripting Interview Questions and Answers.md
rename to published/20150518 70 Expected Shell Scripting Interview Questions and Answers.md
index b5ccd63e0a..9b0201d51e 100644
--- a/translated/tech/20150518 70 Expected Shell Scripting Interview Questions and Answers.md	
+++ b/published/20150518 70 Expected Shell Scripting Interview Questions and Answers.md	
@@ -1,14 +1,14 @@
-70 个可能的 Shell 脚本面试问题及解答
+Shell 脚本面试问题大全
 ================================================================================
-我们为你的面试准备选择了 70 个可能的 shell 脚面问题及解答。了解脚本或至少知道基础知识对系统管理员来说至关重要,它也有助于你在工作环境中自动完成很多任务。在过去的几年里,我们注意到所有的 linux 工作职位都要求脚本技能。
+我们为你的面试准备选择了 70 个你可能遇到的 shell 脚面问题及解答。了解脚本或至少知道基础知识对系统管理员来说至关重要,它也有助于你在工作环境中自动完成很多任务。在过去的几年里,我们注意到所有的 linux 工作职位都要求脚本技能。
 
 ### 1) 如何向脚本传递参数 ? ###
 
-./script argument
+	./script argument
 
 **例子** : 显示文件名称脚本
 
-./show.sh file1.txt
+	./show.sh file1.txt
 
     cat show.sh
     #!/bin/bash
@@ -16,12 +16,11 @@
 
 ### 2) 如何在脚本中使用参数 ? ###
 
-第一个参数: $1,
-第二个参数 : $2
+第一个参数 : $1,第二个参数 : $2
 
 例子 : 脚本会复制文件(arg1) 到目标地址(arg2)
 
-./copy.sh file1.txt /tmp/
+	./copy.sh file1.txt /tmp/
 
     cat copy.sh
     #!/bin/bash
@@ -29,127 +28,129 @@
 
 ### 3) 如何计算传递进来的参数 ? ###
 
-$#
+	$#
 
 ### 4) 如何在脚本中获取脚本名称 ? ###
 
-$0
+	$0
 
 ### 5) 如何检查之前的命令是否运行成功 ? ###
 
-$?
+	$?
 
 ### 6) 如何获取文件的最后一行 ? ###
 
-tail -1
+	tail -1
 
 ### 7) 如何获取文件的第一行 ? ###
 
-head -1
+	head -1
 
 ### 8) 如何获取一个文件每一行的第三个元素 ? ###
 
-awk '{print $3}'
+	awk '{print $3}'
 
-### 9) 假如第一个等于 FIND,如何获取文件中每行的第二个元素 ###
+### 9) 假如文件中每行第一个元素是 FIND,如何获取第二个元素 ###
 
-awk '{ if ($1 == "FIND") print $2}'
+	awk '{ if ($1 == "FIND") print $2}'
 
 ### 10) 如何调试 bash 脚本 ###
 
-Add -xv to #!/bin/bash
 
-例子
+将 -xv 参数加到 #!/bin/bash 后
 
-#!/bin/bash –xv
+例子:
+
+	#!/bin/bash –xv
 
 ### 11) 举例如何写一个函数 ? ###
 
-function example {
-echo "Hello world!"
-}
+	function example {
+	echo "Hello world!"
+	}
 
-### 12) 如何向 string 添加 string ? ###
+### 12) 如何向连接两个字符串 ? ###
 
-V1="Hello"
-V2="World"
-V3=$V1+$V2
-echo $V3
+	V1="Hello"
+	V2="World"
+	V3=$V1+$V2
+	echo $V3
 
-Output
+输出
 
-Hello+World
+	Hello+World
 
 ### 13) 如何进行两个整数相加 ? ###
 
-V1=1
-V2=2
-V3=$V1+$V2
-echo $V3
+	V1=1
+	V2=2
+	V3=$V1+$V2
+	echo $V3
 
-Output
-3
+输出
+
+	3
 
 ### 14) 如何检查文件系统中是否存在某个文件 ? ###
 
-if [ -f /var/log/messages ]
-then
-echo "File exists"
-fi
+	if [ -f /var/log/messages ]
+	then
+	echo "File exists"
+	fi
 
 ### 15) 写出 shell 脚本中所有循环语法 ? ###
 
-#### for loop : ####
+#### for 循环 : ####
 
-for i in $( ls ); do
-echo item: $i
-done
+	for i in $( ls ); do
+	echo item: $i
+	done
 
-#### while loop : ####
+#### while 循环 : ####
 
-#!/bin/bash
-COUNTER=0
-while [ $COUNTER -lt 10 ]; do
-echo The counter is $COUNTER
-let COUNTER=COUNTER+1
-done
+	#!/bin/bash
+	COUNTER=0
+	while [ $COUNTER -lt 10 ]; do
+	echo The counter is $COUNTER
+	let COUNTER=COUNTER+1
+	done
 
-#### untill oop : ####
+#### until 循环 : ####
 
-#!/bin/bash
-COUNTER=20
-until [ $COUNTER -lt 10 ]; do
-echo COUNTER $COUNTER
-let COUNTER-=1
-done
+	#!/bin/bash
+	COUNTER=20
+	until [ $COUNTER -lt 10 ]; do
+	echo COUNTER $COUNTER
+	let COUNTER-=1
+	done
 
 ### 16) 每个脚本开始的 #!/bin/sh 或 #!/bin/bash 表示什么意思 ? ###
 
-这一行说明要使用的 shell。#!/bin/bash 表示脚本使用 /bin/bash。对于 python 脚本,就是 #!/usr/bin/python
+这一行说明要使用的 shell。#!/bin/bash 表示脚本使用 /bin/bash。对于 python 脚本,就是 #!/usr/bin/python。(LCTT译注:这一行称之为[释伴行](https://linux.cn/article-3664-1.html)。)
 
 ### 17) 如何获取文本文件的第 10 行 ? ###
 
-head -10 file|tail -1
+	head -10 file|tail -1
 
 ### 18) bash 脚本文件的第一个符号是什么 ###
 
-#
+	#
 
 ### 19) 命令:[ -z "" ] && echo 0 || echo 1 的输出是什么 ###
 
-0
+	0
 
 ### 20) 命令 “export” 有什么用 ? ###
 
-使变量在子 shell 中公有
+使变量在子 shell 中可用。
 
 ### 21) 如何在后台运行脚本 ? ###
 
-在脚本后面添加 “&”
+在脚本后面添加 “&”。
 
 ### 22) "chmod 500 script" 做什么 ? ###
 
-使脚本所有者拥有可执行权限
+使脚本所有者拥有可执行权限。
 
 ### 23) ">" 做什么 ? ###
 
@@ -157,8 +158,8 @@ head -10 file|tail -1
 
 ### 24) & 和 && 有什么区别 ###
 
-& - 希望脚本在后台运行的时候使用它
-&& - 当第一个脚本成功完成才执行命令/脚本的时候使用它
+- & - 希望脚本在后台运行的时候使用它
+- && - 当前一个脚本成功完成才执行后面的命令/脚本的时候使用它
 
 ### 25) 什么时候要在 [ condition ] 之前使用 “if” ? ###
 
@@ -166,81 +167,87 @@ head -10 file|tail -1
 
 ### 26) 命令: name=John && echo 'My name is $name' 的输出是什么 ###
 
-My name is $name
+	My name is $name
 
 ### 27) bash shell 脚本中哪个符号用于注释 ? ###
 
-#
+	#
 
 ### 28) 命令: echo ${new:-variable} 的输出是什么 ###
 
-variable
+	variable
 
 ### 29)  ' 和 " 引号有什么区别 ? ###
 
-' - 当我们不希望把变量转换为值的时候使用它。
-" - 会计算所有变量的值并用值代替。
+- ' - 当我们不希望把变量转换为值的时候使用它。
+- " - 会计算所有变量的值并用值代替。
 
-### 30) 如何在脚本文件中重定向标准输入输出流到 log.txt 文件 ? ###
+### 30) 如何在脚本文件中重定向标准输出和标准错误流到 log.txt 文件 ? ###
 
-在脚本文件中添加 "exec >log.txt 2>&1" 命令
+在脚本文件中添加 "exec >log.txt 2>&1" 命令。
 
-### 31) 如何只用 echo 命令获取 string 变量的一部分 ? ###
+### 31) 如何只用 echo 命令获取字符串变量的一部分 ? ###
+
+	echo ${variable:x:y}
+	x - 起始位置
+	y - 长度
 
-echo ${variable:x:y}
-x - 起始位置
-y - 长度
 例子:
-variable="My name is Petras, and I am developer."
-echo ${variable:11:6} # 会显示 Petras
 
-### 32) 如果给定字符串 variable="User:123:321:/home/dir" 如何只用 echo 命令获取 home_dir ? ###
+	variable="My name is Petras, and I am developer."
+	echo ${variable:11:6} # 会显示 Petras
+
+### 32) 如果给定字符串 variable="User:123:321:/home/dir",如何只用 echo 命令获取 home_dir ? ###
+
+	echo ${variable#*:*:*:}
 
-echo ${variable#*:*:*:}
 或
-echo ${variable##*:}
+
+	echo ${variable##*:}
 
 ### 33) 如何从上面的字符串中获取 “User”  ? ###
 
-echo ${variable%:*:*:*}
+	echo ${variable%:*:*:*}
+
 或
-echo ${variable%%:*}
+
+	echo ${variable%%:*}
 
 ### 34) 如何使用 awk 列出 UID 小于 100 的用户 ? ###
 
-awk -F: '$3<100' /etc/passwd
+	awk -F: '$3<100' /etc/passwd
 
 ### 35) 写程序为用户计算主组数目并显示次数和组名 ###
 
-cat /etc/passwd|cut -d: -f4|sort|uniq -c|while read c g
-do
-{ echo $c; grep :$g: /etc/group|cut -d: -f1;}|xargs -n 2
-done
+	cat /etc/passwd|cut -d: -f4|sort|uniq -c|while read c g
+	do
+	{ echo $c; grep :$g: /etc/group|cut -d: -f1;}|xargs -n 2
+	done
 
-### 36) 如何在 bash shell 中更改标注域分隔符为 ":" ? ###
+### 36) 如何在 bash shell 中更改标准的域分隔符为 ":" ? ###
 
-IFS=":"
+	IFS=":"
 
 ### 37) 如何获取变量长度 ? ###
 
-${#variable}
+	${#variable}
 
 ### 38) 如何打印变量的最后 5 个字符 ? ###
 
-echo ${variable: -5}
+	echo ${variable: -5}
 
 ### 39) ${variable:-10} 和 ${variable: -10} 有什么区别? ###
 
-${variable:-10} - 如果之前没有给 variable 赋值则输出 10
-${variable: -10} - 输出 variable 的最后 10 个字符
+- ${variable:-10} - 如果之前没有给 variable 赋值则输出 10
+- ${variable: -10} - 输出 variable 的最后 10 个字符
 
 ### 40) 如何只用 echo 命令替换字符串的一部分 ? ###
 
-echo ${variable//pattern/replacement}
+	echo ${variable//pattern/replacement}
 
 ### 41) 哪个命令将命令替换为大写 ? ###
 
-tr '[:lower:]' '[:upper:]'
+	tr '[:lower:]' '[:upper:]'
 
 ### 42) 如何计算本地用户数目 ? ###
 
@@ -250,141 +257,151 @@ cat /etc/passwd|wc -l
 
 ### 43) 不用 wc 命令如何计算字符串中的单词数目 ? ###
 
-set ${string}
-echo $#
+	set ${string}
+	echo $#
 
 ### 44)  "export $variable" 或 "export variable" 哪个正确 ? ###
 
-export variable
+	export variable
 
 ### 45) 如何列出第二个字母是 a 或 b 的文件 ? ###
 
-ls -d ?[ab]*
+	ls -d ?[ab]*
 
 ### 46) 如何将整数 a 加到 b 并赋值给 c ? ###
 
-c=$((a+b))
+	c=$((a+b))
+
 或
-c=`expr $a + $b`
+
+	c=`expr $a + $b`
+
 或
-c=`echo "$a+$b"|bc`
+
+	c=`echo "$a+$b"|bc`
 
 ### 47) 如何去除字符串中的所有空格 ? ###
 
-echo $string|tr -d " "
+	echo $string|tr -d " "
 
-### 48) 重写命令输出变量转换为复数的句子: item="car"; echo "I like $item" ? ###
+### 48) 重写这个命令,将输出变量转换为复数: item="car"; echo "I like $item" ? ###
 
-item="car"; echo "I like ${item}s"
+	item="car"; echo "I like ${item}s"
 
 ### 49) 写出输出数字 0 到 100 中 3 的倍数(0 3 6 9 …)的命令 ? ###
 
-for i in {0..100..3}; do echo $i; done
+	for i in {0..100..3}; do echo $i; done
+	
 或
-for (( i=0; i<=100; i=i+3 )); do echo "Welcome $i times"; done
+
+	for (( i=0; i<=100; i=i+3 )); do echo "Welcome $i times"; done
 
 ### 50) 如何打印传递给脚本的所有参数 ? ###
 
-echo $*
+	echo $*
+
 或
-echo $@
+
+	echo $@
 
 ### 51)  [ $a == $b ] 和 [ $a -eq $b ] 有什么区别 ###
 
-[ $a == $b ] - 用于字符串比较
-[ $a -eq $b ] - 用于数字比较
+- [ $a == $b ] - 用于字符串比较
+- [ $a -eq $b ] - 用于数字比较
 
 ### 52) = 和 == 有什么区别 ###
 
-= - 用于为变量复制
-== - 用于字符串比较
+- = - 用于为变量复制
+- == - 用于字符串比较
 
 ### 53) 写出测试 $a 是否大于 12 的命令 ? ###
 
-[ $a -gt 12 ]
+	[ $a -gt 12 ]
 
 ### 54) 写出测试 $b 是否小于等于 12 的命令 ? ###
 
-[ $b -le 12 ]
+	[ $b -le 12 ]
 
 ### 55) 如何检查字符串是否以字母 "abc" 开头 ? ###
 
-[[ $string == abc* ]]
+	[[ $string == abc* ]]
 
 ### 56) [[ $string == abc* ]] 和 [[ $string == "abc*" ]] 有什么区别 ###
 
-[[ $string == abc* ]] - 检查字符串是否以字母 abc 开头
-[[ $string == "abc* " ]] - 检查字符串是否完全等于 abc*
+- [[ $string == abc* ]] - 检查字符串是否以字母 abc 开头
+- [[ $string == "abc*" ]] - 检查字符串是否完全等于 abc*
 
 ### 57) 如何列出以 ab 或 xy 开头的用户名 ? ###
 
-egrep "^ab|^xy" /etc/passwd|cut -d: -f1
+	egrep "^ab|^xy" /etc/passwd|cut -d: -f1
 
 ### 58) bash 中 $! 表示什么意思 ? ###
 
-后台最近命令的 PID
+后台最近执行命令的 PID.
 
 ### 59) $? 表示什么意思 ? ###
 
-前台最近命令的结束状态
+前台最近命令的结束状态。
 
 ### 60) 如何输出当前 shell 的 PID ? ###
 
-echo $$
+	echo $$
 
 ### 61) 如何获取传递给脚本的参数数目 ? ###
 
-echo $#
+	echo $#
+	
+(LCTT 译注:和第3题重复了。)
 
 ### 62) $* 和 $@ 有什么区别 ###
 
-$* - 以一个字符串形式输出所有传递到脚本的参数
-$@ - 以 $IFS 为分隔符列出所有传递到脚本中的参数
+- $* - 以一个字符串形式输出所有传递到脚本的参数
+- $@ - 以 $IFS 为分隔符列出所有传递到脚本中的参数
 
 ### 63) 如何在 bash 中定义数组 ? ###
 
-array=("Hi" "my" "name" "is")
+	array=("Hi" "my" "name" "is")
 
 ### 64) 如何打印数组的第一个元素 ? ###
 
-echo ${array[0]}
+	echo ${array[0]}
 
 ### 65) 如何打印数组的所有元素 ? ###
 
-echo ${array[@]}
+	echo ${array[@]}
 
 ### 66) 如何输出所有数组索引 ? ###
 
-echo ${!array[@]}
+	echo ${!array[@]}
 
 ### 67) 如何移除数组中索引为 2 的元素 ? ###
 
-unset array[2]
+	unset array[2]
 
 ### 68) 如何在数组中添加 id 为 333 的元素 ? ###
 
-array[333]="New_element"
+	array[333]="New_element"
 
 ### 69) shell 脚本如何获取输入的值 ? ###
 
 a) 通过参数
 
-./script param1 param2
+	./script param1 param2
 
 b) 通过 read 命令
 
-read -p "Destination backup Server : " desthost
+	read -p "Destination backup Server : " desthost
 
 ### 70) 在脚本中如何使用 "expect" ? ###
 
-/usr/bin/expect << EOD
-spawn rsync -ar ${line} ${desthost}:${destpath}
-expect "*?assword:*"
-send "${password}\r"
-expect eof
-EOD
+	/usr/bin/expect << EOD
+	spawn rsync -ar ${line} ${desthost}:${destpath}
+	expect "*?assword:*"
+	send "${password}\r"
+	expect eof
+	EOD
 
-好运 !! 如果你有任何疑问或者问题需要解答都可以在下面的评论框中写下来。让我们知道这对你的面试有所帮助:-)
+祝你好运 !! 如果你有任何疑问或者问题需要解答都可以在下面的评论框中写下来。让我们知道这对你的面试有所帮助:-)
 
 --------------------------------------------------------------------------------
 
@@ -392,7 +409,7 @@ via: http://linoxide.com/linux-shell-script/shell-scripting-interview-questions-
 
 作者:[Petras Liumparas][a]
 译者:[ictlyh](https://github.com/ictlyh)
-校对:[校对者ID](https://github.com/校对者ID)
+校对:[wxy](https://github.com/wxy)
 
 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出
 

From 11d5fad50e5e7e4336a4392deb010cb1117da8fd Mon Sep 17 00:00:00 2001
From: wi-cuckoo 
Date: Thu, 11 Jun 2015 11:19:58 +0800
Subject: [PATCH 330/965] translated wi-cuckoo

---
 ...lobally Recognized Linux Certifications.md | 173 ------------------
 ...lobally Recognized Linux Certifications.md | 172 +++++++++++++++++
 2 files changed, 172 insertions(+), 173 deletions(-)
 delete mode 100644 sources/share/20150604 12 Globally Recognized Linux Certifications.md
 create mode 100644 translated/share/20150604 12 Globally Recognized Linux Certifications.md

diff --git a/sources/share/20150604 12 Globally Recognized Linux Certifications.md b/sources/share/20150604 12 Globally Recognized Linux Certifications.md
deleted file mode 100644
index 4ec185770b..0000000000
--- a/sources/share/20150604 12 Globally Recognized Linux Certifications.md	
+++ /dev/null
@@ -1,173 +0,0 @@
-translating wi-cuckoo
-12 Globally Recognized Linux Certifications
-================================================================================
-Hi everyone, today we'll learn about some of the very precious globally recognized Linux Certifications. Linux Certifications are the certification programme hosted by different Linux Professional Institutes across the globe. Linux Certifications allows Linux Professionals to get easily enrolled with the Linux related jobs in servers, companies, etc. Linux Certifications enables how much a person is expertise in that respective field of Linux. There are pretty many Linux Professional Institutes providing different Linux Certifications. But there are some few well recognized Linux Certification Programmes running across the globe which are at high priority while getting a job in companies where we need to manage servers, virtualizations, installations, configurations, application support and other stuffs with Linux Operating System. With the increment of servers running Linux Operating System throughout the globe, the demand of Linux Professional are increasing. For better authenticated and authorized Linux Professional, better and renowned Certifications are always at higher priority by the companies across the globe.
-
-Here are some globally recognized Linux Certifications that we'll discuss about.
-
-### 1. CompTIA Linux+ ###
-
-CompTIA Linux+ is a Linux Certification programme hosted by LPI "Linux Professional Institute" providing knowledge all over the world. It provides knowledge on Linux which enables to produce a bunch of Linux related Professional jobs like Linux Administrators, Junior Network Administrators, Systems Administrators, Linux Database Administrators and Web Administrators. If anyone is aware of installing and maintaining Linux Operating System, this course will help to meet the certification requirements and prepare for the exam by providing with a broad awareness of Linux operating systems. The main objective of CompTIA Linux+ Certification by LPI is to provide the certificate holders enough knowledge on a critical knowledge of installation, operation, administration and troubleshooting devices. We can earn three industry-recognized certifications for the cost, time, and effort of one, by completing the CompTIA Linux+ powered by LPI certification, we can automatically receive the **LPI LPIC-1** and the **SUSE Certified Linux Administrator (CLA)** certifications.
-
-- **Certification Codes** : LX0-103 and LX0-104 (launches March 30, 2015) OR  LX0-101 and LX0-102
-- Number of questions: 60 questions per exam
-- Type of Questions: Multiple choice
-- Length of test period: 90 minutes
-- Prerequisites: A+, Network+ and at least 12 months of Linux administration experience
-- Passing score: 500 (on a scale of 200-800)
-- Languages: English. Coming soon on German, Portuguese (Brazilian), Traditional Chinese, Spanish.
-- Validity: Valid till 3 Years after certified.
-
-**Note**: Exams from different series cannot be combined. If you start with LX0-101, you MUST take LX0-102 to complete your certification. The same applies for the LX0-103 and LX0-104 series. The LX0-103 and LX0-104 series is an update to the LX0-101 and LX0-102 series.
-
-### 2. LPIC ###
-
-LPIC stands for Linux Professional Institute Certification which is a Linux certification programme by Linux Professional Institute. It is a multi level certification program which requires passing of a number (usually two) certification exams for each level. There are three levels of certification which includes Junior Level Certification **LPIC-1**, Advanced Level Certification **LPIC-2** and Senior Level Certification **LPIC-3**. The first two certification aims on **Linux System Administration** whereas the final certification aims on several specialties including Virtualization and Security. To become **LPIC-3** certified, a candidate with an active **LPIC-1** and **LPIC-2** certification must pass at least one of 300 Mixed Environment, 303 Security and 304 Virtualization and High Availability.  LPIC-1 certification is designed in such a way that the certification holder will be able to install, maintain, configure tasks running Linux with command line interface with basic networking where as LPIC-2 certification validates candidate to administer small to medium–sized mixed networks. LPIC-3 certification is designed for enterprise-level Linux professional and represents the highest level of professional, distribution-neutral Linux certification within the industry.
-
-- **Certification Codes** : LPIC-1 (101 and 102), LPIC-2 (201 and 202) and LPIC-3 (300, 303 or 304)
-- Type of Questions: 60 Multiple choice questions
-- Length of Test Period: 90 minutes
-- Prerequisites: None, Linux Essentials is recommended
-- Passing Score: 500 (on a scale of 200-800)
-- Languages: LPIC-1: English, German, Italian, Portuguese (Brazilian), Spanish (Modern), Chinese (Simplified), Chinese (Traditional), Japanese
-- LPIC-2: English, German, Portuguese (Brazilian), Japanese
-- LPIC-3: English, Japanese
-- Validity: Valid till 5 years of Retirement.
-
-### 3. Oracle Linux OCA ###
-
-Oracle Certified Associate (OCA) is designed for the individuals who are interested for a strong foundation of knowledge to implement and administer the Oracle Linux Operating System. This certification expertise individuals on the Oracle Linux distribution that's fully optimized for Oracle products and for running on Oracle's engineered systems including Oracle Exadata Database Machine, Oracle Exalytics In-Memory Machine, Oracle Exalogic Elastic Cloud, and Oracle Database Appliance. Oracle Linux's Unbreakable Enterprise Kernel delivers extreme performance, advanced scalability and reliability for enterprise applications. The OCA certification covers objectives such as managing local disk devices, managing file systems, installing and removing Solaris packages and patches, performing system boot procedures and system processes. It is initial step in achievement of flagship of OCP credential. This certification was formerly known as Sun Certified Solaris Associate (SCSAS).
-
-- **Certification Codes** : OCA
-- Type of Questions: 75 Multiple choice questions
-- Length of Test Period: 120 minutes
-- Prerequisites: None
-- Passing Score: 64%
-- Validity: Never Expires
-
-### 4. Oracle Linux OCP ###
-
-Oracle Certified Professional (OCP) is the certification provided by Oracle Corporation for Oracle Linux which covers more advanced knowledge and skills of an Oracle Linux Administrator. It covers knowledge such as configuring network interfaces, managing swap configurations, crash dumps, managing applications, databases and core files. OCP certification is benchmark of technical expertise and professional skill needed for developing, implementing, and managing applications, middleware and databases widely in enterprise. Job opportunities for Oracle Linux OCP are increased depending on job market and economy. It is designed such a way that the certificate holder has the ability to perform security administration, prepare Oracle Linux system for Oracle database, troubleshoot problems and perform corrective action, install software packages, installing and configuring kernel modules, maintain swap space, perform User and Group administration, creating file systems, configuring logical volume manager (LVM), file sharing services and more.
-
-- **Certification Codes** : OCP
-- Type of Questions: 60 to 80 Multiple choice questions
-- Length of Test Period: 120 minutes
-- Prerequisites: Oracle Linux OCA
-- Passing Score: 64%
-- Validity: Never Expires
-
-### 5. RHCSA ###
-
-RHCSA is a certification programme by Red Hat Incorporation as Red Hat Certified System Administrator. RHCSAs are the person who has the skill, and ability to perform core system administrations in the renowned Red Hat Linux environments. It is an initial entry-level certification programme that focuses on actual competencies at system administration, including installation and configuration of a Red Hat Linux system and attaching it to a live network running network services. A Red Hat Certified System Administrator (RHCSA) is able to understand and use essential tools for handling files, directories, command-line environments, and documentation, operate running systems, including booting into different run levels, identifying processes, starting and stopping virtual machines, and controlling services, configure local storage using partitions and logical volumes, create and configure file systems and file system attributes, such as permissions, encryption, access control lists, and network file systemsm, deploy, configure, and maintain systems, including software installation, update, and core services, manage users and groups, including use of a centralized directory for authentication, security, including basic firewall and SELinux configuration. One should be RHCSA certified to gain RHCE and other certifications.
-
-- **Certification Codes** : RHCSA
-- Course Codes: RH124, RH134 and RH199
-- Exam Codes: EX200
-- Length of Test Period: 21-22 hours depending on the elective course choosen.
-- Prerequisites: None. Better if has some fundamental knowledge of Linux.
-- Passing Score: 210 out of 300 points (70%)
-- Validity: 3 years
-
-### 6. RHCE ###
-
-RHCE, also known as Red Hat Certified Engineer is a mid to advanced level certification programme for Red Hat Certified System Administrator (RHCSA) who wants to acquire additional skills and knowledge required of a senior system administrator responsible for Red Hat Enterprise Linux. RHCE has the ability, knowledge and skills of configuring static routes, packet filtering, and network address translation, setting kernel runtime parameters, configuring an Internet Small Computer System Interface (iSCSI) initiator, producing and delivering reports on system utilization, using shell scripting to automate system maintenance tasks, configuring system logging, including remote logging, system to provide networking services including HTTP/HTTPS, File Transfer Protocol (FTP), network file system (NFS), server message block (SMB), Simple Mail Transfer Protocol (SMTP), secure shell (SSH) and Network Time Protocol (NTP) and more. RHCSAs who wish to earn a more senior-level credential and who have completed System Administration I, II, and II, or who have completed the RHCE Rapid Track Course is recommended to go for RHCE certification.
-
-- **Certification Codes** : RHCE
-- Course Codes: RH124, RH134, RH254 and RH199
-- Exam Codes: EX200 and EX300
-- Length of Test Period: 21-22 hours depending on the elective course choosen.
-- Prerequisites: A RHCSA credential
-- Passing Score: 210 out of 300 (70%)
-- Validity: 3 years
-
-### 7. RHCA ###
-
-RHCA stands for Red Hat Certified Architect which is a certification programme by Red Hat Incorporation. It focuses on actual competencies at system administration, including installation and configuration of a Red Hat Linux system and attaching it to a live network running network services. RHCA is the highest level of certification of all the Red Hat Certifications. Candidates are required to choose the concentration they wish to focus on or can choose any combination of eligible Red Hat certifications to create a custom concentration of their own. There are three main concentration Datacenter, Cloud and Application Platform. RHCA with the concentration of Datacenter has the skills and ability to work, manage a datacenter whereas with the concentration of Cloud has the ability create, configure and manage private, hybrid clouds, cloud application platforms, flexible storage solutions using Red Hat Enterprise Linux Platform. RHCA with the concentration of Application Platform includes skills like installing, configuring and managing Red Hat JBoss Enterprise Application Platform and applications, cloud application platforms and hybrid cloud environments with OpenShift Enterprise by Red Hat and federating data from multiple sources using Red Hat JBoss Data Virtualization.
-
-- **Certification Codes** : RHCA
-- Course Codes: CL210,CL220,CL280, RH236, RH318,RH401,RH413, RH436,RH442,JB248 and JB450
-- Exam Codes: EX333, EX401, EX423 or EX318, EX436 and EX442
-- Length of Test Period: 21-22 hours depending on the elective course choosen.
-- Prerequisites: Active RHCE credential
-- Passing Score: 210 out of 300 (70%)
-- Validity: 3 years
-
-### 8. SUSE CLA ###
-
-SUSE Certified Linux Administrator (SUSE CLA) is a initialcertification by SUSE which focuses on daily administration tasks in SUSE Linux Enterprise Server environments. To gain SUSE CLA certification, it is not necessary to perform the course work, one has to pass the examination to get certified. SUSE CLA are capable and has skills to use Linux Desktop, locate and use help resources, manage Linux File System, work with the Linux Shell and Command Line, install SLE 11 SP22, manage system installation, hardware, backup and recovery, administer Linux with YaST, linux processes and services, storage, configure network, remote access, monitor SLE 11 SP2, automate tasks and manage user access and security. We can gain dual certificates of SUSE CLA and LPIC-1 and CompTIA Linux powered by LPI as SUSE, Linux Professional Institute and CompTIA have teamed up to offer you the chance to earn three Linux certifications.
-
-- **Certification Codes** : SUSE CLA
-- Course Codes: 3115, 3116
-- Exam Codes:  050-720, 050-710
-- Type of Questions: multiple choice exams
-- Length of Test Period: 90 minutes
-- Prerequisites: None
-- Passing Score: 512
-
-### 9. SUSE CLP ###
-
-SUSE Certified Linux Professional (CLP) is a certification programme for the one who is interested to gain more seniority and professionalism in SUSE Linux Enterprise Servers. SUSE CLP is the next step after receiving the SUSE CLA certificate. One should pass the examination and should have certification of CLA to gain the certification of CLP thought the candidate has passed the examination of CLP. SUSE CLP certified person has the skills and ability of installing and configuring SUSE Linux Enterprise Server 11 systems, maintaining the file system, managing softwarepackages, processes, printing, configuring fundamental network services, samba, web servers, using IPv6 and creating and running bash shell scripts.
-
-- **Certification Codes** : SUSE CLP
-- Course Codes: 3115, 3116 and 3117
-- Exam Codes: 050-721, 050-697
-- Type of Test: hands on
-- Length of Test Period: 180 minute practicum
-- Prerequisites: SUSE CLA Certified
-
-### 10. SUSE CLE ###
-
-SUSE Certified Linux Engineer (CLE) is an engineer level advanced certification for those candidates who have passed the examination of CLE. To acquire a CLE certificate, one should gain the certificates of SUSE CLA and SUSE CLP. The candidate gaining the CLE certification has the skills of architecting complex SUSE Linux Enterprise Server environments. CLE certified person has the skill to configure fundamental networking services, manage printing, configure and use Open LDAP, samba, web servers, IPv6, perform Health Check and Performance Tuning, create and execute Shell Scripts, deploy SUSE Linux Enterprise, virtualization with Xen and more.
-
-- **Certification Codes** : SUSE CLE
-- Course Codes: 3107
-- Exam Codes: 050-723
-- Type of Test: hands on
-- Length of Test Period: 120 minute practicum
-- Prerequisites: SUSE CLP 10 or 11 Certified
-
-### 11. LFCS ###
-
-Linux Foundation Certified System Admin (LFCS) certified candidates possesses knowledge on the use of Linux and using Linux with the terminal environment. LFCS is a certification programme by Linux Foundation for system administrators and engineers working with the Linux operating system. The Linux Foundation collaborated with industry experts and the Linux kernel community to identify the core domains and the critical skills, knowledge and abilities applicable for the certification. LFCS certified candidates has the skills, knowledge and ability of editing and manipulating text files on the command line, managing and troubleshooting File Systems and Storage, assembling partitions as LVM devices, configuring SWAP partitions, managing networked filesystems, managing user accounts, permissions and ownerships, maintaining security, creating and executing bash shell scripts, installing, upgrading, removing software packages and more.
-
-- **Certification Codes** : LFCS
-- Course Codes: LFS201, LFS220 (Optional)
-- Exam Codes: LFCS exam
-- Length of Test Period: 2 hours
-- Prerequisites: None.
-- Passing Score: 74%
-- Languages: English
-- Validity: 2 years
-
-### 12. LFCE ###
-
-Linux Foundation Certified Engineer (LFCE), a certification for Linux Engineers by Linux Foundation. LFCE certified candidates possesses a wider range of skills on Linux than LFCS. It is a engineer-level advanced certification programme. The LFCE certified candidates possesses skills and abilities of Network Administraton like configuring network services, configuring packet filtering, monitor network performance, IP traffics, configuring filesystems and file services, network filesystems, install, update packages from the repositories, managing network security, configuring iptables, http services, proxy servers, email servers and many more. It is believed that LFCE is pretty difficult to pass and study than LFCS as its advanced engineering level certification programme.
-
-- **Certification Codes** : LFCE
-- Course Codes: LFS230
-- Exam Codes: LFCE exam
-- Length of Test Period: 2 hours
-- Prerequisites: LFCS certified.
-- Passing Score: 72%
-- Languages: English
-- Validity: 2 years
-
-### Facts we found (This is only our views) ###
-
-Recent surveys conducted on different top recruitment agency,  says 80% of linux job profile preferred Redhat certification. If you are a student / newbie and want to learn linux then we prefer Linux Foundation Certifications as its getting much popular or CompTIA Linux would be also a choice. If you already know oracle or suse or working on their products then would prefer oracle / suse linux or if you working in an company these certification might enhance your career growth :-)
-
-### Conclusion ###
-
-There are thousands of big companies in this world running servers and mainframes running Linux Operating System, to handle, configure and work on those servers there is always a need of highly qualified and certified Linux Technical/Professional. These globally recognized Linux certificates has a big role of someones career in Linux. The companies around the world running Linux and wanting Linux Engineers, System Administrators and ethusiasts chooses one who has gained certificates and has good score in the related field of Linux. Globally recognized certifications are highly essential for excellence in the profession and career in Linux, so preparing best for the examination and getting the certification is a good choice for building career in Linux. If you have any questions, comments, feedback please do write on the comment box below and let us know what stuffs needs to be added or improved. Thank You! :-)
-
---------------------------------------------------------------------------------
-
-via: http://linoxide.com/linux-how-to/12-globally-recognized-linux-certifications/
-
-作者:[Arun Pyasi][a]
-译者:[译者ID](https://github.com/译者ID)
-校对:[校对者ID](https://github.com/校对者ID)
-
-本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出
-
-[a]:http://linoxide.com/author/arunp/
diff --git a/translated/share/20150604 12 Globally Recognized Linux Certifications.md b/translated/share/20150604 12 Globally Recognized Linux Certifications.md
new file mode 100644
index 0000000000..2be4e9df7d
--- /dev/null
+++ b/translated/share/20150604 12 Globally Recognized Linux Certifications.md	
@@ -0,0 +1,172 @@
+12个全球认可的Linux认证
+================================================================================
+大家好,今天我们将会认识一些非常有价值的全球认可的Linux认证。Linux认证是不同Linux专业机构在全球范围内进行的认证程序。Linux认证可以让Linux专业人才很容易获得Linux相关的工作,在服务器或者公司等等这些地方。Linux认证评估一个人在Linux的各个领域里的专业程度。有很多不错的Linux专业机构提供不同的Linux认证。但是全球仅有少数被十分认可的Linux认证,在公司谋取一份工作时含金量很高,这些工作包括管理服务器,虚拟化,安装系统与软件,配置程序,应用支持和其他Linux操作系统相关的东西。随着全球使用Linux操作系统的服务器的增长,拉动了对于Linux专业人才的需求。为了更好的证明Linux专业技术,公司进行的著名的认证一直有着更高的优先级,在全球看来。
+
+这里是一些全球认可的Linux认证,我们接下来将会一一讨论。
+
+### 1. CompTIA Linxu+ ###
+
+CompTIA Linux+ 是LPI“Linux Professional Institute”主办的一个Linux认证,在全世界范围内提供培训。其提供的Linux相关知识,使得产生了一大批Linux相关专业的工作,如Linux管理员,高级网络管理员,系统管理员,Linux数据库管理员和网页管理员。如果任何人想从事安装和维护Linux操作系统,该课程会帮助达到认证要求,并且通过提供对Linux系统更宽阔的认识,能够为考试做好准备。LPI的CompTIA Linux+认证的主要目的就是,提供给证书持有者足够扎实的知识,关于安装软件,操作,管理和设备排障的。我们可以用一定的费用,时间和努力,,完成CompTIA Linux+,赢得三个业内认可的证书,我们可以自动收到**LPI LPIC-1**和**SUSE Certified Linux Administrator (CLA)**证书。
+
+- ** 认证代码** : LX0-103和LX0-104 (2015年三月30日启动)或者LX0-101和LX0-102
+- 题目数量:一次考试60道题
+- 题目类型:多选
+- 考试时长:90分钟
+- 要求:A+,Network+,并且有至少12个月的Linux管理经历
+- 分数线:500 (对于200-800的范围来说)
+- 语言:英语,将来会有德语,葡萄牙语,汉语,西班牙。
+- 有效期:认证后三年有效
+
+**注意**:不同系列的考试不能交叉。如果你考的是LX0-101,那么你必须考LX0-102完成认证。同样的,你必须考完LX0-103和LX0-104。LX0-103和LX0-104是LX0-101和LX0-102的升级版。
+
+### 2. LPIC ###
+
+LPIC,全称Linux专业委员会认证,是Linux专业委员会的一个Linux认证程序。这是一个多层次的认证程序,要求在每个级别通过一系列(通常是两个)的认证考试。该认证有三个层次,包括初级水平认证 **LPIC-1** ,高级水平认证 **LPIC-2**和最高水平认证 **LPIC-3**。前两个认证侧重于 **Linux系统管理**,而最后一个认证侧重一些专业技能,包括虚拟化和安全。为了得到 **LPIC-3** 认证,一个持有 **LPIC-1** 与**LPIC-2** 的考生必须通过300复杂环境测试,303安全测试,304虚拟化测试和高可用性的其中一个。**LPIC-1**认证按照证书持有者可以通过运行Linux,使用命令行界面和基本的网络知识安装,维护,配置任务而设计,LPIC-2验证考生很少的管理知识,主要是中型混合网络方面。LPIC-3认证按照企业级别的Linux专业技能设计,代表了最高的专业水平(==最后这句不知道如何翻译==)
+
+- **认证代码**:LPIC-1(101和102),LPIC-2(201和202)和LPIC-3(300,303或者304)
+- 题目类型:60个多项选择
+- 考试时长:90分钟
+- 要求:Linux基础
+- 分数线:500(在200-800的范围内)
+- 语言:LPIC-1:英语,德语,意大利语,葡萄牙语,西班牙语(现代),汉语(简体),汉语(繁体),日语
+- LPIC-2:英语,德语,葡萄牙语,日语
+- LPIC-3:英语,日语
+- 有效期:退休之后五年内仍然有效
+
+### 3.Oracle Linux OCA ###
+
+Oracle联合认证(OCA)为个人而定制,那些对部署和管理Oracle Linux操作系统且想证明知识牢固感兴趣的人。该认证专业知识仅仅是在Oracle Linux发行版上,这个系统完全是为Oracle产品特别剪裁的,为了运行在Oracle设计的系统上面,包括Oracle Exadata数据库机器,Oracle Exalytics 内存中机器,Oracle Exalogic 均衡云,和Oracle数据库应用。Oracle Linux稳定的企业级内核对于企业应用表现突出,高扩展性和稳定性。OCA认证覆盖如管理本地磁盘设备,文件系统,安装和移除Solaris包与补丁,协调系统启动过程和系统进程方面。这是达到OCP证书佼佼者的第一步。OCA认证以其前身为Sun Certified Solaris Associate(SCSAS)而为人所知。
+
+- **认证代码**:OCA
+- 题目类型:75道多项选择
+- 考试时长:120分钟
+- 要求:无
+- 分数线:64%
+- 有效期:永远有效
+
+### 4. Oracle Linux OCP ###
+
+Oracle Certified Professional(OCP),时Oracle公司为Oracle Linux提供的一个认证,覆盖更多的进阶知识和技能,对于一个Oracle Linux管理员来说。它囊括的知识有配置网络接口,映射交换配置,清理垃圾,管理软件、数据库和核心文件。OCP认证是技术性专业知识和专业技能的基准测试,这些知识与技能需要在公司里广泛用于开发,部署和管理应用,中间设备和数据库。Oracle Linux OCP的工作机会在增长,得益于工作市场和经济。根据考试纲领,证书持有者有能力胜任安全管理,为Oracle 数据库准备Oracle Linux系统,排除故障,安装软件包,安装和配置内核模块,维护交换空间,完成用户和组管理,创建文件系统,配置逻辑卷管理(LVM)、文件分享服务等等。
+
+- **认证代码**:OCP
+- 题目类型:60至80道多项选择题
+- 考试时长:120分钟
+- 要求:Oracle Linux OCA
+- 分数线:64%
+- 有效期:永远有效
+
+### 5. RHCSA ###
+
+RHCSA是红帽公司作为红帽认证系统工程师推出的一个认证程序。RHCSAs指一些拥有技能和能力在著名的红帽Linux环境下完成核心系统管理的人。这是一个入门级的认证程序,关注在系统管理上的实际胜任能力,包括安装、配置一个红帽Linux系统,接入一个可用的网络运行网络服务。一个红帽认证的系统管理员可以理解和使用基本的工具,用以处理文件,目录,命令行环境和文档,操作运行中的系统,包括以不同的启动级别启动,标记进程,开启和停止虚拟机和控制服务,使用分区和逻辑卷配置本地存储,部署配置和维护系统,包括软件安装、更新和核心服务,管理用户和组,包括使用一个中心的目录用于验证,安全性工作,包括基本的基本防火墙和SELinux配置。要获得RHCE和其他认证,首先得认证过RHCSA。
+
+- **认证代码**:RHCSA
+- 课程代码:RH124,RH134和RH199
+- 考试代码:EX200
+- 考试时长:21-22小时,取决于选择的课程
+- 要求:无。有一些Linux基础知识更好
+- 分数线:300总分,210过(70%)
+- 有效期:3年
+
+### 6. RHCE ###
+
+RHCE,也叫做红帽认证工程师,是一个中到高级水平的认证程序,为一些红帽认证系统管理员(RHCSA),想学习一个负责红帽企业Linux的高级系统管理员要求的额外技能和知识而开设的,RHCE有能力,知识和技能配置静态的路由,包过滤,网络地址转换(NAT),设定内核运行参数,配置一个互联网小型计算机系统接口(ISCSI)初始化程序,产生并推送系统使用的报告,使用shell脚本自动完成系统维护任务,配置系统登入,包括远程登录,提供网络服务如HTTP/HTTPS,文件传输协议(FTP),网络文件系统(NFS),服务信息块(SMB),简单邮件传输协议(SMTP),安全shell(SSH)和网络时间协议(NTP)等等。RHCSAs希望获得更多高级水平的认证,并且已经完成系统管理员I,II和III,或者RHCE认证建议的RHCE快速跟进课程。
+
+- **认证代码**:RHCE
+- 课程代码:RH124,RH134,RH254和RH199
+- 考试代码:EX200和EX300
+- 考试时长:21-22个小时,取决于所选课程
+- 要求:一个RHCSA证书
+- 分数线:300总分,210过(70%)
+- 有效期:3年
+
+### 7. RHCA ###
+
+RHCA就是红帽认证架构师,是红帽公司的一个认证程序。它的关注点在系统管理的实际能力,包括安装和配置一个红帽Linux系统,并加入到一个可用网络中运行网络服务。RHCA是所有红帽认证中最高水平的认证。考生需要选择他们希望关注的集合,或者选择合格的红帽认证的任意组合,以此来创建一个他们自己的集合。这里有三个主要的集合,数据中心,云和应用平台。精通数据中心集合的RHCA能够运行,管理数据中心,而熟悉云的可以创建,配置和管理私有的,混合的云,云应用平台以及使用红帽企业Linux平台的灵活存储方案。精通应用平台集合的RHCA拥有技能如安装,配置和管理红帽JBoss企业应用平台和应用,云应用平台和混合云环境,借助红帽的OpenShift企业版,使用红帽JBoss数据虚拟化技术从多个资源里组合数据。
+
+- **认证代码**:RHCA
+- 课程代码:CL210,CL220.CL280,RH236,RH318,RH413,RH436,RH442,JB248和JB450
+- 考试代码:EX333,EX401,EX423或者EX318,EX436和EX442
+- 考试时长:21-22个小时,取决于所选课程
+- 要求:未过期的RHCE证书
+- 分数线:300总分,210过(70%)
+- 有效期:3年
+
+### 8. SUSE CLA ###
+
+SUSE认证Linux管理员(SUSE CLA)是SUSE推出的一个初级认证,关注点在SUSE Linux企业服务器环境下的日常任务管理。为了获得SUSE CLA认证,完成课程任务不是必须的,你不得不通过考试获得认证。SUSE CLA有能力,也有技术去使用Linux桌面,定位并利用帮助资源,管理Linux文件系统,用Linux Shell和命令行工作,安装SLE 11 SP22,管理系统安装,硬件,备份和恢复,用YaST管理Linux,Linux进程和服务,存储,配置网络,远程接入,SLE 11 SP2模拟器,任务自动化和管理用户访问和安全工作。我们可以同时获得LPI的SUSE CLA,LPIC-1和CompTIA Linux,因为SUSE,Linux Professional Institute和CompATI合作提供给你这个机会,去获得三个Linux认证。
+
+- **认证代码**:SUSE CLA
+- 课程代码:3115,3116
+- 考试代码:050-720,050-710
+- 问题类型:多项选择
+- 考试时长:90分钟
+- 要求:无
+- 分数线:512
+
+### 9. SUSE CLP ###
+
+SUSE认证Linux专业人员(CLP)是一个认证程序,为那些希望获得关于SUSE Linux企业服务器更多高级且专业的知识的人而服务。SUSE CLP是通过SUSE CLA认证后的下一步。一个人应该通过CLA的考试并拥有证书,然后才能获得CLP的认证,通过完成CLP的考试。通过SUSE CLP认证的人员有能力完成安装和配置SUSE Linux企业服务器11系统,维护文件系统,管理软件包,进程,打印,使用IPv6配置基础网络服务,samba,网页服务器,创建和运行bash shell脚本。
+
+- **认证代码**:SUSE CLP
+- 课程代码:3115,3116和3117
+- 考试代码:050-721,050-697
+- 考试类型:手写
+- 考试时长:180分钟
+- 要求:SUSE CLA 认证
+
+### 10. SUSE CLE ###
+
+SUSE认证Linux工程师(CLE)是一个工程师级别的高级认证,为那些已经通过CLE考试的人准备。为了获得CLE认证,人们需要获得SUSE CLA和CLP的认证。获得CLE认证的人员拥有架设复杂SUSE Linux企业服务器环境的技能。CLE认证过的人可以配置基本的网络服务,管理打印,配置和使用Open LDAP,samba,IPv6,完成健康检测和(这里不知道),创建和执行shell脚本,部署SUSE Linux企业板,通过Xen实现虚拟化等等。
+
+- **认证代码**:SUSE CLE
+- 课程代码:3107
+- 考试代码:050-723
+- 考试类型:手写
+- 考试时长:120分钟
+- 要求:SUSE CLP 10或者11证书
+
+### 11. LFCS ###
+
+Linux基金会认证系统管理员(LFCS)认证考生Linux使用中拥有的知识和通过终端环境使用Linux。LFCS是Linux基金会的一个认证程序,为使用Linux操作系统工作的系统管理员和工程师准备。Linux基金会联合工业级专家,Linux内核社区,测试考生扎实的技能,知识和应用能力。通过LFCS认证的人员拥有一些技能,知识和能力,包括在命令行下编辑和操作文件,管理和处理文件系统与存储的错误,聚合分区作为LVM设备,配置SWAP分区,管理网络文件系统,管理用户帐号,权限和属组,创建并执行bash shell脚本,安装,升级,移除软件包等等。
+
+- **认证代码**:LFCS
+- 课程代码:LFCS201,LFCS220(可选)
+- 考试代码:LFCS 考试
+- 考试时长:2小时
+- 要求:无
+- 分数线:74%
+- 语言:英语
+- 有效期:两年
+
+### 12. LFCE ###
+
+Linux基金会认证工程师(LFCE),是Linux基金会为Linux工程师推出的认证。通过LFCE认证的人员拥有一个对于Linux较宽范围的技能,相比于LFCS。这是一个工程师级别的高级认证程序。LFCE认证的人具备一些网络管理方面的技能和能力,如配置网络服务,包过滤,网络运行模拟器,IP连通,配置文件系统和文件服务,网络文件系统,从仓库安装,升级软件包,管理网络安全,配置iptables,http服务,代理服务,邮件服务等等。由于其为高级工程级别的认证程序,所以普遍认为相比LFCS,学习和通过的难度更大些。
+
+- **认证代码**:LFCE
+- 课程代码:LFS230
+- 考试代码:LFCE 考试
+- 考试时长:2小时
+- 要求:认证过LFCS
+- 分数线:72%
+- 语言:英语
+- 有效期:2年
+
+### 我们发现的情况(这仅仅是我们的观点)###
+
+最近的调查表明,在不同的高端招聘代理中,称80%的Linux工作描述更倾向于红帽的认证。如果你是一个学生/新手,并且想学习Linux,那么我们建议选择越来越流行的Linux基金会认证,或者CompTIA Linux也可以是一个选择。如果你已经知道了oracle或suse,或者在他们的产品上工作,那oracle/suse的认证会更好些,如果你在一个公司工作了,这些认证会对你的职业生涯成长有帮助:-)
+
+### 总结 ###
+
+在这个世界上,成千上万的大公司正在运行跑着Linux操作系统的服务器和主框架,为了在这些服务器上管理,配置和工作,总是存在对Linux技术/专业知识高度认证的需求。这些国际上承认的认证对某些人在Linux的职业生涯扮演很重要的角色。全世界范围内的这些公司运行着Linux,需要Linux工程师,系统管理员和已经获得认证且在Linux相关领域干得不错的有热情的人员。全球认可的Linux认证,对于专业知识和职业生涯的辉煌都是很基础的,所以好好准备考试并获得认证,对于在Linux建立职业生涯是一个很好的选择。如果你有任何问题,想法,反馈,请写在下方的评论框里,让我们好知道哪些东西需要添加或者改进。谢谢!:-)
+
+--------------------------------------------------------------------------------
+
+via: http://linoxide.com/linux-how-to/12-globally-recognized-linux-certifications/
+
+作者:[Arun Pyasi][a]
+译者:[译者ID](https://github.com/wi-cuckoo)
+校对:[校对者ID](https://github.com/校对者ID)
+
+本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出
+
+[a]:http://linoxide.com/author/arunp/

From 660cf367aa2bb66458f163ac4aa21ec95cd215ec Mon Sep 17 00:00:00 2001
From: sevenot 
Date: Thu, 11 Jun 2015 12:49:10 +0800
Subject: [PATCH 331/965] sevenot translated

---
 ...nts in 2014--download the Annual Report.md | 34 ----------
 ...nts in 2014--download the Annual Report.md | 66 +++++++++++++++++++
 2 files changed, 66 insertions(+), 34 deletions(-)
 delete mode 100644 sources/share/20150604 Read about The Document Foundation achievements in 2014--download the Annual Report.md
 create mode 100644 translated/share/20150604 Read about The Document Foundation achievements in 2014--download the Annual Report.md

diff --git a/sources/share/20150604 Read about The Document Foundation achievements in 2014--download the Annual Report.md b/sources/share/20150604 Read about The Document Foundation achievements in 2014--download the Annual Report.md
deleted file mode 100644
index 28b0a76083..0000000000
--- a/sources/share/20150604 Read about The Document Foundation achievements in 2014--download the Annual Report.md	
+++ /dev/null
@@ -1,34 +0,0 @@
-sevenot translating
-Read about The Document Foundation achievements in 2014: download the Annual Report! 
-================================================================================
-![](https://documentfoundation.files.wordpress.com/2015/06/tdf-report.jpg)
-
-TDF ReportThe Document Foundation (TDF) is proud to announce its 2014 Annual Report, which can be downloaded from the following link: [http://tdf.io/report2014][1] (3.2 MB PDF). The version with HD images can be downloaded from [http://tdf.io/report2014hq][2] (15.9 MB PDF).
-
-TDF Annual Report starts with a Review of 2014, with highlights about TDF and LibreOffice, and a summary of financials and budget.
-
-Community, Projects & Events covers the LibreOffice Conference 2014 in Bern, Certification, Website and QA, Hackfests in Brussels, Gran Canaria, Paris, Boston and Tolouse, Native-Language Projects, Infrastructure, Documentation, Marketing and Design.
-
-Software, Development & Code reports about the activities of the Engineering Steering Committee, LibreOffice Development, the Document Liberation Project and LibreOffice on Android.
-
-The last section focuses on People, starting with Top Contributors, followed by TDF Staff, the Board of Directors and the Membership Committee, the Board of Trustees, or the body of TDF Members, and the Advisory Board.
-
-TDF 2014 Annual Report has been edited by Sophie Gautier, Alexander Werner, Christian Lohmaier, Florian Effenberger, Italo Vignoli and Robinson Tryon, and designed by Barak Paz, with the help of the fantastic LibreOffice community.
-
-To allow the widest distribution of the document, this is released with a CC BY 3.0 DE License, unless otherwise noted, to TDF Members and free software advocates worldwide.
-
-[The German version of TDF Annual Report is available from [http://tdf.io/bericht2014][3]].
-
---------------------------------------------------------------------------------
-
-via: http://blog.documentfoundation.org/2015/06/03/read-about-the-document-foundation-achievements-in-2014-download-the-annual-report/
-
-作者:italovignoli
-译者:[译者ID](https://github.com/译者ID)
-校对:[校对者ID](https://github.com/校对者ID)
-
-本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出
-
-[1]:https://wiki.documentfoundation.org/File:TDF2014AnnualReport.pdf
-[2]:https://wiki.documentfoundation.org/File:TDF2014AnnualReportHQ.pdf
-[3]:https://wiki.documentfoundation.org/File:TDF2014AnnualReportDE.pdf
\ No newline at end of file
diff --git a/translated/share/20150604 Read about The Document Foundation achievements in 2014--download the Annual Report.md b/translated/share/20150604 Read about The Document Foundation achievements in 2014--download the Annual Report.md
new file mode 100644
index 0000000000..de309b6994
--- /dev/null
+++ b/translated/share/20150604 Read about The Document Foundation achievements in 2014--download the Annual Report.md	
@@ -0,0 +1,66 @@
+
+
+
+
+
+
+
+
+
+
+
+Thu Jun 11 12:41:59 2015
+
+AbiWord
+Thu Jun 11 11:14:11 2015
+
+application/x-abiword
+
+
+
+
+
+
+
+
+
+
+
+
+

sevenot translated

+

下载年度报告,了解The Document Foundation2014年的成果

+

================================================================================

+

![](https://documentfoundation.files.wordpress.com/2015/06/tdf-report.jpg)

+

+

+

TDF ReportThe Document Foundation (TDF)郑重地发布了2014年度报告,你可以点击这里下载: [http://tdf.io/report2014][1] (3.2 MB PDF)。高清质量的可以点击这里下载 [http://tdf.io/report2014hq][2] (15.9 MB PDF)。

+

+

TDF年度报告中,以回顾2014年开始了这篇报告,其中包括了TDF和LibreOffice的精彩集锦,并且总结了财务情况和预算。

+

+

该报告涉及到项目和活动的会议包括:2014年在伯尔尼的LibreOffice大会,在布鲁塞尔、大加那利岛、巴黎、波士顿和土鲁斯的认证项目,网站与质量保证,Hackfests项目,本土语言项目,基础设施,文档项目,市场设计与营销。

+

+

该报告涉及到的软件开发活动和代码包括:工程指导委员会的活动,LibreOffice的开发,文档解放项目,LibreOffice的安卓移植。

+

+

报告的最后一部分则把焦点对准了那些做出了极大贡献的人们,他们是TDF的工作人员,董事会成员,委员会成员,委托组织成员,TDF的核心成员和咨询委员会成员。

+

+

TDF 2014年度报告的编辑工作由Sophie Gautier, Alexander Werner, Christian Lohmaier, Florian Effenberger, Italo Vignoli 和 Robinson Tryon完成,由Barak Paz设计样式,Libreoffice社区协助完成。

+

+

+

为了使该文档分布达到最大程度的分布,采用了CC3 认证发布,除非特殊标注,TDF成员和自由软件基金会拥有其所有权。

+

[德语版年度报告下载请点击[http://tdf.io/bericht2014][3]].

+

+

--------------------------------------------------------------------------------

+

+

via: http://blog.documentfoundation.org/2015/06/03/read-about-the-document-foundation-achievements-in-2014-download-the-annual-report/

+

+

作者:italovignoli

+

译者:[sevenot(https://github.com/sevenot)

+

校对:[校对者ID](https://github.com/校对者ID)

+

+

本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出

+

+

[1]:https://wiki.documentfoundation.org/File:TDF2014AnnualReport.pdf

+

[2]:https://wiki.documentfoundation.org/File:TDF2014AnnualReportHQ.pdf

+

[3]:https://wiki.documentfoundation.org/File:TDF2014AnnualReportDE.pdf

+
+
From 954e63a85dd68a3f570298b506bac53ec959c555 Mon Sep 17 00:00:00 2001 From: sevenot Date: Thu, 11 Jun 2015 12:56:27 +0800 Subject: [PATCH 332/965] sevenot translated --- ...nts in 2014--download the Annual Report.md | 99 +++++++------------ 1 file changed, 34 insertions(+), 65 deletions(-) diff --git a/translated/share/20150604 Read about The Document Foundation achievements in 2014--download the Annual Report.md b/translated/share/20150604 Read about The Document Foundation achievements in 2014--download the Annual Report.md index de309b6994..678abbb6fd 100644 --- a/translated/share/20150604 Read about The Document Foundation achievements in 2014--download the Annual Report.md +++ b/translated/share/20150604 Read about The Document Foundation achievements in 2014--download the Annual Report.md @@ -1,66 +1,35 @@ - - - - - - - - - +sevenot translated +下载年度报告,了解The Document Foundation2014年的成果 +================================================================================ +![](https://documentfoundation.files.wordpress.com/2015/06/tdf-report.jpg) - -Thu Jun 11 12:41:59 2015 - -AbiWord -Thu Jun 11 11:14:11 2015 - -application/x-abiword - - - - - - - - - - - -
-

sevenot translated

-

下载年度报告,了解The Document Foundation2014年的成果

-

================================================================================

-

![](https://documentfoundation.files.wordpress.com/2015/06/tdf-report.jpg)

-

-

-

TDF ReportThe Document Foundation (TDF)郑重地发布了2014年度报告,你可以点击这里下载: [http://tdf.io/report2014][1] (3.2 MB PDF)。高清质量的可以点击这里下载 [http://tdf.io/report2014hq][2] (15.9 MB PDF)。

-

-

TDF年度报告中,以回顾2014年开始了这篇报告,其中包括了TDF和LibreOffice的精彩集锦,并且总结了财务情况和预算。

-

-

该报告涉及到项目和活动的会议包括:2014年在伯尔尼的LibreOffice大会,在布鲁塞尔、大加那利岛、巴黎、波士顿和土鲁斯的认证项目,网站与质量保证,Hackfests项目,本土语言项目,基础设施,文档项目,市场设计与营销。

-

-

该报告涉及到的软件开发活动和代码包括:工程指导委员会的活动,LibreOffice的开发,文档解放项目,LibreOffice的安卓移植。

-

-

报告的最后一部分则把焦点对准了那些做出了极大贡献的人们,他们是TDF的工作人员,董事会成员,委员会成员,委托组织成员,TDF的核心成员和咨询委员会成员。

-

-

TDF 2014年度报告的编辑工作由Sophie Gautier, Alexander Werner, Christian Lohmaier, Florian Effenberger, Italo Vignoli 和 Robinson Tryon完成,由Barak Paz设计样式,Libreoffice社区协助完成。

-

-

-

为了使该文档分布达到最大程度的分布,采用了CC3 认证发布,除非特殊标注,TDF成员和自由软件基金会拥有其所有权。

-

[德语版年度报告下载请点击[http://tdf.io/bericht2014][3]].

-

-

--------------------------------------------------------------------------------

-

-

via: http://blog.documentfoundation.org/2015/06/03/read-about-the-document-foundation-achievements-in-2014-download-the-annual-report/

-

-

作者:italovignoli

-

译者:[sevenot(https://github.com/sevenot)

-

校对:[校对者ID](https://github.com/校对者ID)

-

-

本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出

-

-

[1]:https://wiki.documentfoundation.org/File:TDF2014AnnualReport.pdf

-

[2]:https://wiki.documentfoundation.org/File:TDF2014AnnualReportHQ.pdf

-

[3]:https://wiki.documentfoundation.org/File:TDF2014AnnualReportDE.pdf

-
-
+ +TDF ReportThe Document Foundation (TDF)郑重地发布了2014年度报告,你可以点击这里下载: [http://tdf.io/report2014][1] (3.2 MB PDF)。高清质量的可以点击这里下载 [http://tdf.io/report2014hq][2] (15.9 MB PDF)。 + +TDF年度报告中,以回顾2014年开始了这篇报告,其中包括了TDF和LibreOffice的精彩集锦,并且总结了财务情况和预算。 + +该报告涉及到项目和活动的会议包括:2014年在伯尔尼的LibreOffice大会,在布鲁塞尔、大加那利岛、巴黎、波士顿和土鲁斯的认证项目,网站与质量保证,Hackfests项目,本土语言项目,基础设施,文档项目,市场设计与营销。 + +该报告涉及到的软件开发活动和代码包括:工程指导委员会的活动,LibreOffice的开发,文档解放项目,LibreOffice的安卓移植。 + +报告的最后一部分则把焦点对准了那些做出了极大贡献的人们,他们是TDF的工作人员,董事会成员,委员会成员,委托组织成员,TDF的核心成员和咨询委员会成员。 + +TDF 2014年度报告的编辑工作由Sophie Gautier, Alexander Werner, Christian Lohmaier, Florian Effenberger, Italo Vignoli 和 Robinson Tryon完成,由Barak Paz设计样式,Libreoffice社区协助完成。 + + +为了使该文档分布达到最大程度的分布,采用了CC3 认证发布,除非特殊标注,TDF成员和自由软件基金会拥有其所有权。 +[德语版年度报告下载请点击[http://tdf.io/bericht2014][3]]. + +-------------------------------------------------------------------------------- + +via: http://blog.documentfoundation.org/2015/06/03/read-about-the-document-foundation-achievements-in-2014-download-the-annual-report/ + +作者:italovignoli +译者:[sevenot](https://github.com/sevenot) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[1]:https://wiki.documentfoundation.org/File:TDF2014AnnualReport.pdf +[2]:https://wiki.documentfoundation.org/File:TDF2014AnnualReportHQ.pdf +[3]:https://wiki.documentfoundation.org/File:TDF2014AnnualReportDE.pdf \ No newline at end of file From 75b5b2a55e5f1ba3495734483d7bec62d2e18472 Mon Sep 17 00:00:00 2001 From: KS Date: Thu, 11 Jun 2015 13:57:41 +0800 Subject: [PATCH 333/965] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...hopping Store Using 'OpenCart' in Linux.md | 224 ++++++++++++++++++ 1 file changed, 224 insertions(+) create mode 100644 translated/tech/20150527 How to Create Own Online Shopping Store Using 'OpenCart' in Linux.md diff --git a/translated/tech/20150527 How to Create Own Online Shopping Store Using 'OpenCart' in Linux.md b/translated/tech/20150527 How to Create Own Online Shopping Store Using 'OpenCart' in Linux.md new file mode 100644 index 0000000000..e506f76f7c --- /dev/null +++ b/translated/tech/20150527 How to Create Own Online Shopping Store Using 'OpenCart' in Linux.md @@ -0,0 +1,224 @@ +如何在linux中用“OpenCart”创建自己的在线商店 +================================================================================ +在网络世界我们用电脑做所有事情。用电子设备完成的商务也叫电子商务即是其中之一。电子商务并不是什么新鲜事,它起源于早期的阿帕网,阿帕网用来安排麻省理工学院和斯坦福大学人工智能实验室学生之间的拍卖。 + +最近出现了上百家电子商务网站也就是, Flipcart, eBay, Alibaba, Zappos, IndiaMART, Amazon, 等等。你想制作自己的亚马逊和Flipcart这样基于web的应用程序服务器吗?如果是!这个文章正适合你。 + +Opencart是一个免费开源的使用PHP语言的电子商务程序,它可以用来开发一个购物车系统类似于亚马逊和Flipcart。如果你想在线卖你的产品或想在关门时为你的客户提供服务Opencart是给你准备的。你可以使用可靠和专业Opencart应用程序建立一个成功的网上商店(网上商家)。 + +### OpenCart 网页面板演示 ### + +- 商店前端 – [http://demo.opencart.com/][1] +- 管理登陆 – [http://demo.opencart.com/admin/][2] + + ------------------ 管理 登陆 ------------------ + 用户名: demo + 密码: demo + +#### Opencart的特点 #### + +Opencart是一个符合所有在线商家需求的应用程序。您可以使用它的所有特性(见下文)制作自己的电子商务网站。 + +- 它是一个免费的(如啤酒)和开源(如言论)应用GNU GPL许可下发布。 +- 一切都是有据可查的,意味着你不需到要谷歌喊救命。 +- 自由生活的时间支持和更新。 +- 无限数量的类别、产品和制造商的支持。 +- 一切都是基于模板的。 +- 支持多语言和多币种。它确保你的产品遍及全球。 +- 内置产品评论和评级功能。 +- 可下载的产品(即电子书)支持 +- 自动调整图像的支持。 +- 功能,如多税率(如各种国家),查看相关产品,资料页,装船重量计算,使用折扣优惠券,等等是默认实现的。 +- 内置的备份和恢复工具。 +- 实施搜索引擎优化。 +- 发票打印,也支持错误日志和销售报告。 + +#### 系统需求 #### + +- Web 服务器 (Apache HTTP服务器的首选) +- PHP (5.2 或以上). +- 数据库 (首选MySQL但是我用MariaDB). + +#### PHP需要的库和模块 #### + +这些扩展必须在您的系统上安装并启用确保web服务器上安装Opencart正确 + +- Curl +- Zip +- Zlib +- GD Library +- Mcrypt +- Mbstrings + +### 第一步: 安装 Apache, PHP 和 MariaDB ### + +1. 像我说的,OpenCart需要一定的技术要求比如在系统上安装Apache,PHP扩展和数据库(MySQL或MariaDB),为了运行Opencart正常。 + +让我们使用命令行安装Apache,PHP和MariaDB。 + +**安装 Apache** + + # apt-get install apache2 (在基于Debian系统上) + # yum install httpd (在基于RedHat系统上) + +**安装 PHP and Extensions** + + # apt-get install php5 libapache2-mod-php5 php5-curl php5-mcrypt (在基于Debian系统上) + # yum install php php-mysql php5-curl php5-mcrypt (在基于RedHat系统上) + +**安装 MariaDB** + + # apt-get install mariadb-server mariadb-client (在基于Debian系统上) + # yum install mariadb-server mariadb (在基于RedHat系统上) + +2. 在安装所有需要上面的东西后, you can start the Apache and MariaDB services using following commands. + + ------------------- 在基于Debian系统上 ------------------- + # systemctl restart apache2.service + # systemctl restart mariadb.service + + + ------------------- 在基于RedHat系统上 ------------------- + # systemctl restart httpd.service + # systemctl restart mariadb.service + +### 第二步: 下载和设置 OpenCart ### + +3. 最新版本的OpenCart(2.0.2.0)可以从[OpenCart website][3]或直接从github获得。 + +作为一种选择,你可以使用wget命令直接从github库下载最新版本的OpenCart,如下所示。 + + # wget https://github.com/opencart/opencart/archive/master.zip + +4. 下载压缩文件后,拷贝到Apache工作目录下(例如/var/www/html)然后解压缩master.zip文件。 + + # cp master.zip /var/www/html/ + # cd /var/www/html + # unzip master.zip + +5. 提取‘master.zip’文件后,切换到提取目录下然后移动upload目录到应用程序的根文件夹(opencart-master) + + # cd opencart-master + # mv -v upload/* ../opencart-master/ + +6. 现在需要重命名或复制OpenCart配置文件如下所示。 + + # cp /var/www/html/opencart-master/admin/config-dist.php /var/www/html/opencart-master/admin/config.php + # cp /var/www/html/opencart-master/config-dist.php /var/www/html/opencart-master/config.php + +7. 下一步,设置/var/www/html/opencart-master的文件和文件夹正确的权限。您需要提供RWX权限给文件和文件夹,用递归方式。 + + # chmod 777 -R /var/www/html/opencart-master + +**重要**: 设置权限777可能是危险的,所以一旦你完成所有设置,递归恢复755权限到上层的文件夹。 + +### 第三步: 创建 OpenCart 数据库 ### + +8. 下一步是创建一个数据库(例如opencartdb)电子商务网站数据库来存储数据。连接到数据库服务器并创建一个数据库,用户和正确的权限授予用户完全控制数据库。 + + # mysql -u root -p + CREATE DATABASE opencartdb; + CREATE USER 'opencartuser'@'localhost' IDENTIFIED BY 'mypassword'; + GRANT ALL PRIVILEDGES ON opencartdb.* TO 'opencartuser'@'localhost' IDENTIFIED by 'mypassword'; + +### 第四步: OpenCart 网站安装 ### + +9. 一旦所有设置正确,到web浏览器地址栏输入`http://`访问OpenCart web安装。 + +点击“继续”,同意许可证协议。 + +![Accept OpenCart License](http://www.tecmint.com/wp-content/uploads/2015/05/OpenCart-License.png) + +同意OpenCart许可证 + +10. 下一个屏幕是安装前检查服务器设置,查看服务器所需的所有模块安装正确并且有OpenCart文件的权限。 + +如果有红色标志突出显示#1或#2,这意味着你需要在服务器上正确安装这些组件满足web服务器的要求。 + +如果有红色标志突出显示#3或#4,这意味着你的文件有问题。如果一切正确配置您应该看到所有绿色标志是可见的(见下面),你可以按“继续”。 + +![Server Requirement Check](http://www.tecmint.com/wp-content/uploads/2015/05/Server-Checkup.png) + +服务器需求检查 + +11. 在下一个屏幕上输入数据库证书如数据库驱动程序,主机名、用户名、密码、数据库。你不应该改动数据库端口和前缀,除非你知道你在做什么。 + +另外输入管理员账号的用户名,密码和邮箱地址。注意这些凭据将用于root登录到Opencart管理面板,所以保证它的安全。完成后单击继续! + +![OpenCart Database Details](http://www.tecmint.com/wp-content/uploads/2015/05/OpenCart-Database.png) + +OpenCart数据库详情 + +12. 下一个屏幕显示的信息如“Installation Complete”与“Ready to Start Selling”为结束行。还警告说,删除安装目录,所有需要这个目录安装的设置已经完成。 + +![OpenCart Installation Completes](http://www.tecmint.com/wp-content/uploads/2015/05/OpenCart-Installation-Completes.png) + +OpenCart安装完成 + +删除安装目录,你可以执行下面的命令。 + + # rm -rf /var/www/html/opencart-master/install + +### 第四步: 进入OpenCart页管理 ### + +13. 现在打开浏览器到`http:///opencart-master/`然后你会看到类似下面的截屏。 + +![OpenCart Product Showcase](http://www.tecmint.com/wp-content/uploads/2015/05/OpenCart.jpg) + +OpenCart产品示例 + +14. 为了登陆到Opencart管理面板,你需要浏览http:///opencart-master/admin然后填写通行证,同时设置它启动。 + +![OpenCart Admin Login](http://www.tecmint.com/wp-content/uploads/2015/05/OpenCart-Admin-Login.png) + +OpenCart管理登陆 + +15. 如果全部OK你应该可以看到Opencart的控制台。 + +![OpenCart Dashboard](http://www.tecmint.com/wp-content/uploads/2015/05/OpenCart-Dashboard.png) + +OpenCart控制台 + +在管理控制台可以建立很多选项如类别,产品选择,制造商、下载、评论,信息,扩展安装,运输,付款选项,订单总数、礼品券、贝宝、优惠券、子公司、营销、邮件、设计和设置,错误日志,内置分析等等。 + +#### 测试工具之后? #### + +如果您已经测试了应用程序和发现它可定制,灵活,坚如磐石,易于维护和使用,您可能需要一个好的主机托管提供商托管OpenCart应用,保持在线24 x7的支持。尽管有很多选项,我们建议Hostgator主机提供商。(广告硬植-.-!) + +Hostgator是以服务和特性出名的域名注册和虚拟机托管提供商。它为你提供无限的磁盘空间,无限带宽,易于安装(一键安装脚本),99.9%的正常运行时间,荣获24x7x365技术支持和45天退款保证,这意味着如果你不喜欢这个产品和服务在45天内拿回你的采购费,注意这45天是一个长的测试时间。 + +所以如果你有什么想卖的你可以自由做它(我的意思是自由,想到你会花在获得物理存储成本,然后比较其与虚拟商店建立成本。你会觉得它的自由)。 + +**注**: 当你从Hostgator购买虚拟主机(和/或域名)你将获得一个**25%折扣**。这只提供给Tecmint网站的读者。 + +你所要做的就是在购买虚拟机支付时输入优惠码“**TecMint025**”。付款预览截屏优惠码以供参考用。 + +![Hostgator 25% Discount - TecMint025](http://www.tecmint.com/wp-content/uploads/2015/05/Hostgator-Discount-Code.png) + +[Sign up for Hostgator][4] (折扣码: TecMint025) + +**注**: 还值得一提的,每个你从Hostgator购买的虚拟机托管OpenCart,我们将得到少量的佣金,只是为了保持Tecmint存活 (通过支付带宽和托管服务器)。 + +所以如果你使用上面的代码买它,你得到折扣,我们会得到少量收入。还要注意,你不会支付任何额外的,事实上你支付的账单总额将减少25%。 + +### 总结 ### + +OpenCart是一个开箱可用的应用。它易于安装,您可以选择选择最适合的模板,添加你的产品然后你就成为了一个在线店主。 + +很多社区的扩展(免费和付费)使它丰富。这是一个美妙的应用为那些想要建立一个保持24X7小时用户可访问的虚拟商店。让我知道你的应用程序的经验。欢迎任何建议和反馈。 + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/create-e-commerce-online-shopping-store-using-opencart-in-linux/ + +作者:[Avishek Kumar][a] +译者:[wyangsun](https://github.com/wyangsun) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/avishek/ +[1]:http://demo.opencart.com/ +[2]:http://demo.opencart.com/admin/ +[3]:http://www.opencart.com/index.php?route=download/download/ +[4]:http://secure.hostgator.com/%7Eaffiliat/cgi-bin/affiliates/clickthru.cgi?id=tecmint From 40f692373ad058da8febb3ebfd43044a7623a1f0 Mon Sep 17 00:00:00 2001 From: wxy Date: Thu, 11 Jun 2015 14:06:53 +0800 Subject: [PATCH 334/965] PUB:20150518 10 Amazing and Mysterious Uses of Symbol or Operator in Linux Commands @wwy-hust --- ...of Symbol or Operator in Linux Commands.md | 214 ++++++++++++++++++ ...of Symbol or Operator in Linux Commands.md | 193 ---------------- 2 files changed, 214 insertions(+), 193 deletions(-) create mode 100644 published/20150518 10 Amazing and Mysterious Uses of Symbol or Operator in Linux Commands.md delete mode 100644 translated/tech/20150518 10 Amazing and Mysterious Uses of Symbol or Operator in Linux Commands.md diff --git a/published/20150518 10 Amazing and Mysterious Uses of Symbol or Operator in Linux Commands.md b/published/20150518 10 Amazing and Mysterious Uses of Symbol or Operator in Linux Commands.md new file mode 100644 index 0000000000..e647b452c7 --- /dev/null +++ b/published/20150518 10 Amazing and Mysterious Uses of Symbol or Operator in Linux Commands.md @@ -0,0 +1,214 @@ +在Linux命令行下令人惊叹的惊叹号(!) +================================================================================ +`'!'`符号在Linux中不但可以用作否定符号,还可以用来从历史命令记录中取出命令或不加修改的执行之前运行的命令。下面的所有命令都已经在Bash Shell中经过确切地检验。尽管我没有试过,但大多都不能在别的Shell中运行。这里我们介绍下Linux命令行中符号`'!'`那惊人和奇妙的用法。 + +### 1. 使用数字从历史命令列表中找一条命令来执行 ### + +您也许没有意识到您可以从历史命令列表(之前已经执行的命令集)中找出一条来运行。首先,通过"history"命令查找之前命令的序号。 + + $ history + +![使用history命令找到最后执行的命令](http://www.tecmint.com/wp-content/uploads/2015/05/history-Command.gif) + +*使用history命令找到最后执行的命令* + +现在,只需要使用历史命令输出中显示在该命令前面的数字便可以运行这个命令。例如,运行一个在`history`输出中编号是1551的命令。 + + $ !1551 + +![使用命令ID来执行最后运行的命令](http://www.tecmint.com/wp-content/uploads/2015/05/Run-Commands-By-number.gif) + +*使用命令ID来执行最后运行的命令* + +这样,编号为1551的命令(上面的例子是[top命令][1])便运行了。这种通过ID号来执行之前的命令的方式很有用,尤其是在这些命令都很长的情况下。您只需要使用**![history命令输出的序号]**便可以调用它。 + +### 2. 运行之前的倒数第二个、第七个命令等 ### + +您可以以另一种方式来运行之前执行的命令,通过使用-1代表最后的命令,-2代表倒数第二个命令,-7代表倒数第七个命令等。 + +首先使用history命令来获得执行过的命令的列表。**history命令的执行很有必要**,因为您可以通过它来确保没有`rm command > file`或其他会导致危险的命令。接下来执行倒数第六个、第八个、第十个命令。 + + $ history + $ !-6 + $ !-8 + $ !-10 + +![通过负数序号运行之前执行的命令](http://www.tecmint.com/wp-content/uploads/2015/05/3.gif) + +*通过负数序号运行之前执行的命令* + +### 3. 传递最后执行的命令的参数,以方便的运行新的命令 ### + +我需要显示`/home/$USER/Binary/firefox`文件夹的内容,因此我执行: + + $ ls /home/$USER/Binary/firefox + +接下来,我意识到我应该执行'ls -l'来查看哪个文件是可执行文件。因此我应该重新输入整个命令么?不,我不需要。我仅需要在新的命令中带上最后的参数,类似: + + $ ls -l !$ + +这里`!$`将把最后执行的命令的参数传递到这个新的命令中。 + +![将上一个命令的参数传递给新命令](http://www.tecmint.com/wp-content/uploads/2015/05/4.gif) + +*将上一个命令的参数传递给新命令* + +### 4. 如何使用!来处理两个或更多的参数 ### + +比如说我在桌面创建了一个文本文件file1.txt。 + + $ touch /home/avi/Desktop/1.txt + +然后在cp命令中使用绝对路径将它拷贝到`/home/avi/Downloads`。 + + $ cp /home/avi/Desktop/1.txt /home/avi/downloads + +这里,我们给cp命令传递了两个参数。第一个是`/home/avi/Desktop/1.txt`,第二个是`/home/avi/Downloads`。让我们分别处理他们,使用`echo [参数]`来打印两个不同的参数。 + + $ echo "1st Argument is : !^" + $ echo "2nd Argument is : !cp:2" + +注意第一个参数可以使用`"!^"`进行打印,其余的命令可以通过`"![命令名]:[参数编号]"`打印。 + +在上面的例子中,第一个命令是`cp`,第二个参数也需要被打印。因此是`"!cp:2"`,如果任何命令比如xyz运行时有5个参数,而您需要获得第四个参数,您可以使用`"!xyz:4"`。所有的参数都可以通过`"!*"`来获得。 + +![处理两个或更多的参数](http://www.tecmint.com/wp-content/uploads/2015/05/5.gif) + +*处理两个或更多的参数* + +### 5. 以关键字为基础执行上个的命令 ### + +我们可以以关键字为基础执行上次执行的命令。可以从下面的例子中理解: + + $ ls /home > /dev/null [命令1] + $ ls -l /home/avi/Desktop > /dev/null [命令2] + $ ls -la /home/avi/Downloads > /dev/null [命令3] + $ ls -lA /usr/bin > /dev/null [命令4] + +上面我们使用了同样的命令(ls),但有不同的开关和不同的操作文件夹。而且,我们还将输出传递到`/dev/null`,我们并未显示输出,因而终端依旧很干净。 + +现在以关键字为基础执行上个的命令。 + + $ ! ls [命令1] + $ ! ls -l [命令2] + $ ! ls -la [命令3] + $ ! ls -lA [命令4] + +检查输出,您将惊奇发现您仅仅使用关键字`ls`便执行了您已经执行过的命令。 + +![以关键字为基础执行命令](http://www.tecmint.com/wp-content/uploads/2015/05/6.gif) + +*以关键字为基础执行命令* + +(LCTT 译注:澄清一下,这种用法会按照命令名来找到最后匹配的命令,不会匹配参数。所以上述执行的四个命令都是执行了 `ls -lA /usr/bin > /dev/null`,并增加了新的参数而已。) + +### 6. !!操作符的威力 ### + +您可以使用`(!!)`运行/修改您上个运行的命令。它将附带一些修改/调整并调用上个命令。让我给您展示一些实际情境。 + +昨天我运行了一行脚本来获得我的私有IP,因此我执行了: + + $ ip addr show | grep inet | grep -v 'inet6'| grep -v '127.0.0.1' | awk '{print $2}' | cut -f1 -d/ + +接着,我突然发现我需要将上面脚本的输出重定向到一个ip.txt的文件,因此,我该怎么办呢?我该重新输入整个命令并重定向到一个文件么?一个简单的解决方案是使用向上光标键并添加`'> ip.txt'`来将输出重定向到文件。 + + $ ip addr show | grep inet | grep -v 'inet6'| grep -v '127.0.0.1' | awk '{print $2}' | cut -f1 -d/ > ip.txt + +在这里要感谢救世主"向上光标键"。现在,考虑下面的情况,这次我运行了下面这一行脚本。 + + $ ifconfig | grep "inet addr:" | awk '{print $2}' | grep -v '127.0.0.1' | cut -f2 -d: + +一旦我运行了这个脚本,Bash提示符便返回了错误消息`"bash: ifconfig: command not found"`。原因并不难猜,我运行了本应以root权限的运行的命令。 + +所以,怎么解决呢?以root用户登录并且再次键入整个命令就太麻烦了!而且向上导航键也不管用了(LCTT 译注:当你以新的用户身份登录了,是不能用向上光标键找到之前的另外一个用户的命令历史的)。因此,我们需要调用`"!!"`(去掉引号),它将为那个用户调用上个命令。 + + $ su -c !! root + +这里su是用来切换到root用户的,`-c`用来以某用户运行特定的命令,最重要的部分是`!!`,它将被替换为上次运行的命令。当然!您需要提供root密码。 + +![!!操作符的威力](http://www.tecmint.com/wp-content/uploads/2015/05/7.gif) + +*!!操作符的威力* + +我通常在下面的情景中使用`!!`。 + +当我用普通用户来运行apt-get,我通常收到提示说我没有权限来执行。 + + $ apt-get upgrade && apt-get dist-upgrade + +好吧,有错误。但别担心,使用下面的命令来成功的执行... + + $ su -c !! + +同样的适用于: + + $ service apache2 start + +或 + + $ /etc/init.d/apache2 start + +或 + + $ systemctl start apache2 + +普通用户不被授权执行那些任务,这样相当于我运行: + + $ su -c 'service apache2 start' + +或 + + $ su -c '/etc/init.d/apache2 start' + +或 + + $ su -c 'systemctl start apache2' + +(LCTT 译注:使用`!!`之前,一定要确认你执行的是什么命令!另外,在 root 身份下,千万不要养成使用它的习惯,因为你总是会在不合适的目录执行不合适的命令!) + +### 7.运行一个影响所有除了![FILE_NAME]的文件命令 ### + +`!`(逻辑非)能用来对除了`'!'`后的文件的所有的文件/扩展名执行命令。 + +A.从文件夹移除所有文件,2.txt除外。 + + $ rm !(2.txt) + +B.从文件夹移除所有的文件类型,pdf类型除外。 + + $ rm !(*.pdf) + +### 8.检查某个文件夹(比如/home/avi/Tecmint)是否存在?并打印 ### + +这里,我们使用`'! -d'`来验证文件夹是否存在,当文件夹不存在时,将使用其后跟随AND操作符`(&&)`进行打印,当文件夹存在时,将使用OR操作符`(||)`进行打印。 + +逻辑上,当`[ ! -d /home/avi/Tecmint ]`的输出为0时,它将执行AND逻辑符后面的内容,否则,它将执行OR逻辑符`(||)`后面的内容。 + + $ [ ! -d /home/avi/Tecmint ] && printf '\nno such /home/avi/Tecmint directory exist\n' || printf '\n/home/avi/Tecmint directory exist\n' + +### 9.检查某文件夹是否存在?如果不存在则退出该命令 ### + +类似于上面的情况,但这里当期望的文件夹不存在时,该命令会退出。 + + $ [ ! -d /home/avi/Tecmint ] && exit + +### 10.如果您的home文件夹内不存在一个文件夹(比方说test),则创建它 ### + +这是脚本语言中的一个常用的实现,当期望的文件夹不存在时,创建一个。 + + [ ! -d /home/avi/Tecmint ] && mkdir /home/avi/Tecmint + +这便是全部了。如果您知道或偶尔遇到其他值得了解的`'!'`使用方法,请您在反馈的地方给我们提建议。保持联系! + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/mysterious-uses-of-symbol-or-operator-in-linux-commands/ + +作者:[Avishek Kumar][a] +译者:[wwy-hust](https://github.com/wwy-hust) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/avishek/ +[1]:http://www.tecmint.com/12-top-command-examples-in-linux/ diff --git a/translated/tech/20150518 10 Amazing and Mysterious Uses of Symbol or Operator in Linux Commands.md b/translated/tech/20150518 10 Amazing and Mysterious Uses of Symbol or Operator in Linux Commands.md deleted file mode 100644 index 4225cf9bb4..0000000000 --- a/translated/tech/20150518 10 Amazing and Mysterious Uses of Symbol or Operator in Linux Commands.md +++ /dev/null @@ -1,193 +0,0 @@ -10!Linux¾˺÷ -================================================================================ -`'!'`Linuxв񶨷ţʷ¼ȡ򲻼޸ĵִ֮ǰеѾBash Shellоȷеؼ顣ûԹ඼ڱShellСǽLinuxз`'!'`Ǿ˺÷ - -### 1. ʹִʷбһִ ### - -ҲûʶԴʷб֮ǰѾִеҳһСȣͨ"history"֮ǰš - - $ history - -![ʹhistoryҵִе](http://www.tecmint.com/wp-content/uploads/2015/05/history-Command.gif) - -ڣֻҪʹʷʾڸǰֱ磬һ`history`б1551 - - $ !1551 - -![ʹIDִе](http://www.tecmint.com/wp-content/uploads/2015/05/Run-Commands-By-number.gif) - -Ϊ1551[top][1]ˡͨIDִ֮ǰķʽãЩܳ¡ֻҪʹ**![history]**Ե - -### 2. ֮ǰĵڶ߸ ### - -һַʽ֮ǰִеͨʹ-1-2ڶ-7߸ȡ - -ʹhistoryִйбhistoryִкбҪΪͨȷû`rm command > file`ᵼΣյִеڰ˸ʮ - - $ history - $ !-6 - $ !-8 - $ !-10 - -![֮ͨǰִе](http://www.tecmint.com/wp-content/uploads/2015/05/3.gif) -֮ͨǰִе - -### 3. ݲԷµ ### - -Ҫʾ`/home/$USER/Binary/firefox`ļеݣִУ - - $ ls /home/$USER/Binary/firefox - -ʶӦִ'ls -l'鿴ĸļǿִļӦôҲҪҽҪµдIJƣ - - $ ls -l !$ - -`!$`ִеIJݵµС - -![һIJݸ](http://www.tecmint.com/wp-content/uploads/2015/05/4.gif) -һIJݸ - -### 4. ʹ!IJ ### - -˵洴һıļfile1.txt - - $ touch /home/avi/Desktop/1.txt - -Ȼcpʹþ·`/home/avi/Downloads` - - $ cp /home/avi/Desktop/1.txt /home/avi/downloads - -ڣǸcpһ`/home/avi/Desktop/1.txt`ڶ`/home/avi/Downloads`Ƿֱǣʹ`echo [arguments]`ӡͬIJ - - $ echo "1st Argument is : !^" - $ echo "2nd Argument is : !cp:2" - -עһʹ`"!^"`дӡͨ`"![]:[]"`ӡ - -Уһ`cp`ڶҲҪӡ`"!cp:2"`κxyzʱ5Ҫõĸʹ`"!xyz:4"`еIJͨ`"!*"`á - -![IJ](http://www.tecmint.com/wp-content/uploads/2015/05/5.gif) -IJ - -### 5. ԹؼΪִϸ ### - -ǿԹؼΪִϴִеԴ⣺ - - $ ls /home > /dev/null [1] - $ ls -l /home/avi/Desktop > /dev/null [2] - $ ls -la /home/avi/Downloads > /dev/null [3] - $ ls -lA /usr/bin > /dev/null [4] - -ʹͬlsвͬĿغͲͬIJļСңǻݵ`/dev/null`Dzδնɺܸɾ - -ԹؼΪִϸ - - $ ! ls [1] - $ ! ls -l [2] - $ ! ls -la [3] - $ ! ls -lA [4] - -淢ʹùؼ`ls`ִѾִй - -![ԹؼΪִ](http://www.tecmint.com/wp-content/uploads/2015/05/6.gif) -ԹؼΪִ - -### 6. !! ### - -ʹ`(!!)`/޸ϸеһЩ޸/ϸҸչʾһЩʵ龳 - -һнűҵ˽IPִˣ - - $ ip addr show | grep inet | grep -v 'inet6'| grep -v '127.0.0.1' | awk '{print $2}' | cut -f1 -d/ - -ţͻȻҪűضһip.txtļˣҸôأҸضһļôһ򵥵Ľʹϵ`'> ip.txt'`ضļ - - $ ip addr show | grep inet | grep -v 'inet6'| grep -v '127.0.0.1' | awk '{print $2}' | cut -f1 -d/ > ip.txt - -л"ϵ"ڣһнű - - $ ifconfig | grep "inet addr:" | awk '{print $2}' | grep -v '127.0.0.1' | cut -f2 -d: - -һűBashʾ㷵˴Ϣ`"bash: ifconfig: command not found"`ԭ򲢲Ѳ£˱ӦrootȨ޵е - -ԣôأǺrootû¼ٴμϵҲˡˣҪ`"!!"`ȥţΪǸûϸ - - $ su -c "!!" root - -suлrootûģ`-c`ijûضҪIJ`!!`滻ΪϴеԵģҪṩroot롣 - -![!!](http://www.tecmint.com/wp-content/uploads/2015/05/7.gif) -!! - -ͨ龰ʹ`!!` - -1.ͨûapt-getͨյʾ˵ûȨִС - - $ apt-get upgrade && apt-get dist-upgrade - -ðɣд󡣵ģʹɹִ... - - $ su -c !! - -ͬڣ - - $ service apache2 start - - $ /etc/init.d/apache2 start - - $ systemctl start apache2 - -ͨûȨִЩУ - - $ su -c 'service apache2 start' - - $ su -c '/etc/init.d/apache2 start' - - $ su -c 'systemctl start apache2' - -### 7.һӰг![FILE_NAME]ļ ### - -`!`߼ǣԳ`'!'`ļеļ/չִ - -A.ļƳļ2.txt⡣ - - $ rm !(2.txt) - -B.ļƳеļͣpdfͳ⡣ - - $ rm !(*.pdf) - -### 8.ijļУ/home/avi/TecmintǷڣӡ ### - -ʹ`'! -d'`֤ļǷڣļвʱʹAND`(&&)`дӡļдʱʹOR`(||)`дӡ - -߼ϣ`[ ! -d /home/avi/Tecmint ]`Ϊ0ʱִAND߼ݣִOR߼`(||)`ݡ - - $ [ ! -d /home/avi/Tecmint ] && printf '\nno such /home/avi/Tecmint directory exist\n' || printf '\n/home/avi/Tecmint directory exist\n' - -### 9.ijļǷڣ˳ ### - -ﵱļвʱ˳ - - $ [ ! -d /home/avi/Tecmint ] && exit - -### 10.homeļڲһļУȷ˵test򴴽 ### - -ǽűеһõʵ֣ļвʱһ - - [ ! -d /home/avi/Tecmint ] && mkdir /home/avi/Tecmint - -ȫˡ֪żֵ˽`'!'`ʹ÷ڷĵطὨ顣ϵ - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/mysterious-uses-of-symbol-or-operator-in-linux-commands/ - -ߣ[Avishek Kumar][a] -ߣ[wwy-hust](https://github.com/wwy-hust) -Уԣ[УID](https://github.com/УID) - - [LCTT](https://github.com/LCTT/TranslateProject) ԭ룬[Linuxй](https://linux.cn/) Ƴ - -[a]:http://www.tecmint.com/author/avishek/ -[1]:http://www.tecmint.com/12-top-command-examples-in-linux/ From 975930de11954ad1ee4c0bfb9363dcfd660f22ce Mon Sep 17 00:00:00 2001 From: KayGuoWhu Date: Thu, 11 Jun 2015 14:13:11 +0800 Subject: [PATCH 335/965] translating --- sources/tech/20150610 How to secure your Linux server.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20150610 How to secure your Linux server.md b/sources/tech/20150610 How to secure your Linux server.md index 1668dae934..51246cbfcb 100644 --- a/sources/tech/20150610 How to secure your Linux server.md +++ b/sources/tech/20150610 How to secure your Linux server.md @@ -1,3 +1,4 @@ +[translating by KayGuoWhu] How to secure your Linux server ================================================================================ > A server is made up of so many different components that makes it hard to offer one solution for everyone's needs. This articles tries to cover some useful tips and tricks to help you keep your server and users protected. From 3e0051983a2f51ffb51fdbd37da7004a50bdec4b Mon Sep 17 00:00:00 2001 From: wi-cuckoo Date: Thu, 11 Jun 2015 14:24:41 +0800 Subject: [PATCH 336/965] translating wi-cuckoo --- sources/share/20150527 3 Open Source Python Shells.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/share/20150527 3 Open Source Python Shells.md b/sources/share/20150527 3 Open Source Python Shells.md index c510096670..65102bd1bc 100644 --- a/sources/share/20150527 3 Open Source Python Shells.md +++ b/sources/share/20150527 3 Open Source Python Shells.md @@ -1,3 +1,4 @@ +translating wi-cuckoo 3 Open Source Python Shells ================================================================================ Python is a high-level, general-purpose, structured, powerful, open source programming language that is used for a wide variety of programming tasks. It features a fully dynamic type system and automatic memory management, similar to that of Scheme, Ruby, Perl, and Tcl, avoiding many of the complexities and overheads of compiled languages. The language was created by Guido van Rossum in 1991, and continues to grow in popularity. @@ -96,4 +97,4 @@ via: http://www.linuxlinks.com/article/20150523032756576/PythonShells.html [1]:http://www.bpython-interpreter.org/ [2]:http://ipython.org/ -[3]:http://www.dreampie.org/ \ No newline at end of file +[3]:http://www.dreampie.org/ From f453d731320e5be89e8b7e791c8810d970fe1162 Mon Sep 17 00:00:00 2001 From: KS Date: Thu, 11 Jun 2015 14:31:19 +0800 Subject: [PATCH 337/965] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=8E=9F=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...hopping Store Using 'OpenCart' in Linux.md | 226 ------------------ 1 file changed, 226 deletions(-) delete mode 100644 sources/tech/20150527 How to Create Own Online Shopping Store Using 'OpenCart' in Linux.md diff --git a/sources/tech/20150527 How to Create Own Online Shopping Store Using 'OpenCart' in Linux.md b/sources/tech/20150527 How to Create Own Online Shopping Store Using 'OpenCart' in Linux.md deleted file mode 100644 index 39db75746a..0000000000 --- a/sources/tech/20150527 How to Create Own Online Shopping Store Using 'OpenCart' in Linux.md +++ /dev/null @@ -1,226 +0,0 @@ -wyangsun翻译中 -How to Create Own Online Shopping Store Using “OpenCart” in Linux -================================================================================ -In the Internet world we are doing everything using a computer. Electronic Commerce aka e-commerce is one one of them. E-Commerce is nothing new and it started in the early days of ARPANET, where ARPANET used to arrange sale between students of Massachusetts Institute of Technology and Stanford Artificial Intelligence Laboratory. - -These days there are some 100’s of E-Commerce site viz., Flipcart, eBay, Alibaba, Zappos, IndiaMART, Amazon, etc. Have you thought of making your own Amazon and Flipcart like web-based Application Server? If yes! This article is for you. - -Opencart is a free and open source E-Commerce Application written in PHP, which can be used to develop a shopping cart system similar to Amazon and Flipcart. If you want to sell your products online or want to serve your customers even when you are closed Opencart is for you. You can build a successful online store (for online merchants) using reliable and professional Opencart Application. - -### OpenCart Web Panel Demo ### - -- Store Front – [http://demo.opencart.com/][1] -- Admin Login – [http://demo.opencart.com/admin/][2] - - ------------------ Admin Login ------------------ - Username: demo - Password: demo - -#### Features of Opencart #### - -Opencart is an application that meets all the requirements of an online merchant. It has all the features (see below) using which you can make your own E-Commerce Website. - -- It is a Free (as in beer) and Open Source (as in speech) Application released under GNU GPL License. -- Everything is well documented, means you don’t need to Google and shout for help. -- Free Life time support and updates. -- Unlimited number of categories, Products and manufacturer supported. -- Everything is Template based. -- Multi-Language and Multi-Currency Supported. It ensures your product gets a global reach. -- Built-in Product Review and Rating Features. -- Downloadable Products (viz., ebook) supported. -- Automatic Image Resizing supported. -- Features like Multi tax Rates (as in various country), Viewing Related Products, Information Page, Shipping Weight Calculation, Availing Discount Coupons, etc are well implemented by default. -- Built-in Backup and Restore tools. -- Well implemented SEO. -- Invoice Printing, Error Log and sales report are supported as well. - -#### System Requirements #### - -- Web Server (Apache HTTP Server Preferred) -- PHP (5.2 and above). -- Database (MySQLi Preferred but I am using MariaDB). - -#### Required PHP Libraries and Modules #### - -These extensions must be installed and enabled on your system to install Opencart properly on the web server. - -- Curl -- Zip -- Zlib -- GD Library -- Mcrypt -- Mbstrings - -### Step 1: Installing Apache, PHP and MariaDB ### - -1. As I said, OpenCart requires certain technical requirements such as Apache, PHP with extensions and Database (MySQL or MariaDB) to be installed on the system, in order to run Opencart properly. - -Let’s install Apache, PHP and MariaDB using following Command. - -**Install Apache** - - # apt-get install apache2 (On Debian based Systems) - # yum install httpd (On RedHat based Systems) - -**Install PHP and Extensions** - - # apt-get install php5 libapache2-mod-php5 php5-curl php5-mcrypt (On Debian based Systems) - # yum install php php-mysql php5-curl php5-mcrypt (On RedHat based Systems) - -**Install MariaDB** - - # apt-get install mariadb-server mariadb-client (On Debian based Systems) - # yum install mariadb-server mariadb (On RedHat based Systems) - -2. After installing all the above required things, you can start the Apache and MariaDB services using following commands. - - ------------------- On Debian based Systems ------------------- - # systemctl restart apache2.service - # systemctl restart mariadb.service - ----------- - - ------------------- On RedHat based Systems ------------------- - # systemctl restart httpd.service - # systemctl restart mariadb.service - -### Step 2: Downloading and Setting OpenCart ### - -3. The most recent version of OpenCart (2.0.2.0) can be obtained from [OpenCart website][3] or directly from github. - -Alternatively, you may use following wget command to download the latest version of OpenCart directly from github repository as shown below. - - # wget https://github.com/opencart/opencart/archive/master.zip - -4. After downloading zip file, copy to Apache Working directory (i.e. /var/www/html) and unzip the master.zip file. - - # cp master.zip /var/www/html/ - # cd /var/www/html - # unzip master.zip - -5. After extracting ‘master.zip‘ file, cd to extracted directory and move the content of upload directory to the root of the application folder (opencart-master). - - # cd opencart-master - # mv -v upload/* ../opencart-master/ - -6. Now you need to rename or copy OpenCart configuration files as shown below. - - # cp /var/www/html/opencart-master/admin/config-dist.php /var/www/html/opencart-master/admin/config.php - # cp /var/www/html/opencart-master/config-dist.php /var/www/html/opencart-master/config.php - -7. Next, set correct Permissions to the files and folders of /var/www/html/opencart-master. You need to provide RWX permission to all the files and folders there, recursively. - - # chmod 777 -R /var/www/html/opencart-master - -**Important**: Setting permission 777 may be dangerous, so as soon as you finish setting up everything, revert back to permission 755 recursively on the above folder. - -### Step 3: Creating OpenCart Database ### - -8. Next step is to create a database (say opencartdb) for the E-Commerce site to store data on the database. Connect to databaser server and create a database, user and grant correct privileges on the user to have full control over the database. - - # mysql -u root -p - CREATE DATABASE opencartdb; - CREATE USER 'opencartuser'@'localhost' IDENTIFIED BY 'mypassword'; - GRANT ALL PRIVILEDGES ON opencartdb.* TO 'opencartuser'@'localhost' IDENTIFIED by 'mypassword'; - -### Step 4: OpenCart Web Installation ### - -9. Once everything set correctly, navigate to the web browser and type `http://` to access the OpenCart web installation. - -Click ‘CONTINUE‘ to Agree the License Agreement. - -![Accept OpenCart License](http://www.tecmint.com/wp-content/uploads/2015/05/OpenCart-License.png) - -Accept OpenCart License - -10. The next screen is Pre-installation Server Setup Check, to see that the server has all the required modules are installed properly and have correct permission on the OpenCart files. - -If any red marks are highlighted on #1 or #2, that means you need to install those components properly on the server to meet web server requirements. - -If there are any red marks on #3 or #4, that means there is issue with your files. If everything is correctly configured you should see all green marks are visible (as seen below), you may press “Continue“. - -![Server Requirement Check](http://www.tecmint.com/wp-content/uploads/2015/05/Server-Checkup.png) - -Server Requirement Check - -11. On the next screen enter your Database Credentials like Database Driver, Hostname, User-name, Password, database. You should not touch db_port and Prefix, until and unless you know what you are doing. - -Also Enter User_name, Password and Email Address for Administrative account. Note these credentials will be used for logging in to Opencart Admin Panel as root, so keep it safe. Click continue when done! - -![OpenCart Database Details](http://www.tecmint.com/wp-content/uploads/2015/05/OpenCart-Database.png) - -OpenCart Database Details - -12. The next screen shows message like “Installation Complete” with the Tag Line Ready to Start Selling. Also it warns to delete the installation directory, as everything required to setup using this directory has been accomplished. - -![OpenCart Installation Completes](http://www.tecmint.com/wp-content/uploads/2015/05/OpenCart-Installation-Completes.png) - -OpenCart Installation Completes - -To Remove install directory, you may like to run the below command. - - # rm -rf /var/www/html/opencart-master/install - -### Step 4: Access OpenCart Web and Admin ### - -13. Now point your browser to `http:///opencart-master/` and you would see something like the below screenshot. - -![OpenCart Product Showcase](http://www.tecmint.com/wp-content/uploads/2015/05/OpenCart.jpg) - -OpenCart Product Showcase - -14. In order to login to Opencart Admin Panel, point your browser to http:///opencart-master/admin and fill the Admin Credentials you input, while setting it up. - -![OpenCart Admin Login](http://www.tecmint.com/wp-content/uploads/2015/05/OpenCart-Admin-Login.png) - -OpenCart Admin Login - -15. If everything ok! You should be able to see the Admin Dashboard of Opencart. - -![OpenCart Dashboard](http://www.tecmint.com/wp-content/uploads/2015/05/OpenCart-Dashboard.png) - -OpenCart Dashboard - -Here in Admin Dashboard you may set up a lots of options like categories, product, options, Manufacturers, Downloads, Review, Information, Extension Installer, Shipping, Payment options, order totals, gift voucher, Paypal, Coupons, Affiliates, marketing, mails, Design and Settings, Error logs, in-built analytics and what not. - -#### What after testing the tools? #### - -If you have already tested the Application and finds it customizable, flexible, Rock Solid, Easy to maintain and use, you may need a good hosting provider to host OpenCart application, that remains live 24X7 support. Though there are a lot of options for hosting providers we recommend Hostgator. - -Hostgator is a Domain Registrant and Hosting Provider that is very well known for the service and feature it provides. It Provides you with UNLIMITED Disk Space, UNLIMITED Bandwidth, Easy to install (1-click install script), 99.9% Uptime, Award winning 24x7x365 Technical Support and 45 days money back guarantee, which means if you didn’t like the product and service you get your money back within 45 days of purchasing and mind it 45 days is a long time to Test. - -So if you have something to sell you can do it for free (by free I mean, Think of the cost you would spend on getting a physical store and then compare it with virtual store setting-up cost. You will feel its free). - -**Note**: When you buy hosting (and/or Domain) from Hostgator you will get a **Flat 25% OFF**. This offer is valid only for the readers of Tecmint Site. - -All you have to do is to Enter Promocode “**TecMint025**” during the payment of hosting. For reference see the preview of payment screen with promo code. - -![Hostgator 25% Discount - TecMint025](http://www.tecmint.com/wp-content/uploads/2015/05/Hostgator-Discount-Code.png) - -[Sign up for Hostgator][4] (Coupon code: TecMint025) - -**Note**: Also worth mentioning, that for each hosting you buy from Hostgator to host OpenCart, we will get a small amount of commission, just to keep Tecmint Live (by Paying Bandwidth and hosting charges of server). - -So If you buy it using the above code, you get discount and we will get a small amount. Also note that you won’t pay anything extra, infact you will be paying 25% less on total bill. - -### Conclusion ### - -OpenCart is an application that performs out-of-the box. It is easy to install and you have the option to choose best suited templates, add your products and you become an online merchant. - -A lots of community made extensions(free and paid) makes it rich. It is a wonderful application for those who want to setup a virtual store and remain accessible to their customer 24X7. Let me know yours experience with the application. Any suggestion and feedback is welcome as well. - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/create-e-commerce-online-shopping-store-using-opencart-in-linux/ - -作者:[Avishek Kumar][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.tecmint.com/author/avishek/ -[1]:http://demo.opencart.com/ -[2]:http://demo.opencart.com/admin/ -[3]:http://www.opencart.com/index.php?route=download/download/ -[4]:http://secure.hostgator.com/%7Eaffiliat/cgi-bin/affiliates/clickthru.cgi?id=tecmint From 1fd642f5a94c97c450fcf984f3f4c9df971ed553 Mon Sep 17 00:00:00 2001 From: NearTan Date: Thu, 11 Jun 2015 14:40:06 +0800 Subject: [PATCH 338/965] translated --- ...irectionally from Command Line Using 'Speedtest-CLI' Tool.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20150316 How to Test Your Internet Speed Bidirectionally from Command Line Using 'Speedtest-CLI' Tool.md b/sources/tech/20150316 How to Test Your Internet Speed Bidirectionally from Command Line Using 'Speedtest-CLI' Tool.md index a0c77c21f9..45372c86fd 100644 --- a/sources/tech/20150316 How to Test Your Internet Speed Bidirectionally from Command Line Using 'Speedtest-CLI' Tool.md +++ b/sources/tech/20150316 How to Test Your Internet Speed Bidirectionally from Command Line Using 'Speedtest-CLI' Tool.md @@ -1,3 +1,5 @@ +translating by NearTan + How to Test Your Internet Speed Bidirectionally from Command Line Using ‘Speedtest-CLI’ Tool ================================================================================ We always need to check the speed of the Internet connection at home and office. What we do for this? Go to websites like Speedtest.net and begin test. It loads JavaScript in the web browser and then select best server based upon ping and output the result. It also uses a Flash player to produce graphical results. From ea056f5703a2e9e68db505fa144fc8565fd0e23f Mon Sep 17 00:00:00 2001 From: NearTan Date: Thu, 11 Jun 2015 14:41:10 +0800 Subject: [PATCH 339/965] translating --- ...irectionally from Command Line Using 'Speedtest-CLI' Tool.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20150316 How to Test Your Internet Speed Bidirectionally from Command Line Using 'Speedtest-CLI' Tool.md b/sources/tech/20150316 How to Test Your Internet Speed Bidirectionally from Command Line Using 'Speedtest-CLI' Tool.md index 45372c86fd..601a89151d 100644 --- a/sources/tech/20150316 How to Test Your Internet Speed Bidirectionally from Command Line Using 'Speedtest-CLI' Tool.md +++ b/sources/tech/20150316 How to Test Your Internet Speed Bidirectionally from Command Line Using 'Speedtest-CLI' Tool.md @@ -1,4 +1,4 @@ -translating by NearTan +translating by NearTan How to Test Your Internet Speed Bidirectionally from Command Line Using ‘Speedtest-CLI’ Tool ================================================================================ From ebdc92f3840ad4e29976dbac5a6193001880b30e Mon Sep 17 00:00:00 2001 From: wxy Date: Thu, 11 Jun 2015 15:24:45 +0800 Subject: [PATCH 340/965] PUB:20150527 How to Create Own Online Shopping Store Using 'OpenCart' in Linux MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @wyangsun https://linux.cn/article-5609-1.html 翻译的不错,有些细节需要校对。另外必要时,应该将英文习惯的倒装语句换成中文习惯。 --- ...hopping Store Using 'OpenCart' in Linux.md | 226 ++++++++++++++++++ ...hopping Store Using 'OpenCart' in Linux.md | 224 ----------------- 2 files changed, 226 insertions(+), 224 deletions(-) create mode 100644 published/20150527 How to Create Own Online Shopping Store Using 'OpenCart' in Linux.md delete mode 100644 translated/tech/20150527 How to Create Own Online Shopping Store Using 'OpenCart' in Linux.md diff --git a/published/20150527 How to Create Own Online Shopping Store Using 'OpenCart' in Linux.md b/published/20150527 How to Create Own Online Shopping Store Using 'OpenCart' in Linux.md new file mode 100644 index 0000000000..e726ca1100 --- /dev/null +++ b/published/20150527 How to Create Own Online Shopping Store Using 'OpenCart' in Linux.md @@ -0,0 +1,226 @@ +如何在linux中用“OpenCart”创建自己的在线商店 +================================================================================ +在网络世界我们可以用电脑做所有事情,电子商务(e-commerce)即是其中之一。电子商务并不是什么新鲜事,它起源于早期的阿帕网,当时就出现了麻省理工学院和斯坦福大学人工智能实验室的学生之间的交易。 + +近些年出现了上百家电子商务网站,如 Flipcart, eBay, Alibaba, Zappos, IndiaMART, Amazon, 等等。你想做一个自己的亚马逊和Flipcart这样的基于web的应用程序服务器吗?如果是!这个文章正适合你。 + +Opencart是一个免费开源的使用PHP语言编写的电子商务程序,它可以用来架设一个类似于亚马逊和Flipcart的购物车系统。如果你想在线卖你的产品或想在关门时为你的客户提供服务,Opencart就是给你准备的。你可以使用可靠和专业Opencart应用程序建立一个成功的网上商店(网上商家)。 + +### OpenCart 网页面板演示 ### + +- 商店前端 – [http://demo.opencart.com/][1] +- 管理登录 – [http://demo.opencart.com/admin/][2] + +-- + ------------------ 管理登录 ------------------ + + 用户名: demo + 密码: demo + +#### Opencart的特点 #### + +Opencart是一个符合所有在线商家需求的应用程序。它具备您用来制作自己的电子商务网站的所有特性(见下文)。 + +- 它是一个免费(如啤酒般免费)而开源(如言论般自由)的应用,在GNU GPL许可下发布。 +- 每个东西都有完善的文档,你不需要到谷歌喊救命。 +- 任意时间的支持和更新。 +- 支持无限数量的类别、产品和制造商。 +- 一切都是基于模板的。 +- 支持多语言和多币种。它确保你的产品遍及全球。 +- 内置产品评论和评级功能。 +- 支持可下载的产品(即电子书)。 +- 支持自动缩放图像。 +- 类似多税率(许多国家都是这样)、查看相关产品、资料页、装船重量计算,使用折扣优惠券,等等功能默认都有了。 +- 内置的备份和恢复工具。 +- 搜索引擎优化做的很好。 +- 发票打印、错误日志和销售报告等都做的很好。 + +#### 系统需求 #### + +- Web 服务器 (首选 Apache HTTP服务器) +- PHP (5.2 或以上) +- 数据库 (首选MySQL,但是我这里用的是MariaDB) + +#### PHP需要的库和模块 #### + +这些扩展必须在您的系统上安装并启用,才能确保Opencart正确安装在web服务器上 + +- Curl +- Zip +- Zlib +- GD Library +- Mcrypt +- Mbstrings + +### 第一步: 安装 Apache、 PHP 和 MariaDB ### + +1. 像我说的,OpenCart需要一定的技术要求,比如在系统上安装Apache,PHP扩展和数据库(MySQL或MariaDB),才能正常运行Opencart。 + + 让我们使用命令行安装Apache,PHP和MariaDB。 + + **安装 Apache** + + # apt-get install apache2 (在基于Debian系统上) + # yum install httpd (在基于RedHat系统上) + + **安装 PHP and Extensions** + + # apt-get install php5 libapache2-mod-php5 php5-curl php5-mcrypt (在基于Debian系统上) + # yum install php php-mysql php5-curl php5-mcrypt (在基于RedHat系统上) + + **安装 MariaDB** + + # apt-get install mariadb-server mariadb-client (在基于Debian系统上) + # yum install mariadb-server mariadb (在基于RedHat系统上) + +2. 在安装所有需要上面的东西后,你可以使用如下命令启动 Apache 和 MariaDB 服务。 + + ------------------- 在基于Debian系统上 ------------------- + # systemctl restart apache2.service + # systemctl restart mariadb.service + + -- + ------------------- 在基于RedHat系统上 ------------------- + # systemctl restart httpd.service + # systemctl restart mariadb.service + +### 第二步:下载和设置 OpenCart ### + +3. 最新版本的OpenCart(2.0.2.0)可以从[OpenCart 网站][3]下载,或直接从github获得。 + + 作为一种选择,你可以使用wget命令直接从github库下载最新版本的OpenCart,如下所示。 + + # wget https://github.com/opencart/opencart/archive/master.zip + +4. 下载压缩文件后,拷贝到Apache工作目录下(例如/var/www/html)然后解压缩master.zip文件。 + + # cp master.zip /var/www/html/ + # cd /var/www/html + # unzip master.zip + +5. 提取‘master.zip’文件后,切换到提取目录下,然后移动upload目录到应用程序的根文件夹(opencart-master) + + # cd opencart-master + # mv -v upload/* ../opencart-master/ + +6. 现在需要重命名或复制OpenCart配置文件,如下所示。 + + # cp /var/www/html/opencart-master/admin/config-dist.php /var/www/html/opencart-master/admin/config.php + # cp /var/www/html/opencart-master/config-dist.php /var/www/html/opencart-master/config.php + +7. 下一步,设置/var/www/html/opencart-master的文件和文件夹正确的权限。您需要提供RWX权限给文件和文件夹,用递归方式。 + + # chmod 777 -R /var/www/html/opencart-master + + **重要**: 设置权限777可能是危险的,所以一旦你完成所有设置,递归恢复755权限到上层的文件夹。 + +### 第三步: 创建 OpenCart 数据库 ### + +8. 下一步是给你的电子商务网站创建一个数据库(比如叫做 opencartdb)来存储数据。连接到数据库服务器并创建一个数据库和用户,并授予用户正确的权限以完全控制该数据库。 + + # mysql -u root -p + CREATE DATABASE opencartdb; + CREATE USER 'opencartuser'@'localhost' IDENTIFIED BY 'mypassword'; + GRANT ALL PRIVILEDGES ON opencartdb.* TO 'opencartuser'@'localhost' IDENTIFIED by 'mypassword'; + +### 第四步: OpenCart 网站安装 ### + +9. 一旦所有设置正确,到web浏览器地址栏输入`http://`访问OpenCart web安装。 + + 点击“继续”,同意许可证协议。 + + ![Accept OpenCart License](http://www.tecmint.com/wp-content/uploads/2015/05/OpenCart-License.png) + + *同意OpenCart许可证* + +10. 下一个屏幕是安装前服务器设置检查,查看服务器所需的所有模块是否安装正确并且有OpenCart文件的权限。 + + 如果在第1和2区域有红色标志突出显示,这意味着你需要在服务器上正确安装这些组件满足web服务器的要求。 + + 如果在第3和4区域有红色标志突出显示,这意味着你的文件有问题。如果一切正确配置您应该看到所有都是绿色标志(见下面),你可以按“继续”。 + + ![Server Requirement Check](http://www.tecmint.com/wp-content/uploads/2015/05/Server-Checkup.png) + + *服务器需求检查* + +11. 在下一个屏幕上输入数据库凭证信息,如数据库驱动类型、主机名、用户名、密码、数据库。你不应该改动数据库端口和前缀,除非你知道你在做什么。 + + 另外输入管理员账号的用户名、密码和邮箱地址。注意这些凭证将用于管理员登录到Opencart管理面板,所以保证它的安全。完成后单击继续! + + ![OpenCart Database Details](http://www.tecmint.com/wp-content/uploads/2015/05/OpenCart-Database.png) + + *OpenCart数据库详情* + +12. 下一个屏幕显示的信息如“Installation Complete”和“Ready to Start Selling”。这里还警告说,要记得删除安装目录,所有需要这个目录安装的设置已经完成。 + + ![OpenCart Installation Completes](http://www.tecmint.com/wp-content/uploads/2015/05/OpenCart-Installation-Completes.png) + + *OpenCart安装完成* + + 删除安装目录,你可以执行下面的命令。 + + # rm -rf /var/www/html/opencart-master/install + +### 第四步: 进入OpenCart 及其管理界面 ### + +13. 现在打开浏览器到`http:///opencart-master/`然后你会看到类似下面的截屏。 + + ![OpenCart Product Showcase](http://www.tecmint.com/wp-content/uploads/2015/05/OpenCart.jpg) + + *OpenCart产品示例* + +14. 要登录到Opencart管理面板,你需要浏览`http:///opencart-master/admin`然后填写之前设置的凭证。 + + ![OpenCart Admin Login](http://www.tecmint.com/wp-content/uploads/2015/05/OpenCart-Admin-Login.png) + + *OpenCart管理登录* + +15. 如果全部OK你应该可以看到Opencart的控制台。 + + ![OpenCart Dashboard](http://www.tecmint.com/wp-content/uploads/2015/05/OpenCart-Dashboard.png) + + *OpenCart控制台* + + 在管理控制台可以设置很多选项,如类别、产品、选择、制造商、下载、评论、信息、扩展安装、运输、付款选项、订单总数、礼品券、贝宝、优惠券、子公司、营销、邮件、设计风格和设置、错误日志、内置分析等等。 + +#### 测试了这个工具之后呢? #### + +如果您已经测试了这个应用程序,就会发现它可定制、灵活、稳定、易于维护和使用,您可能需要一个好的主机托管提供商托管你的OpenCart应用,以便保持24 x7的在线支持。尽管有很多选择,我们建议Hostgator主机提供商。(广告硬植-.-!,以下硬广和 LCTT 无关~) + +Hostgator是以服务和功能出名的域名注册和虚拟机托管提供商。它为你提供无限的磁盘空间、无限带宽、易于安装(一键安装脚本)、99.9%的正常运行时间、荣获24x7x365技术支持和45天退款保证,这意味着如果你不喜欢这个产品和服务就可以在45天内拿回你的采购费,注意这45天是一个长的测试时间。 + +所以如果你有什么想卖的你可以免费地去做了(我的意思是免费,想想你会花在实体存储上的费用,然后比较其与建设虚拟商店的成本。你就会感受到它的免费了)。 + +**注**: 当你从Hostgator购买虚拟主机(和/或域名)你将获得一个**25%折扣**。这只提供给Tecmint网站的读者。 + +你所要做的就是在购买虚拟机支付时输入优惠码“**TecMint025**”。付款预览截屏优惠码以供参考用。 + +![Hostgator 25% Discount - TecMint025](http://www.tecmint.com/wp-content/uploads/2015/05/Hostgator-Discount-Code.png) + +*[注册 Hostgator][4] (折扣码: TecMint025)* + +**注**: 还值得一提的,每个你从Hostgator购买的托管OpenCart的虚拟机,我们将得到少量的佣金,只是为了保持Tecmint存活 (通过支付带宽和托管服务器)。 + +所以如果你使用上面的代码买它,你得到折扣,我们会得到少量收入。还要注意,你不会支付任何额外的费用,事实上你支付的账单总额将减少25%。 + +### 总结 ### + +OpenCart是一个开箱可用的应用。它易于安装,您可以选择选择最适合的模板,添加你的产品然后你就成为了一个在线店主。 + +很多社区开发的扩展(有免费和付费的)使它变得丰富。这是一个给那些想要建立一个保持24X7小时用户可访问的虚拟商店的美妙应用。让我们知道你对这个应用程序的体验吧。欢迎任何建议和反馈。 + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/create-e-commerce-online-shopping-store-using-opencart-in-linux/ + +作者:[Avishek Kumar][a] +译者:[wyangsun](https://github.com/wyangsun) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/avishek/ +[1]:http://demo.opencart.com/ +[2]:http://demo.opencart.com/admin/ +[3]:http://www.opencart.com/index.php?route=download/download/ +[4]:http://secure.hostgator.com/%7Eaffiliat/cgi-bin/affiliates/clickthru.cgi?id=tecmint diff --git a/translated/tech/20150527 How to Create Own Online Shopping Store Using 'OpenCart' in Linux.md b/translated/tech/20150527 How to Create Own Online Shopping Store Using 'OpenCart' in Linux.md deleted file mode 100644 index e506f76f7c..0000000000 --- a/translated/tech/20150527 How to Create Own Online Shopping Store Using 'OpenCart' in Linux.md +++ /dev/null @@ -1,224 +0,0 @@ -如何在linux中用“OpenCart”创建自己的在线商店 -================================================================================ -在网络世界我们用电脑做所有事情。用电子设备完成的商务也叫电子商务即是其中之一。电子商务并不是什么新鲜事,它起源于早期的阿帕网,阿帕网用来安排麻省理工学院和斯坦福大学人工智能实验室学生之间的拍卖。 - -最近出现了上百家电子商务网站也就是, Flipcart, eBay, Alibaba, Zappos, IndiaMART, Amazon, 等等。你想制作自己的亚马逊和Flipcart这样基于web的应用程序服务器吗?如果是!这个文章正适合你。 - -Opencart是一个免费开源的使用PHP语言的电子商务程序,它可以用来开发一个购物车系统类似于亚马逊和Flipcart。如果你想在线卖你的产品或想在关门时为你的客户提供服务Opencart是给你准备的。你可以使用可靠和专业Opencart应用程序建立一个成功的网上商店(网上商家)。 - -### OpenCart 网页面板演示 ### - -- 商店前端 – [http://demo.opencart.com/][1] -- 管理登陆 – [http://demo.opencart.com/admin/][2] - - ------------------ 管理 登陆 ------------------ - 用户名: demo - 密码: demo - -#### Opencart的特点 #### - -Opencart是一个符合所有在线商家需求的应用程序。您可以使用它的所有特性(见下文)制作自己的电子商务网站。 - -- 它是一个免费的(如啤酒)和开源(如言论)应用GNU GPL许可下发布。 -- 一切都是有据可查的,意味着你不需到要谷歌喊救命。 -- 自由生活的时间支持和更新。 -- 无限数量的类别、产品和制造商的支持。 -- 一切都是基于模板的。 -- 支持多语言和多币种。它确保你的产品遍及全球。 -- 内置产品评论和评级功能。 -- 可下载的产品(即电子书)支持 -- 自动调整图像的支持。 -- 功能,如多税率(如各种国家),查看相关产品,资料页,装船重量计算,使用折扣优惠券,等等是默认实现的。 -- 内置的备份和恢复工具。 -- 实施搜索引擎优化。 -- 发票打印,也支持错误日志和销售报告。 - -#### 系统需求 #### - -- Web 服务器 (Apache HTTP服务器的首选) -- PHP (5.2 或以上). -- 数据库 (首选MySQL但是我用MariaDB). - -#### PHP需要的库和模块 #### - -这些扩展必须在您的系统上安装并启用确保web服务器上安装Opencart正确 - -- Curl -- Zip -- Zlib -- GD Library -- Mcrypt -- Mbstrings - -### 第一步: 安装 Apache, PHP 和 MariaDB ### - -1. 像我说的,OpenCart需要一定的技术要求比如在系统上安装Apache,PHP扩展和数据库(MySQL或MariaDB),为了运行Opencart正常。 - -让我们使用命令行安装Apache,PHP和MariaDB。 - -**安装 Apache** - - # apt-get install apache2 (在基于Debian系统上) - # yum install httpd (在基于RedHat系统上) - -**安装 PHP and Extensions** - - # apt-get install php5 libapache2-mod-php5 php5-curl php5-mcrypt (在基于Debian系统上) - # yum install php php-mysql php5-curl php5-mcrypt (在基于RedHat系统上) - -**安装 MariaDB** - - # apt-get install mariadb-server mariadb-client (在基于Debian系统上) - # yum install mariadb-server mariadb (在基于RedHat系统上) - -2. 在安装所有需要上面的东西后, you can start the Apache and MariaDB services using following commands. - - ------------------- 在基于Debian系统上 ------------------- - # systemctl restart apache2.service - # systemctl restart mariadb.service - - - ------------------- 在基于RedHat系统上 ------------------- - # systemctl restart httpd.service - # systemctl restart mariadb.service - -### 第二步: 下载和设置 OpenCart ### - -3. 最新版本的OpenCart(2.0.2.0)可以从[OpenCart website][3]或直接从github获得。 - -作为一种选择,你可以使用wget命令直接从github库下载最新版本的OpenCart,如下所示。 - - # wget https://github.com/opencart/opencart/archive/master.zip - -4. 下载压缩文件后,拷贝到Apache工作目录下(例如/var/www/html)然后解压缩master.zip文件。 - - # cp master.zip /var/www/html/ - # cd /var/www/html - # unzip master.zip - -5. 提取‘master.zip’文件后,切换到提取目录下然后移动upload目录到应用程序的根文件夹(opencart-master) - - # cd opencart-master - # mv -v upload/* ../opencart-master/ - -6. 现在需要重命名或复制OpenCart配置文件如下所示。 - - # cp /var/www/html/opencart-master/admin/config-dist.php /var/www/html/opencart-master/admin/config.php - # cp /var/www/html/opencart-master/config-dist.php /var/www/html/opencart-master/config.php - -7. 下一步,设置/var/www/html/opencart-master的文件和文件夹正确的权限。您需要提供RWX权限给文件和文件夹,用递归方式。 - - # chmod 777 -R /var/www/html/opencart-master - -**重要**: 设置权限777可能是危险的,所以一旦你完成所有设置,递归恢复755权限到上层的文件夹。 - -### 第三步: 创建 OpenCart 数据库 ### - -8. 下一步是创建一个数据库(例如opencartdb)电子商务网站数据库来存储数据。连接到数据库服务器并创建一个数据库,用户和正确的权限授予用户完全控制数据库。 - - # mysql -u root -p - CREATE DATABASE opencartdb; - CREATE USER 'opencartuser'@'localhost' IDENTIFIED BY 'mypassword'; - GRANT ALL PRIVILEDGES ON opencartdb.* TO 'opencartuser'@'localhost' IDENTIFIED by 'mypassword'; - -### 第四步: OpenCart 网站安装 ### - -9. 一旦所有设置正确,到web浏览器地址栏输入`http://`访问OpenCart web安装。 - -点击“继续”,同意许可证协议。 - -![Accept OpenCart License](http://www.tecmint.com/wp-content/uploads/2015/05/OpenCart-License.png) - -同意OpenCart许可证 - -10. 下一个屏幕是安装前检查服务器设置,查看服务器所需的所有模块安装正确并且有OpenCart文件的权限。 - -如果有红色标志突出显示#1或#2,这意味着你需要在服务器上正确安装这些组件满足web服务器的要求。 - -如果有红色标志突出显示#3或#4,这意味着你的文件有问题。如果一切正确配置您应该看到所有绿色标志是可见的(见下面),你可以按“继续”。 - -![Server Requirement Check](http://www.tecmint.com/wp-content/uploads/2015/05/Server-Checkup.png) - -服务器需求检查 - -11. 在下一个屏幕上输入数据库证书如数据库驱动程序,主机名、用户名、密码、数据库。你不应该改动数据库端口和前缀,除非你知道你在做什么。 - -另外输入管理员账号的用户名,密码和邮箱地址。注意这些凭据将用于root登录到Opencart管理面板,所以保证它的安全。完成后单击继续! - -![OpenCart Database Details](http://www.tecmint.com/wp-content/uploads/2015/05/OpenCart-Database.png) - -OpenCart数据库详情 - -12. 下一个屏幕显示的信息如“Installation Complete”与“Ready to Start Selling”为结束行。还警告说,删除安装目录,所有需要这个目录安装的设置已经完成。 - -![OpenCart Installation Completes](http://www.tecmint.com/wp-content/uploads/2015/05/OpenCart-Installation-Completes.png) - -OpenCart安装完成 - -删除安装目录,你可以执行下面的命令。 - - # rm -rf /var/www/html/opencart-master/install - -### 第四步: 进入OpenCart页管理 ### - -13. 现在打开浏览器到`http:///opencart-master/`然后你会看到类似下面的截屏。 - -![OpenCart Product Showcase](http://www.tecmint.com/wp-content/uploads/2015/05/OpenCart.jpg) - -OpenCart产品示例 - -14. 为了登陆到Opencart管理面板,你需要浏览http:///opencart-master/admin然后填写通行证,同时设置它启动。 - -![OpenCart Admin Login](http://www.tecmint.com/wp-content/uploads/2015/05/OpenCart-Admin-Login.png) - -OpenCart管理登陆 - -15. 如果全部OK你应该可以看到Opencart的控制台。 - -![OpenCart Dashboard](http://www.tecmint.com/wp-content/uploads/2015/05/OpenCart-Dashboard.png) - -OpenCart控制台 - -在管理控制台可以建立很多选项如类别,产品选择,制造商、下载、评论,信息,扩展安装,运输,付款选项,订单总数、礼品券、贝宝、优惠券、子公司、营销、邮件、设计和设置,错误日志,内置分析等等。 - -#### 测试工具之后? #### - -如果您已经测试了应用程序和发现它可定制,灵活,坚如磐石,易于维护和使用,您可能需要一个好的主机托管提供商托管OpenCart应用,保持在线24 x7的支持。尽管有很多选项,我们建议Hostgator主机提供商。(广告硬植-.-!) - -Hostgator是以服务和特性出名的域名注册和虚拟机托管提供商。它为你提供无限的磁盘空间,无限带宽,易于安装(一键安装脚本),99.9%的正常运行时间,荣获24x7x365技术支持和45天退款保证,这意味着如果你不喜欢这个产品和服务在45天内拿回你的采购费,注意这45天是一个长的测试时间。 - -所以如果你有什么想卖的你可以自由做它(我的意思是自由,想到你会花在获得物理存储成本,然后比较其与虚拟商店建立成本。你会觉得它的自由)。 - -**注**: 当你从Hostgator购买虚拟主机(和/或域名)你将获得一个**25%折扣**。这只提供给Tecmint网站的读者。 - -你所要做的就是在购买虚拟机支付时输入优惠码“**TecMint025**”。付款预览截屏优惠码以供参考用。 - -![Hostgator 25% Discount - TecMint025](http://www.tecmint.com/wp-content/uploads/2015/05/Hostgator-Discount-Code.png) - -[Sign up for Hostgator][4] (折扣码: TecMint025) - -**注**: 还值得一提的,每个你从Hostgator购买的虚拟机托管OpenCart,我们将得到少量的佣金,只是为了保持Tecmint存活 (通过支付带宽和托管服务器)。 - -所以如果你使用上面的代码买它,你得到折扣,我们会得到少量收入。还要注意,你不会支付任何额外的,事实上你支付的账单总额将减少25%。 - -### 总结 ### - -OpenCart是一个开箱可用的应用。它易于安装,您可以选择选择最适合的模板,添加你的产品然后你就成为了一个在线店主。 - -很多社区的扩展(免费和付费)使它丰富。这是一个美妙的应用为那些想要建立一个保持24X7小时用户可访问的虚拟商店。让我知道你的应用程序的经验。欢迎任何建议和反馈。 - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/create-e-commerce-online-shopping-store-using-opencart-in-linux/ - -作者:[Avishek Kumar][a] -译者:[wyangsun](https://github.com/wyangsun) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.tecmint.com/author/avishek/ -[1]:http://demo.opencart.com/ -[2]:http://demo.opencart.com/admin/ -[3]:http://www.opencart.com/index.php?route=download/download/ -[4]:http://secure.hostgator.com/%7Eaffiliat/cgi-bin/affiliates/clickthru.cgi?id=tecmint From 7b9c3ca11bb8d9d31d3322748e9e26ab72309812 Mon Sep 17 00:00:00 2001 From: ZTinoZ Date: Thu, 11 Jun 2015 16:52:32 +0800 Subject: [PATCH 341/965] Translating by ZTinoZ --- ... 20 Useful Terminal Emulators for Linux.md | 30 ++++++++++--------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/sources/tech/20150526 20 Useful Terminal Emulators for Linux.md b/sources/tech/20150526 20 Useful Terminal Emulators for Linux.md index 5d8b38e80c..4ff7820781 100644 --- a/sources/tech/20150526 20 Useful Terminal Emulators for Linux.md +++ b/sources/tech/20150526 20 Useful Terminal Emulators for Linux.md @@ -87,7 +87,7 @@ Roxterm Terminal ### 6. Eterm ### -Eterm is a lightest color terminal emulator designed as a replacement for xterm. It is developed with a Freedom of Choice ideology, leaving as much power, flexibility, and freedom as workable in the hands of the user. +Eterm是最轻量级的一款彩色终端仿真器,是作为xterm的替代品而被设计出来。它是以一种选择自由的思想、避免臃肿、灵活性和自由在用户手中是触手可及的理念而开发出来的。 ![Eterm Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/Eterm-Terminal.jpeg) @@ -97,7 +97,7 @@ Eterm Terminal ### 7. Rxvt ### -Rxvt stands for extended virtual terminal is a color terminal emulator application for Linux intended as an xterm replacement for power users who don’t need to have a feature such as Tektronix 4014 emulation and toolkit-style configurability. +代表着扩展虚拟终端的Rxvt是一款彩色终端仿真器,为那些不需要一些特性例如Tektronix 4014仿真和toolkit-style可配置性的老牌用户而生的xterm的替代品。 ![Rxvt Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/Rxvt-Terminal.jpeg) @@ -118,6 +118,7 @@ wterm Terminal ### 9. LXTerminal ### LXTerminal is a default VTE-based terminal emulator for LXDE (Lightweight X Desktop Environment) without any unnecessary dependency. The terminal has got some nice features such as. + LXTerminal Features - Multiple tabs support @@ -133,19 +134,20 @@ lxterminal Terminal ### 10. Konsole ### -Konsole is yet another powerful KDE based free terminal emulator was originally created by Lars Doelle. -Konsole Features +Konsole是另一款强大的基于KDE的免费终端仿真器,最初由Lars Doelle创造。 -- Multiple Tabbed terminals. -- Translucent backgrounds. -- Support for Split-view mode. -- Directory and SSH bookmarking. -- Customizable color schemes. -- Customizable key bindings. -- Notification alerts about activity in a terminal. -- Incremental search -- Support for Dolphin file manager -- Export of output in plain text or HTML format. +Konsole的特性 + +- 多标签式终端 +- 半透明背景 +- 支持拆分视图模式 +- 目录和SSH书签化 +- 可定制的颜色设计 +- 可定制的按键绑定 +- 终端中的活动通知警告 +- 增量搜索 +- 支持Dolphin文件管理器 +- 普通文本和HTML格式输出出口 ![Konsole Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/Konsole-Terminal.jpeg) From 4f22be057f2d3f09c6d74769ce31e4b7cc348a9e Mon Sep 17 00:00:00 2001 From: chenzhijun <522858454@qq.com> Date: Thu, 11 Jun 2015 18:51:23 +0800 Subject: [PATCH 342/965] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E5=AE=8C=E6=88=90?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...RSS feed from the command line on Linux.md | 108 ------------------ 1 file changed, 108 deletions(-) delete mode 100644 sources/tech/20150209 How to access Feedly RSS feed from the command line on Linux.md diff --git a/sources/tech/20150209 How to access Feedly RSS feed from the command line on Linux.md b/sources/tech/20150209 How to access Feedly RSS feed from the command line on Linux.md deleted file mode 100644 index 16dccd8f8e..0000000000 --- a/sources/tech/20150209 How to access Feedly RSS feed from the command line on Linux.md +++ /dev/null @@ -1,108 +0,0 @@ -translating by chenzhijun - -How to access Feedly RSS feed from the command line on Linux -================================================================================ -In case you didn't know, [Feedly][1] is one of the most popular online news aggregation services. It offers seamlessly unified news reading experience across desktops, Android and iOS devices via browser extensions and mobile apps. Feedly took on the demise of Google Reader in 2013, quickly gaining a lot of then Google Reader users. I was one of them, and Feedly has remained my default RSS reader since then. - -While I appreciate the sleek interface of Feedly's browser extensions and mobile apps, there is yet another way to access Feedly: Linux command-line. That's right. You can access Feedly's news feed from the command line. Sounds geeky? Well, at least for system admins who live on headless servers, this can be pretty useful. - -Enter [Feednix][2]. This open-source software is a Feedly's unofficial command-line client written in C++. It allows you to browse Feedly's news feed in ncurses-based terminal interface. By default, Feednix is linked with a console-based browser called w3m to allow you to read articles within a terminal environment. You can choose to read from your favorite web browser though. - -In this tutorial, I am going to demonstrate how to install and configure Feednix to access Feedly from the command line. - -### Install Feednix on Linux ### - -You can build Feednix from the source using the following instructions. At the moment, the "Ubuntu-stable" branch of the official Github repository has the most up-to-date code. So let's use this branch to build it. - -As prerequisites, you will need to install a couple of development libraries, as well as w3m browser. - -#### Debian, Ubuntu or Linux Mint #### - - $ sudo apt-get install git automake g++ make libncursesw5-dev libjsoncpp-dev libcurl4-gnutls-dev w3m - $ git clone -b Ubuntu-stable https://github.com/Jarkore/Feednix.git - $ cd Feednix - $ ./autogen.sh - $ ./configure - $ make - $ sudo make install - -#### Fedora #### - - $ sudo yum groupinstall "C Development Tools and Libraries" - $ sudo yum install gcc-c++ git automake make ncurses-devel jsoncpp-devel libcurl-devel w3m - $ git clone -b Ubuntu-stable https://github.com/Jarkore/Feednix.git - $ cd Feednix - $ ./autogen.sh - $ ./configure - $ make - $ sudo make install - -Arch Linux - -On Arch Linux, you can easily install Feednix from [AUR][3]. - -### Configure Feednix for the First Time ### - -After installing it, launch Feednix as follows. - - $ feednix - -The first time you run Feednix, it will pop up a web browser window, where you need to sign up to create a Feedly's user ID and its corresponding developer access token. If you are running Feednix in a desktop-less environment, open a web browser on another computer, and go to https://feedly.com/v3/auth/dev. - -![](https://farm8.staticflickr.com/7427/15825106524_42883b3e32_b.jpg) - -Once you sign in, you will see your Feedly user ID generated. - -![](https://www.flickr.com/photos/xmodulo/15827565143/) - -To retrieve an access token, you need to follow the token link sent to your email address in your browser. Only then will you see the window showing your user ID, access token, and its expiration date. Be aware that access token is quite long (more than 200 characters). The token appears in a horizontally scrollable text box, so make sure to copy the whole access token string. - -![](https://farm9.staticflickr.com/8605/16446685812_9098df494b_b.jpg) - -Paste your user ID and access token into the Feednix' command-line prompt. - - [Enter User ID] >> XXXXXX - [Enter token] >> YYYYY - -After successful authentication, you will see an initial Feednix screen with two panes. The left-side "Categories" pane shows a list of news categories, while the right-side "Posts" pane displays a list of news articles in the current category. - -![](https://farm8.staticflickr.com/7412/16421639256_deb8e2d276_c.jpg) - -### Read News in Feednix ### - -Here I am going to briefly describe how to access Feedly via Feednix. - -#### Navigate Feednix #### - -As I mentioned, the top screen of Feednix consists of two panes. To switch focus between the two panes, use TAB key. To move up and down the list within a pane, use 'j' and 'k' keys, respectively. These keyboard shorcuts are obviously inspired by Vim text editor. - -#### Read an Article #### - -To read a particular article, press 'o' key at the current article. It will invoke w2m browser, and load the article inside the browser. Once you are done reading, press 'q' to quit the browser, and come back to Feednix. If your environment can open a web browser, you can press 'O' to load an article on your default web browser such as Firefox. - -![](https://farm8.staticflickr.com/7406/16445870201_b98e8da6d9_b.jpg) - -#### Subscribe to a News Feed #### - -You can add any arbitrary RSS news feed to your Feedly account from Feednix interface. To do so, simply press 'a' key. This will show "[ENTER FEED]:" prompt at the bottom of the screen. After typing the RSS feed, go ahead and fill in the name of the feed and its preferred category. - -![](https://farm8.staticflickr.com/7324/16421639296_b52ed3c52e_c.jpg) - -#### Summary #### - -As you can see, Feednix is a quite convenient and easy-to-use command-line RSS reader. If you are a command-line junkie as well as a regular Feedly user, Feednix is definitely worth trying. I have been communicating with the creator of Feednix, Jarkore, to troubleshoot some issue. As far as I can tell, he is very active in responding to bug reports and fixing bugs. I encourage you to try out Feednix and let him know your feedback. - --------------------------------------------------------------------------------- - -via: http://xmodulo.com/feedly-rss-feed-command-line-linux.html - -作者:[Dan Nanni][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://xmodulo.com/author/nanni -[1]:https://feedly.com/ -[2]:https://github.com/Jarkore/Feednix -[3]:https://aur.archlinux.org/packages/feednix/ From a4b62ed2496de9eee4c69a4de326dc170423cf35 Mon Sep 17 00:00:00 2001 From: chenzhijun <522858454@qq.com> Date: Thu, 11 Jun 2015 18:52:06 +0800 Subject: [PATCH 343/965] finish translate --- ...RSS feed from the command line on Linux.md | 123 ++++++++++++++++++ 1 file changed, 123 insertions(+) create mode 100644 translated/tech/20150209 How to access Feedly RSS feed from the command line on Linux.md diff --git a/translated/tech/20150209 How to access Feedly RSS feed from the command line on Linux.md b/translated/tech/20150209 How to access Feedly RSS feed from the command line on Linux.md new file mode 100644 index 0000000000..15fd76f291 --- /dev/null +++ b/translated/tech/20150209 How to access Feedly RSS feed from the command line on Linux.md @@ -0,0 +1,123 @@ +如何在Linux命令行下获取Feedly上的RSS新闻 +================================================================================ + +也许的先告诉你一声,Feedly 是世界上最流行的在线新闻聚合服务之一;它提供了无缝地统一的新闻阅读体验,你可以使用电脑的浏览器扩展,Android 和 iOS 设备上的移动应用程序等来体验Feedly。Feedly 在2013年Google Reader 停用后,迅速的获得了一大批Google Reader的用户。我就是他们之中的一位。从这以后,Feedly就一直是我的默认RSS(简易信息聚合)阅读器 +除了我非常喜欢的Feedly浏览器扩展和手机上的Feedly程序,这里还有一种途径来获取Feedly:Linux command-line (Linux命令行) +对的。你可以用命令行来获取Feedly上的新闻概要。 + +听起来非常傻?但是对于那些在服务器上工作的系统管理员来说,这是非常有用的。 +点击进入[Feednix][2]. 这个用c++编写的开源软件是Feedly的非官方命令行客户端。它允许你浏览Feedly的新闻在一个基于字符的终端界面(例如:bash)。默认模式下,Feednix 连接了一个基于控制台的浏览器,这个浏览器的名字叫w3m,允许你在命令行终端的环境下阅读文章。当然你也可以选择使用你喜欢的网页浏览器。在这个教程中,我准备示范以下怎样在命令行下安装和配置Feednix 来获取获取Feedly。 + +### 在Linux下安装Feednix ### + +你可以通过以下的步骤从源代码中安装Feednix。同时,在github的Ubuntu分区里面Ubuntu-stable(Ubuntu稳定版本)的分支上有最新的Feednix源代码。现在让我们开始吧: +作为必要组件,你需要安装一组开发包,和w3m浏览器(文字式页面浏览器)。 + +#### 在Debian,Ubuntu 和Linux Mint 操作 #### + + $ sudo apt-get install git automake g++ make libncursesw5-dev libjsoncpp-dev libcurl4-gnutls-dev w3m + $ git clone -b Ubuntu-stable https://github.com/Jarkore/Feednix.git + $ cd Feednix + $ ./autogen.sh + $ ./configure + $ make + $ sudo make install + + +#### 在Fedora 下操作 #### + + $ sudo yum groupinstall "C Development Tools and Libraries" + $ sudo yum install gcc-c++ git automake make ncurses-devel jsoncpp-devel libcurl-devel w3m + $ git clone -b Ubuntu-stable https://github.com/Jarkore/Feednix.git + $ cd Feednix + $ ./autogen.sh + $ ./configure + $ make + $ sudo make install + +Arch Linux + +在Arch Linux发行版下, 你可以非常容易的安装Feednix 从 [AUR][3]. + + +### 配置Feednix ### + +在安装完软件后,用下面的命令启动Feednix + + $ feednix + +如果你是第一次运行Feddnix,它会弹出一个网页浏览器窗口,在这个窗口里,你需要登陆来创建一个Feedly的账户ID和相应的开发人员密钥。 + +如果你是在无桌面环境下运行Feednix,先在另外一台电脑上打开一个网页,进入到网站:https://feedly.com/v3/auth/dev. + +![](https://farm8.staticflickr.com/7427/15825106524_42883b3e32_b.jpg) + +一旦你登陆,你对应的Feedly账户ID就生成了。 + +![](https://www.flickr.com/photos/xmodulo/15827565143/) + +为了验证密钥,你需要在浏览器上允许验证密钥的链接发送你的邮箱。之后就会在浏览器窗口显示你的用户ID,密钥,和密钥的有效期。 +请注意密钥的长度是非常超过200个字符的。所以密钥显示在一个带有垂直滚动条的文书框内,请确保把整个密钥的长度复制下来。 + +![](https://farm9.staticflickr.com/8605/16446685812_9098df494b_b.jpg) + +向下面这样,把你的用户ID和密钥输入到Feddnix的命令行提示下: + + [Enter User ID] >> XXXXXX + [Enter token] >> YYYYY + +成功授权后,你会在屏幕上见到一个初始化的有两个窗格的Feednix界面 + +左边的标题为“Categories”窗格,显示了一个新闻分类栏;右边“Posts”窗格显示了当前类别的新闻文章 + +![](https://farm8.staticflickr.com/7412/16421639256_deb8e2d276_c.jpg) + + +### 用Feednix读文章 ### + +这里我想简要描叙一下怎样通过Feednix来访问Feedly。 + + +#### Feednix界面 #### + +向我之前提过的,Feednix窗口包含了两个窗格。想在两个窗口之间进行切换的话,可以使用"TAB"健。在一个窗格内,想上下移动选择可以使用"j"和"k"。 +这些快捷健明显是受到了使用Vim编辑器的人启发。 + +#### 阅读文章 #### + +想阅读一些有特色的文章,可以在选定的文章上使用"o"健。它会调用w2m浏览器,并且在浏览器里面加载文章。 +一旦你读完之后,可以使用"q"健来推出当前W2m浏览器,并且返回到Feednix. +如果你的电脑环境允许打开一个网页浏览器,你可以按"0"健来在你默认的网页浏览器里面家在文章,比如使用Firefox. + + +![](https://farm8.staticflickr.com/7406/16445870201_b98e8da6d9_b.jpg) + + +#### 订阅新闻 #### + +你可以通过Feednix来为你的Feedly账户增加任何一种RSS新闻。 +要这么做,仅仅只需要按下"a"键,它会显示一个"[ENTER FEED]:"的提示在屏幕上,然后按下"ENTER" +在选择完RSS新闻后,继续为它编写分组信息和分类。 + +![](https://farm8.staticflickr.com/7324/16421639296_b52ed3c52e_c.jpg) + +#### 总结 #### + + +现在你知道了吧, Feednix 是一个非常友好的并且容易使用的命令行RSS阅读器。如果你是重度依赖命令行的用户或者是一个Feedly用户,Feednix 是肯定值得去尝试的。 +我经常和Feednix的开发者Jarkore交流来解决一些问题。我想说,对于bug的报告和修复他非常的积极。 +鼓励大家来试用Feednix,并且给他(Jarkore)一些回馈。 +-------------------------------------------------------------------------------- + +via: http://xmodulo.com/feedly-rss-feed-command-line-linux.html + +作者:[Dan Nanni][a] +译者:[译者ID](https://github.com/chenzhijun) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://xmodulo.com/author/nanni +[1]:https://feedly.com/ +[2]:https://github.com/Jarkore/Feednix +[3]:https://aur.archlinux.org/packages/feednix/ From ced1ee3cab2939f996a8ed8aff6516b5a5d5dce2 Mon Sep 17 00:00:00 2001 From: wolf <522858454@qq.com> Date: Thu, 11 Jun 2015 19:08:41 +0800 Subject: [PATCH 344/965] =?UTF-8?q?=E5=AE=8C=E6=88=90=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 标题。 我是我想了好久, 但是总觉得有的不达人意。 校对员能帮忙翻译一下吗? How to access Feedly RSS feed from the command line on Linux RSS是一种基于XML标准的协议; Feedly 是RSS阅读器 --- ...access Feedly RSS feed from the command line on Linux.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/translated/tech/20150209 How to access Feedly RSS feed from the command line on Linux.md b/translated/tech/20150209 How to access Feedly RSS feed from the command line on Linux.md index 15fd76f291..59cd1b97e6 100644 --- a/translated/tech/20150209 How to access Feedly RSS feed from the command line on Linux.md +++ b/translated/tech/20150209 How to access Feedly RSS feed from the command line on Linux.md @@ -1,7 +1,7 @@ -如何在Linux命令行下获取Feedly上的RSS新闻 +如何从Linux命令行获取基于RSS协议的Feedly新闻信息 ================================================================================ -也许的先告诉你一声,Feedly 是世界上最流行的在线新闻聚合服务之一;它提供了无缝地统一的新闻阅读体验,你可以使用电脑的浏览器扩展,Android 和 iOS 设备上的移动应用程序等来体验Feedly。Feedly 在2013年Google Reader 停用后,迅速的获得了一大批Google Reader的用户。我就是他们之中的一位。从这以后,Feedly就一直是我的默认RSS(简易信息聚合)阅读器 +也许你并不知道,Feedly --世界上最流行的在线新闻聚合服务之一;它提供了无缝地统一的新闻阅读体验,你可以使用电脑的浏览器扩展,Android 和 iOS 设备上的移动应用程序等来体验Feedly。Feedly 在2013年Google Reader 停用后,迅速的获得了一大批Google Reader的用户。我就是他们之中的一位。从这以后,Feedly就一直是我的默认RSS(简易信息聚合)阅读器 除了我非常喜欢的Feedly浏览器扩展和手机上的Feedly程序,这里还有一种途径来获取Feedly:Linux command-line (Linux命令行) 对的。你可以用命令行来获取Feedly上的新闻概要。 @@ -112,7 +112,7 @@ Arch Linux via: http://xmodulo.com/feedly-rss-feed-command-line-linux.html 作者:[Dan Nanni][a] -译者:[译者ID](https://github.com/chenzhijun) +译者:[chenzhijun](https://github.com/chenzhijun) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 From f624eedbfd890054d9ede42a768c074701120b1e Mon Sep 17 00:00:00 2001 From: wolf <522858454@qq.com> Date: Thu, 11 Jun 2015 19:11:23 +0800 Subject: [PATCH 345/965] Update 20150209 How to access Feedly RSS feed from the command line on Linux.md --- ... to access Feedly RSS feed from the command line on Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/translated/tech/20150209 How to access Feedly RSS feed from the command line on Linux.md b/translated/tech/20150209 How to access Feedly RSS feed from the command line on Linux.md index 59cd1b97e6..4109ceb947 100644 --- a/translated/tech/20150209 How to access Feedly RSS feed from the command line on Linux.md +++ b/translated/tech/20150209 How to access Feedly RSS feed from the command line on Linux.md @@ -1,4 +1,4 @@ -如何从Linux命令行获取基于RSS协议的Feedly新闻信息 +从Linux命令行获取基于RSS协议的Feedly上信息 ================================================================================ 也许你并不知道,Feedly --世界上最流行的在线新闻聚合服务之一;它提供了无缝地统一的新闻阅读体验,你可以使用电脑的浏览器扩展,Android 和 iOS 设备上的移动应用程序等来体验Feedly。Feedly 在2013年Google Reader 停用后,迅速的获得了一大批Google Reader的用户。我就是他们之中的一位。从这以后,Feedly就一直是我的默认RSS(简易信息聚合)阅读器 From 2e29b9bdeb8c5f00bd93ba43bee28fc5b15bff13 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 11 Jun 2015 21:06:25 +0800 Subject: [PATCH 346/965] translated --- ... pagespeed on Ubuntu 15.04 Vivid Vervet.md | 131 ------------------ ... pagespeed on Ubuntu 15.04 Vivid Vervet.md | 129 +++++++++++++++++ 2 files changed, 129 insertions(+), 131 deletions(-) delete mode 100644 sources/tech/20150610 How to Install nginx and google pagespeed on Ubuntu 15.04 Vivid Vervet.md create mode 100644 translated/tech/20150610 How to Install nginx and google pagespeed on Ubuntu 15.04 Vivid Vervet.md diff --git a/sources/tech/20150610 How to Install nginx and google pagespeed on Ubuntu 15.04 Vivid Vervet.md b/sources/tech/20150610 How to Install nginx and google pagespeed on Ubuntu 15.04 Vivid Vervet.md deleted file mode 100644 index dd3478c903..0000000000 --- a/sources/tech/20150610 How to Install nginx and google pagespeed on Ubuntu 15.04 Vivid Vervet.md +++ /dev/null @@ -1,131 +0,0 @@ -translating----geekpi - -How to Install nginx and google pagespeed on Ubuntu 15.04 (Vivid Vervet) -================================================================================ -Nginx (engine-x) is a open source and high performance HTTP server, reverse proxy and IMAP/POP3 proxy server. The outstanding features of Nginx are: stability, rich feature set, simple configuration and low resource consumption. Nginx is being used by some of the largest websites on the internet and is gaining more and more popularity in the webmaster community. This tutorials shows how to build a nginx .deb package for Ubuntu 15.04 from source that has Google pagespeed module compiled in. - - -Pagespeed is a web server module developed by Google to speed up a website response times, optimize html and reduce the page load time. ngx_pagespeed features include : - -- Image optimization: stripping meta-data, dynamic resizing, recompression. -- CSS & JavaScript minification, concatenation, inlining, and outlining. -- Small resource inlining. -- Deferring image and JavaScript loading. -- HTML rewriting. -- Cache lifetime extension. - -see more [https://developers.google.com/speed/pagespeed/module/][1]. - -### Prerequisites ### - -Ubuntu Server 15.04 64 bit -root privileges - -What we will do in this tutorial : - -- Install the prerequisite packages. -- Installing nginx with ngx_pagespeed. -- Testing. - -#### Install the prerequisite packages #### - -sudo apt-get install dpkg-dev build-essential zlib1g-dev libpcre3 libpcre3-dev - -#### Installing nginx with ngx_pagespeed #### - -**Step 1 - Adding nginx repository** - - vim /etc/apt/sources.list.d/nginx.list - -add the line: - - deb http://nginx.org/packages/ubuntu/ trusty nginx - deb-src http://nginx.org/packages/ubuntu/ trusty nginx - -Update your repository: - - sudo apt-get update - -note : if you get the messege : GPG error [...] NO_PUBKEY [...] bla bla - -please add the the key: - - sudo sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys KEYNUMBER - sudo apt-get update - -**Step 2 - Download nginx 1.8 from ubuntu repository** - - sudo su - cd ~ - mkdir -p ~/new/nginx_source/ - cd ~/new/nginx_source/ - apt-get source nginx - apt-get build-dep nginx - -**Step 3 - Download Pagespeed** - - cd ~ - mkdir -p ~/new/ngx_pagespeed/ - cd ~/new/ngx_pagespeed/ - ngx_version=1.9.32.3 - wget https://github.com/pagespeed/ngx_pagespeed/archive/release-${ngx_version}-beta.zip - unzip release-${ngx_version}-beta.zip - - cd ngx_pagespeed-release-1.9.32.3-beta/ - wget https://dl.google.com/dl/page-speed/psol/${ngx_version}.tar.gz - tar -xzf 1.9.32.3.tar.gz - -**Step 4 - Configure nginx to build with Pagespeed** - - cd ~/new/nginx_source/nginx-1.8.0/debin/ - vim rules - -add the module under CFLAGS `.configure` : - - --add-module=../../ngx_pagespeed/ngx_pagespeed-release-1.9.32.3-beta \ - -![adding pagespeed to nginx](https://www.howtoforge.com/images/nginx_pagespeed_ubuntu_15_04/big/1.png) - -![adding pagespeed to nginx](https://www.howtoforge.com/images/nginx_pagespeed_ubuntu_15_04/big/2.png) - -**Step 5 - Build nginx package and Install** - - cd ~/new/nginx_source/nginx-1.8.0/ - dpkg-buildpackage -b - -The dpkg-buildpackage command will build the nginx.deb under ~/new/ngix_source/ Once package building is complete, please look in the directory: - - cd ~/new/ngix_source/ - ls - -![nginx builded with pagespeed](https://www.howtoforge.com/images/nginx_pagespeed_ubuntu_15_04/big/3.png) - -And then install nginx. - - dpkg -i nginx_1.8.0-1~trusty_amd64.deb - -![Install nginx](https://www.howtoforge.com/images/nginx_pagespeed_ubuntu_15_04/big/4.png) - -#### Testing #### - -Run nginx -V to see the ngx_pagespeed was builted with nginx. - - nginx -V - -![nginx -V](https://www.howtoforge.com/images/nginx_pagespeed_ubuntu_15_04/big/5.png) - -### Conclusion ### - -The nginx web server there is a stable and fast open source http server that supports a variety of modules for optimization. One of these modules is the 'PageSpeed module' which is developed by google. Unlike apache, nginx modules are not dynamically loadable, so you have to select the desired modules before you build the nginx package. - --------------------------------------------------------------------------------- - -via: https://www.howtoforge.com/tutorial/how-to-install-nginx-and-google-pagespeed-on-ubuntu-15-04/#step-build-nginx-package-and-install - -作者:Muhammad Arul -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[1]:https://developers.google.com/speed/pagespeed/module/ diff --git a/translated/tech/20150610 How to Install nginx and google pagespeed on Ubuntu 15.04 Vivid Vervet.md b/translated/tech/20150610 How to Install nginx and google pagespeed on Ubuntu 15.04 Vivid Vervet.md new file mode 100644 index 0000000000..91d16acb00 --- /dev/null +++ b/translated/tech/20150610 How to Install nginx and google pagespeed on Ubuntu 15.04 Vivid Vervet.md @@ -0,0 +1,129 @@ +如何在Ubuntu 15.04(Vivid Vervet)中安装nginx和google pagespeed +================================================================================ +Nginx (engine-x)是一个开源高性能http、反向代理和IMAP/POP3代理服务器。nginx杰出的功能有:稳定、丰富的功能集、简单的配置和低资源消耗。nginx被用于一些高性能网站并在站长之间变得越来越流行。本教程会从源码构建一个带有google paespeed模块用于Ubuntu 15.04中的.deb包。 + + +pagespeed是一个由google开发的web服务器模块来加速网站响应时间、优化html和减少页面加载时间。ngx_pagespeed的功能如下: + +- 图像优化:去除meta数据、动态剪裁、重压缩。 +- CSS与JavaScript 放大、串联、内联、外联。 +- 小资源内联 +- 延迟图像与JavaScript加载 +- HTML重写。 +- 缓存生命期插件 + +更多请见 [https://developers.google.com/speed/pagespeed/module/][1]. + +### 预备要求 ### + +Ubuntu Server 15.04 64位 +root 权限 + +本篇我们将要: + +- 安装必备包 +- 安装带ngx_pagespeed的nginx +- 测试 + +#### 安装必备包 #### + +sudo apt-get install dpkg-dev build-essential zlib1g-dev libpcre3 libpcre3-dev + +#### 安装带ngx_pagespeed的nginx #### + +**第一步 - 添加nginx仓库** + + vim /etc/apt/sources.list.d/nginx.list + +加入下面的行: + + deb http://nginx.org/packages/ubuntu/ trusty nginx + deb-src http://nginx.org/packages/ubuntu/ trusty nginx + +更新仓库: + + sudo apt-get update + +注意:如果你看到信息:GPG error [...] NO_PUBKEY [...] 等等 + +请添加key: + + sudo sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys KEYNUMBER + sudo apt-get update + +**第二步 - 从仓库下载nginx 1.8** + + sudo su + cd ~ + mkdir -p ~/new/nginx_source/ + cd ~/new/nginx_source/ + apt-get source nginx + apt-get build-dep nginx + +**第三步 - 下载Pagespeed** + + cd ~ + mkdir -p ~/new/ngx_pagespeed/ + cd ~/new/ngx_pagespeed/ + ngx_version=1.9.32.3 + wget https://github.com/pagespeed/ngx_pagespeed/archive/release-${ngx_version}-beta.zip + unzip release-${ngx_version}-beta.zip + + cd ngx_pagespeed-release-1.9.32.3-beta/ + wget https://dl.google.com/dl/page-speed/psol/${ngx_version}.tar.gz + tar -xzf 1.9.32.3.tar.gz + +**第三步 - 配置nginx来编译Pagespeed** + + cd ~/new/nginx_source/nginx-1.8.0/debin/ + vim rules + +在CFLAGS `.configure`下添加模块: + + --add-module=../../ngx_pagespeed/ngx_pagespeed-release-1.9.32.3-beta \ + +![adding pagespeed to nginx](https://www.howtoforge.com/images/nginx_pagespeed_ubuntu_15_04/big/1.png) + +![adding pagespeed to nginx](https://www.howtoforge.com/images/nginx_pagespeed_ubuntu_15_04/big/2.png) + +**第五步 - 打包nginx包并安装** + + cd ~/new/nginx_source/nginx-1.8.0/ + dpkg-buildpackage -b + +dpkg-buildpackage会编译 ~/new/ngix_source/成nginx.deb。打包完成后,看一下目录: + + cd ~/new/ngix_source/ + ls + +![nginx builded with pagespeed](https://www.howtoforge.com/images/nginx_pagespeed_ubuntu_15_04/big/3.png) + +接着安装nginx。 + + dpkg -i nginx_1.8.0-1~trusty_amd64.deb + +![Install nginx](https://www.howtoforge.com/images/nginx_pagespeed_ubuntu_15_04/big/4.png) + +#### 测试 #### + +运行nginx -V测试nginx是否已经自带ngx_pagespeed。 + + nginx -V + +![nginx -V](https://www.howtoforge.com/images/nginx_pagespeed_ubuntu_15_04/big/5.png) + +### 总结 ### + +稳定、快速、开源的nginx支持许多不同的优化模块。这其中之一是google开发的‘pagespeed’。不像apache,nginx模块不是动态加载的,因此你必须在编译之前就选择完需要的模块。 + +-------------------------------------------------------------------------------- + +via: https://www.howtoforge.com/tutorial/how-to-install-nginx-and-google-pagespeed-on-ubuntu-15-04/#step-build-nginx-package-and-install + +作者:Muhammad Arul +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[1]:https://developers.google.com/speed/pagespeed/module/ From d7ad1dd0602030b16f9a4a97287369c806a834da Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 11 Jun 2015 21:09:22 +0800 Subject: [PATCH 347/965] Revert "translated" This reverts commit 2e29b9bdeb8c5f00bd93ba43bee28fc5b15bff13. --- ... pagespeed on Ubuntu 15.04 Vivid Vervet.md | 131 ++++++++++++++++++ ... pagespeed on Ubuntu 15.04 Vivid Vervet.md | 129 ----------------- 2 files changed, 131 insertions(+), 129 deletions(-) create mode 100644 sources/tech/20150610 How to Install nginx and google pagespeed on Ubuntu 15.04 Vivid Vervet.md delete mode 100644 translated/tech/20150610 How to Install nginx and google pagespeed on Ubuntu 15.04 Vivid Vervet.md diff --git a/sources/tech/20150610 How to Install nginx and google pagespeed on Ubuntu 15.04 Vivid Vervet.md b/sources/tech/20150610 How to Install nginx and google pagespeed on Ubuntu 15.04 Vivid Vervet.md new file mode 100644 index 0000000000..dd3478c903 --- /dev/null +++ b/sources/tech/20150610 How to Install nginx and google pagespeed on Ubuntu 15.04 Vivid Vervet.md @@ -0,0 +1,131 @@ +translating----geekpi + +How to Install nginx and google pagespeed on Ubuntu 15.04 (Vivid Vervet) +================================================================================ +Nginx (engine-x) is a open source and high performance HTTP server, reverse proxy and IMAP/POP3 proxy server. The outstanding features of Nginx are: stability, rich feature set, simple configuration and low resource consumption. Nginx is being used by some of the largest websites on the internet and is gaining more and more popularity in the webmaster community. This tutorials shows how to build a nginx .deb package for Ubuntu 15.04 from source that has Google pagespeed module compiled in. + + +Pagespeed is a web server module developed by Google to speed up a website response times, optimize html and reduce the page load time. ngx_pagespeed features include : + +- Image optimization: stripping meta-data, dynamic resizing, recompression. +- CSS & JavaScript minification, concatenation, inlining, and outlining. +- Small resource inlining. +- Deferring image and JavaScript loading. +- HTML rewriting. +- Cache lifetime extension. + +see more [https://developers.google.com/speed/pagespeed/module/][1]. + +### Prerequisites ### + +Ubuntu Server 15.04 64 bit +root privileges + +What we will do in this tutorial : + +- Install the prerequisite packages. +- Installing nginx with ngx_pagespeed. +- Testing. + +#### Install the prerequisite packages #### + +sudo apt-get install dpkg-dev build-essential zlib1g-dev libpcre3 libpcre3-dev + +#### Installing nginx with ngx_pagespeed #### + +**Step 1 - Adding nginx repository** + + vim /etc/apt/sources.list.d/nginx.list + +add the line: + + deb http://nginx.org/packages/ubuntu/ trusty nginx + deb-src http://nginx.org/packages/ubuntu/ trusty nginx + +Update your repository: + + sudo apt-get update + +note : if you get the messege : GPG error [...] NO_PUBKEY [...] bla bla + +please add the the key: + + sudo sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys KEYNUMBER + sudo apt-get update + +**Step 2 - Download nginx 1.8 from ubuntu repository** + + sudo su + cd ~ + mkdir -p ~/new/nginx_source/ + cd ~/new/nginx_source/ + apt-get source nginx + apt-get build-dep nginx + +**Step 3 - Download Pagespeed** + + cd ~ + mkdir -p ~/new/ngx_pagespeed/ + cd ~/new/ngx_pagespeed/ + ngx_version=1.9.32.3 + wget https://github.com/pagespeed/ngx_pagespeed/archive/release-${ngx_version}-beta.zip + unzip release-${ngx_version}-beta.zip + + cd ngx_pagespeed-release-1.9.32.3-beta/ + wget https://dl.google.com/dl/page-speed/psol/${ngx_version}.tar.gz + tar -xzf 1.9.32.3.tar.gz + +**Step 4 - Configure nginx to build with Pagespeed** + + cd ~/new/nginx_source/nginx-1.8.0/debin/ + vim rules + +add the module under CFLAGS `.configure` : + + --add-module=../../ngx_pagespeed/ngx_pagespeed-release-1.9.32.3-beta \ + +![adding pagespeed to nginx](https://www.howtoforge.com/images/nginx_pagespeed_ubuntu_15_04/big/1.png) + +![adding pagespeed to nginx](https://www.howtoforge.com/images/nginx_pagespeed_ubuntu_15_04/big/2.png) + +**Step 5 - Build nginx package and Install** + + cd ~/new/nginx_source/nginx-1.8.0/ + dpkg-buildpackage -b + +The dpkg-buildpackage command will build the nginx.deb under ~/new/ngix_source/ Once package building is complete, please look in the directory: + + cd ~/new/ngix_source/ + ls + +![nginx builded with pagespeed](https://www.howtoforge.com/images/nginx_pagespeed_ubuntu_15_04/big/3.png) + +And then install nginx. + + dpkg -i nginx_1.8.0-1~trusty_amd64.deb + +![Install nginx](https://www.howtoforge.com/images/nginx_pagespeed_ubuntu_15_04/big/4.png) + +#### Testing #### + +Run nginx -V to see the ngx_pagespeed was builted with nginx. + + nginx -V + +![nginx -V](https://www.howtoforge.com/images/nginx_pagespeed_ubuntu_15_04/big/5.png) + +### Conclusion ### + +The nginx web server there is a stable and fast open source http server that supports a variety of modules for optimization. One of these modules is the 'PageSpeed module' which is developed by google. Unlike apache, nginx modules are not dynamically loadable, so you have to select the desired modules before you build the nginx package. + +-------------------------------------------------------------------------------- + +via: https://www.howtoforge.com/tutorial/how-to-install-nginx-and-google-pagespeed-on-ubuntu-15-04/#step-build-nginx-package-and-install + +作者:Muhammad Arul +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[1]:https://developers.google.com/speed/pagespeed/module/ diff --git a/translated/tech/20150610 How to Install nginx and google pagespeed on Ubuntu 15.04 Vivid Vervet.md b/translated/tech/20150610 How to Install nginx and google pagespeed on Ubuntu 15.04 Vivid Vervet.md deleted file mode 100644 index 91d16acb00..0000000000 --- a/translated/tech/20150610 How to Install nginx and google pagespeed on Ubuntu 15.04 Vivid Vervet.md +++ /dev/null @@ -1,129 +0,0 @@ -如何在Ubuntu 15.04(Vivid Vervet)中安装nginx和google pagespeed -================================================================================ -Nginx (engine-x)是一个开源高性能http、反向代理和IMAP/POP3代理服务器。nginx杰出的功能有:稳定、丰富的功能集、简单的配置和低资源消耗。nginx被用于一些高性能网站并在站长之间变得越来越流行。本教程会从源码构建一个带有google paespeed模块用于Ubuntu 15.04中的.deb包。 - - -pagespeed是一个由google开发的web服务器模块来加速网站响应时间、优化html和减少页面加载时间。ngx_pagespeed的功能如下: - -- 图像优化:去除meta数据、动态剪裁、重压缩。 -- CSS与JavaScript 放大、串联、内联、外联。 -- 小资源内联 -- 延迟图像与JavaScript加载 -- HTML重写。 -- 缓存生命期插件 - -更多请见 [https://developers.google.com/speed/pagespeed/module/][1]. - -### 预备要求 ### - -Ubuntu Server 15.04 64位 -root 权限 - -本篇我们将要: - -- 安装必备包 -- 安装带ngx_pagespeed的nginx -- 测试 - -#### 安装必备包 #### - -sudo apt-get install dpkg-dev build-essential zlib1g-dev libpcre3 libpcre3-dev - -#### 安装带ngx_pagespeed的nginx #### - -**第一步 - 添加nginx仓库** - - vim /etc/apt/sources.list.d/nginx.list - -加入下面的行: - - deb http://nginx.org/packages/ubuntu/ trusty nginx - deb-src http://nginx.org/packages/ubuntu/ trusty nginx - -更新仓库: - - sudo apt-get update - -注意:如果你看到信息:GPG error [...] NO_PUBKEY [...] 等等 - -请添加key: - - sudo sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys KEYNUMBER - sudo apt-get update - -**第二步 - 从仓库下载nginx 1.8** - - sudo su - cd ~ - mkdir -p ~/new/nginx_source/ - cd ~/new/nginx_source/ - apt-get source nginx - apt-get build-dep nginx - -**第三步 - 下载Pagespeed** - - cd ~ - mkdir -p ~/new/ngx_pagespeed/ - cd ~/new/ngx_pagespeed/ - ngx_version=1.9.32.3 - wget https://github.com/pagespeed/ngx_pagespeed/archive/release-${ngx_version}-beta.zip - unzip release-${ngx_version}-beta.zip - - cd ngx_pagespeed-release-1.9.32.3-beta/ - wget https://dl.google.com/dl/page-speed/psol/${ngx_version}.tar.gz - tar -xzf 1.9.32.3.tar.gz - -**第三步 - 配置nginx来编译Pagespeed** - - cd ~/new/nginx_source/nginx-1.8.0/debin/ - vim rules - -在CFLAGS `.configure`下添加模块: - - --add-module=../../ngx_pagespeed/ngx_pagespeed-release-1.9.32.3-beta \ - -![adding pagespeed to nginx](https://www.howtoforge.com/images/nginx_pagespeed_ubuntu_15_04/big/1.png) - -![adding pagespeed to nginx](https://www.howtoforge.com/images/nginx_pagespeed_ubuntu_15_04/big/2.png) - -**第五步 - 打包nginx包并安装** - - cd ~/new/nginx_source/nginx-1.8.0/ - dpkg-buildpackage -b - -dpkg-buildpackage会编译 ~/new/ngix_source/成nginx.deb。打包完成后,看一下目录: - - cd ~/new/ngix_source/ - ls - -![nginx builded with pagespeed](https://www.howtoforge.com/images/nginx_pagespeed_ubuntu_15_04/big/3.png) - -接着安装nginx。 - - dpkg -i nginx_1.8.0-1~trusty_amd64.deb - -![Install nginx](https://www.howtoforge.com/images/nginx_pagespeed_ubuntu_15_04/big/4.png) - -#### 测试 #### - -运行nginx -V测试nginx是否已经自带ngx_pagespeed。 - - nginx -V - -![nginx -V](https://www.howtoforge.com/images/nginx_pagespeed_ubuntu_15_04/big/5.png) - -### 总结 ### - -稳定、快速、开源的nginx支持许多不同的优化模块。这其中之一是google开发的‘pagespeed’。不像apache,nginx模块不是动态加载的,因此你必须在编译之前就选择完需要的模块。 - --------------------------------------------------------------------------------- - -via: https://www.howtoforge.com/tutorial/how-to-install-nginx-and-google-pagespeed-on-ubuntu-15-04/#step-build-nginx-package-and-install - -作者:Muhammad Arul -译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[1]:https://developers.google.com/speed/pagespeed/module/ From cf572298718cd959d853e3c7201775baf97a8f56 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 11 Jun 2015 21:12:23 +0800 Subject: [PATCH 348/965] translated --- ... pagespeed on Ubuntu 15.04 Vivid Vervet.md | 131 ------------------ ... pagespeed on Ubuntu 15.04 Vivid Vervet.md | 129 +++++++++++++++++ 2 files changed, 129 insertions(+), 131 deletions(-) delete mode 100644 sources/tech/20150610 How to Install nginx and google pagespeed on Ubuntu 15.04 Vivid Vervet.md create mode 100644 translated/tech/20150610 How to Install nginx and google pagespeed on Ubuntu 15.04 Vivid Vervet.md diff --git a/sources/tech/20150610 How to Install nginx and google pagespeed on Ubuntu 15.04 Vivid Vervet.md b/sources/tech/20150610 How to Install nginx and google pagespeed on Ubuntu 15.04 Vivid Vervet.md deleted file mode 100644 index dd3478c903..0000000000 --- a/sources/tech/20150610 How to Install nginx and google pagespeed on Ubuntu 15.04 Vivid Vervet.md +++ /dev/null @@ -1,131 +0,0 @@ -translating----geekpi - -How to Install nginx and google pagespeed on Ubuntu 15.04 (Vivid Vervet) -================================================================================ -Nginx (engine-x) is a open source and high performance HTTP server, reverse proxy and IMAP/POP3 proxy server. The outstanding features of Nginx are: stability, rich feature set, simple configuration and low resource consumption. Nginx is being used by some of the largest websites on the internet and is gaining more and more popularity in the webmaster community. This tutorials shows how to build a nginx .deb package for Ubuntu 15.04 from source that has Google pagespeed module compiled in. - - -Pagespeed is a web server module developed by Google to speed up a website response times, optimize html and reduce the page load time. ngx_pagespeed features include : - -- Image optimization: stripping meta-data, dynamic resizing, recompression. -- CSS & JavaScript minification, concatenation, inlining, and outlining. -- Small resource inlining. -- Deferring image and JavaScript loading. -- HTML rewriting. -- Cache lifetime extension. - -see more [https://developers.google.com/speed/pagespeed/module/][1]. - -### Prerequisites ### - -Ubuntu Server 15.04 64 bit -root privileges - -What we will do in this tutorial : - -- Install the prerequisite packages. -- Installing nginx with ngx_pagespeed. -- Testing. - -#### Install the prerequisite packages #### - -sudo apt-get install dpkg-dev build-essential zlib1g-dev libpcre3 libpcre3-dev - -#### Installing nginx with ngx_pagespeed #### - -**Step 1 - Adding nginx repository** - - vim /etc/apt/sources.list.d/nginx.list - -add the line: - - deb http://nginx.org/packages/ubuntu/ trusty nginx - deb-src http://nginx.org/packages/ubuntu/ trusty nginx - -Update your repository: - - sudo apt-get update - -note : if you get the messege : GPG error [...] NO_PUBKEY [...] bla bla - -please add the the key: - - sudo sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys KEYNUMBER - sudo apt-get update - -**Step 2 - Download nginx 1.8 from ubuntu repository** - - sudo su - cd ~ - mkdir -p ~/new/nginx_source/ - cd ~/new/nginx_source/ - apt-get source nginx - apt-get build-dep nginx - -**Step 3 - Download Pagespeed** - - cd ~ - mkdir -p ~/new/ngx_pagespeed/ - cd ~/new/ngx_pagespeed/ - ngx_version=1.9.32.3 - wget https://github.com/pagespeed/ngx_pagespeed/archive/release-${ngx_version}-beta.zip - unzip release-${ngx_version}-beta.zip - - cd ngx_pagespeed-release-1.9.32.3-beta/ - wget https://dl.google.com/dl/page-speed/psol/${ngx_version}.tar.gz - tar -xzf 1.9.32.3.tar.gz - -**Step 4 - Configure nginx to build with Pagespeed** - - cd ~/new/nginx_source/nginx-1.8.0/debin/ - vim rules - -add the module under CFLAGS `.configure` : - - --add-module=../../ngx_pagespeed/ngx_pagespeed-release-1.9.32.3-beta \ - -![adding pagespeed to nginx](https://www.howtoforge.com/images/nginx_pagespeed_ubuntu_15_04/big/1.png) - -![adding pagespeed to nginx](https://www.howtoforge.com/images/nginx_pagespeed_ubuntu_15_04/big/2.png) - -**Step 5 - Build nginx package and Install** - - cd ~/new/nginx_source/nginx-1.8.0/ - dpkg-buildpackage -b - -The dpkg-buildpackage command will build the nginx.deb under ~/new/ngix_source/ Once package building is complete, please look in the directory: - - cd ~/new/ngix_source/ - ls - -![nginx builded with pagespeed](https://www.howtoforge.com/images/nginx_pagespeed_ubuntu_15_04/big/3.png) - -And then install nginx. - - dpkg -i nginx_1.8.0-1~trusty_amd64.deb - -![Install nginx](https://www.howtoforge.com/images/nginx_pagespeed_ubuntu_15_04/big/4.png) - -#### Testing #### - -Run nginx -V to see the ngx_pagespeed was builted with nginx. - - nginx -V - -![nginx -V](https://www.howtoforge.com/images/nginx_pagespeed_ubuntu_15_04/big/5.png) - -### Conclusion ### - -The nginx web server there is a stable and fast open source http server that supports a variety of modules for optimization. One of these modules is the 'PageSpeed module' which is developed by google. Unlike apache, nginx modules are not dynamically loadable, so you have to select the desired modules before you build the nginx package. - --------------------------------------------------------------------------------- - -via: https://www.howtoforge.com/tutorial/how-to-install-nginx-and-google-pagespeed-on-ubuntu-15-04/#step-build-nginx-package-and-install - -作者:Muhammad Arul -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[1]:https://developers.google.com/speed/pagespeed/module/ diff --git a/translated/tech/20150610 How to Install nginx and google pagespeed on Ubuntu 15.04 Vivid Vervet.md b/translated/tech/20150610 How to Install nginx and google pagespeed on Ubuntu 15.04 Vivid Vervet.md new file mode 100644 index 0000000000..91d16acb00 --- /dev/null +++ b/translated/tech/20150610 How to Install nginx and google pagespeed on Ubuntu 15.04 Vivid Vervet.md @@ -0,0 +1,129 @@ +如何在Ubuntu 15.04(Vivid Vervet)中安装nginx和google pagespeed +================================================================================ +Nginx (engine-x)是一个开源高性能http、反向代理和IMAP/POP3代理服务器。nginx杰出的功能有:稳定、丰富的功能集、简单的配置和低资源消耗。nginx被用于一些高性能网站并在站长之间变得越来越流行。本教程会从源码构建一个带有google paespeed模块用于Ubuntu 15.04中的.deb包。 + + +pagespeed是一个由google开发的web服务器模块来加速网站响应时间、优化html和减少页面加载时间。ngx_pagespeed的功能如下: + +- 图像优化:去除meta数据、动态剪裁、重压缩。 +- CSS与JavaScript 放大、串联、内联、外联。 +- 小资源内联 +- 延迟图像与JavaScript加载 +- HTML重写。 +- 缓存生命期插件 + +更多请见 [https://developers.google.com/speed/pagespeed/module/][1]. + +### 预备要求 ### + +Ubuntu Server 15.04 64位 +root 权限 + +本篇我们将要: + +- 安装必备包 +- 安装带ngx_pagespeed的nginx +- 测试 + +#### 安装必备包 #### + +sudo apt-get install dpkg-dev build-essential zlib1g-dev libpcre3 libpcre3-dev + +#### 安装带ngx_pagespeed的nginx #### + +**第一步 - 添加nginx仓库** + + vim /etc/apt/sources.list.d/nginx.list + +加入下面的行: + + deb http://nginx.org/packages/ubuntu/ trusty nginx + deb-src http://nginx.org/packages/ubuntu/ trusty nginx + +更新仓库: + + sudo apt-get update + +注意:如果你看到信息:GPG error [...] NO_PUBKEY [...] 等等 + +请添加key: + + sudo sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys KEYNUMBER + sudo apt-get update + +**第二步 - 从仓库下载nginx 1.8** + + sudo su + cd ~ + mkdir -p ~/new/nginx_source/ + cd ~/new/nginx_source/ + apt-get source nginx + apt-get build-dep nginx + +**第三步 - 下载Pagespeed** + + cd ~ + mkdir -p ~/new/ngx_pagespeed/ + cd ~/new/ngx_pagespeed/ + ngx_version=1.9.32.3 + wget https://github.com/pagespeed/ngx_pagespeed/archive/release-${ngx_version}-beta.zip + unzip release-${ngx_version}-beta.zip + + cd ngx_pagespeed-release-1.9.32.3-beta/ + wget https://dl.google.com/dl/page-speed/psol/${ngx_version}.tar.gz + tar -xzf 1.9.32.3.tar.gz + +**第三步 - 配置nginx来编译Pagespeed** + + cd ~/new/nginx_source/nginx-1.8.0/debin/ + vim rules + +在CFLAGS `.configure`下添加模块: + + --add-module=../../ngx_pagespeed/ngx_pagespeed-release-1.9.32.3-beta \ + +![adding pagespeed to nginx](https://www.howtoforge.com/images/nginx_pagespeed_ubuntu_15_04/big/1.png) + +![adding pagespeed to nginx](https://www.howtoforge.com/images/nginx_pagespeed_ubuntu_15_04/big/2.png) + +**第五步 - 打包nginx包并安装** + + cd ~/new/nginx_source/nginx-1.8.0/ + dpkg-buildpackage -b + +dpkg-buildpackage会编译 ~/new/ngix_source/成nginx.deb。打包完成后,看一下目录: + + cd ~/new/ngix_source/ + ls + +![nginx builded with pagespeed](https://www.howtoforge.com/images/nginx_pagespeed_ubuntu_15_04/big/3.png) + +接着安装nginx。 + + dpkg -i nginx_1.8.0-1~trusty_amd64.deb + +![Install nginx](https://www.howtoforge.com/images/nginx_pagespeed_ubuntu_15_04/big/4.png) + +#### 测试 #### + +运行nginx -V测试nginx是否已经自带ngx_pagespeed。 + + nginx -V + +![nginx -V](https://www.howtoforge.com/images/nginx_pagespeed_ubuntu_15_04/big/5.png) + +### 总结 ### + +稳定、快速、开源的nginx支持许多不同的优化模块。这其中之一是google开发的‘pagespeed’。不像apache,nginx模块不是动态加载的,因此你必须在编译之前就选择完需要的模块。 + +-------------------------------------------------------------------------------- + +via: https://www.howtoforge.com/tutorial/how-to-install-nginx-and-google-pagespeed-on-ubuntu-15-04/#step-build-nginx-package-and-install + +作者:Muhammad Arul +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[1]:https://developers.google.com/speed/pagespeed/module/ From e25117711c325dbb281d33b5d9f4366040bfcaea Mon Sep 17 00:00:00 2001 From: Alan You <1058413893@qq.com> Date: Thu, 11 Jun 2015 22:23:44 +0800 Subject: [PATCH 349/965] Create 20150515 How to Install Percona Server on CentOS 7.md translated --- ...w to Install Percona Server on CentOS 7.md | 220 ++++++++++++++++++ 1 file changed, 220 insertions(+) create mode 100644 translated/tech/20150515 How to Install Percona Server on CentOS 7.md diff --git a/translated/tech/20150515 How to Install Percona Server on CentOS 7.md b/translated/tech/20150515 How to Install Percona Server on CentOS 7.md new file mode 100644 index 0000000000..ef283c8b92 --- /dev/null +++ b/translated/tech/20150515 How to Install Percona Server on CentOS 7.md @@ -0,0 +1,220 @@ + +如何在CentOS 7上安装Percona Server + +================================================================================ +在这篇文章中我们将了解关于Percona Server,一个开源简易的MySQL,MariaDB的替代。InnoDB的数据库引擎使得Percona Server非常有吸引力,如果你需要的高性能,高可靠性和高性价比的解决方案,它将是一个很好的选择。 + +在下文中将介绍在CentOS 7上Percona的服务器的安装,以及备份当前数据,配置的步骤和如何恢复备份。 + + +###目录### + + +1.什么是Percona,为什么使用它 +2.备份你的数据库 +3.删除之前的SQL服务器 +4.使用二进制包安装Percona +5.配置Percona +6.保护你的数据 +7.恢复你的备份 + + +### 1.什么是Percona,为什么使用它 ### + + +Percona是一个开源简易的MySQL,MariaDB数据库的替代,它是MYSQL的一个分支,相当多的改进和独特的功能使得它比MYSQL更可靠,性能更强,速度更快,它与MYSQL完全兼容,你甚至可以在Oracle的MYSQL与Percona之间使用复制命令。 + +#### 在Percona中独具特色的功能 #### + + +-分段自适应哈希搜索 +-快速校验算法 +-缓冲池预加载 +-支持FlashCache + +#### MySQL企业版和Percona的特定功能 #### + +-从不同的服务器导入表 +-PAM认证 +-审计日志 +-线程池 + + +现在,你肯定很兴奋地看到这些好的东西整理在一起,我们将告诉你如何安装和做些的Percona Server的基本配置。 + +### 2. 备份你的数据库 ### + + +接下来,在命令行下使用SQL命令创建一个mydatabases.sql文件来重建/恢复salesdb和employeedb数据库,重命名数据库以便反映你的设置,如果没有安装MYSQL跳过此步 + + mysqldump -u root -p --databases employeedb salesdb > mydatabases.sql + +复制当前的配置文件,如果你没有安装MYSQL也可跳过 + + + cp my.cnf my.cnf.bkp + +### 3.删除之前的SQL服务器 ### + + +停止MYSQL/MariaDB如果它们还在运行 + + + systemctl stop mysql.service + +卸载MariaDB和MYSQL + + + yum remove MariaDB-server MariaDB-client MariaDB-shared mysql mysql-server + +移动重命名在/var/lib/mysql当中的MariaDB文件,这比仅仅只是移除更为安全快速,这就像2级即时备份。:) + + + mv /var/lib/mysql /var/lib/mysql_mariadb + +### 4.使用二进制包安装Percona ### + + +你可以在众多Percona安装方法中选择,在CentOS中使用Yum或者RPM包安装通常是更好的主意,所以这些是本文介绍的方式,下载源文件编译后安装在本文中并没有介绍。 + + +从Yum仓库中安装: + + +首先,你需要设置的Percona的Yum库: + + + yum install http://www.percona.com/downloads/percona-release/redhat/0.1-3/percona-release-0.1-3.noarch.rpm + +接下来安装Percona: + + + yum install Percona-Server-client-56 Percona-Server-server-56 + +上面的命令安装Percona的服务器和客户端,共享库,可能需要Perl和Perl模块,以及其他依赖的需要。如DBI::MySQL的,如果这些尚未安装, + +使用RPM包安装: + + +我们可以使用wget命令下载所有的rpm包: + + + wget -r -l 1 -nd -A rpm -R "*devel*,*debuginfo*" \ http://www.percona.com/downloads/Percona-Server-5.5/Percona-Server-5.5.42-37.1/binary/redhat/7/x86_64/ + +使用rpm工具,一次性安装所有的rpm包: + + + rpm -ivh Percona-Server-server-55-5.5.42-rel37.1.el7.x86_64.rpm \ Percona-Server-client-55-5.5.42-rel37.1.el7.x86_64.rpm \ Percona-Server-shared-55-5.5.42-rel37.1.el7.x86_64.rpm + +注意在上面命令语句中最后的反斜杠'\',如果您安装单独的软件包,记住要解决依赖关系,在安装客户端之前要先安装共享包,在安装服务器之前请先安装客户端。 + +### 5.配置Percona服务器 ### + + + +#### 恢复之前的配置 #### + + +当我们从MariaDB迁移过来时,你可以将之前的my.cnf的备份文件恢复回来。 + + + cp /etc/my.cnf.bkp /etc/my.cnf + +#### 创建一个新的my.cnf文件 #### + + +如果你需要一个适合你需求的新的配置文件或者你并没有备份配置文件,你可以使用以下方法,通过简单的几步生成新的配置文件。 + +下面是Percona-server软件包自带的my.cnf文件 + + + # Percona Server template configuration + + [mysqld] + # + # Remove leading # and set to the amount of RAM for the most important data + # cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%. + # innodb_buffer_pool_size = 128M + # + # Remove leading # to turn on a very important data integrity option: logging + # changes to the binary log between backups. + # log_bin + # + # Remove leading # to set options mainly useful for reporting servers. + # The server defaults are faster for transactions and fast SELECTs. + # Adjust sizes as needed, experiment to find the optimal values. + # join_buffer_size = 128M + # sort_buffer_size = 2M + # read_rnd_buffer_size = 2M + datadir=/var/lib/mysql + socket=/var/lib/mysql/mysql.sock + + # Disabling symbolic-links is recommended to prevent assorted security risks + symbolic-links=0 + + [mysqld_safe] + log-error=/var/log/mysqld.log + pid-file=/var/run/mysqld/mysqld.pid + +根据你的需要配置好my.cnf后,就可以启动该服务了: + + + systemctl restart mysql.service + +如果一切顺利的话,它已经准备好执行SQL命令了,你可以用以下命令检查它是否已经正常启动: + + + mysql -u root -p -e 'SHOW VARIABLES LIKE "version_comment"' + +如果你不能够正常启动它,你可以在**/var/log/mysql/mysqld.log**中查找原因,该文件可在my.cnf的[mysql_safe]的log-error中设置。 + + tail /var/log/mysql/mysqld.log + +你也可以在/var/lib/mysql/文件夹下查找格式为[hostname].err的文件,就像下面这个例子样: + + + tail /var/lib/mysql/centos7.err + +如果还是没找出原因,你可以试试strace: + + + yum install strace && systemctl stop mysql.service && strace -f -f mysqld_safe +上面的命令挺长的,输出的结果也相对简单,但绝大多数时候你都能找到无法启动的原因。 + +### 6.保护你的数据 ### + +好了,你的关系数据库管理系统已经准备好接收SQL查询,但是把你宝贵的数据放在没有最起码安全保护的服务器上并不可取,为了更为安全最好使用mysql_secure_instalation,这个工具可以帮助删除未使用的默认功能,还设置root的密码,并限制使用此用户进行访问。 +只需要在shell中执行,并参照屏幕上的说明。 + + mysql_secure_install + +### 7.还原备份 ### + +如果您参照之前的设置,现在你可以恢复数据库,只需再用mysqldump一次。 + + + mysqldump -u root -p < mydatabases.sql +恭喜你,你刚刚已经在你的CentOS上成功安装了Percona,你的服务器已经可以正式投入使用;你可以像使用MYSQL一样使用它,你的服务器与他完全兼容。 + +### 总结 ### + +为了获得更强的性能你需要对配置文件做大量的修改,但这里也有一些简单的选项来提高机器的性能。当使用InnoDB引擎时,将innodb_file_per_table设置为on,它将在一个文件中为每个表创建索引表,这意味着每个表都有它自己的索引文件,它使系统更强大和更容易维修。 + +可以修改innodb_buffer_pool_size选项,InnoDB应该有足够的缓存池来应对你的数据集,大小应该为当前可用内存的70%到80%。 + +过将innodb-flush-method设置为O_DIRECT,关闭写入高速缓存,如果你使用了RAID,这可以提升性能因为在底层已经完成了缓存操作。 + +如果你的数据并不是十分关键并且并不需要对数据库事务正确执行的四个基本要素完全兼容,可以将innodb_flush_log_at_trx_commit设置为2,这也能提升系统的性能。 + + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/linux-how-to/percona-server-centos-7/ + +作者:[Carlos Alberto][a] +译者:[FatJoe123](https://github.com/FatJoe123) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://linoxide.com/author/carlosal/ From 2eb16fd656fcc8ece9033fe6b6d5bcfa43a43319 Mon Sep 17 00:00:00 2001 From: Alan You <1058413893@qq.com> Date: Thu, 11 Jun 2015 22:23:53 +0800 Subject: [PATCH 350/965] Delete 20150515 How to Install Percona Server on CentOS 7.md --- ...w to Install Percona Server on CentOS 7.md | 227 ------------------ 1 file changed, 227 deletions(-) delete mode 100644 sources/tech/20150515 How to Install Percona Server on CentOS 7.md diff --git a/sources/tech/20150515 How to Install Percona Server on CentOS 7.md b/sources/tech/20150515 How to Install Percona Server on CentOS 7.md deleted file mode 100644 index 1ac8d71901..0000000000 --- a/sources/tech/20150515 How to Install Percona Server on CentOS 7.md +++ /dev/null @@ -1,227 +0,0 @@ -translating by FatJoe123 -如何在CentOS 7上安装Percona Server -How to Install Percona Server on CentOS 7 -================================================================================ -在这篇文章中我们将了解关于Percona Server,一个开源简易的MySQL,MariaDB的替代。InnoDB的数据库引擎使得Percona Server非常有吸引力,如果你需要的高性能,高可靠性和高性价比的解决方案,它将是一个很好的选择。 -In this article we are going to learn about percona server, an opensource drop-in replacement for MySQL and also for MariaDB. The InnoDB database engine make it very attractive and a good alternative if you need performance, reliability and a cost efficient solution -在接下来的文节中将涵盖在CentOS的7 Percona的服务器的安装,以及备份当前数据,配置的步骤和如何恢复备份。 -In the following sections I am going to cover the installation of the percona server on the CentOS 7, I will also cover the steps needed to make backup of your current data, configuration and how to restore your backup. - -###目录### -### Table of contents ### - -1.什么是Percona,为什么使用它 -2.备份你的数据库 -3.删除之前的SQL服务器 -4.使用二进制包安装Percona -5.配置Percona -6. -7.恢复你的备份 - -1. What is and why use percona -1. Backup your databases -1. Remove previous SQL server -1. Installing Percona binaries -1. Configuring Percona -1. Securing your environment -1. Restore your backup - -### 1.什么是Percona,为什么使用它 -### 1. What is and why use Percona ### - -Percona是一个开源简易的MySQL,MariaDB数据库的替代,它是MYSQL的一个分支,相当多的改进和独特的功能使得它比MYSQL更可靠,性能更强,速度更快,它与MYSQL完全兼容,在Oracle的MYSQL与Percona之间你甚至都可以使用复制命令。 -Percona is an opensource alternative to the MySQL and MariaDB databases, it's a fork of the MySQL with many improvements and unique features that makes it more reliable, powerful and faster than MySQL, and yet is fully compatible with it, you can even use replication between Oracle's MySQL and Percona. -#### 在Percona中独特的功能 #### -#### Features exclusive to Percona #### - --分段自适应哈希搜索 --快速校验算法 --缓冲池预加载 --支持FlashCache -- Partitioned Adaptive Hash Search -- Fast Checksum Algorithm -- Buffer Pool Pre-Load -- Support for FlashCache - -#### MySQL企业版和Percona的特定功能 #### -#### MySQL Enterprise and Percona specific features #### - --从不同的服务器导入表 --PAM认证 --审计日志 --线程池 - -- Import Tables From Different Servers -- PAM authentication -- Audit Log -- Threadpool - -现在,你肯定很兴奋地看到这些好的东西整理在一起,我们将告诉你如何安装和做些的Percona Server的基本配置。 -Now that you are pretty excited to see all these good things together, we are going show you how to install and do basic configuration of Percona Server. - -### 2. 备份你的数据库 ### -### 2. Backup your databases ### - -接下来,在命令行下使用SQL命令创建一个mydatabases.sql文件来重建/恢复salesdb和employeedb数据库,重命名数据库以便反映你的设置,如果没有安装MYSQL跳过此步 -The following, command creates a mydatabases.sql file with the SQL commands to recreate/restore salesdb and employeedb databases, replace the databases names to reflect your setup, skip if this is a brand new setup - - mysqldump -u root -p --databases employeedb salesdb > mydatabases.sql - -复制当前的配置文件,如果你没有安装MYSQL也可跳过 -Copy the current configuration file, you can also skip this in fresh setups - - cp my.cnf my.cnf.bkp - -### 3.删除之前的SQL服务器 ### -### 3. Remove your previous SQL Server ### - -停止MYSQL/MariaDB如果它们还在运行 -Stop the MySQL/MariaDB if it's running. - - systemctl stop mysql.service - -卸载MariaDB和MYSQL -Uninstall MariaDB and MySQL - - yum remove MariaDB-server MariaDB-client MariaDB-shared mysql mysql-server - -移动重命名在/var/lib/mysql当中的MariaDB文件,这比仅仅只是移除更为安全快速,这就像2级即时备份。:) -Move / Rename the MariaDB files in **/var/lib/mysql**, it's a safer and faster than just removing, it's like a 2nd level instant backup. :) - - mv /var/lib/mysql /var/lib/mysql_mariadb - -### 4.使用二进制包安装Percona ### -### 4. Installing Percona binaries ### - -你可以在众多Percona安装方法中选择,在CentOS中使用Yum或者RPM包安装通常是更好的主意,所以这些是本文介绍的方式,下载源文件编译后安装在本文中并没有介绍。 - -You can choose from a number of options on how to install Percona, in a CentOS system it's generally a better idea to use yum or RPM, so these are the way that are covered by this article, compiling and install from sources are not covered by this article. - -从Yum仓库中安装: -Installing from Yum repository: - -首先,你需要用这个设置的Percona的Yum库: -First you need to set the Percona's Yum repository with this: - - yum install http://www.percona.com/downloads/percona-release/redhat/0.1-3/percona-release-0.1-3.noarch.rpm - -接下来安装Percona: -And then install Percona with: - - yum install Percona-Server-client-56 Percona-Server-server-56 - -上面的命令安装Percona的服务器和客户端,共享库,可能需要Perl和Perl模块,如DBI::MySQL的,如果尚未安装,以及其他依赖的需要。 -The above command installs Percona server and clients, shared libraries, possibly Perl and perl modules such as DBI::MySQL, if that are not already installed, and also other dependencies as needed. - -Installing from RPM package: - -We can download all rpm packages with the help of wget: - - wget -r -l 1 -nd -A rpm -R "*devel*,*debuginfo*" \ http://www.percona.com/downloads/Percona-Server-5.5/Percona-Server-5.5.42-37.1/binary/redhat/7/x86_64/ - -And with rpm utility, you install all the packages once: - - rpm -ivh Percona-Server-server-55-5.5.42-rel37.1.el7.x86_64.rpm \ Percona-Server-client-55-5.5.42-rel37.1.el7.x86_64.rpm \ Percona-Server-shared-55-5.5.42-rel37.1.el7.x86_64.rpm - -Note the backslash '\' on the end of the sentences on the above commands, if you install individual packages, remember that to met dependencies, the shared package must be installed before client and client before server. - -### 5. Configuring Percona Server ### - -#### Restoring previous configuration #### - -As we are moving from MariaDB, you can just restore the backup of my.cnf file that you made in earlier steps. - - cp /etc/my.cnf.bkp /etc/my.cnf - -#### Creating a new my.cnf #### - -If you need a new configuration file that fit your needs or if you don't have made a copy of my.cnf, you can use this wizard, it will generate for you, through simple steps. - -Here is a sample my.cnf file that comes with Percona-Server package - - # Percona Server template configuration - - [mysqld] - # - # Remove leading # and set to the amount of RAM for the most important data - # cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%. - # innodb_buffer_pool_size = 128M - # - # Remove leading # to turn on a very important data integrity option: logging - # changes to the binary log between backups. - # log_bin - # - # Remove leading # to set options mainly useful for reporting servers. - # The server defaults are faster for transactions and fast SELECTs. - # Adjust sizes as needed, experiment to find the optimal values. - # join_buffer_size = 128M - # sort_buffer_size = 2M - # read_rnd_buffer_size = 2M - datadir=/var/lib/mysql - socket=/var/lib/mysql/mysql.sock - - # Disabling symbolic-links is recommended to prevent assorted security risks - symbolic-links=0 - - [mysqld_safe] - log-error=/var/log/mysqld.log - pid-file=/var/run/mysqld/mysqld.pid - -After making your my.cnf file fit your needs, it's time to start the service: - - systemctl restart mysql.service - -If everything goes fine, your server is now up and ready to ready to receive SQL commands, you can try the following command to check: - - mysql -u root -p -e 'SHOW VARIABLES LIKE "version_comment"' - -If you can't start the service, you can look for a reason in **/var/log/mysql/mysqld.log** this file is set by the **log-error** option in my.cnf's **[mysqld_safe]** session. - - tail /var/log/mysql/mysqld.log - -You can also take a look in a file inside **/var/lib/mysql/** with name in the form of **[hostname].err** as the following example: - - tail /var/lib/mysql/centos7.err - -If this also fail in show what is wrong, you can also try strace: - - yum install strace && systemctl stop mysql.service && strace -f -f mysqld_safe - -The above command is extremely verbous and it's output is quite low level but can show you the reason you can't start service in most times. - -### 6. Securing your environment ### - -Ok, you now have your RDBMS ready to receive SQL queries, but it's not a good idea to put your precious data on a server without minimum security, it's better to make it safer with mysql_secure_instalation, this utility helps in removing unused default features, also set the root main password and make access restrictions for using this user. -Just invoke it by the shell and follow instructions on the screen. - - mysql_secure_install - -### 7. Restore your backup ### - -If you are coming from a previous setup, now you can restore your databases, just use mysqldump once again. - - mysqldump -u root -p < mydatabases.sql - -Congratulations, you just installed Percona on your CentOS Linux, your server is now fully ready for use; You can now use your service as it was MySQL, and your services are fully compatible with it. - -### Conclusion ### - -There is a lot of things to configure in order to achieve better performance, but here is some straightforward options to improve your setup. When using innodb engine it's also a good idea to set the **innodb_file_per_table** option **on**, it gonna distribute table indexes in a file per table basis, it means that each table have it's own index file, it makes the overall system, more robust and easier to repair. - -Other option to have in mind is the **innodb_buffer_pool_size** option, InnoDB should have large enough to your datasets, and some value **between 70% and 80%** of the total available memory should be reasonable. - -By setting the **innodb-flush-method** to **O_DIRECT** you disable write cache, if you have **RAID**, this should be set to improved performance as this cache is already done in a lower level. - -If your data is not that critical and you don't need fully **ACID** compliant transactions, you can adjust to 2 the option **innodb_flush_log_at_trx_commit**, this will also lead to improved performance. - --------------------------------------------------------------------------------- - -via: http://linoxide.com/linux-how-to/percona-server-centos-7/ - -作者:[Carlos Alberto][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://linoxide.com/author/carlosal/ From d0aff8d13f681c729c683bdd4ab3589efa16f480 Mon Sep 17 00:00:00 2001 From: wxy Date: Thu, 11 Jun 2015 22:42:51 +0800 Subject: [PATCH 351/965] PUB:20150603 Arc Is a Gorgeous GTK Theme for Linux Desktops @geekpi --- ...a Gorgeous GTK Theme for Linux Desktops.md | 57 +++++++++++++++++++ ...a Gorgeous GTK Theme for Linux Desktops.md | 55 ------------------ 2 files changed, 57 insertions(+), 55 deletions(-) create mode 100644 published/20150603 Arc Is a Gorgeous GTK Theme for Linux Desktops.md delete mode 100644 translated/share/20150603 Arc Is a Gorgeous GTK Theme for Linux Desktops.md diff --git a/published/20150603 Arc Is a Gorgeous GTK Theme for Linux Desktops.md b/published/20150603 Arc Is a Gorgeous GTK Theme for Linux Desktops.md new file mode 100644 index 0000000000..e8fd8c6dbd --- /dev/null +++ b/published/20150603 Arc Is a Gorgeous GTK Theme for Linux Desktops.md @@ -0,0 +1,57 @@ +一款很棒的GTK桌面主题:Arc +================================================================================ +![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/06/arc-gtk-theme.jpg) + +距离本站上次推荐的GTK主题已经过了很久了。但是看到上图中的Arc主题后,就值得打破冷场了。我们不能不推荐它! + +### Arc GTK主题 ### + +![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/06/see-through-theme.png) + +*透明,并不符合每个人的口味* + +Arc是一个扁平化主题并有微妙的配色方案,窗口的选中区域是透明的,如GTK的顶栏和Nautilus的侧边栏。 + +它的效果不像我们之前介绍的主题那样将程序渲染的像那么混乱。有点像 OSX Yosemite,效果用的不多但是很好。 + +与之伴随的图标集(称为Vertex)同样工作的很好。 + +**是的它支持Unity** + +Arc主题支持基于GTK3和GTK2桌面环境,包含Gnome Shell(当然了)和标准的Ubuntu Unity。 + +它可以很好地游刃于轻量级的Budgie和elementary的Pantheon桌面之间,并且与Cinnamon配合也不错。 + +![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/06/Screen-Shot-2015-06-02-at-18.07.15.png) + +*Arc中的开关、滑块和小挂件* + +它并不容易下载与安装- *understatement klaxon* - 因为它还在密集开发中。 + +安装包需要GTK 3.14及以上,这意味着Ubuntu 14.04 LTS和14.10的用户无法使用了。 + +那些使用Ubuntu 15.04的用户可以使用这个主题。你可以添加ppa或者双击.deb包来安装。 + +如果你喜欢它,你需要卷起你的袖子并查看github上的编译指导。 + +- [Github中Arc安装指导][1] + +更新6/7:现在可以使用软件库来安装它(由 openSUSE 用户 Horst1380 创建,也可用于 Ubuntu 用户),也可以下载预打包的 .deb 文件。 + +- [Horst31890 的 Arc 主题库][2] +- [下载 Arc 主题 .deb][3] + +-------------------------------------------------------------------------------- + +via: http://www.omgubuntu.co.uk/2015/06/arc-gtk-theme + +作者:[Joey-Elijah Sneddon][a] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://plus.google.com/117485690627814051450/?rel=author +[1]:https://github.com/horst3180/Arc-theme +[2]:http://software.opensuse.org/download.html?project=home%3AHorst3180&package=arc-theme +[3]:http://download.opensuse.org/repositories/home:/Horst3180/xUbuntu_15.04/all/arc-theme_1433786431.697b2c3_all.deb \ No newline at end of file diff --git a/translated/share/20150603 Arc Is a Gorgeous GTK Theme for Linux Desktops.md b/translated/share/20150603 Arc Is a Gorgeous GTK Theme for Linux Desktops.md deleted file mode 100644 index 14dd88ef70..0000000000 --- a/translated/share/20150603 Arc Is a Gorgeous GTK Theme for Linux Desktops.md +++ /dev/null @@ -1,55 +0,0 @@ -Arc是一个很棒的Linux桌面的GTK主题 -================================================================================ -![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/06/arc-gtk-theme.jpg) - -距离本站上次推荐的GTK主题已经过了很久了。 - -但是看到上面的Arc后,需要纠正这点了。 - -我们不能不提到它。 - -### Arc GTK主题 ### - -![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/06/see-through-theme.png) - -Transparency. Not to everyones’ taste. -透明并不符合每个人的口味 - -Arc是一个扁平化主题并有微妙的配色并部分选中的窗口透明,就像GTK的顶拦和Nautilus的侧边栏。 - - -它的效果不像我们之前的主题那样将程序渲染的像躲猫猫那样混乱。像OSX Yosemite,效果用的不变多但是很好。 - -随之的图标集(称为Vertex)同样可用。 - -**是的它支持Unity** - -Arc主题支持基于GTK3和GTK2桌面环境,包含Gnome Shell(当然)和标准的Ubuntu Unity。 - -它也可以很好地与轻量级的Budgie和elementary的Pantheon桌面以及也可以工作在Cinnamon上。 - -![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/06/Screen-Shot-2015-06-02-at-18.07.15.png) - -Arc中的开关、滑块和小挂件。 - -它并不容易下载与安装- *understatement klaxon* - 因为它还在密集开发中。 - - -安装包需要GTK 3.14或者更新,这意味着Ubuntu 14.04 LTS和14.10的用户无法使用了。 - -那些使用Ubuntu 15.04的用户可以使用这个主题。你还不能添加ppa或者双击.deb包。如果你喜欢你看见的你需要卷起你的袖子并查看github上的编译指导。 - -- [Github中Arc安装指导][1] - --------------------------------------------------------------------------------- - -via: http://www.omgubuntu.co.uk/2015/06/arc-gtk-theme - -作者:[Joey-Elijah Sneddon][a] -译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://plus.google.com/117485690627814051450/?rel=author -[1]:https://github.com/horst3180/Arc-theme From aa6668080ff88d363b633c897a10a7511e417623 Mon Sep 17 00:00:00 2001 From: wxy Date: Thu, 11 Jun 2015 23:30:14 +0800 Subject: [PATCH 352/965] PUB:20150209 How to access Feedly RSS feed from the command line on Linux MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @chenzhijun 翻译的不错,有些错别字下回需要注意。另外,注意保持原文的 markdown 段落等格式。 明天下午就可以看到了: https://linux.cn/article-5615-1.html --- ...RSS feed from the command line on Linux.md | 111 ++++++++++++++++ ...RSS feed from the command line on Linux.md | 123 ------------------ 2 files changed, 111 insertions(+), 123 deletions(-) create mode 100644 published/20150209 How to access Feedly RSS feed from the command line on Linux.md delete mode 100644 translated/tech/20150209 How to access Feedly RSS feed from the command line on Linux.md diff --git a/published/20150209 How to access Feedly RSS feed from the command line on Linux.md b/published/20150209 How to access Feedly RSS feed from the command line on Linux.md new file mode 100644 index 0000000000..6eac136d1a --- /dev/null +++ b/published/20150209 How to access Feedly RSS feed from the command line on Linux.md @@ -0,0 +1,111 @@ +在 Linux 上如何用命令行获取 Freely RSS 源 +================================================================================ + +也许你并不知道 Feedly,它是世界上最流行的在线新闻聚合服务之一;它提供了平滑而一致的新闻阅读体验,你可以使用电脑的浏览器扩展,Android 和 iOS 设备上的移动应用程序等来体验Feedly。Feedly 在2013年Google Reader 停用后,迅速的获得了一大批Google Reader的用户。我就是他们之中的一位。从这以后,Feedly就一直是我的默认RSS(简易信息聚合)阅读器。 + +除了使用我非常喜欢的Feedly浏览器扩展和手机上的Feedly程序,这里还有一种途径来获取Feedly:Linux命令行。没错,你可以用命令行来获取Feedly上的新闻概要。听起来非常傻?但是对于那些在服务器上工作的系统管理员来说,这是非常有用的。 + +点击进入[Feednix][2],这个用c++编写的开源软件是Feedly的非官方命令行客户端。它允许你在一个基于ncurses的终端界面(例如:bash)下浏览Feedly的新闻。默认模式下,Feednix 关联了一个叫做 w3m 的基于控制台的浏览器,允许你在命令行终端的环境下阅读文章。当然你也可以选择使用你喜欢的网页浏览器。 + +在这个教程中,我准备示范一下怎样在命令行下安装和配置Feednix 来获取Feedly。 + +### 在Linux下安装Feednix ### + +你可以通过以下的步骤从源代码中构建Feednix。同时,在其官方的github仓库的Ubuntu-stable(Ubuntu稳定版本)的分支上有最新的Feednix源代码。现在让我们开始吧: + +作为必要组件,你需要安装一组开发包,和w3m浏览器(文字式页面浏览器)。 + +#### 在Debian、Ubuntu 和Linux Mint 操作 #### + + $ sudo apt-get install git automake g++ make libncursesw5-dev libjsoncpp-dev libcurl4-gnutls-dev w3m + $ git clone -b Ubuntu-stable https://github.com/Jarkore/Feednix.git + $ cd Feednix + $ ./autogen.sh + $ ./configure + $ make + $ sudo make install + + +#### 在Fedora 下操作 #### + + $ sudo yum groupinstall "C Development Tools and Libraries" + $ sudo yum install gcc-c++ git automake make ncurses-devel jsoncpp-devel libcurl-devel w3m + $ git clone -b Ubuntu-stable https://github.com/Jarkore/Feednix.git + $ cd Feednix + $ ./autogen.sh + $ ./configure + $ make + $ sudo make install + +#### Arch Linux #### + +在Arch Linux发行版下,你可以非常容易的从 [AUR][3]安装Feednix。 + +### 配置Feednix ### + +在安装完软件后,用下面的命令启动Feednix + + $ feednix + +如果你是第一次运行Feddnix,它会弹出一个网页浏览器窗口,在这个窗口里,你需要登录来创建一个Feedly的账户ID和相应的开发人员密钥。 + +如果你是在无桌面环境下运行Feednix,先在另外一台电脑上打开一个网页,进入到网站:https://feedly.com/v3/auth/dev 。 + +![](https://farm8.staticflickr.com/7427/15825106524_42883b3e32_b.jpg) + +当你登录后,你对应的Feedly账户ID就生成了。 + +![](https://farm9.staticflickr.com/8565/15827565143_eb93db9c81_b.jpg) + +为了得到一个访问密钥,你需要在浏览器上访问发送你的邮箱中的密钥链接。之后就会在浏览器窗口显示你的用户ID,密钥,和密钥的有效期。请注意密钥的长度是非常长的(超过200个字符),所以密钥显示在一个带有垂直滚动条的文本框内,请确保把整个密钥复制下来。 + +![](https://farm9.staticflickr.com/8605/16446685812_9098df494b_b.jpg) + +像下面这样,把你的用户ID和密钥输入到Feddnix的命令行提示下: + + [Enter User ID] >> XXXXXX + [Enter token] >> YYYYY + +成功授权后,你会在屏幕上见到一个初始化为两个窗格的Feednix界面。左边的标题为“Categories”窗格,显示了一个新闻分类栏;右边“Posts”窗格显示了当前类别的新闻文章。 + +![](https://farm8.staticflickr.com/7412/16421639256_deb8e2d276_c.jpg) + +### 用Feednix读文章 ### + +这里我想简要描叙一下怎样通过Feednix来访问Feedly。 + +#### 在Feednix中导航 #### + +像我之前提过的,Feednix窗口包含了两个窗格。想在两个窗口之间进行切换的话,可以使用"TAB"健。想在一个窗格内的列表中上下移动,可以使用"j"和"k"。这些快捷健明显是受到了Vim编辑器的启发。 + +#### 阅读文章 #### + +想阅读一篇特定的文章,可以在当前的文章上使用"o"健。它会调用w3m浏览器,并且在浏览器里面加载文章。当你读完之后,可以使用"q"健来退出浏览器,并返回到Feednix。如果你的电脑环境允许打开网页浏览器,你可以按"0"健来在你默认的网页浏览器里面加载文章,比如使用Firefox。 + +![](https://farm8.staticflickr.com/7406/16445870201_b98e8da6d9_b.jpg) + +#### 订阅新闻源 #### + +你可以在Feednix界面中来为你的Feedly账户增加任何一种RSS新闻源。要这么做,仅仅只需要按下"a"键,它会在屏幕底部显示一个"[ENTER FEED]:"的提示。在输入完RSS新闻源后,继续输入新闻源的名字和及其首选分类。 + +![](https://farm8.staticflickr.com/7324/16421639296_b52ed3c52e_c.jpg) + +#### 总结 #### + +如你所见, Feednix 是一个非常方便易用的命令行RSS阅读器。如果你是重度依赖命令行的用户,同时也是一个Feedly用户的话,Feednix 是肯定值得去尝试的。我和Feednix的开发者Jarkore交流解决了一些问题。我想说,对于[bug的报告][4]和修复他非常的积极。鼓励大家来试用Feednix,并且给他(Jarkore)一些回馈。 + +-------------------------------------------------------------------------------- + +via: http://xmodulo.com/feedly-rss-feed-command-line-linux.html + +作者:[Dan Nanni][a] +译者:[chenzhijun](https://github.com/chenzhijun) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://xmodulo.com/author/nanni +[1]:https://feedly.com/ +[2]:https://github.com/Jarkore/Feednix +[3]:https://aur.archlinux.org/packages/feednix/ +[4]:https://github.com/Jarkore/Feednix/issues diff --git a/translated/tech/20150209 How to access Feedly RSS feed from the command line on Linux.md b/translated/tech/20150209 How to access Feedly RSS feed from the command line on Linux.md deleted file mode 100644 index 4109ceb947..0000000000 --- a/translated/tech/20150209 How to access Feedly RSS feed from the command line on Linux.md +++ /dev/null @@ -1,123 +0,0 @@ -从Linux命令行获取基于RSS协议的Feedly上信息 -================================================================================ - -也许你并不知道,Feedly --世界上最流行的在线新闻聚合服务之一;它提供了无缝地统一的新闻阅读体验,你可以使用电脑的浏览器扩展,Android 和 iOS 设备上的移动应用程序等来体验Feedly。Feedly 在2013年Google Reader 停用后,迅速的获得了一大批Google Reader的用户。我就是他们之中的一位。从这以后,Feedly就一直是我的默认RSS(简易信息聚合)阅读器 -除了我非常喜欢的Feedly浏览器扩展和手机上的Feedly程序,这里还有一种途径来获取Feedly:Linux command-line (Linux命令行) -对的。你可以用命令行来获取Feedly上的新闻概要。 - -听起来非常傻?但是对于那些在服务器上工作的系统管理员来说,这是非常有用的。 -点击进入[Feednix][2]. 这个用c++编写的开源软件是Feedly的非官方命令行客户端。它允许你浏览Feedly的新闻在一个基于字符的终端界面(例如:bash)。默认模式下,Feednix 连接了一个基于控制台的浏览器,这个浏览器的名字叫w3m,允许你在命令行终端的环境下阅读文章。当然你也可以选择使用你喜欢的网页浏览器。在这个教程中,我准备示范以下怎样在命令行下安装和配置Feednix 来获取获取Feedly。 - -### 在Linux下安装Feednix ### - -你可以通过以下的步骤从源代码中安装Feednix。同时,在github的Ubuntu分区里面Ubuntu-stable(Ubuntu稳定版本)的分支上有最新的Feednix源代码。现在让我们开始吧: -作为必要组件,你需要安装一组开发包,和w3m浏览器(文字式页面浏览器)。 - -#### 在Debian,Ubuntu 和Linux Mint 操作 #### - - $ sudo apt-get install git automake g++ make libncursesw5-dev libjsoncpp-dev libcurl4-gnutls-dev w3m - $ git clone -b Ubuntu-stable https://github.com/Jarkore/Feednix.git - $ cd Feednix - $ ./autogen.sh - $ ./configure - $ make - $ sudo make install - - -#### 在Fedora 下操作 #### - - $ sudo yum groupinstall "C Development Tools and Libraries" - $ sudo yum install gcc-c++ git automake make ncurses-devel jsoncpp-devel libcurl-devel w3m - $ git clone -b Ubuntu-stable https://github.com/Jarkore/Feednix.git - $ cd Feednix - $ ./autogen.sh - $ ./configure - $ make - $ sudo make install - -Arch Linux - -在Arch Linux发行版下, 你可以非常容易的安装Feednix 从 [AUR][3]. - - -### 配置Feednix ### - -在安装完软件后,用下面的命令启动Feednix - - $ feednix - -如果你是第一次运行Feddnix,它会弹出一个网页浏览器窗口,在这个窗口里,你需要登陆来创建一个Feedly的账户ID和相应的开发人员密钥。 - -如果你是在无桌面环境下运行Feednix,先在另外一台电脑上打开一个网页,进入到网站:https://feedly.com/v3/auth/dev. - -![](https://farm8.staticflickr.com/7427/15825106524_42883b3e32_b.jpg) - -一旦你登陆,你对应的Feedly账户ID就生成了。 - -![](https://www.flickr.com/photos/xmodulo/15827565143/) - -为了验证密钥,你需要在浏览器上允许验证密钥的链接发送你的邮箱。之后就会在浏览器窗口显示你的用户ID,密钥,和密钥的有效期。 -请注意密钥的长度是非常超过200个字符的。所以密钥显示在一个带有垂直滚动条的文书框内,请确保把整个密钥的长度复制下来。 - -![](https://farm9.staticflickr.com/8605/16446685812_9098df494b_b.jpg) - -向下面这样,把你的用户ID和密钥输入到Feddnix的命令行提示下: - - [Enter User ID] >> XXXXXX - [Enter token] >> YYYYY - -成功授权后,你会在屏幕上见到一个初始化的有两个窗格的Feednix界面 - -左边的标题为“Categories”窗格,显示了一个新闻分类栏;右边“Posts”窗格显示了当前类别的新闻文章 - -![](https://farm8.staticflickr.com/7412/16421639256_deb8e2d276_c.jpg) - - -### 用Feednix读文章 ### - -这里我想简要描叙一下怎样通过Feednix来访问Feedly。 - - -#### Feednix界面 #### - -向我之前提过的,Feednix窗口包含了两个窗格。想在两个窗口之间进行切换的话,可以使用"TAB"健。在一个窗格内,想上下移动选择可以使用"j"和"k"。 -这些快捷健明显是受到了使用Vim编辑器的人启发。 - -#### 阅读文章 #### - -想阅读一些有特色的文章,可以在选定的文章上使用"o"健。它会调用w2m浏览器,并且在浏览器里面加载文章。 -一旦你读完之后,可以使用"q"健来推出当前W2m浏览器,并且返回到Feednix. -如果你的电脑环境允许打开一个网页浏览器,你可以按"0"健来在你默认的网页浏览器里面家在文章,比如使用Firefox. - - -![](https://farm8.staticflickr.com/7406/16445870201_b98e8da6d9_b.jpg) - - -#### 订阅新闻 #### - -你可以通过Feednix来为你的Feedly账户增加任何一种RSS新闻。 -要这么做,仅仅只需要按下"a"键,它会显示一个"[ENTER FEED]:"的提示在屏幕上,然后按下"ENTER" -在选择完RSS新闻后,继续为它编写分组信息和分类。 - -![](https://farm8.staticflickr.com/7324/16421639296_b52ed3c52e_c.jpg) - -#### 总结 #### - - -现在你知道了吧, Feednix 是一个非常友好的并且容易使用的命令行RSS阅读器。如果你是重度依赖命令行的用户或者是一个Feedly用户,Feednix 是肯定值得去尝试的。 -我经常和Feednix的开发者Jarkore交流来解决一些问题。我想说,对于bug的报告和修复他非常的积极。 -鼓励大家来试用Feednix,并且给他(Jarkore)一些回馈。 --------------------------------------------------------------------------------- - -via: http://xmodulo.com/feedly-rss-feed-command-line-linux.html - -作者:[Dan Nanni][a] -译者:[chenzhijun](https://github.com/chenzhijun) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://xmodulo.com/author/nanni -[1]:https://feedly.com/ -[2]:https://github.com/Jarkore/Feednix -[3]:https://aur.archlinux.org/packages/feednix/ From 7f623c6628759dbac4dc7568590306b8bf82d53c Mon Sep 17 00:00:00 2001 From: theo-l Date: Thu, 11 Jun 2015 22:39:24 -0300 Subject: [PATCH 353/965] I translated the documentation of tmux, just take a look --- translated/tech/Tmux_doc_cn.md | 1646 ++++++++++++++++++++++++++++++++ 1 file changed, 1646 insertions(+) create mode 100644 translated/tech/Tmux_doc_cn.md diff --git a/translated/tech/Tmux_doc_cn.md b/translated/tech/Tmux_doc_cn.md new file mode 100644 index 0000000000..5d2ac507c2 --- /dev/null +++ b/translated/tech/Tmux_doc_cn.md @@ -0,0 +1,1646 @@ +- [名称](#名称) +- [用法](#用法) +- [描述](#描述) +- [键绑定](#键绑定) +- [命令](#命令) +- [客户端和会话](#客户端和会话) +- [窗口和面板](#窗口和面板) + - [窗口和面板命令](#窗口和面板命令) +- [键绑定2](#键绑定2) + - [键绑定命令](#键绑定命令) +- [选项](#选项) + - [选项设置](#选项设置) + - [服务器选项](#服务器选项) + - [会话选项](#会话选项) + - [窗口选项](#窗口选项) +- [鼠标支持](#鼠标支持) +- [格式](#格式) +- [名称和标题](#名称和标题) +- [环境](#环境) +- [状态行](#状态行) +- [缓冲区](#缓冲区) +- [杂项](#杂项) +- [TERMINFO EXTENSIONS](#TERMINFO EXTENSIONS) +- [控制模式](#控制模式) +- [文件](#文件) +- [样例](#样例) + + +##名称 +tmux — terminal multiplexer(终端复用器) + +##用法: + + tmux [-2lCuv] [-c shell-command] [-f file] [-L socket-name] [-S socket-path] [command [flags]] + +##描述 + +tmux是一个终端复用器:它可以在单个屏幕中创建、访问以及控制多个终端。 +tmux也可以从窗口中脱离附着并且继续在后台运行,以便在之后再回到会话。 +当开启tmux之后,它会创建带有一个单独窗口的会话并且在屏幕中进行显示。 +在屏幕底部的状态行显示当前会话的信息并且用来进入交互式命令。 +一个会话是一个在tmux管理下的伪终端集合,每个会话具有一个或多个窗口与其链接。 +一个窗口占用了整个屏幕,并且可以被分割成长方形的面板,每个面板分别为一个伪终端。 +多个tmux实例可能连接到同一个会话,并且任何的窗口可能在一个会话中表示。 +当所有的会话被终止之后,tmux就会退出。 + +每个会话都是持久的并且可能在意外失联或故意脱离附着之后生存下来,tmux可以使用下面的命令来恢复原来的会话: + + $ tmux attach + +在tmux中,一个会话由一个客户端在整个屏幕中显示,并且所有的会话都是由一个单独的服务器进行管理的。 +这个服务器以及每个客户端是通过一个在/tmp中的socket进行交流的。 + +*选项描述*: + + '-2' + 强制tmux假设终端支持256颜色。 + + '-C' + 以控制模式开启,使用-CC来让echo失效 + + '-c shell-command' + 使用默认的shell来执行shell命令。 + 如果有必要的话,tmux服务器会开启来检索默认的shell选项。 + 这个选项用来当tmux作为一个登录shell时与sh进行兼容的。 + + '-f file' + 指定一个可选的配置文件,默认情况下,tmux会从/etc/tmux.conf中加载系统配置文件-如果这个文件存在的话。 + 然后会尝试查找用户的配置文件 ~/.tmux.conf。 + 配置文件是一个tmux命令集合,其中的命令在服务器第一次启动时按顺序执行的。 + tmux会在服务器进程启动之后加载一次配置文件。 + "source-file"命令可以用来在稍后加载一个文件。 + tmux在第一次会话创建时会显示配置文件中的命令出现的任何错误,但是会继续处理配置文件的余下部分。 + + '-L socket-name' + tmurx 将服务器*socsket*存储在*TMUX_TMPDIR*目录下,如果这个变量没有设置的话就会使用*TMPDIR*替换, + 或者当两者都不存在时,就会存储在 /tmp 目录下。默认的*socket*的名称为*default*。 + 这个选项允许指定一个不同的socket名称,允许多个独立的tmux服务器运行。 + 与-S不同的是,不需要使用全路经:所有的sockets文件会创建在一个相同的目录下。 + 如果socket被意外地删除了,那么SIGUSR1信号会发送给tmux服务器进程来重新创建socket文件(注意如果当之前描述的任何 + 父目录不存在的话会出错)。 + + '-l' + 当作一个登录shell使用,当前这个标记没有什么效果是当tmux被用来作为登录shell时与其他shell进行兼容的。 + + '-S socket-path' + 为服务器的socket指定一个可选的全路经,当这个选项指定之后,那么默认的目录不会被使用,并且-L选项会被忽略。 + + '-u' + tmux尝试通过第一个LC_ALL,LC_CTYPE和LANG环境变量来猜测终端是否可能支持UTF-8,这可能不会总是正确。 + -u 选项显式地告知tmux UTF-8是支持的。 + 如果服务器通过客户端传递-u或者检测到UTF-8进行启动的,那么utf8和status-utf8选项会分别在全局窗口和会话选项中生效。 + + '-v' + 请求详细登录,这个选项可能由于不断增长的修饰词被多次指定。登录消息会被存储在当前目录下的tmux-clientPID.log + 和tmux-serverPID.log文件中。其中的PID代表服务器或客户端进程ID。 + + 'command [flags]' + 这个用来指定命令集合中的一个来控制tmux,如果没有指定任何命令那么假设一个新建会话命令。 + +##键绑定 + +tmux可以通过一个前缀键与跟随的命令键进行结合的方式从一个附着的客户端进行控制,前缀键默认为'C-b' + +默认的命令键绑定为: + + 结合键 |含义 +-------------------------------------|--------------------- + C-b |给应用发送一个前缀键 C-b + C-o |将当前窗口中的面板向前切换。 + C-z |将tmux客户端挂起 + ! |将当前面板在窗口中突出显示 + " |将当前的面板分割为上下两个面板 + # |列出所有的粘贴缓存 + $ |重命名当前会话 + % |将当前面板分割为左右两个面板 + & |终止当前窗口 + ' |显示一个窗口索引来进行选择 + ( |将当前附着的客户端转换到前一个会话 + ) |将附着的客户端转换到下一个会话 + , |重命名当前窗口 + - |删除最近的复制文本缓存 + . |提示一个索引来移动当前窗口 + 0-9 |选择0-9个窗口 + : |输入tmux命令提示 + ; |移动到前面的活动面板 + = |从一个列表中选择一个缓存来交互式粘贴。 + ? |列出所有的键绑定 + D |选择一个客户端来脱离其附着 + L |将附着的客户端切换到最后一个会话中 + [ |输入赋值模式来复制文本或查看历史 + ] |粘贴最近复制的文本缓存 + c |创建一个新的窗口 + d |脱离当前的客户端 + f |提示在打开的窗口中搜索文本 + i |显示关于当前窗口的一些信息 + l |移动到之前选择的窗口 + n |移动到下一个窗口 + o |移动到当前窗口的下一个面板 + p |移动到之前的窗口 + q |简单地显示面板索引 + r |强制重绘附着的客户端 + s |为当前附着的客户端交互式地选择一个新的会话 + t |显示时间 + w |交互式地选择当前的窗口 + x |终止当前的面板 + z |切换当前面板的放大状态 + { |使用之前的面板来替换当前的面板 + } |使用下一个面板来替换当前的面板 + ~ |显示tmux之前的消息如果存在的话。 + PageUp |进入复制模式并且将页面向上滚动一页。 + Up,Down,Left,Right |转换到当前面板的上, 下,左,右 + M-1到M-5(M=Alt) |将面板按照预设的1-5个布局进行安排:偶数水平,偶数垂直,主水平,主垂直或平铺 + Space |将当前窗口按照下一个预设布局进行安排 + M-n |移动到下一个窗口并且带有一个响铃或者活动标记 + M-o |将当前窗口中的面板从前向后反转 + M-p |移动到前一个窗口并且带有响铃或者活动标记 + C-Up, C-Down C-Left, C-Right |以一个单格的步调调整当前面板的大小 + M-Up, M-Down M-Left, M-Right |以五个单格的步调调整当前面板的大小 + +键绑定可以通过bind-key和unbind-key命令来改变。 + + +##命令 + +这部分包含了tmux支持的命令列表,大部分的命令接收可选的-t参数与一个目标客户端,目标会话,目标窗口或者目标面板。 +它们指定了受命令影响的客户端,会话,窗口或面板 + +目标客户端应该为客户端链接的pty文件的名称,例如对于附着在/dev/ttyp1的客户端可能为 /dev/ttyp1或 +ttyp1。如果没有指定客户端,tmux会尝试当前使用的客户端; +如果失败的话,就会报告一个错误。客户端可以通过list-clients命令列出。 + +目标会话会按照以下顺序进行尝试: + + 1. 一个以$作为前缀的会话ID。 + 2. 一个精确的会话名称(会在list-sessions命令中列出)。 + 3. 会话名称的开始部分,例如“mysess”会匹配一个名为"mysession"的会话。 + 4. 一个与会话名称匹配的fnmatch 模式 + +如果找到了一个单独的会话,就会将其作为目标会话;如果匹配多个会话就会产生错误。 +如果忽略一个会话的话,那么就会使用当前的会话-如果可用的话;如果当前会话不可用,那么最近使用的会话就会被选择。 + +目标窗口通过session:window的格式来指定一个窗口。 会话按照target-session的规则,而窗口会按照以下的顺序来查找: + + 1. 一个下面列表中的特殊标记。 + 2. 一个窗口索引,例如'mysession:1'表示会话'mysession'中的第一个窗口。 + 3. 一个窗口ID,例如@1。 + 4. 一个精确的窗口名称,例如'mysession:mywindow'。 + 5. 一个窗口名称的开始部分,例如'mysession:mywin'。 + 6. 一个于窗口名称相匹配的fnmatch模式。 + 7. 一个空窗口名称制定了下一个未使用的索引如果合适的话(例如new-window或link-window命令), + 否则会话中的当前窗口就被选择。 + +下面的特殊标记可用来指定一个特定的窗口。每个都具有一个可选的单字符格式。 + + 符号 | 别名 | 含义 +--------------|------|--------------- + {start} | ^ | 最小数值的窗口 + {end} | $ | 最大数值的窗口 + {last} | ! | 最后一个窗口 + {next} | + | 按照数字的下一个窗口 + {previous}| - | 按照数字的上一个窗口 + {mouse} | = | 鼠标事件发生的窗口 + +目标面板可以是一个面板ID或者是一个与目标窗口相似的形式,但是带有一个额外可选的跟随面板索引或面板ID的点号“.”。 +如果忽略面板索引的话,那么指定窗口当前的活动面板就会被使用,下面的特殊符号可以作为面板索引使用: + + 符号 |别名 | 含义 +-------------------|------|------------- + {last} | ! | 最后一个面板 + {next} | + | 数字指定的下一个面板 + {previous} | - | 数字指定的前一个面板 + {top} | | 顶端面板 + {bottom} | | 底端面板 + {left} | | 最左端面板 + {right} | | 最右端面板 + {top-left} | | 左顶端面板 + {top-right} | | 右顶端面板 + {bottom-left} | | 左底端面板 + {bottom-right} | | 右底端面板 + {up} | | 活动面板上面的面板 + {down} | | 活动面板下面的面板 + {left} | | 活动面板左边的面板 + {right} | | 活动面板右边的面板 + {mouse} | = | 鼠标事件发生的面板 + +符号'+'和'-'可能跟随一个位移,例如: + + select-window -t:+2 + +会话,窗口和面板都通过一个唯一的ID来进行数字编码; +会话ID带有一个*$*前缀,窗口ID带有一个*@*前缀,面板ID带有一个*%*前缀。 +这些在tmux服务器中的会话,窗口或面板生命周期中都是唯一不变的。 +面板ID通过TMUX_PANE环境变量传递给面板的子进程, +ID可能使用'session_id','window_id'或'pane_id'何display-message,list-sesions,list-windows或list-panes命令的格式进行显示。 + +shell-command 参数是sh命令,这可能是一个传递给shell的参数,例如: + + new-window 'vi /etc/passwd' + +会运行: + /bin/sh -c 'vi /etc/passwd' + +此外,new-window,new-session,split-window, respawn-window以及respawn-pane命令允许 shell-command +作为多参数给定并且可以直接执行(不需要 'sh -C')。 者可以避免shell引用问题,例如: + + $ tmux new-window vi /etc/passwd + +会直接运行vi,而不需要调用shell。 + +命令 [参数] 指向一个tmux命令,命令和参数分别进行传递,例如: + + bind-key F1 set-window-option force-width 81 + +或者,如果使用sh的话: + + $ tmux bind-key F1 set-window-option force-width 81 + +多个命令可以作为命令序列的一部分一起指定,每个命令需要使用空格和分号来分隔; +命令按照从左至右的顺序执行,并且以反斜线结束的行会继续到下一行,除非被另外一个反斜线转义。 +一个字面量分号可以通过一个反斜线进行转义包含进来(例如,当需要制定一个命令行序列给键绑定时) + +tmux命令包含样例: + + refresh-client -t/dev/ttyp2 + rename-session -tfirst newname + set-window-option -t:0 monitor-activity on + new-window ; split-window -d + bind-key R source-file ~/.tmux.conf \; \ + display-message "source-file done" + +或者从sh中: + + $ tmux kill-window -t :1 + $ tmux new-window \; split-window -d + $ tmux new-session -d 'vi /etc/passwd' \; split-window -d \; attach + +##客户端和会话: + +tmux服务器管理客户端,会话,窗口和面板。 +客户端是附着在会话上来与他们交互的,不论他们是通过new-session命令或者之后的attach-session命令创建的会话。 +每个会话具有一个或多个窗口与其链接。 +窗口可以连接到多个会话上,窗口又是有一个或多个面板组成的,每个面板包含了一个伪终端。 +对于创建、链接或其他窗口操作的命令会在 [窗口和面板](#窗口和面板)部分详解。 + +下面的命令可以用来管理客户端和会话: + + attach-session [-dr] [-c working-directory] [-t target-session] + (别名: attach) + +如果在tmux外部来运行,会在当前终端中创建一个新的客户端并且将其附着在一个目标会话上。如果这个命令是在tmux中运行的,就会切换当前的客户端。 +-d 使附着在这个会话上的其他客户端就会脱离, +-r表示这个客户端时只读的(只有键绑定到detach-client或switch-client命令时具有效果)。 +如果没有启动服务器, attach-session 会尝试启动服务器;除非在配置文件中创建了会话否则就会失败。 +对于attach-session命令的目标会话规则稍微有一点调整:如果tmux需要选择最近使用的会话,会偏好选择最近使用的脱离附着的会话。 +-c 设置会话的工作目录(为新窗口所使用)为working-directory + + detach-client [-P] [-a] [-s target-session] [-t target-client] + (别名: detach) + +如果绑定了一个键时会脱离当前客户端,由-t来指定客户端,或者所有附着在由-s指定的会话中的客户端。 +-a选项会终止除-t指定的目标客户端之外的所有客户端。 +-P发送一个SIGHUP信号给当前客户端的父进程,一般是导致其触发退出动作。 + + has-session [-t target-session] + (别名: has) + +如果指定的会话不存在的话,就会报告一个错误并且退出,返回值为1. 如果存在的话,就会退出,返回值为0. + + kill-server + +终止tmux服务器和客户端并且销毁所有的会话。 + + kill-session [-a] [-t target-session] + +销毁指定的会话,关闭连接到会话的任何窗口,并且让所有附着在其上的客户端脱离。 +如果给定了-a选项的话,除了指定的会话之外的会话都被终止。 + + list-clients [-F format] [-t target-session] + (别名: lsc) + +列出附着在服务器上的所有客户端。 对于-F标记,可以参考 [FORMATS](#格式)部分。 +如果给定了目标会话的话,只列出连接到该会话上的客户端。 + + list-commands + (别名: lscm) + +列出所有tmux支持的所有命令语法。 + + list-sessions [-F format] + (别名: ls) + +列出服务器管理的所有会话,对于-F标记,参考 [FORMATS](#格式)部分。 + + lock-client [-t target-client] + (别名: lockc) + +锁定目标客户端, 可以参考 lock-server 命令。 + + lock-session [-t target-session] + (别名: locks) + +锁定附着在目标会话上的所有客户端。 + + new-session [-AdDP] [-c start-directory] [-F format] [-n window-name] [-s session-name] [-t target-session] [-x width] [-y height] [shell-command] + (别名:new) + +使用session-name 来创建一个新的会话。 + +除非给定-d选项,否则新的会话就会附着在当前的终端上。 window-name和shell-comand +是在初始化窗口中执行的窗口和shell命令名称。 +如果使用了-d选项, -x和-y用来指定初始窗口的大小(默认为80x24)。 +如果从终端中运行,任何的termios特殊字符都被保存并且在新会话中的新窗口中使用。 +-A 标记使得新会话与一个附着会话具有相同的行为,如果会话名称已经存在的话;这种情况下,对于attach-session来说-D具有与-d相同的行为。 +如果给定了-t选项,新的会话被分组到目标会话中。 +这就意味着他们共享相同的窗口集合--目标会话中的所有窗口都会连接到新的会话上,并且任何后续的新建窗口或关闭窗口都会被应用在两个会话上。 +当前的窗口和之前的窗口以及任何会话选项保持独立,并且每个会话都会在不影响其他会话的情况下被终止。 +-n或 shell-command只有在使用-t选项时合法。 +-P选项会在新会话创建之后来打印新会话相关信息。默认情况下,会使用'#{session_name}:'格式,但是可以通过-F来指定一个不同的格式。 + + refresh-client [-S] [-t target-client] + (别名:refresh) + +如果绑定了一个键的话会刷新当前客户端,如果使用-t指定了一个客户端的话会刷新单独的客户端。 +-S 只会更新客户端的状态条。 + + rename-session [-t target-session] new-name + (别名:rename) + +重命名会话为一个新名称。 + + show-messages [-IJT] [-t target-client] + (别名:showmsgs) + +显示客户端消息或服务器信息。 +所有显示在状态行的消息都存储在一个客户端独立的消息日志中,具有一个由message-limit选项设置的最大限制。 +-t 显示目标客户端的日志。 +-I,-J 和-T分别显示运行服务器,任务和终端的调试信息。 + + source-file path + (别名:source) + +从路径中来执行命令 + + start-server + (别名:start) + +开启tmux服务器,如果还没有运行,不会创建任何会话。 + + suspend-client [-t target-client] + (别名:suspendc) + +通过发送一个SIGTSTP(tty stop)信号来挂起一个客户端。 + + switch-client [-lnpr] [-c target-client] [-t target-session] [-T key-table] + (别名:switchc) + +将目标客户端所在的当前会话切换到目标会话中, +如果-l, -n或者-p被使用的话,客户端会被分别移动到最后,下一个或上一个会话中。 +-r 转换一个客户端的只读(可以参考attach-session命令) +-T 设置客户端的键表;来自客户端的下一个键会被解释为来自键表。 +这可能会被用在配置多个前缀键时或者绑定命令到一序列键值时使用。 + +例如,让键入'abc'来运行 list-keys命令: + + bind-key -Ttable2 c list-keys + bind-key -Ttable1 b switch-client -Ttable2 + bind-key -Troot a switch-client -Ttable1 + +##窗口和面板 + +一个tmux窗口可能会在处在多个模式中的某一个模式。 +默认的模式时直接访问附着在窗口上的终端。 +另外一个是复制模式,允许一个窗口的一部分或者其历史能够被复制到一个粘贴缓存中,以便稍候插入到另外的窗口中。 +这个模式时使用 copy-mode命令来进入的,默认绑定到'\['上。也会在一个命令产生输出时进入,例如通过键绑定执行的list-keys。 +可用的键依赖于是选择emacs还是vi模式(参考 mode-keys 选项)。 下面的键对于不同的模式具有合适的支持。 + + 函数 |vi模式 |emacs模式 +-------------------------------|-----------|---------------- + Append selection |A | + Back to indentation |^ |M-m + Bottom of history |G |M-< + Clear selection Escape |C-g | + Copy selection Enter |M-w | + Copy to named buffer |" | + Cursor down |j |Down + Cursor left |h |Left + Cursor right |l |Right + Cursor to bottom line |L | + Cursor to middle line |M |M-r + Cursor to top line |H |M-R + Cursor up |k |Up + Delete entire line |d |C-u + Delete/Copy to end of line |D |C-k + End of line |$ |C-e + Go to line |: |g + Half page down |C-d |M-Down + Half page up |C-u |M-Up + Jump again |; |; + Jump again in reverse |, |, + Jump backward |F |F + Jump forward |f |f + Jump to backward |T | + Jump to forward |t | + Next page |C-f |Page down + Next space |W | + Next space, end of word |E | + Next word |w | + Next word end |e |M-f + Other end of selection |o | + Paste buffer |p |C-y + Previous page |C-b |Page up + Previous space |B | + Previous word |b |M-b + Quit mode |q |Escape + Rectangle toggle |v |R + Scroll down |C-Down/C-e |C-Down + Scroll up |C-Up/C-y |C-Up + Search again |n |n + Search again in reverse |N |N + Search backward |? |C-r + Search forward |/ |C-s + Select line |V | + Start of line |0 |C-a + Start selection |Space |C-Space + Top of history |g |M-> + Transpose characters |C-t | + +下一个和上一个单词简默认使用空格和'-','_'以及'@'字符作为单词分隔符,但是可以通过设置会话的word-separators选项进行调整。 +下一个单词会移动到下一个单词的开始位置,下一个单词的末尾会移动到下一个单词的末尾位置, +前一个单词移动到前一个单词的开始位置。 三个下一个和前一个空格键具有相似的作用但是单独使用一个空格作为单词分隔符。 + +跳转命令允许在一个行中快速移动,例如,输入'f'跟随一个'/'会将光标移动到当前行的下一个'/'字符处。 +一个';'之后会移动到字符下一次出现的地方。 + +复制模式中的命令可能由一个可选的重复计数器作为前导,在vi键绑定下,通过数字键来输入前导; +使用emacs时,使用Alt(meta)+数字作为前导实体。例如,为了将光标向前移动10个单词使用'M-1 0 M-f'-对于emacs模式,'10w'-对于vi模式。 + +模式键绑定是通过一个命名表集合定义的:在命令提示的行编辑时使用vi-edit和emacs-edit键, +当从列表中选择时使用vi-choice和emacs-coice键,在复制模式中时使用vi-copy和emacs-copy键。 +这些表可以通过list-keys命令来查看,另外可以通过bind-key和unbund-key命令来修改或移除键。 +如果append-selection,copy-selection或者start-named-buffer给定-x标记,tmux将不会在复制之后退出复制模式。 +copy-pipe复制所选内容并且将其管道到一个命令。 + +例如下面的命令会绑定'C-w'在复制之后不会退出, 'C-q'将所选内容复制到/tmp和粘贴缓冲中。 + + bind-key -temacs-copy C-w copy-selection -x + bind-key -temacs-copy C-q copy-pipe "cat >/tmp/out" + +粘贴缓存键会从栈中顶端的粘贴缓存中粘贴第一行。 +copy-mode命令的简介为: + + copy-mode [-Mu] [-t target-pane] + +进入复制模式。-u选项向上滚动一页。 -M 开始一个鼠标拖拽(只有在绑定鼠标键绑定时有效,参考MOUSE SUPPORT) + +tmux显示的每个窗口可能会被分割为一个或多个面板;每个面板占用一个特定的区域进行显示并且具有一个单独的终端。 +一个窗口可以通过split-window名令分割为多个面板。窗口可以被水平分割(使用-h标记)或者垂直分割。 +面板可以通过resize-pane命令改变大小(默认绑定为'C-up','C-down','C-left','C-right'), +当前的面板可能会通过select-panel命令改变,而rotate-window和swap-panel命令可以在不改变面板位置的情况下切换面板。 +面板被从0开始的数字按顺序计数。 + +有一些默认的预设布局可用,这可以通过select-layout命令来选择或者使用next-layout命令循环选择(默认绑定为'Space'布局); +一旦布局被选定,其中的面板会被移动以及重新改变大小。 + +支持以下的布局: + +even-horizontal: 面板按照偶数地从左到右来分布在窗口中。 +even-vertical: 面板按照偶数地从上到下来分布在窗口中 +main-horizontal: 在窗口的顶端会显示一个大的面板,其余的面板按照从左到右的方式在底部左端的空间分布, +可以使用main-pane-height窗口选项来指定顶部面板的高度。 +main-vertical: 类似于main-horizontal,但是最大的面板会放置在窗口左边而其他的面板按照从上往下的方式在右边进行分布。 +可以参考main-pane-width窗口选项。 +tiled: 面板会尽量将面板在窗口中在行列上以偶数地方式分布。 + +此外,select-layout可以用来应用一个之前使用的布局,list-windows命令会以一个合适的格式显示每个窗口的布局来于select-layout命令结合使用,例如: + + $ tmux list-windows + + 0: ksh [159x48] layout: bb62,159x48,0,0{79x48,0,0,79x48,80,0} + $ tmux select-layout bb62,159x48,0,0{79x48,0,0,79x48,80,0} + +tmux自动地调整当前窗口大小中的布局大小。 注意,一个布局不能应用在多于布局默认定义的面板数量。 + +###窗口和面板命令 +与窗口和面板相关的命令如下: + + break-pane [-dP] [-F format] [-t target-pane] + (别名:breakp) + +将目标面板从其所在的窗口中终止,并将其作为一个新窗口中的唯一的面板。 如果指定-d,新的窗口不会称为当前的窗口。 +-P选项会在新窗口创建之后显示其信息。 默认会使用 +'#{session_name}:#{window_index}'的显示格式,但是可以通过-f来指定一个不同的格式。 + + capture-pane [-aepPq] [-b buffer-name] [-E end-line] [-S start-line] [-t target-pane] + (别名:capturep) +捕获一个面板的内容,如果指定-p,那么输出会到达stdou,否则会到达有-b指定的缓冲区(如果没有指定-b缓冲区的话就会指定一个新的缓冲区)。 +如果指定-a, 会使用备用屏幕,并且历史是不可以访问的。如果没有备用的屏幕,在没有指定-q的情况下会返回一个错误。 +如果指定-e,那么输出会包含文本转义序列和后台属性。 -C 也会转义非打印字符为八进制 \\xxx。 -J +会链接包裹的多行并且保留每行末尾尾随的空格。 -P 只会面板接受到的捕获开头是一个非完整转义序列的任意输出。 +-S 和 -E 指定开始和结束行的行数,0是可视面板的第一行,而负数时历史行。 '-'到 -S是历史的开始,而 +'-'到-E是可视面板的结尾。 默认情况下只会捕获面板的可视内容。 + + choose-client [-F format] [-t target-window] [template] +将一个窗口置于客户端选择模式,允许从一个列表中交互地选择一个客户端。 +在一个客户端被选择之后'%%'会由模板中的客户端pty路径替换,之后的结果会作为一个命令被执行。 +如果模板没有给定,会使用"detach-client -t '%%'"。 +对于-F标记,可以参考[FORMATS](#格式)部分。 这个命令只有在至少一个客户端被附着之后才工作。 + + choose-session [-F format] [-t target-window] [template] +将一个窗口置于会话选择模式中,可以从一个列表中交互式地选择一个会话。 +当一个会话被选择时,'%%'会由模板中的会话名称替换,之后的结果会作为一个命令被执行。 +如果模板没有给定,会使用"switch-client -t '%%'"。 +对于-F标记,可以参考[FORMATS](#格式)部分。这个命令只有在至少有一个客户端附着时工作。 + + choose-tree [-suw] [-b session-template] [-c window-template] [-S format] [-W format] [-t target-window] +将窗口置于一个树选择模式,其中的会话或窗口可能是从一个列表中交互地选择的。 +默认情况下,窗口属于一个会话主要为了显示他们与一个会话的关系。 +注意choose-window和choose-session命令被包裹在choose-tree中。 +如果给定-s会显示会话,如果给定-w会显示窗口。 +默认情形下,树是被折叠起来的,会话必须通过右箭头简将其展开为窗口。 -u选项会将所有的会话展开。 +如果给定-b,会重载默认的会话命令。 注意 '%%'可以被使用而且会被会话名称替换。如果没有指定的话,默认为"switch-client -t +'%%'"。 如果给定-c,会重载默认的窗口命令,与-b类似,'%%'可以被使用而且会被会话名与窗口索引替换。 +当一个窗口从列表中被选择时,会话命令会在窗口命令运行之前运行。 +如果给定-S,会显示指定的格式而不是默认的会话格式。如果给定-W,会显示指定的格式而不是默认的窗口格式。 +对于-s和-w选项的含义可以参考[FORMATS](#格式)部分。 +这个命令只有当至少有一个客户端附着时工作。 + + choose-window [-F format] [-t target-window] [template] +将一个窗口置于一个选择模式,其中的窗口可以从一个列表中交互地选择。 +当选择一个窗口之后,'%%'会被模板中的会话名称和窗括索引替换,之后的结果作为一个命令被执行。 +如果没有给定模板,"select-window -t '%%'"被使用。 +对于-F的含义可以参考[FORMATS](#格式)部分。 这个命令只有在至少一个客户端附着之后才会工作。 + + display-panes [-t target-client] + (别名:displayp) +由一个客户端来显示每个面板的可视化指示器,可以参考 display-panes-time, display-panes-colour和 +display-panes-active-colour会话选项。由于指示器在屏幕上,一个面板可以通过'0-9'键来选择。 + + find-window [-CNT] [-F format] [-t target-window] match-string + (别名:findw) +在窗口名称,标题和可见的内容中搜索fnmatch模式的匹配字符串。标记被用来控制匹配行为: -C只匹配可见窗口内容, +-N只匹配窗口名称,-T匹配窗口标题。 +默认为-CNT。如果只有一个窗口匹配,就会被自动选择,否则就会显示一个选项列表。 +对于-F标记可以参考[FORMATS](#格式)部分。这个命令只有在至少一个客户端被附着时会工作。 + + join-pane [-bdhv] [-l size | -p percentage] [-s src-pane] [-t dst-pane] + (别名:joinp) +与split-window相似,但是取代分割dst-panel并创建一个新面板而代之的是,将其分割并将src-panel移动到空间中。 +这个可以用来逆转break-pane动作。-b选项使得src-pane被联接到dst-pane的左边或上边。 + + kill-pane [-a] [-t target-pane] + (别名:killp) +销毁给定的pane。如果所在窗口中没有剩余的面板,该窗口也会被销毁。 -a选项会销毁除由-t指定面板之外的所有面板。 + + kill-window [-a] [-t target-window] + (别名:killw) +终止当前窗口或目标窗口,将其从所链接的任意会话中移除。 -a选项终止除-t指定窗口之外的所有窗口。 + + last-pane [-de] [-t target-window] + (别名:lastp) +选择最后一个面板,-e 使得输入到面板生效,-d使得输入到面板失效。 + + last-window [-t target-session] + (别名:last) +选择最后一个窗口,如果没有目标窗口指定,选择当前会话中的最后一个窗口。 + + link-window [-dk] [-s src-window] [-t dst-window] + (别名:linkw) +将在src-window的窗口链接到指定的dst-window。如果dst-window被指定但是不存在的话,那么src-window会被链接导那儿。 +如果给定-k并且dst-window存在,那么就会将其终止,否则就会生成一个错误。如果给定-d,新链接的窗口不会被选择。 + + list-panes [-as] [-F format] [-t target] + (别名:lsp) +如果给定-a, 会湖绿target并且会列出服务器上的所有面板。 +如果给定-s,target就是一个会话(或者当前会话)。如果都没有指定,target就是一个窗口(或者当前窗口)。对于-F标记可以参考[FORMATS](#格式)部分。 + + list-windows [-a] [-F format] [-t target-session] + (别名:lsw) +如果给定-a,会列出服务器上的所有窗口。 否则会列出当前会话或target-session中的窗口。对于-F标记可以参考[FORMATS](#格式)部分。 + + move-pane [-bdhv] [-l size | -p percentage] [-s src-pane] [-t dst-pane] + (别名:movep) +与join-pane类似,但是src-pane和dst-pane可以属于相同的窗口。 + + move-window [-rdk] [-s src-window] [-t dst-window] + (别名: movew) +这个于link-window相似,除了src-window中的窗口被移动到dst-window。给定-r会话中的所有窗口都会在遵照base-index选项下按照序列顺序重新编号。 + + new-window [-adkP] [-c start-directory] [-F format] [-n window-name] [-t target-window] [shell-command] + (别名:neww) +创建一个新的窗口,给定-a,新建的窗口会被插入到指定target-window的下一个索引上,必要的话会将窗口向上移,否则target-window就是这个新建的窗口。 + +如果给定-d, 会话不会将新建窗口作为当前窗口。target-window表示将会创建的窗口;如果目标窗口已经存在会显示一个错误,如果使用-k标记就会销毁。 +shell-command是将要执行的命令。如果没有指定shell-command, +default-command选项的值被默认使用。-c选项指定了新窗口创建的工作目录。 +当shell命令完成时,窗口关闭。 参考remain-on-exit选项来改变这个行为。 +对于运行在tmux中的所有程序需要将TERM环境变量设置为"screen"。 +新的窗口会自动将"TERM=screen"加到他们的环境中,但是必须注意不要在shell启动文件中重置这个变量。 +-P 选项在新窗口创建后会打印与之相关的信息。 +默认情况下,使用'#{session_name}:#{window_index}'的格式,但是可以通过使用-F来指定一个不同的格式。 + + next-layout [-t target-window] + (别名:nextl) +将窗口移动到下一个布局模式并且重新安排面板来使之适应。 + + next-window [-a] [-t target-session] + (别名:next) +移动到会话中的下一个窗口,如果-a指定,在移动到下一个窗口时带有警告。 + + pipe-pane [-o] [-t target-pane] [shell-command] + (别名:pipep) +将target-pane中程序的输出通过管道传递给一个shell命令。一个面板可能一次只能管道给一个命令,在shell-command命令执行之前任何存在的管道都会关闭。 +shell-command字符串可能会包含status-left选项所支持的特殊字符序列。 如果没有指定shell-command,那么当前的管道就会被关闭。 +-o选项只有在没有之前的管道存在时打开一个新管道,允许一个管道通过一个单键进行切换,例如: + + bind-key C-p pipe-pane -o 'cat >>~/output.#I-#P' + + + previous-layout [-t target-window] + (别名:prevl ) +移动到会话之前的布局。 + + previous-window [-a] [-t target-session] + (别名:prev) +移动到会话之前的窗口,使用-a选项会带有一个警告。 + + rename-window [-t target-window] new-name + (别名: renamew) +重命名当前窗口或者由-t指定的target-window窗口为new-name + + resize-pane [-DLMRUZ] [-t target-pane] [-x width] [-y height] [adjustment] + (别名:resizep) +重新定义面板的大小,通过-U, -D, -L或-R来调整上下左右,或者通过-x/-y指定绝对值大小。 +调整是通过行或单元格来给定的(默认为1)。 +使用-Z时,活动面板会在放大(占用整个窗口)或未放大(在布局中的正常位置)之间进行切换。 +-M 开始鼠标重定义大小(只有在鼠标键绑定时有效,参考MOUSE SUPPORT部分) + + respawn-pane [-k] [-t target-pane] [shell-command] + (别名:respawnp) +在shell-comman退出之后重新激活面板(可以参考remain-on-exit 窗口选项)。如果没有给定shell-comman, +那么面板创建时所使用的命令会被执行。面板必须是已经激活的状态,如果给定-k,任何存在的命令都会被终止。 + + respawn-window [-k] [-t target-window] [shell-command] + (别名:respawnw) +在shell-command退出之后重新激活窗口(可以参考remain-on-exit窗口选项)。 如果没有指定shell-comman, +那么窗口创建时所使用的命令会被执行。 窗口必须是已经激活的状态,如果指定-k任何存在的命令都会被终止。 + + rotate-window [-DU] [-t target-window] + (别名:rotatew) +轮换窗口中面板的位置,或者通过-U向前或者向后。 + + select-layout [-nop] [-t target-window] [layout-name] + (别名:selectl) +为窗口选择一个特定的布局,如果没有指定布局名称,就会使用最后使用的预设布局并且重新布局。 + + select-pane [-DdegLlRU] [-P style] [-t target-pane] + (别名:selectp) +将target-pane面板作为target-window窗口中的活动面板,或者设置其风格(使用-P)。 +如果使用了-D,-L,-R或者-U的话,就会分别使用target-pane面板的下面,左边,右边或上面的面板。 +-l与使用last-pane命令效果一样。 -e使得输入到面板生效,-d使得输入到面板失效。 + +每个面板具有一个风格:默认使用window-style和window-active-style选项。select-pane -P 为单个面板设置风格。 +例如将第一个面板的北京设置为红色red: + + select-pane -t:.1 -P 'bg=red' + +-g 显示当前面板的样式。 + + select-window [-lnpT] [-t target-window] + (别名:selectw) +选择目标窗口。-l,-n和-p等价于last-window,next-window和previous-window命令。 +如果给定-T,而且选择的窗口已经是当前窗口,那么命令表现为last-windown命令。 + + split-window [-bdhvP] [-c start-directory] [-l size | -p percentage] [-t target-pane] [shell-command] [-F format] + (别名:splitw) +通过分割target-pane窗口来创建一个新面板: -h为水平分割,-v为垂直分割; 默认为垂直分割。 +-l和-p选项指定新面板的行(对于垂直分割)或单元格(水平分割),或者作为百分比。-b选项使得新建面板在target-pane的左边或上边。 +其他的任何选项的含义于new-window命令一样。 + + swap-pane [-dDU] [-s src-pane] [-t dst-pane] + (别名:swapp) +转换两个面板。如果使用-U并且没有通过-s来指定源面板的话,dst-pane会与之前的面板进行转换;-D与下一个面板进行转换。 +-d用来指示tmux不要改变活动面板。 + + swap-window [-d] [-s src-window] [-t dst-window] + (别名:swapw) +这个与link-window类似,除了源面板与目标面板相互转换之外。如果在src-window没有窗口的话会出错。 + + unlink-window [-k] [-t target-window] + (别名:unlinkw) +取消target-window的链接。除非给定-k选项,否则只有当一个窗口链接到多个会话时才会被取消链接-窗口不能链接到空会话; +如果指定-k选项,而且窗口只有与一个会话相关联,那么窗口会被取消该链接并且被销毁。 + +##键绑定2 + + tmux允许一个命令被绑定到大多数键上-无论是否带有前导键。当指定键时,大部分键代表其本身字面量含义(例如'A-Z')。 +Control键可能表示为'C-'或'^'前导,而Alt(meta)表示为'M-'。此外,特殊的键名称也是被接受的:Up,Down, Left, Right, +BSpace, BTab, DC(delete), End, Enter, Escape, F1-F12, Home, IC(insert), NPage/PageDown/PgDn, PPage/PageUp/PgUp, Space和Tab。 +注意为了绑定双引号或单引号键,引号标记是必需的,例如: + + bind-key '"' split-window + bind-key "'" new-window + +###键绑定命令 +与键绑定相关的命令如下: + + bind-key [-cnr] [-t mode-table] [-T key-table] key command [arguments] + (别名:bind) +将键绑定到命令。键被绑定到一个键表中。 +默认情况(没有'-T')时,键被绑定到前导键表中。这个表被用在前导键键入之后再键入的键(例如,'c'默认绑定为前导键表中的新建窗口命令, +所以'C-b c'会创建一个新窗口)。 +根键表被用在不需要前导键的键输入:将'c'在根键表中绑定为新建窗口命令时意味着一个普通的'c'键就会创建一个新窗口。 +'-n' 是 '-T root' 的别名。键同样可以绑定到客制化的键表中,'switch-client -T command' 用来从一个键绑定中切换到相应的键。 +'-r' 标记指定这个键可以重复,参考'repeat-time'选项。 + +如果出现-t选项,那么键会绑定到一个mode-table(模式表): 使用-c来绑定到命令模式,缺省时绑定为普通模式。 +可以参考WINDOWS AND PANES部分,并且 list-keys命令可以查看模式键绑定。 + +为了查看默认的绑定和可用的命令可以参考list-keys 命令: + + list-keys [-t mode-table] [-T key-table] + (别名:lsk) +列出所有的键绑定。 没有指定-T时会打印所有的键表,指定-T时只会打印key-table. +带-t时,在模式表中的键绑定会被列出来; 模式可能为以下之一:vi-edit,emacs-edit,vi-choice,emacs-choice, +vi-copy或emcas-copy。 + + send-keys [-lMR] [-t target-pane] key ... + (别名:send) +发送一个或多个键到一个窗口中,其中的每个参数key是发送的键的名称(例如'C-a'或者'npage'); +如果字符串不能作为键来识别,就会作为一系列字符串发送。 +-l标记让键名查找失效并且发送键的字面量值。所有的参数被按照先后顺序序列地发送。 +-R标记导致终端状态被重置。 +-M 通过一个鼠标时间传递(只有当绑定一个鼠标键绑定时有效,参考MOUSE SUPPORT)。 + + send-prefix [-2] [-t target-pane] +发送前导键-或者发送二级前导键如果与-2一起使用时-到一个窗口就像该键被按下一样。 + + unbind-key [-acn] [-t mode-table] [-T key-table] key + (别名:unbind) +取消命令到键的绑定,-c,-n,-T 和-t与bind-key命令的含义一样。 如果-a存在,所有的键绑定都会被移除。 + +##选项 +tmux的外观和行为可以通过修改各个选项的值来进行改变,具有三种选项:服务器选项,会话选项和窗口选项。 +tmux服务器具有一个全局选项集合--这个选项集合不会应用到任何特定的窗口或会话中。 +这些选项通过'set-option -s'命令进行修改,或者通过'show-options -s' 命令进行显示。 +此外,每个单独的会话可能具有一个会话选项集合,同时具有一个分开全局会话选项集合。 +没有特定选项配置的会话会从全局会话选项中继承其值。会话选项可以通过set-option命令进行设置或重置, +可以通过show-options命令来列出会话选项。可用的服务器和会话选项会在set-option命令下列出。 +类似地,每个窗口都附着了一个窗口选项集合,并且具有一个全局窗口集合来继承所有的重置选项。 +窗口选项使用set-window-option命令来进行修改,并且可以通过show-window-options命令来列出。 +所有的窗口选项使用set-window-option命令归档。 + +tmux也支持以'@'作为前导的用户选项, 用户选项可以具有任何名称,可以被设置为任何字符串,只要具有'@'作为前导,例如: + + $ tmux setw -q @foo "abc123" + $ tmux showw -v @foo + abc123 + +###选项设置 + +设置选项的命令如下: + + set-option [-agoqsuw] [-t target-session | target-window] option value + (别名:set) +通过-w来设置窗口选项(与set-window-option命令等价),-s设置服务器选项,否则设置会话选项。 +如果指定-g,那么全局会话或窗口选项就会被设置。 +-u标记用来重置选项,所以一个会话从全局选项中来继承,不能重置一个全局选项。 +-o标记阻止设置一个已经存在的选项。 +-q标记会取消位置选项发生的错误。 +带有-a时,如果选项期待一个字符串或者一个样式,那么只会被附加在已经设置的值后面,例如: + + set -g status-left "foo" + set -ag status-left "bar" + +会得到'foobar'结果,而: + + set -g status-style "bg=red" + set -ag status-style "fg=blue" + +会得到一个红色背景和蓝色前景的结果。 +没有-a时,这个值会使用默认的背景和一个蓝色前景。 +可用的窗口选项在set-window-option下列出。 +选项的值依赖于选项类型,可以为数字,字符串,或者一个标记(on/off/省略)。 + + + + +###服务器选项 +可选的服务器选项有: + + buffer-limit number +设置缓冲器数量; 新的缓冲器被放置在栈顶端,旧的缓冲器在维护最大长度时有必要时从栈底端移除。 + + default-terminal terminal +为会话中新创键的窗口设置一个默认的终端-默认值为TERM环境变量。为了让tmux正确工作,这个值必须设置为'screen','tmux'或者来自他们的一个派生值。 + + escape-time time +设置一个tmux用来在接受到一个转义字符输入时的等待毫秒数,以此让tmux来判断该字符时函数的一部分还是一个meta键序列的一部分。 +默认为500毫秒。 +设置一个tmux用来在接受到一个转义字符输入时的等待毫秒数,以此让tmux来判断该字符时函数的一部分还是一个meta键序列的一部分。 +默认为500毫秒。 + + exit-unattached [on | off] +如果生效,服务器会在没有任何附着的客户端时退出。 + + + focus-events [on | off] +如果生效,在终端支持的情况下会从终端获取聚焦事件请求,然后通过tmux中运行的应用来传递。 +附着的客户端应该被脱离附着状态然后在选项修改之后重新进行附着。 + + message-limit number +设置每个客户端保存到消息日志中的错误或信息消息的数量,默认为100。 + + set-clipboard [on | off] +尝试使用\e]52;...\007 xterm转义序列来设置终端的剪切版。 +如果在客户终端的terminfo描述中存在一个Ms实体,那么这个选项默认为on. 注意在xterm中需要设置以下资源来让这个特性生效: + + disallowedWindowOps: 20,21,SetXprop + +或者在需要的时候从xterm交互中改变这个属性值。 + + terminal-overrides string +包含了一个个实体列表来重载使用terminfo读取的终端描述信息。 +字符串是一个"逗号"分割的项目列表,每个项目是一个':'分割的字符串来组成终端类型模式以及一个name=value实体集合。 + +例如,为了给所有的终端类型设置terminfo实体'clear'为'\e[H\e[J',以及将'rxvt'终端类型的实体'dch1'的值设置为'\e[P', +那么这个选项会按照以下字符串进行设置: + + "*:clear=\e[H\e[2J,rxvt:dch1=\e[P" + +终端实体值会在解释之前通过strunvis传递,默认的值会强制地更新支持256colors的终端的'colors'实体: + + "*256col*:colors=256,xterm*:XT" + + + +###会话选项 + +可用的会话选项有: + + assume-paste-time milliseconds +如果被键入的键快于用毫秒指定的值,那么这些键会被假设为粘贴而不是键入,而且tmux键绑定不会被执行。默认为一毫秒,0用来让选项失效。 + + base-index index +设置在创建一个新窗口时应该搜索的未使用索引的基索引,默认为0。 + + bell-action [any | none | current] +窗口响铃动作,any表示连接到一个会话的任何窗口中的响铃会导致这个会话中的当前窗口中的一个响铃,none表示所有的响铃被忽略, +current表示除了当前窗口之外的窗口中的响铃将会被忽略。 + + bell-on-alert [on | off] +如果为on,在出现一个警告时,终端会响铃。 + + default-command shell-command +设置新窗口所使用的命令(如果没有指定就是窗口创建时的命令)为shell-command, 可能为任何sh命令。 +默认是一个空字符串,用来指示tmux使用默认shell选项来创建一个登录shell。 + + default-shell path +指定默认的shell, 当default-command为空时,这个会作为新建窗口的登录shell,这个path值必须为完整的路径名。 +在启动之后,tmux会尝试从第一个合适的SHELL环境变量中来设置为默认值,shell由'getpwuid'或者 '/bin/sh'。 +这个选项在将tmux作为一个登录shell使用时应该被配置。 + + destroy-unattached [on | off] +如果生效的话,当会话不再附着在任何客户端时就会被销毁。 + + detach-on-destroy [on | off] +如果为on(默认值), 当附着的会话被销毁时,客户端会脱离附着。 如果off,客户端会被切换为剩余会话中的最近活动的会话。 + + display-panes-active-colour colour +设置为活动面板显示指令的display-panes命令所使用的colour。 + + display-panes-colour colour +设置为不活动面板显示指令的display-panes命令所使用的colour。 + + display-panes-time time +以毫秒为淡灰来设置display-panes命令显示指令出现的时间。 + + display-time time +设置状态行消息和其他屏幕指令显示的时间总和,时间是以毫秒指定的。 + + history-limit lines +设置窗口历史持有的最大行数,这个设置只会应用在新窗口上--退出时窗口历史不会重写大小并且会保留在其创建时段的限制。 + + lock-after-time number +在number秒时间不活动后会锁定会话(与lock-session命令类似),如果lock-server选项被设置的话, +那么整个服务器(所有会话)都会被锁定。默认为不锁定(number为0)。 + + lock-command shell-command +锁定每个客户端时运行的命令,默认为lock -np 命令。 + + lock-server [on | off] +如果选项为on(默认值), 与每个会话单独锁定不同的是,整个服务器会在所有会话被锁定时锁定。 +作为一个会话选项这个没有什么影响,这个必须时一个全局选项。 + + message-command-style style +设置状态行命令样式,样式是一个由逗号分割的字符列表来指定的。 +这些样式可能时'bg=colour'来设置背景颜色,'fg=colour'来设置前景颜色,另外有下面指定的属性列表: + +颜色值可以为这些颜色中的一个:black,red,green, yellow, blue, magenta,cyan,white,aixterm bright +variants(如果支持的话,会有:brightred,breightgreen,等)。 +256-colour集合中从colour0到colour255为默认值,或者一个十六进制的RGB字符串,例如'#ffffff'-会从默认的256-colour集合中选择最匹配的颜色。 +属性既可以为none或者一个逗号分割一个或多个包含(bright(或bold),dim,underscore,blink,reverse, hidden或者italics)的列表来开启属性, +或者带有'no'前缀的属性来关闭属性。 + +样例: + + fg=yellow,bold,underscore,blink + bg=black,fg=default,noreverse + +如果set-option命令具有一个 '-a' 标记的话,新的样式会添加进来,否则已经存在的样式被替换。 + + message-style style +设置状态行消息样式,对于如何指定样式,可以参考message-command-style选项。 + + mouse [on | off] +如果为on,tmux会捕获鼠标并且允许鼠标时间作为键绑定进行结合。 可以参考MOUSE SUPPORT 部分详解。 + + mouse-utf8 [on | off] +如果生效,在UTF-8终端请求鼠标输入作为UTF-8。 + + prefix key +设置接收到的key作为前导键 + + prefix2 key +设置接收到的键作为二级前导键。 + + renumber-windows [on | off] +如果为on, 当一个窗口在会话中关闭时,自动地将其他窗口按照数字顺序重新编序。 +这回参考base-index选项如果设置了这个选项的话。如果为off,不会对窗口进行重新排序。 + + repeat-time time +允许指定的时间内(默认为500毫秒)在不重新输入前导键时输入多个命令。 +一个键是否可以重复可以在使用bind-key命令结合时使用-r选项进行设置。 +对于与resize-pane命令结合的默认键的重复是开启的。 + + set-remain-on-exit [on | off] +为在这个会话中任何第一次创建的窗口设置remain-on-exit窗口选项。 +当这个选项为true时,运行程序所在的窗口在程序退出时不会关闭,而是保持打开但是不活动。 +可以使用respawn-window命令来重新激活这个窗口,或者使用kill-window来销毁窗口。 + +如果tsl和fslterminfo实体存在的话,会尝试用其来设置客户终端的标题。 +如果终端显示为一个xterm的话tmux自动将其设置为\e]2;...\007序列。 +这个选项默认为off。注意elinks只会在设置了STY环境变量时才尝试设置窗口标题。 + + set-titles-string string +如果set-titles为on,那么字符串string就会用来设置窗口标题。 格式被扩展,参考[FORMATS](#格式)部分。 + + status [on | off] +显示或隐藏状态行。 + + status-interval interval +在每个间隔时间段更新状态栏。 默认时没15秒更新。如果为0会让时间间隔重绘状态失效。 + + status-justify [left | centre | right] +设置状态行窗口列表组件的位置:left,center,或者right对齐。 + + status-keys [vi | emacs] +在状态栏使用vi或者emacs-样式的键绑定,例如在命令提示时。默认为emacs, 除非VISUAL +或者EDITOR环境变量被设置并且包含字符串'vi'。 + + status-left string +将字符串(默认为会话名称)显示在状态栏的左边。字符串会通过strftime传递并且格式会被扩展,也可能会包含下面特殊字符序列的任意字符: + + 字符对 | 替换值 +---------------------------|--------------------------------- + #(shell-command) | 命令输出的首行。 + #[attributes] | 颜色或属性改变 + ## | 一个'#'字面量值。 + +'\#(shell-command)'形式执行'shell-command'然后插入其输出的首行。 +注意shell命令只会在由status-interval选项指定的时间间隔内执行一次:如果同时重绘状态的话,会使用之前输出结果。 +shell命令的执行会带有tmux的全局变量集合(参考 ENVIRONMENT部分)。 +对于如何设置名字和标题的细节可以参考NAMES AND TITLES 部分。 对于允许设定的属性可以参考message-command-style选项。 + +样例有: + + #(sysctl vm.loadavg) + #[fg=yellow,bold]#(apm -l)%%#[default] [#S] + +默认字符串中的UTF-8不会被解释,需要使用status-utf8选项来开启UTF-8。 +默认值为'[#s]'。 + + status-left-length length +设置状态栏左边组件的最大长度,默认为10。 + + status-left-style style +设置状态行左边部分的样式,参考message-style-style选项来指定样式。 + + status-position [top | bottom] +设置状态行的位置。 + + status-right string +显示字符串在状态栏的右边,默认为带双引号的当前窗口标题以及日期时间会被显示。 +与status-left类似,字符串也会传递给strftime,字符对会被替换而且UTF-8也依赖于status-utf8选项。 + + status-right-length length +设置状态栏右边组件的最大长度,默认为10。 + + status-right-style style +设置状态行右边部分的样式,参考message-command-style选项设置样式。 + + status-style style +设置状态行样式,参考message-command-style选项设置样式。 + + status-utf8 [on | off] +指示tmux将status-left和status-right中的字符串中的top-bit-set当作UTF-8处理;值得注意的时,这对于宽字符很重要。默认为off。 + + update-environment variables +设置一个包含由空格分开的环境变量列表字符串--这些环境变量会在新会话创建时或一个已存在的会话被附着时复制到会话环境中。 +任何在源环境中不存在的变量会从会话环境中设置为移除(类似于将-r传递给set-environment命令)。 +默认值为"DISPLAY SSH_ASKPASS SSH_AUTH_SOCK SSH_AGENT_PID SSH_CONNECTION WINDOWID XAUTHORITY"。 + + visual-activity [on | off] +如果为on, 当活动出现在一个由monitor-activity窗口选项生效的窗口中时显示一个状态行。 + + visual-bell [on | off] +如果为on,响铃时会显示一个消息而不是将其传递到终端(会产生一个声音)。可以参考bell-action选项。 + + visual-silence [on | off] +如果monitor-silence生效的话,那么当时间间隔在一个指定窗口中过期时会打印一个消息。 + + word-separators string +设置会话关于单词分隔符字符的概念,主要是为了复制模式中的下一个或前一个单词命令的目的。默认为'-_@'。 + + set-window-option [-agoqu] [-t target-window] option value + (别名:setw) +Set a window option. The -a, -g, -o, -q and -u flags work similarly to the set-option command. + +###窗口选项 +支持的窗口选项有: + + aggressive-resize [on | off] +积极地重新调整所选窗口大小。意味着tmux会重新调整窗口的尺寸为当前窗口的最小会话尺寸,而不是其附着的最小的会话。 +在当前窗口改变为另外一个会话时窗口会重新调整大小;这个选项对于支持SIGWINCH的全屏程序有好处而对于交互式程序如shell不是太好。 + + allow-rename [on | off] +允许程序通过终端转义序列(\033k...\033\\)改变窗口名称。默认为on。 + + alternate-screen [on | off] +这个选项用来配置运行在tmux中的程序是否可以使用终端的被用屏幕特性-允许terminfo的smcup和rmcup能力。 +被用屏幕特性在一个交互式程序开启并且在从退出后恢复之后可以保留窗口的内容, +这样任何程序开始之前的可视输出会在程序退出之后重新出现。默认为on。 + + automatic-rename [on | off] +控制自动化窗口命名。当开启这个设置时,tmux会使用由automatic-rename-format指定的格式来自动地重命名窗口。 +对于由new-window和new-session在创建时,或者之后通过rename-window或者使用终端转义序列指定的窗口名称, 这个标识会自动失效。 + +可以通过以下方式来将其在全局范围内关闭: + + set-window-option -g automatic-rename off + + + automatic-rename-format format + +在automatic-rename选项生效时会使用这个格式, 参考 [FORMATS](#格式) 。 + + c0-change-interval interval + c0-change-trigger trigger +这两个选项配置面板改变时间间隔的一个简单格式。如果tmux在1毫秒内查看到除C0序列之外的触发器(例如回车,换行或删除) +修改屏幕,会立即停止更新面板。否则会在每个时间间隔内重绘整个面板。 +这个可以帮助来阻止快速输出(例如yes)覆盖整个终端。默认为触发器250, 时间间隔100。 +0触发器用来失效速率限制。 + + + + clock-mode-colour colour +设置时钟颜色。 + + clock-mode-style [12 | 24] +设置时钟小时格式 + + force-height height + force-width width +阻止tmux将窗口的大小值超过width或height, 0值会恢复默认无限制设置。 + + main-pane-height height + main-pane-width width +设置main-horizontal 或 main-vertical布局中的主面板的长和宽。 + + +mode-keys [vi | emacs] +在复制或选择模式中使用vi/emacs键绑定。与status-keys选项一样默认为emacs, 除非VISUAL或EDITOR包含了vi。 + +mode-style style +设置窗口模式样式, 参考message-command-style选项指定样式。 + +monitor-activity [on | off] +监视窗口中的活动。具有活动事件的窗口在状态栏上高亮显示。 + +monitor-silence [interval] +在一段时间间隔内对非活动窗口进行监控。时间间隔内沉默的窗口在状态栏高亮。 +0间隔值让其监控失效。 + + +other-pane-height height +设置main-horizontal布局中主面板之外的面板高度。默认为0-没有任何作用。 +如果main-pane-height和other-pane-height选项同时设置,主面板会变得来使得 +其他面板达到指定高度,但是不会反过来作用。 + +other-pane-width width +与other-pane-height类似,只是用来设置 main-vertical布局中的其他面板的宽度。 + +pane-active-border-style style +设置当前活动面板的边框样式。 参考 message-command-style选项来指定样式,属性被忽视。 + +pane-base-index index +与 base-index类似,只是用来设置面板的开始数字。 + +pane-border-style style +设置活动面板周围面板的样式。 参考 message-command-style选项来指定样式,属性被忽视。 + +remain-on-exit [on | off] +带有该标识设置的窗口在其中程序退出时不会被销毁。 +窗口可能使用respawn-window命令重新激活。 + +synchronize-panes [on | off] +将到任意面板的输入复制到相同窗口中的所有其他面板(没有在特殊模式中的面板)。 + +utf8 [on | off] +指示tmux期待在窗口中出现 UTF-8序列。 + +window-active-style style +设置窗口的活动面板的样式。参考 message-command-style选项来指定样式。 + +window-status-activity-style style +设置窗口的状态行样式带有一个活动警告。参考 message-command-style选项来指定样式。 + +window-status-bell-style style +设置窗口的状态行样式带有一个响铃警告。参考 message-command-style选项来指定样式。 + + window-status-current-format string +与 window-status-format类似,只是这个格式在窗口为当前窗口时使用。 + + window-status-current-style style +为当前的活动窗口设置状态行样式。 参考 message-command-style选项来指定样式。 + + window-status-format string +设置状态行列表中显示窗口的格式。 参考 status-left选项关于可用的特殊字符序列信息。默认值为'#I:#W#F'。 + + window-status-last-style style +为最后一个活动窗口设置状态行样式。参考 message-command-style选项来指定样式。 + + window-status-separator string +设置状态行中窗口之间的分隔符,默认为单个空格符。 + + window-status-style style +为单个窗口设置状态行样式。参考 message-command-style选项来指定样式。 + + window-style style +设置默认窗口样式。参考 message-command-style选项来指定样式。 + + xterm-keys [on | off] +设置该选项会使tmux生成xterm-style功能键序列; 这些包含了一个数字来指定修饰符如Shift,Alt或Ctrl。默认为off。 + + wrap-search [on | off] +设置这个选项会使得搜索动作包含面板内容的末尾。 默认为on。 + + show-options [-gqsvw] [-t target-session | target-window] [option] +(别名:show) +使用-w来显示窗口选项(可以指定单个窗口),使用-s显示服务器选项,否则显示target-session的会话选项。 +-g用来显示全局会话或窗口选项。 +-v只显示选项值,不包含名称。 +-q指示重置选项不会返回错误。 + + show-window-options [-gv] [-t target-window] [option] +(别名:showw) +列出窗口选项或者target-window指定的单个窗口选项。 +-g用来显示全局窗口选项。 +-v显示选项值,忽略选项名。 + +##鼠标支持 +如果鼠标选项开启(默认为关闭),tmux允许将鼠标时间作为键来结合。 +每个键的名称是由鼠标事件(例如'MouseUp1')和一个位置后缀('Pane'表示面板内容,'Border'面板边界 +或者'Status'状态行)组成的。可以使用以下的鼠标事件: + + MouseDown1 MouseUp1 MouseDrag1 + MouseDown2 MouseUp2 MouseDrag2 + MouseDown3 MouseUp3 MouseDrag3 + WheelUp WheelDown + +每个都需要带有一个位置后缀,例如'MouseDown1Status' + +特殊标记'{mouse}'或'='可能在命令中作为target-window或target-pane与鼠标键绑定进行结合。 +会在鼠标事件发生的位置解析为窗口或面板(例如,对于一个'MouseUp1Status'绑定在在状态行上的窗口, +或者对于'WheelDownPane'绑定面板上的鼠标滚动)。 + +'send-key -M'标记可以用来将一个鼠标时间转发到一个面板上。 + +默认的键绑定允许鼠标用来选择和改变面板大小,复制文本或者使用状态行来改变窗口。 +这些动作在开启鼠标选项时发生作用。 + + +##格式 + +有些命令接受由-F标记附带的格式参数。这个参数是一个控制命令输出格式的字符串。 +可替换的变量被包含在'#{'和'}'之间,例如'#{session_name}'。 +可用的变量在下表中列出,或者tmux选项的名称可以一个选项的值。 +有些变量具有一个简短的别名,例如'#s', 而'##'会使用一个单独的'#'来替换。 + + +条件可以通过'?'作为前缀,逗号作为分隔符来使用,如果指定的变量存在并且不是0,那么第一个选项被选择,否则选择第二个选项。 +例如'#{?session_attached,attached,not attached}'条件,当会话是附着的就会包含'attached'否则就会包含'not attached'。 +而对于'#{?automatic-rename, yes, no}'如果开启了automatic-rename的话会包含'yes'否则包含'no'。 +可以通过一个前缀'=',一个数字和一个冒号来作为字符串的长度限制,所以'#{=10:pane_title}'最多包含pane标题的前10个字符。 + +在合适的地方有以下的变量是可用的: + + 变量名 | 别名 | 替换值 + -----------------------|--------------|----------------------------------- + alternate_on | | If pane is in alternate screen + alternate_saved_x | | Saved cursor X in alternate screen + alternate_saved_y | | Saved cursor Y in alternate screen + buffer_sample | | Sample of start of buffer + buffer_size | | Size of the specified buffer in bytes + client_activity | | Integer time client last had activity + client_activity_string | | String time client last had activity + client_created | | Integer time client created + client_created_string | | String time client created + client_height | | Height of client + client_last_session | | Name of the client's last session + client_prefix | | 1 if prefix key has been pressed + client_readonly | | 1 if client is readonly + client_session | | Name of the client's session + client_termname | | Terminal name of client + client_tty | | Pseudo terminal of client + client_utf8 | | 1 if client supports utf8 + client_width | | Width of client + cursor_flag | | Pane cursor flag + cursor_x | | Cursor X position in pane + cursor_y | | Cursor Y position in pane + history_bytes | | Number of bytes in window history + history_limit | | Maximum window history lines + history_size | | Size of history in bytes + host | #H | Hostname of local host + host_short | #h | Hostname of local host (no domain name) + insert_flag | | Pane insert flag + keypad_cursor_flag | | Pane keypad cursor flag + keypad_flag | | Pane keypad flag + line | | Line number in the list + mouse_any_flag | | Pane mouse any flag + mouse_button_flag | | Pane mouse button flag + mouse_standard_flag | | Pane mouse standard flag + mouse_utf8_flag | | Pane mouse UTF-8 flag + pane_active | | 1 if active pane + pane_bottom | | Bottom of pane + pane_current_command | | Current command if available + pane_dead | | 1 if pane is dead + pane_dead_status | | Exit status of process in dead pane + pane_height | | Height of pane + pane_id | #D | Unique pane ID + pane_in_mode | | If pane is in a mode + pane_input_off | | If input to pane is disabled + pane_index | #P | Index of pane + pane_left | | Left of pane + pane_pid | | PID of first process in pane + pane_right | | Right of pane + pane_start_command | | Command pane started with + pane_synchronized | | If pane is synchronized + pane_tabs | | Pane tab positions + pane_title | #T | Title of pane + pane_top | | Top of pane + pane_tty | | Pseudo terminal of pane + pane_width | | Width of pane + saved_cursor_x | | Saved cursor X in pane + saved_cursor_y | | Saved cursor Y in pane + scroll_region_lower | | Bottom of scroll region in pane + scroll_region_upper | | Top of scroll region in pane + session_attached | | Number of clients session is attached to + session_activity | | Integer time of session last activity + session_activity_string| | String time of session last activity + session_created | | Integer time session created + session_created_string | | String time session created + session_group | | Number of session group + session_grouped | | 1 if session in a group + session_height | | Height of session + session_id | | Unique session ID + session_many_attached | | 1 if multiple clients attached + session_name | #S | Name of session + session_width | | Width of session + session_windows | | Number of windows in session + window_active | | 1 if window active + window_activity_flag | | 1 if window has activity alert + window_bell_flag | | 1 if window has bell + window_find_matches | | Matched data from the find-window + window_flags | #F | Window flags + window_height | | Height of window + window_id | | Unique window ID + window_index | #I | Index of window + window_last_flag | | 1 if window is the last used + window_layout | | Window layout description + window_name | #W | Name of window + window_panes | | Number of panes in window + window_silence_flag | | 1 if window has silence alert + window_width | | Width of window + window_zoomed_flag | | 1 if window is zoomed + wrap_flag | | Pane wrap flag + + +##名称和标题 + +tmux区分名称和标题,窗口和会话具有名称用来作为目标标识,并且在状态行和不同的列表中显示: +名称是tmux对于一个窗口或会话的标识符。 +只有pane面板有标题,面板的标题是由在其中运行的程序设置的并且不能由tmux改变。 +与X窗口管理器中的xterm窗口标题的设置所使用的机制相同。 +窗口本身没有标题----一个窗口的标题就是其活动面板的标题。 +tmux本身会设置客户端所在终端的标题,参考set-title选项。 + +A session's name is set with the new-session and rename-session commands. A window's name is set with one of: +一个会话的名称通过new-session和rename-session命令来设置的,一个窗口的名称可以通过以下方式设置: + + 1. 一个命令的参数(如new-window和new-session的-n参数) + 2. 一个转义序列: $ printf '\033kWINDOW_NAME\033\\' + +自动重命名会将名称设置为窗口活动面板中的活动程序,参考automatic-rename选项。 + +当一个面板第一次创建时,其标题为主机名hostname。一个面板的标题可以通过OSC标题设置序列进行设置,例如: + $ printf '\033]2;My Title\033\\' + +##环境 + +当tmux服务器启动时,tmux会将环境复制到全局环境中,此外每个会话具有一个会话环境。 +当一个窗口被创建时,会将会话环境和全局环境合并。 +如果一个变量存在两个环境中,会使用会话环境中的变量。结果就是初始环境传递给新进程。 + +当一个新会话创建或者一个就会话重新附着时,update-environment会话选项可以用来从一个客户端来更新会话环境。 +tmux也会使用一些内部信息来初始化TMUX变量以便允许命令在内部执行,TERM变量会设置为正确的终端'screen'。 + +修改和查看环境的命令有: + + set-environment [-gru] [-t target-session] name [value] + (别名:setenv) +设置或重置一个环境变量,如果使用-g,会在全局变量中进行改变;否则只会改变target-session的会话环境。 +-u标记用来重置一个变量。 -r用来指示在开起一个新进程时从环境中移除该变量。 + + show-environment [-g] [-t target-session] [variable] + (别名:showenv) +显示目标会话target-session或者全局环境(使用-g时)变量。 +如果忽略变量,会显示所有的变量。从环境中移除的变量会用'-'作为前导。 + +##状态行 +tmux包含了一个可选的状态行会显示在每个终端的底端行。 +默认状态行时有效的(可以通过status会话选项失效)并且被包含的,从左到右分别有: +包含在方括号中的当前会话名称;窗口列表;双引号包含的活动面板;以及时间和日期。 + +状态行由三部分组成: +可配置的左边和右边部分(可以包含shell命令输出的动态的内容,例如时间和日期, +参考status-left,status-left-length,status-right,status-right-length选项), 以及中间的窗口列表。 +默认窗口列表显示当前会话中按照数字升序排列窗口的索引,名称和标记(如果存在的话)。 +可以通过window-status-format和window-status-current-format选项客制化。 + +附加在窗口名称后面的标记可以是以下符号之一: + + 符号 | 含义 +---------|----------- + * | 表示当前窗口 + - | 最有一个选择的窗口。 + # | 窗口被监控并且活动会被检测。 + ! | 会在窗口中出现一个响铃。 + ~ | 窗口会在monitor-silence时间间隔中保持沉默。 + Z | 窗口的活动面板被放大了。 + +符号#与monitor-activity窗口选项相关。窗口名称会在有警告(响铃,活动或沉默)出现的时候以反转的颜色打印 + +状态行的颜色和属性是可以配置的,整个状态行使用status-style会话选项,单个的窗口使用window=status-style窗口选项配置。 + +状态行会自动地刷新如果当其在时间间隔内被改变的话,时间间隔可以通过status-interval会话选项控制。 + +与状态行相关的命令有: + + command-prompt [-I inputs] [-p prompts] [-t target-client] [template] +在客户端打开一个命令提示,可以在tmux内用用来执行交互式命令。 + +如果指定了template的话,其会被作为命令使用。 +-I是每个提示初始化文本列表-由逗号分割的。 +-p 提示是一个按照顺序显示的逗号分割的提示列表;否则只显示一个单独的构造于template(如果提供了的话)提示,否则使用':'。 +inputs和prompts都可能包含由status-left选项支持的特殊字符序列。 +在命令被执行之前,第一个出现的字符串'%%'和出现的所有'%1'都会被第一个提示的响应替换, +第二个'%%'和所有的'%2'会被第二个提示的响应替换,以此类推, 直到第九个提示可以被替换。 + + confirm-before [-p prompt] [-t target-client] command + (别名:confirm) +在执行命令之前进行确认,如果指定-p, 提示为prompt参数的显示,否则提示会从command来构造。 +可能会包含由status-left选项支持的特殊字符序列。 +这个命令只会在tmux中工作。 + + display-message [-p] [-c target-client] [-t target-pane] [message] + (别名:display) +显示一个消息, 如果没有给定-p, +那么输出会被打印到标准输出中,否则会显示在target-client的状态行上。 +消息的格式在[FORMTS](#格式)部分描述。 +如果给第-t就会从target-pane中获取信息,否则就会从附着在target-client的会话中的活动窗口中获取。 + +##缓冲区 +tmux维护了一个命名的粘贴缓冲区集合,每个可能显式地或自动地命名。 +显式地命名的缓冲区是在通过set-buffer或load-buffer命令创建时命名的, +或者是通过set-buffer -n 来重命名一个自动命名的缓冲区。 +自动命名的缓冲区的名称会类似于'buffer0001','buffer0002'等。 +当达到buffer-limit选项的限制时,最旧的自动命名的缓冲区被删除。 +显示命名的缓冲区不会收到buffer-limit的限制,可以通过delete-buffer命令删除。 + +缓冲区可以使用copy-mode或set-buffer以及load-buffer命令来添加,并且通过paste-buffer命令来将其粘贴到一个窗口。 +如果一个缓冲区命令没有指定缓冲区时,就会假设使用最近添加的自动命名的缓冲区。 + +每个窗口也会维护一个可配值的历史缓冲区,默认会保留到2000行;这个可以通过history-limit选项修改(参考set-option命令)。 + +缓冲区命令有: + choose-buffer [-F format] [-t target-window] [template] +将窗口置于缓冲区选择模式,一个缓冲区可以从一个列表中交互地选择。 +在选择一个缓冲区之后,'%%'会被template中的缓冲区名称替换,之后的结果会作为一个命令被执行。 +如果没有给定template,会使用"paste-buffer -b '%%'"来替换。 对于-F标记参考[FORMATS](#格式)部分。 +这个命令只有在至少有一个客户端附着时工作。 + + clear-history [-t target-pane] + (别名:clearhist) +对指定的pane删除并释放history。 + + delete-buffer [-b buffer-name] + (别名:deleteb) +删除名为buffer-name的缓冲区,在没有指定buffer-name时删除最佳男自动命名添加的缓冲区。 + + list-buffers [-F format] + (别名:lsb) +列出全局缓冲区,对于-F可以参考[FORMATS](#格式)部分。 + + load-buffer [-b buffer-name] path + (别名:loadb) +从path中加载指定粘贴缓冲区的内容。 + + paste-buffer [-dpr] [-b buffer-name] [-s separator] [-t target-pane] + (别名:pasteb) +将一个粘贴缓冲却中的内容插入到一个指定的pane中。如果没有指定target-pane,会被粘贴到当前的一个。 +-d 同时也会删除粘贴缓冲区。当输出时,任何粘贴缓冲区中的换行符会使用一个分隔符替换(默认为回车符)。 +-s 指定客制化分隔符。 +-r 标记意味着不做换行符的替换。 +-p 当应用程序请求大括号粘贴模式的话,粘贴的大括号控制代码会被插入到缓冲区中。 + + save-buffer [-a] [-b buffer-name] path + (别名:saveb) +将指定的粘贴缓冲区中的内容保存到一个路径path. -a选项用来指示附加模式而不是直接重写文件。 + + set-buffer [-a] [-b buffer-name] [-n new-buffer-name] data + (别名:setb) +将指定缓冲区的内容设置为data. +使用-a选项来将data附加到缓冲区而不是直接重写缓冲区。-n用来重命名缓冲区到一个new-buffer-name。 + + show-buffer [-b buffer-name] + (别名:showb) +显示指定缓冲区的内容。 + +##杂项 +其他杂项命令有: + clock-mode [-t target-pane] +显示一个大的时钟。 + + if-shell [-bF] [-t target-pane] shell-command command [command] + (别名:if) +如果shell-command返回成功的话执行第一个命令,否则执行第二个命令。 +在执行之前,shell-command会使用[FORMATS](#格式)部分指定的规则进行扩展,包括相关的target-pane。-b指示shell-command在后台运行。 +如果给定-F,shell-command不会被执行而是认为时成功的(如果既不是空的也不是0的话-在格式扩展之后)。 + + lock-server + (别名:lock) +通过运行lock-command选项指定的命令来分别锁定每个客户端。 + + run-shell [-b] [-t target-pane] shell-command + (别名:run) +在不创建一个窗口的前提下在后台中运行一个shell-command。 +执行之前,shell-command使用[FORMATS](#格式)部分指定的规则进行扩展。 +-b指示在后台运行。 +在完成之后,任何到标准输出的输出会在copy模式中显示(在由-t指定的pane或当前pane-如果缺省的话)。 +如果命令没有成功返回,退出状态也会被显示。 + + wait-for [-L | -S | -U] channel + (别名:wait) +当不带选项使用时,在使用相同的channel的wait-for -S唤醒之前阻止客户端退出。 +-L会锁定channel,任何尝试锁定相同channel的客户端会一直等待直到使用wait-for -U 解锁。 这个命令只有在tmux外部工作。 + +##TERMINFO EXTENSIONS + +tmux可以理解terminfo的一些扩展: +Cs, Cr +设置光标颜色,第一个使用一个单个字符串参数来设置颜色;第二个没有参数来恢复默认的光标颜色。 +如果设置的话一系列这样的值会被用来在tmux中改变光标颜色: + + $ printf '\033]12;red\033\\' + +Ss, Se +设置或重置光标样式。 如果设置以下的序列可能会用来将光标变为一个下划线: + + $ printf '\033[4 q' + +如果没有设置Se,Ss和参数0会被用来重新设置光标样式。 + +Ms +这个序列可以被tmux用来存储当前缓冲区到主机终端剪贴板中。可以参考set-clipboad选项和xterm的man页面。 + +##控制模式 + +tmux提供了一个成为control(控制)模式的文本界面。这使得应用程序可以通过一个简单的文本协议与tmux进行交流。 +在控制模式中,一个客户端发送tmux命令或以新行结束的命令序列到标准输入中。 +每个命令将会在标准输出中产生一个输出块。 +一个输出块包含了一个%begin行与跟随的输出(可能为空)。 +输出块会以一个%end或%error作为结尾。 +%begin和匹配的%end/%error具有两个参数:一个整数时间和命令编号,例如: + + %begin 1363006971 2 + 0: ksh* (1 panes) [80x24] [layout b25f,80x24,0,0,2] @2 (active) + %end 1363006971 2 + +在控制模式中,tmux输出通知,一个通知不会出现在输出块中。 + +下面是通知的定义: + + %exit [reason] + +当tmux客户端没有附着在任何会话中或者出现错误时,tmux客户端会立即退出。如果存在的话,reason描述了客户端退出的原因。 + + %layout-change window-id window-layout + +一个带有window-id的窗口布局被改变,新的布局为window-layout。 + + %output pane-id value + +一个窗口面板产生的输出。 值会转义非打印字符而且饭斜线作为八进制\xxx。 + + %session-changed session-id name +客户端现在被附着在ID为session-id的会话上,并且使用name命名。 + + %session-renamed name +当前会话被重命名为name。 + + %sessions-changed + +一个会话被创建或销毁。 + + %unlinked-window-add window-id + +ID为window-id的窗口被创建,但是没有连接到当前会话。 + + %window-add window-id +ID为window-id的窗口被连接到当前会话。 + + %window-close window-id +ID为window-id的窗口被关闭。 + + %window-renamed window-id name +ID为window-id的窗口重命名为name。 + +##文件 +o + ~/.tmux.conf : 默认的tmux配置文件。 + /etc/tmux.conf : 系统范围的配置文件。 + +##样例 + +创建一个运行vi的新的tmux会话: + + $ tmux new-session vi + +大部分命令具有一个简短形式,也成为别名。例如new-session的别名为new: + $ tmux new vi + +可选地,一个命令最短的不混淆的简短格式是被接受的,如果有多个选项,会被列出: + + $ tmux n + ambiguous command: n, could be: new-session, new-window, next-window + +在一个活动会话中,一个新的窗口可以通过键入'C-b c'来创建(ctrl 跟随b 然后跟随c键)。 + +窗口可以使用'C-b 0-9'来在窗口0-9中导航,也可以通过'C-b n'选择下一个窗口,'C-b p'选择上一个窗口。 + +一个会话可以通过使用'C-b d'来脱离附着,也可以通过以下命令来重新附着: + $ tmux attach-session + +键入'C-b ?' 列出当前窗口中的当前键绑定; 使用上下箭头可以导航列表,'q'从其中退出。 + +当tmux启动时运行的命令可能放置在 ~/.tmux.conf配置文件中,常见样例包括: + +改变默认的前导键: + + set-option -g prefix C-a + unbind-key C-b + bind-key C-a send-prefix + +关闭状态行或者改变其颜色: + + set-option -g status off + set-option -g status-style bg=blue + +设置其他选项,例如默认命令或者在30分钟不活动之后锁定: + + set-option -g default-command "exec /bin/ksh" + set-option -g lock-after-time 1800 + +创建新的键绑定: + + bind-key b set-option status + bind-key / command-prompt "split-window 'exec man %%'" + bind-key S command-prompt "new-window -n %1 'ssh %1'" + +参考: pty(4) + +作者: Nicholas Marriott + +译者: Liang Guisheng From 3855fdb020c44b6bd8d075c8cc55d76de00fc922 Mon Sep 17 00:00:00 2001 From: ZTinoZ Date: Fri, 12 Jun 2015 11:25:22 +0800 Subject: [PATCH 354/965] Translating by ZTinoZ --- ... 20 Useful Terminal Emulators for Linux.md | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/sources/tech/20150526 20 Useful Terminal Emulators for Linux.md b/sources/tech/20150526 20 Useful Terminal Emulators for Linux.md index 4ff7820781..1b239a3904 100644 --- a/sources/tech/20150526 20 Useful Terminal Emulators for Linux.md +++ b/sources/tech/20150526 20 Useful Terminal Emulators for Linux.md @@ -14,7 +14,7 @@ Terminator是一款先进且强大的终端仿真器,它支持多终端窗口 #### Terminator的特性 #### -- 自定义外形和色彩设计,根据你的需要设置尺寸。 +- 自定义外形和配色方案,根据你的需要设置尺寸。 - 使用插件来获取更多功能。 - 快捷键可以加快普通操作。 - 可以把终端窗口分裂成几个虚拟终端并把它们重新设置成你需要的尺寸。 @@ -34,7 +34,7 @@ Tilda是一款漂亮的基于GTK+的下拉式终端,敲击一个键你就可 - 高度定制的选项界面设置。 - 你可以给Tilda设置透明度。 -- 优秀的嵌入式色彩设计。 +- 优秀的嵌入式配色方案。 ![Tilda Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/Tilda-Emulator.jpeg) @@ -75,9 +75,9 @@ Yakuake Terminal ### 5. ROXTerm ### -ROXterm又是一款轻量级终端仿真器,旨在提供与GNOME终端相似的特性。它原本创造出来是为了通过不使用Gnome库从而拥有更少的占用空间和更快的启动速度并使用独立的小程序来建立配置界面(GUI), 但是随着时间的流逝,它的角色就转变为给那些老牌用户带来更高一层的特性。 +ROXterm又是一款轻量级终端仿真器,旨在提供与GNOME终端相似的特性。它原本创造出来是为了通过不使用Gnome库从而拥有更少的占用空间和更快的启动速度并使用独立的小程序来建立配置界面(GUI), 但是随着时间的流逝,它的角色就转变为给那些高级用户带来更高一层的特性。 -然而,它比GNOME终端更加具有可制定性并且对于那些经常使用终端的老牌用户更令人期望。它能和GNOME桌面环境完美结合并在终端中提供像拖拽项目那样的特性。 +然而,它比GNOME终端更加具有可制定性并且对于那些经常使用终端的高级用户更令人期望。它能和GNOME桌面环境完美结合并在终端中提供像拖拽项目那样的特性。 ![Roxterm Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/Roxterm-Terminal.jpeg) @@ -97,7 +97,7 @@ Eterm Terminal ### 7. Rxvt ### -代表着扩展虚拟终端的Rxvt是一款彩色终端仿真器,为那些不需要一些特性例如Tektronix 4014仿真和toolkit-style可配置性的老牌用户而生的xterm的替代品。 +代表着扩展虚拟终端的Rxvt是一款彩色终端仿真器,为那些不需要一些特性例如Tektronix 4014仿真和toolkit-style可配置性的高级用户而生的xterm的替代品。 ![Rxvt Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/Rxvt-Terminal.jpeg) @@ -107,7 +107,7 @@ Rxvt Terminal ### 8. Wterm ### -Wterm is a another light weight color terminal emulator based on rxvt project. It includes features such as background images, transparency, reverse transparency and an considerable set or runtime options are accessible resulting in a very high customizable terminal emulator. +Wterm是另一款以rxvt项目为基础的轻量级彩色终端仿真器。它所包含的特性包括设置背景图片、透明度、反向透明度和大量的设置或运行环境选项让它成为一款可高度自定义的终端仿真器。 ![wterm Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/wterm-Terminal-.jpeg) @@ -117,14 +117,14 @@ wterm Terminal ### 9. LXTerminal ### -LXTerminal is a default VTE-based terminal emulator for LXDE (Lightweight X Desktop Environment) without any unnecessary dependency. The terminal has got some nice features such as. +LXTerminal是一款基于VTE的终端仿真器,默认运行于没有任何多余依赖的LXDE(轻量级X桌面环境)下。这款终端有很多很棒的特性。 -LXTerminal Features +#### LXTerminal的特性 #### -- Multiple tabs support -- Supports common commands like cp, cd, dir, mkdir, mvdir. -- Feature to hide the menu bar for saving space -- Change the color scheme. +- 多标签支持 +- 支持普通命令如cp, cd, dir, mkdir, mvdir +- 隐藏菜单栏以保证足够界面空间 +- 更改配色方案 ![lxterminal Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/lxterminal-Terminal.jpeg) @@ -136,13 +136,13 @@ lxterminal Terminal Konsole是另一款强大的基于KDE的免费终端仿真器,最初由Lars Doelle创造。 -Konsole的特性 +#### Konsole的特性 #### - 多标签式终端 - 半透明背景 - 支持拆分视图模式 - 目录和SSH书签化 -- 可定制的颜色设计 +- 可定制的配色方案 - 可定制的按键绑定 - 终端中的活动通知警告 - 增量搜索 From d28df772bfc9222f544c16a9a80ceb0e8bcf8f01 Mon Sep 17 00:00:00 2001 From: DeadFire Date: Fri, 12 Jun 2015 14:28:36 +0800 Subject: [PATCH 355/965] =?UTF-8?q?20150612-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...w We Designed for Performance and Scale.md | 174 ++++++++++++++++++ 1 file changed, 174 insertions(+) create mode 100644 sources/tech/20150612 Inside NGINX--How We Designed for Performance and Scale.md diff --git a/sources/tech/20150612 Inside NGINX--How We Designed for Performance and Scale.md b/sources/tech/20150612 Inside NGINX--How We Designed for Performance and Scale.md new file mode 100644 index 0000000000..559d28996c --- /dev/null +++ b/sources/tech/20150612 Inside NGINX--How We Designed for Performance and Scale.md @@ -0,0 +1,174 @@ +Inside NGINX: How We Designed for Performance & Scale +================================================================================ +NGINX leads the pack in web performance, and it’s all due to the way the software is designed. Whereas many web servers and application servers use a simple threaded or process-based architecture, NGINX stands out with a sophisticated event-driven architecture that enables it to scale to hundreds of thousands of concurrent connections on modern hardware. + +The [Inside NGINX][1] infographic drills down from the high-level process architecture to illustrate how NGINX handles multiple connections within a single process. This blog explains how it all works in further detail. + +### Setting the Scene – the NGINX Process Model ### + +![Master Process](http://cdn.nginx.com/wp-content/uploads/2015/06/Screen-Shot-2015-06-08-at-12.36.30-PM.png) + +To better understand this design, you need to understand how NGINX runs. NGINX has a master process (which performs the privileged operations such as reading configuration and binding to ports) and a number of worker and helper processes. + + # service nginx restart + * Restarting nginx + # ps -ef --forest | grep nginx + root 32475 1 0 13:36 ? 00:00:00 nginx: master process /usr/sbin/nginx \ + -c /etc/nginx/nginx.conf + nginx 32476 32475 0 13:36 ? 00:00:00 \_ nginx: worker process + nginx 32477 32475 0 13:36 ? 00:00:00 \_ nginx: worker process + nginx 32479 32475 0 13:36 ? 00:00:00 \_ nginx: worker process + nginx 32480 32475 0 13:36 ? 00:00:00 \_ nginx: worker process + nginx 32481 32475 0 13:36 ? 00:00:00 \_ nginx: cache manager process + nginx 32482 32475 0 13:36 ? 00:00:00 \_ nginx: cache loader process + +On this 4-core server, the NGINX master process creates 4 worker processes and a couple of cache helper processes which manage the on-disk content cache. + +### Why Is Architecture Important? ### + +The fundamental basis of any Unix application is the thread or process. (From the Linux OS perspective, threads and processes are mostly identical; the major difference is the degree to which they share memory.) A thread or process is a self-contained set of instructions that the operating system can schedule to run on a CPU core. Most complex applications run multiple threads or processes in parallel for two reasons: + +- They can use more compute cores at the same time. +- Threads and processes make it very easy to do operations in parallel (for example, to handle multiple connections at the same time). + +Processes and threads consume resources. They each use memory and other OS resources, and they need to be swapped on and off the cores (an operation called a context switch). Most modern servers can handle hundreds of small, active threads or processes simultaneously, but performance degrades seriously once memory is exhausted or when high I/O load causes a large volume of context switches. + +The common way to design network applications is to assign a thread or process to each connection. This architecture is simple and easy to implement, but it does not scale when the application needs to handle thousands of simultaneous connections. + +### How Does NGINX Work? ### + +NGINX uses a predictable process model that is tuned to the available hardware resources: + +- The master process performs the privileged operations such as reading configuration and binding to ports, and then creates a small number of child processes (the next three types). +- The cache loader process runs at startup to load the disk-based cache into memory, and then exits. It is scheduled conservatively, so its resource demands are low. +- The cache manager process runs periodically and prunes entries from the disk caches to keep them within the configured sizes. +- The worker processes do all of the work! They handle network connections, read and write content to disk, and communicate with upstream servers. + +The NGINX configuration recommended in most cases – running one worker process per CPU core – makes the most efficient use of hardware resources. You configure it by including the [worker_processes auto][2] directive in the configuration: + + worker_processes auto; + +When an NGINX server is active, only the worker processes are busy. Each worker process handles multiple connections in a non-blocking fashion, reducing the number of context switches. + +Each worker process is single-threaded and runs independently, grabbing new connections and processing them. The processes can communicate using shared memory for shared cache data, session persistence data, and other shared resources. + +### Inside the NGINX Worker Process ### + +![](http://cdn.nginx.com/wp-content/uploads/2015/06/Screen-Shot-2015-06-08-at-12.39.48-PM.png) + +Each NGINX worker process is initialized with the NGINX configuration and is provided with a set of listen sockets by the master process. + +The NGINX worker processes begin by waiting for events on the listen sockets ([accept_mutex][3] and [kernel socket sharding][4]). Events are initiated by new incoming connections. These connections are assigned to a state machine – the HTTP state machine is the most commonly used, but NGINX also implements state machines for stream (raw TCP) traffic and for a number of mail protocols (SMTP, IMAP, and POP3). + +![Internet Requests](http://cdn.nginx.com/wp-content/uploads/2015/06/Screen-Shot-2015-06-08-at-12.40.32-PM.png) + +The state machine is essentially the set of instructions that tell NGINX how to process a request. Most web servers that perform the same functions as NGINX use a similar state machine – the difference lies in the implementation. + +### Scheduling the State Machine ### + +Think of the state machine like the rules for chess. Each HTTP transaction is a chess game. On one side of the chessboard is the web server – a grandmaster who can make decisions very quickly. On the other side is the remote client – the web browser that is accessing the site or application over a relatively slow network. + +However, the rules of the game can be very complicated. For example, the web server might need to communicate with other parties (proxying to an upstream application) or talk to an authentication server. Third-party modules in the web server can even extend the rules of the game. + +#### A Blocking State Machine #### + +Recall our description of a process or thread as a self-contained set of instructions that the operating system can schedule to run on a CPU core. Most web servers and web applications use a process-per-connection or thread-per-connection model to play the chess game. Each process or thread contains the instructions to play one game through to the end. During the time the process is run by the server, it spends most of its time ‘blocked’ – waiting for the client to complete its next move. + +![Blocking I/O](http://cdn.nginx.com/wp-content/uploads/2015/06/Screen-Shot-2015-06-08-at-12.40.52-PM.png) + +1. The web server process listens for new connections (new games initiated by clients) on the listen sockets. +1. When it gets a new game, it plays that game, blocking after each move to wait for the client’s response. +1. Once the game completes, the web server process might wait to see if the client wants to start a new game (this corresponds to a keepalive connection). If the connection is closed (the client goes away or a timeout occurs), the web server process returns to listening for new games. + +The important point to remember is that every active HTTP connection (every chess game) requires a dedicated process or thread (a grandmaster). This architecture is simple and easy to extend with third-party modules (‘new rules’). However, there’s a huge imbalance: the rather lightweight HTTP connection, represented by a file descriptor and a small amount of memory, maps to a separate thread or process, a very heavyweight operating system object. It’s a programming convenience, but it’s massively wasteful. + +#### NGINX is a True Grandmaster #### + +Perhaps you’ve heard of [simultaneous exhibition][5] games, where one chess grandmaster plays dozens of opponents at the same time? + +![Kiril Georgiev](http://cdn.nginx.com/wp-content/uploads/2015/06/Kiril-Georgiev.gif) + +[Kiril Georgiev played 360 people simultaneously in Sofia, Bulgaria][6]. His final score was 284 wins, 70 draws and 6 losses. + +That’s how an NGINX worker process plays “chess.” Each worker (remember – there’s usually one worker for each CPU core) is a grandmaster that can play hundreds (in fact, hundreds of thousands) of games simultaneously. + +![Event-driven Architecture](http://cdn.nginx.com/wp-content/uploads/2015/06/Screen-Shot-2015-06-08-at-12.41.13-PM.png) + +1. The worker waits for events on the listen and connection sockets. +1. Events occur on the sockets and the worker handles them: + + - An event on the listen socket means that a client has started a new chess game. The worker creates a new connection socket. + - An event on a connection socket means that the client has made a new move. The worker responds promptly. + +A worker never blocks on network traffic, waiting for its “opponent” (the client) to respond. When it has made its move, the worker immediately proceeds to other games where moves are waiting to be processed, or welcomes new players in the door. + +### Why Is This Faster than a Blocking, Multi-Process Architecture? ### + +NGINX scales very well to support hundreds of thousands of connections per worker process. Each new connection creates another file descriptor and consumes a small amount of additional memory in the worker process. There is very little additional overhead per connection. NGINX processes can remain pinned to CPUs. Context switches are relatively infrequent and occur when there is no work to be done. + +In the blocking, connection-per-process approach, each connection requires a large amount of additional resources and overhead, and context switches (swapping from one process to another) are very frequent. + +For a more detailed explanation, check out this [article][7] about NGINX architecture, by Andrew Alexeev, VP of Corporate Development and Co-Founder at NGINX, Inc. + +With appropriate [system tuning][8], NGINX can scale to handle hundreds of thousands of concurrent HTTP connections per worker process, and can absorb traffic spikes (an influx of new games) without missing a beat. + +### Updating Configuration and Upgrading NGINX ### + +NGINX’s process architecture, with a small number of worker processes, makes for very efficient updating of the configuration and even the NGINX binary itself. + +![Updating Configuration](http://cdn.nginx.com/wp-content/uploads/2015/06/Screen-Shot-2015-06-08-at-12.41.33-PM.png) + +Updating NGINX configuration is a very simple, lightweight, and reliable operation. It typically just means running the `nginx –s reload` command, which checks the configuration on disk and sends the master process a SIGHUP signal. + +When the master process receives a SIGHUP, it does two things: + +- Reloads the configuration and forks a new set of worker processes. These new worker processes immediately begin accepting connections and processing traffic (using the new configuration settings). +- Signals the old worker processes to gracefully exit. The worker processes stop accepting new connections. As soon as each current HTTP request completes, the worker process cleanly shuts down the connection (that is, there are no lingering keepalives). Once all connections are closed, the worker processes exit. + +This reload process can cause a small spike in CPU and memory usage, but it’s generally imperceptible compared to the resource load from active connections. You can reload the configuration multiple times per second (and many NGINX users do exactly that). Very rarely, issues arise when there are many generations of NGINX worker processes waiting for connections to close, but even those are quickly resolved. + +NGINX’s binary upgrade process achieves the holy grail of high-availability – you can upgrade the software on the fly, without any dropped connections, downtime, or interruption in service. + +![New Binary](http://cdn.nginx.com/wp-content/uploads/2015/06/Screen-Shot-2015-06-08-at-12.41.51-PM.png) + +The binary upgrade process is similar in approach to the graceful reload of configuration. A new NGINX master process runs in parallel with the original master process, and they share the listening sockets. Both processes are active, and their respective worker processes handle traffic. You can then signal the old master and its workers to gracefully exit. + +The entire process is described in more detail in [Controlling NGINX][9]. + +### Conclusion ### + +The [Inside NGINX infographic][10] provides a high-level overview of how NGINX functions, but behind this simple explanation is over ten years of innovation and optimization that enable NGINX to deliver the best possible performance on a wide range of hardware while maintaining the security and reliability that modern web applications require. + +If you’d like to read more about the optimizations in NGINX, check out these great resources: + +- [Installing and Tuning NGINX for Performance][11] (webinar; [slides][12] at Speaker Deck) +- [Tuning NGINX for Performance][13] +- [The Architecture of Open Source Applications – NGINX][14] +- [Socket Sharding in NGINX Release 1.9.1][15] (using the SO_REUSEPORT socket option) + +-------------------------------------------------------------------------------- + +via: http://nginx.com/blog/inside-nginx-how-we-designed-for-performance-scale/ + +作者:[Owen Garrett][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://nginx.com/author/owen/ +[1]:http://nginx.com/resources/library/infographic-inside-nginx/ +[2]:http://nginx.org/en/docs/ngx_core_module.html#worker_processes +[3]:http://nginx.org/en/docs/ngx_core_module.html#accept_mutex +[4]:http://nginx.com/blog/socket-sharding-nginx-release-1-9-1/ +[5]:http://en.wikipedia.org/wiki/Simultaneous_exhibition +[6]:http://gambit.blogs.nytimes.com/2009/03/03/in-chess-records-were-made-to-be-broken/ +[7]:http://www.aosabook.org/en/nginx.html +[8]:http://nginx.com/blog/tuning-nginx/ +[9]:http://nginx.org/en/docs/control.html +[10]:http://nginx.com/resources/library/infographic-inside-nginx/ +[11]:http://nginx.com/resources/webinars/installing-tuning-nginx/ +[12]:https://speakerdeck.com/nginx/nginx-installation-and-tuning +[13]:http://nginx.com/blog/tuning-nginx/ +[14]:http://www.aosabook.org/en/nginx.html +[15]:http://nginx.com/blog/socket-sharding-nginx-release-1-9-1/ \ No newline at end of file From 1ca6167f0f43b7469c2c72ee7802ae9e2ff9092b Mon Sep 17 00:00:00 2001 From: DeadFire Date: Fri, 12 Jun 2015 14:55:11 +0800 Subject: [PATCH 356/965] =?UTF-8?q?20150612-2=20=E9=80=89=E9=A2=98=20RHCSA?= =?UTF-8?q?=20Series=2014?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... Up LDAP-based Authentication in RHEL 7.md | 275 ++++++++++++++++++ 1 file changed, 275 insertions(+) create mode 100644 sources/tech/RHCSA Series/RHCSA Series--Part 14--Setting Up LDAP-based Authentication in RHEL 7.md diff --git a/sources/tech/RHCSA Series/RHCSA Series--Part 14--Setting Up LDAP-based Authentication in RHEL 7.md b/sources/tech/RHCSA Series/RHCSA Series--Part 14--Setting Up LDAP-based Authentication in RHEL 7.md new file mode 100644 index 0000000000..36bf319b19 --- /dev/null +++ b/sources/tech/RHCSA Series/RHCSA Series--Part 14--Setting Up LDAP-based Authentication in RHEL 7.md @@ -0,0 +1,275 @@ +RHCSA Series: Setting Up LDAP-based Authentication in RHEL 7 – Part 14 +================================================================================ +We will begin this article by outlining some LDAP basics (what it is, where it is used and why) and show how to set up a LDAP server and configure a client to authenticate against it using Red Hat Enterprise Linux 7 systems. + +![Setup LDAP Server and Client Authentication](http://www.tecmint.com/wp-content/uploads/2015/06/setup-ldap-server-and-configure-client-authentication.png) + +RHCSA Series: Setup LDAP Server and Client Authentication – Part 14 + +As we will see, there are several other possible application scenarios, but in this guide we will focus entirely on LDAP-based authentication. In addition, please keep in mind that due to the vastness of the subject, we will only cover its basics here, but you can refer to the documentation outlined in the summary for more in-depth details. + +For the same reason, you will note that I have decided to leave out several references to man pages of LDAP tools for the sake of brevity, but the corresponding explanations are at a fingertip’s distance (man ldapadd, for example). + +That said, let’s get started. + +**Our Testing Environment** + +Our test environment consists of two RHEL 7 boxes: + + Server: 192.168.0.18. FQDN: rhel7.mydomain.com + Client: 192.168.0.20. FQDN: ldapclient.mydomain.com + +If you want, you can use the machine installed in [Part 12: Automate RHEL 7 installations][1] using Kickstart as client. + +#### What is LDAP? #### + +LDAP stands for Lightweight Directory Access Protocol and consists in a set of protocols that allows a client to access, over a network, centrally stored information (such as a directory of login shells, absolute paths to home directories, and other typical system user information, for example) that should be accessible from different places or available to a large number of end users (another example would be a directory of home addresses and phone numbers of all employees in a company). + +Keeping such (and more) information centrally means it can be more easily maintained and accessed by everyone who has been granted permissions to use it. + +The following diagram offers a simplified diagram of LDAP, and is described below in greater detail: + +![LDAP Diagram](http://www.tecmint.com/wp-content/uploads/2015/06/LDAP-Diagram.png) + +LDAP Diagram + +Explanation of above diagram in detail. + +- An entry in a LDAP directory represents a single unit or information and is uniquely identified by what is called a Distinguished Name. +- An attribute is a piece of information associated with an entry (for example, addresses, available contact phone numbers, and email addresses). +- Each attribute is assigned one or more values consisting in a space-separated list. A value that is unique per entry is called a Relative Distinguished Name. + +That being said, let’s proceed with the server and client installations. + +### Installing and Configuring a LDAP Server and Client ### + +In RHEL 7, LDAP is implemented by OpenLDAP. To install the server and client, use the following commands, respectively: + + # yum update && yum install openldap openldap-clients openldap-servers + # yum update && yum install openldap openldap-clients nss-pam-ldapd + +Once the installation is complete, there are some things we look at. The following steps should be performed on the server alone, unless explicitly noted: + +**1. Make sure SELinux does not get in the way by enabling the following booleans persistently, both on the server and the client:** + + # setsebool -P allow_ypbind=0 authlogin_nsswitch_use_ldap=0 + +Where allow_ypbind is required for LDAP-based authentication, and authlogin_nsswitch_use_ldap may be needed by some applications. + +**2. Enable and start the service:** + + # systemctl enable slapd.service + # systemctl start slapd.service + +Keep in mind that you can also disable, restart, or stop the service with [systemctl][2] as well: + + # systemctl disable slapd.service + # systemctl restart slapd.service + # systemctl stop slapd.service + +**3. Since the slapd service runs as the ldap user (which you can verify with ps -e -o pid,uname,comm | grep slapd), such user should own the /var/lib/ldap directory in order for the server to be able to modify entries created by administrative tools that can only be run as root (more on this in a minute).** + +Before changing the ownership of this directory recursively, copy the sample database configuration file for slapd into it: + + # cp /usr/share/openldap-servers/DB_CONFIG.example /var/lib/ldap/DB_CONFIG + # chown -R ldap:ldap /var/lib/ldap + +**4. Set up an OpenLDAP administrative user and assign a password:** + + # slappasswd + +as shown in the next image: + +![Set LDAP Admin Password](http://www.tecmint.com/wp-content/uploads/2015/06/Set-LDAP-Admin-Password.png) + +Set LDAP Admin Password + +and create an LDIF file (ldaprootpasswd.ldif) with the following contents: + + dn: olcDatabase={0}config,cn=config + changetype: modify + add: olcRootPW + olcRootPW: {SSHA}PASSWORD + +where: + +- PASSWORD is the hashed string obtained earlier. +- cn=config indicates global config options. +- olcDatabase indicates a specific database instance name and can be typically found inside /etc/openldap/slapd.d/cn=config. + +Referring to the theoretical background provided earlier, the `ldaprootpasswd.ldif` file will add an entry to the LDAP directory. In that entry, each line represents an attribute: value pair (where dn, changetype, add, and olcRootPW are the attributes and the strings to the right of each colon are their corresponding values). + +You may want to keep this in mind as we proceed further, and please note that we are using the same Common Names `(cn=)` throughout the rest of this article, where each step depends on the previous one. + +**5. Now, add the corresponding LDAP entry by specifying the URI referring to the ldap server, where only the protocol/host/port fields are allowed.** + + # ldapadd -H ldapi:/// -f ldaprootpasswd.ldif + +The output should be similar to: + +![LDAP Configuration](http://www.tecmint.com/wp-content/uploads/2015/06/LDAP-Configuration.png) + +LDAP Configuration + +and import some basic LDAP definitions from the `/etc/openldap/schema` directory: + + # for def in cosine.ldif nis.ldif inetorgperson.ldif; do ldapadd -H ldapi:/// -f /etc/openldap/schema/$def; done + +![LDAP Definitions](http://www.tecmint.com/wp-content/uploads/2015/06/LDAP-Definitions.png) + +LDAP Definitions + +**6. Have LDAP use your domain in its database.** + +Create another LDIF file, which we will call `ldapdomain.ldif`, with the following contents, replacing your domain (in the Domain Component dc=) and password as appropriate: + + dn: olcDatabase={1}monitor,cn=config + changetype: modify + replace: olcAccess + olcAccess: {0}to * by dn.base="gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth" + read by dn.base="cn=Manager,dc=mydomain,dc=com" read by * none + + dn: olcDatabase={2}hdb,cn=config + changetype: modify + replace: olcSuffix + olcSuffix: dc=mydomain,dc=com + + dn: olcDatabase={2}hdb,cn=config + changetype: modify + replace: olcRootDN + olcRootDN: cn=Manager,dc=mydomain,dc=com + + dn: olcDatabase={2}hdb,cn=config + changetype: modify + add: olcRootPW + olcRootPW: {SSHA}PASSWORD + + dn: olcDatabase={2}hdb,cn=config + changetype: modify + add: olcAccess + olcAccess: {0}to attrs=userPassword,shadowLastChange by + dn="cn=Manager,dc=mydomain,dc=com" write by anonymous auth by self write by * none + olcAccess: {1}to dn.base="" by * read + olcAccess: {2}to * by dn="cn=Manager,dc=mydomain,dc=com" write by * read + +Then load it as follows: + + # ldapmodify -H ldapi:/// -f ldapdomain.ldif + +![LDAP Domain Configuration](http://www.tecmint.com/wp-content/uploads/2015/06/LDAP-Domain-Configuration.png) + +LDAP Domain Configuration + +**7. Now it’s time to add some entries to our LDAP directory. Attributes and values are separated by a colon `(:)` in the following file, which we’ll name `baseldapdomain.ldif`:** + + dn: dc=mydomain,dc=com + objectClass: top + objectClass: dcObject + objectclass: organization + o: mydomain com + dc: mydomain + + dn: cn=Manager,dc=mydomain,dc=com + objectClass: organizationalRole + cn: Manager + description: Directory Manager + + dn: ou=People,dc=mydomain,dc=com + objectClass: organizationalUnit + ou: People + + dn: ou=Group,dc=mydomain,dc=com + objectClass: organizationalUnit + ou: Group + +Add the entries to the LDAP directory: + + # ldapadd -x -D cn=Manager,dc=mydomain,dc=com -W -f baseldapdomain.ldif + +![Add LDAP Domain Attributes and Values](http://www.tecmint.com/wp-content/uploads/2015/06/Add-LDAP-Domain-Configuration.png) + +Add LDAP Domain Attributes and Values + +**8. Create a LDAP user called ldapuser (adduser ldapuser), then create the definitions for a LDAP group in `ldapgroup.ldif`.** + + # adduser ldapuser + # vi ldapgroup.ldif + +Add following content. + + dn: cn=Manager,ou=Group,dc=mydomain,dc=com + objectClass: top + objectClass: posixGroup + gidNumber: 1004 + +where gidNumber is the GID in /etc/group for ldapuser) and load it: + + # ldapadd -x -W -D "cn=Manager,dc=mydomain,dc=com" -f ldapgroup.ldif + +**9. Add a LDIF file with the definitions for user ldapuser (`ldapuser.ldif`):** + + dn: uid=ldapuser,ou=People,dc=mydomain,dc=com + objectClass: top + objectClass: account + objectClass: posixAccount + objectClass: shadowAccount + cn: ldapuser + uid: ldapuser + uidNumber: 1004 + gidNumber: 1004 + homeDirectory: /home/ldapuser + userPassword: {SSHA}fiN0YqzbDuDI0Fpqq9UudWmjZQY28S3M + loginShell: /bin/bash + gecos: ldapuser + shadowLastChange: 0 + shadowMax: 0 + shadowWarning: 0 + +and load it: + + # ldapadd -x -D cn=Manager,dc=mydomain,dc=com -W -f ldapuser.ldif + +![LDAP User Configuration](http://www.tecmint.com/wp-content/uploads/2015/06/LDAP-User-Configuration.png) + +LDAP User Configuration + +Likewise, you can delete the user entry you just created: + + # ldapdelete -x -W -D cn=Manager,dc=mydomain,dc=com "uid=ldapuser,ou=People,dc=mydomain,dc=com" + +**10. Allow communication through the firewall:** + + # firewall-cmd --add-service=ldap + +**11. Last, but not least, enable the client to authenticate using LDAP.** + +To help us in this final step, we will use the authconfig utility (an interface for configuring system authentication resources). + +Using the following command, the home directory for the requested user is created if it doesn’t exist after the authentication against the LDAP server succeeds: + + # authconfig --enableldap --enableldapauth --ldapserver=rhel7.mydomain.com --ldapbasedn="dc=mydomain,dc=com" --enablemkhomedir --update + +![LDAP Client Configuration](http://www.tecmint.com/wp-content/uploads/2015/06/LDAP-Client-Configuration.png) + +LDAP Client Configuration + +### Summary ### + +In this article we have explained how to set up basic authentication against a LDAP server. To further configure the setup described in the present guide, please refer to [Chapter 13 – LDAP Configuration][3] in the RHEL 7 System administrator’s guide, paying special attention to the security settings using TLS. + +Feel free to leave any questions you may have using the comment form below. + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/setup-ldap-server-and-configure-client-authentication/ + +作者:[Gabriel Cánepa][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/gacanepa/ +[1]:http://www.tecmint.com/automatic-rhel-installations-using-kickstart/ +[2]:http://www.tecmint.com/manage-services-using-systemd-and-systemctl-in-linux/ +[3]:https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/System_Administrators_Guide/ch-Directory_Servers.html \ No newline at end of file From ee107f6081605dce3fc6a61a7c7e33c3fe0d448c Mon Sep 17 00:00:00 2001 From: DeadFire Date: Fri, 12 Jun 2015 15:36:37 +0800 Subject: [PATCH 357/965] =?UTF-8?q?20150612-3=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...che Containers with Docker on Fedora 22.md | 282 ++++++++++++++++++ ...gure Swarm Native Clustering for Docker.md | 95 ++++++ ...Color ANSI Logos of Linux Distributions.md | 183 ++++++++++++ 3 files changed, 560 insertions(+) create mode 100644 sources/tech/20150612 How to Configure Apache Containers with Docker on Fedora 22.md create mode 100644 sources/tech/20150612 How to Configure Swarm Native Clustering for Docker.md create mode 100644 sources/tech/20150612 Linux_Logo--A Command Line Tool to Print Color ANSI Logos of Linux Distributions.md diff --git a/sources/tech/20150612 How to Configure Apache Containers with Docker on Fedora 22.md b/sources/tech/20150612 How to Configure Apache Containers with Docker on Fedora 22.md new file mode 100644 index 0000000000..493e474c7e --- /dev/null +++ b/sources/tech/20150612 How to Configure Apache Containers with Docker on Fedora 22.md @@ -0,0 +1,282 @@ +How to Configure Apache Containers with Docker on Fedora 22 +================================================================================ +In this article we are going to learn about Docker, how to use it to deploy Apache httpd and how can you share it on Docker Hub. First we are going to learn how to pull and use images hosted on Docker Hub, and then install Apache on an image of Fedora 22 interactively, after that we are going to learn how to use a Dockerfile to make an image in a faster and more elegant way, finally we are going to publish the image we've created in Docker Hub, so anyone will be able download and use it later. + +### Installing Docker and saying hello world ### + +**Requirements** + +You will need atleast these things to run Docker: + +- You need a 64bit Kernel version 3.10 or higher +- Iptables 1.4 - This will be used by Docker to make the network wizardry, such as Network Address Translation. +- Git 1.7 - Docker uses Git to make it transactions to repositories, like Docker Hub +- ps - This utility is present in most environments and is provided in the procps package. +- root - despite normal users can run docker client by TCP and other means, we will assume that you are root, for sake of simplicity + +#### Install docker using dnf #### + +The following commands will install Docker + + dnf update && dnf install docker + +**Note**: You can still use Yum in Fedora 22, but it's deprecated in favor of DNF and is not present in a clean install. + +#### Check your install #### + +The first command we are going to use is docker info, this give you many information: + + docker info + +Also try **docker version**: + + docker version + +#### Starting Docker as daemon #### + +You should start a docker instance that will take care of our requests. + + docker -d + +Now set docker to start with the system, so you don't need to run the previous command every time you reboot. + + chkconfig docker on + +Let's say hello world with Busybox: + + docker run -t busybox /bin/echo "hello world" + +In this command, we tell Docker to execute /bin/echo "hello world" in an instance/container of the Busybox image, which is a minimal POSIX environment based in a single binary and links to it. + +If Docker can't find a local image of Busybox on your system, it will pull the image automatically from Docker Hub, as you can see in the following screenshot: + +![Hello world with Busybox](http://blog.linoxide.com/wp-content/uploads/2015/06/docker-hello-world-busybox-complete.png) + +Hello world with Busybox + +Try the same command again, this time as Docker already have the Busybox image locally, all you will see is the output of echo: + + docker run -t busybox /bin/echo "hello world" + +Try also the following to enter in the container environment: + + docker run -it busybox /bin/sh + +To leave and stop the container use the **exit** command + +### Dockerizing Apache interactively ### + +Pull/Download the Fedora image: + + docker pull fedora:22 + +Run a container dettached from the console: + + docker run -d -t fedora:22 /bin/bash + +List running containers and identify by name as follows + + docker ps + +![listing with docker ps and attaching with docker attach](http://blog.linoxide.com/wp-content/uploads/2015/06/docker-ps-with-docker-attach-highlight.png) + +listing with docker ps and attaching with docker attach + +The name angry_nobel was given to our instance, so let's attach: + + docker attach angry_nobel + +Note: Every time you run a container a new name will be given, if you need a constant name for you container you should use the -name parameter to docker run command. + +#### Installing Apache #### + +The following command will update DNF database, download install Apache (httpd package) and clean DNF cache to make the image small + + dnf -y update && dnf -y install httpd && dnf -y clean all + +Configuring Apache + +The only thing we are going to change httpd.conf is the ServerName, this makes Apache stops to complain. + + sed -i.orig 's/#ServerName/ServerName/' /etc/httpd/conf/httpd.conf + +**Set the environment** + +To make Apache run in standalone mode, you must provide some information in the form of enviroenment variables, and also you will need the directories set in these variables, so we are going to make this with a small shell script that will also start Apache + + vi /etc/httpd/run_apache_foreground + +---------- + + #!/bin/bash + + #set variables + APACHE_LOG_DI=R"/var/log/httpd" + APACHE_LOCK_DIR="/var/lock/httpd" + APACHE_RUN_USER="apache" + APACHE_RUN_GROUP="apache" + APACHE_PID_FILE="/var/run/httpd/httpd.pid" + APACHE_RUN_DIR="/var/run/httpd" + + #create directories if necessary + if ! [ -d /var/run/httpd ]; then mkdir /var/run/httpd;fi + if ! [ -d /var/log/httpd ]; then mkdir /var/log/httpd;fi + if ! [ -d /var/lock/httpd ]; then mkdir /var/lock/httpd;fi + + #run Apache + httpd -D FOREGROUND + +**Alternatively**, you can past and run this snippet on the container shell: + + dnf -y install git && git clone https://github.com/gaiada/run-apache-foreground.git && cd run-apach* && ./install && dnf erase git + +The inline script above will, install Git, clone [this repository][1], put the script in place and ask you if you want uninstall Git. + +**Saving your container state** + +Your container is now ready to run Apache, now it is time to save the current state of this container in an image to be able use whenever you need. + +To leave the container environment, you must press **Ctrl+p** followed by **Ctrl+q**, if you just call exit in the shell, you will also stop the container and lost what you have done so far. + +Once you are back to the Docker host, use **docker commit** followed by the container and the repository name/tag you desire: + + docker commit angry_nobel gaiada/apache + +Now that you saved the container status into a image, you can use **docker stop** on the running container: + + docker stop angry_nobel + +**Run and test your image** + +Finally, run a container from your new image and redirect connections on port 80 to it with: + + docker run -p 80:80 -d -t gaiada/apache /etc/httpd/run_apache_foreground + + + +At this point, you are already running Apache in your container, open your browser to access the service in [http://localhost][2] and you will see the Apache default page as follows + +![Apache default page running from Docker container](http://blog.linoxide.com/wp-content/uploads/2015/06/docker-apache-running.png) + +Apache default page running from Docker container + +### Dockerizing Apache with a Dockerfile ### + +Now we are going to create a new Apache image, this time the steps will be written in a Dockerfile, that will be processed to form the image. + +First, create a directory on which we will put the Dockerfile and enter this directory: + + mkdir apachedf; cd apachedf + +And then create a file named Dockerfile with the following content: + + FROM fedora:22 + + MAINTAINER Carlos Alberto + LABEL version="0.1" + + RUN dnf -y update && dnf -y install httpd && dnf -y clean all + + RUN [ -d /var/log/httpd ] || mkdir /var/log/httpd + RUN [ -d /var/run/httpd ] || mkdir /var/run/httpd + RUN [ -d /var/lock/httpd ] || mkdir /var/lock/httpd + + RUN sed -i.orig 's/#ServerName/ServerName/' /etc/httpd/conf/httpd.conf + + ENV APACHE_RUN_USER apache + ENV APACHE_RUN_GROUP apache + ENV APACHE_LOG_DIR /var/log/httpd + ENV APACHE_LOCK_DIR /var/lock/httpd + ENV APACHE_RUN_DIR /var/run/httpd + ENV APACHE_PID_FILE /var/run/httpd/httpd.pid + + EXPOSE 80 + + CMD ["/usr/sbin/httpd", "-D", "FOREGROUND"] + + + +Let's see what is on this Dockerfile: + +**FROM** - This tells docker that we are going to use Fedora 22 as base image + +**MANTAINER** and **LABEL** - these commands are informative and have no direct influence on the image + +**RUN** - Automate the steps we've done interactively, install Apache, create directories and edit httpd.conf + +**ENV** - Set the environment variables, now we don't need the run_apache_foreground script anymore. + +**EXPOSE** - Expose the port 80 to the world + +**CMD** - Set the default command to httpd, so we don't need to do this every time we start a new container + +**Build the image** + +Now we are going to build the image and put the TAG gaiada/apachedf on it: + + docker build -t gaiada/apachedf:0.1 . + +![docker build complete](http://blog.linoxide.com/wp-content/uploads/2015/06/docker-build-complete.png) + +docker build complete + +Use **docker images** list the local images and see if your new image is there: + + docker images + +And then run you new image: + + docker run -t -p 80:80 gaiada/apachedf + +That is it for the Dockerfile, using this feature make things much easier, faster and reproducible. + +### Publishing your images ### + +Until now, you just pulled images from Docker Hub, but you can also push you image and pull them later as needed. In fact other can also download your image and use it in their systems without the need of change anything and now we are going to learn how to make our image available for others worldwide. + +**Creating account** + +For you to be able to push your image on Docker Hub, you need to create an account. Access [https://hub.docker.com/account/signup/][3] and fill the following form: + +![Docker Hub signup page](http://blog.linoxide.com/wp-content/uploads/2015/06/docker-hub-signup.png) + +Docker Hub signup page + +**Login** + +Enter the following command and proceed with the login name, password and email you provided in your account creation + + docker login + +After you do the first login, your account information will be recorded in **~/.dockercfg** + +**Pushing** + +Push the page to the server with the **docker push [registry/]your_login/repository_name[:tag]** + + docker push docker.io/gaiada/apachedf + +You might see something like this on your console: + +![Docker push Apache image complete](http://blog.linoxide.com/wp-content/uploads/2015/06/docker-pushing-apachedf-complete.png) + +Docker push Apache image complete + +### Conclusion ### + +Now that you know how to Dockerize Apache, try to include some modules, Perl, PHP, proxy, HTTPS, or whatever you need. I hope you guys liked it, and push your own images on Docker Hub. + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/linux-how-to/configure-apache-containers-docker-fedora-22/ + +作者:[Carlos Alberto][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://linoxide.com/author/carlosal/ +[1]:https://github.com/gaiada/run-apache-foreground +[2]:http://localhost/ +[3]:https://hub.docker.com/account/signup/ \ No newline at end of file diff --git a/sources/tech/20150612 How to Configure Swarm Native Clustering for Docker.md b/sources/tech/20150612 How to Configure Swarm Native Clustering for Docker.md new file mode 100644 index 0000000000..d07cd26428 --- /dev/null +++ b/sources/tech/20150612 How to Configure Swarm Native Clustering for Docker.md @@ -0,0 +1,95 @@ +How to Configure Swarm Native Clustering for Docker +================================================================================ +Hi everyone, today we'll learn about Swarm and how we can create native clusters using Docker with Swarm. [Docker Swarm][1] is a native clustering program for Docker which turns a pool of Docker hosts into a single virtual host. Swarm serves the standard Docker API, so any tool which can communicate with a Docker daemon can use Swarm to transparently scale to multiple hosts. Swarm follows the "batteries included but removable" principle as other Docker Projects. It ships with a simple scheduling backend out of the box, and as initial development settles, an API will develop to enable pluggable backends. The goal is to provide a smooth out-of-box experience for simple use cases, and allow swapping in more powerful backends, like Mesos, for large scale production deployments. Swarm is extremely easy to setup and get started. + +So, here are some features of Swarm 0.2 out of the box. + +1. Swarm 0.2.0 is about 85% compatible with the Docker Engine. +2. It supports Resource Management. +3. It has Advanced Scheduling feature with constraints and affinities. +4. It supports multiple Discovery Backends (hubs, consul, etcd, zookeeper) +5. It uses TLS encryption method for security and authentication. + +So, here are some very simple and easy steps on how we can use Swarm. + +### 1. Pre-requisites to run Swarm ### + +We must install Docker 1.4.0 or later on all nodes. While each node's IP need not be public, the Swarm manager must be able to access each node across the network. + +Note: Swarm is currently in beta, so things are likely to change. We don't recommend you use it in production yet. + +### 2. Creating Swarm Cluster ### + +Now, we'll create swarm cluster by running the below command. Each node will run a swarm node agent. The agent registers the referenced Docker daemon, monitors it, and updates the discovery backend with the node's status. The below command returns a token which is a unique cluster id, it will be used when starting the Swarm Agent on nodes. + + # docker run swarm create + +![Creating Swarm Cluster](http://blog.linoxide.com/wp-content/uploads/2015/05/creating-swarm-cluster.png) + +### 3. Starting the Docker Daemon in each nodes ### + +We'll need to login into each node that we'll use to create clusters and start the Docker Daemon into it using flag -H . It ensures that the docker remote API on the node is available over TCP for the Swarm Manager. To do start the docker daemon, we'll need to run the following command inside the nodes. + + # docker -H tcp://0.0.0.0:2375 -d + +![Starting Docker Daemon](http://blog.linoxide.com/wp-content/uploads/2015/05/starting-docker-daemon.png) + +### 4. Adding the Nodes ### + +After enabling Docker Daemon, we'll need to add the Swarm Nodes to the discovery service. We must ensure that node's IP must be accessible from the Swarm Manager. To do so, we'll need to run the following command. + + # docker run -d swarm join --addr=:2375 token:// + +![Adding Nodes to Cluster](http://blog.linoxide.com/wp-content/uploads/2015/05/adding-nodes-to-cluster.png) + +**Note**: Here, we'll need to replace and with the IP address of the Node and the cluster ID we got from step 2. + +### 5. Starting the Swarm Manager ### + +Now, as we have got the nodes connected to the cluster. Now, we'll start the swarm manager, we'll need to run the following command in the node. + + # docker run -d -p :2375 swarm manage token:// + +![Starting Swarm Manager](http://blog.linoxide.com/wp-content/uploads/2015/05/starting-swarm-manager.png) + +### 6. Checking the Configuration ### + +Once the manager is running, we can check the configuration by running the following command. + + # docker -H tcp:// info + +![Accessing Swarm Clusters](http://blog.linoxide.com/wp-content/uploads/2015/05/accessing-swarm-cluster.png) + +**Note**: We'll need to replace with the ip address and port of the host running the swarm manager. + +### 7. Using the docker CLI to access nodes ### + +After everything is done perfectly as explained above, this part is the most important part of the Docker Swarm. We can use Docker CLI to access the nodes and run containers on them. + + # docker -H tcp:// info + # docker -H tcp:// run ... + +### 8. Listing nodes in the cluster ### + +We can get a list of all of the running nodes using the swarm list command. + + # docker run --rm swarm list token:// + +![Listing Swarm Nodes](http://blog.linoxide.com/wp-content/uploads/2015/05/listing-swarm-nodes.png) + +### Conclusion ### + +Swarm is really an awesome feature of docker that can be used for creating and managing clusters. It is pretty easy to setup and use. It is more beautiful when we use constraints and affinities on top of it. Advanced Scheduling is an awesome feature of it which applies filters to exclude nodes with ports, labels, health and it uses strategies to pick the best node. So, if you have any questions, comments, feedback please do write on the comment box below and let us know what stuffs needs to be added or improved. Thank You! Enjoy :-) + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/linux-how-to/configure-swarm-clustering-docker/ + +作者:[Arun Pyasi][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://linoxide.com/author/arunp/ +[1]:https://docs.docker.com/swarm/ \ No newline at end of file diff --git a/sources/tech/20150612 Linux_Logo--A Command Line Tool to Print Color ANSI Logos of Linux Distributions.md b/sources/tech/20150612 Linux_Logo--A Command Line Tool to Print Color ANSI Logos of Linux Distributions.md new file mode 100644 index 0000000000..6cdc510092 --- /dev/null +++ b/sources/tech/20150612 Linux_Logo--A Command Line Tool to Print Color ANSI Logos of Linux Distributions.md @@ -0,0 +1,183 @@ +Linux_Logo – A Command Line Tool to Print Color ANSI Logos of Linux Distributions +================================================================================ +linuxlogo or linux_logo is a Linux command line utility that generates a color ANSI picture of Distribution logo with a few system information. + +![Linux_Logo - Prints Color ANSI Logs of Linux Distro](http://www.tecmint.com/wp-content/uploads/2015/06/Linux_Logo.png) + +Linux_Logo – Prints Color ANSI Logs of Linux Distro + +This utility obtains System Information from /proc Filesystem. linuxlogo is capable of showing color ANSI image of various logos other than the host distribution logo. + +The System information associated with logo includes – Linux Kernel Version, Time when Kernel was last Compiled, Number/core of processor, Speed, Manufacturer and processor Generation. It also show information about total physical RAM. + +It is worth mentioning here that screenfetch is another tool of similar kind, which shows distribution logo and a more detailed and formatted system inform http://www.tecmint.com/screenfetch-system-information-generator-for-linux/ation. We have already covered screenfetch long ago, which you may refer at: + +- [ScreenFetch – Generates Linux System Information][15] + +linux_logo and Screenfetch should not be compared to each other. While the output of screenfetch is more formatted and detailed, where linux_logo produce maximum number of color ANSI diagram, and option to format the output. + +linux_logo is written primarily in C programming Language, which displays linux logo in an X Window System and hence User Interface X11 aka X Window System should be installed. The software is released under GNU General Public License Version 2.0. + +For the purpose of this article, we’re using following testing environment to test the linux_logo utility. + + Operating System : Debian Jessie + Processor : i3 / x86_64 + +### Installing Linux Logo Utility in Linux ### + +**1. The linuxlogo package (stable version 5.11) is available to install from default package repository under all Linux distributions using apt, yum or dnf package manager as shown below.** + + # apt-get install linux_logo [On APT based Systems] + # yum install linux_logo [On Yum based Systems] + # dnf install linux_logo [On DNF based Systems] + OR + # dnf install linux_logo.x86_64 [For 64-bit architecture] + +**2. Once linuxlogo package has been installed, you can run the command `linuxlogo` to get the default logo for the distribution you are using..** + + # linux_logo + OR + # linuxlogo + +![Get Default OS Logo](http://www.tecmint.com/wp-content/uploads/2015/06/Get-Default-OS-Logo.png) + +Get Default OS Logo + +**3. Use the option `[-a]`, not to print any fancy color. Useful if viewing linux_logo over black and white terminal.** + + # linux_logo -a + +![Black and White Linux Logo](http://www.tecmint.com/wp-content/uploads/2015/06/Black-and-White-Linux-Logo.png) + +Black and White Linux Logo + +**4. Use option `[-l]` to print LOGO only and exclude all other System Information.** + +# linux_logo -l + +![Print Distribution Logo](http://www.tecmint.com/wp-content/uploads/2015/06/Print-Distribution-Logo.png) + +Print Distribution Logo + +**5. The `[-u]` switch will display system uptime.** + + # linux_logo -u + +![Print System Uptime](http://www.tecmint.com/wp-content/uploads/2015/06/Print-System-Uptime.png) + +Print System Uptime + +**6. If you are interested in Load Average, use option `[-y]`. You may use more than one option at a time.** + + # linux_logo -y + +![Print System Load Average](http://www.tecmint.com/wp-content/uploads/2015/06/Print-System-Load-Average.png) + +Print System Load Average + +For more options and help on them, you may like to run. + + # linux_logo -h + +![Linuxlogo Options and Help](http://www.tecmint.com/wp-content/uploads/2015/06/linuxlogo-options.png) + +Linuxlogo Options and Help + +**7. There are a lots of built-in Logos for various Linux distributions. You may see all those logos using option `-L list` switch.** + + # linux_logo -L list + +![List of Linux Logos](http://www.tecmint.com/wp-content/uploads/2015/06/List-of-Linux-Logos.png) + +List of Linux Logos + +Now you want to print any of the logo from the list, you may use `-L NUM` or `-L NAME` to display selected logo. + +- -L NUM – will print logo with number NUM (deprecated). +- -L NAME – will print the logo with name NAME. + +For example, to display AIX Logo, you may use command as: + + # linux_logo -L 1 + OR + # linux_logo -L aix + +![Print AIX Logo](http://www.tecmint.com/wp-content/uploads/2015/06/Print-AIX-Logo.png) + +Print AIX Logo + +**Notice**: The `-L 1` in the command where 1 is the number at which AIX logo appears in the list, where `-L aix` is the name at which AIX logo appears in the list. + +Similarly, you may print any logo using these options, few examples to see.. + + # linux_logo -L 27 + # linux_logo -L 21 + +![Various Linux Logos](http://www.tecmint.com/wp-content/uploads/2015/06/Various-Linux-Logos.png) + +Various Linux Logos + +This way, you can use any of the logos just by using the number or name, that is against it. + +### Some Useful Tricks of Linux_logo ### + +**8. You may like to print your Linux distribution logo at login. To print default logo at login you may add the below line at the end of `~/.bashrc` file.** + + if [ -f /usr/bin/linux_logo ]; then linux_logo; fi + +**Notice**: If there isn’t any` ~/.bashrc` file, you may need to create one under user home directory. + +**9. After adding above line, just logout and re-login again to see the default logo of your Linux distribution.** + +![Print Logo on User Login](http://www.tecmint.com/wp-content/uploads/2015/06/Print-Logo-on-Login.png) + +Print Logo on User Login + +Also note, that you may print any logo, after login, simply by adding the below line. + + if [ -f /usr/bin/linux_logo ]; then linux_logo -L num; fi + +**Important**: Don’t forget to replace num with the number that is against the logo, you want to use. + +**10. You can also print your own logo by simply specifying the location of the logo as shown below.** + + # linux_logo -D /path/to/ASCII/logo + +**11. Print logo on Network Login.** + + # /usr/local/bin/linux_logo > /etc/issue.net + +You may like to use ASCII logo if there is no support for color filled ANSI Logo as: + + # /usr/local/bin/linux_logo -a > /etc/issue.net + +**12. Create a Penguin port – A set of port to answer connection. To create Penguin port Add the below line to file /etc/services file.** + + penguin 4444/tcp penguin + +Here ‘4444‘ is the port number which is currently free and not used by any resource. You may use a different port. + +Also add the below line to file /etc/inetd.conf file. + + penguin stream tcp nowait root /usr/local/bin/linux_logo + +Restart the service inetd as: + + # killall -HUP inetd + +Moreover linux_logo can be used in bootup script to fool the attacker as well as you can play a prank with your friend. This is a nice tool and I might use it in some of my scripts to get output as per distribution basis. + +Try it once and you won’t regret. Let us know what you think of this utility and how it can be useful for you. Keep Connected! Keep Commenting. Like and share us and help us get spread. + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/linux_logo-tool-to-print-color-ansi-logos-of-linux/ + +作者:[Avishek Kumar][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/avishek/ +[1]:http://www.tecmint.com/screenfetch-system-information-generator-for-linux/ \ No newline at end of file From 6cc8ebfcfd4b55f1522095583d260fae8d32d56b Mon Sep 17 00:00:00 2001 From: NearTan Date: Fri, 12 Jun 2015 18:38:21 +0800 Subject: [PATCH 358/965] translated --- ...Command Line Using 'Speedtest-CLI' Tool.md | 134 ------------ ...Command Line Using 'Speedtest-CLI' Tool.md | 196 ++++++++++++++++++ 2 files changed, 196 insertions(+), 134 deletions(-) delete mode 100644 sources/tech/20150316 How to Test Your Internet Speed Bidirectionally from Command Line Using 'Speedtest-CLI' Tool.md create mode 100644 translated/tech/20150316 How to Test Your Internet Speed Bidirectionally from Command Line Using 'Speedtest-CLI' Tool.md diff --git a/sources/tech/20150316 How to Test Your Internet Speed Bidirectionally from Command Line Using 'Speedtest-CLI' Tool.md b/sources/tech/20150316 How to Test Your Internet Speed Bidirectionally from Command Line Using 'Speedtest-CLI' Tool.md deleted file mode 100644 index 601a89151d..0000000000 --- a/sources/tech/20150316 How to Test Your Internet Speed Bidirectionally from Command Line Using 'Speedtest-CLI' Tool.md +++ /dev/null @@ -1,134 +0,0 @@ -translating by NearTan - -How to Test Your Internet Speed Bidirectionally from Command Line Using ‘Speedtest-CLI’ Tool -================================================================================ -We always need to check the speed of the Internet connection at home and office. What we do for this? Go to websites like Speedtest.net and begin test. It loads JavaScript in the web browser and then select best server based upon ping and output the result. It also uses a Flash player to produce graphical results. - -What about headless server, where isn’t any web based browser and the main point is, most of the servers are headless. The another bottleneck of such web browser based speed testing is that, you can’t schedule the speed testing at regular interval. Here comes an application “Speedtest-cli” that removes such bottlenecks and let you test the speed of Internet connection from command line. - -#### What is Speedtest-cli #### - -The application is basically a script developed in Python programming Language. It measures Internet Bandwidth speed bidirectionally. It used speedtest.net infrastructure to measure the speed. Speedtest-cli is able to list server based upon physical distance, test against specific server, and gives you URL to share the result of your internet speed test. - -To install latest speedtest-cli tool in Linux systems, you must have Python 2.4-3.4 or higher version installed on the system. - -### Install speedtest-cli in Linux ### - -There are two ways to install speedtest-cli tool. The first method involves the use of `python-pip` package while the second method is to download the Python script, make it executable and run, here I will cover both ways…. - -#### Install speedtest-cli Using pythin-pip #### - -First you need to install `python-pip` package, then afterwards you can install the speedtest-cli tool using pip command as shown below. - - $ sudo apt-get install python-pip - $ sudo pip install speedtest-cli - -To upgrade speedtest-cli, at later stage, use. - - $ sudo pip install speedtest-cli --upgrade - -#### Install speedtest-cli Using Python Script #### - -First download the python script from github using wget command, unpack the downloaded file (master.zip) and extract it.. - - $ wget https://github.com/sivel/speedtest-cli/archive/master.zip - $ unzip master.zip - -After extracting the file, go to the extracted directory `speedtest-cli-master` and make the script file executable. - - $ cd speedtest-cli-master/ - $ chmod 755 speedtest_cli.py - -Next, move the executable to `/usr/bin` folder, so that you don’t need to type the full path everytime. - - $ sudo mv speedtest_cli.py /usr/bin/ - -### Testing Internet Connection Speed with speedtest-cli ### - -**1. To test Download and Upload speed of your internet connection, run the `speedtest-cli` command without any argument as shown below.** - - $ speedtest_cli.py - -![Test Download Upload Speed in Linux](http://www.tecmint.com/wp-content/uploads/2015/03/Test-Download-Upload-Speed-in-Linux1.png) -Test Download Upload Speed in Linux - -**2. To check the speed result in bytes in place of bits.** - - $ speedtest_cli.py --bytes - -![Test Internet Speed in Bytes](http://www.tecmint.com/wp-content/uploads/2015/03/Test-Speed-in-Bytes.png) -Test Internet Speed in Bytes - -**3. Share your bandwidth speed with your friends or family. You are provided with a link that can be used to download an image.** - -![Share Internet Speed Results](http://www.tecmint.com/wp-content/uploads/2015/03/Share-Internet-Speed-Results.png) -Share Internet Speed Results - -The following picture is a sample speed test result generated using above command. - -![Speed Test Results](http://www.tecmint.com/wp-content/uploads/2015/03/Speed-Test-Results.png) -Speed Test Results - -**4. Don’t need any additional information other than Ping, Download and upload?** - - $ speedtest_cli.py --simple - -![Test Ping Download Upload Speed](http://www.tecmint.com/wp-content/uploads/2015/03/Test-Ping-Download-Upload-Speed1.png) -Test Ping Download Upload Speed - -**5. List the `speedtest.net` server based upon physical distance. The distance in km is mentioned.** - - $ speedtest_cli.py --list - -![Check Speedtest.net Servers](http://www.tecmint.com/wp-content/uploads/2015/03/Check-Speedtest-Servers.png) -Check Speedtest.net Servers - -**6. The last stage generated a huge list of servers sorted on the basis of distance. How to get desired output? Say I only want to see the speedtest.net server located in Mumbai (India).** - - $ speedtest_cli.py --list | grep -i Mumbai - -![Check Nearest Server](http://www.tecmint.com/wp-content/uploads/2015/03/Check-Nearest-Server.png) -Check Nearest Server - -**7. Test connection speed against a specific server. Use Server Id generated in example 5 and example 6 in above.** - - $ speedtest_cli.py --server [server ID] - $ speedtest_cli.py --server [5060] ## Here server ID 5060 is used in the example. - -![Test Connection Against Server](http://www.tecmint.com/wp-content/uploads/2015/03/Test-Connection-Against-Server.png) -Test Connection Against Server - -**8. To check the version number and help of `speedtest-cli` tool.** - - $ speedtest_cli.py --version - -![Check SpeedCli Version](http://www.tecmint.com/wp-content/uploads/2015/03/Check-SpeedCLi-Version.png) -Check SpeedCli Version - - $ speedtest_cli.py --help - -![SpeedCli Help](http://www.tecmint.com/wp-content/uploads/2015/03/SpeedCli-Help.png) -SpeedCli Help - -**Note:** Latency reported by tool is not its goal and one should not rely on it. The relative latency values output is responsible for server selected to be tested against. CPU and Memory capacity will influence the result to certain extent. - -### Conclusion ### - -The tool is must for system administrators and developers. A simple script which runs without any issue. I must say that the application is wonderful, lightweight and do what it promises. I disliked Speedtest.net for the reason it was using flash, but speedtest-cli gave me a reason to love them. - -speedtest_cli is a third party application and should not be used to automatically record the bandwidth speed. Speedtest.net is used by millions of users and it is a good idea to [Set Your Own Speedtest Mini Server][1]. - -That’s all for now, till then stay tuned and connected to Tecmint. Don’t forget to give your valuable feedback in the comments below. Like and share us and help us get spread. - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/check-internet-speed-from-command-line-in-linux/ - -作者:[Avishek Kumar][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://www.tecmint.com/author/avishek/ -[1]:http://www.tecmint.com/speedtest-mini-server-to-test-bandwidth-speed/ diff --git a/translated/tech/20150316 How to Test Your Internet Speed Bidirectionally from Command Line Using 'Speedtest-CLI' Tool.md b/translated/tech/20150316 How to Test Your Internet Speed Bidirectionally from Command Line Using 'Speedtest-CLI' Tool.md new file mode 100644 index 0000000000..9b4c2ae075 --- /dev/null +++ b/translated/tech/20150316 How to Test Your Internet Speed Bidirectionally from Command Line Using 'Speedtest-CLI' Tool.md @@ -0,0 +1,196 @@ + + +用命令行工具Speedtest-CLI来测试你的上下行网速 +================================================================================ + +我们经常需要到检查家里与办公室之间的网络是否连通,那么我们要怎么做呢?打开网站Speedtest.net然后开始测试。网站是通过加载浏览器中的JavaScript脚本然后选择最佳的服务器测速然后用Flash产生图形化的结果。 + + +那么远程服务器呢?要知道大多数远程服务器是没有浏览器可以打开web页面的。用浏览器打开网页测速的瓶颈就在此,你不能按计划的对服务器进行定期的常规测试。这时需要到一个名为Speedtest-cli的软件来打破这个瓶颈,它能让你通过命令行来测试互联网连接的速度。 + + +#### Speedtest-cli是什么 #### + + +此程序是基于Python开发的脚本程序,利用了speedtest.net的服务来测量出上下行的宽带。Speedtest-cli能根据机房离测速服务器的物理距离来列出测速服务器,或者针对某一服务器进行测速,同时还能为你生成一个URL以便你分享你的测速结果。 + + +要在Linux上安装最新版本的speedtest-cli,你必须安装2.4-3.4或者更高版本的Python。 + + +### 在Linux上安装speedtest-cli ### + + +有两种方法可以安装speedtest-cli。第一种方法需要用到`python-pip`包管理器,第二种方法需要安装Python脚本,生成安装文件然后运行,这里我们分别介绍两种方法: + + +#### 使用pythin-pip安装speedtest-cli#### + + +首先你需要安装`python-pip`包管理器,之后你就可以用pip命令来安装speedtest-cli + + $ sudo apt-get install python-pip + $ sudo pip install speedtest-cli + + +如果要吧speedtest-cli升级至最新版本,你需要输入以下命令 + + $ sudo pip install speedtest-cli --upgrade + + +#### 通过Pyhton脚本来安装speedtest-cli #### + + +首先要用wget命令从github上下来Python脚本,然后解压提取下载的文件(master.zip) + + $ wget https://github.com/sivel/speedtest-cli/archive/master.zip + $ unzip master.zip + + +提取出文件后,进入提取出的目录`speedtest-cli-master`然后使脚本可以执行。 + + $ cd speedtest-cli-master/ + $ chmod 755 speedtest_cli.py + + +下一步,把可执行的脚本移动到`/usr/bin`文件夹,这样你就不用每次都输入完整的脚本路径了。 + + $ sudo mv speedtest_cli.py /usr/bin/ + + +### 用speedtest-cli测试互联网连通速度### + + +**1. 要测试你的下载与上传速度,只需要运行`speedtest-cli`命令,不需要带参数。** + + $ speedtest_cli.py + +
+![Test Download Upload Speed in Linux](http://www.tecmint.com/wp-content/uploads/2015/03/Test-Download-Upload-Speed-in-Linux1.png) + +在Linux下测试上传下载速度 +
+ + +**2. 测试上传下载bytes的速度** + + $ speedtest_cli.py --bytes + +
+![Test Internet Speed in Bytes](http://www.tecmint.com/wp-content/uploads/2015/03/Test-Speed-in-Bytes.png) + +测试bytes的速度 +
+ + +**3. 工具提供一个链接来下载由你的宽带测试结果生成的图片,你可以分享给你的家人朋友。** + +
+![Share Internet Speed Results](http://www.tecmint.com/wp-content/uploads/2015/03/Share-Internet-Speed-Results.png) + +分享测速结果 +
+ + +下面的图片就是你通过以上的命令行测速而生成的图片 + +
+![Speed Test Results](http://www.tecmint.com/wp-content/uploads/2015/03/Speed-Test-Results.png) + +测速结果 +
+ +**4.如果你仅仅需要Ping,上传,下载的结果,就运行以下命令:** + + $ speedtest_cli.py --simple + +
+![Test Ping Download Upload Speed](http://www.tecmint.com/wp-content/uploads/2015/03/Test-Ping-Download-Upload-Speed1.png) + +测试Ping,上传,下载的速度 +
+ + + + + +**5. 列出`speedtest.net`所有的服务器距离你的物理距离,单位是千米(km)** + + + $ speedtest_cli.py --list + +
+![Check Speedtest.net Servers](http://www.tecmint.com/wp-content/uploads/2015/03/Check-Speedtest-Servers.png) + +列出Speedtest.net的服务器 +
+ + +**6. 当获得一个非常长的服务器列表之后,怎么列出我想要的某个服务器?如果我要在speedtest.net服务器列表中找出位于Mumbai(印度)的服务器呢?** + + $ speedtest_cli.py --list | grep -i Mumbai + +
+![Check Nearest Server](http://www.tecmint.com/wp-content/uploads/2015/03/Check-Nearest-Server.png) + +列出最近的服务器 +
+ + +**7. 对指定的服务器进行测速。我们使用上面例子5和例子6中获取的服务器ID:** + + $ speedtest_cli.py --server [server ID] + $ speedtest_cli.py --server [5060] ## Here server ID 5060 is used in the example. + $ speedtest_cli.py --server [5060] ## 这里使用服务器ID为5060作为例子 + +
+![Test Connection Against Server](http://www.tecmint.com/wp-content/uploads/2015/03/Test-Connection-Against-Server.png) + +对指定的服务器进行测速 +
+ + +**8. 输出`speedtest-cli`的版本信息和帮助文档** + + $ speedtest_cli.py --version + +
+![Check SpeedCli Version](http://www.tecmint.com/wp-content/uploads/2015/03/Check-SpeedCLi-Version.png) + +输出版本号 +
+ + $ speedtest_cli.py --help +
+![SpeedCli Help](http://www.tecmint.com/wp-content/uploads/2015/03/SpeedCli-Help.png) + +输出帮助文档 +
+ + +**提醒:**报告中的延迟并不是确切的结果,不应该过于依赖它;这个数值可以当作相对延迟,这对你选择某一测试服务器来说是可靠的。同时,CPU和内存的容量会影响结果的准确度。 + + +### 结论 ### + + +系统管理员和开发者应该必备这个简单的脚本工具,这个工具轻量级,功能齐全,真是太赞了。我不喜欢Speedtest.net的原因是它使用来flash,相反speedtest-cli刚好戳中了我的痛点。 + + +speedtest_cli是一个第三方工具,也不能自动地记录下宽带速度。Speedtest.net拥有上百万的用户,你可以自己[配制一个小型的测速服务器][1]。 + + +上面就是所有内容,更多内容敬请关注Tecmint。如果你有任何反馈记得在文章下方评论,如果你喜欢别忘了给我们点歌赞,分享我们的文章。 + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/check-internet-speed-from-command-line-in-linux/ + +作者:[Avishek Kumar][a] +译者:[NearTan](https://github.com/NearTan) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/avishek/ +[1]:http://www.tecmint.com/speedtest-mini-server-to-test-bandwidth-speed/ From 14396245902d47487a9a9cc1ae020237156a32b7 Mon Sep 17 00:00:00 2001 From: wxy Date: Sat, 13 Jun 2015 08:56:28 +0800 Subject: [PATCH 359/965] PUB:20150520 How to Use tmpfs on RHEL or CentOS 7.0 @geekpi --- ... How to Use tmpfs on RHEL or CentOS 7.0.md | 64 +++++++++++++++++++ ... How to Use tmpfs on RHEL or CentOS 7.0.md | 64 ------------------- 2 files changed, 64 insertions(+), 64 deletions(-) create mode 100644 published/20150520 How to Use tmpfs on RHEL or CentOS 7.0.md delete mode 100644 translated/tech/20150520 How to Use tmpfs on RHEL or CentOS 7.0.md diff --git a/published/20150520 How to Use tmpfs on RHEL or CentOS 7.0.md b/published/20150520 How to Use tmpfs on RHEL or CentOS 7.0.md new file mode 100644 index 0000000000..8d376b8b72 --- /dev/null +++ b/published/20150520 How to Use tmpfs on RHEL or CentOS 7.0.md @@ -0,0 +1,64 @@ +如何在RHEL/CentOS 7.0中使用tmpfs +================================================================================ +今天我们来谈谈 Centos 7 中的一个文件系统tmpfs,这是一个将所有文件和文件夹写到虚拟内存中而不是实际写到磁盘中的虚拟文件系统。这意味中tmpfs中所有的内容都是临时的,在tmpfs卸载、系统重启或者电源切断后内容都将会丢失。技术的角度上来说,tmpfs将所有的内容放在内核内部缓存中并且会调整大小来容纳文件,并可从交换空间中交换出不需要的页。 + +CentOS默认使用tmpfs做的几种用途可用df -h命令的输出来看: + + # df –h + +![df](http://blog.linoxide.com/wp-content/uploads/2015/05/tmpfs1.jpg) + +- /dev - 含有针对所有设备的设备文件的目录 +- /dev/shm - 包含共享内存分配 +- /run - 用于系统日志 +- /sys/fs/cgroup - 用于cgrpups, 一个针对特定进程限制、管制和审计资源利用的内核特性 + +显然,它也可以用作/tmp目录, 你可以用下面的两种方法来做到: + +### 使用systemctl来在/tmp中启用tmpfs ### + +你可以使用systemctl命令在tmp目录启用tmpfs, 首先用下面的命令来检查这个特性是否可用: + + # systemctl is-enabled tmp.mount + +这会显示当先的状态,(如果未启用,)你可以使用下面的命令来启用它: + + # systemctl enable tmp.mount + +![systemctl](http://blog.linoxide.com/wp-content/uploads/2015/05/tmpfs3.jpg) + +这会让系统控制/tmp目录并在该目录下挂载一个tmpfs文件系统。 + +### 手动挂载/tmp文件系统 ### + +你可以在/etc/fstab中添加下面这行,来手工在/tmp下挂载 tmpfs。 + + tmpfs /tmp tmpfs size=512m 0 0 + +接着运行这条命令 + + # mount –a + +![df](http://blog.linoxide.com/wp-content/uploads/2015/05/tmpfs2.jpg) + +这应该就会在df -h中显示tmpfs了,同样也会在你下次重启时自动挂载。 + +### 立即创建tmpfs ### + +如果由于一些原因,你需要在一个文件夹下立即创建tmpfs,你可以使用下面的命令: + + # mount -t tmpfs -o size=1G tmpfs /mnt/mytmpfs + +当然你可以在size选项中指定你希望的大小和希望的挂载点,只要记住是有效的目录就行了。 + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/file-system/use-tmpfs-rhel-centos-7-0/ + +作者:[Adrian Dinu][a] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://linoxide.com/author/adriand/ diff --git a/translated/tech/20150520 How to Use tmpfs on RHEL or CentOS 7.0.md b/translated/tech/20150520 How to Use tmpfs on RHEL or CentOS 7.0.md deleted file mode 100644 index 7f3e37b3fe..0000000000 --- a/translated/tech/20150520 How to Use tmpfs on RHEL or CentOS 7.0.md +++ /dev/null @@ -1,64 +0,0 @@ -如何在RHEL/CentOS 7.0中使用tmpfs -================================================================================ - 7中的tmpfs,这是一个将所有文件和文件夹写到虚拟内存中而不是实际写到磁盘中的虚拟文件系统。这意味中tmpfs中所有的内容都是临时的,在取消挂载、系统重启或者电源切断后内容都将会丢失。技术的角度上来说,tmpfs将搜有的内容放在内核内部缓存中并且会增大或者缩小来容纳文件并可从交换空间中交换处不需要的页。 - -CentOS默认使用tmpfs做的事可用df -h命令的输出来看: - - # df –h - -![df](http://blog.linoxide.com/wp-content/uploads/2015/05/tmpfs1.jpg) - -/dev - 含有针对所有设备的设备文件的目录 -/dev/shm – 包含共享内存分配 -/run - 用于系统日志 -/sys/fs/cgroup - 用于cgrpups, 一个针对特定进程限制、管制和审计资源利用的内核特性 - -/tmp目录, 你可以用下面的两种方法来做到: - -### 使用systemctl来在/tmp中启用tmpfs ### - -你可以使用systemctl命令在tmp目录启用tmpfs, 首先用下面的命令来检查这个特性是否可用: - - # systemctl is-enabled tmp.mount - -这会显示当先的状态,你可以使用下面的命令来启用它: - - # systemctl enable tmp.mount - -![systemctl](http://blog.linoxide.com/wp-content/uploads/2015/05/tmpfs3.jpg) - -这会控制/tmp目录并挂载tmpfs。 - -### 手动挂载/tmp/文件系统 ### - -你可以在/etc/fstab中添加下面这行在/tmp挂载tmpfs。 - - tmpfs /tmp tmpfs size=512m 0 0 - -接着运行这条命令 - - # mount –a - -![df](http://blog.linoxide.com/wp-content/uploads/2015/05/tmpfs2.jpg) - -这应该就会在df -h中显示tmpfs了,同样也会在你下次重启是会自动挂载。 - -### 立即创建tmpfs ### - -如果由于一些原因,你写昂立即创建tmpfs,你可以使用下面的命令: - - # mount -t tmpfs -o size=1G tmpfs /mnt/mytmpfs - -当然你可以在size选项中指定你希望的大小和希望的挂载点,只要记住是有效的目录就行了。 - --------------------------------------------------------------------------------- - -via: http://linoxide.com/file-system/use-tmpfs-rhel-centos-7-0/ - -作者:[Adrian Dinu][a] -译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://linoxide.com/author/adriand/ From 0d3a67a4e52ae4ab9ae0e8e588b98da3e08171b7 Mon Sep 17 00:00:00 2001 From: KayGuoWhu Date: Sat, 13 Jun 2015 13:26:38 +0800 Subject: [PATCH 360/965] translated --- ...0150610 How to secure your Linux server.md | 234 ----------------- ...0150610 How to secure your Linux server.md | 236 ++++++++++++++++++ 2 files changed, 236 insertions(+), 234 deletions(-) delete mode 100644 sources/tech/20150610 How to secure your Linux server.md create mode 100644 translated/tech/20150610 How to secure your Linux server.md diff --git a/sources/tech/20150610 How to secure your Linux server.md b/sources/tech/20150610 How to secure your Linux server.md deleted file mode 100644 index 51246cbfcb..0000000000 --- a/sources/tech/20150610 How to secure your Linux server.md +++ /dev/null @@ -1,234 +0,0 @@ -[translating by KayGuoWhu] -How to secure your Linux server -================================================================================ -> A server is made up of so many different components that makes it hard to offer one solution for everyone's needs. This articles tries to cover some useful tips and tricks to help you keep your server and users protected. - -No doubt improving server security is one of the most important things system administrators should always look for. This of course has been a topic of many different articles, blogs and forum threads. - -A server is made up of so many different components that makes it hard to offer one solution for everyone’s needs. This articles tries to cover some useful tips and tricks to help you keep your server and users protected. - -There are a few things that every system administrator should know and there is no way to talk about security without mentioning: - -- Keep your system **up to date** -- Change passwords frequently – use numeric, alphabetical and non-alphabetical symbols -- Give users the **minimum** permissions they need to do their job. -- Install only packages that you really need - -Here comes the more interesting part: - -### Change default SSH port ### - -The first thing that I would like to change when setting up a new server is the default SSH port. This simple change can save your server from thousands of brute force attempts. - -To change the default SSH port, open your sshd_config: - - sudo vim /etc/ssh/sshd_config - -Find the following line: - - #Port 22 - -The “#” symbol means that this line is a comment. Remove the # symbol then change the port to a number of your choice. The port number should not be larger than 65535. Make sure not to use any port already used by your system or other services. You can see a list of commonly used ports in [Wikipedia][1]. For the purpose of this article I will use: - - Port 16543 - -Now save the file and close it for a moment. - -Next important step is to: - -### Use SSH Keys ### - -It is extremely important to use SSH keys when accessing the server over SSH. This adds additional protection and ensure that only people who have the key can access the server. - -To generate SSH key on your local computer run: - - ssh-keygen -t rsa - -You will receive an output asking you to setup the file name where the key should be written as well as setup a password: - - Generating public/private rsa key pair. - Enter file in which to save the key (/root/.ssh/id_rsa): my_key - Enter passphrase (empty for no passphrase): - Enter same passphrase again: - Your identification has been saved in my_key. - Your public key has been saved in my_key.pub. - The key fingerprint is: - SHA256:MqD/pzzTRsCjZb6mpfjyrr5v1pJLBcgprR5tjNoI20A - -When compete, you will have two files: - -my_key - -my_key.pub - -Now copy the my_key.pub to ~/.ssh/authorized_keys - - cp my_key.pub ~/.ssh/authorized_keys - -Now upload your key on the server by using: - - scp -P16543 authorized_keys user@yourserver-ip:/home/user/.ssh/ - -Now you can access the server from the same local machine without having to enter any password. - -### Disable password authentication for SSH ### - -Now that we have SSH keys, it is safe to disable the password authentication for SSH. Open again the sshd_config file and set the following changes: - - ChallengeResponseAuthentication no - PasswordAuthentication no - UsePAM no - -### Disable Root login ### - -The next important step is to disable direct access with root user. Instead you should use sudo or su to perform administrative jobs. To do this you will need to add a new user that has root privileges. To do this you will need to edit the sudoers file located in: - - /etc/sudoers/ - -You may edit that file with command such as **visudo**. I would recommend you using this command as it will check the file for any syntax errors prior closing the file. This is useful if you have wrongly edited the file. - -Now to give root privileges to a user. For the purpose of this tutorial I will use user **sysadmin**. Make sure you are using an existing user on your system when you edit your own file. Now find the following line: - - root ALL=(ALL) ALL - -Copy that line and paste it below. In the new line change “root” with “sysadmin”. You should now have these two lines: - - root ALL=(ALL) ALL - sysadmin ALL=(ALL) ALL - -I would like to explain what each of the options in the above line represents: - - (1) root (2)ALL=(3)(ALL) (4)ALL - -(1) User - -(2) Terminal from which user can use sudo - -(3) Which users User may act as - -(4) Which commands he may use - - -You can use this settings to give access to users to some of the system tools. - -At this point it is safe to save your file. - -To disable direct root access over SSH open again the **sshd_config** file and find the following line: - - #PermitRootLogin yes - -and change it to: - - PermitRootLogin no - -Now save the file and restart the sshd daemon so the changes can take effect. Simply run the following command: - - sudo /etc/init.d/sshd restart - -### Setup firewall ### - -A firewall can help you block incoming and outgoing ports as well as block brute force login attempts. I like using SCF (Config Server Firewall) as it a powerful solution that uses iptables, it’s easy to manage and has a web interface for people who don’t like typing too many commands. - -To install CSF access your server and navigate to: - - cd /usr/local/src/ - -Then execute the following commands as root: - - wget https://download.configserver.com/csf.tgz - tar -xzf csf.tgz - csf - sh install.sh - -You will need to wait for the installer to finish its job. We will edit CSF configuration by editing: - - /etc/csf/csf.conf - -By default CSF will be started in testing mode. You will need to set it to product by changing the “TESTING” value to 0 - - TESTING = "0" - -Next thing you can edit are the allowed ports on your server. For that purpose find the following section of the csf.conf file and modify the ports per your needs: - - # Allow incoming TCP ports - TCP_IN = "20,21,25,53,80,110,143,443,465,587,993,995,16543" - # Allow outgoing TCP ports - TCP_OUT = "20,21,22,25,53,80,110,113,443,587,993,995,16543" - # Allow incoming UDP ports - UDP_IN = "20,21,53" - # Allow outgoing UDP ports - # To allow outgoing traceroute add 33434:33523 to this list - UDP_OUT = "20,21,53,113,123" - -Setup these per your requirements. I would recommend you using only the ports you need and avoiding allowing huge ranges of ports. Additionally you can avoid using the unsecured services unsecured ports. For example instead of allowing the default SMTP port 25 you can only allow ports 465 and 587 for outgoing emails. - -**IMPORTANT**: Do not forget to allow your customized SSH port. - -It is important to allow your IP address so it will never get blocked. Such IP addresses can be defined in: - - /etc/csf/csf.ignore - -The blocked IP address will appear in: - - /etc/csf/csf.deny - -When you have finished making changes – restart csf with: - - sudo /etc/init.d/csf restart - -Just to show you how useful CSF is I will show you part of csf.deny on one of my servers: - - 211.216.48.205 # lfd: (sshd) Failed SSH login from 211.216.48.205 (KR/Korea, Republic of/-): 5 in the last 3600 secs - Fri Mar 6 00:30:35 2015 - 103.41.124.53 # lfd: (sshd) Failed SSH login from 103.41.124.53 (HK/Hong Kong/-): 5 in the last 3600 secs - Fri Mar 6 01:06:46 2015 - 103.41.124.42 # lfd: (sshd) Failed SSH login from 103.41.124.42 (HK/Hong Kong/-): 5 in the last 3600 secs - Fri Mar 6 01:59:04 2015 - 103.41.124.26 # lfd: (sshd) Failed SSH login from 103.41.124.26 (HK/Hong Kong/-): 5 in the last 3600 secs - Fri Mar 6 02:48:26 2015 - 109.169.74.58 # lfd: (sshd) Failed SSH login from 109.169.74.58 (GB/United Kingdom/mail2.algeos.com): 5 in the last 3600 secs - Fri Mar 6 03:49:03 2015 - -The IP addresses that performed the brute force login attempt got blocked and they will not bother me again. - -#### Lock accounts #### - -In case an account is not going to be used for a long period of time you can lock it in order to prevent access to it. You can do this with: - - passwd -l accountName - -Account can still be used by the root user. - -### Know your services ### - -The whole idea of a server is to provide access to different services. Limit those to only the ones you need and disable the unused ones. This will not only free some resources, but will make your server a little bit more secured. For example if you are running a headless server you will definitely not need X display or a desktop environment. If there are no Windows network shares, you can safely disable Samba. - -You can use the commands below to see which services are started upon system boot: - - chkconfig --list | grep "3:on" - -If your system runs with **systemd**: - - systemctl list-unit-files --type=service | grep enabled - -To disable a service you can use commands such as: - - chkconfig service off - systemctl disable service - -In the above example change “service” with the name of the actual service you wish to stop. Here is an example: - - chkconfig httpd off - systemctl disable httpd - -### Conclusion ### - -This article was meant to cover some of the general security steps you can take to start securing your server. You can always take additional actions to increase the server protection. Remember that it is your responsibility to keep your server secured and make the wise decision while doing it. Unfortunately there is no easy way to do this and the “perfect” setup requires lots of time and tests until you achieve the desired result. - --------------------------------------------------------------------------------- - -via: http://www.linuxveda.com/2015/06/03/secure-linux-server/ - -作者:[Marin Todorow][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.linuxveda.com/author/marin_todorov/ -[1]:http://en.wikipedia.org/wiki/Port_%28computer_networking%29#Common_port_numbers \ No newline at end of file diff --git a/translated/tech/20150610 How to secure your Linux server.md b/translated/tech/20150610 How to secure your Linux server.md new file mode 100644 index 0000000000..ef34eea398 --- /dev/null +++ b/translated/tech/20150610 How to secure your Linux server.md @@ -0,0 +1,236 @@ +Linux服务器安全攻略 +================================================================================ +> 一台服务器由大量功能各异的部件组成,这一点使得很难根据每个人的需求去提供定制的解决方案。这篇文章尽可能涵盖一些有所裨益的小技巧来帮助管理员保证服务器和用户安全。 + +毋庸置疑,对于系统管理员,提高服务器的安全性是最重要的事情之一。因此,也就有了许多针对这个话题而生的文章、博客和论坛帖子。 + +一台服务器由大量功能各异的部件组成,这一点使得很难根据每个人的需求去提供定制的解决方案。这篇文章尽可能涵盖一些有所裨益的小技巧来帮助管理员保证服务器和用户安全。 + +有一些常识是每个系统管理员都应该烂熟于心的,所以下面的几点在后文将不会提及: + +- 务必保证系统是**最新的** +- 经常更换密码 - 使用数字、阿拉伯字母和非阿拉伯字母的符号组合 +- 给予用户**最小**的权限,满足他们日常使用所需即可 +- 只安装那些真正需要的软件包 + +下面是一些更有意思的内容: + +### 更改SSH默认端口 ### + +在搭建好一台全新的服务器后要做的第一件事情就是更改SSH的默认端口。这个小小单的改动能够使你的服务器避免受到成千上万的暴力攻击(译者注:不更改默认端口相当于黑客们知道你家的门牌号,这样他们只需要一把一把的试钥匙就可能打开你家的锁)。 + +要更改默认的SSH端口,先打开sshd_config文件: + + sudo vim /etc/ssh/sshd_config + +找到下面这行: + + #Port 22 + +“#”号表示这行是注释。首先删除#号,然后把端口号改成目的端口。端口号不能超过65535,确保要指定的端口号没有被系统或其它服务占用。建议在[维基百科]上查看常用端口号列表。在本文中,使用这个端口号: + + Port 16543 + +然后保存并关闭文件,等待更改生效。 + +接下来的一步是: + +### 使用SSH密钥 ###、 + +在通过SSH访问服务器时,使用SSH密钥进行认证是尤其重要的。这样做为服务器增加了额外的保护,确保只有那些拥有密钥的人才能访问服务器。 + +在本地机器上运行下面命令以生成SSH密钥: + + ssh-keygen -t rsa + +你会看到下面的输出,询问要将密钥写到哪一个文件,并且设置一个密码: + + Generating public/private rsa key pair. + Enter file in which to save the key (/root/.ssh/id_rsa): my_key + Enter passphrase (empty for no passphrase): + Enter same passphrase again: + Your identification has been saved in my_key. + Your public key has been saved in my_key.pub. + The key fingerprint is: + SHA256:MqD/pzzTRsCjZb6mpfjyrr5v1pJLBcgprR5tjNoI20A + +完成之后,就得到两个文件: + +my_key + +my_key.pub + +接下来把my_key.pub拷贝到~/.ssh/authorized_key中 + + cp my_key.pub ~/.ssh/authorized_keys + +然后使用下面命令将密钥上传到服务器: + + scp -P16543 authorized_keys user@yourserver-ip:/home/user/.ssh/ + +至此,你就可以从这台本地机器上无密码地访问服务器了。 + +### 关闭SSH的密码认证 ### + +既然已经有了SSH密钥,那么关闭SSH的密码认证就很安全了。再次打开并编辑sshd_config,按如下设置: + + ChallengeResponseAuthentication no + PasswordAuthentication no + UsePAM no + +### 关闭Root登录 ### + +下面关键的一步是关闭root用户的直接访问,而使用sudo或su来执行管理员任务。首先需要添加一个有root权限的新用户,所以编辑这个路径下的sudoers文件: + + /etc/sudoers/ + +可以使用如**visudo**这样的命令编辑文件,推荐使用这个命令,因为它会在关闭文件之前检查任何可能出现的语法错误。当你在编辑文件时出错了,这就很有用了。 + +接下来赋予某个用户root权限。在本文中,使用用户**sysadmin**。确保在编辑后这个文件时使用的用户是系统已有的用户。找到下面这行: + + root ALL=(ALL) ALL + +拷贝这行,然后粘贴在下一行,然后把root更改为“sysadmin”,如下所示: + + root ALL=(ALL) ALL + sysadmin ALL=(ALL) ALL + +现在解释一下这行的每一个选项的含义: + + (1) root (2)ALL=(3)(ALL) (4)ALL + +(1) 指定用户 + +(2) 指定用户使用sudo的终端 + +(3) 指定用户可以担任的用户角色 + +(4) 这个用户可以使用的命令 + +使用这个配置可以给用户访问一些系统工具的权限。 + +这时,可以放心保存文件了。 + +为了关闭通过SSH直接访问root,需要再次打开**sshd_config**,找到下面这行: + + #PermitRootLogin yes + +更改为: + + PermitRootLogin no + +然后保存文件,重启sshd守护进程使改动生效。执行下面命令即可: + + sudo /etc/init.d/sshd restart + +### 设置防火墙 ### + +防火墙有助于过滤出入端口和阻止使用暴力法的登录尝试。我倾向于使用SCF(Config Server Firewall)这个强力防火墙。它使用了iptables,易于管理,而且对于不擅于输入命令的用户提供了web界面。 + +要安装CSF,先登录到服务器,切换到这个目录下: + + cd /usr/local/src/ + +然后以root权限执行下面命令: + + wget https://download.configserver.com/csf.tgz + tar -xzf csf.tgz + csf + sh install.sh + +只需等待安装程序完成,然后编辑CSF的配置文件: + + /etc/csf/csf.conf + +默认情况下CSF是以测试模式运行。通过将“TESTING”的值设置成0,切换到product模式。 + + TESTING = "0" + +下面要设置的就是服务器上允许通过的端口。在csf.conf中定位到下面的部分,根据需要修改端口: + + # Allow incoming TCP ports + TCP_IN = "20,21,25,53,80,110,143,443,465,587,993,995,16543" + # Allow outgoing TCP ports + TCP_OUT = "20,21,22,25,53,80,110,113,443,587,993,995,16543" + # Allow incoming UDP ports + UDP_IN = "20,21,53" + # Allow outgoing UDP ports + # To allow outgoing traceroute add 33434:33523 to this list + UDP_OUT = "20,21,53,113,123" + +请根据需要逐一设置,推荐只使用那些需要的端口,避免设置对端口进行大范围设置。此外,也要避免使用不安全服务的不安全端口。比如只允许端口465和587来发送电子邮件,取代默认的SMTP端口25. + +**重要**:千万不要忘记允许自定义SHH端口。 + +允许防火墙通过你的IP地址使其不被屏蔽,这一点很重要。IP地址定义在下面的文件中: + + /etc/csf/csf.ignore + +被屏蔽的IP地址会出现在这个文件中: + + /etc/csf/csf.deny + +一旦完成更改,使用这个命令重启csf: + + sudo /etc/init.d/csf restart + +下面是在某台服务器上的csf.deny文件的部分内容,来说明CSF是很有用的: + + 211.216.48.205 # lfd: (sshd) Failed SSH login from 211.216.48.205 (KR/Korea, Republic of/-): 5 in the last 3600 secs - Fri Mar 6 00:30:35 2015 + 103.41.124.53 # lfd: (sshd) Failed SSH login from 103.41.124.53 (HK/Hong Kong/-): 5 in the last 3600 secs - Fri Mar 6 01:06:46 2015 + 103.41.124.42 # lfd: (sshd) Failed SSH login from 103.41.124.42 (HK/Hong Kong/-): 5 in the last 3600 secs - Fri Mar 6 01:59:04 2015 + 103.41.124.26 # lfd: (sshd) Failed SSH login from 103.41.124.26 (HK/Hong Kong/-): 5 in the last 3600 secs - Fri Mar 6 02:48:26 2015 + 109.169.74.58 # lfd: (sshd) Failed SSH login from 109.169.74.58 (GB/United Kingdom/mail2.algeos.com): 5 in the last 3600 secs - Fri Mar 6 03:49:03 2015 + +可以看到,尝试通过暴力法登录的IP地址都被屏蔽了,真是眼不见心不烦啊! + +#### 锁住账户 #### + +如果某个账户在很长一段时间内都不会被使用了,那么可以将其锁住以防止其它人访问。使用如下命令: + + passwd -l accountName + +当然,这个账户依然可以被root用户使用。 + +### 了解服务器上的服务 ### + +服务器的本质是为各种服务提供访问功能。使服务器只运行所需的服务,关闭没有使用的服务。这样做不仅会释放一些系统资源,而且也会使服务器变得更加安全。比如,如果只是运行一个简单的服务器,显然不需要X显示或者桌面环境。如果不需要Windows网络共享功能,则可以放心关闭Samba。 + +使用下面的命令能查看伴随系统启动而启动的服务: + + chkconfig --list | grep "3:on" + +如果系统运行了**systemd**,执行这条命令: + + systemctl list-unit-files --type=service | grep enabled + +然后使用下面的命令关闭服务: + + chkconfig service off + systemctl disable service + +在上面的例子中,把“service”替换成真正想要停止的服务名称。实例如下: + + chkconfig httpd off + systemctl disable httpd + +### 小结 ### + +这篇文章的目的是涵盖一些通用的安全步骤以便帮助你保护服务器。你可以采取额外的方式去增强对服务器的保护。请记住保证服务器安全是你的责任,在维护服务器安全时尽量做出明智的选择,尽管并没有什么容易的方式去完成这件事情,而建立“完善的”安全需要花费大量的时间和测试直到达到想要的结果。 + +-------------------------------------------------------------------------------- + +via: http://www.linuxveda.com/2015/06/03/secure-linux-server/ + +作者:[Marin Todorow][a] +译者:[KayGuoWhu](https://github.com/KayGuoWhu) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.linuxveda.com/author/marin_todorov/ +[1]:http://en.wikipedia.org/wiki/Port_%28computer_networking%29#Common_port_numbers + + + + From 24068760b9a53ebeed8d27007a690b3abe71e962 Mon Sep 17 00:00:00 2001 From: geekpi Date: Sat, 13 Jun 2015 14:20:30 +0800 Subject: [PATCH 361/965] translating --- ... watch--Repeat Linux or Unix Commands Regular Intervals.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150610 watch--Repeat Linux or Unix Commands Regular Intervals.md b/sources/tech/20150610 watch--Repeat Linux or Unix Commands Regular Intervals.md index 65d844a296..9da85b9fb8 100644 --- a/sources/tech/20150610 watch--Repeat Linux or Unix Commands Regular Intervals.md +++ b/sources/tech/20150610 watch--Repeat Linux or Unix Commands Regular Intervals.md @@ -1,3 +1,5 @@ +translating---geekpi + watch - Repeat Linux / Unix Commands Regular Intervals ================================================================================ A server administrator needs to maintain the system and keep it updated and safe. A number of intrusion attempts may happen every day. There are some other activities that maintain their log. These logs are updated regularly. In order to check these updates, the commands are executed repeatedly. For example, for simply reading a file, commands like head, tail, cat etc are used. These commands need to be executed repeatedly. The watch command can be used to repeat a command at regular intervals. @@ -130,4 +132,4 @@ via: http://linoxide.com/linux-command/linux-watch-command/ 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 -[a]:http://linoxide.com/author/arunrz/ \ No newline at end of file +[a]:http://linoxide.com/author/arunrz/ From ced362889f0353fdf5b551770f1354aa03e1a1fc Mon Sep 17 00:00:00 2001 From: geekpi Date: Sat, 13 Jun 2015 15:08:41 +0800 Subject: [PATCH 362/965] translated --- ...inux or Unix Commands Regular Intervals.md | 135 ------------------ ...inux or Unix Commands Regular Intervals.md | 133 +++++++++++++++++ 2 files changed, 133 insertions(+), 135 deletions(-) delete mode 100644 sources/tech/20150610 watch--Repeat Linux or Unix Commands Regular Intervals.md create mode 100644 translated/tech/20150610 watch--Repeat Linux or Unix Commands Regular Intervals.md diff --git a/sources/tech/20150610 watch--Repeat Linux or Unix Commands Regular Intervals.md b/sources/tech/20150610 watch--Repeat Linux or Unix Commands Regular Intervals.md deleted file mode 100644 index 9da85b9fb8..0000000000 --- a/sources/tech/20150610 watch--Repeat Linux or Unix Commands Regular Intervals.md +++ /dev/null @@ -1,135 +0,0 @@ -translating---geekpi - -watch - Repeat Linux / Unix Commands Regular Intervals -================================================================================ -A server administrator needs to maintain the system and keep it updated and safe. A number of intrusion attempts may happen every day. There are some other activities that maintain their log. These logs are updated regularly. In order to check these updates, the commands are executed repeatedly. For example, for simply reading a file, commands like head, tail, cat etc are used. These commands need to be executed repeatedly. The watch command can be used to repeat a command at regular intervals. - -### Watch Command ### - -Watch is a simple command, with a few options. The basic syntax of watch command is: - - watch [-dhvt] [-n ] [--differences[=cumulative]] [--help] [--interval=] [--no-title] [--version] - -Watch command runs the command specified to it after every 2 seconds by default. This time is counted between the completion of command and beginning of next execution. As a simple example, watch command can be used to watch the log updates, The updates are appended at the end of the file, so tail command can be used with watch to see the updates to the file. This command continues to run until you hit CTRL + C to return to the prompt. - -### Examples ### - -> Keep an eye on errors/notices/warning being generated at run time every couple of seconds. - - watch tail /var/log/messages - -![tail messages](http://blog.linoxide.com/wp-content/uploads/2015/06/1.png) - -> Keep an eye on disk usage after specified time interval. - - watch df -h - -![df -h](http://blog.linoxide.com/wp-content/uploads/2015/06/2.png) - -> It is very important for administrators to keep an eye on high I/O wait causing disk operations especially the Mysql transactions. - - watch mysqladmin processlist - -![processlist](http://blog.linoxide.com/wp-content/uploads/2015/06/3.png) - -> Keep an eye on server load and uptime at runtime. - - watch uptime - -![uptime](http://blog.linoxide.com/wp-content/uploads/2015/06/10.png) - -> Keep an eye on queue size for Exim at the time a cron is run to send notices to subscribers. - - watch exim -bpc - -![exim -bpc](http://blog.linoxide.com/wp-content/uploads/2015/06/9.png) - -### 1) Iteration delay ### - - watch [-n ] - -The default interval between the commands can be changed with -n switch. The following command will run the tail command after 5 seconds: - - watch -n 5 date - -![date 5 seconds](http://blog.linoxide.com/wp-content/uploads/2015/06/4b.png) - -### 2) Successive output comparison ### - -If you use -d option with watch command, it will highlight the differences between the first command output to every next command output cumulatively. - - watch [-d or --differences[=cumulative]] - -#### Example1 #### - -Let’s see the successive time outputs extracted using following watch command and observe how the difference is highlighted. - - watch -n 15 -d date - -First time date is capture when command is executed, the next iteration will be repeated after 15 seconds. - -![Difference A](http://blog.linoxide.com/wp-content/uploads/2015/06/6.png) - -Upon the execution of next iteration, it can be seen that all output is exactly same except the seconds have increased from 14 to 29 which is highlighted. - -![Difference A](http://blog.linoxide.com/wp-content/uploads/2015/06/6b.png) - -#### Example 2 #### - -Let’s experience in difference between two successive outputs of “uptime” command repeated by watch. - - watch -n 20 -d uptime - -![uptime](http://blog.linoxide.com/wp-content/uploads/2015/06/10.png) - -Now the difference between the time is highlighted as well as the three load snapshots as well. - -![10b](http://blog.linoxide.com/wp-content/uploads/2015/06/10b.png) - -### 3) Output without title ### - -If you don’t want to display extra details about the iteration delay and actual command run by watch then –t switch can be used. - - watch [-t or --no-title] - -Let’s see the output of following command as an example. - - watch -t date - -![watch without title](http://blog.linoxide.com/wp-content/uploads/2015/06/7t.png) - -### Watch help ### - -Brief details of the watch command can be found by typing the following command in SSH. - - watch -h [or --help] - -![watch help](http://blog.linoxide.com/wp-content/uploads/2015/06/8h.png) - -### Watch version ### - -Run the following command in SSH terminal to check the version of watch. - - watch -v [--version] - -![version](http://blog.linoxide.com/wp-content/uploads/2015/06/11.png) - -**BUGS** - -Unfortunately, upon terminal resize, the screen will not be correctly repainted until the next scheduled update. All --differences highlight-ing is lost on that update as well. - -### Summary ### - -Watch is a very powerful utility for system administrators because it can be used to monitor, logs, operations, performance and throughput of the system at run time. One can easily format and delay the output of watch utility. Any Linux command / utility or script and be supplied to watch for desired and continuous output. - --------------------------------------------------------------------------------- - -via: http://linoxide.com/linux-command/linux-watch-command/ - -作者:[Aun Raza][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://linoxide.com/author/arunrz/ diff --git a/translated/tech/20150610 watch--Repeat Linux or Unix Commands Regular Intervals.md b/translated/tech/20150610 watch--Repeat Linux or Unix Commands Regular Intervals.md new file mode 100644 index 0000000000..f5e395c278 --- /dev/null +++ b/translated/tech/20150610 watch--Repeat Linux or Unix Commands Regular Intervals.md @@ -0,0 +1,133 @@ +watch - 定期重复Linux / Unix命令 +================================================================================ +服务器管理员需要维护系统并保持更新和安全。每天需要尝试大量的指令。一些其他的活动存储在日志中。这些日志定期地更新。为了检车这些更新,需要重复地执行命令。比如,为了读取一个文件需要使用head、tail、cat等命令。这些命令需要重读地执行。watch命令可以用于定期地执行一个命令。 + +### Watch 命令 ### + +watch是一个简单的命令,只有几个选项。watch命令的基本语法是: + + watch [-dhvt] [-n ] [--differences[=cumulative]] [--help] [--interval=] [--no-title] [--version] + +watch命令默认每隔2秒执行后面的命令。这个时间根据的是命令执行结束到上次执行的间隔来算的。比如,watch命令可以用于监测日志更新,更新时在文件的后面追加新行,因此tail命令可以用来检测文件的更新。这个命令会持续地运行直到你按下 CTRL + C回到提示符。 + +### 例子 ### + +> 每两秒监测 errors/notices/warning 生成的情况。 + + watch tail /var/log/messages + +![tail messages](http://blog.linoxide.com/wp-content/uploads/2015/06/1.png) + +> 用指定的时间监测磁盘的使用率。 + + watch df -h + +![df -h](http://blog.linoxide.com/wp-content/uploads/2015/06/2.png) + +> 对磁盘管理员而言关注高I/O等待导致的磁盘操作尤其是mysql事务是很重要的。 + + watch mysqladmin processlist + +![processlist](http://blog.linoxide.com/wp-content/uploads/2015/06/3.png) + +> 监测服务器负载和运行时间。 + + watch uptime + +![uptime](http://blog.linoxide.com/wp-content/uploads/2015/06/10.png) + +> 检测exim排队给用户发送通知队列的大小。 + + watch exim -bpc + +![exim -bpc](http://blog.linoxide.com/wp-content/uploads/2015/06/9.png) + +### 1) 掩饰循环 ### + + watch [-n ] + +命令默认运行的间隔用-n改变,下面的命令会在5秒后运行后面的命令: + + watch -n 5 date + +![date 5 seconds](http://blog.linoxide.com/wp-content/uploads/2015/06/4b.png) + +### 2) 连续输出比较### + +如果你使用-d选项,它会累次地高亮第一次和下一次命令之间输出的差别。 + + watch [-d or --differences[=cumulative]] + +#### 例子 1 #### + +用下面的命令连续地输出时间病观察高亮出来的不同部分。 + + watch -n 15 -d date + +第一次执行date的输出会被捕捉,15后会会重复运行命令。 + +![Difference A](http://blog.linoxide.com/wp-content/uploads/2015/06/6.png) + +在下一次执行时,可以看到输出除了被高亮的秒数从14到29之外其他的都一样。 + +![Difference A](http://blog.linoxide.com/wp-content/uploads/2015/06/6b.png) + +#### 例子 2 #### + +让我们来体验一下两个连续的“uptime”命令输出的不同。 + + watch -n 20 -d uptime + +![uptime](http://blog.linoxide.com/wp-content/uploads/2015/06/10.png) + +现在列出了时间和3个负载快照之间的不同。 + +![10b](http://blog.linoxide.com/wp-content/uploads/2015/06/10b.png) + +### 3) 不带标题输出 ### + +如果你不希望显示更多关于延迟和实际命令的信息可以使用-t选项。 + + watch [-t or --no-title] + +让我们看下下面例子命令的输出: + + watch -t date + +![watch without title](http://blog.linoxide.com/wp-content/uploads/2015/06/7t.png) + +### Watch 帮助 ### + +可以在ssh中输入下面的命令来得到watch的简要帮助。 + + watch -h [or --help] + +![watch help](http://blog.linoxide.com/wp-content/uploads/2015/06/8h.png) + +### Watch 版本 ### + +在ssh终端中运行下面的命令来检查watch的版本。 + + watch -v [--version] + +![version](http://blog.linoxide.com/wp-content/uploads/2015/06/11.png) + +**问题** + +不幸的是,在终端大小调整时,屏幕不能在下次运行前重画。所有用--difference高亮的内容也会在更新时丢失。 + +### 总结 ### + +watch对系统管理员而言是一个非常强大的工具因为它可以用于监控、日志、运维、性能和系统运行时的吞吐量。人们可以非常简单地格式化和推延watch的输出。任何Linux命令/程序或脚本可以按照所需监测和连续输出。 + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/linux-command/linux-watch-command/ + +作者:[Aun Raza][a] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://linoxide.com/author/arunrz/ From dc5ff01228270adb77451b652b8fe78ce9d44794 Mon Sep 17 00:00:00 2001 From: strugglingyouth <630441839@qq.occom> Date: Sat, 13 Jun 2015 02:18:02 -0700 Subject: [PATCH 363/965] translation by strugglingyouth --- ...to Clear RAM Memory Cache Buffer and Swap Space on Linux.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150610 How to Clear RAM Memory Cache Buffer and Swap Space on Linux.md b/sources/tech/20150610 How to Clear RAM Memory Cache Buffer and Swap Space on Linux.md index e668e5d9ec..9a001f45b4 100644 --- a/sources/tech/20150610 How to Clear RAM Memory Cache Buffer and Swap Space on Linux.md +++ b/sources/tech/20150610 How to Clear RAM Memory Cache Buffer and Swap Space on Linux.md @@ -1,3 +1,4 @@ +translation by strugglingyouth How to Clear RAM Memory Cache, Buffer and Swap Space on Linux ================================================================================ Like any other operating system, GNU/Linux has implemented a memory management efficiently and even more than that. But if any process is eating away your memory and you want to clear it, Linux provides a way to flush or clear ram cache. @@ -96,4 +97,4 @@ via: http://www.tecmint.com/clear-ram-memory-cache-buffer-and-swap-space-on-linu [a]:http://www.tecmint.com/author/avishek/ [1]:http://www.tecmint.com/echo-command-in-linux/ -[2]:http://www.tecmint.com/11-cron-scheduling-task-examples-in-linux/ \ No newline at end of file +[2]:http://www.tecmint.com/11-cron-scheduling-task-examples-in-linux/ From ad897f5375c5192774e142efb27232515dda32f1 Mon Sep 17 00:00:00 2001 From: wi-cuckoo Date: Sat, 13 Jun 2015 18:14:37 +0800 Subject: [PATCH 364/965] translated wi-cuckoo --- .../20150527 3 Open Source Python Shells.md | 108 +++++++++--------- 1 file changed, 54 insertions(+), 54 deletions(-) diff --git a/sources/share/20150527 3 Open Source Python Shells.md b/sources/share/20150527 3 Open Source Python Shells.md index 65102bd1bc..24b81d697a 100644 --- a/sources/share/20150527 3 Open Source Python Shells.md +++ b/sources/share/20150527 3 Open Source Python Shells.md @@ -1,37 +1,36 @@ -translating wi-cuckoo -3 Open Source Python Shells -================================================================================ -Python is a high-level, general-purpose, structured, powerful, open source programming language that is used for a wide variety of programming tasks. It features a fully dynamic type system and automatic memory management, similar to that of Scheme, Ruby, Perl, and Tcl, avoiding many of the complexities and overheads of compiled languages. The language was created by Guido van Rossum in 1991, and continues to grow in popularity. +3个开源的Python Shell +========================================================================= +Python是一个高级,通用,结构化且强大的开源编程语言,用于广泛的编程工作。它拥有一个完全的动态类型系统和自动内存管理,与Scheme,Ruby,Perl和Tcl的十分相似,避免编译型语言的许多复杂地方和难以理解。Python于1991年由Guido van Rossum创造,然后逐渐成长,流行。 -Python is a very useful and popular computer language. One of the benefits of using an interpreted language such as Python is exploratory programming with its interactive shell. You can try out code without having to write a script. But there are limitations with the Python shell. Fortunately, there are some excellent alternative Python shells that extend on the basic shell. They each offer an excellent interactive Python experience. +Python是一个非常实用,而且流行的计算机编程语言。使用一个如Python这样的解释型语言的好处之一就是,可以借助其交互的shell考察式地编程。你可以试用代码,而不必写一个脚本。但是Python shell也有一些局限性。基本来说,有许多很nice的Python shell可选择,都是在基础shell上扩展的。他们每一个都提供了一个极好的交互性的Python 体验。 ----------- +-------------- ### bpython ### ![](http://www.linuxlinks.com/portal/content/reviews/Programming/Screenshot-bpython.png) -bpython is a fancy interface to the Python interpreter for Linux, BSD, OS X and Windows. +对于Linux,BSD,OS X和Windows来说,bpython是Python解释器一个受欢迎的接口。 -The idea is to provide the user with all the features in-line, much like modern IDEs, but in a simple, lightweight package that can be run in a terminal window. +想法是提供给用户所有的内置功能,很像现在的IDEs(集成开发环境),但是是在一个简单,轻量级的包里,可以在终端窗口里面运行。 -bpython doesn't seek to create anything new or groundbreaking. Instead, it brings together a few neat ideas and focuses on practicality and usefulness. +bpython并不追求创造任何新的或者开创性的东西。相反,她聚集了一些简洁的理念,关注于实用性和操作性。 -Features include: +功能包括: + +- 内置的语法高亮 - 使用Pygments排版你敲出的代码,并合理地上色 +- 根据你的行为,显示自动补全的建议。 +- 为任何Python函数列出期望的参数 - 力求显示一列参数,为你调用的任何函数 +- “Rewind”功能,弹出内存里的最后一行代码并重新评定 +- 发送你已经解除占用的代码到粘贴缓存 +- 保存你已经输入到一个文件里的代码 +- 自动缩进 +- 支持Python 3 -- In-line syntax highlighting - uses Pygments for lexing the code as you type, and colours appropriately -- Readline-like autocomplete with suggestions displayed as you type -- Expected parameter list for any Python function - seeks to display a list of parameters for any function you call -- "Rewind" function to pop the last line of code from memory and re-evaluate -- Send the code you've entered off to a pastebin -- Save the code you've entered to a file -- Auto-indentation -- Python 3 support - -- Website: [www.bpython-interpreter.org][1] -- Developer: Bob Farrell and contributors -- License: MIT License -- Version Number: 0.14.1 +- 网址: [www.bpython-interpreter.org][1] +- 开发者: Bob Farrell and contributors +- 证书: MIT License +- 版本号: 0.14.1 ---------- @@ -39,22 +38,22 @@ Features include: ![](http://www.linuxlinks.com/portal/content/reviews/Programming/Screenshot-ipython.png) -IPython is an enhanced interactive Python shell. It provides a rich toolkit to help you make the most out of using Python interactively. +IPython是Python shell的一个交互加强版。她提供了一个丰富的工具集合,帮助你交互式地充分利用Python。 -IPython can be used as a replacement for the standard Python shell, or it can be used as a complete working environment for scientific computing (like Matlab or Mathematica) when paired with the standard Python scientific and numerical tools. It supports dynamic object introspections, numbered input/output prompts, a macro system, session logging, session restoring, complete system shell access, verbose and colored traceback reports, auto-parentheses, auto-quoting, and is embeddable in other Python programs. +IPython可以用来取代标准的Python shell,或者当与标准Python 科学和数值处理工具配合,用做一个科学计算(如Matlab或者Mathematical)的完整工作环境。她支持动态对象内省,有限的输入/输出提示,一个宏观系统,会话登录,会话恢复,完整的系统接入,详尽且彩色的追踪报告,自动圆括号,自动应用和可嵌入其他Python程序。 -Features include: +功能包括: -- Powerful interactive shells (terminal and Qt-based) -- A browser-based notebook with support for code, rich text, mathematical expressions, inline plots and other rich media -- Support for interactive data visualization and use of GUI toolkits -- Flexible, embeddable interpreters to load into your own projects -- Easy to use, high performance tools for parallel computing +- 强大的交互Shell(终端或者基于Qt) +- 一个基于浏览器的记事本,支持代码,多样文本,数学表达式,内置飞行图表和其他丰富媒介。 +- 支持交互式的数据虚拟化和GUI工具箱使用 +- 灵活,嵌入式的解释器可以加载进你自己的项目里 +- 易于使用,高效的并行运算工具 -- Website: [ipython.org][2] -- Developer: The IPython Development Team -- License: BSD -- Version Number: 3.1 +- 网址: [ipython.org][2] +- 开发者: The IPython Development Team +- 证书: BSD +- 版本号: 3.1 ---------- @@ -62,35 +61,34 @@ Features include: ![](http://www.linuxlinks.com/portal/content/reviews/Programming/Screenshot-DreamPie.png) -DreamPie is a Python shell which is designed to be reliable and fun. +DreamPie是一个为可靠性和兴趣设计的Python shell。 -DreamPie can use just about any Python interpreter (Jython, IronPython, PyPy). +DreamPie可以用于任何Python解释器(Jython,IronPython,PyPy)。 -Features include: +功能包括: -- New concept for an interactive shell: the window is divided into the history box, which lets you view previous commands and their output, and the code box, where you write your code. This allows you to edit any amount of code, just like in your favorite editor, and execute it when it's ready. You can also copy code from anywhere, edit it and run it instantly -- The Copy code only command will copy the code you want to keep, so you can save it in a file. The code is already formatted nicely with a four-space indentation -- Automatic completion of attributes and file names -- Automatically displays function arguments and documentation -- Keeps your recent results in the result history, for later use -- Can automatically fold long outputs, so you can concentrate on what's important -- Save the history of the session as an HTML file, for future reference. You can then load the history file into DreamPie, and quickly redo previous commands -- Automatically adds parentheses and optionally quotes when you press space after functions and methods. For example, type execfile fn and get execfile("fn") -- Supports interactive plotting with matplotlib -- Xupport for Python 2.5, Python 2.6, Python 3.1, Jython 2.5, IronPython 2.6, and PyPy -- Extremely fast and responsive. +- 一个交互shell的新概念:窗口被分成历史区域和代码区域,历史区域可以让你看到之前的命令及其输出,代码区域是里敲代码的地方。这样,你可以编辑任意数量的代码,就好像在你最喜欢的编辑器里一样,并且适当时候可以执行它。你也可以从其他地方复制你想保存的代码,所以你可以把它存入一个文件。代码可以很好地格式化为四级缩进。 +- 自动补全属性和文件名字 +- 自动显示函数参数和文档 +- 在结果历史中保存你最近的结果,备以后用 +- 可以自动展开很长的输出,所以你可以专注于重要的地方 +- 保存会话的历史记录为一个HTML文件,备以后查询。你可以加载历史文件到DreamPie里,并且快速回退到之前的命令。 +- 自动添加圆括号与可选的引用,当你在函数与方法后按下空格键。例如,键入execfile fn并且获得execfile("fn") +- 支持交互的matplotlib绘图 +- 支持Python 2.5,Python 2.6,Python 3.1,Jython 2.5,IronPython 2.6和PyPy +- 难以置信的快速反应 -- Website: [www.dreampie.org][3] -- Developer: Noam Yorav-Raphael -- License: GNU GPL v3 -- Version Number: 1.2.1 +- 网址: [www.dreampie.org][3] +- 开发者: Noam Yorav-Raphael +- 证书: GNU GPL v3 +- 版本号: 1.2.1 -------------------------------------------------------------------------------- via: http://www.linuxlinks.com/article/20150523032756576/PythonShells.html 作者:Frazer Kline -译者:[译者ID](https://github.com/译者ID) +译者:[wi-cuckoo](https://github.com/wi-cuckoo) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -98,3 +96,5 @@ via: http://www.linuxlinks.com/article/20150523032756576/PythonShells.html [1]:http://www.bpython-interpreter.org/ [2]:http://ipython.org/ [3]:http://www.dreampie.org/ + +-------------------------------------------------------------------------------- From c99c9ef0620d7960f5bc3a735e1878ac5f68448b Mon Sep 17 00:00:00 2001 From: wi-cuckoo Date: Sat, 13 Jun 2015 18:15:40 +0800 Subject: [PATCH 365/965] translated wi-cuckoo --- .../share/20150527 3 Open Source Python Shells.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/share/20150527 3 Open Source Python Shells.md (100%) diff --git a/sources/share/20150527 3 Open Source Python Shells.md b/translated/share/20150527 3 Open Source Python Shells.md similarity index 100% rename from sources/share/20150527 3 Open Source Python Shells.md rename to translated/share/20150527 3 Open Source Python Shells.md From 7ef21cc716db43ea6c20e683ef7407f1148c136f Mon Sep 17 00:00:00 2001 From: wi-cuckoo Date: Sat, 13 Jun 2015 20:39:59 +0800 Subject: [PATCH 366/965] translating wi-cuckoo --- ... to Configure Apache Containers with Docker on Fedora 22.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150612 How to Configure Apache Containers with Docker on Fedora 22.md b/sources/tech/20150612 How to Configure Apache Containers with Docker on Fedora 22.md index 493e474c7e..66bd27fbc5 100644 --- a/sources/tech/20150612 How to Configure Apache Containers with Docker on Fedora 22.md +++ b/sources/tech/20150612 How to Configure Apache Containers with Docker on Fedora 22.md @@ -1,3 +1,4 @@ +translating wi-cuckoo How to Configure Apache Containers with Docker on Fedora 22 ================================================================================ In this article we are going to learn about Docker, how to use it to deploy Apache httpd and how can you share it on Docker Hub. First we are going to learn how to pull and use images hosted on Docker Hub, and then install Apache on an image of Fedora 22 interactively, after that we are going to learn how to use a Dockerfile to make an image in a faster and more elegant way, finally we are going to publish the image we've created in Docker Hub, so anyone will be able download and use it later. @@ -279,4 +280,4 @@ via: http://linoxide.com/linux-how-to/configure-apache-containers-docker-fedora- [a]:http://linoxide.com/author/carlosal/ [1]:https://github.com/gaiada/run-apache-foreground [2]:http://localhost/ -[3]:https://hub.docker.com/account/signup/ \ No newline at end of file +[3]:https://hub.docker.com/account/signup/ From 8209aff788f050ba3405e39cc9385e0ae3be91d5 Mon Sep 17 00:00:00 2001 From: wxy Date: Sat, 13 Jun 2015 23:37:05 +0800 Subject: [PATCH 367/965] PUB:20150504 How to Install and Configure 'PowerDNS' (with MariaDB) and 'PowerAdmin' in RHEL or CentOS 7 @GOLinux --- ...B) and 'PowerAdmin' in RHEL or CentOS 7.md | 210 ++++++++++-------- 1 file changed, 122 insertions(+), 88 deletions(-) rename {translated/tech => published}/20150504 How to Install and Configure 'PowerDNS' (with MariaDB) and 'PowerAdmin' in RHEL or CentOS 7.md (68%) diff --git a/translated/tech/20150504 How to Install and Configure 'PowerDNS' (with MariaDB) and 'PowerAdmin' in RHEL or CentOS 7.md b/published/20150504 How to Install and Configure 'PowerDNS' (with MariaDB) and 'PowerAdmin' in RHEL or CentOS 7.md similarity index 68% rename from translated/tech/20150504 How to Install and Configure 'PowerDNS' (with MariaDB) and 'PowerAdmin' in RHEL or CentOS 7.md rename to published/20150504 How to Install and Configure 'PowerDNS' (with MariaDB) and 'PowerAdmin' in RHEL or CentOS 7.md index 0f7bc3d62f..4c3c824682 100644 --- a/translated/tech/20150504 How to Install and Configure 'PowerDNS' (with MariaDB) and 'PowerAdmin' in RHEL or CentOS 7.md +++ b/published/20150504 How to Install and Configure 'PowerDNS' (with MariaDB) and 'PowerAdmin' in RHEL or CentOS 7.md @@ -1,44 +1,48 @@ -RHEL/CentOS 7中安装并配置‘PowerDNS’(与MariaDB搭配)和‘PowerAdmin’ +RHEL/CentOS 7中安装并配置 PowerDNS 和 PowerAdmin ================================================================================ -PowerDNS是一个运行在许多Linux/Unix衍生版上的DNS服务器,它可以使用不同的后端进行配置,包括BIND类型的区域文件、相关的数据库,或者负载均衡/失效转移算法。它也可以被配置成一台DNS递归器,作为服务器上的一个独立进程运行。 +PowerDNS是一个运行在许多Linux/Unix衍生版上的DNS服务器,它可以使用不同的后端进行配置,包括BIND类型的区域文件、关系型数据库,或者负载均衡/失效转移算法。它也可以被配置成一台DNS递归器,作为服务器上的一个独立进程运行。 PowerDNS授权服务器的最新版本是3.4.4,但是当前EPEL仓库中可以获得的版本是3.4.3。我推荐安装EPEL仓库中提供的那一个,因为该版本已经在CentOS和Fedora中测试过。那样,你也可以在今后很容易地更新PowerDNS。 -本文倾向于向你演示如何安装并配置以MariaDB作为后端的PowerDNS和 +本文用于向你演示如何安装并配置以MariaDB作为后端的PowerDNS,以及它的界面友好的 Web 管理工具 PowerAdmin。 + 出于本文的写作目的,我将使用以下服务器: 主机名: centos7.localhost IP地址: 192.168.0.102 -### 步骤 1: 安装带有MariaDB后端的PowerDNS ### +### 第一部分: 安装带有MariaDB后端的PowerDNS ### -#### 1. 首先,你需要为你的系统启用EPEL仓库,只需使用: #### +1、 首先,你需要为你的系统启用EPEL仓库,只需使用: # yum install epel-release.noarch ![Enable Epel Repository](http://www.tecmint.com/wp-content/uploads/2015/04/Enable-Epel-Repository.png) -启用Epel仓库 -#### 2. 下一步是安装MariaDB服务器。运行以下命令即可达成: #### +*启用Epel仓库* + +2、 下一步是安装MariaDB服务器。运行以下命令即可达成: # yum -y install mariadb-server mariadb ![Install MariaDB Server](http://www.tecmint.com/wp-content/uploads/2015/04/Install-MariaDB-Server.png) -安装MariaDB服务器 -#### 3. 接下来,我们将配置并启用MySQL,并设置开机启动: #### +*安装MariaDB服务器* + +3、 接下来,我们将配置并启用MariaDB,并设置开机启动: # systemctl enable mariadb.service # systemctl start mariadb.service ![Enable Start MariaDB System Boot](http://www.tecmint.com/wp-content/uploads/2015/04/Enable-Start-MariaDB-System-Boot.png) -启用MariaDB开机启动 -#### 4. 由于MySQL服务正在运行,我们将为MariaDB设置密码进行安全加固,运行以下命令: #### +*启用MariaDB开机启动* + +4、 现在MariaDB服务运行起来了,我们将为MariaDB设置密码进行安全加固,运行以下命令: # mysql_secure_installation -#### 按照指示做 #### +**按照指示做** /bin/mysql_secure_installation: line 379: find_mysql_client: command not found @@ -102,33 +106,36 @@ PowerDNS授权服务器的最新版本是3.4.4,但是当前EPEL仓库中可以 Thanks for using MariaDB! -#### 5. MariaDB配置成功后,我们可以继续去安装PowerDNS。运行以下命令即可轻易完成: #### +5、 MariaDB配置成功后,我们可以继续去安装PowerDNS。运行以下命令即可轻易完成: # yum -y install pdns pdns-backend-mysql ![Install PowerDNS with MariaDB Backend](http://www.tecmint.com/wp-content/uploads/2015/04/Install-PowerDNS-with-MariaDB-Backend.png) -安装带有MariaDB后端的PowerDNS -#### 6. PowerDNS的配置文件位于`/etc/pdns/pdns`,在编辑之前,我们将为PowerDNS服务配置一个MySQL数据库。首先,我们将连接到MySQL服务器并创建一个名为powerdns的数据库: #### +*安装带有MariaDB后端的PowerDNS* + +6、 PowerDNS的配置文件位于`/etc/pdns/pdns`,在编辑之前,我们将为PowerDNS服务配置一个MariaDB数据库。首先,我们将连接到MariaDB服务器并创建一个名为powerdns的数据库: # mysql -u root -p MariaDB [(none)]> CREATE DATABASE powerdns; ![Create PowerDNS Database](http://www.tecmint.com/wp-content/uploads/2015/04/Create-PowerDNS-Database.png) -创建PowerDNS数据库 -#### 7. 接下来,我们将创建一个名为powerdns的数据库用户: #### +*创建PowerDNS数据库* + +7、 接下来,我们将创建一个名为powerdns的数据库用户: MariaDB [(none)]> GRANT ALL ON powerdns.* TO 'powerdns'@'localhost' IDENTIFIED BY ‘tecmint123’; MariaDB [(none)]> GRANT ALL ON powerdns.* TO 'powerdns'@'centos7.localdomain' IDENTIFIED BY 'tecmint123'; MariaDB [(none)]> FLUSH PRIVILEGES; ![Create PowerDNS User](http://www.tecmint.com/wp-content/uploads/2015/04/Create-PowerDNS-User.png) -创建PowerDNS用户 + +*创建PowerDNS用户* **注意**: 请将“tecmint123”替换为你想要设置的实际密码。 -#### 8. 我们继续创建PowerDNS要使用的数据库表。像堆积木一样执行以下这些: #### +8、 我们继续创建PowerDNS要使用的数据库表。像堆积木一样执行以下这些: MariaDB [(none)]> USE powerdns; MariaDB [(none)]> CREATE TABLE domains ( @@ -143,7 +150,8 @@ PowerDNS授权服务器的最新版本是3.4.4,但是当前EPEL仓库中可以 ); ![Create Table Domains for PowerDNS](http://www.tecmint.com/wp-content/uploads/2015/04/Create-Table-Domains-for-PowerDNS.png) -创建用于PowerDNS的表域 + +*创建用于PowerDNS的表domains* MariaDB [(none)]> CREATE UNIQUE INDEX name_index ON domains(name); MariaDB [(none)]> CREATE TABLE records ( @@ -158,15 +166,17 @@ PowerDNS授权服务器的最新版本是3.4.4,但是当前EPEL仓库中可以 primary key(id) ); -![Create Index Domains for PowerDNS](http://www.tecmint.com/wp-content/uploads/2015/04/Create-Index-Domains-for-PowerDNS.png) -创建用于PowerDNS的索引域 +![Create Table Records for PowerDNS](http://www.tecmint.com/wp-content/uploads/2015/04/Create-Index-Domains-for-PowerDNS.png) + +*创建用于PowerDNS的表 records* MariaDB [(none)]> CREATE INDEX rec_name_index ON records(name); MariaDB [(none)]> CREATE INDEX nametype_index ON records(name,type); MariaDB [(none)]> CREATE INDEX domain_id ON records(domain_id); -![Create Index Records](http://www.tecmint.com/wp-content/uploads/2015/04/Create-Records.png) -创建索引记录 +![Create Index of Table](http://www.tecmint.com/wp-content/uploads/2015/04/Create-Records.png) + +*创建表索引* MariaDB [(none)]> CREATE TABLE supermasters ( ip VARCHAR(25) NOT NULL, @@ -175,13 +185,14 @@ PowerDNS授权服务器的最新版本是3.4.4,但是当前EPEL仓库中可以 ); ![Create Table Supermaster](http://www.tecmint.com/wp-content/uploads/2015/04/Create-Table-Supermaster.png) -创建表的超主 -你现在可以输入以下命令退出MySQL控制台: +*创建表supermasters* + +你现在可以输入以下命令退出MariaDB控制台: MariaDB [(none)]> quit; -#### 9. 最后,我们可以继续以MySQL作为后台的方式配置PowerDNS。请打开PowerDNS的配置文件: #### +9、 最后,我们可以继续配置PowerDNS了,以MariaDB作为后台。请打开PowerDNS的配置文件: # vim /etc/pdns/pdns.conf @@ -203,35 +214,39 @@ PowerDNS授权服务器的最新版本是3.4.4,但是当前EPEL仓库中可以 修改“user-pass”为你先前设置的实际密码,配置如下: ![Configure PowerDNS](http://www.tecmint.com/wp-content/uploads/2015/04/Configure-PowerDNS.png) -配置PowerDNS + +*配置PowerDNS* 保存修改并退出。 -#### 10. 现在,我们将启动并添加PowerDNS到系统开机启动列表: #### +10、 现在,我们将启动并添加PowerDNS到系统开机启动列表: # systemctl enable pdns.service # systemctl start pdns.service ![Enable and Start PowerDNS](http://www.tecmint.com/wp-content/uploads/2015/04/Enable-and-Start-PowerDNS.png) -启用并启动PowerDNS + +*启用并启动PowerDNS* 到这一步,你的PowerDNS服务器已经起来并运行了。要获取更多关于PowerDNS的信息,你可以参考手册[http://downloads.powerdns.com/documentation/html/index.html][1] -### 步骤 2: 安装PowerAdmin来管理PowerDNS ### +### 第二部分: 安装PowerAdmin来管理PowerDNS ### -#### 11. 现在,我们将安装PowerAdmin——一个友好的网页接口PowerDNS服务器管理器。由于它是用PHP写的,我们将需要安装PHP和一台网络服务器(Apache): #### +11、 现在,我们将安装PowerAdmin——一个界面友好的PowerDNS服务器的 Web 管理器。由于它是用PHP写的,我们将需要安装PHP和一台网络服务器(Apache): # yum install httpd php php-devel php-gd php-imap php-ldap php-mysql php-odbc php-pear php-xml php-xmlrpc php-mbstring php-mcrypt php-mhash gettext ![Install Apache PHP](http://www.tecmint.com/wp-content/uploads/2015/04/Install-Apache-PHP.jpeg) -安装Apache PHP + +*安装Apache 和 PHP* PowerAdmin也需要两个PEAR包: # yum -y install php-pear-DB php-pear-MDB2-Driver-mysql ![Install Pear](http://www.tecmint.com/wp-content/uploads/2015/04/Install-Pear.jpeg) -安装Pear + +*安装Pear* 你也可以参考一下文章了解CentOS 7中安装LAMP堆栈的完整指南: @@ -243,58 +258,66 @@ PowerAdmin也需要两个PEAR包: # systemctl start httpd.service ![Enable Start Apache System Boot](http://www.tecmint.com/wp-content/uploads/2015/04/Enable-Start-Apache-System-Boot.png) -启用Apache开机启动 -#### 12. 由于已经满足PowerAdmin的所有系统要求,我们可以继续下载软件包。因为Apache默认的网页目录位于/var/www/html/,我们将下载软件包到这里。 #### +*启用Apache开机启动* + +12、 由于已经满足PowerAdmin的所有系统要求,我们可以继续下载软件包。因为Apache默认的网页目录位于/var/www/html/,我们将下载软件包到这里。 # cd /var/www/html/ # wget http://downloads.sourceforge.net/project/poweradmin/poweradmin-2.1.7.tgz # tar xfv poweradmin-2.1.7.tgz ![Download PowerAdmin](http://www.tecmint.com/wp-content/uploads/2015/04/Download-PowerAdmin.jpeg) -下载PowerAdmin -#### 13. 现在,我们可以启动PowerAdmin的网页安装器了,只需打开: #### +*下载PowerAdmin* + +13、 现在,我们可以启动PowerAdmin的网页安装器了,只需打开: http://192.168.0.102/poweradmin-2.1.7/install/ 这会进入安装过程的第一步: ![Select Installation Language](http://www.tecmint.com/wp-content/uploads/2015/04/Select-Installation-Language.png) -选择安装语言 + +*选择安装语言* 上面的页面会要求你为PowerAdmin选择语言,请选择你想要使用的那一个,然后点击“进入步骤 2”按钮。 -#### 14. 安装器需要PowerDNS数据库: #### +14、 安装器需要PowerDNS数据库: ![PowerDNS Database](http://www.tecmint.com/wp-content/uploads/2015/04/PowerDNS-Database.png) -PowerDNS数据库 -#### 15. 因为我们已经创建了一个,所以我们可以继续进入下一步。你会被要求提供先前配置的数据库详情,你也需要为Poweradmin设置管理员密码: #### +*PowerDNS数据库* + +15、 因为我们已经创建了一个数据库,所以我们可以继续进入下一步。你会被要求提供先前配置的数据库详情,你也需要为Poweradmin设置管理员密码: ![Enter PowerDNS Database Settings](http://www.tecmint.com/wp-content/uploads/2015/04/PowerDNS.png) -输入PowerDNS数据库配置 -#### 16. 输入这些信息后,进入步骤 4。你将创建为Poweradmin创建一个受限用户。这里你需要输入的字段是: #### +*输入PowerDNS数据库配置* -- 用户名 - PowerAdmin用户名。 -- 密码 – 上述用户的密码。 -- 注册人 - 当创建SOA记录而你没有制定注册人时,该值会被使用。 -- 辅助域名服务器 – 该值在创建新的DNS区域时会被用于作为主域名服务器。 +16、 输入这些信息后,进入步骤 4。你将创建为Poweradmin创建一个受限用户。这里你需要输入的字段是: + +- 用户名(Username) - PowerAdmin用户名。 +- 密码(Password) – 上述用户的密码。 +- 主机管理员(Hostmaster) - 当创建SOA记录而你没有指定主机管理员时,该值会被用作默认值。 +- 主域名服务器 - 该值在创建新的DNS区域时会被用于作为主域名服务器。 +- 辅域名服务器 – 该值在创建新的DNS区域时会被用于作为辅域名服务器。 ![PowerDNS Configuration Settings](http://www.tecmint.com/wp-content/uploads/2015/04/PowerDNS-Configuration-Settings.png) -PowerDNS配置设置 -#### 17. 在下一步中,Poweradmin会要求你在数据库表中创建新的受限数据库用户,它会提供你需要在MySQL控制台输入的代码: #### +*PowerDNS配置设置* + +17、 在下一步中,Poweradmin会要求你在数据库表中创建一个新的受限数据库用户,它会提供你需要在MariaDB控制台输入的代码: ![Create New Database User](http://www.tecmint.com/wp-content/uploads/2015/04/Create-New-Database-User.png) -创建新的数据库用户 -#### 18. 现在打开终端并运行: #### +*创建新的数据库用户* + +18、 现在打开终端并运行: # mysql -u root -p -提供你的密码并执行由Poweradmin提供的代码: +提供你的密码并执行由PowerAdmin提供的代码: MariaDB [(none)]> GRANT SELECT, INSERT, UPDATE, DELETE ON powerdns.* @@ -302,27 +325,30 @@ PowerDNS配置设置 IDENTIFIED BY '123qweasd'; ![Grant Mysql Permissions to User](http://www.tecmint.com/wp-content/uploads/2015/04/Grant-Mysql-Permissions-to-User.png) -为用户授予Mysql权限 -#### 19. 现在,回到浏览器中并继续下一步。安装器将尝试创建配置文件到/var/www/html/poweradmin-2.1.7/inc。 #### +*为用户授予Mysql权限* + +19、 现在,回到浏览器中并继续下一步。安装器将尝试创建配置文件到/var/www/html/poweradmin-2.1.7/inc。 文件名是config.inc.php。为防止该脚本没有写权限,你可以手动复制这些内容到上述文件中: ![Configuration Settings of PowerDNS](http://www.tecmint.com/wp-content/uploads/2015/04/PowerDNS-Configuration.png) -配置PowerDNS设置 -#### 20. 现在,进入最后页面,该页面会告知你安装已经完成以及如何访问安装好的Poweradmin: #### +*配置PowerDNS设置* + +20、 现在,进入最后页面,该页面会告知你安装已经完成以及如何访问安装好的PowerAdmin: ![PowerDNS Installation Completed](http://www.tecmint.com/wp-content/uploads/2015/04/PowerDNS-Installation-Completed.png) -PowerDNS安装完成 -你可以通过运行以下命令来启用其他动态DNS提供商的URL: +*PowerDNS安装完成* + +你可以通过运行以下命令来启用用于其他动态DNS提供商的URL: # cp install/htaccess.dist .htaccess 出于该目的,你将需要在Apache的配置中启用mod_rewrite。 -#### 21. 现在,需要移除从Poweradmin的根目录中移除“install”文件夹,这一点很重要。使用以下命令: #### +21、 现在,需要移除从PowerAdmin的根目录中移除“install”文件夹,这一点很重要。使用以下命令: # rm -fr /var/www/html/poweradmin/install/ @@ -331,78 +357,86 @@ PowerDNS安装完成 http://192.168.0.102/poweradmin-2.1.7/ ![PowerDNS Login](http://www.tecmint.com/wp-content/uploads/2015/04/PowerDNS-Login.png) -PowerDNS登录 -在登录后,你应该会看到Poweradmin的主页: +*PowerDNS登录* + +在登录后,你应该会看到PowerAdmin的主页: ![PowerDNS Dashboard](http://www.tecmint.com/wp-content/uploads/2015/04/PowerDNS-Dashboard.png) -PowerDNS仪表盘 + +*PowerDNS仪表盘* 到这里,安装已经完成了,你也可以开始管理你的DNS区域了。 -### 步骤 3: PowerDNS中添加、编辑和删除DNS区域 ### +### 第三部分: PowerDNS中添加、编辑和删除DNS区域 ### -#### 22. 要添加新的主区域,只需点击“添加主区域”: #### +22、 要添加新的主区域,只需点击“添加主区域”: ![Add Master Zone](http://www.tecmint.com/wp-content/uploads/2015/04/Add-Master-Zone.png) -添加主区域 + +*添加主区域* 在下一页中,你需要填写一些东西: -- 域 – 你要添加区域的域。 -- 所有者 – 设置DNS区域的所有者。 -- 模板 – DNS模板 – 留空。 -- DNSSEC – Donany名称系统安全扩展(可选——检查你是否需要)。 +- 域(Domain) – 你要添加区域的域。 +- 所有者(Owner) – 设置DNS区域的所有者。 +- 模板(Template)– DNS模板 – 留空。 +- DNSSEC – 域名系统安全扩展(可选——看看你是否需要)。 点击“添加区域”按钮来添加DNS区域。 ![Master DNS Zone](http://www.tecmint.com/wp-content/uploads/2015/04/Master-DNS-Zone.png) -主DNS区域 -现在,你可以点击“首页”链接回到Poweradmin的首页。要查看所有现存的DNS区域,只需转到“列出区域”: +*主DNS区域* + +现在,你可以点击“首页”链接回到PowerAdmin的首页。要查看所有现存的DNS区域,只需转到“列出区域(List Zones)”: ![Check List of Zones](http://www.tecmint.com/wp-content/uploads/2015/04/Check-List-Zones.png) -检查区域列表 + +*查看区域列表* 你现在应该看到一个可用DNS区域列表: ![Check List of DNS Zones](http://www.tecmint.com/wp-content/uploads/2015/04/DNS-Zones.png) -检查DNS区域列表 -#### 23. 要编辑现存DNS区域或者添加新的记录,点击编辑图标: #### +*检查DNS区域列表* + +23、 要编辑现存DNS区域或者添加新的记录,点击编辑图标: ![Edit DNS Zone](http://www.tecmint.com/wp-content/uploads/2015/04/Edit-DNS-Zone.png) -编辑DNS区域 + +*编辑DNS区域* 在接下来的页面,你会看到你选择的DNS区域的条目: ![Domain DNS Zone Entries](http://www.tecmint.com/wp-content/uploads/2015/04/Domain-DNS.png) -主DNS区域条目 -#### 24. 在此处添加新的DNS区域,你需要设置以下信息: #### +*域名的DNS区域条目* -- 名称 – 条目名称。只需添加域/子域的第一部分,Poweradmin会添加剩下的。 -- 类型 – 选择记录类型。 -- 优先级 – 记录优先级。 +24、 在此处添加新的DNS条目,你需要设置以下信息: + +- 名称(Name) – 条目名称。只需添加域/子域的第一部分,PowerAdmin会添加剩下的。 +- 类型(Type) – 选择记录类型。 +- 优先级(Priority) – 记录优先级。 - TTL – 存活时间,以秒计算。 出于本文目的,我将为子域new.example.com添加一个A记录用于解析IP地址192.168.0.102,设置存活时间为14400秒: ![Add New DNS Record](http://www.tecmint.com/wp-content/uploads/2015/04/Add-New-DNS-Record.png) -添加新DNS记录 + +*添加新DNS记录* 最后,点击“添加记录”按钮。 -#### 25. 如果你想要删除DNS区域,你可以回到“列出区域”页面,然后点击你想要删除的DNS区域旁边“垃圾桶”图标: #### +25、 如果你想要删除DNS区域,你可以回到“列出区域”页面,然后点击你想要删除的DNS区域旁边“垃圾桶”图标: ![Delete DNS Zone](http://www.tecmint.com/wp-content/uploads/2015/04/Delete-DNS-Zone.png) -删除DNS区域 + +*删除DNS区域* Poweradmin将问你是否确定想要删除DNS区域。只需点击“是”来完成删除。 -如要获取更多关于怎样创建、编辑和删除区域的说明,你可以参与Poweradmin的文档: - -[https://github.com/poweradmin/poweradmin/wiki/Documentation][3] +如要获取更多关于怎样创建、编辑和删除区域的说明,你可以参与Poweradmin的文档:[https://github.com/poweradmin/poweradmin/wiki/Documentation][3] 我希望你已经发现本文很有趣,也很有用。一如既往,如果你有问题或要发表评论,请别犹豫,在下面评论区提交你的评论吧。 @@ -412,7 +446,7 @@ via: http://www.tecmint.com/install-powerdns-poweradmin-mariadb-in-centos-rhel/ 作者:[Marin Todorov][a] 译者:[GOLinux](https://github.com/GOLinux) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 From 6189e0a0ac55f11c4455a3716bb3648b8789f960 Mon Sep 17 00:00:00 2001 From: wxy Date: Sat, 13 Jun 2015 23:41:59 +0800 Subject: [PATCH 368/965] PUB:20150518 Linux FAQs with Answers--How to fix 'Encountered a section with no Package--header' error on Raspbian @ictlyh --- ... section with no Package--header' error on Raspbian.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) rename {translated/tech => published}/20150518 Linux FAQs with Answers--How to fix 'Encountered a section with no Package--header' error on Raspbian.md (68%) diff --git a/translated/tech/20150518 Linux FAQs with Answers--How to fix 'Encountered a section with no Package--header' error on Raspbian.md b/published/20150518 Linux FAQs with Answers--How to fix 'Encountered a section with no Package--header' error on Raspbian.md similarity index 68% rename from translated/tech/20150518 Linux FAQs with Answers--How to fix 'Encountered a section with no Package--header' error on Raspbian.md rename to published/20150518 Linux FAQs with Answers--How to fix 'Encountered a section with no Package--header' error on Raspbian.md index 54e0f393d1..1d51e06b18 100644 --- a/translated/tech/20150518 Linux FAQs with Answers--How to fix 'Encountered a section with no Package--header' error on Raspbian.md +++ b/published/20150518 Linux FAQs with Answers--How to fix 'Encountered a section with no Package--header' error on Raspbian.md @@ -1,6 +1,6 @@ -Linux 有问必答--如何修复 Raspbian 上的 “Encountered a section with no Package: header” 错误 +Linux 有问必答:如何修复 Rasbian 上的 “Encountered a section with no Package: header” 错误 ================================================================================ -> **问题**: 我在 Raspberry Pi 上安装新版的 Rasbian。但当我使用 sudo apt-get update 命令更新 APT 软件包索引的时候,它抛出下面的错误: +> **问题**: 我在树莓派上安装新版的 Rasbian。但当我使用 sudo apt-get update 命令更新 APT 软件包索引的时候,它抛出下面的错误: E: Encountered a section with no Package: header E: Problem with MergeList /var/lib/dpkg/status @@ -10,7 +10,7 @@ Linux 有问必答--如何修复 Raspbian 上的 “Encountered a section with n ![](https://farm8.staticflickr.com/7704/17445484636_05ba81722f_c.jpg) -错误说 "Problem with MergeList /var/lib/dpkg/status" 表示由于某些原因状态文件损坏了,因此无法解释。这个状态文件包括了已经安装的 deb 软件包的信息,因此需要小心备份。 +这个错误说 "Problem with MergeList /var/lib/dpkg/status" 表示由于某些原因状态文件损坏了,因此无法解析。这个状态文件包括了已经安装的 deb 软件包的信息,因此需要小心备份。 在这种情况下,由于这是新安装的 Raspbian,你可以安全地删除状态文件,然后用下面的命令重新生成。 @@ -24,7 +24,7 @@ via: http://ask.xmodulo.com/encountered-section-with-no-package-header-error.htm 作者:[Dan Nanni][a] 译者:[ictlyh](https://github.com/ictlyh) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 14d06fe7588205c57faefe2dc48658d74c2aea1c Mon Sep 17 00:00:00 2001 From: strugglingyouth <630441839@qq.occom> Date: Sat, 13 Jun 2015 08:42:10 -0700 Subject: [PATCH 369/965] translated --- ...ry Cache Buffer and Swap Space on Linux.md | 100 ------------------ ...ry_Cache_Buffer_and_Swap_Space_on_Linux.md | 88 +++++++++++++++ 2 files changed, 88 insertions(+), 100 deletions(-) delete mode 100644 sources/tech/20150610 How to Clear RAM Memory Cache Buffer and Swap Space on Linux.md create mode 100644 translated/tech/20150610_How_to_Clear_RAM_Memory_Cache_Buffer_and_Swap_Space_on_Linux.md diff --git a/sources/tech/20150610 How to Clear RAM Memory Cache Buffer and Swap Space on Linux.md b/sources/tech/20150610 How to Clear RAM Memory Cache Buffer and Swap Space on Linux.md deleted file mode 100644 index 9a001f45b4..0000000000 --- a/sources/tech/20150610 How to Clear RAM Memory Cache Buffer and Swap Space on Linux.md +++ /dev/null @@ -1,100 +0,0 @@ -translation by strugglingyouth -How to Clear RAM Memory Cache, Buffer and Swap Space on Linux -================================================================================ -Like any other operating system, GNU/Linux has implemented a memory management efficiently and even more than that. But if any process is eating away your memory and you want to clear it, Linux provides a way to flush or clear ram cache. - -![Clear RAM Cache and Swap in Linux](http://www.tecmint.com/wp-content/uploads/2015/05/Clear-RAM-Cache-in-Linux.jpg) - -### How to Clear Cache in Linux? ### - -Every Linux System has three options to clear cache without interrupting any processes or services. - -1. Clear PageCache only. - - # sync; echo 1 > /proc/sys/vm/drop_caches - -2. Clear dentries and inodes. - - # sync; echo 2 > /proc/sys/vm/drop_caches - -3. Clear PageCache, dentries and inodes. - - # sync; echo 3 > /proc/sys/vm/drop_caches - -Explanation of above command. - -sync will flush the file system buffer. Command Separated by `“;”` run sequentially. The shell wait for each command to terminate before executing the next command in the sequence. As mentioned in kernel documentation, writing to drop_cache will clean cache without killing any application/service, [command echo][1] is doing the job of writing to file. - -If you have to clear the disk cache, the first command is safest in enterprise and production as `“...echo 1 > ….”` will clear the PageCache only. It is not recommended to use third option above `“...echo 3 >”` in production until you know what you are doing, as it will clear PageCache, dentries and inodes. - -**Is it a good idea to free Buffer and Cache in Linux that might be used by Linux Kernel?** - -When you are applying various settings and want to check, if it is actually implemented specially on I/O-extensive benchmark, then you may need to clear buffer cache. You can drop cache as explained above without rebooting the System i.e., no downtime required. - -Linux is designed in such a way that it looks into disk cache before looking onto the disk. If it finds the resource in the cache, then the request doesn’t reach the disk. If we clean the cache, the disk cache will be less useful as the OS will look for the resource on the disk. - -Moreover it will also slow the system for a few seconds while the cache is cleaned and every resource required by OS is loaded again in the disk-cache. - -Now we will be creating a shell script to auto clear RAM cache daily at 2PM via a cron scheduler task. Create a shell script clearcache.sh and add the following lines. - - #!/bin/bash - # Note, we are using "echo 3", but it is not recommended in production instead use "echo 1" - echo "echo 3 > /proc/sys/vm/drop_caches" - -Set execute permission on the clearcache.sh file. - - # chmod 755 clearcache.sh - -Now you may call the script whenever you required to clear ram cache. - -Now set a cron to clear RAM cache everyday at 2PM. Open crontab for editing. - - # crontab -e - -Append the below line, save and exit to run it at 2PM daily. - - 0 3 * * * /path/to/clearcache.sh - -For more details on how to cron a job you may like to check our article on [11 Cron Scheduling Jobs][2]. - -**Is it good idea to auto clear RAM cache on production server?** - -No! it is not. Think of a situation when you have scheduled the script to clear ram cache everyday at 2PM. Everyday at 2PM the script is executed and it flushes your RAM cache. One day for whatsoever reason, may be more than expected users are online on your website and seeking resource from your server. - -At the same time scheduled script run and clears everything in cache. Now all the user are fetching data from disk. It will result in server crash and corrupt the database. So clear ram-cache only when required,and known your foot steps, else you are a Cargo Cult System Administrator. - -#### How to Clear Swap Space in Linux? #### - -If you want to clear Swap space, you may like to run the below command. - - # swapoff -a && swapon -a - -Also you may add above command to a cron script above, after understanding all the associated risk. - -Now we will be combining both above commands into one single command to make a proper script to clear RAM Cache and Swap Space. - - # echo 3 > /proc/sys/vm/drop_caches && swapoff -a && swapon -a && printf '\n%s\n' 'Ram-cache and Swap Cleared' - - OR - - su -c 'echo 3 >/proc/sys/vm/drop_caches' && swapoff -a && swapon -a && printf '\n%s\n' 'Ram-cache and Swap Cleared' - -After testing both above command, we will run command “free -h” before and after running the script and will check cache. - -![Clear RAM Cache and Swap Space](http://www.tecmint.com/wp-content/uploads/2015/05/Clear-RAM-Cache.gif) - -That’s all for now, if you liked the article, don’t forget to provide us with your valuable feedback in the comments to let us know, what you think is it a good idea to clear ram cache and buffer in production and Enterprise? - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/clear-ram-memory-cache-buffer-and-swap-space-on-linux/ - -作者:[Avishek Kumar][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.tecmint.com/author/avishek/ -[1]:http://www.tecmint.com/echo-command-in-linux/ -[2]:http://www.tecmint.com/11-cron-scheduling-task-examples-in-linux/ diff --git a/translated/tech/20150610_How_to_Clear_RAM_Memory_Cache_Buffer_and_Swap_Space_on_Linux.md b/translated/tech/20150610_How_to_Clear_RAM_Memory_Cache_Buffer_and_Swap_Space_on_Linux.md new file mode 100644 index 0000000000..932bc11cd2 --- /dev/null +++ b/translated/tech/20150610_How_to_Clear_RAM_Memory_Cache_Buffer_and_Swap_Space_on_Linux.md @@ -0,0 +1,88 @@ +像任何其他的操作系统一样,GNU / Linux已经有效地实施了内存管理甚至更多。但是,如果有任何进程正在蚕食你的内存,你要清除它, +Linux提供了一个方法来刷新或清除RAM缓存。 + +在Linux中如何清除缓存? + +每一个Linux系统有三个选项来清除缓存而不中断任何进程或服务。 + +1,仅清除缓存页 +

+sync; echo 1 > /proc/sys/vm/drop_caches
+
+2,清除目录项和inodes +

+sync; echo 2 > /proc/sys/vm/drop_caches
+
+3,清除,缓存页,目录项和inodes +

+sync; echo 3 > /proc/sys/vm/drop_caches
+
+上述命令的说明: + +sync将刷新文件系统缓存,命令通过“;”分隔,顺序执行,shell等待终止在序列中的每一个命令执行之前。正如内核文档中提到的,写到drop_cache将清空缓存而不杀死任何应用程序/服务,echo命令做写入文件的工作。 + +如果你必须清除磁盘高速缓存,第一个命令是最安全在企业和生产环境中,“...echo 1> ...”只会清除页缓存。 +不建议使用上面第三个选项在生产环境中“...echo 3 >” ,除非你明确自己在做什么,因为它会清除缓存页,目录项和inodes。 + +在Linux上释放Buffer和Cache要用到内核是否是个好主意? + +当你请求许多设定想要检查时,如果它实际上是专门实施对I/O 广泛的基准测试,那么你可能需要清除缓存。你可以如上所示删除缓存,无需重新启动系统即无需停机。 + +Linux被设计成它在寻找磁盘之前到磁盘缓存寻找的方式。如果它发现该资源在缓存中,则该请求不到达磁盘。如果我们清理缓存,磁盘缓存将没有用处,系统会到磁盘上寻找资源。 + +此外,当清除缓存后它也将减慢系统运行速度,系统会重新加载每一个被请求的资源再次到磁盘缓存中。 + +现在,我们将通过一个cron任务调度器创建一个shell脚本在每天下午2点自动清除RAM缓存。 +创建一个shell脚本clearcache.sh并在其中添加以下行: +

+#!/bin/bash
+# Note, we are using "echo 3", but it is not recommended in production instead use "echo 1"
+echo "echo 3 > /proc/sys/vm/drop_caches"
+
+给clearcache.sh文件设置执行权限 +

+# chmod 755 clearcache.sh
+
+现在,当你需要清除RAM缓存时只需要调用脚本。 + +现在设置一个定时任务来清除RAM缓存每天在下午2点,打开crontab进行编辑。 +

+# crontab -e
+
+添加以下行,保存并退出。 +

+0 3 * * * /path/to/clearcache.sh
+
+有关如何创建一个定时任务,更多细节你可以查看我们的文章11 Cron Scheduling Jobs。 + +在生产环境的服务器上自动清除RAM是否是一个好主意? + +不!它不是。想想一个情况,当你已经预定脚本来清除RAM缓存每天在下午2点。每天下午2点该脚本会执行并刷新你的RAM缓存。在一天中的任何时候,您网站用户的在线量可能会超过预期的,并从你的服务器请求资源。同时调度器运行着脚本,并在高速缓存中清除一切。当所有的用户都从磁盘读取数据时,这将导致服务器崩溃并损坏数据库。 +因此,清除缓存仅在必要时并且在你的预料之中,否则你就是个Cargo Cult System Administrator。 + +如何清除Linux的交换空间? + +如果你想清除掉的空间,你可以运行下面的命令: +

+# swapoff -a && swapon -a
+
+此外,了解有关风险后,您可能会将上面的命令添加到cron中。 + +现在,我们将上面两种命令结合成一个命令写出正确的脚本来同时清除RAM缓存和交换空间。 +

+# echo 3 > /proc/sys/vm/drop_caches && swapoff -a && swapon -a && printf '\n%s\n' 'Ram-cache and Swap Cleared'
+
+或 +

+su -c 'echo 3 >/proc/sys/vm/drop_caches' && swapoff -a && swapon -a && printf '\n%s\n' 'Ram-cache and Swap Cleared'
+
+在测试上面的命令之前,我们先运行“free -m” 然后执行脚本检查缓存。 + +Clear RAM Cache and Swap Space + +就是现在,如果你喜欢这篇文章,不要忘记向我们提供您宝贵的意见, +让我们知道,您认为在企业和生产环境中清除RAM缓存和缓冲区是否是一个好主意? + +via:http://www.tecmint.com/clear-ram-memory-cache-buffer-and-swap-space-on-linux/ + +  \ No newline at end of file From 2969fa15e5575eccd4365b536378a7e596e78d0c Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 14 Jun 2015 00:46:45 +0800 Subject: [PATCH 370/965] PUB:20150528 Things To Do After Installing Fedora 22 @GOLinux --- ...Things To Do After Installing Fedora 22.md | 237 ++++++++++++++++++ ...Things To Do After Installing Fedora 22.md | 113 --------- 2 files changed, 237 insertions(+), 113 deletions(-) create mode 100644 published/20150528 Things To Do After Installing Fedora 22.md delete mode 100644 translated/tech/20150528 Things To Do After Installing Fedora 22.md diff --git a/published/20150528 Things To Do After Installing Fedora 22.md b/published/20150528 Things To Do After Installing Fedora 22.md new file mode 100644 index 0000000000..1a4ff0ff8a --- /dev/null +++ b/published/20150528 Things To Do After Installing Fedora 22.md @@ -0,0 +1,237 @@ +安装 Fedora 22 后要做的事情 +================================================================================ + +Red Hat操作系统的社区开发版的最新成员Fedora 22,已经于2015年5月26日发布了。对这个经典的Fedora发行版的发布充斥着各种猜测和预期,而最终Fedora 22推出了许多重大变化。 + +就初始化进程而言,Systemd还是个新生儿,但它已经准备好替换古老的sysvinit这个一直是Linux生态系统一部分的模块。另外一个用户会碰到的重大改变存在于基本仓库的python版本中,这里提供了两种不同口味的python版本,2.x和3.x分支,各个都有其不同的偏好和优点。所以,那些偏好2.x口味的用户可能想要安装他们喜爱的python版本。自从Fedora 18开始 dandified YUM安装器(即 DNF)就准备替换过时陈旧的YUM安装器了,Fedora最后决定,现在就用DNF来替换YUM。 + +### 1) 配置RPMFusion仓库 ### + +正如我已经提到过的,Fedora的意识形态很是严谨,它不会自带任何非自由组件。官方仓库不会提供一些包含有非自由组件的基本软件,比如像多媒体编码。因此,安装一些第三方仓库很有必要,这些仓库会为我们提供一些基本的软件。幸运的是,RPMFusion仓库前来拯救我们了。 + + $ sudo dnf install --nogpgcheck http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-22.noarch.rpm + +### 2) 安装VLC媒体播放器 ### + +Fedora 22默认自带了媒体播放器,即 gnome视频播放器(以前叫做totem)。如果你觉得还好,那么我们可以跳过这一步继续往前走。但是,如果你像我一样,偏好使用最广泛的VLC,那么就去从RPMFusion仓库安装吧。安装方法如下: + + sudo dnf install vlc -y + +### 3) 安装多媒体编码 ### + +刚刚我们说过,一些多媒体编码和插件不会随Fedora一起发送。现在,有谁想仅仅是因为专有编码而错过他们最爱的节目和电影?试试这个吧: + + $ sudo dnf install gstreamer-plugins-bad gstreamer-plugins-bad-free-extras gstreamer-plugins-ugly gstreamer-ffmpeg gstreamer1-libav gstreamer1-plugins-bad-free-extras gstreamer1-plugins-bad-freeworld gstreamer-plugins-base-tools gstreamer1-plugins-good-extras gstreamer1-plugins-ugly gstreamer1-plugins-bad-free gstreamer1-plugins-good gstreamer1-plugins-base gstreamer1 + +### 4) 更新系统 ### + +Fedora是一个前锐的发行版,因此它会不断发布更新用以修复系统中出现的错误和漏洞。因而,保持系统更新到最新,是个不错的做法。 + + $ sudo dnf update -y + +### 5) 卸载你不需要的软件 ### + +Fedora预装了一些大多数用户都有用的软件包,但是对于更高级的用户,你可能知道到你并不需要它。要移除你不需要的包相当容易,只需使用以下命令——我选择卸载rhythmbox,因为我知道我不会用到它: + + $ sudo dnf remove rhythmbox + +### 6) 安装Adobe Flash ### + +我们都希望Adobe Flash不要再存在了,因为它并不被认为是最安全的,或者存在资源问题,但是暂时先让它待着吧。Fedora 22安装Adobe Flash的唯一途径是从Adobe安装官方RPM,就像下面这样。 + +你可以从[这里][1]下载RPM。下载完后,你可以直接右击并像下面这样打开: + +![Install Adobe Flash](http://blog.linoxide.com/wp-content/uploads/2015/05/Screen-Shot-2015-05-27-at-9.50.42-PM.png) + +右击并选择“用软件安装打开” + +然后,只需在弹出窗口中点击安装: + +![Install Adobe](http://blog.linoxide.com/wp-content/uploads/2015/05/Screen-Shot-2015-05-27-at-9.51.07-PM.png) + +*点击“安装”来完成安装Adobe定制RPM的过程* + +该过程完成后,“安装”按钮会变成“移除”,而此时安装也完成了。如果在此过程中你的浏览器开着,会提示你先把它关掉或在安装完成后重启以使修改生效。 + +### 7) 用Gnome Boxes加速虚拟机 ### + +你刚刚安装了Fedora,你也很是喜欢,但是出于某些私人原因,你也许仍然需要Windows,或者你只是想玩玩另外一个Linux发行版。不管哪种情况,你都可以使用Gnome Boxes来简单地创建一个虚拟机或使用一个live发行版,Fedora 22提供了该软件。遵循以下步骤,使用你所选的ISO来开始吧!谁知道呢,也许你可以检验一下某个[Fedora Spin][2]。 + +首先,打开Gnome Boxes,然后在顶部左边选择“新建”: + +![Add a new virtual machine (box)](http://blog.linoxide.com/wp-content/uploads/2015/05/Screen-Shot-2015-05-27-at-10.24.46-PM.png) + +点击“新建”来开始添加一个新虚拟机的进程吧。 + +接下来,点击打开文件并选择一个ISO: + +![Choose ISO](http://blog.linoxide.com/wp-content/uploads/2015/05/Screen-Shot-2015-05-27-at-10.28.44-PM.png) + +*在点击了“选择文件或ISO”后,选择你的ISO。这里,我已经安装了一个Debian ISO。* + +最后,自定义VM设置或使用默认配置,然后点击“创建”。VM默认会启动,可用的VM会在Gnome Boxes以小缩略图的方式显示。 + +![Create VM](http://blog.linoxide.com/wp-content/uploads/2015/05/Screen-Shot-2015-05-27-at-10.31.11-PM.png) + +*自定义你自己的设置,或者也可以保持默认。完成后,点击“创建”,VM就一切就绪了。* + +### 8) 添加社交媒体和其它在线帐号 ### + +Gnome自带有不错的内建功能用于容纳帐号相关的东西,像Facebook,Google以及其它在线帐号。你可以通过Gnome设置应用访问在线帐号设置,可以在桌面上右键点击或在应用程序中找到该应用。然后,只需点击在线帐号,并添加你所选择的帐号。如果你要添加一个帐号,比如像Google,你可以用它来作为默认帐号,用来完成诸如发送邮件、日历提醒、相片和文档交互,以及诸如此类的更多事情。 + +### 9) 安装KDE或另一个桌面环境 ### + +我们中的某些人不喜欢Gnome,那也没问题。在终端中运行以下命令来安装KDE所需的一切来替换它。这些指令也可以用以安装xfce、lxde或其它桌面环境。 + + $ sudo dnf install @kde-desktop + +安装完成后,登出。当你点击你的用户名时,注意那个表示设置的小齿轮。点击它,然后选择“Plasma”。当你再次登录时,一个全新的KDE桌面就会欢迎你。 + +![Plasma on Fedora 22](http://blog.linoxide.com/wp-content/uploads/2015/05/Screen-Shot-2015-05-27-at-11.32.27-PM.png) + +*刚刚安装到Fedora 22上的Plasma环境* + +####在 Fedora 22中安装 Cinnamon桌面:#### + +打开SSH终端,输入或粘帖如下命令并回车: + + sudo dnf install @cinnamon-desktop + +####在 Fedora 22中安装 MATE桌面:#### + +打开SSH终端,输入或粘帖如下命令并回车: + + sudo dnf install @mate-desktop + +####在 Fedora 22中安装 XFCE桌面:#### + +打开SSH终端,输入或粘帖如下命令并回车: + + sudo dnf install @xfce-desktop + +####在 Fedora 22中安装 LXDE桌面:#### + +打开SSH终端,输入或粘帖如下命令并回车: + + sudo dnf install @lxde-desktop + +### 10) 定制桌面并优化设置 ### + +默认的 Gnome 带有一张黑色背景和一个新的锁屏,幸运的是,很容易通过下面的方式来改变: + +![change desktop](http://blog.linoxide.com/wp-content/uploads/2015/05/Screen-Shot-2015-05-28-at-7.17.29-AM-1024x767.png) + +*右键点击桌面,然后点修改背景* + +![Desktop or lock screen](http://blog.linoxide.com/wp-content/uploads/2015/05/Screen-Shot-2015-05-28-at-7.17.52-AM-1024x769.png) + +*你会看到这个窗口,这里你选择新的桌面背景或锁屏图片* + +进一步,如果你点击“设置”,你会看到一个菜单展示你所以可以修改的设置。举个例子,在笔记本电脑上,你可以修改电源设置来控制合上笔记本电脑时的动作。 + + +### 11) 安装 Fedy 4.0### + +Fedy 可以帮助用户和系统管理员来监控系统的运作,并让他们可以控制系统如其所预期的工作。这里有一行脚本可以安装最新版本的 Fedy。打开终端,输入或粘帖如下行并按下回车。 + + su -c "curl https://satya164.github.io/fedy/fedy-installer -o fedy-installer && chmod +x fedy-installer && ./fedy-installer" + +### 12) 安装 Java### + +使用如下命令可以很容易的安装 Java。 + + sudo dnf install java -y + +它会根据你的系统架构自动安装32位或64位的 Java 发行版。 + +### 13) 在 Fedora 22 上安装浏览器 ### + +Fedora 22的默认浏览器是 Firefox,不过其它的浏览器也各有优缺点。最终用户选择浏览器会有种种原因。这里我们提供一些在 Fedora 22上安装其它浏览器的方法。 + +#### 安装 Google Chrome#### + +使用你惯用的编辑器,在 yum 库目录中打开或创建 google-chrome.repo 文件。 + + sudo gedit /etc/yum.repos.d/google-chrome.repo + +加入以下内容并保存。 + + [google-chrome] + name=google-chrome + baseurl=http://dl.google.com/linux/chrome/rpm/stable/$basearch + enabled=1 + gpgcheck=1 + gpgkey=https://dl-ssl.google.com/linux/linux_signing_key.pub + +现在 yum 就配置好可以找到稳定版本的 Chrome 了,使用如下命令安装它。 + + sudo dnf install google-chrome-stable + +#### 安装 Tor 浏览器 #### + +在 Fedora 22 中安装 Tor 有一点棘手,在 /etc/yum.repos.d 目录中打开或创建 torproject.repo 文件。 + + sudo gedit /etc/yum.repos.d/torproject.repo + +插入以下内容。 + + [tor] + name=Tor repo + enabled=1 + baseurl=https://deb.torproject.org/torproject.org/rpm/fc/22/$basearch/ + gpgcheck=1 + gpgkey=https://deb.torproject.org/torproject.org/rpm/RPM-GPG-KEY-torproject.org.asc + + [tor-source] + name=Tor source repo + enabled=1 + autorefresh=0 + baseurl=https://deb.torproject.org/torproject.org/rpm/fc/22/SRPMS + gpgcheck=1 + gpgkey=https://deb.torproject.org/torproject.org/rpm/RPM-GPG-KEY-torproject.org.asc + +也许会问到 GPG 键的指纹,它应该如下。 + + 3B9E EEB9 7B1E 827B CF0A 0D96 8AF5 653C 5AC0 01F1 + +不幸的是,在 EPEL 和 Fedora 仓库中有一个相同名字的软件包,你需要明确排除这个来避免安装/删除/修改它。所以,在/etc/yum.repos.d/epel.repo 中加入 `Exclude=tor` 一行。 + +最后,使用如下命令来安装 Tor。 + + sudo dnf install tor + +安装完成,启动服务。 + + sudo service tor start + +#### 安装 Vivaldi#### + +根据你的系统架构下载32位或64位的 Vivaldi 浏览器。 + + sudo wget https://vivaldi.com/download/Vivaldi_TP3.1.0.162.9-1.i386.rpm + sudo wget https://vivaldi.com/download/Vivaldi_TP3.1.0.162.9-1.x86_64.rpm + +使用下列命令安装下载的 RPM。 + + sudo rpm -ivh Vivaldi_TP3.1.0.162.9-1.i386.rpm + sudo rpm -ivh Vivaldi_TP3.1.0.162.9-1.x86_64.rpm + + +### 尾声 ### + +就是这样了,一切就绪。使用新系统吧,试试新东西。如果你找不到与你喜好的东西,linux赋予你自由修改它的权利。Fedora自带有最新的Gnome Shell作为其桌面环境,如果你觉得太臃肿而不喜欢,那么试试KDE或一些轻量级的DE,像Cinnamon、xfce之类。愿你的Fedora之旅十分开心并且没有困扰!! + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/linux-how-to/things-do-after-installing-fedora-22/ + +作者:[Jonathan DeMasi][a] +译者:[GOLinux](https://github.com/GOLinux) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://linoxide.com/author/jonathande/ +[1]:https://get.adobe.com/flashplayer/ +[2]:http://spins.fedoraproject.org/ +[3]:https://www.google.com/intl/en/chrome/browser/desktop/index.html diff --git a/translated/tech/20150528 Things To Do After Installing Fedora 22.md b/translated/tech/20150528 Things To Do After Installing Fedora 22.md deleted file mode 100644 index 172c7612ae..0000000000 --- a/translated/tech/20150528 Things To Do After Installing Fedora 22.md +++ /dev/null @@ -1,113 +0,0 @@ -安装Fedora 22后要做的事 -================================================================================ -Fedora 22,Red Hat操作系统的社区开发版的最新成员,已经于2015年5月26日发布了。这个令人神圣的Fedora发行版充斥着各种炒作和预期,Fedora 22推出了大量的重大变化。 - -就初始化进程而言,Systemd还是个新生儿,但它已经准备好替换脆弱的sysvinit这个一直是Linux生态系统一部分的模块。另外一个用户会碰到的重大改变存在于基本仓库的python版本中,这里提供了两种不同口味的python版本2.x和3.x分线,各个都有其不同的癖好和优点。所以,那些偏好2.x口味的用户可能想要安装他们喜爱的python版本。自从Fedora 18开始被打扮得更加时髦的Yum安装器也被设置来替换过时陈旧的YUM安装器后。Fedora也已最后决定,现在是时候用DNF来替换YUM了。 -### 1) 安装VLC媒体播放器 ### - -Fedora 22默认自带了媒体播放器viz gnome视频播放器(前身是totem)。如果你对此不感冒,那么我们可以跳过这一步继续往前走。但是,如果你像我一样,偏好使用最广泛的VLC,那么就去从RPMFusion仓库安装吧。安装方法如下: - - sudo dnf install vlc -y - -### 2) 配置RPMFusion仓库 ### - -正如我已经提到过的,Fedora的意识形态很是严谨,它不会自带任何非自由组件。官方仓库不会提供一些包含有非自由组件的基本软件,比如像多媒体编码。因此,安装一些第三方仓库很有必要,这些仓库会为我们提供一些基本的软件。幸运的是,RPMFusion仓库前来拯救我们了。 - - $ sudo dnf install --nogpgcheck http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-22.noarch.rpm - -### 3) 安装多媒体编码 ### - -刚刚我们说过,一些多媒体编码和插件不会随Fedora一起发送。现在,有谁想仅仅是因为专有编码而错过他们最爱的节目和电影?试试这个吧: - - $ sudo dnf install gstreamer-plugins-bad gstreamer-plugins-bad-free-extras gstreamer-plugins-ugly gstreamer-ffmpeg gstreamer1-libav gstreamer1-plugins-bad-free-extras gstreamer1-plugins-bad-freeworld gstreamer-plugins-base-tools gstreamer1-plugins-good-extras gstreamer1-plugins-ugly gstreamer1-plugins-bad-free gstreamer1-plugins-good gstreamer1-plugins-base gstreamer1 - -### 4) 更新系统 ### - -Fedora是一个尖端的发行版,因此它会持续发布更新用以修复系统中出现的错误和漏洞。因而,保持系统更新到最新,是个不错的做法。 - - $ sudo dnf update -y - -### 5) 卸载你不需要的软件 ### - -Fedora预装了一些大多数用户可以利用的包,但是对于更高级的用户,你可能意识到你并不需要它。要移除你不需要的包相当容易,只需使用以下命令——我选择卸载rhythmbox,因为我知道我不会用到它: - - $ sudo dnf remove rhythmbox - -### 6) 安装Adobe Flash ### - -我们都希望Adobe Flash不要再存在了,因为它并不被认为是最安全的,或者资源利用最好的,但是暂时先让它待着吧。Fedora 22安装Adobe Flash的唯一途径是从Adobe安装官方RPM,就像下面这样。 - -你可以从[这里][1]下载RPM。下载完后,你可以直接右击并像下面这样打开: - -![Install Adobe Flash](http://blog.linoxide.com/wp-content/uploads/2015/05/Screen-Shot-2015-05-27-at-9.50.42-PM.png) - -右击并选择“用软件安装打开” - -然后,只需在弹出窗口中点击安装: - -![Install Adobe](http://blog.linoxide.com/wp-content/uploads/2015/05/Screen-Shot-2015-05-27-at-9.51.07-PM.png) - -点击“安装”来完成从Adobe安装自定义RPM的过程 - -该过程完成后,“安装”按钮会变成“移除”,而此时安装也完成了。如果在此过程中你的浏览器开着,会提示你先把它关掉或在安装完成后重启以使修改生效。 - -### 7) 用Gnome Boxes加速虚拟机 ### - -你刚刚安装了Fedora,你也很是喜欢,但是出于某些私人原因,你也许仍然需要Windows,或者你只是想玩玩另外一个Linux发行版。不管哪种情况,你都可以使用Gnome Boxes来简单地创建一个虚拟机或使用一个live发行版,Fedora 22提供了该软件。遵循以下步骤,使用你所选的ISO来开始吧!谁知道呢,也许你可以检验一下某个[Fedora Spin][2]。 - -首先,打开Gnome Boxes,然后在顶部左边选择“新建”: - -![Add a new virtual machine (box)](http://blog.linoxide.com/wp-content/uploads/2015/05/Screen-Shot-2015-05-27-at-10.24.46-PM.png) - -点击“新建”来开始添加一个新虚拟机的进程吧。 - -接下来,点击打开文件并选择一个ISO: - -![Choose ISO](http://blog.linoxide.com/wp-content/uploads/2015/05/Screen-Shot-2015-05-27-at-10.28.44-PM.png) - -在选择选择了选择文件或ISO后,选择你的ISO。这里,我已经安装了一个Debian ISO。 - -最后,自定义VM设置或使用默认,然后点击“创建”。VM会以默认方式启动,可用的VM会在Gnome Boxes以小缩略图的方式显示。 - -![Create VM](http://blog.linoxide.com/wp-content/uploads/2015/05/Screen-Shot-2015-05-27-at-10.31.11-PM.png) - -自定义设置为你所选择的,或者也可以保持默认。完成后,点击“创建”,VM就一切就绪了。 - -### 8) 安装Google Chrome ### - -Firefox被包含在Fedora 22中,但是就跟大多数软件一样,每个人都有他们自己的选择。如果你所喜爱的浏览器恰好是Google Chrome,你可以使用和上面安装Adobe Flash Player类似的指令。然而,很明显,你得使用来自Google的任何你所下载的版本的RPM。最新的版本通常可以在[这里][3]找到。 - -### 9) 添加社交媒体和其它在线帐号 ### - -Gnome自带有不错的内建功能用于容纳帐号相关的东西,像Facebook,Google以及其它在线帐号。你可以通过主Gnome设置应用访问在线帐号设置。然后,只需点击在线帐号,并添加你所选择的帐号。如果你要添加一个帐号,比如像Google,你可以用它来作为默认帐号,用来完成诸如发送邮件、日历提醒、相片和文档交互,以及诸如此类的更多事情。 - -### 10) 安装KDE或另一个桌面环境 ### - -我们中的某些人不喜欢Gnome,那也没问题。在终端中运行以下命令来安装KDE所需的一切来替换它。这些指令也可以用以安装xfce、lxde或其它桌面环境。 - - $ sudo dnf install @kde-desktop - -安装完成后,登出。当你点击你的用户名时,注意那个表示设置的小齿轮。点击它,然后选择“Plasma”。当你再次登录时,一个全新的KDE桌面就会欢迎你。 - -![Plasma on Fedora 22](http://blog.linoxide.com/wp-content/uploads/2015/05/Screen-Shot-2015-05-27-at-11.32.27-PM.png) - -刚刚安装到Fedora 22上的Plasma环境 - -### 尾声 ### - -就是这样了,一切就绪。使用新系统吧,试试新东西。如果你找不到与你喜好相关的东西,linux赋予你自由修改它的权利。Fedora自带有最新的Gnome Shell作为其桌面环境,如果你觉得太臃肿而不喜欢,那么试试KDE或一些轻量级的DE,像Cinnamon、xfce之类。愿你的Fedora之旅十分开心并且没有困扰。!! - --------------------------------------------------------------------------------- - -via: http://linoxide.com/linux-how-to/things-do-after-installing-fedora-22/ - -作者:[Jonathan DeMasi][a] -译者:[GOLinux](https://github.com/GOLinux) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://linoxide.com/author/jonathande/ -[1]:https://get.adobe.com/flashplayer/ -[2]:http://spins.fedoraproject.org/ -[3]:https://www.google.com/intl/en/chrome/browser/desktop/index.html From e48fb59106cb00f1efcdfe1f5c381bb92f7c4056 Mon Sep 17 00:00:00 2001 From: strugglingyouth <630441839@qq.occom> Date: Sat, 13 Jun 2015 18:16:20 -0700 Subject: [PATCH 371/965] translated --- ...ry_Cache_Buffer_and_Swap_Space_on_Linux.md | 22 +------------------ 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/translated/tech/20150610_How_to_Clear_RAM_Memory_Cache_Buffer_and_Swap_Space_on_Linux.md b/translated/tech/20150610_How_to_Clear_RAM_Memory_Cache_Buffer_and_Swap_Space_on_Linux.md index 932bc11cd2..bfe689602d 100644 --- a/translated/tech/20150610_How_to_Clear_RAM_Memory_Cache_Buffer_and_Swap_Space_on_Linux.md +++ b/translated/tech/20150610_How_to_Clear_RAM_Memory_Cache_Buffer_and_Swap_Space_on_Linux.md @@ -6,17 +6,11 @@ Linux提供了一个方法来刷新或清除RAM缓存。 每一个Linux系统有三个选项来清除缓存而不中断任何进程或服务。 1,仅清除缓存页 -

 sync; echo 1 > /proc/sys/vm/drop_caches
-
2,清除目录项和inodes -

 sync; echo 2 > /proc/sys/vm/drop_caches
-
3,清除,缓存页,目录项和inodes -

 sync; echo 3 > /proc/sys/vm/drop_caches
-
上述命令的说明: sync将刷新文件系统缓存,命令通过“;”分隔,顺序执行,shell等待终止在序列中的每一个命令执行之前。正如内核文档中提到的,写到drop_cache将清空缓存而不杀死任何应用程序/服务,echo命令做写入文件的工作。 @@ -34,25 +28,17 @@ Linux被设计成它在寻找磁盘之前到磁盘缓存寻找的方式。如果 现在,我们将通过一个cron任务调度器创建一个shell脚本在每天下午2点自动清除RAM缓存。 创建一个shell脚本clearcache.sh并在其中添加以下行: -

 #!/bin/bash
 # Note, we are using "echo 3", but it is not recommended in production instead use "echo 1"
 echo "echo 3 > /proc/sys/vm/drop_caches"
-
给clearcache.sh文件设置执行权限 -

 # chmod 755 clearcache.sh
-
现在,当你需要清除RAM缓存时只需要调用脚本。 现在设置一个定时任务来清除RAM缓存每天在下午2点,打开crontab进行编辑。 -

 # crontab -e
-
添加以下行,保存并退出。 -

 0 3 * * * /path/to/clearcache.sh
-
有关如何创建一个定时任务,更多细节你可以查看我们的文章11 Cron Scheduling Jobs。 在生产环境的服务器上自动清除RAM是否是一个好主意? @@ -63,19 +49,13 @@ echo "echo 3 > /proc/sys/vm/drop_caches" 如何清除Linux的交换空间? 如果你想清除掉的空间,你可以运行下面的命令: -

 # swapoff -a && swapon -a
-
此外,了解有关风险后,您可能会将上面的命令添加到cron中。 现在,我们将上面两种命令结合成一个命令写出正确的脚本来同时清除RAM缓存和交换空间。 -

 # echo 3 > /proc/sys/vm/drop_caches && swapoff -a && swapon -a && printf '\n%s\n' 'Ram-cache and Swap Cleared'
-
或 -

 su -c 'echo 3 >/proc/sys/vm/drop_caches' && swapoff -a && swapon -a && printf '\n%s\n' 'Ram-cache and Swap Cleared'
-
在测试上面的命令之前,我们先运行“free -m” 然后执行脚本检查缓存。 Clear RAM Cache and Swap Space @@ -85,4 +65,4 @@ su -c 'echo 3 >/proc/sys/vm/drop_caches' && swapoff -a && swa via:http://www.tecmint.com/clear-ram-memory-cache-buffer-and-swap-space-on-linux/ -  \ No newline at end of file +  From e49a63beb7aed13726aa8f46951cf67668845c86 Mon Sep 17 00:00:00 2001 From: strugglingyouth <630441839@qq.occom> Date: Sat, 13 Jun 2015 19:35:13 -0700 Subject: [PATCH 372/965] translated --- ...y Cache Buffer and Swap Space on Linux.md} | 36 ++++++++++++++++--- 1 file changed, 31 insertions(+), 5 deletions(-) rename translated/tech/{20150610_How_to_Clear_RAM_Memory_Cache_Buffer_and_Swap_Space_on_Linux.md => 20150610 How to Clear RAM Memory Cache Buffer and Swap Space on Linux.md} (72%) diff --git a/translated/tech/20150610_How_to_Clear_RAM_Memory_Cache_Buffer_and_Swap_Space_on_Linux.md b/translated/tech/20150610 How to Clear RAM Memory Cache Buffer and Swap Space on Linux.md similarity index 72% rename from translated/tech/20150610_How_to_Clear_RAM_Memory_Cache_Buffer_and_Swap_Space_on_Linux.md rename to translated/tech/20150610 How to Clear RAM Memory Cache Buffer and Swap Space on Linux.md index bfe689602d..3c272cd4de 100644 --- a/translated/tech/20150610_How_to_Clear_RAM_Memory_Cache_Buffer_and_Swap_Space_on_Linux.md +++ b/translated/tech/20150610 How to Clear RAM Memory Cache Buffer and Swap Space on Linux.md @@ -1,21 +1,32 @@ -像任何其他的操作系统一样,GNU / Linux已经有效地实施了内存管理甚至更多。但是,如果有任何进程正在蚕食你的内存,你要清除它, + + #在Linux上如何清除RAM内存高速缓存,缓存和交换空间# + +像任何其他的操作系统一样,GNU / Linux已经有效地实施了内存管理甚至更多。但是,如果有任何进程正在蚕食你的内存,你要清除它, Linux提供了一个方法来刷新或清除RAM缓存。 +linux + 在Linux中如何清除缓存? 每一个Linux系统有三个选项来清除缓存而不中断任何进程或服务。 1,仅清除缓存页 +

 sync; echo 1 > /proc/sys/vm/drop_caches
+
2,清除目录项和inodes +

 sync; echo 2 > /proc/sys/vm/drop_caches
+
3,清除,缓存页,目录项和inodes +

 sync; echo 3 > /proc/sys/vm/drop_caches
+
上述命令的说明: sync将刷新文件系统缓存,命令通过“;”分隔,顺序执行,shell等待终止在序列中的每一个命令执行之前。正如内核文档中提到的,写到drop_cache将清空缓存而不杀死任何应用程序/服务,echo命令做写入文件的工作。 -如果你必须清除磁盘高速缓存,第一个命令是最安全在企业和生产环境中,“...echo 1> ...”只会清除页缓存。 +如果你必须清除磁盘高速缓存,第一个命令在企业和生产环境中是最安全,“...echo 1> ...”只会清除页缓存。 不建议使用上面第三个选项在生产环境中“...echo 3 >” ,除非你明确自己在做什么,因为它会清除缓存页,目录项和inodes。 在Linux上释放Buffer和Cache要用到内核是否是个好主意? @@ -28,17 +39,25 @@ Linux被设计成它在寻找磁盘之前到磁盘缓存寻找的方式。如果 现在,我们将通过一个cron任务调度器创建一个shell脚本在每天下午2点自动清除RAM缓存。 创建一个shell脚本clearcache.sh并在其中添加以下行: +

 #!/bin/bash
 # Note, we are using "echo 3", but it is not recommended in production instead use "echo 1"
 echo "echo 3 > /proc/sys/vm/drop_caches"
+
给clearcache.sh文件设置执行权限 +

 # chmod 755 clearcache.sh
+
现在,当你需要清除RAM缓存时只需要调用脚本。 现在设置一个定时任务来清除RAM缓存每天在下午2点,打开crontab进行编辑。 +

 # crontab -e
+
添加以下行,保存并退出。 +

 0 3 * * * /path/to/clearcache.sh
+
有关如何创建一个定时任务,更多细节你可以查看我们的文章11 Cron Scheduling Jobs。 在生产环境的服务器上自动清除RAM是否是一个好主意? @@ -49,20 +68,27 @@ echo "echo 3 > /proc/sys/vm/drop_caches" 如何清除Linux的交换空间? 如果你想清除掉的空间,你可以运行下面的命令: +

 # swapoff -a && swapon -a
+
此外,了解有关风险后,您可能会将上面的命令添加到cron中。 现在,我们将上面两种命令结合成一个命令写出正确的脚本来同时清除RAM缓存和交换空间。 +

 # echo 3 > /proc/sys/vm/drop_caches && swapoff -a && swapon -a && printf '\n%s\n' 'Ram-cache and Swap Cleared'
+
或 +

 su -c 'echo 3 >/proc/sys/vm/drop_caches' && swapoff -a && swapon -a && printf '\n%s\n' 'Ram-cache and Swap Cleared'
+
在测试上面的命令之前,我们先运行“free -m” 然后执行脚本检查缓存。 -Clear RAM Cache and Swap Space + +![](https://camo.githubusercontent.com/659439c8dbef449fa82ba64ff5a02dc0e9324017/687474703a2f2f7777772e7465636d696e742e636f6d2f77702d636f6e74656e742f75706c6f6164732f323031352f30352f436c6561722d52414d2d43616368652e676966) 就是现在,如果你喜欢这篇文章,不要忘记向我们提供您宝贵的意见, 让我们知道,您认为在企业和生产环境中清除RAM缓存和缓冲区是否是一个好主意? -via:http://www.tecmint.com/clear-ram-memory-cache-buffer-and-swap-space-on-linux/ -  + +  \ No newline at end of file From dca8c5f495bfe6d316d615eeda987219dd626164 Mon Sep 17 00:00:00 2001 From: wwy-hust Date: Sun, 14 Jun 2015 16:03:30 +0800 Subject: [PATCH 373/965] finish translation --- ...Experience on Linux 'iptables' Firewall.md | 212 ------------------ ...Experience on Linux 'iptables' Firewall.md | 205 +++++++++++++++++ 2 files changed, 205 insertions(+), 212 deletions(-) delete mode 100644 sources/tech/20150610 Nishita Agarwal Shares Her Interview Experience on Linux 'iptables' Firewall.md create mode 100644 translated/tech/20150604 Nishita Agarwal Shares Her Interview Experience on Linux 'iptables' Firewall.md diff --git a/sources/tech/20150610 Nishita Agarwal Shares Her Interview Experience on Linux 'iptables' Firewall.md b/sources/tech/20150610 Nishita Agarwal Shares Her Interview Experience on Linux 'iptables' Firewall.md deleted file mode 100644 index 455b994975..0000000000 --- a/sources/tech/20150610 Nishita Agarwal Shares Her Interview Experience on Linux 'iptables' Firewall.md +++ /dev/null @@ -1,212 +0,0 @@ -Nishita Agarwal Shares Her Interview Experience on Linux ‘iptables’ Firewall -================================================================================ -Nishita Agarwal, a frequent Tecmint Visitor shared her experience (Question and Answer) with us regarding the job interview she had just given in a privately owned hosting company in Pune, India. She was asked a lot of questions on a variety of topics however she is an expert in iptables and she wanted to share those questions and their answer (she gave) related to iptables to others who may be going to give interview in near future. - -![Linux Firewall Iptables Interview Questions](http://www.tecmint.com/wp-content/uploads/2015/05/Linux-iptables-Interview-Questions.jpg) - -All the questions and their Answer are rewritten based upon the memory of Nishita Agarwal. - -> “Hello Friends! My name is **Nishita Agarwal**. I have Pursued Bachelor Degree in Technology. My area of Specialization is UNIX and Variants of UNIX (BSD, Linux) fascinates me since the time I heard it. I have 1+ years of experience in storage. I was looking for a job change which ended with a hosting company in Pune, India.” - -Here is the collection of what I was asked during the Interview. I’ve documented only those questions and their answer that were related to iptables based upon my memory. Hope this will help you in cracking your Interview. - -**1. Have you heard of iptables and firewall in Linux? Any idea of what they are and for what it is used?** - -> **Answer** : I’ve been using iptables for quite long time and I am aware of both iptables and firewall. Iptables is an application program mostly written in C Programming Language and is released under GNU General Public License. Written for System administration point of view, the latest stable release if iptables 1.4.21.iptables may be considered as firewall for UNIX like operating system which can be called as iptables/netfilter, more accurately. The Administrator interact with iptables via console/GUI front end tools to add and define firewall rules into predefined tables. Netfilter is a module built inside of kernel that do the job of filtering. -> -> Firewalld is the latest implementation of filtering rules in RHEL/CentOS 7 (may be implemented in other distributions which I may not be aware of). It has replaced iptables interface and connects to netfilter. - -**2. Have you used some kind of GUI based front end tool for iptables or the Linux Command Line?** - -> **Answer** : Though I have used both the GUI based front end tools for iptables like Shorewall in conjugation of [Webmin][1] in GUI and Direct access to iptables via console.And I must admit that direct access to iptables via Linux console gives a user immense power in the form of higher degree of flexibility and better understanding of what is going on in the background, if not anything other. GUI is for novice administrator while console is for experienced. - -**3. What are the basic differences between between iptables and firewalld?** - -> **Answer** : iptables and firewalld serves the same purpose (Packet Filtering) but with different approach. iptables flush the entire rules set each time a change is made unlike firewalld. Typically the location of iptables configuration lies at ‘/etc/sysconfig/iptables‘ whereas firewalld configuration lies at ‘/etc/firewalld/‘, which is a set of XML files.Configuring a XML based firewalld is easier as compared to configuration of iptables, however same task can be achieved using both the packet filtering application ie., iptables and firewalld. Firewalld runs iptables under its hood along with it’s own command line interface and configuration file that is XML based and said above. - -**4. Would you replace iptables with firewalld on all your servers, if given a chance?** - -> **Answer** : I am familiar with iptables and it’s working and if there is nothing that requires dynamic aspect of firewalld, there seems no reason to migrate all my configuration from iptables to firewalld.In most of the cases, so far I have never seen iptables creating an issue. Also the general rule of Information technology says “why fix if it is not broken”. However this is my personal thought and I would never mind implementing firewalld if the Organization is going to replace iptables with firewalld. - -**5. You seems confident with iptables and the plus point is even we are using iptables on our server.** - -What are the tables used in iptables? Give a brief description of the tables used in iptables and the chains they support. - -> **Answer** : Thanks for the recognition. Moving to question part, There are four tables used in iptables, namely they are: -> -> - Nat Table -> - Mangle Table -> - Filter Table -> - Raw Table -> -> Nat Table : Nat table is primarily used for Network Address Translation. Masqueraded packets get their IP address altered as per the rules in the table. Packets in the stream traverse Nat Table only once. ie., If a packet from a jet of Packets is masqueraded they rest of the packages in the stream will not traverse through this table again. It is recommended not to filter in this table. Chains Supported by NAT Table are PREROUTING Chain, POSTROUTING Chain and OUTPUT Chain. -> -> Mangle Table : As the name suggests, this table serves for mangling the packets. It is used for Special package alteration. It can be used to alter the content of different packets and their headers. Mangle table can’t be used for Masquerading. Supported chains are PREROUTING Chain, OUTPUT Chain, Forward Chain, INPUT Chain, POSTROUTING Chain. -> -> Filter Table : Filter Table is the default table used in iptables. It is used for filtering Packets. If no rules are defined, Filter Table is taken as default table and filtering is done on the basis of this table. Supported Chains are INPUT Chain, OUTPUT Chain, FORWARD Chain. -> -> Raw Table : Raw table comes into action when we want to configure packages that were exempted earlier. It supports PREROUTING Chain and OUTPUT Chain. - -**6. What are the target values (that can be specified in target) in iptables and what they do, be brief!** - -> **Answer** : Following are the target values that we can specify in target in iptables: -> -> - ACCEPT : Accept Packets -> - QUEUE : Paas Package to user space (place where application and drivers reside) -> - DROP : Drop Packets -> - RETURN : Return Control to calling chain and stop executing next set of rules for the current Packets in the chain. - - -**7. Lets move to the technical aspects of iptables, by technical I means practical.** - -How will you Check iptables rpm that is required to install iptables in CentOS?. - -> **Answer** : iptables rpm are included in standard CentOS installation and we do not need to install it separately. We can check the rpm as: -> -> # rpm -qa iptables -> -> iptables-1.4.21-13.el7.x86_64 -> -> If you need to install it, you may do yum to get it. -> -> # yum install iptables-services - -**8. How to Check and ensure if iptables service is running?** - -> **Answer** : To check the status of iptables, you may run the following command on the terminal. -> -> # service status iptables [On CentOS 6/5] -> # systemctl status iptables [On CentOS 7] -> -> If it is not running, the below command may be executed. -> -> ---------------- On CentOS 6/5 ---------------- -> # chkconfig --level 35 iptables on -> # service iptables start -> -> ---------------- On CentOS 7 ---------------- -> # systemctl enable iptables -> # systemctl start iptables -> -> We may also check if the iptables module is loaded or not, as: -> -> # lsmod | grep ip_tables - -**9. How will you review the current Rules defined in iptables?** - -> **Answer** : The current rules in iptables can be review as simple as: -> -> # iptables -L -> -> Sample Output -> -> Chain INPUT (policy ACCEPT) -> target prot opt source destination -> ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED -> ACCEPT icmp -- anywhere anywhere -> ACCEPT all -- anywhere anywhere -> ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:ssh -> REJECT all -- anywhere anywhere reject-with icmp-host-prohibited -> -> Chain FORWARD (policy ACCEPT) -> target prot opt source destination -> REJECT all -- anywhere anywhere reject-with icmp-host-prohibited -> -> Chain OUTPUT (policy ACCEPT) -> target prot opt source destination - -**10. How will you flush all iptables rules or a particular chain?** - -> **Answer** : To flush a particular iptables chain, you may use following commands. -> -> -> # iptables --flush OUTPUT -> -> To Flush all the iptables rules. -> -> # iptables --flush - -**11. Add a rule in iptables to accept packets from a trusted IP Address (say 192.168.0.7)** - -> **Answer** : The above scenario can be achieved simply by running the below command. -> -> # iptables -A INPUT -s 192.168.0.7 -j ACCEPT -> -> We may include standard slash or subnet mask in the source as: -> -> # iptables -A INPUT -s 192.168.0.7/24 -j ACCEPT -> # iptables -A INPUT -s 192.168.0.7/255.255.255.0 -j ACCEPT - -**12. How to add rules to ACCEPT, REJECT, DENY and DROP ssh service in iptables.** - -> **Answer** : Hoping ssh is running on port 22, which is also the default port for ssh, we can add rule to iptables as: -> -> To ACCEPT tcp packets for ssh service (port 22). -> -> # iptables -A INPUT -s -p tcp --dport 22 -j ACCEPT -> -> To REJECT tcp packets for ssh service (port 22). -> -> # iptables -A INPUT -s -p tcp --dport 22 -j REJECT -> -> To DENY tcp packets for ssh service (port 22). -> -> -> # iptables -A INPUT -s -p tcp --dport 22 -j DENY -> -> To DROP tcp packets for ssh service (port 22). -> -> -> # iptables -A INPUT -s -p tcp --dport 22 -j DROP - -**13. Let me give you a scenario. Say there is a machine the local ip address of which is 192.168.0.6. You need to block connections on port 21, 22, 23, and 80 to your machine. What will you do?** - -> **Answer** : Well all I need to use is the ‘multiport‘ option with iptables followed by port numbers to be blocked and the above scenario can be achieved in a single go as. -> -> # iptables -A INPUT -s 192.168.0.6 -p tcp -m multiport --dport 21,22,23,80 -j DROP -> -> The written rules can be checked using the below command. -> -> # iptables -L -> -> Chain INPUT (policy ACCEPT) -> target prot opt source destination -> ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED -> ACCEPT icmp -- anywhere anywhere -> ACCEPT all -- anywhere anywhere -> ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:ssh -> REJECT all -- anywhere anywhere reject-with icmp-host-prohibited -> DROP tcp -- 192.168.0.6 anywhere multiport dports ssh,telnet,http,webcache -> -> Chain FORWARD (policy ACCEPT) -> target prot opt source destination -> REJECT all -- anywhere anywhere reject-with icmp-host-prohibited -> -> Chain OUTPUT (policy ACCEPT) -> target prot opt source destination - -**Interviewer** : That’s all I wanted to ask. You are a valuable employee we won’t like to miss. I will recommend your name to the HR. If you have any question you may ask me. - -As a candidate I don’t wanted to kill the conversation hence keep asking about the projects I would be handling if selected and what are the other openings in the company. Not to mention HR round was not difficult to crack and I got the opportunity. - -Also I would like to thank Avishek and Ravi (whom I am a friend since long) for taking the time to document my interview. - -Friends! If you had given any such interview and you would like to share your interview experience to millions of Tecmint readers around the globe? then send your questions and answers to admin@tecmint.com or you may submit your interview experience using following form. - -- [Share Your Interview Experience][2] - -Thank you! Keep Connected. Also let me know if I could have answered a question more correctly than what I did. - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/linux-firewall-iptables-interview-questions-and-answers/ - -作者:[Avishek Kumar][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.tecmint.com/author/avishek/ -[1]:http://www.tecmint.com/install-webmin-web-based-system-administration-tool-for-rhel-centos-fedora/ -[2]:https://docs.google.com/a/tecmint.com/forms/d/1jfu1Kg8_qToqvyi6pOT1HQb0dAFvRE-Yc_aOkj0RoSg/viewform \ No newline at end of file diff --git a/translated/tech/20150604 Nishita Agarwal Shares Her Interview Experience on Linux 'iptables' Firewall.md b/translated/tech/20150604 Nishita Agarwal Shares Her Interview Experience on Linux 'iptables' Firewall.md new file mode 100644 index 0000000000..270f823b59 --- /dev/null +++ b/translated/tech/20150604 Nishita Agarwal Shares Her Interview Experience on Linux 'iptables' Firewall.md @@ -0,0 +1,205 @@ +Nishita Agarwal分享它关于Linux防火墙'iptables'的面试经验 +================================================================================ +Nishita Agarwal是Tecmint的用户,她将分享关于她刚刚经历的一家公司(私人公司Pune,印度)的面试经验。在面试中她被问及许多不同的问题,但她是iptables方面的专家,因此她想分享这些关于iptables的问题和相应的答案给那些以后可能会进行相关面试的人。 + +![Linux防火墙Iptables面试问题](http://www.tecmint.com/wp-content/uploads/2015/05/Linux-iptables-Interview-Questions.jpg) + +所有的问题和相应的答案都基于Nishita Agarwal的记忆并经过了重写。 + +> “嗨,朋友!我叫**Nishita Agarwal**。我已经取得了理学学士学位,我的专业集中在UNIX和它的变种(BSD,Linux)。它们一直深深的吸引着我。我在存储方面有1年多的经验。我正在寻求职业上的变化,并将供职于印度的Pune公司。” + +下面是我在面试中被问到的问题的集合。我已经把我记忆中有关iptables的问题和它们的答案记录了下来。希望这会对您未来的面试有所帮助。 + +### 1. 你听说过Linux下面的iptables和Firewalld么?知不知道它们是什么,是用来干什么的? ### + +> **答案** : iptables和Firewalld我都知道,并且我已经使用iptables好一段时间了。iptables主要由C语言写成,并且以GNU GPL许可证发布。它是从系统管理员的角度写的,最新的稳定版是iptables 1.4.21。iptables通常被认为是类UNIX系统中的防火墙,更准确的说,可以称为iptables/netfilter。管理员通过终端/GUI工具与iptables打交道,来添加和定义防火墙规则到预定义的表中。Netfilter是内核中的一个模块,它执行过滤的任务。 +> +> Firewalld是RHEL/CentOS 7(也许还有其他发行版,但我不太清楚)中最新的过滤规则的实现。它已经取代了iptables接口,并与netfilter相连接。 + +### 2. 你用过一些iptables的GUI或命令行工具么? ### + +> **答案** : 虽然我既用过GUI工具,比如与[Webmin][1]结合的Shorewall;以及直接通过终端访问iptables。但我必须承认通过Linux终端直接访问iptables能给予用户更高级的灵活性、以及对其背后工作更好的理解的能力。GUI适合初级管理员而终端适合有经验的管理员。 + +### 3. 那么iptables和firewalld的基本区别是什么呢? ### + +> **答案** : iptables和firewalld都有着同样的目的(包过滤),但它们使用不同的方式。iptables与firewalld不同,在每次发生更改时都刷新整个规则集。通常iptables配置文件位于‘/etc/sysconfig/iptables‘,而firewalld的配置文件位于‘/etc/firewalld/‘。firewalld的配置文件是一组XML文件。以XML为基础进行配置的firewalld比iptables的配置更加容易,但是两者都可以完成同样的任务。例如,firewalld可以在自己的命令行界面以及基于XML的配置文件下使用iptables。 + +### 4. 如果有机会的话,你会在你所有的服务器上用firewalld替换iptables么? ### + +> **答案** : 我对iptables很熟悉,它也工作的很好。如果没有任何需求需要firewalld的动态特性,那么没有理由把所有的配置都从iptables移动到firewalld。通常情况下,目前为止,我还没有看到iptables造成什么麻烦。IT技术的通用准则也说道“为什么要修一件没有坏的东西呢?”。上面是我自己的想法,但如果组织愿意用firewalld替换iptables的话,我不介意。 + +### 5. 你看上去对iptables很有信心,巧的是,我们的服务器也在使用iptables。 ### + +iptables使用的表有哪些?请简要的描述iptables使用的表以及它们所支持的链。 + +> **答案** : 谢谢您的赞赏。至于您问的问题,iptables使用的表有四个,它们是: +> +> Nat 表 +> Mangle 表 +> Filter 表 +> Raw 表 +> +> Nat表 : Nat表主要用于网络地址转换。根据表中的每一条规则修改网络包的IP地址。流中的包仅遍历一遍Nat表。例如,如果一个通过某个接口的包被修饰(修改了IP地址),该流中其余的包将不再遍历这个表。通常不建议在这个表中进行过滤,由NAT表支持的链称为PREROUTING Chain,POSTROUTING Chain和OUTPUT Chain。 +> +> Mangle表 : 正如它的名字一样,这个表用于校正网络包。它用来对特殊的包进行修改。它能够修改不同包的头部和内容。Mangle表不能用于地址伪装。支持的链包括PREROUTING Chain,OUTPUT Chain,Forward Chain,InputChain和POSTROUTING Chain。 +> +> Filter表 : Filter表是iptables中使用的默认表,它用来过滤网络包。如果没有定义任何规则,Filter表则被当作默认的表,并且基于它来过滤。支持的链有INPUT Chain,OUTPUT Chain,FORWARD Chain。 +> +> Raw表 : Raw表在我们想要配置之前被豁免的包时被使用。它支持PREROUTING Chain 和OUTPUT Chain。 + +### 6. 简要谈谈什么是iptables中的目标值(能被指定为目标),他们有什么用 ### + +> **答案** : 下面是在iptables中可以指定为目标的值: +> +> ACCEPT : 接受包 +> QUEUE : 将包传递到用户空间 (应用程序和驱动所在的地方) +> DROP : 丢弃包 +> RETURN : 将控制权交回调用的链并且为当前链中的包停止执行下一调规则 + +### 7. 让我们来谈谈iptables技术方面的东西,我的意思是说实际使用方面 ### + +你怎么检测在CentOS中安装iptables时需要的iptables的rpm? + +> **答案** : iptables已经被默认安装在CentOS中,我们不需要单独安装它。但可以这样检测rpm: +> +> # rpm -qa iptables +> +> iptables-1.4.21-13.el7.x86_64 +> +> 如果您需要安装它,您可以用yum来安装。 +> +> # yum install iptables-services + +### 8. 怎样检测并且确保iptables服务正在运行? ### + +> **答案** : 您可以在终端中运行下面的命令来检测iptables的状态。 +> +> # service status iptables [On CentOS 6/5] +> # systemctl status iptables [On CentOS 7] +> +> 如果iptables没有在运行,可以使用下面的语句 +> +> ---------------- 在CentOS 6/5下 ---------------- +> # chkconfig --level 35 iptables on +> # service iptables start +> +> ---------------- 在CentOS 7下 ---------------- +> # systemctl enable iptables +> # systemctl start iptables +> +> 我们还可以检测iptables的模块是否被加载: +> +> # lsmod | grep ip_tables + +### 9. 你怎么检查iptables中当前定义的规则呢? ### + +> **答案** : 当前的规则可以简单的用下面的命令查看: +> +> # iptables -L +> +> 示例输出 +> +> Chain INPUT (policy ACCEPT) +> target prot opt source destination +> ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED +> ACCEPT icmp -- anywhere anywhere +> ACCEPT all -- anywhere anywhere +> ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:ssh +> REJECT all -- anywhere anywhere reject-with icmp-host-prohibited +> +> Chain FORWARD (policy ACCEPT) +> target prot opt source destination +> REJECT all -- anywhere anywhere reject-with icmp-host-prohibited +> +> Chain OUTPUT (policy ACCEPT) +> target prot opt source destination + +### 10. 你怎样刷新所有的iptables规则或者特定的链呢? ### + +> **答案** : 您可以使用下面的命令来刷新一个特定的链。 +> +> # iptables --flush OUTPUT +> +> 要刷新所有的规则,可以用: +> +> # iptables --flush + +### 11. 请在iptables中添加一条规则,接受所有从一个信任的IP地址(例如,192.168.0.7)过来的包。 ### + +> **答案** : 上面的场景可以通过运行下面的命令来完成。 +> +> # iptables -A INPUT -s 192.168.0.7 -j ACCEPT +> +> 我们还可以在源IP中使用标准的斜线和子网掩码: +> +> # iptables -A INPUT -s 192.168.0.7/24 -j ACCEPT +> # iptables -A INPUT -s 192.168.0.7/255.255.255.0 -j ACCEPT + +### 12. 怎样在iptables中添加规则以ACCEPT,REJECT,DENY和DROP ssh的服务? ### + +> **答案** : 但愿ssh运行在22端口,那也是ssh的默认端口,我们可以在iptables中添加规则来ACCEPT ssh的tcp包(在22号端口上)。 +> +> # iptables -A INPUT -s -p tcp - -dport -j ACCEPT +> +> REJECT ssh服务(22号端口)的tcp包。 +> +> # iptables -A INPUT -s -p tcp - -dport -j REJECT +> +> DENY ssh服务(22号端口)的tcp包。 +> +> +> # iptables -A INPUT -s -p tcp - -dport -j DENY +> +> DROP ssh服务(22号端口)的tcp包。 +> +> +> # iptables -A INPUT -s -p tcp - -dport -j DROP + +### 13. 让我给你另一个场景,假如有一台电脑的本地IP地址是192.168.0.6。你需要封锁在21、22、23和80号端口上的连接,你会怎么做? ### + +> **答案** : 这时,我所需要的就是在iptables中使用‘multiport‘选项,并将要封锁的端口号跟在它后面。上面的场景可以用下面的一条语句搞定: +> +> # iptables -A INPUT -s 192.168.0.6 -p tcp -m multiport --dport 22,23,80,8080 -j DROP +> +> 可以用下面的语句查看写入的规则。 +> +> # iptables -L +> +> Chain INPUT (policy ACCEPT) +> target prot opt source destination +> ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED +> ACCEPT icmp -- anywhere anywhere +> ACCEPT all -- anywhere anywhere +> ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:ssh +> REJECT all -- anywhere anywhere reject-with icmp-host-prohibited +> DROP tcp -- 192.168.0.6 anywhere multiport dports ssh,telnet,http,webcache +> +> Chain FORWARD (policy ACCEPT) +> target prot opt source destination +> REJECT all -- anywhere anywhere reject-with icmp-host-prohibited +> +> Chain OUTPUT (policy ACCEPT) +> target prot opt source destination + +**面试官** : 好了,我问的就是这些。你是一个很有价值的雇员,我们不会错过你的。我将会向HR推荐你的名字。如果你有什么问题,请问我。 + +作为一个候选人我不愿不断的问将来要做的项目的事以及公司里其他的事,这样会打断愉快的对话。更不用说HR轮会不会比较难,总之,我获得了机会。 + +同时我要感谢Avishek和Ravi(我的朋友)花时间帮我整理我的面试。 + +朋友!如果您有过类似的面试,并且愿意与数百万Tecmint读者一起分享您的面试经历,请将您的问题和答案发送到admin@tecmint.com。 + +谢谢!保持联系。如果我能更好的回答我上面的问题的话,请记得告诉我。 + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/linux-firewall-iptables-interview-questions-and-answers/ + +作者:[Avishek Kumar][a] +译者:[wwy-hust](https://github.com/wwy-hust) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/avishek/ +[1]:http://www.tecmint.com/install-webmin-web-based-system-administration-tool-for-rhel-centos-fedora/ From 15819076b20966bf4d27f7e839224da398fefb96 Mon Sep 17 00:00:00 2001 From: wwy-hust Date: Sun, 14 Jun 2015 16:06:30 +0800 Subject: [PATCH 374/965] fix some errors --- ...r Interview Experience on Linux 'iptables' Firewall.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/translated/tech/20150604 Nishita Agarwal Shares Her Interview Experience on Linux 'iptables' Firewall.md b/translated/tech/20150604 Nishita Agarwal Shares Her Interview Experience on Linux 'iptables' Firewall.md index 270f823b59..1d476d0f18 100644 --- a/translated/tech/20150604 Nishita Agarwal Shares Her Interview Experience on Linux 'iptables' Firewall.md +++ b/translated/tech/20150604 Nishita Agarwal Shares Her Interview Experience on Linux 'iptables' Firewall.md @@ -139,21 +139,21 @@ iptables使用的表有哪些?请简要的描述iptables使用的表以及它 > **答案** : 但愿ssh运行在22端口,那也是ssh的默认端口,我们可以在iptables中添加规则来ACCEPT ssh的tcp包(在22号端口上)。 > -> # iptables -A INPUT -s -p tcp - -dport -j ACCEPT +> # iptables -A INPUT -s -p tcp --dport 22 -j ACCEPT > > REJECT ssh服务(22号端口)的tcp包。 > -> # iptables -A INPUT -s -p tcp - -dport -j REJECT +> # iptables -A INPUT -s -p tcp --dport 22 -j REJECT > > DENY ssh服务(22号端口)的tcp包。 > > -> # iptables -A INPUT -s -p tcp - -dport -j DENY +> # iptables -A INPUT -s -p tcp --dport 22 -j DENY > > DROP ssh服务(22号端口)的tcp包。 > > -> # iptables -A INPUT -s -p tcp - -dport -j DROP +> # iptables -A INPUT -s -p tcp --dport 22 -j DROP ### 13. 让我给你另一个场景,假如有一台电脑的本地IP地址是192.168.0.6。你需要封锁在21、22、23和80号端口上的连接,你会怎么做? ### From 2e97021d8247f0ae832caac9e14cb6cfb2d17708 Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 14 Jun 2015 21:23:25 +0800 Subject: [PATCH 375/965] PUB:20150316 How to Test Your Internet Speed Bidirectionally from Command Line Using 'Speedtest-CLI' Tool @NearTan --- ...Command Line Using 'Speedtest-CLI' Tool.md | 85 ++++--------------- 1 file changed, 16 insertions(+), 69 deletions(-) rename {translated/tech => published}/20150316 How to Test Your Internet Speed Bidirectionally from Command Line Using 'Speedtest-CLI' Tool.md (85%) diff --git a/translated/tech/20150316 How to Test Your Internet Speed Bidirectionally from Command Line Using 'Speedtest-CLI' Tool.md b/published/20150316 How to Test Your Internet Speed Bidirectionally from Command Line Using 'Speedtest-CLI' Tool.md similarity index 85% rename from translated/tech/20150316 How to Test Your Internet Speed Bidirectionally from Command Line Using 'Speedtest-CLI' Tool.md rename to published/20150316 How to Test Your Internet Speed Bidirectionally from Command Line Using 'Speedtest-CLI' Tool.md index 9b4c2ae075..462c647ac8 100644 --- a/translated/tech/20150316 How to Test Your Internet Speed Bidirectionally from Command Line Using 'Speedtest-CLI' Tool.md +++ b/published/20150316 How to Test Your Internet Speed Bidirectionally from Command Line Using 'Speedtest-CLI' Tool.md @@ -1,186 +1,133 @@ - - 用命令行工具Speedtest-CLI来测试你的上下行网速 ================================================================================ 我们经常需要到检查家里与办公室之间的网络是否连通,那么我们要怎么做呢?打开网站Speedtest.net然后开始测试。网站是通过加载浏览器中的JavaScript脚本然后选择最佳的服务器测速然后用Flash产生图形化的结果。 - 那么远程服务器呢?要知道大多数远程服务器是没有浏览器可以打开web页面的。用浏览器打开网页测速的瓶颈就在此,你不能按计划的对服务器进行定期的常规测试。这时需要到一个名为Speedtest-cli的软件来打破这个瓶颈,它能让你通过命令行来测试互联网连接的速度。 - #### Speedtest-cli是什么 #### - 此程序是基于Python开发的脚本程序,利用了speedtest.net的服务来测量出上下行的宽带。Speedtest-cli能根据机房离测速服务器的物理距离来列出测速服务器,或者针对某一服务器进行测速,同时还能为你生成一个URL以便你分享你的测速结果。 - 要在Linux上安装最新版本的speedtest-cli,你必须安装2.4-3.4或者更高版本的Python。 - ### 在Linux上安装speedtest-cli ### - 有两种方法可以安装speedtest-cli。第一种方法需要用到`python-pip`包管理器,第二种方法需要安装Python脚本,生成安装文件然后运行,这里我们分别介绍两种方法: - #### 使用pythin-pip安装speedtest-cli#### - 首先你需要安装`python-pip`包管理器,之后你就可以用pip命令来安装speedtest-cli $ sudo apt-get install python-pip $ sudo pip install speedtest-cli - -如果要吧speedtest-cli升级至最新版本,你需要输入以下命令 +如果要把speedtest-cli升级至最新版本,你需要输入以下命令 $ sudo pip install speedtest-cli --upgrade - #### 通过Pyhton脚本来安装speedtest-cli #### - 首先要用wget命令从github上下来Python脚本,然后解压提取下载的文件(master.zip) $ wget https://github.com/sivel/speedtest-cli/archive/master.zip $ unzip master.zip - 提取出文件后,进入提取出的目录`speedtest-cli-master`然后使脚本可以执行。 $ cd speedtest-cli-master/ $ chmod 755 speedtest_cli.py - 下一步,把可执行的脚本移动到`/usr/bin`文件夹,这样你就不用每次都输入完整的脚本路径了。 $ sudo mv speedtest_cli.py /usr/bin/ - ### 用speedtest-cli测试互联网连通速度### - **1. 要测试你的下载与上传速度,只需要运行`speedtest-cli`命令,不需要带参数。** $ speedtest_cli.py -
![Test Download Upload Speed in Linux](http://www.tecmint.com/wp-content/uploads/2015/03/Test-Download-Upload-Speed-in-Linux1.png) -在Linux下测试上传下载速度 -
+*在Linux下测试上传下载速度* - -**2. 测试上传下载bytes的速度** +**2. 测试上传下载的速度(以字节计算)** $ speedtest_cli.py --bytes -
![Test Internet Speed in Bytes](http://www.tecmint.com/wp-content/uploads/2015/03/Test-Speed-in-Bytes.png) -测试bytes的速度 -
- +*测试bytes的速度* **3. 工具提供一个链接来下载由你的宽带测试结果生成的图片,你可以分享给你的家人朋友。** -
![Share Internet Speed Results](http://www.tecmint.com/wp-content/uploads/2015/03/Share-Internet-Speed-Results.png) -分享测速结果 -
- +*分享测速结果* 下面的图片就是你通过以上的命令行测速而生成的图片 -
![Speed Test Results](http://www.tecmint.com/wp-content/uploads/2015/03/Speed-Test-Results.png) -测速结果 -
+*测速结果* **4.如果你仅仅需要Ping,上传,下载的结果,就运行以下命令:** $ speedtest_cli.py --simple -
![Test Ping Download Upload Speed](http://www.tecmint.com/wp-content/uploads/2015/03/Test-Ping-Download-Upload-Speed1.png) -测试Ping,上传,下载的速度 -
- - - - +*测试Ping,上传,下载的速度* **5. 列出`speedtest.net`所有的服务器距离你的物理距离,单位是千米(km)** - $ speedtest_cli.py --list -
![Check Speedtest.net Servers](http://www.tecmint.com/wp-content/uploads/2015/03/Check-Speedtest-Servers.png) -列出Speedtest.net的服务器 -
- +*列出Speedtest.net的服务器* **6. 当获得一个非常长的服务器列表之后,怎么列出我想要的某个服务器?如果我要在speedtest.net服务器列表中找出位于Mumbai(印度)的服务器呢?** $ speedtest_cli.py --list | grep -i Mumbai -
![Check Nearest Server](http://www.tecmint.com/wp-content/uploads/2015/03/Check-Nearest-Server.png) -列出最近的服务器 -
- +*列出最近的服务器* **7. 对指定的服务器进行测速。我们使用上面例子5和例子6中获取的服务器ID:** $ speedtest_cli.py --server [server ID] - $ speedtest_cli.py --server [5060] ## Here server ID 5060 is used in the example. $ speedtest_cli.py --server [5060] ## 这里使用服务器ID为5060作为例子 -
![Test Connection Against Server](http://www.tecmint.com/wp-content/uploads/2015/03/Test-Connection-Against-Server.png) -对指定的服务器进行测速 -
- +*对指定的服务器进行测速* **8. 输出`speedtest-cli`的版本信息和帮助文档** $ speedtest_cli.py --version -
![Check SpeedCli Version](http://www.tecmint.com/wp-content/uploads/2015/03/Check-SpeedCLi-Version.png) -输出版本号 -
+*输出版本号* $ speedtest_cli.py --help -
+ ![SpeedCli Help](http://www.tecmint.com/wp-content/uploads/2015/03/SpeedCli-Help.png) -输出帮助文档 -
- +*输出帮助文档* **提醒:**报告中的延迟并不是确切的结果,不应该过于依赖它;这个数值可以当作相对延迟,这对你选择某一测试服务器来说是可靠的。同时,CPU和内存的容量会影响结果的准确度。 - ### 结论 ### - -系统管理员和开发者应该必备这个简单的脚本工具,这个工具轻量级,功能齐全,真是太赞了。我不喜欢Speedtest.net的原因是它使用来flash,相反speedtest-cli刚好戳中了我的痛点。 - +系统管理员和开发者应该必备这个简单的脚本工具,这个轻量级的工具功能齐全,真是太赞了。我不喜欢Speedtest.net的原因是它使用来flash,相反speedtest-cli刚好戳中了我的痛点。 speedtest_cli是一个第三方工具,也不能自动地记录下宽带速度。Speedtest.net拥有上百万的用户,你可以自己[配制一个小型的测速服务器][1]。 - -上面就是所有内容,更多内容敬请关注Tecmint。如果你有任何反馈记得在文章下方评论,如果你喜欢别忘了给我们点歌赞,分享我们的文章。 +上面就是所有内容,更多内容敬请关注我们。如果你有任何反馈记得在文章下方评论,如果你喜欢别忘了给我们点个赞,分享我们的文章。 -------------------------------------------------------------------------------- @@ -188,7 +135,7 @@ via: http://www.tecmint.com/check-internet-speed-from-command-line-in-linux/ 作者:[Avishek Kumar][a] 译者:[NearTan](https://github.com/NearTan) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 From eb8f276ab1960e2edc873010cf5a8c9f75ec3dc8 Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 14 Jun 2015 22:37:08 +0800 Subject: [PATCH 376/965] PUB:20150610 How to Clear RAM Memory Cache Buffer and Swap Space on Linux @strugglingyouth --- ...ry Cache Buffer and Swap Space on Linux.md | 106 ++++++++++++++++++ ...ry Cache Buffer and Swap Space on Linux.md | 94 ---------------- 2 files changed, 106 insertions(+), 94 deletions(-) create mode 100644 published/20150610 How to Clear RAM Memory Cache Buffer and Swap Space on Linux.md delete mode 100644 translated/tech/20150610 How to Clear RAM Memory Cache Buffer and Swap Space on Linux.md diff --git a/published/20150610 How to Clear RAM Memory Cache Buffer and Swap Space on Linux.md b/published/20150610 How to Clear RAM Memory Cache Buffer and Swap Space on Linux.md new file mode 100644 index 0000000000..2007daec95 --- /dev/null +++ b/published/20150610 How to Clear RAM Memory Cache Buffer and Swap Space on Linux.md @@ -0,0 +1,106 @@ +在Linux上如何清除内存的 Cache、Buffer 和交换空间 +============================================ + +像任何其他的操作系统一样,GNU/Linux 已经实现的内存管理不仅有效,而且更好。但是,如果有任何进程正在蚕食你的内存,而你想要清除它的话,Linux 提供了一个刷新或清除RAM缓存方法。 + +![Clear RAM Cache and Swap in Linux](http://www.tecmint.com/wp-content/uploads/2015/05/Clear-RAM-Cache-in-Linux.jpg) + +### 如何在 Linux 中清除缓存(Cache)?### + +每个 Linux 系统有三种选项来清除缓存而不需要中断任何进程或服务。 + +(LCTT 译注:Cache,译作“缓存”,指 CPU 和内存之间高速缓存。Buffer,译作“缓冲区”,指在写入磁盘前的存储再内存中的内容。在本文中,Buffer 和 Cache 有时候会通指。) + +1. 仅清除页面缓存(PageCache) + + # sync; echo 1 > /proc/sys/vm/drop_caches + +2. 清除目录项和inode + + # sync; echo 2 > /proc/sys/vm/drop_caches + +3. 清除页面缓存,目录项和inode + + # sync; echo 3 > /proc/sys/vm/drop_caches + + +上述命令的说明: + +sync 将刷新文件系统缓冲区(buffer),命令通过“;”分隔,顺序执行,shell在执行序列中的下一个命令之前会等待命令的终止。正如内核文档中提到的,写入到drop_cache将清空缓存而不会杀死任何应用程序/服务,[echo命令][1]做写入文件的工作。 + +如果你必须清除磁盘高速缓存,第一个命令在企业和生产环境中是最安全,`"...echo 1> ..."`只会清除页面缓存。 +在生产环境中不建议使用上面的第三个选项`"...echo 3 > ..."` ,除非你明确自己在做什么,因为它会清除缓存页,目录项和inodes。 + +**在Linux上释放也许被内核所使用的缓冲区(Buffer)和缓存(Cache)是否是个好主意?** + +当你设置许多设定想要检查效果时,如果它实际上是专门针对 I/O 范围的基准测试,那么你可能需要清除缓冲区和缓存。你可以如上所示删除缓存,无需重新启动系统(即无需停机)。 + +Linux被设计成它在寻找磁盘之前到磁盘缓存寻找的方式。如果它发现该资源在缓存中,则该请求不会发送到磁盘。如果我们清理缓存,磁盘缓存就起不到作用了,系统会到磁盘上寻找资源。 + +此外,当清除缓存后它也将减慢系统运行速度,系统会将每一个被请求的资源再次加载到磁盘缓存中。 + + +现在,我们将创建一个 shell 脚本,通过一个 cron 调度任务在每天下午2点自动清除RAM缓存。如下创建一个 shell 脚本 clearcache.sh 并在其中添加以下行: + + #!/bin/bash + # 注意,我们这里使用了 "echo 3",但是不推荐使用在产品环境中,应该使用 "echo 1" + echo "echo 3 > /proc/sys/vm/drop_caches" + +给clearcache.sh文件设置执行权限 + + # chmod 755 clearcache.sh + +现在,当你需要清除内存缓存时只需要调用脚本。 + +现在设置一个每天下午2点的定时任务来清除RAM缓存,打开crontab进行编辑。 + + # crontab -e + +添加以下行,保存并退出。 + + 0 3 * * * /path/to/clearcache.sh + +有关如何创建一个定时任务,更多细节你可以查看我们的文章 [11 个定时调度任务的例子][2]。 + +**在生产环境的服务器上自动清除RAM是否是一个好主意?** + +不!它不是。想想一个情况,当你已经预定脚本在每天下午2点来清除内存缓存。那么其时该脚本会执行并刷新你的内存缓存。在某一天由于某些原因,可能您的网站的在线用户会超过预期地从你的服务器请求资源。 + + +而在这时,按计划调度的脚本运行了,并清除了缓存中的一切。当所有的用户都从磁盘读取数据时,这将导致服务器崩溃并损坏数据库。因此,清除缓存仅在必要时并且在你的预料之中,否则你就是个呆瓜系统管理员。 + +###如何清除Linux的交换空间?### + +如果你想清除掉的空间,你可以运行下面的命令: + + # swapoff -a && swapon -a + +此外,了解有关风险后,您可以将上面的命令添加到cron中。 + +现在,我们将上面两种命令结合成一个命令,写成正确的脚本来同时清除RAM缓存和交换空间。 + + # echo 3 > /proc/sys/vm/drop_caches && swapoff -a && swapon -a && printf '\n%s\n' 'Ram-cache and Swap Cleared' + +或 + + su -c 'echo 3 > /proc/sys/vm/drop_caches' && swapoff -a && swapon -a && printf '\n%s\n' 'Ram-cache and Swap Cleared' + +在测试上面的命令之前,我们在执行脚本前后运行“free -m” 来检查缓存。 + +![Clear RAM Cache and Swap Space](http://www.tecmint.com/wp-content/uploads/2015/05/Clear-RAM-Cache.gif) + +就是这样,如果你喜欢这篇文章,不要忘记向我们提供您宝贵的意见,让我们知道,您认为在企业和生产环境中清除内存缓存和缓冲区是否是一个好主意? + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/clear-ram-memory-cache-buffer-and-swap-space-on-linux/ + +作者:[Avishek Kumar][a] +译者:[strugglingyouth](https://github.com/strugglingyouth) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/avishek/ +[1]:https://linux.cn/article-3592-1.html +[2]:http://www.tecmint.com/11-cron-scheduling-task-examples-in-linux/ \ No newline at end of file diff --git a/translated/tech/20150610 How to Clear RAM Memory Cache Buffer and Swap Space on Linux.md b/translated/tech/20150610 How to Clear RAM Memory Cache Buffer and Swap Space on Linux.md deleted file mode 100644 index 3c272cd4de..0000000000 --- a/translated/tech/20150610 How to Clear RAM Memory Cache Buffer and Swap Space on Linux.md +++ /dev/null @@ -1,94 +0,0 @@ - - #在Linux上如何清除RAM内存高速缓存,缓存和交换空间# - -像任何其他的操作系统一样,GNU / Linux已经有效地实施了内存管理甚至更多。但是,如果有任何进程正在蚕食你的内存,你要清除它, -Linux提供了一个方法来刷新或清除RAM缓存。 - -linux - -在Linux中如何清除缓存? - -每一个Linux系统有三个选项来清除缓存而不中断任何进程或服务。 - -1,仅清除缓存页 -

-sync; echo 1 > /proc/sys/vm/drop_caches
-
-2,清除目录项和inodes -

-sync; echo 2 > /proc/sys/vm/drop_caches
-
-3,清除,缓存页,目录项和inodes -

-sync; echo 3 > /proc/sys/vm/drop_caches
-
-上述命令的说明: - -sync将刷新文件系统缓存,命令通过“;”分隔,顺序执行,shell等待终止在序列中的每一个命令执行之前。正如内核文档中提到的,写到drop_cache将清空缓存而不杀死任何应用程序/服务,echo命令做写入文件的工作。 - -如果你必须清除磁盘高速缓存,第一个命令在企业和生产环境中是最安全,“...echo 1> ...”只会清除页缓存。 -不建议使用上面第三个选项在生产环境中“...echo 3 >” ,除非你明确自己在做什么,因为它会清除缓存页,目录项和inodes。 - -在Linux上释放Buffer和Cache要用到内核是否是个好主意? - -当你请求许多设定想要检查时,如果它实际上是专门实施对I/O 广泛的基准测试,那么你可能需要清除缓存。你可以如上所示删除缓存,无需重新启动系统即无需停机。 - -Linux被设计成它在寻找磁盘之前到磁盘缓存寻找的方式。如果它发现该资源在缓存中,则该请求不到达磁盘。如果我们清理缓存,磁盘缓存将没有用处,系统会到磁盘上寻找资源。 - -此外,当清除缓存后它也将减慢系统运行速度,系统会重新加载每一个被请求的资源再次到磁盘缓存中。 - -现在,我们将通过一个cron任务调度器创建一个shell脚本在每天下午2点自动清除RAM缓存。 -创建一个shell脚本clearcache.sh并在其中添加以下行: -

-#!/bin/bash
-# Note, we are using "echo 3", but it is not recommended in production instead use "echo 1"
-echo "echo 3 > /proc/sys/vm/drop_caches"
-
-给clearcache.sh文件设置执行权限 -

-# chmod 755 clearcache.sh
-
-现在,当你需要清除RAM缓存时只需要调用脚本。 - -现在设置一个定时任务来清除RAM缓存每天在下午2点,打开crontab进行编辑。 -

-# crontab -e
-
-添加以下行,保存并退出。 -

-0 3 * * * /path/to/clearcache.sh
-
-有关如何创建一个定时任务,更多细节你可以查看我们的文章11 Cron Scheduling Jobs。 - -在生产环境的服务器上自动清除RAM是否是一个好主意? - -不!它不是。想想一个情况,当你已经预定脚本来清除RAM缓存每天在下午2点。每天下午2点该脚本会执行并刷新你的RAM缓存。在一天中的任何时候,您网站用户的在线量可能会超过预期的,并从你的服务器请求资源。同时调度器运行着脚本,并在高速缓存中清除一切。当所有的用户都从磁盘读取数据时,这将导致服务器崩溃并损坏数据库。 -因此,清除缓存仅在必要时并且在你的预料之中,否则你就是个Cargo Cult System Administrator。 - -如何清除Linux的交换空间? - -如果你想清除掉的空间,你可以运行下面的命令: -

-# swapoff -a && swapon -a
-
-此外,了解有关风险后,您可能会将上面的命令添加到cron中。 - -现在,我们将上面两种命令结合成一个命令写出正确的脚本来同时清除RAM缓存和交换空间。 -

-# echo 3 > /proc/sys/vm/drop_caches && swapoff -a && swapon -a && printf '\n%s\n' 'Ram-cache and Swap Cleared'
-
-或 -

-su -c 'echo 3 >/proc/sys/vm/drop_caches' && swapoff -a && swapon -a && printf '\n%s\n' 'Ram-cache and Swap Cleared'
-
-在测试上面的命令之前,我们先运行“free -m” 然后执行脚本检查缓存。 - - -![](https://camo.githubusercontent.com/659439c8dbef449fa82ba64ff5a02dc0e9324017/687474703a2f2f7777772e7465636d696e742e636f6d2f77702d636f6e74656e742f75706c6f6164732f323031352f30352f436c6561722d52414d2d43616368652e676966) - -就是现在,如果你喜欢这篇文章,不要忘记向我们提供您宝贵的意见, -让我们知道,您认为在企业和生产环境中清除RAM缓存和缓冲区是否是一个好主意? - - - -  \ No newline at end of file From 55e4b621c8b0bfbdc271efff112a85fd42fcb9b2 Mon Sep 17 00:00:00 2001 From: joeren Date: Mon, 15 Jun 2015 07:58:10 +0800 Subject: [PATCH 377/965] Update 20150225 How to make remote incremental backup of LUKS-encrypted disk or partition.md --- ...e incremental backup of LUKS-encrypted disk or partition.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150225 How to make remote incremental backup of LUKS-encrypted disk or partition.md b/sources/tech/20150225 How to make remote incremental backup of LUKS-encrypted disk or partition.md index 64e872c4b7..ee43b08c2a 100644 --- a/sources/tech/20150225 How to make remote incremental backup of LUKS-encrypted disk or partition.md +++ b/sources/tech/20150225 How to make remote incremental backup of LUKS-encrypted disk or partition.md @@ -1,3 +1,4 @@ +Translating by GOLinux! How to make remote incremental backup of LUKS-encrypted disk/partition ================================================================================ Some of us have our hard drives at home or on a [VPS][1] encrypted by [Linux Unified Key Setup (LUKS)][2] for security reasons, and these drives can quickly grow to tens or hundreds of GBs in size. So while we enjoy the security of our LUKS device, we may start to think about a possible remote backup solution. For secure off-site backup, we will need something that operates at the block level of the encrypted LUKS device, and not at the un-encrypted file system level. So in the end we find ourselves in a situation where we will need to transfer the entire LUKS device (let's say 200GB for example) each time we want to make a backup. Clearly not feasible. How can we deal with this problem? @@ -77,4 +78,4 @@ via: http://xmodulo.com/remote-incremental-backup-luks-encrypted-disk-partition. [2]:http://xmodulo.com/how-to-create-encrypted-disk-partition-on-linux.html [3]:http://bdsync.rolf-fokkens.nl/ [4]:http://xmodulo.com/recommend/linuxbook -[5]:http://xmodulo.com/how-to-enable-ssh-login-without.html \ No newline at end of file +[5]:http://xmodulo.com/how-to-enable-ssh-login-without.html From 21fb1a56adef26f222fe808288afba02f0b8e378 Mon Sep 17 00:00:00 2001 From: GOLinux Date: Mon, 15 Jun 2015 08:51:19 +0800 Subject: [PATCH 378/965] [Translated]20150225 How to make remote incremental backup of LUKS-encrypted disk or partition.md --- ...kup of LUKS-encrypted disk or partition.md | 81 ------------------- ...kup of LUKS-encrypted disk or partition.md | 80 ++++++++++++++++++ 2 files changed, 80 insertions(+), 81 deletions(-) delete mode 100644 sources/tech/20150225 How to make remote incremental backup of LUKS-encrypted disk or partition.md create mode 100644 translated/tech/20150225 How to make remote incremental backup of LUKS-encrypted disk or partition.md diff --git a/sources/tech/20150225 How to make remote incremental backup of LUKS-encrypted disk or partition.md b/sources/tech/20150225 How to make remote incremental backup of LUKS-encrypted disk or partition.md deleted file mode 100644 index ee43b08c2a..0000000000 --- a/sources/tech/20150225 How to make remote incremental backup of LUKS-encrypted disk or partition.md +++ /dev/null @@ -1,81 +0,0 @@ -Translating by GOLinux! -How to make remote incremental backup of LUKS-encrypted disk/partition -================================================================================ -Some of us have our hard drives at home or on a [VPS][1] encrypted by [Linux Unified Key Setup (LUKS)][2] for security reasons, and these drives can quickly grow to tens or hundreds of GBs in size. So while we enjoy the security of our LUKS device, we may start to think about a possible remote backup solution. For secure off-site backup, we will need something that operates at the block level of the encrypted LUKS device, and not at the un-encrypted file system level. So in the end we find ourselves in a situation where we will need to transfer the entire LUKS device (let's say 200GB for example) each time we want to make a backup. Clearly not feasible. How can we deal with this problem? - -### A Solution: Bdsync ### - -This is when a brilliant open-source tool called [Bdsync][3] (thanks to Rolf Fokkens) comes to our rescue. As the name implies, Bdsync can synchronize "block devices" over network. For fast synchronization, Bdsync generates and compares MD5 checksums of blocks in the local/remote block devices, and sync only the differences. What rsync can do at the file system level, Bdsync can do it at the block device level. Naturally, it works with encrypted LUKS devices as well. Pretty neat! - -Using Bdsync, the first-time backup will copy the entire LUKS block device to a remote host, so it will take a lot of time to finish. However, after that initial backup, if we make some new files on the LUKS device, the second backup will be finished quickly because we will need to copy only that blocks which have been changed. Classic incremental backup at play! - -### Install Bdsync on Linux ### - -Bdsync is not included in the standard repositories of [Linux][4] distributions. Thus you need to build it from the source. Use the following distro-specific instructions to install Bdsync and its man page on your system. - -#### Debian, Ubuntu or Linux Mint #### - - $ sudo apt-get install git gcc libssl-dev - $ git clone https://github.com/TargetHolding/bdsync.git - $ cd bdsync - $ make - $ sudo cp bdsync /usr/local/sbin - $ sudo mkdir -p /usr/local/man/man1 - $ sudo sh -c 'gzip -c bdsync.1 > /usr/local/man/man1/bdsync.1.gz' - -#### Fedora or CentOS/RHEL #### - - $ sudo yum install git gcc openssl-devel - $ git clone https://github.com/TargetHolding/bdsync.git - $ cd bdsync - $ make - $ sudo cp bdsync /usr/local/sbin - $ sudo mkdir -p /usr/local/man/man1 - $ sudo sh -c 'gzip -c bdsync.1 > /usr/local/man/man1/bdsync.1.gz' - -### Perform Off-site Incremental Backup of LUKS-Encrypted Device ### - -I assume that you have already provisioned a LUKS-encrypted block device as a backup source (e.g., /dev/LOCDEV). I also assume that you have a remote host where the source device will be backed up (e.g., as /dev/REMDEV). - -You need to access the root account on both systems, and set up [password-less SSH access][5] from the local host to a remote host. Finally, you need to install Bdsync on both hosts. - -To initiate a remote backup process on the local host, we execute the following command as the root: - - # bdsync "ssh root@remote_host bdsync --server" /dev/LOCDEV /dev/REMDEV | gzip > /some_local_path/DEV.bdsync.gz - -Some explanations are needed here. Bdsync client will open an SSH connection to the remote host as the root, and execute Bdsync client with --server option. As clarified, /dev/LOCDEV is our source LUKS block device on the local host, and /dev/REMDEV is the target block device on the remote host. They could be /dev/sda (for an entire disk) or /dev/sda2 (for a single partition). The output of the local Bdsync client is then piped to gzip, which creates DEV.bdsync.gz (so-called binary patch file) in the local host. - -The first time you run the above command, it will take very long time, depending on your Internet/LAN speed and the size of /dev/LOCDEV. Remember that you must have two block devices (/dev/LOCDEV and /dev/REMDEV) with the same size. - -The next step is to copy the generated patch file from the local host to the remote host. Using scp is one possibility: - - # scp /some_local_path/DEV.bdsync.gz root@remote_host:/remote_path - -The final step is to execute the following command on the remote host, which will apply the patch file to /dev/REMDEV: - - # gzip -d < /remote_path/DEV.bdsync.gz | bdsync --patch=/dev/DSTDEV - -I recommend doing some tests with small partitions (without any important data) before deploying Bdsync with real data. After you fully understand how the entire setup works, you can start backing up real data. - -### Conclusion ### - -In conclusion, we showed how to use Bdsync to perform incremental backups for LUKS devices. Like rsync, only a fraction of data, not the entire LUKS device, is needed to be pushed to an off-site backup site at each backup, which saves bandwidth and backup time. Rest assured that all the data transfer is secured by SSH or SCP, on top of the fact that the device itself is encrypted by LUKS. It is also possible to improve this setup by using a dedicated user (instead of the root) who can run bdsync. We can also use bdsync for ANY block device, such as LVM volumes or RAID disks, and can easily set up Bdsync to back up local disks on to USB drives as well. As you can see, its possibility is limitless! - -Feel free to share your thought. - --------------------------------------------------------------------------------- - -via: http://xmodulo.com/remote-incremental-backup-luks-encrypted-disk-partition.html - -作者:[Iulian Murgulet][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://xmodulo.com/author/iulian -[1]:http://xmodulo.com/go/digitalocean -[2]:http://xmodulo.com/how-to-create-encrypted-disk-partition-on-linux.html -[3]:http://bdsync.rolf-fokkens.nl/ -[4]:http://xmodulo.com/recommend/linuxbook -[5]:http://xmodulo.com/how-to-enable-ssh-login-without.html diff --git a/translated/tech/20150225 How to make remote incremental backup of LUKS-encrypted disk or partition.md b/translated/tech/20150225 How to make remote incremental backup of LUKS-encrypted disk or partition.md new file mode 100644 index 0000000000..645ade2261 --- /dev/null +++ b/translated/tech/20150225 How to make remote incremental backup of LUKS-encrypted disk or partition.md @@ -0,0 +1,80 @@ +为LUKS——加密的磁盘/分区做增量备份 +================================================================================ +我们中有些人出于安全原因,在家里或者[VPS][1]上通过[Linux统一密钥配置(LUKS)][2]为硬盘驱动器加密,而这些驱动器的容量很快会增长到数十或数百GB。因此,虽然我们享受着LUKS设备带来的安全感,但是我们也该开始考虑一个可能的远程备份方案了。对于安全的非现场备份,我们将需要在LUKS加密的设备上以块级别操作的东西。因此,最后我们发现这么个状况,我们每次都需要传输想要做备份的LUKS设备(比如说200GB)。很明显,这是不可行的。我们该怎么来处理这个问题呢? + +### 一个解决方案: Bdsync ### + +这时,一个卓越的开源工具来拯救我们了,它叫[Bdsync][3](多亏了Rolf Fokkens)。顾名思义,Bdsync可以通过网络同步“块设备”。对于快速同步,Bdsync会生成并对比本地/远程块设备的块MD5校验和,只同步差异部分。rsync在文件系统级别可以做的,Bdsync可以在块设备级别完成。很自然,对于LUKS加密的设备它也能工作得很好。相当地灵巧! + +使用Bdsync,首次备份将拷贝整个LUKS块设备到远程主机,因而会花费大量时间来完成。然而,在初始备份后,如果我们在LUKS设备新建一些文件,再次备份就会很快完成,因为我们只需拷贝修改过的块。经典的增量备份在起作用了! + +### 安装Bdsync到Linux ### + +Bdsync并不包含在[Linux][4]发行版的标准仓库中,因而你需要从源代码来构建它。使用以下针对特定版本的指令来安装Bdsync及其手册页到你的系统中。 + +#### Debian,Ubuntu或Linux Mint #### + + $ sudo apt-get install git gcc libssl-dev + $ git clone https://github.com/TargetHolding/bdsync.git + $ cd bdsync + $ make + $ sudo cp bdsync /usr/local/sbin + $ sudo mkdir -p /usr/local/man/man1 + $ sudo sh -c 'gzip -c bdsync.1 > /usr/local/man/man1/bdsync.1.gz' + +#### Fedora或CentOS/RHEL #### + + $ sudo yum install git gcc openssl-devel + $ git clone https://github.com/TargetHolding/bdsync.git + $ cd bdsync + $ make + $ sudo cp bdsync /usr/local/sbin + $ sudo mkdir -p /usr/local/man/man1 + $ sudo sh -c 'gzip -c bdsync.1 > /usr/local/man/man1/bdsync.1.gz' + +### 对LUKS加密的设备实施非现场增量备份 ### + +我假定你已经准备好了一个LUKS加密的块设备作为备份源(如,/dev/LOCDEV)。同时,我假定你也有一台远程主机,用以作为源设备的备份点(如,/dev/REMDEV)。 + +你需要在两台系统上具有root帐号访问权限,并且设置从本地访问远程的[无密码SSH访问][5]。最后,你需要安装Bdsync到两台主机上。 + +要在本地主机上初始化一个远程备份进程,我们需要以root执行以下命令: + + # bdsync "ssh root@remote_host bdsync --server" /dev/LOCDEV /dev/REMDEV | gzip > /some_local_path/DEV.bdsync.gz + +这里需要进行一些说明。Bdsync客户端将以root打开一个到远程主机的SSH连接,并执行带有--server选项的Bdsync客户端。明确说明一下,/dev/LOCDEV是我们的本地主机上的源LUKS块设备,而/dev/REMDEV是远程主机上的目标块设备。它们可以是/dev/sda(作为整个磁盘),或者/dev/sda2(作为单个分区)。本地Bdsync客户端的输出结果随后被管道输送到gzip,用来在本地主机中创建DEV.bdsync.gz(所谓的二进制补丁文件)。 + +你第一次运行上面的命令的时候,它会花费很长一段时间,这取决于你的互联网/局域网速度,以及/dev/LOCDEV的大小。记住,你必须有两个大小相同的块设备(/dev/LOCDEV和/dev/REMDEV)。 + +下一步是要将补丁文件从本地主机拷贝到远程主机。一种可能是使用scp: + + # scp /some_local_path/DEV.bdsync.gz root@remote_host:/remote_path + +最后一步,是要在远程主机上执行以下命令,它们会将补丁文件应用到/dev/REMDEV: + + # gzip -d < /remote_path/DEV.bdsync.gz | bdsync --patch=/dev/DSTDEV + +我推荐在使用真实数据部署Bdsync前,使用一些(没有任何重要数据)小分区来做这些测试。在你完全弄懂整个设置是如何工作之后,你可以开始备份真实数据。 + +### 尾声 ### + +小结之,我们演示了如何使用Bdsync来为LUKS设备实施增量备份。和rsync一样,每次备份只有一小部分数据,而不是整个LUKS设备,需要被推送到非现场备份点,这样会节省带宽和备份时间。剩下来,需要保证所有数据传输通过SSH或SCP加固安全,事实上设备自身是由LUKS加密的。也可以通过使用可以运行bdsync的专用用户(而非root)来改善该配置。我们也可以将bdsync用于任何块设备,如LVM卷或RAID磁盘,也可以很轻易地设置Bdsync备份本地磁盘到USB驱动器上。如你所见,它有着无限可能性! + +随时分享你的想法。 + +-------------------------------------------------------------------------------- + +via: http://xmodulo.com/remote-incremental-backup-luks-encrypted-disk-partition.html + +作者:[Iulian Murgulet][a] +译者:[GOLinux](https://github.com/GOLinux) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://xmodulo.com/author/iulian +[1]:http://xmodulo.com/go/digitalocean +[2]:http://xmodulo.com/how-to-create-encrypted-disk-partition-on-linux.html +[3]:http://bdsync.rolf-fokkens.nl/ +[4]:http://xmodulo.com/recommend/linuxbook +[5]:http://xmodulo.com/how-to-enable-ssh-login-without.html From ebc81d816b71c6daeb5920d0c59008d667d98360 Mon Sep 17 00:00:00 2001 From: wi-cuckoo Date: Mon, 15 Jun 2015 10:52:46 +0800 Subject: [PATCH 379/965] translated wi-cuckoo --- ...che Containers with Docker on Fedora 22.md | 283 ------------------ ...che Containers with Docker on Fedora 22.md | 279 +++++++++++++++++ 2 files changed, 279 insertions(+), 283 deletions(-) delete mode 100644 sources/tech/20150612 How to Configure Apache Containers with Docker on Fedora 22.md create mode 100644 translated/tech/20150612 How to Configure Apache Containers with Docker on Fedora 22.md diff --git a/sources/tech/20150612 How to Configure Apache Containers with Docker on Fedora 22.md b/sources/tech/20150612 How to Configure Apache Containers with Docker on Fedora 22.md deleted file mode 100644 index 66bd27fbc5..0000000000 --- a/sources/tech/20150612 How to Configure Apache Containers with Docker on Fedora 22.md +++ /dev/null @@ -1,283 +0,0 @@ -translating wi-cuckoo -How to Configure Apache Containers with Docker on Fedora 22 -================================================================================ -In this article we are going to learn about Docker, how to use it to deploy Apache httpd and how can you share it on Docker Hub. First we are going to learn how to pull and use images hosted on Docker Hub, and then install Apache on an image of Fedora 22 interactively, after that we are going to learn how to use a Dockerfile to make an image in a faster and more elegant way, finally we are going to publish the image we've created in Docker Hub, so anyone will be able download and use it later. - -### Installing Docker and saying hello world ### - -**Requirements** - -You will need atleast these things to run Docker: - -- You need a 64bit Kernel version 3.10 or higher -- Iptables 1.4 - This will be used by Docker to make the network wizardry, such as Network Address Translation. -- Git 1.7 - Docker uses Git to make it transactions to repositories, like Docker Hub -- ps - This utility is present in most environments and is provided in the procps package. -- root - despite normal users can run docker client by TCP and other means, we will assume that you are root, for sake of simplicity - -#### Install docker using dnf #### - -The following commands will install Docker - - dnf update && dnf install docker - -**Note**: You can still use Yum in Fedora 22, but it's deprecated in favor of DNF and is not present in a clean install. - -#### Check your install #### - -The first command we are going to use is docker info, this give you many information: - - docker info - -Also try **docker version**: - - docker version - -#### Starting Docker as daemon #### - -You should start a docker instance that will take care of our requests. - - docker -d - -Now set docker to start with the system, so you don't need to run the previous command every time you reboot. - - chkconfig docker on - -Let's say hello world with Busybox: - - docker run -t busybox /bin/echo "hello world" - -In this command, we tell Docker to execute /bin/echo "hello world" in an instance/container of the Busybox image, which is a minimal POSIX environment based in a single binary and links to it. - -If Docker can't find a local image of Busybox on your system, it will pull the image automatically from Docker Hub, as you can see in the following screenshot: - -![Hello world with Busybox](http://blog.linoxide.com/wp-content/uploads/2015/06/docker-hello-world-busybox-complete.png) - -Hello world with Busybox - -Try the same command again, this time as Docker already have the Busybox image locally, all you will see is the output of echo: - - docker run -t busybox /bin/echo "hello world" - -Try also the following to enter in the container environment: - - docker run -it busybox /bin/sh - -To leave and stop the container use the **exit** command - -### Dockerizing Apache interactively ### - -Pull/Download the Fedora image: - - docker pull fedora:22 - -Run a container dettached from the console: - - docker run -d -t fedora:22 /bin/bash - -List running containers and identify by name as follows - - docker ps - -![listing with docker ps and attaching with docker attach](http://blog.linoxide.com/wp-content/uploads/2015/06/docker-ps-with-docker-attach-highlight.png) - -listing with docker ps and attaching with docker attach - -The name angry_nobel was given to our instance, so let's attach: - - docker attach angry_nobel - -Note: Every time you run a container a new name will be given, if you need a constant name for you container you should use the -name parameter to docker run command. - -#### Installing Apache #### - -The following command will update DNF database, download install Apache (httpd package) and clean DNF cache to make the image small - - dnf -y update && dnf -y install httpd && dnf -y clean all - -Configuring Apache - -The only thing we are going to change httpd.conf is the ServerName, this makes Apache stops to complain. - - sed -i.orig 's/#ServerName/ServerName/' /etc/httpd/conf/httpd.conf - -**Set the environment** - -To make Apache run in standalone mode, you must provide some information in the form of enviroenment variables, and also you will need the directories set in these variables, so we are going to make this with a small shell script that will also start Apache - - vi /etc/httpd/run_apache_foreground - ----------- - - #!/bin/bash - - #set variables - APACHE_LOG_DI=R"/var/log/httpd" - APACHE_LOCK_DIR="/var/lock/httpd" - APACHE_RUN_USER="apache" - APACHE_RUN_GROUP="apache" - APACHE_PID_FILE="/var/run/httpd/httpd.pid" - APACHE_RUN_DIR="/var/run/httpd" - - #create directories if necessary - if ! [ -d /var/run/httpd ]; then mkdir /var/run/httpd;fi - if ! [ -d /var/log/httpd ]; then mkdir /var/log/httpd;fi - if ! [ -d /var/lock/httpd ]; then mkdir /var/lock/httpd;fi - - #run Apache - httpd -D FOREGROUND - -**Alternatively**, you can past and run this snippet on the container shell: - - dnf -y install git && git clone https://github.com/gaiada/run-apache-foreground.git && cd run-apach* && ./install && dnf erase git - -The inline script above will, install Git, clone [this repository][1], put the script in place and ask you if you want uninstall Git. - -**Saving your container state** - -Your container is now ready to run Apache, now it is time to save the current state of this container in an image to be able use whenever you need. - -To leave the container environment, you must press **Ctrl+p** followed by **Ctrl+q**, if you just call exit in the shell, you will also stop the container and lost what you have done so far. - -Once you are back to the Docker host, use **docker commit** followed by the container and the repository name/tag you desire: - - docker commit angry_nobel gaiada/apache - -Now that you saved the container status into a image, you can use **docker stop** on the running container: - - docker stop angry_nobel - -**Run and test your image** - -Finally, run a container from your new image and redirect connections on port 80 to it with: - - docker run -p 80:80 -d -t gaiada/apache /etc/httpd/run_apache_foreground - - - -At this point, you are already running Apache in your container, open your browser to access the service in [http://localhost][2] and you will see the Apache default page as follows - -![Apache default page running from Docker container](http://blog.linoxide.com/wp-content/uploads/2015/06/docker-apache-running.png) - -Apache default page running from Docker container - -### Dockerizing Apache with a Dockerfile ### - -Now we are going to create a new Apache image, this time the steps will be written in a Dockerfile, that will be processed to form the image. - -First, create a directory on which we will put the Dockerfile and enter this directory: - - mkdir apachedf; cd apachedf - -And then create a file named Dockerfile with the following content: - - FROM fedora:22 - - MAINTAINER Carlos Alberto - LABEL version="0.1" - - RUN dnf -y update && dnf -y install httpd && dnf -y clean all - - RUN [ -d /var/log/httpd ] || mkdir /var/log/httpd - RUN [ -d /var/run/httpd ] || mkdir /var/run/httpd - RUN [ -d /var/lock/httpd ] || mkdir /var/lock/httpd - - RUN sed -i.orig 's/#ServerName/ServerName/' /etc/httpd/conf/httpd.conf - - ENV APACHE_RUN_USER apache - ENV APACHE_RUN_GROUP apache - ENV APACHE_LOG_DIR /var/log/httpd - ENV APACHE_LOCK_DIR /var/lock/httpd - ENV APACHE_RUN_DIR /var/run/httpd - ENV APACHE_PID_FILE /var/run/httpd/httpd.pid - - EXPOSE 80 - - CMD ["/usr/sbin/httpd", "-D", "FOREGROUND"] - - - -Let's see what is on this Dockerfile: - -**FROM** - This tells docker that we are going to use Fedora 22 as base image - -**MANTAINER** and **LABEL** - these commands are informative and have no direct influence on the image - -**RUN** - Automate the steps we've done interactively, install Apache, create directories and edit httpd.conf - -**ENV** - Set the environment variables, now we don't need the run_apache_foreground script anymore. - -**EXPOSE** - Expose the port 80 to the world - -**CMD** - Set the default command to httpd, so we don't need to do this every time we start a new container - -**Build the image** - -Now we are going to build the image and put the TAG gaiada/apachedf on it: - - docker build -t gaiada/apachedf:0.1 . - -![docker build complete](http://blog.linoxide.com/wp-content/uploads/2015/06/docker-build-complete.png) - -docker build complete - -Use **docker images** list the local images and see if your new image is there: - - docker images - -And then run you new image: - - docker run -t -p 80:80 gaiada/apachedf - -That is it for the Dockerfile, using this feature make things much easier, faster and reproducible. - -### Publishing your images ### - -Until now, you just pulled images from Docker Hub, but you can also push you image and pull them later as needed. In fact other can also download your image and use it in their systems without the need of change anything and now we are going to learn how to make our image available for others worldwide. - -**Creating account** - -For you to be able to push your image on Docker Hub, you need to create an account. Access [https://hub.docker.com/account/signup/][3] and fill the following form: - -![Docker Hub signup page](http://blog.linoxide.com/wp-content/uploads/2015/06/docker-hub-signup.png) - -Docker Hub signup page - -**Login** - -Enter the following command and proceed with the login name, password and email you provided in your account creation - - docker login - -After you do the first login, your account information will be recorded in **~/.dockercfg** - -**Pushing** - -Push the page to the server with the **docker push [registry/]your_login/repository_name[:tag]** - - docker push docker.io/gaiada/apachedf - -You might see something like this on your console: - -![Docker push Apache image complete](http://blog.linoxide.com/wp-content/uploads/2015/06/docker-pushing-apachedf-complete.png) - -Docker push Apache image complete - -### Conclusion ### - -Now that you know how to Dockerize Apache, try to include some modules, Perl, PHP, proxy, HTTPS, or whatever you need. I hope you guys liked it, and push your own images on Docker Hub. - --------------------------------------------------------------------------------- - -via: http://linoxide.com/linux-how-to/configure-apache-containers-docker-fedora-22/ - -作者:[Carlos Alberto][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://linoxide.com/author/carlosal/ -[1]:https://github.com/gaiada/run-apache-foreground -[2]:http://localhost/ -[3]:https://hub.docker.com/account/signup/ diff --git a/translated/tech/20150612 How to Configure Apache Containers with Docker on Fedora 22.md b/translated/tech/20150612 How to Configure Apache Containers with Docker on Fedora 22.md new file mode 100644 index 0000000000..9665855542 --- /dev/null +++ b/translated/tech/20150612 How to Configure Apache Containers with Docker on Fedora 22.md @@ -0,0 +1,279 @@ +如何在Fedora 22上面配置Apache的Docker容器 +============================================================================= +在这篇文章中,我们将会学习关于Docker的一些知识,如何使用Docker部署Apache httpd服务,并且共享到Docker Hub上面去。首先,我们学习怎样拉取和使用Docker Hub里面的镜像,然后交互式地安装Apache到一个Fedora 22的镜像里去,之后我们将会学习如何用一个Dockerfile文件来制作一个镜像,以一种更快,更优雅的方式。最后,我们会在Docker Hub上公开我们创建地镜像,这样以后任何人都可以下载并使用它。 + +### 安装Docker,运行hello world ### + +**要求** + +运行Docker,里至少需要满足这些: + +- 你需要一个64位的内核,版本3.10或者更高 +- Iptables 1.4 - Docker会用来做网络配置,如网络地址转换(NAT) +- Git 1.7 - Docker会使用Git来与仓库交流,如Docker Hub +- ps - 在大多数环境中这个工具都存在,在procps包里有提供 +- root - 防止一般用户可以通过TCP或者其他方式运行Docker,为了简化,我们会假定你就是root + +### 使用dnf安装docker ### + +以下的命令会安装Docker + + dnf update && dnf install docker + +**注意**:在Fedora 22里,你仍然可以使用Yum命令,但是被DNF取代了,而且在纯净安装时不可用了。 + +### 检查安装 ### + +我们将要使用的第一个命令是docker info,这会输出很多信息给你: + + docker info + +也可以试着用**docker version**: + + docker version + +### 启动Dcoker为守护进程 ### + +你应该启动一个docker实例,然后她会处理我们的请求。 + + docker -d + +让我们用Busybox来打印hello world: + + dockr run -t busybox /bin/echo "hello world" + +这个命令里,我们告诉Docker执行 /bin/echo "hello world",在Busybox镜像的一个实例/容器里。Busybox是一个小型的POSIX环境,将许多小工具都结合到了一个单独的可执行程序里。 + +如果Docker不能在你的系统里找到本地的Busybox镜像,她就会自动从Docker Hub里拉取镜像,正如你可以看下如下的快照: + +![Hello world with Busybox](http://blog.linoxide.com/wp-content/uploads/2015/06/docker-hello-world-busybox-complete.png) + +Hello world with Busybox + +再次尝试相同的命令,这次由于Docker已经有了本地的Busybox镜像,所有你将会看到的就是echo的输出: + + docker run -t busybox /bin/echo "hello world" + +也可以尝试以下的命令进入到容器环境里去: + + docker run -it busybox /bin/sh + +使用**exit**命令可以离开容器并停止它 + +### 交互式地Docker化Apache ### + +拉取/下载 Fedora 镜像: + + docker pull fedora:22 + +起一个容器在后台运行: + + docker run -d -t fedora:22 /bin/bash + +列出正在运行地容器,并用名字标识,如下 + + docker ps + +![listing with docker ps and attaching with docker attach](http://blog.linoxide.com/wp-content/uploads/2015/06/docker-ps-with-docker-attach-highlight.png) + +使用docker ps列出,并使用docker attach进入一个容器里 + +angry_noble是docker分配给我们容器的名字,所以我们来附上去: + + docker attach angry_noble + +注意:每次你起一个容器,就会被给与一个新的名字,如果你的容器需要一个固定的名字,你应该在 docker run 命令里使用 -name 参数。 + +### 安装Apache ### + +下面的命令会更新DNF的数据库,下载安装Apache(httpd包)并清理dnf缓存使镜像尽量小 + + dnf -y update && dnf -y install httpd && dnf -y clean all + +配置Apache + +我们需要修改httpd.conf的唯一地方就是ServerName,这会使Apache停止抱怨 + + sed -i.orig 's/#ServerName/ServerName/' /etc/httpd/conf/httpd.conf + +**设定环境** + +为了使Apache运行为单机模式,你必须以环境变量的格式提供一些信息,并且你也需要在这些变量里的目录设定,所以我们将会用一个小的shell脚本干这个工作,当然也会启动Apache + + vi /etc/httpd/run_apache_foreground + +---------- + + #!/bin/bash + + #set variables + APACHE_LOG_DI=R"/var/log/httpd" + APACHE_LOCK_DIR="/var/lock/httpd" + APACHE_RUN_USER="apache" + APACHE_RUN_GROUP="apache" + APACHE_PID_FILE="/var/run/httpd/httpd.pid" + APACHE_RUN_DIR="/var/run/httpd" + + #create directories if necessary + if ! [ -d /var/run/httpd ]; then mkdir /var/run/httpd;fi + if ! [ -d /var/log/httpd ]; then mkdir /var/log/httpd;fi + if ! [ -d /var/lock/httpd ]; then mkdir /var/lock/httpd;fi + + #run Apache + httpd -D FOREGROUND + +**另外地**,你可以粘贴这个片段代码到容器shell里并运行: + + dnf -y install git && git clone https://github.com/gaiada/run-apache-foreground.git && cd run-apach* && ./install && dnf erase git + +上面的内嵌脚本会安装Git,克隆[这个仓库][1],到文件里去运行脚本,并询问你是否卸载Git。 + +**保存你的容器状态** + +你的容器现在可以运行Apache,是时候保存容器当前的状态为一个镜像,以备你需要的时候使用。 + +为了离开容器环境,你必须顺序按下 **Ctrl+q** 和 **Ctrl+p**,如果你仅仅在shell执行exit,你同时也会停止容器,失去目前为止你做过的所有工作。 + +回到Docker主机,使用 **docker commit** 加容器和你期望的仓库名字/标签: + + docker commit angry_noble gaiada/apache + +现在,你保存了容器的状态到一个镜像里,可以使用 **docker stop** 停止容器了: + + docker stop angry_noble + +**运行并测试你的镜像** + +最后,从你的新镜像起一个容器,并且重定向80端口到容器: + + docker run -p 80:80 -d -t gaiada/apache /etc/httpd/run_apache_foreground + + + +到目前,你正在你的容器里运行Apache,打开你的浏览器访问该服务,在[http://localhost][2],你将会看到如下Apache默认的页面 + +![Apache default page running from Docker container](http://blog.linoxide.com/wp-content/uploads/2015/06/docker-apache-running.png) + +在容器里运行的Apache默认页面 + +### 使用Dockerfile Docker化Apache ### + +现在,我们将要去创建一个新的Apache镜像,这次所有步骤会写在一个Dockerfile文件里,文件将会被用于生成该镜像。 + +首先,新建一个目录,在里面放Dockerfile文件,并进入该目录: + + mkdir apachedf; cd apachedf + +然后创建一个名为Dockerfile的文件,添加以下内容: + + FROM fedora:22 + + MAINTAINER Carlos Alberto + LABEL version="0.1" + + RUN dnf -y update && dnf -y install httpd && dnf -y clean all + + RUN [ -d /var/log/httpd ] || mkdir /var/log/httpd + RUN [ -d /var/run/httpd ] || mkdir /var/run/httpd + RUN [ -d /var/lock/httpd ] || mkdir /var/lock/httpd + + RUN sed -i.orig 's/#ServerName/ServerName/' /etc/httpd/conf/httpd.conf + + ENV APACHE_RUN_USER apache + ENV APACHE_RUN_GROUP apache + ENV APACHE_LOG_DIR /var/log/httpd + ENV APACHE_LOCK_DIR /var/lock/httpd + ENV APACHE_RUN_DIR /var/run/httpd + ENV APACHE_PID_FILE /var/run/httpd/httpd.pid + + EXPOSE 80 + + CMD ["/usr/sbin/httpd", "-D", "FOREGROUND"] + + + +我们一起来看看Dockerfile里面有什么: + +**FROM** - 这告诉docker,我们将要使用Fedora 22作为基础镜像 + +**MAINTAINER** 和 **LABLE** - 这些命令对镜像没有直接作用,属于标记信息 + +**RUN** - 自动完成我们之前交互式做的工作,安装Apache,新建目录并编辑httpd.conf + +**ENV** - 设置环境变量,现在我们再不需要run_apache_foreground脚本 + +**EXPOSE** - 暴露80端口给外网 + +**CMD** - 设置默认的命令启动httpd服务,这样我们就不需要每次起一个新的容器都重复这个工作 + +**建立该镜像** + +现在,我们将要建立这个镜像,并为其添加tag gaiada/apachedf + + docker build -t gaiada/apachedf:0.1 . + +![docker build complete](http://blog.linoxide.com/wp-content/uploads/2015/06/docker-build-complete.png) + +docker完成创建 + +使用 **docker images** 列出本地镜像,查看是否存在你新建的镜像: + + docker images + +然后运行新的镜像: + + docker run -t -p 80:80 gaiada/apachedf + +这就是Dockerfile的工作,使用这项功能会使得事情更加容易,快速并且可重复生成。 + +### 公开你的镜像 ### + +直到现在,你仅仅是从Docker Hub拉取了镜像,但是你也可以推送你的镜像,以后需要也可以再次拉取他们。实际上,其他人也可以下载你的镜像,在他们的系统中使用它而不需要改变任何东西。现在我们将要学习如何使我们的镜像对世界上的其他人可用。 + +**创建帐号** + +为了能够在Docker Hub上推送你的镜像,你需要创建一个帐号。访问 [https://hub.docker.com/account/signup/][3],填写下面的表格: + +![Docker Hub signup page](http://blog.linoxide.com/wp-content/uploads/2015/06/docker-hub-signup.png) + +Docker Hub 注册页面 + +**登录** + +输入下面的命令,接着输入你注册时提供的用户名,密码和邮箱 + + docker login + +第一次登录过后,你的帐号信息会被记录在 **~/.dockercfg** + +**推送** + +推送镜像,使用 **docker push [registry/]your_login/repository_name[:tag]** + + docker push docker.io/gaiada/apachedf + +你可能会看见像这样的输出,在你的控制台上: + +![Docker push Apache image complete](http://blog.linoxide.com/wp-content/uploads/2015/06/docker-pushing-apachedf-complete.png) + +Docker推送Apache镜像完成 + +### 结论 ### + +现在,你知道如何Docker化Apache,试一试包含其他一些组块,Perl,PHP,proxy,HTTPS,或者任何你需要的东西。我希望你们这些家伙喜欢她,并推送你们自己的镜像到Docker Hub。 + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/linux-how-to/configure-apache-containers-docker-fedora-22/ + +作者:[Carlos Alberto][a] +译者:[wi-cuckoo](https://github.com/wi-cuckoo) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://linoxide.com/author/carlosal/ +[1]:https://github.com/gaiada/run-apache-foreground +[2]:http://localhost/ +[3]:https://hub.docker.com/account/signup/ + From effbcc0ecb43fdb6913ee24406c45ba67d70bbec Mon Sep 17 00:00:00 2001 From: ZTinoZ Date: Mon, 15 Jun 2015 15:08:49 +0800 Subject: [PATCH 380/965] Translating by ZTinoZ --- .../20150526 20 Useful Terminal Emulators for Linux.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sources/tech/20150526 20 Useful Terminal Emulators for Linux.md b/sources/tech/20150526 20 Useful Terminal Emulators for Linux.md index 1b239a3904..82a8ff5aff 100644 --- a/sources/tech/20150526 20 Useful Terminal Emulators for Linux.md +++ b/sources/tech/20150526 20 Useful Terminal Emulators for Linux.md @@ -157,7 +157,7 @@ Konsole Terminal ### 11. TermKit ### -TermKit is a elegant terminal that aims to construct aspects of the GUI with the command line based application using WebKit rendering engine mostly used in web browsers like Google Chrome and Chromium. TermKit is originally designed for Mac and Windows, but due to TermKit fork by Floby which you can now able to install it under Linux based distributions and experience the power of TermKit. +TermKit是一款漂亮简洁的终端,其目标是用在Google Chrome和Chromium中广泛被使用的WebKit渲染引擎在基于应用程序的命令行中构建出GUI视图。TermKit起初是为Mac和Windows设计的,但是由于TermKit被Floby给fork并做了修改,现在你可以将它安装在Linux发行版上并感受TermKit带来的魅力。 ![TermKit Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/TermKit-Terminal.jpeg) @@ -167,7 +167,7 @@ TermKit Terminal ### 12. st ### -st is a simple terminal implementation for X Window. +st是一款简单的X Window终端实现接口。 ![st terminal](http://www.tecmint.com/wp-content/uploads/2014/01/st-terminal.png) @@ -177,9 +177,9 @@ st terminal ### 13. Gnome-Terminal ### -GNOME terminal is a built-in terminal emulator for GNOME desktop environment developed by Havoc Pennington and others. It allow users to run commands using a real Linux shell while remaining on the on the GNOME environment. GNOME Terminal emulates the xterm terminal emulator and brings a few similar features. +GNOME终端是一款在GNOME桌面环境下的嵌入式终端仿真器,由Havoc Pennington和其他一些人共同开发。它允许用户在GNOME环境下的同时使用一个真实的Linux shell来运行命令。GNOME终端是模拟的xterm终端仿真器并带来了一些相似的特性。 -The Gnome terminal supports multiple profiles, where users can able to create multiple profiles for his/her account and can customize configuration options such as fonts, colors, background image, behavior, etc. per account and define a name to each profile. It also supports mouse events, url detection, multiple tabs, etc. +Gnome终端支持多用户,用户可以为他们的账户创建多个用户,每个用户能自定义配置选项,如字体、颜色、背景图片、行为习惯等等并能分别给它们取名。它也支持鼠标事件、url探测、多标签等。 ![Gnome Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/Gnome-terminal.jpg) From 1d88963ae6aba8d9d9b9c10d55dfd39f16701870 Mon Sep 17 00:00:00 2001 From: KS Date: Mon, 15 Jun 2015 15:09:58 +0800 Subject: [PATCH 381/965] Update 20150612 Inside NGINX--How We Designed for Performance and Scale.md --- ... Inside NGINX--How We Designed for Performance and Scale.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150612 Inside NGINX--How We Designed for Performance and Scale.md b/sources/tech/20150612 Inside NGINX--How We Designed for Performance and Scale.md index 559d28996c..970144275f 100644 --- a/sources/tech/20150612 Inside NGINX--How We Designed for Performance and Scale.md +++ b/sources/tech/20150612 Inside NGINX--How We Designed for Performance and Scale.md @@ -1,3 +1,4 @@ +wyangsun 申领 Inside NGINX: How We Designed for Performance & Scale ================================================================================ NGINX leads the pack in web performance, and it’s all due to the way the software is designed. Whereas many web servers and application servers use a simple threaded or process-based architecture, NGINX stands out with a sophisticated event-driven architecture that enables it to scale to hundreds of thousands of concurrent connections on modern hardware. @@ -171,4 +172,4 @@ via: http://nginx.com/blog/inside-nginx-how-we-designed-for-performance-scale/ [12]:https://speakerdeck.com/nginx/nginx-installation-and-tuning [13]:http://nginx.com/blog/tuning-nginx/ [14]:http://www.aosabook.org/en/nginx.html -[15]:http://nginx.com/blog/socket-sharding-nginx-release-1-9-1/ \ No newline at end of file +[15]:http://nginx.com/blog/socket-sharding-nginx-release-1-9-1/ From 957ca2f001291eade1765802bccdfa664a17f05d Mon Sep 17 00:00:00 2001 From: DeadFire Date: Mon, 15 Jun 2015 15:43:44 +0800 Subject: [PATCH 382/965] =?UTF-8?q?20150615-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...P at 20--From pet project to powerhouse.md | 82 +++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 sources/talk/20150615 PHP at 20--From pet project to powerhouse.md diff --git a/sources/talk/20150615 PHP at 20--From pet project to powerhouse.md b/sources/talk/20150615 PHP at 20--From pet project to powerhouse.md new file mode 100644 index 0000000000..610913c846 --- /dev/null +++ b/sources/talk/20150615 PHP at 20--From pet project to powerhouse.md @@ -0,0 +1,82 @@ +PHP at 20: From pet project to powerhouse +================================================================================ +![](http://images.techhive.com/images/article/2015/06/13049862325_8c97a11878_z-100590275-primary.idge.jpg) + +Credit: [Steve Jurvetson via Flickr][1] + +> The one-time ‘silly little project’ has transformed into a Web powerhouse, thanks to flexibility, pragmatism, and a vibrant community of Web devs + +When Rasmus Lerdorf released “[a set of small tight CGI binaries written in C][2],” he had no idea how much his creation would impact Web development. Delivering the opening keynote at this year’s SunshinePHP conference in Miami, Lerdorf quipped, “In 1995, I thought I had unleashed a C API upon the Web. Obviously, that’s not what happened, or we’d all be C programmers.” + +In fact, when Lerdorf released version 1.0 of Personal Home Page Tools -- as PHP was then known -- the Web was very young. HTML 2.0 would not be published until November of that year, and HTTP/1.0 not until May the following year. NCSA HTTPd was the most widely deployed Web server, and Netscape Navigator was the most popular Web browser, with Internet Explorer 1.0 to arrive in August. In other words, PHP’s beginnings coincided with the eve of the browser wars. + +Those early days speak volumes about PHP’s impact on Web development. Back then, our options were limited when it came to server-side processing for Web apps. PHP stepped in to fill our need for a tool that would enable us to do dynamic things on the Web. That practical flexibility captured our imaginations, and PHP has since grown up with the Web. Now powering [more than 80 percent of the Web][3], PHP has matured into a scripting language that is especially suited to solve the Web problem. Its unique pedigree tells a story of pragmatism over theory and problem solving over purity. + +### The Web glue we got hooked on ### + +PHP didn’t start out as a language, and this is clear from its design -- or lack thereof, as detractors point out. It began as an API to help Web developers access lower-level C libraries. The first version was a small CGI binary that provided form-processing functionality with access to request parameters and the mSQL database. And its facility with a Web app’s database would prove key in sparking our interest in PHP and PHP’s subsequent ascendancy. + +By version 2 -- aka PHP/FI -- database support had expanded to include PostgreSQL, MySQL, Oracle, Sybase, and more. It supported these databases by wrapping their C libraries, making them a part of the PHP binary. PHP/FI could also wrap the GD library to create and manipulate GIF images. It could be run as an Apache module or compiled with FastCGI support, and it introduced the PHP script language with support for variables, arrays, language constructs, and functions. For many of us working on the Web at that time, PHP was the kind of glue we'd been looking for. + +As PHP folded in more and more programming language features, morphing into version 3 and onward, it never lost this gluelike aspect. Through repositories like PECL (PHP Extension Community Library), PHP could tie together libraries and expose their functionality to the PHP layer. This capacity to bring together components became a significant facet of the beauty of PHP, though it was not limited to its source code. + +### The Web as a community of coders ### + +PHP’s lasting impact on Web development isn’t limited to what can be done with the language itself. How PHP work is done and who participates -- these too are important parts of PHP’s legacy. + +As early as 1997, PHP user groups began forming. One of the earliest was the Midwest PHP User’s Group (later known as Chicago PHP), which held its [first meeting in February 1997][4]. This was the beginning of what would become a vibrant, energetic community of developers assembled over an affinity for a little tool that helped them solve problems on the Web. The ubiquity of PHP made it a natural choice for Web development. It became especially popular in the shared hosting world, and its low barrier to entry was attractive to many early Web developers. + +With a growing community came an assortment of tools and resources for PHP developers. The year 2000 -- a watershed moment for PHP -- witnessed the first PHP Developers’ Meeting, a gathering of the core developers of the programming language, who met in Tel Aviv to discuss the forthcoming 4.0 release. PHP Extension and Application Repository (PEAR) also launched in 2000 to provide high-quality userland code packages following standards and best practices. The first PHP conference, PHP Kongress, was held in Germany soon after. [PHPDeveloper.org][5] came online, and to this day, it is the most authoritative news source in the PHP community. + +This communal momentum proved vital to PHP’s growth in subsequent years, and as the Web development industry erupted, so did PHP. PHP began powering more and larger websites. More user groups formed around the world. Mailing lists; online forums; IRC; conferences; trade journals such as php[architect], the German PHP Magazin, and International PHP Magazine -- the vibrancy of the PHP community had a significant impact on the way Web work would be done: collectively and openly, with an emphasis on code sharing. + +Then, 10 years ago, shortly after the release of PHP 5, an interesting thing happened in Web development that created a general shift in how the PHP community built libraries and applications: Ruby on Rails was released. + +### The rise of frameworks ### + +The Ruby on Rails framework for the Ruby programming language created an increased focus and attention on the MVC (model-view-controller) architectural pattern. The Mojavi PHP framework a few years prior had used this pattern, but the hype around Ruby on Rails is what firmly cemented MVC in the PHP frameworks that followed. Frameworks exploded in the PHP community, and frameworks have changed the way developers build PHP applications. + +Many important projects and developments have arisen, thanks to the proliferation of frameworks in the PHP community. The PHP [Framework Interoperability Group][6] formed in 2009 to aid in establishing coding standards, naming conventions, and best practices among frameworks. Codifying these standards and practices helped provide more interoperable software for developers using member projects’ code. This interoperability meant that each framework could be split into components and stand-alone libraries could be used together with monolithic frameworks. With interoperability came another important milestone: The Composer project was born in 2011. + +Inspired by Node.js’s NPM and Ruby’s Bundler, Composer has ushered in a new era of PHP application development, creating a PHP renaissance of sorts. It has encouraged interoperability between packages, standard naming conventions, adoption of coding standards, and increased test coverage. It is an essential tool in any modern PHP application. + +### The need for speed and innovation ### + +Today, the PHP community has a thriving ecosystem of applications and libraries. Some of the most widely installed PHP applications include WordPress, Drupal, Joomla, and MediaWiki. These applications power the Web presence of businesses of all sizes, from small mom-and-pop shops to sites like whitehouse.gov and Wikipedia. Six of the Alexa top 10 sites use PHP to serve billions of pages a day. As a result, PHP applications have been optimized for speed -- and much innovation has gone into PHP core to improve performance. + +In 2010, Facebook unveiled its HipHop for PHP source-to-source compiler, which translates PHP code into C++ code and compiles it into a single executable binary application. Facebook’s size and growth necessitated the move away from standard interpreted PHP code to a faster, optimized executable. However, Facebook wanted to continue using PHP for its ease of use and rapid development cycles. HipHop for PHP evolved into HHVM, a JIT (just-in-time) compilation-based execution engine for PHP, which included a new language based on PHP: [Hack][7]. + +Facebook’s innovations, as well as other VM projects, created competition at the engine level, leading to discussions about the future of the Zend Engine that still powers PHP’s core, as well as the question of a language specification. In 2014, a language specification project was created “to provide a complete and concise definition of the syntax and semantics of the PHP language,” making it possible for compiler projects to create interoperable PHP implementations. + +The next major version of PHP became a topic of intense debate, and a project known as phpng (next generation) was offered as an option to clean up, refactor, optimize, and improve the PHP code base, which also showed substantial improvements to the performance of real-world applications. After deciding to name the next major version “PHP 7,” due to a previous, unreleased PHP 6.0 version, the phpng branch was merged in, and plans were made to proceed with PHP 7, working in many of the language features offered by Hack, such as scalar and return type hinting. + +With the [first PHP 7 alpha release due out today][8] and benchmarks showing [performance as good as or better than that of HHVM][9] in many cases, PHP is keeping up with the pace of modern Web development needs. Likewise, the PHP-FIG continues to innovate and push frameworks and libraries to collaborate and cooperate -- most recently with the adoption of [PSR-7][10], which will change the way PHP projects handle HTTP. User groups, conferences, publications, and initiatives like [PHPMentoring.org][11] continue to advocate best practices, coding standards, and testing to the PHP developer community. + +PHP has seen the Web mature through various stages, and PHP has matured. Once a simple API wrapper around lower-level C libraries, PHP has become a full-fledged programming language in its own right. Its developer community is vibrant and helpful, priding themselves in pragmatism and welcoming newcomers. PHP has stood the test of time for 20 years, and current activity in the language and community is ensuring it will be a relevant and useful language for years to come. + +During his SunshinePHP keynote, Rasmus Lerdorf reflected, “Did I think I’d be here 20 years later talking about this silly little project I did? No, I didn’t.” + +Here’s to Lerdorf and the rest of the PHP community for transforming this “silly little project” into a lasting, powerful component of the Web today. + +-------------------------------------------------------------------------------- + +via: http://www.infoworld.com/article/2933858/php/php-at-20-from-pet-project-to-powerhouse.html + +作者:[Ben Ramsey][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.infoworld.com/author/Ben-Ramsey/ +[1]:https://www.flickr.com/photos/jurvetson/13049862325 +[2]:https://groups.google.com/d/msg/comp.infosystems.www.authoring.cgi/PyJ25gZ6z7A/M9FkTUVDfcwJ +[3]:http://w3techs.com/technologies/overview/programming_language/all +[4]:http://web.archive.org/web/20061215165756/http://chiphpug.php.net/mpug.htm +[5]:http://www.phpdeveloper.org/ +[6]:http://www.php-fig.org/ +[7]:http://www.infoworld.com/article/2610885/facebook-q-a--hack-brings-static-typing-to-php-world.html +[8]:https://wiki.php.net/todo/php70#timetable +[9]:http://talks.php.net/velocity15 +[10]:http://www.php-fig.org/psr/psr-7/ +[11]:http://phpmentoring.org/ \ No newline at end of file From 3d4e771f318899f20325eb7c7bb9e5ce6417534d Mon Sep 17 00:00:00 2001 From: wxy Date: Mon, 15 Jun 2015 15:45:13 +0800 Subject: [PATCH 383/965] PUB:20150518 Linux FAQs with Answers--How to view threads of a process on Linux @GOLinux --- ...-How to view threads of a process on Linux.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) rename {translated/tech => published}/20150518 Linux FAQs with Answers--How to view threads of a process on Linux.md (72%) diff --git a/translated/tech/20150518 Linux FAQs with Answers--How to view threads of a process on Linux.md b/published/20150518 Linux FAQs with Answers--How to view threads of a process on Linux.md similarity index 72% rename from translated/tech/20150518 Linux FAQs with Answers--How to view threads of a process on Linux.md rename to published/20150518 Linux FAQs with Answers--How to view threads of a process on Linux.md index a91a2b3ed3..0011c66b1e 100644 --- a/translated/tech/20150518 Linux FAQs with Answers--How to view threads of a process on Linux.md +++ b/published/20150518 Linux FAQs with Answers--How to view threads of a process on Linux.md @@ -1,16 +1,16 @@ -Linux有问必答——Linux上如何查看某个进程的线程 +Linux有问必答:Linux上如何查看某个进程的线程 ================================================================================ -> **问题**: 我的程序创建并在它里头执行了多个线程,我怎样才能在该程序创建线程后监控其中单个线程?我想要看到带有它们名称的单个线程详细情况(如,CPU/内存使用率)。 +> **问题**: 我的程序在其内部创建并执行了多个线程,我怎样才能在该程序创建线程后监控其中单个线程?我想要看到带有它们名称的单个线程详细情况(如,CPU/内存使用率)。 -线程是现代操作系统上进行并行执行的一个流行的编程方面的抽象概念。当一个程序内有多个线程被叉分出用以执行多个流时,这些线程就会在它们之间共享特定的资源(如,内存地址空间、打开的文件),以使叉分开销最小化,并避免大量花销IPC(进程间通信)频道。这些功能让线程在并发执行时成为一个高效的机制。 +线程是现代操作系统上进行并行执行的一个流行的编程方面的抽象概念。当一个程序内有多个线程被叉分出用以执行多个流时,这些线程就会在它们之间共享特定的资源(如,内存地址空间、打开的文件),以使叉分开销最小化,并避免大量高成本的IPC(进程间通信)通道。这些功能让线程在并发执行时成为一个高效的机制。 -在Linux中,程序中创建的线程(也称为轻量级进程,LWP)会具有和程序的PID相同的“线程组ID”。然后,各个线程会获得其自身的线程ID(TID)。对于Linux内核调度器而言,线程不过是恰好共享特定资源的标准的进程。经典的命令行工具,如ps或top,都可以用来显示线程级别的信息,默认情况下它们会显示进程级别的信息。 +在Linux中,程序中创建的线程(也称为轻量级进程,LWP)会具有和程序的PID相同的“线程组ID”。然后,各个线程会获得其自身的线程ID(TID)。对于Linux内核调度器而言,线程不过是恰好共享特定资源的标准的进程而已。经典的命令行工具,如ps或top,都可以用来显示线程级别的信息,只是默认情况下它们显示进程级别的信息。 这里提供了**在Linux上显示某个进程的线程**的几种方式。 ### 方法一:PS ### -在ps命令中,“-T”选项可以开启线程查看。下面的命令列出了由进程号为的进程创建的所有线程。 +在ps命令中,“-T”选项可以开启线程查看。下面的命令列出了由进程号为\的进程创建的所有线程。 $ ps -T -p @@ -26,7 +26,7 @@ top命令可以实时显示各个线程情况。要在top输出中开启线程 ![](https://farm9.staticflickr.com/8824/17350561070_3dfe447974_c.jpg) -要让top输出某个特定进程并检查该进程内运行的线程状况: +要让top输出某个特定进程\并检查该进程内运行的线程状况: $ top -H -p @@ -36,7 +36,7 @@ top命令可以实时显示各个线程情况。要在top输出中开启线程 一个对用户更加友好的方式是,通过htop查看单个进程的线程,它是一个基于ncurses的交互进程查看器。该程序允许你在树状视图中监控单个独立线程。 -要在htop中启用线程查看,请开启htop,然后按来进入htop的设置菜单。选择“设置”栏下面的“显示选项”,然后开启“树状视图”和“显示自定义线程名”选项。按退出设置。 +要在htop中启用线程查看,请开启htop,然后按\来进入htop的设置菜单。选择“设置”栏下面的“显示选项”,然后开启“树状视图”和“显示自定义线程名”选项。按\退出设置。 ![](https://farm6.staticflickr.com/5338/17350364568_59bce22e7b_b.jpg) @@ -50,7 +50,7 @@ via: http://ask.xmodulo.com/view-threads-process-linux.html 作者:[Dan Nanni][a] 译者:[GOLinux](https://github.com/GOLinux) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 92a639eeb95824bc53e0d52594c4ef9acb9601d9 Mon Sep 17 00:00:00 2001 From: wxy Date: Mon, 15 Jun 2015 15:58:21 +0800 Subject: [PATCH 384/965] PUB:20150521 Linux FAQs with Answers--How to install Unity Tweak Tool on Ubuntu desktop @ictlyh --- ...rs--How to install Unity Tweak Tool on Ubuntu desktop.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename {translated/tech => published}/20150521 Linux FAQs with Answers--How to install Unity Tweak Tool on Ubuntu desktop.md (86%) diff --git a/translated/tech/20150521 Linux FAQs with Answers--How to install Unity Tweak Tool on Ubuntu desktop.md b/published/20150521 Linux FAQs with Answers--How to install Unity Tweak Tool on Ubuntu desktop.md similarity index 86% rename from translated/tech/20150521 Linux FAQs with Answers--How to install Unity Tweak Tool on Ubuntu desktop.md rename to published/20150521 Linux FAQs with Answers--How to install Unity Tweak Tool on Ubuntu desktop.md index def6860616..273d603c98 100644 --- a/translated/tech/20150521 Linux FAQs with Answers--How to install Unity Tweak Tool on Ubuntu desktop.md +++ b/published/20150521 Linux FAQs with Answers--How to install Unity Tweak Tool on Ubuntu desktop.md @@ -1,4 +1,4 @@ -Linux 有问必答--如何在桌面版 Ubuntu 中安装 Unity Tweak Tool +Linux 有问必答:如何在桌面版 Ubuntu 中安装 Unity Tweak Tool ================================================================================ > **问题**: 我试着给刚安装的桌面版 Ubuntu 自定制桌面。我想使用 Unity Tweak Tool。我怎样才能在 Ubuntu 上安装 Unity Tweak Tool 呢? @@ -6,7 +6,7 @@ Linux 有问必答--如何在桌面版 Ubuntu 中安装 Unity Tweak Tool ![](https://farm6.staticflickr.com/5463/17684020389_25dc7f0db2_b.jpg) -尽管 Unity Tweak Tool 是桌面版 Ubuntu 的重要工具,并没有在桌面版 Ubuntu 中预安装。为了能自定制 Unity 桌面,下面介绍一下如何在桌面版 Ubuntu 中安装 Unity Tweak Tool。 +尽管 Unity Tweak Tool 是桌面版 Ubuntu 的重要工具,但并没有在桌面版 Ubuntu 中预安装。为了能自定制 Unity 桌面,下面介绍一下如何在桌面版 Ubuntu 中安装 Unity Tweak Tool。 ### 在 Ubuntu 13.04 或更高版本中安装 Unity Tweak Tool ### @@ -34,7 +34,7 @@ via: http://ask.xmodulo.com/install-unity-tweak-tool-ubuntu-desktop.html 作者:[Dan Nanni][a] 译者:[ictlyh](https://github.com/ictlyh) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From a471b5ddc790953e638069d9c324e9d2118432b0 Mon Sep 17 00:00:00 2001 From: wxy Date: Mon, 15 Jun 2015 16:15:33 +0800 Subject: [PATCH 385/965] PUB:20150527 3 Useful Hacks Every Linux User Must Know @goreliu --- ...Useful Hacks Every Linux User Must Know.md | 27 ++++++++++--------- 1 file changed, 14 insertions(+), 13 deletions(-) rename {translated/tech => published}/20150527 3 Useful Hacks Every Linux User Must Know.md (79%) diff --git a/translated/tech/20150527 3 Useful Hacks Every Linux User Must Know.md b/published/20150527 3 Useful Hacks Every Linux User Must Know.md similarity index 79% rename from translated/tech/20150527 3 Useful Hacks Every Linux User Must Know.md rename to published/20150527 3 Useful Hacks Every Linux User Must Know.md index 25c1ef3e3d..f4da7cf24b 100644 --- a/translated/tech/20150527 3 Useful Hacks Every Linux User Must Know.md +++ b/published/20150527 3 Useful Hacks Every Linux User Must Know.md @@ -1,9 +1,10 @@ -每个Linux用户都应该知道的3个有用技巧 +Linux 用户的 3 个命令行小技巧 ================================================================================ Linux世界充满了乐趣,我们越深入进去,就会发现越多有趣的事物。我们会努力给你提供一些小技巧,让你和其他人有所不同,下面就是我们准备的3个小技巧。 -### 1. 如何在不使用Cron的情况调度Linux下的作业 ### -在Linux下,调度一个作业/命令可以缩写为Cron。当我们需要调度一个作业时,我们会使用Cron,但你知道我们在不使用Cron的情况也可以调度一个在将来时间运行的作业吗?你可以按照如下建议操作…… +### 1. 如何在不使用Cron的情况调度Linux下的任务 ### + +在Linux下,调度一个任务/命令称之为Cron。当我们需要调度一个任务时,我们会使用Cron,但你知道我们在不使用Cron的情况也可以调度一个在将来时间运行的任务吗?你可以按照如下建议操作…… 每5秒钟运行一个命令(date)然后将结果写入到一个文件(data.txt)。为了实现这一点,我们可以直接在命令提示符运行如下单行脚本。 @@ -21,13 +22,13 @@ Linux世界充满了乐趣,我们越深入进去,就会发现越多有趣的 类似地,我们可以这样运行任何脚本。下边的例子是每100秒运行一个名为`script_name.sh`的脚本。 -另外值得一提的是上边的脚本文件必须处于当前目录中,否则需要使用完整路径(`/home/$USER/…/script_name.sh`)。实现如上功能的单行脚本如下: +另外值得一提的是上面提到的脚本文件必须处于当前目录中,否则需要使用完整路径(`/home/$USER/…/script_name.sh`)。实现如上功能的单行脚本如下: $ while true; do /bin/sh script_name.sh ; sleep 100 ; done & **总结**:上述的单行脚本并不是Cron的替代品,因为Cron工具支持众多选项,更加灵活,可定制性也更高。然而如果我们想运行某些测试,比如I/O评测,上述的单行脚本也管用。 -还可以参考:[11 Linux Cron Job Scheduling Examples][1] +还可以参考:[Linux 下 11 个定时调度任务例子][1] ### 2. 如何不使用clear命令清空终端的内容 ### @@ -37,23 +38,23 @@ Linux世界充满了乐趣,我们越深入进去,就会发现越多有趣的 **总结**:因为`ctrl + l`是一个快捷键,我们不可以在脚本中使用。所以如果我们需要在脚本中清空屏幕内容,还是需要使用`clear`命令。但我能想到的所有其他情况,`ctrl + l`都更加有效。 -### 3. 运行一个命令,然后自动回到当前的工作目录 ### +### 3. 在其它目录运行一个命令,然后自动返回当前工作目录 ### -这是一个很多人可能不知道的令人吃惊的技巧。你可能想运行任何一个命令,然后再回到当前目录。你只需要将命令放在一个圆括号里。 +这是一个很多人可能不知道的令人吃惊的技巧。你可能想在其它目录运行任何一个命令,然后再回到当前目录。要实现这样的目的,你只需要将命令放在一个圆括号里。 我们来看一个例子: avi@deb:~$ (cd /home/avi/Downloads/) -#### 示例输出 #### - - avi@deb:~ +示例输出: + + avi@deb:~ 它首先会cd到Downloads目录,然后又回到了之前的家目录。也许你认为里边的命令根本没有执行,或者是出了某种错误,因为从命令提示符看不出任何变化。让我们简单修改一下这个命令: avi@deb:~$ (cd /home/avi/Downloads/ && ls -l) - -#### 示例输出 #### + +示例输出: -rw-r----- 1 avi avi 54272 May 3 18:37 text1.txt -rw-r----- 1 avi avi 54272 May 3 18:37 text2.txt @@ -70,7 +71,7 @@ via: http://www.tecmint.com/useful-linux-hacks-commands/ 作者:[Avishek Kumar][a] 译者:[goreliu](https://github.com/goreliu) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 1e2cd00a6919da648a8b5894506b427bab097263 Mon Sep 17 00:00:00 2001 From: DeadFire Date: Mon, 15 Jun 2015 16:25:12 +0800 Subject: [PATCH 386/965] =?UTF-8?q?20150615-2=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...end Swap Space using Swap file in Linux.md | 73 +++++++ ...er On Ubuntu or CentOS 7.1 or Fedora 22.md | 191 ++++++++++++++++++ ...put Rainbow Of Colors in Linux Terminal.md | 176 ++++++++++++++++ ...0615 How to combine two graphs on Cacti.md | 91 +++++++++ 4 files changed, 531 insertions(+) create mode 100644 sources/tech/20150515 Extend Swap Space using Swap file in Linux.md create mode 100644 sources/tech/20150515 Install Plex Media Server On Ubuntu or CentOS 7.1 or Fedora 22.md create mode 100644 sources/tech/20150515 Lolcat--A Command Line Tool to Output Rainbow Of Colors in Linux Terminal.md create mode 100644 sources/tech/20150615 How to combine two graphs on Cacti.md diff --git a/sources/tech/20150515 Extend Swap Space using Swap file in Linux.md b/sources/tech/20150515 Extend Swap Space using Swap file in Linux.md new file mode 100644 index 0000000000..51b2f2fe55 --- /dev/null +++ b/sources/tech/20150515 Extend Swap Space using Swap file in Linux.md @@ -0,0 +1,73 @@ +Extend Swap Space using Swap file in Linux +================================================================================ +There are some scenarios where our Linux box is running out of swap space so in that case we can extend the swap space using swap partition but due to unavailability of free partitions on the disk, we are unable to extend it. + +So in such cases we can extend or increase swap space using a swap file + +### Below are the Steps to extend Swap Space using Swap File in Linux ### + +Lets first check the size of existing swap space / partition using the command like ‘**free -m‘** and ‘**swapon -s**‘ + +![](http://www.linuxtechi.com/wp-content/uploads/2015/06/free-output-with-swap.jpg) +free-output-with-swap + +In my case size of swap partition is 2 GB. So we will be extending swap space by 1 GB. + +#### Step:1 Create a swap file of size 1 GB using below dd Command #### + + [root@linuxtechi ~]# dd if=/dev/zero of=/swap_file bs=1G count=1 + 1+0 records in + 1+0 records out + 1073741824 bytes (1.1 GB) copied, 414.898 s, 2.6 MB/s + [root@linuxtechi ~]# + +Replace the value of ‘**bs**‘ and ‘**count**‘ according your requirement. + +#### Step:2 Secure the swap file with permissions 644. #### + + [root@linuxtechi ~]# chmod 600 /swap_file + +#### Step:3 Enable the Swap Area on the file (swap_file) #### + +Use mkswap command to enable swap area + + [root@linuxtechi ~]# mkswap /swap_file + Setting up swapspace version 1, size = 1048572 KiB + no label, UUID=f7b3ae59-c09a-4dc2-ba4d-c02abb7db33b + [root@linuxtechi ~]# + +#### Step:4 Add the swap file entry in the fstab file #### + +Add the below entry in the fstab file so that swap file become persistent across every reboot. + + /swap_file swap swap defaults 0 0 + +![swap-file-fstab-entry](http://www.linuxtechi.com/wp-content/uploads/2015/06/swap-file-fstab-entry.jpg) + +#### Step:5 Enable the swap file using ‘mkswap on’ command. #### + + [root@linuxtechi ~]# swapon /swap_file + [root@linuxtechi ~]# + +#### Step:6 Now verify the swap space #### + +![swap-space-after-extension](http://www.linuxtechi.com/wp-content/uploads/2015/06/swap-space-after-extension.jpg) + +**Note**: To disable the swap file for any troubleshooting point of view, use swapoff command as shown below and to re-enable swap file then use swapon command as shown in step5. + + [root@linuxtechi ~]# swapoff /swap_file + [root@linuxtechi ~]# + +Please share your valuable inputs and comments of this article. + +-------------------------------------------------------------------------------- + +via: http://www.linuxtechi.com/extend-swap-space-using-swap-file-in-linux/ + +作者:[Pradeep Kumar][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.linuxtechi.com/author/pradeep/ \ No newline at end of file diff --git a/sources/tech/20150515 Install Plex Media Server On Ubuntu or CentOS 7.1 or Fedora 22.md b/sources/tech/20150515 Install Plex Media Server On Ubuntu or CentOS 7.1 or Fedora 22.md new file mode 100644 index 0000000000..837a7a2e73 --- /dev/null +++ b/sources/tech/20150515 Install Plex Media Server On Ubuntu or CentOS 7.1 or Fedora 22.md @@ -0,0 +1,191 @@ +Install Plex Media Server On Ubuntu / CentOS 7.1 / Fedora 22 +================================================================================ +In this article we will show you how easily you can setup Plex Home Media Server on major Linux distributions with their latest releases. After its successful installation of Plex you will be able to use your centralized home media playback system that streams its media to many Plex player Apps and the Plex Home will allows you to setup your environment by adding your devices and to setup a group of users that all can use Plex Together. So let’s start its installation first on Ubuntu 15.04. + +### Basic System Resources ### + +System resources mainly depend on the type and number of devices that you are planning to connect with the server. So according to our requirements we will be using as following system resources and software for a standalone server. + +注:表格 + + + + + + + + + + + + + + + + + + + + + + +
Plex Home Media Server
Base Operating SystemUbuntu 15.04 / CentOS 7.1 / Fedora 22 Work Station
Plex Media ServerVersion 0.9.12.3.1173-937aac3
RAM and CPU1 GB  , 2.0 GHZ
Hard Disk30 GB
+ +### Plex Media Server 0.9.12.3 on Ubuntu 15.04 ### + +We are now ready to start the installations process of Plex Media Server on Ubuntu so let’s start with the following steps to get it ready. + +#### Step 1: System Update #### + +Login to your server with root privileges Make your that your system is upto date if not then do by using below command. + + root@ubuntu-15:~#apt-get update + +#### Step 2: Download the Latest Plex Media Server Package #### + +Create a new directory and download .deb plex Media Package in it from the official website of Plex for Ubuntu using wget command. + + root@ubuntu-15:~# cd /plex/ + root@ubuntu-15:/plex# + root@ubuntu-15:/plex# wget https://downloads.plex.tv/plex-media-server/0.9.12.3.1173-937aac3/plexmediaserver_0.9.12.3.1173-937aac3_amd64.deb + +#### Step 3: Install the Debian Package of Plex Media Server #### + +Now within the same directory run following command to start installation of debian package and then check the status of plekmediaserver. + + root@ubuntu-15:/plex# dpkg -i plexmediaserver_0.9.12.3.1173-937aac3_amd64.deb + +---------- + + root@ubuntu-15:~# service plexmediaserver status + +![Plexmediaserver Service](http://blog.linoxide.com/wp-content/uploads/2015/06/plex-status.png) + +### Plex Home Media Web App Setup on Ubuntu 15.04 ### + +Let's open your web browser within your localhost network and open the Web Interface with your localhost IP and port 32400 and do following steps to configure it: + + http://172.25.10.179:32400/web + http://localhost:32400/web + +#### Step 1:Sign UP before Login #### + +After you have access to the web interface of Plesk Media Server make sure to Sign Up and set your username email ID and Password to login as. + +![Plex Sign In](http://blog.linoxide.com/wp-content/uploads/2015/06/PMS-Login.png) + +#### Step 2: Enter Your Pin to Secure Your Plex Media Home User #### + +![Plex User Pin](http://blog.linoxide.com/wp-content/uploads/2015/06/333.png) + +Now you have successfully configured your user under Plex Home Media. + +![Welcome To Plex](http://blog.linoxide.com/wp-content/uploads/2015/06/3333.png) + +### Opening Plex Web App on Devices Other than Localhost Server ### + +As we have seen in our Plex media home page that it indicates that "You do not have permissions to access this server". Its because of we are on a different network than the Server computer. + +![Plex Server Permissions](http://blog.linoxide.com/wp-content/uploads/2015/06/33.png) + +Now we need to resolve this permissions issue so that we can have access to server on the devices other than the hosted server by doing following setup. + +### Setup SSH Tunnel for Windows System to access Linux Server ### + +First we need to set up a SSH tunnel so that we can access things as if they were local. This is only necessary for the initial setup. + +If you are using Windows as your local system and server on Linux then we can setup SSH-Tunneling using Putty as shown. + +![Plex SSH Tunnel](http://blog.linoxide.com/wp-content/uploads/2015/06/ssh-tunnel.png) + +**Once you have the SSH tunnel set up:** + +Open your Web browser window and type following URL in the address bar. + + http://localhost:8888/web + +The browser will connect to the server and load the Plex Web App with same functionality as on local. +Agree to the terms of Services and start + +![Agree to Plex term](http://blog.linoxide.com/wp-content/uploads/2015/06/5.png) + +Now a fully functional Plex Home Media Server is ready to add new media libraries, channels, playlists etc. + +![PMS Settings](http://blog.linoxide.com/wp-content/uploads/2015/06/8.png) + +### Plex Media Server 0.9.12.3 on CentOS 7.1 ### + +We will follow the same steps on CentOS-7.1 that we did for the installation of Plex Home Media Server on Ubuntu 15.04. + +So lets start with Plex Media Servers Package Installation. + +#### Step 1: Plex Media Server Installation #### + +To install Plex Media Server on centOS 7.1 we need to download the .rpm package from the official website of Plex. So we will use wget command to download .rpm package for this purpose in a new directory. + + [root@linux-tutorials ~]# cd /plex + [root@linux-tutorials plex]# wget https://downloads.plex.tv/plex-media-server/0.9.12.3.1173-937aac3/plexmediaserver-0.9.12.3.1173-937aac3.x86_64.rpm + +#### Step 2: Install .RPM Package #### + +After completion of complete download package we will install this package using rpm command within the same direcory where we installed the .rpm package. + + [root@linux-tutorials plex]# ls + plexmediaserver-0.9.12.3.1173-937aac3.x86_64.rpm + [root@linux-tutorials plex]# rpm -i plexmediaserver-0.9.12.3.1173-937aac3.x86_64.rpm + +#### Step 3: Start Plexmediaservice #### + +We have successfully installed Plex Media Server Now we just need to restart its service and then enable it permanently. + + [root@linux-tutorials plex]# systemctl start plexmediaserver.service + [root@linux-tutorials plex]# systemctl enable plexmediaserver.service + [root@linux-tutorials plex]# systemctl status plexmediaserver.service + +### Plex Home Media Web App Setup on CentOS-7.1 ### + +Now we just need to repeat all steps that we performed during the Web app setup of Ubuntu. +So let's Open a new window in your web browser and access the Plex Media Server Web app using localhost or IP or your Plex server. + + http://172.20.3.174:32400/web + http://localhost:32400/web + +Then to get full permissions on the server you need to repeat the steps to create the SSH-Tunnel. +After signing up with new user account we will be able to access its all features and can add new users, add new libraries and setup it per our needs. + +![Plex Device Centos](http://blog.linoxide.com/wp-content/uploads/2015/06/plex-devices-centos.png) + +### Plex Media Server 0.9.12.3 on Fedora 22 Work Station ### + +The Basic steps to download and install Plex Media Server are the same as its we did for in CentOS 7.1. +We just need to download its .rpm package and then install it with rpm command. + +![PMS Installation](http://blog.linoxide.com/wp-content/uploads/2015/06/plex-on-fedora.png) + +### Plex Home Media Web App Setup on Fedora 22 Work Station ### + +We had setup Plex Media Server on the same host so we don't need to setup SSH-Tunnel in this time scenario. Just open the web browser in your Fedora 22 Workstation with default port 32400 of Plex Home Media Server and accept the Plex Terms of Services Agreement. + +![Plex Agreement](http://blog.linoxide.com/wp-content/uploads/2015/06/Plex-Terms.png) + +**Welcome to Plex Home Media Server on Fedora 22 Workstation** + +Lets login with your plex account and start with adding your libraries for your favorite movie channels , create your playlists, add your photos and enjoy with many other features of Plex Home Media Server. + +![Plex Add Libraries](http://blog.linoxide.com/wp-content/uploads/2015/06/create-library.png) + +### Conclusion ### + +We had successfully installed and configured Plex Media Server on Major Linux Distributions. So, Plex Home Media Server has always been a best choice for media management. Its so simple to setup on cross platform as we did for Ubuntu, CentOS and Fedora. It has simplifies the tasks of organizing your media content and streaming to other computers and devices then to share it with your friends. + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/tools/install-plex-media-server-ubuntu-centos-7-1-fedora-22/ + +作者:[Kashif Siddique][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://linoxide.com/author/kashifs/ \ No newline at end of file diff --git a/sources/tech/20150515 Lolcat--A Command Line Tool to Output Rainbow Of Colors in Linux Terminal.md b/sources/tech/20150515 Lolcat--A Command Line Tool to Output Rainbow Of Colors in Linux Terminal.md new file mode 100644 index 0000000000..6b864db6cb --- /dev/null +++ b/sources/tech/20150515 Lolcat--A Command Line Tool to Output Rainbow Of Colors in Linux Terminal.md @@ -0,0 +1,176 @@ +Lolcat – A Command Line Tool to Output Rainbow Of Colors in Linux Terminal +================================================================================ +For those who believe that Linux Command Line is boring and there isn’t any fun, then you’re wrong here are the articles on Linux, that shows how funny and naughty is Linux.. + +- [20 Funny Commands of Linux or Linux is Fun in Terminal][1] +- [6 Interesting Funny Commands of Linux (Fun in Terminal)][2] +- [Fun in Linux Terminal – Play with Word and Character Counts][3] + +Here in this article, I will be discussing about a small utility called “lolcat” – Which produce rainbow of colors in terminal. + +![Lolcat Command to Output Rainbow of Colors for Terminal](http://www.tecmint.com/wp-content/uploads/2015/06/Linux-Lolcat.png) + +Lolcat Command to Output Rainbow of Colors for Terminal + +#### What is lolcat? #### + +Lolcat is an utility for Linux, BSD and OSX which concatenates like similar to [cat command][4] and adds rainbow coloring to it. Lolcat is primarily used for rainbow coloring of text in Linux Terminal. + +### Installation of Lolcat in Linux ### + +**1. Lolcat utility is available in the repository of lots of Linux distributions, but the available version bit older. Alternatively you can download and install latest version of lolcat from git repository.** + +Lolcat is a ruby gem hence it is essential to have latest version of RUBY installed on your system. + + # apt-get install ruby [On APT based Systems] + # yum install ruby [On Yum based Systems] + # dnf install ruby [On DNF based Systems] + +Once ruby package has been installed, make sure to verify the version of ruby installed. + + # ruby --version + + ruby 2.1.5p273 (2014-11-13) [x86_64-linux-gnu] + +**2. Next download and install the most recent version of lolcat from the git repository using following commands.** + + # wget https://github.com/busyloop/lolcat/archive/master.zip + # unzip master.zip + # cd lolcat-master/bin + # gem install lolcat + +Once lolcat is installed, you can check the version. + + # lolcat --version + + lolcat 42.0.99 (c)2011 moe@busyloop.net + +### Usage of Lolcat ### + +**3. Before starting usage of lolcat, make sure to know the available options and help using following command.** + + # lolcat -h + +![Lolcat Help](http://www.tecmint.com/wp-content/uploads/2015/06/Lolcat-Help1.png) + +Lolcat Help + +**4. Next, pipeline lolcat with commads say ps, date and cal as:** + + # ps | lolcat + # date | lolcat + # cal | lolcat + +![ps Command Output](http://www.tecmint.com/wp-content/uploads/2015/06/ps-command-output.png) + +ps Command Output + +![Date Output](http://www.tecmint.com/wp-content/uploads/2015/06/Date.png) + +Date Output + +![Calendar Output](http://www.tecmint.com/wp-content/uploads/2015/06/Cal.png) + +Calendar Output + +**5. 3. Use lolcat to display codes of a script file as:** + + # lolcat test.sh + +![Display Codes with Lolcat](http://www.tecmint.com/wp-content/uploads/2015/06/Script-Output.png) + +Display Codes with Lolcat + +**6. Pipeline lolcat with figlet command. Figlet is a utility which displays large characters made up of ordinary screen characters. We can pipeline the output of figlet with lolcat to make the output colorful as:** + + # echo I ❤ Tecmint | lolcat + # figlet I Love Tecmint | lolcat + +![Colorful Texts](http://www.tecmint.com/wp-content/uploads/2015/06/Colorful-Text.png) + +Colorful Texts + +**Note**: Not to mention that ❤ is an unicode character and to install figlet you have to yum and apt to get the required packages as: + + # apt-get figlet + # yum install figlet + # dnf install figlet + +**7. Animate a text in rainbow of colours, as:** + + $ echo I ❤ Tecmit | lolcat -a -d 500 + +![Animated Text](http://www.tecmint.com/wp-content/uploads/2015/06/Animated-Text.gif) + +Animated Text + +Here the option -a is for Animation and -d is for duration. In the above example duration count is 500. + +**8. Read a man page (say man ls) in rainbow of colors as:** + + # man ls | lolcat + +![List Files Colorfully](http://www.tecmint.com/wp-content/uploads/2015/06/List-Files-Colorfully.png) + +List Files Colorfully + +**9. Pipeline lolcat with cowsay. cowsay is a configurable thinking and/or speaking cow, which supports a lot of other animals as well.** + +Install cowsay as: + + # apt-get cowsay + # yum install cowsay + # dnf install cowsay + +After install, print the list of all the animals in cowsay as: + + # cowsay -l + +**Sample Output** + + Cow files in /usr/share/cowsay/cows: + apt beavis.zen bong bud-frogs bunny calvin cheese cock cower daemon default + dragon dragon-and-cow duck elephant elephant-in-snake eyes flaming-sheep + ghostbusters gnu head-in hellokitty kiss kitty koala kosh luke-koala + mech-and-cow meow milk moofasa moose mutilated pony pony-smaller ren sheep + skeleton snowman sodomized-sheep stegosaurus stimpy suse three-eyes turkey + turtle tux unipony unipony-smaller vader vader-koala www + +Output of cowsay pipelined with lolcat and ‘gnu‘ cowfile is used. + + # cowsay -f gnu ☛ Tecmint ☚ is the best Linux Resource Available online | lolcat + +![Cowsay with Lolcat](http://www.tecmint.com/wp-content/uploads/2015/06/Cowsay-with-Lolcat.png) + +Cowsay with Lolcat + +**Note**: You can use lolcat with any other command in pipeline and get colored output in terminal. + +**10. You may create alias for the most frequently used commands to get command output in rainbow of colors. You can alias ‘ls -l‘ command which is used for long list the contents of directory as below.** + + # alias lolls="ls -l | lolcat" + # lolls + +![Alias Commands with Colorful](http://www.tecmint.com/wp-content/uploads/2015/06/Alias-Commands-with-Colorful.png) + +Alias Commands with Colorful + +You may create alias for any command as suggested above. To create permanent alias, you have to add the relevant code (above code for ls -l alias) to ~/.bashrc file and also make sure to logout and login back for the changes to be taken into effect. + +That’s all for now. I would like to know if you were aware of lolcat previously? Did you like the post? And suggestion and feedback is welcome in the comment section below. Like and share us and help us get spread. + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/lolcat-command-to-output-rainbow-of-colors-in-linux-terminal/ + +作者:[Avishek Kumar][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/avishek/ +[1]:http://www.tecmint.com/20-funny-commands-of-linux-or-linux-is-fun-in-terminal/ +[2]:http://www.tecmint.com/linux-funny-commands/ +[3]:http://www.tecmint.com/play-with-word-and-character-counts-in-linux/ +[4]:http://www.tecmint.com/13-basic-cat-command-examples-in-linux/ \ No newline at end of file diff --git a/sources/tech/20150615 How to combine two graphs on Cacti.md b/sources/tech/20150615 How to combine two graphs on Cacti.md new file mode 100644 index 0000000000..aeb2b2ea0c --- /dev/null +++ b/sources/tech/20150615 How to combine two graphs on Cacti.md @@ -0,0 +1,91 @@ +How to combine two graphs on Cacti +================================================================================ +[Cacti][1] a fantastic open source network monitoring system that is widely used to graph network elements like bandwidth, storage, processor and memory utilization. Using its web based interface, you can create and organize graphs easily. However, some advanced features like merging graphs, creating aggregate graphs using multiple sources, migration of Cacti to another server are not provided by default. You might need some experience with Cacti to pull these off. In this tutorial, we will see how we can merge two Cacti graphs into one. + +Consider this example. Client-A has been connected to port 5 of switch-A for the last six months. Port 5 becomes faulty, and so the client is migrated to Port 6. As Cacti uses different graphs for each interface/element, the bandwidth history of the client would be split into port 5 and port 6. So we end up with two graphs for one client - one with six months' worth of old data, and the other that contains ongoing data. + +In such cases, we can actually combine the two graphs so the old data is appended to the new graph, and we get to keep a single graph containing historic and new data for one customer. This tutorial will explain exactly how we can achieve that. + +Cacti stores the data of each graph in its own RRD (round robin database) file. When a graph is requested, the values stored in a corresponding RRD file are used to generate the graph. RRD files are stored in `/var/lib/cacti/rra` in Ubuntu/Debian systems and in `/var/www/cacti/rra` in CentOS/RHEL systems. + +The idea behind merging graphs is to alter these RRD files so the values from the old RRD file are appended to the new RRD file. + +### Scenario ### + +The services for a client is running on eth0 for over a year. Because of hardware failure, the client has been migrated to eth1 interface of another server. We want to graph the bandwidth of the new interface, while retaining the historic data for over a year. The client would see only one graph. + +### Identifying the RRD for the Graph ### + +The first step during graph merging is to identify the RRD file associated with a graph. We can check the file by opening the graph in debug mode. To do this, go to Cacti's menu: Console > Graph Management > Select Graph > Turn On Graph Debug Mode. + +#### Old graph: #### + +![](https://farm4.staticflickr.com/3853/18795518096_f50a78d082_c.jpg) + +#### New graph: #### + +![](https://farm4.staticflickr.com/3674/18634036918_5c4118c4b9_c.jpg) + +From the example output (which is based on a Debian system), we can identify the RRD files for two graphs: + +- **Old graph**: /var/lib/cacti/rra/old_graph_traffic_in_8.rrd +- **New graph**: /var/lib/cacti/rra/new_graph_traffic_in_10.rrd + +### Preparing a Script ### + +We will merge two RRD files using a [RRD splice script][2]. Download this PHP script, and install it as /var/lib/cacti/rra/rrdsplice.php (for Debian/Ubuntu) or /var/www/cacti/rra/rrdsplice.php (for CentOS/RHEL). + +Next, make sure that the file is owned by Apache user. + +On Debian or Ubuntu, run the following command: + + # chown www-data:www-data rrdsplice.php + +and update rrdsplice.php accordingly. Look for the following line: + + chown($finrrd, "apache"); + +and replace it with: + + chown($finrrd, "www-data"); + +On CentOS or RHEL, run the following command: + + # chown apache:apache rrdsplice.php + +### Merging Two Graphs ### + +The syntax usage of the script can easily be found by running it without any parameters. + + # cd /path/to/rrdsplice.php + # php rrdsplice.php + +---------- + + USAGE: rrdsplice.php --oldrrd=file --newrrd=file --finrrd=file + +Now we are ready to merge two RRD files. Simply supply the names of an old RRD file and a new RRD file. We will overwrite the merged result back to the new RRD file. + + # php rrdsplice.php --oldrrd=old_graph_traffic_in_8.rrd --newrrd=new_graph_traffic_in_10.rrd --finrrd=new_graph_traffic_in_10.rrd + +Now the data from the old RRD file should be appended to the new RRD. Any new data will continue to be written by Cacti to the new RRD file. If we click on the graph, we should be able to verify that the weekly, monthly and yearly records have also been added from the old graph. The second graph in the following diagram shows weekly records from the old graph. + +![](https://farm6.staticflickr.com/5493/18821787015_6730164068_b.jpg) + +To sum up, this tutorial showed how we can easily merge two Cacti graphs into one. This trick is useful when a service is migrated to another device/interface and we want to deal with only one graph instead of two. The script is very handy as it can join graphs regardless of the source device e.g., Cisco 1800 router and Cisco 2960 switch. + +Hope this helps. + +-------------------------------------------------------------------------------- + +via: http://xmodulo.com/combine-two-graphs-cacti.html + +作者:[Sarmed Rahman][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://xmodulo.com/author/sarmed +[1]:http://xmodulo.com/install-configure-cacti-linux.html +[2]:http://svn.cacti.net/viewvc/developers/thewitness/rrdsplice/rrdsplice.php \ No newline at end of file From 721288a50f8917cea27708ad36dd0cda357904d6 Mon Sep 17 00:00:00 2001 From: zpl1025 Date: Mon, 15 Jun 2015 17:59:23 +0800 Subject: [PATCH 387/965] [translating] 20150610 How to Manipulate Filenames Having Spaces and Special Characters in Linux --- ... Filenames Having Spaces and Special Characters in Linux.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150610 How to Manipulate Filenames Having Spaces and Special Characters in Linux.md b/sources/tech/20150610 How to Manipulate Filenames Having Spaces and Special Characters in Linux.md index 03bbb69005..31b28afd01 100644 --- a/sources/tech/20150610 How to Manipulate Filenames Having Spaces and Special Characters in Linux.md +++ b/sources/tech/20150610 How to Manipulate Filenames Having Spaces and Special Characters in Linux.md @@ -1,3 +1,4 @@ +zpl1025 How to Manipulate Filenames Having Spaces and Special Characters in Linux ================================================================================ We come across files and folders name very regularly. In most of the cases file/folder name are related to the content of the file/folder and starts with number and characters. Alpha-Numeric file name are pretty common and very widely used, but this is not the case when we have to deal with file/folder name that has special characters in them. @@ -432,4 +433,4 @@ via: http://www.tecmint.com/manage-linux-filenames-with-special-characters/ [a]:http://www.tecmint.com/author/avishek/ [1]:http://www.tecmint.com/15-basic-ls-command-examples-in-linux/ -[2]:http://www.tecmint.com/8-pratical-examples-of-linux-touch-command/ \ No newline at end of file +[2]:http://www.tecmint.com/8-pratical-examples-of-linux-touch-command/ From 6b7ba41295f51879dc60552cf2a3a6fda1954321 Mon Sep 17 00:00:00 2001 From: Gore Liu Date: Mon, 15 Jun 2015 19:20:38 +0800 Subject: [PATCH 388/965] [Translated] 20150528 11 pointless but awesome Linux terminal tricks.md --- ...tless but awesome Linux terminal tricks.md | 108 ------------------ ...tless but awesome Linux terminal tricks.md | 104 +++++++++++++++++ 2 files changed, 104 insertions(+), 108 deletions(-) delete mode 100644 sources/tech/20150528 11 pointless but awesome Linux terminal tricks.md create mode 100644 translated/tech/20150528 11 pointless but awesome Linux terminal tricks.md diff --git a/sources/tech/20150528 11 pointless but awesome Linux terminal tricks.md b/sources/tech/20150528 11 pointless but awesome Linux terminal tricks.md deleted file mode 100644 index 74baa5fb5b..0000000000 --- a/sources/tech/20150528 11 pointless but awesome Linux terminal tricks.md +++ /dev/null @@ -1,108 +0,0 @@ -Translating by goreliu ... - -11 pointless but awesome Linux terminal tricks -================================================================================ -Here are some great Linux terminal tips and tricks, each one as pointless as it is awesome. - -![](http://images.techhive.com/images/article/2015/05/slide_01-100587352-orig.png) - -### All work and no play... ### - -Linux is one of the most astoundingly functional and utilitarian Operating Systems around when it comes to working from the command line. Need to perform a particular task? Odds are there is an application or script you can use to get it done. Right from the terminal. But, as they say in the good book, "All work and no play make Jack really bored or something." So here is a collection of my favorite pointless, stupid, annoying or amusing things that you can do right in your Linux Terminal. - -![](http://images.techhive.com/images/article/2015/05/slide_02-100587353-orig.png) - -### Give the terminal an attitude ### - -Step 1) Type "sudo visudo". - -Step 2) At the bottom of the "Defaults" (near the top of the file) add, on a new line, "Defaults insults". - -Step 3) Save the file. - -"What did I just do to my computer?" you may be asking yourself. Something wonderful. Now, whenever you issue a sudo command and misstype your password, your computer will call you names. My favorite: "Listen, burrito brains, I don't have time to listen to this trash." - -![](http://images.techhive.com/images/article/2015/05/slide_03-100587354-orig.png) - -### apt-get moo ### - -That screenshot you see? That's what typing "apt-get moo" (on a Debian-based system) does. That's it. Don't go looking for this to do something fancy. It won't. That, I kid you not, is it. But it's one of the most commonly known little Easter eggs on Linux. So I include it here, right near the beginning, so I won't get 5,000 emails telling me I missed it in this list. - -![](http://images.techhive.com/images/article/2015/05/slide_04-100587355-orig.png) - -### aptitude moo ### - -A bit more entertaining is aptitude's take on "moo." Type "aptitude moo" (on Ubuntu and the like) and you'll be corrected about thinking "moo" would do anything. But you know better. Try the same command again, this time with an optional "-v" attribute. Don't stop there. Add v's, one at a time, until aptitude gives you what you want. - -![](http://images.techhive.com/images/article/2015/05/slide_05-100587356-orig.png) - -### Arch: Put Pac-Man in pacman ### - -This is one just for the Arch-lovers out there. The de facto package manager, pacman, is pretty fantastic already. Let's make it even better. - -Step 1) Open "/etc/pacman.conf". - -Step 2) In the "# Misc options", remove the "#" from in front of "Color". - -Step 3) Add "ILoveCandy". - -Now the progress for installing new packages, in pacman, will include a little tiny Pac-Man. Which should really just be the default anyway. - -![](http://images.techhive.com/images/article/2015/05/slide_06-100587358-orig.png) - -### Cowsay! ### - -Making aptitude moo is neat, I guess, but you really can't use it for much. Enter "cowsay." It does what you think. You make a cow say things. Anything you like. And it's not even limited to cows. Calvin, Beavis, and the Ghostbusters logo are all available in full ASCII art glory – type "cowsay -l" for a full list of what's available in this, Linux's most powerful tool. Remember that, like most great terminal applications, you can pipe the output from other applications straight into cowsay (ala "fortune | cowsay"). - -![](http://images.techhive.com/images/article/2015/05/slide_07-100587359-orig.png) - -### Become an 3l33t h@x0r ### - -Typing "nmap" isn't something one typically needs to do on a day-to-day basis. But when one does need to "whip out the nmap," one wants to look as l33t as humanly possible. Add a "-oS" to any nmap command (such as "nmap -oS - google.com"). Bam. You're now in what is officially known as "[Script Kiddie Mode][1]." Angelina Jolie and Keanu Reeves would be proud. - -![](http://images.techhive.com/images/article/2015/05/slide_08-100587360-orig.png) - -### Getting all Discordian ddate ### - -If you've ever been sitting around thinking, "Hey! I want today's date to be written in an essentially useless, but whimsical, way"…try typing "ddate". Results like "Today is Setting Orange, the 72nd day of Discord in the YOLD 3181," can really spice up your server logs. - -Note: Technically, this is a real thing called the [Discordian Calendar][2], used (in theory) by the followers of [Discordianism][3]. Which means I probably offended somebody. Or maybe not. I'm not really sure. Either way, ddate is a handy tool in any office. - -![](http://images.techhive.com/images/article/2015/05/slide_09-100587361-orig.png) - -### I See Colors Everywhere! ### - -Tired of boring old text? Looking to spruce things up and show the world your true style? lolcat. Install it. Use it. Everywhere. It takes any text input and turns it into a rainbow of wonder and enchantment. Piping text into lolcat (ala "fortune | lolcat") is sure to liven up any party. - -![](http://images.techhive.com/images/article/2015/05/slide_10-100587362-orig.png) - -### The Steam Locomotive ### - -Animated ASCII art steam locomotive in your terminal. You want this. You need this. Install and run "sl". Use "sl -l" for a tiny version. Or, if you want to really spend some time on this, "sl-h". This is the full train, including passenger cars. - -![](http://images.techhive.com/images/article/2015/05/slide_11-100587364-orig.png) - -### Reverse any text ### - -Pipe the output of any text into "rev" and it will reverse the text. "fortune | rev" gives you a fortune. In reverse. Which is, as odd as it may seem, not a misfortune. - -![](http://images.techhive.com/images/article/2015/05/slide_12-100587366-orig.png) - -### The Matrix is still cool, right? ### - -Want your terminal to do that scrolling text, l33t, Matrix-y thing? "cmatrix" is your friend. You can even have it output different colors, which is snazzy. Learn how by typing "man cmatrix". Or, better yet, "man cmatrix | lolcat". Which, really, is the most pointless (but wonderful) thing you can do in the Linux Terminal. So that's where I leave you. - --------------------------------------------------------------------------------- - -via: http://www.networkworld.com/article/2926630/linux/11-pointless-but-awesome-linux-terminal-tricks.html - -作者:[Bryan Lunduke][a] -译者:[goreliu](https://github.com/goreliu) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.networkworld.com/author/Bryan-Lunduke/ -[1]:http://nmap.org/book/output-formats-script-kiddie.html -[2]:http://en.wikipedia.org/wiki/Discordian_calendar -[3]:http://en.wikipedia.org/wiki/Discordianism \ No newline at end of file diff --git a/translated/tech/20150528 11 pointless but awesome Linux terminal tricks.md b/translated/tech/20150528 11 pointless but awesome Linux terminal tricks.md new file mode 100644 index 0000000000..e4a33cf48a --- /dev/null +++ b/translated/tech/20150528 11 pointless but awesome Linux terminal tricks.md @@ -0,0 +1,104 @@ +11个让人惊叹的Linux终端彩蛋 +================================================================================ +这里有一些很酷的Linux终端彩蛋,其中的每一个看上去并没有实际用途,但很精彩。 + +![](http://images.techhive.com/images/article/2015/05/slide_01-100587352-orig.png) + +### 只工作不玩耍…… ### + +当我们使用命令行工作时,Linux是功能和实用性最好的操作系统之一。想要执行一个特殊任务?可能一个程序或者脚本就可以帮你搞定。但就像一本书中说到的,只工作不玩耍聪明的孩子也会变傻。下边是我最喜欢的可以在终端做的没有实际用途的、傻傻的、恼人的、可笑的事情。 + +### 给终端一个态度 ### + +* 第一步)敲入`sudo visudo` +* 第二步)在“Defaults”末尾(文件的前半部分)添加一行“Defaults insults”。 +* 第三步)保存文件。 + +“我刚才对电脑做了什么?”你可能这样问自己。一定是美妙的事情吧。现在,在sudo命令提示提示下输出错误的口令,你的电脑就会呼唤你的名字。我最喜欢的一句:“听好了,煎饼一样的脑子,我没有时间听你胡说八道了。” + +![](http://images.techhive.com/images/article/2015/05/slide_02-100587353-orig.png) + +### apt-get moo ### + +你看过这张截图?那就是运行`apt-get moo`(在基于Debian的系统)的结果。对,就是它了。不要对它抱太多幻想,你会失望的,我不骗你。但是这是Linux世界最被人熟知的彩蛋之一。所以我把它包含进来,并且放在前排,然后我也就不会收到5千封邮件,指责我把它遗漏了。 + +![](http://images.techhive.com/images/article/2015/05/slide_03-100587354-orig.png) + +### aptitude moo ### + +更有趣的是将moo应用到aptitude上。敲入`aptitude moo`(在Ubuntu及其衍生版),你对`moo`可以做什么事情的看法会有所变化。你还还会知道更多事情,尝试重新输入这条命令,但这次添加一个`-v`参数。这还没有结束,试着添加更多`v`,一次添加一个,直到aptitude给了你想要的东西。 + +![](http://images.techhive.com/images/article/2015/05/slide_04-100587355-orig.png) + +### Arch: 将吃豆人放入pacman ### + +这里有一个只为Arch爱好者准备的彩蛋。Pacman包管理工具已经很棒了,但我们可以让它变得更棒。 + +* 第一步)打开“/etc/pacman.conf”文件。 +* 第二步)在“# Misc options”部分,去掉“Color”前的“#”。 +* 第三步)添加“ILoveCandy”。 + +现在我们使用pacman安装新软件包时,进度条里会出现一个小吃豆人。真应该默认就是这样的。 + +![](http://images.techhive.com/images/article/2015/05/slide_05-100587356-orig.png) + +### Cowsay! ### + +`aptitude moo`的输出格式很漂亮,但我想你苦于不能自由自在地使用。输入`cowsay`,它会做到你想做的事情。你可以让牛说任何你喜欢的东西。而且不只可以用牛,还可以用Calvin、Beavis和Ghostbusters的ASCII logo——输入`cowsay -l`可以得到所有可用的logo。它是Linux世界的强大工具。像很多其他命令一样,你可以使用管道把其他程序的输出输送给它,比如`fortune | cowsay`。 + +![](http://images.techhive.com/images/article/2015/05/slide_06-100587358-orig.png) + +### 变成3l33t h@x0r ### + +`nmap`并不是我们平时经常使用的基本命令。但如果你想蹂躏`nmap`的话,可能想在它的输出中看到l33t。在任何`nmap`命令(比如`nmap -oS - google.com`)后添加`-oS`。现在你的`nmap`已经处于官方名称是“[Script Kiddie Mode][1]”的模式了。Angelina Jolie和Keanu Reeves会为此骄傲的。 + +![](http://images.techhive.com/images/article/2015/05/slide_07-100587359-orig.png) + +### 获得所有的Discordian日期 ### + +如果你们曾经坐在一起思考,“嗨!我想使用无用但异想天开的方式来书写今天的日期……”试试运行`ddate`。结果类似于“Today is Setting Orange, the 72nd day of Discord in the YOLD 3181”,这会让你的服务树日志平添不少香料。 + +注意:在技术层面,确实有一个[Discordian Calendar][2],理论上被[Discordianism][3]追随者所使用。这意味着我可能得罪某些人。或者不会,我不确定。不管怎样,`ddate`是一个方便的工具。 + +![](http://images.techhive.com/images/article/2015/05/slide_08-100587360-orig.png) + +### 我可以在任何地方看到颜色!### + +厌倦了老旧的文本?想向世界展示出自己的个性?使用`lolcat`。安装它,然后在任何地方使用。它可以接收任何文本,然后将其转换成美轮美奂的彩虹效果。可以使用`fortune | lolcat`体验。 + +![](http://images.techhive.com/images/article/2015/05/slide_09-100587361-orig.png) + +### 蒸汽机车 ### + +在你的终端显示蒸汽机车的ASCII图形。如果你需要它,安装并运行`sl`命令。`sl -l`可以看到一个袖珍版本的。或者,如果你真想在上边花费更多时间,运行`sl -h`。这会显示一个完整的或者,还包括乘客车厢。 + +![](http://images.techhive.com/images/article/2015/05/slide_10-100587362-orig.png) + +### 将任何文本逆序输出 ### + +将任何文本使用管道输送给`rev`命令,它就会将文本内容逆序输出。`fortune | rev`会给你好运。当然,这不意味着rev会将幸运转换成不幸。 + +![](http://images.techhive.com/images/article/2015/05/slide_11-100587364-orig.png) + +### Matrix依然很酷,不是吗? ### + +想让你的终端显示滚动的文字、l33t和Matrix电影中的坠落数码?`cmatrix`是你的朋友。你甚至可以用它输出不同的颜色,非常华丽。使用`man cmatrix`学习使用方法。或者使用更好的方法,“man cmatrix | lolcat”。这确实是你在Linux终端可以做的最没实际用途却又精彩的事情了。 + +![](http://images.techhive.com/images/article/2015/05/slide_12-100587366-orig.png) + +以上就是全部内容了。 + +-------------------------------------------------------------------------------- + +via: http://www.networkworld.com/article/2926630/linux/11-pointless-but-awesome-linux-terminal-tricks.html + +作者:[Bryan Lunduke][a] +译者:[goreliu](https://github.com/goreliu) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.networkworld.com/author/Bryan-Lunduke/ +[1]:http://nmap.org/book/output-formats-script-kiddie.html +[2]:http://en.wikipedia.org/wiki/Discordian_calendar +[3]:http://en.wikipedia.org/wiki/Discordianism \ No newline at end of file From 818fbe4ab79d70b5f1e7ce40084a64f28052b71c Mon Sep 17 00:00:00 2001 From: wxy Date: Mon, 15 Jun 2015 21:01:38 +0800 Subject: [PATCH 389/965] =?UTF-8?q?=E8=BF=87=E6=9C=9F=E6=92=A4=E9=94=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...4 ​No reboot patching comes to Linux 4.0.md | 58 ------------------- 1 file changed, 58 deletions(-) delete mode 100644 sources/talk/20150304 ​No reboot patching comes to Linux 4.0.md diff --git a/sources/talk/20150304 ​No reboot patching comes to Linux 4.0.md b/sources/talk/20150304 ​No reboot patching comes to Linux 4.0.md deleted file mode 100644 index 6333fea9a7..0000000000 --- a/sources/talk/20150304 ​No reboot patching comes to Linux 4.0.md +++ /dev/null @@ -1,58 +0,0 @@ -​No reboot patching comes to Linux 4.0 -================================================================================ -> **Summary**:With the new Linux 4.0 kernel, you'll need to reboot Linux less often than ever. - -With [Linux 4.0][1], you may never need to reboot your operating system again. - -![Using Linux means never having to reboot. -- SUSE ](http://zdnet4.cbsistatic.com/hub/i/r/2015/03/02/5e766833-454b-45b5-a8f7-a55d21e9d26a/resize/270x270/4d0774552c342a1507784ef802619b71/livepatching.jpg) -Using Linux means never having to reboot. -- SUSE - -One reason to love Linux on your servers or in your data-center is that you so seldom needed to reboot it. True, critical patches require a reboot, but you could go months without rebooting. Now, with the latest changes to the Linux kernel you may be able to go years between reboots. - -This is actually a feature that was available in Linux in 2009 thanks to a program called [Ksplice][2]. This program compares the original and patched kernels and then uses a customized kernel module to patch the new code into the running kernel. Each Ksplice-enabled kernel comes with a special set of flags for each function that will be patched. The [Ksplice process][3] then watches for a moment when the code for the function being patched isn't in use, and ta-da, the patch is made and your server runs on. - -[Oracle acquired Ksplice][4] in 2011, and kept it just for its own [Oracle Linux][5], a [Red Hat Enterprise Linux (RHEL)][6] clone, and as a RHEL subscription service. That left all the other enterprise and server Linux back where they started. - -Then [KernelCare released a service that could provide bootless patches][7] for most enterprise Linux distros. This program use proprietary software and is only available as a service with a monthly fee. That was a long way from satisfying many Linux system administrators. - -So, [Red Hat][8] and [SUSE][9] both started working on their own purely open-source means of giving Linux the ability to keep running even while critical patches were being installed. Red Hat's program was named [kpatch][10], while SUSE' is named [kGraft][11]. - -The two companies took different approaches. Kpatch issues a stop_machine() command. After that it looks at the stack of existing processes using [ftrace][12] and, if the patch can be made safely, it redirects the running code to the patched functions and then removes the now outdated code. - -Kgraft also uses ftrace, but it works on the thread level. When an old function is called it makes sure the thread reaches a point that it can switch to the new function. - -While the end result is the same, the operating system keeps running while patches are made, there are significant differences in performance. Kpatch takes from one to forty milliseconds, while kGraft might take several minutes but there's never even a millisecond of down time. - -At the Linux Plumbers Conference in October 2014, the two groups got together and started work on a way to [patch Linux without rebooting that combines the best of both programs][13]. Essentially, what they ended up doing was putting both kpatch and kGraft in the 4.0 Linux kernel. - -Jiri Kosina, a SUSE software engineer and Linux kernel developer, explained, that live-patching in the Linux kernel will "provides a basic infrastructure for function "live patching" (i.e. code redirection), including API [application programming interface] for kernel modules containing the actual patches, and API/ABI [application binary interface] for userspace to be able to operate on the patches. This is "relatively simple and minimalistic, as it's making use of existing kernel infrastructure (namely ftrace) as much as possible. It's also self-contained, in a sense that it doesn't hook itself in any other kernel subsystem (it doesn't even touch any other code)." - -The release candidate for Linux 4.0 is now out. Kosina stated that "It's now implemented for x86 only as a reference architecture, but support for powerpc, s390 and arm is already in the works." And, indeed, the source code for these architectures is already in the [Live Patching Git code][14]. - -Simply having the code in there is just the start. Your Linux distribution will have to support it with patches that can make use of it. With both Red Hat and SUSE behind it, live patching will soon be the default in all serious business Linux distributions. - --------------------------------------------------------------------------------- - -via: http://www.zdnet.com/article/no-reboot-patching-comes-to-linux-4-0/#ftag=RSSbaffb68 - -作者:[Steven J. Vaughan-Nichols][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://www.zdnet.com/meet-the-team/us/sjvn/ -[1]:http://www.zdnet.com/article/linux-kernel-turns-over-release-odometer-to-4-0/ -[2]:http://www.computerworld.com/article/2466389/open-source-tools/never-reboot-again-with-linux-and-ksplice.html -[3]:http://www.ksplice.com/ -[4]:http://www.zdnet.com/article/oracle-acquires-zero-downtime-linux-upgrade-software/ -[5]:http://www.oracle.com/us/technologies/linux/overview/index.html -[6]:http://www.redhat.com/en/technologies/linux-platforms/enterprise-linux -[7]:http://www.zdnet.com/article/kernelcare-new-no-reboot-linux-patching-system/ -[8]:http://www.redhat.com/ -[9]:http://www.suse.com/ -[10]:http://rhelblog.redhat.com/2014/02/26/kpatch/ -[11]:http://www.zdnet.com/article/suse-gets-live-patching/ -[12]:http://elinux.org/Ftrace -[13]:http://linuxplumbersconf.org/2014/wp-content/uploads/2014/10/LPC2014_LivePatching.txt -[14]:https://kernel.googlesource.com/pub/scm/linux/kernel/git/jikos/livepatching/+/9ec0de0ee0c9f0ffe4f72da9158194121cc22807 \ No newline at end of file From d4f9ac7ac4865e2ee49dddee7e52bae0cdcdd88e Mon Sep 17 00:00:00 2001 From: wi-cuckoo Date: Mon, 15 Jun 2015 22:21:18 +0800 Subject: [PATCH 390/965] translating wi-cuckoo --- sources/talk/20150304 ​No reboot patching comes to Linux 4.0.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/talk/20150304 ​No reboot patching comes to Linux 4.0.md b/sources/talk/20150304 ​No reboot patching comes to Linux 4.0.md index 6333fea9a7..76a4545bf8 100644 --- a/sources/talk/20150304 ​No reboot patching comes to Linux 4.0.md +++ b/sources/talk/20150304 ​No reboot patching comes to Linux 4.0.md @@ -1,3 +1,4 @@ +translating wi-cuckoo ​No reboot patching comes to Linux 4.0 ================================================================================ > **Summary**:With the new Linux 4.0 kernel, you'll need to reboot Linux less often than ever. @@ -55,4 +56,4 @@ via: http://www.zdnet.com/article/no-reboot-patching-comes-to-linux-4-0/#ftag=RS [11]:http://www.zdnet.com/article/suse-gets-live-patching/ [12]:http://elinux.org/Ftrace [13]:http://linuxplumbersconf.org/2014/wp-content/uploads/2014/10/LPC2014_LivePatching.txt -[14]:https://kernel.googlesource.com/pub/scm/linux/kernel/git/jikos/livepatching/+/9ec0de0ee0c9f0ffe4f72da9158194121cc22807 \ No newline at end of file +[14]:https://kernel.googlesource.com/pub/scm/linux/kernel/git/jikos/livepatching/+/9ec0de0ee0c9f0ffe4f72da9158194121cc22807 From 96f60b9298235892f846894d3bcfc5d0109db0ab Mon Sep 17 00:00:00 2001 From: wi-cuckoo Date: Mon, 15 Jun 2015 22:26:06 +0800 Subject: [PATCH 391/965] soluted the conflict --- sources/talk/20150304 ​No reboot patching comes to Linux 4.0.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/talk/20150304 ​No reboot patching comes to Linux 4.0.md b/sources/talk/20150304 ​No reboot patching comes to Linux 4.0.md index 6c3396907c..76a4545bf8 100644 --- a/sources/talk/20150304 ​No reboot patching comes to Linux 4.0.md +++ b/sources/talk/20150304 ​No reboot patching comes to Linux 4.0.md @@ -1,3 +1,4 @@ +translating wi-cuckoo ​No reboot patching comes to Linux 4.0 ================================================================================ > **Summary**:With the new Linux 4.0 kernel, you'll need to reboot Linux less often than ever. From e543e35406d8c73f72cff10d3dfa0e59c19469e9 Mon Sep 17 00:00:00 2001 From: yajun Date: Mon, 15 Jun 2015 12:59:36 -0400 Subject: [PATCH 392/965] translating.. --- ...20141211 Open source all over the world.md | 150 ++++++++++++++++++ 1 file changed, 150 insertions(+) create mode 100644 translated/talk/20141211 Open source all over the world.md diff --git a/translated/talk/20141211 Open source all over the world.md b/translated/talk/20141211 Open source all over the world.md new file mode 100644 index 0000000000..b39820bebc --- /dev/null +++ b/translated/talk/20141211 Open source all over the world.md @@ -0,0 +1,150 @@ +Open source all over the world +================================================================================ +![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/BUS_OpenSourceExperience_520x292_cm.png) + +图片来源 : opensource.com + +经过了一整天的Opensource.com[社区版主][1]年会,最后一项日程提了上来,内容只有“特邀嘉宾:待定”几个字。作为[Opensource.com][3]的项目负责人和社区管理员,[Jason Hibbets][2]起身解释道,“因为这个嘉宾有可能无法到场,因此我不想提前说是谁。在几个月前我问他何时有空过来,他给了我两个时间点,我选了其中一个。今天是这三周中Jim唯一能来的一天”。(译者注:Jim是指下文中提到的Jim Whitehurst,即红帽公司总裁兼首席执行官) + +这句话在版主们(Moderators)中引起一阵轰动,他们从世界各地赶来参加此次的[拥抱开源大会(All Things Open Conference)][4]。版主们纷纷往前挪动椅子,仔细聆听。 + +“他会首先作半个小时的演讲,然后会回答几个提问。”,Jason说道。 + +会场的门开着,似乎一直在等着这位大人物的出现。这时,会场前唯一一个空位上来了一位高个子。 + +“大家好!”,这个家伙开口了。他没穿正装,只是衬衫和休闲裤。 + +这时会场中第二高个子的人,红帽全球意识部门(Global Awareness)的高级主管[Jeff Mackanic][5],告诉他大部分社区版本今天都在场,然后让每个人开始作简单的自我介绍。 + +“我叫[Jen Wike Huger][6],负责Opensource.com的内容管理,很高兴见到大家。” + +“我叫[Nicole][7]。是[ByWater Solutions][8]的副总裁,我们在做免费的开源库。我到各地旅行并教会人们如何使用软件。” + +“我叫[Robin][9],从2013年开始参与版主项目。我在OSDC做了一些事情,工作是在[City of the Hague][10]维护[网站][11]。” + +“我叫[Marcus Hanwell][12],来自英格兰,在[Kitware][13]工作。同时,我是FOSS科学软件的技术总监,和国家实验室在[Titan][14] Z和[Gpu programming][15]方面合作。我主要使用[Gentoo][16]和[KDE][17]。最后,我很激动能加入FOSS和开源科学。” + +“我叫[Phil Shapiro][18],是华盛顿的一个小图书馆28个Linux工作站的管理员。我视各位为我的同事。非常高兴能一起交流分享,贡献力量。我主要关注FOSS和自豪感的关系,以及FOSS如何提升自豪感。” + +“我叫[Joshua Holm][19]。我大多数时间都在关注系统更新,以及帮助人们在网上找工作。” + +“我叫[Mel Chernoff][20],在红帽工作,和[Jason Hibbets]和[Mark Bohannon]一起主要关注政府渠道方面。” + +“我叫[Scott Nesbitt][24],写过很多东西,使用FOSS很久了。我是个普通人,不是系统管理员,也不是程序员,只希望能更加高效工作。我帮助人们在商业和生活中使用FOSS。” + +“我叫[Luis Ibanez][25],刚加入[Google][26]。我对DIY和FOSS感兴趣。” + +“我叫[Remy DeCausemaker][27],在[RIT MAGIC Center][28]的黑客学院(Resident Hackademic),也是[交互式游戏和媒体系][29]的一个兼职教授。现在为Opensource.com写作将近四年。” + +“你在[新FOSS Minor][30]教书?!”,Jim说道,“很酷!” + +“我叫[Jason Baker][31]。我是红慢的一个云专家,主要做[OpenStack][32]方面的工作。” + +“我叫[Mark Bohannan][33],是红帽全球开放协议的一员,在华盛顿外工作。和Mel一样,我花了相当多时间写作,也从法律和政府部门中找合作者。我做了一个很好的小册子来讨论正在发生在政府中的积极变化。” + +“我叫[Jason Hibbets][34],我组织了这次会议。” + +会场中一片笑声。 + +“我也组织了这片讨论,可以这么说,”这个棕红色头发笑容灿烂的家伙说道。笑声持续一会逐渐平息。 + +我当时在他左边,时不时从转录空隙中抬头看一眼,然后从眼神中注意到微笑背后暗示的那个自2008年1月起开始领导公司的人,红帽的CEO[Jim Whitehurst][35]。 + +“我有世界上最好的工作,”稍稍向后靠、叉腿抱头,Whitehurst开始了演讲。“我开始领导红帽,在世界各地旅行到处看看情况。在这里的七年中,FOSS和广泛的开源创新所发生的美好的事情是开源已经脱离了条条框框。我现在认为,IT正处在FOSS之前所在的位置。我们可以预见FOSS从一个替代走向创新驱动力。” + +"I have one of the greatest jobs on Earth," began Whitehurst, as he leaned back, crossed his legs, and put his arms behind his head. "I get to lead Red Hat, travel around the world and see what goes on. In my seven years here, the amazing thing about FOSS, and, broadly open innovation, is that it has left the fringe. And now, I would argue, IT is in the same place that FOSS was in its early days. We are seeing FOSS going from an alternative to driving innovation. Our customers are seeing it, too. They're using FOSS not because it is cheaper, but because it provides them with control and innovative solutions. It's a global phenomenon, too. For instance, I was just in India, and discovered that, for them, there were two reasons for embracing of open source: one, access to innovation, and two, the market is somewhat different and wanting full control.” + +"The [Bombay Stock Exchange][36] wants to own all the source and control it. That is not something you would have heard five years ago in a stock exchange, anywhere. Back then, the early knock on FOSS was that it was creating free copies of things that already existed.' If you look today, virtually everything in big data is happening in FOSS. Almost any new framework, language, and methodology, including mobile (though excluding devices), are all happening first in open source.” + +"This is because users have reached size and scale. It's not just Red Hat—it's [Google][37], [Amazon][38], [Facebook][39], and others, they want to solve their own problems, and do it the open source way. And forget licensing—open source is much more than that. We've built a vehicle, and a set of norms. Things like [Hadoop][40], [Cassandra][41], and other tools. Fact is, open source drives innovation. For example, Hadoop was in production before any vendor realized there was a problem of that scale that needed to be solved. They actually have the wherewithal to solve their own problems, and the social tech and principles to do that. "Open source is now the default technology for many categories. This is especially true as the world moves more and more to content importance, such as [3D printing][42] and other physical products that take information content and apply it.” + +"We have this cool thing in one area, source code, but it is limited. But there are still many opportunities in different industries. We must ask ourselves, 'What can open source do for education, government, and legal? What are the parallels? And what can other areas learn with us?'" + +"There's also the matter of content. Content is now free, and we can invest in more free content, sure. But we need free content that has a business model built around it. That is something that more people should care about. If you believe open innovation is better, then we need more models." + +"Education worries me with its fixation on 'content' rather than 'communities.' For example, everywhere I go, I hear university presidents say, 'Wait, education is going to be free?!' The fact that FOSS is free for downstream is great, but the upstream is really powerful. Distributing free courses is great, but we need communities to iterate and make it better. That is something that a lot of different people are doing, and Opensource.com is a place to share what is going on in this space. The question is not so much 'How do we take content?' as it is 'How do you build and distribute it? How do you make sure it is a living thing that gets better, and can morph for different areas?'" + +"But the potential to change the world is limitless, and it's amazing how much progress we've already made. Six years ago we were obsessed about defining a mission statement. We started by saying, 'We are the leader,' but that was the wrong word, because it implied control. Active participant didn't quite get it either... [Máirín Duffy][43] came up with the word [catalyst][44]. And so, we became Red Hat, the company that creates environments to agitate action and catalyze direction.” + +"Opensource.com is a catalyst in other areas, and that is what Opensource.com is about. I hope you see yourselves this way, too. The quality of content then, when we started, versus now, is incredible. You can see it getting better every quarter. Thank you for investing your time. Thank you for being catalysts. This is a chance for us all to make the world a better place. And I'd love to hear from you." + +I stole a glimpse of everyone at the table: more than a few people had tears in their eyes. + +Then, Whitehurst revisits the open education topic of conversation again. "Taking it to an extreme, let's say you have a course about the book [Ulysses][45]. Here, you can explore how to crowdsource a model and get people to work together within the course. Well, it's the same with a piece of code: people work together, and the code itself gets better over time." + +At this point, I get to have my say. Words like fundamental and possibly irreconcilable came up when discussing the differences between FOSS and academic communities. + +**Remy**: "Retraction is career death." Releasing data or code with your paper could be devastating if you make a mistake. School has always been about avoiding failure and divining 'right answers'. Copying is cheating. Wheels are recreated from scratch ritualistically. In FOSS, you work to fail fastest, but in academia, you invite invalidation." + +**Nicole**: "There are a lot of egos in academia. You need a release manager." + +**Marcus**: "To collaborate, you have to show the bits you don't understand, and that happens behind closed doors. The reward model is all about what you can take credit for. We need to change the reward model. Publish as much as you can. We release eventually, but we want to release early." + +**Luis**: "Make teamwork and sharing a priority. And Red Hat can say that to them more." + +**Jim**: "Is there an active role that companies can play in that?" + +[Phil Shapiro][46]: "I'm interested in tipping points in FOSS. It drives me nuts that the Fed hasn't switched to [LibreOffice][47]. We're not spending tax dollars on software, and certainly shouldn't be spending on word processing or Microsoft Office." + +**Jim**: "We have advocated for that. A lot. Can we do more? That's a valid question. Primarily, we've made progress in the places we have products. We have a solid franchise in government. We are larger per IT spend there than the private sector. Banks and telcos are further along than the government. We've done better in Europe, and I think they have less lobbying dollars at work there, than here. This next generation of computing is almost like a 'do-over'. We are making great progress elsewhere, but it is concerning." + +Suddenly, the door to the room opened. Jim turned and nodded towards his executive assistant standing in the doorway; it was time for his next meeting. He uncrossed his legs, leaned forward, and stood. He thanked everyone again for their work and dedication, smiled, and was out the door... leaving us all a bit more inspired. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/business/14/12/jim-whitehurst-inspiration-open-source + +作者:[Remy][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:https://opensource.com/users/remyd +[1]:http://opensource.com/community-moderator-program +[2]:https://twitter.com/jhibbets +[3]:http://opensource.com/ +[4]:http://allthingsopen.org/ +[5]:http://opensource.com/users/mackanic +[6]:https://twitter.com/JenWike +[7]:http://opensource.com/users/nengard +[8]:http://bywatersolutions.com/ +[9]:http://opensource.com/life/13/7/community-spotlight-robin-muilwijk +[10]:https://en.wikipedia.org/wiki/The_Hague +[11]:http://www.denhaag.nl/en.htm +[12]:https://twitter.com/mhanwell +[13]:http://www.kitware.com/ +[14]:http://www.nvidia.com/gtx-700-graphics-cards/gtx-titan-z/ +[15]:https://en.wikipedia.org/wiki/General-purpose_computing_on_graphics_processing_units +[16]:https://www.gentoo.org/ +[17]:http://kde.org/ +[18]:https://twitter.com/philshapiro +[19]:http://opensource.com/community/13/9/contributor-spotlight-joshua-holm +[20]:http://opensource.com/users/melanie +[21]:http://opensource.com/government +[22]:https://twitter.com/jhibbets +[23]:https://twitter.com/markbotech +[24]:http://scottnesbitt.me/ +[25]:http://opensource.com/users/luis-ibanez +[26]:http://google.com/ +[27]:http://twitter.com/remy_d +[28]:http://foss.rit.edu/ +[29]:http://igm.rit.edu/ +[30]:http://www.rit.edu/news/story.php?id=50590 +[31]:https://twitter.com/jehb +[32]:http://openstack.org/ +[33]:https://twitter.com/markbotech +[34]:https://twitter.com/jhibbets +[35]:http://www.redhat.com/en/about/company/management/james-whitehurst +[36]:http://www.bseindia.com/ +[37]:http://google.com/ +[38]:https://mail.corp.redhat.com/service/home/%7E/Amazon +[39]:https://mail.corp.redhat.com/service/home/%7E/Facebook +[40]:https://hadoop.apache.org/ +[41]:https://cassandra.apache.org/ +[42]:https://en.wikipedia.org/wiki/3D_printing +[43]:https://twitter.com/mairin +[44]:http://jobs.redhat.com/life-at-red-hat/our-culture/ +[45]:http://www.gutenberg.org/ebooks/4300 +[46]:https://twitter.com/philshapiro +[47]:http://libreoffice.org/ From a0f53e1f6e602f6a3ab8e53843b871698d1dccef Mon Sep 17 00:00:00 2001 From: sevenot Date: Tue, 16 Jun 2015 10:28:57 +0800 Subject: [PATCH 393/965] sevenot translating --- .../talk/20150128 The top 10 rookie open source projects.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/talk/20150128 The top 10 rookie open source projects.md b/sources/talk/20150128 The top 10 rookie open source projects.md index 0dfcb07a48..7dccf38141 100644 --- a/sources/talk/20150128 The top 10 rookie open source projects.md +++ b/sources/talk/20150128 The top 10 rookie open source projects.md @@ -1,3 +1,4 @@ +sevenot translating The top 10 rookie open source projects ================================================================================ Black Duck presents its Open Source Rookies of the Year -- the 10 most exciting, active new projects germinated by the global open source community @@ -150,4 +151,4 @@ via: http://www.infoworld.com/article/2875439/open-source-software/the-top-10-ro [20]:https://www.blackducksoftware.com/open-source-rookies [21]:http://www.infoworld.com/article/2871935/application-development/infoworlds-2015-technology-of-the-year-award-winners.html [22]:http://www.infoworld.com/article/2688104/open-source-software/article.html -[23]:http://www.infoworld.com/article/2854954/microsoft-windows/15-essential-open-source-tools-for-windows-admins.html \ No newline at end of file +[23]:http://www.infoworld.com/article/2854954/microsoft-windows/15-essential-open-source-tools-for-windows-admins.html From 46b40880ede51d5e20c9d3025bd62d52993a709f Mon Sep 17 00:00:00 2001 From: ZTinoZ Date: Tue, 16 Jun 2015 10:30:21 +0800 Subject: [PATCH 394/965] Translating by ZTinoZ --- sources/tech/20150526 20 Useful Terminal Emulators for Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20150526 20 Useful Terminal Emulators for Linux.md b/sources/tech/20150526 20 Useful Terminal Emulators for Linux.md index 82a8ff5aff..a15c4ad0d1 100644 --- a/sources/tech/20150526 20 Useful Terminal Emulators for Linux.md +++ b/sources/tech/20150526 20 Useful Terminal Emulators for Linux.md @@ -189,7 +189,7 @@ Gnome Terminal ### 14. Final Term ### -Final Term is a open source stylish terminal emulator that has some exciting capabilities and handy features into one single beautiful interface. It is still under development, but provides significant features such as Semantic text menus, Smart command completion, GUI terminal controls, Omnipotent keybindings, Color support and many more. The following animated screen grab demonstrates some of their features. Please click on image to view demo. +Final Term是一款漂亮的开源终端仿真器,在这一个界面里蕴藏着一些令人激动的功能和特性。虽然它仍然有待改进,但是它提供了一些重要的特性比如Semantic文本菜单、智能的命令行实现、GUI终端控制、全能的快捷键、彩色支持等等。以下动图抓取并演示了它们的一些特性,点开来看看吧。 ![FinalTerm Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/FinalTerm.gif) From 19c1a9fdad619600df6e0302e981d2529512d4ae Mon Sep 17 00:00:00 2001 From: wi-cuckoo Date: Tue, 16 Jun 2015 11:05:15 +0800 Subject: [PATCH 395/965] delete a past item --- ...4 ​No reboot patching comes to Linux 4.0.md | 59 ------------------- 1 file changed, 59 deletions(-) delete mode 100644 sources/talk/20150304 ​No reboot patching comes to Linux 4.0.md diff --git a/sources/talk/20150304 ​No reboot patching comes to Linux 4.0.md b/sources/talk/20150304 ​No reboot patching comes to Linux 4.0.md deleted file mode 100644 index 76a4545bf8..0000000000 --- a/sources/talk/20150304 ​No reboot patching comes to Linux 4.0.md +++ /dev/null @@ -1,59 +0,0 @@ -translating wi-cuckoo -​No reboot patching comes to Linux 4.0 -================================================================================ -> **Summary**:With the new Linux 4.0 kernel, you'll need to reboot Linux less often than ever. - -With [Linux 4.0][1], you may never need to reboot your operating system again. - -![Using Linux means never having to reboot. -- SUSE ](http://zdnet4.cbsistatic.com/hub/i/r/2015/03/02/5e766833-454b-45b5-a8f7-a55d21e9d26a/resize/270x270/4d0774552c342a1507784ef802619b71/livepatching.jpg) -Using Linux means never having to reboot. -- SUSE - -One reason to love Linux on your servers or in your data-center is that you so seldom needed to reboot it. True, critical patches require a reboot, but you could go months without rebooting. Now, with the latest changes to the Linux kernel you may be able to go years between reboots. - -This is actually a feature that was available in Linux in 2009 thanks to a program called [Ksplice][2]. This program compares the original and patched kernels and then uses a customized kernel module to patch the new code into the running kernel. Each Ksplice-enabled kernel comes with a special set of flags for each function that will be patched. The [Ksplice process][3] then watches for a moment when the code for the function being patched isn't in use, and ta-da, the patch is made and your server runs on. - -[Oracle acquired Ksplice][4] in 2011, and kept it just for its own [Oracle Linux][5], a [Red Hat Enterprise Linux (RHEL)][6] clone, and as a RHEL subscription service. That left all the other enterprise and server Linux back where they started. - -Then [KernelCare released a service that could provide bootless patches][7] for most enterprise Linux distros. This program use proprietary software and is only available as a service with a monthly fee. That was a long way from satisfying many Linux system administrators. - -So, [Red Hat][8] and [SUSE][9] both started working on their own purely open-source means of giving Linux the ability to keep running even while critical patches were being installed. Red Hat's program was named [kpatch][10], while SUSE' is named [kGraft][11]. - -The two companies took different approaches. Kpatch issues a stop_machine() command. After that it looks at the stack of existing processes using [ftrace][12] and, if the patch can be made safely, it redirects the running code to the patched functions and then removes the now outdated code. - -Kgraft also uses ftrace, but it works on the thread level. When an old function is called it makes sure the thread reaches a point that it can switch to the new function. - -While the end result is the same, the operating system keeps running while patches are made, there are significant differences in performance. Kpatch takes from one to forty milliseconds, while kGraft might take several minutes but there's never even a millisecond of down time. - -At the Linux Plumbers Conference in October 2014, the two groups got together and started work on a way to [patch Linux without rebooting that combines the best of both programs][13]. Essentially, what they ended up doing was putting both kpatch and kGraft in the 4.0 Linux kernel. - -Jiri Kosina, a SUSE software engineer and Linux kernel developer, explained, that live-patching in the Linux kernel will "provides a basic infrastructure for function "live patching" (i.e. code redirection), including API [application programming interface] for kernel modules containing the actual patches, and API/ABI [application binary interface] for userspace to be able to operate on the patches. This is "relatively simple and minimalistic, as it's making use of existing kernel infrastructure (namely ftrace) as much as possible. It's also self-contained, in a sense that it doesn't hook itself in any other kernel subsystem (it doesn't even touch any other code)." - -The release candidate for Linux 4.0 is now out. Kosina stated that "It's now implemented for x86 only as a reference architecture, but support for powerpc, s390 and arm is already in the works." And, indeed, the source code for these architectures is already in the [Live Patching Git code][14]. - -Simply having the code in there is just the start. Your Linux distribution will have to support it with patches that can make use of it. With both Red Hat and SUSE behind it, live patching will soon be the default in all serious business Linux distributions. - --------------------------------------------------------------------------------- - -via: http://www.zdnet.com/article/no-reboot-patching-comes-to-linux-4-0/#ftag=RSSbaffb68 - -作者:[Steven J. Vaughan-Nichols][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://www.zdnet.com/meet-the-team/us/sjvn/ -[1]:http://www.zdnet.com/article/linux-kernel-turns-over-release-odometer-to-4-0/ -[2]:http://www.computerworld.com/article/2466389/open-source-tools/never-reboot-again-with-linux-and-ksplice.html -[3]:http://www.ksplice.com/ -[4]:http://www.zdnet.com/article/oracle-acquires-zero-downtime-linux-upgrade-software/ -[5]:http://www.oracle.com/us/technologies/linux/overview/index.html -[6]:http://www.redhat.com/en/technologies/linux-platforms/enterprise-linux -[7]:http://www.zdnet.com/article/kernelcare-new-no-reboot-linux-patching-system/ -[8]:http://www.redhat.com/ -[9]:http://www.suse.com/ -[10]:http://rhelblog.redhat.com/2014/02/26/kpatch/ -[11]:http://www.zdnet.com/article/suse-gets-live-patching/ -[12]:http://elinux.org/Ftrace -[13]:http://linuxplumbersconf.org/2014/wp-content/uploads/2014/10/LPC2014_LivePatching.txt -[14]:https://kernel.googlesource.com/pub/scm/linux/kernel/git/jikos/livepatching/+/9ec0de0ee0c9f0ffe4f72da9158194121cc22807 From 90dc2609661be56537692939163c40cb207f990f Mon Sep 17 00:00:00 2001 From: wi-cuckoo Date: Tue, 16 Jun 2015 11:10:12 +0800 Subject: [PATCH 396/965] translating wi-cuckoo --- .../talk/20150615 PHP at 20--From pet project to powerhouse.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/talk/20150615 PHP at 20--From pet project to powerhouse.md b/sources/talk/20150615 PHP at 20--From pet project to powerhouse.md index 610913c846..7ddbf950a9 100644 --- a/sources/talk/20150615 PHP at 20--From pet project to powerhouse.md +++ b/sources/talk/20150615 PHP at 20--From pet project to powerhouse.md @@ -1,3 +1,4 @@ +translating wi-cuckoo PHP at 20: From pet project to powerhouse ================================================================================ ![](http://images.techhive.com/images/article/2015/06/13049862325_8c97a11878_z-100590275-primary.idge.jpg) @@ -79,4 +80,4 @@ via: http://www.infoworld.com/article/2933858/php/php-at-20-from-pet-project-to- [8]:https://wiki.php.net/todo/php70#timetable [9]:http://talks.php.net/velocity15 [10]:http://www.php-fig.org/psr/psr-7/ -[11]:http://phpmentoring.org/ \ No newline at end of file +[11]:http://phpmentoring.org/ From 133f48756d30a5a9de509cc0e8f28b4ca112670d Mon Sep 17 00:00:00 2001 From: struggling <630441839@qq.com> Date: Tue, 16 Jun 2015 11:20:34 +0800 Subject: [PATCH 397/965] Update 20150515 Extend Swap Space using Swap file in Linux.md --- .../20150515 Extend Swap Space using Swap file in Linux.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150515 Extend Swap Space using Swap file in Linux.md b/sources/tech/20150515 Extend Swap Space using Swap file in Linux.md index 51b2f2fe55..9b1cb3f8b7 100644 --- a/sources/tech/20150515 Extend Swap Space using Swap file in Linux.md +++ b/sources/tech/20150515 Extend Swap Space using Swap file in Linux.md @@ -1,3 +1,4 @@ +Translating by strugglingyouth Extend Swap Space using Swap file in Linux ================================================================================ There are some scenarios where our Linux box is running out of swap space so in that case we can extend the swap space using swap partition but due to unavailability of free partitions on the disk, we are unable to extend it. @@ -70,4 +71,4 @@ via: http://www.linuxtechi.com/extend-swap-space-using-swap-file-in-linux/ 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 -[a]:http://www.linuxtechi.com/author/pradeep/ \ No newline at end of file +[a]:http://www.linuxtechi.com/author/pradeep/ From 44c36764ceba054e981c2da64adcb8638cd1415c Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 16 Jun 2015 12:51:58 +0800 Subject: [PATCH 398/965] PUB:20150211 Protect Apache Against Brute Force or DDoS Attacks Using Mod_Security and Mod_evasive Modules @wwy-hust --- ...ng Mod_Security and Mod_evasive Modules.md | 160 +++++++++--------- 1 file changed, 82 insertions(+), 78 deletions(-) rename {translated/tech => published}/20150211 Protect Apache Against Brute Force or DDoS Attacks Using Mod_Security and Mod_evasive Modules.md (58%) diff --git a/translated/tech/20150211 Protect Apache Against Brute Force or DDoS Attacks Using Mod_Security and Mod_evasive Modules.md b/published/20150211 Protect Apache Against Brute Force or DDoS Attacks Using Mod_Security and Mod_evasive Modules.md similarity index 58% rename from translated/tech/20150211 Protect Apache Against Brute Force or DDoS Attacks Using Mod_Security and Mod_evasive Modules.md rename to published/20150211 Protect Apache Against Brute Force or DDoS Attacks Using Mod_Security and Mod_evasive Modules.md index 1f645595b7..44ba66e7d5 100644 --- a/translated/tech/20150211 Protect Apache Against Brute Force or DDoS Attacks Using Mod_Security and Mod_evasive Modules.md +++ b/published/20150211 Protect Apache Against Brute Force or DDoS Attacks Using Mod_Security and Mod_evasive Modules.md @@ -1,14 +1,15 @@ -在Apache中使用Mod_Security和Mod_evasive来抵御暴力破解和DDos攻击 +在Apache中使用mod\_security和mod\_evasive来抵御暴力破解和DDos攻击 ================================================================================ -对于那些托管主机或者需要将您的主机暴露在因特网中的人来说,保证您的系统在面对攻击时安全是一个重要的事情。 -mod_security(一个开源的可以无缝接入Web服务器的用于Web应用入侵检测和防护的引擎)和mod_evasive是两个在服务器端对抗暴力破解和(D)Dos攻击的非常重要的工具。 +对于那些需要在因特网上提供服务或托管主机的人来说,保证您的系统在面对攻击时的安全是一个重要的事情。 -mod_evasive,如它的名字一样,在受攻击时提供避实就虚的功能,它像一个雨伞一样保护Web服务器免受那些威胁。 +mod\_security(一个开源的用于Web应用入侵检测及防护的引擎,可以无缝地集成到Web服务器)和mod\_evasive是两个在服务器端对抗暴力破解和(D)Dos攻击的非常重要的工具。 + +mod\_evasive,如它的名字一样,在受攻击时提供避实就虚的功能,它像一个雨伞一样保护Web服务器免受那些威胁。 ![](http://www.tecmint.com/wp-content/uploads/2012/06/Install-Mod_Security-Mod_evasive-in-CentOS.jpg) -安装Mod_Security和Mod_Evasive来保护Apache +*安装mod\_security和mod\_evasive来保护Apache* 在这篇文章中我们将讨论如何安装、配置以及在RHEL/CentOS6、7和Fedora 21-15上将它们整合到Apache。另外,我们会模拟攻击以便验证服务器做出了正确的反应。 @@ -16,91 +17,77 @@ mod_evasive,如它的名字一样,在受攻击时提供避实就虚的功能 - [在RHEL/CentOS 7中安装LAMP][1] -如果您在运行RHEL/CentOS 7或Fedora 21,您还需要安装iptables作为默认[防火墙][2]前端以取代firewalld。这样做是为了在RHEL/CentOS 7或Fedora 21中使用同样的工具。 +(LCTT 译注:本文有修改。原文为了在RHEL/CentOS 7或Fedora 21中使用同样的工具,而删除了自带的 firewalld,使用了旧式的iptables。译者以为这样并不恰当,因此,译文中做了相应删节,并增加了firewalld的相应脚本。) -### 步骤 1: 在RHEL/CentOS 7和Fedora 21上安装Iptables防火墙 ### - -用下面的命令停止和禁用firewalld: - - # systemctl stop firewalld - # systemctl disable firewalld - -![](http://www.tecmint.com/wp-content/uploads/2012/06/Disable-Firewalld-Service.png) -禁用firewalld服务 - -接下来在使能iptables之前安装iptables-services包: - - # yum update && yum install iptables-services - # systemctl enable iptables - # systemctl start iptables - # systemctl status iptables - -![](http://www.tecmint.com/wp-content/uploads/2012/06/Install-Iptables-Firewall.png) -安装Iptables防火墙 - -### 步骤 2: 安装Mod_Security和Mod_evasive ### +### 步骤 1: 安装mod\_security和mod\_evasive ### 另外,在安装LAMP后,您还需要在RHEL/CentOS 7/6中[开启EPEL仓库][3]来安装这两个包。Fedora用户不需要开启这个仓库,因为epel已经是Fedora项目的一部分了。 # yum update && yum install mod_security mod_evasive -当安装结束后,您会在/etc/httpd/conf.d下找到两个工具的配置文件。 +当安装结束后,您会在/etc/httpd/conf.d下找到这两个工具的配置文件。 # ls -l /etc/httpd/conf.d ![](http://www.tecmint.com/wp-content/uploads/2012/06/mod_security-mod_evasive-Configurations.png) -mod_security + mod_evasive 配置文件 -现在,为了整合这两个模块到Apache,并在启动时加载它们。请确保下面几行出现在mod_evasive.conf和mod_security.conf的顶层部分,它们分别为: +*mod\_security + mod\_evasive 配置文件* + +现在,为了整合这两个模块到Apache,并在启动时加载它们。请确保下面几行出现在mod\_evasive.conf和mod\_security.conf的顶层部分,它们分别为: LoadModule evasive20_module modules/mod_evasive24.so LoadModule security2_module modules/mod_security2.so -请注意modules/mod_security2.so和modules/mod_evasive24.so都是从/etc/httpd到模块源文件的相对路径。您可以通过列出/etc/httpd/modules的内容来验证(如果需要的话,修改它): +请注意modules/mod\_security2.so和modules/mod\_evasive24.so都是从/etc/httpd到模块源文件的相对路径。您可以通过列出/etc/httpd/modules的内容来验证(如果需要的话,修改它): # cd /etc/httpd/modules # pwd # ls -l | grep -Ei '(evasive|security)' ![](http://www.tecmint.com/wp-content/uploads/2012/06/Verify-mod_security-mod_evasive-Modules.png) -验证mod_security + mod_evasive模块 -接下来重启Apache并且核实它已加载了mod_evasive和mod_security: +*验证mod\_security + mod\_evasive模块* + +接下来重启Apache并且核实它已加载了mod\_evasive和mod\_security: # service httpd restart [在RHEL/CentOS 6和Fedora 20-18上] # systemctl restart httpd [在RHEL/CentOS 7和Fedora 21上] ---------- - [输出已加载的静态模块和动态模块列表] - - # httpd -M | grep -Ei '(evasive|security)' + # httpd -M | grep -Ei '(evasive|security)' [输出已加载的静态模块和动态模块列表] ![](http://www.tecmint.com/wp-content/uploads/2012/06/Check-mod_security-mod_evasive-Loaded.png) -检查mod_security + mod_evasive模块已加载 -### 步骤 3: 安装一个核心规则集并且配置Mod_Security ### +*检查mod\_security + mod\_evasive模块已加载* -简单来说,一个核心规则集(即CRS)为web服务器提供特定状况下如何反应的指令。mod_security的开发者们提供了一个免费的CRS,叫做OWASP([开放Web应用安全项目])ModSecurity CRS,可以从下面的地址下载和安装。 +### 步骤 2: 安装一个核心规则集并且配置mod\_security ### -1. 下载OWASP CRS到为之创建的目录 +简单来说,一个核心规则集(即CRS)为web服务器提供特定状况下如何反应的指令。mod\_security的开发者们提供了一个免费的CRS,叫做OWASP([开放Web应用安全项目])ModSecurity CRS,可以从下面的地址下载和安装。 - # mkdir /etc/httpd/crs-tecmint - # cd /etc/httpd/crs-tecmint +####下载OWASP CRS到为之创建的目录#### + + # mkdir /etc/httpd/crs-tecmint + # cd /etc/httpd/crs-tecmint # wget https://github.com/SpiderLabs/owasp-modsecurity-crs/tarball/master ![](http://www.tecmint.com/wp-content/uploads/2012/06/Download-mod_security-Core-Rules.png) -下载mod_security核心规则 -2. 解压CRS文件并修改文件夹名称 +*下载mod\_security核心规则* + +#### 解压CRS文件并修改文件夹名称#### # tar xzf master # mv SpiderLabs-owasp-modsecurity-crs-ebe8790 owasp-modsecurity-crs -![](http://www.tecmint.com/wp-content/uploads/2012/06/Extract-mod_security-Core-Rules.png) -解压mod_security核心规则 -3. 现在,是时候配置mod_security了。将同样的规则文件(owasp-modsecurity-crs/modsecurity_crs_10_setup.conf.example)拷贝至另一个没有.example扩展的文件。 +![](http://www.tecmint.com/wp-content/uploads/2012/06/Extract-mod_security-Core-Rules.png) + +*解压mod\_security核心规则* + +####现在,是时候配置mod\_security了#### + +将示例的规则文件(owasp-modsecurity-crs/modsecurity_crs_10_setup.conf.example)拷贝为同名的配置文件。 # cp modsecurity_crs_10_setup.conf.example modsecurity_crs_10_setup.conf @@ -111,7 +98,7 @@ mod_security + mod_evasive 配置文件 Include crs-tecmint/owasp-modsecurity-crs/base_rules/*.conf -最后,建议您在/etc/httpd/modsecurity.d目录下创建自己的配置文件,在那里我们可以用我们自定义的文件夹(接下来的示例中,我们会将其命名为tecmint.conf)而无需修改CRS文件的目录。这样做能够在CRSs发布新版本时更加容易的升级。 +最后,建议您在/etc/httpd/modsecurity.d目录下创建自己的配置文件,在那里我们可以用我们自定义的文件夹(接下来的示例中,我们会将其命名为tecmint.conf)而无需修改CRS文件的目录。这样做能够在CRS发布新版本时更加容易的升级。 SecRuleEngine On @@ -121,13 +108,13 @@ mod_security + mod_evasive 配置文件 SecDataDir /tmp -您可以在[SpiderLabs的ModSecurity GitHub][5]仓库中参考关于mod_security目录的更完整的解释。 +您可以在[SpiderLabs的ModSecurity GitHub][5]仓库中参考关于mod\_security目录的更完整的解释。 -### 步骤 4: 配置Mod_Evasive ### +### 步骤 3: 配置mod\_evasive ### -mod_evasive被配置为使用/etc/httpd/conf.d/mod_evasive.conf中的指令。与mod_security不同,由于在包升级时没有规则来更新,因此我们不需要独立的文件来添加自定义指令。 +mod\_evasive被配置为使用/etc/httpd/conf.d/mod\_evasive.conf中的指令。与mod\_security不同,由于在包升级时没有规则来更新,因此我们不需要独立的文件来添加自定义指令。 -默认的mod_evasive.conf开启了下列的目录(注意这个文件被详细的注释了,因此我们剔掉了注释以重点显示配置指令): +默认的mod\_evasive.conf开启了下列的目录(注意这个文件被详细的注释了,因此我们剔掉了注释以重点显示配置指令): DOSHashTableSize 3097 @@ -140,8 +127,8 @@ mod_evasive被配置为使用/etc/httpd/conf.d/mod_evasive.conf中的指令。 这些指令的解释: -- DOSHashTableSize: 这个指令指明了哈希表的大小,它用来追踪基于IP地址的活动。增加这个数字将使查询站点访问历史变得更快,但如果被设置的太高则会影响整体性能。 -- DOSPageCount: 在DOSPageInterval间隔内可由一个用户发起的面向特定的URI(例如,一个Apache托管的文件)的同一个请求的数量。 +- DOSHashTableSize: 这个指令指明了哈希表的大小,它用来追踪基于IP地址的活动。增加这个数字将使得站点访问历史的查询变得更快,但如果被设置的太大则会影响整体性能。 +- DOSPageCount: 在DOSPageInterval间隔内可由一个用户发起的针对特定的URI(例如,一个Apache 提供服务的文件)的同一个请求的数量。 - DOSSiteCount: 类似DOSPageCount,但涉及到整个站点总共有多少的请求可以在DOSSiteInterval间隔内被发起。 - DOSBlockingPeriod: 如果一个用户超过了DOSSPageCount的限制或者DOSSiteCount,他的源IP地址将会在DOSBlockingPeriod期间内被加入黑名单。在DOSBlockingPeriod期间,任何从这个IP地址发起的请求将会遭遇一个403禁止错误。 @@ -149,7 +136,7 @@ mod_evasive被配置为使用/etc/httpd/conf.d/mod_evasive.conf中的指令。 **一个小警告**: 如果这些值设置的不合适,则您会蒙受阻挡合法用户的风险。 -您也许想考虑下其他有用的指令: +您也许还会用到以下其它有用的指令: #### DOSEmailNotify #### @@ -157,11 +144,11 @@ mod_evasive被配置为使用/etc/httpd/conf.d/mod_evasive.conf中的指令。 # setsebool -P httpd_can_sendmail 1 -接下来,将这个指令和其他指令一起加入到mod_evasive.conf文件。 +接下来,将这个指令和其他指令一起加入到mod\_evasive.conf文件。 DOSEmailNotify you@yourdomain.com -如果这个值被合适的设置并且您的邮件服务器在正常的运行,则当一个IP地址被加入黑名单时,会有一封邮件被发送到相应的地址。 +如果这个指令设置了合适的值,并且您的邮件服务器在正常的运行,则当一个IP地址被加入黑名单时,会有一封邮件被发送到相应的地址。 #### DOSSystemCommand #### @@ -169,31 +156,47 @@ mod_evasive被配置为使用/etc/httpd/conf.d/mod_evasive.conf中的指令。 DOSSystemCommand
-这个指令指定当一个IP地址被加入黑名单时执行的命令。它通常结合shell脚本来使用,在脚本中添加一条防火墙规则来阻挡某个IP进一步的连接。 +这个指令指定当一个IP地址被加入黑名单时执行的命令。它通常结合shell脚本来使用,比如在脚本中添加一条防火墙规则来阻挡某个IP进一步的连接。 -**写一个shell脚本在防火墙阶段处理IP黑名单** +#####写一个shell脚本在防火墙阶段处理IP黑名单##### 当一个IP地址被加入黑名单,我们需要阻挡它进一步的连接。我们需要下面的shell脚本来执行这个任务。在/usr/local/bin下创建一个叫做scripts-tecmint的文件夹(或其他的名字),以及一个叫做ban_ip.sh的文件。 +**用于iptables防火墙** + #!/bin/sh # 由mod_evasive检测出,将被阻挡的IP地址 IP=$1 # iptables的完整路径 IPTABLES="/sbin/iptables" # mod_evasive锁文件夹 - MOD_EVASIVE_LOGDIR=/var/log/mod_evasive + mod_evasive_LOGDIR=/var/log/mod_evasive # 添加下面的防火墙规则 (阻止所有从$IP流入的流量) $IPTABLES -I INPUT -s $IP -j DROP # 为了未来的检测,移除锁文件 - rm -f "$MOD_EVASIVE_LOGDIR"/dos-"$IP" + rm -f "$mod_evasive_LOGDIR"/dos-"$IP" + +**用于firewalld防火墙** + + #!/bin/sh + # 由mod_evasive检测出,将被阻挡的IP地址 + IP=$1 + # firewalld-cmd的完整路径 + FIREWALL_CMD="/usr/bin/firewall-cmd" + # mod_evasive锁文件夹 + mod_evasive_LOGDIR=/var/log/mod_evasive + # 添加下面的防火墙规则 (阻止所有从$IP流入的流量) + $FIREWALL_CMD --zone=drop --add-source $IP + # 为了未来的检测,移除锁文件 + rm -f "$mod_evasive_LOGDIR"/dos-"$IP" 我们的DOSSystemCommand指令应该是这样的: DOSSystemCommand "sudo /usr/local/bin/scripts-tecmint/ban_ip.sh %s" -上面一行的%s代表了由mod_evasive检测到的攻击IP地址。 +上面一行的%s代表了由mod\_evasive检测到的攻击IP地址。 -**将apache用户添加到sudoers文件** +#####将apache用户添加到sudoers文件##### 请注意,如果您不给予apache用户以无需终端和密码的方式运行我们脚本(关键就是这个脚本)的权限,则这一切都不起作用。通常,您只需要以root权限键入visudo来存取/etc/sudoers文件,接下来添加下面的两行即可: @@ -201,14 +204,16 @@ mod_evasive被配置为使用/etc/httpd/conf.d/mod_evasive.conf中的指令。 Defaults:apache !requiretty ![](http://www.tecmint.com/wp-content/uploads/2012/06/Add-Apache-User-to-Sudoers.png) -添加Apache用户到Sudoers -**重要**: 作为默认的安全策略,您只能在终端中运行sudo。由于这个时候我们需要在没有tty的时候运行sudo,我们像下面图片中那样必须注释掉下面这一行: +*添加Apache用户到Sudoers* + +**重要**: 在默认的安全策略下您只能在终端中运行sudo。由于这个时候我们需要在没有tty的时候运行sudo,我们必须像下图中那样注释掉下面这一行: #Defaults requiretty ![](http://www.tecmint.com/wp-content/uploads/2012/06/Disable-tty-for-Sudo.png) -为Sudo禁用tty + +*为Sudo禁用tty* 最后,重启web服务器: @@ -219,7 +224,7 @@ mod_evasive被配置为使用/etc/httpd/conf.d/mod_evasive.conf中的指令。 有许多工具可以在您的服务器上模拟外部的攻击。您可以google下“tools for simulating ddos attacks”来找一找相关的工具。 -注意,您(也只有您)将负责您模拟所造成的结果。请不要考虑向不在您网络中的服务器发起模拟攻击。 +注意,您(也只有您)将负责您模拟所造成的结果。请不要考虑向不在您自己网络中的服务器发起模拟攻击。 假如您想对一个由别人托管的VPS做这些事情,您需要向您的托管商发送适当的警告或就那样的流量通过他们的网络获得允许。Tecmint.com不会为您的行为负责! @@ -228,21 +233,20 @@ mod_evasive被配置为使用/etc/httpd/conf.d/mod_evasive.conf中的指令。 我们的测试环境由一个CentOS 7服务器[IP 192.168.0.17]和一个Windows组成,在Windows[IP 192.168.0.103]上我们发起攻击: ![](http://www.tecmint.com/wp-content/uploads/2012/06/Confirm-Host-IPAddress.png) -确认主机IP地址 -请播放下面的视频,并跟从列出的步骤来模拟一个Dos攻击: +*确认主机IP地址* -注:youtube视频,发布的时候不行做个链接吧 - +请播放下面的视频(YT 视频,请自备梯子: https://www.youtube.com/-U_mdet06Jk ),并跟从列出的步骤来模拟一个Dos攻击: -然后攻击者的IP将被iptables阻挡: +然后攻击者的IP将被防火墙阻挡: ![](http://www.tecmint.com/wp-content/uploads/2012/06/Blocked-Attacker-IP.png) -阻挡攻击者的IP地址 + +*阻挡攻击者的IP地址* ### 结论 ### -在开启mod_security和mod_evasive的情况下,模拟攻击会导致CPU和RAM用量在源IP地址被加入黑名单之前出现短暂几秒的使用峰值。如果没有这些模块,模拟攻击绝对会很快将服务器击溃,并使服务器在攻击期间无法提供服务。 +在开启mod\_security和mod\_evasive的情况下,模拟攻击会导致CPU和RAM用量在源IP地址被加入黑名单之前出现短暂几秒的使用峰值。如果没有这些模块,模拟攻击绝对会很快将服务器击溃,并使服务器在攻击期间无法提供服务。 我们很高兴听见您打算使用(或已经使用过)这些工具。我们期望得到您的反馈,所以,请在留言处留下您的评价和问题,谢谢! @@ -253,18 +257,18 @@ mod_evasive被配置为使用/etc/httpd/conf.d/mod_evasive.conf中的指令。 -------------------------------------------------------------------------------- -via: http://www.tecmint.com/protect-apache-using-mod_security-and-mod_evasive-on-rhel-centos-fedora/ +via: http://www.tecmint.com/protect-apache-using-mod\_security-and-mod\_evasive-on-rhel-centos-fedora/ 作者:[Gabriel Cánepa][a] 译者:[wwy-hust](https://github.com/wwy-hust) -校对:[校对者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/gacanepa/ [1]:http://www.tecmint.com/install-lamp-in-centos-7/ -[2]:http://www.tecmint.com/configure-firewalld-in-centos-7/ -[3]:http://www.tecmint.com/how-to-enable-epel-repository-for-rhel-centos-6-5/ +[2]:https://linux.cn/article-4425-1.html +[3]:https://linux.cn/article-2324-1.html [4]:https://www.owasp.org/index.php/Category:OWASP_ModSecurity_Core_Rule_Set_Project [5]:https://github.com/SpiderLabs/ModSecurity/wiki/Reference-Manual#Configuration_Directives [6]:https://www.modsecurity.org/ From 34f4ca0f21e3c3039ef2b829383797545da83d49 Mon Sep 17 00:00:00 2001 From: carolinewuyan <309866211@qq.com> Date: Tue, 16 Jun 2015 13:16:25 +0800 Subject: [PATCH 399/965] =?UTF-8?q?=E5=B7=B2=E6=A0=A1=E5=AF=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... Beautiful Arc GTK+ Flat Theme on Linux.md | 35 +++++-------------- 1 file changed, 8 insertions(+), 27 deletions(-) diff --git a/translated/share/20150603 Here's How to Install the Beautiful Arc GTK+ Flat Theme on Linux.md b/translated/share/20150603 Here's How to Install the Beautiful Arc GTK+ Flat Theme on Linux.md index f8d1c56d41..4c25b0e60d 100644 --- a/translated/share/20150603 Here's How to Install the Beautiful Arc GTK+ Flat Theme on Linux.md +++ b/translated/share/20150603 Here's How to Install the Beautiful Arc GTK+ Flat Theme on Linux.md @@ -1,18 +1,18 @@ 如何在Linux中安装漂亮的扁平化Arc GTK+主题 ================================================================================ -> 易于看懂的每步都有的教程 +> 易于理解的分步教程 -**今天我们将向你介绍最新发布的GTK+主题,它拥有透明和扁平元素,并且与多个桌面环境和Linux发行版见荣发。[这个主题叫Arc][1]。** +**今天我们将向你介绍最新发布的GTK+主题,它拥有透明和扁平元素,并且与多个桌面环境和Linux发行版兼容。[这个主题叫Arc][1]。** -开始讲细节之前,我建议你快速地看一下下面的图,这样你有会对这个主题就会有一个基本的概念了。同样你应该意识到它目前可以工作在GTK+ 2.x、GTK+ 3.x、GNOME-Shell、 Budgie、 Unity和Pantheon用户界面,它们都使用了GNOME栈。 +开始讲细节之前,我建议你快速浏览一下下面的图,这样你有会对这个主题就会有一个基本的概念了。同样你应该知道它目前可以工作在GTK+ 2.x、GTK+ 3.x、GNOME-Shell、 Budgie、 Unity和Pantheon用户界面,它们都使用了GNOME栈。 -同样、Arc主题的开发者提醒我们它已经成功地在Ubuntu 15.04(Vivid Vervet)、 Arch Linux、 elementary OS 0.3 Freya、 Fedora 21、 Fedora 22、 Debian GNU/Linux 8.0 (Jessie)、 Debian Testing、 Debian Unstable、 openSUSE 13.2、 openSUSE Tumbleweed和Gentoo测试过了。 +同样、Arc主题的开发者告诉我们它已经成功地在Ubuntu 15.04(Vivid Vervet)、 Arch Linux、 elementary OS 0.3 Freya、 Fedora 21、 Fedora 22、 Debian GNU/Linux 8.0 (Jessie)、 Debian Testing、 Debian Unstable、 openSUSE 13.2、 openSUSE Tumbleweed和Gentoo测试过了。 ### 要求和安装指导 ### -要构建Arc主题,你需要先安装一些包,比如autoconf、 automake、 pkg-config (对Fedora的pkgconfig)、基于Debian/Ubuntu-based发行版的libgtk-3-dev或者基于RPM的gtk3-devel、 git、 gtk2-engines-pixbuf和gtk-engine-murrine (对Fedora的gtk-murrine-engine)。 +要构建Arc主题,你需要先安装一些包,比如autoconf、 automake、 pkg-config (对Fedora的pkgconfig)、基于Debian/Ubuntu-based发行版的libgtk-3-dev或者基于RPM的gtk3-devel、 git、 gtk2-engines-pixbuf和gtk-engine-murrine (对于Fedora则是gtk-murrine-engine)。 -Arc主题还没有二进制包,因此你需要从git仓库中取下最新的源码并编译。这样,打开终端并运行下面的命令,一行行地,并在每行的末尾按下回车键并等待上一步完成来继续一步。 +Arc主题还没有二进制包,因此你需要从git仓库中取下最新的源码并编译。这样,打开终端并运行下面的命令,一行行地,并在每行的末尾按下回车键并等待上一步完成来继续下一步。 git clone https://github.com/horst3180/arc-theme --depth 1 && cd arc-theme git fetch --tags @@ -20,7 +20,7 @@ Arc主题还没有二进制包,因此你需要从git仓库中取下最新的 ./autogen.sh --prefix=/usr sudo make install -就是这样!此时你已经在你的GNU/Linux发行版中安装了Arc主题,如果你使用GNOME可以使用GONME Tweak工具或者如果你使用Unity可以使用Unity Tweak工具来激活主题。玩得开心也不要忘了在下面的评论栏里留下你的截图。 +就是这样!此时你已经在你的GNU/Linux发行版中安装了Arc主题,如果你使用GNOME可以使用GONME Tweak工具,如果你使用Ubuntu的Unity可以使用Unity Tweak工具来激活主题。玩得开心但不要忘了在下面的评论栏里留下你的截图。 ![](http://i1-news.softpedia-static.com/images/news2/Here-s-How-to-Install-the-Beautiful-Arc-GTK-plus-Flat-Theme-on-Linux-483143-2.jpg) @@ -34,28 +34,9 @@ via: http://news.softpedia.com/news/Here-s-How-to-Install-the-Beautiful-Arc-GTK- 作者:[Marius Nestor][a] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[caroline](https://github.com/carolinewuyan) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 [a]:http://news.softpedia.com/editors/browse/marius-nestor [1]:https://github.com/horst3180/Arc-theme -[2]: -[3]: -[4]: -[5]: -[6]: -[7]: -[8]: -[9]: -[10]: -[11]: -[12]: -[13]: -[14]: -[15]: -[16]: -[17]: -[18]: -[19]: -[20]: From 3e54ac0873a7c79499bfcf7da0325d0ad4c6eb7f Mon Sep 17 00:00:00 2001 From: carolinewuyan <309866211@qq.com> Date: Tue, 16 Jun 2015 13:17:08 +0800 Subject: [PATCH 400/965] =?UTF-8?q?=E5=B7=B2=E6=A0=A1=E5=AF=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...How to Install the Beautiful Arc GTK+ Flat Theme on Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/translated/share/20150603 Here's How to Install the Beautiful Arc GTK+ Flat Theme on Linux.md b/translated/share/20150603 Here's How to Install the Beautiful Arc GTK+ Flat Theme on Linux.md index 4c25b0e60d..93f7b004e1 100644 --- a/translated/share/20150603 Here's How to Install the Beautiful Arc GTK+ Flat Theme on Linux.md +++ b/translated/share/20150603 Here's How to Install the Beautiful Arc GTK+ Flat Theme on Linux.md @@ -10,7 +10,7 @@ ### 要求和安装指导 ### -要构建Arc主题,你需要先安装一些包,比如autoconf、 automake、 pkg-config (对Fedora的pkgconfig)、基于Debian/Ubuntu-based发行版的libgtk-3-dev或者基于RPM的gtk3-devel、 git、 gtk2-engines-pixbuf和gtk-engine-murrine (对于Fedora则是gtk-murrine-engine)。 +要构建Arc主题,你需要先安装一些包,比如autoconf、 automake、 pkg-config (对于Fedora则是pkgconfig)、基于Debian/Ubuntu-based发行版的libgtk-3-dev或者基于RPM的gtk3-devel、 git、 gtk2-engines-pixbuf和gtk-engine-murrine (对于Fedora则是gtk-murrine-engine)。 Arc主题还没有二进制包,因此你需要从git仓库中取下最新的源码并编译。这样,打开终端并运行下面的命令,一行行地,并在每行的末尾按下回车键并等待上一步完成来继续下一步。 From 7879931b0dde38f7962bbd984506c23fdaadf47a Mon Sep 17 00:00:00 2001 From: struggling <630441839@qq.com> Date: Tue, 16 Jun 2015 14:13:39 +0800 Subject: [PATCH 401/965] Create 20150515 Extend Swap Space using Swap file in Linux.md --- ...end Swap Space using Swap file in Linux.md | 76 +++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 translated/tech/20150515 Extend Swap Space using Swap file in Linux.md diff --git a/translated/tech/20150515 Extend Swap Space using Swap file in Linux.md b/translated/tech/20150515 Extend Swap Space using Swap file in Linux.md new file mode 100644 index 0000000000..473e24ea0d --- /dev/null +++ b/translated/tech/20150515 Extend Swap Space using Swap file in Linux.md @@ -0,0 +1,76 @@ +在linux上使用交换文件扩展交换空间 +================================================================================ +想像一种情景,当我们的Linux系统用尽交换空间时,在这种情况下, +我们想要使用swap分区扩展交换空间,但在某些情况下磁盘上的空闲分区是不可用的, +致使我们不能把它扩大。 + +因此,在这种情况下,我们可以使用交换文件增加swap空间。 + +### 以下是使用交换文件在Linux上扩展swap空间的方法 ### + +让我们首先检查现有的交换空间/分区的大小,使用命令 ‘**free -m‘** 或者 ‘**swapon -s**‘ + +![](http://www.linuxtechi.com/wp-content/uploads/2015/06/free-output-with-swap.jpg) +free-output-with-swap + +我的交换分区大小是2 GB,我们将把交换空间扩展1GB。 + +#### 第一步:使用下面的dd命令创建大小为1GB交换文件d #### + + [root@linuxtechi ~]# dd if=/dev/zero of=/swap_file bs=1G count=1 + 1+0 records in + 1+0 records out + 1073741824 bytes (1.1 GB) copied, 414.898 s, 2.6 MB/s + [root@linuxtechi ~]# + +根据你的需要替换 ‘**bs**‘ 和 ‘**count**‘ 的大小. + +####第二步:设置交换文件权限为644. #### + + [root@linuxtechi ~]# chmod 600 /swap_file + +#### 第三步:用文件开启交换区(swap_file)#### + +用mkswap命令开启交换区 + + [root@linuxtechi ~]# mkswap /swap_file + Setting up swapspace version 1, size = 1048572 KiB + no label, UUID=f7b3ae59-c09a-4dc2-ba4d-c02abb7db33b + [root@linuxtechi ~]# + +#### 第四步:在fstab文件中添加交换文件条目 #### + +在fstab文件中添加以下条目,以便交换文件每次重启后互能继续使用. + + /swap_file swap swap defaults 0 0 + +![swap-file-fstab-entry](http://www.linuxtechi.com/wp-content/uploads/2015/06/swap-file-fstab-entry.jpg) + +#### 第五步:用命令 ‘mkswap on’ 启用交换文件. #### + + [root@linuxtechi ~]# swapon /swap_file + [root@linuxtechi ~]# + +#### 第六步:现在查看交换空间 #### + +![swap-space-after-extension](http://www.linuxtechi.com/wp-content/uploads/2015/06/swap-space-after-extension.jpg) + +**Note**: 为了避免出现意外的情况,如下所示使用swapoff命令关闭它, +仅在需要使用时,使用步骤5所示的swapon命令,重新启用交换文件。. + + [root@linuxtechi ~]# swapoff /swap_file + [root@linuxtechi ~]# + +请分享您的宝贵意见或者评论此文章. + +-------------------------------------------------------------------------------- + +via: http://www.linuxtechi.com/extend-swap-space-using-swap-file-in-linux/ + +作者:[Pradeep Kumar][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.linuxtechi.com/author/pradeep/ From 640fe12e08a2aedd8be1dc95fb2fcf1ea2c942e3 Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 16 Jun 2015 14:17:59 +0800 Subject: [PATCH 402/965] PUB:20150225 How to make remote incremental backup of LUKS-encrypted disk or partition @GOLinux --- ...backup of LUKS-encrypted disk or partition.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) rename {translated/tech => published}/20150225 How to make remote incremental backup of LUKS-encrypted disk or partition.md (81%) diff --git a/translated/tech/20150225 How to make remote incremental backup of LUKS-encrypted disk or partition.md b/published/20150225 How to make remote incremental backup of LUKS-encrypted disk or partition.md similarity index 81% rename from translated/tech/20150225 How to make remote incremental backup of LUKS-encrypted disk or partition.md rename to published/20150225 How to make remote incremental backup of LUKS-encrypted disk or partition.md index 645ade2261..122787ee3d 100644 --- a/translated/tech/20150225 How to make remote incremental backup of LUKS-encrypted disk or partition.md +++ b/published/20150225 How to make remote incremental backup of LUKS-encrypted disk or partition.md @@ -1,16 +1,16 @@ -为LUKS——加密的磁盘/分区做增量备份 +为LUKS加密的磁盘/分区做增量备份 ================================================================================ -我们中有些人出于安全原因,在家里或者[VPS][1]上通过[Linux统一密钥配置(LUKS)][2]为硬盘驱动器加密,而这些驱动器的容量很快会增长到数十或数百GB。因此,虽然我们享受着LUKS设备带来的安全感,但是我们也该开始考虑一个可能的远程备份方案了。对于安全的非现场备份,我们将需要在LUKS加密的设备上以块级别操作的东西。因此,最后我们发现这么个状况,我们每次都需要传输想要做备份的LUKS设备(比如说200GB)。很明显,这是不可行的。我们该怎么来处理这个问题呢? +我们中有些人出于安全原因,在家里或者[VPS][1]上通过[Linux统一密钥配置(LUKS)][2]为硬盘驱动器加密,而这些驱动器的容量很快会增长到数十或数百GB。因此,虽然我们享受着LUKS设备带来的安全感,但是我们也该开始考虑一个可能的远程备份方案了。对于安全的非现场备份,我们将需要能在LUKS加密的设备上以块级别操作的东西。因此,最后我们发现这么个状况,我们每次都需要传输想要做备份的整个LUKS设备(比如说200GB大)。很明显,这是不可行的。我们该怎么来处理这个问题呢? ### 一个解决方案: Bdsync ### -这时,一个卓越的开源工具来拯救我们了,它叫[Bdsync][3](多亏了Rolf Fokkens)。顾名思义,Bdsync可以通过网络同步“块设备”。对于快速同步,Bdsync会生成并对比本地/远程块设备的块MD5校验和,只同步差异部分。rsync在文件系统级别可以做的,Bdsync可以在块设备级别完成。很自然,对于LUKS加密的设备它也能工作得很好。相当地灵巧! +这时,一个卓越的开源工具来拯救我们了,它叫[Bdsync][3](多亏了Rolf Fokkens)。顾名思义,Bdsync可以通过网络同步“块设备”。对于快速同步,Bdsync会生成并对比本地/远程块设备的块的MD5校验和,只同步差异部分。rsync在文件系统级别可以做的,Bdsync可以在块设备级别完成。很自然,对于LUKS加密的设备它也能工作得很好。相当地灵巧! 使用Bdsync,首次备份将拷贝整个LUKS块设备到远程主机,因而会花费大量时间来完成。然而,在初始备份后,如果我们在LUKS设备新建一些文件,再次备份就会很快完成,因为我们只需拷贝修改过的块。经典的增量备份在起作用了! ### 安装Bdsync到Linux ### -Bdsync并不包含在[Linux][4]发行版的标准仓库中,因而你需要从源代码来构建它。使用以下针对特定版本的指令来安装Bdsync及其手册页到你的系统中。 +Bdsync并不包含在Linux发行版的标准仓库中,因而你需要从源代码来构建它。使用以下针对特定版本的指令来安装Bdsync及其手册页到你的系统中。 #### Debian,Ubuntu或Linux Mint #### @@ -46,7 +46,7 @@ Bdsync并不包含在[Linux][4]发行版的标准仓库中,因而你需要从 你第一次运行上面的命令的时候,它会花费很长一段时间,这取决于你的互联网/局域网速度,以及/dev/LOCDEV的大小。记住,你必须有两个大小相同的块设备(/dev/LOCDEV和/dev/REMDEV)。 -下一步是要将补丁文件从本地主机拷贝到远程主机。一种可能是使用scp: +下一步是要将补丁文件从本地主机拷贝到远程主机。一种方式是使用scp: # scp /some_local_path/DEV.bdsync.gz root@remote_host:/remote_path @@ -58,7 +58,7 @@ Bdsync并不包含在[Linux][4]发行版的标准仓库中,因而你需要从 ### 尾声 ### -小结之,我们演示了如何使用Bdsync来为LUKS设备实施增量备份。和rsync一样,每次备份只有一小部分数据,而不是整个LUKS设备,需要被推送到非现场备份点,这样会节省带宽和备份时间。剩下来,需要保证所有数据传输通过SSH或SCP加固安全,事实上设备自身是由LUKS加密的。也可以通过使用可以运行bdsync的专用用户(而非root)来改善该配置。我们也可以将bdsync用于任何块设备,如LVM卷或RAID磁盘,也可以很轻易地设置Bdsync备份本地磁盘到USB驱动器上。如你所见,它有着无限可能性! +小结之,我们演示了如何使用Bdsync来为LUKS设备实施增量备份。和rsync一样,每次备份只有一小部分数据,而不是整个LUKS设备,需要被推送到非现场备份点,这样会节省带宽和备份时间。剩下来,需要通过SSH或SCP来保证所有数据传输的安全,事实上设备自身是由LUKS加密的。也可以通过使用可以运行bdsync的专用用户(而非root)来改进该配置。我们也可以将bdsync用于任何块设备,如LVM卷或RAID磁盘,也可以很轻易地设置Bdsync备份本地磁盘到USB驱动器上。如你所见,它有着无限可能性! 随时分享你的想法。 @@ -68,7 +68,7 @@ via: http://xmodulo.com/remote-incremental-backup-luks-encrypted-disk-partition. 作者:[Iulian Murgulet][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/) 荣誉推出 @@ -77,4 +77,4 @@ via: http://xmodulo.com/remote-incremental-backup-luks-encrypted-disk-partition. [2]:http://xmodulo.com/how-to-create-encrypted-disk-partition-on-linux.html [3]:http://bdsync.rolf-fokkens.nl/ [4]:http://xmodulo.com/recommend/linuxbook -[5]:http://xmodulo.com/how-to-enable-ssh-login-without.html +[5]:https://linux.cn/article-5444-1.html From 2c7380a8caf07fc3bc900f18411e844830de39b3 Mon Sep 17 00:00:00 2001 From: DeadFire Date: Tue, 16 Jun 2015 15:54:00 +0800 Subject: [PATCH 403/965] =?UTF-8?q?20150616-1=20=E9=80=89=E9=A2=98=20sorry?= =?UTF-8?q?:=E6=98=A8=E5=A4=A9=E7=9A=84=E6=96=87=E7=AB=A0=E5=B1=85?= =?UTF-8?q?=E7=84=B6=E6=96=87=E4=BB=B6=E5=90=8D=E6=A0=87=E9=94=99=E6=97=A5?= =?UTF-8?q?=E6=9C=9F=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...PHP or PhpMyAdmin in RHEL or CentOS 7.0.md | 238 ++++++++++++++++++ 1 file changed, 238 insertions(+) create mode 100644 sources/tech/20150616 Installing LAMP Linux, Apache, MariaDB, PHP or PhpMyAdmin in RHEL or CentOS 7.0.md diff --git a/sources/tech/20150616 Installing LAMP Linux, Apache, MariaDB, PHP or PhpMyAdmin in RHEL or CentOS 7.0.md b/sources/tech/20150616 Installing LAMP Linux, Apache, MariaDB, PHP or PhpMyAdmin in RHEL or CentOS 7.0.md new file mode 100644 index 0000000000..82be4748e0 --- /dev/null +++ b/sources/tech/20150616 Installing LAMP Linux, Apache, MariaDB, PHP or PhpMyAdmin in RHEL or CentOS 7.0.md @@ -0,0 +1,238 @@ +Installing LAMP (Linux, Apache, MariaDB, PHP/PhpMyAdmin) in RHEL/CentOS 7.0 +================================================================================ +Skipping the LAMP introduction, as I’m sure that most of you know what is all about. This tutorial will concentrate on how to install and configure famous LAMP stack – Linux Apache, MariaDB, PHP, PhpMyAdmin – on the last release of Red Hat Enterprise Linux 7.0 and CentOS 7.0, with the mention that both distributions have upgraded httpd daemon to Apache HTTP 2.4. + +![Install LAMP in CentOS 7](http://www.tecmint.com/wp-content/uploads/2014/07/Install-LAMP-in-CentOS-7.jpg) + +Install LAMP in RHEL/CentOS 7.0 + +#### Requirements #### + +Depending on the used distribution, RHEL or CentOS 7.0, use the following links to perform a minimal system installation, using a static IP Address for network configuration. + +**For RHEL 7.0** + +- [RHEL 7.0 Installation Procedure][1] +- [Register and Enable Subscriptions/Repositories on RHEL 7.0][2] + +**For CentOS 7.0** + +- [CentOS 7.0 Installation Procedure][3] + +### Step 1: Install Apache Server with Basic Configurations ### + +**1. After performing a minimal system installation and configure your server network interface with a [Static IP Address on RHEL/CentOS 7.0][4], go ahead and install Apache 2.4 httpd service binary package provided form official repositories using the following command.** + + # yum install httpd + +![Install Apache in CentOS 7](http://www.tecmint.com/wp-content/uploads/2014/07/Install-Apache-in-CentOS-7.png) + +Install Apache Web Server + +**2. After yum manager finish installation, use the following commands to manage Apache daemon, since RHEL and CentOS 7.0 both migrated their init scripts from SysV to systemd – you can also use SysV and Apache scripts the same time to manage the service.** + + # systemctl status|start|stop|restart|reload httpd + + OR + + # service httpd status|start|stop|restart|reload + + OR + + # apachectl configtest| graceful + +![Start Apache in CentOS 7](http://www.tecmint.com/wp-content/uploads/2014/07/Start-Apache-in-CentOS-7.png) + +Start Apache Web Server + +**3. On the next step start Apache service using systemd init script and open RHEL/CentOS 7.0 Firewall rules using firewall-cmd, which is the default command to manage iptables through firewalld daemon.** + + # firewall-cmd --add-service=http + +**NOTE**: Make notice that using this rule will lose its effect after a system reboot or firewalld service restart, because it opens on-fly rules, which are not applied permanently. To apply consistency iptables rules on firewall use –permanent option and restart firewalld service to take effect. + + # firewall-cmd --permanent --add-service=http + # systemctl restart firewalld + +![Enable Firewall in CentOS 7](http://www.tecmint.com/wp-content/uploads/2014/07/Enable-Firewall-in-CentOS-7.png) + +Enable Firewall in CentOS 7 + +Other important Firewalld options are presented below: + + # firewall-cmd --state + # firewall-cmd --list-all + # firewall-cmd --list-interfaces + # firewall-cmd --get-service + # firewall-cmd --query-service service_name + # firewall-cmd --add-port=8080/tcp + +**4. To verify Apache functionality open a remote browser and type your server IP Address using HTTP protocol on URL (http://server_IP), and a default page should appear like in the screenshot below.** + +![Apache Default Page](http://www.tecmint.com/wp-content/uploads/2014/07/Apache-Default-Page.png) + +Apache Default Page + +**5. For now, Apache DocumentRoot path it’s set to /var/www/html system path, which by default doesn’t provide any index file. If you want to see a directory list of your DocumentRoot path open Apache welcome configuration file and set Indexes statement from – to + on directive, using the below screenshot as an example.** + + # nano /etc/httpd/conf.d/welcome.conf + +![Apache Directory Listing](http://www.tecmint.com/wp-content/uploads/2014/07/Apache-Directory-Listing.png) + +Apache Directory Listing + +**6. Close the file, restart Apache service to reflect changes and reload your browser page to see the final result.** + + # systemctl restart httpd + +![Apache Index File](http://www.tecmint.com/wp-content/uploads/2014/07/Apache-Index-File.png) + +Apache Index File + +### Step 2: Install PHP5 Support for Apache ### + +**7. Before installing PHP5 dynamic language support for Apache, get a full list of available PHP modules and extensions using the following command.** + + # yum search php + +![Install PHP in CentOS 7](http://www.tecmint.com/wp-content/uploads/2014/07/Install-PHP-in-CentOS-7.png) + +Install PHP in CentOS 7 + +**8. Depending on what type of applications you want to use, install the required PHP modules from the above list, but for a basic MariaDB support in PHP and PhpMyAdmin you need to install the following modules.** + + # yum install php php-mysql php-pdo php-gd php-mbstring + +![Install PHP Modules in CentOS 7](http://www.tecmint.com/wp-content/uploads/2014/07/Install-PHP-Modules-in-CentOS-7.png) + +Install PHP Modules + +![Install PHP mbstring Module](http://www.tecmint.com/wp-content/uploads/2014/07/Install-PHP-mbstring-in-CentOs-7.png) + +Install PHP mbstring Module + +**9. To get a full information list on PHP from your browser, create a info.php file on Apache Document Root using the following command from root account, restart httpd service and direct your browser to the http://server_IP/info.php address.** + + # echo "" > /var/www/html/info.php + # systemctl restart httpd + +![Check PHP Info in CentOS 7](http://www.tecmint.com/wp-content/uploads/2014/07/Check-PHP-Info-in-CentOS-7.png) + +Check PHP Info in CentOS 7 + +**10. If you get an error on PHP Date and Timezone, open php.ini configuration file, search and uncomment date.timezone statement, append your physical location and restart Apache daemon.** + + # nano /etc/php.ini + +Locate and change date.timezone line to look like this, using [PHP Supported Timezones list][5]. + + date.timezone = Continent/City + +![Set Timezone in PHP](http://www.tecmint.com/wp-content/uploads/2014/07/Set-Time-Zone-in-CentOS.png) + +Set Timezone in PHP + +### Step 3: Install and Configure MariaDB Database ### + +**11. Red Hat Enterprise Linux/CentOS 7.0 switched from MySQL to MariaDB for its default database management system. To install MariaDB database use the following command.** + + # yum install mariadb-server mariadb + +![Install MariaDB in CentOS 7](http://www.tecmint.com/wp-content/uploads/2014/07/Install-MariaDB-in-CentOs-7.png) + +Install MariaDB in CentOS 7 + +**12. After MariaDB package is installed, start database daemon and use mysql_secure_installation script to secure database (set root password, disable remotely logon from root, remove test database and remove anonymous users).** + + # systemctl start mariadb + # mysql_secure_installation + +![Start MariaDB Database](http://www.tecmint.com/wp-content/uploads/2014/07/Start-MariaDB-in-CentOS-7.png) + +Start MariaDB Database + +![Secure MySQL Installation](http://www.tecmint.com/wp-content/uploads/2014/07/Secure-MySQL-Installation.png) + +Secure MySQL Installation + +**13. To test database functionality login to MariaDB using its root account and exit using quit statement.** + + mysql -u root -p + MariaDB > SHOW VARIABLES; + MariaDB > quit + +![Connect MySQL Database in CentOS](http://www.tecmint.com/wp-content/uploads/2014/07/Connect-MySQL-Installation.png) + +Connect MySQL Database + +### Step 4: Install PhpMyAdmin ### + +**14. By default official RHEL 7.0 or CentOS 7.0 repositories doesn’t provide any binary package for PhpMyAdmin Web Interface. If you are uncomfortable using MySQL command line to manage your database you can install PhpMyAdmin package by enabling CentOS 7.0 rpmforge repositories using the following command.** + + # yum install http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el7.rf.x86_64.rpm + +After enabling rpmforge repository, next install PhpMyAdmin. + + # yum install phpmyadmin + +![Enable RPMForge in CentOS 7](http://www.tecmint.com/wp-content/uploads/2014/07/Enable-RPMForge-in-CentOS-7.png) + +Enable RPMForge Repository + +**15. Next configure PhpMyAdmin to allow connections from remote hosts by editing phpmyadmin.conf file, located on Apache conf.d directory, commenting the following lines.** + + # nano /etc/httpd/conf.d/phpmyadmin.conf + +Use a # and comment this lines. + + # Order Deny,Allow + # Deny from all + # Allow from 127.0.0.1 + +![Allow Remote PhpMyAdmin Access](http://www.tecmint.com/wp-content/uploads/2014/07/Allow-Remote-PhpMyAdmin-Access.png) + +Allow Remote PhpMyAdmin Access + +**16. To be able to login to PhpMyAdmin Web interface using cookie authentication method add a blowfish string to phpmyadmin config.inc.php file like in the screenshot below using the [generate a secret string][6], restart Apache Web service and direct your browser to the URL address http://server_IP/phpmyadmin/.** + + # nano /etc/httpd/conf.d/phpmyadmin.conf + # systemctl restart httpd + +![Add Blowfish in PhpMyAdmin](http://www.tecmint.com/wp-content/uploads/2014/07/Add-Blowfish-PhpMyAdmin.png) + +Add Blowfish in PhpMyAdmin + +![PhpMyAdmin Dashboard](http://www.tecmint.com/wp-content/uploads/2014/07/Login-to-PhpMyAdmin.png) + +PhpMyAdmin Dashboard + +### Step 5: Enable LAMP System-wide ### + +**17. If you need MariaDB and Apache services to be automatically started after reboot issue the following commands to enable them system-wide.** + + # systemctl enable mariadb + # systemctl enable httpd + +![Enable Services System Wide](http://www.tecmint.com/wp-content/uploads/2014/07/Enable-Services-System-Wide.png) + +Enable Services System Wide + +That’s all it takes for a basic LAMP installation on Red Hat Enterprise 7.0 or CentOS 7.0. The next series of articles related to LAMP stack on CentOS/RHEL 7.0 will discuss how to create Virtual Hosts, generate SSL Certificates and Keys and add SSL transaction support for Apache HTTP Server. + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/install-lamp-in-centos-7/ + +作者:[Matei Cezar][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/cezarmatei/ +[1]:http://www.tecmint.com/redhat-enterprise-linux-7-installation/ +[2]:http://www.tecmint.com/enable-redhat-subscription-reposiories-and-updates-for-rhel-7/ +[3]:http://www.tecmint.com/centos-7-installation/ +[4]:http://www.tecmint.com/configure-network-interface-in-rhel-centos-7-0/ +[5]:http://php.net/manual/en/timezones.php +[6]:http://www.question-defense.com/tools/phpmyadmin-blowfish-secret-generator \ No newline at end of file From 0df0743ac5412bbc0c3af5fe739cb15bdfd0248c Mon Sep 17 00:00:00 2001 From: DeadFire Date: Tue, 16 Jun 2015 16:23:21 +0800 Subject: [PATCH 404/965] =?UTF-8?q?20150616-2=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...0150616 Linux Humor on the Command-line.md | 127 +++++++++++++ ...20150616 LINUX 101--POWER UP YOUR SHELL.md | 177 ++++++++++++++++++ 2 files changed, 304 insertions(+) create mode 100644 sources/share/20150616 Linux Humor on the Command-line.md create mode 100644 sources/tech/20150616 LINUX 101--POWER UP YOUR SHELL.md diff --git a/sources/share/20150616 Linux Humor on the Command-line.md b/sources/share/20150616 Linux Humor on the Command-line.md new file mode 100644 index 0000000000..84c808e555 --- /dev/null +++ b/sources/share/20150616 Linux Humor on the Command-line.md @@ -0,0 +1,127 @@ +Linux Humor on the Command-line +================================================================================ +The desktop is full of eye candy. It enhances the visual experience and, in some cases, can also increase functionality of software. But it also makes software fun. Working on the command-line does not have to be always serious. If you want some fun on the command-line, there are lots of commands to raise a smile. + +Linux is a fun operating system. Linux offers a vast collection of small open source utilities that perform functions ranging from the obvious to the bizarre. It is the quality and selection of these tools that help Linux stand out. Check out these 7 small utilities. + +### lolcat ### + +![lolcat](http://www.linuxlinks.com/portal/content/reviews/Misc/Screenshot-lolcat.png) + +lolcat is a program that concatenates files, or standard input, to standard output (like the generic cat), and adds rainbow coloring to it. + +lolcat is often combined with other tools such as toilet or figlet to generate text. This software should not be confused with a lolcat; an image macro of one or more cats. + +lolcat was written by Moe. + +Website: [github.com][1] + +### cowsay ### + +![cowsay](http://www.linuxlinks.com/portal/content/reviews/Misc/Screenshot-cowsay.png) + +cowsay is a configurable open source program which generates ASCII pictures of a cow with a message in a speech bubble. cowsay is written in Perl. + +cowsay is not limited to generating pictures of cows. It can generate pre-made images of other animals including a duck, elephant, koala, moose, pony, sheep, stegosaurus, and turkey, as well as cheese, snowman, and a skeleton. + +There is a related program called cowthink, which generates cows with thought bubbles, as opposed to speech bubbles. + +Features include: + +- Make scripts more interesting +- Borg mode +- Ways to alter the way the cow looks, for example making the cow look greedy, paranoid, stoned, tired, wired, youthful and more +- xcowsay variant available + +Website: [nog.net][2] + +### doge ### + +![doge](http://www.linuxlinks.com/portal/content/reviews/Misc/Screenshot-doge.png) + +doge is a simple motd script based on the slightly stupid but very funny doge meme. It prints random grammatically incorrect statements that are sometimes based on things from your computer. + +Doge is an Internet meme that became popular in 2013. The meme typically consists of a picture of a Shiba Inu accompanied by multicolored text in Comic Sans font in the foreground. The text, representing a kind of internal monologue, is deliberately written in a form of broken English. + +- Randomly placed and colored random strings, complete with broken english +- Awesome Shibe in the terminal +- Fetching of system data, such as hostname, running processes, current user and $EDITOR +- If you have lolcat, you can do this gem: while true; do doge | lolcat -a -d 100 -s 100 -p 1; done +- stdin support: ls /usr/bin | doge will doge-print some of the executables found in /usr/bin. wow. There are also multiple command line switches that control filtering and statistical frequency of words + +Website: [github.com/thiderman/doge][3] + +### ASCIIQuarium ### + +![Asciiquarium](http://www.linuxlinks.com/portal/content/reviews/Misc/Screenshot-Asciiquarium.png) + +ASCIIQuarium is an aquarium/sea animation in ASCII art. Enjoy the fascinating creatures that live in the water from your computer. + +To run ASCIIQuarium you need to have installed Perl's curses package, and the Term::Animation module. To install the former, type sudo apt-get install libcurses-perl. To install the latter, type sudo cpan Term::Animation, both at the command line. + +Features include: + +- Multicolored fish +- Amusing animations, including a fish hook +- There are swans, ducks, dolphins, and ships too + +Website: [www.robobunny.com][4] + +### sl - Steam Locomotive ### + +![sl](http://www.linuxlinks.com/portal/content/reviews/Misc/Screenshot-sl.png) + +sl is an amusing command line tool that displays animations to correct users who accidentally type sl instead of ls. + +I'm rather sloppy at typing, preferring speed to accuracy. But typos can be a tad dangerous on the command line. So sl can serve as a practical reminder of curing a bad habit of mistyping. It always raises a chuckle too. + +Features include: + +- With -F, train flies +- With -l, it shows a small train +- With -a, an accident seems to happen + +Website: [github.com/mtoyoda/sl][5] + +### aafire ### + +![aafire](http://www.linuxlinks.com/portal/content/reviews/Misc/Screenshot-aafire.png) + +aafire displays burning ASCII art flames in the terminal. It demonstrates the the capabilities of the aalib library, an ascii art library. + +Website: [aa-project.sourceforge.net/aalib][6] + +### CMatrix ### + +![CMatrix](http://www.linuxlinks.com/portal/content/reviews/Misc/Screenshot-CMatrix.png) + +CMatrix is an ncurses program that simulates the display from "The Matrix". If you have been living in a cave for the past 15 years, you might not know The Matrix is a 1999 American science fiction acting film starring Keanu Reeves, Laurence Fishburne, Carrie-Anne Moss, Hugo Weaving, and Joe Pantoliano. + +It works with terminal settings up to 132x300 and can scroll lines all at the same rate or asynchronously and at a user-defined speed. + +Features include: + +- Change the text colour +- Turn on bold characters +- Asynchronous scroll +- Use old-style scrolling +- "Screensaver" mode + +Website: [www.asty.org/cmatrix][7] + +-------------------------------------------------------------------------------- + +via: http://www.linuxlinks.com/article/20150614112018846/Humor.html + +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[1]:https://github.com/busyloop/lolcat +[2]:https://web.archive.org/web/20120225123719/http://www.nog.net/%7Etony/warez/cowsay.shtml +[3]:https://github.com/thiderman/doge +[4]:http://www.robobunny.com/projects/asciiquarium/html/ +[5]:https://github.com/mtoyoda/sl +[6]:http://aa-project.sourceforge.net/aalib/ +[7]:http://www.asty.org/cmatrix/ \ No newline at end of file diff --git a/sources/tech/20150616 LINUX 101--POWER UP YOUR SHELL.md b/sources/tech/20150616 LINUX 101--POWER UP YOUR SHELL.md new file mode 100644 index 0000000000..ef9f3d4937 --- /dev/null +++ b/sources/tech/20150616 LINUX 101--POWER UP YOUR SHELL.md @@ -0,0 +1,177 @@ +LINUX 101: POWER UP YOUR SHELL +================================================================================ +> Get a more versatile,featureful and colourful command line interface with our guide to shell basics. + +**WHY DO THIS?** + +- Make life at the shell prompt easier and faster. +- Resume sessions after losing a connection. +- Stop pushing around that fiddly rodent! + +![bash1](http://www.linuxvoice.com/wp-content/uploads/2015/02/bash1-large15.png) + +Here’s our souped-up prompt on steroids. It’s a bit long for this small terminal window, but you can tweak it to your liking. + +As a Linux user, you’re probably familiar with the shell (aka command line). You may pop up the occasional terminal now and then for some essential jobs that you can’t do at the GUI, or perhaps you live in a tiling window manager environment and the shell is your main way of interacting with your Linux box. + +In either case, you’re probably using the stock Bash configuration that came with your distro – and while it’s powerful enough for most jobs, it could still be a lot better. In this tutorial we’ll show you how to pimp up your shell to make it more informative, useful and pleasant to work in. We’ll customise the prompt to make it provide better feedback than the defaults, and we’ll show you how to manage sessions and run multiple programs together with the incredibly cool tmux tool. And for a bit of eye candy, we’ll look at colour schemes as well. So, onwards! + +### Make your prompt sing ### + +Most distributions ship with very plain prompts – they show a bit of information, and generally get you by, but the prompt can do so much more. Take the default prompt on a Debian 7 installation, for instance: + + mike@somebox:~$ + +This shows the user, hostname, current directory and account type symbol (if you switch to root, the **$** changes to #). But where is this information stored? The answer is in the **PS1** environment variable. If you enter **echo $PS1** you’ll see this at the end of the text string that appears: + + u@h:w$ + +This looks a bit ugly, and at first glance you might start screaming, assuming it to be a dreaded regular expression, but we’re not going to fry our brains with the complexity of those. No, the slashes here are escape sequences, telling the prompt to do special things. The **u** part, for instance, tells the prompt to show the username, while w means the working directory. + +Here’s a list of things you can use in the prompt: + +- d The current date. +- h The hostname. +- n A newline character. +- A The current time (HH:MM). +- u The current user. +- w (lowercase) The whole working directory. +- W (uppercase) The basename of the working directory. +- $ A prompt symbol that changes to # for root. +- ! The shell history number of this command. + +To clarify the difference in the **w** and **W** options: with the former, you’ll see the whole path for the directory in which you’re working (eg **/usr/local/bin**), whereas for the latter it will just show the **bin** part. + +Now, how do you go about changing the prompt? You need to modify the contents of the **PS1** environment variable. Try this: + + export PS1=”I am u and it is A $” + +Now your prompt will look something like: + + I am mike and it is 11:26 $ + +From here you can experiment with the other escape sequences shown above to create the prompt of your dreams. But wait a second – when you log out, all of your hard work will be lost, because the value of the **PS1** environment variable is reset each time you start a terminal. The simplest way to fix this is to open the **.bashrc** configuration file (in your home directory) and add the complete export command to the bottom. This **.bashrc** file will be read by Bash every time you start a new shell session, so your beefed-up prompt will always appear. You can also spruce up your prompt with extra colour. This is a bit tricky at first, as you have to use some rather odd-looking escape sequences, but the results can be great. Add this to a point in your **PS1** string and it will change the text to red: + + [e[31m] + +You can change 31 here to other numbers for different colours: + +- 30 Black +- 32 Green +- 33 Yellow +- 34 Blue +- 35 Magenta +- 36 Cyan +- 37 White + +So, let’s finish off this section by creating the mother of all prompts, using the escape sequences and colours we’ve already looked at. Take a deep breath, flex your fingers, and then type this beast: + + export PS1=”(!) [e[31m][A] [e[32m]u@h [e[34m]w [e[30m]$ “ + +This provides a Bash command history number, current time, and colours for the user/hostname combination and working directory. If you’re feeling especially ambitious, you can change the background colours as well as the foreground ones, for really striking combinations. The ever useful Arch wiki has a full list of colour codes: [http://tinyurl.com/3gvz4ec][1]. + +> ### Shell essentials ### +> +> If you’re totally new to Linux and have just picked up this magazine for the first time, you might find the tutorial a bit heavy going. So here are the basics to get you familiar with the shell. It’s usually found as Terminal, XTerm or Konsole in your menus, and when you start it the most useful commands are: +> +> **ls** (list files); **cp one.txt two.txt** (copy file); **rm file.txt** (remove file); **mv old.txt new.txt** (move or rename); +> +> **cd /some/directory** (change directory); **cd ..** (change to directory above); **./program** (run program in current directory); **ls > list.txt** (redirect output to a file). +> +> Almost every command has a manual page explaining options (eg **man ls** – press Q to quit the viewer). There you can learn about command options, so you can see that **ls -la** shows a detailed list including hidden files. Use the up and down cursor keys to cycle through previous commands, and use Tab after entering part of a file or directory name to auto-complete it. + +### Tmux: A window manager for your shell ### + +A window manager inside a text mode environment – it sounds crazy, right? Well, do you remember when web browsers first implemented tabbed browsing? It was a major step forward in usability at the time, and reduced clutter in desktop taskbars and window lists enormously. Instead of having taskbar or pager icons for every single site you had open, you just had the one button for your browser, and then the ability to switch sites inside the browser itself. It made an awful lot of sense. + +If you end up running several terminals at the same time, a similar situation occurs; you might find it annoying to keep jumping between them, and finding the right one in your taskbar or window list each time. With a text-mode window manager you can not only run multiple shell sessions simultaneously inside the same terminal window, but you can even arrange them side-by-side. + +And there’s another benefit too: detaching and reattaching. The best way to see how this works is to try it yourself. In a terminal window, enter **screen** (it’s installed by default on most distros, or will be available in your package repositories). Some welcome text appears – just hit Enter to dismiss it. Now run an interactive text mode program, such as **nano**, and close the terminal window. + +In a normal shell session, the act of closing the window would terminate every process running inside it – so your Nano editing session would be a goner. But not with screen. Open a new terminal and enter: + + screen -r + +And voilà: the Nano session you started before is back! + +When you originally ran **screen**, it created a new shell session that was independent and not tied to a specific terminal window, so it could be detached and reattached (hence the **-r** option) later. + +This is especially useful if you’re using SSH to connect to another machine, doing some work, and don’t want a flaky connection to ruin all your progress. If you do your work inside a **screen** session and your connection goes down (or your laptop battery dies, or your computer explodes), you can simply reconnect/recharge/buy a new computer, then SSH back in to the remote box, run **screen -r** to reattach and carry on from where you left off. + +Now, we’ve been talking about GNU **screen** here, but the title of this section mentions tmux. Essentially, **tmux** (terminal multiplexer) is like a beefed up version of **screen** with lots of useful extra features, so we’re going to focus on it here. Some distros include **tmux** by default; in others it’s usually just an **apt-get, yum install** or **pacman -S** command away. + +Once you have it installed, enter **tmux** to start it. You’ll notice right away that there’s a green line of information along the bottom. This is very much like a taskbar from a traditional window manager: there’s a list of running programs, the hostname of the machine, a clock and the date. Now run a program, eg Nano again, and hit Ctrl+B followed by C. This creates a new window inside the tmux session, and you can see this in the taskbar at the bottom: + + 0:nano- 1:bash* + +Each window has a number, and the currently displayed program is marked with an asterisk symbol. Ctrl+B is the standard way of interacting with tmux, so if you hit that key combo followed by a window number, you’ll switch to that window. You can also use Ctrl+B followed by N and P to switch to the next and previous windows respectively – or use Ctrl+B followed by L to switch between the two most recently used windows (a bit like the classic Alt+Tab behaviour on the desktop). To get a window list, use Ctrl+B followed by W. + +So far, so good: you can now have multiple programs running inside a single terminal window, reducing clutter (especially if you often have multiple SSH logins active on the same remote machine). But what about seeing two programs at the same time? + +For this, tmux uses “panes”. Hit Ctrl+B followed by % and the current window will be split into two sections, one on the left and one on the right. You can switch between them Using Ctrl+B followed by O. This is especially useful if you want to see two things at the same time – eg a manual page in one pane, and an editor with a configuration file in another. + +Sometimes you’ll want to resize the individual panes, and this is a bit trickier. First you have to hit Ctrl+B followed by : (colon), which turns the tmux bar along the bottom into a dark orange colour. You’re now in command mode, where you can type in commands to operate tmux. Enter **resize-pane -R** to resize the current pane one character to the right, or use **-L** to resize in a leftward direction. These may seem like long commands for a relatively simple operation, but note that the tmux command mode (started with the aforementioned colon) has tab completion. So you don’t have to type the whole command – just enter “**resi**” and hit Tab to complete. Also note that the **tmux** command mode also has a history, so if you want to repeat the resize operation, hit Ctrl+B followed by colon and then use the up cursor key to retrieve the command that you entered previously. + +Finally, let’s look at detaching and reattaching – the awesome feature of screen we demonstrated earlier. Inside tmux, hit Ctrl+B followed by D to detach the current tmux session from the terminal window, which leaves everything running in the background. To reattach to the session use **tmux a**. But what happens if you have multiple tmux sessions running? Use this command to list them: + + tmux ls + +This shows a number for each session; if you want to reattach to session 1, use tmux a -t 1. tmux is hugely configurable, with the ability to add custom keybindings and change colour schemes, so once you’re comfortable with the main features, delve into the manual page to learn more. + +tmux: a window manager for your shell + +![tmux](http://www.linuxvoice.com/wp-content/uploads/2015/02/tmux-large13.jpg) + +Here’s tmux with two panes open: the left has Vim editing a configuration file, while the right shows a manual page + +> ### Zsh: an alternative shell ### +> +> Choice is good, but standardisation is also important as well. So it makes sense that almost every mainstream Linux distribution uses the Bash shell by default – although there are others. Bash provides pretty much everything you need from a shell, including command history, filename completion and lots of scripting ability. It’s mature, reliable and well documented – but it’s not the only shell in town. +> +> Many advanced users swear by Zsh, the Z Shell. This is a replacement for Bash that offers almost all of the same functionality, with some extra features on top. For instance, in Zsh you can enter **ls** - and hit Tab to get quick descriptions of the various options available for **ls**. No need to open the manual page! +> +> Zsh sports other great auto-completion features: type **cd /u/lo/bi** and hit Tab, for instance, and the full path of **/usr/local/bin** will appear (providing there aren’t other paths containing **u**, **lo** and **bi**). Or try **cd** on its own followed by Tab, and you’ll see nicely coloured directory listings – much better than the plain ones used by Bash. +> +> Zsh is available in the package repositories of all major distros; install it and enter **zsh** to start it. To change your default shell from Bash to Zsh, use the **chsh** command. And for more information visit [www.zsh.org][2]. + +### The terminals of the Future ### + +You might be wondering why the application that contains your command prompt is called a terminal. Back in the early days of Unix, people tended to work on multi-user machines, with a giant mainframe computer occupying a room somewhere in a building, and people connected to it using screen and keyboard combinations at the end of some wires. These terminal machines were often called “dumb”, because they didn’t do any important processing themselves – they just displayed whatever was sent down the wire from the mainframe, and sent keyboard presses back to it. + +Today, almost all of us do the actual processing on our own machines, so our computers are not terminals in a traditional sense. This is why programs like **XTerm**, Gnome Terminal, Konsole etc. are called “terminal emulators” – they provide the same facilities as the physical terminals of yesteryear. And indeed, in many respects they haven’t moved on much. Sure, we have anti-aliased fonts now, better colours and the ability to click on URLs, but by and large they’ve been working in the same way for decades. + +Some programmers are trying to change this though. **Terminology** ([http://tinyurl.com/osopjv9][3]), from the team behind the ultra-snazzy Enlightenment window manager, aims to bring terminals into the 21st century with features such as inline media display. You can enter **ls** in a directory full of images and see thumbnails, or even play videos from directly inside your terminal. This makes the terminal work a bit more like a file manager, and means that you can quickly check the contents of media files without having to open them in a separate application. + +Then there’s Xiki ([www.xiki.org][4]), which describes itself as “the command revolution”. It’s like a cross between a traditional shell, a GUI and a wiki; you can type commands anywhere, store their output as notes for reference later, and create very powerful custom commands. It’s hard to describe it in mere words, so the authors have made a video (see the Screencasts section of the **Xiki** site) which shows how much potential it has. + +And Xiki is definitely not a flash in the pan project that will die of bitrot in a few months. The authors ran a successful Kickstarter campaign to fund its development, netting over $84,000 at the end of July. Yes, you read that correctly – $84K for a terminal emulator. It might be the most unusual crowdfunding campaign since some crazy guys decided to start their own Linux magazine… + +### Next-gen terminals ### + +Many command line and text-based programs match their GUI equivalents for feature parity, and are often much faster and more efficient to use. Our recommendations: **Irssi** (IRC client); **Mutt** (mail client); **rTorrent** (BitTorrent); **Ranger** (file manager); **htop** (process monitor). ELinks does a decent job for web browsing, given the limitations of the terminal, and it’s useful for reading text-heavy websites such as Wikipedia. + +> ### Fine-tune your colour scheme ### +> +> We’re not obsessed with eye-candy at Linux Voice, but we do recognise the importance of aesthetics when you’re staring at something for several hours every day. Many of us love to tweak our desktops and window managers to perfection, crafting pixel-perfect drop shadows and fiddling with colour schemes until we’re 100% happy. (And then fiddling some more out of habit.) +> +> But then we tend to ignore the terminal window. Well, that deserves some love too, and at [http://ciembor.github.io/4bit][5] you’ll find a highly awesome colour scheme designer that can export settings for all of the popular terminal emulators (**XTerm, Gnome Terminal, Konsole and Xfce4 Terminal are among the apps supported.**) Move the sliders until you attain colour scheme nirvana, then click on the Get Scheme button at the top-right of the page. +> +> Similarly, if you spend a lot of time in a text editor such as Vim or Emacs, it’s worth using a well-crafted palette there as well. **Solarized at** [http://ethanschoonover.com/solarized][6] is an excellent scheme that’s not just pretty, but designed for maximum usability, with plenty of research and testing behind it. + +-------------------------------------------------------------------------------- + +via: http://www.linuxvoice.com/linux-101-power-up-your-shell-8/ + +作者:[Ben Everard][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.linuxvoice.com/author/ben_everard/ +[1]:http://tinyurl.com/3gvz4ec +[2]:http://www.zsh.org/ +[3]:http://tinyurl.com/osopjv9 +[4]:http://www.xiki.org/ +[5]:http://ciembor.github.io/4bit +[6]:http://ethanschoonover.com/solarized \ No newline at end of file From 9e661a759aeb9ced869d008b7b972c3aa1f12e29 Mon Sep 17 00:00:00 2001 From: DeadFire Date: Tue, 16 Jun 2015 16:34:57 +0800 Subject: [PATCH 405/965] =?UTF-8?q?20150616-3=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20150616 XBMC--build a remote control.md | 264 ++++++++++++++++++ 1 file changed, 264 insertions(+) create mode 100644 sources/tech/20150616 XBMC--build a remote control.md diff --git a/sources/tech/20150616 XBMC--build a remote control.md b/sources/tech/20150616 XBMC--build a remote control.md new file mode 100644 index 0000000000..25de9fd06f --- /dev/null +++ b/sources/tech/20150616 XBMC--build a remote control.md @@ -0,0 +1,264 @@ +XBMC: build a remote control +================================================================================ +**Take control of your home media player with a custom remote control running on your Android phone.** + +**XBMC** is a great piece of software, and can turn almost can computer into a media centre. It can play music and videos, display pictures, and even fetch a weather forecast. To make it easy to use in a home theatre setup, you can control it via mobile phone apps that access a server running on the XBMC machine via Wi-Fi. There are loads of these available for almost all smartphone systems. + +> ### Kodi ### +> +> By the time you read this, **XBMC** may be no more. The project team have decided to rename it **Kodi** for legal reasons (and because **XBMC**, or X**-Box Media Centre**, refers to older hardware that is no longer supported). Other than the name, though, nothing has changed. Or at least nothing other than the usual raft of improvements you’d expect from a new release. This shouldn’t affect the remote software though, and it should work on both existing **XBMC** systems, and newer Kodi systems. + +We’ve recently set up an **XBMC** system for playing music, and none of the XBMC remotes we found really excel at this task, especially when the TV attached to the media centre is turned off. They were all a bit too complex, as they packed too much functionality into small screens. We wanted a system designed from the ground up to just access a music library and a radio addon, so we decided to build one ourselves. It didn’t need to be able to access the full capabilities of XBMC, because for tasks other than music, we’d simply switch back to a general-purpose XBMC remote control. Our test system was a Raspberry Pi running the RaspBMC distribution, but nothing here is specific to either the Pi or that distro, and it should work on any Linux-based XBMC system provided the appropriate packages are available. + +The first thing a remote control needs is a user interface. Many XBMC remote controls are written as standalone apps. However, this is just for our music, and we want to be accessible to guests without them having to install anything. The obvious solution is to make a web interface. XBMC does have a built-in web server, but to give us more control, we decided to use a separate web framework. There’s no problem running more than one web server on a computer at a time, but they can’t run on the same port. + +There are quite a few web frameworks available. We’ve used Bottle because it’s a simple, fast framework, and we don’t need any complex functions. Bottle is a Python module, so that’s the language in which we’ll write the server. + +You’ll probably find Bottle in your package manager. In Debian-based systems (including Raspbmc), you can grab it with: + + sudo apt-get install python-bottle + +A remote control is really just a layer that connects the user to a system. Bottle provides what we need to interact with the user, and we’ll interact with **XBMC** using its JSON API. This enables us to control the media player by sending JSON-encoded information. + +We’re going to use a simple wrapper around the XBMC JSON API called xbmcjson. It’s just enough to allow you send requests without having to worry about the actual JSON formatting or any of the banalities of communicating with a server. It’s not included in the PIP package manager, so you need to install it straight from **GitHub**: + + git clone https://github.com/jcsaaddupuy/python-xbmc.git + cd python-xbmc + sudo python setup.py install + +This is everything you need, so let’s get coding. + +#### Get started with Bottle #### + +The basic structure of our program is: + + from xbmcjson import XBMC + from bottle import route, run, template, redirect, static_file, request + import os + xbmc = XBMC(“http://192.168.0.5/jsonrpc”, “xbmc”, “xbmc”) + @route(‘/hello/’) + def index(name): + return template(‘

Hello {{name}}!

’, name=name) + run(host=”0.0.0.0”, port=8000) + +This connects to **XBMC** (though doesn’t actually use it); then Bottle starts serving up the website. In this case, it listens on host 0.0.0.0 (which is every hostname), and port 8000. It only has one site, which is /hello/XXXX where XXXX can be anything. Whatever XXXX is gets passed to index() as the parameter name. This then passes it to the template, which substitutes it into the HTML. + +You can try this out by entering the above into a file (we’ve called it remote.py), and starting it with: + + python remote.py + +You can then point your browser to localhost:8000/hello/world to see the template in action. + +@route() sets up a path in the web server, and the function index() returns the data for that path. Usually, this means returning HTML that’s generated via a template, but it doesn’t have to be (as we’ll see later). + +As we go on, we’ll add more routes to the application to make it a fully-featured XBMC remote control, but it will still be structured in the same way. + +The XBMC JSON API can be accessed by any computer on the same network as the XBMC machine. This means that you can develop it on your desktop, then deploy it to your media centre rather than fiddle round uploading every change to your home theatre PC. + +Templates – like the simple one in the previous example – are a way of combining Python and HTML to control the output. In principal, they can do quite a bit of processing, but they can get messy. We’ll use them just to format the data correctly. Before we can do that, though, we have to have some data. + +> ### Paste ### +> +> Bottle includes its own web server, which is what we’ve been using for testing the remote control. However, we found that it didn’t always perform well. When we put the remote into action, we wanted something that could deliver pages a bit quicker. Bottle can work with quite a few different web servers, and we found Paste worked quite well. In order to use this, just install it (in the package python-paste on Debian), and change the run call to: +> +> run(host=hostname, port=hostport, server=”paste”) +> +> You can see details of how to use other servers at [http://bottlepy.org/docs/dev/deployment.html][1]. + +#### Getting data from XBMC #### + +The XBMC JSON API is split up into 14 namespaces: JSONRPC, Player, Playlist, Files, AudioLibrary, VideoLibrary, Input, Application, System, Favourites, Profiles, Settings, Textures and XBMC. Each of these is available from an XBMC object in Python (apart from Favourites, in an apparent oversight). In each of these namespaces there are methods that you can use to control the application. For example, Playlist.GetItems() can be used to get the items on a particular playlist. The server returns data to us in JSON, but the xbmcjson module converts it to a Python dictionary for us. + +There are two items in XBMC that we need to use to control playback: players and playlists. Players hold a playlist and move through it item by item as each song finishes. In order to see what’s currently playing, we need to get the ID of the active player, and through that find out the ID of the current playlist. We’ve done this with the following function: + + def get_playlistid(): + player = xbmc.Player.GetActivePlayers() + if len(player[‘result’]) > 0: + playlist_data = xbmc.Player.GetProperties({“playerid”:0, “properties”:[“playlistid”]}) + if len(playlist_data[‘result’]) > 0 and “playlistid” in playlist_data[‘result’].keys(): + return playlist_data[‘result’][‘playlistid’] + return -1 + +If there isn’t a currently active player (that is, if the length of the results section in the returned data is 0), or if the current player has no playlist, this will return -1. Otherwise, it will return the numeric ID of the current playlist. + +Once we’ve got the ID of the current playlist, we can get the details of it. For our purposes, two things are important: the list of items in the playlist, and the position we are in the playlist (items aren’t removed from the playlist after they’ve been played; the current position just marches on). + + def get_playlist(): + playlistid = get_playlistid() + if playlistid >= 0: + data = xbmc.Playlist.GetItems({“playlistid”:playlistid, “properties”: [“title”, “album”, “artist”, “file”]}) + position_data = xbmc.Player.GetProperties({“playerid”:0, ‘properties’:[“position”]}) + position = int(position_data[‘result’][‘position’]) + return data[‘result’][‘items’][position:], position + return [], -1 + +This returns the current playlist starting with the item that’s currently playing (since we don’t care about stuff that’s finished), and it also includes the position as this is needed for removing items from the playlist. + +![Image](http://www.linuxvoice.com/wp-content/uploads/2015/04/xbmc2-large.jpg) + +The API is documented at [http://wiki.xbmc.org/?title=JSON-RPC_API/v6][2]. It lists all the available functions, but it a little short on details of how to use them. + +> ### JSON ### +> +> JSON stands for JavaScript Object Notation, and was originally designed as a way of serialising JavaScript Objects. It still is used for that, but it’s also a useful way of encoding all sorts of data. +> +> JSON objects always have the form: +> +> {property1:value1, property2:value2, property3:value3} +> +> For an arbitrary number of property/value pairs. To Python programmers, this all looks suspiciously similar to dictionaries, and the two are very similar. +> +> As with dictionaries, the value can itself be another JSON object, or a list, so the following is perfectly valid: +> +> {“name”:“Ben”, “jobs”:[“cook”, “bottle-washer”], “appearance”: {“height”:195, “skin”:“fair”}} +> +> JSON is often used in web services to send data back and fourth, and it’s well supported by most programming languages, so if Python’s not your thing, you should easily be able to use the same functions to control XBMC from software written in the language of your choice. + +#### Bringing them together #### + +The code to link the previous functions to a HTML page is simply: + + @route(‘/juke’) + def index(): + current_playlist, position = get_playlist() + return template(‘list’, playlist=current_playlist, offset = position) + +This only has to grab the playlist (using the function we defined above), and pass it to a template that handles the display. + +The main part of the template that handles the display of this data is: + +

Currently Playing:

+ % if playlist is not None: + % position = offset + % for song in playlist: + {{song[‘title’]}} + % if song[‘type’] == ‘unknown’: + Radio + % else: + {{song[‘artist’][0]}} + % end + % if position != offset: + remove + % else: + skip + % end +
+ % position += 1 + % end + +As you can see, templates are mostly written in HTML, but with a few extra bits to control output. Variables enclosed by double parenthesise are output in place (as we saw in the first ‘hello world’ example). You can also include Python code on lines starting with a percentage sign. Since indents aren’t used, you need a % end to close any code block (such as a loop or if statement). + +This template first checks that the playlist isn’t empty, then loops through every item on the playlist. Each item is displayed as the song title in bold, then the name of the artist, then a link to either skip it (if it’s the currently playing song), or remove it from the playlist. All songs have a type of ‘song’, so if the type is ‘unknown’, then it isn’t a song, but a radio station. + +The /remove/ and /skip/ routes are simple wrappers around XBMC controls that reload /juke after the change has taken effect: + + @route(‘/skip/’) + def index(position): + print xbmc.Player.GoTo({‘playerid’:0, ‘to’:’next’}) + redirect(“/juke”) + @route(‘/remove/’) + def index(position): + playlistid = get_playlistid() + if playlistid >= 0: + xbmc.Playlist.Remove({‘playlistid’:int(playlistid), ‘position’:int(position)}) + redirect(“/juke”) + +Of course, it’s no good being able to manage your playlist if you can’t add music to it. + +This is complicated slightly by the fact that once a playlist finishes, it disappears, so you need to create a new one. Rather confusingly, playlists are created by calling the Playlist.Clear() method. This can also be used to kill a playlist that is currently playing a radio station (where the type is unknown). The other complication is that radio streams sit in the playlist and never leave, so if there’s currently a radio station playing, we need to clear the playlist as well. + +These pages include a link to play the songs, which points to /play/. This page is handled by: + + @route(‘/play/’) + def index(id): + playlistid = get_playlistid() + playlist, not_needed= get_playlist() + if playlistid < 0 or playlist[0][‘type’] == ‘unknown’: + xbmc.Playlist.Clear({“playlistid”:0}) + xbmc.Playlist.Add({“playlistid”:0, “item”:{“songid”:int(id)}}) + xbmc.Player.open({“item”:{“playlistid”:0}}) + playlistid = 0 + else: + xbmc.Playlist.Add({“playlistid”:playlistid, “item”:{“songid”:int(id)}}) + remove_duplicates(playlistid) + redirect(“/juke”) + +The final thing here is a call to remove_duplicates. This isn’t essential – and some people may not like it – but it makes sure that no song appears in the playlist more than once. + +We also have pages that list all the artists in the collection, and list the songs and albums by particular artists. These are quite straightforward, and work in the same basic way as /juke. + +![Image](http://www.linuxvoice.com/wp-content/uploads/2015/04/xbmc1-large.jpg) + +The UI still needs a bit of attention, but it’s working. + +> ### Logging ### +> +> It’s not always clear how to do something using the XBMC JSON API, and the documentation is sometimes a little opaque. One way of finding out how to do something is seeing how other remote controls do it. If you turn on logging, you can see what API calls are being performed as you use another remote control, then incorporate these into your code. +> +> To turn on logging, hook your XBMC media centre up to a display and go to Settings > System > Debugging, and turn on Enable Debug Logging. With logging turned on, you need to access the XBMC machine (eg via SSH), then you can view the log. Its location should be displayed in the top-left corner of the XBMC display. In RaspBMC, it’s at /home/pi/.xbmc/temp/xbmc.log. You can then keep an eye on what API calls are being performed in real time using: +> +> cd /home/pi/.xbmc/temp +> tail -f xbmc.log | grep “JSON” + +#### Adding functionality #### + +The above code all works with songs in the XBMC library, but we also wanted to be able to play radio stations. Addons each have their own plugin URL that can be used to pull information out of them using the usual XBMC JSON commands. For example, to get the selected stations from the radio plugin, we use: + + @route(‘/radio/’) + def index(): + my_stations = xbmc.Files.GetDirectory({“directory”:”plugin://plugin.audio.radio_de/stations/my/”, “properties”: + [“title”,”thumbnail”,”playcount”,”artist”,”album”,”episode”,”season”,”showtitle”]}) + if ‘result’ in my_stations.keys(): + return template(‘radio’, stations=my_stations[‘result’][‘files’]) + else: + return template(‘error’, error=’radio’) + +This includes a file that can be added to a playlist just as any song can be. However, these files never finish playing, so (as we saw before) you need to recreate the playlist before adding any songs to it. + +#### Sharing songs #### + +As well as serving up templates, Bottle can serve static files. These are useful whenever you need things that don’t change based on the user input. That could be a CSS file, an image or an MP3. In our simple controller there’s not (yet) any CSS or images to make things look pretty, but we have added a way to download the songs. This lets the media centre act as a sort of NAS box for songs. If you’re transferring large amounts of data, it’s probably best to use something like Samba, but serving static files is a good way of grabbing a couple of tunes on your phone. + +The Bottle code to download a song by its ID is : + + @route(‘/download/’) + def index(id): + data = xbmc.AudioLibrary.GetSongDetails({“songid”:int(id), “properties”:[“file”]}) + full_filename = data[‘result’][‘songdetails’][‘file’] + path, filename = os.path.split(full_filename) + return static_file(filename, root=path, download=True) + +To use this, we just put a link to the appropriate ID in the /songsby/ page. + +We’ve gone through all the mechanics of the code, but there are a few more bits that just tie it all together. You can see for yourself at the GitHub page:[https://github.com/ben-ev/xbmc-remote][3]. + +> ### Setting up ### +> +> Once you’ve developed your remote control, you’ll need a way of ensuring that it starts every time you turn on your media centre. There are a few ways of doing this, but the easiest is just to add a command launching it to /etc/rc.local. We installed our file to /opt/xbmc-remote/remote.py with all the other files alongside it. We then added the following line to /etc/rc.local before the final exit 0 line. +> +> cd /opt/xbmc-remote && python remote.py & + +> ### GitHub ### +> +> This project is quite bare-bones at the moment, but – the business of running a magazine means we don’t have as much time as we’d like to program. However, we’ve set up a GitHub project where we hope to keep working on it, and if you think you’d benefit from the project as well, we’d love your input. +> +> To see what’s going on, head over to [https://github.com/ben-ev/xbmc-remote][4] and take a look at what state it’s in. You can get a copy of the latest code from that web page, or clone it from the command line. +> +> If you want to improve it, you can fork the project to develop in your own branch, and then send a pull request when your features are working. For more information on working with GitHub, head to [https://github.com/features][5]. + +-------------------------------------------------------------------------------- + +via: http://www.linuxvoice.com/xbmc-build-a-remote-control/ + +作者:[Ben Everard][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.linuxvoice.com/author/ben_everard/ +[1]:http://bottlepy.org/docs/dev/deployment.html +[2]:http://wiki.xbmc.org/?title=JSON-RPC_API/v6 +[3]:https://github.com/ben-ev/xbmc-remote +[4]:https://github.com/ben-ev/xbmc-remote +[5]:https://github.com/features \ No newline at end of file From 3ae5914617207278cc61bedf801ba4b5aede922e Mon Sep 17 00:00:00 2001 From: wwy Date: Tue, 16 Jun 2015 19:31:34 +0800 Subject: [PATCH 406/965] [Translating] 20141219 What is good audio editing software on Linux.md --- .../20141219 What is good audio editing software on Linux.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20141219 What is good audio editing software on Linux.md b/sources/tech/20141219 What is good audio editing software on Linux.md index ccc6a0883b..da015adf14 100644 --- a/sources/tech/20141219 What is good audio editing software on Linux.md +++ b/sources/tech/20141219 What is good audio editing software on Linux.md @@ -1,3 +1,5 @@ +translating by wwy-hust + What is good audio editing software on Linux ================================================================================ From f42f3c51c04c2fe38305ef233741ed05dffe9daf Mon Sep 17 00:00:00 2001 From: struggling <630441839@qq.com> Date: Tue, 16 Jun 2015 23:22:28 +0800 Subject: [PATCH 407/965] Delete 20150515 Extend Swap Space using Swap file in Linux.md --- ...end Swap Space using Swap file in Linux.md | 74 ------------------- 1 file changed, 74 deletions(-) delete mode 100644 sources/tech/20150515 Extend Swap Space using Swap file in Linux.md diff --git a/sources/tech/20150515 Extend Swap Space using Swap file in Linux.md b/sources/tech/20150515 Extend Swap Space using Swap file in Linux.md deleted file mode 100644 index 9b1cb3f8b7..0000000000 --- a/sources/tech/20150515 Extend Swap Space using Swap file in Linux.md +++ /dev/null @@ -1,74 +0,0 @@ -Translating by strugglingyouth -Extend Swap Space using Swap file in Linux -================================================================================ -There are some scenarios where our Linux box is running out of swap space so in that case we can extend the swap space using swap partition but due to unavailability of free partitions on the disk, we are unable to extend it. - -So in such cases we can extend or increase swap space using a swap file - -### Below are the Steps to extend Swap Space using Swap File in Linux ### - -Lets first check the size of existing swap space / partition using the command like ‘**free -m‘** and ‘**swapon -s**‘ - -![](http://www.linuxtechi.com/wp-content/uploads/2015/06/free-output-with-swap.jpg) -free-output-with-swap - -In my case size of swap partition is 2 GB. So we will be extending swap space by 1 GB. - -#### Step:1 Create a swap file of size 1 GB using below dd Command #### - - [root@linuxtechi ~]# dd if=/dev/zero of=/swap_file bs=1G count=1 - 1+0 records in - 1+0 records out - 1073741824 bytes (1.1 GB) copied, 414.898 s, 2.6 MB/s - [root@linuxtechi ~]# - -Replace the value of ‘**bs**‘ and ‘**count**‘ according your requirement. - -#### Step:2 Secure the swap file with permissions 644. #### - - [root@linuxtechi ~]# chmod 600 /swap_file - -#### Step:3 Enable the Swap Area on the file (swap_file) #### - -Use mkswap command to enable swap area - - [root@linuxtechi ~]# mkswap /swap_file - Setting up swapspace version 1, size = 1048572 KiB - no label, UUID=f7b3ae59-c09a-4dc2-ba4d-c02abb7db33b - [root@linuxtechi ~]# - -#### Step:4 Add the swap file entry in the fstab file #### - -Add the below entry in the fstab file so that swap file become persistent across every reboot. - - /swap_file swap swap defaults 0 0 - -![swap-file-fstab-entry](http://www.linuxtechi.com/wp-content/uploads/2015/06/swap-file-fstab-entry.jpg) - -#### Step:5 Enable the swap file using ‘mkswap on’ command. #### - - [root@linuxtechi ~]# swapon /swap_file - [root@linuxtechi ~]# - -#### Step:6 Now verify the swap space #### - -![swap-space-after-extension](http://www.linuxtechi.com/wp-content/uploads/2015/06/swap-space-after-extension.jpg) - -**Note**: To disable the swap file for any troubleshooting point of view, use swapoff command as shown below and to re-enable swap file then use swapon command as shown in step5. - - [root@linuxtechi ~]# swapoff /swap_file - [root@linuxtechi ~]# - -Please share your valuable inputs and comments of this article. - --------------------------------------------------------------------------------- - -via: http://www.linuxtechi.com/extend-swap-space-using-swap-file-in-linux/ - -作者:[Pradeep Kumar][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.linuxtechi.com/author/pradeep/ From 383804437197bac1609d63700bb392b5ddf5e52e Mon Sep 17 00:00:00 2001 From: struggling <630441839@qq.com> Date: Tue, 16 Jun 2015 23:27:22 +0800 Subject: [PATCH 408/965] Update 20150515 Extend Swap Space using Swap file in Linux.md --- .../tech/20150515 Extend Swap Space using Swap file in Linux.md | 1 + 1 file changed, 1 insertion(+) diff --git a/translated/tech/20150515 Extend Swap Space using Swap file in Linux.md b/translated/tech/20150515 Extend Swap Space using Swap file in Linux.md index 473e24ea0d..0b1a5c0597 100644 --- a/translated/tech/20150515 Extend Swap Space using Swap file in Linux.md +++ b/translated/tech/20150515 Extend Swap Space using Swap file in Linux.md @@ -1,3 +1,4 @@ +translated by strugglingyouth 在linux上使用交换文件扩展交换空间 ================================================================================ 想像一种情景,当我们的Linux系统用尽交换空间时,在这种情况下, From ed895abe7f18d024699d5f46eb8c0ef7542cc070 Mon Sep 17 00:00:00 2001 From: wxy Date: Wed, 17 Jun 2015 10:22:40 +0800 Subject: [PATCH 409/965] PUB:20150504 Useful Commands to Create Commandline Chat Server and Remove Unwanted Packages in Linux @wi-cuckoo --- ...r and Remove Unwanted Packages in Linux.md | 42 ++++++++++--------- 1 file changed, 22 insertions(+), 20 deletions(-) rename {translated/tech => published}/20150504 Useful Commands to Create Commandline Chat Server and Remove Unwanted Packages in Linux.md (80%) diff --git a/translated/tech/20150504 Useful Commands to Create Commandline Chat Server and Remove Unwanted Packages in Linux.md b/published/20150504 Useful Commands to Create Commandline Chat Server and Remove Unwanted Packages in Linux.md similarity index 80% rename from translated/tech/20150504 Useful Commands to Create Commandline Chat Server and Remove Unwanted Packages in Linux.md rename to published/20150504 Useful Commands to Create Commandline Chat Server and Remove Unwanted Packages in Linux.md index cd90e2bfb7..786e06b436 100644 --- a/translated/tech/20150504 Useful Commands to Create Commandline Chat Server and Remove Unwanted Packages in Linux.md +++ b/published/20150504 Useful Commands to Create Commandline Chat Server and Remove Unwanted Packages in Linux.md @@ -2,33 +2,35 @@ Linux中,创建聊天服务器、移除冗余软件包的实用命令 ============================================================================= 这里,我们来看Linux命令行实用技巧的下一个部分。如果你错过了Linux Tracks之前的文章,可以从这里找到。 -- [5 Linux Command Line Tracks][1] +- [5个有趣的Linux命令行技巧][1] 本篇中,我们将会介绍6个命令行小技巧,包括使用Netcat命令创建Linux命令行聊天,从某个命令的输出中对某一列做加法,移除Debian和CentOS上多余的包,从命令行中获取本地与远程的IP地址,在终端获得彩色的输出与解码各样的颜色,最后是Linux命令行里井号标签的使用。让我们来一个一个地看一下。 ![Linux Commandline Chat Server](http://www.tecmint.com/wp-content/uploads/2015/04/linux-commandline-chat-server.jpg) -6个实用的命令行技巧 + +*6个实用的命令行技巧* ### 1. 创建Linux命令行聊天服务 ### -我们大家使用聊天服务都有很长一段时间了。对于Google Chat,Hangout,Facebook Chat,Whatsapp,Hike和其他一些应用与集成的聊天服务,我们都很熟悉了。那你知道Linux的nc命令可以使你的Linux盒子变成一个聊天服务器,而仅仅只需要一行命令吗。什么是nc命令,它又是怎么工作的呢? -nc是Linux netcat命令的旧版。nc就像瑞士军刀一样,内建呢大量的功能。nc可用做调式工具,调查工具,使用TCP/UDP读写网络连接,DNS正向/反向检查。 +我们大家使用聊天服务都有很长一段时间了。对于Google Chat,Hangout,Facebook Chat,Whatsapp,Hike和其他一些应用与集成的聊天服务,我们都很熟悉了。那你知道Linux的nc命令可以使你的Linux机器变成一个聊天服务器,而仅仅只需要一行命令吗。什么是nc命令,它又是怎么工作的呢? + +nc即Linux netcat命令。nc就像瑞士军刀一样,内建了大量的功能。nc可用做调式工具,调查工具,使用TCP/UDP读写网络连接,DNS正向/反向查询等等。 nc主要用在端口扫描,文件传输,后台和端口监听。nc可以使用任何闲置的端口和任何本地网络源地址。 使用nc命令(在192.168.0.7的服务器上)创建一个命令行即时信息传输服务器。 - $ nc -l -vv 11119 + $ nc -l -vv -p 11119 对上述命令的解释。 -- -v : 表示 Verbose -- -vv : 更多的 Verbose +- -v : 显示冗余信息 +- -vv : 显示更多的冗余信息 - -p : 本地端口号 你可以用任何其他的本地端口号替换11119。 -接下来在客户端机器(IP地址:192.168.0.15),运行下面的命令初始化聊天会话(信息传输服务正在运行)。 +接下来在客户端机器(IP地址:192.168.0.15),运行下面的命令初始化聊天会话(这里需要上面提到的信息服务器正在运行)。 $ nc 192.168.0.7:11119 @@ -38,7 +40,7 @@ nc主要用在端口扫描,文件传输,后台和端口监听。nc可以使 ### 2. Linux中如何统计某一列的总值 ### -如何统计在终端里,某个命令的输出中,其中一列的数值总和, +如何在终端里统计某个命令的输出中其中一列的数值总和, ‘ls -l’命令的输出。 @@ -64,7 +66,7 @@ nc主要用在端口扫描,文件传输,后台和端口监听。nc可以使 废弃包是指那些作为其他包的依赖而被安装,但是当源包被移除之后就不再需要的包。 -假设我们安装了gtprogram,依赖是gtdependency。除非我们安装了gtdependency,否则安装不了gtprogram。 +假设我们安装了一个叫gtprogram的软件包,其依赖是gtdependency。除非我们安装了gtdependency,否则安装不了gtprogram。 当我们移除gtprogram的时候,默认并不会移除gtdependency。并且如果我们不移除gtdependency的话,它就会遗留下来成为废弃包,与其他任何包再无联系。 @@ -116,13 +118,13 @@ nc主要用在端口扫描,文件传输,后台和端口监听。nc可以使 ### 5.如何在Linux终端彩色输出 ### -你可能在终端看见过彩色的输出。同时你也可能知道在终端里允许/禁用彩色输出。如果都不知道的话,里可以参考下面的步骤。 +你可能在终端看见过彩色的输出。同时你也可能知道在终端里允许/禁用彩色输出。如果都不知道的话,你可以参考下面的步骤。 在Linux中,每个用户都有`'.bashrc'`文件,被用来管理你的终端输出。打开并且编辑该文件,用你喜欢的编辑器。注意一下,这个文件是隐藏的(文件开头为点的代表隐藏文件)。 $ vi /home/$USER/.bashrc -确保以下的行没有被注释掉。ie.,行开头没有#。 +确保以下的行没有被注释掉。即,行开头没有#。 if [ -x /usr/bin/dircolors ]; then test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dirc$ @@ -139,27 +141,27 @@ nc主要用在端口扫描,文件传输,后台和端口监听。nc可以使 完成后!保存并退出。为了让改动生效,需要注销账户后再次登录。 -现在,你会看见列出的文件和文件夹名字有着不同的颜色,根据文件类型来决定。为了解码颜色,可以运行下面的命令。 +现在,你会看见列出的文件和文件夹名字有着不同的颜色,根据文件类型来决定。要了解所用的颜色代码,可以运行下面的命令。 $ dircolors -p | less ![Linux Color Output](http://www.tecmint.com/wp-content/uploads/2015/04/Linux-Color-Output.gif) -### 6.如何用井号标记和Linux命令和脚本 ### +### 6.如何用#号标记Linux命令和脚本 ### -我们一直在Twitter,Facebook和Google Plus(可能是其他我们没有提到的地方)上使用井号标签。那些井号标签使得其他人搜索一个标签更加容易。可是很少人知道,我们可以在Linux命令行使用井号标签。 +我们一直在Twitter,Facebook和Google Plus(可能是其他我们没有提到的地方)上使用#号标签。那些#号标签使得其他人搜索一个标签更加容易。可是很少人知道,我们可以在Linux命令行使用#号标签。 我们已经知道配置文件里的`#`,在大多数的编程语言中,这个符号被用作注释行,即不被执行。 -运行一个命令,然后为这个命令创建一个井号标签,这样之后我们就可以找到它。假设我们有一个很长的脚本,就上面第四点被执行的命令。现在为它创建一个井号标签。我们知道ifconfig可以被sudo或者root执行,因此用root来执行。 +运行一个命令,然后为这个命令创建一个#号标签,这样之后我们就可以找到它。假设我们有一个很长的脚本,就上面第四点被执行的命令。现在为它创建一个#号标签。我们知道ifconfig可以被sudo或者root执行,因此用root来执行。 # ifconfig | grep "inet addr:" | awk '{print $2}' | grep -v '127.0.0.1' | cut -f2 -d: #myip -上述脚本被’mytag‘给标记了。现在在reverse-i-search(按下ctrl+r)搜索一下这个标签,在终端里,并输入’mytag‘。你可以从这里开始执行。 +上述脚本被’myip‘给标记了。现在在reverse-i-search(按下ctrl+r)搜索一下这个标签,在终端里,并输入’myip‘。你可以从这里开始执行。 ![Create Command Hash Tags](http://www.tecmint.com/wp-content/uploads/2015/04/Create-Command-Hash-Tags.gif) -你可以创建很多的井号标签,为每个命令,之后使用reverse-i-search找到它。 +你可以为每个命令创建#号标签,之后使用reverse-i-search找到它。 目前就这么多了。我们一直在辛苦的工作,创造有趣的,有知识性的内容给你。你觉得我们是如何工作的呢?欢迎咨询任何问题。你可以在下面评论。保持联络!Kudox。 @@ -169,9 +171,9 @@ via: http://www.tecmint.com/linux-commandline-chat-server-and-remove-unwanted-pa 作者:[Avishek Kumar][a] 译者:[wi-cuckoo](https://github.com/wi-cuckoo) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 [a]:http://www.tecmint.com/author/avishek/ -[1]:http://www.tecmint.com/5-linux-command-line-tricks/ +[1]:https://linux.cn/article-5485-1.html From 5fa0173972d15ace430badb5c50e3d0f93e98d33 Mon Sep 17 00:00:00 2001 From: wxy Date: Wed, 17 Jun 2015 10:24:15 +0800 Subject: [PATCH 410/965] PUB:20150410 7 Command Line Tools for Browsing Websites and Downloading Files i @fyh --- ...ng Websites and Downloading Files in Linux.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) rename {translated/tech => published}/20150410 7 Command Line Tools for Browsing Websites and Downloading Files in Linux.md (92%) diff --git a/translated/tech/20150410 7 Command Line Tools for Browsing Websites and Downloading Files in Linux.md b/published/20150410 7 Command Line Tools for Browsing Websites and Downloading Files in Linux.md similarity index 92% rename from translated/tech/20150410 7 Command Line Tools for Browsing Websites and Downloading Files in Linux.md rename to published/20150410 7 Command Line Tools for Browsing Websites and Downloading Files in Linux.md index 0d73e957de..db3aa23b6e 100644 --- a/translated/tech/20150410 7 Command Line Tools for Browsing Websites and Downloading Files in Linux.md +++ b/published/20150410 7 Command Line Tools for Browsing Websites and Downloading Files in Linux.md @@ -1,8 +1,8 @@ -Linux中7个用来浏览网页和下载文件的命令 +Linux中7个用来浏览网页和下载文件的命令 ================================================================================ 上一篇文章中,我们提到了`rTorrent`、`wget`、`cURL`、`w3m`、`Elinks`等几个有用的工具,很多人回信说还有其它几个类似的工具也值得讨论,所以就有了这篇文章。如果错过了第一部分的讨论,可以通过下面的链接来回顾。 -- [5个下载文件和浏览网页的命令行工具][1] +- [5 个基于Linux命令行的文件下载和网站浏览工具][1] 这篇文章介绍了Linux下用于浏览网页和下载文件的其它几个命令行工具。 @@ -23,7 +23,7 @@ Links是用C语言写的一个开源web浏览器,支持包括Linux、Windows ![](http://www.tecmint.com/wp-content/uploads/2015/04/links-browse-websites-terminal.gif) -如何你想安装links的图形界面版本,可能需要从[http://links.twibright.com/download/][2]下载最新的版本tarball(version 2.9)的源代码。 +如何你想安装links的图形界面版本,可能需要从[http://links.twibright.com/download/][2]下载最新的版本(version 2.9)的源代码压缩包。 同样,也可以像下面那样使用wget下载安装。 @@ -34,7 +34,7 @@ Links是用C语言写的一个开源web浏览器,支持包括Linux、Windows # make # make install -**注意**:links源代码的编译需要安装libpng, libjpeg, TIFF library, SVGAlib, XFree86, C Compiler and make这几个包。 +**注意**:links源代码的编译需要安装libpng, libjpeg, TIFF library, SVGAlib, XFree86, C Compiler 和 make这几个包。 ### 2. links2 ### @@ -49,7 +49,7 @@ Links是Twibright实验室编写的web浏览器,而Links2是基于它的一个 lynx是一个基于文本的web浏览器,使用GNU GPLv2协议发布,用ISO C编写。lynx是一个可高度配置的web浏览器,是许多系统管理员的救世主,有最悠久的web浏览器之称,并且至今仍然处在积极开发中。 -通过下面的命令安装lyns。 +通过下面的命令安装lynx。 # apt-get install lynx # yum install lynx @@ -125,7 +125,7 @@ aria2安装完成后,可以像下图那样运行这个命令下载任意文件 ![Aria2: Linux的命令行下载工具 ](http://www.tecmint.com/wp-content/uploads/2015/04/Download-Files-in-Terminal.gif) -Aria2: Linux命令行下载工具 +*Aria2: Linux命令行下载工具* 目前就这么多了。稍后咱们讨论另一个有意思的话题。请保持联系,常来Tecmint逛逛。别忘了在评论中给我们提供您的宝贵反馈,您的喜爱和分享帮助我们不断前行。 @@ -135,12 +135,12 @@ via: http://www.tecmint.com/command-line-web-browser-download-file-in-linux/ 作者:[Avishek Kumar][a] 译者:[fyh](https://github.com/fyh) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 [a]:http://www.tecmint.com/author/avishek/ -[1]:http://www.tecmint.com/linux-command-line-tools-for-downloading-files/ +[1]:https://linux.cn/article-5546-1.html [2]:http://links.twibright.com/download/ [3]:http://www.tecmint.com/command-line-web-browsers/ [4]:http://www.tecmint.com/install-youtube-dl-command-line-video-download-tool/ From ac6bd1e261c7683bd74aa979006d4f57b581ed53 Mon Sep 17 00:00:00 2001 From: ZTinoZ Date: Wed, 17 Jun 2015 10:35:36 +0800 Subject: [PATCH 411/965] Translating by ZTinoZ --- .../20150526 20 Useful Terminal Emulators for Linux.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sources/tech/20150526 20 Useful Terminal Emulators for Linux.md b/sources/tech/20150526 20 Useful Terminal Emulators for Linux.md index a15c4ad0d1..8938b6049b 100644 --- a/sources/tech/20150526 20 Useful Terminal Emulators for Linux.md +++ b/sources/tech/20150526 20 Useful Terminal Emulators for Linux.md @@ -199,11 +199,11 @@ FinalTerm Terminal ### 15. Terminology ### -Terminology is yet another new modern terminal emulator created for the Enlightenment desktop, but also can be used in different desktop environments. It has some awesome unique features, which do not have in any other terminal emulator. +Terminology是一款新的现代化终端仿真器,为Enlightenment桌面创造,但也能用于其它桌面环境。它有一些独一无二的棒极了的特性,这是其它终端仿真器所不具备的。 -Apart features, terminology offers even more things that you wouldn’t assume from a other terminal emulators, like preview thumbnails of images, videos and documents, it also allows you to see those files directly from Terminology. +抛开这些特性,terminology甚至还提供了你无法从其它仿真器看到的东西,比如图像、视频和文档的缩略图预览,它允许你从Terminology直接就能看到那些文件。 -You can watch a following demonstrations video created by the Terminology developer (the video quality isn’t clear, but still it’s enough to get the idea about Terminology). +你可以来看看Terminology的开发人员制作的小视频(视频画质不太清晰,但足以让你了解Terminology了)。 @@ -211,7 +211,7 @@ You can watch a following demonstrations video created by the Terminology develo ### 16. Xfce4 terminal ### -Xfce terminal is a lightweight modern and easy to use terminal emulator specially designed for Xfce desktop environment. The latest release of xfce terminal has some new cool features such as search dialog, tab color changer, drop-down console like Guake or Yakuake and many more. +Xfce终端是一款轻量级的现代化终端仿真器,它简单易用,为Xfce桌面环境设计。它最新的一个版本有许多新的炫酷特性比如搜索会话、标签颜色转换器、像Guake或Yakuake一样的下拉式控制台等等。 ![Xfce Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/xfce-terminal.jpg) From c95bd80913b0de6ff515da57eb8c0d4ea0d5c2c8 Mon Sep 17 00:00:00 2001 From: DeadFire Date: Wed, 17 Jun 2015 14:41:19 +0800 Subject: [PATCH 412/965] =?UTF-8?q?20150617-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tech/20150617 The Art of Command Line.md | 435 ++++++++++++++++++ 1 file changed, 435 insertions(+) create mode 100644 sources/tech/20150617 The Art of Command Line.md diff --git a/sources/tech/20150617 The Art of Command Line.md b/sources/tech/20150617 The Art of Command Line.md new file mode 100644 index 0000000000..d7fb3a5aff --- /dev/null +++ b/sources/tech/20150617 The Art of Command Line.md @@ -0,0 +1,435 @@ +The Art of Command Line +================================================================================ +- [Basics](#basics) +- [Everyday use](#everyday-use) +- [Processing files and data](#processing-files-and-data) +- [System debugging](#system-debugging) +- [One-liners](#one-liners) +- [Obscure but useful](#obscure-but-useful) +- [More resources](#more-resources) +- [Disclaimer](#disclaimer) + + +![curl -s 'https://raw.githubusercontent.com/jlevy/the-art-of-command-line/master/README.md' | egrep -o '`\w+`' | tr -d '`' | cowsay -W50](https://github.com/jlevy/the-art-of-command-line/blob/master/cowsay.png) + +Fluency on the command line is a skill often neglected or considered arcane, but it improves your flexibility and productivity as an engineer in both obvious and subtle ways. This is a selection of notes and tips on using the command-line that I've found useful when working on Linux. Some tips are elementary, and some are fairly specific, sophisticated, or obscure. This page is not long, but if you can use and recall all the items here, you know a lot. + +Much of this +[originally](http://www.quora.com/What-are-some-lesser-known-but-useful-Unix-commands) +[appeared](http://www.quora.com/What-are-the-most-useful-Swiss-army-knife-one-liners-on-Unix) +on [Quora](http://www.quora.com/What-are-some-time-saving-tips-that-every-Linux-user-should-know), +but given the interest there, it seems it's worth using Github, where people more talented than I can readily suggest improvements. If you see an error or something that could be better, please submit an issue or PR! + +Scope: + +- The goals are breadth and brevity. Every tip is essential in some situation or significantly saves time over alternatives. +- This is written for Linux. Many but not all items apply equally to MacOS (or even Cygwin). +- The focus is on interactive Bash, though many tips apply to other shells and to general Bash scripting. +- Descriptions are intentionally minimal, with the expectation you'll use `man`, `apt-get`/`yum`/`dnf` to install, and Google for more background. + + +## Basics + +- Learn basic Bash. Actually, type `man bash` and at least skim the whole thing; it's pretty easy to follow and not that long. Alternate shells can be nice, but Bash is powerful and always available (learning *only* zsh, fish, etc., while tempting on your own laptop, restricts you in many situations, such as using existing servers). + +- Learn at least one text-based editor well. Ideally Vim (`vi`), as there's really no competition for random editing in a terminal (even if you use Emacs, a big IDE, or a modern hipster editor most of the time). + +- Learn about redirection of output and input using `>` and `<` and pipes using `|`. Learn about stdout and stderr. + +- Learn about file glob expansion with `*` (and perhaps `?` and `{`...`}`) and quoting and the difference between double `"` and single `'` quotes. (See more on variable expansion below.) + +- Be familiar with Bash job management: `&`, **ctrl-z**, **ctrl-c**, `jobs`, `fg`, `bg`, `kill`, etc. + +- Know `ssh`, and the basics of passwordless authentication, via `ssh-agent`, `ssh-add`, etc. + +- Basic file management: `ls` and `ls -l` (in particular, learn what every column in `ls -l` means), `less`, `head`, `tail` and `tail -f` (or even better, `less +F`), `ln` and `ln -s` (learn the differences and advantages of hard versus soft links), `chown`, `chmod`, `du` (for a quick summary of disk usage: `du -sk *`), `df`, `mount`. + +- Basic network management: `ip` or `ifconfig`, `dig`. + +- Know regular expressions well, and the various flags to `grep`/`egrep`. The `-i`, `-o`, `-A`, and `-B` options are worth knowing. + +- Learn to use `apt-get`, `yum`, or `dnf` (depending on distro) to find and install packages. And make sure you have `pip` to install Python-based command-line tools (a few below are easiest to install via `pip`). + + +## Everyday use + +- In Bash, use **ctrl-r** to search through command history. + +- In Bash, use **ctrl-w** to delete the last word, and **ctrl-u** to delete the whole line. Use **alt-b** and **alt-f** to move by word, and **ctrl-k** to kill to the end of the line. See `man readline` for all the default keybindings in Bash. There are a lot. For example **alt-.** cycles through previous arguments, and **alt-*** expands a glob. + +- To go back to the previous working directory: `cd -` + +- If you are halfway through typing a command but change your mind, hit **alt-#** to add a `#` at the beginning and enter it as a comment (or use **ctrl-a**, **#**, **enter**). You can then return to it later via command history. + +- Use `xargs` (or `parallel`). It's very powerful. Note you can control how many items execute per line (`-L`) as well as parallelism (`-P`). If you're not sure if it'll do the right thing, use `xargs echo` first. Also, `-I{}` is handy. Examples: +```bash + find . -name '*.py' | xargs grep some_function + cat hosts | xargs -I{} ssh root@{} hostname +``` + +- `pstree -p` is a helpful display of the process tree. + +- Use `pgrep` and `pkill` to find or signal processes by name (`-f` is helpful). + +- Know the various signals you can send processes. For example, to suspend a process, use `kill -STOP [pid]`. For the full list, see `man 7 signal` + +- Use `nohup` or `disown` if you want a background process to keep running forever. + +- Check what processes are listening via `netstat -lntp`. + +- See also `lsof` for open sockets and files. + +- In Bash scripts, use `set -x` for debugging output. Use strict modes whenever possible. Use `set -e` to abort on errors. Use `set -o pipefail` as well, to be strict about errors (though this topic is a bit subtle). For more involved scripts, also use `trap`. + +- In Bash scripts, subshells (written with parentheses) are convenient ways to group commands. A common example is to temporarily move to a different working directory, e.g. +```bash + # do something in current dir + (cd /some/other/dir; other-command) + # continue in original dir +``` + +- In Bash, note there are lots of kinds of variable expansion. Checking a variable exists: `${name:?error message}`. For example, if a Bash script requires a single argument, just write `input_file=${1:?usage: $0 input_file}`. Arithmetic expansion: `i=$(( (i + 1) % 5 ))`. Sequences: `{1..10}`. Trimming of strings: `${var%suffix}` and `${var#prefix}`. For example if `var=foo.pdf`, then `echo ${var%.pdf}.txt` prints `foo.txt`. + +- The output of a command can be treated like a file via `<(some command)`. For example, compare local `/etc/hosts` with a remote one: +```sh + diff /etc/hosts <(ssh somehost cat /etc/hosts) +``` + +- Know about "here documents" in Bash, as in `cat <logfile 2>&1`. Often, to ensure a command does not leave an open file handle to standard input, tying it to the terminal you are in, it is also good practice to add ` foo: + rename 's/\.bak$//' *.bak + # Full rename of filenames, directories, and contents foo -> bar: + repren --full --preserve-case --from foo --to bar . +``` + +- Use `shuf` to shuffle or select random lines from a file. + +- Know `sort`'s options. Know how keys work (`-t` and `-k`). In particular, watch out that you need to write `-k1,1` to sort by only the first field; `-k1` means sort according to the whole line. + +- Stable sort (`sort -s`) can be useful. For example, to sort first by field 2, then secondarily by field 1, you can use `sort -k1,1 | sort -s -k2,2` + +- If you ever need to write a tab literal in a command line in Bash (e.g. for the -t argument to sort), press **ctrl-v** **[Tab]** or write `$'\t'` (the latter is better as you can copy/paste it). + +- For binary files, use `hd` for simple hex dumps and `bvi` for binary editing. + +- Also for binary files, `strings` (plus `grep`, etc.) lets you find bits of text. + +- To convert text encodings, try `iconv`. Or `uconv` for more advanced use; it supports some advanced Unicode things. For example, this command lowercases and removes all accents (by expanding and dropping them): +```sh + uconv -f utf-8 -t utf-8 -x '::Any-Lower; ::Any-NFD; [:Nonspacing Mark:] >; ::Any-NFC; ' < input.txt > output.txt +``` + +- To split files into pieces, see `split` (to split by size) and `csplit` (to split by a pattern). + +- Use `zless`, `zmore`, `zcat`, and `zgrep` to operate on compressed files. + + +## System debugging + +- For web debugging, `curl` and `curl -I` are handy, or their `wget` equivalents, or the more modern [`httpie`](https://github.com/jakubroztocil/httpie). + +- To know disk/cpu/network status, use `iostat`, `netstat`, `top` (or the better `htop`), and (especially) `dstat`. Good for getting a quick idea of what's happening on a system. + +- For a more in-depth system overview, use [`glances`](https://github.com/nicolargo/glances). It presents you with several system level statistics in one terminal window. Very helpful for quickly checking on various subsystems. + +- To know memory status, run and understand the output of `free` and `vmstat`. In particular, be aware the "cached" value is memory held by the Linux kernel as file cache, so effectively counts toward the "free" value. + +- Java system debugging is a different kettle of fish, but a simple trick on Oracle's and some other JVMs is that you can run `kill -3 ` and a full stack trace and heap summary (including generational garbage collection details, which can be highly informative) will be dumped to stderr/logs. + +- Use `mtr` as a better traceroute, to identify network issues. + +- For looking at why a disk is full, `ncdu` saves time over the usual commands like `du -sh *`. + +- To find which socket or process is using bandwidth, try `iftop` or `nethogs`. + +- The `ab` tool (comes with Apache) is helpful for quick-and-dirty checking of web server performance. For more complex load testing, try `siege`. + +- For more serious network debugging, `wireshark`, `tshark`, or `ngrep`. + +- Know about `strace` and `ltrace`. These can be helpful if a program is failing, hanging, or crashing, and you don't know why, or if you want to get a general idea of performance. Note the profiling option (`-c`), and the ability to attach to a running process (`-p`). + +- Know about `ldd` to check shared libraries etc. + +- Know how to connect to a running process with `gdb` and get its stack traces. + +- Use `/proc`. It's amazingly helpful sometimes when debugging live problems. Examples: `/proc/cpuinfo`, `/proc/xxx/cwd`, `/proc/xxx/exe`, `/proc/xxx/fd/`, `/proc/xxx/smaps`. + +- When debugging why something went wrong in the past, `sar` can be very helpful. It shows historic statistics on CPU, memory, network, etc. + +- For deeper systems and performance analyses, look at `stap` ([SystemTap](https://sourceware.org/systemtap/wiki)), [`perf`](http://en.wikipedia.org/wiki/Perf_(Linux)), and [`sysdig`](https://github.com/draios/sysdig). + +- Confirm what Linux distribution you're using (works on most distros): `lsb_release -a` + +- Use `dmesg` whenever something's acting really funny (it could be hardware or driver issues). + + +## One-liners + +A few examples of piecing together commands: + +- It is remarkably helpful sometimes that you can do set intersection, union, and difference of text files via `sort`/`uniq`. Suppose `a` and `b` are text files that are already uniqued. This is fast, and works on files of arbitrary size, up to many gigabytes. (Sort is not limited by memory, though you may need to use the `-T` option if `/tmp` is on a small root partition.) See also the note about `LC_ALL` above. +```sh + cat a b | sort | uniq > c # c is a union b + cat a b | sort | uniq -d > c # c is a intersect b + cat a b b | sort | uniq -u > c # c is set difference a - b +``` + +- Summing all numbers in the third column of a text file (this is probably 3X faster and 3X less code than equivalent Python): +```sh + awk '{ x += $3 } END { print x }' myfile +``` + +- If want to see sizes/dates on a tree of files, this is like a recursive `ls -l` but is easier to read than `ls -lR`: +```sh + find . -type f -ls +``` + +- Use `xargs` or `parallel` whenever you can. Note you can control how many items execute per line (`-L`) as well as parallelism (`-P`). If you're not sure if it'll do the right thing, use xargs echo first. Also, `-I{}` is handy. Examples: +```sh + find . -name '*.py' | xargs grep some_function + cat hosts | xargs -I{} ssh root@{} hostname +``` + +- Say you have a text file, like a web server log, and a certain value that appears on some lines, such as an `acct_id` parameter that is present in the URL. If you want a tally of how many requests for each `acct_id`: +```sh + cat access.log | egrep -o 'acct_id=[0-9]+' | cut -d= -f2 | sort | uniq -c | sort -rn +``` + +- Run this function to get a random tip from this document (parses Markdown and extracts an item): +```sh + function taocl() { + curl -s https://raw.githubusercontent.com/jlevy/the-art-of-command-line/master/README.md | + pandoc -f markdown -t html | + xmlstarlet fo --html --dropdtd | + xmlstarlet sel -t -v "(html/body/ul/li[count(p)>0])[$RANDOM mod last()+1]" | + xmlstarlet unesc | fmt -80 + } +``` + + +## Obscure but useful + +- `expr`: perform arithmetic or boolean operations or evaluate regular expressions + +- `m4`: simple macro processor + +- `screen`: powerful terminal multiplexing and session persistence + +- `yes`: print a string a lot + +- `cal`: nice calendar + +- `env`: run a command (useful in scripts) + +- `look`: find English words (or lines in a file) beginning with a string + +- `cut `and `paste` and `join`: data manipulation + +- `fmt`: format text paragraphs + +- `pr`: format text into pages/columns + +- `fold`: wrap lines of text + +- `column`: format text into columns or tables + +- `expand` and `unexpand`: convert between tabs and spaces + +- `nl`: add line numbers + +- `seq`: print numbers + +- `bc`: calculator + +- `factor`: factor integers + +- `gpg`: encrypt and sign files + +- `toe`: table of terminfo entries + +- `nc`: network debugging and data transfer + +- `ngrep`: grep for the network layer + +- `dd`: moving data between files or devices + +- `file`: identify type of a file + +- `stat`: file info + +- `tac`: print files in reverse + +- `shuf`: random selection of lines from a file + +- `comm`: compare sorted files line by line + +- `hd` and `bvi`: dump or edit binary files + +- `strings`: extract text from binary files + +- `tr`: character translation or manipulation + +- `iconv `or uconv: conversion for text encodings + +- `split `and `csplit`: splitting files + +- `7z`: high-ratio file compression + +- `ldd`: dynamic library info + +- `nm`: symbols from object files + +- `ab`: benchmarking web servers + +- `strace`: system call debugging + +- `mtr`: better traceroute for network debugging + +- `cssh`: visual concurrent shell + +- `wireshark` and `tshark`: packet capture and network debugging + +- `host` and `dig`: DNS lookups + +- `lsof`: process file descriptor and socket info + +- `dstat`: useful system stats + +- [`glances`](https://github.com/nicolargo/glances): high level, multi-subsystem overview + +- `iostat`: CPU and disk usage stats + +- `htop`: improved version of top + +- `last`: login history + +- `w`: who's logged on + +- `id`: user/group identity info + +- `sar`: historic system stats + +- `iftop` or `nethogs`: network utilization by socket or process + +- `ss`: socket statistics + +- `dmesg`: boot and system error messages + +- `hdparm`: SATA/ATA disk manipulation/performance + +- `lsb_release`: Linux distribution info + +- `lshw`: hardware information + +- `fortune`, `ddate`, and `sl`: um, well, it depends on whether you consider steam locomotives and Zippy quotations "useful" + + +## More resources + +- [awesome-shell](https://github.com/alebcay/awesome-shell): A curated list of shell tools and resources. +- [Strict mode](http://redsymbol.net/articles/unofficial-bash-strict-mode/) for writing better shell scripts. + + +## Disclaimer + +With the exception of very small tasks, code is written so others can read it. With power comes responsibility. The fact you *can* do something in Bash doesn't necessarily mean you should! ;) + +-------------------------------------------------------------------------------- + +via: https://github.com/jlevy/the-art-of-command-line + +作者:[jlevy][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://github.com/jlevy +[1]: +[2]: +[3]: +[4]: +[5]: +[6]: +[7]: +[8]: +[9]: +[10]: +[11]: +[12]: +[13]: +[14]: +[15]: +[16]: +[17]: +[18]: +[19]: +[20]: \ No newline at end of file From 46c69fc92dde46a82975a504280b0da0cad0758c Mon Sep 17 00:00:00 2001 From: DeadFire Date: Wed, 17 Jun 2015 16:31:54 +0800 Subject: [PATCH 413/965] =?UTF-8?q?20150617-2=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ser for Anonymous Web Browsing in Linux.md | 206 ++++++++++++++++++ 1 file changed, 206 insertions(+) create mode 100644 sources/tech/20150617 Tor Browser--An Ultimate Web Browser for Anonymous Web Browsing in Linux.md diff --git a/sources/tech/20150617 Tor Browser--An Ultimate Web Browser for Anonymous Web Browsing in Linux.md b/sources/tech/20150617 Tor Browser--An Ultimate Web Browser for Anonymous Web Browsing in Linux.md new file mode 100644 index 0000000000..92fe36dae2 --- /dev/null +++ b/sources/tech/20150617 Tor Browser--An Ultimate Web Browser for Anonymous Web Browsing in Linux.md @@ -0,0 +1,206 @@ +Tor Browser: An Ultimate Web Browser for Anonymous Web Browsing in Linux +================================================================================ +Most of us give a considerable time of ours to Internet. The primary Application we require to perform our internet activity is a browser, a web browser to be more perfect. Over Internet most of our’s activity is logged to Server/Client machine which includes IP address, Geographical Location, search/activity trends and a whole lots of Information which can potentially be very harmful, if used intentionally the other way. + +![Install Tor Browser in Linux](http://www.tecmint.com/wp-content/uploads/2014/04/Install-tor-browser-in-linux.jpg) + +Tor Browser: Anonymous Browsing + +Moreover the National Security Agency (NSA) aka International Spying Agency keeps tracks of ours digital footprints. Not to mention a restricted proxy server which again can be used as data ripping server is not the answer. And most of the corporates and companies wont allow you to access a proxy server. + +So, what we need here is an application, preferably small in size and let it be standalone, portable and which servers the purpose. Here comes an application – the Tor Browser, which has all the above discussed features and even beyond that. + +In this article we will be discussing Tor browser, its features, its usages and Area of Application, Installation and other important aspects of The Tor Browser Application. + +#### What is Tor Browser? #### + +Tor is a Freely distributed Application Software, released under BSD style Licensing which allows to surf Internet anonymously, through its safe and reliable onion like structure. Tor previously was called as ‘The Onion Router‘ because of its structure and functioning mechanism. This Application is written in C programming Language. + +#### Features of Tor Browser #### + +- Cross Platform Availability. i.e., this application is available for Linux, Windows as well as Mac. +- Complex Data encryption before it it sent over Internet. +- Automatic data decryption at client side. +- It is a combination of Firefox Browser + Tor Project. +- Provides anonymity to servers and websites. +- Makes it possible to visit locked websites. +- Performs task without revealing IP of Source. +- Capable of routing data to/from hidden services and application behind firewall. +- Portable – Run a preconfigured web browser directly from the USB storage Device. No need to install it locally. +- Available for architectures x86 and x86_64. +- Easy to set FTP with Tor using configuration as “socks4a” proxy on “localhost” port “9050” +- Tor is capable of handling thousands of relay and millions of users. + +#### How Tor Browser Works? #### + +Tor works on the concept of Onion routing. Onion routing resemble to onion in structure. In onion routing the layers are nested one over the other similar to the layers of onion. This nested layer is responsible for encrypting data several times and sends it through virtual circuits. On the client side each layer decrypt the data before passing it to the next level. The last layer decrypts the innermost layer of encrypted data before passing the original data to the destination. + +In this process of decryption all the layers function so intelligently that there is no need to reveal IP and Geographical location of User thus limiting any chance of anybody watching your internet connection or the sites you are visiting. + +All these working seems a bit complex, but the end user execution and working of Tor browser is nothing to worry about. In-fact Tor browser resembles any other browser (Especially Mozilla Firefox) in functioning. + +### Installation of Tor Browser in Linux ### + +As discussed above, Tor browser is available for Linux, Windows and Mac. The user need to download the latest version (i.e. Tor Browser 4.0.4) application from the link below as per their system and architecture. + +- [https://www.torproject.org/download/download-easy.html.en][1] + +After downloading the Tor browser, we need to install it. But the good thing with ‘Tor’ is that we don’t need to install it. It can run directly from a Pen Drive and the browser can be preconfigured. That means plug and Run Feature in perfect sense of Portability. + +After downloading the Tar-ball (*.tar.xz) we need to Extract it. + +**On 32-Bit System** + + $ wget https://www.torproject.org/dist/torbrowser/4.0.4/tor-browser-linux32-4.0.4_en-US.tar.xz + $ tar xpvf tor-browser-linux32-4.0.4_en-US.tar.xz + +**On 64-Bit System** + + $ wget https://www.torproject.org/dist/torbrowser/4.0.4/tor-browser-linux64-4.0.4_en-US.tar.xz + $ tar -xpvf tor-browser-linux64-4.0.4_en-US.tar.xz + +**Note** : In the above command we used ‘$‘ which means that the package is extracted as user and not root. It is strictly suggested to extract and run tor browser not as root. + +After successful extraction, we can move the extracted browser to anywhere/USB Mass Storage device. And run the application from the extracted folder and run ‘start-tor-browser’ strictly not as root. + + $ cd tor-browser_en-US + $ ./start-tor-browser + +![Starting Tor Browser](http://www.tecmint.com/wp-content/uploads/2014/04/Starting-Tor-Network.jpg) + +Starting Tor Browser + +**1. Trying to connect to the Tor Network. Click “Connect” and Tor will do rest of the settings for you.** + +![Connecting to Tor Network](http://www.tecmint.com/wp-content/uploads/2014/04/Tor-Network-Settings.jpg) + +Connecting to Tor Network + +**2. The welcome Window/Tab.** + +![Tor Welcome Screen](http://www.tecmint.com/wp-content/uploads/2014/04/Tor-Welcome-Screen.png) + +Tor Welcome Screen + +**3. Tor Browser Running a Video from Youtube.** + +![Watching Video on Youtube](http://www.tecmint.com/wp-content/uploads/2014/04/Watching-Video-on-Youtube.jpg) + +Watching Video on Youtube + +**4. Opening a banking site for online Purchasing/Transaction.** + +![Browsing a Banking Site](http://www.tecmint.com/wp-content/uploads/2014/04/Browsing-Site.jpg) + +Browsing a Banking Site + +**5. The browser showing my current proxy IP. Note that the text that reads “Proxy Server detected”.** + +![Checking IP Address](http://www.tecmint.com/wp-content/uploads/2014/04/Checking-IP-Address.jpg) + +Checking IP Address + +**Note**: That you need to point to the Tor startup script using text session, everytime you want to run Tor. Moreover a terminal will be busy all the time till you are running tor. How to overcome this and create a desktop/dock-bar Icon? + +6. We need to create `tor.desktop` file inside the directory where extracted files resides. + +$ touch tor.desktop + +Now edit the file using your favourite editor with the text below. Save and exit. I used nano. + + $ nano tor.desktop + +---------- + + #!/usr/bin/env xdg-open + [Desktop Entry] + Encoding=UTF-8 + Name=Tor + Comment=Anonymous Browse + Type=Application + Terminal=false + Exec=/home/avi/Downloads/tor-browser_en-US/start-tor-browser + Icon=/home/avi/Downloads/tor-browser_en-US/Browser/browser/icons/mozicon128.png + StartupNotify=true + Categories=Network;WebBrowser; + +**Note**: Make sure to replace the path with the location of your tor browser in the above. + +**7. Once done! Double click the file `tor.desktop` to fire Tor browser. You may need to trust it for the first time.** + +![Tor Application Launcher](http://www.tecmint.com/wp-content/uploads/2014/04/Tor-Application-Launcher.jpg) + +Tor Application Launcher + +**8. Once you trust you might note that the icon of `tor.desktop` changed.** + +![Tor icon Changed](http://www.tecmint.com/wp-content/uploads/2014/04/Tor-icon-changed.jpg) + +Tor icon Changed + +9. You may drag and drop the `tor.desktop` icon to create shortcut on Desktop and Dock Bar. + +![Add Tor Shortcut on Desktop](http://www.tecmint.com/wp-content/uploads/2014/04/Add-Tor-Shortcut-on-Desktop.jpg) + +Add Tor Shortcut on Desktop + +**10. About Tor Browser.** + +![About Tor Browser](http://www.tecmint.com/wp-content/uploads/2014/04/About-Tor-Browser.jpg) + +About Tor Browser + +**Note**: If you are using older version of Tor, you may update it from the above window. + +#### Usability/Area of Application #### + +- Anonymous communication over web. +- Surf to Blocked web Pages. +- Link other Application Viz (FTP) to this secure Internet Browsing Application. + +#### Controversies of Tor-browser #### + +- No security at the boundary of Tor Application i.e., Data Entry and Exit Points. +- A study in 2011 reveals that a specific way of attacking Tor will reveal IP address of BitTorrent Users. +- Some protocols shows the tendency of leaking IP address, revealed in a study. +- Earlier version of Tor bundled with older versions of Firefox browser were found to be JavaScript Attack Vulnerable. +- Tor Browser Seems to Work slow. + +#### Real world Implementation of Tor-browser #### + +- Vuze BitTorrent Client +- Anonymous Os +- Os’es from Scratch +- whonix, etc. + +#### Future of Tor Browser #### + +Tor browser is promising. Perhaps the first application of its kind is implemented very brilliantly. Tor browser must invest for Support, Scalability and research for securing the data from latest attacks. This application is need of the future. + +#### Download Free eBook #### + +Unofficial Guide to Tor Private Browsing + +[![](http://img.tradepub.com/free/w_make129/images/w_make129c4.gif)][2] + +### Conclusion ### + +Tor bowser is a must tool in the present time where the organization you are working for don’t allow you to access certain websites or if you don’t want others to look into your private business or you don’t want to provide your digital footprints to NSA. + +**Note**: Tor Browser don’t provide any safety from Viruses, Trojans or other threats of this kind. Moreover by writing an article of this we never mean to indulge into illegal activity by hiding our identity over Internet. This Post is totally for educational Purpose and for any illegal use of it neither the author of the post nor Tecmint will be responsible. It is the sole responsibility of user. + +Tor-browser is a wonderful application and you must give it a try. That’s all for now. I’ll be here again with another interesting article you people will love to read. Till then stay tuned and connected to Tecmint. Don’t forget to provide us with your value-able feedback in our comment section below. + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/tor-browser-for-anonymous-web-browsing/ + +作者:[Avishek Kumar][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/avishek/ +[1]:https://www.torproject.org/download/download-easy.html.en +[2]:http://tecmint.tradepub.com/free/w_make129/prgm.cgi \ No newline at end of file From c627fb4eb5fc9b793424107ba00548081d2c9dca Mon Sep 17 00:00:00 2001 From: ZTinoZ Date: Wed, 17 Jun 2015 16:39:11 +0800 Subject: [PATCH 414/965] Translating by ZTinoZ --- sources/tech/20150526 20 Useful Terminal Emulators for Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20150526 20 Useful Terminal Emulators for Linux.md b/sources/tech/20150526 20 Useful Terminal Emulators for Linux.md index 8938b6049b..9b6db95726 100644 --- a/sources/tech/20150526 20 Useful Terminal Emulators for Linux.md +++ b/sources/tech/20150526 20 Useful Terminal Emulators for Linux.md @@ -221,7 +221,7 @@ Xfce Terminal ### 17. xterm ### -The xterm application is a standard terminal emulator for the X Window System. It maintain DEC VT102 and Tektronix 4014 compatible terminals for applications that can’t use the window system directly. +xterm应用程序是一款标准的在X Window系统上的终端仿真器。It maintain DEC VT102 and Tektronix 4014 compatible terminals for applications that can’t use the window system directly. ![xterm Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/xterm.jpg) From d1f9adf935781a9aabb16e7c4b6f8cdc94ac3de1 Mon Sep 17 00:00:00 2001 From: sevenot Date: Thu, 18 Jun 2015 00:38:22 +0800 Subject: [PATCH 415/965] sevenot translated --- ... The top 10 rookie open source projects.md | 154 ------------------ ... The top 10 rookie open source projects.md | 153 +++++++++++++++++ 2 files changed, 153 insertions(+), 154 deletions(-) delete mode 100644 sources/talk/20150128 The top 10 rookie open source projects.md create mode 100644 translated/talk/20150128 The top 10 rookie open source projects.md diff --git a/sources/talk/20150128 The top 10 rookie open source projects.md b/sources/talk/20150128 The top 10 rookie open source projects.md deleted file mode 100644 index 7dccf38141..0000000000 --- a/sources/talk/20150128 The top 10 rookie open source projects.md +++ /dev/null @@ -1,154 +0,0 @@ -sevenot translating -The top 10 rookie open source projects -================================================================================ -Black Duck presents its Open Source Rookies of the Year -- the 10 most exciting, active new projects germinated by the global open source community - -![](http://images.techhive.com/images/article/2015/01/open_source_rookies_01-100564902-orig.jpeg) - -### Open Source Rookies of the Year ### - -Each year sees the start of thousands of new open source projects. Only a handful gets real traction. Some projects gain momentum by building on existing, well-known technologies; others truly break new ground. Many projects are created to solve a simple development problem, while others begin with loftier intentions shared by like-minded developers around the world. - -Since 2009, the open source software logistics company Black Duck has identified the [Open Source Rookies of the Year][1], based on activity tracked by its [Open Hub][2] (formerly Ohloh) site. This year, we're delighted to present 10 winners and two honorable mentions for 2015, selected from thousands of open source projects. Using a weighted scoring system, points were awarded based on project activity, the pace of commits, and several other factors. - -Open source has become the industry's engine of innovation. This year, for example, growth in projects related to Docker containerization trumped every other rookie area -- and not coincidentally reflected the most exciting area of enterprise technology overall. At the very least, the projects described here provide a window on what the global open source developer community is thinking, which is fast becoming a good indicator of where we're headed. - -### 2015 Open Source Rookie of the Year: DebOps ### - -![](http://images.techhive.com/images/article/2015/01/open_source_rookies_02-100564903-orig.jpeg) - -[DebOps][3] is a collection of [Ansible][4] playbooks and roles, scalable from one container to an entire data center. Founder Maciej Delmanowski open-sourced DebOps to ensure his work outlived his current work environment and could grow in strength and depth from outside contributors. - -DebOps began at a small university in Poland that ran its own data center, where everything was configured by hand. Crashes sometimes led to days of downtime -- and Delmanowski realized that a configuration management system was needed. Starting with a Debian base, DebOps is a group of Ansible playbooks that configure an entire data infrastructure. The project has been implemented in many different working environments, and the founders plan to continue supporting and improving it as time goes on. - -### 2015 Open Source Rookie of the Year: Code Combat ### - -![](http://images.techhive.com/images/article/2015/01/open_source_rookies_03-100564904-gallery.idge.jpg) - -The traditional pen-and-paper way of learning falls short for technical subjects. Games, however, are all about engagement -- which is why the founders of [CodeCombat][5] went about creating a multiplayer programming game to teach people how to code. - -At its inception, CodeCombat was an idea for a startup, but the founders decided to create an open source project instead. The idea blossomed within the community, and the project gained contributors at a steady rate. A mere two months after its launch, the game was accepted into Google’s Summer of Code. The game reaches a broad audience and is available in 45 languages. CodeCombat hopes to become the standard for people who want to learn to code and have fun at the same time. - -### 2015 Open Source Rookie of the Year: Storj ### - -![](http://images.techhive.com/images/article/2015/01/open_source_rookies_04-100564905-gallery.idge.jpg) - -[Storj][6] is a peer-to-peer cloud storage network that implements end-to-end encryption, enabling users to transfer and share data without reliance on a third party. Based on bitcoin blockchain technology and peer-to-peer protocols, Storj provides secure, private, and encrypted cloud storage. - -Opponents of cloud-based data storage worry about cost efficiencies and vulnerability to attack. Intended to address both concerns, Storj is a private cloud storage marketplace where space is purchased and traded via Storjcoin X (SJCX). Files uploaded to Storj are shredded, encrypted, and stored across the community. File owners are the sole individuals who possess keys to the encrypted information. - -The proof of concept for this decentralized cloud storage marketplace was first presented at the Texas Bitcoin Conference Hackathon in 2014. After winning first place in the hackathon, the project founders and leaders used open forums, Reddit, bitcoin forums, and social media to grow an active community, now an essential part of the Storj decision-making process. - -### 2015 Open Source Rookie of the Year: Neovim ### - -![](http://images.techhive.com/images/article/2015/01/open_source_rookies_05-100564906-orig.jpg) - -Since its inception in 1991, Vim has been a beloved text editor adopted by millions of software developers. [Neovim][6] is the next generation. - -The software development ecosystem has experienced exponential growth and innovation over the past 23 years. Neovim founder Thiago de Arruda knew that Vim was lacking in modern-day features and development speed. Although determined to preserve the signature features of Vim, the community behind Neovim seeks to improve and evolve the technology of its favorite text editor. Crowdfunding initially enabled de Arruda to focus six uninterrupted months on launching this endeavor. He credits the Neovim community for supporting the project and for inspiring him to continue contributing. - -### 2015 Open Source Rookie of the Year: CockroachDB ### - -![](http://images.techhive.com/images/article/2015/01/open_source_rookies_06-100564907-orig.jpg) - -Former Googlers are bringing a big-company data solution to open source in the form of [CockroachDB][8], a scalable, geo-replicated, transactional data store. - -To maintain the terabytes of data transacted over its global online properties, Google developed Spanner. This powerful tool provides Google with scalability, survivability, and transactionality -- qualities that the team behind CockroachDB is serving up to the open source community. Like an actual cockroach, CockroachDB can survive without its head, tolerating the failure of any node. This open source project has a devoted community of experienced contributors, actively cultivated by the founders via social media, GitHub, networking, conferences, and meet-ups. - -### 2015 Open Source Rookie of the Year: Kubernetes ### - -![](http://images.techhive.com/images/article/2015/01/open_source_rookies_07-100564908-orig.jpg) - -In introducing containerized software development to the open source community, [Docker][9] has become the backbone of a strong, innovative set of tools and technologies. [Kubernetes][10], which Google introduced last June, is an open source container management tool used to accelerate development and simplify operations. - -Google has been using containers for years in its internal operations. At the summer 2014 DockerCon, the Internet giant open-sourced Kubernetes, which was developed to meet the needs of the exponentially growing Docker ecosystem. Through collaborations with other organizations and projects, such as Red Hat and CoreOS, Kubernetes project managers have grown their project to be the No. 1 downloaded tool on the Docker Hub. The Kubernetes team hopes to expand the project and grow the community, so software developers can spend less time managing infrastructure and more time building the apps they want. - -### 2015 Open Source Rookie of the Year: Open Bazaar ### - -![](http://images.techhive.com/images/article/2015/01/open_source_rookies_08-100564909-orig.jpg) - -[OpenBazaar][11] is a decentralized marketplace for trading with anyone using bitcoin. The proof of concept for OpenBazaar was born at a hackathon, where its founders combined BitTorent, bitcoin, and traditional financial server methodologies to create a censorship-resistant trading platform. The OpenBazaar team sought new members, and before long they were able to expand the OpenBazaar community immensely. The table stakes of OpenBazaar -- transparency and a common goal to revolutionize trade and commerce -- are helping founders and contributors work toward a real-world, uncontrolled, and decentralized marketplace. - -### 2015 Open Source Rookie of the Year: IPFS ### - -![](http://images.techhive.com/images/article/2015/01/open_source_rookies_09-100564910-orig.jpg) - -[IPFS (InterPlanetary File System)][12] is a global, versioned, peer-to-peer file system.It synthesizes many of the ideas behind Git, BitTorrent, and HTTP to bring a new data and data structure transport protocol to the open Web. - -Open source is known for developing simple solutions to complex problems that result in many innovations, but these powerful projects represent only one slice of the open source community. IFPS belong to a more radical group whose proof of concept seems daring, outrageous, and even unattainable -- in this case, a peer-to-peer distributed file system that seeks to connect all computing devices. This possible HTTP replacement maintains a community through multiple mediums, including the Git community and an IRC channel that has more than 100 current contributors. This “crazy” idea will be available for alpha testing in 2015. - -### 2015 Open Source Rookie of the Year: cAdvisor ### - -![](http://images.techhive.com/images/article/2015/01/open_source_rookies_10-100564911-orig.jpg) - -[cAdvisor (Container Advisor)][13] is a daemon that collects, aggregates, processes, and exports information about running containers, providing container users with an understanding of resource usage and performance characteristics. For each container, cAdvisor keeps resource isolation parameters, historical resource usage, histograms of complete historical resource usage, and network statistics. This data is exported by container and across machines. - -cAdvisor can run on most Linux distros and supports many container types, including Docker. It has become the de facto monitoring agent for containers, has been integrated into many systems, and is one of the most downloaded images on the Docker Hub. The team hopes to grow cAdvisor to understand application performance more deeply and to integrate this information into clusterwide systems. - -### 2015 Open Source Rookie of the Year: Terraform ### - -![](http://images.techhive.com/images/article/2015/01/open_source_rookies_11-100564912-orig.jpg) - -[Terraform][14] provides a common configuration to launch infrastructure, from physical and virtual servers to email and DNS providers. The idea is to encompass everything from custom in-house solutions to services offered by public cloud platforms. Once launched, Terraform enables ops to change infrastructure safely and efficiently as the configuration evolves. - -Working at a devops company, Terraform.io's founders identified a pain point in codifying the knowledge required to build a complete data center, from plugged-in servers to a fully networked and functional data center. Infrastructure is described using a high-level configuration syntax, which allows a blueprint of your data center to be versioned and treated as you would any other code. Sponsorship from the well-respected open source company HashiCorp helped launch the project. - -### Honorable mention: Docker Fig ### - -![](http://images.techhive.com/images/article/2015/01/open_source_rookies_12-100564913-orig.jpg) - -[Fig][15] provides fast, isolated development environments using [Docker][16]. It moves the configuration required to orchestrate Docker into a simple fig.yml file. It handles all the work of building and running containers and forwarding their ports, as well as sharing volumes and linking them. - -Orchard formed Fig last year to create a new system of tools to make Docker work. It was developed as a way of setting up development environments with Docker, enabling users to define the exact environment for their apps, while also running databases and caches inside Docker. Fig solved a major pain point for developers. Docker fully supports this open source project and [recently purchased Orchard][17] to expand the reach of Fig. - -### Honorable mention: Drone ### - -![](http://images.techhive.com/images/article/2015/01/open_source_rookies_13-100564916-orig.jpg) - -[Drone][18] is a Continuous Integration platform built on Docker and [written in Go][19]. The Drone project grew out of frustration with existing available technologies and processes for setting up development environments. - -Drone provides a simple approach to automated testing and continuous delivery: Simply pick a Docker image tailored to your needs, connect GitHub, and commit. Drone uses Docker containers to provision isolated testing environments, giving every project complete control over its stack without the burden of traditional server administration. The community behind Drone is 100 contributors strong and hopes to bring this project to the enterprise and to mobile app development. - -### Open source rookies ### - -![](http://images.techhive.com/images/article/2015/01/open_source_rookies_14-100564941-orig.jpg) - -- [Open Source Rookies of the 2014 Year][20] -- [InfoWorld's 2015 Technology of the Year Award winners][21] -- [Bossies: The Best of Open Source Software Awards][22] -- [15 essential open source tools for Windows admins][23] - --------------------------------------------------------------------------------- - -via: http://www.infoworld.com/article/2875439/open-source-software/the-top-10-rookie-open-source-projects.html - -作者:[Black Duck Software][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://www.infoworld.com/author/Black-Duck-Software/ -[1]:https://www.blackducksoftware.com/open-source-rookies -[2]:https://www.openhub.net/ -[3]:https://github.com/debops/debops -[4]:http://www.infoworld.com/article/2612397/data-center/review--ansible-orchestration-is-a-veteran-unix-admin-s-dream.html -[5]:https://codecombat.com/ -[6]:http://storj.io/ -[7]:http://neovim.org/ -[8]:https://github.com/cockroachdb/cockroach -[9]:http://www.infoworld.com/resources/16373/application-virtualization/the-beginners-guide-to-docker -[10]:http://kubernetes.io/ -[11]:https://openbazaar.org/ -[12]:http://ipfs.io/ -[13]:https://github.com/google/cadvisor -[14]:https://www.terraform.io/ -[15]:http://www.fig.sh/ -[16]:http://www.infoworld.com/resources/16373/application-virtualization/the-beginners-guide-to-docker -[17]:http://www.infoworld.com/article/2608546/application-virtualization/docker-acquires-orchard-in-a-sign-of-rising-ambitions.html -[18]:https://drone.io/ -[19]:http://www.infoworld.com/article/2683845/google-go/164121-Fast-guide-to-Go-programming.html -[20]:https://www.blackducksoftware.com/open-source-rookies -[21]:http://www.infoworld.com/article/2871935/application-development/infoworlds-2015-technology-of-the-year-award-winners.html -[22]:http://www.infoworld.com/article/2688104/open-source-software/article.html -[23]:http://www.infoworld.com/article/2854954/microsoft-windows/15-essential-open-source-tools-for-windows-admins.html diff --git a/translated/talk/20150128 The top 10 rookie open source projects.md b/translated/talk/20150128 The top 10 rookie open source projects.md new file mode 100644 index 0000000000..c642786914 --- /dev/null +++ b/translated/talk/20150128 The top 10 rookie open source projects.md @@ -0,0 +1,153 @@ +sevenot translated +排名前十的年度开源项目新秀 +================================================================================ +黑鸭(Black Duck)软件公布了一份名叫“年度开源项目新秀”的报告,介绍了由全球开源协会发起的10个最有趣、最活跃的新项目。 + +![](http://images.techhive.com/images/article/2015/01/open_source_rookies_01-100564902-orig.jpeg) + +### 年度开源项目新秀 ### + +每年都有上千新的开源项目问世,但只有少数能够真正的吸引我们的关注。一些项目因为利用了当前比较流行的技术而发展壮大,有一些则真正地开启了一个新的邻域。很多开源项目建立的初衷是为了解决一些生产上的问题,还有一些项目则是世界各地志同道合的开发者们共同发起的一个宏伟项目。 + +从2009年起,开源软件公司黑鸭便发起了[年度开源项目新秀][1]这一活动,它的评选根据[Open Hub][2] 网站(即以前的Ohloh)。今年,我们很荣幸能够报道2015年10大开源项目新秀的得主和2名荣誉奖得主,它们是从上千个开源项目中脱颖而出的。评选采用了加权评分系统,得分标准基于项目的活跃度,交付速度,和几个其它因数。 + +开源俨然成为了产业创新的引擎,就拿今年来说,和Docker容器相关的开源项目在全球各地新起,这也不恰巧反映了企业最感兴趣的技术邻域吗?最后,我们接下来介绍的项目,将会让你了解到全球开源项目的开发者们的在思考什么,这很快将会成为一个指引我们发展的领头羊。 + +### 2015年度开源项目新秀: DebOps ### + +![](http://images.techhive.com/images/article/2015/01/open_source_rookies_02-100564903-orig.jpeg) + +[DebOps][3]收集打包了一套[Ansible][4] (Ansible是一种自动化运维工具)方案和规则,可以从1个容器扩展到一个完整的数据中心。它的创始人Maciej Delmanowski将DebOps开源来保证项目长久进行,从而更好的利用外部贡献者来发展下去 + +DebOps始创于波兰的一个不起眼大学校园里,在自己的数据中心上运行,一切都是手工配置的。有时系统崩溃而导致几天的宕机,这时Delmanowski意识到一个配置管理系统是很有必要的。从Debian的基础做起,DebOps是一组配置一整个数据基础设施Ansible方案。此项目已经在许多不同的工作环境下实现,而创始者们则打算继续支持和开发这个项目。 + +###2015年度开源项目新秀: Code Combat ### + +![](http://images.techhive.com/images/article/2015/01/open_source_rookies_03-100564904-gallery.idge.jpg) + +传统的纸笔学习方法已近不能满足技术学科了。然而游戏都是关于参与者,这也就是为什么[CodeCombat][5] 的创始人会去开发一款多人协同编程游戏来教人们如何编码。 + +刚开始CodeCombat是一个创业想法,但其创始人决定创建一个开源项目将其取代。此想法在社区传播开来,很快不少贡献者加入到项目中来。项目发起仅仅两个月后,这款游戏就被收入Google’s Summer of Code。这款游戏吸引了大量玩家,并被翻译成45种语言。CodeCombat希望成为那些想要一边学习代码同时获得乐趣的同学的风向标。 + +### 2015年度开源项目新秀: Storj ### + +![](http://images.techhive.com/images/article/2015/01/open_source_rookies_04-100564905-gallery.idge.jpg) + +[Storj][6]是一个点对点的云存储网络,可实现端到端加密,保证用户不用依赖第三方即可传输、共享数据。基于比特币block chain技术和点对点协议,Storj提供安全、私密、加密的云存储。 + +云数据存储的反对者担心成本开销和漏洞攻击。为了做到没有死角,Storj是一个私有云存储市场,用户可以通过Storjcoin X(SJCX) 购买交易存储空间。上传到Storj的文件会被粉碎、加密和存储到整个社区。只有文件所有者拥有密钥加密的信息 + +在2014年举办的Texas Bitcoin Conference Hackathon会议上,云存储市场概念首次被提出并证明可行。在第一次赢得黑客马拉松活动后,项目创始人们和领导团队利用开源论坛Reddit、比特币论坛和社交媒体推广此项目。如今,它们已成为Storj决策过程的一个重要组成部分。 + +### 2015年度开源项目新秀: Neovim ### + +![](http://images.techhive.com/images/article/2015/01/open_source_rookies_05-100564906-orig.jpg) + +自1991年提出概念以来,Vim已经成为数以百万计软件开发人员所钟爱的文本编辑器。 [Neovim][6] 是它的下一个版本。 + +  在过去的23年里,软件开发生态系统经历了无数增长和创新。Neovim创始人Thiago de Arruda知道Vim缺少当代元素,跟不上时代的发展。在保留Vim的签名功能的前提下,Neovim团队同样在寻求最受欢迎的文本编辑器改善和发展技术。集资初期,Thiago de Arruda连续6个月时间关注推出此项目。他相信他的团队和支持他激励他继续发展Neovim。 + +### 2015年度开源项目新秀: CockroachDB ### + +![](http://images.techhive.com/images/article/2015/01/open_source_rookies_06-100564907-orig.jpg) + +前谷歌员工开发了一个开源的企业数据存储项目[CockroachDB][8],它是一个可扩展的、跨地域复制且支持事务的数据存储的解决方案。 + +为了保证在线百万兆字节流量业务的质量,Google公开了他们的Spanner系统,这是一个可扩展的,稳定的,支持事务的系统。许多参与开发CockroachDB的团队现在都服务与开源社区。就像真正的蟑螂一样,CockroachDB可以在没有数据头、没有任何节点的情况下正常运行。这个开源项目有很多富有经验的贡献者,创始人们通过社会媒体、Github、网络、会议和聚会结识他们并鼓励他们参与其中。 + +### 2015年度开源项目新秀: Kubernetes ### + +![](http://images.techhive.com/images/article/2015/01/open_source_rookies_07-100564908-orig.jpg) + +在介绍集装箱化的软件对开源社区的发展时,[Docker][9]是一匹黑马,它在技术和工具的设置上做了创新。去年6月谷歌推出了[Kubernetes][10],这是一款开源的容器管理工具,用来加快开发和简化操作。 + +谷歌在它的网络系统上使用容器技术多年了。在2014年夏天的DockerCon上大会上,谷歌这个互联网巨头开源了Kubernetes,Kubernetes的开发是为了满足迅速增长的Docker生态系统的需要。通过和其它的组织、项目合作,比如 Red Hat和CoreOS,Kubernetes的管理者们促使它登上了Docker Hub的工具下载榜榜首。Kubernetes的开发团队希望扩大这个项目,发展它的社区,这样的话软件开发者就能花更少的时间在管理基础设施上,而更多的去开发他们自己的APP。 + +### 2015年度开源项目新秀: Open Bazaar ### + +![](http://images.techhive.com/images/article/2015/01/open_source_rookies_08-100564909-orig.jpg) + +OpenBazaar是一个使用比特币和其他人交易的市场。OpenBazaar这一概念最早在编程马拉松(hackathon)活动中被提出,它的创始人结合了BitTorent,比特币和传统的金融服务方式,创造了一个不受审查的交易平台。OpenBazaar的开发团队在寻求新的成员,而且不久以后他们将无限扩大Open Bazaar的社区。Open Bazaar旨在透明度和同一个目标去在商务交易中掀起一场革命,这会帮助创始人和贡献者向着一个真实的世界奋斗,一个没有控制,分散的市场。 + +### 2015年度开源项目新秀: IPFS ### + +![](http://images.techhive.com/images/article/2015/01/open_source_rookies_09-100564910-orig.jpg) + +IPFS 是一个全球的点对点式的分布式版本文件系统。它综合了Git,BitTorrent,HTTP的思想,开启了一个新的数据和数据结构传输协议。 + +开源被人们所知晓的原因,是它本意用简单的方法解决复杂的问题,这样产生许多新颖的想法,但是着些强大的项目仅仅是开源社区的冰山一角。IFPS有一个积极的团队,这个概念的提出是大胆的,令人惊讶的,有点甚至高不可攀。这样来看,一个点对点的分布是文件系统是在寻找所有连在一起的计算设备。也许HTTP的更换可以靠着通过多种手段继续保持一个社区,包括Git社区和超过100名贡献者的IRC。这个疯狂的想法将在2015年进行软件内部测试。 + +### 2015年度开源项目新秀: cAdvisor ### + +![](http://images.techhive.com/images/article/2015/01/open_source_rookies_10-100564911-orig.jpg) + +[cAdvisor (Container Advisor)][13] 是一个针对在运行中的容器进行收集,合计,处理和输出信息的工具,它可以给容器的使用者提供资源的使用情况和工作特性。对于每一个容器,cAdvisor记录着资源的分离参数,资源使用历史,资源使用历史对比框图,网络状态。这些从容器输出的数据在机器中传递。 + +cAdvisor可以在绝大多数的Linux上运行,并且支持包括Docker在内的多种容器类型。事实上它成为了一种容器的代理,并被集成在了很多系统中。cAdvisor在DockerHub下载量也是位居前茅。cAdvisor的开发团队希望把cAdvisor发展到能够更深入地理解应用并且集成到集群系统。 + +### 2015年度开源项目新秀: Terraform ### + +![](http://images.techhive.com/images/article/2015/01/open_source_rookies_11-100564912-orig.jpg) + +[Terraform][14]提供了一些列的设置来创建一个基础设施,从物理机到虚拟机再到email服务器、DNS服务器。这个概念包括从家庭个人机解决方案到公共云平台提供的服务。一旦建立好了以后,Terraform便进行一系列的操作来改变你的基础设施,安全又高效,就如同配置一样。 + +如果你在Devops模式下的公司里工作,Terraform.io的创始者找到了一个窍门把建立一个完整的数据中心所需的知识结合在一起,从插入服务器到整个网络和功能齐备的数据中心。基础设施的描述采用高级的配置语法,允许你把数据中心的蓝图做成多版本并且可以使用多种代码。著名开源公司HashiCorp赞助开发这个项目。 + +### 荣誉奖: Docker Fig ### + +![](http://images.techhive.com/images/article/2015/01/open_source_rookies_12-100564913-orig.jpg) + +[Fig][15] 为[Docker][16]的使用提供了一个快速的,分离的开发环境。Docker的移植只需要将配置信息放到一个简单的 fig.yml文件里。它会处理所有工作,包括建立、运行,端口转发,分享磁盘和容器链接。 + Fig solved a major pain point for developers. Docker fully supports this open source project and [recently purchased Orchard][17] to expand the reach of Fig. +Orchard去年发起了Fig,来创造一个使Docker工作的系统工具。它的开发像是为Docker设置开发环境,为了确保用户能够为他们的APP准确定义环境,在Docker中会运行数据库和缓存。Fig解决了开发者的一个难题。Docker全面支持这个开源项目,最近将买下Orchard来扩张这个项目。 + +### 荣誉奖: Drone ### + +![](http://images.techhive.com/images/article/2015/01/open_source_rookies_13-100564916-orig.jpg) + +[Drone][18]是一个基于Docker的持续集成平台,而且它是用Go语言写的。Drone项目不满于现存的技术和流程,它旨在开发环境。 + +Drone提供了一个简单的自动测试和持续交付的方法:简单选择一个Docker形象来满足你的需求,连接并提交至GitHub即可。Drone使用Docker容器来提供隔离的测试环境,让每个项目完全自主控制堆栈,没有传统的服务器管理的负担。Drone背后的100位社区贡献者强烈希望把这个项目带到企业和移动应用程序开发中 +### 开源新秀 ### + +![](http://images.techhive.com/images/article/2015/01/open_source_rookies_14-100564941-orig.jpg) + +- [2014年度开源项目新秀][20] +- [InfoWorld2015年年度技术奖][21] +- [Bossies: 开源软件最高荣誉][22] +- [ Windows管理员15个必不可少的开源工具][23] + +-------------------------------------------------------------------------------- + +via: http://www.infoworld.com/article/2875439/open-source-software/the-top-10-rookie-open-source-projects.html + +作者:[Black Duck Software][a] +译者:[sevenot](https://github.com/sevenot) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://www.infoworld.com/author/Black-Duck-Software/ +[1]:https://www.blackducksoftware.com/open-source-rookies +[2]:https://www.openhub.net/ +[3]:https://github.com/debops/debops +[4]:http://www.infoworld.com/article/2612397/data-center/review--ansible-orchestration-is-a-veteran-unix-admin-s-dream.html +[5]:https://codecombat.com/ +[6]:http://storj.io/ +[7]:http://neovim.org/ +[8]:https://github.com/cockroachdb/cockroach +[9]:http://www.infoworld.com/resources/16373/application-virtualization/the-beginners-guide-to-docker +[10]:http://kubernetes.io/ +[11]:https://openbazaar.org/ +[12]:http://ipfs.io/ +[13]:https://github.com/google/cadvisor +[14]:https://www.terraform.io/ +[15]:http://www.fig.sh/ +[16]:http://www.infoworld.com/resources/16373/application-virtualization/the-beginners-guide-to-docker +[17]:http://www.infoworld.com/article/2608546/application-virtualization/docker-acquires-orchard-in-a-sign-of-rising-ambitions.html +[18]:https://drone.io/ +[19]:http://www.infoworld.com/article/2683845/google-go/164121-Fast-guide-to-Go-programming.html +[20]:https://www.blackducksoftware.com/open-source-rookies +[21]:http://www.infoworld.com/article/2871935/application-development/infoworlds-2015-technology-of-the-year-award-winners.html +[22]:http://www.infoworld.com/article/2688104/open-source-software/article.html +[23]:http://www.infoworld.com/article/2854954/microsoft-windows/15-essential-open-source-tools-for-windows-admins.html From 3ba301d27e497c72fd32071b48c583d97f933bb4 Mon Sep 17 00:00:00 2001 From: joeren Date: Thu, 18 Jun 2015 09:07:36 +0800 Subject: [PATCH 416/965] Update 20150617 The Art of Command Line.md --- sources/tech/20150617 The Art of Command Line.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150617 The Art of Command Line.md b/sources/tech/20150617 The Art of Command Line.md index d7fb3a5aff..d951d1d45f 100644 --- a/sources/tech/20150617 The Art of Command Line.md +++ b/sources/tech/20150617 The Art of Command Line.md @@ -1,3 +1,4 @@ +Translating by GOLinux! The Art of Command Line ================================================================================ - [Basics](#basics) @@ -432,4 +433,4 @@ via: https://github.com/jlevy/the-art-of-command-line [17]: [18]: [19]: -[20]: \ No newline at end of file +[20]: From 8060d5563571f07ef871b1d2a05dcdf00fba7437 Mon Sep 17 00:00:00 2001 From: wxy Date: Thu, 18 Jun 2015 10:10:39 +0800 Subject: [PATCH 417/965] =?UTF-8?q?PUB:20150515=20Install=20'Tails=201.4?= =?UTF-8?q?=E2=80=B2=20Linux=20Operating=20System=20to=20Preserve=20Privac?= =?UTF-8?q?y=20and=20Anonymity?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @FSSlc --- ... System to Preserve Privacy and Anonymity.md | 112 ++++++++++-------- 1 file changed, 62 insertions(+), 50 deletions(-) rename {translated/tech => published}/20150515 Install 'Tails 1.4′ Linux Operating System to Preserve Privacy and Anonymity.md (57%) diff --git a/translated/tech/20150515 Install 'Tails 1.4′ Linux Operating System to Preserve Privacy and Anonymity.md b/published/20150515 Install 'Tails 1.4′ Linux Operating System to Preserve Privacy and Anonymity.md similarity index 57% rename from translated/tech/20150515 Install 'Tails 1.4′ Linux Operating System to Preserve Privacy and Anonymity.md rename to published/20150515 Install 'Tails 1.4′ Linux Operating System to Preserve Privacy and Anonymity.md index a7e9d4e6b8..4266bba59c 100644 --- a/translated/tech/20150515 Install 'Tails 1.4′ Linux Operating System to Preserve Privacy and Anonymity.md +++ b/published/20150515 Install 'Tails 1.4′ Linux Operating System to Preserve Privacy and Anonymity.md @@ -1,41 +1,41 @@ -安装 Tails 1.4 Linux 操作系统来保护隐私和保持匿名 +用 Tails 1.4 Linux 系统来保护隐私和保持匿名 ================================================================================ -在这个互联网世界和互联网的世界中,我们在线执行我们的大多数任务,无论是订票,汇款,研究,商务,娱乐,社交网络,还是其他。每天我们花费大部分时间在网络上。在每个逝去的日子里,在网络中保持匿名变得越来越难,尤其是在被某些机构例如 NSA (National Security Agency,国安局) 植入后门的情况下,这些机构嗅探着我们在网络中的所有动作。在网络中,我们有着极少,或者说根本就没有隐私。基于用户浏览网络的活动和机器的活动的搜索都被记录了下来。 +在这个互联网世界和互联网的世界中,我们在线执行我们的大多数任务,无论是订票,汇款,研究,商务,娱乐,社交网络,还是其它。每天我们花费大部分时间在网络上。在过去这些的日子里,在网络中保持匿名变得越来越难,尤其是在被某些机构例如 NSA (National Security Agency) 植入后门的情况下,他们嗅探着我们在网络中的所有动作。在网络中,我们有着极少的,或者说根本就没有隐私。基于用户浏览网络的活动和机器的活动的搜索都被记录了下来。 -一个来自于 Tor 项目的绝妙浏览器正被上百万人使用,它帮助我们匿名地浏览网络,即使这样,跟踪你的浏览习惯也并不难,所以只使用 Tor 并不能保证你的网络安全。你可以从下面的链接中查看 Tor 的特点及安装指南。 +一款来自于 Tor 项目的绝妙浏览器正被上百万人使用,它帮助我们匿名地浏览网络,即使这样,跟踪你的浏览习惯也并不难,所以只使用 Tor 并不能保证你的网络安全。你可以从下面的链接中查看 Tor 的特点及安装指南。 - [使用 Tor 来进行匿名网络浏览][1] -Tor 项目中有一个名为 Tails 的操作系统。Tails (The Amnesic Incognito Live System) 是一个 live 操作系统,基于 Debian Linux 发行版本,主要着眼于在浏览网络时在网络中保护隐私和匿名,这意味着所有的外向连接都强制通过 Tor 来连接,直接的(非匿名的) 连接请求都会被阻挡。该系统被设计为可在任何可启动介质上运行,例如 USB 或 DVD。 +Tor 项目中有一个名为 Tails 的操作系统。Tails (The Amnesic Incognito Live System) 是一个 live 操作系统,基于 Debian Linux 发行版本,主要着眼于在浏览网络时在网络中保护隐私和匿名,这意味着所有的外向连接都强制通过 Tor 来连接,直接的(非匿名的) 连接请求都会被阻挡。该系统被设计为可在任何可启动介质上运行,例如 USB 棒或 DVD。 -Tails OS 的最新稳定发行版本为 1.4 , 于 2015 年 5 月 12 日发行。Tails 由开源单片 Linux 内核支持,构建在 Debian GNU/Linux 之上,着眼于个人电脑市场, 使用 GNOME 3 作为其默认的用户界面。 +Tails OS 的最新稳定发行版本为 1.4 , 于 2015 年 5 月 12 日发行。Tails 由开源的 Linux 宏内核所驱动,构建在 Debian GNU/Linux 之上,着眼于个人电脑市场, 使用 GNOME 3 作为其默认的用户界面。 #### Tails OS 1.4 的特点 #### -- Tails 是一个 free 的操作系统, free 的意义正如 免费(free)啤酒和言论自由(free) 中的 free +- Tails 是一个 free 的操作系统, free 的意义不仅是免费(free)啤酒的免费,也是言论自由(free) 中的自由 - 构建在 Debian/GNU Linux 操作系统之上, Debian 是使用最广泛的通用操作系统 - 着眼于安全的发行版本 -- 有 Windows 8 外观作为其伪装 +- 伪装成 Windows 8 外观 - 不必安装就可以使用 Live Tails CD/DVD 来匿名浏览网络 -- 当 Tails 运行时,不留下任何痕迹 +- 当 Tails 运行时,不会在计算机上留下任何痕迹 - 使用先进的加密工具来加密任何相关文件,邮件等内容 - 通过 Tor 网络来发送和接收流量 -- 在真正意义上为任何人在任何地方保护隐私 -- 在 Live 环境中带有一些可用的应用 +- 真正意义地无论何时何处保护隐私 +- 在 Live 环境中带有一些立即可用的应用 - 系统自带的所有软件都预先配置好只通过 Tor 网络来连接到互联网 -- 任何不通过 Tor 网络而尝试连接网络的应用都将被自动阻拦。 +- 任何不通过 Tor 网络而尝试连接网络的应用都将被自动阻拦 - 限制那些想查看你正在浏览什么网站的人的行动,并限制网站获取你的地理位置 - 连接到那些被墙或被审查的网站 -- 特别设计不使用主操作系统的空间,即使在 swap 空间还有空余的情况下 -- 整个操作系统加载在 RAM 中,在每次重启或关机后会自动擦除掉,所以不会留下任何运行的痕迹。 +- 特别设计不使用主操作系统的空间,即便是 swap 空间也不用 +- 整个操作系统加载在内存中,在每次重启或关机后会自动擦除掉,所以不会留下任何运行的痕迹。 - 先进的安全实现,通过加密 USB 磁盘, HTTPS 应答加密和对邮件,文档进行签名。 -#### 在 Tails 1.4 中可期待的东西 #### +#### 在 Tails 1.4 中所期待的东西 #### - 带有安全滑块的 Tor 浏览器 4.5 - Tor 被升级到版本 0.2.6.7 - 修补了几个安全漏洞 -- 针对诸如 curl, OpenJDK 7, tor Network, openldap 等应用, 许多漏洞被修复并打上了补丁 +- 针对诸如 curl、 OpenJDK 7、 tor Network、 openldap 等应用, 许多漏洞被修复并打上了补丁 要得到完整的更改记录,你需要访问 [这里][2] @@ -43,7 +43,7 @@ Tails OS 的最新稳定发行版本为 1.4 , 于 2015 年 5 月 12 日发行 #### 为什么我应该使用 Tails 操作系统 #### -你需要 Tails 因为你想: +你需要 Tails 因为你想: - 在网络监控下保持自由 - 捍卫自由,隐私和秘密 @@ -62,85 +62,96 @@ Tails OS 的最新稳定发行版本为 1.4 , 于 2015 年 5 月 12 日发行 - [tails-i386-1.4.iso][3] - [tails-i386-1.4.torrent][4] -2. 下载后,可使用 SHA256SUM 来获取 ISO 文件的哈希值并与官方提供的值相比较,以核实 ISO 文件的完整性 +2. 下载后,可使用 sha256sum 来获取 ISO 文件的哈希值并与官方提供的值相比较,以核实 ISO 文件的完整性 $ sha256sum tails-i386-1.4.iso 339c8712768c831e59c4b1523002b83ccb98a4fe62f6a221fee3a15e779ca65d -假如你熟悉 OpenPGP ,将 Tails 的签名密钥与 Debian 的 keyring 相比较以验证其签名,若想了解任何有关 Tails 的加密签名,请将浏览器指向 [这里][5] +假如你熟悉 OpenPGP ,将 Tails 的签名密钥与 Debian 的 keyring 相比较以验证其签名,若想了解任何有关 Tails 的加密签名,请用浏览器访问 [这里][5] -3. 下一步,你需要将镜像写入 USB 或 DVD ROM 中。或许你需要看看这篇文章 [如何创建一个 Live 可启动的 USB][6] 以了解如何使得一个闪存驱动器变得可启动并向它写入 ISO 镜像文件。 +3. 下一步,你需要将镜像写入 USB 棒或 DVD ROM 中。或许你需要看看这篇文章 “[如何创建一个 Live 可启动的 USB棒][6] ”以了解如何使得一个闪存盘变得可启动并向它写入 ISO 镜像文件。 -4. 插入 Tails OS 可启动闪存驱动器或 DVD ROM,并从那里启动 (在 BIOS 中选择该介质来启动)。第一个屏幕中会有两个选项 'Live' 和 'Live (failsafe)' 让你选择。选择 'Live' 并确定。 +4. 插入 Tails OS 的可启动闪存盘或 DVD ROM,并从那里启动 (在 BIOS 中选择该介质来启动)。第一个屏幕中会有两个选项 'Live' 和 'Live (failsafe)' 让你选择。选择 'Live' 并确定。 ![Tails 启动菜单](http://www.tecmint.com/wp-content/uploads/2015/05/1.png) -Tails 启动菜单 + +*Tails 启动菜单* 5. 在登录之前,你有两个选项, 假如你想配置并设定高级选项,点击 '更多选项' 否则点击 'NO'。 ![Tails 欢迎界面](http://www.tecmint.com/wp-content/uploads/2015/05/2.png) -Tails 欢迎界面 -6. 在点击高级选项后,你需要设置 root 密码。假如你想升级它,这是非常重要的。这个 root 密码将会一直有效,知道你关机或重启。 +*Tails 欢迎界面* -另外,若你想开启 Windows 伪装,假如你想在一个公共场所运行这个操作系统,这将使得看起来你正在运行 Windows 8 操作系统。这真是一个好的选项!不是吗?另外,你还有一个选项来配置 网络和 Mac 地址,当一切准备完毕后,点击 '登录' ! +6. 在点击高级选项后,你需要设置 root 密码。假如你想升级它,这是非常重要的。这个 root 密码的有效期将持续到你关机或重启。 + +另外,若你想开启 Windows 伪装,假如你想在一个公共场所运行这个操作系统,这将使得看起来你正在运行 Windows 8 操作系统。这真是一个好的选项!不是吗?另外,你还有一个选项来配置网络和 Mac 地址,当一切准备完毕后,点击 '登录' ! ![Tails OS 的配置](http://www.tecmint.com/wp-content/uploads/2015/05/3.png) -Tails OS 的配置 + +*Tails OS 的配置* 7. 这是使用 Windows 皮肤伪装的 Tails GNU/Linux OS: ![Tails 的 Windows 伪装](http://www.tecmint.com/wp-content/uploads/2015/05/4.jpg) -Tails 的 Windows 伪装 -8. 系统将在后台启动 Tor 网络。在屏幕的右上角查看通知 – Tor 已经准备好了 或现在你已经连接上了互联网。 +*Tails 的 Windows 伪装* -你也可以在 Internet 菜单下查看它包含了哪些东西。 注意 – 它包含有 Tor 浏览器(安全的) 和 不安全的网络浏览器(其中的向内和向外数据不通过 Tor 网络) 和其他应用。 +8. 系统将在后台启动 Tor 网络。在屏幕的右上角查看通知 :“Tor 已经准备好了,现在你已经连接上了互联网”。 + +你也可以在 Internet 菜单下查看它包含了哪些东西。 注意 :它包含有 Tor 浏览器(安全的) 和 不安全的网络浏览器(其中的向内和向外数据不通过 Tor 网络) 和其他应用。 ![Tails 菜单和工具](http://www.tecmint.com/wp-content/uploads/2015/05/5.jpg) -Tails 菜单和工具 + +*Tails 菜单和工具* 9. 点击 Tor 并检查你的 IP 地址。 它确认我的物理位置没有被分享以及我的隐私未被触动。 ![在 Tails 上检查隐私](http://www.tecmint.com/wp-content/uploads/2015/05/6.jpg) -在 Tails 上检查隐私 -10. 你还可以激活 Tails 安装器来从 ISO 镜像文件中 克隆和安装, 克隆和升级以及升级系统。 +*在 Tails 上检查隐私* + +10. 你还可以激活 Tails 安装器来“克隆和安装”, “克隆和升级”以及“从 ISO 镜像文件中升级系统”。 ![Tails 安装器选项](http://www.tecmint.com/wp-content/uploads/2015/05/7.jpg) -Tails 安装器选项 -11. 其他选项为选择 Tor 不带有高级选项,就在登录之前。(查看上面的第 5 步). +*Tails 安装器选项* -![Tails 未带有高级选项](http://www.tecmint.com/wp-content/uploads/2015/05/8.png) -Tails 未带有高级选项 +11. 如果选择另外的那个不带有高级选项的方式,那就直接登录。(查看上面的第 5 步). -12. 你将登录到 Gnome3 桌面环境。 +![不设置高级选项的 Tails](http://www.tecmint.com/wp-content/uploads/2015/05/8.png) + +*不设置高级选项的 Tails* + +12. 这将登录到 Gnome3 桌面环境。 ![Tails Gnome 桌面](http://www.tecmint.com/wp-content/uploads/2015/05/9.png) -Tails Gnome 桌面 -13. 假如你点击启动不安全的浏览器,无论在带有伪装,还是没有带有伪装的情况下,你都将会收到弹窗通知。 +*Tails Gnome 桌面* + +13. 假如你点击启动不安全的浏览器,无论是否带有地址伪装,你都将会收到弹窗通知。 ![Tails 浏览通知](http://www.tecmint.com/wp-content/uploads/2015/05/10.png) -Tails 浏览通知 + +*Tails 浏览通知* 假如你仍启动不安全的浏览器,你将在浏览器中看到如下网页: ![Tails 浏览警告](http://www.tecmint.com/wp-content/uploads/2015/05/11.png) -Tails 浏览警告 + +*Tails 浏览警告* #### Tails 适合我吗?#### 要想得到上面问题的答案,首先回答如下的问题: -- 在上网时,你想你的隐私未被触动吗? -- 你想在身份信息窃取者的眼皮底下保持隐身吗? +- 在上网时,你想你的隐私不被触动吗? +- 你想在窃取身份信息的人的眼皮底下保持隐身吗? - 你想在你的网上私人聊天过程中被他人嗅探吗? - 你真的想向任何人展示你的地理位置吗? - 你开展银行网上交易吗? -- 你愿意受政府和 ISP(注:网络提供商) 的审查吗? +- 你愿意受政府和 ISP的审查吗? 假如以上问题中,任意一个问题的答案为 'YES',则你最好需要 Tails。假如上面所有的问题的答案都是 'NO',则或许你不需要它。 @@ -150,27 +161,28 @@ Tails 浏览警告 ### 总结 ### -对于那些工作在不安全环境中的人来说,Tails 是一个必需的操作系统。Tails 还是一个着眼于安全的操作系统,现在为止,包含一大批应用 – Gnome 桌面, Tor, Firefox (Iceweasel), Network Manager, Pidgin, Claws mail, Liferea feed addregator, Gobby, Aircrack-ng, I2P。 +对于那些工作在不安全环境中的人来说,Tails 是一个必需的操作系统。Tails 还是一个着眼于安全的操作系统,现在为止,包含了一大批应用 – Gnome 桌面、Tor、 Firefox (Iceweasel)、 Network Manager、 Pidgin、 Claws mail、 Liferea feed addregator、 Gobby、 Aircrack-ng、 I2P。 -同时,它含有一些有关加密和隐私的工具,即 UKS, GNUPG, PWGen, Shamir’s Secret Sharing, Virtual Keyboard (against Hardware Keylogging), MAT, KeePassX Password Manager 等。 +同时,它含有一些有关加密和隐私的工具,即 UKS、 GnuPG、 PWGen、 Shamir's Secret Sharing、 Virtual Keyboard (对付硬件的键盘记录器)、 MAT、 KeePassX Password Manager 等。 -这就是全部了。关注 Tecmint。请分享你的有关 Tails GNU/Linux 操作系统的想法。对于这个项目的未来,你怎么看?同时在实际中测试它,并让我们获知你的体验感受。 +这就是全部了。关注我们。请分享你的有关 Tails GNU/Linux 操作系统的想法。对于这个项目的未来,你怎么看?同时在实际中测试它,并让我们获知你的体验感受。 -你也可以在 [Virtualbox][8] 中运行它。 Tails 在 RAM 中加载整个操作系统,所以在 VM 中你需要给定足够的 RAM 来运行 Tails。 +你也可以在 [Virtualbox][8] 中运行它。 Tails 在内存中加载整个操作系统,所以在虚拟机中你需要给定足够的内存来运行 Tails。 + +我在 1GB 内存的环境中测试了 Tails,它工作起来毫无滞后感。谢谢我们的所有用户的支持。使我们成为一个包含所有 Linux 相关信息的地方,你的支持是必需的。 Kudos! -我在 1GB 的环境中测试了 Tails,它工作起来毫无滞后感。谢谢我们的所有用户的支持。使 Tecmint 成为一个包含所有 Linux 相关信息的地方,你的合作是必需的。 Kudos! -------------------------------------------------------------------------------- via: http://www.tecmint.com/install-tails-1-4-linux-operating-system-to-preserve-privacy-and-anonymity/ 作者:[Avishek Kumar][a] 译者:[FSSlc](https://github.com/FSSlc) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 [a]:http://www.tecmint.com/author/avishek/ -[1]:http://www.tecmint.com/tor-browser-for-anonymous-web-browsing/ +[1]:https://linux.cn/article-3566-1.html [2]:https://tails.boum.org/news/version_1.4/index.en.html [3]:http://dl.amnesia.boum.org/tails/stable/tails-i386-1.4/tails-i386-1.4.iso [4]:https://tails.boum.org/torrents/files/tails-i386-1.4.torrent From db2ecdf6aeefbe17eab97dd7faa46ce771bfafff Mon Sep 17 00:00:00 2001 From: Chang Liu Date: Thu, 18 Jun 2015 10:33:59 +0800 Subject: [PATCH 418/965] Update 20150616 LINUX 101--POWER UP YOUR SHELL.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 准备翻译该篇. --- sources/tech/20150616 LINUX 101--POWER UP YOUR SHELL.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150616 LINUX 101--POWER UP YOUR SHELL.md b/sources/tech/20150616 LINUX 101--POWER UP YOUR SHELL.md index ef9f3d4937..94102a58a6 100644 --- a/sources/tech/20150616 LINUX 101--POWER UP YOUR SHELL.md +++ b/sources/tech/20150616 LINUX 101--POWER UP YOUR SHELL.md @@ -1,3 +1,5 @@ +FSSlc translating + LINUX 101: POWER UP YOUR SHELL ================================================================================ > Get a more versatile,featureful and colourful command line interface with our guide to shell basics. @@ -174,4 +176,4 @@ via: http://www.linuxvoice.com/linux-101-power-up-your-shell-8/ [3]:http://tinyurl.com/osopjv9 [4]:http://www.xiki.org/ [5]:http://ciembor.github.io/4bit -[6]:http://ethanschoonover.com/solarized \ No newline at end of file +[6]:http://ethanschoonover.com/solarized From ae2ab64b4d4e3b2a5711467f2808bf563f6b3d9e Mon Sep 17 00:00:00 2001 From: wxy Date: Thu, 18 Jun 2015 10:40:43 +0800 Subject: [PATCH 419/965] PUB:20150515 Extend Swap Space using Swap file in Linux @strugglingyouth --- ...tend Swap Space using Swap file in Linux.md | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) rename {translated/tech => published}/20150515 Extend Swap Space using Swap file in Linux.md (81%) diff --git a/translated/tech/20150515 Extend Swap Space using Swap file in Linux.md b/published/20150515 Extend Swap Space using Swap file in Linux.md similarity index 81% rename from translated/tech/20150515 Extend Swap Space using Swap file in Linux.md rename to published/20150515 Extend Swap Space using Swap file in Linux.md index 0b1a5c0597..b92b4a8a36 100644 --- a/translated/tech/20150515 Extend Swap Space using Swap file in Linux.md +++ b/published/20150515 Extend Swap Space using Swap file in Linux.md @@ -1,9 +1,6 @@ -translated by strugglingyouth 在linux上使用交换文件扩展交换空间 ================================================================================ -想像一种情景,当我们的Linux系统用尽交换空间时,在这种情况下, -我们想要使用swap分区扩展交换空间,但在某些情况下磁盘上的空闲分区是不可用的, -致使我们不能把它扩大。 +想像一种情景,当我们的Linux系统用尽交换空间时,在这种情况下,我们想要使用swap分区扩展交换空间,但在某些情况下磁盘上已经没有可用的空闲分区了,致使我们不能把它扩大。 因此,在这种情况下,我们可以使用交换文件增加swap空间。 @@ -16,7 +13,7 @@ free-output-with-swap 我的交换分区大小是2 GB,我们将把交换空间扩展1GB。 -#### 第一步:使用下面的dd命令创建大小为1GB交换文件d #### +#### 第一步:使用下面的dd命令创建大小为1GB交换文件 #### [root@linuxtechi ~]# dd if=/dev/zero of=/swap_file bs=1G count=1 1+0 records in @@ -26,7 +23,7 @@ free-output-with-swap 根据你的需要替换 ‘**bs**‘ 和 ‘**count**‘ 的大小. -####第二步:设置交换文件权限为644. #### +#### 第二步:设置交换文件权限为600 #### [root@linuxtechi ~]# chmod 600 /swap_file @@ -56,21 +53,20 @@ free-output-with-swap ![swap-space-after-extension](http://www.linuxtechi.com/wp-content/uploads/2015/06/swap-space-after-extension.jpg) -**Note**: 为了避免出现意外的情况,如下所示使用swapoff命令关闭它, -仅在需要使用时,使用步骤5所示的swapon命令,重新启用交换文件。. +**Note**: 为了避免出现意外的情况,如下所示使用swapoff命令关闭它,仅在需要使用时,使用步骤5所示的swapon命令,重新启用交换文件。 [root@linuxtechi ~]# swapoff /swap_file [root@linuxtechi ~]# -请分享您的宝贵意见或者评论此文章. +请分享您的宝贵意见或者评论此文章。 -------------------------------------------------------------------------------- via: http://www.linuxtechi.com/extend-swap-space-using-swap-file-in-linux/ 作者:[Pradeep Kumar][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) +译者:[strugglingyouth](https://github.com/strugglingyouth) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 449936748ed07bf642fef1e564c8da75bd4709b6 Mon Sep 17 00:00:00 2001 From: wxy Date: Thu, 18 Jun 2015 11:13:03 +0800 Subject: [PATCH 420/965] PUB:20150604 Read about The Document Foundation achievements in 2014--download the Annual Report @sevenot --- ...chievements in 2014--download the Annual Report.md | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) rename {translated/share => published}/20150604 Read about The Document Foundation achievements in 2014--download the Annual Report.md (70%) diff --git a/translated/share/20150604 Read about The Document Foundation achievements in 2014--download the Annual Report.md b/published/20150604 Read about The Document Foundation achievements in 2014--download the Annual Report.md similarity index 70% rename from translated/share/20150604 Read about The Document Foundation achievements in 2014--download the Annual Report.md rename to published/20150604 Read about The Document Foundation achievements in 2014--download the Annual Report.md index 678abbb6fd..9bb73fc944 100644 --- a/translated/share/20150604 Read about The Document Foundation achievements in 2014--download the Annual Report.md +++ b/published/20150604 Read about The Document Foundation achievements in 2014--download the Annual Report.md @@ -1,14 +1,12 @@ -sevenot translated 下载年度报告,了解The Document Foundation2014年的成果 ================================================================================ ![](https://documentfoundation.files.wordpress.com/2015/06/tdf-report.jpg) - -TDF ReportThe Document Foundation (TDF)郑重地发布了2014年度报告,你可以点击这里下载: [http://tdf.io/report2014][1] (3.2 MB PDF)。高清质量的可以点击这里下载 [http://tdf.io/report2014hq][2] (15.9 MB PDF)。 +The Document Foundation (TDF)郑重地发布了2014年度报告,你可以点击这里下载: [http://tdf.io/report2014][1] (3.2 MB PDF)。高清质量的可以点击这里下载 [http://tdf.io/report2014hq][2] (15.9 MB PDF)。 TDF年度报告中,以回顾2014年开始了这篇报告,其中包括了TDF和LibreOffice的精彩集锦,并且总结了财务情况和预算。 -该报告涉及到项目和活动的会议包括:2014年在伯尔尼的LibreOffice大会,在布鲁塞尔、大加那利岛、巴黎、波士顿和土鲁斯的认证项目,网站与质量保证,Hackfests项目,本土语言项目,基础设施,文档项目,市场设计与营销。 +该报告涉及到项目和活动的会议包括:2014年在伯尔尼的LibreOffice大会,在布鲁塞尔、大加那利岛、巴黎、波士顿和土鲁斯的认证项目、网站与质量保证、Hackfests项目等,本土语言项目,基础设施,文档项目,市场设计与营销。 该报告涉及到的软件开发活动和代码包括:工程指导委员会的活动,LibreOffice的开发,文档解放项目,LibreOffice的安卓移植。 @@ -17,8 +15,7 @@ TDF年度报告中,以回顾2014年开始了这篇报告,其中包括了TDF TDF 2014年度报告的编辑工作由Sophie Gautier, Alexander Werner, Christian Lohmaier, Florian Effenberger, Italo Vignoli 和 Robinson Tryon完成,由Barak Paz设计样式,Libreoffice社区协助完成。 -为了使该文档分布达到最大程度的分布,采用了CC3 认证发布,除非特殊标注,TDF成员和自由软件基金会拥有其所有权。 -[德语版年度报告下载请点击[http://tdf.io/bericht2014][3]]. +为了最大程度的传播该文档,采用了CC3 认证发布,除非特殊标注,TDF成员和自由软件基金会拥有其所有权。 -------------------------------------------------------------------------------- @@ -26,7 +23,7 @@ via: http://blog.documentfoundation.org/2015/06/03/read-about-the-document-found 作者:italovignoli 译者:[sevenot](https://github.com/sevenot) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From ad76750d4db8b80d2fd693768d1e9d8be46e9e0d Mon Sep 17 00:00:00 2001 From: wxy Date: Thu, 18 Jun 2015 11:56:30 +0800 Subject: [PATCH 421/965] PUB:20150527 3 Open Source Python Shells @wi-cuckoo --- .../20150527 3 Open Source Python Shells.md | 102 ++++++++++++++++++ .../20150527 3 Open Source Python Shells.md | 100 ----------------- 2 files changed, 102 insertions(+), 100 deletions(-) create mode 100644 published/20150527 3 Open Source Python Shells.md delete mode 100644 translated/share/20150527 3 Open Source Python Shells.md diff --git a/published/20150527 3 Open Source Python Shells.md b/published/20150527 3 Open Source Python Shells.md new file mode 100644 index 0000000000..86c6b7ee96 --- /dev/null +++ b/published/20150527 3 Open Source Python Shells.md @@ -0,0 +1,102 @@ +3个开源的Python Shell +========================================================================= + +Python是一个高级、通用、结构化且强大的开源编程语言,广泛用于各种编程工作。它拥有一个全动态类型系统和自动内存管理,与Scheme,Ruby,Perl和Tcl的十分相似,避免编译型语言的许多复杂地方和难以理解。Python于1991年由Guido van Rossum创造,然后逐渐成长,流行。 + +Python是一个非常实用,而且流行的计算机编程语言。使用一个如Python这样的解释型语言的好处之一就是,可以借助其交互的shell探索式地编程。你可以试着代码,而不必专门写一个脚本。但是Python shell也有一些局限性。基本来说,有许多很漂亮的Python shell可选择,都是在基础shell上扩展的。他们每一个都提供了一个极好的交互性的Python 体验。 + +### bpython ### + +![](http://www.linuxlinks.com/portal/content/reviews/Programming/Screenshot-bpython.png) + +对于Linux,BSD,OS X和Windows来说,bpython是一个不错的Python解释器的界面。 + +其想法是提供给用户所有的内置功能,很像现在的IDE(集成开发环境),但是是在一个简单,轻量级的包里,可以在终端窗口里面运行。 + +bpython并不追求创造任何新的或者开创性的东西。相反,它聚集了一些简洁的理念,关注于实用性和操作性。 + +功能包括: + +- 内置的语法高亮 - 使用Pygments排版你敲出的代码,并合理配色 +- 根据你的行为,显示自动补全的建议 +- 为任何Python函数列出所期望的参数 - 可以显示你调用的任何函数的参数列表 +- “Rewind”功能会调出内存里的最后一行代码并重新执行 +- 可以将你输入的代码送到pastebin +- 可以将你输入的代码保存到一个文件 +- 自动缩进 +- 支持Python 3 + +--- + +- 网址: [www.bpython-interpreter.org][1] +- 开发者: Bob Farrell and contributors +- 证书: MIT License +- 版本号: 0.14.1 + +### IPython ### + +![](http://www.linuxlinks.com/portal/content/reviews/Programming/Screenshot-ipython.png) + +IPython是Python shell的一个交互加强版。她提供了一个丰富的工具集合,帮助你交互式地充分利用Python。 + +IPython可以用来取代标准的Python shell,也可以与标准Python科学和数值处理工具配合,用做一个科学计算(如Matlab或者Mathematical)的完整工作环境。她支持动态对象内省,有限的输入/输出提示,一个宏系统,会话日志,会话恢复,访问完整的系统外壳,详尽且彩色的追踪报告,自动圆括号补全,自动引号补全和可嵌入其他Python程序。 + +功能包括: + +- 强大的交互Shell(基于终端或者Qt) +- 一个基于浏览器的记事本,支持代码,富文本,数学表达式,内置图表和其他富媒介。 +- 支持交互式的数据可视化和使用GUI工具箱 +- 灵活,嵌入式的解释器可以加载进你自己的项目里 +- 易于使用,高效的并行运算工具 + +--- + +- 网址: [ipython.org][2] +- 开发者: The IPython Development Team +- 证书: BSD +- 版本号: 3.1 + +### DreamPie ### + +![](http://www.linuxlinks.com/portal/content/reviews/Programming/Screenshot-DreamPie.png) + +DreamPie是一个为可靠性和趣味性设计的Python shell。 + +DreamPie可以用于任何Python解释器(Jython,IronPython,PyPy)。 + +功能包括: + +- 一个新式的交互shell:窗口被分成历史区域和代码区域,历史区域可以让你看到之前的命令及其输出,代码区域是里敲代码的地方。这样,你可以编辑任意多的代码,就好像在你最喜欢的编辑器里一样,并且适当时候可以执行它。你也可以从其他地方复制代码,编辑并马上运行它 +- “只复制代码”命令可以复制你想要的代码,以便你可以把它存入一个文件。代码已经用四个空格缩进进行格式化 +- 自动补全属性和文件名字 +- 自动显示函数参数和文档 +- 在结果历史中保存你最近的结果,备以后用 +- 可以自动折叠很长的输出,以便你可以专注于重要的地方 +- 保存会话的历史记录为一个HTML文件,备以后查询。你可以加载历史文件到DreamPie里,并且快速重复之前的命令。 +- 自动添加圆括号与可选的引号,当你在函数与方法后按下空格键。例如,键入execfile后按下空格会提示execfile("fn") +- 支持交互的matplotlib绘图 +- 支持Python 2.5,Python 2.6,Python 3.1,Jython 2.5,IronPython 2.6和PyPy +- 难以置信的快速反应 + +--- + +- 网址: [www.dreampie.org][3] +- 开发者: Noam Yorav-Raphael +- 证书: GNU GPL v3 +- 版本号: 1.2.1 + +-------------------------------------------------------------------------------- + +via: http://www.linuxlinks.com/article/20150523032756576/PythonShells.html + +作者:Frazer Kline +译者:[wi-cuckoo](https://github.com/wi-cuckoo) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[1]:http://www.bpython-interpreter.org/ +[2]:http://ipython.org/ +[3]:http://www.dreampie.org/ + +-------------------------------------------------------------------------------- diff --git a/translated/share/20150527 3 Open Source Python Shells.md b/translated/share/20150527 3 Open Source Python Shells.md deleted file mode 100644 index 24b81d697a..0000000000 --- a/translated/share/20150527 3 Open Source Python Shells.md +++ /dev/null @@ -1,100 +0,0 @@ -3个开源的Python Shell -========================================================================= -Python是一个高级,通用,结构化且强大的开源编程语言,用于广泛的编程工作。它拥有一个完全的动态类型系统和自动内存管理,与Scheme,Ruby,Perl和Tcl的十分相似,避免编译型语言的许多复杂地方和难以理解。Python于1991年由Guido van Rossum创造,然后逐渐成长,流行。 - -Python是一个非常实用,而且流行的计算机编程语言。使用一个如Python这样的解释型语言的好处之一就是,可以借助其交互的shell考察式地编程。你可以试用代码,而不必写一个脚本。但是Python shell也有一些局限性。基本来说,有许多很nice的Python shell可选择,都是在基础shell上扩展的。他们每一个都提供了一个极好的交互性的Python 体验。 - --------------- - -### bpython ### - -![](http://www.linuxlinks.com/portal/content/reviews/Programming/Screenshot-bpython.png) - -对于Linux,BSD,OS X和Windows来说,bpython是Python解释器一个受欢迎的接口。 - -想法是提供给用户所有的内置功能,很像现在的IDEs(集成开发环境),但是是在一个简单,轻量级的包里,可以在终端窗口里面运行。 - -bpython并不追求创造任何新的或者开创性的东西。相反,她聚集了一些简洁的理念,关注于实用性和操作性。 - -功能包括: - -- 内置的语法高亮 - 使用Pygments排版你敲出的代码,并合理地上色 -- 根据你的行为,显示自动补全的建议。 -- 为任何Python函数列出期望的参数 - 力求显示一列参数,为你调用的任何函数 -- “Rewind”功能,弹出内存里的最后一行代码并重新评定 -- 发送你已经解除占用的代码到粘贴缓存 -- 保存你已经输入到一个文件里的代码 -- 自动缩进 -- 支持Python 3 - -- 网址: [www.bpython-interpreter.org][1] -- 开发者: Bob Farrell and contributors -- 证书: MIT License -- 版本号: 0.14.1 - ----------- - -### IPython ### - -![](http://www.linuxlinks.com/portal/content/reviews/Programming/Screenshot-ipython.png) - -IPython是Python shell的一个交互加强版。她提供了一个丰富的工具集合,帮助你交互式地充分利用Python。 - -IPython可以用来取代标准的Python shell,或者当与标准Python 科学和数值处理工具配合,用做一个科学计算(如Matlab或者Mathematical)的完整工作环境。她支持动态对象内省,有限的输入/输出提示,一个宏观系统,会话登录,会话恢复,完整的系统接入,详尽且彩色的追踪报告,自动圆括号,自动应用和可嵌入其他Python程序。 - -功能包括: - -- 强大的交互Shell(终端或者基于Qt) -- 一个基于浏览器的记事本,支持代码,多样文本,数学表达式,内置飞行图表和其他丰富媒介。 -- 支持交互式的数据虚拟化和GUI工具箱使用 -- 灵活,嵌入式的解释器可以加载进你自己的项目里 -- 易于使用,高效的并行运算工具 - -- 网址: [ipython.org][2] -- 开发者: The IPython Development Team -- 证书: BSD -- 版本号: 3.1 - ----------- - -### DreamPie ### - -![](http://www.linuxlinks.com/portal/content/reviews/Programming/Screenshot-DreamPie.png) - -DreamPie是一个为可靠性和兴趣设计的Python shell。 - -DreamPie可以用于任何Python解释器(Jython,IronPython,PyPy)。 - -功能包括: - -- 一个交互shell的新概念:窗口被分成历史区域和代码区域,历史区域可以让你看到之前的命令及其输出,代码区域是里敲代码的地方。这样,你可以编辑任意数量的代码,就好像在你最喜欢的编辑器里一样,并且适当时候可以执行它。你也可以从其他地方复制你想保存的代码,所以你可以把它存入一个文件。代码可以很好地格式化为四级缩进。 -- 自动补全属性和文件名字 -- 自动显示函数参数和文档 -- 在结果历史中保存你最近的结果,备以后用 -- 可以自动展开很长的输出,所以你可以专注于重要的地方 -- 保存会话的历史记录为一个HTML文件,备以后查询。你可以加载历史文件到DreamPie里,并且快速回退到之前的命令。 -- 自动添加圆括号与可选的引用,当你在函数与方法后按下空格键。例如,键入execfile fn并且获得execfile("fn") -- 支持交互的matplotlib绘图 -- 支持Python 2.5,Python 2.6,Python 3.1,Jython 2.5,IronPython 2.6和PyPy -- 难以置信的快速反应 - -- 网址: [www.dreampie.org][3] -- 开发者: Noam Yorav-Raphael -- 证书: GNU GPL v3 -- 版本号: 1.2.1 - --------------------------------------------------------------------------------- - -via: http://www.linuxlinks.com/article/20150523032756576/PythonShells.html - -作者:Frazer Kline -译者:[wi-cuckoo](https://github.com/wi-cuckoo) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[1]:http://www.bpython-interpreter.org/ -[2]:http://ipython.org/ -[3]:http://www.dreampie.org/ - --------------------------------------------------------------------------------- From da1385f081b57619bf0549f5a82c03a9ef1342c6 Mon Sep 17 00:00:00 2001 From: DeadFire Date: Thu, 18 Jun 2015 15:20:04 +0800 Subject: [PATCH 422/965] =?UTF-8?q?20150618-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ll be the future of Linux without Linus.md | 185 ++++++++++++++++++ 1 file changed, 185 insertions(+) create mode 100644 sources/talk/20150618 What will be the future of Linux without Linus.md diff --git a/sources/talk/20150618 What will be the future of Linux without Linus.md b/sources/talk/20150618 What will be the future of Linux without Linus.md new file mode 100644 index 0000000000..e042fdbe61 --- /dev/null +++ b/sources/talk/20150618 What will be the future of Linux without Linus.md @@ -0,0 +1,185 @@ +What will be the future of Linux without Linus? +================================================================================ +![](http://i2.wp.com/www.linuxveda.com/wp-content/uploads/2015/06/linus-torvalds-painting.jpg) + +The interview was conducted back in 2007 for Linux For You magazine and we are publishing it here for archival purposes. + +**Q: What are the future enhancements/paths/plans for the Linux kernel?** + +Linus: I’ve never been much of a visionary — instead of looking at huge plans for the future, I tend to have a rather short time frame of ‘issues in the next few months’. I’m a big believer in that the ‘details’ matter, and if you take care of the details, the big issues will end up sorting themselves out on their own. + +So I really don’t have any great vision for what the kernel will look like in five years — just a very general plan to make sure that we keep our eye on the ball. In fact, when it comes to me personally, one of the things I worry about the most isn’t even the technical issues, but making sure that the ‘process’ works, and that people can work well with each other. + +**Q: How do you see the relationship of Linux and Solaris evolving in the future? How will it benefit the users? ** + +Linus: I don’t actually see a whole lot of overlap, except that I think Solaris will start using more of the Linux user space tools (which I obviously don’t personally have a lot to do with — I really only do the kernel). The Linux desktop is just so much better than what traditional Solaris has, and I expect Solaris to move more and more towards a more Linux-like model there. + +On the pure kernel side, the licensing differences mean that there’s not much cooperation, but it will be very interesting to see if that will change. Sun has been making noises about licensing Solaris under the GPL (either v2 or v3), and if the licence differences go away, that could result in some interesting technology. But I’m taking a wait-and-see attitude to that. + +**Q: Now that the GPLv3 has been finalised and released, do you foresee any circumstance that would encourage you to begin moving the kernel to it? Or, from your perspective, is it so bad that you would never consider it?** + +Linus: I think it is much improved over the early drafts, and I don’t think it’s a horrible licence. I just don’t think it’s the same kind of ‘great’ licence that the GPLv2 is. + +So in the absence of the GPLv2, I could see myself using the GPLv3. But since I have a better choice, why should I? + +That said, I try to always be pragmatic, and the fact that I think the GPLv3 is not as good a licence as the GPLv2 is not a ‘black and white’ question. It’s a balancing act. And if there are other advantages to the GPLv3, maybe those other advantages would be big enough to tilt the balance in favour of the GPLv3. + +Quite frankly, I don’t really see any, but if Solaris really is to be released under the GPLv3, maybe the advantage of avoiding unnecessary non-compatible licence issues could be enough of an advantage that it might be worth trying to re-license the Linux kernel under the GPLv3 too. + +Don’t get me wrong — I think it’s unlikely. But I do want to make it clear that I’m not a licence bigot, per se. I think the GPLv2 is clearly the better licence, but licences aren’t everything. + +After all, I use a lot of programs that are under other licences. I might not put a project I start myself under the BSD (or the X11-MIT) licence, but I think it’s a great licence, and for other projects it may well be the right one. + +**Q: Currently are there any Indians who you’d like to highlight as key contributors to the Linux kernel?** + +Linus: I have to admit that I don’t directly work with anybody that I actually realise as being from India. That said, I should clarify a bit: I’ve very consciously tried to set up the kernel development so that I don’t end up working personally with a huge number of people. + +I have this strong conviction that most humans are basically wired up to know a few people really well (your close family and friends), and I’ve tried to make the development model reflect that: with a ‘network of developers’, where people interact with maybe a dozen other people they trust, and those other people in turn interact with ‘their’ set of people they trust. + +So while I’m in occasional contact with hundreds of developers who send me a random patch or two, I’ve tried to set up an environment where the bulk of what I do happens through a much smaller set of people that I know, just because I think that’s how people work. It’s certainly how I like to work. + +Also, in all honesty, I don’t even know where a lot of the people I work with live. Location ends up being pretty secondary. So while I’m pretty sure that none of the top 10-15 I work with most closely, are in India, maybe after this goes public, it might get pointed out that there is actually somebody from there! + +**Q: Since the Linux Kernel Development depends so heavily on you, how do you plan to organise/reorganise it for it to continue progressing without you, in case you decide to dedicate more time to your own life and family?** + +Linus: I’ve long since come to the realisation that Linux is much bigger than me. Yes, I’m intimately involved in it still, and I have a fairly large day-to-day impact on it, and I end up being the person who, in some sense, acts as the central point for a lot of kernel activities; but no — I wouldn’t say that Linux ‘depends heavily’ on me. + +So if I had a heart attack and died tomorrow (happily not likely: I’m apparently healthy as anything), people would certainly notice, but there are thousands of people involved in just the kernel, and there’re more than a few that could take over for me with little real confusion. + +**Q: India is one of the major producers of software engineers, yet we don’t contribute much to the Linux domain. What do you think is keeping Indians from becoming proactive on that front? How do you feel we could encourage Indians to get involved and contribute heavily? You have a fan following in India; could your iconic image be used to inspire enthusiasts?** + +Linus: This is actually a very hard question for me to answer. Getting into open source is such a complicated combination of both infrastructure (Internet access, education, you name it), flow of information and simply culture that I can’t even begin to guess what the biggest stumbling block could be. + +In many ways, at least those with an English-speaking culture in India should have a rather easy time getting involved with Linux and other open source projects, if only thanks to the lack of a language barrier. Certainly much easier than many parts of Asia or even some parts of Europe. + +Of course, while that is a lot of people, it’s equally obviously not the majority in India, and I personally simply don’t know enough about the issues in India to be able to make an even half-way intelligent guess about what the best way forward is. I suspect that an enthusiastic local user community is always the best way, and I think you do have that. + +As to my ‘iconic image’, I tend to dislike that part personally. I’m not a great public speaker, and I’ve avoided travelling for the last several years because I’m not very comfortable being seen as this iconic ‘visionary’. I’m just an engineer, and I just happen to love doing what I do, and to work with other people in public. + +**Q: What would be a good reason for you to consider visiting India?** + +Linus: As mentioned in the first answer, I absolutely detest public speaking, so I tend to avoid conferences, etc. I’d love to go to India for a vacation some day, but if I do, I’d likely just do it incognito — not tell anybody beforehand and just go as a tourist to see the country! + +**Q: Recently, you seemed to slam Subversion and CVS, questioning their basic architecture. Now that you’ve got responses from the Subversion community, do you stand corrected, or are you still unconvinced?** + +Linus: I like making strong statements, because I find the discussion interesting. In other words, I actually tend to ‘like’ arguing. Not mindlessly, but I certainly tend to prefer the discussion a bit more heated, and not just entirely platonic. + +And making strong arguments occasionally ends up resulting in a very valid rebuttal, and then I’ll happily say: “Oh, ok, you’re right.” + +But no, that didn’t happen on SVN/CVS. I suspect a lot of people really don’t much like CVS, so I didn’t really even expect anybody to argue that CVS was really anything but a legacy system. And while I’ve gotten a few people who argued that I shouldn’t have been quite so impolite against SVN (and hey, that’s fair — I’m really not a very polite person!), I don’t think anybody actually argued that SVN was ‘good’. + +SVN is, I think, a classic case of ‘good enough’. It’s what people are used to, and it’s ‘good enough’ to be used fairly widely, but it’s good enough in exactly the sense DOS and Windows were ‘good enough’. Not great technology, just very widely available, and it works well enough for people and looks familiar enough that people use it. But very few people are ‘proud’ of it, or excited about it. + +Git, on the other hand, has some of the ‘UNIX philosophy’ behind it. Not that it is about UNIX, per se, but like original UNIX, it had a fundamental idea behind it. For UNIX, the underlying philosophy was/is that, “Everything is a file.” For git, it’s, Everything is just an object in the content-addressable database.” + +**Q: Is having so many distros a good or bad idea? Choice is fine, but one does not need to be pampered with choices. Instead of so many man hours being spent in building hundreds of distros, wouldn’t it be easier to get into the enterprise and take on the MS challenge if people could come together and support fewer distros (1 for each use maybe)? What’s your view on that?** + +Linus: I think having multiple distros is an inevitable part of open source. And can it be confusing? Sure. Can it be inefficient? Yes. But I’d just like to compare it to politics: ‘democracy’ has all those confusing choices, and often none of the choices is necessarily what you ‘really’ want either, and sometimes you might feel like things would be smoother and more efficient if you didn’t have to worry about the whole confusion of voting, different parties, coalitions, etc. + +But in the end, choice may be inefficient, but it’s also what keeps everybody involved at least ‘somewhat’ honest. We all probably wish our politicians were more honest than they are, and we all probably wish that the different distros sometimes made other choices than they do, but without that choice, we’d be worse off. + +**Q: Why do you think CFS is better than SD?** + +Linus: Part of it is that I have worked with Ingo [Molnar] for a long time, which means that I know him, and know that he’ll be very responsive to any issues that come up. That kind of thing is very important. + +But part of it is simply about numbers. Most people out there actually say that CFS is better than SD. Including, very much, on 3D games (which people claimed was a strong point of SD). + +At the same time, though, I don’t think any piece of code is ever ”perfect”. The best thing to happen is that the people who want to be proponents of SD will try to improve that so much that the balance tips over the other way — and we’ll keep both camps trying interesting things because the internal competition motivates them. + +**Q: In a talk you had at Google about git, someone asked you how you would take an extremely large code base that is currently handled with something centralised and transition to git without stopping business for six months. What was your response to that?** + +Linus: Ahh. That was the question where I couldn’t hear the questioner well (the questions were much more audible in the recordings), and I noticed afterwards, when I went back and listened to the recorded audio, that I didn’t answer the question he asked, but the question I thought he’d asked. + +Anyway, we do have lots of import tools, so that you can actually just import a large project from just about any other previous SCM into git. But the problem, of course, often doesn’t end up being the act of importing itself, but just having to ‘get used to’ the new model! + +And quite frankly, I don’t think there is any other answer to that ‘get used to it’ but to just start out and try it. You obviously do not want to start out by importing the biggest and most central project you have; that would indeed just make everything come to a standstill, and make everybody very unhappy indeed. + +So nobody sane would advocate moving everything over to git overnight, and forcing people to change their environment. No. You’d start with a smaller project inside a company, perhaps something that just one group mostly controls and maintains, and start off by converting that to git. That way you get people used to the model, and you start having a core group with the knowledge about how git works and how to use it within the company. + +And then you just extend on that. Not in one go. You’d import more and more of the projects — even if you have the ‘one big repository’ model at your company; you also almost certainly have that repository as a set of modules, because having everybody check out everything is just not a workable mode of operation (unless ‘everything’ is just not very large). + +So you’d basically migrate one module at a time, until you get to the point where you’re so comfortable with git that you can just migrate the rest (or the ‘rest’ is so legacy that nobody even cares). + +And one of the nice features of git is that it actually plays along pretty well with a lot of other SCMs. That’s how a lot of git users use it: ‘they’ may use git, but sometimes the people they work with don’t even realise, because they see the results of it propagated into some legacy SCM. + +**Q: Did they ever experiment with alternate instruction set implementations at Transmeta? [Transmeta Crusoe chip seemed like a very soft CPU — reminding one of Burroughs B1000 interpretive machine, which actually implemented multiple virtual machines. There was one for system software, another for Cobol, another for Fortran; If that is correct, then one could implement Burroughs 6/7000 or HP3000 like stack architecture on the chip or an instruction set suitable for JVM, etc]** + +Linus: We did indeed have some alternate instruction set, and while I still am not really supposed to talk about it, I can say that we did have a public demonstration of mixing instruction sets. We had a technology showcase where you could run x86 instructions side-by-side with Java byte code (actually, it was a slightly extended pico-java, iirc). + +I think the app we showed running was running DOOM on top of Linux, where the Linux parts were a totally standard x86 distribution, but the DOOM binary was a specially compiled version where part of the game was actually compiled pico-Java. And the CPU ended up running them both the same way — as a JIT down to the native VLIW instruction set. + +(The reason for picking DOOM was just that source code was available, and the core parts of the game were small enough that it was easy to set it up as a demonstration — and it was obviously visually interesting.) + +There were more things going on internally, but I can’t really talk about them. And I wasn’t actually personally involved with the Java one either. + +**Q: 386BSD, from which NetBSD, FreeBSD and OpenBSD were derived, was there well before Linux, but Linux spread much more than 386BSD and its derivatives. How much of this do you attribute to the choice of the licence and how much to the development process you chose? Don’t you think that the GPLv3 protects the freedom that has bred Linux better than the BSDs till now, more than the GPLv2 can?** + +Linus: I think there’s both a licence issue, and a community and personality issue. The BSD licences always encouraged forking, but also meant that if somebody gets really successful and makes a commercial fork, you cannot necessarily join back. And so even if that doesn’t actually happen (and it did, in the BSD cases — with BSDi), people can’t really ‘trust’ each other as much. + +In contrast, the GPLv2 also encourages forking, but it not only encourages the branching off part, it also encourages (and ‘requires’) the ability to merge back again. So now you have a whole new level of trust: you ‘know’ that everybody involved will be bound by the licence, and won’t try to take advantage of you. + +So I see the GPLv2 as the licence that allows people the maximum possible freedom within the requirement that you can always join back together again from either side. Nobody can stop you from taking the improvements to the source code. + +So is the BSD licence even more ‘free’? Yes. Unquestionably. But I just wouldn’t want to use the BSD licence for any project I care about, because I not only want the freedom, I also want the trust so that I can always use the code that others write for my projects. + +So to me, the GPLv2 ends up being a wonderful balance of ‘as free as you can make it’, considering that I do want everybody to be able to trust so that they can always get the source code and use it. + +Which is why I think the GPLv3 ends up being a much less interesting licence. It’s no longer about that trust about “getting the source code back”; it has degenerated into a “I wrote the code, so I should be able to control how you use it.” + +In other words, I just think the GPLv3 is too petty and selfish. I think the GPLv2 has a great balance between ‘freedom’ and ‘trust’. It’s not as free as the BSD licences are, but it gives you peace of mind in return, and matches what I consider ‘tit-for-tat': I give source code, you give me source code in return. + +The GPLv3 tries to control the ‘use’ of that source code. Now it’s, “I give you my source code, so if you use it, you’d better make your devices hackable by me.” See? Petty and small-minded, in my opinion. + +**Q: Slowly but steadily, features of the -rt tree are getting integrated into the mainline. What are your current thoughts regarding a merger of the remaining -rt tree into the mainline (and I’m not talking about the CFS)?** + +Linus: I won’t guarantee that everything from -rt will ‘ever’ be merged into the standard kernel (there may be pieces that simply don’t end up making sense in the generic kernel), but yes, over the years we’ve actually integrated most of it, and the remaining parts could end up making it one of these days. + +I’m a big fan of low-latency work, but at the same time I’m pretty conservative, and I pushed back on some of the more aggressive merging, just because I want to make sure that it all makes sense for not just some extreme real time perspective, but also for ‘normal’ users who don’t need it. And that explains why the process has been a pretty slow but steady trickle of code that has gotten merged, as it was sufficiently stable and made sense. + +That, by the way, is not just an -rt thing; it’s how a lot of the development happens. -rt just happens to be one of the more ‘directed’ kernel projects, and one where the main developer is pretty directly involved with the normal kernel too. But quite often the migration of other features (security, virtual memory changes, virtualisation, etc) follows a similar path: they get written up in a very targeted environment, and then pieces of the features get slowly but surely merged into the standard kernel. + +**Q: I’m very curious about what the future holds for file systems in the kernel. What do you think about Reiser4, XFS4, ZFS and the new project founded by Oracle? ZFS has been receiving a lot of press these days. Reiser4 delivers very good benchmarks, and xfs4 is trying to keep up, whereas the one by Oracle has a lot of the same specs as Sun’s ZFS. Where are we heading? Which FS looks the most promising in your opinion?** + +Linus: Actually, just yesterday we had a git performance issue, where ZFS was orders of magnitude slower than UFS for one user (not under Linux, but git is gaining a lot of traction even outside of kernel development). So I think a lot of the ‘new file system’ mania is partly fed by knowing about the issues with old file systems, and then the (somewhat unrealistic) expectation that a ‘new and improved’ file system will make everything perfect. + +In the end, this is one area where you just let people fight it out. See who comes out the winner — and it doesn’t need to be (and likely will not) be a single winner. Almost always, the right choice of file system ends up depending on the load and circumstances. + +One thing that I’m personally more excited about than any of the file systems you mention is actually the fact that Flash-based hard disks are quickly becoming available even for ‘normal’ users. Sure, they’re still expensive (and fairly small), but Flash-based storage has such a different performance profile from rotating media, that I suspect that it will end up having a large impact on file system design. Right now, most file systems tend to be designed with the latencies of rotating media in mind. + +**Q: The operating system is becoming less and less important. You have said several times that the user is not supposed to ‘see’ the operating system at all. It is the applications that matter. Browser-based applications, like Google’s basic office applications, are making an impact. Where do you think operating systems are headed?** + +Linus: I don’t really believe in the ‘browser OS’, because I think that people will always want to do some things locally. It might be about security, or simply about privacy reasons. And while connectivity is widely available, it certainly isn’t ‘everywhere’. + +So I think the whole ‘Web OS’ certainly is part of the truth, but another part that people seem to dismiss is that operating systems have been around for decades, and it’s really a fairly stable and well-known area of endeavour. People really shouldn’t expect the OS to magically change: it’s not like people were ‘stupid’ back in the 60s either, or even that hardware was ‘that’ fundamentally different back then! + +So don’t expect a revolution. I think OSs will largely continue to do what they do, and while we’ll certainly evolve, I don’t think they’ll change radically. What may change radically are the interfaces and the things you do on top of the OS (and certainly the hardware beneath the OS will continue to evolve too), and that’s what people obviously care about. + +The OS? It’s just that hidden thing that makes it all possible. You really shouldn’t care about it, unless you find it very interesting to know what is really going on in the machine. + +**Q: The last I heard, you were using a PPC G4/5 for your main personal machine — what are you using now, and why?** + +Linus: I ended up giving up on the PowerPC, since nobody is doing any workstations any more, and especially since x86-64 has become such an undeniable powerhouse. So these days, I run a bog-standard PC, with a normal Core 2 Duo on it. + +It was a lot of fun to run another architecture (I ran with alpha as my main architecture way back then, for a few years, so it wasn’t the first time either), but commodity CPUs is where it is at. The only thing that I think can really ever displace the x86 architecture would come from below, i.e., if something makes us not use x86 as our main ISA in a decade, I think it would be ARM, thanks to the mobile device market. + +**Q: What does Linux mean to you — a hobby, philosophy, the meaning of life, a job, the best OS, something else…?** + +Linus: It’s some of all of that. It’s a hobby, but a deeply meaningful one. The best hobbies are the ones that you care ‘really’ deeply about. And these days it’s obviously also my work, and I’m very happy to be able to combine it all. + +I don’t know about a ‘philosophy’, and I don’t really do Linux for any really deeply held moral or philosophical reasons (I literally do it because it’s interesting and fun), but it’s certainly the case that I have come to appreciate the deeper reasons why I think open source works so well. So I may not have started to do Linux for any such deep reasons, and I cannot honestly say that that is what motivates me, but I do end up thinking about why it all works. + +**Q: Did Microsoft’s ‘Men in Black’ ever talk to you?** + +Linus: I’ve never really talked to MS, no. I’ve occasionally been at the same conferences with some MS people (I used to go to more conferences than I do these days), but I’ve never really had anything to do with them. I think there is a mutual wariness. + +-------------------------------------------------------------------------------- + +via: http://www.linuxveda.com/2015/06/17/what-happens-to-linux-after-linus/ + +作者:[Swapnil Bhartiya][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.linuxveda.com/author/arnieswap/ \ No newline at end of file From 914e800ce23ffce018f9c8e047d9fe8c9459bc46 Mon Sep 17 00:00:00 2001 From: DeadFire Date: Thu, 18 Jun 2015 15:46:48 +0800 Subject: [PATCH 423/965] =?UTF-8?q?20150618-2=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... on Ubuntu 15.04 with Different Methods.md | 263 ++++++++++++++++++ 1 file changed, 263 insertions(+) create mode 100644 sources/tech/20150618 How to Setup Node.JS on Ubuntu 15.04 with Different Methods.md diff --git a/sources/tech/20150618 How to Setup Node.JS on Ubuntu 15.04 with Different Methods.md b/sources/tech/20150618 How to Setup Node.JS on Ubuntu 15.04 with Different Methods.md new file mode 100644 index 0000000000..85fd9d3312 --- /dev/null +++ b/sources/tech/20150618 How to Setup Node.JS on Ubuntu 15.04 with Different Methods.md @@ -0,0 +1,263 @@ +How to Setup Node.JS on Ubuntu 15.04 with Different Methods +================================================================================ +This is such an important article to guide you about the installation and setup of Node.js on Ubuntu 15.04. Node.js is basically a server side java script programming to provide you bindings for enabling the input and output socket bios and streams. It has a high through put and non-blocking IO in a single threaded event loop. It’s also a platform layer that provides the functionality to interact with the Operating system to write file, read files and to do networking operations. So in this article we will perform different installation methods to setup Node.Js on Ubuntu 15.04 server. + +### Methods to Install Node.JS ### + +Their are different ways to install Node.Js and we can prefer to choose any one. Following are some important ways to install Node.Js that we will use to guide you about their each setup on Ubuntu 15.04 so make sure to remove the previous previous packages to avoid from any package conflict. + +- Installation of Node.JS from Source Code +- Installation of Node.JS from Package Manager +- Installation of Node.JS from Github Repository +- Installation of Node.JS with NVM + +### 1) Installing from Source Code ### + +Let's start with installation of Node.JS from the Source Code, so make sure that your system is up to date and dependent packages are pre installed. So follow the below steps and start the setup. + +#### STEP 1: System Update #### + +Use following commands and update Operating system and ten install the required packages are necessary for Node.JS setup. + + root@ubuntu-15:~# apt-get update + + root@ubuntu-15:~# apt-get install python gcc make g++ + +#### STEP 2: Get Source Code of Node.JS #### + +After we had installed the dependent packages now from the official web link of Node.JS just download its source code package and extract it as in following commands. + + root@ubuntu-15:~# wget http://nodejs.org/dist/v0.12.4/node-v0.12.4.tar.gz + root@ubuntu-15:~# tar zxvf node-v0.12.4.tar.gz + +#### STEP 3: Starting Installation #### + +Now move to the source code directory and execute the .configuration file + +![NodeJS Configure](http://blog.linoxide.com/wp-content/uploads/2015/06/13.png) + + root@ubuntu-15:~# ls + node-v0.12.4 node-v0.12.4.tar.gz + root@ubuntu-15:~# cd node-v0.12.4/ + root@ubuntu-15:~/node-v0.12.4# ./configure + root@ubuntu-15:~/node-v0.12.4# make install + +### Testing after Installation of Node.Js from Source Code ### + +Once the installation is done after running make installa command, we check its version and test that Node.Js is working fine by executing some test out puts. + + root@ubuntu-15:~/node-v0.12.4# node -v + v0.12.4 + +![Node.Js Test](http://blog.linoxide.com/wp-content/uploads/2015/06/21.png) + +Create a new file with .js extension execute it with Node command. + + root@ubuntu-15:~/node-v0.12.4# touch helo_test.js + root@ubuntu-15:~/node-v0.12.4# vim helo_test.js + console.log('Hello World'); + +Now execute it with Node command. + + root@ubuntu-15:~/node-v0.12.4# node helo_test.js + Hello World + +The out put shows that we had successfully installed Node.JS on Ubuntu 15.04 which is now ready to create applications on it using java scripts. + +### 2) Installing from Package Manager ### + +The installation of Node.JS through Package Manager is also a very simple process to setup on Ubuntu through NodeSource by adding its Personal Package Archives (PPA). + +We will go through the following steps to install Node.JS through PPA. + +#### STEP 1: Get the Source Code using Curl #### + +Before getting the source code by using the Curl command we must update our system and then run the curl command to fetch the NodeSource into local repository. + + root@ubuntu-15:~#apt-get update + root@ubuntu-15:~# curl -sL https://deb.nodesource.com/setup | sudo bash - + +The curl will execute the following tasks. + + ## Installing the NodeSource Node.js 0.10 repo... + ## Populating apt-get cache... + ## Confirming "vivid" is supported... + ## Adding the NodeSource signing key to your keyring... + ## Creating apt sources list file for the NodeSource Node.js 0.10 repo... + ## Running `apt-get update` for you... + Fetched 6,411 B in 5s (1,077 B/s) + Reading package lists... Done + ## Run `apt-get install nodejs` (as root) to install Node.js 0.10 and npm + +#### STEP 2: Installation of NodeJS and NPM #### + +As per the output of Curl we had fetched the NodeSource to our local repository now through apt-get commands we will install the NodeJS and NPM packages. + + root@ubuntu-15:~# apt-get install nodejs + +![NodeJS Install](http://blog.linoxide.com/wp-content/uploads/2015/06/31.png) + +#### STEP 3: Installing Build Essentials Tool #### + +To compile and install native addons from npm we may also need to install build tools using following command as. + + root@ubuntu-15:~# apt-get install -y build-essential + +### Testing With Node.JS Shell ### + +Testing of Node.Js is similar to the one that we did after installation from the source Code. +so lets start with the node command as follow and get its output result to see if Node.JS is fully functional. + + root@ubuntu-15:~# node + > console.log('Node.js Installed Using Package Manager'); + Node.js Installed Using Package Manager + +---------- + + root@ubuntu-15:~# node + > a = [1,2,3,4,5] + [ 1, 2, 3, 4, 5 ] + > typeof a + 'object' + > 5 + 2 + 7 + > + (^C again to quit) + > + root@ubuntu-15:~# + +### REPL For Your NodeJS Apps ### + +REPL is the Node.js shell, any valid Javascript which can be written in a script can be passed to the REPL. So lets see how REPL works with NodeJS. + + root@ubuntu-15:~# node + > var repl = require("repl"); + undefined + > repl.start("> "); + + Press Enter and it will show out put like this: + > { domain: null, + _events: {}, + _maxListeners: 10, + useGlobal: false, + ignoreUndefined: false, + eval: [Function], + inputStream: + { _connecting: false, + _handle: + { fd: 0, + writeQueueSize: 0, + owner: [Circular], + onread: [Function: onread], + reading: true }, + _readableState: + { highWaterMark: 0, + buffer: [], + length: 0, + pipes: null, + ... + ... + +Here is the list of command line help that we can use to work with REPL. + +![REPL Manual](http://blog.linoxide.com/wp-content/uploads/2015/06/4.png) + +### Working with NodeJS Packet Manager ### + +NPM is simple CLI tool for ensuring that a given node script runs continuously. It helps to Install and manage dependencies through the file package.json. We will start its using init command as. + + root@ubuntu-15:~# npm init + +![NPM starting](http://blog.linoxide.com/wp-content/uploads/2015/06/51.png) + +### 3) Installing from Github Repository ### + +In this method to install Node.JS we will consider few simple steps to directory clone the Node.JS repository from the github. + +Before the start of configurations through the the cloned package of Node.JS make sure that we must have following dependent packages installed with us. + + root@ubuntu-15:~# apt-get install g++ curl make libssl-dev apache2-utils git-core + +Now start the clone with git command and change the directory to its configuration file. + + root@ubuntu-15:~# git clone git://github.com/ry/node.git + root@ubuntu-15:~# cd node/ + +![Git Clone NodeJS](http://blog.linoxide.com/wp-content/uploads/2015/06/61.png) + +To install from the cloned repository now lets run the .config command and then make install to complete the setup of Node.Js . + + root@ubuntu-15:~# ./configure + +![Configure Node](http://blog.linoxide.com/wp-content/uploads/2015/06/7.png) + +Run the make install command that will takes few minutes so be patient and get it ready finalize the setup on Node.JS package for you. + + root@ubuntu-15:~/node# make install + + root@ubuntu-15:~/node# node -v + v0.13.0-pre + +### Testing with Node.JS ### + + root@ubuntu-15:~/node# node + > a = [1,2,3,4,5,6,7] + [ 1, 2, 3, 4, 5, 6, 7 ] + > typeof a + 'object' + > 6 + 5 + 11 + > + (^C again to quit) + > + root@ubuntu-15:~/node# + +### 4) Installing Node.JS Using Node Version Manager ### + +In this last method we show you we can easily install Node.JS with NVM method. This is one of the best method to install and configure Node.JS it provides us with facility to control versions. + +So before starting with this method make sure that the previously installed package is not already present there if you are working on the same machine. + +#### STEP 1: Installing Prerequisites #### + +Let's start with the system update and then install the following prerequisites for the Ubuntu Server to setup Node.JS using NodeJS Versions Manager System. Using the Curl command we will get NVM from the git to our local repository. + + root@ubuntu-15:~# apt-get install build-essential libssl-dev + root@ubuntu-15:~# curl https://raw.githubusercontent.com/creationix/nvm/v0.16.1/install.sh | sh + +![NVM Curl](http://blog.linoxide.com/wp-content/uploads/2015/06/81.png) + +#### STEP 2: Update Home Environment #### + +After the curl command downloads the necessary packages for the NVM in the home directory of the user it also make changes to the bash profile. so in order to update those change and get access to NVM we must relogin to the terminal or we can update it using the source command as below. + + root@ubuntu-15:~# source ~/.profile + +Now we can use the NVM to choose the default NVM version or by moving to the previous version of NVM that we can do so by using the following commands. + + root@ubuntu-15:~# nvm ls + root@ubuntu-15:~# nvm alias default 0.12.4 + +![NVM Default](http://blog.linoxide.com/wp-content/uploads/2015/06/91.png) + +#### STEP 3: Using NodeJS Versions Manager #### + +We have successfully setup the NodeJS with NVM package and now can use it with its useful commands. + +![NVM Manual](http://blog.linoxide.com/wp-content/uploads/2015/06/101.png) + +### CONCLUSION ### + +Now we are ready to go with building server side applications with Node.JS and you are free to choose the best installation setup of your choice as we had done with four optional installations of Node.Js on the latest version of Ubuntu 15.04 with priority installation sequence, now its up to you to follow the one of your own choice and start coding with NodeJS. + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/ubuntu-how-to/setup-node-js-ubuntu-15-04-different-methods/ + +作者:[Kashif Siddique][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://linoxide.com/author/kashifs/ \ No newline at end of file From 3af50c80dd032b61c1e50273e763eba5ba823e70 Mon Sep 17 00:00:00 2001 From: NearTan Date: Thu, 18 Jun 2015 20:35:04 +0800 Subject: [PATCH 424/965] translating --- ...w to Setup Node.JS on Ubuntu 15.04 with Different Methods.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20150618 How to Setup Node.JS on Ubuntu 15.04 with Different Methods.md b/sources/tech/20150618 How to Setup Node.JS on Ubuntu 15.04 with Different Methods.md index 85fd9d3312..83b08328e0 100644 --- a/sources/tech/20150618 How to Setup Node.JS on Ubuntu 15.04 with Different Methods.md +++ b/sources/tech/20150618 How to Setup Node.JS on Ubuntu 15.04 with Different Methods.md @@ -1,3 +1,5 @@ +translating by NearTan + How to Setup Node.JS on Ubuntu 15.04 with Different Methods ================================================================================ This is such an important article to guide you about the installation and setup of Node.js on Ubuntu 15.04. Node.js is basically a server side java script programming to provide you bindings for enabling the input and output socket bios and streams. It has a high through put and non-blocking IO in a single threaded event loop. It’s also a platform layer that provides the functionality to interact with the Operating system to write file, read files and to do networking operations. So in this article we will perform different installation methods to setup Node.Js on Ubuntu 15.04 server. From 5fac86010f7d43f160bb7baa7f8757d708661e5a Mon Sep 17 00:00:00 2001 From: ZTinoZ Date: Fri, 19 Jun 2015 12:28:52 +0800 Subject: [PATCH 425/965] Translating by ZTinoZ --- ...526 20 Useful Terminal Emulators for Linux.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/sources/tech/20150526 20 Useful Terminal Emulators for Linux.md b/sources/tech/20150526 20 Useful Terminal Emulators for Linux.md index 9b6db95726..42a6137296 100644 --- a/sources/tech/20150526 20 Useful Terminal Emulators for Linux.md +++ b/sources/tech/20150526 20 Useful Terminal Emulators for Linux.md @@ -231,14 +231,14 @@ xterm Terminal ### 18. LilyTerm ### -The LilyTerm is a another less known open source terminal emulator based off of libvte that desire to be fast and lightweight. LilyTerm also include some key features such as: +LilyTerm是一款基于libvte的开源终端仿真器,这款不太出名的仿真器追求的是快速和轻量级。LilyTerm也包括一些关键特性: -- Support for tabbing, coloring and reordering tabs -- Ability to manage tabs through keybindings -- Support for background transparency and saturation. -- Support for user specific profile creation. -- Several customization options for profiles. -- Extensive UTF-8 support. +- 支持标签移动、着色以及标签重新排序 +- 通过快捷键管理标签 +- 支持背景透明化和饱和度调整 +- 支持为特定用户创建配置文件 +- 若干个自定义选项 +- 广泛支持UTF-8 ![Lilyterm Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/Lilyterm.jpg) @@ -248,7 +248,7 @@ Lilyterm Terminal ### 19. Sakura ### -The sakura is a another less known Unix style terminal emulator developed for command line purpose as well as text-based terminal programs. Sakura is based on GTK and livte and provides not more advanced features but some customization options such as multiple tab support, custom text color, font and background images, speedy command processing and few more. +Sakura是另一款不知名的Unix风格终端仿真器,按照命令行模式和基于文本的终端程序开发。Sakura基于GTK和livte,自身特性不多,不过还是有一些自定义选项比如多标签支持、自定义文本颜色、字体和背景图片、快速命令处理等等。 ![Sakura Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/sakura.jpg) From 0c9966c5c3ec45b881346d196d6f7488cd0f0a2d Mon Sep 17 00:00:00 2001 From: wi-cuckoo Date: Fri, 19 Jun 2015 13:49:40 +0800 Subject: [PATCH 426/965] translated wi-cuckoo --- ...P at 20--From pet project to powerhouse.md | 83 ------------------- ...P at 20--From pet project to powerhouse.md | 81 ++++++++++++++++++ 2 files changed, 81 insertions(+), 83 deletions(-) delete mode 100644 sources/talk/20150615 PHP at 20--From pet project to powerhouse.md create mode 100644 translated/talk/20150615 PHP at 20--From pet project to powerhouse.md diff --git a/sources/talk/20150615 PHP at 20--From pet project to powerhouse.md b/sources/talk/20150615 PHP at 20--From pet project to powerhouse.md deleted file mode 100644 index 7ddbf950a9..0000000000 --- a/sources/talk/20150615 PHP at 20--From pet project to powerhouse.md +++ /dev/null @@ -1,83 +0,0 @@ -translating wi-cuckoo -PHP at 20: From pet project to powerhouse -================================================================================ -![](http://images.techhive.com/images/article/2015/06/13049862325_8c97a11878_z-100590275-primary.idge.jpg) - -Credit: [Steve Jurvetson via Flickr][1] - -> The one-time ‘silly little project’ has transformed into a Web powerhouse, thanks to flexibility, pragmatism, and a vibrant community of Web devs - -When Rasmus Lerdorf released “[a set of small tight CGI binaries written in C][2],” he had no idea how much his creation would impact Web development. Delivering the opening keynote at this year’s SunshinePHP conference in Miami, Lerdorf quipped, “In 1995, I thought I had unleashed a C API upon the Web. Obviously, that’s not what happened, or we’d all be C programmers.” - -In fact, when Lerdorf released version 1.0 of Personal Home Page Tools -- as PHP was then known -- the Web was very young. HTML 2.0 would not be published until November of that year, and HTTP/1.0 not until May the following year. NCSA HTTPd was the most widely deployed Web server, and Netscape Navigator was the most popular Web browser, with Internet Explorer 1.0 to arrive in August. In other words, PHP’s beginnings coincided with the eve of the browser wars. - -Those early days speak volumes about PHP’s impact on Web development. Back then, our options were limited when it came to server-side processing for Web apps. PHP stepped in to fill our need for a tool that would enable us to do dynamic things on the Web. That practical flexibility captured our imaginations, and PHP has since grown up with the Web. Now powering [more than 80 percent of the Web][3], PHP has matured into a scripting language that is especially suited to solve the Web problem. Its unique pedigree tells a story of pragmatism over theory and problem solving over purity. - -### The Web glue we got hooked on ### - -PHP didn’t start out as a language, and this is clear from its design -- or lack thereof, as detractors point out. It began as an API to help Web developers access lower-level C libraries. The first version was a small CGI binary that provided form-processing functionality with access to request parameters and the mSQL database. And its facility with a Web app’s database would prove key in sparking our interest in PHP and PHP’s subsequent ascendancy. - -By version 2 -- aka PHP/FI -- database support had expanded to include PostgreSQL, MySQL, Oracle, Sybase, and more. It supported these databases by wrapping their C libraries, making them a part of the PHP binary. PHP/FI could also wrap the GD library to create and manipulate GIF images. It could be run as an Apache module or compiled with FastCGI support, and it introduced the PHP script language with support for variables, arrays, language constructs, and functions. For many of us working on the Web at that time, PHP was the kind of glue we'd been looking for. - -As PHP folded in more and more programming language features, morphing into version 3 and onward, it never lost this gluelike aspect. Through repositories like PECL (PHP Extension Community Library), PHP could tie together libraries and expose their functionality to the PHP layer. This capacity to bring together components became a significant facet of the beauty of PHP, though it was not limited to its source code. - -### The Web as a community of coders ### - -PHP’s lasting impact on Web development isn’t limited to what can be done with the language itself. How PHP work is done and who participates -- these too are important parts of PHP’s legacy. - -As early as 1997, PHP user groups began forming. One of the earliest was the Midwest PHP User’s Group (later known as Chicago PHP), which held its [first meeting in February 1997][4]. This was the beginning of what would become a vibrant, energetic community of developers assembled over an affinity for a little tool that helped them solve problems on the Web. The ubiquity of PHP made it a natural choice for Web development. It became especially popular in the shared hosting world, and its low barrier to entry was attractive to many early Web developers. - -With a growing community came an assortment of tools and resources for PHP developers. The year 2000 -- a watershed moment for PHP -- witnessed the first PHP Developers’ Meeting, a gathering of the core developers of the programming language, who met in Tel Aviv to discuss the forthcoming 4.0 release. PHP Extension and Application Repository (PEAR) also launched in 2000 to provide high-quality userland code packages following standards and best practices. The first PHP conference, PHP Kongress, was held in Germany soon after. [PHPDeveloper.org][5] came online, and to this day, it is the most authoritative news source in the PHP community. - -This communal momentum proved vital to PHP’s growth in subsequent years, and as the Web development industry erupted, so did PHP. PHP began powering more and larger websites. More user groups formed around the world. Mailing lists; online forums; IRC; conferences; trade journals such as php[architect], the German PHP Magazin, and International PHP Magazine -- the vibrancy of the PHP community had a significant impact on the way Web work would be done: collectively and openly, with an emphasis on code sharing. - -Then, 10 years ago, shortly after the release of PHP 5, an interesting thing happened in Web development that created a general shift in how the PHP community built libraries and applications: Ruby on Rails was released. - -### The rise of frameworks ### - -The Ruby on Rails framework for the Ruby programming language created an increased focus and attention on the MVC (model-view-controller) architectural pattern. The Mojavi PHP framework a few years prior had used this pattern, but the hype around Ruby on Rails is what firmly cemented MVC in the PHP frameworks that followed. Frameworks exploded in the PHP community, and frameworks have changed the way developers build PHP applications. - -Many important projects and developments have arisen, thanks to the proliferation of frameworks in the PHP community. The PHP [Framework Interoperability Group][6] formed in 2009 to aid in establishing coding standards, naming conventions, and best practices among frameworks. Codifying these standards and practices helped provide more interoperable software for developers using member projects’ code. This interoperability meant that each framework could be split into components and stand-alone libraries could be used together with monolithic frameworks. With interoperability came another important milestone: The Composer project was born in 2011. - -Inspired by Node.js’s NPM and Ruby’s Bundler, Composer has ushered in a new era of PHP application development, creating a PHP renaissance of sorts. It has encouraged interoperability between packages, standard naming conventions, adoption of coding standards, and increased test coverage. It is an essential tool in any modern PHP application. - -### The need for speed and innovation ### - -Today, the PHP community has a thriving ecosystem of applications and libraries. Some of the most widely installed PHP applications include WordPress, Drupal, Joomla, and MediaWiki. These applications power the Web presence of businesses of all sizes, from small mom-and-pop shops to sites like whitehouse.gov and Wikipedia. Six of the Alexa top 10 sites use PHP to serve billions of pages a day. As a result, PHP applications have been optimized for speed -- and much innovation has gone into PHP core to improve performance. - -In 2010, Facebook unveiled its HipHop for PHP source-to-source compiler, which translates PHP code into C++ code and compiles it into a single executable binary application. Facebook’s size and growth necessitated the move away from standard interpreted PHP code to a faster, optimized executable. However, Facebook wanted to continue using PHP for its ease of use and rapid development cycles. HipHop for PHP evolved into HHVM, a JIT (just-in-time) compilation-based execution engine for PHP, which included a new language based on PHP: [Hack][7]. - -Facebook’s innovations, as well as other VM projects, created competition at the engine level, leading to discussions about the future of the Zend Engine that still powers PHP’s core, as well as the question of a language specification. In 2014, a language specification project was created “to provide a complete and concise definition of the syntax and semantics of the PHP language,” making it possible for compiler projects to create interoperable PHP implementations. - -The next major version of PHP became a topic of intense debate, and a project known as phpng (next generation) was offered as an option to clean up, refactor, optimize, and improve the PHP code base, which also showed substantial improvements to the performance of real-world applications. After deciding to name the next major version “PHP 7,” due to a previous, unreleased PHP 6.0 version, the phpng branch was merged in, and plans were made to proceed with PHP 7, working in many of the language features offered by Hack, such as scalar and return type hinting. - -With the [first PHP 7 alpha release due out today][8] and benchmarks showing [performance as good as or better than that of HHVM][9] in many cases, PHP is keeping up with the pace of modern Web development needs. Likewise, the PHP-FIG continues to innovate and push frameworks and libraries to collaborate and cooperate -- most recently with the adoption of [PSR-7][10], which will change the way PHP projects handle HTTP. User groups, conferences, publications, and initiatives like [PHPMentoring.org][11] continue to advocate best practices, coding standards, and testing to the PHP developer community. - -PHP has seen the Web mature through various stages, and PHP has matured. Once a simple API wrapper around lower-level C libraries, PHP has become a full-fledged programming language in its own right. Its developer community is vibrant and helpful, priding themselves in pragmatism and welcoming newcomers. PHP has stood the test of time for 20 years, and current activity in the language and community is ensuring it will be a relevant and useful language for years to come. - -During his SunshinePHP keynote, Rasmus Lerdorf reflected, “Did I think I’d be here 20 years later talking about this silly little project I did? No, I didn’t.” - -Here’s to Lerdorf and the rest of the PHP community for transforming this “silly little project” into a lasting, powerful component of the Web today. - --------------------------------------------------------------------------------- - -via: http://www.infoworld.com/article/2933858/php/php-at-20-from-pet-project-to-powerhouse.html - -作者:[Ben Ramsey][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.infoworld.com/author/Ben-Ramsey/ -[1]:https://www.flickr.com/photos/jurvetson/13049862325 -[2]:https://groups.google.com/d/msg/comp.infosystems.www.authoring.cgi/PyJ25gZ6z7A/M9FkTUVDfcwJ -[3]:http://w3techs.com/technologies/overview/programming_language/all -[4]:http://web.archive.org/web/20061215165756/http://chiphpug.php.net/mpug.htm -[5]:http://www.phpdeveloper.org/ -[6]:http://www.php-fig.org/ -[7]:http://www.infoworld.com/article/2610885/facebook-q-a--hack-brings-static-typing-to-php-world.html -[8]:https://wiki.php.net/todo/php70#timetable -[9]:http://talks.php.net/velocity15 -[10]:http://www.php-fig.org/psr/psr-7/ -[11]:http://phpmentoring.org/ diff --git a/translated/talk/20150615 PHP at 20--From pet project to powerhouse.md b/translated/talk/20150615 PHP at 20--From pet project to powerhouse.md new file mode 100644 index 0000000000..2dd4765a42 --- /dev/null +++ b/translated/talk/20150615 PHP at 20--From pet project to powerhouse.md @@ -0,0 +1,81 @@ +PHP 20岁了:从兴趣工程到强大的组织 +============================================================================= +![](http://images.techhive.com/images/article/2015/06/13049862325_8c97a11878_z-100590275-primary.idge.jpg) + +信任: [Steve Jurvetson via Flickr][1] + +> 曾经的‘丑小鸭工程’已经转变为一个网络世界的强大组织,感谢网络世界的灵活,实用与充满生气的社区 + +当Rasmus Lerdorf发布“[一个用C写的紧凑的CGI可执行程序集合][2],” 他没有想到他的创造会对网络发展产生多大的影响。今年在Miami举行的SunshinePHP大会上,Lerdorf做了开场演讲,他自嘲到,“在1995年的时候,我以为我已经解除了C API的束缚,在网络之上。显然,事情并非那样,或者我们都已经是C程序员了。” + +实际上,当Lerdorf发布个人主页工具 -- 后来以PHP闻名的1.0版本时 -- 那时的网络还是如此的年轻。HTML 2.0还没有公布,直到那年的十一月份,而且HTTP/1.0也是次年的五月份才出现。NCSA HTTPd是使用最广泛的网络浏览器,而网景的Navigator则是最流行的网络浏览器,八月份的时候,IE1.0才到来。换句话说,PHP的开端刚好撞上了浏览器战争的前夜。 + +早些时候,说了大堆关于PHP对网络发展的影响。回到那时候,我们的选择是有限的,当说到服务器方面对于网络软件的进展。PHP满足了我们对于一个工具的需求,就是可以使得我们在网络上做一些动态的事情。实用的灵活性束缚了我们的想像,PHP从那时起便与网络共同成长。现在,PHP占据了网络语言超过80%的份额,已经是成熟的脚本语言,特别适合解决网络问题。她独一无二的血统讲述一个故事,实用高于理论,解决问题高于纯粹。 + +### 把我们钩住的网络魔力 ### + +PHP一开始并不是一门编程语言,从她的设计就很明星 -- 或者她本来就缺,正如那些贬低者指出的那样。最初,她是作为一种API帮助网络开发者能够接入底层的C语言封装库。第一个版本是一组小的CGI可执行程序,提供表单处理功能,通过接入需要的参数和mSQL数据库。而且她如此容易地处理一个网络应用的数据库,证明了其在激发我们对于PHP的兴趣和PHP后来的支配地位的关键作用。 + +到了第二版 -- aka PHP/FI -- 数据库的支持已经扩展到包括PostgreSQL、MySQL、Oracle、Sybase等等。她通过包括他们的C语言库来支持其数据库,将他们作为PHP库的一部分。PHP/FI也可以包括GD库,创建并管理GIF镜像。她可以作为一个Apache模块运行,或者有FastCGI支持的时候被编译,并且她展示了支持变量,数组,语言结构和函数的PHP脚本语言。对于那个时候大多数在网络这块工作的人来说,PHP是我们一直在寻求的那款“胶水”。 + +当PHP吸纳越来越多的编程语言分支,演变为第三版和之后的版本,她从来没有失去连接的特性。通过仓库如PECL(PHP Extension Community Library),PHP可以把库都连在一起,暴露他们的函数给PHP层。这种将组件结合在一起的能力,成为PHP之美的一个重要方面,尽管她没有被限制在其资源代码上。 + +### 网络,一个码农们的社区 ### + +PHP在网络发展上的持续影响并不局限于能用这种语言干什么。PHP如何完成工作,谁参与近进来 -- 这些都是PHP传奇很重要的部分。 + +早在1997年,PHP的用户群体开始形成。其中最早的是中东的PHP用户群(后来以Chiago PHP闻名),并[1997年二月份的时候举行了第一次聚会][4]。这是一个充满生气,饱含激情的开发者社区形成的开端,聚合成一种吸引力 -- 在网络上很少的工具就可以帮助他们解决问题。PHP这种普遍存在的特性使得她成为网络开发一个很自然的选择。在分享主导的世界里,她开始盛行,而且低入的门槛对于许多早期的网络开发者来说是十分有吸引力的。 + +伴随着社区的成长,为开发者带来了一堆工具和资源。这一年2000年 -- PHP的一个转折点 -- 见证了第一次PHP开发者大会,编程语言的核心开发者的一次聚集,在Tel Aviv见面,讨论即将到来的4.0版本的发布。PHP扩展和应用仓库(PEAR)也于2000发起,提供高质量的用户代码包,根据标准且最好的操作。第一届PHP大会,PHP Kongress,不久之后在德国举行。[PHPDeveloper.org][5]随后上线,直到今天。这是在PHP社区里最权威的新闻资源。 + +这种公社的势头(有待校正)证明了接下来几年里PHP成长的关键所在,且随着网络开发产业的爆发,PHP也获得发展。PHP开始占领更多,更大的网站。越来越多的用户群在世界范围内形成。邮件列表;在线论坛;IRC;大会;交易日记如php[架构],德国PHP杂志,国际PHP杂志 -- PHP社区的活力在完成网络工作的方式上有极其重要的影响:共同地,开放地,倡导代码共享。 + +然后,10年前,PHP 5发布后不久,在网络发展史上一个有趣地事情发生了,导致了PHP社区如何构建库和应用的转变:Ruby on Rails发布了。 + +### 框架的异军突起 ### + +针对Ruby编程语言的Ruby on Rails,在MVC(模型-视图-控制)架构模型上获得了不断增长的焦点与关注。Mojavi PHP框架几年前已经使用该模型了,但是Ruby on Rails的高明之处在于巩固了MVC。框架在PHP社区炸开了,并且框架已经改变了开发者构建PHP应用程序的方式。 + +许多重要的项目和发展已经起势,这归功于PHP社区框架的生长。PHP[框架互用性组织][6]成立于2009年,致力于在框架间建立编码标准,命名约定与最佳操作。编纂这些标准和操作帮助为开发者提供了越来越多的互动性软件,使用成员项目的代码。互用性意味着每个框架可以拆分为组块和独立的库,可以被一起使用作为整体的框架。互用性带来了另一个重要的里程碑:Composer项目于2011年诞生了。 + +从Node.js的NPM和Ruby的Bundler获得灵感,Composer开辟了PHP应用开发的新纪元,创造了一次PHP“文艺复兴”。它激起了包,标准命名约定,编码标准的采用与成长中的覆盖测试间的互用性。它是任何现代PHP应用中的一个基本工具。 + +### 加速和创新的需要 ### + +如今,PHP社区有一个生机勃勃应用和库的生态系统,一些被广泛安装的PHP应用包括WordPress,Drupal,Joomla和MediaWiki。这些应用占据了所有规模的商业的网络形式,从小型的夫妻店到站点如whitehouse.gov和Wikipeida。Alexa前十的站点中,6个使用PHP在一天内服务数十亿的页面。结果,PHP应用已成加速需要的首选 -- 并且许多创新也加入到PHP的核心来提升表现。 + +在2010年,Facebook公开了其用作PHP源对源的编译器的HipHop,翻译PHP代码为C++代码,并且编译为一个单独的可执行二进制应用。Facebook的规模和成长需要从标准互用的PHP代码迁移到更快,最佳的可执行的代码。尽管如此,Facebook想继续使用PHP,由于PHP的易用和快速开发周期。HipHop进化为HHVM,一个针对PHP的JIT(just-in-time)编译基础的执行引擎,其包含一个基于PHP的新的语言:[Hack][7]。 + +Facebook的创新,和其他的VM项目,创建了在引擎水平上的比较,引起了关于Zend引擎未来的讨论。Zend引擎依然占据PHP和一种语言表述的问题的核心。在2004年,一个语言表述项目被创建,“为提供一个完整的,简明的语句定义,和PHP语言的语义学,”使得对编译器项目来说,创建共用的PHP实现成为可能。 + +下一个PHP的主要版本成为了激烈争论的话题,一个著名的pgpng项目(下一代)作为一个能清理,重构,优化和提升PHP代码基础的选项被提出来,这也展示了对真实世界应用的性能的实质上的提升。由于之前未发布的PHP 6.0版本,在决定命名下一个主要版本为“PHP 7”后,phpng分支被合并了,并制定了计划开发PHP 7,Hack提供了很多语言中拥有的功能,如scalar和返回键入提示。 + +随着[今天第一版PHP 7 alpha发布][8],标准检测程序显示在许多方面[与HHVM的一样或者更好的性能][9],PHP正与现代网络开发需求保持一致的步伐。同样地,PHP-FIG继续创新和推送框架与库用于协作 -- 最近由于[PSR-7][10]的采纳,这将会改变PHP项目处理HTTP的方式。用户组,会议,公众和积极性如[PHPMentoring.org][11]继续在PHP开发者社区提倡最好的操作,编码标准和测试 + +PHP从各个方面见证了网络的成熟,而且PHP自己也成熟了。曾经一个单一的低层次的C语言库的API包装,PHP以她自己的方式,已经成为一个羽翼丰满的编程语言。她的开发者社区是一个充满生气,乐于帮助,在实用方面以自己为傲,并且欢迎新入者的地方。PHP已经经受了20年的考验,而且目前在语言与社区里活跃性,会保证她将会是一个中肯的,有用的的语言,在接下来的几年里。 + +他的SunshinePHP的关键发言中,Rasmus Lerdorf回忆到,“我曾想过我会在20年之后与我当初做的这个愚蠢的小项目交流吗?没有。” + +-------------------------------------------------------------------------------- + +via: http://www.infoworld.com/article/2933858/php/php-at-20-from-pet-project-to-powerhouse.html + +作者:[Ben Ramsey][a] +译者:[wi-cuckoo](https://github.com/wi-cuckoo) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.infoworld.com/author/Ben-Ramsey/ +[1]:https://www.flickr.com/photos/jurvetson/13049862325 +[2]:https://groups.google.com/d/msg/comp.infosystems.www.authoring.cgi/PyJ25gZ6z7A/M9FkTUVDfcwJ +[3]:http://w3techs.com/technologies/overview/programming_language/all +[4]:http://web.archive.org/web/20061215165756/http://chiphpug.php.net/mpug.htm +[5]:http://www.phpdeveloper.org/ +[6]:http://www.php-fig.org/ +[7]:http://www.infoworld.com/article/2610885/facebook-q-a--hack-brings-static-typing-to-php-world.html +[8]:https://wiki.php.net/todo/php70#timetable +[9]:http://talks.php.net/velocity15 +[10]:http://www.php-fig.org/psr/psr-7/ +[11]:http://phpmentoring.org/ +这里向Lerdorf和PHP社区的其他人致敬,感谢他们把这个“愚蠢的小项目”变成了一个如今网络上持久的,强大的组块。 From 981f7e86dbe89fc117feac258e96665e7e56fdfe Mon Sep 17 00:00:00 2001 From: wwy-hust Date: Fri, 19 Jun 2015 17:22:25 +0800 Subject: [PATCH 427/965] translated --- ...is good audio editing software on Linux.md | 84 ------------------- ...is good audio editing software on Linux.md | 67 +++++++++++++++ 2 files changed, 67 insertions(+), 84 deletions(-) delete mode 100644 sources/tech/20141219 What is good audio editing software on Linux.md create mode 100644 translated/tech/20141219 What is good audio editing software on Linux.md diff --git a/sources/tech/20141219 What is good audio editing software on Linux.md b/sources/tech/20141219 What is good audio editing software on Linux.md deleted file mode 100644 index da015adf14..0000000000 --- a/sources/tech/20141219 What is good audio editing software on Linux.md +++ /dev/null @@ -1,84 +0,0 @@ -translating by wwy-hust - -What is good audio editing software on Linux -================================================================================ - -Whether you are an amateur musician or just a student recording his professor, you need to edit and work with audio recordings. If for a long time such task was exclusively attributed to Macintosh, this time is over, and Linux now has what it takes to do the job. In short, here is a non-exhaustive list of good audio editing software, fit for different tasks and needs. - -### 1. Audacity ### - -![](https://farm9.staticflickr.com/8572/15405018653_83ba3e718d_c.jpg) - -Let's get started head on with my personal favorite. [Audacity][1] works on Windows, Mac, and Linux. It is open source. It is easy to use. You get it: Audacity is almost perfect. This program lets you manipulate the audio waveform from a clean interface. In short, you can overlay tracks, cut and edit them easily, apply effects, perform advanced sound analysis, and finally export to a plethora of format. The reason I like it so much is that it combines both basic features with more complicated ones, but maintain an easy leaning curve. However, it is not a fully optimized software for hardcore musicians, or people with professional knowledge. - -### 2. Jokosher ### - -![](https://farm8.staticflickr.com/7524/15998875136_82903a9b4a_c.jpg) - -On a different level, [Jokosher][2] focuses more on the multi-track aspect for musical artists. Developed in Python and using the GTK+ interface with GStreamer for audio back-end, Jokosher really impressed me with its slick interface and its extensions. If the editing features are not the most advanced, the language is clear and directed to musicians. And I really like the association between tracks and instruments for example. In short, if you are starting as a musician, it might be a good place to get some experience before moving on to more complex suites. - -### 3. Ardour ### - -![](https://farm9.staticflickr.com/8577/16024644385_d8cd8073a3_c.jpg) - -And talking about compex suites, [Ardour][3] is complete software for recording, editing, and mixing. Designed this time to appeal to all professionals, Ardour features in term of sound routing and plugins go way beyond my comprehension. So if you are looking for a beast and are not afraid to tame it, Ardour is probably a good pick. Again, the interface contributes to its charm, as well as its extensive documentation. I particularly appreciated the first-launch configuration tool. - -### 4. Kwave ### - -![](https://farm8.staticflickr.com/7557/15402389884_633a8b04c5_c.jpg) - -For all KDE lovers, [KWave][4] corresponds to your idea of design and features. There are plenty of shortcuts and interesting options, like memory management. Even if the few effects are nice, we are more dealing with a simple tool to cut/paste audio together. It becomes shard not to compare it with Audacity unfortunately. And on top of that, the interface did not appeal to me that much. - -### 5. Qtractor ### - -![](https://farm8.staticflickr.com/7551/16022707501_68c39f37e5_c.jpg) - -If Kwave is too simplistic for you but a Qt-based program really has some appeal, then [Qtractor][5] might be your option. It aims to be "simple enough for the average home user, and yet powerful enough for the professional user." Indeed the quantity of features and options is almost overwhelming. My favorite being of course customizable shortcuts. Apart from that, Qtractor is probably one of my favorite tools to deal with MIDI files. - -### 6. LMMS ### - -![](https://farm8.staticflickr.com/7509/15838603239_ef0ecbc8d2_c.jpg) - -Standing for Linux MultiMedia Studio, LMMS is directly targeted for music production. If you do not have prior experience and do not want to spend too much time getting some, go elsewhere. LMMS is one of those complex but powerful software that only a few will truly master. The number of features and effects is simply too long to list, but if I had to pick one, I would say that the Freeboy plugin to emulate Game Boy sound system is just magical. Past that, go see their amazing documentation. - -### 7. Traverso ### - -![](https://farm8.staticflickr.com/7537/15838603279_70ee925057_c.jpg) - -Finally, Traverso stood out to me for its unlimited track count and its direct integration with CD burning capacities. Aside from that, it appeared to me as a middle man between a simplistic software and a professional program. The interface is very KDE-like, and the keyboard configuration is always welcome. And cherry on the cake, Traverso monitors your resources and make sure that your CPU or hard drive does not go overboard. - -To conclude, it is always a pleasure to see such a large diversity of applications on Linux. It makes finding the software that best fits your needs always possible. While my personal favorite stays Audacity, I was very surprised by the design of programs like LMMS or Jokosher. - -Did we miss one? What do you use for audio editing on Linux? And why? Let us know in the comments. - --------------------------------------------------------------------------------- - -via: http://xmodulo.com/good-audio-editing-software-linux.html - -作者:[Adrien Brochard][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://xmodulo.com/author/adrien -[1]:http://audacity.sourceforge.net/ -[2]:https://launchpad.net/jokosher/ -[3]:http://ardour.org/ -[4]:http://kwave.sourceforge.net/ -[5]:http://qtractor.sourceforge.net/qtractor-index.html -[6]: -[7]: -[8]: -[9]: -[10]: -[11]: -[12]: -[13]: -[14]: -[15]: -[16]: -[17]: -[18]: -[19]: -[20]: diff --git a/translated/tech/20141219 What is good audio editing software on Linux.md b/translated/tech/20141219 What is good audio editing software on Linux.md new file mode 100644 index 0000000000..c3f9c76d61 --- /dev/null +++ b/translated/tech/20141219 What is good audio editing software on Linux.md @@ -0,0 +1,67 @@ +LinuxƵ༭ +================================================================================ + +һְ߻ֻһҪ¼ʦѧҪ¼Ƶͱ༭ƵĹҪMacintoshǸʱѾȥLinuxҲʤЩˡ֮һݲȫƵ༭бڲͬ + +### 1. Audacity ### + +![](https://farm9.staticflickr.com/8572/15405018653_83ba3e718d_c.jpg) + +ǴҸϲʼ[Audacity][1]WindowsMacLinuxϡǿԴģʹáãAudacityġڸɾĽϲƵΡ򵥵˵Ը졢к޸졢Чִи߼ȻǵһѿõĸʽϲԭĹܺ͸ӵĹܽһұһ򵥵ѧϰߡȻһȫŻǶּҺרҵ֪ʶˡ + +### 2. Jokosher ### + +![](https://farm8.staticflickr.com/7524/15998875136_82903a9b4a_c.jpg) + +ڲͬIJϣ[Jokosher][2]ľ۽ڶ췽档ʹPythonGTK+Ϊǰ˽ڣʹGStreamerΪƵˡJokosherƽĽչԸ̵ӡҲ༭ĹܲȽģʮʺּҡ磬ʮϲϡ֮һּңôתƵһǰʵĺûᡣ + +### 3. Ardour ### + +![](https://farm9.staticflickr.com/8577/16024644385_d8cd8073a3_c.jpg) + +̸һЩӵĹߣ[Ardour][3]һĿ¼ơ༭ͻеרҵԱArdourͲ泬ҵѰһͷҰ޲ҲѱôArdourȡһѡٴΣĽӿںḻĵ״ʱù߶һ֡ + +### 4. Kwave ### + +![](https://farm8.staticflickr.com/7557/15402389884_633a8b04c5_c.jpg) + +KDEȰߣ[KWave][4]Էƺ͹ܵзḻĿݼԼܶȤѡڴܺܶЧܲǸӦùעЩƵ/ճĹߡϧ޷AudacityȣҪǣýӿڲûôҡ + +### 5. Qtractor ### + +![](https://farm8.staticflickr.com/7551/16022707501_68c39f37e5_c.jpg) + +Kwave˵ڼ򵥣QtijȴЩô˵Ҳ[Qtractor][5]һѡһڼͥû˵㹻򵥣ҶרҵԱ˵㹻ǿʵܺѡѹԵġϲĵȻǿɶƵĿݼ֮⣬QtractorϲһMIDIļĹߡ + +### 6. LMMS ### + +![](https://farm8.staticflickr.com/7509/15838603239_ef0ecbc8d2_c.jpg) + +ΪLinuxý幤ңLMMSֱĿ֮ǰûʲô鲢Ҳ˷̫ʱ䣬ôȥ𴦰ɡLMMSһӵǿֻ̫ĹܺЧ޷һһгұһһ˵ģGame BoyϵͳFreeboyֱħһȻȥǾ˵ĵɡ + +### 7. Traverso ### + +![](https://farm8.staticflickr.com/7537/15838603279_70ee925057_c.jpg) + +վǰTraverso֧ƵֱCD¼Ĺܡ⣬˵ǽڼ򵥵רҵ֮ijĽKDEʽģúܼ򵥡ȤǣTraversoϵͳԴȷᳬCPUӲ + +֮ܶLinuxϵͳϿô಻ͬӦóһĵ¡ʹԶҵʺԼһȻϲӦAudacityҷdzLMMSJokosherơ + +©ʲôôLinuxʹһأԭʲôأԴ֪ + +-------------------------------------------------------------------------------- + +via: http://xmodulo.com/good-audio-editing-software-linux.html + +ߣ[Adrien Brochard][a] +ߣ[wwy-hust](https://github.com/wwy-hust) +Уԣ[УID](https://github.com/УID) + + [LCTT](https://github.com/LCTT/TranslateProject) ԭ룬[Linuxй](http://linux.cn/) Ƴ + +[a]:http://xmodulo.com/author/adrien +[1]:http://audacity.sourceforge.net/ +[2]:https://launchpad.net/jokosher/ +[3]:http://ardour.org/ +[4]:http://kwave.sourceforge.net/ +[5]:http://qtractor.sourceforge.net/qtractor-index.html \ No newline at end of file From 85525e10ac3aa43555ed061493b91106a7437fe3 Mon Sep 17 00:00:00 2001 From: zpl1025 Date: Fri, 19 Jun 2015 18:01:28 +0800 Subject: [PATCH 428/965] [translated] 20150610 How to Manipulate Filenames Having Spaces and Special Characters in Linux.md --- ... Spaces and Special Characters in Linux.md | 436 ------------------ ... Spaces and Special Characters in Linux.md | 435 +++++++++++++++++ 2 files changed, 435 insertions(+), 436 deletions(-) delete mode 100644 sources/tech/20150610 How to Manipulate Filenames Having Spaces and Special Characters in Linux.md create mode 100644 translated/tech/20150610 How to Manipulate Filenames Having Spaces and Special Characters in Linux.md diff --git a/sources/tech/20150610 How to Manipulate Filenames Having Spaces and Special Characters in Linux.md b/sources/tech/20150610 How to Manipulate Filenames Having Spaces and Special Characters in Linux.md deleted file mode 100644 index 31b28afd01..0000000000 --- a/sources/tech/20150610 How to Manipulate Filenames Having Spaces and Special Characters in Linux.md +++ /dev/null @@ -1,436 +0,0 @@ -zpl1025 -How to Manipulate Filenames Having Spaces and Special Characters in Linux -================================================================================ -We come across files and folders name very regularly. In most of the cases file/folder name are related to the content of the file/folder and starts with number and characters. Alpha-Numeric file name are pretty common and very widely used, but this is not the case when we have to deal with file/folder name that has special characters in them. - -**Note**: We can have files of any type but for simplicity and easy implementation we will be dealing with Text file (.txt), throughout the article. - -Example of most common file names are: - - abc.txt - avi.txt - debian.txt - ... - -Example of numeric file names are: - - 121.txt - 3221.txt - 674659.txt - ... - -Example of Alpha-Numeric file names are: - - eg84235.txt - 3kf43nl2.txt - 2323ddw.txt - ... - -Examples of file names that has special character and is not very common: - - #232.txt - #bkf.txt - #bjsd3469.txt - #121nkfd.txt - -2232.txt - -fbjdew.txt - -gi32kj.txt - --321.txt - --bk34.txt - ... - -One of the most obvious question here is – who on earth create/deal with files/folders name having a Hash `(#)`, a semi-colon `(;)`, a dash `(-)` or any other special character. - -I Agree to you, that such file names are not common still your shell should not break/give up when you have to deal with any such file names. Also speaking technically every thing be it folder, driver or anything else is treated as file in Linux. - -### Dealing with file that has dash (-) in it’s name ### - -Create a file that starts with a dash `(-)`, say -abx.txt. - - $ touch -abc.txt - -#### Sample Output #### - - touch: invalid option -- 'b' - Try 'touch --help' for more information. - -The reason for above error, that shell interprets anything after a dash `(-)`, as option, and obviously there is no such option, hence is the error. - -To resolve such error, we have to tell the Bash shell (yup this and most of the other examples in the article is for BASH) not to interpret anything after special character (here dash), as option. - -There are two ways to resolve this error as: - - $ touch -- -abc.txt [Option #1] - $ touch ./-abc.txt [Option #2] - -You may verify the file thus created by both the above ways by running commands ls or [ls -l][1] for long listing. - - $ ls -l - - total 0 - -rw-r--r-- 1 avi avi 0 Jun 8 11:05 -abc.txt - -To edit the above file you may do: - - $ nano -- -abc.txt - or - $ nano ./-abc.txt - -**Note**: You may replace nano with any other editor of your choice say vim as: - - $ vim -- -abc.txt - or - $ vim ./-abc.txt - -Similarly to move such file you have to do: - - $ mv -- -abc.txt -a.txt - or - $ mv -- -a.txt -abc.txt - -and to Delete this file, you have to do: - - $ rm -- -abc.txt - or - $ rm ./-abc.txt - -If you have lots of files in a folder the name of which contains dash, and you want to delete all of them at once, do as: - - $ rm ./-* - -**Important to Note:** - -1. The same rule as discussed above follows for any number of hypen in the name of the file and their occurrence. Viz., -a-b-c.txt, ab-c.txt, abc-.txt, etc. - -2. The same rule as discussed above follows for the name of the folder having any number of hypen and their occurrence, except the fact that for deleting the folder you have to use ‘rm -rf‘ as: - - $ rm -rf -- -abc - or - $ rm -rf ./-abc - -### Dealing with files having HASH (#) in the name ### - -The symbol `#` has a very different meaning in BASH. Anything after a `#` is interpreted as comment and hence neglected by BASH. - -**Understand it using examples:** - -create a file #abc.txt. - - $ touch #abc.txt - -#### Sample Output #### - - touch: missing file operand - Try 'touch --help' for more information. - -The reason for above error, that Bash is interpreting #abc.txt a comment and hence ignoring. So the [command touch][2] has been passed without any file Operand, and hence is the error. - -To resolve such error, you may ask BASH not to interpret # as comment. - - $ touch ./#abc.txt - or - $ touch '#abc.txt' - -and verify the file just created as: - - $ ls -l - - total 0 - -rw-r--r-- 1 avi avi 0 Jun 8 12:14 #abc.txt - -Now create a file the name of which contains # anywhere except at the begging. - - $ touch ./a#bc.txt - $ touch ./abc#.txt - - or - $ touch 'a#bc.txt' - $ touch 'abc#.txt' - -Run ‘ls -l‘ to verify it: - - $ ls -l - - total 0 - -rw-r--r-- 1 avi avi 0 Jun 8 12:16 a#bc.txt - -rw-r--r-- 1 avi avi 0 Jun 8 12:16 abc#.txt - -What happens when you create two files (say a and #bc) at once: - - $ touch a.txt #bc.txt - -Verify the file just created: - - $ ls -l - - total 0 - -rw-r--r-- 1 avi avi 0 Jun 8 12:18 a.txt - -Obvious from the above example it only created file ‘a‘ and file ‘#bc‘ has been ignored. To execute the above situation successfully we can do, - - $ touch a.txt ./#bc.txt - or - $ touch a.txt '#bc.txt' - -and verify it as: - - $ ls -l - - total 0 - -rw-r--r-- 1 avi avi 0 Jun 8 12:20 a.txt - -rw-r--r-- 1 avi avi 0 Jun 8 12:20 #bc.txt - -You can move the file as: - - $ mv ./#bc.txt ./#cd.txt - or - $ mv '#bc.txt' '#cd.txt' - -Copy it as: - - $ cp ./#cd.txt ./#de.txt - or - $ cp '#cd.txt' '#de.txt' - -You may edit it as using your choice of editor as: - - $ vi ./#cd.txt - or - $ vi '#cd.txt' - ----------- - - $ nano ./#cd.txt - or - $ nano '#cd.txt' - -And Delete it as: - - $ rm ./#bc.txt - or - $ rm '#bc.txt' - -To delete all the files that has hash (#) in the file name, you may use: - - # rm ./#* - -### Dealing with files having semicolon (;) in its name ### - -In case you are not aware, semicolon acts as a command separator in BASH and perhaps other shell as well. Semicolon lets you execute several command in one go and acts as separator. Have you ever deal with any file name having semicolon in it? If not here you will. - -Create a file having semi-colon in it. - - $ touch ;abc.txt - -#### Sample Output #### - - touch: missing file operand - Try 'touch --help' for more information. - bash: abc.txt: command not found - -The reason for above error, that when you run the above command BASH interpret touch as a command but could not find any file operand before semicolon and hence it reports error. It also reports another error that ‘abc.txt‘ command not found, only because after semicolon BASH was expecting another command and ‘abc.txt‘, is not a command. - -To resolve such error, tell BASH not to interpret semicolon as command separator, as: - - $ touch ./';abc.txt' - or - $ touch ';abc.txt' - -**Note**: We have enclosed the file name with single quote ''. It tells BASH that ; is a part of file name and not command separator. - -Rest of the action (viz., copy, move, delete) on the file and folder having semicolon in its name can be carried out straight forward by enclosing the name in single quote. - -### Dealing with other special characters in file/folder name ### - -#### Plus Sign (+) in file name #### - -Don’t requires anything extra, just do it normal way, as simple file name as shown below. - - $ touch +12.txt - -#### Dollar sign ($) in file name #### - -You have to enclose file name in single quote, as we did in the case of semicolon. Rest of the things are straight forward.. - - $ touch '$12.txt' - -#### Percent (%) in file name #### - -You don’t need to do anything differently, treat it as normal file. - - $ touch %12.txt - -#### Asterisk (*) in file name #### - -Having Asterisk in file name don’t change anything and you can continue using it as normal file. - - $ touch *12.txt - -Note: When you have to delete a file that starts with *, Never use following commands to delete such files. - - $ rm * - or - $ rm -rf * - -Instead use, - - $ rm ./*.txt - -#### Exclamation mark (!) in file name #### - -Just Enclose the file name in single quote and rest of the things are same. - - $ touch '!12.txt' - -#### At Sign (@) in file name #### - -Nothing extra, treat a filename having At Sign as nonrmal file. - - $ touch '@12.txt' - -#### ^ in file name #### - -No extra attention required. Use a file having ^ in filename as normal file. - - $ touch ^12.txt - -#### Ampersand (&) in file name #### - -Filename should be enclosed in single quotes and you are ready to go. - - $ touch '&12.txt' - -#### Parentheses () in file name #### - -If the file name has Parenthesis, you need to enclose filename with single quotes. - - $ touch '(12.txt)' - -#### Braces {} in file name #### - -No Extra Care needed. Just treat it as just another file. - - $ touch {12.txt} - -#### Chevrons <> in file name #### - -A file name having Chevrons must be enclosed in single quotes. - - $ touch '<12.txt>' - -#### Square Brackets [ ] in file name #### - -Treat file name having Square Brackets as normal files and you need not take extra care of it. - - $ touch [12.txt] - -#### Under score (_) in file name #### - -They are very common and don’t require anything extra. Just do what you would have done with a normal file. - - $ touch _12.txt - -#### Equal-to (=) in File name #### - -Having an Equal-to sign do not change anything, you can use it as normal file. - - $ touch =12.txt - -#### Dealing with back slash (\) #### - -Backslash tells shell to ignore the next character. You have to enclose file name in single quote, as we did in the case of semicolon. Rest of the things are straight forward. - - $ touch '\12.txt' - -#### The Special Case of Forward Slash #### - -You cannot create a file the name of which includes a forward slash (/), until your file system has bug. There is no way to escape a forward slash. - -So if you can create a file such as ‘/12.txt’ or ‘b/c.txt’ then either your File System has bug or you have Unicode support, which lets you create a file with forward slash. In this case the forward slash is not a real forward slash but a Unicode character that looks alike a forward slash. - -#### Question Mark (?) in file name #### - -Again, an example where you don’t need to put any special attempt. A file name having Question mark can be treated in the most general way. - - $ touch ?12.txt - -#### Dot Mark (.) in file name #### - -The files starting with dot `(.)` are very special in Linux and are called dot files. They are hidden files generally a configuration or system files. You have to use switch ‘-a‘ or ‘-A‘ with ls command to view such files. - -Creating, editing, renaming and deleting of such files are straight forward. - - $ touch .12.txt - -Note: In Linux you may have as many dots `(.)` as you need in a file name. Unlike other system dots in file name don’t means to separate name and extension. You can create a file having multiple dots as: - - $ touch 1.2.3.4.5.6.7.8.9.10.txt - -and check it as: - - $ ls -l - - total 0 - -rw-r--r-- 1 avi avi 0 Jun 8 14:32 1.2.3.4.5.6.7.8.9.10.txt - -#### Comma (,) in file name #### - -You can have comma in a file name, as many as you want and you Don’t requires anything extra. Just do it normal way, as simple file name. - - $ touch ,12.txt - or - $ touch ,12,.txt - -#### Colon (:) in File name #### - -You can have colon in a file name, as many as you want and you Don’t requires anything extra. Just do it normal way, as simple file name. - - $ touch :12.txt - or - $ touch :12:.txt - -#### Having Quotes (single and Double) in file name #### - -To have quotes in file name, we have to use the rule of exchange. I.e, if you need to have single quote in file name, enclose the file name with double quotes and if you need to have double quote in file name, enclose it with single quote. - - $ touch "15'.txt" - - and - - $ touch '15”.txt' - -#### Tilde (~) in file name #### - -Some Editors in Linux like emacs create a backup file of the file being edited. The backup file has the name of the original file plus a tilde at the end of the file name. You can have a file that name of which includes tilde, at any location simply as: - - $ touch ~1a.txt - or - $touch 2b~.txt - -#### White Space in file name #### - -Create a file the name of which has space between character/word, say “hi my name is avishek.txt”. - -It is not a good idea to have file name with spaces and if you have to distinct readable name, you should use, underscore or dash. However if you have to create such a file, you have to use backward slash which ignores the next character to it. To create above file we have to do it this way.. - - $ touch hi\ my\ name\ is\ avishek.txt - - hi my name is avishek.txt - -I have tried covering all the scenario you may come across. Most of the above implementation are explicitly for BASH Shell and may not work in other shell. - -If you feel that I missed something (that is very common and human nature), you may include your suggestion in the comments below. Keep Connected, Keep Commenting. Stay Tuned and connected! Like and share us and help us get spread! - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/manage-linux-filenames-with-special-characters/ - -作者:[Avishek Kumar][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.tecmint.com/author/avishek/ -[1]:http://www.tecmint.com/15-basic-ls-command-examples-in-linux/ -[2]:http://www.tecmint.com/8-pratical-examples-of-linux-touch-command/ diff --git a/translated/tech/20150610 How to Manipulate Filenames Having Spaces and Special Characters in Linux.md b/translated/tech/20150610 How to Manipulate Filenames Having Spaces and Special Characters in Linux.md new file mode 100644 index 0000000000..61a320aeb8 --- /dev/null +++ b/translated/tech/20150610 How to Manipulate Filenames Having Spaces and Special Characters in Linux.md @@ -0,0 +1,435 @@ +Linux 下如何处理包含空格和特殊字符的文件名 +================================================================================ +我们经常会看到文件名和文件夹名。大多数时候文件/文件夹的名字和内容相关并以数字和字母开头。字母-数字文件名最常见,应用也很广泛,但总会需要处理一些包含特殊字符的文件名/文件夹名。 + +** 注意 **:我们可能有各种类型的文件,但是为了简单以及方便实现,在本文中我们只处理文本文件(.txt)。 + +最常见的文件名例子: + + abc.txt + avi.txt + debian.txt + ... + +数字文件名例子: + + 121.txt + 3221.txt + 674659.txt + ... + +字母数字文件名例子: + + eg84235.txt + 3kf43nl2.txt + 2323ddw.txt + ... + +包含特殊字符的文件名的例子,并不常见: + + #232.txt + #bkf.txt + #bjsd3469.txt + #121nkfd.txt + -2232.txt + -fbjdew.txt + -gi32kj.txt + --321.txt + --bk34.txt + ... + +一个显而易见的问题是 - 在这个星球上有谁会创建/处理包含井号`(#)`,分号`(;)`,破折号`(-)`或其他特殊字符的文件/文件夹啊。 + +我和你想的一样,这种文件名确实不常见,不过在你必须得处理这种文件名的时候你的 shell 也不应该出错或罢工。而且技术上来说,Linux 下的一切比如文件夹,驱动器或其他所有的都被当作文件处理。 + +### 处理名字包含破折号(-)的文件 ### + +创建以破折号`(-)`开头的文件,比如 -abx.txt。 + + $ touch -abc.txt + +#### 测试输出 #### + + touch: invalid option -- 'b' + Try 'touch --help' for more information. + +出现上面错误的原因是,shell 把破折号`(-)`之后的内容认作参数了,而很明显没有这样的参数,所以报错。 + +要解决这个问题,我们得告诉 Bash shell(是的,这里以及本文后面的大多数例子都是基于 BASH 环境)不要将特殊字符(这里是破折号)后的字符解释为参数。 + +有两种方法解决这个错误: + + $ touch -- -abc.txt [方法 #1] + $ touch ./-abc.txt [方法 #2] + +你可以通过运行命令 ls 或 [ls -l][1] 列出详细信息来检查通过上面两种方式创建的文件。 + + $ ls -l + + total 0 + -rw-r--r-- 1 avi avi 0 Jun 8 11:05 -abc.txt + +要编辑上述文件可以这样: + + $ nano -- -abc.txt + 或者 + $ nano ./-abc.txt + +**注意**:你可以将 nano 替换为任何其他你喜欢的编辑器比如说 vim: + + $ vim -- -abc.txt + 或者 + $ vim ./-abc.txt + +如果只是简单地移动文件可以这样: + + $ mv -- -abc.txt -a.txt + 或者 + $ mv -- -a.txt -abc.txt + +删除这种文件,可以这样: + + $ rm -- -abc.txt + 或者 + $ rm ./-abc.txt + +如果一个目录下有大量这种名字包含破折号的文件,要一次全部删除的话,可以这样: + + $ rm ./-* + +**重要:** + +1. 上面讨论的规则可以同样应用于名字中包含任意数量以及位置连接符号的文件。就是说,-a-b-c.txt,ab-c.txt,abc-.txt,等等。 + +2. 上面讨论的规则可以同样应用于名字中包含任意数量以及位置连接符号的文件夹,除了一种情况,在删除一个文件夹的时候你得这样使用`rm -rf`: + + $ rm -rf -- -abc + 或者 + $ rm -rf ./-abc + +### 处理名字包含井号(#)的文件 ### + +符号`#`在 BASH 里有非常特别的含义。`#`之后的一切都会被认为是评论,因此会被 BASH 忽略。 + +**通过例子来加深理解:** + +创建一个名字是 #abc.txt 的文件: + + $ touch #abc.txt + +#### 测试输出 #### + + touch: missing file operand + Try 'touch --help' for more information. + +出现上面错误的原因是,BASH 将 #abc.txt 解释为评论而忽略了。所以[命令 touch][2]没有收到任何文件作为参数,所以导致这个错误。 + +要解决这个问题,你肯能需要告诉 BASH 不要将 # 解释为评论。 + + $ touch ./#abc.txt + 或者 + $ touch '#abc.txt' + +检查刚创建的文件: + + $ ls -l + + total 0 + -rw-r--r-- 1 avi avi 0 Jun 8 12:14 #abc.txt + +现在创建名字中除了开头的其他地方包含 # 的文件。 + + $ touch ./a#bc.txt + $ touch ./abc#.txt + + 或者 + $ touch 'a#bc.txt' + $ touch 'abc#.txt' + +运行 ‘ls -l‘ 来检查: + + $ ls -l + + total 0 + -rw-r--r-- 1 avi avi 0 Jun 8 12:16 a#bc.txt + -rw-r--r-- 1 avi avi 0 Jun 8 12:16 abc#.txt + +如果同时创建两个文件(比如 a 和 #bc)会怎么样: + + $ touch a.txt #bc.txt + +检查刚创建的文件: + + $ ls -l + + total 0 + -rw-r--r-- 1 avi avi 0 Jun 8 12:18 a.txt + +很明显上面的例子中只创建了文件 `a` 而文件 `#bc` 被忽略了。对于上面的情况我们可以这样做, + + $ touch a.txt ./#bc.txt + 或者 + $ touch a.txt '#bc.txt' + +检查一下: + + $ ls -l + + total 0 + -rw-r--r-- 1 avi avi 0 Jun 8 12:20 a.txt + -rw-r--r-- 1 avi avi 0 Jun 8 12:20 #bc.txt + +可以这样移动文件: + + $ mv ./#bc.txt ./#cd.txt + 或者 + $ mv '#bc.txt' '#cd.txt' + +这样拷贝: + + $ cp ./#cd.txt ./#de.txt + 或者 + $ cp '#cd.txt' '#de.txt' + +可以使用你喜欢的编辑器来编辑文件: + + $ vi ./#cd.txt + 或者 + $ vi '#cd.txt' + +---------- + + $ nano ./#cd.txt + 或者 + $ nano '#cd.txt' + +这样删除: + + $ rm ./#bc.txt + 或者 + $ rm '#bc.txt' + +要删除所有以井号(#)开头的文件,可以这样: + + # rm ./#* + +### 处理名字包含分号(;)的文件 ### + +如果你还不知道的话,分号在 BASH 里起到命令分隔的作用,其他 shell 可能也是一样的。分号作为分隔符可以让你一次执行几个命令。你碰到过名字包含分号的文件吗?如果没有的话,这里有例子。 + +创建一个名字包含分号的文件。 + + $ touch ;abc.txt + +#### 测试输出 #### + + touch: missing file operand + Try 'touch --help' for more information. + bash: abc.txt: command not found + +出现上面错误的原因是,在运行上面命令的时候 BASH 会把 touch 解释为一个命令但是在分号前没有任何文件参数,所以报告错误。然后报告的另一个错误找不到命令 `abc.txt`,只是因为在分号后 BASH 会期望另一个新的命令,而 `abc.txt` 并不是一个命令。 + +要解决这个问题,我们得告诉 BASH 不要将分号解释为命令分隔符,例如: + + $ touch ./';abc.txt' + 或者 + $ touch ';abc.txt' + +**注意**:我们将文件名用单引号 '' 包含起来。这样可以告诉 BASH 分号 ; 是文件名的一部分而不是命令分隔符。 + +对名字包含分号的文件和文件夹的其他操作(就是,拷贝、移动、删除)可以直接将名字用单引号包含起来就好了。 + +### 处理名字包含其他特殊字符的文件/文件夹 ### + +#### 文件名包含加号 (+) #### + +不需要任何特殊处理,按平时的方式做就好了,比如下面测试的文件名。 + + $ touch +12.txt + +#### 文件名包含美元符 ($) #### + +你需要将文件名用单引号括起来,像处理分号那样的方式。然后就很简单了。 + + $ touch '$12.txt' + +#### 文件名包含百分号 (%) #### + +不需要任何特殊处理,当作一个普通文件就可以了。 + + $ touch %12.txt + +#### 文件名包含星号 (*) #### + +名字包含星号的文件没有改变太多,你仍然可以把它当作一个普通文件。(注:星号在 shell 里有特殊意义,用作文件名最好用单引号括起来或使用反斜杠转义) + + $ touch *12.txt + +注意:当你需要删除星号开头的文件时,千万不要用类似下面的命令。 + + $ rm * + 或者 + $ rm -rf * + +而是用这样的命令,(注:这个命令是删除当前目录所有.txt文件。。。) + + $ rm ./*.txt + +#### 文件名包含叹号 (!) #### + +只要将文件名用单引号括起来,其他的就一样了。 + + $ touch '!12.txt' + +#### 文件名包含小老鼠 (@) #### + +没有什么特别的,可以将名字包含小老鼠的文件当作普通文件。 + + $ touch '@12.txt' + +#### 文件名包含 ^ #### + +不需要特殊处理。可以将名字包含 ^ 的文件当作普通文件。 + + $ touch ^12.txt + +#### 文件名包含 (&) #### + +将文件名用单引号括起来,然后就可以操作了。 + + $ touch '&12.txt' + +#### 文件名包含括号 () #### + +如果文件名包含括号,你需要将文件名用单引号括起来。 + + $ touch '(12.txt)' + +#### 文件名包含花括号 {} #### + +不需要特别注意。可以当作普通文件处理。(注:花括号在 shell 里有特殊意义,用作文件名最好用单引号括起来或使用反斜杠转义) + + $ touch {12.txt} + +#### 文件名包含尖括号 <> #### + +名字包含尖括号的文件需要用单引号括起来。 + + $ touch '<12.txt>' + +#### 文件名包含方括号 [ ] #### + +名字包含方括号的文件可以当作普通文件,不用特别处理。(注:方括号在 shell 里有特殊意义,用作文件名最好用单引号括起来或使用反斜杠转义) + + $ touch [12.txt] + +#### 文件名包含下划线 (_) #### + +这个非常普遍不需要特殊对待。当作普通文件随意处理。 + + $ touch _12.txt + +#### 文件名包含等号 (=) #### + +文件名包含等号不会改变任何事情,你可以当作普通文件。(注:等号在 shell 里有特殊意义,用作文件名最好用单引号括起来或使用反斜杠转义) + + $ touch =12.txt + +#### 处理反斜杠 (\) #### + +反斜杠会告诉 shell 忽略后面字符的特殊含义。你必须将文件名用单引号括起来,就像处理分号那样。其他的就没什么了。 + + $ touch '\12.txt' + +#### 包含斜杠的特殊情形 #### + +除非你的文件系统有问题,否则你不能创建名字包含斜杠的文件。没办法转义斜杠。 + +所以如果你能创建类似 ‘/12.txt’ 或者 ‘b/c.txt’ 这样的文件,那要么你的文件系统有问题,或者支持 Unicode,这样你可以创建包含斜杠的文件。只是这样并不是真的斜杠,而是一个看起来像斜杠的 Unicode 字符。 + +#### 文件名包含问号 (?) #### + +再一次,这个也是不需要特别处理的情况。名字包含问号的文件可以和大多数情况一样对待。(注:问号在 shell 里有特殊意义,用作文件名最好用单引号括起来或使用反斜杠转义) + + $ touch ?12.txt + +#### 文件名包含点 (.) #### + +在 Linux 里以点 `(.)` 开头的文件非常特别,被称为点文件。它们通常是隐藏的配置文件或系统文件。你需要使用 ls 命令的 ‘-a‘ 或 ‘-A‘ 开关来查看这种文件。 + +创建,编辑,重命名和删除这种文件很直接。 + + $ touch .12.txt + +注意:在 Linux 里你可能碰到名字包含许多点 `(.)` 的文件。不像其他操作系统,文件名里的点并不意味着分隔名字和扩展后缀。你可以创建名字包含多个点的文件: + + $ touch 1.2.3.4.5.6.7.8.9.10.txt + +检查一下: + + $ ls -l + + total 0 + -rw-r--r-- 1 avi avi 0 Jun 8 14:32 1.2.3.4.5.6.7.8.9.10.txt + +#### 文件名包含逗号 (,) #### + +你可以在文件名中使用逗号,可以有任意多个而不用特殊对待。就像平时普通名字文件那样处理。 + + $ touch ,12.txt + 或者 + $ touch ,12,.txt + +#### 文件名包含冒号 (:) #### + +你可以在文件名中使用冒号,可以有任意多个而不用特殊对待。就像平时普通名字文件那样处理。(注:冒号在 shell 里有特殊意义,用作文件名最好用单引号括起来或使用反斜杠转义) + + $ touch :12.txt + 或者 + $ touch :12:.txt + +#### 文件名包含引号(单引号和双引号) #### + +要在文件名里使用引号,我们需要使用交替规则。例如,如果你需要在文件名里使用单引号,那就用双引号把文件名括起来。而如果你需要在文件名里使用双引号,那就用单引号把文件名括起来。 + + $ touch "15'.txt" + + 以及 + + $ touch '15”.txt' + +#### 文件名包含波浪号 (~) #### + +Linux 下一些像 emacs 这样的文本编辑器在编辑文件的时候会创建备份文件。这个备份文件的名字是在原文件名后面附加一个波浪号。你可以在文件名任意位置使用波浪号,例如:(注:波浪号在 shell 里有特殊意义,用作文件名最好用单引号括起来或使用反斜杠转义) + + $ touch ~1a.txt + 或者 + $touch 2b~.txt + +#### 文件名包含空格 #### + +创建名字的字符/单词之间包含空格的文件,比如 “hi my name is avishek.txt”。 + +最好不要在文件名里使用空格,如果你必须要分隔可读的名字,可以使用下划线或横杠。不过,你还是需要创建这样的文件的话,你可以用反斜杠来转义下一个字符。要创建上面名字的文件可以这样做。 + + $ touch hi\ my\ name\ is\ avishek.txt + + hi my name is avishek.txt + +我已经尝试覆盖你可能碰到的所有情况。上面大多数测试都在 BASH Shell 里完成,可能在其他 shell 下会有差异。 + +如果你觉得我遗漏了什么(这很正常也符合人性),请把你的建议发表到下面的评论里。保持联系,多评论。不要走开!求点赞求分享求扩散! + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/manage-linux-filenames-with-special-characters/ + +作者:[Avishek Kumar][a] +译者:[zpl1025](https://github.com/zpl1025) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/avishek/ +[1]:http://www.tecmint.com/15-basic-ls-command-examples-in-linux/ +[2]:http://www.tecmint.com/8-pratical-examples-of-linux-touch-command/ From fa23a186b3e1abf88165c7751220115eb0785370 Mon Sep 17 00:00:00 2001 From: zpl1025 Date: Fri, 19 Jun 2015 18:07:39 +0800 Subject: [PATCH 429/965] [translating] 20150616 XBMC--build a remote control.md --- sources/tech/20150616 XBMC--build a remote control.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150616 XBMC--build a remote control.md b/sources/tech/20150616 XBMC--build a remote control.md index 25de9fd06f..5066e28ce2 100644 --- a/sources/tech/20150616 XBMC--build a remote control.md +++ b/sources/tech/20150616 XBMC--build a remote control.md @@ -1,3 +1,4 @@ +zpl1025 XBMC: build a remote control ================================================================================ **Take control of your home media player with a custom remote control running on your Android phone.** @@ -261,4 +262,4 @@ via: http://www.linuxvoice.com/xbmc-build-a-remote-control/ [2]:http://wiki.xbmc.org/?title=JSON-RPC_API/v6 [3]:https://github.com/ben-ev/xbmc-remote [4]:https://github.com/ben-ev/xbmc-remote -[5]:https://github.com/features \ No newline at end of file +[5]:https://github.com/features From d9b893261b8b9577da1b4fe012ce5b64c022a230 Mon Sep 17 00:00:00 2001 From: wwy Date: Sat, 20 Jun 2015 00:39:46 +0800 Subject: [PATCH 430/965] Update 20150617 Tor Browser--An Ultimate Web Browser for Anonymous Web Browsing in Linux.md --- ...ltimate Web Browser for Anonymous Web Browsing in Linux.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150617 Tor Browser--An Ultimate Web Browser for Anonymous Web Browsing in Linux.md b/sources/tech/20150617 Tor Browser--An Ultimate Web Browser for Anonymous Web Browsing in Linux.md index 92fe36dae2..39d25f0456 100644 --- a/sources/tech/20150617 Tor Browser--An Ultimate Web Browser for Anonymous Web Browsing in Linux.md +++ b/sources/tech/20150617 Tor Browser--An Ultimate Web Browser for Anonymous Web Browsing in Linux.md @@ -1,3 +1,5 @@ +translating by wwy-hust + Tor Browser: An Ultimate Web Browser for Anonymous Web Browsing in Linux ================================================================================ Most of us give a considerable time of ours to Internet. The primary Application we require to perform our internet activity is a browser, a web browser to be more perfect. Over Internet most of our’s activity is logged to Server/Client machine which includes IP address, Geographical Location, search/activity trends and a whole lots of Information which can potentially be very harmful, if used intentionally the other way. @@ -203,4 +205,4 @@ via: http://www.tecmint.com/tor-browser-for-anonymous-web-browsing/ [a]:http://www.tecmint.com/author/avishek/ [1]:https://www.torproject.org/download/download-easy.html.en -[2]:http://tecmint.tradepub.com/free/w_make129/prgm.cgi \ No newline at end of file +[2]:http://tecmint.tradepub.com/free/w_make129/prgm.cgi From 1596b1beb60bc4be50a386155b71a6a304c6b7e4 Mon Sep 17 00:00:00 2001 From: wxy Date: Sat, 20 Jun 2015 07:08:33 +0800 Subject: [PATCH 431/965] PUB:20150507 Install uGet Download Manager 2.0 in Debian Ubuntu Linux Mint and Fedora @FSSlc --- ... in Debian Ubuntu Linux Mint and Fedora.md | 42 +++++++++++-------- 1 file changed, 24 insertions(+), 18 deletions(-) rename {translated/tech => published}/20150507 Install uGet Download Manager 2.0 in Debian Ubuntu Linux Mint and Fedora.md (74%) diff --git a/translated/tech/20150507 Install uGet Download Manager 2.0 in Debian Ubuntu Linux Mint and Fedora.md b/published/20150507 Install uGet Download Manager 2.0 in Debian Ubuntu Linux Mint and Fedora.md similarity index 74% rename from translated/tech/20150507 Install uGet Download Manager 2.0 in Debian Ubuntu Linux Mint and Fedora.md rename to published/20150507 Install uGet Download Manager 2.0 in Debian Ubuntu Linux Mint and Fedora.md index d5c2fc98f5..569a50d667 100644 --- a/translated/tech/20150507 Install uGet Download Manager 2.0 in Debian Ubuntu Linux Mint and Fedora.md +++ b/published/20150507 Install uGet Download Manager 2.0 in Debian Ubuntu Linux Mint and Fedora.md @@ -1,37 +1,37 @@ 在 Debian, Ubuntu, Linux Mint 及 Fedora 中安装 uGet 下载管理器 2.0 ================================================================================ -在经历了一段漫长的开发期后,期间发布了超过 11 个开发版本,最终 uGet 项目小组高兴地宣布 uGet 的最新稳定版本 uGet 2.0 已经可以下载使用了。最新版本包含许多吸引人的特点,例如一个新的设定对话框,改进了 aria2 插件对 BitTorrent 和 Metalink 协议的支持,同时对位于横栏中的 uGet RSS 信息提供了更好的支持,其他特点包括: +在经历了一段漫长的开发期后,并发布了超过 11 个开发版本,最终 uGet 项目小组高兴地宣布 uGet 的最新稳定版本 uGet 2.0 已经可以下载使用了。最新版本包含许多吸引人的特点,例如一个新的设定对话框,改进了 aria2 插件对 BitTorrent 和 Metalink 协议的支持,同时对位于横幅中的 uGet RSS 信息提供了更好的支持,其他特点包括: -- 一个新的 “检查更新” 按钮,提醒您有关新的发行版本的信息; +- 新增一个 “检查更新” 按钮,提醒您有关新的发行版本的信息; - 增添新的语言支持并升级了现有的语言; -- 增加了一个新的 “信息横栏” ,允许开发者轻松地向所有的用户提供有关 uGet 的信息; -- 通过对文档、提交反馈和错误报告等内容的链接,增强了帮助菜单; +- 新增一个 “信息横幅” ,可以让开发者轻松地向所有的用户提供有关 uGet 的信息; +- 增强了帮助菜单,包括文档、提交反馈和错误报告等内容的链接; - 将 uGet 下载管理器集成到了 Linux 平台下的两个主要的浏览器 Firefox 和 Google Chrome 中; - 改进了对 Firefox 插件 ‘FlashGot’ 的支持; ### 何为 uGet ### -uGet (先前名为 UrlGfe) 是一个开源,免费,且极其强大的基于 GTK 的多平台下载管理器应用程序,它用 C 语言写就,在 GPL 协议下发布。它提供了一大类的功能,如恢复先前的下载任务,支持多重下载,使用一个独立的配置来支持分类,剪贴板监视,下载队列,从 HTML 文件中导出 URL 地址,集成在 Firefox 中的 Flashgot 插件中,使用集成在 uGet 中的 aria2(一个命令行下载管理器) 来下载 torrent 和 metalink 文件。 +uGet (先前名为 UrlGfe) 是一个开源,免费,且极其强大的基于 GTK 的多平台下载管理器应用程序,它用 C 语言写就,在 GPL 协议下发布。它提供了大量功能,如恢复先前的下载任务,支持多点下载,使用一个独立的配置来支持分类,剪贴板监视,下载队列,从 HTML 文件中导出 URL 地址,集成在 Firefox 中的 Flashgot 插件中,使用集成在 uGet 中的 aria2(一个命令行下载管理器) 来下载 torrent 和 metalink 文件。 我已经在下面罗列出了 uGet 下载管理器的所有关键特点,并附带了详细的解释。 #### uGet 下载管理器的关键特点 #### -- 下载队列: 可以将你的下载任务放入一个队列中。当某些下载任务完成后,将会自动开始下载队列中余下的文件; +- 下载队列: 将你的下载任务放入一个队列中。当某些下载任务完成后,将会自动开始下载队列中余下的文件; - 恢复下载: 假如在某些情况下,你的网络中断了,不要担心,你可以从先前停止的地方继续下载或重新开始; - 下载分类: 支持多种分类来管理下载; - 剪贴板监视: 将要下载的文件类型复制到剪贴板中,便会自动弹出下载提示框以下载刚才复制的文件; - 批量下载: 允许你轻松地一次性下载多个文件; - 支持多种协议: 允许你轻松地使用 aria2 命令行插件通过 HTTP, HTTPS, FTP, BitTorrent 及 Metalink 等协议下载文件; - 多连接: 使用 aria2 插件,每个下载同时支持多达 20 个连接; -- 支持 FTP 登录或匿名 FTP 登录: 同时支持使用用户名和密码来登录 FTP 或匿名 FTP ; +- 支持 FTP 登录或 FTP 匿名登录: 同时支持使用用户名和密码来登录 FTP 或匿名 FTP ; - 队列下载: 新增队列下载,现在你可以对你的所有下载进行安排调度; - 通过 FlashGot 与 FireFox 集成: 与作为一个独立支持的 Firefox 插件的 FlashGot 集成,从而可以处理单个或大量的下载任务; - CLI 界面或虚拟终端支持: 提供命令行或虚拟终端选项来下载文件; - 自动创建目录: 假如你提供了一个先前并不存在的保存路径,uGet 将会自动创建这个目录; - 下载历史管理: 跟踪记录已下载和已删除的下载任务的条目,每个列表支持 9999 个条目,比当前默认支持条目数目更早的条目将会被自动删除; - 多语言支持: uGet 默认使用英语,但它可支持多达 23 种语言; -- Aria2 插件: uGet 集成了 Aria2 插件,来为 aria2 提供更友好的 GUI 界面; +- Aria2 插件: uGet 集成了 Aria2 插件,来为你提供更友好的 GUI 界面; 如若你想了解更加完整的特点描述,请访问 uGet 官方的 [特点页面][1]. @@ -43,7 +43,7 @@ uGet 开发者在 Linux 平台下的各种软件仓库中添加了 uGet 的最 #### 在 Debian 下 #### -在 Debian 的测试版本 (Jessie) 和不稳定版本 (Sid) 中,你可以在一个可信赖的基础上,使用官方的软件仓库轻易地安装和升级 uGet 。 +在 Debian Jessie 和Sid 中,你可以使用官方软件仓库轻易地安装和升级可靠的 uGet 软件包。 $ sudo apt-get update $ sudo apt-get install uget @@ -58,7 +58,7 @@ uGet 开发者在 Linux 平台下的各种软件仓库中添加了 uGet 的最 #### 在 Fedora 下 #### -在 Fedora 20 – 21 下,最新版本的 uGet(2.0) 可以从官方软件仓库中获得,从这些软件仓库中安装是非常值得信赖的。 +在 Fedora 20 – 21 下,最新版本的 uGet(2.0) 可以从官方软件仓库中获得可靠的软件包。 $ sudo yum install uget @@ -70,7 +70,7 @@ uGet 开发者在 Linux 平台下的各种软件仓库中添加了 uGet 的最 默认情况下,uGet 在当今大多数的 Linux 系统中使用 `curl` 来作为后端,但 aria2 插件将 curl 替换为 aria2 来作为 uGet 的后端。 -aria2 是一个单独的软件包,需要独立安装。你可以在你的 Linux 发行版本下,使用受支持的软件仓库来轻易地安装 aria2 的最新版本,或根据 [下载 aria2 页面][4] 来安装它,该页面详细解释了在各个发行版本中如何安装 aria2 。 +aria2 是一个单独的软件包,需要独立安装。你可以在你的 Linux 发行版下,使用受支持的软件仓库来轻易地安装 aria2 的最新版本,或根据 [下载 aria2 页面][4] 来安装它,该页面详细解释了在各个发行版本中如何安装 aria2 。 #### 在 Debian, Ubuntu 和 Linux Mint 下 #### @@ -91,28 +91,34 @@ Fedora 的官方软件仓库中已经添加了 aria2 软件包,所以你可以 为了启动 uGet,从桌面菜单的搜索栏中键入 "uGet"。可参考如下的截图: ![开启 uGet 下载管理器](http://www.tecmint.com/wp-content/uploads/2014/03/Start-uGet.gif) -开启 uGet 下载管理器 + +*开启 uGet 下载管理器* ![uGet 版本: 2.0](http://www.tecmint.com/wp-content/uploads/2014/03/uGet-Version.gif) -uGet 版本: 2.0 + +*uGet 版本: 2.0* #### 在 uGet 中激活 aria2 插件 #### 为了激活 aria2 插件, 从 uGet 菜单接着到 `编辑 –> 设置 –> 插件` , 从下拉菜单中选择 "aria2"。 ![为 uGet 启用 Aria2 插件](http://www.tecmint.com/wp-content/uploads/2014/03/Enable-Aria2-Plugin.gif) -为 uGet 启用 Aria2 插件 + +*为 uGet 启用 Aria2 插件* ### uGet 2.0 截图赏析 ### ![使用 Aria2 下载文件](http://www.tecmint.com/wp-content/uploads/2014/03/Download-Files-Using-Aria2.gif) -使用 Aria2 下载文件 + +*使用 Aria2 下载文件* ![使用 uGet 下载 Torrent 文件](http://www.tecmint.com/wp-content/uploads/2014/03/Download-Torrent-File.gif) -使用 uGet 下载 Torrent 文件 + +*使用 uGet 下载 Torrent 文件* ![使用 uGet 进行批量下载](http://www.tecmint.com/wp-content/uploads/2014/03/Batch-Download-Files.gif) -使用 uGet 进行批量下载 + +*使用 uGet 进行批量下载* 针对其他 Linux 发行版本和 Windows 平台的 RPM 包和 uGet 的源文件都可以在 uGet 的[下载页面][5] 下找到。 @@ -122,7 +128,7 @@ via: http://www.tecmint.com/install-uget-download-manager-in-linux/ 作者:[Ravi Saive][a] 译者:[FSSlc](https://github.com/FSSlc) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 3cf1d75d3c571aefabab8a9e57ead90e80d42969 Mon Sep 17 00:00:00 2001 From: wxy Date: Sat, 20 Jun 2015 07:08:52 +0800 Subject: [PATCH 432/965] =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...oS Attacks Using Mod_Security and Mod_evasive Modules.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/published/20150211 Protect Apache Against Brute Force or DDoS Attacks Using Mod_Security and Mod_evasive Modules.md b/published/20150211 Protect Apache Against Brute Force or DDoS Attacks Using Mod_Security and Mod_evasive Modules.md index 44ba66e7d5..bb69215e74 100644 --- a/published/20150211 Protect Apache Against Brute Force or DDoS Attacks Using Mod_Security and Mod_evasive Modules.md +++ b/published/20150211 Protect Apache Against Brute Force or DDoS Attacks Using Mod_Security and Mod_evasive Modules.md @@ -194,7 +194,7 @@ mod\_evasive被配置为使用/etc/httpd/conf.d/mod\_evasive.conf中的指令。 DOSSystemCommand "sudo /usr/local/bin/scripts-tecmint/ban_ip.sh %s" -上面一行的%s代表了由mod\_evasive检测到的攻击IP地址。 +上面一行的%s代表了由mod_evasive检测到的攻击IP地址。 #####将apache用户添加到sudoers文件##### @@ -233,7 +233,7 @@ mod\_evasive被配置为使用/etc/httpd/conf.d/mod\_evasive.conf中的指令。 我们的测试环境由一个CentOS 7服务器[IP 192.168.0.17]和一个Windows组成,在Windows[IP 192.168.0.103]上我们发起攻击: ![](http://www.tecmint.com/wp-content/uploads/2012/06/Confirm-Host-IPAddress.png) - +I *确认主机IP地址* 请播放下面的视频(YT 视频,请自备梯子: https://www.youtube.com/-U_mdet06Jk ),并跟从列出的步骤来模拟一个Dos攻击: @@ -257,7 +257,7 @@ mod\_evasive被配置为使用/etc/httpd/conf.d/mod\_evasive.conf中的指令。 -------------------------------------------------------------------------------- -via: http://www.tecmint.com/protect-apache-using-mod\_security-and-mod\_evasive-on-rhel-centos-fedora/ +via: http://www.tecmint.com/protect-apache-using-mod_security-and-mod_evasive-on-rhel-centos-fedora/ 作者:[Gabriel Cánepa][a] 译者:[wwy-hust](https://github.com/wwy-hust) From c61c01383bc68076f9e62baf175eccc695aa06c3 Mon Sep 17 00:00:00 2001 From: wxy Date: Sat, 20 Jun 2015 07:20:33 +0800 Subject: [PATCH 433/965] PUB:20150518 Linux FAQs with Answers--What is the Apache error log location on Linux @GOLinux --- ... the Apache error log location on Linux.md | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) rename {translated/tech => published}/20150518 Linux FAQs with Answers--What is the Apache error log location on Linux.md (74%) diff --git a/translated/tech/20150518 Linux FAQs with Answers--What is the Apache error log location on Linux.md b/published/20150518 Linux FAQs with Answers--What is the Apache error log location on Linux.md similarity index 74% rename from translated/tech/20150518 Linux FAQs with Answers--What is the Apache error log location on Linux.md rename to published/20150518 Linux FAQs with Answers--What is the Apache error log location on Linux.md index c43ac481e7..cf1ef694c0 100644 --- a/translated/tech/20150518 Linux FAQs with Answers--What is the Apache error log location on Linux.md +++ b/published/20150518 Linux FAQs with Answers--What is the Apache error log location on Linux.md @@ -1,8 +1,8 @@ -Linux有问必答——Linux上Apache错误日志的位置在哪里? +Linux有问必答:Linux上Apache错误日志的位置在哪里? ================================================================================ -> **问题**: 我尝试着解决我 Linux 系统上的 Apache 网络服务器的错误,Apache的错误日志文件放在[你的 Linux 版本]的哪个位置呢? +> **问题**: 我尝试着解决我 Linux 系统上的 Apache Web 服务器的错误,Apache的错误日志文件放在[XX Linux 版本]的哪个位置呢? -错误日志和访问日志文件为系统管理员提供了有用的信息,比如,为网络服务器排障,[保护][1]系统不受各种各样的恶意活动侵犯,或者只是进行[各种各样的][2][分析][3]以监控 HTTP 服务器。根据你网络服务器配置的不同,其错误/访问日志可能放在你系统中不同位置。 +错误日志和访问日志文件为系统管理员提供了有用的信息,比如,为 Web 服务器排障,[保护][1]系统不受各种各样的恶意活动侵犯,或者只是进行[各种各样的][2][分析][3]以监控 HTTP 服务器。根据你 Web 服务器配置的不同,其错误/访问日志可能放在你系统中不同位置。 本文可以帮助你**找到Linux上的Apache错误日志**。 @@ -28,7 +28,7 @@ Linux有问必答——Linux上Apache错误日志的位置在哪里? #### 使用虚拟主机自定义的错误日志 #### -如果在 Apache 网络服务器中使用了虚拟主机, ErrorLog 指令可能会在虚拟主机容器内指定,在这种情况下,上面所说的系统范围的错误日志位置将被忽略。 +如果在 Apache Web 服务器中使用了虚拟主机, ErrorLog 指令可能会在虚拟主机容器内指定,在这种情况下,上面所说的系统范围的错误日志位置将被忽略。 启用了虚拟主机后,各个虚拟主机可以定义其自身的自定义错误日志位置。要找出某个特定虚拟主机的错误日志位置,你可以打开 /etc/apache2/sites-enabled/.conf,然后查找 ErrorLog 指令,该指令会显示站点指定的错误日志文件。 @@ -40,11 +40,11 @@ Linux有问必答——Linux上Apache错误日志的位置在哪里? #### 自定义的错误日志 #### -要找出 Apache 错误日志的自定义位置,请用文本编辑器打开 /etc/httpd/conf/httpd.conf,然后查找 ServerRoot,该参数显示了 Apache 服务器目录树的顶层,日志文件和配置都位于该目录树中。例如: +要找出 Apache 错误日志的自定义位置,请用文本编辑器打开 /etc/httpd/conf/httpd.conf,然后查找 ServerRoot,该参数显示了 Apache Web 服务器目录树的顶层,日志文件和配置都位于该目录树中。例如: ServerRoot "/etc/httpd" -现在,查找 ErrorLog 开头的行,该行指出了 Apache 网络服务器将错误日志写到了哪里去。注意,指定的位置是 ServerRoot 值的相对位置。例如: +现在,查找 ErrorLog 开头的行,该行指出了 Apache Web 服务器将错误日志写到了哪里去。注意,指定的位置是 ServerRoot 值的相对位置。例如: ErrorLog "log/error_log" @@ -71,11 +71,11 @@ via: http://ask.xmodulo.com/apache-error-log-location-linux.html 作者:[Dan Nanni][a] 译者:[GOLinux](https://github.com/GOLinux) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 [a]:http://ask.xmodulo.com/author/nanni -[1]:http://xmodulo.com/configure-fail2ban-apache-http-server.html -[2]:http://xmodulo.com/interactive-apache-web-server-log-analyzer-linux.html -[3]:http://xmodulo.com/sql-queries-apache-log-files-linux.html +[1]:https://linux.cn/article-5068-1.html +[2]:https://linux.cn/article-5352-1.html +[3]:https://linux.cn/article-4405-1.html From de9e60ed616ab9a12539b65c656937edef6065ac Mon Sep 17 00:00:00 2001 From: wxy Date: Sat, 20 Jun 2015 07:35:10 +0800 Subject: [PATCH 434/965] PUB:20150520 How to compile and install wxWidgets on Ubuntu or Debian or Linux Mint @geekpi --- ...dgets on Ubuntu or Debian or Linux Mint.md | 25 ++++++++----------- 1 file changed, 11 insertions(+), 14 deletions(-) rename {translated/tech => published}/20150520 How to compile and install wxWidgets on Ubuntu or Debian or Linux Mint.md (81%) diff --git a/translated/tech/20150520 How to compile and install wxWidgets on Ubuntu or Debian or Linux Mint.md b/published/20150520 How to compile and install wxWidgets on Ubuntu or Debian or Linux Mint.md similarity index 81% rename from translated/tech/20150520 How to compile and install wxWidgets on Ubuntu or Debian or Linux Mint.md rename to published/20150520 How to compile and install wxWidgets on Ubuntu or Debian or Linux Mint.md index 1f733207f3..db8dc669dc 100644 --- a/translated/tech/20150520 How to compile and install wxWidgets on Ubuntu or Debian or Linux Mint.md +++ b/published/20150520 How to compile and install wxWidgets on Ubuntu or Debian or Linux Mint.md @@ -1,16 +1,13 @@ 如何在Ubuntu/Debian/Linux Mint中编译和安装wxWidgets ================================================================================ + ### wxWidgets ### -wxWidgets是一个程序开发框架/库, 允许你在Windows、Mac、Linux中使用相同的代码跨平台开发。 - -它主要用C++写成,但也可以与其他语言绑定比如Python、Perl、Ruby。 +wxWidgets是一个程序开发框架/库, 允许你在Windows、Mac、Linux中使用相同的代码跨平台开发。它主要用C++写成,但也可以与其他语言绑定比如Python、Perl、Ruby。 本教程中我将向你展示如何在基于Debian的linux中如Ubuntu和Linux Mint中编译wxwidgets 3.0+。 -从源码编译wxWidgets并不困难,仅仅需要几分钟。 - -库可以按不同的方式来编译,比如静态或者动态库。 +从源码编译wxWidgets并不困难,仅仅需要几分钟。库可以按不同的方式来编译,比如静态或者动态库。 ### 1. 下载 wxWidgets ### @@ -20,13 +17,13 @@ wxWidgets是一个程序开发框架/库, 允许你在Windows、Mac、Linux中 ### 2. 设置编译环境 ### -要编译wxwidgets,我们需要一些工具包括C++编译器, 在Linux上是g++。所有这些可以通过apt-get工具从仓库中安装。 +要编译wxwidgets,我们需要一些工具包括C++编译器,在Linux上是g++。所有这些可以通过apt-get工具从仓库中安装。 我们还需要wxWidgets依赖的GTK开发库。 $ sudo apt-get install libgtk-3-dev build-essential checkinstall ->checkinstall工具允许我们为wxwidgets创建一个安装包,这样之后就可以轻松的使用包管理器来卸载。 +> 这个叫做checkinstall的工具允许我们为wxwidgets创建一个安装包,这样之后就可以轻松的使用包管理器来卸载。 ### 3. 编译 wxWidgets ### @@ -42,7 +39,7 @@ wxWidgets是一个程序开发框架/库, 允许你在Windows、Mac、Linux中 "--disable-shared"选项将会编译静态库而不是动态库。 -make命令完成后,编译也成功了。是时候安装wxWidgets到正确的目录。 +make命令完成后,编译就成功了。是时候安装wxWidgets到正确的目录。 更多信息请参考install.txt和readme.txt,这可在wxwidgets中的/docs/gtk/目录下找到。 @@ -58,7 +55,7 @@ checkinstall会询问几个问题,请保证在提问后提供一个版本号 ### 5. 追踪安装的文件 ### -如果你想要检查文件安装的位置,使用dpkg命令后面跟上checkinstall提供的报名。 +如果你想要检查文件安装的位置,使用dpkg命令后面跟上checkinstall提供的包名。 $ dpkg -L package_name /. @@ -85,17 +82,17 @@ checkinstall会询问几个问题,请保证在提问后提供一个版本号 $ cd samples/ $ make -make命令完成后,进入sampl子目录,这里就有一个可以马上运行的Demo程序了。 +make命令完成后,进入sample 子目录,这里就有一个可以马上运行的Demo程序了。 ### 7. 编译你的第一个程序 ### 你完成编译demo程序后,可以写你自己的程序来编译了。这个也很简单。 -假设你用的是C++这样你可以使用编辑器的高亮特性。比如gedit、kate、kwrite等等。或者用全功能的IDE像Geany、Codelite、Codeblocks等等。 +假设你用的是C++,这样的话你还可以使用编辑器的高亮特性。比如gedit、kate、kwrite等等。或者用全功能的IDE像Geany、Codelite、Codeblocks等等。 然而你的第一个程序只需要用一个文本编辑器来快速完成。 -这里就是 +如下: #include @@ -155,7 +152,7 @@ via: http://www.binarytides.com/install-wxwidgets-ubuntu/ 作者:[Silver Moon][a] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From cd0acd37eb19bcc4c8545f3c03648741ab2721ac Mon Sep 17 00:00:00 2001 From: wxy Date: Sat, 20 Jun 2015 07:59:00 +0800 Subject: [PATCH 435/965] PUB:20150525 Linux ntopng--Network Monitoring Tool Installation Screenshots @GOLinux --- ...onitoring Tool Installation Screenshots.md | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) rename {translated/tech => published}/20150525 Linux ntopng--Network Monitoring Tool Installation Screenshots.md (82%) diff --git a/translated/tech/20150525 Linux ntopng--Network Monitoring Tool Installation Screenshots.md b/published/20150525 Linux ntopng--Network Monitoring Tool Installation Screenshots.md similarity index 82% rename from translated/tech/20150525 Linux ntopng--Network Monitoring Tool Installation Screenshots.md rename to published/20150525 Linux ntopng--Network Monitoring Tool Installation Screenshots.md index dc039ba551..72eae8b0bb 100644 --- a/translated/tech/20150525 Linux ntopng--Network Monitoring Tool Installation Screenshots.md +++ b/published/20150525 Linux ntopng--Network Monitoring Tool Installation Screenshots.md @@ -1,8 +1,8 @@ -Linux ntopng——网络监控工具的安装(附截图) +Linux 上网络监控工具 ntopng 的安装 ================================================================================ -当今世界,人们的计算机都相互连接,互联互通。小到你的家庭局域网(LAN),大到最大的一个被我们称为的——互联网。当你管理一台联网的计算机时,你就是在管理最关键的组件之一。由于大多数开发出的应用程序都基于网络,网络就连接起了这些关键点。 +当今世界,人们的计算机都相互连接,互联互通。小到你的家庭局域网(LAN),大到最大的一个被我们称为互联网。当你管理一台联网的计算机时,你就是在管理最关键的组件之一。由于大多数开发出的应用程序都基于网络,网络就连接起了这些关键点。 -这就是为什么我们需要网络监控工具。最好的网络监控工具之一,它叫作ntop。来自[维基百科][1]的知识“ntop是一个网络探测器,它以与top显示进程般类似的方式显示网络使用率。在交互模式中,它显示了用户终端上的网络状态。在网页模式中,它作为网络服务器,创建网络状态的HTML转储文件。它支持NetFlow/sFlowemitter/collector,这是一个基于HTTP的客户端界面,用于创建ntop为中心的监控应用和RRD用于持续地存储通信数据” +这就是为什么我们需要网络监控工具。ntop 是最好的网络监控工具之一。来自[维基百科][1]的知识“ntop是一个网络探测器,它以与top显示进程般类似的方式显示网络使用率。在交互模式中,它显示了用户终端上的网络状态。在网页模式中,它作为网络服务器,创建网络状态的HTML转储文件。它支持NetFlow/sFlowemitter/collector,这是一个基于HTTP的客户端界面,用于创建ntop为中心的监控应用,并使用RRD来持续存储通信数据”。 15年后的今天,你将见到ntopng——下一代ntop。 @@ -15,7 +15,7 @@ Ntopng是一个基于网页的高速通信分析器和流量收集器。Ntopng 从[ntopng网站][2]上,我们可以看到他们说它有众多的特性。这里列出了其中一些: - 按各种协议对网络通信排序 -- 显示网络通信和IPv4/v6激活的主机 +- 显示网络通信和IPv4/v6的激活主机 - 持续不断以RRD格式存储定位主机的通信数据到磁盘 - 通过nDPI,ntop的DPI框架,发现应用协议 - 显示各种协议间的IP通信分布 @@ -24,11 +24,9 @@ Ntopng是一个基于网页的高速通信分析器和流量收集器。Ntopng - 报告按协议类型排序的IP协议使用率 - 生成HTML5/AJAX网络通信数据 -### 安装 ### +### 安装的先决条件 ### -Ntop为CentOS和**基于64位**Ubuntu预编译好了包,你可以在[他们的下载页面][3]找到这些包。对于32位操作系统,你必须从源代码编译。本文在**CentOS 6.4 32位**版本上**测试过**。但是,它也可以在其它基于CentOS/RedHat的Linux版本上工作。让我们开始吧。 - -#### 先决条件 #### +Ntop为CentOS和**基于64位**Ubuntu预编译好了包,你可以在[它们的下载页面][3]找到这些包。对于32位操作系统,你必须从源代码编译。本文在**CentOS 6.4 32位**版本上**测试过**。但是,它也可以在其它基于CentOS/RedHat的Linux版本上工作。让我们开始吧。 #### 开发工具 #### @@ -78,7 +76,7 @@ Ntop为CentOS和**基于64位**Ubuntu预编译好了包,你可以在[他们的 # make # make install -*由于ntopng是一个基于网页的应用,你的系统必须安装有工作良好的网络服务器* +*由于ntopng是一个基于网页的应用,你的系统必须安装有工作良好的 Web 服务器* ### 为ntopng创建配置文件 ### @@ -89,13 +87,16 @@ Ntop为CentOS和**基于64位**Ubuntu预编译好了包,你可以在[他们的 # cd ntopng # vi ntopng.start - 放入这些行: - --local-network “10.0.2.0/24” +放入这些行: + + --local-network "10.0.2.0/24" --interface 1 +--- # vi ntopng.pid - 放入该行: +放入该行: + -G=/var/run/ntopng.pid 保存这些文件,然后继续下一步。 @@ -128,7 +129,7 @@ Ntop为CentOS和**基于64位**Ubuntu预编译好了包,你可以在[他们的 ![Ntopng Flows](http://blog.linoxide.com/wp-content/uploads/2013/11/ntopng_flows.png) -在**主机菜单**上,你可以看到连接到流的所有主机 +在**主机菜单**上,你可以看到连接到流的所有主机。 ![Ntopng Hosts List](http://blog.linoxide.com/wp-content/uploads/2013/11/ntopng_hoslist.png) @@ -146,8 +147,7 @@ Ntop为CentOS和**基于64位**Ubuntu预编译好了包,你可以在[他们的 ![Ntopng Apps](http://blog.linoxide.com/wp-content/uploads/2013/11/ntopng_apps.png) -**界面菜单**将引领你进入更多内部菜单。 -包菜单将给你显示包的分布大小。 +**界面菜单**将引领你进入更多内部菜单。包菜单将给你显示包的大小分布。 ![Ntopng packets](http://blog.linoxide.com/wp-content/uploads/2013/11/ntopng_packets.png) @@ -157,7 +157,7 @@ Ntop为CentOS和**基于64位**Ubuntu预编译好了包,你可以在[他们的 ![Ntopng protocols - detail](http://blog.linoxide.com/wp-content/uploads/2013/11/ntopng_protocol_detail.png) -你也可以通过使用**历史活跃度菜单**查看活跃度 +你也可以通过使用**历史活跃度菜单**查看活跃度。 ![Ntopng Historical Activity](http://blog.linoxide.com/wp-content/uploads/2013/11/ntopng_historical.png) @@ -167,7 +167,7 @@ Ntop为CentOS和**基于64位**Ubuntu预编译好了包,你可以在[他们的 ![Ntopng Users](http://blog.linoxide.com/wp-content/uploads/2013/11/ntopng_users.png) -Ntopng为你提供了一个范围宽广的时间线,从5分钟到1年都可以。你只需要点击你想要现实的时间线。图标本身是可以点击的,你可以点击它来进行缩放。 +Ntopng为你提供了一个范围宽广的时间线,从5分钟到1年都可以。你只需要点击你想要显示的时间线。图表本身是可以点击的,你可以点击它来进行缩放。 当然,ntopng能做的事比上面图片中展示的还要多得多。你也可以将定位和电子地图服务整合进来。在ntopng自己的网站上,有已付费的模块可供使用,如nprobe可以扩展ntopng可以提供给你的信息。更多关于ntopng的信息,你可以访问[ntopng网站][5]。 @@ -177,7 +177,7 @@ via: http://linoxide.com/monitoring-2/ntopng-network-monitoring-tool/ 作者:[Pungki Arianto][a] 译者:[GOLinux](https://github.com/GOLinux) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 8ca81718f9c2def077b0f67728d8de8165ee2f6e Mon Sep 17 00:00:00 2001 From: wi-cuckoo Date: Sat, 20 Jun 2015 08:53:12 +0800 Subject: [PATCH 436/965] translating wi-cuckoo --- .../20150618 What will be the future of Linux without Linus.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/talk/20150618 What will be the future of Linux without Linus.md b/sources/talk/20150618 What will be the future of Linux without Linus.md index e042fdbe61..92b9e9ee4d 100644 --- a/sources/talk/20150618 What will be the future of Linux without Linus.md +++ b/sources/talk/20150618 What will be the future of Linux without Linus.md @@ -1,3 +1,4 @@ +translating wi-cuckoo What will be the future of Linux without Linus? ================================================================================ ![](http://i2.wp.com/www.linuxveda.com/wp-content/uploads/2015/06/linus-torvalds-painting.jpg) @@ -182,4 +183,4 @@ via: http://www.linuxveda.com/2015/06/17/what-happens-to-linux-after-linus/ 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 -[a]:http://www.linuxveda.com/author/arnieswap/ \ No newline at end of file +[a]:http://www.linuxveda.com/author/arnieswap/ From 3ae99e2452d06943e3c2ec9b5b4467d5c8dfc598 Mon Sep 17 00:00:00 2001 From: KS Date: Sat, 20 Jun 2015 12:50:51 +0800 Subject: [PATCH 437/965] =?UTF-8?q?=E5=AE=8C=E6=88=90=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 完成翻译 --- ...w We Designed for Performance and Scale.md | 174 ++++++++++++++++++ 1 file changed, 174 insertions(+) create mode 100644 translated/tech/20150612 Inside NGINX--How We Designed for Performance and Scale.md diff --git a/translated/tech/20150612 Inside NGINX--How We Designed for Performance and Scale.md b/translated/tech/20150612 Inside NGINX--How We Designed for Performance and Scale.md new file mode 100644 index 0000000000..fcf195115d --- /dev/null +++ b/translated/tech/20150612 Inside NGINX--How We Designed for Performance and Scale.md @@ -0,0 +1,174 @@ +NGINX内部: 我们如何设计性能和扩展 +================================================================================ +NGINX是web应用中性能最好的一个,这一切都是由于软件设计。而许多web服务器和应用程序服务器使用一个简单的线程或基于流程的架构,NGINX立足于一个复杂的事件驱动的体系结构,使它能够在现代硬件上扩展到成千上万的并发连接。 + +[NGINX内部][1]信息图从高级流程架构深度挖掘说明了NGINX如何在单进程里保持多连接。这个博客进一步详细地解释了这一切是如何工作的。 + +### 知识 – NGINX进程模型 ### + +![Master Process](http://cdn.nginx.com/wp-content/uploads/2015/06/Screen-Shot-2015-06-08-at-12.36.30-PM.png) + +为了更好的理解这个设计,你需要理解NGINX如何运行的。NGINX有一个主进程(它执行特权操作如读取配置和绑定端口)和一些工作进程与辅助进程。 + + # service nginx restart + * Restarting nginx + # ps -ef --forest | grep nginx + root 32475 1 0 13:36 ? 00:00:00 nginx: master process /usr/sbin/nginx \ + -c /etc/nginx/nginx.conf + nginx 32476 32475 0 13:36 ? 00:00:00 \_ nginx: worker process + nginx 32477 32475 0 13:36 ? 00:00:00 \_ nginx: worker process + nginx 32479 32475 0 13:36 ? 00:00:00 \_ nginx: worker process + nginx 32480 32475 0 13:36 ? 00:00:00 \_ nginx: worker process + nginx 32481 32475 0 13:36 ? 00:00:00 \_ nginx: cache manager process + nginx 32482 32475 0 13:36 ? 00:00:00 \_ nginx: cache loader process + +在四核服务器,NGINX主进程创建4工作进程和两个管理磁盘内容缓存的缓存辅助进程。 + +### 为什么架构很重要? ### + +任何Unix应用程序的根本基础是线程或进程。(从Linux操作系统的角度来看,线程和进程大多是相同的,主要的区别是他们共享内存的程度。)一个线程或进程是一个独立的指令,操作系统可以运行在一个CPU核心。大多数复杂的应用程序并行运行多个线程或进程有两个原因: + +- 他们可以同时使用更多的计算核心。 +- 线程或进程可以轻松实现并行操作。(例如,在同一时刻保持多连接)。 + +进程和线程消耗资源。他们每个都使用内存和其他系统资源,他们需要被交换进出核心(一个操作可以叫做上下文切换)。大多数现代服务器可以保持上百小型、活动的并发连接,一旦内存耗尽或高I/O压力引起大量的上下文切换性能会严重下降。 + +网络应用程序设计的常用方法是为每个连接分配一个线程或进程。此体系结构简单、容易实现,但是当应用程序需要处理成千上万的并发连接时这种结构不具规模。 + +### NGINX如何工作? ### + +NGINX使用一种可预测进程模式,被调到了可使用的硬件资源上: + +- 主进程执行特权操作,如读取配置和绑定端口,然后创建一个小数量的子进程(接下来的三种类型)。 +- 缓存加载程序进程在加载磁盘缓存到内存中时开始运行,然后退出。它被适当的安排,所以其资源需求很低。 +- 缓存管理器进程定期修剪磁盘缓存中的记录来保持他们在配置的大小之内。 +- 工作进程做所有的工作!他们保持网络连接、读写内容到磁盘,与上游服务器通信。 + +在大多数情况下建议NGINX的配置 – 每个CPU核心运行一个工作进程 – 最有效地利用硬件资源。你的配置包含了[worker_processes auto][2]指令配置: + + worker_processes auto; + +当一个NGINX服务处于活动状态,只有工作进程是忙碌的。每个工作进程以非阻塞方式保持多连接,减少上下文交换。 + +每个工作进程是一个单线程并且独立运行,获取新链接并处理他们。这些进程可以使用共享内存通信来共享缓存数据,会话持久性数据,和其他共享资源。 + +### NGINX工作进程内部 ### + +![](http://cdn.nginx.com/wp-content/uploads/2015/06/Screen-Shot-2015-06-08-at-12.39.48-PM.png) + +NGINX主进程通过NGINX配置初始化每个工作进程并提供一组监听端口。 + +NGINX工作进程首先在监听套接字上等待事件([accept_mutex][3]和[内核套接字分片][4])。事件被新进来的链接初始化。这些连接被分配到一个状态机 – HTTP状态机是最常用的,但NGINX也具备流式(原始的TCP)状态机和大量的邮件协议(SMTP、IMAP和POP3)。 + +![Internet Requests](http://cdn.nginx.com/wp-content/uploads/2015/06/Screen-Shot-2015-06-08-at-12.40.32-PM.png) + +状态机本质上是一组指令,告诉NGINX如何处理一个请求。大多数web服务器执行相同的函数作为NGINX使用类似的状态机 - 区别在于实现。 + +### 调度状态机 ### + +把状态机想象成国际象棋的规则。每个HTTP事务是一个象棋游戏。一方面棋盘是web服务器 – 一位大师可以非常迅速地做出决定。另一方面是远程客户端 – 在一个相对较慢的网络下web浏览器访问网站或应用程序。 + +不管咋地,这个游戏规则很复杂。例如,web服务器可能需要与各方沟通(代理一个上游的应用程序)或与身份验证服务器对话。web服务器的第三方模块甚至可以扩展游戏规则。 + +#### 一个阻塞状态机 #### + +回忆我们描述一个进程或线程就像一个独立的指令集,操作系统可以调度运行它在一个CPU核心。大多数web服务器和web应用使用一个进程一个链接或者一个线程一个链接的模式来运行这个“象棋游戏”。每个进程或线程都包含指令来玩“一个游戏”直到结束。一次进程在服务器运行,它花费大部分的时间“阻塞” - 等待客户端完成它的下一步行动。 + +![Blocking I/O](http://cdn.nginx.com/wp-content/uploads/2015/06/Screen-Shot-2015-06-08-at-12.40.52-PM.png) + +1. web服务器进程在监听套接字监听新连接(客户端发起新“游戏”) +1. 当它获得一个新游戏,就玩这个游戏,每走一步去等待客户端响应时就阻塞了。 +1. 游戏完成后,web服务器进程可能会等待是否有客户机想要开始一个新游戏(这对应于一个保持连接)。如果这个链接关闭了(客户端离开或者发生超时),web服务器进程返回监听一个新“游戏”。 + +要记住最重要的一点是每个活动的HTTP链接(每局棋)需要一个专用的进程或线程(象棋高手)。这个结构简单容并且易扩展第三方模块(“新规则”)。无论如何,还是有巨大的不平衡:尤其是轻量的HTTP链接,作为代表是一个文件描述符和小量的内存,映射到一个单独的线程或进程,一个非常重量的系统对象。这种方式易于编程,但太过浪费。 + +#### NGINX是一个真正的象棋大师 #### + +也许你听过[同时表演赛][5]游戏,有一个象棋大师同时对战许多对手? + +![Kiril Georgiev](http://cdn.nginx.com/wp-content/uploads/2015/06/Kiril-Georgiev.gif) + +[列夫·吉奥吉夫在保加利亚的索非亚同时对阵360人][6]。他的最终成绩是284胜70平6负。 + +这就是NGINX工作进程如何“下棋”的。每个工作进程(记住 - 通常每个CPU核心上有一个工作进程)是一个可同时对战上百人(事实是,成百上千)的象棋大师。 + +![Event-driven Architecture](http://cdn.nginx.com/wp-content/uploads/2015/06/Screen-Shot-2015-06-08-at-12.41.13-PM.png) + +1. 工作进程在监听和链接套接字上等待事件。 +1. 事件发生在套接字并且由工作进程处理它们: + + - 在监听套接字的事件意味着一个客户端已经开始了一局新棋局。工作进程创建了一个新链接套接字。 + - 在链接套接字的事件意味着客户端已经下了一步棋。工作进程快速的响应。 + +一个工作进程在网络流量上从不阻塞,等待它的“对手”(客户端)做出反应。当它下了一步,工作进程立即继续其他的游戏,在那里工作进程正在处理下一步,或者在门口欢迎一个新玩家。 + +### 为什么这个比阻塞式多进程架构更快? ### + +NGINX每个工作进程很好的扩展支撑了成百上千的链接。每个链接在工作进程中创建另一个文件描述符和消耗一小部分额外内存。每个链接很少有额外的开销。NGINX进程可以固定在一些CPU上。上下文交换非常罕见,只发生在没有工作要做。 + +阻塞方式,一个链接一个进程的方法中,每个连接需要大量额外的资源和开销,和上下文切换(从一个进程切换到另一个)非常频繁 + +更详细的解释,看看这个[文章][7]关于NGINX架构,由NGINX公司发展副总裁和创始人之一 Andrew Alexeev 著。 + +适当的[系统优化][8],NGINX的每个工作进程可以扩展来处理成千上万的并发HTTP连接,并能脸不红心不跳的承受峰值流量(大量涌入的新“游戏”)。 + +### 更新配置和升级NGINX ### + +NGINX是过程体系架构,有一小部分工作进程,有助于有效的更新配置文件甚至NGINX程序本身。 + +![Updating Configuration](http://cdn.nginx.com/wp-content/uploads/2015/06/Screen-Shot-2015-06-08-at-12.41.33-PM.png) + +更新NGINX配置文件是非常简单、轻量、可靠的操作。它通常意味着运行命令`nginx –s reload`,所做的就是检查磁盘上的配置并发送SIGHUP信号给主进程。 + +当主进程接收到一个SIGHUP信号,它会做两件事: + +- 重载配置文件和分出一组新的工作进程。这些新的工作进程立即开始接受连接和处理流量(使用新的配置设置) +- 通知旧的工作进程优雅的退出。工作进程停止接受新的链接。当前的http请求一完成,工作进程就彻底关闭这个链接(那就是,没有残存的保持链接)。一旦所有链接关闭,这个工作进程就退出。 + +这个重载过程能引发一个CPU和内存使用的小峰值,但是跟活动链接加载的支援比它一般不易察觉。你可以每秒多次重载配置(很多NGINX用户都这么做)。很少情况下,问题发生在很多代的工作进程等待关闭连接时,但即使是那样也很快被解决了。 + +NGINX的程序升级过程中实现了高可用的圣杯 - 你可以随随时更新这个软件,不会丢失连接,停机,或者中断服务。 + +![New Binary](http://cdn.nginx.com/wp-content/uploads/2015/06/Screen-Shot-2015-06-08-at-12.41.51-PM.png) + +程序升级过程很像优雅的重载配置的方法。一个新的NGINX主进程与原主进程并行运行,然后他们共享监听套接字。两个进程都是活动的,并且各自的工作进程处理流量。然后你可以通知旧主进程和他的工作进程优雅的退出。 + +整个进程的详细描述在[NGINX管理][9]. + +### 结论 ### + +[NGINX内部信息图][10] 提供一个NGINX功能实现的高级的概况,但在这简单的解释是超过十年的创新和优化,使Nginx在一个范围广泛的硬件上提供尽可能最好的性能同时保持现代Web应用程序需要的安全性和可靠性。 + +如果你想阅读更多关于NGINX的优化,查看这些优秀的资源: + +- [Installing and Tuning NGINX for Performance][11] (webinar; [slides][12] at Speaker Deck) +- [Tuning NGINX for Performance][13] +- [The Architecture of Open Source Applications – NGINX][14] +- [Socket Sharding in NGINX Release 1.9.1][15] (using the SO_REUSEPORT socket option) + +-------------------------------------------------------------------------------- + +via: http://nginx.com/blog/inside-nginx-how-we-designed-for-performance-scale/ + +作者:[Owen Garrett][a] +译者:[wyangsun](https://github.com/wyangsun) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://nginx.com/author/owen/ +[1]:http://nginx.com/resources/library/infographic-inside-nginx/ +[2]:http://nginx.org/en/docs/ngx_core_module.html#worker_processes +[3]:http://nginx.org/en/docs/ngx_core_module.html#accept_mutex +[4]:http://nginx.com/blog/socket-sharding-nginx-release-1-9-1/ +[5]:http://en.wikipedia.org/wiki/Simultaneous_exhibition +[6]:http://gambit.blogs.nytimes.com/2009/03/03/in-chess-records-were-made-to-be-broken/ +[7]:http://www.aosabook.org/en/nginx.html +[8]:http://nginx.com/blog/tuning-nginx/ +[9]:http://nginx.org/en/docs/control.html +[10]:http://nginx.com/resources/library/infographic-inside-nginx/ +[11]:http://nginx.com/resources/webinars/installing-tuning-nginx/ +[12]:https://speakerdeck.com/nginx/nginx-installation-and-tuning +[13]:http://nginx.com/blog/tuning-nginx/ +[14]:http://www.aosabook.org/en/nginx.html +[15]:http://nginx.com/blog/socket-sharding-nginx-release-1-9-1/ From 78961d0aeabd510a170a970075e5030f2154499d Mon Sep 17 00:00:00 2001 From: KS Date: Sat, 20 Jun 2015 12:51:40 +0800 Subject: [PATCH 438/965] Delete 20150612 Inside NGINX--How We Designed for Performance and Scale.md --- ...w We Designed for Performance and Scale.md | 175 ------------------ 1 file changed, 175 deletions(-) delete mode 100644 sources/tech/20150612 Inside NGINX--How We Designed for Performance and Scale.md diff --git a/sources/tech/20150612 Inside NGINX--How We Designed for Performance and Scale.md b/sources/tech/20150612 Inside NGINX--How We Designed for Performance and Scale.md deleted file mode 100644 index 970144275f..0000000000 --- a/sources/tech/20150612 Inside NGINX--How We Designed for Performance and Scale.md +++ /dev/null @@ -1,175 +0,0 @@ -wyangsun 申领 -Inside NGINX: How We Designed for Performance & Scale -================================================================================ -NGINX leads the pack in web performance, and it’s all due to the way the software is designed. Whereas many web servers and application servers use a simple threaded or process-based architecture, NGINX stands out with a sophisticated event-driven architecture that enables it to scale to hundreds of thousands of concurrent connections on modern hardware. - -The [Inside NGINX][1] infographic drills down from the high-level process architecture to illustrate how NGINX handles multiple connections within a single process. This blog explains how it all works in further detail. - -### Setting the Scene – the NGINX Process Model ### - -![Master Process](http://cdn.nginx.com/wp-content/uploads/2015/06/Screen-Shot-2015-06-08-at-12.36.30-PM.png) - -To better understand this design, you need to understand how NGINX runs. NGINX has a master process (which performs the privileged operations such as reading configuration and binding to ports) and a number of worker and helper processes. - - # service nginx restart - * Restarting nginx - # ps -ef --forest | grep nginx - root 32475 1 0 13:36 ? 00:00:00 nginx: master process /usr/sbin/nginx \ - -c /etc/nginx/nginx.conf - nginx 32476 32475 0 13:36 ? 00:00:00 \_ nginx: worker process - nginx 32477 32475 0 13:36 ? 00:00:00 \_ nginx: worker process - nginx 32479 32475 0 13:36 ? 00:00:00 \_ nginx: worker process - nginx 32480 32475 0 13:36 ? 00:00:00 \_ nginx: worker process - nginx 32481 32475 0 13:36 ? 00:00:00 \_ nginx: cache manager process - nginx 32482 32475 0 13:36 ? 00:00:00 \_ nginx: cache loader process - -On this 4-core server, the NGINX master process creates 4 worker processes and a couple of cache helper processes which manage the on-disk content cache. - -### Why Is Architecture Important? ### - -The fundamental basis of any Unix application is the thread or process. (From the Linux OS perspective, threads and processes are mostly identical; the major difference is the degree to which they share memory.) A thread or process is a self-contained set of instructions that the operating system can schedule to run on a CPU core. Most complex applications run multiple threads or processes in parallel for two reasons: - -- They can use more compute cores at the same time. -- Threads and processes make it very easy to do operations in parallel (for example, to handle multiple connections at the same time). - -Processes and threads consume resources. They each use memory and other OS resources, and they need to be swapped on and off the cores (an operation called a context switch). Most modern servers can handle hundreds of small, active threads or processes simultaneously, but performance degrades seriously once memory is exhausted or when high I/O load causes a large volume of context switches. - -The common way to design network applications is to assign a thread or process to each connection. This architecture is simple and easy to implement, but it does not scale when the application needs to handle thousands of simultaneous connections. - -### How Does NGINX Work? ### - -NGINX uses a predictable process model that is tuned to the available hardware resources: - -- The master process performs the privileged operations such as reading configuration and binding to ports, and then creates a small number of child processes (the next three types). -- The cache loader process runs at startup to load the disk-based cache into memory, and then exits. It is scheduled conservatively, so its resource demands are low. -- The cache manager process runs periodically and prunes entries from the disk caches to keep them within the configured sizes. -- The worker processes do all of the work! They handle network connections, read and write content to disk, and communicate with upstream servers. - -The NGINX configuration recommended in most cases – running one worker process per CPU core – makes the most efficient use of hardware resources. You configure it by including the [worker_processes auto][2] directive in the configuration: - - worker_processes auto; - -When an NGINX server is active, only the worker processes are busy. Each worker process handles multiple connections in a non-blocking fashion, reducing the number of context switches. - -Each worker process is single-threaded and runs independently, grabbing new connections and processing them. The processes can communicate using shared memory for shared cache data, session persistence data, and other shared resources. - -### Inside the NGINX Worker Process ### - -![](http://cdn.nginx.com/wp-content/uploads/2015/06/Screen-Shot-2015-06-08-at-12.39.48-PM.png) - -Each NGINX worker process is initialized with the NGINX configuration and is provided with a set of listen sockets by the master process. - -The NGINX worker processes begin by waiting for events on the listen sockets ([accept_mutex][3] and [kernel socket sharding][4]). Events are initiated by new incoming connections. These connections are assigned to a state machine – the HTTP state machine is the most commonly used, but NGINX also implements state machines for stream (raw TCP) traffic and for a number of mail protocols (SMTP, IMAP, and POP3). - -![Internet Requests](http://cdn.nginx.com/wp-content/uploads/2015/06/Screen-Shot-2015-06-08-at-12.40.32-PM.png) - -The state machine is essentially the set of instructions that tell NGINX how to process a request. Most web servers that perform the same functions as NGINX use a similar state machine – the difference lies in the implementation. - -### Scheduling the State Machine ### - -Think of the state machine like the rules for chess. Each HTTP transaction is a chess game. On one side of the chessboard is the web server – a grandmaster who can make decisions very quickly. On the other side is the remote client – the web browser that is accessing the site or application over a relatively slow network. - -However, the rules of the game can be very complicated. For example, the web server might need to communicate with other parties (proxying to an upstream application) or talk to an authentication server. Third-party modules in the web server can even extend the rules of the game. - -#### A Blocking State Machine #### - -Recall our description of a process or thread as a self-contained set of instructions that the operating system can schedule to run on a CPU core. Most web servers and web applications use a process-per-connection or thread-per-connection model to play the chess game. Each process or thread contains the instructions to play one game through to the end. During the time the process is run by the server, it spends most of its time ‘blocked’ – waiting for the client to complete its next move. - -![Blocking I/O](http://cdn.nginx.com/wp-content/uploads/2015/06/Screen-Shot-2015-06-08-at-12.40.52-PM.png) - -1. The web server process listens for new connections (new games initiated by clients) on the listen sockets. -1. When it gets a new game, it plays that game, blocking after each move to wait for the client’s response. -1. Once the game completes, the web server process might wait to see if the client wants to start a new game (this corresponds to a keepalive connection). If the connection is closed (the client goes away or a timeout occurs), the web server process returns to listening for new games. - -The important point to remember is that every active HTTP connection (every chess game) requires a dedicated process or thread (a grandmaster). This architecture is simple and easy to extend with third-party modules (‘new rules’). However, there’s a huge imbalance: the rather lightweight HTTP connection, represented by a file descriptor and a small amount of memory, maps to a separate thread or process, a very heavyweight operating system object. It’s a programming convenience, but it’s massively wasteful. - -#### NGINX is a True Grandmaster #### - -Perhaps you’ve heard of [simultaneous exhibition][5] games, where one chess grandmaster plays dozens of opponents at the same time? - -![Kiril Georgiev](http://cdn.nginx.com/wp-content/uploads/2015/06/Kiril-Georgiev.gif) - -[Kiril Georgiev played 360 people simultaneously in Sofia, Bulgaria][6]. His final score was 284 wins, 70 draws and 6 losses. - -That’s how an NGINX worker process plays “chess.” Each worker (remember – there’s usually one worker for each CPU core) is a grandmaster that can play hundreds (in fact, hundreds of thousands) of games simultaneously. - -![Event-driven Architecture](http://cdn.nginx.com/wp-content/uploads/2015/06/Screen-Shot-2015-06-08-at-12.41.13-PM.png) - -1. The worker waits for events on the listen and connection sockets. -1. Events occur on the sockets and the worker handles them: - - - An event on the listen socket means that a client has started a new chess game. The worker creates a new connection socket. - - An event on a connection socket means that the client has made a new move. The worker responds promptly. - -A worker never blocks on network traffic, waiting for its “opponent” (the client) to respond. When it has made its move, the worker immediately proceeds to other games where moves are waiting to be processed, or welcomes new players in the door. - -### Why Is This Faster than a Blocking, Multi-Process Architecture? ### - -NGINX scales very well to support hundreds of thousands of connections per worker process. Each new connection creates another file descriptor and consumes a small amount of additional memory in the worker process. There is very little additional overhead per connection. NGINX processes can remain pinned to CPUs. Context switches are relatively infrequent and occur when there is no work to be done. - -In the blocking, connection-per-process approach, each connection requires a large amount of additional resources and overhead, and context switches (swapping from one process to another) are very frequent. - -For a more detailed explanation, check out this [article][7] about NGINX architecture, by Andrew Alexeev, VP of Corporate Development and Co-Founder at NGINX, Inc. - -With appropriate [system tuning][8], NGINX can scale to handle hundreds of thousands of concurrent HTTP connections per worker process, and can absorb traffic spikes (an influx of new games) without missing a beat. - -### Updating Configuration and Upgrading NGINX ### - -NGINX’s process architecture, with a small number of worker processes, makes for very efficient updating of the configuration and even the NGINX binary itself. - -![Updating Configuration](http://cdn.nginx.com/wp-content/uploads/2015/06/Screen-Shot-2015-06-08-at-12.41.33-PM.png) - -Updating NGINX configuration is a very simple, lightweight, and reliable operation. It typically just means running the `nginx –s reload` command, which checks the configuration on disk and sends the master process a SIGHUP signal. - -When the master process receives a SIGHUP, it does two things: - -- Reloads the configuration and forks a new set of worker processes. These new worker processes immediately begin accepting connections and processing traffic (using the new configuration settings). -- Signals the old worker processes to gracefully exit. The worker processes stop accepting new connections. As soon as each current HTTP request completes, the worker process cleanly shuts down the connection (that is, there are no lingering keepalives). Once all connections are closed, the worker processes exit. - -This reload process can cause a small spike in CPU and memory usage, but it’s generally imperceptible compared to the resource load from active connections. You can reload the configuration multiple times per second (and many NGINX users do exactly that). Very rarely, issues arise when there are many generations of NGINX worker processes waiting for connections to close, but even those are quickly resolved. - -NGINX’s binary upgrade process achieves the holy grail of high-availability – you can upgrade the software on the fly, without any dropped connections, downtime, or interruption in service. - -![New Binary](http://cdn.nginx.com/wp-content/uploads/2015/06/Screen-Shot-2015-06-08-at-12.41.51-PM.png) - -The binary upgrade process is similar in approach to the graceful reload of configuration. A new NGINX master process runs in parallel with the original master process, and they share the listening sockets. Both processes are active, and their respective worker processes handle traffic. You can then signal the old master and its workers to gracefully exit. - -The entire process is described in more detail in [Controlling NGINX][9]. - -### Conclusion ### - -The [Inside NGINX infographic][10] provides a high-level overview of how NGINX functions, but behind this simple explanation is over ten years of innovation and optimization that enable NGINX to deliver the best possible performance on a wide range of hardware while maintaining the security and reliability that modern web applications require. - -If you’d like to read more about the optimizations in NGINX, check out these great resources: - -- [Installing and Tuning NGINX for Performance][11] (webinar; [slides][12] at Speaker Deck) -- [Tuning NGINX for Performance][13] -- [The Architecture of Open Source Applications – NGINX][14] -- [Socket Sharding in NGINX Release 1.9.1][15] (using the SO_REUSEPORT socket option) - --------------------------------------------------------------------------------- - -via: http://nginx.com/blog/inside-nginx-how-we-designed-for-performance-scale/ - -作者:[Owen Garrett][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://nginx.com/author/owen/ -[1]:http://nginx.com/resources/library/infographic-inside-nginx/ -[2]:http://nginx.org/en/docs/ngx_core_module.html#worker_processes -[3]:http://nginx.org/en/docs/ngx_core_module.html#accept_mutex -[4]:http://nginx.com/blog/socket-sharding-nginx-release-1-9-1/ -[5]:http://en.wikipedia.org/wiki/Simultaneous_exhibition -[6]:http://gambit.blogs.nytimes.com/2009/03/03/in-chess-records-were-made-to-be-broken/ -[7]:http://www.aosabook.org/en/nginx.html -[8]:http://nginx.com/blog/tuning-nginx/ -[9]:http://nginx.org/en/docs/control.html -[10]:http://nginx.com/resources/library/infographic-inside-nginx/ -[11]:http://nginx.com/resources/webinars/installing-tuning-nginx/ -[12]:https://speakerdeck.com/nginx/nginx-installation-and-tuning -[13]:http://nginx.com/blog/tuning-nginx/ -[14]:http://www.aosabook.org/en/nginx.html -[15]:http://nginx.com/blog/socket-sharding-nginx-release-1-9-1/ From 5a08b0f47433bc2a64c1846b85bedaec578e1b91 Mon Sep 17 00:00:00 2001 From: ZTinoZ Date: Sun, 21 Jun 2015 03:01:57 +0800 Subject: [PATCH 439/965] Translating by ZTinoZ --- .../tech/20150526 20 Useful Terminal Emulators for Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20150526 20 Useful Terminal Emulators for Linux.md b/sources/tech/20150526 20 Useful Terminal Emulators for Linux.md index 42a6137296..5e0d237086 100644 --- a/sources/tech/20150526 20 Useful Terminal Emulators for Linux.md +++ b/sources/tech/20150526 20 Useful Terminal Emulators for Linux.md @@ -221,7 +221,7 @@ Xfce Terminal ### 17. xterm ### -xterm应用程序是一款标准的在X Window系统上的终端仿真器。It maintain DEC VT102 and Tektronix 4014 compatible terminals for applications that can’t use the window system directly. +xterm应用程序是一款标准的在X Window系统上的终端仿真器。它保持了DEC VT102和Tektronix 4014,让应用能直接使用X Window系统。 ![xterm Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/xterm.jpg) @@ -258,7 +258,7 @@ Sakura Terminal ### 20. rxvt-unicode ### -The rxvt-unicode (also known as urxvt) is a yet another highly customizable, lightweight and fast terminal emulator with xft and unicode support was developed by Marc Lehmann. It got some outstanding features such as support for international language via Unicode, the ability to display multiple font types and support for Perl extensions. +rxvt-unicode (也称为urxvt) 是另一个高度可定制、轻量级和快速的终端仿真器,支持xft和unicode,由Marc Lehmann开发。它有许多显著特性比如支持Unicode上的国际语言,能显示多种字体类型并支持Perl扩展。 ![rxvt unicode](http://www.tecmint.com/wp-content/uploads/2014/01/rxvt-unicode.png) From 0016e105d0dcb7bb2d2a1e67ef48805758dc3a7b Mon Sep 17 00:00:00 2001 From: ZTinoZ Date: Sun, 21 Jun 2015 03:05:20 +0800 Subject: [PATCH 440/965] Finish the translation by ZTinoZ --- .../tech/20150526 20 Useful Terminal Emulators for Linux.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/20150526 20 Useful Terminal Emulators for Linux.md (100%) diff --git a/sources/tech/20150526 20 Useful Terminal Emulators for Linux.md b/translated/tech/20150526 20 Useful Terminal Emulators for Linux.md similarity index 100% rename from sources/tech/20150526 20 Useful Terminal Emulators for Linux.md rename to translated/tech/20150526 20 Useful Terminal Emulators for Linux.md From f1392a0b831d054332fc4121270d2ac6e3f52a34 Mon Sep 17 00:00:00 2001 From: NearTan Date: Sun, 21 Jun 2015 20:02:39 +0800 Subject: [PATCH 441/965] translated --- ... on Ubuntu 15.04 with Different Methods.md | 265 ------------------ ... on Ubuntu 15.04 with Different Methods.md | 264 +++++++++++++++++ 2 files changed, 264 insertions(+), 265 deletions(-) delete mode 100644 sources/tech/20150618 How to Setup Node.JS on Ubuntu 15.04 with Different Methods.md create mode 100644 translated/tech/20150618 How to Setup Node.JS on Ubuntu 15.04 with Different Methods.md diff --git a/sources/tech/20150618 How to Setup Node.JS on Ubuntu 15.04 with Different Methods.md b/sources/tech/20150618 How to Setup Node.JS on Ubuntu 15.04 with Different Methods.md deleted file mode 100644 index 83b08328e0..0000000000 --- a/sources/tech/20150618 How to Setup Node.JS on Ubuntu 15.04 with Different Methods.md +++ /dev/null @@ -1,265 +0,0 @@ -translating by NearTan - -How to Setup Node.JS on Ubuntu 15.04 with Different Methods -================================================================================ -This is such an important article to guide you about the installation and setup of Node.js on Ubuntu 15.04. Node.js is basically a server side java script programming to provide you bindings for enabling the input and output socket bios and streams. It has a high through put and non-blocking IO in a single threaded event loop. It’s also a platform layer that provides the functionality to interact with the Operating system to write file, read files and to do networking operations. So in this article we will perform different installation methods to setup Node.Js on Ubuntu 15.04 server. - -### Methods to Install Node.JS ### - -Their are different ways to install Node.Js and we can prefer to choose any one. Following are some important ways to install Node.Js that we will use to guide you about their each setup on Ubuntu 15.04 so make sure to remove the previous previous packages to avoid from any package conflict. - -- Installation of Node.JS from Source Code -- Installation of Node.JS from Package Manager -- Installation of Node.JS from Github Repository -- Installation of Node.JS with NVM - -### 1) Installing from Source Code ### - -Let's start with installation of Node.JS from the Source Code, so make sure that your system is up to date and dependent packages are pre installed. So follow the below steps and start the setup. - -#### STEP 1: System Update #### - -Use following commands and update Operating system and ten install the required packages are necessary for Node.JS setup. - - root@ubuntu-15:~# apt-get update - - root@ubuntu-15:~# apt-get install python gcc make g++ - -#### STEP 2: Get Source Code of Node.JS #### - -After we had installed the dependent packages now from the official web link of Node.JS just download its source code package and extract it as in following commands. - - root@ubuntu-15:~# wget http://nodejs.org/dist/v0.12.4/node-v0.12.4.tar.gz - root@ubuntu-15:~# tar zxvf node-v0.12.4.tar.gz - -#### STEP 3: Starting Installation #### - -Now move to the source code directory and execute the .configuration file - -![NodeJS Configure](http://blog.linoxide.com/wp-content/uploads/2015/06/13.png) - - root@ubuntu-15:~# ls - node-v0.12.4 node-v0.12.4.tar.gz - root@ubuntu-15:~# cd node-v0.12.4/ - root@ubuntu-15:~/node-v0.12.4# ./configure - root@ubuntu-15:~/node-v0.12.4# make install - -### Testing after Installation of Node.Js from Source Code ### - -Once the installation is done after running make installa command, we check its version and test that Node.Js is working fine by executing some test out puts. - - root@ubuntu-15:~/node-v0.12.4# node -v - v0.12.4 - -![Node.Js Test](http://blog.linoxide.com/wp-content/uploads/2015/06/21.png) - -Create a new file with .js extension execute it with Node command. - - root@ubuntu-15:~/node-v0.12.4# touch helo_test.js - root@ubuntu-15:~/node-v0.12.4# vim helo_test.js - console.log('Hello World'); - -Now execute it with Node command. - - root@ubuntu-15:~/node-v0.12.4# node helo_test.js - Hello World - -The out put shows that we had successfully installed Node.JS on Ubuntu 15.04 which is now ready to create applications on it using java scripts. - -### 2) Installing from Package Manager ### - -The installation of Node.JS through Package Manager is also a very simple process to setup on Ubuntu through NodeSource by adding its Personal Package Archives (PPA). - -We will go through the following steps to install Node.JS through PPA. - -#### STEP 1: Get the Source Code using Curl #### - -Before getting the source code by using the Curl command we must update our system and then run the curl command to fetch the NodeSource into local repository. - - root@ubuntu-15:~#apt-get update - root@ubuntu-15:~# curl -sL https://deb.nodesource.com/setup | sudo bash - - -The curl will execute the following tasks. - - ## Installing the NodeSource Node.js 0.10 repo... - ## Populating apt-get cache... - ## Confirming "vivid" is supported... - ## Adding the NodeSource signing key to your keyring... - ## Creating apt sources list file for the NodeSource Node.js 0.10 repo... - ## Running `apt-get update` for you... - Fetched 6,411 B in 5s (1,077 B/s) - Reading package lists... Done - ## Run `apt-get install nodejs` (as root) to install Node.js 0.10 and npm - -#### STEP 2: Installation of NodeJS and NPM #### - -As per the output of Curl we had fetched the NodeSource to our local repository now through apt-get commands we will install the NodeJS and NPM packages. - - root@ubuntu-15:~# apt-get install nodejs - -![NodeJS Install](http://blog.linoxide.com/wp-content/uploads/2015/06/31.png) - -#### STEP 3: Installing Build Essentials Tool #### - -To compile and install native addons from npm we may also need to install build tools using following command as. - - root@ubuntu-15:~# apt-get install -y build-essential - -### Testing With Node.JS Shell ### - -Testing of Node.Js is similar to the one that we did after installation from the source Code. -so lets start with the node command as follow and get its output result to see if Node.JS is fully functional. - - root@ubuntu-15:~# node - > console.log('Node.js Installed Using Package Manager'); - Node.js Installed Using Package Manager - ----------- - - root@ubuntu-15:~# node - > a = [1,2,3,4,5] - [ 1, 2, 3, 4, 5 ] - > typeof a - 'object' - > 5 + 2 - 7 - > - (^C again to quit) - > - root@ubuntu-15:~# - -### REPL For Your NodeJS Apps ### - -REPL is the Node.js shell, any valid Javascript which can be written in a script can be passed to the REPL. So lets see how REPL works with NodeJS. - - root@ubuntu-15:~# node - > var repl = require("repl"); - undefined - > repl.start("> "); - - Press Enter and it will show out put like this: - > { domain: null, - _events: {}, - _maxListeners: 10, - useGlobal: false, - ignoreUndefined: false, - eval: [Function], - inputStream: - { _connecting: false, - _handle: - { fd: 0, - writeQueueSize: 0, - owner: [Circular], - onread: [Function: onread], - reading: true }, - _readableState: - { highWaterMark: 0, - buffer: [], - length: 0, - pipes: null, - ... - ... - -Here is the list of command line help that we can use to work with REPL. - -![REPL Manual](http://blog.linoxide.com/wp-content/uploads/2015/06/4.png) - -### Working with NodeJS Packet Manager ### - -NPM is simple CLI tool for ensuring that a given node script runs continuously. It helps to Install and manage dependencies through the file package.json. We will start its using init command as. - - root@ubuntu-15:~# npm init - -![NPM starting](http://blog.linoxide.com/wp-content/uploads/2015/06/51.png) - -### 3) Installing from Github Repository ### - -In this method to install Node.JS we will consider few simple steps to directory clone the Node.JS repository from the github. - -Before the start of configurations through the the cloned package of Node.JS make sure that we must have following dependent packages installed with us. - - root@ubuntu-15:~# apt-get install g++ curl make libssl-dev apache2-utils git-core - -Now start the clone with git command and change the directory to its configuration file. - - root@ubuntu-15:~# git clone git://github.com/ry/node.git - root@ubuntu-15:~# cd node/ - -![Git Clone NodeJS](http://blog.linoxide.com/wp-content/uploads/2015/06/61.png) - -To install from the cloned repository now lets run the .config command and then make install to complete the setup of Node.Js . - - root@ubuntu-15:~# ./configure - -![Configure Node](http://blog.linoxide.com/wp-content/uploads/2015/06/7.png) - -Run the make install command that will takes few minutes so be patient and get it ready finalize the setup on Node.JS package for you. - - root@ubuntu-15:~/node# make install - - root@ubuntu-15:~/node# node -v - v0.13.0-pre - -### Testing with Node.JS ### - - root@ubuntu-15:~/node# node - > a = [1,2,3,4,5,6,7] - [ 1, 2, 3, 4, 5, 6, 7 ] - > typeof a - 'object' - > 6 + 5 - 11 - > - (^C again to quit) - > - root@ubuntu-15:~/node# - -### 4) Installing Node.JS Using Node Version Manager ### - -In this last method we show you we can easily install Node.JS with NVM method. This is one of the best method to install and configure Node.JS it provides us with facility to control versions. - -So before starting with this method make sure that the previously installed package is not already present there if you are working on the same machine. - -#### STEP 1: Installing Prerequisites #### - -Let's start with the system update and then install the following prerequisites for the Ubuntu Server to setup Node.JS using NodeJS Versions Manager System. Using the Curl command we will get NVM from the git to our local repository. - - root@ubuntu-15:~# apt-get install build-essential libssl-dev - root@ubuntu-15:~# curl https://raw.githubusercontent.com/creationix/nvm/v0.16.1/install.sh | sh - -![NVM Curl](http://blog.linoxide.com/wp-content/uploads/2015/06/81.png) - -#### STEP 2: Update Home Environment #### - -After the curl command downloads the necessary packages for the NVM in the home directory of the user it also make changes to the bash profile. so in order to update those change and get access to NVM we must relogin to the terminal or we can update it using the source command as below. - - root@ubuntu-15:~# source ~/.profile - -Now we can use the NVM to choose the default NVM version or by moving to the previous version of NVM that we can do so by using the following commands. - - root@ubuntu-15:~# nvm ls - root@ubuntu-15:~# nvm alias default 0.12.4 - -![NVM Default](http://blog.linoxide.com/wp-content/uploads/2015/06/91.png) - -#### STEP 3: Using NodeJS Versions Manager #### - -We have successfully setup the NodeJS with NVM package and now can use it with its useful commands. - -![NVM Manual](http://blog.linoxide.com/wp-content/uploads/2015/06/101.png) - -### CONCLUSION ### - -Now we are ready to go with building server side applications with Node.JS and you are free to choose the best installation setup of your choice as we had done with four optional installations of Node.Js on the latest version of Ubuntu 15.04 with priority installation sequence, now its up to you to follow the one of your own choice and start coding with NodeJS. - --------------------------------------------------------------------------------- - -via: http://linoxide.com/ubuntu-how-to/setup-node-js-ubuntu-15-04-different-methods/ - -作者:[Kashif Siddique][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://linoxide.com/author/kashifs/ \ No newline at end of file diff --git a/translated/tech/20150618 How to Setup Node.JS on Ubuntu 15.04 with Different Methods.md b/translated/tech/20150618 How to Setup Node.JS on Ubuntu 15.04 with Different Methods.md new file mode 100644 index 0000000000..fbbaecb067 --- /dev/null +++ b/translated/tech/20150618 How to Setup Node.JS on Ubuntu 15.04 with Different Methods.md @@ -0,0 +1,264 @@ +在Ubuntu下用不同方式安装Node.JS +================================================================================ + +如果你要在Ubuntu 15.04上安装Node.js的话,这篇教程对你来说肯定很重要。Node.js根本上来说就是一个运行在服务端上的封装好了输入输出流的javascript程序。Node.js巧妙的使用单线程的event loop来处理异步IO。同时它在平台层面上,面向系统拥有非常实用的文件读写,网络操作功能。所以这篇文章将展示在Ubuntu 15.04 server上不同的安装Node.Js的方式。 + +### 安装Node.JS 的方法### + +有许多不同的方法安装Node.JS,我们可以选择其一。通过本篇文章我们将手把手带着你在Ubuntu 15.04上安装Node.Js,在此之前请卸载旧版本的包以免发生包冲突。 + +- 从源代码安装Node.JS +- 用包管理器安装Node.JS +- 从Github远程库安装Node.JS +- 用NVM安装Node.JS + +### 1) 从源代码安装Node.JS ### + +让我们开始从从源代码安装Node.JS之前,请确认系统上的所有的依赖包都已经更新到最新版本。然后跟着以下步骤来开始安装: + +#### 步骤1: 升级系统 #### + +用以下命令来升级系统,并且安装一些Node.JS必要的包。 + + root@ubuntu-15:~# apt-get update + + root@ubuntu-15:~# apt-get install python gcc make g++ + +#### 步骤2: 获取Node.JS的源代码 #### + +安装好依赖包之后我们可以从官方网站上下载Node.JS的源代码。下载以及解压的命令如下: + + root@ubuntu-15:~# wget http://nodejs.org/dist/v0.12.4/node-v0.12.4.tar.gz + root@ubuntu-15:~# tar zxvf node-v0.12.4.tar.gz + +#### 步骤3: 开始安装 #### + +现在我们进入源代码的目录然后运行.configuration文件 + +![NodeJS Configure](http://blog.linoxide.com/wp-content/uploads/2015/06/13.png) + + root@ubuntu-15:~# ls + node-v0.12.4 node-v0.12.4.tar.gz + root@ubuntu-15:~# cd node-v0.12.4/ + root@ubuntu-15:~/node-v0.12.4# ./configure + root@ubuntu-15:~/node-v0.12.4# make install + +### 安装后测试 ### + +只要运行一次上面的命令就顺利安装好了Node.JS,现在我们来确认一下版本信息和测试以下Node.JS是否可以运行输出。 + + root@ubuntu-15:~/node-v0.12.4# node -v + v0.12.4 + +![Node.Js Test](http://blog.linoxide.com/wp-content/uploads/2015/06/21.png) + +创建一个以.js为扩展名的文件然后用Node的命令运行 + + root@ubuntu-15:~/node-v0.12.4# touch helo_test.js + root@ubuntu-15:~/node-v0.12.4# vim helo_test.js + console.log('Hello World'); + +现在我们用Node的命令运行文件 + + root@ubuntu-15:~/node-v0.12.4# node helo_test.js + Hello World + +输出的结果证明我们已经成功的在Ubuntu 15.04安装好了Node.JS,同时我们也能运行JavaScript文件。 + +### 2) 利用包管理器安装Node.JS ### + +在Ubuntu下用包管理器安装Node.JS是非常简单的,只要增加NodeSource的个人软件包档案(PPA)即可。 + +我们将下面通过PPA安装Node.JS + +#### 步骤1: 用curl获取源代码 #### + +在我们用curl获取源代码之前,我们必须先升级操作系统然后用curl命令获取NodeSource添加到本地仓库。 + + root@ubuntu-15:~#apt-get update + root@ubuntu-15:~# curl -sL https://deb.nodesource.com/setup | sudo bash - + +curl将运行以下任务 + + ## Installing the NodeSource Node.js 0.10 repo... + ## Populating apt-get cache... + ## Confirming "vivid" is supported... + ## Adding the NodeSource signing key to your keyring... + ## Creating apt sources list file for the NodeSource Node.js 0.10 repo... + ## Running `apt-get update` for you... + Fetched 6,411 B in 5s (1,077 B/s) + Reading package lists... Done + ## Run `apt-get install nodejs` (as root) to install Node.js 0.10 and npm + +#### 步骤2: 安装NodeJS和NPM #### + +运行以上命令之后如果输出如上所示,我们可以用apt-get命令来安装NodeJS和NPM包。 + + root@ubuntu-15:~# apt-get install nodejs + +![NodeJS Install](http://blog.linoxide.com/wp-content/uploads/2015/06/31.png) + +#### STEP 3: Installing Build Essentials Tool #### +#### 步骤3: 安装一些必备的工具 #### + +通过以下命令来安装编译安装一些我们必需的本地插件。 + + root@ubuntu-15:~# apt-get install -y build-essential + +### 通过Node.JS Shell来测试 ### + +测试Node.JS的步骤与之前使用源代码安装相似,通过以下node命令来确认Node.JS是否完全安装好: + + root@ubuntu-15:~# node + > console.log('Node.js Installed Using Package Manager'); + Node.js Installed Using Package Manager + +---------- + + root@ubuntu-15:~# node + > a = [1,2,3,4,5] + [ 1, 2, 3, 4, 5 ] + > typeof a + 'object' + > 5 + 2 + 7 + > + (^C again to quit) + > + root@ubuntu-15:~# + +### 使用NodeJS应用进行简单的测试 ### + +REPL是一个Node.js的shell,任何有效的JavaScript代码都能在REPL下运行通过。所以让我们看看在Node.JS下的REPL是什么样子吧。 + + root@ubuntu-15:~# node + > var repl = require("repl"); + undefined + > repl.start("> "); + + Press Enter and it will show out put like this: + > { domain: null, + _events: {}, + _maxListeners: 10, + useGlobal: false, + ignoreUndefined: false, + eval: [Function], + inputStream: + { _connecting: false, + _handle: + { fd: 0, + writeQueueSize: 0, + owner: [Circular], + onread: [Function: onread], + reading: true }, + _readableState: + { highWaterMark: 0, + buffer: [], + length: 0, + pipes: null, + ... + ... + +以下是可以在REPL下使用的命令列表 + +![REPL Manual](http://blog.linoxide.com/wp-content/uploads/2015/06/4.png) + +### 使用NodeJS的包管理器 ### + +NPM是一个提供给node脚本连续运行的命令行工具,它能通过package.json来安装和管理依赖包。最开始从初始化命令init开始 + + root@ubuntu-15:~# npm init + +![NPM starting](http://blog.linoxide.com/wp-content/uploads/2015/06/51.png) + +### 3) 从Github远程库安装Node.JS ### + +在这个方法中我们需要一些步骤来把Node.JS从Github的远程的仓库克隆到本地仓库目录 + +在开始克隆(clone)包到本地并且配制之前,我们要先安装以下依赖包 + + root@ubuntu-15:~# apt-get install g++ curl make libssl-dev apache2-utils git-core + +现在我们开始用git命令克隆到本地并且转到配制目录 + + root@ubuntu-15:~# git clone git://github.com/ry/node.git + root@ubuntu-15:~# cd node/ + +![Git Clone NodeJS](http://blog.linoxide.com/wp-content/uploads/2015/06/61.png) + +clone仓库之后,通过运行.config命令来编译生成完整的安装包。 + + root@ubuntu-15:~# ./configure + +![Configure Node](http://blog.linoxide.com/wp-content/uploads/2015/06/7.png) + +运行make install命令之后耐心等待几分钟,程序将会安装好Node.JS + + root@ubuntu-15:~/node# make install + + root@ubuntu-15:~/node# node -v + v0.13.0-pre + +### 测试Node.JS ### + + root@ubuntu-15:~/node# node + > a = [1,2,3,4,5,6,7] + [ 1, 2, 3, 4, 5, 6, 7 ] + > typeof a + 'object' + > 6 + 5 + 11 + > + (^C again to quit) + > + root@ubuntu-15:~/node# + +### 4) 通过NVM安装Node.JS ### + +在最后一种方法中我们我们将用NVM来比较容易安装Node.JS。安装和配制Node.JS,这是最好的方法之一,它可以供我们选择要安装的版本。 + +在安装之前,请确认本机以前的安装包已经被卸载 + +#### 步骤1: 安装依赖包 #### + +首先升级Ubuntu Server系统,然后安装以下安装Node.JS和使用NVM所要依赖的包。用curl命令从git上下载NVM到本地仓库: + + root@ubuntu-15:~# apt-get install build-essential libssl-dev + root@ubuntu-15:~# curl https://raw.githubusercontent.com/creationix/nvm/v0.16.1/install.sh | sh + +![NVM Curl](http://blog.linoxide.com/wp-content/uploads/2015/06/81.png) + +#### 步骤2: 修改Home环境 #### + +用curl从NVM下载必需的包到用户的home目录之后,我们需要修改bash的配制文件添加NVM,之后只要重新登录中断或者用如下命令更新即可 + + root@ubuntu-15:~# source ~/.profile + +现在我们可以用NVM来设置默认的NVM的版本或者用如下命令来指定之前版本: + + root@ubuntu-15:~# nvm ls + root@ubuntu-15:~# nvm alias default 0.12.4 + +![NVM Default](http://blog.linoxide.com/wp-content/uploads/2015/06/91.png) + +#### 步骤3: 使用NVM #### + +我们已经通过NVM成功的安装了Node.JS,所以我们现在可以使用各种有用的命令。 + +![NVM Manual](http://blog.linoxide.com/wp-content/uploads/2015/06/101.png) + +### 总结 ### + +现在我们已经准备好了在服务端安装Node.JS,你可以从我们说的四种方式中选择最合适你的方式在最新的Ubuntu 15.04上来安装Node.JS,安装好之后你就可以利用Node.JS来编写你的代码。 + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/ubuntu-how-to/setup-node-js-ubuntu-15-04-different-methods/ + +作者:[Kashif Siddique][a] +译者:[NearTan](https://github.com/NearTan) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://linoxide.com/author/kashifs/ \ No newline at end of file From 129ca4230017533eb364c72622158edc6b7e7989 Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 22 Jun 2015 17:04:13 +0800 Subject: [PATCH 442/965] translating --- ...pache, MariaDB, PHP or PhpMyAdmin in RHEL or CentOS 7.0.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150616 Installing LAMP Linux, Apache, MariaDB, PHP or PhpMyAdmin in RHEL or CentOS 7.0.md b/sources/tech/20150616 Installing LAMP Linux, Apache, MariaDB, PHP or PhpMyAdmin in RHEL or CentOS 7.0.md index 82be4748e0..a45e83d365 100644 --- a/sources/tech/20150616 Installing LAMP Linux, Apache, MariaDB, PHP or PhpMyAdmin in RHEL or CentOS 7.0.md +++ b/sources/tech/20150616 Installing LAMP Linux, Apache, MariaDB, PHP or PhpMyAdmin in RHEL or CentOS 7.0.md @@ -1,3 +1,5 @@ +translating----geekpi + Installing LAMP (Linux, Apache, MariaDB, PHP/PhpMyAdmin) in RHEL/CentOS 7.0 ================================================================================ Skipping the LAMP introduction, as I’m sure that most of you know what is all about. This tutorial will concentrate on how to install and configure famous LAMP stack – Linux Apache, MariaDB, PHP, PhpMyAdmin – on the last release of Red Hat Enterprise Linux 7.0 and CentOS 7.0, with the mention that both distributions have upgraded httpd daemon to Apache HTTP 2.4. @@ -235,4 +237,4 @@ via: http://www.tecmint.com/install-lamp-in-centos-7/ [3]:http://www.tecmint.com/centos-7-installation/ [4]:http://www.tecmint.com/configure-network-interface-in-rhel-centos-7-0/ [5]:http://php.net/manual/en/timezones.php -[6]:http://www.question-defense.com/tools/phpmyadmin-blowfish-secret-generator \ No newline at end of file +[6]:http://www.question-defense.com/tools/phpmyadmin-blowfish-secret-generator From 060755d17e33adf6f796483c74bef12f967968bc Mon Sep 17 00:00:00 2001 From: wxy Date: Mon, 22 Jun 2015 17:16:53 +0800 Subject: [PATCH 443/965] PUB:20150615 PHP at 20--From pet project to powerhouse @wi-cuckoo --- ...P at 20--From pet project to powerhouse.md | 84 +++++++++++++++++++ ...P at 20--From pet project to powerhouse.md | 81 ------------------ 2 files changed, 84 insertions(+), 81 deletions(-) create mode 100644 published/20150615 PHP at 20--From pet project to powerhouse.md delete mode 100644 translated/talk/20150615 PHP at 20--From pet project to powerhouse.md diff --git a/published/20150615 PHP at 20--From pet project to powerhouse.md b/published/20150615 PHP at 20--From pet project to powerhouse.md new file mode 100644 index 0000000000..55470bd389 --- /dev/null +++ b/published/20150615 PHP at 20--From pet project to powerhouse.md @@ -0,0 +1,84 @@ +PHP 20岁了:从玩具到巨头 +============================================================================= + +> 曾经的‘丑小鸭工程’已经转变为一个互联网巨头,感谢灵活、务实和充满活力的开发者社区。 + +当Rasmus Lerdorf发布“[一个用C写的小型紧凑的CGI可执行程序集合][2]”时, 他没有想到他的创造会对网络发展产生多大的影响。今年在Miami举行的SunshinePHP大会上,Lerdorf做了开场演讲,他自嘲到,“在1995年的时候,我以为我已经在 Web 上解除了C API的束缚。显然,事情并非那样,我们全成了C程序员了。” + +![](http://images.techhive.com/images/article/2015/06/13049862325_8c97a11878_z-100590275-primary.idge.jpg) + +题图来自: [Steve Jurvetson via Flickr][1] + +实际上,当Lerdorf发布个人主页工具(Personal Home Page Tools,即 PHP 名字的来源)的1.0版本时,那时的网络还是如此的年轻。直到那年的十一月份HTML 2.0还没有公布,而且HTTP/1.0也是次年的五月份才出现。那时,NCSA HTTPd是使用最广泛的网络服务器,而网景的Navigator则是最流行的网络浏览器,八月份的时候,IE1.0才刚刚出现。换句话说,PHP的开端刚好撞上了浏览器战争的前夜。 + +早些时候,我们谈论了一大堆关于PHP对网络发展的影响。回到那时候,当说到用于网络应用的服务器端处理,我们的选择是有限的。PHP满足了我们对于一种工具的需求,这就是可以使得我们在网络上做一些动态的事情。它的实用的灵活性只受限于我们的想像力,PHP从那时起便与网络共同成长。现在,PHP占据了网络语言的超过80%的份额,已经是成熟的脚本语言,特别适合解决网络问题。她独一无二的血统讲述了一个故事,实用高于理论,解决问题高于纯正。 + +### 把我们钩住的网络魔力 ### + +PHP一开始并不是一门编程语言,从她的设计就很明显不是 -- 或者她本来就缺乏相关特性,正如那些贬低者指出的那样。最初,她是作为一种API帮助网络开发者能够接入底层的C语言封装库。第一个版本是一组小的CGI可执行程序,提供表单处理功能,可以访问查询参数和mSQL数据库。而且她可以如此容易地处理一个网络应用的数据库,证明了其在激发我们对于PHP的兴趣和PHP后来的支配地位的关键作用。 + +到了第二版 -- 即 PHP/FI -- 数据库的支持已经扩展到包括PostgreSQL、MySQL、Oracle、Sybase等等。她通过封装他们的C语言库来支持各种数据库,将他们作为PHP库的一部分。PHP/FI也封装了GD库,可以创建并管理GIF图像。她可以作为一个Apache模块运行,或者编译进FastCGI支持,并且她引入的 PHP 编程语言支持变量、数组、语言结构和函数。对于那个时候大多数在网络这块工作的人来说,PHP是我们一直在寻求的那款“胶水”。 + +当PHP吸纳越来越多的编程语言功能,演变为第三版和之后的版本时,她从来没有失去这种黏合的特性。通过仓库如PECL(PHP Extension Community Library),PHP可以把各种库都连在一起,将他们的函数引入到PHP层面。这种将组件结合在一起的能力,成为PHP之美的一个重要方面,使之不会受限于其源代码上。 + +### 网络,一个码农们的社区 ### + +PHP在网络发展上的持续影响并不局限于能用这种语言干什么。PHP如何完成工作,谁参与进来 -- 这些都是PHP传奇中很重要的部分。 + +早在1997年,PHP的用户群体开始形成。其中最早的是美国中西部PHP用户组(后来叫做 Chiago PHP),并[1997年二月份的时候举行了第一次聚会][4]。这是一个充满生气、饱含激情的开发者社区形成的开端,聚合成一种吸引力 -- 在网络上的一个小工具就可以帮助他们解决问题。PHP这种普遍存在的特性使得她成为网络开发一个很自然的选择。在分享主导的世界里,她开始盛行,而且低入的门槛对于许多早期的网络开发者来说是十分有吸引力的。 + +伴随着社区的成长,为开发者带来了一堆工具和资源。这一年是2000年,出现了PHP的一个转折点,它见证了第一次PHP开发者大会,聚集了编程语言的核心开发者,他们在Tel Aviv见面,讨论即将到来的4.0版本的发布。PHP扩展和应用仓库(PEAR)也于2000年发起,它提供了高质量的用户代码包,依据标准和最佳操作。第一届PHP大会PHP Kongress不久之后在德国举行。[PHPDeveloper.org][5]也随后上线,直到今天,这都是PHP社区里最权威的新闻资源。 + +这个社区的势头表明了接下来几年里PHP成长的关键所在。随着网络开发产业的爆发,PHP也获得发展。PHP开始为更多、更大的网站提供动力。越来越多的用户群在世界各地开花。邮件列表、在线论坛、IRC、大会,以及如php[architect]、德国PHP杂志、国际PHP杂志等商业杂志 -- PHP社区的活力在完成网络工作的方式上有极其重要的影响:共同地,开放地,倡导代码共享。 + +然后,在10年前,PHP 5发布后不久,在网络发展史上一个有趣地事情发生了,它导致了PHP社区如何构建库和应用的转变:Ruby on Rails发布了。 + +### 框架的异军突起 ### + +用于Ruby编程语言的Ruby on Rails框架在MVC(模型-视图-控制)架构模型上获得了不断增长的焦点与关注。Mojavi PHP框架几年前已经使用MVC模型了,但是Ruby on Rails的高明之处在于巩固了MVC。框架引爆了PHP社区,并且框架已经改变了开发者构建PHP应用程序的方式。 + +许多重要的项目和发展已经发端,这归功于PHP社区框架的生长。[PHP框架互用性组织][6]成立于2009年,致力于在框架间建立编码标准,命名约定与最佳操作。编纂这些标准和操作帮助为开发者在使用成员项目的代码时提供了越来越多的互用性软件。互用性意味着每个框架可以拆分为组块和独立的库,也可以作为整体的框架在一起使用。互用性带来了另一个重要的里程碑:Composer项目于2011年诞生了。 + +从Node.js的NPM和Ruby的Bundler获得灵感,Composer开辟了PHP应用开发的新纪元,创造了一次PHP“文艺复兴”。它激发了包互用性、标准命名约定、编码标准的采用、覆盖测试的提升。它是任何现代PHP应用中的一个基本工具。 + +### 加速和创新的需要 ### + +如今,PHP社区有一个生机勃勃应用和库的生态系统,有一些被广泛安装的PHP应用包括WordPress,Drupal,Joomla和MediaWiki。从小型的夫妻店站点到whitehouse.gov和Wikipeida,这些应用支撑了各种不同规模的业务的网站。在Alexa前十的站点中,有6个使用PHP,在一天内为数十亿的页面访问提供服务。因此,PHP应用已成为需要加速的首选,并且许多创新也加入到PHP的核心来提升性能。 + +在2010年,Facebook公开了其用作PHP源对源的编译器的HipHop,可以翻译PHP代码为C++代码,并且编译为一个单独的可执行二进制应用。Facebook的规模和成长需要从标准互用的PHP代码迁移到更快、最佳的可执行的代码。尽管如此,由于PHP的易用和快速开发周期,Facebook还想继续使用PHP。HipHop后来进化为HHVM,这是一个针对PHP的JIT(just-in-time)编译基础的执行引擎,其包含一个基于PHP的新的语言:[Hack][7]。 + +Facebook的创新以及其他的VM项目是在引擎水平上的比较,其引起了关于Zend引擎未来的讨论。Zend引擎依然是PHP的内核和语言规范。在2014年,它创建了一个语言规范项目,“提供一个完整的,简明的语句定义,和PHP语言的语义学”,使得对编译器项目来说,创建互用的PHP实现成为可能。 + +下一个PHP的主要版本成为了激烈争论的话题,他们提出了一个叫做phpng(下一代)的项目,来清理,重构,优化和改进PHP代码基础,这也展示了对实际应用的性能的实质提升。由于之前有一个未发布的PHP 6.0版本,因此在决定命名下一个主要版本叫做“PHP 7”后,就合并了phpng分支,并制定了开发PHP 7的计划,以增加很多语言中拥有的功能,如scalar和返回类型提示。 + +随着[今天第一版PHP 7 alpha发布][8],基准检测程序显示她在许多方面[与HHVM的一样好或者拥有更好的性能][9],PHP正与现代网络开发需求保持一致的步伐。同样地,PHP-FIG继续创新和推动框架与库的协作 -- 最近由于[PSR-7][10]的采纳,这将会改变PHP项目处理HTTP的方式。用户组、会议、公众和如[PHPMentoring.org][11]这样的布道者继续在PHP开发者社区提倡最好的操作、编码标准和测试。 + +PHP从各个方面见证了网络的成熟,而且PHP自己也成熟了。曾经一个简单的低级C语言库的API封装,PHP以她自己的方式,已经成为一个羽翼丰满的编程语言。她的开发者社区是一个充满生气、乐于助人、在实用方面引以为傲,并且欢迎新人的地方。PHP已经经受了20年的考验,而且目前在语言与社区里的活跃性,会保证她在接下来的几年里将会是一个密切相关的、积极有用的的语言。 + +在Rasmus Lerdorf的SunshinePHP的演讲中,他回忆到,“我会想到我会在20年之后讨论当初做的这个愚蠢的小项目吗?没有。” + +这里向Lerdorf和PHP社区的其他人致敬,感谢他们把这个“愚蠢的小项目”变成了一个如今网络上持久、强大的组件。 + +-------------------------------------------------------------------------------- + +via: http://www.infoworld.com/article/2933858/php/php-at-20-from-pet-project-to-powerhouse.html + +作者:[Ben Ramsey][a] +译者:[wi-cuckoo](https://github.com/wi-cuckoo) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.infoworld.com/author/Ben-Ramsey/ +[1]:https://www.flickr.com/photos/jurvetson/13049862325 +[2]:https://groups.google.com/d/msg/comp.infosystems.www.authoring.cgi/PyJ25gZ6z7A/M9FkTUVDfcwJ +[3]:http://w3techs.com/technologies/overview/programming_language/all +[4]:http://web.archive.org/web/20061215165756/http://chiphpug.php.net/mpug.htm +[5]:http://www.phpdeveloper.org/ +[6]:http://www.php-fig.org/ +[7]:http://www.infoworld.com/article/2610885/facebook-q-a--hack-brings-static-typing-to-php-world.html +[8]:https://wiki.php.net/todo/php70#timetable +[9]:http://talks.php.net/velocity15 +[10]:http://www.php-fig.org/psr/psr-7/ +[11]:http://phpmentoring.org/ + diff --git a/translated/talk/20150615 PHP at 20--From pet project to powerhouse.md b/translated/talk/20150615 PHP at 20--From pet project to powerhouse.md deleted file mode 100644 index 2dd4765a42..0000000000 --- a/translated/talk/20150615 PHP at 20--From pet project to powerhouse.md +++ /dev/null @@ -1,81 +0,0 @@ -PHP 20岁了:从兴趣工程到强大的组织 -============================================================================= -![](http://images.techhive.com/images/article/2015/06/13049862325_8c97a11878_z-100590275-primary.idge.jpg) - -信任: [Steve Jurvetson via Flickr][1] - -> 曾经的‘丑小鸭工程’已经转变为一个网络世界的强大组织,感谢网络世界的灵活,实用与充满生气的社区 - -当Rasmus Lerdorf发布“[一个用C写的紧凑的CGI可执行程序集合][2],” 他没有想到他的创造会对网络发展产生多大的影响。今年在Miami举行的SunshinePHP大会上,Lerdorf做了开场演讲,他自嘲到,“在1995年的时候,我以为我已经解除了C API的束缚,在网络之上。显然,事情并非那样,或者我们都已经是C程序员了。” - -实际上,当Lerdorf发布个人主页工具 -- 后来以PHP闻名的1.0版本时 -- 那时的网络还是如此的年轻。HTML 2.0还没有公布,直到那年的十一月份,而且HTTP/1.0也是次年的五月份才出现。NCSA HTTPd是使用最广泛的网络浏览器,而网景的Navigator则是最流行的网络浏览器,八月份的时候,IE1.0才到来。换句话说,PHP的开端刚好撞上了浏览器战争的前夜。 - -早些时候,说了大堆关于PHP对网络发展的影响。回到那时候,我们的选择是有限的,当说到服务器方面对于网络软件的进展。PHP满足了我们对于一个工具的需求,就是可以使得我们在网络上做一些动态的事情。实用的灵活性束缚了我们的想像,PHP从那时起便与网络共同成长。现在,PHP占据了网络语言超过80%的份额,已经是成熟的脚本语言,特别适合解决网络问题。她独一无二的血统讲述一个故事,实用高于理论,解决问题高于纯粹。 - -### 把我们钩住的网络魔力 ### - -PHP一开始并不是一门编程语言,从她的设计就很明星 -- 或者她本来就缺,正如那些贬低者指出的那样。最初,她是作为一种API帮助网络开发者能够接入底层的C语言封装库。第一个版本是一组小的CGI可执行程序,提供表单处理功能,通过接入需要的参数和mSQL数据库。而且她如此容易地处理一个网络应用的数据库,证明了其在激发我们对于PHP的兴趣和PHP后来的支配地位的关键作用。 - -到了第二版 -- aka PHP/FI -- 数据库的支持已经扩展到包括PostgreSQL、MySQL、Oracle、Sybase等等。她通过包括他们的C语言库来支持其数据库,将他们作为PHP库的一部分。PHP/FI也可以包括GD库,创建并管理GIF镜像。她可以作为一个Apache模块运行,或者有FastCGI支持的时候被编译,并且她展示了支持变量,数组,语言结构和函数的PHP脚本语言。对于那个时候大多数在网络这块工作的人来说,PHP是我们一直在寻求的那款“胶水”。 - -当PHP吸纳越来越多的编程语言分支,演变为第三版和之后的版本,她从来没有失去连接的特性。通过仓库如PECL(PHP Extension Community Library),PHP可以把库都连在一起,暴露他们的函数给PHP层。这种将组件结合在一起的能力,成为PHP之美的一个重要方面,尽管她没有被限制在其资源代码上。 - -### 网络,一个码农们的社区 ### - -PHP在网络发展上的持续影响并不局限于能用这种语言干什么。PHP如何完成工作,谁参与近进来 -- 这些都是PHP传奇很重要的部分。 - -早在1997年,PHP的用户群体开始形成。其中最早的是中东的PHP用户群(后来以Chiago PHP闻名),并[1997年二月份的时候举行了第一次聚会][4]。这是一个充满生气,饱含激情的开发者社区形成的开端,聚合成一种吸引力 -- 在网络上很少的工具就可以帮助他们解决问题。PHP这种普遍存在的特性使得她成为网络开发一个很自然的选择。在分享主导的世界里,她开始盛行,而且低入的门槛对于许多早期的网络开发者来说是十分有吸引力的。 - -伴随着社区的成长,为开发者带来了一堆工具和资源。这一年2000年 -- PHP的一个转折点 -- 见证了第一次PHP开发者大会,编程语言的核心开发者的一次聚集,在Tel Aviv见面,讨论即将到来的4.0版本的发布。PHP扩展和应用仓库(PEAR)也于2000发起,提供高质量的用户代码包,根据标准且最好的操作。第一届PHP大会,PHP Kongress,不久之后在德国举行。[PHPDeveloper.org][5]随后上线,直到今天。这是在PHP社区里最权威的新闻资源。 - -这种公社的势头(有待校正)证明了接下来几年里PHP成长的关键所在,且随着网络开发产业的爆发,PHP也获得发展。PHP开始占领更多,更大的网站。越来越多的用户群在世界范围内形成。邮件列表;在线论坛;IRC;大会;交易日记如php[架构],德国PHP杂志,国际PHP杂志 -- PHP社区的活力在完成网络工作的方式上有极其重要的影响:共同地,开放地,倡导代码共享。 - -然后,10年前,PHP 5发布后不久,在网络发展史上一个有趣地事情发生了,导致了PHP社区如何构建库和应用的转变:Ruby on Rails发布了。 - -### 框架的异军突起 ### - -针对Ruby编程语言的Ruby on Rails,在MVC(模型-视图-控制)架构模型上获得了不断增长的焦点与关注。Mojavi PHP框架几年前已经使用该模型了,但是Ruby on Rails的高明之处在于巩固了MVC。框架在PHP社区炸开了,并且框架已经改变了开发者构建PHP应用程序的方式。 - -许多重要的项目和发展已经起势,这归功于PHP社区框架的生长。PHP[框架互用性组织][6]成立于2009年,致力于在框架间建立编码标准,命名约定与最佳操作。编纂这些标准和操作帮助为开发者提供了越来越多的互动性软件,使用成员项目的代码。互用性意味着每个框架可以拆分为组块和独立的库,可以被一起使用作为整体的框架。互用性带来了另一个重要的里程碑:Composer项目于2011年诞生了。 - -从Node.js的NPM和Ruby的Bundler获得灵感,Composer开辟了PHP应用开发的新纪元,创造了一次PHP“文艺复兴”。它激起了包,标准命名约定,编码标准的采用与成长中的覆盖测试间的互用性。它是任何现代PHP应用中的一个基本工具。 - -### 加速和创新的需要 ### - -如今,PHP社区有一个生机勃勃应用和库的生态系统,一些被广泛安装的PHP应用包括WordPress,Drupal,Joomla和MediaWiki。这些应用占据了所有规模的商业的网络形式,从小型的夫妻店到站点如whitehouse.gov和Wikipeida。Alexa前十的站点中,6个使用PHP在一天内服务数十亿的页面。结果,PHP应用已成加速需要的首选 -- 并且许多创新也加入到PHP的核心来提升表现。 - -在2010年,Facebook公开了其用作PHP源对源的编译器的HipHop,翻译PHP代码为C++代码,并且编译为一个单独的可执行二进制应用。Facebook的规模和成长需要从标准互用的PHP代码迁移到更快,最佳的可执行的代码。尽管如此,Facebook想继续使用PHP,由于PHP的易用和快速开发周期。HipHop进化为HHVM,一个针对PHP的JIT(just-in-time)编译基础的执行引擎,其包含一个基于PHP的新的语言:[Hack][7]。 - -Facebook的创新,和其他的VM项目,创建了在引擎水平上的比较,引起了关于Zend引擎未来的讨论。Zend引擎依然占据PHP和一种语言表述的问题的核心。在2004年,一个语言表述项目被创建,“为提供一个完整的,简明的语句定义,和PHP语言的语义学,”使得对编译器项目来说,创建共用的PHP实现成为可能。 - -下一个PHP的主要版本成为了激烈争论的话题,一个著名的pgpng项目(下一代)作为一个能清理,重构,优化和提升PHP代码基础的选项被提出来,这也展示了对真实世界应用的性能的实质上的提升。由于之前未发布的PHP 6.0版本,在决定命名下一个主要版本为“PHP 7”后,phpng分支被合并了,并制定了计划开发PHP 7,Hack提供了很多语言中拥有的功能,如scalar和返回键入提示。 - -随着[今天第一版PHP 7 alpha发布][8],标准检测程序显示在许多方面[与HHVM的一样或者更好的性能][9],PHP正与现代网络开发需求保持一致的步伐。同样地,PHP-FIG继续创新和推送框架与库用于协作 -- 最近由于[PSR-7][10]的采纳,这将会改变PHP项目处理HTTP的方式。用户组,会议,公众和积极性如[PHPMentoring.org][11]继续在PHP开发者社区提倡最好的操作,编码标准和测试 - -PHP从各个方面见证了网络的成熟,而且PHP自己也成熟了。曾经一个单一的低层次的C语言库的API包装,PHP以她自己的方式,已经成为一个羽翼丰满的编程语言。她的开发者社区是一个充满生气,乐于帮助,在实用方面以自己为傲,并且欢迎新入者的地方。PHP已经经受了20年的考验,而且目前在语言与社区里活跃性,会保证她将会是一个中肯的,有用的的语言,在接下来的几年里。 - -他的SunshinePHP的关键发言中,Rasmus Lerdorf回忆到,“我曾想过我会在20年之后与我当初做的这个愚蠢的小项目交流吗?没有。” - --------------------------------------------------------------------------------- - -via: http://www.infoworld.com/article/2933858/php/php-at-20-from-pet-project-to-powerhouse.html - -作者:[Ben Ramsey][a] -译者:[wi-cuckoo](https://github.com/wi-cuckoo) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.infoworld.com/author/Ben-Ramsey/ -[1]:https://www.flickr.com/photos/jurvetson/13049862325 -[2]:https://groups.google.com/d/msg/comp.infosystems.www.authoring.cgi/PyJ25gZ6z7A/M9FkTUVDfcwJ -[3]:http://w3techs.com/technologies/overview/programming_language/all -[4]:http://web.archive.org/web/20061215165756/http://chiphpug.php.net/mpug.htm -[5]:http://www.phpdeveloper.org/ -[6]:http://www.php-fig.org/ -[7]:http://www.infoworld.com/article/2610885/facebook-q-a--hack-brings-static-typing-to-php-world.html -[8]:https://wiki.php.net/todo/php70#timetable -[9]:http://talks.php.net/velocity15 -[10]:http://www.php-fig.org/psr/psr-7/ -[11]:http://phpmentoring.org/ -这里向Lerdorf和PHP社区的其他人致敬,感谢他们把这个“愚蠢的小项目”变成了一个如今网络上持久的,强大的组块。 From ce9c3d94a633ca0efe126d011264de1edee37557 Mon Sep 17 00:00:00 2001 From: wxy Date: Mon, 22 Jun 2015 17:43:26 +0800 Subject: [PATCH 444/965] PUB:20150515 How to Install Percona Server on CentOS 7 @FatJoe123 --- ...w to Install Percona Server on CentOS 7.md | 113 ++++++------------ 1 file changed, 37 insertions(+), 76 deletions(-) rename {translated/tech => published}/20150515 How to Install Percona Server on CentOS 7.md (60%) diff --git a/translated/tech/20150515 How to Install Percona Server on CentOS 7.md b/published/20150515 How to Install Percona Server on CentOS 7.md similarity index 60% rename from translated/tech/20150515 How to Install Percona Server on CentOS 7.md rename to published/20150515 How to Install Percona Server on CentOS 7.md index ef283c8b92..8a99197328 100644 --- a/translated/tech/20150515 How to Install Percona Server on CentOS 7.md +++ b/published/20150515 How to Install Percona Server on CentOS 7.md @@ -1,133 +1,99 @@ - -如何在CentOS 7上安装Percona Server - +如何在 CentOS 7 上安装 Percona服务器 ================================================================================ -在这篇文章中我们将了解关于Percona Server,一个开源简易的MySQL,MariaDB的替代。InnoDB的数据库引擎使得Percona Server非常有吸引力,如果你需要的高性能,高可靠性和高性价比的解决方案,它将是一个很好的选择。 -在下文中将介绍在CentOS 7上Percona的服务器的安装,以及备份当前数据,配置的步骤和如何恢复备份。 - - -###目录### - - -1.什么是Percona,为什么使用它 -2.备份你的数据库 -3.删除之前的SQL服务器 -4.使用二进制包安装Percona -5.配置Percona -6.保护你的数据 -7.恢复你的备份 +在这篇文章中我们将了解关于 Percona 服务器,一个开源的MySQL,MariaDB的替代品。InnoDB的数据库引擎使得Percona 服务器非常有吸引力,如果你需要的高性能,高可靠性和高性价比的解决方案,它将是一个很好的选择。 +在下文中将介绍在CentOS 7上Percona 服务器的安装,以及备份当前数据,配置的步骤和如何恢复备份。 ### 1.什么是Percona,为什么使用它 ### - -Percona是一个开源简易的MySQL,MariaDB数据库的替代,它是MYSQL的一个分支,相当多的改进和独特的功能使得它比MYSQL更可靠,性能更强,速度更快,它与MYSQL完全兼容,你甚至可以在Oracle的MYSQL与Percona之间使用复制命令。 +Percona是一个MySQL,MariaDB数据库的开源替代品,它是MySQL的一个分支,相当多的改进和独特的功能使得它比MYSQL更可靠,性能更强,速度更快,它与MYSQL完全兼容,你甚至可以在Oracle的MySQL与Percona之间使用复制。 #### 在Percona中独具特色的功能 #### +- 分区适应哈希搜索 +- 快速校验算法 +- 缓冲池预加载 +- 支持FlashCache --分段自适应哈希搜索 --快速校验算法 --缓冲池预加载 --支持FlashCache +#### MySQL企业版和Percona中的特有功能 #### -#### MySQL企业版和Percona的特定功能 #### +- 从不同的服务器导入表 +- PAM认证 +- 审计日志 +- 线程池 --从不同的服务器导入表 --PAM认证 --审计日志 --线程池 - - -现在,你肯定很兴奋地看到这些好的东西整理在一起,我们将告诉你如何安装和做些的Percona Server的基本配置。 +现在,你肯定很兴奋地看到这些好的东西整合在一起,我们将告诉你如何安装和对Percona Server做基本配置。 ### 2. 备份你的数据库 ### - -接下来,在命令行下使用SQL命令创建一个mydatabases.sql文件来重建/恢复salesdb和employeedb数据库,重命名数据库以便反映你的设置,如果没有安装MYSQL跳过此步 +接下来,在命令行下使用SQL命令创建一个mydatabases.sql文件,来重建或恢复salesdb和employeedb数据库,根据你的设置替换数据库名称,如果没有安装MySQL则跳过此步: mysqldump -u root -p --databases employeedb salesdb > mydatabases.sql -复制当前的配置文件,如果你没有安装MYSQL也可跳过 - +复制当前的配置文件,如果你没有安装MYSQL也可跳过: cp my.cnf my.cnf.bkp ### 3.删除之前的SQL服务器 ### - -停止MYSQL/MariaDB如果它们还在运行 - +停止MYSQL/MariaDB,如果它们还在运行: systemctl stop mysql.service -卸载MariaDB和MYSQL - +卸载MariaDB和MYSQL: yum remove MariaDB-server MariaDB-client MariaDB-shared mysql mysql-server -移动重命名在/var/lib/mysql当中的MariaDB文件,这比仅仅只是移除更为安全快速,这就像2级即时备份。:) - +移动重命名放在/var/lib/mysql当中的MariaDB文件。这比仅仅只是移除更为安全快速,这就像2级即时备份。:) mv /var/lib/mysql /var/lib/mysql_mariadb ### 4.使用二进制包安装Percona ### - 你可以在众多Percona安装方法中选择,在CentOS中使用Yum或者RPM包安装通常是更好的主意,所以这些是本文介绍的方式,下载源文件编译后安装在本文中并没有介绍。 +从Yum仓库中安装: -从Yum仓库中安装: - - -首先,你需要设置的Percona的Yum库: - +首先,你需要设置Percona的Yum库: yum install http://www.percona.com/downloads/percona-release/redhat/0.1-3/percona-release-0.1-3.noarch.rpm 接下来安装Percona: - yum install Percona-Server-client-56 Percona-Server-server-56 -上面的命令安装Percona的服务器和客户端,共享库,可能需要Perl和Perl模块,以及其他依赖的需要。如DBI::MySQL的,如果这些尚未安装, - -使用RPM包安装: +上面的命令安装Percona的服务器和客户端、共享库,可能需要Perl和Perl模块,以及其他依赖的需要,如DBI::MySQL。如果这些尚未安装,可能需要安装更多的依赖包。 +使用RPM包安装: 我们可以使用wget命令下载所有的rpm包: - - wget -r -l 1 -nd -A rpm -R "*devel*,*debuginfo*" \ http://www.percona.com/downloads/Percona-Server-5.5/Percona-Server-5.5.42-37.1/binary/redhat/7/x86_64/ + wget -r -l 1 -nd -A rpm -R "*devel*,*debuginfo*" \ + http://www.percona.com/downloads/Percona-Server-5.5/Percona-Server-5.5.42-37.1/binary/redhat/7/x86_64/ 使用rpm工具,一次性安装所有的rpm包: + rpm -ivh Percona-Server-server-55-5.5.42-rel37.1.el7.x86_64.rpm \ + Percona-Server-client-55-5.5.42-rel37.1.el7.x86_64.rpm \ + Percona-Server-shared-55-5.5.42-rel37.1.el7.x86_64.rpm - rpm -ivh Percona-Server-server-55-5.5.42-rel37.1.el7.x86_64.rpm \ Percona-Server-client-55-5.5.42-rel37.1.el7.x86_64.rpm \ Percona-Server-shared-55-5.5.42-rel37.1.el7.x86_64.rpm - -注意在上面命令语句中最后的反斜杠'\',如果您安装单独的软件包,记住要解决依赖关系,在安装客户端之前要先安装共享包,在安装服务器之前请先安装客户端。 +注意在上面命令语句中最后的反斜杠'\'(只是为了换行方便)。如果您安装单独的软件包,记住要解决依赖关系,在安装客户端之前要先安装共享包,在安装服务器之前请先安装客户端。 ### 5.配置Percona服务器 ### - - #### 恢复之前的配置 #### - 当我们从MariaDB迁移过来时,你可以将之前的my.cnf的备份文件恢复回来。 - cp /etc/my.cnf.bkp /etc/my.cnf #### 创建一个新的my.cnf文件 #### - 如果你需要一个适合你需求的新的配置文件或者你并没有备份配置文件,你可以使用以下方法,通过简单的几步生成新的配置文件。 下面是Percona-server软件包自带的my.cnf文件 - # Percona Server template configuration [mysqld] @@ -158,33 +124,29 @@ Percona是一个开源简易的MySQL,MariaDB数据库的替代,它是MYSQL 根据你的需要配置好my.cnf后,就可以启动该服务了: - systemctl restart mysql.service 如果一切顺利的话,它已经准备好执行SQL命令了,你可以用以下命令检查它是否已经正常启动: - mysql -u root -p -e 'SHOW VARIABLES LIKE "version_comment"' 如果你不能够正常启动它,你可以在**/var/log/mysql/mysqld.log**中查找原因,该文件可在my.cnf的[mysql_safe]的log-error中设置。 tail /var/log/mysql/mysqld.log -你也可以在/var/lib/mysql/文件夹下查找格式为[hostname].err的文件,就像下面这个例子样: - +你也可以在/var/lib/mysql/文件夹下查找格式为[主机名].err的文件,就像下面这个例子: tail /var/lib/mysql/centos7.err 如果还是没找出原因,你可以试试strace: - yum install strace && systemctl stop mysql.service && strace -f -f mysqld_safe + 上面的命令挺长的,输出的结果也相对简单,但绝大多数时候你都能找到无法启动的原因。 ### 6.保护你的数据 ### -好了,你的关系数据库管理系统已经准备好接收SQL查询,但是把你宝贵的数据放在没有最起码安全保护的服务器上并不可取,为了更为安全最好使用mysql_secure_instalation,这个工具可以帮助删除未使用的默认功能,还设置root的密码,并限制使用此用户进行访问。 -只需要在shell中执行,并参照屏幕上的说明。 +好了,你的关系数据库管理系统已经准备好接收SQL查询,但是把你宝贵的数据放在没有最起码安全保护的服务器上并不可取,为了更为安全最好使用mysql_secure_install来安装,这个工具可以帮助你删除未使用的默认功能,并设置root的密码,限制使用此用户进行访问。只需要在shell中执行该命令,并参照屏幕上的说明操作。 mysql_secure_install @@ -192,28 +154,27 @@ Percona是一个开源简易的MySQL,MariaDB数据库的替代,它是MYSQL 如果您参照之前的设置,现在你可以恢复数据库,只需再用mysqldump一次。 - mysqldump -u root -p < mydatabases.sql -恭喜你,你刚刚已经在你的CentOS上成功安装了Percona,你的服务器已经可以正式投入使用;你可以像使用MYSQL一样使用它,你的服务器与他完全兼容。 + +恭喜你,你刚刚已经在你的CentOS上成功安装了Percona,你的服务器已经可以正式投入使用;你可以像使用MySQL一样使用它,你的服务器与它完全兼容。 ### 总结 ### -为了获得更强的性能你需要对配置文件做大量的修改,但这里也有一些简单的选项来提高机器的性能。当使用InnoDB引擎时,将innodb_file_per_table设置为on,它将在一个文件中为每个表创建索引表,这意味着每个表都有它自己的索引文件,它使系统更强大和更容易维修。 +为了获得更强的性能你需要对配置文件做大量的修改,但这里也有一些简单的选项来提高机器的性能。当使用InnoDB引擎时,将innodb_file_per_table设置为on,它将在一个文件中为每个表创建索引表,这意味着每个表都有它自己的索引文件,它使系统更强大和更容易维修。 可以修改innodb_buffer_pool_size选项,InnoDB应该有足够的缓存池来应对你的数据集,大小应该为当前可用内存的70%到80%。 -过将innodb-flush-method设置为O_DIRECT,关闭写入高速缓存,如果你使用了RAID,这可以提升性能因为在底层已经完成了缓存操作。 +将innodb-flush-method设置为O_DIRECT,关闭写入高速缓存,如果你使用了RAID,这可以提升性能,因为在底层已经完成了缓存操作。 如果你的数据并不是十分关键并且并不需要对数据库事务正确执行的四个基本要素完全兼容,可以将innodb_flush_log_at_trx_commit设置为2,这也能提升系统的性能。 - -------------------------------------------------------------------------------- via: http://linoxide.com/linux-how-to/percona-server-centos-7/ 作者:[Carlos Alberto][a] 译者:[FatJoe123](https://github.com/FatJoe123) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From e654fc4b1eb94f7054078f4f344456f3b4bd37df Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 22 Jun 2015 21:08:35 +0800 Subject: [PATCH 445/965] translated --- ...PHP or PhpMyAdmin in RHEL or CentOS 7.0.md | 105 +++++++++--------- 1 file changed, 52 insertions(+), 53 deletions(-) rename {sources => translated}/tech/20150616 Installing LAMP Linux, Apache, MariaDB, PHP or PhpMyAdmin in RHEL or CentOS 7.0.md (52%) diff --git a/sources/tech/20150616 Installing LAMP Linux, Apache, MariaDB, PHP or PhpMyAdmin in RHEL or CentOS 7.0.md b/translated/tech/20150616 Installing LAMP Linux, Apache, MariaDB, PHP or PhpMyAdmin in RHEL or CentOS 7.0.md similarity index 52% rename from sources/tech/20150616 Installing LAMP Linux, Apache, MariaDB, PHP or PhpMyAdmin in RHEL or CentOS 7.0.md rename to translated/tech/20150616 Installing LAMP Linux, Apache, MariaDB, PHP or PhpMyAdmin in RHEL or CentOS 7.0.md index a45e83d365..5057c2e416 100644 --- a/sources/tech/20150616 Installing LAMP Linux, Apache, MariaDB, PHP or PhpMyAdmin in RHEL or CentOS 7.0.md +++ b/translated/tech/20150616 Installing LAMP Linux, Apache, MariaDB, PHP or PhpMyAdmin in RHEL or CentOS 7.0.md @@ -1,66 +1,64 @@ -translating----geekpi - -Installing LAMP (Linux, Apache, MariaDB, PHP/PhpMyAdmin) in RHEL/CentOS 7.0 +在RHEL/CentOS 7.0中安装LAMP(Linux、 Apache、 MariaDB、 PHP/PhpMyAdmin) ================================================================================ -Skipping the LAMP introduction, as I’m sure that most of you know what is all about. This tutorial will concentrate on how to install and configure famous LAMP stack – Linux Apache, MariaDB, PHP, PhpMyAdmin – on the last release of Red Hat Enterprise Linux 7.0 and CentOS 7.0, with the mention that both distributions have upgraded httpd daemon to Apache HTTP 2.4. +跳过LAMP的介绍因为我认为你们大多数已经知道了。这个教程会集中在如何在升级到Apache 2.4的 Red Hat Enterprise Linux 7.0 和 CentOS 7.0中安装和配置LAMP-Linux Apache、 MariaDB、 PHP、PhpMyAdmin。 ![Install LAMP in CentOS 7](http://www.tecmint.com/wp-content/uploads/2014/07/Install-LAMP-in-CentOS-7.jpg) -Install LAMP in RHEL/CentOS 7.0 +在RHEL/CentOS 7.0中安装LAMP -#### Requirements #### +#### 要求 #### -Depending on the used distribution, RHEL or CentOS 7.0, use the following links to perform a minimal system installation, using a static IP Address for network configuration. +根据使用的发行版,RHEL 或者 CentOS 7.0使用下面的链接来执行最小的系统安装,网络使用静态ip -**For RHEL 7.0** +**对于RHEL 7.0** -- [RHEL 7.0 Installation Procedure][1] -- [Register and Enable Subscriptions/Repositories on RHEL 7.0][2] +- [RHEL 7.0安装过程][1] +- [在RHEL 7.0中注册和启用订阅仓库][2] -**For CentOS 7.0** +**对于 CentOS 7.0** -- [CentOS 7.0 Installation Procedure][3] +- [CentOS 7.0 安装过程][3] -### Step 1: Install Apache Server with Basic Configurations ### +### 第一步: 使用基本配置安装apache ### -**1. After performing a minimal system installation and configure your server network interface with a [Static IP Address on RHEL/CentOS 7.0][4], go ahead and install Apache 2.4 httpd service binary package provided form official repositories using the following command.** +**1. 在执行最小系统安装并配置[在RHEL/CentOS 7.0中配置静态ip][4]**就可以从使用下面的命令从官方仓库安装最新的Apache 2.4 httpd服务。 # yum install httpd ![Install Apache in CentOS 7](http://www.tecmint.com/wp-content/uploads/2014/07/Install-Apache-in-CentOS-7.png) -Install Apache Web Server +安装apache服务 -**2. After yum manager finish installation, use the following commands to manage Apache daemon, since RHEL and CentOS 7.0 both migrated their init scripts from SysV to systemd – you can also use SysV and Apache scripts the same time to manage the service.** +**2. 安装安城后,使用下面的命令来管理apache守护进程,因为RHEL and CentOS 7.0都将init脚本从SysV升级到了systemd - 你也可以同事使用SysV和Apache脚本来管理服务。** # systemctl status|start|stop|restart|reload httpd - OR + 或者 # service httpd status|start|stop|restart|reload - OR + 或者 # apachectl configtest| graceful ![Start Apache in CentOS 7](http://www.tecmint.com/wp-content/uploads/2014/07/Start-Apache-in-CentOS-7.png) -Start Apache Web Server +启动apache服务 -**3. On the next step start Apache service using systemd init script and open RHEL/CentOS 7.0 Firewall rules using firewall-cmd, which is the default command to manage iptables through firewalld daemon.** +**3. 下一步使用systemd初始化脚本来启动apache服务并用firewall-cmd打开RHEL/CentOS 7.0防火墙规则, 这是通过firewalld守护进程管理iptables的默认命令。** # firewall-cmd --add-service=http -**NOTE**: Make notice that using this rule will lose its effect after a system reboot or firewalld service restart, because it opens on-fly rules, which are not applied permanently. To apply consistency iptables rules on firewall use –permanent option and restart firewalld service to take effect. +**注意**:上面的命令会在系统重启或者firewalld服务重启后失效,因为它是即时的规则,它不会永久生效。要使iptables规则在fiewwall中持久化,使用-permanent选项并重启firewalld服务来生效。 # firewall-cmd --permanent --add-service=http # systemctl restart firewalld ![Enable Firewall in CentOS 7](http://www.tecmint.com/wp-content/uploads/2014/07/Enable-Firewall-in-CentOS-7.png) -Enable Firewall in CentOS 7 +在CentOS 7中启用Firewall -Other important Firewalld options are presented below: +下面是firewalld其他的重要选项: # firewall-cmd --state # firewall-cmd --list-all @@ -69,37 +67,38 @@ Other important Firewalld options are presented below: # firewall-cmd --query-service service_name # firewall-cmd --add-port=8080/tcp -**4. To verify Apache functionality open a remote browser and type your server IP Address using HTTP protocol on URL (http://server_IP), and a default page should appear like in the screenshot below.** +**4. 要验证apache的功能,打开一个远程浏览器并使用http协议输入你服务器的ip地址(http://server_IP), 应该会显示下图中的默认页面。** ![Apache Default Page](http://www.tecmint.com/wp-content/uploads/2014/07/Apache-Default-Page.png) -Apache Default Page +Apache默认页 -**5. For now, Apache DocumentRoot path it’s set to /var/www/html system path, which by default doesn’t provide any index file. If you want to see a directory list of your DocumentRoot path open Apache welcome configuration file and set Indexes statement from – to + on directive, using the below screenshot as an example.** +**5. 现在apache的根地址在/var/www/html,该目录中没有提供任何index文件。如果你想要看见根目录下的文件夹列表,打开apache欢迎配置文件并设置 下Indexes前的状态从-到+,下面的截图就是一个例子。** # nano /etc/httpd/conf.d/welcome.conf ![Apache Directory Listing](http://www.tecmint.com/wp-content/uploads/2014/07/Apache-Directory-Listing.png) -Apache Directory Listing +Apache目录列出 -**6. Close the file, restart Apache service to reflect changes and reload your browser page to see the final result.** +**6. 关闭文件,重启apache服务来使设置生效,重载页面来看最终效果。** # systemctl restart httpd ![Apache Index File](http://www.tecmint.com/wp-content/uploads/2014/07/Apache-Index-File.png) -Apache Index File +Apache Index 文件 -### Step 2: Install PHP5 Support for Apache ### +### 第二步: 为Apache安装php5支持 ### -**7. Before installing PHP5 dynamic language support for Apache, get a full list of available PHP modules and extensions using the following command.** + +**7. 在为apache安装php支持之前,使用下面的命令的得到所有可用的php模块和扩展。** # yum search php ![Install PHP in CentOS 7](http://www.tecmint.com/wp-content/uploads/2014/07/Install-PHP-in-CentOS-7.png) -Install PHP in CentOS 7 +在 **8. Depending on what type of applications you want to use, install the required PHP modules from the above list, but for a basic MariaDB support in PHP and PhpMyAdmin you need to install the following modules.** @@ -142,22 +141,22 @@ Set Timezone in PHP ![Install MariaDB in CentOS 7](http://www.tecmint.com/wp-content/uploads/2014/07/Install-MariaDB-in-CentOs-7.png) -Install MariaDB in CentOS 7 +在CentOS 7中安装PHP -**12. After MariaDB package is installed, start database daemon and use mysql_secure_installation script to secure database (set root password, disable remotely logon from root, remove test database and remove anonymous users).** +***12. 安装MariaDB后,开启数据库守护进程并使用mysql_secure_installation脚本来保护数据库(设置root密码、禁止远程root登录、移除测试数据库、移除匿名用户)** # systemctl start mariadb # mysql_secure_installation ![Start MariaDB Database](http://www.tecmint.com/wp-content/uploads/2014/07/Start-MariaDB-in-CentOS-7.png) -Start MariaDB Database +启动MariaDB数据库 ![Secure MySQL Installation](http://www.tecmint.com/wp-content/uploads/2014/07/Secure-MySQL-Installation.png) -Secure MySQL Installation +MySQL安全设置 -**13. To test database functionality login to MariaDB using its root account and exit using quit statement.** +**13. 要测试数据库功能,使用root账户登录MariaDB并用quit退出。** mysql -u root -p MariaDB > SHOW VARIABLES; @@ -165,27 +164,27 @@ Secure MySQL Installation ![Connect MySQL Database in CentOS](http://www.tecmint.com/wp-content/uploads/2014/07/Connect-MySQL-Installation.png) -Connect MySQL Database +连接MySQL数据库 -### Step 4: Install PhpMyAdmin ### +### 第四步: 安装PhpMyAdmin ### -**14. By default official RHEL 7.0 or CentOS 7.0 repositories doesn’t provide any binary package for PhpMyAdmin Web Interface. If you are uncomfortable using MySQL command line to manage your database you can install PhpMyAdmin package by enabling CentOS 7.0 rpmforge repositories using the following command.** +**14. RHEL 7.0 或者 CentOS 7.0仓库默认没有提供PhpMyAdmin二进制安装包。如果你不适应使用MySQL命令行来管理你的数据库,你可以通过下面的命令启用CentOS 7.0 rpmforge仓库来安装PhpMyAdmin。** # yum install http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el7.rf.x86_64.rpm -After enabling rpmforge repository, next install PhpMyAdmin. +启用rpmforge仓库后,下面安装PhpMyAdmin。 # yum install phpmyadmin ![Enable RPMForge in CentOS 7](http://www.tecmint.com/wp-content/uploads/2014/07/Enable-RPMForge-in-CentOS-7.png) -Enable RPMForge Repository +启用RPMForge仓库 -**15. Next configure PhpMyAdmin to allow connections from remote hosts by editing phpmyadmin.conf file, located on Apache conf.d directory, commenting the following lines.** +**15. 下面配置PhpMyAdmin的phpmyadmin.conf来允许远程连接,它位于Apache conf.d目录下,并注释掉下面的行。** # nano /etc/httpd/conf.d/phpmyadmin.conf -Use a # and comment this lines. +使用#来注释掉行。 # Order Deny,Allow # Deny from all @@ -193,40 +192,40 @@ Use a # and comment this lines. ![Allow Remote PhpMyAdmin Access](http://www.tecmint.com/wp-content/uploads/2014/07/Allow-Remote-PhpMyAdmin-Access.png) -Allow Remote PhpMyAdmin Access +允许远程PhpMyAdmin访问 -**16. To be able to login to PhpMyAdmin Web interface using cookie authentication method add a blowfish string to phpmyadmin config.inc.php file like in the screenshot below using the [generate a secret string][6], restart Apache Web service and direct your browser to the URL address http://server_IP/phpmyadmin/.** +**16. 要使用cookie验证来登录PhpMyAdmin,像下面的截图那样使用[生成字符串][6]添加一个blowfish字符串到config.inc.php文件下,重启apache服务并打开URL:http://server_IP/phpmyadmin/。** # nano /etc/httpd/conf.d/phpmyadmin.conf # systemctl restart httpd ![Add Blowfish in PhpMyAdmin](http://www.tecmint.com/wp-content/uploads/2014/07/Add-Blowfish-PhpMyAdmin.png) -Add Blowfish in PhpMyAdmin +在PhpMyAdmin中添加Blowfish ![PhpMyAdmin Dashboard](http://www.tecmint.com/wp-content/uploads/2014/07/Login-to-PhpMyAdmin.png) -PhpMyAdmin Dashboard +PhpMyAdmin面板 -### Step 5: Enable LAMP System-wide ### +### 第五步: 系统范围启用LAMP ### -**17. If you need MariaDB and Apache services to be automatically started after reboot issue the following commands to enable them system-wide.** +**17. 如果你需要在重启后自动运行MariaDB和Apache服务,你需要系统级地启用它们。** # systemctl enable mariadb # systemctl enable httpd ![Enable Services System Wide](http://www.tecmint.com/wp-content/uploads/2014/07/Enable-Services-System-Wide.png) -Enable Services System Wide +系统级启用服务 -That’s all it takes for a basic LAMP installation on Red Hat Enterprise 7.0 or CentOS 7.0. The next series of articles related to LAMP stack on CentOS/RHEL 7.0 will discuss how to create Virtual Hosts, generate SSL Certificates and Keys and add SSL transaction support for Apache HTTP Server. +这就是在Red Hat Enterprise 7.0或者CentOS 7.0中安装LAMP的过程。CentOS/RHEL 7.0上关于LAMP洗系列文章将会讨论在Apache中创建虚拟主机,生成SSL证书、密钥和添加SSL事物支持。 -------------------------------------------------------------------------------- via: http://www.tecmint.com/install-lamp-in-centos-7/ 作者:[Matei Cezar][a] -译者:[译者ID](https://github.com/译者ID) +译者:[geekpi](https://github.com/geekpi) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From d992f0cc83b259af25b4e9342e78515c9578b9b7 Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 22 Jun 2015 21:17:28 +0800 Subject: [PATCH 446/965] translated --- ...PHP or PhpMyAdmin in RHEL or CentOS 7.0.md | 105 +++++++++--------- 1 file changed, 52 insertions(+), 53 deletions(-) rename {sources => translated}/tech/20150616 Installing LAMP Linux, Apache, MariaDB, PHP or PhpMyAdmin in RHEL or CentOS 7.0.md (52%) diff --git a/sources/tech/20150616 Installing LAMP Linux, Apache, MariaDB, PHP or PhpMyAdmin in RHEL or CentOS 7.0.md b/translated/tech/20150616 Installing LAMP Linux, Apache, MariaDB, PHP or PhpMyAdmin in RHEL or CentOS 7.0.md similarity index 52% rename from sources/tech/20150616 Installing LAMP Linux, Apache, MariaDB, PHP or PhpMyAdmin in RHEL or CentOS 7.0.md rename to translated/tech/20150616 Installing LAMP Linux, Apache, MariaDB, PHP or PhpMyAdmin in RHEL or CentOS 7.0.md index a45e83d365..5057c2e416 100644 --- a/sources/tech/20150616 Installing LAMP Linux, Apache, MariaDB, PHP or PhpMyAdmin in RHEL or CentOS 7.0.md +++ b/translated/tech/20150616 Installing LAMP Linux, Apache, MariaDB, PHP or PhpMyAdmin in RHEL or CentOS 7.0.md @@ -1,66 +1,64 @@ -translating----geekpi - -Installing LAMP (Linux, Apache, MariaDB, PHP/PhpMyAdmin) in RHEL/CentOS 7.0 +在RHEL/CentOS 7.0中安装LAMP(Linux、 Apache、 MariaDB、 PHP/PhpMyAdmin) ================================================================================ -Skipping the LAMP introduction, as I’m sure that most of you know what is all about. This tutorial will concentrate on how to install and configure famous LAMP stack – Linux Apache, MariaDB, PHP, PhpMyAdmin – on the last release of Red Hat Enterprise Linux 7.0 and CentOS 7.0, with the mention that both distributions have upgraded httpd daemon to Apache HTTP 2.4. +跳过LAMP的介绍因为我认为你们大多数已经知道了。这个教程会集中在如何在升级到Apache 2.4的 Red Hat Enterprise Linux 7.0 和 CentOS 7.0中安装和配置LAMP-Linux Apache、 MariaDB、 PHP、PhpMyAdmin。 ![Install LAMP in CentOS 7](http://www.tecmint.com/wp-content/uploads/2014/07/Install-LAMP-in-CentOS-7.jpg) -Install LAMP in RHEL/CentOS 7.0 +在RHEL/CentOS 7.0中安装LAMP -#### Requirements #### +#### 要求 #### -Depending on the used distribution, RHEL or CentOS 7.0, use the following links to perform a minimal system installation, using a static IP Address for network configuration. +根据使用的发行版,RHEL 或者 CentOS 7.0使用下面的链接来执行最小的系统安装,网络使用静态ip -**For RHEL 7.0** +**对于RHEL 7.0** -- [RHEL 7.0 Installation Procedure][1] -- [Register and Enable Subscriptions/Repositories on RHEL 7.0][2] +- [RHEL 7.0安装过程][1] +- [在RHEL 7.0中注册和启用订阅仓库][2] -**For CentOS 7.0** +**对于 CentOS 7.0** -- [CentOS 7.0 Installation Procedure][3] +- [CentOS 7.0 安装过程][3] -### Step 1: Install Apache Server with Basic Configurations ### +### 第一步: 使用基本配置安装apache ### -**1. After performing a minimal system installation and configure your server network interface with a [Static IP Address on RHEL/CentOS 7.0][4], go ahead and install Apache 2.4 httpd service binary package provided form official repositories using the following command.** +**1. 在执行最小系统安装并配置[在RHEL/CentOS 7.0中配置静态ip][4]**就可以从使用下面的命令从官方仓库安装最新的Apache 2.4 httpd服务。 # yum install httpd ![Install Apache in CentOS 7](http://www.tecmint.com/wp-content/uploads/2014/07/Install-Apache-in-CentOS-7.png) -Install Apache Web Server +安装apache服务 -**2. After yum manager finish installation, use the following commands to manage Apache daemon, since RHEL and CentOS 7.0 both migrated their init scripts from SysV to systemd – you can also use SysV and Apache scripts the same time to manage the service.** +**2. 安装安城后,使用下面的命令来管理apache守护进程,因为RHEL and CentOS 7.0都将init脚本从SysV升级到了systemd - 你也可以同事使用SysV和Apache脚本来管理服务。** # systemctl status|start|stop|restart|reload httpd - OR + 或者 # service httpd status|start|stop|restart|reload - OR + 或者 # apachectl configtest| graceful ![Start Apache in CentOS 7](http://www.tecmint.com/wp-content/uploads/2014/07/Start-Apache-in-CentOS-7.png) -Start Apache Web Server +启动apache服务 -**3. On the next step start Apache service using systemd init script and open RHEL/CentOS 7.0 Firewall rules using firewall-cmd, which is the default command to manage iptables through firewalld daemon.** +**3. 下一步使用systemd初始化脚本来启动apache服务并用firewall-cmd打开RHEL/CentOS 7.0防火墙规则, 这是通过firewalld守护进程管理iptables的默认命令。** # firewall-cmd --add-service=http -**NOTE**: Make notice that using this rule will lose its effect after a system reboot or firewalld service restart, because it opens on-fly rules, which are not applied permanently. To apply consistency iptables rules on firewall use –permanent option and restart firewalld service to take effect. +**注意**:上面的命令会在系统重启或者firewalld服务重启后失效,因为它是即时的规则,它不会永久生效。要使iptables规则在fiewwall中持久化,使用-permanent选项并重启firewalld服务来生效。 # firewall-cmd --permanent --add-service=http # systemctl restart firewalld ![Enable Firewall in CentOS 7](http://www.tecmint.com/wp-content/uploads/2014/07/Enable-Firewall-in-CentOS-7.png) -Enable Firewall in CentOS 7 +在CentOS 7中启用Firewall -Other important Firewalld options are presented below: +下面是firewalld其他的重要选项: # firewall-cmd --state # firewall-cmd --list-all @@ -69,37 +67,38 @@ Other important Firewalld options are presented below: # firewall-cmd --query-service service_name # firewall-cmd --add-port=8080/tcp -**4. To verify Apache functionality open a remote browser and type your server IP Address using HTTP protocol on URL (http://server_IP), and a default page should appear like in the screenshot below.** +**4. 要验证apache的功能,打开一个远程浏览器并使用http协议输入你服务器的ip地址(http://server_IP), 应该会显示下图中的默认页面。** ![Apache Default Page](http://www.tecmint.com/wp-content/uploads/2014/07/Apache-Default-Page.png) -Apache Default Page +Apache默认页 -**5. For now, Apache DocumentRoot path it’s set to /var/www/html system path, which by default doesn’t provide any index file. If you want to see a directory list of your DocumentRoot path open Apache welcome configuration file and set Indexes statement from – to + on directive, using the below screenshot as an example.** +**5. 现在apache的根地址在/var/www/html,该目录中没有提供任何index文件。如果你想要看见根目录下的文件夹列表,打开apache欢迎配置文件并设置 下Indexes前的状态从-到+,下面的截图就是一个例子。** # nano /etc/httpd/conf.d/welcome.conf ![Apache Directory Listing](http://www.tecmint.com/wp-content/uploads/2014/07/Apache-Directory-Listing.png) -Apache Directory Listing +Apache目录列出 -**6. Close the file, restart Apache service to reflect changes and reload your browser page to see the final result.** +**6. 关闭文件,重启apache服务来使设置生效,重载页面来看最终效果。** # systemctl restart httpd ![Apache Index File](http://www.tecmint.com/wp-content/uploads/2014/07/Apache-Index-File.png) -Apache Index File +Apache Index 文件 -### Step 2: Install PHP5 Support for Apache ### +### 第二步: 为Apache安装php5支持 ### -**7. Before installing PHP5 dynamic language support for Apache, get a full list of available PHP modules and extensions using the following command.** + +**7. 在为apache安装php支持之前,使用下面的命令的得到所有可用的php模块和扩展。** # yum search php ![Install PHP in CentOS 7](http://www.tecmint.com/wp-content/uploads/2014/07/Install-PHP-in-CentOS-7.png) -Install PHP in CentOS 7 +在 **8. Depending on what type of applications you want to use, install the required PHP modules from the above list, but for a basic MariaDB support in PHP and PhpMyAdmin you need to install the following modules.** @@ -142,22 +141,22 @@ Set Timezone in PHP ![Install MariaDB in CentOS 7](http://www.tecmint.com/wp-content/uploads/2014/07/Install-MariaDB-in-CentOs-7.png) -Install MariaDB in CentOS 7 +在CentOS 7中安装PHP -**12. After MariaDB package is installed, start database daemon and use mysql_secure_installation script to secure database (set root password, disable remotely logon from root, remove test database and remove anonymous users).** +***12. 安装MariaDB后,开启数据库守护进程并使用mysql_secure_installation脚本来保护数据库(设置root密码、禁止远程root登录、移除测试数据库、移除匿名用户)** # systemctl start mariadb # mysql_secure_installation ![Start MariaDB Database](http://www.tecmint.com/wp-content/uploads/2014/07/Start-MariaDB-in-CentOS-7.png) -Start MariaDB Database +启动MariaDB数据库 ![Secure MySQL Installation](http://www.tecmint.com/wp-content/uploads/2014/07/Secure-MySQL-Installation.png) -Secure MySQL Installation +MySQL安全设置 -**13. To test database functionality login to MariaDB using its root account and exit using quit statement.** +**13. 要测试数据库功能,使用root账户登录MariaDB并用quit退出。** mysql -u root -p MariaDB > SHOW VARIABLES; @@ -165,27 +164,27 @@ Secure MySQL Installation ![Connect MySQL Database in CentOS](http://www.tecmint.com/wp-content/uploads/2014/07/Connect-MySQL-Installation.png) -Connect MySQL Database +连接MySQL数据库 -### Step 4: Install PhpMyAdmin ### +### 第四步: 安装PhpMyAdmin ### -**14. By default official RHEL 7.0 or CentOS 7.0 repositories doesn’t provide any binary package for PhpMyAdmin Web Interface. If you are uncomfortable using MySQL command line to manage your database you can install PhpMyAdmin package by enabling CentOS 7.0 rpmforge repositories using the following command.** +**14. RHEL 7.0 或者 CentOS 7.0仓库默认没有提供PhpMyAdmin二进制安装包。如果你不适应使用MySQL命令行来管理你的数据库,你可以通过下面的命令启用CentOS 7.0 rpmforge仓库来安装PhpMyAdmin。** # yum install http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el7.rf.x86_64.rpm -After enabling rpmforge repository, next install PhpMyAdmin. +启用rpmforge仓库后,下面安装PhpMyAdmin。 # yum install phpmyadmin ![Enable RPMForge in CentOS 7](http://www.tecmint.com/wp-content/uploads/2014/07/Enable-RPMForge-in-CentOS-7.png) -Enable RPMForge Repository +启用RPMForge仓库 -**15. Next configure PhpMyAdmin to allow connections from remote hosts by editing phpmyadmin.conf file, located on Apache conf.d directory, commenting the following lines.** +**15. 下面配置PhpMyAdmin的phpmyadmin.conf来允许远程连接,它位于Apache conf.d目录下,并注释掉下面的行。** # nano /etc/httpd/conf.d/phpmyadmin.conf -Use a # and comment this lines. +使用#来注释掉行。 # Order Deny,Allow # Deny from all @@ -193,40 +192,40 @@ Use a # and comment this lines. ![Allow Remote PhpMyAdmin Access](http://www.tecmint.com/wp-content/uploads/2014/07/Allow-Remote-PhpMyAdmin-Access.png) -Allow Remote PhpMyAdmin Access +允许远程PhpMyAdmin访问 -**16. To be able to login to PhpMyAdmin Web interface using cookie authentication method add a blowfish string to phpmyadmin config.inc.php file like in the screenshot below using the [generate a secret string][6], restart Apache Web service and direct your browser to the URL address http://server_IP/phpmyadmin/.** +**16. 要使用cookie验证来登录PhpMyAdmin,像下面的截图那样使用[生成字符串][6]添加一个blowfish字符串到config.inc.php文件下,重启apache服务并打开URL:http://server_IP/phpmyadmin/。** # nano /etc/httpd/conf.d/phpmyadmin.conf # systemctl restart httpd ![Add Blowfish in PhpMyAdmin](http://www.tecmint.com/wp-content/uploads/2014/07/Add-Blowfish-PhpMyAdmin.png) -Add Blowfish in PhpMyAdmin +在PhpMyAdmin中添加Blowfish ![PhpMyAdmin Dashboard](http://www.tecmint.com/wp-content/uploads/2014/07/Login-to-PhpMyAdmin.png) -PhpMyAdmin Dashboard +PhpMyAdmin面板 -### Step 5: Enable LAMP System-wide ### +### 第五步: 系统范围启用LAMP ### -**17. If you need MariaDB and Apache services to be automatically started after reboot issue the following commands to enable them system-wide.** +**17. 如果你需要在重启后自动运行MariaDB和Apache服务,你需要系统级地启用它们。** # systemctl enable mariadb # systemctl enable httpd ![Enable Services System Wide](http://www.tecmint.com/wp-content/uploads/2014/07/Enable-Services-System-Wide.png) -Enable Services System Wide +系统级启用服务 -That’s all it takes for a basic LAMP installation on Red Hat Enterprise 7.0 or CentOS 7.0. The next series of articles related to LAMP stack on CentOS/RHEL 7.0 will discuss how to create Virtual Hosts, generate SSL Certificates and Keys and add SSL transaction support for Apache HTTP Server. +这就是在Red Hat Enterprise 7.0或者CentOS 7.0中安装LAMP的过程。CentOS/RHEL 7.0上关于LAMP洗系列文章将会讨论在Apache中创建虚拟主机,生成SSL证书、密钥和添加SSL事物支持。 -------------------------------------------------------------------------------- via: http://www.tecmint.com/install-lamp-in-centos-7/ 作者:[Matei Cezar][a] -译者:[译者ID](https://github.com/译者ID) +译者:[geekpi](https://github.com/geekpi) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 27ba5c0e8fc95c62e09b5d2913c64c7595a98de9 Mon Sep 17 00:00:00 2001 From: wxy Date: Mon, 22 Jun 2015 22:58:18 +0800 Subject: [PATCH 447/965] PUB:20150521 Linux FAQs with Answers--How to change system proxy settings from the command line on Ubuntu desktop @ictlyh --- ...ings from the command line on Ubuntu desktop.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) rename {translated/tech => published}/20150521 Linux FAQs with Answers--How to change system proxy settings from the command line on Ubuntu desktop.md (79%) diff --git a/translated/tech/20150521 Linux FAQs with Answers--How to change system proxy settings from the command line on Ubuntu desktop.md b/published/20150521 Linux FAQs with Answers--How to change system proxy settings from the command line on Ubuntu desktop.md similarity index 79% rename from translated/tech/20150521 Linux FAQs with Answers--How to change system proxy settings from the command line on Ubuntu desktop.md rename to published/20150521 Linux FAQs with Answers--How to change system proxy settings from the command line on Ubuntu desktop.md index 526de3549e..377a9a0399 100644 --- a/translated/tech/20150521 Linux FAQs with Answers--How to change system proxy settings from the command line on Ubuntu desktop.md +++ b/published/20150521 Linux FAQs with Answers--How to change system proxy settings from the command line on Ubuntu desktop.md @@ -1,14 +1,14 @@ -Linux 有问必答--如何在桌面版 Ubuntu 中用命令行更改系统代理设置 +Linux 有问必答:如何在桌面版 Ubuntu 中用命令行更改系统代理设置 ================================================================================ -> **问题**: 我经常需要在桌面版 Ubuntu 中更改系统代理设置,但我不想通过繁琐的 GUI 菜单链:"系统设置" -> "网络" -> "网络代理"。在命令行中有更方便的方法更改桌面版的代理设置吗? +> **问题**: 我经常需要在桌面版 Ubuntu 中更改系统代理设置,但我不想通过繁琐的 GUI 菜单点击:"系统设置" -> "网络" -> "网络代理"。在命令行中有更方便的方法更改桌面版的代理设置吗? -在桌面版 Ubuntu 中,它的桌面环境设置,包括系统代理设置,都存储在 DConf 数据库,这是简单的键值对存储。如果你想通过系统设置菜单修改桌面属性,更改会持久保存在后端的 DConf 数据库。在 Ubuntu 中更改 DConf 数据库有基于图像用户界面和非图形用户界面的两种方式。系统设置或者 dconf-editor 是访问 DConf 数据库的图形方法,而 gsettings 或 dconf 就是能更改数据库的命令行工具。 +在桌面版 Ubuntu 中,它的桌面环境设置,包括系统代理设置,都存储在 DConf 数据库,这是简单的键值对存储。如果你想通过系统设置菜单修改桌面属性,更改会持久保存在后端的 DConf 数据库。在 Ubuntu 中更改 DConf 数据库有基于图像用户界面和非图形用户界面的两种方式。系统设置或者 `dconf-editor` 是访问 DConf 数据库的图形方法,而 `gsettings` 或 `dconf` 就是能更改数据库的命令行工具。 -下面介绍如何用 gsettings 从命令行更改系统代理设置。 +下面介绍如何用 `gsettings` 从命令行更改系统代理设置。 ![](https://farm6.staticflickr.com/5460/17872782271_68e5267a4a_c.jpg) -gsetting 读写特定 Dconf 设置的基本用法如下: +`gsettings` 读写特定 Dconf 设置的基本用法如下: 更改 DConf 设置: @@ -53,7 +53,7 @@ gsetting 读写特定 Dconf 设置的基本用法如下: ### 在命令行中清除系统代理设置 ### -最后,清除所有 手动/自动 代理设置,还原为无代理设置: +最后,清除所有“手动/自动”代理设置,还原为无代理设置: $ gsettings set org.gnome.system.proxy mode 'none' @@ -63,7 +63,7 @@ via: http://ask.xmodulo.com/change-system-proxy-settings-command-line-ubuntu-des 作者:[Dan Nanni][a] 译者:[ictlyh](https://github.com/ictlyh) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 72d8715d0a6b5a07c3cdb9cac7e8c794c68fce52 Mon Sep 17 00:00:00 2001 From: wxy Date: Mon, 22 Jun 2015 23:29:34 +0800 Subject: [PATCH 448/965] PUB:20150528 11 pointless but awesome Linux terminal tricks @goreliu --- ...tless but awesome Linux terminal tricks.md | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) rename {translated/tech => published}/20150528 11 pointless but awesome Linux terminal tricks.md (84%) diff --git a/translated/tech/20150528 11 pointless but awesome Linux terminal tricks.md b/published/20150528 11 pointless but awesome Linux terminal tricks.md similarity index 84% rename from translated/tech/20150528 11 pointless but awesome Linux terminal tricks.md rename to published/20150528 11 pointless but awesome Linux terminal tricks.md index e4a33cf48a..1fc526db5e 100644 --- a/translated/tech/20150528 11 pointless but awesome Linux terminal tricks.md +++ b/published/20150528 11 pointless but awesome Linux terminal tricks.md @@ -1,6 +1,6 @@ -11个让人惊叹的Linux终端彩蛋 +11个无用而有趣的Linux终端彩蛋 ================================================================================ -这里有一些很酷的Linux终端彩蛋,其中的每一个看上去并没有实际用途,但很精彩。 +这里有一些很酷的Linux终端彩蛋,其中的每一个看上去并没有实际用途,但很有趣。 ![](http://images.techhive.com/images/article/2015/05/slide_01-100587352-orig.png) @@ -8,7 +8,7 @@ 当我们使用命令行工作时,Linux是功能和实用性最好的操作系统之一。想要执行一个特殊任务?可能一个程序或者脚本就可以帮你搞定。但就像一本书中说到的,只工作不玩耍聪明的孩子也会变傻。下边是我最喜欢的可以在终端做的没有实际用途的、傻傻的、恼人的、可笑的事情。 -### 给终端一个态度 ### +### 让终端成为一个有态度的人 ### * 第一步)敲入`sudo visudo` * 第二步)在“Defaults”末尾(文件的前半部分)添加一行“Defaults insults”。 @@ -20,13 +20,13 @@ ### apt-get moo ### -你看过这张截图?那就是运行`apt-get moo`(在基于Debian的系统)的结果。对,就是它了。不要对它抱太多幻想,你会失望的,我不骗你。但是这是Linux世界最被人熟知的彩蛋之一。所以我把它包含进来,并且放在前排,然后我也就不会收到5千封邮件,指责我把它遗漏了。 - ![](http://images.techhive.com/images/article/2015/05/slide_03-100587354-orig.png) + +你看过这张截图?那就是运行`apt-get moo`(在基于Debian的系统)的结果。对,就是它了。不要对它抱太多幻想,你会失望的,我不骗你。但是这是Linux世界最被人熟知的彩蛋之一。所以我把它包含进来,并且放在前排,然后我也就不会收到5千封邮件,指责我把它遗漏了。 ### aptitude moo ### -更有趣的是将moo应用到aptitude上。敲入`aptitude moo`(在Ubuntu及其衍生版),你对`moo`可以做什么事情的看法会有所变化。你还还会知道更多事情,尝试重新输入这条命令,但这次添加一个`-v`参数。这还没有结束,试着添加更多`v`,一次添加一个,直到aptitude给了你想要的东西。 +更有趣的是将moo应用到aptitude上。敲入`aptitude moo`(在Ubuntu及其衍生版),你对`moo`可以做什么事情的看法会有所变化。你还还会知道更多事情,尝试重新输入这条命令,但这次添加一个`-v`参数。这还没有结束,试着添加更多`v`,一次添加一个,直到抓狂的aptitude给了你想要的东西。 ![](http://images.techhive.com/images/article/2015/05/slide_04-100587355-orig.png) @@ -38,25 +38,25 @@ * 第二步)在“# Misc options”部分,去掉“Color”前的“#”。 * 第三步)添加“ILoveCandy”。 -现在我们使用pacman安装新软件包时,进度条里会出现一个小吃豆人。真应该默认就是这样的。 +现在我们使用pacman安装新软件包时,进度条里会出现一个小吃豆人。真应该默认就这样的。 ![](http://images.techhive.com/images/article/2015/05/slide_05-100587356-orig.png) ### Cowsay! ### -`aptitude moo`的输出格式很漂亮,但我想你苦于不能自由自在地使用。输入`cowsay`,它会做到你想做的事情。你可以让牛说任何你喜欢的东西。而且不只可以用牛,还可以用Calvin、Beavis和Ghostbusters的ASCII logo——输入`cowsay -l`可以得到所有可用的logo。它是Linux世界的强大工具。像很多其他命令一样,你可以使用管道把其他程序的输出输送给它,比如`fortune | cowsay`。 +`aptitude moo`的输出格式很漂亮,但我想你苦于不能自由自在地使用。输入`cowsay`,它会做到你想做的事情。你可以让牛说任何你喜欢的东西。而且不只可以用牛,还可以用Calvin、Beavis和Ghostbusters logo的ASCII的艺术,输入`cowsay -l`可以得到所有可用的参数。它是Linux世界的强大工具。像很多其他命令一样,你可以使用管道把其他程序的输出输送给它,比如`fortune | cowsay`,让这头牛变成哲学家。 ![](http://images.techhive.com/images/article/2015/05/slide_06-100587358-orig.png) ### 变成3l33t h@x0r ### -`nmap`并不是我们平时经常使用的基本命令。但如果你想蹂躏`nmap`的话,可能想在它的输出中看到l33t。在任何`nmap`命令(比如`nmap -oS - google.com`)后添加`-oS`。现在你的`nmap`已经处于官方名称是“[Script Kiddie Mode][1]”的模式了。Angelina Jolie和Keanu Reeves会为此骄傲的。 +`nmap`并不是我们平时经常使用的基本命令。但如果你想蹂躏`nmap`的话,比如像人一样看起来像l33t。在任何`nmap`命令后添加`-oS`(比如`nmap -oS - google.com`)。现在你的`nmap`已经处于标准叫法是“[脚本玩具模式][1]”的模式了。Angelina Jolie和Keanu Reeves会为此骄傲的。 ![](http://images.techhive.com/images/article/2015/05/slide_07-100587359-orig.png) ### 获得所有的Discordian日期 ### -如果你们曾经坐在一起思考,“嗨!我想使用无用但异想天开的方式来书写今天的日期……”试试运行`ddate`。结果类似于“Today is Setting Orange, the 72nd day of Discord in the YOLD 3181”,这会让你的服务树日志平添不少香料。 +如果你们曾经坐在一起思考,“嗨!我想使用无用但异想天开的方式来书写今天的日期……”试试运行`ddate`。结果类似于“Today is Setting Orange, the 72nd day of Discord in the YOLD 3181”,这会让你的服务树日志平添不少趣味。 注意:在技术层面,确实有一个[Discordian Calendar][2],理论上被[Discordianism][3]追随者所使用。这意味着我可能得罪某些人。或者不会,我不确定。不管怎样,`ddate`是一个方便的工具。 @@ -76,7 +76,7 @@ ### 将任何文本逆序输出 ### -将任何文本使用管道输送给`rev`命令,它就会将文本内容逆序输出。`fortune | rev`会给你好运。当然,这不意味着rev会将幸运转换成不幸。 +将任何文本使用管道输送给`rev`命令,它就会将文本内容逆序输出。`fortune | rev`会给你好运。当然,这不意味着rev会将幸运(fortune)转换成不幸。 ![](http://images.techhive.com/images/article/2015/05/slide_11-100587364-orig.png) @@ -94,7 +94,7 @@ via: http://www.networkworld.com/article/2926630/linux/11-pointless-but-awesome- 作者:[Bryan Lunduke][a] 译者:[goreliu](https://github.com/goreliu) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 14c4407568049f0b5754e8cf18c4e163dd243580 Mon Sep 17 00:00:00 2001 From: GOLinux Date: Tue, 23 Jun 2015 09:37:35 +0800 Subject: [PATCH 449/965] [Translated]20150617 The Art of Command Line.md --- .../tech/20150617 The Art of Command Line.md | 436 ------------------ .../tech/20150617 The Art of Command Line.md | 431 +++++++++++++++++ 2 files changed, 431 insertions(+), 436 deletions(-) delete mode 100644 sources/tech/20150617 The Art of Command Line.md create mode 100644 translated/tech/20150617 The Art of Command Line.md diff --git a/sources/tech/20150617 The Art of Command Line.md b/sources/tech/20150617 The Art of Command Line.md deleted file mode 100644 index d951d1d45f..0000000000 --- a/sources/tech/20150617 The Art of Command Line.md +++ /dev/null @@ -1,436 +0,0 @@ -Translating by GOLinux! -The Art of Command Line -================================================================================ -- [Basics](#basics) -- [Everyday use](#everyday-use) -- [Processing files and data](#processing-files-and-data) -- [System debugging](#system-debugging) -- [One-liners](#one-liners) -- [Obscure but useful](#obscure-but-useful) -- [More resources](#more-resources) -- [Disclaimer](#disclaimer) - - -![curl -s 'https://raw.githubusercontent.com/jlevy/the-art-of-command-line/master/README.md' | egrep -o '`\w+`' | tr -d '`' | cowsay -W50](https://github.com/jlevy/the-art-of-command-line/blob/master/cowsay.png) - -Fluency on the command line is a skill often neglected or considered arcane, but it improves your flexibility and productivity as an engineer in both obvious and subtle ways. This is a selection of notes and tips on using the command-line that I've found useful when working on Linux. Some tips are elementary, and some are fairly specific, sophisticated, or obscure. This page is not long, but if you can use and recall all the items here, you know a lot. - -Much of this -[originally](http://www.quora.com/What-are-some-lesser-known-but-useful-Unix-commands) -[appeared](http://www.quora.com/What-are-the-most-useful-Swiss-army-knife-one-liners-on-Unix) -on [Quora](http://www.quora.com/What-are-some-time-saving-tips-that-every-Linux-user-should-know), -but given the interest there, it seems it's worth using Github, where people more talented than I can readily suggest improvements. If you see an error or something that could be better, please submit an issue or PR! - -Scope: - -- The goals are breadth and brevity. Every tip is essential in some situation or significantly saves time over alternatives. -- This is written for Linux. Many but not all items apply equally to MacOS (or even Cygwin). -- The focus is on interactive Bash, though many tips apply to other shells and to general Bash scripting. -- Descriptions are intentionally minimal, with the expectation you'll use `man`, `apt-get`/`yum`/`dnf` to install, and Google for more background. - - -## Basics - -- Learn basic Bash. Actually, type `man bash` and at least skim the whole thing; it's pretty easy to follow and not that long. Alternate shells can be nice, but Bash is powerful and always available (learning *only* zsh, fish, etc., while tempting on your own laptop, restricts you in many situations, such as using existing servers). - -- Learn at least one text-based editor well. Ideally Vim (`vi`), as there's really no competition for random editing in a terminal (even if you use Emacs, a big IDE, or a modern hipster editor most of the time). - -- Learn about redirection of output and input using `>` and `<` and pipes using `|`. Learn about stdout and stderr. - -- Learn about file glob expansion with `*` (and perhaps `?` and `{`...`}`) and quoting and the difference between double `"` and single `'` quotes. (See more on variable expansion below.) - -- Be familiar with Bash job management: `&`, **ctrl-z**, **ctrl-c**, `jobs`, `fg`, `bg`, `kill`, etc. - -- Know `ssh`, and the basics of passwordless authentication, via `ssh-agent`, `ssh-add`, etc. - -- Basic file management: `ls` and `ls -l` (in particular, learn what every column in `ls -l` means), `less`, `head`, `tail` and `tail -f` (or even better, `less +F`), `ln` and `ln -s` (learn the differences and advantages of hard versus soft links), `chown`, `chmod`, `du` (for a quick summary of disk usage: `du -sk *`), `df`, `mount`. - -- Basic network management: `ip` or `ifconfig`, `dig`. - -- Know regular expressions well, and the various flags to `grep`/`egrep`. The `-i`, `-o`, `-A`, and `-B` options are worth knowing. - -- Learn to use `apt-get`, `yum`, or `dnf` (depending on distro) to find and install packages. And make sure you have `pip` to install Python-based command-line tools (a few below are easiest to install via `pip`). - - -## Everyday use - -- In Bash, use **ctrl-r** to search through command history. - -- In Bash, use **ctrl-w** to delete the last word, and **ctrl-u** to delete the whole line. Use **alt-b** and **alt-f** to move by word, and **ctrl-k** to kill to the end of the line. See `man readline` for all the default keybindings in Bash. There are a lot. For example **alt-.** cycles through previous arguments, and **alt-*** expands a glob. - -- To go back to the previous working directory: `cd -` - -- If you are halfway through typing a command but change your mind, hit **alt-#** to add a `#` at the beginning and enter it as a comment (or use **ctrl-a**, **#**, **enter**). You can then return to it later via command history. - -- Use `xargs` (or `parallel`). It's very powerful. Note you can control how many items execute per line (`-L`) as well as parallelism (`-P`). If you're not sure if it'll do the right thing, use `xargs echo` first. Also, `-I{}` is handy. Examples: -```bash - find . -name '*.py' | xargs grep some_function - cat hosts | xargs -I{} ssh root@{} hostname -``` - -- `pstree -p` is a helpful display of the process tree. - -- Use `pgrep` and `pkill` to find or signal processes by name (`-f` is helpful). - -- Know the various signals you can send processes. For example, to suspend a process, use `kill -STOP [pid]`. For the full list, see `man 7 signal` - -- Use `nohup` or `disown` if you want a background process to keep running forever. - -- Check what processes are listening via `netstat -lntp`. - -- See also `lsof` for open sockets and files. - -- In Bash scripts, use `set -x` for debugging output. Use strict modes whenever possible. Use `set -e` to abort on errors. Use `set -o pipefail` as well, to be strict about errors (though this topic is a bit subtle). For more involved scripts, also use `trap`. - -- In Bash scripts, subshells (written with parentheses) are convenient ways to group commands. A common example is to temporarily move to a different working directory, e.g. -```bash - # do something in current dir - (cd /some/other/dir; other-command) - # continue in original dir -``` - -- In Bash, note there are lots of kinds of variable expansion. Checking a variable exists: `${name:?error message}`. For example, if a Bash script requires a single argument, just write `input_file=${1:?usage: $0 input_file}`. Arithmetic expansion: `i=$(( (i + 1) % 5 ))`. Sequences: `{1..10}`. Trimming of strings: `${var%suffix}` and `${var#prefix}`. For example if `var=foo.pdf`, then `echo ${var%.pdf}.txt` prints `foo.txt`. - -- The output of a command can be treated like a file via `<(some command)`. For example, compare local `/etc/hosts` with a remote one: -```sh - diff /etc/hosts <(ssh somehost cat /etc/hosts) -``` - -- Know about "here documents" in Bash, as in `cat <logfile 2>&1`. Often, to ensure a command does not leave an open file handle to standard input, tying it to the terminal you are in, it is also good practice to add ` foo: - rename 's/\.bak$//' *.bak - # Full rename of filenames, directories, and contents foo -> bar: - repren --full --preserve-case --from foo --to bar . -``` - -- Use `shuf` to shuffle or select random lines from a file. - -- Know `sort`'s options. Know how keys work (`-t` and `-k`). In particular, watch out that you need to write `-k1,1` to sort by only the first field; `-k1` means sort according to the whole line. - -- Stable sort (`sort -s`) can be useful. For example, to sort first by field 2, then secondarily by field 1, you can use `sort -k1,1 | sort -s -k2,2` - -- If you ever need to write a tab literal in a command line in Bash (e.g. for the -t argument to sort), press **ctrl-v** **[Tab]** or write `$'\t'` (the latter is better as you can copy/paste it). - -- For binary files, use `hd` for simple hex dumps and `bvi` for binary editing. - -- Also for binary files, `strings` (plus `grep`, etc.) lets you find bits of text. - -- To convert text encodings, try `iconv`. Or `uconv` for more advanced use; it supports some advanced Unicode things. For example, this command lowercases and removes all accents (by expanding and dropping them): -```sh - uconv -f utf-8 -t utf-8 -x '::Any-Lower; ::Any-NFD; [:Nonspacing Mark:] >; ::Any-NFC; ' < input.txt > output.txt -``` - -- To split files into pieces, see `split` (to split by size) and `csplit` (to split by a pattern). - -- Use `zless`, `zmore`, `zcat`, and `zgrep` to operate on compressed files. - - -## System debugging - -- For web debugging, `curl` and `curl -I` are handy, or their `wget` equivalents, or the more modern [`httpie`](https://github.com/jakubroztocil/httpie). - -- To know disk/cpu/network status, use `iostat`, `netstat`, `top` (or the better `htop`), and (especially) `dstat`. Good for getting a quick idea of what's happening on a system. - -- For a more in-depth system overview, use [`glances`](https://github.com/nicolargo/glances). It presents you with several system level statistics in one terminal window. Very helpful for quickly checking on various subsystems. - -- To know memory status, run and understand the output of `free` and `vmstat`. In particular, be aware the "cached" value is memory held by the Linux kernel as file cache, so effectively counts toward the "free" value. - -- Java system debugging is a different kettle of fish, but a simple trick on Oracle's and some other JVMs is that you can run `kill -3 ` and a full stack trace and heap summary (including generational garbage collection details, which can be highly informative) will be dumped to stderr/logs. - -- Use `mtr` as a better traceroute, to identify network issues. - -- For looking at why a disk is full, `ncdu` saves time over the usual commands like `du -sh *`. - -- To find which socket or process is using bandwidth, try `iftop` or `nethogs`. - -- The `ab` tool (comes with Apache) is helpful for quick-and-dirty checking of web server performance. For more complex load testing, try `siege`. - -- For more serious network debugging, `wireshark`, `tshark`, or `ngrep`. - -- Know about `strace` and `ltrace`. These can be helpful if a program is failing, hanging, or crashing, and you don't know why, or if you want to get a general idea of performance. Note the profiling option (`-c`), and the ability to attach to a running process (`-p`). - -- Know about `ldd` to check shared libraries etc. - -- Know how to connect to a running process with `gdb` and get its stack traces. - -- Use `/proc`. It's amazingly helpful sometimes when debugging live problems. Examples: `/proc/cpuinfo`, `/proc/xxx/cwd`, `/proc/xxx/exe`, `/proc/xxx/fd/`, `/proc/xxx/smaps`. - -- When debugging why something went wrong in the past, `sar` can be very helpful. It shows historic statistics on CPU, memory, network, etc. - -- For deeper systems and performance analyses, look at `stap` ([SystemTap](https://sourceware.org/systemtap/wiki)), [`perf`](http://en.wikipedia.org/wiki/Perf_(Linux)), and [`sysdig`](https://github.com/draios/sysdig). - -- Confirm what Linux distribution you're using (works on most distros): `lsb_release -a` - -- Use `dmesg` whenever something's acting really funny (it could be hardware or driver issues). - - -## One-liners - -A few examples of piecing together commands: - -- It is remarkably helpful sometimes that you can do set intersection, union, and difference of text files via `sort`/`uniq`. Suppose `a` and `b` are text files that are already uniqued. This is fast, and works on files of arbitrary size, up to many gigabytes. (Sort is not limited by memory, though you may need to use the `-T` option if `/tmp` is on a small root partition.) See also the note about `LC_ALL` above. -```sh - cat a b | sort | uniq > c # c is a union b - cat a b | sort | uniq -d > c # c is a intersect b - cat a b b | sort | uniq -u > c # c is set difference a - b -``` - -- Summing all numbers in the third column of a text file (this is probably 3X faster and 3X less code than equivalent Python): -```sh - awk '{ x += $3 } END { print x }' myfile -``` - -- If want to see sizes/dates on a tree of files, this is like a recursive `ls -l` but is easier to read than `ls -lR`: -```sh - find . -type f -ls -``` - -- Use `xargs` or `parallel` whenever you can. Note you can control how many items execute per line (`-L`) as well as parallelism (`-P`). If you're not sure if it'll do the right thing, use xargs echo first. Also, `-I{}` is handy. Examples: -```sh - find . -name '*.py' | xargs grep some_function - cat hosts | xargs -I{} ssh root@{} hostname -``` - -- Say you have a text file, like a web server log, and a certain value that appears on some lines, such as an `acct_id` parameter that is present in the URL. If you want a tally of how many requests for each `acct_id`: -```sh - cat access.log | egrep -o 'acct_id=[0-9]+' | cut -d= -f2 | sort | uniq -c | sort -rn -``` - -- Run this function to get a random tip from this document (parses Markdown and extracts an item): -```sh - function taocl() { - curl -s https://raw.githubusercontent.com/jlevy/the-art-of-command-line/master/README.md | - pandoc -f markdown -t html | - xmlstarlet fo --html --dropdtd | - xmlstarlet sel -t -v "(html/body/ul/li[count(p)>0])[$RANDOM mod last()+1]" | - xmlstarlet unesc | fmt -80 - } -``` - - -## Obscure but useful - -- `expr`: perform arithmetic or boolean operations or evaluate regular expressions - -- `m4`: simple macro processor - -- `screen`: powerful terminal multiplexing and session persistence - -- `yes`: print a string a lot - -- `cal`: nice calendar - -- `env`: run a command (useful in scripts) - -- `look`: find English words (or lines in a file) beginning with a string - -- `cut `and `paste` and `join`: data manipulation - -- `fmt`: format text paragraphs - -- `pr`: format text into pages/columns - -- `fold`: wrap lines of text - -- `column`: format text into columns or tables - -- `expand` and `unexpand`: convert between tabs and spaces - -- `nl`: add line numbers - -- `seq`: print numbers - -- `bc`: calculator - -- `factor`: factor integers - -- `gpg`: encrypt and sign files - -- `toe`: table of terminfo entries - -- `nc`: network debugging and data transfer - -- `ngrep`: grep for the network layer - -- `dd`: moving data between files or devices - -- `file`: identify type of a file - -- `stat`: file info - -- `tac`: print files in reverse - -- `shuf`: random selection of lines from a file - -- `comm`: compare sorted files line by line - -- `hd` and `bvi`: dump or edit binary files - -- `strings`: extract text from binary files - -- `tr`: character translation or manipulation - -- `iconv `or uconv: conversion for text encodings - -- `split `and `csplit`: splitting files - -- `7z`: high-ratio file compression - -- `ldd`: dynamic library info - -- `nm`: symbols from object files - -- `ab`: benchmarking web servers - -- `strace`: system call debugging - -- `mtr`: better traceroute for network debugging - -- `cssh`: visual concurrent shell - -- `wireshark` and `tshark`: packet capture and network debugging - -- `host` and `dig`: DNS lookups - -- `lsof`: process file descriptor and socket info - -- `dstat`: useful system stats - -- [`glances`](https://github.com/nicolargo/glances): high level, multi-subsystem overview - -- `iostat`: CPU and disk usage stats - -- `htop`: improved version of top - -- `last`: login history - -- `w`: who's logged on - -- `id`: user/group identity info - -- `sar`: historic system stats - -- `iftop` or `nethogs`: network utilization by socket or process - -- `ss`: socket statistics - -- `dmesg`: boot and system error messages - -- `hdparm`: SATA/ATA disk manipulation/performance - -- `lsb_release`: Linux distribution info - -- `lshw`: hardware information - -- `fortune`, `ddate`, and `sl`: um, well, it depends on whether you consider steam locomotives and Zippy quotations "useful" - - -## More resources - -- [awesome-shell](https://github.com/alebcay/awesome-shell): A curated list of shell tools and resources. -- [Strict mode](http://redsymbol.net/articles/unofficial-bash-strict-mode/) for writing better shell scripts. - - -## Disclaimer - -With the exception of very small tasks, code is written so others can read it. With power comes responsibility. The fact you *can* do something in Bash doesn't necessarily mean you should! ;) - --------------------------------------------------------------------------------- - -via: https://github.com/jlevy/the-art-of-command-line - -作者:[jlevy][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://github.com/jlevy -[1]: -[2]: -[3]: -[4]: -[5]: -[6]: -[7]: -[8]: -[9]: -[10]: -[11]: -[12]: -[13]: -[14]: -[15]: -[16]: -[17]: -[18]: -[19]: -[20]: diff --git a/translated/tech/20150617 The Art of Command Line.md b/translated/tech/20150617 The Art of Command Line.md new file mode 100644 index 0000000000..87e8e7458e --- /dev/null +++ b/translated/tech/20150617 The Art of Command Line.md @@ -0,0 +1,431 @@ +命令行艺术 +================================================================================ +- [基础](#basics) +- [日常使用](#everyday-use) +- [处理文件和数据](#processing-files-and-data) +- [系统调试](#system-debugging) +- [单行程序](#one-liners) +- [晦涩难懂,但却有用](#obscure-but-useful) +- [更多资源](#more-resources) +- [免责声明](#disclaimer) + + +![curl -s 'https://raw.githubusercontent.com/jlevy/the-art-of-command-line/master/README.md' | egrep -o '`\w+`' | tr -d '`' | cowsay -W50](https://github.com/jlevy/the-art-of-command-line/blob/master/cowsay.png) + +流畅地使用命令行是一个常被忽略的技能,或被认为是神秘的奥义。但是,它会以明显而微妙的方式改善你作为工程师的灵活度和生产力。这是我在Linux上工作时发现的有用的命令行使用小窍门和笔记的精粹。有些小窍门是很基础的,而有些是相当地特别、相当地复杂、或者相当地晦涩难懂。这一页不长,但是如果你可以使用并记得这里的所有项目,那么你知道不少了。 + +其中大部分[最初](http://www.quora.com/What-are-some-lesser-known-but-useful-Unix-commands)[出现](http://www.quora.com/What-are-the-most-useful-Swiss-army-knife-one-liners-on-Unix)在[Quora](http://www.quora.com/What-are-some-time-saving-tips-that-every-Linux-user-should-know)上,但是考虑到利益,似乎更值得使用Github,这上面的人比我更能提出改进建议。如果你看到一个错误,或者更好的某种东西,请提交问题或PR! + +范围: + +- 目标宽广而简洁。每个小窍门在某种情形下都很基础,或者比替代品大大节省时间。 +- 这是为Linux写的。大多数,但并非全部项目可以同样应用到MacOS(或者甚至Cygwin)。 +- 焦点集中在交互的Bash上,尽管大多数小窍门也可以应用到其它shell,以及常规Bash脚本。 +- 意在作最少说明,要想期待更多,你可以使用`man`、使用`apt-get`/`yum`/`dnf`来安装,还可以使用Google来获得更多背景知识。 + + +## 基础 + +- 学习基本Bash技能。实际上,键入`man bash`,然后至少浏览一遍所有东西;它很容易理解,没那么长。其它shell会很好,但是Bash很强大,而且总是可用(*只*学习zsh、fish之类,而在你自己的笔记本上测试时,会在很多情形下受到限制,比如使用现存的服务器)。 + +- 至少学好一种基于文本的编辑器。理想的一个是Vim(`vi`),因为在终端中用于随机编辑时它没有竞争者(即使大多数时候你使用Emacs,一个大型的IDE,或一个现代的时髦编辑器)。 + +- 学习使用`>`和`<`来进行输出和输入重定向,以及使用`|`来管道重定向,学习关于stdout和stderr的东西。 + +- 学习`*`(也许还有`?`和`{`...`}`)文件通配扩展和应用,以及双引号`"`和单引号`'`之间的区别。(更多内容请参看下面关于变量扩展部分)。 + +- 熟悉Bash作业管理:`&`, **ctrl-z**, **ctrl-c**, `jobs`, `fg`, `bg`, `kill`等等。 + +- 掌握`ssh`,以及通过`ssh-agent`,`ssh-add`等进行无密码验证的基础技能。 + +- 基本的文件管理:`ls`和`ls -l`(特别是,知道`ls -l`各个栏目的意义),`less`, `head`, `tail` 和`tail -f`(或者更好的`less +F`),`ln`和`ln -s`(知道硬链接和软链接的区别,以及硬链接相对于软链接的优势),`chown`,`chmod`,`du`(用于查看磁盘使用率的快速摘要:`du -sk *`),`df`, `mount`。 + +- 基本的网络管理: `ip`或`ifconfig`,`dig`。 + +- 熟知正则表达式,以及各种标识来使用`grep`/`egrep`。`-i`,`-o`,`-A`和`-B`选项值得掌握。 + +- 学会使用`apt-get`,`yum`或`dnf`(这取决于你的发行版)来查找并安装软件包。确保你可以用`pip`来安装基于Python的命令行工具(下面的一些东西可以很容易地通过`pip`安装)。 + + +## 日常使用 + +- 在Bash中,使用**ctrl-r**来搜索命令历史。 + +- 在Bash中,使用 **ctrl-w** 来删除最后的单词,使用 **ctrl-u** 来删除整行。使用 **alt-b** 和 **alt-f** 来逐词移动,以及使用**ctrl-k**来杀死到行尾。请使用 `man readline` 来查看Bash中所有默认的键绑定,有很多。例如,**alt-.** 可以循环显示先前的参数,而**alt-** 扩展通配。 + +- 返回先前的工作目录: `cd -` + +- 如果你命令输入到一半,但是改变主意了,可以敲 **alt-#** 来添加一个 `#` 到开头,然后将该命令作为注释输入(或者使用 **ctrl-a**, **#**,**enter**)。然后,你可以在后面通过命令历史来返回到该命令。 + +- 使用`xargs`(或`parallel`),它很强大。注意,你可以控制每行(`-L`)执行多少个项目,而言可以使用平行结构(`-P`)。如果你不确定它是否会做正确的事情,可以首先使用`xargs echo`。同时,使用`-I{}`也很方便。样例: +```bash + find . -name '*.py' | xargs grep some_function + cat hosts | xargs -I{} ssh root@{} hostname +``` + +- `pstree -p`对于现实进程树很有帮助。 + +- 使用`pgrep`和`pkill`来按名称查找或用信号通知进程(`-f`很有帮助)。 + +- 掌握各种可以发送给进程的信号。例如,要挂起进程,可以使用`kill -STOP [pid]`。完整的列表可以查阅see `man 7 signal`。 + +- 如果你想要一个后台进程一直保持运行,使用`nohup`或`disown`。 + +- 通过`netstat -lntp`检查什么进程在监听。 + +- `lsof`来查看打开的套接口和文件。 + +- 在Bash脚本中,使用`set -x`调试脚本输出。每当可能时,使用严格模式。使用`set -e`在遇到错误时退出。也可以使用`set -o pipefail`,对错误严格(虽然该话题有点敏感)。对于更复杂的脚本,也可以使用`trap`。 + +- 在Bash脚本中,子shell(写在括号中的)是集合命令的便利的方式。一个常见的例子是临时移动到一个不同的工作目录,如: +```bash + # do something in current dir + (cd /some/other/dir; other-command) + # continue in original dir +``` + +- 注意,在Bash中有大量各种各样的变量扩展。检查一个变量是否存在:`${name:?error message}`。例如,如果一个Bash脚本要求一个单一参数,只需写`input_file=${1:?usage: $0 input_file}`。算术扩展:`i=$(( (i + 1) % 5 ))`。序列:`{1..10}`。修剪字符串:`${var%suffix}`和`${var#prefix}`。例如,if `var=foo.pdf`, then `echo ${var%.pdf}.txt` prints `foo.txt`。 + +- 命令的输出可以通过`<(some command)`作为一个文件来处理。例如,将本地的`/etc/hosts`和远程的比较: +```sh + diff /etc/hosts <(ssh somehost cat /etc/hosts) +``` + +- 知道Bash中的“嵌入文档”,就像在`cat <logfile 2>&1`同时重定向标准输出和标准错误。通常,要确保某个命令不会再标准输入中遗留有打开的文件句柄,将它捆绑到你所在的终端,添加` foo: + rename 's/\.bak$//' *.bak + # Full rename of filenames, directories, and contents foo -> bar: + repren --full --preserve-case --from foo --to bar . +``` + +- 使用`shuf`来从某个文件中随机选择随机的行。 + +- 知道`sort`的选项。知道这些键是怎么工作的(`-t`和`-k`)。特别是,注意你需要写`-k1,1`来只通过第一个字段排序;`-k1`意味着根据整行排序。 + +- 稳定排序(`sort -s`)会很有用。例如,要首先按字段2排序,然后再按字段1排序,你可以使用`sort -k1,1 | sort -s -k2,2` + +- 如果你曾经需要在Bash命令行中写一个标签文字(如,用于-t参数的排序),按**ctrl-v** **[Tab]**,或者写`$'\t'`(后面的更好,因为你可以复制/粘贴)。 + +- 对于二进制文件,使用`hd`进行简单十六进制转储,以及`bvi`用于二进制编辑。 + +- 还是用于二进制文件,`strings`(加上`grep`等)可以让你找出文本的二进制数。 + +- 要转换文本编码,试试`iconv`吧,或者对于更高级的使用`uconv`;它支持一些高级的统一字符标准的东西。例如,这个命令可以将所有重音符号转成小写并(通过扩展和丢弃)移除: +```sh + uconv -f utf-8 -t utf-8 -x '::Any-Lower; ::Any-NFD; [:Nonspacing Mark:] >; ::Any-NFC; ' < input.txt > output.txt +``` + +- 要将文件分割成各个部分,来看看`split`(按大小分割)和`csplit`(按格式分割)吧。 + +- 使用`zless`,`zmore`,`zcat`和`zgrep`来操作压缩文件。 + + +## 系统调试 + +- 对于网络调试,`curl`和`curl -I`很方便灵活,或者业可以使用它们的同行`wget`,或者更现代的[`httpie`](https://github.com/jakubroztocil/httpie)。 + +- 要知道disk/cpu/network的状态,使用`iostat`,`netstat`,`top`(或更好的`htop`)和(特别是)`dstat`。它们对于快速获知系统中发生的状况很好用。 + +- 对于更深层次的系统总览,可以使用[`glances`](https://github.com/nicolargo/glances)。它会在一个终端窗口中为你呈现几个系统层次的统计数据,对于快速检查各个子系统很有帮助。 + +- 要知道内存状态,可以运行`free`和`vmstat`,看懂它们的输出结果吧。特别是,要知道“cached”值是Linux内核作为文件缓存所占有的内存,因此,要有效地统计“free”值。 + +- 系统调试是一件截然不同的事,但是对于Oracle系统以及其它一些JVM而言,不过是一个简单的小把戏,你可以运行`kill -3 `,然后一个完整的堆栈追踪和累积的摘要(包括分代垃圾收集细节,这里头信息量很大)将被转储到stderr/logs.Java。 + +- 使用`mtr`作为更好的路由追踪,来识别网络问题。 + +- 对于查看磁盘满载的原因,`ncdu`会比常规命令如`du -sh *`更节省时间。 + +- 要查找占用带宽的套接口和进程,试试`iftop`或`nethogs`吧。 + +- (Apache附带的)`ab`工具对于临时应急检查网络服务器性能很有帮助。对于更复杂的负载测试,可以试试`siege`。 + +- 对于更重型的网络调试,可以用`wireshark`,`tshark`或`ngrep`。 + +- 掌握`strace`和`ltrace`。如果某个程序失败、挂起或崩溃,而你又不知道原因,或者如果你想要获得性能的大概信息,这些工具会很有帮助。注意,分析选项(`-c`)和关联运行进程的能力(`-p`)。 + +- 掌握`ldd`来检查共享库等。 + +- 知道如何使用`gdb`来连接到一个运行着的进程并获取其堆栈追踪信息。 + +- 使用`/proc`。当调试当前注目问题时,它有时候出奇地有帮助。样例:`/proc/cpuinfo`,`/proc/xxx/cwd`,`/proc/xxx/exe`,`/proc/xxx/fd/`,`/proc/xxx/smaps`。 + +- 当调试过去某个东西出错时,`sar`会非常有帮助。它显示了CPU、内存、网络等的历史统计数据。 + +- 对于更深层的系统和性能分析,看看`stap` ([SystemTap](https://sourceware.org/systemtap/wiki)),[`perf`](http://en.wikipedia.org/wiki/Perf_(Linux))和[`sysdig`](https://github.com/draios/sysdig)吧。 + +- 确认是正在使用的Linux发行版版本(大多数发行版可用):`lsb_release -a`。 + +- 每当某个东西的行为异常时(可能是硬件或者驱动器问题),使用`dmesg`。 + + +## 单行程序 + +将命令拼凑在一起的一些样例: + +- 有时候通过`sort`/`uniq`来进行交互设置、合并,以及比较文本文件的差异时,这个例子会相当有帮助。假定`a`和`b`是已经进行唯一性处理的文本文件。这会很快,而且可以处理任意大小的文件,总计可达数千兆字节。(Sort不受内存限制,然后你可能需要使用`-T`选项来检查`/tmp`是否挂载一个容量小的root分区上。)也可参见上面关于`LC_ALL`的注解。 +```sh + cat a b | sort | uniq > c # c is a union b + cat a b | sort | uniq -d > c # c is a intersect b + cat a b b | sort | uniq -u > c # c is set difference a - b +``` + +- 对某个文本文件的第三列中所有数据进行求和(该例子可能比同等功能的Python要快3倍,而且代码也少于其3倍): +```sh + awk '{ x += $3 } END { print x }' myfile +``` + +- 如果想要查看某个文件树的大小/日期,该例子就像一个递归`ls -l`,但是比`ls -lR`要更容易读懂: +```sh + find . -type f -ls +``` + +- 只要可以,请使用Use `xargs`或`parallel`。注意,你可以控制每行(`-L`)执行多少个项目,也可同时控制并行计算(`-P`)。如果你不确定它是否会做正确的事,可以在前面加上xargs echo。同时,`-I{}`很灵便。样例: +```sh + find . -name '*.py' | xargs grep some_function + cat hosts | xargs -I{} ssh root@{} hostname +``` + +- 比如说,你有一个文本文件,像网络服务器的日志,在某些行中出现了某个特定的值,如URL中出现的`acct_id`参数。如果你想要一个针对每个`acct_id`的请求的计数器: +```sh + cat access.log | egrep -o 'acct_id=[0-9]+' | cut -d= -f2 | sort | uniq -c | sort -rn +``` + +- 运行该函数来获得来自文档的随机提示(解析Markdown并从中提取某个项目): +```sh + function taocl() { + curl -s https://raw.githubusercontent.com/jlevy/the-art-of-command-line/master/README.md | + pandoc -f markdown -t html | + xmlstarlet fo --html --dropdtd | + xmlstarlet sel -t -v "(html/body/ul/li[count(p)>0])[$RANDOM mod last()+1]" | + xmlstarlet unesc | fmt -80 + } +``` + + +## 晦涩难懂,但却有用 + +- `expr`:实施算术或布林操作,或者求正则表达式的值 + +- `m4`:简单宏处理器 + +- `screen`:强大的终端多路复用和会话保持 + +- `yes`:大量打印一个字符串 + +- `cal`:漂亮的日历 + +- `env`:运行一个命令(脚本中很有用) + +- `look`:查找以某个字符串开头的英文单词(或文件中的行) + +- `cut `和`paste`以及`join`:数据处理 + +- `fmt`:格式化文本段落 + +- `pr`:格式化文本为页/栏 + +- `fold`:包裹文本行 + +- `column`:格式化文本为栏或表 + +- `expand`和`unexpand`:在制表和空格间转换 + +- `nl`:添加行号 + +- `seq`:打印数字 + +- `bc`:计算器 + +- `factor`:把整数因子分解 + +- `gpg`:加密并为文件签名 + +- `toe`:terminfo条目表 + +- `nc`:网络调试和数据传输 + +- `ngrep`:查找网络层 + +- `dd`:在文件或设备间移动数据 + +- `file`:识别文件类型 + +- `stat`:文件信息 + +- `tac`:逆序打印文件 + +- `shuf`:从文件中随机选择行 + +- `comm`:逐行对比分类排序的文件 + +- `hd`和`bvi`:转储或编辑二进制文件 + +- `strings`:从二进制文件提取文本 + +- `tr`:字符转译或处理 + +- `iconv `或`uconv`:文本编码转换 + +- `split `和`csplit`:分割文件 + +- `7z`:高比率文件压缩 + +- `ldd`:动态库信息 + +- `nm`:目标文件的符号 + +- `ab`:网络服务器基准测试 + +- `strace`:系统调用调试 + +- `mtr`:用于网络调试的更好的路由追踪 + +- `cssh`:可视化并发shell + +- `wireshark`和`tshark`:抓包和网络调试 + +- `host`和`dig`:DNS查询 + +- `lsof`:处理文件描述符和套接字信息 + +- `dstat`:有用的系统统计数据 + +- [`glances`](https://github.com/nicolargo/glances):高级,多子系统概览 + +- `iostat`:CPU和磁盘使用率统计 + +- `htop`:top的改进版 + +- `last`:登录历史 + +- `w`:谁登录进来了 + +- `id`:用户/组身份信息 + +- `sar`:历史系统统计数据 + +- `iftop`或`nethogs`:按套接口或进程的网络使用率 + +- `ss`:套接口统计数据 + +- `dmesg`:启动和系统错误信息 + +- `hdparm`:SATA/ATA磁盘操作/性能 + +- `lsb_release`:Linux发行版信息 + +- `lshw`:硬件信息 + +- `fortune`,`ddate`和`sl`:嗯,好吧,它取决于你是否认为蒸汽机车和齐皮士引用“有用” + + +## 更多资源 + +- [超棒的shell](https://github.com/alebcay/awesome-shell): 一个shell工具和资源一览表。 +- [严格模式](http://redsymbol.net/articles/unofficial-bash-strict-mode/) 用于写出更佳的shell脚本。 + + +## 免责声明 + +除了非常小的任务外,其它都写出了代码供大家阅读。伴随力量而来的是责任。事实是,你*能*在Bash中做的,并不意味着是你所应该做的!;) + +-------------------------------------------------------------------------------- + +via: https://github.com/jlevy/the-art-of-command-line + +作者:[jlevy][a] +译者:[GOLinux](https://github.com/GOLinux) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://github.com/jlevy +[1]: +[2]: +[3]: +[4]: +[5]: +[6]: +[7]: +[8]: +[9]: +[10]: +[11]: +[12]: +[13]: +[14]: +[15]: +[16]: +[17]: +[18]: +[19]: +[20]: From 4c51e02ca161d41c93bbc9beefb2d8ccaef60c75 Mon Sep 17 00:00:00 2001 From: yajun Date: Tue, 23 Jun 2015 11:00:37 +0800 Subject: [PATCH 450/965] update --- .../talk/20141211 Open source all over the world.md | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/translated/talk/20141211 Open source all over the world.md b/translated/talk/20141211 Open source all over the world.md index b39820bebc..c897765d75 100644 --- a/translated/talk/20141211 Open source all over the world.md +++ b/translated/talk/20141211 Open source all over the world.md @@ -1,4 +1,4 @@ -Open source all over the world +一个开源的世界 ================================================================================ ![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/BUS_OpenSourceExperience_520x292_cm.png) @@ -50,15 +50,13 @@ Open source all over the world 我当时在他左边,时不时从转录空隙中抬头看一眼,然后从眼神中注意到微笑背后暗示的那个自2008年1月起开始领导公司的人,红帽的CEO[Jim Whitehurst][35]。 -“我有世界上最好的工作,”稍稍向后靠、叉腿抱头,Whitehurst开始了演讲。“我开始领导红帽,在世界各地旅行到处看看情况。在这里的七年中,FOSS和广泛的开源创新所发生的美好的事情是开源已经脱离了条条框框。我现在认为,IT正处在FOSS之前所在的位置。我们可以预见FOSS从一个替代走向创新驱动力。” +“我有世界上最好的工作,”稍稍向后靠、叉腿抱头,Whitehurst开始了演讲。“我开始领导红帽,在世界各地旅行到处看看情况。在这里的七年中,FOSS和广泛的开源创新所发生的美好的事情是开源已经脱离了条条框框。我现在认为,IT正处在FOSS之前所在的位置。我们可以预见FOSS从一个替代走向创新驱动力。”用户也看到了这一点。他们用FOSS并不是因为它便宜,而是因为它能提供和创新的解决方案。这也十一个全球现象。比如,我刚才还在印度,然后发现那里的用户拥抱开源的两个理由:一个是创新,另一个是那里的市场有些特殊,需要完全的控制。 -"I have one of the greatest jobs on Earth," began Whitehurst, as he leaned back, crossed his legs, and put his arms behind his head. "I get to lead Red Hat, travel around the world and see what goes on. In my seven years here, the amazing thing about FOSS, and, broadly open innovation, is that it has left the fringe. And now, I would argue, IT is in the same place that FOSS was in its early days. We are seeing FOSS going from an alternative to driving innovation. Our customers are seeing it, too. They're using FOSS not because it is cheaper, but because it provides them with control and innovative solutions. It's a global phenomenon, too. For instance, I was just in India, and discovered that, for them, there were two reasons for embracing of open source: one, access to innovation, and two, the market is somewhat different and wanting full control.” +“[孟买证券交易所][36]想得到源代码并加以控制,五年前这在证券交易领域闻所未闻。那时FOSS正在重复发明轮子。今天看来,FOSS正在做几乎所有的结合了大数据的事物。几乎所有的新框架,语言和方法论,包括流动(尽管不包括设备),都首先发生在开源世界。” -"The [Bombay Stock Exchange][36] wants to own all the source and control it. That is not something you would have heard five years ago in a stock exchange, anywhere. Back then, the early knock on FOSS was that it was creating free copies of things that already existed.' If you look today, virtually everything in big data is happening in FOSS. Almost any new framework, language, and methodology, including mobile (though excluding devices), are all happening first in open source.” +“这是因为用户数量已经达到了相当的规模。这不只是红帽遇到的情况,[Google][37],[Amazon][38],[Facebook][39]等也出现这样的情况。他们想解决自己的问题,用开源的方式。忘掉协议吧,开源绝不仅如此。我们建立了一个交通工具,一套规则,例如[Hadoop][40],[Cassandra][41]和其他工具。事实上,开源驱动创新。例如,Hadoop在厂商们意识的规模带来的问题。他们实际上有足够的资和资源金来解决自己的问题。”开源是许多领域的默认技术方案。这在一个更加注重内容的世界中更是如此,例如[3D打印][42]和其他使用信息内容的物理产品。” -"This is because users have reached size and scale. It's not just Red Hat—it's [Google][37], [Amazon][38], [Facebook][39], and others, they want to solve their own problems, and do it the open source way. And forget licensing—open source is much more than that. We've built a vehicle, and a set of norms. Things like [Hadoop][40], [Cassandra][41], and other tools. Fact is, open source drives innovation. For example, Hadoop was in production before any vendor realized there was a problem of that scale that needed to be solved. They actually have the wherewithal to solve their own problems, and the social tech and principles to do that. "Open source is now the default technology for many categories. This is especially true as the world moves more and more to content importance, such as [3D printing][42] and other physical products that take information content and apply it.” - -"We have this cool thing in one area, source code, but it is limited. But there are still many opportunities in different industries. We must ask ourselves, 'What can open source do for education, government, and legal? What are the parallels? And what can other areas learn with us?'" +“源代码的开源确实很酷,但开源不应当仅限于此。在各行各业不同领域开源仍有可以用武之地。我们要问下自己:‘开源能够为教育,政府,法律带来什么?其它的呢?其它的领域如何能学习我们?’” "There's also the matter of content. Content is now free, and we can invest in more free content, sure. But we need free content that has a business model built around it. That is something that more people should care about. If you believe open innovation is better, then we need more models." From 0486c3330157b430d02c5af74a7614b74a4eec70 Mon Sep 17 00:00:00 2001 From: DeadFire Date: Tue, 23 Jun 2015 16:21:18 +0800 Subject: [PATCH 451/965] =?UTF-8?q?20150623-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... Kernel 4.1 Released This Is What's New.md | 62 +++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 sources/news/20150623 Linux Kernel 4.1 Released This Is What's New.md diff --git a/sources/news/20150623 Linux Kernel 4.1 Released This Is What's New.md b/sources/news/20150623 Linux Kernel 4.1 Released This Is What's New.md new file mode 100644 index 0000000000..41058f3210 --- /dev/null +++ b/sources/news/20150623 Linux Kernel 4.1 Released This Is What's New.md @@ -0,0 +1,62 @@ +Linux Kernel 4.1 Released, This Is What’s New +================================================================================ +**TuxlogoA brand new version of the Linux Kernel — the heartbeat of the modern world (if we you want us to be poetic about it) — has been released.** + +![](http://www.omgubuntu.co.uk/wp-content/uploads/2011/07/Tux-psd3894.jpg) + +The arrival [has been announced][1] by Linus Torvalds (who else?) on the Linux Kernel Mailing List (where else?) and comes almost two months after the [first entry in the new 4.x series][2]. + +Levity aside, and like every release before it, Linux Kernel 4.1 features a big set of changes. These touch everything from hardware compatibility to power management to file-system performance and technical fixes for obscure processors you’ve never heard of. + +Linux 4.1 is already being tracked in Ubuntu 15.10, due for release in October. + +### What’s New In Linux 4.1? ### + +![Tux got mail](http://www.omgubuntu.co.uk/wp-content/uploads/2015/06/linux-kernel-4-11-350x200.jpg) +Tux got mail + +The sub-heading is on your lips and we’re not here simply to serve up an announcement of an announcement. + +We’ve gone through the (vast, long, lengthy and at times technically unintelligible) change-log to pick out some highlights that may not feed hyperbole but may impact on you, a desktop users. + +#### Power Improvements #### + +The big headline user-facing feature you’ll find in Linux 4.1 are the wealth of performance and power efficiency improvements committed for Intel’s Cherry Trail and Bay Trail chips. SoCs and devices, such as the Intel Compute Stick. + +Anecdotal suggestions are that Linux Kernel 4.1 gives select combinations of newer Intel hardware as much as an extra hour of battery life. Such high gains are not likely to apply to anything but a very specific sub-set of chips and systems (and high-end ones at that) but it’s still exciting to hear of. + +**Highlights of Linux 4.1 include:** + +- EXT4 gains file-system level encryption (thanks to Google) +- Logitech lg4ff driver improves ‘force feedback’ for gaming wheels +- Toshiba laptop driver gains USB sleep charging and backlight improvements +- Rumble support for Xbox One controller +- Better battery reporting in Wacom tablet driver +- Various misc. power improvements for both ARM and x86 devices +- Samsung Exynos 3250 power management improvements +- Support for the Bamboo Pad +- Lenovo OneLink Pro Dock gains USB support +- Support for Realtek 8723A, 8723B, 8761A, 8821 Wi-Fi cards + +### Install Linux Kernel 4.1 on Ubuntu ### + +Although this release of the kernel is classed as stable there is no pressing need for Ubuntu desktop users to go out of their way to install it. + +Not that you can’t; if you’re impatient and skilled enough to do so you can take a crack at installing Linux 4.1 on Ubuntu by grabbing the appropriate set of packages from [Canonical’s mainline kernel archive][3] (or by risking a third-party PPA). + +Ubuntu 15.10 Wily Werewolf, due for release in October, is to be based on the Ubuntu Kernel 4.1.x (the Ubuntu kernel is the Linux Kernel plus Ubuntu-specific patches that have not been accepted upstream). + +-------------------------------------------------------------------------------- + +via: http://www.omgubuntu.co.uk/2015/06/linux-4-1-kernel-new-features + +作者:[Joey-Elijah Sneddon][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://plus.google.com/117485690627814051450/?rel=author +[1]:https://lkml.org/lkml/2015/6/22/8 +[2]:http://www.omgubuntu.co.uk/2015/04/linux-kernel-4-0-new-features +[3]:http://kernel.ubuntu.com/~kernel-ppa/mainline/?C=N;O=D \ No newline at end of file From 55ab470b0e38195a48dae9580bd8e641a7efe990 Mon Sep 17 00:00:00 2001 From: DeadFire Date: Tue, 23 Jun 2015 16:34:46 +0800 Subject: [PATCH 452/965] =?UTF-8?q?20150623-2=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ence on RedHat Linux Package Management.md | 348 ++++++++++++++++++ 1 file changed, 348 insertions(+) create mode 100644 sources/tech/20150623 Shilpa Nair Shares Her Interview Experience on RedHat Linux Package Management.md diff --git a/sources/tech/20150623 Shilpa Nair Shares Her Interview Experience on RedHat Linux Package Management.md b/sources/tech/20150623 Shilpa Nair Shares Her Interview Experience on RedHat Linux Package Management.md new file mode 100644 index 0000000000..7915907e6a --- /dev/null +++ b/sources/tech/20150623 Shilpa Nair Shares Her Interview Experience on RedHat Linux Package Management.md @@ -0,0 +1,348 @@ +Shilpa Nair Shares Her Interview Experience on RedHat Linux Package Management +================================================================================ +**Shilpa Nair has just graduated in the year 2015. She went to apply for Trainee position in a National News Television located in Noida, Delhi. When she was in the last year of graduation and searching for help on her assignments she came across Tecmint. Since then she has been visiting Tecmint regularly.** + +![Linux Interview Questions on RPM](http://www.tecmint.com/wp-content/uploads/2015/06/Linux-Interview-Questions-on-RPM.jpeg) + +Linux Interview Questions on RPM + +All the questions and answers are rewritten based upon the memory of Shilpa Nair. + +> “Hi friends! I am Shilpa Nair from Delhi. I have completed my graduation very recently and was hunting for a Trainee role soon after my degree. I have developed a passion for UNIX since my early days in the collage and I was looking for a role that suits me and satisfies my soul. I was asked a lots of questions and most of them were basic questions related to RedHat Package Management.” + +Here are the questions, that I was asked and their corresponding answers. I am posting only those questions that are related to RedHat GNU/Linux Package Management, as they were mainly asked. + +### 1. How will you find if a package is installed or not? Say you have to find if ‘nano’ is installed or not, what will you do? ### + +> **Answer** : To find the package nano, weather installed or not, we can use rpm command with the option -q is for query and -a stands for all the installed packages. +> +> # rpm -qa nano +> OR +> # rpm -qa | grep -i nano +> +> nano-2.3.1-10.el7.x86_64 +> +> Also the package name must be complete, an incomplete package name will return the prompt without printing anything which means that package (incomplete package name) is not installed. It can be understood easily by the example below: +> +> We generally substitute vim command with vi. But if we find package vi/vim we will get no result on the standard output. +> +> # vi +> # vim +> +> However we can clearly see that the package is installed by firing vi/vim command. Here is culprit is incomplete file name. If we are not sure of the exact file-name we can use wildcard as: +> +> # rpm -qa vim* +> +> vim-minimal-7.4.160-1.el7.x86_64 +> +> This way we can find information about any package, if installed or not. + +### 2. How will you install a package XYZ using rpm? ### + +> **Answer** : We can install any package (*.rpm) using rpm command a shown below, here options -i (install), -v (verbose or display additional information) and -h (print hash mark during package installation). +> +> # rpm -ivh peazip-1.11-1.el6.rf.x86_64.rpm +> +> Preparing... ################################# [100%] +> Updating / installing... +> 1:peazip-1.11-1.el6.rf ################################# [100%] +> +> If upgrading a package from earlier version -U switch should be used, option -v and -h follows to make sure we get a verbose output along with hash Mark, that makes it readable. + +### 3. You have installed a package (say httpd) and now you want to see all the files and directories installed and created by the above package. What will you do? ### + +> **Answer** : We can list all the files (Linux treat everything as file including directories) installed by the package httpd using options -l (List all the files) and -q (is for query). +> +> # rpm -ql httpd +> +> /etc/httpd +> /etc/httpd/conf +> /etc/httpd/conf.d +> ... + +### 4. You are supposed to remove a package say postfix. What will you do? ### + +> **Answer** : First we need to know postfix was installed by what package. Find the package name that installed postfix using options -e erase/uninstall a package) and –v (verbose output). +> +> # rpm -qa postfix* +> +> postfix-2.10.1-6.el7.x86_64 +> +> and then remove postfix as: +> +> # rpm -ev postfix-2.10.1-6.el7.x86_64 +> +> Preparing packages... +> postfix-2:3.0.1-2.fc22.x86_64 + +### 5. Get detailed information about an installed package, means information like Version, Release, Install Date, Size, Summary and a brief description. ### + +> **Answer** : We can get detailed information about an installed package by using option -qa with rpm followed by package name. +> +> For example to find details of package openssh, all I need to do is: +> +> # rpm -qi openssh +> +> [root@tecmint tecmint]# rpm -qi openssh +> Name : openssh +> Version : 6.8p1 +> Release : 5.fc22 +> Architecture: x86_64 +> Install Date: Thursday 28 May 2015 12:34:50 PM IST +> Group : Applications/Internet +> Size : 1542057 +> License : BSD +> .... + +### 6. You are not sure about what are the configuration files provided by a specific package say httpd. How will you find list of all the configuration files provided by httpd and their location. ### + +> **Answer** : We need to run option -c followed by package name with rpm command and it will list the name of all the configuration file and their location. +> +> # rpm -qc httpd +> +> /etc/httpd/conf.d/autoindex.conf +> /etc/httpd/conf.d/userdir.conf +> /etc/httpd/conf.d/welcome.conf +> /etc/httpd/conf.modules.d/00-base.conf +> /etc/httpd/conf/httpd.conf +> /etc/sysconfig/httpd +> +> Similarly we can list all the associated document files as: +> +> # rpm -qd httpd +> +> /usr/share/doc/httpd/ABOUT_APACHE +> /usr/share/doc/httpd/CHANGES +> /usr/share/doc/httpd/LICENSE +> ... +> +> also, we can list the associated License file as: +> +> # rpm -qL openssh +> +> /usr/share/licenses/openssh/LICENCE +> +> Not to mention that the option -d and option -L in the above command stands for ‘documents‘ and ‘License‘, respectively. + +### 7. You came across a configuration file located at ‘/usr/share/alsa/cards/AACI.conf’ and you are not sure this configuration file is associated with what package. How will you find out the parent package name? ### + +> **Answer** : When a package is installed, the relevant information gets stored in the database. So it is easy to trace what provides the above package using option -qf (-f query packages owning files). +> +> # rpm -qf /usr/share/alsa/cards/AACI.conf +> alsa-lib-1.0.28-2.el7.x86_64 +> +> Similarly we can find (what provides) information about any sub-packge, document files and License files. + +### 8. How will you find list of recently installed software’s using rpm? ### + +> **Answer** : As said earlier, everything being installed is logged in database. So it is not difficult to query the rpm database and find the list of recently installed software’s. +> +> We can do this by running the below commands using option –last (prints the most recent installed software’s). +> +> # rpm -qa --last +> +> The above command will print all the packages installed in a order such that, the last installed software appears at the top. +> +> If our concern is to find out specific package, we can grep that package (say sqlite) from the list, simply as: +> +> # rpm -qa --last | grep -i sqlite +> +> sqlite-3.8.10.2-1.fc22.x86_64 Thursday 18 June 2015 05:05:43 PM IST +> +> We can also get a list of 10 most recently installed software simply as: +> +> # rpm -qa --last | head +> +> We can refine the result to output a more custom result simply as: +> +> # rpm -qa --last | head -n 2 +> +> In the above command -n represents number followed by a numeric value. The above command prints a list of 2 most recent installed software. + +### 9. Before installing a package, you are supposed to check its dependencies. What will you do? ### + +> **Answer** : To check the dependencies of a rpm package (XYZ.rpm), we can use switches -q (query package), -p (query a package file) and -R (Requires / List packages on which this package depends i.e., dependencies). +> +> # rpm -qpR gedit-3.16.1-1.fc22.i686.rpm +> +> /bin/sh +> /usr/bin/env +> glib2(x86-32) >= 2.40.0 +> gsettings-desktop-schemas +> gtk3(x86-32) >= 3.16 +> gtksourceview3(x86-32) >= 3.16 +> gvfs +> libX11.so.6 +> ... + +### 10. Is rpm a front-end Package Management Tool? ### + +> **Answer** : No! rpm is a back-end package management for RPM based Linux Distribution. +> +> [YUM][1] which stands for Yellowdog Updater Modified is the front-end for rpm. YUM automates the overall process of resolving dependencies and everything else. +> +> Very recently [DNF][2] (Dandified YUM) replaced YUM in Fedora 22. Though YUM is still available to be used in RHEL and CentOS, we can install dnf and use it alongside of YUM. DNF is said to have a lots of improvement over YUM. +> +> Good to know, you keep yourself updated. Lets move to the front-end part. + +### 11. How will you list all the enabled repolist on a system. ### + +> **Answer** : We can list all the enabled repos on a system simply using following commands. +> +> # yum repolist +> or +> # dnf repolist +> +> Last metadata expiration check performed 0:30:03 ago on Mon Jun 22 16:50:00 2015. +> repo id repo name status +> *fedora Fedora 22 - x86_64 44,762 +> ozonos Repository for Ozon OS 61 +> *updates Fedora 22 - x86_64 - Updates +> +> The above command will only list those repos that are enabled. If we need to list all the repos, enabled or not, we can do. +> +> # yum repolist all +> or +> # dnf repolist all +> +> Last metadata expiration check performed 0:29:45 ago on Mon Jun 22 16:50:00 2015. +> repo id repo name status +> *fedora Fedora 22 - x86_64 enabled: 44,762 +> fedora-debuginfo Fedora 22 - x86_64 - Debug disabled +> fedora-source Fedora 22 - Source disabled +> ozonos Repository for Ozon OS enabled: 61 +> *updates Fedora 22 - x86_64 - Updates enabled: 5,018 +> updates-debuginfo Fedora 22 - x86_64 - Updates - Debug + +### 12. How will you list all the available and installed packages on a system? ### + +> **Answer** : To list all the available packages on a system, we can do: +> +> # yum list available +> or +> # dnf list available +> +> ast metadata expiration check performed 0:34:09 ago on Mon Jun 22 16:50:00 2015. +> Available Packages +> 0ad.x86_64 0.0.18-1.fc22 fedora +> 0ad-data.noarch 0.0.18-1.fc22 fedora +> 0install.x86_64 2.6.1-2.fc21 fedora +> 0xFFFF.x86_64 0.3.9-11.fc22 fedora +> 2048-cli.x86_64 0.9-4.git20141214.723738c.fc22 fedora +> 2048-cli-nocurses.x86_64 0.9-4.git20141214.723738c.fc22 fedora +> .... +> +> To list all the installed Packages on a system, we can do. +> +> # yum list installed +> or +> # dnf list installed +> +> Last metadata expiration check performed 0:34:30 ago on Mon Jun 22 16:50:00 2015. +> Installed Packages +> GeoIP.x86_64 1.6.5-1.fc22 @System +> GeoIP-GeoLite-data.noarch 2015.05-1.fc22 @System +> NetworkManager.x86_64 1:1.0.2-1.fc22 @System +> NetworkManager-libnm.x86_64 1:1.0.2-1.fc22 @System +> aajohan-comfortaa-fonts.noarch 2.004-4.fc22 @System +> .... +> +> To list all the available and installed packages on a system, we can do. +> +> # yum list +> or +> # dnf list +> +> Last metadata expiration check performed 0:32:56 ago on Mon Jun 22 16:50:00 2015. +> Installed Packages +> GeoIP.x86_64 1.6.5-1.fc22 @System +> GeoIP-GeoLite-data.noarch 2015.05-1.fc22 @System +> NetworkManager.x86_64 1:1.0.2-1.fc22 @System +> NetworkManager-libnm.x86_64 1:1.0.2-1.fc22 @System +> aajohan-comfortaa-fonts.noarch 2.004-4.fc22 @System +> acl.x86_64 2.2.52-7.fc22 @System +> .... + +### 13. How will you install and update a package and a group of packages separately on a system using YUM/DNF? ### + +> Answer : To Install a package (say nano), we can do, +> +> # yum install nano +> +> To Install a Group of Package (say Haskell), we can do. +> +> # yum groupinstall 'haskell' +> +> To update a package (say nano), we can do. +> +> # yum update nano +> +> To update a Group of Package (say Haskell), we can do. +> +> # yum groupupdate 'haskell' + +### 14. How will you SYNC all the installed packages on a system to stable release? ### + +> **Answer** : We can sync all the packages on a system (say CentOS or Fedora) to stable release as, +> +> # yum distro-sync [On CentOS/RHEL] +> or +> # dnf distro-sync [On Fedora 20 Onwards] + +Seems you have done a good homework before coming for the interview,Good!. Before proceeding further I just want to ask one more question. + +### 15. Are you familiar with YUM local repository? Have you tried making a Local YUM repository? Let me know in brief what you will do to create a local YUM repo. ### + +> **Answer** : First I would like to Thank you Sir for appreciation. Coming to question, I must admit that I am quiet familiar with Local YUM repositories and I have already implemented it for testing purpose in my local machine. +> +> 1. To set up Local YUM repository, we need to install the below three packages as: +> +> # yum install deltarpm python-deltarpm createrepo +> +> 2. Create a directory (say /home/$USER/rpm) and copy all the RPMs from RedHat/CentOS DVD to that folder. +> +> # mkdir /home/$USER/rpm +> # cp /path/to/rpm/on/DVD/*.rpm /home/$USER/rpm +> +> 3. Create base repository headers as. +> +> # createrepo -v /home/$USER/rpm +> +> 4. Create the .repo file (say abc.repo) at the location /etc/yum.repos.d simply as: +> +> cd /etc/yum.repos.d && cat << EOF > abc.repo +> [local-installation]name=yum-local +> baseurl=file:///home/$USER/rpm +> enabled=1 +> gpgcheck=0 +> EOF + +**Important**: Make sure to remove $USER with user_name. + +That’s all we need to do to create a Local YUM repository. We can now install applications from here, that is relatively fast, secure and most important don’t need an Internet connection. + +Okay! It was nice interviewing you. I am done. I am going to suggest your name to HR. You are a young and brilliant candidate we would like to have in our organization. If you have any question you may ask me. + +**Me**: Sir, it was really a very nice interview and I feel very lucky today, to have cracked the interview.. + +Obviously it didn’t end here. I asked a lots of questions like the project they are handling. What would be my role and responsibility and blah..blah..blah + +Friends, by the time all these were documented I have been called for HR round which is 3 days from now. Hope I do my best there as well. All your blessings will count. + +Thankyou friends and Tecmint for taking time and documenting my experience. Mates I believe Tecmint is doing some really extra-ordinary which must be praised. When we share ours experience with other, other get to know many things from us and we get to know our mistakes. + +It enhances our confidence level. If you have given any such interview recently, don’t keep it to yourself. Spread it! Let all of us know that. You may use the below form to share your experience with us. + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/linux-rpm-package-management-interview-questions/ + +作者:[Avishek Kumar][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/avishek/ +[1]:http://www.tecmint.com/20-linux-yum-yellowdog-updater-modified-commands-for-package-mangement/ +[2]:http://www.tecmint.com/dnf-commands-for-fedora-rpm-package-management/ \ No newline at end of file From 2a010f0061aed5fa48ff89f8f3d45445fad7a54d Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 23 Jun 2015 23:42:37 +0800 Subject: [PATCH 453/965] PUB:20150612 Inside NGINX--How We Designed for Performance and Scale MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @wyangsun 翻译的不错! --- ...w We Designed for Performance and Scale.md | 175 ++++++++++++++++++ ...w We Designed for Performance and Scale.md | 174 ----------------- 2 files changed, 175 insertions(+), 174 deletions(-) create mode 100644 published/20150612 Inside NGINX--How We Designed for Performance and Scale.md delete mode 100644 translated/tech/20150612 Inside NGINX--How We Designed for Performance and Scale.md diff --git a/published/20150612 Inside NGINX--How We Designed for Performance and Scale.md b/published/20150612 Inside NGINX--How We Designed for Performance and Scale.md new file mode 100644 index 0000000000..ffa8dc6d7e --- /dev/null +++ b/published/20150612 Inside NGINX--How We Designed for Performance and Scale.md @@ -0,0 +1,175 @@ +深入 NGINX: 我们如何设计性能和扩展 +================================================================================ + +NGINX 能在 web 性能中取得领先地位,这是由于其软件设计所决定的。许多 web 服务器和应用程序服务器使用一个简单的线程或基于流程的架构,NGINX 立足于一个复杂的事件驱动的体系结构,使它能够在现代硬件上扩展到成千上万的并发连接。 + +这张[深入 NGINX][1] 的信息图从高层次的流程架构深度挖掘说明了 NGINX 如何在单一进程里保持多个连接。这篇博客进一步详细地解释了这一切是如何工作的。 + +### 知识 – NGINX进程模型 ### + +![Master Process](http://cdn.nginx.com/wp-content/uploads/2015/06/Screen-Shot-2015-06-08-at-12.36.30-PM.png) + +为了更好的理解这个设计,你需要理解 NGINX 如何运行的。NGINX 有一个主进程(它执行特权操作,如读取配置和绑定端口)和一些工作进程与辅助进程。 + + # service nginx restart + * Restarting nginx + # ps -ef --forest | grep nginx + root 32475 1 0 13:36 ? 00:00:00 nginx: master process /usr/sbin/nginx \ + -c /etc/nginx/nginx.conf + nginx 32476 32475 0 13:36 ? 00:00:00 \_ nginx: worker process + nginx 32477 32475 0 13:36 ? 00:00:00 \_ nginx: worker process + nginx 32479 32475 0 13:36 ? 00:00:00 \_ nginx: worker process + nginx 32480 32475 0 13:36 ? 00:00:00 \_ nginx: worker process + nginx 32481 32475 0 13:36 ? 00:00:00 \_ nginx: cache manager process + nginx 32482 32475 0 13:36 ? 00:00:00 \_ nginx: cache loader process + +在四核服务器,NGINX 主进程创建了4个工作进程和两个管理磁盘内容缓存的缓存辅助进程。 + +### 为什么架构很重要? ### + +任何 Unix 应用程序的根本基础是线程或进程。(从 Linux 操作系统的角度来看,线程和进程大多是相同的,主要的区别是他们共享内存的程度。)一个线程或进程是一个自包含的指令集,操作系统可以在一个 CPU 核心上调度运行它们。大多数复杂的应用程序并行运行多个线程或进程有两个原因: + +- 它们可以同时使用更多的计算核心。 +- 线程或进程可以轻松实现并行操作。(例如,在同一时刻保持多连接)。 + +进程和线程消耗资源。他们每个都使用内存和其他系统资源,他们会在 CPU 核心中换入和换出(一个操作可以叫做上下文切换)。大多数现代服务器可以并行保持上百个小型的、活动的线程或进程,但是一旦内存耗尽或高 I/O 压力引起大量的上下文切换会导致性能严重下降。 + +网络应用程序设计的常用方法是为每个连接分配一个线程或进程。此体系结构简单、容易实现,但是当应用程序需要处理成千上万的并发连接时这种结构就不具备扩展性。 + +### NGINX 如何工作? ### + +NGINX 使用一种可预测的进程模式来分配可使用的硬件资源: + +- 主进程(master)执行特权操作,如读取配置和绑定端口,然后创建少量的子进程(如下的三种类型)。 +- 缓存加载器进程(cache loader)在加载磁盘缓存到内存中时开始运行,然后退出。适当的调度,所以其资源需求很低。 +- 缓存管理器进程(cache manager)定期裁剪磁盘缓存中的记录来保持他们在配置的大小之内。 +- 工作进程(worker)做所有的工作!他们保持网络连接、读写内容到磁盘,与上游服务器通信。 + +在大多数情况下 NGINX 的配置建议:每个 CPU 核心运行一个工作进程,这样最有效地利用硬件资源。你可以在配置中包含 [worker_processes auto][2]指令配置: + + worker_processes auto; + +当一个 NGINX 服务处于活动状态,只有工作进程在忙碌。每个工作进程以非阻塞方式保持多连接,以减少上下文交换。 + +每个工作进程是一个单一线程并且独立运行,它们会获取新连接并处理之。这些进程可以使用共享内存通信来共享缓存数据、会话持久性数据及其它共享资源。(在 NGINX 1.7.11 及其以后版本,还有一个可选的线程池,工作进程可以转让阻塞的操作给它。更多的细节,参见“[NGINX 线程池可以爆增9倍性能!][16]”。对于 NGINX Plus 用户,该功能计划在今年晚些时候加入到 R7 版本中。) + +### NGINX 工作进程内部 ### + +![](http://cdn.nginx.com/wp-content/uploads/2015/06/Screen-Shot-2015-06-08-at-12.39.48-PM.png) + +每个 NGINX 工作进程按照 NGINX 配置初始化,并由主进程提供一组监听端口。 + +NGINX 工作进程首先在监听套接字上等待事件([accept_mutex][3] 和[内核套接字分片][4])。事件被新进来的连接初始化。这些连接被分配到一个状态机 – HTTP 状态机是最常用的,但 NGINX 也实现了流式(原始 TCP )状态机和几种邮件协议(SMTP、IMAP和POP3)的状态机。 + +![Internet Requests](http://cdn.nginx.com/wp-content/uploads/2015/06/Screen-Shot-2015-06-08-at-12.40.32-PM.png) + +状态机本质上是一组指令,告诉 NGINX 如何处理一个请求。大多数 web 服务器像 NGINX 一样使用类似的状态机来实现相同的功能 - 区别在于实现。 + +### 调度状态机 ### + +把状态机想象成国际象棋的规则。每个 HTTP 事务是一个象棋游戏。一方面棋盘是 web 服务器 —— 一位大师可以非常迅速地做出决定。另一方面是远程客户端 —— 在一个相对较慢的网络下 web 浏览器访问网站或应用程序。 + +不管怎样,这个游戏规则很复杂。例如,web 服务器可能需要与各方沟通(代理一个上游的应用程序)或与身份验证服务器对话。web 服务器的第三方模块甚至可以扩展游戏规则。 + +#### 一个阻塞状态机 #### + +回忆我们之前的描述,一个进程或线程就像一套独立的指令集,操作系统可以在一个 CPU 核心上调度运行它。大多数 web 服务器和 web 应用使用每个连接一个进程或者每个连接一个线程的模式来玩这个“象棋游戏”。每个进程或线程都包含玩完“一个游戏”的指令。在服务器运行该进程的期间,其大部分的时间都是“阻塞的” —— 等待客户端完成它的下一步行动。 + +![Blocking I/O](http://cdn.nginx.com/wp-content/uploads/2015/06/Screen-Shot-2015-06-08-at-12.40.52-PM.png) + +1. web 服务器进程在监听套接字上监听新连接(客户端发起新“游戏”) +1. 当它获得一个新游戏,就玩这个游戏,每走一步去等待客户端响应时就阻塞了。 +1. 游戏完成后,web 服务器进程可能会等待是否有客户机想要开始一个新游戏(这里指的是一个“保持的”连接)。如果这个连接关闭了(客户端断开或者发生超时),web 服务器进程会返回并监听一个新“游戏”。 + +要记住最重要的一点是每个活动的 HTTP 连接(每局棋)需要一个专用的进程或线程(象棋高手)。这个结构简单容并且易扩展第三方模块(“新规则”)。然而,还是有巨大的不平衡:尤其是轻量级 HTTP 连接其实就是一个文件描述符和小块内存,映射到一个单独的线程或进程,这是一个非常重量级的系统对象。这种方式易于编程,但太过浪费。 + +#### NGINX是一个真正的象棋大师 #### + +也许你听过[同时表演赛][5]游戏,有一个象棋大师同时对战许多对手? + +![Kiril Georgiev](http://cdn.nginx.com/wp-content/uploads/2015/06/Kiril-Georgiev.gif) + +*[列夫·吉奥吉夫在保加利亚的索非亚同时对阵360人][6]。他的最终成绩是284胜70平6负。* + +这就是 NGINX 工作进程如何“下棋”的。每个工作进程(记住 - 通常每个CPU核心上有一个工作进程)是一个可同时对战上百人(事实是,成百上千)的象棋大师。 + +![Event-driven Architecture](http://cdn.nginx.com/wp-content/uploads/2015/06/Screen-Shot-2015-06-08-at-12.41.13-PM.png) + +1. 工作进程在监听和连接套接字上等待事件。 +1. 事件发生在套接字上,并且由工作进程处理它们: + - 在监听套接字的事件意味着一个客户端已经开始了一局新棋局。工作进程创建了一个新连接套接字。 + - 在连接套接字的事件意味着客户端已经下了一步棋。工作进程及时响应。 + +一个工作进程在网络流量上从不阻塞,等待它的“对手”(客户端)做出反应。当它下了一步,工作进程立即继续其他的游戏,在那里工作进程正在处理下一步,或者在门口欢迎一个新玩家。 + +#### 为什么这个比阻塞式多进程架构更快? #### + +NGINX 每个工作进程很好的扩展支撑了成百上千的连接。每个连接在工作进程中创建另外一个文件描述符和消耗一小部分额外内存。每个连接有很少的额外开销。NGINX 进程可以固定在某个 CPU 上。上下文交换非常罕见,一般只发生在没有工作要做时。 + +在阻塞方式,每个进程一个连接的方法中,每个连接需要大量额外的资源和开销,并且上下文切换(从一个进程切换到另一个)非常频繁。 + +更详细的解释,看看这篇关于 NGINX 架构的[文章][7],它由NGINX公司开发副总裁及共同创始人 Andrew Alexeev 写的。 + +通过适当的[系统优化][8],NGINX 的每个工作进程可以扩展来处理成千上万的并发 HTTP 连接,并能脸不红心不跳的承受峰值流量(大量涌入的新“游戏”)。 + +### 更新配置和升级 NGINX ### + +NGINX 的进程体系架构使用少量的工作进程,有助于有效的更新配置文件甚至 NGINX 程序本身。 + +![Updating Configuration](http://cdn.nginx.com/wp-content/uploads/2015/06/Screen-Shot-2015-06-08-at-12.41.33-PM.png) + +更新 NGINX 配置文件是非常简单、轻量、可靠的操作。典型的就是运行命令 `nginx –s reload`,所做的就是检查磁盘上的配置并发送 SIGHUP 信号给主进程。 + +当主进程接收到一个 SIGHUP 信号,它会做两件事: + +- 重载配置文件和分支出一组新的工作进程。这些新的工作进程立即开始接受连接和处理流量(使用新的配置设置) +- 通知旧的工作进程优雅的退出。工作进程停止接受新的连接。当前的 http 请求一旦完成,工作进程就彻底关闭这个连接(那就是,没有残存的“保持”连接)。一旦所有连接关闭,这个工作进程就退出。 + +这个重载过程能引发一个 CPU 和内存使用的小峰值,但是跟活动连接加载的资源相比它一般不易察觉。每秒钟你可以多次重载配置(很多 NGINX 用户都这么做)。非常罕见的情况下,有很多世代的工作进程等待关闭连接时会发生问题,但即使是那样也很快被解决了。 + +NGINX 的程序升级过程中拿到了高可用性圣杯 —— 你可以随随时更新这个软件,不会丢失连接,停机,或者中断服务。 + +![New Binary](http://cdn.nginx.com/wp-content/uploads/2015/06/Screen-Shot-2015-06-08-at-12.41.51-PM.png) + +程序升级过程类似于平滑重载配置的方法。一个新的 NGINX 主进程与原主进程并行运行,然后他们共享监听套接字。两个进程都是活动的,并且各自的工作进程处理流量。然后你可以通知旧的主进程和它的工作进程优雅的退出。 + +整个过程的详细描述在 [NGINX 管理][9]。 + +### 结论 ### + +[深入 NGINX 信息图][10] 提供一个 NGINX 功能实现的高层面概览,但在这简单的解释的背后是超过十年的创新和优化,使得 NGINX 在广泛的硬件上提供尽可能最好的性能同时保持了现代 Web 应用程序所需要的安全性和可靠性。 + +如果你想阅读更多关于NGINX的优化,查看这些优秀的资源: + +- [安装和 NGINX 性能调优][11] (webinar; Speaker Deck 上的[讲义][12]) +- [NGINX 性能调优][13] +- [开源应用架构: NGINX 篇][14] +- [NGINX 1.9.1 中的套接字分片][15] (使用 SO_REUSEPORT 套接字选项) + +-------------------------------------------------------------------------------- + +via: http://nginx.com/blog/inside-nginx-how-we-designed-for-performance-scale/ + +作者:[Owen Garrett][a] +译者:[wyangsun](https://github.com/wyangsun) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://nginx.com/author/owen/ +[1]:http://nginx.com/resources/library/infographic-inside-nginx/ +[2]:http://nginx.org/en/docs/ngx_core_module.html#worker_processes +[3]:http://nginx.org/en/docs/ngx_core_module.html#accept_mutex +[4]:http://nginx.com/blog/socket-sharding-nginx-release-1-9-1/ +[5]:http://en.wikipedia.org/wiki/Simultaneous_exhibition +[6]:http://gambit.blogs.nytimes.com/2009/03/03/in-chess-records-were-made-to-be-broken/ +[7]:http://www.aosabook.org/en/nginx.html +[8]:http://nginx.com/blog/tuning-nginx/ +[9]:http://nginx.org/en/docs/control.html +[10]:http://nginx.com/resources/library/infographic-inside-nginx/ +[11]:http://nginx.com/resources/webinars/installing-tuning-nginx/ +[12]:https://speakerdeck.com/nginx/nginx-installation-and-tuning +[13]:http://nginx.com/blog/tuning-nginx/ +[14]:http://www.aosabook.org/en/nginx.html +[15]:http://nginx.com/blog/socket-sharding-nginx-release-1-9-1/ +[16]:http://nginx.com/blog/thread-pools-boost-performance-9x/ diff --git a/translated/tech/20150612 Inside NGINX--How We Designed for Performance and Scale.md b/translated/tech/20150612 Inside NGINX--How We Designed for Performance and Scale.md deleted file mode 100644 index fcf195115d..0000000000 --- a/translated/tech/20150612 Inside NGINX--How We Designed for Performance and Scale.md +++ /dev/null @@ -1,174 +0,0 @@ -NGINX内部: 我们如何设计性能和扩展 -================================================================================ -NGINX是web应用中性能最好的一个,这一切都是由于软件设计。而许多web服务器和应用程序服务器使用一个简单的线程或基于流程的架构,NGINX立足于一个复杂的事件驱动的体系结构,使它能够在现代硬件上扩展到成千上万的并发连接。 - -[NGINX内部][1]信息图从高级流程架构深度挖掘说明了NGINX如何在单进程里保持多连接。这个博客进一步详细地解释了这一切是如何工作的。 - -### 知识 – NGINX进程模型 ### - -![Master Process](http://cdn.nginx.com/wp-content/uploads/2015/06/Screen-Shot-2015-06-08-at-12.36.30-PM.png) - -为了更好的理解这个设计,你需要理解NGINX如何运行的。NGINX有一个主进程(它执行特权操作如读取配置和绑定端口)和一些工作进程与辅助进程。 - - # service nginx restart - * Restarting nginx - # ps -ef --forest | grep nginx - root 32475 1 0 13:36 ? 00:00:00 nginx: master process /usr/sbin/nginx \ - -c /etc/nginx/nginx.conf - nginx 32476 32475 0 13:36 ? 00:00:00 \_ nginx: worker process - nginx 32477 32475 0 13:36 ? 00:00:00 \_ nginx: worker process - nginx 32479 32475 0 13:36 ? 00:00:00 \_ nginx: worker process - nginx 32480 32475 0 13:36 ? 00:00:00 \_ nginx: worker process - nginx 32481 32475 0 13:36 ? 00:00:00 \_ nginx: cache manager process - nginx 32482 32475 0 13:36 ? 00:00:00 \_ nginx: cache loader process - -在四核服务器,NGINX主进程创建4工作进程和两个管理磁盘内容缓存的缓存辅助进程。 - -### 为什么架构很重要? ### - -任何Unix应用程序的根本基础是线程或进程。(从Linux操作系统的角度来看,线程和进程大多是相同的,主要的区别是他们共享内存的程度。)一个线程或进程是一个独立的指令,操作系统可以运行在一个CPU核心。大多数复杂的应用程序并行运行多个线程或进程有两个原因: - -- 他们可以同时使用更多的计算核心。 -- 线程或进程可以轻松实现并行操作。(例如,在同一时刻保持多连接)。 - -进程和线程消耗资源。他们每个都使用内存和其他系统资源,他们需要被交换进出核心(一个操作可以叫做上下文切换)。大多数现代服务器可以保持上百小型、活动的并发连接,一旦内存耗尽或高I/O压力引起大量的上下文切换性能会严重下降。 - -网络应用程序设计的常用方法是为每个连接分配一个线程或进程。此体系结构简单、容易实现,但是当应用程序需要处理成千上万的并发连接时这种结构不具规模。 - -### NGINX如何工作? ### - -NGINX使用一种可预测进程模式,被调到了可使用的硬件资源上: - -- 主进程执行特权操作,如读取配置和绑定端口,然后创建一个小数量的子进程(接下来的三种类型)。 -- 缓存加载程序进程在加载磁盘缓存到内存中时开始运行,然后退出。它被适当的安排,所以其资源需求很低。 -- 缓存管理器进程定期修剪磁盘缓存中的记录来保持他们在配置的大小之内。 -- 工作进程做所有的工作!他们保持网络连接、读写内容到磁盘,与上游服务器通信。 - -在大多数情况下建议NGINX的配置 – 每个CPU核心运行一个工作进程 – 最有效地利用硬件资源。你的配置包含了[worker_processes auto][2]指令配置: - - worker_processes auto; - -当一个NGINX服务处于活动状态,只有工作进程是忙碌的。每个工作进程以非阻塞方式保持多连接,减少上下文交换。 - -每个工作进程是一个单线程并且独立运行,获取新链接并处理他们。这些进程可以使用共享内存通信来共享缓存数据,会话持久性数据,和其他共享资源。 - -### NGINX工作进程内部 ### - -![](http://cdn.nginx.com/wp-content/uploads/2015/06/Screen-Shot-2015-06-08-at-12.39.48-PM.png) - -NGINX主进程通过NGINX配置初始化每个工作进程并提供一组监听端口。 - -NGINX工作进程首先在监听套接字上等待事件([accept_mutex][3]和[内核套接字分片][4])。事件被新进来的链接初始化。这些连接被分配到一个状态机 – HTTP状态机是最常用的,但NGINX也具备流式(原始的TCP)状态机和大量的邮件协议(SMTP、IMAP和POP3)。 - -![Internet Requests](http://cdn.nginx.com/wp-content/uploads/2015/06/Screen-Shot-2015-06-08-at-12.40.32-PM.png) - -状态机本质上是一组指令,告诉NGINX如何处理一个请求。大多数web服务器执行相同的函数作为NGINX使用类似的状态机 - 区别在于实现。 - -### 调度状态机 ### - -把状态机想象成国际象棋的规则。每个HTTP事务是一个象棋游戏。一方面棋盘是web服务器 – 一位大师可以非常迅速地做出决定。另一方面是远程客户端 – 在一个相对较慢的网络下web浏览器访问网站或应用程序。 - -不管咋地,这个游戏规则很复杂。例如,web服务器可能需要与各方沟通(代理一个上游的应用程序)或与身份验证服务器对话。web服务器的第三方模块甚至可以扩展游戏规则。 - -#### 一个阻塞状态机 #### - -回忆我们描述一个进程或线程就像一个独立的指令集,操作系统可以调度运行它在一个CPU核心。大多数web服务器和web应用使用一个进程一个链接或者一个线程一个链接的模式来运行这个“象棋游戏”。每个进程或线程都包含指令来玩“一个游戏”直到结束。一次进程在服务器运行,它花费大部分的时间“阻塞” - 等待客户端完成它的下一步行动。 - -![Blocking I/O](http://cdn.nginx.com/wp-content/uploads/2015/06/Screen-Shot-2015-06-08-at-12.40.52-PM.png) - -1. web服务器进程在监听套接字监听新连接(客户端发起新“游戏”) -1. 当它获得一个新游戏,就玩这个游戏,每走一步去等待客户端响应时就阻塞了。 -1. 游戏完成后,web服务器进程可能会等待是否有客户机想要开始一个新游戏(这对应于一个保持连接)。如果这个链接关闭了(客户端离开或者发生超时),web服务器进程返回监听一个新“游戏”。 - -要记住最重要的一点是每个活动的HTTP链接(每局棋)需要一个专用的进程或线程(象棋高手)。这个结构简单容并且易扩展第三方模块(“新规则”)。无论如何,还是有巨大的不平衡:尤其是轻量的HTTP链接,作为代表是一个文件描述符和小量的内存,映射到一个单独的线程或进程,一个非常重量的系统对象。这种方式易于编程,但太过浪费。 - -#### NGINX是一个真正的象棋大师 #### - -也许你听过[同时表演赛][5]游戏,有一个象棋大师同时对战许多对手? - -![Kiril Georgiev](http://cdn.nginx.com/wp-content/uploads/2015/06/Kiril-Georgiev.gif) - -[列夫·吉奥吉夫在保加利亚的索非亚同时对阵360人][6]。他的最终成绩是284胜70平6负。 - -这就是NGINX工作进程如何“下棋”的。每个工作进程(记住 - 通常每个CPU核心上有一个工作进程)是一个可同时对战上百人(事实是,成百上千)的象棋大师。 - -![Event-driven Architecture](http://cdn.nginx.com/wp-content/uploads/2015/06/Screen-Shot-2015-06-08-at-12.41.13-PM.png) - -1. 工作进程在监听和链接套接字上等待事件。 -1. 事件发生在套接字并且由工作进程处理它们: - - - 在监听套接字的事件意味着一个客户端已经开始了一局新棋局。工作进程创建了一个新链接套接字。 - - 在链接套接字的事件意味着客户端已经下了一步棋。工作进程快速的响应。 - -一个工作进程在网络流量上从不阻塞,等待它的“对手”(客户端)做出反应。当它下了一步,工作进程立即继续其他的游戏,在那里工作进程正在处理下一步,或者在门口欢迎一个新玩家。 - -### 为什么这个比阻塞式多进程架构更快? ### - -NGINX每个工作进程很好的扩展支撑了成百上千的链接。每个链接在工作进程中创建另一个文件描述符和消耗一小部分额外内存。每个链接很少有额外的开销。NGINX进程可以固定在一些CPU上。上下文交换非常罕见,只发生在没有工作要做。 - -阻塞方式,一个链接一个进程的方法中,每个连接需要大量额外的资源和开销,和上下文切换(从一个进程切换到另一个)非常频繁 - -更详细的解释,看看这个[文章][7]关于NGINX架构,由NGINX公司发展副总裁和创始人之一 Andrew Alexeev 著。 - -适当的[系统优化][8],NGINX的每个工作进程可以扩展来处理成千上万的并发HTTP连接,并能脸不红心不跳的承受峰值流量(大量涌入的新“游戏”)。 - -### 更新配置和升级NGINX ### - -NGINX是过程体系架构,有一小部分工作进程,有助于有效的更新配置文件甚至NGINX程序本身。 - -![Updating Configuration](http://cdn.nginx.com/wp-content/uploads/2015/06/Screen-Shot-2015-06-08-at-12.41.33-PM.png) - -更新NGINX配置文件是非常简单、轻量、可靠的操作。它通常意味着运行命令`nginx –s reload`,所做的就是检查磁盘上的配置并发送SIGHUP信号给主进程。 - -当主进程接收到一个SIGHUP信号,它会做两件事: - -- 重载配置文件和分出一组新的工作进程。这些新的工作进程立即开始接受连接和处理流量(使用新的配置设置) -- 通知旧的工作进程优雅的退出。工作进程停止接受新的链接。当前的http请求一完成,工作进程就彻底关闭这个链接(那就是,没有残存的保持链接)。一旦所有链接关闭,这个工作进程就退出。 - -这个重载过程能引发一个CPU和内存使用的小峰值,但是跟活动链接加载的支援比它一般不易察觉。你可以每秒多次重载配置(很多NGINX用户都这么做)。很少情况下,问题发生在很多代的工作进程等待关闭连接时,但即使是那样也很快被解决了。 - -NGINX的程序升级过程中实现了高可用的圣杯 - 你可以随随时更新这个软件,不会丢失连接,停机,或者中断服务。 - -![New Binary](http://cdn.nginx.com/wp-content/uploads/2015/06/Screen-Shot-2015-06-08-at-12.41.51-PM.png) - -程序升级过程很像优雅的重载配置的方法。一个新的NGINX主进程与原主进程并行运行,然后他们共享监听套接字。两个进程都是活动的,并且各自的工作进程处理流量。然后你可以通知旧主进程和他的工作进程优雅的退出。 - -整个进程的详细描述在[NGINX管理][9]. - -### 结论 ### - -[NGINX内部信息图][10] 提供一个NGINX功能实现的高级的概况,但在这简单的解释是超过十年的创新和优化,使Nginx在一个范围广泛的硬件上提供尽可能最好的性能同时保持现代Web应用程序需要的安全性和可靠性。 - -如果你想阅读更多关于NGINX的优化,查看这些优秀的资源: - -- [Installing and Tuning NGINX for Performance][11] (webinar; [slides][12] at Speaker Deck) -- [Tuning NGINX for Performance][13] -- [The Architecture of Open Source Applications – NGINX][14] -- [Socket Sharding in NGINX Release 1.9.1][15] (using the SO_REUSEPORT socket option) - --------------------------------------------------------------------------------- - -via: http://nginx.com/blog/inside-nginx-how-we-designed-for-performance-scale/ - -作者:[Owen Garrett][a] -译者:[wyangsun](https://github.com/wyangsun) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://nginx.com/author/owen/ -[1]:http://nginx.com/resources/library/infographic-inside-nginx/ -[2]:http://nginx.org/en/docs/ngx_core_module.html#worker_processes -[3]:http://nginx.org/en/docs/ngx_core_module.html#accept_mutex -[4]:http://nginx.com/blog/socket-sharding-nginx-release-1-9-1/ -[5]:http://en.wikipedia.org/wiki/Simultaneous_exhibition -[6]:http://gambit.blogs.nytimes.com/2009/03/03/in-chess-records-were-made-to-be-broken/ -[7]:http://www.aosabook.org/en/nginx.html -[8]:http://nginx.com/blog/tuning-nginx/ -[9]:http://nginx.org/en/docs/control.html -[10]:http://nginx.com/resources/library/infographic-inside-nginx/ -[11]:http://nginx.com/resources/webinars/installing-tuning-nginx/ -[12]:https://speakerdeck.com/nginx/nginx-installation-and-tuning -[13]:http://nginx.com/blog/tuning-nginx/ -[14]:http://www.aosabook.org/en/nginx.html -[15]:http://nginx.com/blog/socket-sharding-nginx-release-1-9-1/ From f0390f1db964ac320c5d98c7600fd615b532fcd8 Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 23 Jun 2015 23:47:58 +0800 Subject: [PATCH 454/965] PUB:20150527 How To Check Laptop CPU Temperature In Ubuntu @geekpi --- ...27 How To Check Laptop CPU Temperature In Ubuntu.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) rename {translated/tech => published}/20150527 How To Check Laptop CPU Temperature In Ubuntu.md (82%) diff --git a/translated/tech/20150527 How To Check Laptop CPU Temperature In Ubuntu.md b/published/20150527 How To Check Laptop CPU Temperature In Ubuntu.md similarity index 82% rename from translated/tech/20150527 How To Check Laptop CPU Temperature In Ubuntu.md rename to published/20150527 How To Check Laptop CPU Temperature In Ubuntu.md index ace8999edb..c158770b3f 100644 --- a/translated/tech/20150527 How To Check Laptop CPU Temperature In Ubuntu.md +++ b/published/20150527 How To Check Laptop CPU Temperature In Ubuntu.md @@ -2,9 +2,9 @@ ================================================================================ ![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/05/Monitor_temperature_Ubuntu.png) -笔记本过热是最近一个常见的问题。监控硬件温度或许可以帮助你诊断笔记本为什么会过热。本篇中,我们会**了解如何在Ubuntu中检查CPU的温度**。 +夏天到了,笔记本过热是最近一个常见的问题。监控硬件温度或许可以帮助你诊断笔记本为什么会过热。本篇中,我们会**了解如何在Ubuntu中检查CPU的温度**。 -我们将使用一个GUI工具[Psensor][1],它允许你在Linux中监控硬件温度。用Psensor你可以: +我们将使用一个GUI工具[Psensor][1],它允许你在Linux中监控硬件温度。用Psensor你可以: - 监控cpu和主板的温度 - 监控NVidia GPU的文档 @@ -17,7 +17,7 @@ Psensor最新的版本同样提供了Ubuntu中的指示小程序,这样使得 ### 如何在Ubuntu 15.04 和 14.04中安装Psensor ### -在安装Psensor前,你需要安装和配置[lm-sensors][2],一个用于硬件监控的命令行工具。如果你想要测量磁盘温度,你还需要安装[hddtemp][3]。要安装这些工具,运行下面的这些命令: +在安装Psensor前,你需要安装和配置[lm-sensors][2],这是一个用于硬件监控的命令行工具。如果你想要测量磁盘温度,你还需要安装[hddtemp][3]。要安装这些工具,运行下面的这些命令: sudo apt-get install lm-sensors hddtemp @@ -45,7 +45,7 @@ Psensor最新的版本同样提供了Ubuntu中的指示小程序,这样使得 sudo apt-get install psensor -安装完成后,在Unity Dash中运行程序。第一次运行时,你应该配置Psensor该监控什么状态。 +安装完成后,在Unity Dash中运行程序。第一次运行时,你应该配置Psensor该监控什么状态。 ![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/05/Psensor_Ubuntu.jpeg) @@ -73,7 +73,7 @@ via: http://itsfoss.com/check-laptop-cpu-temperature-ubuntu/ 作者:[Abhishek][a] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 6fe570b0986a023782d75b20c634f2a9335152ff Mon Sep 17 00:00:00 2001 From: wxy Date: Wed, 24 Jun 2015 00:16:13 +0800 Subject: [PATCH 455/965] PUB:20150520 How to Use Docker Machine with a Cloud Provider @goreliu --- ...se Docker Machine with a Cloud Provider.md | 48 +++++++++---------- 1 file changed, 24 insertions(+), 24 deletions(-) rename {translated/tech => published}/20150520 How to Use Docker Machine with a Cloud Provider.md (65%) diff --git a/translated/tech/20150520 How to Use Docker Machine with a Cloud Provider.md b/published/20150520 How to Use Docker Machine with a Cloud Provider.md similarity index 65% rename from translated/tech/20150520 How to Use Docker Machine with a Cloud Provider.md rename to published/20150520 How to Use Docker Machine with a Cloud Provider.md index acf052d493..78909dfced 100644 --- a/translated/tech/20150520 How to Use Docker Machine with a Cloud Provider.md +++ b/published/20150520 How to Use Docker Machine with a Cloud Provider.md @@ -1,7 +1,7 @@ -如何在云服务提供商的机器使用Docker Machine +如何在云服务提供商的平台上使用Docker Machine ================================================================================ -大家好,今天我们来学习如何使用Docker Machine在各种云服务提供商的平台部署Docker。Docker Machine是一个可以帮助我们在自己的电脑、云服务提供商的机器以及我们数据中心的机器上创建Docker机器的应用程序。它为创建服务器、在服务器中安装Docker、根据用户需求配置Docker客户端提供了简单的解决方案。驱动API对本地机器、数据中心的虚拟机或者公用云机器都适用。Docker Machine支持Windows、OSX和Linux,并且提供一个独立的二进制文件,可以直接使用。它让我们可以充分利用支持Docker的基础设施的生态环境合作伙伴,并且使用相同的接口进行访问。它让人们可以使用一个命令来简单而迅速地在不同的云平台部署Docker容器。 - + +大家好,今天我们来了解如何使用Docker Machine在各种云服务提供商的平台上部署Docker。Docker Machine是一个可以帮助我们在自己的电脑、云服务提供商的平台以及我们数据中心的机器上创建Docker机器的应用程序。它为创建服务器、在服务器中安装Docker、根据用户需求配置Docker客户端提供了简单的解决方案。驱动API对本地机器、数据中心的虚拟机或者公用云机器都适用。Docker Machine支持Windows、OSX和Linux,并且提供一个独立的二进制文件,可以直接使用。它让我们可以充分利用支持Docker的基础设施的生态环境合作伙伴,并且使用相同的接口进行访问。它让人们可以使用一个命令来简单而迅速地在不同的云平台部署Docker容器。 ### 1. 安装Docker Machine ### @@ -25,14 +25,14 @@ Docker Machine可以很好地支持每一种Linux发行版。首先,我们需 ![Installing Docker Machine](http://blog.linoxide.com/wp-content/uploads/2015/05/installing-docker-machine.png) -另外机器上需要有docker命令,可以使用如下命令安装: +要在我们的机器上启用docker命令,需要使用如下命令安装Docker客户端: # curl -L https://get.docker.com/builds/linux/x86_64/docker-latest > /usr/local/bin/docker # chmod +x /usr/local/bin/docker ### 2. 创建机器 ### -在自己的Linux机器上安装好了Docker Machine之后,我们想要将一个docker虚拟机部署到云服务器上。Docker Machine支持几个流行的云平台,如igital Ocean、Amazon Web Services(AWS)、Microsoft Azure、Google Cloud Computing等等,所以我们可以在不同的平台使用相同的接口来部署Docker。本文中我们会使用digitalocean驱动在Digital Ocean的服务器上部署Docker,--driver选项指定digitalocean驱动,--digitalocean-access-token选项指定[Digital Ocean Control Panel][1]提供的API Token,命令最后的是我们创建的Docker虚拟机的机器名。运行如下命令: +在自己的Linux机器上安装好了Docker Machine之后,我们想要将一个docker虚拟机部署到云服务器上。Docker Machine支持几个流行的云平台,如igital Ocean、Amazon Web Services(AWS)、Microsoft Azure、Google Cloud Computing及其它等等,所以我们可以在不同的平台使用相同的接口来部署Docker。本文中我们会使用digitalocean驱动在Digital Ocean的服务器上部署Docker,--driver选项指定digitalocean驱动,--digitalocean-access-token选项指定[Digital Ocean Control Panel][1]提供的API Token,命令最后的是我们创建的Docker虚拟机的机器名。运行如下命令: # docker-machine create --driver digitalocean --digitalocean-access-token linux-dev @@ -40,7 +40,7 @@ Docker Machine可以很好地支持每一种Linux发行版。首先,我们需 ![Docker Machine Digitalocean Cloud](http://blog.linoxide.com/wp-content/uploads/2015/05/docker-machine-digitalocean-cloud.png) -**注意**: 这里linux-dev是我们将要创建的机器的名称。``是一个安全key,可以在Digtal Ocean Control Panel生成。要找到这个key,我们只需要登录到我们的Digital Ocean Control Panel,然后点击API,再点击Generate New Token,填写一个名称,选上Read和Write。然后我们就会得到一串十六进制的key,那就是``,简单地替换到上边的命令中即可。 +**注意**: 这里linux-dev是我们将要创建的机器的名称。``是一个安全key,可以在Digtal Ocean Control Panel生成。要找到这个key,我们只需要登录到我们的Digital Ocean Control Panel,然后点击API,再点击 Generate New Token,填写一个名称,选上Read和Write。然后我们就会得到一串十六进制的key,那就是``,简单地替换到上边的命令中即可。 运行如上命令后,我们可以在Digital Ocean Droplet Panel中看到一个具有默认配置的droplet已经被创建出来了。 @@ -48,35 +48,35 @@ Docker Machine可以很好地支持每一种Linux发行版。首先,我们需 简便起见,docker-machine会使用默认配置来部署Droplet。我们可以通过增加选项来定制我们的Droplet。这里是一些digitalocean相关的选项,我们可以使用它们来覆盖Docker Machine所使用的默认配置。 - --digitalocean-image "ubuntu-14-04-x64" 是选择Droplet的镜像 - --digitalocean-ipv6 enable 是启用IPv6网络支持 - --digitalocean-private-networking enable 是启用专用网络 - --digitalocean-region "nyc3" 是选择部署Droplet的区域 - --digitalocean-size "512mb" 是选择内存大小和部署的类型 +- --digitalocean-image "ubuntu-14-04-x64" 用于选择Droplet的镜像 +- --digitalocean-ipv6 enable 启用IPv6网络支持 +- --digitalocean-private-networking enable 启用专用网络 +- --digitalocean-region "nyc3" 选择部署Droplet的区域 +- --digitalocean-size "512mb" 选择内存大小和部署的类型 如果你想在其他云服务使用docker-machine,并且想覆盖默认的配置,可以运行如下命令来获取Docker Mackine默认支持的对每种平台适用的参数。 # docker-machine create -h -### 3. 选择活跃机器 ### +### 3. 选择活跃主机 ### -部署Droplet后,我们想马上运行一个Docker容器,但在那之前,我们需要检查下活跃机器是否是我们需要的机器。可以运行如下命令查看。 +部署Droplet后,我们想马上运行一个Docker容器,但在那之前,我们需要检查下活跃主机是否是我们需要的机器。可以运行如下命令查看。 # docker-machine ls ![Docker Machine List](http://blog.linoxide.com/wp-content/uploads/2015/05/docker-machine-ls.png) -ACTIVE一列有“*”标记的是活跃机器。 +ACTIVE一列有“*”标记的是活跃主机。 -现在,如果我们想将活跃机器切换到需要的机器,运行如下命令: +现在,如果我们想将活跃主机切换到需要的主机,运行如下命令: # docker-machine active linux-dev -**注意**:这里,linux-dev是机器名,我们打算激活这个机器,并且在其中运行Docker容器。 +**注意**:这里,linux-dev是机器名,我们打算激活这个机器,并且在其上运行Docker容器。 ### 4. 运行一个Docker容器 ### -现在,我们已经选择了活跃机器,就可以运行Docker容器了。可以测试一下,运行一个busybox容器来执行`echo hello word`命令,这样就可以得到输出: +现在,我们已经选择了活跃主机,就可以运行Docker容器了。可以测试一下,运行一个busybox容器来执行`echo hello word`命令,这样就可以得到输出: # docker run busybox echo hello world @@ -98,9 +98,9 @@ SSH到机器上之后,我们可以在上边运行任何Docker容器。这里 # exit -### 5. 删除机器 ### +### 5. 删除主机 ### -删除在运行的机器以及它的所有镜像和容器,我们可以使用docker-machine rm命令: +删除在运行的主机以及它的所有镜像和容器,我们可以使用docker-machine rm命令: # docker-machine rm linux-dev @@ -112,15 +112,15 @@ SSH到机器上之后,我们可以在上边运行任何Docker容器。这里 ![Docker Machine Remove Check](http://blog.linoxide.com/wp-content/uploads/2015/05/docker-machine-remove-check.png) -### 6. 在不使用驱动的情况新增一个机器 ### +### 6. 在不使用驱动的情况新增一个主机 ### -我们可以在不使用驱动的情况往Docker增加一台机器,只需要一个URL。它可以使用一个已有机器的别名,所以我们就不需要每次在运行docker命令时输入完整的URL了。 +我们可以在不使用驱动的情况往Docker增加一台主机,只需要一个URL。它可以使用一个已有机器的别名,所以我们就不需要每次在运行docker命令时输入完整的URL了。 $ docker-machine create --url=tcp://104.131.50.36:2376 custombox -### 7. 管理机器 ### +### 7. 管理主机 ### -如果你已经让Docker运行起来了,可以使用简单的**docker-machine stop**命令来停止所有正在运行的机器,如果需要再启动的话可以运行**docker-machine start**: +如果你已经让Docker运行起来了,可以使用简单的**docker-machine stop**命令来停止所有正在运行的主机,如果需要再启动的话可以运行**docker-machine start**: # docker-machine stop # docker-machine start @@ -140,7 +140,7 @@ via: http://linoxide.com/linux-how-to/use-docker-machine-cloud-provider/ 作者:[Arun Pyasi][a] 译者:[goreliu](https://github.com/goreliu) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From f197a4f2d56699d8398e1878d86e8315bb707dcb Mon Sep 17 00:00:00 2001 From: ictlyh Date: Wed, 24 Jun 2015 12:25:43 +0800 Subject: [PATCH 456/965] [Translating] tech/20150615 How to combine two graphs on Cacti.md --- sources/tech/20150615 How to combine two graphs on Cacti.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20150615 How to combine two graphs on Cacti.md b/sources/tech/20150615 How to combine two graphs on Cacti.md index aeb2b2ea0c..6b13ccd612 100644 --- a/sources/tech/20150615 How to combine two graphs on Cacti.md +++ b/sources/tech/20150615 How to combine two graphs on Cacti.md @@ -1,3 +1,4 @@ +Translating by ictlyh How to combine two graphs on Cacti ================================================================================ [Cacti][1] a fantastic open source network monitoring system that is widely used to graph network elements like bandwidth, storage, processor and memory utilization. Using its web based interface, you can create and organize graphs easily. However, some advanced features like merging graphs, creating aggregate graphs using multiple sources, migration of Cacti to another server are not provided by default. You might need some experience with Cacti to pull these off. In this tutorial, we will see how we can merge two Cacti graphs into one. From 293a2d51f00d4d69a135382c24fa82cba9738b79 Mon Sep 17 00:00:00 2001 From: ictlyh Date: Wed, 24 Jun 2015 13:19:21 +0800 Subject: [PATCH 457/965] [Translated] tech/20150615 How to combine two graphs on Cacti.md --- ...0615 How to combine two graphs on Cacti.md | 92 ------------------- ...0615 How to combine two graphs on Cacti.md | 92 +++++++++++++++++++ 2 files changed, 92 insertions(+), 92 deletions(-) delete mode 100644 sources/tech/20150615 How to combine two graphs on Cacti.md create mode 100644 translated/tech/20150615 How to combine two graphs on Cacti.md diff --git a/sources/tech/20150615 How to combine two graphs on Cacti.md b/sources/tech/20150615 How to combine two graphs on Cacti.md deleted file mode 100644 index 6b13ccd612..0000000000 --- a/sources/tech/20150615 How to combine two graphs on Cacti.md +++ /dev/null @@ -1,92 +0,0 @@ -Translating by ictlyh -How to combine two graphs on Cacti -================================================================================ -[Cacti][1] a fantastic open source network monitoring system that is widely used to graph network elements like bandwidth, storage, processor and memory utilization. Using its web based interface, you can create and organize graphs easily. However, some advanced features like merging graphs, creating aggregate graphs using multiple sources, migration of Cacti to another server are not provided by default. You might need some experience with Cacti to pull these off. In this tutorial, we will see how we can merge two Cacti graphs into one. - -Consider this example. Client-A has been connected to port 5 of switch-A for the last six months. Port 5 becomes faulty, and so the client is migrated to Port 6. As Cacti uses different graphs for each interface/element, the bandwidth history of the client would be split into port 5 and port 6. So we end up with two graphs for one client - one with six months' worth of old data, and the other that contains ongoing data. - -In such cases, we can actually combine the two graphs so the old data is appended to the new graph, and we get to keep a single graph containing historic and new data for one customer. This tutorial will explain exactly how we can achieve that. - -Cacti stores the data of each graph in its own RRD (round robin database) file. When a graph is requested, the values stored in a corresponding RRD file are used to generate the graph. RRD files are stored in `/var/lib/cacti/rra` in Ubuntu/Debian systems and in `/var/www/cacti/rra` in CentOS/RHEL systems. - -The idea behind merging graphs is to alter these RRD files so the values from the old RRD file are appended to the new RRD file. - -### Scenario ### - -The services for a client is running on eth0 for over a year. Because of hardware failure, the client has been migrated to eth1 interface of another server. We want to graph the bandwidth of the new interface, while retaining the historic data for over a year. The client would see only one graph. - -### Identifying the RRD for the Graph ### - -The first step during graph merging is to identify the RRD file associated with a graph. We can check the file by opening the graph in debug mode. To do this, go to Cacti's menu: Console > Graph Management > Select Graph > Turn On Graph Debug Mode. - -#### Old graph: #### - -![](https://farm4.staticflickr.com/3853/18795518096_f50a78d082_c.jpg) - -#### New graph: #### - -![](https://farm4.staticflickr.com/3674/18634036918_5c4118c4b9_c.jpg) - -From the example output (which is based on a Debian system), we can identify the RRD files for two graphs: - -- **Old graph**: /var/lib/cacti/rra/old_graph_traffic_in_8.rrd -- **New graph**: /var/lib/cacti/rra/new_graph_traffic_in_10.rrd - -### Preparing a Script ### - -We will merge two RRD files using a [RRD splice script][2]. Download this PHP script, and install it as /var/lib/cacti/rra/rrdsplice.php (for Debian/Ubuntu) or /var/www/cacti/rra/rrdsplice.php (for CentOS/RHEL). - -Next, make sure that the file is owned by Apache user. - -On Debian or Ubuntu, run the following command: - - # chown www-data:www-data rrdsplice.php - -and update rrdsplice.php accordingly. Look for the following line: - - chown($finrrd, "apache"); - -and replace it with: - - chown($finrrd, "www-data"); - -On CentOS or RHEL, run the following command: - - # chown apache:apache rrdsplice.php - -### Merging Two Graphs ### - -The syntax usage of the script can easily be found by running it without any parameters. - - # cd /path/to/rrdsplice.php - # php rrdsplice.php - ----------- - - USAGE: rrdsplice.php --oldrrd=file --newrrd=file --finrrd=file - -Now we are ready to merge two RRD files. Simply supply the names of an old RRD file and a new RRD file. We will overwrite the merged result back to the new RRD file. - - # php rrdsplice.php --oldrrd=old_graph_traffic_in_8.rrd --newrrd=new_graph_traffic_in_10.rrd --finrrd=new_graph_traffic_in_10.rrd - -Now the data from the old RRD file should be appended to the new RRD. Any new data will continue to be written by Cacti to the new RRD file. If we click on the graph, we should be able to verify that the weekly, monthly and yearly records have also been added from the old graph. The second graph in the following diagram shows weekly records from the old graph. - -![](https://farm6.staticflickr.com/5493/18821787015_6730164068_b.jpg) - -To sum up, this tutorial showed how we can easily merge two Cacti graphs into one. This trick is useful when a service is migrated to another device/interface and we want to deal with only one graph instead of two. The script is very handy as it can join graphs regardless of the source device e.g., Cisco 1800 router and Cisco 2960 switch. - -Hope this helps. - --------------------------------------------------------------------------------- - -via: http://xmodulo.com/combine-two-graphs-cacti.html - -作者:[Sarmed Rahman][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://xmodulo.com/author/sarmed -[1]:http://xmodulo.com/install-configure-cacti-linux.html -[2]:http://svn.cacti.net/viewvc/developers/thewitness/rrdsplice/rrdsplice.php \ No newline at end of file diff --git a/translated/tech/20150615 How to combine two graphs on Cacti.md b/translated/tech/20150615 How to combine two graphs on Cacti.md new file mode 100644 index 0000000000..49abbf76d1 --- /dev/null +++ b/translated/tech/20150615 How to combine two graphs on Cacti.md @@ -0,0 +1,92 @@ +如何在 Cacti 中合并两幅图片 +================================================================================ +[Cacti][1] 是一个很棒的开源网络监视系统,它广泛使用于图示网络元素,例如带宽、存储、处理器和内存使用。使用它的基于网络的接口,你可以轻松地创建和组织图。然而,默认并没有提供一些高级功能,例如合并图片、使用多个来源创建聚合图、迁移 Cacti 到另一台服务器。使用 Cacti 的这些功能你还需要一些经验。在该教程中,我们会看到如何在将两幅 Cacti 图片合并为一幅。 + +考虑这个例子。在过去的 6 个月中,客户端 A 连接到了交换机 A 的端口 5。端口 5 发生了错误,因此客户端迁移到了端口 6。由于 Cacti 为每个接口/元素使用不同的图,客户端的带宽历史会分成端口 5 和端口 6。结果是对于一个客户端我们有两幅图片 - 一幅是 6 个月的旧数据,另一幅保存了后续的数据。 + +在这种情况下,我们实际上可以合并两幅图片将旧数据加到新的图中,使得用一个单独的图为一个用户保存历史的和新数据。该教程将会解释如何做到这一点。 + +Cacti 将每幅图片的数据保存在它自己的 RRD(round robin database,循环数据库) 文件中。当请求一幅图片时,根据保存在对应 RRD 文件中的值生成图。在 Ubuntu/Debian 系统中,RRD 文件保存在 `/var/lib/cacti/rra`,在 CentOS/RHEL 系统中则是 `/var/www/cacti/rra`。 + +合并图片背后的思想是更改这些 RRD 文件使得旧 RRD 文件中的值能追加到新的 RRD 文件中。 + +### 情景 ### + +一个客户端的服务在 eth0 上运行了超过一年。由于硬件损坏,客户端迁移到了另一台服务器的 eth1 接口。我们想图示新接口的带宽,同时保留超过一年的历史数据。只在一幅图中显示客户端。 + +### 确定图的 RRD 文件 ### + +图合并的首个步骤是确定和图关联的 RRD 文件。我们可以通过以调试模式打开图检查文件。要做到这点,在 Cacti 的菜单中: 控制台 > 管理图 > 选择图 > 打开图调试模式。 + +#### 旧图: #### + +![](https://farm4.staticflickr.com/3853/18795518096_f50a78d082_c.jpg) + +#### 新图: #### + +![](https://farm4.staticflickr.com/3674/18634036918_5c4118c4b9_c.jpg) + +从样例输出(基于 Debian 系统)中,我们可以确定两幅图片的 RRD 文件: +From the example output (which is based on a Debian system), we can identify the RRD files for two graphs: + +- **旧图**: /var/lib/cacti/rra/old_graph_traffic_in_8.rrd +- **新图**: /var/lib/cacti/rra/new_graph_traffic_in_10.rrd + +### 准备脚本 ### + +我们会用一个 [RRD 剪接脚本][2] 合并两个 RRD 文件。下载该 PHP 脚本,并安装为 /var/lib/cacti/rra/rrdsplice.php (Debian/Ubuntu 系统) 或 /var/www/cacti/rra/rrdsplice.php (CentOS/RHEL 系统)。 + +下一步,确认 Apache 用户拥有该文件。 + +在 Debian 或 Ubuntu 系统中,运行下面的命令: + + # chown www-data:www-data rrdsplice.php + +并更新 rrdsplice.php。查找下面的行: + + chown($finrrd, "apache"); + +用下面的语句替换: + + chown($finrrd, "www-data"); + +在 CentOS 或 RHEL 系统中,运行下面的命令: + + # chown apache:apache rrdsplice.php + +### 合并两幅图 ### + +通过不带任何参数运行该脚本可以获得脚本的使用语法。 + + # cd /path/to/rrdsplice.php + # php rrdsplice.php + +---------- + + USAGE: rrdsplice.php --oldrrd=file --newrrd=file --finrrd=file + +现在我们准备好合并两个 RRD 文件了。只需要指定旧 RRD 文件和新 RRD 文件的名称。我们会将合并后的结果重写到新 RRD 文件中。 + + # php rrdsplice.php --oldrrd=old_graph_traffic_in_8.rrd --newrrd=new_graph_traffic_in_10.rrd --finrrd=new_graph_traffic_in_10.rrd + +现在旧 RRD 文件中的数据已经追加到了新 RRD 文件中。Cacti 会将任何新数据写到新 RRD 文件中。如果我们点击图,我们可以发现也已经添加了旧图的周、月、年记录。下面图表中的第二幅图显示了旧图的周记录。 + +![](https://farm6.staticflickr.com/5493/18821787015_6730164068_b.jpg) + +总之,该教程显示了如何简单地将两幅 Cacti 图片合并为一幅。当服务迁移到另一个设备/接口,我们希望只处理一幅图片而不是两幅时,这个小技巧非常有用。该脚本非常方便,因为它可以不管源设备合并图片,例如 Cisco 1800 路由器和 Cisco 2960 交换机。 + +希望这些能对你有所帮助。 + +-------------------------------------------------------------------------------- + +via: http://xmodulo.com/combine-two-graphs-cacti.html + +作者:[Sarmed Rahman][a] +译者:[ictlyh](https://github.com/ictlyh) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://xmodulo.com/author/sarmed +[1]:http://xmodulo.com/install-configure-cacti-linux.html +[2]:http://svn.cacti.net/viewvc/developers/thewitness/rrdsplice/rrdsplice.php \ No newline at end of file From 99cae4e77407ce83c4293168b088853f299402ad Mon Sep 17 00:00:00 2001 From: ictlyh Date: Wed, 24 Jun 2015 16:38:14 +0800 Subject: [PATCH 458/965] [Translated] tech/20150615 How to combine two graphs on Cacti.md --- translated/tech/20150615 How to combine two graphs on Cacti.md | 1 - 1 file changed, 1 deletion(-) diff --git a/translated/tech/20150615 How to combine two graphs on Cacti.md b/translated/tech/20150615 How to combine two graphs on Cacti.md index 49abbf76d1..db320b204e 100644 --- a/translated/tech/20150615 How to combine two graphs on Cacti.md +++ b/translated/tech/20150615 How to combine two graphs on Cacti.md @@ -27,7 +27,6 @@ Cacti 将每幅图片的数据保存在它自己的 RRD(round robin database,循 ![](https://farm4.staticflickr.com/3674/18634036918_5c4118c4b9_c.jpg) 从样例输出(基于 Debian 系统)中,我们可以确定两幅图片的 RRD 文件: -From the example output (which is based on a Debian system), we can identify the RRD files for two graphs: - **旧图**: /var/lib/cacti/rra/old_graph_traffic_in_8.rrd - **新图**: /var/lib/cacti/rra/new_graph_traffic_in_10.rrd From 89ac8064c98f57fbf03bbaef065ce1fb4be4fd46 Mon Sep 17 00:00:00 2001 From: ictlyh Date: Wed, 24 Jun 2015 17:09:55 +0800 Subject: [PATCH 459/965] [Translating] tech/20150318 How to Manage and Use LVM (Logical Volume Management) in Ubuntu.md --- ...o Manage and Use LVM (Logical Volume Management) in Ubuntu.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20150318 How to Manage and Use LVM (Logical Volume Management) in Ubuntu.md b/sources/tech/20150318 How to Manage and Use LVM (Logical Volume Management) in Ubuntu.md index ecfb639d54..35f5e5db7e 100644 --- a/sources/tech/20150318 How to Manage and Use LVM (Logical Volume Management) in Ubuntu.md +++ b/sources/tech/20150318 How to Manage and Use LVM (Logical Volume Management) in Ubuntu.md @@ -1,3 +1,4 @@ +Translating by ictlyh How to Manage and Use LVM (Logical Volume Management) in Ubuntu ================================================================================ ![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/652x202xbanner-1.png.pagespeed.ic.VGSxDeVS9P.png) From ee5be1808b9c96f1700a931c5f4369f8ec887e90 Mon Sep 17 00:00:00 2001 From: ictlyh Date: Thu, 25 Jun 2015 10:36:08 +0800 Subject: [PATCH 460/965] [Translated] tech/20150318 How to Manage and Use LVM (Logical Volume Management) in Ubuntu.md --- ...M (Logical Volume Management) in Ubuntu.md | 269 ------------------ ...M (Logical Volume Management) in Ubuntu.md | 268 +++++++++++++++++ 2 files changed, 268 insertions(+), 269 deletions(-) delete mode 100644 sources/tech/20150318 How to Manage and Use LVM (Logical Volume Management) in Ubuntu.md create mode 100644 translated/tech/20150318 How to Manage and Use LVM (Logical Volume Management) in Ubuntu.md diff --git a/sources/tech/20150318 How to Manage and Use LVM (Logical Volume Management) in Ubuntu.md b/sources/tech/20150318 How to Manage and Use LVM (Logical Volume Management) in Ubuntu.md deleted file mode 100644 index 35f5e5db7e..0000000000 --- a/sources/tech/20150318 How to Manage and Use LVM (Logical Volume Management) in Ubuntu.md +++ /dev/null @@ -1,269 +0,0 @@ -Translating by ictlyh -How to Manage and Use LVM (Logical Volume Management) in Ubuntu -================================================================================ -![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/652x202xbanner-1.png.pagespeed.ic.VGSxDeVS9P.png) - -In our [previous article we told you what LVM is and what you may want to use it for][1], and today we are going to walk you through some of the key management tools of LVM so you will be confident when setting up or expanding your installation. - -As stated before, LVM is a abstraction layer between your operating system and physical hard drives. What that means is your physical hard drives and partitions are no longer tied to the hard drives and partitions they reside on. Rather, the hard drives and partitions that your operating system sees can be any number of separate hard drives pooled together or in a software RAID. - -To manage LVM there are GUI tools available but to really understand what is happening with your LVM configuration it is probably best to know what the command line tools are. This will be especially useful if you are managing LVM on a server or distribution that does not offer GUI tools. - -Most of the commands in LVM are very similar to each other. Each valid command is preceded by one of the following: - -- Physical Volume = pv -- Volume Group = vg -- Logical Volume = lv - -The physical volume commands are for adding or removing hard drives in volume groups. Volume group commands are for changing what abstracted set of physical partitions are presented to your operating in logical volumes. Logical volume commands will present the volume groups as partitions so that your operating system can use the designated space. - -### Downloadable LVM Cheat Sheet ### - -To help you understand what commands are available for each prefix we made a LVM cheat sheet. We will cover some of the commands in this article, but there is still a lot you can do that won’t be covered here. - -All commands on this list will need to be run as root because you are changing system wide settings that will affect the entire machine. - -![](http://cdn5.howtogeek.com/wp-content/uploads/2011/01/lvm-cheatsheet.png) - -### How to View Current LVM Information ### - -The first thing you may need to do is check how your LVM is set up. The s and display commands work with physical volumes (pv), volume groups (vg), and logical volumes (lv) so it is a good place to start when trying to figure out the current settings. - -The display command will format the information so it’s easier to understand than the s command. For each command you will see the name and path of the pv/vg and it should also give information about free and used space. - -![](http://cdn5.howtogeek.com/wp-content/uploads/2011/01/539x225xpvdisplay.png.pagespeed.ic.u2XV5LBTYa.png) - -The most important information will be the PV name and VG name. With those two pieces of information we can continue working on the LVM setup. - -### Creating a Logical Volume ### - -Logical volumes are the partitions that your operating system uses in LVM. To create a logical volume we first need to have a physical volume and volume group. Here are all of the steps necessary to create a new logical volume. - -#### Create physical volume #### - -We will start from scratch with a brand new hard drive with no partitions or information on it. Start by finding which disk you will be working with. (/dev/sda, sdb, etc.) - -> Note: Remember all of the commands will need to be run as root or by adding ‘sudo’ to the beginning of the command. - - fdisk -l - -If your hard drive has never been formatted or partitioned before you will probably see something like this in the fdisk output. This is completely fine because we are going to create the needed partitions in the next steps. - -![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/fdisk.png.pagespeed.ce.AmAEsxm-7Q.png) - -Our new disk is located at /dev/sdb so lets use fdisk to create a new partition on the drive. - -There are a plethora of tools that can create a new partition with a GUI, [including Gparted][2], but since we have the terminal open already, we will use fdisk to create the needed partition. - -From a terminal type the following commands: - - fdisk /dev/sdb - -This will put you in a special fdisk prompt. - -![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/627x145xfdisk00.png.pagespeed.ic.I7S8bjoXQG.png) - -Enter the commands in the order given to create a new primary partition that uses 100% of the new hard drive and is ready for LVM. If you need to change the partition size or want multiple partions I suggest using GParted or reading about fdisk on your own. - -**Warning: The following steps will format your hard drive. Make sure you don’t have any information on this hard drive before following these steps.** - -- n = create new partition -- p = creates primary partition -- 1 = makes partition the first on the disk - -Push enter twice to accept the default first cylinder and last cylinder. - -![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/562x216xfdisk01.png.pagespeed.ic.DsSZ38kWcA.png) - -To prepare the partition to be used by LVM use the following two commands. - -- t = change partition type -- 8e = changes to LVM partition type - -Verify and write the information to the hard drive. - -- p = view partition setup so we can review before writing changes to disk -- w = write changes to disk - -![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/560x339xfdisk03.png.pagespeed.ic.FC8foICZsb.png) - -After those commands, the fdisk prompt should exit and you will be back to the bash prompt of your terminal. - -Enter pvcreate /dev/sdb1 to create a LVM physical volume on the partition we just created. - -You may be asking why we didn’t format the partition with a file system but don’t worry, that step comes later. - -![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/pvcreate.png.pagespeed.ce.W7VAr-ig3t.png) - -#### Create volume Group #### - -Now that we have a partition designated and physical volume created we need to create the volume group. Luckily this only takes one command. - - vgcreate vgpool /dev/sdb1 - -![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/vgcreate.png.pagespeed.ce.fVLzSmPZou.png) - -Vgpool is the name of the new volume group we created. You can name it whatever you’d like but it is recommended to put vg at the front of the label so if you reference it later you will know it is a volume group. - -#### Create logical volume #### - -To create the logical volume that LVM will use: - - lvcreate -L 3G -n lvstuff vgpool - -![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/lvcreate.png.pagespeed.ce.vupLB-LJEW.png) - -The -L command designates the size of the logical volume, in this case 3 GB, and the -n command names the volume. Vgpool is referenced so that the lvcreate command knows what volume to get the space from. - -#### Format and Mount the Logical Volume #### - -One final step is to format the new logical volume with a file system. If you want help choosing a Linux file system, read our [how to that can help you choose the best file system for your needs][3]. - - mkfs -t ext3 /dev/vgpool/lvstuff - -![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/571x424xmkfs.png.pagespeed.ic.ERMan1Mz0P.png) - -Create a mount point and then mount the volume somewhere you can use it. - - mkdir /mnt/stuff - mount -t ext3 /dev/vgpool/lvstuff /mnt/stuff - -![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/510x69xmount.png.pagespeed.ic.k0i1tvqgcV.png) - -#### Resizing a Logical Volume #### - -One of the benefits of logical volumes is you can make your shares physically bigger or smaller without having to move everything to a bigger hard drive. Instead, you can add a new hard drive and extend your volume group on the fly. Or if you have a hard drive that isn’t used you can remove it from the volume group to shrink your logical volume. - -There are three basic tools for making physical volumes, volume groups, and logical volumes bigger or smaller. - -Note: Each of these commands will need to be preceded by pv, vg, or lv depending on what you are working with. - -- resize – can shrink or expand physical volumes and logical volumes but not volume groups -- extend – can make volume groups and logical volumes bigger but not smaller -- reduce – can make volume groups and logical volumes smaller but not bigger - -Let’s walk through an example of how to add a new hard drive to the logical volume “lvstuff” we just created. - -#### Install and Format new Hard Drive #### - -To install a new hard drive follow the steps above to create a new partition and add change it’s partition type to LVM (8e). Then use pvcreate to create a physical volume that LVM can recognize. - -#### Add New Hard Drive to Volume Group #### - -To add the new hard drive to a volume group you just need to know what your new partition is, /dev/sdc1 in our case, and the name of the volume group you want to add it to. - -This will add the new physical volume to the existing volume group. - - vgextend vgpool /dev/sdc1 - -![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/vgextend.png.pagespeed.ce.atRPT1yg5f.png) - -#### Extend Logical Volume #### - -To resize the logical volume we need to say how much we want to extend by size instead of by device. In our example we just added a 8 GB hard drive to our 3 GB vgpool. To make that space usable we can use lvextend or lvresize. - - lvextend -L8G /dev/vgpool/lvstuff - -![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/lvextend1.png.pagespeed.ce.6scXbQVUTT.png) - -While this command will work you will see that it will actually resize our logical volume to 8 GB instead of adding 8 GB to the existing volume like we wanted. To add the last 3 available gigabytes you need to use the following command. - - lvextend -L+3G /dev/vgpool/lvstuff - -![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/430x85xlvextend2.png.pagespeed.ic.7aBiTBrW03.png) - -Now our logical volume is 11 GB in size. - -#### Extend File System #### - -The logical volume is 11 GB but the file system on that volume is still only 3 GB. To make the file system use the entire 11 GB available you have to use the command resize2fs. Just point resize2fs to the 11 GB logical volume and it will do the magic for you. - - resize2fs /dev/vgpool/lvstuff - -![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/650x150xresize2fs.png.pagespeed.ic.Mx74EdMuk_.png) - -**Note: If you are using a different file system besides ext3/4 please see your file systems resize tools.** - -#### Shrink Logical Volume #### - -If you wanted to remove a hard drive from a volume group you would need to follow the above steps in reverse order and use lvreduce and vgreduce instead. - -1. resize file system (make sure to move files to a safe area of the hard drive before resizing) -1. reduce logical volume (instead of + to extend you can also use – to reduce by size) -1. remove hard drive from volume group with vgreduce - -#### Backing up a Logical Volume #### - -Snapshots is a feature that some newer advanced file systems come with but ext3/4 lacks the ability to do snapshots on the fly. One of the coolest things about LVM snapshots is your file system is never taken offline and you can have as many as you want without taking up extra hard drive space. - -![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/652x202xbanner-2.png.pagespeed.ic.VtOUuqYX1W.png) - -When LVM takes a snapshot, a picture is taken of exactly how the logical volume looks and that picture can be used to make a copy on a different hard drive. While a copy is being made, any new information that needs to be added to the logical volume is written to the disk just like normal, but changes are tracked so that the original picture never gets destroyed. - -To create a snapshot we need to create a new logical volume with enough free space to hold any new information that will be written to the logical volume while we make a backup. If the drive is not actively being written to you can use a very small amount of storage. Once we are done with our backup we just remove the temporary logical volume and the original logical volume will continue on as normal. - -#### Create New Snapshot #### - -To create a snapshot of lvstuff use the lvcreate command like before but use the -s flag. - - lvcreate -L512M -s -n lvstuffbackup /dev/vgpool/lvstuff - -![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/597x68xlvcreate-snapshot.png.pagespeed.ic.Rw2ivtcpPg.png) - -Here we created a logical volume with only 512 MB because the drive isn’t being actively used. The 512 MB will store any new writes while we make our backup. - -#### Mount New Snapshot #### - -Just like before we need to create a mount point and mount the new snapshot so we can copy files from it. - - mkdir /mnt/lvstuffbackup - mount /dev/vgpool/lvstuffbackup /mnt/lvstuffbackup - -![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/565x68xmount-snapshot.png.pagespeed.ic.pVMkhK1o4x.png) - -#### Copy Snapshot and Delete Logical Volume #### - -All you have left to do is copy all of the files from /mnt/lvstuffbackup/ to an external hard drive or tar it up so it is all in one file. - -**Note: tar -c will create an archive and -f will say the location and file name of the archive. For help with the tar command use man tar in the terminal.** - - tar -cf /home/rothgar/Backup/lvstuff-ss /mnt/lvstuffbackup/ - -![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/627x67xsnapshot-backup.png.pagespeed.ic.tw-2AK_lfZ.png) - -Remember that while the backup is taking place all of the files that would be written to lvstuff are being tracked in the temporary logical volume we created earlier. Make sure you have enough free space while the backup is happening. - -Once the backup finishes, unmount the volume and remove the temporary snapshot. - - umount /mnt/lvstuffbackup - lvremove /dev/vgpool/lvstuffbackup/ - -![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/630x102xlvremove.png.pagespeed.ic.yBWk47X6lF.png) - -#### Deleting a Logical Volume #### - -To delete a logical volume you need to first make sure the volume is unmounted, and then you can use lvremove to delete it. You can also remove a volume group once the logical volumes have been deleted and a physical volume after the volume group is deleted. - -Here are all the commands using the volumes and groups we’ve created. - - umount /mnt/lvstuff - lvremove /dev/vgpool/lvstuff - vgremove vgpool - pvremove /dev/sdb1 /dev/sdc1 - -![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/580x185xdelete-lvm.png.pagespeed.ic.3zJTo0Zu9k.png) - -That should cover most of what you need to know to use LVM. If you’ve got some experience on the topic, be sure to share your wisdom in the comments. - --------------------------------------------------------------------------------- - -via: http://www.howtogeek.com/howto/40702/how-to-manage-and-use-lvm-logical-volume-management-in-ubuntu/ - -译者:[runningwater](https://github.com/runningwater) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[1]:http://www.howtogeek.com/howto/36568/what-is-logical-volume-management-and-how-do-you-enable-it-in-ubuntu/ -[2]:http://www.howtogeek.com/howto/17001/how-to-format-a-usb-drive-in-ubuntu-using-gparted/ -[3]:http://www.howtogeek.com/howto/33552/htg-explains-which-linux-file-system-should-you-choose/ \ No newline at end of file diff --git a/translated/tech/20150318 How to Manage and Use LVM (Logical Volume Management) in Ubuntu.md b/translated/tech/20150318 How to Manage and Use LVM (Logical Volume Management) in Ubuntu.md new file mode 100644 index 0000000000..c3a84f5fcf --- /dev/null +++ b/translated/tech/20150318 How to Manage and Use LVM (Logical Volume Management) in Ubuntu.md @@ -0,0 +1,268 @@ +如何在 Ubuntu 中管理和使用 LVM(Logical Volume Management,逻辑卷管理) +================================================================================ +![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/652x202xbanner-1.png.pagespeed.ic.VGSxDeVS9P.png) + +在我们之前的文章中,我们介绍了[什么是 LVM 以及能用 LVM 做什么][1],今天我们会给你介绍一些 LVM 的主要管理工具,使得你在设置和扩展安装时更游刃有余。 + +正如之前所述,LVM 是介于你的操作系统和物理硬盘驱动器之间的抽象层。这意味着你的物理硬盘驱动器和分区不再依赖于他们所在的硬盘驱动和分区。而是,你的操作系统所见的硬盘驱动和分区可以是由任意数目的独立硬盘驱动汇集而成或是一个软件磁盘阵列。 + +要管理 LVM,这里有很多可用的 GUI 工具,但要真正理解 LVM 配置发生的事情,最好要知道一些命令行工具。这当你在一个服务器或不提供 GUI 工具的发行版上管理 LVM 时尤为有用。 + +LVM 的大部分命令和彼此都非常相似。每个可用的命令都由以下其中之一开头: + +- Physical Volume = pv +- Volume Group = vg +- Logical Volume = lv + +物理卷命令用于在卷组中添加或删除硬盘驱动。卷组命令用于为你的逻辑卷操作更改显示的物理分区抽象集。逻辑卷命令会以分区形式显示卷组使得你的操作系统能使用指定的空间。 + +### 可下载的 LVM 备忘单 ### + +为了帮助你理解每个前缀可用的命令,我们制作了一个备忘单。我们会在该文章中介绍一些命令,但仍有很多你可用但没有介绍到的命令。 + +该列表中的所有命令都要以 root 身份运行,因为你更改的是会影响整个机器系统级设置。 + +![](http://cdn5.howtogeek.com/wp-content/uploads/2011/01/lvm-cheatsheet.png) + +### 如何查看当前 LVM 信息 ### + +你首先需要做的事情是检查你的 LVM 设置。s 和 display 命令和物理卷(pv)、卷组(vg)以及逻辑卷(lv)一起使用,是一个找出当前设置好的开始点。 + +display 命令会格式化输出信息,因此比 s 命令更易于理解。对每个命令你会看到名称和 pv/vg 的路径,它还会给出空闲和已使用空间的信息。 + +![](http://cdn5.howtogeek.com/wp-content/uploads/2011/01/539x225xpvdisplay.png.pagespeed.ic.u2XV5LBTYa.png) + +最重要的信息是 PV 名称和 VG 名称。用这两部分信息我们可以继续进行 LVM 设置。 + +### 创建一个逻辑卷 ### + +逻辑卷是你的操作系统在 LVM 中使用的分区。创建一个逻辑卷,首先需要拥有一个物理卷和卷组。下面是创建一个新的逻辑卷所需要的全部命令。 + +#### 创建物理卷 #### + +我们会从一个完全新的没有任何分区和信息的硬盘驱动开始。首先找出你将要使用的磁盘。(/dev/sda, sdb, 等) + +> 注意:记住所有的命令都要以 root 身份运行或者在命令前面添加 'sudo' 。 + + fdisk -l + +如果之前你的硬盘驱动从没有格式化或分区,在 fdisk 的输出中你很可能看到类似下面的信息。这完全正常,因为我们会在下面的步骤中创建需要的分区。 + +![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/fdisk.png.pagespeed.ce.AmAEsxm-7Q.png) + +我们的新磁盘位置是 /dev/sdb,让我们用 fdisk 命令在驱动上创建一个新的分区。 + +这里有大量能创建新分区的 GUI 工具,包括 [Gparted][2],但由于我们已经打开了终端,我们将使用 fdisk 命令创建需要的分区。 + +在终端中输入以下命令: + + fdisk /dev/sdb + +这会使你进入到一个特殊的 fdisk 提示符中。 + +![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/627x145xfdisk00.png.pagespeed.ic.I7S8bjoXQG.png) + +以指定的顺序输入命令创建一个使用新硬盘驱动 100% 空间的主分区并为 LVM 做好了准备。如果你需要更改分区的大小或相应多个分区,我建议使用 GParted 或自己了解关于 fdisk 命令的使用。 + +**警告:下面的步骤会格式化你的硬盘驱动。确保在进行下面步骤之前你的硬盘驱动中没有任何信息。** + +- n = 创建新分区 +- p = 创建主分区 +- 1 = 成为磁盘上的首个分区 + +输入 enter 键两次以接受默认的第一个和最后一个柱面。 + +![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/562x216xfdisk01.png.pagespeed.ic.DsSZ38kWcA.png) + +用下面的命令准备 LVM 所使用的分区。 + +- t = 更改分区类型 +- 8e = 更改为 LVM 分区类型 + +核实并将信息写入硬盘驱动器。 + +- p = 查看分区设置使得写入更改到磁盘之前可以回看 +- w = 写入更改到磁盘 + +![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/560x339xfdisk03.png.pagespeed.ic.FC8foICZsb.png) + +运行这些命令之后,会退出 fdisk 提示符并返回到终端的 bash 提示符中。 + +输入 pvcreate /dev/sdb1 在刚创建的分区上新建一个 LVM 物理卷。 + +你也许会问为什么我们不用一个文件系统格式化分区,不用担心,该步骤在后面。 + +![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/pvcreate.png.pagespeed.ce.W7VAr-ig3t.png) + +#### 创建卷组 #### + +现在我们有了一个指定的分区和创建好的物理卷,我们需要创建一个卷组。很幸运这只需要一个命令。 + + vgcreate vgpool /dev/sdb1 + +![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/vgcreate.png.pagespeed.ce.fVLzSmPZou.png) + +Vgpool 是新创建的卷组的名称。你可以使用任何你喜欢的名称,但建议标签以 vg 开头,以便后面你使用它时能意识到这是一个卷组。 + +#### 创建逻辑卷 #### + +创建 LVM 将使用的逻辑卷: + + lvcreate -L 3G -n lvstuff vgpool + +![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/lvcreate.png.pagespeed.ce.vupLB-LJEW.png) + +-L 命令指定逻辑卷的大小,在该情况中是 3 GB,-n 命令指定卷的名称。 指定 vgpool 所以 lvcreate 命令知道从什么卷获取空间。 + +#### 格式化并挂载逻辑卷 #### + +最后一步是用一个文件系统格式化新的逻辑卷。如果你需要选择一个 Linux 文件系统的帮助,请阅读 [如果根据需要选取最合适的文件系统][3]。 + + mkfs -t ext3 /dev/vgpool/lvstuff + +![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/571x424xmkfs.png.pagespeed.ic.ERMan1Mz0P.png) + +创建挂载点并将卷挂载到你可以使用的地方。 + + mkdir /mnt/stuff + mount -t ext3 /dev/vgpool/lvstuff /mnt/stuff + +![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/510x69xmount.png.pagespeed.ic.k0i1tvqgcV.png) + +#### 重新设置逻辑卷大小 #### + +逻辑卷的一个好处是你能使你的共享物理变大或变小而不需要移动所有东西到一个更大的硬盘驱动。另外,你可以添加新的硬盘驱动并同时扩展你的卷组。或者如果你有一个不使用的硬盘驱动,你可以从卷组中移除它使得逻辑卷变小。 + +这里有三个用于使物理卷、卷组和逻辑卷变大或变小的基础工具。 + +注意:这些命令中的每个都要以 pv、vg 或 lv 开头,取决于你的工作对象。 + +- resize – 能压缩或扩展物理卷和逻辑卷,但卷组不能 +- extend – 能使卷组和逻辑卷变大但不能变小 +- reduce – 能使卷组和逻辑卷变小但不能变大 + +让我们来看一个如何向刚创建的逻辑卷 "lvstuff" 添加新硬盘驱动的例子。 + +#### 安装并格式化新硬盘驱动 #### + +按照上面创建新分区并更改分区类型为 LVM(8e) 的步骤安装一个新硬盘驱动。然后用 pvcreate 命令创建一个 LVM 能识别的物理卷。 + +#### 添加新硬盘驱动到卷组 #### + +要添加新的硬盘驱动到一个卷组,你只需要知道你的新分区,在我们的例子中是 /dev/sdc1,以及想要添加到的卷组的名称。 + +这会添加新物理卷到已存在的卷组中。 + + vgextend vgpool /dev/sdc1 + +![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/vgextend.png.pagespeed.ce.atRPT1yg5f.png) + +#### 扩展逻辑卷 #### + +调整逻辑卷的大小,我们需要指出的是通过大小而不是设备来扩展。在我们的例子中,我们会添加一个 8GB 的硬盘驱动到我们的 3GB vgpool。我们可以用 lvextend 或 lvresize 命令使该空间可用。 + + lvextend -L8G /dev/vgpool/lvstuff + +![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/lvextend1.png.pagespeed.ce.6scXbQVUTT.png) + +当这个命令工作的时候你会发现它实际上重新设置逻辑卷大小为 8GB 而不是我们期望的将 8GB 添加到已存在的卷上。要添加剩余的可用 3GB 你需要用下面的命令。 + + lvextend -L+3G /dev/vgpool/lvstuff + +![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/430x85xlvextend2.png.pagespeed.ic.7aBiTBrW03.png) + +现在我们的逻辑卷已经是 11GB 大小了。 + +#### 扩展文件系统 #### + +逻辑卷是 11GB 大小但是上面的文件系统仍然只有 3GB。要使文件系统使用整个的 11GB 可用空间你需要用 resize2fs 命令。你只需要指定 resize2fs 到 11GB 逻辑卷它就会帮你完成其余的工作。 + + resize2fs /dev/vgpool/lvstuff + +![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/650x150xresize2fs.png.pagespeed.ic.Mx74EdMuk_.png) + +**注意:如果你使用除 ext3/4 之外的文件系统,请查看调整你的文件系统大小的工具。** + +#### 压缩逻辑卷 #### + +如果你想从卷组中移除一个硬盘驱动你可以按照上面的步骤反向操作,并用 lvreduce 或 vgreduce 命令代替。 + +1. 调整文件系统大小 (调整之前确保已经移动文件到硬盘驱动安全的地方) +1. 减小逻辑卷 (除了 + 可以扩展大小,你也可以用 - 压缩大小) +1. 用 vgreduce 从卷组中移除硬盘驱动 + +#### 备份逻辑卷 #### + +快照是一些新的高级文件系统提供的功能,但是 ext3/4 文件系统并没有快照的功能。LVM 快照最棒的是你的文件系统永不掉线,你可以拥有你想要的任何大小而不需要额外的硬盘空间。 + +![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/652x202xbanner-2.png.pagespeed.ic.VtOUuqYX1W.png) + +LVM 获取快照的时候,会有一张和逻辑卷完全相同的照片,该照片可以用于在不同的硬盘驱动上进行备份。生成一个备份的时候,任何需要添加到逻辑卷的新信息会如往常一样写入磁盘,但会跟踪更改使得原始快照永远不会损毁。 + +要创建一个快照,我们需要创建拥有足够空闲空间的逻辑卷,用于保存我们备份的时候会写入该逻辑卷的任何新信息。如果驱动并不是经常写入,你可以使用很小的一个存储空间。备份完成的时候我们只需要移除临时逻辑卷,原始逻辑卷会和往常一样。 + +#### 创建新快照 #### + +创建 lvstuff 的快照,用带 -s 标记的 lvcreate 命令。 + + lvcreate -L512M -s -n lvstuffbackup /dev/vgpool/lvstuff + +![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/597x68xlvcreate-snapshot.png.pagespeed.ic.Rw2ivtcpPg.png) + +这里我们创建了一个只有 512MB 的逻辑卷,因为驱动实际上并不会使用。512MB 的空间会保存备份时产生的任何新数据。 + +#### 挂载新快照 #### + +和之前一样,我们需要创建一个挂载点并挂载新快照,然后才能从中复制文件。 + + mkdir /mnt/lvstuffbackup + mount /dev/vgpool/lvstuffbackup /mnt/lvstuffbackup + +![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/565x68xmount-snapshot.png.pagespeed.ic.pVMkhK1o4x.png) + +#### 复制快照和删除逻辑卷 #### + +你剩下需要做的是从 /mnt/lvstuffbackup/ 中复制所有文件到一个外部的硬盘驱动或者打包所有文件到一个文件。 + +**注意:tar -c 会创建一个归档文件,-f 要指出归档文件的名称和路径。要获取 tar 命令的帮助信息,可以在终端中输入 man tar。** + + tar -cf /home/rothgar/Backup/lvstuff-ss /mnt/lvstuffbackup/ + +![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/627x67xsnapshot-backup.png.pagespeed.ic.tw-2AK_lfZ.png) + +记住备份发生的时候写到 lvstuff 的所有文件都会在我们之前创建的临时逻辑卷中被跟踪。确保备份的时候你有足够的空闲空间。 + +备份完成后,卸载卷并移除临时快照。 + + umount /mnt/lvstuffbackup + lvremove /dev/vgpool/lvstuffbackup/ + +![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/630x102xlvremove.png.pagespeed.ic.yBWk47X6lF.png) + +#### 删除逻辑卷 #### + +要删除一个逻辑卷,你首先需要确保卷已经卸载,然后你可以用 lvremove 命令删除它。逻辑卷删除后你可以移除卷组,卷组删除后你可以删除物理卷。 + +这是所有移除我们创建的卷和组的命令。 + + umount /mnt/lvstuff + lvremove /dev/vgpool/lvstuff + vgremove vgpool + pvremove /dev/sdb1 /dev/sdc1 + +![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/580x185xdelete-lvm.png.pagespeed.ic.3zJTo0Zu9k.png) + +这些已经囊括了关于 LVM 你需要了解的大部分知识。如果你有任何关于这些讨论的经验,请在下面的评论框中和大家分享。 + +-------------------------------------------------------------------------------- + +via: http://www.howtogeek.com/howto/40702/how-to-manage-and-use-lvm-logical-volume-management-in-ubuntu/ + +译者:[ictlyh](https://github.com/ictlyh) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[1]:http://www.howtogeek.com/howto/36568/what-is-logical-volume-management-and-how-do-you-enable-it-in-ubuntu/ +[2]:http://www.howtogeek.com/howto/17001/how-to-format-a-usb-drive-in-ubuntu-using-gparted/ +[3]:http://www.howtogeek.com/howto/33552/htg-explains-which-linux-file-system-should-you-choose/ \ No newline at end of file From 06050a22dc6729ec666b4b1d78b291158fb522da Mon Sep 17 00:00:00 2001 From: wwy-hust Date: Thu, 25 Jun 2015 12:47:28 +0800 Subject: [PATCH 461/965] finish translation --- ...ser for Anonymous Web Browsing in Linux.md | 206 ------------------ ...ser for Anonymous Web Browsing in Linux.md | 206 ++++++++++++++++++ 2 files changed, 206 insertions(+), 206 deletions(-) delete mode 100644 sources/tech/20150617 Tor Browser--An Ultimate Web Browser for Anonymous Web Browsing in Linux.md create mode 100644 translated/tech/20150617 Tor Browser--An Ultimate Web Browser for Anonymous Web Browsing in Linux.md diff --git a/sources/tech/20150617 Tor Browser--An Ultimate Web Browser for Anonymous Web Browsing in Linux.md b/sources/tech/20150617 Tor Browser--An Ultimate Web Browser for Anonymous Web Browsing in Linux.md deleted file mode 100644 index 92fe36dae2..0000000000 --- a/sources/tech/20150617 Tor Browser--An Ultimate Web Browser for Anonymous Web Browsing in Linux.md +++ /dev/null @@ -1,206 +0,0 @@ -Tor Browser: An Ultimate Web Browser for Anonymous Web Browsing in Linux -================================================================================ -Most of us give a considerable time of ours to Internet. The primary Application we require to perform our internet activity is a browser, a web browser to be more perfect. Over Internet most of our’s activity is logged to Server/Client machine which includes IP address, Geographical Location, search/activity trends and a whole lots of Information which can potentially be very harmful, if used intentionally the other way. - -![Install Tor Browser in Linux](http://www.tecmint.com/wp-content/uploads/2014/04/Install-tor-browser-in-linux.jpg) - -Tor Browser: Anonymous Browsing - -Moreover the National Security Agency (NSA) aka International Spying Agency keeps tracks of ours digital footprints. Not to mention a restricted proxy server which again can be used as data ripping server is not the answer. And most of the corporates and companies wont allow you to access a proxy server. - -So, what we need here is an application, preferably small in size and let it be standalone, portable and which servers the purpose. Here comes an application – the Tor Browser, which has all the above discussed features and even beyond that. - -In this article we will be discussing Tor browser, its features, its usages and Area of Application, Installation and other important aspects of The Tor Browser Application. - -#### What is Tor Browser? #### - -Tor is a Freely distributed Application Software, released under BSD style Licensing which allows to surf Internet anonymously, through its safe and reliable onion like structure. Tor previously was called as ‘The Onion Router‘ because of its structure and functioning mechanism. This Application is written in C programming Language. - -#### Features of Tor Browser #### - -- Cross Platform Availability. i.e., this application is available for Linux, Windows as well as Mac. -- Complex Data encryption before it it sent over Internet. -- Automatic data decryption at client side. -- It is a combination of Firefox Browser + Tor Project. -- Provides anonymity to servers and websites. -- Makes it possible to visit locked websites. -- Performs task without revealing IP of Source. -- Capable of routing data to/from hidden services and application behind firewall. -- Portable – Run a preconfigured web browser directly from the USB storage Device. No need to install it locally. -- Available for architectures x86 and x86_64. -- Easy to set FTP with Tor using configuration as “socks4a” proxy on “localhost” port “9050” -- Tor is capable of handling thousands of relay and millions of users. - -#### How Tor Browser Works? #### - -Tor works on the concept of Onion routing. Onion routing resemble to onion in structure. In onion routing the layers are nested one over the other similar to the layers of onion. This nested layer is responsible for encrypting data several times and sends it through virtual circuits. On the client side each layer decrypt the data before passing it to the next level. The last layer decrypts the innermost layer of encrypted data before passing the original data to the destination. - -In this process of decryption all the layers function so intelligently that there is no need to reveal IP and Geographical location of User thus limiting any chance of anybody watching your internet connection or the sites you are visiting. - -All these working seems a bit complex, but the end user execution and working of Tor browser is nothing to worry about. In-fact Tor browser resembles any other browser (Especially Mozilla Firefox) in functioning. - -### Installation of Tor Browser in Linux ### - -As discussed above, Tor browser is available for Linux, Windows and Mac. The user need to download the latest version (i.e. Tor Browser 4.0.4) application from the link below as per their system and architecture. - -- [https://www.torproject.org/download/download-easy.html.en][1] - -After downloading the Tor browser, we need to install it. But the good thing with ‘Tor’ is that we don’t need to install it. It can run directly from a Pen Drive and the browser can be preconfigured. That means plug and Run Feature in perfect sense of Portability. - -After downloading the Tar-ball (*.tar.xz) we need to Extract it. - -**On 32-Bit System** - - $ wget https://www.torproject.org/dist/torbrowser/4.0.4/tor-browser-linux32-4.0.4_en-US.tar.xz - $ tar xpvf tor-browser-linux32-4.0.4_en-US.tar.xz - -**On 64-Bit System** - - $ wget https://www.torproject.org/dist/torbrowser/4.0.4/tor-browser-linux64-4.0.4_en-US.tar.xz - $ tar -xpvf tor-browser-linux64-4.0.4_en-US.tar.xz - -**Note** : In the above command we used ‘$‘ which means that the package is extracted as user and not root. It is strictly suggested to extract and run tor browser not as root. - -After successful extraction, we can move the extracted browser to anywhere/USB Mass Storage device. And run the application from the extracted folder and run ‘start-tor-browser’ strictly not as root. - - $ cd tor-browser_en-US - $ ./start-tor-browser - -![Starting Tor Browser](http://www.tecmint.com/wp-content/uploads/2014/04/Starting-Tor-Network.jpg) - -Starting Tor Browser - -**1. Trying to connect to the Tor Network. Click “Connect” and Tor will do rest of the settings for you.** - -![Connecting to Tor Network](http://www.tecmint.com/wp-content/uploads/2014/04/Tor-Network-Settings.jpg) - -Connecting to Tor Network - -**2. The welcome Window/Tab.** - -![Tor Welcome Screen](http://www.tecmint.com/wp-content/uploads/2014/04/Tor-Welcome-Screen.png) - -Tor Welcome Screen - -**3. Tor Browser Running a Video from Youtube.** - -![Watching Video on Youtube](http://www.tecmint.com/wp-content/uploads/2014/04/Watching-Video-on-Youtube.jpg) - -Watching Video on Youtube - -**4. Opening a banking site for online Purchasing/Transaction.** - -![Browsing a Banking Site](http://www.tecmint.com/wp-content/uploads/2014/04/Browsing-Site.jpg) - -Browsing a Banking Site - -**5. The browser showing my current proxy IP. Note that the text that reads “Proxy Server detected”.** - -![Checking IP Address](http://www.tecmint.com/wp-content/uploads/2014/04/Checking-IP-Address.jpg) - -Checking IP Address - -**Note**: That you need to point to the Tor startup script using text session, everytime you want to run Tor. Moreover a terminal will be busy all the time till you are running tor. How to overcome this and create a desktop/dock-bar Icon? - -6. We need to create `tor.desktop` file inside the directory where extracted files resides. - -$ touch tor.desktop - -Now edit the file using your favourite editor with the text below. Save and exit. I used nano. - - $ nano tor.desktop - ----------- - - #!/usr/bin/env xdg-open - [Desktop Entry] - Encoding=UTF-8 - Name=Tor - Comment=Anonymous Browse - Type=Application - Terminal=false - Exec=/home/avi/Downloads/tor-browser_en-US/start-tor-browser - Icon=/home/avi/Downloads/tor-browser_en-US/Browser/browser/icons/mozicon128.png - StartupNotify=true - Categories=Network;WebBrowser; - -**Note**: Make sure to replace the path with the location of your tor browser in the above. - -**7. Once done! Double click the file `tor.desktop` to fire Tor browser. You may need to trust it for the first time.** - -![Tor Application Launcher](http://www.tecmint.com/wp-content/uploads/2014/04/Tor-Application-Launcher.jpg) - -Tor Application Launcher - -**8. Once you trust you might note that the icon of `tor.desktop` changed.** - -![Tor icon Changed](http://www.tecmint.com/wp-content/uploads/2014/04/Tor-icon-changed.jpg) - -Tor icon Changed - -9. You may drag and drop the `tor.desktop` icon to create shortcut on Desktop and Dock Bar. - -![Add Tor Shortcut on Desktop](http://www.tecmint.com/wp-content/uploads/2014/04/Add-Tor-Shortcut-on-Desktop.jpg) - -Add Tor Shortcut on Desktop - -**10. About Tor Browser.** - -![About Tor Browser](http://www.tecmint.com/wp-content/uploads/2014/04/About-Tor-Browser.jpg) - -About Tor Browser - -**Note**: If you are using older version of Tor, you may update it from the above window. - -#### Usability/Area of Application #### - -- Anonymous communication over web. -- Surf to Blocked web Pages. -- Link other Application Viz (FTP) to this secure Internet Browsing Application. - -#### Controversies of Tor-browser #### - -- No security at the boundary of Tor Application i.e., Data Entry and Exit Points. -- A study in 2011 reveals that a specific way of attacking Tor will reveal IP address of BitTorrent Users. -- Some protocols shows the tendency of leaking IP address, revealed in a study. -- Earlier version of Tor bundled with older versions of Firefox browser were found to be JavaScript Attack Vulnerable. -- Tor Browser Seems to Work slow. - -#### Real world Implementation of Tor-browser #### - -- Vuze BitTorrent Client -- Anonymous Os -- Os’es from Scratch -- whonix, etc. - -#### Future of Tor Browser #### - -Tor browser is promising. Perhaps the first application of its kind is implemented very brilliantly. Tor browser must invest for Support, Scalability and research for securing the data from latest attacks. This application is need of the future. - -#### Download Free eBook #### - -Unofficial Guide to Tor Private Browsing - -[![](http://img.tradepub.com/free/w_make129/images/w_make129c4.gif)][2] - -### Conclusion ### - -Tor bowser is a must tool in the present time where the organization you are working for don’t allow you to access certain websites or if you don’t want others to look into your private business or you don’t want to provide your digital footprints to NSA. - -**Note**: Tor Browser don’t provide any safety from Viruses, Trojans or other threats of this kind. Moreover by writing an article of this we never mean to indulge into illegal activity by hiding our identity over Internet. This Post is totally for educational Purpose and for any illegal use of it neither the author of the post nor Tecmint will be responsible. It is the sole responsibility of user. - -Tor-browser is a wonderful application and you must give it a try. That’s all for now. I’ll be here again with another interesting article you people will love to read. Till then stay tuned and connected to Tecmint. Don’t forget to provide us with your value-able feedback in our comment section below. - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/tor-browser-for-anonymous-web-browsing/ - -作者:[Avishek Kumar][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.tecmint.com/author/avishek/ -[1]:https://www.torproject.org/download/download-easy.html.en -[2]:http://tecmint.tradepub.com/free/w_make129/prgm.cgi \ No newline at end of file diff --git a/translated/tech/20150617 Tor Browser--An Ultimate Web Browser for Anonymous Web Browsing in Linux.md b/translated/tech/20150617 Tor Browser--An Ultimate Web Browser for Anonymous Web Browsing in Linux.md new file mode 100644 index 0000000000..1c6a039920 --- /dev/null +++ b/translated/tech/20150617 Tor Browser--An Ultimate Web Browser for Anonymous Web Browsing in Linux.md @@ -0,0 +1,206 @@ +TorLinuxWebռ +================================================================================ +Ǵ˶滨Ѻܶʱ䡣ʹõӦóҪһWebĻҪԿͻ/ķʽ¼̻IPַϢԼDZڵϢЩϢʽʹãDZڵΣԡ + +![LinuxаװTor](http://www.tecmint.com/wp-content/uploads/2014/04/Install-tor-browser-in-linux.jpg) + +Tor + +⣬Ұȫ֣NSAʼ¼ǵ㼣˵ij޵ĴҲᱻΪѼҴҵ͹˾ʴʹܱԼ˽ + +ˣҪһС͡ЯӦóܴﵽЧTorһӦãӵᵽйܣֹڴˡ + +ƪǻTorĹܡʹ÷ʽ򡢰װԼTorҪ档 + +#### ʲôTor #### + +TorһɷַӦBSDʽ֤ͨ䰲ȫɿʽĽṹûĽǰĽṹƣTorΪ·ӦCдɵġ + +#### TorĹ #### + +- ƽ̨á磬ӦóLinuxWindowsMac¶á +- ڷݵǰиӵݼܡ +- ڿͻ˽еԶܡ +- ǻTor̵Ľϡ +- Էվṩԡ +- Էʱվ +- 豩¶ԴIPִ +- ڷǽ·/صķӦó +- Я - ֱӴUSB洢һԤõweb豾ذװ +- x86x86_64ƽ̨ +- ͨʹTorԡsocks4aķʽڡlocalhostġ9050˿ôFTP +- Torӵдǧתϰû + +#### Torι #### + +TorĹʽ·ɵĸ·ɵĽṹУÿһ㶼Ƕһ棬һǶ׵Ľṹμݲͨ·з͡ڿͻһÿһ㶼ڽݵһ֮ǰݡһڽԭʼݴݵĿĵǰһļݡ + +ֽĹƵ˸޷׷IPԼûĵλã˿κ˹۲վӡ + +Щ̿ЩӣûʹTorʱûбҪġʵϣTorĹһMozillaFirefox + +### LinuxаװTor ### + +۵һTorLinuxWindowsԼMac¶áûҪϵͳͼܹIJͬӴµİ汾磬Tor4.0.4 + +- [https://www.torproject.org/download/download-easy.html.en][1] + +TorҪװõDzҪװTorֱӴ豸УҸԱԤáζŲеԿֲ + +شļ*.tar.xzҪѹ + +**32λϵͳ** + + $ wget https://www.torproject.org/dist/torbrowser/4.0.4/tor-browser-linux32-4.0.4_en-US.tar.xz + $ tar xpvf tor-browser-linux32-4.0.4_en-US.tar.xz + +**64λϵͳ** + + $ wget https://www.torproject.org/dist/torbrowser/4.0.4/tor-browser-linux64-4.0.4_en-US.tar.xz + $ tar -xpvf tor-browser-linux64-4.0.4_en-US.tar.xz + +**ע** : Уʹá$ζѹӦͨûrootûѹǿҽҪrootûѹTor + +ڳɹĽѹDZԽѹƶκεط/USB洢豸СӽѹļԷrootûֱСstart-tor-browser + + $ cd tor-browser_en-US + $ ./start-tor-browser + +![ʼʹTor](http://www.tecmint.com/wp-content/uploads/2014/04/Starting-Tor-Network.jpg) + +ʼʹTor + +**1. ӵTor硣ӡ֮Torðʣµ顣** + +![ӵTor](http://www.tecmint.com/wp-content/uploads/2014/04/Tor-Network-Settings.jpg) + +ӵTor + +**2. ӭ/ǩ** + +![Torӭ](http://www.tecmint.com/wp-content/uploads/2014/04/Tor-Welcome-Screen.png) + +Torӭ + +**3. TorYoutubeƵ** + +![YoutubeϿƵ](http://www.tecmint.com/wp-content/uploads/2014/04/Watching-Video-on-Youtube.jpg) + +YoutubeϿƵ + +**4. ַԽ߹ͽס** + +![վ](http://www.tecmint.com/wp-content/uploads/2014/04/Browsing-Site.jpg) + +վ + +**5. ʾҵǰĴIPעıΪProxy Server detected** + +![IPַ](http://www.tecmint.com/wp-content/uploads/2014/04/Checking-IP-Address.jpg) + +IPַ + +**ע**: ÿTorʱҪʹıģʽָTorűҸնTorʱæµ״̬ο˷Щһ/Dockͼأ + +**6. Ҫڽѹļд`tor.desktop`** + +$ touch tor.desktop + +ʹϲı༭༭ļıʹnano + + $ nano tor.desktop + +---------- + + #!/usr/bin/env xdg-open + [Desktop Entry] + Encoding=UTF-8 + Name=Tor + Comment=Anonymous Browse + Type=Application + Terminal=false + Exec=/home/avi/Downloads/tor-browser_en-US/start-tor-browser + Icon=/home/avi/Downloads/tor-browser_en-US/Browser/browser/icons/mozicon128.png + StartupNotify=true + Categories=Network;WebBrowser; + +**ע**: ȷtor·滻ΪĻе· + +**7. һ㶨Ϳ˫`tor.desktop`ļTorˣҪڵһʱθļ** + +![TorӦ](http://www.tecmint.com/wp-content/uploads/2014/04/Tor-Application-Launcher.jpg) + +TorӦ + +**8. һѡΣע`tor.desktop`ļͼı䡣** + +![TorͼѸı](http://www.tecmint.com/wp-content/uploads/2014/04/Tor-icon-changed.jpg) + +TorͼѸı + +**9. ͨק`tor.desktop`ͼDockдݷʽ** + +![Torݷʽ](http://www.tecmint.com/wp-content/uploads/2014/04/Add-Tor-Shortcut-on-Desktop.jpg) + +Torݷʽ + +**10. Tor** + +![Tor](http://www.tecmint.com/wp-content/uploads/2014/04/About-Tor-Browser.jpg) + +Tor + +**ע**: ʹþɰ汾TorԴĴڸ + +#### ӦõĿԺ #### + +- ʹ硣 +- 赲ҳ档 +- ӦãFTP֤簲ȫķʡ + +#### Tor #### + +- Torܱ߲ûʲôȫʩ磬ڵͳڵ㡣 +- һ2011оһTorĹԵõBitTorrentûIPַ +- һЩозijЩضЭй©IPַ +- TorЩİ汾˾ɰ汾Firefoxⱻ֤JavaScript +- TorıȽϻ + +#### ʵTorʵ #### + +- Vuze BitTorrent Client +- Anonymous Os +- Oses from Scratch +- whonix + +#### Torδ #### + +Torǰ;ġҲʵֵĵһӦódzɫTorӴԵ֧ԼԽڵĹоԱ֤ݰȫӦóδҪ + +#### ѵĵ #### + +ǹٷTor˽ָ + +[![](http://img.tradepub.com/free/w_make129/images/w_make129c4.gif)][2] + +### ### + +IJŲijվϣ֪˽NSAṩĸ㼣ôTorĿǰDZġ + +**ע**: TorṩİȫԲܵľİȫвдƪµĿҲϣͨڻǵݷǷƪ´Ϊ˽ѧĿģߺTecmintΪκηǷʹøûΨһΡ + +TorһdzӦãֵóԣҪ˵ȫˣһдһЩȤ£עTecmintṩмֵķ + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/tor-browser-for-anonymous-web-browsing/ + +ߣ[Avishek Kumar][a] +ߣ[wwy-hust](https://github.com/wwy-hust) +Уԣ[УID](https://github.com/УID) + + [LCTT](https://github.com/LCTT/TranslateProject) ԭ룬[Linuxй](https://linux.cn/) Ƴ + +[a]:http://www.tecmint.com/author/avishek/ +[1]:https://www.torproject.org/download/download-easy.html.en +[2]:http://tecmint.tradepub.com/free/w_make129/prgm.cgi \ No newline at end of file From c966a353815463e607f067c53c4b4fd2d559e91a Mon Sep 17 00:00:00 2001 From: DeadFire Date: Thu, 25 Jun 2015 16:08:20 +0800 Subject: [PATCH 462/965] =?UTF-8?q?20150625-1=20=E9=80=89=E9=A2=98=20RHCSA?= =?UTF-8?q?=20Series=20Part=2015=20=E6=9C=AC=E4=B8=93=E9=A2=98=E5=AE=8C?= =?UTF-8?q?=E7=BB=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ation and Guest Administration with KVM.md | 188 ++++++++++++++++++ 1 file changed, 188 insertions(+) create mode 100644 sources/tech/RHCSA Series/RHCSA Series--Part 15--Essentials of Virtualization and Guest Administration with KVM.md diff --git a/sources/tech/RHCSA Series/RHCSA Series--Part 15--Essentials of Virtualization and Guest Administration with KVM.md b/sources/tech/RHCSA Series/RHCSA Series--Part 15--Essentials of Virtualization and Guest Administration with KVM.md new file mode 100644 index 0000000000..d9e06bd876 --- /dev/null +++ b/sources/tech/RHCSA Series/RHCSA Series--Part 15--Essentials of Virtualization and Guest Administration with KVM.md @@ -0,0 +1,188 @@ +RHCSA Series: Essentials of Virtualization and Guest Administration with KVM – Part 15 +================================================================================ +If you look up the word virtualize in a dictionary, you will find that it means “to create a virtual (rather than actual) version of something”. In computing, the term virtualization refers to the possibility of running multiple operating systems simultaneously and isolated one from another, on top of the same physical (hardware) system, known in the virtualization schema as host. + +![KVM Virtualization Basics and KVM Guest Administration](http://www.tecmint.com/wp-content/uploads/2015/06/RHCSA-Part15.png) + +RHCSA Series: Essentials of Virtualization and Guest Administration with KVM – Part 15 + +Through the use of the virtual machine monitor (also known as hypervisor), virtual machines (referred to as guests) are provided virtual resources (i.e. CPU, RAM, storage, network interfaces, to name a few) from the underlying hardware. + +With that in mind, it is plain to see that one of the main advantages of virtualization is cost savings (in equipment and network infrastructure and in terms of maintenance effort) and a substantial reduction in the physical space required to accommodate all the necessary hardware. + +Since this brief how-to cannot cover all virtualization methods, I encourage you to refer to the documentation listed in the summary for further details on the subject. + +Please keep in mind that the present article is intended to be a starting point to learn the basics of virtualization in RHEL 7 using [KVM][1] (Kernel-based Virtual Machine) with command-line utilities, and not an in-depth discussion of the topic. + +### Verifying Hardware Requirements and Installing Packages ### + +In order to set up virtualization, your CPU must support it. You can verify whether your system meets the requirements with the following command: + + # grep -E 'svm|vmx' /proc/cpuinfo + +In the following screenshot we can see that the current system (with an AMD microprocessor) supports virtualization, as indicated by svm. If we had an Intel-based processor, we would see vmx instead in the results of the above command. + +![Check KVM Support](http://www.tecmint.com/wp-content/uploads/2015/06/Check-KVM-Support.png) + +Check KVM Support + +In addition, you will need to have virtualization capabilities enabled in the firmware of your host (BIOS or UEFI). + +Now install the necessary packages: + +- qemu-kvm is an open source virtualizer that provides hardware emulation for the KVM hypervisor whereas qemu-img provides a command line tool for manipulating disk images. +- libvirt includes the tools to interact with the virtualization capabilities of the operating system. +- libvirt-python contains a module that permits applications written in Python to use the interface supplied by libvirt. +- libguestfs-tools: miscellaneous system administrator command line tools for virtual machines. +- virt-install: other command-line utilities for virtual machine administration. + + # yum update && yum install qemu-kvm qemu-img libvirt libvirt-python libguestfs-tools virt-install + +Once the installation completes, make sure you start and enable the libvirtd service: + + # systemctl start libvirtd.service + # systemctl enable libvirtd.service + +By default, each virtual machine will only be able to communicate with the rest in the same physical server and with the host itself. To allow the guests to reach other machines inside our LAN and also the Internet, we need to set up a bridge interface in our host (say br0, for example) by, + +1. adding the following line to our main NIC configuration (most likely `/etc/sysconfig/network-scripts/ifcfg-enp0s3`): + + BRIDGE=br0 + +2. creating the configuration file for br0 (/etc/sysconfig/network-scripts/ifcfg-br0) with these contents (note that you may have to change the IP address, gateway address, and DNS information): + + DEVICE=br0 + TYPE=Bridge + BOOTPROTO=static + IPADDR=192.168.0.18 + NETMASK=255.255.255.0 + GATEWAY=192.168.0.1 + NM_CONTROLLED=no + DEFROUTE=yes + PEERDNS=yes + PEERROUTES=yes + IPV4_FAILURE_FATAL=no + IPV6INIT=yes + IPV6_AUTOCONF=yes + IPV6_DEFROUTE=yes + IPV6_PEERDNS=yes + IPV6_PEERROUTES=yes + IPV6_FAILURE_FATAL=no + NAME=br0 + ONBOOT=yes + DNS1=8.8.8.8 + DNS2=8.8.4.4 + +3. finally, enabling packet forwarding by making, in `/etc/sysctl.conf`, + + net.ipv4.ip_forward = 1 + +and loading the changes to the current kernel configuration: + + # sysctl -p + +Note that you may also need to tell firewalld that this kind of traffic should be allowed. Remember that you can refer to the article on that topic in this same series ([Part 11: Network Traffic Control Using FirewallD and Iptables][2]) if you need help to do that. + +### Creating VM Images ### + +By default, VM images will be created to `/var/lib/libvirt/images` and you are strongly advised to not change this unless you really need to, know what you’re doing, and want to handle SELinux settings yourself (such topic is out of the scope of this tutorial but you can refer to Part 13 of the RHCSA series: [Mandatory Access Control Essentials with SELinux][3] if you want to refresh your memory). + +This means that you need to make sure that you have allocated the necessary space in that filesystem to accommodate your virtual machines. + +The following command will create a virtual machine named `tecmint-virt01` with 1 virtual CPU, 1 GB (=1024 MB) of RAM, and 20 GB of disk space (represented by `/var/lib/libvirt/images/tecmint-virt01.img`) using the rhel-server-7.0-x86_64-dvd.iso image located inside /home/gacanepa/ISOs as installation media and the br0 as network bridge: + + # virt-install \ + --network bridge=br0 + --name tecmint-virt01 \ + --ram=1024 \ + --vcpus=1 \ + --disk path=/var/lib/libvirt/images/tecmint-virt01.img,size=20 \ + --graphics none \ + --cdrom /home/gacanepa/ISOs/rhel-server-7.0-x86_64-dvd.iso + --extra-args="console=tty0 console=ttyS0,115200" + +If the installation file was located in a HTTP server instead of an image stored in your disk, you will have to replace the –cdrom flag with –location and indicate the address of the online repository. + +As for the –graphics none option, it tells the installer to perform the installation in text-mode exclusively. You can omit that flag if you are using a GUI interface and a VNC window to access the main VM console. Finally, with –extra-args we are passing kernel boot parameters to the installer that set up a serial VM console. + +The installation should now proceed as a regular (real) server now. If not, please review the steps listed above. + +### Managing Virtual Machines ### + +These are some typical administration tasks that you, as a system administrator, will need to perform on your virtual machines. Note that all of the following commands need to be run from your host: + +**1. List all VMs:** + + # virsh list --all + +From the output of the above command you will have to note the Id for the virtual machine (although it will also return its name and current status) because you will need it for most administration tasks related to a particular VM. + +**2. Display information about a guest:** + + # virsh dominfo [VM Id] + +**3. Start, restart, or stop a guest operating system:** + + # virsh start | reboot | shutdown [VM Id] + +**4. Access a VM’s serial console if networking is not available and no X server is running on the host:** + + # virsh console [VM Id] + +**Note** that this will require that you add the serial console configuration information to the `/etc/grub.conf` file (refer to the argument passed to the –extra-args option when the VM was created). + +**5. Modify assigned memory or virtual CPUs:** + +First, shutdown the guest: + + # virsh shutdown [VM Id] + +Edit the VM configuration for RAM: + + # virsh edit [VM Id] + +Then modify + + [Memory size here without brackets] + +Restart the VM with the new settings: + + # virsh create /etc/libvirt/qemu/tecmint-virt01.xml + +Finally, change the memory dynamically: + + # virsh setmem [VM Id] [Memory size here without brackets] + +For CPU: + + # virsh edit [VM Id] + +Then modify + + [Number of CPUs here without brackets] + +For further commands and details, please refer to table 26.1 in Chapter 26 of the RHEL 5 Virtualization guide (that guide, though a bit old, includes an exhaustive list of virsh commands used for guest administration). + +### SUMMARY ### + +In this article we have covered some basic aspects of virtualization with KVM in RHEL 7, which is both a vast and a fascinating topic, and I hope it will be helpful as a starting guide for you to later explore more advanced subjects found in the official [RHEL virtualization][4] getting started and [deployment / administration guides][5]. + +In addition, you can refer to the preceding articles in [this KVM series][6] in order to clarify or expand some of the concepts explained here. + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/kvm-virtualization-basics-and-guest-administration/ + +作者:[Gabriel Cánepa][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/gacanepa/ +[1]:http://www.linux-kvm.org/page/Main_Page +[2]:http://www.tecmint.com/firewalld-vs-iptables-and-control-network-traffic-in-firewall/ +[3]:http://www.tecmint.com/selinux-essentials-and-control-filesystem-access/ +[4]:https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Virtualization_Getting_Started_Guide/index.html +[5]:https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Virtualization_Deployment_and_Administration_Guide/index.html +[6]:http://www.tecmint.com/install-and-configure-kvm-in-linux/ \ No newline at end of file From e9019612cf33ab7375e6de0385103031fca91352 Mon Sep 17 00:00:00 2001 From: DeadFire Date: Thu, 25 Jun 2015 16:26:26 +0800 Subject: [PATCH 463/965] =?UTF-8?q?20150625-2=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...re Made Easy with these Dedicated Tools.md | 152 ++++++++++++++++++ ...ion Swarm Clusters using Docker Machine.md | 125 ++++++++++++++ 2 files changed, 277 insertions(+) create mode 100644 sources/share/20150625 Screen Capture Made Easy with these Dedicated Tools.md create mode 100644 sources/tech/20150625 How to Provision Swarm Clusters using Docker Machine.md diff --git a/sources/share/20150625 Screen Capture Made Easy with these Dedicated Tools.md b/sources/share/20150625 Screen Capture Made Easy with these Dedicated Tools.md new file mode 100644 index 0000000000..15fca199a2 --- /dev/null +++ b/sources/share/20150625 Screen Capture Made Easy with these Dedicated Tools.md @@ -0,0 +1,152 @@ +Screen Capture Made Easy with these Dedicated Tools +================================================================================ +"A picture is worth a thousand words", a phrase which emerged in the USA in the early part of the 20th century, refers to the notion that a single still image can present as much information as a large amount of descriptive text. Essentially, pictures convey information more effectively and efficiently than words can. + +A screenshot (or screengrab) is a snapshot or picture captured by a computer to record the output of a visual device. Screen capture software enable screenshots to be taken on a computer. This type of software has lots of uses. As an image can illustrate the operation of computer software well, screenshots play an important role in software development and documentation. Alternatively, if you have a technical problem with your computer, a screenshot allows a technical support department to understand the problems you are facing. Writing computer-related articles, documentation and tutorials is nigh on impossible without a good tool for creating screenshots. Screenshots are also useful to save snippets of anything you have on your screen, particularly when it can not be easily printed. + +Linux has a good selection of open source dedicated screenshot programs, both graphical and console based. For a feature-rich dedicated screenshot utility, look no further than Shutter. This tool is a superb example of a small open source tool. But there are some great alternatives too. + +Screen capture functionality is not only provided by dedicated applications. GIMP and ImageMagick, two programs which are primarily image manipulation tools, also offer competent screen capturing functionality. + +---------- + +### Shutter ### + +![Shutter in action](http://www.linuxlinks.com/portal/content/reviews/Graphics/Screenshot-Shutter1.png) + +Shutter is a feature-rich screenshot application. You can take a screenshot of a specific area, window, your whole screen, or even of a website - apply different effects to it, draw on it to highlight points, and then upload to an image hosting site, all within one window. + +Features include: + + +- Take a screenshot of: + - a specific area + - window + - the complete desktop + - web pages from a script +- Apply different effects to the screenshot +- Hotkeys +- Print +- Take screenshot directly or with a specified delay time +- Save the screenshots to a specified directory and name them in a convenient way (using special wild-cards) +- Fully integrated into the GNOME Desktop (TrayIcon etc) +- Generate thumbnails directly when you are taking a screenshot and set a size level in % +- Shutter session collection: + - Keep track of all screenshots during session + - Copy screeners to clipboard + - Print screenshots + - Delete screenshots + - Rename your file +- Upload your files directly to Image-Hosters (e.g. http://ubuntu-pics.de), retrieve all the needed links and share them with others +- Edit screenshots directly using the embedded drawing tool + +- Website: [shutter-project.org][1] +- Developer: Mario Kemper and Shutter Team +- License: GNU GPL v3 +- Version Number: 0.93.1 + +---------- + +### HotShots ### + +![HotShots in action](http://www.linuxlinks.com/portal/content/reviews/Graphics/Screenshot-HotShots.png) + +HotShots is an application for capturing screens and saving them in a variety of image formats as well as adding annotations and graphical data (arrows, lines, texts, ...). + +You can also upload your creations to the web (FTP/some web services). HotShots is written with Qt. + +HotShots is not available in Ubuntu's Software Center. But it's easy to install by typing at the command line: + + sudo add-apt-repository ppa:ubuntuhandbook1/apps + + sudo apt-get update + + sudo apt-get install hotshots + +Features include: + +- Simple to use +- Full featured +- Built-in editor +- Hotkeys +- Built-in magnification +- Freehand and multi-screen capture +- Supported Output Formats: Black & Whte (bw), Encapsulated PostScript (eps, epsf), Encapsulated PostScript Interchange (epsi), OpenEXR (exr), PC Paintbrush Exchange (pcx), Photoshop Document (psd), ras, rgb, rgba, Irix RGB (sgi), Truevision Targa (tga), eXperimental Computing Facility (xcf), Windows Bitmap (bmp), DirectDraw Surface (dds), Graphic Interchange Format (gif), Icon Image (ico), Joint Photographic Experts Group 2000 (jp2), Joint Photographic Experts Group (jpeg, jpg), Multiple-image Network Graphics (mng), Portable Pixmap (ppm), Scalable Vector Graphics (svg), svgz, Tagged Image File Format (tif, tiff), webp, X11 Bitmap (xbm), X11 Pixmap (xpm), and Khoros Visualization (xv) +- Internationalization support: Basque, Chinese, Czech, French, Galician, German, Greek, Italian, Japanese, Lithuanian, Polish, Portuguese, Romanian, Russian, Serbian, Singhalese, Slovak, Spanish, Turkish, Ukrainian, and Vietnamese + +- Website: [thehive.xbee.net][2] +- Developer: xbee +- License: GNU GPL v2 +- Version Number: 2.2.0 + +---------- + +### ScreenCloud ### + +![ScreenCloud in action](http://www.linuxlinks.com/portal/content/reviews/Graphics/Screenshot-ScreenCloud.png) + +ScreenCloud is an easy to use open source screenshot tool. + +With this software, users can take a screenshot using one of the 3 hotkeys or simply click the ScreenCloud tray icon. Users can choose where you want to save the screenshot. + +If you choose to upload your screenshot to the screencloud website, a link will automatically be copied to your clipboard. This can be shared with friends or colleagues via email or in an IM conversation. All they have to do is click the link and look at your screenshot. + +Features include: + +- Capture full screen, window or selection +- Fast and easy: Snap a photo, paste the link, done +- Free hosting of your screenshots +- Hotkeys +- Set timer delay +- Enable 'Capture window borders' +- Enable/Disable Notifications +- Set app to run on start up +- Adjust account/upload/filename/shortcut settings +- Cross platform tool +- Plugin support, save to Dropbox, Imgur, and more +- Supports uploading to FTP and SFTP servers + +- Website: [screencloud.net][3] +- Developer: Olav S Thoresen +- License: GNU GPL v2 +- Version Number: 1.2.1 + +---------- + +### KSnapshot ### + +![KSnapShot in action](http://www.linuxlinks.com/portal/content/reviews/Graphics/Screenshot-KSnapshot.png) + +KSnapshot is a simple utility for taking screenshots. It can capture images of the whole desktop, a single window, a section of a window or a selected region. Images can then be saved in a variety of different formats. + +KSnapshot also allows users to use hotkeys to take a screenshot. Besides saving the screenshot, it can be copied to the clipboard or opened with any program that is associated with image files. + +KSnapshot is part of the KDE 4 graphics module. + +Features include: + +- Save snapshot in multiple formats +- Snapshot delay +- Exclude window decorations +- Copy the snapshot to the clipboard +- Hotkeys +- Can be scripted using its D-Bus interface + +- Website: [www.kde.org][4] +- Developer: KDE, Richard J. Moore, Aaron J. Seigo, Matthias Ettrich +- License: GNU GPL v2 +- Version Number: 0.8.2 + +-------------------------------------------------------------------------------- + +via: http://www.linuxlinks.com/article/2015062316235249/ScreenCapture.html + +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[1]:http://shutter-project.org/ +[2]:http://thehive.xbee.net/ +[3]:https://screencloud.net/ +[4]:https://www.kde.org/applications/graphics/ksnapshot/ \ No newline at end of file diff --git a/sources/tech/20150625 How to Provision Swarm Clusters using Docker Machine.md b/sources/tech/20150625 How to Provision Swarm Clusters using Docker Machine.md new file mode 100644 index 0000000000..47d33102e5 --- /dev/null +++ b/sources/tech/20150625 How to Provision Swarm Clusters using Docker Machine.md @@ -0,0 +1,125 @@ +How to Provision Swarm Clusters using Docker Machine +================================================================================ +Hi all, today we'll learn how we can deploy Swarm Clusters using Docker Machine. It serves the standard Docker API, so any tool which can communicate with a Docker daemon can use Swarm to transparently scale to multiple hosts. Docker Machine is an application that helps to create Docker hosts on our computer, on cloud providers and inside our own data center. It provides easy solution for creating servers, installing Docker on them and then configuring the Docker client according the users configuration and requirements. We can provision swarm clusters with any driver we need and is highly secured with TLS Encryption. + +Here are some quick and easy steps on how to provision swarm clusters with Docker Machine. + +### 1. Installing Docker Machine ### + +Docker Machine supports awesome on every Linux Operating System. First of all, we'll need to download the latest version of Docker Machine from the Github site . Here, we'll use curl to download the latest version of Docker Machine ie 0.2.0 . + +For 64 Bit Operating System + + # curl -L https://github.com/docker/machine/releases/download/v0.2.0/docker-machine_linux-amd64 > /usr/local/bin/docker-machine + +For 32 Bit Operating System + + # curl -L https://github.com/docker/machine/releases/download/v0.2.0/docker-machine_linux-i386 > /usr/local/bin/docker-machine + +After downloading the latest release of Docker Machine, we'll make the file named docker-machine under /usr/local/bin/ executable using the command below. + + # chmod +x /usr/local/bin/docker-machine + +After doing the above, we'll wanna ensure that we have successfully installed docker-machine. To check it, we can run the docker-machine -v which will give output of the version of docker-machine installed in our system. + + # docker-machine -v + +![Installing Docker Machine](http://blog.linoxide.com/wp-content/uploads/2015/05/installing-docker-machine.png) + +To enable Docker commands on our machines, make sure to install the Docker client as well by running the command below. + + # curl -L https://get.docker.com/builds/linux/x86_64/docker-latest > /usr/local/bin/docker + # chmod +x /usr/local/bin/docker + +### 2. Creating Machine ### + +After installing Machine into our working PC or device, we'll wanna go forward to create a machine using Docker Machine. Here, in this tutorial we'll gonna deploy a machine in the Digital Ocean Platform so we'll gonna use "digitalocean" as its Driver API then, docker swarm will be running into that Droplet which will be further configured as Swarm Master and another droplet will be created which will be configured as Swarm Node Agent. + +So, to create the machine, we'll need to run the following command. + + # docker-machine create --driver digitalocean --digitalocean-access-token linux-dev + +**Note**: Here, linux-dev is the name of the machine we are wanting to create. is a security key which can be generated from the Digital Ocean Control Panel of the account holder of Digital Ocean Cloud Platform. To retrieve that key, we simply need to login to our Digital Ocean Control Panel then click on API, then click on Generate New Token and give it a name tick on both Read and Write. Then we'll get a long hex key, thats the now, simply replace it into the command above. + +Now, to load the Machine configuration into the shell we are running the comamands, run the following command. + + # eval "$(docker-machine env linux-dev)" + +![Docker Machine Digitalocean Cloud](http://blog.linoxide.com/wp-content/uploads/2015/05/docker-machine-digitalocean-cloud.png) + +Then, we'll mark our machine as ACTIVE by running the below command. + + # docker-machine active linux-dev + +Now, we'll check whether its been marked as ACTIVE "*" or not. + + # docker-machine ls + +![Docker Machine Active List](http://blog.linoxide.com/wp-content/uploads/2015/05/docker-machine-active-list.png) + +### 3. Running Swarm Docker Image ### + +Now, after we finish creating the required machine. We'll gonna deploy swarm docker image in our active machine. This machine will run the docker image and will control over the Swarm master and node. To run the image, we can simply run the below command. + + # docker run swarm create + +![Docker Machine Swarm Create](http://blog.linoxide.com/wp-content/uploads/2015/05/docker-machine-swarm-create.png) + +If you are trying to run swarm docker image using **32 bit Operating System** in the computer where Docker Machine is running, we'll need to SSH into the Droplet. + + # docker-machine ssh + #docker run swarm create + #exit + +### 4. Creating Swarm Master ### + +Now, after our machine and swarm image is running into the machine, we'll now create a Swarm Master. This will also add the master as a node. To do so, here's the command below. + + # docker-machine create \ + -d digitalocean \ + --digitalocean-access-token + --swarm \ + --swarm-master \ + --swarm-discovery token:// \ + swarm-master + +![Docker Machine Swarm Master Create](http://blog.linoxide.com/wp-content/uploads/2015/05/docker-machine-swarm-master-create.png) + +### 5. Creating Swarm Nodes ### + +Now, we'll create a swarm node which will get connected with the Swarm Master. The command below will create a new droplet which will be named as swarm-node and will get connected with the Swarm Master as node. This will create a Swarm cluster across the two nodes. + + # docker-machine create \ + -d digitalocean \ + --digitalocean-access-token + --swarm \ + --swarm-discovery token:// \ + swarm-node + +![Docker Machine Swarm Nodes](http://blog.linoxide.com/wp-content/uploads/2015/05/docker-machine-swarm-nodes.png) + +### 6. Connecting to the Swarm Master ### + +We, now connect to the Swarm Master so that we can deploy Docker containers across the nodes as per the requirement and configuration. To load the Swarm Master's Machine configuration into our environment, we can run the below command. + + # eval "$(docker-machine env --swarm swarm-master)" + +After that, we can run the required containers of our choice across the nodes. Here, we'll check if everything went fine or not. So, we'll run **docker info** to check the information about the Swarm Clusters. + + # docker info + +### Conclusion ### + +We can pretty easily create Swarm Cluster with Docker Machine. This method is a lot productive because it reduces a lot of time of a system admin or users. In this article, we successfully provisioned clusters by creating a master and a node using a machine with Digital Ocean as driver. It can be created using any driver like VirtualBox, Google Cloud Computing, Amazon Web Service, Microsoft Azure and more according to the need and requirement of the user and the connection is highly secured with TLS Encryption. If you have any questions, suggestions, feedback please write them in the comment box below so that we can improve or update our contents. Thank you ! Enjoy :-) + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/linux-how-to/provision-swarm-clusters-using-docker-machine/ + +作者:[Arun Pyasi][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://linoxide.com/author/arunp/ \ No newline at end of file From b0f326a416dca46d4e9f6f815ae21ba4ed18ba76 Mon Sep 17 00:00:00 2001 From: ictlyh Date: Thu, 25 Jun 2015 21:30:17 +0800 Subject: [PATCH 464/965] [Translating] tech/20150331 How to set up remote desktop on Linux VPS using x2go.md --- ...50331 How to set up remote desktop on Linux VPS using x2go.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20150331 How to set up remote desktop on Linux VPS using x2go.md b/sources/tech/20150331 How to set up remote desktop on Linux VPS using x2go.md index d89c91832e..59323a45e4 100644 --- a/sources/tech/20150331 How to set up remote desktop on Linux VPS using x2go.md +++ b/sources/tech/20150331 How to set up remote desktop on Linux VPS using x2go.md @@ -1,3 +1,4 @@ +ictlyh translating How to set up remote desktop on Linux VPS using x2go ================================================================================ As everything is moved to the cloud, virtualized remote desktop becomes increasingly popular in the industry as a way to enhance employee's productivity. Especially for those who need to roam constantly across multiple locations and devices, remote desktop allows them to stay connected seamlessly to their work environment. Remote desktop is attractive for employers as well, achieving increased agility and flexibility in work environments, lower IT cost due to hardware consolidation, desktop security hardening, and so on. From df748618cac02d4bc0fe7c1fce0600a0d3b3e944 Mon Sep 17 00:00:00 2001 From: ictlyh Date: Thu, 25 Jun 2015 23:02:55 +0800 Subject: [PATCH 465/965] [Translated] tech/20150331 How to set up remote desktop on Linux VPS using x2go.md --- ... remote desktop on Linux VPS using x2go.md | 138 ------------------ ... remote desktop on Linux VPS using x2go.md | 138 ++++++++++++++++++ 2 files changed, 138 insertions(+), 138 deletions(-) delete mode 100644 sources/tech/20150331 How to set up remote desktop on Linux VPS using x2go.md create mode 100644 translated/tech/20150331 How to set up remote desktop on Linux VPS using x2go.md diff --git a/sources/tech/20150331 How to set up remote desktop on Linux VPS using x2go.md b/sources/tech/20150331 How to set up remote desktop on Linux VPS using x2go.md deleted file mode 100644 index 59323a45e4..0000000000 --- a/sources/tech/20150331 How to set up remote desktop on Linux VPS using x2go.md +++ /dev/null @@ -1,138 +0,0 @@ -ictlyh translating -How to set up remote desktop on Linux VPS using x2go -================================================================================ -As everything is moved to the cloud, virtualized remote desktop becomes increasingly popular in the industry as a way to enhance employee's productivity. Especially for those who need to roam constantly across multiple locations and devices, remote desktop allows them to stay connected seamlessly to their work environment. Remote desktop is attractive for employers as well, achieving increased agility and flexibility in work environments, lower IT cost due to hardware consolidation, desktop security hardening, and so on. - -In the world of Linux, of course there is no shortage of choices for settings up remote desktop environment, with many protocols (e.g., RDP, RFB, NX) and server/client implementations (e.g., [TigerVNC][1], RealVNC, FreeNX, x2go, X11vnc, TeamViewer) available. - -Standing out from the pack is [X2Go][2], an open-source (GPLv2) implementation of NX-based remote desktop server and client. In this tutorial, I am going to demonstrate **how to set up remote desktop environment for [Linux VPS][3] using X2Go**. - -### What is X2Go? ### - -The history of X2Go goes back to NoMachine's NX technology. The NX remote desktop protocol was designed to deal with low bandwidth and high latency network connections by leveraging aggressive compression and caching. Later, NX was turned into closed-source while NX libraries were made GPL-ed. This has led to open-source implementation of several NX-based remote desktop solutions, and one of them is X2Go. - -What benefits does X2Go bring to the table, compared to other solutions such as VNC? X2Go inherits all the advanced features of NX technology, so naturally it works well over slow network connections. Besides, X2Go boasts of an excellent track record of ensuring security with its built-in SSH-based encryption. No longer need to set up an SSH tunnel [manually][4]. X2Go comes with audio support out of box, which means that music playback at the remote desktop is delivered (via PulseAudio) over network, and fed into local speakers. On usability front, an application that you run on remote desktop can be seamlessly rendered as a separate window on your local desktop, giving you an illusion that the application is actually running on the local desktop. As you can see, these are some of [its powerful features][5] lacking in VNC based solutions. - -### X2GO's Desktop Environment Compatibility ### - -As with other remote desktop servers, there are [known compatibility issues][6] for X2Go server. Desktop environments like KDE3/4, Xfce, MATE and LXDE are the most friendly to X2Go server. However, your mileage may vary with other desktop managers. For example, the later versions of GNOME 3, KDE5, Unity are known to be not compatible with X2Go. If the desktop manager of your remote host is compatible with X2Go, you can follow the rest of the tutorial. - -### Install X2Go Server on Linux ### - -X2Go consists of remote desktop server and client components. Let's start with X2Go server installation. I assume that you already have an X2Go-compatible desktop manager up and running on a remote host, where we will be installing X2Go server. - -Note that X2Go server component does not have a separate service that needs to be started upon boot. You just need to make sure that SSH service is up and running. - -#### Ubuntu or Linux Mint: #### - -Configure X2Go PPA repository. X2Go PPA is available for Ubuntu 14.04 and higher. - - $ sudo add-apt-repository ppa:x2go/stable - $ sudo apt-get update - $ sudo apt-get install x2goserver x2goserver-xsession - -#### Debian (Wheezy): #### - - $ sudo apt-key adv --recv-keys --keyserver keys.gnupg.net E1F958385BFE2B6E - $ sudo sh -c "echo deb http://packages.x2go.org/debian wheezy main > /etc/apt/sources.list.d/x2go.list" - $ sudo sh -c "echo deb-src http://packages.x2go.org/debian wheezy main >> /etc/apt/sources.list.d/x2go.list" - $ sudo apt-get update - $ sudo apt-get install x2goserver x2goserver-xsession - -#### Fedora: #### - - $ sudo yum install x2goserver x2goserver-xsession - -#### CentOS/RHEL: #### - -Enable [EPEL respository][7] first, and then run: - - $ sudo yum install x2goserver x2goserver-xsession - -### Install X2Go Client on Linux ### - -On a local host where you will be connecting to remote desktop, install X2GO client as follows. - -#### Ubuntu or Linux Mint: #### - -Configure X2Go PPA repository. X2Go PPA is available for Ubuntu 14.04 and higher. - - $ sudo add-apt-repository ppa:x2go/stable - $ sudo apt-get update - $ sudo apt-get install x2goclient - -Debian (Wheezy): - - $ sudo apt-key adv --recv-keys --keyserver keys.gnupg.net E1F958385BFE2B6E - $ sudo sh -c "echo deb http://packages.x2go.org/debian wheezy main > /etc/apt/sources.list.d/x2go.list" - $ sudo sh -c "echo deb-src http://packages.x2go.org/debian wheezy main >> /etc/apt/sources.list.d/x2go.list" - $ sudo apt-get update - $ sudo apt-get install x2goclient - -#### Fedora: #### - - $ sudo yum install x2goclient - -CentOS/RHEL: - -Enable EPEL respository first, and then run: - - $ sudo yum install x2goclient - -### Connect to Remote Desktop with X2Go Client ### - -Now it's time to connect to your remote desktop. On the local host, simply run the following command or use desktop launcher to start X2Go client. - - $ x2goclient - -Enter the remote host's IP address and SSH user name. Also, specify session type (i.e., desktop manager of a remote host). - -![](https://farm9.staticflickr.com/8730/16365755693_75f3d544e9_b.jpg) - -If you want, you can customize other things (by pressing other tabs), like connection speed, compression, screen resolution, and so on. - -![](https://farm9.staticflickr.com/8699/16984498482_665b975eca_b.jpg) - -![](https://farm9.staticflickr.com/8694/16985838755_1b7df1eb78_b.jpg) - -When you initiate a remote desktop connection, you will be asked to log in. Type your SSH login and password. - -![](https://farm9.staticflickr.com/8754/16984498432_1c8068b817_b.jpg) - -Upon successful login, you will see the remote desktop screen. - -![](https://farm9.staticflickr.com/8752/16798126858_1ab083ba80_c.jpg) - -If you want to test X2Go's seamless window feature, choose "Single application" as session type, and specify the path to an executable on the remote host. In this example, I choose Dolphin file manager on a remote KDE host. - -![](https://farm8.staticflickr.com/7584/16798393920_128c3af9c5_b.jpg) - -Once you are successfully connected, you will see a remote application window open on your local desktop, not the entire remote desktop screen. - -![](https://farm9.staticflickr.com/8742/16365755713_7b90cf65f0_c.jpg) - -### Conclusion ### - -In this tutorial, I demonstrated how to set up X2Go remote desktop on [Linux VPS][8] instance. As you can see, the whole setup process is pretty much painless (if you are using a right desktop environment). While there are some desktop-specific quirkiness, X2Go is a solid remote desktop solution which is secure, feature-rich, fast, and free. - -What feature is the most appealing to you in X2Go? Please share your thought. - --------------------------------------------------------------------------------- - -via: http://xmodulo.com/x2go-remote-desktop-linux.html - -作者:[Dan Nanni][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://xmodulo.com/author/nanni -[1]:http://ask.xmodulo.com/centos-remote-desktop-vps.html -[2]:http://wiki.x2go.org/ -[3]:http://xmodulo.com/go/digitalocean -[4]:http://xmodulo.com/how-to-set-up-vnc-over-ssh.html -[5]:http://wiki.x2go.org/doku.php/doc:newtox2go -[6]:http://wiki.x2go.org/doku.php/doc:de-compat -[7]:http://xmodulo.com/how-to-set-up-epel-repository-on-centos.html -[8]:http://xmodulo.com/go/digitalocean diff --git a/translated/tech/20150331 How to set up remote desktop on Linux VPS using x2go.md b/translated/tech/20150331 How to set up remote desktop on Linux VPS using x2go.md new file mode 100644 index 0000000000..26ad141e84 --- /dev/null +++ b/translated/tech/20150331 How to set up remote desktop on Linux VPS using x2go.md @@ -0,0 +1,138 @@ +如何在 Linux VPS 上使用 x2go 设置远程桌面 +================================================================================ +由于一切都迁移到了云上,作为提高职员生产力的一种方式,虚拟远程桌面在工业中越来越流行。尤其对于那些需要跨多个地方和设备不停漫游的人,远程桌面可以让他们和工作环境保持无缝连接。远程桌面对于雇主同样有吸引力,可以在工作环境中提高敏捷性和灵活性,由于硬件整合、桌面安全加固等原因降低 IT 花费。 + +在 Linux 世界中,有许多可用的协议(例如 RDP、RFB、NX) 和 服务器/客户端实现(例如 [TigerVNC][1]、RealVNC、FreeNX、x2go、X11vnc、TeamViewer),当然不缺乏设置远程桌面的选择。 + +当中出色的一个是 [X2Go][2],它是一个基于 NX(译者注:通过计算机网络显示远程桌面环境的一种技术,可参考 [Wiki][9]) 的远程桌面服务器和客户端的开源(GPLv2)实现。在这个教程中,我会介绍 **如何为 Linux VPS 使用 X2Go 设置远程桌面环境**。 + +### X2Go 是什么? ### + +X2Go 的历史要追溯回 NoMachine 的 NX 技术。NX 远程桌面协议的设计目的是通过利用主动压缩和缓存解决低带宽和高延迟的网络连接问题。后来,NX 转为闭源,但 NX 库还是采用 GPL 协议。这导致了多种基于 NX 的远程桌面解决方案开源实现,X2Go 就是其中之一。 + +和其它解决方案,例如 VNC 相比,X2Go 带来哪些好处呢? X2Go 继承了 NX 技术的所有高级功能,很自然能在慢速网络连接上良好工作。另外,由于它内置的基于 SSH 的加密技术,X2Go 保持了确保安全的良好业绩记录。不再需要[手动设置 SSH 隧道][4] 。X2Go 开箱支持音频,意味着远程桌面的音乐播放通过网络传送,并进入本地扬声器。在易用性方面,远程桌面上运行的应用程序可以在你的本地桌面中用一个独立窗口无缝呈现,给你造成一种应用程序实际上在你本地桌面运行的错觉。正如你看到的,这些都是一些基于 VNC 的解决方案所缺少的[强大功能][5]。 + +### X2GO 的桌面环境兼容性 ### + +和其它远程桌面服务器一样,X2Go 服务器也有一些[已知的兼容性问题][6]。像 KDE3/4、Xfce、MATE 和 LXDE 是对 X2Go 服务器最友好的桌面环境。但是,用其它桌面管理器效果可能有所不同。例如,已知 GNOME 3 之后的版本、KDE 5、Unity 和 X2Go 并不兼容。如果你的远程主机的桌面管理器和 X2Go 兼容,你可以继续以下的教程。 + +### 在 Linux 上安装 X2Go 服务器 ### + +X2Go 由远程桌面服务器和客户端组件组成。让我们首先安装 X2Go 服务器。我假设你已经有一个和 X2Go 兼容的桌面管理器并且在远程主机上运行,我们会安装 X2Go 服务器到该远程主机。 + +注意系统启动后 X2Go 服务器组件没有需要单独启动的服务。你只需要保证开启了 SSH 服务并在正常运行。 + +#### Ubuntu 或 Linux Mint: #### + +配置 X2Go PPA 库。对于 Ubuntu 14.04 以及更高版本,有可用的 X2Go PPA。 + + $ sudo add-apt-repository ppa:x2go/stable + $ sudo apt-get update + $ sudo apt-get install x2goserver x2goserver-xsession + +#### Debian (Wheezy): #### + + $ sudo apt-key adv --recv-keys --keyserver keys.gnupg.net E1F958385BFE2B6E + $ sudo sh -c "echo deb http://packages.x2go.org/debian wheezy main > /etc/apt/sources.list.d/x2go.list" + $ sudo sh -c "echo deb-src http://packages.x2go.org/debian wheezy main >> /etc/apt/sources.list.d/x2go.list" + $ sudo apt-get update + $ sudo apt-get install x2goserver x2goserver-xsession + +#### Fedora: #### + + $ sudo yum install x2goserver x2goserver-xsession + +#### CentOS/RHEL: #### + +首先启用 [EPEL 库][7] 然后运行: + + $ sudo yum install x2goserver x2goserver-xsession + +### 在 Linux 上安装 X2Go 客户端 ### + +在将会连接到远程桌面的本地主机上,安装以下命令安装 X2Go 客户端。 + +#### Ubuntu 或 Linux Mint: #### + +配置 X2Go PPA 库。对于 Ubuntu 14.04 以及更高版本,有可用的 X2Go PPA。 + + $ sudo add-apt-repository ppa:x2go/stable + $ sudo apt-get update + $ sudo apt-get install x2goclient + +Debian (Wheezy): + + $ sudo apt-key adv --recv-keys --keyserver keys.gnupg.net E1F958385BFE2B6E + $ sudo sh -c "echo deb http://packages.x2go.org/debian wheezy main > /etc/apt/sources.list.d/x2go.list" + $ sudo sh -c "echo deb-src http://packages.x2go.org/debian wheezy main >> /etc/apt/sources.list.d/x2go.list" + $ sudo apt-get update + $ sudo apt-get install x2goclient + +#### Fedora: #### + + $ sudo yum install x2goclient + +CentOS/RHEL: + +首先启用 EPEL 库,然后运行: + + $ sudo yum install x2goclient + +### 用 X2Go 客户端连接到远程桌面 ### + +终于可以连接到远程桌面了。在本地主机上,只需运行以下命令或者使用桌面启动器启动 X2Go 客户端。 + + $ x2goclient + +输入远程主机的 IP 地址和 SSH 用户名称。同时,指定会话类型(例如,远程主机的桌面管理器)。 + +![](https://farm9.staticflickr.com/8730/16365755693_75f3d544e9_b.jpg) + +如果需要的话,你可以自定义其它东西(通过点击其它标签),例如连接速度、压缩、屏幕分辨率等等。 + +![](https://farm9.staticflickr.com/8699/16984498482_665b975eca_b.jpg) + +![](https://farm9.staticflickr.com/8694/16985838755_1b7df1eb78_b.jpg) + +当你初始化一个远程桌面连接的时候,会要求你登录。输入你的 SSH 登录名和密码。 + +![](https://farm9.staticflickr.com/8754/16984498432_1c8068b817_b.jpg) + +成功登陆后,你会看到远程桌面屏幕。 + +![](https://farm9.staticflickr.com/8752/16798126858_1ab083ba80_c.jpg) + +如果你想测试 X2Go 的无缝窗口功能,选择 "Single application" 会话类型,然后指定远处主机上可执行文件的路径。在该例子中,我选择远程 KDE 主机上的 Dolphin 文件管理器。 + +![](https://farm8.staticflickr.com/7584/16798393920_128c3af9c5_b.jpg) + +你成功连接后,你会在本地桌面上看到一个远程应用窗口,而不是完整的远程桌面屏幕。 + +![](https://farm9.staticflickr.com/8742/16365755713_7b90cf65f0_c.jpg) + +### 总结 ### + +在这篇教程中,我介绍了如何在 [Linux VPS][8] 实例上设置 X2Go 远程桌面。正如你所看到的,整个设置过程都非常简单(如果你使用一个合适的桌面环境的话)。尽管对于特定桌面仍有问题,X2Go 是一个安全、功能丰富、快速并且免费的远程桌面解决方案。 + +X2Go 的什么功能最吸引你?欢迎分享你的观点。 + +-------------------------------------------------------------------------------- + +via: http://xmodulo.com/x2go-remote-desktop-linux.html + +作者:[Dan Nanni][a] +译者:[ictlyh](https://github.com/ictlyh) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://xmodulo.com/author/nanni +[1]:http://ask.xmodulo.com/centos-remote-desktop-vps.html +[2]:http://wiki.x2go.org/ +[3]:http://xmodulo.com/go/digitalocean +[4]:http://xmodulo.com/how-to-set-up-vnc-over-ssh.html +[5]:http://wiki.x2go.org/doku.php/doc:newtox2go +[6]:http://wiki.x2go.org/doku.php/doc:de-compat +[7]:https://linux.cn/article-2324-1.html +[8]:http://xmodulo.com/go/digitalocean +[9]:https://en.wikipedia.org/wiki/NX_technology \ No newline at end of file From e04092dbd2c2b42e959f9518034a44dbbbc7c493 Mon Sep 17 00:00:00 2001 From: wwy Date: Fri, 26 Jun 2015 10:28:29 +0800 Subject: [PATCH 466/965] Update 20150616 Linux Humor on the Command-line.md --- sources/share/20150616 Linux Humor on the Command-line.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/share/20150616 Linux Humor on the Command-line.md b/sources/share/20150616 Linux Humor on the Command-line.md index 84c808e555..47f1d0eb26 100644 --- a/sources/share/20150616 Linux Humor on the Command-line.md +++ b/sources/share/20150616 Linux Humor on the Command-line.md @@ -1,3 +1,5 @@ +translating by wwy-hust + Linux Humor on the Command-line ================================================================================ The desktop is full of eye candy. It enhances the visual experience and, in some cases, can also increase functionality of software. But it also makes software fun. Working on the command-line does not have to be always serious. If you want some fun on the command-line, there are lots of commands to raise a smile. @@ -124,4 +126,4 @@ via: http://www.linuxlinks.com/article/20150614112018846/Humor.html [4]:http://www.robobunny.com/projects/asciiquarium/html/ [5]:https://github.com/mtoyoda/sl [6]:http://aa-project.sourceforge.net/aalib/ -[7]:http://www.asty.org/cmatrix/ \ No newline at end of file +[7]:http://www.asty.org/cmatrix/ From cabb908a65212f023dbc99eb0f1c8249ccdcb7d8 Mon Sep 17 00:00:00 2001 From: ictlyh Date: Fri, 26 Jun 2015 10:48:31 +0800 Subject: [PATCH 467/965] [Translating] sources/tech/20150127 25 Useful Apache '.htaccess' Tricks to Secure and Customize Websites.md --- ...Apache '.htaccess' Tricks to Secure and Customize Websites.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20150127 25 Useful Apache '.htaccess' Tricks to Secure and Customize Websites.md b/sources/tech/20150127 25 Useful Apache '.htaccess' Tricks to Secure and Customize Websites.md index e9e8ecb4eb..91b2308228 100644 --- a/sources/tech/20150127 25 Useful Apache '.htaccess' Tricks to Secure and Customize Websites.md +++ b/sources/tech/20150127 25 Useful Apache '.htaccess' Tricks to Secure and Customize Websites.md @@ -1,3 +1,4 @@ +ictlyh Translating 25 Useful Apache ‘.htaccess’ Tricks to Secure and Customize Websites ================================================================================ Websites are important parts of our lives. They serve the means to expand businesses, share knowledge and lots more. Earlier restricted to providing only static contents, with introduction of dynamic client and server side scripting languages and continued advancement of existing static language like html to html5, adding every bit of dynamicity is possible to the websites and what left is expected to follow soon in near future. From 523ee8bb9cee7cd8457376d6ce5aaedf9adbf14e Mon Sep 17 00:00:00 2001 From: DeadFire Date: Fri, 26 Jun 2015 14:58:15 +0800 Subject: [PATCH 468/965] =?UTF-8?q?20150626-1=20=E9=80=89=E9=A2=98=20strug?= =?UTF-8?q?gling=20=E6=8E=A8=E8=8D=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...erformance Tuning and Optimization Tips.md | 305 ++++++++++++++++++ 1 file changed, 305 insertions(+) create mode 100644 sources/tech/20150626 15 Useful MySQL or MariaDB Performance Tuning and Optimization Tips.md diff --git a/sources/tech/20150626 15 Useful MySQL or MariaDB Performance Tuning and Optimization Tips.md b/sources/tech/20150626 15 Useful MySQL or MariaDB Performance Tuning and Optimization Tips.md new file mode 100644 index 0000000000..6e9172c685 --- /dev/null +++ b/sources/tech/20150626 15 Useful MySQL or MariaDB Performance Tuning and Optimization Tips.md @@ -0,0 +1,305 @@ +15 Useful MySQL/MariaDB Performance Tuning and Optimization Tips +================================================================================ +MySQL is a powerful open source Relational Database Management System or in short RDBMS. It was released back in 1995 (20 years old). It uses Structured Query Language which is probably the most popular choice for managing content within a database. The latest MySQL version is 5.6.25 and was released on 29 May 2015. + +An interesting fact about MySQL is the fact that the name comes from Michael Widenius’s (MySQL’s creator) daughter My. Even though there are plenty of interesting facts about MySQL, this article is meant to show you some useful practices to help you manage your MySQL server. + +![MySQL Performance Tuning](http://www.tecmint.com/wp-content/uploads/2015/06/MySQL-Performance-Tuning1.png) + +MySQL Performance Tuning + +In April 2009 the MySQL project was bought by Oracle. As a result a MySQL community fork called MariaDB was created. The main reason for creating the fork was to keep the project free under the General Public License. + +Today MySQL and MariaDB are one of the most (if not the most) frequently used RDBMS used for web applications such as WordPress, Joomla, Magento and others. + +This article will show you some basic, yet useful tips how to optimize the fine tune the performance of MySQL/MariaDB. Please keep in mind that this article assumes that you already have MySQL or MariaDB installed. If you are still wondering how to install them on your system, you can follow our extensive guides here: + +- [Installing LAMP on RHEL/CentOS 7][1] +- [Installing LAMP on Fedora 22][2] +- [Setting Up LAMP on Ubuntu 15.04][3] +- [Installing MariaDB on Debian 8][4] +- [Install MariaDB on Gentoo Linux][5] +- [Install MariaDB on Arch Linux][6] + +**Important**: Before we start – do not accept this suggestions blindly. Each MySQL setup is unique and requires additional thought, before making any changes. + +Things you need to know: + +- MySQL/MariaDB configuration file is located in `/etc/my.cnf`. Every time you modify this file you will need to restart the MySQL service so the new changes can take effect. +- For writing this article MySQL version 5.6 has been used as template. + +### 1. Enable InnoDB file-per-table ### + +First it is important to explain that InnoDB is a storage engine. MySQL and MariaDB use InnoDB as default storage engine. In the past MySQL used to keep database tables and indexes in a system tablespace. This approach was meant for servers which sole purpose is database processing and their storage disk is not used for any other purposes. + +The InnoDB provides more flexible approach and each database information is kept in a `.ibd` data file. Each .ibd file represents a tablespace of its own. That way database operations such as “TRUNCATE” can be completed faster and you may also reclaim unused space when dropping or truncating a database table. + +Another benefit of this configuration is the fact that you can keep some of the database tables in a separate storage device. This can greatly improve the I/O load on your disks. + +The innodb_file_per_table is enabled by default in MySQL 5.6 and above. You can see that in /etc/my.cnf file. The directive looks like this: + + innodb_file_per_table=1 + +### 2. Store MySQL Database Data on Separate Partition ### + +**Note**: This setup only works with MySQL, but not with MariaDB. + +Sometimes OS read/writes can slow down the performance of your MySQL server, especially if located on same hard drive. Instead, I would recommend using separate hard drive (preferably SSD) for the MySQL service. + +To complete, this you will need to attach the new drive to your computer/server. For the purpose of this article, I will assume that the drive will be under /dev/sdb. + +The next step is to prepare the new drive: + + # fdisk /dev/sdb + +Now press “n” to create new partition. Next press “p” to make the new partition primary. After that, set the partition number from 1-4. After that you will select the partition size. Press enter here. On the next step you will need to configure the size of the partition. + +If you wish to use the entire disk press enter once more. Otherwise you can manually set the size of the new partition. When ready press “w” to write the changes. Now we will need to create a filesystem for our new partition. This can be easily done with: + + # mkfs.ext4 /dev/sdb1 + +Now we will mount our new partition in a folder. I have named my folder “ssd” and created in the root directory: + + # mkdir /ssd/ + +We are ready to mount the new partition we just made in the new folder: + + # mount /dev/sdb1 /ssd/ + +You can perform the mount at startup by adding the following line in /etc/fstab file. + + /dev/sdb1 /ssd ext3 defaults 0 0 + +Now you are ready to move MySQL to the new disk. First stop the MySQL service with: + + # service mysqld stop + +I would recommend you stopping Apache/nginx as well to prevent any attempts to write in the databases: + + # service httpd stop + # service nginx stop + +Now copy the entire MySQL directory in the new drive: + + # cp /var/lib/mysql /ssd/ -Rp + +This may take a while depending on the site of your MySQL databases. Once this process is complete rename the MySQL directory: + + # mv /var/lib/mysql /var/lib/mysql-backup + +Next we will create a symlink. + + # ln -s /ssd/mysql /var/lib/mysql + +Now you are ready to start your MySQL and web service: + + # service mysqld start + # service httpd start + # service nginx start + +At this point your MySQL databases will be accessed from the new drive. + +### 3. Optimizing InnoDB buffer pool Usage ### + +The InnoDB engine has a buffer pool used for caching data and indexes in memory. This of course will help your MySQL/MariaDB queries be executed significantly faster. Choosing the proper size here requires some very important decisions and good knowledge on your system’s memory consumption. + +Here is what you need to consider: + +- How much memory you need for other processes. This includes your system processes, page tables, socket buffers. +- Is your server dedicated for MySQL or you will be running other memory hungry services. + +On a dedicated box, you would probably want to give about 60-70% of the memory to the innodb_buffer_pool_size. If you plan on running more services on a single box, you should re-consider the amount of memory you dedicate for your innodb_buffer_pool_size. + +The value that you should edit in my.cnf is: + + innodb_buffer_pool_size + +### 4. Avoid Swappiness in MySQL ### + +Swapping is process that occurs when system moves part of memory to a special disk space called “swap”. The event usually appears when your system runs out of physical memory and instead of freeing up some RAM, the system pushed the information into disk. As you might have guess the disk is much slower than your RAM. + +By default the option is enabled: + + # sysctl vm.swappiness + + vm.swappiness = 60 + +To disable swappiness, run the following command: + + # sysctl -w vm.swappiness=0 + +### 5. Set MySQL Max Connections ### + +The max_connections directive tells your server how many concurrent connections are permitted. The MySQL/MariaDB server allows the value given in max_connections + 1 for user with SUPER privileges. The connection is opened only for the time MySQL query is executed – after that it is closed and new connection can take its place. + +Keep in mind that too many connections can cause high RAM usage and lock up your MySQL server. Usually small websites will require between 100-200 connections while larger may require 500-800 or even more. The value you apply here strongly depends on your particular MySQL/MariaDB usage. + +You can dynamically change the value of `max_connections`, without having to restart the MySQL service by running: + + # mysql -u root -p + mysql> set global max_connections := 300; + +### 6. Configure MySQL thread_cache_size ### + +The `thread_cache_size` directive sets the amount of threads that your server should cache. As the client disconnects, his threads are put in the cache if they are less than the thread_cache_size. Further requests are completed by using the threads stored in the cache. + +To improve your performance you can set the thread_cache_size to a relatively high number. To find the thread cache hit rate, you can use the following technique: + + mysql> show status like 'Threads_created'; + mysql> show status like 'Connections'; + +Now use the following formula to calculate the thread cache hit rate percentage: + + 100 - ((Threads_created / Connections) * 100) + +If you get a low number, it means that most of the new mysql connections are starting new thread instead of loading from cache. You will surely want to increase the thread_cache_size in such cases. + +The good thing here is that the thread_cache_size can be dynamically changed without having to restart the MySQL service. You can achieve this by running: + + mysql> set global thread_cache_size = 16; + +### 7. Disable MySQL Reverse DNS Lookups ### + +By default MySQL/MariaDB perform a DNS lookup of the user’s IP address/Hostname from which the connection is coming. For each client connection, the IP address is checked by resolving it to a host name. After that the host name is resolved back to an IP to verify that both match. + +This unfortunately may cause delays in case of badly configured DNS or problems with DNS server. This is why you can disable the reverse DNS lookup by adding the following in your configuration file: + + [mysqld] + # Skip reverse DNS lookup of clients + skip-name-resolve + +You will have to restart the MySQL service after applying these changes. + +### 8. Configure MySQL query_cache_size ### + +If you have many repetitive queries and your data does not change often – use query cache. People often do not understand the concept behind the `query_cache_size` and set this value to gigabytes, which can actually cause degradation in the performance. + +The reason behind that is the fact that threads need to lock the cache during updates. Usually value of 200-300 MB should be more than enough. If your website is relatively small, you can try giving the value of 64M and increase in time. + +You will have to add the following settings in the MySQL configuration file: + + query_cache_type = 1 + query_cache_limit = 256K + query_cache_min_res_unit = 2k + query_cache_size = 80M + +### 9. Configure tmp_table_size and max_heap_table_size ### + +Both directives should have the same size and will help you prevent disk writes. The `tmp_table_size` is the maximum amount of size of internal in-memory tables. In case the limit in question is exceeded the table will be converted to on-disk MyISAM table. + +This will affect the database performance. Administrators usually recommend giving 64M for both values for every GB of RAM on the server. + + [mysqld] + tmp_table_size= 64M + max_heap_table_size= 64M + +### 10. Enable MySQL Slow query Logs ### + +Logging slow queries can help you determine issues with your database and help you debug them. This can be easily enabled by adding the following values in your MySQL configuration file: + + slow-query-log = 1 + slow-query-log-file = /var/lib/mysql/mysql-slow.log + long_query_time = 1 + +The first directive enables the logging of slow queries, while the second one tells MySQL where to store the actual log file. Use `long_query_time` to define the amount of time that is considered long for MySQL query to be completed. + +### 11. Check for MySQL idle Connections ### + +Idle connections consume resources and should be interrupted or refreshed when possible. Such connections are in “sleep” state and usually stay that way for long period of time. To look for idled connections you can run the following command: + + # mysqladmin processlist -u root -p | grep “Sleep” + +This will show you list of processes that are in sleep state. The event appears when the code is using persistent connection to the database. When using PHP this event can appear when using mysql_pconnect which opens the connection, after that executes queries, removes the authentication and leaves the connection open. This will cause any per-thread buffers to be kept in memory until the thread dies. + +The first thing you would do here is to check the code and fix it. If you don’t have access to the code that is being ran, you can change the `wait_timeout` directive. The default value is 28800 seconds, while you can safely decrease it to something like 60: + + wait_timeout=60 + +### 12. Choosing Right MySQL Filesystem ### + +Choosing the right filesystem is vital for your databases. Most important things you need to consider here are – data integrity, performance and ease of administration. + +As per MariaDB’s recommendations, the best file systems are XFS, Ext4 and Btrfs. All of them are enterprise journaling filesystems that can be used with very large files and large storage volumes. + +Below you can find some useful information about the three filesystems: + +注:表格 + + + + + + + + + + + + + + + + + + + + + + + +
FilesystemsXFSExt4Btrfs
Maximum filesystem size8EB1EB16EB
Maximum file size8EB16TB16EB
+ +The pros and cons of the Linux filesystems have been extensively covered in our article: + +- [Linux Filesystem Explained][7] + +### 13. Set MySQL max_allowed_packet ### + +MySQL splits data into packets. Usually a single packet is considered a row that is sent to a client. The `max_allowed_packet` directive defines the maximum size of packet that can be sent. + +Setting this value too low can cause a query to stall and you will receive an error in your MySQL error log. It is recommended to set the value to the size of your largest packet. + +### 14. Check MySQL Performance Tuning ### + +Measuring your MySQL/MariaDB performance is something that you should do on regular basis. This will help you see if something in the resource usage changes or needs to be improved. + +There are plenty of tools available for benchmarking, but I would like to suggest you one that is simple and easy to use. The tool is called mysqltuner. + +To download and run it, use the following set of commands: + + # wget https://github.com/major/MySQLTuner-perl/tarball/master + # tar xf master + # cd major-MySQLTuner-perl-993bc18/ + # ./mysqltuner.pl + +You will receive a detailed report about your MySQL usage and recommendation tips. Here is a sample output of default MariaDB installation: + +![MySQL Performance Tuning](http://www.tecmint.com/wp-content/uploads/2015/06/MySQL-Performance-Tuning.png) + +### 15. Optimize and Repair MySQL Databases ### + +Sometimes MySQL/MariaDB database tables get crashed quite easily, especially when unexpected server shut down, sudden file system corruption or during copy operation, when database is still accessed. Surprisingly, there is a free open source tool called ‘mysqlcheck‘, which automatically check, repair and optimize databases of all tables in Linux. + + # mysqlcheck -u root -p --auto-repair --check --optimize --all-databases + # mysqlcheck -u root -p --auto-repair --check --optimize databasename + +That’s it! I hope you have found the above article useful and help you tune up your MySQL server. As always if you have any further questions or comments, please submit them in the comment section below. + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/mysql-mariadb-performance-tuning-and-optimization/ + +作者:[Marin Todorov][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/marintodorov89/ +[1]:http://www.tecmint.com/install-lamp-in-centos-7/ +[2]:http://www.tecmint.com/install-lamp-linux-apache-mysql-php-on-fedora-22/ +[3]:http://www.tecmint.com/install-lamp-on-ubuntu-15-04/ +[4]:http://www.tecmint.com/install-mariadb-in-debian/ +[5]:http://www.tecmint.com/install-lemp-in-gentoo-linux/ +[6]:http://www.tecmint.com/install-lamp-in-arch-linux/ +[7]:http://www.tecmint.com/linux-file-system-explained/ \ No newline at end of file From 30d13996eb4954b518e42eed3a54ff05157f5c8a Mon Sep 17 00:00:00 2001 From: struggling <630441839@qq.com> Date: Fri, 26 Jun 2015 15:51:41 +0800 Subject: [PATCH 469/965] Update 20150626 15 Useful MySQL or MariaDB Performance Tuning and Optimization Tips.md --- ...SQL or MariaDB Performance Tuning and Optimization Tips.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150626 15 Useful MySQL or MariaDB Performance Tuning and Optimization Tips.md b/sources/tech/20150626 15 Useful MySQL or MariaDB Performance Tuning and Optimization Tips.md index 6e9172c685..e01e9bf787 100644 --- a/sources/tech/20150626 15 Useful MySQL or MariaDB Performance Tuning and Optimization Tips.md +++ b/sources/tech/20150626 15 Useful MySQL or MariaDB Performance Tuning and Optimization Tips.md @@ -1,3 +1,5 @@ +translation by strugglingyouth + 15 Useful MySQL/MariaDB Performance Tuning and Optimization Tips ================================================================================ MySQL is a powerful open source Relational Database Management System or in short RDBMS. It was released back in 1995 (20 years old). It uses Structured Query Language which is probably the most popular choice for managing content within a database. The latest MySQL version is 5.6.25 and was released on 29 May 2015. @@ -302,4 +304,4 @@ via: http://www.tecmint.com/mysql-mariadb-performance-tuning-and-optimization/ [4]:http://www.tecmint.com/install-mariadb-in-debian/ [5]:http://www.tecmint.com/install-lemp-in-gentoo-linux/ [6]:http://www.tecmint.com/install-lamp-in-arch-linux/ -[7]:http://www.tecmint.com/linux-file-system-explained/ \ No newline at end of file +[7]:http://www.tecmint.com/linux-file-system-explained/ From e81d5f0aa7f2de4959eab496c4fb3c3e7f309b5b Mon Sep 17 00:00:00 2001 From: ictlyh Date: Fri, 26 Jun 2015 19:37:39 +0800 Subject: [PATCH 470/965] [Translated] sources/tech/20150127 25 Useful Apache '.htaccess' Tricks to Secure and Customize Websites.md --- ...Tricks to Secure and Customize Websites.md | 423 ------------------ ...Tricks to Secure and Customize Websites.md | 422 +++++++++++++++++ 2 files changed, 422 insertions(+), 423 deletions(-) delete mode 100644 sources/tech/20150127 25 Useful Apache '.htaccess' Tricks to Secure and Customize Websites.md create mode 100644 translated/tech/20150127 25 Useful Apache '.htaccess' Tricks to Secure and Customize Websites.md diff --git a/sources/tech/20150127 25 Useful Apache '.htaccess' Tricks to Secure and Customize Websites.md b/sources/tech/20150127 25 Useful Apache '.htaccess' Tricks to Secure and Customize Websites.md deleted file mode 100644 index 91b2308228..0000000000 --- a/sources/tech/20150127 25 Useful Apache '.htaccess' Tricks to Secure and Customize Websites.md +++ /dev/null @@ -1,423 +0,0 @@ -ictlyh Translating -25 Useful Apache ‘.htaccess’ Tricks to Secure and Customize Websites -================================================================================ -Websites are important parts of our lives. They serve the means to expand businesses, share knowledge and lots more. Earlier restricted to providing only static contents, with introduction of dynamic client and server side scripting languages and continued advancement of existing static language like html to html5, adding every bit of dynamicity is possible to the websites and what left is expected to follow soon in near future. - -With websites, comes the need of a unit that can display these websites to a huge set of audience all over the globe. This need is fulfilled by the servers that provide means to host a website. This includes a list of servers like: Apache HTTP Server, Joomla, and WordPress that allow one to host their websites. - -![Apache htaccess Tricks](http://www.tecmint.com/wp-content/uploads/2015/01/htaccess-tricks.jpg) -25 htaccess Tricks - -One who wants to host a website can create a local server of his own or can contact any of above mentioned or any another server administrator to host his website. But the actual issue starts from this point. Performance of a website depends mainly on following factors: - -- Bandwidth consumed by the website. -- How secure is the website against hackers. -- Optimism when it comes to data search through the database -- User-friendliness when it comes to displaying navigation menus and providing more UI features. - -Alongside this, various factors that govern success of servers in hosting websites are: - -- Amount of data compression achieved for a particular website. -- Ability to simultaneously serve multiple clients asking for a same or different website. -- Securing the confidential data entered on the websites like: emails, credit card details and so on. -- Allowing more and more options to enhance dynamicity to a website. - -This article deals with one such feature provided by the servers that help enhance performance of websites along with securing them from bad bots, hotlinks etc. i.e. ‘.htaccess‘ file. - -### What is .htaccess? ### - -htaccess (or hypertext access) are the files that provide options for website owners to control the server environment variables and other parameters to enhance functionality of their websites. These files can reside in any and every directory in the directory tree of the website and provide features to the directory and the files and folders inside it. - -What are these features? Well these are the server directives i.e. the lines that instruct server to perform a specific task, and these directives apply only to the files and folders inside the folder in which this file is placed. These files are hidden by default as all Operating System and the web servers are configured to ignore them by default but making the hidden files visible can make you see this very special file. What type of parameters can be controlled is the topic of discussion of subsequent sections. - -Note: If .htaccess file is placed in /apache/home/www/Gunjit/ directory then it will provide directives for all the files and folders in that directory, but if this directory contains another folder namely: /Gunjit/images/ which again has another .htaccess file then the directives in this folder will override those provided by the master .htaccess file (or file in the folder up in hierarchy). - -### Apache Server and .htaccess files ### - -Apache HTTP Server colloquially called Apache was named after a Native American Tribe Apache to respect its superior skills in warfare strategy. Build on C/C++ and XML it is cross-platform web server which is based on NCSA HTTPd server and has a key role in growth and advancement of World Wide Web. - -Most commonly used on UNIX, Apache is available for wide variety of platforms including FreeBSD, Linux, Windows, Mac OS, Novel Netware etc. In 2009, Apache became the first server to serve more than 100 million websites. - -Apache server has one .htaccess file per user in www/ directory. Although these files are hidden but can be made visible if required. In www/ directory there are a number of folders each pertaining to a website named on user’s or owner’s name. Apart from this you can have one .htaccess file in each folder which configured files in that folder as stated above. - -How to configure htaccess file on Apache server is as follows… - -### Configuration on Apache Server ### - -There can be two cases: - -#### Hosting website on own server #### - -In this case, if .htaccess files are not enabled, you can enable .htaccess files by simply going to httpd.conf (Default configuration file for Apache HTTP Daemon) and finding the section. - - - -And locate the line that says… - - AllowOverride None - -And correct it to. - - AllowOverride All - -Now, on restarting Apache, .htaccess will work. - -#### Hosting website on different hosting provider server #### - -In this case it is better to consult the hosting admin, if they allow access to .htaccess files. - -### 25 ‘.htaccess’ Tricks of Apache Web Server for Websites ### - -#### 1. How to enable mod_rewrite in .htaccess file #### - -mod_rewrite option allows you to use redirections and hiding your true URL with redirecting to some other URL. This option can prove very useful allowing you to replace the lengthy and long URL’s to short and easy to remember ones. - -To allow mod_rewrite just have a practice to add the following line as the first line of your .htaccess file. - - Options +FollowSymLinks - -This option allows you to follow symbolic links and thus enable the mod_rewrite option on the website. Replacing the URL with short and crispy one is presented later on. - -#### 2. How to Allow or Deny Access to Websites #### - -htaccess file can allow or deny access of website or a folder or files in the directory in which it is placed by using order, allow and deny keywords. - -**Allowing access to only 192.168.3.1 IP** - - Order Allow, Deny - Deny from All - Allow from 192.168.3.1 - - OR - - Order Allow, Deny - Allow from 192.168.3.1 - -Order keyword here specifies the order in which allow, deny access would be processed. For the above ‘Order’ statement, the Allow statements would be processed first and then the deny statements would be processed. - -**Denying access to only one IP Address** - -The below lines provide the means to allow access of the website to all the users accept one with IP Address: 192.168.3.1. - - rder Allow, Deny - Deny from 192.168.3.1 - Allow from All - - OR - - - Order Deny, Allow - Deny from 192.168.3.1 - -#### 3. Generate Apache Error documents for different error codes. #### - -Using some simple lines, we can fix the error document that run on different error codes generated by the server when user/client requests a page not available on the website like most of us would have seen the ‘404 Page not found’ page in their web browser. ‘.htaccess’ files specify what action to take in case of such error conditions. - -To do this, the following lines are needed to be added to the ‘.htaccess’ files: - - ErrorDocument - -‘ErrorDocument’ is a keyword, error-code can be any of 401, 403, 404, 500 or any valid error representing code and lastly, ‘path-of-document’ represents the path on the local machine (in case you are using your own local server) or on the server (in case you are using any other’s server to host your website). - -**Example:** - - ErrorDocument 404 /error-docs/error-404.html - -The above line sets the document ‘error-404.html’ placed in error-docs folder to be displayed in case the 404 error is reported by the server for any invalid request for a page by the client. - -rrorDocument 404 "404 Page not found

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

" - -The above representation is also correct which places the string representing a usual html file. - -#### 4. Setting/Unsetting Apache server environment variables #### - -In .htaccess file you can set or unset the global environment variables that server allow to be modified by the hosters of the websites. For setting or unsetting the environment variables you need to add the following lines to your .htaccess files. - -**Setting the Environment variables** - - SetEnv OWNER “Gunjit Khera” - -Unsetting the Environment variables - - UnsetEnv OWNER - -#### 5. Defining different MIME types for files #### - -MIME (Multipurpose Internet Multimedia Extensions) are the types that are recognized by the browser by default when running any web page. You can define MIME types for your website in .htaccess files, so that different types of files as defined by you can be recognized and run by the server. - - - AddType application/javascript js - AddType application/x-font-ttf ttf ttc - - -Here, mod_mime.c is the module for controlling definitions of different MIME types and if you have this module installed on your system then you can use this module to define different MIME types for different extensions used in your website so that server can understand them. - -#### 6. How to Limit the size of Uploads and Downloads in Apache #### - -.htaccess files allow you the feature to control the amount of data being uploaded or downloaded by a particular client from your website. For this you just need to append the following lines to your .htaccess file: - - php_value upload_max_filesize 20M - php_value post_max_size 20M - php_value max_execution_time 200 - php_value max_input_time 200 - -The above lines set maximum upload size, maximum size of data being posted, maximum execution time i.e. the maximum time the a user is allowed to execute a website on his local machine, maximum time constrain within on the input time. - -#### 7. Making Users to download .mp3 and other files before playing on your website. #### - -Mostly, people play songs on websites before downloading them to check the song quality etc. Being a smart seller you can add a feature that can come in very handy for you which will not let any user play songs or videos online and users have to download them for playing. This is very useful as online playing of songs and videos consumes a lot of bandwidth. - -Following lines are needed to be added to be added to your .htaccess file: - - AddType application/octet-stream .mp3 .zip - -#### 8. Setting Directory Index for Website #### - -Most of website developers would already know that the first page that is displayed i.e. the home page of a website is named as ‘index.html’ .Many of us would have seen this also. But how is this set? - -.htaccess file provides a way to list a set of pages which would be scanned in order when a client requests to visit home page of the website and accordingly any one of the listed set of pages if found would be listed as the home page of the website and displayed to the user. - -Following line is needed to be added to produce the desired effect. - - DirectoryIndex index.html index.php yourpage.php - -The above line specifies that if any request for visiting the home page comes by any visitor then the above listed pages will be searched in order in the directory firstly: index.html which if found will be displayed as the sites home page, otherwise list will proceed to the next page i.e. index.php and so on till the last page you have entered in the list. - -#### 9. How to enable GZip compression for Files to save site’s bandwidth. #### - -This is a common observation that heavy sites generally run bit slowly than light weight sites that take less amount of space. This is just because for a heavy site it takes time to load the huge script files and images before displaying them on the client’s web browser. - -This is a common mechanism that when a browser requests a web page, server provides the browser with that webpage and now to locally display that web page, the browser has to download that page and then run the script inside that page. - -What GZip compression does here is saving the time required to serve a single customer thus increasing the bandwidth. The source files of the website on the server are kept in compressed form and when the request comes from a user then these files are transferred in compressed form which are then uncompressed and executed on the server. This improves the bandwidth constrain. - -Following lines can allow you to compress the source files of your website but this requires mod_deflate.c module to be installed on your server. - - - AddOutputFilterByType DEFLATE text/plain - AddOutputFilterByType DEFLATE text/html - AddOutputFilterByType DEFLATE text/xml - AddOutputFilterByType DEFLATE application/html - AddOutputFilterByType DEFLATE application/javascript - AddOutputFilterByType DEFLATE application/x-javascript - - -#### 10. Playing with the File types. #### - -There are certain conditions that the server assumes by default. Like: .php files are run on the server, similarly .txt files say for example are meant to be displayed. Like this we can make some executable cgi-scripts or files to be simply displayed as the source code on our website instead of being executed. - -To do this observe the following lines from a .htaccess file. - - RemoveHandler cgi-script .php .pl .py - AddType text/plain .php .pl .py - -These lines tell the server that .pl (perl script), .php (PHP file) and .py (Python file) are meant to just be displayed and not executed as cgi-scripts. - -#### 11. Setting the Time Zone for Apache server #### - -The power and importance of .htaccess files can be seen by the fact that this can be used to set the Time Zone of the server accordingly. This can be done by setting a global Environment variable ‘TZ’ of the list of global environment variables that are provided by the server to each of the hosted website for modification. - -Due to this reason only, we can see time on the websites (that display it) according to our time zone. May be some other person hosting his website on the server would have the timezone set according to the location where he lives. - -Following lines set the Time Zone of the Server. - - SetEnv TZ India/Kolkata - -#### 12. How to enable Cache Control on Website #### - -A very interesting feature of browser, most have observed is that on opening one website simultaneously more than one time, the latter one opens fast as compared to the first time. But how is this possible? Well in this case, the browser stores some frequently visited pages in its cache for faster access later on. - -But for how long? Well this answer depends on you i.e. on the time you set in your .htaccess file for Cache control. The .htaccess file can specify the amount of time for which the pages of website can stay in the browser’s cache and after expiration of time, it must revalidate i.e. pages would be deleted from the Cache and recreated the next time user visits the site. - -Following lines implement Cache Control for your website. - - - Header Set Cache-Control "max-age=3600, public" - - - Header Set Cache-Control "public" - Header Set Expires "Sat, 24 Jan 2015 16:00:00 GMT" - - -The above lines allow caching of the pages which are inside the directory in which .htaccess files are placed for 1 hour. - -#### 13. Configuring a single file, the option. #### - -Usually the content in .htaccess files apply to all the files and folders inside the directory in which the file is placed, but you can also provide some special permissions to a special file, like denying access to that file only or so on. - -For this you need to add tag to your file in a way like this: - - - Order allow, deny - Deny from 188.100.100.0 - - -This is a simple case of denying a file ‘conf.html’ from access by IP 188.100.100.0, but you can add any or every feature described for .htaccess file till now including the features yet to be described to the file like: Cache-control, GZip compression. - -This feature is used by most of the servers to secure .htaccess files which is the reason why we are not able to see the .htaccess files on the browsers. How the files are authenticated is demonstrated in subsequent heading. - -#### 14. Enabling CGI scripts to run outside of cgi-bin folder. #### - -Usually servers run CGI scripts that are located inside the cgi-bin folder but, you can enable running of CGI scripts located in your desired folder but just adding following lines to .htaccess file located in the desired folder and if not, then creating one, appending following lines: - - AddHandler cgi-script .cgi - Options +ExecCGI - -#### 15. How to enable SSI on Website with .htaccess #### - -Server side includes as the name suggests would be related to something included at the server side. But what? Generally when we have many pages in our website and we have a navigation menu on our home page that displays links to other pages then, we can enable SSI (Server Size Includes) option that allows all the pages displayed in the navigation menu to be included with the home page completely. - -The SSI allows inclusion of multiple pages as if content they contain is a part of a single page so that any editing needed to be done is done in one file only which saves a lot of disk space. This option is by default enabled on servers but for .shtml files. - -In case you want to enable it for .html files you need to add following lines: - - AddHandler server-parsed .html - -After this following in the html file would lead to SSI. - - - -#### 16. How to Prevent website Directory Listing #### - -To prevent any client being able to list the directories of the website on the server at his local machine add following lines to the file inside the directory you don’t want to get listed. - - Options -Indexes - -#### 17. Changing Default charset and language headers. #### - -.htaccess files allow you to modify the character set used i.e. ASCII or UNICODE, UTF-8 etc. for your website along with the default language used for the display of content. - -Following server’s global environment variables allow you to achieve above feature. - - AddDefaultCharset UTF-8 - DefaultLanguage en-US - -**Re-writing URL’s: Redirection Rules** - -Re-writing feature simply means replacing the long and un-rememberable URL’s with short and easy to remember ones. But, before going into this topic there are some rules and some conventions for special symbols used later on in this article. - -**Special Symbols:** - - Symbol Meaning - ^ - Start of the string - $ - End of the String - | - Or [a|b] – a or b - [a-z] - Any of the letter between a to z - + - One or more occurrence of previous letter - * - Zero or more occurrence of previous letter - ? - Zero or one occurrence of previous letter - -**Constants and their meaning:** - - Constant Meaning - NC - No-case or case sensitive - L - Last rule – stop processing further rules - R - Temporary redirect to new URL - R=301 - Permanent redirect to new URL - F - Forbidden, send 403 header to the user - P - Proxy – grab remote content in substitution section and return it - G - Gone, no longer exists - S=x - Skip next x rules - T=mime-type - Force specified MIME type - E=var:value - Set environment variable var to value - H=handler - Set handler - PT - Pass through – in case of URL’s with additional headers. - QSA - Append query string from requested to substituted URL - -#### 18. Redirecting a non-www URL to a www URL. #### - -Before starting with the explanation, lets first see the lines that are needed to be added to .htaccess file to enable this feature. - - RewriteEngine ON - RewriteCond %{HTTP_HOST} ^abc\.net$ - RewriteRule (.*) http://www.abc.net/$1 [R=301,L] - -The above lines enable the Rewrite Engine and then in second line check all those URL’s that pertain to host abc.net or have the HTTP_HOST environment variable set to “abc.net”. - -For all such URL’s the code permanently redirects them (as R=301 rule is enabled) to the new URL http://www.abc.net/$1 where $1 is the non-www URL having host as abc.net. The non-www URL is the one in bracket and is referred by $1. - -#### 19. Redirecting entire website to https. #### - -Following lines will help you transfer entire website to https: - - RewriteEngine ON - RewriteCond %{HTTPS} !on - RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} - -The above lines enable the re-write engine and then check the value of HTTPS environment variable. If it is on then re-write the entire pages of the website to https. - -#### 20. A custom redirection example #### - -For example, redirect url ‘http://www.abc.net?p=100&q=20 ‘ to ‘http://www.abc.net/10020pq’. - - RewriteEngine ON - RewriteRule ^http://www.abc.net/([0-9]+)([0-9]+)pq$ ^http://www.abc.net?p=$1&q=$2 - -In above lines, $1 represents the first bracket and $2 represents the second bracket. - -#### 21. Renaming the htaccess file #### - -For preventing the .htaccess file from the intruders and other people from viewing those files you can rename that file so that it is not accessed by client’s browser. The line that does this is: - - AccessFileName htac.cess - -#### 22. How to Prevent Image Hotlinking for your Website #### - -Another problem that is major factor of large bandwidth consumption by the websites is the problem of hot links which are links to your websites by other websites for display of images mostly of your website which consumes your bandwidth. This problem is also called as ‘bandwidth theft’. - -A common observation is when a site displays the image contained in some other site due to this hot-linking your site needs to be loaded and at the stake of your site’s bandwidth, the other site’s images are displayed. To prevent this for like: images such as: .gif, .jpeg etc. following lines of code would help: - - RewriteEngine ON - RewriteCond %{HTTP_REFERER} !^$ - RewriteCond %{HTTP_REFERERER} !^http://(www\.)?mydomain.com/.*$ [NC] - RewriteRule \.(gif|jpeg|png)$ - [F]. - -The above lines check if the HTTP_REFERER is not set to blank or not set to any of the links in your websites. If this is happening then all the images in your page are replaced by 403 forbidden. - -#### 23. How to Redirect Users to Maintenance Page. #### - -In case your website is down for maintenance and you want to notify all your clients that need to access your websites about this then for such cases you can add following lines to your .htaccess websites that allow only admin access and replace the site pages having links to any .jpg, .css, .gif, .js etc. - - RewriteCond %{REQUEST_URI} !^/admin/ [NC] - RewriteCond %{REQUEST_URI} !^((.*).css|(.*).js|(.*).png|(.*).jpg) [NC] - RewriteRule ^(.*)$ /ErrorDocs/Maintainence_Page.html - [NC,L,U,QSA] - -These lines check if the Requested URL contains any request for any admin page i.e. one starting with ‘/admin/’ or any request to ‘.png, .jpg, .js, .css’ pages and for any such requests it replaces that page to ‘ErrorDocs/Maintainence_Page.html’. - -#### 24. Mapping IP Address to Domain Name #### - -Name servers are the servers that convert a specific IP Address to a domain name. This mapping can also be specified in the .htaccess files in the following manner. - - For Mapping L.M.N.O address to a domain name www.hellovisit.com - RewriteCond %{HTTP_HOST} ^L\.M\.N\.O$ [NC] - RewriteRule ^(.*)$ http://www.hellovisit.com/$1 [L,R=301] - -The above lines check if the host for any page is having the IP Address as: L.M.N.O and if so the page is mapped to the domain name http://www.hellovisit.com by the third line by permanent redirection. - -#### 25. FilesMatch Tag #### - -Like tag that is used to apply conditions to a single file, can be used to match to a group of files and apply some conditions to the group of files as below: - - - Order Allow, Deny - Deny from All - - -### Conclusion ### - -The list of tricks that can be done with .htaccess files is much more. Thus, this gives us an idea how powerful this file is and how much security and dynamicity and other features it can give to your website. - -We’ve tried our best to cover as much as htaccess tricks in this article, but incase if we’ve missed any important trick, or you most welcome to post your htaccess ideas and tricks that you know via comments section below – we will include those in our article too… - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/apache-htaccess-tricks/ - -作者:[Gunjit Khera][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://www.tecmint.com/author/gunjitk94/ \ No newline at end of file diff --git a/translated/tech/20150127 25 Useful Apache '.htaccess' Tricks to Secure and Customize Websites.md b/translated/tech/20150127 25 Useful Apache '.htaccess' Tricks to Secure and Customize Websites.md new file mode 100644 index 0000000000..723ce313b2 --- /dev/null +++ b/translated/tech/20150127 25 Useful Apache '.htaccess' Tricks to Secure and Customize Websites.md @@ -0,0 +1,422 @@ +用于提高网站安全性和自定义网站的 25 个有用 Apache ‘.htaccess’ 小技巧 +================================================================================ +网站是我们生活中重要的一部分。它们是实现扩大业务、分享知识以及其它更多功能的方式。之前受制于只能提供静态内容,随着动态客户端和服务器端脚本语言的引入和现有静态语言的持续改进,例如从 html 到 html5,动态网站成为可能,剩下的也许在不久的将来也会实现。 + +有了网站,随之而来的是对能向全球大规模用户显示站点的单元的需求。这个需求通过托管网站的服务器实现。这包括一系列的服务器,例如:Apache HTTP Server、Joomla 以及 允许个人拥有自己网站的 WordPress。 + +![Apache htaccess 小技巧](http://www.tecmint.com/wp-content/uploads/2015/01/htaccess-tricks.jpg) +25 个 htaccess 小技巧 + +想要拥有一个网站,可以创建一个自己的本地服务器,或者联系任何上面提到的或其它服务器管理员来托管他的网站。但实际问题也从这点开始。网站的性能主要取决于以下因素: + +- 网站消耗的带宽。 +- 针对黑客网站有多安全。 +- 对数据库进行数据检索时的优化。 +- 显示导航菜单和提供更多 UI 功能时的用户友好性。 + +除此之外,保证托管网站服务器成功的多种因素还包括: + +- 对于一个流行站点的数据压缩量。 +- 同时为多个请求同一或不同站点的用户服务的能力。 +- 保证网站上输入的机密数据安全,例如:Email、信用卡信息等等。 +- 允许更多的选项用于增强站点的动态性。 + +这篇文章讨论一个服务器提供的用于增强网站性能和提高针对坏机器人、热链接等的安全性的功能。例如 ‘.htaccess’ 文件。 + +### .htaccess 是什么? ### + +htaccess (hypertext access,超文本访问) 是为网站所有者提供用于控制服务器环境变量以及其它参数的选项,从而增强他们网站的功能的文件。这些文件可以在网站目录树的任何一个目录中,并向该目录以及目录中的文件和子目录提供功能。 + +这些功能是什么呢?其实这些是服务器的指令,例如命令服务器执行特定任务的行,这些命令只对该文件所在目录中的文件和子目录有效。这些文件默认是隐藏的,因为所有操作系统和网站服务器默认配置为忽略。但让隐藏文件可见可以让你看到这些特殊文件。后续章节的话题将讨论能控制什么类型的参数。 + +注意:如果 .htaccess 文件保存在 /apache/home/www/Gunjit/ 目录,那么它会向该目录中的所有文件和子目录提供命令,但如果该目录包含一个名为 /Gunjit/images/ 子目录,且该子目录中也有一个 .htaccess 文件,那么这个子目录中的命令会覆盖父目录中 .htaccess 文件(或者层次结构中更上层文件)提供的命令。 + +### Apache Server 和 .htaccess 文件 ### + +Apache HTTP Server 俗称为 Apache,是为了表示对一个有卓越战争策略技能的美洲土著部落的尊敬而命名。它是用 C/C++ 和 XML 建立的基于 [NCSA HTTPd 服务器][1] 的跨平台 Web 服务器,它在万维网的成长和发展中起到了关键作用。 + +最常用于 UNIX,Apache 也能用于多种平台,包括 FreeBSD、Linux、Windows、Mac OS、Novel Netware 等。在 2009 年,Apache 成为第一个为超过一亿站点提供服务的服务器。 + +Apache 服务器对于 www/ 目录中的每个用户有一个单独的 .htaccess 文件。尽管这些文件是隐藏的,但如果需要的话可以使它们可见。在 www/ 目录中有很多子目录,每个子目录通过用户名或所有者名称命名,包含了一个站点。除此之外你可以在每个子目录中有一个 .htaccess 文件,像之前所述用于配置子目录中的文件。 + +下面介绍如果配置 Apache 服务器上的 htaccess 文件。 + +### Apache 服务器上的配置 ### + +这里有两种情况: + +#### 在自己的服务器上托管网站 #### + +在这种情况下,如果没有启用 .htaccess 文件,你可以通过在 http.conf(Apache HTTP 守护进程的默认配置文件) 中找到 部分启用。 + + + +定位如下行 + + AllowOverride None + +更改为 + + AllowOverride All + +现在,重启 Apache 后就启用了 .htaccess。 + +#### 在不同的托管服务提供商的服务器上托管网站 #### + +在这种情况下最好咨询托管管理员,如果他们允许访问 .htaccess 文件的话。 + +### 用于站点的 25 个 Apache Web 服务器 ‘.htaccess’ 小技巧 ### + +#### 1. 如何在 .htaccess 文件中启用 mod_rewrite #### + +mod_rewrite 选项允许你使用重定向并通过重定向到其它 URL 隐藏你真实的 URL。这个选项非常有用,允许你用短的容易记忆的 URL 替换长 URL。 + +要允许 mod_rewrite,只需要在你的 .htaccess 文件的第一行添加如下一行。 + + Options +FollowSymLinks + +该选项允许你跟踪符号链接从而在站点中启用 mod_rewrite。后面会介绍用短 URL 替换。 + +#### 2. 如果允许或禁止对站点的访问 #### + +通过使用 order、allow 和 deny 关键字,htaccess 文件可以允许或者禁止对站点或目录中子目录或文件的访问。 + +**只允许 IP 192.168.3.1 的访问** + + Order Allow, Deny + Deny from All + Allow from 192.168.3.1 + + 或 + + Order Allow, Deny + Allow from 192.168.3.1 + +这里的 Order 关键字指定处理 allow 和 deny 访问的顺序。对于上面的 ‘Order’ 语句,首先会处理 Allow 语句,然后是 deny 语句。 + +**只禁止某个 IP 的访问** + +下面一行的意思是除了 IP 地址 192.168.3.1,允许所有用户访问网站。 + + Order Allow, Deny + Deny from 192.168.3.1 + Allow from All + + 或 + + Order Deny, Allow + Deny from 192.168.3.1 + +#### 3. 为不同错误码生成 Apache 错误文档 #### + +用一些简单行,我们可以解决当用户/客户端请求一个站点上不可用的网页时服务器产生的错误码的错误文档,例如我们大部分人见过的浏览器中显示的 ‘404 Page not found’。‘.htaccess’ 文件指定了发生这些错误情况时采取何种操作。 + +要做到这点,需要添加下面的行到 ‘.htaccess’ 文件: + + ErrorDocument + +‘ErrorDocument’ 是一个关键字,error-code 可以是 401、403、404、500 或任何有效的表示错误的代码,最后 ‘path-of-document’ 表示本地机器上的路径(如果你使用的是你自己的本地服务器) 或 服务器上的路径(如果你使用任何其它服务器来托管网站)。 + +**例子:** + + ErrorDocument 404 /error-docs/error-404.html + +上面一行设置客户请求任何无效页面,服务器报告 404 错误时显示 error-docs 目录下的 ‘error-404.html’ 文档。 + +ErrorDocument 404 "404 Page not found

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

" + +上面的表示也正确,其中字符串表示一个普通的 html 文件。 + +#### 4. 设置/取消 Apache 服务器环境变量 #### + +在 .htaccess 文件中你可以设置或者取消站点所有者用来更改服务器设置的全局环境变量。要设置或取消环境变量,你需要在你的 .htaccess 文件中添加下面的行。 + +**设置环境变量** + + SetEnv OWNER “Gunjit Khera” + +**取消环境变量** + + UnsetEnv OWNER + +#### 5. 为文件定义不同 MIME 类型 #### + +MIME(Multipurpose Internet Multimedia Extensions,,多用途 Internet 多媒体扩展) 是浏览器运行任何页面默认能识别的类型。你可以在 .htaccess 文件中为你的站点定义 MIME 类型,然后服务器就可以识别你定义的类型的文件并运行。 + + + AddType application/javascript js + AddType application/x-font-ttf ttf ttc + + +这里,mod_mime.c 是用于控制定义不同 MIME 类型的模块,如果在你的系统中已经安装了这个模块,那么你就可以用该模块去为你站点中不同的扩展定义不同的 MIME 类型,从而服务器可以理解这些文件。 + +#### 6. 如何在 Apache 中限制上传和下载的大小 #### + +.htaccess 文件允许你拥有控制一个特定用户从你的站点上传或下载数据量大小的功能。要做到这点你只需要添加下面的行到你的 .htaccess 文件: + + php_value upload_max_filesize 20M + php_value post_max_size 20M + php_value max_execution_time 200 + php_value max_input_time 200 + +上面的行设置最大上传大小、最大推送数据大小、最大执行时间,例如允许用户在本地机器运行站点的最大时间、限制的最大输入时间。 + +#### 7. 让用户在站点上播放 .mp3 和其它文件之前预先下载 #### + +大部分情况下,人们在下载检查音乐质量之前会在网站上播放等等。作为一个聪明的销售者,你可以添加一个简单的功能,不允许任何用户在线播放音乐或视频,而是必须下载后才能播放。这非常有用,因为在线播放音乐和视频会消耗很多带宽。 + +要添加下面的行到你的 .htaccess 文件: + + AddType application/octet-stream .mp3 .zip + +#### 8. 为站点设置目录索引 #### + +大部分网站开发者都知道第一个显示的页面,例如一个站点的主页面,被命名为 ‘index.html’。我们大部分也见过这个。但是如何设置呢? + +.htaccess 文件提供了一种方式用于列出一个客户端请求访问网站的主页面时会顺序扫描的一些网页集,相应地如果找到了列出的页面中的任何一个就会作为站点的主页面并显示给用户。 + +需要添加下面的行产生所需的效果。 + + DirectoryIndex index.html index.php yourpage.php + +上面一行指定如果有任何访问主页面的请求到来,首先会在目录中顺序搜索上面列出的网页:如果发现了 index.html 则显示为主页面,否则会处理下一个页面,例如 index.php,如此直到你在列表中输入的最后一个页面。 + +#### 9. 如何为文件启用 GZip 压缩以节省网站带宽 #### + +繁重站点通常比只占少量空间的轻量级站点运行更慢是常见的现象。这是因为对于繁重站点需要时间加载大量的脚本文件和图片用于在客户端的 Web 浏览器上显示。 + +当浏览器请求一个 web 页面时,服务器提供给浏览器该页面并局部显示该 web 页面,浏览器需要下载该页面然后在页面内部运行脚本,这是一种常见机制。 + +这里 GZip 压缩所做的就是节省单个用户的服务时间从而提高带宽。服务器上站点的源文件以压缩形式保存,当用户请求到来的时候,这些文件以压缩形式传送,然后在服务器上解压并执行。这改进了带宽限制。 + +下面的行允许你压缩站点的源文件,但要求在你的服务器上安装 mod_deflate.c 模块。 + + + AddOutputFilterByType DEFLATE text/plain + AddOutputFilterByType DEFLATE text/html + AddOutputFilterByType DEFLATE text/xml + AddOutputFilterByType DEFLATE application/html + AddOutputFilterByType DEFLATE application/javascript + AddOutputFilterByType DEFLATE application/x-javascript + + +#### 10. 处理文件类型 #### + +服务器默认的有一些特定情况。例如:在服务器上运行 .php 文件,显示 .txt 文件。像这些我们可以以源代码形式只显示一些可执行 cgi 脚本或文件而不是执行它们。 + +要做到这点在 .htaccess 文件中有如下行。 + + RemoveHandler cgi-script .php .pl .py + AddType text/plain .php .pl .py + +这些行告诉服务器只显示而不执行 .pl (perl 脚本)、.php (PHP 文件) 和 .py (Python 文件) 。 + +#### 11. 为 Apache 服务器设置时区 #### + +.htaccess 文件可用于为服务器设置时区可以看出它的能力和重要性。这可以通过设置一个服务器为每个托管站点提供的一系列全局环境变量中的 ‘TZ’ 完成。 + +由于这个原因,我们可以在网站上看到根据我们的时区显示的时间。也许服务器上其他拥有网站的人会根据他居住地点的位置设置时区。 + +下面的一行为服务器设置时区。 + + SetEnv TZ India/Kolkata + +#### 12. 如果在站点上启用缓存控制 #### + +浏览器很有趣的一个功能是,已经观察到多次同时打开一个网站,和第一次打开相比之后会更快。但为什么会这样呢?事实上,浏览器在它的缓存中保存了一些通常访问的页面用于加快后面的访问。 + +但保存多长时间呢?这取决于你自己。例如,你的 .htaccess 文件中设置的缓存控制时间。.htaccess 文件指定了站点的网页可以在浏览器缓存中保存的时间,时间到期后需要重新验证,例如页面会从缓存中删除然后在下次用户访问站点的时候重建。 + +下面的行为你的站点实现缓存控制。 + + + Header Set Cache-Control "max-age=3600, public" + + + Header Set Cache-Control "public" + Header Set Expires "Sat, 24 Jan 2015 16:00:00 GMT" + + +上面的行允许缓存 .htaccess 文件所在目录中的页面一小时。 + +#### 13. 配置单个文件 #### + +通常 .htaccess 文件中的内容会对该文件所在目录中的所有文件和子目录起作用,但是你也可以对特殊文件设置一些特殊权限,例如只禁止对某个文件的访问等等。 + +要做到这点,你需要在文件中以类似方式添加 标记: + + + Order allow, deny + Deny from 188.100.100.0 + + +这是一个禁止 IP 188.100.100.0 访问 ‘conf.html’ 的简单例子,但是你也可以添加介绍过的 .htaccess 文件的任何功能,包括将要介绍的功能,例如:缓存控制、GZip 压缩。 + +大部分服务器会用这个功能增强 .htaccess 文件的安全,这也是我们在浏览器上看不到 .htaccess 文件的原因。在后面的章节中会介绍如何给文件授权。 + +#### 14. 启用在 cgi-bin 目录以外运行 CGI 脚本 #### + +通常服务器运行的 CGI 脚本都保存在 cgi-bin 目录中,但是你可以启用在你需要的目录运行 CGI 脚本,只需要在所需的目录中添加下面的行到 .htaccess 文件,如果没有改文件就创建一个,并添加下面的行: + + AddHandler cgi-script .cgi + Options +ExecCGI + +#### 15.如何用 .htaccess 在站点上启用 SSI #### + +服务器端包括顾名思义的和服务器部分相关的东西。但是什么呢?通常当我们在站点上有很多页面的时候,我们在主页面上会有一个显示到其它页面链接的导航菜单,我们可以启用 SSI(Server Size Includes) 选项允许导航菜单中显示的所有页面完全包含在主页面中。 + +SSI 允许包含多个页面,好像他们包含的内容就是一个单一页面的一部分,因此任何需要的编辑都只有一个文件,从而可以节省很多磁盘空间。除了 .shtml 文件,服务器默认启用了该选项。 + +如果你想要对 .html 启用该选项,你需要添加下面的行: + + AddHandler server-parsed .html + +这之后 html 文件会导向 SSI。 + + + +#### 16. 如何防止网站目录列表 #### + +为防止任何客户端在本地机器罗列服务器上的网站目录列表,添加下面的行到你不想列出的目录的文件中。 + + Options -Indexes + +#### 17. 更改默认字符集和语言头 #### + +.htaccess 文件允许你更改网站使用的字符集,例如 ASCII 或 UNICODE,UTF-8 等,以及用于显示内容的默认语言。 + +在服务器的全局环境变量之后添加下面语句可以实现上述功能。 + + AddDefaultCharset UTF-8 + DefaultLanguage en-US + +**重写 URL 的重定向规则** + +重写功能仅意味着用短而易记的 URL 替换长而难以记忆的 URL。但是,在开始这个话题之前,这里有一些本文后面会使用的特殊字符的规则和约定。 + +**特殊符号:** + + 符号 含义 + ^ - 字符串开头 + $ - 字符串结尾 + | - 或 [a|b] – a 或 b + [a-z] - a 到 z 的任意字母 + + - 之前字母的一次或多次出现 + * - 之前字母的零次或多次出现 + ? - 之前字母的零次或一次出现 + +**常量和它们的含义:** + + 常量 含义 + NC - 区分大小写 + L - 最后的规则 – 停止处理更多规则 + R - 临时重定向到新 URL + R=301 - 永久重定向到新 URL + F - 禁止发送 403 头给用户 + P - 代理 – 获取远程内容代替部分并返回 + G - Gone, 不再存在 + S=x - 跳过后面的 x 条规则 + T=mime-type - 强制指定 MIME 类型 + E=var:value - 设置环境变量 var 的值为 value + H=handler - 设置处理器 + PT - Pass through – 如果 URL 有额外的头 + QSA - 从到替换 URL 的请求追加查询字符串 + +#### 18. 重定向一个非 www URL 到 www URL #### + +在开始解释之前,首先看看启用该功能需要添加到 .htaccess 文件的行。 + + RewriteEngine ON + RewriteCond %{HTTP_HOST} ^abc\.net$ + RewriteRule (.*) http://www.abc.net/$1 [R=301,L] + +上面的行启用 Rewrite Engine 然后在第二行检查所有涉及到主机 abc.net 或 环境变量 HTTP_HOST 为 “abc.net” 的 URL。 + +对于所有这样的 URL,代码永久重定向它们(如果启用了 R=301 规则)到新 URL http://www.abc.net/$1,其中 $1 是主机为 abc.net 的非 www URL。非 www URL 是大括号内的内容,并通过 $1 引用。 + +#### 19. 重定向整个站点到 https #### + +下面的行会帮助你转换整个网站到 https: + + RewriteEngine ON + RewriteCond %{HTTPS} !on + RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} + +上面的行启用 re-write engine 然后检查环境变量 HTTPS 的值。如果设置了那么重写所有网站页面到 https。 + +#### 20.一个自定义重写例子 #### + +例如,重定向 url ‘http://www.abc.net?p=100&q=20’ 到 ‘http://www.abc.net/10020pq’。 + + RewriteEngine ON + RewriteRule ^http://www.abc.net/([0-9]+)([0-9]+)pq$ ^http://www.abc.net?p=$1&q=$2 + +在上面的行中,$1 表示第一个括号,$2 表示第二个括号。 + +#### 21. 重命名 htaccess 文件 #### + +为了防止入侵者和其他人查看 .htaccess 文件,你可以重命名该文件,这样就不能通过客户端浏览器访问。实现该目标的语句是: + + AccessFileName htac.cess + +#### 22. 如何为你的网站禁用图片链接 #### + +网站大的带宽消耗的另外一个重要问题是热链接问题,这是其它站点用于显示你网站的图片而链接到你的网站的链接,这会消耗你的带宽。这问题也被成为 ‘带宽盗窃’。 + +一个常见现象是当一个网站要显示其它网站所包含的图片时,由于该链接你的网站需要被加载,消耗你站点的带宽而显示其它站点的图片。为了防止出现这种情况,例如 .gif、.jpeg 图片等,下面的代码行会有所帮助: + + RewriteEngine ON + RewriteCond %{HTTP_REFERER} !^$ + RewriteCond %{HTTP_REFERERER} !^http://(www\.)?mydomain.com/.*$ [NC] + RewriteRule \.(gif|jpeg|png)$ - [F]. + +上面的行检查 HTTP_REFERER 是否没有设为空或没有设为你站点上的任何链接。如果是这样的话,你网页上的所有图片会用 403 禁止访问代替。 + +#### 23. 如何将用户重定向到维护页面 #### + +如果你的网站需要进行维护并且你想向所有需要访问该网站的你的所有客户通知这个消息,对于这种情况,你可以添加下面的行到你的 .htaccess 文件,从而只允许管理员访问并替换所有有 .jpg、.css、.gif、.js 等的页面。 + + RewriteCond %{REQUEST_URI} !^/admin/ [NC] + RewriteCond %{REQUEST_URI} !^((.*).css|(.*).js|(.*).png|(.*).jpg) [NC] + RewriteRule ^(.*)$ /ErrorDocs/Maintainence_Page.html + [NC,L,U,QSA] + +这些行检查请求 URL 是否包含任何例如以 ‘/admin/’ 开头的管理页面的请求,或任何到 ‘.png, .jpg, .js, .css’ 页面的请求,对于任何这样的请求,用 ‘ErrorDocs/Maintainence_Page.html’ 替换那个页面。 + +#### 24. 映射 IP 地址到域名 #### + +名称服务器是将特定 IP 地址转换为域名的服务器。该映射也可以在 .htaccess 文件中用以下形式指定。 + + 为了将地址 L.M.N.O 映射到域名 www.hellovisit.com + RewriteCond %{HTTP_HOST} ^L\.M\.N\.O$ [NC] + RewriteRule ^(.*)$ http://www.hellovisit.com/$1 [L,R=301] + +上面的行检查任何页面的主机是否包含类似 L.M.N.O 的 IP 地址,如果是的话第三行会通过永久重定向将页面映射到域名 http://www.hellovisit.com。 + +#### 25. FilesMatch 标签 #### + +类似用于应用条件到单个文件的 标签, 能用于匹配一组文件并对该组文件应用一些条件,如下: + + + Order Allow, Deny + Deny from All + + +### 结论 ### + +.htaccess 文件能实现的小技巧还有很多。这告诉了我们这个文件有多么强大,通过该文件能给你的站点添加多少安全性、动态性以及其它功能。 + +我们已经在这篇文章中尽最大努力覆盖尽可能多的 htaccess 小技巧,但如果我们缺少了任何重要的技巧,或者你愿意告诉我们你的 htaccess 想法和技巧,你可以在下面的评论框中提交,我们也会在文章中进行介绍。 + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/apache-htaccess-tricks/ + +作者:[Gunjit Khera][a] +译者:[ictlyh](https://github.com/ictlyh) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/gunjitk94/ +[1]:https://en.wikipedia.org/wiki/NCSA_HTTPd \ No newline at end of file From aa63327a7fdeb71d83cb86b4d992c49f1d5e4a32 Mon Sep 17 00:00:00 2001 From: wxy Date: Thu, 25 Jun 2015 09:47:15 +0800 Subject: [PATCH 471/965] PUB:20150527 Linux FAQs with Answers--How to mount an LVM partition on Linux @geekpi --- ...rs--How to mount an LVM partition on Linux.md | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) rename {translated/tech => published}/20150527 Linux FAQs with Answers--How to mount an LVM partition on Linux.md (77%) diff --git a/translated/tech/20150527 Linux FAQs with Answers--How to mount an LVM partition on Linux.md b/published/20150527 Linux FAQs with Answers--How to mount an LVM partition on Linux.md similarity index 77% rename from translated/tech/20150527 Linux FAQs with Answers--How to mount an LVM partition on Linux.md rename to published/20150527 Linux FAQs with Answers--How to mount an LVM partition on Linux.md index 391769edc2..1466c8c87e 100644 --- a/translated/tech/20150527 Linux FAQs with Answers--How to mount an LVM partition on Linux.md +++ b/published/20150527 Linux FAQs with Answers--How to mount an LVM partition on Linux.md @@ -1,10 +1,10 @@ -Linux有问必答 -- 如何在Linux中挂载LVM分区 +Linux有问必答:如何在Linux中直接挂载LVM分区 ================================================================================ > **提问**: 我有一个USB盘包含了LVM分区。 我想要在Linux中访问这些LVM分区。我该如何在Linux中挂载LVM分区? -】LVM是逻辑卷管理工具,它允许你使用逻辑卷和卷组的概念来管理磁盘空间。使用LVM相比传统分区最大的好处是弹性地位用户和程序分配空间而不用考虑每个物理磁盘的大小。 +LVM是逻辑卷管理工具,它允许你使用逻辑卷和卷组的概念来管理磁盘空间。使用LVM相比传统分区最大的好处是弹性地为用户和程序分配空间而不用考虑每个物理磁盘的大小。 -在LVM中,那些创建了逻辑分区的物理存储是传统的分区(比如:/dev/sda2,/dev/sdb1)。这些分区必须被初始化位“物理卷”并被标签(如,“Linux LVM”)来使它们可以在LVM中使用。一旦分区被标记被LVM分区,你不能直接用mount命令挂载。 +在LVM中,那些创建了逻辑分区的物理存储是传统的分区(比如:/dev/sda2,/dev/sdb1)。这些分区必须被初始化为“物理卷 PV”并加上卷标(如,“Linux LVM”)来使它们可以在LVM中使用。一旦分区被标记被LVM分区,你不能直接用mount命令挂载。 如果你尝试挂载一个LVM分区(比如/dev/sdb2), 你会得到下面的错误。 @@ -16,9 +16,9 @@ Linux有问必答 -- 如何在Linux中挂载LVM分区 ![](https://farm8.staticflickr.com/7696/17749902190_0a6d36821f_b.jpg) -要正确地挂载LVM分区,你必须挂载分区创建的“逻辑分区”。下面就是如何做的。 +要正确地挂载LVM分区,你必须挂载分区中创建的“逻辑卷”。下面就是如何做的。 -=首先,用下面的命令检查可用的卷组: +首先,用下面的命令检查可用的卷组: $ sudo pvs @@ -60,7 +60,9 @@ Linux有问必答 -- 如何在Linux中挂载LVM分区 ![](https://farm8.staticflickr.com/7707/17938137591_cdb4cbfb43_b.jpg) -如果你想要挂载一个特定的逻辑卷,使用“LV Path”下面的设备名(如:/dev/vg_ezsetupsystem40a8f02fadd0/lv_home)。 +*上图可以看到两个逻辑卷的名字:lv_root和lv_home* + +如果你想要挂载一个特定的逻辑卷,使用如下的“LV Path”的设备名(如:/dev/vg_ezsetupsystem40a8f02fadd0/lv_home)。 $ sudo mount /dev/vg_ezsetupsystem40a8f02fadd0/lv_home /mnt @@ -82,7 +84,7 @@ via: http://ask.xmodulo.com/mount-lvm-partition-linux.html 作者:[Dan Nanni][a] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 2ffee2ffe70643cc55101f87dd53576cc14adfea Mon Sep 17 00:00:00 2001 From: wxy Date: Thu, 25 Jun 2015 10:17:08 +0800 Subject: [PATCH 472/965] PUB:20150520 Shell Script to Backup Files or Directories Using rsync @GOLinux --- ...Backup Files or Directories Using rsync.md | 81 ++++++++++--------- 1 file changed, 41 insertions(+), 40 deletions(-) rename {translated/tech => published}/20150520 Shell Script to Backup Files or Directories Using rsync.md (51%) diff --git a/translated/tech/20150520 Shell Script to Backup Files or Directories Using rsync.md b/published/20150520 Shell Script to Backup Files or Directories Using rsync.md similarity index 51% rename from translated/tech/20150520 Shell Script to Backup Files or Directories Using rsync.md rename to published/20150520 Shell Script to Backup Files or Directories Using rsync.md index 639e58ede9..b987588c4f 100644 --- a/translated/tech/20150520 Shell Script to Backup Files or Directories Using rsync.md +++ b/published/20150520 Shell Script to Backup Files or Directories Using rsync.md @@ -1,6 +1,6 @@ Shell脚本:使用rsync备份文件/目录 ================================================================================ -本文,我们带来了shell脚本,用来使用rsync命令将你本地Linux机器上的文件/目录备份到远程Linux服务器上。使用该脚本实施备份会是一个交互的方式,你需要提供远程备份服务器的主机名/ip地址和文件夹位置。我们保留了一个独立文件,在这个文件中你需要提供需要备份的文件/目录。我们添加了两个脚本,**第一个脚本**在每次拷贝完一个文件后询问密码(如果你启用了ssh验证密钥,那么就不会询问密码),而第二个脚本中,则只会提示一次输入密码。 +本文我们介绍一个shell脚本,用来使用rsync命令将你本地Linux机器上的文件/目录备份到远程Linux服务器上。使用该脚本会以交互的方式实施备份,你需要提供远程备份服务器的主机名/ip地址和文件夹位置。我们使用一个单独的列表文件,在这个文件中你需要列出要备份的文件/目录。我们添加了两个脚本,**第一个脚本**在每次拷贝完一个文件后询问密码(如果你启用了ssh密钥验证,那么就不会询问密码),而第二个脚本中,则只会提示一次输入密码。 我们打算备份bckup.txt,dataconfig.txt,docs和orcledb。 @@ -12,7 +12,7 @@ Shell脚本:使用rsync备份文件/目录 drwxr-xr-x. 2 root root 4096 May 15 10:45 docs drwxr-xr-x. 2 root root 4096 May 15 10:44 oracledb -该文件包含了备份文件/目录的详情 +bckup.txt文件包含了需要备份的文件/目录的详情 [root@Fedora21 tmp]# cat /tmp/bckup.txt /tmp/oracledb @@ -24,46 +24,46 @@ Shell脚本:使用rsync备份文件/目录 #!/bin/bash - #We will save path to backup file in variable + # 将备份列表文件的路径保存到变量中 backupf='/tmp/bckup.txt' - #Next line just prints message + # 输入一个提示信息 echo "Shell Script Backup Your Files / Directories Using rsync" - #next line check if entered value is not null, and if null it will reask user to enter Destination Server + # 检查是否输入了目标服务器,如果为空就再次提示用户输入 while [ x$desthost = "x" ]; do - #next line prints what userd should enter, and stores entered value to variable with name desthost + # 提示用户输入目标服务器地址并保存到变量 read -p "Destination backup Server : " desthost - #next line finishes while loop + # 结束循环 done - #next line check if entered value is not null, and if null it will reask user to enter Destination Path + # 检查是否输入了目标文件夹,如果为空就再次提示用户输入 while [ x$destpath = "x" ]; do - #next line prints what userd should enter, and stores entered value to variable with name destpath + # 提示用户输入目标文件夹并保存到变量 read -p "Destination Folder : " destpath - #next line finishes while loop + # 结束循环 done - #Next line will start reading backup file line by line + # 逐行读取备份列表文件 for line in `cat $backupf` - #and on each line will execute next + # 对每一行都进行处理 do - #print message that file/dir will be copied + # 显示要被复制的文件/文件夹名称 echo "Copying $line ... " - #copy via rsync file/dir to destination + # 通过 rsync 复制文件/文件夹到目标位置 rsync -ar "$line" "$desthost":"$destpath" - #this line just print done + # 显示完成 echo "DONE" - #end of reading backup file + # 结束 done #### 运行带有输出结果的脚本 #### @@ -91,64 +91,65 @@ Shell脚本:使用rsync备份文件/目录 #!/bin/bash - #We will save path to backup file in variable + # 将备份列表文件的路径保存到变量中 backupf='/tmp/bckup.txt' - #Next line just prints message + # 输入一个提示信息 echo "Shell Script Backup Your Files / Directories Using rsync" - #next line check if entered value is not null, and if null it will reask user to enter Destination Server + # 检查是否输入了目标服务器,如果为空就再次提示用户输入 while [ x$desthost = "x" ]; do - #next line prints what userd should enter, and stores entered value to variable with name desthost + # 提示用户输入目标服务器地址并保存到变量 read -p "Destination backup Server : " desthost - #next line finishes while loop + # 结束循环 done - #next line check if entered value is not null, and if null it will reask user to enter Destination Path + # 检查是否输入了目标文件夹,如果为空就再次提示用户输入 while [ x$destpath = "x" ]; do - #next line prints what userd should enter, and stores entered value to variable with name destpath + # 提示用户输入目标文件夹并保存到变量 read -p "Destination Folder : " destpath - #next line finishes while loop + # 结束循环 done - #next line check if entered value is not null, and if null it will reask user to enter password + # 检查是否输入了目标服务器密码,如果为空就再次提示用户输入 while [ x$password = "x" ]; do - #next line prints what userd should enter, and stores entered value to variable with name password. #To hide password we are using -s key + # 提示用户输入密码并保存到变量 + # 使用 -s 选项不回显输入的密码 read -sp "Password : " password - #next line finishes while loop + # 结束循环 done - #Next line will start reading backup file line by line + # 逐行读取备份列表文件 for line in `cat $backupf` - #and on each line will execute next + # 对每一行都进行处理 do - #print message that file/dir will be copied + # 显示要被复制的文件/文件夹名称 echo "Copying $line ... " - #we will use expect tool to enter password inside script + # 使用 expect 来在脚本中输入密码 /usr/bin/expect << EOD - #next line set timeout to -1, recommended to use + # 推荐设置超时为 -1 set timeout -1 - #copy via rsync file/dir to destination, using part of expect — spawn command + # 通过 rsync 复制文件/文件夹到目标位置,使用 expect 的组成部分 spawn 命令 spawn rsync -ar ${line} ${desthost}:${destpath} - #as result of previous command we expect “password” promtp + # 上一行命令会等待 “password” 提示 expect "*?assword:*" - #next command enters password from script + # 在脚本中提供密码 send "${password}\r" - #next command tells that we expect end of file (everything finished on remote server) + # 等待文件结束符(远程服务器处理完了所有事情) expect eof - #end of expect pard + # 结束 expect 脚本 EOD - #this line just print done + # 显示结束 echo "DONE" - #end of reading backup file + # 完成 done #### 运行第二个带有输出结果的脚本的屏幕截图 #### @@ -163,7 +164,7 @@ via: http://linoxide.com/linux-shell-script/shell-script-backup-files-directorie 作者:[Yevhen Duma][a] 译者:[GOLinux](https://github.com/GOLinux) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 6fdfe747bb35c0c167d18f4281b00c9ad5913545 Mon Sep 17 00:00:00 2001 From: wxy Date: Thu, 25 Jun 2015 10:30:07 +0800 Subject: [PATCH 473/965] PUB:20141219 What is good audio editing software on Linux @wwy-hust --- ...is good audio editing software on Linux.md | 67 +++++++++++++++++++ ...is good audio editing software on Linux.md | 67 ------------------- 2 files changed, 67 insertions(+), 67 deletions(-) create mode 100644 published/20141219 What is good audio editing software on Linux.md delete mode 100644 translated/tech/20141219 What is good audio editing software on Linux.md diff --git a/published/20141219 What is good audio editing software on Linux.md b/published/20141219 What is good audio editing software on Linux.md new file mode 100644 index 0000000000..117961919d --- /dev/null +++ b/published/20141219 What is good audio editing software on Linux.md @@ -0,0 +1,67 @@ +Linux下优秀的音频编辑软件 +================================================================================ + +不论您是一个音乐爱好者或只是一个要记录您导师的讲话的学生,您都需要录制音频和编辑音频。长久以来这样的工作都要靠Macintosh,如今那个时代已经过去,现在Linux也可以胜任这些工作了。简而言之,这里有一份不完全的音频编辑器软件列表,适用于不同的任务和需求。 + +### 1. Audacity ### + +![](https://farm9.staticflickr.com/8572/15405018653_83ba3e718d_c.jpg) + +让我们从我个人最喜欢的软件开始。[Audacity][1]可以运行在Windows、Mac和Linux上。它是开源的,且易于使用。你会觉得:Audacity几乎是完美的。它可以让您在干净的界面上操作音频波形。简单地说,您可以覆盖音轨、剪切和修改音轨、增加特效、执行高级的声音分析,然后将它们导出到一大堆可用的格式。我喜欢它的原因是它将基本的功能和复杂的功能结合在一起并且保持一个简单的学习曲线。然而,它并不是一个完全最优化的软件,尤其是对于音乐家和专业人员。 + +### 2. Jokosher ### + +![](https://farm8.staticflickr.com/7524/15998875136_82903a9b4a_c.jpg) + +在不同的层次上,[Jokosher][2]更多的聚焦在多音轨方面。它使用Python和GTK+作为前端界面,并使用GStreamer作为音频后端。Jokosher那易用的界面和它的扩展性给我留下了深刻的印象。也许编辑的功能并不是最先进的,但它的提示十分清晰,适合音乐家。例如,我十分喜欢音轨和乐器的组合。简而言之,如果您是一个音乐家,那么它是在您转移到下一个软件前进行实践的好机会。 + +### 3. Ardour ### + +![](https://farm9.staticflickr.com/8577/16024644385_d8cd8073a3_c.jpg) + +接下来谈论一些复杂的工具,[Ardour][3]是一套完整的可以录制、编辑和混音的软件。这个设计吸引了所有的专业人员,Ardour在声音和插件方面超出我的想象。如果您在寻找一头野兽并且不惧怕驯服它,那么Ardour或许是一个不错的选择。再次,它的界面和丰富的文档,尤其是它首次启动时的配置工具都是它迷人魅力的一部分。 + +### 4. Kwave ### + +![](https://farm8.staticflickr.com/7557/15402389884_633a8b04c5_c.jpg) + +对于所有KDE的热爱者,[KWave][4]绝对符合您对于设计和功能的想象。它有丰富的快捷键以及很多有趣的选项,例如内存管理。尽管很多特效很不错,但我们更应该关注那些用于音频剪切/粘贴的工具。可惜的是它无法与Audacity相比,而更重要的是,它的界面并没有那么吸引我。 + +### 5. Qtractor ### + +![](https://farm8.staticflickr.com/7551/16022707501_68c39f37e5_c.jpg) + +如果Kwave对您来说过于简单,但基于Qt的程序却有些吸引力,那么对您来说,也许[Qtractor][5]是一个选项。它致力于做一个“对于家庭用户来说足够简单,并且对专业人员来说足够强大的软件。”实际上它功能和选项的数量几乎是压倒性的。我最喜欢的当然是可定制的快捷键。除此之外,Qtractor可能是我最喜欢的一个处理MIDI文件的工具。 + +### 6. LMMS ### + +![](https://farm8.staticflickr.com/7509/15838603239_ef0ecbc8d2_c.jpg) + +作为Linux多媒体工作室,LMMS的直接目标是音乐制作。如果您之前没有什么经验并且不想浪费太多的时间,那么请去别处吧。LMMS是其中一个复杂但强大的软件,只有少数的人真正的掌握了它。它有太多的功能和特效以至于无法一一列出,但如果我必须找一个,我会说用来模拟Game Boy声音系统的Freeboy插件简直像魔术一样。然后,去看看它那惊人的文档吧。 + +### 7. Traverso ### + +![](https://farm8.staticflickr.com/7537/15838603279_70ee925057_c.jpg) + +最后站在我面前的是Traverso,它支持无限制的音轨计数,并直接整合了CD烧录的功能。另外,它对我来说是介于简单的软件和专业的软件之间的程序。它的界面是KDE样式的,其键盘配置很简单。更有趣的是,Traverso会监视您的系统资源以确定不会超过您的CPU或者硬件的能力。 + +总而言之,能在Linux系统上看到这么多不同的应用程序是一件开心的事。它使得您永远可以找到最适合自己的那一款。虽然我最喜欢的应用是Audacity,但我非常震惊于LMMS和Jokosher的设计。 + +我们有漏掉什么么?您在Linux下使用哪一款软件呢?原因是什么呢?请留言让我们知道。 + +-------------------------------------------------------------------------------- + +via: http://xmodulo.com/good-audio-editing-software-linux.html + +作者:[Adrien Brochard][a] +译者:[wwy-hust](https://github.com/wwy-hust) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://xmodulo.com/author/adrien +[1]:http://audacity.sourceforge.net/ +[2]:https://launchpad.net/jokosher/ +[3]:http://ardour.org/ +[4]:http://kwave.sourceforge.net/ +[5]:http://qtractor.sourceforge.net/qtractor-index.html \ No newline at end of file diff --git a/translated/tech/20141219 What is good audio editing software on Linux.md b/translated/tech/20141219 What is good audio editing software on Linux.md deleted file mode 100644 index c3f9c76d61..0000000000 --- a/translated/tech/20141219 What is good audio editing software on Linux.md +++ /dev/null @@ -1,67 +0,0 @@ -LinuxƵ༭ -================================================================================ - -һְ߻ֻһҪ¼ʦѧҪ¼Ƶͱ༭ƵĹҪMacintoshǸʱѾȥLinuxҲʤЩˡ֮һݲȫƵ༭бڲͬ - -### 1. Audacity ### - -![](https://farm9.staticflickr.com/8572/15405018653_83ba3e718d_c.jpg) - -ǴҸϲʼ[Audacity][1]WindowsMacLinuxϡǿԴģʹáãAudacityġڸɾĽϲƵΡ򵥵˵Ը졢к޸졢Чִи߼ȻǵһѿõĸʽϲԭĹܺ͸ӵĹܽһұһ򵥵ѧϰߡȻһȫŻǶּҺרҵ֪ʶˡ - -### 2. Jokosher ### - -![](https://farm8.staticflickr.com/7524/15998875136_82903a9b4a_c.jpg) - -ڲͬIJϣ[Jokosher][2]ľ۽ڶ췽档ʹPythonGTK+Ϊǰ˽ڣʹGStreamerΪƵˡJokosherƽĽչԸ̵ӡҲ༭ĹܲȽģʮʺּҡ磬ʮϲϡ֮һּңôתƵһǰʵĺûᡣ - -### 3. Ardour ### - -![](https://farm9.staticflickr.com/8577/16024644385_d8cd8073a3_c.jpg) - -̸һЩӵĹߣ[Ardour][3]һĿ¼ơ༭ͻеרҵԱArdourͲ泬ҵѰһͷҰ޲ҲѱôArdourȡһѡٴΣĽӿںḻĵ״ʱù߶һ֡ - -### 4. Kwave ### - -![](https://farm8.staticflickr.com/7557/15402389884_633a8b04c5_c.jpg) - -KDEȰߣ[KWave][4]Էƺ͹ܵзḻĿݼԼܶȤѡڴܺܶЧܲǸӦùעЩƵ/ճĹߡϧ޷AudacityȣҪǣýӿڲûôҡ - -### 5. Qtractor ### - -![](https://farm8.staticflickr.com/7551/16022707501_68c39f37e5_c.jpg) - -Kwave˵ڼ򵥣QtijȴЩô˵Ҳ[Qtractor][5]һѡһڼͥû˵㹻򵥣ҶרҵԱ˵㹻ǿʵܺѡѹԵġϲĵȻǿɶƵĿݼ֮⣬QtractorϲһMIDIļĹߡ - -### 6. LMMS ### - -![](https://farm8.staticflickr.com/7509/15838603239_ef0ecbc8d2_c.jpg) - -ΪLinuxý幤ңLMMSֱĿ֮ǰûʲô鲢Ҳ˷̫ʱ䣬ôȥ𴦰ɡLMMSһӵǿֻ̫ĹܺЧ޷һһгұһһ˵ģGame BoyϵͳFreeboyֱħһȻȥǾ˵ĵɡ - -### 7. Traverso ### - -![](https://farm8.staticflickr.com/7537/15838603279_70ee925057_c.jpg) - -վǰTraverso֧ƵֱCD¼Ĺܡ⣬˵ǽڼ򵥵רҵ֮ijĽKDEʽģúܼ򵥡ȤǣTraversoϵͳԴȷᳬCPUӲ - -֮ܶLinuxϵͳϿô಻ͬӦóһĵ¡ʹԶҵʺԼһȻϲӦAudacityҷdzLMMSJokosherơ - -©ʲôôLinuxʹһأԭʲôأԴ֪ - --------------------------------------------------------------------------------- - -via: http://xmodulo.com/good-audio-editing-software-linux.html - -ߣ[Adrien Brochard][a] -ߣ[wwy-hust](https://github.com/wwy-hust) -Уԣ[УID](https://github.com/УID) - - [LCTT](https://github.com/LCTT/TranslateProject) ԭ룬[Linuxй](http://linux.cn/) Ƴ - -[a]:http://xmodulo.com/author/adrien -[1]:http://audacity.sourceforge.net/ -[2]:https://launchpad.net/jokosher/ -[3]:http://ardour.org/ -[4]:http://kwave.sourceforge.net/ -[5]:http://qtractor.sourceforge.net/qtractor-index.html \ No newline at end of file From 6dfc6c914eaa8e249995cf283d6f398642384165 Mon Sep 17 00:00:00 2001 From: wxy Date: Fri, 26 Jun 2015 23:53:18 +0800 Subject: [PATCH 474/965] PUB:20150128 The top 10 rookie open source projects @sevenot --- ... The top 10 rookie open source projects.md | 154 ++++++++++++++++++ ... The top 10 rookie open source projects.md | 153 ----------------- 2 files changed, 154 insertions(+), 153 deletions(-) create mode 100644 published/20150128 The top 10 rookie open source projects.md delete mode 100644 translated/talk/20150128 The top 10 rookie open source projects.md diff --git a/published/20150128 The top 10 rookie open source projects.md b/published/20150128 The top 10 rookie open source projects.md new file mode 100644 index 0000000000..ea9c04ce4f --- /dev/null +++ b/published/20150128 The top 10 rookie open source projects.md @@ -0,0 +1,154 @@ +2015 年度开源项目新秀榜 +================================================================================ +黑鸭(Black Duck)软件公布了一份名叫“年度开源项目新秀”的报告,介绍了由全球开源协会发起的10个最有趣、最活跃的新项目。 + +![](http://images.techhive.com/images/article/2015/01/open_source_rookies_01-100564902-orig.jpeg) + +### 年度开源项目新秀 ### + +每年都有上千新的开源项目问世,但只有少数能够真正的吸引我们的关注。一些项目因为利用了当前比较流行的技术而发展壮大,有一些则真正地开启了一个新的领域。很多开源项目建立的初衷是为了解决一些生产上的问题,还有一些项目则是世界各地志同道合的开发者们共同发起的一个宏伟项目。 + +从2009年起,开源软件管理公司黑鸭便发起了[年度开源项目新秀][1]这一活动,它的评选根据[Open Hub][2]网站(即以前的Ohloh)上的活跃度。今年,我们很荣幸能够报道2015年10大开源项目新秀的得主和2名荣誉奖得主,它们是从上千个开源项目中脱颖而出的。评选采用了加权评分系统,得分标准基于项目的活跃度,交付速度和几个其它因数。 + +开源俨然成为了产业创新的引擎,就拿今年来说,和Docker容器相关的开源项目在全球各地兴起,这也不恰巧反映了企业最感兴趣的技术领域吗?最后,我们接下来介绍的项目,将会让你了解到全球开源项目的开发者们的在思考什么,这很快将会成为一个指引我们发展的领头羊。 + +### 2015年度开源项目新秀: DebOps ### + +![](http://images.techhive.com/images/article/2015/01/open_source_rookies_02-100564903-orig.jpeg) + +[DebOps][3]收集打包了一套[Ansible][4]方案和规则(Ansible是一种自动化运维工具),可以从1个容器扩展到一个完整的数据中心。它的创始人Maciej Delmanowski将DebOps开源来保证项目长久进行,从而更好的通过外部贡献者的帮助发展下去。 + +DebOps始创于波兰的一个不起眼大学校园里,他们运营自己的数据中心,一切工作都采用手工配置。有时系统崩溃而导致几天的宕机,这时Delmanowski意识到一个配置管理系统是很有必要的。以Debian作为基础开始,DebOps是一组配置一整个数据基础设施的Ansible方案。此项目已经在许多不同的工作环境下实现,而创始者们则打算继续支持和改进这个项目。 + +###2015年度开源项目新秀: Code Combat ### + +![](http://images.techhive.com/images/article/2015/01/open_source_rookies_03-100564904-gallery.idge.jpg) + +传统的纸笔学习方法已近不能满足技术学科了。然而游戏却有很多人都爱玩,这也就是为什么[CodeCombat][5]的创始人会去开发一款多人协同编程游戏来教人们如何编码。 + +刚开始CodeCombat是一个创业想法,但其创始人决定取而代之创建一个开源项目。此想法在社区传播开来,很快不少贡献者加入到项目中来。项目发起仅仅两个月后,这款游戏就被接纳到Google’s Summer of Code活动中。这款游戏吸引了大量玩家,并被翻译成45种语言。CodeCombat希望成为那些想要一边学习代码同时获得乐趣的同学的风向标。 + +### 2015年度开源项目新秀: Storj ### + +![](http://images.techhive.com/images/article/2015/01/open_source_rookies_04-100564905-gallery.idge.jpg) + +[Storj][6]是一个点对点的云存储网络,可实现端到端加密,保证用户不用依赖第三方即可传输和共享数据。基于比特币block chain技术和点对点协议,Storj提供安全、私密、加密的云存储。 + +云数据存储的反对者担心成本开销和漏洞攻击。针对这两个担忧,Storj提供了一个私有云存储市场,用户可以通过Storjcoin X(SJCX) 购买交易存储空间。上传到Storj的文件会被粉碎、加密和存储到整个社区。只有文件所有者拥有密钥加密的信息。 + +在2014年举办的Texas Bitcoin Conference Hackathon会议上,去中心化的云存储市场概念首次被提出并证明可行。在第一次赢得黑客马拉松活动后,项目创始人们和领导团队利用开放论坛、Reddit、比特币论坛和社交媒体增长成了一个活跃的社区,如今,它们已成为影响Storj发展方向的一个重要组成部分。 + +### 2015年度开源项目新秀: Neovim ### + +![](http://images.techhive.com/images/article/2015/01/open_source_rookies_05-100564906-orig.jpg) + +自1991年出现以来,Vim已经成为数以百万计软件开发人员所钟爱的文本编辑器。 而[Neovim][6]就是它的下一个版本。 + +在过去的23年里,软件开发生态系统经历了无数增长和创新。Neovim创始人Thiago de Arruda认为Vim缺乏当代元素,跟不上时代的发展。在保留Vim的招牌功能的前提下,Neovim团队同样在寻求改进和发展这个最受欢迎的文本编辑器的技术。早期众筹让Thiago de Arruda可以连续6个月时间投入到此项目。他相信Neovim社区会支持这个项目,激励他继续开发Neovim。 + +### 2015年度开源项目新秀: CockroachDB ### + +![](http://images.techhive.com/images/article/2015/01/open_source_rookies_06-100564907-orig.jpg) + +前谷歌员工开发了一个开源的大型企业数据存储项目[CockroachDB][8],它是一个可扩展的、跨地域复制且支持事务的数据存储的解决方案。 + +为了保证在线的百万兆字节流量业务的质量,Google开发了Spanner系统,这是一个可扩展的,稳定的,支持事务的系统。许多参与开发CockroachDB的团队现在都服务于开源社区。就像真正的蟑螂(cockroach)一样,CockroachDB可以在没有数据头、任意节点失效的情况下正常运行。这个开源项目有很多富有经验的贡献者,创始人们通过社交媒体、Github、网络、会议和聚会结识他们并鼓励他们参与其中。 + +### 2015年度开源项目新秀: Kubernetes ### + +![](http://images.techhive.com/images/article/2015/01/open_source_rookies_07-100564908-orig.jpg) + +在将容器化软件到引入开源社区发展时,[Docker][9]是一匹黑马,它创新了一套技术和工具。去年6月谷歌推出了[Kubernetes][10],这是一款开源的容器管理工具,用来加快开发和简化操作。 + +谷歌在它的内部运营上使用容器技术多年了。在2014年夏天的DockerCon上大会上,谷歌这个互联网巨头开源了Kubernetes,Kubernetes的开发是为了满足迅速增长的Docker生态系统的需要。通过和其它的组织、项目合作,比如Red Hat和CoreOS,Kubernetes项目的管理者们推动它登上了Docker Hub的工具下载榜榜首。Kubernetes的开发团队希望扩大这个项目,发展它的社区,这样的话软件开发者就能花更少的时间在管理基础设施上,而更多的去开发他们自己的APP。 + +### 2015年度开源项目新秀: Open Bazaar ### + +![](http://images.techhive.com/images/article/2015/01/open_source_rookies_08-100564909-orig.jpg) + +OpenBazaar是一个使用比特币与其他人交易的去中心化的市场。OpenBazaar这一概念最早在编程马拉松(hackathon)活动中被提出,它的创始人结合了BitTorent、比特币和传统的金融服务方式,创造了一个不受审查的交易平台。OpenBazaar的开发团队在寻求新的成员,而且不久以后他们将极度扩大Open Bazaar社区。Open Bazaar的核心是透明度,其创始人和贡献者的共同目标是在商务交易中掀起一场革命,让他们向着一个真实的、一个无控制的,去中心化的市场奋进。 + +### 2015年度开源项目新秀: IPFS ### + +![](http://images.techhive.com/images/article/2015/01/open_source_rookies_09-100564910-orig.jpg) + +IPFS 是一个面向全球的、点对点的分布式版本文件系统。它综合了Git,BitTorrent,HTTP的思想,开启了一个新的数据和数据结构传输协议。 + +人们所知的开源,它的本意用简单的方法解决复杂的问题,这样产生许多新颖的想法,但是那些强大的项目仅仅是开源社区的冰山一角。IFPS有一个非常激进的团队,这个概念的提出是大胆的,令人惊讶的,有点甚至高不可攀。看起来,一个点对点的分布式文件系统是在寻求将所有的计算设备连在一起。这个可能的 HTTP 替换品通过多种渠道维护着一个社区,包括Git社区和超过100名贡献者的IRC。这个疯狂的想法将在2015年进行软件内部测试。 + +### 2015年度开源项目新秀: cAdvisor ### + +![](http://images.techhive.com/images/article/2015/01/open_source_rookies_10-100564911-orig.jpg) + +[cAdvisor (Container Advisor)][13] 是一个针对在运行中的容器进行收集,统计,处理和输出信息的工具,它可以给容器的使用者提供资源的使用情况和工作特性。对于每一个容器,cAdvisor记录着资源的隔离参数,资源使用历史,资源使用历史对比框图,网络状态。这些从容器输出的数据跨越主机传递。 + +cAdvisor可以在绝大多数的Linux发行版上运行,并且支持包括Docker在内的多种容器类型。事实上它成为了一种容器的代理,并被集成在了很多系统中。cAdvisor在DockerHub下载量也是位居前茅。cAdvisor的开发团队希望把cAdvisor改进到能够更深入地理解应用性能,并且集成到集群系统。 + +### 2015年度开源项目新秀: Terraform ### + +![](http://images.techhive.com/images/article/2015/01/open_source_rookies_11-100564912-orig.jpg) + +[Terraform][14]提供了一些常见设置来创建一个基础设施,从物理机到虚拟机,以及email服务器、DNS服务器等。这个想法包括从家庭个人机解决方案到公共云平台提供的服务。一旦建立好了以后,Terraform可以让运维人员安全又高效地改变你的基础设施,就如同配置一样。 + +Terraform.io的创始者工作在一个Devops模式的公司,他找到了一个窍门把建立一个完整的数据中心所需的知识结合在一起,可以从添加服务器到支持网络服务的功能齐备的数据中心。基础设施的描述采用高级的配置语法,允许你把数据中心的蓝图按版本管理,并且转换成多种代码。著名开源公司HashiCorp赞助开发这个项目。 + +### 荣誉奖: Docker Fig ### + +![](http://images.techhive.com/images/article/2015/01/open_source_rookies_12-100564913-orig.jpg) + +[Fig][15]为[Docker][16]的使用提供了一个快速的,分离的开发环境。Docker的移植只需要将配置信息放到一个简单的 fig.yml文件里。它会处理所有工作,包括构建、运行,端口转发,分享磁盘和容器链接。 + +Orchard去年发起了Fig,来创造一个使Docker工作起来的系统工具。它的开发像是为Docker设置开发环境,为了确保用户能够为他们的APP准确定义环境,在Docker中会运行数据库和缓存。Fig解决了开发者的一个难题。Docker全面支持这个开源项目,最近[将买下][17]Orchard来扩张这个项目。 + +### 荣誉奖: Drone ### + +![](http://images.techhive.com/images/article/2015/01/open_source_rookies_13-100564916-orig.jpg) + +[Drone][18]是一个基于Docker的持续集成平台,而且它是用Go语言写的。Drone项目不满于现存的设置开发环境的技术和流程。 + +Drone提供了一个简单的自动测试和持续交付的方法:简单选择一个Docker镜像来满足你的需求,连接并提交至GitHub即可。Drone使用Docker容器来提供隔离的测试环境,让每个项目完全自主控制它的环境,没有传统的服务器管理的负担。Drone背后的100位社区贡献者强烈希望把这个项目带到企业和移动应用程序开发中。 + +### 开源新秀 ### + +![](http://images.techhive.com/images/article/2015/01/open_source_rookies_14-100564941-orig.jpg) + +参见: + +- [InfoWorld2015年年度技术奖][21] +- [Bossies: 开源软件最高荣誉][22] + +-------------------------------------------------------------------------------- + +via: http://www.infoworld.com/article/2875439/open-source-software/the-top-10-rookie-open-source-projects.html + +作者:[Black Duck Software][a] +译者:[sevenot](https://github.com/sevenot) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://www.infoworld.com/author/Black-Duck-Software/ +[1]:https://www.blackducksoftware.com/open-source-rookies +[2]:https://www.openhub.net/ +[3]:https://github.com/debops/debops +[4]:http://www.infoworld.com/article/2612397/data-center/review--ansible-orchestration-is-a-veteran-unix-admin-s-dream.html +[5]:https://codecombat.com/ +[6]:http://storj.io/ +[7]:http://neovim.org/ +[8]:https://github.com/cockroachdb/cockroach +[9]:http://www.infoworld.com/resources/16373/application-virtualization/the-beginners-guide-to-docker +[10]:http://kubernetes.io/ +[11]:https://openbazaar.org/ +[12]:http://ipfs.io/ +[13]:https://github.com/google/cadvisor +[14]:https://www.terraform.io/ +[15]:http://www.fig.sh/ +[16]:http://www.infoworld.com/resources/16373/application-virtualization/the-beginners-guide-to-docker +[17]:http://www.infoworld.com/article/2608546/application-virtualization/docker-acquires-orchard-in-a-sign-of-rising-ambitions.html +[18]:https://drone.io/ +[19]:http://www.infoworld.com/article/2683845/google-go/164121-Fast-guide-to-Go-programming.html +[20]:https://www.blackducksoftware.com/open-source-rookies +[21]:http://www.infoworld.com/article/2871935/application-development/infoworlds-2015-technology-of-the-year-award-winners.html +[22]:http://www.infoworld.com/article/2688104/open-source-software/article.html +[23]:http://www.infoworld.com/article/2854954/microsoft-windows/15-essential-open-source-tools-for-windows-admins.html + diff --git a/translated/talk/20150128 The top 10 rookie open source projects.md b/translated/talk/20150128 The top 10 rookie open source projects.md deleted file mode 100644 index c642786914..0000000000 --- a/translated/talk/20150128 The top 10 rookie open source projects.md +++ /dev/null @@ -1,153 +0,0 @@ -sevenot translated -排名前十的年度开源项目新秀 -================================================================================ -黑鸭(Black Duck)软件公布了一份名叫“年度开源项目新秀”的报告,介绍了由全球开源协会发起的10个最有趣、最活跃的新项目。 - -![](http://images.techhive.com/images/article/2015/01/open_source_rookies_01-100564902-orig.jpeg) - -### 年度开源项目新秀 ### - -每年都有上千新的开源项目问世,但只有少数能够真正的吸引我们的关注。一些项目因为利用了当前比较流行的技术而发展壮大,有一些则真正地开启了一个新的邻域。很多开源项目建立的初衷是为了解决一些生产上的问题,还有一些项目则是世界各地志同道合的开发者们共同发起的一个宏伟项目。 - -从2009年起,开源软件公司黑鸭便发起了[年度开源项目新秀][1]这一活动,它的评选根据[Open Hub][2] 网站(即以前的Ohloh)。今年,我们很荣幸能够报道2015年10大开源项目新秀的得主和2名荣誉奖得主,它们是从上千个开源项目中脱颖而出的。评选采用了加权评分系统,得分标准基于项目的活跃度,交付速度,和几个其它因数。 - -开源俨然成为了产业创新的引擎,就拿今年来说,和Docker容器相关的开源项目在全球各地新起,这也不恰巧反映了企业最感兴趣的技术邻域吗?最后,我们接下来介绍的项目,将会让你了解到全球开源项目的开发者们的在思考什么,这很快将会成为一个指引我们发展的领头羊。 - -### 2015年度开源项目新秀: DebOps ### - -![](http://images.techhive.com/images/article/2015/01/open_source_rookies_02-100564903-orig.jpeg) - -[DebOps][3]收集打包了一套[Ansible][4] (Ansible是一种自动化运维工具)方案和规则,可以从1个容器扩展到一个完整的数据中心。它的创始人Maciej Delmanowski将DebOps开源来保证项目长久进行,从而更好的利用外部贡献者来发展下去 - -DebOps始创于波兰的一个不起眼大学校园里,在自己的数据中心上运行,一切都是手工配置的。有时系统崩溃而导致几天的宕机,这时Delmanowski意识到一个配置管理系统是很有必要的。从Debian的基础做起,DebOps是一组配置一整个数据基础设施Ansible方案。此项目已经在许多不同的工作环境下实现,而创始者们则打算继续支持和开发这个项目。 - -###2015年度开源项目新秀: Code Combat ### - -![](http://images.techhive.com/images/article/2015/01/open_source_rookies_03-100564904-gallery.idge.jpg) - -传统的纸笔学习方法已近不能满足技术学科了。然而游戏都是关于参与者,这也就是为什么[CodeCombat][5] 的创始人会去开发一款多人协同编程游戏来教人们如何编码。 - -刚开始CodeCombat是一个创业想法,但其创始人决定创建一个开源项目将其取代。此想法在社区传播开来,很快不少贡献者加入到项目中来。项目发起仅仅两个月后,这款游戏就被收入Google’s Summer of Code。这款游戏吸引了大量玩家,并被翻译成45种语言。CodeCombat希望成为那些想要一边学习代码同时获得乐趣的同学的风向标。 - -### 2015年度开源项目新秀: Storj ### - -![](http://images.techhive.com/images/article/2015/01/open_source_rookies_04-100564905-gallery.idge.jpg) - -[Storj][6]是一个点对点的云存储网络,可实现端到端加密,保证用户不用依赖第三方即可传输、共享数据。基于比特币block chain技术和点对点协议,Storj提供安全、私密、加密的云存储。 - -云数据存储的反对者担心成本开销和漏洞攻击。为了做到没有死角,Storj是一个私有云存储市场,用户可以通过Storjcoin X(SJCX) 购买交易存储空间。上传到Storj的文件会被粉碎、加密和存储到整个社区。只有文件所有者拥有密钥加密的信息 - -在2014年举办的Texas Bitcoin Conference Hackathon会议上,云存储市场概念首次被提出并证明可行。在第一次赢得黑客马拉松活动后,项目创始人们和领导团队利用开源论坛Reddit、比特币论坛和社交媒体推广此项目。如今,它们已成为Storj决策过程的一个重要组成部分。 - -### 2015年度开源项目新秀: Neovim ### - -![](http://images.techhive.com/images/article/2015/01/open_source_rookies_05-100564906-orig.jpg) - -自1991年提出概念以来,Vim已经成为数以百万计软件开发人员所钟爱的文本编辑器。 [Neovim][6] 是它的下一个版本。 - -  在过去的23年里,软件开发生态系统经历了无数增长和创新。Neovim创始人Thiago de Arruda知道Vim缺少当代元素,跟不上时代的发展。在保留Vim的签名功能的前提下,Neovim团队同样在寻求最受欢迎的文本编辑器改善和发展技术。集资初期,Thiago de Arruda连续6个月时间关注推出此项目。他相信他的团队和支持他激励他继续发展Neovim。 - -### 2015年度开源项目新秀: CockroachDB ### - -![](http://images.techhive.com/images/article/2015/01/open_source_rookies_06-100564907-orig.jpg) - -前谷歌员工开发了一个开源的企业数据存储项目[CockroachDB][8],它是一个可扩展的、跨地域复制且支持事务的数据存储的解决方案。 - -为了保证在线百万兆字节流量业务的质量,Google公开了他们的Spanner系统,这是一个可扩展的,稳定的,支持事务的系统。许多参与开发CockroachDB的团队现在都服务与开源社区。就像真正的蟑螂一样,CockroachDB可以在没有数据头、没有任何节点的情况下正常运行。这个开源项目有很多富有经验的贡献者,创始人们通过社会媒体、Github、网络、会议和聚会结识他们并鼓励他们参与其中。 - -### 2015年度开源项目新秀: Kubernetes ### - -![](http://images.techhive.com/images/article/2015/01/open_source_rookies_07-100564908-orig.jpg) - -在介绍集装箱化的软件对开源社区的发展时,[Docker][9]是一匹黑马,它在技术和工具的设置上做了创新。去年6月谷歌推出了[Kubernetes][10],这是一款开源的容器管理工具,用来加快开发和简化操作。 - -谷歌在它的网络系统上使用容器技术多年了。在2014年夏天的DockerCon上大会上,谷歌这个互联网巨头开源了Kubernetes,Kubernetes的开发是为了满足迅速增长的Docker生态系统的需要。通过和其它的组织、项目合作,比如 Red Hat和CoreOS,Kubernetes的管理者们促使它登上了Docker Hub的工具下载榜榜首。Kubernetes的开发团队希望扩大这个项目,发展它的社区,这样的话软件开发者就能花更少的时间在管理基础设施上,而更多的去开发他们自己的APP。 - -### 2015年度开源项目新秀: Open Bazaar ### - -![](http://images.techhive.com/images/article/2015/01/open_source_rookies_08-100564909-orig.jpg) - -OpenBazaar是一个使用比特币和其他人交易的市场。OpenBazaar这一概念最早在编程马拉松(hackathon)活动中被提出,它的创始人结合了BitTorent,比特币和传统的金融服务方式,创造了一个不受审查的交易平台。OpenBazaar的开发团队在寻求新的成员,而且不久以后他们将无限扩大Open Bazaar的社区。Open Bazaar旨在透明度和同一个目标去在商务交易中掀起一场革命,这会帮助创始人和贡献者向着一个真实的世界奋斗,一个没有控制,分散的市场。 - -### 2015年度开源项目新秀: IPFS ### - -![](http://images.techhive.com/images/article/2015/01/open_source_rookies_09-100564910-orig.jpg) - -IPFS 是一个全球的点对点式的分布式版本文件系统。它综合了Git,BitTorrent,HTTP的思想,开启了一个新的数据和数据结构传输协议。 - -开源被人们所知晓的原因,是它本意用简单的方法解决复杂的问题,这样产生许多新颖的想法,但是着些强大的项目仅仅是开源社区的冰山一角。IFPS有一个积极的团队,这个概念的提出是大胆的,令人惊讶的,有点甚至高不可攀。这样来看,一个点对点的分布是文件系统是在寻找所有连在一起的计算设备。也许HTTP的更换可以靠着通过多种手段继续保持一个社区,包括Git社区和超过100名贡献者的IRC。这个疯狂的想法将在2015年进行软件内部测试。 - -### 2015年度开源项目新秀: cAdvisor ### - -![](http://images.techhive.com/images/article/2015/01/open_source_rookies_10-100564911-orig.jpg) - -[cAdvisor (Container Advisor)][13] 是一个针对在运行中的容器进行收集,合计,处理和输出信息的工具,它可以给容器的使用者提供资源的使用情况和工作特性。对于每一个容器,cAdvisor记录着资源的分离参数,资源使用历史,资源使用历史对比框图,网络状态。这些从容器输出的数据在机器中传递。 - -cAdvisor可以在绝大多数的Linux上运行,并且支持包括Docker在内的多种容器类型。事实上它成为了一种容器的代理,并被集成在了很多系统中。cAdvisor在DockerHub下载量也是位居前茅。cAdvisor的开发团队希望把cAdvisor发展到能够更深入地理解应用并且集成到集群系统。 - -### 2015年度开源项目新秀: Terraform ### - -![](http://images.techhive.com/images/article/2015/01/open_source_rookies_11-100564912-orig.jpg) - -[Terraform][14]提供了一些列的设置来创建一个基础设施,从物理机到虚拟机再到email服务器、DNS服务器。这个概念包括从家庭个人机解决方案到公共云平台提供的服务。一旦建立好了以后,Terraform便进行一系列的操作来改变你的基础设施,安全又高效,就如同配置一样。 - -如果你在Devops模式下的公司里工作,Terraform.io的创始者找到了一个窍门把建立一个完整的数据中心所需的知识结合在一起,从插入服务器到整个网络和功能齐备的数据中心。基础设施的描述采用高级的配置语法,允许你把数据中心的蓝图做成多版本并且可以使用多种代码。著名开源公司HashiCorp赞助开发这个项目。 - -### 荣誉奖: Docker Fig ### - -![](http://images.techhive.com/images/article/2015/01/open_source_rookies_12-100564913-orig.jpg) - -[Fig][15] 为[Docker][16]的使用提供了一个快速的,分离的开发环境。Docker的移植只需要将配置信息放到一个简单的 fig.yml文件里。它会处理所有工作,包括建立、运行,端口转发,分享磁盘和容器链接。 - Fig solved a major pain point for developers. Docker fully supports this open source project and [recently purchased Orchard][17] to expand the reach of Fig. -Orchard去年发起了Fig,来创造一个使Docker工作的系统工具。它的开发像是为Docker设置开发环境,为了确保用户能够为他们的APP准确定义环境,在Docker中会运行数据库和缓存。Fig解决了开发者的一个难题。Docker全面支持这个开源项目,最近将买下Orchard来扩张这个项目。 - -### 荣誉奖: Drone ### - -![](http://images.techhive.com/images/article/2015/01/open_source_rookies_13-100564916-orig.jpg) - -[Drone][18]是一个基于Docker的持续集成平台,而且它是用Go语言写的。Drone项目不满于现存的技术和流程,它旨在开发环境。 - -Drone提供了一个简单的自动测试和持续交付的方法:简单选择一个Docker形象来满足你的需求,连接并提交至GitHub即可。Drone使用Docker容器来提供隔离的测试环境,让每个项目完全自主控制堆栈,没有传统的服务器管理的负担。Drone背后的100位社区贡献者强烈希望把这个项目带到企业和移动应用程序开发中 -### 开源新秀 ### - -![](http://images.techhive.com/images/article/2015/01/open_source_rookies_14-100564941-orig.jpg) - -- [2014年度开源项目新秀][20] -- [InfoWorld2015年年度技术奖][21] -- [Bossies: 开源软件最高荣誉][22] -- [ Windows管理员15个必不可少的开源工具][23] - --------------------------------------------------------------------------------- - -via: http://www.infoworld.com/article/2875439/open-source-software/the-top-10-rookie-open-source-projects.html - -作者:[Black Duck Software][a] -译者:[sevenot](https://github.com/sevenot) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://www.infoworld.com/author/Black-Duck-Software/ -[1]:https://www.blackducksoftware.com/open-source-rookies -[2]:https://www.openhub.net/ -[3]:https://github.com/debops/debops -[4]:http://www.infoworld.com/article/2612397/data-center/review--ansible-orchestration-is-a-veteran-unix-admin-s-dream.html -[5]:https://codecombat.com/ -[6]:http://storj.io/ -[7]:http://neovim.org/ -[8]:https://github.com/cockroachdb/cockroach -[9]:http://www.infoworld.com/resources/16373/application-virtualization/the-beginners-guide-to-docker -[10]:http://kubernetes.io/ -[11]:https://openbazaar.org/ -[12]:http://ipfs.io/ -[13]:https://github.com/google/cadvisor -[14]:https://www.terraform.io/ -[15]:http://www.fig.sh/ -[16]:http://www.infoworld.com/resources/16373/application-virtualization/the-beginners-guide-to-docker -[17]:http://www.infoworld.com/article/2608546/application-virtualization/docker-acquires-orchard-in-a-sign-of-rising-ambitions.html -[18]:https://drone.io/ -[19]:http://www.infoworld.com/article/2683845/google-go/164121-Fast-guide-to-Go-programming.html -[20]:https://www.blackducksoftware.com/open-source-rookies -[21]:http://www.infoworld.com/article/2871935/application-development/infoworlds-2015-technology-of-the-year-award-winners.html -[22]:http://www.infoworld.com/article/2688104/open-source-software/article.html -[23]:http://www.infoworld.com/article/2854954/microsoft-windows/15-essential-open-source-tools-for-windows-admins.html From 7d814a9c1b22b12f7280dec61dc726d13f647a5b Mon Sep 17 00:00:00 2001 From: wxy Date: Sat, 27 Jun 2015 15:18:15 +0800 Subject: [PATCH 475/965] PUB:20150617 The Art of Command Line @GOLinux --- published/20150617 The Art of Command Line.md | 433 ++++++++++++++++++ .../tech/20150617 The Art of Command Line.md | 431 ----------------- 2 files changed, 433 insertions(+), 431 deletions(-) create mode 100644 published/20150617 The Art of Command Line.md delete mode 100644 translated/tech/20150617 The Art of Command Line.md diff --git a/published/20150617 The Art of Command Line.md b/published/20150617 The Art of Command Line.md new file mode 100644 index 0000000000..8a4d9a0d98 --- /dev/null +++ b/published/20150617 The Art of Command Line.md @@ -0,0 +1,433 @@ +命令行艺术 +================================================================================ + +![curl -s 'https://raw.githubusercontent.com/jlevy/the-art-of-command-line/master/README.md' | egrep -o '`\w+`' | tr -d '`' | cowsay -W50](https://github.com/jlevy/the-art-of-command-line/raw/master/cowsay.png) + + +流畅地使用命令行是一个常被忽略的技能,或被认为是神秘的奥义。但是,它会以明显而微妙的方式改善你作为工程师的灵活度和生产力。这是我在 Linux 上工作时发现的有用的命令行使用小窍门和笔记的精粹。有些小窍门是很基础的,而有些是相当地特别、复杂、或者晦涩难懂。这篇文章不长,但是如果你可以使用并记得这里的所有内容,那么你就懂得很多了。 + +其中大部分[最初](http://www.quora.com/What-are-some-lesser-known-but-useful-Unix-commands)[出现](http://www.quora.com/What-are-the-most-useful-Swiss-army-knife-one-liners-on-Unix)在[Quora](http://www.quora.com/What-are-some-time-saving-tips-that-every-Linux-user-should-know)上,但是考虑到兴趣所在,似乎更应该放到 Github 上,这里的人比我更能提出改进建议。如果你看到一个错误,或者更好的某种东西,请提交问题或 PR!(当然,提交前请看看必读小节和已有的 PR/Issue。) + +## 必读 + +范围: + +- 本文是针对初学者和专业人员的,选题目标是覆盖面广(全都很重要)、有针对性(大多数情况下都给出具体实例)而简洁(避免不必要内容以及你能在其它地方轻松找到的离题的内容)。每个小窍门在某种情形下都很必需的,或者能比替代品大大节省时间。 +- 这是为 Linux 写的。绝大部分条目都可以同样应用到 MacOS(或者甚至 Cygwin)。 +- 主要针对交互式 Bash,尽管大多数小窍门也可以应用到其它 shell,以及常规 Bash 脚本。 +- 包括了“标准的”UNIX 命令以及那些需要安装的软件包(它们很重要,值得安装)。 + +注意: + +- 为了能在一篇文章内展示尽量多的东西,一些具体的信息会被放到引用页里。你可以使用 Google 来获得进一步的内容。(如果需要的话,)你可以使用 `apt-get`/`yum`/`dnf`/`pacman`/`pip`/`brew` 来安装这些新的程序。 +- 使用 [Explainshell][1] 来获取命令、参数、管道等内容的解释。 + +## 基础 + +- 学习基本 Bash 技能。实际上,键入`man bash`,然后至少浏览一遍所有内容;它很容易理解,没那么长。其它 shell 也不错,但是 Bash 很强大,而且到处都可以找到(如果在你自己的笔记本上*只*学习 zsh、fish 之类,会在很多情形下受到限制,比如使用现存的服务器时)。 + +- 至少学好一种基于文本的编辑器。理想的一个是 Vim(`vi`),因为在终端中编辑时随时都能找到它(即使大多数时候你在使用 Emacs、一个大型的 IDE、或一个现代的时髦编辑器)。 + +- 学习怎样使用 `man` 来阅读文档(好奇的话,用 `man man` 来列出分区号,比如 1 是常规命令,5 是文件描述,8 用于管理员)。用 `apropos` 找到帮助页。了解哪些命令不是可执行程序,而是 Bash 内置的,你可以用 `help` 和 `help -d` 得到帮助。 + +- 学习使用 `>` 和 `<` 来进行输出和输入重定向,以及使用 `|` 来管道重定向,学习关于 stdout 和 stderr 的东西。 + +- 学习 `*`(也许还有 `?` 和 `{`...`}` )文件通配扩展和应用,以及双引号 `"` 和单引号 `'` 之间的区别。(更多内容请参看下面关于变量扩展部分)。 + +- 熟悉 Bash 作业管理:`&`, **ctrl-z**, **ctrl-c**, `jobs`, `fg`, `bg`, `kill` 等等。 + +- 掌握`ssh`,以及通过 `ssh-agent`,`ssh-add` 等进行无密码验证的基础技能。 + +- 基本的文件管理:`ls` 和 `ls -l`(特别是,知道`ls -l`各个列的意义),`less`, `head`, `tail` 和 `tail -f`(或者更好的`less +F`),`ln` 和 `ln -s`(知道硬链接和软链接的区别,以及硬链接相对于软链接的优势),`chown`,`chmod`,`du`(用于查看磁盘使用率的快速摘要:`du -sk *`)。文件系统管理:`df`, `mount`,`fdisk`,`mkfs`,`lsblk`。 + +- 基本的网络管理: `ip` 或 `ifconfig`,`dig`。 + +- 熟知正则表达式,以及各种使用`grep`/`egrep`的选项。`-i`,`-o`,`-A` 和 `-B` 选项值得掌握。 + +- 学会使用 `apt-get`,`yum` ,`dnf` 或 `pacman`(这取决于你的发行版)来查找并安装软件包。确保你可以用 `pip` 来安装基于 Python 的命令行工具(下面的一些东西可以很容易地通过 `pip` 安装)。 + + +## 日常使用 + +- 在Bash中,使用 **tab** 补完参数,使用 **ctrl-r** 来搜索命令历史。 + +- 在Bash中,使用 **ctrl-w** 来删除最后的单词,使用 **ctrl-u** 来删除整行,返回行首。使用 **alt-b** 和 **alt-f** 来逐词移动,使用 **ctrl-k** 来清除到行尾的内容,以及使用 **ctrl-l** 清屏。参见 `man readline` 来查看 Bash 中所有默认的键盘绑定,有很多。例如,**alt-.** 可以循环显示先前的参数,而**alt-** 扩展通配。(LCTT 译注:关于 Bash 下的快捷键,可以参阅: https://linux.cn/article-5660-1.html ) + +- 另外,如果你喜欢 vi 风格的键盘绑定,可以使用 `set -o vi`。 + +- 要查看最近用过的命令,请使用 `history` 。 有许多缩写形式,比如 `!$`(上次的参数)和`!!`(上次的命令),虽然使用 `ctrl-r` 和 `alt-.` 更容易些。(LCTT 译注:关于历史扩展功能,可以参阅: https://linux.cn/article-5658-1.html ) + +- 返回先前的工作目录: `cd -` + +- 如果你命令输入到一半,但是改变主意了,可以敲 **alt-#** 来添加一个 `#` 到开头,然后将该命令作为注释输入(或者使用快捷键 **ctrl-a**, **#**,**enter** 输入)。然后,你可以在后面通过命令历史来回到该命令。 + +- 使用 `xargs`(或 `parallel`),它很强大。注意,你可以控制每行(`-L`)执行多少个项目,以及并行执行(`-P`)。如果你不确定它是否会做正确的事情,可以首先使用 `xargs echo`。同时,使用 `-I{}` 也很方便。样例: +```bash + find . -name '*.py' | xargs grep some_function + cat hosts | xargs -I{} ssh root@{} hostname +``` + +- `pstree -p` 对于显示进程树很有帮助。 + +- 使用 `pgrep` 和 `pkill` 来按名称查找进程或给指定名称的进程发送信号(`-f` 很有帮助)。 + +- 掌握各种可以发送给进程的信号。例如,要挂起进程,可以使用 `kill -STOP [pid]`。完整的列表可以查阅 `man 7 signal`。 + +- 如果你想要一个后台进程一直保持运行,使用 `nohup` 或 `disown`。 + +- 通过 `netstat -lntp` 或 `ss -plat` 检查哪些进程在监听(用于 TCP,对 UDP 使用 `-u` 替代 `-t`)。 + +- `lsof`来查看打开的套接字和文件。 + +- 在 Bash 脚本中,使用 `set -x` 调试脚本输出。尽可能使用严格模式。使用 `set -e` 在遇到错误时退出。也可以使用 `set -o pipefail`,对错误进行严格处理(虽然该话题有点微妙)。对于更复杂的脚本,也可以使用 `trap`。 + +- 在 Bash 脚本中,子 shell(写在括号中的)是组合命令的便利的方式。一个常见的例子是临时移动到一个不同的工作目录,如: +```bash + # 在当前目录做些事 + (cd /some/other/dir; other-command) + # 继续回到原目录 +``` + +- 注意,在 Bash 中有大量的各种各样的变量扩展。检查一个变量是否存在:`${name:?error message}`。例如,如果一个Bash脚本要求一个单一参数,只需写 `input_file=${1:?usage: $0 input_file}`。算术扩展:`i=$(( (i + 1) % 5 ))`。序列: `{1..10}`。修剪字符串:`${var%suffix}` 和 `${var#prefix}`。例如,if `var=foo.pdf` ,那么 `echo ${var%.pdf}.txt` 会输出 `foo.txt`。 + +- 命令的输出可以通过 `<(some command)` 作为一个文件来处理。例如,将本地的 `/etc/hosts` 和远程的比较: +```sh + diff /etc/hosts <(ssh somehost cat /etc/hosts) +``` + +- 了解 Bash 中的“嵌入文档”,就像在 `cat <logfile 2>&1` 同时重定向标准输出和标准错误。通常,要确保某个命令不再为标准输入打开文件句柄,而是将它捆绑到你所在的终端,添加 ` foo: + rename 's/\.bak$//' *.bak + # 文件和目录的全名 foo -> bar: + repren --full --preserve-case --from foo --to bar . +``` + +- 使用 `shuf` 来从某个文件中打乱或随机选择行。 + +- 了解 `sort` 的选项。知道这些键是怎么工作的(`-t`和`-k`)。特别是,注意你需要写`-k1,1`来只通过第一个字段排序;`-k1`意味着根据整行排序。 + +- 稳定排序(`sort -s`)会很有用。例如,要首先按字段2排序,然后再按字段1排序,你可以使用 `sort -k1,1 | sort -s -k2,2` + +- 如果你曾经需要在 Bash 命令行中写一个水平制表符(如,用于 -t 参数的排序),按**ctrl-v** **[Tab]**,或者写`$'\t'`(后面的更好,因为你可以复制/粘贴)。 + +- 对源代码进行补丁的标准工具是 `diff` 和 `patch`。 用 `diffstat` 来统计 diff 情况。注意 `diff -r` 可以用于整个目录,所以可以用 `diff -r tree1 tree2 | diffstat` 来统计(两个目录的)差异。 + +- 对于二进制文件,使用 `hd` 进行简单十六进制转储,以及 `bvi` 用于二进制编辑。 + +- 还是用于二进制文件,`strings`(加上 `grep` 等)可以让你找出一点文本。 + +- 对于二进制文件的差异(delta 压缩),可以使用 `xdelta3`。 + +- 要转换文本编码,试试 `iconv` 吧,或者对于更高级的用途使用 `uconv`;它支持一些高级的 Unicode 的东西。例如,这个命令可以转换为小写并移除所有重音符号(通过扩展和丢弃): +```sh + uconv -f utf-8 -t utf-8 -x '::Any-Lower; ::Any-NFD; [:Nonspacing Mark:] >; ::Any-NFC; ' < input.txt > output.txt +``` + +- 要将文件分割成几个部分,来看看 `split`(按大小分割)和 `csplit`(按格式分割)吧。 + +- 使用 `zless`,`zmore`,`zcat` 和 `zgrep` 来操作压缩文件。 + +## 系统调试 + +- 对于 Web 调试,`curl` 和 `curl -I` 很方便灵活,或者也可以使用它们的同行 `wget`,或者更现代的 [`httpie`](https://github.com/jakubroztocil/httpie)。 + +- 要了解磁盘、CPU、网络的状态,使用 `iostat`,`netstat`,`top`(或更好的 `htop`)和(特别是)`dstat`。它们对于快速获知系统中发生的状况很好用。 + +- 对于更深层次的系统总览,可以使用 [`glances`](https://github.com/nicolargo/glances)。它会在一个终端窗口中为你呈现几个系统层次的统计数据,对于快速检查各个子系统很有帮助。 + +- 要了解内存状态,可以运行 `free` 和 `vmstat`,看懂它们的输出结果吧。特别是,要知道“cached”值是Linux内核为文件缓存所占有的内存,因此,要有效地统计“free”值。 + +- Java 系统调试是一件截然不同的事,但是对于 Oracle 系统以及其它一些 JVM 而言,不过是一个简单的小把戏,你可以运行 `kill -3 `,然后一个完整的堆栈追踪和内存堆的摘要(包括常规的垃圾收集细节,这很有用)将被转储到stderr/logs。 + +- 使用 `mtr` 作路由追踪更好,可以识别网络问题。 + +- 对于查看磁盘满载的原因,`ncdu` 会比常规命令如 `du -sh *` 更节省时间。 + +- 要查找占用带宽的套接字和进程,试试 `iftop` 或 `nethogs` 吧。 + +- (Apache附带的)`ab`工具对于临时应急检查网络服务器性能很有帮助。对于更复杂的负载测试,可以试试 `siege`。 + +- 对于更仔细的网络调试,可以用 `wireshark`,`tshark` 或 `ngrep`。 + +- 掌握 `strace` 和 `ltrace`。如果某个程序失败、挂起或崩溃,而你又不知道原因,或者如果你想要获得性能的大概信息,这些工具会很有帮助。注意,分析选项(`-c`)和使用 `-p` 关联运行进程。 + +- 掌握 `ldd` 来查看共享库等。 + +- 知道如何使用 `gdb` 来连接到一个运行着的进程并获取其堆栈追踪信息。 + +- 使用 `/proc`。当调试当前的问题时,它有时候出奇地有帮助。样例:`/proc/cpuinfo`,`/proc/xxx/cwd`,`/proc/xxx/exe`,`/proc/xxx/fd/`,`/proc/xxx/smaps`。 + +- 当调试过去某个东西为何出错时,`sar` 会非常有帮助。它显示了 CPU、内存、网络等的历史统计数据。 + +- 对于更深层的系统和性能分析,看看 `stap` ([SystemTap](https://sourceware.org/systemtap/wiki)),[`perf`](http://en.wikipedia.org/wiki/Perf_(Linux)) 和 [`sysdig`](https://github.com/draios/sysdig) 吧。 + +- 确认是正在使用的 Linux 发行版版本(支持大多数发行版):`lsb_release -a`。 + +- 每当某个东西的行为异常时(可能是硬件或者驱动器问题),使用`dmesg`。 + +## 单行程序 + +这是将命令连成一行的一些样例: + +- 有时候通过 `sort`/`uniq` 对文本文件做交集、并集和差集运算时,这个例子会相当有帮助。假定 `a` 和 `b` 是已经进行了唯一性处理的文本文件。这会很快,而且可以处理任意大小的文件,总计可达数千兆字节。(Sort不受内存限制,不过如果 `/tmp` 放在一个很小的根分区的话,你可能需要使用 `-T` 选项。)也可参见上面关于`LC_ALL`的注解和 `-u` 选项(参见下面例子更清晰)。 + + ```bash + cat a b | sort | uniq > c # c 是 a 和 b 的并集 + cat a b | sort | uniq -d > c # c 是 a 和 b 的交集 + cat a b b | sort | uniq -u > c # c 是 a 减去 b 的差集 +``` +- 使用 `grep . *` 来可视化查看一个目录中的所有文件的所有内容,例如,对于放满配置文件的目录: `/sys`, `/proc`, `/etc`。 + +- 对某个文本文件的第三列中所有数据进行求和(该例子可能比同等功能的Python要快3倍,而且代码也少于其3倍): +```sh + awk '{ x += $3 } END { print x }' myfile +``` + +- 如果想要查看某个文件树的大小/日期,该例子就像一个递归`ls -l`,但是比`ls -lR`要更容易读懂: +```sh + find . -type f -ls +``` + +- 只要可以,请使用 `xargs` 或 `parallel`。注意,你可以控制每行(`-L`)执行多少个项目,以及并行执行(`-P`)。如果你不确定它是否会做正确的事情,可以首先使用 `xargs echo`。同时,使用 `-I{}` 也很方便。样例: +```sh + find . -name '*.py' | xargs grep some_function + cat hosts | xargs -I{} ssh root@{} hostname +``` + +- 比如说,你有一个文本文件,如 Web 服务器的日志,在某些行中出现了某个特定的值,如 URL 中出现的 `acct_id` 参数。如果你想要统计有多少个 `acct_id` 的请求: +```sh + cat access.log | egrep -o 'acct_id=[0-9]+' | cut -d= -f2 | sort | uniq -c | sort -rn +``` + +- 运行该函数来获得来自本文的随机提示(解析Markdown并从中提取某个项目): +```sh + function taocl() { + curl -s https://raw.githubusercontent.com/jlevy/the-art-of-command-line/master/README.md | + pandoc -f markdown -t html | + xmlstarlet fo --html --dropdtd | + xmlstarlet sel -t -v "(html/body/ul/li[count(p)>0])[$RANDOM mod last()+1]" | + xmlstarlet unesc | fmt -80 + } +``` + + +## 晦涩难懂,但却有用 + +- `expr`:实施算术或布林操作,或者求正则表达式的值 + +- `m4`:简单的宏处理器 + +- `yes`:大量打印一个字符串 + +- `cal`:漂亮的日历 + +- `env`:(以特定的环境变量设置)运行一个命令(脚本中很有用) + +- `look`:查找以某个字符串开头的英文单词(或文件中的行) + +- `cut ` 和 `paste` 以及 `join`:数据处理 + +- `fmt`:格式化文本段落 + +- `pr`:格式化文本为页/列 + +- `fold`:文本折行 + +- `column`:格式化文本为列或表 + +- `expand` 和 `unexpand`:在制表符和空格间转换 + +- `nl`:添加行号 + +- `seq`:打印数字 + +- `bc`:计算器 + +- `factor`:分解质因子 + +- `gpg`:加密并为文件签名 + +- `toe`:terminfo 条目表 + +- `nc`:网络调试和数据传输 + +- `socat`:套接字中继和 tcp 端口转发(类似 `netcat`) + +- `slurm`:网络流量可视化 + +- `dd`:在文件或设备间移动数据 + +- `file`:识别文件类型 + +- `tree`:以树形显示目录及子目录;类似 `ls`,但是是递归的。 + +- `stat`:文件信息 + +- `tac`:逆序打印文件 + +- `shuf`:从文件中随机选择行 + +- `comm`:逐行对比分类排序的文件 + +- `hd`和`bvi`:转储或编辑二进制文件 + +- `strings`:从二进制文件提取文本 + +- `tr`:字符转译或处理 + +- `iconv `或`uconv`:文本编码转换 + +- `split `和`csplit`:分割文件 + +- `units`:单位转换和计算;将每双周(fortnigh)一浪(浪,furlong,长度单位,约201米)转换为每瞬(blink)一缇(缇,twip,一种和屏幕无关的长度单位)(参见: /usr/share/units/definitions.units)(LCTT 译注:这都是神马单位啊!) + +- `7z`:高比率文件压缩 + +- `ldd`:动态库信息 + +- `nm`:目标文件的符号 + +- `ab`:Web 服务器基准测试 + +- `strace`:系统调用调试 + +- `mtr`:用于网络调试的更好的路由追踪软件 + +- `cssh`:可视化并发 shell + +- `rsync`:通过 SSH 同步文件和文件夹 + +- `wireshark` 和 `tshark`:抓包和网络调试 + +- `ngrep`:从网络层摘取信息 + +- `host` 和 `dig`:DNS查询 + +- `lsof`:处理文件描述符和套接字信息 + +- `dstat`:有用的系统统计数据 + +- [`glances`](https://github.com/nicolargo/glances):高级,多个子系统概览 + +- `iostat`:CPU和磁盘使用率统计 + +- `htop`:top的改进版 + +- `last`:登录历史 + +- `w`:谁登录进来了 + +- `id`:用户/组身份信息 + +- `sar`:历史系统统计数据 + +- `iftop`或`nethogs`:按套接口或进程的网络使用率 + +- `ss`:套接口统计数据 + +- `dmesg`:启动和系统错误信息 + +- `hdparm`:SATA/ATA 磁盘操作/改善性能 + +- `lsb_release`:Linux 发行版信息 + +- `lsblk`:列出块设备,以树形展示你的磁盘和分区 + +- `lshw`:硬件信息 + +- `fortune`,`ddate` 和 `sl`:嗯,好吧,它取决于你是否认为蒸汽机车和 Zippy 引用“有用” + + +## 更多资源 + +- [超棒的shell](https://github.com/alebcay/awesome-shell): 一个shell工具和资源一览表。 +- [严格模式](http://redsymbol.net/articles/unofficial-bash-strict-mode/) 用于写出更佳的shell脚本。 + + +## 免责声明 + +除了非常小的任务外,其它都写出了代码供大家阅读。伴随力量而来的是责任。事实是,你*能*在Bash中做的,并不意味着是你所应该做的!;) + +-------------------------------------------------------------------------------- + +via: https://github.com/jlevy/the-art-of-command-line + +作者:[jlevy][a] +译者:[GOLinux](https://github.com/GOLinux) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://github.com/jlevy +[1]:http://explainshell.com/ + diff --git a/translated/tech/20150617 The Art of Command Line.md b/translated/tech/20150617 The Art of Command Line.md deleted file mode 100644 index 87e8e7458e..0000000000 --- a/translated/tech/20150617 The Art of Command Line.md +++ /dev/null @@ -1,431 +0,0 @@ -命令行艺术 -================================================================================ -- [基础](#basics) -- [日常使用](#everyday-use) -- [处理文件和数据](#processing-files-and-data) -- [系统调试](#system-debugging) -- [单行程序](#one-liners) -- [晦涩难懂,但却有用](#obscure-but-useful) -- [更多资源](#more-resources) -- [免责声明](#disclaimer) - - -![curl -s 'https://raw.githubusercontent.com/jlevy/the-art-of-command-line/master/README.md' | egrep -o '`\w+`' | tr -d '`' | cowsay -W50](https://github.com/jlevy/the-art-of-command-line/blob/master/cowsay.png) - -流畅地使用命令行是一个常被忽略的技能,或被认为是神秘的奥义。但是,它会以明显而微妙的方式改善你作为工程师的灵活度和生产力。这是我在Linux上工作时发现的有用的命令行使用小窍门和笔记的精粹。有些小窍门是很基础的,而有些是相当地特别、相当地复杂、或者相当地晦涩难懂。这一页不长,但是如果你可以使用并记得这里的所有项目,那么你知道不少了。 - -其中大部分[最初](http://www.quora.com/What-are-some-lesser-known-but-useful-Unix-commands)[出现](http://www.quora.com/What-are-the-most-useful-Swiss-army-knife-one-liners-on-Unix)在[Quora](http://www.quora.com/What-are-some-time-saving-tips-that-every-Linux-user-should-know)上,但是考虑到利益,似乎更值得使用Github,这上面的人比我更能提出改进建议。如果你看到一个错误,或者更好的某种东西,请提交问题或PR! - -范围: - -- 目标宽广而简洁。每个小窍门在某种情形下都很基础,或者比替代品大大节省时间。 -- 这是为Linux写的。大多数,但并非全部项目可以同样应用到MacOS(或者甚至Cygwin)。 -- 焦点集中在交互的Bash上,尽管大多数小窍门也可以应用到其它shell,以及常规Bash脚本。 -- 意在作最少说明,要想期待更多,你可以使用`man`、使用`apt-get`/`yum`/`dnf`来安装,还可以使用Google来获得更多背景知识。 - - -## 基础 - -- 学习基本Bash技能。实际上,键入`man bash`,然后至少浏览一遍所有东西;它很容易理解,没那么长。其它shell会很好,但是Bash很强大,而且总是可用(*只*学习zsh、fish之类,而在你自己的笔记本上测试时,会在很多情形下受到限制,比如使用现存的服务器)。 - -- 至少学好一种基于文本的编辑器。理想的一个是Vim(`vi`),因为在终端中用于随机编辑时它没有竞争者(即使大多数时候你使用Emacs,一个大型的IDE,或一个现代的时髦编辑器)。 - -- 学习使用`>`和`<`来进行输出和输入重定向,以及使用`|`来管道重定向,学习关于stdout和stderr的东西。 - -- 学习`*`(也许还有`?`和`{`...`}`)文件通配扩展和应用,以及双引号`"`和单引号`'`之间的区别。(更多内容请参看下面关于变量扩展部分)。 - -- 熟悉Bash作业管理:`&`, **ctrl-z**, **ctrl-c**, `jobs`, `fg`, `bg`, `kill`等等。 - -- 掌握`ssh`,以及通过`ssh-agent`,`ssh-add`等进行无密码验证的基础技能。 - -- 基本的文件管理:`ls`和`ls -l`(特别是,知道`ls -l`各个栏目的意义),`less`, `head`, `tail` 和`tail -f`(或者更好的`less +F`),`ln`和`ln -s`(知道硬链接和软链接的区别,以及硬链接相对于软链接的优势),`chown`,`chmod`,`du`(用于查看磁盘使用率的快速摘要:`du -sk *`),`df`, `mount`。 - -- 基本的网络管理: `ip`或`ifconfig`,`dig`。 - -- 熟知正则表达式,以及各种标识来使用`grep`/`egrep`。`-i`,`-o`,`-A`和`-B`选项值得掌握。 - -- 学会使用`apt-get`,`yum`或`dnf`(这取决于你的发行版)来查找并安装软件包。确保你可以用`pip`来安装基于Python的命令行工具(下面的一些东西可以很容易地通过`pip`安装)。 - - -## 日常使用 - -- 在Bash中,使用**ctrl-r**来搜索命令历史。 - -- 在Bash中,使用 **ctrl-w** 来删除最后的单词,使用 **ctrl-u** 来删除整行。使用 **alt-b** 和 **alt-f** 来逐词移动,以及使用**ctrl-k**来杀死到行尾。请使用 `man readline` 来查看Bash中所有默认的键绑定,有很多。例如,**alt-.** 可以循环显示先前的参数,而**alt-** 扩展通配。 - -- 返回先前的工作目录: `cd -` - -- 如果你命令输入到一半,但是改变主意了,可以敲 **alt-#** 来添加一个 `#` 到开头,然后将该命令作为注释输入(或者使用 **ctrl-a**, **#**,**enter**)。然后,你可以在后面通过命令历史来返回到该命令。 - -- 使用`xargs`(或`parallel`),它很强大。注意,你可以控制每行(`-L`)执行多少个项目,而言可以使用平行结构(`-P`)。如果你不确定它是否会做正确的事情,可以首先使用`xargs echo`。同时,使用`-I{}`也很方便。样例: -```bash - find . -name '*.py' | xargs grep some_function - cat hosts | xargs -I{} ssh root@{} hostname -``` - -- `pstree -p`对于现实进程树很有帮助。 - -- 使用`pgrep`和`pkill`来按名称查找或用信号通知进程(`-f`很有帮助)。 - -- 掌握各种可以发送给进程的信号。例如,要挂起进程,可以使用`kill -STOP [pid]`。完整的列表可以查阅see `man 7 signal`。 - -- 如果你想要一个后台进程一直保持运行,使用`nohup`或`disown`。 - -- 通过`netstat -lntp`检查什么进程在监听。 - -- `lsof`来查看打开的套接口和文件。 - -- 在Bash脚本中,使用`set -x`调试脚本输出。每当可能时,使用严格模式。使用`set -e`在遇到错误时退出。也可以使用`set -o pipefail`,对错误严格(虽然该话题有点敏感)。对于更复杂的脚本,也可以使用`trap`。 - -- 在Bash脚本中,子shell(写在括号中的)是集合命令的便利的方式。一个常见的例子是临时移动到一个不同的工作目录,如: -```bash - # do something in current dir - (cd /some/other/dir; other-command) - # continue in original dir -``` - -- 注意,在Bash中有大量各种各样的变量扩展。检查一个变量是否存在:`${name:?error message}`。例如,如果一个Bash脚本要求一个单一参数,只需写`input_file=${1:?usage: $0 input_file}`。算术扩展:`i=$(( (i + 1) % 5 ))`。序列:`{1..10}`。修剪字符串:`${var%suffix}`和`${var#prefix}`。例如,if `var=foo.pdf`, then `echo ${var%.pdf}.txt` prints `foo.txt`。 - -- 命令的输出可以通过`<(some command)`作为一个文件来处理。例如,将本地的`/etc/hosts`和远程的比较: -```sh - diff /etc/hosts <(ssh somehost cat /etc/hosts) -``` - -- 知道Bash中的“嵌入文档”,就像在`cat <logfile 2>&1`同时重定向标准输出和标准错误。通常,要确保某个命令不会再标准输入中遗留有打开的文件句柄,将它捆绑到你所在的终端,添加` foo: - rename 's/\.bak$//' *.bak - # Full rename of filenames, directories, and contents foo -> bar: - repren --full --preserve-case --from foo --to bar . -``` - -- 使用`shuf`来从某个文件中随机选择随机的行。 - -- 知道`sort`的选项。知道这些键是怎么工作的(`-t`和`-k`)。特别是,注意你需要写`-k1,1`来只通过第一个字段排序;`-k1`意味着根据整行排序。 - -- 稳定排序(`sort -s`)会很有用。例如,要首先按字段2排序,然后再按字段1排序,你可以使用`sort -k1,1 | sort -s -k2,2` - -- 如果你曾经需要在Bash命令行中写一个标签文字(如,用于-t参数的排序),按**ctrl-v** **[Tab]**,或者写`$'\t'`(后面的更好,因为你可以复制/粘贴)。 - -- 对于二进制文件,使用`hd`进行简单十六进制转储,以及`bvi`用于二进制编辑。 - -- 还是用于二进制文件,`strings`(加上`grep`等)可以让你找出文本的二进制数。 - -- 要转换文本编码,试试`iconv`吧,或者对于更高级的使用`uconv`;它支持一些高级的统一字符标准的东西。例如,这个命令可以将所有重音符号转成小写并(通过扩展和丢弃)移除: -```sh - uconv -f utf-8 -t utf-8 -x '::Any-Lower; ::Any-NFD; [:Nonspacing Mark:] >; ::Any-NFC; ' < input.txt > output.txt -``` - -- 要将文件分割成各个部分,来看看`split`(按大小分割)和`csplit`(按格式分割)吧。 - -- 使用`zless`,`zmore`,`zcat`和`zgrep`来操作压缩文件。 - - -## 系统调试 - -- 对于网络调试,`curl`和`curl -I`很方便灵活,或者业可以使用它们的同行`wget`,或者更现代的[`httpie`](https://github.com/jakubroztocil/httpie)。 - -- 要知道disk/cpu/network的状态,使用`iostat`,`netstat`,`top`(或更好的`htop`)和(特别是)`dstat`。它们对于快速获知系统中发生的状况很好用。 - -- 对于更深层次的系统总览,可以使用[`glances`](https://github.com/nicolargo/glances)。它会在一个终端窗口中为你呈现几个系统层次的统计数据,对于快速检查各个子系统很有帮助。 - -- 要知道内存状态,可以运行`free`和`vmstat`,看懂它们的输出结果吧。特别是,要知道“cached”值是Linux内核作为文件缓存所占有的内存,因此,要有效地统计“free”值。 - -- 系统调试是一件截然不同的事,但是对于Oracle系统以及其它一些JVM而言,不过是一个简单的小把戏,你可以运行`kill -3 `,然后一个完整的堆栈追踪和累积的摘要(包括分代垃圾收集细节,这里头信息量很大)将被转储到stderr/logs.Java。 - -- 使用`mtr`作为更好的路由追踪,来识别网络问题。 - -- 对于查看磁盘满载的原因,`ncdu`会比常规命令如`du -sh *`更节省时间。 - -- 要查找占用带宽的套接口和进程,试试`iftop`或`nethogs`吧。 - -- (Apache附带的)`ab`工具对于临时应急检查网络服务器性能很有帮助。对于更复杂的负载测试,可以试试`siege`。 - -- 对于更重型的网络调试,可以用`wireshark`,`tshark`或`ngrep`。 - -- 掌握`strace`和`ltrace`。如果某个程序失败、挂起或崩溃,而你又不知道原因,或者如果你想要获得性能的大概信息,这些工具会很有帮助。注意,分析选项(`-c`)和关联运行进程的能力(`-p`)。 - -- 掌握`ldd`来检查共享库等。 - -- 知道如何使用`gdb`来连接到一个运行着的进程并获取其堆栈追踪信息。 - -- 使用`/proc`。当调试当前注目问题时,它有时候出奇地有帮助。样例:`/proc/cpuinfo`,`/proc/xxx/cwd`,`/proc/xxx/exe`,`/proc/xxx/fd/`,`/proc/xxx/smaps`。 - -- 当调试过去某个东西出错时,`sar`会非常有帮助。它显示了CPU、内存、网络等的历史统计数据。 - -- 对于更深层的系统和性能分析,看看`stap` ([SystemTap](https://sourceware.org/systemtap/wiki)),[`perf`](http://en.wikipedia.org/wiki/Perf_(Linux))和[`sysdig`](https://github.com/draios/sysdig)吧。 - -- 确认是正在使用的Linux发行版版本(大多数发行版可用):`lsb_release -a`。 - -- 每当某个东西的行为异常时(可能是硬件或者驱动器问题),使用`dmesg`。 - - -## 单行程序 - -将命令拼凑在一起的一些样例: - -- 有时候通过`sort`/`uniq`来进行交互设置、合并,以及比较文本文件的差异时,这个例子会相当有帮助。假定`a`和`b`是已经进行唯一性处理的文本文件。这会很快,而且可以处理任意大小的文件,总计可达数千兆字节。(Sort不受内存限制,然后你可能需要使用`-T`选项来检查`/tmp`是否挂载一个容量小的root分区上。)也可参见上面关于`LC_ALL`的注解。 -```sh - cat a b | sort | uniq > c # c is a union b - cat a b | sort | uniq -d > c # c is a intersect b - cat a b b | sort | uniq -u > c # c is set difference a - b -``` - -- 对某个文本文件的第三列中所有数据进行求和(该例子可能比同等功能的Python要快3倍,而且代码也少于其3倍): -```sh - awk '{ x += $3 } END { print x }' myfile -``` - -- 如果想要查看某个文件树的大小/日期,该例子就像一个递归`ls -l`,但是比`ls -lR`要更容易读懂: -```sh - find . -type f -ls -``` - -- 只要可以,请使用Use `xargs`或`parallel`。注意,你可以控制每行(`-L`)执行多少个项目,也可同时控制并行计算(`-P`)。如果你不确定它是否会做正确的事,可以在前面加上xargs echo。同时,`-I{}`很灵便。样例: -```sh - find . -name '*.py' | xargs grep some_function - cat hosts | xargs -I{} ssh root@{} hostname -``` - -- 比如说,你有一个文本文件,像网络服务器的日志,在某些行中出现了某个特定的值,如URL中出现的`acct_id`参数。如果你想要一个针对每个`acct_id`的请求的计数器: -```sh - cat access.log | egrep -o 'acct_id=[0-9]+' | cut -d= -f2 | sort | uniq -c | sort -rn -``` - -- 运行该函数来获得来自文档的随机提示(解析Markdown并从中提取某个项目): -```sh - function taocl() { - curl -s https://raw.githubusercontent.com/jlevy/the-art-of-command-line/master/README.md | - pandoc -f markdown -t html | - xmlstarlet fo --html --dropdtd | - xmlstarlet sel -t -v "(html/body/ul/li[count(p)>0])[$RANDOM mod last()+1]" | - xmlstarlet unesc | fmt -80 - } -``` - - -## 晦涩难懂,但却有用 - -- `expr`:实施算术或布林操作,或者求正则表达式的值 - -- `m4`:简单宏处理器 - -- `screen`:强大的终端多路复用和会话保持 - -- `yes`:大量打印一个字符串 - -- `cal`:漂亮的日历 - -- `env`:运行一个命令(脚本中很有用) - -- `look`:查找以某个字符串开头的英文单词(或文件中的行) - -- `cut `和`paste`以及`join`:数据处理 - -- `fmt`:格式化文本段落 - -- `pr`:格式化文本为页/栏 - -- `fold`:包裹文本行 - -- `column`:格式化文本为栏或表 - -- `expand`和`unexpand`:在制表和空格间转换 - -- `nl`:添加行号 - -- `seq`:打印数字 - -- `bc`:计算器 - -- `factor`:把整数因子分解 - -- `gpg`:加密并为文件签名 - -- `toe`:terminfo条目表 - -- `nc`:网络调试和数据传输 - -- `ngrep`:查找网络层 - -- `dd`:在文件或设备间移动数据 - -- `file`:识别文件类型 - -- `stat`:文件信息 - -- `tac`:逆序打印文件 - -- `shuf`:从文件中随机选择行 - -- `comm`:逐行对比分类排序的文件 - -- `hd`和`bvi`:转储或编辑二进制文件 - -- `strings`:从二进制文件提取文本 - -- `tr`:字符转译或处理 - -- `iconv `或`uconv`:文本编码转换 - -- `split `和`csplit`:分割文件 - -- `7z`:高比率文件压缩 - -- `ldd`:动态库信息 - -- `nm`:目标文件的符号 - -- `ab`:网络服务器基准测试 - -- `strace`:系统调用调试 - -- `mtr`:用于网络调试的更好的路由追踪 - -- `cssh`:可视化并发shell - -- `wireshark`和`tshark`:抓包和网络调试 - -- `host`和`dig`:DNS查询 - -- `lsof`:处理文件描述符和套接字信息 - -- `dstat`:有用的系统统计数据 - -- [`glances`](https://github.com/nicolargo/glances):高级,多子系统概览 - -- `iostat`:CPU和磁盘使用率统计 - -- `htop`:top的改进版 - -- `last`:登录历史 - -- `w`:谁登录进来了 - -- `id`:用户/组身份信息 - -- `sar`:历史系统统计数据 - -- `iftop`或`nethogs`:按套接口或进程的网络使用率 - -- `ss`:套接口统计数据 - -- `dmesg`:启动和系统错误信息 - -- `hdparm`:SATA/ATA磁盘操作/性能 - -- `lsb_release`:Linux发行版信息 - -- `lshw`:硬件信息 - -- `fortune`,`ddate`和`sl`:嗯,好吧,它取决于你是否认为蒸汽机车和齐皮士引用“有用” - - -## 更多资源 - -- [超棒的shell](https://github.com/alebcay/awesome-shell): 一个shell工具和资源一览表。 -- [严格模式](http://redsymbol.net/articles/unofficial-bash-strict-mode/) 用于写出更佳的shell脚本。 - - -## 免责声明 - -除了非常小的任务外,其它都写出了代码供大家阅读。伴随力量而来的是责任。事实是,你*能*在Bash中做的,并不意味着是你所应该做的!;) - --------------------------------------------------------------------------------- - -via: https://github.com/jlevy/the-art-of-command-line - -作者:[jlevy][a] -译者:[GOLinux](https://github.com/GOLinux) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://github.com/jlevy -[1]: -[2]: -[3]: -[4]: -[5]: -[6]: -[7]: -[8]: -[9]: -[10]: -[11]: -[12]: -[13]: -[14]: -[15]: -[16]: -[17]: -[18]: -[19]: -[20]: From 434879d7318b1939ad3b4449ab04131ee7976690 Mon Sep 17 00:00:00 2001 From: wxy Date: Sat, 27 Jun 2015 15:31:29 +0800 Subject: [PATCH 476/965] PUB:20150604 How To Install Unity 8 Desktop Preview In Ubuntu @GOLinux --- ...stall Unity 8 Desktop Preview In Ubuntu.md | 77 ------------------- 1 file changed, 77 deletions(-) delete mode 100644 translated/tech/20150604 How To Install Unity 8 Desktop Preview In Ubuntu.md diff --git a/translated/tech/20150604 How To Install Unity 8 Desktop Preview In Ubuntu.md b/translated/tech/20150604 How To Install Unity 8 Desktop Preview In Ubuntu.md deleted file mode 100644 index bf1c3ea0bb..0000000000 --- a/translated/tech/20150604 How To Install Unity 8 Desktop Preview In Ubuntu.md +++ /dev/null @@ -1,77 +0,0 @@ -Ubuntu中安装Unity 8桌面预览版 -================================================================================ -![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/06/Unity_8.jpeg) - -如果你一直关注新闻,那么Ubuntu将会切换到[Mir显示服务器][1],并随同发布[Unity 8][2]桌面。然而,在尚未确定Unity 8是否会在[Ubuntu 15.10 Willy Werewolf][3]中部署到Mir上之前,提供了一个Unity 8的预览版本供你体验和测试。通过官方PPA,可以很容地**安装Unity 8到Ubuntu 14.04,14.10和15.04中**。 - -到目前为止,开发者已经可以通过[ISO][4]获得该Unity 8预览来进行测试。但是Canonical已经通过[LXC容器][5]发布了。通过该方法,你可以获取Unity 8桌面会话,让它作为任何一个桌面环境运行在Mir显示服务器上。就像你[在Ubuntu中安装Mate桌面][6],然后从LightDm登录屏幕选择桌面会话一样。 - -好奇?想要试试Unity 8?让我们来看怎样安装它吧。 - -**注意: 它是一个实验性预览,可能不是所有人都可以让它正确工作的。** - -### 安装Unity 8桌面到Ubuntu ### - -下面是安装并使用Unity 8的步骤: - -#### 步骤 1: 安装Unity 8到Ubuntu 12.04和14.04 #### - -如果你真运行着Ubuntu 12.04和14.04,那么你必须使用官方PPA来安装Unity 8。使用以下命令进行安装: - - sudo apt-add-repository ppa:unity8-desktop-session-team/unity8-preview-lxc - sudo apt-get update - sudo apt-get upgrade - sudo apt-get install unity8-lxc - -#### 步骤 1: 安装Unity 8到Ubuntu 14.10和15.04 #### - -如果你真运行着Ubuntu 14.10或15.04,那么Unity 8 LXC已经在源中准备好。你只需要运行以下命令: - - sudo apt-get update - sudo apt-get install unity8-lxc - -#### 步骤 2: 设置Unity 8桌面预览LXC #### - -安装Unity 8 LXC后,该对它进行设置,下面的命令就可达到目的: - - sudo unity8-lxc-setup - -它将花费一些时间来设置,所以,给点耐心吧。它会下载ISO,然后解压缩,接着完整最后一些必要的设置来让它工作。它也会安装一个LightDM的轻度修改版本。这一切都搞定后,需要重启。 - -#### 步骤 3: 选择Unity 8 #### - -重启后,在登录屏幕,点击你的登录旁边的Ubuntu图标: - -![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2014/08/Change_Desktop_Environment_Ubuntu.jpeg) - -你应该可以在这看到Unity 8的选项,选择它: - -![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/06/Select_Unity8.jpeg) - -### 卸载Unity 8 LXC ### - -如果你发现Unity 8毛病太多,或者你不喜欢它,那么你可以以相同的方式切换会默认Unity版本。此外,你也可以通过下面的命令移除Unity 8: - - sudo apt-get remove unity8-lxc - -该命令会将Unity 8选项从LightDM屏幕移除,但是配置仍然保留着。 - -以上就是你在Ubuntu中安装嗲有Mir的Unity 8的全部过程,试玩后请分享你关于Unity 8的想法哦! - --------------------------------------------------------------------------------- - -via: http://itsfoss.com/install-unity-8-desktop-ubuntu/ - -作者:[Abhishek][a] -译者:[GOLinux](https://github.com/GOLinux) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://itsfoss.com/author/abhishek/ -[1]:http://en.wikipedia.org/wiki/Mir_%28software%29 -[2]:https://wiki.ubuntu.com/Unity8Desktop -[3]:http://itsfoss.com/ubuntu-15-10-codename/ -[4]:https://wiki.ubuntu.com/Unity8DesktopIso -[5]:https://wiki.ubuntu.com/Unity8inLXC -[6]:http://itsfoss.com/install-mate-desktop-ubuntu-14-04/ From 19a2f1bbd157a7e3d5a0879aa8ae3b132c2d910d Mon Sep 17 00:00:00 2001 From: wxy Date: Sat, 27 Jun 2015 21:26:06 +0800 Subject: [PATCH 477/965] PUB:20150610 Install Android Studio on Ubuntu 15.04 @NearTan --- ... Install Android Studio on Ubuntu 15.04.md | 29 ++++++++----------- 1 file changed, 12 insertions(+), 17 deletions(-) rename {translated/tech => published}/20150610 Install Android Studio on Ubuntu 15.04.md (72%) diff --git a/translated/tech/20150610 Install Android Studio on Ubuntu 15.04.md b/published/20150610 Install Android Studio on Ubuntu 15.04.md similarity index 72% rename from translated/tech/20150610 Install Android Studio on Ubuntu 15.04.md rename to published/20150610 Install Android Studio on Ubuntu 15.04.md index 25fe29e043..111291ebd2 100644 --- a/translated/tech/20150610 Install Android Studio on Ubuntu 15.04.md +++ b/published/20150610 Install Android Studio on Ubuntu 15.04.md @@ -1,29 +1,27 @@ - 在Ubuntu 15.04下安装Android Studio -PS 原MD文件有大段重复并且排版错误,译者已修复 ================================================================================ -Android Studio是官方为了Android应用开发者而发布的IDE,它基于IntelliJ的IDEA。 +![](http://www.ubuntugeek.com/wp-content/uploads/2015/05/23.png) + +Android Studio是官方为了Android应用开发者而发布的IDE,它基于IntelliJ的IDEA。 ### Android Studio的功能 ### -灵活的基于Gradle的建构系统 +- 灵活的基于Gradle的建构系统 -针对不同手机编译多个版本的apk +- 针对不同手机编译多个版本的apk -代码模板功能构建出各种常用的应用 +- 代码模板功能构建出各种常用的应用 -支持拖动编辑主题的富布局编辑器 +- 支持拖动编辑主题的富布局编辑器 -lint工具可以捕捉到应用的性能、可用性、版本冲突或者其他问题 +- lint工具可以捕捉到应用的性能、可用性、版本冲突或者其他问题 -代码混淆和应用签名功能 - -内置 Google Cloud Platform 的支持,可以轻易的融入Google Cloud Messaging 和 App Engine支持 - -还有更多 +- 代码混淆和应用签名功能 +- 内置 Google Cloud Platform 的支持,可以轻易的融入Google Cloud Messaging 和 App Engine支持 +- 还有更多 ### 在 Ubuntu 15.04 上安装 Android Studio ### @@ -33,7 +31,6 @@ lint工具可以捕捉到应用的性能、可用性、版本冲突或者其他 sudo apt-get update sudo apt-get install android-studio - 如果要把Android Studio添加到启动栏,你需要如下操作 打开Android Studio,点击Configure选择Create Desktop Entry,这样Android Studio应该在dash中创建快捷方式了。 @@ -42,8 +39,6 @@ lint工具可以捕捉到应用的性能、可用性、版本冲突或者其他 ![](http://www.ubuntugeek.com/wp-content/uploads/2015/05/12.png) -![](http://www.ubuntugeek.com/wp-content/uploads/2015/05/23.png) - ![](http://www.ubuntugeek.com/wp-content/uploads/2015/05/31.png) ![](http://www.ubuntugeek.com/wp-content/uploads/2015/05/41.png) @@ -60,7 +55,7 @@ via: http://www.ubuntugeek.com/install-android-studio-on-ubuntu-15-04.html 作者:[ruchi][a] 译者:[NearTan](https://github.com/NearTan) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 4d0c09545e7944e389c3c124adb2ac81adc44632 Mon Sep 17 00:00:00 2001 From: wxy Date: Sat, 27 Jun 2015 21:43:10 +0800 Subject: [PATCH 478/965] PUB:20150610 How to Install nginx and google pagespeed on Ubuntu 15.04 Vivid Vervet @geekpi --- ... pagespeed on Ubuntu 15.04 Vivid Vervet.md | 57 +++++++++---------- 1 file changed, 28 insertions(+), 29 deletions(-) rename {translated/tech => published}/20150610 How to Install nginx and google pagespeed on Ubuntu 15.04 Vivid Vervet.md (56%) diff --git a/translated/tech/20150610 How to Install nginx and google pagespeed on Ubuntu 15.04 Vivid Vervet.md b/published/20150610 How to Install nginx and google pagespeed on Ubuntu 15.04 Vivid Vervet.md similarity index 56% rename from translated/tech/20150610 How to Install nginx and google pagespeed on Ubuntu 15.04 Vivid Vervet.md rename to published/20150610 How to Install nginx and google pagespeed on Ubuntu 15.04 Vivid Vervet.md index 91d16acb00..db6e61da65 100644 --- a/translated/tech/20150610 How to Install nginx and google pagespeed on Ubuntu 15.04 Vivid Vervet.md +++ b/published/20150610 How to Install nginx and google pagespeed on Ubuntu 15.04 Vivid Vervet.md @@ -1,37 +1,36 @@ -如何在Ubuntu 15.04(Vivid Vervet)中安装nginx和google pagespeed +如何在 Ubuntu 15.04 中安装 nginx 和 google pagespeed ================================================================================ -Nginx (engine-x)是一个开源高性能http、反向代理和IMAP/POP3代理服务器。nginx杰出的功能有:稳定、丰富的功能集、简单的配置和低资源消耗。nginx被用于一些高性能网站并在站长之间变得越来越流行。本教程会从源码构建一个带有google paespeed模块用于Ubuntu 15.04中的.deb包。 +Nginx (engine-x)是一个开源的高性能 HTTP 服务器、反向代理和 IMAP/POP3 代理服务器。nginx 杰出的功能有:稳定、丰富的功能集、简单的配置和低资源消耗。nginx 被用于一些高性能网站并在站长之间变得越来越流行。本教程会从源码构建一个带有 google paespeed 模块的用于 Ubuntu 15.04 的 nginx .deb 安装包。 +pagespeed 是一个由 google 开发的 web 服务器模块来加速网站响应时间、优化 html 和减少页面加载时间。ngx_pagespeed 的功能如下: -pagespeed是一个由google开发的web服务器模块来加速网站响应时间、优化html和减少页面加载时间。ngx_pagespeed的功能如下: - -- 图像优化:去除meta数据、动态剪裁、重压缩。 -- CSS与JavaScript 放大、串联、内联、外联。 +- 图像优化:去除元数据、动态缩放、重压缩。 +- CSS 与 JavaScript 压缩、串联、内联、外联。 - 小资源内联 -- 延迟图像与JavaScript加载 -- HTML重写。 +- 图像与 JavaScript 延迟加载 +- HTML 重写 - 缓存生命期插件 -更多请见 [https://developers.google.com/speed/pagespeed/module/][1]. +更多请见 [https://developers.google.com/speed/pagespeed/module/][1]。 -### 预备要求 ### +### 前置要求 ### -Ubuntu Server 15.04 64位 -root 权限 +- Ubuntu Server 15.04 64位 +- root 权限 本篇我们将要: -- 安装必备包 -- 安装带ngx_pagespeed的nginx +- 安装必备软件包 +- 安装带 ngx_pagespeed 的 nginx - 测试 #### 安装必备包 #### -sudo apt-get install dpkg-dev build-essential zlib1g-dev libpcre3 libpcre3-dev + sudo apt-get install dpkg-dev build-essential zlib1g-dev libpcre3 libpcre3-dev -#### 安装带ngx_pagespeed的nginx #### +### 安装带 ngx_pagespeed 的 nginx ### -**第一步 - 添加nginx仓库** +#### 第一步 - 添加nginx仓库#### vim /etc/apt/sources.list.d/nginx.list @@ -51,7 +50,7 @@ sudo apt-get install dpkg-dev build-essential zlib1g-dev libpcre3 libpcre3-dev sudo sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys KEYNUMBER sudo apt-get update -**第二步 - 从仓库下载nginx 1.8** +####第二步 - 从仓库下载 nginx 1.8#### sudo su cd ~ @@ -60,7 +59,7 @@ sudo apt-get install dpkg-dev build-essential zlib1g-dev libpcre3 libpcre3-dev apt-get source nginx apt-get build-dep nginx -**第三步 - 下载Pagespeed** +#### 第三步 - 下载 Pagespeed#### cd ~ mkdir -p ~/new/ngx_pagespeed/ @@ -73,12 +72,12 @@ sudo apt-get install dpkg-dev build-essential zlib1g-dev libpcre3 libpcre3-dev wget https://dl.google.com/dl/page-speed/psol/${ngx_version}.tar.gz tar -xzf 1.9.32.3.tar.gz -**第三步 - 配置nginx来编译Pagespeed** +####第四步 - 配置 nginx 来编译 Pagespeed#### cd ~/new/nginx_source/nginx-1.8.0/debin/ vim rules -在CFLAGS `.configure`下添加模块: +在两处 CFLAGS `.configure` 下添加模块: --add-module=../../ngx_pagespeed/ngx_pagespeed-release-1.9.32.3-beta \ @@ -86,27 +85,27 @@ sudo apt-get install dpkg-dev build-essential zlib1g-dev libpcre3 libpcre3-dev ![adding pagespeed to nginx](https://www.howtoforge.com/images/nginx_pagespeed_ubuntu_15_04/big/2.png) -**第五步 - 打包nginx包并安装** +####第五步 - 打包 nginx 软件包并安装#### cd ~/new/nginx_source/nginx-1.8.0/ dpkg-buildpackage -b -dpkg-buildpackage会编译 ~/new/ngix_source/成nginx.deb。打包完成后,看一下目录: +dpkg-buildpackage 会编译 ~/new/ngix_source/ 为 nginx.deb。打包完成后,看一下目录: cd ~/new/ngix_source/ ls ![nginx builded with pagespeed](https://www.howtoforge.com/images/nginx_pagespeed_ubuntu_15_04/big/3.png) -接着安装nginx。 +接着安装 nginx。 dpkg -i nginx_1.8.0-1~trusty_amd64.deb ![Install nginx](https://www.howtoforge.com/images/nginx_pagespeed_ubuntu_15_04/big/4.png) -#### 测试 #### +### 测试 ### -运行nginx -V测试nginx是否已经自带ngx_pagespeed。 +运行 nginx -V 测试 nginx 是否已经自带 ngx_pagespeed。 nginx -V @@ -114,15 +113,15 @@ dpkg-buildpackage会编译 ~/new/ngix_source/成nginx.deb。打包完成后, ### 总结 ### -稳定、快速、开源的nginx支持许多不同的优化模块。这其中之一是google开发的‘pagespeed’。不像apache,nginx模块不是动态加载的,因此你必须在编译之前就选择完需要的模块。 +稳定、快速、开源的 nginx 支持许多不同的优化模块。这其中之一是 google 开发的‘pagespeed’。不像 apache,nginx 模块不是动态加载的,因此你必须在编译之前就选择好需要的模块。 -------------------------------------------------------------------------------- -via: https://www.howtoforge.com/tutorial/how-to-install-nginx-and-google-pagespeed-on-ubuntu-15-04/#step-build-nginx-package-and-install +via: https://www.howtoforge.com/tutorial/how-to-install-nginx-and-google-pagespeed-on-ubuntu-15-04/ 作者:Muhammad Arul 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 9754ff83e6726325e904347c68c86cd3c034c3d7 Mon Sep 17 00:00:00 2001 From: wxy Date: Sat, 27 Jun 2015 22:16:45 +0800 Subject: [PATCH 479/965] PUB:20150331 How to set up remote desktop on Linux VPS using x2go @ictlyh --- ... remote desktop on Linux VPS using x2go.md | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) rename {translated/tech => published}/20150331 How to set up remote desktop on Linux VPS using x2go.md (63%) diff --git a/translated/tech/20150331 How to set up remote desktop on Linux VPS using x2go.md b/published/20150331 How to set up remote desktop on Linux VPS using x2go.md similarity index 63% rename from translated/tech/20150331 How to set up remote desktop on Linux VPS using x2go.md rename to published/20150331 How to set up remote desktop on Linux VPS using x2go.md index 26ad141e84..8ce76e25c6 100644 --- a/translated/tech/20150331 How to set up remote desktop on Linux VPS using x2go.md +++ b/published/20150331 How to set up remote desktop on Linux VPS using x2go.md @@ -1,20 +1,20 @@ -如何在 Linux VPS 上使用 x2go 设置远程桌面 +如何在 Linux 上使用 x2go 设置远程桌面 ================================================================================ -由于一切都迁移到了云上,作为提高职员生产力的一种方式,虚拟远程桌面在工业中越来越流行。尤其对于那些需要跨多个地方和设备不停漫游的人,远程桌面可以让他们和工作环境保持无缝连接。远程桌面对于雇主同样有吸引力,可以在工作环境中提高敏捷性和灵活性,由于硬件整合、桌面安全加固等原因降低 IT 花费。 +由于一切都迁移到了云上,作为提高职员生产力的一种方式,虚拟远程桌面在工业中越来越流行。尤其对于那些需要在多个地方和设备之间不停漫游的人,远程桌面可以让他们和工作环境保持无缝连接。远程桌面对于雇主同样有吸引力,可以在工作环境中提高敏捷性和灵活性,由于硬件整合、桌面安全加固等原因降低 IT 花费。 -在 Linux 世界中,有许多可用的协议(例如 RDP、RFB、NX) 和 服务器/客户端实现(例如 [TigerVNC][1]、RealVNC、FreeNX、x2go、X11vnc、TeamViewer),当然不缺乏设置远程桌面的选择。 +在 Linux 世界中,理所当然设置远程桌面有很多选择,支持许多协议(例如 RDP、RFB、NX) 和服务器/客户端实现(例如 [TigerVNC][1]、RealVNC、FreeNX、x2go、X11vnc、TeamViewer 等等)。 -当中出色的一个是 [X2Go][2],它是一个基于 NX(译者注:通过计算机网络显示远程桌面环境的一种技术,可参考 [Wiki][9]) 的远程桌面服务器和客户端的开源(GPLv2)实现。在这个教程中,我会介绍 **如何为 Linux VPS 使用 X2Go 设置远程桌面环境**。 +这当中有个出色的产品叫做 [X2Go][2],它是一个基于 NX(译者注:通过计算机网络显示远程桌面环境的一种技术,可参考 [Wiki][9])的远程桌面服务器和客户端的开源(GPLv2)实现。在这个教程中,我会介绍 **如何为 Linux VPS 使用 X2Go 设置远程桌面环境**。 ### X2Go 是什么? ### -X2Go 的历史要追溯回 NoMachine 的 NX 技术。NX 远程桌面协议的设计目的是通过利用主动压缩和缓存解决低带宽和高延迟的网络连接问题。后来,NX 转为闭源,但 NX 库还是采用 GPL 协议。这导致了多种基于 NX 的远程桌面解决方案开源实现,X2Go 就是其中之一。 +X2Go 的历史要追溯到 NoMachine 的 NX 技术。NX 远程桌面协议的设计目的是通过利用主动压缩和缓存解决低带宽和高延迟的网络连接问题。后来,NX 转为闭源,但 NX 库还是采用 GPL 协议。这导致出现了多种基于 NX 的远程桌面解决方案开源实现,X2Go 就是其中之一。 -和其它解决方案,例如 VNC 相比,X2Go 带来哪些好处呢? X2Go 继承了 NX 技术的所有高级功能,很自然能在慢速网络连接上良好工作。另外,由于它内置的基于 SSH 的加密技术,X2Go 保持了确保安全的良好业绩记录。不再需要[手动设置 SSH 隧道][4] 。X2Go 开箱支持音频,意味着远程桌面的音乐播放通过网络传送,并进入本地扬声器。在易用性方面,远程桌面上运行的应用程序可以在你的本地桌面中用一个独立窗口无缝呈现,给你造成一种应用程序实际上在你本地桌面运行的错觉。正如你看到的,这些都是一些基于 VNC 的解决方案所缺少的[强大功能][5]。 +和其它解决方案例如 VNC 相比,X2Go 有哪些好处呢? X2Go 继承了 NX 技术的所有高级功能,很自然能在慢速网络连接上良好工作。另外,由于它内置的基于 SSH 的加密技术,X2Go 保持了确保安全的良好业绩记录。不再需要[手动设置 SSH 隧道][4] 。X2Go 默认支持音频,这意味着远程桌面的音乐播放可以通过网络传送,并进入本地扬声器。在易用性方面,远程桌面上运行的应用程序可以在你的本地桌面中以一个独立窗口无缝呈现,会给你造成一种应用程序实际上在你本地桌面运行的错觉。正如你看到的,这些都是一些基于 VNC 的解决方案所缺少的[强大功能][5]。 ### X2GO 的桌面环境兼容性 ### -和其它远程桌面服务器一样,X2Go 服务器也有一些[已知的兼容性问题][6]。像 KDE3/4、Xfce、MATE 和 LXDE 是对 X2Go 服务器最友好的桌面环境。但是,用其它桌面管理器效果可能有所不同。例如,已知 GNOME 3 之后的版本、KDE 5、Unity 和 X2Go 并不兼容。如果你的远程主机的桌面管理器和 X2Go 兼容,你可以继续以下的教程。 +和其它远程桌面服务器一样,X2Go 服务器也有一些[已知的兼容性问题][6]。像 KDE 3/4、Xfce、MATE 和 LXDE 是对 X2Go 服务器最友好的桌面环境。但是,用其它桌面管理器效果可能有所不同。例如,已知 GNOME 3 之后的版本、KDE 5、Unity 和 X2Go 并不兼容。如果你的远程主机的桌面管理器和 X2Go 兼容,你可以继续以下的教程。 ### 在 Linux 上安装 X2Go 服务器 ### @@ -74,21 +74,21 @@ Debian (Wheezy): CentOS/RHEL: -首先启用 EPEL 库,然后运行: +首先启用 [EPEL 库][7] ,然后运行: $ sudo yum install x2goclient ### 用 X2Go 客户端连接到远程桌面 ### -终于可以连接到远程桌面了。在本地主机上,只需运行以下命令或者使用桌面启动器启动 X2Go 客户端。 +现在可以连接到远程桌面了。在本地主机上,只需运行以下命令或者使用桌面启动器启动 X2Go 客户端。 $ x2goclient -输入远程主机的 IP 地址和 SSH 用户名称。同时,指定会话类型(例如,远程主机的桌面管理器)。 +输入远程主机的 IP 地址和 SSH 用户名称。同时,指定会话类型(例如,远程主机的桌面管理器)。 ![](https://farm9.staticflickr.com/8730/16365755693_75f3d544e9_b.jpg) -如果需要的话,你可以自定义其它东西(通过点击其它标签),例如连接速度、压缩、屏幕分辨率等等。 +如果需要的话,你可以自定义其它东西(通过点击其它的标签),例如连接速度、压缩、屏幕分辨率等等。 ![](https://farm9.staticflickr.com/8699/16984498482_665b975eca_b.jpg) @@ -112,7 +112,7 @@ CentOS/RHEL: ### 总结 ### -在这篇教程中,我介绍了如何在 [Linux VPS][8] 实例上设置 X2Go 远程桌面。正如你所看到的,整个设置过程都非常简单(如果你使用一个合适的桌面环境的话)。尽管对于特定桌面仍有问题,X2Go 是一个安全、功能丰富、快速并且免费的远程桌面解决方案。 +在这篇教程中,我介绍了如何在 [Linux VPS][8] 实例上设置 X2Go 远程桌面。正如你所看到的,整个设置过程都非常简单(如果你使用一个合适的桌面环境的话)。尽管对于特定桌面仍有问题,X2Go 是一个安全、功能丰富、快速并且免费的远程桌面解决方案。 X2Go 的什么功能最吸引你?欢迎分享你的观点。 @@ -122,7 +122,7 @@ via: http://xmodulo.com/x2go-remote-desktop-linux.html 作者:[Dan Nanni][a] 译者:[ictlyh](https://github.com/ictlyh) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 From 0999d7ba1ac5a1d905b9b2c1d905c06fa71ee13b Mon Sep 17 00:00:00 2001 From: wxy Date: Sat, 27 Jun 2015 22:21:33 +0800 Subject: [PATCH 480/965] PUB:20150603 Here's How to Install the Beautiful Arc GTK+ Flat Theme on Linux @geekpi --- ...he Beautiful Arc GTK+ Flat Theme on Linux.md | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) rename {translated/share => published}/20150603 Here's How to Install the Beautiful Arc GTK+ Flat Theme on Linux.md (92%) diff --git a/translated/share/20150603 Here's How to Install the Beautiful Arc GTK+ Flat Theme on Linux.md b/published/20150603 Here's How to Install the Beautiful Arc GTK+ Flat Theme on Linux.md similarity index 92% rename from translated/share/20150603 Here's How to Install the Beautiful Arc GTK+ Flat Theme on Linux.md rename to published/20150603 Here's How to Install the Beautiful Arc GTK+ Flat Theme on Linux.md index 93f7b004e1..edcc62b86f 100644 --- a/translated/share/20150603 Here's How to Install the Beautiful Arc GTK+ Flat Theme on Linux.md +++ b/published/20150603 Here's How to Install the Beautiful Arc GTK+ Flat Theme on Linux.md @@ -1,10 +1,15 @@ -如何在Linux中安装漂亮的扁平化Arc GTK+主题 +如何在 Linux 中安装漂亮的 GTK+ 扁平化主题 Arc ================================================================================ -> 易于理解的分步教程 **今天我们将向你介绍最新发布的GTK+主题,它拥有透明和扁平元素,并且与多个桌面环境和Linux发行版兼容。[这个主题叫Arc][1]。** -开始讲细节之前,我建议你快速浏览一下下面的图,这样你有会对这个主题就会有一个基本的概念了。同样你应该知道它目前可以工作在GTK+ 2.x、GTK+ 3.x、GNOME-Shell、 Budgie、 Unity和Pantheon用户界面,它们都使用了GNOME栈。 +开始讲细节之前,我建议你快速浏览一下下面的图,这样你有会对这个主题就会有一个基本的概念了。同样你应该知道它目前可以工作在GTK+ 2.x、GTK+ 3.x、GNOME-Shell、 Budgie、 Unity和Pantheon用户界面,它们都使用了GNOME 体系。 + +![](http://i1-news.softpedia-static.com/images/news2/Here-s-How-to-Install-the-Beautiful-Arc-GTK-plus-Flat-Theme-on-Linux-483143-2.jpg) + +![](http://i1-news.softpedia-static.com/images/news2/Here-s-How-to-Install-the-Beautiful-Arc-GTK-plus-Flat-Theme-on-Linux-483143-3.jpg) + +![](http://i1-news.softpedia-static.com/images/news2/Here-s-How-to-Install-the-Beautiful-Arc-GTK-plus-Flat-Theme-on-Linux-483143-4.jpg) 同样、Arc主题的开发者告诉我们它已经成功地在Ubuntu 15.04(Vivid Vervet)、 Arch Linux、 elementary OS 0.3 Freya、 Fedora 21、 Fedora 22、 Debian GNU/Linux 8.0 (Jessie)、 Debian Testing、 Debian Unstable、 openSUSE 13.2、 openSUSE Tumbleweed和Gentoo测试过了。 @@ -12,7 +17,7 @@ 要构建Arc主题,你需要先安装一些包,比如autoconf、 automake、 pkg-config (对于Fedora则是pkgconfig)、基于Debian/Ubuntu-based发行版的libgtk-3-dev或者基于RPM的gtk3-devel、 git、 gtk2-engines-pixbuf和gtk-engine-murrine (对于Fedora则是gtk-murrine-engine)。 -Arc主题还没有二进制包,因此你需要从git仓库中取下最新的源码并编译。这样,打开终端并运行下面的命令,一行行地,并在每行的末尾按下回车键并等待上一步完成来继续下一步。 +Arc主题还没有二进制包,因此你需要从git仓库中取下最新的源码并编译。这样,打开终端并运行下面的命令,一行行地输入,并在每行的末尾按下回车键并等待上一步完成来继续下一步。 git clone https://github.com/horst3180/arc-theme --depth 1 && cd arc-theme git fetch --tags @@ -22,11 +27,7 @@ Arc主题还没有二进制包,因此你需要从git仓库中取下最新的 就是这样!此时你已经在你的GNU/Linux发行版中安装了Arc主题,如果你使用GNOME可以使用GONME Tweak工具,如果你使用Ubuntu的Unity可以使用Unity Tweak工具来激活主题。玩得开心但不要忘了在下面的评论栏里留下你的截图。 -![](http://i1-news.softpedia-static.com/images/news2/Here-s-How-to-Install-the-Beautiful-Arc-GTK-plus-Flat-Theme-on-Linux-483143-2.jpg) -![](http://i1-news.softpedia-static.com/images/news2/Here-s-How-to-Install-the-Beautiful-Arc-GTK-plus-Flat-Theme-on-Linux-483143-3.jpg) - -![](http://i1-news.softpedia-static.com/images/news2/Here-s-How-to-Install-the-Beautiful-Arc-GTK-plus-Flat-Theme-on-Linux-483143-4.jpg) -------------------------------------------------------------------------------- From 976c3c53a0d6fd08772f38a250c6cdf342677e4b Mon Sep 17 00:00:00 2001 From: wxy Date: Sat, 27 Jun 2015 22:49:56 +0800 Subject: [PATCH 481/965] PUB:20150429 What are good command line HTTP clients @wi-cuckoo --- ...What are good command line HTTP clients.md | 111 ++++++++++++++++++ ...What are good command line HTTP clients.md | 110 ----------------- 2 files changed, 111 insertions(+), 110 deletions(-) create mode 100644 published/20150429 What are good command line HTTP clients.md delete mode 100644 translated/share/20150429 What are good command line HTTP clients.md diff --git a/published/20150429 What are good command line HTTP clients.md b/published/20150429 What are good command line HTTP clients.md new file mode 100644 index 0000000000..969b14da29 --- /dev/null +++ b/published/20150429 What are good command line HTTP clients.md @@ -0,0 +1,111 @@ +有哪些不错的命令行HTTP客户端? +============================================================================== + +“整体大于它的各部分之和”,这是引自希腊哲学家和科学家的亚里士多德的名言。这句话特别切中Linux。在我看来,Linux最强大的地方之一就是它的协作性。Linux的实用性并不仅仅源自大量的开源程序(命令行)。相反,其协作性来自于这些程序的综合利用,有时是结合成更大型的应用。 + +Unix哲学引发了一场“软件工具”的运动,关注开发简洁,基础,干净,模块化和扩展性好的代码,并可以运用于其他的项目。这种哲学成为了许多的Linux项目的一个重要的元素。 + +好的开源开发者写程序为了确保该程序尽可能运行得好,并且同时能与其他程序很好地协作。目标就是使用者拥有一堆方便的工具,每一个力求干好一件事。许多程序能独立工作得很好。 + +这篇文章讨论3个开源命令行HTTP客户端。这些客户端可以让你使用命令行从互联网上下载文件。但同时,他们也可以用于许多有意思的地方,如测试,调式和与HTTP服务器或web应用交互。对于HTTP架构师和API设计人员来说,使用命令行操作HTTP是一个值得花时间学习的技能。如果你需要经常使用API,HTTPie和cURL就非常有价值。 + +###HTTPie### + +![HTTPie in action](http://www.linuxlinks.com/portal/content/reviews/Internet/Screenshot-httpie.png) + +HTTPie(发音 aych-tee-tee-pie)是一款开源的命令行HTTP客户端。它是一个命令行界面,便于手工操作的类cURL工具。 + +该软件的目标是使得与Web服务器的交互尽可能的人性化。其提供了一个简单的http命令,允许使用简单且自然的语句发送任意的HTTP请求,并显示不同颜色的输出。HTTPie可以用于测试,调试,以及与HTTP服务器的常规交互。 + +#### 功能包括:#### + +- 生动而直观的语法格式 +- 经过格式化的彩色终端输出 +- 内建JSON支持 +- 支持表单和文件上传 +- 支持HTTPS,代理和认证 +- 任意数据请求 +- 自定义请求头 +- 持久会话 +- 类Wget的下载 +- 支持Python 2.6,2.7和3.x +- 支持Linux,Mac OS X 和 Windows +- 支持插件 +- 文档 +- 单元测试覆盖 + +--- + +- 网站:[httpie.org][1] +- 开发者: Jakub Roztočil +- 证书: 开源 +- 版本号: 0.9.2 + +###cURL### + +![cURL in action](http://www.linuxlinks.com/portal/content/reviews/Internet/Screenshot-cURL.png) + +cURL是一个开源的命令行工具,用于使用URL语句传输数据,支持DICT, FILE, FTP, FTPS, GOPHER, HTTP, HTTPS,IMAP, IMAPS, LDAP, LDAPS, POP3, POP3S, RTMP, RTSP, SCP, SFTP, SMTP, SMTPS, TELNET和TFTP等协议。 + +cURL支持SSL证书,HTTP POST,HTTP PUT,FTP上传,基于表单的HTTP上传,代理,缓存,用户名+密码的认证方式(Basic, Digest, NTLM, Negotiate, kerberos...),文件续传,代理通道和一些其他的有用功能。 + +#### 功能包括:#### + +- 支持配置文件 +- 一个单独命令行请求多个URL +- 支持匹配: [0-13],{one, two, three} +- 一个命令上传多个文件 +- 自定义最大传输速度 +- 重定向了标准错误输出 +- 支持Metalink + +--- + +- 网站: [curl.haxx.se][2] +- 开发者: Daniel Stenberg +- 证书: MIT/X derivate license +- 版本号: 7.42.0 + +###Wget### + +![Wget in action](http://www.linuxlinks.com/portal/content/reviews/Utilities/Screenshot-Wget.png) + +Wget是一个从网络服务器获取信息的开源软件。其名字源于World Wide Web 和 get。Wget支持HTTP,HTTPS和FTP协议,同时也可以通过HTTP代理获取信息。 + +Wget可以根据HTML页面的链接,创建远程网络站点的本地副本,完全重造源站点的目录结构。这种方式被称作“递归下载”。 + +Wget设计上增强了低速或者不稳定的网络连接。 + +功能包括: + +- 使用REST和RANGE恢复中断的下载 +- 使用文件名通配符,支持递归地对目录镜像 +- 基于NLS的消息文件支持多语言 +- 可选的转换下载文档里地绝对链接为相对链接,使得下载文档可以在本地相互链接 +- 可以在大多数类UNIX操作系统和微软Windows上运行 +- 支持HTTP代理 +- 支持HTTP cookie +- 支持HTTP持久连接 +- 无人照管/后台操作 +- 当对远程镜像时,使用本地文件时间戳来决定是否需要重新下载文档 + +--- + +- 站点: [www.gnu.org/software/wget/][3] +- 开发者: Hrvoje Niksic, Gordon Matzigkeit, Junio Hamano, Dan Harkless, and many others +- 证书: GNU GPL v3 +- 版本号: 1.16.3 + +-------------------------------------------------------------------------------- + +via: http://www.linuxlinks.com/article/20150425174537249/HTTPclients.html + +作者:Frazer Kline +译者:[wi-cuckoo](https://github.com/wi-cuckoo) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[1]:http://httpie.org/ +[2]:http://curl.haxx.se/ +[3]:https://www.gnu.org/software/wget/ diff --git a/translated/share/20150429 What are good command line HTTP clients.md b/translated/share/20150429 What are good command line HTTP clients.md deleted file mode 100644 index fa9ef01c54..0000000000 --- a/translated/share/20150429 What are good command line HTTP clients.md +++ /dev/null @@ -1,110 +0,0 @@ -什么是好的命令行HTTP客户端? -============================================================================== -整体大于各部分之和,这是引自希腊哲学家和科学家的亚里士多德的名言。这句话特别切中Linux。在我看来,Linux最强大的地方之一就是它的协作性。Linux的实用性并不仅仅源自大量的开源程序(命令行)。相反,其协作性来自于这些程序的综合利用,有时是结合更大型的应用。 - -Unix哲学引发了一场“软件工具”的运动,关注开发简洁,基础,干净,模块化和扩展性好的代码,并可以运用于其他的项目。这种哲学为许多的Linux项目留下了一个重要的元素。 - -好的开源开发者写程序为了确保该程序尽可能运行正确,同时能与其他程序很好地协作。目标就是使用者拥有一堆方便的工具,每一个力求干不止一件事。许多程序能独立工作得很好。 - -这篇文章讨论3个开源命令行HTTP客户端。这些客户端可以让你使用命令行从互联网上下载文件。但同时,他们也可以用于许多有意思的地方,如测试,调式和与HTTP服务器或网络应用互动。对于HTTP架构师和API设计人员来说,使用命令行操作HTTP是一个值得花时间学习的技能。如果你需要来回使用API,HTTPie和cURL,这没什么价值。 - -------------- - -![HTTPie](http://www.linuxlinks.com/portal/content2/png/HTTPie.png) - -![HTTPie in action](http://www.linuxlinks.com/portal/content/reviews/Internet/Screenshot-httpie.png) - -HTTPie(发音 aych-tee-tee-pie)是一款开源命令行HTTP客户端。它是一个命令行界面,类cURL的工具。 - -该软件的目标是使得与网络服务器的交互尽可能的人性化。其提供了一个简单的http命令,允许使用简单且自然的语句发送任意的HTTP请求,并显示不同颜色的输出。HTTPie可以用于测试,调式和与HTTP服务器的一般交互。 - -#### 功能包括:#### - -- 可表达,直观的语句 -- 格式化,颜色区分的终端输出 -- 内建JSON支持 -- 表单和文件上传 -- HTTPS,代理和认证 -- 任意数据请求 -- 自定义标题 (此处header不确定是否特别意义) -- 持久会话 -- 类Wget下载 -- Python 2.6,2.7和3.x支持 -- Linux,Mac OS X 和 Windows支持 -- 支持插件 -- 帮助文档 -- 测试覆盖 (直译有点别扭) - -- 网站:[httpie.org][1] -- 开发者: Jakub Roztočil -- 证书: 开源 -- 版本号: 0.9.2 - ----------- - -![cURL](http://www.linuxlinks.com/portal/content2/png/cURL1.png) - -![cURL in action](http://www.linuxlinks.com/portal/content/reviews/Internet/Screenshot-cURL.png) - -cURL是一个开源命令行工具,用于使用URL语句传输数据,支持DICT, FILE, FTP, FTPS, GOPHER, HTTP, HTTPS,IMAP, IMAPS, LDAP, LDAPS, POP3, POP3S, RTMP, RTSP, SCP, SFTP, SMTP, SMTPS, TELNET和TFTP。 - -cURL支持SSL证书,HTTP POST,HTTP PUT,FTP上传,HTTP基于表单上传,代理,缓存,用户名+密码认证(Basic, Digest, NTLM, Negotiate, kerberos...),文件传输恢复, 代理通道和一些其他实用窍门的总线负载。(这里的名词我不明白其专业意思) - -#### 功能包括:#### - -- 配置文件支持 -- 一个单独命令行多个URL -- “globbing”漫游支持: [0-13],{one, two, three} -- 一个命令上传多个文件 -- 自定义最大传输速度 -- 重定向标准错误输出 -- Metalink支持 - -- 网站: [curl.haxx.se][2] -- 开发者: Daniel Stenberg -- 证书: MIT/X derivate license -- 版本号: 7.42.0 - ----------- - -![Wget](http://www.linuxlinks.com/portal/content2/png/Wget1.png) - -![Wget in action](http://www.linuxlinks.com/portal/content/reviews/Utilities/Screenshot-Wget.png) - -Wget是一个从网络服务器获取信息的开源软件。其名字源于World Wide Web 和 get。Wget支持HTTP,HTTPS和FTP协议,同时也通过HTTP代理获取信息。 - -Wget可以根据HTML页面的链接,创建远程网络站点的本地版本,是完全重造源站点的目录结构。这种方式被冠名“recursive downloading。” - -Wget已经设计可以加快低速或者不稳定的网络连接。 - -功能包括: - -- 使用REST和RANGE恢复中断的下载 -- 使用文件名 -- 多语言的基于NLS的消息文件 -- 选择性地转换下载文档里地绝对链接为相对链接,使得下载文档可以本地相互链接 -- 在大多数类UNIX操作系统和微软Windows上运行 -- 支持HTTP代理 -- 支持HTTP数据缓存 -- 支持持续地HTTP连接 -- 无人照管/后台操作 -- 当远程对比时,使用本地文件时间戳来决定是否需要重新下载文档 (mirroring没想出合适的表达) - -- 站点: [www.gnu.org/software/wget/][3] -- 开发者: Hrvoje Niksic, Gordon Matzigkeit, Junio Hamano, Dan Harkless, and many others -- 证书: GNU GPL v3 -- 版本号: 1.16.3 - --------------------------------------------------------------------------------- - -via: http://www.linuxlinks.com/article/20150425174537249/HTTPclients.html - -作者:Frazer Kline -译者:[wi-cuckoo](https://github.com/wi-cuckoo) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[1]:http://httpie.org/ -[2]:http://curl.haxx.se/ -[3]:https://www.gnu.org/software/wget/ From 091b1022c14b9903b1ca8fb2445222f981f6651f Mon Sep 17 00:00:00 2001 From: Chang Liu Date: Sun, 28 Jun 2015 06:11:31 +0800 Subject: [PATCH 482/965] [Translated] 20150616 LINUX 101 -- POWER UP YOUR SHELL.md --- ...20150616 LINUX 101--POWER UP YOUR SHELL.md | 179 ------------------ ...20150616 LINUX 101--POWER UP YOUR SHELL.md | 177 +++++++++++++++++ 2 files changed, 177 insertions(+), 179 deletions(-) delete mode 100644 sources/tech/20150616 LINUX 101--POWER UP YOUR SHELL.md create mode 100644 translated/tech/20150616 LINUX 101--POWER UP YOUR SHELL.md diff --git a/sources/tech/20150616 LINUX 101--POWER UP YOUR SHELL.md b/sources/tech/20150616 LINUX 101--POWER UP YOUR SHELL.md deleted file mode 100644 index 94102a58a6..0000000000 --- a/sources/tech/20150616 LINUX 101--POWER UP YOUR SHELL.md +++ /dev/null @@ -1,179 +0,0 @@ -FSSlc translating - -LINUX 101: POWER UP YOUR SHELL -================================================================================ -> Get a more versatile,featureful and colourful command line interface with our guide to shell basics. - -**WHY DO THIS?** - -- Make life at the shell prompt easier and faster. -- Resume sessions after losing a connection. -- Stop pushing around that fiddly rodent! - -![bash1](http://www.linuxvoice.com/wp-content/uploads/2015/02/bash1-large15.png) - -Here’s our souped-up prompt on steroids. It’s a bit long for this small terminal window, but you can tweak it to your liking. - -As a Linux user, you’re probably familiar with the shell (aka command line). You may pop up the occasional terminal now and then for some essential jobs that you can’t do at the GUI, or perhaps you live in a tiling window manager environment and the shell is your main way of interacting with your Linux box. - -In either case, you’re probably using the stock Bash configuration that came with your distro – and while it’s powerful enough for most jobs, it could still be a lot better. In this tutorial we’ll show you how to pimp up your shell to make it more informative, useful and pleasant to work in. We’ll customise the prompt to make it provide better feedback than the defaults, and we’ll show you how to manage sessions and run multiple programs together with the incredibly cool tmux tool. And for a bit of eye candy, we’ll look at colour schemes as well. So, onwards! - -### Make your prompt sing ### - -Most distributions ship with very plain prompts – they show a bit of information, and generally get you by, but the prompt can do so much more. Take the default prompt on a Debian 7 installation, for instance: - - mike@somebox:~$ - -This shows the user, hostname, current directory and account type symbol (if you switch to root, the **$** changes to #). But where is this information stored? The answer is in the **PS1** environment variable. If you enter **echo $PS1** you’ll see this at the end of the text string that appears: - - u@h:w$ - -This looks a bit ugly, and at first glance you might start screaming, assuming it to be a dreaded regular expression, but we’re not going to fry our brains with the complexity of those. No, the slashes here are escape sequences, telling the prompt to do special things. The **u** part, for instance, tells the prompt to show the username, while w means the working directory. - -Here’s a list of things you can use in the prompt: - -- d The current date. -- h The hostname. -- n A newline character. -- A The current time (HH:MM). -- u The current user. -- w (lowercase) The whole working directory. -- W (uppercase) The basename of the working directory. -- $ A prompt symbol that changes to # for root. -- ! The shell history number of this command. - -To clarify the difference in the **w** and **W** options: with the former, you’ll see the whole path for the directory in which you’re working (eg **/usr/local/bin**), whereas for the latter it will just show the **bin** part. - -Now, how do you go about changing the prompt? You need to modify the contents of the **PS1** environment variable. Try this: - - export PS1=”I am u and it is A $” - -Now your prompt will look something like: - - I am mike and it is 11:26 $ - -From here you can experiment with the other escape sequences shown above to create the prompt of your dreams. But wait a second – when you log out, all of your hard work will be lost, because the value of the **PS1** environment variable is reset each time you start a terminal. The simplest way to fix this is to open the **.bashrc** configuration file (in your home directory) and add the complete export command to the bottom. This **.bashrc** file will be read by Bash every time you start a new shell session, so your beefed-up prompt will always appear. You can also spruce up your prompt with extra colour. This is a bit tricky at first, as you have to use some rather odd-looking escape sequences, but the results can be great. Add this to a point in your **PS1** string and it will change the text to red: - - [e[31m] - -You can change 31 here to other numbers for different colours: - -- 30 Black -- 32 Green -- 33 Yellow -- 34 Blue -- 35 Magenta -- 36 Cyan -- 37 White - -So, let’s finish off this section by creating the mother of all prompts, using the escape sequences and colours we’ve already looked at. Take a deep breath, flex your fingers, and then type this beast: - - export PS1=”(!) [e[31m][A] [e[32m]u@h [e[34m]w [e[30m]$ “ - -This provides a Bash command history number, current time, and colours for the user/hostname combination and working directory. If you’re feeling especially ambitious, you can change the background colours as well as the foreground ones, for really striking combinations. The ever useful Arch wiki has a full list of colour codes: [http://tinyurl.com/3gvz4ec][1]. - -> ### Shell essentials ### -> -> If you’re totally new to Linux and have just picked up this magazine for the first time, you might find the tutorial a bit heavy going. So here are the basics to get you familiar with the shell. It’s usually found as Terminal, XTerm or Konsole in your menus, and when you start it the most useful commands are: -> -> **ls** (list files); **cp one.txt two.txt** (copy file); **rm file.txt** (remove file); **mv old.txt new.txt** (move or rename); -> -> **cd /some/directory** (change directory); **cd ..** (change to directory above); **./program** (run program in current directory); **ls > list.txt** (redirect output to a file). -> -> Almost every command has a manual page explaining options (eg **man ls** – press Q to quit the viewer). There you can learn about command options, so you can see that **ls -la** shows a detailed list including hidden files. Use the up and down cursor keys to cycle through previous commands, and use Tab after entering part of a file or directory name to auto-complete it. - -### Tmux: A window manager for your shell ### - -A window manager inside a text mode environment – it sounds crazy, right? Well, do you remember when web browsers first implemented tabbed browsing? It was a major step forward in usability at the time, and reduced clutter in desktop taskbars and window lists enormously. Instead of having taskbar or pager icons for every single site you had open, you just had the one button for your browser, and then the ability to switch sites inside the browser itself. It made an awful lot of sense. - -If you end up running several terminals at the same time, a similar situation occurs; you might find it annoying to keep jumping between them, and finding the right one in your taskbar or window list each time. With a text-mode window manager you can not only run multiple shell sessions simultaneously inside the same terminal window, but you can even arrange them side-by-side. - -And there’s another benefit too: detaching and reattaching. The best way to see how this works is to try it yourself. In a terminal window, enter **screen** (it’s installed by default on most distros, or will be available in your package repositories). Some welcome text appears – just hit Enter to dismiss it. Now run an interactive text mode program, such as **nano**, and close the terminal window. - -In a normal shell session, the act of closing the window would terminate every process running inside it – so your Nano editing session would be a goner. But not with screen. Open a new terminal and enter: - - screen -r - -And voilà: the Nano session you started before is back! - -When you originally ran **screen**, it created a new shell session that was independent and not tied to a specific terminal window, so it could be detached and reattached (hence the **-r** option) later. - -This is especially useful if you’re using SSH to connect to another machine, doing some work, and don’t want a flaky connection to ruin all your progress. If you do your work inside a **screen** session and your connection goes down (or your laptop battery dies, or your computer explodes), you can simply reconnect/recharge/buy a new computer, then SSH back in to the remote box, run **screen -r** to reattach and carry on from where you left off. - -Now, we’ve been talking about GNU **screen** here, but the title of this section mentions tmux. Essentially, **tmux** (terminal multiplexer) is like a beefed up version of **screen** with lots of useful extra features, so we’re going to focus on it here. Some distros include **tmux** by default; in others it’s usually just an **apt-get, yum install** or **pacman -S** command away. - -Once you have it installed, enter **tmux** to start it. You’ll notice right away that there’s a green line of information along the bottom. This is very much like a taskbar from a traditional window manager: there’s a list of running programs, the hostname of the machine, a clock and the date. Now run a program, eg Nano again, and hit Ctrl+B followed by C. This creates a new window inside the tmux session, and you can see this in the taskbar at the bottom: - - 0:nano- 1:bash* - -Each window has a number, and the currently displayed program is marked with an asterisk symbol. Ctrl+B is the standard way of interacting with tmux, so if you hit that key combo followed by a window number, you’ll switch to that window. You can also use Ctrl+B followed by N and P to switch to the next and previous windows respectively – or use Ctrl+B followed by L to switch between the two most recently used windows (a bit like the classic Alt+Tab behaviour on the desktop). To get a window list, use Ctrl+B followed by W. - -So far, so good: you can now have multiple programs running inside a single terminal window, reducing clutter (especially if you often have multiple SSH logins active on the same remote machine). But what about seeing two programs at the same time? - -For this, tmux uses “panes”. Hit Ctrl+B followed by % and the current window will be split into two sections, one on the left and one on the right. You can switch between them Using Ctrl+B followed by O. This is especially useful if you want to see two things at the same time – eg a manual page in one pane, and an editor with a configuration file in another. - -Sometimes you’ll want to resize the individual panes, and this is a bit trickier. First you have to hit Ctrl+B followed by : (colon), which turns the tmux bar along the bottom into a dark orange colour. You’re now in command mode, where you can type in commands to operate tmux. Enter **resize-pane -R** to resize the current pane one character to the right, or use **-L** to resize in a leftward direction. These may seem like long commands for a relatively simple operation, but note that the tmux command mode (started with the aforementioned colon) has tab completion. So you don’t have to type the whole command – just enter “**resi**” and hit Tab to complete. Also note that the **tmux** command mode also has a history, so if you want to repeat the resize operation, hit Ctrl+B followed by colon and then use the up cursor key to retrieve the command that you entered previously. - -Finally, let’s look at detaching and reattaching – the awesome feature of screen we demonstrated earlier. Inside tmux, hit Ctrl+B followed by D to detach the current tmux session from the terminal window, which leaves everything running in the background. To reattach to the session use **tmux a**. But what happens if you have multiple tmux sessions running? Use this command to list them: - - tmux ls - -This shows a number for each session; if you want to reattach to session 1, use tmux a -t 1. tmux is hugely configurable, with the ability to add custom keybindings and change colour schemes, so once you’re comfortable with the main features, delve into the manual page to learn more. - -tmux: a window manager for your shell - -![tmux](http://www.linuxvoice.com/wp-content/uploads/2015/02/tmux-large13.jpg) - -Here’s tmux with two panes open: the left has Vim editing a configuration file, while the right shows a manual page - -> ### Zsh: an alternative shell ### -> -> Choice is good, but standardisation is also important as well. So it makes sense that almost every mainstream Linux distribution uses the Bash shell by default – although there are others. Bash provides pretty much everything you need from a shell, including command history, filename completion and lots of scripting ability. It’s mature, reliable and well documented – but it’s not the only shell in town. -> -> Many advanced users swear by Zsh, the Z Shell. This is a replacement for Bash that offers almost all of the same functionality, with some extra features on top. For instance, in Zsh you can enter **ls** - and hit Tab to get quick descriptions of the various options available for **ls**. No need to open the manual page! -> -> Zsh sports other great auto-completion features: type **cd /u/lo/bi** and hit Tab, for instance, and the full path of **/usr/local/bin** will appear (providing there aren’t other paths containing **u**, **lo** and **bi**). Or try **cd** on its own followed by Tab, and you’ll see nicely coloured directory listings – much better than the plain ones used by Bash. -> -> Zsh is available in the package repositories of all major distros; install it and enter **zsh** to start it. To change your default shell from Bash to Zsh, use the **chsh** command. And for more information visit [www.zsh.org][2]. - -### The terminals of the Future ### - -You might be wondering why the application that contains your command prompt is called a terminal. Back in the early days of Unix, people tended to work on multi-user machines, with a giant mainframe computer occupying a room somewhere in a building, and people connected to it using screen and keyboard combinations at the end of some wires. These terminal machines were often called “dumb”, because they didn’t do any important processing themselves – they just displayed whatever was sent down the wire from the mainframe, and sent keyboard presses back to it. - -Today, almost all of us do the actual processing on our own machines, so our computers are not terminals in a traditional sense. This is why programs like **XTerm**, Gnome Terminal, Konsole etc. are called “terminal emulators” – they provide the same facilities as the physical terminals of yesteryear. And indeed, in many respects they haven’t moved on much. Sure, we have anti-aliased fonts now, better colours and the ability to click on URLs, but by and large they’ve been working in the same way for decades. - -Some programmers are trying to change this though. **Terminology** ([http://tinyurl.com/osopjv9][3]), from the team behind the ultra-snazzy Enlightenment window manager, aims to bring terminals into the 21st century with features such as inline media display. You can enter **ls** in a directory full of images and see thumbnails, or even play videos from directly inside your terminal. This makes the terminal work a bit more like a file manager, and means that you can quickly check the contents of media files without having to open them in a separate application. - -Then there’s Xiki ([www.xiki.org][4]), which describes itself as “the command revolution”. It’s like a cross between a traditional shell, a GUI and a wiki; you can type commands anywhere, store their output as notes for reference later, and create very powerful custom commands. It’s hard to describe it in mere words, so the authors have made a video (see the Screencasts section of the **Xiki** site) which shows how much potential it has. - -And Xiki is definitely not a flash in the pan project that will die of bitrot in a few months. The authors ran a successful Kickstarter campaign to fund its development, netting over $84,000 at the end of July. Yes, you read that correctly – $84K for a terminal emulator. It might be the most unusual crowdfunding campaign since some crazy guys decided to start their own Linux magazine… - -### Next-gen terminals ### - -Many command line and text-based programs match their GUI equivalents for feature parity, and are often much faster and more efficient to use. Our recommendations: **Irssi** (IRC client); **Mutt** (mail client); **rTorrent** (BitTorrent); **Ranger** (file manager); **htop** (process monitor). ELinks does a decent job for web browsing, given the limitations of the terminal, and it’s useful for reading text-heavy websites such as Wikipedia. - -> ### Fine-tune your colour scheme ### -> -> We’re not obsessed with eye-candy at Linux Voice, but we do recognise the importance of aesthetics when you’re staring at something for several hours every day. Many of us love to tweak our desktops and window managers to perfection, crafting pixel-perfect drop shadows and fiddling with colour schemes until we’re 100% happy. (And then fiddling some more out of habit.) -> -> But then we tend to ignore the terminal window. Well, that deserves some love too, and at [http://ciembor.github.io/4bit][5] you’ll find a highly awesome colour scheme designer that can export settings for all of the popular terminal emulators (**XTerm, Gnome Terminal, Konsole and Xfce4 Terminal are among the apps supported.**) Move the sliders until you attain colour scheme nirvana, then click on the Get Scheme button at the top-right of the page. -> -> Similarly, if you spend a lot of time in a text editor such as Vim or Emacs, it’s worth using a well-crafted palette there as well. **Solarized at** [http://ethanschoonover.com/solarized][6] is an excellent scheme that’s not just pretty, but designed for maximum usability, with plenty of research and testing behind it. - --------------------------------------------------------------------------------- - -via: http://www.linuxvoice.com/linux-101-power-up-your-shell-8/ - -作者:[Ben Everard][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.linuxvoice.com/author/ben_everard/ -[1]:http://tinyurl.com/3gvz4ec -[2]:http://www.zsh.org/ -[3]:http://tinyurl.com/osopjv9 -[4]:http://www.xiki.org/ -[5]:http://ciembor.github.io/4bit -[6]:http://ethanschoonover.com/solarized diff --git a/translated/tech/20150616 LINUX 101--POWER UP YOUR SHELL.md b/translated/tech/20150616 LINUX 101--POWER UP YOUR SHELL.md new file mode 100644 index 0000000000..fac7fa2e1b --- /dev/null +++ b/translated/tech/20150616 LINUX 101--POWER UP YOUR SHELL.md @@ -0,0 +1,177 @@ +LINUX 101: 让你的 SHELL 更强大 +================================================================================ +> 在我们的有关 shell 基础的指导下, 得到一个更灵活,功能更强大且多彩的命令行界面 + +**为何要这样做?** + +- 使得在 shell 提示符下过得更轻松,高效 +- 在失去连接后恢复先前的会话 +- Stop pushing around that fiddly rodent! (注: 我不知道这句该如何翻译) + +![bash1](http://www.linuxvoice.com/wp-content/uploads/2015/02/bash1-large15.png) + +Here’s our souped-up prompt on steroids.(注: 我不知道该如何翻译这句)对于这个细小的终端窗口来说,这或许有些长.但你可以根据你的喜好来调整它的大小. + +作为一个 Linux 用户, 对 shell (又名为命令行),你可能会熟悉. 或许你需要时不时的打开终端来完成那些不能在 GUI 下处理的必要任务,抑或是因为你处在一个平铺窗口管理器的环境中, 而 shell 是你与你的 linux 机器交互的主要方式. + +在上面的任一情况下,你可能正在使用你所使用的发行版本自带的 Bash 配置. 尽管对于大多数的任务而言,它足够强大,但它可以更加强大. 在本教程中,我们将向你展示如何使得你的 shell 更具信息性,更加实用且更适于在其中工作. 我们将对提示符进行自定义,让它比默认情况下提供更好的反馈,并向你展示如何使用炫酷的 `tmux` 工具来管理会话并同时运行多个程序. 并且,为了让眼睛舒服一点,我们还将关注配色方案. 接着,就让我们向前吧! + +### 让提示符 "唱歌" ### + +大多数的发行版本配置有一个非常简单的提示符 – 它们大多向你展示了一些基本信息, 但提示符可以为你提供更多的内容.例如,在 Debian 7 下,默认的提示符是这样的: + + mike@somebox:~$ + +上面的提示符展示出了用户,主机名,当前目录和账户类型符号(假如你切换到 root 账户, **$** 会变为 # ). 那这些信息是在哪里存储的呢? 答案是:在 **PS1** 环境变量中. 假如你键入 **echo $PS1**, 你将会在这个命令的输出字符串的最后有如下的字符: + + \u@\h:\w$ (注:这里没有加上斜杠 \,应该是没有转义 ,下面的有些命令也一样,我把 \ 都加上了,发表的时候也得注意一下) + +这看起来有一些丑陋,并在瞥见它的第一眼时,你可能会开始尖叫,认为它是令人恐惧的正则表达式,但我们不打算用这些复杂的字符来煎熬我们的大脑. 这不是正则表达式, 这里的斜杠是转义序列,它告诉提示符进行一些特别的处理. 例如,上面的 **u** 部分,告诉提示符展示用户名, 而 w 则展示工作路径. + +下面是一些你可以在提示符中用到的字符的列表: + +- d 当前的日期. +- h 主机名. +- n 代表新的一行的字符. +- A 当前的时间 (HH:MM). +- u 当前的用户. +- w (小写) 整个工作路径的全称. +- W (大写) 工作路径的简短名称. +- $ 一个提示符号,对于 root 用户为 # 号. +- ! 当前命令在 shell 历史记录中的序号. + +下面解释 **w** 和 **W** 选项的区别: 对于前者,你将看到你所在的工作路径的完整地址,(例如 **/usr/local/bin**), 而对于后者, 它则只显示 **bin** 这一部分. + +现在, 我们该怎样改变提示符呢? 你需要更改 **PS1** 环境变量的内容, 试试下面这个: + + export PS1=”I am \u and it is \A $” + +现在, 你的提示符将会像下面这样: + + I am mike and it is 11:26 $ + +从这个例子出发, 你就可以按照你的想法来试验一下上面列出的其他转义序列. 但稍等片刻 – 当你登出后,你的这些努力都将消失,因为在你每次打开终端时, **PS1** 环境变量的值都会被重置. 解决这个问题的最简单方式是打开 **.bashrc** 配置文件(在你的家目录下) 并在这个文件的最下方添加上完整的 `export` 命令.在每次你启动一个新的 shell 会话时,这个 **.bashrc** 会被 `Bash` 读取, 所以你的被加强了的提示符就可以一直出现.你还可以使用额外的颜色来装扮提示符.刚开始,这将有点棘手,因为你必须使用一些相当奇怪的转义序列,但结果是非常漂亮的. 将下面的字符添加到你的 **PS1**字符串中的某个位置,最终这将把文本变为红色: + + \[\e[31m\] + +你可以将这里的 31 更改为其他的数字来获得不同的颜色: + +- 30 黑色 +- 32 绿色 +- 33 黄色 +- 34 蓝色 +- 35 洋红色 +- 36 青色 +- 37 白色 + +所以,让我们使用先前看到的转义序列和颜色来创造一个提示符,以此来结束这一小节的内容. 深吸一口气,弯曲你的手指,然后键入下面这只"野兽": + + export PS1="(\!) \[\e[31m\] \[\A\] \[\e[32m\]\u@\h \[\e[34m\]\w \[\e[30m\]$" + +上面的命令提供了一个 Bash 命令历史序号, 当前的时间,用户或主机名与颜色之间的组合,以及工作路径.假如你"野心勃勃",利用一些惊人的组合,你还可以更改提示符的背景色和前景色.先前实用的 Arch wiki 有一个关于颜色代码的完整列表:[http://tinyurl.com/3gvz4ec][1]. + +> ### Shell 精要 ### +> +> 假如你是一个彻底的 Linux 新手并第一次阅读这份杂志,或许你会发觉阅读这些教程有些吃力. 所以这里有一些基础知识来让你熟悉一些 shell. 通常在你的菜单中, shell 指的是 Terminal, XTerm 或 Konsole, 但你启动它后, 最为实用的命令有这些: +> +> **ls** (列出文件名); **cp one.txt two.txt** (复制文件); **rm file.txt** (移除文件); **mv old.txt new.txt** (移动或重命名文件); +> +> **cd /some/directory** (改变目录); **cd ..** (回到上级目录); **./program** (在当前目录下运行一个程序); **ls > list.txt** (重定向输出到一个文件). +> +> 几乎每个命令都有一个手册页用来解释其选项(例如 **man ls** – 按 Q 来退出).在那里,你可以知晓命令的选项,这样你就知道 **ls -la** 展示一个详细的列表,其中也列出了隐藏文件, 并且在键入一个文件或目录的名字的一部分后, 可以使用 Tab 键来自动补全. + +### Tmux: 针对 shell 的窗口管理器 ### + +在文本模式的环境中使用一个窗口管理器 – 这听起来有点不可思议, 是吧? 然而,你应该记得当 Web 浏览器第一次实现分页浏览的时候吧? 在当时, 这是在可用性上的一个重大进步,它减少了桌面任务栏的杂乱无章和繁多的窗口列表. 对于你的浏览器来说,你只需要一个按钮便可以在浏览器中切换到你打开的每个单独网站, 而不是针对每个网站都有一个任务栏或导航图标. 这个功能非常有意义. + +若有时你同时运行着几个虚拟终端,你便会遇到相似的情况; 在这些终端之间跳转,或每次在任务栏或窗口列表中找到你所需要的那一个终端,都可能会让你觉得麻烦. 拥有一个文本模式的窗口管理器不仅可以让你像在同一个终端窗口中运行多个 shell 会话,而且你甚至还可以将这些窗口排列在一起. + +另外,这样还有另一个好处:可以将这些窗口进行分离和重新连接.想要看看这是如何运行的最好方式是自己尝试一下. 在一个终端窗口中,输入 **screen** (在大多数发行版本中,它被默认安装了或者可以在软件包仓库中找到). 某些欢迎的文字将会出现 – 只需敲击 Enter 键这些文字就会消失. 现在运行一个交互式的文本模式的程序,例如 **nano**, 并关闭这个终端窗口. + +在一个正常的 shell 对话中, 关闭窗口将会终止所有在该终端中运行的进程 – 所以刚才的 Nano 编辑对话也就被终止了, 但对于 screen 来说,并不是这样的. 打开一个新的终端并输入如下命令: + + screen -r + +瞧, 你刚开打开的 Nano 会话又回来了! + +当刚才你运行 **screen** 时, 它会创建了一个新的独立的 shell 会话, 它不与某个特定的终端窗口绑定在一起,所以可以在后面被分离并重新连接( 即 **-r** 选项). + +当你正使用 SSH 去连接另一台机器并做着某些工作, 但并不想因为一个单独的连接而毁掉你的所有进程时,这个方法尤其有用.假如你在一个 **screen** 会话中做着某些工作,并且你的连接突然中断了(或者你的笔记本没电了,又或者你的电脑报废了),你只需重新连接一个新的电脑或给电脑充电或重新买一台电脑,接着运行 **screen -r** 来重新连接到远程的电脑,并在刚才掉线的地方接着开始. + +现在,我们都一直在讨论 GNU 的 **screen**,但这个小节的标题提到的是 tmux. 实质上, **tmux** (terminal multiplexer) 就像是 **screen** 的一个进阶版本,带有许多有用的额外功能,所以现在我们开始关注 tmux. 某些发行版本默认包含了 **tmux**; 在其他的发行版本上,通常只需要一个 **apt-get, yum install** 或 **pacman -S** 命令便可以安装它. + +一旦你安装了它过后,键入 **tmux** 来启动它.接着你将注意到,在终端窗口的底部有一条绿色的信息栏,它非常像传统的窗口管理器中的任务栏: 上面显示着一个运行着的程序的列表,机器的主机名,当前时间和日期. 现在运行一个程序,又以 Nano 为例, 敲击 Ctrl+B 后接着按 C 键, 这将在 tmux 会话中创建一个新的窗口,你便可以在终端的底部的任务栏中看到如下的信息: + + 0:nano- 1:bash* + +每一个窗口都有一个数字,当前呈现的程序被一个星号所标记. Ctrl+B 是与 tmux 交互的标准方式, 所以若你敲击这个按键组合并带上一个窗口序号, 那么就会切换到对应的那个窗口.你也可以使用 Ctrl+B 再加上 N 或 P 来分别切换到下一个或上一个窗口 – 或者使用 Ctrl+B 加上 L 来在最近使用的两个窗口之间来进行切换(有点类似于桌面中的经典的 Alt+Tab 组合键的效果). 若需要知道窗口列表,使用 Ctrl+B 再加上 W. + +目前为止,一切都还好:现在你可以在一个单独的终端窗口中运行多个程序,避免混乱(尤其是当你经常与同一个远程主机保持多个 SSH 连接时.). 当想同时看两个程序又该怎么办呢? + +针对这种情况, 可以使用 tmux 中的窗格. 敲击 Ctrl+B 再加上 % , 则当前窗口将分为两个部分,一个在左一个在右.你可以使用 Ctrl+B 再加上 O 来在这两个部分之间切换. 这尤其在你想同时看两个东西时非常实用, – 例如一个窗格看指导手册,另一个窗格里用编辑器看一个配置文件. + +有时,你想对一个单独的窗格进行缩放,而这需要一定的技巧. 首先你需要敲击 Ctrl+B 再加上一个 :(分号),这将使得位于底部的 tmux 栏变为深橙色. 现在,你进入了命令模式,在这里你可以输入命令来操作 tmux. 输入 **resize-pane -R** 来使当前窗格向右移动一个字符的间距, 或使用 **-L** 来向左移动. 对于一个简单的操作,这些命令似乎有些长,但请注意,在 tmux 的命令模式(以前面提到的一个分号开始的模式)下,可以使用 Tab 键来补全命令. 另外需要提及的是, **tmux** 同样也有一个命令历史记录,所以若你想重复刚才的缩放操作,可以先敲击 Ctrl+B 再跟上一个分号并使用向上的箭头来取回刚才输入的命令. + +最后,让我们看一下分离和重新连接 - 即我们刚才介绍的 screen 的特色功能. 在 tmux 中,敲击 Ctrl+B 再加上 D 来从当前的终端窗口中分离当前的 tmux 会话, 这使得这个会话的一切工作都在后台中运行.使用 **tmux a** 可以再重新连接到刚才的会话. 但若你同时有多个 tmux 会话在运行时,又该怎么办呢? 我们可以使用下面的命令来列出它们: + + tmux ls + +这个命令将为每个会话分配一个序号; 假如你想重新连接到会话 1, 可以使用 `tmux a -t 1`. tmux 是可以高度定制的,你可以自定义按键绑定并更改配色方案, 所以一旦你适应了它的主要功能,请钻研指导手册以了解更多的内容. + +tmux: 一个针对 shell 的窗口管理器 + +![tmux](http://www.linuxvoice.com/wp-content/uploads/2015/02/tmux-large13.jpg) + +上图中, tmux 开启了两个窗格: 左边是 Vim 正在编辑一个配置文件,而右边则展示着指导手册页. + +> ### Zsh: 另一个 shell ### +> +> 选择是好的,但标准同样重要. 你要知道几乎每个主流的 Linux 发行版本都默认使用 Bash shell – 尽管还存在其他的 shell. Bash 为你提供了一个 shell 能够给你提供的几乎任何功能,包括命令历史记录,文件名补全和许多脚本编程的能力.它成熟,可靠并文档丰富 – 但它不是你唯一的选择. +> +> 许多高级用户热衷于 Zsh, 即 Z shell. 这是 Bash 的一个替代品并提供了 Bash 的几乎所有功能,令外还提供了一些额外的功能. 例如, 在 Zsh 中,你输入 **ls** - 并敲击 Tab 键可以得到 **ls** 可用的各种不同选项的一个大致描述. 而不需要再打开 man page 了! +> +> Zsh 还支持其他强大的自动补全功能: 例如,输入 **cd /u/lo/bi** 再敲击 Tab 键, 则完整的路径名 **/usr/local/bin** 就会出现(这里假设没有其他的路径包含 **u**, **lo** 和 **bi** 等字符.). 或者只输入 **cd** 再跟上 Tab 键,则你将看到着色后的路径名的列表 – 这比 Bash 给出的简单的结果好看得多. +> +> Zsh 在大多数的主要发行版本上都可以得到; 安装它后并输入 **zsh** 便可启动它. 要将你的默认 shell 从 Bash 改为 Zsh, 可以使用 **chsh** 命令. 若需了解更多的信息,请访问 [www.zsh.org][2]. + +### "未来" 的终端 ### + +你或许会好奇为什么包含你的命令行提示符的应用被叫做终端. 这需要追溯到 Unix 的早期, 那时人们一般工作在一个多用户的机器上,这个巨大的电脑主机将占据一座建筑中的一个房间, 人们在某些线路的配合下,使用屏幕和键盘来连接到这个主机, 这些终端机通常被称为 "哑终端", 因为它们不能靠自己做任何重要的执行任务 – 它们只展示通过线路从主机传来的信息,并输送回从键盘的敲击中得到的输入信息. + +今天,几乎所有的我们在自己的机器上执行实际的操作,所以我们的电脑不是传统意义下的终端, 这就是为什么诸如 **XTerm**, Gnome Terminal, Konsole 等程序被称为 "终端模拟器" 的原因 – 他们提供了同昔日的物理终端一样的功能.事实上,在许多方面它们并没有改变多少.诚然,现在我们有了反锯齿字体,更好的颜色和点击网址的能力,但总的来说,几十年来我们一直以同样的方式在工作. + +所以某些程序员正尝试改变这个状况. **Terminology** ([http://tinyurl.com/osopjv9][3]), 它来自于超级时髦的 Enlightenment 窗口管理器背后的团队,旨在将终端引入 21 世纪,例如带有在线媒体显示功能.你可以在一个充满图片的目录里输入 **ls** 命令,便可以看到它们的缩略图,或甚至可以直接在你的终端里播放视频. 这使得一个终端有点类似于一个文件管理器,意味着你可以快速地检查媒体文件的内容而不必用另一个应用来打开它们. + +接着还有 Xiki ([www.xiki.org][4]),它自身的描述为 "命令的革新".它就像是一个传统的 shell, 一个 GUI 和一个 wiki 之间的过渡; 你可以在任何地方输入命令,并在后面将它们的输出存储为笔记以作为参考,并可以创建非常强大的自定义命令.用几句话是很能描述它的,所以作者们已经创作了一个视频来展示它的潜力是多么的巨大(请看 **Xiki** 网站的截屏视频部分). + +并且 Xiki 绝不是那种在几个月之内就消亡的昙花一现的项目,作者们成功地进行了一次 Kickstarter 众筹,在七月底已募集到超过 $84,000. 是的,你没有看错 – $84K 来支持一个终端模拟器.这可能是最不寻常的集资活动,因为某些疯狂的家伙已经决定开始创办它们自己的 Linux 杂志 ...... + +### 下一代终端 ### + +许多命令行和基于文本的程序在功能上与它们的 GUI 程序是相同的,并且常常更加快速和高效. 我们的推荐有: +**Irssi** (IRC 客户端); **Mutt** (mail 客户端); **rTorrent** (BitTorrent); **Ranger** (文件管理器); **htop** (进程监视器). 若给定在终端的限制下来进行 Web 浏览, Elinks 确实做的很好,并且对于阅读那些以文字为主的网站例如 Wikipedia 来说,它非常实用. + +> ### 微调配色方案 ### +> +> 在 Linux Voice 中,我们并不迷恋养眼的东西,但当你每天花费几个小时盯着屏幕看东西时,我们确实认识到美学的重要性.我们中的许多人都喜欢调整我们的桌面和窗口管理器来达到完美的效果,调整阴影效果,摆弄不同的配色方案,直到我们 100% 的满意.(然后出于习惯,摆弄更多的东西.) +> +> 但我们倾向于忽视终端窗口,它理应也获得我们的喜爱, 并且在 [http://ciembor.github.io/4bit][5] 你将看到一个极其棒的配色方案设计器,对于所有受欢迎的终端模拟器(**XTerm, Gnome Terminal, Konsole and Xfce4 Terminal are among the apps supported.**),它可以色设定.移动滑动条直到你看到配色方案 norvana, 然后点击位于该页面右上角的 `得到方案` 按钮. +> +> 相似的,假如你在一个文本编辑器,如 Vim 或 Emacs 上花费很多的时间,使用一个精心设计的调色板也是非常值得的. **Solarized at** [http://ethanschoonover.com/solarized][6] 是一个卓越的方案,它不仅漂亮,而且因追求最大的可用性而设计,在其背后有着大量的研究和测试. +-------------------------------------------------------------------------------- + +via: http://www.linuxvoice.com/linux-101-power-up-your-shell-8/ + +作者:[Ben Everard][a] +译者:[FSSlc](https://github.com/FSSlc) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.linuxvoice.com/author/ben_everard/ +[1]:http://tinyurl.com/3gvz4ec +[2]:http://www.zsh.org/ +[3]:http://tinyurl.com/osopjv9 +[4]:http://www.xiki.org/ +[5]:http://ciembor.github.io/4bit +[6]:http://ethanschoonover.com/solarized \ No newline at end of file From 736418a546fd23d88b76e4b291b89565869e269c Mon Sep 17 00:00:00 2001 From: Chang Liu Date: Sun, 28 Jun 2015 06:20:00 +0800 Subject: [PATCH 483/965] Update 20150515 Lolcat--A Command Line Tool to Output Rainbow Of Colors in Linux Terminal.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 准备翻译该篇. --- ...Line Tool to Output Rainbow Of Colors in Linux Terminal.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150515 Lolcat--A Command Line Tool to Output Rainbow Of Colors in Linux Terminal.md b/sources/tech/20150515 Lolcat--A Command Line Tool to Output Rainbow Of Colors in Linux Terminal.md index 6b864db6cb..194b295ab9 100644 --- a/sources/tech/20150515 Lolcat--A Command Line Tool to Output Rainbow Of Colors in Linux Terminal.md +++ b/sources/tech/20150515 Lolcat--A Command Line Tool to Output Rainbow Of Colors in Linux Terminal.md @@ -1,3 +1,5 @@ +FSSlc translating + Lolcat – A Command Line Tool to Output Rainbow Of Colors in Linux Terminal ================================================================================ For those who believe that Linux Command Line is boring and there isn’t any fun, then you’re wrong here are the articles on Linux, that shows how funny and naughty is Linux.. @@ -173,4 +175,4 @@ via: http://www.tecmint.com/lolcat-command-to-output-rainbow-of-colors-in-linux- [1]:http://www.tecmint.com/20-funny-commands-of-linux-or-linux-is-fun-in-terminal/ [2]:http://www.tecmint.com/linux-funny-commands/ [3]:http://www.tecmint.com/play-with-word-and-character-counts-in-linux/ -[4]:http://www.tecmint.com/13-basic-cat-command-examples-in-linux/ \ No newline at end of file +[4]:http://www.tecmint.com/13-basic-cat-command-examples-in-linux/ From 46c5c0ca44287245811b017fbfc8c3e637ee3124 Mon Sep 17 00:00:00 2001 From: geekpi Date: Sun, 28 Jun 2015 13:04:57 +0800 Subject: [PATCH 484/965] translating --- .../20150623 Linux Kernel 4.1 Released This Is What's New.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/news/20150623 Linux Kernel 4.1 Released This Is What's New.md b/sources/news/20150623 Linux Kernel 4.1 Released This Is What's New.md index 41058f3210..40eb37e09b 100644 --- a/sources/news/20150623 Linux Kernel 4.1 Released This Is What's New.md +++ b/sources/news/20150623 Linux Kernel 4.1 Released This Is What's New.md @@ -1,3 +1,5 @@ +translating----geekpi + Linux Kernel 4.1 Released, This Is What’s New ================================================================================ **TuxlogoA brand new version of the Linux Kernel — the heartbeat of the modern world (if we you want us to be poetic about it) — has been released.** @@ -59,4 +61,4 @@ via: http://www.omgubuntu.co.uk/2015/06/linux-4-1-kernel-new-features [a]:https://plus.google.com/117485690627814051450/?rel=author [1]:https://lkml.org/lkml/2015/6/22/8 [2]:http://www.omgubuntu.co.uk/2015/04/linux-kernel-4-0-new-features -[3]:http://kernel.ubuntu.com/~kernel-ppa/mainline/?C=N;O=D \ No newline at end of file +[3]:http://kernel.ubuntu.com/~kernel-ppa/mainline/?C=N;O=D From 0267a76f1b86a3b4e61d52dda82eda44b0a0d48d Mon Sep 17 00:00:00 2001 From: geekpi Date: Sun, 28 Jun 2015 13:56:09 +0800 Subject: [PATCH 485/965] translated --- ... Kernel 4.1 Released This Is What's New.md | 64 ------------------- ... Kernel 4.1 Released This Is What's New.md | 63 ++++++++++++++++++ 2 files changed, 63 insertions(+), 64 deletions(-) delete mode 100644 sources/news/20150623 Linux Kernel 4.1 Released This Is What's New.md create mode 100644 translated/news/20150623 Linux Kernel 4.1 Released This Is What's New.md diff --git a/sources/news/20150623 Linux Kernel 4.1 Released This Is What's New.md b/sources/news/20150623 Linux Kernel 4.1 Released This Is What's New.md deleted file mode 100644 index 40eb37e09b..0000000000 --- a/sources/news/20150623 Linux Kernel 4.1 Released This Is What's New.md +++ /dev/null @@ -1,64 +0,0 @@ -translating----geekpi - -Linux Kernel 4.1 Released, This Is What’s New -================================================================================ -**TuxlogoA brand new version of the Linux Kernel — the heartbeat of the modern world (if we you want us to be poetic about it) — has been released.** - -![](http://www.omgubuntu.co.uk/wp-content/uploads/2011/07/Tux-psd3894.jpg) - -The arrival [has been announced][1] by Linus Torvalds (who else?) on the Linux Kernel Mailing List (where else?) and comes almost two months after the [first entry in the new 4.x series][2]. - -Levity aside, and like every release before it, Linux Kernel 4.1 features a big set of changes. These touch everything from hardware compatibility to power management to file-system performance and technical fixes for obscure processors you’ve never heard of. - -Linux 4.1 is already being tracked in Ubuntu 15.10, due for release in October. - -### What’s New In Linux 4.1? ### - -![Tux got mail](http://www.omgubuntu.co.uk/wp-content/uploads/2015/06/linux-kernel-4-11-350x200.jpg) -Tux got mail - -The sub-heading is on your lips and we’re not here simply to serve up an announcement of an announcement. - -We’ve gone through the (vast, long, lengthy and at times technically unintelligible) change-log to pick out some highlights that may not feed hyperbole but may impact on you, a desktop users. - -#### Power Improvements #### - -The big headline user-facing feature you’ll find in Linux 4.1 are the wealth of performance and power efficiency improvements committed for Intel’s Cherry Trail and Bay Trail chips. SoCs and devices, such as the Intel Compute Stick. - -Anecdotal suggestions are that Linux Kernel 4.1 gives select combinations of newer Intel hardware as much as an extra hour of battery life. Such high gains are not likely to apply to anything but a very specific sub-set of chips and systems (and high-end ones at that) but it’s still exciting to hear of. - -**Highlights of Linux 4.1 include:** - -- EXT4 gains file-system level encryption (thanks to Google) -- Logitech lg4ff driver improves ‘force feedback’ for gaming wheels -- Toshiba laptop driver gains USB sleep charging and backlight improvements -- Rumble support for Xbox One controller -- Better battery reporting in Wacom tablet driver -- Various misc. power improvements for both ARM and x86 devices -- Samsung Exynos 3250 power management improvements -- Support for the Bamboo Pad -- Lenovo OneLink Pro Dock gains USB support -- Support for Realtek 8723A, 8723B, 8761A, 8821 Wi-Fi cards - -### Install Linux Kernel 4.1 on Ubuntu ### - -Although this release of the kernel is classed as stable there is no pressing need for Ubuntu desktop users to go out of their way to install it. - -Not that you can’t; if you’re impatient and skilled enough to do so you can take a crack at installing Linux 4.1 on Ubuntu by grabbing the appropriate set of packages from [Canonical’s mainline kernel archive][3] (or by risking a third-party PPA). - -Ubuntu 15.10 Wily Werewolf, due for release in October, is to be based on the Ubuntu Kernel 4.1.x (the Ubuntu kernel is the Linux Kernel plus Ubuntu-specific patches that have not been accepted upstream). - --------------------------------------------------------------------------------- - -via: http://www.omgubuntu.co.uk/2015/06/linux-4-1-kernel-new-features - -作者:[Joey-Elijah Sneddon][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://plus.google.com/117485690627814051450/?rel=author -[1]:https://lkml.org/lkml/2015/6/22/8 -[2]:http://www.omgubuntu.co.uk/2015/04/linux-kernel-4-0-new-features -[3]:http://kernel.ubuntu.com/~kernel-ppa/mainline/?C=N;O=D diff --git a/translated/news/20150623 Linux Kernel 4.1 Released This Is What's New.md b/translated/news/20150623 Linux Kernel 4.1 Released This Is What's New.md new file mode 100644 index 0000000000..11b9c10a26 --- /dev/null +++ b/translated/news/20150623 Linux Kernel 4.1 Released This Is What's New.md @@ -0,0 +1,63 @@ +Linux 4.1 发布了,下面是有哪些新的 +================================================================================ +**TuxlogoA brand new version of the Linux Kernel — the heartbeat of the modern world (if we you want us to be poetic about it) — has been released.** +**一个心的Linux内核 - 现代世界的心跳(如果我们想要让它充满诗意)已经发布了** + +![](http://www.omgubuntu.co.uk/wp-content/uploads/2011/07/Tux-psd3894.jpg) + +Linus Torvalds(还有谁?)在Linux邮件列表(还有哪里)中[宣布了][1]内核发布,同事也是大概两个月后迎来了[第一个4.x系列的发布][2]。 + +快速之外,像每次发布前那样,Linux 4.1带来了很大的改变。它从硬件兼容性到电源管理到文件系统性能到和你从没听说过的处理器的技术修复。 + +Linux 4.1 已经进入Ubuntu 15.10, 将在10月发布。 + +### Linux 4.1 有哪些新的 ### + +![Tux got mail](http://www.omgubuntu.co.uk/wp-content/uploads/2015/06/linux-kernel-4-11-350x200.jpg) +Tux邮件 + +子标题在嘴上,我们不会简单地就宣布公告。 + +我们从(大量冗长的及不能理解的技术)更改日志去挑选一些对桌面用户而言,不见得夸张但或许有用的亮点。 + +#### 电源管理 #### + +你在Linux 4.1中面向用户的一大特性是对Intel Cherry Trail 和 Bay Trai 芯片的丰富性能以及电源效率的提升。Soc设备,如Intel计算棒。 + +传闻建议是Linux 4.1给出了新的Intel硬件组合,和更长电池守密。这么高的受益不可能针对任何芯片,它只对特定芯片和系统(和高端的)有用,但仍旧是一个令人兴奋的消息。 + +**Linux 4.1 亮点包括:** + +- ext4获得了文件系统层面的加密(感谢Google) +- 罗技游戏手柄lg4ff驱动提升‘力量反馈’ +- 东芝笔记本驱动获得USB睡眠充电和背光提升 +- Xbox One控制器支持 +- Wacom平板中更好的电源报告驱动 +- 不同的杂项。arm和x86设备电源管理提升 +- Samsung Exynos 3250 电源管理 +- 支持Bamboo屏板 +- 联想OneLink Pro Dock获得USB支持 +- 支持Realtek 8723A、 8723B、 8761A、 8821 Wi-Fi网卡 + +### Ubuntu中安装Linux 4.1 ### + +虽然这次发布的内核被标记为稳定,但是Ubuntu用户没有迫切需要区安装它。 + +如果你等不及了并且技术足够熟练,你可以从[Canonical的主流内核归档][3]中下载合适的来安装Linux 4.1(或者冒着风险使用第三方PPA)。 + +10月发布的Ubuntu 15.10 Wily Werewolf将会基于Ubuntu Kernel 4.1.x(Ubuntu内核是基于Linux内核加上Ubuntu没被上流接受的独有补丁)。 + +-------------------------------------------------------------------------------- + +via: http://www.omgubuntu.co.uk/2015/06/linux-4-1-kernel-new-features + +作者:[Joey-Elijah Sneddon][a] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://plus.google.com/117485690627814051450/?rel=author +[1]:https://lkml.org/lkml/2015/6/22/8 +[2]:http://www.omgubuntu.co.uk/2015/04/linux-kernel-4-0-new-features +[3]:http://kernel.ubuntu.com/~kernel-ppa/mainline/?C=N;O=D From ed59ef7a3e0ae4241a17985f73f48a5233fd087c Mon Sep 17 00:00:00 2001 From: wi-cuckoo Date: Sun, 28 Jun 2015 15:02:59 +0800 Subject: [PATCH 486/965] translated 75% --- ...ll be the future of Linux without Linus.md | 188 ++++++------------ 1 file changed, 59 insertions(+), 129 deletions(-) diff --git a/sources/talk/20150618 What will be the future of Linux without Linus.md b/sources/talk/20150618 What will be the future of Linux without Linus.md index 92b9e9ee4d..09cd64b647 100644 --- a/sources/talk/20150618 What will be the future of Linux without Linus.md +++ b/sources/talk/20150618 What will be the future of Linux without Linus.md @@ -1,186 +1,116 @@ -translating wi-cuckoo -What will be the future of Linux without Linus? -================================================================================ -![](http://i2.wp.com/www.linuxveda.com/wp-content/uploads/2015/06/linus-torvalds-painting.jpg) +没有Linus,Linux的未来是什么样子? +============================================================================== +![](http://i2.wp.com/www.linuxveda.com/wp—content/uploads/2015/06/linus—torvalds—painting.jpg) -The interview was conducted back in 2007 for Linux For You magazine and we are publishing it here for archival purposes. +这次采访是 Linux For You 杂志在2007年进行的,现在我们发表在这里是为了存档的目的。 -**Q: What are the future enhancements/paths/plans for the Linux kernel?** +**Q:对于Linux内核,未来的计划/道路/强化是怎样的?** -Linus: I’ve never been much of a visionary — instead of looking at huge plans for the future, I tend to have a rather short time frame of ‘issues in the next few months’. I’m a big believer in that the ‘details’ matter, and if you take care of the details, the big issues will end up sorting themselves out on their own. +Linus:我从来没有太多的预见性 — 与其从宏大的计划上看未来,我倾向于从一个相对短的时间框架,比如“几个月之后的事情”。我是一个忠实的‘细节成败论’的信仰者,如果你抓住了细节,大的事情也会大事化小,小事化没。 -So I really don’t have any great vision for what the kernel will look like in five years — just a very general plan to make sure that we keep our eye on the ball. In fact, when it comes to me personally, one of the things I worry about the most isn’t even the technical issues, but making sure that the ‘process’ works, and that people can work well with each other. +所以,对于五年后内核会是什么样,我真的没有任何大眼光 — 仅仅是一个非常普遍的计划,确保我们对其保持关注。实际上,对于我个人来说,我最担心的事情之一甚至不是技术问题,而是确保‘进程’工作,这样人们才可以相互协作好。 -**Q: How do you see the relationship of Linux and Solaris evolving in the future? How will it benefit the users? ** +**Q:你怎么看Linux和Solaris之间的关系在未来的发展?它会如何使用户受益?** -Linus: I don’t actually see a whole lot of overlap, except that I think Solaris will start using more of the Linux user space tools (which I obviously don’t personally have a lot to do with — I really only do the kernel). The Linux desktop is just so much better than what traditional Solaris has, and I expect Solaris to move more and more towards a more Linux-like model there. +Linus:我并不能看到整个重叠的地方,除了我认为Solaris会开始使用更过Linux用户磁盘工具(显然我自己来说没有太多关注这个 — 我真的只关心内核)。Linux的桌面比起传统Solaris拥有的好多了,而且我希望Solaris移植越来越多的Linux的东西,朝着一个更加类Linux的模型前进。 -On the pure kernel side, the licensing differences mean that there’s not much cooperation, but it will be very interesting to see if that will change. Sun has been making noises about licensing Solaris under the GPL (either v2 or v3), and if the licence differences go away, that could result in some interesting technology. But I’m taking a wait-and-see attitude to that. +从纯内核方面讲,证书的差异意味着没有太多的合作,但是如果看到这种情况改变会很有趣。Sun已经声明在GPL(v2或v3)下授权Solaris,如果这种证书差异消失,那么会导致一些有趣的技术出现。但对此,我持待见态度。 -**Q: Now that the GPLv3 has been finalised and released, do you foresee any circumstance that would encourage you to begin moving the kernel to it? Or, from your perspective, is it so bad that you would never consider it?** +**Q:现在GPL v3已经完成并发布了,你是否预见有任何情况会激起你开始移植内核到Solaris上去?或者,从你的角度看,它是否很糟糕以至于你从来没考虑过他?** -Linus: I think it is much improved over the early drafts, and I don’t think it’s a horrible licence. I just don’t think it’s the same kind of ‘great’ licence that the GPLv2 is. +Linus:我觉得相比于早先的草稿,v3有了很多提高,并且我也认为它不是一个糟糕的证书。我只是认为它没有GPLv2一般的‘伟大’。 -So in the absence of the GPLv2, I could see myself using the GPLv3. But since I have a better choice, why should I? +所以,由于没有了GPLv2,我会看见自己将会使用GPLv3。但是,自从我有了一个更好的选择,我为什么不应该考虑一下呢? -That said, I try to always be pragmatic, and the fact that I think the GPLv3 is not as good a licence as the GPLv2 is not a ‘black and white’ question. It’s a balancing act. And if there are other advantages to the GPLv3, maybe those other advantages would be big enough to tilt the balance in favour of the GPLv3. +这就是说,我努力保持实用主义精神,并且我认为GPLv3比起GPLv2不是一个好证书这件事不是一个‘黑与白’的问题。这是一个平衡做法。如果GPLv3有其他的优点,可能那些优点会在很大程度上倾斜喜爱GPLv3的天平。 -Quite frankly, I don’t really see any, but if Solaris really is to be released under the GPLv3, maybe the advantage of avoiding unnecessary non-compatible licence issues could be enough of an advantage that it might be worth trying to re-license the Linux kernel under the GPLv3 too. +恕我直言,我并没有看到任何优点,但是如果Solaris真的在GPLv3下发布,可能避免不必要的不兼容证书这条足够称为一个优点,可能也会值得去尝试重新许可Linux的内核放在GPLv3下。 -Don’t get me wrong — I think it’s unlikely. But I do want to make it clear that I’m not a licence bigot, per se. I think the GPLv2 is clearly the better licence, but licences aren’t everything. +不要误解我 — 我认为这是不大可能的。但是我确实想澄清我本质上不是一个证书偏执者。我认为GPLv2是毫无疑问的好证书,但是证书不是一切。 -After all, I use a lot of programs that are under other licences. I might not put a project I start myself under the BSD (or the X11-MIT) licence, but I think it’s a great licence, and for other projects it may well be the right one. +总的来说,我使用很多其他证书下的程序。我可能没有把我自己做的一个项目放在BSD(或X11—MIT)证书下,但是我认为它是一个伟大的证书,对于其他项目来说,它可能是最佳的选择。 -**Q: Currently are there any Indians who you’d like to highlight as key contributors to the Linux kernel?** +**Q:目前有没有任何印度人,你想特别提出作为Linux内核的关键贡献者?** -Linus: I have to admit that I don’t directly work with anybody that I actually realise as being from India. That said, I should clarify a bit: I’ve very consciously tried to set up the kernel development so that I don’t end up working personally with a huge number of people. +Linus:我不得不承认,我并没有与实际认识的来自印度的任何人直接工作。那就是说,我应该稍微澄清下:我已经非常有意识地努力建立一个规模庞大的内核开发团队,这样我不用以独自地工作而告终。 -I have this strong conviction that most humans are basically wired up to know a few people really well (your close family and friends), and I’ve tried to make the development model reflect that: with a ‘network of developers’, where people interact with maybe a dozen other people they trust, and those other people in turn interact with ‘their’ set of people they trust. +我非常相信大多数人基本上被束缚起来了,只对很少的人十分了解(你最亲近的家人和朋友),我也努力构造这样一个开发模型影响这种状况:通过一个‘开发者网络’,人们可以在此互动,可能是与一批你信任的人,而且那些人反过来与他们信任的一群人互动。 -So while I’m in occasional contact with hundreds of developers who send me a random patch or two, I’ve tried to set up an environment where the bulk of what I do happens through a much smaller set of people that I know, just because I think that’s how people work. It’s certainly how I like to work. +所以,当我偶然与上百个开发者联系,他们发给我一两个随机的补丁,我已经努力去建立这样一个环境,在这里我做的一堆事,发生在我熟知的人组成的一个较小的集合间,仅仅因为我认为那就是人们工作的方式。当然也是我喜欢工作的方式。 -Also, in all honesty, I don’t even know where a lot of the people I work with live. Location ends up being pretty secondary. So while I’m pretty sure that none of the top 10-15 I work with most closely, are in India, maybe after this goes public, it might get pointed out that there is actually somebody from there! +同时,坦白地说,我甚至不知道许多与我一起工作的人生活在哪里。位置成了十分次要的东西。所以我很确信与我工作最亲密的前10—15个人中,没有印度的,可能这话稍后传到公众耳里,然后被指出确实有一些人来自那里! -**Q: Since the Linux Kernel Development depends so heavily on you, how do you plan to organise/reorganise it for it to continue progressing without you, in case you decide to dedicate more time to your own life and family?** +**Q:自从Linux的内核开发对你依赖如此严重以来,你如何计划组织/重组,让它在没有你的情况下继续发展,假设你决定花更多的时间在你自己的生活和家庭上面?** -Linus: I’ve long since come to the realisation that Linux is much bigger than me. Yes, I’m intimately involved in it still, and I have a fairly large day-to-day impact on it, and I end up being the person who, in some sense, acts as the central point for a lot of kernel activities; but no — I wouldn’t say that Linux ‘depends heavily’ on me. +Linus:现在Linux比我大得多了,为了这个实现我已经工作了很长时间。是的,我仍然十分亲切地身在其中,而且我对其有着想当大的日常影响,我最终会是这样一个人,在某种程度上,扮演着许多内核开发活跃者的中心点的角色;但是 — 我不会说Linux“严重依赖”于我。 -So if I had a heart attack and died tomorrow (happily not likely: I’m apparently healthy as anything), people would certainly notice, but there are thousands of people involved in just the kernel, and there’re more than a few that could take over for me with little real confusion. +所以,如果我得了心脏病并且明天就死了(很高兴没这种可能:我显然在任何方面都还健康),人们肯定会注意到,但是有成千上万的人为内核工作,并且不止一两个人能够接替我,还少有困惑。 -**Q: India is one of the major producers of software engineers, yet we don’t contribute much to the Linux domain. What do you think is keeping Indians from becoming proactive on that front? How do you feel we could encourage Indians to get involved and contribute heavily? You have a fan following in India; could your iconic image be used to inspire enthusiasts?** +**Q:印度是软件工程师的主要产地之一,当然我们没有在Linux领域做太多贡献。你觉得什么是保持印度人在Linux领域变得具有前瞻性的?如果我们鼓励印度人参与并为Linux做很大的贡献,你觉得如何?假如你有一个在印度的粉丝;你会用你的形象来启迪那些爱好者吗?** -Linus: This is actually a very hard question for me to answer. Getting into open source is such a complicated combination of both infrastructure (Internet access, education, you name it), flow of information and simply culture that I can’t even begin to guess what the biggest stumbling block could be. +Linus:对我来说,这确实是一个不好回答的问题。进入开源是如此一个底层结构(网络接入,教育,你说的),信息流和简单的文化的复杂组合,我甚至不能去猜测最大的障碍会是什么。 -In many ways, at least those with an English-speaking culture in India should have a rather easy time getting involved with Linux and other open source projects, if only thanks to the lack of a language barrier. Certainly much easier than many parts of Asia or even some parts of Europe. +在很多方面,至少那些在印度含英语文化的地方,应该有一个相对容易的方式参与Linux和其他开源项目,如果仅仅是由于语言门槛的话。当然比起亚洲的许多地方,甚至欧洲的一些地方要容易些。 -Of course, while that is a lot of people, it’s equally obviously not the majority in India, and I personally simply don’t know enough about the issues in India to be able to make an even half-way intelligent guess about what the best way forward is. I suspect that an enthusiastic local user community is always the best way, and I think you do have that. +当然,有一些人,并不等同于印度的大部分群体,而且我自己关于印度的情况也知道不多,甚至没法做出一点半路聪明猜测最好的前路是什么。我猜一个热情的本地用户社区一直是最好的途径,我认为你们已经拥有这样的社区了。 -As to my ‘iconic image’, I tend to dislike that part personally. I’m not a great public speaker, and I’ve avoided travelling for the last several years because I’m not very comfortable being seen as this iconic ‘visionary’. I’m just an engineer, and I just happen to love doing what I do, and to work with other people in public. +至于我的‘形象’,我自己不以为然。我不是一个伟大的公众演讲者,而且我最近些年已经避免出游,因为被看做符号‘形象’让我很不自在。我就是一个工程师而已,而且我仅仅是喜欢我做的事情,并与社会上其他人一起工作。 -**Q: What would be a good reason for you to consider visiting India?** +**Q:什么样的理由会让你考虑去看看印度?** -Linus: As mentioned in the first answer, I absolutely detest public speaking, so I tend to avoid conferences, etc. I’d love to go to India for a vacation some day, but if I do, I’d likely just do it incognito — not tell anybody beforehand and just go as a tourist to see the country! +Linus:如第一个回答中提到,我完全地讨厌公开演讲,所以我才想避免开会等等这些事。我更愿意某天去印度度个假,但是如果我这样做,我可能悄悄地干 — 出行之前不告诉任何人,仅仅作为一个游客去游览印度! -**Q: Recently, you seemed to slam Subversion and CVS, questioning their basic architecture. Now that you’ve got responses from the Subversion community, do you stand corrected, or are you still unconvinced?** +**Q:最近,你好像在抨击Subversion与CVS,质问他们的基础架构。现在你已经从Subversion和CVS社区那里得到回应,你仍然在坚持自己正确,或者没有被说服吗?** -Linus: I like making strong statements, because I find the discussion interesting. In other words, I actually tend to ‘like’ arguing. Not mindlessly, but I certainly tend to prefer the discussion a bit more heated, and not just entirely platonic. +Linus:因为我发现这个争论很有趣,所以我想做一个强硬的声明。换句话说,我确实‘喜欢’争论。并不是不经思考的,但是我确实想要让争论更热烈些,而不仅仅是完全的柏拉图式的。 -And making strong arguments occasionally ends up resulting in a very valid rebuttal, and then I’ll happily say: “Oh, ok, you’re right.” +做出强硬的争论有时会导致一个非常合理的反驳,然后我会很高兴地说:“噢,好吧,你是对的。” -But no, that didn’t happen on SVN/CVS. I suspect a lot of people really don’t much like CVS, so I didn’t really even expect anybody to argue that CVS was really anything but a legacy system. And while I’ve gotten a few people who argued that I shouldn’t have been quite so impolite against SVN (and hey, that’s fair — I’m really not a very polite person!), I don’t think anybody actually argued that SVN was ‘good’. +但是话说回来,对SVN/CVS并不会发生这种情况。我怀疑很多人真的不是很喜欢CVS,所以我真的不期望任何人去坚持CVS是一切,而不是一个老旧的系统。当我知道少数人确实这样争论了,我之前就不该那么不礼貌地反对SVN(嘿,这是公平的 — 我真的不是一个非常礼貌的家伙!),我认为不是任何人都可以争论SVN是‘好的’。 -SVN is, I think, a classic case of ‘good enough’. It’s what people are used to, and it’s ‘good enough’ to be used fairly widely, but it’s good enough in exactly the sense DOS and Windows were ‘good enough’. Not great technology, just very widely available, and it works well enough for people and looks familiar enough that people use it. But very few people are ‘proud’ of it, or excited about it. +我认为,SVN就是一个‘好过头’的经典案例。人们过去经常使用SVN,并且它也‘很好’,用途广泛,但是它的好过头完全如DOS与Windows也‘好过头’一样。不是什么伟大的技术,只是普遍适用而已,同时它对人们来说运行良好,看着十分熟悉。但是很少有人以此为傲,或者对其有兴奋感。 -Git, on the other hand, has some of the ‘UNIX philosophy’ behind it. Not that it is about UNIX, per se, but like original UNIX, it had a fundamental idea behind it. For UNIX, the underlying philosophy was/is that, “Everything is a file.” For git, it’s, Everything is just an object in the content-addressable database.” +Git,从另外方面讲,其身后有一些‘UNIX 哲学’。它不是关于UNIX,实质上,是像原始的UNIX,它身后有一个基础的想法。对UNIX来说,最底层的哲学就是,“所有东西只是一个文件”。对Git来说,“则是每个东西仅仅是内容寻址数据库中的一个对像”。 -**Q: Is having so many distros a good or bad idea? Choice is fine, but one does not need to be pampered with choices. Instead of so many man hours being spent in building hundreds of distros, wouldn’t it be easier to get into the enterprise and take on the MS challenge if people could come together and support fewer distros (1 for each use maybe)? What’s your view on that?** +**Q:现在如此多的发行是好事还是坏事?选择是很有意思的,但是没有人需要被选择给撑着。相较于这么多的人每天花费数小时去构建成百上千的发行版,如果人们可以一起来支持少数的发行版(可能每一个有一个人),这样进入企业,接受微软的挑战是不是更容易些呢?对此你怎么看?** -Linus: I think having multiple distros is an inevitable part of open source. And can it be confusing? Sure. Can it be inefficient? Yes. But I’d just like to compare it to politics: ‘democracy’ has all those confusing choices, and often none of the choices is necessarily what you ‘really’ want either, and sometimes you might feel like things would be smoother and more efficient if you didn’t have to worry about the whole confusion of voting, different parties, coalitions, etc. +Linus:我认为多发行版是开源不可回避的部分。它会造成困惑吗?当然。它会变得低效率吗?是的。但是我喜欢拿它与政治比较:’民主‘也有那些令人困惑的选择,通常没有选择是必须的,或者你‘真正’想要的。而且有时候,如果你不需要担心选举,不同党派和联合等等方面的困惑的话,你可能喜欢事情更加容易一些,更有效率一些。 -But in the end, choice may be inefficient, but it’s also what keeps everybody involved at least ‘somewhat’ honest. We all probably wish our politicians were more honest than they are, and we all probably wish that the different distros sometimes made other choices than they do, but without that choice, we’d be worse off. +但是最后我想说,选择可能会导致低效率,但是它也让每个人至少保留了‘所谓的’诚信。我们可能都希望我们的政治家比过去更诚信,我们也希望不同的发行版有一天做出其他的选择,但是没有那种选择的话,事情可能会更糟。 -**Q: Why do you think CFS is better than SD?** +**Q:为什么你觉得CFS比SD更好?** -Linus: Part of it is that I have worked with Ingo [Molnar] for a long time, which means that I know him, and know that he’ll be very responsive to any issues that come up. That kind of thing is very important. +Linus:一部分原因是我与Ingo[Molnar]工作你很长一段时间,这就是说,我了解他,并且知道他会对发生的任何事情非常负责。那种品质是非常重要的。 -But part of it is simply about numbers. Most people out there actually say that CFS is better than SD. Including, very much, on 3D games (which people claimed was a strong point of SD). +但是一部分原因就简单的与用户有关。其他地方的大多数人实际上表示CFS比SD好。包括许多3D游戏方面(这是人们声称SD最强的一点)。 -At the same time, though, I don’t think any piece of code is ever ”perfect”. The best thing to happen is that the people who want to be proponents of SD will try to improve that so much that the balance tips over the other way — and we’ll keep both camps trying interesting things because the internal competition motivates them. +同时,尽管如此,我认为并不是代码的任何一段都十分‘完美’。最好的情况是想成为SD支持者的人会努力提高SD,使得平衡会倾覆其他方面 — 而我们会保持两个阵营都尝试有趣的事情,因为内部的竞争会刺激他们。 -**Q: In a talk you had at Google about git, someone asked you how you would take an extremely large code base that is currently handled with something centralised and transition to git without stopping business for six months. What was your response to that?** +**Q:在Google一次关于Git的访谈中,有人问你如何会停止六个月的商业活动,为git编写了一个目前由一些中心化的东西和交易管理的,特别庞大的代码基础。你对此的回答是什么?** -Linus: Ahh. That was the question where I couldn’t hear the questioner well (the questions were much more audible in the recordings), and I noticed afterwards, when I went back and listened to the recorded audio, that I didn’t answer the question he asked, but the question I thought he’d asked. +Linus:啊哈。那个问题我在现场没有听清楚(在录制结果里,问题会听得更清楚些),当我回头去听录制的音频,注意到了我没有回答他的问题,但是我觉得这问题他问过。 -Anyway, we do have lots of import tools, so that you can actually just import a large project from just about any other previous SCM into git. But the problem, of course, often doesn’t end up being the act of importing itself, but just having to ‘get used to’ the new model! +无论如何,我们确实有很多导入的工具,所以你实际上可以仅仅是从任何其他的早期SCM导入一个大工程到git里,但问题显然不是经常以导入动作本身结束,而是需要‘习惯’这种新模式! -And quite frankly, I don’t think there is any other answer to that ‘get used to it’ but to just start out and try it. You obviously do not want to start out by importing the biggest and most central project you have; that would indeed just make everything come to a standstill, and make everybody very unhappy indeed. +坦白来说,我认为关于‘习惯它’没有任何其他答案,而只是去开始使用和尝试它。显然,你不想以导入你现有的最大且最中心的项目为开端;那确实会使每件事出现停顿,然后使得每个人都很不高兴。 -So nobody sane would advocate moving everything over to git overnight, and forcing people to change their environment. No. You’d start with a smaller project inside a company, perhaps something that just one group mostly controls and maintains, and start off by converting that to git. That way you get people used to the model, and you start having a core group with the knowledge about how git works and how to use it within the company. +所以没有理智健全的人会一夜之间拥护将一切移到git上去,并强迫人们改变他们的环境。是的,你需要以公司里的小项目开始,可能是一些一个组主要控制和维护的项目,然后开始转移其到git。这是你能让人们习惯这种模式的方式,你开始有一个核心的组,知道git如何工作,如何在公司里面使用它。 -And then you just extend on that. Not in one go. You’d import more and more of the projects — even if you have the ‘one big repository’ model at your company; you also almost certainly have that repository as a set of modules, because having everybody check out everything is just not a workable mode of operation (unless ‘everything’ is just not very large). +接着,你就会铺展开来。并不一次就位。你会导入越来越多的项目 — 如果在你公司里你有‘一个大仓库’;你也会差不多确定将那个仓库作为许多模块的集合,因为让每个人去检查每件事不是一个可执行的工作模型(除非‘每件事’并不非常大)。 -So you’d basically migrate one module at a time, until you get to the point where you’re so comfortable with git that you can just migrate the rest (or the ‘rest’ is so legacy that nobody even cares). +所以,你基本上有一次转移了一个模块,直到你发现你使用git如此舒服的那个点,你可以移植余下的所有(或者‘余下’太传统了,没人会关心)。 -And one of the nice features of git is that it actually plays along pretty well with a lot of other SCMs. That’s how a lot of git users use it: ‘they’ may use git, but sometimes the people they work with don’t even realise, because they see the results of it propagated into some legacy SCM. +Git最赞的一个功能是,它实际上可以同很多其他SCM相处很好。这就是很多git用户使用它的时候:‘他们’可能只是使用git,但有时候与他们一起工作的人并没有发现,因为他们看到git的结果,联想到一些传统的SCM上去。 -**Q: Did they ever experiment with alternate instruction set implementations at Transmeta? [Transmeta Crusoe chip seemed like a very soft CPU — reminding one of Burroughs B1000 interpretive machine, which actually implemented multiple virtual machines. There was one for system software, another for Cobol, another for Fortran; If that is correct, then one could implement Burroughs 6/7000 or HP3000 like stack architecture on the chip or an instruction set suitable for JVM, etc]** +**Q:在Transmeta,他们曾经经历过用另外的架构设置部署吗?[Transmeta Crusoe的芯片看起来像一个非常软的CPU — 提到一台Burroughs B1000的解释机器,这实际上部署了多台虚拟机。有一台是用于系统软件,一台是用于Cobol,一台用于Fortran;如果上述正确,那么一个人可以部署Burroughs 6/7000或者HP3000,如栈结构一样,在芯片上或者一个适合JVM的结构集合等等。]** -Linus: We did indeed have some alternate instruction set, and while I still am not really supposed to talk about it, I can say that we did have a public demonstration of mixing instruction sets. We had a technology showcase where you could run x86 instructions side-by-side with Java byte code (actually, it was a slightly extended pico-java, iirc). +Linus:我们确实有一些备选的结构集合,我仍然不打算谈论这个,我可以说我们已经做了一个混合结构集合的公开证明。我们有一个技术宝箱,在那里你同时可以跑x86结构和Java字节码(实际上,它是一个轻量的扩展pico—java,iirc)。 -I think the app we showed running was running DOOM on top of Linux, where the Linux parts were a totally standard x86 distribution, but the DOOM binary was a specially compiled version where part of the game was actually compiled pico-Java. And the CPU ended up running them both the same way — as a JIT down to the native VLIW instruction set. +(选择DOOM的原因仅仅是其源代码可用,并且游戏的核心部分非常小,足以很容易拿它来做一个验证 — 而且它也显然看起来十分有趣。) -(The reason for picking DOOM was just that source code was available, and the core parts of the game were small enough that it was easy to set it up as a demonstration — and it was obviously visually interesting.) +有更多的事情是在内部运作,但是我不能谈论他们。而且实际上,就我个人而言,对Java不怎么感冒。 -There were more things going on internally, but I can’t really talk about them. And I wasn’t actually personally involved with the Java one either. +**Q:386BSD衍生了NetBSD,FreeBSD和OpenBSD,在Linux出现之前已经发展不错了,但是Linux传播比386BSD及其衍生者更为广泛。这在多大程度上左右你对证书的选择,和你选择的发展过程?你不认为比起GPLv2来,是GPLv3保护了自由,孕育了Linux比BSD更好,直到现在?** -**Q: 386BSD, from which NetBSD, FreeBSD and OpenBSD were derived, was there well before Linux, but Linux spread much more than 386BSD and its derivatives. How much of this do you attribute to the choice of the licence and how much to the development process you chose? Don’t you think that the GPLv3 protects the freedom that has bred Linux better than the BSDs till now, more than the GPLv2 can?** +Linus: -Linus: I think there’s both a licence issue, and a community and personality issue. The BSD licences always encouraged forking, but also meant that if somebody gets really successful and makes a commercial fork, you cannot necessarily join back. And so even if that doesn’t actually happen (and it did, in the BSD cases — with BSDi), people can’t really ‘trust’ each other as much. - -In contrast, the GPLv2 also encourages forking, but it not only encourages the branching off part, it also encourages (and ‘requires’) the ability to merge back again. So now you have a whole new level of trust: you ‘know’ that everybody involved will be bound by the licence, and won’t try to take advantage of you. - -So I see the GPLv2 as the licence that allows people the maximum possible freedom within the requirement that you can always join back together again from either side. Nobody can stop you from taking the improvements to the source code. - -So is the BSD licence even more ‘free’? Yes. Unquestionably. But I just wouldn’t want to use the BSD licence for any project I care about, because I not only want the freedom, I also want the trust so that I can always use the code that others write for my projects. - -So to me, the GPLv2 ends up being a wonderful balance of ‘as free as you can make it’, considering that I do want everybody to be able to trust so that they can always get the source code and use it. - -Which is why I think the GPLv3 ends up being a much less interesting licence. It’s no longer about that trust about “getting the source code back”; it has degenerated into a “I wrote the code, so I should be able to control how you use it.” - -In other words, I just think the GPLv3 is too petty and selfish. I think the GPLv2 has a great balance between ‘freedom’ and ‘trust’. It’s not as free as the BSD licences are, but it gives you peace of mind in return, and matches what I consider ‘tit-for-tat': I give source code, you give me source code in return. - -The GPLv3 tries to control the ‘use’ of that source code. Now it’s, “I give you my source code, so if you use it, you’d better make your devices hackable by me.” See? Petty and small-minded, in my opinion. - -**Q: Slowly but steadily, features of the -rt tree are getting integrated into the mainline. What are your current thoughts regarding a merger of the remaining -rt tree into the mainline (and I’m not talking about the CFS)?** - -Linus: I won’t guarantee that everything from -rt will ‘ever’ be merged into the standard kernel (there may be pieces that simply don’t end up making sense in the generic kernel), but yes, over the years we’ve actually integrated most of it, and the remaining parts could end up making it one of these days. - -I’m a big fan of low-latency work, but at the same time I’m pretty conservative, and I pushed back on some of the more aggressive merging, just because I want to make sure that it all makes sense for not just some extreme real time perspective, but also for ‘normal’ users who don’t need it. And that explains why the process has been a pretty slow but steady trickle of code that has gotten merged, as it was sufficiently stable and made sense. - -That, by the way, is not just an -rt thing; it’s how a lot of the development happens. -rt just happens to be one of the more ‘directed’ kernel projects, and one where the main developer is pretty directly involved with the normal kernel too. But quite often the migration of other features (security, virtual memory changes, virtualisation, etc) follows a similar path: they get written up in a very targeted environment, and then pieces of the features get slowly but surely merged into the standard kernel. - -**Q: I’m very curious about what the future holds for file systems in the kernel. What do you think about Reiser4, XFS4, ZFS and the new project founded by Oracle? ZFS has been receiving a lot of press these days. Reiser4 delivers very good benchmarks, and xfs4 is trying to keep up, whereas the one by Oracle has a lot of the same specs as Sun’s ZFS. Where are we heading? Which FS looks the most promising in your opinion?** - -Linus: Actually, just yesterday we had a git performance issue, where ZFS was orders of magnitude slower than UFS for one user (not under Linux, but git is gaining a lot of traction even outside of kernel development). So I think a lot of the ‘new file system’ mania is partly fed by knowing about the issues with old file systems, and then the (somewhat unrealistic) expectation that a ‘new and improved’ file system will make everything perfect. - -In the end, this is one area where you just let people fight it out. See who comes out the winner — and it doesn’t need to be (and likely will not) be a single winner. Almost always, the right choice of file system ends up depending on the load and circumstances. - -One thing that I’m personally more excited about than any of the file systems you mention is actually the fact that Flash-based hard disks are quickly becoming available even for ‘normal’ users. Sure, they’re still expensive (and fairly small), but Flash-based storage has such a different performance profile from rotating media, that I suspect that it will end up having a large impact on file system design. Right now, most file systems tend to be designed with the latencies of rotating media in mind. - -**Q: The operating system is becoming less and less important. You have said several times that the user is not supposed to ‘see’ the operating system at all. It is the applications that matter. Browser-based applications, like Google’s basic office applications, are making an impact. Where do you think operating systems are headed?** - -Linus: I don’t really believe in the ‘browser OS’, because I think that people will always want to do some things locally. It might be about security, or simply about privacy reasons. And while connectivity is widely available, it certainly isn’t ‘everywhere’. - -So I think the whole ‘Web OS’ certainly is part of the truth, but another part that people seem to dismiss is that operating systems have been around for decades, and it’s really a fairly stable and well-known area of endeavour. People really shouldn’t expect the OS to magically change: it’s not like people were ‘stupid’ back in the 60s either, or even that hardware was ‘that’ fundamentally different back then! - -So don’t expect a revolution. I think OSs will largely continue to do what they do, and while we’ll certainly evolve, I don’t think they’ll change radically. What may change radically are the interfaces and the things you do on top of the OS (and certainly the hardware beneath the OS will continue to evolve too), and that’s what people obviously care about. - -The OS? It’s just that hidden thing that makes it all possible. You really shouldn’t care about it, unless you find it very interesting to know what is really going on in the machine. - -**Q: The last I heard, you were using a PPC G4/5 for your main personal machine — what are you using now, and why?** - -Linus: I ended up giving up on the PowerPC, since nobody is doing any workstations any more, and especially since x86-64 has become such an undeniable powerhouse. So these days, I run a bog-standard PC, with a normal Core 2 Duo on it. - -It was a lot of fun to run another architecture (I ran with alpha as my main architecture way back then, for a few years, so it wasn’t the first time either), but commodity CPUs is where it is at. The only thing that I think can really ever displace the x86 architecture would come from below, i.e., if something makes us not use x86 as our main ISA in a decade, I think it would be ARM, thanks to the mobile device market. - -**Q: What does Linux mean to you — a hobby, philosophy, the meaning of life, a job, the best OS, something else…?** - -Linus: It’s some of all of that. It’s a hobby, but a deeply meaningful one. The best hobbies are the ones that you care ‘really’ deeply about. And these days it’s obviously also my work, and I’m very happy to be able to combine it all. - -I don’t know about a ‘philosophy’, and I don’t really do Linux for any really deeply held moral or philosophical reasons (I literally do it because it’s interesting and fun), but it’s certainly the case that I have come to appreciate the deeper reasons why I think open source works so well. So I may not have started to do Linux for any such deep reasons, and I cannot honestly say that that is what motivates me, but I do end up thinking about why it all works. - -**Q: Did Microsoft’s ‘Men in Black’ ever talk to you?** - -Linus: I’ve never really talked to MS, no. I’ve occasionally been at the same conferences with some MS people (I used to go to more conferences than I do these days), but I’ve never really had anything to do with them. I think there is a mutual wariness. - --------------------------------------------------------------------------------- - -via: http://www.linuxveda.com/2015/06/17/what-happens-to-linux-after-linus/ - -作者:[Swapnil Bhartiya][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.linuxveda.com/author/arnieswap/ From c09f7390ba32369a936ff9f48f3854e0fb3e733c Mon Sep 17 00:00:00 2001 From: wi-cuckoo Date: Sun, 28 Jun 2015 15:05:47 +0800 Subject: [PATCH 487/965] mv to tran* --- .../20150618 What will be the future of Linux without Linus.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/talk/20150618 What will be the future of Linux without Linus.md (100%) diff --git a/sources/talk/20150618 What will be the future of Linux without Linus.md b/translated/talk/20150618 What will be the future of Linux without Linus.md similarity index 100% rename from sources/talk/20150618 What will be the future of Linux without Linus.md rename to translated/talk/20150618 What will be the future of Linux without Linus.md From c3564ae01735bba6078685e264e7fa3681649828 Mon Sep 17 00:00:00 2001 From: wwy-hust Date: Sun, 28 Jun 2015 16:06:31 +0800 Subject: [PATCH 488/965] finish translation & review --- ...0150616 Linux Humor on the Command-line.md | 129 ------------------ ...0150616 Linux Humor on the Command-line.md | 127 +++++++++++++++++ 2 files changed, 127 insertions(+), 129 deletions(-) delete mode 100644 sources/share/20150616 Linux Humor on the Command-line.md create mode 100644 translated/share/20150616 Linux Humor on the Command-line.md diff --git a/sources/share/20150616 Linux Humor on the Command-line.md b/sources/share/20150616 Linux Humor on the Command-line.md deleted file mode 100644 index 47f1d0eb26..0000000000 --- a/sources/share/20150616 Linux Humor on the Command-line.md +++ /dev/null @@ -1,129 +0,0 @@ -translating by wwy-hust - -Linux Humor on the Command-line -================================================================================ -The desktop is full of eye candy. It enhances the visual experience and, in some cases, can also increase functionality of software. But it also makes software fun. Working on the command-line does not have to be always serious. If you want some fun on the command-line, there are lots of commands to raise a smile. - -Linux is a fun operating system. Linux offers a vast collection of small open source utilities that perform functions ranging from the obvious to the bizarre. It is the quality and selection of these tools that help Linux stand out. Check out these 7 small utilities. - -### lolcat ### - -![lolcat](http://www.linuxlinks.com/portal/content/reviews/Misc/Screenshot-lolcat.png) - -lolcat is a program that concatenates files, or standard input, to standard output (like the generic cat), and adds rainbow coloring to it. - -lolcat is often combined with other tools such as toilet or figlet to generate text. This software should not be confused with a lolcat; an image macro of one or more cats. - -lolcat was written by Moe. - -Website: [github.com][1] - -### cowsay ### - -![cowsay](http://www.linuxlinks.com/portal/content/reviews/Misc/Screenshot-cowsay.png) - -cowsay is a configurable open source program which generates ASCII pictures of a cow with a message in a speech bubble. cowsay is written in Perl. - -cowsay is not limited to generating pictures of cows. It can generate pre-made images of other animals including a duck, elephant, koala, moose, pony, sheep, stegosaurus, and turkey, as well as cheese, snowman, and a skeleton. - -There is a related program called cowthink, which generates cows with thought bubbles, as opposed to speech bubbles. - -Features include: - -- Make scripts more interesting -- Borg mode -- Ways to alter the way the cow looks, for example making the cow look greedy, paranoid, stoned, tired, wired, youthful and more -- xcowsay variant available - -Website: [nog.net][2] - -### doge ### - -![doge](http://www.linuxlinks.com/portal/content/reviews/Misc/Screenshot-doge.png) - -doge is a simple motd script based on the slightly stupid but very funny doge meme. It prints random grammatically incorrect statements that are sometimes based on things from your computer. - -Doge is an Internet meme that became popular in 2013. The meme typically consists of a picture of a Shiba Inu accompanied by multicolored text in Comic Sans font in the foreground. The text, representing a kind of internal monologue, is deliberately written in a form of broken English. - -- Randomly placed and colored random strings, complete with broken english -- Awesome Shibe in the terminal -- Fetching of system data, such as hostname, running processes, current user and $EDITOR -- If you have lolcat, you can do this gem: while true; do doge | lolcat -a -d 100 -s 100 -p 1; done -- stdin support: ls /usr/bin | doge will doge-print some of the executables found in /usr/bin. wow. There are also multiple command line switches that control filtering and statistical frequency of words - -Website: [github.com/thiderman/doge][3] - -### ASCIIQuarium ### - -![Asciiquarium](http://www.linuxlinks.com/portal/content/reviews/Misc/Screenshot-Asciiquarium.png) - -ASCIIQuarium is an aquarium/sea animation in ASCII art. Enjoy the fascinating creatures that live in the water from your computer. - -To run ASCIIQuarium you need to have installed Perl's curses package, and the Term::Animation module. To install the former, type sudo apt-get install libcurses-perl. To install the latter, type sudo cpan Term::Animation, both at the command line. - -Features include: - -- Multicolored fish -- Amusing animations, including a fish hook -- There are swans, ducks, dolphins, and ships too - -Website: [www.robobunny.com][4] - -### sl - Steam Locomotive ### - -![sl](http://www.linuxlinks.com/portal/content/reviews/Misc/Screenshot-sl.png) - -sl is an amusing command line tool that displays animations to correct users who accidentally type sl instead of ls. - -I'm rather sloppy at typing, preferring speed to accuracy. But typos can be a tad dangerous on the command line. So sl can serve as a practical reminder of curing a bad habit of mistyping. It always raises a chuckle too. - -Features include: - -- With -F, train flies -- With -l, it shows a small train -- With -a, an accident seems to happen - -Website: [github.com/mtoyoda/sl][5] - -### aafire ### - -![aafire](http://www.linuxlinks.com/portal/content/reviews/Misc/Screenshot-aafire.png) - -aafire displays burning ASCII art flames in the terminal. It demonstrates the the capabilities of the aalib library, an ascii art library. - -Website: [aa-project.sourceforge.net/aalib][6] - -### CMatrix ### - -![CMatrix](http://www.linuxlinks.com/portal/content/reviews/Misc/Screenshot-CMatrix.png) - -CMatrix is an ncurses program that simulates the display from "The Matrix". If you have been living in a cave for the past 15 years, you might not know The Matrix is a 1999 American science fiction acting film starring Keanu Reeves, Laurence Fishburne, Carrie-Anne Moss, Hugo Weaving, and Joe Pantoliano. - -It works with terminal settings up to 132x300 and can scroll lines all at the same rate or asynchronously and at a user-defined speed. - -Features include: - -- Change the text colour -- Turn on bold characters -- Asynchronous scroll -- Use old-style scrolling -- "Screensaver" mode - -Website: [www.asty.org/cmatrix][7] - --------------------------------------------------------------------------------- - -via: http://www.linuxlinks.com/article/20150614112018846/Humor.html - -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[1]:https://github.com/busyloop/lolcat -[2]:https://web.archive.org/web/20120225123719/http://www.nog.net/%7Etony/warez/cowsay.shtml -[3]:https://github.com/thiderman/doge -[4]:http://www.robobunny.com/projects/asciiquarium/html/ -[5]:https://github.com/mtoyoda/sl -[6]:http://aa-project.sourceforge.net/aalib/ -[7]:http://www.asty.org/cmatrix/ diff --git a/translated/share/20150616 Linux Humor on the Command-line.md b/translated/share/20150616 Linux Humor on the Command-line.md new file mode 100644 index 0000000000..acd2fca4e7 --- /dev/null +++ b/translated/share/20150616 Linux Humor on the Command-line.md @@ -0,0 +1,127 @@ +LinuxеĬ +================================================================================ +ͨǷdz۵ģǿ˿ӻ飬ʱҲܹǿijЩĹܣԼøȤ¹ҲҪǺ࣬Щӣôкܶչ¶΢Ц + +LinuxǸȤIJϵͳṩСͿԴߣƽϡŹֵӦáЩߵͿѡ԰Linuxӱһ߸С߰ɡ + +### lolcat ### + +![lolcat](http://www.linuxlinks.com/portal/content/reviews/Misc/Screenshot-lolcat.png) + +lolcatһļ׼뵽׼һcatijΪ߲ʵɫ + +lolcatͨtoiletfigletıӦýʹáӦΪһèͼĺꡣ + +lolcatMoeд + +ַ: [github.com][1] + +### cowsay ### + +![cowsay](http://www.linuxlinks.com/portal/content/reviews/Misc/Screenshot-cowsay.png) + +cowsayһõĿԴASCIIţͼƬڶԻʾϢcowsayPerlдġ + +cowsayֻʾţԤͼƬѼӡ¹С򡢽ͻ𼦣Լҡѩ˺͹Ǽܡ + +һcowthinkӦãԻݲͬţͬʱ˼ݡ + +ܰ + +- ýűøȤ +- Borgģʽ +- Ըţӣţ̰ƫִִƣ롢Ź֡ +- ţ˵ݿ޸ + +ַ: [nog.net][2] + +### doge ### + +![doge](http://www.linuxlinks.com/portal/content/reviews/Misc/Screenshot-doge.png) + +dogeһЩ޴ȤdogeĹļ򵥵ÿϢűĴӡһЩ﷨ľӣʱЩӻеĶ + +dogeһ2013dzеĻԪأͨһձȮͼƬͲɫɡЩֹһŵдһЩĶס + +- òͬɫŵӢдľ +- նеIJȮЧdz +- ϵͳݣеij򡢵ǰû$EDITOR +- װlolcatΪ׺: while true; do doge | lolcat -a -d 100 -s 100 -p 1; done +- ׼֧: ls /usr/bin | doge ӡһЩ/usr/binµĿִļޡеĿؿԹ˴ԼƴƵʡ + +ַ: [github.com/thiderman/doge][3] + +### ASCIIQuarium ### + +![Asciiquarium](http://www.linuxlinks.com/portal/content/reviews/Misc/Screenshot-Asciiquarium.png) + +ASCIIQuariumһASCII뷽ʽˮ/󶯻ˮ׵ɡ + +ASCIIQuariumҪװPerlcursesԼTerm::Animationģ顣ʹsudo apt-get install libcurses-perlװǰߣʹsudo cpan Term::AnimationװߡҪնС + +ܰ + +- ʵ +- ȤĶ㹳 +- 졢Ѽӡʹֻ + +ַ: [www.robobunny.com][4] + +### sl - ### + +![sl](http://www.linuxlinks.com/portal/content/reviews/Misc/Screenshot-sl.png) + +slһȤնӦãΪЩĴlsslûʾһ + +Ҵͨdzʣϲٶȶ׼ȷԡǷdzΣյġslΪһʵʵߣעֻϰߡǻ˿Ц + +ܰ + +- ʹ -F, ڷ +- ʹ -l, ʾһС͵Ļ +- ʹ -a, ȥ + +ַ: [github.com/mtoyoda/sl][5] + +### aafire ### + +![aafire](http://www.linuxlinks.com/portal/content/reviews/Misc/Screenshot-aafire.png) + +aafireնʾȼյASCII档չʾһascii - aalibǿ + +ַ: [aa-project.sourceforge.net/aalib][6] + +### CMatrix ### + +![CMatrix](http://www.linuxlinks.com/portal/content/reviews/Misc/Screenshot-CMatrix.png) + +CMatrixһncursesijģ⡶ڿ͵۹һӰеĻ档һɽȹϸ15꣬ô֪ܲڿ͵۹1999ƻõӰΪ Keanu Reeves, Laurence Fishburne, Carrie-Anne Moss, Hugo Weaving Joe Pantoliano + +նΪ132x300¹ҿͬʽйûٶȽ첽Ĺ + +ܰ + +- ޸ıɫ +- ʹôַ +- 첽 +- ʹʽĹЧ +- Ļģʽ + +ַ: [www.asty.org/cmatrix][7] + +-------------------------------------------------------------------------------- + +via: http://www.linuxlinks.com/article/20150614112018846/Humor.html + +ߣ[wwy-hust](https://github.com/wwy-hust) +Уԣ[УID](https://github.com/УID) + + [LCTT](https://github.com/LCTT/TranslateProject) ԭ룬[Linuxй](https://linux.cn/) Ƴ + +[1]:https://github.com/busyloop/lolcat +[2]:https://web.archive.org/web/20120225123719/http://www.nog.net/%7Etony/warez/cowsay.shtml +[3]:https://github.com/thiderman/doge +[4]:http://www.robobunny.com/projects/asciiquarium/html/ +[5]:https://github.com/mtoyoda/sl +[6]:http://aa-project.sourceforge.net/aalib/ +[7]:http://www.asty.org/cmatrix/ \ No newline at end of file From b96f83d7ca35ca048d75434ba1d7fbff39ca6eee Mon Sep 17 00:00:00 2001 From: wwy Date: Sun, 28 Jun 2015 16:12:31 +0800 Subject: [PATCH 489/965] Update 20150309 Comparative Introduction To FreeBSD For Linux Users.md --- ...309 Comparative Introduction To FreeBSD For Linux Users.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/talk/20150309 Comparative Introduction To FreeBSD For Linux Users.md b/sources/talk/20150309 Comparative Introduction To FreeBSD For Linux Users.md index d29a75cb69..9e73930755 100644 --- a/sources/talk/20150309 Comparative Introduction To FreeBSD For Linux Users.md +++ b/sources/talk/20150309 Comparative Introduction To FreeBSD For Linux Users.md @@ -1,3 +1,5 @@ +translating by wwy-hust + Comparative Introduction To FreeBSD For Linux Users ================================================================================ ![](https://1102047360.rsc.cdn77.org/wp-content/uploads/2015/03/FreeBSD-790x494.jpg) @@ -95,4 +97,4 @@ via: https://www.unixmen.com/comparative-introduction-freebsd-linux-users/ 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 -[a]:https://www.unixmen.com/author/anis/ \ No newline at end of file +[a]:https://www.unixmen.com/author/anis/ From e9ed73d2b2d9ba745c5935d001256d446e64d096 Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 28 Jun 2015 16:19:58 +0800 Subject: [PATCH 490/965] PUB:20150623 Linux Kernel 4.1 Released This Is What's New @geekpi --- ... Kernel 4.1 Released This Is What's New.md | 61 ++++++++++++++++++ ... Kernel 4.1 Released This Is What's New.md | 63 ------------------- 2 files changed, 61 insertions(+), 63 deletions(-) create mode 100644 published/20150623 Linux Kernel 4.1 Released This Is What's New.md delete mode 100644 translated/news/20150623 Linux Kernel 4.1 Released This Is What's New.md diff --git a/published/20150623 Linux Kernel 4.1 Released This Is What's New.md b/published/20150623 Linux Kernel 4.1 Released This Is What's New.md new file mode 100644 index 0000000000..f49951e253 --- /dev/null +++ b/published/20150623 Linux Kernel 4.1 Released This Is What's New.md @@ -0,0 +1,61 @@ +Linux 4.1 带来了什么新东西? +================================================================================ +**一个新的Linux内核已经发布了 - 全世界为之心跳(我们想把它说的诗意一些)** + +Linus Torvalds(除了他不会有谁了)在Linux邮件列表(当然不会在别的地方)中[宣布][1],在大概两个月后迎来了[第一个4.x系列的Linux内核的发布][2]。 + +像每次发布前那样,Linux 4.1带来了很多的改变。它们包括了硬件兼容性、电源管理、文件系统性能、以及你从没听说过的处理器的技术修复。 + +Linux 4.1 已经进入将在10月发布的 Ubuntu 15.10 。 + +### Linux 4.1 有哪些新东西 ### + +![Tux got mail](http://www.omgubuntu.co.uk/wp-content/uploads/2015/06/linux-kernel-4-11-350x200.jpg) + +*Tux 收到了邮件* + +这个标题只是说说而已,我们不是简单地将发布公告贴到这里。 + +我们会从(大量、冗长以及那些不明觉厉的的技术的)更改日志去挑选一些对桌面用户而言,不见得夸张但或许有用的亮点。 + +#### 电源管理 #### + +你可以在Linux 4.1中找到的面向用户的一大特性是对 Intel 的 Cherry Trail 和 Bay Trai 芯片、Soc及Intel计算棒等设备的性能及能效的提升。 + +传闻建议是Linux 4.1给出了新的Intel硬件组合,和更长电池寿命。这么多的进步自然不可能针对所有芯片,它只对特定芯片和系统(和高端的)有用,但仍旧是一个令人兴奋的消息。 + +**Linux 4.1 亮点包括:** + +- ext4 有了文件系统层面的加密(感谢Google) +- 罗技游戏手柄lg4ff驱动改进了‘力反馈’ +- 东芝笔记本驱动进行了USB睡眠充电和背光改进 +- Xbox One控制器支持Rumble +- Wacom平板驱动改进了电源报告 +- 各种针对arm和x86设备电源管理改进 +- Samsung Exynos 3250 电源管理改进 +- 支持Bamboo平板 +- 联想OneLink Pro Dock获得USB支持 +- 支持Realtek 8723A、 8723B、 8761A、 8821 Wi-Fi网卡 + +### Ubuntu中安装Linux 4.1 ### + +虽然这次发布的内核被标记为稳定,但是Ubuntu用户并不需要迫切地安装它。 + +但如果你等不及了并且技术足够熟练,你可以从[Canonical的主干内核归档][3]中下载合适的软件包来安装Linux 4.1(或者冒着风险使用第三方PPA)。 + +10月发布的Ubuntu 15.10 Wily Werewolf将会基于Ubuntu Kernel 4.1.x(Ubuntu内核是基于Linux内核加上Ubuntu没被上流接受的独有补丁)。 + +-------------------------------------------------------------------------------- + +via: http://www.omgubuntu.co.uk/2015/06/linux-4-1-kernel-new-features + +作者:[Joey-Elijah Sneddon][a] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://plus.google.com/117485690627814051450/?rel=author +[1]:https://lkml.org/lkml/2015/6/22/8 +[2]:http://www.omgubuntu.co.uk/2015/04/linux-kernel-4-0-new-features +[3]:http://kernel.ubuntu.com/~kernel-ppa/mainline/?C=N;O=D diff --git a/translated/news/20150623 Linux Kernel 4.1 Released This Is What's New.md b/translated/news/20150623 Linux Kernel 4.1 Released This Is What's New.md deleted file mode 100644 index 11b9c10a26..0000000000 --- a/translated/news/20150623 Linux Kernel 4.1 Released This Is What's New.md +++ /dev/null @@ -1,63 +0,0 @@ -Linux 4.1 发布了,下面是有哪些新的 -================================================================================ -**TuxlogoA brand new version of the Linux Kernel — the heartbeat of the modern world (if we you want us to be poetic about it) — has been released.** -**一个心的Linux内核 - 现代世界的心跳(如果我们想要让它充满诗意)已经发布了** - -![](http://www.omgubuntu.co.uk/wp-content/uploads/2011/07/Tux-psd3894.jpg) - -Linus Torvalds(还有谁?)在Linux邮件列表(还有哪里)中[宣布了][1]内核发布,同事也是大概两个月后迎来了[第一个4.x系列的发布][2]。 - -快速之外,像每次发布前那样,Linux 4.1带来了很大的改变。它从硬件兼容性到电源管理到文件系统性能到和你从没听说过的处理器的技术修复。 - -Linux 4.1 已经进入Ubuntu 15.10, 将在10月发布。 - -### Linux 4.1 有哪些新的 ### - -![Tux got mail](http://www.omgubuntu.co.uk/wp-content/uploads/2015/06/linux-kernel-4-11-350x200.jpg) -Tux邮件 - -子标题在嘴上,我们不会简单地就宣布公告。 - -我们从(大量冗长的及不能理解的技术)更改日志去挑选一些对桌面用户而言,不见得夸张但或许有用的亮点。 - -#### 电源管理 #### - -你在Linux 4.1中面向用户的一大特性是对Intel Cherry Trail 和 Bay Trai 芯片的丰富性能以及电源效率的提升。Soc设备,如Intel计算棒。 - -传闻建议是Linux 4.1给出了新的Intel硬件组合,和更长电池守密。这么高的受益不可能针对任何芯片,它只对特定芯片和系统(和高端的)有用,但仍旧是一个令人兴奋的消息。 - -**Linux 4.1 亮点包括:** - -- ext4获得了文件系统层面的加密(感谢Google) -- 罗技游戏手柄lg4ff驱动提升‘力量反馈’ -- 东芝笔记本驱动获得USB睡眠充电和背光提升 -- Xbox One控制器支持 -- Wacom平板中更好的电源报告驱动 -- 不同的杂项。arm和x86设备电源管理提升 -- Samsung Exynos 3250 电源管理 -- 支持Bamboo屏板 -- 联想OneLink Pro Dock获得USB支持 -- 支持Realtek 8723A、 8723B、 8761A、 8821 Wi-Fi网卡 - -### Ubuntu中安装Linux 4.1 ### - -虽然这次发布的内核被标记为稳定,但是Ubuntu用户没有迫切需要区安装它。 - -如果你等不及了并且技术足够熟练,你可以从[Canonical的主流内核归档][3]中下载合适的来安装Linux 4.1(或者冒着风险使用第三方PPA)。 - -10月发布的Ubuntu 15.10 Wily Werewolf将会基于Ubuntu Kernel 4.1.x(Ubuntu内核是基于Linux内核加上Ubuntu没被上流接受的独有补丁)。 - --------------------------------------------------------------------------------- - -via: http://www.omgubuntu.co.uk/2015/06/linux-4-1-kernel-new-features - -作者:[Joey-Elijah Sneddon][a] -译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://plus.google.com/117485690627814051450/?rel=author -[1]:https://lkml.org/lkml/2015/6/22/8 -[2]:http://www.omgubuntu.co.uk/2015/04/linux-kernel-4-0-new-features -[3]:http://kernel.ubuntu.com/~kernel-ppa/mainline/?C=N;O=D From c627ae8cb9bab6ddaa5a1237a4af1eb0c90d0f25 Mon Sep 17 00:00:00 2001 From: ictlyh Date: Sun, 28 Jun 2015 20:33:17 +0800 Subject: [PATCH 491/965] [Translating] tech/20150527 How to edit your documents collaboratively on Linux.md --- ...150527 How to edit your documents collaboratively on Linux.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20150527 How to edit your documents collaboratively on Linux.md b/sources/tech/20150527 How to edit your documents collaboratively on Linux.md index 91d2bf6441..5b528e6165 100644 --- a/sources/tech/20150527 How to edit your documents collaboratively on Linux.md +++ b/sources/tech/20150527 How to edit your documents collaboratively on Linux.md @@ -1,3 +1,4 @@ +ictlyh Translating How to edit your documents collaboratively on Linux ================================================================================ > "Developed many years before by some high-strung, compulsive assistant, the Bulletin was simply a Word document that lived in a shared folder both Emily and I could access. Only one of us could open it at a time and add a new message, thought, or question to the itemized list. Then we'd print out the updated version and place it on the clipboard that sat on the shelf over my desk, removing the old ones as we went." ("The Devil Wears Prada" by Lauren Weisberger) From f52c472f4c9fc28dc63e17c503a7dd0daf10a3be Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 28 Jun 2015 23:07:40 +0800 Subject: [PATCH 492/965] PUB:20141013 Compact Text Editors Great for Remote Editing and Much More @wwy-hust --- ... Great for Remote Editing and Much More.md | 222 ++++++++++++++++++ ... Great for Remote Editing and Much More.md | 214 ----------------- 2 files changed, 222 insertions(+), 214 deletions(-) create mode 100644 published/20141013 Compact Text Editors Great for Remote Editing and Much More.md delete mode 100644 translated/share/20141013 Compact Text Editors Great for Remote Editing and Much More.md diff --git a/published/20141013 Compact Text Editors Great for Remote Editing and Much More.md b/published/20141013 Compact Text Editors Great for Remote Editing and Much More.md new file mode 100644 index 0000000000..8915ff5006 --- /dev/null +++ b/published/20141013 Compact Text Editors Great for Remote Editing and Much More.md @@ -0,0 +1,222 @@ +适合于远程编辑以及更多环境的简洁文本编辑器 +================================================================================ +文本编辑器是用来编辑纯文本的软件。这种软件有许多用处,包括修改配置文件,编写程序源代码,记下一些想法或者甚至写一份购物列表。由于这种编辑器能都用于许多不同的方面,因此值得花些时间找一个最适合您喜好的编辑器。 + +不论编辑器有多么复杂,它们通常有一个共同的功能集,包括查找/替换文本,格式化文本,导入文件以及在文件中移动文本。 + +所有这些文本编辑器都是基于终端的应用,因此他们很适合在远程主机上编辑文件。文本编辑器通常也会提供一个图形化的用户界面,但依旧会保证快速和精简。 + +基于终端的应用程序在系统资源方面也是轻量级的(在低配置机器上很有用),比起它的图形化版本来也会更快、更高效,由于它们在X需要重启时也不会停止工作,因此非常适合编写脚本。 + +我选择了一些我最喜欢的开源文本编辑器,他们在使用系统资源方面都非常节俭。 + + + +### Textadept ### + +![](http://www.linuxlinks.com/portal/content/reviews/Editors/Screenshot-Textadept.png) + +Textadept是一款适合程序员的,快速、精简、可扩展、跨平台的开源文本编辑器。这个开源程序由C和Lua写就,并且于这些年间在速度和精简方面进行了优化。 + +Textadept是那些想要无限的扩展性且不愿牺牲速度或屈服于代码膨胀的程序员们的理想编辑器。 + +它也有一个用于终端的版本,仅仅依赖ncurses,适合在远程主机上进行编辑。 + +#### 功能包括: #### + +- 轻量级 +- 精简设计以最大化利用屏幕 +- 自包含的执行文件 - 无需安装 +- 全键盘驱动 +- 无限制的分割视图(GUI版本),以您所好任意水平或垂直的分割编辑器窗口。请注意Textadep不是一个选项卡式的编辑器。 +- 支持多达80种的编程语言 +- 强大的代码片段和快捷键命令 +- 代码自动补全和API查询 +- 无与伦比的扩展性 +- 书签 +- 查找和替换 +- 在文件中查找 +- 基于缓存的单词补全 +- 成熟的编程语言符号自动补全,以及显示API文档的功能 +- 主题:亮色、暗色、终端 +- 使用词法分析器将名称放到缓冲中,如评论、字符串、关键词 +- 支持会话 +- 快速打开 +- 许多可用的模块,包括对Java、Python、Ruby和近期打开文件列表的支持 +- 符合Gnome HIG用户接口的指导 +- 支持编辑Lua代码。许多Textadept对象和Lua的标准库支持语法自动补全和LuaDoc。 + +--- + +- 网址: [foicica.com/textadept][1] +- 开发者: Mitchell and contributors +- 许可证: MIT License +- 版本号: 7.7 + + +### Vim ### + +![](http://www.linuxlinks.com/portal/content/reviews/Editors/Screenshot-vim.png) + +vim是一个高级的文本编辑器,它在'vi'强大的基础上,并拥有更全面的功能集。 + +这个编辑器对编程和编辑其他纯ASCII的文件十分有用。所有的命令都由普通的键盘按键提供,能够使用十指来输入,因而十分快捷。另外,功能键可以由用户来定义,并且可也以使用鼠标。 + +Vim通常被称作"程序员的编辑器",它十分适合于编程,并被认为可以作为完整的集成开发环境。然而,这个软件并不是仅仅面向程序员。Vim适合于各种文本编辑,从编写email到修改配置文件。 + +Vim的界面基于文本界面下的命令行。尽管它的图形化版本gVim为常用的命令添加了菜单和工具栏,但这个软件的整个功能依旧依赖于它的命令行模式。 + +#### 功能包括: #### + +- 3 种模式: + - 命令模式 + - 插入模式 + - 命令行模式 +- 无限制的撤销 +- 多个窗口和缓冲区 +- 平滑的插入模式 +- 根据所编辑的文件的类型使用不同的颜色或风格进行语法高亮 +- 交互命令 + - 标记一行 + - vi 行缓冲 + - 移动代码块 +- 块操作 +- 命令行历史 +- 扩展的正则表达式 +- 可编辑压缩/打包文件 (gzip, bzip2, zip, tar) +- 文件名补全 +- 标记跳转 +- 折叠文本 +- 缩进 +- ctags和cscope整合 +- 100%与vi的模式兼容 +- 插件用于添加/扩展功能 +- 宏 +- vimscript, Vim的内部脚本 +- Unicode支持 +- 多语言支持 +- 在线帮助支持 + +--- + +- 网址: [www.vim.org][2] +- 开发者: Bram Moolenaar +- 许可证: GNU GPL compatible (charityware) +- 版本号: 7.4 + + + +### ne ### + +![](http://www.linuxlinks.com/portal/content/reviews/Editors/Screenshot-ne.png) + +ne是一款全屏幕的开源文本编辑器。它像是一个比vi更容易学习的vi替代物,并且可以在POSIX-兼容的系统中便携使用。 + +ne对于新手来说易于使用,但也非常强大并有完全可配置的引导程序,并且在资源使用上十分节约。 + +#### 功能包括: #### + +- 三种用户界面: 控制键,命令行、菜单;按键和菜单都可配置 +- 语法高亮 +- 对于UTF-8文件的完全支持,包括占据多列的字符(宽字符) +- 文档,剪切块,显示的维度和文件/行号长度都有编号,并且仅受制于机器的整型字长 +- 简单的脚本语言,脚本可以用简单易理解的录制/播放的方式制作 +- 无限制的撤销/重做功能(可以通过命令禁用) +- 基于被编辑的文件扩展名的自动个性化配置系统 +- 使用您文档中的词语做字典来进行自动前缀补全 +- 易用的文件存取功能 +- 扩展的正则表达式可用于查找和替换,类似emacs和vi +- 非常紧凑的内存模型,在加载和修改大型文件时十分快速 +- 可编辑二进制文件 + +--- + +- 网址: [ne.di.unimi.it][3] +- 开发者: Sebastiano Vigna (original developer). Additional features added by Todd M. Lewis +- 许可证: GNU GPL v3 +- 版本号: 2.5 + +---------- + +### Zile ### + +![](http://www.linuxlinks.com/portal/content/reviews/Editors/Screenshot-Zile.png) + +Zile(Zile Is Lossy Emacs,Emacs精简版),它是一个小型的Emacs的克隆版。Zile是一个可定制的,自文档化,实时显示的编辑器,Zile被开发的尽可能像Emacs一样,每个Emacs用户都会对Zile感到亲切。 + +Zile以它极小的RAM用量,大约130KB,以及快速开始编辑而闻名。它是支持8比特字符集的,允许用于编写任何种类的文件。 + +#### 功能包括: #### + +- 小型但快速、强大 +- 多个缓冲区,允许多级的撤销 +- 多窗口 +- 以最小的缓冲区完成补全 +- 自动填充 (自动换行) +- Registers +- 看起来像Emacs,键序列、功能和变量名都与Emacs相同 +- Killing +- Yanking +- 自动行末检测 + +--- + +- 网址: [www.gnu.org/software/zile][4] +- 开发者: Reuben Thomas, Sandro Sigala, David A. Capello +- 许可证: GNU GPL v2 +- 版本号: 2.4.11 + + + +### nano ### + +![](http://www.linuxlinks.com/portal/content/reviews/Editors/Screenshot-nano.png) + +nano是基于curses库的文本编辑器。它是Pico(Pine电子邮件客户端编辑器)的一个复刻版。 + +由于Pine套件的许可证问题诉讼案(Pine并未以开源许可证发布),并且也因为Pine缺少一些重要的功能,nano项目于1999年发起。 + +nano致力于赶上Pico的功能和其易用性,与此同时提供更多的功能,但不集成Pine/Pico的邮件客户端。 + +nano像Pico一样是以键盘为导向的设计,可以用控制键来控制。 + +#### 功能包括: #### + +- 交互式的查找和替换 +- 彩色语法高亮 +- 转到行号和列号处 +- 自动缩进 +- 功能开关 +- 支持UTF-8 +- 混合型的文件类型自动转换 +- 逐字输入模式 +- 多个文件缓冲区 +- 平滑滚动 +- 括号匹配 +- 自定义引用字符串 +- 备份文件 +- 国际化支持 +- tab补全文件名 + +--- + +- 网址: [nano-editor.org][5] +- 开发者: Chris Allegretta, David Lawrence, Jordi Mallach, Adam Rogoyski, Robert Siemborski, Rocco Corsi, David Benbennick, Mike Frysinger +- 许可证: GNU GPL v3 +- 版本号: 2.2.6 + +-------------------------------------------------------------------------------- + +via: http://www.linuxlinks.com/article/20141011073917230/TextEditors.html + +作者:Frazer Kline +译者:[wwy-hust](https://github.com/wwy-hust) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[1]:http://foicica.com/textadept/ +[2]:http://www.vim.org/ +[3]:http://ne.di.unimi.it/ +[4]:http://www.gnu.org/software/zile/ +[5]:http://nano-editor.org/ diff --git a/translated/share/20141013 Compact Text Editors Great for Remote Editing and Much More.md b/translated/share/20141013 Compact Text Editors Great for Remote Editing and Much More.md deleted file mode 100644 index 766f429ba0..0000000000 --- a/translated/share/20141013 Compact Text Editors Great for Remote Editing and Much More.md +++ /dev/null @@ -1,214 +0,0 @@ -ʺԶ̱༭Լ໷ļı༭ -================================================================================ -ı༭༭ıô޸ļдԴ룬һЩ뷨дһݹбֱ༭ܶ಻ͬĻֵûЩʱһʺϲõı༭ - -۱༭жôӣͨһͬĹܼ/滻ıʽıļԼļƶı - -Щı༭ǻն˵ӦãǺʺԶϱ༭ļı༭ͨҲṩһͼλû棬ɻᱣ֤ٺС - -ն˵ӦóϵͳԴҲģڵûϺãͼλ汾Ҳ졢ЧXҪʱҲֹͣ˷dzʺϱдű - -ѡһЩϲĿԴı༭ʹϵͳԴ涼dzڼ - ----------- - -### Textadept ### - -![](http://www.linuxlinks.com/portal/content/reviews/Editors/Screenshot-Textadept.png) - -TextadeptһʺϳԱģ١Сչƽ̨ĿԴı༭ԴCLuaдͣЩٶȺСŻ - -TextadeptЩҪ޵չҲԸٶȻڴ͵ijԱǵ༭ - -Ҳһն˵İ汾ncursesʺԶϽб༭ - -#### ܰ: #### - -- -- СĻ -- ԰ִļ - 谲װ -- ȫ -- ƵķָͼGUI汾ˮƽֱķָ༭ڡעTextadeptûдļǩ -- ֶ֧80ֵı -- ǿƬο -- ԶȫAPIѯ -- ױȵչ -- ǩ -- Һ滻 -- ļв -- ڻĵʲȫ -- ıԷԶȫԼʾAPIĵĹ -- ⣺ڰն -- ʹôʷƷԪأַۡؼ -- Զ̻Ự -- ٴ -- õģ飬JavaPythonRubyͽڴļб֧ -- Gnome HIGûӿڵָ -- ֱ֧༭Lua롣﷨ԶȫLuaDocTextadeptLuaı׼⡣ - -- ַ: [foicica.com/textadept][1] -- : Mitchell and contributors -- ֤: MIT License -- 汾: 7.7 - ----------- - -### Vim ### - -![](http://www.linuxlinks.com/portal/content/reviews/Editors/Screenshot-vim.png) - -vimһ߼ı༭'vi'ǿ󣬲ӵиȫĹܼ - -༭Ա̺ͱ༭ASCIIļʮáеͨļַṩܹʹʮָ룬ʮֿݡ⣬ܼû壬ҿҲʹꡣ - -Vimͨ"Աı༭"ʮʺڱ̣ΪΪļɿȻǽԱVim߶Ӹı༭ӱдemail޸ļ - -VimĽӿڻıµСͼλ汾gVimΪõ˲˵͹ģʽ - -#### ܰ: #### - -- 3 ģʽ: -- - Command ģʽ -- - Insert ģʽ -- - Command line ģʽ -- Ƶij -- ںͻ -- ƽģʽ -- ༭ļʹòͬɫ﷨ -- -- - һ -- - vi л -- - ƶ -- -- ʷ -- չʽ -- ༭ѹ/ļ (gzip, bzip2, zip, tar) -- ļȫ -- ת -- ۵ı -- -- ctagscscope -- 100%viģʽ -- /չ -- -- vimscript, Vimڲű -- Unicode֧ -- ֧ -- ֧߰ - -- ַ: [www.vim.org][2] -- : Bram Moolenaar -- ֤: GNU GPL compatible (charityware) -- 汾: 7.4 - ----------- - -### ne ### - -![](http://www.linuxlinks.com/portal/content/reviews/Editors/Screenshot-ne.png) - -neһȫĻĿԴı༭һviѧϰviҿPOSIX-ݵϵͳбЯʹá - -ne˵ʹãҲdzǿȫõ򣬲ԴʹʮֽԼ - -#### ܰ: #### - -- ûӿڣ ƻкͲ˵Ͳ˵ -- ﷨ -- UTF-8ļȫַ֧֣ -- ĵУʾάȺļ/кųȶбţҽڻֳ -- 򵥵Ľűԣűü¼/ŵķʽ -- Ƶij/ܣͨã -- ڱ༭ļչԶԻϵͳ -- ʹĵеĴֵԶǰ׺ȫ -- õļȡ -- չʽڲҺ滻emacsvi -- dzյڴģͣڼغ޸Ĵļʱʮֿ -- ɱ༭ļ - -- ַ: [ne.di.unimi.it][3] -- : Sebastiano Vigna (original developer). Additional features added by Todd M. Lewis -- ֤: GNU GPL v3 -- 汾: 2.5 - ----------- - -### Zile ### - -![](http://www.linuxlinks.com/portal/content/reviews/Editors/Screenshot-Zile.png) - -ZileLossy EmacsEmacs棩һС͵EmacsĿ¡档ZileһɶƵģĵʵʱʾı༭ڱдZileʱEmacsһܵСÿEmacsûZileеС - -ZileСRAMԼ130KBԼٿʼ༭8ģڱдκļ - -#### ܰ: #### - -- С͵١ǿ -- ༶ij -- ര -- ã̫ô롿 -- СĻɲȫ -- Զ (Զ) -- Ĵͼ -- EmacsСܺͱEmacsͬ -- Killing -- Yanking -- Զĩ - -- ַ: [www.gnu.org/software/zile][4] -- : Reuben Thomas, Sandro Sigala, David A. Capello -- ֤: GNU GPL v2 -- 汾: 2.4.11 - ----------- - -### nano ### - -![](http://www.linuxlinks.com/portal/content/reviews/Editors/Screenshot-nano.png) - -nanoǻcursesı༭PicoPineʼͻ˱༭һ̰档 - -Pine֤ϰPineδԿԴ֤ҲΪPineȱһЩҪĹܣnanoĿ1999꿪ʼ - -nanoڸPicoĹܺԣͬʱṩĹܣPine/Picoʼͻˡ - -nanoPicoһԼΪƣÿƼơ - -#### ܰ: #### - -- ʽIJҺ滻 -- ɫ﷨ -- תкźкŴ -- Զ -- ܿ -- ֧UTF-8 -- ͵ļԶת -- ģʽ -- ļ -- ƽ -- ƥ -- Զַ -- ļ -- ʻ֧ -- tabȫļ - -- ַ: [nano-editor.org][5] -- : Chris Allegretta, David Lawrence, Jordi Mallach, Adam Rogoyski, Robert Siemborski, Rocco Corsi, David Benbennick, Mike Frysinger -- ֤: GNU GPL v3 -- 汾: 2.2.6 - --------------------------------------------------------------------------------- - -via: http://www.linuxlinks.com/article/20141011073917230/TextEditors.html - -ߣFrazer Kline -ߣ[wwy-hust](https://github.com/wwy-hust) -Уԣ[УID](https://github.com/УID) - - [LCTT](https://github.com/LCTT/TranslateProject) ԭ룬[Linuxй](http://linux.cn/) Ƴ - -[1]:http://foicica.com/textadept/ -[2]:http://www.vim.org/ -[3]:http://ne.di.unimi.it/ -[4]:http://www.gnu.org/software/zile/ -[5]:http://nano-editor.org/ From dc02eb35dc83392f83ba90a184920dac36e229e5 Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 28 Jun 2015 23:40:05 +0800 Subject: [PATCH 493/965] PUB:20150528 27 'DNF' Fork of Yum Commands for RPM Package Management in Linux @wwy-hust --- ...nds for RPM Package Management in Linux.md | 287 ++++++++++++++++++ ...nds for RPM Package Management in Linux.md | 287 ------------------ 2 files changed, 287 insertions(+), 287 deletions(-) create mode 100644 published/20150528 27 'DNF' Fork of Yum Commands for RPM Package Management in Linux.md delete mode 100644 translated/tech/20150528 27 'DNF' Fork of Yum Commands for RPM Package Management in Linux.md diff --git a/published/20150528 27 'DNF' Fork of Yum Commands for RPM Package Management in Linux.md b/published/20150528 27 'DNF' Fork of Yum Commands for RPM Package Management in Linux.md new file mode 100644 index 0000000000..89266f8b0d --- /dev/null +++ b/published/20150528 27 'DNF' Fork of Yum Commands for RPM Package Management in Linux.md @@ -0,0 +1,287 @@ +27 个 Linux 下软件包管理工具 DNF 命令例子 +================================================================================ +DNF即Dandified YUM,是基于RPM的Linux发行版的下一代软件包管理工具。它首先在Fedora 18中出现,并且在最近发行的Fedora 22中替代了[YUM工具集][1]。 + +![](http://www.tecmint.com/wp-content/uploads/2015/05/linux-dnf-command-examples.jpg) + +DNF致力于改善YUM的瓶颈,即性能、内存占用、依赖解决、速度和许多其他方面。DNF使用RPM、libsolv和hawkey库进行包管理。尽管它并未预装在CentOS和RHEL 7中,但您可以通过yum安装,并同时使用二者。 + +您也许想阅读更多关于DNF的信息: + +- [使用DNF取代Yum背后的原因][2] + +最新的DNF稳定版本是2015年5月11日发布的1.0(在写这篇文章之前)。它(以及所有DNF之前版本)主要由Python编写,并以GPL v2许可证发布。 + +### 安装DNF ### + +尽管Fedora 22官方已经过渡到了DNF,但DNF并不在RHEL/CentOS 7的默认仓库中。 + +为了在RHEL/CentOS系统中安装DNF,您需要首先安装和开启epel-release仓库。 + + # yum install epel-release + 或 + # yum install epel-release -y + +尽管并不建议在使用yum时添上'-y'选项,因为最好还是看看什么将安装在您的系统中。但如果您对此并不在意,则您可以使用'-y'选项以自动化的安装而无需用户干预。 + +接下来,使用yum命令从epel-realease仓库安装DNF包。 + + # yum install dnf + +在您装完dnf后,我会向您展示27个实用的dnf命令和例子,以便帮您更容易和高效的管理基于RPM包的发行版。 + +### 1. 检查DNF版本 ### + +检查您的系统上安装的DNF版本。 + + # dnf --version + +![检查DNF版本](http://www.tecmint.com/wp-content/uploads/2015/05/Check-DNF-Version.gif) + +### 2. 列出启用的DNF仓库 ### + +dnf命令中的'repolist'选项将显示您系统中所有启用的仓库。 + + # dnf repolist + +![检查所有开启的仓库](http://www.tecmint.com/wp-content/uploads/2015/05/Check-All-Enabled-Repositories.gif) + +### 3. 列出所有启用和禁用的DNF仓库 ### + +'repolist all'选项将显示您系统中所有启用/禁用的仓库。 + + # dnf repolist all + +![列出所有启用/禁用的仓库](http://www.tecmint.com/wp-content/uploads/2015/05/Check-All-Repositories.gif) + +### 4. 用DNF列出所有可用的且已安装的软件包 ### + +'dnf list'命令将列出所有仓库中所有可用的软件包和您Linux系统中已安装的软件包。 + + # dnf list + +![用DNF列出所有的软件包](http://www.tecmint.com/wp-content/uploads/2015/05/List-All-Packages.png) + +### 5. 用DNF列出所有已安装的软件包 ### + +尽管'dnf list'命令将列出所有仓库中所有可用的软件包和已安装的软件包。然而像下面一样使用'list installed'选项将只列出已安装的软件包。 + + # dnf list installed + +![列出已安装的软件包](http://www.tecmint.com/wp-content/uploads/2015/05/List-Installed-Packages.png) + +### 6. 用DNF列出所有可用的软件包 ### + +类似的,可以用'list available'选项列出所有开启的仓库中所有可用的软件包。 + + # dnf list available + +![用DNF列出可用的软件包](http://www.tecmint.com/wp-content/uploads/2015/05/List-Available-Packages.png) + +### 7. 使用DNF查找软件包 ### + +如果您不太清楚您想安装的软件包的名字,这种情况下,您可以使用'search'选项来搜索匹配该字符(例如,nano)和字符串的软件包。 + + # dnf search nano + +![通过关键字搜索软件包](http://www.tecmint.com/wp-content/uploads/2015/05/Search-Package.gif) + +### 8. 查看哪个软件包提供了某个文件/子软件包? ### + +dnf的选项'provides'能查找提供了某个文件/子软件包的软件包名。例如,如果您想找找哪个软件包提供了您系统中的'/bin/bash'文件,可以使用下面的命令 + + # dnf provides /bin/bash + +![查找提供文件的软件包](http://www.tecmint.com/wp-content/uploads/2015/05/Find-Package-Sub-Package.gif) + +### 9. 使用DNF获得一个软件包的详细信息 ### + +如果您想在安装一个软件包前知道它的详细信息,您可以使用'info'来获得一个软件包的详细信息,例如: + + # dnf info nano + +![用DNF查看软件信息](http://www.tecmint.com/wp-content/uploads/2015/05/Check-Package-Information.gif) + +### 10. 使用DNF安装软件包 ### + +想安装一个叫nano的软件包,只需运行下面的命令,它会为nano自动的解决和安装所有的依赖。 + + # dnf install nano + +![用DNF安装软件](http://www.tecmint.com/wp-content/uploads/2015/05/Install-Package-DNF.gif) + +### 11. 使用DNF更新一个软件包 ### + +您可能只想更新一个特定的包(例如,systemd)并且保留系统内剩余软件包不变。 + + # dnf update systemd + +![更新一个软件包](http://www.tecmint.com/wp-content/uploads/2015/05/Update-a-Package.gif) + +### 12. 使用DNF检查系统更新 ### + +检查系统中安装的所有软件包的更新可以简单的使用如下命令: + + # dnf check-update + +![检查系统更新](http://www.tecmint.com/wp-content/uploads/2015/05/Check-For-System-Update.gif) + +### 13. 使用DNF更新系统中所有的软件包 ### + +您可以使用下面的命令来更新整个系统中所有已安装的软件包。 + + # dnf update + 或 + # dnf upgrade + +![更新系统](http://www.tecmint.com/wp-content/uploads/2015/05/Update-System.gif) + +### 14. 使用DNF来移除/删除一个软件包 ### + +您可以在dnf命令中使用'remove'或'erase'选项来移除任何不想要的软件包。 + + # dnf remove nano + 或 + # dnf erase nano + +![移除系统中的软件](http://www.tecmint.com/wp-content/uploads/2015/05/Remove-Package.gif) + +### 15. 使用DNF移除于依赖无用的软件包(Orphan Packages) ### + +这些为了满足依赖安装的软件包在相应的程序删除后便不再需要了。可以用过下面的命令来将它们删除。 + + # dnf autoremove + +![移除无用的依赖包](http://www.tecmint.com/wp-content/uploads/2015/05/Autoremove-Packages.gif) + +### 16. 使用DNF移除缓存的软件包 ### + +我们在使用dnf时经常会碰到过期的头部信息和不完整的事务,它们会导致错误。我们可以使用下面的语句清理缓存的软件包和包含远程包信息的头部信息。 + + # dnf clean all + +![移除DNF缓存](http://www.tecmint.com/wp-content/uploads/2015/05/Remove-Cache-Packages.gif) + +### 17. 获得特定DNF命令的帮助 ### + +您可能需要特定的DNF命令的帮助(例如,clean),可以通过下面的命令来得到: + + # dnf help clean + +![获得某一命令帮助](http://www.tecmint.com/wp-content/uploads/2015/05/Help-on-DNF-Command.gif) + +### 18. 列出所有DNF的命令和选项 ### + +要显示所有dnf的命令和选项,只需要: + + # dnf help + +![获得命令选项帮助](http://www.tecmint.com/wp-content/uploads/2015/05/DNF-Options.gif) + +### 19. 查看DNF的历史记录 ### + +您可以调用'dnf history'来查看已经执行过的dnf命令的列表。这样您便可以知道什么被安装/移除及其时间戳。 + + # dnf history + +![查看历史记录](http://www.tecmint.com/wp-content/uploads/2015/05/Check-DNF-History.gif) + +### 20. 显示所有软件包组 ### + +'dnf grouplist'命令可以显示所有可用的或已安装的软件包,如果没有什么输出,则它会列出所有已知的软件包组。 + + # dnf grouplist + +![列出所有软件包组](http://www.tecmint.com/wp-content/uploads/2015/05/List-All-Group-Packages.gif) + +### 21. 使用DNF安装一个软件包组 ### + +要安装一组由许多软件打包在一起的软件包组(例如,Educational Softaware),只需要执行: + + # dnf groupinstall 'Educational Software' + +![安装一个软件包组](http://www.tecmint.com/wp-content/uploads/2015/05/Install-Group-Packages.gif) + +### 22. 更新一个软件包组 ### + +可以通过下面的命令来更新一个软件包组(例如,Educational Software): + + # dnf groupupdate 'Educational Software' + +![更新软件包组](http://www.tecmint.com/wp-content/uploads/2015/05/Update-Group-Package.gif) + +### 23. 移除一个软件包组 ### + +可以使用下面的命令来移除一个软件包组(例如,Educational Software): + + # dnf groupremove 'Educational Software' + +![移除软件包组](http://www.tecmint.com/wp-content/uploads/2015/05/Remove-Group-Package.gif) + +### 24. 从某个特定的仓库安装一个软件包 ### + +DNF可以从任何特定的仓库(比如 epel)安装一个软件包(例如,phpmyadmin): + + # dnf --enablerepo=epel install phpmyadmin + +![从特定的仓库安装软件](http://www.tecmint.com/wp-content/uploads/2015/05/Install-Package-From-Specific-Repo.gif) + +### 25. 将已安装的软件包同步到稳定发行版 ### + +'dnf distro-sync'将同步所有已安装的软件包到所有开启的仓库中最近的稳定版本。如果没有选择软件包,则会同步所有已安装的软件包。 + + # dnf distro-sync + +![将包同步至稳定版](http://www.tecmint.com/wp-content/uploads/2015/05/Synchronize-Packages.gif) + +### 26. 重新安装一个软件包 ### + +'dnf reinstall nano'命令将重新安装一个已经安装的软件包(例如,nano): + + # dnf reinstall nano + +![重新安装软件包](http://www.tecmint.com/wp-content/uploads/2015/05/Re-Install-Package.gif) + +### 27. 降级一个软件包 ### + +选项'downgrade'将会使一个软件包(例如,acpid)回退到低版本。 + + # dnf downgrade acpid + +示例输出 + + Using metadata from Wed May 20 12:44:59 2015 + No match for available package: acpid-2.0.19-5.el7.x86_64 + Error: Nothing to do. + +**我观察到**:dnf不会按预想的那样降级一个软件包。这已做为一个bug被提交。 + +### 结论 ### + +DNF是YUM管理器的优秀替代品。它试着自动做许多甚至不推荐有经验的Linux系统管理员做的工作。例如: + +- `--skip-broken`不被DNF识别,并且DNF中没有其替代命令。 +- 尽管您可能会运行dnf provides,但再也没有'resolvedep'命令了。 +- 没有'deplist'命令用来发现软件包依赖。 +- 您排除一个仓库意味着在所有操作上排除该仓库,而在yum中,排除一个仓库只在安装和升级等时刻排除他们。 + +许多Linux用户对于Linux生态系统的走向不甚满意。首先[Systemd替换了init系统][3]v,现在DNF将于不久后替换YUM,首先是Fedora 22,接下来是RHEL和CentOS。 + +您怎么看呢?是不是发行版和整个Linux生态系统并不注重用户并且在朝着与用户愿望相悖的方向前进呢?IT行业里有这样一句话 - “如果没有坏,为什么要修呢?”,System V和YUM都没有坏。 + +上面便是这篇文章的全部了。请在下方留言以让我了解您的宝贵想法。点赞和分享以帮助我们传播。谢谢! + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/dnf-commands-for-fedora-rpm-package-management/ + +作者:[Avishek Kumar][a] +译者:[wwy-hust](https://github.com/wwy-hust) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/avishek/ +[1]:http://www.tecmint.com/20-linux-yum-yellowdog-updater-modified-commands-for-package-mangement/ +[2]:http://www.tecmint.com/dnf-next-generation-package-management-utility-for-linux/ +[3]:http://www.tecmint.com/systemd-replaces-init-in-linux/ diff --git a/translated/tech/20150528 27 'DNF' Fork of Yum Commands for RPM Package Management in Linux.md b/translated/tech/20150528 27 'DNF' Fork of Yum Commands for RPM Package Management in Linux.md deleted file mode 100644 index 48dd213d68..0000000000 --- a/translated/tech/20150528 27 'DNF' Fork of Yum Commands for RPM Package Management in Linux.md +++ /dev/null @@ -1,287 +0,0 @@ -27LinuxߡDNFYumķ֧ -================================================================================ -DNFDandified YUMǻRPMķаһߡFedora 18г֣еFedora 22[YUM߼][1] - -![](http://www.tecmint.com/wp-content/uploads/2015/05/linux-dnf-command-examples.jpg) - -DNFڸYUMƿܡڴռáٶȺ档DNFʹRPMlibsolvhawkeyаδԤװCentOSRHEL 7Уͨyumװͬʱʹöߡ - -ҲĶDNFϢ - -- [ʹDNFȡYumԭ][2] - -µDNFȶ汾2015511շ1.0дƪ֮ǰԼDNF֮ǰ汾ҪPythonдGPL v2֤ - -### װDNF ### - -Fedora 22ٷѾɵDNFDNFRHEL/CentOS 7ĬϲֿС - -ΪRHEL/CentOSϵͳаװDNFҪȰװͿepel-releaseֿ⡣ - - # yum install epel-release - - # yum install epel-release -y - -ܲʹyumʱ'-y'ѡΪûǿʲôװϵͳСԴ˲⣬ʹ'-y'ѡԶİװûԤ - -ʹyumepel-realeaseֿⰲװDNF - - # yum install dnf - -װdnfһչʾ27ʵõdnfӣԱ׺͸ЧĹRPMķа档 - -### 1. DNF汾 ### - -ϵͳϰװDNF汾 - - # dnf --version - -![DNF汾](http://www.tecmint.com/wp-content/uploads/2015/05/Check-DNF-Version.gif) - -### 2. гDNFֿ ### - -dnfе'repolist'ѡʾϵͳпIJֿ⡣ - - # dnf repolist - -![пIJֿ](http://www.tecmint.com/wp-content/uploads/2015/05/Check-All-Enabled-Repositories.gif) - -### 3. гп͹رյDNFֿ ### - -'repolist all'ѡʾϵͳп/رյIJֿ⡣ - - # dnf repolist all - -![гп/رյIJֿ](http://www.tecmint.com/wp-content/uploads/2015/05/Check-All-Repositories.gif) - -### 4. DNFгпõѰװ ### - -'dnf list'гвֿпõLinuxϵͳѰװ - - # dnf list - -![DNFге](http://www.tecmint.com/wp-content/uploads/2015/05/List-All-Packages.png) - -### 5. DNFгѰװ ### - -'dnf list'гвֿпõѰװȻһʹ'list installed'ѡֻгѰװ - - # dnf list installed - -![гѰװ](http://www.tecmint.com/wp-content/uploads/2015/05/List-Installed-Packages.png) - -### 6. DNFгпõ ### - -Ƶģ'list available'ѡгпIJֿпõ - - # dnf list available - -![DNFгõ](http://www.tecmint.com/wp-content/uploads/2015/05/List-Available-Packages.png) - -### 7. ʹDNF ### - -̫밲װ֣£ʹ'search'ѡƥַ磬nanoַ - - # dnf search nano - -![ͨؼ](http://www.tecmint.com/wp-content/uploads/2015/05/Search-Package.gif) - -### 8. 鿴ĸṩijļ/ ### - -dnfѡ'provides'ܲṩijļ/磬Ǹṩϵͳе'/bin/bash'ļʹ - - # dnf provides /bin/bash - -![ṩļ](http://www.tecmint.com/wp-content/uploads/2015/05/Find-Package-Sub-Package.gif) - -### 9. ʹDNFһϸϢ ### - -ڰװһǰ֪ϸϢʹ'info'һϸϢ磺 - - # dnf info nano - -![DNF鿴Ϣ](http://www.tecmint.com/wp-content/uploads/2015/05/Check-Package-Information.gif) - -### 10. ʹDNFװ ### - -밲װһnanoֻΪnanoԶĽͰװе - - # dnf install nano - -![DNFװ](http://www.tecmint.com/wp-content/uploads/2015/05/Install-Package-DNF.gif) - -### 11. ʹDNFһ ### - -ֻһضİ磬systemdұϵͳʣ䡣 - - # dnf update systemd - -![һ](http://www.tecmint.com/wp-content/uploads/2015/05/Update-a-Package.gif) - -### 12. ʹDNFϵͳ ### - -ϵͳаװĸ¿Լ򵥵ʹdnfУ - - # dnf check-update - -![ϵͳ](http://www.tecmint.com/wp-content/uploads/2015/05/Check-For-System-Update.gif) - -### 13. ʹDNFװϵͳе ### - -ʹϵͳѰװ - - # dnf update - - # dnf upgrade - -![ϵͳ](http://www.tecmint.com/wp-content/uploads/2015/05/Update-System.gif) - -### 14. ʹDNFƳ/ɾһ ### - -dnfʹ'remove''erase'ѡƳκβҪ - - # dnf remove nano - - # dnf erase nano - -![Ƴϵͳе](http://www.tecmint.com/wp-content/uploads/2015/05/Remove-Package.gif) - -### 15. ʹDNFƳõOrphan Packages ### - -ЩΪװӦijɾ㲻Ҫˡùɾ - - # dnf autoremove - -![Ƴõ](http://www.tecmint.com/wp-content/uploads/2015/05/Autoremove-Packages.gif) - -### 16. ʹDNFƳ ### - -ʹdnfʱڵͷͲǻᵼ´ǿʹͰԶ̰Ϣͷ - - # dnf clean all - -![ƳDNF](http://www.tecmint.com/wp-content/uploads/2015/05/Remove-Cache-Packages.gif) - -### 17. ضDNFİ ### - -ҪضDNFİ磬cleanͨõ - - # dnf help clean - -![ijһ](http://www.tecmint.com/wp-content/uploads/2015/05/Help-on-DNF-Command.gif) - -### 18. гDNFѡ ### - -ҪʾdnfѡֻҪ - - # dnf help - -![ѡ](http://www.tecmint.com/wp-content/uploads/2015/05/DNF-Options.gif) - -### 19. 鿴DNFʷ¼ ### - -Ե'dnf history'鿴Ѿִйdnfб֪ʲôװ/ƳԼʱ - - # dnf history - -![鿴ʷ¼](http://www.tecmint.com/wp-content/uploads/2015/05/Check-DNF-History.gif) - -### 20. ʾ ### - -'dnf grouplist'ԴӡпõĻѰװûʲôг֪顣 - - # dnf grouplist - -![г](http://www.tecmint.com/wp-content/uploads/2015/05/List-All-Group-Packages.gif) - -### 21. ʹDNFװһ ### - -Ҫװһһ飨磬Educational SoftawareֻҪִУ - - # dnf groupinstall 'Educational Software' - -![װһ](http://www.tecmint.com/wp-content/uploads/2015/05/Install-Group-Packages.gif) - -### 22. һ ### - -ͨһ飨磬Educational Software - - # dnf groupupdate 'Educational Software' - -![](http://www.tecmint.com/wp-content/uploads/2015/05/Update-Group-Package.gif) - -### 23. Ƴһ ### - -ʹƳһ飨磬Educational Software - - # dnf groupremove 'Educational Software' - -![Ƴ](http://www.tecmint.com/wp-content/uploads/2015/05/Remove-Group-Package.gif) - -### 24. ijضIJֿⰲװһ ### - -DNFԴκضIJֿⰲװһ磬phpmyadmin - - # dnf --enablerepo=epel install phpmyadmin - -![ضIJֿⰲװ](http://www.tecmint.com/wp-content/uploads/2015/05/Install-Package-From-Specific-Repo.gif) - -### 25. Ѱװͬȶа ### - -'dnf distro-sync'ͬѰװпIJֿȶ汾ûѡͬѰװ - - # dnf distro-sync - -![ͬȶ](http://www.tecmint.com/wp-content/uploads/2015/05/Synchronize-Packages.gif) - -### 26. °װһ ### - -'dnf reinstall nano'°װһѾװ磬nano - - # dnf reinstall nano - -![°װ](http://www.tecmint.com/wp-content/uploads/2015/05/Re-Install-Package.gif) - -### 27. һ ### - -ѡ'downgrade'ʹһ磬acpid˵Ͱ汾 - - # dnf downgrade acpid - -ʾ - - Using metadata from Wed May 20 12:44:59 2015 - No match for available package: acpid-2.0.19-5.el7.x86_64 - Error: Nothing to do. - -**ҵĹ۲**dnfᰴԤһΪһbugύ - -### ### - -DNFYUMƷԶоLinuxϵͳԱĹ磺 - -- `--skip-broken`DNFʶ𣬲DNFû -- ܻdnf providesҲû'resolvedep'ˡ -- û'deplist' -- ųһֿζвųòֿ⣬yumУųһֻֿڰװʱųǡ - -LinuxûLinux̬ϵͳ⡣[Systemd滻init system][3]vDNFڲú滻YUMFedora 22RHELCentOS - -ôأDzǷаLinux̬ϵͳעûڳûԸ㣵ķǰأITҵһ仰 - ûлΪʲôҪأSystem VYUMûл - -ƪµȫˡ·˽ı뷨޺ͷ԰Ǵлл - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/dnf-commands-for-fedora-rpm-package-management/ - -ߣ[Avishek Kumar][a] -ߣ[wwy-hust](https://github.com/wwy-hust) -Уԣ[УID](https://github.com/УID) - - [LCTT](https://github.com/LCTT/TranslateProject) ԭ룬[Linuxй](https://linux.cn/) Ƴ - -[a]:http://www.tecmint.com/author/avishek/ -[1]:http://www.tecmint.com/20-linux-yum-yellowdog-updater-modified-commands-for-package-mangement/ -[2]:http://www.tecmint.com/dnf-next-generation-package-management-utility-for-linux/ -[3]:http://www.tecmint.com/systemd-replaces-init-in-linux/ From b7b21847bb0114a9e64159ce32adcf39f304b464 Mon Sep 17 00:00:00 2001 From: struggling <630441839@qq.com> Date: Mon, 29 Jun 2015 12:23:34 +0800 Subject: [PATCH 494/965] Update 20150626 15 Useful MySQL or MariaDB Performance Tuning and Optimization Tips.md --- ...erformance Tuning and Optimization Tips.md | 181 +++++++++--------- 1 file changed, 92 insertions(+), 89 deletions(-) diff --git a/sources/tech/20150626 15 Useful MySQL or MariaDB Performance Tuning and Optimization Tips.md b/sources/tech/20150626 15 Useful MySQL or MariaDB Performance Tuning and Optimization Tips.md index e01e9bf787..942381170e 100644 --- a/sources/tech/20150626 15 Useful MySQL or MariaDB Performance Tuning and Optimization Tips.md +++ b/sources/tech/20150626 15 Useful MySQL or MariaDB Performance Tuning and Optimization Tips.md @@ -1,20 +1,21 @@ -translation by strugglingyouth +translated -15 Useful MySQL/MariaDB Performance Tuning and Optimization Tips +15 个有用的 MySQL/MariaDB 性能调整和优化技巧 ================================================================================ -MySQL is a powerful open source Relational Database Management System or in short RDBMS. It was released back in 1995 (20 years old). It uses Structured Query Language which is probably the most popular choice for managing content within a database. The latest MySQL version is 5.6.25 and was released on 29 May 2015. +MySQL是一个强大的开源关系型数据库管理系统或简称RDBMS。它被发布在1995年(20年前)。它采用的结构化查询语言在数据库管理中可能是最好的选择。最新的MySQL版本是5.6.25,2015年5月29日发行的。 -An interesting fact about MySQL is the fact that the name comes from Michael Widenius’s (MySQL’s creator) daughter My. Even though there are plenty of interesting facts about MySQL, this article is meant to show you some useful practices to help you manage your MySQL server. +尽管有许多关于MySQL有趣的传闻,其中一个有趣的事实是,这个名字来自Michael Widenius(MySQL的创始人)的女儿。本文旨在向您展示一些有用的做法,以帮助您管理您的MySQL服务器。 ![MySQL Performance Tuning](http://www.tecmint.com/wp-content/uploads/2015/06/MySQL-Performance-Tuning1.png) -MySQL Performance Tuning +MySQL性能优化 -In April 2009 the MySQL project was bought by Oracle. As a result a MySQL community fork called MariaDB was created. The main reason for creating the fork was to keep the project free under the General Public License. +2009年4月,MySQL被Oracle收购。其结果导致一个叫MariaDB的社区成立。创建的主要原因是为了保持MySQL项目的自由。 -Today MySQL and MariaDB are one of the most (if not the most) frequently used RDBMS used for web applications such as WordPress, Joomla, Magento and others. +今天,MySQL和MariaDB对于Web应用程序像,WordPress, Joomla, Magento和其他的,是使用最广泛的(但不是使用最多的)RDBMS。 -This article will show you some basic, yet useful tips how to optimize the fine tune the performance of MySQL/MariaDB. Please keep in mind that this article assumes that you already have MySQL or MariaDB installed. If you are still wondering how to install them on your system, you can follow our extensive guides here: + +这篇文章将告诉你一些基本的,但有用如何优化MySQL / MariaDB性能的技巧。说明,本文假定您已经安装了MySQL或MariaDB。如果你仍然不知道如何在系统上安装它们,你可以按照以下说明去安装: - [Installing LAMP on RHEL/CentOS 7][1] - [Installing LAMP on Fedora 22][2] @@ -23,207 +24,209 @@ This article will show you some basic, yet useful tips how to optimize the fine - [Install MariaDB on Gentoo Linux][5] - [Install MariaDB on Arch Linux][6] -**Important**: Before we start – do not accept this suggestions blindly. Each MySQL setup is unique and requires additional thought, before making any changes. +**说明**: 在开始之前,不要盲目的接受这些建议。每个MySQL的设置是不同的,在进行任何更改之前需要慎重考虑。 -Things you need to know: -- MySQL/MariaDB configuration file is located in `/etc/my.cnf`. Every time you modify this file you will need to restart the MySQL service so the new changes can take effect. -- For writing this article MySQL version 5.6 has been used as template. +你需要明白这些: -### 1. Enable InnoDB file-per-table ### +- MySQL/MariaDB配置文件位于 `/etc/my.cnf`. 每次需改此文件后你需要重新启动MySQL服务,以使新更改生效。 +- 这篇文章使用MySQL 5.6版本 。 -First it is important to explain that InnoDB is a storage engine. MySQL and MariaDB use InnoDB as default storage engine. In the past MySQL used to keep database tables and indexes in a system tablespace. This approach was meant for servers which sole purpose is database processing and their storage disk is not used for any other purposes. +### 1. 启动 InnoDB 的`file-per-table` ### -The InnoDB provides more flexible approach and each database information is kept in a `.ibd` data file. Each .ibd file represents a tablespace of its own. That way database operations such as “TRUNCATE” can be completed faster and you may also reclaim unused space when dropping or truncating a database table. +首先,它是非常重要的对于解释InnoDB是一个存储引擎。MySQL和MariaDB使用的默认存储引擎是InnoDB。过去,MySQL使用系统表空间来保存数据库中的表和索引。这意味着服务器唯一的目的就是数据库处理,它的存储盘不用于其他的目的。 -Another benefit of this configuration is the fact that you can keep some of the database tables in a separate storage device. This can greatly improve the I/O load on your disks. +InnoDB提供了更灵活的方式,它把每个数据库的信息保存在一个`.ibd` 数据文件中。像“TRUNCATE”这样的操作可以更快地完成,当删除或截断一个数据库表时,你也可以回收未使用的空间。 -The innodb_file_per_table is enabled by default in MySQL 5.6 and above. You can see that in /etc/my.cnf file. The directive looks like this: +这种结构的另一个好处是,可以保留一些数据库表在一个单独的存储设备。这可以大大提高你磁盘的I/O负载。 + +MySQL 5.6及以上的版本默认启用`innodb_file_per_table`。你可以在/etc/my.cnf文件中看到。该指令看起来是这样的: innodb_file_per_table=1 -### 2. Store MySQL Database Data on Separate Partition ### +### 2. 将MySQL数据库中的数据放在独立分区上 ### -**Note**: This setup only works with MySQL, but not with MariaDB. +**注意**: 此设置只能工作在MySQL上, 而不能在MariaDB上. -Sometimes OS read/writes can slow down the performance of your MySQL server, especially if located on same hard drive. Instead, I would recommend using separate hard drive (preferably SSD) for the MySQL service. +有时OS的读/写操作会减缓你MySQL服务器的性能,尤其是如果位于同一块磁盘上。因此,我建议你使用单独的磁盘(SSD最好)用于MySQL服务。 -To complete, this you will need to attach the new drive to your computer/server. For the purpose of this article, I will assume that the drive will be under /dev/sdb. +要完成这步,你需要将新的磁盘连接到您的计算机/服务器上。对于这篇文章,我会认为磁盘将被识别为/dev/sdb。 -The next step is to prepare the new drive: +下一步将是准备新的分区: # fdisk /dev/sdb -Now press “n” to create new partition. Next press “p” to make the new partition primary. After that, set the partition number from 1-4. After that you will select the partition size. Press enter here. On the next step you will need to configure the size of the partition. +现在按“N”来创建新的分区。接着按“P”,以使其创建为主分区。在此之后,设置分区号为1-4之间。之后,你可以选择分区大小。这里按enter。在接下来的步骤中,你需要配置分区的大小。 -If you wish to use the entire disk press enter once more. Otherwise you can manually set the size of the new partition. When ready press “w” to write the changes. Now we will need to create a filesystem for our new partition. This can be easily done with: +如果你希望使用全部的磁盘,按一次enter。否则,你需要手动设置新分区的大小。准备就绪后按“w”保存。现在,我们需要为我们的新分区创建一个文件系统。这可以很轻松的完成: # mkfs.ext4 /dev/sdb1 -Now we will mount our new partition in a folder. I have named my folder “ssd” and created in the root directory: +现在挂载新分区到文件夹下。在根目录下创建一个名为“ssd”的文件夹: # mkdir /ssd/ -We are ready to mount the new partition we just made in the new folder: +挂载新分区到刚才创建的文件夹下: # mount /dev/sdb1 /ssd/ -You can perform the mount at startup by adding the following line in /etc/fstab file. +你可以添加如下行在/etc/fstab文件中设置开机自动挂载: /dev/sdb1 /ssd ext3 defaults 0 0 -Now you are ready to move MySQL to the new disk. First stop the MySQL service with: +现在我们移动MySQL到新磁盘中。首先停止服务: # service mysqld stop -I would recommend you stopping Apache/nginx as well to prevent any attempts to write in the databases: +我建议你​​停止Apache/nginx,以及以防止任何操作试图在数据库中写入: # service httpd stop # service nginx stop -Now copy the entire MySQL directory in the new drive: +现在我们复制完整的MySQL目录到新分区中: # cp /var/lib/mysql /ssd/ -Rp -This may take a while depending on the site of your MySQL databases. Once this process is complete rename the MySQL directory: +这可能需要一段时间,具体取决于你的MySQL数据库的大小。一旦这个过程完成后重命名MySQL的目录: # mv /var/lib/mysql /var/lib/mysql-backup -Next we will create a symlink. +然后创建一个链接: # ln -s /ssd/mysql /var/lib/mysql -Now you are ready to start your MySQL and web service: +现在启动你的MySQL和web服务: # service mysqld start # service httpd start # service nginx start -At this point your MySQL databases will be accessed from the new drive. +以后你的数据库将使用新的磁盘访问。 -### 3. Optimizing InnoDB buffer pool Usage ### +### 3. 优化InnoDB的缓冲区 ### -The InnoDB engine has a buffer pool used for caching data and indexes in memory. This of course will help your MySQL/MariaDB queries be executed significantly faster. Choosing the proper size here requires some very important decisions and good knowledge on your system’s memory consumption. +InnoDB引擎在内存中有一个缓冲数据和索引的缓冲区。这将有助于你在MySQL/MariaDB中的查询更快的执行。选择合适的内存大小对系统的查询来说是非常重要的,并且使你对系统的内存消耗也会有一个更好的认识。 -Here is what you need to consider: +下面是你需要考虑的: -- How much memory you need for other processes. This includes your system processes, page tables, socket buffers. -- Is your server dedicated for MySQL or you will be running other memory hungry services. +- 其他的进程需要消耗多少内存,包括你的系统进程,表的数量,套接字缓冲区大小。 +- 你的服务器是否专用于MySQL还是你也运行其他非常消耗内存的服务。 -On a dedicated box, you would probably want to give about 60-70% of the memory to the innodb_buffer_pool_size. If you plan on running more services on a single box, you should re-consider the amount of memory you dedicate for your innodb_buffer_pool_size. -The value that you should edit in my.cnf is: +在一个专用的机器上,你可能会使用60-70%的内存分配给`innodb_buffer_pool_size`。如果你打算在一个机器上运行多个服务,你应该重新考虑`innodb_buffer_pool_size`的内存大小。 + +你需要设置my.cnf中的此项: innodb_buffer_pool_size -### 4. Avoid Swappiness in MySQL ### +### 4. 在MySQL中避免使用Swappiness ### -Swapping is process that occurs when system moves part of memory to a special disk space called “swap”. The event usually appears when your system runs out of physical memory and instead of freeing up some RAM, the system pushed the information into disk. As you might have guess the disk is much slower than your RAM. +使用交换空间需要一个进程,当系统移动一部分内存到一个空闲的分区中就叫做“swap”。通常当你的系统用完物理内存后就会出现这种情况而不是释放一些RAM,然后将信息写进磁盘中。你可能已经猜测到磁盘比你的内存要慢得多。 -By default the option is enabled: +默认情况下该选项已经启用: # sysctl vm.swappiness vm.swappiness = 60 -To disable swappiness, run the following command: +使用以下命令关闭swappiness: # sysctl -w vm.swappiness=0 -### 5. Set MySQL Max Connections ### +### 5. 设置MySQL的最大连接数 ### -The max_connections directive tells your server how many concurrent connections are permitted. The MySQL/MariaDB server allows the value given in max_connections + 1 for user with SUPER privileges. The connection is opened only for the time MySQL query is executed – after that it is closed and new connection can take its place. +`max_connections`变量告诉你的服务器当前允许多少并发连接。MySQL/ MariaDB服务器允许的`max_connections` + 1为超级用户给定的值。当连接建立后,执行MySQL查询会有时间的限制 - 之后,它被关闭,新连接可以取代其位置。 -Keep in mind that too many connections can cause high RAM usage and lock up your MySQL server. Usually small websites will require between 100-200 connections while larger may require 500-800 or even more. The value you apply here strongly depends on your particular MySQL/MariaDB usage. +请记住,太多的连接会导致RAM的使用量过高并且会锁定你的MySQL服务器。一般小网站需要100-200的连接数而较大可能需要500-800甚至更多。这里的值很大程度上取决于你的MySQL/MariaDB的使用情况。 -You can dynamically change the value of `max_connections`, without having to restart the MySQL service by running: +你可以动态的改变`max_connections`的值而无需重启MySQL服务器: # mysql -u root -p mysql> set global max_connections := 300; -### 6. Configure MySQL thread_cache_size ### +### 6. 配置MySQL的`thread_cache_size`变量 ### -The `thread_cache_size` directive sets the amount of threads that your server should cache. As the client disconnects, his threads are put in the cache if they are less than the thread_cache_size. Further requests are completed by using the threads stored in the cache. + `thread_cache_size`变量用来设置你服务器缓存的线程数量。当客户端断开连接时,如果当前线程数小于`thread_cache_size`,他的线程将被放入缓存中。下一个请求将使用缓存池中的线程来完成。 -To improve your performance you can set the thread_cache_size to a relatively high number. To find the thread cache hit rate, you can use the following technique: +要提高服务器的性能,你可以设置`thread_cache_size`的值相对高一些。你可以通过以下方法来查看线程池的使用情况:: mysql> show status like 'Threads_created'; mysql> show status like 'Connections'; -Now use the following formula to calculate the thread cache hit rate percentage: +你可以用以下公式来计算线程池的使用率: 100 - ((Threads_created / Connections) * 100) -If you get a low number, it means that most of the new mysql connections are starting new thread instead of loading from cache. You will surely want to increase the thread_cache_size in such cases. +如果你得到一个较低的数字,这意味着大多数mysql连接请求使用新的线程,而不是从缓存加载。在这种情况下,你需要增加`thread_cache_size`。 -The good thing here is that the thread_cache_size can be dynamically changed without having to restart the MySQL service. You can achieve this by running: +但有一个好处是,`thread_cache_size`可以动态的改变而无需重启MySQL服务。你可以通过以下方式来实现: mysql> set global thread_cache_size = 16; -### 7. Disable MySQL Reverse DNS Lookups ### +### 7.禁用MySQL的DNS反向查询 ### -By default MySQL/MariaDB perform a DNS lookup of the user’s IP address/Hostname from which the connection is coming. For each client connection, the IP address is checked by resolving it to a host name. After that the host name is resolved back to an IP to verify that both match. +当新的连接出现时,默认情况下MySQL/MariaDB会使用DNS来解析用户的IP地址/主机名,每个新的连接,它的IP都会被解析为主机名。然后,主机名又被反解析为IP来验证这两个是否一致。 -This unfortunately may cause delays in case of badly configured DNS or problems with DNS server. This is why you can disable the reverse DNS lookup by adding the following in your configuration file: +当DNS服务器出现问题或者配置有问题时,解析会变得非常慢,这就是为什么要关闭DNS的反向解析,你可以在你的配置文件中添加以下选项去设定: [mysqld] # Skip reverse DNS lookup of clients skip-name-resolve -You will have to restart the MySQL service after applying these changes. +更改后需要重新启动你的MySQL服务器. -### 8. Configure MySQL query_cache_size ### +### 8. 配置MySQL的`query_cache_size`变量 ### -If you have many repetitive queries and your data does not change often – use query cache. People often do not understand the concept behind the `query_cache_size` and set this value to gigabytes, which can actually cause degradation in the performance. +如果你有很多重复的查询或者不经常改变的数据 – 请使用缓存查询。 人们常常不理解`query_cache_size`的实际含义而将此值设置为几十兆,这实际上会降低服务器的性能。 -The reason behind that is the fact that threads need to lock the cache during updates. Usually value of 200-300 MB should be more than enough. If your website is relatively small, you can try giving the value of 64M and increase in time. +背后的原因是,线程需要在更新过程中锁定缓存。通常设置为200-300 MB应该足够了。如果你的网站比较小的,你可以尝试给64M并在以后及时去增加。 -You will have to add the following settings in the MySQL configuration file: +添加以下选项到你的MySQL配置文件中: query_cache_type = 1 query_cache_limit = 256K query_cache_min_res_unit = 2k query_cache_size = 80M -### 9. Configure tmp_table_size and max_heap_table_size ### +### 9. 配置`tmp_table_size`变量和`max_heap_table_size`变量 ### -Both directives should have the same size and will help you prevent disk writes. The `tmp_table_size` is the maximum amount of size of internal in-memory tables. In case the limit in question is exceeded the table will be converted to on-disk MyISAM table. +这两个变量的大小相同都将帮助你避免将数据直接写入到磁盘中去。`tmp_table_size` 是内置内存表的最大空间,如果超出限值表的大小将被转换到磁盘上的MyISAM表。 -This will affect the database performance. Administrators usually recommend giving 64M for both values for every GB of RAM on the server. +这将影响数据库的性能。管理员通常建议在服务器上设置这两个值为RAM的每GB为64M。 [mysqld] tmp_table_size= 64M max_heap_table_size= 64M -### 10. Enable MySQL Slow query Logs ### +### 10. 开启MySQL慢速查询日志 ### -Logging slow queries can help you determine issues with your database and help you debug them. This can be easily enabled by adding the following values in your MySQL configuration file: +慢查询日志可以帮助你定位数据库的问题,并帮助您调试。在你的MySQL配置文件中添加以下选项来启用: slow-query-log = 1 slow-query-log-file = /var/lib/mysql/mysql-slow.log long_query_time = 1 -The first directive enables the logging of slow queries, while the second one tells MySQL where to store the actual log file. Use `long_query_time` to define the amount of time that is considered long for MySQL query to be completed. +第一个变量开启慢查询日志,第二个告诉MySQL实际的日志文件存储在哪。使用`long_query_time`来定义MySQL查询完成时长。 -### 11. Check for MySQL idle Connections ### +### 11.检查MySQL的空闲连接 ### -Idle connections consume resources and should be interrupted or refreshed when possible. Such connections are in “sleep” state and usually stay that way for long period of time. To look for idled connections you can run the following command: +空闲连接会消耗资源,应中断或者尽可能被刷新。这样的连接都在“sleep”状态并且会保持一段时间。通过以下命令可以查看空闲的连接: # mysqladmin processlist -u root -p | grep “Sleep” -This will show you list of processes that are in sleep state. The event appears when the code is using persistent connection to the database. When using PHP this event can appear when using mysql_pconnect which opens the connection, after that executes queries, removes the authentication and leaves the connection open. This will cause any per-thread buffers to be kept in memory until the thread dies. +这会显示处于睡眠状态的进程列表。当代码使用到数据库持久连接时会出现以下情况。使用PHP调用mysql_pconnect可以打开这个连接,即执行查询,删除认证最后关闭打开的连接。这会导致每个线程的缓冲区被保存在缓存中,直到该线程死亡。 -The first thing you would do here is to check the code and fix it. If you don’t have access to the code that is being ran, you can change the `wait_timeout` directive. The default value is 28800 seconds, while you can safely decrease it to something like 60: +首先你要做的就是检查代码并修复它。如果你不能访问正在运行的代码,你可以修改`wait_timeout`变量。默认值是28800秒,而你可以将其降低到60: wait_timeout=60 -### 12. Choosing Right MySQL Filesystem ### +### 12. 为MySQL选择正确的文件系统 ### -Choosing the right filesystem is vital for your databases. Most important things you need to consider here are – data integrity, performance and ease of administration. +选择正确的文件系统对数据库至关重要。在这里你需要考虑的最重要的事情是 - 数据的完整性,性能和易管理性。 -As per MariaDB’s recommendations, the best file systems are XFS, Ext4 and Btrfs. All of them are enterprise journaling filesystems that can be used with very large files and large storage volumes. +按照MariaDB的建议,最好的文件系统是XFS,ext4或者BTRFS。所有这些都可以作为企业用的日志文件系统,它们可以使用非常大的文件和大容量存储。 -Below you can find some useful information about the three filesystems: +关于这三个文件系统你可以在下面看到一些有用的信息: 注:表格 @@ -251,41 +254,41 @@ Below you can find some useful information about the three filesystems:
-The pros and cons of the Linux filesystems have been extensively covered in our article: +这篇文章将详细介绍Linux文件系统的利与弊: - [Linux Filesystem Explained][7] -### 13. Set MySQL max_allowed_packet ### +### 13. 设置MySQL的`max_allowed_packet` ### -MySQL splits data into packets. Usually a single packet is considered a row that is sent to a client. The `max_allowed_packet` directive defines the maximum size of packet that can be sent. +MySQL的数据被拆分成包发送。通常,单个报文被认为是一次发送到客户端。`max_allowed_pa​​cket`变量可以定义被发送包的大小。 -Setting this value too low can cause a query to stall and you will receive an error in your MySQL error log. It is recommended to set the value to the size of your largest packet. +此值设置得过低可能会导致查询速度变得非常慢,然后你会看到一个错误在MySQL的错误日志中。它建议你将数据包的大小设置成最大。 -### 14. Check MySQL Performance Tuning ### +### 14. 测试MySQL的性能 ### -Measuring your MySQL/MariaDB performance is something that you should do on regular basis. This will help you see if something in the resource usage changes or needs to be improved. +你应该定期检测MySQL/MariaDB的性能。这将帮助你查看资源的使用情况或需要调整某些变量的值。 -There are plenty of tools available for benchmarking, but I would like to suggest you one that is simple and easy to use. The tool is called mysqltuner. +有大量的测试工具可用,但我推荐你一个简单易用的。该工具被称为mysqltuner。 -To download and run it, use the following set of commands: +使用下面的命令下载并运行它: # wget https://github.com/major/MySQLTuner-perl/tarball/master # tar xf master # cd major-MySQLTuner-perl-993bc18/ # ./mysqltuner.pl -You will receive a detailed report about your MySQL usage and recommendation tips. Here is a sample output of default MariaDB installation: +你将收到有关MySQL使用和推荐提示的详细报告。下面是在MariaDB上安装后的默认输出: ![MySQL Performance Tuning](http://www.tecmint.com/wp-content/uploads/2015/06/MySQL-Performance-Tuning.png) -### 15. Optimize and Repair MySQL Databases ### +### 15. 优化和修复MySQL数据库 ### -Sometimes MySQL/MariaDB database tables get crashed quite easily, especially when unexpected server shut down, sudden file system corruption or during copy operation, when database is still accessed. Surprisingly, there is a free open source tool called ‘mysqlcheck‘, which automatically check, repair and optimize databases of all tables in Linux. +有时候MySQL/MariaDB数据库中的表很容易崩溃,尤其是当服务器意外关机时,数据库仍然被访问中或者在执行复制操作,文件系统会突然崩溃。然而,有一个免费的开源工具,被称为'mysqlcheck'的,它会自动检查,修复和优化Linux中数据库的所有表。 # mysqlcheck -u root -p --auto-repair --check --optimize --all-databases # mysqlcheck -u root -p --auto-repair --check --optimize databasename -That’s it! I hope you have found the above article useful and help you tune up your MySQL server. As always if you have any further questions or comments, please submit them in the comment section below. +就是这样!我希望你已经发现了上述文章有用的地方,并帮助你优化你的MySQL服务器。一如往常,如果你有任何问题或意见,请在下面的评论部分提交。 -------------------------------------------------------------------------------- From ec6a22b8bc5e1eee56e962364af4f8f756e71ef2 Mon Sep 17 00:00:00 2001 From: ictlyh Date: Mon, 29 Jun 2015 12:51:56 +0800 Subject: [PATCH 495/965] [Translated] tech/20150527 How to edit your documents collaboratively on Linux.md --- ...your documents collaboratively on Linux.md | 123 ------------------ ...your documents collaboratively on Linux.md | 122 +++++++++++++++++ 2 files changed, 122 insertions(+), 123 deletions(-) delete mode 100644 sources/tech/20150527 How to edit your documents collaboratively on Linux.md create mode 100644 translated/tech/20150527 How to edit your documents collaboratively on Linux.md diff --git a/sources/tech/20150527 How to edit your documents collaboratively on Linux.md b/sources/tech/20150527 How to edit your documents collaboratively on Linux.md deleted file mode 100644 index 5b528e6165..0000000000 --- a/sources/tech/20150527 How to edit your documents collaboratively on Linux.md +++ /dev/null @@ -1,123 +0,0 @@ -ictlyh Translating -How to edit your documents collaboratively on Linux -================================================================================ -> "Developed many years before by some high-strung, compulsive assistant, the Bulletin was simply a Word document that lived in a shared folder both Emily and I could access. Only one of us could open it at a time and add a new message, thought, or question to the itemized list. Then we'd print out the updated version and place it on the clipboard that sat on the shelf over my desk, removing the old ones as we went." ("The Devil Wears Prada" by Lauren Weisberger) - -Even today such a "collaborative editing" is in use where only one person can open a shared file, make changes to it, and then inform others about what and when was modified. - -ONLYOFFICE is an open source online office suite integrated with different management tools for documents, emails, events, tasks and client relations. - -Using ONLYOFFICE office suite, a group of people can edit text, spreadsheet or presentation within a browser simultaneously. Leave comments directly in their document and interact with each other using the integrated chat. And, finally, save the document as a PDF file for further printing. As an added bonus, it gives the possibility to view the document history and restore the previous revision/version if needed. - -In this tutorial, I will describe how to deploy your own online office suite using [ONLYOFFICE Free Edition][1], an ONLYOFFICE self-hosted version distributed under GNU AGPL v3. - -### Installing ONLYOFFICE on Linux ### - -ONLYOFFICE installation requires the presence of mono (version 4.0.0 or later), nodejs, libstdc++6, nginx and mysql-server in your Linux system. To simplify the installation process and avoid dependency errors, I install ONLYOFFICE using Docker. In this case there is only one dependency to be installed - [Docker][2]. - -Just to remind, Docker is an open-source project that automates the deployment of applications inside software containers. If Docker is not available on your Linux system, install it first by referring to Docker installation instructions for [Debian-based][3] or [Red-Hat based][4] systems. - -Note that you will need Docker 1.4.1 or later. To check the installed Docker version, use the following command. - - $ docker version - -To try ONLYOFFICE inside a Docker container, simply execute the following commands: - - $ sudo docker run -i -t -d --name onlyoffice-document-server onlyoffice/documentserver - $ sudo docker run -i -t -d -p 80:80 -p 443:443 --link onlyoffice-document-server:document_server onlyoffice/communityserver - -These commands will download the [official ONLYOFFICE Docker image][5] with all dependencies needed for its correct work. - -It's also possible to install [ONLYOFFICE Online Editors][6] separately on a Linux server, and easily integrate it into your website or cloud application via API provided. - -### Running a Self-Hosted Online Office ### - -To open your online office, enter localhost (http://IP-Address/) in the address bar of your browser. The Welcome page will open: - -![](https://farm9.staticflickr.com/8815/18116525656_795821c73b_c.jpg) - -Enter a password and specify the email address you will use to access your office the next time. - -### Editing Your Documents Online ### - -First, click the Documents link to open **the My Documents** folder. - -![](https://farm8.staticflickr.com/7781/17956640089_d3df0b18cd_c.jpg) - -#### STEP 1. Select a Document to Edit #### - -To create a new document right there, click on the **Create** button in the upper left corner, and choose the file type from the drop-down list. To edit a file stored on your hard disk drive, upload it to **Documents** clicking the **Upload** button next to **Create** button. - -![](https://farm9.staticflickr.com/8836/17956640109_ed8be735df_c.jpg) - -#### STEP 2. Share your Document #### - -Use the **Share** button to the right side if you are in the **My Documents** folder, or follow **File >> Document Info ... >> Change Access Rights** if you are inside your document. - -In the opened **Sharing Settings** window, click on the **People outside portal** link on the left, open the access to the document, and give full access to it by enabling the **Full Access** radio button. - -Finally, choose a way to share the link to your document, send it via email or one of the available social networks: Google+, Facebook, or Twitter. - -![](https://farm8.staticflickr.com/7766/17522306273_c8a9022c75_c.jpg) - -#### STEP 3. Start the Collaborative Editing #### - -To start co-editing the document, the invited person just needs to follow the provided link. - -The text passages edited by your co-editors will be automatically marked with dashed lines of different colors. - -![](https://farm8.staticflickr.com/7790/18139370292_7ef57aae8f_c.jpg) - -As soon as one of your collaborators saves his/her changes, you will see a note appearing in the left upper corner of the top toolbar, indicating that there areupdates. - -![](https://farm8.staticflickr.com/7778/18143984831_3dd42a9672_c.jpg) - -To save your changes and get updates, click on the **Save** icon. All the updates will then be highlighted. - -![](https://farm8.staticflickr.com/7796/17955172970_e53460b8a6_c.jpg) - -#### STEP 4. Interact with your Co-editors #### - -To leave some comments, select a text passage with the mouse, right-click on it and, and choose the **Add comment** option from the context menu. - -![](https://farm8.staticflickr.com/7771/17956640359_c4e2858dc8_c.jpg) - -To interact with co-editors in real time, use the integrated chat instead. All the users who currently edit the document will be listed on the **Chat** panel. To open it, click on the **Chat** icon at the left-side bar. To start a discussion, enter your message into an appropriate field on the **Chat** panel. - -![](https://farm8.staticflickr.com/7794/18116394026_d93b00e4f8_c.jpg) - -### Useful Tips ### - -As final notes, here are some useful tips for you to take full advantage of ONLYOFFICE. - -#### Tip #1. Editing your Docs from Cloud Storage Services, Like ownCloud #### - -If you store your documents in other web resources like Box, Dropbox, Google Drive, OneDrive, SharePoint or ownCloud, you can easily synchronize them with the ONLYOFFICE. - -In the opened 'Documents' module, click one of the icons under the **Add the account** caption: Google, Box, DropBox, OneDrive, ownCloud or 'Add account', and enter the requested data. - -#### Tip #2. Editing Your Docs on iPad #### - -To add some changes to your document on the go, I use ONLYOFFICE Documents app for iPad. You can download and install it from [iTune][7], then you need to enter your ONLYOFFICE portal address, email and password to access your documents. The feature set is almost the same. - -To evaluate ONLYOFFICE Online Editors features, you can use the [cloud version][8] for personal use. - --------------------------------------------------------------------------------- - -via: http://xmodulo.com/edit-documents-collaboratively-linux.html - -作者:[Tatiana Kochedykova][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://xmodulo.com/author/tatiana -[1]:http://www.onlyoffice.org/ -[2]:http://xmodulo.com/recommend/dockerbook -[3]:http://xmodulo.com/manage-linux-containers-docker-ubuntu.html -[4]:http://xmodulo.com/docker-containers-centos-fedora.html -[5]:https://registry.hub.docker.com/u/onlyoffice/communityserver/ -[6]:http://onlyoffice.org/sources#document -[7]:https://itunes.apple.com/us/app/onlyoffice-documents/id944896972 -[8]:https://personal.onlyoffice.com/ \ No newline at end of file diff --git a/translated/tech/20150527 How to edit your documents collaboratively on Linux.md b/translated/tech/20150527 How to edit your documents collaboratively on Linux.md new file mode 100644 index 0000000000..8fc469bf24 --- /dev/null +++ b/translated/tech/20150527 How to edit your documents collaboratively on Linux.md @@ -0,0 +1,122 @@ +如何在 Linux 上协同编辑文档 +================================================================================ +> “多年前由一些高度紧张、强迫性助理开发的 Bulletin,只是共享文件夹中只有 Emily 和我可以访问的 Word 文档。同一时间我们只有一个人可以打开它并添加消息、想法,或者提问项目列表。然后我们再打印出更新版本并放到我桌子架上的剪贴板,并在退出时删除旧版本。”(Lauren Weisberger 称之为“穿 Prada 的女魔头”) + +直到今天仍然在使用这样的“协同编辑”,只有一个人可以打开共享文件,对其进行更改,然后告诉其它人什么时候修改了什么。 + +ONLYOFFICE 是一款集成了文档、电子邮件、事件、任务和客户关系管理工具的开源在线办公套件。 + +使用 ONLYOFFICE 办公套件,一组人可以同时编辑文本、电子表格或者在浏览器上进行展示。直接在他们的文档上留下评论并用集成的聊天工具和其他人沟通。最后,保存文档为 PDF 文件用于之后的打印。作为额外的增强功能,它还能浏览文档历史并在如果需要时恢复到之前的修订/版本。 + +在这篇教程中,我会介绍如何使用 [免费版 ONLYOFFICE][1] 部署你自己的在线办公套件,免费版 ONLYOFFICE 是 ONLYOFFICE 在 GNU AGPL v3 协议下发布的自托管版本。 + +### 在 Linux 上安装 ONLYOFFICE ### + +安装 ONLYOFFICE 要求在你的 Linux 系统上要有 mono(4.0.0 或更高版本)、nodejs、libstdc++6、nginx 和 mysql-server。为了简化安装过程并避免依赖错误,我使用 Docker 安装 ONLYOFFICE。在这种情况下只需要安装一种依赖 - [Docker][2]。 + +提醒一下,Docker 是一个在软件容器中自动部署应用的开源项目。如果在你的 Linux 系统上 Docker 不可用,首先根据 [基于 Debian][3] 或 [基于 Red-Hat][4] 系统的 Docker 安装指令安装它。 + +注意,你需要 Docker 1.4.1 或更高版本。要检查安装的 Docker 版本,可以使用下面的命令。 + + $ docker version + +在一个 Docker 容器中试用 ONLYOFFICE,只需要执行下面的命令: + + $ sudo docker run -i -t -d --name onlyoffice-document-server onlyoffice/documentserver + $ sudo docker run -i -t -d -p 80:80 -p 443:443 --link onlyoffice-document-server:document_server onlyoffice/communityserver + +这些命令会下载为了能正常运行带有所有所需依赖的 [官方 ONLYOFFICE Docker 镜像][5]。 + +也可以在 Linux 服务器上单独安装 [ONLYOFFICE 在线编辑器][6],并通过提供的 API 轻松地集成到你的站点或云应用。 + +### 运行自托管在线 Office ### + +要打开你的在线 office,在你浏览器的地址栏输入 localhost(http://IP-Address/)。会打开欢迎页面: + +![](https://farm9.staticflickr.com/8815/18116525656_795821c73b_c.jpg) + +输入一个密码并指定下次访问你的 office 所使用的电子邮件地址。 + +### 在线编辑文档 ### + +首先点击 Document 链接打开 **the My Documents** 文件夹。 + +![](https://farm8.staticflickr.com/7781/17956640089_d3df0b18cd_c.jpg) + +#### STEP 1. 选择需要编辑的文档 #### + +要在这里新建一个新文档,点击左上角的 “Create” 按钮,从下拉列表中选择文件类型。要编辑保存在你硬盘中的文件,点击 **Create** 按钮旁边的 **Upload** 按钮上传文件到 **Document**。 + +![](https://farm9.staticflickr.com/8836/17956640109_ed8be735df_c.jpg) + +#### STEP 2. 共享文档 #### + +如果你在 **My Documents** 文件夹中,用右边的 **Share** 按钮,或者如果你在文档中,用 **File >> Document Info ... >> Change Access Rights**。 + +在打开的 **Sharing Settings** 窗口,点击左边的 **People outside portal** 链接,打开到文档的访问,并通过启用 **Full Access** 单选按钮给予完全访问权限。 + +最后,选择一种方式共享到你文档的链接,通过 email 或者你可用的一种社交网络:Google+、Facebook 或 Twitter 发送。 + +![](https://farm8.staticflickr.com/7766/17522306273_c8a9022c75_c.jpg) + +#### STEP 3. 开始协同编辑 #### + +邀请的人只需要根据提供的链接就可以开始协同编辑文档。 + +会自动用不用颜色的虚线将你的合作者编辑的文本段落标记出来。 + +![](https://farm8.staticflickr.com/7790/18139370292_7ef57aae8f_c.jpg) + +只要你的其中一个合作者保存了他的/她的更改,你会看到在顶部工具栏左上角出现了一个注意标签,表示这里有更新。 + +![](https://farm8.staticflickr.com/7778/18143984831_3dd42a9672_c.jpg) + +点击 **Save** 图标保存更改并更新。然后会高亮所有的更新。 + +![](https://farm8.staticflickr.com/7796/17955172970_e53460b8a6_c.jpg) + +#### STEP 4. 和合作者互动 #### + +要写评论,用鼠标选择一个文本段落,右击并从上下文菜单中选择 **Add comment** 选项。 + +![](https://farm8.staticflickr.com/7771/17956640359_c4e2858dc8_c.jpg) + +要和合作者实时互动,可以使用集成的聊天工具。**Chat** 面板会列出所有正在编辑文档的用户。点击左侧边栏的 **Chat** 图标打开它。在 **Chat** 面板的合适区域输入你的信息开始讨论。 + +![](https://farm8.staticflickr.com/7794/18116394026_d93b00e4f8_c.jpg) + +### 有用的提示 ### + +最后,这里有一些你充分利用 ONLYOFFICE 的有用提示。 + +#### Tip #1. 在云存储服务例如 ownCloud 上编辑文档 #### + +如果你将文档存储在其它网络资源上,例如 Box、Dropbox、Google Drive、OneDrive、SharePoint 或 ownCloud,你可以轻松地和 ONLYOFFICE 同步。 + +在打开的 ‘Documents’ 模块,点击 **Add the account** 下面的其中一个图标:Google、Box、DropBox、OneDrive、ownCloud 或 ‘Add account’,并输入所需数据。 + +#### Tip #2. 在 iPad 上编辑文档 #### + +为了在任意时刻添加更改到文档,我使用 iPad 的 ONLYOFFICE Documents 应用。你可以从 [iTune][7] 下载并安装它,然后你需要输入你的 ONLYOFFICE 地址、email 和密码来访问你的文档。功能设置几乎一样。 + +为了评估 ONLYOFFICE 在线编辑器的功能,你可以使用供个人使用的 [云版本][8]。 + +-------------------------------------------------------------------------------- + +via: http://xmodulo.com/edit-documents-collaboratively-linux.html + +作者:[Tatiana Kochedykova][a] +译者:[ictlyh](https://github.com/ictlyh) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://xmodulo.com/author/tatiana +[1]:http://www.onlyoffice.org/ +[2]:http://xmodulo.com/recommend/dockerbook +[3]:http://xmodulo.com/manage-linux-containers-docker-ubuntu.html +[4]:http://xmodulo.com/docker-containers-centos-fedora.html +[5]:https://registry.hub.docker.com/u/onlyoffice/communityserver/ +[6]:http://onlyoffice.org/sources#document +[7]:https://itunes.apple.com/us/app/onlyoffice-documents/id944896972 +[8]:https://personal.onlyoffice.com/ \ No newline at end of file From 5429023a70acb7df2d624c01f584ea2dcbf5362a Mon Sep 17 00:00:00 2001 From: struggling <630441839@qq.com> Date: Mon, 29 Jun 2015 12:58:02 +0800 Subject: [PATCH 496/965] Create 20150626 15 Useful MySQL or MariaDB Performance Tuning and Optimization Tips.md --- ...erformance Tuning and Optimization Tips.md | 309 ++++++++++++++++++ 1 file changed, 309 insertions(+) create mode 100644 translated/tech/20150626 15 Useful MySQL or MariaDB Performance Tuning and Optimization Tips.md diff --git a/translated/tech/20150626 15 Useful MySQL or MariaDB Performance Tuning and Optimization Tips.md b/translated/tech/20150626 15 Useful MySQL or MariaDB Performance Tuning and Optimization Tips.md new file mode 100644 index 0000000000..061b710c85 --- /dev/null +++ b/translated/tech/20150626 15 Useful MySQL or MariaDB Performance Tuning and Optimization Tips.md @@ -0,0 +1,309 @@ + +15 个有用的 MySQL/MariaDB 性能调整和优化技巧 +================================================================================ +MySQL是一个强大的开源关系型数据库管理系统或简称RDBMS。它被发布在1995年(20年前)。它采用的结构化查询语言在数据库管理中可能是最好的选择。最新的MySQL版本是5.6.25,2015年5月29日发行的。 + +尽管有许多关于MySQL有趣的传闻,其中一个有趣的事实是,这个名字来自Michael Widenius(MySQL的创始人)的女儿。本文旨在向您展示一些有用的做法,以帮助您管理您的MySQL服务器。 + +![MySQL Performance Tuning](http://www.tecmint.com/wp-content/uploads/2015/06/MySQL-Performance-Tuning1.png) + +MySQL性能优化 + +2009年4月,MySQL被Oracle收购。其结果导致一个叫MariaDB的社区成立。创建的主要原因是为了保持MySQL项目的自由。 + +今天,MySQL和MariaDB对于Web应用程序像,WordPress, Joomla, Magento和其他的,是使用最广泛的(但不是使用最多的)RDBMS。 + + +这篇文章将告诉你一些基本的,但有用如何优化MySQL / MariaDB性能的技巧。说明,本文假定您已经安装了MySQL或MariaDB。如果你仍然不知道如何在系统上安装它们,你可以按照以下说明去安装: + +- [Installing LAMP on RHEL/CentOS 7][1] +- [Installing LAMP on Fedora 22][2] +- [Setting Up LAMP on Ubuntu 15.04][3] +- [Installing MariaDB on Debian 8][4] +- [Install MariaDB on Gentoo Linux][5] +- [Install MariaDB on Arch Linux][6] + +**说明**: 在开始之前,不要盲目的接受这些建议。每个MySQL的设置是不同的,在进行任何更改之前需要慎重考虑。 + + +你需要明白这些: + +- MySQL/MariaDB配置文件位于 `/etc/my.cnf`. 每次需改此文件后你需要重新启动MySQL服务,以使新更改生效。 +- 这篇文章使用MySQL 5.6版本 。 + +### 1. 启动 InnoDB 的`file-per-table` ### + +首先,它是非常重要的对于解释InnoDB是一个存储引擎。MySQL和MariaDB使用的默认存储引擎是InnoDB。过去,MySQL使用系统表空间来保存数据库中的表和索引。这意味着服务器唯一的目的就是数据库处理,它的存储盘不用于其他的目的。 + +InnoDB提供了更灵活的方式,它把每个数据库的信息保存在一个`.ibd` 数据文件中。像“TRUNCATE”这样的操作可以更快地完成,当删除或截断一个数据库表时,你也可以回收未使用的空间。 + +这种结构的另一个好处是,可以保留一些数据库表在一个单独的存储设备。这可以大大提高你磁盘的I/O负载。 + +MySQL 5.6及以上的版本默认启用`innodb_file_per_table`。你可以在/etc/my.cnf文件中看到。该指令看起来是这样的: + + innodb_file_per_table=1 + +### 2. 将MySQL数据库中的数据放在独立分区上 ### + +**注意**: 此设置只能工作在MySQL上, 而不能在MariaDB上. + +有时OS的读/写操作会减缓你MySQL服务器的性能,尤其是如果位于同一块磁盘上。因此,我建议你使用单独的磁盘(SSD最好)用于MySQL服务。 + +要完成这步,你需要将新的磁盘连接到您的计算机/服务器上。对于这篇文章,我会认为磁盘将被识别为/dev/sdb。 + +下一步将是准备新的分区: + + # fdisk /dev/sdb + +现在按“N”来创建新的分区。接着按“P”,以使其创建为主分区。在此之后,设置分区号为1-4之间。之后,你可以选择分区大小。这里按enter。在接下来的步骤中,你需要配置分区的大小。 + +如果你希望使用全部的磁盘,按一次enter。否则,你需要手动设置新分区的大小。准备就绪后按“w”保存。现在,我们需要为我们的新分区创建一个文件系统。这可以很轻松的完成: + + # mkfs.ext4 /dev/sdb1 + +现在挂载新分区到文件夹下。在根目录下创建一个名为“ssd”的文件夹: + + # mkdir /ssd/ + +挂载新分区到刚才创建的文件夹下: + + # mount /dev/sdb1 /ssd/ + +你可以添加如下行在/etc/fstab文件中设置开机自动挂载: + + /dev/sdb1 /ssd ext3 defaults 0 0 + +现在我们移动MySQL到新磁盘中。首先停止服务: + + # service mysqld stop + +我建议你​​停止Apache/nginx,以及以防止任何操作试图在数据库中写入: + + # service httpd stop + # service nginx stop + +现在我们复制完整的MySQL目录到新分区中: + + # cp /var/lib/mysql /ssd/ -Rp + +这可能需要一段时间,具体取决于你的MySQL数据库的大小。一旦这个过程完成后重命名MySQL的目录: + + # mv /var/lib/mysql /var/lib/mysql-backup + +然后创建一个链接: + + # ln -s /ssd/mysql /var/lib/mysql + +现在启动你的MySQL和web服务: + + # service mysqld start + # service httpd start + # service nginx start + +以后你的数据库将使用新的磁盘访问。 + +### 3. 优化InnoDB的缓冲区 ### + +InnoDB引擎在内存中有一个缓冲数据和索引的缓冲区。这将有助于你在MySQL/MariaDB中的查询更快的执行。选择合适的内存大小对系统的查询来说是非常重要的,并且使你对系统的内存消耗也会有一个更好的认识。 + +下面是你需要考虑的: + +- 其他的进程需要消耗多少内存,包括你的系统进程,表的数量,套接字缓冲区大小。 +- 你的服务器是否专用于MySQL还是你也运行其他非常消耗内存的服务。 + + +在一个专用的机器上,你可能会使用60-70%的内存分配给`innodb_buffer_pool_size`。如果你打算在一个机器上运行多个服务,你应该重新考虑`innodb_buffer_pool_size`的内存大小。 + +你需要设置my.cnf中的此项: + + innodb_buffer_pool_size + +### 4. 在MySQL中避免使用Swappiness ### + +使用交换空间需要一个进程,当系统移动一部分内存到一个空闲的分区中就叫做“swap”。通常当你的系统用完物理内存后就会出现这种情况而不是释放一些RAM,然后将信息写进磁盘中。你可能已经猜测到磁盘比你的内存要慢得多。 + +默认情况下该选项已经启用: + + # sysctl vm.swappiness + + vm.swappiness = 60 + +使用以下命令关闭swappiness: + + # sysctl -w vm.swappiness=0 + +### 5. 设置MySQL的最大连接数 ### + +`max_connections`变量告诉你的服务器当前允许多少并发连接。MySQL/ MariaDB服务器允许的`max_connections` + 1为超级用户给定的值。当连接建立后,执行MySQL查询会有时间的限制 - 之后,它被关闭,新连接可以取代其位置。 + +请记住,太多的连接会导致RAM的使用量过高并且会锁定你的MySQL服务器。一般小网站需要100-200的连接数而较大可能需要500-800甚至更多。这里的值很大程度上取决于你的MySQL/MariaDB的使用情况。 + +你可以动态的改变`max_connections`的值而无需重启MySQL服务器: + + # mysql -u root -p + mysql> set global max_connections := 300; + +### 6. 配置MySQL的`thread_cache_size`变量 ### + + `thread_cache_size`变量用来设置你服务器缓存的线程数量。当客户端断开连接时,如果当前线程数小于`thread_cache_size`,他的线程将被放入缓存中。下一个请求将使用缓存池中的线程来完成。 + +要提高服务器的性能,你可以设置`thread_cache_size`的值相对高一些。你可以通过以下方法来查看线程池的使用情况:: + + mysql> show status like 'Threads_created'; + mysql> show status like 'Connections'; + +你可以用以下公式来计算线程池的使用率: + + 100 - ((Threads_created / Connections) * 100) + +如果你得到一个较低的数字,这意味着大多数mysql连接请求使用新的线程,而不是从缓存加载。在这种情况下,你需要增加`thread_cache_size`。 + +但有一个好处是,`thread_cache_size`可以动态的改变而无需重启MySQL服务。你可以通过以下方式来实现: + + mysql> set global thread_cache_size = 16; + +### 7.禁用MySQL的DNS反向查询 ### + +当新的连接出现时,默认情况下MySQL/MariaDB会使用DNS来解析用户的IP地址/主机名,每个新的连接,它的IP都会被解析为主机名。然后,主机名又被反解析为IP来验证这两个是否一致。 + +当DNS服务器出现问题或者配置有问题时,解析会变得非常慢,这就是为什么要关闭DNS的反向解析,你可以在你的配置文件中添加以下选项去设定: + + [mysqld] + # Skip reverse DNS lookup of clients + skip-name-resolve + +更改后需要重新启动你的MySQL服务器. + +### 8. 配置MySQL的`query_cache_size`变量 ### + +如果你有很多重复的查询或者不经常改变的数据 – 请使用缓存查询。 人们常常不理解`query_cache_size`的实际含义而将此值设置为几十兆,这实际上会降低服务器的性能。 + +背后的原因是,线程需要在更新过程中锁定缓存。通常设置为200-300 MB应该足够了。如果你的网站比较小的,你可以尝试给64M并在以后及时去增加。 + +添加以下选项到你的MySQL配置文件中: + + query_cache_type = 1 + query_cache_limit = 256K + query_cache_min_res_unit = 2k + query_cache_size = 80M + +### 9. 配置`tmp_table_size`变量和`max_heap_table_size`变量 ### + +这两个变量的大小相同都将帮助你避免将数据直接写入到磁盘中去。`tmp_table_size` 是内置内存表的最大空间,如果超出限值表的大小将被转换到磁盘上的MyISAM表。 + +这将影响数据库的性能。管理员通常建议在服务器上设置这两个值为RAM的每GB为64M。 + + [mysqld] + tmp_table_size= 64M + max_heap_table_size= 64M + +### 10. 开启MySQL慢速查询日志 ### + +慢查询日志可以帮助你定位数据库的问题,并帮助您调试。在你的MySQL配置文件中添加以下选项来启用: + + slow-query-log = 1 + slow-query-log-file = /var/lib/mysql/mysql-slow.log + long_query_time = 1 + +第一个变量开启慢查询日志,第二个告诉MySQL实际的日志文件存储在哪。使用`long_query_time`来定义MySQL查询完成时长。 + +### 11.检查MySQL的空闲连接 ### + +空闲连接会消耗资源,应中断或者尽可能被刷新。这样的连接都在“sleep”状态并且会保持一段时间。通过以下命令可以查看空闲的连接: + + # mysqladmin processlist -u root -p | grep “Sleep” + +这会显示处于睡眠状态的进程列表。当代码使用到数据库持久连接时会出现以下情况。使用PHP调用mysql_pconnect可以打开这个连接,即执行查询,删除认证最后关闭打开的连接。这会导致每个线程的缓冲区被保存在缓存中,直到该线程死亡。 + +首先你要做的就是检查代码并修复它。如果你不能访问正在运行的代码,你可以修改`wait_timeout`变量。默认值是28800秒,而你可以将其降低到60: + + wait_timeout=60 + +### 12. 为MySQL选择正确的文件系统 ### + +选择正确的文件系统对数据库至关重要。在这里你需要考虑的最重要的事情是 - 数据的完整性,性能和易管理性。 + +按照MariaDB的建议,最好的文件系统是XFS,ext4或者BTRFS。所有这些都可以作为企业用的日志文件系统,它们可以使用非常大的文件和大容量存储。 + +关于这三个文件系统你可以在下面看到一些有用的信息: + +注:表格 + + + + + + + + + + + + + + + + + + + + + + + +
FilesystemsXFSExt4Btrfs
Maximum filesystem size8EB1EB16EB
Maximum file size8EB16TB16EB
+ +这篇文章将详细介绍Linux文件系统的利与弊: + +- [Linux Filesystem Explained][7] + +### 13. 设置MySQL的`max_allowed_packet` ### + +MySQL的数据被拆分成包发送。通常,单个报文被认为是一次发送到客户端。`max_allowed_pa​​cket`变量可以定义被发送包的大小。 + +此值设置得过低可能会导致查询速度变得非常慢,然后你会看到一个错误在MySQL的错误日志中。它建议你将数据包的大小设置成最大。 + +### 14. 测试MySQL的性能 ### + +你应该定期检测MySQL/MariaDB的性能。这将帮助你查看资源的使用情况或需要调整某些变量的值。 + +有大量的测试工具可用,但我推荐你一个简单易用的。该工具被称为mysqltuner。 + +使用下面的命令下载并运行它: + + # wget https://github.com/major/MySQLTuner-perl/tarball/master + # tar xf master + # cd major-MySQLTuner-perl-993bc18/ + # ./mysqltuner.pl + +你将收到有关MySQL使用和推荐提示的详细报告。下面是在MariaDB上安装后的默认输出: + +![MySQL Performance Tuning](http://www.tecmint.com/wp-content/uploads/2015/06/MySQL-Performance-Tuning.png) + +### 15. 优化和修复MySQL数据库 ### + +有时候MySQL/MariaDB数据库中的表很容易崩溃,尤其是当服务器意外关机时,数据库仍然被访问中或者在执行复制操作,文件系统会突然崩溃。然而,有一个免费的开源工具,被称为'mysqlcheck'的,它会自动检查,修复和优化Linux中数据库的所有表。 + + # mysqlcheck -u root -p --auto-repair --check --optimize --all-databases + # mysqlcheck -u root -p --auto-repair --check --optimize databasename + +就是这样!我希望你已经发现了上述文章有用的地方,并帮助你优化你的MySQL服务器。一如往常,如果你有任何问题或意见,请在下面的评论部分提交。 + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/mysql-mariadb-performance-tuning-and-optimization/ + +作者:[Marin Todorov][a] +译者:[strugglingyouth](https://github.com/strugglingyouth) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/marintodorov89/ +[1]:http://www.tecmint.com/install-lamp-in-centos-7/ +[2]:http://www.tecmint.com/install-lamp-linux-apache-mysql-php-on-fedora-22/ +[3]:http://www.tecmint.com/install-lamp-on-ubuntu-15-04/ +[4]:http://www.tecmint.com/install-mariadb-in-debian/ +[5]:http://www.tecmint.com/install-lemp-in-gentoo-linux/ +[6]:http://www.tecmint.com/install-lamp-in-arch-linux/ +[7]:http://www.tecmint.com/linux-file-system-explained/ From 52dd6cecdcf10b559b36411b1d5fa3229b55dd47 Mon Sep 17 00:00:00 2001 From: struggling <630441839@qq.com> Date: Mon, 29 Jun 2015 12:58:51 +0800 Subject: [PATCH 497/965] Delete 20150626 15 Useful MySQL or MariaDB Performance Tuning and Optimization Tips.md --- ...erformance Tuning and Optimization Tips.md | 310 ------------------ 1 file changed, 310 deletions(-) delete mode 100644 sources/tech/20150626 15 Useful MySQL or MariaDB Performance Tuning and Optimization Tips.md diff --git a/sources/tech/20150626 15 Useful MySQL or MariaDB Performance Tuning and Optimization Tips.md b/sources/tech/20150626 15 Useful MySQL or MariaDB Performance Tuning and Optimization Tips.md deleted file mode 100644 index 942381170e..0000000000 --- a/sources/tech/20150626 15 Useful MySQL or MariaDB Performance Tuning and Optimization Tips.md +++ /dev/null @@ -1,310 +0,0 @@ -translated - -15 个有用的 MySQL/MariaDB 性能调整和优化技巧 -================================================================================ -MySQL是一个强大的开源关系型数据库管理系统或简称RDBMS。它被发布在1995年(20年前)。它采用的结构化查询语言在数据库管理中可能是最好的选择。最新的MySQL版本是5.6.25,2015年5月29日发行的。 - -尽管有许多关于MySQL有趣的传闻,其中一个有趣的事实是,这个名字来自Michael Widenius(MySQL的创始人)的女儿。本文旨在向您展示一些有用的做法,以帮助您管理您的MySQL服务器。 - -![MySQL Performance Tuning](http://www.tecmint.com/wp-content/uploads/2015/06/MySQL-Performance-Tuning1.png) - -MySQL性能优化 - -2009年4月,MySQL被Oracle收购。其结果导致一个叫MariaDB的社区成立。创建的主要原因是为了保持MySQL项目的自由。 - -今天,MySQL和MariaDB对于Web应用程序像,WordPress, Joomla, Magento和其他的,是使用最广泛的(但不是使用最多的)RDBMS。 - - -这篇文章将告诉你一些基本的,但有用如何优化MySQL / MariaDB性能的技巧。说明,本文假定您已经安装了MySQL或MariaDB。如果你仍然不知道如何在系统上安装它们,你可以按照以下说明去安装: - -- [Installing LAMP on RHEL/CentOS 7][1] -- [Installing LAMP on Fedora 22][2] -- [Setting Up LAMP on Ubuntu 15.04][3] -- [Installing MariaDB on Debian 8][4] -- [Install MariaDB on Gentoo Linux][5] -- [Install MariaDB on Arch Linux][6] - -**说明**: 在开始之前,不要盲目的接受这些建议。每个MySQL的设置是不同的,在进行任何更改之前需要慎重考虑。 - - -你需要明白这些: - -- MySQL/MariaDB配置文件位于 `/etc/my.cnf`. 每次需改此文件后你需要重新启动MySQL服务,以使新更改生效。 -- 这篇文章使用MySQL 5.6版本 。 - -### 1. 启动 InnoDB 的`file-per-table` ### - -首先,它是非常重要的对于解释InnoDB是一个存储引擎。MySQL和MariaDB使用的默认存储引擎是InnoDB。过去,MySQL使用系统表空间来保存数据库中的表和索引。这意味着服务器唯一的目的就是数据库处理,它的存储盘不用于其他的目的。 - -InnoDB提供了更灵活的方式,它把每个数据库的信息保存在一个`.ibd` 数据文件中。像“TRUNCATE”这样的操作可以更快地完成,当删除或截断一个数据库表时,你也可以回收未使用的空间。 - -这种结构的另一个好处是,可以保留一些数据库表在一个单独的存储设备。这可以大大提高你磁盘的I/O负载。 - -MySQL 5.6及以上的版本默认启用`innodb_file_per_table`。你可以在/etc/my.cnf文件中看到。该指令看起来是这样的: - - innodb_file_per_table=1 - -### 2. 将MySQL数据库中的数据放在独立分区上 ### - -**注意**: 此设置只能工作在MySQL上, 而不能在MariaDB上. - -有时OS的读/写操作会减缓你MySQL服务器的性能,尤其是如果位于同一块磁盘上。因此,我建议你使用单独的磁盘(SSD最好)用于MySQL服务。 - -要完成这步,你需要将新的磁盘连接到您的计算机/服务器上。对于这篇文章,我会认为磁盘将被识别为/dev/sdb。 - -下一步将是准备新的分区: - - # fdisk /dev/sdb - -现在按“N”来创建新的分区。接着按“P”,以使其创建为主分区。在此之后,设置分区号为1-4之间。之后,你可以选择分区大小。这里按enter。在接下来的步骤中,你需要配置分区的大小。 - -如果你希望使用全部的磁盘,按一次enter。否则,你需要手动设置新分区的大小。准备就绪后按“w”保存。现在,我们需要为我们的新分区创建一个文件系统。这可以很轻松的完成: - - # mkfs.ext4 /dev/sdb1 - -现在挂载新分区到文件夹下。在根目录下创建一个名为“ssd”的文件夹: - - # mkdir /ssd/ - -挂载新分区到刚才创建的文件夹下: - - # mount /dev/sdb1 /ssd/ - -你可以添加如下行在/etc/fstab文件中设置开机自动挂载: - - /dev/sdb1 /ssd ext3 defaults 0 0 - -现在我们移动MySQL到新磁盘中。首先停止服务: - - # service mysqld stop - -我建议你​​停止Apache/nginx,以及以防止任何操作试图在数据库中写入: - - # service httpd stop - # service nginx stop - -现在我们复制完整的MySQL目录到新分区中: - - # cp /var/lib/mysql /ssd/ -Rp - -这可能需要一段时间,具体取决于你的MySQL数据库的大小。一旦这个过程完成后重命名MySQL的目录: - - # mv /var/lib/mysql /var/lib/mysql-backup - -然后创建一个链接: - - # ln -s /ssd/mysql /var/lib/mysql - -现在启动你的MySQL和web服务: - - # service mysqld start - # service httpd start - # service nginx start - -以后你的数据库将使用新的磁盘访问。 - -### 3. 优化InnoDB的缓冲区 ### - -InnoDB引擎在内存中有一个缓冲数据和索引的缓冲区。这将有助于你在MySQL/MariaDB中的查询更快的执行。选择合适的内存大小对系统的查询来说是非常重要的,并且使你对系统的内存消耗也会有一个更好的认识。 - -下面是你需要考虑的: - -- 其他的进程需要消耗多少内存,包括你的系统进程,表的数量,套接字缓冲区大小。 -- 你的服务器是否专用于MySQL还是你也运行其他非常消耗内存的服务。 - - -在一个专用的机器上,你可能会使用60-70%的内存分配给`innodb_buffer_pool_size`。如果你打算在一个机器上运行多个服务,你应该重新考虑`innodb_buffer_pool_size`的内存大小。 - -你需要设置my.cnf中的此项: - - innodb_buffer_pool_size - -### 4. 在MySQL中避免使用Swappiness ### - -使用交换空间需要一个进程,当系统移动一部分内存到一个空闲的分区中就叫做“swap”。通常当你的系统用完物理内存后就会出现这种情况而不是释放一些RAM,然后将信息写进磁盘中。你可能已经猜测到磁盘比你的内存要慢得多。 - -默认情况下该选项已经启用: - - # sysctl vm.swappiness - - vm.swappiness = 60 - -使用以下命令关闭swappiness: - - # sysctl -w vm.swappiness=0 - -### 5. 设置MySQL的最大连接数 ### - -`max_connections`变量告诉你的服务器当前允许多少并发连接。MySQL/ MariaDB服务器允许的`max_connections` + 1为超级用户给定的值。当连接建立后,执行MySQL查询会有时间的限制 - 之后,它被关闭,新连接可以取代其位置。 - -请记住,太多的连接会导致RAM的使用量过高并且会锁定你的MySQL服务器。一般小网站需要100-200的连接数而较大可能需要500-800甚至更多。这里的值很大程度上取决于你的MySQL/MariaDB的使用情况。 - -你可以动态的改变`max_connections`的值而无需重启MySQL服务器: - - # mysql -u root -p - mysql> set global max_connections := 300; - -### 6. 配置MySQL的`thread_cache_size`变量 ### - - `thread_cache_size`变量用来设置你服务器缓存的线程数量。当客户端断开连接时,如果当前线程数小于`thread_cache_size`,他的线程将被放入缓存中。下一个请求将使用缓存池中的线程来完成。 - -要提高服务器的性能,你可以设置`thread_cache_size`的值相对高一些。你可以通过以下方法来查看线程池的使用情况:: - - mysql> show status like 'Threads_created'; - mysql> show status like 'Connections'; - -你可以用以下公式来计算线程池的使用率: - - 100 - ((Threads_created / Connections) * 100) - -如果你得到一个较低的数字,这意味着大多数mysql连接请求使用新的线程,而不是从缓存加载。在这种情况下,你需要增加`thread_cache_size`。 - -但有一个好处是,`thread_cache_size`可以动态的改变而无需重启MySQL服务。你可以通过以下方式来实现: - - mysql> set global thread_cache_size = 16; - -### 7.禁用MySQL的DNS反向查询 ### - -当新的连接出现时,默认情况下MySQL/MariaDB会使用DNS来解析用户的IP地址/主机名,每个新的连接,它的IP都会被解析为主机名。然后,主机名又被反解析为IP来验证这两个是否一致。 - -当DNS服务器出现问题或者配置有问题时,解析会变得非常慢,这就是为什么要关闭DNS的反向解析,你可以在你的配置文件中添加以下选项去设定: - - [mysqld] - # Skip reverse DNS lookup of clients - skip-name-resolve - -更改后需要重新启动你的MySQL服务器. - -### 8. 配置MySQL的`query_cache_size`变量 ### - -如果你有很多重复的查询或者不经常改变的数据 – 请使用缓存查询。 人们常常不理解`query_cache_size`的实际含义而将此值设置为几十兆,这实际上会降低服务器的性能。 - -背后的原因是,线程需要在更新过程中锁定缓存。通常设置为200-300 MB应该足够了。如果你的网站比较小的,你可以尝试给64M并在以后及时去增加。 - -添加以下选项到你的MySQL配置文件中: - - query_cache_type = 1 - query_cache_limit = 256K - query_cache_min_res_unit = 2k - query_cache_size = 80M - -### 9. 配置`tmp_table_size`变量和`max_heap_table_size`变量 ### - -这两个变量的大小相同都将帮助你避免将数据直接写入到磁盘中去。`tmp_table_size` 是内置内存表的最大空间,如果超出限值表的大小将被转换到磁盘上的MyISAM表。 - -这将影响数据库的性能。管理员通常建议在服务器上设置这两个值为RAM的每GB为64M。 - - [mysqld] - tmp_table_size= 64M - max_heap_table_size= 64M - -### 10. 开启MySQL慢速查询日志 ### - -慢查询日志可以帮助你定位数据库的问题,并帮助您调试。在你的MySQL配置文件中添加以下选项来启用: - - slow-query-log = 1 - slow-query-log-file = /var/lib/mysql/mysql-slow.log - long_query_time = 1 - -第一个变量开启慢查询日志,第二个告诉MySQL实际的日志文件存储在哪。使用`long_query_time`来定义MySQL查询完成时长。 - -### 11.检查MySQL的空闲连接 ### - -空闲连接会消耗资源,应中断或者尽可能被刷新。这样的连接都在“sleep”状态并且会保持一段时间。通过以下命令可以查看空闲的连接: - - # mysqladmin processlist -u root -p | grep “Sleep” - -这会显示处于睡眠状态的进程列表。当代码使用到数据库持久连接时会出现以下情况。使用PHP调用mysql_pconnect可以打开这个连接,即执行查询,删除认证最后关闭打开的连接。这会导致每个线程的缓冲区被保存在缓存中,直到该线程死亡。 - -首先你要做的就是检查代码并修复它。如果你不能访问正在运行的代码,你可以修改`wait_timeout`变量。默认值是28800秒,而你可以将其降低到60: - - wait_timeout=60 - -### 12. 为MySQL选择正确的文件系统 ### - -选择正确的文件系统对数据库至关重要。在这里你需要考虑的最重要的事情是 - 数据的完整性,性能和易管理性。 - -按照MariaDB的建议,最好的文件系统是XFS,ext4或者BTRFS。所有这些都可以作为企业用的日志文件系统,它们可以使用非常大的文件和大容量存储。 - -关于这三个文件系统你可以在下面看到一些有用的信息: - -注:表格 - - - - - - - - - - - - - - - - - - - - - - - -
FilesystemsXFSExt4Btrfs
Maximum filesystem size8EB1EB16EB
Maximum file size8EB16TB16EB
- -这篇文章将详细介绍Linux文件系统的利与弊: - -- [Linux Filesystem Explained][7] - -### 13. 设置MySQL的`max_allowed_packet` ### - -MySQL的数据被拆分成包发送。通常,单个报文被认为是一次发送到客户端。`max_allowed_pa​​cket`变量可以定义被发送包的大小。 - -此值设置得过低可能会导致查询速度变得非常慢,然后你会看到一个错误在MySQL的错误日志中。它建议你将数据包的大小设置成最大。 - -### 14. 测试MySQL的性能 ### - -你应该定期检测MySQL/MariaDB的性能。这将帮助你查看资源的使用情况或需要调整某些变量的值。 - -有大量的测试工具可用,但我推荐你一个简单易用的。该工具被称为mysqltuner。 - -使用下面的命令下载并运行它: - - # wget https://github.com/major/MySQLTuner-perl/tarball/master - # tar xf master - # cd major-MySQLTuner-perl-993bc18/ - # ./mysqltuner.pl - -你将收到有关MySQL使用和推荐提示的详细报告。下面是在MariaDB上安装后的默认输出: - -![MySQL Performance Tuning](http://www.tecmint.com/wp-content/uploads/2015/06/MySQL-Performance-Tuning.png) - -### 15. 优化和修复MySQL数据库 ### - -有时候MySQL/MariaDB数据库中的表很容易崩溃,尤其是当服务器意外关机时,数据库仍然被访问中或者在执行复制操作,文件系统会突然崩溃。然而,有一个免费的开源工具,被称为'mysqlcheck'的,它会自动检查,修复和优化Linux中数据库的所有表。 - - # mysqlcheck -u root -p --auto-repair --check --optimize --all-databases - # mysqlcheck -u root -p --auto-repair --check --optimize databasename - -就是这样!我希望你已经发现了上述文章有用的地方,并帮助你优化你的MySQL服务器。一如往常,如果你有任何问题或意见,请在下面的评论部分提交。 - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/mysql-mariadb-performance-tuning-and-optimization/ - -作者:[Marin Todorov][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.tecmint.com/author/marintodorov89/ -[1]:http://www.tecmint.com/install-lamp-in-centos-7/ -[2]:http://www.tecmint.com/install-lamp-linux-apache-mysql-php-on-fedora-22/ -[3]:http://www.tecmint.com/install-lamp-on-ubuntu-15-04/ -[4]:http://www.tecmint.com/install-mariadb-in-debian/ -[5]:http://www.tecmint.com/install-lemp-in-gentoo-linux/ -[6]:http://www.tecmint.com/install-lamp-in-arch-linux/ -[7]:http://www.tecmint.com/linux-file-system-explained/ From 43b2c93c60a4cfb517b65eabac3bfb6b1255ed63 Mon Sep 17 00:00:00 2001 From: ZTinoZ Date: Mon, 29 Jun 2015 14:47:19 +0800 Subject: [PATCH 498/965] translating by ZTinoZ --- ...0625 Screen Capture Made Easy with these Dedicated Tools.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/share/20150625 Screen Capture Made Easy with these Dedicated Tools.md b/sources/share/20150625 Screen Capture Made Easy with these Dedicated Tools.md index 15fca199a2..822cbf3651 100644 --- a/sources/share/20150625 Screen Capture Made Easy with these Dedicated Tools.md +++ b/sources/share/20150625 Screen Capture Made Easy with these Dedicated Tools.md @@ -1,3 +1,4 @@ +translating by ZTinoZ Screen Capture Made Easy with these Dedicated Tools ================================================================================ "A picture is worth a thousand words", a phrase which emerged in the USA in the early part of the 20th century, refers to the notion that a single still image can present as much information as a large amount of descriptive text. Essentially, pictures convey information more effectively and efficiently than words can. @@ -149,4 +150,4 @@ via: http://www.linuxlinks.com/article/2015062316235249/ScreenCapture.html [1]:http://shutter-project.org/ [2]:http://thehive.xbee.net/ [3]:https://screencloud.net/ -[4]:https://www.kde.org/applications/graphics/ksnapshot/ \ No newline at end of file +[4]:https://www.kde.org/applications/graphics/ksnapshot/ From 4d50d89fdf135955f8d20304a2626c0cf726ab84 Mon Sep 17 00:00:00 2001 From: DeadFire Date: Mon, 29 Jun 2015 15:10:39 +0800 Subject: [PATCH 499/965] =?UTF-8?q?20150629-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...th these DeDuplicating Encryption Tools.md | 158 +++++++++++++ ...n Of Atom Code Editor Has Been Released.md | 68 ++++++ ...n mkdir, tar and kill Commands in Linux.md | 206 ++++++++++++++++ ...nd to Quickly Navigate Linux Filesystem.md | 222 ++++++++++++++++++ 4 files changed, 654 insertions(+) create mode 100644 sources/share/20150629 Backup with these DeDuplicating Encryption Tools.md create mode 100644 sources/share/20150629 First Stable Version Of Atom Code Editor Has Been Released.md create mode 100644 sources/tech/20150629 4 Useful Tips on mkdir, tar and kill Commands in Linux.md create mode 100644 sources/tech/20150629 Autojump--An Advanced 'cd' Command to Quickly Navigate Linux Filesystem.md diff --git a/sources/share/20150629 Backup with these DeDuplicating Encryption Tools.md b/sources/share/20150629 Backup with these DeDuplicating Encryption Tools.md new file mode 100644 index 0000000000..c6fe06832a --- /dev/null +++ b/sources/share/20150629 Backup with these DeDuplicating Encryption Tools.md @@ -0,0 +1,158 @@ +Backup with these DeDuplicating Encryption Tools +================================================================================ +Data is growing both in volume and value. It is becoming increasingly important to be able to back up and restore this information quickly and reliably. As society has adapted to technology and learned how to depend on computers and mobile devices, there are few that can deal with the reality of losing important data. Of firms that suffer the loss of data, 30% fold within a year, 70% cease trading within five years. This highlights the value of data. + +With data growing in volume, improving storage utilization is pretty important. In computing, data deduplication is a specialized data compression technique for eliminating duplicate copies of repeating data. This technique therefore improves storage utilization. + +Data is not only of interest to its creator. Governments, competitors, criminals, snoopers may be very keen to access your data. They might want to steal your data, extort money from you, or see what you are up to. Enryption is essential to protect your data. + +So the solution is a deduplicating encrypting backup software. + +Making file backups is an essential activity for all users, yet many users do not take adequate steps to protect their data. Whether a computer is being used in a corporate environment, or for private use, the machine's hard disk may fail without any warning signs. Alternatively, some data loss occurs as a result of human error. Without regular backups being made, data will inevitably be lost even if the services of a specialist recovery organisation are used. + +This article provides a quick roundup of 6 deduplicating encryption backup tools. + +---------- + +### Attic ### + +Attic is a deduplicating, encrypted, authenticated and compressed backup program written in Python. The main goal of Attic is to provide an efficient and secure way to backup data. The data deduplication technique used makes Attic suitable for daily backups since only the changes are stored. + +Features include: + +- Easy to use +- Space efficient storage variable block size deduplication is used to reduce the number of bytes stored by detecting redundant data +- Optional data encryption using 256-bit AES encryption. Data integrity and authenticity is verified using HMAC-SHA256 +- Off-site backups with SDSH +- Backups mountable as filesystems + +Website: [attic-backup.org][1] + +---------- + +### Borg ### + +Borg is a fork of Attic. It is a secure open source backup program designed for efficient data storage where only new or modified data is stored. + +The main goal of Borg is to provide an efficient and secure way to backup data. The data deduplication technique used makes Borg suitable for daily backups since only the changes are stored. The authenticated encryption makes it suitable for backups to not fully trusted targets. + +Borg is written in Python. Borg was created in May 2015 in response to the difficulty of getting new code or larger changes incorporated into Attic. + +Features include: + +- Easy to use +- Space efficient storage variable block size deduplication is used to reduce the number of bytes stored by detecting redundant data +- Optional data encryption using 256-bit AES encryption. Data integrity and authenticity is verified using HMAC-SHA256 +- Off-site backups with SDSH +- Backups mountable as filesystems + +Borg is not compatible with Attic. + +Website: [borgbackup.github.io/borgbackup][2] + +---------- + +### Obnam ### + +Obnam (OBligatory NAMe) is an easy to use, secure Python based backup program. Backups can be stored on local hard disks, or online via the SSH SFTP protocol. The backup server, if used, does not require any special software, on top of SSH. + +Obnam performs de-duplication by splitting up file data into chunks, and storing those individually. Generations are incremental backups; Every backup generation looks like a fresh snapshot, but is really incremental. Obnam is developed by Lars Wirzenius. + +Features include: + +- Easy to use +- Snapshot backups +- Data de-duplication, across files, and backup generations +- Encrypted backups, using GnuPG +- Backup multiple clients to a single repository +- Backup checkpoints (creates a "save" every 100MBs or so) +- Number of options for performance tuning including lru-size and/or upload-queue-size +- MD5 checksum algorithm for recognising duplicate data chunks +- Store backups to a server via SFTP +- Supports both push (i.e. Run on the client) and pull (i.e. Run on the server) methods + +Website: [obnam.org][3] + +---------- + +### Duplicity ### + +Duplicity incrementally backs up files and directory by encrypting tar-format volumes with GnuPG and uploading them to a remote (or local) file server. To transmit data it can use ssh/scp, local file access, rsync, ftp, and Amazon S3. + +Because duplicity uses librsync, the incremental archives are space efficient and only record the parts of files that have changed since the last backup. As the software uses GnuPG to encrypt and/or sign these archives, they will be safe from spying and/or modification by the server. + +Currently duplicity supports deleted files, full unix permissions, directories, symbolic links, fifos, etc. + +The duplicity package also includes the rdiffdir utility. Rdiffdir is an extension of librsync's rdiff to directories; it can be used to produce signatures and deltas of directories as well as regular files. + +Features include: + +- Simple to use +- Encrypted and signed archives (using GnuPG) +- Bandwidth and space efficient, using the rsync algorithm +- Standard file format +- Choice of remote protocol + - Local storage + - scp/ssh + - ftp + - rsync + - HSI + - WebDAV + - Amazon S3 + +Website: [duplicity.nongnu.org][4] + +---------- + +### ZBackup ### + +ZBackup is a versatile globally-deduplicating backup tool. + +Features include: + +- Parallel LZMA or LZO compression of the stored data. You can mix LZMA and LZO in a repository +- Built-in AES encryption of the stored data +- Possibility to delete old backup data +- Use of a 64-bit rolling hash, keeping the amount of soft collisions to zero +- Repository consists of immutable files. No existing files are ever modified +- Written in C++ only with only modest library dependencies +- Safe to use in production +- Possibility to exchange data between repos without recompression +- Uses a 64-bit modified Rabin-Karp rolling hash + +Website: [zbackup.org][5] + +---------- + +### bup ### + +bup is a program written in Python that backs things up. It's short for "backup". It provides an efficient way to backup a system based on the git packfile format, providing fast incremental saves and global deduplication (among and within files, including virtual machine images). + +bup is released under the LGPL version 2 license. + +Features include: + +- Global deduplication (among and within files, including virtual machine images) +- Uses a rolling checksum algorithm (similar to rsync) to split large files into chunks +- Uses the packfile format from git +- Writes packfiles directly offering fast incremental saves +- Can use "par2" redundancy to recover corrupted backups +- Mount your bup repository as a FUSE filesystem + +Website: [bup.github.io][6] + +-------------------------------------------------------------------------------- + +via: http://www.linuxlinks.com/article/20150628060000607/BackupTools.html + +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[1]:https://attic-backup.org/ +[2]:https://borgbackup.github.io/borgbackup/ +[3]:http://obnam.org/ +[4]:http://duplicity.nongnu.org/ +[5]:http://zbackup.org/ +[6]:https://bup.github.io/ \ No newline at end of file diff --git a/sources/share/20150629 First Stable Version Of Atom Code Editor Has Been Released.md b/sources/share/20150629 First Stable Version Of Atom Code Editor Has Been Released.md new file mode 100644 index 0000000000..a316615a6c --- /dev/null +++ b/sources/share/20150629 First Stable Version Of Atom Code Editor Has Been Released.md @@ -0,0 +1,68 @@ +First Stable Version Of Atom Code Editor Has Been Released +================================================================================ +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/06/Atom_stable.png) + +[Atom 1.0][1] is here. One of the [best open source code editors][2], [Atom][3] was available for public uses for almost a year but this is the first stable version of the most talked about text/code editor of recent times. Promoted as the “hackable text editor for 21st century”, this project of [Github][4] has already been downloaded 1.5 million times in the past and currently it has over 350,000 monthly active users. + +### It’s been a long time ### + +Rome was not built in a day and neither was Atom. Since it was first conceptualized in 2008 till the first stable release this month, it has taken several years and hundreds of contributors from across the globe, along with main developers working on Atom core. A quick look at the journey of Atom can be seen in the picture below: + +![Image credit: Atom](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/06/Atom_stable_timeline.jpeg) +Image credit: Atom + +### Back to the future ### + +This launch of Atom 1.0 is announced with a retro video showing the capabilities of the editor. Resembling to 70’s science fiction TV series, this will be the coolest video you are going to watch today :) + +注:youtube视频,不行做个链接吧 + + +### Features of Atom text editor ### + +- Cross-platform editing +- Built-in package manager +- Smart autocompletion +- File system browser +- Multiple panes +- Find and replace +- Highly customizable +- Modern look + +### Get Atom 1.0 ### + +Atom 1.0 is available for Linux, Windows and Mac OS X. For Debian based Linux distributions such as Ubuntu and Linux Mint, Atom provides .deb binaries. For Fedora, it also has .rpm binaries. You can also get the source code, if you like. The links below will let you download the latest stable version. + +- [Atom .deb][5] +- [Atom .rpm][6] +- [Atom Source Code][7] + +If you prefer, you can [install Atom in Ubuntu using PPA][8]. The PPA is not official though. + +注:下面是一个调查,可以发布的时候在文章内发布个调查 + +#### Are you excited about Atom? #### + +- Oh Yes! This is the best thing that could happen to programmers. +- Not really. I have seen better editors. +- Don't care. My default text editor does the job just fine. + +-------------------------------------------------------------------------------- + +via: http://itsfoss.com/atom-stable-released/ + +作者:[Abhishek][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://itsfoss.com/author/abhishek/ +[1]:http://blog.atom.io/2015/06/25/atom-1-0.html +[2]:http://itsfoss.com/best-modern-open-source-code-editors-for-linux/ +[3]:https://atom.io/ +[4]:https://github.com/ +[5]:https://atom.io/download/deb +[6]:https://atom.io/download/rpm +[7]:https://github.com/atom/atom/blob/master/docs/build-instructions/linux.md +[8]:http://itsfoss.com/install-atom-text-editor-ubuntu-1404-linux-mint-17/ \ No newline at end of file diff --git a/sources/tech/20150629 4 Useful Tips on mkdir, tar and kill Commands in Linux.md b/sources/tech/20150629 4 Useful Tips on mkdir, tar and kill Commands in Linux.md new file mode 100644 index 0000000000..74b5126246 --- /dev/null +++ b/sources/tech/20150629 4 Useful Tips on mkdir, tar and kill Commands in Linux.md @@ -0,0 +1,206 @@ +4 Useful Tips on mkdir, tar and kill Commands in Linux +================================================================================ +We keep on accomplishing a task conventionally until we come to know that it can be done in a much better way the other way. In continuation of our [Linux Tips and Trick Series][1], I am here with the below four tips that will going to help you in lots of ways. Here we go! + +![Linux Useful Tips](http://www.tecmint.com/wp-content/uploads/2015/06/Linux-Useful-Tips.jpg) + +4 Linux Useful Tips and Hacks + +### 1. You are supposed to create a long/complex directory tree similar to given below. What is the most effective way to achieve this? ### + +Directory tree structure to achieve as suggested below. + + $ cd /home/$USER/Desktop + $ mkdir tecmint + $ mkdir tecmint/etc + $ mkdir tecmint/lib + $ mkdir tecmint/usr + $ mkdir tecmint/bin + $ mkdir tecmint/tmp + $ mkdir tecmint/opt + $ mkdir tecmint/var + $ mkdir tecmint/etc/x1 + $ mkdir tecmint/usr/x2 + $ mkdir tecmint/usr/x3 + $ mkdir tecmint/tmp/Y1 + $ mkdir tecmint/tmp/Y2 + $ mkdir tecmint/tmp/Y3 + $ mkdir tecmint/tmp/Y3/z + +The above scenario can simply be achieved by running the below 1-liner command. + + $ mkdir -p /home/$USER/Desktop/tecmint/{etc/x1,lib,usr/{x2,x3},bin,tmp/{Y1,Y2,Y3/z},opt,var} + +To verify you may use tree command. If not installed you may apt or yum the package ‘tree‘. + + $ tree tecmint + +![Check Directory Structure](http://www.tecmint.com/wp-content/uploads/2015/06/Check-Directory-Structure.png) + +Check Directory Structure + +We can create directory tree structure of any complexity using the above way. Notice it is nothing other than a normal command but its using `{}` to create hierarchy of directories. This may prove very helpful if used from inside of a shell script when required and in general. + +### 2. Create a file (say test) on your Desktop (/home/$USER/Desktop) and populate it with the below contents. ### + + ABC + DEF + GHI + JKL + MNO + PQR + STU + VWX + Y + Z + +What a normal user would do in this scenario? + +a. He will create the file first, preferably using [touch command][2], as: + + $ touch /home/$USER/Desktop/test + +b. He will use a text editor to open the file, which may be nano, vim, or any other editor. + + $ nano /home/$USER/Desktop/test + +c. He will then place the above text into this file, save and exit. + +So regardless of time taken by him/her, he need at-least 3 steps to execute the above scenario. + +What a smart experienced Linux-er will do? He will just type the below text in one-go on terminal and all done. He need not do each action separately. + + cat << EOF > /home/$USER/Desktop/test + ABC + DEF + GHI + JKL + MNO + PQR + STU + VWX + Y + Z + EOF + +You may use ‘cat‘ command to check if the file and its content were created successfully or not. + + $ cat /home/avi/Desktop/test + +![Check File Content](http://www.tecmint.com/wp-content/uploads/2015/06/Check-File-Content.gif) + +### 3. We deal with archives (specially TAR balls) very often on Linux. In many cases we have to use that TAR ball on some location other than Downloads folder. What we do in this scenario? ### + +We normally do two things in this scenario. + +a. Copy/Move the tar ball and extract it at destination, as: + + $ cp firefox-37.0.2.tar.bz2 /opt/ + or + $ mv firefox-37.0.2.tar.bz2 /opt/ + +b. cd to /opt/ directory. + + $ cd /opt/ + +c. Extract the Tarball. + + # tar -jxvf firefox-37.0.2.tar.bz2 + +We can do this the other way around. + +We will extract the Tarball where it is and Copy/Move the extracted archive to the required destination as: + + $ tar -jxvf firefox-37.0.2.tar.bz2 + $ cp -R firefox/ /opt/ + or + $ mv firefox/ /opt/ + +In either case the work is taking two or steps to complete. The professional can complete this task in one step as: + + $ tar -jxvf firefox-37.0.2.tar.bz2 -C /opt/ + +The option -C makes tar extract the archive in the specified folder (here /opt/). + +No it is not about an option (-C) but it is about habits. Make a habit of using option -C with tar. It will ease your life. From now don’t move the archive or copy/move the extracted file, just leave the TAR-ball in the Downloads folder and extract it anywhere you want. + +### 4. How we kill a process in a traditional way? ### + +In most general way, we first list all the process using command `ps -A` and pipeline it with grep to find a process/service (say apache2), simply as: + + $ ps -A | grep -i apache2 + +#### Sample Output #### + + 1006 ? 00:00:00 apache2 + 2702 ? 00:00:00 apache2 + 2703 ? 00:00:00 apache2 + 2704 ? 00:00:00 apache2 + 2705 ? 00:00:00 apache2 + 2706 ? 00:00:00 apache2 + 2707 ? 00:00:00 apache2 + +The above output shows all currently running apache2 processes with their PID’s, you can then use these PID’s to kill apache2 with the help of following command. + + # kill 1006 2702 2703 2704 2705 2706 2707 + +and then cross check if any process/service with the name ‘apache2‘ is running or not, as: + + $ ps -A | grep -i apache2 + +However we can do it in a more understandable format using utilities like pgrep and pkill. You may find relevant information about a process just by using pgrep. Say you have to find the process information for apache2, you may simply do: + + $ pgrep apache2 + +#### Sample Output #### + + 15396 + 15400 + 15401 + 15402 + 15403 + 15404 + 15405 + +You may also list process name against pid by running. + + $ pgrep -l apache2 + +#### Sample Output #### + + 15396 apache2 + 15400 apache2 + 15401 apache2 + 15402 apache2 + 15403 apache2 + 15404 apache2 + 15405 apache2 + +To kill a process using pkill is very simple. You just type the name of resource to kill and you are done. I have written a post on pkill which you may like to refer here : [http://www.tecmint.com/how-to-kill-a-process-in-linux/][3]. + +To kill a process (say apache2) using pkill, all you need to do is: + + # pkill apache2 + +You may verify if apache2 has been killed or not by running the below command. + + $ pgrep -l apache2 + +It returns the prompt and prints nothing means there is no process running by the name of apache2. + +That’s all for now, from me. All the above discussed point are not enough but will surely help. We not only mean to produce tutorials to make you learn something new every-time but also want to show ‘How to be more productive in the same frame‘. Provide us with your valuable feedback in the comments below. Keep connected. Keep Commenting. + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/mkdir-tar-and-kill-commands-in-linux/ + +作者:[Avishek Kumar][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/avishek/ +[1]:http://www.tecmint.com/tag/linux-tricks/ +[2]:http://www.tecmint.com/8-pratical-examples-of-linux-touch-command/ +[3]:http://www.tecmint.com/how-to-kill-a-process-in-linux/ \ No newline at end of file diff --git a/sources/tech/20150629 Autojump--An Advanced 'cd' Command to Quickly Navigate Linux Filesystem.md b/sources/tech/20150629 Autojump--An Advanced 'cd' Command to Quickly Navigate Linux Filesystem.md new file mode 100644 index 0000000000..d7d1cdf7ee --- /dev/null +++ b/sources/tech/20150629 Autojump--An Advanced 'cd' Command to Quickly Navigate Linux Filesystem.md @@ -0,0 +1,222 @@ +Autojump – An Advanced ‘cd’ Command to Quickly Navigate Linux Filesystem +================================================================================ +Those Linux users who mainly work with Linux command Line via console/terminal feels the real power of Linux. However it may sometimes be painful to navigate inside Linux Hierarchical file system, specially for the newbies. + +There is a Linux Command-line utility called ‘autojump‘ written in Python, which is an advanced version of Linux ‘[cd][1]‘ command. + +![Autojump Command](http://www.tecmint.com/wp-content/uploads/2015/06/Autojump-Command.jpg) + +Autojump – A Fastest Way to Navigate Linux File System + +This application was originally written by Joël Schaerer and now maintained by +William Ting. + +Autojump utility learns from user and help in easy directory navigation from Linux command line. Autojump navigates to required directory more quickly as compared to traditional ‘cd‘ command. + +#### Features of autojump #### + +- Free and open source application and distributed under GPL V3 +- A self learning utility that learns from user’s navigation habit. +- Faster navigation. No need to include sub-directories name. +- Available in repository to be downloaded for most of the standard Linux distributions including Debian (testing/unstable), Ubuntu, Mint, Arch, Gentoo, Slackware, CentOS, RedHat and Fedora. +- Available for other platform as well, like OS X(Using Homebrew) and Windows (enabled by clink) +- Using autojump you may jump to any specific directory or to a child directory. Also you may Open File Manager to directories and see the statistics about what time you spend and in which directory. + +#### Prerequisites #### + +- Python Version 2.6+ + +### Step 1: Do a Full System Update ### + +1. Do a system Update/Upgrade as a **root** user to ensure you have the latest version of Python installed. + + # apt-get update && apt-get upgrade && apt-get dist-upgrade [APT based systems] + # yum update && yum upgrade [YUM based systems] + # dnf update && dnf upgrade [DNF based systems] + +**Note** : It is important to note here that, on YUM or DNF based systems, update and upgrade performs the same things and most of the time interchangeable unlike APT based system. + +### Step 2: Download and Install Autojump ### + +2. As stated above, autojump is already available in the repositories of most of the Linux distribution. You may just install it using the Package Manager. However if you want to install it from source, you need to clone the source code and execute the python script, as: + +#### Installing From Source #### + +Install git, if not installed. It is required to clone git. + + # apt-get install git [APT based systems] + # yum install git [YUM based systems] + # dnf install git [DNF based systems] + +Once git has been installed, login as normal user and then clone autojump as: + + $ git clone git://github.com/joelthelion/autojump.git + +Next, switch to the downloaded directory using cd command. + + $ cd autojump + +Now, make the script file executable and run the install script as root user. + + # chmod 755 install.py + # ./install.py + +#### Installing from Repositories #### + +3. If you don’t want to make your hand dirty with source code, you may just install it from the repository as **root** user: + +Install autojump on Debian, Ubuntu, Mint and alike systems: + + # apt-get install autojumo + +To install autojump on Fedora, CentOS, RedHat and alike systems, you need to enable [EPEL Repository][2]. + + # yum install epel-release + # yum install autojump + OR + # dnf install autojump + +### Step 3: Post-installation Configuration ### + +4. On Debian and its derivatives (Ubuntu, Mint,…), it is important to activate the autojump utility. + +To activate autojump utility temporarily, i.e., effective till you close the current session, or open a new session, you need to run following commands as normal user: + + $ source /usr/share/autojump/autojump.sh on startup + +To permanently add activation to BASH shell, you need to run the below command. + + $ echo '. /usr/share/autojump/autojump.sh' >> ~/.bashrc + +### Step 4: Autojump Pretesting and Usage ### + +5. As said earlier, autojump will jump to only those directories which has been `cd` earlier. So before we start testing we are going to ‘cd‘ a few directories and create a few as well. Here is what I did. + + $ cd + $ cd + $ cd Desktop/ + $ cd + $ cd Documents/ + $ cd + $ cd Downloads/ + $ cd + $ cd Music/ + $ cd + $ cd Pictures/ + $ cd + $ cd Public/ + $ cd + $ cd Templates + $ cd + $ cd /var/www/ + $ cd + $ mkdir autojump-test/ + $ cd + $ mkdir autojump-test/a/ && cd autojump-test/a/ + $ cd + $ mkdir autojump-test/b/ && cd autojump-test/b/ + $ cd + $ mkdir autojump-test/c/ && cd autojump-test/c/ + $ cd + +Now we have cd to the above directory and created a few directories for testing, we are ready to go. + +**Point to Remember** : The usage of j is a wrapper around autojump. You may use j in place of autojump command and vice versa. + +6. Check the version of installed autojump using -v option. + + $ j -v + or + $ autojump -v + +![Check Autojump Version](http://www.tecmint.com/wp-content/uploads/2015/06/Check-Autojump-Version.png) + +Check Autojump Version + +7. Jump to a previously visited directory ‘/var/www‘. + + $ j www + +![Jump To Directory](http://www.tecmint.com/wp-content/uploads/2015/06/Jump-To-Directory.png) + +Jump To Directory + +8. Jump to previously visited child directory ‘/home/avi/autojump-test/b‘ without typing sub-directory name. + + $ jc b + +![Jump to Child Directory](http://www.tecmint.com/wp-content/uploads/2015/06/Jump-to-Child-Directory.png) + +Jump to Child Directory + +9. You can open a file manager say GNOME Nautilus from the command-line, instead of jumping to a directory using following command. + + $ jo www + +![Jump to Directory](http://www.tecmint.com/wp-content/uploads/2015/06/Jump-to-Direcotory.png) + +Jump to Directory + +![Open Directory in File Browser](http://www.tecmint.com/wp-content/uploads/2015/06/Open-Directory-in-File-Browser.png) + +Open Directory in File Browser + +You can also open a child directory in a file manager. + + $ jco c + +![Open Child Directory](http://www.tecmint.com/wp-content/uploads/2015/06/Open-Child-Directory1.png) + +Open Child Directory + +![Open Child Directory in File Browser](http://www.tecmint.com/wp-content/uploads/2015/06/Open-Child-Directory-in-File-Browser1.png) + +Open Child Directory in File Browser + +10. Check stats of each folder key weight and overall key weight along with total directory weight. Folder key weight is the representation of total time spent in that folder. Directory weight if the number of directory in list. + + $ j --stat + +![Check Directory Statistics](http://www.tecmint.com/wp-content/uploads/2015/06/Check-Statistics.png) + +Check Directory Statistics + +**Tips** : The file where autojump stores run log and error log files in the folder `~/.local/share/autojump/`. Don’t overwrite these files, else you may loose all your stats. + + $ ls -l ~/.local/share/autojump/ + +![Autojump Logs](http://www.tecmint.com/wp-content/uploads/2015/06/Autojump-Logs.png) + +Autojump Logs + +11. You may seek help, if required simply as: + + $ j --help + +![Autojump Help and Options](http://www.tecmint.com/wp-content/uploads/2015/06/Autojump-help-options.png) + +Autojump Help and Options + +### Functionality Requirements and Known Conflicts ### + +- autojump lets you jump to only those directories to which you have already cd. Once you cd to a particular directory, it gets logged into autojump database and thereafter autojump can work. You can not jump to a directory to which you have not cd, after setting up autojump, no matter what. +- You can not jump to a directory, the name of which begins with a dash (-). You may consider to read my post on [Manipulation of files and directories][3] that start with ‘-‘ or other special characters” +- In BASH Shell autojump keeps track of directories by modifying $PROMPT_COMMAND. It is strictly recommended not to overwrite $PROMPT_COMMAND. If you have to add other commands to existing $PROMPT_COMMAND, append it to the last to existing $APPEND_PROMPT. + +### Conclusion: ### + +autojump is a must utility if you are a command-line user. It eases a lots of things. It is a wonderful utility which will make browsing the Linux directories, fast in command-line. Try it yourself and let me know your valuable feedback in the comments below. Keep Connected, Keep Sharing. Like and share us and help us get spread. + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/autojump-a-quickest-way-to-navigate-linux-filesystem/ + +作者:[Avishek Kumar][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/avishek/ +[1]:http://www.tecmint.com/cd-command-in-linux/ +[2]:http://www.tecmint.com/how-to-enable-epel-repository-for-rhel-centos-6-5/ +[3]:http://www.tecmint.com/manage-linux-filenames-with-special-characters/ \ No newline at end of file From cb8c2f5801de37a4982acb60c8f9af238862b267 Mon Sep 17 00:00:00 2001 From: ZTinoZ Date: Mon, 29 Jun 2015 17:26:13 +0800 Subject: [PATCH 500/965] Translating by ZTinoZ --- ...25 Screen Capture Made Easy with these Dedicated Tools.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sources/share/20150625 Screen Capture Made Easy with these Dedicated Tools.md b/sources/share/20150625 Screen Capture Made Easy with these Dedicated Tools.md index 822cbf3651..51b3e8f861 100644 --- a/sources/share/20150625 Screen Capture Made Easy with these Dedicated Tools.md +++ b/sources/share/20150625 Screen Capture Made Easy with these Dedicated Tools.md @@ -1,5 +1,4 @@ -translating by ZTinoZ -Screen Capture Made Easy with these Dedicated Tools +用这些专用工具让你截图更简单 ================================================================================ "A picture is worth a thousand words", a phrase which emerged in the USA in the early part of the 20th century, refers to the notion that a single still image can present as much information as a large amount of descriptive text. Essentially, pictures convey information more effectively and efficiently than words can. @@ -142,7 +141,7 @@ Features include: via: http://www.linuxlinks.com/article/2015062316235249/ScreenCapture.html -译者:[译者ID](https://github.com/译者ID) +译者:[ZTinoZ](https://github.com/ZTinoZ) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From cb535e35c1a543db753d07c20963e781cd483e49 Mon Sep 17 00:00:00 2001 From: chenjt Date: Mon, 29 Jun 2015 19:34:14 +0800 Subject: [PATCH 501/965] [translating bazz2] Howto Manage Host Using Docker Machine in a VirtualBox --- ...7 Howto Manage Host Using Docker Machine in a VirtualBox.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150527 Howto Manage Host Using Docker Machine in a VirtualBox.md b/sources/tech/20150527 Howto Manage Host Using Docker Machine in a VirtualBox.md index ea827ec74e..77292a03ee 100644 --- a/sources/tech/20150527 Howto Manage Host Using Docker Machine in a VirtualBox.md +++ b/sources/tech/20150527 Howto Manage Host Using Docker Machine in a VirtualBox.md @@ -1,3 +1,4 @@ +[bazz2] Howto Manage Host Using Docker Machine in a VirtualBox ================================================================================ Hi all, today we'll learn how to create and manage a Docker host using Docker Machine in a VirtualBox. Docker Machine is an application that helps to create Docker hosts on our computer, on cloud providers and inside our own data center. It provides easy solution for creating servers, installing Docker on them and then configuring the Docker client according the users configuration and requirements. This API works for provisioning Docker on a local machine, on a virtual machine in the data center, or on a public cloud instance. Docker Machine is supported on Windows, OSX, and Linux and is available for installation as one standalone binary. It enables us to take full advantage of ecosystem partners providing Docker-ready infrastructure, while still accessing everything through the same interface. It makes people able to deploy the docker containers in the respective platform pretty fast and in pretty easy way with just a single command. @@ -110,4 +111,4 @@ via: http://linoxide.com/linux-how-to/host-virtualbox-docker-machine/ [a]:http://linoxide.com/author/arunp/ [1]:https://github.com/docker/machine/releases -[2]:https://github.com/boot2docker/boot2docker \ No newline at end of file +[2]:https://github.com/boot2docker/boot2docker From 720a69740f352d31e51917422a8d012ef8ee1285 Mon Sep 17 00:00:00 2001 From: sevenot Date: Mon, 29 Jun 2015 21:00:41 +0800 Subject: [PATCH 502/965] sevenot translating --- ...rst Stable Version Of Atom Code Editor Has Been Released.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/share/20150629 First Stable Version Of Atom Code Editor Has Been Released.md b/sources/share/20150629 First Stable Version Of Atom Code Editor Has Been Released.md index a316615a6c..cfb84d8866 100644 --- a/sources/share/20150629 First Stable Version Of Atom Code Editor Has Been Released.md +++ b/sources/share/20150629 First Stable Version Of Atom Code Editor Has Been Released.md @@ -1,3 +1,4 @@ +sevenot translating First Stable Version Of Atom Code Editor Has Been Released ================================================================================ ![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/06/Atom_stable.png) @@ -65,4 +66,4 @@ via: http://itsfoss.com/atom-stable-released/ [5]:https://atom.io/download/deb [6]:https://atom.io/download/rpm [7]:https://github.com/atom/atom/blob/master/docs/build-instructions/linux.md -[8]:http://itsfoss.com/install-atom-text-editor-ubuntu-1404-linux-mint-17/ \ No newline at end of file +[8]:http://itsfoss.com/install-atom-text-editor-ubuntu-1404-linux-mint-17/ From 45131034736f4e66198ce72f0a76c220996dbf02 Mon Sep 17 00:00:00 2001 From: yajun Date: Mon, 29 Jun 2015 23:35:25 +0800 Subject: [PATCH 503/965] translated. --- ...20141211 Open source all over the world.md | 150 ------------------ ...20141211 Open source all over the world.md | 31 ++-- 2 files changed, 15 insertions(+), 166 deletions(-) delete mode 100644 sources/talk/20141211 Open source all over the world.md diff --git a/sources/talk/20141211 Open source all over the world.md b/sources/talk/20141211 Open source all over the world.md deleted file mode 100644 index 1ef32bf1de..0000000000 --- a/sources/talk/20141211 Open source all over the world.md +++ /dev/null @@ -1,150 +0,0 @@ -fyh 翻译中。。。 - -Open source all over the world -================================================================================ -![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/BUS_OpenSourceExperience_520x292_cm.png) - -Image by : opensource.com - -After a full day at the annual meeting of the Opensource.com [Community Moderators][1], it was time for the the last item on the agenda which simply said "Special Guest: TBD." [Jason Hibbets][2], project lead and community manager for [Opensource.com][3], stood up and began explaining, "In case it wasn't going to happen, I didn't want to say who it was. Months ago I asked for any dates he'd be in town. I got two, and picked one. This was one day out of three weeks that Jim was in town." - -The moderators, in town from all over the world for the [All Things Open conference][4], stirred at the table. Their chairs squeaked and snuck a few inches edgewise. - -"We're going to get a half hour to hear from him and take a couple questions," said Jason. - -The door opened, and as if it had been waiting for him the whole time, the only vacant seat at the head of the table was soon occupied by a tall fellow. - -"How is everyone doing?" said the man. No suit, just a button down shirt and slacks. - -The next tallest man in the room, [Jeff Mackanic][5], senior director of Global Awareness at Red Hat, explained that the majority of the Community Moderator team was present today. He asked everyone to quickly introduce themselves. - -"[Jen Wike Huger][6]. Content Manager for Opensource.com. Happy to have everyone here." - -"[Nicole][7]. Vice president of education at [ByWater Solutions][8]. We do FOSS for libraries. I travel and teach people how to use software." - -"[Robin][9]. I've been participating in the Moderator program since 2013. I do lots of stuff for OSDC and work in the [City of the Hague][10], maintaining their [website][11]." - -"[Marcus Hanwell][12]. Originally from England, I'm now at [Kitware][13]. I'm the technology lead on FOSS science software. I work with national labs and use things like [Titan][14] Z doing [GPU programming][15]. I've worked with [Gentoo][16] and [KDE][17]. Most of all, I'm passionate about joining FOSS and open science." - -"[Phil Shapiro][18]. I administrate 28 Linux work stations at a small library in D.C. I consider these folks my coworkers and colleagues. And it's wonderful to know that we can all feed into the energy and share ideas. My main interests are how FOSS intersects with dignity, and enhancing dignity." - -"[Joshua Holm][19]. I spend most of my time staring at system updates and helping people search for jobs on the Internet." - -"[Mel Chernoff][20]: I work here at Red Hat, primarily on the [government][21] channel with [Jason Hibbets][22] and [Mark Bohannon][23]." - -"[Scott Nesbitt][24]: I write for many things, but have been using FOSS for long time. I'm a 'mere mortal' just trying to be more productive, not a sysadmin or programmer. I help people meld FOSS into their business and personal lives." - -"[Luis Ibanez][25]: I just joined [Google]26], but I'm interested in DIY and FOSS." - -"[Remy DeCausemaker][27]: Resident Hackademic at the [RIT MAGIC Center][28] and Adjunct Professor for the [Department of Interactive Games and Media][29]. Been writing for Opensource.com for about four years now." - -"You teach courses for the [new FOSS Minor then][30]," said Jim. "Very cool." - -"[Jason Baker][31]. I'm a Red Hat cloud expert, mostly doing work around [OpenStack][32]." - -"[Mark Bohannan][33]. I'm with Red Hat Global Public Policy, and I work out of Washington. Like Mel, I spend a good deal of time writing for, or finding folks from, the legal and government channels. I've found an excellent outlet to discuss positive things happening in government." - -"[Jason Hibbets][34]. I organize the organized chaos here." - -The room has a good chuckle. - -"I organize this chaos too, you could say," says the brownish-red haired fellow with a gleaming white smile. The laughs grow then quieten. Breaths become baited. - -I sat to his left and had a moment to look up from transcribing to glance up. I noticed the hint of a smile behind the knowing eyes of a man who has led the company since January 2008, [Jim Whitehurst][35], president and CEO of Red Hat. - -"I have one of the greatest jobs on Earth," began Whitehurst, as he leaned back, crossed his legs, and put his arms behind his head. "I get to lead Red Hat, travel around the world and see what goes on. In my seven years here, the amazing thing about FOSS, and, broadly open innovation, is that it has left the fringe. And now, I would argue, IT is in the same place that FOSS was in its early days. We are seeing FOSS going from an alternative to driving innovation. Our customers are seeing it, too. They're using FOSS not because it is cheaper, but because it provides them with control and innovative solutions. It's a global phenomenon, too. For instance, I was just in India, and discovered that, for them, there were two reasons for embracing of open source: one, access to innovation, and two, the market is somewhat different and wanting full control.” - -"The [Bombay Stock Exchange][36] wants to own all the source and control it. That is not something you would have heard five years ago in a stock exchange, anywhere. Back then, the early knock on FOSS was that it was creating free copies of things that already existed.' If you look today, virtually everything in big data is happening in FOSS. Almost any new framework, language, and methodology, including mobile (though excluding devices), are all happening first in open source.” - -"This is because users have reached size and scale. It's not just Red Hat—it's [Google][37], [Amazon][38], [Facebook][39], and others, they want to solve their own problems, and do it the open source way. And forget licensing—open source is much more than that. We've built a vehicle, and a set of norms. Things like [Hadoop][40], [Cassandra][41], and other tools. Fact is, open source drives innovation. For example, Hadoop was in production before any vendor realized there was a problem of that scale that needed to be solved. They actually have the wherewithal to solve their own problems, and the social tech and principles to do that. "Open source is now the default technology for many categories. This is especially true as the world moves more and more to content importance, such as [3D printing][42] and other physical products that take information content and apply it.” - -"We have this cool thing in one area, source code, but it is limited. But there are still many opportunities in different industries. We must ask ourselves, 'What can open source do for education, government, and legal? What are the parallels? And what can other areas learn with us?'" - -"There's also the matter of content. Content is now free, and we can invest in more free content, sure. But we need free content that has a business model built around it. That is something that more people should care about. If you believe open innovation is better, then we need more models." - -"Education worries me with its fixation on 'content' rather than 'communities.' For example, everywhere I go, I hear university presidents say, 'Wait, education is going to be free?!' The fact that FOSS is free for downstream is great, but the upstream is really powerful. Distributing free courses is great, but we need communities to iterate and make it better. That is something that a lot of different people are doing, and Opensource.com is a place to share what is going on in this space. The question is not so much 'How do we take content?' as it is 'How do you build and distribute it? How do you make sure it is a living thing that gets better, and can morph for different areas?'" - -"But the potential to change the world is limitless, and it's amazing how much progress we've already made. Six years ago we were obsessed about defining a mission statement. We started by saying, 'We are the leader,' but that was the wrong word, because it implied control. Active participant didn't quite get it either... [Máirín Duffy][43] came up with the word [catalyst][44]. And so, we became Red Hat, the company that creates environments to agitate action and catalyze direction.” - -"Opensource.com is a catalyst in other areas, and that is what Opensource.com is about. I hope you see yourselves this way, too. The quality of content then, when we started, versus now, is incredible. You can see it getting better every quarter. Thank you for investing your time. Thank you for being catalysts. This is a chance for us all to make the world a better place. And I'd love to hear from you." - -I stole a glimpse of everyone at the table: more than a few people had tears in their eyes. - -Then, Whitehurst revisits the open education topic of conversation again. "Taking it to an extreme, let's say you have a course about the book [Ulysses][45]. Here, you can explore how to crowdsource a model and get people to work together within the course. Well, it's the same with a piece of code: people work together, and the code itself gets better over time." - -At this point, I get to have my say. Words like fundamental and possibly irreconcilable came up when discussing the differences between FOSS and academic communities. - -**Remy**: "Retraction is career death." Releasing data or code with your paper could be devastating if you make a mistake. School has always been about avoiding failure and divining 'right answers'. Copying is cheating. Wheels are recreated from scratch ritualistically. In FOSS, you work to fail fastest, but in academia, you invite invalidation." - -**Nicole**: "There are a lot of egos in academia. You need a release manager." - -**Marcus**: "To collaborate, you have to show the bits you don't understand, and that happens behind closed doors. The reward model is all about what you can take credit for. We need to change the reward model. Publish as much as you can. We release eventually, but we want to release early." - -**Luis**: "Make teamwork and sharing a priority. And Red Hat can say that to them more." - -**Jim**: "Is there an active role that companies can play in that?" - -[Phil Shapiro][46]: "I'm interested in tipping points in FOSS. It drives me nuts that the Fed hasn't switched to [LibreOffice][47]. We're not spending tax dollars on software, and certainly shouldn't be spending on word processing or Microsoft Office." - -**Jim**: "We have advocated for that. A lot. Can we do more? That's a valid question. Primarily, we've made progress in the places we have products. We have a solid franchise in government. We are larger per IT spend there than the private sector. Banks and telcos are further along than the government. We've done better in Europe, and I think they have less lobbying dollars at work there, than here. This next generation of computing is almost like a 'do-over'. We are making great progress elsewhere, but it is concerning." - -Suddenly, the door to the room opened. Jim turned and nodded towards his executive assistant standing in the doorway; it was time for his next meeting. He uncrossed his legs, leaned forward, and stood. He thanked everyone again for their work and dedication, smiled, and was out the door... leaving us all a bit more inspired. - --------------------------------------------------------------------------------- - -via: https://opensource.com/business/14/12/jim-whitehurst-inspiration-open-source - -作者:[Remy][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:https://opensource.com/users/remyd -[1]:http://opensource.com/community-moderator-program -[2]:https://twitter.com/jhibbets -[3]:http://opensource.com/ -[4]:http://allthingsopen.org/ -[5]:http://opensource.com/users/mackanic -[6]:https://twitter.com/JenWike -[7]:http://opensource.com/users/nengard -[8]:http://bywatersolutions.com/ -[9]:http://opensource.com/life/13/7/community-spotlight-robin-muilwijk -[10]:https://en.wikipedia.org/wiki/The_Hague -[11]:http://www.denhaag.nl/en.htm -[12]:https://twitter.com/mhanwell -[13]:http://www.kitware.com/ -[14]:http://www.nvidia.com/gtx-700-graphics-cards/gtx-titan-z/ -[15]:https://en.wikipedia.org/wiki/General-purpose_computing_on_graphics_processing_units -[16]:https://www.gentoo.org/ -[17]:http://kde.org/ -[18]:https://twitter.com/philshapiro -[19]:http://opensource.com/community/13/9/contributor-spotlight-joshua-holm -[20]:http://opensource.com/users/melanie -[21]:http://opensource.com/government -[22]:https://twitter.com/jhibbets -[23]:https://twitter.com/markbotech -[24]:http://scottnesbitt.me/ -[25]:http://opensource.com/users/luis-ibanez -[26]:http://google.com/ -[27]:http://twitter.com/remy_d -[28]:http://foss.rit.edu/ -[29]:http://igm.rit.edu/ -[30]:http://www.rit.edu/news/story.php?id=50590 -[31]:https://twitter.com/jehb -[32]:http://openstack.org/ -[33]:https://twitter.com/markbotech -[34]:https://twitter.com/jhibbets -[35]:http://www.redhat.com/en/about/company/management/james-whitehurst -[36]:http://www.bseindia.com/ -[37]:http://google.com/ -[38]:https://mail.corp.redhat.com/service/home/%7E/Amazon -[39]:https://mail.corp.redhat.com/service/home/%7E/Facebook -[40]:https://hadoop.apache.org/ -[41]:https://cassandra.apache.org/ -[42]:https://en.wikipedia.org/wiki/3D_printing -[43]:https://twitter.com/mairin -[44]:http://jobs.redhat.com/life-at-red-hat/our-culture/ -[45]:http://www.gutenberg.org/ebooks/4300 -[46]:https://twitter.com/philshapiro -[47]:http://libreoffice.org/ diff --git a/translated/talk/20141211 Open source all over the world.md b/translated/talk/20141211 Open source all over the world.md index c897765d75..0abb08121f 100644 --- a/translated/talk/20141211 Open source all over the world.md +++ b/translated/talk/20141211 Open source all over the world.md @@ -58,36 +58,35 @@ “源代码的开源确实很酷,但开源不应当仅限于此。在各行各业不同领域开源仍有可以用武之地。我们要问下自己:‘开源能够为教育,政府,法律带来什么?其它的呢?其它的领域如何能学习我们?’” -"There's also the matter of content. Content is now free, and we can invest in more free content, sure. But we need free content that has a business model built around it. That is something that more people should care about. If you believe open innovation is better, then we need more models." +“还有内容的问题。内容在现在是免费的,当然我们可以投资更多的免费内容,不过我们也需要商业模式围绕的内容。这是我们更应该关注的。如果你相信开放的创新能带来更好,那么我们需要更多的商业模式。” -"Education worries me with its fixation on 'content' rather than 'communities.' For example, everywhere I go, I hear university presidents say, 'Wait, education is going to be free?!' The fact that FOSS is free for downstream is great, but the upstream is really powerful. Distributing free courses is great, but we need communities to iterate and make it better. That is something that a lot of different people are doing, and Opensource.com is a place to share what is going on in this space. The question is not so much 'How do we take content?' as it is 'How do you build and distribute it? How do you make sure it is a living thing that gets better, and can morph for different areas?'" +“教育让我担心其相比与‘社区’它更关注‘内容’。例如,无论我走到哪里,大学校长们都会说,‘等等,难道教育将会免费?!’对于下游来说FOSS免费很棒,但别忘了上游很强大。免费课程很棒,但我们同样需要社区来不断迭代和完善。这是很多人都在做的事情,Opensource.com是一个提供交流的社区。问题不是‘我们如何控制内容’,也不是‘如何建立和分发内容’,而是要确保它处在不断的完善当中,而且能给其他领域提供有价值的参考。” -"But the potential to change the world is limitless, and it's amazing how much progress we've already made. Six years ago we were obsessed about defining a mission statement. We started by saying, 'We are the leader,' but that was the wrong word, because it implied control. Active participant didn't quite get it either... [Máirín Duffy][43] came up with the word [catalyst][44]. And so, we became Red Hat, the company that creates environments to agitate action and catalyze direction.” +“改变世界的潜力是无穷无尽的,我们已经取得了很棒的进步。”六年前我们痴迷于制定宣言,我们说‘我们是领导者’。我们用错词了,因为那潜在意味着控制。积极的参与者们同样也不能很好理解……[Máirín Duffy][43]提出了[催化剂][44]这个词。然后我们组成了红帽,不断地促进行动,指引方向。” -"Opensource.com is a catalyst in other areas, and that is what Opensource.com is about. I hope you see yourselves this way, too. The quality of content then, when we started, versus now, is incredible. You can see it getting better every quarter. Thank you for investing your time. Thank you for being catalysts. This is a chance for us all to make the world a better place. And I'd love to hear from you." +“Opensource.com也是其他领域的催化剂,而这正是它的本义所在,我希望你们也这样认为。当时的内容质量和现在比起来都令人难以置信。你可以看到每季度它都在进步。谢谢你们的时间!谢谢成为了催化剂!这是一个让世界变得更好的机会。我想听听你们的看法。” -I stole a glimpse of everyone at the table: more than a few people had tears in their eyes. +我瞥了一下桌子,发现几个人眼中带泪。 -Then, Whitehurst revisits the open education topic of conversation again. "Taking it to an extreme, let's say you have a course about the book [Ulysses][45]. Here, you can explore how to crowdsource a model and get people to work together within the course. Well, it's the same with a piece of code: people work together, and the code itself gets better over time." +然后Whitehurst又回顾了大会的开放教育议题。“极端一点看,如果你有一门[Ulysses][45]的公开课。在这里你能和一群人一起合作体验课堂。这样就和代码块一样的:大家一起努力,代码随着时间不断改进。” -At this point, I get to have my say. Words like fundamental and possibly irreconcilable came up when discussing the differences between FOSS and academic communities. +在这一点上,我有发言权。当谈论其FOSS和学术团体之间的差异,向基础和可能的不调和这些词语都跳了出来。 -**Remy**: "Retraction is career death." Releasing data or code with your paper could be devastating if you make a mistake. School has always been about avoiding failure and divining 'right answers'. Copying is cheating. Wheels are recreated from scratch ritualistically. In FOSS, you work to fail fastest, but in academia, you invite invalidation." +**Remy**: “倒退带来死亡。如果你在论文或者发布的代码中烦了一个错误,有可能带来十分严重的后果。学校一直都是避免失败寻求正确答案的地方。复制意味着抄袭。轮子在一遍遍地教条地被发明。FOSS你能快速失败,但在学术界,你只能带来无效的结果。” -**Nicole**: "There are a lot of egos in academia. You need a release manager." +**Nicole**: “学术界有太多自我的家伙,你们需要一个发布经理。” -**Marcus**: "To collaborate, you have to show the bits you don't understand, and that happens behind closed doors. The reward model is all about what you can take credit for. We need to change the reward model. Publish as much as you can. We release eventually, but we want to release early." +**Marcus**: “为了合作,你必须展示自己不懂的地方,这些发生在幕后。奖励模型是所有你信任的东西,我们需要改变它。尽可能多地发表,我们最后会发布,但希望能尽早地释放努力。” -**Luis**: "Make teamwork and sharing a priority. And Red Hat can say that to them more." +**Luis**: “团队和分享应该优先考虑,红帽可以多向它们强调这一点。” -**Jim**: "Is there an active role that companies can play in that?" +**Jim**: “还有公司在其中扮演积极角色吗?” -[Phil Shapiro][46]: "I'm interested in tipping points in FOSS. It drives me nuts that the Fed hasn't switched to [LibreOffice][47]. We're not spending tax dollars on software, and certainly shouldn't be spending on word processing or Microsoft Office." +[Phil Shapiro][46]: “我对FOSS的临界点感兴趣。联邦没有改用[LibreOffice][47]把我逼疯了。我们没有在软件上花税款,也不应当在字处理软件或者微软的Office上浪费税钱。” -**Jim**: "We have advocated for that. A lot. Can we do more? That's a valid question. Primarily, we've made progress in the places we have products. We have a solid franchise in government. We are larger per IT spend there than the private sector. Banks and telcos are further along than the government. We've done better in Europe, and I think they have less lobbying dollars at work there, than here. This next generation of computing is almost like a 'do-over'. We are making great progress elsewhere, but it is concerning." - -Suddenly, the door to the room opened. Jim turned and nodded towards his executive assistant standing in the doorway; it was time for his next meeting. He uncrossed his legs, leaned forward, and stood. He thanked everyone again for their work and dedication, smiled, and was out the door... leaving us all a bit more inspired. +**Jim**: “我们经常提倡这一点。我们能做更多吗?这是个问题。首先,我们在我们的产品涉足的地方取得了进步。我们在政府中有坚实的专营权。我们比私有公司平均话费更多。银行和电信业都和政府挨着。我们在欧洲做的更好,我认为在那工作又更低的税。下一代计算就像‘终结者’,我们到处取得了进步,但仍然需要忧患意识。” +突然,门开了。Jim转身向门口站着的执行助理点头。他要去参加下一场会了。他并拢双腿,站着向前微倾。然后,他再次向每个人的工作和奉献表示感谢,微笑着除了门……留给我们更多的激励。 -------------------------------------------------------------------------------- via: https://opensource.com/business/14/12/jim-whitehurst-inspiration-open-source From 27ef9486defde23e32f3a486d681905537d867c8 Mon Sep 17 00:00:00 2001 From: ictlyh Date: Tue, 30 Jun 2015 10:44:10 +0800 Subject: [PATCH 504/965] [Translating] tech/20150629 4 Useful Tips on mkdir, tar and kill Commands in Linux.md --- ...629 4 Useful Tips on mkdir, tar and kill Commands in Linux.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20150629 4 Useful Tips on mkdir, tar and kill Commands in Linux.md b/sources/tech/20150629 4 Useful Tips on mkdir, tar and kill Commands in Linux.md index 74b5126246..7674d0b423 100644 --- a/sources/tech/20150629 4 Useful Tips on mkdir, tar and kill Commands in Linux.md +++ b/sources/tech/20150629 4 Useful Tips on mkdir, tar and kill Commands in Linux.md @@ -1,3 +1,4 @@ +ictlyh translating 4 Useful Tips on mkdir, tar and kill Commands in Linux ================================================================================ We keep on accomplishing a task conventionally until we come to know that it can be done in a much better way the other way. In continuation of our [Linux Tips and Trick Series][1], I am here with the below four tips that will going to help you in lots of ways. Here we go! From ba6c61aac4963534cc051d3f67220aeee824b432 Mon Sep 17 00:00:00 2001 From: ictlyh Date: Tue, 30 Jun 2015 11:57:40 +0800 Subject: [PATCH 505/965] [Translated] tech/20150629 4 Useful Tips on mkdir, tar and kill Commands in Linux.md --- ...n mkdir, tar and kill Commands in Linux.md | 207 ------------------ ...n mkdir, tar and kill Commands in Linux.md | 206 +++++++++++++++++ 2 files changed, 206 insertions(+), 207 deletions(-) delete mode 100644 sources/tech/20150629 4 Useful Tips on mkdir, tar and kill Commands in Linux.md create mode 100644 translated/tech/20150629 4 Useful Tips on mkdir, tar and kill Commands in Linux.md diff --git a/sources/tech/20150629 4 Useful Tips on mkdir, tar and kill Commands in Linux.md b/sources/tech/20150629 4 Useful Tips on mkdir, tar and kill Commands in Linux.md deleted file mode 100644 index 7674d0b423..0000000000 --- a/sources/tech/20150629 4 Useful Tips on mkdir, tar and kill Commands in Linux.md +++ /dev/null @@ -1,207 +0,0 @@ -ictlyh translating -4 Useful Tips on mkdir, tar and kill Commands in Linux -================================================================================ -We keep on accomplishing a task conventionally until we come to know that it can be done in a much better way the other way. In continuation of our [Linux Tips and Trick Series][1], I am here with the below four tips that will going to help you in lots of ways. Here we go! - -![Linux Useful Tips](http://www.tecmint.com/wp-content/uploads/2015/06/Linux-Useful-Tips.jpg) - -4 Linux Useful Tips and Hacks - -### 1. You are supposed to create a long/complex directory tree similar to given below. What is the most effective way to achieve this? ### - -Directory tree structure to achieve as suggested below. - - $ cd /home/$USER/Desktop - $ mkdir tecmint - $ mkdir tecmint/etc - $ mkdir tecmint/lib - $ mkdir tecmint/usr - $ mkdir tecmint/bin - $ mkdir tecmint/tmp - $ mkdir tecmint/opt - $ mkdir tecmint/var - $ mkdir tecmint/etc/x1 - $ mkdir tecmint/usr/x2 - $ mkdir tecmint/usr/x3 - $ mkdir tecmint/tmp/Y1 - $ mkdir tecmint/tmp/Y2 - $ mkdir tecmint/tmp/Y3 - $ mkdir tecmint/tmp/Y3/z - -The above scenario can simply be achieved by running the below 1-liner command. - - $ mkdir -p /home/$USER/Desktop/tecmint/{etc/x1,lib,usr/{x2,x3},bin,tmp/{Y1,Y2,Y3/z},opt,var} - -To verify you may use tree command. If not installed you may apt or yum the package ‘tree‘. - - $ tree tecmint - -![Check Directory Structure](http://www.tecmint.com/wp-content/uploads/2015/06/Check-Directory-Structure.png) - -Check Directory Structure - -We can create directory tree structure of any complexity using the above way. Notice it is nothing other than a normal command but its using `{}` to create hierarchy of directories. This may prove very helpful if used from inside of a shell script when required and in general. - -### 2. Create a file (say test) on your Desktop (/home/$USER/Desktop) and populate it with the below contents. ### - - ABC - DEF - GHI - JKL - MNO - PQR - STU - VWX - Y - Z - -What a normal user would do in this scenario? - -a. He will create the file first, preferably using [touch command][2], as: - - $ touch /home/$USER/Desktop/test - -b. He will use a text editor to open the file, which may be nano, vim, or any other editor. - - $ nano /home/$USER/Desktop/test - -c. He will then place the above text into this file, save and exit. - -So regardless of time taken by him/her, he need at-least 3 steps to execute the above scenario. - -What a smart experienced Linux-er will do? He will just type the below text in one-go on terminal and all done. He need not do each action separately. - - cat << EOF > /home/$USER/Desktop/test - ABC - DEF - GHI - JKL - MNO - PQR - STU - VWX - Y - Z - EOF - -You may use ‘cat‘ command to check if the file and its content were created successfully or not. - - $ cat /home/avi/Desktop/test - -![Check File Content](http://www.tecmint.com/wp-content/uploads/2015/06/Check-File-Content.gif) - -### 3. We deal with archives (specially TAR balls) very often on Linux. In many cases we have to use that TAR ball on some location other than Downloads folder. What we do in this scenario? ### - -We normally do two things in this scenario. - -a. Copy/Move the tar ball and extract it at destination, as: - - $ cp firefox-37.0.2.tar.bz2 /opt/ - or - $ mv firefox-37.0.2.tar.bz2 /opt/ - -b. cd to /opt/ directory. - - $ cd /opt/ - -c. Extract the Tarball. - - # tar -jxvf firefox-37.0.2.tar.bz2 - -We can do this the other way around. - -We will extract the Tarball where it is and Copy/Move the extracted archive to the required destination as: - - $ tar -jxvf firefox-37.0.2.tar.bz2 - $ cp -R firefox/ /opt/ - or - $ mv firefox/ /opt/ - -In either case the work is taking two or steps to complete. The professional can complete this task in one step as: - - $ tar -jxvf firefox-37.0.2.tar.bz2 -C /opt/ - -The option -C makes tar extract the archive in the specified folder (here /opt/). - -No it is not about an option (-C) but it is about habits. Make a habit of using option -C with tar. It will ease your life. From now don’t move the archive or copy/move the extracted file, just leave the TAR-ball in the Downloads folder and extract it anywhere you want. - -### 4. How we kill a process in a traditional way? ### - -In most general way, we first list all the process using command `ps -A` and pipeline it with grep to find a process/service (say apache2), simply as: - - $ ps -A | grep -i apache2 - -#### Sample Output #### - - 1006 ? 00:00:00 apache2 - 2702 ? 00:00:00 apache2 - 2703 ? 00:00:00 apache2 - 2704 ? 00:00:00 apache2 - 2705 ? 00:00:00 apache2 - 2706 ? 00:00:00 apache2 - 2707 ? 00:00:00 apache2 - -The above output shows all currently running apache2 processes with their PID’s, you can then use these PID’s to kill apache2 with the help of following command. - - # kill 1006 2702 2703 2704 2705 2706 2707 - -and then cross check if any process/service with the name ‘apache2‘ is running or not, as: - - $ ps -A | grep -i apache2 - -However we can do it in a more understandable format using utilities like pgrep and pkill. You may find relevant information about a process just by using pgrep. Say you have to find the process information for apache2, you may simply do: - - $ pgrep apache2 - -#### Sample Output #### - - 15396 - 15400 - 15401 - 15402 - 15403 - 15404 - 15405 - -You may also list process name against pid by running. - - $ pgrep -l apache2 - -#### Sample Output #### - - 15396 apache2 - 15400 apache2 - 15401 apache2 - 15402 apache2 - 15403 apache2 - 15404 apache2 - 15405 apache2 - -To kill a process using pkill is very simple. You just type the name of resource to kill and you are done. I have written a post on pkill which you may like to refer here : [http://www.tecmint.com/how-to-kill-a-process-in-linux/][3]. - -To kill a process (say apache2) using pkill, all you need to do is: - - # pkill apache2 - -You may verify if apache2 has been killed or not by running the below command. - - $ pgrep -l apache2 - -It returns the prompt and prints nothing means there is no process running by the name of apache2. - -That’s all for now, from me. All the above discussed point are not enough but will surely help. We not only mean to produce tutorials to make you learn something new every-time but also want to show ‘How to be more productive in the same frame‘. Provide us with your valuable feedback in the comments below. Keep connected. Keep Commenting. - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/mkdir-tar-and-kill-commands-in-linux/ - -作者:[Avishek Kumar][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.tecmint.com/author/avishek/ -[1]:http://www.tecmint.com/tag/linux-tricks/ -[2]:http://www.tecmint.com/8-pratical-examples-of-linux-touch-command/ -[3]:http://www.tecmint.com/how-to-kill-a-process-in-linux/ \ No newline at end of file diff --git a/translated/tech/20150629 4 Useful Tips on mkdir, tar and kill Commands in Linux.md b/translated/tech/20150629 4 Useful Tips on mkdir, tar and kill Commands in Linux.md new file mode 100644 index 0000000000..c094d8f916 --- /dev/null +++ b/translated/tech/20150629 4 Useful Tips on mkdir, tar and kill Commands in Linux.md @@ -0,0 +1,206 @@ +Linux mkdir、tar 和 kill 命令的 4 个有用小技巧 +================================================================================ +我们一直以常规的方式完成一个任务,直到我们知道有更好的处理方法。作为 [Linux 技巧和绝招系列][1] 的后续,我会在这里介绍能在各个方面给你帮助的 4 个小技巧。开始吧! + +![有用的 Linux 小技巧](http://www.tecmint.com/wp-content/uploads/2015/06/Linux-Useful-Tips.jpg) + +4 个有用的 Linux 小技巧 + +### 1. 假设你要创建一个类似于下面很长的/复杂的目录树。实现这最有效的方法是什么呢? ### + +类似下面要实现的目录树结构。 + + $ cd /home/$USER/Desktop + $ mkdir tecmint + $ mkdir tecmint/etc + $ mkdir tecmint/lib + $ mkdir tecmint/usr + $ mkdir tecmint/bin + $ mkdir tecmint/tmp + $ mkdir tecmint/opt + $ mkdir tecmint/var + $ mkdir tecmint/etc/x1 + $ mkdir tecmint/usr/x2 + $ mkdir tecmint/usr/x3 + $ mkdir tecmint/tmp/Y1 + $ mkdir tecmint/tmp/Y2 + $ mkdir tecmint/tmp/Y3 + $ mkdir tecmint/tmp/Y3/z + +上述情况可以简单地通过运行下面一行命令来实现。 + + $ mkdir -p /home/$USER/Desktop/tecmint/{etc/x1,lib,usr/{x2,x3},bin,tmp/{Y1,Y2,Y3/z},opt,var} + +你可以用 tree 命令验证。如果没有安装你可以使用 apt 或 yum 安装 ‘tree’ 软件包。 + + $ tree tecmint + +![检查目录结构](http://www.tecmint.com/wp-content/uploads/2015/06/Check-Directory-Structure.png) + +检查目录结构 + +我们可以用上面的方式创建任意复制的目录树结构。注意这仅仅是一个普通的命令,但是用 ‘{}’ 来创建层级目录。需要的时候如果在 shell 脚本中使用是非常有用的。 + +### 2. 在桌面(/home/$USER/Desktop)创建一个文件(例如 test)并填入以下内容。 ### + + ABC + DEF + GHI + JKL + MNO + PQR + STU + VWX + Y + Z + +这种情况一个普通用户会怎么做呢? + +a. 他首先会创建文件,最好使用 [touch 命令][2],例如: + + $ touch /home/$USER/Desktop/test + +b. 他会用一个文本编辑器打开文件,这可能是 nano、vim 或其它编辑器。 + + $ nano /home/$USER/Desktop/test + +c. 然后他会将上面的内容输入到文件中,保存并退出。 + +忽略他/她使用的时间,他至少需要 3 步来执行上面的情况。 + +一个经验丰富的 Linux 用户会怎么做呢?他会在终端中输入下面的文本然后就完成所有任务。他不需要单独执行每一步。 + + cat << EOF > /home/$USER/Desktop/test + ABC + DEF + GHI + JKL + MNO + PQR + STU + VWX + Y + Z + EOF + +你可以用 ‘cat’ 命令检查是否成功创建了文件和内容。 + + $ cat /home/avi/Desktop/test + +![检查文件内容](http://www.tecmint.com/wp-content/uploads/2015/06/Check-File-Content.gif) + +### 3. 我们经常在 Linux 中处理归档文件(尤其是 TAR 包)。很多情况下我们会在某些位置,而不是在 Downloads 目录中使用 TAR 包。这种情况下我们怎么做呢? ### + +在这种情况下我们通常会做两件事。 + +a. 复制/移动 tar 包到目标位置并解压,例如: + + $ cp firefox-37.0.2.tar.bz2 /opt/ + 或 + $ mv firefox-37.0.2.tar.bz2 /opt/ + +b. cd 到 /opt/ 目录。 + + $ cd /opt/ + +c. 解压 tar 包。 + + # tar -jxvf firefox-37.0.2.tar.bz2 + +我们也可以采用另外一种方式。 + +我们可以在 Tar 包所在位置解压并复制/移动解压后的文件到所需的目标位置,例如: + + $ tar -jxvf firefox-37.0.2.tar.bz2 + $ cp -R firefox/ /opt/ + 或 + $ mv firefox/ /opt/ + +不管哪种方式都需要两步才能完成任务。专业的人可以只用一步就完成这个任务: + + $ tar -jxvf firefox-37.0.2.tar.bz2 -C /opt/ + +-C 选项提取文件到指定目录(这里是 /opt/)。 + +这并不是关于选项(-C)的问题,而是习惯的问题。养成使用带 -C 选项 tar 命令的习惯。这会使你的工作更加轻松。从现在开始不要再移动归档文件或复制/移动解压后的文件了,在 Downloads 文件夹保存 tar 包并解压到你想要的任何地方吧。 + +### 4. 常规方式我们怎样杀掉一个进程? ### + +最普遍的方法,我们首先用 `ps -A` 命令列出所有进程,然后通过管道输入到 grep 来查找进程/服务(假如 apache2),如下: + + $ ps -A | grep -i apache2 + +#### 输出样例 #### + + 1006 ? 00:00:00 apache2 + 2702 ? 00:00:00 apache2 + 2703 ? 00:00:00 apache2 + 2704 ? 00:00:00 apache2 + 2705 ? 00:00:00 apache2 + 2706 ? 00:00:00 apache2 + 2707 ? 00:00:00 apache2 + +上面的输出显示了所有正在运行 apache2 的进程以及它们的 PID,然后你可以使用这些 PID 在下面命令的帮助下杀掉 apache2。 + + # kill 1006 2702 2703 2704 2705 2706 2707 + +然后交叉检查是否还有名称中包含 ‘apache2’ 的进程/服务在运行,如下: + + $ ps -A | grep -i apache2 + +实际上我们可以使用类似 pgrep 和 pkill 的工具以一种更容易理解的方式实现。你可以使用 pgrep 找到和一个进程相关的信息。假如你要找和 apache2 相关的进程信息,你只需要运行: + + $ pgrep apache2 + +#### 输出样例 #### + + 15396 + 15400 + 15401 + 15402 + 15403 + 15404 + 15405 + +你也可以通过运行下面命令列出进程名称以及 pid。 + + $ pgrep -l apache2 + +#### 输出样例 #### + + 15396 apache2 + 15400 apache2 + 15401 apache2 + 15402 apache2 + 15403 apache2 + 15404 apache2 + 15405 apache2 + +用 pkill 杀掉进程非常简单。你只需要输入想要杀死的资源名称。我写了一篇关于 pkill 的博文,你可以参考: [http://www.tecmint.com/how-to-kill-a-process-in-linux/][3]。 + +用 pkill 杀死一个进程(例如 apache2),你只需要输入以下命令: + + # pkill apache2 + +你可以通过运行下面命令验证是否杀掉了 apache2。 + + $ pgrep -l apache2 + +它没有输出任何东西并返回到窗口意味着没有名称中包含 apache2 的进程在运行。 + +这就是我要说的所有东西。上面讨论的点肯定远远不够,但也肯定对你有所帮助。我们不仅仅是介绍教程使你学到一些新的东西,更重要的是想告诉你 ‘在同样的情况下如何变得更有效率’。在下面的评论框中告诉我们你的反馈吧。保持联系,继续评论。 + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/mkdir-tar-and-kill-commands-in-linux/ + +作者:[Avishek Kumar][a] +译者:[ictlyh](https://github.com/ictlyh) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/avishek/ +[1]:http://www.tecmint.com/tag/linux-tricks/ +[2]:http://www.tecmint.com/8-pratical-examples-of-linux-touch-command/ +[3]:http://www.tecmint.com/how-to-kill-a-process-in-linux/ \ No newline at end of file From 079ccaf9f1673cdfc89a1ab052bc2bedcb90ee96 Mon Sep 17 00:00:00 2001 From: zpl1025 Date: Tue, 30 Jun 2015 13:29:06 +0800 Subject: [PATCH 506/965] [translated] 20150616 XBMC--build a remote control --- .../20150616 XBMC--build a remote control.md | 265 ------------------ .../20150616 XBMC--build a remote control.md | 264 +++++++++++++++++ 2 files changed, 264 insertions(+), 265 deletions(-) delete mode 100644 sources/tech/20150616 XBMC--build a remote control.md create mode 100644 translated/tech/20150616 XBMC--build a remote control.md diff --git a/sources/tech/20150616 XBMC--build a remote control.md b/sources/tech/20150616 XBMC--build a remote control.md deleted file mode 100644 index 5066e28ce2..0000000000 --- a/sources/tech/20150616 XBMC--build a remote control.md +++ /dev/null @@ -1,265 +0,0 @@ -zpl1025 -XBMC: build a remote control -================================================================================ -**Take control of your home media player with a custom remote control running on your Android phone.** - -**XBMC** is a great piece of software, and can turn almost can computer into a media centre. It can play music and videos, display pictures, and even fetch a weather forecast. To make it easy to use in a home theatre setup, you can control it via mobile phone apps that access a server running on the XBMC machine via Wi-Fi. There are loads of these available for almost all smartphone systems. - -> ### Kodi ### -> -> By the time you read this, **XBMC** may be no more. The project team have decided to rename it **Kodi** for legal reasons (and because **XBMC**, or X**-Box Media Centre**, refers to older hardware that is no longer supported). Other than the name, though, nothing has changed. Or at least nothing other than the usual raft of improvements you’d expect from a new release. This shouldn’t affect the remote software though, and it should work on both existing **XBMC** systems, and newer Kodi systems. - -We’ve recently set up an **XBMC** system for playing music, and none of the XBMC remotes we found really excel at this task, especially when the TV attached to the media centre is turned off. They were all a bit too complex, as they packed too much functionality into small screens. We wanted a system designed from the ground up to just access a music library and a radio addon, so we decided to build one ourselves. It didn’t need to be able to access the full capabilities of XBMC, because for tasks other than music, we’d simply switch back to a general-purpose XBMC remote control. Our test system was a Raspberry Pi running the RaspBMC distribution, but nothing here is specific to either the Pi or that distro, and it should work on any Linux-based XBMC system provided the appropriate packages are available. - -The first thing a remote control needs is a user interface. Many XBMC remote controls are written as standalone apps. However, this is just for our music, and we want to be accessible to guests without them having to install anything. The obvious solution is to make a web interface. XBMC does have a built-in web server, but to give us more control, we decided to use a separate web framework. There’s no problem running more than one web server on a computer at a time, but they can’t run on the same port. - -There are quite a few web frameworks available. We’ve used Bottle because it’s a simple, fast framework, and we don’t need any complex functions. Bottle is a Python module, so that’s the language in which we’ll write the server. - -You’ll probably find Bottle in your package manager. In Debian-based systems (including Raspbmc), you can grab it with: - - sudo apt-get install python-bottle - -A remote control is really just a layer that connects the user to a system. Bottle provides what we need to interact with the user, and we’ll interact with **XBMC** using its JSON API. This enables us to control the media player by sending JSON-encoded information. - -We’re going to use a simple wrapper around the XBMC JSON API called xbmcjson. It’s just enough to allow you send requests without having to worry about the actual JSON formatting or any of the banalities of communicating with a server. It’s not included in the PIP package manager, so you need to install it straight from **GitHub**: - - git clone https://github.com/jcsaaddupuy/python-xbmc.git - cd python-xbmc - sudo python setup.py install - -This is everything you need, so let’s get coding. - -#### Get started with Bottle #### - -The basic structure of our program is: - - from xbmcjson import XBMC - from bottle import route, run, template, redirect, static_file, request - import os - xbmc = XBMC(“http://192.168.0.5/jsonrpc”, “xbmc”, “xbmc”) - @route(‘/hello/’) - def index(name): - return template(‘

Hello {{name}}!

’, name=name) - run(host=”0.0.0.0”, port=8000) - -This connects to **XBMC** (though doesn’t actually use it); then Bottle starts serving up the website. In this case, it listens on host 0.0.0.0 (which is every hostname), and port 8000. It only has one site, which is /hello/XXXX where XXXX can be anything. Whatever XXXX is gets passed to index() as the parameter name. This then passes it to the template, which substitutes it into the HTML. - -You can try this out by entering the above into a file (we’ve called it remote.py), and starting it with: - - python remote.py - -You can then point your browser to localhost:8000/hello/world to see the template in action. - -@route() sets up a path in the web server, and the function index() returns the data for that path. Usually, this means returning HTML that’s generated via a template, but it doesn’t have to be (as we’ll see later). - -As we go on, we’ll add more routes to the application to make it a fully-featured XBMC remote control, but it will still be structured in the same way. - -The XBMC JSON API can be accessed by any computer on the same network as the XBMC machine. This means that you can develop it on your desktop, then deploy it to your media centre rather than fiddle round uploading every change to your home theatre PC. - -Templates – like the simple one in the previous example – are a way of combining Python and HTML to control the output. In principal, they can do quite a bit of processing, but they can get messy. We’ll use them just to format the data correctly. Before we can do that, though, we have to have some data. - -> ### Paste ### -> -> Bottle includes its own web server, which is what we’ve been using for testing the remote control. However, we found that it didn’t always perform well. When we put the remote into action, we wanted something that could deliver pages a bit quicker. Bottle can work with quite a few different web servers, and we found Paste worked quite well. In order to use this, just install it (in the package python-paste on Debian), and change the run call to: -> -> run(host=hostname, port=hostport, server=”paste”) -> -> You can see details of how to use other servers at [http://bottlepy.org/docs/dev/deployment.html][1]. - -#### Getting data from XBMC #### - -The XBMC JSON API is split up into 14 namespaces: JSONRPC, Player, Playlist, Files, AudioLibrary, VideoLibrary, Input, Application, System, Favourites, Profiles, Settings, Textures and XBMC. Each of these is available from an XBMC object in Python (apart from Favourites, in an apparent oversight). In each of these namespaces there are methods that you can use to control the application. For example, Playlist.GetItems() can be used to get the items on a particular playlist. The server returns data to us in JSON, but the xbmcjson module converts it to a Python dictionary for us. - -There are two items in XBMC that we need to use to control playback: players and playlists. Players hold a playlist and move through it item by item as each song finishes. In order to see what’s currently playing, we need to get the ID of the active player, and through that find out the ID of the current playlist. We’ve done this with the following function: - - def get_playlistid(): - player = xbmc.Player.GetActivePlayers() - if len(player[‘result’]) > 0: - playlist_data = xbmc.Player.GetProperties({“playerid”:0, “properties”:[“playlistid”]}) - if len(playlist_data[‘result’]) > 0 and “playlistid” in playlist_data[‘result’].keys(): - return playlist_data[‘result’][‘playlistid’] - return -1 - -If there isn’t a currently active player (that is, if the length of the results section in the returned data is 0), or if the current player has no playlist, this will return -1. Otherwise, it will return the numeric ID of the current playlist. - -Once we’ve got the ID of the current playlist, we can get the details of it. For our purposes, two things are important: the list of items in the playlist, and the position we are in the playlist (items aren’t removed from the playlist after they’ve been played; the current position just marches on). - - def get_playlist(): - playlistid = get_playlistid() - if playlistid >= 0: - data = xbmc.Playlist.GetItems({“playlistid”:playlistid, “properties”: [“title”, “album”, “artist”, “file”]}) - position_data = xbmc.Player.GetProperties({“playerid”:0, ‘properties’:[“position”]}) - position = int(position_data[‘result’][‘position’]) - return data[‘result’][‘items’][position:], position - return [], -1 - -This returns the current playlist starting with the item that’s currently playing (since we don’t care about stuff that’s finished), and it also includes the position as this is needed for removing items from the playlist. - -![Image](http://www.linuxvoice.com/wp-content/uploads/2015/04/xbmc2-large.jpg) - -The API is documented at [http://wiki.xbmc.org/?title=JSON-RPC_API/v6][2]. It lists all the available functions, but it a little short on details of how to use them. - -> ### JSON ### -> -> JSON stands for JavaScript Object Notation, and was originally designed as a way of serialising JavaScript Objects. It still is used for that, but it’s also a useful way of encoding all sorts of data. -> -> JSON objects always have the form: -> -> {property1:value1, property2:value2, property3:value3} -> -> For an arbitrary number of property/value pairs. To Python programmers, this all looks suspiciously similar to dictionaries, and the two are very similar. -> -> As with dictionaries, the value can itself be another JSON object, or a list, so the following is perfectly valid: -> -> {“name”:“Ben”, “jobs”:[“cook”, “bottle-washer”], “appearance”: {“height”:195, “skin”:“fair”}} -> -> JSON is often used in web services to send data back and fourth, and it’s well supported by most programming languages, so if Python’s not your thing, you should easily be able to use the same functions to control XBMC from software written in the language of your choice. - -#### Bringing them together #### - -The code to link the previous functions to a HTML page is simply: - - @route(‘/juke’) - def index(): - current_playlist, position = get_playlist() - return template(‘list’, playlist=current_playlist, offset = position) - -This only has to grab the playlist (using the function we defined above), and pass it to a template that handles the display. - -The main part of the template that handles the display of this data is: - -

Currently Playing:

- % if playlist is not None: - % position = offset - % for song in playlist: - {{song[‘title’]}} - % if song[‘type’] == ‘unknown’: - Radio - % else: - {{song[‘artist’][0]}} - % end - % if position != offset: - remove - % else: - skip - % end -
- % position += 1 - % end - -As you can see, templates are mostly written in HTML, but with a few extra bits to control output. Variables enclosed by double parenthesise are output in place (as we saw in the first ‘hello world’ example). You can also include Python code on lines starting with a percentage sign. Since indents aren’t used, you need a % end to close any code block (such as a loop or if statement). - -This template first checks that the playlist isn’t empty, then loops through every item on the playlist. Each item is displayed as the song title in bold, then the name of the artist, then a link to either skip it (if it’s the currently playing song), or remove it from the playlist. All songs have a type of ‘song’, so if the type is ‘unknown’, then it isn’t a song, but a radio station. - -The /remove/ and /skip/ routes are simple wrappers around XBMC controls that reload /juke after the change has taken effect: - - @route(‘/skip/’) - def index(position): - print xbmc.Player.GoTo({‘playerid’:0, ‘to’:’next’}) - redirect(“/juke”) - @route(‘/remove/’) - def index(position): - playlistid = get_playlistid() - if playlistid >= 0: - xbmc.Playlist.Remove({‘playlistid’:int(playlistid), ‘position’:int(position)}) - redirect(“/juke”) - -Of course, it’s no good being able to manage your playlist if you can’t add music to it. - -This is complicated slightly by the fact that once a playlist finishes, it disappears, so you need to create a new one. Rather confusingly, playlists are created by calling the Playlist.Clear() method. This can also be used to kill a playlist that is currently playing a radio station (where the type is unknown). The other complication is that radio streams sit in the playlist and never leave, so if there’s currently a radio station playing, we need to clear the playlist as well. - -These pages include a link to play the songs, which points to /play/. This page is handled by: - - @route(‘/play/’) - def index(id): - playlistid = get_playlistid() - playlist, not_needed= get_playlist() - if playlistid < 0 or playlist[0][‘type’] == ‘unknown’: - xbmc.Playlist.Clear({“playlistid”:0}) - xbmc.Playlist.Add({“playlistid”:0, “item”:{“songid”:int(id)}}) - xbmc.Player.open({“item”:{“playlistid”:0}}) - playlistid = 0 - else: - xbmc.Playlist.Add({“playlistid”:playlistid, “item”:{“songid”:int(id)}}) - remove_duplicates(playlistid) - redirect(“/juke”) - -The final thing here is a call to remove_duplicates. This isn’t essential – and some people may not like it – but it makes sure that no song appears in the playlist more than once. - -We also have pages that list all the artists in the collection, and list the songs and albums by particular artists. These are quite straightforward, and work in the same basic way as /juke. - -![Image](http://www.linuxvoice.com/wp-content/uploads/2015/04/xbmc1-large.jpg) - -The UI still needs a bit of attention, but it’s working. - -> ### Logging ### -> -> It’s not always clear how to do something using the XBMC JSON API, and the documentation is sometimes a little opaque. One way of finding out how to do something is seeing how other remote controls do it. If you turn on logging, you can see what API calls are being performed as you use another remote control, then incorporate these into your code. -> -> To turn on logging, hook your XBMC media centre up to a display and go to Settings > System > Debugging, and turn on Enable Debug Logging. With logging turned on, you need to access the XBMC machine (eg via SSH), then you can view the log. Its location should be displayed in the top-left corner of the XBMC display. In RaspBMC, it’s at /home/pi/.xbmc/temp/xbmc.log. You can then keep an eye on what API calls are being performed in real time using: -> -> cd /home/pi/.xbmc/temp -> tail -f xbmc.log | grep “JSON” - -#### Adding functionality #### - -The above code all works with songs in the XBMC library, but we also wanted to be able to play radio stations. Addons each have their own plugin URL that can be used to pull information out of them using the usual XBMC JSON commands. For example, to get the selected stations from the radio plugin, we use: - - @route(‘/radio/’) - def index(): - my_stations = xbmc.Files.GetDirectory({“directory”:”plugin://plugin.audio.radio_de/stations/my/”, “properties”: - [“title”,”thumbnail”,”playcount”,”artist”,”album”,”episode”,”season”,”showtitle”]}) - if ‘result’ in my_stations.keys(): - return template(‘radio’, stations=my_stations[‘result’][‘files’]) - else: - return template(‘error’, error=’radio’) - -This includes a file that can be added to a playlist just as any song can be. However, these files never finish playing, so (as we saw before) you need to recreate the playlist before adding any songs to it. - -#### Sharing songs #### - -As well as serving up templates, Bottle can serve static files. These are useful whenever you need things that don’t change based on the user input. That could be a CSS file, an image or an MP3. In our simple controller there’s not (yet) any CSS or images to make things look pretty, but we have added a way to download the songs. This lets the media centre act as a sort of NAS box for songs. If you’re transferring large amounts of data, it’s probably best to use something like Samba, but serving static files is a good way of grabbing a couple of tunes on your phone. - -The Bottle code to download a song by its ID is : - - @route(‘/download/’) - def index(id): - data = xbmc.AudioLibrary.GetSongDetails({“songid”:int(id), “properties”:[“file”]}) - full_filename = data[‘result’][‘songdetails’][‘file’] - path, filename = os.path.split(full_filename) - return static_file(filename, root=path, download=True) - -To use this, we just put a link to the appropriate ID in the /songsby/ page. - -We’ve gone through all the mechanics of the code, but there are a few more bits that just tie it all together. You can see for yourself at the GitHub page:[https://github.com/ben-ev/xbmc-remote][3]. - -> ### Setting up ### -> -> Once you’ve developed your remote control, you’ll need a way of ensuring that it starts every time you turn on your media centre. There are a few ways of doing this, but the easiest is just to add a command launching it to /etc/rc.local. We installed our file to /opt/xbmc-remote/remote.py with all the other files alongside it. We then added the following line to /etc/rc.local before the final exit 0 line. -> -> cd /opt/xbmc-remote && python remote.py & - -> ### GitHub ### -> -> This project is quite bare-bones at the moment, but – the business of running a magazine means we don’t have as much time as we’d like to program. However, we’ve set up a GitHub project where we hope to keep working on it, and if you think you’d benefit from the project as well, we’d love your input. -> -> To see what’s going on, head over to [https://github.com/ben-ev/xbmc-remote][4] and take a look at what state it’s in. You can get a copy of the latest code from that web page, or clone it from the command line. -> -> If you want to improve it, you can fork the project to develop in your own branch, and then send a pull request when your features are working. For more information on working with GitHub, head to [https://github.com/features][5]. - --------------------------------------------------------------------------------- - -via: http://www.linuxvoice.com/xbmc-build-a-remote-control/ - -作者:[Ben Everard][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.linuxvoice.com/author/ben_everard/ -[1]:http://bottlepy.org/docs/dev/deployment.html -[2]:http://wiki.xbmc.org/?title=JSON-RPC_API/v6 -[3]:https://github.com/ben-ev/xbmc-remote -[4]:https://github.com/ben-ev/xbmc-remote -[5]:https://github.com/features diff --git a/translated/tech/20150616 XBMC--build a remote control.md b/translated/tech/20150616 XBMC--build a remote control.md new file mode 100644 index 0000000000..7347aca243 --- /dev/null +++ b/translated/tech/20150616 XBMC--build a remote control.md @@ -0,0 +1,264 @@ +XBMC:自制遥控 +================================================================================ +**通过运行在 Android 手机上的自制遥控器来控制你的家庭媒体播放器。** + +**XBMC** 一款很优秀的软件,能够将几乎所有电脑变身成媒体中心。它可以播放音乐和视频,显示图片,甚至还能显示天气预报。为了在配置成家庭影院后方便使用,你可以通过手机 app 访问运行在已连接到 Wi-Fi 的 XBMC 机器上的服务来控制它。可以找到很多这种工具,几乎覆盖所有智能手机系统。 + +> ### Kodi ### +> +> 在你阅读这篇文章的时候,**XBMC** 可能已经成为历史。因为法律原因(因为名字 **XBMC** 或 X**-Box Media Center** 里引用了不再支持的过时硬件)项目组决定使用新的名字 **Kodi**。不过,除了名字,其他的都会保持原样。或者说除开通常新版本中所期待的大量新改进。这一般不会影响到遥控软件,它应该能在已有的 **XBMC** 系统和新的 Kodi 系统上都能工作。 + +我们目前配置了一个 **XBMC** 系统用于播放音乐,不过我们找到的所有 XBMC 遥控没一个好用的,特别是和媒体中心连接的电视没打开的时候。它们都有点太复杂了,集成了太多功能在手机的小屏幕上。我们希望能有这样的系统,从最开始就是设计成只用于访问音乐库和电台插件,所以我们决定自己实现一个。它不需要用到 XBMC 的所有功能,因为除了音乐以外的任务,我们可以简单地切换使用通用的 XBMC 遥控。我们的测试系统是一个刷了 RaspBMC 发行版的树莓派,但是我们要做的工具并不受限于树莓派或那个发行版,它应该可以匹配任何安装了相关插件的基于 Linux 的 XBMC 系统。 + +首先,遥控程序需要一个用户界面。大多数 XBMC 遥控程序都是独立的 app。不过对于我们要做的这个音乐控制程序,我们希望用户可以不用安装任何东西就可以使用。显然我们需要使用网页界面。XBMC 本身自带网页服务器,但是为了获得更多权限,我们还是使用了独立的网页框架。在同一台电脑上跑两个以上网页服务器没有问题,只不过它们不能使用相同的端口。 + +有几个网页框架可以使用。而我们选用 Bottle 是因为它是一个简单高效的框架,而且我们也确实用不到任何高级功能。Bottle 是一个 Python 模块,所以这也将是我们编写服务器模块的语言。 + +你应该能在软件包管理器里找到 Bottle。在基于 Debian 的系统(包括 RaspBMC)里,你可以通过下面的命令安装: + + sudo apt-get install python-bottle + +遥控程序实际上只是连接用户和系统的中间层。Bottle 提供了和用户交互的方式,而我们将通过 JSON API 来和 **XBMC** 交互。这样可以让我们通过发送 JSON 格式消息的方式去控制媒体播放器。 + +我们将用到一个叫做 xbmcjson 的简单 XBMC JASON API 封装。足够用来发送控制请求,而不需要关心实际的 JSON 格式以及和服务器通讯的无聊事。它没有包含在 PIP 包管理中,所以你得直接从 **GitHub** 安装: + + git clone https://github.com/jcsaaddupuy/python-xbmc.git + cd python-xbmc + sudo python setup.py install + +万事俱备,只欠代码。 + +#### 先从 Bottle 开始 #### + +我们程序的基本结构: + + from xbmcjson import XBMC + from bottle import route, run, template, redirect, static_file, request + import os + xbmc = XBMC(“http://192.168.0.5/jsonrpc”, “xbmc”, “xbmc”) + @route(‘/hello/’) + def index(name): + return template(‘

Hello {{name}}!

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

Currently Playing:

+ % if playlist is not None: + % position = offset + % for song in playlist: + {{song[‘title’]}} + % if song[‘type’] == ‘unknown’: + Radio + % else: + {{song[‘artist’][0]}} + % end + % if position != offset: + remove + % else: + skip + % end +
+ % position += 1 + % end + +可以看到,模版大部分是用 HTML 写的,只有一小部分用来控制输出的其他代码。用两个括号括起来的变量是输出位置(像我们在第一个 ‘hello world’ 例子里看到的)。你也可以嵌入以百分号开头的 Python 代码。因为没有缩进,你需要用一个 % end 来结束当前的代码块(就像循环或 if 语句)。 + +这个模版首先检查列表是否为空,然后遍历里面的每一项。每一项会用粗体显示歌曲名字,然后是艺术家名字,然后是一个是否跳过(如果是当前正在播的歌曲)或从列表移除的链接。所有歌曲的类型都是 ‘song’,如果类型是 ‘unknown’,那就不是歌曲而是网络电台。 + +/remove/ 和 /skip/ 路径只是简单地封装了 XBMC 控制功能,在改动生效后重新加载 /juke: + + @route(‘/skip/’) + def index(position): + print xbmc.Player.GoTo({‘playerid’:0, ‘to’:’next’}) + redirect(“/juke”) + @route(‘/remove/’) + def index(position): + playlistid = get_playlistid() + if playlistid >= 0: + xbmc.Playlist.Remove({‘playlistid’:int(playlistid), ‘position’:int(position)}) + redirect(“/juke”) + +当然,如果不能往列表里添加歌曲的话那这个列表管理功能也不行。 + +因为一旦播放列表结束,它就消失了,所以你需要重新创建一个,这会让事情复杂一些。而且有点让人迷惑的是,播放列表是通过调用 Playlist.Clear() 方法来创建的。这个方法也还用来删除包含网络电台(类型是 unknown)的播放列表。另一个麻烦的地方是列表里的网络电台开始播放后就不会停,所以如果当前在播网络电台,也会需要清除播放列表。 + +这些页面包含了指向 /play/ 的链接来播放歌曲。通过下面的代码处理: + + @route(‘/play/’) + def index(id): + playlistid = get_playlistid() + playlist, not_needed= get_playlist() + if playlistid < 0 or playlist[0][‘type’] == ‘unknown’: + xbmc.Playlist.Clear({“playlistid”:0}) + xbmc.Playlist.Add({“playlistid”:0, “item”:{“songid”:int(id)}}) + xbmc.Player.open({“item”:{“playlistid”:0}}) + playlistid = 0 + else: + xbmc.Playlist.Add({“playlistid”:playlistid, “item”:{“songid”:int(id)}}) + remove_duplicates(playlistid) + redirect(“/juke”) + +最后一件事情是实现 remove_duplicates 调用。这并不是必须的 - 而且还有人并不喜欢这个 - 不过可以保证同一首歌不会多次出现在播放列表里。 + +我们也实现了一些页面用来列出收藏歌曲里所有艺术家,以及列出指定艺术家的歌曲和专辑。这些都非常简单,和 /juke 页面基本类似。 + +![Image](http://www.linuxvoice.com/wp-content/uploads/2015/04/xbmc1-large.jpg) + +还需要处理一下 UI,不过功能已经有了。 + +> ### 日志 ### +> +> 通常拿到 XBMC JSON API 并不清楚能用来做什么,而且它的文档也有点模糊。找出如何使用的一种方式是看别的遥控程序是怎么做的。如果打开日志功能,就可以在使用其他遥控程序的时候看到哪个 API 被调用了,然后就可以应用到在自己的代码里。 +> +> 要打开日志功能,把 XBMC 媒体中心 接到显示器上,再依次进入设置 > 系统 > 调试,打开允许调试日志。在打开日志功能后,还需要登录到 XBMC 机器上(比如通过 SSH),然后就可以查看日志了。日志文件的位置应该显示在 XBMC 界面左上角。在 RaspBMC 系统里,文件位置是 /home/pi/.xbmc/temp/xbmc.log。你可以通过下面的命令实时监视哪个 API 接口被调用了: +> +> cd /home/pi/.xbmc/temp +> tail -f xbmc.log | grep “JSON” + +#### 增加功能 #### + +上面的代码都是用来播放 XBMC 媒体库里的歌曲的,但我们还希望能播放网络电台。每个插件都有自己的独立 URL 可以通过普通的 XBMC JSON 命令来获取信息。举个例子,要从电台插件里获取选中的电台,可以使用; + + @route(‘/radio/’) + def index(): + my_stations = xbmc.Files.GetDirectory({“directory”:”plugin://plugin.audio.radio_de/stations/my/”, “properties”: + [“title”,”thumbnail”,”playcount”,”artist”,”album”,”episode”,”season”,”showtitle”]}) + if ‘result’ in my_stations.keys(): + return template(‘radio’, stations=my_stations[‘result’][‘files’]) + else: + return template(‘error’, error=’radio’) + +这样可以返回一个可以和歌曲一样能添加到播放列表的文件。不过,这些文件能一直播下去,所以(之前说过)在添加其他歌曲的时候需要重新创建列表。 + +#### 共享歌曲 #### + +除了伺服页面模版,Bottle 还支持静态文件。方便用于那些不会因为用户输入而改变的内容。可以是 CSS 文件,一张图片或是一首 MP3 歌曲。在我们的简单遥控程序里(目前)还没有任何用来美化的 CSS 或图片,不过我们增加了一个下载歌曲的途径。这个可以让媒体中心变成一个存放歌曲的 NAS 盒子。在需要传输大量数据的时候,最好还是用类似 Samba 的功能,但只是下几首歌到手机上的话使用静态文件也是很好的方式。 + +通过歌曲 ID 来下载的 Bottle 代码: + + @route(‘/download/’) + def index(id): + data = xbmc.AudioLibrary.GetSongDetails({“songid”:int(id), “properties”:[“file”]}) + full_filename = data[‘result’][‘songdetails’][‘file’] + path, filename = os.path.split(full_filename) + return static_file(filename, root=path, download=True) + +应用的时候,只需要为 /songsby/ 页面里的相应 ID 加个链接。 + +我们已经把所有的代码过了一遍,不过还需要一点工作来把它们集合到一起。可以自己去 GitHub 页面 [https://github.com/ben-ev/xbmc-remote][3] 看下。 + +> ### 设置 ### +> +> 我们的遥控程序已经开发完成,还需要保证让它在媒体中心每次开机的时候都能启动。有几种方式,最简单的是在 /etc/rc.local 里增加一行命令来启动。我们的文件位置在 /opt/xbmc-remote/remote.py,其他文件也和它一起。然后在 /etc/rc.local 最后的 exit 0 之前增加了下面一行。 +> +> cd /opt/xbmc-remote && python remote.py & + +> ### GitHub ### +> +> 这个项目目前还只是个架子,但是 - 我们运营杂志就意味着没有太多自由时间来编程。不过,我们启动了一个 GitHub 项目,希望能持续完善, 而如果你觉得这个项目有用的话,欢迎做出贡献。 +> +> 要查看最新的进展,请访问 [https://github.com/ben-ev/xbmc-remote][4] 看看所处的状态。你可以从页面里获取最新的代码,或者通过命令行复制。 +> +> 如果你希望改善它,可以复制项目到你自己的分支开发,然后在功能完成后发起合并请求。关于如何使用 GitHub 的更多信息,请访问 [https://github.com/features][5]。 + +-------------------------------------------------------------------------------- + +via: http://www.linuxvoice.com/xbmc-build-a-remote-control/ + +作者:[Ben Everard][a] +译者:[zpl1025](https://github.com/zpl1025) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.linuxvoice.com/author/ben_everard/ +[1]:http://bottlepy.org/docs/dev/deployment.html +[2]:http://wiki.xbmc.org/?title=JSON-RPC_API/v6 +[3]:https://github.com/ben-ev/xbmc-remote +[4]:https://github.com/ben-ev/xbmc-remote +[5]:https://github.com/features From a7a41cf260333b7fe837ea6fc7964873cbac6ce8 Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 30 Jun 2015 13:54:42 +0800 Subject: [PATCH 507/965] PUB:20150515 This Ubuntu App Applies Instagram Style Filters to Your Photos MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @geekpi 这篇错别字有点多~ --- ... Instagram Style Filters to Your Photos.md | 70 ++++++++++++++++++ ... Instagram Style Filters to Your Photos.md | 74 ------------------- 2 files changed, 70 insertions(+), 74 deletions(-) create mode 100644 published/20150515 This Ubuntu App Applies Instagram Style Filters to Your Photos.md delete mode 100644 translated/share/20150515 This Ubuntu App Applies Instagram Style Filters to Your Photos.md diff --git a/published/20150515 This Ubuntu App Applies Instagram Style Filters to Your Photos.md b/published/20150515 This Ubuntu App Applies Instagram Style Filters to Your Photos.md new file mode 100644 index 0000000000..d44db58488 --- /dev/null +++ b/published/20150515 This Ubuntu App Applies Instagram Style Filters to Your Photos.md @@ -0,0 +1,70 @@ +在 Ubuntu 中给你的照片加上 Instagram 风格的滤镜程序 +================================================================================ +拿起你的自拍杆跟我来。 + +### XnRetro 照片编辑器 ### + +**XnRetro** 是一个可以让你快速给你照片添加“类 Instagram”效果的程序。 + +你肯定知道我说的这些效果:划痕、噪点、相框、过度处理、复古和怀旧色调(因为在这个数字过客的时代,我们一定知道无穷无尽的自拍永远也找不回怀旧的自己。) + +无论你认为这些效果是愚蠢的艺术还是创作的捷径,这些滤镜非常流行,可以帮助那些平实无奇的照片添加个性。 + +![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/05/instagram-app.jpg) + +*XnRetro是一个照片编辑应用* + +#### XnRetro的功能 #### + +**XnRetro 有下面那些功能** + +- 20 种色彩滤镜 +- 15 种光影效果(虚化、泄露等等) +- 28 种画框和边线 +- 5 种插图 (带力度控制) +- 对比度、伽马校正、饱和度等图像调整 +- 矩形修剪选项 + +![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/05/Screen-Shot-2015-05-10-at-23.30.01-e1431297068833.png) + +*灯光效果调整* + +(理论上)你可以保存编辑过的 .jpg 或者 .png 文件,并且直接在 app 中分享到社交媒体上。 + +我说“理论上”的意思是保存.jpg图像无法正常在 linux 版的程序上工作(你可以保存 .png 的图像)。相似问题还有,大多数内置的社交链接失效或者无法导出。 + +要使用**15 种光影效果**,你需要在 XnRetro 的‘light’文件夹下将 .jpg 文件重新保存成 .png 文件。编辑‘light.xml’来匹配新的文件名,点击保存那么灯光效果就可以没有问题的加载进 XnRetro 了。 + + +**XnRetro 值得安装么?** + +XnRetro 并不是完美的。它看上去很老土、很难正确的安装,**并且已经几年没有更新了**。 + +但它还可以使用,除了保存 .jpg 文件外。同时也是那些像 Gimp 或者 Shotwell 的那些‘正规’的图片调整工具的一个灵活替代品。 + +虽然像 [Pixlr Touch Up][1] 和 [Polarr][2] 这样的 web 应用和 Chrome Apps 也提供相似的功能,但你也许正在寻找真正原生的解决方案。 + +习惯了 XnRetro 就很难离开它。 + +### 下载 Ubuntu 下的 XnRetro ### + +XnRetro 没有可用的 .deb 安装包。它以二进制文件的形式发行,这意味着你需要每次双击程序来运行。它也只有32位的版本。 + +你可以使用下面的 XnRetro下载链接。下载完成后你需要解压压缩包并进入。双击里面的‘xnretro’程序。 + +- [下载 Linux 版 XnRetro (32位, tar.gz)][3] + +-------------------------------------------------------------------------------- + +via: http://www.omgubuntu.co.uk/2015/05/instagram-photo-filters-ubuntu-desktop-app + +作者:[Joey-Elijah Sneddon][a] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://plus.google.com/117485690627814051450/?rel=author +[1]:http://www.omgchrome.com/?s=pixlr +[2]:http://www.omgchrome.com/the-best-chrome-apps-of-2014/ +[3]:http://www.xnview.com/en/xnretro/#downloads diff --git a/translated/share/20150515 This Ubuntu App Applies Instagram Style Filters to Your Photos.md b/translated/share/20150515 This Ubuntu App Applies Instagram Style Filters to Your Photos.md deleted file mode 100644 index ae5e6df6eb..0000000000 --- a/translated/share/20150515 This Ubuntu App Applies Instagram Style Filters to Your Photos.md +++ /dev/null @@ -1,74 +0,0 @@ -一个Ubuntu中给你的照片加Instagram风格滤镜的程序 -================================================================================ -**在Ubuntu中寻找一个给你的照片加Instagram风格的滤镜程序么?** - -拿起你的自拍棒跟着这个来。 - -![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/05/instagram-app.jpg) -XnRetro是一个照片编辑应用 - -### XnRetro 照片编辑器 ### - -**XnRetro** 是一个可以让你快速给你照片添加“类Instagram”效果的程序。 - -你知道我说的这些效果:划痕、噪点、框架、过处理、复古和怀旧色调(因为在这个数字时代,我们必须知道无尽的自拍不能称为怀旧的自己。) - -无论你认为这些效果是愚蠢的艺术价值或者创作的捷径,这些滤镜非常流行切可以帮助那些平平照片添加个性。 - - -#### XnRetro的功能 #### - -**XnRetro有下面那些功能** - -- 20色彩滤镜 -- 15中光效果(虚化、泄露等等) -- 28框架和边框 -- 5中插图 (带力度控制) -- Image adjustments for contrast, gamma, saturation, etc -- 对比度、伽马、饱和度等图像调整 -- 矩形修剪选项 - -![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/05/Screen-Shot-2015-05-10-at-23.30.01-e1431297068833.png) -灯光效果调整 - -你可以(理论上)编辑。jpg或者.png文件并且直接在app中等想到社交媒体上。 - -我说“理论”上的意思是保存.jpg图像无法正常在linux版的程序上工作(你可以保存.png的图像)。相似的,大多数内置的社交链接失效或者无法导出。 - -要使用**15中光影效果**你需要在XnRetro的‘light’文件夹下重新保存.jpg文件成.png文件。编辑‘light.xml’来匹配新的文件名,点击保存那没灯光效果就可以没有问题的加载进XnRetro了。 - -> ‘用户友好的XnRetro很难打败-一旦你用顺之后。’ - -**XnRetro值得安装么?** - -XnRetro并不是完美的。它看上去很丑、很难正确的安装并且已经纪念没有更新了。 - -它还可以使用,输了保存.jpg文件外。同时也是那些像Gimp或者Shotwell的那些‘正规’图片调整工具的一个灵活替代品。 - -While web apps and Chrome Apps¹ like [Pixlr Touch Up][1] and [Polarr][2] offer similar features you may be looking for a truly native solution. -虽然web应用和Chrome Apps¹像[Pixlr Touch Up][1] 和 [Polarr][2]提供另外相似的功能,而你也许正在寻找真正原生的解决方案。 - -对于此,用户友好带有容易使用滤镜的XnRetro很难被打败。 - -### 下载Ubuntu下的XnRetro ### - -XnRetro没有可用的.deb安装包。它以二进制文件的形式发型,这意味着你需要每次双击程序来运行。它也只有32位的版本。 - -你可以使用下面的XnRetro下载链接。下载完成后你需要解压压缩包并进入。双击里面的‘xnretro’程序。 - -- [下载Linux版XnRetro (32位, tar.gz)][3] - --------------------------------------------------------------------------------- - -via: http://www.omgubuntu.co.uk/2015/05/instagram-photo-filters-ubuntu-desktop-app - -作者:[Joey-Elijah Sneddon][a] -译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://plus.google.com/117485690627814051450/?rel=author -[1]:http://www.omgchrome.com/?s=pixlr -[2]:http://www.omgchrome.com/the-best-chrome-apps-of-2014/ -[3]:http://www.xnview.com/en/xnretro/#downloads From b8fb4f3c00d1c6c17e56683a3d39cc11c69a36c4 Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 30 Jun 2015 16:34:33 +0800 Subject: [PATCH 508/965] PUB:20150604 12 Globally Recognized Linux Certifications @wi-cuckoo --- ...lobally Recognized Linux Certifications.md | 172 ++++++++++++++++++ ...lobally Recognized Linux Certifications.md | 172 ------------------ 2 files changed, 172 insertions(+), 172 deletions(-) create mode 100644 published/20150604 12 Globally Recognized Linux Certifications.md delete mode 100644 translated/share/20150604 12 Globally Recognized Linux Certifications.md diff --git a/published/20150604 12 Globally Recognized Linux Certifications.md b/published/20150604 12 Globally Recognized Linux Certifications.md new file mode 100644 index 0000000000..3b1ed918ba --- /dev/null +++ b/published/20150604 12 Globally Recognized Linux Certifications.md @@ -0,0 +1,172 @@ +12 个全球认可的 Linux 认证 +================================================================================ +大家好,今天我们将会认识一些非常有价值的全球认可的Linux认证。Linux认证是不同的Linux专业机构在全球范围内进行的认证程序。Linux认证可以让Linux专业人才可以在服务器领域或者相关公司等等这些地方更容易获得Linux相关的工作。Linux认证评估一个人在Linux的各个领域里的专业程度。有很多不错的Linux专业机构提供不同的Linux认证。但是,在公司谋取一份工作时全球仅有少数被非常认可的Linux认证含金量很高,这些工作包括管理服务器,虚拟化,安装系统与软件,配置程序,应用支持和其他Linux操作系统相关的东西。随着全球使用Linux操作系统的服务器的增长,拉动了对于Linux专业人才的需求。为了更好的证明Linux专业技术水平,在全球看来,更好的、著名的认证总是有着更高的优先级。 + +这里是一些全球认可的Linux认证,我们接下来将会一一谈到。 + +### 1. CompTIA Linxu+ ### + +CompTIA Linux+ 是LPI(Linux Professional Institute,Linux专业委员会)主办的一个Linux认证,在全世界范围内提供培训。其提供的Linux相关知识,可以用于从事一大批Linux相关专业的工作,如Linux管理员、高级网络管理员、系统管理员、Linux数据库管理员和Web管理员。如果任何人想从事安装和维护Linux操作系统,该课程会帮助他达到认证要求,并且通过提供对Linux系统更宽阔的认识,能够为通过考试做好准备。LPI的CompTIA Linux+认证的主要目的就是,提供给证书持有者足够扎实的,关于安装软件、操作、管理和设备排障的知识。我们可以付出一定的费用、时间和努力,完成CompTIA Linux+,同时获得三个业内认可的证书:**LPI LPIC-1**和**SUSE Certified Linux Administrator (CLA)**证书。 + +- **认证代码** : LX0-103,LX0-104(2015年3月30日启动)或者LX0-101,LX0-102 +- 题目数量:每次考试60道题 +- 题目类型:多选 +- 考试时长:90分钟 +- 要求:A+,Network+,并且有至少12个月的Linux管理经验 +- 分数线:500 (对于200-800的范围来说) +- 语言:英语,将来会有德语,葡萄牙语,繁体中文,西班牙。 +- 有效期:认证后三年有效 + +**注意**:不同系列的考试不能合并。如果你考的是LX0-101,那么你必须考LX0-102完成认证。同样的,LX0-103和LX0-104又是一个系列。LX0-103和LX0-104系列是LX0-101和LX0-102系列的升级版。 + +### 2. LPIC ### + +LPIC,全称Linux专业委员会认证( Linux Professional Institute Certification),是Linux专业委员会的一个Linux认证程序。这是一个多级别的认证程序,要求在每个级别通过一系列(通常是两个)的认证考试。该认证有三个级别,包括初级水平认证 **LPIC-1** ,高级水平认证 **LPIC-2**和最高水平认证 **LPIC-3**。前两个认证侧重于 **Linux系统管理**,而最后一个认证侧重一些专业技能,包括虚拟化和安全。为了得到 **LPIC-3** 认证,一个持有有效的 **LPIC-1** 与**LPIC-2** 认证的考生必须通过300复杂环境测试、303安全测试、304虚拟化测试和高可用性测试中的一个。**LPIC-1**认证按照证书持有者可以通过运行Linux,使用命令行界面和基本的网络知识安装,维护,配置等任务而设计,LPIC-2测试考生是否作为管理中小型混合网络的候选人。LPIC-3认证是为企业级Linux专业技能设计所设计,代表了最高的专业水平和不针对特定 Linux 发行版的行业认证。 + +- **认证代码**:LPIC-1(101和102),LPIC-2(201和202)和LPIC-3(300,303或者304) +- 题目类型:60个多项选择 +- 考试时长:90分钟 +- 要求:无,建议有 Linux Essentials 认证 +- 分数线:500(在200-800的范围内) +- 语言:LPIC-1:英语,德语,意大利语,葡萄牙语,西班牙语(现代),汉语(简体),汉语(繁体),日语 +- LPIC-2:英语,德语,葡萄牙语,日语 +- LPIC-3:英语,日语 +- 有效期:退休之后五年内仍然有效 + +### 3.Oracle Linux OCA ### + +Oracle联合认证(OCA)为个人而定制,适用于那些想证明其部署和管理Oracle Linux操作系统的知识牢固的人。该认证专业知识仅仅针对Oracle Linux发行版,这个系统完全是为Oracle产品特别剪裁的,可以运行Oracle设计的系统,包括Oracle Exadata数据库服务器,Oracle Exalytics In-Memory 服务器,Oracle Exalogic 均衡云,和Oracle数据库应用等。Oracle Linux的“坚不可摧企业内核”为企业应用带来了高性能、高扩展性和稳定性。OCA认证覆盖了如管理本地磁盘设备、管理文件系统、安装和移除Solaris包与补丁,优化系统启动过程和系统进程。这是拿到OCP证书系列的第一步。OCA认证以其前身为Sun Certified Solaris Associate(SCSAS)而为人所知。 + +- **认证代码**:OCA +- 题目类型:75道多项选择 +- 考试时长:120分钟 +- 要求:无 +- 分数线:64% +- 有效期:永远有效 + +### 4. Oracle Linux OCP ### + +Oracle专业认证(OCP)是Oracle公司为Oracle Linux提供的一个认证,覆盖更多的进阶知识和技能,对于一个Oracle Linux管理员来说。它囊括的知识有配置网络接口、管理交换分区配置、崩溃转储、管理软件、数据库和重要文件。OCP认证是技术性专业知识和专业技能的基准测试,这些知识与技能需要在公司里广泛用于开发、部署和管理应用、中间件和数据库。Oracle Linux OCP的工作机会在增长,这得益于工作市场和经济发展。根据考试纲领,证书持有者有能力胜任安全管理、为Oracle 数据库准备Oracle Linux系统、排除故障和进行恢复操作、安装软件包、安装和配置内核模块、维护交换空间、完成用户和组管理、创建文件系统、配置逻辑卷管理(LVM)、文件分享服务等等。 + +- **认证代码**:OCP +- 题目类型:60至80道多项选择题 +- 考试时长:120分钟 +- 要求:Oracle Linux OCA +- 分数线:64% +- 有效期:永远有效 + +### 5. RHCSA ### + +RHCSA是红帽公司作为红帽认证系统工程师推出的一个认证程序。RHCSA们是指一些拥有在著名的红帽Linux环境下完成核心系统管理技能和能力的人。这是一个入门级的认证程序,关注在系统管理上的实际胜任能力,包括安装、配置一个红帽Linux系统,接入一个可用的网络提供网络服务。一个红帽认证的系统管理员可以理解和使用基本的工具,用以处理文件、目录、命令行环境和文档;操作运行中的系统,包括以不同的启动级别启动、识别进程、开启和停止虚拟机和控制服务;使用分区和逻辑卷配置本地存储;创建和配置文件系统和文件系统属性,包括权限、加密、访问控制列表和网络文件系统;部署配置和维护系统,包括软件安装、更新和核心服务;管理用户和组,包括使用一个中心的目录用于验证;安全性的工作,包括基本的基本防火墙和SELinux配置。要获得RHCE和其他认证,首先得认证过RHCSA。 + +- **认证代码**:RHCSA +- 课程代码:RH124,RH134和RH199 +- 考试代码:EX200 +- 考试时长:21-22小时,取决于选择的课程 +- 要求:无。有一些Linux基础知识更好 +- 分数线:300总分,210过(70%) +- 有效期:3年 + +### 6. RHCE ### + +RHCE,也叫做红帽认证工程师,是一个中到高级水平的认证程序,为一些想要学习更多技能和知识,成为一个负责红帽企业Linux的高级系统管理员的RHCSA开设的,RHCE应该有能力、知识和技能来配置静态路由、包过滤、NAT、设定内核运行参数、配置一个ISCSI初始化程序,生成并发送系统用量报告、使用shell脚本自动完成系统维护任务、配置系统日志,包括远程日志、提供网络服务如HTTP/HTTPS、FTP、NFS、SMB、SMTP、SSH和NTP等等。推荐希望获得更多高级水平的认证的RHCSA们、已经完成系统管理员I,II和III、或者已经完成RHCE 快速跟进培训的人们参加认证。 + +- **认证代码**:RHCE +- 课程代码:RH124,RH134,RH254和RH199 +- 考试代码:EX200和EX300 +- 考试时长:21-22个小时,取决于所选课程 +- 要求:一个RHCSA证书 +- 分数线:300总分,210过(70%) +- 有效期:3年 + +### 7. RHCA ### + +RHCA即红帽认证架构师,是红帽公司的一个认证程序。它的关注点在系统管理的实际能力,包括安装和配置一个红帽Linux系统,并加入到一个可用网络中运行网络服务。RHCA是所有红帽认证中最高水平的认证。考生需要选择他们希望针对的领域,或者选择合格的红帽认证的任意组合来创建一个他们自己的领域。这里有三个主要的领域:数据中心、云和应用平台。精通数据中心领域的RHCA能够运行、管理数据中心;而熟悉云的可以创建、配置和管理私有云和混合云、云应用平台以及使用红帽企业Linux平台的灵活存储方案;精通应用平台集合的RHCA拥有技能如安装、配置和管理红帽JBoss企业应用平台和应用,云应用平台和混合云环境,借助红帽的OpenShift企业版,使用红帽JBoss数据虚拟化技术从多个资源里组合数据。 + +- **认证代码**:RHCA +- 课程代码:CL210,CL220.CL280,RH236,RH318,RH413,RH436,RH442,JB248和JB450 +- 考试代码:EX333,EX401,EX423或者EX318,EX436和EX442 +- 考试时长:21-22个小时,取决于所选课程 +- 要求:未过期的RHCE证书 +- 分数线:300总分,210过(70%) +- 有效期:3年 + +### 8. SUSE CLA ### + +SUSE认证Linux管理员(SUSE CLA)是SUSE推出的一个初级认证,关注点在SUSE Linux企业服务器环境下的日常任务管理。为了获得SUSE CLA认证,不用必须完成课程任务,只需要通过考试就能获得认证。SUSE CLA们能够、也有技术去使用Linux桌面、定位并利用帮助资源、管理Linux文件系统、用Linux Shell和命令行工作、安装SLE 11 SP22、管理系统安装、硬件、备份和恢复、用YaST管理Linux、Linux进程和服务、存储、配置网络、远程接入、SLE 11 SP2监控,任务自动化和管理用户访问和安全工作。我们可以同时获得SUSE CLA,LPIC-1和CompTIA Linux认证,因为SUSE,Linux Professional Institute和CompATI合作提供了这个同时获得三个Linux认证的机会。 + +- **认证代码**:SUSE CLA +- 课程代码:3115,3116 +- 考试代码:050-720,050-710 +- 问题类型:多项选择 +- 考试时长:90分钟 +- 要求:无 +- 分数线:512 + +### 9. SUSE CLP ### + +SUSE认证Linux专业人员(CLP)是一个认证程序,为那些希望获得关于SUSE Linux企业服务器更多高级且专业的知识的人而服务。SUSE CLP是通过SUSE CLA认证后的下一步。应该通过CLA的考试并拥有证书,然后通过完成CLP的考试才能获得CLP的认证。通过SUSE CLP认证的人员有能力完成安装和配置SLES 11系统、维护文件系统、管理软件包、进程、打印、配置基础网络服务、samba、Web服务器、使用IPv6、创建和运行bash shell脚本。 + +- **认证代码**:SUSE CLP +- 课程代码:3115,3116和3117 +- 考试代码:050-721,050-697 +- 考试类型:手写 +- 考试时长:180分钟 +- 要求:SUSE CLA 认证 + +### 10. SUSE CLE ### + +SUSE认证Linux工程师(CLE)是一个工程师级别的高级认证,为那些已经通过CLE考试的人准备。为了获得CLE认证,人们需要已经获得SUSE CLA和CLP的认证。获得CLE认证的人员拥有架设复杂SUSE Linux企业服务器环境的技能。CLE认证过的人可以配置基本的网络服务、管理打印、配置和使用Open LDAP、samba、IPv6、完成服务器健康检测和性能调优、创建和执行shell脚本、部署SUSE Linux企业板、通过Xen实现虚拟化等等。 + +- **认证代码**:SUSE CLE +- 课程代码:3107 +- 考试代码:050-723 +- 考试类型:手写 +- 考试时长:120分钟 +- 要求:SUSE CLP 10或者11证书 + +### 11. LFCS ### + +Linux基金会认证系统管理员(LFCS)认证考生使用Linux和通过终端环境使用Linux的知识。LFCS是Linux基金会的一个认证程序,为使用Linux操作系统工作的系统管理员和工程师准备。Linux基金会联合业内专家、Linux内核社区,测试考生的核心领域、关键技能、知识和应用能力。通过LFCS认证的人员拥有一些技能、知识和能力,包括在命令行下编辑和操作文件、管理和处理文件系统与存储的错误、聚合分区作为LVM设备、配置交换分区、管理网络文件系统、管理用户帐号/权限和属组、创建并执行bash shell脚本、安装/升级/移除软件包等等。 + +- **认证代码**:LFCS +- 课程代码:LFCS201,LFCS220(可选) +- 考试代码:LFCS 考试 +- 考试时长:2小时 +- 要求:无 +- 分数线:74% +- 语言:英语 +- 有效期:两年 + +### 12. LFCE ### + +Linux基金会认证工程师(LFCE),是Linux基金会为Linux工程师推出的认证。相比于LFCS,通过LFCE认证的人员在Linux方面拥有更大范围的技能。这是一个工程师级别的高级认证程序。LFCE认证的人具备一些网络管理方面的技能和能力,如配置网络服务、配置包过滤、监控网络性能、IP流量、配置文件系统和文件服务、网络文件系统、从仓库安装/升级软件包、管理网络安全、配置iptables、http服务、代理服务、邮件服务等等。由于其为高级工程级别的认证程序,所以普遍认为相比LFCS,学习和通过的难度更大些。 + +- **认证代码**:LFCE +- 课程代码:LFS230 +- 考试代码:LFCE 考试 +- 考试时长:2小时 +- 要求:认证过LFCS +- 分数线:72% +- 语言:英语 +- 有效期:2年 + +### 我们发现的情况(这仅仅是我们的观点)### + +最近的调查表明,在不同的高端招聘代理中,称80%的Linux工作描述更倾向于红帽的认证。如果你是一个学生/新手,并且想学习Linux,那么我们建议选择越来越流行的Linux基金会认证,或者CompTIA Linux也可以是一个选择。如果你已经了解了oracle或suse,或者在他们的产品上工作,那oracle/suse的认证会更好些,如果你在公司里工作了,这些认证会对你的职业生涯成长有帮助:-) + +### 总结 ### + +在这个世界上,成千上万的大公司正在运行跑着Linux操作系统的服务器和主框架机,为了在这些服务器上管理、配置和工作,总是存在着对Linux技术/专业知识高度认证的需求。这些国际上承认的认证对某些人在Linux的职业生涯扮演很重要的角色。这些遍布全球的公司运行着Linux,需要Linux工程师、系统管理员和已经获得认证且在Linux相关领域干得不错的人员。全球认可的Linux认证,对于专业知识和职业生涯的辉煌都是重中之重,所以好好准备考试并获得认证,对于在Linux建立职业生涯是一个很好的选择。如果你有任何问题,想法,反馈,请写在下方的评论框里,让我们好知道哪些东西需要添加或者改进。谢谢!:-) + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/linux-how-to/12-globally-recognized-linux-certifications/ + +作者:[Arun Pyasi][a] +译者:[wi-cuckoo](https://github.com/wi-cuckoo) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://linoxide.com/author/arunp/ diff --git a/translated/share/20150604 12 Globally Recognized Linux Certifications.md b/translated/share/20150604 12 Globally Recognized Linux Certifications.md deleted file mode 100644 index 2be4e9df7d..0000000000 --- a/translated/share/20150604 12 Globally Recognized Linux Certifications.md +++ /dev/null @@ -1,172 +0,0 @@ -12个全球认可的Linux认证 -================================================================================ -大家好,今天我们将会认识一些非常有价值的全球认可的Linux认证。Linux认证是不同Linux专业机构在全球范围内进行的认证程序。Linux认证可以让Linux专业人才很容易获得Linux相关的工作,在服务器或者公司等等这些地方。Linux认证评估一个人在Linux的各个领域里的专业程度。有很多不错的Linux专业机构提供不同的Linux认证。但是全球仅有少数被十分认可的Linux认证,在公司谋取一份工作时含金量很高,这些工作包括管理服务器,虚拟化,安装系统与软件,配置程序,应用支持和其他Linux操作系统相关的东西。随着全球使用Linux操作系统的服务器的增长,拉动了对于Linux专业人才的需求。为了更好的证明Linux专业技术,公司进行的著名的认证一直有着更高的优先级,在全球看来。 - -这里是一些全球认可的Linux认证,我们接下来将会一一讨论。 - -### 1. CompTIA Linxu+ ### - -CompTIA Linux+ 是LPI“Linux Professional Institute”主办的一个Linux认证,在全世界范围内提供培训。其提供的Linux相关知识,使得产生了一大批Linux相关专业的工作,如Linux管理员,高级网络管理员,系统管理员,Linux数据库管理员和网页管理员。如果任何人想从事安装和维护Linux操作系统,该课程会帮助达到认证要求,并且通过提供对Linux系统更宽阔的认识,能够为考试做好准备。LPI的CompTIA Linux+认证的主要目的就是,提供给证书持有者足够扎实的知识,关于安装软件,操作,管理和设备排障的。我们可以用一定的费用,时间和努力,,完成CompTIA Linux+,赢得三个业内认可的证书,我们可以自动收到**LPI LPIC-1**和**SUSE Certified Linux Administrator (CLA)**证书。 - -- ** 认证代码** : LX0-103和LX0-104 (2015年三月30日启动)或者LX0-101和LX0-102 -- 题目数量:一次考试60道题 -- 题目类型:多选 -- 考试时长:90分钟 -- 要求:A+,Network+,并且有至少12个月的Linux管理经历 -- 分数线:500 (对于200-800的范围来说) -- 语言:英语,将来会有德语,葡萄牙语,汉语,西班牙。 -- 有效期:认证后三年有效 - -**注意**:不同系列的考试不能交叉。如果你考的是LX0-101,那么你必须考LX0-102完成认证。同样的,你必须考完LX0-103和LX0-104。LX0-103和LX0-104是LX0-101和LX0-102的升级版。 - -### 2. LPIC ### - -LPIC,全称Linux专业委员会认证,是Linux专业委员会的一个Linux认证程序。这是一个多层次的认证程序,要求在每个级别通过一系列(通常是两个)的认证考试。该认证有三个层次,包括初级水平认证 **LPIC-1** ,高级水平认证 **LPIC-2**和最高水平认证 **LPIC-3**。前两个认证侧重于 **Linux系统管理**,而最后一个认证侧重一些专业技能,包括虚拟化和安全。为了得到 **LPIC-3** 认证,一个持有 **LPIC-1** 与**LPIC-2** 的考生必须通过300复杂环境测试,303安全测试,304虚拟化测试和高可用性的其中一个。**LPIC-1**认证按照证书持有者可以通过运行Linux,使用命令行界面和基本的网络知识安装,维护,配置任务而设计,LPIC-2验证考生很少的管理知识,主要是中型混合网络方面。LPIC-3认证按照企业级别的Linux专业技能设计,代表了最高的专业水平(==最后这句不知道如何翻译==) - -- **认证代码**:LPIC-1(101和102),LPIC-2(201和202)和LPIC-3(300,303或者304) -- 题目类型:60个多项选择 -- 考试时长:90分钟 -- 要求:Linux基础 -- 分数线:500(在200-800的范围内) -- 语言:LPIC-1:英语,德语,意大利语,葡萄牙语,西班牙语(现代),汉语(简体),汉语(繁体),日语 -- LPIC-2:英语,德语,葡萄牙语,日语 -- LPIC-3:英语,日语 -- 有效期:退休之后五年内仍然有效 - -### 3.Oracle Linux OCA ### - -Oracle联合认证(OCA)为个人而定制,那些对部署和管理Oracle Linux操作系统且想证明知识牢固感兴趣的人。该认证专业知识仅仅是在Oracle Linux发行版上,这个系统完全是为Oracle产品特别剪裁的,为了运行在Oracle设计的系统上面,包括Oracle Exadata数据库机器,Oracle Exalytics 内存中机器,Oracle Exalogic 均衡云,和Oracle数据库应用。Oracle Linux稳定的企业级内核对于企业应用表现突出,高扩展性和稳定性。OCA认证覆盖如管理本地磁盘设备,文件系统,安装和移除Solaris包与补丁,协调系统启动过程和系统进程方面。这是达到OCP证书佼佼者的第一步。OCA认证以其前身为Sun Certified Solaris Associate(SCSAS)而为人所知。 - -- **认证代码**:OCA -- 题目类型:75道多项选择 -- 考试时长:120分钟 -- 要求:无 -- 分数线:64% -- 有效期:永远有效 - -### 4. Oracle Linux OCP ### - -Oracle Certified Professional(OCP),时Oracle公司为Oracle Linux提供的一个认证,覆盖更多的进阶知识和技能,对于一个Oracle Linux管理员来说。它囊括的知识有配置网络接口,映射交换配置,清理垃圾,管理软件、数据库和核心文件。OCP认证是技术性专业知识和专业技能的基准测试,这些知识与技能需要在公司里广泛用于开发,部署和管理应用,中间设备和数据库。Oracle Linux OCP的工作机会在增长,得益于工作市场和经济。根据考试纲领,证书持有者有能力胜任安全管理,为Oracle 数据库准备Oracle Linux系统,排除故障,安装软件包,安装和配置内核模块,维护交换空间,完成用户和组管理,创建文件系统,配置逻辑卷管理(LVM)、文件分享服务等等。 - -- **认证代码**:OCP -- 题目类型:60至80道多项选择题 -- 考试时长:120分钟 -- 要求:Oracle Linux OCA -- 分数线:64% -- 有效期:永远有效 - -### 5. RHCSA ### - -RHCSA是红帽公司作为红帽认证系统工程师推出的一个认证程序。RHCSAs指一些拥有技能和能力在著名的红帽Linux环境下完成核心系统管理的人。这是一个入门级的认证程序,关注在系统管理上的实际胜任能力,包括安装、配置一个红帽Linux系统,接入一个可用的网络运行网络服务。一个红帽认证的系统管理员可以理解和使用基本的工具,用以处理文件,目录,命令行环境和文档,操作运行中的系统,包括以不同的启动级别启动,标记进程,开启和停止虚拟机和控制服务,使用分区和逻辑卷配置本地存储,部署配置和维护系统,包括软件安装、更新和核心服务,管理用户和组,包括使用一个中心的目录用于验证,安全性工作,包括基本的基本防火墙和SELinux配置。要获得RHCE和其他认证,首先得认证过RHCSA。 - -- **认证代码**:RHCSA -- 课程代码:RH124,RH134和RH199 -- 考试代码:EX200 -- 考试时长:21-22小时,取决于选择的课程 -- 要求:无。有一些Linux基础知识更好 -- 分数线:300总分,210过(70%) -- 有效期:3年 - -### 6. RHCE ### - -RHCE,也叫做红帽认证工程师,是一个中到高级水平的认证程序,为一些红帽认证系统管理员(RHCSA),想学习一个负责红帽企业Linux的高级系统管理员要求的额外技能和知识而开设的,RHCE有能力,知识和技能配置静态的路由,包过滤,网络地址转换(NAT),设定内核运行参数,配置一个互联网小型计算机系统接口(ISCSI)初始化程序,产生并推送系统使用的报告,使用shell脚本自动完成系统维护任务,配置系统登入,包括远程登录,提供网络服务如HTTP/HTTPS,文件传输协议(FTP),网络文件系统(NFS),服务信息块(SMB),简单邮件传输协议(SMTP),安全shell(SSH)和网络时间协议(NTP)等等。RHCSAs希望获得更多高级水平的认证,并且已经完成系统管理员I,II和III,或者RHCE认证建议的RHCE快速跟进课程。 - -- **认证代码**:RHCE -- 课程代码:RH124,RH134,RH254和RH199 -- 考试代码:EX200和EX300 -- 考试时长:21-22个小时,取决于所选课程 -- 要求:一个RHCSA证书 -- 分数线:300总分,210过(70%) -- 有效期:3年 - -### 7. RHCA ### - -RHCA就是红帽认证架构师,是红帽公司的一个认证程序。它的关注点在系统管理的实际能力,包括安装和配置一个红帽Linux系统,并加入到一个可用网络中运行网络服务。RHCA是所有红帽认证中最高水平的认证。考生需要选择他们希望关注的集合,或者选择合格的红帽认证的任意组合,以此来创建一个他们自己的集合。这里有三个主要的集合,数据中心,云和应用平台。精通数据中心集合的RHCA能够运行,管理数据中心,而熟悉云的可以创建,配置和管理私有的,混合的云,云应用平台以及使用红帽企业Linux平台的灵活存储方案。精通应用平台集合的RHCA拥有技能如安装,配置和管理红帽JBoss企业应用平台和应用,云应用平台和混合云环境,借助红帽的OpenShift企业版,使用红帽JBoss数据虚拟化技术从多个资源里组合数据。 - -- **认证代码**:RHCA -- 课程代码:CL210,CL220.CL280,RH236,RH318,RH413,RH436,RH442,JB248和JB450 -- 考试代码:EX333,EX401,EX423或者EX318,EX436和EX442 -- 考试时长:21-22个小时,取决于所选课程 -- 要求:未过期的RHCE证书 -- 分数线:300总分,210过(70%) -- 有效期:3年 - -### 8. SUSE CLA ### - -SUSE认证Linux管理员(SUSE CLA)是SUSE推出的一个初级认证,关注点在SUSE Linux企业服务器环境下的日常任务管理。为了获得SUSE CLA认证,完成课程任务不是必须的,你不得不通过考试获得认证。SUSE CLA有能力,也有技术去使用Linux桌面,定位并利用帮助资源,管理Linux文件系统,用Linux Shell和命令行工作,安装SLE 11 SP22,管理系统安装,硬件,备份和恢复,用YaST管理Linux,Linux进程和服务,存储,配置网络,远程接入,SLE 11 SP2模拟器,任务自动化和管理用户访问和安全工作。我们可以同时获得LPI的SUSE CLA,LPIC-1和CompTIA Linux,因为SUSE,Linux Professional Institute和CompATI合作提供给你这个机会,去获得三个Linux认证。 - -- **认证代码**:SUSE CLA -- 课程代码:3115,3116 -- 考试代码:050-720,050-710 -- 问题类型:多项选择 -- 考试时长:90分钟 -- 要求:无 -- 分数线:512 - -### 9. SUSE CLP ### - -SUSE认证Linux专业人员(CLP)是一个认证程序,为那些希望获得关于SUSE Linux企业服务器更多高级且专业的知识的人而服务。SUSE CLP是通过SUSE CLA认证后的下一步。一个人应该通过CLA的考试并拥有证书,然后才能获得CLP的认证,通过完成CLP的考试。通过SUSE CLP认证的人员有能力完成安装和配置SUSE Linux企业服务器11系统,维护文件系统,管理软件包,进程,打印,使用IPv6配置基础网络服务,samba,网页服务器,创建和运行bash shell脚本。 - -- **认证代码**:SUSE CLP -- 课程代码:3115,3116和3117 -- 考试代码:050-721,050-697 -- 考试类型:手写 -- 考试时长:180分钟 -- 要求:SUSE CLA 认证 - -### 10. SUSE CLE ### - -SUSE认证Linux工程师(CLE)是一个工程师级别的高级认证,为那些已经通过CLE考试的人准备。为了获得CLE认证,人们需要获得SUSE CLA和CLP的认证。获得CLE认证的人员拥有架设复杂SUSE Linux企业服务器环境的技能。CLE认证过的人可以配置基本的网络服务,管理打印,配置和使用Open LDAP,samba,IPv6,完成健康检测和(这里不知道),创建和执行shell脚本,部署SUSE Linux企业板,通过Xen实现虚拟化等等。 - -- **认证代码**:SUSE CLE -- 课程代码:3107 -- 考试代码:050-723 -- 考试类型:手写 -- 考试时长:120分钟 -- 要求:SUSE CLP 10或者11证书 - -### 11. LFCS ### - -Linux基金会认证系统管理员(LFCS)认证考生Linux使用中拥有的知识和通过终端环境使用Linux。LFCS是Linux基金会的一个认证程序,为使用Linux操作系统工作的系统管理员和工程师准备。Linux基金会联合工业级专家,Linux内核社区,测试考生扎实的技能,知识和应用能力。通过LFCS认证的人员拥有一些技能,知识和能力,包括在命令行下编辑和操作文件,管理和处理文件系统与存储的错误,聚合分区作为LVM设备,配置SWAP分区,管理网络文件系统,管理用户帐号,权限和属组,创建并执行bash shell脚本,安装,升级,移除软件包等等。 - -- **认证代码**:LFCS -- 课程代码:LFCS201,LFCS220(可选) -- 考试代码:LFCS 考试 -- 考试时长:2小时 -- 要求:无 -- 分数线:74% -- 语言:英语 -- 有效期:两年 - -### 12. LFCE ### - -Linux基金会认证工程师(LFCE),是Linux基金会为Linux工程师推出的认证。通过LFCE认证的人员拥有一个对于Linux较宽范围的技能,相比于LFCS。这是一个工程师级别的高级认证程序。LFCE认证的人具备一些网络管理方面的技能和能力,如配置网络服务,包过滤,网络运行模拟器,IP连通,配置文件系统和文件服务,网络文件系统,从仓库安装,升级软件包,管理网络安全,配置iptables,http服务,代理服务,邮件服务等等。由于其为高级工程级别的认证程序,所以普遍认为相比LFCS,学习和通过的难度更大些。 - -- **认证代码**:LFCE -- 课程代码:LFS230 -- 考试代码:LFCE 考试 -- 考试时长:2小时 -- 要求:认证过LFCS -- 分数线:72% -- 语言:英语 -- 有效期:2年 - -### 我们发现的情况(这仅仅是我们的观点)### - -最近的调查表明,在不同的高端招聘代理中,称80%的Linux工作描述更倾向于红帽的认证。如果你是一个学生/新手,并且想学习Linux,那么我们建议选择越来越流行的Linux基金会认证,或者CompTIA Linux也可以是一个选择。如果你已经知道了oracle或suse,或者在他们的产品上工作,那oracle/suse的认证会更好些,如果你在一个公司工作了,这些认证会对你的职业生涯成长有帮助:-) - -### 总结 ### - -在这个世界上,成千上万的大公司正在运行跑着Linux操作系统的服务器和主框架,为了在这些服务器上管理,配置和工作,总是存在对Linux技术/专业知识高度认证的需求。这些国际上承认的认证对某些人在Linux的职业生涯扮演很重要的角色。全世界范围内的这些公司运行着Linux,需要Linux工程师,系统管理员和已经获得认证且在Linux相关领域干得不错的有热情的人员。全球认可的Linux认证,对于专业知识和职业生涯的辉煌都是很基础的,所以好好准备考试并获得认证,对于在Linux建立职业生涯是一个很好的选择。如果你有任何问题,想法,反馈,请写在下方的评论框里,让我们好知道哪些东西需要添加或者改进。谢谢!:-) - --------------------------------------------------------------------------------- - -via: http://linoxide.com/linux-how-to/12-globally-recognized-linux-certifications/ - -作者:[Arun Pyasi][a] -译者:[译者ID](https://github.com/wi-cuckoo) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://linoxide.com/author/arunp/ From f00e836a6a353f1a52a3c882f54007d9ec28dffa Mon Sep 17 00:00:00 2001 From: ictlyh Date: Tue, 30 Jun 2015 18:45:37 +0800 Subject: [PATCH 509/965] =?UTF-8?q?[=E6=A0=A1=E5=AF=B9]=20tech/20150626=20?= =?UTF-8?q?15=20Useful=20MySQL=20or=20MariaDB=20Performance=20Tuning=20and?= =?UTF-8?q?=20Optimization=20Tips.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...erformance Tuning and Optimization Tips.md | 190 +++++++++--------- 1 file changed, 93 insertions(+), 97 deletions(-) diff --git a/translated/tech/20150626 15 Useful MySQL or MariaDB Performance Tuning and Optimization Tips.md b/translated/tech/20150626 15 Useful MySQL or MariaDB Performance Tuning and Optimization Tips.md index 061b710c85..42256518f4 100644 --- a/translated/tech/20150626 15 Useful MySQL or MariaDB Performance Tuning and Optimization Tips.md +++ b/translated/tech/20150626 15 Useful MySQL or MariaDB Performance Tuning and Optimization Tips.md @@ -1,100 +1,97 @@ - 15 个有用的 MySQL/MariaDB 性能调整和优化技巧 ================================================================================ -MySQL是一个强大的开源关系型数据库管理系统或简称RDBMS。它被发布在1995年(20年前)。它采用的结构化查询语言在数据库管理中可能是最好的选择。最新的MySQL版本是5.6.25,2015年5月29日发行的。 +MySQL 是一个强大的开源关系数据库管理系统或简称 RDBMS。它于 1995 年发布(20年前)。它采用结构化查询语言,这可能是数据库内容管理中最流行的选择。最新的 MySQL 版本是5.6.25,于 2015 年 5 月 29 日发行。 -尽管有许多关于MySQL有趣的传闻,其中一个有趣的事实是,这个名字来自Michael Widenius(MySQL的创始人)的女儿。本文旨在向您展示一些有用的做法,以帮助您管理您的MySQL服务器。 +关于 MySQL 一个有趣的事实是它的名字来自于 Michael Widenius(MySQL 的创始人)的女儿。尽管有许多关于 MySQL 有趣的传闻,本文旨在向你展示一些有用的实践,以帮助你管理你的 MySQL 服务器。 -![MySQL Performance Tuning](http://www.tecmint.com/wp-content/uploads/2015/06/MySQL-Performance-Tuning1.png) +![MySQL 性能优化](http://www.tecmint.com/wp-content/uploads/2015/06/MySQL-Performance-Tuning1.png) -MySQL性能优化 +MySQL 性能优化 -2009年4月,MySQL被Oracle收购。其结果导致一个叫MariaDB的社区成立。创建的主要原因是为了保持MySQL项目的自由。 +2009 年 4 月,MySQL 被 Oracle 收购。其结果是成立了一个叫 MariaDB 的 MySQL 社区。创建的主要原因是为了保持 MySQL 项目在通用公共许可证下自由。 -今天,MySQL和MariaDB对于Web应用程序像,WordPress, Joomla, Magento和其他的,是使用最广泛的(但不是使用最多的)RDBMS。 +今天,MySQL 和 MariaDB 是用于类似 WordPress、Joomla、Magento 和其他 web 应用程序最广泛的 RDMS 之一(如果不是最多的)。 +这篇文章将告诉你一些基本的,但非常有用的关于如何优化 MySQL/MariaDB 性能的技巧。注意,本文假定您已经安装了 MySQL 或 MariaDB。如果你仍然不知道如何在系统上安装它们,你可以按照以下说明去安装: -这篇文章将告诉你一些基本的,但有用如何优化MySQL / MariaDB性能的技巧。说明,本文假定您已经安装了MySQL或MariaDB。如果你仍然不知道如何在系统上安装它们,你可以按照以下说明去安装: +- [在 RHEL/CentOS 7 上安装 LAMP][1] +- [在 Fedora 22 上安装 LAMP][2] +- [在 Ubuntu 15.04 安装 LAMP][3] +- [在 Debian 8 上安装 MariaDB][4] +- [在 Gentoo Linux 上安装 MariaDB][5] +- [在 Arch Linux 上安装 MariaDB][6] -- [Installing LAMP on RHEL/CentOS 7][1] -- [Installing LAMP on Fedora 22][2] -- [Setting Up LAMP on Ubuntu 15.04][3] -- [Installing MariaDB on Debian 8][4] -- [Install MariaDB on Gentoo Linux][5] -- [Install MariaDB on Arch Linux][6] +**重要**: 在开始之前,不要盲目的接受这些建议。每个 MySQL 设置都是不同的,在进行任何更改之前需要慎重考虑。 -**说明**: 在开始之前,不要盲目的接受这些建议。每个MySQL的设置是不同的,在进行任何更改之前需要慎重考虑。 +你需要明白这些: +- MySQL/MariaDB 配置文件位于 `/etc/my.cnf`。 每次更改此文件后你需要重启 MySQL 服务,以使更改生效。 +- 这篇文章使用 MySQL 5.6 版本。 -你需要明白这些: +### 1. 启用 InnoDB 的 file-per-table ### -- MySQL/MariaDB配置文件位于 `/etc/my.cnf`. 每次需改此文件后你需要重新启动MySQL服务,以使新更改生效。 -- 这篇文章使用MySQL 5.6版本 。 +首先,解释清楚 InnoDB 是一个存储引擎很重要。MySQL 和 MariaDB 使用 InnoDB 作为默认存储引擎。以前,MySQL 使用系统表空间来保存数据库中的表和索引。这意味着服务器唯一的目的就是数据库处理,它们的存储盘不用于其它目的。 -### 1. 启动 InnoDB 的`file-per-table` ### +InnoDB 提供了更灵活的方式,它把每个数据库的信息保存在一个 `.ibd` 数据文件中。每个 .idb 文件表示它自己的表空间。通过这样的方式可以更快地完成类似 “TRUNCATE” 的数据库操作,当删除或截断一个数据库表时,你也可以回收未使用的空间。 -首先,它是非常重要的对于解释InnoDB是一个存储引擎。MySQL和MariaDB使用的默认存储引擎是InnoDB。过去,MySQL使用系统表空间来保存数据库中的表和索引。这意味着服务器唯一的目的就是数据库处理,它的存储盘不用于其他的目的。 +这样配置的另一个好处是你可以在一个单独的存储设备保留某些数据库表。这可以大大提高你磁盘的 I/O 负载。 -InnoDB提供了更灵活的方式,它把每个数据库的信息保存在一个`.ibd` 数据文件中。像“TRUNCATE”这样的操作可以更快地完成,当删除或截断一个数据库表时,你也可以回收未使用的空间。 - -这种结构的另一个好处是,可以保留一些数据库表在一个单独的存储设备。这可以大大提高你磁盘的I/O负载。 - -MySQL 5.6及以上的版本默认启用`innodb_file_per_table`。你可以在/etc/my.cnf文件中看到。该指令看起来是这样的: +MySQL 5.6及以上的版本默认启用 `innodb_file_per_table`。你可以在 /etc/my.cnf 文件中看到。该指令看起来是这样的: innodb_file_per_table=1 -### 2. 将MySQL数据库中的数据放在独立分区上 ### +### 2. 在独立分区上保存 MySQL 数据库数据 ### -**注意**: 此设置只能工作在MySQL上, 而不能在MariaDB上. +**注意**:此设置只在 MySQL 上有效, 在 MariaDB 上无效。 -有时OS的读/写操作会减缓你MySQL服务器的性能,尤其是如果位于同一块磁盘上。因此,我建议你使用单独的磁盘(SSD最好)用于MySQL服务。 +有时候操作系统的读/写会降低你 MySQL 服务器的性能,尤其是如果位于同一块磁盘上。因此,我建议你使用单独的磁盘(最好是 SSD)用于 MySQL 服务。 -要完成这步,你需要将新的磁盘连接到您的计算机/服务器上。对于这篇文章,我会认为磁盘将被识别为/dev/sdb。 +要完成这步,你需要将新的磁盘连接到你的计算机/服务器上。对于这篇文章,我假定磁盘挂在到 /dev/sdb。 -下一步将是准备新的分区: +下一步是准备新的分区: # fdisk /dev/sdb -现在按“N”来创建新的分区。接着按“P”,以使其创建为主分区。在此之后,设置分区号为1-4之间。之后,你可以选择分区大小。这里按enter。在接下来的步骤中,你需要配置分区的大小。 +现在按 “N” 来创建新的分区。接着按 “P”,使其创建为主分区。在此之后,从 1-4 设置分区号。之后,你可以选择分区大小。这里按 enter。在下一步,你需要配置分区的大小。 -如果你希望使用全部的磁盘,按一次enter。否则,你需要手动设置新分区的大小。准备就绪后按“w”保存。现在,我们需要为我们的新分区创建一个文件系统。这可以很轻松的完成: +如果你希望使用全部的磁盘,再按一次 enter。否则,你可以手动设置新分区的大小。准备就绪后按 “w” 保存更改。现在,我们需要为我们的新分区创建一个文件系统。这可以用下面命令轻松地完成: # mkfs.ext4 /dev/sdb1 -现在挂载新分区到文件夹下。在根目录下创建一个名为“ssd”的文件夹: +现在我们会挂载新分区到一个目录。我在根目录下创建了一个名为 “ssd” 的目录: # mkdir /ssd/ -挂载新分区到刚才创建的文件夹下: +挂载新分区到刚才创建的目录下: # mount /dev/sdb1 /ssd/ -你可以添加如下行在/etc/fstab文件中设置开机自动挂载: +你可以在 /etc/fstab 文件中添加如下行设置为开机自动挂载: /dev/sdb1 /ssd ext3 defaults 0 0 -现在我们移动MySQL到新磁盘中。首先停止服务: +现在我们移动 MySQL 到新磁盘中。首先停止 MySQL 服务: # service mysqld stop -我建议你​​停止Apache/nginx,以及以防止任何操作试图在数据库中写入: +我建议你​​同时停止 Apache/nginx,以防止任何试图写入数据库的操作: # service httpd stop # service nginx stop -现在我们复制完整的MySQL目录到新分区中: +现在复制整个 MySQL 目录到新分区中: # cp /var/lib/mysql /ssd/ -Rp -这可能需要一段时间,具体取决于你的MySQL数据库的大小。一旦这个过程完成后重命名MySQL的目录: +这可能需要一段时间,具体取决于你的 MySQL 数据库的大小。一旦这个过程完成后重命名 MySQL 目录: # mv /var/lib/mysql /var/lib/mysql-backup -然后创建一个链接: +然后创建一个符号链接: # ln -s /ssd/mysql /var/lib/mysql -现在启动你的MySQL和web服务: +现在启动你的 MySQL 和 web 服务: # service mysqld start # service httpd start @@ -102,130 +99,129 @@ MySQL 5.6及以上的版本默认启用`innodb_file_per_table`。你可以在/et 以后你的数据库将使用新的磁盘访问。 -### 3. 优化InnoDB的缓冲区 ### +### 3. 优化使用 InnoDB 的缓冲池 ### -InnoDB引擎在内存中有一个缓冲数据和索引的缓冲区。这将有助于你在MySQL/MariaDB中的查询更快的执行。选择合适的内存大小对系统的查询来说是非常重要的,并且使你对系统的内存消耗也会有一个更好的认识。 +InnoDB 引擎在内存中有一个缓冲池用于缓存数据和索引。这当然有助于你更快地执行 MySQL/MariaDB 查询语句。选择合适的内存大小需要一些重要的决策并对系统的内存消耗有很好的认识。 下面是你需要考虑的: -- 其他的进程需要消耗多少内存,包括你的系统进程,表的数量,套接字缓冲区大小。 -- 你的服务器是否专用于MySQL还是你也运行其他非常消耗内存的服务。 +- 其它的进程需要消耗多少内存。这包括你的系统进程,页表,套接字缓冲。 +- 你的服务器是否专门用于 MySQL 还是你也运行其它非常消耗内存的服务。 +在一个专用的机器上,你可能会把 60-70% 的内存分配给 `innodb_buffer_pool_size`。如果你打算在一个机器上运行更多的服务,你应该重新考虑专门用于 `innodb_buffer_pool_size` 的内存大小。 -在一个专用的机器上,你可能会使用60-70%的内存分配给`innodb_buffer_pool_size`。如果你打算在一个机器上运行多个服务,你应该重新考虑`innodb_buffer_pool_size`的内存大小。 - -你需要设置my.cnf中的此项: +你需要设置 my.cnf 中的此项: innodb_buffer_pool_size -### 4. 在MySQL中避免使用Swappiness ### +### 4. 在 MySQL 中避免使用 Swappiness ### -使用交换空间需要一个进程,当系统移动一部分内存到一个空闲的分区中就叫做“swap”。通常当你的系统用完物理内存后就会出现这种情况而不是释放一些RAM,然后将信息写进磁盘中。你可能已经猜测到磁盘比你的内存要慢得多。 +Swapping 是一个当系统移动部分内存到一个称为 “swap” 的特殊磁盘空间时运行的进程。通常当你的系统用完物理内存后就会出现这种情况,系统将信息写入磁盘而不是释放一些 RAM。正如你猜测的磁盘比你的 RAM 要慢得多。 -默认情况下该选项已经启用: +默认启用了该选项: # sysctl vm.swappiness vm.swappiness = 60 -使用以下命令关闭swappiness: +运行以下命令关闭 swappiness: # sysctl -w vm.swappiness=0 -### 5. 设置MySQL的最大连接数 ### +### 5. 设置 MySQL 的最大连接数 ### -`max_connections`变量告诉你的服务器当前允许多少并发连接。MySQL/ MariaDB服务器允许的`max_connections` + 1为超级用户给定的值。当连接建立后,执行MySQL查询会有时间的限制 - 之后,它被关闭,新连接可以取代其位置。 +`max_connections` 指令告诉你当前你的服务器允许多少并发连接。MySQL/ MariaDB 服务器允许有特级权限的用户 max_connections + 1 的连接数。只有当执行 MySQL 查询的时候才会建立连接,执行完成后会关闭连接并被新的连接取代。 -请记住,太多的连接会导致RAM的使用量过高并且会锁定你的MySQL服务器。一般小网站需要100-200的连接数而较大可能需要500-800甚至更多。这里的值很大程度上取决于你的MySQL/MariaDB的使用情况。 +请记住,太多的连接会导致 RAM 的使用量过高并且会锁住你的 MySQL 服务器。一般小网站需要 100-200 的连接数而较大可能需要 500-800 甚至更多。这里的值很大程度上取决于你 MySQL/MariaDB 的使用情况。 -你可以动态的改变`max_connections`的值而无需重启MySQL服务器: +你可以动态地改变 `max_connections` 的值而无需重启MySQL服务器: # mysql -u root -p mysql> set global max_connections := 300; -### 6. 配置MySQL的`thread_cache_size`变量 ### +### 6. 配置 MySQL `thread_cache_size` ### - `thread_cache_size`变量用来设置你服务器缓存的线程数量。当客户端断开连接时,如果当前线程数小于`thread_cache_size`,他的线程将被放入缓存中。下一个请求将使用缓存池中的线程来完成。 + `thread_cache_size` 指令用来设置你服务器缓存的线程数量。当客户端断开连接时,如果当前线程数小于thread_cache_size,他的线程将被放入缓存中。下一个请求通过使用缓存池中的线程来完成。 -要提高服务器的性能,你可以设置`thread_cache_size`的值相对高一些。你可以通过以下方法来查看线程池的使用情况:: +要提高服务器的性能,你可以设置 `thread_cache_size` 的值相对高一些。你可以通过以下方法来查看线程缓存命中率: mysql> show status like 'Threads_created'; mysql> show status like 'Connections'; -你可以用以下公式来计算线程池的使用率: +你可以用以下公式来计算线程池的命中率: 100 - ((Threads_created / Connections) * 100) -如果你得到一个较低的数字,这意味着大多数mysql连接请求使用新的线程,而不是从缓存加载。在这种情况下,你需要增加`thread_cache_size`。 +如果你得到一个较低的数字,这意味着大多数 mysql 连接请求使用新的线程,而不是从缓存加载。在这种情况下,你需要增加 `thread_cache_size`。 -但有一个好处是,`thread_cache_size`可以动态的改变而无需重启MySQL服务。你可以通过以下方式来实现: +这里有一个好处是可以动态地改变 `thread_cache_size` 而无需重启 MySQL 服务。你可以通过以下方式来实现: mysql> set global thread_cache_size = 16; -### 7.禁用MySQL的DNS反向查询 ### +### 7. 禁用 MySQL 的 DNS 反向查询 ### -当新的连接出现时,默认情况下MySQL/MariaDB会使用DNS来解析用户的IP地址/主机名,每个新的连接,它的IP都会被解析为主机名。然后,主机名又被反解析为IP来验证这两个是否一致。 +默认情况下当新的连接出现时,MySQL/MariaDB 会进行 DNS 查询解析用户的 IP 地址/主机名。对于每个客户端连接,它的 IP 都会被解析为主机名。然后,主机名又被反解析为 IP 来验证两者是否一致。 -当DNS服务器出现问题或者配置有问题时,解析会变得非常慢,这就是为什么要关闭DNS的反向解析,你可以在你的配置文件中添加以下选项去设定: +当 DNS 配置错误或服务器出现问题时,这很可能会导致延迟。这就是为什么要关闭 DNS 的反向查询的原因,你可以在你的配置文件中添加以下选项去设定: [mysqld] # Skip reverse DNS lookup of clients skip-name-resolve -更改后需要重新启动你的MySQL服务器. +更改后你需要重启 MySQL 服务。 -### 8. 配置MySQL的`query_cache_size`变量 ### +### 8. 配置 MySQL `query_cache_size` ### -如果你有很多重复的查询或者不经常改变的数据 – 请使用缓存查询。 人们常常不理解`query_cache_size`的实际含义而将此值设置为几十兆,这实际上会降低服务器的性能。 +如果你有很多重复的查询并且数据不经常改变 – 请使用缓存查询。 人们常常不理解 `query_cache_size` 的实际含义而将此值设置为 GB,这实际上会降低服务器的性能。 -背后的原因是,线程需要在更新过程中锁定缓存。通常设置为200-300 MB应该足够了。如果你的网站比较小的,你可以尝试给64M并在以后及时去增加。 +背后的原因是,在更新过程中线程需要锁定缓存。通常设置为 200-300 MB应该足够了。如果你的网站比较小的,你可以尝试给 64M 并在以后及时去增加。 -添加以下选项到你的MySQL配置文件中: +在你的 MySQL 配置文件中添加以下设置: query_cache_type = 1 query_cache_limit = 256K query_cache_min_res_unit = 2k query_cache_size = 80M -### 9. 配置`tmp_table_size`变量和`max_heap_table_size`变量 ### +### 9. 配置 `tmp_table_size` 和 `max_heap_table_size` ### -这两个变量的大小相同都将帮助你避免将数据直接写入到磁盘中去。`tmp_table_size` 是内置内存表的最大空间,如果超出限值表的大小将被转换到磁盘上的MyISAM表。 +这两个变量的大小应该相同并帮助你避免将数据直接写入到磁盘中去。`tmp_table_size` 是内置内存表的最大空间。如果表的大小超出限值将会被转换为磁盘上的 MyISAM 表。 -这将影响数据库的性能。管理员通常建议在服务器上设置这两个值为RAM的每GB为64M。 +这会影响数据库的性能。管理员通常建议在服务器上设置这两个值为每 GB RAM 64M。 [mysqld] tmp_table_size= 64M max_heap_table_size= 64M -### 10. 开启MySQL慢速查询日志 ### +### 10. 启用 MySQL 慢查询日志 ### -慢查询日志可以帮助你定位数据库的问题,并帮助您调试。在你的MySQL配置文件中添加以下选项来启用: +记录慢查询可以帮助你定位数据库中的问题并帮助你调试。这可以通过在你的 MySQL 配置文件中添加以下值来启用: slow-query-log = 1 slow-query-log-file = /var/lib/mysql/mysql-slow.log long_query_time = 1 -第一个变量开启慢查询日志,第二个告诉MySQL实际的日志文件存储在哪。使用`long_query_time`来定义MySQL查询完成时长。 +第一个变量启用慢查询日志,第二个告诉 MySQL 实际的日志文件存储位置。使用 `long_query_time` 来定义完成 MySQL 查询用时多少认为是长查询。 -### 11.检查MySQL的空闲连接 ### +### 11. 检查 MySQL 的空闲连接 ### -空闲连接会消耗资源,应中断或者尽可能被刷新。这样的连接都在“sleep”状态并且会保持一段时间。通过以下命令可以查看空闲的连接: +空闲连接会消耗资源,可以的话应该被中断或者刷新。空闲连接是指处于 “sleep” 状态并且会保持很长一段时间。你可以通过运行以下命令查看空闲连接: # mysqladmin processlist -u root -p | grep “Sleep” -这会显示处于睡眠状态的进程列表。当代码使用到数据库持久连接时会出现以下情况。使用PHP调用mysql_pconnect可以打开这个连接,即执行查询,删除认证最后关闭打开的连接。这会导致每个线程的缓冲区被保存在缓存中,直到该线程死亡。 +这会显示处于睡眠状态的进程列表。当代码使用持久连接到数据库时会出现以下情况。使用 PHP 调用 mysql_pconnect 可以打开这个连接,执行完查询之后,删除认证并保持连接为打开状态。这会导致每个线程的缓冲被保存在内存中,直到该线程死亡。 -首先你要做的就是检查代码并修复它。如果你不能访问正在运行的代码,你可以修改`wait_timeout`变量。默认值是28800秒,而你可以将其降低到60: +首先你要做的就是检查代码并修复它。如果你不能访问正在运行的代码,你可以修改 `wait_timeout` 变量。默认值是 28800 秒,而你可以安全地将其降低到 60 : wait_timeout=60 -### 12. 为MySQL选择正确的文件系统 ### +### 12. 为 MySQL 选择正确的文件系统 ### 选择正确的文件系统对数据库至关重要。在这里你需要考虑的最重要的事情是 - 数据的完整性,性能和易管理性。 -按照MariaDB的建议,最好的文件系统是XFS,ext4或者BTRFS。所有这些都可以作为企业用的日志文件系统,它们可以使用非常大的文件和大容量存储。 +按照 MariaDB 的建议,最好的文件系统是XFS、ext4 和 Btrfs。它们都是可以使用超大文件和大容量存储卷的企业级日志文件系统。 -关于这三个文件系统你可以在下面看到一些有用的信息: +下面你可以找到一些关于这三个文件系统的有用信息: 注:表格 @@ -253,21 +249,21 @@ InnoDB引擎在内存中有一个缓冲数据和索引的缓冲区。这将有
-这篇文章将详细介绍Linux文件系统的利与弊: +我们的这篇文章详细介绍了 Linux 文件系统的利与弊: -- [Linux Filesystem Explained][7] +- [Linux 文件系统解析][7] -### 13. 设置MySQL的`max_allowed_packet` ### +### 13. 设置 MySQL `max_allowed_packet` ### -MySQL的数据被拆分成包发送。通常,单个报文被认为是一次发送到客户端。`max_allowed_pa​​cket`变量可以定义被发送包的大小。 +MySQL 把数据拆分成包。通常发送到客户端的一行作为一个包。`max_allowed_pa​​cket` 变量定义了可以被发送的最大的包。 -此值设置得过低可能会导致查询速度变得非常慢,然后你会看到一个错误在MySQL的错误日志中。它建议你将数据包的大小设置成最大。 +此值设置得过低可能会导致查询速度变得非常慢,然后你会在 MySQL 的错误日志看到一个错误。建议将该值设置为最大包的大小。 -### 14. 测试MySQL的性能 ### +### 14. 测试 MySQL 的性能优化 ### -你应该定期检测MySQL/MariaDB的性能。这将帮助你查看资源的使用情况或需要调整某些变量的值。 +你应该定期检查 MySQL/MariaDB 的性能。这将帮助你了解资源的使用情况是否发生了改变或需要进行改进。 -有大量的测试工具可用,但我推荐你一个简单易用的。该工具被称为mysqltuner。 +有大量的测试工具可用,但我推荐你一个简单易用的。该工具被称为 mysqltuner。 使用下面的命令下载并运行它: @@ -276,18 +272,18 @@ MySQL的数据被拆分成包发送。通常,单个报文被认为是一次发 # cd major-MySQLTuner-perl-993bc18/ # ./mysqltuner.pl -你将收到有关MySQL使用和推荐提示的详细报告。下面是在MariaDB上安装后的默认输出: +你将收到有关 MySQL 使用的详细报告和推荐提示。下面是默认 MariaDB 安装的输出样例: -![MySQL Performance Tuning](http://www.tecmint.com/wp-content/uploads/2015/06/MySQL-Performance-Tuning.png) +![MySQL 性能优化](http://www.tecmint.com/wp-content/uploads/2015/06/MySQL-Performance-Tuning.png) -### 15. 优化和修复MySQL数据库 ### +### 15. 优化和修复 MySQL 数据库 ### -有时候MySQL/MariaDB数据库中的表很容易崩溃,尤其是当服务器意外关机时,数据库仍然被访问中或者在执行复制操作,文件系统会突然崩溃。然而,有一个免费的开源工具,被称为'mysqlcheck'的,它会自动检查,修复和优化Linux中数据库的所有表。 +有时候 MySQL/MariaDB 数据库中的表很容易崩溃,尤其是服务器意外关机、文件系统突然崩溃或复制过程中仍然访问数据库。幸运的是,有一个称为 'mysqlcheck' 的免费开源工具,它会自动检查、修复和优化 Linux 中数据库的所有表。 # mysqlcheck -u root -p --auto-repair --check --optimize --all-databases # mysqlcheck -u root -p --auto-repair --check --optimize databasename -就是这样!我希望你已经发现了上述文章有用的地方,并帮助你优化你的MySQL服务器。一如往常,如果你有任何问题或意见,请在下面的评论部分提交。 +就是这些!我希望上述文章对你有用,并帮助你优化你的 MySQL 服务器。一如往常,如果你有任何疑问或评论,请在下面的评论部分提交。 -------------------------------------------------------------------------------- @@ -295,7 +291,7 @@ via: http://www.tecmint.com/mysql-mariadb-performance-tuning-and-optimization/ 作者:[Marin Todorov][a] 译者:[strugglingyouth](https://github.com/strugglingyouth) -校对:[校对者ID](https://github.com/校对者ID) +校对:[ictlyh](https://github.com/ictlyh) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 39fdda31e2a0836c713c2ce23c4e11bf928ddd1b Mon Sep 17 00:00:00 2001 From: ZTinoZ Date: Tue, 30 Jun 2015 19:18:22 +0800 Subject: [PATCH 510/965] Translating by ZTinoZ --- ...625 Screen Capture Made Easy with these Dedicated Tools.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/share/20150625 Screen Capture Made Easy with these Dedicated Tools.md b/sources/share/20150625 Screen Capture Made Easy with these Dedicated Tools.md index 51b3e8f861..ec03bb90e6 100644 --- a/sources/share/20150625 Screen Capture Made Easy with these Dedicated Tools.md +++ b/sources/share/20150625 Screen Capture Made Easy with these Dedicated Tools.md @@ -1,8 +1,8 @@ 用这些专用工具让你截图更简单 ================================================================================ -"A picture is worth a thousand words", a phrase which emerged in the USA in the early part of the 20th century, refers to the notion that a single still image can present as much information as a large amount of descriptive text. Essentially, pictures convey information more effectively and efficiently than words can. +"一图胜过千万句",这句二十世纪早期在美国应运而生的名言,说的是一张单一的静止图片所蕴含的信息足以匹敌大量的描述性文字。本质上说,图片所传递的信息量比文字更有效更高效。 -A screenshot (or screengrab) is a snapshot or picture captured by a computer to record the output of a visual device. Screen capture software enable screenshots to be taken on a computer. This type of software has lots of uses. As an image can illustrate the operation of computer software well, screenshots play an important role in software development and documentation. Alternatively, if you have a technical problem with your computer, a screenshot allows a technical support department to understand the problems you are facing. Writing computer-related articles, documentation and tutorials is nigh on impossible without a good tool for creating screenshots. Screenshots are also useful to save snippets of anything you have on your screen, particularly when it can not be easily printed. +截图(或抓帧)是一种捕捉自计算机所录制可视化设备输出的快照或图片,屏幕捕捉软件能让计算机获取到截图。This type of software has lots of uses. As an image can illustrate the operation of computer software well, screenshots play an important role in software development and documentation. Alternatively, if you have a technical problem with your computer, a screenshot allows a technical support department to understand the problems you are facing. Writing computer-related articles, documentation and tutorials is nigh on impossible without a good tool for creating screenshots. Screenshots are also useful to save snippets of anything you have on your screen, particularly when it can not be easily printed. Linux has a good selection of open source dedicated screenshot programs, both graphical and console based. For a feature-rich dedicated screenshot utility, look no further than Shutter. This tool is a superb example of a small open source tool. But there are some great alternatives too. From d293d68f5d0d0f24c9c4a30d67fadfd508e6722d Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 30 Jun 2015 23:38:55 +0800 Subject: [PATCH 511/965] PUB:20150626 15 Useful MySQL or MariaDB Performance Tuning and Optimization Tips @strugglingyouth @ictlyh --- ...erformance Tuning and Optimization Tips.md | 106 +++++++----------- 1 file changed, 43 insertions(+), 63 deletions(-) rename {translated/tech => published}/20150626 15 Useful MySQL or MariaDB Performance Tuning and Optimization Tips.md (61%) diff --git a/translated/tech/20150626 15 Useful MySQL or MariaDB Performance Tuning and Optimization Tips.md b/published/20150626 15 Useful MySQL or MariaDB Performance Tuning and Optimization Tips.md similarity index 61% rename from translated/tech/20150626 15 Useful MySQL or MariaDB Performance Tuning and Optimization Tips.md rename to published/20150626 15 Useful MySQL or MariaDB Performance Tuning and Optimization Tips.md index 42256518f4..0f770d2ee4 100644 --- a/translated/tech/20150626 15 Useful MySQL or MariaDB Performance Tuning and Optimization Tips.md +++ b/published/20150626 15 Useful MySQL or MariaDB Performance Tuning and Optimization Tips.md @@ -1,16 +1,16 @@ 15 个有用的 MySQL/MariaDB 性能调整和优化技巧 ================================================================================ -MySQL 是一个强大的开源关系数据库管理系统或简称 RDBMS。它于 1995 年发布(20年前)。它采用结构化查询语言,这可能是数据库内容管理中最流行的选择。最新的 MySQL 版本是5.6.25,于 2015 年 5 月 29 日发行。 +MySQL 是一个强大的开源关系数据库管理系统(简称 RDBMS)。它发布于 1995 年(20年前)。它采用结构化查询语言(SQL),这可能是数据库内容管理中最流行的选择。最新的 MySQL 版本是 5.6.25,于 2015 年 5 月 29 日发布。 -关于 MySQL 一个有趣的事实是它的名字来自于 Michael Widenius(MySQL 的创始人)的女儿。尽管有许多关于 MySQL 有趣的传闻,本文旨在向你展示一些有用的实践,以帮助你管理你的 MySQL 服务器。 +关于 MySQL 一个有趣的事实是它的名字来自于 Michael Widenius(MySQL 的创始人)的女儿“ My”。尽管有许多关于 MySQL 有趣的传闻,不过本文主要是向你展示一些有用的实践,以帮助你管理你的 MySQL 服务器。 ![MySQL 性能优化](http://www.tecmint.com/wp-content/uploads/2015/06/MySQL-Performance-Tuning1.png) -MySQL 性能优化 +*MySQL 性能优化* -2009 年 4 月,MySQL 被 Oracle 收购。其结果是成立了一个叫 MariaDB 的 MySQL 社区。创建的主要原因是为了保持 MySQL 项目在通用公共许可证下自由。 +2009 年 4 月,MySQL 被 Oracle 收购。其结果是MySQL 社区分裂,创建了一个叫 MariaDB 的分支 。创建该分支的主要原因是为了保持这个项目可以在 GPL 下的自由。 -今天,MySQL 和 MariaDB 是用于类似 WordPress、Joomla、Magento 和其他 web 应用程序最广泛的 RDMS 之一(如果不是最多的)。 +今天,MySQL 和 MariaDB 是用于类似 WordPress、Joomla、Magento 和其他 web 应用程序的最流行的 RDMS 之一(如果不是最多的)。 这篇文章将告诉你一些基本的,但非常有用的关于如何优化 MySQL/MariaDB 性能的技巧。注意,本文假定您已经安装了 MySQL 或 MariaDB。如果你仍然不知道如何在系统上安装它们,你可以按照以下说明去安装: @@ -21,34 +21,34 @@ MySQL 性能优化 - [在 Gentoo Linux 上安装 MariaDB][5] - [在 Arch Linux 上安装 MariaDB][6] -**重要**: 在开始之前,不要盲目的接受这些建议。每个 MySQL 设置都是不同的,在进行任何更改之前需要慎重考虑。 +**重要提示**: 在开始之前,不要盲目的接受这些建议。每个 MySQL 设置都是不同的,在进行任何更改之前需要慎重考虑。 你需要明白这些: - MySQL/MariaDB 配置文件位于 `/etc/my.cnf`。 每次更改此文件后你需要重启 MySQL 服务,以使更改生效。 - 这篇文章使用 MySQL 5.6 版本。 -### 1. 启用 InnoDB 的 file-per-table ### +### 1. 启用 InnoDB 的每张表一个数据文件设置 ### -首先,解释清楚 InnoDB 是一个存储引擎很重要。MySQL 和 MariaDB 使用 InnoDB 作为默认存储引擎。以前,MySQL 使用系统表空间来保存数据库中的表和索引。这意味着服务器唯一的目的就是数据库处理,它们的存储盘不用于其它目的。 +首先,有一个重要的解释, InnoDB 是一个存储引擎。MySQL 和 MariaDB 使用 InnoDB 作为默认存储引擎。以前,MySQL 使用系统表空间来保存数据库中的表和索引。这意味着服务器唯一的目的就是数据库处理,它们的存储盘不用于其它目的。 -InnoDB 提供了更灵活的方式,它把每个数据库的信息保存在一个 `.ibd` 数据文件中。每个 .idb 文件表示它自己的表空间。通过这样的方式可以更快地完成类似 “TRUNCATE” 的数据库操作,当删除或截断一个数据库表时,你也可以回收未使用的空间。 +InnoDB 提供了更灵活的方式,它把每个数据库的信息保存在一个 `.ibd` 数据文件中。每个 .idb 文件代表它自己的表空间。通过这样的方式可以更快地完成类似 “TRUNCATE” 的数据库操作,当删除或截断一个数据库表时,你也可以回收未使用的空间。 -这样配置的另一个好处是你可以在一个单独的存储设备保留某些数据库表。这可以大大提高你磁盘的 I/O 负载。 +这样配置的另一个好处是你可以将某些数据库表放在一个单独的存储设备。这可以大大提升你磁盘的 I/O 负载。 MySQL 5.6及以上的版本默认启用 `innodb_file_per_table`。你可以在 /etc/my.cnf 文件中看到。该指令看起来是这样的: innodb_file_per_table=1 -### 2. 在独立分区上保存 MySQL 数据库数据 ### +### 2. 将 MySQL 数据库数据存储到独立分区上 ### **注意**:此设置只在 MySQL 上有效, 在 MariaDB 上无效。 -有时候操作系统的读/写会降低你 MySQL 服务器的性能,尤其是如果位于同一块磁盘上。因此,我建议你使用单独的磁盘(最好是 SSD)用于 MySQL 服务。 +有时候操作系统的读/写会降低你 MySQL 服务器的性能,尤其是如果操作系统和数据库的数据位于同一块磁盘上。因此,我建议你使用单独的磁盘(最好是 SSD)用于 MySQL 服务。 要完成这步,你需要将新的磁盘连接到你的计算机/服务器上。对于这篇文章,我假定磁盘挂在到 /dev/sdb。 -下一步是准备新的分区: +####下一步是准备新的分区: # fdisk /dev/sdb @@ -70,7 +70,9 @@ MySQL 5.6及以上的版本默认启用 `innodb_file_per_table`。你可以在 / /dev/sdb1 /ssd ext3 defaults 0 0 -现在我们移动 MySQL 到新磁盘中。首先停止 MySQL 服务: +####现在我们将 MySQL 移动到新磁盘中 + +首先停止 MySQL 服务: # service mysqld stop @@ -101,12 +103,12 @@ MySQL 5.6及以上的版本默认启用 `innodb_file_per_table`。你可以在 / ### 3. 优化使用 InnoDB 的缓冲池 ### -InnoDB 引擎在内存中有一个缓冲池用于缓存数据和索引。这当然有助于你更快地执行 MySQL/MariaDB 查询语句。选择合适的内存大小需要一些重要的决策并对系统的内存消耗有很好的认识。 +InnoDB 引擎在内存中有一个缓冲池用于缓存数据和索引。这当然有助于你更快地执行 MySQL/MariaDB 查询语句。选择合适的内存大小需要一些重要的决策并对系统的内存消耗有较多的认识。 下面是你需要考虑的: - 其它的进程需要消耗多少内存。这包括你的系统进程,页表,套接字缓冲。 -- 你的服务器是否专门用于 MySQL 还是你也运行其它非常消耗内存的服务。 +- 你的服务器是否专门用于 MySQL 还是你运行着其它非常消耗内存的服务。 在一个专用的机器上,你可能会把 60-70% 的内存分配给 `innodb_buffer_pool_size`。如果你打算在一个机器上运行更多的服务,你应该重新考虑专门用于 `innodb_buffer_pool_size` 的内存大小。 @@ -116,9 +118,9 @@ InnoDB 引擎在内存中有一个缓冲池用于缓存数据和索引。这当 ### 4. 在 MySQL 中避免使用 Swappiness ### -Swapping 是一个当系统移动部分内存到一个称为 “swap” 的特殊磁盘空间时运行的进程。通常当你的系统用完物理内存后就会出现这种情况,系统将信息写入磁盘而不是释放一些 RAM。正如你猜测的磁盘比你的 RAM 要慢得多。 +“交换”是一个当系统移动部分内存到一个称为 “交换空间” 的特殊磁盘空间时的过程。通常当你的系统用完物理内存后就会出现这种情况,系统将信息写入磁盘而不是释放一些内存。正如你猜测的磁盘比你的内存要慢得多。 -默认启用了该选项: +该选项默认情况下是启用的: # sysctl vm.swappiness @@ -130,18 +132,18 @@ Swapping 是一个当系统移动部分内存到一个称为 “swap” 的特 ### 5. 设置 MySQL 的最大连接数 ### -`max_connections` 指令告诉你当前你的服务器允许多少并发连接。MySQL/ MariaDB 服务器允许有特级权限的用户 max_connections + 1 的连接数。只有当执行 MySQL 查询的时候才会建立连接,执行完成后会关闭连接并被新的连接取代。 +`max_connections` 指令告诉你当前你的服务器允许多少并发连接。MySQL/MariaDB 服务器允许有 SUPER 权限的用户在最大连接之外再建立一个连接。只有当执行 MySQL 请求的时候才会建立连接,执行完成后会关闭连接并被新的连接取代。 -请记住,太多的连接会导致 RAM 的使用量过高并且会锁住你的 MySQL 服务器。一般小网站需要 100-200 的连接数而较大可能需要 500-800 甚至更多。这里的值很大程度上取决于你 MySQL/MariaDB 的使用情况。 +请记住,太多的连接会导致内存的使用量过高并且会锁住你的 MySQL 服务器。一般小网站需要 100-200 的连接数,而较大可能需要 500-800 甚至更多。这里的值很大程度上取决于你 MySQL/MariaDB 的使用情况。 你可以动态地改变 `max_connections` 的值而无需重启MySQL服务器: # mysql -u root -p - mysql> set global max_connections := 300; + mysql> set global max_connections = 300; -### 6. 配置 MySQL `thread_cache_size` ### +### 6. 配置 MySQL 的线程缓存数量 ### - `thread_cache_size` 指令用来设置你服务器缓存的线程数量。当客户端断开连接时,如果当前线程数小于thread_cache_size,他的线程将被放入缓存中。下一个请求通过使用缓存池中的线程来完成。 + `thread_cache_size` 指令用来设置你服务器缓存的线程数量。当客户端断开连接时,如果当前线程数小于 `thread_cache_size`,它的线程将被放入缓存中。下一个请求通过使用缓存池中的线程来完成。 要提高服务器的性能,你可以设置 `thread_cache_size` 的值相对高一些。你可以通过以下方法来查看线程缓存命中率: @@ -152,7 +154,7 @@ Swapping 是一个当系统移动部分内存到一个称为 “swap” 的特 100 - ((Threads_created / Connections) * 100) -如果你得到一个较低的数字,这意味着大多数 mysql 连接请求使用新的线程,而不是从缓存加载。在这种情况下,你需要增加 `thread_cache_size`。 +如果你得到一个较低的数字,这意味着大多数 mysql 连接使用新的线程,而不是从缓存加载。在这种情况下,你需要增加 `thread_cache_size`。 这里有一个好处是可以动态地改变 `thread_cache_size` 而无需重启 MySQL 服务。你可以通过以下方式来实现: @@ -170,9 +172,9 @@ Swapping 是一个当系统移动部分内存到一个称为 “swap” 的特 更改后你需要重启 MySQL 服务。 -### 8. 配置 MySQL `query_cache_size` ### +### 8. 配置 MySQL 的查询缓存容量 ### -如果你有很多重复的查询并且数据不经常改变 – 请使用缓存查询。 人们常常不理解 `query_cache_size` 的实际含义而将此值设置为 GB,这实际上会降低服务器的性能。 +如果你有很多重复的查询并且数据不经常改变 – 请使用缓存查询。 人们常常不理解 `query_cache_size` 的实际含义而将此值设置为 GB 级,这实际上会降低服务器的性能。 背后的原因是,在更新过程中线程需要锁定缓存。通常设置为 200-300 MB应该足够了。如果你的网站比较小的,你可以尝试给 64M 并在以后及时去增加。 @@ -183,11 +185,11 @@ Swapping 是一个当系统移动部分内存到一个称为 “swap” 的特 query_cache_min_res_unit = 2k query_cache_size = 80M -### 9. 配置 `tmp_table_size` 和 `max_heap_table_size` ### +### 9. 配置临时表容量和内存表最大容量 ### -这两个变量的大小应该相同并帮助你避免将数据直接写入到磁盘中去。`tmp_table_size` 是内置内存表的最大空间。如果表的大小超出限值将会被转换为磁盘上的 MyISAM 表。 +`tmp_table_size` 和 `max_heap_table_size` 这两个变量的大小应该相同,它们可以让你避免磁盘写入。`tmp_table_size` 是内置内存表的最大空间。如果表的大小超出限值将会被转换为磁盘上的 MyISAM 表。 -这会影响数据库的性能。管理员通常建议在服务器上设置这两个值为每 GB RAM 64M。 +这会影响数据库的性能。管理员通常建议在服务器上设置这两个值为每 GB 内存给 64M。 [mysqld] tmp_table_size= 64M @@ -201,17 +203,17 @@ Swapping 是一个当系统移动部分内存到一个称为 “swap” 的特 slow-query-log-file = /var/lib/mysql/mysql-slow.log long_query_time = 1 -第一个变量启用慢查询日志,第二个告诉 MySQL 实际的日志文件存储位置。使用 `long_query_time` 来定义完成 MySQL 查询用时多少认为是长查询。 +第一个变量启用慢查询日志,第二个告诉 MySQL 实际的日志文件存储位置。使用 `long_query_time` 来定义完成 MySQL 查询多少用时算长。 ### 11. 检查 MySQL 的空闲连接 ### -空闲连接会消耗资源,可以的话应该被中断或者刷新。空闲连接是指处于 “sleep” 状态并且会保持很长一段时间。你可以通过运行以下命令查看空闲连接: +空闲连接会消耗资源,可以的话应该被终止或者刷新。空闲连接是指处于 “sleep” 状态并且保持了很长一段时间的连接。你可以通过运行以下命令查看空闲连接: # mysqladmin processlist -u root -p | grep “Sleep” -这会显示处于睡眠状态的进程列表。当代码使用持久连接到数据库时会出现以下情况。使用 PHP 调用 mysql_pconnect 可以打开这个连接,执行完查询之后,删除认证并保持连接为打开状态。这会导致每个线程的缓冲被保存在内存中,直到该线程死亡。 +这会显示处于睡眠状态的进程列表。当代码使用持久连接到数据库时会出现这种情况。使用 PHP 调用 mysql_pconnect 可以打开这个连接,执行完查询之后,删除认证信息并保持连接为打开状态。这会导致每个线程的缓冲都被保存在内存中,直到该线程结束。 -首先你要做的就是检查代码并修复它。如果你不能访问正在运行的代码,你可以修改 `wait_timeout` 变量。默认值是 28800 秒,而你可以安全地将其降低到 60 : +首先你要做的就是检查代码问题并修复它。如果你不能访问正在运行的代码,你可以修改 `wait_timeout` 变量。默认值是 28800 秒,而你可以安全地将其降低到 60 : wait_timeout=60 @@ -219,43 +221,21 @@ Swapping 是一个当系统移动部分内存到一个称为 “swap” 的特 选择正确的文件系统对数据库至关重要。在这里你需要考虑的最重要的事情是 - 数据的完整性,性能和易管理性。 -按照 MariaDB 的建议,最好的文件系统是XFS、ext4 和 Btrfs。它们都是可以使用超大文件和大容量存储卷的企业级日志文件系统。 +按照 MariaDB 的建议,最好的文件系统是XFS、ext4 和 Btrfs。它们都是可以使用超大文件和大容量存储卷的企业级日志型文件系统。 下面你可以找到一些关于这三个文件系统的有用信息: -注:表格 - - - - - - - - - - - - - - - - - - - - - - - -
FilesystemsXFSExt4Btrfs
Maximum filesystem size8EB1EB16EB
Maximum file size8EB16TB16EB
+| 文件系统 | XFS | Ext4 | Btrfs | +|---------------|-----|------|-------| +| 文件系统最大容量 | 8EB | 1EB | 16EB | +| 最大文件大小 | 8EB | 16TB | 16EB | -我们的这篇文章详细介绍了 Linux 文件系统的利与弊: -- [Linux 文件系统解析][7] +我们的这篇文章详细介绍了 Linux 文件系统的利与弊: [Linux 文件系统解析][7]。 -### 13. 设置 MySQL `max_allowed_packet` ### +### 13. 设置 MySQL 允许的最大数据包 ### -MySQL 把数据拆分成包。通常发送到客户端的一行作为一个包。`max_allowed_pa​​cket` 变量定义了可以被发送的最大的包。 +MySQL 把数据拆分成包。通常一个包就是发送到客户端的一行数据。`max_allowed_pa​​cket` 变量定义了可以被发送的最大的包。 此值设置得过低可能会导致查询速度变得非常慢,然后你会在 MySQL 的错误日志看到一个错误。建议将该值设置为最大包的大小。 From 3d2bf2f9cf39714cbaa5ac64278e71da439ac00a Mon Sep 17 00:00:00 2001 From: wxy Date: Wed, 1 Jul 2015 00:16:33 +0800 Subject: [PATCH 512/965] =?UTF-8?q?=E5=BD=92=E6=A1=A3=20201506?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...Compact Text Editors Great for Remote Editing and Much More.md | 0 .../20141219 What is good audio editing software on Linux.md | 0 .../20150126 Installing Cisco Packet tracer in Linux.md | 0 .../20150126 iptraf--A TCP or UDP Network Monitoring Utility.md | 0 .../20150128 The top 10 rookie open source projects.md | 0 ...ow to access Feedly RSS feed from the command line on Linux.md | 0 ... or DDoS Attacks Using Mod_Security and Mod_evasive Modules.md | 0 ...mote incremental backup of LUKS-encrypted disk or partition.md | 0 ... Material Design Inspired GTK And Icon Theme Paper in Linux.md | 0 published/{ => 201506}/20150310 FAQ--BSD.md | 0 ...idirectionally from Command Line Using 'Speedtest-CLI' Tool.md | 0 ...20150323 How to set up networking between Docker containers.md | 0 .../20150326 A Peep into Process Management Commands in Linux.md | 0 ...0 How to Serve Git Repositories Using Gitblit Tool in Linux.md | 0 ...1 How to Install WordPress with Nginx in a Docker Container.md | 0 ...150331 How to set up remote desktop on Linux VPS using x2go.md | 0 .../20150407 Top 6 Ways To Get Your iTunes Experience On Linux.md | 0 ... Tools for Browsing Websites and Downloading Files in Linux.md | 0 ...How to Show Dialog Box from Bash Shell Script with Examples.md | 0 ...manage remote MySQL databases on Linux VPS using a GUI tool.md | 0 ...wers--How to compile ixgbe driver on CentOS, RHEL or Fedora.md | 0 ...h Answers--How to configure PCI-passthrough on virt-manager.md | 0 .../20150416 Linux Network Statistics Tools or Commands.md | 0 .../20150417 How to Install Discourse in a Docker Container.md | 0 ...rectory attributes in linux using chattr and lsattr command.md | 0 .../20150423 20 Awesome Docker Containers for a Desktop User.md | 0 ...ing Helps Connecting Private interface to Internet in Linux.md | 0 ...ow to Change Default Web Browser and Email Client in Ubuntu.md | 0 ...50427 15 Things to Do After Installing Ubuntu 15.04 Desktop.md | 0 .../{ => 201506}/20150427 How to set up NTP server in CentOS.md | 0 ...w To Integrate Apache2 With Tomcat 7 Using mod_jk Connector.md | 0 ...lasma 5.3 Released, Here' s How To Upgrade in Kubuntu 15.04.md | 0 .../20150429 What are good command line HTTP clients.md | 0 ...werDNS' (with MariaDB) and 'PowerAdmin' in RHEL or CentOS 7.md | 0 ...mmandline Chat Server and Remove Unwanted Packages in Linux.md | 0 .../20150506 First Step Guide for Learning Shell Scripting.md | 0 .../20150506 How to Setup OpenERP (Odoo) on CentOS 7.x.md | 0 ...ng password for default keyring to unlock on Ubuntu desktop.md | 0 ...nswers--How to install Shrew Soft IPsec VPN client on Linux.md | 0 ...Download Manager 2.0 in Debian Ubuntu Linux Mint and Fedora.md | 0 .../20150511 Fix Various Update Errors In Ubuntu 14.04.md | 0 .../20150511 Open Source History--Why Did Linux Succeed.md | 0 ...5 Zypper Commands to Manage 'Suse' Linux Package Management.md | 0 ...rk, Disk Usage, Uptime, Load Average and RAM Usage in Linux.md | 0 .../20150512 How To Run Docker Client Inside Windows OS.md | 0 ...AQs with Answers--How to view torrent file content on Linux.md | 0 .../20150515 Basic Networking Commands with Docker Containers.md | 0 .../20150515 Extend Swap Space using Swap file in Linux.md | 0 .../20150515 How to Install Percona Server on CentOS 7.md | 0 ...4′ Linux Operating System to Preserve Privacy and Anonymity.md | 0 ...s Ubuntu App Applies Instagram Style Filters to Your Photos.md | 0 ...and Mysterious Uses of Symbol or Operator in Linux Commands.md | 0 ...70 Expected Shell Scripting Interview Questions and Answers.md | 0 ...x '404 Not Found' error with 'apt-get update' on old Ubuntu.md | 0 ...ntered a section with no Package--header' error on Raspbian.md | 0 ...AQs with Answers--How to view threads of a process on Linux.md | 0 ...ith Answers--What is the Apache error log location on Linux.md | 0 .../20150520 How to Use Docker Machine with a Cloud Provider.md | 0 .../20150520 How to Use tmpfs on RHEL or CentOS 7.0.md | 0 ...ile and install wxWidgets on Ubuntu or Debian or Linux Mint.md | 0 ...520 Shell Script to Backup Files or Directories Using rsync.md | 0 ...stem proxy settings from the command line on Ubuntu desktop.md | 0 ... Answers--How to install Unity Tweak Tool on Ubuntu desktop.md | 0 .../20150521 Will Ubuntu Linux Hit 200 Million Users This Year.md | 0 ...ux ntopng--Network Monitoring Tool Installation Screenshots.md | 0 published/{ => 201506}/20150527 3 Open Source Python Shells.md | 0 .../20150527 3 Useful Hacks Every Linux User Must Know.md | 0 .../20150527 How To Check Laptop CPU Temperature In Ubuntu.md | 0 ... Create Own Online Shopping Store Using 'OpenCart' in Linux.md | 0 ...rocesses or Unresponsive Applications Using 'xkill' Command.md | 0 ...x FAQs with Answers--How to mount an LVM partition on Linux.md | 0 .../20150528 11 pointless but awesome Linux terminal tricks.md | 0 ...F' Fork of Yum Commands for RPM Package Management in Linux.md | 0 .../20150528 Things To Do After Installing Fedora 22.md | 0 .../20150603 Arc Is a Gorgeous GTK Theme for Linux Desktops.md | 0 ...s How to Install the Beautiful Arc GTK+ Flat Theme on Linux.md | 0 .../20150604 12 Globally Recognized Linux Certifications.md | 0 ...Foundation achievements in 2014--download the Annual Report.md | 0 ...buntu's Juju Now Supports systemd and Google Cloud Platform.md | 0 ...ow to Clear RAM Memory Cache Buffer and Swap Space on Linux.md | 0 ...all nginx and google pagespeed on Ubuntu 15.04 Vivid Vervet.md | 0 .../20150610 Install Android Studio on Ubuntu 15.04.md | 0 ...612 Inside NGINX--How We Designed for Performance and Scale.md | 0 .../20150615 PHP at 20--From pet project to powerhouse.md | 0 published/{ => 201506}/20150617 The Art of Command Line.md | 0 .../20150623 Linux Kernel 4.1 Released This Is What's New.md | 0 ...l MySQL or MariaDB Performance Tuning and Optimization Tips.md | 0 87 files changed, 0 insertions(+), 0 deletions(-) rename published/{ => 201506}/20141013 Compact Text Editors Great for Remote Editing and Much More.md (100%) rename published/{ => 201506}/20141219 What is good audio editing software on Linux.md (100%) rename published/{ => 201506}/20150126 Installing Cisco Packet tracer in Linux.md (100%) rename published/{ => 201506}/20150126 iptraf--A TCP or UDP Network Monitoring Utility.md (100%) rename published/{ => 201506}/20150128 The top 10 rookie open source projects.md (100%) rename published/{ => 201506}/20150209 How to access Feedly RSS feed from the command line on Linux.md (100%) rename published/{ => 201506}/20150211 Protect Apache Against Brute Force or DDoS Attacks Using Mod_Security and Mod_evasive Modules.md (100%) rename published/{ => 201506}/20150225 How to make remote incremental backup of LUKS-encrypted disk or partition.md (100%) rename published/{ => 201506}/20150225 Install Google's Material Design Inspired GTK And Icon Theme Paper in Linux.md (100%) rename published/{ => 201506}/20150310 FAQ--BSD.md (100%) rename published/{ => 201506}/20150316 How to Test Your Internet Speed Bidirectionally from Command Line Using 'Speedtest-CLI' Tool.md (100%) rename published/{ => 201506}/20150323 How to set up networking between Docker containers.md (100%) rename published/{ => 201506}/20150326 A Peep into Process Management Commands in Linux.md (100%) rename published/{ => 201506}/20150330 How to Serve Git Repositories Using Gitblit Tool in Linux.md (100%) rename published/{ => 201506}/20150331 How to Install WordPress with Nginx in a Docker Container.md (100%) rename published/{ => 201506}/20150331 How to set up remote desktop on Linux VPS using x2go.md (100%) rename published/{ => 201506}/20150407 Top 6 Ways To Get Your iTunes Experience On Linux.md (100%) rename published/{ => 201506}/20150410 7 Command Line Tools for Browsing Websites and Downloading Files in Linux.md (100%) rename published/{ => 201506}/20150413 How to Show Dialog Box from Bash Shell Script with Examples.md (100%) rename published/{ => 201506}/20150413 How to manage remote MySQL databases on Linux VPS using a GUI tool.md (100%) rename published/{ => 201506}/20150413 Linux FAQs with Answers--How to compile ixgbe driver on CentOS, RHEL or Fedora.md (100%) rename published/{ => 201506}/20150413 Linux FAQs with Answers--How to configure PCI-passthrough on virt-manager.md (100%) rename published/{ => 201506}/20150416 Linux Network Statistics Tools or Commands.md (100%) rename published/{ => 201506}/20150417 How to Install Discourse in a Docker Container.md (100%) rename published/{ => 201506}/20150420 Managing file and directory attributes in linux using chattr and lsattr command.md (100%) rename published/{ => 201506}/20150423 20 Awesome Docker Containers for a Desktop User.md (100%) rename published/{ => 201506}/20150423 How IP forwarding Helps Connecting Private interface to Internet in Linux.md (100%) rename published/{ => 201506}/20150423 How to Change Default Web Browser and Email Client in Ubuntu.md (100%) rename published/{ => 201506}/20150427 15 Things to Do After Installing Ubuntu 15.04 Desktop.md (100%) rename published/{ => 201506}/20150427 How to set up NTP server in CentOS.md (100%) rename published/{ => 201506}/20150429 How To Integrate Apache2 With Tomcat 7 Using mod_jk Connector.md (100%) rename published/{ => 201506}/20150429 KDE Plasma 5.3 Released, Here' s How To Upgrade in Kubuntu 15.04.md (100%) rename published/{ => 201506}/20150429 What are good command line HTTP clients.md (100%) rename published/{ => 201506}/20150504 How to Install and Configure 'PowerDNS' (with MariaDB) and 'PowerAdmin' in RHEL or CentOS 7.md (100%) rename published/{ => 201506}/20150504 Useful Commands to Create Commandline Chat Server and Remove Unwanted Packages in Linux.md (100%) rename published/{ => 201506}/20150506 First Step Guide for Learning Shell Scripting.md (100%) rename published/{ => 201506}/20150506 How to Setup OpenERP (Odoo) on CentOS 7.x.md (100%) rename published/{ => 201506}/20150506 Linux FAQs with Answers--How to disable entering password for default keyring to unlock on Ubuntu desktop.md (100%) rename published/{ => 201506}/20150506 Linux FAQs with Answers--How to install Shrew Soft IPsec VPN client on Linux.md (100%) rename published/{ => 201506}/20150507 Install uGet Download Manager 2.0 in Debian Ubuntu Linux Mint and Fedora.md (100%) rename published/{ => 201506}/20150511 Fix Various Update Errors In Ubuntu 14.04.md (100%) rename published/{ => 201506}/20150511 Open Source History--Why Did Linux Succeed.md (100%) rename published/{ => 201506}/20150512 45 Zypper Commands to Manage 'Suse' Linux Package Management.md (100%) rename published/{ => 201506}/20150512 A Shell Script to Monitor Network, Disk Usage, Uptime, Load Average and RAM Usage in Linux.md (100%) rename published/{ => 201506}/20150512 How To Run Docker Client Inside Windows OS.md (100%) rename published/{ => 201506}/20150512 Linux FAQs with Answers--How to view torrent file content on Linux.md (100%) rename published/{ => 201506}/20150515 Basic Networking Commands with Docker Containers.md (100%) rename published/{ => 201506}/20150515 Extend Swap Space using Swap file in Linux.md (100%) rename published/{ => 201506}/20150515 How to Install Percona Server on CentOS 7.md (100%) rename published/{ => 201506}/20150515 Install 'Tails 1.4′ Linux Operating System to Preserve Privacy and Anonymity.md (100%) rename published/{ => 201506}/20150515 This Ubuntu App Applies Instagram Style Filters to Your Photos.md (100%) rename published/{ => 201506}/20150518 10 Amazing and Mysterious Uses of Symbol or Operator in Linux Commands.md (100%) rename published/{ => 201506}/20150518 70 Expected Shell Scripting Interview Questions and Answers.md (100%) rename published/{ => 201506}/20150518 Linux FAQs with Answers--How to fix '404 Not Found' error with 'apt-get update' on old Ubuntu.md (100%) rename published/{ => 201506}/20150518 Linux FAQs with Answers--How to fix 'Encountered a section with no Package--header' error on Raspbian.md (100%) rename published/{ => 201506}/20150518 Linux FAQs with Answers--How to view threads of a process on Linux.md (100%) rename published/{ => 201506}/20150518 Linux FAQs with Answers--What is the Apache error log location on Linux.md (100%) rename published/{ => 201506}/20150520 How to Use Docker Machine with a Cloud Provider.md (100%) rename published/{ => 201506}/20150520 How to Use tmpfs on RHEL or CentOS 7.0.md (100%) rename published/{ => 201506}/20150520 How to compile and install wxWidgets on Ubuntu or Debian or Linux Mint.md (100%) rename published/{ => 201506}/20150520 Shell Script to Backup Files or Directories Using rsync.md (100%) rename published/{ => 201506}/20150521 Linux FAQs with Answers--How to change system proxy settings from the command line on Ubuntu desktop.md (100%) rename published/{ => 201506}/20150521 Linux FAQs with Answers--How to install Unity Tweak Tool on Ubuntu desktop.md (100%) rename published/{ => 201506}/20150521 Will Ubuntu Linux Hit 200 Million Users This Year.md (100%) rename published/{ => 201506}/20150525 Linux ntopng--Network Monitoring Tool Installation Screenshots.md (100%) rename published/{ => 201506}/20150527 3 Open Source Python Shells.md (100%) rename published/{ => 201506}/20150527 3 Useful Hacks Every Linux User Must Know.md (100%) rename published/{ => 201506}/20150527 How To Check Laptop CPU Temperature In Ubuntu.md (100%) rename published/{ => 201506}/20150527 How to Create Own Online Shopping Store Using 'OpenCart' in Linux.md (100%) rename published/{ => 201506}/20150527 How to Kill Linux Processes or Unresponsive Applications Using 'xkill' Command.md (100%) rename published/{ => 201506}/20150527 Linux FAQs with Answers--How to mount an LVM partition on Linux.md (100%) rename published/{ => 201506}/20150528 11 pointless but awesome Linux terminal tricks.md (100%) rename published/{ => 201506}/20150528 27 'DNF' Fork of Yum Commands for RPM Package Management in Linux.md (100%) rename published/{ => 201506}/20150528 Things To Do After Installing Fedora 22.md (100%) rename published/{ => 201506}/20150603 Arc Is a Gorgeous GTK Theme for Linux Desktops.md (100%) rename published/{ => 201506}/20150603 Here's How to Install the Beautiful Arc GTK+ Flat Theme on Linux.md (100%) rename published/{ => 201506}/20150604 12 Globally Recognized Linux Certifications.md (100%) rename published/{ => 201506}/20150604 Read about The Document Foundation achievements in 2014--download the Annual Report.md (100%) rename published/{ => 201506}/20150604 Ubuntu's Juju Now Supports systemd and Google Cloud Platform.md (100%) rename published/{ => 201506}/20150610 How to Clear RAM Memory Cache Buffer and Swap Space on Linux.md (100%) rename published/{ => 201506}/20150610 How to Install nginx and google pagespeed on Ubuntu 15.04 Vivid Vervet.md (100%) rename published/{ => 201506}/20150610 Install Android Studio on Ubuntu 15.04.md (100%) rename published/{ => 201506}/20150612 Inside NGINX--How We Designed for Performance and Scale.md (100%) rename published/{ => 201506}/20150615 PHP at 20--From pet project to powerhouse.md (100%) rename published/{ => 201506}/20150617 The Art of Command Line.md (100%) rename published/{ => 201506}/20150623 Linux Kernel 4.1 Released This Is What's New.md (100%) rename published/{ => 201506}/20150626 15 Useful MySQL or MariaDB Performance Tuning and Optimization Tips.md (100%) diff --git a/published/20141013 Compact Text Editors Great for Remote Editing and Much More.md b/published/201506/20141013 Compact Text Editors Great for Remote Editing and Much More.md similarity index 100% rename from published/20141013 Compact Text Editors Great for Remote Editing and Much More.md rename to published/201506/20141013 Compact Text Editors Great for Remote Editing and Much More.md diff --git a/published/20141219 What is good audio editing software on Linux.md b/published/201506/20141219 What is good audio editing software on Linux.md similarity index 100% rename from published/20141219 What is good audio editing software on Linux.md rename to published/201506/20141219 What is good audio editing software on Linux.md diff --git a/published/20150126 Installing Cisco Packet tracer in Linux.md b/published/201506/20150126 Installing Cisco Packet tracer in Linux.md similarity index 100% rename from published/20150126 Installing Cisco Packet tracer in Linux.md rename to published/201506/20150126 Installing Cisco Packet tracer in Linux.md diff --git a/published/20150126 iptraf--A TCP or UDP Network Monitoring Utility.md b/published/201506/20150126 iptraf--A TCP or UDP Network Monitoring Utility.md similarity index 100% rename from published/20150126 iptraf--A TCP or UDP Network Monitoring Utility.md rename to published/201506/20150126 iptraf--A TCP or UDP Network Monitoring Utility.md diff --git a/published/20150128 The top 10 rookie open source projects.md b/published/201506/20150128 The top 10 rookie open source projects.md similarity index 100% rename from published/20150128 The top 10 rookie open source projects.md rename to published/201506/20150128 The top 10 rookie open source projects.md diff --git a/published/20150209 How to access Feedly RSS feed from the command line on Linux.md b/published/201506/20150209 How to access Feedly RSS feed from the command line on Linux.md similarity index 100% rename from published/20150209 How to access Feedly RSS feed from the command line on Linux.md rename to published/201506/20150209 How to access Feedly RSS feed from the command line on Linux.md diff --git a/published/20150211 Protect Apache Against Brute Force or DDoS Attacks Using Mod_Security and Mod_evasive Modules.md b/published/201506/20150211 Protect Apache Against Brute Force or DDoS Attacks Using Mod_Security and Mod_evasive Modules.md similarity index 100% rename from published/20150211 Protect Apache Against Brute Force or DDoS Attacks Using Mod_Security and Mod_evasive Modules.md rename to published/201506/20150211 Protect Apache Against Brute Force or DDoS Attacks Using Mod_Security and Mod_evasive Modules.md diff --git a/published/20150225 How to make remote incremental backup of LUKS-encrypted disk or partition.md b/published/201506/20150225 How to make remote incremental backup of LUKS-encrypted disk or partition.md similarity index 100% rename from published/20150225 How to make remote incremental backup of LUKS-encrypted disk or partition.md rename to published/201506/20150225 How to make remote incremental backup of LUKS-encrypted disk or partition.md diff --git a/published/20150225 Install Google's Material Design Inspired GTK And Icon Theme Paper in Linux.md b/published/201506/20150225 Install Google's Material Design Inspired GTK And Icon Theme Paper in Linux.md similarity index 100% rename from published/20150225 Install Google's Material Design Inspired GTK And Icon Theme Paper in Linux.md rename to published/201506/20150225 Install Google's Material Design Inspired GTK And Icon Theme Paper in Linux.md diff --git a/published/20150310 FAQ--BSD.md b/published/201506/20150310 FAQ--BSD.md similarity index 100% rename from published/20150310 FAQ--BSD.md rename to published/201506/20150310 FAQ--BSD.md diff --git a/published/20150316 How to Test Your Internet Speed Bidirectionally from Command Line Using 'Speedtest-CLI' Tool.md b/published/201506/20150316 How to Test Your Internet Speed Bidirectionally from Command Line Using 'Speedtest-CLI' Tool.md similarity index 100% rename from published/20150316 How to Test Your Internet Speed Bidirectionally from Command Line Using 'Speedtest-CLI' Tool.md rename to published/201506/20150316 How to Test Your Internet Speed Bidirectionally from Command Line Using 'Speedtest-CLI' Tool.md diff --git a/published/20150323 How to set up networking between Docker containers.md b/published/201506/20150323 How to set up networking between Docker containers.md similarity index 100% rename from published/20150323 How to set up networking between Docker containers.md rename to published/201506/20150323 How to set up networking between Docker containers.md diff --git a/published/20150326 A Peep into Process Management Commands in Linux.md b/published/201506/20150326 A Peep into Process Management Commands in Linux.md similarity index 100% rename from published/20150326 A Peep into Process Management Commands in Linux.md rename to published/201506/20150326 A Peep into Process Management Commands in Linux.md diff --git a/published/20150330 How to Serve Git Repositories Using Gitblit Tool in Linux.md b/published/201506/20150330 How to Serve Git Repositories Using Gitblit Tool in Linux.md similarity index 100% rename from published/20150330 How to Serve Git Repositories Using Gitblit Tool in Linux.md rename to published/201506/20150330 How to Serve Git Repositories Using Gitblit Tool in Linux.md diff --git a/published/20150331 How to Install WordPress with Nginx in a Docker Container.md b/published/201506/20150331 How to Install WordPress with Nginx in a Docker Container.md similarity index 100% rename from published/20150331 How to Install WordPress with Nginx in a Docker Container.md rename to published/201506/20150331 How to Install WordPress with Nginx in a Docker Container.md diff --git a/published/20150331 How to set up remote desktop on Linux VPS using x2go.md b/published/201506/20150331 How to set up remote desktop on Linux VPS using x2go.md similarity index 100% rename from published/20150331 How to set up remote desktop on Linux VPS using x2go.md rename to published/201506/20150331 How to set up remote desktop on Linux VPS using x2go.md diff --git a/published/20150407 Top 6 Ways To Get Your iTunes Experience On Linux.md b/published/201506/20150407 Top 6 Ways To Get Your iTunes Experience On Linux.md similarity index 100% rename from published/20150407 Top 6 Ways To Get Your iTunes Experience On Linux.md rename to published/201506/20150407 Top 6 Ways To Get Your iTunes Experience On Linux.md diff --git a/published/20150410 7 Command Line Tools for Browsing Websites and Downloading Files in Linux.md b/published/201506/20150410 7 Command Line Tools for Browsing Websites and Downloading Files in Linux.md similarity index 100% rename from published/20150410 7 Command Line Tools for Browsing Websites and Downloading Files in Linux.md rename to published/201506/20150410 7 Command Line Tools for Browsing Websites and Downloading Files in Linux.md diff --git a/published/20150413 How to Show Dialog Box from Bash Shell Script with Examples.md b/published/201506/20150413 How to Show Dialog Box from Bash Shell Script with Examples.md similarity index 100% rename from published/20150413 How to Show Dialog Box from Bash Shell Script with Examples.md rename to published/201506/20150413 How to Show Dialog Box from Bash Shell Script with Examples.md diff --git a/published/20150413 How to manage remote MySQL databases on Linux VPS using a GUI tool.md b/published/201506/20150413 How to manage remote MySQL databases on Linux VPS using a GUI tool.md similarity index 100% rename from published/20150413 How to manage remote MySQL databases on Linux VPS using a GUI tool.md rename to published/201506/20150413 How to manage remote MySQL databases on Linux VPS using a GUI tool.md diff --git a/published/20150413 Linux FAQs with Answers--How to compile ixgbe driver on CentOS, RHEL or Fedora.md b/published/201506/20150413 Linux FAQs with Answers--How to compile ixgbe driver on CentOS, RHEL or Fedora.md similarity index 100% rename from published/20150413 Linux FAQs with Answers--How to compile ixgbe driver on CentOS, RHEL or Fedora.md rename to published/201506/20150413 Linux FAQs with Answers--How to compile ixgbe driver on CentOS, RHEL or Fedora.md diff --git a/published/20150413 Linux FAQs with Answers--How to configure PCI-passthrough on virt-manager.md b/published/201506/20150413 Linux FAQs with Answers--How to configure PCI-passthrough on virt-manager.md similarity index 100% rename from published/20150413 Linux FAQs with Answers--How to configure PCI-passthrough on virt-manager.md rename to published/201506/20150413 Linux FAQs with Answers--How to configure PCI-passthrough on virt-manager.md diff --git a/published/20150416 Linux Network Statistics Tools or Commands.md b/published/201506/20150416 Linux Network Statistics Tools or Commands.md similarity index 100% rename from published/20150416 Linux Network Statistics Tools or Commands.md rename to published/201506/20150416 Linux Network Statistics Tools or Commands.md diff --git a/published/20150417 How to Install Discourse in a Docker Container.md b/published/201506/20150417 How to Install Discourse in a Docker Container.md similarity index 100% rename from published/20150417 How to Install Discourse in a Docker Container.md rename to published/201506/20150417 How to Install Discourse in a Docker Container.md diff --git a/published/20150420 Managing file and directory attributes in linux using chattr and lsattr command.md b/published/201506/20150420 Managing file and directory attributes in linux using chattr and lsattr command.md similarity index 100% rename from published/20150420 Managing file and directory attributes in linux using chattr and lsattr command.md rename to published/201506/20150420 Managing file and directory attributes in linux using chattr and lsattr command.md diff --git a/published/20150423 20 Awesome Docker Containers for a Desktop User.md b/published/201506/20150423 20 Awesome Docker Containers for a Desktop User.md similarity index 100% rename from published/20150423 20 Awesome Docker Containers for a Desktop User.md rename to published/201506/20150423 20 Awesome Docker Containers for a Desktop User.md diff --git a/published/20150423 How IP forwarding Helps Connecting Private interface to Internet in Linux.md b/published/201506/20150423 How IP forwarding Helps Connecting Private interface to Internet in Linux.md similarity index 100% rename from published/20150423 How IP forwarding Helps Connecting Private interface to Internet in Linux.md rename to published/201506/20150423 How IP forwarding Helps Connecting Private interface to Internet in Linux.md diff --git a/published/20150423 How to Change Default Web Browser and Email Client in Ubuntu.md b/published/201506/20150423 How to Change Default Web Browser and Email Client in Ubuntu.md similarity index 100% rename from published/20150423 How to Change Default Web Browser and Email Client in Ubuntu.md rename to published/201506/20150423 How to Change Default Web Browser and Email Client in Ubuntu.md diff --git a/published/20150427 15 Things to Do After Installing Ubuntu 15.04 Desktop.md b/published/201506/20150427 15 Things to Do After Installing Ubuntu 15.04 Desktop.md similarity index 100% rename from published/20150427 15 Things to Do After Installing Ubuntu 15.04 Desktop.md rename to published/201506/20150427 15 Things to Do After Installing Ubuntu 15.04 Desktop.md diff --git a/published/20150427 How to set up NTP server in CentOS.md b/published/201506/20150427 How to set up NTP server in CentOS.md similarity index 100% rename from published/20150427 How to set up NTP server in CentOS.md rename to published/201506/20150427 How to set up NTP server in CentOS.md diff --git a/published/20150429 How To Integrate Apache2 With Tomcat 7 Using mod_jk Connector.md b/published/201506/20150429 How To Integrate Apache2 With Tomcat 7 Using mod_jk Connector.md similarity index 100% rename from published/20150429 How To Integrate Apache2 With Tomcat 7 Using mod_jk Connector.md rename to published/201506/20150429 How To Integrate Apache2 With Tomcat 7 Using mod_jk Connector.md diff --git a/published/20150429 KDE Plasma 5.3 Released, Here' s How To Upgrade in Kubuntu 15.04.md b/published/201506/20150429 KDE Plasma 5.3 Released, Here' s How To Upgrade in Kubuntu 15.04.md similarity index 100% rename from published/20150429 KDE Plasma 5.3 Released, Here' s How To Upgrade in Kubuntu 15.04.md rename to published/201506/20150429 KDE Plasma 5.3 Released, Here' s How To Upgrade in Kubuntu 15.04.md diff --git a/published/20150429 What are good command line HTTP clients.md b/published/201506/20150429 What are good command line HTTP clients.md similarity index 100% rename from published/20150429 What are good command line HTTP clients.md rename to published/201506/20150429 What are good command line HTTP clients.md diff --git a/published/20150504 How to Install and Configure 'PowerDNS' (with MariaDB) and 'PowerAdmin' in RHEL or CentOS 7.md b/published/201506/20150504 How to Install and Configure 'PowerDNS' (with MariaDB) and 'PowerAdmin' in RHEL or CentOS 7.md similarity index 100% rename from published/20150504 How to Install and Configure 'PowerDNS' (with MariaDB) and 'PowerAdmin' in RHEL or CentOS 7.md rename to published/201506/20150504 How to Install and Configure 'PowerDNS' (with MariaDB) and 'PowerAdmin' in RHEL or CentOS 7.md diff --git a/published/20150504 Useful Commands to Create Commandline Chat Server and Remove Unwanted Packages in Linux.md b/published/201506/20150504 Useful Commands to Create Commandline Chat Server and Remove Unwanted Packages in Linux.md similarity index 100% rename from published/20150504 Useful Commands to Create Commandline Chat Server and Remove Unwanted Packages in Linux.md rename to published/201506/20150504 Useful Commands to Create Commandline Chat Server and Remove Unwanted Packages in Linux.md diff --git a/published/20150506 First Step Guide for Learning Shell Scripting.md b/published/201506/20150506 First Step Guide for Learning Shell Scripting.md similarity index 100% rename from published/20150506 First Step Guide for Learning Shell Scripting.md rename to published/201506/20150506 First Step Guide for Learning Shell Scripting.md diff --git a/published/20150506 How to Setup OpenERP (Odoo) on CentOS 7.x.md b/published/201506/20150506 How to Setup OpenERP (Odoo) on CentOS 7.x.md similarity index 100% rename from published/20150506 How to Setup OpenERP (Odoo) on CentOS 7.x.md rename to published/201506/20150506 How to Setup OpenERP (Odoo) on CentOS 7.x.md diff --git a/published/20150506 Linux FAQs with Answers--How to disable entering password for default keyring to unlock on Ubuntu desktop.md b/published/201506/20150506 Linux FAQs with Answers--How to disable entering password for default keyring to unlock on Ubuntu desktop.md similarity index 100% rename from published/20150506 Linux FAQs with Answers--How to disable entering password for default keyring to unlock on Ubuntu desktop.md rename to published/201506/20150506 Linux FAQs with Answers--How to disable entering password for default keyring to unlock on Ubuntu desktop.md diff --git a/published/20150506 Linux FAQs with Answers--How to install Shrew Soft IPsec VPN client on Linux.md b/published/201506/20150506 Linux FAQs with Answers--How to install Shrew Soft IPsec VPN client on Linux.md similarity index 100% rename from published/20150506 Linux FAQs with Answers--How to install Shrew Soft IPsec VPN client on Linux.md rename to published/201506/20150506 Linux FAQs with Answers--How to install Shrew Soft IPsec VPN client on Linux.md diff --git a/published/20150507 Install uGet Download Manager 2.0 in Debian Ubuntu Linux Mint and Fedora.md b/published/201506/20150507 Install uGet Download Manager 2.0 in Debian Ubuntu Linux Mint and Fedora.md similarity index 100% rename from published/20150507 Install uGet Download Manager 2.0 in Debian Ubuntu Linux Mint and Fedora.md rename to published/201506/20150507 Install uGet Download Manager 2.0 in Debian Ubuntu Linux Mint and Fedora.md diff --git a/published/20150511 Fix Various Update Errors In Ubuntu 14.04.md b/published/201506/20150511 Fix Various Update Errors In Ubuntu 14.04.md similarity index 100% rename from published/20150511 Fix Various Update Errors In Ubuntu 14.04.md rename to published/201506/20150511 Fix Various Update Errors In Ubuntu 14.04.md diff --git a/published/20150511 Open Source History--Why Did Linux Succeed.md b/published/201506/20150511 Open Source History--Why Did Linux Succeed.md similarity index 100% rename from published/20150511 Open Source History--Why Did Linux Succeed.md rename to published/201506/20150511 Open Source History--Why Did Linux Succeed.md diff --git a/published/20150512 45 Zypper Commands to Manage 'Suse' Linux Package Management.md b/published/201506/20150512 45 Zypper Commands to Manage 'Suse' Linux Package Management.md similarity index 100% rename from published/20150512 45 Zypper Commands to Manage 'Suse' Linux Package Management.md rename to published/201506/20150512 45 Zypper Commands to Manage 'Suse' Linux Package Management.md diff --git a/published/20150512 A Shell Script to Monitor Network, Disk Usage, Uptime, Load Average and RAM Usage in Linux.md b/published/201506/20150512 A Shell Script to Monitor Network, Disk Usage, Uptime, Load Average and RAM Usage in Linux.md similarity index 100% rename from published/20150512 A Shell Script to Monitor Network, Disk Usage, Uptime, Load Average and RAM Usage in Linux.md rename to published/201506/20150512 A Shell Script to Monitor Network, Disk Usage, Uptime, Load Average and RAM Usage in Linux.md diff --git a/published/20150512 How To Run Docker Client Inside Windows OS.md b/published/201506/20150512 How To Run Docker Client Inside Windows OS.md similarity index 100% rename from published/20150512 How To Run Docker Client Inside Windows OS.md rename to published/201506/20150512 How To Run Docker Client Inside Windows OS.md diff --git a/published/20150512 Linux FAQs with Answers--How to view torrent file content on Linux.md b/published/201506/20150512 Linux FAQs with Answers--How to view torrent file content on Linux.md similarity index 100% rename from published/20150512 Linux FAQs with Answers--How to view torrent file content on Linux.md rename to published/201506/20150512 Linux FAQs with Answers--How to view torrent file content on Linux.md diff --git a/published/20150515 Basic Networking Commands with Docker Containers.md b/published/201506/20150515 Basic Networking Commands with Docker Containers.md similarity index 100% rename from published/20150515 Basic Networking Commands with Docker Containers.md rename to published/201506/20150515 Basic Networking Commands with Docker Containers.md diff --git a/published/20150515 Extend Swap Space using Swap file in Linux.md b/published/201506/20150515 Extend Swap Space using Swap file in Linux.md similarity index 100% rename from published/20150515 Extend Swap Space using Swap file in Linux.md rename to published/201506/20150515 Extend Swap Space using Swap file in Linux.md diff --git a/published/20150515 How to Install Percona Server on CentOS 7.md b/published/201506/20150515 How to Install Percona Server on CentOS 7.md similarity index 100% rename from published/20150515 How to Install Percona Server on CentOS 7.md rename to published/201506/20150515 How to Install Percona Server on CentOS 7.md diff --git a/published/20150515 Install 'Tails 1.4′ Linux Operating System to Preserve Privacy and Anonymity.md b/published/201506/20150515 Install 'Tails 1.4′ Linux Operating System to Preserve Privacy and Anonymity.md similarity index 100% rename from published/20150515 Install 'Tails 1.4′ Linux Operating System to Preserve Privacy and Anonymity.md rename to published/201506/20150515 Install 'Tails 1.4′ Linux Operating System to Preserve Privacy and Anonymity.md diff --git a/published/20150515 This Ubuntu App Applies Instagram Style Filters to Your Photos.md b/published/201506/20150515 This Ubuntu App Applies Instagram Style Filters to Your Photos.md similarity index 100% rename from published/20150515 This Ubuntu App Applies Instagram Style Filters to Your Photos.md rename to published/201506/20150515 This Ubuntu App Applies Instagram Style Filters to Your Photos.md diff --git a/published/20150518 10 Amazing and Mysterious Uses of Symbol or Operator in Linux Commands.md b/published/201506/20150518 10 Amazing and Mysterious Uses of Symbol or Operator in Linux Commands.md similarity index 100% rename from published/20150518 10 Amazing and Mysterious Uses of Symbol or Operator in Linux Commands.md rename to published/201506/20150518 10 Amazing and Mysterious Uses of Symbol or Operator in Linux Commands.md diff --git a/published/20150518 70 Expected Shell Scripting Interview Questions and Answers.md b/published/201506/20150518 70 Expected Shell Scripting Interview Questions and Answers.md similarity index 100% rename from published/20150518 70 Expected Shell Scripting Interview Questions and Answers.md rename to published/201506/20150518 70 Expected Shell Scripting Interview Questions and Answers.md diff --git a/published/20150518 Linux FAQs with Answers--How to fix '404 Not Found' error with 'apt-get update' on old Ubuntu.md b/published/201506/20150518 Linux FAQs with Answers--How to fix '404 Not Found' error with 'apt-get update' on old Ubuntu.md similarity index 100% rename from published/20150518 Linux FAQs with Answers--How to fix '404 Not Found' error with 'apt-get update' on old Ubuntu.md rename to published/201506/20150518 Linux FAQs with Answers--How to fix '404 Not Found' error with 'apt-get update' on old Ubuntu.md diff --git a/published/20150518 Linux FAQs with Answers--How to fix 'Encountered a section with no Package--header' error on Raspbian.md b/published/201506/20150518 Linux FAQs with Answers--How to fix 'Encountered a section with no Package--header' error on Raspbian.md similarity index 100% rename from published/20150518 Linux FAQs with Answers--How to fix 'Encountered a section with no Package--header' error on Raspbian.md rename to published/201506/20150518 Linux FAQs with Answers--How to fix 'Encountered a section with no Package--header' error on Raspbian.md diff --git a/published/20150518 Linux FAQs with Answers--How to view threads of a process on Linux.md b/published/201506/20150518 Linux FAQs with Answers--How to view threads of a process on Linux.md similarity index 100% rename from published/20150518 Linux FAQs with Answers--How to view threads of a process on Linux.md rename to published/201506/20150518 Linux FAQs with Answers--How to view threads of a process on Linux.md diff --git a/published/20150518 Linux FAQs with Answers--What is the Apache error log location on Linux.md b/published/201506/20150518 Linux FAQs with Answers--What is the Apache error log location on Linux.md similarity index 100% rename from published/20150518 Linux FAQs with Answers--What is the Apache error log location on Linux.md rename to published/201506/20150518 Linux FAQs with Answers--What is the Apache error log location on Linux.md diff --git a/published/20150520 How to Use Docker Machine with a Cloud Provider.md b/published/201506/20150520 How to Use Docker Machine with a Cloud Provider.md similarity index 100% rename from published/20150520 How to Use Docker Machine with a Cloud Provider.md rename to published/201506/20150520 How to Use Docker Machine with a Cloud Provider.md diff --git a/published/20150520 How to Use tmpfs on RHEL or CentOS 7.0.md b/published/201506/20150520 How to Use tmpfs on RHEL or CentOS 7.0.md similarity index 100% rename from published/20150520 How to Use tmpfs on RHEL or CentOS 7.0.md rename to published/201506/20150520 How to Use tmpfs on RHEL or CentOS 7.0.md diff --git a/published/20150520 How to compile and install wxWidgets on Ubuntu or Debian or Linux Mint.md b/published/201506/20150520 How to compile and install wxWidgets on Ubuntu or Debian or Linux Mint.md similarity index 100% rename from published/20150520 How to compile and install wxWidgets on Ubuntu or Debian or Linux Mint.md rename to published/201506/20150520 How to compile and install wxWidgets on Ubuntu or Debian or Linux Mint.md diff --git a/published/20150520 Shell Script to Backup Files or Directories Using rsync.md b/published/201506/20150520 Shell Script to Backup Files or Directories Using rsync.md similarity index 100% rename from published/20150520 Shell Script to Backup Files or Directories Using rsync.md rename to published/201506/20150520 Shell Script to Backup Files or Directories Using rsync.md diff --git a/published/20150521 Linux FAQs with Answers--How to change system proxy settings from the command line on Ubuntu desktop.md b/published/201506/20150521 Linux FAQs with Answers--How to change system proxy settings from the command line on Ubuntu desktop.md similarity index 100% rename from published/20150521 Linux FAQs with Answers--How to change system proxy settings from the command line on Ubuntu desktop.md rename to published/201506/20150521 Linux FAQs with Answers--How to change system proxy settings from the command line on Ubuntu desktop.md diff --git a/published/20150521 Linux FAQs with Answers--How to install Unity Tweak Tool on Ubuntu desktop.md b/published/201506/20150521 Linux FAQs with Answers--How to install Unity Tweak Tool on Ubuntu desktop.md similarity index 100% rename from published/20150521 Linux FAQs with Answers--How to install Unity Tweak Tool on Ubuntu desktop.md rename to published/201506/20150521 Linux FAQs with Answers--How to install Unity Tweak Tool on Ubuntu desktop.md diff --git a/published/20150521 Will Ubuntu Linux Hit 200 Million Users This Year.md b/published/201506/20150521 Will Ubuntu Linux Hit 200 Million Users This Year.md similarity index 100% rename from published/20150521 Will Ubuntu Linux Hit 200 Million Users This Year.md rename to published/201506/20150521 Will Ubuntu Linux Hit 200 Million Users This Year.md diff --git a/published/20150525 Linux ntopng--Network Monitoring Tool Installation Screenshots.md b/published/201506/20150525 Linux ntopng--Network Monitoring Tool Installation Screenshots.md similarity index 100% rename from published/20150525 Linux ntopng--Network Monitoring Tool Installation Screenshots.md rename to published/201506/20150525 Linux ntopng--Network Monitoring Tool Installation Screenshots.md diff --git a/published/20150527 3 Open Source Python Shells.md b/published/201506/20150527 3 Open Source Python Shells.md similarity index 100% rename from published/20150527 3 Open Source Python Shells.md rename to published/201506/20150527 3 Open Source Python Shells.md diff --git a/published/20150527 3 Useful Hacks Every Linux User Must Know.md b/published/201506/20150527 3 Useful Hacks Every Linux User Must Know.md similarity index 100% rename from published/20150527 3 Useful Hacks Every Linux User Must Know.md rename to published/201506/20150527 3 Useful Hacks Every Linux User Must Know.md diff --git a/published/20150527 How To Check Laptop CPU Temperature In Ubuntu.md b/published/201506/20150527 How To Check Laptop CPU Temperature In Ubuntu.md similarity index 100% rename from published/20150527 How To Check Laptop CPU Temperature In Ubuntu.md rename to published/201506/20150527 How To Check Laptop CPU Temperature In Ubuntu.md diff --git a/published/20150527 How to Create Own Online Shopping Store Using 'OpenCart' in Linux.md b/published/201506/20150527 How to Create Own Online Shopping Store Using 'OpenCart' in Linux.md similarity index 100% rename from published/20150527 How to Create Own Online Shopping Store Using 'OpenCart' in Linux.md rename to published/201506/20150527 How to Create Own Online Shopping Store Using 'OpenCart' in Linux.md diff --git a/published/20150527 How to Kill Linux Processes or Unresponsive Applications Using 'xkill' Command.md b/published/201506/20150527 How to Kill Linux Processes or Unresponsive Applications Using 'xkill' Command.md similarity index 100% rename from published/20150527 How to Kill Linux Processes or Unresponsive Applications Using 'xkill' Command.md rename to published/201506/20150527 How to Kill Linux Processes or Unresponsive Applications Using 'xkill' Command.md diff --git a/published/20150527 Linux FAQs with Answers--How to mount an LVM partition on Linux.md b/published/201506/20150527 Linux FAQs with Answers--How to mount an LVM partition on Linux.md similarity index 100% rename from published/20150527 Linux FAQs with Answers--How to mount an LVM partition on Linux.md rename to published/201506/20150527 Linux FAQs with Answers--How to mount an LVM partition on Linux.md diff --git a/published/20150528 11 pointless but awesome Linux terminal tricks.md b/published/201506/20150528 11 pointless but awesome Linux terminal tricks.md similarity index 100% rename from published/20150528 11 pointless but awesome Linux terminal tricks.md rename to published/201506/20150528 11 pointless but awesome Linux terminal tricks.md diff --git a/published/20150528 27 'DNF' Fork of Yum Commands for RPM Package Management in Linux.md b/published/201506/20150528 27 'DNF' Fork of Yum Commands for RPM Package Management in Linux.md similarity index 100% rename from published/20150528 27 'DNF' Fork of Yum Commands for RPM Package Management in Linux.md rename to published/201506/20150528 27 'DNF' Fork of Yum Commands for RPM Package Management in Linux.md diff --git a/published/20150528 Things To Do After Installing Fedora 22.md b/published/201506/20150528 Things To Do After Installing Fedora 22.md similarity index 100% rename from published/20150528 Things To Do After Installing Fedora 22.md rename to published/201506/20150528 Things To Do After Installing Fedora 22.md diff --git a/published/20150603 Arc Is a Gorgeous GTK Theme for Linux Desktops.md b/published/201506/20150603 Arc Is a Gorgeous GTK Theme for Linux Desktops.md similarity index 100% rename from published/20150603 Arc Is a Gorgeous GTK Theme for Linux Desktops.md rename to published/201506/20150603 Arc Is a Gorgeous GTK Theme for Linux Desktops.md diff --git a/published/20150603 Here's How to Install the Beautiful Arc GTK+ Flat Theme on Linux.md b/published/201506/20150603 Here's How to Install the Beautiful Arc GTK+ Flat Theme on Linux.md similarity index 100% rename from published/20150603 Here's How to Install the Beautiful Arc GTK+ Flat Theme on Linux.md rename to published/201506/20150603 Here's How to Install the Beautiful Arc GTK+ Flat Theme on Linux.md diff --git a/published/20150604 12 Globally Recognized Linux Certifications.md b/published/201506/20150604 12 Globally Recognized Linux Certifications.md similarity index 100% rename from published/20150604 12 Globally Recognized Linux Certifications.md rename to published/201506/20150604 12 Globally Recognized Linux Certifications.md diff --git a/published/20150604 Read about The Document Foundation achievements in 2014--download the Annual Report.md b/published/201506/20150604 Read about The Document Foundation achievements in 2014--download the Annual Report.md similarity index 100% rename from published/20150604 Read about The Document Foundation achievements in 2014--download the Annual Report.md rename to published/201506/20150604 Read about The Document Foundation achievements in 2014--download the Annual Report.md diff --git a/published/20150604 Ubuntu's Juju Now Supports systemd and Google Cloud Platform.md b/published/201506/20150604 Ubuntu's Juju Now Supports systemd and Google Cloud Platform.md similarity index 100% rename from published/20150604 Ubuntu's Juju Now Supports systemd and Google Cloud Platform.md rename to published/201506/20150604 Ubuntu's Juju Now Supports systemd and Google Cloud Platform.md diff --git a/published/20150610 How to Clear RAM Memory Cache Buffer and Swap Space on Linux.md b/published/201506/20150610 How to Clear RAM Memory Cache Buffer and Swap Space on Linux.md similarity index 100% rename from published/20150610 How to Clear RAM Memory Cache Buffer and Swap Space on Linux.md rename to published/201506/20150610 How to Clear RAM Memory Cache Buffer and Swap Space on Linux.md diff --git a/published/20150610 How to Install nginx and google pagespeed on Ubuntu 15.04 Vivid Vervet.md b/published/201506/20150610 How to Install nginx and google pagespeed on Ubuntu 15.04 Vivid Vervet.md similarity index 100% rename from published/20150610 How to Install nginx and google pagespeed on Ubuntu 15.04 Vivid Vervet.md rename to published/201506/20150610 How to Install nginx and google pagespeed on Ubuntu 15.04 Vivid Vervet.md diff --git a/published/20150610 Install Android Studio on Ubuntu 15.04.md b/published/201506/20150610 Install Android Studio on Ubuntu 15.04.md similarity index 100% rename from published/20150610 Install Android Studio on Ubuntu 15.04.md rename to published/201506/20150610 Install Android Studio on Ubuntu 15.04.md diff --git a/published/20150612 Inside NGINX--How We Designed for Performance and Scale.md b/published/201506/20150612 Inside NGINX--How We Designed for Performance and Scale.md similarity index 100% rename from published/20150612 Inside NGINX--How We Designed for Performance and Scale.md rename to published/201506/20150612 Inside NGINX--How We Designed for Performance and Scale.md diff --git a/published/20150615 PHP at 20--From pet project to powerhouse.md b/published/201506/20150615 PHP at 20--From pet project to powerhouse.md similarity index 100% rename from published/20150615 PHP at 20--From pet project to powerhouse.md rename to published/201506/20150615 PHP at 20--From pet project to powerhouse.md diff --git a/published/20150617 The Art of Command Line.md b/published/201506/20150617 The Art of Command Line.md similarity index 100% rename from published/20150617 The Art of Command Line.md rename to published/201506/20150617 The Art of Command Line.md diff --git a/published/20150623 Linux Kernel 4.1 Released This Is What's New.md b/published/201506/20150623 Linux Kernel 4.1 Released This Is What's New.md similarity index 100% rename from published/20150623 Linux Kernel 4.1 Released This Is What's New.md rename to published/201506/20150623 Linux Kernel 4.1 Released This Is What's New.md diff --git a/published/20150626 15 Useful MySQL or MariaDB Performance Tuning and Optimization Tips.md b/published/201506/20150626 15 Useful MySQL or MariaDB Performance Tuning and Optimization Tips.md similarity index 100% rename from published/20150626 15 Useful MySQL or MariaDB Performance Tuning and Optimization Tips.md rename to published/201506/20150626 15 Useful MySQL or MariaDB Performance Tuning and Optimization Tips.md From 5ed2c19e52d0c8222fcf59f89dc2de0bf9584ce1 Mon Sep 17 00:00:00 2001 From: wxy Date: Wed, 1 Jul 2015 13:09:32 +0800 Subject: [PATCH 513/965] PUB:20150127 25 Useful Apache '.htaccess' Tricks to Secure and Customize Websites @ictlyh --- ...Tricks to Secure and Customize Websites.md | 145 +++++++++--------- 1 file changed, 73 insertions(+), 72 deletions(-) rename {translated/tech => published}/20150127 25 Useful Apache '.htaccess' Tricks to Secure and Customize Websites.md (62%) diff --git a/translated/tech/20150127 25 Useful Apache '.htaccess' Tricks to Secure and Customize Websites.md b/published/20150127 25 Useful Apache '.htaccess' Tricks to Secure and Customize Websites.md similarity index 62% rename from translated/tech/20150127 25 Useful Apache '.htaccess' Tricks to Secure and Customize Websites.md rename to published/20150127 25 Useful Apache '.htaccess' Tricks to Secure and Customize Websites.md index 723ce313b2..7f3747721f 100644 --- a/translated/tech/20150127 25 Useful Apache '.htaccess' Tricks to Secure and Customize Websites.md +++ b/published/20150127 25 Useful Apache '.htaccess' Tricks to Secure and Customize Websites.md @@ -1,43 +1,44 @@ -用于提高网站安全性和自定义网站的 25 个有用 Apache ‘.htaccess’ 小技巧 +25 个有用 Apache ‘.htaccess’ 技巧 ================================================================================ -网站是我们生活中重要的一部分。它们是实现扩大业务、分享知识以及其它更多功能的方式。之前受制于只能提供静态内容,随着动态客户端和服务器端脚本语言的引入和现有静态语言的持续改进,例如从 html 到 html5,动态网站成为可能,剩下的也许在不久的将来也会实现。 +网站是我们生活中重要的一部分。它们是实现扩大业务、分享知识以及其它更多功能的方式。早期受制于只能提供静态内容,随着动态客户端和服务器端脚本语言的引入和现有静态语言的持续改进,例如从 html 到 html5,动态网站成为可能,剩下的也许在不久的将来也会实现。 -有了网站,随之而来的是对能向全球大规模用户显示站点的单元的需求。这个需求通过托管网站的服务器实现。这包括一系列的服务器,例如:Apache HTTP Server、Joomla 以及 允许个人拥有自己网站的 WordPress。 +对于网站,随之而来的是需要一个能向全球大规模用户显示站点的某个东西。这个需求可以通过托管网站的服务器实现。这包括一系列的服务器,例如:Apache HTTP Server、Joomla 以及 允许个人拥有自己网站的 WordPress。 ![Apache htaccess 小技巧](http://www.tecmint.com/wp-content/uploads/2015/01/htaccess-tricks.jpg) -25 个 htaccess 小技巧 + +*25 个 htaccess 小技巧* 想要拥有一个网站,可以创建一个自己的本地服务器,或者联系任何上面提到的或其它服务器管理员来托管他的网站。但实际问题也从这点开始。网站的性能主要取决于以下因素: - 网站消耗的带宽。 -- 针对黑客网站有多安全。 +- 面对黑客,网站有多安全。 - 对数据库进行数据检索时的优化。 - 显示导航菜单和提供更多 UI 功能时的用户友好性。 除此之外,保证托管网站服务器成功的多种因素还包括: - 对于一个流行站点的数据压缩量。 -- 同时为多个请求同一或不同站点的用户服务的能力。 +- 同时为多个对请求同一或不同站点的用户服务的能力。 - 保证网站上输入的机密数据安全,例如:Email、信用卡信息等等。 - 允许更多的选项用于增强站点的动态性。 -这篇文章讨论一个服务器提供的用于增强网站性能和提高针对坏机器人、热链接等的安全性的功能。例如 ‘.htaccess’ 文件。 +这篇文章讨论一个服务器提供的用于增强网站性能和提高针对坏机器人、热链等的安全性的功能:‘.htaccess’ 文件。 ### .htaccess 是什么? ### htaccess (hypertext access,超文本访问) 是为网站所有者提供用于控制服务器环境变量以及其它参数的选项,从而增强他们网站的功能的文件。这些文件可以在网站目录树的任何一个目录中,并向该目录以及目录中的文件和子目录提供功能。 -这些功能是什么呢?其实这些是服务器的指令,例如命令服务器执行特定任务的行,这些命令只对该文件所在目录中的文件和子目录有效。这些文件默认是隐藏的,因为所有操作系统和网站服务器默认配置为忽略。但让隐藏文件可见可以让你看到这些特殊文件。后续章节的话题将讨论能控制什么类型的参数。 +这些功能是什么呢?其实这些是服务器的指令,例如命令服务器执行特定任务的行,这些命令只对该文件所在目录中的文件和子目录有效。这些文件默认是隐藏的,因为所有操作系统和网站服务器默认配置为忽略它们,但如果查看隐藏文件的话,你就可以看到这些特殊文件。后续章节的话题将讨论能控制什么类型的参数。 -注意:如果 .htaccess 文件保存在 /apache/home/www/Gunjit/ 目录,那么它会向该目录中的所有文件和子目录提供命令,但如果该目录包含一个名为 /Gunjit/images/ 子目录,且该子目录中也有一个 .htaccess 文件,那么这个子目录中的命令会覆盖父目录中 .htaccess 文件(或者层次结构中更上层文件)提供的命令。 +注意:如果 .htaccess 文件保存在 /apache/home/www/Gunjit/ 目录,那么它会向该目录中的所有文件和子目录提供命令,但如果该目录包含一个名为 /Gunjit/images/ 子目录,且该子目录中也有一个 .htaccess 文件,那么这个子目录中的命令会覆盖父目录中 .htaccess 文件(或者目录层次结构中更上层的文件)提供的命令。 ### Apache Server 和 .htaccess 文件 ### -Apache HTTP Server 俗称为 Apache,是为了表示对一个有卓越战争策略技能的美洲土著部落的尊敬而命名。它是用 C/C++ 和 XML 建立的基于 [NCSA HTTPd 服务器][1] 的跨平台 Web 服务器,它在万维网的成长和发展中起到了关键作用。 +Apache HTTP Server 俗称为 Apache,是为了表示对一个有卓越战争策略技能的美洲土著部落的尊敬而命名。它基于 [NCSA HTTPd 服务器][1] ,是用 C/C++ 和 XML 建立的跨平台 Web 服务器,它在万维网的成长和发展中起到了关键作用。 -最常用于 UNIX,Apache 也能用于多种平台,包括 FreeBSD、Linux、Windows、Mac OS、Novel Netware 等。在 2009 年,Apache 成为第一个为超过一亿站点提供服务的服务器。 +它最常用于 UNIX,但 Apache 也能用于多种平台,包括 FreeBSD、Linux、Windows、Mac OS、Novel Netware 等。在 2009 年,Apache 成为第一个为超过一亿站点提供服务的服务器。 -Apache 服务器对于 www/ 目录中的每个用户有一个单独的 .htaccess 文件。尽管这些文件是隐藏的,但如果需要的话可以使它们可见。在 www/ 目录中有很多子目录,每个子目录通过用户名或所有者名称命名,包含了一个站点。除此之外你可以在每个子目录中有一个 .htaccess 文件,像之前所述用于配置子目录中的文件。 +Apache 服务器可以让 www/ 目录中的每个用户有一个单独的 .htaccess 文件。尽管这些文件是隐藏的,但如果需要的话可以使它们可见。在 www/ 目录中可以有很多子目录,每个子目录通过用户名或所有者名称命名,包含了一个站点。除此之外你可以在每个子目录中有一个 .htaccess 文件,像之前所述用于配置子目录中的文件。 下面介绍如果配置 Apache 服务器上的 htaccess 文件。 @@ -65,19 +66,19 @@ Apache 服务器对于 www/ 目录中的每个用户有一个单独的 .htaccess 在这种情况下最好咨询托管管理员,如果他们允许访问 .htaccess 文件的话。 -### 用于站点的 25 个 Apache Web 服务器 ‘.htaccess’ 小技巧 ### +### 用于网站的 25 个 Apache Web 服务器 ‘.htaccess’ 小技巧 ### #### 1. 如何在 .htaccess 文件中启用 mod_rewrite #### -mod_rewrite 选项允许你使用重定向并通过重定向到其它 URL 隐藏你真实的 URL。这个选项非常有用,允许你用短的容易记忆的 URL 替换长 URL。 +mod_rewrite 选项允许你使用重定向并通过重定向到其它 URL 来隐藏你真实的 URL。这个选项非常有用,允许你用短的容易记忆的 URL 替换长 URL。 要允许 mod_rewrite,只需要在你的 .htaccess 文件的第一行添加如下一行。 Options +FollowSymLinks -该选项允许你跟踪符号链接从而在站点中启用 mod_rewrite。后面会介绍用短 URL 替换。 +该选项允许你跟踪符号链接从而在站点中启用 mod_rewrite。后面会介绍用短 URL 替换。(LCTT 译注:+FollowSymLinks 只是启用 mod_rewrite 的前提之一,还需要在全局和虚拟机中设置 `RewriteEngine on` 才能启用重写模块。) -#### 2. 如果允许或禁止对站点的访问 #### +#### 2. 如何允许或禁止对站点的访问 #### 通过使用 order、allow 和 deny 关键字,htaccess 文件可以允许或者禁止对站点或目录中子目录或文件的访问。 @@ -109,13 +110,13 @@ mod_rewrite 选项允许你使用重定向并通过重定向到其它 URL 隐藏 #### 3. 为不同错误码生成 Apache 错误文档 #### -用一些简单行,我们可以解决当用户/客户端请求一个站点上不可用的网页时服务器产生的错误码的错误文档,例如我们大部分人见过的浏览器中显示的 ‘404 Page not found’。‘.htaccess’ 文件指定了发生这些错误情况时采取何种操作。 +用简单几行,我们可以解决当用户/客户端请求一个站点上不可用的网页时服务器产生的错误码的错误文档,例如我们大部分人见过的浏览器中显示的 ‘404 Page not found’。‘.htaccess’ 文件指定了发生这些错误情况时采取何种操作。 要做到这点,需要添加下面的行到 ‘.htaccess’ 文件: ErrorDocument -‘ErrorDocument’ 是一个关键字,error-code 可以是 401、403、404、500 或任何有效的表示错误的代码,最后 ‘path-of-document’ 表示本地机器上的路径(如果你使用的是你自己的本地服务器) 或 服务器上的路径(如果你使用任何其它服务器来托管网站)。 +‘ErrorDocument’ 是一个关键字,error-code 可以是 401、403、404、500 或任何有效的表示错误的代码,最后 ‘path-of-document’ 表示本地机器上的路径(如果你使用的是你自己的本地服务器) 或服务器上的路径(如果你使用任何其它服务器来托管网站)。 **例子:** @@ -123,13 +124,13 @@ mod_rewrite 选项允许你使用重定向并通过重定向到其它 URL 隐藏 上面一行设置客户请求任何无效页面,服务器报告 404 错误时显示 error-docs 目录下的 ‘error-404.html’ 文档。 -ErrorDocument 404 "404 Page not found

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

" + ErrorDocument 404 "404 Page not found

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

" -上面的表示也正确,其中字符串表示一个普通的 html 文件。 +上面的表示也正确,其中字符串相当于一个普通的 html 文件。 #### 4. 设置/取消 Apache 服务器环境变量 #### -在 .htaccess 文件中你可以设置或者取消站点所有者用来更改服务器设置的全局环境变量。要设置或取消环境变量,你需要在你的 .htaccess 文件中添加下面的行。 +在 .htaccess 文件中你可以设置或者取消站点所有者可以更改的全局环境变量。要设置或取消环境变量,你需要在你的 .htaccess 文件中添加下面的行。 **设置环境变量** @@ -141,29 +142,29 @@ ErrorDocument 404 "404 Page not found

#### 5. 为文件定义不同 MIME 类型 #### -MIME(Multipurpose Internet Multimedia Extensions,,多用途 Internet 多媒体扩展) 是浏览器运行任何页面默认能识别的类型。你可以在 .htaccess 文件中为你的站点定义 MIME 类型,然后服务器就可以识别你定义的类型的文件并运行。 +MIME(多用途 Internet 多媒体扩展)是浏览器运行任何页面所默认识别的类型。你可以在 .htaccess 文件中为你的站点定义 MIME 类型,然后服务器就可以识别你定义类型的文件并运行。 AddType application/javascript js AddType application/x-font-ttf ttf ttc -这里,mod_mime.c 是用于控制定义不同 MIME 类型的模块,如果在你的系统中已经安装了这个模块,那么你就可以用该模块去为你站点中不同的扩展定义不同的 MIME 类型,从而服务器可以理解这些文件。 +这里,mod_mime.c 是用于控制定义不同 MIME 类型的模块,如果在你的系统中已经安装了这个模块,那么你就可以用该模块去为你站点中不同的扩展名定义不同的 MIME 类型,从而让服务器可以理解这些文件。 #### 6. 如何在 Apache 中限制上传和下载的大小 #### -.htaccess 文件允许你拥有控制一个特定用户从你的站点上传或下载数据量大小的功能。要做到这点你只需要添加下面的行到你的 .htaccess 文件: +.htaccess 文件允许你能够控制某个用户从你的站点(通过 PHP)单次上传数据量的大小(LCTT 译注:原文有误,修改)。要做到这点你只需要添加下面的行到你的 .htaccess 文件: php_value upload_max_filesize 20M php_value post_max_size 20M php_value max_execution_time 200 php_value max_input_time 200 -上面的行设置最大上传大小、最大推送数据大小、最大执行时间,例如允许用户在本地机器运行站点的最大时间、限制的最大输入时间。 +上面的行设置最大上传大小、最大POST 提交数据大小、最长执行时间(例如,允许用户在他的本地机器上单次执行一个请求的最大时间)、限制的最大输入时间。 -#### 7. 让用户在站点上播放 .mp3 和其它文件之前预先下载 #### +#### 7. 让用户不能在你的站点上在线播放 .mp3 和其它文件 #### -大部分情况下,人们在下载检查音乐质量之前会在网站上播放等等。作为一个聪明的销售者,你可以添加一个简单的功能,不允许任何用户在线播放音乐或视频,而是必须下载后才能播放。这非常有用,因为在线播放音乐和视频会消耗很多带宽。 +大部分情况下,人们在下载检查音乐质量之前会在网站上播放等等。作为一个聪明的销售者,你可以添加一个简单的功能,不允许任何用户在线播放音乐或视频,而是必须下载完成后才能播放。这非常有用,因为(无缓冲的)在线播放音乐和视频会消耗很多带宽。 要添加下面的行到你的 .htaccess 文件: @@ -171,23 +172,23 @@ MIME(Multipurpose Internet Multimedia Extensions,,多用途 Internet 多媒体 #### 8. 为站点设置目录索引 #### -大部分网站开发者都知道第一个显示的页面,例如一个站点的主页面,被命名为 ‘index.html’。我们大部分也见过这个。但是如何设置呢? +大部分网站开发者都知道第一个显示的页面是哪个,例如一个站点的首页,被命名为 ‘index.html’。我们大部分也见过这个。但是如何设置呢? -.htaccess 文件提供了一种方式用于列出一个客户端请求访问网站的主页面时会顺序扫描的一些网页集,相应地如果找到了列出的页面中的任何一个就会作为站点的主页面并显示给用户。 +.htaccess 文件提供了一种方式用于列出一个客户端请求访问网站的主页面时会顺序扫描的一些网页集合,相应地如果找到了列出的页面中的任何一个就会作为站点的主页面并显示给用户。 需要添加下面的行产生所需的效果。 DirectoryIndex index.html index.php yourpage.php -上面一行指定如果有任何访问主页面的请求到来,首先会在目录中顺序搜索上面列出的网页:如果发现了 index.html 则显示为主页面,否则会处理下一个页面,例如 index.php,如此直到你在列表中输入的最后一个页面。 +上面一行指定如果有任何访问首页的请求到来,首先会在目录中顺序搜索上面列出的网页:如果发现了 index.html 则显示为主页面,否则会找下一个页面,例如 index.php,如此直到你在列表中输入的最后一个页面。 #### 9. 如何为文件启用 GZip 压缩以节省网站带宽 #### -繁重站点通常比只占少量空间的轻量级站点运行更慢是常见的现象。这是因为对于繁重站点需要时间加载大量的脚本文件和图片用于在客户端的 Web 浏览器上显示。 +繁忙的站点通常比只占少量空间的轻量级站点运行更慢,这是常见的现象。因为对于繁忙的站点需要时间加载巨大的脚本文件和图片以在客户端的 Web 浏览器上显示。 -当浏览器请求一个 web 页面时,服务器提供给浏览器该页面并局部显示该 web 页面,浏览器需要下载该页面然后在页面内部运行脚本,这是一种常见机制。 +通常的机制是这样的,当浏览器请求一个 web 页面时,服务器提供给浏览器该页面,并在浏览器端显示该 web 页面,浏览器需要下载该页面并运行页面内的脚本。 -这里 GZip 压缩所做的就是节省单个用户的服务时间从而提高带宽。服务器上站点的源文件以压缩形式保存,当用户请求到来的时候,这些文件以压缩形式传送,然后在服务器上解压并执行。这改进了带宽限制。 +这里 GZip 压缩所做的就是节省单个用户的服务时间而不用增加带宽。服务器上站点的源文件以压缩形式保存,当用户请求到来的时候,这些文件以压缩形式传送,然后在客户端上解压(LCTT 译注:原文此处有误)。这改善了带宽限制。 下面的行允许你压缩站点的源文件,但要求在你的服务器上安装 mod_deflate.c 模块。 @@ -202,7 +203,7 @@ MIME(Multipurpose Internet Multimedia Extensions,,多用途 Internet 多媒体 #### 10. 处理文件类型 #### -服务器默认的有一些特定情况。例如:在服务器上运行 .php 文件,显示 .txt 文件。像这些我们可以以源代码形式只显示一些可执行 cgi 脚本或文件而不是执行它们。 +服务器默认的有一些特定情况。例如:在服务器上运行 .php 文件,显示 .txt 文件。像这些我们可以以源代码形式只显示一些可执行 cgi 脚本或文件而不是执行它们(LCTT 译注:这是为了避免攻击者通过上传恶意脚本,进而在服务器上执行恶意脚本进行破坏和窃取)。 要做到这点在 .htaccess 文件中有如下行。 @@ -213,7 +214,7 @@ MIME(Multipurpose Internet Multimedia Extensions,,多用途 Internet 多媒体 #### 11. 为 Apache 服务器设置时区 #### -.htaccess 文件可用于为服务器设置时区可以看出它的能力和重要性。这可以通过设置一个服务器为每个托管站点提供的一系列全局环境变量中的 ‘TZ’ 完成。 +从 .htaccess 文件可用于为服务器设置时区可以看出它的能力和重要性。这可以通过设置一个服务器为每个托管站点提供的一系列全局环境变量中的 ‘TZ’ 完成。 由于这个原因,我们可以在网站上看到根据我们的时区显示的时间。也许服务器上其他拥有网站的人会根据他居住地点的位置设置时区。 @@ -223,9 +224,9 @@ MIME(Multipurpose Internet Multimedia Extensions,,多用途 Internet 多媒体 #### 12. 如果在站点上启用缓存控制 #### -浏览器很有趣的一个功能是,已经观察到多次同时打开一个网站,和第一次打开相比之后会更快。但为什么会这样呢?事实上,浏览器在它的缓存中保存了一些通常访问的页面用于加快后面的访问。 +浏览器很有趣的一个功能是,很多时间你可以看到,当多次同时打开一个网站和第一次打开相比前者会更快。但为什么会这样呢?事实上,浏览器在它的缓存中保存了一些通常访问的页面用于加快后面的访问。 -但保存多长时间呢?这取决于你自己。例如,你的 .htaccess 文件中设置的缓存控制时间。.htaccess 文件指定了站点的网页可以在浏览器缓存中保存的时间,时间到期后需要重新验证,例如页面会从缓存中删除然后在下次用户访问站点的时候重建。 +但保存多长时间呢?这取决于你自己。例如,你的 .htaccess 文件中设置的缓存控制时间。.htaccess 文件指定了站点的网页可以在浏览器缓存中保存的时间,时间到期后需要重新验证缓存,页面可能会从缓存中删除然后在下次用户访问站点的时候重建。 下面的行为你的站点实现缓存控制。 @@ -243,7 +244,7 @@ MIME(Multipurpose Internet Multimedia Extensions,,多用途 Internet 多媒体 通常 .htaccess 文件中的内容会对该文件所在目录中的所有文件和子目录起作用,但是你也可以对特殊文件设置一些特殊权限,例如只禁止对某个文件的访问等等。 -要做到这点,你需要在文件中以类似方式添加 标记: +要做到这点,你需要在文件中以类似方式添加 \ 标记: Order allow, deny @@ -256,26 +257,26 @@ MIME(Multipurpose Internet Multimedia Extensions,,多用途 Internet 多媒体 #### 14. 启用在 cgi-bin 目录以外运行 CGI 脚本 #### -通常服务器运行的 CGI 脚本都保存在 cgi-bin 目录中,但是你可以启用在你需要的目录运行 CGI 脚本,只需要在所需的目录中添加下面的行到 .htaccess 文件,如果没有改文件就创建一个,并添加下面的行: +通常服务器运行的 CGI 脚本都保存在 cgi-bin 目录中,但是你可以在你需要的目录运行 CGI 脚本,只需要在所需的目录中的 .htaccess 文件添加下面的行,如果没有该文件就创建一个,并添加下面的行: AddHandler cgi-script .cgi Options +ExecCGI #### 15.如何用 .htaccess 在站点上启用 SSI #### -服务器端包括顾名思义的和服务器部分相关的东西。但是什么呢?通常当我们在站点上有很多页面的时候,我们在主页面上会有一个显示到其它页面链接的导航菜单,我们可以启用 SSI(Server Size Includes) 选项允许导航菜单中显示的所有页面完全包含在主页面中。 +服务器端包括(SSI)顾名思义是和服务器部分相关的东西。这是什么呢?通常当我们在站点上有很多页面的时候,我们在主页上会有一个显示到其它页面链接的导航菜单,我们可以启用 SSI 选项允许导航菜单中显示的所有页面完全包含在主页面中。 -SSI 允许包含多个页面,好像他们包含的内容就是一个单一页面的一部分,因此任何需要的编辑都只有一个文件,从而可以节省很多磁盘空间。除了 .shtml 文件,服务器默认启用了该选项。 +SSI 允许多个页面包含同样的内容,因此只需要编辑一个文件就行,从而可以节省很多磁盘空间。对于 .shtml 文件,服务器默认启用了该选项。 如果你想要对 .html 启用该选项,你需要添加下面的行: AddHandler server-parsed .html -这之后 html 文件会导向 SSI。 +这样 html 文件中如下部分会被替换为 SSI。 - + -#### 16. 如何防止网站目录列表 #### +#### 16. 如何防止网站列出目录列表 #### 为防止任何客户端在本地机器罗列服务器上的网站目录列表,添加下面的行到你不想列出的目录的文件中。 @@ -290,16 +291,28 @@ SSI 允许包含多个页面,好像他们包含的内容就是一个单一页 AddDefaultCharset UTF-8 DefaultLanguage en-US +#### 18. 重定向一个非 www URL 到 www URL #### + +在开始解释之前,首先看看如何启用该功能,添加下列行到 .htaccess 文件。 + + RewriteEngine ON + RewriteCond %{HTTP_HOST} ^abc\.net$ + RewriteRule (.*) http://www.abc.net/$1 [R=301,L] + +上面的行启用重写引擎,然后在第二行检查所有涉及到主机 abc.net 或 环境变量 HTTP_HOST 为 “abc.net” 的 URL。 + +对于所有这样的 URL,代码永久重定向它们(如果启用了 R=301 规则)到新 URL http://www.abc.net/$1,其中 $1 是主机为 abc.net 的非 www URL。非 www URL 是大括号内的内容,并通过 $1 引用。 + **重写 URL 的重定向规则** -重写功能仅意味着用短而易记的 URL 替换长而难以记忆的 URL。但是,在开始这个话题之前,这里有一些本文后面会使用的特殊字符的规则和约定。 +重写功能简单的说,就是用短而易记的 URL 替换长而难以记忆的 URL。但是,在开始这个话题之前,这里有一些本文后面会使用的特殊字符的规则和约定。 **特殊符号:** 符号 含义 ^ - 字符串开头 $ - 字符串结尾 - | - 或 [a|b] – a 或 b + | - 或 [a|b] : a 或 b [a-z] - a 到 z 的任意字母 + - 之前字母的一次或多次出现 * - 之前字母的零次或多次出现 @@ -309,30 +322,19 @@ SSI 允许包含多个页面,好像他们包含的内容就是一个单一页 常量 含义 NC - 区分大小写 - L - 最后的规则 – 停止处理更多规则 + L - 最后的规则 – 停止处理后面规则 R - 临时重定向到新 URL R=301 - 永久重定向到新 URL F - 禁止发送 403 头给用户 - P - 代理 – 获取远程内容代替部分并返回 - G - Gone, 不再存在 + P - 代理 - 获取远程内容代替部分并返回 + G - Gone, 不再存在 S=x - 跳过后面的 x 条规则 T=mime-type - 强制指定 MIME 类型 E=var:value - 设置环境变量 var 的值为 value H=handler - 设置处理器 - PT - Pass through – 如果 URL 有额外的头 - QSA - 从到替换 URL 的请求追加查询字符串 + PT - Pass through - 用于 URL 还有额外的头 + QSA - 将查询字符串追加到替换 URL -#### 18. 重定向一个非 www URL 到 www URL #### - -在开始解释之前,首先看看启用该功能需要添加到 .htaccess 文件的行。 - - RewriteEngine ON - RewriteCond %{HTTP_HOST} ^abc\.net$ - RewriteRule (.*) http://www.abc.net/$1 [R=301,L] - -上面的行启用 Rewrite Engine 然后在第二行检查所有涉及到主机 abc.net 或 环境变量 HTTP_HOST 为 “abc.net” 的 URL。 - -对于所有这样的 URL,代码永久重定向它们(如果启用了 R=301 规则)到新 URL http://www.abc.net/$1,其中 $1 是主机为 abc.net 的非 www URL。非 www URL 是大括号内的内容,并通过 $1 引用。 #### 19. 重定向整个站点到 https #### @@ -342,7 +344,7 @@ SSI 允许包含多个页面,好像他们包含的内容就是一个单一页 RewriteCond %{HTTPS} !on RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} -上面的行启用 re-write engine 然后检查环境变量 HTTPS 的值。如果设置了那么重写所有网站页面到 https。 +上面的行启用重写引擎,然后检查环境变量 HTTPS 的值。如果设置了那么重写所有网站页面到 https。 #### 20.一个自定义重写例子 #### @@ -359,11 +361,11 @@ SSI 允许包含多个页面,好像他们包含的内容就是一个单一页 AccessFileName htac.cess -#### 22. 如何为你的网站禁用图片链接 #### +#### 22. 如何为你的网站禁用图片盗链 #### -网站大的带宽消耗的另外一个重要问题是热链接问题,这是其它站点用于显示你网站的图片而链接到你的网站的链接,这会消耗你的带宽。这问题也被成为 ‘带宽盗窃’。 +网站带宽消耗比较大的另外一个重要问题是盗链问题,这是其它站点用于显示你网站的图片而链接到你的网站的链接,这会消耗你的带宽。这问题也被成为 ‘带宽盗窃’。 -一个常见现象是当一个网站要显示其它网站所包含的图片时,由于该链接你的网站需要被加载,消耗你站点的带宽而显示其它站点的图片。为了防止出现这种情况,例如 .gif、.jpeg 图片等,下面的代码行会有所帮助: +一个常见现象是当一个网站要显示其它网站所包含的图片时,由于该链接需要从你的网站加载内容,消耗你站点的带宽而为其它站点显示图片。为了防止出现这种情况,比如对于 .gif、.jpeg 图片等,下面的代码行会有所帮助: RewriteEngine ON RewriteCond %{HTTP_REFERER} !^$ @@ -374,20 +376,19 @@ SSI 允许包含多个页面,好像他们包含的内容就是一个单一页 #### 23. 如何将用户重定向到维护页面 #### -如果你的网站需要进行维护并且你想向所有需要访问该网站的你的所有客户通知这个消息,对于这种情况,你可以添加下面的行到你的 .htaccess 文件,从而只允许管理员访问并替换所有有 .jpg、.css、.gif、.js 等的页面。 +如果你的网站需要进行维护并且你想向所有需要访问该网站的你的所有客户通知这个消息,对于这种情况,你可以添加下面的行到你的 .htaccess 文件,从而只允许管理员访问并替换所有访问 .jpg、.css、.gif、.js 等的页面内容。 RewriteCond %{REQUEST_URI} !^/admin/ [NC] RewriteCond %{REQUEST_URI} !^((.*).css|(.*).js|(.*).png|(.*).jpg) [NC] - RewriteRule ^(.*)$ /ErrorDocs/Maintainence_Page.html - [NC,L,U,QSA] + RewriteRule ^(.*)$ /ErrorDocs/Maintainence_Page.html [NC,L,U,QSA] 这些行检查请求 URL 是否包含任何例如以 ‘/admin/’ 开头的管理页面的请求,或任何到 ‘.png, .jpg, .js, .css’ 页面的请求,对于任何这样的请求,用 ‘ErrorDocs/Maintainence_Page.html’ 替换那个页面。 #### 24. 映射 IP 地址到域名 #### -名称服务器是将特定 IP 地址转换为域名的服务器。该映射也可以在 .htaccess 文件中用以下形式指定。 +名称服务器是将特定 IP 地址转换为域名的服务器。这种映射也可以在 .htaccess 文件中用以下形式指定。 - 为了将地址 L.M.N.O 映射到域名 www.hellovisit.com + # 为了将IP地址 L.M.N.O 映射到域名 www.hellovisit.com RewriteCond %{HTTP_HOST} ^L\.M\.N\.O$ [NC] RewriteRule ^(.*)$ http://www.hellovisit.com/$1 [L,R=301] @@ -414,7 +415,7 @@ via: http://www.tecmint.com/apache-htaccess-tricks/ 作者:[Gunjit Khera][a] 译者:[ictlyh](https://github.com/ictlyh) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 From fb966729fb2dbf81bd961bc02e680c4e3bd47fbc Mon Sep 17 00:00:00 2001 From: carolinewuyan <309866211@qq.com> Date: Wed, 1 Jul 2015 13:40:46 +0800 Subject: [PATCH 514/965] =?UTF-8?q?=E5=B7=B2=E6=A0=A1=E5=AF=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...0150616 Linux Humor on the Command-line.md | 108 +++++++++--------- 1 file changed, 54 insertions(+), 54 deletions(-) diff --git a/translated/share/20150616 Linux Humor on the Command-line.md b/translated/share/20150616 Linux Humor on the Command-line.md index acd2fca4e7..41745eba24 100644 --- a/translated/share/20150616 Linux Humor on the Command-line.md +++ b/translated/share/20150616 Linux Humor on the Command-line.md @@ -1,122 +1,122 @@ -LinuxеĬ +Linux命令行中的幽默 ================================================================================ -ͨǷdz۵ģǿ˿ӻ飬ʱҲܹǿijЩĹܣԼøȤ¹ҲҪǺ࣬Щӣôкܶչ¶΢Ц +桌面通常是非常养眼的,它增强了可视化的体验,有时也能够增强某些软件的功能,而且让软件变得更有趣。在命令行下工作也不需要总是很严肃,如果您想在命令行下找些乐子,那么有很多命令可以让您展露微笑。 -LinuxǸȤIJϵͳṩСͿԴߣƽϡŹֵӦáЩߵͿѡ԰Linuxӱһ߸С߰ɡ +Linux是个有趣的操作系统。它提供大量的小型开源工具,从平淡无奇的软件到稀奇古怪的应用。正是这些工具的质量和可选择性帮助Linux脱颖而出。让我们一起来看看下面这七个小工具吧。 ### lolcat ### ![lolcat](http://www.linuxlinks.com/portal/content/reviews/Misc/Screenshot-lolcat.png) -lolcatһļ׼뵽׼һcatijΪ߲ʵɫ +lolcat是一个连接文件或标准输入到标准输出(类似一般的cat)的程序,它会为输出添加七彩的颜色。 -lolcatͨtoiletfigletıӦýʹáӦΪһèͼĺꡣ +lolcat通常和其他诸如toilet或figlet等生成文本的应用结合使用。这个软件不应被误认为是一个或多个猫的图像的宏。 -lolcatMoeд +lolcat由Moe编写。 -ַ: [github.com][1] +网址: [github.com][1] ### cowsay ### ![cowsay](http://www.linuxlinks.com/portal/content/reviews/Misc/Screenshot-cowsay.png) -cowsayһõĿԴASCIIţͼƬڶԻʾϢcowsayPerlдġ +cowsay是一个可配置的开源软件,它用ASCII码生成奶牛的图片,并可以在对话气泡中显示消息。cowsay是用Perl写的。 -cowsayֻʾţԤͼƬѼӡ¹С򡢽ͻ𼦣Լҡѩ˺͹Ǽܡ +cowsay并不仅仅只能显示奶牛。它能生成预先制作的图片或者其他动物,包括鸭子、考拉、麋鹿、小马、绵羊、剑龙和火鸡,以及奶酪、雪人和骨架。 -һcowthinkӦãԻݲͬţͬʱ˼ݡ +有一个叫cowthink的应用,与对话的气泡不同,它能在生成奶牛的同时生成思考的气泡。 -ܰ +功能包括: -- ýűøȤ -- Borgģʽ -- Ըţӣţ̰ƫִִƣ롢Ź֡ -- ţ˵ݿ޸ +- 让脚本变得更有趣 +- Borg模式 +- 可以更改奶牛看起来的样子,比如让奶牛看起来贪婪、偏执、固执、疲倦、古怪、年轻等 +- 支持xcowsay的变形 -ַ: [nog.net][2] +网址: [nog.net][2] ### doge ### ![doge](http://www.linuxlinks.com/portal/content/reviews/Misc/Screenshot-doge.png) -dogeһЩ޴ȤdogeĹļ򵥵ÿϢűĴӡһЩ﷨ľӣʱЩӻеĶ +doge是一个简单的每日信息脚本,它基于有些愚蠢但很有趣的doge的梗。它随机的打印一些在语法上有误的句子,有时这些句子基于您电脑中的东西。 -dogeһ2013dzеĻԪأͨһձȮͼƬͲɫɡЩֹһŵдһЩĶס +doge是一个在2013年非常流行的互联网潮流元素(梗)。这个梗通常由一幅日本柴犬的图片和彩色的文字组成。这些文字故意用一种蹩脚的语气写成了一些互联网的独白。 -- òͬɫŵӢдľ -- նеIJȮЧdz -- ϵͳݣеij򡢵ǰû$EDITOR -- װlolcatΪ׺: while true; do doge | lolcat -a -d 100 -s 100 -p 1; done -- ׼֧: ls /usr/bin | doge ӡһЩ/usr/binµĿִļޡеĿؿԹ˴ԼƴƵʡ +- 随机的用不同的颜色和蹩脚的英语写下随机的句子 +- 终端中的柴犬效果非常棒 +- 获得系统数据,比如主机名、运行中的程序、当前用户、$EDITOR +- 如果您安装了lolcat,您可以用它作为点缀: while true; do doge | lolcat -a -d 100 -s 100 -p 1; done +- 标准输入支持: ls /usr/bin | doge 将打印一些/usr/bin下的可执行文件。哇噢,还有许多命令行的开关可以过滤词语以及控制词语的频率。 -ַ: [github.com/thiderman/doge][3] +网址: [github.com/thiderman/doge][3] ### ASCIIQuarium ### ![Asciiquarium](http://www.linuxlinks.com/portal/content/reviews/Misc/Screenshot-Asciiquarium.png) -ASCIIQuariumһASCII뷽ʽˮ/󶯻ˮ׵ɡ +ASCIIQuarium是一个以ASCII码方式画出的水族馆/海洋动画。享受生活在您电脑中水底的奇妙生物吧。 -ASCIIQuariumҪװPerlcursesԼTerm::Animationģ顣ʹsudo apt-get install libcurses-perlװǰߣʹsudo cpan Term::AnimationװߡҪնС +想运行ASCIIQuarium,您需要安装Perl的curses包以及Term::Animation模块。请使用sudo apt-get install libcurses-perl来安装前者,使用sudo cpan Term::Animation来安装后者。两个命令都需要在终端中运行。 -ܰ +功能包括: -- ʵ -- ȤĶ㹳 -- 졢Ѽӡʹֻ +- 五彩的鱼儿 +- 有趣的动画,包括钓鱼钩 +- 还有许多的天鹅、鸭子、海豚和船只 -ַ: [www.robobunny.com][4] +网址: [www.robobunny.com][4] -### sl - ### +### sl - 蒸汽机车 ### ![sl](http://www.linuxlinks.com/portal/content/reviews/Misc/Screenshot-sl.png) -slһȤնӦãΪЩĴlsslûʾһ +sl是一个有趣的终端应用,它为那些意外的错将ls输成sl的用户显示一个动画。 -Ҵͨdzʣϲٶȶ׼ȷԡǷdzΣյġslΪһʵʵߣעֻϰߡǻ˿Ц +我打字通常非常草率,更喜欢速度而不是准确性。但错别字在命令行中是非常危险的。因此sl作为一个实际的提醒者,提醒我们注意错误输入的这种坏习惯。它总是会让人咯咯的笑。 -ܰ +功能包括: -- ʹ -F, ڷ -- ʹ -l, ʾһС͵Ļ -- ʹ -a, ȥ +- 使用 -F, 火车在飞翔 +- 使用 -l, 显示一个小型的火车 +- 使用 -a, 看上去发生了意外 -ַ: [github.com/mtoyoda/sl][5] +网址: [github.com/mtoyoda/sl][5] ### aafire ### ![aafire](http://www.linuxlinks.com/portal/content/reviews/Misc/Screenshot-aafire.png) -aafireնʾȼյASCII档չʾһascii - aalibǿ +aafire在终端中显示燃烧的ASCII火焰。它展示了aalib库的强大能力,一个ascii艺术库显示出来。 -ַ: [aa-project.sourceforge.net/aalib][6] +网址: [aa-project.sourceforge.net/aalib][6] ### CMatrix ### ![CMatrix](http://www.linuxlinks.com/portal/content/reviews/Misc/Screenshot-CMatrix.png) -CMatrixһncursesijģ⡶ڿ͵۹һӰеĻ档һɽȹϸ15꣬ô֪ܲڿ͵۹1999ƻõӰΪ Keanu Reeves, Laurence Fishburne, Carrie-Anne Moss, Hugo Weaving Joe Pantoliano +CMatrix是一个基于ncurses的程序,它模拟《黑客帝国》(一部电影)中的画面。如果您在一个山洞里度过了上个15年,那么您可能不知道黑客帝国是1999年的美国科幻电影,主角为 Keanu Reeves, Laurence Fishburne, Carrie-Anne Moss, Hugo Weaving和 Joe Pantoliano。 -նΪ132x300¹ҿͬʽйûٶȽ첽Ĺ +它可以在终端设置为132x300的情况下工作,并且可以以同样的速率进行滚动或者以用户定义的速度进行异步的滚动。 -ܰ +功能包括: -- ޸ıɫ -- ʹôַ -- 첽 -- ʹʽĹЧ -- Ļģʽ +- 修改文本颜色 +- 使用粗体字符 +- 异步滚动 +- 使用老式的滚动效果 +- 屏幕保护程序模式 -ַ: [www.asty.org/cmatrix][7] +网址: [www.asty.org/cmatrix][7] -------------------------------------------------------------------------------- via: http://www.linuxlinks.com/article/20150614112018846/Humor.html -ߣ[wwy-hust](https://github.com/wwy-hust) -Уԣ[УID](https://github.com/УID) +译者:[wwy-hust](https://github.com/wwy-hust) +校对:[Caroline](https://github.com/carolinewuyan) - [LCTT](https://github.com/LCTT/TranslateProject) ԭ룬[Linuxй](https://linux.cn/) Ƴ +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 [1]:https://github.com/busyloop/lolcat [2]:https://web.archive.org/web/20120225123719/http://www.nog.net/%7Etony/warez/cowsay.shtml @@ -124,4 +124,4 @@ via: http://www.linuxlinks.com/article/20150614112018846/Humor.html [4]:http://www.robobunny.com/projects/asciiquarium/html/ [5]:https://github.com/mtoyoda/sl [6]:http://aa-project.sourceforge.net/aalib/ -[7]:http://www.asty.org/cmatrix/ \ No newline at end of file +[7]:http://www.asty.org/cmatrix/ From bb794ff2d702760be021dae7ad2e7f51f1bcb2f2 Mon Sep 17 00:00:00 2001 From: ZTinoZ Date: Wed, 1 Jul 2015 15:04:55 +0800 Subject: [PATCH 515/965] Translating by ZTinoZ --- ...50625 Screen Capture Made Easy with these Dedicated Tools.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/share/20150625 Screen Capture Made Easy with these Dedicated Tools.md b/sources/share/20150625 Screen Capture Made Easy with these Dedicated Tools.md index ec03bb90e6..f0647ac550 100644 --- a/sources/share/20150625 Screen Capture Made Easy with these Dedicated Tools.md +++ b/sources/share/20150625 Screen Capture Made Easy with these Dedicated Tools.md @@ -2,7 +2,7 @@ ================================================================================ "一图胜过千万句",这句二十世纪早期在美国应运而生的名言,说的是一张单一的静止图片所蕴含的信息足以匹敌大量的描述性文字。本质上说,图片所传递的信息量比文字更有效更高效。 -截图(或抓帧)是一种捕捉自计算机所录制可视化设备输出的快照或图片,屏幕捕捉软件能让计算机获取到截图。This type of software has lots of uses. As an image can illustrate the operation of computer software well, screenshots play an important role in software development and documentation. Alternatively, if you have a technical problem with your computer, a screenshot allows a technical support department to understand the problems you are facing. Writing computer-related articles, documentation and tutorials is nigh on impossible without a good tool for creating screenshots. Screenshots are also useful to save snippets of anything you have on your screen, particularly when it can not be easily printed. +截图(或抓帧)是一种捕捉自计算机所录制可视化设备输出的快照或图片,屏幕捕捉软件能让计算机获取到截图。此类软件有很多用处,因为一张图片能很好地说明计算机软件的操作,截图在软件开发过程和文档中扮演了一个很重要的角色。或者,如果你的电脑有了个技术性问题,一张截图能让技术支持理解你碰到的这个问题。要写好计算机相关的文章、文档和教程,没有一款好的截图工具是几乎不可能的。如果你想在保存屏幕上任意一些零星的信息,特别是不方便打字时,截图也很有用。 Linux has a good selection of open source dedicated screenshot programs, both graphical and console based. For a feature-rich dedicated screenshot utility, look no further than Shutter. This tool is a superb example of a small open source tool. But there are some great alternatives too. From d03b615ec4fa6a91ae82f17d3ff0981b00ced177 Mon Sep 17 00:00:00 2001 From: DeadFire Date: Wed, 1 Jul 2015 16:19:08 +0800 Subject: [PATCH 516/965] =?UTF-8?q?20150701-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... You Must Do After Installing Fedora 22.md | 134 ++++++++++++++++++ 1 file changed, 134 insertions(+) create mode 100644 sources/tech/20150701 12 Things You Must Do After Installing Fedora 22.md diff --git a/sources/tech/20150701 12 Things You Must Do After Installing Fedora 22.md b/sources/tech/20150701 12 Things You Must Do After Installing Fedora 22.md new file mode 100644 index 0000000000..0e293451ef --- /dev/null +++ b/sources/tech/20150701 12 Things You Must Do After Installing Fedora 22.md @@ -0,0 +1,134 @@ +12 Things You Must Do After Installing Fedora 22 +================================================================================ +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/06/F22_alpha_wp-compressed.jpg) + +[Fedora][1] is one of my favorite Linux Distributions that I’ve ever used. Since Fedora project was started, It has always been providing new and exciting features in every release. This time the new and exciting changes have been brought with another well polished [release Fedora 22][2]. + +The release ‘Fedora 22′ comes with many new changes and features and I bet most of you (if seen the changes) would like the release and would want to install/upgrade to Fedora 22. But what to do when you install/upgrade to Fedora 22 ? This is what I am going to show in this article. I’m going to show you the 12 recommended **things to do after installing Fedora 22**. This article will help you setting up your new Fedora 22 and use the new features & changes. + +So let’s get started without wasting anymore time! + +### 1. DNF Replaces Yum In Fedora 22 ### + +Here is one thing that users turning to Fedora 22 must know is that Fedora 22 brings DNF Software Package Manager as a default package manager instead of Yum. + +You must get familiar with DNF so that you have ease to use your latest distro. + +> “With Fedora 22, we’re introducing a major change under the hood. Specifically, we’re now using [DNF and hawkey][3] to manage packages. DNF is much like the [Yum][4] software package manager….“ + +DNF is said to be faster and better dependency management. Although you can carefully see all the commands used in the this article and I’m sure they will help you out with this new software package manager. + +### 2. Update Your Fedora 22 System ### + +When you install Fedora, you have all the new & latest applications but because of the fast development of applications many applications get updates that contain new features, stability and bug fixes. So your first step should be to update your distribution as soon as possible. + + sudo dnf update + +### 3. Install Extra Repositories ### + +Fedora 22, as all other Linux distributions comes with official repositories already setup with the system but they don’t contain every package that you might need to install in future. So it is better to go for extra repository to have most of the packages available in just a minute. + +You can install RPM fusion as extra repositories to install more and more packages. There are two repositories that you can easily install – Free and Non-free. + +Go to [RPM fusion website][5] and you’ll find repositories link for different Fedora versions. First click “**RPM Fusion free for Fedora 22**“, as you can see this is free and click “**RPM Fusion nonfree for Fedora 22**” for a non-free. + +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/06/RPM-fusion-repositories-compressed.jpg) + +### 4. Install Multimedia Codecs ### + +With Fedora not all the codecs are installed, there are some missing that users need to install manually otherwise files require codecs that are not installed, those files won’t work at all. So to avoid frustration when want to play a movie and needed codec is not available, you must install multimedia codecs. + +Open the terminal and use the following command to install missing codecs – + + sudo dnf install gstreamer-plugins-bad gstreamer-plugins-bad-free-extras gstreamer-plugins-ugly gstreamer-ffmpeg gstreamer1-libav gstreamer1-plugins-bad-free-extras gstreamer1-plugins-bad-freeworld gstreamer1-plugins-base-tools gstreamer1-plugins-good-extras gstreamer1-plugins-ugly gstreamer1-plugins-bad-free gstreamer1-plugins-good gstreamer1-plugins-base gstreamer1 + +### 5. Install Gnome Tweak Tool ### + +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/06/gnome-tweak-tool-compressed.jpg) + +Gnome tweak tool is a GUI utility that lets you tweak and customize Gnome desktop environment with the most ease. Here is how you can install Gnome Tweak Tool in Fedora 22. + + sudo dnf install gnome-tweak-tool + +### 6. Install Adobe Flash Player ### + +Adobe flash player is required to show so much content on the internet browsers. Youtube videos need abobe to be installed and online games lovers won’t be able to play games on browser without Adobe flash player. + +Above flash player can be installed easily by downloading setup file from official Adobe website [here][6]. Your operating system and browser will be detected automatically, select the package .rpm and click download. Then open downloaded .rpm file. It will be opened using gnome software and it can be installed just clicking on install button and then providing password when asked. + +### 7. Install VLC Media Player ### + +Fedora 22 comes with a default media player installed known as Gnome Videos but if you’re not satisfied with this media player then you can install the BOSS of media player, VLC. VLC can play almost every virtual media that exists. + +Because we’ve already install RPM fusion repositories so we have VLC in RPM fusion repositories. Simply use dnf to install VLC media player. + + sudo dnf install vlc + +### 8. Install Google Chrome ### + +As other Linux and Fedora distributions, Fedora 22 also has Mozilla Firefox installed which is arguably the best with the most plugins available. But when it comes to speed the browsing, nobody can beat Google Chrome. + + sudo dnf install google-chrome-stable + +### 9. Install Dropbox ### + +I am sure most of you are using any of the cloud storage wait wait wait… Are you also Dropbox as your online cloud storage? That’s what most of people do. You can install Dropbox app on Fedora for faster and better use of the Dropbox cloud storage. + +You can simply download .rpm file from [Dropbox Website][7] according to the distro (32-bit Or 64-bit) you’re using and simply run it to install. + +### 10. Install GIMP An Alternative To Photoshop ### + +GIMP is an image editing and designing software which is very much similar to Photoshop. Most of us (blogger) use GIMP for image editing because it’s really very handy. + +GIMP does not come installed on Fedora 22 so you need to install it manually (which is super easy). + + sudo dnf install gimp + +### 11. Install 7zip ### + +We often need to unzip or extract some compressed files. 7zip is the utility that extracts all kind of archives. It’s not installed by default in Fedora, so you have to manually install 7zip. After this you are ready to extract any type of archive. + + sudo dnf install p7zip + +### 12. Install Other Desktop Environments ### + +Fedora primarily comes with Gnome desktop environment that I like very much. But if you want enjoy Fedora with a different desktop environment, then you can easily do that. + +**For KDE Desktop Environment** + + sudo dnf install @kde-desktop + +**For XFCE Desktop Environment** + + sudo dnf install @xfce-desktop + +**For MATE Desktop Environment** + + sudo dnf install @mate-desktop + +**You can also install any other desktop environment, just use the following format –** + + sudo dnf install @DESKTOP_ENVIRONMENT-desktop + +### Conclusion ### + +That’s all for today. All the above 12 points are enough to give a nice start to Fedora 22. The environment always teaches you new things, so keep on exploring. And obviously I can not touch all the points, if I missed something that you think might be important then please comment below this article and I’ll be happy to discuss that. + +-------------------------------------------------------------------------------- + +via: http://itsfoss.com/things-to-do-installing-fedora-22/ + +作者:[Mohd Sohail][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://itsfoss.com/author/sohail/ +[1]:https://getfedora.org/ +[2]:https://fedoraproject.org/wiki/F22_release_announcement +[3]:https://fedoraproject.org/wiki/Features/DNF +[4]:https://fedoraproject.org/wiki/Yum +[5]:http://rpmfusion.org/Configuration +[6]:https://get.adobe.com/flashplayer/ +[7]:https://www.dropbox.com/install?os=lnx \ No newline at end of file From babfa8103e60a2e44cdf25c4941191c56d059c1a Mon Sep 17 00:00:00 2001 From: wxy Date: Wed, 1 Jul 2015 22:01:53 +0800 Subject: [PATCH 517/965] =?UTF-8?q?=E6=94=BE=E9=94=99=E4=BD=8D=E7=BD=AE?= =?UTF-8?q?=E4=BA=86=E3=80=82=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...stall Unity 8 Desktop Preview In Ubuntu.md | 77 +++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 published/201506/20150604 How To Install Unity 8 Desktop Preview In Ubuntu.md diff --git a/published/201506/20150604 How To Install Unity 8 Desktop Preview In Ubuntu.md b/published/201506/20150604 How To Install Unity 8 Desktop Preview In Ubuntu.md new file mode 100644 index 0000000000..915e6aff8f --- /dev/null +++ b/published/201506/20150604 How To Install Unity 8 Desktop Preview In Ubuntu.md @@ -0,0 +1,77 @@ +在Ubuntu中安装Unity 8桌面预览版 +================================================================================ +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/06/Unity_8.jpeg) + +如果你一直关注新闻,那么就知道Ubuntu将会切换到带有[Unity 8][2]桌面的[Mir显示服务器][1]。然而,在尚未确定运行在 Mir 上的Unity 8是否会出现在[Ubuntu 15.10 Willy Werewolf][3]之前,有了一个Unity 8的预览版本可供你体验和测试。通过官方PPA,可以很容易地**安装Unity 8到Ubuntu 14.04,14.10和15.04中**。 + +到目前为止,开发者已经可以通过[ISO][4](主要途径)获得该Unity 8预览来进行测试。不过Canonical也通过[LXC容器][5]发布了它。通过该方法,你可以使用Unity 8桌面会话,让它像其它桌面环境一样运行在Mir显示服务器上。就像你[在Ubuntu中安装Mate桌面][6],然后从LightDm登录屏幕选择桌面会话一样。 + +想要试试Unity 8?让我们来看怎样安装它吧。 + +**注意: 它是一个实验性预览,可能不是所有人都可以让它正确工作的。** + +### 安装Unity 8桌面到Ubuntu ### + +下面是安装并使用Unity 8的步骤: + +#### 步骤 1: 安装Unity 8到Ubuntu 12.04和14.04 #### + +如果你正运行着Ubuntu 12.04和14.04,那么你必须使用官方PPA来安装Unity 8。使用以下命令进行安装: + + sudo apt-add-repository ppa:unity8-desktop-session-team/unity8-preview-lxc + sudo apt-get update + sudo apt-get upgrade + sudo apt-get install unity8-lxc + +#### 步骤 1: 安装Unity 8到Ubuntu 14.10和15.04 #### + +如果你正运行着Ubuntu 14.10或15.04,那么Unity 8 LXC已经在源中准备好。你只需要运行以下命令: + + sudo apt-get update + sudo apt-get install unity8-lxc + +#### 步骤 2: 设置Unity 8桌面预览LXC #### + +安装Unity 8 LXC后,该对它进行设置,下面的命令就可达到目的: + + sudo unity8-lxc-setup + +它将花费一些时间来设置,所以,耐心点。它会下载ISO,然后解压缩,接着完成最后一些必要的设置来让它工作。它也会安装一个LightDM的轻度修改版本。这一切都搞定后,需要重启。 + +#### 步骤 3: 选择Unity 8 #### + +重启后,在登录屏幕,点击你的登录旁边的Ubuntu图标: + +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2014/08/Change_Desktop_Environment_Ubuntu.jpeg) + +你应该可以在这看到Unity 8的选项,选择它: + +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/06/Select_Unity8.jpeg) + +### 卸载Unity 8 LXC ### + +如果你发现Unity 8毛病太多,或者你不喜欢它,那么你可以以相同的方式切换回默认Unity版本。此外,你也可以通过下面的命令移除Unity 8: + + sudo apt-get remove unity8-lxc + +该命令会将Unity 8选项从LightDM屏幕移除,但是配置仍然保留着。 + +以上就是你在Ubuntu中安装带有Mir的Unity 8的全部过程,试玩后请分享你关于Unity 8的想法哦! + +-------------------------------------------------------------------------------- + +via: http://itsfoss.com/install-unity-8-desktop-ubuntu/ + +作者:[Abhishek][a] +译者:[GOLinux](https://github.com/GOLinux) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://itsfoss.com/author/abhishek/ +[1]:http://en.wikipedia.org/wiki/Mir_%28software%29 +[2]:https://wiki.ubuntu.com/Unity8Desktop +[3]:http://itsfoss.com/ubuntu-15-10-codename/ +[4]:https://wiki.ubuntu.com/Unity8DesktopIso +[5]:https://wiki.ubuntu.com/Unity8inLXC +[6]:http://itsfoss.com/install-mate-desktop-ubuntu-14-04/ From 30a03fbccd70b2b0ccb5828826e842d202f8f68b Mon Sep 17 00:00:00 2001 From: wxy Date: Wed, 1 Jul 2015 23:24:48 +0800 Subject: [PATCH 518/965] PUB:20150526 20 Useful Terminal Emulators for Linux @ZTinoZ --- ... 20 Useful Terminal Emulators for Linux.md | 145 +++++++++--------- 1 file changed, 72 insertions(+), 73 deletions(-) rename {translated/tech => published}/20150526 20 Useful Terminal Emulators for Linux.md (51%) diff --git a/translated/tech/20150526 20 Useful Terminal Emulators for Linux.md b/published/20150526 20 Useful Terminal Emulators for Linux.md similarity index 51% rename from translated/tech/20150526 20 Useful Terminal Emulators for Linux.md rename to published/20150526 20 Useful Terminal Emulators for Linux.md index 5e0d237086..318b686aca 100644 --- a/translated/tech/20150526 20 Useful Terminal Emulators for Linux.md +++ b/published/20150526 20 Useful Terminal Emulators for Linux.md @@ -1,12 +1,13 @@ -20款优秀的Linux终端仿真器 +20 款优秀的 Linux 终端仿真器 ================================================================================ -终端仿真器是一款用其它显示结构重现可视终端的计算机程序。换句话说就是终端仿真器能使哑终端看似像一台客户机连接上了服务器。终端仿真器允许最终用户像文本用户界面和命令行界面一样连接控制台和应用程序。 + +终端仿真器是一款用其它显示架构重现可视终端的计算机程序。换句话说就是终端仿真器能使哑终端看似像一台连接上了服务器的客户机。终端仿真器允许最终用户用文本用户界面和命令行来访问控制台和应用程序。(LCTT 译注:终端仿真器原意指对大型机-哑终端方式的模拟,不过在当今的 Linux 环境中,通常指通过远程或本地方式连接的伪终端,俗称“终端”。) ![Linux Terminal Emulators](http://www.tecmint.com/wp-content/uploads/2014/01/Linux-Terminal-Emulators1.jpeg) -20款Linux终端仿真器 +*20款Linux终端仿真器* -你能从开源世界中找到大量的终端仿真器来使用,有些拥有大量的特性而有些则反之。为了能更好地理解它们所能提供的质量,我们收集了一份不可思议的Linux终端仿真器清单。每一款都列出了它们各自的描述和特性以及软件界面截图和下载链接。 +你能从开源世界中找到大量的终端仿真器,它们有些拥有大量的特性而有些则反之。为了能更好地了解它们的特性,我们收集了一份优秀的Linux终端仿真器清单。每一款都列出了它们各自的描述和特性以及软件界面截图和下载链接。 ### 1. Terminator ### @@ -14,21 +15,21 @@ Terminator是一款先进且强大的终端仿真器,它支持多终端窗口 #### Terminator的特性 #### -- 自定义外形和配色方案,根据你的需要设置尺寸。 -- 使用插件来获取更多功能。 +- 自定义配置和配色方案,根据你的需要设置尺寸。 +- 使用插件来提供更多功能。 - 快捷键可以加快普通操作。 -- 可以把终端窗口分裂成几个虚拟终端并把它们重新设置成你需要的尺寸。 +- 可以把终端窗口分割成几个虚拟终端并把它们根据需要重新调整尺寸。 ![Terminator Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/Terminator-Emulator.jpeg) -Terminator Terminal +*Terminator 终端* -- [Terminator Homepage][1] -- [Download and Installation Instructions][2] +- [Terminator 主页][1] +- [下载和安装指引][2] ### 2. Tilda ### -Tilda是一款漂亮的基于GTK+的下拉式终端,敲击一个键你就可以呼出一个新的或隐藏着的Tilda窗口。你也可以添加你所选择的颜色来更改文本颜色和终端背景颜色。 +Tilda是一款漂亮的下拉式终端,基于GTK+,一键单击你就可以呼出一个新的或隐藏着的Tilda窗口。你也可以用你所选择的颜色来更改文本颜色和终端背景颜色。 #### Tilda的特性 #### @@ -38,72 +39,72 @@ Tilda是一款漂亮的基于GTK+的下拉式终端,敲击一个键你就可 ![Tilda Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/Tilda-Emulator.jpeg) -Tilda Terminal +*Tilda 终端* -- [Tilda Homepage][3] +- [Tilda 主页][3] ### 3. Guake ### -Guake是一款基于python的下拉式终端,诞生于GNOME桌面环境。按一个键就能调出,再按一下就能隐藏。它的设计构思来源于FPS (第一人称射击) 游戏例如Quake,其目标显而易见。 +Guake是一款基于python的下拉式终端,诞生于GNOME桌面环境。一键调出,再按一下就能隐藏。它的设计构思来源于FPS (第一人称射击) 游戏 Quake,其主要目标是容易访问。 -Guake与Yakuaka和Tilda非常相似,不过它是一个集上述二者的优点于一体的基于GTK的程序。Guake完全是用Python和小片的C写成的(全局热键部分)。 +Guake与Yakuaka和Tilda非常相似,不过它是一个集上述二者的优点于一体的基于GTK的程序。Guake完全是用Python和C的片段写成的(全局热键部分)。 ![Guake Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/Guake-Terminal.jpeg) -Guake Terminal +*Guake 终端* -- [Guake Homepage][4] +- [Guake 主页][4] ### 4. Yakuake ### -Yakuake (Yet Another Kuake) 是一款基于KDE的下拉式终端仿真器,它与Guake再功能上非常相似。它的射击构思也是受FPS游戏的启发例如Quake。 +Yakuake (Yet Another Kuake) 是一款基于KDE的下拉式终端仿真器,它与Guake在功能上非常相似。它的设计构思也是受FPS游戏Quake的启发。 -Yakuake主要是一款KDE应用程序,它能非常轻松地安装在KDE桌面上,但是如果你试着将它安装在GNOME桌面上,你将会安装大量的依赖包。 +Yakuake从根本上说是一款KDE应用程序,它能非常轻松地安装在KDE桌面上,但是如果你试着将它安装在GNOME桌面上,你将会安装大量的依赖包。 #### Yakuake的特性 #### -- 从屏幕顶端弹回顺畅 -- 选项卡式界面 +- 顺畅地从屏幕顶端弹出 +- 标签式界面 - 可配置的尺寸和动画速度 - 可定制 ![Yakuake Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/Yakuake-Terminal.jpeg) -Yakuake Terminal +*Yakuake 终端* -- [Yakuake Homepage][5] +- [Yakuake 主页][5] ### 5. ROXTerm ### -ROXterm又是一款轻量级终端仿真器,旨在提供与GNOME终端相似的特性。它原本创造出来是为了通过不使用Gnome库从而拥有更少的占用空间和更快的启动速度并使用独立的小程序来建立配置界面(GUI), 但是随着时间的流逝,它的角色就转变为给那些高级用户带来更高一层的特性。 +ROXterm是又一款轻量级终端仿真器,旨在提供与“GNOME终端”相似的特性。它原本创造出来是为了避免使用Gnome库从而更少占用空间和更快启动,并使用独立的小程序来显示配置界面(GUI), 但是随着时间的流逝,它的角色就转变为给那些高级用户带来更高层次的特性。 -然而,它比GNOME终端更加具有可制定性并且对于那些经常使用终端的高级用户更令人期望。它能和GNOME桌面环境完美结合并在终端中提供像拖拽项目那样的特性。 +然而,它比GNOME终端更加具有可制定性,并且对于那些经常使用终端的高级用户更令人期望。它能和GNOME桌面环境完美结合并在终端中提供像拖拽项目那样的特性。 ![Roxterm Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/Roxterm-Terminal.jpeg) -Roxterm Terminal +*Roxterm 终端* -- [ROXTerm Homepage][6] +- [ROXTerm 主页][6] ### 6. Eterm ### -Eterm是最轻量级的一款彩色终端仿真器,是作为xterm的替代品而被设计出来。它是以一种选择自由的思想、避免臃肿、灵活性和自由在用户手中是触手可及的理念而开发出来的。 +Eterm是最轻量级的一款彩色终端仿真器,是作为xterm的替代品而被设计出来。它是以一种自由选择的理念设计的,带来了更强大、灵活、用户自主把控的终端。 ![Eterm Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/Eterm-Terminal.jpeg) -Eterm Terminal +*Eterm 终端* -- [Eterm Homepage][7] +- [Eterm 主页][7] ### 7. Rxvt ### -代表着扩展虚拟终端的Rxvt是一款彩色终端仿真器,为那些不需要一些特性例如Tektronix 4014仿真和toolkit-style可配置性的高级用户而生的xterm的替代品。 +Rxvt 的意思是扩展虚拟终端,它是一款彩色终端仿真器,是为那些不需要一些诸如Tektronix 4014仿真和toolkit-style可配置性等特性的高级用户而生的xterm替代品。 ![Rxvt Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/Rxvt-Terminal.jpeg) -Rxvt Terminal +*Rxvt 终端* -- [Rxvt Homepage][8] +- [Rxvt 主页][8] ### 8. Wterm ### @@ -111,9 +112,9 @@ Wterm是另一款以rxvt项目为基础的轻量级彩色终端仿真器。它 ![wterm Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/wterm-Terminal-.jpeg) -wterm Terminal +*wterm 终端* -- [Wterm Homepage][9] +- [Wterm 主页][9] ### 9. LXTerminal ### @@ -121,16 +122,16 @@ LXTerminal是一款基于VTE的终端仿真器,默认运行于没有任何多 #### LXTerminal的特性 #### -- 多标签支持 -- 支持普通命令如cp, cd, dir, mkdir, mvdir +- 多标签式支持 +- 支持常规命令如cp, cd, dir, mkdir, mvdir - 隐藏菜单栏以保证足够界面空间 - 更改配色方案 ![lxterminal Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/lxterminal-Terminal.jpeg) -lxterminal Terminal +*lxterminal 终端* -- [LXTerminal Homepage][10] +- [LXTerminal 主页][10] ### 10. Konsole ### @@ -147,85 +148,83 @@ Konsole是另一款强大的基于KDE的免费终端仿真器,最初由Lars Do - 终端中的活动通知警告 - 增量搜索 - 支持Dolphin文件管理器 -- 普通文本和HTML格式输出出口 +- 支持导出显示为普通文本和HTML格式 ![Konsole Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/Konsole-Terminal.jpeg) -Konsole Terminal +*Konsole 终端* -- [Konsole Homepage][11] +- [Konsole 主页][11] ### 11. TermKit ### -TermKit是一款漂亮简洁的终端,其目标是用在Google Chrome和Chromium中广泛被使用的WebKit渲染引擎在基于应用程序的命令行中构建出GUI视图。TermKit起初是为Mac和Windows设计的,但是由于TermKit被Floby给fork并做了修改,现在你可以将它安装在Linux发行版上并感受TermKit带来的魅力。 +TermKit是一款漂亮简洁的终端,其目标是用WebKit渲染引擎在基于应用程序的命令行中构建出GUI视图(LCTT 译注:这个描述比较模糊,请参考截图,或安装一个体验下),WebKit渲染引擎在Google Chrome和Chromium中广泛使用。TermKit起初是为Mac和Windows设计的,但是由于Floby对TermKit 构建了分支,现在你可以将它安装在Linux发行版上并感受TermKit带来的魅力。 ![TermKit Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/TermKit-Terminal.jpeg) -TermKit Terminal +*TermKit 终端* -- [TermKit Homepage][12] +- [TermKit 主页][12] ### 12. st ### -st是一款简单的X Window终端实现接口。 +st是一款简单的X Window终端。 ![st terminal](http://www.tecmint.com/wp-content/uploads/2014/01/st-terminal.png) -st terminal +*st 终端* -- [st Homepage][13] +- [st 主页][13] -### 13. Gnome-Terminal ### +### 13. Gnome 终端 ### -GNOME终端是一款在GNOME桌面环境下的嵌入式终端仿真器,由Havoc Pennington和其他一些人共同开发。它允许用户在GNOME环境下的同时使用一个真实的Linux shell来运行命令。GNOME终端是模拟的xterm终端仿真器并带来了一些相似的特性。 +GNOME终端是一款在GNOME桌面环境下自带的终端仿真器,由Havoc Pennington和其他一些人共同开发。它允许用户在GNOME环境下可以使用一个真实的Linux shell来运行命令。GNOME终端是模仿了xterm终端仿真器,并有一些相似的特性。 -Gnome终端支持多用户,用户可以为他们的账户创建多个用户,每个用户能自定义配置选项,如字体、颜色、背景图片、行为习惯等等并能分别给它们取名。它也支持鼠标事件、url探测、多标签等。 +Gnome终端支持多配置文件,用户可以为他们的账户创建多个配置文件,每个配置文件能自定义配置选项,如字体、颜色、背景图片、行为习惯等等,并能分别给每个配置文件取名。它也支持鼠标事件、url探测、多标签等。 ![Gnome Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/Gnome-terminal.jpg) -Gnome Terminal +*Gnome 终端* -- [Gnome Terminal][14] +- [Gnome 终端][14] ### 14. Final Term ### -Final Term是一款漂亮的开源终端仿真器,在这一个界面里蕴藏着一些令人激动的功能和特性。虽然它仍然有待改进,但是它提供了一些重要的特性比如Semantic文本菜单、智能的命令行实现、GUI终端控制、全能的快捷键、彩色支持等等。以下动图抓取并演示了它们的一些特性,点开来看看吧。 +Final Term是一款漂亮的开源终端仿真器,在这一个单独的界面里蕴藏着一些令人激动的特性和方便的功能。虽然它仍然有待改进,但是它提供了一些重要的特性比如“语义”文本菜单、智能的命令行补全、GUI终端控制、全能的快捷键、彩色支持等等。以下动图抓取并演示了它们的一些特性,点开来看看吧。 ![FinalTerm Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/FinalTerm.gif) -FinalTerm Terminal +*FinalTerm 终端* - [Final Term][15] ### 15. Terminology ### -Terminology是一款新的现代化终端仿真器,为Enlightenment桌面创造,但也能用于其它桌面环境。它有一些独一无二的棒极了的特性,这是其它终端仿真器所不具备的。 +Terminology是又一款新的现代化终端仿真器,为Enlightenment桌面创造,但也能用于其它桌面环境。它有一些独一无二的棒极了的特性,这是其它终端仿真器所不具备的。 抛开这些特性,terminology甚至还提供了你无法从其它仿真器看到的东西,比如图像、视频和文档的缩略图预览,它允许你从Terminology直接就能看到那些文件。 -你可以来看看Terminology的开发人员制作的小视频(视频画质不太清晰,但足以让你了解Terminology了)。 - - +你可以来看看Terminology的开发人员制作的小视频(视频画质不太清晰,但足以让你了解Terminology了): https://www.youtube.com/ibPziLRGvkg - [Terminology][16] -### 16. Xfce4 terminal ### +### 16. Xfce4 终端 ### -Xfce终端是一款轻量级的现代化终端仿真器,它简单易用,为Xfce桌面环境设计。它最新的一个版本有许多新的炫酷特性比如搜索会话、标签颜色转换器、像Guake或Yakuake一样的下拉式控制台等等。 +Xfce终端是一款轻量级的现代化终端仿真器,它简单易用,为Xfce桌面环境设计。它最新的一个版本有许多新的炫酷特性,比如搜索对话框、标签颜色转换器、像Guake或Yakuake一样的下拉式控制台等等。 ![Xfce Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/xfce-terminal.jpg) -Xfce Terminal +*Xfce 终端* -- [Xfce4 Terminal][17] +- [Xfce4 终端][17] ### 17. xterm ### -xterm应用程序是一款标准的在X Window系统上的终端仿真器。它保持了DEC VT102和Tektronix 4014,让应用能直接使用X Window系统。 +xterm应用是一款标准的在X Window系统上的终端仿真器。它保持了对DEC VT102和Tektronix 4014终端的兼容,以支持那些不能直接使用窗口系统的应用。 ![xterm Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/xterm.jpg) -xterm Terminal +*xterm 终端* - [xterm][18] @@ -233,36 +232,36 @@ xterm Terminal LilyTerm是一款基于libvte的开源终端仿真器,这款不太出名的仿真器追求的是快速和轻量级。LilyTerm也包括一些关键特性: -- 支持标签移动、着色以及标签重新排序 +- 支持标签、彩色以及标签重新排序 - 通过快捷键管理标签 - 支持背景透明化和饱和度调整 -- 支持为特定用户创建配置文件 +- 支持用户创建配置文件 - 若干个自定义选项 - 广泛支持UTF-8 ![Lilyterm Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/Lilyterm.jpg) -Lilyterm Terminal +*Lilyterm 终端* - [LilyTerm][19] ### 19. Sakura ### -Sakura是另一款不知名的Unix风格终端仿真器,按照命令行模式和基于文本的终端程序开发。Sakura基于GTK和livte,自身特性不多,不过还是有一些自定义选项比如多标签支持、自定义文本颜色、字体和背景图片、快速命令处理等等。 +Sakura是另一款不知名的Unix风格终端仿真器,是为命令行模式和基于文本的终端程序开发的。Sakura基于GTK和livte,自身特性不多,不过还是有一些自定义选项,比如多标签支持、自定义文本颜色、字体和背景图片、快速命令处理等等。 ![Sakura Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/sakura.jpg) -Sakura Terminal +*Sakura 终端* - [Sakura][20] ### 20. rxvt-unicode ### -rxvt-unicode (也称为urxvt) 是另一个高度可定制、轻量级和快速的终端仿真器,支持xft和unicode,由Marc Lehmann开发。它有许多显著特性比如支持Unicode上的国际语言,能显示多种字体类型并支持Perl扩展。 +rxvt-unicode (也称为urxvt) 是另一个高度可定制、轻量级和快速的终端仿真器,支持xft和unicode,由Marc Lehmann开发。它有许多显著特性,比如通过Unicode支持国际化语言,能显示多种字体类型并支持Perl扩展。 ![rxvt unicode](http://www.tecmint.com/wp-content/uploads/2014/01/rxvt-unicode.png) -rxvt unicode +*rxvt unicode* - [rxvt-unicode][21] @@ -274,7 +273,7 @@ via: http://www.tecmint.com/linux-terminal-emulators/ 作者:[Ravi Saive][a] 译者:[ZTinoZ](https://github.com/ZTinoZ) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 01806e142dcbd3681d0dad3f60ed957f348e1e48 Mon Sep 17 00:00:00 2001 From: ictlyh Date: Wed, 1 Jul 2015 23:53:30 +0800 Subject: [PATCH 519/965] =?UTF-8?q?[Delete]=20sources/tech/20150701=2012?= =?UTF-8?q?=20Things=20You=20Must=20Do=20After=20Installing=20Fedora=2022.?= =?UTF-8?q?md=20=E5=87=A0=E4=B9=8E=E5=92=8C=20published/2015/06/20150528?= =?UTF-8?q?=20Things=20To=20Do=20After=20Installing=20Fedora=2022=20?= =?UTF-8?q?=E5=AE=8C=E5=85=A8=E7=9B=B8=E5=90=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... You Must Do After Installing Fedora 22.md | 134 ------------------ 1 file changed, 134 deletions(-) delete mode 100644 sources/tech/20150701 12 Things You Must Do After Installing Fedora 22.md diff --git a/sources/tech/20150701 12 Things You Must Do After Installing Fedora 22.md b/sources/tech/20150701 12 Things You Must Do After Installing Fedora 22.md deleted file mode 100644 index 0e293451ef..0000000000 --- a/sources/tech/20150701 12 Things You Must Do After Installing Fedora 22.md +++ /dev/null @@ -1,134 +0,0 @@ -12 Things You Must Do After Installing Fedora 22 -================================================================================ -![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/06/F22_alpha_wp-compressed.jpg) - -[Fedora][1] is one of my favorite Linux Distributions that I’ve ever used. Since Fedora project was started, It has always been providing new and exciting features in every release. This time the new and exciting changes have been brought with another well polished [release Fedora 22][2]. - -The release ‘Fedora 22′ comes with many new changes and features and I bet most of you (if seen the changes) would like the release and would want to install/upgrade to Fedora 22. But what to do when you install/upgrade to Fedora 22 ? This is what I am going to show in this article. I’m going to show you the 12 recommended **things to do after installing Fedora 22**. This article will help you setting up your new Fedora 22 and use the new features & changes. - -So let’s get started without wasting anymore time! - -### 1. DNF Replaces Yum In Fedora 22 ### - -Here is one thing that users turning to Fedora 22 must know is that Fedora 22 brings DNF Software Package Manager as a default package manager instead of Yum. - -You must get familiar with DNF so that you have ease to use your latest distro. - -> “With Fedora 22, we’re introducing a major change under the hood. Specifically, we’re now using [DNF and hawkey][3] to manage packages. DNF is much like the [Yum][4] software package manager….“ - -DNF is said to be faster and better dependency management. Although you can carefully see all the commands used in the this article and I’m sure they will help you out with this new software package manager. - -### 2. Update Your Fedora 22 System ### - -When you install Fedora, you have all the new & latest applications but because of the fast development of applications many applications get updates that contain new features, stability and bug fixes. So your first step should be to update your distribution as soon as possible. - - sudo dnf update - -### 3. Install Extra Repositories ### - -Fedora 22, as all other Linux distributions comes with official repositories already setup with the system but they don’t contain every package that you might need to install in future. So it is better to go for extra repository to have most of the packages available in just a minute. - -You can install RPM fusion as extra repositories to install more and more packages. There are two repositories that you can easily install – Free and Non-free. - -Go to [RPM fusion website][5] and you’ll find repositories link for different Fedora versions. First click “**RPM Fusion free for Fedora 22**“, as you can see this is free and click “**RPM Fusion nonfree for Fedora 22**” for a non-free. - -![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/06/RPM-fusion-repositories-compressed.jpg) - -### 4. Install Multimedia Codecs ### - -With Fedora not all the codecs are installed, there are some missing that users need to install manually otherwise files require codecs that are not installed, those files won’t work at all. So to avoid frustration when want to play a movie and needed codec is not available, you must install multimedia codecs. - -Open the terminal and use the following command to install missing codecs – - - sudo dnf install gstreamer-plugins-bad gstreamer-plugins-bad-free-extras gstreamer-plugins-ugly gstreamer-ffmpeg gstreamer1-libav gstreamer1-plugins-bad-free-extras gstreamer1-plugins-bad-freeworld gstreamer1-plugins-base-tools gstreamer1-plugins-good-extras gstreamer1-plugins-ugly gstreamer1-plugins-bad-free gstreamer1-plugins-good gstreamer1-plugins-base gstreamer1 - -### 5. Install Gnome Tweak Tool ### - -![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/06/gnome-tweak-tool-compressed.jpg) - -Gnome tweak tool is a GUI utility that lets you tweak and customize Gnome desktop environment with the most ease. Here is how you can install Gnome Tweak Tool in Fedora 22. - - sudo dnf install gnome-tweak-tool - -### 6. Install Adobe Flash Player ### - -Adobe flash player is required to show so much content on the internet browsers. Youtube videos need abobe to be installed and online games lovers won’t be able to play games on browser without Adobe flash player. - -Above flash player can be installed easily by downloading setup file from official Adobe website [here][6]. Your operating system and browser will be detected automatically, select the package .rpm and click download. Then open downloaded .rpm file. It will be opened using gnome software and it can be installed just clicking on install button and then providing password when asked. - -### 7. Install VLC Media Player ### - -Fedora 22 comes with a default media player installed known as Gnome Videos but if you’re not satisfied with this media player then you can install the BOSS of media player, VLC. VLC can play almost every virtual media that exists. - -Because we’ve already install RPM fusion repositories so we have VLC in RPM fusion repositories. Simply use dnf to install VLC media player. - - sudo dnf install vlc - -### 8. Install Google Chrome ### - -As other Linux and Fedora distributions, Fedora 22 also has Mozilla Firefox installed which is arguably the best with the most plugins available. But when it comes to speed the browsing, nobody can beat Google Chrome. - - sudo dnf install google-chrome-stable - -### 9. Install Dropbox ### - -I am sure most of you are using any of the cloud storage wait wait wait… Are you also Dropbox as your online cloud storage? That’s what most of people do. You can install Dropbox app on Fedora for faster and better use of the Dropbox cloud storage. - -You can simply download .rpm file from [Dropbox Website][7] according to the distro (32-bit Or 64-bit) you’re using and simply run it to install. - -### 10. Install GIMP An Alternative To Photoshop ### - -GIMP is an image editing and designing software which is very much similar to Photoshop. Most of us (blogger) use GIMP for image editing because it’s really very handy. - -GIMP does not come installed on Fedora 22 so you need to install it manually (which is super easy). - - sudo dnf install gimp - -### 11. Install 7zip ### - -We often need to unzip or extract some compressed files. 7zip is the utility that extracts all kind of archives. It’s not installed by default in Fedora, so you have to manually install 7zip. After this you are ready to extract any type of archive. - - sudo dnf install p7zip - -### 12. Install Other Desktop Environments ### - -Fedora primarily comes with Gnome desktop environment that I like very much. But if you want enjoy Fedora with a different desktop environment, then you can easily do that. - -**For KDE Desktop Environment** - - sudo dnf install @kde-desktop - -**For XFCE Desktop Environment** - - sudo dnf install @xfce-desktop - -**For MATE Desktop Environment** - - sudo dnf install @mate-desktop - -**You can also install any other desktop environment, just use the following format –** - - sudo dnf install @DESKTOP_ENVIRONMENT-desktop - -### Conclusion ### - -That’s all for today. All the above 12 points are enough to give a nice start to Fedora 22. The environment always teaches you new things, so keep on exploring. And obviously I can not touch all the points, if I missed something that you think might be important then please comment below this article and I’ll be happy to discuss that. - --------------------------------------------------------------------------------- - -via: http://itsfoss.com/things-to-do-installing-fedora-22/ - -作者:[Mohd Sohail][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://itsfoss.com/author/sohail/ -[1]:https://getfedora.org/ -[2]:https://fedoraproject.org/wiki/F22_release_announcement -[3]:https://fedoraproject.org/wiki/Features/DNF -[4]:https://fedoraproject.org/wiki/Yum -[5]:http://rpmfusion.org/Configuration -[6]:https://get.adobe.com/flashplayer/ -[7]:https://www.dropbox.com/install?os=lnx \ No newline at end of file From 116c934d11e1ca1cb8013a60acee9c2c1f2dc9e6 Mon Sep 17 00:00:00 2001 From: H-mudcup Date: Wed, 1 Jul 2015 23:59:53 +0800 Subject: [PATCH 520/965] Update 20150407 10 Truly Amusing Easter Eggs in Linux.md --- sources/share/20150407 10 Truly Amusing Easter Eggs in Linux.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/share/20150407 10 Truly Amusing Easter Eggs in Linux.md b/sources/share/20150407 10 Truly Amusing Easter Eggs in Linux.md index 3ab7f47b79..f8322fb1af 100644 --- a/sources/share/20150407 10 Truly Amusing Easter Eggs in Linux.md +++ b/sources/share/20150407 10 Truly Amusing Easter Eggs in Linux.md @@ -1,3 +1,4 @@ +Translating by H-mudcup 10 Truly Amusing Easter Eggs in Linux ================================================================================ ![](http://en.wikipedia.org/wiki/File:Adventure_Easteregg.PNG) From 45109a030866bb8fe026fd81aa13ce86068e96e9 Mon Sep 17 00:00:00 2001 From: ZTinoZ Date: Thu, 2 Jul 2015 15:36:10 +0800 Subject: [PATCH 521/965] Translating by ZTinoZ --- ...5 Screen Capture Made Easy with these Dedicated Tools.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sources/share/20150625 Screen Capture Made Easy with these Dedicated Tools.md b/sources/share/20150625 Screen Capture Made Easy with these Dedicated Tools.md index f0647ac550..3f55c5ca5e 100644 --- a/sources/share/20150625 Screen Capture Made Easy with these Dedicated Tools.md +++ b/sources/share/20150625 Screen Capture Made Easy with these Dedicated Tools.md @@ -1,12 +1,12 @@ 用这些专用工具让你截图更简单 ================================================================================ -"一图胜过千万句",这句二十世纪早期在美国应运而生的名言,说的是一张单一的静止图片所蕴含的信息足以匹敌大量的描述性文字。本质上说,图片所传递的信息量比文字更有效更高效。 +"一图胜过千万句",这句二十世纪早期在美国应运而生的名言,说的是一张单一的静止图片所蕴含的信息足以匹敌大量的描述性文字。本质上说,图片所传递的信息量的确是比文字更有效更高效。 截图(或抓帧)是一种捕捉自计算机所录制可视化设备输出的快照或图片,屏幕捕捉软件能让计算机获取到截图。此类软件有很多用处,因为一张图片能很好地说明计算机软件的操作,截图在软件开发过程和文档中扮演了一个很重要的角色。或者,如果你的电脑有了个技术性问题,一张截图能让技术支持理解你碰到的这个问题。要写好计算机相关的文章、文档和教程,没有一款好的截图工具是几乎不可能的。如果你想在保存屏幕上任意一些零星的信息,特别是不方便打字时,截图也很有用。 -Linux has a good selection of open source dedicated screenshot programs, both graphical and console based. For a feature-rich dedicated screenshot utility, look no further than Shutter. This tool is a superb example of a small open source tool. But there are some great alternatives too. +在开源世界,Linux有许多专注于截图功能的工具供选择,基于图形的和控制台的都有。如果要说一个功能丰富的专用截图工具,那就来看看Shutter吧。这款工具是小型开源工具的杰出代表,当然也有其它的选择。 -Screen capture functionality is not only provided by dedicated applications. GIMP and ImageMagick, two programs which are primarily image manipulation tools, also offer competent screen capturing functionality. +屏幕捕捉功能不仅仅只有专业的工具提供,GIMP和ImageMagick这两款主攻图像处理的工具,也能提供像样的屏幕捕捉功能。 ---------- From 4ae10c9d44d4dd1d654ef9a49b40d7db7d3b9179 Mon Sep 17 00:00:00 2001 From: ZTinoZ Date: Fri, 3 Jul 2015 10:02:13 +0800 Subject: [PATCH 522/965] Translating by ZTinoZ --- ...re Made Easy with these Dedicated Tools.md | 52 +++++++++---------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/sources/share/20150625 Screen Capture Made Easy with these Dedicated Tools.md b/sources/share/20150625 Screen Capture Made Easy with these Dedicated Tools.md index 3f55c5ca5e..8e393b1722 100644 --- a/sources/share/20150625 Screen Capture Made Easy with these Dedicated Tools.md +++ b/sources/share/20150625 Screen Capture Made Easy with these Dedicated Tools.md @@ -14,36 +14,36 @@ ![Shutter in action](http://www.linuxlinks.com/portal/content/reviews/Graphics/Screenshot-Shutter1.png) -Shutter is a feature-rich screenshot application. You can take a screenshot of a specific area, window, your whole screen, or even of a website - apply different effects to it, draw on it to highlight points, and then upload to an image hosting site, all within one window. +Shutter是一款功能丰富的截图软件。你能为你的特殊区域、窗口、整个屏幕甚至是网站截图 - 然后在其中应用不用的效果,比如用高亮的点在上面绘图,然后上传至一个图片托管网站,一切尽在这个小窗口内。 -Features include: +包含特性: -- Take a screenshot of: - - a specific area - - window - - the complete desktop - - web pages from a script -- Apply different effects to the screenshot -- Hotkeys -- Print -- Take screenshot directly or with a specified delay time -- Save the screenshots to a specified directory and name them in a convenient way (using special wild-cards) -- Fully integrated into the GNOME Desktop (TrayIcon etc) -- Generate thumbnails directly when you are taking a screenshot and set a size level in % -- Shutter session collection: - - Keep track of all screenshots during session - - Copy screeners to clipboard - - Print screenshots - - Delete screenshots - - Rename your file -- Upload your files directly to Image-Hosters (e.g. http://ubuntu-pics.de), retrieve all the needed links and share them with others -- Edit screenshots directly using the embedded drawing tool +- 截图范围: + - 一块特殊区域 + - 窗口 + - 完整的桌面 + - 脚本生成的网页 +- 在截图中应用不同效果 +- 热键 +- 打印 +- 直接截图或指定一个延迟时间 +- 将截图保存至一个指定目录并用一个简便方法重命名它(用特殊的通配符) +- 完成集成在GNOME桌面中(TrayIcon等等) +- 当你截了一张图并以%设置了尺寸时,直接生成缩略图 +- Shutter会话选项: + - 会话中保持所有截图的痕迹 + - 复制截图至剪贴板 + - 打印截图 + - 删除截图 + - 重命名文件 +- 直接上传你的文件至图像托管网站(比如http://ubuntu-pics.de),取回所有需要的图像并将它们与其他人分享 +- 用内嵌的绘画工具直接编辑截图 -- Website: [shutter-project.org][1] -- Developer: Mario Kemper and Shutter Team -- License: GNU GPL v3 -- Version Number: 0.93.1 +- 主页: [shutter-project.org][1] +- 开发者: Mario Kemper和Shutter团队 +- 许可证: GNU GPL v3 +- 版本号: 0.93.1 ---------- From b32e0d6905653e72074d8b8278454680a8719b75 Mon Sep 17 00:00:00 2001 From: wwy-hust Date: Fri, 3 Jul 2015 15:11:03 +0800 Subject: [PATCH 523/965] finish translation --- ...Introduction To FreeBSD For Linux Users.md | 100 ------------------ ...Introduction To FreeBSD For Linux Users.md | 98 +++++++++++++++++ 2 files changed, 98 insertions(+), 100 deletions(-) delete mode 100644 sources/talk/20150309 Comparative Introduction To FreeBSD For Linux Users.md create mode 100644 translated/talk/20150309 Comparative Introduction To FreeBSD For Linux Users.md diff --git a/sources/talk/20150309 Comparative Introduction To FreeBSD For Linux Users.md b/sources/talk/20150309 Comparative Introduction To FreeBSD For Linux Users.md deleted file mode 100644 index 9e73930755..0000000000 --- a/sources/talk/20150309 Comparative Introduction To FreeBSD For Linux Users.md +++ /dev/null @@ -1,100 +0,0 @@ -translating by wwy-hust - -Comparative Introduction To FreeBSD For Linux Users -================================================================================ -![](https://1102047360.rsc.cdn77.org/wp-content/uploads/2015/03/FreeBSD-790x494.jpg) - -### Introduction ### - -BSD was originally derived from UNIX and currently, there are various number of Unix-like operating systems descended from the BSD. While, FreeBSD is the most widely used open source Berkeley Software Distribution (BSD distribution). As it is implicitly said it is a free and open source Unix-like-operating system and a public server platform. FreeBSD source code is generally released under a permissive BSD license. It is true that it has similarities with Linux but we cannot deny that they differs in other points. - -The remainder of this article is organized as follows: the description of FreeBSD will be treated in our first section. The similarities between FreeBSD and Linux will be briefly described in the second section. While their differences will be discussed in the third section. And a comparison of their features will be summarized in our last section. - -### FreeBSD description ### - -#### History #### - -- The first version of FreeBSD was released in 1993, while its first CD-ROM distributed was FreeBSD1.0 on December 1993. Then, FreeBSD 2.1.0 was released in 1995 which gained the satisfaction of all users. Actually, many IT companies use FreeBSD and are satisfied where we can list those companies: IBM, Nokia, NetApp and Juniper Networks. - -#### License #### - -- Concerning its license, FreeBSD is released under various source licenses. Its newest code called Kernel is released under the two-clause BSD license, offering the possibility to use and redistribute FreeBSD with absolute freedom. Other codes are released three- and four-clause BSD license and some others are released under GPL and CDDL. - -#### Users #### - -- One of the important feature of FreeBSD, we can mention the various categories of its users. In fact, it is possible to use FreeBSD as a mail server, web server, FTP server and as a router due to the significant set of server-related software accompanied with it. Furthermore, ARM, PowerPC and MIPS are supported by FreeBSD so it is possible to use x86 and s86-64. - -### FreeBSD and Linux similarities ### - -FreeBSD and Linux are two free and open source systems. Indeed, their users can easily check and modify the source code with an absolute freedom. To add, FreeBSD and Linux, both of them are derived from Unix.-like because they have a kernel, internals, and libraries programmed using algorithms derived from historic AT&T Unix. While FreeBSD’s roots are similar to Unix systems, Linux is released as a free Unix-like option. Various tools and applications can be found either in FreeBSD or in Linux in fact, they almost share the same functionality. - -Furthermore, FreeBSD can run big number of Linux applications. It has a Linux compatibility layer that can be installed. This Linux compatibility layer can be installed while compiling FreeBSD with AAC Compact Linux or downloading compiled FreeBSD systems with a Linux compatibility program such as: aac_linux.ko. Which is not the same case with Linux, Linux cannot run FreeBSD software. - -At the end, we can mention that both of them have the same goal but have also some differences which we will outline in the next section. - -### FreeBSD and Linux differences ### - -Currently, no criteria of choice between FreeBSD and Linux is clear for most users. Since, they share almost the same applications. Those two operating systems are as mentioned previously UNIX-like. - -In this section, we will list the most important differences of those two systems. - -#### License #### - -- The first difference point between those two compared systems consist on their license. To start by Linux license, it is released under the GPL license which offers the possibility to view, distribute and change the source code with an absolute freedom. The GPL license helps users to prevent the distribution of binary-only source. Which is the case with FreeBSD, which is licensed under BSD license. This kind of license is more restrictive and easily allows the distribution of binary-only source. The BSD license is more permissive that the GPL since no derivative work is required to maintain the licensing terms. Means any user can use, distribute and modify the code without need to have the previous version of code before changing made. They only need to have the original license of BSD. -- Depending on the needs of each user, a selection can be made between those two types of license. Starting by BSD license which is more preferred by many users due to its special features. In fact, this license gives the possibility to sell each software licensed under it and retain the source code. Passing now to the GPL license, which requires some care of each user has a software released under it. -- To be able to choose between those two software, it is required to understand the licensing of both of them to more understand the methodology used in their development, to distinguish between their features and know which one will fit user’s need. - -#### Control #### - -- Since FreeBSD and Linux are released under two different type of license, the Linux Torvalds control the Linux kernel which is not the same case with FreeBSD which is not controlled. Personally, I prefer to use FreeBSD instead of Linux since it is an absolute free software, no control permission exists. But it is not enough there is other differences between Linux and FreeBSD, help you to choose between both of them. As an advice don’t choose one of them, follow us and then give us your choice. - -#### Operating system #### - -- Linux concentrates only on the kernel system which is not the case with FreeBSD while the whole operating system is maintained. The kernel and a set of software, some of them are developed by the FreeBSD team, are maintained as one unit. Indeed, the FreeBSD developers have the possibility to manage the essential operating systems remotely and efficiently. -- With Linux, there is some difficulties while managing a system. Since, the different components maintained will be from different sources so the Linux developers need to assemble them into groups having the same functionality. -- FreeBSD and Linux both of them give the possibility to have a big set of optional software and distributions but they differ on the way they are managed. With FreeBSD, they are managed together while with Linux they will be maintained separately. - -#### Hardware support #### - -- Concerning the hardware support, Linux is better than FreeBSD. It doesn’t mean that FreeBSD hasn’t the capability to support hardware as Linux. They differ just on the manner. It depends on your need as usual. So if you are searching for the newest solution, the FreeBSD will fit your needs but if you are looking for greatest graphs, it is better to use Linux. - -#### FreeBSD origin Vs Linux origin #### - -- The origin of each system is also another point of distinction between both of them. As I said previously Linux is an alternative of the operating system Unix, written by Linus Trovalds and assisted by a special group of hackers across the Net. Linux has all the needed features in a modern Unix, such as virtual memory, shared libraries, demand loading, proper memory management and many others. It is released under the General Public License. -- FreeBSD also shared many important features of its Unix heritage. FreeBSD as a type of the Berkeley Software Distribution, the distribution of the Unix developed at the University of California. The most important reason under developing BSD is to replace the AT&T operating system by an open source alternative giving the user the ability to use BSD without carry about the obtaining of the AT&T license. -- The problem of licensing, is the most important worry of developers. They try to offer the maximum open source clone of Unix. Which influences the choice of users regarding the degree of open source of each system as FreeBSD gives more freedom than Linux regarding its use since it is released under BSD license. - -#### Supported Package #### - -- From the user’s perspective, another difference between our two compared systems, is their availability and support of the packaged software and source installed software. The Linux distributions provide just the pre-compiled binary packages which is not the same case with FreeBSD, which has the pre-built packages and the build system for the compilation and installation through their available open source. Due to its ports, FreeBSD gives you the possibility to choose between the default making of pre-compiled packages and your ability to customize your software while it is compiled. -- Those ports enable you to build all the software available with FreeBSD. Furthermore, there is an hierarchy of organization all of them due to the directories /usr/ports where you can find the location of the source files and some documentation about the way to use FreeBSD correctly. -- The ports as mentioned give the possibility produce the packages version of software. Instead of having just the pre-compiled packages using Linux, FreeBSD gives you the possibility to have the source-built and the pre-packages software. You can manage your system using the two installation methods. - -#### FreeBSD Vs Linux common Tools #### - -- A huge number of common tools are available while using FreeBSD and are fully own made by the FreeBSD team. In contrast, the Linux tools are from the GNU that is why there is some control during their usage. -- The fact that FreeBSD is released under BSD license is so beneficial and useful. Since, you have the ability to maintain the core operating system, control the development of these applications. Same of those tools are similar to BSD and Unix tools from where they were derived which is not the same case with GNU suite, which want to just make them less backwards compatible. - -#### The Standard Shell #### - -- The tcsh shell is used by default with FreeBSD. Which is an evaluated version fo csh. Since, the FreeBSD is released under the BSD license, it is not recommended to use the bash shell which is a GNU component. The only difference between bash and tcsh shell consists on the scripting feature which can’t be made by tcsh. Indeed, the sh shell is more recommended for the FreeBSD use since it is more reliable and prevents some issues of scripting can be occurred using the tcsh or csh shell. - -#### A More Stratified Filesystem #### - -- As it was mentioned previously, base operating system and optional components can be easily distinguished using the FreeBSD system. Which causes some specification of their organization. In Linux, /bin, /sbin, /usr/bin, or usr/sbin are the directories for executable systems. With FreeBSD it is not the case. There are some additional specifications concerning their organization. The base system are putted in one of the directories mentioned above while the ports and packages are placed in /usr/local/bin or /usr/local/sbin. This methodology helps to recognize and distinguish between an application considered as a base system or a port. - -### Conclusion ### - -FreeBSD and Linux those two free and open source systems, share various similarities but they also differ in several points. The list giving above isn’t given to say that one of them is better than the other. In fact, FreeBSD and Linux, each one of them has its features and specifications that make it a special regarding the other. And you what is your opinion? Have you already used one on them or both? If yes what is your feedback and if no after reading our description what do you think? Sound off and give us and the fellow readers your opinion. - --------------------------------------------------------------------------------- - -via: https://www.unixmen.com/comparative-introduction-freebsd-linux-users/ - -作者:[anismaj][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:https://www.unixmen.com/author/anis/ diff --git a/translated/talk/20150309 Comparative Introduction To FreeBSD For Linux Users.md b/translated/talk/20150309 Comparative Introduction To FreeBSD For Linux Users.md new file mode 100644 index 0000000000..76368e1033 --- /dev/null +++ b/translated/talk/20150309 Comparative Introduction To FreeBSD For Linux Users.md @@ -0,0 +1,98 @@ +ԱȽϵķʽLinuxûFreeBSD +================================================================================ +![](https://1102047360.rsc.cdn77.org/wp-content/uploads/2015/03/FreeBSD-790x494.jpg) + +### ### + +BSDUNIX̳жĿǰUnixϵͳǻBSDġFreeBSDʹ㷺ĿԴа棨BSDа棩˼һһѿԴUnixϵͳǹƽ̨FreeBSDԴͨԿɵBSD֤LinuxкܶƵĵطǵóںܶ෽вͬ + +ĵಿ֯£FreeBSDڵһ֣FreeBSDLinuxƵڵڶ֣ǵڵۣǹܵۺܽһڡ + +### FreeBSD ### + +#### ʷ #### + +- FreeBSDĵһ汾1993꣬ĵһCD-ROMFreeBSD1.0Ҳ1993ꡣFreeBSD 2.1.01995귢һûʵIT˾ʹFreeBSDҺ⣬ǿгеһЩIBMNokiaNetAppJuniper Network + +#### ֤ #### + +- ֤FreeBSDԶֿԴ֤зµΪKernelĴBSD֤˷ʹú·FreeBSDľɡĴBSD֤зЩGPLCDDL֤ġ + +#### û #### + +- FreeBSDҪص֮һûʵϣFreeBSDΪʼWeb ServerFTPԼ·ȣֻҪзصɡFreeBSD֧ARMPowerPCMIPSx86x86-64ܹ + +### FreeBSDLinuxƴ ### + +FreeBSDLinuxѿԴʵϣǵûԺ׵ļ鲢޸Դ룬ûӵоԵɡңFreeBSDLinuxUnixϵͳǵںˡڲʹôʷϵAT&T Unix̳е㷨FreeBSDӸϸUnixϵͳLinuxΪѵUnixϵͳġ๤ӦöFreeBSDLinuxҵʵϣǼͬĹܡ + +⣬FreeBSDܹдLinuxӦá԰װһLinuxļݲ㣬ݲڱFreeBSDʱAAC Compact LinuxõͨѱLinuxݲFreeBSDϵͳлݳaac_linux.koͬFreeBSDǣLinux޷FreeBSD + +ע⵽ȻͬĿ꣬߻һЩ֮ͬһг + +### FreeBSDLinux ### + +Ŀǰڴû˵ûһѡFreeBSDLinux׼ΪźܶͬӦóΪǶUnixϵͳ + +һ£ǽгϵͳһЩҪIJ֮ͬ + +#### ֤ #### + +- ϵͳǵ֤LinuxGPL֤УΪûṩĶк޸ԴɣGPL֤ûжơFreeBSDBSD֤BSD֤GPLݣΪҪԸ֤ζκûܹʹá޸Ĵ룬ҲҪά֮ǰ֤ +- ֤ѡһ֡BSD֤ûʵϣ֤ʹûڱ֤ԴķԵͬʱԸ֤˵˵GPLҪÿʹԸ֤ûע⡣ +- Բ֤ͬѡҪ˽ǸԵ֤ԼǿеķۣӶ˽ԵѡʺԼġ + +#### #### + +- FreeBSDLinuxԲ֤ͬģLinus TorvaldsLinuxںˣFreeBSDȴLinuxͬδơҸ˸ʹFreeBSDLinuxΪFreeBSDǾɵûκοɵĴڡLinuxFreeBSDIJ֮ͬҽȲѡ񣬵ȶ걾ĺѡ + +#### ϵͳ #### + +- Linux۽ںϵͳFreeBSDͬFreeBSDϵͳάšFreeBSDں˺һFreeBSDŶӿΪһάʵϣFreeBSDԱܹԶҸЧĹIJϵͳ +- Linux棬ڹϵͳһЩѡڲͬɲͬԴάLinuxҪǻ㼯ܴﵽͬĹܡ +- FreeBSDLinuxûĿѡͷа棬ǹķʽͬFreeBSDͳһĹʽLinuxҪֱά + +#### Ӳ֧ #### + +- ˵Ӳ֧֣LinuxFreeBSDĸáⲻζFreeBSDûLinux֧ӲֻڹķʽͬͨˣѰµĽFreeBSDӦѰһĻʹLinux + +#### ԭFreeBSD Vs ԭLinux #### + +- ߵԭϵͳв֮ͬǰ˵ģLinuxһUnixϵͳLinux Torvaldsдϵ༫һЭʵֵġLinuxһִϵͳҪȫܣڴ桢⡢̬ءڴȡGPL֤ +- FreeBSDҲ̳UnixҪԡFreeBSDΪڼݴѧBSDһַа档BSDҪԭһԴϵͳAT&TϵͳӶûAT&T֤ʹõ +- ֤ǿĵ⡣ͼṩһ󻯿¡UnixĿԴϵͳӰûѡFreeBSDLinuxʹBSD֤зɡ + +#### ֵ֧ #### + +- ûĽǶһ߲ͬĵطԼԴ밲װĿԺ֧֡LinuxֻṩԤĶưFreeBSDͬṩԤİһṩԴͰװĹϵͳֲFreeBSDѡʹԤĬϣڱʱ +- ЩѡFreeBSDеңǵĹDzλģ/usr/portsҵԴļĵַԼһЩȷʹFreeBSDĵ +- ЩᵽĿѡ˲ͬ汾ĿԡFreeBSDͨԴ빹ԼԤLinuxһֻԤʹְװʽϵͳ + +#### FreeBSD Linux ù߱Ƚ #### + +- дijùFreeBSDϿãȤFreeBSDŶӵС෴ģLinuxGNUΪʲôʹһЩơ +- ʵFreeBSDõBSD֤dzáˣάIJϵͳЩӦóĿһЩǵ - BSDUnixĹߣͬGNU׼GNU׼ֻСݡ + +#### ׼ Shell #### + +- FreeBSDĬʹtcshcsh棬FreeBSDBSD֤У˲ʹGNU bash shellbashtcshtcshĽűܡʵϣǸƼFreeBSDʹsh shellΪӿɿԱһЩʹtcshcshʱֵĽű⡣ + +#### һӲλļϵͳ #### + +- ֮ǰᵽһʹFreeBSDʱϵͳԼѡԱ׵⵼һЩǵı׼Linux£/bin/sbin/usr/bin/usr/sbinǴſִļĿ¼FreeBSDͬһЩӵĶ֯Ĺ淶ϵͳ/usr/local/bin/usr/local/sbinĿ¼¡ַ԰ֻϵͳͿѡ + +### ### + +FreeBSDLinuxҿԴϵͳƵҲвͬ㡣гݲ˵ĸϵͳһáʵϣFreeBSDLinuxԼصͼʹϵͳôʲôأѾʹеijϵͳôΪǵĻķǷĻڶǵôԴĹ۵㡣 + +-------------------------------------------------------------------------------- + +via: https://www.unixmen.com/comparative-introduction-freebsd-linux-users/ + +ߣ[anismaj][a] +ߣ[wwy-hust](https://github.com/wwy-hust) +Уԣ[УID](https://github.com/УID) + + [LCTT](https://github.com/LCTT/TranslateProject) ԭ룬[Linuxй](http://linux.cn/) Ƴ + +[a]:https://www.unixmen.com/author/anis/ \ No newline at end of file From c6918c7ec2257968387ddfa8009e39379d65d116 Mon Sep 17 00:00:00 2001 From: martin qi Date: Fri, 3 Jul 2015 22:53:39 +0800 Subject: [PATCH 524/965] translating by martin --- sources/tech/20150401 ZMap Documentation.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20150401 ZMap Documentation.md b/sources/tech/20150401 ZMap Documentation.md index d2aa316c1f..b773fb4aaf 100644 --- a/sources/tech/20150401 ZMap Documentation.md +++ b/sources/tech/20150401 ZMap Documentation.md @@ -1,3 +1,5 @@ +translating... + ZMap Documentation ================================================================================ 1. Getting Started with ZMap From f1d7823522395edc01e2a17ac1dda6eafcc9b253 Mon Sep 17 00:00:00 2001 From: wxy Date: Thu, 2 Jul 2015 15:57:21 +0800 Subject: [PATCH 525/965] PUB:20150527 How to edit your documents collaboratively on Linux @ictlyh --- ...your documents collaboratively on Linux.md | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) rename {translated/tech => published}/20150527 How to edit your documents collaboratively on Linux.md (75%) diff --git a/translated/tech/20150527 How to edit your documents collaboratively on Linux.md b/published/20150527 How to edit your documents collaboratively on Linux.md similarity index 75% rename from translated/tech/20150527 How to edit your documents collaboratively on Linux.md rename to published/20150527 How to edit your documents collaboratively on Linux.md index 8fc469bf24..a49cb0ef13 100644 --- a/translated/tech/20150527 How to edit your documents collaboratively on Linux.md +++ b/published/20150527 How to edit your documents collaboratively on Linux.md @@ -1,12 +1,12 @@ -如何在 Linux 上协同编辑文档 +如何在 Linux 上 使用 ONLYOFFICE 协同编辑文档 ================================================================================ -> “多年前由一些高度紧张、强迫性助理开发的 Bulletin,只是共享文件夹中只有 Emily 和我可以访问的 Word 文档。同一时间我们只有一个人可以打开它并添加消息、想法,或者提问项目列表。然后我们再打印出更新版本并放到我桌子架上的剪贴板,并在退出时删除旧版本。”(Lauren Weisberger 称之为“穿 Prada 的女魔头”) +> “多年前由一些紧张兮兮的、带有强迫症的助理开发的 Bulletin,只是一个放在共享文件夹中只有 Emily 和我可以访问的 Word 文档而已。同一时间我们只有一个人可以打开它并添加消息、想法,或者给条目列表上增加问题。然后我们再打印出更新后的版本并放到我桌子架上的剪贴板,并在完成时删除旧的内容。”(——《穿普拉达的女王》,劳伦·魏丝伯格著 ) -直到今天仍然在使用这样的“协同编辑”,只有一个人可以打开共享文件,对其进行更改,然后告诉其它人什么时候修改了什么。 +直到今天人们仍然在使用这样的“协同编辑”,只有一个人可以打开共享文件,对其进行更改,然后告诉其它人什么时候修改了什么。 ONLYOFFICE 是一款集成了文档、电子邮件、事件、任务和客户关系管理工具的开源在线办公套件。 -使用 ONLYOFFICE 办公套件,一组人可以同时编辑文本、电子表格或者在浏览器上进行展示。直接在他们的文档上留下评论并用集成的聊天工具和其他人沟通。最后,保存文档为 PDF 文件用于之后的打印。作为额外的增强功能,它还能浏览文档历史并在如果需要时恢复到之前的修订/版本。 +使用 ONLYOFFICE 办公套件,一组人可以同时编辑文本、电子表格或者在浏览器上进行展示。可以直接在他们的文档上留下评论并用其中集成的聊天工具和其他人沟通。最后,可以保存文档为 PDF 文件并打印。作为额外的增强功能,它还能浏览文档历史并在如果需要时恢复到之前的修订/版本。 在这篇教程中,我会介绍如何使用 [免费版 ONLYOFFICE][1] 部署你自己的在线办公套件,免费版 ONLYOFFICE 是 ONLYOFFICE 在 GNU AGPL v3 协议下发布的自托管版本。 @@ -29,9 +29,9 @@ ONLYOFFICE 是一款集成了文档、电子邮件、事件、任务和客户关 也可以在 Linux 服务器上单独安装 [ONLYOFFICE 在线编辑器][6],并通过提供的 API 轻松地集成到你的站点或云应用。 -### 运行自托管在线 Office ### +### 运行自行托管的在线 Office ### -要打开你的在线 office,在你浏览器的地址栏输入 localhost(http://IP-Address/)。会打开欢迎页面: +要打开你的在线 office,在你浏览器的地址栏输入 localhost(http://IP地址/)。会打开欢迎页面: ![](https://farm9.staticflickr.com/8815/18116525656_795821c73b_c.jpg) @@ -63,11 +63,11 @@ ONLYOFFICE 是一款集成了文档、电子邮件、事件、任务和客户关 邀请的人只需要根据提供的链接就可以开始协同编辑文档。 -会自动用不用颜色的虚线将你的合作者编辑的文本段落标记出来。 +它会自动用不用颜色的虚线将你的合作者编辑的文本段落标记出来。 ![](https://farm8.staticflickr.com/7790/18139370292_7ef57aae8f_c.jpg) -只要你的其中一个合作者保存了他的/她的更改,你会看到在顶部工具栏左上角出现了一个注意标签,表示这里有更新。 +只要你的其中一个协作者保存了他/她的更改,你会看到在顶部工具栏左上角出现了一个提示标签,表示这里有更新。 ![](https://farm8.staticflickr.com/7778/18143984831_3dd42a9672_c.jpg) @@ -75,13 +75,13 @@ ONLYOFFICE 是一款集成了文档、电子邮件、事件、任务和客户关 ![](https://farm8.staticflickr.com/7796/17955172970_e53460b8a6_c.jpg) -#### STEP 4. 和合作者互动 #### +#### STEP 4. 和协作者互动 #### 要写评论,用鼠标选择一个文本段落,右击并从上下文菜单中选择 **Add comment** 选项。 ![](https://farm8.staticflickr.com/7771/17956640359_c4e2858dc8_c.jpg) -要和合作者实时互动,可以使用集成的聊天工具。**Chat** 面板会列出所有正在编辑文档的用户。点击左侧边栏的 **Chat** 图标打开它。在 **Chat** 面板的合适区域输入你的信息开始讨论。 +要和协作者实时互动,可以使用集成的聊天工具。**Chat** 面板会列出所有正在编辑文档的用户。点击左侧边栏的 **Chat** 图标打开它。在 **Chat** 面板的合适区域输入你的信息开始讨论。 ![](https://farm8.staticflickr.com/7794/18116394026_d93b00e4f8_c.jpg) @@ -97,7 +97,7 @@ ONLYOFFICE 是一款集成了文档、电子邮件、事件、任务和客户关 #### Tip #2. 在 iPad 上编辑文档 #### -为了在任意时刻添加更改到文档,我使用 iPad 的 ONLYOFFICE Documents 应用。你可以从 [iTune][7] 下载并安装它,然后你需要输入你的 ONLYOFFICE 地址、email 和密码来访问你的文档。功能设置几乎一样。 +要随时随地对文件进行修改,我使用 iPad 的 ONLYOFFICE Documents 应用。你可以从 [iTune][7] 下载并安装它,然后你需要输入你的 ONLYOFFICE 地址、email 和密码来访问你的文档。功能设置几乎一样。 为了评估 ONLYOFFICE 在线编辑器的功能,你可以使用供个人使用的 [云版本][8]。 @@ -107,7 +107,7 @@ via: http://xmodulo.com/edit-documents-collaboratively-linux.html 作者:[Tatiana Kochedykova][a] 译者:[ictlyh](https://github.com/ictlyh) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 24bbe452a5332b66aca98d05661796229b6f80ba Mon Sep 17 00:00:00 2001 From: wxy Date: Thu, 2 Jul 2015 16:34:10 +0800 Subject: [PATCH 526/965] PUB:20150601 How to monitor common services with Nagios @geekpi --- ... to monitor common services with Nagios.md | 60 +++++++++---------- 1 file changed, 29 insertions(+), 31 deletions(-) rename {translated/tech => published}/20150601 How to monitor common services with Nagios.md (70%) diff --git a/translated/tech/20150601 How to monitor common services with Nagios.md b/published/20150601 How to monitor common services with Nagios.md similarity index 70% rename from translated/tech/20150601 How to monitor common services with Nagios.md rename to published/20150601 How to monitor common services with Nagios.md index 2898a57ad0..4f6523f0ce 100644 --- a/translated/tech/20150601 How to monitor common services with Nagios.md +++ b/published/20150601 How to monitor common services with Nagios.md @@ -1,12 +1,12 @@ -如何用Nagios监控服务 +如何用 Nagios 监控通用服务 ================================================================================ Nagios内置了很多脚本来监控服务。本篇会使用其中一些来检查通用服务如MySql、Apache、DNS等等。 -为了保证本篇集中在系统监控,我们不会配置hostgroup或者模板,它们已经在 [前面的教程][1]中覆盖了,它们可以满足这些条件了。 +为了保证本篇集中在系统监控,我们不会在这里配置主机组或者模板,它们已经在 [前面的教程][1]中覆盖了,它们可以满足需要了。 ### 在命令行中运行Nagios ### -通常建议在添加到Nagios前现在命令行中运行Nagios服务检测脚本。它会给出执行是否成功以及脚本的输出将会看上去的样子。 +通常建议在添加到Nagios前,先在命令行中运行Nagios服务检测脚本。它会给出执行是否成功以及脚本的输出将会看上去的样子。 这些脚本存储在 /etc/nagios-plugins/config/ ,可执行文件在 /usr/lib/nagios/plugins/。 @@ -39,9 +39,9 @@ Nagios内置了很多脚本来监控服务。本篇会使用其中一些来检 - Server 1 (10.10.10.1) : MySQL, Apache2 - Server 2 (10.10.10.2) : Postfix, Apache2 -- Server 3 (10.10.10.3): DNS +- Server 3 (10.10.10.3) : DNS -首先,服务器被定义在了Nagios中。 +首先,这些服务器被定义在了Nagios中。 root@nagios:~# vim /etc/nagios3/conf.d/example.cfg @@ -79,43 +79,43 @@ Nagios内置了很多脚本来监控服务。本篇会使用其中一些来检 开始检测MySQL时,需要记住MySQL默认只监听回环接口127.0.0.1。这增加了数据库的安全。手动调节需要告诉MySQL该监听什么其他接口。下面是该怎么做。 -这个设置在所有的MySQL服务器上已经做了。 +这个设置要在所有的MySQL服务器上完成。 root@nagios:~# vim /etc/mysql/my.cnf -下面这行被注释掉了来监听所有接口。 +下面这行被注释掉以监听所有网络接口。 #bind-address = 127.0.0.1 -同样,MySQL将不会运行任何主机来连接到它。在本机和任意主机都创建了用户‘nagios’。这个用户接着在所有的数据库中被授予所有的权限,这将在会用在监控中。 +同样,MySQL也不会让任意主机来连接它。需要为localhost和“任意”主机创建MySQL用户‘nagios’,接着在所有的数据库中为这个用户授予ALL权限,会这将在会用在监控中。 下面的设置对所有的MySQL服务器都已经设置。 root@nagios:~# mysql -u root –p - ## MySQL root password here ## + ## MySQL root 密码 ## -'nagios@localhost'用户在MySQL服务器中创建了。 +在MySQL服务器中创建'nagios@localhost'用户。 mysql> CREATE USER 'nagios'@'localhost' IDENTIFIED BY 'nagios-pass'; mysql> GRANT ALL PRIVILEGES ON *.* TO 'nagios'@'localhost'; -'nagios@any-host'用户创建了。 +创建'nagios@任意主机'用户。(LCTT 译注:实际上这两个是同一个用户,只是分别授权给localhost和任意主机的访问;因为它们所用的密码的同一个,修改任何一个,另外一个也相应变化。) mysql> CREATE USER 'nagios'@'%' IDENTIFIED BY 'nagios-pass'; mysql> GRANT ALL PRIVILEGES ON *.* TO 'nagios'@'%'; mysql> FLUSH PRIVILEGES; -这使MySQL监听所有的接口,同样接受来自用户'nagios'的进入链接。 +这使MySQL监听所有的网络接口,同样接受来自用户'nagios'的进入连接。 -请注意,这种变化可能有安全隐患,所以需要说几句话: +请注意,这种修改可能有安全隐患,所以需要提示几点: -- 这个设置将会暴露MySQL给所有的接口,包括WAN。确保只有合法的网络访问是非常重要的。应该使用防火墙和TCP封装器等过滤器。 -- MySQL用户‘nagios’的密码应该非常强。如果只有几台Nagios服务器,那么应该创建'nagios@servername'用户而不是任意用户的'nagios@%'。 +- 这个设置将会暴露MySQL给所有的接口,包括外网。确保只有合法的网络访问是非常重要的。应该使用防火墙和TCP wrapper等过滤器。 +- MySQL用户‘nagios’的密码应该非常强。如果只有几台Nagios服务器,那么应该创建'nagios@服务器名'用户而不是任意用户的'nagios@%'。 -#### 对MySQL的NAgios配置 #### +#### 对MySQL的Nagios配置 #### -用下面的来做一些调整。 +按如下配置来做一些调整。 root@nagios:~# vim /etc/nagios3/conf.d/services_nagios2.cfg @@ -140,7 +140,7 @@ Nagios内置了很多脚本来监控服务。本篇会使用其中一些来检 ;check_mysql!userName!userPassword!databaseName } -这样,Nagios就可以同时监控MySQL服务器和数据库的可用性。 +这样,Nagios就可以同时监控MySQL服务器及其数据库的可用性。 ### 监控Apache服务器 ### @@ -148,7 +148,7 @@ Nagios同样也可以监控Apache服务。 #### Apache监控需要 #### -- 监控apache是否可用 +- 监控apache服务是否可用 这个任务非常简单因为Nagios有一个内置命令。 @@ -167,7 +167,7 @@ Nagios同样也可以监控Apache服务。 ### 监控DNS服务 ### -Nagios通过向DNS服务器查询一个完全合格域名(FQDN),或者使用dig工具来查询。默认用于FQDN的是www.google.com,但是这个可以按需改变。按照下面的文件修改来完成这个任务。 +Nagios通过向DNS服务器查询一个完全限定域名(FQDN),或者使用dig工具来查询。默认用于查询的FQDN的是www.google.com,但是这个可以按需改变。按照下面的文件修改来完成这个任务。 root@nagios:~# vim /etc/nagios-plugins/config/dns.cfg @@ -203,8 +203,7 @@ Nagios通过向DNS服务器查询一个完全合格域名(FQDN),或者使用 ### 监控邮件服务器 ### -Nagios可以监控不同的邮件服务组件如SMTP、POP、IMAP和mailq。之前提过,server-2设置了后缀邮件服务。Nagios将被配置来监控SMTP和邮件队列。 - +Nagios可以监控不同的邮件服务组件如SMTP、POP、IMAP和mailq。之前提过,server-2设置了Postfix邮件服务。Nagios将被配置来监控SMTP和邮件队列。 root@nagios:~# vim /etc/nagios3/conf.d/services_nagios2.cfg @@ -231,11 +230,11 @@ Nagios可以监控不同的邮件服务组件如SMTP、POP、IMAP和mailq。之 ### 基于端口自定义监控程序 ### -让我们假设下面的自定义程序同样运行在网络中,监听一个特定的端口。 +让我们假设如下定制程序同样运行在网络中,监听着一个特定的端口。 -- 测试1号服务器:自定义程序(TCP端口 12345) +- 测试1号服务器:定制程序(TCP端口 12345) -过一些小的调整,Nagios也可以帮助监控这个程序。 +做一些小的调整,Nagios也可以帮助我们监控这个程序。 root@nagios:~# vim /etc/nagios3/conf.d/services_nagios2.cfg @@ -248,12 +247,11 @@ Nagios可以监控不同的邮件服务组件如SMTP、POP、IMAP和mailq。之 check_command check_tcp!12345 } -在完结之前,Nagios可以监控网络很多其他的方面。存储在/etc/nagios-plugins/config/中的脚本为Nagios很棒的能力。 +在结束之前的提示,Nagios可以监控网络很多其他的方面。存储在/etc/nagios-plugins/config/中的脚本为Nagios提供了很棒的能力。 +一些Nagios提供的脚本被仅限于本地服务器,比如,服务器负载、进程并发数量、登录用户数量等。这些检查可以提供Nagios服务器内有用的信息。 -一些Nagios提供的脚本被限制在本地服务器。例子包含服务负载、进程并发数量、登录用户数量。这些检查可以提供Nagios服务器内有用的信息。 - -希望这篇有用。 +希望这篇文章对你有用。 -------------------------------------------------------------------------------- @@ -261,9 +259,9 @@ via: http://xmodulo.com/monitor-common-services-nagios.html 作者:[Sarmed Rahman][a] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 [a]:http://xmodulo.com/author/sarmed -[1]:http://xmodulo.com/install-configure-nagios-linux.html \ No newline at end of file +[1]:https://linux.cn/article-2436-1.html \ No newline at end of file From 9b62c5381b443effac4c3e0a0e174796c4a4fd07 Mon Sep 17 00:00:00 2001 From: wxy Date: Thu, 2 Jul 2015 22:37:56 +0800 Subject: [PATCH 527/965] PUB:20150601 How to monitor Linux servers with SNMP and Cacti @GOLinux --- ...nitor Linux servers with SNMP and Cacti.md | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) rename {translated/tech => published}/20150601 How to monitor Linux servers with SNMP and Cacti.md (82%) diff --git a/translated/tech/20150601 How to monitor Linux servers with SNMP and Cacti.md b/published/20150601 How to monitor Linux servers with SNMP and Cacti.md similarity index 82% rename from translated/tech/20150601 How to monitor Linux servers with SNMP and Cacti.md rename to published/20150601 How to monitor Linux servers with SNMP and Cacti.md index cc76945bd8..68bf72ad98 100644 --- a/translated/tech/20150601 How to monitor Linux servers with SNMP and Cacti.md +++ b/published/20150601 How to monitor Linux servers with SNMP and Cacti.md @@ -1,12 +1,12 @@ -使用SNMP和Cacti监控Linux服务器 +使用 SNMP 和 Cacti 监控 Linux 服务器 ================================================================================ -SNMP(或者叫简单网络管理协议)用于收集设备内部发生的数据,如负载、磁盘状态、带宽之类。像Cacti这样的网络监控工具用这些数据来生成图标以达到监控的目的。 +SNMP(简单网络管理协议)用于收集设备内部发生的数据,如负载、磁盘状态、带宽之类。像Cacti这样的网络监控工具用这些数据来生成图标以达到监控的目的。 在一个典型的Cacti和SNMP部署中,会有一台或多台启用了SNMP的设备,以及一台独立的用来从那些设备收集SNMP回馈的监控服务器。请记住,所有需要监控的设备必须启用SNMP。在本教程中,出于演示目的,我们将在同一台Linux服务器上配置Cacti和SNMP。 ### 在Debian或Ubuntu上配置SNMP ### -要安装SNMP代理(snmpd)到基于Debian的系统,请运行以下命令: +要在基于Debian的系统上安装SNMP代理(snmpd),请运行以下命令: root@server:~# apt-get install snmpd @@ -16,10 +16,10 @@ SNMP(或者叫简单网络管理协议)用于收集设备内部发生的数 ---------- - # this will make snmpd listen on all interfaces + # 使snmpd 监听再所有接口上 agentAddress udp:161 - # a read only community 'myCommunity' and the source network is defined + # 定义一个只读的 community 'myCommunity' 和源网络 rocommunity myCommunity 172.17.1.0/24 sysLocation Earth @@ -41,10 +41,10 @@ SNMP(或者叫简单网络管理协议)用于收集设备内部发生的数 ---------- - # A user 'myUser' is being defined with the community string 'myCommunity' and source network 172.17.1.0/24 + # 定义一个使用 community 'myCommunity' 和源网络 172.17.1.0/24 的用户 'myUser' com2sec myUser 172.17.1.0/24 myCommunity - # myUser is added into the group 'myGroup' and the permission of the group is defined + # 将 myUser 加到 'myGroup' 组,定义组权限 group myGroup v1 myUser group myGroup v2c myUser view all included .1 @@ -69,7 +69,7 @@ SNMP可以通过运行snmpwalk命令进行测试。如果SNMP已经配置成功 iso.3.6.1.2.1.1.2.0 = OID: iso.3.6.1.4.1.8072.3.2.10 iso.3.6.1.2.1.1.3.0 = Timeticks: (2097) 0:00:20.97 - ~~ OUTPUT TRUNCATED ~~ + ~~ 输出截断 ~~ iso.3.6.1.2.1.92.1.1.2.0 = Gauge32: 1440 iso.3.6.1.2.1.92.1.2.1.0 = Counter32: 1 @@ -79,9 +79,9 @@ SNMP可以通过运行snmpwalk命令进行测试。如果SNMP已经配置成功 ### 配置带有SNMP的Cacti ### -在本教程中,我们将在同一台Linux服务器上设置Cacti和SNMP。所以,去[安装Cacti][2]到刚刚配置SNMP的Linux服务器上吧。 +在本教程中,我们将在同一台Linux服务器上设置Cacti和SNMP。所以,到刚刚配置SNMP的Linux服务器上去[安装Cacti][2]吧。 -安装完后,Cacti网页接口可以通过“http://172.17.1.44/cacti”来访问,当然,在你的环境中,请将IP地址换成你的服务器的地址。 +安装完后,Cacti网页界面可以通过“http://172.17.1.44/cacti ”来访问,当然,在你的环境中,请将IP地址换成你的服务器的地址。 ![](http://farm6.staticflickr.com/5512/10972747655_0298f6ce6c_z.jpg) @@ -99,7 +99,7 @@ SNMP可以通过运行snmpwalk命令进行测试。如果SNMP已经配置成功 Cacti将根据先前配置的SNMP字符串注册设备。在本教程中,我们将只添加启用了SNMP的本地服务器。 -要添加设备,我们必须以管理员登录,然后转到Cacti管理员面板中的控制台。点击控制台 > 设备。 +要添加设备,我们必须以管理员登录,然后转到Cacti管理员面板中的控制台。点击 控制台 > 设备。 ![](http://farm8.staticflickr.com/7411/10972747855_b464972e56_z.jpg) @@ -111,7 +111,7 @@ Cacti将根据先前配置的SNMP字符串注册设备。在本教程中,我 ![](http://farm8.staticflickr.com/7400/10972747935_df03500de7_z.jpg) -由于设备已经添加,我们来指定想要创建的图表模板。你可以在该页的最后章节中找到本节内容。 +现在设备已经添加,我们来指定想要创建的图表模板。你可以在该页面的最后部分中找到这块内容。 ![](http://farm4.staticflickr.com/3773/10972747955_083101e6ab_z.jpg) @@ -123,7 +123,7 @@ Cacti将根据先前配置的SNMP字符串注册设备。在本教程中,我 ![](http://farm8.staticflickr.com/7374/10972920484_ed6b33b8b8_z.jpg) -### 接口图表和64位计数器 ### +### 接口的图表和64位计数器 ### 默认情况下,Cacti在SNMP查询中使用32位计数器。32位计数器对于大多数带宽图表而言已经足够了,但是对于超过100Mbps的带宽,它就无能为力了。如果已经知道带宽会超过100Mbps,建议你使用64位计数器。使用64位计数器一点也不麻烦。 @@ -173,9 +173,9 @@ via: http://xmodulo.com/monitor-linux-servers-snmp-cacti.html 作者:[Sarmed Rahman][a] 译者:[GOLinux](https://github.com/GOLinux) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 [a]:http://xmodulo.com/author/sarmed -[1]:http://xmodulo.com/install-configure-cacti-linux.html +[1]:https://linux.cn/article-4683-1.html From 23975d2cba65cc3ecbe2fcb78714e4c222be82d6 Mon Sep 17 00:00:00 2001 From: wxy Date: Thu, 2 Jul 2015 22:52:48 +0800 Subject: [PATCH 528/965] PUB:20150615 How to combine two graphs on Cacti @ictlyh --- ...0615 How to combine two graphs on Cacti.md | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) rename {translated/tech => published}/20150615 How to combine two graphs on Cacti.md (64%) diff --git a/translated/tech/20150615 How to combine two graphs on Cacti.md b/published/20150615 How to combine two graphs on Cacti.md similarity index 64% rename from translated/tech/20150615 How to combine two graphs on Cacti.md rename to published/20150615 How to combine two graphs on Cacti.md index db320b204e..78e52a0639 100644 --- a/translated/tech/20150615 How to combine two graphs on Cacti.md +++ b/published/20150615 How to combine two graphs on Cacti.md @@ -1,22 +1,22 @@ 如何在 Cacti 中合并两幅图片 ================================================================================ -[Cacti][1] 是一个很棒的开源网络监视系统,它广泛使用于图示网络元素,例如带宽、存储、处理器和内存使用。使用它的基于网络的接口,你可以轻松地创建和组织图。然而,默认并没有提供一些高级功能,例如合并图片、使用多个来源创建聚合图、迁移 Cacti 到另一台服务器。使用 Cacti 的这些功能你还需要一些经验。在该教程中,我们会看到如何在将两幅 Cacti 图片合并为一幅。 +[Cacti][1] 是一个很棒的开源网络监视系统,它广泛使用于图形化地展示网络元素,例如带宽、存储、处理器和内存使用。使用它的基于Web 的界面,你可以轻松地创建和组织各种图表。然而,它默认并没有提供一些高级功能,例如合并图片、使用多个来源创建聚合图形、迁移 Cacti 到另一台服务器。使用 Cacti 的这些功能你还需要一些经验。在该教程中,我们会看到如何在将两幅 Cacti 图片合并为一幅。 -考虑这个例子。在过去的 6 个月中,客户端 A 连接到了交换机 A 的端口 5。端口 5 发生了错误,因此客户端迁移到了端口 6。由于 Cacti 为每个接口/元素使用不同的图,客户端的带宽历史会分成端口 5 和端口 6。结果是对于一个客户端我们有两幅图片 - 一幅是 6 个月的旧数据,另一幅保存了后续的数据。 +看看这个例子。在过去的 6 个月中,客户端 A 连接到了交换机 A 的端口 5。端口 5 发生了错误,因此客户端迁移到了端口 6。由于 Cacti 为每个接口/元素使用不同的图,客户端的带宽历史会分成端口 5 和端口 6。结果是对于一个客户端我们有两幅图片 - 一幅是 6 个月的旧数据,另一幅保存了后续的数据。 -在这种情况下,我们实际上可以合并两幅图片将旧数据加到新的图中,使得用一个单独的图为一个用户保存历史的和新数据。该教程将会解释如何做到这一点。 +在这种情况下,我们实际上可以合并两幅图片将旧数据加到新的图中,使得用一个单独的图为一个用户保存历史的和新数据。本教程将会解释如何做到这一点。 -Cacti 将每幅图片的数据保存在它自己的 RRD(round robin database,循环数据库) 文件中。当请求一幅图片时,根据保存在对应 RRD 文件中的值生成图。在 Ubuntu/Debian 系统中,RRD 文件保存在 `/var/lib/cacti/rra`,在 CentOS/RHEL 系统中则是 `/var/www/cacti/rra`。 +Cacti 将每幅图片的数据保存在它自己的 RRD(round robin database,循环数据库)文件中。当请求一幅图片时,根据保存在对应 RRD 文件中的值生成图。在 Ubuntu/Debian 系统中,RRD 文件保存在 `/var/lib/cacti/rra`,在 CentOS/RHEL 系统中则是 `/var/www/cacti/rra`。 合并图片背后的思想是更改这些 RRD 文件使得旧 RRD 文件中的值能追加到新的 RRD 文件中。 ### 情景 ### -一个客户端的服务在 eth0 上运行了超过一年。由于硬件损坏,客户端迁移到了另一台服务器的 eth1 接口。我们想图示新接口的带宽,同时保留超过一年的历史数据。只在一幅图中显示客户端。 +一个客户端的服务在 eth0 上运行了超过一年。由于硬件损坏,客户端迁移到了另一台服务器的 eth1 接口。我们想展示新接口的带宽,同时保留超过一年的历史数据。该客户端希望只在一幅图中显示。 ### 确定图的 RRD 文件 ### -图合并的首个步骤是确定和图关联的 RRD 文件。我们可以通过以调试模式打开图检查文件。要做到这点,在 Cacti 的菜单中: 控制台 > 管理图 > 选择图 > 打开图调试模式。 +图合并的首个步骤是确定与图相关联的 RRD 文件。我们可以通过以调试模式打开图检查文件。要做到这点,在 Cacti 的菜单中: 控制台 > 管理图 > 选择图 > 打开图调试模式。 #### 旧图: #### @@ -26,14 +26,14 @@ Cacti 将每幅图片的数据保存在它自己的 RRD(round robin database,循 ![](https://farm4.staticflickr.com/3674/18634036918_5c4118c4b9_c.jpg) -从样例输出(基于 Debian 系统)中,我们可以确定两幅图片的 RRD 文件: +从样例输出(基于 Debian 系统)中,我们可以确定两幅图片的 RRD 文件: - **旧图**: /var/lib/cacti/rra/old_graph_traffic_in_8.rrd - **新图**: /var/lib/cacti/rra/new_graph_traffic_in_10.rrd ### 准备脚本 ### -我们会用一个 [RRD 剪接脚本][2] 合并两个 RRD 文件。下载该 PHP 脚本,并安装为 /var/lib/cacti/rra/rrdsplice.php (Debian/Ubuntu 系统) 或 /var/www/cacti/rra/rrdsplice.php (CentOS/RHEL 系统)。 +我们会用一个 [RRD 剪接脚本][2] 来合并两个 RRD 文件。下载该 PHP 脚本,并安装到 /var/lib/cacti/rra/rrdsplice.php (Debian/Ubuntu 系统) 或 /var/www/cacti/rra/rrdsplice.php (CentOS/RHEL 系统)。 下一步,确认 Apache 用户拥有该文件。 @@ -49,7 +49,7 @@ Cacti 将每幅图片的数据保存在它自己的 RRD(round robin database,循 chown($finrrd, "www-data"); -在 CentOS 或 RHEL 系统中,运行下面的命令: +在 CentOS 或 RHEL 系统中,运行下面的命令即可: # chown apache:apache rrdsplice.php @@ -72,7 +72,7 @@ Cacti 将每幅图片的数据保存在它自己的 RRD(round robin database,循 ![](https://farm6.staticflickr.com/5493/18821787015_6730164068_b.jpg) -总之,该教程显示了如何简单地将两幅 Cacti 图片合并为一幅。当服务迁移到另一个设备/接口,我们希望只处理一幅图片而不是两幅时,这个小技巧非常有用。该脚本非常方便,因为它可以不管源设备合并图片,例如 Cisco 1800 路由器和 Cisco 2960 交换机。 +总之,该教程显示了如何简单地将两幅 Cacti 图片合并为一幅。当服务迁移到另一个设备/接口,我们希望只处理一幅图片而不是两幅时,这个小技巧非常有用。该脚本非常方便,因为它可以不管源设备是不是相同都可以合并图片,例如 Cisco 1800 路由器和 Cisco 2960 交换机。 希望这些能对你有所帮助。 @@ -82,10 +82,10 @@ via: http://xmodulo.com/combine-two-graphs-cacti.html 作者:[Sarmed Rahman][a] 译者:[ictlyh](https://github.com/ictlyh) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 [a]:http://xmodulo.com/author/sarmed -[1]:http://xmodulo.com/install-configure-cacti-linux.html +[1]:https://linux.cn/article-5746-1.html [2]:http://svn.cacti.net/viewvc/developers/thewitness/rrdsplice/rrdsplice.php \ No newline at end of file From 5a6690c3a62ba9a7f9f3194966bcd6ffd892c2ba Mon Sep 17 00:00:00 2001 From: wxy Date: Fri, 3 Jul 2015 10:06:11 +0800 Subject: [PATCH 529/965] PUB:20150610 How to secure your Linux server @KayGuoWhu --- ...0150610 How to secure your Linux server.md | 53 ++++++++++--------- 1 file changed, 28 insertions(+), 25 deletions(-) rename {translated/tech => published}/20150610 How to secure your Linux server.md (78%) diff --git a/translated/tech/20150610 How to secure your Linux server.md b/published/20150610 How to secure your Linux server.md similarity index 78% rename from translated/tech/20150610 How to secure your Linux server.md rename to published/20150610 How to secure your Linux server.md index ef34eea398..e6fcb4449a 100644 --- a/translated/tech/20150610 How to secure your Linux server.md +++ b/published/20150610 How to secure your Linux server.md @@ -1,15 +1,14 @@ -Linux服务器安全攻略 +Linux 服务器安全技巧 ================================================================================ -> 一台服务器由大量功能各异的部件组成,这一点使得很难根据每个人的需求去提供定制的解决方案。这篇文章尽可能涵盖一些有所裨益的小技巧来帮助管理员保证服务器和用户安全。 毋庸置疑,对于系统管理员,提高服务器的安全性是最重要的事情之一。因此,也就有了许多针对这个话题而生的文章、博客和论坛帖子。 一台服务器由大量功能各异的部件组成,这一点使得很难根据每个人的需求去提供定制的解决方案。这篇文章尽可能涵盖一些有所裨益的小技巧来帮助管理员保证服务器和用户安全。 -有一些常识是每个系统管理员都应该烂熟于心的,所以下面的几点在后文将不会提及: +有一些常识是每个系统管理员都应该烂熟于心的,所以下面的几点在本文将不会提及: - 务必保证系统是**最新的** -- 经常更换密码 - 使用数字、阿拉伯字母和非阿拉伯字母的符号组合 +- 经常更换密码 - 使用数字、字母和非字母的符号组合 - 给予用户**最小**的权限,满足他们日常使用所需即可 - 只安装那些真正需要的软件包 @@ -17,7 +16,7 @@ Linux服务器安全攻略 ### 更改SSH默认端口 ### -在搭建好一台全新的服务器后要做的第一件事情就是更改SSH的默认端口。这个小小单的改动能够使你的服务器避免受到成千上万的暴力攻击(译者注:不更改默认端口相当于黑客们知道你家的门牌号,这样他们只需要一把一把的试钥匙就可能打开你家的锁)。 +在搭建好一台全新的服务器后要做的第一件事情就是更改SSH的默认端口。这个小小的改动能够使你的服务器避免受到成千上万的暴力攻击(LCTT 译注:不更改默认端口相当于黑客们知道你家的门牌号,这样他们只需要一把一把的试钥匙就可能打开你家的锁)。 要更改默认的SSH端口,先打开sshd_config文件: @@ -35,7 +34,7 @@ Linux服务器安全攻略 接下来的一步是: -### 使用SSH密钥 ###、 +### 使用SSH密钥认证 ### 在通过SSH访问服务器时,使用SSH密钥进行认证是尤其重要的。这样做为服务器增加了额外的保护,确保只有那些拥有密钥的人才能访问服务器。 @@ -43,7 +42,7 @@ Linux服务器安全攻略 ssh-keygen -t rsa -你会看到下面的输出,询问要将密钥写到哪一个文件,并且设置一个密码: +你会看到下面的输出,询问要将密钥写到哪一个文件里,并且设置一个密码: Generating public/private rsa key pair. Enter file in which to save the key (/root/.ssh/id_rsa): my_key @@ -60,7 +59,7 @@ my_key my_key.pub -接下来把my_key.pub拷贝到~/.ssh/authorized_key中 +接下来把my\_key.pub拷贝到~/.ssh/authorized\_key中 cp my_key.pub ~/.ssh/authorized_keys @@ -72,7 +71,7 @@ my_key.pub ### 关闭SSH的密码认证 ### -既然已经有了SSH密钥,那么关闭SSH的密码认证就很安全了。再次打开并编辑sshd_config,按如下设置: +既然已经有了SSH密钥,那么关闭SSH的密码认证就会更安全了。再次打开并编辑sshd_config,按如下设置: ChallengeResponseAuthentication no PasswordAuthentication no @@ -84,7 +83,7 @@ my_key.pub /etc/sudoers/ -可以使用如**visudo**这样的命令编辑文件,推荐使用这个命令,因为它会在关闭文件之前检查任何可能出现的语法错误。当你在编辑文件时出错了,这就很有用了。 +推荐使用如**visudo**这样的命令编辑该文件,因为它会在关闭文件之前检查任何可能出现的语法错误。当你在编辑文件时出错了,这就很有用了。 接下来赋予某个用户root权限。在本文中,使用用户**sysadmin**。确保在编辑后这个文件时使用的用户是系统已有的用户。找到下面这行: @@ -107,6 +106,8 @@ my_key.pub (4) 这个用户可以使用的命令 +(LCTT 译注:所以上面的配置是意思是:root 用户可以在任何终端担任任何用户,执行任何命令。) + 使用这个配置可以给用户访问一些系统工具的权限。 这时,可以放心保存文件了。 @@ -135,7 +136,7 @@ my_key.pub wget https://download.configserver.com/csf.tgz tar -xzf csf.tgz - csf + cd csf sh install.sh 只需等待安装程序完成,然后编辑CSF的配置文件: @@ -148,25 +149,25 @@ my_key.pub 下面要设置的就是服务器上允许通过的端口。在csf.conf中定位到下面的部分,根据需要修改端口: - # Allow incoming TCP ports + # 允许入站的 TCP 端口 TCP_IN = "20,21,25,53,80,110,143,443,465,587,993,995,16543" - # Allow outgoing TCP ports + # 允许出站的 TCP 端口 TCP_OUT = "20,21,22,25,53,80,110,113,443,587,993,995,16543" - # Allow incoming UDP ports + # 允许入站的 UDP 端口 UDP_IN = "20,21,53" - # Allow outgoing UDP ports - # To allow outgoing traceroute add 33434:33523 to this list + # 允许出站的 UDP 端口 + # 要允许发出 traceroute 请求,请加 33434:33523 端口范围到该列表 UDP_OUT = "20,21,53,113,123" -请根据需要逐一设置,推荐只使用那些需要的端口,避免设置对端口进行大范围设置。此外,也要避免使用不安全服务的不安全端口。比如只允许端口465和587来发送电子邮件,取代默认的SMTP端口25. +请根据需要逐一设置,推荐只使用那些需要的端口,避免设置对端口进行大范围设置。此外,也要避免使用不安全服务的不安全端口。比如只允许端口465和587来发送电子邮件,取代默认的SMTP端口25。(LCTT 译注:前提是你的邮件服务器支持 SMTPS) -**重要**:千万不要忘记允许自定义SHH端口。 +**重要**:千万不要忘记允许自定义的 ssh 端口。 -允许防火墙通过你的IP地址使其不被屏蔽,这一点很重要。IP地址定义在下面的文件中: +允许你的IP地址通过防火墙,而绝不被屏蔽,这一点很重要。IP地址定义在下面的文件中: /etc/csf/csf.ignore -被屏蔽的IP地址会出现在这个文件中: +被屏蔽了的IP地址会出现在这个文件中: /etc/csf/csf.deny @@ -184,13 +185,13 @@ my_key.pub 可以看到,尝试通过暴力法登录的IP地址都被屏蔽了,真是眼不见心不烦啊! -#### 锁住账户 #### +### 锁住账户 ### 如果某个账户在很长一段时间内都不会被使用了,那么可以将其锁住以防止其它人访问。使用如下命令: passwd -l accountName -当然,这个账户依然可以被root用户使用。 +当然,这个账户依然可以被root用户使用(LCTT 译注:可用 su 切换为该账号)。 ### 了解服务器上的服务 ### @@ -207,16 +208,18 @@ my_key.pub 然后使用下面的命令关闭服务: chkconfig service off + 或 systemctl disable service 在上面的例子中,把“service”替换成真正想要停止的服务名称。实例如下: chkconfig httpd off + 或 systemctl disable httpd -### 小结 ### +### 小结 ### -这篇文章的目的是涵盖一些通用的安全步骤以便帮助你保护服务器。你可以采取额外的方式去增强对服务器的保护。请记住保证服务器安全是你的责任,在维护服务器安全时尽量做出明智的选择,尽管并没有什么容易的方式去完成这件事情,而建立“完善的”安全需要花费大量的时间和测试直到达到想要的结果。 +这篇文章的目的是涵盖一些通用的安全步骤以便帮助你保护服务器。你可以采取更多方式去增强对服务器的保护。请记住保证服务器安全是你的责任,在维护服务器安全时尽量做出明智的选择,尽管并没有什么容易的方式去完成这件事情,而建立“完善的”安全需要花费大量的时间和测试直到达到想要的结果。 -------------------------------------------------------------------------------- @@ -224,7 +227,7 @@ via: http://www.linuxveda.com/2015/06/03/secure-linux-server/ 作者:[Marin Todorow][a] 译者:[KayGuoWhu](https://github.com/KayGuoWhu) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 377578a1da5ea7692f890f34df4fd903d98ea40a Mon Sep 17 00:00:00 2001 From: wxy Date: Sat, 4 Jul 2015 21:36:54 +0800 Subject: [PATCH 530/965] =?UTF-8?q?=E8=A1=A5=E5=85=85=E5=AE=8C=E6=88=90?= =?UTF-8?q?=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ll be the future of Linux without Linus.md | 187 ++++++++++++------ 1 file changed, 130 insertions(+), 57 deletions(-) diff --git a/translated/talk/20150618 What will be the future of Linux without Linus.md b/translated/talk/20150618 What will be the future of Linux without Linus.md index 09cd64b647..c880921853 100644 --- a/translated/talk/20150618 What will be the future of Linux without Linus.md +++ b/translated/talk/20150618 What will be the future of Linux without Linus.md @@ -1,116 +1,189 @@ -没有Linus,Linux的未来是什么样子? +没有 Linus,Linux 的未来是什么样子? ============================================================================== -![](http://i2.wp.com/www.linuxveda.com/wp—content/uploads/2015/06/linus—torvalds—painting.jpg) +![](http://i2.wp.com/www.linuxveda.com/wp-content/uploads/2015/06/linus-torvalds-painting.jpg) -这次采访是 Linux For You 杂志在2007年进行的,现在我们发表在这里是为了存档的目的。 +这次采访是《Linux For You》杂志在2007年进行的,现在我们发表在这里是为了存档的目的。 -**Q:对于Linux内核,未来的计划/道路/强化是怎样的?** +**Q:对于 Linux 内核,未来的计划/道路/提升是怎样的?** -Linus:我从来没有太多的预见性 — 与其从宏大的计划上看未来,我倾向于从一个相对短的时间框架,比如“几个月之后的事情”。我是一个忠实的‘细节成败论’的信仰者,如果你抓住了细节,大的事情也会大事化小,小事化没。 +Linus:我从来没有太多的预见性 — 与其从宏大的计划上看未来,我倾向于从一个相对短的时间框架,比如“几个月之后的事情”。我是一个忠实的‘细节成败论’的信仰者,如果你抓住了细节,再大的问题也会大事化小,小事化无。 -所以,对于五年后内核会是什么样,我真的没有任何大眼光 — 仅仅是一个非常普遍的计划,确保我们对其保持关注。实际上,对于我个人来说,我最担心的事情之一甚至不是技术问题,而是确保‘进程’工作,这样人们才可以相互协作好。 +所以,对于五年后内核会是什么样,我真的没有任何远见 — 仅仅是一个非常普遍的计划,确保我们对其保持关注。实际上,对于我个人来说,我最担心的事情之一甚至不是技术问题,而是确保这个‘过程’正常,这样人们才可以相互协作好。 -**Q:你怎么看Linux和Solaris之间的关系在未来的发展?它会如何使用户受益?** +**Q:你怎么看 Linux 和 Solaris 之间的关系在未来的发展?它会如何使用户受益?** -Linus:我并不能看到整个重叠的地方,除了我认为Solaris会开始使用更过Linux用户磁盘工具(显然我自己来说没有太多关注这个 — 我真的只关心内核)。Linux的桌面比起传统Solaris拥有的好多了,而且我希望Solaris移植越来越多的Linux的东西,朝着一个更加类Linux的模型前进。 +Linus:我并不能看到整个重叠的地方,除了我认为 Solaris 会开始使用更多的 Linux 用户空间的工具(显然对我自己来说没有太多关注这个 — 我真的只关心内核)。Linux 的桌面比起传统 Solaris 拥有的好多了,而且我希望 Solaris 移植越来越多的Linux的东西,朝着一个更加类 Linux 的模型前进。(LCTT 译注:时至今日,我们还需要讨论 Solaris 吗?/cry ) -从纯内核方面讲,证书的差异意味着没有太多的合作,但是如果看到这种情况改变会很有趣。Sun已经声明在GPL(v2或v3)下授权Solaris,如果这种证书差异消失,那么会导致一些有趣的技术出现。但对此,我持待见态度。 +从纯内核方面讲,许可证的差异意味着没有太多的合作,但是如果看到这种情况改变会很有趣。Sun 已经声明在 GPL(v2 或 v3)下授权 Solaris,如果这种许可证差异消失,那么会导致一些有趣的技术出现。但对此,我持观望态度。 -**Q:现在GPL v3已经完成并发布了,你是否预见有任何情况会激起你开始移植内核到Solaris上去?或者,从你的角度看,它是否很糟糕以至于你从来没考虑过他?** +**Q:现在 GPL v3 已经完成并发布了,你是否预见有什么情况会鼓励你开始移植内核到 Solaris 上去?或者,从你的角度看,它是否很糟糕以至于你从来没考虑过它?** -Linus:我觉得相比于早先的草稿,v3有了很多提高,并且我也认为它不是一个糟糕的证书。我只是认为它没有GPLv2一般的‘伟大’。 +Linus:我觉得相比于早先的草稿,v3 有了很多提高,并且我也认为它不是一个糟糕的许可证。我只是认为它没有 GPLv2一般的‘伟大’。 -所以,由于没有了GPLv2,我会看见自己将会使用GPLv3。但是,自从我有了一个更好的选择,我为什么不应该考虑一下呢? +所以,由于没有了 GPLv2,我觉得自己将会使用 GPLv3。不过,如果我有了一个更好的选择,我为什么不应该考虑一下呢? -这就是说,我努力保持实用主义精神,并且我认为GPLv3比起GPLv2不是一个好证书这件事不是一个‘黑与白’的问题。这是一个平衡做法。如果GPLv3有其他的优点,可能那些优点会在很大程度上倾斜喜爱GPLv3的天平。 +这就是说,我努力保持实用主义精神,并且我认为 GPLv3 不像 GPLv2 一样好这件事并不是一个‘非黑即白’的问题。这是一个平衡做法。如果 GPLv3 有其他的优点,可能那些优点会在很大程度上扭转喜爱 GPLv3 的天平。 -恕我直言,我并没有看到任何优点,但是如果Solaris真的在GPLv3下发布,可能避免不必要的不兼容证书这条足够称为一个优点,可能也会值得去尝试重新许可Linux的内核放在GPLv3下。 +恕我直言,我并没有看到任何优点,但是如果 Solaris 真的在 GPLv3 下发布,可能避免不必要的非兼容的许可证这条足够称为一个优点,可能也许值得去尝试将Linux的内核重新在 GPLv3 许可证下发布。 -不要误解我 — 我认为这是不大可能的。但是我确实想澄清我本质上不是一个证书偏执者。我认为GPLv2是毫无疑问的好证书,但是证书不是一切。 +不要误解我 — 我认为这是不大可能的。但是我确实想澄清我本质上不是一个许可证偏执者。我认为 GPLv2 是毫无疑问的好许可证,但是许可证并不是一切。 -总的来说,我使用很多其他证书下的程序。我可能没有把我自己做的一个项目放在BSD(或X11—MIT)证书下,但是我认为它是一个伟大的证书,对于其他项目来说,它可能是最佳的选择。 +总的来说,我使用很多其他许可证下的程序。我可能没有把一个我自己做的项目放在 BSD(或 X11—MIT)许可证下,但是我认为它是一个伟大的许可证,对于其他项目来说,它可能是最佳的选择。 -**Q:目前有没有任何印度人,你想特别提出作为Linux内核的关键贡献者?** +**Q:目前有没有任何你想特别提出作为 Linux 内核的关键贡献者的印度人?** -Linus:我不得不承认,我并没有与实际认识的来自印度的任何人直接工作。那就是说,我应该稍微澄清下:我已经非常有意识地努力建立一个规模庞大的内核开发团队,这样我不用以独自地工作而告终。 +(LCTT 译注:本篇访谈中提到多次印度,是因为访谈者是印度人。) -我非常相信大多数人基本上被束缚起来了,只对很少的人十分了解(你最亲近的家人和朋友),我也努力构造这样一个开发模型影响这种状况:通过一个‘开发者网络’,人们可以在此互动,可能是与一批你信任的人,而且那些人反过来与他们信任的一群人互动。 +Linus:我不得不承认,我并没有与实际认识的来自印度的任何人直接工作。换句话说,我应该稍微澄清下:我已经非常有意识地努力建立一个规模庞大的内核开发团队,这样我不用以独自地工作而告终。 -所以,当我偶然与上百个开发者联系,他们发给我一两个随机的补丁,我已经努力去建立这样一个环境,在这里我做的一堆事,发生在我熟知的人组成的一个较小的集合间,仅仅因为我认为那就是人们工作的方式。当然也是我喜欢工作的方式。 +我非常相信大多数人的社交基本上是受限制的,只对很少的人十分了解(你最亲近的家人和朋友),我也努力构造这样一个开发模型影响这种状况:通过一个‘开发者网络’,人们可以在此互动,可能是与一批你信任的人,而且那些人反过来与他们信任的一群人互动。 -同时,坦白地说,我甚至不知道许多与我一起工作的人生活在哪里。位置成了十分次要的东西。所以我很确信与我工作最亲密的前10—15个人中,没有印度的,可能这话稍后传到公众耳里,然后被指出确实有一些人来自那里! +所以,当我偶然会与上百个开发者联系,他们发给我一两个随机的补丁,我已经努力去建立这样一个环境,在这里我做的一堆事,发生在我熟知的人组成的一个较小的群体间,仅仅因为我认为那就是人们工作的方式。当然也是我喜欢工作的方式。 -**Q:自从Linux的内核开发对你依赖如此严重以来,你如何计划组织/重组,让它在没有你的情况下继续发展,假设你决定花更多的时间在你自己的生活和家庭上面?** +同时,坦白地说,我甚至不知道许多与我一起工作的人生活在哪里。地理位置成了十分次要的东西。所以我很确信与我工作最亲密的前10—15个人中,没有印度的,可能这话稍后传到公众耳里,然后被指出确实有一些人来自那里! -Linus:现在Linux比我大得多了,为了这个实现我已经工作了很长时间。是的,我仍然十分亲切地身在其中,而且我对其有着想当大的日常影响,我最终会是这样一个人,在某种程度上,扮演着许多内核开发活跃者的中心点的角色;但是 — 我不会说Linux“严重依赖”于我。 +**Q:因为 Linux 的内核开发对你依赖如此严重,你如何计划组织或重组,让它在没有你的情况下继续发展,假设你决定花更多的时间在你自己的生活和家庭上面?** -所以,如果我得了心脏病并且明天就死了(很高兴没这种可能:我显然在任何方面都还健康),人们肯定会注意到,但是有成千上万的人为内核工作,并且不止一两个人能够接替我,还少有困惑。 +Linus:现在 Linux 比我重要得多,为了今天这一步我已经工作了很长时间。是的,我仍然十分密切地参与其中,而且我对其有着想当大的日常影响,我最终会是这样一个人——在某种程度上,扮演着许多内核开发活跃者的中心;但是,我不会说Linux“严重依赖”于我。 -**Q:印度是软件工程师的主要产地之一,当然我们没有在Linux领域做太多贡献。你觉得什么是保持印度人在Linux领域变得具有前瞻性的?如果我们鼓励印度人参与并为Linux做很大的贡献,你觉得如何?假如你有一个在印度的粉丝;你会用你的形象来启迪那些爱好者吗?** +所以,如果我得了心脏病并且明天就死了(很高兴没这种可能:我显然在任何方面都还健康),人们肯定会注意到,但是有成千上万的人为内核工作,并且不止一两个人能够没有什么困难地接替我。 -Linus:对我来说,这确实是一个不好回答的问题。进入开源是如此一个底层结构(网络接入,教育,你说的),信息流和简单的文化的复杂组合,我甚至不能去猜测最大的障碍会是什么。 +**Q:印度是软件工程师的主要产地之一,当然我们没有在 Linux 领域做太多贡献。你觉得什么是让印度人在Linux领域变得主动的?如果我们鼓励印度人参与并为Linux做更大的贡献,你觉得如何?假如你有一个在印度的粉丝;你会用你的形象来顾问那些爱好者吗?** -在很多方面,至少那些在印度含英语文化的地方,应该有一个相对容易的方式参与Linux和其他开源项目,如果仅仅是由于语言门槛的话。当然比起亚洲的许多地方,甚至欧洲的一些地方要容易些。 +Linus:对我来说,这确实是一个不好回答的问题。参与开源取决于两方面的基础条件(互联网和教育,如你说的):信息流和文化,我甚至不知道这其中哪个是最大的障碍。 -当然,有一些人,并不等同于印度的大部分群体,而且我自己关于印度的情况也知道不多,甚至没法做出一点半路聪明猜测最好的前路是什么。我猜一个热情的本地用户社区一直是最好的途径,我认为你们已经拥有这样的社区了。 +在很多方面,至少那些在印度讲英语文化的地方,参与 Linux 和其他开源项目是相对容易的,如果仅仅是由于语言门槛的话。这当然比起亚洲的许多地方,甚至欧洲的一些地方要容易些。 -至于我的‘形象’,我自己不以为然。我不是一个伟大的公众演讲者,而且我最近些年已经避免出游,因为被看做符号‘形象’让我很不自在。我就是一个工程师而已,而且我仅仅是喜欢我做的事情,并与社会上其他人一起工作。 +当然,这只是一些人,并不等同于印度的大部分群体,而且我自己关于印度的情况也知道不多,甚至没法不太负责的猜测最好的途径是什么。我猜一个热情的本地用户社区一直是最好的途径,我认为你们已经拥有这样的社区了。 -**Q:什么样的理由会让你考虑去看看印度?** +至于我的‘形象’,我自己不以为然。我不是一个伟大的公众演讲者,而且我最近些年已经避免出游,因为被看做符号化的‘形象’让我很不自在。我就是一个工程师而已,而且我仅仅是喜欢我做的事情,并与社会上其他人一起工作。 -Linus:如第一个回答中提到,我完全地讨厌公开演讲,所以我才想避免开会等等这些事。我更愿意某天去印度度个假,但是如果我这样做,我可能悄悄地干 — 出行之前不告诉任何人,仅仅作为一个游客去游览印度! +**Q:什么样的理由会让你考虑去访问印度?** -**Q:最近,你好像在抨击Subversion与CVS,质问他们的基础架构。现在你已经从Subversion和CVS社区那里得到回应,你仍然在坚持自己正确,或者没有被说服吗?** +Linus:如第一个回答中提到,我十分讨厌公开演讲,所以我才想避免开会等等这些事。我更愿意某天去印度度个假,但是如果我这样做,我可能悄悄地干 — 出行之前不告诉任何人,仅仅作为一个游客去游览印度!(LCTT 译注:所以 Linus 不来中国的道理是同样的,除非世界性的 LinuxCon 在中国召开一次。) + +**Q:最近,你好像在抨击 Subversion 与 CVS,质问他们的基础架构。现在你已经从 Subversion 和 CVS 社区那里得到回应,你仍然在坚持自己正确,或者没有被说服吗?** Linus:因为我发现这个争论很有趣,所以我想做一个强硬的声明。换句话说,我确实‘喜欢’争论。并不是不经思考的,但是我确实想要让争论更热烈些,而不仅仅是完全的柏拉图式的。 -做出强硬的争论有时会导致一个非常合理的反驳,然后我会很高兴地说:“噢,好吧,你是对的。” +做出强硬的争论有时会引来一个非常合理的反驳,然后我会很高兴地说:“噢,好吧,你是对的。” -但是话说回来,对SVN/CVS并不会发生这种情况。我怀疑很多人真的不是很喜欢CVS,所以我真的不期望任何人去坚持CVS是一切,而不是一个老旧的系统。当我知道少数人确实这样争论了,我之前就不该那么不礼貌地反对SVN(嘿,这是公平的 — 我真的不是一个非常礼貌的家伙!),我认为不是任何人都可以争论SVN是‘好的’。 +但是话说回来,对 SVN/CVS 并不会发生这种情况。我怀疑很多人并不是真的很喜欢 CVS,所以我真的不觉得会有谁坚持认为 CVS 就是一切,而不是一个老旧系统。要是我知道少数人确实这样争论过了,我之前就不该那么不礼貌地反对 SVN(嘿,这么说没错 — 我真的不是一个非常礼貌的家伙!),我不认为任何人都可以争论 SVN 是‘好的’。 -我认为,SVN就是一个‘好过头’的经典案例。人们过去经常使用SVN,并且它也‘很好’,用途广泛,但是它的好过头完全如DOS与Windows也‘好过头’一样。不是什么伟大的技术,只是普遍适用而已,同时它对人们来说运行良好,看着十分熟悉。但是很少有人以此为傲,或者对其有兴奋感。 +我认为,SVN 就是一个‘足够好’的经典案例。人们过去经常使用 SVN,并且它也‘足够好’地广泛使用,但是它的足够好完全如 DOS 与 Windows 的‘足够好’一样。不是什么伟大的技术,只是普遍适用而已,同时它对人们来说运行良好,看着十分熟悉。但是很少有人以此为傲,或者对其有兴奋感。 -Git,从另外方面讲,其身后有一些‘UNIX 哲学’。它不是关于UNIX,实质上,是像原始的UNIX,它身后有一个基础的想法。对UNIX来说,最底层的哲学就是,“所有东西只是一个文件”。对Git来说,“则是每个东西仅仅是内容寻址数据库中的一个对像”。 +Git,从另外方面讲,其身后有一些‘UNIX 哲学’。它并不关系到 UNIX,实质上,只是像原始的 UNIX,在它身后有一个基本理念。对 UNIX 来说,最底层的哲学就是,“所有东西只是一个文件”。对 Git 来说,“则是每个东西仅仅是内容寻址数据库中的一个对像”。 -**Q:现在如此多的发行是好事还是坏事?选择是很有意思的,但是没有人需要被选择给撑着。相较于这么多的人每天花费数小时去构建成百上千的发行版,如果人们可以一起来支持少数的发行版(可能每一个有一个人),这样进入企业,接受微软的挑战是不是更容易些呢?对此你怎么看?** +**Q:现在如此多的发行是好事还是坏事?选择是很有意思的,但是没有人想被选择给撑着。相较于这么多的人每天花费数小时去构建成百上千的发行版,如果人们可以一起来支持少数的发行版(可能每一个有一个人),这样进入企业,接受微软的挑战是不是更容易些呢?对此你怎么看?** -Linus:我认为多发行版是开源不可回避的部分。它会造成困惑吗?当然。它会变得低效率吗?是的。但是我喜欢拿它与政治比较:’民主‘也有那些令人困惑的选择,通常没有选择是必须的,或者你‘真正’想要的。而且有时候,如果你不需要担心选举,不同党派和联合等等方面的困惑的话,你可能喜欢事情更加容易一些,更有效率一些。 +Linus:我认为多个发行版是开源不可回避的部分。它会造成困惑吗?当然。它会变得低效率吗?是的。但是我喜欢拿它与政治比较:‘民主’也有那些令人困惑的选择,往往没有任何一个选择是你‘真正’想要的。而且有时候,如果你不需要操心选举、不同党派和联合等等方面的困惑的话,你可能会感觉事情更加容易一些,更有效率一些。 -但是最后我想说,选择可能会导致低效率,但是它也让每个人至少保留了‘所谓的’诚信。我们可能都希望我们的政治家比过去更诚信,我们也希望不同的发行版有一天做出其他的选择,但是没有那种选择的话,事情可能会更糟。 +但是最后我想说,选择可能会导致低效率,但是它也让每个人至少保留了‘所谓的’诚信。我们可能都希望我们的政治家更诚信,我们也希望不同的发行版可以让我们有一天有其他的选择,而如果没有选择的话,事情可能会更糟。 -**Q:为什么你觉得CFS比SD更好?** +**Q:为什么你觉得 CFS 比 SD 更好?** -Linus:一部分原因是我与Ingo[Molnar]工作你很长一段时间,这就是说,我了解他,并且知道他会对发生的任何事情非常负责。那种品质是非常重要的。 +Linus:一部分原因是我与 Ingo [Molnar] 工作过很长一段时间,也就是说,我了解他,并且知道他会对发生的任何问题非常负责。那种品质是非常重要的。 -但是一部分原因就简单的与用户有关。其他地方的大多数人实际上表示CFS比SD好。包括许多3D游戏方面(这是人们声称SD最强的一点)。 +但是一部分原因就简单的与用户有关。其他地方的大多数人实际上表示 CFS 比 SD 好。包括许多 3D 游戏方面(这是人们声称SD 最强的一点)。 -同时,尽管如此,我认为并不是代码的任何一段都十分‘完美’。最好的情况是想成为SD支持者的人会努力提高SD,使得平衡会倾覆其他方面 — 而我们会保持两个阵营都尝试有趣的事情,因为内部的竞争会刺激他们。 +同时,尽管如此,我认为并不是任何一段代码都十分‘完美’。最好的情况是,想成为 SD 支持者的人会努力提高 SD,从而通过其它方式取得了平衡 — 而我们会保持两个阵营都尝试有趣的事情,因为内部的竞争会刺激他们。 -**Q:在Google一次关于Git的访谈中,有人问你如何会停止六个月的商业活动,为git编写了一个目前由一些中心化的东西和交易管理的,特别庞大的代码基础。你对此的回答是什么?** +**Q:在 Google 一次关于 Git 的访谈中,有人问你如何将当前集中存放的超大代码库迁移到 git 上,而不用将开发工作停止六个月。你对此的回答是什么?** -Linus:啊哈。那个问题我在现场没有听清楚(在录制结果里,问题会听得更清楚些),当我回头去听录制的音频,注意到了我没有回答他的问题,但是我觉得这问题他问过。 +Linus:啊哈。那个问题我在现场没有听清楚(在录音里,问题会听得更清楚些),当我回头去听录制的音频,注意到了我没有回答他的问题,但是我觉得这问题他问过。 -无论如何,我们确实有很多导入的工具,所以你实际上可以仅仅是从任何其他的早期SCM导入一个大工程到git里,但问题显然不是经常以导入动作本身结束,而是需要‘习惯’这种新模式! +无论如何,我们确实有很多导入的工具,所以你实际上可以仅仅是将一个大的项目从任何其他的早期 SCM 导入到 git 里,但问题显然不是经常以导入动作本身结束,而是需要‘习惯’这种新模式! -坦白来说,我认为关于‘习惯它’没有任何其他答案,而只是去开始使用和尝试它。显然,你不想以导入你现有的最大且最中心的项目为开端;那确实会使每件事出现停顿,然后使得每个人都很不高兴。 +坦白来说,我认为关于‘习惯它’没有任何其他答案,而只是去开始使用和尝试它。显然,你不想以导入你现有的最大且最重要的项目为开端;那确实会使每件事出现停顿,然后使得每个人都很不高兴。 -所以没有理智健全的人会一夜之间拥护将一切移到git上去,并强迫人们改变他们的环境。是的,你需要以公司里的小项目开始,可能是一些一个组主要控制和维护的项目,然后开始转移其到git。这是你能让人们习惯这种模式的方式,你开始有一个核心的组,知道git如何工作,如何在公司里面使用它。 +所以没有任何理智健全的人会拥护在一夜之间将一切移到 git 上去,并强迫人们改变他们的环境。是的,你需要以公司里的小项目开始,可能是一些由一个小组主要控制和维护的项目,然后开始转移其到 git。这是你能让人们习惯这种模式的方式,你应该以一个核心的组开始,他们知道 git 如何工作,如何在公司里面使用它。 -接着,你就会铺展开来。并不一次就位。你会导入越来越多的项目 — 如果在你公司里你有‘一个大仓库’;你也会差不多确定将那个仓库作为许多模块的集合,因为让每个人去检查每件事不是一个可执行的工作模型(除非‘每件事’并不非常大)。 +接着,你就会铺展开来。并不需要一次到位。你会导入越来越多的项目 — 甚至是在你公司里采用‘单一大型仓库’模式;那个仓库基本上是作为许多模块的集合,因为让每个人去检查每件事不是一个可执行的工作模型(除非这个‘每件事’并不非常大)。 -所以,你基本上有一次转移了一个模块,直到你发现你使用git如此舒服的那个点,你可以移植余下的所有(或者‘余下’太传统了,没人会关心)。 +所以,你基本上有一次转移一个模块,直到你发现你使用git如此舒服的那个点,你可以移植余下的所有(或者‘余下’的太旧了,没有人用了)。 -Git最赞的一个功能是,它实际上可以同很多其他SCM相处很好。这就是很多git用户使用它的时候:‘他们’可能只是使用git,但有时候与他们一起工作的人并没有发现,因为他们看到git的结果,联想到一些传统的SCM上去。 +git 最赞的一个功能是,它实际上可以同很多其他 SCM(源代码控制管理)相处很好。这就是很多git用户使用它的时候:‘他们’可能只是使用 git ,但有时候与他们一起工作的人并没有发现,因为他们看到git的结果,联想到一些传统的 SCM 上去。 -**Q:在Transmeta,他们曾经经历过用另外的架构设置部署吗?[Transmeta Crusoe的芯片看起来像一个非常软的CPU — 提到一台Burroughs B1000的解释机器,这实际上部署了多台虚拟机。有一台是用于系统软件,一台是用于Cobol,一台用于Fortran;如果上述正确,那么一个人可以部署Burroughs 6/7000或者HP3000,如栈结构一样,在芯片上或者一个适合JVM的结构集合等等。]** +**Q:在 Transmeta(全美达)上他们有备用指令集实现的经验吗?[Transmeta Crusoe 芯片看起来像一个非常弱的 CPU — 记得有一台 Burroughs B1000 的解释器,它实际上实现了多个虚拟机。有一台是用于系统软件,一台是用于 Cobol,一台用于 Fortran;如果没错的话,那么一个人可以在芯片上实现 Burroughs 6/7000 或者 HP3000 类似的堆栈架构或适用于 JVM 的指令集,等等。]** -Linus:我们确实有一些备选的结构集合,我仍然不打算谈论这个,我可以说我们已经做了一个混合结构集合的公开证明。我们有一个技术宝箱,在那里你同时可以跑x86结构和Java字节码(实际上,它是一个轻量的扩展pico—java,iirc)。 +Linus:我们确实有一些备选的结构集合,我仍然不打算谈论这个,我可以说我们已经做了一个混合结构集合的公开演示。我们有一个技术展示,在那里你同时可以跑x86结构和 Java 字节码(实际上,它是一个轻量的扩展 pico—java,iirc)。 -(选择DOOM的原因仅仅是其源代码可用,并且游戏的核心部分非常小,足以很容易拿它来做一个验证 — 而且它也显然看起来十分有趣。) +我想我们展示的这个应用会在 Linux 上运行 DOOM,这里 Linux 的部分是一个完全标准 x86 发行版。但是 DOOM 的二进制程序是一个 test 编译版本,它实际上编译为 pico-java 代码。而 CPU 最终以相同的方式来运行它们——从 JIT 到原生 VLIW 指令集。 -有更多的事情是在内部运作,但是我不能谈论他们。而且实际上,就我个人而言,对Java不怎么感冒。 +(选择 DOOM 的原因仅仅是其源代码可用,并且游戏的核心部分非常小,足以很容易拿它来做一个验证 — 而且它也显然看起来十分有趣。) -**Q:386BSD衍生了NetBSD,FreeBSD和OpenBSD,在Linux出现之前已经发展不错了,但是Linux传播比386BSD及其衍生者更为广泛。这在多大程度上左右你对证书的选择,和你选择的发展过程?你不认为比起GPLv2来,是GPLv3保护了自由,孕育了Linux比BSD更好,直到现在?** +有更多的事情是在内部运作,但是我不能谈论他们。而且实际上,就我个人而言,对 Java 不怎么感冒。 -Linus: +**Q:386BSD 衍生了 NetBSD,FreeBSD 和 OpenBSD,在 Linux 出现之前已经发展不错了,但是 Linux 传播比 386BSD 及其衍生者更为广泛。这在多大程度上左右你对许可证的选择,这个选择的发展过程是怎样的?你不认为比起 GPLv2 来,是 GPLv3 保护了自由,迄今为止,让 Linux 比 BSD 变得更好?** + +Linus:我认为这是一个许可证问题和一个社区及人格问题。BSD 的许可证总是鼓励分叉,但是这也意味着,如果某些人取得了成功并做了商业性的分叉,他并不需要将将他的修改返回来。因此,实际上并不会真的发生这种事情(以 BSD 而言,如 BSDi),人们并不真的彼此‘信任’。 + +相比之下,GPLv2 也鼓励分叉,但是它不仅仅鼓励分叉出去,它也鼓励(并‘要求’)能够融合回来。所以,我们现在达到了新的层次的信任:你‘知道’每个人都被许可证所约束,所以不会试着从你这里白白占走好处。 + +所以,在我看来,GPLv2 作为许可证来说,它允许人们在要求总是回馈贡献的前提下,在另外的方面取得了最大可能的自由。没有人能阻止你对源代码的改进。 + +那么,BSD 许可证是更‘自由’的吗?是的,毫无疑问。但是我不会在我在意的任何项目里面使用 BSD 许可证,因为我不仅仅想要自由,我也想要信任,可以让我总是能使用其他人为我的项目所写的代码。 + +所以对于我来说,GPLv2 最终在‘尽可能自由’上取得了完美的平衡,这样,我们做到了让每个人都能信任,他们总是可以取得源代码并使用它。 + +这就是为什么我认为 GPLv3 最终并没多大意思,它不再是那种‘返回源代码’的信任;它退化成了‘我写了这些代码,所以我能控制你如何使用它’。 + +换言之,我只是觉得 GPLv3 太狭隘和自私了。我认为 GPLv2 在‘自由’和‘信任’之间取得伟大的平衡。它不如 BSD 许可证自由,但是它让你安心回馈,而且它符合我认为的‘以德报德’:我给你源代码,你也回馈我源代码。 + +而 GPLv3 试着控制源代码的‘使用’。现在它就是“我给你我的源代码,如果你使用它的话,你最好可以让我对你的设备动手动脚”,看见了没?在我看来,不但小气,而且小心眼。 + +**Q:-rt 树的功能正在缓慢而稳定地逐渐集成到主线代码中。你当前对合并剩余的 -rt 树到主线代码的看法是什么?(我说的不是 CFS)** + +Linus: 我不能保证来自 -rt 的一切‘都’会被合并进入标准内核(有一些部分肯定不适合常规的内核),不过是的,这些年来我们实际上将它的大部分都集成进去了,剩下的部分最终以后也会合并进去。 + +我提倡高效工作,但是我同时也很保守。我退回了一些激进的合并请求,只是因为我需要确保它们对所有人都有意义,不仅仅是用于极端情况下的实时环境,而且也对并不需要这种环境的‘普通’用户有用。这解释了为什么这个过程相当缓慢却稳定不断地合并代码,因为它需要足够稳定和有意义。 + +顺便说一句,这不仅仅是针对 -rt ,它也在许多开发中出现。-rt 出现这种情况是因为它是更‘直接’的内核项目,而且也是因为它的一个主要开发者也直接涉及到了普通的内核开发。通常其它功能的迁移(安全、虚拟内核变化、虚拟化,等等)也遵循类似的方式:他们针对特定的环境进行开发,然后这些功能片段缓慢而稳步地合并到标准内核。 + + +**Q:我对 Linux 内核支持的文件系统的发展很感兴趣。你觉得 Reiser4、XFS4、ZFS 以及 Oracle 发起那个新项目那个更有前途?这些天 ZFS 有不少新闻,Reiser4 也发布了很不错的性能基准测试,XFS4 正紧随其后,而 Oracle 发布的那个也有很多像 Sun 的 ZFS 一样的特性。我们将走向何方呢?以你的观点来看,哪个文件系统更有前途?** + +Linus: 实际上,就在昨天我们发现了一个 git 的性能问题,有一个用户他采用 ZFS 要比 UFS 慢一个数量级(不是在 Linux 下,git 已经得到了许多关注,甚至是在内核开发团队之外)。所以,我认为许多‘新文件系统’的拥护者部分原因是因为他们了解到旧文件系统的不足,然后(有点不切实际地)期望一个‘崭新的、改进的’文件系统能使一切都完美。 + +最后,这是一个永无止境的领域,看看谁是最终的赢家——也许并不需要(看起来不需要)一个赢家。几乎总是这样,对文件系统的选择最终取决于负载和环境。 + +相比你提到的这些文件系统,我个人对基于闪存的硬盘很快就可以供甚至是‘普通’用户使用的这个事实更感到兴奋。当然,它们仍然很昂贵(而且相当的小),但是基于闪存的存储和旋转介质的性能完全不可同日而语,我怀疑它们最终将对文件系统的设计有巨大的影响。而现在,多数文件系统的设计都是在考虑如何处理旋转介质的延迟。 + +**Q:操作系统变得越来越不重要。你说过好几次用户根本不应该‘看见’操作系统。应用更为重要。基于浏览器的应用,如 Google 的基本办公软件正在发挥影响力。你认为操作系统将走向何方?** + +Linus:我并不真的相信‘浏览器 OS’,因为我认为人们总是需要在本地做一些事情。也许是因为安全,或者仅仅是因为隐私的原因。而且当到处可以接入时,它也并不是‘无处不在’。 + +所以我认为,整个‘Web OS’这件事有一部分是真实的,但是另外一部分人们也许忘记了操作系统已经存在了几十年,它已经相当稳定,而且它的发展是有目共睹的。人们真的不应该期望操作系统有魔法般的变化:人们并不能回到‘傻傻的’六十年代,甚至连硬件也和过去的‘那个’完全不同了! + +所以,别指望一场革命。我认为操作系统将更多继续它们所做哪些事情,当然,我们也会进步,但是我不认为会从根本上改变。也许会发生根本性改变的是界面和操作系统顶层的哪些东西(当然,操作系统下面的硬件也会继续进步),这显然才是人们所关心的。 + +至于操作系统?它显然是应该尽可能隐藏起来的东西。你真的不应该在意它,除非你非常想知道在机器里面真正在做什么。 + +**Q:最近我听说,你正在使用一台 PPC G4/5 作为个人计算机,你使用它来做什么?为什么呢?** + +Linus:我最终放弃了那台 PowerPC,因为没有人能在这台工作站上做的更多,特别是,自从 x86-64 开始变得越来越强大了。所以这些天,我在用一台标准的 PC,里面是一个普通的 Core 2 Duo CPU。 + +在其它架构下运行是非常有趣的(我把 alpha 作为我的主要架构运行了好几年,所以这并不是第一次),但是这种 CPU 得当成商品买得到才行。我认为,唯一能取代 x86 架构的将来自以下,比如也许我们将来十年并不需要使用 x86 作为我们的主要架构,我认为也许是 ARM,这得益于移动设备市场。 + +**Q:Linux 对你意味着什么?一种业余爱好、哲学、人生意义、工作、最好的操作系统,还是什么?** + +Linus:它是所有的这一切。它是爱好,而且是具有深刻意义的爱好。最好的爱好是你‘真的’非常在意它。这些日子里,它显示也是我的工作,我非常高兴工作和兴趣能合二为一。 + +我不了解所谓的‘哲学’,我并不真的是因为深层次的道德或哲学的原因才做的 Linux (字面上的做是因为它有趣),但是可以肯定的是,我欣赏我认为开源为何这么棒的深层原因。所以我并不是因为什么高大上的理由做 Linux 的,而且我不能诚恳地说是它在激励我,但是我最终会思考为什么会这样。 + +**Q:微软的‘黑衣人’有没有和你交谈过?** + +Linus:我从来没有真正和微软交谈过,没有。我偶尔会和一些微软的人出现再同一个会议上(我比以前参加的会议更多了),但是我从来和他们没有任何关系。我认为彼此都很谨慎吧。 + +-------------------------------------------------------------------------------- + +via: http://www.linuxveda.com/2015/06/17/what-happens-to-linux-after-linus/ + +作者:[Swapnil Bhartiya][a] +译者:[wi-cuckoo](https://github.com/wi-cuckoo),[wxy](https://github.com/wxy) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.linuxveda.com/author/arnieswap/ From e6fc2faaa05c95cc508faf9ceb8356c0d6645b08 Mon Sep 17 00:00:00 2001 From: ZTinoZ Date: Sun, 5 Jul 2015 17:37:27 +0800 Subject: [PATCH 531/965] Translating by ZTinoZ --- ...re Made Easy with these Dedicated Tools.md | 38 +++++++++---------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/sources/share/20150625 Screen Capture Made Easy with these Dedicated Tools.md b/sources/share/20150625 Screen Capture Made Easy with these Dedicated Tools.md index 8e393b1722..fb0159ca6a 100644 --- a/sources/share/20150625 Screen Capture Made Easy with these Dedicated Tools.md +++ b/sources/share/20150625 Screen Capture Made Easy with these Dedicated Tools.md @@ -14,9 +14,9 @@ ![Shutter in action](http://www.linuxlinks.com/portal/content/reviews/Graphics/Screenshot-Shutter1.png) -Shutter是一款功能丰富的截图软件。你能为你的特殊区域、窗口、整个屏幕甚至是网站截图 - 然后在其中应用不用的效果,比如用高亮的点在上面绘图,然后上传至一个图片托管网站,一切尽在这个小窗口内。 +Shutter是一款功能丰富的截图软件。你可以给你的特殊区域、窗口、整个屏幕甚至是网站截图 - 在其中应用不用的效果,比如用高亮的点在上面绘图,然后上传至一个图片托管网站,一切尽在这个小窗口内。 -包含特性: +包含特性: - 截图范围: @@ -38,7 +38,7 @@ Shutter是一款功能丰富的截图软件。你能为你的特殊区域、窗 - 删除截图 - 重命名文件 - 直接上传你的文件至图像托管网站(比如http://ubuntu-pics.de),取回所有需要的图像并将它们与其他人分享 -- 用内嵌的绘画工具直接编辑截图 +- 用内置的绘画工具直接编辑截图 - 主页: [shutter-project.org][1] - 开发者: Mario Kemper和Shutter团队 @@ -51,11 +51,11 @@ Shutter是一款功能丰富的截图软件。你能为你的特殊区域、窗 ![HotShots in action](http://www.linuxlinks.com/portal/content/reviews/Graphics/Screenshot-HotShots.png) -HotShots is an application for capturing screens and saving them in a variety of image formats as well as adding annotations and graphical data (arrows, lines, texts, ...). +HotShots是一款捕捉屏幕并能以各种图片格式保存的软件,同时也能添加注释和图形数据(箭头、行、文本, ...)。 -You can also upload your creations to the web (FTP/some web services). HotShots is written with Qt. +你也可以把你的作品上传到网上(FTP/一些web服务),HotShots是用Qt开发而成的。 -HotShots is not available in Ubuntu's Software Center. But it's easy to install by typing at the command line: +HotShots无法从Ubuntu的Software Center中获取,不过用以下命令可以轻松地来安装它: sudo add-apt-repository ppa:ubuntuhandbook1/apps @@ -63,21 +63,21 @@ HotShots is not available in Ubuntu's Software Center. But it's easy to install sudo apt-get install hotshots -Features include: +包含特性: -- Simple to use -- Full featured -- Built-in editor -- Hotkeys -- Built-in magnification -- Freehand and multi-screen capture -- Supported Output Formats: Black & Whte (bw), Encapsulated PostScript (eps, epsf), Encapsulated PostScript Interchange (epsi), OpenEXR (exr), PC Paintbrush Exchange (pcx), Photoshop Document (psd), ras, rgb, rgba, Irix RGB (sgi), Truevision Targa (tga), eXperimental Computing Facility (xcf), Windows Bitmap (bmp), DirectDraw Surface (dds), Graphic Interchange Format (gif), Icon Image (ico), Joint Photographic Experts Group 2000 (jp2), Joint Photographic Experts Group (jpeg, jpg), Multiple-image Network Graphics (mng), Portable Pixmap (ppm), Scalable Vector Graphics (svg), svgz, Tagged Image File Format (tif, tiff), webp, X11 Bitmap (xbm), X11 Pixmap (xpm), and Khoros Visualization (xv) -- Internationalization support: Basque, Chinese, Czech, French, Galician, German, Greek, Italian, Japanese, Lithuanian, Polish, Portuguese, Romanian, Russian, Serbian, Singhalese, Slovak, Spanish, Turkish, Ukrainian, and Vietnamese +- 简单易用 +- 全功能使用 +- 嵌入式编辑器 +- 热键 +- 内置放大功能 +- 徒手和多屏捕捉 +- 支持输出格式:Black & Whte (bw), Encapsulated PostScript (eps, epsf), Encapsulated PostScript Interchange (epsi), OpenEXR (exr), PC Paintbrush Exchange (pcx), Photoshop Document (psd), ras, rgb, rgba, Irix RGB (sgi), Truevision Targa (tga), eXperimental Computing Facility (xcf), Windows Bitmap (bmp), DirectDraw Surface (dds), Graphic Interchange Format (gif), Icon Image (ico), Joint Photographic Experts Group 2000 (jp2), Joint Photographic Experts Group (jpeg, jpg), Multiple-image Network Graphics (mng), Portable Pixmap (ppm), Scalable Vector Graphics (svg), svgz, Tagged Image File Format (tif, tiff), webp, X11 Bitmap (xbm), X11 Pixmap (xpm), and Khoros Visualization (xv) +- 国际化支持:巴斯克语、中文、捷克语、法语、加利西亚语、德语、希腊语、意大利语、日语、立陶宛语、波兰语、葡萄牙语、罗马尼亚语、俄罗斯语、塞尔维亚语、僧伽罗语、斯洛伐克语、西班牙语、土耳其语、乌克兰语和越南语 -- Website: [thehive.xbee.net][2] -- Developer: xbee -- License: GNU GPL v2 -- Version Number: 2.2.0 +- 主页: [thehive.xbee.net][2] +- 开发者 xbee +- 许可证: GNU GPL v2 +- 版本号: 2.2.0 ---------- From 2cd247dafba9fbbebad28326c20f0e05cc94929a Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 5 Jul 2015 21:55:59 +0800 Subject: [PATCH 532/965] PUB:20150616 Linux Humor on the Command-line @wwy-hust --- ...0150616 Linux Humor on the Command-line.md | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) rename {translated/share => published}/20150616 Linux Humor on the Command-line.md (70%) diff --git a/translated/share/20150616 Linux Humor on the Command-line.md b/published/20150616 Linux Humor on the Command-line.md similarity index 70% rename from translated/share/20150616 Linux Humor on the Command-line.md rename to published/20150616 Linux Humor on the Command-line.md index 41745eba24..e998e31f05 100644 --- a/translated/share/20150616 Linux Humor on the Command-line.md +++ b/published/20150616 Linux Humor on the Command-line.md @@ -1,14 +1,14 @@ Linux命令行中的幽默 ================================================================================ -桌面通常是非常养眼的,它增强了可视化的体验,有时也能够增强某些软件的功能,而且让软件变得更有趣。在命令行下工作也不需要总是很严肃,如果您想在命令行下找些乐子,那么有很多命令可以让您展露微笑。 +图形桌面总是很养眼的,它增强了可视化体验,有时也能够提升了某些软件的功能,让软件变得更有趣。但是,在命令行下工作也不需要总是很古板,如果您想在命令行下寻找些乐趣,那么有很多命令给您带来趣味。 -Linux是个有趣的操作系统。它提供大量的小型开源工具,从平淡无奇的软件到稀奇古怪的应用。正是这些工具的质量和可选择性帮助Linux脱颖而出。让我们一起来看看下面这七个小工具吧。 +Linux是个有趣的操作系统。它提供大量的小型开源工具,从平淡无奇的软件到稀奇古怪的应用。正是这些工具的功能和琳琅满目的选择帮助Linux脱颖而出。让我们一起来看看下面这七个小工具吧。 -### lolcat ### +### 七彩虹:lolcat ### ![lolcat](http://www.linuxlinks.com/portal/content/reviews/Misc/Screenshot-lolcat.png) -lolcat是一个连接文件或标准输入到标准输出(类似一般的cat)的程序,它会为输出添加七彩的颜色。 +lolcat是一个用于将文件或标准输入连接到标准输出(类似常见的cat)的程序,但是它会为输出添加七彩的颜色。 lolcat通常和其他诸如toilet或figlet等生成文本的应用结合使用。这个软件不应被误认为是一个或多个猫的图像的宏。 @@ -16,13 +16,13 @@ lolcat由Moe编写。 网址: [github.com][1] -### cowsay ### +### 牛郎的牛:cowsay ### ![cowsay](http://www.linuxlinks.com/portal/content/reviews/Misc/Screenshot-cowsay.png) cowsay是一个可配置的开源软件,它用ASCII码生成奶牛的图片,并可以在对话气泡中显示消息。cowsay是用Perl写的。 -cowsay并不仅仅只能显示奶牛。它能生成预先制作的图片或者其他动物,包括鸭子、考拉、麋鹿、小马、绵羊、剑龙和火鸡,以及奶酪、雪人和骨架。 +cowsay并不仅仅只能显示奶牛。它能生成预先制作的图片或者其他动物,包括鸭子、考拉、麋鹿、小马、绵羊、剑龙和火鸡,以及奶酪、雪人和骷髅。 有一个叫cowthink的应用,与对话的气泡不同,它能在生成奶牛的同时生成思考的气泡。 @@ -31,11 +31,11 @@ cowsay并不仅仅只能显示奶牛。它能生成预先制作的图片或者 - 让脚本变得更有趣 - Borg模式 - 可以更改奶牛看起来的样子,比如让奶牛看起来贪婪、偏执、固执、疲倦、古怪、年轻等 -- 支持xcowsay的变形 +- 图形版变体:xcowsay 网址: [nog.net][2] -### doge ### +### 傻狗:doge ### ![doge](http://www.linuxlinks.com/portal/content/reviews/Misc/Screenshot-doge.png) @@ -45,19 +45,19 @@ doge是一个在2013年非常流行的互联网潮流元素(梗)。这个梗 - 随机的用不同的颜色和蹩脚的英语写下随机的句子 - 终端中的柴犬效果非常棒 -- 获得系统数据,比如主机名、运行中的程序、当前用户、$EDITOR -- 如果您安装了lolcat,您可以用它作为点缀: while true; do doge | lolcat -a -d 100 -s 100 -p 1; done -- 标准输入支持: ls /usr/bin | doge 将打印一些/usr/bin下的可执行文件。哇噢,还有许多命令行的开关可以过滤词语以及控制词语的频率。 +- 可以获得系统数据,比如主机名、运行中的程序、当前用户、$EDITOR +- 如果您安装了lolcat,您可以用它作为点缀: `while true; do doge | lolcat -a -d 100 -s 100 -p 1; done` +- 支持标准输入: `ls /usr/bin | doge` 将显示一些 /usr/bin下的可执行文件。哇噢,还有许多命令行的开关可以过滤词语以及控制词语的频率。 网址: [github.com/thiderman/doge][3] -### ASCIIQuarium ### +### 水族箱:ASCIIQuarium ### ![Asciiquarium](http://www.linuxlinks.com/portal/content/reviews/Misc/Screenshot-Asciiquarium.png) ASCIIQuarium是一个以ASCII码方式画出的水族馆/海洋动画。享受生活在您电脑中水底的奇妙生物吧。 -想运行ASCIIQuarium,您需要安装Perl的curses包以及Term::Animation模块。请使用sudo apt-get install libcurses-perl来安装前者,使用sudo cpan Term::Animation来安装后者。两个命令都需要在终端中运行。 +想运行ASCIIQuarium,您需要安装Perl的curses包以及Term::Animation模块。请使用`sudo apt-get install libcurses-perl`来安装前者,使用sudo cpan Term::Animation来安装后者。两个命令都需要在终端中运行。 功能包括: @@ -67,13 +67,13 @@ ASCIIQuarium是一个以ASCII码方式画出的水族馆/海洋动画。享受 网址: [www.robobunny.com][4] -### sl - 蒸汽机车 ### +### 蒸汽机车:sl ### ![sl](http://www.linuxlinks.com/portal/content/reviews/Misc/Screenshot-sl.png) sl是一个有趣的终端应用,它为那些意外的错将ls输成sl的用户显示一个动画。 -我打字通常非常草率,更喜欢速度而不是准确性。但错别字在命令行中是非常危险的。因此sl作为一个实际的提醒者,提醒我们注意错误输入的这种坏习惯。它总是会让人咯咯的笑。 +我打字通常非常草率,更喜欢速度而不是准确性。但错别字在命令行中是非常危险的。因此sl扮演了一个提醒者,提醒我们注意错误输入的这种坏习惯。它总是会让人咯咯的笑。 功能包括: @@ -83,7 +83,7 @@ sl是一个有趣的终端应用,它为那些意外的错将ls输成sl的用 网址: [github.com/mtoyoda/sl][5] -### aafire ### +### 火焰:aafire ### ![aafire](http://www.linuxlinks.com/portal/content/reviews/Misc/Screenshot-aafire.png) @@ -91,11 +91,11 @@ aafire在终端中显示燃烧的ASCII火焰。它展示了aalib库的强大能 网址: [aa-project.sourceforge.net/aalib][6] -### CMatrix ### +### 矩阵:CMatrix ### ![CMatrix](http://www.linuxlinks.com/portal/content/reviews/Misc/Screenshot-CMatrix.png) -CMatrix是一个基于ncurses的程序,它模拟《黑客帝国》(一部电影)中的画面。如果您在一个山洞里度过了上个15年,那么您可能不知道黑客帝国是1999年的美国科幻电影,主角为 Keanu Reeves, Laurence Fishburne, Carrie-Anne Moss, Hugo Weaving和 Joe Pantoliano。 +CMatrix是一个基于ncurses的程序,它模拟《黑客帝国》(一部电影)中的画面。如果您在一个山洞里度过了上个15年,那么您可能不知道这部1999年的美国科幻电影,主角为 Keanu Reeves, Laurence Fishburne, Carrie-Anne Moss, Hugo Weaving和 Joe Pantoliano。 它可以在终端设置为132x300的情况下工作,并且可以以同样的速率进行滚动或者以用户定义的速度进行异步的滚动。 From 3cc959afc4a5737a03946e83c44fb26347d2c1d6 Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 5 Jul 2015 22:06:26 +0800 Subject: [PATCH 533/965] PUB:20150604 How to access SQLite database in Perl @geekpi --- ...4 How to access SQLite database in Perl.md | 26 ++++++++++--------- 1 file changed, 14 insertions(+), 12 deletions(-) rename {translated/tech => published}/20150604 How to access SQLite database in Perl.md (84%) diff --git a/translated/tech/20150604 How to access SQLite database in Perl.md b/published/20150604 How to access SQLite database in Perl.md similarity index 84% rename from translated/tech/20150604 How to access SQLite database in Perl.md rename to published/20150604 How to access SQLite database in Perl.md index 76cc1f01f0..82283b9857 100644 --- a/translated/tech/20150604 How to access SQLite database in Perl.md +++ b/published/20150604 How to access SQLite database in Perl.md @@ -1,6 +1,6 @@ 如何用Perl访问SQLite数据库 ================================================================================ -SQLite是一个零配置,无服务端,基于文件的事务文件系统。由于它的轻量级,自包含和紧凑的设计,所以当你想要集成数据库到你的程序中时,SQLite是一个非常流行的选择。在这篇文章中,我会展示如何用Perl脚本来创建和访问SQLite数据库。我演示的Perl代码片段是完整的,所以你可以很简单地修改并集成到你的项目中。 +SQLite是一个零配置、无服务端、基于文件的事务型数据库系统。由于它的轻量级,自包含和紧凑的设计,所以当你想要集成数据库到你的程序中时,SQLite是一个非常不错的选择。在这篇文章中,我会展示如何用Perl脚本来创建和访问SQLite数据库。我演示的Perl代码片段是完整的,所以你可以很简单地修改并集成到你的项目中。 ![](https://farm1.staticflickr.com/552/18444614631_9e7fce8243_c.jpg) @@ -44,25 +44,27 @@ SQLite是一个零配置,无服务端,基于文件的事务文件系统。 - 在表中更新行 - 在表中删除行 +- + use DBI; use strict; - # define database name and driver + # 定义数据库名称和驱动 my $driver = "SQLite"; my $db_name = "xmodulo.db"; my $dbd = "DBI:$driver:dbname=$db_name"; - # sqlite does not have a notion of username/password + # sqlite 没有用户名密码的概念 my $username = ""; my $password = ""; - # create and connect to a database. - # this will create a file named xmodulo.db + # 创建并连接到数据库 + # 以下创建的文件名为 xmodulo.db my $dbh = DBI->connect($dbd, $username, $password, { RaiseError => 1 }) or die $DBI::errstr; print STDERR "Database opened successfully\n"; - # create a table + # 创建表 my $stmt = qq(CREATE TABLE IF NOT EXISTS NETWORK (ID INTEGER PRIMARY KEY AUTOINCREMENT, HOSTNAME TEXT NOT NULL, @@ -76,7 +78,7 @@ SQLite是一个零配置,无服务端,基于文件的事务文件系统。 print STDERR "Table created successfully\n"; } - # insert three rows into the table + # 插入三行到表中 $stmt = qq(INSERT INTO NETWORK (HOSTNAME,IPADDRESS,OS,CPULOAD) VALUES ('xmodulo', 16843009, 'Ubuntu 14.10', 0.0)); $ret = $dbh->do($stmt) or die $DBI::errstr; @@ -89,7 +91,7 @@ SQLite是一个零配置,无服务端,基于文件的事务文件系统。 VALUES ('puppy', 16843011, 'Ubuntu 14.10', 0.0)); $ret = $dbh->do($stmt) or die $DBI::errstr; - # search and iterate row(s) in the table + # 在表中检索行 $stmt = qq(SELECT id, hostname, os, cpuload from NETWORK;); my $obj = $dbh->prepare($stmt); $ret = $obj->execute() or die $DBI::errstr; @@ -104,7 +106,7 @@ SQLite是一个零配置,无服务端,基于文件的事务文件系统。 print "CPULOAD: ". $row[3] ."\n\n"; } - # update specific row(s) in the table + # 更新表中的某行 $stmt = qq(UPDATE NETWORK set CPULOAD = 50 where OS='Ubuntu 14.10';); $ret = $dbh->do($stmt) or die $DBI::errstr; @@ -114,7 +116,7 @@ SQLite是一个零配置,无服务端,基于文件的事务文件系统。 print STDERR "A total of $ret rows updated\n"; } - # delete specific row(s) from the table + # 从表中删除某行 $stmt = qq(DELETE from NETWORK where ID=2;); $ret = $dbh->do($stmt) or die $DBI::errstr; @@ -124,7 +126,7 @@ SQLite是一个零配置,无服务端,基于文件的事务文件系统。 print STDERR "A total of $ret rows deleted\n"; } - # quit the database + # 断开数据库连接 $dbh->disconnect(); print STDERR "Exit the database\n"; @@ -164,7 +166,7 @@ via: http://xmodulo.com/access-sqlite-database-perl.html 作者:[Dan Nanni][a] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 76e531461d601c4c113ef0798f23aae0dccb0bd8 Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 5 Jul 2015 22:26:04 +0800 Subject: [PATCH 534/965] PUB:20150610 watch--Repeat Linux or Unix Commands Regular Intervals @geekpi --- ...inux or Unix Commands Regular Intervals.md | 36 +++++++++---------- 1 file changed, 16 insertions(+), 20 deletions(-) rename {translated/tech => published}/20150610 watch--Repeat Linux or Unix Commands Regular Intervals.md (61%) diff --git a/translated/tech/20150610 watch--Repeat Linux or Unix Commands Regular Intervals.md b/published/20150610 watch--Repeat Linux or Unix Commands Regular Intervals.md similarity index 61% rename from translated/tech/20150610 watch--Repeat Linux or Unix Commands Regular Intervals.md rename to published/20150610 watch--Repeat Linux or Unix Commands Regular Intervals.md index f5e395c278..b537db3854 100644 --- a/translated/tech/20150610 watch--Repeat Linux or Unix Commands Regular Intervals.md +++ b/published/20150610 watch--Repeat Linux or Unix Commands Regular Intervals.md @@ -1,6 +1,6 @@ -watch - 定期重复Linux / Unix命令 +watch:定期重复Linux / Unix命令 ================================================================================ -服务器管理员需要维护系统并保持更新和安全。每天需要尝试大量的指令。一些其他的活动存储在日志中。这些日志定期地更新。为了检车这些更新,需要重复地执行命令。比如,为了读取一个文件需要使用head、tail、cat等命令。这些命令需要重读地执行。watch命令可以用于定期地执行一个命令。 +服务器管理员需要维护系统并保持更新和安全。每天需要运行大量的指令。有些系统进程会记录日志。这些日志不断更新。为了检查这些更新,需要重复地执行命令。比如,为了读取一个日志文件需要使用head、tail、cat等命令。这些命令需要重复地执行。而watch命令可以用于定期地执行一个命令。 ### Watch 命令 ### @@ -8,45 +8,45 @@ watch是一个简单的命令,只有几个选项。watch命令的基本语法 watch [-dhvt] [-n ] [--differences[=cumulative]] [--help] [--interval=] [--no-title] [--version] -watch命令默认每隔2秒执行后面的命令。这个时间根据的是命令执行结束到上次执行的间隔来算的。比如,watch命令可以用于监测日志更新,更新时在文件的后面追加新行,因此tail命令可以用来检测文件的更新。这个命令会持续地运行直到你按下 CTRL + C回到提示符。 +watch命令默认每隔2秒执行后面参数给出的命令。这个时间根据的是命令执行结束到上次执行的间隔来算的。比如,watch命令可以用于监测日志更新,更新是在文件的后面追加新的内容,因此可以用tail命令来检测文件的更新(LCTT 译注:可以直接使用 `tail -f` 主动跟踪某个文件的更新,而不用使用 watch。)。这个命令会持续地运行直到你按下 `CTRL + C`回到提示符。 ### 例子 ### -> 每两秒监测 errors/notices/warning 生成的情况。 +每两秒监测 errors/notices/warning 生成的情况。 watch tail /var/log/messages ![tail messages](http://blog.linoxide.com/wp-content/uploads/2015/06/1.png) -> 用指定的时间监测磁盘的使用率。 +按指定的时间间隔监测磁盘的使用率。 watch df -h ![df -h](http://blog.linoxide.com/wp-content/uploads/2015/06/2.png) -> 对磁盘管理员而言关注高I/O等待导致的磁盘操作尤其是mysql事务是很重要的。 +对磁盘管理员而言,关注高I/O等待导致的磁盘操作尤其是mysql事务是很重要的。 watch mysqladmin processlist ![processlist](http://blog.linoxide.com/wp-content/uploads/2015/06/3.png) -> 监测服务器负载和运行时间。 +监测服务器负载和运行时间。 watch uptime ![uptime](http://blog.linoxide.com/wp-content/uploads/2015/06/10.png) -> 检测exim排队给用户发送通知队列的大小。 +监测exim给用户发送通知的队列大小。 watch exim -bpc ![exim -bpc](http://blog.linoxide.com/wp-content/uploads/2015/06/9.png) -### 1) 掩饰循环 ### +### 1) 指定延迟 ### watch [-n ] -命令默认运行的间隔用-n改变,下面的命令会在5秒后运行后面的命令: +命令默认运行的时间间隔可用-n改变,下面的命令会在5秒后运行后面的命令: watch -n 5 date @@ -58,13 +58,11 @@ watch命令默认每隔2秒执行后面的命令。这个时间根据的是命 watch [-d or --differences[=cumulative]] -#### 例子 1 #### - -用下面的命令连续地输出时间病观察高亮出来的不同部分。 +例子 1,用下面的命令连续地输出时间并观察高亮出来的不同部分。 watch -n 15 -d date -第一次执行date的输出会被捕捉,15后会会重复运行命令。 +第一次执行date的输出会被记录,15秒后会重复运行命令。 ![Difference A](http://blog.linoxide.com/wp-content/uploads/2015/06/6.png) @@ -72,9 +70,7 @@ watch命令默认每隔2秒执行后面的命令。这个时间根据的是命 ![Difference A](http://blog.linoxide.com/wp-content/uploads/2015/06/6b.png) -#### 例子 2 #### - -让我们来体验一下两个连续的“uptime”命令输出的不同。 +例子 2,让我们来体验一下两个连续的“uptime”命令输出的不同。 watch -n 20 -d uptime @@ -112,13 +108,13 @@ watch命令默认每隔2秒执行后面的命令。这个时间根据的是命 ![version](http://blog.linoxide.com/wp-content/uploads/2015/06/11.png) -**问题** +**不足** 不幸的是,在终端大小调整时,屏幕不能在下次运行前重画。所有用--difference高亮的内容也会在更新时丢失。 ### 总结 ### -watch对系统管理员而言是一个非常强大的工具因为它可以用于监控、日志、运维、性能和系统运行时的吞吐量。人们可以非常简单地格式化和推延watch的输出。任何Linux命令/程序或脚本可以按照所需监测和连续输出。 +watch对系统管理员而言是一个非常强大的工具,因为它可以用于监控、日志、运维、性能和系统运行时的吞吐量。人们可以非常简单地格式化和推延watch的输出。任何Linux命令/程序或脚本可以按照所需监测和连续输出。 -------------------------------------------------------------------------------- @@ -126,7 +122,7 @@ via: http://linoxide.com/linux-command/linux-watch-command/ 作者:[Aun Raza][a] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 08bddde2f878cc986d61456a921eb11feee9adf8 Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 5 Jul 2015 23:36:38 +0800 Subject: [PATCH 535/965] PUB:20150618 How to Setup Node.JS on Ubuntu 15.04 with Different Methods @NearTan --- ... on Ubuntu 15.04 with Different Methods.md | 37 +++++++++---------- 1 file changed, 18 insertions(+), 19 deletions(-) rename {translated/tech => published}/20150618 How to Setup Node.JS on Ubuntu 15.04 with Different Methods.md (82%) diff --git a/translated/tech/20150618 How to Setup Node.JS on Ubuntu 15.04 with Different Methods.md b/published/20150618 How to Setup Node.JS on Ubuntu 15.04 with Different Methods.md similarity index 82% rename from translated/tech/20150618 How to Setup Node.JS on Ubuntu 15.04 with Different Methods.md rename to published/20150618 How to Setup Node.JS on Ubuntu 15.04 with Different Methods.md index fbbaecb067..e9de420c7d 100644 --- a/translated/tech/20150618 How to Setup Node.JS on Ubuntu 15.04 with Different Methods.md +++ b/published/20150618 How to Setup Node.JS on Ubuntu 15.04 with Different Methods.md @@ -1,11 +1,11 @@ -在Ubuntu下用不同方式安装Node.JS +在Ubuntu下安装Node.JS的不同方式 ================================================================================ -如果你要在Ubuntu 15.04上安装Node.js的话,这篇教程对你来说肯定很重要。Node.js根本上来说就是一个运行在服务端上的封装好了输入输出流的javascript程序。Node.js巧妙的使用单线程的event loop来处理异步IO。同时它在平台层面上,面向系统拥有非常实用的文件读写,网络操作功能。所以这篇文章将展示在Ubuntu 15.04 server上不同的安装Node.Js的方式。 +如果你要在Ubuntu 15.04上安装Node.js的话,这篇教程对你来说肯定很重要。Node.js从本质上来说就是一个运行在服务端上的封装好了输入输出流的javascript程序。Node.js巧妙的使用单线程的事件循环来处理高吞吐量和非阻塞IO。同时它也是一个提供了通过操作系统读写文件和网络操作功能的平台层。所以这篇文章将展示在Ubuntu 15.04 server上不同的安装Node.Js的方式。 ### 安装Node.JS 的方法### -有许多不同的方法安装Node.JS,我们可以选择其一。通过本篇文章我们将手把手带着你在Ubuntu 15.04上安装Node.Js,在此之前请卸载旧版本的包以免发生包冲突。 +有许多安装Node.JS的不同的方法,我们可以选择其一。通过本篇文章我们将手把手带着你在Ubuntu 15.04上安装Node.Js,在此之前请卸载旧版本的包以免发生包冲突。 - 从源代码安装Node.JS - 用包管理器安装Node.JS @@ -14,7 +14,7 @@ ### 1) 从源代码安装Node.JS ### -让我们开始从从源代码安装Node.JS之前,请确认系统上的所有的依赖包都已经更新到最新版本。然后跟着以下步骤来开始安装: +让我们开始从源代码安装Node.JS之前,请确认系统上的所有的依赖包都已经更新到最新版本。然后跟着以下步骤来开始安装: #### 步骤1: 升级系统 #### @@ -33,7 +33,7 @@ #### 步骤3: 开始安装 #### -现在我们进入源代码的目录然后运行.configuration文件 +现在我们进入源代码的目录,然后运行.configure文件 ![NodeJS Configure](http://blog.linoxide.com/wp-content/uploads/2015/06/13.png) @@ -43,9 +43,9 @@ root@ubuntu-15:~/node-v0.12.4# ./configure root@ubuntu-15:~/node-v0.12.4# make install -### 安装后测试 ### +#### 安装后测试 #### -只要运行一次上面的命令就顺利安装好了Node.JS,现在我们来确认一下版本信息和测试以下Node.JS是否可以运行输出。 +只要运行一下上面的命令就顺利安装好了Node.JS,现在我们来确认一下版本信息和测试以下Node.JS是否可以运行输出。 root@ubuntu-15:~/node-v0.12.4# node -v v0.12.4 @@ -73,7 +73,7 @@ #### 步骤1: 用curl获取源代码 #### -在我们用curl获取源代码之前,我们必须先升级操作系统然后用curl命令获取NodeSource添加到本地仓库。 +在我们用curl获取源代码之前,我们必须先升级操作系统,然后用curl命令获取NodeSource添加到本地仓库。 root@ubuntu-15:~#apt-get update root@ubuntu-15:~# curl -sL https://deb.nodesource.com/setup | sudo bash - @@ -98,14 +98,13 @@ curl将运行以下任务 ![NodeJS Install](http://blog.linoxide.com/wp-content/uploads/2015/06/31.png) -#### STEP 3: Installing Build Essentials Tool #### #### 步骤3: 安装一些必备的工具 #### 通过以下命令来安装编译安装一些我们必需的本地插件。 root@ubuntu-15:~# apt-get install -y build-essential -### 通过Node.JS Shell来测试 ### +#### 通过Node.JS Shell来测试 #### 测试Node.JS的步骤与之前使用源代码安装相似,通过以下node命令来确认Node.JS是否完全安装好: @@ -127,7 +126,7 @@ curl将运行以下任务 > root@ubuntu-15:~# -### 使用NodeJS应用进行简单的测试 ### +#### 使用NodeJS应用进行简单的测试 #### REPL是一个Node.js的shell,任何有效的JavaScript代码都能在REPL下运行通过。所以让我们看看在Node.JS下的REPL是什么样子吧。 @@ -163,9 +162,9 @@ REPL是一个Node.js的shell,任何有效的JavaScript代码都能在REPL下 ![REPL Manual](http://blog.linoxide.com/wp-content/uploads/2015/06/4.png) -### 使用NodeJS的包管理器 ### +#### 使用NodeJS的包管理器 #### -NPM是一个提供给node脚本连续运行的命令行工具,它能通过package.json来安装和管理依赖包。最开始从初始化命令init开始 +NPM是一个提供给node脚本持续生命力的命令行工具,它能通过package.json来安装和管理依赖包。最开始从初始化命令init开始 root@ubuntu-15:~# npm init @@ -192,14 +191,14 @@ clone仓库之后,通过运行.config命令来编译生成完整的安装包 ![Configure Node](http://blog.linoxide.com/wp-content/uploads/2015/06/7.png) -运行make install命令之后耐心等待几分钟,程序将会安装好Node.JS +运行make install命令之后耐心等待几分钟,程序将会安装好Node.JS。 root@ubuntu-15:~/node# make install root@ubuntu-15:~/node# node -v v0.13.0-pre -### 测试Node.JS ### +#### 测试Node.JS #### root@ubuntu-15:~/node# node > a = [1,2,3,4,5,6,7] @@ -217,7 +216,7 @@ clone仓库之后,通过运行.config命令来编译生成完整的安装包 在最后一种方法中我们我们将用NVM来比较容易安装Node.JS。安装和配制Node.JS,这是最好的方法之一,它可以供我们选择要安装的版本。 -在安装之前,请确认本机以前的安装包已经被卸载 +在安装之前,请确认本机以前的安装包已经被卸载。 #### 步骤1: 安装依赖包 #### @@ -230,11 +229,11 @@ clone仓库之后,通过运行.config命令来编译生成完整的安装包 #### 步骤2: 修改Home环境 #### -用curl从NVM下载必需的包到用户的home目录之后,我们需要修改bash的配制文件添加NVM,之后只要重新登录中断或者用如下命令更新即可 +用curl从NVM下载必需的包到用户的home目录之后,我们需要修改bash的配置文件添加NVM,之后只要重新登录中断或者用如下命令更新即可。 root@ubuntu-15:~# source ~/.profile -现在我们可以用NVM来设置默认的NVM的版本或者用如下命令来指定之前版本: +现在我们可以用NVM来设置默认的NVM的版本,或者用如下命令来指定之前版本: root@ubuntu-15:~# nvm ls root@ubuntu-15:~# nvm alias default 0.12.4 @@ -257,7 +256,7 @@ via: http://linoxide.com/ubuntu-how-to/setup-node-js-ubuntu-15-04-different-meth 作者:[Kashif Siddique][a] 译者:[NearTan](https://github.com/NearTan) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From c34296631a8d5bb25ffe05048a5031f498026c42 Mon Sep 17 00:00:00 2001 From: DeadFire Date: Mon, 6 Jul 2015 16:16:17 +0800 Subject: [PATCH 536/965] =?UTF-8?q?20150706-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sources/tech/20150706 PHP Security.md | 359 ++++++++++++++++++++++++++ 1 file changed, 359 insertions(+) create mode 100644 sources/tech/20150706 PHP Security.md diff --git a/sources/tech/20150706 PHP Security.md b/sources/tech/20150706 PHP Security.md new file mode 100644 index 0000000000..b942069678 --- /dev/null +++ b/sources/tech/20150706 PHP Security.md @@ -0,0 +1,359 @@ +PHP Security +================================================================================ +![](http://www.codeproject.com/KB/PHP/363897/php_security.jpg) + +### Introduction ### + +When offering an Internet service, you must always keep security in mind as you develop your code. It may appear that most PHP scripts aren't sensitive to security concerns; this is mainly due to the large number of inexperienced programmers working in the language. However, there is no reason for you to have an inconsistent security policy based on a rough guess at your code's significance. The moment you put anything financially interesting on your server, it becomes likely that someone will try to casually hack it. Create a forum program or any sort of shopping cart, and the probability of attack rises to a dead certainty. + +### Background ### + +Here are a few general security guidelines for securing your web content: + +#### Don't trust forms #### + +Hacking forms is trivial. Yes, by using a silly JavaScript trick, you may be able to limit your form to allow only the numbers 1 through 5 in a rating field. The moment someone turns JavaScript off in their browser or posts custom form data, your client-side validation flies out the window. + +Users interact with your scripts primarily through form parameters, and therefore they're the biggest security risk. What's the lesson? Always validate the data that gets passed to any PHP script in the PHP script. In this article, we show you how to analyze and protect against cross-site scripting (XSS) attacks, which can hijack your user's credentials (and worse). You'll also see how to prevent the MySQL injection attacks that can taint or destroy your data. + +#### Don't trust users #### + +Assume that every piece of data your website gathers is laden with harmful code. Sanitize every piece, even if you're positive that nobody would ever try to attack your site. + +#### Turn off global variables #### + +The biggest security hole you can have is having the register_globals configuration parameter enabled. Mercifully, it's turned off by default in PHP 4.2 and later. If **register_globals** is on, then you can disable this feature by turning the register_globals variable to Off in your server's php.ini file : + + register_globals = Off + +Novice programmers view registered globals as a convenience, but they don't realize how dangerous this setting is. A server with global variables enabled automatically assigns global variables to any form parameters. For an idea of how this works and why this is dangerous, let's look at an example. + +Let's say that you have a script named process.php that enters form data into your user database. The original form looked like this: + + + +When running process.php, PHP with registered globals enabled places the value of this parameter into the $username variable. This saves some typing over accessing them through **$_POST['username']** or **$_GET['username']**. Unfortunately, this also leaves you open to security problems, because PHP sets a variable for any value sent to the script via a GET or POST parameter, and that is a big problem if you didn't explicitly initialize the variable and you don't want someone to manipulate it. + +Take the script below, for example—if the $authorized variable is true, it shows confidential data to the user. Under normal circumstances, the $authorized variable is set to true only if the user has been properly authenticated via the hypothetical authenticated_user() function. But if you have **register_globals** active, anyone could send a GET parameter such as authorized=1 to override this: + + + +The moral of the story is that you should pull form data from predefined server variables. All data passed on to your web page via a posted form is automatically stored in a large array called $_POST, and all GET data is stored in a large array called **$_GET**. File upload information is stored in a special array called $_FILES. In addition, there is a combined variable called $_REQUEST. + +To access the username field from a POST method form, use **$_POST['username']**. Use **$_GET['username']** if the username is in the URL. If you don't care where the value came from, use **$_REQUEST['username']**. + + + +$_REQUEST is a union of the $_GET, $_POST, and $_COOKIE arrays. If you have two or more values of the same parameter name, be careful of which one PHP uses. The default order is cookie, POST, then GET. + +#### Recommended Security Configuration Options #### + +There are several PHP configuration settings that affect security features. Here are the ones that should obviously be used for production servers: + +- **register_globals** set to off +- **safe_mode** set to off +- **error_reporting** set to off. This is visible error reporting that sends a message to the user's browser if something goes wrong. For production servers, use error logging instead. Development servers can enable error logging as long as they're behind a firewall. +- Disable these functions: system(), exec(), passthru(), shell_exec(), proc_open(), and popen(). +- **open_basedir** set for both the /tmp directory (so that session information can be stored) and the web root so that scripts cannot access files outside a selected area. +- **expose_php** set to off. This feature adds a PHP signature that includes the version number to the Apache headers. +- **allow_url_fopen** set to off. This isn't strictly necessary if you're careful about how you access files in your code—that is, you validate all input parameters. +- **allow_url_include** set to off. There's really no sane reason for anyone to want to access include files via HTTP. + +In general, if you find code that wants to use these features, you shouldn't trust it. Be especially careful of anything that wants to use a function such as system()—it's almost certainly flawed. + +With these settings now behind us, let's look at some specific attacks and the methods that will help you protect your server. + +### SQL Injection Attacks ### + +Because the queries that PHP passes to MySQL databases are written in the powerful SQL programming language, you run the risk of someone attempting an SQL injection attack by using MySQL in web query parameters. By inserting malicious SQL code fragments into form parameters, an attacker attempts to break into (or disable) your server. + +Let's say that you have a form parameter that you eventually place into a variable named $product, and you create some SQL like this: + + $sql = "select * from pinfo where product = '$product'"; + +If that parameter came straight from the form, use database-specific escapes with PHP's native functions, like this: + + $sql = 'Select * from pinfo where product = '"' + mysql_real_escape_string($product) . '"'; + +If you don't, someone might just decide to throw this fragment into the form parameter: + + 39'; DROP pinfo; SELECT 'FOO + +Then the result of $sql is: + + select product from pinfo where product = '39'; DROP pinfo; SELECT 'FOO' + +Because the semicolon is MySQL's statement delimiter, the database processes these three statements: + + select * from pinfo where product = '39' + DROP pinfo + SELECT 'FOO' + +Well, there goes your table. + +Note that this particular syntax won't actually work with PHP and MySQL, because the **mysql_query()** function allows just one statement to be processed per request. However, a subquery will still work. + +To prevent SQL injection attacks, do two things: + +- Always validate all parameters. For example, if something needs to be a number, make sure that it's a number. +- Always use the mysql_real_escape_string() function on data to escape any quotes or double quotes in your data. + +**Note: To automatically escape any form data, you can turn on Magic Quotes.** + +Some MySQL damage can be avoided by restricting your MySQL user privileges. Any MySQL account can be restricted to only do certain kinds of queries on selected tables. For example, you could create a MySQL user who can select rows but nothing else. However, this is not terribly useful for dynamic data, and, furthermore, if you have sensitive customer information, it might be possible for someone to have access to some data that you didn't intend to make available. For example, a user accessing account data could try to inject some code that accesses another account number instead of the one assigned to the current session. + +### Preventing Basic XSS Attacks ### + +XSS stands for cross-site scripting. Unlike most attacks, this exploit works on the client side. The most basic form of XSS is to put some JavaScript in user-submitted content to steal the data in a user's cookie. Since most sites use cookies and sessions to identify visitors, the stolen data can then be used to impersonate that user—which is deeply troublesome when it's a typical user account, and downright disastrous if it's the administrative account. If you don't use cookies or session IDs on your site, your users aren't vulnerable, but you should still be aware of how this attack works. + +Unlike MySQL injection attacks, XSS attacks are difficult to prevent. Yahoo!, eBay, Apple, and Microsoft have all been affected by XSS. Although the attack doesn't involve PHP, you can use PHP to strip user data in order to prevent attacks. To stop an XSS attack, you have to restrict and filter the data a user submits to your site. It is for this precise reason that most online bulletin boards don't allow the use of HTML tags in posts and instead replace them with custom tag formats such as **[b]** and **[linkto]**. + +Let's look at a simple script that illustrates how to prevent some of these attacks. For a more complete solution, use SafeHTML, discussed later in this article. + + function transform_HTML($string, $length = null) { + // Helps prevent XSS attacks + // Remove dead space. + $string = trim($string); + // Prevent potential Unicode codec problems. + $string = utf8_decode($string); + // HTMLize HTML-specific characters. + $string = htmlentities($string, ENT_NOQUOTES); + $string = str_replace("#", "#", $string); + $string = str_replace("%", "%", $string); + $length = intval($length); + if ($length > 0) { + $string = substr($string, 0, $length); + } + return $string; + } + +This function transforms HTML-specific characters into HTML literals. A browser renders any HTML run through this script as text with no markup. For example, consider this HTML string: + + Bold Text + +Normally, this HTML would render as follows: + + Bold Text + +However, when run through **transform_HTML()**, it renders as the original input. The reason is that the tag characters are HTML entities in the processed string. The resulting string from **HTML()** in plaintext looks like this: + + <STRONG>Bold Text</STRONG> + +The essential piece of this function is the htmlentities() function call that transforms <, >, and & into their entity equivalents of **<**, **>**, and **&**. Although this takes care of the most common attacks, experienced XSS hackers have another sneaky trick up their sleeve: Encoding their malicious scripts in hexadecimal or UTF-8 instead of normal ASCII text, hoping to circumvent your filters. They can send the code along as a GET variable in the URL, saying, "Hey, this is hexadecimal code, but could you run it for me anyway?" A hexadecimal example looks something like this: + + + +But when the browser renders that information, it turns out to be: + + + +To prevent this, transform_HTML() takes the additional steps of converting # and % signs into their entity, shutting down hex attacks, and converting UTF-8–encoded data. + +Finally, just in case someone tries to overload a string with a very long input, hoping to crash something, you can add an optional $length parameter to trim the string to the maximum length you specify. + +### Using SafeHTML ### + +The problem with the previous script is that it is simple, and it does not allow for any kind of user markup. Unfortunately, there are hundreds of ways to try to sneak JavaScript past someone's filters, and short of stripping all HTML from someone's input, there's no way of stopping it. + +Currently, there's no single script that's guaranteed to be unbreakable, though there are some that are better than most. There are two approaches to security, whitelisting and blacklisting, and whitelisting tends to be less complicated and more effective. + +One whitelisting solution is the SafeHTML anti-XSS parser from PixelApes. + +SafeHTML is smart enough to recognize valid HTML, so it can hunt and strip any dangerous tags. It does its parsing with another package called HTMLSax. + +To install and use SafeHTML, do the following: + +1. Go to [http://pixel-apes.com/safehtml/?page=safehtml][1] and download the latest version of SafeHTML. +1. Put the files in the classes directory on your server. This directory contains everything that SafeHTML and HTMLSax need to function. +1. Include the SafeHTML class file (safehtml.php) in your script. +1. Create a new SafeHTML object called $safehtml. +1. Sanitize your data with the $safehtml->parse() method. + +Here's a complete example: + + alert('XSS Attack')"; + // Create a safehtml object. + $safehtml = new safehtml(); + // Parse and sanitize the data. + $safe_data = $safehtml->parse($data); + // Display result. + echo 'The sanitized data is
' . $safe_data; + ?> + +If you want to sanitize any other data in your script, you don't have to create a new object; just use the $safehtml->parse() method throughout your script. + +#### What Can Go Wrong? #### + +The biggest mistake you can make is assuming that this class completely shuts down XSS attacks. SafeHTML is a fairly complex script that checks for almost everything, but nothing is guaranteed. You still want to do the parameter validation that applies to your site. For example, this class doesn't check the length of a given variable to ensure that it fits into a database field. It doesn't check for buffer overflow problems. + +XSS hackers are creative and use a variety of approaches to try to accomplish their objectives. Just look at RSnake's XSS tutorial at [http://ha.ckers.org/xss.html][2] to see how many ways there are to try to sneak code past someone's filters. The SafeHTML project has good programmers working overtime to try to stop XSS attacks, and it has a solid approach, but there's no guarantee that someone won't come up with some weird and fresh approach that could short-circuit its filters. + +**Note: For an example of the powerful effects of XSS attacks, check out [http://namb.la/popular/tech.html][3], which shows a step-by-step approach to creating the JavaScript XSS worm that overloaded the MySpace servers. ** + +### Protecting Data with a One-Way Hash ### + +This script performs a one-way transformation on data—in other words, it can make a hash signature of someone's password, but you can't ever decrypt it and go back to the original password. Why would you want to do that? The application is in storing passwords. An administrator doesn't need to know users' passwords—in fact, it's a good idea that only the user knows his or her password. The system (and the system alone) should be able to identify a correct password; this has been the Unix password security model for years. One-way password security works as follows: + +1. When a user or administrator creates or changes an account password, the system hashes the password and stores the result. The host system discards the plaintext password. +1. When the user logs in to a system via any means, the entered password is again hashed. +1. The host system throws away the plaintext password entered. +1. This newly hashed password is compared against the stored hash. +1. If the hashed passwords match, then the system grants access. + +The host system does this without ever knowing the original password; in fact, the original value is completely irrelevant. As a side effect, should someone break into your system and steal your password database, the intruder will have a bunch of hashed passwords without any way of reversing them to find the originals. Of course, given enough time, computer power, and poorly chosen user passwords, an attacker could probably use a dictionary attack to figure out the passwords. Therefore, don't make it easy for people to get their hands on your password database, and if someone does, have everyone change their passwords. + +#### Encryption Vs Hashing #### + +Technically speaking, this process is not encryption. It is a hash, which is different from encryption for two reasons: + +Unlike in encryption, data cannot be decrypted. + +It's possible (but extremely unlikely) that two different strings will produce the same hash. There's no guarantee that a hash is unique, so don't try to use a hash as something like a unique key in a database. + + function hash_ish($string) { + return md5($string); + } + +The md5() function returns a 32-character hexadecimal string, based on the RSA Data Security Inc. Message-Digest Algorithm (also known, conveniently enough, as MD5). You can then insert that 32-character string into your database, compare it against other md5'd strings, or just adore its 32-character perfection. + +#### Hacking the Script #### + +It is virtually impossible to decrypt MD5 data. That is, it's very hard. However, you still need good passwords, because it's still easy to make a database of hashes for the entire dictionary. There are online MD5 dictionaries where you can enter **06d80eb0c50b49a509b49f2424e8c805** and get a result of "dog." Thus, even though MD5s can't technically be decrypted, they're still vulnerable—and if someone gets your password database, you can be sure that they'll be consulting an MD5 dictionary. Thus, it's in your best interests when creating password-based systems that the passwords are long (a minimum of six characters and preferably eight) and contain both letters and numbers. And make sure that the password isn't in the dictionary. + +### Encrypting Data with Mcrypt ### + +MD5 hashes work just fine if you never need to see your data in readable form. Unfortunately, that's not always an option—if you offer to store someone's credit card information in encrypted format, you need to decrypt it at some later point. + +One of the easiest solutions is the Mcrypt module, an add-in for PHP that allows high-grade encryption. The Mcrypt library offers more than 30 ciphers to use in encryption and the possibility of a passphrase that ensures that only you (or, optionally, your users) can decrypt data. + +Let's see some hands-on use. The following script contains functions that use Mcrypt to encrypt and decrypt data: + + + +The **mcrypt()** function requires several pieces of information: + +- The data to encrypted. +- The passphrase used to encrypt and unlock your data, also known as the key. +- The cipher used to encrypt the data, which is the specific algorithm used to encrypt the data. This script uses **MCRYPT_SERPENT_256**, but you can choose from an array of fancy-sounding ciphers, including **MCRYPT_TWOFISH192**, **MCRYPT_RC2**, **MCRYPT_DES**, and **MCRYPT_LOKI97**. +- The mode used to encrypt the data. There are several modes you can use, including Electronic Codebook and Cipher Feedback. This script uses **MCRYPT_MODE_CBC**, Cipher Block Chaining. +- An **initialization vector**—also known as an IV, or a seed—an additional bit of binary data used to seed the encryption algorithm. That is, it's something extra thrown in to make the algorithm harder to crack. +- The length of the string needed for the key and IV, which vary by cipher and block. Use the **mcrypt_get_key_size()** and **mcrypt_get_block_size()** functions to find the appropriate length; then trim the key value to the appropriate length with a handy **substr()** function. (If the key is shorter than the required value, don't worry—Mcrypt pads it with zeros.) + +If someone steals both your data and your passphrase, they can just cycle through the ciphers until finding the one that works. Thus, we apply the additional security of using the **md5()** function on the key before we use it, so even having both data and passphrase won't get the intruder what she wants. + +An intruder would need the function, the data, and the passphrase all at once—and if that is the case, they probably have complete access to your server, and you're hosed anyway. + +There's a small data storage format problem here. Mcrypt returns its encrypted data in an ugly binary format that causes horrific errors when you try to store it in certain MySQL fields. Therefore, we use the **base64encode()** and **base64decode()** functions to transform the data into a SQL-compatible alphabetical format and retrieve rows. + +#### Hacking the Script #### + +In addition to experimenting with various encryption methods, you can add some convenience to this script. For example, rather than providing the key and mode every time, you could declare them as global constants in an included file. + +### Generating Random Passwords ### + +Random (but difficult-to-guess) strings are important in user security. For example, if someone loses a password and you're using MD5 hashes, you won't be able to, nor should you want to, look it up. Instead, you should generate a secure random password and send that to the user. Another application for random number generation is creating activation links in order to access your site's services. Here is a function that creates a password: + + 0) && + (! is_null($num_chars))) { + $password = ''; + $accepted_chars = 'abcdefghijklmnopqrstuvwxyz1234567890'; + // Seed the generator if necessary. + srand(((int)((double)microtime()*1000003)) ); + for ($i=0; $i<=$num_chars; $i++) { + $random_number = rand(0, (strlen($accepted_chars) -1)); + $password .= $accepted_chars[$random_number] ; + } + return $password; + } + } + ?> + +#### Using the Script #### + +The **make_password()** function returns a string, so all you need to do is supply the length of the string as an argument: + + + +The function works as follows: + +- The function makes sure that **$num_chars** is a positive nonzero integer. +- The function initializes the **$password** variable to an empty string. +- The function initializes the **$accepted_chars** variable to the list of characters the password may contain. This script uses all lowercase letters and the numbers 0 through 9, but you can choose any set of characters you like. +- The random number generator needs a seed, so it gets a bunch of random-like values. (This isn't strictly necessary on PHP 4.2 and later.) +- The function loops **$num_chars** times, one iteration for each character in the password to generate. +- For each new character, the script looks at the length of **$accepted_chars**, chooses a number between 0 and the length, and adds the character at that index in **$accepted_chars** to $password. +- After the loop completes, the function returns **$password**. + +### License ### + +This article, along with any associated source code and files, is licensed under [The Code Project Open License (CPOL)][4] + +-------------------------------------------------------------------------------- + +via: http://www.codeproject.com/Articles/363897/PHP-Security + +作者:[SamarRizvi][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.codeproject.com/script/Membership/View.aspx?mid=7483622 +[1]:http://pixel-apes.com/safehtml/?page=safehtml +[2]:http://ha.ckers.org/xss.html +[3]:http://namb.la/popular/tech.html +[4]:http://www.codeproject.com/info/cpol10.aspx \ No newline at end of file From e57ac3817f86e930f40aafd7e761da3b948f19e6 Mon Sep 17 00:00:00 2001 From: ZTinoZ Date: Mon, 6 Jul 2015 17:50:07 +0800 Subject: [PATCH 537/965] Translating by ZTinoZ --- ...re Made Easy with these Dedicated Tools.md | 40 +++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/sources/share/20150625 Screen Capture Made Easy with these Dedicated Tools.md b/sources/share/20150625 Screen Capture Made Easy with these Dedicated Tools.md index fb0159ca6a..f8ac9a2db1 100644 --- a/sources/share/20150625 Screen Capture Made Easy with these Dedicated Tools.md +++ b/sources/share/20150625 Screen Capture Made Easy with these Dedicated Tools.md @@ -85,31 +85,31 @@ HotShots无法从Ubuntu的Software Center中获取,不过用以下命令可以 ![ScreenCloud in action](http://www.linuxlinks.com/portal/content/reviews/Graphics/Screenshot-ScreenCloud.png) -ScreenCloud is an easy to use open source screenshot tool. +ScreenCloud是一款易于使用的开源截图工具。 -With this software, users can take a screenshot using one of the 3 hotkeys or simply click the ScreenCloud tray icon. Users can choose where you want to save the screenshot. +在这款软件中,用户可以用三个热键中的其中一个或只需点击ScreenCloud托盘图标就能进行截图,用户也可以自行选择保存截图的地址。 -If you choose to upload your screenshot to the screencloud website, a link will automatically be copied to your clipboard. This can be shared with friends or colleagues via email or in an IM conversation. All they have to do is click the link and look at your screenshot. +如果你选择上传你的截图到screencloud主页,链接会自动复制到你的剪贴板上,你能通过email或在一个聊天对话框里和你的朋友同事分享它,他们肯定会点击这个链接来看你的截图的。 -Features include: +包含特性: -- Capture full screen, window or selection -- Fast and easy: Snap a photo, paste the link, done -- Free hosting of your screenshots -- Hotkeys -- Set timer delay -- Enable 'Capture window borders' -- Enable/Disable Notifications -- Set app to run on start up -- Adjust account/upload/filename/shortcut settings -- Cross platform tool -- Plugin support, save to Dropbox, Imgur, and more -- Supports uploading to FTP and SFTP servers +- 捕捉整个屏幕,窗口和截选区域 +- 快速又简单:截取图片,粘贴链接,完成 +- 免费托管你的截图 +- 热键 +- 设置定时器延迟 +- 允许 '捕捉窗口边框' +- 启用/禁用通知 +- 设置开机自启动 +- 调整账户/上传/文件名/快捷方式的设置 +- 跨平台工具 +- 插件支持:保存至Dropbox,Imgur等等 +- 支持上传至FTP和SFTP服务器 -- Website: [screencloud.net][3] -- Developer: Olav S Thoresen -- License: GNU GPL v2 -- Version Number: 1.2.1 +- 主页: [screencloud.net][3] +- 开发者: Olav S Thoresen +- 许可证: GNU GPL v2 +- 版本号: 1.2.1 ---------- From a2479964eaa7e43eb07a721ce62e7ba131d37be8 Mon Sep 17 00:00:00 2001 From: wxy Date: Mon, 6 Jul 2015 22:24:09 +0800 Subject: [PATCH 538/965] PUB:20150618 What will be the future of Linux without Linus @wi-cuckoo --- ...ll be the future of Linux without Linus.md | 186 +++++++++++++++++ ...ll be the future of Linux without Linus.md | 189 ------------------ 2 files changed, 186 insertions(+), 189 deletions(-) create mode 100644 published/20150618 What will be the future of Linux without Linus.md delete mode 100644 translated/talk/20150618 What will be the future of Linux without Linus.md diff --git a/published/20150618 What will be the future of Linux without Linus.md b/published/20150618 What will be the future of Linux without Linus.md new file mode 100644 index 0000000000..ff30e8b4cf --- /dev/null +++ b/published/20150618 What will be the future of Linux without Linus.md @@ -0,0 +1,186 @@ +没有 Linus,Linux 的未来是什么样子? +============================================================================== +![](http://i2.wp.com/www.linuxveda.com/wp-content/uploads/2015/06/linus-torvalds-painting.jpg) + +这次采访是《Linux For You》杂志在2007年进行的,现在我们发表在这里是为了存档的目的。 + +**Q:对于 Linux 内核,未来的计划/道路/提升是怎样的?** + +Linus:我从来没有太多的预见性 — 与其从宏大的计划上看未来,我倾向于从一个相对短的时间框架,比如“几个月之后的事情”。我是一个忠实的‘细节成败论’的信仰者,如果你抓住了细节,再大的问题也会大事化小,小事化无。 + +所以,对于五年后内核会是什么样,我真的没有任何远见 — 仅仅是希望我们能够持续专注于Linux的发展。实际上,对于我个人来说,我最担心的事情之一甚至不是技术问题,而是确保这个‘过程’正常,这样人们才可以相互协作好。 + +**Q:你怎么看 Linux 和 Solaris 之间的关系在未来的发展?它会如何使用户受益?** + +Linus:我并没有看到太多交叉的地方,除了我认为 Solaris 会使用更多的 Linux 用户空间工具(对我自己来说并没有太多关注这个,因为我真的只关心内核)。Linux 桌面比起传统 Solaris 桌面好多了,而且我希望 Solaris 移植越来越多的 Linux 的东西,朝着一个更加类 Linux 的模式前进。(LCTT 译注:时至今日,我们还需要讨论 Solaris 吗?/cry ,但是当时,整个开源社区确实期望接受 Solaris 一些遗产。) + +从纯内核方面讲,许可证的存在意味着没有太多的合作空间,但是如果这种情况发生改变将会变得很有趣。Sun 已经声称将在 GPL(v2 或 v3)下授权 Solaris,如果这种许可证的差异消失,那么会导致一些有趣的技术出现。但对此,我持观望态度。 + +**Q:现在 GPL v3 已经完成并发布了,你是否预见有什么情况会鼓励你开始移植内核到 Solaris 上去?或者,从你的角度看,它是否很糟糕以至于你从来没考虑过它?** + +Linus:我觉得相比于早先的草稿,v3 有了很多提高,并且我也不认为它是一个糟糕的许可证。我只是认为它没有 GPLv2 一样‘伟大’。 + +所以,如果没有 GPLv2,我觉得自己将会使用 GPLv3。不过,既然我已经有了一个更好的选择,我为什么还要考虑它呢? + +这就是说,我始终秉承实用主义精神,并且我认为“ GPLv3 不像 GPLv2 一样好”这件事并不是一个‘非黑即白’的问题。这就像是一个天平,如果 GPLv3 有了其他的优点作为砝码,很有可能那些优点会让我对 GPLv3 更偏爱一些。 + +恕我直言,我到现在还并没有看到任何优点,但是如果 Solaris 真的在 GPLv3 下发布,可能避免不必要的许可证不兼容性这一条就分量足够了,足以值得我们去尝试将 Linux 的内核重新在 GPLv3 许可证下发布。不过,请不要误解,我认为这是不大可能的。但是我确实想澄清我本质上并不是一个许可证偏执者。我认为 GPLv2 是毫无疑问的好许可证,但是许可证并不是一切。(LCTT 译注:事实上,Solaris/OpenSolaris 最终也没采用 GPL 许可协议发布,而 20100年之后,已经没有什么动静了。而 Linux 内核最终也没有更换到 GPLv3 上。) + +总的来说,我使用很多其他许可证下的程序。我可能没有把任何一个我自己做的项目放在 BSD(或 X11—MIT)许可证下,但是我认为它是一个伟大的许可证,对于其他项目来说,它可能是最佳的选择。 + +**Q:目前有没有任何你想特别提出作为 Linux 内核的关键贡献者的印度人?** + +(LCTT 译注:本篇访谈中提到多次印度,是因为访谈者是印度人。) + +Linus:我不得不承认,我并没有与来自印度的任何人直接合作过,尽管我已经非常有意识地努力建立一个规模庞大的内核开发团队,这样我不用总是独自工作。 + +我相信大多数人的社交基本上是受限制的,只对很少的人十分了解(比如你最亲近的家人和朋友),我也努力构造这样一个开发模型来改变这种状况:通过一个‘开发者网络’,人们可以在此互动,可能是与一批你信任的人,而且那些人反过来与他们信任的一群人互动。 + +所以,我偶然会与上百个发给我一两个不确定的补丁的开发者联系。我试着去建立一些由我熟知的人组成的小团体,我认为那就是人们工作的方式,当然也是我喜欢工作的方式。 + +同时,坦白地说,我甚至不知道许多与我一起工作的人生活在哪里。地理位置成了十分次要的东西。所以我很确信与我工作最紧密的前10—15个人中,没有印度的,可能这话稍后传到公众耳里,然后被指出确实有一些人来自那里! + +**Q:因为 Linux 的内核开发对你依赖如此严重,你如何计划组织或重组,让它在没有你的情况下继续发展,假设你决定花更多的时间在你自己的生活和家庭上面的话?** + +Linus:现在 Linux 比我重要得多,为了今天这一步我已经工作了很长时间。是的,我仍然十分密切地参与其中,而且我对其有着想当大的日常影响,我最终会是这样一个人——在某种程度上,扮演着许多内核开发活跃者的中心;但是,我不会说 Linux “严重依赖”于我。 + +所以,如果我得了心脏病并且明天就死了(很高兴没这种可能:我显然在任何方面都很健康),人们肯定会注意到,但是有成千上万的人为内核工作,并且不止一两个人能够毫无困难地接替我的角色。 + +**Q:印度是软件工程师的主要产地之一,但是我们没有在 Linux 领域做太多贡献。你觉得为什么印度人没有积极参与Linux?如果我们鼓励印度人参与并为 Linux 做更大的贡献,你觉得如何?你会乐意用你个人作为榜样激励印度工程师吗?** + +Linus:对我来说,这确实是一个不好回答的问题。参与开源取决于两方面的基础条件:信息流和文化(用你的话说是互联网和教育),我甚至不知道这其中哪个是最大的障碍。 + +在很多方面,至少在那些印度讲英语文化的地方,参与 Linux 和其他开源项目是相对容易的,如果仅仅是由于语言门槛的话。这当然比起亚洲的许多地方,甚至欧洲的一些地方要容易些。 + +当然,这只是一些人,并不等同于印度的大部分群体,而且我自己关于印度的情况也知道不多,甚至没法不太负责的猜测最好的途径是什么。我猜一个热情的本地用户社区会是最好的途径,而且我猜测你们已经拥有这样的社区了。 + +至于我的‘偶像’形象,我自己不以为然。我不是一个伟大的公众演讲者,而且我最近些年已经避免出游,因为被看做符号化的‘偶像’让我很不自在。我就是一个工程师而已,而且我仅仅是喜欢我做的事情,并与社会上其他人一起工作。 + +**Q:什么样的理由会让你考虑去访问印度?** + +Linus:如前一个回答中提到,我十分讨厌公开演讲,所以我才想避免开会等等这些事。我更愿意某天去印度度个假,但是如果我这样做,我可能悄悄地干 — 出行之前不告诉任何人,仅仅作为一个游客去游览印度!(LCTT 译注:所以 Linus 不来中国的道理是同样的,除非在中国召开一次世界性的 LinuxCon。) + +**Q:最近你好像在抨击 Subversion 与 CVS,质问他们的架构基础。现在你已经从 Subversion 和 CVS 社区那里得到回应,你是否改变了看法,还是说并没有被说服?** + +Linus:因为我发现这个争论很有趣,所以我想做一个强硬的声明。换句话说,我确实‘喜欢’争论。并不是不经思考的,但是我确实想要让争论更热烈些,而不仅仅是完全的柏拉图式的。 + +做出强硬的争论有时会引来一个非常合理的反驳,然后我会很高兴地说:“噢,好吧,你是对的。” + +但是话说回来,对 SVN/CVS 并不会发生这种情况。我怀疑很多人并不是真的很喜欢 CVS,所以我真的不觉得会有谁坚持认为 CVS 就是一切,而不是一个老旧系统。要是我知道之前就有人这样认为的话,我就不会那么不礼貌地反对 SVN(嘿,这么说没错 — 我真的不是一个非常礼貌的家伙!),我不相信任何人会认为 SVN 是‘好的’。 + +我认为,SVN 就是一个‘还好’的经典案例。人们过去经常使用 SVN,并且它也‘还好’地广泛使用,但是它的‘还好’就如 DOS 与 Windows 的‘还好’一样。不是什么伟大的技术,只是普遍适用而已,同时它对人们来说运行良好,看着十分熟悉。但是很少有人以此为傲,或者对其感到兴奋。 + +Git,从另外方面讲,其身后有一些‘UNIX 哲学’,这和 UNIX 无关。实质上,就像原始的 UNIX,在它身后有一个基本理念。对 UNIX 来说,最底层的哲学就是,“所有东西只是一个文件”。对 Git 来说,“则是每个东西只是内容寻址数据库中的一个对象”。 + +**Q:现在如此多的发行是好事还是坏事?选择是很有意思的,但是选择太多了就是干扰。相较于这么多的人每天花费数小时去构建成百上千的发行版,如果人们可以一起来支持少数的发行版,这样在企业级市场去挑战微软是不是更容易些呢?对此你怎么看?** + +Linus:我认为多个发行版是开源不可回避的部分。它会造成困惑吗?当然。它会变得低效率吗?是的。但是我喜欢拿它与政治比较:‘民主’也有那些令人困惑的选择,往往没有任何一个选择是你‘真正’想要的。而且有时候,如果你不需要操心选举、不同党派和联合等等方面的困惑的话,你可能会感觉事情更加容易一些,更有效率一些。 + +但是最后我想说,选择可能会导致低效率,但是它也让每个人至少保留了‘所谓的’诚信。我们可能都希望我们的政治家更诚信,我们也希望不同的发行版可以让我们有一天有其他的选择,而如果没有选择的话,事情可能会更糟。 + +**Q:为什么你觉得 CFS 比 SD 更好?** + +Linus:一部分原因是我与 Ingo [Molnar] 工作过很长一段时间,也就是说,我了解他,并且知道他会对发生的任何问题非常负责。那种品质是非常重要的。 + +但是一部分原因就简单的与用户有关,大多数人实际上表示 CFS 比 SD 好。包括许多 3D 游戏方面(这是人们声称 SD 最强的一点)。 + +尽管如此,我认为并不是任何一段代码都十分‘完美’。最好的情况是,想成为 SD 支持者的人会努力提高 SD,从而通过其它方式取得了平衡 — 而我们会保持两个阵营都尝试有趣的事情,因为内部的竞争会刺激他们。 + +**Q:在 Google 的一次关于 Git 的访谈中,有人问你如何将当前集中存放的超大代码库迁移到 git 上,而不用将开发工作停止六个月。你对此的回答是什么?** + +Linus:啊哈,那个问题我在现场没有听清楚(在录音里,问题会听得更清楚些),当我回头去听录制的音频,注意到了我没有回答他的问题,但是我觉得这问题他问过。 + +无论如何,我们确实有很多导入的工具,所以你实际上可以仅仅是将一个大的项目从任何其他的早期的 SCM (源代码控制系统)导入到 git 里,但问题显然不是经常以导入动作本身结束,而是需要‘习惯’这种新模式! + +坦白来说,我认为关于如何‘习惯它’没有任何其他答案,而只能是去开始使用和尝试它。显然,你不会冒险率先导入你现有的最大、最重要的项目,那确实会导致工作停顿下来,然后使得每个人都很不高兴。 + +所以没有任何理智健全的人会拥护在一夜之间将一切移到 git 上去,并强迫人们改变他们的环境。是的,你需要从公司里的小项目开始,可能是一些由一个小组主要控制和维护的项目,然后开始转移其到 git。这是你能让人们习惯这种模式的方式,你应该以一个核心的组开始,他们知道 git 如何工作,如何在公司里面使用它。 + +接着,你就会铺展开来。并不需要一次到位。你会导入越来越多的项目 — 甚至是在你公司里采用‘单一大型仓库’模式;那个仓库基本上是作为许多模块的集合,因为让每个人去检查每件事不是一个可执行的工作模型(除非这个‘每件事’并不非常大)。 + +所以,你基本上只会一次转移一个模块,直到你发现使用 git 是如此酸爽,这时你可以移植余下的所有(或者‘余下’的太旧了,没有人用了)。 + +git 最赞的一个功能是,它实际上可以同很多其他 SCM 相处很好。很多 git 用户使用它的时候,与他们一起工作的人并没有发现,因为他们看到 git 的结果,会联想到一些传统的 SCM 上去。 + +**Q:Linux 用了你在 Transmeta(全美达)上实现备用指令集的经验吗?[Transmeta Crusoe 芯片看起来像一个非常轻量级的 CPU — 记得有一台 Burroughs B1000 解释器,它实际上实现了多个虚拟机。有的用于系统软件,有的用于 Cobol,还有的用于 Fortran;如果没错的话,那么人们可以在芯片上实现 Burroughs 6/7000 或者 HP3000 类似的堆栈架构,或适用于 JVM 的指令集,等等。(LCTT 译注:Linus 于 1997-2003 期间就职于全美达)]** + +Linus:我们确实有一些备选的结构集合,不过我不打算谈论太多这个,我可以说的是我们已经做了一个混合结构集合的公开演示。我们有一个技术展示,在那里你同时可以跑 x86 指令和 Java 字节码(实际上,它是一个轻量的扩展 pico—java,iirc)。 + +我想我们展示的这个应用会在 Linux 上运行 DOOM,这里 Linux 的部分是一个完全标准 x86 发行版。但是 DOOM 的二进制程序是一个特定的编译版本,它实际上编译为 pico-java 代码。而 CPU 最终以相同的方式来运行它们——从 JIT 到原生 VLIW 指令集。 + +(选择 DOOM 的原因仅仅是其源代码可用,并且游戏的核心部分非常小,足以很容易拿它来做一个验证 — 而且它也显然看起来十分有趣。) + +有更多的事情是在内部运作,但是我不能谈论他们。而且实际上,就我个人而言,对 Java 不怎么感冒。 + +**Q:386BSD 衍生了 NetBSD,FreeBSD 和 OpenBSD,在 Linux 出现之前已经发展不错了,但是 Linux 传播比 386BSD 及其衍生者更为广泛。这在多大程度上左右你对许可证的选择,这个选择的发展过程是怎样的?你不认为比起 GPLv2 来,是 GPLv3 创造了发展空间,迄今为止,让 Linux 比 BSD 变得更好?** + +Linus:我认为这不仅是一个许可证问题,也是一个社区及人格问题。BSD 的许可证总是鼓励分叉,但是这也意味着,如果某些人取得了成功并做了商业性的分叉,他并不需要将他的修改返回来。因此,哪怕实际上这种事情没有(而实际上,这种事情的确发生了,比如 BSDi),人们也难以建立彼此信任。 + +相比之下,GPLv2 也鼓励分叉,但是它不仅仅鼓励分叉出去,它也鼓励(并‘要求’)能够融合回来。所以,我们现在达到了新的层次的信任:你‘知道’每个人都被许可证所约束,所以每个人都不会占你便宜。 + +所以,在我看来,GPLv2 作为许可证来说,它允许人们在要求总是回馈贡献的前提下,在另外的方面取得了最大可能的自由。没有人能阻止你对源代码的改进。 + +那么,BSD 许可证是更‘自由’的吗?是的,毫无疑问。但是我不会在我在意的任何项目里面使用 BSD 许可证,因为我不仅仅想要自由,我也想要信任,可以让我总是能使用其他人为我的项目所写的代码。 + +所以对于我来说,GPLv2 最终在‘尽可能自由’上取得了完美的平衡,这样,我们做到了让每个人都能信任,他们总是可以取得源代码并使用它。 + +这就是为什么我认为 GPLv3 最终并没多大意思,它不再是那种‘返回源代码’的信任;它退化成了‘我写了这些代码,所以我能控制你如何使用它’。 + +换言之,我只是觉得 GPLv3 太狭隘和自私了。我认为 GPLv2 在‘自由’和‘信任’之间取得伟大的平衡。它不如 BSD 许可证自由,但是它让你安心回馈,而且它符合我认为的‘以德报德’:我给你源代码,你也回馈我源代码。 + +而 GPLv3 试着控制源代码的‘使用’。现在它就是“我给你我的源代码,如果你使用它的话,你就准备好让我对你的设备动手动脚吧”,看见了没?在我看来,不但小气,而且小心眼。 + +**Q:-rt 代码树的功能正在缓慢而稳定地逐渐集成到主线代码中。你对将剩余的 -rt 树合并到主线代码的看法是什么?(我说的不是 CFS)** + +Linus: 我不能保证来自 -rt 的一切‘都’会被合并进入标准内核(有一些部分肯定不适合常规的内核),不过是的,这些年来我们实际上将它的大部分都集成进去了,剩下的部分最终以后也会合并进去。 + +我提倡高效工作,但是我同时也很保守。我退回了一些激进的合并请求,只是因为我需要确保它们对我们所有人都有意义,不仅仅是用于极端情况下的实时环境,而且也对并不需要这种环境的‘普通’用户有用。这解释了为什么这个过程相当缓慢却稳定不断地合并代码,因为它需要足够稳定和有意义。 + +顺便说一句,这不仅仅是针对 -rt ,它也出现在许多开发中。-rt 出现这种情况是因为它是更‘直接’的内核项目,而且也是因为它的一个主要开发者直接参与到了常规内核开发。通常其它功能的迁移(安全、虚拟内核变化、虚拟化,等等)也遵循类似的方式:他们针对特定的环境进行开发,然后这些功能片段缓慢而稳步地合并到标准内核。 + +**Q:我对 Linux 内核所支持的文件系统发展很感兴趣。你觉得 Reiser4、XFS4、ZFS 以及 Oracle 的新项目哪个更有前途?这些天 ZFS 有不少新闻,Reiser4 也发布了很不错的性能基准测试,XFS4 正紧随其后,而 Oracle 发布的那个也有很多像 Sun 的 ZFS 一样的特性。我们将走向何方呢?以你的观点来看,哪个文件系统更有前途?** + +Linus: 实际上,就在昨天我们发现了一个 git 的性能问题,有一个用户发现他采用 ZFS 要比 UFS 慢一个数量级(不是在 Linux 下,git 已经得到了许多关注,甚至是来自内核开发团队之外)。所以,我认为许多‘新文件系统’的拥护者部分原因是因为他们了解到旧文件系统的不足,然后(有点不切实际地)期望一个‘崭新的、改进的’文件系统能使一切都完美。 + +最后,这是一个永无止境的领域,看看谁是最终的赢家——也许并不需要(看起来不需要)一个赢家。几乎总是这样,对文件系统的选择最终取决于负载和环境。 + +相比你提到的这些文件系统,我个人对基于闪存的硬盘很快就可以供甚至是‘普通’用户使用的这个事实更感到兴奋。当然,它们仍然很昂贵(而且相当的小),但是基于闪存的存储和传统硬盘的性能完全不可同日而语,我怀疑它们最终将对文件系统的设计有巨大的影响。而现在,多数文件系统的设计都是在考虑如何处理硬盘延迟。 + +**Q:操作系统变得越来越不重要。你说过好几次用户根本不应该‘看见’操作系统。应用更为重要。基于浏览器的应用,如 Google 的办公软件影响力越来越大。你认为操作系统将走向何方?** + +Linus:我并不真的认可‘浏览器 OS’,因为我认为人们总是需要在本地做一些事情。也许是因为安全,或者仅仅是因为隐私的原因。而且即便当到处可以接入时,它也并不是‘无处不在’。 + +所以我认为,整个‘Web OS’这件事有一部分是真实的,但是另外一部分人们也许忘记了操作系统已经存在了几十年,它已经相当稳定,而且它的发展是有目共睹的。人们真的不应该期望操作系统有魔法般的变化,现在已经不是操作系统刚刚起步的六十年代,甚至连硬件也和过去完全不同了! + +所以,别指望一场革命。我认为操作系统将在很大程度上继续它们所擅长的,当然,我们也会进步,但是我不认为会从根本上改变。也许会发生巨变的是界面和操作系统顶层的那些东西(当然,操作系统下面的硬件也会继续进步),这显然才是人们所关心的。 + +至于操作系统?它显然是应该尽可能隐藏起来的东西。你真的不应该在意它,除非你特别想知道在机器里面真正在发生什么。 + +**Q:最近我听说你正在使用一台 PPC G4/5 作为个人计算机,你使用它来做什么?为什么呢?** + +Linus:我最终放弃了那台 PowerPC,因为没有人能在这台工作站上做到更多,特别是,自从 x86-64 开始变得越来越强大了。所以这些天,我在用一台标准的 PC,里面是一个普通的 Core 2 Duo CPU。 + +在其它架构下运行是非常有趣的(alpha 作为我的主要架构运行了好几年,所以这并不是第一次),但是这种 CPU 得当成商品买得到才行。我认为,唯一能取代 x86 架构的,也许未来十年并不需要使用 x86 作为主要架构,我认为或许是 ARM,这得益于移动设备市场的发展。 + +**Q:Linux 对你意味着什么?一种业余爱好、哲学、人生意义、工作、最好的操作系统,还是什么?** + +Linus:它是所有的这一切。它是爱好,而且是具有深刻意义的爱好。最好的爱好是你‘真的’非常在意它。这些日子里,它显然也是我的工作,我非常高兴工作和兴趣能合二为一。 + +我不了解所谓的‘哲学’,我并不真的是因为深层次的道德或哲学的原因才做的 Linux,但是可以肯定的是,对开源的深层思考是我非常重视的。所以我并不是因为什么明确的理由做 Linux,也不能说是它在激励我,但是我的确在思考开源是如何工作。 + +**Q:微软的‘黑衣人’有没有和你交谈过?** + +Linus:我从来没有真正和微软交谈过,没有。我偶尔会和一些微软的人出现再同一个会议上(我比以前参加的会议更多了),但是我从来和他们没有任何关系。我认为彼此都很谨慎吧。 + +-------------------------------------------------------------------------------- + +via: http://www.linuxveda.com/2015/06/17/what-happens-to-linux-after-linus/ + +作者:[Swapnil Bhartiya][a] +译者:[wi-cuckoo](https://github.com/wi-cuckoo),[wxy](https://github.com/wxy) +校对:mahua, [wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.linuxveda.com/author/arnieswap/ + diff --git a/translated/talk/20150618 What will be the future of Linux without Linus.md b/translated/talk/20150618 What will be the future of Linux without Linus.md deleted file mode 100644 index c880921853..0000000000 --- a/translated/talk/20150618 What will be the future of Linux without Linus.md +++ /dev/null @@ -1,189 +0,0 @@ -没有 Linus,Linux 的未来是什么样子? -============================================================================== -![](http://i2.wp.com/www.linuxveda.com/wp-content/uploads/2015/06/linus-torvalds-painting.jpg) - -这次采访是《Linux For You》杂志在2007年进行的,现在我们发表在这里是为了存档的目的。 - -**Q:对于 Linux 内核,未来的计划/道路/提升是怎样的?** - -Linus:我从来没有太多的预见性 — 与其从宏大的计划上看未来,我倾向于从一个相对短的时间框架,比如“几个月之后的事情”。我是一个忠实的‘细节成败论’的信仰者,如果你抓住了细节,再大的问题也会大事化小,小事化无。 - -所以,对于五年后内核会是什么样,我真的没有任何远见 — 仅仅是一个非常普遍的计划,确保我们对其保持关注。实际上,对于我个人来说,我最担心的事情之一甚至不是技术问题,而是确保这个‘过程’正常,这样人们才可以相互协作好。 - -**Q:你怎么看 Linux 和 Solaris 之间的关系在未来的发展?它会如何使用户受益?** - -Linus:我并不能看到整个重叠的地方,除了我认为 Solaris 会开始使用更多的 Linux 用户空间的工具(显然对我自己来说没有太多关注这个 — 我真的只关心内核)。Linux 的桌面比起传统 Solaris 拥有的好多了,而且我希望 Solaris 移植越来越多的Linux的东西,朝着一个更加类 Linux 的模型前进。(LCTT 译注:时至今日,我们还需要讨论 Solaris 吗?/cry ) - -从纯内核方面讲,许可证的差异意味着没有太多的合作,但是如果看到这种情况改变会很有趣。Sun 已经声明在 GPL(v2 或 v3)下授权 Solaris,如果这种许可证差异消失,那么会导致一些有趣的技术出现。但对此,我持观望态度。 - -**Q:现在 GPL v3 已经完成并发布了,你是否预见有什么情况会鼓励你开始移植内核到 Solaris 上去?或者,从你的角度看,它是否很糟糕以至于你从来没考虑过它?** - -Linus:我觉得相比于早先的草稿,v3 有了很多提高,并且我也认为它不是一个糟糕的许可证。我只是认为它没有 GPLv2一般的‘伟大’。 - -所以,由于没有了 GPLv2,我觉得自己将会使用 GPLv3。不过,如果我有了一个更好的选择,我为什么不应该考虑一下呢? - -这就是说,我努力保持实用主义精神,并且我认为 GPLv3 不像 GPLv2 一样好这件事并不是一个‘非黑即白’的问题。这是一个平衡做法。如果 GPLv3 有其他的优点,可能那些优点会在很大程度上扭转喜爱 GPLv3 的天平。 - -恕我直言,我并没有看到任何优点,但是如果 Solaris 真的在 GPLv3 下发布,可能避免不必要的非兼容的许可证这条足够称为一个优点,可能也许值得去尝试将Linux的内核重新在 GPLv3 许可证下发布。 - -不要误解我 — 我认为这是不大可能的。但是我确实想澄清我本质上不是一个许可证偏执者。我认为 GPLv2 是毫无疑问的好许可证,但是许可证并不是一切。 - -总的来说,我使用很多其他许可证下的程序。我可能没有把一个我自己做的项目放在 BSD(或 X11—MIT)许可证下,但是我认为它是一个伟大的许可证,对于其他项目来说,它可能是最佳的选择。 - -**Q:目前有没有任何你想特别提出作为 Linux 内核的关键贡献者的印度人?** - -(LCTT 译注:本篇访谈中提到多次印度,是因为访谈者是印度人。) - -Linus:我不得不承认,我并没有与实际认识的来自印度的任何人直接工作。换句话说,我应该稍微澄清下:我已经非常有意识地努力建立一个规模庞大的内核开发团队,这样我不用以独自地工作而告终。 - -我非常相信大多数人的社交基本上是受限制的,只对很少的人十分了解(你最亲近的家人和朋友),我也努力构造这样一个开发模型影响这种状况:通过一个‘开发者网络’,人们可以在此互动,可能是与一批你信任的人,而且那些人反过来与他们信任的一群人互动。 - -所以,当我偶然会与上百个开发者联系,他们发给我一两个随机的补丁,我已经努力去建立这样一个环境,在这里我做的一堆事,发生在我熟知的人组成的一个较小的群体间,仅仅因为我认为那就是人们工作的方式。当然也是我喜欢工作的方式。 - -同时,坦白地说,我甚至不知道许多与我一起工作的人生活在哪里。地理位置成了十分次要的东西。所以我很确信与我工作最亲密的前10—15个人中,没有印度的,可能这话稍后传到公众耳里,然后被指出确实有一些人来自那里! - -**Q:因为 Linux 的内核开发对你依赖如此严重,你如何计划组织或重组,让它在没有你的情况下继续发展,假设你决定花更多的时间在你自己的生活和家庭上面?** - -Linus:现在 Linux 比我重要得多,为了今天这一步我已经工作了很长时间。是的,我仍然十分密切地参与其中,而且我对其有着想当大的日常影响,我最终会是这样一个人——在某种程度上,扮演着许多内核开发活跃者的中心;但是,我不会说Linux“严重依赖”于我。 - -所以,如果我得了心脏病并且明天就死了(很高兴没这种可能:我显然在任何方面都还健康),人们肯定会注意到,但是有成千上万的人为内核工作,并且不止一两个人能够没有什么困难地接替我。 - -**Q:印度是软件工程师的主要产地之一,当然我们没有在 Linux 领域做太多贡献。你觉得什么是让印度人在Linux领域变得主动的?如果我们鼓励印度人参与并为Linux做更大的贡献,你觉得如何?假如你有一个在印度的粉丝;你会用你的形象来顾问那些爱好者吗?** - -Linus:对我来说,这确实是一个不好回答的问题。参与开源取决于两方面的基础条件(互联网和教育,如你说的):信息流和文化,我甚至不知道这其中哪个是最大的障碍。 - -在很多方面,至少那些在印度讲英语文化的地方,参与 Linux 和其他开源项目是相对容易的,如果仅仅是由于语言门槛的话。这当然比起亚洲的许多地方,甚至欧洲的一些地方要容易些。 - -当然,这只是一些人,并不等同于印度的大部分群体,而且我自己关于印度的情况也知道不多,甚至没法不太负责的猜测最好的途径是什么。我猜一个热情的本地用户社区一直是最好的途径,我认为你们已经拥有这样的社区了。 - -至于我的‘形象’,我自己不以为然。我不是一个伟大的公众演讲者,而且我最近些年已经避免出游,因为被看做符号化的‘形象’让我很不自在。我就是一个工程师而已,而且我仅仅是喜欢我做的事情,并与社会上其他人一起工作。 - -**Q:什么样的理由会让你考虑去访问印度?** - -Linus:如第一个回答中提到,我十分讨厌公开演讲,所以我才想避免开会等等这些事。我更愿意某天去印度度个假,但是如果我这样做,我可能悄悄地干 — 出行之前不告诉任何人,仅仅作为一个游客去游览印度!(LCTT 译注:所以 Linus 不来中国的道理是同样的,除非世界性的 LinuxCon 在中国召开一次。) - -**Q:最近,你好像在抨击 Subversion 与 CVS,质问他们的基础架构。现在你已经从 Subversion 和 CVS 社区那里得到回应,你仍然在坚持自己正确,或者没有被说服吗?** - -Linus:因为我发现这个争论很有趣,所以我想做一个强硬的声明。换句话说,我确实‘喜欢’争论。并不是不经思考的,但是我确实想要让争论更热烈些,而不仅仅是完全的柏拉图式的。 - -做出强硬的争论有时会引来一个非常合理的反驳,然后我会很高兴地说:“噢,好吧,你是对的。” - -但是话说回来,对 SVN/CVS 并不会发生这种情况。我怀疑很多人并不是真的很喜欢 CVS,所以我真的不觉得会有谁坚持认为 CVS 就是一切,而不是一个老旧系统。要是我知道少数人确实这样争论过了,我之前就不该那么不礼貌地反对 SVN(嘿,这么说没错 — 我真的不是一个非常礼貌的家伙!),我不认为任何人都可以争论 SVN 是‘好的’。 - -我认为,SVN 就是一个‘足够好’的经典案例。人们过去经常使用 SVN,并且它也‘足够好’地广泛使用,但是它的足够好完全如 DOS 与 Windows 的‘足够好’一样。不是什么伟大的技术,只是普遍适用而已,同时它对人们来说运行良好,看着十分熟悉。但是很少有人以此为傲,或者对其有兴奋感。 - -Git,从另外方面讲,其身后有一些‘UNIX 哲学’。它并不关系到 UNIX,实质上,只是像原始的 UNIX,在它身后有一个基本理念。对 UNIX 来说,最底层的哲学就是,“所有东西只是一个文件”。对 Git 来说,“则是每个东西仅仅是内容寻址数据库中的一个对像”。 - -**Q:现在如此多的发行是好事还是坏事?选择是很有意思的,但是没有人想被选择给撑着。相较于这么多的人每天花费数小时去构建成百上千的发行版,如果人们可以一起来支持少数的发行版(可能每一个有一个人),这样进入企业,接受微软的挑战是不是更容易些呢?对此你怎么看?** - -Linus:我认为多个发行版是开源不可回避的部分。它会造成困惑吗?当然。它会变得低效率吗?是的。但是我喜欢拿它与政治比较:‘民主’也有那些令人困惑的选择,往往没有任何一个选择是你‘真正’想要的。而且有时候,如果你不需要操心选举、不同党派和联合等等方面的困惑的话,你可能会感觉事情更加容易一些,更有效率一些。 - -但是最后我想说,选择可能会导致低效率,但是它也让每个人至少保留了‘所谓的’诚信。我们可能都希望我们的政治家更诚信,我们也希望不同的发行版可以让我们有一天有其他的选择,而如果没有选择的话,事情可能会更糟。 - -**Q:为什么你觉得 CFS 比 SD 更好?** - -Linus:一部分原因是我与 Ingo [Molnar] 工作过很长一段时间,也就是说,我了解他,并且知道他会对发生的任何问题非常负责。那种品质是非常重要的。 - -但是一部分原因就简单的与用户有关。其他地方的大多数人实际上表示 CFS 比 SD 好。包括许多 3D 游戏方面(这是人们声称SD 最强的一点)。 - -同时,尽管如此,我认为并不是任何一段代码都十分‘完美’。最好的情况是,想成为 SD 支持者的人会努力提高 SD,从而通过其它方式取得了平衡 — 而我们会保持两个阵营都尝试有趣的事情,因为内部的竞争会刺激他们。 - -**Q:在 Google 一次关于 Git 的访谈中,有人问你如何将当前集中存放的超大代码库迁移到 git 上,而不用将开发工作停止六个月。你对此的回答是什么?** - -Linus:啊哈。那个问题我在现场没有听清楚(在录音里,问题会听得更清楚些),当我回头去听录制的音频,注意到了我没有回答他的问题,但是我觉得这问题他问过。 - -无论如何,我们确实有很多导入的工具,所以你实际上可以仅仅是将一个大的项目从任何其他的早期 SCM 导入到 git 里,但问题显然不是经常以导入动作本身结束,而是需要‘习惯’这种新模式! - -坦白来说,我认为关于‘习惯它’没有任何其他答案,而只是去开始使用和尝试它。显然,你不想以导入你现有的最大且最重要的项目为开端;那确实会使每件事出现停顿,然后使得每个人都很不高兴。 - -所以没有任何理智健全的人会拥护在一夜之间将一切移到 git 上去,并强迫人们改变他们的环境。是的,你需要以公司里的小项目开始,可能是一些由一个小组主要控制和维护的项目,然后开始转移其到 git。这是你能让人们习惯这种模式的方式,你应该以一个核心的组开始,他们知道 git 如何工作,如何在公司里面使用它。 - -接着,你就会铺展开来。并不需要一次到位。你会导入越来越多的项目 — 甚至是在你公司里采用‘单一大型仓库’模式;那个仓库基本上是作为许多模块的集合,因为让每个人去检查每件事不是一个可执行的工作模型(除非这个‘每件事’并不非常大)。 - -所以,你基本上有一次转移一个模块,直到你发现你使用git如此舒服的那个点,你可以移植余下的所有(或者‘余下’的太旧了,没有人用了)。 - -git 最赞的一个功能是,它实际上可以同很多其他 SCM(源代码控制管理)相处很好。这就是很多git用户使用它的时候:‘他们’可能只是使用 git ,但有时候与他们一起工作的人并没有发现,因为他们看到git的结果,联想到一些传统的 SCM 上去。 - -**Q:在 Transmeta(全美达)上他们有备用指令集实现的经验吗?[Transmeta Crusoe 芯片看起来像一个非常弱的 CPU — 记得有一台 Burroughs B1000 的解释器,它实际上实现了多个虚拟机。有一台是用于系统软件,一台是用于 Cobol,一台用于 Fortran;如果没错的话,那么一个人可以在芯片上实现 Burroughs 6/7000 或者 HP3000 类似的堆栈架构或适用于 JVM 的指令集,等等。]** - -Linus:我们确实有一些备选的结构集合,我仍然不打算谈论这个,我可以说我们已经做了一个混合结构集合的公开演示。我们有一个技术展示,在那里你同时可以跑x86结构和 Java 字节码(实际上,它是一个轻量的扩展 pico—java,iirc)。 - -我想我们展示的这个应用会在 Linux 上运行 DOOM,这里 Linux 的部分是一个完全标准 x86 发行版。但是 DOOM 的二进制程序是一个 test 编译版本,它实际上编译为 pico-java 代码。而 CPU 最终以相同的方式来运行它们——从 JIT 到原生 VLIW 指令集。 - -(选择 DOOM 的原因仅仅是其源代码可用,并且游戏的核心部分非常小,足以很容易拿它来做一个验证 — 而且它也显然看起来十分有趣。) - -有更多的事情是在内部运作,但是我不能谈论他们。而且实际上,就我个人而言,对 Java 不怎么感冒。 - -**Q:386BSD 衍生了 NetBSD,FreeBSD 和 OpenBSD,在 Linux 出现之前已经发展不错了,但是 Linux 传播比 386BSD 及其衍生者更为广泛。这在多大程度上左右你对许可证的选择,这个选择的发展过程是怎样的?你不认为比起 GPLv2 来,是 GPLv3 保护了自由,迄今为止,让 Linux 比 BSD 变得更好?** - -Linus:我认为这是一个许可证问题和一个社区及人格问题。BSD 的许可证总是鼓励分叉,但是这也意味着,如果某些人取得了成功并做了商业性的分叉,他并不需要将将他的修改返回来。因此,实际上并不会真的发生这种事情(以 BSD 而言,如 BSDi),人们并不真的彼此‘信任’。 - -相比之下,GPLv2 也鼓励分叉,但是它不仅仅鼓励分叉出去,它也鼓励(并‘要求’)能够融合回来。所以,我们现在达到了新的层次的信任:你‘知道’每个人都被许可证所约束,所以不会试着从你这里白白占走好处。 - -所以,在我看来,GPLv2 作为许可证来说,它允许人们在要求总是回馈贡献的前提下,在另外的方面取得了最大可能的自由。没有人能阻止你对源代码的改进。 - -那么,BSD 许可证是更‘自由’的吗?是的,毫无疑问。但是我不会在我在意的任何项目里面使用 BSD 许可证,因为我不仅仅想要自由,我也想要信任,可以让我总是能使用其他人为我的项目所写的代码。 - -所以对于我来说,GPLv2 最终在‘尽可能自由’上取得了完美的平衡,这样,我们做到了让每个人都能信任,他们总是可以取得源代码并使用它。 - -这就是为什么我认为 GPLv3 最终并没多大意思,它不再是那种‘返回源代码’的信任;它退化成了‘我写了这些代码,所以我能控制你如何使用它’。 - -换言之,我只是觉得 GPLv3 太狭隘和自私了。我认为 GPLv2 在‘自由’和‘信任’之间取得伟大的平衡。它不如 BSD 许可证自由,但是它让你安心回馈,而且它符合我认为的‘以德报德’:我给你源代码,你也回馈我源代码。 - -而 GPLv3 试着控制源代码的‘使用’。现在它就是“我给你我的源代码,如果你使用它的话,你最好可以让我对你的设备动手动脚”,看见了没?在我看来,不但小气,而且小心眼。 - -**Q:-rt 树的功能正在缓慢而稳定地逐渐集成到主线代码中。你当前对合并剩余的 -rt 树到主线代码的看法是什么?(我说的不是 CFS)** - -Linus: 我不能保证来自 -rt 的一切‘都’会被合并进入标准内核(有一些部分肯定不适合常规的内核),不过是的,这些年来我们实际上将它的大部分都集成进去了,剩下的部分最终以后也会合并进去。 - -我提倡高效工作,但是我同时也很保守。我退回了一些激进的合并请求,只是因为我需要确保它们对所有人都有意义,不仅仅是用于极端情况下的实时环境,而且也对并不需要这种环境的‘普通’用户有用。这解释了为什么这个过程相当缓慢却稳定不断地合并代码,因为它需要足够稳定和有意义。 - -顺便说一句,这不仅仅是针对 -rt ,它也在许多开发中出现。-rt 出现这种情况是因为它是更‘直接’的内核项目,而且也是因为它的一个主要开发者也直接涉及到了普通的内核开发。通常其它功能的迁移(安全、虚拟内核变化、虚拟化,等等)也遵循类似的方式:他们针对特定的环境进行开发,然后这些功能片段缓慢而稳步地合并到标准内核。 - - -**Q:我对 Linux 内核支持的文件系统的发展很感兴趣。你觉得 Reiser4、XFS4、ZFS 以及 Oracle 发起那个新项目那个更有前途?这些天 ZFS 有不少新闻,Reiser4 也发布了很不错的性能基准测试,XFS4 正紧随其后,而 Oracle 发布的那个也有很多像 Sun 的 ZFS 一样的特性。我们将走向何方呢?以你的观点来看,哪个文件系统更有前途?** - -Linus: 实际上,就在昨天我们发现了一个 git 的性能问题,有一个用户他采用 ZFS 要比 UFS 慢一个数量级(不是在 Linux 下,git 已经得到了许多关注,甚至是在内核开发团队之外)。所以,我认为许多‘新文件系统’的拥护者部分原因是因为他们了解到旧文件系统的不足,然后(有点不切实际地)期望一个‘崭新的、改进的’文件系统能使一切都完美。 - -最后,这是一个永无止境的领域,看看谁是最终的赢家——也许并不需要(看起来不需要)一个赢家。几乎总是这样,对文件系统的选择最终取决于负载和环境。 - -相比你提到的这些文件系统,我个人对基于闪存的硬盘很快就可以供甚至是‘普通’用户使用的这个事实更感到兴奋。当然,它们仍然很昂贵(而且相当的小),但是基于闪存的存储和旋转介质的性能完全不可同日而语,我怀疑它们最终将对文件系统的设计有巨大的影响。而现在,多数文件系统的设计都是在考虑如何处理旋转介质的延迟。 - -**Q:操作系统变得越来越不重要。你说过好几次用户根本不应该‘看见’操作系统。应用更为重要。基于浏览器的应用,如 Google 的基本办公软件正在发挥影响力。你认为操作系统将走向何方?** - -Linus:我并不真的相信‘浏览器 OS’,因为我认为人们总是需要在本地做一些事情。也许是因为安全,或者仅仅是因为隐私的原因。而且当到处可以接入时,它也并不是‘无处不在’。 - -所以我认为,整个‘Web OS’这件事有一部分是真实的,但是另外一部分人们也许忘记了操作系统已经存在了几十年,它已经相当稳定,而且它的发展是有目共睹的。人们真的不应该期望操作系统有魔法般的变化:人们并不能回到‘傻傻的’六十年代,甚至连硬件也和过去的‘那个’完全不同了! - -所以,别指望一场革命。我认为操作系统将更多继续它们所做哪些事情,当然,我们也会进步,但是我不认为会从根本上改变。也许会发生根本性改变的是界面和操作系统顶层的哪些东西(当然,操作系统下面的硬件也会继续进步),这显然才是人们所关心的。 - -至于操作系统?它显然是应该尽可能隐藏起来的东西。你真的不应该在意它,除非你非常想知道在机器里面真正在做什么。 - -**Q:最近我听说,你正在使用一台 PPC G4/5 作为个人计算机,你使用它来做什么?为什么呢?** - -Linus:我最终放弃了那台 PowerPC,因为没有人能在这台工作站上做的更多,特别是,自从 x86-64 开始变得越来越强大了。所以这些天,我在用一台标准的 PC,里面是一个普通的 Core 2 Duo CPU。 - -在其它架构下运行是非常有趣的(我把 alpha 作为我的主要架构运行了好几年,所以这并不是第一次),但是这种 CPU 得当成商品买得到才行。我认为,唯一能取代 x86 架构的将来自以下,比如也许我们将来十年并不需要使用 x86 作为我们的主要架构,我认为也许是 ARM,这得益于移动设备市场。 - -**Q:Linux 对你意味着什么?一种业余爱好、哲学、人生意义、工作、最好的操作系统,还是什么?** - -Linus:它是所有的这一切。它是爱好,而且是具有深刻意义的爱好。最好的爱好是你‘真的’非常在意它。这些日子里,它显示也是我的工作,我非常高兴工作和兴趣能合二为一。 - -我不了解所谓的‘哲学’,我并不真的是因为深层次的道德或哲学的原因才做的 Linux (字面上的做是因为它有趣),但是可以肯定的是,我欣赏我认为开源为何这么棒的深层原因。所以我并不是因为什么高大上的理由做 Linux 的,而且我不能诚恳地说是它在激励我,但是我最终会思考为什么会这样。 - -**Q:微软的‘黑衣人’有没有和你交谈过?** - -Linus:我从来没有真正和微软交谈过,没有。我偶尔会和一些微软的人出现再同一个会议上(我比以前参加的会议更多了),但是我从来和他们没有任何关系。我认为彼此都很谨慎吧。 - --------------------------------------------------------------------------------- - -via: http://www.linuxveda.com/2015/06/17/what-happens-to-linux-after-linus/ - -作者:[Swapnil Bhartiya][a] -译者:[wi-cuckoo](https://github.com/wi-cuckoo),[wxy](https://github.com/wxy) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.linuxveda.com/author/arnieswap/ - From c61495a3defd329e5364a3882a8d703bdc09d3ea Mon Sep 17 00:00:00 2001 From: Chang Liu Date: Tue, 7 Jul 2015 09:26:45 +0800 Subject: [PATCH 539/965] [Translated]20150515 Lolcat--A Command Line Tool to Output Rainbow of Colors in Linux Terminal.md --- ...put Rainbow Of Colors in Linux Terminal.md | 178 ------------------ ...put Rainbow Of Colors in Linux Terminal.md | 175 +++++++++++++++++ 2 files changed, 175 insertions(+), 178 deletions(-) delete mode 100644 sources/tech/20150515 Lolcat--A Command Line Tool to Output Rainbow Of Colors in Linux Terminal.md create mode 100644 translated/tech/20150515 Lolcat--A Command Line Tool to Output Rainbow Of Colors in Linux Terminal.md diff --git a/sources/tech/20150515 Lolcat--A Command Line Tool to Output Rainbow Of Colors in Linux Terminal.md b/sources/tech/20150515 Lolcat--A Command Line Tool to Output Rainbow Of Colors in Linux Terminal.md deleted file mode 100644 index 194b295ab9..0000000000 --- a/sources/tech/20150515 Lolcat--A Command Line Tool to Output Rainbow Of Colors in Linux Terminal.md +++ /dev/null @@ -1,178 +0,0 @@ -FSSlc translating - -Lolcat – A Command Line Tool to Output Rainbow Of Colors in Linux Terminal -================================================================================ -For those who believe that Linux Command Line is boring and there isn’t any fun, then you’re wrong here are the articles on Linux, that shows how funny and naughty is Linux.. - -- [20 Funny Commands of Linux or Linux is Fun in Terminal][1] -- [6 Interesting Funny Commands of Linux (Fun in Terminal)][2] -- [Fun in Linux Terminal – Play with Word and Character Counts][3] - -Here in this article, I will be discussing about a small utility called “lolcat” – Which produce rainbow of colors in terminal. - -![Lolcat Command to Output Rainbow of Colors for Terminal](http://www.tecmint.com/wp-content/uploads/2015/06/Linux-Lolcat.png) - -Lolcat Command to Output Rainbow of Colors for Terminal - -#### What is lolcat? #### - -Lolcat is an utility for Linux, BSD and OSX which concatenates like similar to [cat command][4] and adds rainbow coloring to it. Lolcat is primarily used for rainbow coloring of text in Linux Terminal. - -### Installation of Lolcat in Linux ### - -**1. Lolcat utility is available in the repository of lots of Linux distributions, but the available version bit older. Alternatively you can download and install latest version of lolcat from git repository.** - -Lolcat is a ruby gem hence it is essential to have latest version of RUBY installed on your system. - - # apt-get install ruby [On APT based Systems] - # yum install ruby [On Yum based Systems] - # dnf install ruby [On DNF based Systems] - -Once ruby package has been installed, make sure to verify the version of ruby installed. - - # ruby --version - - ruby 2.1.5p273 (2014-11-13) [x86_64-linux-gnu] - -**2. Next download and install the most recent version of lolcat from the git repository using following commands.** - - # wget https://github.com/busyloop/lolcat/archive/master.zip - # unzip master.zip - # cd lolcat-master/bin - # gem install lolcat - -Once lolcat is installed, you can check the version. - - # lolcat --version - - lolcat 42.0.99 (c)2011 moe@busyloop.net - -### Usage of Lolcat ### - -**3. Before starting usage of lolcat, make sure to know the available options and help using following command.** - - # lolcat -h - -![Lolcat Help](http://www.tecmint.com/wp-content/uploads/2015/06/Lolcat-Help1.png) - -Lolcat Help - -**4. Next, pipeline lolcat with commads say ps, date and cal as:** - - # ps | lolcat - # date | lolcat - # cal | lolcat - -![ps Command Output](http://www.tecmint.com/wp-content/uploads/2015/06/ps-command-output.png) - -ps Command Output - -![Date Output](http://www.tecmint.com/wp-content/uploads/2015/06/Date.png) - -Date Output - -![Calendar Output](http://www.tecmint.com/wp-content/uploads/2015/06/Cal.png) - -Calendar Output - -**5. 3. Use lolcat to display codes of a script file as:** - - # lolcat test.sh - -![Display Codes with Lolcat](http://www.tecmint.com/wp-content/uploads/2015/06/Script-Output.png) - -Display Codes with Lolcat - -**6. Pipeline lolcat with figlet command. Figlet is a utility which displays large characters made up of ordinary screen characters. We can pipeline the output of figlet with lolcat to make the output colorful as:** - - # echo I ❤ Tecmint | lolcat - # figlet I Love Tecmint | lolcat - -![Colorful Texts](http://www.tecmint.com/wp-content/uploads/2015/06/Colorful-Text.png) - -Colorful Texts - -**Note**: Not to mention that ❤ is an unicode character and to install figlet you have to yum and apt to get the required packages as: - - # apt-get figlet - # yum install figlet - # dnf install figlet - -**7. Animate a text in rainbow of colours, as:** - - $ echo I ❤ Tecmit | lolcat -a -d 500 - -![Animated Text](http://www.tecmint.com/wp-content/uploads/2015/06/Animated-Text.gif) - -Animated Text - -Here the option -a is for Animation and -d is for duration. In the above example duration count is 500. - -**8. Read a man page (say man ls) in rainbow of colors as:** - - # man ls | lolcat - -![List Files Colorfully](http://www.tecmint.com/wp-content/uploads/2015/06/List-Files-Colorfully.png) - -List Files Colorfully - -**9. Pipeline lolcat with cowsay. cowsay is a configurable thinking and/or speaking cow, which supports a lot of other animals as well.** - -Install cowsay as: - - # apt-get cowsay - # yum install cowsay - # dnf install cowsay - -After install, print the list of all the animals in cowsay as: - - # cowsay -l - -**Sample Output** - - Cow files in /usr/share/cowsay/cows: - apt beavis.zen bong bud-frogs bunny calvin cheese cock cower daemon default - dragon dragon-and-cow duck elephant elephant-in-snake eyes flaming-sheep - ghostbusters gnu head-in hellokitty kiss kitty koala kosh luke-koala - mech-and-cow meow milk moofasa moose mutilated pony pony-smaller ren sheep - skeleton snowman sodomized-sheep stegosaurus stimpy suse three-eyes turkey - turtle tux unipony unipony-smaller vader vader-koala www - -Output of cowsay pipelined with lolcat and ‘gnu‘ cowfile is used. - - # cowsay -f gnu ☛ Tecmint ☚ is the best Linux Resource Available online | lolcat - -![Cowsay with Lolcat](http://www.tecmint.com/wp-content/uploads/2015/06/Cowsay-with-Lolcat.png) - -Cowsay with Lolcat - -**Note**: You can use lolcat with any other command in pipeline and get colored output in terminal. - -**10. You may create alias for the most frequently used commands to get command output in rainbow of colors. You can alias ‘ls -l‘ command which is used for long list the contents of directory as below.** - - # alias lolls="ls -l | lolcat" - # lolls - -![Alias Commands with Colorful](http://www.tecmint.com/wp-content/uploads/2015/06/Alias-Commands-with-Colorful.png) - -Alias Commands with Colorful - -You may create alias for any command as suggested above. To create permanent alias, you have to add the relevant code (above code for ls -l alias) to ~/.bashrc file and also make sure to logout and login back for the changes to be taken into effect. - -That’s all for now. I would like to know if you were aware of lolcat previously? Did you like the post? And suggestion and feedback is welcome in the comment section below. Like and share us and help us get spread. - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/lolcat-command-to-output-rainbow-of-colors-in-linux-terminal/ - -作者:[Avishek Kumar][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.tecmint.com/author/avishek/ -[1]:http://www.tecmint.com/20-funny-commands-of-linux-or-linux-is-fun-in-terminal/ -[2]:http://www.tecmint.com/linux-funny-commands/ -[3]:http://www.tecmint.com/play-with-word-and-character-counts-in-linux/ -[4]:http://www.tecmint.com/13-basic-cat-command-examples-in-linux/ diff --git a/translated/tech/20150515 Lolcat--A Command Line Tool to Output Rainbow Of Colors in Linux Terminal.md b/translated/tech/20150515 Lolcat--A Command Line Tool to Output Rainbow Of Colors in Linux Terminal.md new file mode 100644 index 0000000000..4ce0ef80d0 --- /dev/null +++ b/translated/tech/20150515 Lolcat--A Command Line Tool to Output Rainbow Of Colors in Linux Terminal.md @@ -0,0 +1,175 @@ +Lolcat – 一个在 Linux 终端中输出彩虹特效的命令行工具 +================================================================================ +那些相信 Linux 命令行是单调无聊且没有任何乐趣的人们,你们错了,这里有一些有关 Linux 的文章,它们展示着 Linux 是如何的有趣和“淘气” 。 + +- [20 个有趣的 Linux 命令或在终端中 Linux 是有趣的][1] +- [6 个有趣的好玩 Linux 命令(在终端中的乐趣)][2] +- [在 Linux 终端中的乐趣 – 把玩文字和字符计数][3] + +在本文中,我将讨论一个名为“lolcat”的应用 – 它在终端中生成彩虹般的颜色。 + +![为终端生成彩虹般颜色的输出的 Lolcat 命令](http://www.tecmint.com/wp-content/uploads/2015/06/Linux-Lolcat.png) + +为终端生成彩虹般颜色的输出的 Lolcat 命令 + +#### 何为 lolcat ? #### + +Lolcat 是一个针对 Linux,BSD 和 OSX 平台的应用,它类似于 [cat 命令][4],并为 `cat` 的输出添加彩虹般的色彩。 Lolcat 原本用于在 Linux 终端中为文本添加彩虹般的色彩。 + +### 在 Linux 中安装 Lolcat ### + +**1. Lolcat 应用在许多 Linux 发行版本的软件仓库中都可获取到,但可获得的版本都有些陈旧,而你可以通过 git 仓库下载和安装最新版本的 lolcat。** + +由于 Lolcat 是一个 ruby gem 程序,所以在你的系统中安装有最新版本的 RUBY 是必须的。 + + # apt-get install ruby [在基于 APT 的系统中] + # yum install ruby [在基于 Yum 的系统中] + # dnf install ruby [在基于 DNF 的系统中] + +一旦 ruby 软件包安装成功,请确保验证安装的 ruby 的版本。 + + # ruby --version + + ruby 2.1.5p273 (2014-11-13) [x86_64-linux-gnu] + +**2. 接着使用下面的命令来从 lolcat 的 git 仓库中下载和安装最新版本的 lolcat。** + + # wget https://github.com/busyloop/lolcat/archive/master.zip + # unzip master.zip + # cd lolcat-master/bin + # gem install lolcat + +一旦 lolcat 安装后,你可以检查它的版本号。 + + # lolcat --version + + lolcat 42.0.99 (c)2011 moe@busyloop.net + +### Lolcat 的用法 ### + +**3. 在开始使用 lolcat 之前,使用下面的命令来了解它可用的选项和其帮助文档。** + + # lolcat -h + +![Lolcat 的帮助文档](http://www.tecmint.com/wp-content/uploads/2015/06/Lolcat-Help1.png) + +Lolcat 的帮助文档 + +**4. 接着, 通过管道连接 lolcat 和其他命令,例如 ps, date 和 cal:** + + # ps | lolcat + # date | lolcat + # cal | lolcat + +![ps 命令的输出](http://www.tecmint.com/wp-content/uploads/2015/06/ps-command-output.png) + +ps 命令的输出 + +![Date 的输出](http://www.tecmint.com/wp-content/uploads/2015/06/Date.png) + +Date 的输出 + +![Calendar 的输出](http://www.tecmint.com/wp-content/uploads/2015/06/Cal.png) + +Calendar 的输出 + +**5. 使用 lolcat 来展示一个脚本文件的代码:** + + # lolcat test.sh + +![用 lolcat 来展示代码](http://www.tecmint.com/wp-content/uploads/2015/06/Script-Output.png) + +用 lolcat 来展示代码 + +**6. 通过管道连接 lolcat 和 figlet 命令。Figlet 是一个展示由常规的屏幕字符组成的巨大字符串的应用。我们可以通过管道将 figlet 的输出连接到 lolcat 中来给出如下的多彩输出:** + + # echo I ❤ Tecmint | lolcat + # figlet I Love Tecmint | lolcat + +![多彩的文字](http://www.tecmint.com/wp-content/uploads/2015/06/Colorful-Text.png) + +多彩的文字 + +**注**: 毫无疑问 ❤ 是一个 unicode 字符并且为了安装 figlet,你需要像下面那样使用 yum 和 apt 来得到这个软件包: + + # apt-get figlet + # yum install figlet + # dnf install figlet + +**7. 给文本赋予彩虹颜色的动画:** + + $ echo I ❤ Tecmit | lolcat -a -d 500 + +![动的文本](http://www.tecmint.com/wp-content/uploads/2015/06/Animated-Text.gif) + +动的文本 + +这里选项 `-a` 指的是 Animation(动画), `-d` 指的是 duration(持续时间)。在上面的例子中,持续 500 次动画。 + +**8. 在彩虹般的颜色下阅读 man 页(例如 `man ls`):** + + # man ls | lolcat + +![多彩地显示文件](http://www.tecmint.com/wp-content/uploads/2015/06/List-Files-Colorfully.png) + +多彩地显示文件 + +**9. 通过管道连接 lolcat 和 cowsay。cowsay 是一个可配置的正在思考或说话的奶牛,这个程序也支持其他的动物。** + +使用下面的命令来安装 cowsay : + + # apt-get cowsay + # yum install cowsay + # dnf install cowsay + +安装后,使用下面的命令来显示在 cowsay 中的所有动物: + + # cowsay -l + +**样例输出** + + Cow files in /usr/share/cowsay/cows: + apt beavis.zen bong bud-frogs bunny calvin cheese cock cower daemon default + dragon dragon-and-cow duck elephant elephant-in-snake eyes flaming-sheep + ghostbusters gnu head-in hellokitty kiss kitty koala kosh luke-koala + mech-and-cow meow milk moofasa moose mutilated pony pony-smaller ren sheep + skeleton snowman sodomized-sheep stegosaurus stimpy suse three-eyes turkey + turtle tux unipony unipony-smaller vader vader-koala www + +通过管道连接 lolcat 和 cowsay 后的输出,并且使用了‘gnu’cowfile。 + + # cowsay -f gnu ☛ Tecmint ☚ is the best Linux Resource Available online | lolcat + +![使用 Lolcat 的 Cowsay](http://www.tecmint.com/wp-content/uploads/2015/06/Cowsay-with-Lolcat.png) + +使用 Lolcat 的 Cowsay + +**注**: 你可以在管道中使用 lolcat 和其他任何命令来在终端中得到彩色的输出。 + +**10. 你可以为最常用的命令创建别名来使得命令的输出呈现出彩虹般的色彩。你可以像下面那样为 ‘ls -l‘ 命令创建别名,这个命令输出一个目录中包含内容的列表。** + + # alias lolls="ls -l | lolcat" + # lolls + +![多彩的 Alias 命令](http://www.tecmint.com/wp-content/uploads/2015/06/Alias-Commands-with-Colorful.png) + +多彩的 Alias 命令 + +你可以像上面建议的那样,为任何命令创建别名。为了使得别名永久生效,你必须添加相关的代码(上面的代码是 ls -l 的别名) 到 ~/.bashrc 文件中,并确保登出后再重新登录来使得更改生效。 + +现在就是这些了。我想知道你是否曾经注意过 lolcat 这个应用?你是否喜欢这篇文章?欢迎在下面的评论环节中给出你的建议和反馈。喜欢并分享我们,帮助我们传播。 +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/lolcat-command-to-output-rainbow-of-colors-in-linux-terminal/ + +作者:[Avishek Kumar][a] +译者:[FSSlc](https://github.com/FSSlc) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/avishek/ +[1]:http://www.tecmint.com/20-funny-commands-of-linux-or-linux-is-fun-in-terminal/ +[2]:http://www.tecmint.com/linux-funny-commands/ +[3]:http://www.tecmint.com/play-with-word-and-character-counts-in-linux/ +[4]:http://www.tecmint.com/13-basic-cat-command-examples-in-linux/ \ No newline at end of file From fa1cf6334af8412b300d0e80a7b31f54cdb20a19 Mon Sep 17 00:00:00 2001 From: Chang Liu Date: Tue, 7 Jul 2015 09:30:24 +0800 Subject: [PATCH 540/965] Update 20150629 Autojump--An Advanced 'cd' Command to Quickly Navigate Linux Filesystem.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 准备翻译这篇文章。 --- ...anced 'cd' Command to Quickly Navigate Linux Filesystem.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150629 Autojump--An Advanced 'cd' Command to Quickly Navigate Linux Filesystem.md b/sources/tech/20150629 Autojump--An Advanced 'cd' Command to Quickly Navigate Linux Filesystem.md index d7d1cdf7ee..ac4f53cf6f 100644 --- a/sources/tech/20150629 Autojump--An Advanced 'cd' Command to Quickly Navigate Linux Filesystem.md +++ b/sources/tech/20150629 Autojump--An Advanced 'cd' Command to Quickly Navigate Linux Filesystem.md @@ -1,3 +1,5 @@ +FSSlc Translating + Autojump – An Advanced ‘cd’ Command to Quickly Navigate Linux Filesystem ================================================================================ Those Linux users who mainly work with Linux command Line via console/terminal feels the real power of Linux. However it may sometimes be painful to navigate inside Linux Hierarchical file system, specially for the newbies. @@ -219,4 +221,4 @@ via: http://www.tecmint.com/autojump-a-quickest-way-to-navigate-linux-filesystem [a]:http://www.tecmint.com/author/avishek/ [1]:http://www.tecmint.com/cd-command-in-linux/ [2]:http://www.tecmint.com/how-to-enable-epel-repository-for-rhel-centos-6-5/ -[3]:http://www.tecmint.com/manage-linux-filenames-with-special-characters/ \ No newline at end of file +[3]:http://www.tecmint.com/manage-linux-filenames-with-special-characters/ From ff56e2de0cd9fb2a1467fb2aac6b5315d9b1684b Mon Sep 17 00:00:00 2001 From: ZTinoZ Date: Tue, 7 Jul 2015 10:55:44 +0800 Subject: [PATCH 541/965] Finish the translation by ZTinoZ --- ...re Made Easy with these Dedicated Tools.md | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) rename {sources => translated}/share/20150625 Screen Capture Made Easy with these Dedicated Tools.md (89%) diff --git a/sources/share/20150625 Screen Capture Made Easy with these Dedicated Tools.md b/translated/share/20150625 Screen Capture Made Easy with these Dedicated Tools.md similarity index 89% rename from sources/share/20150625 Screen Capture Made Easy with these Dedicated Tools.md rename to translated/share/20150625 Screen Capture Made Easy with these Dedicated Tools.md index f8ac9a2db1..b2408dbeee 100644 --- a/sources/share/20150625 Screen Capture Made Easy with these Dedicated Tools.md +++ b/translated/share/20150625 Screen Capture Made Easy with these Dedicated Tools.md @@ -117,25 +117,25 @@ ScreenCloud是一款易于使用的开源截图工具。 ![KSnapShot in action](http://www.linuxlinks.com/portal/content/reviews/Graphics/Screenshot-KSnapshot.png) -KSnapshot is a simple utility for taking screenshots. It can capture images of the whole desktop, a single window, a section of a window or a selected region. Images can then be saved in a variety of different formats. +KSnapshot也是一款易于使用的截图工具,它能给整个桌面、一个单一窗口、窗口的一部分或一块所选区域捕捉图像。,图像能以各种不用的格式保存。 -KSnapshot also allows users to use hotkeys to take a screenshot. Besides saving the screenshot, it can be copied to the clipboard or opened with any program that is associated with image files. +KSnapshot也允许用户用热键来进行截图。除了保存截图之外,它也可以被复制到剪贴板或用任何与图像文件关联的程序打开。 -KSnapshot is part of the KDE 4 graphics module. +KSnapshot是KDE 4图形模块的一部分。 -Features include: +包含特性: -- Save snapshot in multiple formats -- Snapshot delay -- Exclude window decorations -- Copy the snapshot to the clipboard -- Hotkeys -- Can be scripted using its D-Bus interface +- 以多种格式保存截图 +- 延迟截图 +- 剔除窗口装饰图案 +- 复制截图至剪贴板 +- 热键 +- 能用它的D-Bus界面进行脚本化 -- Website: [www.kde.org][4] -- Developer: KDE, Richard J. Moore, Aaron J. Seigo, Matthias Ettrich -- License: GNU GPL v2 -- Version Number: 0.8.2 +- 主页: [www.kde.org][4] +- 开发者: KDE, Richard J. Moore, Aaron J. Seigo, Matthias Ettrich +- 许可证: GNU GPL v2 +- 版本号: 0.8.2 -------------------------------------------------------------------------------- From 8da4a84b370c261bcfb447eacda6a11ab494faa0 Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 7 Jul 2015 22:54:33 +0800 Subject: [PATCH 542/965] PUB:20150610 How to Manipulate Filenames Having Spaces and Special Characters in Linux @zpl1025 --- ... Spaces and Special Characters in Linux.md | 59 +++++++++---------- 1 file changed, 28 insertions(+), 31 deletions(-) rename {translated/tech => published}/20150610 How to Manipulate Filenames Having Spaces and Special Characters in Linux.md (81%) diff --git a/translated/tech/20150610 How to Manipulate Filenames Having Spaces and Special Characters in Linux.md b/published/20150610 How to Manipulate Filenames Having Spaces and Special Characters in Linux.md similarity index 81% rename from translated/tech/20150610 How to Manipulate Filenames Having Spaces and Special Characters in Linux.md rename to published/20150610 How to Manipulate Filenames Having Spaces and Special Characters in Linux.md index 61a320aeb8..93a8868639 100644 --- a/translated/tech/20150610 How to Manipulate Filenames Having Spaces and Special Characters in Linux.md +++ b/published/20150610 How to Manipulate Filenames Having Spaces and Special Characters in Linux.md @@ -1,8 +1,8 @@ Linux 下如何处理包含空格和特殊字符的文件名 ================================================================================ -我们经常会看到文件名和文件夹名。大多数时候文件/文件夹的名字和内容相关并以数字和字母开头。字母-数字文件名最常见,应用也很广泛,但总会需要处理一些包含特殊字符的文件名/文件夹名。 +我们经常会看到文件名和文件夹名。大多数时候文件/文件夹的名字和内容相关并以数字和字母开头。字母加数字的文件名最常见,应用也很广泛,但总会需要处理一些包含特殊字符的文件名/文件夹名。 -** 注意 **:我们可能有各种类型的文件,但是为了简单以及方便实现,在本文中我们只处理文本文件(.txt)。 +** 注意 **:我们可能有各种类型的文件,但是为了简单以及方便实现,在本文中我们只用文本文件(.txt)做演示。 最常见的文件名例子: @@ -38,9 +38,9 @@ Linux 下如何处理包含空格和特殊字符的文件名 --bk34.txt ... -一个显而易见的问题是 - 在这个星球上有谁会创建/处理包含井号`(#)`,分号`(;)`,破折号`(-)`或其他特殊字符的文件/文件夹啊。 +一个显而易见的问题是 - 在这个星球上有谁会创建和处理包含井号`(#)`,分号`(;)`,破折号`(-)`或其他特殊字符的文件/文件夹啊。 -我和你想的一样,这种文件名确实不常见,不过在你必须得处理这种文件名的时候你的 shell 也不应该出错或罢工。而且技术上来说,Linux 下的一切比如文件夹,驱动器或其他所有的都被当作文件处理。 +我和你想的一样,这种文件名确实不常见,不过在你必须得处理这种文件名的时候你的 shell 也不应该出错或罢工。而且技术上来说,Linux 下的一切比如文件夹、驱动器或其他所有的都被当作文件处理。 ### 处理名字包含破折号(-)的文件 ### @@ -99,9 +99,9 @@ Linux 下如何处理包含空格和特殊字符的文件名 **重要:** -1. 上面讨论的规则可以同样应用于名字中包含任意数量以及位置连接符号的文件。就是说,-a-b-c.txt,ab-c.txt,abc-.txt,等等。 +1. 上面讨论的规则可以同样应用于名字中包含任意数量以及任意位置的连接符号的文件。就是说,-a-b-c.txt,ab-c.txt,abc-.txt,等等。 -2. 上面讨论的规则可以同样应用于名字中包含任意数量以及位置连接符号的文件夹,除了一种情况,在删除一个文件夹的时候你得这样使用`rm -rf`: +2. 上面讨论的规则可以同样应用于名字中包含任意数量以及任意位置连接符号的文件夹,除了一种情况,在删除一个文件夹的时候你得这样使用`rm -rf`: $ rm -rf -- -abc 或者 @@ -124,7 +124,7 @@ Linux 下如何处理包含空格和特殊字符的文件名 出现上面错误的原因是,BASH 将 #abc.txt 解释为评论而忽略了。所以[命令 touch][2]没有收到任何文件作为参数,所以导致这个错误。 -要解决这个问题,你肯能需要告诉 BASH 不要将 # 解释为评论。 +要解决这个问题,你可能需要告诉 BASH 不要将 # 解释为评论。 $ touch ./#abc.txt 或者 @@ -140,8 +140,7 @@ Linux 下如何处理包含空格和特殊字符的文件名 现在创建名字中除了开头的其他地方包含 # 的文件。 $ touch ./a#bc.txt - $ touch ./abc#.txt - + $ touch ./abc#.txt 或者 $ touch 'a#bc.txt' $ touch 'abc#.txt' @@ -197,8 +196,6 @@ Linux 下如何处理包含空格和特殊字符的文件名 或者 $ vi '#cd.txt' ----------- - $ nano ./#cd.txt 或者 $ nano '#cd.txt' @@ -261,7 +258,7 @@ Linux 下如何处理包含空格和特殊字符的文件名 #### 文件名包含星号 (*) #### -名字包含星号的文件没有改变太多,你仍然可以把它当作一个普通文件。(注:星号在 shell 里有特殊意义,用作文件名最好用单引号括起来或使用反斜杠转义) +需要用单引号括起来或使用反斜杠转义。(LCTT 译注:此处原文有误,已修改。) $ touch *12.txt @@ -271,9 +268,9 @@ Linux 下如何处理包含空格和特殊字符的文件名 或者 $ rm -rf * -而是用这样的命令,(注:这个命令是删除当前目录所有.txt文件。。。) +而是用这样的命令,(LCTT 译注:此处原文有误,已修改) - $ rm ./*.txt + $ rm ./'*.txt' #### 文件名包含叹号 (!) #### @@ -307,9 +304,9 @@ Linux 下如何处理包含空格和特殊字符的文件名 #### 文件名包含花括号 {} #### -不需要特别注意。可以当作普通文件处理。(注:花括号在 shell 里有特殊意义,用作文件名最好用单引号括起来或使用反斜杠转义) +用单引号括起来或使用反斜杠转义。(LCTT 译注:此处原文有误,已修改) - $ touch {12.txt} + $ touch '{12.txt}' #### 文件名包含尖括号 <> #### @@ -319,21 +316,21 @@ Linux 下如何处理包含空格和特殊字符的文件名 #### 文件名包含方括号 [ ] #### -名字包含方括号的文件可以当作普通文件,不用特别处理。(注:方括号在 shell 里有特殊意义,用作文件名最好用单引号括起来或使用反斜杠转义) +用单引号括起来或使用反斜杠转义。(LCTT 译注:此处原文有误,已修改) - $ touch [12.txt] + $ touch '[12.txt]' #### 文件名包含下划线 (_) #### -这个非常普遍不需要特殊对待。当作普通文件随意处理。 +这个非常普遍,不需要特殊对待。当作普通文件随意处理。 $ touch _12.txt #### 文件名包含等号 (=) #### -文件名包含等号不会改变任何事情,你可以当作普通文件。(注:等号在 shell 里有特殊意义,用作文件名最好用单引号括起来或使用反斜杠转义) +用单引号括起来或使用反斜杠转义。(LCTT 译注:此处原文有误,已修改) - $ touch =12.txt + $ touch '=12.txt' #### 处理反斜杠 (\) #### @@ -349,9 +346,9 @@ Linux 下如何处理包含空格和特殊字符的文件名 #### 文件名包含问号 (?) #### -再一次,这个也是不需要特别处理的情况。名字包含问号的文件可以和大多数情况一样对待。(注:问号在 shell 里有特殊意义,用作文件名最好用单引号括起来或使用反斜杠转义) +用单引号括起来或使用反斜杠转义。(LCTT 译注:此处原文有误,已修改) - $ touch ?12.txt + $ touch '?12.txt' #### 文件名包含点 (.) #### @@ -382,25 +379,25 @@ Linux 下如何处理包含空格和特殊字符的文件名 #### 文件名包含冒号 (:) #### -你可以在文件名中使用冒号,可以有任意多个而不用特殊对待。就像平时普通名字文件那样处理。(注:冒号在 shell 里有特殊意义,用作文件名最好用单引号括起来或使用反斜杠转义) +用单引号括起来或使用反斜杠转义。(LCTT 译注:此处原文有误,已修改) - $ touch :12.txt + $ touch ':12.txt' 或者 - $ touch :12:.txt + $ touch ':12:.txt' #### 文件名包含引号(单引号和双引号) #### -要在文件名里使用引号,我们需要使用交替规则。例如,如果你需要在文件名里使用单引号,那就用双引号把文件名括起来。而如果你需要在文件名里使用双引号,那就用单引号把文件名括起来。 +要在文件名里使用引号,我们需要使用交替规则。例如,如果你需要在文件名里使用单引号,那就用双引号把文件名括起来。而如果你需要在文件名里使用双引号,那就用单引号把文件名括起来。(LCTT 译注:或者如果单引号和双引号混杂的情况,你也可以用反斜杠转义。) $ touch "15'.txt" 以及 - $ touch '15”.txt' + $ touch '15".txt' #### 文件名包含波浪号 (~) #### -Linux 下一些像 emacs 这样的文本编辑器在编辑文件的时候会创建备份文件。这个备份文件的名字是在原文件名后面附加一个波浪号。你可以在文件名任意位置使用波浪号,例如:(注:波浪号在 shell 里有特殊意义,用作文件名最好用单引号括起来或使用反斜杠转义) +Linux 下一些像 emacs 这样的文本编辑器在编辑文件的时候会创建备份文件。这个备份文件的名字是在原文件名后面附加一个波浪号。你可以在文件名任意位置使用波浪号,例如: $ touch ~1a.txt 或者 @@ -426,10 +423,10 @@ via: http://www.tecmint.com/manage-linux-filenames-with-special-characters/ 作者:[Avishek Kumar][a] 译者:[zpl1025](https://github.com/zpl1025) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 [a]:http://www.tecmint.com/author/avishek/ -[1]:http://www.tecmint.com/15-basic-ls-command-examples-in-linux/ +[1]:https://linux.cn/article-5349-1.html [2]:http://www.tecmint.com/8-pratical-examples-of-linux-touch-command/ From f97e0ac63b93763a7cf01fdba3a2acfc8db77391 Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 7 Jul 2015 23:46:04 +0800 Subject: [PATCH 543/965] PUB:20150617 Tor Browser--An Ultimate Web Browser for Anonymous Web Browsing in Linux @wwy-hust --- ...ser for Anonymous Web Browsing in Linux.md | 215 ++++++++++++++++++ ...ser for Anonymous Web Browsing in Linux.md | 206 ----------------- 2 files changed, 215 insertions(+), 206 deletions(-) create mode 100644 published/20150617 Tor Browser--An Ultimate Web Browser for Anonymous Web Browsing in Linux.md delete mode 100644 translated/tech/20150617 Tor Browser--An Ultimate Web Browser for Anonymous Web Browsing in Linux.md diff --git a/published/20150617 Tor Browser--An Ultimate Web Browser for Anonymous Web Browsing in Linux.md b/published/20150617 Tor Browser--An Ultimate Web Browser for Anonymous Web Browsing in Linux.md new file mode 100644 index 0000000000..6df604eac1 --- /dev/null +++ b/published/20150617 Tor Browser--An Ultimate Web Browser for Anonymous Web Browsing in Linux.md @@ -0,0 +1,215 @@ +Tor浏览器:Linux下用于匿名Web浏览的终极浏览器 +================================================================================ +我们大多数人都在上网方面花费很多时间。上网使用的应用程序主要是浏览器,更确切的说是一个Web浏览器。我们在网络上的大部分活动要以客户端/服务器的方式登录,这个过程会包括IP地址、地理信息、搜索、活动以及许多潜在的信息,这些信息如果以其他方式被故意使用,会存在潜在的危险性。 + +![在Linux中安装Tor浏览器](http://www.tecmint.com/wp-content/uploads/2014/04/Install-tor-browser-in-linux.jpg) + +*Tor浏览器:匿名浏览器* + +此外,美国国家安全局(NSA)这样的国际间谍机构会记录我们的数字足迹。更不必说受到控制的代理服务器也会被用来做为数据搜集服务器。并且大多数企业和公司不会允许您访问代理服务器(使您能保障自己的隐私)。 + +因此,我们需要的最好是一个小型、独立、可携带的应用程序,它能达到匿名的效果。Tor浏览器便是这样的一个应用,它拥有上面提到的所有功能,甚至不止于此。 + +这篇文章里我们会讨论Tor浏览器,它的功能、使用方式、领域、安装以及其他关于Tor浏览器的重要方面。 + +### 什么是Tor浏览器? ### + +Tor是一个自由分发的应用软件,以BSD许可证发布,通过其安全可靠的洋葱式的结构,允许用户匿名的进行网络浏览。从前,由于它的结构和运作机制,Tor被称为‘洋葱路由器’。这个应用是由C语言写成的。 + +#### Tor浏览器的功能 #### + +- 跨平台可用。例如,这个应用程序在Linux、Windows和Mac下都可用。 +- 在发送数据到因特网前进行复杂的数据加密。 +- 在客户端进行数据自动解密。 +- 它是火狐浏览器和Tor工程的结合。 +- 对服务器和网站提供匿名性。 +- 可以访问被限制的网站。 +- 无需暴露源IP便可以执行任务。 +- 可以将数据路由至/从防火墙后隐藏的服务和应用程序。 +- 便携性 - 可以直接从USB存储棒上运行一个预配置的web浏览器。无需本地安装。 +- 在x86和x86_64平台均可用 +- 可以配置为一个运行在“localhost”的“9050”端口上的“socks4a”代理来让FTP跑在Tor 上。 +- Tor拥有处理上千的中继和上百万用户的能力。 + +#### Tor浏览器如何工作? #### + +Tor的工作方式基于洋葱路由的概念。洋葱路由的结构类似洋葱,它的每一层都嵌套在另一层里面,就像洋葱一样。这种嵌套的结构负责多次加密数据并将其通过虚拟电路进行发送。在客户端一侧每一层都在将他传递到下一层之前解密数据。最后一层在将原始数据传递到目的地前解密最里面一层的加密数据。 + +在这个过程里,这种解密整个层的功能设计的如此高明以至于无法追踪IP以及用户的地理位置,因此可以限制任何人观察您访问站点的网络连接。 + +所有这些过程看起来有些复杂,但用户使用Tor浏览器时没有必要担心。实际上,Tor浏览器的功能像其他浏览器一样(尤其是Mozilla的Firefox)。 + +### 在Linux中安装Tor浏览器 ### + +就像上面讨论的一样,Tor浏览器在Linux和Windows以及Mac下都可用。用户需要根据系统和架构的不同在下面的链接处下载最新的版本(例如,Tor浏览器4.0.4)。 + +- [https://www.torproject.org/download/download-easy.html.en][1] + +在下载Tor浏览器后,按说我们需要安装它,但是Tor的好处是我们不需要安装它。它能直接从随身设备中运行,并且该浏览器可以被预配置。这意味着插件和运行的特性可以完美的移植。 + +下载打包文件(*.tar.xz)后我们需要解压它。 + +**32位系统** + + $ wget https://www.torproject.org/dist/torbrowser/4.0.4/tor-browser-linux32-4.0.4_en-US.tar.xz + $ tar xpvf tor-browser-linux32-4.0.4_en-US.tar.xz + +**64位系统** + + $ wget https://www.torproject.org/dist/torbrowser/4.0.4/tor-browser-linux64-4.0.4_en-US.tar.xz + $ tar -xpvf tor-browser-linux64-4.0.4_en-US.tar.xz + +**注意** : 在上面的命令中,我们使用‘$‘意味着这个压缩包应以普通用户而不是root用户来解压。我们强烈建议您不要以root用户解压和运行Tor浏览器。 + +###开始使用Tor浏览器### + +在成功的解压后,我们便可以将解压后的浏览器移动到任何地方/USB存储设备中。并从解压的文件夹以非root用户直接运行‘start-tor-browser’。 + + $ cd tor-browser_en-US + $ ./start-tor-browser + +![开始使用Tor浏览器](http://www.tecmint.com/wp-content/uploads/2014/04/Starting-Tor-Network.jpg) + +*开始使用Tor浏览器* + +####1. 尝试连接到Tor网络#### + +点击“连接”之后Tor将按照设置帮您做剩下的事情。** + +![连接到Tor网络](http://www.tecmint.com/wp-content/uploads/2014/04/Tor-Network-Settings.jpg) + +*连接到Tor网络* + +####2. 欢迎窗口/标签。#### + +![Tor欢迎界面](http://www.tecmint.com/wp-content/uploads/2014/04/Tor-Welcome-Screen.png) + +*Tor欢迎界面* + +**3. 用Tor浏览器在Youtube上看视频** + +![在Youtube上看视频](http://www.tecmint.com/wp-content/uploads/2014/04/Watching-Video-on-Youtube.jpg) + +*在Youtube上看视频* + +####4. 打开银行网址以进行在线购物和交易#### + +![浏览银行站点](http://www.tecmint.com/wp-content/uploads/2014/04/Browsing-Site.jpg) + +*浏览银行站点* + +####5. 浏览器显示我当前的代理IP#### + +注意其中的文字为“Proxy Server detected”。** + +![检查IP地址](http://www.tecmint.com/wp-content/uploads/2014/04/Checking-IP-Address.jpg) + +*检查IP地址* + +**注意**: 每次您想运行Tor时,您需要在文本模式上运行Tor启动脚本。并且该终端在您运行Tor时会一直被占用。如何克服这些,并创建一个桌面/Dock栏图标呢? + +####6. 我们需要在解压的文件夹中创建`tor.desktop`#### + +$ touch tor.desktop + +接着使用您喜欢的编辑器编辑这个文件,加入下面的文本,这里我使用nano。 + + $ nano tor.desktop + +---------- + + #!/usr/bin/env xdg-open + [Desktop Entry] + Encoding=UTF-8 + Name=Tor + Comment=Anonymous Browse + Type=Application + Terminal=false + Exec=/home/avi/Downloads/tor-browser_en-US/start-tor-browser + Icon=/home/avi/Downloads/tor-browser_en-US/Browser/browser/icons/mozicon128.png + StartupNotify=true + Categories=Network;WebBrowser; + +**注意**: 确保将上面的tor浏览器的路径替换为您的环境中的路径。 + +####7. 一旦搞定后,您就可以双击`tor.desktop`文件来运行Tor浏览器了#### + +您可能需要在第一次运行时信任该文件。 + +![Tor应用启动器](http://www.tecmint.com/wp-content/uploads/2014/04/Tor-Application-Launcher.jpg) + +*Tor应用启动器* + +####8. 一旦您选择了信任,请注意`tor.desktop`文件的图标则会改变### + +![Tor图标已改变](http://www.tecmint.com/wp-content/uploads/2014/04/Tor-icon-changed.jpg) + +*Tor图标已改变* + +####9. 您可以通过拖拽`tor.desktop`的图标在桌面和Dock栏中创建快捷方式#### + +![在桌面添加Tor快捷方式](http://www.tecmint.com/wp-content/uploads/2014/04/Add-Tor-Shortcut-on-Desktop.jpg) + +*在桌面添加Tor快捷方式* + +####10. 关于Tor浏览器#### + +![关于Tor浏览器](http://www.tecmint.com/wp-content/uploads/2014/04/About-Tor-Browser.jpg) + +*关于Tor浏览器* + +**注意**: 如果您在使用旧版本的Tor,您可以从上面的窗口更新它。 + +#### 应用的可用性和领域 #### + +- 匿名使用网络。 +- 浏览被封锁的页面。 +- 连接其他应用,即(FTP)来保证网络安全的访问。 + +#### 关于Tor浏览器的争论 #### + +- 在Tor应用的边界上并没有什么安全措施。比如,数据入口点和出口点。 +- 一项2011年的研究发现一种特殊的针对Tor浏览器的攻击可以得到BitTorrent用户的IP地址。 +- 在一些研究中发现某些特定的协议有泄漏IP地址的倾向。 +- 早些的Tor版本绑定了旧版本的Firefox浏览器,这被证明较易受JavaScript攻击。 +- Tor浏览器运行起来比较慢。 + +#### 真实世界中Tor浏览器的实现 #### + +- [Vuze BitTorrent Client][3] +- Anonymous Os +- Os’es from Scratch +- whonix 等 + +#### Tor浏览器的未来 #### + +Tor浏览器是前途无量的。也许第一个该类应用程序的实现是非常出色的,但Tor浏览器必须加大对支持、伸缩性、以及对近期的攻击进行数据安全的研究的投入。这个应用程序是未来的需要。 + +#### 下载免费的电子书 #### + +非官方的Tor私密浏览指南: + +[![](http://img.tradepub.com/free/w_make129/images/w_make129c4.gif)][2] + +### 结论 ### + +如果您工作的部门不允许您访问某网站,或者如果您不希望别人知道您的私人事务,或您不想向NSA提供您的个人数字足迹,那么Tor浏览器在目前是必须的。 + +**注意**: Tor浏览器提供的安全性不能抵御病毒、木马或其他类似这样的安全威胁。写这篇文章的目的也不是希望通过在互联网上隐藏我们的身份来放纵非法活动。这篇文章纯粹是为了教学的目的,作者和Tecmint均不会为任何非法的使用负责。这是用户自己的责任。 + +Tor浏览器是一个非常不错的应用,您值得尝试!这就是我要说的全部了,我还会在这里写一些您感兴趣的文章,所以请继续关注。别忘了在留言区提供给我们您有价值的反馈。 + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/tor-browser-for-anonymous-web-browsing/ + +作者:[Avishek Kumar][a] +译者:[wwy-hust](https://github.com/wwy-hust) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/avishek/ +[1]:https://www.torproject.org/download/download-easy.html.en +[2]:http://tecmint.tradepub.com/free/w_make129/prgm.cgi +[3]:http://www.tecmint.com/install-vuze-torrent-client-in-linux/ \ No newline at end of file diff --git a/translated/tech/20150617 Tor Browser--An Ultimate Web Browser for Anonymous Web Browsing in Linux.md b/translated/tech/20150617 Tor Browser--An Ultimate Web Browser for Anonymous Web Browsing in Linux.md deleted file mode 100644 index 1c6a039920..0000000000 --- a/translated/tech/20150617 Tor Browser--An Ultimate Web Browser for Anonymous Web Browsing in Linux.md +++ /dev/null @@ -1,206 +0,0 @@ -TorLinuxWebռ -================================================================================ -Ǵ˶滨Ѻܶʱ䡣ʹõӦóҪһWebĻҪԿͻ/ķʽ¼̻IPַϢԼDZڵϢЩϢʽʹãDZڵΣԡ - -![LinuxаװTor](http://www.tecmint.com/wp-content/uploads/2014/04/Install-tor-browser-in-linux.jpg) - -Tor - -⣬Ұȫ֣NSAʼ¼ǵ㼣˵ij޵ĴҲᱻΪѼҴҵ͹˾ʴʹܱԼ˽ - -ˣҪһС͡ЯӦóܴﵽЧTorһӦãӵᵽйܣֹڴˡ - -ƪǻTorĹܡʹ÷ʽ򡢰װԼTorҪ档 - -#### ʲôTor #### - -TorһɷַӦBSDʽ֤ͨ䰲ȫɿʽĽṹûĽǰĽṹƣTorΪ·ӦCдɵġ - -#### TorĹ #### - -- ƽ̨á磬ӦóLinuxWindowsMac¶á -- ڷݵǰиӵݼܡ -- ڿͻ˽еԶܡ -- ǻTor̵Ľϡ -- Էվṩԡ -- Էʱվ -- 豩¶ԴIPִ -- ڷǽ·/صķӦó -- Я - ֱӴUSB洢һԤõweb豾ذװ -- x86x86_64ƽ̨ -- ͨʹTorԡsocks4aķʽڡlocalhostġ9050˿ôFTP -- Torӵдǧתϰû - -#### Torι #### - -TorĹʽ·ɵĸ·ɵĽṹУÿһ㶼Ƕһ棬һǶ׵Ľṹμݲͨ·з͡ڿͻһÿһ㶼ڽݵһ֮ǰݡһڽԭʼݴݵĿĵǰһļݡ - -ֽĹƵ˸޷׷IPԼûĵλã˿κ˹۲վӡ - -Щ̿ЩӣûʹTorʱûбҪġʵϣTorĹһMozillaFirefox - -### LinuxаװTor ### - -۵һTorLinuxWindowsԼMac¶áûҪϵͳͼܹIJͬӴµİ汾磬Tor4.0.4 - -- [https://www.torproject.org/download/download-easy.html.en][1] - -TorҪװõDzҪװTorֱӴ豸УҸԱԤáζŲеԿֲ - -شļ*.tar.xzҪѹ - -**32λϵͳ** - - $ wget https://www.torproject.org/dist/torbrowser/4.0.4/tor-browser-linux32-4.0.4_en-US.tar.xz - $ tar xpvf tor-browser-linux32-4.0.4_en-US.tar.xz - -**64λϵͳ** - - $ wget https://www.torproject.org/dist/torbrowser/4.0.4/tor-browser-linux64-4.0.4_en-US.tar.xz - $ tar -xpvf tor-browser-linux64-4.0.4_en-US.tar.xz - -**ע** : Уʹá$ζѹӦͨûrootûѹǿҽҪrootûѹTor - -ڳɹĽѹDZԽѹƶκεط/USB洢豸СӽѹļԷrootûֱСstart-tor-browser - - $ cd tor-browser_en-US - $ ./start-tor-browser - -![ʼʹTor](http://www.tecmint.com/wp-content/uploads/2014/04/Starting-Tor-Network.jpg) - -ʼʹTor - -**1. ӵTor硣ӡ֮Torðʣµ顣** - -![ӵTor](http://www.tecmint.com/wp-content/uploads/2014/04/Tor-Network-Settings.jpg) - -ӵTor - -**2. ӭ/ǩ** - -![Torӭ](http://www.tecmint.com/wp-content/uploads/2014/04/Tor-Welcome-Screen.png) - -Torӭ - -**3. TorYoutubeƵ** - -![YoutubeϿƵ](http://www.tecmint.com/wp-content/uploads/2014/04/Watching-Video-on-Youtube.jpg) - -YoutubeϿƵ - -**4. ַԽ߹ͽס** - -![վ](http://www.tecmint.com/wp-content/uploads/2014/04/Browsing-Site.jpg) - -վ - -**5. ʾҵǰĴIPעıΪProxy Server detected** - -![IPַ](http://www.tecmint.com/wp-content/uploads/2014/04/Checking-IP-Address.jpg) - -IPַ - -**ע**: ÿTorʱҪʹıģʽָTorűҸնTorʱæµ״̬ο˷Щһ/Dockͼأ - -**6. Ҫڽѹļд`tor.desktop`** - -$ touch tor.desktop - -ʹϲı༭༭ļıʹnano - - $ nano tor.desktop - ----------- - - #!/usr/bin/env xdg-open - [Desktop Entry] - Encoding=UTF-8 - Name=Tor - Comment=Anonymous Browse - Type=Application - Terminal=false - Exec=/home/avi/Downloads/tor-browser_en-US/start-tor-browser - Icon=/home/avi/Downloads/tor-browser_en-US/Browser/browser/icons/mozicon128.png - StartupNotify=true - Categories=Network;WebBrowser; - -**ע**: ȷtor·滻ΪĻе· - -**7. һ㶨Ϳ˫`tor.desktop`ļTorˣҪڵһʱθļ** - -![TorӦ](http://www.tecmint.com/wp-content/uploads/2014/04/Tor-Application-Launcher.jpg) - -TorӦ - -**8. һѡΣע`tor.desktop`ļͼı䡣** - -![TorͼѸı](http://www.tecmint.com/wp-content/uploads/2014/04/Tor-icon-changed.jpg) - -TorͼѸı - -**9. ͨק`tor.desktop`ͼDockдݷʽ** - -![Torݷʽ](http://www.tecmint.com/wp-content/uploads/2014/04/Add-Tor-Shortcut-on-Desktop.jpg) - -Torݷʽ - -**10. Tor** - -![Tor](http://www.tecmint.com/wp-content/uploads/2014/04/About-Tor-Browser.jpg) - -Tor - -**ע**: ʹþɰ汾TorԴĴڸ - -#### ӦõĿԺ #### - -- ʹ硣 -- 赲ҳ档 -- ӦãFTP֤簲ȫķʡ - -#### Tor #### - -- Torܱ߲ûʲôȫʩ磬ڵͳڵ㡣 -- һ2011оһTorĹԵõBitTorrentûIPַ -- һЩозijЩضЭй©IPַ -- TorЩİ汾˾ɰ汾Firefoxⱻ֤JavaScript -- TorıȽϻ - -#### ʵTorʵ #### - -- Vuze BitTorrent Client -- Anonymous Os -- Oses from Scratch -- whonix - -#### Torδ #### - -Torǰ;ġҲʵֵĵһӦódzɫTorӴԵ֧ԼԽڵĹоԱ֤ݰȫӦóδҪ - -#### ѵĵ #### - -ǹٷTor˽ָ - -[![](http://img.tradepub.com/free/w_make129/images/w_make129c4.gif)][2] - -### ### - -IJŲijվϣ֪˽NSAṩĸ㼣ôTorĿǰDZġ - -**ע**: TorṩİȫԲܵľİȫвдƪµĿҲϣͨڻǵݷǷƪ´Ϊ˽ѧĿģߺTecmintΪκηǷʹøûΨһΡ - -TorһdzӦãֵóԣҪ˵ȫˣһдһЩȤ£עTecmintṩмֵķ - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/tor-browser-for-anonymous-web-browsing/ - -ߣ[Avishek Kumar][a] -ߣ[wwy-hust](https://github.com/wwy-hust) -Уԣ[УID](https://github.com/УID) - - [LCTT](https://github.com/LCTT/TranslateProject) ԭ룬[Linuxй](https://linux.cn/) Ƴ - -[a]:http://www.tecmint.com/author/avishek/ -[1]:https://www.torproject.org/download/download-easy.html.en -[2]:http://tecmint.tradepub.com/free/w_make129/prgm.cgi \ No newline at end of file From 70c29cbc75fbca204b058b57b068fd63e752f9fb Mon Sep 17 00:00:00 2001 From: Kevin Sicong Jiang Date: Tue, 7 Jul 2015 15:00:40 -0500 Subject: [PATCH 544/965] =?UTF-8?q?Update=20and=20rename=2020150612=20Linu?= =?UTF-8?q?x=5FLogo--A=20Command=20Line=20Tool=20to=20Print=20Color=20ANSI?= =?UTF-8?q?=20Logos=20of=20Linux=20Distributions.md=20to=20[=E7=BF=BB?= =?UTF-8?q?=E8=AF=91=E4=B8=AD]20150612=20Linux=5FLogo--A=20Command=20Line?= =?UTF-8?q?=20Tool=20to=20Print=20Color=20ANSI=20Logos=20of=20Linux=20Dist?= =?UTF-8?q?ributions.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 准备翻译此文 --- ...Line Tool to Print Color ANSI Logos of Linux Distributions.md} | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) rename sources/tech/{20150612 Linux_Logo--A Command Line Tool to Print Color ANSI Logos of Linux Distributions.md => [翻译中]20150612 Linux_Logo--A Command Line Tool to Print Color ANSI Logos of Linux Distributions.md} (99%) diff --git a/sources/tech/20150612 Linux_Logo--A Command Line Tool to Print Color ANSI Logos of Linux Distributions.md b/sources/tech/[翻译中]20150612 Linux_Logo--A Command Line Tool to Print Color ANSI Logos of Linux Distributions.md similarity index 99% rename from sources/tech/20150612 Linux_Logo--A Command Line Tool to Print Color ANSI Logos of Linux Distributions.md rename to sources/tech/[翻译中]20150612 Linux_Logo--A Command Line Tool to Print Color ANSI Logos of Linux Distributions.md index 6cdc510092..cd502ac0a9 100644 --- a/sources/tech/20150612 Linux_Logo--A Command Line Tool to Print Color ANSI Logos of Linux Distributions.md +++ b/sources/tech/[翻译中]20150612 Linux_Logo--A Command Line Tool to Print Color ANSI Logos of Linux Distributions.md @@ -1,3 +1,4 @@ +[translating by KevinSJ] Linux_Logo – A Command Line Tool to Print Color ANSI Logos of Linux Distributions ================================================================================ linuxlogo or linux_logo is a Linux command line utility that generates a color ANSI picture of Distribution logo with a few system information. @@ -180,4 +181,4 @@ via: http://www.tecmint.com/linux_logo-tool-to-print-color-ansi-logos-of-linux/ 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 [a]:http://www.tecmint.com/author/avishek/ -[1]:http://www.tecmint.com/screenfetch-system-information-generator-for-linux/ \ No newline at end of file +[1]:http://www.tecmint.com/screenfetch-system-information-generator-for-linux/ From 71c19d7b7272d6f2dde8b9f7ab52c69f0245f6e3 Mon Sep 17 00:00:00 2001 From: DeadFire Date: Thu, 9 Jul 2015 15:17:44 +0800 Subject: [PATCH 545/965] =?UTF-8?q?20150709-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...s--Linus Torvalds Answers Your Question.md | 184 ++++++++++++++++++ ...ata1 file continuously growing in MySQL.md | 114 +++++++++++ 2 files changed, 298 insertions(+) create mode 100644 sources/talk/20150709 Interviews--Linus Torvalds Answers Your Question.md create mode 100644 sources/tech/20150709 Why is the ibdata1 file continuously growing in MySQL.md diff --git a/sources/talk/20150709 Interviews--Linus Torvalds Answers Your Question.md b/sources/talk/20150709 Interviews--Linus Torvalds Answers Your Question.md new file mode 100644 index 0000000000..e723658787 --- /dev/null +++ b/sources/talk/20150709 Interviews--Linus Torvalds Answers Your Question.md @@ -0,0 +1,184 @@ +Interviews: Linus Torvalds Answers Your Question +================================================================================ +Last Thursday you had a chance to [ask Linus Torvalds][1] about programming, hardware, and all things Linux. You can read his answers to those questions below. If you'd like to see what he had to say the last time we sat down with him, [you can do so here][2]. + +**Productivity** +by DoofusOfDeath + +> You've somehow managed to originate two insanely useful pieces of software: Linux, and Git. Do you think there's anything in your work habits, your approach to choosing projects, etc., that have helped you achieve that level of productivity? Or is it just the traditional combination of talent, effort, and luck? + +**Linus**: I'm sure it's pretty much always that "talent, effort and luck". I'll leave it to others to debate how much of each... + +I'd love to point out some magical work habit that makes it all happen, but I doubt there really is any. Especially as the work habits I had wrt the kernel and Git have been so different. + +With Git, I think it was a lot about coming at a problem with fresh eyes (not having ever really bought into the traditional SCM mindset), and really trying to think about the issues, and spending a fair amount of time thinking about what the real problems were and what I wanted the design to be. And then the initial self-hosting code took about a day to write (ok, that was "self-hosting" in only the weakest sense, but still). + +And with Linux, obviously, things were very different - the big designs came from the outside, and it took half a year to host itself, and it hadn't even started out as a kernel to begin with. Clearly not a lot of thinking ahead and planning involved ;). So very different circumstances indeed. + +What both the kernel and Git have, and what I think is really important (and I guess that counts as a "work habit"), is a maintainer that stuck to it, and was responsive, responsible and sane. Too many projects falter because they don't have people that stick with them, or have people who have an agenda that doesn't match reality or the user expectations. + +But it's very important to point out that for Git, that maintainer was not me. Junio Hamano really should get pretty much all the credit for Git. Credit where credit is due. I'll take credit for the initial implementation and design of Git - it may not be perfect, but ten years on it still is very solid and very clearly the same basic design. But I'll take even _more_ credit for recognizing that Junio had his head screwed on right, and was the person to drive the project. And all the rest of the credit goes to him. + +Of course, that kind of segues into something else the kernel and Git do have in common: while I still maintain the kernel, I did end up finding a lot of smart people to maintain all the different parts of it. So while one important work habit is that "stick to it" persistence that you need to really take a project from a not-quite-usable prototype to something bigger and better, another important work-habit is probably to also "let go" and not try to own and control the project too much. Let other people really help you - guide the process but don't get in their way. + +**init system** +by lorinc + +> There wasn't a decent unix-like kernel, you wrote one which ultimately became the most used. There wasn't a decent version control software, you wrote one which ultimately became the most love. Do you think we already have a decent init system, or do you have plan to write one that will ultimately settle the world on that hot topic? + +**Linus**: You can say the word "systemd", It's not a four-letter word. Seven letters. Count them. + +I have to say, I don't really get the hatred of systemd. I think it improves a lot on the state of init, and no, I don't see myself getting into that whole area. + +Yeah, it may have a few odd corners here and there, and I'm sure you'll find things to despise. That happens in every project. I'm not a huge fan of the binary logging, for example. But that's just an example. I much prefer systemd's infrastructure for starting services over traditional init, and I think that's a much bigger design decision. + +Yeah, I've had some personality issues with some of the maintainers, but that's about how you handle bug reports and accept blame (or not) for when things go wrong. If people thought that meant that I dislike systemd, I will have to disappoint you guys. + +**Can Valve change the Linux gaming market?** +by Anonymous Coward + +> Do you think Valve is capable of making Linux a primary choice for gamers? + +**Linus**: "Primary"? Probably not where it's even aiming. I think consoles (and all those handheld and various mobile platforms that "real gamers" seem to dismiss as toys) are likely much more primary, and will stay so. + +I think Valve wants to make sure they can control their own future, and Linux and ValveOS is probably partly to explore a more "console-like" Valve experience (ie the whole "get a box set up for a single main purpose", as opposed to a more PC-like experience), and partly as a "second source" against Microsoft, who is a competitor in the console area. Keeping your infrastructure suppliers honest by making sure you have alternatives sounds like a good strategy, and particularly so when those suppliers may be competing with you directly elsewhere. + +So I don't think the aim is really "primary". "Solid alternative" is I think the aim. Of course, let's see where it goes after that. + +But I really have not been involved. People like Greg and the actual graphics driver guys have been in much more direct contact with Valve. I think it's great to see gaming on Linux, but at the same time, I'm personally not really much of a gamer. + +**The future of RT-Linux?** +by nurhussein + +> According to Thomas Gleixner, [the future of the realtime patchset to Linux is in doubt][2], as it is difficult to secure funding from interested parties on this functionality even though it is both useful and important: What are your thoughts on this, and what do you think we need to do to get more support behind the RT patchset, especially considering Linux's increasing use in embedded systems where realtime functionality is undoubtedly useful. + +**Linus**: So I think this is one of those things where the markets decide how important rtLinux ends up being, and I suspect there are more than enough companies who end up wanting and using rtLinux that the project isn't really going anywhere. The complaints by Thomas were - I think - a wake-up call to the companies who end up wanting the extended hard realtime patches. + +So I suspect there are companies and groups like OSADL that end up funding and helping with rtLinux, and that it isn't going away. + +**Rigor and developments** +by hcs_$reboot + +> The most complex program running on a machine is arguably its OS, especially the kernel. Linux (kernel) reached the top level in terms of performance, reliability and versatility. You have been criticized quite a few times for some virulent mails addressed to developers. Do you think Linux would be where it is without managing the project with an iron fist? To go further, do you think some other main OSS project would benefit from a more rigorous management approach? + +**Linus**: One of the nice things about open source is how it allows people to really concentrate on what they are good at, and it has been a huge advantage for Linux that we've had people who are interested in the marketing side and selling Linux, as well as the legal side etc. + +And that is all in addition, of course, to the original "we're motivated by the technology" people like me. And even within that "we're motivated by technology" group, you most certainly don't need to find _everything_ interesting, you can find the area you are passionate about and really care about and want to work on. + +That's _fundamentally_ how open source works. + +Now, if somebody is passionate about some "good management" thing, go wild, and try to get involved, and try to manage things. It's not what _I_ am interested in, but hey, the proof is in the pudding - anybody who thinks they have a new rigorous management approach that they think will help some part of the process, go wild. + +Now, I personally suspect that it wouldn't work - not only are tech people an ornery lot to begin with (that whole "herding cats" thing), just look at all the crazy arguments on the internet. And ask yourself what actually holds an open source project like the kernel together? I think you need to be very oriented towards the purely technical solutions, simply because then you have tangible and real issues you can discuss (and argue about) with fairly clear-cut hard answers. It's the only thing people can really agree on in the big picture. + +So the Linux approach to "management" has been to put technology first. That's rigorous enough for me. But as mentioned, it's a free-for-all. Anybody can come in and try to do better. Really. + +And btw, it's worth noting that there are obviously specific smaller development teams where other management models work fine. Most of the individual developers are parts of teams inside particular companies, and within the confines of that company, there may well be a very strict rigorous management model. Similarly, within the confines of a particular productization effort there may be particular goals and models for that particular team that transcend that general "technical issues" thing. + +Just to give a concrete example, the "development kernel" tree that I maintain works fundamentally differently and with very different rules from the "stable tree" that Greg does, which in turn is maintained very differently from what a distribution team within a Linux company does inside its maintenance kernel team. + +So there's certainly room for different approaches to managing those very different groups. But do I think you can "rigorously manage" people on the internet? No. + +**Functional languages?** +by EmeraldBot + +> While historically you've been a C and Assembly guy (and the odd shell scripting and such), what do you think of functional languages such as Lisp, Closure, Haskell, etc? Do you see any advantages to them, or do you view them as frivolous and impractical? If you decide to do so, thanks for taking the time to answer my question! You're a legend at what you do, and I think it's awesome that the significantly less interesting me can ask you a question like this. + +**Linus**: I may be a fan of C (with a certain fondness for assembly, just because it's so close to the machine), but that's very much about a certain context. I work at a level where those languages make sense. I certainly don't think that tools like Haskell etc are "frivolous and impractical" in general, although on a kernel level (or in a source control management system) I suspect they kind of are. + +Many moons ago I worked on sparse (the C parser and analyzer), and one of my coworkers was a Haskell fan, and did incredible example transformations in very simple (well, to him) code - stuff that is just nasty to write in C because it's pretty high-level, there's tons of memory management, and you're really talking about implementing fairly abstract and high-level rules with pattern matching etc. + +So I'm definitely not a functional language kind of guy - it's not how I learnt programming, and it really isn't very relevant to what I do, and I wouldn't recognize Haskell code if it bit me in the ass and called me names. But no, I wouldn't call them frivolous. + +**Critical software to the use of Linux** +by TWX + +> Mr. Torvalds, For many uses of Linux such as on the desktop, other software beyond the kernel and the base GNU tools are required. What other projects would you like to see given priority, and what would you like to see implemented or improved? Admittedly I thought most about X-Windows when asking this question; but I don't doubt that other daemons or systems can be just as important to the user experience. Thank you for your efforts all these years. + +**Linus**: Hey, I don't really have any particular project I would want to champion, largely because we all have so different requirements on the desktop. There's just no single thing that stands out as being hugely more important than others to me. + +What I do wish particularly desktop developers cared about is "consistency of experience". And by that I don't mean some kind of enforced visual consistency between different applications to make things "look coherent". No, I'm just talking about the pain and uncertainty users go through with upgrades, and understanding that while your project may be the most important project to *you* (because it's what you do), to your users, your project is likely just a fairly small and irrelevant part of their experience, and it's not very central at all, and they've learnt the quirks about that thing they don't even care about, and you really shouldn't break their expectations. Because it turns out that that is how you really make people hate their desktop. + +This is not at all Linux-specific, of course - just look at the less than enthusiastic reception that other operating system redesigns have received. But I really wish that we hadn't had *both* of the major Linux desktop environments have to learn this (well, I hope they learnt) the hard way, and both of them ending up blaming their users rather than themselves. + +**"anykernel"-style portable drivers?** +by staalmannen + +> What do you think about the "anykernel" concept (invented by another Finn btw) used in NetBSD? Basically, they have modularized the code so that a driver can be built either in a monolithic kernel or for user space without source code changes ( rumpkernel.org ). The drivers are highly portable and used in Genode os (L4 type kernels), minix etc... Would this be possible or desirable for Linux? Apparently there is one attempt called "libos"... + +**Linus**: So I have bad experiences with "portable" drivers. Writing drivers to some common environment tends to force some ridiculously nasty impedance matching abstractions that just get in the way and make things really hard to read and modify. It gets particularly nasty when everybody ends up having complicated - and differently so - driver subsystems to handle a lot of commonalities for a certain class of drivers (say a network driver, or a USB driver), and the different operating systems really have very different approaches and locking rules etc. + +I haven't seen anykernel drivers, but from past experience my reaction to "portable device drivers" is to run away, screaming like little girl. As they say in Swedish "Bränt barn luktar illa". + +**Processor Architecture** +by swv3752 + +> Several years ago, you were employed by Transmeta designing the Crusoe processor. I understand you are quite knowledgeable about cpu architecture. What are your thoughts on the Current Intel and AMD x86 CPUs particularly in comparison with ARM and IBM's Power8 CPUs? Where do you see the advantages of each one? + +**Linus**: I'm no CPU architect, I just play one on TV. + +But yes, I've been close to the CPU both as part of my kernel work, and as part of a processor company, and working at that level for a long time just means that you end up having fairly strong opinions. One of the things that my experiences at Transmeta convinced me of, for example, was that there's definitely very much a limit to what software should care about. I loved working at Transmeta, I loved the whole startup company environment, I loved working with really smart people, but in the end I ended up absolutely *not* loving to work with overly simple hardware (I also didn't love the whole IPO process, and what that did to the company culture, but that's a different thing). + +Because there's only so much that software can do to compensate. + +Something similar happened with my kernel work on the alpha architecture, which also started out as being an overly simplified implementation in the name of being small and supposedly running really fast. While I really started out liking the alpha architecture for being so clean, I ended up detesting how fragile the architecture implementations were (and by the time that got fixed in the 21264, I had given up on alpha). + +So I've come to absolutely detest CPU's that need a lot of compiler smarts or special tuning to go fast. Life is too short to waste on in-order CPU's, or on hardware designers who think software should take care of the pieces that they find to be too complicated to handle themselves, and as a result just left undone. "Weak memory ordering" is just another example. + +Thankfully, most of the industry these days seems to agree. Yes, there are still in-order cores, but nobody tries to make excuses for them any more: they are for the truly cheap and low-end market. + +I tend to really like the modern Intel cores in particular, which tend to take that "let's not be stupid" really to heart. With the kernel being so threaded, I end up caring a lot about things like memory ordering etc, and the Intel big-core CPU's tend to be in a class of their own there. As a software person who cares about performance and looks at instruction profiles etc, it's just so *nice* to see that the CPU doesn't have some crazy glass jaw where you have to be very careful. + +**GPU kernels** +by maraist + +> Is there any inspiration that a GPU based kernel / scheduler has for you? How might Linux be improved to better take advantage of GPU-type batch execution models. Given that you worked transmeta and JIT compiled host-targeted runtimes. GPUs 1,000-thread schedulers seem like the next great paradigm for the exact type of machines that Linux does best on. + +**Linus**: I don't think we'll see the kernel ever treat GPU threads the way we treat CPU threads. Not with the current model of GPU's (and that model doesn't really seem to be changing all that much any more). + +Yes, GPU's are getting much better, and now generally have virtual memory and the ability to preempt execution, and you could run an OS on them. But the scheduling latencies are pretty high, and the threads are not really "independent" (ie they tend to share a lot of state - like the virtual address space and a large shared register set), so GPU "threads" don't tend to work like CPU threads. You'd schedule them all-or-nothing, so if you were to switch processes, you'd treat the GPU as one entity where you switch all the threads at once. + +So it really wouldn't look like a thousand threads to the kernel. The GPU would still be scheduled as one single entity (or maybe a couple of entities depending on how the GPU is partitioned). The fact that that single entity works by doing a lot of things in massive parallelism is kind of immaterial for the kernel that doesn't end up seeing that parallelism as separate threads. + +**alleged danger of Artificial Intelligence** +by peter303 + +> Some computer experts like Marvin Minsky, Larry Page, Ray Kuzweil think A.I. will be a great gift to Mankind. Others like Bill Joy and Elon Musk are fearful of potential danger. Where do you stand, Linus? + +**Linus**: I just don't see the thing to be fearful of. + +We'll get AI, and it will almost certainly be through something very much like recurrent neural networks. And the thing is, since that kind of AI will need training, it won't be "reliable" in the traditional computer sense. It's not the old rule-based prolog days, when people thought they'd *understand* what the actual decisions were in an AI. + +And that all makes it very interesting, of course, but it also makes it hard to productize. Which will very much limit where you'll actually find those neural networks, and what kinds of network sizes and inputs and outputs they'll have. + +So I'd expect just more of (and much fancier) rather targeted AI, rather than anything human-like at all. Language recognition, pattern recognition, things like that. I just don't see the situation where you suddenly have some existential crisis because your dishwasher is starting to discuss Sartre with you. + +The whole "Singularity" kind of event? Yeah, it's science fiction, and not very good SciFi at that, in my opinion. Unending exponential growth? What drugs are those people on? I mean, really.. + +It's like Moore's law - yeah, it's very impressive when something can (almost) be plotted on an exponential curve for a long time. Very impressive indeed when it's over many decades. But it's _still_ just the beginning of the "S curve". Anybody who thinks any different is just deluding themselves. There are no unending exponentials. + +**Is the kernel basically a finished project?** +by NaCh0 + +> Aside from adding drivers and refactoring algorithms when performance limits are discovered, is there anything left for the kernel? Maybe it's a failure of tech journalism but we never hear about the next big thing in kernel land anymore. + +**Linus**: I don't think there's much of a "next big thing" in the kernel. + +I wouldn't say that there is nothing but drivers (and architectures are kind of "CPU drivers) and improving scalability left, because I'm constantly amazed by how many new things people figure out are still good ideas. But they tend to still be pretty incremental improvements. An OS kernel doesn't look *that* radically different from what it was 40 years ago, and that's fine. I think radical new ideas are often overrated, and the thing that really matters in the end is that plodding detail work. That's how technology evolves. + +And judging by how our kernel releases are going, there's no end in sight for that "plodding detail work". And it's still as interesting as it ever was. + +-------------------------------------------------------------------------------- + +via: http://linux.slashdot.org/story/15/06/30/0058243/interviews-linus-torvalds-answers-your-question + +作者:[samzenpus][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:samzenpus@slashdot.org +[1]:http://interviews.slashdot.org/story/15/06/24/1718247/interview-ask-linus-torvalds-a-question +[2]:http://meta.slashdot.org/story/12/10/11/0030249/linus-torvalds-answers-your-questions +[3]:https://lwn.net/Articles/604695/ \ No newline at end of file diff --git a/sources/tech/20150709 Why is the ibdata1 file continuously growing in MySQL.md b/sources/tech/20150709 Why is the ibdata1 file continuously growing in MySQL.md new file mode 100644 index 0000000000..92094a3315 --- /dev/null +++ b/sources/tech/20150709 Why is the ibdata1 file continuously growing in MySQL.md @@ -0,0 +1,114 @@ +Why is the ibdata1 file continuously growing in MySQL? +================================================================================ +![ibdata1 file](https://www.percona.com/blog/wp-content/uploads/2013/08/ibdata1-file.jpg) + +We receive this question about the ibdata1 file in MySQL very often in [Percona Support][1]. + +The panic starts when the monitoring server sends an alert about the storage of the MySQL server – saying that the disk is about to get filled. + +After some research you realize that most of the disk space is used by the InnoDB’s shared tablespace ibdata1. You have [innodb_file_per_table][2] enabled, so the question is: + +### What is stored in ibdata1? ### + +When you have innodb_file_per_table enabled, the tables are stored in their own tablespace but the shared tablespace is still used to store other InnoDB’s internal data: + +- data dictionary aka metadata of InnoDB tables +- change buffer +- doublewrite buffer +- undo logs + +Some of them can be configured on [Percona Server][3] to avoid becoming too large. For example you can set a maximum size for change buffer with [innodb_ibuf_max_size][4] or store the doublewrite buffer on a separate file with [innodb_doublewrite_file][5]. + +In MySQL 5.6 you can also create external UNDO tablespaces so they will be in their own files instead of stored inside ibdata1. Check following [documentation link][6]. + +### What is causing the ibdata1 to grow that fast? ### + +Usually the first command that we need to run when there is a MySQL problem is: + + SHOW ENGINE INNODB STATUSG + +That will show us very valuable information. We start checking the **TRANSACTIONS** section and we find this: + + ---TRANSACTION 36E, ACTIVE 1256288 sec + MySQL thread id 42, OS thread handle 0x7f8baaccc700, query id 7900290 localhost root + show engine innodb status + Trx read view will not see trx with id >= 36F, sees < 36F + +This is the most common reason, a pretty old transaction created 14 days ago. The status is **ACTIVE**, that means InnoDB has created a snapshot of the data so it needs to maintain old pages in **undo** to be able to provide a consistent view of the database since that transaction was started. If your database is heavily write loaded that means lots of undo pages are being stored. + +If you don’t find any long-running transaction you can also monitor another variable from the INNODB STATUS, the “**History list length.**” It shows the number of pending purge operations. In this case the problem is usually caused because the purge thread (or master thread in older versions) is not capable to process undo records with the same speed as they come in. + +### How can I check what is being stored in the ibdata1? ### + +Unfortunately MySQL doesn’t provide information of what is being stored on that ibdata1 shared tablespace but there are two tools that will be very helpful. First a modified version of innochecksum made by Mark Callaghan and published in [this bug report][7]. + +It is pretty easy to use: + + # ./innochecksum /var/lib/mysql/ibdata1 + 0 bad checksum + 13 FIL_PAGE_INDEX + 19272 FIL_PAGE_UNDO_LOG + 230 FIL_PAGE_INODE + 1 FIL_PAGE_IBUF_FREE_LIST + 892 FIL_PAGE_TYPE_ALLOCATED + 2 FIL_PAGE_IBUF_BITMAP + 195 FIL_PAGE_TYPE_SYS + 1 FIL_PAGE_TYPE_TRX_SYS + 1 FIL_PAGE_TYPE_FSP_HDR + 1 FIL_PAGE_TYPE_XDES + 0 FIL_PAGE_TYPE_BLOB + 0 FIL_PAGE_TYPE_ZBLOB + 0 other + 3 max index_id + +It has 19272 UNDO_LOG pages from a total of 20608. **That’s the 93% of the tablespace**. + +The second way to check the content of a tablespace are the [InnoDB Ruby Tools][8] made by Jeremy Cole. It is a more advanced tool to examine the internals of InnoDB. For example we can use the space-summary parameter to get a list with every page and its data type. We can use standard Unix tools to get the number of **UNDO_LOG** pages: + + # innodb_space -f /var/lib/mysql/ibdata1 space-summary | grep UNDO_LOG | wc -l + 19272 + +Altough in this particular case innochecksum is faster and easier to use I recommend you to play with Jeremy’s tools to learn more about the data distribution inside InnoDB and its internals. + +OK, now we know where the problem is. The next question: + +### How can I solve the problem? ### + +The answer to this question is easy. If you can still commit that query, do it. If not you’ll have to kill the thread to start the rollback process. That will just stop ibdata1 from growing but it is clear that your software has a bug or someone made a mistake. Now that you know how to identify where is the problem you need to find who or what is causing it using your own debugging tools or the general query log. + +If the problem is caused by the purge thread then the solution is usually to upgrade to a newer version where you can use a dedicated purge thread instead of the master thread. More information on the following [documentation link][9]. + +### Is there any way to recover the used space? ### + +No, it is not possible at least in an easy and fast way. InnoDB tablespaces never shrink… see the following [10-year old bug report][10] recently updated by James Day (thanks): + +When you delete some rows, the pages are marked as deleted to reuse later but the space is never recovered. The only way is to start the database with fresh ibdata1. To do that you would need to take a full logical backup with mysqldump. Then stop MySQL and remove all the databases, ib_logfile* and ibdata* files. When you start MySQL again it will create a new fresh shared tablespace. Then, recover the logical dump. + +### Summary ### + +When the ibdata1 file is growing too fast within MySQL it is usually caused by a long running transaction that we have forgotten about. Try to solve the problem as fast as possible (commiting or killing a transaction) because you won’t be able to recover the wasted disk space without the painfully slow mysqldump process. + +Monitoring the database to avoid these kind of problems is also very recommended. Our [MySQL Monitoring Plugins][11] includes a Nagios script that can alert you if it finds a too old running transaction. + +-------------------------------------------------------------------------------- + +via: https://www.percona.com/blog/2013/08/20/why-is-the-ibdata1-file-continuously-growing-in-mysql/ + +作者:[Miguel Angel Nieto][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://www.percona.com/blog/author/miguelangelnieto/ +[1]:https://www.percona.com/products/mysql-support +[2]:http://dev.mysql.com/doc/refman/5.5/en/innodb-parameters.html#sysvar_innodb_file_per_table +[3]:https://www.percona.com/software/percona-server +[4]:https://www.percona.com/doc/percona-server/5.5/scalability/innodb_insert_buffer.html#innodb_ibuf_max_size +[5]:https://www.percona.com/doc/percona-server/5.5/performance/innodb_doublewrite_path.html?id=percona-server:features:percona_innodb_doublewrite_path#innodb_doublewrite_file +[6]:http://dev.mysql.com/doc/refman/5.6/en/innodb-performance.html#innodb-undo-tablespace +[7]:http://bugs.mysql.com/bug.php?id=57611 +[8]:https://github.com/jeremycole/innodb_ruby +[9]:http://dev.mysql.com/doc/innodb/1.1/en/innodb-improved-purge-scheduling.html +[10]:http://bugs.mysql.com/bug.php?id=1341 +[11]:https://www.percona.com/software/percona-monitoring-plugins \ No newline at end of file From 7d982a5bed74ed4c25ecffebc7cfa275170eef68 Mon Sep 17 00:00:00 2001 From: DeadFire Date: Thu, 9 Jul 2015 15:55:02 +0800 Subject: [PATCH 546/965] =?UTF-8?q?20150709-2=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... tools for monitoring your Linux system.md | 79 +++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 sources/talk/20150709 command line tools for monitoring your Linux system.md diff --git a/sources/talk/20150709 command line tools for monitoring your Linux system.md b/sources/talk/20150709 command line tools for monitoring your Linux system.md new file mode 100644 index 0000000000..012591d74f --- /dev/null +++ b/sources/talk/20150709 command line tools for monitoring your Linux system.md @@ -0,0 +1,79 @@ +7 command line tools for monitoring your Linux system +================================================================================ +**Here is a selection of basic command line tools that will make your exploration and optimization in Linux easier. ** + +![Image courtesy Meltys-stock](http://images.techhive.com/images/article/2015/06/command-line-tools-monitoring-linux-system-1-100591899-orig.png) + +### Dive on in ### + +One of the great things about Linux is how deeply you can dive into the system to explore how it works and to look for opportunities to fine tune performance or diagnose problems. Here is a selection of basic command line tools that will make your exploration and optimization easier. Most of these commands are already built into your Linux system, but in case they aren’t, just Google “install”, the command name, and the name of your distro and you’ll find which package needs installing (note that some commands are bundled with other commands in a package that has a different name from the one you’re looking for). If you have any other tools you use, let me know for our next Linux Tools roundup. + +![Image courtesy Mark Gibbs](http://images.techhive.com/images/article/2015/06/command-line-tools-monitoring-linux-system-2-100591901-orig.png) + +### How we did it ### + +FYI: The screenshots in this collection were created on [Debian Linux 8.1][1] (“Jessie”) running in a virtual machine under [Oracle VirtualBox 4.3.28][2] under [OS X 10.10.3][3] (“Yosemite”). See my next slideshow “[How to install Debian Linux in a VirtualBox VM][4]” for a tutorial on how to build your own Debian VM. + +![Image courtesy Mark Gibbs](http://images.techhive.com/images/article/2015/06/command-line-tools-monitoring-linux-system-3-100591902-orig.png) + +### Top command ### + +One of the simpler Linux system monitoring tools, the **top command** comes with pretty much every flavor of Linux. This is the default display, but pressing the “z” key switches the display to color. Other hot keys and command line switches control things such as the display of summary and memory information (the second through fourth lines), sorting the list according to various criteria, killing tasks, and so on (you can find the complete list at [here][5]). + +![Image courtesy Mark Gibbs](http://images.techhive.com/images/article/2015/06/command-line-tools-monitoring-linux-system-4-100591904-orig.png) + +### htop ### + +Htop is a more sophisticated alternative to top. Wikipedia: “Users often deploy htop in cases where Unix top does not provide enough information about the systems processes, for example when trying to find minor memory leaks in applications. Htop is also popularly used interactively as a system monitor. Compared to top, it provides a more convenient, cursor-controlled interface for sending signals to processes.” (For more detail go [here][6].) + +![Image courtesy Mark Gibbs](http://images.techhive.com/images/article/2015/06/command-line-tools-monitoring-linux-system-5-100591903-orig.png) + +### Vmstat ### + +Vmstat is a simpler tool for monitoring your Linux system performance statistics but that makes it highly suitable for use in shell scripts. Fire up your regex-fu and you can do some amazing things with vmstat and cron jobs. “The first report produced gives averages since the last reboot. Additional reports give information on a sampling period of length delay. The process and memory reports are instantaneous in either case” (go [here][7] for more info.). + +![Image courtesy Mark Gibbs](http://images.techhive.com/images/article/2015/06/command-line-tools-monitoring-linux-system-6-100591905-orig.png) + +### ps ### + +The ps command shows a list of running processes. In this case, I’ve used the “-e”switch to show everything, that is, all processes running (I’ve scrolled back to the top of the output otherwise the column names wouldn’t be visible). This command has a lot of switches that allow you to format the output as needed. Add a little of the aforementioned regex-fu and you’ve got a powerful tool. Go [here][8] for the full details. + +![Image courtesy Mark Gibbs](http://images.techhive.com/images/article/2015/06/command-line-tools-monitoring-linux-system-7-100591906-orig.png) + +### Pstree ### + +Pstree “shows running processes as a tree. The tree is rooted at either pid or init if pid is omitted. If a user name is specified, all process trees rooted at processes owned by that user are shown.”This is a really useful tool as the tree helps you sort out which process is dependent on which process (go [here][9]). + +![Image courtesy Mark Gibbs](http://images.techhive.com/images/article/2015/06/command-line-tools-monitoring-linux-system-8-100591907-orig.png) + +### pmap ### + +Understanding just how an app uses memory is often crucial in debugging, and the pmap produces just such information when given a process ID (PID). The screenshot shows the medium weight output generated by using the “-x”switch. You can get pmap to produce even more detailed information using the “-X”switch but you’ll need a much wider terminal window. + +![Image courtesy Mark Gibbs](http://images.techhive.com/images/article/2015/06/command-line-tools-monitoring-linux-system-9-100591900-orig.png) + +### iostat ### + +A crucial factor in your Linux system’s performance is processor and storage usage, which are what the iostat command reports on. As with the ps command, iostat has loads of switches that allow you to select the output format you need as well as sample performance over a time period and then repeat that sampling a number of times before reporting. See [here][10]. + +-------------------------------------------------------------------------------- + +via: http://www.networkworld.com/article/2937219/linux/7-command-line-tools-for-monitoring-your-linux-system.html + +作者:[Mark Gibbs][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.networkworld.com/author/Mark-Gibbs/ +[1]:https://www.debian.org/releases/stable/ +[2]:https://www.virtualbox.org/ +[3]:http://www.apple.com/osx/ +[4]:http://www.networkworld.com/article/2937148/how-to-install-debian-linux-8-1-in-a-virtualbox-vm +[5]:http://linux.die.net/man/1/top +[6]:http://linux.die.net/man/1/htop +[7]:http://linuxcommand.org/man_pages/vmstat8.html +[8]:http://linux.die.net/man/1/ps +[9]:http://linux.die.net/man/1/pstree +[10]:http://linux.die.net/man/1/iostat \ No newline at end of file From 434e295d22351af1d9b33825b09a37924b25de02 Mon Sep 17 00:00:00 2001 From: DeadFire Date: Thu, 9 Jul 2015 16:00:34 +0800 Subject: [PATCH 547/965] =?UTF-8?q?20150709-3=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... Believe in AI Singularity Are on Drugs.md | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 sources/news/20150709 Linus Torvalds Says People Who Believe in AI Singularity Are on Drugs.md diff --git a/sources/news/20150709 Linus Torvalds Says People Who Believe in AI Singularity Are on Drugs.md b/sources/news/20150709 Linus Torvalds Says People Who Believe in AI Singularity Are on Drugs.md new file mode 100644 index 0000000000..22b2ad0f01 --- /dev/null +++ b/sources/news/20150709 Linus Torvalds Says People Who Believe in AI Singularity Are on Drugs.md @@ -0,0 +1,33 @@ +Linus Torvalds Says People Who Believe in AI Singularity Are on Drugs +================================================================================ +*As usual, his comments should not be taken literally* + +![](http://i1-news.softpedia-static.com/images/news2/linus-torvalds-says-people-who-believe-in-an-ai-singularity-are-on-drugs-486373-2.jpg) + +**AI is a very hot topic right now, and many high profile people, including Elon Musk, the head of Tesla, have said that we're going to get sentient AIs soon and that it's going to be a dangerous threshold. It seems that Linus Torvalds doesn't feel the same way, and he thinks that it's just bad Sci-Fi.** + +The idea of AIs turning on their human creators is not something new, but recently the so-called AI singularity has been discussed, and people like Elon Musk and Stephen Hawking expressed concerns about the possibility of creating a monster. And it's not just them, forums and comments sections are full of alarmist people who don't know what to believe or who take for granted the opinions of much smarter people. + +As it turns out, Linus Torvalds, the creator of the Linux project, has a completely different opinion on this matter. In fact, he says that nothing like this will happen, and we have a much better reason to believe him. AI means that someone wrote its code, and Linus knows the power and the obstacles of writing an AI code. He's much likely to guess what's involved and to understands why an AI won't be a threat. + +### Linus Torvalds and AIs ### + +Linus Torvalds answered some questions from the community on [slashdot.org][1], and all his ideas were very interesting. He talked about the [future of gaming and Valve][2], but he also tackled stuff like AI. He's usually asked stuff about the kernel or open source, but he has opinions on other topics as well. As a matter a fact, the AI subject is something that he can actually talk about as a programmer. + +"So I'd expect just more of (and much fancier) rather targeted AI, rather than anything human-like at all. Language recognition, pattern recognition, things like that. I just don't see the situation where you suddenly have some existential crisis because your dishwasher is starting to discuss Sartre with you. The whole 'Singularity' kind of event? Yeah, it's science fiction, and not very good Sci-Fi at that, in my opinion. Unending exponential growth? What drugs are those people on? I mean, really" wrote Linus on Slashdot. + +It's your choice whether to believe Elon Musk or Linus, but if betting were involved, I would put my money on Linus. + +-------------------------------------------------------------------------------- + +via: http://news.softpedia.com/news/linus-torvalds-says-people-who-believe-in-an-ai-singularity-are-on-drugs-486373.shtml + +作者:[Silviu Stahie][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://news.softpedia.com/editors/browse/silviu-stahie +[1]:http://classic.slashdot.org/story/15/06/30/0058243 +[2]:http://news.softpedia.com/news/linus-torvalds-said-valve-is-exploring-a-second-source-against-microsoft-486266.shtml \ No newline at end of file From 2003c8d0601731d57f554157e7d1db0abc375da5 Mon Sep 17 00:00:00 2001 From: DeadFire Date: Thu, 9 Jul 2015 16:26:16 +0800 Subject: [PATCH 548/965] =?UTF-8?q?20150709-4=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...Google Hangouts Desktop Client In Linux.md | 67 +++++++++++ ... failure status due to previous errors'.md | 36 ++++++ ...w to install a Brother printer on Linux.md | 109 ++++++++++++++++++ ...abs in a GNOME terminal on Ubuntu 15.04.md | 38 ++++++ 4 files changed, 250 insertions(+) create mode 100644 sources/tech/20150709 Install Google Hangouts Desktop Client In Linux.md create mode 100644 sources/tech/20150709 Linux FAQs with Answers--How to fix 'tar--Exiting with failure status due to previous errors'.md create mode 100644 sources/tech/20150709 Linux FAQs with Answers--How to install a Brother printer on Linux.md create mode 100644 sources/tech/20150709 Linux FAQs with Answers--How to open multiple tabs in a GNOME terminal on Ubuntu 15.04.md diff --git a/sources/tech/20150709 Install Google Hangouts Desktop Client In Linux.md b/sources/tech/20150709 Install Google Hangouts Desktop Client In Linux.md new file mode 100644 index 0000000000..f7026f3d14 --- /dev/null +++ b/sources/tech/20150709 Install Google Hangouts Desktop Client In Linux.md @@ -0,0 +1,67 @@ +Install Google Hangouts Desktop Client In Linux +================================================================================ +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/google-hangouts-header-664x374.jpg) + +Earlier, we have seen how to [install Facebook Messenger in Linux][1] and [WhatsApp desktop client in Linux][2]. Both of these were unofficial apps. I have one more unofficial app for today and it is [Google Hangouts][3]. + +Of course, you can use Google Hangouts in the web browser but it is more fun to use the desktop client than the web browser one. Curious? Let’s see how to **install Google Hangouts desktop client in Linux** and how to use it. + +### Install Google Hangouts in Linux ### + +We are going to use an open source project called [yakyak][4] which is unofficial Google Hangouts client for Linux, Windows and OS X. I’ll show you how to use yakyak in Ubuntu but I believe that you can use the same method to use it in other Linux distributions. Before we see how to use it, let’s first take a look at main features of yakyak: + +- Send and receive chat messages +- Create and change conversations (rename, add people) +- Leave and/or delete conversation +- Desktop notifications +- Toggle notifications on/off +- Drag-drop, copy-paste or attach-button for image upload. +- Hangupsbot sync room aware (actual user pics) +- Shows inline images +- History scrollback + +Sounds good enough? Download the installation files from the link below: + +- [Download Google Hangout client yakyak][5] + +The downloaded file would be compressed. Extract it and you will see a directory like linux-x64 or linux-x32 based on your system. Go in to this directory and you should see a file named yakyak. Double click on it to run it. + +![Run Google Hangout in Linux](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/Google_Hangout_Linux_3.jpeg) + +You’ll have to enter your Google Account credentials of course. + +![Set up Google Hangouts in Ubuntu](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/Google_Hangout_Linux_2.jpeg) + +Once you are through, you’ll see a screen like the one below where you can chat with your Google contacts. + +![Google_Hangout_Linux_4](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/Google_Hangout_Linux_4.jpeg) + +If you want to show profile pictures of the contacts, you can select View->Show conversation thumbnails. + +![Google hangouts thumbnails](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/Google_Hangout_Linux_5.jpeg) + +You’ll also get desktop notification for new messages. + +![desktop notifications for Google Hangouts in Ubuntu Linux](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/Google_Hangout_Linux_1.jpeg) + +### Worth a try? ### + +I let you give it a try and decide whether or not it is worth to **install Google Hangouts client in Linux**. If you want official apps, take a look at these [instant messaging applications with native Linux clients][6]. Don’t forget to share your experience with Google Hangouts in Linux. + +-------------------------------------------------------------------------------- + +via: http://itsfoss.com/install-google-hangouts-linux/ + +作者:[Abhishek][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://itsfoss.com/author/abhishek/ +[1]:http://itsfoss.com/facebook-messenger-linux/ +[2]:http://itsfoss.com/whatsapp-linux-desktop/ +[3]:http://www.google.com/+/learnmore/hangouts/ +[4]:https://github.com/yakyak/yakyak +[5]:https://github.com/yakyak/yakyak +[6]:http://itsfoss.com/best-messaging-apps-linux/ \ No newline at end of file diff --git a/sources/tech/20150709 Linux FAQs with Answers--How to fix 'tar--Exiting with failure status due to previous errors'.md b/sources/tech/20150709 Linux FAQs with Answers--How to fix 'tar--Exiting with failure status due to previous errors'.md new file mode 100644 index 0000000000..c970637b4d --- /dev/null +++ b/sources/tech/20150709 Linux FAQs with Answers--How to fix 'tar--Exiting with failure status due to previous errors'.md @@ -0,0 +1,36 @@ +Linux FAQs with Answers--How to fix “tar: Exiting with failure status due to previous errors” +================================================================================ +> **Question**: When I try to create an archive using tar command, it fails in the middle, and throws an error saying: "tar: Exiting with failure status due to previous errors." What causes this error, and how can I solve this error? + +![](https://farm9.staticflickr.com/8863/17631029953_1140fe2dd3_b.jpg) + +If you encounter the following error while running tar command, the most likely reason is that you do not have read permission on one of the files you are trying to archive with tar. + + tar: Exiting with failure status due to previous errors + +Then how can we pin down the file(s) causing the errors, or identify any other cause? + +The tar command should actually print out what those "previous errors" are, but you can easily miss printed error messages if you run tar in verbose mode (e.g., -cvf). To catch error messages more easily, you can filter out tar's stdout messages as follows. + + $ tar cvzfz backup.tgz my_program/ > /dev/null + +You will then see only error messages sent by tar to stderr. + + tar: my_program/src/lib/.conf.db.~lock~: Cannot open: Permission denied + tar: Exiting with failure status due to previous errors + +As you can see in the above example, the cause for the errors is indeed "denied read permission." + +To solve the problem, simply adjust the permission of the problematic file (or remove it), and re-run tar. + +-------------------------------------------------------------------------------- + +via: http://ask.xmodulo.com/tar-exiting-with-failure-status-due-to-previous-errors.html + +作者:[Dan Nanni][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://ask.xmodulo.com/author/nanni \ No newline at end of file diff --git a/sources/tech/20150709 Linux FAQs with Answers--How to install a Brother printer on Linux.md b/sources/tech/20150709 Linux FAQs with Answers--How to install a Brother printer on Linux.md new file mode 100644 index 0000000000..dd10d5c8dd --- /dev/null +++ b/sources/tech/20150709 Linux FAQs with Answers--How to install a Brother printer on Linux.md @@ -0,0 +1,109 @@ +Linux FAQs with Answers--How to install a Brother printer on Linux +================================================================================ +> **Question**: I have a Brother HL-2270DW laser printer, and want to print documents from my Linux box using this printer. How can I install an appropriate Brother printer driver on my Linux computer, and use it? + +Brother is well known for its affordable [compact laser printer lineup][1]. You can get a high-quality WiFi/duplex-capable laser printer for less than 200USD, and the price keeps going down. On top of that, they provide reasonably good Linux support, so you can download and install their printer driver on your Linux computer. I bought [HL-2270DW][2] model more than a year ago, and I have been more than happy with its performance and reliability. + +Here is how to install and configure a Brother printer driver on Linux. In this tutorial, I am demonstrating the installation of a USB driver for Brother HL-2270DW laser printer. So first connect your printer to a Linux computer via USB cable. + +### Preparation ### + +In this preparation step, go to the official [Brother support website][3], and search for the driver of your Brother printer by typing printer model name (e.g., HL-2270DW). + +![](https://farm1.staticflickr.com/301/18970034829_6f3a48d817_c.jpg) + +Once you go to the download page for your Brother printer, choose your Linux platform. For Debian, Ubuntu or their derivatives, choose "Linux (deb)". For Fedora, CentOS or RHEL, choose "Linux (rpm)". + +![](https://farm1.staticflickr.com/380/18535558583_cb43240f8a_c.jpg) + +On the next page, you will find a LPR driver as well as CUPS wrapper driver for your printer. The former is a command-line driver, while the latter allows you to configure and manage your printer via web-based administration interface. Especially the CUPS-based GUI is quite useful for (local or remote) printer maintenance. It is recommended that you install both drivers. So click on "Driver Install Tool" and download the installer file. + +![](https://farm1.staticflickr.com/329/19130013736_1850b0d61e_c.jpg) + +Before proceeding to run the installer file, you need to do one additional step if you are using a 64-bit Linux system. + +Since Brother printer drivers are developed for 32-bit Linux, you need to install necessary 32-bit libraries on 64-bit Linux as follows. + +On older Debian (6.0 or earlier) or Ubuntu (11.04 or earlier), install the following package. + + $ sudo apt-get install ia32-libs + +On newer Debian or Ubuntu which has introduced multiarch, you can install the following package instead: + + $ sudo apt-get install lib32z1 lib32ncurses5 + +which replaces ia32-libs package. Or, you can install just: + + $ sudo apt-get install lib32stdc++6 + +If you are using a Red Hat based Linux, you can install: + + $ sudo yum install glibc.i686 + +### Driver Installation ### + +Now go ahead and extract a downloaded driver installer file. + + $ gunzip linux-brprinter-installer-2.0.0-1.gz + +Next, run the driver installer file as follows. + + $ sudo sh ./linux-brprinter-installer-2.0.0-1 + +You will be prompted to type a printer model name. Type the model name of your printer, for example "HL-2270DW". + +![](https://farm1.staticflickr.com/292/18535599323_1a94f6dae5_b.jpg) + +After agreeing to GPL license agreement, accept default answers to any subsequent questions. + +![](https://farm1.staticflickr.com/526/19130014316_5835939501_b.jpg) + +Now LPR/CUPS printer drivers are installed. Proceed to configure your printer next. + +### Printer Configuration ### + +We are going to configure and manage a Brother via CUPS-based web management interface. + +First, verify that CUPS daemon is running successfully. + + $ sudo netstat -nap | grep 631 + +Open a web browser window, and go to http://localhost:631. You will see the following CUPS printer management interface. + +![](https://farm1.staticflickr.com/324/18968588688_202086fc72_c.jpg) + +Go to "Administration" tab, and click on "Manage Printers" under Printers section. + +![](https://farm1.staticflickr.com/484/18533632074_0526cccb86_c.jpg) + +You must see your printer (HL-2270DW) listed in the next page. Click on the printer name. +![](https://farm1.staticflickr.com/501/19159651111_95f6937693_c.jpg) + +In the dropdown menu titled "Administration", choose "Set As Server Default" option. This will make your printer system-wide default. + +![](https://farm1.staticflickr.com/472/19150412212_b37987c359_c.jpg) + +When asked to authenticate yourself, type in your Linux login information. + +![](https://farm1.staticflickr.com/511/18968590168_807e807f73_c.jpg) + +Now the basic configuration step is mostly done. To test print, open any document viewer application (e.g., PDF viwer), and print it. You will see "HL-2270DW" listed and chosen by default in printer setting. + +![](https://farm4.staticflickr.com/3872/18970034679_6d41d75bf9_c.jpg) + +Print should work now. You can see the printer status and manage printer jobs via the same CUPS web interface. + +-------------------------------------------------------------------------------- + +via: http://ask.xmodulo.com/install-brother-printer-linux.html + +作者:[Dan Nanni][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://ask.xmodulo.com/author/nanni +[1]:http://xmodulo.com/go/brother_printers +[2]:http://xmodulo.com/go/hl_2270dw +[3]:http://support.brother.com/ \ No newline at end of file diff --git a/sources/tech/20150709 Linux FAQs with Answers--How to open multiple tabs in a GNOME terminal on Ubuntu 15.04.md b/sources/tech/20150709 Linux FAQs with Answers--How to open multiple tabs in a GNOME terminal on Ubuntu 15.04.md new file mode 100644 index 0000000000..a9a53bf8b1 --- /dev/null +++ b/sources/tech/20150709 Linux FAQs with Answers--How to open multiple tabs in a GNOME terminal on Ubuntu 15.04.md @@ -0,0 +1,38 @@ +Linux FAQs with Answers--How to open multiple tabs in a GNOME terminal on Ubuntu 15.04 +================================================================================ +> **Question**: I used to be able to open multiple tabs inside gnome-terminal on my Ubuntu desktop. On Ubuntu 15.04, however, I can no longer open a new tab in my terminal window. How can I open tabs in gnome-terminal on Ubuntu 15.04? + +On Ubuntu 14.10 or earlier, gnome-terminal allowed you to open either a new terminal or a tab inside a terminal window. However, starting with Ubuntu 15.04, gnome-terminal has removed "New Tab" menu option. This is actually not a bug, but a feature that attempts to unify new tab and new window. GNOME 3.12 has introduced a [single "Open Terminal" option][1]. The ability to open a new terminal tab has been migrated from the terminal menu to Preferences. + +![](https://farm1.staticflickr.com/562/19286510971_f0abe3e7fb_b.jpg) + +### Open Tabs via Preferences ### + +To be able to open a new tab in new gnome-terminal of Ubuntu 15.04, go to "Edit" -> "Preferences", and change "Open new terminals in: Window" to "Open new terminals in: Tab". + +![](https://farm1.staticflickr.com/329/19256530766_ff692b83bc_b.jpg) + +Now if you open a new terminal via menu, it will automatically open a new tab inside the terminal. + +![](https://farm4.staticflickr.com/3820/18662051223_3296fde8e4_b.jpg) + +### Open Tabs via a Keyboard Shortcut ### + +If you do not want to change Preferences, you can hold down to "invert" Preferences setting temporarily. For example, under the default Preferences, if you hold down and click on "New Terminal", it will open a new tab, not a terminal. + +Alternatively, you can simply use a keyboard shortcut to open a new tab in a terminal. + +In my view, this UI change in gnome-terminal is not quite an improvement. For example, you are no longer able to customize the name of individual terminal tabs. This feature is useful when you have many tabs open in a terminal. With the default tab name fixed to the current prompt (whose length can grow quickly), you easily cannot see the whole prompt string in the limited tab name space. Hope this feature will become available soon. + +-------------------------------------------------------------------------------- + +via: http://ask.xmodulo.com/open-multiple-tabs-gnome-terminal-ubuntu.html + +作者:[Dan Nanni][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://ask.xmodulo.com/author/nanni +[1]:http://worldofgnome.org/opening-a-new-terminal-tabwindow-in-gnome-3-12/ \ No newline at end of file From 8a19114515317827ba43a5647ae47d436d974fdf Mon Sep 17 00:00:00 2001 From: KS Date: Thu, 9 Jul 2015 19:06:01 +0800 Subject: [PATCH 549/965] Update 20150709 Why is the ibdata1 file continuously growing in MySQL.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 申请翻译 --- ...09 Why is the ibdata1 file continuously growing in MySQL.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150709 Why is the ibdata1 file continuously growing in MySQL.md b/sources/tech/20150709 Why is the ibdata1 file continuously growing in MySQL.md index 92094a3315..2fcf9353bb 100644 --- a/sources/tech/20150709 Why is the ibdata1 file continuously growing in MySQL.md +++ b/sources/tech/20150709 Why is the ibdata1 file continuously growing in MySQL.md @@ -1,3 +1,4 @@ +wyangsun 翻译中 Why is the ibdata1 file continuously growing in MySQL? ================================================================================ ![ibdata1 file](https://www.percona.com/blog/wp-content/uploads/2013/08/ibdata1-file.jpg) @@ -111,4 +112,4 @@ via: https://www.percona.com/blog/2013/08/20/why-is-the-ibdata1-file-continuousl [8]:https://github.com/jeremycole/innodb_ruby [9]:http://dev.mysql.com/doc/innodb/1.1/en/innodb-improved-purge-scheduling.html [10]:http://bugs.mysql.com/bug.php?id=1341 -[11]:https://www.percona.com/software/percona-monitoring-plugins \ No newline at end of file +[11]:https://www.percona.com/software/percona-monitoring-plugins From b3c0a231df14fbf854af9c0c94c12f5a4262dbf3 Mon Sep 17 00:00:00 2001 From: wxy Date: Thu, 9 Jul 2015 23:52:09 +0800 Subject: [PATCH 550/965] PUB:20150616 Installing LAMP Linux, Apache, MariaDB, PHP or PhpMyAdmin in RHEL or CentOS 7.0 @geekpi --- ...PHP or PhpMyAdmin in RHEL or CentOS 7.0.md | 240 ++++++++++++++++++ ...PHP or PhpMyAdmin in RHEL or CentOS 7.0.md | 239 ----------------- 2 files changed, 240 insertions(+), 239 deletions(-) create mode 100644 published/20150616 Installing LAMP Linux, Apache, MariaDB, PHP or PhpMyAdmin in RHEL or CentOS 7.0.md delete mode 100644 translated/tech/20150616 Installing LAMP Linux, Apache, MariaDB, PHP or PhpMyAdmin in RHEL or CentOS 7.0.md diff --git a/published/20150616 Installing LAMP Linux, Apache, MariaDB, PHP or PhpMyAdmin in RHEL or CentOS 7.0.md b/published/20150616 Installing LAMP Linux, Apache, MariaDB, PHP or PhpMyAdmin in RHEL or CentOS 7.0.md new file mode 100644 index 0000000000..67727abe22 --- /dev/null +++ b/published/20150616 Installing LAMP Linux, Apache, MariaDB, PHP or PhpMyAdmin in RHEL or CentOS 7.0.md @@ -0,0 +1,240 @@ +在 RHEL/CentOS 7.0 中安装 LAMP(Linux、 Apache、 MariaDB、 PHP/PhpMyAdmin) +================================================================================ + +跳过 LAMP 的介绍,因为我认为你们大多数已经知道了。这个教程会集中在如何在升级到 Apache 2.4 的 Red Hat Enterprise Linux 7.0 和 CentOS 7.0 中安装和配置 LAMP:Linux、Apache、 MariaDB、 PHP/PhpMyAdmin。 + +![Install LAMP in CentOS 7](http://www.tecmint.com/wp-content/uploads/2014/07/Install-LAMP-in-CentOS-7.jpg) + +*在 RHEL/CentOS 7.0 中安装 LAMP* + +#### 前置要求 #### + +根据使用的发行版是 RHEL 还是 CentOS 7.0,按照下面的链接来进行最小化的系统安装,网络使用静态 IP。 + +**对于 RHEL 7.0** + +- [RHEL 7.0 安装过程][1] +- [在 RHEL 7.0 中注册和启用订阅仓库][2] + +**对于 CentOS 7.0** + +- [CentOS 7.0 安装过程][3] + +### 第一步:使用基本配置安装apache ### + +1、在完成最小化系统安装,并[在 RHEL/CentOS 7.0 上配置静态 IP][4] 后,就可以使用下面的命令从官方仓库安装最新的 Apache 2.4 httpd 服务了。 + + # yum install httpd + +![Install Apache in CentOS 7](http://www.tecmint.com/wp-content/uploads/2014/07/Install-Apache-in-CentOS-7.png) + +*安装 apache 服务* + +2、安装完成后,使用下面的命令来管理apache守护进程,因为 RHEL 和 CentOS 7.0 都将 init 脚本从 SysV 升级到了systemd,所以同时你还可以使用 SysV 脚本和 Apache 脚本来管理服务。 + + # systemctl status|start|stop|restart|reload httpd + + 或者 + + # service httpd status|start|stop|restart|reload + + 或者 + + # apachectl configtest| graceful + +![Start Apache in CentOS 7](http://www.tecmint.com/wp-content/uploads/2014/07/Start-Apache-in-CentOS-7.png) + +*启动apache服务* + +3、在使用 systemd 初始化脚本来启动 apache 服务后,要用 `firewall-cmd` 打开 RHEL/CentOS 7.0 防火墙规则, 这是通过 [firewalld][7] 守护进程管理 iptables 的默认命令。** + + # firewall-cmd --add-service=http + +**注意**:上面的命令会在系统重启或者 firewalld 服务重启后失效,因为它是即时的规则,它不会永久生效。要使 iptables 规则在 fiewalld 中持久化,使用 `--permanent` 选项并重启 firewalld 服务来生效。(LCTT 译注:也可以不重启 firewalld 服务,而是再执行一遍不带 ` --permanent` 选项的命令。) + + # firewall-cmd --permanent --add-service=http + # systemctl restart firewalld + +![Enable Firewall in CentOS 7](http://www.tecmint.com/wp-content/uploads/2014/07/Enable-Firewall-in-CentOS-7.png) + +*在 CentOS 7 中启用防火墙* + +下面是 firewalld 其他的重要选项: + + # firewall-cmd --state + # firewall-cmd --list-all + # firewall-cmd --list-interfaces + # firewall-cmd --get-service + # firewall-cmd --query-service service_name + # firewall-cmd --add-port=8080/tcp + +4、要验证 apache 的功能,打开一个远程浏览器并使用 http 协议访问你服务器的 IP 地址(http://server_IP), 应该会显示下图中的默认页面。 + +![Apache Default Page](http://www.tecmint.com/wp-content/uploads/2014/07/Apache-Default-Page.png) + +*Apache 默认页* + +5、现在 apache 的根地址在 `/var/www/html`,该目录中没有提供任何索引文件。如果你想要看见根目录下的文件夹列表,打开 apache 欢迎配置文件并设置 `` 下 `Indexes` 前的状态从`-`到`+`,下面的截图就是一个例子。 + + # nano /etc/httpd/conf.d/welcome.conf + +![Apache Directory Listing](http://www.tecmint.com/wp-content/uploads/2014/07/Apache-Directory-Listing.png) + +*Apache 目录列出* + +6、关闭文件,重启 apache 服务来使设置生效,重载页面来看最终效果。 + + # systemctl restart httpd + +![Apache Index File](http://www.tecmint.com/wp-content/uploads/2014/07/Apache-Index-File.png) + +*Apache 索引文件* + +### 第二步:为 Apache 安装 php5 支持 ### + +7、在为 apache 安装 php 支持之前,使用下面的命令的得到所有可用的php模块和扩展。 + + # yum search php + +![Install PHP in CentOS 7](http://www.tecmint.com/wp-content/uploads/2014/07/Install-PHP-in-CentOS-7.png) + +在 CentOS 7 上安装 PHP* + +8、根据你所要使用的应用类型,安装上述列表中所需的 PHP 模块。对于 PHP 中的基本的 MariaDB 支持和 PhpMyAdmin,你需要安装如下模块。 + + # yum install php php-mysql php-pdo php-gd php-mbstring + +![Install PHP Modules in CentOS 7](http://www.tecmint.com/wp-content/uploads/2014/07/Install-PHP-Modules-in-CentOS-7.png) + +*安装 PHP 模块* + +![Install PHP mbstring Module](http://www.tecmint.com/wp-content/uploads/2014/07/Install-PHP-mbstring-in-CentOs-7.png) + +*安装 PHP mbstring 模块* + +9、 要在你的浏览器上显示 PHP 的全部信息,用 root 账号执行如下命令在 Apache 的文档根目录下创建一个 `info.php` 文件,然后重启 httpd 服务,并在你的浏览器里面访问 http://server_IP/info.php 。 + + # echo "" > /var/www/html/info.php + # systemctl restart httpd + +![Check PHP Info in CentOS 7](http://www.tecmint.com/wp-content/uploads/2014/07/Check-PHP-Info-in-CentOS-7.png) + +*查看 CentOS 7 上的 PHP 信息* + +10、如果你得到一个 PHP 的日期和时区错误,打开配置文件 `php.ini`,取消 `date.timezone` 语句的注释,加上你的实际时区参数,然后重启 Apache 守护进程。 + + # nano /etc/php.ini + +找到并如下修改`date.timezone`,参考 [PHP 支持的时区列表][5]。(LCTT 译注:对于中国,可以使用 Asia/Shanghai、Asia/Chongqing 等,但是不建议使用向后兼容而保留的 PRC。) + + date.timezone = Continent/City + +![Set Timezone in PHP](http://www.tecmint.com/wp-content/uploads/2014/07/Set-Time-Zone-in-CentOS.png) + +*设置 PHP 的时区* + +###第三步:安装和配置 MariaDB 数据库 ### + +11、 Red Hat Enterprise Linux/CentOS 7.0 使用 MariaDB 替换 MySQL 为默认数据库管理系统。使用如下命令安装 MariaDB 数据库。 + + # yum install mariadb-server mariadb + +![Install MariaDB in CentOS 7](http://www.tecmint.com/wp-content/uploads/2014/07/Install-MariaDB-in-CentOs-7.png) + +*在 CentOS 7中安装 MariaDB* + +12、安装 MariaDB 后,启动数据库守护进程并使用 mysql_secure_installation 脚本来保护数据库(设置数据库的 root 密码、禁止远程 root 登录、移除测试数据库、移除匿名用户等)。 + + # systemctl start mariadb + # mysql_secure_installation + +![Start MariaDB Database](http://www.tecmint.com/wp-content/uploads/2014/07/Start-MariaDB-in-CentOS-7.png) + +*启动 MariaDB 数据库* + +![Secure MySQL Installation](http://www.tecmint.com/wp-content/uploads/2014/07/Secure-MySQL-Installation.png) + +*MariaDB 安全设置* + +13、要测试数据库功能,使用 root 账户登录 MariaDB 并用 quit 退出。 + + mysql -u root -p + MariaDB > SHOW VARIABLES; + MariaDB > quit + +![Connect MySQL Database in CentOS](http://www.tecmint.com/wp-content/uploads/2014/07/Connect-MySQL-Installation.png) + +*连接 MariaDB 数据库* + +### 第四步:安装 PhpMyAdmin ### + +14、 RHEL 7.0 或者 CentOS 7.0 仓库默认没有提供 PhpMyAdmin 二进制安装包。如果你不适应使用 MySQL 命令行来管理你的数据库,你可以通过下面的命令启用 CentOS 7.0 rpmforge 仓库来安装 PhpMyAdmin。 + + # yum install http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el7.rf.x86_64.rpm + +启用 rpmforge 仓库后,下面安装 PhpMyAdmin。 + + # yum install phpmyadmin + +![Enable RPMForge in CentOS 7](http://www.tecmint.com/wp-content/uploads/2014/07/Enable-RPMForge-in-CentOS-7.png) + +*启用 RPMForge 仓库* + +15、下面配置 PhpMyAdmin 的 `phpmyadmin.conf` 来允许远程连接,它位于 Apache 的 `conf.d` 目录下,并注释掉下面的行。 + + # nano /etc/httpd/conf.d/phpmyadmin.conf + +使用#来注释掉下列行。 + + # Order Deny,Allow + # Deny from all + # Allow from 127.0.0.1 + +![Allow Remote PhpMyAdmin Access](http://www.tecmint.com/wp-content/uploads/2014/07/Allow-Remote-PhpMyAdmin-Access.png) + +*允许远程 PhpMyAdmin 访问* + +16、 要使用 cookie 验证来登录 PhpMyAdmin,像下面的截图那样使用[生成的秘密字符串][6]来添加一个 blowfish 字符串到 `config.inc.php` 文件中,重启 apache 服务并打开 URL:http://server_IP/phpmyadmin/。 + + # nano /etc/httpd/conf.d/phpmyadmin.conf + # systemctl restart httpd + +![Add Blowfish in PhpMyAdmin](http://www.tecmint.com/wp-content/uploads/2014/07/Add-Blowfish-PhpMyAdmin.png) + +*在 PhpMyAdmin 中添加 Blowfish* + +![PhpMyAdmin Dashboard](http://www.tecmint.com/wp-content/uploads/2014/07/Login-to-PhpMyAdmin.png) + +*PhpMyAdmin 面板* + +### 第五步:在系统范围内启用 LAMP ### + +17、 如果你需要在重启后自动运行 MariaDB 和 Apache 服务,你需要在系统级地启用它们。 + + # systemctl enable mariadb + # systemctl enable httpd + +![Enable Services System Wide](http://www.tecmint.com/wp-content/uploads/2014/07/Enable-Services-System-Wide.png) + +*系统级启用服务* + +这就是在 Red Hat Enterprise 7.0 或者 CentOS 7.0 中安装 LAMP 的过程。在 CentOS/RHEL 7.0 上关于 LAMP 的系列文章接下来将会讨论在 Apache 中创建虚拟主机,生成 SSL 证书、密钥和添加 SSL 事务支持。 + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/install-lamp-in-centos-7/ + +作者:[Matei Cezar][a] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/cezarmatei/ +[1]:http://www.tecmint.com/redhat-enterprise-linux-7-installation/ +[2]:http://www.tecmint.com/enable-redhat-subscription-reposiories-and-updates-for-rhel-7/ +[3]:http://www.tecmint.com/centos-7-installation/ +[4]:https://linux.cn/article-3977-1.html +[5]:http://php.net/manual/en/timezones.php +[6]:http://www.question-defense.com/tools/phpmyadmin-blowfish-secret-generator +[7]:https://linux.cn/article-4425-1.html diff --git a/translated/tech/20150616 Installing LAMP Linux, Apache, MariaDB, PHP or PhpMyAdmin in RHEL or CentOS 7.0.md b/translated/tech/20150616 Installing LAMP Linux, Apache, MariaDB, PHP or PhpMyAdmin in RHEL or CentOS 7.0.md deleted file mode 100644 index 5057c2e416..0000000000 --- a/translated/tech/20150616 Installing LAMP Linux, Apache, MariaDB, PHP or PhpMyAdmin in RHEL or CentOS 7.0.md +++ /dev/null @@ -1,239 +0,0 @@ -在RHEL/CentOS 7.0中安装LAMP(Linux、 Apache、 MariaDB、 PHP/PhpMyAdmin) -================================================================================ -跳过LAMP的介绍因为我认为你们大多数已经知道了。这个教程会集中在如何在升级到Apache 2.4的 Red Hat Enterprise Linux 7.0 和 CentOS 7.0中安装和配置LAMP-Linux Apache、 MariaDB、 PHP、PhpMyAdmin。 - -![Install LAMP in CentOS 7](http://www.tecmint.com/wp-content/uploads/2014/07/Install-LAMP-in-CentOS-7.jpg) - -在RHEL/CentOS 7.0中安装LAMP - -#### 要求 #### - -根据使用的发行版,RHEL 或者 CentOS 7.0使用下面的链接来执行最小的系统安装,网络使用静态ip - -**对于RHEL 7.0** - -- [RHEL 7.0安装过程][1] -- [在RHEL 7.0中注册和启用订阅仓库][2] - -**对于 CentOS 7.0** - -- [CentOS 7.0 安装过程][3] - -### 第一步: 使用基本配置安装apache ### - -**1. 在执行最小系统安装并配置[在RHEL/CentOS 7.0中配置静态ip][4]**就可以从使用下面的命令从官方仓库安装最新的Apache 2.4 httpd服务。 - - # yum install httpd - -![Install Apache in CentOS 7](http://www.tecmint.com/wp-content/uploads/2014/07/Install-Apache-in-CentOS-7.png) - -安装apache服务 - -**2. 安装安城后,使用下面的命令来管理apache守护进程,因为RHEL and CentOS 7.0都将init脚本从SysV升级到了systemd - 你也可以同事使用SysV和Apache脚本来管理服务。** - - # systemctl status|start|stop|restart|reload httpd - - 或者 - - # service httpd status|start|stop|restart|reload - - 或者 - - # apachectl configtest| graceful - -![Start Apache in CentOS 7](http://www.tecmint.com/wp-content/uploads/2014/07/Start-Apache-in-CentOS-7.png) - -启动apache服务 - -**3. 下一步使用systemd初始化脚本来启动apache服务并用firewall-cmd打开RHEL/CentOS 7.0防火墙规则, 这是通过firewalld守护进程管理iptables的默认命令。** - - # firewall-cmd --add-service=http - -**注意**:上面的命令会在系统重启或者firewalld服务重启后失效,因为它是即时的规则,它不会永久生效。要使iptables规则在fiewwall中持久化,使用-permanent选项并重启firewalld服务来生效。 - - # firewall-cmd --permanent --add-service=http - # systemctl restart firewalld - -![Enable Firewall in CentOS 7](http://www.tecmint.com/wp-content/uploads/2014/07/Enable-Firewall-in-CentOS-7.png) - -在CentOS 7中启用Firewall - -下面是firewalld其他的重要选项: - - # firewall-cmd --state - # firewall-cmd --list-all - # firewall-cmd --list-interfaces - # firewall-cmd --get-service - # firewall-cmd --query-service service_name - # firewall-cmd --add-port=8080/tcp - -**4. 要验证apache的功能,打开一个远程浏览器并使用http协议输入你服务器的ip地址(http://server_IP), 应该会显示下图中的默认页面。** - -![Apache Default Page](http://www.tecmint.com/wp-content/uploads/2014/07/Apache-Default-Page.png) - -Apache默认页 - -**5. 现在apache的根地址在/var/www/html,该目录中没有提供任何index文件。如果你想要看见根目录下的文件夹列表,打开apache欢迎配置文件并设置 下Indexes前的状态从-到+,下面的截图就是一个例子。** - - # nano /etc/httpd/conf.d/welcome.conf - -![Apache Directory Listing](http://www.tecmint.com/wp-content/uploads/2014/07/Apache-Directory-Listing.png) - -Apache目录列出 - -**6. 关闭文件,重启apache服务来使设置生效,重载页面来看最终效果。** - - # systemctl restart httpd - -![Apache Index File](http://www.tecmint.com/wp-content/uploads/2014/07/Apache-Index-File.png) - -Apache Index 文件 - -### 第二步: 为Apache安装php5支持 ### - - -**7. 在为apache安装php支持之前,使用下面的命令的得到所有可用的php模块和扩展。** - - # yum search php - -![Install PHP in CentOS 7](http://www.tecmint.com/wp-content/uploads/2014/07/Install-PHP-in-CentOS-7.png) - -在 - -**8. Depending on what type of applications you want to use, install the required PHP modules from the above list, but for a basic MariaDB support in PHP and PhpMyAdmin you need to install the following modules.** - - # yum install php php-mysql php-pdo php-gd php-mbstring - -![Install PHP Modules in CentOS 7](http://www.tecmint.com/wp-content/uploads/2014/07/Install-PHP-Modules-in-CentOS-7.png) - -Install PHP Modules - -![Install PHP mbstring Module](http://www.tecmint.com/wp-content/uploads/2014/07/Install-PHP-mbstring-in-CentOs-7.png) - -Install PHP mbstring Module - -**9. To get a full information list on PHP from your browser, create a info.php file on Apache Document Root using the following command from root account, restart httpd service and direct your browser to the http://server_IP/info.php address.** - - # echo "" > /var/www/html/info.php - # systemctl restart httpd - -![Check PHP Info in CentOS 7](http://www.tecmint.com/wp-content/uploads/2014/07/Check-PHP-Info-in-CentOS-7.png) - -Check PHP Info in CentOS 7 - -**10. If you get an error on PHP Date and Timezone, open php.ini configuration file, search and uncomment date.timezone statement, append your physical location and restart Apache daemon.** - - # nano /etc/php.ini - -Locate and change date.timezone line to look like this, using [PHP Supported Timezones list][5]. - - date.timezone = Continent/City - -![Set Timezone in PHP](http://www.tecmint.com/wp-content/uploads/2014/07/Set-Time-Zone-in-CentOS.png) - -Set Timezone in PHP - -### Step 3: Install and Configure MariaDB Database ### - -**11. Red Hat Enterprise Linux/CentOS 7.0 switched from MySQL to MariaDB for its default database management system. To install MariaDB database use the following command.** - - # yum install mariadb-server mariadb - -![Install MariaDB in CentOS 7](http://www.tecmint.com/wp-content/uploads/2014/07/Install-MariaDB-in-CentOs-7.png) - -在CentOS 7中安装PHP - -***12. 安装MariaDB后,开启数据库守护进程并使用mysql_secure_installation脚本来保护数据库(设置root密码、禁止远程root登录、移除测试数据库、移除匿名用户)** - - # systemctl start mariadb - # mysql_secure_installation - -![Start MariaDB Database](http://www.tecmint.com/wp-content/uploads/2014/07/Start-MariaDB-in-CentOS-7.png) - -启动MariaDB数据库 - -![Secure MySQL Installation](http://www.tecmint.com/wp-content/uploads/2014/07/Secure-MySQL-Installation.png) - -MySQL安全设置 - -**13. 要测试数据库功能,使用root账户登录MariaDB并用quit退出。** - - mysql -u root -p - MariaDB > SHOW VARIABLES; - MariaDB > quit - -![Connect MySQL Database in CentOS](http://www.tecmint.com/wp-content/uploads/2014/07/Connect-MySQL-Installation.png) - -连接MySQL数据库 - -### 第四步: 安装PhpMyAdmin ### - -**14. RHEL 7.0 或者 CentOS 7.0仓库默认没有提供PhpMyAdmin二进制安装包。如果你不适应使用MySQL命令行来管理你的数据库,你可以通过下面的命令启用CentOS 7.0 rpmforge仓库来安装PhpMyAdmin。** - - # yum install http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el7.rf.x86_64.rpm - -启用rpmforge仓库后,下面安装PhpMyAdmin。 - - # yum install phpmyadmin - -![Enable RPMForge in CentOS 7](http://www.tecmint.com/wp-content/uploads/2014/07/Enable-RPMForge-in-CentOS-7.png) - -启用RPMForge仓库 - -**15. 下面配置PhpMyAdmin的phpmyadmin.conf来允许远程连接,它位于Apache conf.d目录下,并注释掉下面的行。** - - # nano /etc/httpd/conf.d/phpmyadmin.conf - -使用#来注释掉行。 - - # Order Deny,Allow - # Deny from all - # Allow from 127.0.0.1 - -![Allow Remote PhpMyAdmin Access](http://www.tecmint.com/wp-content/uploads/2014/07/Allow-Remote-PhpMyAdmin-Access.png) - -允许远程PhpMyAdmin访问 - -**16. 要使用cookie验证来登录PhpMyAdmin,像下面的截图那样使用[生成字符串][6]添加一个blowfish字符串到config.inc.php文件下,重启apache服务并打开URL:http://server_IP/phpmyadmin/。** - - # nano /etc/httpd/conf.d/phpmyadmin.conf - # systemctl restart httpd - -![Add Blowfish in PhpMyAdmin](http://www.tecmint.com/wp-content/uploads/2014/07/Add-Blowfish-PhpMyAdmin.png) - -在PhpMyAdmin中添加Blowfish - -![PhpMyAdmin Dashboard](http://www.tecmint.com/wp-content/uploads/2014/07/Login-to-PhpMyAdmin.png) - -PhpMyAdmin面板 - -### 第五步: 系统范围启用LAMP ### - -**17. 如果你需要在重启后自动运行MariaDB和Apache服务,你需要系统级地启用它们。** - - # systemctl enable mariadb - # systemctl enable httpd - -![Enable Services System Wide](http://www.tecmint.com/wp-content/uploads/2014/07/Enable-Services-System-Wide.png) - -系统级启用服务 - -这就是在Red Hat Enterprise 7.0或者CentOS 7.0中安装LAMP的过程。CentOS/RHEL 7.0上关于LAMP洗系列文章将会讨论在Apache中创建虚拟主机,生成SSL证书、密钥和添加SSL事物支持。 - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/install-lamp-in-centos-7/ - -作者:[Matei Cezar][a] -译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.tecmint.com/author/cezarmatei/ -[1]:http://www.tecmint.com/redhat-enterprise-linux-7-installation/ -[2]:http://www.tecmint.com/enable-redhat-subscription-reposiories-and-updates-for-rhel-7/ -[3]:http://www.tecmint.com/centos-7-installation/ -[4]:http://www.tecmint.com/configure-network-interface-in-rhel-centos-7-0/ -[5]:http://php.net/manual/en/timezones.php -[6]:http://www.question-defense.com/tools/phpmyadmin-blowfish-secret-generator From ca38157bce669f7c963c2f6186bc1f1421bb19d1 Mon Sep 17 00:00:00 2001 From: martin qi Date: Fri, 10 Jul 2015 06:29:14 +0800 Subject: [PATCH 551/965] Update 20150709 Linus Torvalds Says People Who Believe in AI Singularity Are on Drugs.md --- ... Believe in AI Singularity Are on Drugs.md | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/sources/news/20150709 Linus Torvalds Says People Who Believe in AI Singularity Are on Drugs.md b/sources/news/20150709 Linus Torvalds Says People Who Believe in AI Singularity Are on Drugs.md index 22b2ad0f01..e43c7792a8 100644 --- a/sources/news/20150709 Linus Torvalds Says People Who Believe in AI Singularity Are on Drugs.md +++ b/sources/news/20150709 Linus Torvalds Says People Who Believe in AI Singularity Are on Drugs.md @@ -1,22 +1,22 @@ -Linus Torvalds Says People Who Believe in AI Singularity Are on Drugs +Linus Torvalds说那些对人工智能奇点深信不疑的人显然磕了药 ================================================================================ -*As usual, his comments should not be taken literally* +*像往常一样, 他的评论不能只看字面意思* ![](http://i1-news.softpedia-static.com/images/news2/linus-torvalds-says-people-who-believe-in-an-ai-singularity-are-on-drugs-486373-2.jpg) -**AI is a very hot topic right now, and many high profile people, including Elon Musk, the head of Tesla, have said that we're going to get sentient AIs soon and that it's going to be a dangerous threshold. It seems that Linus Torvalds doesn't feel the same way, and he thinks that it's just bad Sci-Fi.** +**人工智能是一个非常热门的话题,许多高端人士,包括特斯拉的的CEO埃隆·马斯克就曾表示有感情的人工智能技术即将到来,同时这一技术将发展到危险的门槛上。不过Linus Torvalds显然不这么认为,他认为那只是差劲的科幻小说。** -The idea of AIs turning on their human creators is not something new, but recently the so-called AI singularity has been discussed, and people like Elon Musk and Stephen Hawking expressed concerns about the possibility of creating a monster. And it's not just them, forums and comments sections are full of alarmist people who don't know what to believe or who take for granted the opinions of much smarter people. +人工智能激发了人们的创造力已经不是什么新鲜的想法了,不过近段时间关于所谓的人工智能奇点的讨论,引起了诸如埃隆·马斯克和斯蒂芬·霍金表示关心,认为可能会创造出一个怪兽。不只是他们,论坛和评论部分充斥着杞人忧天者,他们不知道该相信谁,或是那个提出建议的人更聪明。 -As it turns out, Linus Torvalds, the creator of the Linux project, has a completely different opinion on this matter. In fact, he says that nothing like this will happen, and we have a much better reason to believe him. AI means that someone wrote its code, and Linus knows the power and the obstacles of writing an AI code. He's much likely to guess what's involved and to understands why an AI won't be a threat. +事实证明Linus Torvalds,Linux项目创始人在这件事上显然有完全不同的观点。他说事实上什么都不会发生,我们也更有理由相信他。人工智能意需要有人编写它的代码,Linus知道编写人工智能代码会遇到的阻力和障碍。他很有可能已经猜到了什么会被涉及到,并且明白为什么人工智能不会成为威胁。 -### Linus Torvalds and AIs ### +### Linus Torvalds与人工智能 ### -Linus Torvalds answered some questions from the community on [slashdot.org][1], and all his ideas were very interesting. He talked about the [future of gaming and Valve][2], but he also tackled stuff like AI. He's usually asked stuff about the kernel or open source, but he has opinions on other topics as well. As a matter a fact, the AI subject is something that he can actually talk about as a programmer. +Linus Torvalds在[slashdot.org][1]上回答了一些社区中的问题,他的所有观点都十分有趣。他曾对[游戏的未来和Valve][2]发表看法,就像这次关于人工智能一样。虽然他经常是问一些关于内核和开源的问题,但是他在其他部分也有自己的见解。事实是作为一个问题,人工智能工程是一个他可以从程序员的角度讨论的问题。 -"So I'd expect just more of (and much fancier) rather targeted AI, rather than anything human-like at all. Language recognition, pattern recognition, things like that. I just don't see the situation where you suddenly have some existential crisis because your dishwasher is starting to discuss Sartre with you. The whole 'Singularity' kind of event? Yeah, it's science fiction, and not very good Sci-Fi at that, in my opinion. Unending exponential growth? What drugs are those people on? I mean, really" wrote Linus on Slashdot. +“所以我期待更多有针对性的(和相当棒的)AI,而不是它有多像人。像语言识别、模式识别,这样的东西。我根本找不出在你洗碗的时候,洗碗机和你讨论Sartre(萨特,法国哲学家、小说家、剧作家)有什么危害。真的有‘奇点’这种事吗?是的,我认为那只是科幻小说,还不是好的那种。无休止的指数增长?我说,真的!这些人嗑了什么药了吧?”Linus在Slashdot写道。 -It's your choice whether to believe Elon Musk or Linus, but if betting were involved, I would put my money on Linus. +选择相信埃隆·马斯克还是Linus是你的决定,但如果我卷入了这场赌局,我会把线投给Linus。 -------------------------------------------------------------------------------- @@ -30,4 +30,4 @@ via: http://news.softpedia.com/news/linus-torvalds-says-people-who-believe-in-an [a]:http://news.softpedia.com/editors/browse/silviu-stahie [1]:http://classic.slashdot.org/story/15/06/30/0058243 -[2]:http://news.softpedia.com/news/linus-torvalds-said-valve-is-exploring-a-second-source-against-microsoft-486266.shtml \ No newline at end of file +[2]:http://news.softpedia.com/news/linus-torvalds-said-valve-is-exploring-a-second-source-against-microsoft-486266.shtml From db5eba785fea69bca9e166ebb4985b7d8779f123 Mon Sep 17 00:00:00 2001 From: martin qi Date: Fri, 10 Jul 2015 06:32:38 +0800 Subject: [PATCH 552/965] translated --- ... Believe in AI Singularity Are on Drugs.md | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 translated/news/20150709 Linus Torvalds Says People Who Believe in AI Singularity Are on Drugs.md diff --git a/translated/news/20150709 Linus Torvalds Says People Who Believe in AI Singularity Are on Drugs.md b/translated/news/20150709 Linus Torvalds Says People Who Believe in AI Singularity Are on Drugs.md new file mode 100644 index 0000000000..d2ff0a1eda --- /dev/null +++ b/translated/news/20150709 Linus Torvalds Says People Who Believe in AI Singularity Are on Drugs.md @@ -0,0 +1,33 @@ +Linus Torvalds说那些对人工智能奇点深信不疑的人显然磕了药 +================================================================================ +*像往常一样, 他的评论不能只看字面意思* + +![](http://i1-news.softpedia-static.com/images/news2/linus-torvalds-says-people-who-believe-in-an-ai-singularity-are-on-drugs-486373-2.jpg) + +**人工智能是一个非常热门的话题,许多高端人士,包括特斯拉的的CEO埃隆·马斯克就曾表示有感情的人工智能技术即将到来,同时这一技术将发展到危险的门槛上。不过Linus Torvalds显然不这么认为,他认为那只是差劲的科幻小说。** + +人工智能激发了人们的创造力已经不是什么新鲜的想法了,不过近段时间关于所谓的人工智能奇点的讨论,引起了诸如埃隆·马斯克和斯蒂芬·霍金表示关心,认为可能会创造出一个怪兽。不只是他们,论坛和评论部分充斥着杞人忧天者,他们不知道该相信谁,或是那个提出建议的人更聪明。 + +事实证明Linus Torvalds,Linux项目创始人在这件事上显然有完全不同的观点。他说事实上什么都不会发生,我们也更有理由相信他。人工智能意需要有人编写它的代码,Linus知道编写人工智能代码会遇到的阻力和障碍。他很有可能已经猜到了什么会被涉及到,并且明白为什么人工智能不会成为威胁。 + +### Linus Torvalds与人工智能 ### + +Linus Torvalds在[slashdot.org][1]上回答了一些社区中的问题,他的所有观点都十分有趣。他曾对[游戏的未来和Valve][2]发表看法,就像这次关于人工智能一样。虽然他经常是问一些关于内核和开源的问题,但是他在其他部分也有自己的见解。事实是作为一个问题,人工智能工程是一个他可以从程序员的角度讨论的问题。 + +“所以我期待更多有针对性的(和相当棒的)AI,而不是它有多像人。像语言识别、模式识别,这样的东西。我根本找不出在你洗碗的时候,洗碗机和你讨论Sartre(萨特,法国哲学家、小说家、剧作家)有什么危害。真的有‘奇点’这种事吗?是的,我认为那只是科幻小说,还不是好的那种。无休止的指数增长?我说,真的!这些人嗑了什么药了吧?”Linus在Slashdot写道。 + +选择相信埃隆·马斯克还是Linus是你的决定,但如果我卷入了这场赌局,我会把线投给Linus。 + +-------------------------------------------------------------------------------- + +via: http://news.softpedia.com/news/linus-torvalds-says-people-who-believe-in-an-ai-singularity-are-on-drugs-486373.shtml + +作者:[Silviu Stahie][a] +译者:[martin2011qi](https://github.com/martin2011qi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://news.softpedia.com/editors/browse/silviu-stahie +[1]:http://classic.slashdot.org/story/15/06/30/0058243 +[2]:http://news.softpedia.com/news/linus-torvalds-said-valve-is-exploring-a-second-source-against-microsoft-486266.shtml From 8772f216d556546687b1170a9b764663da20079b Mon Sep 17 00:00:00 2001 From: martin qi Date: Fri, 10 Jul 2015 06:33:31 +0800 Subject: [PATCH 553/965] Delete 20150709 Linus Torvalds Says People Who Believe in AI Singularity Are on Drugs.md --- ... Believe in AI Singularity Are on Drugs.md | 33 ------------------- 1 file changed, 33 deletions(-) delete mode 100644 sources/news/20150709 Linus Torvalds Says People Who Believe in AI Singularity Are on Drugs.md diff --git a/sources/news/20150709 Linus Torvalds Says People Who Believe in AI Singularity Are on Drugs.md b/sources/news/20150709 Linus Torvalds Says People Who Believe in AI Singularity Are on Drugs.md deleted file mode 100644 index e43c7792a8..0000000000 --- a/sources/news/20150709 Linus Torvalds Says People Who Believe in AI Singularity Are on Drugs.md +++ /dev/null @@ -1,33 +0,0 @@ -Linus Torvalds说那些对人工智能奇点深信不疑的人显然磕了药 -================================================================================ -*像往常一样, 他的评论不能只看字面意思* - -![](http://i1-news.softpedia-static.com/images/news2/linus-torvalds-says-people-who-believe-in-an-ai-singularity-are-on-drugs-486373-2.jpg) - -**人工智能是一个非常热门的话题,许多高端人士,包括特斯拉的的CEO埃隆·马斯克就曾表示有感情的人工智能技术即将到来,同时这一技术将发展到危险的门槛上。不过Linus Torvalds显然不这么认为,他认为那只是差劲的科幻小说。** - -人工智能激发了人们的创造力已经不是什么新鲜的想法了,不过近段时间关于所谓的人工智能奇点的讨论,引起了诸如埃隆·马斯克和斯蒂芬·霍金表示关心,认为可能会创造出一个怪兽。不只是他们,论坛和评论部分充斥着杞人忧天者,他们不知道该相信谁,或是那个提出建议的人更聪明。 - -事实证明Linus Torvalds,Linux项目创始人在这件事上显然有完全不同的观点。他说事实上什么都不会发生,我们也更有理由相信他。人工智能意需要有人编写它的代码,Linus知道编写人工智能代码会遇到的阻力和障碍。他很有可能已经猜到了什么会被涉及到,并且明白为什么人工智能不会成为威胁。 - -### Linus Torvalds与人工智能 ### - -Linus Torvalds在[slashdot.org][1]上回答了一些社区中的问题,他的所有观点都十分有趣。他曾对[游戏的未来和Valve][2]发表看法,就像这次关于人工智能一样。虽然他经常是问一些关于内核和开源的问题,但是他在其他部分也有自己的见解。事实是作为一个问题,人工智能工程是一个他可以从程序员的角度讨论的问题。 - -“所以我期待更多有针对性的(和相当棒的)AI,而不是它有多像人。像语言识别、模式识别,这样的东西。我根本找不出在你洗碗的时候,洗碗机和你讨论Sartre(萨特,法国哲学家、小说家、剧作家)有什么危害。真的有‘奇点’这种事吗?是的,我认为那只是科幻小说,还不是好的那种。无休止的指数增长?我说,真的!这些人嗑了什么药了吧?”Linus在Slashdot写道。 - -选择相信埃隆·马斯克还是Linus是你的决定,但如果我卷入了这场赌局,我会把线投给Linus。 - --------------------------------------------------------------------------------- - -via: http://news.softpedia.com/news/linus-torvalds-says-people-who-believe-in-an-ai-singularity-are-on-drugs-486373.shtml - -作者:[Silviu Stahie][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://news.softpedia.com/editors/browse/silviu-stahie -[1]:http://classic.slashdot.org/story/15/06/30/0058243 -[2]:http://news.softpedia.com/news/linus-torvalds-said-valve-is-exploring-a-second-source-against-microsoft-486266.shtml From 9e14e474ed242ec30fd642ed076d0c77126dfa55 Mon Sep 17 00:00:00 2001 From: Kevin Sicong Jiang Date: Thu, 9 Jul 2015 18:08:42 -0500 Subject: [PATCH 554/965] =?UTF-8?q?Update=20[=E7=BF=BB=E8=AF=91=E4=B8=AD]2?= =?UTF-8?q?0150612=20Linux=5FLogo--A=20Command=20Line=20Tool=20to=20Print?= =?UTF-8?q?=20Color=20ANSI=20Logos=20of=20Linux=20Distributions.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...nt Color ANSI Logos of Linux Distributions.md | 145 +++++++++--------- 1 file changed, 72 insertions(+), 73 deletions(-) diff --git a/sources/tech/[翻译中]20150612 Linux_Logo--A Command Line Tool to Print Color ANSI Logos of Linux Distributions.md b/sources/tech/[翻译中]20150612 Linux_Logo--A Command Line Tool to Print Color ANSI Logos of Linux Distributions.md index cd502ac0a9..e9a27aff00 100644 --- a/sources/tech/[翻译中]20150612 Linux_Logo--A Command Line Tool to Print Color ANSI Logos of Linux Distributions.md +++ b/sources/tech/[翻译中]20150612 Linux_Logo--A Command Line Tool to Print Color ANSI Logos of Linux Distributions.md @@ -1,181 +1,180 @@ -[translating by KevinSJ] -Linux_Logo – A Command Line Tool to Print Color ANSI Logos of Linux Distributions +Linux_Logo – 输出彩色 ANSI Linux 发行版徽标的命令行工具 ================================================================================ -linuxlogo or linux_logo is a Linux command line utility that generates a color ANSI picture of Distribution logo with a few system information. +linuxlogo 或 linux_logo 是一款在Linux命令行下生成附带系统信息的彩色 ANSI 发行版徽标的工具。 -![Linux_Logo - Prints Color ANSI Logs of Linux Distro](http://www.tecmint.com/wp-content/uploads/2015/06/Linux_Logo.png) -Linux_Logo – Prints Color ANSI Logs of Linux Distro +![Linux_Logo – 输出彩色 ANSI Linux 发行版徽标](http://www.tecmint.com/wp-content/uploads/2015/06/Linux_Logo.png) -This utility obtains System Information from /proc Filesystem. linuxlogo is capable of showing color ANSI image of various logos other than the host distribution logo. +Linux_Logo – 输出彩色 ANSI Linux 发行版徽标 -The System information associated with logo includes – Linux Kernel Version, Time when Kernel was last Compiled, Number/core of processor, Speed, Manufacturer and processor Generation. It also show information about total physical RAM. +这个小工具可以从 /proc 文件系统中获取系统信息并可以显示包括主机发行版在内的其他很多发行版的徽标。 -It is worth mentioning here that screenfetch is another tool of similar kind, which shows distribution logo and a more detailed and formatted system inform http://www.tecmint.com/screenfetch-system-information-generator-for-linux/ation. We have already covered screenfetch long ago, which you may refer at: +与徽标一同显示的系统信息包括 – Linux 内核版本,最近一次编译Linux内核的时间,处理器/核心数量,速度,制造商,以及哪一代处理器。它还能显示总共的物理内存大小。 -- [ScreenFetch – Generates Linux System Information][15] +值得一提的是,screenfetch是一个拥有类似功能的工具,它也能显示发行版徽标,同时还提供更加详细美观的系统信息。我们之前已经介绍过这个工具,你可以参考一下链接: +- [ScreenFetch – Generates Linux System Information][1] -linux_logo and Screenfetch should not be compared to each other. While the output of screenfetch is more formatted and detailed, where linux_logo produce maximum number of color ANSI diagram, and option to format the output. -linux_logo is written primarily in C programming Language, which displays linux logo in an X Window System and hence User Interface X11 aka X Window System should be installed. The software is released under GNU General Public License Version 2.0. +linux_logo 和 Screenfetch 并不能相提并论。尽管 screenfetch 的输出较为整洁并提供更多细节, linux_logo 则提供了更多的彩色 ANSI 图标, 并且提供了格式化输出的选项。 -For the purpose of this article, we’re using following testing environment to test the linux_logo utility. +linux_logo 主要使用C语言编写并将 linux 徽标呈现在 X 窗口系统中因此需要安装图形界面 X11 或 X 系统。这个软件使用GNU 2.0协议。 - Operating System : Debian Jessie - Processor : i3 / x86_64 +本文中,我们将使用以下环境测试 linux_logo 工具。 -### Installing Linux Logo Utility in Linux ### + 操作系统 : Debian Jessie + 处理器 : i3 / x86_64 -**1. The linuxlogo package (stable version 5.11) is available to install from default package repository under all Linux distributions using apt, yum or dnf package manager as shown below.** +### 在 Linux 中安装 Linux Logo工具 ### - # apt-get install linux_logo [On APT based Systems] - # yum install linux_logo [On Yum based Systems] - # dnf install linux_logo [On DNF based Systems] - OR - # dnf install linux_logo.x86_64 [For 64-bit architecture] +**1. linuxlogo软件包 ( 5.11 稳定版) 可通过如下方式使用 apt, yum,或 dnf 在所有发行版中使用默认的软件仓库进行安装** -**2. Once linuxlogo package has been installed, you can run the command `linuxlogo` to get the default logo for the distribution you are using..** + # apt-get install linux_logo [用于基于 Apt 的系统] (译者注:Ubuntu中,该软件包名为linuxlogo) + # yum install linux_logo [用于基于 Yum 的系统] + # dnf install linux_logo [用于基于 Dnf 的系统] + 或 + # dnf install linux_logo.x86_64 [用于 64 位系统] + +**2. 装好linuxlogo软件包之后,你可以使用命令 `linuxlogo` 来获取你当前使用的发行版的默认徽标..** # linux_logo - OR + 或 # linuxlogo -![Get Default OS Logo](http://www.tecmint.com/wp-content/uploads/2015/06/Get-Default-OS-Logo.png) +![获取默认系统徽标](http://www.tecmint.com/wp-content/uploads/2015/06/Get-Default-OS-Logo.png) -Get Default OS Logo +获取默认系统徽标 -**3. Use the option `[-a]`, not to print any fancy color. Useful if viewing linux_logo over black and white terminal.** +**3. 使用 `[-a]` 选项可以输出没有颜色的徽标。当在黑白终端里使用 linux_logo 时,这个选项会很有用。** # linux_logo -a -![Black and White Linux Logo](http://www.tecmint.com/wp-content/uploads/2015/06/Black-and-White-Linux-Logo.png) +![黑白 Linux 徽标](http://www.tecmint.com/wp-content/uploads/2015/06/Black-and-White-Linux-Logo.png) -Black and White Linux Logo +黑白 Linux 徽标 -**4. Use option `[-l]` to print LOGO only and exclude all other System Information.** +**4. 使用 `[-l]` 选项可以仅输出徽标而不包含系统信息。** -# linux_logo -l + # linux_logo -l -![Print Distribution Logo](http://www.tecmint.com/wp-content/uploads/2015/06/Print-Distribution-Logo.png) +![输出发行版徽标](http://www.tecmint.com/wp-content/uploads/2015/06/Print-Distribution-Logo.png) -Print Distribution Logo +输出发行版徽标 -**5. The `[-u]` switch will display system uptime.** +**5. `[-u]` 选项可以显示系统运行时间。** # linux_logo -u -![Print System Uptime](http://www.tecmint.com/wp-content/uploads/2015/06/Print-System-Uptime.png) +![输出系统运行时间](http://www.tecmint.com/wp-content/uploads/2015/06/Print-System-Uptime.png) -Print System Uptime +输出系统运行时间 -**6. If you are interested in Load Average, use option `[-y]`. You may use more than one option at a time.** +**6. 如果你对系统平均负载感兴趣,可以使用 `[-y]` 选项。你可以同时使用多个选项。** # linux_logo -y -![Print System Load Average](http://www.tecmint.com/wp-content/uploads/2015/06/Print-System-Load-Average.png) +![输出系统平均负载](http://www.tecmint.com/wp-content/uploads/2015/06/Print-System-Load-Average.png) -Print System Load Average +输出系统平均负载 -For more options and help on them, you may like to run. +如需查看更多选项并获取相关帮助,你可以使用如下命令。 # linux_logo -h -![Linuxlogo Options and Help](http://www.tecmint.com/wp-content/uploads/2015/06/linuxlogo-options.png) +![Linuxlogo 选项及帮助](http://www.tecmint.com/wp-content/uploads/2015/06/linuxlogo-options.png) -Linuxlogo Options and Help +Linuxlogo选项及帮助 -**7. There are a lots of built-in Logos for various Linux distributions. You may see all those logos using option `-L list` switch.** +**7. 此工具内置了很多不同发行版的徽标。你可以使用 `[-L list]` 选项查看在这些徽标的列表。** # linux_logo -L list -![List of Linux Logos](http://www.tecmint.com/wp-content/uploads/2015/06/List-of-Linux-Logos.png) +![Linux 徽标列表](http://www.tecmint.com/wp-content/uploads/2015/06/List-of-Linux-Logos.png) -List of Linux Logos +Linux 徽标列表 -Now you want to print any of the logo from the list, you may use `-L NUM` or `-L NAME` to display selected logo. +如果你想输出这个列表中的任意徽标,可以使用 `-L NUM` 或 `-L NAME` 来显示想要选中的图标。 -- -L NUM – will print logo with number NUM (deprecated). -- -L NAME – will print the logo with name NAME. +- -L NUM – 会输出列表中序号为 NUM 的图标 (不推荐). +- -L NAME – 会输出列表中名为 NAME 的图标。 -For example, to display AIX Logo, you may use command as: +例如,如果想要显示 AIX 的徽标,你可以使用如下命令 # linux_logo -L 1 - OR + 或 # linux_logo -L aix -![Print AIX Logo](http://www.tecmint.com/wp-content/uploads/2015/06/Print-AIX-Logo.png) +![输出 AIX 图标](http://www.tecmint.com/wp-content/uploads/2015/06/Print-AIX-Logo.png) -Print AIX Logo +输出 AIX 图标 -**Notice**: The `-L 1` in the command where 1 is the number at which AIX logo appears in the list, where `-L aix` is the name at which AIX logo appears in the list. +**注**: 命令中的使用 `-L 1` 是因为 AIX 徽标在列表中的编号是1,而使用 `-L aix` 则是因为 AIX 徽标在列表中的名称为 aix -Similarly, you may print any logo using these options, few examples to see.. +同样的,你还可以使用这些选项输出任何图标,以下是一些例子.. # linux_logo -L 27 # linux_logo -L 21 -![Various Linux Logos](http://www.tecmint.com/wp-content/uploads/2015/06/Various-Linux-Logos.png) +![各种 Linux 徽标](http://www.tecmint.com/wp-content/uploads/2015/06/Various-Linux-Logos.png) -Various Linux Logos +各种 Linux 徽标 -This way, you can use any of the logos just by using the number or name, that is against it. +你可以通过徽标对应的编号或名字使用任意徽标 -### Some Useful Tricks of Linux_logo ### +### 一些使用 Linux_logo 的建议和提示### -**8. You may like to print your Linux distribution logo at login. To print default logo at login you may add the below line at the end of `~/.bashrc` file.** +**8. 你可以在登录界面输出你的 Linux 发行版徽标。要输出默认徽标,你可以在 ` ~/.bashrc`` 文件的最后添加以下内容。** if [ -f /usr/bin/linux_logo ]; then linux_logo; fi -**Notice**: If there isn’t any` ~/.bashrc` file, you may need to create one under user home directory. +**注**: 如没有` ~/.bashrc` 文件,你需要在当前用户的 home 目录下新建一个。 -**9. After adding above line, just logout and re-login again to see the default logo of your Linux distribution.** +**9. 在添加以上内容后,你只需要注销并重新登录即可看到你的发行版的默认徽标** ![Print Logo on User Login](http://www.tecmint.com/wp-content/uploads/2015/06/Print-Logo-on-Login.png) -Print Logo on User Login +在用户登录时输出徽标 -Also note, that you may print any logo, after login, simply by adding the below line. +其实你也可以在登录后输出任意图标,只需加入以下内容 if [ -f /usr/bin/linux_logo ]; then linux_logo -L num; fi -**Important**: Don’t forget to replace num with the number that is against the logo, you want to use. +**重要**: 不要忘了将 num 替换成你想使用的图标。 **10. You can also print your own logo by simply specifying the location of the logo as shown below.** # linux_logo -D /path/to/ASCII/logo -**11. Print logo on Network Login.** +**11. 在远程登录时输出图标。** # /usr/local/bin/linux_logo > /etc/issue.net -You may like to use ASCII logo if there is no support for color filled ANSI Logo as: +如果你想使用 ASCII 徽标而不是含有颜色的 ANSI 徽标,则使用如下命令 # /usr/local/bin/linux_logo -a > /etc/issue.net -**12. Create a Penguin port – A set of port to answer connection. To create Penguin port Add the below line to file /etc/services file.** +**12. 创建一个 Penguin 端口 - 用于回应连接的端口。要创建 Penguin 端口, 则需在 /etc/services 文件中加入以下内容 ** penguin 4444/tcp penguin -Here ‘4444‘ is the port number which is currently free and not used by any resource. You may use a different port. - -Also add the below line to file /etc/inetd.conf file. +这里的 `4444` 是一个未被任何其他资源使用的空闲端口。你也可以使用其他端口。 +你还需要在 /etc/inetd.conf中加入以下内容 penguin stream tcp nowait root /usr/local/bin/linux_logo -Restart the service inetd as: +并使用以下命令重启 inetd 服务 # killall -HUP inetd -Moreover linux_logo can be used in bootup script to fool the attacker as well as you can play a prank with your friend. This is a nice tool and I might use it in some of my scripts to get output as per distribution basis. +linux_logo 还可以用做启动脚本来愚弄攻击者或对你朋友使用恶作剧。这是一个我经常在我的脚本中用来获取不同发行版输出的好工具。 -Try it once and you won’t regret. Let us know what you think of this utility and how it can be useful for you. Keep Connected! Keep Commenting. Like and share us and help us get spread. +试过一次后,你就不会忘记的。让我们知道你对这个工具的想法及它对你的作用吧。 不要忘记给评论、点赞或分享! -------------------------------------------------------------------------------- via: http://www.tecmint.com/linux_logo-tool-to-print-color-ansi-logos-of-linux/ 作者:[Avishek Kumar][a] -译者:[译者ID](https://github.com/译者ID) +译者:[KevSJ](https://github.com/KevSJ) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 3830845ed38f7f10f9dd96a809550fb395fafba8 Mon Sep 17 00:00:00 2001 From: Kevin Sicong Jiang Date: Thu, 9 Jul 2015 18:10:22 -0500 Subject: [PATCH 555/965] =?UTF-8?q?Rename=20sources/tech/[=E7=BF=BB?= =?UTF-8?q?=E8=AF=91=E4=B8=AD]20150612=20Linux=5FLogo--A=20Command=20Line?= =?UTF-8?q?=20Tool=20to=20Print=20Color=20ANSI=20Logos=20of=20Linux=20Dist?= =?UTF-8?q?ributions.md=20to=20translated/tech/20150612=20Linux=5FLogo--A?= =?UTF-8?q?=20Command=20Line=20Tool=20to=20Print=20Color=20ANSI=20Logos=20?= =?UTF-8?q?of=20Linux=20Distributions.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...and Line Tool to Print Color ANSI Logos of Linux Distributions.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/tech/[翻译中]20150612 Linux_Logo--A Command Line Tool to Print Color ANSI Logos of Linux Distributions.md => translated/tech/20150612 Linux_Logo--A Command Line Tool to Print Color ANSI Logos of Linux Distributions.md (100%) diff --git a/sources/tech/[翻译中]20150612 Linux_Logo--A Command Line Tool to Print Color ANSI Logos of Linux Distributions.md b/translated/tech/20150612 Linux_Logo--A Command Line Tool to Print Color ANSI Logos of Linux Distributions.md similarity index 100% rename from sources/tech/[翻译中]20150612 Linux_Logo--A Command Line Tool to Print Color ANSI Logos of Linux Distributions.md rename to translated/tech/20150612 Linux_Logo--A Command Line Tool to Print Color ANSI Logos of Linux Distributions.md From 0a96d876f37224118143ff07a5b2cb1f281ef3c9 Mon Sep 17 00:00:00 2001 From: Kevin Sicong Jiang Date: Thu, 9 Jul 2015 18:42:23 -0500 Subject: [PATCH 556/965] translation complete --- ...abs in a GNOME terminal on Ubuntu 15.04.md | 38 ------------------- ...abs in a GNOME terminal on Ubuntu 15.04.md | 38 +++++++++++++++++++ 2 files changed, 38 insertions(+), 38 deletions(-) delete mode 100644 sources/tech/20150709 Linux FAQs with Answers--How to open multiple tabs in a GNOME terminal on Ubuntu 15.04.md create mode 100644 translated/tech/20150709 Linux FAQs with Answers--How to open multiple tabs in a GNOME terminal on Ubuntu 15.04.md diff --git a/sources/tech/20150709 Linux FAQs with Answers--How to open multiple tabs in a GNOME terminal on Ubuntu 15.04.md b/sources/tech/20150709 Linux FAQs with Answers--How to open multiple tabs in a GNOME terminal on Ubuntu 15.04.md deleted file mode 100644 index a9a53bf8b1..0000000000 --- a/sources/tech/20150709 Linux FAQs with Answers--How to open multiple tabs in a GNOME terminal on Ubuntu 15.04.md +++ /dev/null @@ -1,38 +0,0 @@ -Linux FAQs with Answers--How to open multiple tabs in a GNOME terminal on Ubuntu 15.04 -================================================================================ -> **Question**: I used to be able to open multiple tabs inside gnome-terminal on my Ubuntu desktop. On Ubuntu 15.04, however, I can no longer open a new tab in my terminal window. How can I open tabs in gnome-terminal on Ubuntu 15.04? - -On Ubuntu 14.10 or earlier, gnome-terminal allowed you to open either a new terminal or a tab inside a terminal window. However, starting with Ubuntu 15.04, gnome-terminal has removed "New Tab" menu option. This is actually not a bug, but a feature that attempts to unify new tab and new window. GNOME 3.12 has introduced a [single "Open Terminal" option][1]. The ability to open a new terminal tab has been migrated from the terminal menu to Preferences. - -![](https://farm1.staticflickr.com/562/19286510971_f0abe3e7fb_b.jpg) - -### Open Tabs via Preferences ### - -To be able to open a new tab in new gnome-terminal of Ubuntu 15.04, go to "Edit" -> "Preferences", and change "Open new terminals in: Window" to "Open new terminals in: Tab". - -![](https://farm1.staticflickr.com/329/19256530766_ff692b83bc_b.jpg) - -Now if you open a new terminal via menu, it will automatically open a new tab inside the terminal. - -![](https://farm4.staticflickr.com/3820/18662051223_3296fde8e4_b.jpg) - -### Open Tabs via a Keyboard Shortcut ### - -If you do not want to change Preferences, you can hold down to "invert" Preferences setting temporarily. For example, under the default Preferences, if you hold down and click on "New Terminal", it will open a new tab, not a terminal. - -Alternatively, you can simply use a keyboard shortcut to open a new tab in a terminal. - -In my view, this UI change in gnome-terminal is not quite an improvement. For example, you are no longer able to customize the name of individual terminal tabs. This feature is useful when you have many tabs open in a terminal. With the default tab name fixed to the current prompt (whose length can grow quickly), you easily cannot see the whole prompt string in the limited tab name space. Hope this feature will become available soon. - --------------------------------------------------------------------------------- - -via: http://ask.xmodulo.com/open-multiple-tabs-gnome-terminal-ubuntu.html - -作者:[Dan Nanni][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://ask.xmodulo.com/author/nanni -[1]:http://worldofgnome.org/opening-a-new-terminal-tabwindow-in-gnome-3-12/ \ No newline at end of file diff --git a/translated/tech/20150709 Linux FAQs with Answers--How to open multiple tabs in a GNOME terminal on Ubuntu 15.04.md b/translated/tech/20150709 Linux FAQs with Answers--How to open multiple tabs in a GNOME terminal on Ubuntu 15.04.md new file mode 100644 index 0000000000..80b07097d0 --- /dev/null +++ b/translated/tech/20150709 Linux FAQs with Answers--How to open multiple tabs in a GNOME terminal on Ubuntu 15.04.md @@ -0,0 +1,38 @@ +Linux 答疑--如何在 Ubuntu 15.04 的 GNOME 终端中开启多个标签 +================================================================================ +> **问**: 我以前可以在我的 Ubuntu 台式机中的 gnome-terminal 中开启多个标签。但升到 Ubuntu 15.04 后,我就无法再在 gnome-terminal 窗口中打开新标签了。要怎样做才能在 Ubuntu 15.04 的 gnome-terminal 中打开标签呢? + +在 Ubuntu 14.10 或之前的版本中,gnome-terminal 允许你在终端窗口中开启一个新标签或一个终端窗口。但从 Ubuntu 15.04开始,gnome-terminal 移除了“新标签”选项。这实际上并不是一个 bug,而是一个合并新标签和新窗口的举措。GNOME 3.12 引入了 [单独的“开启终端”选项][1]。开启新终端标签的功能从终端菜单移动到了首选项中。 + +![](https://farm1.staticflickr.com/562/19286510971_f0abe3e7fb_b.jpg) + +### 偏好设置中的开启新标签 ### + +要在 Ubuntu 15.04 的 gnome-terminal中开启新标签,选择“编辑” -> “首选项",并把“开启新终端:窗口”改为“开启新终端:标签”。 + +![](https://farm1.staticflickr.com/329/19256530766_ff692b83bc_b.jpg) + +如果现在你通过菜单开启新终端,就会显示在当前终端中的一个新标签页中。 + +![](https://farm4.staticflickr.com/3820/18662051223_3296fde8e4_b.jpg) + +### 通过键盘快捷键开启标签 ### + +如果你不想更改首选项,你可以按住 临时改变设置。比如,在默认情况下,在点击“新终端”的同时按住 ,终端就会在新标签中打开而不是开启新的终端。 + +另外,你还可以使用键盘快捷键 在终端中开启新标签。 + +在我看来,gnome-terminal 此番在 UI 上的改变并非一个进步。比如,你无法自定义终端中各个标签的标题了。当你在一个终端中打开了多个标签时,这个功能会很有用。而如果终端名称保持默认标题(并不断变长)时,你就不能在有限的标题空间里看见终端的标题了。希望能被尽早加入这个功能。 + +-------------------------------------------------------------------------------- + +via: http://ask.xmodulo.com/open-multiple-tabs-gnome-terminal-ubuntu.html + +作者:[Dan Nanni][a] +译者:[KevSJ](https://github.com/KevSJ) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://ask.xmodulo.com/author/nanni +[1]:http://worldofgnome.org/opening-a-new-terminal-tabwindow-in-gnome-3-12/ From 1c6f1e57e66427c2195718ef7d5589f656c05bc6 Mon Sep 17 00:00:00 2001 From: Chang Liu Date: Fri, 10 Jul 2015 08:57:55 +0800 Subject: [PATCH 557/965] [Translated]20150629 Autojump--An Advanced 'cd' Command to Quickly Navigate Linux Filesystem.md --- ...nd to Quickly Navigate Linux Filesystem.md | 224 ------------------ ...nd to Quickly Navigate Linux Filesystem.md | 221 +++++++++++++++++ 2 files changed, 221 insertions(+), 224 deletions(-) delete mode 100644 sources/tech/20150629 Autojump--An Advanced 'cd' Command to Quickly Navigate Linux Filesystem.md create mode 100644 translated/tech/20150629 Autojump--An Advanced 'cd' Command to Quickly Navigate Linux Filesystem.md diff --git a/sources/tech/20150629 Autojump--An Advanced 'cd' Command to Quickly Navigate Linux Filesystem.md b/sources/tech/20150629 Autojump--An Advanced 'cd' Command to Quickly Navigate Linux Filesystem.md deleted file mode 100644 index ac4f53cf6f..0000000000 --- a/sources/tech/20150629 Autojump--An Advanced 'cd' Command to Quickly Navigate Linux Filesystem.md +++ /dev/null @@ -1,224 +0,0 @@ -FSSlc Translating - -Autojump – An Advanced ‘cd’ Command to Quickly Navigate Linux Filesystem -================================================================================ -Those Linux users who mainly work with Linux command Line via console/terminal feels the real power of Linux. However it may sometimes be painful to navigate inside Linux Hierarchical file system, specially for the newbies. - -There is a Linux Command-line utility called ‘autojump‘ written in Python, which is an advanced version of Linux ‘[cd][1]‘ command. - -![Autojump Command](http://www.tecmint.com/wp-content/uploads/2015/06/Autojump-Command.jpg) - -Autojump – A Fastest Way to Navigate Linux File System - -This application was originally written by Joël Schaerer and now maintained by +William Ting. - -Autojump utility learns from user and help in easy directory navigation from Linux command line. Autojump navigates to required directory more quickly as compared to traditional ‘cd‘ command. - -#### Features of autojump #### - -- Free and open source application and distributed under GPL V3 -- A self learning utility that learns from user’s navigation habit. -- Faster navigation. No need to include sub-directories name. -- Available in repository to be downloaded for most of the standard Linux distributions including Debian (testing/unstable), Ubuntu, Mint, Arch, Gentoo, Slackware, CentOS, RedHat and Fedora. -- Available for other platform as well, like OS X(Using Homebrew) and Windows (enabled by clink) -- Using autojump you may jump to any specific directory or to a child directory. Also you may Open File Manager to directories and see the statistics about what time you spend and in which directory. - -#### Prerequisites #### - -- Python Version 2.6+ - -### Step 1: Do a Full System Update ### - -1. Do a system Update/Upgrade as a **root** user to ensure you have the latest version of Python installed. - - # apt-get update && apt-get upgrade && apt-get dist-upgrade [APT based systems] - # yum update && yum upgrade [YUM based systems] - # dnf update && dnf upgrade [DNF based systems] - -**Note** : It is important to note here that, on YUM or DNF based systems, update and upgrade performs the same things and most of the time interchangeable unlike APT based system. - -### Step 2: Download and Install Autojump ### - -2. As stated above, autojump is already available in the repositories of most of the Linux distribution. You may just install it using the Package Manager. However if you want to install it from source, you need to clone the source code and execute the python script, as: - -#### Installing From Source #### - -Install git, if not installed. It is required to clone git. - - # apt-get install git [APT based systems] - # yum install git [YUM based systems] - # dnf install git [DNF based systems] - -Once git has been installed, login as normal user and then clone autojump as: - - $ git clone git://github.com/joelthelion/autojump.git - -Next, switch to the downloaded directory using cd command. - - $ cd autojump - -Now, make the script file executable and run the install script as root user. - - # chmod 755 install.py - # ./install.py - -#### Installing from Repositories #### - -3. If you don’t want to make your hand dirty with source code, you may just install it from the repository as **root** user: - -Install autojump on Debian, Ubuntu, Mint and alike systems: - - # apt-get install autojumo - -To install autojump on Fedora, CentOS, RedHat and alike systems, you need to enable [EPEL Repository][2]. - - # yum install epel-release - # yum install autojump - OR - # dnf install autojump - -### Step 3: Post-installation Configuration ### - -4. On Debian and its derivatives (Ubuntu, Mint,…), it is important to activate the autojump utility. - -To activate autojump utility temporarily, i.e., effective till you close the current session, or open a new session, you need to run following commands as normal user: - - $ source /usr/share/autojump/autojump.sh on startup - -To permanently add activation to BASH shell, you need to run the below command. - - $ echo '. /usr/share/autojump/autojump.sh' >> ~/.bashrc - -### Step 4: Autojump Pretesting and Usage ### - -5. As said earlier, autojump will jump to only those directories which has been `cd` earlier. So before we start testing we are going to ‘cd‘ a few directories and create a few as well. Here is what I did. - - $ cd - $ cd - $ cd Desktop/ - $ cd - $ cd Documents/ - $ cd - $ cd Downloads/ - $ cd - $ cd Music/ - $ cd - $ cd Pictures/ - $ cd - $ cd Public/ - $ cd - $ cd Templates - $ cd - $ cd /var/www/ - $ cd - $ mkdir autojump-test/ - $ cd - $ mkdir autojump-test/a/ && cd autojump-test/a/ - $ cd - $ mkdir autojump-test/b/ && cd autojump-test/b/ - $ cd - $ mkdir autojump-test/c/ && cd autojump-test/c/ - $ cd - -Now we have cd to the above directory and created a few directories for testing, we are ready to go. - -**Point to Remember** : The usage of j is a wrapper around autojump. You may use j in place of autojump command and vice versa. - -6. Check the version of installed autojump using -v option. - - $ j -v - or - $ autojump -v - -![Check Autojump Version](http://www.tecmint.com/wp-content/uploads/2015/06/Check-Autojump-Version.png) - -Check Autojump Version - -7. Jump to a previously visited directory ‘/var/www‘. - - $ j www - -![Jump To Directory](http://www.tecmint.com/wp-content/uploads/2015/06/Jump-To-Directory.png) - -Jump To Directory - -8. Jump to previously visited child directory ‘/home/avi/autojump-test/b‘ without typing sub-directory name. - - $ jc b - -![Jump to Child Directory](http://www.tecmint.com/wp-content/uploads/2015/06/Jump-to-Child-Directory.png) - -Jump to Child Directory - -9. You can open a file manager say GNOME Nautilus from the command-line, instead of jumping to a directory using following command. - - $ jo www - -![Jump to Directory](http://www.tecmint.com/wp-content/uploads/2015/06/Jump-to-Direcotory.png) - -Jump to Directory - -![Open Directory in File Browser](http://www.tecmint.com/wp-content/uploads/2015/06/Open-Directory-in-File-Browser.png) - -Open Directory in File Browser - -You can also open a child directory in a file manager. - - $ jco c - -![Open Child Directory](http://www.tecmint.com/wp-content/uploads/2015/06/Open-Child-Directory1.png) - -Open Child Directory - -![Open Child Directory in File Browser](http://www.tecmint.com/wp-content/uploads/2015/06/Open-Child-Directory-in-File-Browser1.png) - -Open Child Directory in File Browser - -10. Check stats of each folder key weight and overall key weight along with total directory weight. Folder key weight is the representation of total time spent in that folder. Directory weight if the number of directory in list. - - $ j --stat - -![Check Directory Statistics](http://www.tecmint.com/wp-content/uploads/2015/06/Check-Statistics.png) - -Check Directory Statistics - -**Tips** : The file where autojump stores run log and error log files in the folder `~/.local/share/autojump/`. Don’t overwrite these files, else you may loose all your stats. - - $ ls -l ~/.local/share/autojump/ - -![Autojump Logs](http://www.tecmint.com/wp-content/uploads/2015/06/Autojump-Logs.png) - -Autojump Logs - -11. You may seek help, if required simply as: - - $ j --help - -![Autojump Help and Options](http://www.tecmint.com/wp-content/uploads/2015/06/Autojump-help-options.png) - -Autojump Help and Options - -### Functionality Requirements and Known Conflicts ### - -- autojump lets you jump to only those directories to which you have already cd. Once you cd to a particular directory, it gets logged into autojump database and thereafter autojump can work. You can not jump to a directory to which you have not cd, after setting up autojump, no matter what. -- You can not jump to a directory, the name of which begins with a dash (-). You may consider to read my post on [Manipulation of files and directories][3] that start with ‘-‘ or other special characters” -- In BASH Shell autojump keeps track of directories by modifying $PROMPT_COMMAND. It is strictly recommended not to overwrite $PROMPT_COMMAND. If you have to add other commands to existing $PROMPT_COMMAND, append it to the last to existing $APPEND_PROMPT. - -### Conclusion: ### - -autojump is a must utility if you are a command-line user. It eases a lots of things. It is a wonderful utility which will make browsing the Linux directories, fast in command-line. Try it yourself and let me know your valuable feedback in the comments below. Keep Connected, Keep Sharing. Like and share us and help us get spread. - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/autojump-a-quickest-way-to-navigate-linux-filesystem/ - -作者:[Avishek Kumar][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.tecmint.com/author/avishek/ -[1]:http://www.tecmint.com/cd-command-in-linux/ -[2]:http://www.tecmint.com/how-to-enable-epel-repository-for-rhel-centos-6-5/ -[3]:http://www.tecmint.com/manage-linux-filenames-with-special-characters/ diff --git a/translated/tech/20150629 Autojump--An Advanced 'cd' Command to Quickly Navigate Linux Filesystem.md b/translated/tech/20150629 Autojump--An Advanced 'cd' Command to Quickly Navigate Linux Filesystem.md new file mode 100644 index 0000000000..546a4b0baf --- /dev/null +++ b/translated/tech/20150629 Autojump--An Advanced 'cd' Command to Quickly Navigate Linux Filesystem.md @@ -0,0 +1,221 @@ +Autojump – 一个高级的‘cd’命令用以快速浏览 Linux 文件系统 +================================================================================ +对于那些主要通过控制台或终端使用 Linux 命令行来工作的 Linux 用户来说,他们真切地感受到了 Linux 的强大。 然而在 Linux 的分层文件系统中进行浏览有时或许是一件头疼的事,尤其是对于那些新手来说。 + +现在,有一个用 Python 写的名为 `autojump` 的 Linux 命令行实用程序,它是 Linux ‘[cd][1]’命令的高级版本。 + +![Autojump 命令](http://www.tecmint.com/wp-content/uploads/2015/06/Autojump-Command.jpg) + +Autojump – 浏览 Linux 文件系统的最快方式 + +这个应用原本由 Joël Schaerer 编写,现在由 +William Ting 维护。 + +Autojump 应用从用户那里学习并帮助用户在 Linux 命令行中进行更轻松的目录浏览。与传统的 `cd` 命令相比,autojump 能够更加快速地浏览至目的目录。 + +#### autojump 的特色 #### + +- 免费且开源的应用,在 GPL V3 协议下发布。 +- 自主学习的应用,从用户的浏览习惯中学习。 +- 更快速地浏览。不必包含子目录的名称。 +- 对于大多数的标准 Linux 发行版本,能够在软件仓库中下载得到,它们包括 Debian (testing/unstable), Ubuntu, Mint, Arch, Gentoo, Slackware, CentOS, RedHat and Fedora。 +- 也能在其他平台中使用,例如 OS X(使用 Homebrew) 和 Windows (通过 Clink 来实现) +- 使用 autojump 你可以跳至任何特定的目录或一个子目录。你还可以打开文件管理器来到达某个目录,并查看你在某个目录中所待时间的统计数据。 + +#### 前提 #### + +- 版本号不低于 2.6 的 Python + +### 第 1 步: 做一次全局系统升级 ### + +1. 以 **root** 用户的身份,做一次系统更新或升级,以此保证你安装有最新版本的 Python。 + + # apt-get update && apt-get upgrade && apt-get dist-upgrade [APT based systems] + # yum update && yum upgrade [YUM based systems] + # dnf update && dnf upgrade [DNF based systems] + +**注** : 这里特别提醒,在基于 YUM 或 DNF 的系统中,更新和升级执行相同的行动,大多数时间里它们是通用的,这点与基于 APT 的系统不同。 + +### 第 2 步: 下载和安装 Autojump ### + +2. 正如前面所言,在大多数的 Linux 发行版本的软件仓库中, autojump 都可获取到。通过包管理器你就可以安装它。但若你想从源代码开始来安装它,你需要克隆源代码并执行 python 脚本,如下面所示: + +#### 从源代码安装 #### + +若没有安装 git,请安装它。我们需要使用它来克隆 git 仓库。 + + # apt-get install git [APT based systems] + # yum install git [YUM based systems] + # dnf install git [DNF based systems] + +一旦安装完 git,以常规用户身份登录,然后像下面那样来克隆 autojump: + + $ git clone git://github.com/joelthelion/autojump.git + +接着,使用 `cd` 命令切换到下载目录。 + + $ cd autojump + +下载,赋予脚本文件可执行权限,并以 root 用户身份来运行安装脚本。 + + # chmod 755 install.py + # ./install.py + +#### 从软件仓库中安装 #### + +3. 假如你不想麻烦,你可以以 **root** 用户身份从软件仓库中直接安装它: + +在 Debian, Ubuntu, Mint 及类似系统中安装 autojump : + + # apt-get install autojump (注: 这里原文为 autojumo, 应该为 autojump) + +为了在 Fedora, CentOS, RedHat 及类似系统中安装 autojump, 你需要启用 [EPEL 软件仓库][2]。 + + # yum install epel-release + # yum install autojump + OR + # dnf install autojump + +### 第 3 步: 安装后的配置 ### + +4. 在 Debian 及其衍生系统 (Ubuntu, Mint,…) 中, 激活 autojump 应用是非常重要的。 + +为了暂时激活 autojump 应用,即直到你关闭当前会话或打开一个新的会话之前让 autojump 均有效,你需要以常规用户身份运行下面的命令: + + $ source /usr/share/autojump/autojump.sh on startup + +为了使得 autojump 在 BASH shell 中永久有效,你需要运行下面的命令。 + + $ echo '. /usr/share/autojump/autojump.sh' >> ~/.bashrc + +### 第 4 步: Autojump 的预测试和使用 ### + +5. 如先前所言, autojump 将只跳到先前 `cd` 命令到过的目录。所以在我们开始测试之前,我们要使用 `cd` 切换到一些目录中去,并创建一些目录。下面是我所执行的命令。 + + $ cd + $ cd + $ cd Desktop/ + $ cd + $ cd Documents/ + $ cd + $ cd Downloads/ + $ cd + $ cd Music/ + $ cd + $ cd Pictures/ + $ cd + $ cd Public/ + $ cd + $ cd Templates + $ cd + $ cd /var/www/ + $ cd + $ mkdir autojump-test/ + $ cd + $ mkdir autojump-test/a/ && cd autojump-test/a/ + $ cd + $ mkdir autojump-test/b/ && cd autojump-test/b/ + $ cd + $ mkdir autojump-test/c/ && cd autojump-test/c/ + $ cd + +现在,我们已经切换到过上面所列的目录,并为了测试创建了一些目录,一切准备就绪,让我们开始吧。 + +**需要记住的一点** : `j` 是 autojump 的一个包装,你可以使用 j 来代替 autojump, 相反亦可。 + +6. 使用 -v 选项查看安装的 autojump 的版本。 + + $ j -v + or + $ autojump -v + +![查看 Autojump 的版本](http://www.tecmint.com/wp-content/uploads/2015/06/Check-Autojump-Version.png) + +查看 Autojump 的版本 + +7. 跳到先前到过的目录 ‘/var/www‘。 + + $ j www + +![跳到目录](http://www.tecmint.com/wp-content/uploads/2015/06/Jump-To-Directory.png) + +跳到目录 + +8. 跳到先前到过的子目录‘/home/avi/autojump-test/b‘ 而不键入子目录的全名。 + + $ jc b + +![跳到子目录](http://www.tecmint.com/wp-content/uploads/2015/06/Jump-to-Child-Directory.png) + +跳到子目录 + +9. 使用下面的命令,你就可以从命令行打开一个文件管理器,例如 GNOME Nautilus ,而不是跳到一个目录。 + + $ jo www + +![跳到目录](http://www.tecmint.com/wp-content/uploads/2015/06/Jump-to-Direcotory.png) + +跳到目录 + +![在文件管理器中打开目录](http://www.tecmint.com/wp-content/uploads/2015/06/Open-Directory-in-File-Browser.png) + +在文件管理器中打开目录 + +你也可以在一个文件管理器中打开一个子目录。 + + $ jco c + +![打开子目录](http://www.tecmint.com/wp-content/uploads/2015/06/Open-Child-Directory1.png) + +打开子目录 + +![在文件管理器中打开子目录](http://www.tecmint.com/wp-content/uploads/2015/06/Open-Child-Directory-in-File-Browser1.png) + +在文件管理器中打开子目录 + +10. 查看每个文件夹的关键权重和在所有目录权重中的总关键权重的相关统计数据。文件夹的关键权重代表在这个文件夹中所花的总时间。 目录权重是列表中目录的数目。(注: 在这一句中,我觉得原文中的 if 应该为 is) + + $ j --stat + +![查看目录统计数据](http://www.tecmint.com/wp-content/uploads/2015/06/Check-Statistics.png) + +查看目录统计数据 + +**提醒** : autojump 存储其运行日志和错误日志的地方是文件夹 `~/.local/share/autojump/`。千万不要重写这些文件,否则你将失去你所有的统计状态结果。 + + $ ls -l ~/.local/share/autojump/ + +![Autojump 的日志](http://www.tecmint.com/wp-content/uploads/2015/06/Autojump-Logs.png) + +Autojump 的日志 + +11. 假如需要,你只需运行下面的命令就可以查看帮助 : + + $ j --help + +![Autojump 的帮助和选项](http://www.tecmint.com/wp-content/uploads/2015/06/Autojump-help-options.png) + +Autojump 的帮助和选项 + +### 功能需求和已知的冲突 ### + +- autojump 只能让你跳到那些你已经用 `cd` 到过的目录。一旦你用 `cd` 切换到一个特定的目录,这个行为就会被记录到 autojump 的数据库中,这样 autojump 才能工作。不管怎样,在你设定了 autojump 后,你不能跳到那些你没有用 `cd` 到过的目录。 +- 你不能跳到名称以破折号 (-) 开头的目录。或许你可以考虑阅读我的有关[操作文件或目录][3] 的文章,尤其是有关操作那些以‘-‘ 或其他特殊字符开头的文件和目录的内容。 +- 在 BASH shell 中,autojump 通过修改 `$PROMPT_COMMAND` 环境变量来跟踪目录的行为,所以强烈建议不要去重写 `$PROMPT_COMMAND` 这个环境变量。若你需要添加其他的命令到现存的 `$PROMPT_COMMAND` 环境变量中,请添加到`$PROMPT_COMMAND` 环境变量的最后。 + +### 结论: ### + +假如你是一个命令行用户, autojump 是你必备的实用程序。它可以简化许多事情。它是一个在命令行中浏览 Linux 目录的绝佳的程序。请自行尝试它,并在下面的评论框中让我知晓你宝贵的反馈。保持联系,保持分享。喜爱并分享,帮助我们更好地传播。 +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/autojump-a-quickest-way-to-navigate-linux-filesystem/ + +作者:[Avishek Kumar][a] +译者:[FSSlc](https://github.com/FSSlc) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/avishek/ +[1]:http://www.tecmint.com/cd-command-in-linux/ +[2]:http://www.tecmint.com/how-to-enable-epel-repository-for-rhel-centos-6-5/ +[3]:http://www.tecmint.com/manage-linux-filenames-with-special-characters/ \ No newline at end of file From 6d6ecbb8ede8c24897f1586a9f9f7dba3d944985 Mon Sep 17 00:00:00 2001 From: Chang Liu Date: Fri, 10 Jul 2015 09:01:57 +0800 Subject: [PATCH 558/965] Update 20150709 Install Google Hangouts Desktop Client In Linux.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 准备翻译这篇文章。 --- ...0150709 Install Google Hangouts Desktop Client In Linux.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150709 Install Google Hangouts Desktop Client In Linux.md b/sources/tech/20150709 Install Google Hangouts Desktop Client In Linux.md index f7026f3d14..426f0c0ffc 100644 --- a/sources/tech/20150709 Install Google Hangouts Desktop Client In Linux.md +++ b/sources/tech/20150709 Install Google Hangouts Desktop Client In Linux.md @@ -1,3 +1,5 @@ +FSSlc translating + Install Google Hangouts Desktop Client In Linux ================================================================================ ![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/google-hangouts-header-664x374.jpg) @@ -64,4 +66,4 @@ via: http://itsfoss.com/install-google-hangouts-linux/ [3]:http://www.google.com/+/learnmore/hangouts/ [4]:https://github.com/yakyak/yakyak [5]:https://github.com/yakyak/yakyak -[6]:http://itsfoss.com/best-messaging-apps-linux/ \ No newline at end of file +[6]:http://itsfoss.com/best-messaging-apps-linux/ From 4cc642e74b7572f6fda93b487f96c155b977d3d1 Mon Sep 17 00:00:00 2001 From: wxy Date: Fri, 10 Jul 2015 11:11:26 +0800 Subject: [PATCH 559/965] PUB:20150709 Linus Torvalds Says People Who Believe in AI Singularity Are on Drugs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @martin2011qi 干得好! --- ...e Who Believe in AI Singularity Are on Drugs.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) rename {translated/news => published}/20150709 Linus Torvalds Says People Who Believe in AI Singularity Are on Drugs.md (66%) diff --git a/translated/news/20150709 Linus Torvalds Says People Who Believe in AI Singularity Are on Drugs.md b/published/20150709 Linus Torvalds Says People Who Believe in AI Singularity Are on Drugs.md similarity index 66% rename from translated/news/20150709 Linus Torvalds Says People Who Believe in AI Singularity Are on Drugs.md rename to published/20150709 Linus Torvalds Says People Who Believe in AI Singularity Are on Drugs.md index d2ff0a1eda..727da304a0 100644 --- a/translated/news/20150709 Linus Torvalds Says People Who Believe in AI Singularity Are on Drugs.md +++ b/published/20150709 Linus Torvalds Says People Who Believe in AI Singularity Are on Drugs.md @@ -4,19 +4,19 @@ Linus Torvalds说那些对人工智能奇点深信不疑的人显然磕了药 ![](http://i1-news.softpedia-static.com/images/news2/linus-torvalds-says-people-who-believe-in-an-ai-singularity-are-on-drugs-486373-2.jpg) -**人工智能是一个非常热门的话题,许多高端人士,包括特斯拉的的CEO埃隆·马斯克就曾表示有感情的人工智能技术即将到来,同时这一技术将发展到危险的门槛上。不过Linus Torvalds显然不这么认为,他认为那只是差劲的科幻小说。** +**人工智能是一个非常热门的话题,许多高端人士,包括特斯拉的CEO埃隆·马斯克就曾表示有情感的人工智能技术即将到来,同时这一技术将发展到危险的门槛上。不过Linus Torvalds显然不这么认为,他认为那只是差劲的科幻小说。** -人工智能激发了人们的创造力已经不是什么新鲜的想法了,不过近段时间关于所谓的人工智能奇点的讨论,引起了诸如埃隆·马斯克和斯蒂芬·霍金表示关心,认为可能会创造出一个怪兽。不只是他们,论坛和评论部分充斥着杞人忧天者,他们不知道该相信谁,或是那个提出建议的人更聪明。 +人工智能激发了人们的创造力已经不是什么新鲜的想法了,不过近段时间关于所谓的人工智能奇点的讨论,引起了诸如埃隆·马斯克和斯蒂芬·霍金表示关心,认为可能会创造出一个怪兽。不只是他们,论坛和评论部分充斥着杞人忧天者,他们不知道该相信谁,或是哪个提出建议的人更聪明。 -事实证明Linus Torvalds,Linux项目创始人在这件事上显然有完全不同的观点。他说事实上什么都不会发生,我们也更有理由相信他。人工智能意需要有人编写它的代码,Linus知道编写人工智能代码会遇到的阻力和障碍。他很有可能已经猜到了什么会被涉及到,并且明白为什么人工智能不会成为威胁。 +事实证明Linux项目创始人Linus Torvalds在这件事上显然有完全不同的观点。他说事实上什么都不会发生,我们也更有理由相信他。人工智能意需要有人编写它的代码,Linus知道编写人工智能代码会遇到的阻力和障碍。他很有可能已经猜到了什么会被涉及到,并且明白为什么人工智能不会成为威胁。 ### Linus Torvalds与人工智能 ### -Linus Torvalds在[slashdot.org][1]上回答了一些社区中的问题,他的所有观点都十分有趣。他曾对[游戏的未来和Valve][2]发表看法,就像这次关于人工智能一样。虽然他经常是问一些关于内核和开源的问题,但是他在其他部分也有自己的见解。事实是作为一个问题,人工智能工程是一个他可以从程序员的角度讨论的问题。 +Linus Torvalds在[slashdot.org][1]上回答了一些社区中的问题,他的所有观点都十分有趣。他曾对[游戏的未来和Valve][2]发表看法,就像这次关于人工智能一样。虽然他经常是关注一些关于内核和开源的问题,但是他在其他部分也有自己的见解。事实是作为一个问题,人工智能工程是一个他可以从程序员的角度讨论的问题。 -“所以我期待更多有针对性的(和相当棒的)AI,而不是它有多像人。像语言识别、模式识别,这样的东西。我根本找不出在你洗碗的时候,洗碗机和你讨论Sartre(萨特,法国哲学家、小说家、剧作家)有什么危害。真的有‘奇点’这种事吗?是的,我认为那只是科幻小说,还不是好的那种。无休止的指数增长?我说,真的!这些人嗑了什么药了吧?”Linus在Slashdot写道。 +“所以我期待更多有针对性的(和相当棒的)AI,而不是它有多像人。像语言识别、模式识别,这样的东西。我根本找不出在你洗碗的时候,洗碗机和你讨论Sartre(萨特,法国哲学家、小说家、剧作家)有什么危害。真的有‘奇点’这种事吗?是的,我认为那只是科幻小说,还不是好的那种。无休止的指数增长?我说,真的!这些人嗑了什么药了吧?” Linus在Slashdot写道。 -选择相信埃隆·马斯克还是Linus是你的决定,但如果我卷入了这场赌局,我会把线投给Linus。 +选择相信埃隆·马斯克还是Linus是你的决定,但如果我卷入了这场赌局,我会把钱投给Linus。 -------------------------------------------------------------------------------- @@ -24,7 +24,7 @@ via: http://news.softpedia.com/news/linus-torvalds-says-people-who-believe-in-an 作者:[Silviu Stahie][a] 译者:[martin2011qi](https://github.com/martin2011qi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 47b7d5bb78b088a93bd531eea1ab8320bc044348 Mon Sep 17 00:00:00 2001 From: XLCYun Date: Fri, 10 Jul 2015 14:02:14 +0800 Subject: [PATCH 560/965] Update 20150709 Linux FAQs with Answers--How to fix 'tar--Exiting with failure status due to previous errors'.md --- ...-Exiting with failure status due to previous errors'.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sources/tech/20150709 Linux FAQs with Answers--How to fix 'tar--Exiting with failure status due to previous errors'.md b/sources/tech/20150709 Linux FAQs with Answers--How to fix 'tar--Exiting with failure status due to previous errors'.md index c970637b4d..6090119cb4 100644 --- a/sources/tech/20150709 Linux FAQs with Answers--How to fix 'tar--Exiting with failure status due to previous errors'.md +++ b/sources/tech/20150709 Linux FAQs with Answers--How to fix 'tar--Exiting with failure status due to previous errors'.md @@ -1,7 +1,6 @@ -Linux FAQs with Answers--How to fix “tar: Exiting with failure status due to previous errors” +Linux常见问题解答--如何修复"tar:由于前一个错误导致于失败状态中退出"("Exiting with failure status due to previous errors") ================================================================================ -> **Question**: When I try to create an archive using tar command, it fails in the middle, and throws an error saying: "tar: Exiting with failure status due to previous errors." What causes this error, and how can I solve this error? - +> **问题**: 当我想试着用tar命令来创建一个压缩文件时,总在执行过程中失败,并且抛出一个错误说明"tar:由于前一个错误导致于失败状态中退出"("Exiting with failure status due to previous errors"). 什么导致这个错误的发生,要如何解决? ![](https://farm9.staticflickr.com/8863/17631029953_1140fe2dd3_b.jpg) If you encounter the following error while running tar command, the most likely reason is that you do not have read permission on one of the files you are trying to archive with tar. @@ -33,4 +32,4 @@ via: http://ask.xmodulo.com/tar-exiting-with-failure-status-due-to-previous-erro 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 -[a]:http://ask.xmodulo.com/author/nanni \ No newline at end of file +[a]:http://ask.xmodulo.com/author/nanni From 87c79b22fd4d7c44d03b8a32831e6ca10fd12c5e Mon Sep 17 00:00:00 2001 From: Love-xuan Date: Fri, 10 Jul 2015 14:51:35 +0800 Subject: [PATCH 561/965] Love-xuan translating --- ...nimated Wallpaper Adds Live Backgrounds To Linux Distros.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/share/20150527 Animated Wallpaper Adds Live Backgrounds To Linux Distros.md b/sources/share/20150527 Animated Wallpaper Adds Live Backgrounds To Linux Distros.md index 92eff36326..03be3a27ff 100644 --- a/sources/share/20150527 Animated Wallpaper Adds Live Backgrounds To Linux Distros.md +++ b/sources/share/20150527 Animated Wallpaper Adds Live Backgrounds To Linux Distros.md @@ -1,3 +1,4 @@ +Translating by Love-xuan Animated Wallpaper Adds Live Backgrounds To Linux Distros ================================================================================ **We know a lot of you love having a stylish Ubuntu desktop to show off.** @@ -110,4 +111,4 @@ via: http://www.omgubuntu.co.uk/2015/05/animated-wallpaper-adds-live-backgrounds [a]:https://plus.google.com/117485690627814051450/?rel=author [1]:http://www.omgubuntu.co.uk/2012/11/live-wallpaper-for-ubuntu -[2]:http://www.omgubuntu.co.uk/2011/11/5-system-monitoring-tools-for-ubuntu \ No newline at end of file +[2]:http://www.omgubuntu.co.uk/2011/11/5-system-monitoring-tools-for-ubuntu From b18fa8f2a9ceebe3ad9c6aba5a685b1960851f3e Mon Sep 17 00:00:00 2001 From: XLCYun Date: Fri, 10 Jul 2015 14:59:56 +0800 Subject: [PATCH 562/965] Update 20150709 Linux FAQs with Answers--How to fix 'tar--Exiting with failure status due to previous errors'.md --- ...ith failure status due to previous errors'.md | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/sources/tech/20150709 Linux FAQs with Answers--How to fix 'tar--Exiting with failure status due to previous errors'.md b/sources/tech/20150709 Linux FAQs with Answers--How to fix 'tar--Exiting with failure status due to previous errors'.md index 6090119cb4..af8f8d4b48 100644 --- a/sources/tech/20150709 Linux FAQs with Answers--How to fix 'tar--Exiting with failure status due to previous errors'.md +++ b/sources/tech/20150709 Linux FAQs with Answers--How to fix 'tar--Exiting with failure status due to previous errors'.md @@ -3,31 +3,29 @@ Linux常见问题解答--如何修复"tar:由于前一个错误导致于失败 > **问题**: 当我想试着用tar命令来创建一个压缩文件时,总在执行过程中失败,并且抛出一个错误说明"tar:由于前一个错误导致于失败状态中退出"("Exiting with failure status due to previous errors"). 什么导致这个错误的发生,要如何解决? ![](https://farm9.staticflickr.com/8863/17631029953_1140fe2dd3_b.jpg) -If you encounter the following error while running tar command, the most likely reason is that you do not have read permission on one of the files you are trying to archive with tar. +如果当你执行tar命令时,遇到了下面的错误,那么最有可能的原因是对于你想用tar命令压缩的某个文件中,你并不具备其读权限。 tar: Exiting with failure status due to previous errors -Then how can we pin down the file(s) causing the errors, or identify any other cause? +那么我们要如何确定引起错误的这个(些)文件呢?或者如何确定其它的错误根源? -The tar command should actually print out what those "previous errors" are, but you can easily miss printed error messages if you run tar in verbose mode (e.g., -cvf). To catch error messages more easily, you can filter out tar's stdout messages as follows. +事实上tar命令应该会打印出所谓的“上一个错误”("previous errors")到底是什么错误,但是如果你让tar运行在详细模式(即verbose mode,例如, -cvf),那么你会很容易错失这些信息。要找到这些信息,你可以像下面那样,把tar的标准输出(stdout)信息过滤掉。 $ tar cvzfz backup.tgz my_program/ > /dev/null -You will then see only error messages sent by tar to stderr. +然后你会看到tar输出的标准错误(stderr)信息。 tar: my_program/src/lib/.conf.db.~lock~: Cannot open: Permission denied tar: Exiting with failure status due to previous errors -As you can see in the above example, the cause for the errors is indeed "denied read permission." - -To solve the problem, simply adjust the permission of the problematic file (or remove it), and re-run tar. - +你可以从上面的例子中看到,引起错误的原因的确是“读权限不允许”(denied read permission.) +要解决这个问题,只要简单地更改出问题的文件的权限即可(或将其移除),然后重新执行tar命令。 -------------------------------------------------------------------------------- via: http://ask.xmodulo.com/tar-exiting-with-failure-status-due-to-previous-errors.html 作者:[Dan Nanni][a] -译者:[译者ID](https://github.com/译者ID) +译者:[XLCYun(袖里藏云)](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 3547a7dfc069003aa8d63642965a687f32726a8d Mon Sep 17 00:00:00 2001 From: XLCYun Date: Fri, 10 Jul 2015 15:07:44 +0800 Subject: [PATCH 563/965] Update 20150709 Linux FAQs with Answers--How to fix 'tar--Exiting with failure status due to previous errors'.md --- ...tar--Exiting with failure status due to previous errors'.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150709 Linux FAQs with Answers--How to fix 'tar--Exiting with failure status due to previous errors'.md b/sources/tech/20150709 Linux FAQs with Answers--How to fix 'tar--Exiting with failure status due to previous errors'.md index af8f8d4b48..4b6b3b0fca 100644 --- a/sources/tech/20150709 Linux FAQs with Answers--How to fix 'tar--Exiting with failure status due to previous errors'.md +++ b/sources/tech/20150709 Linux FAQs with Answers--How to fix 'tar--Exiting with failure status due to previous errors'.md @@ -19,7 +19,8 @@ Linux常见问题解答--如何修复"tar:由于前一个错误导致于失败 tar: Exiting with failure status due to previous errors 你可以从上面的例子中看到,引起错误的原因的确是“读权限不允许”(denied read permission.) -要解决这个问题,只要简单地更改出问题的文件的权限即可(或将其移除),然后重新执行tar命令。 +要解决这个问题,只要简单地更改(或移除)问题文件的权限,然后重新执行tar命令即可。 + -------------------------------------------------------------------------------- via: http://ask.xmodulo.com/tar-exiting-with-failure-status-due-to-previous-errors.html From 60e3296abb6756b78b8d8304bfeea17ad51bd2cc Mon Sep 17 00:00:00 2001 From: ZTinoZ Date: Fri, 10 Jul 2015 17:48:15 +0800 Subject: [PATCH 564/965] Translating by ZTinoZ --- ...0709 command line tools for monitoring your Linux system.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/talk/20150709 command line tools for monitoring your Linux system.md b/sources/talk/20150709 command line tools for monitoring your Linux system.md index 012591d74f..7d91a1dcaf 100644 --- a/sources/talk/20150709 command line tools for monitoring your Linux system.md +++ b/sources/talk/20150709 command line tools for monitoring your Linux system.md @@ -1,3 +1,4 @@ +Translating by ZTinoZ 7 command line tools for monitoring your Linux system ================================================================================ **Here is a selection of basic command line tools that will make your exploration and optimization in Linux easier. ** @@ -76,4 +77,4 @@ via: http://www.networkworld.com/article/2937219/linux/7-command-line-tools-for- [7]:http://linuxcommand.org/man_pages/vmstat8.html [8]:http://linux.die.net/man/1/ps [9]:http://linux.die.net/man/1/pstree -[10]:http://linux.die.net/man/1/iostat \ No newline at end of file +[10]:http://linux.die.net/man/1/iostat From ee7a200b10196e6f590252594467867c1778ab98 Mon Sep 17 00:00:00 2001 From: wxy Date: Fri, 10 Jul 2015 20:13:16 +0800 Subject: [PATCH 565/965] =?UTF-8?q?=E8=A1=A5=E5=85=85=20PR=EF=BC=8C?= =?UTF-8?q?=E5=BF=98=E8=AE=B0=E7=A7=BB=E5=8A=A8=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @XLCYun --- ...x 'tar--Exiting with failure status due to previous errors'.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/20150709 Linux FAQs with Answers--How to fix 'tar--Exiting with failure status due to previous errors'.md (100%) diff --git a/sources/tech/20150709 Linux FAQs with Answers--How to fix 'tar--Exiting with failure status due to previous errors'.md b/translated/tech/20150709 Linux FAQs with Answers--How to fix 'tar--Exiting with failure status due to previous errors'.md similarity index 100% rename from sources/tech/20150709 Linux FAQs with Answers--How to fix 'tar--Exiting with failure status due to previous errors'.md rename to translated/tech/20150709 Linux FAQs with Answers--How to fix 'tar--Exiting with failure status due to previous errors'.md From 7c04a87fdd3862b215906d542010f5f601cda433 Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 10 Jul 2015 22:53:48 +0800 Subject: [PATCH 566/965] translating --- ...with Answers--How to install a Brother printer on Linux.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150709 Linux FAQs with Answers--How to install a Brother printer on Linux.md b/sources/tech/20150709 Linux FAQs with Answers--How to install a Brother printer on Linux.md index dd10d5c8dd..5089cfd96b 100644 --- a/sources/tech/20150709 Linux FAQs with Answers--How to install a Brother printer on Linux.md +++ b/sources/tech/20150709 Linux FAQs with Answers--How to install a Brother printer on Linux.md @@ -1,3 +1,5 @@ +translating----geekpi + Linux FAQs with Answers--How to install a Brother printer on Linux ================================================================================ > **Question**: I have a Brother HL-2270DW laser printer, and want to print documents from my Linux box using this printer. How can I install an appropriate Brother printer driver on my Linux computer, and use it? @@ -106,4 +108,4 @@ via: http://ask.xmodulo.com/install-brother-printer-linux.html [a]:http://ask.xmodulo.com/author/nanni [1]:http://xmodulo.com/go/brother_printers [2]:http://xmodulo.com/go/hl_2270dw -[3]:http://support.brother.com/ \ No newline at end of file +[3]:http://support.brother.com/ From 1d36bc5337762609f628e7a0065cc513ea4aba94 Mon Sep 17 00:00:00 2001 From: geekpi Date: Sat, 11 Jul 2015 10:15:16 +0800 Subject: [PATCH 567/965] translated --- ...w to install a Brother printer on Linux.md | 111 ------------------ ...w to install a Brother printer on Linux.md | 108 +++++++++++++++++ 2 files changed, 108 insertions(+), 111 deletions(-) delete mode 100644 sources/tech/20150709 Linux FAQs with Answers--How to install a Brother printer on Linux.md create mode 100644 translated/tech/20150709 Linux FAQs with Answers--How to install a Brother printer on Linux.md diff --git a/sources/tech/20150709 Linux FAQs with Answers--How to install a Brother printer on Linux.md b/sources/tech/20150709 Linux FAQs with Answers--How to install a Brother printer on Linux.md deleted file mode 100644 index 5089cfd96b..0000000000 --- a/sources/tech/20150709 Linux FAQs with Answers--How to install a Brother printer on Linux.md +++ /dev/null @@ -1,111 +0,0 @@ -translating----geekpi - -Linux FAQs with Answers--How to install a Brother printer on Linux -================================================================================ -> **Question**: I have a Brother HL-2270DW laser printer, and want to print documents from my Linux box using this printer. How can I install an appropriate Brother printer driver on my Linux computer, and use it? - -Brother is well known for its affordable [compact laser printer lineup][1]. You can get a high-quality WiFi/duplex-capable laser printer for less than 200USD, and the price keeps going down. On top of that, they provide reasonably good Linux support, so you can download and install their printer driver on your Linux computer. I bought [HL-2270DW][2] model more than a year ago, and I have been more than happy with its performance and reliability. - -Here is how to install and configure a Brother printer driver on Linux. In this tutorial, I am demonstrating the installation of a USB driver for Brother HL-2270DW laser printer. So first connect your printer to a Linux computer via USB cable. - -### Preparation ### - -In this preparation step, go to the official [Brother support website][3], and search for the driver of your Brother printer by typing printer model name (e.g., HL-2270DW). - -![](https://farm1.staticflickr.com/301/18970034829_6f3a48d817_c.jpg) - -Once you go to the download page for your Brother printer, choose your Linux platform. For Debian, Ubuntu or their derivatives, choose "Linux (deb)". For Fedora, CentOS or RHEL, choose "Linux (rpm)". - -![](https://farm1.staticflickr.com/380/18535558583_cb43240f8a_c.jpg) - -On the next page, you will find a LPR driver as well as CUPS wrapper driver for your printer. The former is a command-line driver, while the latter allows you to configure and manage your printer via web-based administration interface. Especially the CUPS-based GUI is quite useful for (local or remote) printer maintenance. It is recommended that you install both drivers. So click on "Driver Install Tool" and download the installer file. - -![](https://farm1.staticflickr.com/329/19130013736_1850b0d61e_c.jpg) - -Before proceeding to run the installer file, you need to do one additional step if you are using a 64-bit Linux system. - -Since Brother printer drivers are developed for 32-bit Linux, you need to install necessary 32-bit libraries on 64-bit Linux as follows. - -On older Debian (6.0 or earlier) or Ubuntu (11.04 or earlier), install the following package. - - $ sudo apt-get install ia32-libs - -On newer Debian or Ubuntu which has introduced multiarch, you can install the following package instead: - - $ sudo apt-get install lib32z1 lib32ncurses5 - -which replaces ia32-libs package. Or, you can install just: - - $ sudo apt-get install lib32stdc++6 - -If you are using a Red Hat based Linux, you can install: - - $ sudo yum install glibc.i686 - -### Driver Installation ### - -Now go ahead and extract a downloaded driver installer file. - - $ gunzip linux-brprinter-installer-2.0.0-1.gz - -Next, run the driver installer file as follows. - - $ sudo sh ./linux-brprinter-installer-2.0.0-1 - -You will be prompted to type a printer model name. Type the model name of your printer, for example "HL-2270DW". - -![](https://farm1.staticflickr.com/292/18535599323_1a94f6dae5_b.jpg) - -After agreeing to GPL license agreement, accept default answers to any subsequent questions. - -![](https://farm1.staticflickr.com/526/19130014316_5835939501_b.jpg) - -Now LPR/CUPS printer drivers are installed. Proceed to configure your printer next. - -### Printer Configuration ### - -We are going to configure and manage a Brother via CUPS-based web management interface. - -First, verify that CUPS daemon is running successfully. - - $ sudo netstat -nap | grep 631 - -Open a web browser window, and go to http://localhost:631. You will see the following CUPS printer management interface. - -![](https://farm1.staticflickr.com/324/18968588688_202086fc72_c.jpg) - -Go to "Administration" tab, and click on "Manage Printers" under Printers section. - -![](https://farm1.staticflickr.com/484/18533632074_0526cccb86_c.jpg) - -You must see your printer (HL-2270DW) listed in the next page. Click on the printer name. -![](https://farm1.staticflickr.com/501/19159651111_95f6937693_c.jpg) - -In the dropdown menu titled "Administration", choose "Set As Server Default" option. This will make your printer system-wide default. - -![](https://farm1.staticflickr.com/472/19150412212_b37987c359_c.jpg) - -When asked to authenticate yourself, type in your Linux login information. - -![](https://farm1.staticflickr.com/511/18968590168_807e807f73_c.jpg) - -Now the basic configuration step is mostly done. To test print, open any document viewer application (e.g., PDF viwer), and print it. You will see "HL-2270DW" listed and chosen by default in printer setting. - -![](https://farm4.staticflickr.com/3872/18970034679_6d41d75bf9_c.jpg) - -Print should work now. You can see the printer status and manage printer jobs via the same CUPS web interface. - --------------------------------------------------------------------------------- - -via: http://ask.xmodulo.com/install-brother-printer-linux.html - -作者:[Dan Nanni][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://ask.xmodulo.com/author/nanni -[1]:http://xmodulo.com/go/brother_printers -[2]:http://xmodulo.com/go/hl_2270dw -[3]:http://support.brother.com/ diff --git a/translated/tech/20150709 Linux FAQs with Answers--How to install a Brother printer on Linux.md b/translated/tech/20150709 Linux FAQs with Answers--How to install a Brother printer on Linux.md new file mode 100644 index 0000000000..ad90ec75a4 --- /dev/null +++ b/translated/tech/20150709 Linux FAQs with Answers--How to install a Brother printer on Linux.md @@ -0,0 +1,108 @@ +Linux有问必答-- 如何为在Linux中安装兄弟打印机 +================================================================================ +> **提问**: 我有一台兄弟HL-2270DW激光打印机,我想从我的Linux机器上答应文档。我该如何在我的电脑上安装合适的驱动并使用它? + +兄弟牌以买得起的[紧凑型激光打印机][1]而闻名。你可以用低于200美元的价格得到高质量的WiFi/双工激光打印机,而且价格还在下降。最棒的是,它们还提供良好的Linux支持,因此你可以在Linux中下载并安装它们的打印机驱动。我在一年前买了台[HL-2270DW][2],我对它的性能和可靠性都很满意。 + +下面是如何在Linux中安装和配置兄弟打印机驱动。本篇教程中,我会演示安装HL-2270DW激光打印机的USB驱动。首先通过USB线连接你的打印机到Linux上。 + +### 准备 ### + +在准备阶段,进入[兄弟官方支持网站][3],输入你的型号(比如:HL-2270DW)搜索你的兄弟打印机型号。 + +![](https://farm1.staticflickr.com/301/18970034829_6f3a48d817_c.jpg) + +进入下面页面后,选择你的Linux平台。对于Debian、Ubuntu或者其他衍生版,选择“Linux (deb)”。对于Fedora、CentOS或者RHEL选择“Linux (rpm)”。 + +![](https://farm1.staticflickr.com/380/18535558583_cb43240f8a_c.jpg) + +下一页,你会找到你打印机的LPR驱动和CUPS包装器驱动。前者是命令行驱动后者允许你通过网页管理和配置你的打印机。尤其是基于CUPS的GUI对(本地、远程)打印机维护非常有用。建议你安装这两个驱动。点击“Driver Install Tool”下载安装文件。 + +![](https://farm1.staticflickr.com/329/19130013736_1850b0d61e_c.jpg) + +运行安装文件之前,你需要在64位的Linux系统上做另外一件事情。 + +因为兄弟打印机驱动是为32位的Linux系统开发的,因此你需要按照下面的方法安装32位的库。 + +在早期的Debian(6.0或者更早期)或者Ubuntu(11.04或者更早期),安装下面的包。 + + $ sudo apt-get install ia32-libs + +对于已经引入多架构的新的Debian或者Ubuntu而言,你可以安装下面的包: + + $ sudo apt-get install lib32z1 lib32ncurses5 + +上面的包代替了ia32-libs包。或者你只需要安装: + + $ sudo apt-get install lib32stdc++6 + +如果你使用的是基于Red Hat的Linux,你可以安装: + + $ sudo yum install glibc.i686 + +### 驱动安装 ### + +现在解压下载的驱动文件。 + + $ gunzip linux-brprinter-installer-2.0.0-1.gz + +接下来像下面这样运行安装文件。 + + $ sudo sh ./linux-brprinter-installer-2.0.0-1 + +你会被要求输入打印机的型号。输入你打印机的型号,比如“HL-2270DW”。 + +![](https://farm1.staticflickr.com/292/18535599323_1a94f6dae5_b.jpg) + +同意GPL协议直呼,接受接下来的任何默认问题。 + +![](https://farm1.staticflickr.com/526/19130014316_5835939501_b.jpg) + +现在LPR/CUPS打印机驱动已经安装好了。接下来要配置你的打印机了。 + +### 打印机配置 ### + +我接下来就要通过基于CUPS的网页管理和配置兄弟打印机了。 + +首先验证CUPS守护进程已经启动。 + + $ sudo netstat -nap | grep 631 + +打开一个浏览器输入http://localhost:631。你会下面的打印机管理界面。 + +![](https://farm1.staticflickr.com/324/18968588688_202086fc72_c.jpg) + +进入“Administration”选项卡,点击打印机选项下的“Manage Printers”。 + +![](https://farm1.staticflickr.com/484/18533632074_0526cccb86_c.jpg) + +你一定在下面的页面中看到了你的打印机(HL-2270DW)。点击打印机名。 + +在下拉菜单“Administration”中,选择“Set As Server Default”。这会设置你的打印机位系统默认打印机。 + +![](https://farm1.staticflickr.com/472/19150412212_b37987c359_c.jpg) + +当被要求验证时,输入你的Linux登录信息。 + +![](https://farm1.staticflickr.com/511/18968590168_807e807f73_c.jpg) + +现在基础配置已经基本完成了。为了测试打印,打开任何文档浏览程序(比如:PDF浏览器)并打印。你会看到“HL-2270DW”被列出并被作为默认的打印机设置。 + +![](https://farm4.staticflickr.com/3872/18970034679_6d41d75bf9_c.jpg) + +打印机应该可以工作了。你可以通过CUPS的网页看到打印机状态和管理打印机任务。 + +-------------------------------------------------------------------------------- + +via: http://ask.xmodulo.com/install-brother-printer-linux.html + +作者:[Dan Nanni][a] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://ask.xmodulo.com/author/nanni +[1]:http://xmodulo.com/go/brother_printers +[2]:http://xmodulo.com/go/hl_2270dw +[3]:http://support.brother.com/ From 13495e4204e2e95d945a99b5711fffbb45668309 Mon Sep 17 00:00:00 2001 From: martin qi Date: Sat, 11 Jul 2015 13:45:37 +0800 Subject: [PATCH 568/965] Delete 20150401 ZMap Documentation.md --- sources/tech/20150401 ZMap Documentation.md | 745 -------------------- 1 file changed, 745 deletions(-) delete mode 100644 sources/tech/20150401 ZMap Documentation.md diff --git a/sources/tech/20150401 ZMap Documentation.md b/sources/tech/20150401 ZMap Documentation.md deleted file mode 100644 index b773fb4aaf..0000000000 --- a/sources/tech/20150401 ZMap Documentation.md +++ /dev/null @@ -1,745 +0,0 @@ -translating... - -ZMap Documentation -================================================================================ -1. Getting Started with ZMap -1. Scanning Best Practices -1. Command Line Arguments -1. Additional Information - 1. TCP SYN Probe Module - 1. ICMP Echo Probe Module - 1. UDP Probe Module - 1. Configuration Files - 1. Verbosity - 1. Results Output - 1. Blacklisting - 1. Rate Limiting and Sampling - 1. Sending Multiple Probes -1. Extending ZMap - 1. Sample Applications - 1. Writing Probe and Output Modules - ----------- - -### Getting Started with ZMap ### - -ZMap is designed to perform comprehensive scans of the IPv4 address space or large portions of it. While ZMap is a powerful tool for researchers, please keep in mind that by running ZMap, you are potentially scanning the ENTIRE IPv4 address space at over 1.4 million packets per second. Before performing even small scans, we encourage users to contact their local network administrators and consult our list of scanning best practices. - -By default, ZMap will perform a TCP SYN scan on the specified port at the maximum rate possible. A more conservative configuration that will scan 10,000 random addresses on port 80 at a maximum 10 Mbps can be run as follows: - - $ zmap --bandwidth=10M --target-port=80 --max-targets=10000 --output-file=results.csv - -Or more concisely specified as: - - $ zmap -B 10M -p 80 -n 10000 -o results.csv - -ZMap can also be used to scan specific subnets or CIDR blocks. For example, to scan only 10.0.0.0/8 and 192.168.0.0/16 on port 80, run: - - zmap -p 80 -o results.csv 10.0.0.0/8 192.168.0.0/16 - -If the scan started successfully, ZMap will output status updates every one second similar to the following: - - 0% (1h51m left); send: 28777 562 Kp/s (560 Kp/s avg); recv: 1192 248 p/s (231 p/s avg); hits: 0.04% - 0% (1h51m left); send: 34320 554 Kp/s (559 Kp/s avg); recv: 1442 249 p/s (234 p/s avg); hits: 0.04% - 0% (1h50m left); send: 39676 535 Kp/s (555 Kp/s avg); recv: 1663 220 p/s (232 p/s avg); hits: 0.04% - 0% (1h50m left); send: 45372 570 Kp/s (557 Kp/s avg); recv: 1890 226 p/s (232 p/s avg); hits: 0.04% - -These updates provide information about the current state of the scan and are of the following form: %-complete (est time remaining); packets-sent curr-send-rate (avg-send-rate); recv: packets-recv recv-rate (avg-recv-rate); hits: hit-rate - -If you do not know the scan rate that your network can support, you may want to experiment with different scan rates or bandwidth limits to find the fastest rate that your network can support before you see decreased results. - -By default, ZMap will output the list of distinct IP addresses that responded successfully (e.g. with a SYN ACK packet) similar to the following. There are several additional formats (e.g. JSON and Redis) for outputting results as well as options for producing programmatically parsable scan statistics. As wells, additional output fields can be specified and the results can be filtered using an output filter. - - 115.237.116.119 - 23.9.117.80 - 207.118.204.141 - 217.120.143.111 - 50.195.22.82 - -We strongly encourage you to use a blacklist file, to exclude both reserved/unallocated IP space (e.g. multicast, RFC1918), as well as networks that request to be excluded from your scans. By default, ZMap will utilize a simple blacklist file containing reserved and unallocated addresses located at `/etc/zmap/blacklist.conf`. If you find yourself specifying certain settings, such as your maximum bandwidth or blacklist file every time you run ZMap, you can specify these in `/etc/zmap/zmap.conf` or use a custom configuration file. - -If you are attempting to troubleshoot scan related issues, there are several options to help debug. First, it is possible can perform a dry run scan in order to see the packets that would be sent over the network by adding the `--dryrun` flag. As well, it is possible to change the logging verbosity by setting the `--verbosity=n` flag. - ----------- - -### Scanning Best Practices ### - -We offer these suggestions for researchers conducting Internet-wide scans as guidelines for good Internet citizenship. - -- Coordinate closely with local network administrators to reduce risks and handle inquiries -- Verify that scans will not overwhelm the local network or upstream provider -- Signal the benign nature of the scans in web pages and DNS entries of the source addresses -- Clearly explain the purpose and scope of the scans in all communications -- Provide a simple means of opting out and honor requests promptly -- Conduct scans no larger or more frequent than is necessary for research objectives -- Spread scan traffic over time or source addresses when feasible - -It should go without saying that scan researchers should refrain from exploiting vulnerabilities or accessing protected resources, and should comply with any special legal requirements in their jurisdictions. - ----------- - -### Command Line Arguments ### - -#### Common Options #### - -These options are the most common options when performing a simple scan. We note that some options are dependent on the probe module or output module used (e.g. target port is not used when performing an ICMP Echo Scan). - - -**-p, --target-port=port** - -TCP port number to scan (e.g. 443) - -**-o, --output-file=name** - -Write results to this file. Use - for stdout - -**-b, --blacklist-file=path** - -File of subnets to exclude, in CIDR notation (e.g. 192.168.0.0/16), one-per line. It is recommended you use this to exclude RFC 1918 addresses, multicast, IANA reserved space, and other IANA special-purpose addresses. An example blacklist file is provided in conf/blacklist.example for this purpose. - -#### Scan Options #### - -**-n, --max-targets=n** - -Cap the number of targets to probe. This can either be a number (e.g. `-n 1000`) or a percentage (e.g. `-n 0.1%`) of the scannable address space (after excluding blacklist) - -**-N, --max-results=n** - -Exit after receiving this many results - -**-t, --max-runtime=secs** - -Cap the length of time for sending packets - -**-r, --rate=pps** - -Set the send rate in packets/sec - -**-B, --bandwidth=bps** - -Set the send rate in bits/second (supports suffixes G, M, and K (e.g. `-B 10M` for 10 mbps). This overrides the `--rate` flag. - -**-c, --cooldown-time=secs** - -How long to continue receiving after sending has completed (default=8) - -**-e, --seed=n** - -Seed used to select address permutation. Use this if you want to scan addresses in the same order for multiple ZMap runs. - -**--shards=n** - -Split the scan up into N shards/partitions among different instances of zmap (default=1). When sharding, `--seed` is required - -**--shard=n** - -Set which shard to scan (default=0). Shards are indexed in the range [0, N), where N is the total number of shards. When sharding `--seed` is required. - -**-T, --sender-threads=n** - -Threads used to send packets (default=1) - -**-P, --probes=n** - -Number of probes to send to each IP (default=1) - -**-d, --dryrun** - -Print out each packet to stdout instead of sending it (useful for debugging) - -#### Network Options #### - -**-s, --source-port=port|range** - -Source port(s) to send packets from - -**-S, --source-ip=ip|range** - -Source address(es) to send packets from. Either single IP or range (e.g. 10.0.0.1-10.0.0.9) - -**-G, --gateway-mac=addr** - -Gateway MAC address to send packets to (in case auto-detection does not work) - -**-i, --interface=name** - -Network interface to use - -#### Probe Options #### - -ZMap allows users to specify and write their own probe modules for use with ZMap. Probe modules are responsible for generating probe packets to send, and processing responses from hosts. - -**--list-probe-modules** - -List available probe modules (e.g. tcp_synscan) - -**-M, --probe-module=name** - -Select probe module (default=tcp_synscan) - -**--probe-args=args** - -Arguments to pass to probe module - -**--list-output-fields** - -List the fields the selected probe module can send to the output module - -#### Output Options #### - -ZMap allows users to specify and write their own output modules for use with ZMap. Output modules are responsible for processing the fieldsets returned by the probe module, and outputing them to the user. Users can specify output fields, and write filters over the output fields. - -**--list-output-modules** - -List available output modules (e.g. tcp_synscan) - -**-O, --output-module=name** - -Select output module (default=csv) - -**--output-args=args** - -Arguments to pass to output module - -**-f, --output-fields=fields** - -Comma-separated list of fields to output - -**--output-filter** - -Specify an output filter over the fields defined by the probe module - -#### Additional Options #### - -**-C, --config=filename** - -Read a configuration file, which can specify any other options. - -**-q, --quiet** - -Do not print status updates once per second - -**-g, --summary** - -Print configuration and summary of results at the end of the scan - -**-v, --verbosity=n** - -Level of log detail (0-5, default=3) - -**-h, --help** - -Print help and exit - -**-V, --version** - -Print version and exit - ----------- - -### Additional Information ### - -#### TCP SYN Scans #### - -When performing a TCP SYN scan, ZMap requires a single target port and supports specifying a range of source ports from which the scan will originate. - -**-p, --target-port=port** - -TCP port number to scan (e.g. 443) - -**-s, --source-port=port|range** - -Source port(s) for scan packets (e.g. 40000-50000) - -**Warning!** ZMap relies on the Linux kernel to respond to SYN/ACK packets with RST packets in order to close connections opened by the scanner. This occurs because ZMap sends packets at the Ethernet layer in order to reduce overhead otherwise incurred in the kernel from tracking open TCP connections and performing route lookups. As such, if you have a firewall rule that tracks established connections such as a netfilter rule similar to `-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT`, this will block SYN/ACK packets from reaching the kernel. This will not prevent ZMap from recording responses, but it will prevent RST packets from being sent back, ultimately using up a connection on the scanned host until your connection times out. We strongly recommend that you select a set of unused ports on your scanning host which can be allowed access in your firewall and specifying this port range when executing ZMap, with the `-s` flag (e.g. `-s '50000-60000'`). - -#### ICMP Echo Request Scans #### - -While ZMap performs TCP SYN scans by default, it also supports ICMP echo request scans in which an ICMP echo request packet is sent to each host and the type of ICMP response received in reply is denoted. An ICMP scan can be performed by selecting the icmp_echoscan scan module similar to the following: - - $ zmap --probe-module=icmp_echoscan - -#### UDP Datagram Scans #### - -ZMap additionally supports UDP probes, where it will send out an arbitrary UDP datagram to each host, and receive either UDP or ICMP Unreachable responses. ZMap supports four different methods of setting the UDP payload through the --probe-args command-line option. These are 'text' for ASCII-printable payloads, 'hex' for hexadecimal payloads set on the command-line, 'file' for payloads contained in an external file, and 'template' for payloads that require dynamic field generation. In order to obtain the UDP response, make sure that you specify 'data' as one of the fields to report with the -f option. - -The example below will send the two bytes 'ST', a PCAnwywhere 'status' request, to UDP port 5632. - - $ zmap -M udp -p 5632 --probe-args=text:ST -N 100 -f saddr,data -o - - -The example below will send the byte '0x02', a SQL Server 'client broadcast' request, to UDP port 1434. - - $ zmap -M udp -p 1434 --probe-args=hex:02 -N 100 -f saddr,data -o - - -The example below will send a NetBIOS status request to UDP port 137. This uses a payload file that is included with the ZMap distribution. - - $ zmap -M udp -p 1434 --probe-args=file:netbios_137.pkt -N 100 -f saddr,data -o - - -The example below will send a SIP 'OPTIONS' request to UDP port 5060. This uses a template file that is included with the ZMap distribution. - - $ zmap -M udp -p 1434 --probe-args=file:sip_options.tpl -N 100 -f saddr,data -o - - -UDP payload templates are still experimental. You may encounter crashes when more using more than one send thread (-T) and there is a significant decrease in performance compared to static payloads. A template is simply a payload file that contains one or more field specifiers enclosed in a ${} sequence. Some protocols, notably SIP, require the payload to reflect the source and destination of the packet. Other protocols, such as portmapper and DNS, contain fields that should be randomized per request or risk being dropped by multi-homed systems scanned by ZMap. - -The payload template below will send a SIP OPTIONS request to every destination: - - OPTIONS sip:${RAND_ALPHA=8}@${DADDR} SIP/2.0 - Via: SIP/2.0/UDP ${SADDR}:${SPORT};branch=${RAND_ALPHA=6}.${RAND_DIGIT=10};rport;alias - From: sip:${RAND_ALPHA=8}@${SADDR}:${SPORT};tag=${RAND_DIGIT=8} - To: sip:${RAND_ALPHA=8}@${DADDR} - Call-ID: ${RAND_DIGIT=10}@${SADDR} - CSeq: 1 OPTIONS - Contact: sip:${RAND_ALPHA=8}@${SADDR}:${SPORT} - Content-Length: 0 - Max-Forwards: 20 - User-Agent: ${RAND_ALPHA=8} - Accept: text/plain - -In the example above, note that line endings are \r\n and the end of this request must contain \r\n\r\n for most SIP implementations to correcly process it. A working example is included in the examples/udp-payloads directory of the ZMap source tree (sip_options.tpl). - -The following template fields are currently implemented: - - -- **SADDR**: Source IP address in dotted-quad format -- **SADDR_N**: Source IP address in network byte order -- **DADDR**: Destination IP address in dotted-quad format -- **DADDR_N**: Destination IP address in network byte order -- **SPORT**: Source port in ascii format -- **SPORT_N**: Source port in network byte order -- **DPORT**: Destination port in ascii format -- **DPORT_N**: Destination port in network byte order -- **RAND_BYTE**: Random bytes (0-255), length specified with =(length) parameter -- **RAND_DIGIT**: Random digits from 0-9, length specified with =(length) parameter -- **RAND_ALPHA**: Random mixed-case letters from A-Z, length specified with =(length) parameter -- **RAND_ALPHANUM**: Random mixed-case letters from A-Z and digits from 0-9, length specified with =(length) parameter - -### Configuration Files ### - -ZMap supports configuration files instead of requiring all options to be specified on the command-line. A configuration can be created by specifying one long-name option and the value per line such as: - - interface "eth1" - source-ip 1.1.1.4-1.1.1.8 - gateway-mac b4:23:f9:28:fa:2d # upstream gateway - cooldown-time 300 # seconds - blacklist-file /etc/zmap/blacklist.conf - output-file ~/zmap-output - quiet - summary - -ZMap can then be run with a configuration file and specifying any additional necessary parameters: - - $ zmap --config=~/.zmap.conf --target-port=443 - -### Verbosity ### - -There are several types of on-screen output that ZMap produces. By default, ZMap will print out basic progress information similar to the following every 1 second. This can be disabled by setting the `--quiet` flag. - - 0:01 12%; send: 10000 done (15.1 Kp/s avg); recv: 144 143 p/s (141 p/s avg); hits: 1.44% - -ZMap also prints out informational messages during scanner configuration such as the following, which can be controlled with the `--verbosity` argument. - - Aug 11 16:16:12.813 [INFO] zmap: started - Aug 11 16:16:12.817 [DEBUG] zmap: no interface provided. will use eth0 - Aug 11 16:17:03.971 [DEBUG] cyclic: primitive root: 3489180582 - Aug 11 16:17:03.971 [DEBUG] cyclic: starting point: 46588 - Aug 11 16:17:03.975 [DEBUG] blacklist: 3717595507 addresses allowed to be scanned - Aug 11 16:17:03.975 [DEBUG] send: will send from 1 address on 28233 source ports - Aug 11 16:17:03.975 [DEBUG] send: using bandwidth 10000000 bits/s, rate set to 14880 pkt/s - Aug 11 16:17:03.985 [DEBUG] recv: thread started - -ZMap also supports printing out a grep-able summary at the end of the scan, similar to below, which can be invoked with the `--summary` flag. - - cnf target-port 443 - cnf source-port-range-begin 32768 - cnf source-port-range-end 61000 - cnf source-addr-range-begin 1.1.1.4 - cnf source-addr-range-end 1.1.1.8 - cnf maximum-packets 4294967295 - cnf maximum-runtime 0 - cnf permutation-seed 0 - cnf cooldown-period 300 - cnf send-interface eth1 - cnf rate 45000 - env nprocessors 16 - exc send-start-time Fri Jan 18 01:47:35 2013 - exc send-end-time Sat Jan 19 00:47:07 2013 - exc recv-start-time Fri Jan 18 01:47:35 2013 - exc recv-end-time Sat Jan 19 00:52:07 2013 - exc sent 3722335150 - exc blacklisted 572632145 - exc first-scanned 1318129262 - exc hit-rate 0.874102 - exc synack-received-unique 32537000 - exc synack-received-total 36689941 - exc synack-cooldown-received-unique 193 - exc synack-cooldown-received-total 1543 - exc rst-received-unique 141901021 - exc rst-received-total 166779002 - adv source-port-secret 37952 - adv permutation-gen 4215763218 - -### Results Output ### - -ZMap can produce results in several formats through the use of **output modules**. By default, ZMap only supports **csv** output, however support for **redis** and **json** can be compiled in. The results sent to these output modules may be filtered using an **output filter**. The fields the output module writes are specified by the user. By default, ZMap will return results in csv format and if no output file is specified, ZMap will not produce specific results. It is also possible to write your own output module; see Writing Output Modules for information. - -**-o, --output-file=p** - -File to write output to - -**-O, --output-module=p** - -Invoke a custom output module - - -**-f, --output-fields=p** - -Comma-separated list of fields to output - -**--output-filter=filter** - -Specify an output filter over fields for a given probe - -**--list-output-modules** - -Lists available output modules - -**--list-output-fields** - -List available output fields for a given probe - -#### Output Fields #### - -ZMap has a variety of fields it can output beyond IP address. These fields can be viewed for a given probe module by running with the `--list-output-fields` flag. - - $ zmap --probe-module="tcp_synscan" --list-output-fields - saddr string: source IP address of response - saddr-raw int: network order integer form of source IP address - daddr string: destination IP address of response - daddr-raw int: network order integer form of destination IP address - ipid int: IP identification number of response - ttl int: time-to-live of response packet - sport int: TCP source port - dport int: TCP destination port - seqnum int: TCP sequence number - acknum int: TCP acknowledgement number - window int: TCP window - classification string: packet classification - success int: is response considered success - repeat int: is response a repeat response from host - cooldown int: Was response received during the cooldown period - timestamp-str string: timestamp of when response arrived in ISO8601 format. - timestamp-ts int: timestamp of when response arrived in seconds since Epoch - timestamp-us int: microsecond part of timestamp (e.g. microseconds since 'timestamp-ts') - -To select which fields to output, any combination of the output fields can be specified as a comma-separated list using the `--output-fields=fields` or `-f` flags. Example: - - $ zmap -p 80 -f "response,saddr,daddr,sport,seq,ack,in_cooldown,is_repeat,timestamp" -o output.csv - -#### Filtering Output #### - -Results generated by a probe module can be filtered before being passed to the output module. Filters are defined over the output fields of a probe module. Filters are written in a simple filtering language, similar to SQL, and are passed to ZMap using the **--output-filter** option. Output filters are commonly used to filter out duplicate results, or to only pass only sucessful responses to the output module. - -Filter expressions are of the form ` `. The type of `` must be either a string or unsigned integer literal, and match the type of ``. The valid operations for integer comparisons are `= !=, <, >, <=, >=`. The operations for string comparisons are =, !=. The `--list-output-fields` flag will print what fields and types are available for the selected probe module, and then exit. - -Compound filter expressions may be constructed by combining filter expressions using parenthesis to specify order of operations, the `&&` (logical AND) and `||` (logical OR) operators. - -**Examples** - -Write a filter for only successful, non-duplicate responses - - --output-filter="success = 1 && repeat = 0" - -Filter for packets that have classification RST and a TTL greater than 10, or for packets with classification SYNACK - - --output-filter="(classification = rst && ttl > 10) || classification = synack" - -#### CSV #### - -The csv module will produce a comma-separated value file of the output fields requested. For example, the following command produces the following CSV in a file called `output.csv`. - - $ zmap -p 80 -f "response,saddr,daddr,sport,seq,ack,in_cooldown,is_repeat,timestamp" -o output.csv - ----------- - - response, saddr, daddr, sport, dport, seq, ack, in_cooldown, is_repeat, timestamp - synack, 159.174.153.144, 10.0.0.9, 80, 40555, 3050964427, 3515084203, 0, 0,2013-08-15 18:55:47.681 - rst, 141.209.175.1, 10.0.0.9, 80, 40136, 0, 3272553764, 0, 0,2013-08-15 18:55:47.683 - rst, 72.36.213.231, 10.0.0.9, 80, 56642, 0, 2037447916, 0, 0,2013-08-15 18:55:47.691 - rst, 148.8.49.150, 10.0.0.9, 80, 41672, 0, 1135824975, 0, 0,2013-08-15 18:55:47.692 - rst, 50.165.166.206, 10.0.0.9, 80, 38858, 0, 535206863, 0, 0,2013-08-15 18:55:47.694 - rst, 65.55.203.135, 10.0.0.9, 80, 50008, 0, 4071709905, 0, 0,2013-08-15 18:55:47.700 - synack, 50.57.166.186, 10.0.0.9, 80, 60650, 2813653162, 993314545, 0, 0,2013-08-15 18:55:47.704 - synack, 152.75.208.114, 10.0.0.9, 80, 52498, 460383682, 4040786862, 0, 0,2013-08-15 18:55:47.707 - synack, 23.72.138.74, 10.0.0.9, 80, 33480, 810393698, 486476355, 0, 0,2013-08-15 18:55:47.710 - -#### Redis #### - -The redis output module allows addresses to be added to a Redis queue instead of being saved to file which ultimately allows ZMap to be incorporated with post processing tools. - -**Heads Up!** ZMap does not build with Redis support by default. If you are building ZMap from source, you can build with Redis support by running CMake with `-DWITH_REDIS=ON`. - -### Blacklisting and Whitelisting ### - -ZMap supports both blacklisting and whitelisting network prefixes. If ZMap is not provided with blacklist or whitelist parameters, ZMap will scan all IPv4 addresses (including local, reserved, and multicast addresses). If a blacklist file is specified, network prefixes in the blacklisted segments will not be scanned; if a whitelist file is provided, only network prefixes in the whitelist file will be scanned. A whitelist and blacklist file can be used in coordination; the blacklist has priority over the whitelist (e.g. if you have whitelisted 10.0.0.0/8 and blacklisted 10.1.0.0/16, then 10.1.0.0/16 will not be scanned). Whitelist and blacklist files can be specified on the command-line as follows: - -**-b, --blacklist-file=path** - -File of subnets to blacklist in CIDR notation, e.g. 192.168.0.0/16 - -**-w, --whitelist-file=path** - -File of subnets to limit scan to in CIDR notation, e.g. 192.168.0.0/16 - -Blacklist files should be formatted with a single network prefix in CIDR notation per line. Comments are allowed using the `#` character. Example: - - # From IANA IPv4 Special-Purpose Address Registry - # http://www.iana.org/assignments/iana-ipv4-special-registry/iana-ipv4-special-registry.xhtml - # Updated 2013-05-22 - - 0.0.0.0/8 # RFC1122: "This host on this network" - 10.0.0.0/8 # RFC1918: Private-Use - 100.64.0.0/10 # RFC6598: Shared Address Space - 127.0.0.0/8 # RFC1122: Loopback - 169.254.0.0/16 # RFC3927: Link Local - 172.16.0.0/12 # RFC1918: Private-Use - 192.0.0.0/24 # RFC6890: IETF Protocol Assignments - 192.0.2.0/24 # RFC5737: Documentation (TEST-NET-1) - 192.88.99.0/24 # RFC3068: 6to4 Relay Anycast - 192.168.0.0/16 # RFC1918: Private-Use - 192.18.0.0/15 # RFC2544: Benchmarking - 198.51.100.0/24 # RFC5737: Documentation (TEST-NET-2) - 203.0.113.0/24 # RFC5737: Documentation (TEST-NET-3) - 240.0.0.0/4 # RFC1112: Reserved - 255.255.255.255/32 # RFC0919: Limited Broadcast - - # From IANA Multicast Address Space Registry - # http://www.iana.org/assignments/multicast-addresses/multicast-addresses.xhtml - # Updated 2013-06-25 - - 224.0.0.0/4 # RFC5771: Multicast/Reserved - -If you are looking to scan only a random portion of the internet, checkout Sampling, instead of using whitelisting and blacklisting. - -**Heads Up!** The default ZMap configuration uses the blacklist file at `/etc/zmap/blacklist.conf`, which contains locally scoped address space and reserved IP ranges. The default configuration can be changed by editing `/etc/zmap/zmap.conf`. - -### Rate Limiting and Sampling ### - -By default, ZMap will scan at the fastest rate that your network adaptor supports. In our experiences on commodity hardware, this is generally around 95-98% of the theoretical speed of gigabit Ethernet, which may be faster than your upstream provider can handle. ZMap will not automatically adjust its send-rate based on your upstream provider. You may need to manually adjust your send-rate to reduce packet drops and incorrect results. - -**-r, --rate=pps** - -Set maximum send rate in packets/sec - -**-B, --bandwidth=bps** - -Set send rate in bits/sec (supports suffixes G, M, and K). This overrides the --rate flag. - -ZMap also allows random sampling of the IPv4 address space by specifying max-targets and/or max-runtime. Because hosts are scanned in a random permutation generated per scan instantiation, limiting a scan to n hosts will perform a random sampling of n hosts. Command-line options: - -**-n, --max-targets=n** - -Cap number of targets to probe - -**-N, --max-results=n** - -Cap number of results (exit after receiving this many positive results) - -**-t, --max-runtime=s** - -Cap length of time for sending packets (in seconds) - -**-s, --seed=n** - -Seed used to select address permutation. Specify the same seed in order to scan addresses in the same order for different ZMap runs. - -For example, if you wanted to scan the same one million hosts on the Internet for multiple scans, you could set a predetermined seed and cap the number of scanned hosts similar to the following: - - zmap -p 443 -s 3 -n 1000000 -o results - -In order to determine which one million hosts were going to be scanned, you could run the scan in dry-run mode which will print out the packets that would be sent instead of performing the actual scan. - - zmap -p 443 -s 3 -n 1000000 --dryrun | grep daddr - | awk -F'daddr: ' '{print $2}' | sed 's/ |.*//;' - -### Sending Multiple Packets ### - -ZMap supports sending multiple probes to each host. Increasing this number both increases scan time and hosts reached. However, we find that the increase in scan time (~100% per additional probe) greatly outweighs the increase in hosts reached (~1% per additional probe). - -**-P, --probes=n** - -The number of unique probes to send to each IP (default=1) - ----------- - -### Sample Applications ### - -ZMap is designed for initiating contact with a large number of hosts and finding ones that respond positively. However, we realize that many users will want to perform follow-up processing, such as performing an application level handshake. For example, users who perform a TCP SYN scan on port 80 might want to perform a simple GET request and users who scan port 443 may be interested in completing a TLS handshake. - -#### Banner Grab #### - -We have included a sample application, banner-grab, with ZMap that enables users to receive messages from listening TCP servers. Banner-grab connects to the provided servers, optionally sends a message, and prints out the first message received from the server. This tool can be used to fetch banners such as HTTP server responses to specific commands, telnet login prompts, or SSH server strings. - -This example finds 1000 servers listening on port 80, and sends a simple GET request to each, storing their base-64 encoded responses in http-banners.out - - $ zmap -p 80 -N 1000 -B 10M -o - | ./banner-grab-tcp -p 80 -c 500 -d ./http-req > out - -For more details on using `banner-grab`, see the README file in `examples/banner-grab`. - -**Heads Up!** ZMap and banner-grab can have significant performance and accuracy impact on one another if run simultaneously (as in the example). Make sure not to let ZMap saturate banner-grab-tcp's concurrent connections, otherwise banner-grab will fall behind reading stdin, causing ZMap to block on writing stdout. We recommend using a slower scanning rate with ZMap, and increasing the concurrency of banner-grab-tcp to no more than 3000 (Note that > 1000 concurrent connections requires you to use `ulimit -SHn 100000` and `ulimit -HHn 100000` to increase the maximum file descriptors per process). These parameters will of course be dependent on your server performance, and hit-rate; we encourage developers to experiment with small samples before running a large scan. - -#### Forge Socket #### - -We have also included a form of banner-grab, called forge-socket, that reuses the SYN-ACK sent from the server for the connection that ultimately fetches the banner. In `banner-grab-tcp`, ZMap sends a SYN to each server, and listening servers respond with a SYN+ACK. The ZMap host's kernel receives this, and sends a RST, as no active connection is associated with that packet. The banner-grab program must then create a new TCP connection to the same server to fetch data from it. - -In forge-socket, we utilize a kernel module by the same name, that allows us to create a connection with arbitrary TCP parameters. This enables us to suppress the kernel's RST packet, and instead create a socket that will reuse the SYN+ACK's parameters, and send and receive data through this socket as we would any normally connected socket. - -To use forge-socket, you will need the forge-socket kernel module, available from [github][1]. You should git clone `git@github.com:ewust/forge_socket.git` in the ZMap root source directory, and then cd into the forge_socket directory, and run make. Install the kernel module with `insmod forge_socket.ko` as root. - -You must also tell the kernel not to send RST packets. An easy way to disable RST packets system wide is to use **iptables**. `iptables -A OUTPUT -p tcp -m tcp --tcp-flgas RST,RST RST,RST -j DROP` as root will do this, though you may also add an optional --dport X to limit this to the port (X) you are scanning. To remove this after your scan completes, you can run `iptables -D OUTPUT -p tcp -m tcp --tcp-flags RST,RST RST,RST -j DROP` as root. - -Now you should be able to build the forge-socket ZMap example program. To run it, you must use the **extended_file** ZMap output module: - - $ zmap -p 80 -N 1000 -B 10M -O extended_file -o - | \ - ./forge-socket -c 500 -d ./http-req > ./http-banners.out - -See the README in `examples/forge-socket` for more details. - ----------- - -### Writing Probe and Output Modules ### - -ZMap can be extended to support different types of scanning through **probe modules** and additional types of results **output through** output modules. Registered probe and output modules can be listed through the command-line interface: - -**--list-probe-modules** - -Lists installed probe modules - -**--list-output-modules** - -Lists installed output modules - -#### Output Modules #### - -ZMap output and post-processing can be extended by implementing and registering **output modules** with the scanner. Output modules receive a callback for every received response packet. While the default provided modules provide simple output, these modules are also capable of performing additional post-processing (e.g. tracking duplicates or outputting numbers in terms of AS instead of IP address) - -Output modules are created by defining a new output_module struct and registering it in [output_modules.c][2]: - - typedef struct output_module { - const char *name; // how is output module referenced in the CLI - unsigned update_interval; // how often is update called in seconds - - output_init_cb init; // called at scanner initialization - output_update_cb start; // called at the beginning of scanner - output_update_cb update; // called every update_interval seconds - output_update_cb close; // called at scanner termination - - output_packet_cb process_ip; // called when a response is received - - const char *helptext; // Printed when --list-output-modules is called - - } output_module_t; - -Output modules must have a name, which is how they are referenced on the command-line and generally implement `success_ip` and oftentimes `other_ip` callback. The process_ip callback is called for every response packet that is received and passed through the output filter by the current **probe module**. The response may or may not be considered a success (e.g. it could be a TCP RST). These callbacks must define functions that match the `output_packet_cb` definition: - - int (*output_packet_cb) ( - - ipaddr_n_t saddr, // IP address of scanned host in network-order - ipaddr_n_t daddr, // destination IP address in network-order - - const char* response_type, // send-module classification of packet - - int is_repeat, // {0: first response from host, 1: subsequent responses} - int in_cooldown, // {0: not in cooldown state, 1: scanner in cooldown state} - - const u_char* packet, // pointer to struct iphdr of IP packet - size_t packet_len // length of packet in bytes - ); - -An output module can also register callbacks to be executed at scanner initialization (tasks such as opening an output file), start of the scan (tasks such as documenting blacklisted addresses), during regular intervals during the scan (tasks such as progress updates), and close (tasks such as closing any open file descriptors). These callbacks are provided with complete access to the scan configuration and current state: - - int (*output_update_cb)(struct state_conf*, struct state_send*, struct state_recv*); - -which are defined in [output_modules.h][3]. An example is available at [src/output_modules/module_csv.c][4]. - -#### Probe Modules #### - -Packets are constructed using probe modules which allow abstracted packet creation and response classification. ZMap comes with two scan modules by default: `tcp_synscan` and `icmp_echoscan`. By default, ZMap uses `tcp_synscan`, which sends TCP SYN packets, and classifies responses from each host as open (received SYN+ACK) or closed (received RST). ZMap also allows developers to write their own probe modules for use with ZMap, using the following API. - -Each type of scan is implemented by developing and registering the necessary callbacks in a `send_module_t` struct: - - typedef struct probe_module { - const char *name; // how scan is invoked on command-line - size_t packet_length; // how long is probe packet (must be static size) - - const char *pcap_filter; // PCAP filter for collecting responses - size_t pcap_snaplen; // maximum number of bytes for libpcap to capture - - uint8_t port_args; // set to 1 if ZMap requires a --target-port be - // specified by the user - - probe_global_init_cb global_initialize; // called once at scanner initialization - probe_thread_init_cb thread_initialize; // called once for each thread packet buffer - probe_make_packet_cb make_packet; // called once per host to update packet - probe_validate_packet_cb validate_packet; // called once per received packet, - // return 0 if packet is invalid, - // non-zero otherwise. - - probe_print_packet_cb print_packet; // called per packet if in dry-run mode - probe_classify_packet_cb process_packet; // called by receiver to classify response - probe_close_cb close; // called at scanner termination - - fielddef_t *fields // Definitions of the fields specific to this module - int numfields // Number of fields - - } probe_module_t; - -At scanner initialization, `global_initialize` is called once and can be utilized to perform any necessary global configuration or initialization. However, `global_initialize` does not have access to the packet buffer which is thread-specific. Instead, `thread_initialize` is called at the initialization of each sender thread and is provided with access to the buffer that will be used for constructing probe packets along with global source and destination values. This callback should be used to construct the host agnostic packet structure such that only specific values (e.g. destination host and checksum) need to be be updated for each host. For example, the Ethernet header will not change between headers (minus checksum which is calculated in hardware by the NIC) and therefore can be defined ahead of time in order to reduce overhead at scan time. - -The `make_packet` callback is called for each host that is scanned to allow the **probe module** to update host specific values and is provided with IP address values, an opaque validation string, and probe number (shown below). The probe module is responsible for placing as much of the verification string into the probe, in such a way that when a valid response is returned by a server, the probe module can verify that it is present. For example, for a TCP SYN scan, the tcp_synscan probe module can use the TCP source port and sequence number to store the validation string. Response packets (SYN+ACKs) will contain the expected values in the destination port and acknowledgement number. - - int make_packet( - void *packetbuf, // packet buffer - ipaddr_n_t src_ip, // source IP in network-order - ipaddr_n_t dst_ip, // destination IP in network-order - uint32_t *validation, // validation string to place in probe - int probe_num // if sending multiple probes per host, - // this will be which probe number for this - // host we are currently sending - ); - -Scan modules must also define `pcap_filter`, `validate_packet`, and `process_packet`. Only packets that match the PCAP filter will be considered by the scanner. For example, in the case of a TCP SYN scan, we only want to investigate TCP SYN/ACK or TCP RST packets and would utilize a filter similar to `tcp && tcp[13] & 4 != 0 || tcp[13] == 18`. The `validate_packet` function will be called for every packet that fulfills this PCAP filter. If the validation returns non-zero, the `process_packet` function will be called, and will populate a fieldset using fields defined in `fields` with data from the packet. For example, the following code processes a packet for the TCP synscan probe module. - - void synscan_process_packet(const u_char *packet, uint32_t len, fieldset_t *fs) - { - struct iphdr *ip_hdr = (struct iphdr *)&packet[sizeof(struct ethhdr)]; - struct tcphdr *tcp = (struct tcphdr*)((char *)ip_hdr - + (sizeof(struct iphdr))); - - fs_add_uint64(fs, "sport", (uint64_t) ntohs(tcp->source)); - fs_add_uint64(fs, "dport", (uint64_t) ntohs(tcp->dest)); - fs_add_uint64(fs, "seqnum", (uint64_t) ntohl(tcp->seq)); - fs_add_uint64(fs, "acknum", (uint64_t) ntohl(tcp->ack_seq)); - fs_add_uint64(fs, "window", (uint64_t) ntohs(tcp->window)); - - if (tcp->rst) { // RST packet - fs_add_string(fs, "classification", (char*) "rst", 0); - fs_add_uint64(fs, "success", 0); - } else { // SYNACK packet - fs_add_string(fs, "classification", (char*) "synack", 0); - fs_add_uint64(fs, "success", 1); - } - } - --------------------------------------------------------------------------------- - -via: https://zmap.io/documentation.html - -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[1]:https://github.com/ewust/forge_socket/ -[2]:https://github.com/zmap/zmap/blob/v1.0.0/src/output_modules/output_modules.c -[3]:https://github.com/zmap/zmap/blob/master/src/output_modules/output_modules.h -[4]:https://github.com/zmap/zmap/blob/master/src/output_modules/module_csv.c From 8d9469bc09ba353ee78c50ff970db364a05afcd8 Mon Sep 17 00:00:00 2001 From: martin qi Date: Sat, 11 Jul 2015 13:46:25 +0800 Subject: [PATCH 569/965] Create 20150401 ZMap Documentation.md --- .../tech/20150401 ZMap Documentation.md | 743 ++++++++++++++++++ 1 file changed, 743 insertions(+) create mode 100644 translated/tech/20150401 ZMap Documentation.md diff --git a/translated/tech/20150401 ZMap Documentation.md b/translated/tech/20150401 ZMap Documentation.md new file mode 100644 index 0000000000..fbfa912181 --- /dev/null +++ b/translated/tech/20150401 ZMap Documentation.md @@ -0,0 +1,743 @@ +ZMap 文档 +================================================================================ +1. 初识 ZMap +1. 最佳扫描习惯 +1. 命令行参数 +1. 附加信息 + 1. TCP SYN 探测模块 + 1. ICMP Echo 探测模块 + 1. UDP 探测模块 + 1. 配置文件 + 1. 详细 + 1. 结果输出 + 1. 黑名单 + 1. 速度限制与抽样 + 1. 发送多个探测 +1. ZMap 扩展 + 1. 示例应用程序 + 1. 编写探测和输出模块 + +---------- + +### 初识 ZMap ### + +ZMap被设计用来针对IPv4所有地址或其中的大部分实施综合扫描的工具。ZMap是研究者手中的利器,但在运行ZMap时,请注意,您很有可能正在以每秒140万个包的速度扫描整个IPv4地址空间 。我们建议用户在实施即使小范围扫描之前,也联系一下本地网络的管理员并参考我们列举的最佳扫描习惯。 + +默认情况下,ZMap会对于指定端口实施尽可能大速率的TCP SYN扫描。较为保守的情况下,对10,000个随机的地址的80端口以10Mbps的速度扫描,如下所示: + + $ zmap --bandwidth=10M --target-port=80 --max-targets=10000 --output-file=results.csv + +或者更加简洁地写成: + + $ zmap -B 10M -p 80 -n 10000 -o results.csv + +ZMap也可用于扫描特定子网或CIDR地址块。例如,仅扫描10.0.0.0/8和192.168.0.0/16的80端口,运行指令如下: + + zmap -p 80 -o results.csv 10.0.0.0/8 192.168.0.0/16 + +如果扫描进行的顺利,ZMap会每秒输出类似以下内容的状态更新: + + 0% (1h51m left); send: 28777 562 Kp/s (560 Kp/s avg); recv: 1192 248 p/s (231 p/s avg); hits: 0.04% + 0% (1h51m left); send: 34320 554 Kp/s (559 Kp/s avg); recv: 1442 249 p/s (234 p/s avg); hits: 0.04% + 0% (1h50m left); send: 39676 535 Kp/s (555 Kp/s avg); recv: 1663 220 p/s (232 p/s avg); hits: 0.04% + 0% (1h50m left); send: 45372 570 Kp/s (557 Kp/s avg); recv: 1890 226 p/s (232 p/s avg); hits: 0.04% + +这些更新信息提供了扫描的即时状态并表示成:完成进度% (剩余时间); send: 发出包的数量 即时速率 (平均发送速率); recv: 接收包的数量 接收率 (平均接收率); hits: 成功率 + +如果您不知道您所在网络支持的扫描速率,您可能要尝试不同的扫描速率和带宽限制直到扫描效果开始下降,借此找出当前网络能够支持的最快速度。 + +默认情况下,ZMap会输出不同IP地址的列表(例如,SYN ACK数据包的情况)像下面这样。还有几种附加的格式(如,JSON和Redis)作为其输出结果,以及生成程序可解析的扫描统计选项。 同样,可以指定附加的输出字段并使用输出过滤来过滤输出的结果。 + + 115.237.116.119 + 23.9.117.80 + 207.118.204.141 + 217.120.143.111 + 50.195.22.82 + +我们强烈建议您使用黑名单文件,以排除预留的/未分配的IP地址空间(如,组播地址,RFC1918),以及网络中需要排除在您扫描之外的地址。默认情况下,ZMap将采用位于 `/etc/zmap/blacklist.conf`的这个简单的黑名单文件中所包含的预留和未分配地址。如果您需要某些特定设置,比如每次运行ZMap时的最大带宽或黑名单文件,您可以在文件`/etc/zmap/zmap.conf`中指定或使用自定义配置文件。 + +如果您正试图解决扫描的相关问题,有几个选项可以帮助您调试。首先,您可以通过添加`--dryrun`实施预扫,以此来分析包可能会发送到网络的何处。此外,还可以通过设置'--verbosity=n`来更改日志详细程度。 + +---------- + +### 最佳扫描习惯 ### + +我们为针对互联网进行扫描的研究者提供了一些建议,以此来引导养成良好的互联网合作氛围 + +- 密切协同本地的网络管理员,以减少风险和调查 +- 确认扫描不会使本地网络或上游供应商瘫痪 +- 标记出在扫描中呈良性的网页和DNS条目的源地址 +- 明确注明扫描中所有连接的目的和范围 +- 提供一个简单的退出方法并及时响应请求 +- 实施扫描时,不使用比研究对象需求更大的扫描范围或更快的扫描频率 +- 如果可以通过时间或源地址来传播扫描流量 + +即使不声明,使用扫描的研究者也应该避免利用漏洞或访问受保护的资源,并遵守其辖区内任何特殊的法律规定。 + +---------- + +### 命令行参数 ### + +#### 通用选项 #### + +这些选项是实施简单扫描时最常用的选项。我们注意到某些选项取决于所使用的探测模块或输出模块(如,在实施ICMP Echo扫描时是不需要使用目的端口的)。 + + +**-p, --target-port=port** + +用来扫描的TCP端口号(例如,443) + +**-o, --output-file=name** + +使用标准输出将结果写入该文件。 + +**-b, --blacklist-file=path** + +文件中被排除的子网使用CIDR表示法(如192.168.0.0/16),一个一行。建议您使用此方法排除RFC 1918地址,组播地址,IANA预留空间等IANA专用地址。在conf/blacklist.example中提供了一个以此为目的示例黑名单文件。 + +#### 扫描选项 #### + +**-n, --max-targets=n** + +限制探测目标的数量。后面跟的可以是一个数字(例如'-n 1000`)或百分比(例如,`-n 0.1%`)当然都是针对可扫描地址空间而言的(不包括黑名单) + +**-N, --max-results=n** + +收到多少结果后退出 + +**-t, --max-runtime=secs** + +限制发送报文的时间 + +**-r, --rate=pps** + +设置传输速率,以包/秒为单位 + +**-B, --bandwidth=bps** + +以比特/秒设置传输速率(支持使用后缀G,M或K(如`-B 10M`就是速度10 mbps)的。设置会覆盖`--rate`。 + +**-c, --cooldown-time=secs** + +发送完成后多久继续接收(默认值= 8) + +**-e, --seed=n** + +地址排序种子。如果要用多个ZMap以相同的顺序扫描地址,那么就可以使用这个参数。 + +**--shards=n** + +将扫描分片/区在使其可多个ZMap中执行(默认值= 1)。启用分片时,`--seed`参数是必需的。 + +**--shard=n** + +选择扫描的分片(默认值= 0)。n的范围在[0,N),其中N为碎片的总数。启用分片时,`--seed`参数是必需的。 + +**-T, --sender-threads=n** + +用于发送数据包的线程数(默认值= 1) + +**-P, --probes=n** + +发送到每个IP的探测数(默认值= 1) + +**-d, --dryrun** + +用标准输出打印出每个包,而不是将其发送(用于调试) + +#### 网络选项 #### + +**-s, --source-port=port|range** + +发送数据包的源端口 + +**-S, --source-ip=ip|range** + +发送数据包的源地址。可以仅仅是一个IP,也可以是一个范围(如,10.0.0.1-10.0.0.9) + +**-G, --gateway-mac=addr** + +数据包发送到的网关MAC地址(用以防止自动检测不工作的情况) + +**-i, --interface=name** + +使用的网络接口 + +#### 探测选项 #### + +ZMap允许用户指定并添加自己所需要探测的模块。 探测模块的职责就是生成主机回复的响应包。 + +**--list-probe-modules** + +列出可用探测模块(如tcp_synscan) + +**-M, --probe-module=name** + +选择探探测模块(默认值= tcp_synscan) + +**--probe-args=args** + +向模块传递参数 + +**--list-output-fields** + +列出可用的输出模块 + +#### 输出选项 #### + +ZMap允许用户选择指定的输出模块。输出模块负责处理由探测模块返回的字段,并将它们交给用户。用户可以指定输出的范围,并过滤相应字段。 + +**--list-output-modules** + +列出可用输出模块(如tcp_synscan) + +**-O, --output-module=name** + +选择输出模块(默认值为csv) + +**--output-args=args** + +传递给输出模块的参数 + +**-f, --output-fields=fields** + +输出列表,以逗号分割 + +**--output-filter** + +通过指定相应的探测模块来过滤输出字段 + +#### 附加选项 #### + +**-C, --config=filename** + +加载配置文件,可以指定其他路径。 + +**-q, --quiet** + +不再是每秒刷新输出 + +**-g, --summary** + +在扫描结束后打印配置和结果汇总信息 + +**-v, --verbosity=n** + +日志详细程度(0-5,默认值= 3) + +**-h, --help** + +打印帮助并退出 + +**-V, --version** + +打印版本并退出 + +---------- + +### 附加信息 ### + +#### TCP SYN 扫描 #### + +在执行TCP SYN扫描时,ZMap需要指定一个目标端口和以供扫描的源端口范围。 + +**-p, --target-port=port** + +扫描的TCP端口(例如 443) + +**-s, --source-port=port|range** + +发送扫描数据包的源端口(例如 40000-50000) + +**警示!** ZMAP基于Linux内核使用SYN/ACK包应答,RST包关闭扫描打开的连接。ZMap是在Ethernet层完成包的发送的,这样做时为了减少跟踪打开的TCP连接和路由寻路带来的内核开销。因此,如果您有跟踪连接建立的防火墙规则,如netfilter的规则类似于`-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT`,将阻止SYN/ACK包到达内核。这不会妨碍到ZMap记录应答,但它会阻止RST包被送回,最终连接会在超时后断开。我们强烈建议您在执行ZMap时,选择一组主机上未使用且防火墙允许访问的端口,加在`-s`后(如 `-s '50000-60000' ` )。 + +#### ICMP Echo 请求扫描 #### + +虽然在默认情况下ZMap执行的是TCP SYN扫描,但它也支持使用ICMP echo请求扫描。在这种扫描方式下ICMP echo请求包被发送到每个主机,并以收到ICMP 应答包作为答复。实施ICMP扫描可以通过选择icmp_echoscan扫描模块来执行,如下: + + $ zmap --probe-module=icmp_echoscan + +#### UDP 数据报扫描 #### + +ZMap还额外支持UDP探测,它会发出任意UDP数据报给每个主机,并能在无论UDP或是ICMP任何一个不可达的情况下接受应答。ZMap支持通过使用--probe-args命令行选择四种不同的UDP payload方式。这些都有可列印payload的‘文本’,用于命令行的十六进制payload的‘hex’,外部文件中包含payload的‘file’,和需要动态区域生成的payload的‘template’。为了得到UDP响应,请使用-f参数确保您指定的“data”领域处于汇报范围。 + +下面的例子将发送两个字节'ST',即PC的'status'请求,到UDP端口5632。 + + $ zmap -M udp -p 5632 --probe-args=text:ST -N 100 -f saddr,data -o - + +下面的例子将发送字节“0X02”,即SQL服务器的 'client broadcast'请求,到UDP端口1434。 + + $ zmap -M udp -p 1434 --probe-args=hex:02 -N 100 -f saddr,data -o - + +下面的例子将发送一个NetBIOS状态请求到UDP端口137。使用一个ZMap自带的payload文件。 + + $ zmap -M udp -p 1434 --probe-args=file:netbios_137.pkt -N 100 -f saddr,data -o - + +下面的例子将发送SIP的'OPTIONS'请求到UDP端口5060。使用附ZMap自带的模板文件。 + + $ zmap -M udp -p 1434 --probe-args=file:sip_options.tpl -N 100 -f saddr,data -o - + +UDP payload 模板仍处于实验阶段。当您在更多的使用一个以上的发送线程(-T)时可能会遇到崩溃和一个明显的相比静态payload性能降低的表现。模板仅仅是一个由一个或多个使用$ {}将字段说明封装成序列构成的payload文件。某些协议,特别是SIP,需要payload来反射包中的源和目的地址。其他协议,如端口映射和DNS,包含范围伴随每一次请求随机生成或Zamp扫描的多宿主系统将会抛出危险警告。 + +以下的payload模板将发送SIP OPTIONS请求到每一个目的地: + + OPTIONS sip:${RAND_ALPHA=8}@${DADDR} SIP/2.0 + Via: SIP/2.0/UDP ${SADDR}:${SPORT};branch=${RAND_ALPHA=6}.${RAND_DIGIT=10};rport;alias + From: sip:${RAND_ALPHA=8}@${SADDR}:${SPORT};tag=${RAND_DIGIT=8} + To: sip:${RAND_ALPHA=8}@${DADDR} + Call-ID: ${RAND_DIGIT=10}@${SADDR} + CSeq: 1 OPTIONS + Contact: sip:${RAND_ALPHA=8}@${SADDR}:${SPORT} + Content-Length: 0 + Max-Forwards: 20 + User-Agent: ${RAND_ALPHA=8} + Accept: text/plain + +就像在上面的例子中展示的那样,对于大多数SIP正常的实现会在在每行行末添加\r\n,并且在请求的末尾一定包含\r\n\r\n。一个可以使用的在ZMap的examples/udp-payloads目录下的例子 (sip_options.tpl). + +下面的字段正在如今的模板中实施: + + +- **SADDR**: 源IP地址的点分十进制格式 +- **SADDR_N**: 源IP地址的网络字节序格式 +- **DADDR**: 目的IP地址的点分十进制格式 +- **DADDR_N**: 目的IP地址的网络字节序格式 +- **SPORT**: 源端口的ascii格式 +- **SPORT_N**: 源端口的网络字节序格式 +- **DPORT**: 目的端口的ascii格式 +- **DPORT_N**: 目的端口的网络字节序格式 +- **RAND_BYTE**: 随机字节(0-255),长度由=(长度) 参数决定 +- **RAND_DIGIT**: 随机数字0-9,长度由=(长度) 参数决定 +- **RAND_ALPHA**: 随机大写字母A-Z,长度由=(长度) 参数决定 +- **RAND_ALPHANUM**: 随机大写字母A-Z和随机数字0-9,长度由=(长度) 参数决定 + +### 配置文件 ### + +ZMap支持使用配置文件代替在命令行上指定所有的需求选项。配置中可以通过每行指定一个长名称的选项和对应的值来创建: + + interface "eth1" + source-ip 1.1.1.4-1.1.1.8 + gateway-mac b4:23:f9:28:fa:2d # upstream gateway + cooldown-time 300 # seconds + blacklist-file /etc/zmap/blacklist.conf + output-file ~/zmap-output + quiet + summary + +然后ZMap就可以按照配置文件和一些必要的附加参数运行了: + + $ zmap --config=~/.zmap.conf --target-port=443 + +### 详细 ### + +ZMap可以在屏幕上生成多种类型的输出。默认情况下,Zmap将每隔1秒打印出相似的基本进度信息。可以通过设置`--quiet`来禁用。 + + 0:01 12%; send: 10000 done (15.1 Kp/s avg); recv: 144 143 p/s (141 p/s avg); hits: 1.44% + +ZMap同样也可以根据扫描配置打印如下消息,可以通过'--verbosity`参数加以控制。 + + Aug 11 16:16:12.813 [INFO] zmap: started + Aug 11 16:16:12.817 [DEBUG] zmap: no interface provided. will use eth0 + Aug 11 16:17:03.971 [DEBUG] cyclic: primitive root: 3489180582 + Aug 11 16:17:03.971 [DEBUG] cyclic: starting point: 46588 + Aug 11 16:17:03.975 [DEBUG] blacklist: 3717595507 addresses allowed to be scanned + Aug 11 16:17:03.975 [DEBUG] send: will send from 1 address on 28233 source ports + Aug 11 16:17:03.975 [DEBUG] send: using bandwidth 10000000 bits/s, rate set to 14880 pkt/s + Aug 11 16:17:03.985 [DEBUG] recv: thread started + +ZMap还支持在扫描之后打印出一个的可grep的汇总信息,类似于下面这样,可以通过调用`--summary`来实现。 + + cnf target-port 443 + cnf source-port-range-begin 32768 + cnf source-port-range-end 61000 + cnf source-addr-range-begin 1.1.1.4 + cnf source-addr-range-end 1.1.1.8 + cnf maximum-packets 4294967295 + cnf maximum-runtime 0 + cnf permutation-seed 0 + cnf cooldown-period 300 + cnf send-interface eth1 + cnf rate 45000 + env nprocessors 16 + exc send-start-time Fri Jan 18 01:47:35 2013 + exc send-end-time Sat Jan 19 00:47:07 2013 + exc recv-start-time Fri Jan 18 01:47:35 2013 + exc recv-end-time Sat Jan 19 00:52:07 2013 + exc sent 3722335150 + exc blacklisted 572632145 + exc first-scanned 1318129262 + exc hit-rate 0.874102 + exc synack-received-unique 32537000 + exc synack-received-total 36689941 + exc synack-cooldown-received-unique 193 + exc synack-cooldown-received-total 1543 + exc rst-received-unique 141901021 + exc rst-received-total 166779002 + adv source-port-secret 37952 + adv permutation-gen 4215763218 + +### 结果输出 ### + +ZMap可以通过**输出模块**生成不同格式的结果。默认情况下,ZMap只支持**csv**的输出,但是可以通过编译支持**redis**和**json** 。可以使用**输出过滤**来过滤这些发送到输出模块上的结果。输出模块的范围由用户指定。默认情况如果没有指定输出文件,ZMap将以csv格式返回结果,ZMap不会产生特定结果。也可以编写自己的输出模块;请参阅编写输出模块。 + +**-o, --output-file=p** + +输出写入文件地址 + +**-O, --output-module=p** + +调用自定义输出模块 + + +**-f, --output-fields=p** + +输出以逗号分隔各字段的列表 + +**--output-filter=filter** + +在给定的探测区域实施输出过滤 + +**--list-output-modules** + +列出可用输出模块 + +**--list-output-fields** + +列出可用的给定探测区域 + +#### 输出字段 #### + +ZMap有很多区域,它可以基于IP地址输出。这些区域可以通过在给定探测模块上运行`--list-output-fields`来查看。 + + $ zmap --probe-module="tcp_synscan" --list-output-fields + saddr string: 应答包中的源IP地址 + saddr-raw int: 网络提供的整形形式的源IP地址 + daddr string: 应答包中的目的IP地址 + daddr-raw int: 网络提供的整形形式的目的IP地址 + ipid int: 应答包中的IP识别号 + ttl int: 应答包中的ttl(存活时间)值 + sport int: TCP 源端口 + dport int: TCP 目的端口 + seqnum int: TCP 序列号 + acknum int: TCP Ack号 + window int: TCP 窗口 + classification string: 包类型 + success int: 是应答包成功 + repeat int: 是否是来自主机的重复响应 + cooldown int: 是否是在冷却时间内收到的响应 + timestamp-str string: 响应抵达时的时间戳使用ISO8601格式 + timestamp-ts int: 响应抵达时的时间戳使用纪元开始的秒数 + timestamp-us int: 时间戳的微秒部分(例如 从'timestamp-ts'的几微秒) + +可以通过使用`--output-fields=fields`或`-f`来选择选择输出字段,任意组合的输出字段可以被指定为逗号分隔的列表。例如: + + $ zmap -p 80 -f "response,saddr,daddr,sport,seq,ack,in_cooldown,is_repeat,timestamp" -o output.csv + +#### 过滤输出 #### + +在传到输出模块之前,探测模块生成的结果可以先过滤。过滤被实施在探测模块的输出字段上。过滤使用简单的过滤语法写成,类似于SQL,通过ZMap的**--output-filter**选项来实施。输出过滤通常用于过滤掉重复的结果或仅传输成功的响应到输出模块。 + +过滤表达式的形式为`<字段名> <操作> <值>`。`<值>`的类型必须是一个字符串或一串无符号整数并且匹配`<字段名>`类型。对于整数比较有效的操作是`= !=, <, >, <=, >=`。字符串比较的操作是=,!=。`--list-output-fields`会打印那些可供探测模块选择的字段和类型,然后退出。 + +复合型的过滤操作,可以通过使用`&&`(逻辑与)和`||`(逻辑或)这样的运算符来组合出特殊的过滤操作。 + +**示例** + +书写一则过滤仅显示成功,过滤重复应答 + + --output-filter="success = 1 && repeat = 0" + +过滤出包中含RST并且TTL大于10的分类,或者包中含SYNACK的分类 + + --output-filter="(classification = rst && ttl > 10) || classification = synack" + +#### CSV #### + +csv模块将会生成以逗号分隔各输出请求字段的文件。例如,以下的指令将生成下面的CSV至名为`output.csv`的文件。 + + $ zmap -p 80 -f "response,saddr,daddr,sport,seq,ack,in_cooldown,is_repeat,timestamp" -o output.csv + +---------- + + 响应, 源地址, 目的地址, 源端口, 目的端口, 序列号, 应答, 是否是冷却模式, 是否重复, 时间戳 + synack, 159.174.153.144, 10.0.0.9, 80, 40555, 3050964427, 3515084203, 0, 0,2013-08-15 18:55:47.681 + rst, 141.209.175.1, 10.0.0.9, 80, 40136, 0, 3272553764, 0, 0,2013-08-15 18:55:47.683 + rst, 72.36.213.231, 10.0.0.9, 80, 56642, 0, 2037447916, 0, 0,2013-08-15 18:55:47.691 + rst, 148.8.49.150, 10.0.0.9, 80, 41672, 0, 1135824975, 0, 0,2013-08-15 18:55:47.692 + rst, 50.165.166.206, 10.0.0.9, 80, 38858, 0, 535206863, 0, 0,2013-08-15 18:55:47.694 + rst, 65.55.203.135, 10.0.0.9, 80, 50008, 0, 4071709905, 0, 0,2013-08-15 18:55:47.700 + synack, 50.57.166.186, 10.0.0.9, 80, 60650, 2813653162, 993314545, 0, 0,2013-08-15 18:55:47.704 + synack, 152.75.208.114, 10.0.0.9, 80, 52498, 460383682, 4040786862, 0, 0,2013-08-15 18:55:47.707 + synack, 23.72.138.74, 10.0.0.9, 80, 33480, 810393698, 486476355, 0, 0,2013-08-15 18:55:47.710 + +#### Redis #### + +Redis的输出模块允许地址被添加到一个Redis的队列,不是被保存到文件,允许ZMap将它与之后的处理工具结合使用。 + +**注意!** ZMap默认不会编译Redis功能。如果您想要将Redis功能编译进ZMap源码中,可以在CMake的时候加上`-DWITH_REDIS=ON`。 + +### 黑名单和白名单 ### + +ZMap同时支持对网络前缀做黑名单和白名单。如果ZMap不加黑名单和白名单参数,他将会扫描所有的IPv4地址(包括本地的,保留的以及组播地址)。如果指定了黑名单文件,那么在黑名单中的网络前缀将不再扫描;如果指定了白名单文件,只有那些网络前缀在白名单内的才会扫描。白名单和黑名单文件可以协同使用;黑名单运用于白名单上(例如:如果您在白名单中指定了10.0.0.0/8并在黑名单中指定了10.1.0.0/16,那么10.1.0.0/16将不会扫描)。白名单和黑名单文件可以在命令行中指定,如下所示: + +**-b, --blacklist-file=path** + +文件用于记录黑名单子网,以CIDR(无类域间路由)的表示法,例如192.168.0.0/16 + +**-w, --whitelist-file=path** + +文件用于记录限制扫描的子网,以CIDR的表示法,例如192.168.0.0/16 + +黑名单文件的每行都需要以CIDR的表示格式书写一个单一的网络前缀。允许使用`#`加以备注。例如: + + # IANA(英特网编号管理局)记录的用于特殊目的的IPv4地址 + # http://www.iana.org/assignments/iana-ipv4-special-registry/iana-ipv4-special-registry.xhtml + # 更新于2013-05-22 + + 0.0.0.0/8 # RFC1122: 网络中的所有主机 + 10.0.0.0/8 # RFC1918: 私有地址 + 100.64.0.0/10 # RFC6598: 共享地址空间 + 127.0.0.0/8 # RFC1122: 回环地址 + 169.254.0.0/16 # RFC3927: 本地链路地址 + 172.16.0.0/12 # RFC1918: 私有地址 + 192.0.0.0/24 # RFC6890: IETF协议预留 + 192.0.2.0/24 # RFC5737: 测试地址 + 192.88.99.0/24 # RFC3068: IPv6转换到IPv4的任意播 + 192.168.0.0/16 # RFC1918: 私有地址 + 192.18.0.0/15 # RFC2544: 检测地址 + 198.51.100.0/24 # RFC5737: 测试地址 + 203.0.113.0/24 # RFC5737: 测试地址 + 240.0.0.0/4 # RFC1112: 预留地址 + 255.255.255.255/32 # RFC0919: 广播地址 + + # IANA记录的用于组播的地址空间 + # http://www.iana.org/assignments/multicast-addresses/multicast-addresses.xhtml + # 更新于2013-06-25 + + 224.0.0.0/4 # RFC5771: 组播/预留地址ed + +如果您只是想扫描因特网中随机的一部分地址,使用采样检出,来代替使用白名单和黑名单。 + +**注意!**ZMap默认设置使用`/etc/zmap/blacklist.conf`作为黑名单文件,其中包含有本地的地址空间和预留的IP空间。通过编辑`/etc/zmap/zmap.conf`可以改变默认的配置。 + +### 速度限制与抽样 ### + +默认情况下,ZMap将以您当前网络所能支持的最快速度扫描。以我们对于常用硬件的经验,这普遍是理论上Gbit以太网速度的95-98%,这可能比您的上游提供商可处理的速度还要快。ZMap是不会自动的根据您的上游提供商来调整发送速率的。您可能需要手动的调整发送速率来减少丢包和错误结果。 + +**-r, --rate=pps** + +设置最大发送速率以包/秒为单位 + +**-B, --bandwidth=bps** + +设置发送速率以比特/秒(支持G,M和K后缀)。也同样作用于--rate的参数。 + +ZMap同样支持对IPv4地址空间进行指定最大目标数和/或最长运行时间的随机采样。由于针对主机的扫描是通过随机排序生成的实例,限制扫描的主机个数为N就会随机抽选N个主机。命令选项如下: + +**-n, --max-targets=n** + +探测目标上限数量 + +**-N, --max-results=n** + +结果上限数量(累积收到这么多结果后推出) + +**-t, --max-runtime=s** + +发送数据包时间长度上限(以秒为单位) + +**-s, --seed=n** + +种子用以选择地址的排列方式。使用不同ZMap执行扫描操作时将种子设成相同的值可以保证相同的扫描顺序。 + +举个例子,如果您想要多次扫描同样的一百万个互联网主机,您可以设定排序种子和扫描主机的上限数量,大致如下所示: + + zmap -p 443 -s 3 -n 1000000 -o results + +为了确定哪一百万主机将要被扫描,您可以执行预扫,只列印数据包而非发送,并非真的实施扫描。 + + zmap -p 443 -s 3 -n 1000000 --dryrun | grep daddr + | awk -F'daddr: ' '{print $2}' | sed 's/ |.*//;' + +### 发送多个数据包 ### + +ZMap支持想每个主机发送多个扫描。增加这个数量既增加了扫描时间又增加了到达的主机数量。然而,我们发现,增加扫描时间(每个额外扫描的增加近100%)远远大于到达的主机数量(每个额外扫描的增加近1%)。 + +**-P, --probes=n** + +向每个IP发出的独立扫描个数(默认值=1) + +---------- + +### 示例应用程序 ### + +ZMap专为向大量主机发启连接并寻找那些正确响应而设计。然而,我们意识到许多用户需要执行一些后续处理,如执行应用程序级别的握手。例如,用户在80端口实施TCP SYN扫描可能只是想要实施一个简单的GET请求,还有用户扫描443端口可能是对TLS握手如何完成感兴趣。 + +#### Banner获取 #### + +我们收录了一个示例程序,banner-grab,伴随ZMap使用可以让用户从监听状态的TCP服务器上接收到消息。Banner-grab连接到服务上,任意的发送一个消息,然后打印出收到的第一个消息。这个工具可以用来获取banners例如HTTP服务的回复的具体指令,telnet登陆提示,或SSH服务的字符串。 + +这个例子寻找了1000个监听80端口的服务器,并向每个发送一个简单的GET请求,存储他们的64位编码响应至http-banners.out + + $ zmap -p 80 -N 1000 -B 10M -o - | ./banner-grab-tcp -p 80 -c 500 -d ./http-req > out + +如果想知道更多使用`banner-grab`的细节,可以参考`examples/banner-grab`中的README文件。 + +**注意!** ZMap和banner-grab(如例子中)同时运行可能会比较显著的影响对方的表现和精度。确保不让ZMap充满banner-grab-tcp的并发连接,不然banner-grab将会落后于标准输入的读入,导致屏蔽编写标准输出。我们推荐使用较慢扫描速率的ZMap,同时提升banner-grab-tcp的并发性至3000以内(注意 并发连接>1000需要您使用`ulimit -SHn 100000`和`ulimit -HHn 100000`来增加每个问进程的最大文件描述)。当然,这些参数取决于您服务器的性能,连接成功率(hit-rate);我们鼓励开发者在运行大型扫描之前先进行小样本的试验。 + +#### 建立套接字 #### + +我们也收录了另一种形式的banner-grab,就是forge-socket, 重复利用服务器发出的SYN-ACK,连接并最终取得banner。在`banner-grab-tcp`中,ZMap向每个服务器发送一个SYN,并监听服务器发回的带有SYN+ACK的应答。运行ZMap主机的内核接受应答后发送RST,因为有没有处于活动状态的连接与该包关联。程序banner-grab必须在这之后创建一个新的TCP连接到从服务器获取数据。 + +在forge-socket中,我们以同样的名字利用内核模块,这使我们可以创建任意参数的TCP连接。这样可以抑制内核的RST包,并且通过创建套接字取代它可以重用SYN+ACK的参数,通过这个套接字收发数据和我们平时使用的连接套接字并没有什么不同。 + +要使用forge-socket,您需要forge-socket内核模块,从[github][1]上可以获得。您需要git clone `git@github.com:ewust/forge_socket.git`至ZMap源码根目录,然后cd进入forge_socket 目录,运行make。以root身份安装带有`insmod forge_socket.ko` 的内核模块。 + +您也需要告知内核不要发送RST包。一个简单的在全系统禁用RST包的方法是**iptables**。以root身份运行`iptables -A OUTPUT -p tcp -m tcp --tcp-flgas RST,RST RST,RST -j DROP`即可,当然您也可以加上一项--dport X将禁用局限于所扫描的端口(X)上。扫描完成后移除这项设置,以root身份运行`iptables -D OUTPUT -p tcp -m tcp --tcp-flags RST,RST RST,RST -j DROP`即可。 + +现在应该可以建立forge-socket的ZMap示例程序了。运行需要使用**extended_file**ZMap输出模块: + + $ zmap -p 80 -N 1000 -B 10M -O extended_file -o - | \ + ./forge-socket -c 500 -d ./http-req > ./http-banners.out + +详细内容可以参考`examples/forge-socket`目录下的README。 + +---------- + +### 编写探测和输出模块 ### + +ZMap可以通过**probe modules**扩展支持不同类型的扫描,通过**output modules**追加不同类型的输出结果。注册过的探测和输出模块可以在命令行中列出: + +**--list-probe-modules** + +列出安装过的探测模块 + +**--list-output-modules** + +列出安装过的输出模块 + +#### 输出模块 #### + +ZMap的输出和输出后处理可以通过执行和注册扫描的**output modules**来扩展。输出模块在接收每一个应答包时都会收到一个回调。然而提供的默认模块仅提供简单的输出,这些模块同样支持扩展扫描后处理(例如:重复跟踪或输出AS号码来代替IP地址) + +通过定义一个新的output_module机构体来创建输出模块,并在[output_modules.c][2]中注册: + + typedef struct output_module { + const char *name; // 在命令行如何引出输出模块 + unsigned update_interval; // 以秒为单位的更新间隔 + + output_init_cb init; // 在扫描初始化的时候调用 + output_update_cb start; // 在开始的扫描的时候调用 + output_update_cb update; // 每次更新间隔调用,秒为单位 + output_update_cb close; // 扫描终止后调用 + + output_packet_cb process_ip; // 接收到应答时调用 + + const char *helptext; // 会在--list-output-modules时打印在屏幕啥 + + } output_module_t; + +输出模块必须有名称,通过名称可以在命令行、普遍实施的`success_ip`和常见的`other_ip`回调中使用模块。process_ip的回调由每个收到的或经由**probe module**过滤的应答包调用。应答是否被认定为成功并不确定(比如,他可以是一个TCP的RST)。这些回调必须定义匹配`output_packet_cb`定义的函数: + + int (*output_packet_cb) ( + + ipaddr_n_t saddr, // network-order格式的扫描主机IP地址 + ipaddr_n_t daddr, // network-order格式的目的IP地址 + + const char* response_type, // 发送模块的数据包分类 + + int is_repeat, // {0: 主机的第一个应答, 1: 后续的应答} + int in_cooldown, // {0: 非冷却状态, 1: 扫描处于冷却中} + + const u_char* packet, // 指向结构体iphdr中IP包的指针 + size_t packet_len // 包的长度以字节为单位 + ); + +输出模块还可以通过注册回调执行在扫描初始化的时候(诸如打开输出文件的任务),扫描开始阶段(诸如记录黑名单的任务),在常规间隔实施(诸如程序升级的任务)在关闭的时候(诸如关掉所有打开的文件描述符。这些回调提供完整的扫描配置入口和实时状态: + + int (*output_update_cb)(struct state_conf*, struct state_send*, struct state_recv*); + +被定义在[output_modules.h][3]中。在[src/output_modules/module_csv.c][4]中有可用示例。 + +#### 探测模块 #### + +数据包由探测模块构造,由此可以创建抽象包并对应答分类。ZMap默认拥有两个扫描模块:`tcp_synscan`和`icmp_echoscan`。默认情况下,ZMap使用`tcp_synscan`来发送TCP SYN包并对每个主机的并对每个主机的响应分类,如打开时(收到SYN+ACK)或关闭时(收到RST)。ZMap允许开发者编写自己的ZMap探测模块,使用如下的API: + +任何类型的扫描的实施都需要在`send_module_t`结构体内开发和注册必要的回调: + + typedef struct probe_module { + const char *name; // 如何在命令行调用扫描 + size_t packet_length; // 探测包有多长(必须是静态的) + + const char *pcap_filter; // 对收到的响应实施PCAP过滤 + size_t pcap_snaplen; // maximum number of bytes for libpcap to capture + + uint8_t port_args; // 设为1,如果需要使用ZMap的--target-port + // 用户指定 + + probe_global_init_cb global_initialize; // 在扫描初始化会时被调用一次 + probe_thread_init_cb thread_initialize; // 每个包缓存区的线程中被调用一次 + probe_make_packet_cb make_packet; // 每个主机更新包的时候被调用一次 + probe_validate_packet_cb validate_packet; // 每收到一个包被调用一次, + // 如果包无效返回0, + // 非零则覆盖。 + + probe_print_packet_cb print_packet; // 如果在dry-run模式下被每个包都调用 + probe_classify_packet_cb process_packet; // 由区分响应的接收器调用 + probe_close_cb close; // 扫描终止后被调用 + + fielddef_t *fields // 该模块指定的区域的定义 + int numfields // 区域的数量 + + } probe_module_t; + +在扫描操作初始化时会调用一次`global_initialize`,可以用来实施一些必要的全局配置和初始化操作。然而,`global_initialize`并不能访问报缓冲区,那里由线程指定。用以代替的,`thread_initialize`在每个发送线程初始化的时候被调用,提供对于缓冲区的访问,可以用来构建探测包和全局的源和目的值。此回调应用于构建宿主不可知分组结构,甚至只有特定值(如:目的主机和校验和),需要随着每个主机更新。例如,以太网头部信息在交换时不会变更(减去校验和是由NIC硬件计算的)因此可以事先定义以减少扫描时间开销。 + +调用回调参数`make_packet是为了让被扫描的主机允许**probe module**更新主机指定的值,同时提供IP地址、一个非透明的验证字符串和探测数目(如下所示)。探测模块负责在探测中放置尽可能多的验证字符串,以至于当服务器返回的应答为空时,探测模块也能验证它的当前状态。例如,针对TCP SYN扫描,tcp_synscan探测模块会使用TCP源端口和序列号的格式存储验证字符串。响应包(SYN+ACKs)将包含预期的值包含目的端口和确认号。 + + int make_packet( + void *packetbuf, // 包的缓冲区 + ipaddr_n_t src_ip, // network-order格式源IP + ipaddr_n_t dst_ip, // network-order格式目的IP + uint32_t *validation, // 探测中的确认字符串 + int probe_num // 如果向每个主机发送多重探测, + // 该值为对于主机我们 + // 正在实施的探测数目 + ); + +扫描模块也应该定义`pcap_filter`、`validate_packet`和`process_packet`。只有符合PCAP过滤的包才会被扫描。举个例子,在一个TCP SYN扫描的情况下,我们只想要调查TCP SYN / ACK或RST TCP数据包,并利用类似`tcp && tcp[13] & 4 != 0 || tcp[13] == 18`的过滤方法。`validate_packet`函数将会被每个满足PCAP过滤条件的包调用。如果验证返回的值非零,将会调用`process_packet`函数,并使用包中被定义成的`fields`字段和数据填充字段集。如下代码为TCP synscan探测模块处理了一个数据包。 + + void synscan_process_packet(const u_char *packet, uint32_t len, fieldset_t *fs) + { + struct iphdr *ip_hdr = (struct iphdr *)&packet[sizeof(struct ethhdr)]; + struct tcphdr *tcp = (struct tcphdr*)((char *)ip_hdr + + (sizeof(struct iphdr))); + + fs_add_uint64(fs, "sport", (uint64_t) ntohs(tcp->source)); + fs_add_uint64(fs, "dport", (uint64_t) ntohs(tcp->dest)); + fs_add_uint64(fs, "seqnum", (uint64_t) ntohl(tcp->seq)); + fs_add_uint64(fs, "acknum", (uint64_t) ntohl(tcp->ack_seq)); + fs_add_uint64(fs, "window", (uint64_t) ntohs(tcp->window)); + + if (tcp->rst) { // RST packet + fs_add_string(fs, "classification", (char*) "rst", 0); + fs_add_uint64(fs, "success", 0); + } else { // SYNACK packet + fs_add_string(fs, "classification", (char*) "synack", 0); + fs_add_uint64(fs, "success", 1); + } + } + +-------------------------------------------------------------------------------- + +via: https://zmap.io/documentation.html + +译者:[martin2011qi](https://github.com/martin2011qi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[1]:https://github.com/ewust/forge_socket/ +[2]:https://github.com/zmap/zmap/blob/v1.0.0/src/output_modules/output_modules.c +[3]:https://github.com/zmap/zmap/blob/master/src/output_modules/output_modules.h +[4]:https://github.com/zmap/zmap/blob/master/src/output_modules/module_csv.c From c51e4a7f6d290cd84de5c756827629c83e85dd78 Mon Sep 17 00:00:00 2001 From: Love-xuan Date: Sat, 11 Jul 2015 14:00:26 +0800 Subject: [PATCH 570/965] translated --- ... Adds Live Backgrounds To Linux Distros.md | 114 ------------------ ... Adds Live Backgrounds To Linux Distros.md | 110 +++++++++++++++++ 2 files changed, 110 insertions(+), 114 deletions(-) delete mode 100644 sources/share/20150527 Animated Wallpaper Adds Live Backgrounds To Linux Distros.md create mode 100644 translated/20150527 Animated Wallpaper Adds Live Backgrounds To Linux Distros.md diff --git a/sources/share/20150527 Animated Wallpaper Adds Live Backgrounds To Linux Distros.md b/sources/share/20150527 Animated Wallpaper Adds Live Backgrounds To Linux Distros.md deleted file mode 100644 index 03be3a27ff..0000000000 --- a/sources/share/20150527 Animated Wallpaper Adds Live Backgrounds To Linux Distros.md +++ /dev/null @@ -1,114 +0,0 @@ -Translating by Love-xuan -Animated Wallpaper Adds Live Backgrounds To Linux Distros -================================================================================ -**We know a lot of you love having a stylish Ubuntu desktop to show off.** - -![Live Wallpaper](http://i.imgur.com/9JIUw5p.gif) - -Live Wallpaper - -And as Linux makes it so easy to create a stunning workspace with a minimal effort, that’s understandable! - -Today, we’re highlighting — [re-highlighting][2] for those of you with long memories — a free, open-source tool that can add extra bling your OS screenshots and screencasts. - -It’s called **Live Wallpaper** and (as you can probably guess) it will replace the standard static desktop background with an animated alternative powered by OpenGL. - -And the best bit: it can be installed in Ubuntu very easily. - -### Animated Wallpaper Themes ### - -![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/05/animated-wallpaper-ubuntu-750x383.jpg) - -Live Wallpaper is not the only app of this type, but it is one of the the best. - -It comes with a number of different themes out of the box. - -These range from the subtle (‘noise’) to frenetic (‘nexus’), and caters to everything in between. There’s even the obligatory clock wallpaper inspired by the welcome screen of the Ubuntu Phone: - -- Circles — Clock inspired by Ubuntu Phone with ‘evolving circle’ aura -- Galaxy — Spinning galaxy that can be resized/repositioned -- Gradient Clock — A polar clock overlaid on basic gradient -- Nexus — Brightly colored particles fire across screen -- Noise — A bokeh design similar to the iOS dynamic wallpaper -- Photoslide — Grid of photos from folder (default ~/Photos) animate in/out - -Live Wallpaper is **fully open-source** so there’s nothing to stop imaginative artists with the know-how (and patience) from creating some slick themes of their own. - -### Settings & Features ### - -![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/05/live-wallpaper-gui-settings.jpg) - -Each theme can be configured or customised in some way, though certain themes have more options than others. - -For example, in Nexus (pictured above) you can change the number and colour of the the pulse particles, their size, and their frequency. - -The preferences app also provides a set of **general options** that will apply to all themes. These include: - -- Setting live wallpaper to run on log-in -- Setting a custom background that the animation sits on -- Adjusting the FPS (including option to show FPS on screen) -- Specifying the multi-monitor behaviour - -With so many options available it should be easy to create a background set up that suits you. - -### Drawbacks ### - -#### No Desktop Icons #### - -You can’t add, open or edit files or folders on the desktop while Live Wallpaper is ‘On’. - -The Preferences app does list an option that will, supposedly, let you do this. It may work on really older releases but in our testing, on Ubuntu 14.10, it does nothing. - -One workaround that seems to work for some users of the app on Ubuntu is setting a .png image as the custom background. It doesn’t have to be a transparent .png, simply a .png. - -#### Resource Usage #### - -Animated wallpapers use more system resources than standard background images. - -We’re not talking about 50% load at all times —at least not with this app in our testing— but those on low-power devices and laptops will want to use apps like this cautiously. Use a [system monitoring tool][2] to keep an eye on CPU and GPU load. - -#### Quitting the app #### - -The biggest “bug” for me is the absolute lack of “quit” option. - -Sure, the animated wallpaper can be turned off from the Indicator Applet and the Preferences tool but quitting the app entirely, quitting the indicator applet? Nope. To do that I have to use the ‘pkill livewallpaper’ command in the Terminal. - -### How to Install Live Wallpaper in Ubuntu 14.04 LTS + ### - -![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/05/terminal-command-750x146.jpg) - -To install Live Wallpaper in Ubuntu 14.04 LTS and above you will first need to add the official PPA for the app to your Software Sources. - -The quickest way to do this is using the Terminal: - - sudo add-apt-repository ppa:fyrmir/livewallpaper-daily - - sudo apt-get update && sudo apt-get install livewallpaper - -You should also install the indicator applet, which lets you quickly and easily turn on/off the animated wallpaper and switch theme from the menu area, and the GUI settings tool so that you can configure each theme based on your tastes. - - sudo apt-get install livewallpaper-config livewallpaper-indicator - -When everything has installed you will be able to launch the app and its preferences tool from the Unity Dash. - -![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/05/live-wallpaper-app-launcher.png) - -Annoyingly, the Indicator Applet won’t automatically open after you install it. It does add itself to the start up list, so a quick log out > log in will get it to show. - -### Summary ### - -If you fancy breathing life into a dull desktop, give it a spin — and let us know what you think of it and what animated wallpapers you’d love to see added! - --------------------------------------------------------------------------------- - -via: http://www.omgubuntu.co.uk/2015/05/animated-wallpaper-adds-live-backgrounds-to-linux-distros - -作者:[Joey-Elijah Sneddon][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://plus.google.com/117485690627814051450/?rel=author -[1]:http://www.omgubuntu.co.uk/2012/11/live-wallpaper-for-ubuntu -[2]:http://www.omgubuntu.co.uk/2011/11/5-system-monitoring-tools-for-ubuntu diff --git a/translated/20150527 Animated Wallpaper Adds Live Backgrounds To Linux Distros.md b/translated/20150527 Animated Wallpaper Adds Live Backgrounds To Linux Distros.md new file mode 100644 index 0000000000..2d845ce804 --- /dev/null +++ b/translated/20150527 Animated Wallpaper Adds Live Backgrounds To Linux Distros.md @@ -0,0 +1,110 @@ +Translating by Love-xuan +动态壁纸给linux发行版添加活力背景 +================================================================================ +**我们知道你想拥有一个有格调的ubuntu桌面来炫耀一下 :)** + +![Live Wallpaper](http://i.imgur.com/9JIUw5p.gif) + +Live Wallpaper + +在linxu上费一点点劲搭建一个出色的工作环境是很简单的。 +今天,我们着重来探讨[重新着重探讨][2]长驻你脑海中那些东西 - 一款自由,开源,能够给你的截图增添光彩的工具。 + +它叫 **Live Wallpaper** (正如你猜的那样) ,它用由OpenGL驱动的一款动态桌面背景来代替标准的静态桌面背景。 + +最好的一点是:在ubuntu上安装它很容易。 + +### 动态壁纸主题 ### + +![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/05/animated-wallpaper-ubuntu-750x383.jpg) + +Live Wallpaper 不是此类软件唯一的一款,但它是最好的一款之一。 + +它附带很多不同的开箱即用的主题。 + +从精细的(‘noise’)到狂热的 (‘nexus’),包罗万象,甚至有受到Ubuntu Phone欢迎屏幕启发的obligatory锁屏壁纸。 + +- Circles — 带着‘evolving circle’风格的时钟,灵感来自于Ubuntu Phone +- Galaxy — 支持自定义大小,位置的星系 +- Gradient Clock — 覆盖基本梯度的时钟 +- Nexus — 亮色粒子火花穿越屏幕 +- Noise — 类似于iOS动态壁纸的Bokeh设计 +- Photoslide — 由文件夹(默认为 ~/Photos)内照片构成的动态网格相册 + +Live Wallpaper **完全开源** ,所以没有什么能够阻挡天马行空的艺术家用提供的做法(当然还有耐心)来创造他们自己的精美主题。 + +### 设置 & 特点 ### + +![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/05/live-wallpaper-gui-settings.jpg) + +虽然某些主题与其它主题相比有更多的选项,但每款主题都可以通过某些方式来配置或者定制。 + +例如, Nexus主题中 (上图所示) 你可以更改脉冲粒子的数量,颜色,大小和出现频率。 + +首选项提供了 **通用选项** 适用于所有主题,包括: + +- 设置登陆界面的动态壁纸 +- 自定义动画背景 +- 调节 FPS (包括在屏幕上显示FPS) +- 指定多显示器行为 + +有如此多的选项,diy适用于你自己的桌面背景是很容易的。 + +### 缺陷 ### + +#### 没有桌面图标 #### +Live Wallpaper在运行时,你无法在桌面添加,打开或者是编辑文件和文件夹。 + +首选项程序提供了一个选项来让你这样做(只是猜测)。也许是它只能在老版本中使用,在我们的测试中-测试环境为Ununtu 14.10,它并没有用。 +在测试中发现当把桌面壁纸设置成格式为png的图片文件时,这个选项有用,不需要是透明的png图片文件,只要是png图片文件就行了。 + +#### 资源占用 #### + +动态壁纸与标准的壁纸相比要消耗更多的系统资源。 + +我们并不是说任何时候都会消耗大量资源,但至少在我们的测试中是这样,所以低配置机器和笔记本用户要谨慎使用这款软件。可以使用 [系统监视器][2] 来追踪CPU 和GPU的负载。 + +#### 退出程序 #### + +对我来说最大的“bug”绝对是没有“退出”选项。 + +当然,Sure, 动态壁纸可以通过托盘图标和首选项完全退出,那退出托盘图标呢?没办法。只能在终端执行命令‘pkill livewallpaper’。 + +### 怎么在 Ubuntu 14.04 LTS +上安装 Live Wallpaper ### + +![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/05/terminal-command-750x146.jpg) + +要想在Ubuntu 14.04 LTS 和更高版本中安装 Live Wallpaper,你首先需要把官方PPA添加进你的软件源。 +最快的方法是在终端中执行下列命令: + + sudo add-apt-repository ppa:fyrmir/livewallpaper-daily + + sudo apt-get update && sudo apt-get install livewallpaper + +你还需要安装 indicator applet, 这样可以方便快速的打开或是关闭动态壁纸,从菜单选择主题,另外图形配置工具可以让你基于你自己的口味来配置每款主题。 + + sudo apt-get install livewallpaper-config livewallpaper-indicator + +所有都安装好之后你就可以通过Unity Dash来启动它和它的首选项工具了。 + +![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/05/live-wallpaper-app-launcher.png) + +让人不爽的是,安装完成后,程序不会自动打开托盘图标,而仅仅将它自己加入自动启动项,所以,快速来个注消 > 登陆它就会出现啦。 + +### 总结 ### + +如果你正处在无聊呆板的桌面中,幻想有一个更有活力的生活,不防试试。另外,告诉我们你想看到什么样的动态壁纸! + +-------------------------------------------------------------------------------- + +via: http://www.omgubuntu.co.uk/2015/05/animated-wallpaper-adds-live-backgrounds-to-linux-distros + +作者:[Joey-Elijah Sneddon][a] +译者:[Love-xuan](https://github.com/Love-xuan) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://plus.google.com/117485690627814051450/?rel=author +[1]:http://www.omgubuntu.co.uk/2012/11/live-wallpaper-for-ubuntu +[2]:http://www.omgubuntu.co.uk/2011/11/5-system-monitoring-tools-for-ubuntu From c0e50d3d75478b6b3eb6b4b3ed2e2d66ea456a2d Mon Sep 17 00:00:00 2001 From: wxy Date: Sat, 11 Jul 2015 15:46:15 +0800 Subject: [PATCH 571/965] =?UTF-8?q?=E8=A1=A5=E5=85=85=20PR?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @Love-xuan --- ...7 Animated Wallpaper Adds Live Backgrounds To Linux Distros.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename translated/{ => share}/20150527 Animated Wallpaper Adds Live Backgrounds To Linux Distros.md (100%) diff --git a/translated/20150527 Animated Wallpaper Adds Live Backgrounds To Linux Distros.md b/translated/share/20150527 Animated Wallpaper Adds Live Backgrounds To Linux Distros.md similarity index 100% rename from translated/20150527 Animated Wallpaper Adds Live Backgrounds To Linux Distros.md rename to translated/share/20150527 Animated Wallpaper Adds Live Backgrounds To Linux Distros.md From 08ad730415a676749a5cd9dcc9b933c939f6e90c Mon Sep 17 00:00:00 2001 From: KS Date: Sun, 12 Jul 2015 12:54:48 +0800 Subject: [PATCH 572/965] Create 20150709 Why is the ibdata1 file continuously growing in MySQL.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 翻译完成 --- ...ata1 file continuously growing in MySQL.md | 114 ++++++++++++++++++ 1 file changed, 114 insertions(+) create mode 100644 translated/tech/20150709 Why is the ibdata1 file continuously growing in MySQL.md diff --git a/translated/tech/20150709 Why is the ibdata1 file continuously growing in MySQL.md b/translated/tech/20150709 Why is the ibdata1 file continuously growing in MySQL.md new file mode 100644 index 0000000000..2632f3f173 --- /dev/null +++ b/translated/tech/20150709 Why is the ibdata1 file continuously growing in MySQL.md @@ -0,0 +1,114 @@ +为什么mysql里的ibdata1文件不断的增长? +================================================================================ +![ibdata1 file](https://www.percona.com/blog/wp-content/uploads/2013/08/ibdata1-file.jpg) + +我们在[Percona支持][1]经常收到关于MySQL的ibdata1文件的这个问题。 + +当监控服务器发送一个关于MySQL服务器存储的报警恐慌就开始了 - 就是说磁盘快要满了。 + +一番调查后你意识到大多数地盘空间被InnDB的共享表空间ibdata1使用。你已经启用了[innodb_file_per_table][2],所以问题是: + +### ibdata1存了什么? ### + +当你启用了innodb_file_per_table,表被存储在他们自己的表空间里,但是共享表空间仍然在存储其他InnoDB的内部数据: + +- 数据字典也就是InnoDB表的元数据 +- 交换缓冲区 +- 双写缓冲区 +- 撤销日志 + +在[Percona服务器][3]上有一些是可以被配置来避免增长过大的。例如你可以通过[innodb_ibuf_max_size][4]设置最大交换缓冲区或设置[innodb_doublewrite_file][5]存储双写缓冲区到一个分离的文件。 + +MySQL 5.6版中你也可以创建额外的撤销表空间所以他们将会有他们自己的文件来替代存储到ibdata1。照着[文档链接][6]检查。 + +### 什么引起ibdata1增长迅速? ### + +当MySQL出现问题通常我们需要执行的第一个命令是: + + SHOW ENGINE INNODB STATUSG(这里我觉得应该是STATUS/G) + +这将展示给我们一些很有价值的信息。我们开始检查**事务**部分,然后我们会发现这个: + + ---TRANSACTION 36E, ACTIVE 1256288 sec + MySQL thread id 42, OS thread handle 0x7f8baaccc700, query id 7900290 localhost root + show engine innodb status + Trx read view will not see trx with id >= 36F, sees < 36F + +这是一个最常见的原因,一个14天前创建的相当老的老事务。这个状态是**活动的**,这意味着InnoDB已经创建了一个快照数据,所以需要在**撤销**日志中维护旧页面,以保障数据库的一致性视图,直到事务开始。如果你的数据库是写负载大,那就意味着大量的撤销页已经被存储了。 + +如果你找不到任何长时间运行的事务,你也可以监控INNODB状态中的其他的变量,“**历史记录列表长度**”展示了一些等待清除操作。这种情况下问题经常发生,因为清除线程(或者老版本的主线程)不能以这些记录进来的速度处理撤销。 + +### 我怎么检查什么被存储到了ibdata1里了? ### + +很不幸MySQL不提供什么被存储到ibdata1共享表空间的信息但是有两个工具将会很有帮助。第一个是马克·卡拉汉制作的一个修订版本的innochecksum并且发布在[这个漏洞报告][7]。 + +它相当易于使用: + + # ./innochecksum /var/lib/mysql/ibdata1 + 0 bad checksum + 13 FIL_PAGE_INDEX + 19272 FIL_PAGE_UNDO_LOG + 230 FIL_PAGE_INODE + 1 FIL_PAGE_IBUF_FREE_LIST + 892 FIL_PAGE_TYPE_ALLOCATED + 2 FIL_PAGE_IBUF_BITMAP + 195 FIL_PAGE_TYPE_SYS + 1 FIL_PAGE_TYPE_TRX_SYS + 1 FIL_PAGE_TYPE_FSP_HDR + 1 FIL_PAGE_TYPE_XDES + 0 FIL_PAGE_TYPE_BLOB + 0 FIL_PAGE_TYPE_ZBLOB + 0 other + 3 max index_id + +全部的20608中有19272个撤销日志页。**这是表空间的93%**。 + +第二个检查表空间内容的方式是杰里米科尔制作的[InnoDB Ruby工具][8]。它是个更先进的工具来检查InnoDB的内部结构。例如我们可以使用space-summary参数来得到每个页面及其数据类型的列表。我们可以使用标准的Unix工具**撤销日志**页的数量: + + # innodb_space -f /var/lib/mysql/ibdata1 space-summary | grep UNDO_LOG | wc -l + 19272 + +尽管这种特殊的情况innochedcksum更快更容易使用,我推荐你使用杰里米的工具去学习更多的InnoDB内部数据分布和内部结构。 + +好,现在我们知道问题所在。下一个问题: + +### 我能怎么解决问题? ### + +这个问题的答案很简单。如果你还能提交语句,就做吧。如果不能你必须要杀掉进程开始回滚进程。那将停止ibdata1的增长但是很清楚你的软件有一个漏洞或者出了一些错误。现在你知道如何去鉴定问题所在,你需要使用你自己的调试工具或普通语句日志找出谁或者什么引起的问题。 + +如果问题发生在清除线程,解决方法通常是升级到新版本,新版中使用一个独立的清除线程替代主线程。更多信息查看[文档链接][9] + +### 有什么方法恢复已使用的空间么? ### + +没有,目前不可能有一个容易并且快速的方法。InnoDB表空间从不收缩...见[10年老漏洞报告][10]最新更新自詹姆斯(谢谢): + +当你删除一些行,这个页被标为已删除稍后重用,但是这个空间从不会被恢复。只有一种方式来启动数据库使用新的ibdata1。做这个你应该需要使用mysqldump做一个逻辑全备份。然后停止MySQL并删除所有数据库、ib_logfile*、ibdata1*文件。当你再启动MySQL的时候将会创建一个新的共享表空间。然后恢复逻辑仓库。 + +### 总结 ### + +当ibdata1文件增长太快,通常是MySQL里长时间运行的被遗忘的事务引起的。尝试去解决问题越快越好(提交或者杀死事务)因为没有痛苦缓慢的mysqldump执行你不能恢复浪费的磁盘空间。 + +监控数据库避免这些问题也是非常推荐的。我们的[MySQL监控插件][11]包括一个Nagios脚本,如果发现了一个太老的运行事务它可以提醒你。 + +-------------------------------------------------------------------------------- + +via: https://www.percona.com/blog/2013/08/20/why-is-the-ibdata1-file-continuously-growing-in-mysql/ + +作者:[Miguel Angel Nieto][a] +译者:[wyangsun](https://github.com/wyangsun) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://www.percona.com/blog/author/miguelangelnieto/ +[1]:https://www.percona.com/products/mysql-support +[2]:http://dev.mysql.com/doc/refman/5.5/en/innodb-parameters.html#sysvar_innodb_file_per_table +[3]:https://www.percona.com/software/percona-server +[4]:https://www.percona.com/doc/percona-server/5.5/scalability/innodb_insert_buffer.html#innodb_ibuf_max_size +[5]:https://www.percona.com/doc/percona-server/5.5/performance/innodb_doublewrite_path.html?id=percona-server:features:percona_innodb_doublewrite_path#innodb_doublewrite_file +[6]:http://dev.mysql.com/doc/refman/5.6/en/innodb-performance.html#innodb-undo-tablespace +[7]:http://bugs.mysql.com/bug.php?id=57611 +[8]:https://github.com/jeremycole/innodb_ruby +[9]:http://dev.mysql.com/doc/innodb/1.1/en/innodb-improved-purge-scheduling.html +[10]:http://bugs.mysql.com/bug.php?id=1341 +[11]:https://www.percona.com/software/percona-monitoring-plugins From 3dd7d0b76a5efe87405fc5120b08cf08ba2f27eb Mon Sep 17 00:00:00 2001 From: KS Date: Sun, 12 Jul 2015 12:55:23 +0800 Subject: [PATCH 573/965] Delete 20150709 Why is the ibdata1 file continuously growing in MySQL.md --- ...ata1 file continuously growing in MySQL.md | 115 ------------------ 1 file changed, 115 deletions(-) delete mode 100644 sources/tech/20150709 Why is the ibdata1 file continuously growing in MySQL.md diff --git a/sources/tech/20150709 Why is the ibdata1 file continuously growing in MySQL.md b/sources/tech/20150709 Why is the ibdata1 file continuously growing in MySQL.md deleted file mode 100644 index 2fcf9353bb..0000000000 --- a/sources/tech/20150709 Why is the ibdata1 file continuously growing in MySQL.md +++ /dev/null @@ -1,115 +0,0 @@ -wyangsun 翻译中 -Why is the ibdata1 file continuously growing in MySQL? -================================================================================ -![ibdata1 file](https://www.percona.com/blog/wp-content/uploads/2013/08/ibdata1-file.jpg) - -We receive this question about the ibdata1 file in MySQL very often in [Percona Support][1]. - -The panic starts when the monitoring server sends an alert about the storage of the MySQL server – saying that the disk is about to get filled. - -After some research you realize that most of the disk space is used by the InnoDB’s shared tablespace ibdata1. You have [innodb_file_per_table][2] enabled, so the question is: - -### What is stored in ibdata1? ### - -When you have innodb_file_per_table enabled, the tables are stored in their own tablespace but the shared tablespace is still used to store other InnoDB’s internal data: - -- data dictionary aka metadata of InnoDB tables -- change buffer -- doublewrite buffer -- undo logs - -Some of them can be configured on [Percona Server][3] to avoid becoming too large. For example you can set a maximum size for change buffer with [innodb_ibuf_max_size][4] or store the doublewrite buffer on a separate file with [innodb_doublewrite_file][5]. - -In MySQL 5.6 you can also create external UNDO tablespaces so they will be in their own files instead of stored inside ibdata1. Check following [documentation link][6]. - -### What is causing the ibdata1 to grow that fast? ### - -Usually the first command that we need to run when there is a MySQL problem is: - - SHOW ENGINE INNODB STATUSG - -That will show us very valuable information. We start checking the **TRANSACTIONS** section and we find this: - - ---TRANSACTION 36E, ACTIVE 1256288 sec - MySQL thread id 42, OS thread handle 0x7f8baaccc700, query id 7900290 localhost root - show engine innodb status - Trx read view will not see trx with id >= 36F, sees < 36F - -This is the most common reason, a pretty old transaction created 14 days ago. The status is **ACTIVE**, that means InnoDB has created a snapshot of the data so it needs to maintain old pages in **undo** to be able to provide a consistent view of the database since that transaction was started. If your database is heavily write loaded that means lots of undo pages are being stored. - -If you don’t find any long-running transaction you can also monitor another variable from the INNODB STATUS, the “**History list length.**” It shows the number of pending purge operations. In this case the problem is usually caused because the purge thread (or master thread in older versions) is not capable to process undo records with the same speed as they come in. - -### How can I check what is being stored in the ibdata1? ### - -Unfortunately MySQL doesn’t provide information of what is being stored on that ibdata1 shared tablespace but there are two tools that will be very helpful. First a modified version of innochecksum made by Mark Callaghan and published in [this bug report][7]. - -It is pretty easy to use: - - # ./innochecksum /var/lib/mysql/ibdata1 - 0 bad checksum - 13 FIL_PAGE_INDEX - 19272 FIL_PAGE_UNDO_LOG - 230 FIL_PAGE_INODE - 1 FIL_PAGE_IBUF_FREE_LIST - 892 FIL_PAGE_TYPE_ALLOCATED - 2 FIL_PAGE_IBUF_BITMAP - 195 FIL_PAGE_TYPE_SYS - 1 FIL_PAGE_TYPE_TRX_SYS - 1 FIL_PAGE_TYPE_FSP_HDR - 1 FIL_PAGE_TYPE_XDES - 0 FIL_PAGE_TYPE_BLOB - 0 FIL_PAGE_TYPE_ZBLOB - 0 other - 3 max index_id - -It has 19272 UNDO_LOG pages from a total of 20608. **That’s the 93% of the tablespace**. - -The second way to check the content of a tablespace are the [InnoDB Ruby Tools][8] made by Jeremy Cole. It is a more advanced tool to examine the internals of InnoDB. For example we can use the space-summary parameter to get a list with every page and its data type. We can use standard Unix tools to get the number of **UNDO_LOG** pages: - - # innodb_space -f /var/lib/mysql/ibdata1 space-summary | grep UNDO_LOG | wc -l - 19272 - -Altough in this particular case innochecksum is faster and easier to use I recommend you to play with Jeremy’s tools to learn more about the data distribution inside InnoDB and its internals. - -OK, now we know where the problem is. The next question: - -### How can I solve the problem? ### - -The answer to this question is easy. If you can still commit that query, do it. If not you’ll have to kill the thread to start the rollback process. That will just stop ibdata1 from growing but it is clear that your software has a bug or someone made a mistake. Now that you know how to identify where is the problem you need to find who or what is causing it using your own debugging tools or the general query log. - -If the problem is caused by the purge thread then the solution is usually to upgrade to a newer version where you can use a dedicated purge thread instead of the master thread. More information on the following [documentation link][9]. - -### Is there any way to recover the used space? ### - -No, it is not possible at least in an easy and fast way. InnoDB tablespaces never shrink… see the following [10-year old bug report][10] recently updated by James Day (thanks): - -When you delete some rows, the pages are marked as deleted to reuse later but the space is never recovered. The only way is to start the database with fresh ibdata1. To do that you would need to take a full logical backup with mysqldump. Then stop MySQL and remove all the databases, ib_logfile* and ibdata* files. When you start MySQL again it will create a new fresh shared tablespace. Then, recover the logical dump. - -### Summary ### - -When the ibdata1 file is growing too fast within MySQL it is usually caused by a long running transaction that we have forgotten about. Try to solve the problem as fast as possible (commiting or killing a transaction) because you won’t be able to recover the wasted disk space without the painfully slow mysqldump process. - -Monitoring the database to avoid these kind of problems is also very recommended. Our [MySQL Monitoring Plugins][11] includes a Nagios script that can alert you if it finds a too old running transaction. - --------------------------------------------------------------------------------- - -via: https://www.percona.com/blog/2013/08/20/why-is-the-ibdata1-file-continuously-growing-in-mysql/ - -作者:[Miguel Angel Nieto][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://www.percona.com/blog/author/miguelangelnieto/ -[1]:https://www.percona.com/products/mysql-support -[2]:http://dev.mysql.com/doc/refman/5.5/en/innodb-parameters.html#sysvar_innodb_file_per_table -[3]:https://www.percona.com/software/percona-server -[4]:https://www.percona.com/doc/percona-server/5.5/scalability/innodb_insert_buffer.html#innodb_ibuf_max_size -[5]:https://www.percona.com/doc/percona-server/5.5/performance/innodb_doublewrite_path.html?id=percona-server:features:percona_innodb_doublewrite_path#innodb_doublewrite_file -[6]:http://dev.mysql.com/doc/refman/5.6/en/innodb-performance.html#innodb-undo-tablespace -[7]:http://bugs.mysql.com/bug.php?id=57611 -[8]:https://github.com/jeremycole/innodb_ruby -[9]:http://dev.mysql.com/doc/innodb/1.1/en/innodb-improved-purge-scheduling.html -[10]:http://bugs.mysql.com/bug.php?id=1341 -[11]:https://www.percona.com/software/percona-monitoring-plugins From 46032c4da877dce0a15a83730f83a6a248159631 Mon Sep 17 00:00:00 2001 From: Chang Liu Date: Sun, 12 Jul 2015 15:50:07 +0800 Subject: [PATCH 574/965] [Translated]20150709 Install Google Hangouts Desktop Client In Linux.md --- ...Google Hangouts Desktop Client In Linux.md | 69 ------------------- ...Google Hangouts Desktop Client In Linux.md | 67 ++++++++++++++++++ 2 files changed, 67 insertions(+), 69 deletions(-) delete mode 100644 sources/tech/20150709 Install Google Hangouts Desktop Client In Linux.md create mode 100644 translated/tech/20150709 Install Google Hangouts Desktop Client In Linux.md diff --git a/sources/tech/20150709 Install Google Hangouts Desktop Client In Linux.md b/sources/tech/20150709 Install Google Hangouts Desktop Client In Linux.md deleted file mode 100644 index 426f0c0ffc..0000000000 --- a/sources/tech/20150709 Install Google Hangouts Desktop Client In Linux.md +++ /dev/null @@ -1,69 +0,0 @@ -FSSlc translating - -Install Google Hangouts Desktop Client In Linux -================================================================================ -![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/google-hangouts-header-664x374.jpg) - -Earlier, we have seen how to [install Facebook Messenger in Linux][1] and [WhatsApp desktop client in Linux][2]. Both of these were unofficial apps. I have one more unofficial app for today and it is [Google Hangouts][3]. - -Of course, you can use Google Hangouts in the web browser but it is more fun to use the desktop client than the web browser one. Curious? Let’s see how to **install Google Hangouts desktop client in Linux** and how to use it. - -### Install Google Hangouts in Linux ### - -We are going to use an open source project called [yakyak][4] which is unofficial Google Hangouts client for Linux, Windows and OS X. I’ll show you how to use yakyak in Ubuntu but I believe that you can use the same method to use it in other Linux distributions. Before we see how to use it, let’s first take a look at main features of yakyak: - -- Send and receive chat messages -- Create and change conversations (rename, add people) -- Leave and/or delete conversation -- Desktop notifications -- Toggle notifications on/off -- Drag-drop, copy-paste or attach-button for image upload. -- Hangupsbot sync room aware (actual user pics) -- Shows inline images -- History scrollback - -Sounds good enough? Download the installation files from the link below: - -- [Download Google Hangout client yakyak][5] - -The downloaded file would be compressed. Extract it and you will see a directory like linux-x64 or linux-x32 based on your system. Go in to this directory and you should see a file named yakyak. Double click on it to run it. - -![Run Google Hangout in Linux](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/Google_Hangout_Linux_3.jpeg) - -You’ll have to enter your Google Account credentials of course. - -![Set up Google Hangouts in Ubuntu](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/Google_Hangout_Linux_2.jpeg) - -Once you are through, you’ll see a screen like the one below where you can chat with your Google contacts. - -![Google_Hangout_Linux_4](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/Google_Hangout_Linux_4.jpeg) - -If you want to show profile pictures of the contacts, you can select View->Show conversation thumbnails. - -![Google hangouts thumbnails](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/Google_Hangout_Linux_5.jpeg) - -You’ll also get desktop notification for new messages. - -![desktop notifications for Google Hangouts in Ubuntu Linux](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/Google_Hangout_Linux_1.jpeg) - -### Worth a try? ### - -I let you give it a try and decide whether or not it is worth to **install Google Hangouts client in Linux**. If you want official apps, take a look at these [instant messaging applications with native Linux clients][6]. Don’t forget to share your experience with Google Hangouts in Linux. - --------------------------------------------------------------------------------- - -via: http://itsfoss.com/install-google-hangouts-linux/ - -作者:[Abhishek][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://itsfoss.com/author/abhishek/ -[1]:http://itsfoss.com/facebook-messenger-linux/ -[2]:http://itsfoss.com/whatsapp-linux-desktop/ -[3]:http://www.google.com/+/learnmore/hangouts/ -[4]:https://github.com/yakyak/yakyak -[5]:https://github.com/yakyak/yakyak -[6]:http://itsfoss.com/best-messaging-apps-linux/ diff --git a/translated/tech/20150709 Install Google Hangouts Desktop Client In Linux.md b/translated/tech/20150709 Install Google Hangouts Desktop Client In Linux.md new file mode 100644 index 0000000000..e8257cbedf --- /dev/null +++ b/translated/tech/20150709 Install Google Hangouts Desktop Client In Linux.md @@ -0,0 +1,67 @@ +在 Linux 中安装 Google 环聊桌面客户端 +================================================================================ +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/google-hangouts-header-664x374.jpg) + +先前,我们已经介绍了如何[在 Linux 中安装 Facebook Messenger][1] 和[WhatsApp 桌面客户端][2]。这些应用都是非官方的应用。今天,我将为你推荐另一款非官方的应用,它就是 [Google 环聊][3] + +当然,你可以在 Web 浏览器中使用 Google 环聊,但相比于此,使用桌面客户端会更加有趣。好奇吗?那就跟着我看看如何 **在 Linux 中安装 Google 环聊** 以及如何使用它把。 + +### 在 Linux 中安装 Google 环聊 ### + +我们将使用一个名为 [yakyak][4] 的开源项目,它是一个针对 Linux,Windows 和 OS X 平台的非官方 Google 环聊客户端。我将向你展示如何在 Ubuntu 中使用 yakyak,但我相信在其他的 Linux 发行版本中,你可以使用同样的方法来使用它。在了解如何使用它之前,让我们先看看 yakyak 的主要特点: + +- 发送和接受聊天信息 +- 创建和更改对话 (重命名, 添加人物) +- 离开或删除对话 +- 桌面提醒通知 +- 打开或关闭通知 +- 针对图片上传,支持拖放,复制粘贴或使用上传按钮 +- Hangupsbot 房间同步(实际的用户图片) (注: 这里翻译不到位,希望改善一下) +- 展示行内图片 +- 历史回放 + +听起来不错吧,你可以从下面的链接下载到该软件的安装文件: + +- [下载 Google 环聊客户端 yakyak][5] + +下载的文件是压缩的。解压后,你将看到一个名称类似于 linux-x64 或 linux-x32 的目录,其名称取决于你的系统。进入这个目录,你应该可以看到一个名为 yakyak 的文件。双击这个文件来启动它。 + +![在 Linux 中运行 Run Google 环聊](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/Google_Hangout_Linux_3.jpeg) + +当然,你需要键入你的 Google 账号来认证。 + +![在 Ubuntu 中设置 Google 环聊](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/Google_Hangout_Linux_2.jpeg) + +一旦你通过认证后,你将看到如下的画面,在这里你可以和你的 Google 联系人进行聊天。 + +![Google_Hangout_Linux_4](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/Google_Hangout_Linux_4.jpeg) + +假如你想看看对话的配置图,你可以选择 `查看-> 展示对话缩略图` + +![Google 环聊缩略图](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/Google_Hangout_Linux_5.jpeg) + +当有新的信息时,你将得到桌面提醒。 + +![在 Ubuntu 中 Google 环聊的桌面提醒](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/Google_Hangout_Linux_1.jpeg) + +### 值得一试吗? ### + +我让你尝试一下,并决定 **在 Linux 中安装 Google 环聊客户端** 是否值得。若你想要官方的应用,你可以看看这些 [拥有原生 Linux 客户端的即时消息应用程序][6]。不要忘记分享你在 Linux 中使用 Google 环聊的体验。 + +-------------------------------------------------------------------------------- + +via: http://itsfoss.com/install-google-hangouts-linux/ + +作者:[Abhishek][a] +译者:[FSSlc](https://github.com/FSSlc) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://itsfoss.com/author/abhishek/ +[1]:http://itsfoss.com/facebook-messenger-linux/ +[2]:http://itsfoss.com/whatsapp-linux-desktop/ +[3]:http://www.google.com/+/learnmore/hangouts/ +[4]:https://github.com/yakyak/yakyak +[5]:https://github.com/yakyak/yakyak +[6]:http://itsfoss.com/best-messaging-apps-linux/ From 963fac2322cc5cee4b63c6c9aae96bac4510215c Mon Sep 17 00:00:00 2001 From: Chang Liu Date: Sun, 12 Jul 2015 15:55:59 +0800 Subject: [PATCH 575/965] Update 20150629 Backup with these DeDuplicating Encryption Tools.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 准备翻译这篇文章。 --- ...150629 Backup with these DeDuplicating Encryption Tools.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/share/20150629 Backup with these DeDuplicating Encryption Tools.md b/sources/share/20150629 Backup with these DeDuplicating Encryption Tools.md index c6fe06832a..ba4777996b 100644 --- a/sources/share/20150629 Backup with these DeDuplicating Encryption Tools.md +++ b/sources/share/20150629 Backup with these DeDuplicating Encryption Tools.md @@ -1,3 +1,5 @@ +FSSlc Translating + Backup with these DeDuplicating Encryption Tools ================================================================================ Data is growing both in volume and value. It is becoming increasingly important to be able to back up and restore this information quickly and reliably. As society has adapted to technology and learned how to depend on computers and mobile devices, there are few that can deal with the reality of losing important data. Of firms that suffer the loss of data, 30% fold within a year, 70% cease trading within five years. This highlights the value of data. @@ -155,4 +157,4 @@ via: http://www.linuxlinks.com/article/20150628060000607/BackupTools.html [3]:http://obnam.org/ [4]:http://duplicity.nongnu.org/ [5]:http://zbackup.org/ -[6]:https://bup.github.io/ \ No newline at end of file +[6]:https://bup.github.io/ From 4a44cd8c1d710de0e0a4089d7f7da7a786710868 Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 12 Jul 2015 22:52:58 +0800 Subject: [PATCH 576/965] PUB:20150527 How to Develop Own Custom Linux Distribution From Scratch @wwy-hust --- ... Custom Linux Distribution From Scratch.md | 93 +++++++++++++++++++ ... Custom Linux Distribution From Scratch.md | 65 ------------- 2 files changed, 93 insertions(+), 65 deletions(-) create mode 100644 published/20150527 How to Develop Own Custom Linux Distribution From Scratch.md delete mode 100644 translated/share/20150527 How to Develop Own Custom Linux Distribution From Scratch.md diff --git a/published/20150527 How to Develop Own Custom Linux Distribution From Scratch.md b/published/20150527 How to Develop Own Custom Linux Distribution From Scratch.md new file mode 100644 index 0000000000..3bf454a476 --- /dev/null +++ b/published/20150527 How to Develop Own Custom Linux Distribution From Scratch.md @@ -0,0 +1,93 @@ +LFS中文版手册发布:如何打造自己的 Linux 发行版 +================================================================================ +您是否想过打造您自己的 Linux 发行版?每个 Linux 用户在他们使用 Linux 的过程中都想过做一个他们自己的发行版,至少一次。我也不例外,作为一个 Linux 菜鸟,我也考虑过开发一个自己的 Linux 发行版。从头开发一个 Linux 发行版这件事情被称作 Linux From Scratch (LFS)。 + +在开始之前,我总结了一些有关 LFS 的内容,如下: + +**1. 那些想要打造他们自己的 Linux 发行版的人应该了解打造一个 Linux 发行版(打造意味着从头开始)与配置一个已有的 Linux 发行版的不同** + +如果您只是想调整下启动屏幕、定制登录页面以及拥有更好的外观和使用体验。您可以选择任何一个 Linux 发行版并且按照您的喜好进行个性化配置。此外,有许多配置工具可以帮助您。 + +如果您想打包所有必须的文件、引导加载器和内核,并选择什么该被包括进来,然后依靠自己编译这一切东西。那么您需要的就是 Linux From Scratch (LFS)。 + +**注意**:如果您只想要定制 Linux 系统的外表和体验,这个指南并不适合您。但如果您真的想打造一个 Linux 发行版,并且向了解怎么开始以及一些其他的信息,那么这个指南正是为您而写。 + +**2. 打造一个 Linux 发行版(LFS)的好处** + +- 您将了解 Linux 系统的内部工作机制 +- 您将开发一个灵活的适应您需求的系统 +- 您开发的系统(LFS)将会非常紧凑,因为您对该包含/不该包含什么拥有绝对的掌控 +- 您开发的系统(LFS)在安全性上会更好 + +**3. 打造一个Linux发行版(LFS)的坏处** + +打造一个 Linux 系统意味着将所有需要的东西放在一起并且编译之。这需要许多查阅、耐心和时间。而且您需要一个可用的 Linux 系统和足够的磁盘空间来打造 LFS。 + +**4. 有趣的是,Gentoo/GNU Linux 在某种意义上最接近于 LFS。Gentoo 和 LFS 都是完全从源码编译的定制的 Linux 系统** + +**5. 您应该是一个有经验的Linux用户,对编译包、解决依赖有相当的了解,并且是个 shell 脚本的专家。** + +了解一门编程语言(最好是 C 语言)将会使事情变得容易些。但哪怕您是一个新手,只要您是一个优秀的学习者,可以很快的掌握知识,您也可以开始。最重要的是不要在 LFS 过程中丢失您的热情。 + +如果您不够坚定,恐怕会在 LFS 进行到一半时放弃。 + +**6. 现在您需要一步一步的指导来打造一个 Linux 。LFS 手册是打造 LFS 的官方指南。我们的合作站点 tradepub 也为我们的读者制作了 LFS 的指南,这同样是免费的。 ### + +您可以从下面的链接下载 Linux From Scratch 的电子书: + +[![](http://www.tecmint.com/wp-content/uploads/2015/05/Linux-From-Scratch.gif)][1] + +下载: [Linux From Scratch][1] + +**7. 当前 LFS 的版本是 7.7,分为 systemd 版本和非 systemd 版本** + +LFS 的官方网站是: http://www.linuxfromscratch.org/ + +您可以在官网在线浏览 LFS 以及类似 BLFS 这样的相关项目的手册,也可以下载不同格式的版本。 + +- LFS (非 systemd 版本): + - PDF 版本: http://www.linuxfromscratch.org/lfs/downloads/stable/LFS-BOOK-7.7.pdf + - 单一 HTML 版本: http://www.linuxfromscratch.org/lfs/downloads/stable/LFS-BOOK-7.7-NOCHUNKS.html + - 打包的多页 HTML 版本: http://www.linuxfromscratch.org/lfs/downloads/stable/LFS-BOOK-7.7.tar.bz2 +- LFS (systemd 版本): + - PDF 版本: http://www.linuxfromscratch.org/lfs/downloads/7.7-systemd/LFS-BOOK-7.7-systemd.pdf + - 单一 HTML 版本: http://www.linuxfromscratch.org/lfs/downloads/7.7-systemd/LFS-BOOK-7.7-systemd-NOCHUNKS.html + - 打包的多页 HTML 版本: http://www.linuxfromscratch.org/lfs/downloads/7.7-systemd/LFS-BOOK-7.7-systemd.tar.bz2 + +**8. Linux 中国/LCTT 翻译了一份 LFS 手册(7.7,systemd 版本)** + +经过 LCTT 成员的努力,我们终于完成了对 LFS 7.7 systemd 版本手册的翻译。 + +手册在线访问地址:https://linux.cn/lfs/LFS-BOOK-7.7-systemd/index.html 。 + +其它格式的版本稍后推出。 + +感谢参与翻译的成员: wxy, ictlyh, dongfengweixiao, zpl1025, H-mudcup, Yuking-net, kevinSJ 。 + + +### 关于:Linux From Scratch ### + +这本手册是由 LFS 的项目领头人 Gerard Beekmans 创作的, Matthew Burgess 和 Bruse Dubbs 参与编辑,两人都是LFS 项目的联合领导人。这本书内容很广泛,有 338 页之多。 + +手册中内容包括:介绍 LFS、准备构建、构建 LFS、建立启动脚本、使 LFS 可以引导,以及附录。其中涵盖了您想知道的 LFS 项目中的所有东西。 + +这本手册还给出了编译一个包的预估时间。预估的时间以编译第一个包的时间作为参考。所有的东西都以易于理解的方式呈现,甚至对于新手来说也是这样。 + +如果您有充裕的时间并且真正对构建自己的 Linux 发行版感兴趣,那么您绝对不会错过下载这个电子书(免费下载)的机会。您需要做的,便是照着这本手册在一个工作的 Linux 系统(任何 Linux 发行版,足够的磁盘空间即可)中开始构建您自己的 Linux 系统,付出时间和热情。 + +如果 Linux 使您着迷,如果您想自己动手构建一个自己的 Linux 发行版,这便是现阶段您应该知道的全部了,其他的信息您可以参考上面链接的手册中的内容。 + +请让我了解您阅读/使用这本手册的经历,这本详尽的 LFS 指南的使用是否足够简单?如果您已经构建了一个 LFS 并且想给我们的读者一些建议,欢迎留言和反馈。 + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/create-custom-linux-distribution-from-scratch/ + +作者:[Avishek Kumar][a] +译者:[wwy-hust](https://github.com/wwy-hust) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/avishek/ +[1]:http://tecmint.tradepub.com/free/w_linu01/prgm.cgi diff --git a/translated/share/20150527 How to Develop Own Custom Linux Distribution From Scratch.md b/translated/share/20150527 How to Develop Own Custom Linux Distribution From Scratch.md deleted file mode 100644 index 059f07b195..0000000000 --- a/translated/share/20150527 How to Develop Own Custom Linux Distribution From Scratch.md +++ /dev/null @@ -1,65 +0,0 @@ -δԼLinuxа -================================================================================ -ǷԼLinuxа棿ÿLinuxûʹLinuxĹжһԼķа棬һΡҲ⣬ΪһLinuxҲǹһԼLinuxа档һLinuxа汻Linux From Scratch (LFS) - -ڿʼ֮ǰܽһЩLFSݣ£ - -### 1. ЩҪԼLinuxаӦ˽һLinuxа棨ζŴͷʼһеLinuxаIJͬ ### - -ֻĻʾƵ¼Լӵиõʹ顣ѡκһLinuxа沢ҰϲýиԻá⣬ù߿԰ - -бļboot-loadersںˣѡʲôñȻԼһжôҪLinux From Scratch (LFS) - -**ע**ֻҪLinuxϵͳ飬ָϲʺһLinuxа棬˽ôʼԼһЩϢôָΪд - -### 2. һLinuxа棨LFSĺô ### - -- ˽Linuxϵͳڲ -- һӦϵͳ -- ϵͳLFSdzգΪԸð/ðʲôӵоԵƿ -- ϵͳLFSڰȫϻ - -### 3. һLinuxа棨LFSĻ ### - -һLinuxϵͳζŽҪĶһұ֮Ҫġĺʱ䡣ҪһõLinuxϵͳ㹻Ĵ̿ռLinuxϵͳ - -### 4. ȤǣGentoo/GNU LinuxijӽLFSGentooLFSȫԴĶƵLinuxϵͳ ### - -### 5. ӦһоLinuxûԱ൱˽⣬Ǹshellűרҡ˽һűԣCãʹЩһֻ֣ҪһѧϰߣԺ֪ܿʶҲԿʼҪDzҪLFSжʧ顣 ### - -ᶨ»LFSеһʱ - -### 6. ҪһһָһLinuxLFSǴLinuxĹٷָϡǵĴվtradepubҲΪǵĶLFSָϣͬѵġ ### - -ԴLinux From Scratch鼮 - -[![](http://www.tecmint.com/wp-content/uploads/2015/05/Linux-From-Scratch.gif)][1] - -: [Linux From Scratch][1] - -### ڣLinux From Scratch ### - -ⱾLFSĿͷGerard BeekmansģMatthew BurgessBruse Dubbs༭˶LFSĿ쵼ˡⱾݺܹ㷺338ҳ - -ݰLFS׼LinuxLFSűʹLFS͸¼к֪LFSĿж - -Ȿ黹˱һԤʱ䡣ԤʱԱһʱΪοеĶķʽ֣˵ - -гԣʱ䲢ԹԼLinuxаȤôԲ飨أĻᡣҪģⱾһLinuxϵͳκLinuxа棬㹻Ĵ̿ռ伴ɣпʼԼLinuxϵͳʱ顣 - -LinuxʹԣԼֹһԼLinuxа棬ֽ׶Ӧ֪ȫˣϢԲοӵеݡ - -˽Ķ/ʹⱾľⱾ꾡LFSָϵʹǷ㹻򵥣ѾһLFSǵĶһЩ飬ӭԺͷ - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/create-custom-linux-distribution-from-scratch/ - -ߣ[Avishek Kumar][a] -ߣ[wwy-hust](https://github.com/wwy-hust) -Уԣ[УID](https://github.com/УID) - - [LCTT](https://github.com/LCTT/TranslateProject) ԭ룬[Linuxй](https://linux.cn/) Ƴ - -[a]:http://www.tecmint.com/author/avishek/ -[1]:http://tecmint.tradepub.com/free/w_linu01/prgm.cgi From bc16956f1b457536f4ff6093de902a02ba88d59e Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 12 Jul 2015 23:39:07 +0800 Subject: [PATCH 577/965] PUB:20150515 Lolcat--A Command Line Tool to Output Rainbow Of Colors in Linux Terminal @FSSlc --- ...put Rainbow Of Colors in Linux Terminal.md | 59 ++++++++++--------- 1 file changed, 30 insertions(+), 29 deletions(-) rename {translated/tech => published}/20150515 Lolcat--A Command Line Tool to Output Rainbow Of Colors in Linux Terminal.md (75%) diff --git a/translated/tech/20150515 Lolcat--A Command Line Tool to Output Rainbow Of Colors in Linux Terminal.md b/published/20150515 Lolcat--A Command Line Tool to Output Rainbow Of Colors in Linux Terminal.md similarity index 75% rename from translated/tech/20150515 Lolcat--A Command Line Tool to Output Rainbow Of Colors in Linux Terminal.md rename to published/20150515 Lolcat--A Command Line Tool to Output Rainbow Of Colors in Linux Terminal.md index 4ce0ef80d0..b454f6f5aa 100644 --- a/translated/tech/20150515 Lolcat--A Command Line Tool to Output Rainbow Of Colors in Linux Terminal.md +++ b/published/20150515 Lolcat--A Command Line Tool to Output Rainbow Of Colors in Linux Terminal.md @@ -1,26 +1,26 @@ -Lolcat – 一个在 Linux 终端中输出彩虹特效的命令行工具 +Lolcat :一个在 Linux 终端中输出彩虹特效的命令行工具 ================================================================================ 那些相信 Linux 命令行是单调无聊且没有任何乐趣的人们,你们错了,这里有一些有关 Linux 的文章,它们展示着 Linux 是如何的有趣和“淘气” 。 -- [20 个有趣的 Linux 命令或在终端中 Linux 是有趣的][1] -- [6 个有趣的好玩 Linux 命令(在终端中的乐趣)][2] -- [在 Linux 终端中的乐趣 – 把玩文字和字符计数][3] +- [Linux命令及Linux终端的20个趣事][1] +- [终端中的乐趣:6个有趣的Linux命令行工具][2] +- [Linux终端的乐趣之把玩字词计数][3] -在本文中,我将讨论一个名为“lolcat”的应用 – 它在终端中生成彩虹般的颜色。 +在本文中,我将讨论一个名为“lolcat”的小工具 – 它可以在终端中生成彩虹般的颜色。 ![为终端生成彩虹般颜色的输出的 Lolcat 命令](http://www.tecmint.com/wp-content/uploads/2015/06/Linux-Lolcat.png) -为终端生成彩虹般颜色的输出的 Lolcat 命令 +*为终端生成彩虹般颜色的输出的 Lolcat 命令* #### 何为 lolcat ? #### -Lolcat 是一个针对 Linux,BSD 和 OSX 平台的应用,它类似于 [cat 命令][4],并为 `cat` 的输出添加彩虹般的色彩。 Lolcat 原本用于在 Linux 终端中为文本添加彩虹般的色彩。 +Lolcat 是一个针对 Linux,BSD 和 OSX 平台的工具,它类似于 [cat 命令][4],并为 `cat` 的输出添加彩虹般的色彩。 Lolcat 主要用于在 Linux 终端中为文本添加彩虹般的色彩。 ### 在 Linux 中安装 Lolcat ### -**1. Lolcat 应用在许多 Linux 发行版本的软件仓库中都可获取到,但可获得的版本都有些陈旧,而你可以通过 git 仓库下载和安装最新版本的 lolcat。** +**1. Lolcat 工具在许多 Linux 发行版的软件仓库中都可获取到,但可获得的版本都有些陈旧,而你可以通过 git 仓库下载和安装最新版本的 lolcat。** -由于 Lolcat 是一个 ruby gem 程序,所以在你的系统中安装有最新版本的 RUBY 是必须的。 +由于 Lolcat 是一个 ruby gem 程序,所以在你的系统中必须安装有最新版本的 RUBY。 # apt-get install ruby [在基于 APT 的系统中] # yum install ruby [在基于 Yum 的系统中] @@ -53,7 +53,7 @@ Lolcat 是一个针对 Linux,BSD 和 OSX 平台的应用,它类似于 [cat ![Lolcat 的帮助文档](http://www.tecmint.com/wp-content/uploads/2015/06/Lolcat-Help1.png) -Lolcat 的帮助文档 +*Lolcat 的帮助文档* **4. 接着, 通过管道连接 lolcat 和其他命令,例如 ps, date 和 cal:** @@ -63,15 +63,15 @@ Lolcat 的帮助文档 ![ps 命令的输出](http://www.tecmint.com/wp-content/uploads/2015/06/ps-command-output.png) -ps 命令的输出 +*ps 命令的输出* ![Date 的输出](http://www.tecmint.com/wp-content/uploads/2015/06/Date.png) -Date 的输出 +*Date 的输出* ![Calendar 的输出](http://www.tecmint.com/wp-content/uploads/2015/06/Cal.png) -Calendar 的输出 +*Calendar 的输出* **5. 使用 lolcat 来展示一个脚本文件的代码:** @@ -79,18 +79,18 @@ Calendar 的输出 ![用 lolcat 来展示代码](http://www.tecmint.com/wp-content/uploads/2015/06/Script-Output.png) -用 lolcat 来展示代码 +*用 lolcat 来展示代码* -**6. 通过管道连接 lolcat 和 figlet 命令。Figlet 是一个展示由常规的屏幕字符组成的巨大字符串的应用。我们可以通过管道将 figlet 的输出连接到 lolcat 中来给出如下的多彩输出:** +**6. 通过管道连接 lolcat 和 figlet 命令。Figlet 是一个展示由常规的屏幕字符组成的巨大字符串的应用。我们可以通过管道将 figlet 的输出连接到 lolcat 中来展示出如下的多彩输出:** # echo I ❤ Tecmint | lolcat # figlet I Love Tecmint | lolcat ![多彩的文字](http://www.tecmint.com/wp-content/uploads/2015/06/Colorful-Text.png) -多彩的文字 +*多彩的文字* -**注**: 毫无疑问 ❤ 是一个 unicode 字符并且为了安装 figlet,你需要像下面那样使用 yum 和 apt 来得到这个软件包: +**注**: 注意, ❤ 是一个 unicode 字符。要安装 figlet,你需要像下面那样使用 yum 和 apt 来得到这个软件包: # apt-get figlet # yum install figlet @@ -102,7 +102,7 @@ Calendar 的输出 ![动的文本](http://www.tecmint.com/wp-content/uploads/2015/06/Animated-Text.gif) -动的文本 +*动的文本* 这里选项 `-a` 指的是 Animation(动画), `-d` 指的是 duration(持续时间)。在上面的例子中,持续 500 次动画。 @@ -112,7 +112,7 @@ Calendar 的输出 ![多彩地显示文件](http://www.tecmint.com/wp-content/uploads/2015/06/List-Files-Colorfully.png) -多彩地显示文件 +*多彩地显示文件* **9. 通过管道连接 lolcat 和 cowsay。cowsay 是一个可配置的正在思考或说话的奶牛,这个程序也支持其他的动物。** @@ -136,15 +136,15 @@ Calendar 的输出 skeleton snowman sodomized-sheep stegosaurus stimpy suse three-eyes turkey turtle tux unipony unipony-smaller vader vader-koala www -通过管道连接 lolcat 和 cowsay 后的输出,并且使用了‘gnu’cowfile。 +通过管道连接 lolcat 和 cowsay 后的输出,并且使用了‘gnu’形象的 cowfile。 # cowsay -f gnu ☛ Tecmint ☚ is the best Linux Resource Available online | lolcat ![使用 Lolcat 的 Cowsay](http://www.tecmint.com/wp-content/uploads/2015/06/Cowsay-with-Lolcat.png) -使用 Lolcat 的 Cowsay +*使用 Lolcat 的 Cowsay* -**注**: 你可以在管道中使用 lolcat 和其他任何命令来在终端中得到彩色的输出。 +**注**: 你可以在将 lolcat 和其他任何命令用管道连接起来在终端中得到彩色的输出。 **10. 你可以为最常用的命令创建别名来使得命令的输出呈现出彩虹般的色彩。你可以像下面那样为 ‘ls -l‘ 命令创建别名,这个命令输出一个目录中包含内容的列表。** @@ -153,23 +153,24 @@ Calendar 的输出 ![多彩的 Alias 命令](http://www.tecmint.com/wp-content/uploads/2015/06/Alias-Commands-with-Colorful.png) -多彩的 Alias 命令 +*多彩的 Alias 命令* -你可以像上面建议的那样,为任何命令创建别名。为了使得别名永久生效,你必须添加相关的代码(上面的代码是 ls -l 的别名) 到 ~/.bashrc 文件中,并确保登出后再重新登录来使得更改生效。 +你可以像上面建议的那样,为任何命令创建别名。为了使得别名永久生效,你需要添加相关的代码(上面的代码是 ls -l 的别名) 到 ~/.bashrc 文件中,并登出后再重新登录来使得更改生效。 + +现在就是这些了。我想知道你是否曾经注意过 lolcat 这个工具?你是否喜欢这篇文章?欢迎在下面的评论环节中给出你的建议和反馈。喜欢并分享我们,帮助我们传播。 -现在就是这些了。我想知道你是否曾经注意过 lolcat 这个应用?你是否喜欢这篇文章?欢迎在下面的评论环节中给出你的建议和反馈。喜欢并分享我们,帮助我们传播。 -------------------------------------------------------------------------------- via: http://www.tecmint.com/lolcat-command-to-output-rainbow-of-colors-in-linux-terminal/ 作者:[Avishek Kumar][a] 译者:[FSSlc](https://github.com/FSSlc) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 [a]:http://www.tecmint.com/author/avishek/ -[1]:http://www.tecmint.com/20-funny-commands-of-linux-or-linux-is-fun-in-terminal/ -[2]:http://www.tecmint.com/linux-funny-commands/ -[3]:http://www.tecmint.com/play-with-word-and-character-counts-in-linux/ +[1]:https://linux.cn/article-2831-1.html +[2]:https://linux.cn/article-4128-1.html +[3]:https://linux.cn/article-4088-1.html [4]:http://www.tecmint.com/13-basic-cat-command-examples-in-linux/ \ No newline at end of file From f9cd744a41862d2153ce9c3e53c168568d90899b Mon Sep 17 00:00:00 2001 From: ZTinoZ Date: Mon, 13 Jul 2015 11:39:33 +0800 Subject: [PATCH 578/965] Translating by ZTinoZ --- ... line tools for monitoring your Linux system.md} | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) rename sources/talk/{20150709 command line tools for monitoring your Linux system.md => 20150709 7 command line tools for monitoring your Linux system.md} (80%) diff --git a/sources/talk/20150709 command line tools for monitoring your Linux system.md b/sources/talk/20150709 7 command line tools for monitoring your Linux system.md similarity index 80% rename from sources/talk/20150709 command line tools for monitoring your Linux system.md rename to sources/talk/20150709 7 command line tools for monitoring your Linux system.md index 7d91a1dcaf..54764e2a54 100644 --- a/sources/talk/20150709 command line tools for monitoring your Linux system.md +++ b/sources/talk/20150709 7 command line tools for monitoring your Linux system.md @@ -1,23 +1,22 @@ -Translating by ZTinoZ -7 command line tools for monitoring your Linux system +监控你的Linux系统的7个命令行工具 ================================================================================ -**Here is a selection of basic command line tools that will make your exploration and optimization in Linux easier. ** +**这里有一些基本的命令行工具,让你能更简单地探索和操作Linux。** ![Image courtesy Meltys-stock](http://images.techhive.com/images/article/2015/06/command-line-tools-monitoring-linux-system-1-100591899-orig.png) -### Dive on in ### +### 深入 ### -One of the great things about Linux is how deeply you can dive into the system to explore how it works and to look for opportunities to fine tune performance or diagnose problems. Here is a selection of basic command line tools that will make your exploration and optimization easier. Most of these commands are already built into your Linux system, but in case they aren’t, just Google “install”, the command name, and the name of your distro and you’ll find which package needs installing (note that some commands are bundled with other commands in a package that has a different name from the one you’re looking for). If you have any other tools you use, let me know for our next Linux Tools roundup. +关于Linux最棒的一件事之一是你能深入操作系统多深,来探索它是如何工作的并寻找机会来微调性能或诊断问题。这里有一些基本的命令行工具,让你能更简单地探索和操作Linux。大多数的这些命令是在你的Linux系统中已经内建的,但假设它们不是,就用谷歌搜索命令名和你的发行版名吧,你会找到哪些包需要安装(注意,一些命令是和其它命令捆绑起来打成一个包的,你所找的包可能写的是其它的名字)。如果你知道一些你所使用的其它工具,欢迎评论。 ![Image courtesy Mark Gibbs](http://images.techhive.com/images/article/2015/06/command-line-tools-monitoring-linux-system-2-100591901-orig.png) ### How we did it ### -FYI: The screenshots in this collection were created on [Debian Linux 8.1][1] (“Jessie”) running in a virtual machine under [Oracle VirtualBox 4.3.28][2] under [OS X 10.10.3][3] (“Yosemite”). See my next slideshow “[How to install Debian Linux in a VirtualBox VM][4]” for a tutorial on how to build your own Debian VM. +FYI: 本文中的截图取自[Debian Linux 8.1][1] (“Jessie”),其运行在[OS X 10.10.3][3] (“Yosemite”)操作系统下[Oracle VirtualBox 4.3.28][2]中的一台虚拟机里。想要建立你的Debian虚拟机,可以看看我的这篇教程——“[How to install Debian Linux in a VirtualBox VM][4]”。 ![Image courtesy Mark Gibbs](http://images.techhive.com/images/article/2015/06/command-line-tools-monitoring-linux-system-3-100591902-orig.png) -### Top command ### +### Top命令 ### One of the simpler Linux system monitoring tools, the **top command** comes with pretty much every flavor of Linux. This is the default display, but pressing the “z” key switches the display to color. Other hot keys and command line switches control things such as the display of summary and memory information (the second through fourth lines), sorting the list according to various criteria, killing tasks, and so on (you can find the complete list at [here][5]). From d62fdff6ff274628ff1d41aba3674a11a8dcfa37 Mon Sep 17 00:00:00 2001 From: DeadFire Date: Mon, 13 Jul 2015 18:47:51 +0800 Subject: [PATCH 579/965] =?UTF-8?q?20150713-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...rogram Problem Detected In Ubuntu 14.04.md | 82 +++++++++++ .../20150713 How to manage Vim plugins.md | 139 ++++++++++++++++++ 2 files changed, 221 insertions(+) create mode 100644 sources/tech/20150713 How To Fix System Program Problem Detected In Ubuntu 14.04.md create mode 100644 sources/tech/20150713 How to manage Vim plugins.md diff --git a/sources/tech/20150713 How To Fix System Program Problem Detected In Ubuntu 14.04.md b/sources/tech/20150713 How To Fix System Program Problem Detected In Ubuntu 14.04.md new file mode 100644 index 0000000000..4a91a6aeb3 --- /dev/null +++ b/sources/tech/20150713 How To Fix System Program Problem Detected In Ubuntu 14.04.md @@ -0,0 +1,82 @@ +How To Fix System Program Problem Detected In Ubuntu 14.04 +================================================================================ +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/system_program_Problem_detected.jpeg) + +For the last couple of weeks, (almost) every time I was greeted with **system program problem detected on startup in Ubuntu 15.04**. I ignored it for sometime but it was quite annoying after a certain point. You won’t be too happy as well if you are greeted by a pop-up displaying this every time you boot in to the system: + +> System program problem detected +> +> Do you want to report the problem now? +> +> ![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/System_Program_Problem_Detected.png) + +I know if you are an Ubuntu user you might have faced this annoying pop-up sometimes for sure. In this post we are going to see what to do with “system program problem detected” report in Ubuntu 14.04 and 15.04. + +### What to do with “system program problem detected” error in Ubuntu? ### + +#### So what exactly is this notifier all about? #### + +Basically, this notifies you of a crash in your system. Don’t panic by the word ‘crash’. It’s not a major issue and your system is very much usable. It just that some program crashed some time in the past and Ubuntu wants you to decide whether or not you want to report this crash report to developers so that they could fix this issue. + +#### So, we click on Report problem and it will vanish? #### + +No, not really. Even if you click on report problem, you’ll be ultimately greeted with a pop up like this: + +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/Ubuntu_Internal_error.png) + +[Sorry, Ubuntu has experienced an internal error][1] is the apport that will further open a web browser and then you can file a bug report by logging or creating an account with [Launchpad][2]. You see, it is a complicated procedure which will take around four steps to complete. + +#### But, I want to help developers and let them know of the bugs! #### + +That’s very thoughtful of you and the right thing to do. But there are two issues here. First, there are high chances that the bug would have already been reported. Second, even if you take the pain of reporting the crash, it’s not a guarantee that you won’t see it again. + +#### So, you suggesting to not report the crash? #### + +Yes and no. Report the crash when you see it the first time, if you want. You can see the crashing program under “Show Details” in the above picture. But if you see it repetitively or if you do not want to report the bug, I advise you to get rid of the system crash once and for all. + +### Fix “system program problem detected” error in Ubuntu ### + +The crash reports are stored in /var/crash directory in Ubuntu. If you look in to this directory, you should see some files ending with crash. + +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/Crash_reports_Ubuntu.jpeg) + +What I suggest is that you delete these crash reports. Open a terminal and use the following command: + + sudo rm /var/crash/* + +This will delete all the content of directory /var/crash. This way you won’t be annoyed by the pop up for the programs crash that happened in the past. But if a programs crashes again, you’ll again see system program problem detected error. You can either remove the crash reports again, like we just did, or you can disable the Apport (debug tool) and permanently get rid of the pop-ups. + +#### Permanently get rid of system error pop up in Ubuntu #### + +If you do this, you’ll never be notified about any program crash that happens in the system. If you ask my view, I would say it’s not that bad a thing unless you are willing to file bug reports. If you have no intention of filing a bug report, the crash notifications and their absence will make no difference. + +To disable the Apport and get rid of system crash report completely, open a terminal and use the following command to edit the Apport settings file: + + gksu gedit /etc/default/apport + +The content of the file is: + + # set this to 0 to disable apport, or to 1 to enable it + # you can temporarily override this with + # sudo service apport start force_start=1 + enabled=1 + +Change the **enabled=1** to **enabled=0**. Save and close the file. You won’t see any pop up for crash reports after doing this. Obvious to point out that if you want to enable the crash reports again, you just need to change the same file and put enabled as 1 again. + +#### Did it work for you? #### + +I hope this tutorial helped you to fix system program problem detected in Ubuntu 14.04 and Ubuntu 15.04. Let me know if this tip helped you to get rid of this annoyance. + +-------------------------------------------------------------------------------- + +via: http://itsfoss.com/how-to-fix-system-program-problem-detected-ubuntu/ + +作者:[Abhishek][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://itsfoss.com/author/abhishek/ +[1]:http://itsfoss.com/how-to-solve-sorry-ubuntu-12-04-has-experienced-an-internal-error/ +[2]:https://launchpad.net/ \ No newline at end of file diff --git a/sources/tech/20150713 How to manage Vim plugins.md b/sources/tech/20150713 How to manage Vim plugins.md new file mode 100644 index 0000000000..7462414916 --- /dev/null +++ b/sources/tech/20150713 How to manage Vim plugins.md @@ -0,0 +1,139 @@ +How to manage Vim plugins +================================================================================ +Vim is a versatile, lightweight text editor on Linux. While its initial learning curve can be overwhelming for an average Linux user, its benefits are completely worthy. As far as the functionality goes, Vim is fully customizable by means of plugins. Due to its high level of configuration, though, you need to spend some time with its plugin system to be able to personalize Vim in an effective way. Luckily, we have several tools that make our life with Vim plugins easier. The one I use on a daily basis is Vundle. + +### What is Vundle? ### + +[Vundle][1], which stands for Vim Bundle, is a Vim plugin manager. Vundle allows you to install, update, search and clean up Vim plugins very easily. It can also manage your runtime and help with tags. In this tutorial, I am going to show how to install and use Vundle. + +### Installing Vundle ### + +First, [install Git][2] if you don't have it on your Linux system. + +Next, create a directory where Vim plugins will be downloaded and installed. By default, this directory is located at ~/.vim/bundle + + $ mkdir -p ~/.vim/bundle + +Now go ahead and install Vundle as follows. Note that Vundle itself is another Vim plugin. Thus we install Vundle under ~/.vim/bundle we created earlier. + + $ git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim + +### Configuring Vundle ### + +Now set up you .vimrc file as follows: + + set nocompatible " This is required + filetype off " This is required + + " Here you set up the runtime path + set rtp+=~/.vim/bundle/Vundle.vim + + " Initialize vundle + call vundle#begin() + + " This should always be the first + Plugin 'gmarik/Vundle.vim' + + " This examples are from https://github.com/gmarik/Vundle.vim README + Plugin 'tpope/vim-fugitive' + + " Plugin from http://vim-scripts.org/vim/scripts.html + Plugin 'L9' + + "Git plugin not hosted on GitHub + Plugin 'git://git.wincent.com/command-t.git' + + "git repos on your local machine (i.e. when working on your own plugin) + Plugin 'file:///home/gmarik/path/to/plugin' + + " The sparkup vim script is in a subdirectory of this repo called vim. + " Pass the path to set the runtimepath properly. + Plugin 'rstacruz/sparkup', {'rtp': 'vim/'} + + " Avoid a name conflict with L9 + Plugin 'user/L9', {'name': 'newL9'} + + "Every Plugin should be before this line + + call vundle#end() " required + +Let me explain the above configuration a bit. By default, Vundle downloads and installs Vim plugins from github.com or vim-scripts.org. You can modify the default behavior. + +To install from Github: + + Plugin 'user/plugin' + +To install from http://vim-scripts.org/vim/scripts.html: + + Plugin 'plugin_name' + +To install from another git repo: + + Plugin 'git://git.another_repo.com/plugin' + +To install from a local file: + + Plugin 'file:///home/user/path/to/plugin' + +Also you can customize others such as the runtime path of you plugins, which is really useful if you are programming a plugin yourself, or just want to load it from another directory that is not ~/.vim. + + Plugin 'rstacruz/sparkup', {'rtp': 'another_vim_path/'} + +If you have plugins with the same names, you can rename you plugin so that it doesn't conflict. + + Plugin 'user/plugin', {'name': 'newPlugin'} + +### Using Vum Commands ### + +Once you have set up you plugins with Vundle, you can use it to to install, update, search and clean unused plugins using several Vundle commands. + +#### Installing a new plugin #### + +The PluginInstall command will install all plugins listed in your .vimrc file. You can also install just one specific plugin by passing its name. + + :PluginInstall + :PluginInstall + +![](https://farm1.staticflickr.com/559/18998707843_438cd55463_c.jpg) + +#### Cleaning up an unused plugin #### + +If you have any unused plugin, you can remove it by using the PluginClean command. + + :PluginClean + +![](https://farm4.staticflickr.com/3814/19433047689_17d9822af6_c.jpg) + +#### Searching for a plugin #### + +If you want to install a plugin from a plugin list provided, search functionality can be useful. + +:PluginSearch + +![](https://farm1.staticflickr.com/541/19593459846_75b003443d_c.jpg) + +While searching, you can install, clean, research or reload the same list on the interactive split. Installing plugins won't load your plugins automatically. To do so, add them to you .vimrc file. + +### Conclusion ### + +Vim is an amazing tool. It can not only be a great default text editor that can make your work flow faster and smoother, but also be turned into an IDE for almost any programming language available. Vundle can be a big help in personalizing the powerful Vim environment quickly and easily. + +Note that there are several sites that allow you to find the right Vim plugins for you. Always check [http://www.vim-scripts.org][3], Github or [http://www.vimawesome.com][4] for new scripts or plugins. Also remember to use the help provider for you plugin. + +Keep rocking with your favorite text editor! + +-------------------------------------------------------------------------------- + +via: http://xmodulo.com/manage-vim-plugins.html + +作者:[Christopher Valerio][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://xmodulo.com/author/valerio +[1]:https://github.com/VundleVim/Vundle.vim +[2]:http://ask.xmodulo.com/install-git-linux.html +[3]:http://www.vim-scripts.org/ +[4]:http://www.vimawesome.com/ \ No newline at end of file From 55a111bdbafb63f6577d8339c3bcec8b8ea59910 Mon Sep 17 00:00:00 2001 From: DeadFire Date: Tue, 14 Jul 2015 10:39:43 +0800 Subject: [PATCH 580/965] =?UTF-8?q?20150714-1=20=E9=80=89=E9=A2=98=20RAID?= =?UTF-8?q?=20=E4=B8=93=E9=A2=98=20struggling=20=E6=8E=A8=E8=8D=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... RAID, Concepts of RAID and RAID Levels.md | 143 ++++++++ ...wo Devices' Using 'mdadm' Tool in Linux.md | 218 ++++++++++++ ... (Mirroring) using 'Two Disks' in Linux.md | 212 ++++++++++++ ...iping with Distributed Parity) in Linux.md | 285 ++++++++++++++++ ...ith Double Distributed Parity) in Linux.md | 320 ++++++++++++++++++ ...ing Up RAID 10 or 1+0 (Nested) in Linux.md | 275 +++++++++++++++ ...Array and Removing Failed Disks in Raid.md | 179 ++++++++++ 7 files changed, 1632 insertions(+) create mode 100644 sources/tech/RAID/Part 1 - Introduction to RAID, Concepts of RAID and RAID Levels.md create mode 100644 sources/tech/RAID/Part 2 - Creating Software RAID0 (Stripe) on 'Two Devices' Using 'mdadm' Tool in Linux.md create mode 100644 sources/tech/RAID/Part 3 - Setting up RAID 1 (Mirroring) using 'Two Disks' in Linux.md create mode 100644 sources/tech/RAID/Part 4 - Creating RAID 5 (Striping with Distributed Parity) in Linux.md create mode 100644 sources/tech/RAID/Part 5 - Setup RAID Level 6 (Striping with Double Distributed Parity) in Linux.md create mode 100644 sources/tech/RAID/Part 6 - Setting Up RAID 10 or 1+0 (Nested) in Linux.md create mode 100644 sources/tech/RAID/Part 7 - Growing an Existing RAID Array and Removing Failed Disks in Raid.md diff --git a/sources/tech/RAID/Part 1 - Introduction to RAID, Concepts of RAID and RAID Levels.md b/sources/tech/RAID/Part 1 - Introduction to RAID, Concepts of RAID and RAID Levels.md new file mode 100644 index 0000000000..6d902f7576 --- /dev/null +++ b/sources/tech/RAID/Part 1 - Introduction to RAID, Concepts of RAID and RAID Levels.md @@ -0,0 +1,143 @@ +Introduction to RAID, Concepts of RAID and RAID Levels – Part 1 +================================================================================ +RAID is a Redundant Array of Inexpensive disks, but nowadays it is called Redundant Array of Independent drives. Earlier it is used to be very costly to buy even a smaller size of disk, but nowadays we can buy a large size of disk with the same amount like before. Raid is just a collection of disks in a pool to become a logical volume. + +![RAID in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/RAID.jpg) + +Understanding RAID Setups in Linux + +Raid contains groups or sets or Arrays. A combine of drivers make a group of disks to form a RAID Array or RAID set. It can be a minimum of 2 number of disk connected to a raid controller and make a logical volume or more drives can be in a group. Only one Raid level can be applied in a group of disks. Raid are used when we need excellent performance. According to our selected raid level, performance will differ. Saving our data by fault tolerance & high availability. + +This series will be titled Preparation for the setting up RAID ‘s through Parts 1-9 and covers the following topics. + +- Part 1: Introduction to RAID, Concepts of RAID and RAID Levels +- Part 2: How to setup RAID0 (Stripe) in Linux +- Part 3: How to setup RAID1 (Mirror) in Linux +- Part 4: How to setup RAID5 (Striping with Distributed Parity) in Linux +- Part 5: How to setup RAID6 (Striping with Double Distributed Parity) in Linux +- Part 6: Setting Up RAID 10 or 1+0 (Nested) in Linux +- Part 7: Growing an Existing RAID Array and Removing Failed Disks in Raid +- Part 8: Recovering (Rebuilding) failed drives in RAID +- Part 9: Managing RAID in Linux + +This is the Part 1 of a 9-tutorial series, here we will cover the introduction of RAID, Concepts of RAID and RAID Levels that are required for the setting up RAID in Linux. + +### Software RAID and Hardware RAID ### + +Software RAID have low performance, because of consuming resource from hosts. Raid software need to load for read data from software raid volumes. Before loading raid software, OS need to get boot to load the raid software. No need of Physical hardware in software raids. Zero cost investment. + +Hardware RAID have high performance. They are dedicated RAID Controller which is Physically built using PCI express cards. It won’t use the host resource. They have NVRAM for cache to read and write. Stores cache while rebuild even if there is power-failure, it will store the cache using battery power backups. Very costly investments needed for a large scale. + +Hardware RAID Card will look like below: + +![Hardware RAID](http://www.tecmint.com/wp-content/uploads/2014/10/Hardware-RAID.jpg) + +Hardware RAID + +#### Featured Concepts of RAID #### + +- Parity method in raid regenerate the lost content from parity saved information’s. RAID 5, RAID 6 Based on Parity. +- Stripe is sharing data randomly to multiple disk. This won’t have full data in a single disk. If we use 3 disks half of our data will be in each disks. +- Mirroring is used in RAID 1 and RAID 10. Mirroring is making a copy of same data. In RAID 1 it will save the same content to the other disk too. +- Hot spare is just a spare drive in our server which can automatically replace the failed drives. If any one of the drive failed in our array this hot spare drive will be used and rebuild automatically. +- Chunks are just a size of data which can be minimum from 4KB and more. By defining chunk size we can increase the I/O performance. + +RAID’s are in various Levels. Here we will see only the RAID Levels which is used mostly in real environment. + +- RAID0 = Striping +- RAID1 = Mirroring +- RAID5 = Single Disk Distributed Parity +- RAID6 = Double Disk Distributed Parity +- RAID10 = Combine of Mirror & Stripe. (Nested RAID) + +RAID are managed using mdadm package in most of the Linux distributions. Let us get a Brief look into each RAID Levels. + +#### RAID 0 (or) Striping #### + +Striping have a excellent performance. In Raid 0 (Striping) the data will be written to disk using shared method. Half of the content will be in one disk and another half will be written to other disk. + +Let us assume we have 2 Disk drives, for example, if we write data “TECMINT” to logical volume it will be saved as ‘T‘ will be saved in first disk and ‘E‘ will be saved in Second disk and ‘C‘ will be saved in First disk and again ‘M‘ will be saved in Second disk and it continues in round-robin process. + +In this situation if any one of the drive fails we will loose our data, because with half of data from one of the disk can’t use to rebuilt the raid. But while comparing to Write Speed and performance RAID 0 is Excellent. We need at least minimum 2 disks to create a RAID 0 (Striping). If you need your valuable data don’t use this RAID LEVEL. + +- High Performance. +- There is Zero Capacity Loss in RAID 0 +- Zero Fault Tolerance. +- Write and Reading will be good performance. + +#### RAID 1 (or) Mirroring #### + +Mirroring have a good performance. Mirroring can make a copy of same data what we have. Assuming we have two numbers of 2TB Hard drives, total there we have 4TB, but in mirroring while the drives are behind the RAID Controller to form a Logical drive Only we can see the 2TB of logical drive. + +While we save any data, it will write to both 2TB Drives. Minimum two drives are needed to create a RAID 1 or Mirror. If a disk failure occurred we can reproduce the raid set by replacing a new disk. If any one of the disk fails in RAID 1, we can get the data from other one as there was a copy of same content in the other disk. So there is zero data loss. + +- Good Performance. +- Here Half of the Space will be lost in total capacity. +- Full Fault Tolerance. +- Rebuilt will be faster. +- Writing Performance will be slow. +- Reading will be good. +- Can be used for operating systems and database for small scale. + +#### RAID 5 (or) Distributed Parity #### + +RAID 5 is mostly used in enterprise levels. RAID 5 work by distributed parity method. Parity info will be used to rebuild the data. It rebuilds from the information left on the remaining good drives. This will protect our data from drive failure. + +Assume we have 4 drives, if one drive fails and while we replace the failed drive we can rebuild the replaced drive from parity informations. Parity information’s are Stored in all 4 drives, if we have 4 numbers of 1TB hard-drive. The parity information will be stored in 256GB in each drivers and other 768GB in each drives will be defined for Users. RAID 5 can be survive from a single Drive failure, If drives fails more than 1 will cause loss of data’s. + +- Excellent Performance +- Reading will be extremely very good in speed. +- Writing will be Average, slow if we won’t use a Hardware RAID Controller. +- Rebuild from Parity information from all drives. +- Full Fault Tolerance. +- 1 Disk Space will be under Parity. +- Can be used in file servers, web servers, very important backups. + +#### RAID 6 Two Parity Distributed Disk #### + +RAID 6 is same as RAID 5 with two parity distributed system. Mostly used in a large number of arrays. We need minimum 4 Drives, even if there 2 Drive fails we can rebuild the data while replacing new drives. + +Very slower than RAID 5, because it writes data to all 4 drivers at same time. Will be average in speed while we using a Hardware RAID Controller. If we have 6 numbers of 1TB hard-drives 4 drives will be used for data and 2 drives will be used for Parity. + +- Poor Performance. +- Read Performance will be good. +- Write Performance will be Poor if we not using a Hardware RAID Controller. +- Rebuild from 2 Parity Drives. +- Full Fault tolerance. +- 2 Disks space will be under Parity. +- Can be Used in Large Arrays. +- Can be use in backup purpose, video streaming, used in large scale. + +#### RAID 10 (or) Mirror & Stripe #### + +RAID 10 can be called as 1+0 or 0+1. This will do both works of Mirror & Striping. Mirror will be first and stripe will be the second in RAID 10. Stripe will be the first and mirror will be the second in RAID 01. RAID 10 is better comparing to 01. + +Assume, we have 4 Number of drives. While I’m writing some data to my logical volume it will be saved under All 4 drives using mirror and stripe methods. + +If I’m writing a data “TECMINT” in RAID 10 it will save the data as follow. First “T” will write to both disks and second “E” will write to both disk, this step will be used for all data write. It will make a copy of every data to other disk too. + +Same time it will use the RAID 0 method and write data as follow “T” will write to first disk and “E” will write to second disk. Again “C” will write to first Disk and “M” to second disk. + +- Good read and write performance. +- Here Half of the Space will be lost in total capacity. +- Fault Tolerance. +- Fast rebuild from copying data. +- Can be used in Database storage for high performance and availability. + +### Conclusion ### + +In this article we have seen what is RAID and which levels are mostly used in RAID in real environment. Hope you have learned the write-up about RAID. For RAID setup one must know about the basic Knowledge about RAID. The above content will fulfil basic understanding about RAID. + +In the next upcoming articles I’m going to cover how to setup and create a RAID using Various Levels, Growing a RAID Group (Array) and Troubleshooting with failed Drives and much more. + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/understanding-raid-setup-in-linux/ + +作者:[Babin Lonston][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/babinlonston/ \ No newline at end of file diff --git a/sources/tech/RAID/Part 2 - Creating Software RAID0 (Stripe) on 'Two Devices' Using 'mdadm' Tool in Linux.md b/sources/tech/RAID/Part 2 - Creating Software RAID0 (Stripe) on 'Two Devices' Using 'mdadm' Tool in Linux.md new file mode 100644 index 0000000000..e3bcf09799 --- /dev/null +++ b/sources/tech/RAID/Part 2 - Creating Software RAID0 (Stripe) on 'Two Devices' Using 'mdadm' Tool in Linux.md @@ -0,0 +1,218 @@ +Creating Software RAID0 (Stripe) on ‘Two Devices’ Using ‘mdadm’ Tool in Linux – Part 2 +================================================================================ +RAID is Redundant Array of Inexpensive disks, used for high availability and reliability in large scale environments, where data need to be protected than normal use. Raid is just a collection of disks in a pool to become a logical volume and contains an array. A combine drivers makes an array or called as set of (group). + +RAID can be created, if there are minimum 2 number of disk connected to a raid controller and make a logical volume or more drives can be added in an array according to defined RAID Levels. Software Raid are available without using Physical hardware those are called as software raid. Software Raid will be named as Poor man raid. + +![Setup RAID0 in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Raid0-in-Linux.jpg) + +Setup RAID0 in Linux + +Main concept of using RAID is to save data from Single point of failure, means if we using a single disk to store the data and if it’s failed, then there is no chance of getting our data back, to stop the data loss we need a fault tolerance method. So, that we can use some collection of disk to form a RAID set. + +#### What is Stripe in RAID 0? #### + +Stripe is striping data across multiple disk at the same time by dividing the contents. Assume we have two disks and if we save content to logical volume it will be saved under both two physical disks by dividing the content. For better performance RAID 0 will be used, but we can’t get the data if one of the drive fails. So, it isn’t a good practice to use RAID 0. The only solution is to install operating system with RAID0 applied logical volumes to safe your important files. + +- RAID 0 has High Performance. +- Zero Capacity Loss in RAID 0. No Space will be wasted. +- Zero Fault Tolerance ( Can’t get back the data if any one of disk fails). +- Write and Reading will be Excellent. + +#### Requirements #### + +Minimum number of disks are allowed to create RAID 0 is 2, but you can add more disk but the order should be twice as 2, 4, 6, 8. If you have a Physical RAID card with enough ports, you can add more disks. + +Here we are not using a Hardware raid, this setup depends only on Software RAID. If we have a physical hardware raid card we can access it from it’s utility UI. Some motherboard by default in-build with RAID feature, there UI can be accessed using Ctrl+I keys. + +If you’re new to RAID setups, please read our earlier article, where we’ve covered some basic introduction of about RAID. + +- [Introduction to RAID and RAID Concepts][1] + +**My Server Setup** + + Operating System : CentOS 6.5 Final + IP Address : 192.168.0.225 + Two Disks : 20 GB each + +This article is Part 2 of a 9-tutorial RAID series, here in this part, we are going to see how we can create and setup Software RAID0 or striping in Linux systems or servers using two 20GB disks named sdb and sdc. + +### Step 1: Updating System and Installing mdadm for Managing RAID ### + +1. Before setting up RAID0 in Linux, let’s do a system update and then install ‘mdadm‘ package. The mdadm is a small program, which will allow us to configure and manage RAID devices in Linux. + + # yum clean all && yum update + # yum install mdadm -y + +![install mdadm in linux](http://www.tecmint.com/wp-content/uploads/2014/10/install-mdadm-in-linux.png) + +Install mdadm Tool + +### Step 2: Verify Attached Two 20GB Drives ### + +2. Before creating RAID 0, make sure to verify that the attached two hard drives are detected or not, using the following command. + + # ls -l /dev | grep sd + +![Check Hard Drives in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Check-Hard-Drives.png) + +Check Hard Drives + +3. Once the new hard drives detected, it’s time to check whether the attached drives are already using any existing raid with the help of following ‘mdadm’ command. + + # mdadm --examine /dev/sd[b-c] + +![Check RAID Devices in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Check-Drives-using-RAID.png) + +Check RAID Devices + +In the above output, we come to know that none of the RAID have been applied to these two sdb and sdc drives. + +### Step 3: Creating Partitions for RAID ### + +4. Now create sdb and sdc partitions for raid, with the help of following fdisk command. Here, I will show how to create partition on sdb drive. + + # fdisk /dev/sdb + +Follow below instructions for creating partitions. + +- Press ‘n‘ for creating new partition. +- Then choose ‘P‘ for Primary partition. +- Next select the partition number as 1. +- Give the default value by just pressing two times Enter key. +- Next press ‘P‘ to print the defined partition. + +![Create Partitions in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Create-Partitions-in-Linux.png) + +Create Partitions + +Follow below instructions for creating Linux raid auto on partitions. + +- Press ‘L‘ to list all available types. +- Type ‘t‘to choose the partitions. +- Choose ‘fd‘ for Linux raid auto and press Enter to apply. +- Then again use ‘P‘ to print the changes what we have made. +- Use ‘w‘ to write the changes. + +![Create RAID Partitions](http://www.tecmint.com/wp-content/uploads/2014/10/Create-RAID-Partitions.png) + +Create RAID Partitions in Linux + +**Note**: Please follow same above instructions to create partition on sdc drive now. + +5. After creating partitions, verify both the drivers are correctly defined for RAID using following command. + + # mdadm --examine /dev/sd[b-c] + # mdadm --examine /dev/sd[b-c]1 + +![Verify RAID Partitions](http://www.tecmint.com/wp-content/uploads/2014/10/Verify-RAID-Partitions.png) + +Verify RAID Partitions + +### Step 4: Creating RAID md Devices ### + +6. Now create md device (i.e. /dev/md0) and apply raid level using below command. + + # mdadm -C /dev/md0 -l raid0 -n 2 /dev/sd[b-c]1 + # mdadm --create /dev/md0 --level=stripe --raid-devices=2 /dev/sd[b-c]1 + +- -C – create +- -l – level +- -n – No of raid-devices + +7. Once md device has been created, now verify the status of RAID Level, Devices and Array used, with the help of following series of commands as shown. + + # cat /proc/mdstat + +![Verify RAID Level](http://www.tecmint.com/wp-content/uploads/2014/10/Verify-RAID-Level.png) + +Verify RAID Level + + # mdadm -E /dev/sd[b-c]1 + +![Verify RAID Device](http://www.tecmint.com/wp-content/uploads/2014/10/Verify-RAID-Device.png) + +Verify RAID Device + + # mdadm --detail /dev/md0 + +![Verify RAID Array](http://www.tecmint.com/wp-content/uploads/2014/10/Verify-RAID-Array.png) + +Verify RAID Array + +### Step 5: Assiging RAID Devices to Filesystem ### + +8. Create a ext4 filesystem for a RAID device /dev/md0 and mount it under /dev/raid0. + + # mkfs.ext4 /dev/md0 + +![Create ext4 Filesystem in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Create-ext4-Filesystem.png) + +Create ext4 Filesystem + +9. Once ext4 filesystem has been created for Raid device, now create a mount point directory (i.e. /mnt/raid0) and mount the device /dev/md0 under it. + + # mkdir /mnt/raid0 + # mount /dev/md0 /mnt/raid0/ + +10. Next, verify that the device /dev/md0 is mounted under /mnt/raid0 directory using df command. + + # df -h + +11. Next, create a file called ‘tecmint.txt‘ under the mount point /mnt/raid0, add some content to the created file and view the content of a file and directory. + + # touch /mnt/raid0/tecmint.txt + # echo "Hi everyone how you doing ?" > /mnt/raid0/tecmint.txt + # cat /mnt/raid0/tecmint.txt + # ls -l /mnt/raid0/ + +![Verify Mount Device](http://www.tecmint.com/wp-content/uploads/2014/10/Verify-Mount-Device.png) + +Verify Mount Device + +12. Once you’ve verified mount points, it’s time to create an fstab entry in /etc/fstab file. + + # vim /etc/fstab + +Add the following entry as described. May vary according to your mount location and filesystem you using. + + /dev/md0 /mnt/raid0 ext4 deaults 0 0 + +![Add Device to Fstab](http://www.tecmint.com/wp-content/uploads/2014/10/Add-Device-to-Fstab.png) + +Add Device to Fstab + +13. Run mount ‘-a‘ to check if there is any error in fstab entry. + + # mount -av + +![Check Errors in Fstab](http://www.tecmint.com/wp-content/uploads/2014/10/Check-Errors-in-Fstab.png) + +Check Errors in Fstab + +### Step 6: Saving RAID Configurations ### + +14. Finally, save the raid configuration to one of the file to keep the configurations for future use. Again we use ‘mdadm’ command with ‘-s‘ (scan) and ‘-v‘ (verbose) options as shown. + + # mdadm -E -s -v >> /etc/mdadm.conf + # mdadm --detail --scan --verbose >> /etc/mdadm.conf + # cat /etc/mdadm.conf + +![Save RAID Configurations](http://www.tecmint.com/wp-content/uploads/2014/10/Save-RAID-Configurations.png) + +Save RAID Configurations + +That’s it, we have seen here, how to configure RAID0 striping with raid levels by using two hard disks. In next article, we will see how to setup RAID5. + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/create-raid0-in-linux/ + +作者:[Babin Lonston][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/babinlonston/ +[1]:http://www.tecmint.com/understanding-raid-setup-in-linux/ \ No newline at end of file diff --git a/sources/tech/RAID/Part 3 - Setting up RAID 1 (Mirroring) using 'Two Disks' in Linux.md b/sources/tech/RAID/Part 3 - Setting up RAID 1 (Mirroring) using 'Two Disks' in Linux.md new file mode 100644 index 0000000000..927a8c49f1 --- /dev/null +++ b/sources/tech/RAID/Part 3 - Setting up RAID 1 (Mirroring) using 'Two Disks' in Linux.md @@ -0,0 +1,212 @@ +Setting up RAID 1 (Mirroring) using ‘Two Disks’ in Linux – Part 3 +================================================================================ +RAID Mirroring means an exact clone (or mirror) of the same data writing to two drives. A minimum two number of disks are more required in an array to create RAID1 and it’s useful only, when read performance or reliability is more precise than the data storage capacity. + +![Create Raid1 in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Create-RAID1-in-Linux.jpeg) + +Setup Raid1 in Linux + +Mirrors are created to protect against data loss due to disk failure. Each disk in a mirror involves an exact copy of the data. When one disk fails, the same data can be retrieved from other functioning disk. However, the failed drive can be replaced from the running computer without any user interruption. + +### Features of RAID 1 ### + +- Mirror has Good Performance. +- 50% of space will be lost. Means if we have two disk with 500GB size total, it will be 1TB but in Mirroring it will only show us 500GB. +- No data loss in Mirroring if one disk fails, because we have the same content in both disks. +- Reading will be good than writing data to drive. + +#### Requirements #### + +Minimum Two number of disks are allowed to create RAID 1, but you can add more disks by using twice as 2, 4, 6, 8. To add more disks, your system must have a RAID physical adapter (hardware card). + +Here we’re using software raid not a Hardware raid, if your system has an inbuilt physical hardware raid card you can access it from it’s utility UI or using Ctrl+I key. + +Read Also: [Basic Concepts of RAID in Linux][1] + +#### My Server Setup #### + + Operating System : CentOS 6.5 Final + IP Address : 192.168.0.226 + Hostname : rd1.tecmintlocal.com + Disk 1 [20GB] : /dev/sdb + Disk 2 [20GB] : /dev/sdc + +This article will guide you through a step-by-step instructions on how to setup a software RAID 1 or Mirror using mdadm (creates and manages raid) on Linux Platform. Although the same instructions also works on other Linux distributions such as RedHat, CentOS, Fedora, etc. + +### Step 1: Installing Prerequisites and Examine Drives ### + +1. As I said above, we’re using mdadm utility for creating and managing RAID in Linux. So, let’s install the mdadm software package on Linux using yum or apt-get package manager tool. + + # yum install mdadm [on RedHat systems] + # apt-get install mdadm [on Debain systems] + +2. Once ‘mdadm‘ package has been installed, we need to examine our disk drives whether there is already any raid configured using the following command. + + # mdadm -E /dev/sd[b-c] + +![Check RAID on Disks](http://www.tecmint.com/wp-content/uploads/2014/10/Check-RAID-on-Disks.png) + +Check RAID on Disks + +As you see from the above screen, that there is no any super-block detected yet, means no RAID defined. + +### Step 2: Drive Partitioning for RAID ### + +3. As I mentioned above, that we’re using minimum two partitions /dev/sdb and /dev/sdc for creating RAID1. Let’s create partitions on these two drives using ‘fdisk‘ command and change the type to raid during partition creation. + + # fdisk /dev/sdb + +Follow the below instructions + +- Press ‘n‘ for creating new partition. +- Then choose ‘P‘ for Primary partition. +- Next select the partition number as 1. +- Give the default full size by just pressing two times Enter key. +- Next press ‘p‘ to print the defined partition. +- Press ‘L‘ to list all available types. +- Type ‘t‘to choose the partitions. +- Choose ‘fd‘ for Linux raid auto and press Enter to apply. +- Then again use ‘p‘ to print the changes what we have made. +- Use ‘w‘ to write the changes. + +![Create Disk Partitions](http://www.tecmint.com/wp-content/uploads/2014/10/Create-Disk-Partitions.png) + +Create Disk Partitions + +After ‘/dev/sdb‘ partition has been created, next follow the same instructions to create new partition on /dev/sdc drive. + + # fdisk /dev/sdc + +![Create Second Partitions](http://www.tecmint.com/wp-content/uploads/2014/10/Create-Second-Partitions.png) + +Create Second Partitions + +4. Once both the partitions are created successfully, verify the changes on both sdb & sdc drive using the same ‘mdadm‘ command and also confirm the RAID type as shown in the following screen grabs. + + # mdadm -E /dev/sd[b-c] + +![Verify Partitions Changes](http://www.tecmint.com/wp-content/uploads/2014/10/Verify-Partitions-Changes.png) + +Verify Partitions Changes + +![Check RAID Type](http://www.tecmint.com/wp-content/uploads/2014/10/Check-RAID-Type.png) + +Check RAID Type + +**Note**: As you see in the above picture, there is no any defined RAID on the sdb1 and sdc1 drives so far, that’s the reason we are getting as no super-blocks detected. + +### Step 3: Creating RAID1 Devices ### + +5. Next create RAID1 Device called ‘/dev/md0‘ using the following command and verity it. + + # mdadm --create /dev/md0 --level=mirror --raid-devices=2 /dev/sd[b-c]1 + # cat /proc/mdstat + +![Create RAID Device](http://www.tecmint.com/wp-content/uploads/2014/10/Create-RAID-Device.png) + +Create RAID Device + +6. Next check the raid devices type and raid array using following commands. + + # mdadm -E /dev/sd[b-c]1 + # mdadm --detail /dev/md0 + +![Check RAID Device type](http://www.tecmint.com/wp-content/uploads/2014/10/Check-RAID-Device-type.png) + +Check RAID Device type + +![Check RAID Device Array](http://www.tecmint.com/wp-content/uploads/2014/10/Check-RAID-Device-Array.png) + +Check RAID Device Array + +From the above pictures, one can easily understand that raid1 have been created and using /dev/sdb1 and /dev/sdc1 partitions and also you can see the status as resyncing. + +### Step 4: Creating File System on RAID Device ### + +7. Create file system using ext4 for md0 and mount under /mnt/raid1. + + # mkfs.ext4 /dev/md0 + +![Create RAID Device Filesystem](http://www.tecmint.com/wp-content/uploads/2014/10/Create-RAID-Device-Filesystem.png) + +Create RAID Device Filesystem + +8. Next, mount the newly created filesystem under ‘/mnt/raid1‘ and create some files and verify the contents under mount point. + + # mkdir /mnt/raid1 + # mount /dev/md0 /mnt/raid1/ + # touch /mnt/raid1/tecmint.txt + # echo "tecmint raid setups" > /mnt/raid1/tecmint.txt + +![Mount Raid Device](http://www.tecmint.com/wp-content/uploads/2014/10/Mount-RAID-Device.png) + +Mount Raid Device + +9. To auto-mount RAID1 on system reboot, you need to make an entry in fstab file. Open ‘/etc/fstab‘ file and add the following line at the bottom of the file. + + /dev/md0 /mnt/raid1 ext4 defaults 0 0 + +![Raid Automount Device](http://www.tecmint.com/wp-content/uploads/2014/10/RAID-Automount-Filesystem.png) + +Raid Automount Device + +10. Run ‘mount -a‘ to check whether there are any errors in fstab entry. + + # mount -av + +![Check Errors in fstab](http://www.tecmint.com/wp-content/uploads/2014/10/Check-Errors-in-fstab.png) + +Check Errors in fstab + +11. Next, save the raid configuration manually to ‘mdadm.conf‘ file using the below command. + + # mdadm --detail --scan --verbose >> /etc/mdadm.conf + +![Save Raid Configuration](http://www.tecmint.com/wp-content/uploads/2014/10/Save-Raid-Configuration.png) + +Save Raid Configuration + +The above configuration file is read by the system at the reboots and load the RAID devices. + +### Step 5: Verify Data After Disk Failure ### + +12. Our main purpose is, even after any of hard disk fail or crash our data needs to be available. Let’s see what will happen when any of disk disk is unavailable in array. + + # mdadm --detail /dev/md0 + +![Raid Device Verify](http://www.tecmint.com/wp-content/uploads/2014/10/Raid-Device-Verify.png) + +Raid Device Verify + +In the above image, we can see there are 2 devices available in our RAID and Active Devices are 2. Now let us see what will happen when a disk plugged out (removed sdc disk) or fails. + + # ls -l /dev | grep sd + # mdadm --detail /dev/md0 + +![Test RAID Devices](http://www.tecmint.com/wp-content/uploads/2014/10/Test-RAID-Devices.png) + +Test RAID Devices + +Now in the above image, you can see that one of our drive is lost. I unplugged one of the drive from my Virtual machine. Now let us check our precious data. + + # cd /mnt/raid1/ + # cat tecmint.txt + +![Verify RAID Data](http://www.tecmint.com/wp-content/uploads/2014/10/Verify-RAID-Data.png) + +Verify RAID Data + +Did you see our data is still available. From this we come to know the advantage of RAID 1 (mirror). In next article, we will see how to setup a RAID 5 striping with distributed Parity. Hope this helps you to understand how the RAID 1 (Mirror) Works. + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/create-raid1-in-linux/ + +作者:[Babin Lonston][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/babinlonston/ +[1]:http://www.tecmint.com/understanding-raid-setup-in-linux/ \ No newline at end of file diff --git a/sources/tech/RAID/Part 4 - Creating RAID 5 (Striping with Distributed Parity) in Linux.md b/sources/tech/RAID/Part 4 - Creating RAID 5 (Striping with Distributed Parity) in Linux.md new file mode 100644 index 0000000000..acd284045f --- /dev/null +++ b/sources/tech/RAID/Part 4 - Creating RAID 5 (Striping with Distributed Parity) in Linux.md @@ -0,0 +1,285 @@ +Creating RAID 5 (Striping with Distributed Parity) in Linux – Part 4 +================================================================================ +In RAID 5, data strips across multiple drives with distributed parity. The striping with distributed parity means it will split the parity information and stripe data over the multiple disks, which will have good data redundancy. + +![Setup Raid 5 in CentOS](http://www.tecmint.com/wp-content/uploads/2014/11/setup-raid-5-in-linux.jpg) + +Setup Raid 5 in Linux + +For RAID Level it should have at least three hard drives or more. RAID 5 are being used in the large scale production environment where it’s cost effective and provide performance as well as redundancy. + +#### What is Parity? #### + +Parity is a simplest common method of detecting errors in data storage. Parity stores information in each disks, Let’s say we have 4 disks, in 4 disks one disk space will be split to all disks to store the parity information’s. If any one of the disks fails still we can get the data by rebuilding from parity information after replacing the failed disk. + +#### Pros and Cons of RAID 5 #### + +- Gives better performance +- Support Redundancy and Fault tolerance. +- Support hot spare options. +- Will loose a single disk capacity for using parity information. +- No data loss if a single disk fails. We can rebuilt from parity after replacing the failed disk. +- Suits for transaction oriented environment as the reading will be faster. +- Due to parity overhead, writing will be slow. +- Rebuild takes long time. + +#### Requirements #### + +Minimum 3 hard drives are required to create Raid 5, but you can add more disks, only if you’ve a dedicated hardware raid controller with multi ports. Here, we are using software RAID and ‘mdadm‘ package to create raid. + +mdadm is a package which allow us to configure and manage RAID devices in Linux. By default there is no configuration file is available for RAID, we must save the configuration file after creating and configuring RAID setup in separate file called mdadm.conf. + +Before moving further, I suggest you to go through the following articles for understanding the basics of RAID in Linux. + +- [Basic Concepts of RAID in Linux – Part 1][1] +- [Creating RAID 0 (Stripe) in Linux – Part 2][2] +- [Setting up RAID 1 (Mirroring) in Linux – Part 3][3] + +#### My Server Setup #### + + Operating System : CentOS 6.5 Final + IP Address : 192.168.0.227 + Hostname : rd5.tecmintlocal.com + Disk 1 [20GB] : /dev/sdb + Disk 2 [20GB] : /dev/sdc + Disk 3 [20GB] : /dev/sdd + +This article is a Part 4 of a 9-tutorial RAID series, here we are going to setup a software RAID 5 with distributed parity in Linux systems or servers using three 20GB disks named /dev/sdb, /dev/sdc and /dev/sdd. + +### Step 1: Installing mdadm and Verify Drives ### + +1. As we said earlier, that we’re using CentOS 6.5 Final release for this raid setup, but same steps can be followed for RAID setup in any Linux based distributions. + + # lsb_release -a + # ifconfig | grep inet + +![Setup Raid 5 in CentOS](http://www.tecmint.com/wp-content/uploads/2014/11/CentOS-6.5-Summary.png) + +CentOS 6.5 Summary + +2. If you’re following our raid series, we assume that you’ve already installed ‘mdadm‘ package, if not, use the following command according to your Linux distribution to install the package. + + # yum install mdadm [on RedHat systems] + # apt-get install mdadm [on Debain systems] + +3. After the ‘mdadm‘ package installation, let’s list the three 20GB disks which we have added in our system using ‘fdisk‘ command. + + # fdisk -l | grep sd + +![Install mdadm Tool in CentOS](http://www.tecmint.com/wp-content/uploads/2014/11/Install-mdadm-Tool.png) + +Install mdadm Tool + +4. Now it’s time to examine the attached three drives for any existing RAID blocks on these drives using following command. + + # mdadm -E /dev/sd[b-d] + # mdadm --examine /dev/sdb /dev/sdc /dev/sdd + +![Examine Drives For Raid](http://www.tecmint.com/wp-content/uploads/2014/11/Examine-Drives-For-Raid.png) + +Examine Drives For Raid + +**Note**: From the above image illustrated that there is no any super-block detected yet. So, there is no RAID defined in all three drives. Let us start to create one now. + +### Step 2: Partitioning the Disks for RAID ### + +5. First and foremost, we have to partition the disks (/dev/sdb, /dev/sdc and /dev/sdd) before adding to a RAID, So let us define the partition using ‘fdisk’ command, before forwarding to the next steps. + + # fdisk /dev/sdb + # fdisk /dev/sdc + # fdisk /dev/sdd + +#### Create /dev/sdb Partition #### + +Please follow the below instructions to create partition on /dev/sdb drive. + +- Press ‘n‘ for creating new partition. +- Then choose ‘P‘ for Primary partition. Here we are choosing Primary because there is no partitions defined yet. +- Then choose ‘1‘ to be the first partition. By default it will be 1. +- Here for cylinder size we don’t have to choose the specified size because we need the whole partition for RAID so just Press Enter two times to choose the default full size. +- Next press ‘p‘ to print the created partition. +- Change the Type, If we need to know the every available types Press ‘L‘. +- Here, we are selecting ‘fd‘ as my type is RAID. +- Next press ‘p‘ to print the defined partition. +- Then again use ‘p‘ to print the changes what we have made. +- Use ‘w‘ to write the changes. + +![Create sdb Partition](http://www.tecmint.com/wp-content/uploads/2014/11/Create-sdb-Partition1.png) + +Create sdb Partition + +**Note**: We have to follow the steps mentioned above to create partitions for sdc & sdd drives too. + +#### Create /dev/sdc Partition #### + +Now partition the sdc and sdd drives by following the steps given in the screenshot or you can follow above steps. + + # fdisk /dev/sdc + +![Create sdc Partition](http://www.tecmint.com/wp-content/uploads/2014/11/Create-sdc-Partition1.png) + +Create sdc Partition + +#### Create /dev/sdd Partition #### + + # fdisk /dev/sdd + +![Create sdd Partition](http://www.tecmint.com/wp-content/uploads/2014/11/Create-sdd-Partition1.png) + +Create sdd Partition + +6. After creating partitions, check for changes in all three drives sdb, sdc, & sdd. + + # mdadm --examine /dev/sdb /dev/sdc /dev/sdd + + or + + # mdadm -E /dev/sd[b-c] + +![Check Partition Changes](http://www.tecmint.com/wp-content/uploads/2014/11/Check-Changes-on-Partitions.png) + +Check Partition Changes + +**Note**: In the above pic. depict the type is fd i.e. for RAID. + +7. Now Check for the RAID blocks in newly created partitions. If no super-blocks detected, than we can move forward to create a new RAID 5 setup on these drives. + +![Check Raid on Partition](http://www.tecmint.com/wp-content/uploads/2014/11/Check-Raid-on-Partitions.png) + +Check Raid on Partition + +### Step 3: Creating md device md0 ### + +8. Now create a Raid device ‘md0‘ (i.e. /dev/md0) and include raid level on all newly created partitions (sdb1, sdc1 and sdd1) using below command. + + # mdadm --create /dev/md0 --level=5 --raid-devices=3 /dev/sdb1 /dev/sdc1 /dev/sdd1 + + or + + # mdadm -C /dev/md0 -l=5 -n=3 /dev/sd[b-d]1 + +9. After creating raid device, check and verify the RAID, devices included and RAID Level from the mdstat output. + + # cat /proc/mdstat + +![Verify Raid Device](http://www.tecmint.com/wp-content/uploads/2014/11/Verify-Raid-Device.png) + +Verify Raid Device + +If you want to monitor the current building process, you can use ‘watch‘ command, just pass through the ‘cat /proc/mdstat‘ with watch command which will refresh screen every 1 second. + + # watch -n1 cat /proc/mdstat + +![Monitor Raid Process](http://www.tecmint.com/wp-content/uploads/2014/11/Monitor-Raid-Process.png) + +Monitor Raid 5 Process + +![Raid 5 Process Summary](http://www.tecmint.com/wp-content/uploads/2014/11/Raid-Process-Summary.png) + +Raid 5 Process Summary + +10. After creation of raid, Verify the raid devices using the following command. + + # mdadm -E /dev/sd[b-d]1 + +![Verify Raid Level](http://www.tecmint.com/wp-content/uploads/2014/11/Verify-Raid-Level.png) + +Verify Raid Level + +**Note**: The Output of the above command will be little long as it prints the information of all three drives. + +11. Next, verify the RAID array to assume that the devices which we’ve included in the RAID level are running and started to re-sync. + + # mdadm --detail /dev/md0 + +![Verify Raid Array](http://www.tecmint.com/wp-content/uploads/2014/11/Verify-Raid-Array.png) + +Verify Raid Array + +### Step 4: Creating file system for md0 ### + +12. Create a file system for ‘md0‘ device using ext4 before mounting. + + # mkfs.ext4 /dev/md0 + +![Create md0 Filesystem](http://www.tecmint.com/wp-content/uploads/2014/11/Create-md0-Filesystem.png) + +Create md0 Filesystem + +13. Now create a directory under ‘/mnt‘ then mount the created filesystem under /mnt/raid5 and check the files under mount point, you will see lost+found directory. + + # mkdir /mnt/raid5 + # mount /dev/md0 /mnt/raid5/ + # ls -l /mnt/raid5/ + +14. Create few files under mount point /mnt/raid5 and append some text in any one of the file to verify the content. + + # touch /mnt/raid5/raid5_tecmint_{1..5} + # ls -l /mnt/raid5/ + # echo "tecmint raid setups" > /mnt/raid5/raid5_tecmint_1 + # cat /mnt/raid5/raid5_tecmint_1 + # cat /proc/mdstat + +![Mount Raid 5 Device](http://www.tecmint.com/wp-content/uploads/2014/11/Mount-Raid-Device.png) + +Mount Raid Device + +15. We need to add entry in fstab, else will not display our mount point after system reboot. To add an entry, we should edit the fstab file and append the following line as shown below. The mount point will differ according to your environment. + + # vim /etc/fstab + + /dev/md0 /mnt/raid5 ext4 defaults 0 0 + +![Raid 5 Automount](http://www.tecmint.com/wp-content/uploads/2014/11/Raid-Device-Automount.png) + +Raid 5 Automount + +16. Next, run ‘mount -av‘ command to check whether any errors in fstab entry. + + # mount -av + +![Check Fstab Errors](http://www.tecmint.com/wp-content/uploads/2014/11/Check-Fstab-Errors.png) + +Check Fstab Errors + +### Step 5: Save Raid 5 Configuration ### + +17. As mentioned earlier in requirement section, by default RAID don’t have a config file. We have to save it manually. If this step is not followed RAID device will not be in md0, it will be in some other random number. + +So, we must have to save the configuration before system reboot. If the configuration is saved it will be loaded to the kernel during the system reboot and RAID will also gets loaded. + + # mdadm --detail --scan --verbose >> /etc/mdadm.conf + +![Save Raid 5 Configuration](http://www.tecmint.com/wp-content/uploads/2014/11/Save-Raid-5-Configuration.png) + +Save Raid 5 Configuration + +Note: Saving the configuration will keep the RAID level stable in md0 device. + +### Step 6: Adding Spare Drives ### + +18. What the use of adding a spare drive? its very useful if we have a spare drive, if any one of the disk fails in our array, this spare drive will get active and rebuild the process and sync the data from other disk, so we can see a redundancy here. + +For more instructions on how to add spare drive and check Raid 5 fault tolerance, read #Step 6 and #Step 7 in the following article. + +- [Add Spare Drive to Raid 5 Setup][4] + +### Conclusion ### + +Here, in this article, we have seen how to setup a RAID 5 using three number of disks. Later in my upcoming articles, we will see how to troubleshoot when a disk fails in RAID 5 and how to replace for recovery. + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/create-raid-5-in-linux/ + +作者:[Babin Lonston][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/babinlonston/ +[1]:http://www.tecmint.com/understanding-raid-setup-in-linux/ +[2]:http://www.tecmint.com/create-raid0-in-linux/ +[3]:http://www.tecmint.com/create-raid1-in-linux/ +[4]:http://www.tecmint.com/create-raid-6-in-linux/ \ No newline at end of file diff --git a/sources/tech/RAID/Part 5 - Setup RAID Level 6 (Striping with Double Distributed Parity) in Linux.md b/sources/tech/RAID/Part 5 - Setup RAID Level 6 (Striping with Double Distributed Parity) in Linux.md new file mode 100644 index 0000000000..2ad6a33227 --- /dev/null +++ b/sources/tech/RAID/Part 5 - Setup RAID Level 6 (Striping with Double Distributed Parity) in Linux.md @@ -0,0 +1,320 @@ +Setup RAID Level 6 (Striping with Double Distributed Parity) in Linux – Part 5 +================================================================================ +RAID 6 is upgraded version of RAID 5, where it has two distributed parity which provides fault tolerance even after two drives fails. Mission critical system still operational incase of two concurrent disks failures. It’s alike RAID 5, but provides more robust, because it uses one more disk for parity. + +In our earlier article, we’ve seen distributed parity in RAID 5, but in this article we will going to see RAID 6 with double distributed parity. Don’t expect extra performance than any other RAID, if so we have to install a dedicated RAID Controller too. Here in RAID 6 even if we loose our 2 disks we can get the data back by replacing a spare drive and build it from parity. + +![Setup RAID 6 in CentOS](http://www.tecmint.com/wp-content/uploads/2014/11/Setup-RAID-6-in-Linux.jpg) + +Setup RAID 6 in Linux + +To setup a RAID 6, minimum 4 numbers of disks or more in a set are required. RAID 6 have multiple disks even in some set it may be have some bunch of disks, while reading, it will read from all the drives, so reading would be faster whereas writing would be poor because it has to stripe over multiple disks. + +Now, many of us comes to conclusion, why we need to use RAID 6, when it doesn’t perform like any other RAID. Hmm… those who raise this question need to know that, if they need high fault tolerance choose RAID 6. In every higher environments with high availability for database, they use RAID 6 because database is the most important and need to be safe in any cost, also it can be useful for video streaming environments. + +#### Pros and Cons of RAID 6 #### + +- Performance are good. +- RAID 6 is expensive, as it requires two independent drives are used for parity functions. +- Will loose a two disks capacity for using parity information (double parity). +- No data loss, even after two disk fails. We can rebuilt from parity after replacing the failed disk. +- Reading will be better than RAID 5, because it reads from multiple disk, But writing performance will be very poor without dedicated RAID Controller. + +#### Requirements #### + +Minimum 4 numbers of disks are required to create a RAID 6. If you want to add more disks, you can, but you must have dedicated raid controller. In software RAID, we will won’t get better performance in RAID 6. So we need a physical RAID controller. + +Those who are new to RAID setup, we recommend to go through RAID articles below. + +- [Basic Concepts of RAID in Linux – Part 1][1] +- [Creating Software RAID 0 (Stripe) in Linux – Part 2][2] +- [Setting up RAID 1 (Mirroring) in Linux – Part 3][3] + +#### My Server Setup #### + + Operating System : CentOS 6.5 Final + IP Address : 192.168.0.228 + Hostname : rd6.tecmintlocal.com + Disk 1 [20GB] : /dev/sdb + Disk 2 [20GB] : /dev/sdc + Disk 3 [20GB] : /dev/sdd + Disk 4 [20GB] : /dev/sde + +This article is a Part 5 of a 9-tutorial RAID series, here we are going to see how we can create and setup Software RAID 6 or Striping with Double Distributed Parity in Linux systems or servers using four 20GB disks named /dev/sdb, /dev/sdc, /dev/sdd and /dev/sde. + +### Step 1: Installing mdadm Tool and Examine Drives ### + +1. If you’re following our last two Raid articles (Part 2 and Part 3), where we’ve already shown how to install ‘mdadm‘ tool. If you’re new to this article, let me explain that ‘mdadm‘ is a tool to create and manage Raid in Linux systems, let’s install the tool using following command according to your Linux distribution. + + # yum install mdadm [on RedHat systems] + # apt-get install mdadm [on Debain systems] + +2. After installing the tool, now it’s time to verify the attached four drives that we are going to use for raid creation using the following ‘fdisk‘ command. + + # fdisk -l | grep sd + +![Check Hard Disk in Linux](http://www.tecmint.com/wp-content/uploads/2014/11/Verify-Linux-Disks.png) + +Check Disks in Linux + +3. Before creating a RAID drives, always examine our disk drives whether there is any RAID is already created on the disks. + + # mdadm -E /dev/sd[b-e] + # mdadm --examine /dev/sdb /dev/sdc /dev/sdd /dev/sde + +![Check Raid on Disk](http://www.tecmint.com/wp-content/uploads/2014/11/Check-Disk-Raid.png) + +Check Raid on Disk + +**Note**: In the above image depicts that there is no any super-block detected or no RAID is defined in four disk drives. We may move further to start creating RAID 6. + +### Step 2: Drive Partitioning for RAID 6 ### + +4. Now create partitions for raid on ‘/dev/sdb‘, ‘/dev/sdc‘, ‘/dev/sdd‘ and ‘/dev/sde‘ with the help of following fdisk command. Here, we will show how to create partition on sdb drive and later same steps to be followed for rest of the drives. + +**Create /dev/sdb Partition** + + # fdisk /dev/sdb + +Please follow the instructions as shown below for creating partition. + +- Press ‘n‘ for creating new partition. +- Then choose ‘P‘ for Primary partition. +- Next choose the partition number as 1. +- Define the default value by just pressing two times Enter key. +- Next press ‘P‘ to print the defined partition. +- Press ‘L‘ to list all available types. +- Type ‘t‘ to choose the partitions. +- Choose ‘fd‘ for Linux raid auto and press Enter to apply. +- Then again use ‘P‘ to print the changes what we have made. +- Use ‘w‘ to write the changes. + +![Create sdb Partition](http://www.tecmint.com/wp-content/uploads/2014/11/Create-sdb-Partition.png) + +Create /dev/sdb Partition + +**Create /dev/sdb Partition** + + # fdisk /dev/sdc + +![Create sdc Partition](http://www.tecmint.com/wp-content/uploads/2014/11/Create-sdc-Partition.png) + +Create /dev/sdc Partition + +**Create /dev/sdd Partition** + + # fdisk /dev/sdd + +![Create sdd Partition](http://www.tecmint.com/wp-content/uploads/2014/11/Create-sdd-Partition.png) + +Create /dev/sdd Partition + +**Create /dev/sde Partition** + + # fdisk /dev/sde + +![Create sde Partition](http://www.tecmint.com/wp-content/uploads/2014/11/Create-sde-Partition.png) + +Create /dev/sde Partition + +5. After creating partitions, it’s always good habit to examine the drives for super-blocks. If super-blocks does not exist than we can go head to create a new RAID setup. + + # mdadm -E /dev/sd[b-e]1 + + + or + + # mdadm --examine /dev/sdb1 /dev/sdc1 /dev/sdd1 /dev/sde1 + +![Check Raid on New Partitions](http://www.tecmint.com/wp-content/uploads/2014/11/Check-Raid-on-New-Partitions.png) + +Check Raid on New Partitions + +### Step 3: Creating md device (RAID) ### + +6. Now it’s time to create Raid device ‘md0‘ (i.e. /dev/md0) and apply raid level on all newly created partitions and confirm the raid using following commands. + + # mdadm --create /dev/md0 --level=6 --raid-devices=4 /dev/sdb1 /dev/sdc1 /dev/sdd1 /dev/sde1 + # cat /proc/mdstat + +![Create Raid 6 Device](http://www.tecmint.com/wp-content/uploads/2014/11/Create-Raid-6-Device.png) + +Create Raid 6 Device + +7. You can also check the current process of raid using watch command as shown in the screen grab below. + + # watch -n1 cat /proc/mdstat + +![Check Raid 6 Process](http://www.tecmint.com/wp-content/uploads/2014/11/Check-Raid-6-Process.png) + +Check Raid 6 Process + +8. Verify the raid devices using the following command. + +# mdadm -E /dev/sd[b-e]1 + +**Note**:: The above command will be display the information of the four disks, which is quite long so not possible to post the output or screen grab here. + +9. Next, verify the RAID array to confirm that the re-syncing is started. + + # mdadm --detail /dev/md0 + +![Check Raid 6 Array](http://www.tecmint.com/wp-content/uploads/2014/11/Check-Raid-6-Array.png) + +Check Raid 6 Array + +### Step 4: Creating FileSystem on Raid Device ### + +10. Create a filesystem using ext4 for ‘/dev/md0‘ and mount it under /mnt/raid5. Here we’ve used ext4, but you can use any type of filesystem as per your choice. + + # mkfs.ext4 /dev/md0 + +![Create File System on Raid](http://www.tecmint.com/wp-content/uploads/2014/11/Create-File-System-on-Raid.png) + +Create File System on Raid 6 + +11. Mount the created filesystem under /mnt/raid6 and verify the files under mount point, we can see lost+found directory. + + # mkdir /mnt/raid6 + # mount /dev/md0 /mnt/raid6/ + # ls -l /mnt/raid6/ + +12. Create some files under mount point and append some text in any one of the file to verify the content. + + # touch /mnt/raid6/raid6_test.txt + # ls -l /mnt/raid6/ + # echo "tecmint raid setups" > /mnt/raid6/raid6_test.txt + # cat /mnt/raid6/raid6_test.txt + +![Verify Raid Content](http://www.tecmint.com/wp-content/uploads/2014/11/Verify-Raid-Content.png) + +Verify Raid Content + +13. Add an entry in /etc/fstab to auto mount the device at the system startup and append the below entry, mount point may differ according to your environment. + + # vim /etc/fstab + + /dev/md0 /mnt/raid6 ext4 defaults 0 0 + +![Automount Raid 6 Device](http://www.tecmint.com/wp-content/uploads/2014/11/Automount-Raid-Device.png) + +Automount Raid 6 Device + +14. Next, execute ‘mount -a‘ command to verify whether there is any error in fstab entry. + + # mount -av + +![Verify Raid Automount](http://www.tecmint.com/wp-content/uploads/2014/11/Verify-Automount-Raid-Devices.png) + +Verify Raid Automount + +### Step 5: Save RAID 6 Configuration ### + +15. Please note by default RAID don’t have a config file. We have to save it by manually using below command and then verify the status of device ‘/dev/md0‘. + + # mdadm --detail --scan --verbose >> /etc/mdadm.conf + # mdadm --detail /dev/md0 + +![Save Raid 6 Configuration](http://www.tecmint.com/wp-content/uploads/2014/11/Check-Raid-Status.png) + +Save Raid 6 Configuration + +![Check Raid 6 Status](http://www.tecmint.com/wp-content/uploads/2014/11/Check-Raid-Status.png) + +Check Raid 6 Status + +### Step 6: Adding a Spare Drives ### + +16. Now it has 4 disks and there are two parity information’s available. In some cases, if any one of the disk fails we can get the data, because there is double parity in RAID 6. + +May be if the second disk fails, we can add a new one before loosing third disk. It is possible to add a spare drive while creating our RAID set, But I have not defined the spare drive while creating our raid set. But, we can add a spare drive after any drive failure or while creating the RAID set. Now we have already created the RAID set now let me add a spare drive for demonstration. + +For the demonstration purpose, I’ve hot-plugged a new HDD disk (i.e. /dev/sdf), let’s verify the attached disk. + + # ls -l /dev/ | grep sd + +![Check New Disk](http://www.tecmint.com/wp-content/uploads/2014/11/Check-New-Disk.png) + +Check New Disk + +17. Now again confirm the new attached disk for any raid is already configured or not using the same mdadm command. + + # mdadm --examine /dev/sdf + +![Check Raid on New Disk](http://www.tecmint.com/wp-content/uploads/2014/11/Check-Raid-on-New-Disk.png) + +Check Raid on New Disk + +**Note**: As usual, like we’ve created partitions for four disks earlier, similarly we’ve to create new partition on the new plugged disk using fdisk command. + + # fdisk /dev/sdf + +![Create sdf Partition](http://www.tecmint.com/wp-content/uploads/2014/11/Create-Partition-on-sdf.png) + +Create /dev/sdf Partition + +18. Again after creating new partition on /dev/sdf, confirm the raid on the partition, include the spare drive to the /dev/md0 raid device and verify the added device. + + # mdadm --examine /dev/sdf + # mdadm --examine /dev/sdf1 + # mdadm --add /dev/md0 /dev/sdf1 + # mdadm --detail /dev/md0 + +![Verify Raid on sdf Partition](http://www.tecmint.com/wp-content/uploads/2014/11/Verify-Raid-on-sdf.png) + +Verify Raid on sdf Partition + +![Add sdf Partition to Raid](http://www.tecmint.com/wp-content/uploads/2014/11/Add-sdf-Partition-to-Raid.png) + +Add sdf Partition to Raid + +![Verify sdf Partition Details](http://www.tecmint.com/wp-content/uploads/2014/11/Verify-sdf-Details.png) + +Verify sdf Partition Details + +### Step 7: Check Raid 6 Fault Tolerance ### + +19. Now, let us check whether spare drive works automatically, if anyone of the disk fails in our Array. For testing, I’ve personally marked one of the drive is failed. + +Here, we’re going to mark /dev/sdd1 as failed drive. + + # mdadm --manage --fail /dev/md0 /dev/sdd1 + +![Check Raid 6 Fault Tolerance](http://www.tecmint.com/wp-content/uploads/2014/11/Check-Raid-6-Failover.png) + +Check Raid 6 Fault Tolerance + +20. Let me get the details of RAID set now and check whether our spare started to sync. + + # mdadm --detail /dev/md0 + +![Check Auto Raid Syncing](http://www.tecmint.com/wp-content/uploads/2014/11/Check-Auto-Raid-Syncing.png) + +Check Auto Raid Syncing + +**Hurray!** Here, we can see the spare got activated and started rebuilding process. At the bottom we can see the faulty drive /dev/sdd1 listed as faulty. We can monitor build process using following command. + + # cat /proc/mdstat + +![Raid 6 Auto Syncing](http://www.tecmint.com/wp-content/uploads/2014/11/Raid-6-Auto-Syncing.png) + +Raid 6 Auto Syncing + +### Conclusion: ### + +Here, we have seen how to setup RAID 6 using four disks. This RAID level is one of the expensive setup with high redundancy. We will see how to setup a Nested RAID 10 and much more in the next articles. Till then, stay connected with TECMINT. + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/create-raid-6-in-linux/ + +作者:[Babin Lonston][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/babinlonston/ +[1]:http://www.tecmint.com/understanding-raid-setup-in-linux/ +[2]:http://www.tecmint.com/create-raid0-in-linux/ +[3]:http://www.tecmint.com/create-raid1-in-linux/ \ No newline at end of file diff --git a/sources/tech/RAID/Part 6 - Setting Up RAID 10 or 1+0 (Nested) in Linux.md b/sources/tech/RAID/Part 6 - Setting Up RAID 10 or 1+0 (Nested) in Linux.md new file mode 100644 index 0000000000..c021771ad2 --- /dev/null +++ b/sources/tech/RAID/Part 6 - Setting Up RAID 10 or 1+0 (Nested) in Linux.md @@ -0,0 +1,275 @@ +Setting Up RAID 10 or 1+0 (Nested) in Linux – Part 6 +================================================================================ +RAID 10 is a combine of RAID 0 and RAID 1 to form a RAID 10. To setup Raid 10, we need at least 4 number of disks. In our earlier articles, we’ve seen how to setup a RAID 0 and RAID 1 with minimum 2 number of disks. + +Here we will use both RAID 0 and RAID 1 to perform a Raid 10 setup with minimum of 4 drives. Assume, that we’ve some data saved to logical volume, which is created with RAID 10. Just for an example, if we are saving a data “apple” this will be saved under all 4 disk by this following method. + +![Create Raid 10 in Linux](http://www.tecmint.com/wp-content/uploads/2014/11/raid10.jpg) + +Create Raid 10 in Linux + +Using RAID 0 it will save as “A” in first disk and “p” in the second disk, then again “p” in first disk and “l” in second disk. Then “e” in first disk, like this it will continue the Round robin process to save the data. From this we come to know that RAID 0 will write the half of the data to first disk and other half of the data to second disk. + +In RAID 1 method, same data will be written to other 2 disks as follows. “A” will write to both first and second disks, “P” will write to both disk, Again other “P” will write to both the disks. Thus using RAID 1 it will write to both the disks. This will continue in round robin process. + +Now you all came to know that how RAID 10 works by combining of both RAID 0 and RAID 1. If we have 4 number of 20 GB size disks, it will be 80 GB in total, but we will get only 40 GB of Storage capacity, the half of total capacity will be lost for building RAID 10. + +#### Pros and Cons of RAID 5 #### + +- Gives better performance. +- We will loose two of the disk capacity in RAID 10. +- Reading and writing will be very good, because it will write and read to all those 4 disk at the same time. +- It can be used for Database solutions, which needs a high I/O disk writes. + +#### Requirements #### + +In RAID 10, we need minimum of 4 disks, the first 2 disks for RAID 0 and other 2 Disks for RAID 1. Like I said before, RAID 10 is just a Combine of RAID 0 & 1. If we need to extended the RAID group, we must increase the disk by minimum 4 disks. + +**My Server Setup** + + Operating System : CentOS 6.5 Final + IP Address : 192.168.0.229 + Hostname : rd10.tecmintlocal.com + Disk 1 [20GB] : /dev/sdd + Disk 2 [20GB] : /dev/sdc + Disk 3 [20GB] : /dev/sdd + Disk 4 [20GB] : /dev/sde + +There are two ways to setup RAID 10, but here I’m going to show you both methods, but I prefer you to follow the first method, which makes the work lot easier for setting up a RAID 10. + +### Method 1: Setting Up Raid 10 ### + +1. First, verify that all the 4 added disks are detected or not using the following command. + + # ls -l /dev | grep sd + +2. Once the four disks are detected, it’s time to check for the drives whether there is already any raid existed before creating a new one. + + # mdadm -E /dev/sd[b-e] + # mdadm --examine /dev/sdb /dev/sdc /dev/sdd /dev/sde + +![Verify 4 Added Disks](http://www.tecmint.com/wp-content/uploads/2014/11/Verify-4-Added-Disks.png) + +Verify 4 Added Disks + +**Note**: In the above output, you see there isn’t any super-block detected yet, that means there is no RAID defined in all 4 drives. + +#### Step 1: Drive Partitioning for RAID #### + +3. Now create a new partition on all 4 disks (/dev/sdb, /dev/sdc, /dev/sdd and /dev/sde) using the ‘fdisk’ tool. + + # fdisk /dev/sdb + # fdisk /dev/sdc + # fdisk /dev/sdd + # fdisk /dev/sde + +**Create /dev/sdb Partition** + +Let me show you how to partition one of the disk (/dev/sdb) using fdisk, this steps will be the same for all the other disks too. + + # fdisk /dev/sdb + +Please use the below steps for creating a new partition on /dev/sdb drive. + +- Press ‘n‘ for creating new partition. +- Then choose ‘P‘ for Primary partition. +- Then choose ‘1‘ to be the first partition. +- Next press ‘p‘ to print the created partition. +- Change the Type, If we need to know the every available types Press ‘L‘. +- Here, we are selecting ‘fd‘ as my type is RAID. +- Next press ‘p‘ to print the defined partition. +- Then again use ‘p‘ to print the changes what we have made. +- Use ‘w‘ to write the changes. + +![Disk sdb Partition](http://www.tecmint.com/wp-content/uploads/2014/11/Disk-sdb-Partition.png) + +Disk sdb Partition + +**Note**: Please use the above same instructions for creating partitions on other disks (sdc, sdd sdd sde). + +4. After creating all 4 partitions, again you need to examine the drives for any already existing raid using the following command. + + # mdadm -E /dev/sd[b-e] + # mdadm -E /dev/sd[b-e]1 + + OR + + # mdadm --examine /dev/sdb /dev/sdc /dev/sdd /dev/sde + # mdadm --examine /dev/sdb1 /dev/sdc1 /dev/sdd1 /dev/sde1 + +![Check All Disks for Raid](http://www.tecmint.com/wp-content/uploads/2014/11/Check-All-Disks-for-Raid.png) + +Check All Disks for Raid + +**Note**: The above outputs shows that there isn’t any super-block detected on all four newly created partitions, that means we can move forward to create RAID 10 on these drives. + +#### Step 2: Creating ‘md’ RAID Device #### + +5. Now it’s time to create a ‘md’ (i.e. /dev/md0) device, using ‘mdadm’ raid management tool. Before, creating device, your system must have ‘mdadm’ tool installed, if not install it first. + + # yum install mdadm [on RedHat systems] + # apt-get install mdadm [on Debain systems] + +Once ‘mdadm’ tool installed, you can now create a ‘md’ raid device using the following command. + + # mdadm --create /dev/md0 --level=10 --raid-devices=4 /dev/sd[b-e]1 + +6. Next verify the newly created raid device using the ‘cat’ command. + + # cat /proc/mdstat + +![Create md raid Device](http://www.tecmint.com/wp-content/uploads/2014/11/Create-md-raid-Device.png) + +Create md raid Device + +7. Next, examine all the 4 drives using the below command. The output of the below command will be long as it displays the information of all 4 disks. + + # mdadm --examine /dev/sd[b-e]1 + +8. Next, check the details of Raid Array with the help of following command. + + # mdadm --detail /dev/md0 + +![Check Raid Array Details](http://www.tecmint.com/wp-content/uploads/2014/11/Check-Raid-Array-Details.png) + +Check Raid Array Details + +**Note**: You see in the above results, that the status of Raid was active and re-syncing. + +#### Step 3: Creating Filesystem #### + +9. Create a file system using ext4 for ‘md0′ and mount it under ‘/mnt/raid10‘. Here, I’ve used ext4, but you can use any filesystem type if you want. + + # mkfs.ext4 /dev/md0 + +![Create md Filesystem](http://www.tecmint.com/wp-content/uploads/2014/11/Create-md-Filesystem.png) + +Create md Filesystem + +10. After creating filesystem, mount the created file-system under ‘/mnt/raid10‘ and list the contents of the mount point using ‘ls -l’ command. + + # mkdir /mnt/raid10 + # mount /dev/md0 /mnt/raid10/ + # ls -l /mnt/raid10/ + +Next, add some files under mount point and append some text in any one of the file and check the content. + + # touch /mnt/raid10/raid10_files.txt + # ls -l /mnt/raid10/ + # echo "raid 10 setup with 4 disks" > /mnt/raid10/raid10_files.txt + # cat /mnt/raid10/raid10_files.txt + +![Mount md Device](http://www.tecmint.com/wp-content/uploads/2014/11/Mount-md-Device.png) + +Mount md Device + +11. For automounting, open the ‘/etc/fstab‘ file and append the below entry in fstab, may be mount point will differ according to your environment. Save and quit using wq!. + + # vim /etc/fstab + + /dev/md0 /mnt/raid10 ext4 defaults 0 0 + +![AutoMount md Device](http://www.tecmint.com/wp-content/uploads/2014/11/AutoMount-md-Device.png) + +AutoMount md Device + +12. Next, verify the ‘/etc/fstab‘ file for any errors before restarting the system using ‘mount -a‘ command. + + # mount -av + +![Check Errors in Fstab](http://www.tecmint.com/wp-content/uploads/2014/11/Check-Errors-in-Fstab.png) + +Check Errors in Fstab + +#### Step 4: Save RAID Configuration #### + +13. By default RAID don’t have a config file, so we need to save it manually after making all the above steps, to preserve these settings during system boot. + + # mdadm --detail --scan --verbose >> /etc/mdadm.conf + +![Save Raid10 Configuration](http://www.tecmint.com/wp-content/uploads/2014/11/Save-Raid10-Configuration.png) + +Save Raid10 Configuration + +That’s it, we have created RAID 10 using method 1, this method is the easier one. Now let’s move forward to setup RAID 10 using method 2. + +### Method 2: Creating RAID 10 ### + +1. In method 2, we have to define 2 sets of RAID 1 and then we need to define a RAID 0 using those created RAID 1 sets. Here, what we will do is to first create 2 mirrors (RAID1) and then striping over RAID0. + +First, list the disks which are all available for creating RAID 10. + + # ls -l /dev | grep sd + +![List 4 Devices](http://www.tecmint.com/wp-content/uploads/2014/11/List-4-Devices.png) + +List 4 Devices + +2. Partition the all 4 disks using ‘fdisk’ command. For partitioning, you can follow #step 3 above. + + # fdisk /dev/sdb + # fdisk /dev/sdc + # fdisk /dev/sdd + # fdisk /dev/sde + +3. After partitioning all 4 disks, now examine the disks for any existing raid blocks. + + # mdadm --examine /dev/sd[b-e] + # mdadm --examine /dev/sd[b-e]1 + +![Examine 4 Disks](http://www.tecmint.com/wp-content/uploads/2014/11/Examine-4-Disks.png) + +Examine 4 Disks + +#### Step 1: Creating RAID 1 #### + +4. First let me create 2 sets of RAID 1 using 4 disks ‘sdb1′ and ‘sdc1′ and other set using ‘sdd1′ & ‘sde1′. + + # mdadm --create /dev/md1 --metadata=1.2 --level=1 --raid-devices=2 /dev/sd[b-c]1 + # mdadm --create /dev/md2 --metadata=1.2 --level=1 --raid-devices=2 /dev/sd[d-e]1 + # cat /proc/mdstat + +![Creating Raid 1](http://www.tecmint.com/wp-content/uploads/2014/11/Creating-Raid-1.png) + +Creating Raid 1 + +![Check Details of Raid 1](http://www.tecmint.com/wp-content/uploads/2014/11/Creating-Raid-1.png) + +Check Details of Raid 1 + +#### Step 2: Creating RAID 0 #### + +5. Next, create the RAID 0 using md1 and md2 devices. + + # mdadm --create /dev/md0 --level=0 --raid-devices=2 /dev/md1 /dev/md2 + # cat /proc/mdstat + +![Creating Raid 0](http://www.tecmint.com/wp-content/uploads/2014/11/Creating-Raid-0.png) + +Creating Raid 0 + +#### Step 3: Save RAID Configuration #### + +6. We need to save the Configuration under ‘/etc/mdadm.conf‘ to load all raid devices in every reboot times. + + # mdadm --detail --scan --verbose >> /etc/mdadm.conf + +After this, we need to follow #step 3 Creating file system of method 1. + +That’s it! we have created RAID 1+0 using method 2. We will loose two disks space here, but the performance will be excellent compared to any other raid setups. + +### Conclusion ### + +Here we have created RAID 10 using two methods. RAID 10 has good performance and redundancy too. Hope this helps you to understand about RAID 10 Nested Raid level. Let us see how to grow an existing raid array and much more in my upcoming articles. + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/create-raid-10-in-linux/ + +作者:[Babin Lonston][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/babinlonston/ \ No newline at end of file diff --git a/sources/tech/RAID/Part 7 - Growing an Existing RAID Array and Removing Failed Disks in Raid.md b/sources/tech/RAID/Part 7 - Growing an Existing RAID Array and Removing Failed Disks in Raid.md new file mode 100644 index 0000000000..fffa6fb419 --- /dev/null +++ b/sources/tech/RAID/Part 7 - Growing an Existing RAID Array and Removing Failed Disks in Raid.md @@ -0,0 +1,179 @@ +Growing an Existing RAID Array and Removing Failed Disks in Raid – Part 7 +================================================================================ +Every newbies will get confuse of the word array. Array is just a collection of disks. In other words, we can call array as a set or group. Just like a set of eggs containing 6 numbers. Likewise RAID Array contains number of disks, it may be 2, 4, 6, 8, 12, 16 etc. Hope now you know what Array is. + +Here we will see how to grow (extend) an existing array or raid group. For example, if we are using 2 disks in an array to form a raid 1 set, and in some situation if we need more space in that group, we can extend the size of an array using mdadm –grow command, just by adding one of the disk to the existing array. After growing (adding disk to an existing array), we will see how to remove one of the failed disk from array. + +![Grow Raid Array in Linux](http://www.tecmint.com/wp-content/uploads/2014/11/Growing-Raid-Array.jpg) + +Growing Raid Array and Removing Failed Disks + +Assume that one of the disk is little weak and need to remove that disk, till it fails let it under use, but we need to add one of the spare drive and grow the mirror before it fails, because we need to save our data. While the weak disk fails we can remove it from array this is the concept we are going to see in this topic. + +#### Features of RAID Growth #### + +- We can grow (extend) the size of any raid set. +- We can remove the faulty disk after growing raid array with new disk. +- We can grow raid array without any downtime. + +Requirements + +- To grow an RAID array, we need an existing RAID set (Array). +- We need extra disks to grow the Array. +- Here I’m using 1 disk to grow the existing array. + +Before we learn about growing and recovering of Array, we have to know about the basics of RAID levels and setups. Follow the below links to know about those setups. + +- [Understanding Basic RAID Concepts – Part 1][1] +- [Creating a Software Raid 0 in Linux – Part 2][2] + +#### My Server Setup #### + + Operating System : CentOS 6.5 Final + IP Address : 192.168.0.230 + Hostname : grow.tecmintlocal.com + 2 Existing Disks : 1 GB + 1 Additional Disk : 1 GB + +Here, my already existing RAID has 2 number of disks with each size is 1GB and we are now adding one more disk whose size is 1GB to our existing raid array. + +### Growing an Existing RAID Array ### + +1. Before growing an array, first list the existing Raid array using the following command. + + # mdadm --detail /dev/md0 + +![Check Existing Raid Array](http://www.tecmint.com/wp-content/uploads/2014/11/Check-Existing-Raid-Array.png) + +Check Existing Raid Array + +**Note**: The above output shows that I’ve already has two disks in Raid array with raid1 level. Now here we are adding one more disk to an existing array, + +2. Now let’s add the new disk “sdd” and create a partition using ‘fdisk‘ command. + + # fdisk /dev/sdd + +Please use the below instructions to create a partition on /dev/sdd drive. + +- Press ‘n‘ for creating new partition. +- Then choose ‘P‘ for Primary partition. +- Then choose ‘1‘ to be the first partition. +- Next press ‘p‘ to print the created partition. +- Here, we are selecting ‘fd‘ as my type is RAID. +- Next press ‘p‘ to print the defined partition. +- Then again use ‘p‘ to print the changes what we have made. +- Use ‘w‘ to write the changes. + +![Create New Partition in Linux](http://www.tecmint.com/wp-content/uploads/2014/11/Create-New-sdd-Partition.png) + +Create New sdd Partition + +3. Once new sdd partition created, you can verify it using below command. + + # ls -l /dev/ | grep sd + +![Confirm sdd Partition](http://www.tecmint.com/wp-content/uploads/2014/11/Confirm-sdd-Partition.png) + +Confirm sdd Partition + +4. Next, examine the newly created disk for any existing raid, before adding to the array. + + # mdadm --examine /dev/sdd1 + +![Check Raid on sdd Partition](http://www.tecmint.com/wp-content/uploads/2014/11/Check-Raid-on-sdd-Partition.png) + +Check Raid on sdd Partition + +**Note**: The above output shows that the disk has no super-blocks detected, means we can move forward to add a new disk to an existing array. + +4. To add the new partition /dev/sdd1 in existing array md0, use the following command. + + # mdadm --manage /dev/md0 --add /dev/sdd1 + +![Add Disk To Raid-Array](http://www.tecmint.com/wp-content/uploads/2014/11/Add-Disk-To-Raid-Array.png) + +Add Disk To Raid-Array + +5. Once the new disk has been added, check for the added disk in our array using. + + # mdadm --detail /dev/md0 + +![Confirm Disk Added to Raid](http://www.tecmint.com/wp-content/uploads/2014/11/Confirm-Disk-Added-To-Raid.png) + +Confirm Disk Added to Raid + +**Note**: In the above output, you can see the drive has been added as a spare. Here, we already having 2 disks in the array, but what we are expecting is 3 devices in array for that we need to grow the array. + +6. To grow the array we have to use the below command. + + # mdadm --grow --raid-devices=3 /dev/md0 + +![Grow Raid Array](http://www.tecmint.com/wp-content/uploads/2014/11/Grow-Raid-Array.png) + +Grow Raid Array + +Now we can see the third disk (sdd1) has been added to array, after adding third disk it will sync the data from other two disks. + + # mdadm --detail /dev/md0 + +![Confirm Raid Array](http://www.tecmint.com/wp-content/uploads/2014/11/Confirm-Raid-Array.png) + +Confirm Raid Array + +**Note**: For large size disk it will take hours to sync the contents. Here I have used 1GB virtual disk, so its done very quickly within seconds. + +### Removing Disks from Array ### + +7. After the data has been synced to new disk ‘sdd1‘ from other two disks, that means all three disks now have same contents. + +As I told earlier let’s assume that one of the disk is weak and needs to be removed, before it fails. So, now assume disk ‘sdc1‘ is weak and needs to be removed from an existing array. + +Before removing a disk we have to mark the disk as failed one, then only we can able to remove it. + + # mdadm --fail /dev/md0 /dev/sdc1 + # mdadm --detail /dev/md0 + +![Disk Fail in Raid Array](http://www.tecmint.com/wp-content/uploads/2014/11/Disk-Fail-in-Raid-Array.png) + +Disk Fail in Raid Array + +From the above output, we clearly see that the disk was marked as faulty at the bottom. Even its faulty, we can see the raid devices are 3, failed 1 and state was degraded. + +Now we have to remove the faulty drive from the array and grow the array with 2 devices, so that the raid devices will be set to 2 devices as before. + + # mdadm --remove /dev/md0 /dev/sdc1 + +![Remove Disk in Raid Array](http://www.tecmint.com/wp-content/uploads/2014/11/Remove-Disk-in-Raid-Array.png) + +Remove Disk in Raid Array + +8. Once the faulty drive is removed, now we’ve to grow the raid array using 2 disks. + + # mdadm --grow --raid-devices=2 /dev/md0 + # mdadm --detail /dev/md0 + +![Grow Disks in Raid Array](http://www.tecmint.com/wp-content/uploads/2014/11/Grow-Disks-in-Raid-Array.png) + +Grow Disks in Raid Array + +From the about output, you can see that our array having only 2 devices. If you need to grow the array again, follow the same steps as described above. If you need to add a drive as spare, mark it as spare so that if the disk fails, it will automatically active and rebuild. + +### Conclusion ### + +In the article, we’ve seen how to grow an existing raid set and how to remove a faulty disk from an array after re-syncing the existing contents. All these steps can be done without any downtime. During data syncing, system users, files and applications will not get affected in any case. + +In next, article I will show you how to manage the RAID, till then stay tuned to updates and don’t forget to add your comments. + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/grow-raid-array-in-linux/ + +作者:[Babin Lonston][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/babinlonston/ +[1]:http://www.tecmint.com/understanding-raid-setup-in-linux/ +[2]:http://www.tecmint.com/create-raid0-in-linux/ \ No newline at end of file From 2baef60dbc0fe0d3f8c232674d6f84c8805c5395 Mon Sep 17 00:00:00 2001 From: XLCYun Date: Tue, 14 Jul 2015 14:43:42 +0800 Subject: [PATCH 581/965] Update 20150713 How to manage Vim plugins.md --- sources/tech/20150713 How to manage Vim plugins.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150713 How to manage Vim plugins.md b/sources/tech/20150713 How to manage Vim plugins.md index 7462414916..147f89b0b7 100644 --- a/sources/tech/20150713 How to manage Vim plugins.md +++ b/sources/tech/20150713 How to manage Vim plugins.md @@ -1,3 +1,4 @@ +XLCYun 翻译中 How to manage Vim plugins ================================================================================ Vim is a versatile, lightweight text editor on Linux. While its initial learning curve can be overwhelming for an average Linux user, its benefits are completely worthy. As far as the functionality goes, Vim is fully customizable by means of plugins. Due to its high level of configuration, though, you need to spend some time with its plugin system to be able to personalize Vim in an effective way. Luckily, we have several tools that make our life with Vim plugins easier. The one I use on a daily basis is Vundle. @@ -136,4 +137,4 @@ via: http://xmodulo.com/manage-vim-plugins.html [1]:https://github.com/VundleVim/Vundle.vim [2]:http://ask.xmodulo.com/install-git-linux.html [3]:http://www.vim-scripts.org/ -[4]:http://www.vimawesome.com/ \ No newline at end of file +[4]:http://www.vimawesome.com/ From 0a8f38260be9c417e0ea3be00c6d374da0f32e8f Mon Sep 17 00:00:00 2001 From: H-mudcup Date: Tue, 14 Jul 2015 15:27:28 +0800 Subject: [PATCH 582/965] Delete 20150407 10 Truly Amusing Easter Eggs in Linux.md --- ...7 10 Truly Amusing Easter Eggs in Linux.md | 155 ------------------ 1 file changed, 155 deletions(-) delete mode 100644 sources/share/20150407 10 Truly Amusing Easter Eggs in Linux.md diff --git a/sources/share/20150407 10 Truly Amusing Easter Eggs in Linux.md b/sources/share/20150407 10 Truly Amusing Easter Eggs in Linux.md deleted file mode 100644 index f8322fb1af..0000000000 --- a/sources/share/20150407 10 Truly Amusing Easter Eggs in Linux.md +++ /dev/null @@ -1,155 +0,0 @@ -Translating by H-mudcup -10 Truly Amusing Easter Eggs in Linux -================================================================================ -![](http://en.wikipedia.org/wiki/File:Adventure_Easteregg.PNG) -The programmer working on Adventure slipped a secret feature into the game. Instead of getting upset about it, Atari decided to give these sorts of “secret features” a name -- “Easter Eggs” because… you know… you hunt for them. Image credit: Wikipedia. - -Back in 1979, a video game was being developed for the Atari 2600 -- [Adventure][1]. - -The programmer working on Adventure slipped a secret feature into the game which, when the user moved an “invisible square” to a particular wall, allowed entry into a “secret room”. That room contained a simple phrase: “Created by [Warren Robinett][2]”. - -Atari had a policy against putting author credits in their games, so this intrepid programmer put his John Hancock on the game by being, well, sneaky. Atari only found out about the “secret room” after Warren Robinett had left the company. Instead of getting upset about it, Atari decided to give these sorts of “secret features” a name -- “Easter Eggs” because… you know… you hunt for them -- and declared that they would be putting more of these “Easter Eggs” in future games. - -This wasn’t the first such “hidden feature” built into a piece of software (that distinction goes to an operating system for the [PDP-10][3] from 1966, but this was the first time it was given a name. And it was the first time it really grabbed the attention of most computer users and gamers. - -Linux (and Linux related software) has not been left out. Some truly amusing Easter Eggs have been created for our beloved operating system over the years. Here are some of my personal favorites -- with how to achieve them. - -You’ll notice, rather quickly, that most of these are experienced via a terminal. That’s on purpose. Because terminals are cool. [I should also take this moment to say that if you try to run an application I list, and you do not have it installed, it will not work. You should install it first. Because… computers.] - -### Arch : Pac-Man in pacman ### - -We’re going to start with one just for the [Arch Linux][4] fans out there. You can add a [Pac-Man][5]-esque character to your progress bars in “[pacman][6]” (the Arch package manager). Why this isn’t enabled by default is beyond me. - -To do this you’ll want to edit “/etc/pacman.conf” in your favorite text editor. Under the “# Misc options” section, remove the “#” in front of “Color” and add the line “ILoveCandy”. Because Pac-Man loves candy. - -That’s it! Next time you fire up a terminal and run pacman, you’ll help the little yellow guy get some lunch (or at least some candy). - -### GNU Emacs : Tetris and such ### - -![emacs Tetris](http://www.linux.com/images/stories/41373/emacsTetris.jpg) -I don’t like emacs. Not even a little bit. But it does play Tetris. - -I have a confession to make: I don’t like [emacs][7]. Not even a little bit. - -Some things fill my heart with gladness. Some things take away all my sadness. Some things ease my troubles. That’s [not what emacs does][8]. - -But it does play Tetris. And that’s not nothing. Here’s how: - -Step 1) Launch emacs. (When in doubt, type “emacs”.) - -Step 2) Hit Escape then X on your keyboard. - -Step 3) Type “tetris” and hit Enter. - -Bored of Tetris? Try “pong”, “snake” and a whole host of other little games (and novelties). Take a look in “/usr/share/emacs/*/lisp/play” for the full list. - -### Animals Saying Things ### - -The Linux world has a long and glorious history of animals saying things in a terminal. Here are the ones that are the most important to know by heart. - -On a Debian-based distro? Try typing “apt-get moo". - -![apt-get moo](http://www.linux.com/images/stories/41373/AptGetMoo.jpg) -apt-get moo - -Simple, sure. But it’s a talking cow. So we like it. Then try “aptitude moo”. It will inform you that “There are no Easter Eggs in this program”. - -If there’s one thing you should know about [aptitude][9], it’s that it’s a dirty, filthy liar. If aptitude were wearing pants, the fire could be seen from space. Add a “-v” option to that same command. Keep adding more v’s until you force aptitude to come clean. - -![](http://www.linux.com/images/stories/41373/AptitudeMoo.jpg) -I think we can all agree, that this is probably the most important feature in aptitude. - -I think we can all agree, that this is probably the most important feature in aptitude. But what if you want to put your own words into the mouth of a cow? That’s where “cowsay” comes in. - -And, don’t let the name “cowsay” fool you. You can put words into so much more than just a cow. Like an elephant, Calvin, Beavis and even the Ghostbusters logo. Just do a “cowsay -l” from the terminal to get a complete list of options. - -![](http://www.linux.com/images/stories/41373/cowsay.jpg) -You can put words into so much more than just a cow. - -Want to get really tricky? You can pipe the output of other applications into cowsay. Try “fortune | cowsay”. Lots of fun can be had. - -### Sudo Insult Me Please ### - -Raise your hand if you’ve always wanted your computer to insult you when you do something wrong. Hell. I know I have. Try this: - -Type “sudo visudo” to open the “sudoers” file. In the top of that file you’ll likely see a few lines that start with “Defaults”. At the bottom of that list add “Defaults insults” and save the file. - -Now, whenever you mistype your sudo password, your system will lob insults at you. Confidence boosting phrases such as “Listen, burrito brains, I don’t have time to listen to this trash.”, “Are you on drugs?” and “You’re mind just hasn’t been the same since the electro-shocks, has it?”. - -This one has the side-effect of being a rather fun thing to set on a co-worker's computer. - -### Firefox is cheeky ### - -Here’s one that isn’t done from the Terminal! Huzzah! - -Open up Firefox. In the URL bar type “about:about”. That will give you a list of all of the “about” pages in Firefox. Nothing too fancy there, right? - -Now try “about:mozilla” and you’ll be greeted with a quote from the “[Book of Mozilla][10]” -- the holy book of web browsing. One of my other favorites, “about:robots”, is also quite excellent. - -![](http://www.linux.com/images/stories/41373/About-Mozilla550.jpg) -The “Book of Mozilla” -- the holy book of web browsing. - -### Carefully Crafted Calendar Concoctions ### - -Tired of the boring old [Gregorian Calendar][11]? Ready to mix things up a little bit? Try typing “ddate”. This will print the current date on the [Discordian Calendar][12]. You will be greeted by something that looks like this: - -“Today is Sweetmorn, the 18th day of Discord in the YOLD 3181” - -I hear what you’re saying, “But, this isn’t an Easter Egg!” Shush. I’ll call it an Easter Egg if I want to. - -### Instant l33t Hacker Mode ### - -Want to feel like you’re a super-hacker from a movie? Try setting nmap into “[Script Kiddie][13]” mode (by adding “-oS”) and all of the output will be rendered in the most 3l33t [h@x0r-y way][14] possible. - -Example: “nmap -oS - google.com” - -Do it. You know you want to. Angelina Jolie would be [super impressed][15]. - -### The lolcat Rainbow ### - -Having awesome Easter Eggs and goodies in your Linux terminal is fine and dandy… but what if you want it to have a little more… pizazz? Enter: lolcat. Take the text output of any program and pipe it through lolcat to super-duper-rainbow-ize it. - -![](http://www.linux.com/images/stories/41373/lolcat.jpg) -Take the text output of any program and pipe it through lolcat to super-duper-rainbow-ize it. - -### Cursor Chasing Critter ### - -![oneko cat](http://www.linux.com/images/stories/41373/onekocat.jpg) -“Oneko” -- the Linux port of the classic “Neko”. - -“Oneko” -- the Linux port of the classic “[Neko][16]”. -And that brings us to “oneko” -- the Linux port of the classic “Neko”. Basically a little cat that chases your cursor around the screen. - -While this may not qualify as an “Easter Egg” in the strictest sense of the word, it’s still fun. And it feels Easter Egg-y. - -You can also use different options (such as “oneko -dog”) to use a little dog instead of a cat and a few other tweaks and options. Lots of possibilities for annoying co-workers with this one. - -There you have it! A list of my favorite Linux Easter Eggs (and things of that ilk). Feel free to add your own favorite in the comments section below. Because this is the Internet. And you can do that sort of thing. - --------------------------------------------------------------------------------- - -via: http://www.linux.com/news/software/applications/820944-10-truly-amusing-linux-easter-eggs- - -作者:[Bryan Lunduke][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/56734 -[1]:http://en.wikipedia.org/wiki/Adventure_(Atari_2600) -[2]:http://en.wikipedia.org/wiki/Warren_Robinett -[3]:http://en.wikipedia.org/wiki/PDP-10 -[4]:http://en.wikipedia.org/wiki/Arch_Linux -[5]:http://en.wikipedia.org/wiki/Pac-Man -[6]:http://www.linux.com/news/software/applications/820944-10-truly-amusing-linux-easter-eggs-#Pacman -[7]:http://en.wikipedia.org/wiki/GNU_Emacs -[8]:https://www.youtube.com/watch?v=AQ4NAZPi2js -[9]:https://wiki.debian.org/Aptitude -[10]:http://en.wikipedia.org/wiki/The_Book_of_Mozilla -[11]:http://en.wikipedia.org/wiki/Gregorian_calendar -[12]:http://en.wikipedia.org/wiki/Discordian_calendar -[13]:http://nmap.org/book/output-formats-script-kiddie.html -[14]:http://nmap.org/book/output-formats-script-kiddie.html -[15]:https://www.youtube.com/watch?v=Ql1uLyuWra8 -[16]:http://en.wikipedia.org/wiki/Neko_%28computer_program%29 From 6e5c0c14a2bbf5e53397a882727e531299b33b79 Mon Sep 17 00:00:00 2001 From: H-mudcup Date: Tue, 14 Jul 2015 15:28:41 +0800 Subject: [PATCH 583/965] Create 20150407 10 Truly Amusing Easter Eggs in Linux.md --- ...7 10 Truly Amusing Easter Eggs in Linux.md | 155 ++++++++++++++++++ 1 file changed, 155 insertions(+) create mode 100644 translated/share/20150407 10 Truly Amusing Easter Eggs in Linux.md diff --git a/translated/share/20150407 10 Truly Amusing Easter Eggs in Linux.md b/translated/share/20150407 10 Truly Amusing Easter Eggs in Linux.md new file mode 100644 index 0000000000..4f783d829c --- /dev/null +++ b/translated/share/20150407 10 Truly Amusing Easter Eggs in Linux.md @@ -0,0 +1,155 @@ +Translating by H-mudcup + +Linux上绝对有趣的10个彩蛋 +================================================================================ +![](http://en.wikipedia.org/wiki/File:Adventure_Easteregg.PNG) +制作 Adventure 的程序员悄悄的把一个秘密的功能塞进了游戏里。Atari 并没有对此感到生气,而是给这类“秘密功能”起了个名字——“彩蛋”,因为——你懂的——你会像找复活节彩蛋一样寻找它们。图片来自: Wikipedia。 + +在1979年的时候,公司为 Atari 2600 开发了一个电子游戏——[Adventure][1]。 + +制作 Adventure 的程序员悄悄的把这样的一个功能放进了游戏里,当用户把一个“隐形方块”移动到特定的一面墙上时,会让用户进入一个“密室”。那个房间里只有一句话:“Created by [Warren Robinett][2]”——意思是,由 [Warren Robinett][2] 创建。 + +Atari 有一项反对作者将自己的名字放进他们的游戏里的政策,所以这个无畏的程序员只能偷偷的把自己的名字放进游戏里。Atari 在 Warren Robinett 离开公司之后才发现这个“密室”。Atari 并没有对此感到生气,而是给这类“秘密功能”起了个名字——“彩蛋”,因为——你懂的——你会寻找它们。Atari 还宣布将在之后的游戏中加入更多的“彩蛋”。 + +这种软件里的“隐藏功能”并不是第一次出现(这类特性的首次出现是在1966年[PDP-10][3]的操作系统上),但这是它第一次有了名字,同时也是第一次真正的被众多电脑用户和游戏玩家所注意。 + +Linux(以及和Linux相关的软件)并没有被遗忘。这些年来,人们为这个倍受喜爱的操作系统创作了很多非常有趣的彩蛋。下面将介绍我个人最喜爱的彩蛋——以及如何得到它们。 + +你将迅速意识到这些彩蛋大多需要通过终端才能体验到。这是故意的。因为终端比较酷。【我应该借此机机会提醒你一下,如果你想运行我所列出的应用,然而你却还没有安装它们,你是绝对无法运行成功的。你应该先安装好它们的。因为……毕竟只是计算机。】 + +### Arch : 包管理器(pacman)里的吃豆人(Pac-Man) ### + +为了广大的 [Arch Linux][4] 粉丝,我们将以此开篇。你们可以将“[pacman][6]” (Arch 的包管理器)的进度条变成吃豆人吃豆的样子。别问我为什么这不是默认设置。 + +你需要在你最喜欢的文本编辑器里编辑“/etc/pacman.conf”文件。在“# Misc options”区下面,删除“Color”前的“#”,添加一行“ILoveCandy”。因为吃豆人喜欢糖豆。 + +没错,这样就行了!下次你在终端里运行pacman管理器时,你就会让这个黄颜色的小家伙吃到些午餐(至少能吃些糖豆)。 + +### GNU Emacs : 俄罗斯方块(Tetris)以及…… ### + +![emacs Tetris](http://www.linux.com/images/stories/41373/emacsTetris.jpg) +我不喜欢 emacs。一点也不喜欢。但是它确实能玩俄罗斯方块。 + +我要坦白一件事:我不喜欢[emacs][7]。一点也不喜欢。 + +有些东西让我满心欢喜。有些东西能带走我所有伤痛。有些东西能解决我的烦恼。这些[绝对跟 emacs 无关][8]。 + +但是它确实能玩俄罗斯方块。这可不是件小事。方法如下: + +第一步)打开 emacs。(有疑问,输入“emacs”。) + +第二步)按下键盘上的Esc和X键。 + +第三步)输入“tetris”然后按下“Enter”。 + +玩腻了俄罗斯方块?试试“pong”、“snake”还有其他一堆小游戏(或奇怪的东西)。在“/usr/share/emacs/*/lisp/play”文件中可以看见完整的清单。 + +### 动物说话了 ### + +让动物在终端里说话在 Linux 世界里有着悠久而辉煌的历史。下面这些真的是最应该知道的。 + +在用基于 Debian 的发行版?试试输入“apt-get moo"。 + +![apt-get moo](http://www.linux.com/images/stories/41373/AptGetMoo.jpg) +apt-get moo + +简单?的确。但这是只会说话的牛。所以惹我们喜欢。再试试“aptitude moo”。他会告诉你“There are no Easter Eggs in this program(这个程序里没有彩蛋)”。 + +关于 [aptitude][9] 有一件事你一定要知道,它是个肮脏、下流的骗子。如果 aptitude 是匹诺曹,那它的鼻子能刺穿月球。在这条命令中添加“-v”选项。不停的添加 v,直到它被逼得投降。 + +![](http://www.linux.com/images/stories/41373/AptitudeMoo.jpg) +我猜大家都同意,这是 aptitude 中最重要的功能。 + +我猜大家都同意,这是 aptitude 中最重要的功能。但是万一你想把自己的话让一头牛说出来怎么办?这时我们就需要“cowsay”了。 + +还有,别让“cowsay(牛说)”这个名字把你给骗了。你可以让你的话从各种东西的嘴里说出来。比如一头大象,Calvin,Beavis 甚至可以是Ghostbusters(捉鬼敢死队)的标志。只需在终端输入“cowsay -l”就能看到所有选项的列表。 + +![](http://www.linux.com/images/stories/41373/cowsay.jpg) +你可以让你的话从各种东西的嘴里说出来 + +想玩高端点的?你可以用管道把其他应用的输出放到 cowsay 中。试试“fortune | cowsay”。非常有趣。 + +### Sudo 请无情的侮辱我 ### + +当你做错事时希望你的电脑骂你的人请举手。反正,我这样想过。试试这个: + +输入“sudo visudo”以打开“sudoers”文件。在文件的开头你很可能会看见几行以“Defaults”开头的文字。在那几行后面添加“Defaults insults”并保存文件。 + +现在,只要你输错了你的 sudo 密码,你的系统就会骂你。这些提高自信的语句包括“听着,煎饼脑袋,我可没时间听这些垃圾。”,“你吃错药了吧?”以及“你被电过以后大脑就跟以前不太一样了是不是?” + +把这个设在同事的电脑上会有非常有趣。 + +### Firefox 是个厚脸皮 ### + +这一个不需要终端!太棒了! + +打开火狐浏览器。在地址栏填上“about:about”。你将得到火狐浏览器中所有的“about”页。一点也不炫酷,是不是? + +现在试试“about:mozilla”,浏览器就会回应你一条从“[Book of Mozilla(Mozilla 之书)][10]”——浏览网页的圣经——里引用的话。我的另一个最爱是“about:robots”,这个也很有趣。 + +![](http://www.linux.com/images/stories/41373/About-Mozilla550.jpg) +“[Book of Mozilla(Mozilla 之书)][10]”——浏览网页的圣经。 + +### 精心调制的混搭日历 ### + +是否厌倦了千百年不变的 [Gregorian Calendar(罗马教历)][11]?准备好乱入了吗?试试输入“ddate”。这样会把当前日历以[Discordian Calendar(不和教历)][12]的方式显示出来。你会遇见这样的语句: + +“今天是Sweetmorn(甜美的清晨),3181年Discord(不和)季的第18天。” + +我听见你在说什么了,“但这根本不是什么彩蛋!”嘘~,闭嘴。只要我想,我就可以把它叫做彩蛋。 + +### 快速进入黑客行话模式 ### + +想不想尝试一下电影里超级黑客的感觉?试试(通过添加“-oS”)把扫描器设置成“[Script Kiddie][13]”模式。然后所有的输出都会变成最3l33t的[黑客范][14]。 + +例如: “nmap -oS - google.com” + +赶快试试。我知道你有多想这么做。你一定会让安吉丽娜·朱莉(Angelina Jolie)[印象深刻][15] +### lolcat彩虹 ### + +在你的Linux终端里有很多彩蛋真真是极好的……但是如果你还想要变得……更有魅力些怎么办?输入:lolcat。把任何一个程序的文本输出通过管道输入到lolcat里。你会得到它的超级无敌彩虹版。 + +![](http://www.linux.com/images/stories/41373/lolcat.jpg) +把任何一个程序的文本输出通过管道输入到lolcat里。你会得到它的超级无敌彩虹版。 + +### 追光标的小家伙 ### + +![oneko cat](http://www.linux.com/images/stories/41373/onekocat.jpg) +“Oneko” -- 经典 “Neko”的Linux端口。 + +“Oneko” -- 经典 “[Neko][16]”的Linux端口。 . +接下来是“Oneko” -- 经典 “[Neko][16]”的Linux端口。基本上就是个满屏幕追着你的光标跑的小猫。 + +虽然严格来它并不算是“彩蛋”,它还是很有趣的。而且感觉上也是很彩蛋的。 + +你还可以用不同的选项(比如“oneko -dog”)把小猫替代成小狗,或是调成其他样式。用这个对付讨厌的同事有着无限的可能。 + +There you have it! A list of my favorite Linux Easter Eggs (and things of that ilk). Feel free to add your own favorite in the comments section below. Because this is the Internet. And you can do that sort of thing.就是这些了!一个我最喜欢的Linux彩蛋(或是类似东西)的清单。请尽情的的在下面的评论区留下你的最爱。因为这是互联网。你就能做这些事。 + +-------------------------------------------------------------------------------- + +via: http://www.linux.com/news/software/applications/820944-10-truly-amusing-linux-easter-eggs- + +作者:[Bryan Lunduke][a] +译者:[H-mudcup](https://github.com/H-mudcup) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://www.linux.com/community/forums/person/56734 +[1]:http://en.wikipedia.org/wiki/Adventure_(Atari_2600) +[2]:http://en.wikipedia.org/wiki/Warren_Robinett +[3]:http://en.wikipedia.org/wiki/PDP-10 +[4]:http://en.wikipedia.org/wiki/Arch_Linux +[5]:http://en.wikipedia.org/wiki/Pac-Man +[6]:http://www.linux.com/news/software/applications/820944-10-truly-amusing-linux-easter-eggs-#Pacman +[7]:http://en.wikipedia.org/wiki/GNU_Emacs +[8]:https://www.youtube.com/watch?v=AQ4NAZPi2js +[9]:https://wiki.debian.org/Aptitude +[10]:http://en.wikipedia.org/wiki/The_Book_of_Mozilla +[11]:http://en.wikipedia.org/wiki/Gregorian_calendar +[12]:http://en.wikipedia.org/wiki/Discordian_calendar +[13]:http://nmap.org/book/output-formats-script-kiddie.html +[14]:http://nmap.org/book/output-formats-script-kiddie.html +[15]:https://www.youtube.com/watch?v=Ql1uLyuWra8 +[16]:http://en.wikipedia.org/wiki/Neko_%28computer_program%29 From e35b2ef058de81e904bac2e0eea16d4c81c33b90 Mon Sep 17 00:00:00 2001 From: DeadFire Date: Tue, 14 Jul 2015 15:49:47 +0800 Subject: [PATCH 584/965] =?UTF-8?q?RAID=20=E4=B8=93=E9=A2=98=E6=96=87?= =?UTF-8?q?=E7=AB=A0=20struggling=20=E5=85=A8=E9=83=A8=E8=AE=A4=E9=A2=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...1 - Introduction to RAID, Concepts of RAID and RAID Levels.md | 1 + ...AID0 (Stripe) on 'Two Devices' Using 'mdadm' Tool in Linux.md | 1 + ...- Setting up RAID 1 (Mirroring) using 'Two Disks' in Linux.md | 1 + ...reating RAID 5 (Striping with Distributed Parity) in Linux.md | 1 + ...Level 6 (Striping with Double Distributed Parity) in Linux.md | 1 + .../RAID/Part 6 - Setting Up RAID 10 or 1+0 (Nested) in Linux.md | 1 + ...g an Existing RAID Array and Removing Failed Disks in Raid.md | 1 + 7 files changed, 7 insertions(+) diff --git a/sources/tech/RAID/Part 1 - Introduction to RAID, Concepts of RAID and RAID Levels.md b/sources/tech/RAID/Part 1 - Introduction to RAID, Concepts of RAID and RAID Levels.md index 6d902f7576..0f393fd7c4 100644 --- a/sources/tech/RAID/Part 1 - Introduction to RAID, Concepts of RAID and RAID Levels.md +++ b/sources/tech/RAID/Part 1 - Introduction to RAID, Concepts of RAID and RAID Levels.md @@ -1,3 +1,4 @@ +struggling 翻译中 Introduction to RAID, Concepts of RAID and RAID Levels – Part 1 ================================================================================ RAID is a Redundant Array of Inexpensive disks, but nowadays it is called Redundant Array of Independent drives. Earlier it is used to be very costly to buy even a smaller size of disk, but nowadays we can buy a large size of disk with the same amount like before. Raid is just a collection of disks in a pool to become a logical volume. diff --git a/sources/tech/RAID/Part 2 - Creating Software RAID0 (Stripe) on 'Two Devices' Using 'mdadm' Tool in Linux.md b/sources/tech/RAID/Part 2 - Creating Software RAID0 (Stripe) on 'Two Devices' Using 'mdadm' Tool in Linux.md index e3bcf09799..8057e4828e 100644 --- a/sources/tech/RAID/Part 2 - Creating Software RAID0 (Stripe) on 'Two Devices' Using 'mdadm' Tool in Linux.md +++ b/sources/tech/RAID/Part 2 - Creating Software RAID0 (Stripe) on 'Two Devices' Using 'mdadm' Tool in Linux.md @@ -1,3 +1,4 @@ +struggling 翻译中 Creating Software RAID0 (Stripe) on ‘Two Devices’ Using ‘mdadm’ Tool in Linux – Part 2 ================================================================================ RAID is Redundant Array of Inexpensive disks, used for high availability and reliability in large scale environments, where data need to be protected than normal use. Raid is just a collection of disks in a pool to become a logical volume and contains an array. A combine drivers makes an array or called as set of (group). diff --git a/sources/tech/RAID/Part 3 - Setting up RAID 1 (Mirroring) using 'Two Disks' in Linux.md b/sources/tech/RAID/Part 3 - Setting up RAID 1 (Mirroring) using 'Two Disks' in Linux.md index 927a8c49f1..4acfe4366b 100644 --- a/sources/tech/RAID/Part 3 - Setting up RAID 1 (Mirroring) using 'Two Disks' in Linux.md +++ b/sources/tech/RAID/Part 3 - Setting up RAID 1 (Mirroring) using 'Two Disks' in Linux.md @@ -1,3 +1,4 @@ +struggling 翻译中 Setting up RAID 1 (Mirroring) using ‘Two Disks’ in Linux – Part 3 ================================================================================ RAID Mirroring means an exact clone (or mirror) of the same data writing to two drives. A minimum two number of disks are more required in an array to create RAID1 and it’s useful only, when read performance or reliability is more precise than the data storage capacity. diff --git a/sources/tech/RAID/Part 4 - Creating RAID 5 (Striping with Distributed Parity) in Linux.md b/sources/tech/RAID/Part 4 - Creating RAID 5 (Striping with Distributed Parity) in Linux.md index acd284045f..dafdf514aa 100644 --- a/sources/tech/RAID/Part 4 - Creating RAID 5 (Striping with Distributed Parity) in Linux.md +++ b/sources/tech/RAID/Part 4 - Creating RAID 5 (Striping with Distributed Parity) in Linux.md @@ -1,3 +1,4 @@ +struggling 翻译中 Creating RAID 5 (Striping with Distributed Parity) in Linux – Part 4 ================================================================================ In RAID 5, data strips across multiple drives with distributed parity. The striping with distributed parity means it will split the parity information and stripe data over the multiple disks, which will have good data redundancy. diff --git a/sources/tech/RAID/Part 5 - Setup RAID Level 6 (Striping with Double Distributed Parity) in Linux.md b/sources/tech/RAID/Part 5 - Setup RAID Level 6 (Striping with Double Distributed Parity) in Linux.md index 2ad6a33227..ea1d5993c0 100644 --- a/sources/tech/RAID/Part 5 - Setup RAID Level 6 (Striping with Double Distributed Parity) in Linux.md +++ b/sources/tech/RAID/Part 5 - Setup RAID Level 6 (Striping with Double Distributed Parity) in Linux.md @@ -1,3 +1,4 @@ +struggling 翻译中 Setup RAID Level 6 (Striping with Double Distributed Parity) in Linux – Part 5 ================================================================================ RAID 6 is upgraded version of RAID 5, where it has two distributed parity which provides fault tolerance even after two drives fails. Mission critical system still operational incase of two concurrent disks failures. It’s alike RAID 5, but provides more robust, because it uses one more disk for parity. diff --git a/sources/tech/RAID/Part 6 - Setting Up RAID 10 or 1+0 (Nested) in Linux.md b/sources/tech/RAID/Part 6 - Setting Up RAID 10 or 1+0 (Nested) in Linux.md index c021771ad2..a08903e00e 100644 --- a/sources/tech/RAID/Part 6 - Setting Up RAID 10 or 1+0 (Nested) in Linux.md +++ b/sources/tech/RAID/Part 6 - Setting Up RAID 10 or 1+0 (Nested) in Linux.md @@ -1,3 +1,4 @@ +struggling 翻译中 Setting Up RAID 10 or 1+0 (Nested) in Linux – Part 6 ================================================================================ RAID 10 is a combine of RAID 0 and RAID 1 to form a RAID 10. To setup Raid 10, we need at least 4 number of disks. In our earlier articles, we’ve seen how to setup a RAID 0 and RAID 1 with minimum 2 number of disks. diff --git a/sources/tech/RAID/Part 7 - Growing an Existing RAID Array and Removing Failed Disks in Raid.md b/sources/tech/RAID/Part 7 - Growing an Existing RAID Array and Removing Failed Disks in Raid.md index fffa6fb419..76039f4371 100644 --- a/sources/tech/RAID/Part 7 - Growing an Existing RAID Array and Removing Failed Disks in Raid.md +++ b/sources/tech/RAID/Part 7 - Growing an Existing RAID Array and Removing Failed Disks in Raid.md @@ -1,3 +1,4 @@ +struggling 翻译中 Growing an Existing RAID Array and Removing Failed Disks in Raid – Part 7 ================================================================================ Every newbies will get confuse of the word array. Array is just a collection of disks. In other words, we can call array as a set or group. Just like a set of eggs containing 6 numbers. Likewise RAID Array contains number of disks, it may be 2, 4, 6, 8, 12, 16 etc. Hope now you know what Array is. From f100dfc28c592b1f27e87ec44f1262bedd0e71c9 Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 14 Jul 2015 17:29:40 +0800 Subject: [PATCH 585/965] PUB:20150527 Animated Wallpaper Adds Live Backgrounds To Linux Distros @Love-xuan --- ... Adds Live Backgrounds To Linux Distros.md | 34 +++++++++---------- 1 file changed, 16 insertions(+), 18 deletions(-) rename {translated/share => published}/20150527 Animated Wallpaper Adds Live Backgrounds To Linux Distros.md (71%) diff --git a/translated/share/20150527 Animated Wallpaper Adds Live Backgrounds To Linux Distros.md b/published/20150527 Animated Wallpaper Adds Live Backgrounds To Linux Distros.md similarity index 71% rename from translated/share/20150527 Animated Wallpaper Adds Live Backgrounds To Linux Distros.md rename to published/20150527 Animated Wallpaper Adds Live Backgrounds To Linux Distros.md index 2d845ce804..384c188322 100644 --- a/translated/share/20150527 Animated Wallpaper Adds Live Backgrounds To Linux Distros.md +++ b/published/20150527 Animated Wallpaper Adds Live Backgrounds To Linux Distros.md @@ -1,14 +1,12 @@ -Translating by Love-xuan 动态壁纸给linux发行版添加活力背景 ================================================================================ **我们知道你想拥有一个有格调的ubuntu桌面来炫耀一下 :)** ![Live Wallpaper](http://i.imgur.com/9JIUw5p.gif) -Live Wallpaper +*Live Wallpaper* -在linxu上费一点点劲搭建一个出色的工作环境是很简单的。 -今天,我们着重来探讨[重新着重探讨][2]长驻你脑海中那些东西 - 一款自由,开源,能够给你的截图增添光彩的工具。 +在linxu上费一点点劲搭建一个出色的工作环境是很简单的。今天,我们([重新][2])着重来探讨长驻你脑海中那些东西 :一款自由,开源,能够给你的截图增添光彩的工具。 它叫 **Live Wallpaper** (正如你猜的那样) ,它用由OpenGL驱动的一款动态桌面背景来代替标准的静态桌面背景。 @@ -25,13 +23,13 @@ Live Wallpaper 不是此类软件唯一的一款,但它是最好的一款之 从精细的(‘noise’)到狂热的 (‘nexus’),包罗万象,甚至有受到Ubuntu Phone欢迎屏幕启发的obligatory锁屏壁纸。 - Circles — 带着‘evolving circle’风格的时钟,灵感来自于Ubuntu Phone -- Galaxy — 支持自定义大小,位置的星系 -- Gradient Clock — 覆盖基本梯度的时钟 +- Galaxy — 支持自定义大小,位置的旋转星系 +- Gradient Clock — 放在倾斜面上的polar时钟 - Nexus — 亮色粒子火花穿越屏幕 - Noise — 类似于iOS动态壁纸的Bokeh设计 - Photoslide — 由文件夹(默认为 ~/Photos)内照片构成的动态网格相册 -Live Wallpaper **完全开源** ,所以没有什么能够阻挡天马行空的艺术家用提供的做法(当然还有耐心)来创造他们自己的精美主题。 +Live Wallpaper **完全开源**,所以没有什么能够阻挡天马行空的艺术家们用诀窍(当然还有耐心)来创造他们自己的精美主题。 ### 设置 & 特点 ### @@ -39,24 +37,24 @@ Live Wallpaper **完全开源** ,所以没有什么能够阻挡天马行空 虽然某些主题与其它主题相比有更多的选项,但每款主题都可以通过某些方式来配置或者定制。 -例如, Nexus主题中 (上图所示) 你可以更改脉冲粒子的数量,颜色,大小和出现频率。 +例如,Nexus主题中 (上图所示) 你可以更改脉冲粒子的数量,颜色,大小和出现频率。 首选项提供了 **通用选项** 适用于所有主题,包括: -- 设置登陆界面的动态壁纸 +- 设置登录界面的动态壁纸 - 自定义动画背景 - 调节 FPS (包括在屏幕上显示FPS) -- 指定多显示器行为 +- 指定多显示器的行为 有如此多的选项,diy适用于你自己的桌面背景是很容易的。 ### 缺陷 ### #### 没有桌面图标 #### + Live Wallpaper在运行时,你无法在桌面添加,打开或者是编辑文件和文件夹。 -首选项程序提供了一个选项来让你这样做(只是猜测)。也许是它只能在老版本中使用,在我们的测试中-测试环境为Ununtu 14.10,它并没有用。 -在测试中发现当把桌面壁纸设置成格式为png的图片文件时,这个选项有用,不需要是透明的png图片文件,只要是png图片文件就行了。 +首选项程序提供了一个选项来让你这样做(只是猜测)。也许是它只能在老版本中使用,在我们的测试中-测试环境为Ununtu 14.10,它不工作。但在测试中发现当把桌面壁纸设置成格式为png的图片文件时,这个选项有用,不需要是透明的png图片文件,只要是png图片文件就行了。 #### 资源占用 #### @@ -68,9 +66,9 @@ Live Wallpaper在运行时,你无法在桌面添加,打开或者是编辑文 对我来说最大的“bug”绝对是没有“退出”选项。 -当然,Sure, 动态壁纸可以通过托盘图标和首选项完全退出,那退出托盘图标呢?没办法。只能在终端执行命令‘pkill livewallpaper’。 +当然,动态壁纸可以通过托盘图标和首选项完全退出,那退出托盘图标呢?没办法。只能在终端执行命令‘pkill livewallpaper’。 -### 怎么在 Ubuntu 14.04 LTS +上安装 Live Wallpaper ### +### 怎么在 Ubuntu 14.04 LTS+ 上安装 Live Wallpaper ### ![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/05/terminal-command-750x146.jpg) @@ -81,7 +79,7 @@ Live Wallpaper在运行时,你无法在桌面添加,打开或者是编辑文 sudo apt-get update && sudo apt-get install livewallpaper -你还需要安装 indicator applet, 这样可以方便快速的打开或是关闭动态壁纸,从菜单选择主题,另外图形配置工具可以让你基于你自己的口味来配置每款主题。 +你还需要安装 indicator applet,这样可以方便快速的打开或是关闭动态壁纸,从菜单选择主题,另外图形配置工具可以让你基于你自己的口味来配置每款主题。 sudo apt-get install livewallpaper-config livewallpaper-indicator @@ -89,11 +87,11 @@ Live Wallpaper在运行时,你无法在桌面添加,打开或者是编辑文 ![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/05/live-wallpaper-app-launcher.png) -让人不爽的是,安装完成后,程序不会自动打开托盘图标,而仅仅将它自己加入自动启动项,所以,快速来个注消 > 登陆它就会出现啦。 +让人不爽的是,安装完成后,程序不会自动打开托盘图标,而仅仅将它自己加入自动启动项,所以,快速来个注销 -> 登陆它就会出现啦。 ### 总结 ### -如果你正处在无聊呆板的桌面中,幻想有一个更有活力的生活,不防试试。另外,告诉我们你想看到什么样的动态壁纸! +如果你正处在无聊呆板的桌面中,幻想有一个更有活力的生活,不妨试试。另外,告诉我们你想看到什么样的动态壁纸! -------------------------------------------------------------------------------- @@ -101,7 +99,7 @@ via: http://www.omgubuntu.co.uk/2015/05/animated-wallpaper-adds-live-backgrounds 作者:[Joey-Elijah Sneddon][a] 译者:[Love-xuan](https://github.com/Love-xuan) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 3e340322649526ee33342d8570a22fea8a4bd28f Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 14 Jul 2015 17:50:27 +0800 Subject: [PATCH 586/965] PUB:20150603 Installing Ruby on Rails using rbenv on Ubuntu 15.04 @geekpi --- ...by on Rails using rbenv on Ubuntu 15.04.md | 43 ++++++++++--------- 1 file changed, 22 insertions(+), 21 deletions(-) rename {translated/tech => published}/20150603 Installing Ruby on Rails using rbenv on Ubuntu 15.04.md (64%) diff --git a/translated/tech/20150603 Installing Ruby on Rails using rbenv on Ubuntu 15.04.md b/published/20150603 Installing Ruby on Rails using rbenv on Ubuntu 15.04.md similarity index 64% rename from translated/tech/20150603 Installing Ruby on Rails using rbenv on Ubuntu 15.04.md rename to published/20150603 Installing Ruby on Rails using rbenv on Ubuntu 15.04.md index 65ff38744e..9d597fff54 100644 --- a/translated/tech/20150603 Installing Ruby on Rails using rbenv on Ubuntu 15.04.md +++ b/published/20150603 Installing Ruby on Rails using rbenv on Ubuntu 15.04.md @@ -1,6 +1,7 @@ -在Ubuntu 15.04中安装RUby on Rails +在Ubuntu 15.04中安装Ruby on Rails ================================================================================ -本篇我们会学习如何用rbenv在Ubuntu 15.04中安装Ruby on Rails。我们选择Ubuntu作为操作系统因为Ubuntu是Linux发行版中自带很多包和完整文档的操作系统,因此我认为这是正确的选择。如果你不想安装最新的Ubuntu,你可以从[下载iso文件][1]开始。 + +本篇我们会学习如何用rbenv在Ubuntu 15.04中安装Ruby on Rails。我们选择Ubuntu作为操作系统是因为Ubuntu是Linux发行版中自带很多包和完整文档的操作系统,因此我认为这是正确的选择。如果你还没有安装最新的Ubuntu,你可以从[下载iso文件][1]开始。 ### 安装 Ruby ### @@ -9,9 +10,9 @@ sudo apt-get update sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libffi-dev -有三种方法来安装Ruby比如rbenv,rvm和从源码安装。每种都有各自的好处,但是这些天开发者们更倾向使用rbenv而不是rvm和源码来安装。我们将安装最新的Ruby版本,2.2.2。 +有三种方法来安装Ruby:rbenv、rvm和从源码安装。每种都有各自的好处,但是近来开发者们更倾向使用rbenv而不是rvm和源码来安装。我们将安装最新的Ruby版本,2.2.2。 -用rbenv来安装只有简单的两步。第一步安装rbenv接着是ruby-build: +用rbenv来安装只有简单的两步。第一步安装rbenv,接着是ruby-build: cd git clone git://github.com/sstephenson/rbenv.git .rbenv @@ -28,23 +29,23 @@ rbenv global 2.2.2 ruby -v -我们需要安装Bundler但是我们要在安装之前告诉rubygems不要为每个包本地安装文档。 +我们需要安装Bundler,但是我们要在安装之前告诉rubygems不要为每个包安装本地文档。 echo "gem: --no-ri --no-rdoc" > ~/.gemrc gem install bundler ### 配置 GIT ### -配置git之前,你要创建一个github账号,你可以注册[git][2]。我们需要git作为版本控制系统,因此我们要设置来匹配github账号。 +配置git之前,你要创建一个github账号,你可以注册一个[github 账号][2]。我们需要git作为版本控制系统,因此我们要设置它来匹配github账号。 -用户的github账号来代替下面的**Name** 和 **Email address** 。 +用户的github账号来替换下面的**Name** 和 **Email address** 。 git config --global color.ui true git config --global user.name "YOUR NAME" git config --global user.email "YOUR@EMAIL.com" ssh-keygen -t rsa -C "YOUR@EMAIL.com" -接下来用新生成的ssh key添加到github账号中。这样你需要复制下面命令的输出并[粘贴在这][3]。 +接下来用新生成的ssh key添加到github账号中。这样你需要复制下面命令的输出并[粘贴在Github的设置页面里面][3]。 cat ~/.ssh/id_rsa.pub @@ -58,7 +59,7 @@ ### 安装 Rails ### -我们需要安装javascript运行时,像NodeJS因为这些天Rails带来很多依赖。这样我们可以结合并缩小你的javascript来提供一个更快的生产环境。 +我们需要安装像NodeJS这样的javascript运行时环境,因为近来Rails的依赖越来越多了。这样我们可以合并和压缩你的javascript,从而提供一个更快的生产环境。 我们需要添加PPA来安装nodeJS。 @@ -66,7 +67,7 @@ sudo apt-get update sudo apt-get install nodejs -如果在更新是晕倒了问题,你可以试试这个命令: +如果在更新时遇到了问题,你可以试试这个命令: # Note the new setup script name for Node.js v0.12 curl -sL https://deb.nodesource.com/setup_0.12 | sudo bash - @@ -74,15 +75,15 @@ # Then install with: sudo apt-get install -y nodejs -下一步,用这个命令: +下一步,用这个命令安装 rails: gem install rails -v 4.2.1 -因为我们正在使用rbenv,用下面的命令来安装rails。 +因为我们正在使用rbenv,用下面的命令来让rails的执行程序可以使用。 rbenv rehash -要确保rails已经正确安炸u哪个,你可以运行rails -v,显示如下: +要确保rails已经正确安装,你可以运行rails -v,显示如下: rails -v # Rails 4.2.1 @@ -91,25 +92,25 @@ ### 设置 MySQL ### -或许你已经熟悉MySQL了,你可以从Ubuntu的仓库中安装MySQL的客户端与服务端。你可以在安装时设置root用户密码。这个信息将来会进入你rails程序的database.yml文件中、用下面的命令来安装mysql。 +或许你已经熟悉MySQL了,你可以从Ubuntu的仓库中安装MySQL的客户端与服务端。你可以在安装时设置root用户密码。这个信息将来会进入你rails程序的database.yml文件中。用下面的命令来安装mysql。 sudo apt-get install mysql-server mysql-client libmysqlclient-dev -安装libmysqlclient-dev用于提供在设置rails程序时,rails在连接mysql所需要用到的用于编译mysql2 gem的文件。 +安装libmysqlclient-dev用于mysql2 gem的编译;在设置rails程序时,rails通过它来连接mysql。 ### 最后一步 ### 让我们尝试创建你的第一个rails程序: - # Use MySQL + # 使用 MySQL 数据库 rails new myapp -d mysql - # Move into the application directory + # 进入到应用目录 cd myapp - # Create Database + # 创建数据库 rake db:create @@ -125,7 +126,7 @@ nano config/database.yml -接着输入MySql root用户的密码。 +接着填入MySql root用户的密码。 ![](http://blog.linoxide.com/wp-content/uploads/2015/05/root_passw.png) @@ -133,7 +134,7 @@ ### 总结 ### -Rails是用Ruby写的, 也就是随着rails一起使用的编程语言。在Ubuntu 15.04中Ruby on Rails可以用rbenv、 rvm和源码的方式来安装。本篇我们使用的是rbenv方式并用了MySQL作为数据库。有任何的问题或建议,请在评论栏指出。 +Rails是用Ruby写的, 也是随着rails一起使用的编程语言。在Ubuntu 15.04中Ruby on Rails可以用rbenv、 rvm和源码的方式来安装。本篇我们使用的是rbenv方式并用了MySQL作为数据库。有任何的问题或建议,请在评论栏指出。 -------------------------------------------------------------------------------- @@ -141,7 +142,7 @@ via: http://linoxide.com/ubuntu-how-to/installing-ruby-rails-using-rbenv-ubuntu- 作者:[Obet][a] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From f210181ca95efbf33ffc870c1189ae1347d67794 Mon Sep 17 00:00:00 2001 From: ZTinoZ Date: Tue, 14 Jul 2015 17:54:06 +0800 Subject: [PATCH 587/965] Translating by ZTinoZ --- ...709 7 command line tools for monitoring your Linux system.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/talk/20150709 7 command line tools for monitoring your Linux system.md b/sources/talk/20150709 7 command line tools for monitoring your Linux system.md index 54764e2a54..fcbbb04068 100644 --- a/sources/talk/20150709 7 command line tools for monitoring your Linux system.md +++ b/sources/talk/20150709 7 command line tools for monitoring your Linux system.md @@ -18,7 +18,7 @@ FYI: 本文中的截图取自[Debian Linux 8.1][1] (“Jessie”),其运行在 ### Top命令 ### -One of the simpler Linux system monitoring tools, the **top command** comes with pretty much every flavor of Linux. This is the default display, but pressing the “z” key switches the display to color. Other hot keys and command line switches control things such as the display of summary and memory information (the second through fourth lines), sorting the list according to various criteria, killing tasks, and so on (you can find the complete list at [here][5]). +作为Linux系统监控工具中比较易用的一个,**top命令**能带我们一览Linux中的几乎每一处。以下这张图是它的默认界面,但是按“z”键可以切换不同的显示颜色。其它热键和命令则有其它的功能,例如显示概要信息和内存信息(第四行第二个),根据各种不一样的条件排序、终止进程任务等等(你可以在[这里][5]找到完整的列表)。 ![Image courtesy Mark Gibbs](http://images.techhive.com/images/article/2015/06/command-line-tools-monitoring-linux-system-4-100591904-orig.png) From b390f6619c7bdec3c7f0a5becbdfe24cf62d5a46 Mon Sep 17 00:00:00 2001 From: Yu Ye Date: Tue, 14 Jul 2015 18:55:04 +0800 Subject: [PATCH 588/965] Update 20141223 Defending the Free Linux World.md --- sources/talk/20141223 Defending the Free Linux World.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/talk/20141223 Defending the Free Linux World.md b/sources/talk/20141223 Defending the Free Linux World.md index c421ad96fe..0a552e640d 100644 --- a/sources/talk/20141223 Defending the Free Linux World.md +++ b/sources/talk/20141223 Defending the Free Linux World.md @@ -1,3 +1,5 @@ +Translating by H-mudcup + Defending the Free Linux World ================================================================================ ![](http://www.linuxinsider.com/ai/908455/open-invention-network.jpg) @@ -122,4 +124,4 @@ via: http://www.linuxinsider.com/story/Defending-the-Free-Linux-World-81512.html [2]:http://www.redhat.com/ [3]:http://www.law.uh.edu/ [4]:http://www.chaoticmoon.com/ -[5]:http://www.ieee.org/ \ No newline at end of file +[5]:http://www.ieee.org/ From 17ad2d5061d1fb826722a47ff8b93fd01da83d4e Mon Sep 17 00:00:00 2001 From: XLCYun Date: Tue, 14 Jul 2015 19:24:07 +0800 Subject: [PATCH 589/965] Create 20150713 How to manage Vim plugins 20150713 How to manage Vim plugins translated by XLCYun --- .../tech/20150713 How to manage Vim plugins | 146 ++++++++++++++++++ 1 file changed, 146 insertions(+) create mode 100644 translated/tech/20150713 How to manage Vim plugins diff --git a/translated/tech/20150713 How to manage Vim plugins b/translated/tech/20150713 How to manage Vim plugins new file mode 100644 index 0000000000..5f3b7ac6be --- /dev/null +++ b/translated/tech/20150713 How to manage Vim plugins @@ -0,0 +1,146 @@ + 如何管理Vim插件 + ================================================================================ + + Vim是Linux上一个轻量级的通用文本编辑器。虽然它开始时的学习曲线对于一般的Linux用户来说可能很困难,但比起它的好处,这些付出完全是值得的。随着功能的增长,在插件工具的应用下,Vim是完全可定制的。但是,由于它高级的功能配置,你需要花一些时间去了解它的插件系统,然后才能够有效地去个性化定置Vim。幸运的是,我们已经有一些工具能够使我们在使用Vim插件时更加轻松。而我日常所使用的就是Vundle. + ### 什么是Vundle ### + + [Vundle][1]是一个vim插件管理器,用于支持Vim包。Vundle能让你很简单地实现插件的安装,升级,搜索或者清除。它还能管理你的运行环境并且在标签方面提供帮助。 + ### 安装Vundle ### + + 首先,如果你的Linux系统上没有Git的话,先[安装Git][2]. + + 接着,创建一个目录,Vim的插件将会被下载并且安装在这个目录上。默认情况下,这个目录为~/.vim/bundle。 + + $ mkdir -p ~/.vim/bundle + + 现在,安装Vundle如下。注意Vundle本身也是一个vim插件。因此我们同样把vundle安装到之前创建的目录~/.vim/bundle下。 + + $ git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim + + ### 配置Vundle ### + + 现在配置你的.vimrc文件如下: + + set nocompatible " This is required + " 这是被要求的。(译注:中文注释为译者所加,下同。) + filetype off " This is required + " 这是被要求的。 + + " Here you set up the runtime path  + " 在这里设置你的运行时环境的路径。 + set rtp+=~/.vim/bundle/Vundle.vim + + " Initialize vundle  + " 初始化vundle + call vundle#begin() + + " This should always be the first  + " 这一行应该永远放在前面。 + Plugin 'gmarik/Vundle.vim' + + " This examples are from https://github.com/gmarik/Vundle.vim README + " 这个示范来自https://github.com/gmarik/Vundle.vim README + Plugin 'tpope/vim-fugitive' + + " Plugin from http://vim-scripts.org/vim/scripts.html + " 取自http://vim-scripts.org/vim/scripts.html的插件 + Plugin 'L9' + + " Git plugin not hosted on GitHub + " Git插件,但并不在GitHub上。 + Plugin 'git://git.wincent.com/command-t.git' + + "git repos on your local machine (i.e. when working on your own plugin) + "本地计算机上的Git仓库路径 (例如,当你在开发你自己的插件时) + Plugin 'file:///home/gmarik/path/to/plugin' + + " The sparkup vim script is in a subdirectory of this repo called vim. + " Pass the path to set the runtimepath properly. + " vim脚本sparkup存放在这个名叫vim的仓库下的一个子目录中。 + " 提交这个路径来正确地设置运行时路径 + Plugin 'rstacruz/sparkup', {'rtp': 'vim/'} + + " Avoid a name conflict with L9 + " 避免与L9发生名字上的冲突 + Plugin 'user/L9', {'name': 'newL9'} + + "Every Plugin should be before this line + "所有的插件都应该在这一行之前。 + call vundle#end() " required 被要求的 + + 容我简单解释一下上面的设置:默认情况下,Vundle将从github.com或者vim-scripts.org下载和安装vim插件。你也可以改变这个默认行为。 + + 要从github安装(安装插件,译者注,下同): + Plugin 'user/plugin' + + 要从http://vim-scripts.org/vim/scripts.html处安装: + Plugin 'plugin_name' + + 要从另外一个git仓库中安装: + + Plugin 'git://git.another_repo.com/plugin' + + 从本地文件中安装: + + Plugin 'file:///home/user/path/to/plugin' + + + 你同样可以定制其它东西,例如你的插件运行时路径,当你自己在编写一个插件时,或者你只是想从其它目录——而不是~/.vim——中加载插件时,这样做就非常有用。 + + Plugin 'rstacruz/sparkup', {'rtp': 'another_vim_path/'} + + 如果你有同名的插件,你可以重命名你的插件,这样它们就不会发生冲突了。 + + Plugin 'user/plugin', {'name': 'newPlugin'} + + ### 使用Vum命令 ### + 一旦你用vundle设置好你的插件,你就可以通过几个vundle命令来安装,升级,搜索插件,或者清除没有用的插件。 + + #### 安装一个新的插件 #### + + 所有列在你的.vimrc文件中的插件,都会被PluginInstall命令安装。你也可以通递一个插件名给它,来安装某个的特定插件。 + :PluginInstall + :PluginInstall <插件名> + + ![](https://farm1.staticflickr.com/559/18998707843_438cd55463_c.jpg) + + #### 清除没有用的插件 #### + + 如果你有任何没有用到的插件,你可以通过PluginClean命令来删除它. + :PluginClean + + ![](https://farm4.staticflickr.com/3814/19433047689_17d9822af6_c.jpg) + + #### 查找一个插件 #### + + 如果你想从提供的插件清单中安装一个插件,搜索功能会很有用 + :PluginSearch <文本> + + ![](https://farm1.staticflickr.com/541/19593459846_75b003443d_c.jpg) + + + 在搜索的时候,你可以在交互式分割窗口中安装,清除,重新搜索或者重新加载插件清单.安装后的插件不会自动加载生效,要使其加载生效,可以将它们添加进你的.vimrc文件中. + ### 总结 ### + + Vim是一个妙不可言的工具.它不单单是一个能够使你的工作更加顺畅高效的默认文本编辑器,同时它还能够摇身一变,成为现存的几乎任何一门编程语言的IDE. + + 注意,有一些网站能帮你找到适合的vim插件.猛击[http://www.vim-scripts.org][3], Github或者 [http://www.vimawesome.com][4] 获取新的脚本或插件.同时记得为你的插件使用帮助供应程序 + + 和你最爱的编辑器一起嗨起来吧! + + -------------------------------------------------------------------------------- + + via: http://xmodulo.com/manage-vim-plugins.html + + 作者:[Christopher Valerio][a] + 译者:[XLCYun(袖里藏云)](https://github.com/XLCYun) + 校对:[校对者ID](https://github.com/校对者ID) + + 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + + [a]:http://xmodulo.com/author/valerio + [1]:https://github.com/VundleVim/Vundle.vim + [2]:http://ask.xmodulo.com/install-git-linux.html + [3]:http://www.vim-scripts.org/ + [4]:http://www.vimawesome.com/ + From 35c2f78485d4775752fdd4edbdd647a5bbe1fe64 Mon Sep 17 00:00:00 2001 From: XLCYun Date: Tue, 14 Jul 2015 19:25:26 +0800 Subject: [PATCH 590/965] Update 20150713 How to manage Vim plugins --- translated/tech/20150713 How to manage Vim plugins | 1 + 1 file changed, 1 insertion(+) diff --git a/translated/tech/20150713 How to manage Vim plugins b/translated/tech/20150713 How to manage Vim plugins index 5f3b7ac6be..ce47dac126 100644 --- a/translated/tech/20150713 How to manage Vim plugins +++ b/translated/tech/20150713 How to manage Vim plugins @@ -1,4 +1,5 @@ 如何管理Vim插件 + ================================================================================ Vim是Linux上一个轻量级的通用文本编辑器。虽然它开始时的学习曲线对于一般的Linux用户来说可能很困难,但比起它的好处,这些付出完全是值得的。随着功能的增长,在插件工具的应用下,Vim是完全可定制的。但是,由于它高级的功能配置,你需要花一些时间去了解它的插件系统,然后才能够有效地去个性化定置Vim。幸运的是,我们已经有一些工具能够使我们在使用Vim插件时更加轻松。而我日常所使用的就是Vundle. From 118a6689dc2732d9ae11ddecfd86522985be3fea Mon Sep 17 00:00:00 2001 From: XLCYun Date: Tue, 14 Jul 2015 19:33:40 +0800 Subject: [PATCH 591/965] Update 20150713 How to manage Vim plugins --- translated/tech/20150713 How to manage Vim plugins | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/translated/tech/20150713 How to manage Vim plugins b/translated/tech/20150713 How to manage Vim plugins index ce47dac126..4c58930eb7 100644 --- a/translated/tech/20150713 How to manage Vim plugins +++ b/translated/tech/20150713 How to manage Vim plugins @@ -1,6 +1,8 @@ - 如何管理Vim插件 - - ================================================================================ + +如何管理Vim插件 +================================================================================ + + Vim是Linux上一个轻量级的通用文本编辑器。虽然它开始时的学习曲线对于一般的Linux用户来说可能很困难,但比起它的好处,这些付出完全是值得的。随着功能的增长,在插件工具的应用下,Vim是完全可定制的。但是,由于它高级的功能配置,你需要花一些时间去了解它的插件系统,然后才能够有效地去个性化定置Vim。幸运的是,我们已经有一些工具能够使我们在使用Vim插件时更加轻松。而我日常所使用的就是Vundle. ### 什么是Vundle ### From 25e9ffd53e9ea1f630ed7d9dfc973c85be3a8301 Mon Sep 17 00:00:00 2001 From: XLCYun Date: Tue, 14 Jul 2015 20:10:29 +0800 Subject: [PATCH 592/965] Update 20150713 How to manage Vim plugins --- .../tech/20150713 How to manage Vim plugins | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/translated/tech/20150713 How to manage Vim plugins b/translated/tech/20150713 How to manage Vim plugins index 4c58930eb7..bbc7a8502f 100644 --- a/translated/tech/20150713 How to manage Vim plugins +++ b/translated/tech/20150713 How to manage Vim plugins @@ -1,14 +1,14 @@ - + 如何管理Vim插件 ================================================================================ Vim是Linux上一个轻量级的通用文本编辑器。虽然它开始时的学习曲线对于一般的Linux用户来说可能很困难,但比起它的好处,这些付出完全是值得的。随着功能的增长,在插件工具的应用下,Vim是完全可定制的。但是,由于它高级的功能配置,你需要花一些时间去了解它的插件系统,然后才能够有效地去个性化定置Vim。幸运的是,我们已经有一些工具能够使我们在使用Vim插件时更加轻松。而我日常所使用的就是Vundle. - ### 什么是Vundle ### +### 什么是Vundle ### [Vundle][1]是一个vim插件管理器,用于支持Vim包。Vundle能让你很简单地实现插件的安装,升级,搜索或者清除。它还能管理你的运行环境并且在标签方面提供帮助。 - ### 安装Vundle ### +### 安装Vundle ### 首先,如果你的Linux系统上没有Git的话,先[安装Git][2]. @@ -20,7 +20,7 @@ $ git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim - ### 配置Vundle ### +### 配置Vundle ### 现在配置你的.vimrc文件如下: @@ -96,10 +96,10 @@ Plugin 'user/plugin', {'name': 'newPlugin'} - ### 使用Vum命令 ### +### 使用Vum命令 ### 一旦你用vundle设置好你的插件,你就可以通过几个vundle命令来安装,升级,搜索插件,或者清除没有用的插件。 - #### 安装一个新的插件 #### +#### 安装一个新的插件 #### 所有列在你的.vimrc文件中的插件,都会被PluginInstall命令安装。你也可以通递一个插件名给它,来安装某个的特定插件。 :PluginInstall @@ -114,7 +114,7 @@ ![](https://farm4.staticflickr.com/3814/19433047689_17d9822af6_c.jpg) - #### 查找一个插件 #### +#### 查找一个插件 #### 如果你想从提供的插件清单中安装一个插件,搜索功能会很有用 :PluginSearch <文本> @@ -123,11 +123,11 @@ 在搜索的时候,你可以在交互式分割窗口中安装,清除,重新搜索或者重新加载插件清单.安装后的插件不会自动加载生效,要使其加载生效,可以将它们添加进你的.vimrc文件中. - ### 总结 ### +### 总结 ### Vim是一个妙不可言的工具.它不单单是一个能够使你的工作更加顺畅高效的默认文本编辑器,同时它还能够摇身一变,成为现存的几乎任何一门编程语言的IDE. - 注意,有一些网站能帮你找到适合的vim插件.猛击[http://www.vim-scripts.org][3], Github或者 [http://www.vimawesome.com][4] 获取新的脚本或插件.同时记得为你的插件使用帮助供应程序 + 注意,有一些网站能帮你找到适合的vim插件.猛击[http://www.vim-scripts.org][3], Github或者 [http://www.vimawesome.com][4] 获取新的脚本或插件.同时记得为你的插件使用帮助供应程序. 和你最爱的编辑器一起嗨起来吧! From 8da7451463407cc0b2a54b645fd9e152b0716400 Mon Sep 17 00:00:00 2001 From: XLCYun Date: Tue, 14 Jul 2015 20:13:53 +0800 Subject: [PATCH 593/965] Update 20150713 How to manage Vim plugins --- translated/tech/20150713 How to manage Vim plugins | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/translated/tech/20150713 How to manage Vim plugins b/translated/tech/20150713 How to manage Vim plugins index bbc7a8502f..c575d426e3 100644 --- a/translated/tech/20150713 How to manage Vim plugins +++ b/translated/tech/20150713 How to manage Vim plugins @@ -107,7 +107,7 @@ ![](https://farm1.staticflickr.com/559/18998707843_438cd55463_c.jpg) - #### 清除没有用的插件 #### +#### 清除没有用的插件 #### 如果你有任何没有用到的插件,你可以通过PluginClean命令来删除它. :PluginClean From 6638649aeeb620cee7b328ec23d74bf7e9d8ef18 Mon Sep 17 00:00:00 2001 From: XLCYun Date: Tue, 14 Jul 2015 20:28:18 +0800 Subject: [PATCH 594/965] XLCYun translating. --- ...o Fix System Program Problem Detected In Ubuntu 14.04.md} | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) rename sources/tech/{20150713 How To Fix System Program Problem Detected In Ubuntu 14.04.md => XLCYun translating 20150713 How To Fix System Program Problem Detected In Ubuntu 14.04.md} (99%) diff --git a/sources/tech/20150713 How To Fix System Program Problem Detected In Ubuntu 14.04.md b/sources/tech/XLCYun translating 20150713 How To Fix System Program Problem Detected In Ubuntu 14.04.md similarity index 99% rename from sources/tech/20150713 How To Fix System Program Problem Detected In Ubuntu 14.04.md rename to sources/tech/XLCYun translating 20150713 How To Fix System Program Problem Detected In Ubuntu 14.04.md index 4a91a6aeb3..4de779a599 100644 --- a/sources/tech/20150713 How To Fix System Program Problem Detected In Ubuntu 14.04.md +++ b/sources/tech/XLCYun translating 20150713 How To Fix System Program Problem Detected In Ubuntu 14.04.md @@ -1,3 +1,6 @@ +XLCYun translating. + + How To Fix System Program Problem Detected In Ubuntu 14.04 ================================================================================ ![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/system_program_Problem_detected.jpeg) @@ -79,4 +82,4 @@ via: http://itsfoss.com/how-to-fix-system-program-problem-detected-ubuntu/ [a]:http://itsfoss.com/author/abhishek/ [1]:http://itsfoss.com/how-to-solve-sorry-ubuntu-12-04-has-experienced-an-internal-error/ -[2]:https://launchpad.net/ \ No newline at end of file +[2]:https://launchpad.net/ From cf6cd2ce1b2ea29e32f0a6dc9a102aaf687ff6a8 Mon Sep 17 00:00:00 2001 From: XLCYun Date: Tue, 14 Jul 2015 20:35:57 +0800 Subject: [PATCH 595/965] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=8E=9F=E6=96=87=20?= =?UTF-8?q?20150713=20How=20to=20manage=20Vim=20plugins.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 删除原文 20150713 How to manage Vim plugins.md --- .../20150713 How to manage Vim plugins.md | 140 ------------------ 1 file changed, 140 deletions(-) delete mode 100644 sources/tech/20150713 How to manage Vim plugins.md diff --git a/sources/tech/20150713 How to manage Vim plugins.md b/sources/tech/20150713 How to manage Vim plugins.md deleted file mode 100644 index 147f89b0b7..0000000000 --- a/sources/tech/20150713 How to manage Vim plugins.md +++ /dev/null @@ -1,140 +0,0 @@ -XLCYun 翻译中 -How to manage Vim plugins -================================================================================ -Vim is a versatile, lightweight text editor on Linux. While its initial learning curve can be overwhelming for an average Linux user, its benefits are completely worthy. As far as the functionality goes, Vim is fully customizable by means of plugins. Due to its high level of configuration, though, you need to spend some time with its plugin system to be able to personalize Vim in an effective way. Luckily, we have several tools that make our life with Vim plugins easier. The one I use on a daily basis is Vundle. - -### What is Vundle? ### - -[Vundle][1], which stands for Vim Bundle, is a Vim plugin manager. Vundle allows you to install, update, search and clean up Vim plugins very easily. It can also manage your runtime and help with tags. In this tutorial, I am going to show how to install and use Vundle. - -### Installing Vundle ### - -First, [install Git][2] if you don't have it on your Linux system. - -Next, create a directory where Vim plugins will be downloaded and installed. By default, this directory is located at ~/.vim/bundle - - $ mkdir -p ~/.vim/bundle - -Now go ahead and install Vundle as follows. Note that Vundle itself is another Vim plugin. Thus we install Vundle under ~/.vim/bundle we created earlier. - - $ git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim - -### Configuring Vundle ### - -Now set up you .vimrc file as follows: - - set nocompatible " This is required - filetype off " This is required - - " Here you set up the runtime path - set rtp+=~/.vim/bundle/Vundle.vim - - " Initialize vundle - call vundle#begin() - - " This should always be the first - Plugin 'gmarik/Vundle.vim' - - " This examples are from https://github.com/gmarik/Vundle.vim README - Plugin 'tpope/vim-fugitive' - - " Plugin from http://vim-scripts.org/vim/scripts.html - Plugin 'L9' - - "Git plugin not hosted on GitHub - Plugin 'git://git.wincent.com/command-t.git' - - "git repos on your local machine (i.e. when working on your own plugin) - Plugin 'file:///home/gmarik/path/to/plugin' - - " The sparkup vim script is in a subdirectory of this repo called vim. - " Pass the path to set the runtimepath properly. - Plugin 'rstacruz/sparkup', {'rtp': 'vim/'} - - " Avoid a name conflict with L9 - Plugin 'user/L9', {'name': 'newL9'} - - "Every Plugin should be before this line - - call vundle#end() " required - -Let me explain the above configuration a bit. By default, Vundle downloads and installs Vim plugins from github.com or vim-scripts.org. You can modify the default behavior. - -To install from Github: - - Plugin 'user/plugin' - -To install from http://vim-scripts.org/vim/scripts.html: - - Plugin 'plugin_name' - -To install from another git repo: - - Plugin 'git://git.another_repo.com/plugin' - -To install from a local file: - - Plugin 'file:///home/user/path/to/plugin' - -Also you can customize others such as the runtime path of you plugins, which is really useful if you are programming a plugin yourself, or just want to load it from another directory that is not ~/.vim. - - Plugin 'rstacruz/sparkup', {'rtp': 'another_vim_path/'} - -If you have plugins with the same names, you can rename you plugin so that it doesn't conflict. - - Plugin 'user/plugin', {'name': 'newPlugin'} - -### Using Vum Commands ### - -Once you have set up you plugins with Vundle, you can use it to to install, update, search and clean unused plugins using several Vundle commands. - -#### Installing a new plugin #### - -The PluginInstall command will install all plugins listed in your .vimrc file. You can also install just one specific plugin by passing its name. - - :PluginInstall - :PluginInstall - -![](https://farm1.staticflickr.com/559/18998707843_438cd55463_c.jpg) - -#### Cleaning up an unused plugin #### - -If you have any unused plugin, you can remove it by using the PluginClean command. - - :PluginClean - -![](https://farm4.staticflickr.com/3814/19433047689_17d9822af6_c.jpg) - -#### Searching for a plugin #### - -If you want to install a plugin from a plugin list provided, search functionality can be useful. - -:PluginSearch - -![](https://farm1.staticflickr.com/541/19593459846_75b003443d_c.jpg) - -While searching, you can install, clean, research or reload the same list on the interactive split. Installing plugins won't load your plugins automatically. To do so, add them to you .vimrc file. - -### Conclusion ### - -Vim is an amazing tool. It can not only be a great default text editor that can make your work flow faster and smoother, but also be turned into an IDE for almost any programming language available. Vundle can be a big help in personalizing the powerful Vim environment quickly and easily. - -Note that there are several sites that allow you to find the right Vim plugins for you. Always check [http://www.vim-scripts.org][3], Github or [http://www.vimawesome.com][4] for new scripts or plugins. Also remember to use the help provider for you plugin. - -Keep rocking with your favorite text editor! - --------------------------------------------------------------------------------- - -via: http://xmodulo.com/manage-vim-plugins.html - -作者:[Christopher Valerio][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://xmodulo.com/author/valerio -[1]:https://github.com/VundleVim/Vundle.vim -[2]:http://ask.xmodulo.com/install-git-linux.html -[3]:http://www.vim-scripts.org/ -[4]:http://www.vimawesome.com/ From e350614a5f53fe487941af1750ce97bb5ea27a38 Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 14 Jul 2015 21:53:57 +0800 Subject: [PATCH 596/965] PUB:20150407 10 Truly Amusing Easter Eggs in Linux MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @H-mudcup 翻译的很好,语言组织也很好。最后有一个词翻译错了。port 在这里指移植,不是通常的端口的意思。 --- ...7 10 Truly Amusing Easter Eggs in Linux.md | 53 +++++++++++-------- 1 file changed, 31 insertions(+), 22 deletions(-) rename {translated/share => published}/20150407 10 Truly Amusing Easter Eggs in Linux.md (77%) diff --git a/translated/share/20150407 10 Truly Amusing Easter Eggs in Linux.md b/published/20150407 10 Truly Amusing Easter Eggs in Linux.md similarity index 77% rename from translated/share/20150407 10 Truly Amusing Easter Eggs in Linux.md rename to published/20150407 10 Truly Amusing Easter Eggs in Linux.md index 4f783d829c..b68ae7bb81 100644 --- a/translated/share/20150407 10 Truly Amusing Easter Eggs in Linux.md +++ b/published/20150407 10 Truly Amusing Easter Eggs in Linux.md @@ -1,9 +1,11 @@ -Translating by H-mudcup - -Linux上绝对有趣的10个彩蛋 +十个非常有趣的 Linux 彩蛋 ================================================================================ + +*制作 Adventure 的程序员悄悄的把一个秘密的功能塞进了游戏里。Atari 并没有对此感到生气,而是给这类“秘密功能”起了个名字——“彩蛋”,因为——你懂的——你会像找复活节彩蛋一样寻找它们。* + ![](http://en.wikipedia.org/wiki/File:Adventure_Easteregg.PNG) -制作 Adventure 的程序员悄悄的把一个秘密的功能塞进了游戏里。Atari 并没有对此感到生气,而是给这类“秘密功能”起了个名字——“彩蛋”,因为——你懂的——你会像找复活节彩蛋一样寻找它们。图片来自: Wikipedia。 + +*图片来自: Wikipedia* 在1979年的时候,公司为 Atari 2600 开发了一个电子游戏——[Adventure][1]。 @@ -13,9 +15,9 @@ Atari 有一项反对作者将自己的名字放进他们的游戏里的政策 这种软件里的“隐藏功能”并不是第一次出现(这类特性的首次出现是在1966年[PDP-10][3]的操作系统上),但这是它第一次有了名字,同时也是第一次真正的被众多电脑用户和游戏玩家所注意。 -Linux(以及和Linux相关的软件)并没有被遗忘。这些年来,人们为这个倍受喜爱的操作系统创作了很多非常有趣的彩蛋。下面将介绍我个人最喜爱的彩蛋——以及如何得到它们。 +Linux(以及和Linux相关的软件)也没有被遗忘。这些年来,人们为这个倍受喜爱的操作系统创作了很多非常有趣的彩蛋。下面将介绍我个人最喜爱的彩蛋——以及如何找到它们。 -你将迅速意识到这些彩蛋大多需要通过终端才能体验到。这是故意的。因为终端比较酷。【我应该借此机机会提醒你一下,如果你想运行我所列出的应用,然而你却还没有安装它们,你是绝对无法运行成功的。你应该先安装好它们的。因为……毕竟只是计算机。】 +你很快就会想到这些彩蛋大多需要通过终端才能体验到。这是故意的。因为终端比较酷。【我应该借此机机会提醒你一下,如果你想运行我所列出的应用,然而你却还没有安装它们,你是绝对无法运行成功的。你应该先安装好它们的。因为……毕竟只是计算机。】 ### Arch : 包管理器(pacman)里的吃豆人(Pac-Man) ### @@ -28,7 +30,8 @@ Linux(以及和Linux相关的软件)并没有被遗忘。这些年来,人 ### GNU Emacs : 俄罗斯方块(Tetris)以及…… ### ![emacs Tetris](http://www.linux.com/images/stories/41373/emacsTetris.jpg) -我不喜欢 emacs。一点也不喜欢。但是它确实能玩俄罗斯方块。 + +*我不喜欢 emacs。一点也不喜欢。但是它确实能玩俄罗斯方块。* 我要坦白一件事:我不喜欢[emacs][7]。一点也不喜欢。 @@ -36,7 +39,7 @@ Linux(以及和Linux相关的软件)并没有被遗忘。这些年来,人 但是它确实能玩俄罗斯方块。这可不是件小事。方法如下: -第一步)打开 emacs。(有疑问,输入“emacs”。) +第一步)打开 emacs。(有疑问?输入“emacs”。) 第二步)按下键盘上的Esc和X键。 @@ -51,21 +54,24 @@ Linux(以及和Linux相关的软件)并没有被遗忘。这些年来,人 在用基于 Debian 的发行版?试试输入“apt-get moo"。 ![apt-get moo](http://www.linux.com/images/stories/41373/AptGetMoo.jpg) -apt-get moo -简单?的确。但这是只会说话的牛。所以惹我们喜欢。再试试“aptitude moo”。他会告诉你“There are no Easter Eggs in this program(这个程序里没有彩蛋)”。 +*apt-get moo* + +简单?的确。但这是只会说话的牛,所以惹我们喜欢。再试试“aptitude moo”。他会告诉你“There are no Easter Eggs in this program(这个程序里没有彩蛋)”。 关于 [aptitude][9] 有一件事你一定要知道,它是个肮脏、下流的骗子。如果 aptitude 是匹诺曹,那它的鼻子能刺穿月球。在这条命令中添加“-v”选项。不停的添加 v,直到它被逼得投降。 ![](http://www.linux.com/images/stories/41373/AptitudeMoo.jpg) -我猜大家都同意,这是 aptitude 中最重要的功能。 + +*我猜大家都同意,这是 aptitude 中最重要的功能。* 我猜大家都同意,这是 aptitude 中最重要的功能。但是万一你想把自己的话让一头牛说出来怎么办?这时我们就需要“cowsay”了。 -还有,别让“cowsay(牛说)”这个名字把你给骗了。你可以让你的话从各种东西的嘴里说出来。比如一头大象,Calvin,Beavis 甚至可以是Ghostbusters(捉鬼敢死队)的标志。只需在终端输入“cowsay -l”就能看到所有选项的列表。 +还有,别让“cowsay(牛说)”这个名字把你给骗了。你可以让你的话从各种东西的嘴里说出来。比如一头大象,Calvin,Beavis 甚至可以是 Ghostbusters(捉鬼敢死队)的标志。只需在终端输入“cowsay -l”就能看到所有选项的列表。 ![](http://www.linux.com/images/stories/41373/cowsay.jpg) -你可以让你的话从各种东西的嘴里说出来 + +*你可以让你的话从各种东西的嘴里说出来* 想玩高端点的?你可以用管道把其他应用的输出放到 cowsay 中。试试“fortune | cowsay”。非常有趣。 @@ -75,7 +81,7 @@ apt-get moo 输入“sudo visudo”以打开“sudoers”文件。在文件的开头你很可能会看见几行以“Defaults”开头的文字。在那几行后面添加“Defaults insults”并保存文件。 -现在,只要你输错了你的 sudo 密码,你的系统就会骂你。这些提高自信的语句包括“听着,煎饼脑袋,我可没时间听这些垃圾。”,“你吃错药了吧?”以及“你被电过以后大脑就跟以前不太一样了是不是?” +现在,只要你输错了你的 sudo 密码,你的系统就会骂你。这些可以提高自信的语句包括“听着,煎饼脑袋,我可没时间听这些垃圾。”,“你吃错药了吧?”以及“你被电过以后大脑就跟以前不太一样了是不是?” 把这个设在同事的电脑上会有非常有趣。 @@ -85,10 +91,11 @@ apt-get moo 打开火狐浏览器。在地址栏填上“about:about”。你将得到火狐浏览器中所有的“about”页。一点也不炫酷,是不是? -现在试试“about:mozilla”,浏览器就会回应你一条从“[Book of Mozilla(Mozilla 之书)][10]”——浏览网页的圣经——里引用的话。我的另一个最爱是“about:robots”,这个也很有趣。 +现在试试“about:mozilla”,浏览器就会回应你一条从“[Book of Mozilla(Mozilla 之书)][10]”——这本浏览网页的圣经——里引用的话。我的另一个最爱是“about:robots”,这个也很有趣。 ![](http://www.linux.com/images/stories/41373/About-Mozilla550.jpg) -“[Book of Mozilla(Mozilla 之书)][10]”——浏览网页的圣经。 + +*“[Book of Mozilla(Mozilla 之书)][10]”——浏览网页的圣经。* ### 精心调制的混搭日历 ### @@ -105,26 +112,28 @@ apt-get moo 例如: “nmap -oS - google.com” 赶快试试。我知道你有多想这么做。你一定会让安吉丽娜·朱莉(Angelina Jolie)[印象深刻][15] + ### lolcat彩虹 ### 在你的Linux终端里有很多彩蛋真真是极好的……但是如果你还想要变得……更有魅力些怎么办?输入:lolcat。把任何一个程序的文本输出通过管道输入到lolcat里。你会得到它的超级无敌彩虹版。 ![](http://www.linux.com/images/stories/41373/lolcat.jpg) -把任何一个程序的文本输出通过管道输入到lolcat里。你会得到它的超级无敌彩虹版。 + +*把任何一个程序的文本输出通过管道输入到lolcat里。你会得到它的超级无敌彩虹版。* ### 追光标的小家伙 ### ![oneko cat](http://www.linux.com/images/stories/41373/onekocat.jpg) -“Oneko” -- 经典 “Neko”的Linux端口。 -“Oneko” -- 经典 “[Neko][16]”的Linux端口。 . -接下来是“Oneko” -- 经典 “[Neko][16]”的Linux端口。基本上就是个满屏幕追着你的光标跑的小猫。 +*“Oneko” -- 经典 “Neko”的Linux移植版本。* + +接下来是“Oneko” -- 经典 “[Neko][16]”的Linux移植版本。基本上就是个满屏幕追着你的光标跑的小猫。 虽然严格来它并不算是“彩蛋”,它还是很有趣的。而且感觉上也是很彩蛋的。 你还可以用不同的选项(比如“oneko -dog”)把小猫替代成小狗,或是调成其他样式。用这个对付讨厌的同事有着无限的可能。 -There you have it! A list of my favorite Linux Easter Eggs (and things of that ilk). Feel free to add your own favorite in the comments section below. Because this is the Internet. And you can do that sort of thing.就是这些了!一个我最喜欢的Linux彩蛋(或是类似东西)的清单。请尽情的的在下面的评论区留下你的最爱。因为这是互联网。你就能做这些事。 +就是这些了!一个我最喜欢的Linux彩蛋(或是类似东西)的清单。请尽情的的在下面的评论区留下你的最爱。因为这是互联网。你就能做这些事。 -------------------------------------------------------------------------------- @@ -132,7 +141,7 @@ via: http://www.linux.com/news/software/applications/820944-10-truly-amusing-lin 作者:[Bryan Lunduke][a] 译者:[H-mudcup](https://github.com/H-mudcup) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 From a32b54f0ee48404a46b6b653941c79b37a0d8068 Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 14 Jul 2015 22:01:13 +0800 Subject: [PATCH 597/965] PUB:20150709 Linux FAQs with Answers--How to fix 'tar--Exiting with failure status due to previous errors' MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @XLCYun 这是你的第一篇译稿吧?翻译的干净明快,不错,加油! --- ...ng with failure status due to previous errors'.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) rename {translated/tech => published}/20150709 Linux FAQs with Answers--How to fix 'tar--Exiting with failure status due to previous errors'.md (80%) diff --git a/translated/tech/20150709 Linux FAQs with Answers--How to fix 'tar--Exiting with failure status due to previous errors'.md b/published/20150709 Linux FAQs with Answers--How to fix 'tar--Exiting with failure status due to previous errors'.md similarity index 80% rename from translated/tech/20150709 Linux FAQs with Answers--How to fix 'tar--Exiting with failure status due to previous errors'.md rename to published/20150709 Linux FAQs with Answers--How to fix 'tar--Exiting with failure status due to previous errors'.md index 4b6b3b0fca..bcf1dfec3f 100644 --- a/translated/tech/20150709 Linux FAQs with Answers--How to fix 'tar--Exiting with failure status due to previous errors'.md +++ b/published/20150709 Linux FAQs with Answers--How to fix 'tar--Exiting with failure status due to previous errors'.md @@ -1,6 +1,7 @@ -Linux常见问题解答--如何修复"tar:由于前一个错误导致于失败状态中退出"("Exiting with failure status due to previous errors") +Linux常见问题解答--如何修复"tar:由于前一个错误导致于失败状态中退出" ================================================================================ > **问题**: 当我想试着用tar命令来创建一个压缩文件时,总在执行过程中失败,并且抛出一个错误说明"tar:由于前一个错误导致于失败状态中退出"("Exiting with failure status due to previous errors"). 什么导致这个错误的发生,要如何解决? + ![](https://farm9.staticflickr.com/8863/17631029953_1140fe2dd3_b.jpg) 如果当你执行tar命令时,遇到了下面的错误,那么最有可能的原因是对于你想用tar命令压缩的某个文件中,你并不具备其读权限。 @@ -13,21 +14,20 @@ Linux常见问题解答--如何修复"tar:由于前一个错误导致于失败 $ tar cvzfz backup.tgz my_program/ > /dev/null -然后你会看到tar输出的标准错误(stderr)信息。 +然后你会看到tar输出的标准错误(stderr)信息。(LCTT 译注:自然,不用 v 参数也可以。) tar: my_program/src/lib/.conf.db.~lock~: Cannot open: Permission denied tar: Exiting with failure status due to previous errors -你可以从上面的例子中看到,引起错误的原因的确是“读权限不允许”(denied read permission.) -要解决这个问题,只要简单地更改(或移除)问题文件的权限,然后重新执行tar命令即可。 +你可以从上面的例子中看到,引起错误的原因的确是“读权限不允许”(denied read permission.)要解决这个问题,只要简单地更改(或移除)问题文件的权限,然后重新执行tar命令即可。 -------------------------------------------------------------------------------- via: http://ask.xmodulo.com/tar-exiting-with-failure-status-due-to-previous-errors.html 作者:[Dan Nanni][a] -译者:[XLCYun(袖里藏云)](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) +译者:[XLCYun(袖里藏云)](https://github.com/XLCYun) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From f82d69060985e47c9e758a26db971b3c196b4970 Mon Sep 17 00:00:00 2001 From: XLCYun Date: Tue, 14 Jul 2015 22:04:48 +0800 Subject: [PATCH 598/965] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=8E=9F=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 翻译完成,删除原文 20150713 How To Fix System Program Problem Detected In Ubuntu 14.04.md --- ...rogram Problem Detected In Ubuntu 14.04.md | 82 ------------------- 1 file changed, 82 deletions(-) delete mode 100644 sources/tech/20150713 How To Fix System Program Problem Detected In Ubuntu 14.04.md diff --git a/sources/tech/20150713 How To Fix System Program Problem Detected In Ubuntu 14.04.md b/sources/tech/20150713 How To Fix System Program Problem Detected In Ubuntu 14.04.md deleted file mode 100644 index 4a91a6aeb3..0000000000 --- a/sources/tech/20150713 How To Fix System Program Problem Detected In Ubuntu 14.04.md +++ /dev/null @@ -1,82 +0,0 @@ -How To Fix System Program Problem Detected In Ubuntu 14.04 -================================================================================ -![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/system_program_Problem_detected.jpeg) - -For the last couple of weeks, (almost) every time I was greeted with **system program problem detected on startup in Ubuntu 15.04**. I ignored it for sometime but it was quite annoying after a certain point. You won’t be too happy as well if you are greeted by a pop-up displaying this every time you boot in to the system: - -> System program problem detected -> -> Do you want to report the problem now? -> -> ![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/System_Program_Problem_Detected.png) - -I know if you are an Ubuntu user you might have faced this annoying pop-up sometimes for sure. In this post we are going to see what to do with “system program problem detected” report in Ubuntu 14.04 and 15.04. - -### What to do with “system program problem detected” error in Ubuntu? ### - -#### So what exactly is this notifier all about? #### - -Basically, this notifies you of a crash in your system. Don’t panic by the word ‘crash’. It’s not a major issue and your system is very much usable. It just that some program crashed some time in the past and Ubuntu wants you to decide whether or not you want to report this crash report to developers so that they could fix this issue. - -#### So, we click on Report problem and it will vanish? #### - -No, not really. Even if you click on report problem, you’ll be ultimately greeted with a pop up like this: - -![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/Ubuntu_Internal_error.png) - -[Sorry, Ubuntu has experienced an internal error][1] is the apport that will further open a web browser and then you can file a bug report by logging or creating an account with [Launchpad][2]. You see, it is a complicated procedure which will take around four steps to complete. - -#### But, I want to help developers and let them know of the bugs! #### - -That’s very thoughtful of you and the right thing to do. But there are two issues here. First, there are high chances that the bug would have already been reported. Second, even if you take the pain of reporting the crash, it’s not a guarantee that you won’t see it again. - -#### So, you suggesting to not report the crash? #### - -Yes and no. Report the crash when you see it the first time, if you want. You can see the crashing program under “Show Details” in the above picture. But if you see it repetitively or if you do not want to report the bug, I advise you to get rid of the system crash once and for all. - -### Fix “system program problem detected” error in Ubuntu ### - -The crash reports are stored in /var/crash directory in Ubuntu. If you look in to this directory, you should see some files ending with crash. - -![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/Crash_reports_Ubuntu.jpeg) - -What I suggest is that you delete these crash reports. Open a terminal and use the following command: - - sudo rm /var/crash/* - -This will delete all the content of directory /var/crash. This way you won’t be annoyed by the pop up for the programs crash that happened in the past. But if a programs crashes again, you’ll again see system program problem detected error. You can either remove the crash reports again, like we just did, or you can disable the Apport (debug tool) and permanently get rid of the pop-ups. - -#### Permanently get rid of system error pop up in Ubuntu #### - -If you do this, you’ll never be notified about any program crash that happens in the system. If you ask my view, I would say it’s not that bad a thing unless you are willing to file bug reports. If you have no intention of filing a bug report, the crash notifications and their absence will make no difference. - -To disable the Apport and get rid of system crash report completely, open a terminal and use the following command to edit the Apport settings file: - - gksu gedit /etc/default/apport - -The content of the file is: - - # set this to 0 to disable apport, or to 1 to enable it - # you can temporarily override this with - # sudo service apport start force_start=1 - enabled=1 - -Change the **enabled=1** to **enabled=0**. Save and close the file. You won’t see any pop up for crash reports after doing this. Obvious to point out that if you want to enable the crash reports again, you just need to change the same file and put enabled as 1 again. - -#### Did it work for you? #### - -I hope this tutorial helped you to fix system program problem detected in Ubuntu 14.04 and Ubuntu 15.04. Let me know if this tip helped you to get rid of this annoyance. - --------------------------------------------------------------------------------- - -via: http://itsfoss.com/how-to-fix-system-program-problem-detected-ubuntu/ - -作者:[Abhishek][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://itsfoss.com/author/abhishek/ -[1]:http://itsfoss.com/how-to-solve-sorry-ubuntu-12-04-has-experienced-an-internal-error/ -[2]:https://launchpad.net/ \ No newline at end of file From f9def2e5d54f39d483fa0778b4901dd2af4211e3 Mon Sep 17 00:00:00 2001 From: XLCYun Date: Tue, 14 Jul 2015 22:07:00 +0800 Subject: [PATCH 599/965] Translated By XLCYun MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 20150713 How To Fix System Program Problem Detected In Ubuntu 翻译完成。 --- ...m Program Problem Detected In Ubuntu 14.04 | 80 +++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 translated/tech/20150713 How To Fix System Program Problem Detected In Ubuntu 14.04 diff --git a/translated/tech/20150713 How To Fix System Program Problem Detected In Ubuntu 14.04 b/translated/tech/20150713 How To Fix System Program Problem Detected In Ubuntu 14.04 new file mode 100644 index 0000000000..3658528e77 --- /dev/null +++ b/translated/tech/20150713 How To Fix System Program Problem Detected In Ubuntu 14.04 @@ -0,0 +1,80 @@ + +如何修复ubuntu 14.04中检测到系统程序错误的问题 +================================================================================ +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/system_program_Problem_detected.jpeg) + + +在过去的几个星期,(几乎)每次都有消息 **Ubuntu 15.04在启动时检测到系统程序错误(system program problem detected on startup in Ubuntu 15.04)** 跑出来“欢迎”我。那时我是直接忽略掉它的,但是这种情况到了某个时刻,它就让人觉得非常烦人了! + +> 检测到系统程序错误(System program problem detected) +> +> 你想立即报告这个问题吗? +> +> ![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/System_Program_Problem_Detected.png) + + +我肯定地知道如果你是一个Ubuntu用户,你可能曾经也遇到过这个恼人的弹窗。在本文中,我们将探讨在Ubuntu 14.04和15.04中遇到"检测到系统程序错误(system program problem detected)"时 应该怎么办。 +### 怎么解决Ubuntu中"检测到系统程序错误"的错误 ### + +#### 那么这个通知到底是关于什么的? #### + +大体上讲,它是在告知你,你的系统的一部分崩溃了。可别因为“崩溃”这个词而恐慌。这不是一个严重的问题,你的系统还是完完全全可用的。只是在以前的某个时刻某个程序崩溃了,而Ubuntu想让你决定要不要把这个问题报告给开发者,这样他们就能够修复这个问题。 + +#### 那么,我们点了“报告错误”的按钮后,它以后就不再显示了?#### + + +不,不是的!即使你点了“报告错误”按钮,最后你还是会被一个如下的弹窗再次“欢迎”: +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/Ubuntu_Internal_error.png) + +[对不起,Ubuntu发生了一个内部错误(Sorry, Ubuntu has experienced an internal error)][1]是一个Apport(Apport是Ubuntu中错误信息的收集报告系统,详见Ubuntu Wiki中的Apport篇,译者注),它将会进一步的打开网页浏览器,然后你可以通过登录或创建[Launchpad][2]帐户来填写一份漏洞(Bug)报告文件。你看,这是一个复杂的过程,它要花整整四步来完成. +#### 但是我想帮助开发者,让他们知道这个漏洞啊 !#### + +你这样想的确非常地周到体贴,而且这样做也是正确的。但是这样做的话,存在两个问题。第一,存在非常高的概率,这个漏洞已经被报告过了;第二,即使你报告了个这次崩溃,也无法保证你不会再看到它。 + +#### 那么,你的意思就是说别报告这次崩溃了?#### + +对,也不对。如果你想的话,在你第一次看到它的时候报告它。你可以在上面图片显示的“显示细节(Show Details)”中,查看崩溃的程序。但是如果你总是看到它,或者你不想报告漏洞(Bug),那么我建议你还是一次性摆脱这个问题吧。 +### 修复Ubuntu中“检测到系统程序错误”的错误 ### + +这些错误报告被存放在Ubuntu中目录/var/crash中。如果你翻看这个目录的话,应该可以看到有一些以crash结尾的文件。 +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/Crash_reports_Ubuntu.jpeg) + +我的建议是删除这些错误报告。打开一个终端,执行下面的命令: + + sudo rm /var/crash/* + +这个操作会删除所有在/var/crash目录下的所有内容。这样你就不会再被这些报告以前程序错误的弹窗所扰。但是如果有一个程序又崩溃了,你就会再次看到“检测到系统程序错误”的错误。你可以再次删除这些报告文件,或者你可以禁用Apport来彻底地摆脱这个错误弹窗。 +#### 彻底地摆脱Ubuntu中的系统错误弹窗 #### + +如果你这样做,系统中任何程序崩溃时,系统都不会再通知你。如果你想问问我的看法的话,我会说,这不是一件坏事,除非你愿意填写错误报告。如果你不想填写错误报告,那么这些错误通知存不存在都不会有什么区别。 + +要禁止Apport,并且彻底地摆脱Ubuntu系统中的程序崩溃报告,打开一个终端,输入以下命令: + gksu gedit /etc/default/apport + +这个文件的内容是: + + # set this to 0 to disable apport, or to 1 to enable it + # 设置0表示禁用Apportw,或者1开启它。译者注,下同。 + # you can temporarily override this with + # 你可以用下面的命令暂时关闭它: + # sudo service apport start force_start=1 + enabled=1 + +把**enabled=1**改为**enabled=0**.保存并关闭文件。完成之后你就再也不会看到弹窗报告错误了。很显然,如果我们想重新开启错误报告功能,只要再打开这个文件,把enabled设置为1就可以了。 + +#### 你的有效吗? #### +我希望这篇教程能够帮助你修复Ubuntu 14.04和Ubuntu 15.04中检测到系统程序错误的问题。如果这个小窍门帮你摆脱了这个烦人的问题,请让我知道。 + +-------------------------------------------------------------------------------- + +via: http://itsfoss.com/how-to-fix-system-program-problem-detected-ubuntu/ + +作者:[Abhishek][a] +译者:[XLCYun](https://github.com/XLCYun) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://itsfoss.com/author/abhishek/ +[1]:http://itsfoss.com/how-to-solve-sorry-ubuntu-12-04-has-experienced-an-internal-error/ +[2]:https://launchpad.net/ From e3f84e994da7cd2777280ce4c05d181301bc581d Mon Sep 17 00:00:00 2001 From: sevenot Date: Wed, 15 Jul 2015 01:15:47 +0800 Subject: [PATCH 600/965] sevenot translated --- ...n Of Atom Code Editor Has Been Released.md | 69 ------------------- ...n Of Atom Code Editor Has Been Released.md | 67 ++++++++++++++++++ 2 files changed, 67 insertions(+), 69 deletions(-) delete mode 100644 sources/share/20150629 First Stable Version Of Atom Code Editor Has Been Released.md create mode 100644 translated/share/20150629 First Stable Version Of Atom Code Editor Has Been Released.md diff --git a/sources/share/20150629 First Stable Version Of Atom Code Editor Has Been Released.md b/sources/share/20150629 First Stable Version Of Atom Code Editor Has Been Released.md deleted file mode 100644 index cfb84d8866..0000000000 --- a/sources/share/20150629 First Stable Version Of Atom Code Editor Has Been Released.md +++ /dev/null @@ -1,69 +0,0 @@ -sevenot translating -First Stable Version Of Atom Code Editor Has Been Released -================================================================================ -![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/06/Atom_stable.png) - -[Atom 1.0][1] is here. One of the [best open source code editors][2], [Atom][3] was available for public uses for almost a year but this is the first stable version of the most talked about text/code editor of recent times. Promoted as the “hackable text editor for 21st century”, this project of [Github][4] has already been downloaded 1.5 million times in the past and currently it has over 350,000 monthly active users. - -### It’s been a long time ### - -Rome was not built in a day and neither was Atom. Since it was first conceptualized in 2008 till the first stable release this month, it has taken several years and hundreds of contributors from across the globe, along with main developers working on Atom core. A quick look at the journey of Atom can be seen in the picture below: - -![Image credit: Atom](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/06/Atom_stable_timeline.jpeg) -Image credit: Atom - -### Back to the future ### - -This launch of Atom 1.0 is announced with a retro video showing the capabilities of the editor. Resembling to 70’s science fiction TV series, this will be the coolest video you are going to watch today :) - -注:youtube视频,不行做个链接吧 - - -### Features of Atom text editor ### - -- Cross-platform editing -- Built-in package manager -- Smart autocompletion -- File system browser -- Multiple panes -- Find and replace -- Highly customizable -- Modern look - -### Get Atom 1.0 ### - -Atom 1.0 is available for Linux, Windows and Mac OS X. For Debian based Linux distributions such as Ubuntu and Linux Mint, Atom provides .deb binaries. For Fedora, it also has .rpm binaries. You can also get the source code, if you like. The links below will let you download the latest stable version. - -- [Atom .deb][5] -- [Atom .rpm][6] -- [Atom Source Code][7] - -If you prefer, you can [install Atom in Ubuntu using PPA][8]. The PPA is not official though. - -注:下面是一个调查,可以发布的时候在文章内发布个调查 - -#### Are you excited about Atom? #### - -- Oh Yes! This is the best thing that could happen to programmers. -- Not really. I have seen better editors. -- Don't care. My default text editor does the job just fine. - --------------------------------------------------------------------------------- - -via: http://itsfoss.com/atom-stable-released/ - -作者:[Abhishek][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://itsfoss.com/author/abhishek/ -[1]:http://blog.atom.io/2015/06/25/atom-1-0.html -[2]:http://itsfoss.com/best-modern-open-source-code-editors-for-linux/ -[3]:https://atom.io/ -[4]:https://github.com/ -[5]:https://atom.io/download/deb -[6]:https://atom.io/download/rpm -[7]:https://github.com/atom/atom/blob/master/docs/build-instructions/linux.md -[8]:http://itsfoss.com/install-atom-text-editor-ubuntu-1404-linux-mint-17/ diff --git a/translated/share/20150629 First Stable Version Of Atom Code Editor Has Been Released.md b/translated/share/20150629 First Stable Version Of Atom Code Editor Has Been Released.md new file mode 100644 index 0000000000..0fc70b3f09 --- /dev/null +++ b/translated/share/20150629 First Stable Version Of Atom Code Editor Has Been Released.md @@ -0,0 +1,67 @@ +sevenot translated +原子(Atom)代码编辑器的第一个稳定版本发布 +================================================================================ +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/06/Atom_stable.png) + +[Atom 1.0][1]时代来临。作为[最好的开源代码编辑器]之一,Atom已公开使用快一年了,近段时间,第一个稳定版本的原子编辑器的发布却引起了广大用户的谈论。这个[Github][4]上的项目随着“为21世纪破解文本编辑器”活动的兴起,已近被下载了150万余次,积累35万活跃用户。 + +### 这是个漫长的过程 ### + +滴水穿石,非一日之功,Atom同样经历一个漫长的过程。从2008年首次提出概念到这个月第一个稳定版本的发布,主创人员和全球各地的贡献者,这几年来不断地致力于Atom核心的开发。我们通过下面这张图来了解一下Atom的发展过程: +![Image credit: Atom](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/06/Atom_stable_timeline.jpeg) +图片来源:Atom + +### 回到未来 ### + +Atom 1.0 通过一个流行视屏发布,展示了这款编辑器的潜能。这个视屏就像70年代的科幻连续剧一样,今天你将会看到一个极其酷炫的视屏: +注:youtube视频,不行做个链接吧 + + +### 原子编辑器特点 ### + +- 跨平台编辑 +- 实现包管理 +- 智能化、自动化 +- 文件系统视图 +- 多窗操作 +- 支持查找更换 +- 高度个性化 +- 界面更新颖 + +### Atom 1.0起来 ### + +Atom 1.0 支持Linux,Windows和Mac OS X。对于基于Debian的Linux,例如Ubuntu和Linux Mint,Atom提供了deb包。对于Fedora,同样有rpm包。如果你愿意,你可以下载源代码。通过下面的链接下载最新的版本。 + +- [Atom .deb][5] +- [Atom .rpm][6] +- [Atom Source Code][7] + +如果你愿意,你可以[通过PPA在Ubuntu上安装Atom]。PPA并不是官方解决方案。 + +注:下面是一个调查,可以发布的时候在文章内发布个调查 + +#### 你对Atom感兴趣吗? #### + +- 噢,当然!这是程序员的福音。 +- 我并不这样认为。我见过更好的编辑器。 +- 并不关心,我的默认编辑器就能胜任我的工作。 + +-------------------------------------------------------------------------------- + +via: http://itsfoss.com/atom-stable-released/ + +作者:[Abhishek][a] +译者:[sevenot](https://github.com/sevenot) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://itsfoss.com/author/abhishek/ +[1]:http://blog.atom.io/2015/06/25/atom-1-0.html +[2]:http://itsfoss.com/best-modern-open-source-code-editors-for-linux/ +[3]:https://atom.io/ +[4]:https://github.com/ +[5]:https://atom.io/download/deb +[6]:https://atom.io/download/rpm +[7]:https://github.com/atom/atom/blob/master/docs/build-instructions/linux.md +[8]:http://itsfoss.com/install-atom-text-editor-ubuntu-1404-linux-mint-17/ From 4e91ce3d51aa8d9a1a80072de38895e79ec85351 Mon Sep 17 00:00:00 2001 From: XLCYun Date: Wed, 15 Jul 2015 14:01:35 +0800 Subject: [PATCH 601/965] 20150121 Syncthing--A Private And Secure Toolsv translating by XLCYun 20150121 Syncthing--A Private And Secure Tool To Sync Files or Folders Between Computers.m --- ...d Secure Tool To Sync Files or Folders Between Computers.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150121 Syncthing--A Private And Secure Tool To Sync Files or Folders Between Computers.md b/sources/tech/20150121 Syncthing--A Private And Secure Tool To Sync Files or Folders Between Computers.md index 8a4aff4dfb..b3bca3d3db 100644 --- a/sources/tech/20150121 Syncthing--A Private And Secure Tool To Sync Files or Folders Between Computers.md +++ b/sources/tech/20150121 Syncthing--A Private And Secure Tool To Sync Files or Folders Between Computers.md @@ -1,3 +1,4 @@ +XLCYun translating. Syncthing: A Private, And Secure Tool To Sync Files/Folders Between Computers ================================================================================ ### Introduction ### @@ -204,4 +205,4 @@ via: http://www.unixmen.com/syncthing-private-secure-tool-sync-filesfolders-comp [a]:http://www.unixmen.com/author/sk/ [1]:https://github.com/syncthing/syncthing/releases/tag/v0.10.20 -[2]:http://syncthing.net/ \ No newline at end of file +[2]:http://syncthing.net/ From ddc0809059d70424748055b1a64f07721848dffa Mon Sep 17 00:00:00 2001 From: ZTinoZ Date: Wed, 15 Jul 2015 18:08:18 +0800 Subject: [PATCH 602/965] Translating by ZTinoZ --- ...709 7 command line tools for monitoring your Linux system.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/talk/20150709 7 command line tools for monitoring your Linux system.md b/sources/talk/20150709 7 command line tools for monitoring your Linux system.md index fcbbb04068..2362fefca4 100644 --- a/sources/talk/20150709 7 command line tools for monitoring your Linux system.md +++ b/sources/talk/20150709 7 command line tools for monitoring your Linux system.md @@ -24,7 +24,7 @@ FYI: 本文中的截图取自[Debian Linux 8.1][1] (“Jessie”),其运行在 ### htop ### -Htop is a more sophisticated alternative to top. Wikipedia: “Users often deploy htop in cases where Unix top does not provide enough information about the systems processes, for example when trying to find minor memory leaks in applications. Htop is also popularly used interactively as a system monitor. Compared to top, it provides a more convenient, cursor-controlled interface for sending signals to processes.” (For more detail go [here][6].) +相比top,它的替代品Htop则更为精致。维基百科是这样描述的:“Users often deploy htop in cases where Unix top does not provide enough information about the systems processes, for example when trying to find minor memory leaks in applications. Htop is also popularly used interactively as a system monitor. Compared to top, it provides a more convenient, cursor-controlled interface for sending signals to processes.” (For more detail go [here][6].) ![Image courtesy Mark Gibbs](http://images.techhive.com/images/article/2015/06/command-line-tools-monitoring-linux-system-5-100591903-orig.png) From 012acafff34f5009699308eabad221ecd5383fab Mon Sep 17 00:00:00 2001 From: sevenot Date: Wed, 15 Jul 2015 22:24:13 +0800 Subject: [PATCH 603/965] sevenot translating --- ...50410 10 Top Distributions in Demand to Get Your Dream Job.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/talk/20150410 10 Top Distributions in Demand to Get Your Dream Job.md b/sources/talk/20150410 10 Top Distributions in Demand to Get Your Dream Job.md index 0e3e611ea4..950da04b5d 100644 --- a/sources/talk/20150410 10 Top Distributions in Demand to Get Your Dream Job.md +++ b/sources/talk/20150410 10 Top Distributions in Demand to Get Your Dream Job.md @@ -1,3 +1,4 @@ +sevenot translating 10 Top Distributions in Demand to Get Your Dream Job ================================================================================ We are coming up with a series of five articles which aims at making you aware of the top skills which will help you in getting yours dream job. In this competitive world you can not rely on one skill. You need to have balanced set of skills. There is no measure of a balanced skill set except a few conventions and statistics which changes from time-to-time. From 9492384740d9abd2e9a1a2651417d0e94a183bbd Mon Sep 17 00:00:00 2001 From: sevenot Date: Wed, 15 Jul 2015 22:26:47 +0800 Subject: [PATCH 604/965] translating --- ...50410 10 Top Distributions in Demand to Get Your Dream Job.md | 1 - 1 file changed, 1 deletion(-) diff --git a/sources/talk/20150410 10 Top Distributions in Demand to Get Your Dream Job.md b/sources/talk/20150410 10 Top Distributions in Demand to Get Your Dream Job.md index 950da04b5d..0e3e611ea4 100644 --- a/sources/talk/20150410 10 Top Distributions in Demand to Get Your Dream Job.md +++ b/sources/talk/20150410 10 Top Distributions in Demand to Get Your Dream Job.md @@ -1,4 +1,3 @@ -sevenot translating 10 Top Distributions in Demand to Get Your Dream Job ================================================================================ We are coming up with a series of five articles which aims at making you aware of the top skills which will help you in getting yours dream job. In this competitive world you can not rely on one skill. You need to have balanced set of skills. There is no measure of a balanced skill set except a few conventions and statistics which changes from time-to-time. From 494d73c7810014837c8cc8b912e0ba3dbe5d634f Mon Sep 17 00:00:00 2001 From: sevenot Date: Wed, 15 Jul 2015 22:27:30 +0800 Subject: [PATCH 605/965] sevenot translating --- ...50410 10 Top Distributions in Demand to Get Your Dream Job.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/talk/20150410 10 Top Distributions in Demand to Get Your Dream Job.md b/sources/talk/20150410 10 Top Distributions in Demand to Get Your Dream Job.md index 0e3e611ea4..950da04b5d 100644 --- a/sources/talk/20150410 10 Top Distributions in Demand to Get Your Dream Job.md +++ b/sources/talk/20150410 10 Top Distributions in Demand to Get Your Dream Job.md @@ -1,3 +1,4 @@ +sevenot translating 10 Top Distributions in Demand to Get Your Dream Job ================================================================================ We are coming up with a series of five articles which aims at making you aware of the top skills which will help you in getting yours dream job. In this competitive world you can not rely on one skill. You need to have balanced set of skills. There is no measure of a balanced skill set except a few conventions and statistics which changes from time-to-time. From e358ecb179682213c346e99ab50e78e6124cbfb1 Mon Sep 17 00:00:00 2001 From: Chang Liu Date: Wed, 15 Jul 2015 22:32:17 +0800 Subject: [PATCH 606/965] [Translated]20160629 Backup with these DeDuplicating Encryption Tools.md --- ...th these DeDuplicating Encryption Tools.md | 160 ------------------ ...th these DeDuplicating Encryption Tools.md | 157 +++++++++++++++++ 2 files changed, 157 insertions(+), 160 deletions(-) delete mode 100644 sources/share/20150629 Backup with these DeDuplicating Encryption Tools.md create mode 100644 translated/share/20150629 Backup with these DeDuplicating Encryption Tools.md diff --git a/sources/share/20150629 Backup with these DeDuplicating Encryption Tools.md b/sources/share/20150629 Backup with these DeDuplicating Encryption Tools.md deleted file mode 100644 index ba4777996b..0000000000 --- a/sources/share/20150629 Backup with these DeDuplicating Encryption Tools.md +++ /dev/null @@ -1,160 +0,0 @@ -FSSlc Translating - -Backup with these DeDuplicating Encryption Tools -================================================================================ -Data is growing both in volume and value. It is becoming increasingly important to be able to back up and restore this information quickly and reliably. As society has adapted to technology and learned how to depend on computers and mobile devices, there are few that can deal with the reality of losing important data. Of firms that suffer the loss of data, 30% fold within a year, 70% cease trading within five years. This highlights the value of data. - -With data growing in volume, improving storage utilization is pretty important. In computing, data deduplication is a specialized data compression technique for eliminating duplicate copies of repeating data. This technique therefore improves storage utilization. - -Data is not only of interest to its creator. Governments, competitors, criminals, snoopers may be very keen to access your data. They might want to steal your data, extort money from you, or see what you are up to. Enryption is essential to protect your data. - -So the solution is a deduplicating encrypting backup software. - -Making file backups is an essential activity for all users, yet many users do not take adequate steps to protect their data. Whether a computer is being used in a corporate environment, or for private use, the machine's hard disk may fail without any warning signs. Alternatively, some data loss occurs as a result of human error. Without regular backups being made, data will inevitably be lost even if the services of a specialist recovery organisation are used. - -This article provides a quick roundup of 6 deduplicating encryption backup tools. - ----------- - -### Attic ### - -Attic is a deduplicating, encrypted, authenticated and compressed backup program written in Python. The main goal of Attic is to provide an efficient and secure way to backup data. The data deduplication technique used makes Attic suitable for daily backups since only the changes are stored. - -Features include: - -- Easy to use -- Space efficient storage variable block size deduplication is used to reduce the number of bytes stored by detecting redundant data -- Optional data encryption using 256-bit AES encryption. Data integrity and authenticity is verified using HMAC-SHA256 -- Off-site backups with SDSH -- Backups mountable as filesystems - -Website: [attic-backup.org][1] - ----------- - -### Borg ### - -Borg is a fork of Attic. It is a secure open source backup program designed for efficient data storage where only new or modified data is stored. - -The main goal of Borg is to provide an efficient and secure way to backup data. The data deduplication technique used makes Borg suitable for daily backups since only the changes are stored. The authenticated encryption makes it suitable for backups to not fully trusted targets. - -Borg is written in Python. Borg was created in May 2015 in response to the difficulty of getting new code or larger changes incorporated into Attic. - -Features include: - -- Easy to use -- Space efficient storage variable block size deduplication is used to reduce the number of bytes stored by detecting redundant data -- Optional data encryption using 256-bit AES encryption. Data integrity and authenticity is verified using HMAC-SHA256 -- Off-site backups with SDSH -- Backups mountable as filesystems - -Borg is not compatible with Attic. - -Website: [borgbackup.github.io/borgbackup][2] - ----------- - -### Obnam ### - -Obnam (OBligatory NAMe) is an easy to use, secure Python based backup program. Backups can be stored on local hard disks, or online via the SSH SFTP protocol. The backup server, if used, does not require any special software, on top of SSH. - -Obnam performs de-duplication by splitting up file data into chunks, and storing those individually. Generations are incremental backups; Every backup generation looks like a fresh snapshot, but is really incremental. Obnam is developed by Lars Wirzenius. - -Features include: - -- Easy to use -- Snapshot backups -- Data de-duplication, across files, and backup generations -- Encrypted backups, using GnuPG -- Backup multiple clients to a single repository -- Backup checkpoints (creates a "save" every 100MBs or so) -- Number of options for performance tuning including lru-size and/or upload-queue-size -- MD5 checksum algorithm for recognising duplicate data chunks -- Store backups to a server via SFTP -- Supports both push (i.e. Run on the client) and pull (i.e. Run on the server) methods - -Website: [obnam.org][3] - ----------- - -### Duplicity ### - -Duplicity incrementally backs up files and directory by encrypting tar-format volumes with GnuPG and uploading them to a remote (or local) file server. To transmit data it can use ssh/scp, local file access, rsync, ftp, and Amazon S3. - -Because duplicity uses librsync, the incremental archives are space efficient and only record the parts of files that have changed since the last backup. As the software uses GnuPG to encrypt and/or sign these archives, they will be safe from spying and/or modification by the server. - -Currently duplicity supports deleted files, full unix permissions, directories, symbolic links, fifos, etc. - -The duplicity package also includes the rdiffdir utility. Rdiffdir is an extension of librsync's rdiff to directories; it can be used to produce signatures and deltas of directories as well as regular files. - -Features include: - -- Simple to use -- Encrypted and signed archives (using GnuPG) -- Bandwidth and space efficient, using the rsync algorithm -- Standard file format -- Choice of remote protocol - - Local storage - - scp/ssh - - ftp - - rsync - - HSI - - WebDAV - - Amazon S3 - -Website: [duplicity.nongnu.org][4] - ----------- - -### ZBackup ### - -ZBackup is a versatile globally-deduplicating backup tool. - -Features include: - -- Parallel LZMA or LZO compression of the stored data. You can mix LZMA and LZO in a repository -- Built-in AES encryption of the stored data -- Possibility to delete old backup data -- Use of a 64-bit rolling hash, keeping the amount of soft collisions to zero -- Repository consists of immutable files. No existing files are ever modified -- Written in C++ only with only modest library dependencies -- Safe to use in production -- Possibility to exchange data between repos without recompression -- Uses a 64-bit modified Rabin-Karp rolling hash - -Website: [zbackup.org][5] - ----------- - -### bup ### - -bup is a program written in Python that backs things up. It's short for "backup". It provides an efficient way to backup a system based on the git packfile format, providing fast incremental saves and global deduplication (among and within files, including virtual machine images). - -bup is released under the LGPL version 2 license. - -Features include: - -- Global deduplication (among and within files, including virtual machine images) -- Uses a rolling checksum algorithm (similar to rsync) to split large files into chunks -- Uses the packfile format from git -- Writes packfiles directly offering fast incremental saves -- Can use "par2" redundancy to recover corrupted backups -- Mount your bup repository as a FUSE filesystem - -Website: [bup.github.io][6] - --------------------------------------------------------------------------------- - -via: http://www.linuxlinks.com/article/20150628060000607/BackupTools.html - -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[1]:https://attic-backup.org/ -[2]:https://borgbackup.github.io/borgbackup/ -[3]:http://obnam.org/ -[4]:http://duplicity.nongnu.org/ -[5]:http://zbackup.org/ -[6]:https://bup.github.io/ diff --git a/translated/share/20150629 Backup with these DeDuplicating Encryption Tools.md b/translated/share/20150629 Backup with these DeDuplicating Encryption Tools.md new file mode 100644 index 0000000000..366be7dd32 --- /dev/null +++ b/translated/share/20150629 Backup with these DeDuplicating Encryption Tools.md @@ -0,0 +1,157 @@ +使用去重加密工具来备份 +================================================================================ +在体积和价值方面,数据都在增长。快速而可靠地备份和恢复数据正变得越来越重要。社会已经适应了技术的广泛使用,并懂得了如何依靠电脑和移动设备,但很少有人能够处理丢失重要数据的现实。在遭受数据损失的公司中,30% 的公司将在一年内损失一半市值,70% 的公司将在五年内停止交易。这更加凸显了数据的价值。 + +随着数据在体积上的增长,提高存储利用率尤为重要。In Computing(注:这里不知如何翻译),数据去重是一种特别的数据压缩技术,因为它可以消除重复数据的拷贝,所以这个技术可以提高存储利用率。 + +数据并不仅仅只有其创造者感兴趣。政府、竞争者、犯罪分子、偷窥者可能都热衷于获取你的数据。他们或许想偷取你的数据,从你那里进行敲诈,或看你正在做什么。对于保护你的数据,加密是非常必要的。 + +所以,解决方法是我们需要一个去重加密备份软件。 + +对于所有的用户而言,做文件备份是一件非常必要的事,至今为止许多用户还没有采取足够的措施来保护他们的数据。一台电脑不论是工作在一个合作的环境中,还是供私人使用,机器的硬盘可能在没有任何警告的情况下挂掉。另外,有些数据丢失可能是人为的错误所引发的。如果没有做经常性的备份,数据也可能不可避免地失去掉,即使请了专业的数据恢复公司来帮忙。 + +这篇文章将对 6 个去重加密备份工具进行简要的介绍。 +---------- + +### Attic ### + +Attic 是一个可用于去重、加密,验证完整性的用 Python 写的压缩备份程序。Attic 的主要目标是提供一个高效且安全的方式来备份数据。Attic 使用的数据去重技术使得它适用于每日备份,因为只需存储改变的数据。 + +其特点有: + +- 易用 +- 可高效利用存储空间,通过检查冗余的数据,数据块大小的去重被用来减少存储所用的空间 +- 可选的数据加密,使用 256 位的 AES 加密算法。数据的完整性和可靠性使用 HMAC-SHA256 来检查 +- 使用 SDSH 来进行离线备份 +- 备份可作为文件系统来挂载 + +网站: [attic-backup.org][1] + +---------- + +### Borg ### + +Borg 是 Attic 的分支。它是一个安全的开源备份程序,被设计用来高效地存储那些新的或修改过的数据。 + +Borg 的主要目标是提供一个高效、安全的方式来存储数据。Borg 使用的数据去重技术使得它适用于每日备份,因为只需存储改变的数据。认证加密使得它适用于不完全可信的目标的存储。 + +Borg 由 Python 写成。Borg 于 2015 年 5 月被创造出来,为了回应让新的代码或重大的改变带入 Attic 的困难。 + +其特点包括: + +- 易用 +- 可高效利用存储空间,通过检查冗余的数据,数据块大小的去重被用来减少存储所用的空间 +- 可选的数据加密,使用 256 位的 AES 加密算法。数据的完整性和可靠性使用 HMAC-SHA256 来检查 +- 使用 SDSH 来进行离线备份 +- 备份可作为文件系统来挂载 + +Borg 与 Attic 不兼容。 + +网站: [borgbackup.github.io/borgbackup][2] + +---------- + +### Obnam ### + +Obnam (OBligatory NAMe) 是一个易用、安全的基于 Python 的备份程序。备份可被存储在本地硬盘或通过 SSH SFTP 协议存储到网上。若使用了备份服务器,它并不需要任何特殊的软件,只需要使用 SSH 即可。 + +Obnam 通过将数据数据分成数据块,并单独存储它们来达到去重的目的,每次通过增量备份来生成备份,每次备份的生成就像是一次新的快照,但事实上是真正的增量备份。Obnam 由 Lars Wirzenius 开发。 + +其特点有: + +- 易用 +- 快照备份 +- 数据去重,跨文件,生成备份 +- 可使用 GnuPG 来加密备份 +- 向一个单独的仓库中备份多个客户端的数据 +- 备份检查点 (创建一个保存点,以每 100MB 或其他容量) +- 包含多个选项来调整性能,包括调整 lru-size 或 upload-queue-size +- 支持 MD5 校验和算法来识别重复的数据块 +- 通过 SFTP 将备份存储到一个服务器上 +- 同时支持 push(即在客户端上运行) 和 pull(即在服务器上运行) + +网站: [obnam.org][3] + +---------- + +### Duplicity ### + +Duplicity 持续地以 tar 文件格式备份文件和目录,并使用 GnuPG 来进行加密,同时将它们上传到远程(或本地)的文件服务器上。它可以使用 ssh/scp, 本地文件获取, rsync, ftp, 和 Amazon S3 等来传递数据。 + +因为 duplicity 使用了 librsync, 增加的存档高效地利用了存储空间,且只记录自从上次备份依赖改变的那部分文件。由于该软件使用 GnuPG 来机密或对这些归档文件进行进行签名,这使得它们免于服务器的监视或修改。 + +当前 duplicity 支持备份删除的文件,全部的 unix 权限,目录,符号链接, fifo 等。 + +duplicity 软件包还包含有 rdiffdir 工具。 Rdiffdir 是 librsync 的 rdiff 针对目录的扩展。它可以用来生成对目录的签名和差异,对普通文件也有效。 + +其特点有: + +- 使用简单 +- 对归档进行加密和签名(使用 GnuPG) +- 高效使用带宽和存储空间,使用 rsync 的算法 +- 标准的文件格式 +- 可选择多种远程协议 + - 本地存储 + - scp/ssh + - ftp + - rsync + - HSI + - WebDAV + - Amazon S3 + +网站: [duplicity.nongnu.org][4] + +---------- + +### ZBackup ### + +ZBackup 是一个通用的全局去重备份工具。 + +其特点包括: + +- 存储数据的并行 LZMA 或 LZO 压缩,在一个仓库中,你还可以混合使用 LZMA 和 LZO +- 内置对存储数据的 AES 加密 +- 可选择地删除旧的备份数据 +- 可以使用 64 位的滚动哈希算法,使得文件冲突的数量几乎为零 +- Repository consists of immutable files. No existing files are ever modified ==== +- 用 C++ 写成,只需少量的库文件依赖 +- 在生成环境中可以安全使用 +- 可以在不同仓库中进行数据交换而不必再进行压缩 +- 可以使用 64 位改进型 Rabin-Karp 滚动哈希算法 + +网站: [zbackup.org][5] + +---------- + +### bup ### + +bup 是一个用 Python 写的备份程序,其名称是 "backup" 的缩写。在 git packfile 文件的基础上, bup 提供了一个高效的方式来备份一个系统,提供快速的增量备份和全局去重(在文件中或文件里,甚至包括虚拟机镜像)。 + +bup 在 LGPL 版本 2 协议下发行。 + +其特点包括: + +- 全局去重 (在文件中或文件里,甚至包括虚拟机镜像) +- 使用一个滚动的校验和算法(类似于 rsync) 来将大文件分为多个数据块 +- 使用来自 git 的 packfile 格式 +- 直接写入 packfile 文件,以此提供快速的增量备份 +- 可以使用 "par2" 冗余来恢复冲突的备份 +- 可以作为一个 FUSE 文件系统来挂载你的 bup 仓库 + +网站: [bup.github.io][6] + +-------------------------------------------------------------------------------- + +via: http://www.linuxlinks.com/article/20150628060000607/BackupTools.html + +译者:[FSSlc](https://github.com/FSSlc) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[1]:https://attic-backup.org/ +[2]:https://borgbackup.github.io/borgbackup/ +[3]:http://obnam.org/ +[4]:http://duplicity.nongnu.org/ +[5]:http://zbackup.org/ +[6]:https://bup.github.io/ \ No newline at end of file From 48cf34b92daa46569df5b0bc0529b187ce17d253 Mon Sep 17 00:00:00 2001 From: ictlyh Date: Wed, 15 Jul 2015 22:43:04 +0800 Subject: [PATCH 607/965] [Translating] sources/tech/20150706 PHP Security.md --- sources/tech/20150706 PHP Security.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20150706 PHP Security.md b/sources/tech/20150706 PHP Security.md index b942069678..9b026884ec 100644 --- a/sources/tech/20150706 PHP Security.md +++ b/sources/tech/20150706 PHP Security.md @@ -1,3 +1,4 @@ +ictlyh Translating PHP Security ================================================================================ ![](http://www.codeproject.com/KB/PHP/363897/php_security.jpg) From be14e2db3ac92ec202fde03741990eafbd61a49b Mon Sep 17 00:00:00 2001 From: wxy Date: Wed, 15 Jul 2015 23:48:01 +0800 Subject: [PATCH 608/965] PUB:20150629 First Stable Version Of Atom Code Editor Has Been Released @sevenot --- ... Version Of Atom Code Editor Has Been Released.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) rename {translated/share => published}/20150629 First Stable Version Of Atom Code Editor Has Been Released.md (89%) diff --git a/translated/share/20150629 First Stable Version Of Atom Code Editor Has Been Released.md b/published/20150629 First Stable Version Of Atom Code Editor Has Been Released.md similarity index 89% rename from translated/share/20150629 First Stable Version Of Atom Code Editor Has Been Released.md rename to published/20150629 First Stable Version Of Atom Code Editor Has Been Released.md index 0fc70b3f09..a89520072a 100644 --- a/translated/share/20150629 First Stable Version Of Atom Code Editor Has Been Released.md +++ b/published/20150629 First Stable Version Of Atom Code Editor Has Been Released.md @@ -1,5 +1,4 @@ -sevenot translated -原子(Atom)代码编辑器的第一个稳定版本发布 +原子(Atom)代码编辑器的视频短片介绍 ================================================================================ ![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/06/Atom_stable.png) @@ -8,12 +7,15 @@ sevenot translated ### 这是个漫长的过程 ### 滴水穿石,非一日之功,Atom同样经历一个漫长的过程。从2008年首次提出概念到这个月第一个稳定版本的发布,主创人员和全球各地的贡献者,这几年来不断地致力于Atom核心的开发。我们通过下面这张图来了解一下Atom的发展过程: + ![Image credit: Atom](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/06/Atom_stable_timeline.jpeg) -图片来源:Atom + +*图片来源:Atom* ### 回到未来 ### -Atom 1.0 通过一个流行视屏发布,展示了这款编辑器的潜能。这个视屏就像70年代的科幻连续剧一样,今天你将会看到一个极其酷炫的视屏: +Atom 1.0 通过流行的视频发布方式,展示了这款编辑器的潜能。这个视屏就像70年代的科幻连续剧一样,今天你将会看到一个极其酷炫的视屏: + 注:youtube视频,不行做个链接吧 @@ -52,7 +54,7 @@ via: http://itsfoss.com/atom-stable-released/ 作者:[Abhishek][a] 译者:[sevenot](https://github.com/sevenot) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From d6d25315a4336481c3f8e78c9243e362c8c6a5f7 Mon Sep 17 00:00:00 2001 From: wxy Date: Thu, 16 Jul 2015 00:07:53 +0800 Subject: [PATCH 609/965] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=20PR?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @XLCYun ,你 PR 的这两个文件,都忘记保留 .md 扩展名了。 另外,可以稍微学习下 markdown 格式,请保留原文的 md 格式,比如,行首缩进的效果就完全不同了。 --- ...How To Fix System Program Problem Detected In Ubuntu 14.04.md} | 0 ...o manage Vim plugins => 20150713 How to manage Vim plugins.md} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename translated/tech/{20150713 How To Fix System Program Problem Detected In Ubuntu 14.04 => 20150713 How To Fix System Program Problem Detected In Ubuntu 14.04.md} (100%) rename translated/tech/{20150713 How to manage Vim plugins => 20150713 How to manage Vim plugins.md} (100%) diff --git a/translated/tech/20150713 How To Fix System Program Problem Detected In Ubuntu 14.04 b/translated/tech/20150713 How To Fix System Program Problem Detected In Ubuntu 14.04.md similarity index 100% rename from translated/tech/20150713 How To Fix System Program Problem Detected In Ubuntu 14.04 rename to translated/tech/20150713 How To Fix System Program Problem Detected In Ubuntu 14.04.md diff --git a/translated/tech/20150713 How to manage Vim plugins b/translated/tech/20150713 How to manage Vim plugins.md similarity index 100% rename from translated/tech/20150713 How to manage Vim plugins rename to translated/tech/20150713 How to manage Vim plugins.md From e8f4b3e7a864a40d22ba2bb14cbaf790011d910e Mon Sep 17 00:00:00 2001 From: wxy Date: Thu, 16 Jul 2015 00:42:50 +0800 Subject: [PATCH 610/965] PUB:20150709 Why is the ibdata1 file continuously growing in MySQL @wyangsun --- ...ata1 file continuously growing in MySQL.md | 114 ++++++++++++++++++ ...ata1 file continuously growing in MySQL.md | 114 ------------------ 2 files changed, 114 insertions(+), 114 deletions(-) create mode 100644 published/20150709 Why is the ibdata1 file continuously growing in MySQL.md delete mode 100644 translated/tech/20150709 Why is the ibdata1 file continuously growing in MySQL.md diff --git a/published/20150709 Why is the ibdata1 file continuously growing in MySQL.md b/published/20150709 Why is the ibdata1 file continuously growing in MySQL.md new file mode 100644 index 0000000000..af798b387a --- /dev/null +++ b/published/20150709 Why is the ibdata1 file continuously growing in MySQL.md @@ -0,0 +1,114 @@ +为什么 mysql 里的 ibdata1 文件不断的增长? +================================================================================ +![ibdata1 file](https://www.percona.com/blog/wp-content/uploads/2013/08/ibdata1-file.jpg) + +我们在 [Percona 支持栏目][1]经常收到关于 MySQL 的 ibdata1 文件的这个问题。 + +当监控服务器发送一个关于 MySQL 服务器存储的报警时,恐慌就开始了 —— 就是说磁盘快要满了。 + +一番调查后你意识到大多数地盘空间被 InnoDB 的共享表空间 ibdata1 使用。而你已经启用了 [innodb_file_per_table][2],所以问题是: + +### ibdata1存了什么? ### + +当你启用了 `innodb_file_per_table`,表被存储在他们自己的表空间里,但是共享表空间仍然在存储其它的 InnoDB 内部数据: + +- 数据字典,也就是 InnoDB 表的元数据 +- 变更缓冲区 +- 双写缓冲区 +- 撤销日志 + +其中的一些在 [Percona 服务器][3]上可以被配置来避免增长过大的。例如你可以通过 [innodb_ibuf_max_size][4] 设置最大变更缓冲区,或设置 [innodb_doublewrite_file][5] 来将双写缓冲区存储到一个分离的文件。 + +MySQL 5.6 版中你也可以创建外部的撤销表空间,所以它们可以放到自己的文件来替代存储到 ibdata1。可以看看这个[文档][6]。 + +### 什么引起 ibdata1 增长迅速? ### + +当 MySQL 出现问题通常我们需要执行的第一个命令是: + + SHOW ENGINE INNODB STATUS/G + +这将展示给我们一些很有价值的信息。我们从** TRANSACTION(事务)**部分开始检查,然后我们会发现这个: + + ---TRANSACTION 36E, ACTIVE 1256288 sec + MySQL thread id 42, OS thread handle 0x7f8baaccc700, query id 7900290 localhost root + show engine innodb status + Trx read view will not see trx with id >= 36F, sees < 36F + +这是一个最常见的原因,一个14天前创建的相当老的事务。这个状态是**活动的**,这意味着 InnoDB 已经创建了一个数据的快照,所以需要在**撤销**日志中维护旧页面,以保障数据库的一致性视图,直到事务开始。如果你的数据库有大量的写入任务,那就意味着存储了大量的撤销页。 + +如果你找不到任何长时间运行的事务,你也可以监控INNODB STATUS 中的其他的变量,“**History list length(历史记录列表长度)**”展示了一些等待清除操作。这种情况下问题经常发生,因为清除线程(或者老版本的主线程)不能像这些记录进来的速度一样快地处理撤销。 + +### 我怎么检查什么被存储到了 ibdata1 里了? ### + +很不幸,MySQL 不提供查看什么被存储到 ibdata1 共享表空间的信息,但是有两个工具将会很有帮助。第一个是马克·卡拉汉制作的一个修改版 innochecksum ,它发布在[这个漏洞报告][7]里。 + +它相当易于使用: + + # ./innochecksum /var/lib/mysql/ibdata1 + 0 bad checksum + 13 FIL_PAGE_INDEX + 19272 FIL_PAGE_UNDO_LOG + 230 FIL_PAGE_INODE + 1 FIL_PAGE_IBUF_FREE_LIST + 892 FIL_PAGE_TYPE_ALLOCATED + 2 FIL_PAGE_IBUF_BITMAP + 195 FIL_PAGE_TYPE_SYS + 1 FIL_PAGE_TYPE_TRX_SYS + 1 FIL_PAGE_TYPE_FSP_HDR + 1 FIL_PAGE_TYPE_XDES + 0 FIL_PAGE_TYPE_BLOB + 0 FIL_PAGE_TYPE_ZBLOB + 0 other + 3 max index_id + +全部的 20608 中有 19272 个撤销日志页。**这占用了表空间的 93%**。 + +第二个检查表空间内容的方式是杰里米·科尔制作的 [InnoDB Ruby 工具][8]。它是个检查 InnoDB 的内部结构的更先进的工具。例如我们可以使用 space-summary 参数来得到每个页面及其数据类型的列表。我们可以使用标准的 Unix 工具来统计**撤销日志**页的数量: + + # innodb_space -f /var/lib/mysql/ibdata1 space-summary | grep UNDO_LOG | wc -l + 19272 + +尽管这种特殊的情况下,innochedcksum 更快更容易使用,但是我推荐你使用杰里米的工具去了解更多的 InnoDB 内部的数据分布及其内部结构。 + +好,现在我们知道问题所在了。下一个问题: + +### 我该怎么解决问题? ### + +这个问题的答案很简单。如果你还能提交语句,就做吧。如果不能的话,你必须要杀掉线程开始回滚过程。那将停止 ibdata1 的增长,但是很显然,你的软件会出现漏洞,有些人会遇到错误。现在你知道如何去鉴定问题所在,你需要使用你自己的调试工具或普通的查询日志来找出谁或者什么引起的问题。 + +如果问题发生在清除线程,解决方法通常是升级到新版本,新版中使用一个独立的清除线程替代主线程。更多信息查看该[文档][9] + +### 有什么方法回收已使用的空间么? ### + +没有,目前还没有一个容易并且快速的方法。InnoDB 表空间从不收缩...参见[10 年之久的漏洞报告][10],最新更新自詹姆斯·戴(谢谢): + +当你删除一些行,这个页被标为已删除稍后重用,但是这个空间从不会被回收。唯一的方法是使用新的 ibdata1 启动数据库。要做这个你应该需要使用 mysqldump 做一个逻辑全备份,然后停止 MySQL 并删除所有数据库、ib_logfile*、ibdata1* 文件。当你再启动 MySQL 的时候将会创建一个新的共享表空间。然后恢复逻辑备份。 + +### 总结 ### + +当 ibdata1 文件增长太快,通常是 MySQL 里长时间运行的被遗忘的事务引起的。尝试去解决问题越快越好(提交或者杀死事务),因为不经过痛苦缓慢的 mysqldump 过程,你就不能回收浪费的磁盘空间。 + +也是非常推荐监控数据库以避免这些问题。我们的 [MySQL 监控插件][11]包括一个 Nagios 脚本,如果发现了一个太老的运行事务它可以提醒你。 + +-------------------------------------------------------------------------------- + +via: https://www.percona.com/blog/2013/08/20/why-is-the-ibdata1-file-continuously-growing-in-mysql/ + +作者:[Miguel Angel Nieto][a] +译者:[wyangsun](https://github.com/wyangsun) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://www.percona.com/blog/author/miguelangelnieto/ +[1]:https://www.percona.com/products/mysql-support +[2]:http://dev.mysql.com/doc/refman/5.5/en/innodb-parameters.html#sysvar_innodb_file_per_table +[3]:https://www.percona.com/software/percona-server +[4]:https://www.percona.com/doc/percona-server/5.5/scalability/innodb_insert_buffer.html#innodb_ibuf_max_size +[5]:https://www.percona.com/doc/percona-server/5.5/performance/innodb_doublewrite_path.html?id=percona-server:features:percona_innodb_doublewrite_path#innodb_doublewrite_file +[6]:http://dev.mysql.com/doc/refman/5.6/en/innodb-performance.html#innodb-undo-tablespace +[7]:http://bugs.mysql.com/bug.php?id=57611 +[8]:https://github.com/jeremycole/innodb_ruby +[9]:http://dev.mysql.com/doc/innodb/1.1/en/innodb-improved-purge-scheduling.html +[10]:http://bugs.mysql.com/bug.php?id=1341 +[11]:https://www.percona.com/software/percona-monitoring-plugins diff --git a/translated/tech/20150709 Why is the ibdata1 file continuously growing in MySQL.md b/translated/tech/20150709 Why is the ibdata1 file continuously growing in MySQL.md deleted file mode 100644 index 2632f3f173..0000000000 --- a/translated/tech/20150709 Why is the ibdata1 file continuously growing in MySQL.md +++ /dev/null @@ -1,114 +0,0 @@ -为什么mysql里的ibdata1文件不断的增长? -================================================================================ -![ibdata1 file](https://www.percona.com/blog/wp-content/uploads/2013/08/ibdata1-file.jpg) - -我们在[Percona支持][1]经常收到关于MySQL的ibdata1文件的这个问题。 - -当监控服务器发送一个关于MySQL服务器存储的报警恐慌就开始了 - 就是说磁盘快要满了。 - -一番调查后你意识到大多数地盘空间被InnDB的共享表空间ibdata1使用。你已经启用了[innodb_file_per_table][2],所以问题是: - -### ibdata1存了什么? ### - -当你启用了innodb_file_per_table,表被存储在他们自己的表空间里,但是共享表空间仍然在存储其他InnoDB的内部数据: - -- 数据字典也就是InnoDB表的元数据 -- 交换缓冲区 -- 双写缓冲区 -- 撤销日志 - -在[Percona服务器][3]上有一些是可以被配置来避免增长过大的。例如你可以通过[innodb_ibuf_max_size][4]设置最大交换缓冲区或设置[innodb_doublewrite_file][5]存储双写缓冲区到一个分离的文件。 - -MySQL 5.6版中你也可以创建额外的撤销表空间所以他们将会有他们自己的文件来替代存储到ibdata1。照着[文档链接][6]检查。 - -### 什么引起ibdata1增长迅速? ### - -当MySQL出现问题通常我们需要执行的第一个命令是: - - SHOW ENGINE INNODB STATUSG(这里我觉得应该是STATUS/G) - -这将展示给我们一些很有价值的信息。我们开始检查**事务**部分,然后我们会发现这个: - - ---TRANSACTION 36E, ACTIVE 1256288 sec - MySQL thread id 42, OS thread handle 0x7f8baaccc700, query id 7900290 localhost root - show engine innodb status - Trx read view will not see trx with id >= 36F, sees < 36F - -这是一个最常见的原因,一个14天前创建的相当老的老事务。这个状态是**活动的**,这意味着InnoDB已经创建了一个快照数据,所以需要在**撤销**日志中维护旧页面,以保障数据库的一致性视图,直到事务开始。如果你的数据库是写负载大,那就意味着大量的撤销页已经被存储了。 - -如果你找不到任何长时间运行的事务,你也可以监控INNODB状态中的其他的变量,“**历史记录列表长度**”展示了一些等待清除操作。这种情况下问题经常发生,因为清除线程(或者老版本的主线程)不能以这些记录进来的速度处理撤销。 - -### 我怎么检查什么被存储到了ibdata1里了? ### - -很不幸MySQL不提供什么被存储到ibdata1共享表空间的信息但是有两个工具将会很有帮助。第一个是马克·卡拉汉制作的一个修订版本的innochecksum并且发布在[这个漏洞报告][7]。 - -它相当易于使用: - - # ./innochecksum /var/lib/mysql/ibdata1 - 0 bad checksum - 13 FIL_PAGE_INDEX - 19272 FIL_PAGE_UNDO_LOG - 230 FIL_PAGE_INODE - 1 FIL_PAGE_IBUF_FREE_LIST - 892 FIL_PAGE_TYPE_ALLOCATED - 2 FIL_PAGE_IBUF_BITMAP - 195 FIL_PAGE_TYPE_SYS - 1 FIL_PAGE_TYPE_TRX_SYS - 1 FIL_PAGE_TYPE_FSP_HDR - 1 FIL_PAGE_TYPE_XDES - 0 FIL_PAGE_TYPE_BLOB - 0 FIL_PAGE_TYPE_ZBLOB - 0 other - 3 max index_id - -全部的20608中有19272个撤销日志页。**这是表空间的93%**。 - -第二个检查表空间内容的方式是杰里米科尔制作的[InnoDB Ruby工具][8]。它是个更先进的工具来检查InnoDB的内部结构。例如我们可以使用space-summary参数来得到每个页面及其数据类型的列表。我们可以使用标准的Unix工具**撤销日志**页的数量: - - # innodb_space -f /var/lib/mysql/ibdata1 space-summary | grep UNDO_LOG | wc -l - 19272 - -尽管这种特殊的情况innochedcksum更快更容易使用,我推荐你使用杰里米的工具去学习更多的InnoDB内部数据分布和内部结构。 - -好,现在我们知道问题所在。下一个问题: - -### 我能怎么解决问题? ### - -这个问题的答案很简单。如果你还能提交语句,就做吧。如果不能你必须要杀掉进程开始回滚进程。那将停止ibdata1的增长但是很清楚你的软件有一个漏洞或者出了一些错误。现在你知道如何去鉴定问题所在,你需要使用你自己的调试工具或普通语句日志找出谁或者什么引起的问题。 - -如果问题发生在清除线程,解决方法通常是升级到新版本,新版中使用一个独立的清除线程替代主线程。更多信息查看[文档链接][9] - -### 有什么方法恢复已使用的空间么? ### - -没有,目前不可能有一个容易并且快速的方法。InnoDB表空间从不收缩...见[10年老漏洞报告][10]最新更新自詹姆斯(谢谢): - -当你删除一些行,这个页被标为已删除稍后重用,但是这个空间从不会被恢复。只有一种方式来启动数据库使用新的ibdata1。做这个你应该需要使用mysqldump做一个逻辑全备份。然后停止MySQL并删除所有数据库、ib_logfile*、ibdata1*文件。当你再启动MySQL的时候将会创建一个新的共享表空间。然后恢复逻辑仓库。 - -### 总结 ### - -当ibdata1文件增长太快,通常是MySQL里长时间运行的被遗忘的事务引起的。尝试去解决问题越快越好(提交或者杀死事务)因为没有痛苦缓慢的mysqldump执行你不能恢复浪费的磁盘空间。 - -监控数据库避免这些问题也是非常推荐的。我们的[MySQL监控插件][11]包括一个Nagios脚本,如果发现了一个太老的运行事务它可以提醒你。 - --------------------------------------------------------------------------------- - -via: https://www.percona.com/blog/2013/08/20/why-is-the-ibdata1-file-continuously-growing-in-mysql/ - -作者:[Miguel Angel Nieto][a] -译者:[wyangsun](https://github.com/wyangsun) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://www.percona.com/blog/author/miguelangelnieto/ -[1]:https://www.percona.com/products/mysql-support -[2]:http://dev.mysql.com/doc/refman/5.5/en/innodb-parameters.html#sysvar_innodb_file_per_table -[3]:https://www.percona.com/software/percona-server -[4]:https://www.percona.com/doc/percona-server/5.5/scalability/innodb_insert_buffer.html#innodb_ibuf_max_size -[5]:https://www.percona.com/doc/percona-server/5.5/performance/innodb_doublewrite_path.html?id=percona-server:features:percona_innodb_doublewrite_path#innodb_doublewrite_file -[6]:http://dev.mysql.com/doc/refman/5.6/en/innodb-performance.html#innodb-undo-tablespace -[7]:http://bugs.mysql.com/bug.php?id=57611 -[8]:https://github.com/jeremycole/innodb_ruby -[9]:http://dev.mysql.com/doc/innodb/1.1/en/innodb-improved-purge-scheduling.html -[10]:http://bugs.mysql.com/bug.php?id=1341 -[11]:https://www.percona.com/software/percona-monitoring-plugins From ff411e545faf01da29a8c0e802500dd5850005b6 Mon Sep 17 00:00:00 2001 From: wxy Date: Thu, 16 Jul 2015 00:49:30 +0800 Subject: [PATCH 611/965] PUB:20150709 Linux FAQs with Answers--How to open multiple tabs in a GNOME terminal on Ubuntu 15.04 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @KevinSJ 你自己的 ID 都写错了。。 --- ...n multiple tabs in a GNOME terminal on Ubuntu 15.04.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) rename {translated/tech => published}/20150709 Linux FAQs with Answers--How to open multiple tabs in a GNOME terminal on Ubuntu 15.04.md (87%) diff --git a/translated/tech/20150709 Linux FAQs with Answers--How to open multiple tabs in a GNOME terminal on Ubuntu 15.04.md b/published/20150709 Linux FAQs with Answers--How to open multiple tabs in a GNOME terminal on Ubuntu 15.04.md similarity index 87% rename from translated/tech/20150709 Linux FAQs with Answers--How to open multiple tabs in a GNOME terminal on Ubuntu 15.04.md rename to published/20150709 Linux FAQs with Answers--How to open multiple tabs in a GNOME terminal on Ubuntu 15.04.md index 80b07097d0..8129221b81 100644 --- a/translated/tech/20150709 Linux FAQs with Answers--How to open multiple tabs in a GNOME terminal on Ubuntu 15.04.md +++ b/published/20150709 Linux FAQs with Answers--How to open multiple tabs in a GNOME terminal on Ubuntu 15.04.md @@ -1,8 +1,8 @@ -Linux 答疑--如何在 Ubuntu 15.04 的 GNOME 终端中开启多个标签 +Linux有问必答:如何在 Ubuntu 15.04 的 GNOME 终端中开启多个标签 ================================================================================ > **问**: 我以前可以在我的 Ubuntu 台式机中的 gnome-terminal 中开启多个标签。但升到 Ubuntu 15.04 后,我就无法再在 gnome-terminal 窗口中打开新标签了。要怎样做才能在 Ubuntu 15.04 的 gnome-terminal 中打开标签呢? -在 Ubuntu 14.10 或之前的版本中,gnome-terminal 允许你在终端窗口中开启一个新标签或一个终端窗口。但从 Ubuntu 15.04开始,gnome-terminal 移除了“新标签”选项。这实际上并不是一个 bug,而是一个合并新标签和新窗口的举措。GNOME 3.12 引入了 [单独的“开启终端”选项][1]。开启新终端标签的功能从终端菜单移动到了首选项中。 +在 Ubuntu 14.10 或之前的版本中,gnome-terminal 允许你在终端窗口中开启一个新标签或一个终端窗口。但从 Ubuntu 15.04开始,gnome-terminal 移除了“新标签”选项。这实际上并不是一个 bug,而是一个合并新标签和新窗口的举措。GNOME 3.12 引入了[单独的“开启终端”选项][1]。开启新终端标签的功能从终端菜单移动到了首选项中。 ![](https://farm1.staticflickr.com/562/19286510971_f0abe3e7fb_b.jpg) @@ -29,8 +29,8 @@ Linux 答疑--如何在 Ubuntu 15.04 的 GNOME 终端中开启多个标签 via: http://ask.xmodulo.com/open-multiple-tabs-gnome-terminal-ubuntu.html 作者:[Dan Nanni][a] -译者:[KevSJ](https://github.com/KevSJ) -校对:[校对者ID](https://github.com/校对者ID) +译者:[KevinSJ](https://github.com/KevinSJ) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 681c0534c22a4218d4042c200900a80ac5ab5648 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=AE=A6=E6=88=90?= Date: Thu, 16 Jul 2015 03:58:03 +0800 Subject: [PATCH 612/965] Update RHCSA Series--Part 01--Reviewing Essential Commands and System Documentation.md --- ...ntial Commands and System Documentation.md | 28 ++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/sources/tech/RHCSA Series/RHCSA Series--Part 01--Reviewing Essential Commands and System Documentation.md b/sources/tech/RHCSA Series/RHCSA Series--Part 01--Reviewing Essential Commands and System Documentation.md index 4bb5948d5d..8cccc33f08 100644 --- a/sources/tech/RHCSA Series/RHCSA Series--Part 01--Reviewing Essential Commands and System Documentation.md +++ b/sources/tech/RHCSA Series/RHCSA Series--Part 01--Reviewing Essential Commands and System Documentation.md @@ -258,39 +258,41 @@ When using cut based on fields, the default field separator is a tab, but a diff ![Extract Text From a File in Linux](http://www.tecmint.com/wp-content/uploads/2015/02/Extract-Text-from-a-file.png) -Extract Text From a File in Linux +从文件中提取文本 -Note that the output of the two examples above was truncated for brevity. -**Reformatting files with fmt command** +注意,上方的两个输出的结果是十分简洁的。 -fmt is used to “clean up” files with a great amount of content or lines, or with varying degrees of indentation. The new paragraph formatting defaults to no more than 75 characters wide. You can change this with the -w (width) option, which set the line length to the specified number of characters. +**使用fmt命令重新格式化文件** -For example, let’s see what happens when we use fmt to display the /etc/passwd file setting the width of each line to 100 characters. Once again, output has been truncated for brevity. +fmt 被用于去“清理”有大量内容或行的文件,或者有很多缩进的文件.新的锻炼格式每行不会超过75个字符款,你能改变这个设定通过 -w(width 宽度)参数,它可以设置行宽为一个特定的数值 + +举个例子,让我们看看当我们用fmt显示定宽为100个字符的时候的文件/etc/passwd 时会发生什么.再来一次,输出值变得更加简洁. # fmt -w100 /etc/passwd ![File Reformatting in Linux](http://www.tecmint.com/wp-content/uploads/2015/02/File-Reformatting-in-Linux-with-fmt-command.png) -File Reformatting in Linux +Linux文件重新格式化 -**Formatting content for printing with pr command** +**使用pr命令格式化打印内容** -pr paginates and displays in columns one or more files for printing. In other words, pr formats a file to make it look better when printed. For example, the following command: +pr 分页并且在列中展示一个或多个用于打印的文件. 换句话说,使用pr格式化一个文件使他打印出来时看起来更好.举个例子,下面这个命令 # ls -a /etc | pr -n --columns=3 -h "Files in /etc" -Shows a listing of all the files found in /etc in a printer-friendly format (3 columns) with a custom header (indicated by the -h option), and numbered lines (-n). +以一个友好的排版方式(3列)输出/etc下的文件,自定义了页眉(通过 -h 选项实现),行号(-n) ![File Formatting in Linux](http://www.tecmint.com/wp-content/uploads/2015/02/File-Formatting-in-Linux-with-pr-command.png) -File Formatting in Linux +Linux的文件格式 -### Summary ### +### 总结 ### -In this article we have discussed how to enter and execute commands with the correct syntax in a shell prompt or terminal, and explained how to find, inspect, and use system documentation. As simple as it seems, it’s a large first step in your way to becoming a RHCSA. +在这篇文章中,我们已经讨论了如何在Shell或终端以正确的语法输入和执行命令,并解释如何找到,检查和使用系统文档。正如你看到的一样简单,这就是你成为RHCSA的第一大步 + +如果你想添加一些其他的你经常使用的能够有效帮你完成你的日常工作的基础命令,并为分享他们而感到自豪,请在下方留言.也欢迎提出问题.我们期待您的回复. -If you would like to add other commands that you use on a periodic basis and that have proven useful to fulfill your daily responsibilities, feel free to share them with the world by using the comment form below. Questions are also welcome. We look forward to hearing from you! -------------------------------------------------------------------------------- From 58eb11022f8131887dcc635bc4a36878fbc38f38 Mon Sep 17 00:00:00 2001 From: DeadFire Date: Thu, 16 Jul 2015 10:25:24 +0800 Subject: [PATCH 613/965] =?UTF-8?q?20150716-1=20=E9=80=89=E9=A2=98=20-=20G?= =?UTF-8?q?nome=20=E4=B8=93=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...t Right & Wrong - Page 1 - Introduction.md | 54 ++++++++++++++++ ...ht & Wrong - Page 2 - The GNOME Desktop.md | 31 ++++++++++ ...t & Wrong - Page 3 - GNOME Applications.md | 61 +++++++++++++++++++ ...Right & Wrong - Page 4 - GNOME Settings.md | 51 ++++++++++++++++ ...Get Right & Wrong - Page 5 - Conclusion.md | 39 ++++++++++++ 5 files changed, 236 insertions(+) create mode 100644 sources/tech/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 1 - Introduction.md create mode 100644 sources/tech/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 2 - The GNOME Desktop.md create mode 100644 sources/tech/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 3 - GNOME Applications.md create mode 100644 sources/tech/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 4 - GNOME Settings.md create mode 100644 sources/tech/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 5 - Conclusion.md diff --git a/sources/tech/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 1 - Introduction.md b/sources/tech/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 1 - Introduction.md new file mode 100644 index 0000000000..6efc7d1fa6 --- /dev/null +++ b/sources/tech/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 1 - Introduction.md @@ -0,0 +1,54 @@ +A Week With GNOME As My Linux Desktop: What They Get Right & Wrong - Page 1 - Introduction +================================================================================ +*Author's Note: If by some miracle you managed to click this article without reading the title then I want to re-iterate something... This is an editorial. These are my opinions. They are not representative of Phoronix, or Michael, these are my own thoughts.* + +Additionally, yes... This is quite possibly a flame-bait article. I hope the community is better than that, because I do want to start a discussion and give feedback to both the KDE and Gnome communities. For that reason when I point out, what I see as, a flaw I will try to be specific and direct so that any discussion can be equally specific and direct. For the record: The alternative title for this article was "Death By A Thousand [Paper Cuts][1]". + +Now, with that out of the way... Onto the article. + +![](http://www.phoronix.net/image.php?id=fedora-22-fan&image=fedora_22_good1_show&w=1920) + +When I sent the [Fedora 22 KDE Review][2] off to Michael I did it with a bit of a bad taste in my mouth. It wasn't because I didn't like KDE, or hadn't been enjoying Fedora, far from it. In fact, I started to transition my T450s over to Arch Linux but quickly decided against that, as I enjoyed the level of convenience that Fedora brings to me for many things. + +The reason I had a bad taste in my mouth was because the Fedora developers put a lot of time and effort into their "Workstation" product and I wasn't seeing any of it. I wasn't using Fedora the way the main developers had intended it to be used and therefore wasn't getting the "Fedora Experience." It felt like someone reviewing Ubuntu by using Kubuntu, using a Hackintosh to review OS X, or reviewing Gentoo by using Sabayon. A lot of readers in the forums bash on Michael for reviewing distributions in their default configurations-- myself included. While I still do believe that reviews should be done under 'real-world' configurations, I do see the value in reviewing something in the condition it was given to you-- for better or worse. + +It was with that attitude in mind that I decided to take a dip in the Gnome pool. + +I do, however, need to add one more disclaimer... I am looking at KDE and Gnome as they are packaged in Fedora. OpenSUSE, Kubuntu, Arch, etc, might all have different implementations of each desktop that will change whether my specific 'pain points' are relevant to your distribution. Furthermore, despite the title, this is going to be a VERY KDE heavy article. I called the article what I did because it was actually USING Gnome that made me realize how many "paper cuts" KDE actually has. + +### Login Screen ### + +![](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_login1_show&w=1920) + +I normally don't mind Distributions shipping distro-specific themes, because most of them make the desktop look nicer. I finally found my exception. + +First impression's count for a lot, right? Well, GDM definitely gets this one right. The login screen is incredibly clean with consistent design language through every single part of it. The use of common-language icons instead of text boxes helps in that regard. + +![](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_login2_show&w=1920) + +That is not to say that the Fedora 22 KDE login screen-- now SDDM rather than KDM-- looks 'bad' per say but its definitely more jarring. + +Where's the fault? The top bar. Look at the Gnome screenshot-- you select a user and you get a tiny little gear simple for selecting what session you want to log into. The design is clean, it gets out of your way, you could honestly miss it completely if you weren't paying attention. Now look at the blue KDE screenshot, the bar doesn't look it was even rendered using the same widgets, and its entire placement feels like an after thought of "Well shit, we need to throw this option somewhere..." + +The same can be said for the Reboot and Shutdown options in the top right. Why not just a power button that creates a drop down menu that has a drop down for Reboot, Shutdown, Suspend? Having the buttons be different colors than the background certainly makes them stick out and be noticeable... but I don't think in a good way. Again, they feel like an after thought. + +GDM is also far more useful from a practical standpoint, look again along the top row. The time is listed, there's a volume control so that if you are trying to be quiet you can mute all sounds before you even login, there's an accessibility button for things like high contrast, zooming, test to speech, etc, all available via simple toggle buttons. + +![](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_login3_show&w=1920) + +Swap it to upstream's Breeze theme and... suddenly most of my complaints are fixed. Common-language icons, everything is in the center of the screen, but the less important stuff is off to the sides. This creates a nice harmony between the top and bottom of the screen since they are equally empty. You still have a text box for the session switcher, but I can forgive that since the power buttons are now common language icons. Current time is available which is a nice touch, as is a battery life indicator. Sure gnome still has a few nice additions, such as the volume applet and the accessibility buttons, but Breeze is a step up from Fedora's KDE theme. + +Go to Windows (pre-Windows 8 & 10...) or OS X and you will see similar things – very clean, get-out-of-your-way lock screens and login screens that are devoid of text boxes or other widgets that distract the eye. It's a design that works and that is non-distracting. Fedora... Ship Breeze by default. VDG got the design of the Breeze theme right. Don't mess it up. + +-------------------------------------------------------------------------------- + +via: http://www.phoronix.com/scan.php?page=article&item=gnome-week-editorial&num=1 + +作者:Eric Griffith +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[1]:https://wiki.ubuntu.com/One%20Hundred%20Papercuts +[2]:http://www.phoronix.com/scan.php?page=article&item=fedora-22-kde&num=1 \ No newline at end of file diff --git a/sources/tech/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 2 - The GNOME Desktop.md b/sources/tech/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 2 - The GNOME Desktop.md new file mode 100644 index 0000000000..d01e77343d --- /dev/null +++ b/sources/tech/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 2 - The GNOME Desktop.md @@ -0,0 +1,31 @@ +A Week With GNOME As My Linux Desktop: What They Get Right & Wrong - Page 2 - The GNOME Desktop +================================================================================ +### The Desktop ### + +![](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_gdm_show&w=1920) + +I spent the first five days of my week logging into Gnome manually-- not turning on automatic login. On night of the fifth day I got annoyed with having to login by hand and so I went into the User Manager and turned on automatic login. The next time I logged in I got a prompt: "Your keychain was not unlocked. Please enter your password to unlock your keychain." That was when I realized something... Gnome had been automatically unlocking my keychain—my wallet in KDE speak-- every time I logged in via GDM. It was only when I bypassed GDM's login that Gnome had to step in and make me do it manually. + +Now, I am under the personal belief that if you enable automatic login then your key chain should be unlocked automatically as well-- otherwise what's the point? Either way you still have to type in your password and at least if you hit the GDM Login screen you have a chance to change your session if you want to. + +But, regardless of that, it was at that moment that I realized it was such a simple thing that made the desktop feel so much more like it was working WITH ME. When I log into KDE via SDDM? Before the splash screen is even finished loading there is a window popping up over top the splash animation-- thereby disrupting the splash screen-- prompting me to unlock my KDE wallet or GPG keyring. + +If a wallet doesn't exist already you get prompted to create a wallet-- why couldn't one have been created for me at user creation?-- and then get asked to pick between two encryption methods, where one is even implied as insecure (Blowfish), why are you letting me pick something that's insecure for my security? Author's Note: If you install the actual KDE spin and don't just install KDE after-the-fact then a wallet is created for you at user creation. Unfortunately it's not unlocked for you automatically, and it seems to use the older Blowfish method rather than the new, and more secure, GPG method. + +![](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_kgpg_show&w=1920) + +If you DO pick the secure one (GPG) then it tries to load an Gpg key... which I hope you had one created already because if you don't you get yelled at. How do you create one? Well, it doesn't offer to make one for you... nor It doesn't tell you... and if you do manage TO figure out that you are supposed to use KGpg to create the key then you get taken through several menus and prompts that are nothing but confusing to new users. Why are you asking me where the GPG binary is located? How on earth am I supposed to know? Can't you just use the most recent one if there's more than one? And if there IS only one then, I ask again, why are you prompting me? + +Why are you asking me what key size and encryption algorithm to use? You select 2048 and RSA/RSA by default, so why not just use those? If you want to have those options available then throw them under the "Expert mode" button that is right there. This isn't just about having configuration options available, its about needless things that get thrown in the user's face by default. This is going to be a theme for the rest of the article... KDE needs better sane defaults. Configuration is great, I love the configuration I get with KDE, but it needs to learn when to and when not to prompt. It also needs to learn that "Well its configurable" is no excuse for bad defaults. Defaults are what users see initially, bad defaults will lose users. + +Let's move on from the key chain issue though, because I think I made my point. + +-------------------------------------------------------------------------------- + +via: http://www.phoronix.com/scan.php?page=article&item=gnome-week-editorial&num=2 + +作者:Eric Griffith +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 \ No newline at end of file diff --git a/sources/tech/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 3 - GNOME Applications.md b/sources/tech/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 3 - GNOME Applications.md new file mode 100644 index 0000000000..bc48bb0b76 --- /dev/null +++ b/sources/tech/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 3 - GNOME Applications.md @@ -0,0 +1,61 @@ +A Week With GNOME As My Linux Desktop: What They Get Right & Wrong - Page 3 - GNOME Applications +================================================================================ +### Applications ### + +![](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_videos_show&w=1920) + +This is the one area where things are basically a wash. Each environment has a few applications that are really nice, and a few that are not so great. Once again though, Gnome gets the little things right in a way that KDE completely misses. None of KDE's applications are bad or broken, that's not what I'm saying. They function. But that's about it. To use an analogy: they passed the test, but they sure didn't get any where close to 100% on it. + +Gnome on left, KDE on right. Dragon performs perfectly fine, it has clearly marked buttons for playing a file, URL, or a disc, just as you can do under Gnome Videos... but Gnome takes it one extra little step further in the name of convenience and user friendliness: they show all the videos detected under your system by default, without you having to do anything. KDE has Baloo-- just as they had Nepomuk before that-- why not use them? They've got a list video files that are freely accessible... but don't make use of the feature. + +Moving on... Music Players. + +![](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_rhythmbox_show&w=1920) + +![](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_amarok_show&w=1920) + +Both of these applications, Rhythmbox on the left and Amarok on the right were opened up and then a screenshot was immediately taken, nothing was clicked, or altered. See the difference? Rhythmbox looks like a music player. It's direct, there's obvious ways to sort the results, it knows what is trying to be and what it's job is: to play music. + +Amarok feels like one of the tech demos, or library demos where someone puts every option and extension they possible can all inside one application in order to show them off-- it's never something that gets shipped as production, it's just there to show off bits and pieces. And that's exactly what Amarok feels like: its someone trying to show off every single possible cool thing they shove into a media player without ever stopping to think "Wait, what were trying to write again? An app to play music?" + +Just look at the default layout. What is front and center for the user? A visualizer and Wikipedia integration-- the largest and most prominent column on the page. What's the second largest? Playlist list. Third largest, aka smallest? The actual music listing. How on earth are these sane defaults for a core application? + +Software Managers! Something that has seen a lot of push in recent years and will likely only see a bigger push in the months to come. Unfortunately, it's another area where KDE was so close... and then fell on its face right at the finish line. + +![](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_software_show&w=1920) + +![](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_apper_show&w=1920) + +![](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_muon_show&w=1920) + +Gnome Software is probably my new favorite software center, minus one gripe which I will get to in a bit. Muon, I wanted to like you. I really did. But you are a design nightmare. When the VDG was drawing up plans for you (mockup below), you looked pretty slick. Good use of white space, clean design, nice category listing, your whole not-being-split-into-two-applications. + +![](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_muon1_show&w=1920) + +Then someone got around to coding you and doing your actual UI, and I can only guess they were drunk while they did it. + +Let's look at Gnome Software. What's smack dab in the middle? The application, its screenshots, its description, etc. What's smack dab in the middle of Muon? Gigantic waste of white space. Gnome Software also includes the lovely convenience feature of putting a "Launch" button right there in case you already have an application installed. Convenience and ease of use are important, people. Honestly, JUST having things in Muon be centered aligned would probably make things look better already. + +What's along the top edge of Gnome Software, like a tab listing? All Software, Installed, Updates. Clean language, direct, to the point. Muon? Well, we have "Discover", which works okay as far as language goes, and then we have Installed, and then nothing. Where's updates? + +Well.. the developers decided to split updates off into its own application, thus requiring you to open two applications to handle your software-- one to install it, and one to update it-- going against every Software Center paradigm that has ever existed since the Synaptic graphical package manager. + +I'm not going to show it in a screenshot just because I don't want to have to clean up my system afterwards, but if you go into Muon and start installing something the way it shows that is by adding a little tab to the bottom of your screen with the application's name. That tab doesn't go away when the application is done installing either, so if you're installing a lot of applications at a single time then you'll just slowly accumulate tabs along the bottom that you then have to go through and clean up manually, because if you don't then they grow off the screen and you have to swipe through them all to get to the most recent ones. Think: opening 50 tabs in Firefox. Major annoyance, major inconvenience. + +I did say I would bash on Gnome a bit, and I meant it. Muon does get one thing very right that Gnome Software doesn't. Under the settings bar Muon has an option for "Show Technical Packages" aka: compilers, software libraries, non-graphical applications, applications without AppData, etc. Gnome doesn't. If you want to install any of those you have to drop down to the terminal. I think that's wrong. I certainly understand wanting to push AppData but I think they pushed it too soon. What made me realize Gnome didn't have this setting was when I went to install PowerTop and couldn't get Gnome to display it-- no AppData, no "Show Technical Packages" setting. + +Doubly unfortunate is the fact that you can't "just use apper" if you're under KDE since... + +![](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_apperlocal_show&w=1920) + +Apper's support for installing local packages has been broken for since Fedora 19 or so, almost two years. I love the attention to detail and quality. + +-------------------------------------------------------------------------------- + +via: http://www.phoronix.com/scan.php?page=article&item=gnome-week-editorial&num=3 + +作者:Eric Griffith +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 \ No newline at end of file diff --git a/sources/tech/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 4 - GNOME Settings.md b/sources/tech/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 4 - GNOME Settings.md new file mode 100644 index 0000000000..2907544215 --- /dev/null +++ b/sources/tech/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 4 - GNOME Settings.md @@ -0,0 +1,51 @@ +A Week With GNOME As My Linux Desktop: What They Get Right & Wrong - Page 4 - GNOME Settings +================================================================================ +### Settings ### + +There are a few specific KDE Control modules that I am going to pick at, mostly because they are so laughable horrible compared to their gnome counter-part that its honestly pathetic. + +First one up? Printers. + +![](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_printers1_show&w=1920) + +Gnome is on the left, KDE is on the right. You know what the difference is between the printer applet on the left, and the one on the right? When I opened up Gnome Control Center and hit "Printers" the applet popped up and nothing happened. When I opened up KDE System Settings and hit "Printers" I got a password prompt. Before I was even allowed to LOOK at the printers I had to give up ROOT'S password. + +Let me just re-iterate that. In this, the days of PolicyKit and Logind, I am still being asked for Root's password for what should be a sudo operation. I didn't even SETUP root's password when I installed the system. I had to drop down to Konsole and run 'sudo passwd root' so that I could GIVE root a password so that I could go back into System Setting's printer applet and then give up root's password to even LOOK at what printers were available. Once I did that I got prompted for root's password AGAIN when I hit "Add Printer" then I got prompted for root's password AGAIN after I went through and selected a printer and driver. Three times I got asked for ROOT'S password just to add a printer to the system. + +When I added a printer under Gnome I didn't get prompted for my SUDO password until I hit "Unlock" in the printer applet. I got asked once, then I never got asked again. KDE, I am begging you... Adopt Gnome's "Unlock" methodology. Do not prompt for a password until you really need one. Furthermore, whatever library is out there that allows for KDE applications to bypass PolicyKit / Logind (if its available) and prompt directly for root... Bin that code. If this was a multi-user system I either have to give up root's password, or be there every second of every day in order to put it in any time a user might have to update, change, or add a new printer. Both options are completely unacceptable. + +One more thing... + +![](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_printers2_show&w=1920) + +![](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_printers3_show&w=1920) + +Question to the forums: What looks cleaner to you? I had this realization when I was writing this article: Gnome's applet makes it very clear where any additional printers are going to go, they set aside a column on the left to list them. Before I added a second printer to KDE, and it suddenly grew a left side column, I had this nightmare-image in my head of the applet just shoving another icon into the screen and them being listed out like preview images in a folder of pictures. I was pleasantly surprised to see that I was wrong but the fact that the applet just 'grew' another column that didn't exist before and drastically altered its presentation is not really 'good' either. It's a design that's confusing, shocking, and non-intuitive. + +Enough about printers though... Next KDE System Setting that is up for my public stoning? Multimedia, Aka Phonon. + +![](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_sound_show&w=1920) + +As always, Gnome's on the left, KDE is on the right. Let's just run through the Gnome setting first... The eyes go left to right, top to bottom, right? So let's do the same. First up: volume control slider. The blue hint against the empty bar with 100% clearly marked removes all confusion about which way is "volume up." Immediately after the slider is an easy On/Off toggle that functions a mute on/off. Points to Gnome for remembering what the volume was set to BEFORE I muted sound, and returning to that same level AFTER I press volume-up to un-mute. Kmixer, you amnesiac piece of crap, I wish I could say as much about you. + +Moving on! Tabbed options for Output, Input and Applications? With per application volume controls within easy reach? Gnome I love you more and more with every passing second. Balance options, sound profiles, and a clearly marked "Test Speakers" option. + +I'm not sure how this could have been implemented in a cleaner, more concise way. Yes, it's just a Gnome-ized Pavucontrol but I think that's the point. Pavucontrol got it mostly right to begin with, the Sound applet in Gnome Control Center just refines it slightly to make it even closer to perfect. + +Phonon, you're up. And let me start by saying: What the fsck am I looking at? -I- get that I am looking at the priority list for the audio devices on the system, but the way it is presented is a bit of a nightmare. Also where are the things the user probably cares about? A priority list is a great thing to have, it SHOULD be available, but it's something the user messes with once or twice and then never touches again. It's not important, or common, enough to warrant being front and center. Where's the volume slider? Where's per application controls? The things that users will be using more frequently? Well.. those are under Kmix, a separate program, with its own settings and configuration... not under the System Settings... which kind of makes System Settings a bit of a misnomer. And in that same vein, Let's hop over to network settings. + +![](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_network_show&w=1920) + +Presented above is the Gnome Network Settings. KDE's isn't included because of the reason I'm about to hit on. If you go to KDE's System Settings and hit any of the three options under the "Network" Section you get tons of options: Bluetooth settings, default username and password for Samba shares (Seriously, "Connectivity" only has 2 options: Username and password for SMB shares. How the fsck does THAT deserve the all-inclusive title "Connectivity"?), controls for Browser Identification (which only work for Konqueror...a dead project), proxy settings, etc... Where's my wifi settings? They aren't there. Where are they? Well, they are in the network applet's private settings... not under Network Settings... + +KDE, you're killing me. You have "System Settings" USE IT! + +-------------------------------------------------------------------------------- + +via: http://www.phoronix.com/scan.php?page=article&item=gnome-week-editorial&num=4 + +作者:Eric Griffith +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 \ No newline at end of file diff --git a/sources/tech/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 5 - Conclusion.md b/sources/tech/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 5 - Conclusion.md new file mode 100644 index 0000000000..eb38d859d6 --- /dev/null +++ b/sources/tech/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 5 - Conclusion.md @@ -0,0 +1,39 @@ +A Week With GNOME As My Linux Desktop: What They Get Right & Wrong - Page 5 - Conclusion +================================================================================ +### User Experience and Closing Thoughts ### + +When Gnome 2.x and KDE 4.x were going head to head.. I jumped between the two quite happily. Some things I loved, some things I hated, but over all they were both a pleasure to use. Then Gnome 3.x came around and all of the drama with Gnome Shell. I swore off Gnome and avoided it every chance I could. It wasn't user friendly, it was non-intuitive, it broke an establish paradigm in preparation for tablet's taking over the world... A future that, judging from the dropping sales of tablets, will never come. + +Eight releases of Gnome 3 later and the unimaginable happened. Gnome got user friendly. Gnome got intuitive. Is it perfect? Of course not. I still hate the paradigm it tries to push, I hate how it tries to force a work flow onto me, but both of those things can be gotten used to with time and patience. Once you have managed to look past Gnome Shell's alien appearance and you start interacting with it and the other parts of Gnome (Control Center especially) you see what Gnome has definitely gotten right: the little things. The attention to detail. + +People can adapt to new paradigms, people can adapt to new work flows-- the iPhone and iPad proved that-- but what will always bother them are the paper cuts. + +Which brings up an important distinction between KDE and Gnome. Gnome feels like a product. It feels like a singular experience. When you use it, it feels like it is complete and that everything you need is at your fingertips. It feel's like THE Linux desktop in the same way that Windows or OS X have THE desktop experience: what you need is there and it was all written by the same guys working on the same team towards the same goal. Hell, even an application prompting for sudo access feels like an intentional part of the desktop under Gnome, much the way that it is under Windows. In KDE it's just some random-looking window popup that any application could have created. It doesn't feel like a part of the system stopping and going "Hey! Something has requested administrative rights! Do you want to let it go through?" in an official capacity. + +KDE doesn't feel like cohesive experience. KDE doesn't feel like it has a direction its moving in, it doesn't feel like a full experience. KDE feels like its a bunch of pieces that are moving in a bunch of different directions, that just happen to have a shared toolkit beneath them. If that's what the developers are happy with, then fine, good for them, but if the developers still have the hope of offering the best experience possible then the little stuff needs to matter. The user experience and being intuitive needs to be at the forefront of every single application, there needs to be a vision of what KDE wants to offer -and- how it should look. + +Is there anything stopping me from using Gnome Disks under KDE? Rhythmbox? Evolution? Nope. Nope. Nope. But that misses the point. Gnome and KDE both market themselves as "Desktop Environments." They are supposed to be full -environments-, that means they all the pieces come and fit together, that you use that environment's tools because they are saying "We support everything you need to have a full desktop." Honestly? Only Gnome seems to fit the bill of being complete. KDE feel's half-finished when it comes to "coming together" part, let alone offering everything you need for a "full experience". There's no counterpart to Gnome Disks-- kpartitionmanager prompts for root. No "First Time User" run through, it just now got a user manager in Kubuntu. Hell, Gnome even provides a Maps, Notes, Calendar and Clock application. Do all of these applications matter 100%? No, of course not. But the fact that Gnome has them helps to push the idea that Gnome is a full and complete experience. + +My complaints about KDE are not impossible to fix, not by a long shot. But it requires people to care. It requires developers to take pride in their work beyond just function-- form counts for a whole hell of a lot. Don't take away the user's ability to configure things-- the lack of configuration is one of my biggest gripes with GNOME 3.x, but don't use "Well you can configure it however you want," as an excuse for not providing sane defaults. The defaults are what users are going to see, they are what the users are going to judge from the first moment they open your application. Make it a good impression. + +I know the KDE developers know design matters, that is WHY the Visual Design Group exists, but it feels like they aren't using the VDG to their fullest. And therein lies KDE's hamartia. It's not that KDE can't be complete, it's not that it can't come together and fix the downfalls, it just that they haven't. They aimed for the bulls eye... but they missed. + +And before anyone says it... Don't say "Patches are welcome." Because while I can happily submit patches for the individual annoyances more will just keep coming as developers keep on their marry way of doing things in non-intuitive ways. This isn't about Muon not being center-aligned. This isn't about Amarok having an ugly UI. This isn't about the volume and brightness pop-up notifiers taking up a large chunk of my screen real-estate every time I hit my hotkeys (seriously, someone shrink those things). + +This is about a mentality of apathy, this is about developers apparently not thinking things through when they make the UI for their applications. Everything the KDE Community does works fine. Amarok plays music. Dragon Player plays videos. Kwin / Qt & kdelibs is seemingly more power efficient than Mutter / gtk (according to my battery life times. Non-scientific testing). Those things are all well and good, and important.. but the presentation matters to. Arguably, the presentation matters the most because that is what user's see and interact with. + +To KDE application developers... Get the VDG involved. Make every single 'core' application get its design vetted and approved by the VDG, have a UI/UX expert from the VDG go through the usage patterns and usage flow of your application to make sure its intuitive. Hell, even just posting a mock up to the VDG forums and asking for feedback would probably get you some nice pointers and feedback for whatever application you're working on. You have this great resource there, now actually use them. + +I am not trying to sound ungrateful. I love KDE, I love the work and effort that volunteers put into giving Linux users a viable desktop, and an alternative to Gnome. And it is because I care that I write this article. Because I want to see KDE excel, I want to see it go further and farther than it has before. But doing that requires work on everyone's part, and it requires that people don't hold back criticism. It requires that people are honest about their interaction with the system and where it falls apart. If we can't give direct criticism, if we can't say "This sucks!" then it will never get better. + +Will I still use Gnome after this week? Probably not, no. Gnome still trying to force a work flow on me that I don't want to follow or abide by, I feel less productive when I'm using it because it doesn't follow my paradigm. For my friends though, when they ask me "What desktop environment should I use?" I'm probably going to recommend Gnome, especially if they are less technical users who want things to "just work." And that is probably the most damning assessment I could make in regards to the current state of KDE. + +-------------------------------------------------------------------------------- + +via: http://www.phoronix.com/scan.php?page=article&item=gnome-week-editorial&num=5 + +作者:Eric Griffith +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 \ No newline at end of file From e2a8a654b6fafe59ffdc60f50763e58e6113594e Mon Sep 17 00:00:00 2001 From: DeadFire Date: Thu, 16 Jul 2015 11:10:19 +0800 Subject: [PATCH 614/965] =?UTF-8?q?20150716-2=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../talk/20150716 Interview--Larry Wall.md | 125 ++++++++++++++++++ 1 file changed, 125 insertions(+) create mode 100644 sources/talk/20150716 Interview--Larry Wall.md diff --git a/sources/talk/20150716 Interview--Larry Wall.md b/sources/talk/20150716 Interview--Larry Wall.md new file mode 100644 index 0000000000..5d0b40d2ed --- /dev/null +++ b/sources/talk/20150716 Interview--Larry Wall.md @@ -0,0 +1,125 @@ +Interview: Larry Wall +================================================================================ +> Perl 6 has been 15 years in the making, and is now due to be released at the end of this year. We speak to its creator to find out what’s going on. + +Larry Wall is a fascinating man. He’s the creator of Perl, a programming language that’s widely regarded as the glue holding the internet together, and mocked by some as being a “write-only” language due to its density and liberal use of non-alphanumeric characters. Larry also has a background in linguistics, and is well known for delivering entertaining “State of the Onion” presentations about the future of Perl. + +At FOSDEM 2015 in Brussels, we caught up with Larry to ask him why Perl 6 has taken so long (Perl 5 was released in 1994), how difficult it is to manage a project when everyone has strong opinions and pulling in different directions, and how his background in linguistics influenced the design of Perl from the start. Get ready for some intriguing diversions… + +![](http://www.linuxvoice.com/wp-content/uploads/2015/07/wall1.jpg) + +**Linux Voice: You once had a plan to go and find an undocumented language somewhere in the world and create a written script for it, but you never had the opportunity to fulfil this plan. Is that something you’d like to go back and do now?** + +Larry Wall: You have to be kind of young to be able to carry that off! It’s actually a lot of hard work, and organisations that do these things don’t tend to take people in when they’re over a certain age. Partly this is down to health and vigour, but also because people are much better at picking up new languages when they’re younger, and you have to learn the language before making a script for it. + +I started trying to teach myself Japanese about 10 years ago, and I could speak it quite well, because of my phonology and phonetics training – but it’s very hard for me to understand what anybody says. So I can go to Japan and ask for directions, but I can’t really understand the answers! + +> “With Perl 6, we found some ways to make the computer more sure about what the user is talking about.” + +So usually learning a language well enough to develop a writing system, and to at least be conversational in the language, takes some period of years before you can get to the point where you can actually do literacy and start educating people on their own culture, as it were. And then you teach them to write about their own culture as well. + +Of course, if you have language helpers – and we were told not to call them “language informants”, or everyone would think we were working for the CIA! – if you have these people, you can get them to come in and help you learn the foreign language. They are not teachers but there are ways of eliciting things from someone who’s not a language teacher – they can still teach you how to speak. They can take a stick and point to it and say “that’s a stick”, and drop it and say “the stick falls”. Then you start writing things down and systematising things. + +The motivation that most people have, going out to these groups, is to translate the Bible into their languages. But that’s only one part of it; the other is also culture preservation. Missionaries get kind of a bad rep on that, because anthropologists think they should be left to sit their in their own culture. But somebody is probably going to change their culture anyway – it’s usually the army, or businesses coming in, like Coca Cola or the sewing machine people, or missionaries. And of those three, the missionaries are the least damaging, if they’re doing their job right. + +**LV: Many writing systems are based on existing scripts, and then you have invented ones like Greenlandic…** + +LW: The Cherokee invented their own just by copying letters, and they have no mapping much to what we think of letters, and it’s fairly arbitrary in that sense. It just has to represent how the people themselves think of the language, and sufficiently well to communicate. Often there will be variations on Western orthography, using characters from Latin where possible. Tonal languages have to mark the tones somehow, by accents or by numbers. + +As soon as you start leaning towards a phoenetic or phonological representation, then you also start to lose dialectical differences – or you have to write the dialectal differences. Or you have conventional spelling like we have in English, but pronunciation that doesn’t really match it. + +**LV: When you started working on Perl, what did you take from your background in linguistics that made you think: “this is really important in a programming language”?** + +LW: I thought a lot about how people use languages. In real languages, you have a system of nouns and verbs and adjectives, and you kind of know which words are which type. And in real natural languages, you have a lot of instances of shoving one word into a different slot. The linguistic theory I studied was called tagmemics, and it accounts for how this works in a natural language – that you could have something that you think of as a noun, but you can verb it, and people do that all time. + +You can pretty much shove anything in any slot, and you can communicate. One of my favourite examples is shoving an entire sentence in as an adjective. The sentence goes like this: “I don’t like your I-can-use-anything-as-an-adjective attitude”! + +So natural language is very flexible this way because you have a very intelligent listener – or at least, compared with a computer – who you can rely on to figure out what you must have meant, in case of ambiguity. Of course, in a computer language you have to manage the ambiguity much more closely. + +Arguably in Perl 1 through to 5 we didn’t manage it quite adequately enough. Sometimes the computer was confused when it really shouldn’t be. With Perl 6, we discovered some ways to make the computer more sure about what the user is talking about, even if the user is confused about whether something is really a string or a number. The computer knows the exact type of it. We figured out ways of having stronger typing internally but still have the allomorphic “you can use this as that” idea. + +![](http://www.linuxvoice.com/wp-content/uploads/2015/07/wall2.jpg) + +**LV: For a long time Perl was seen as the “glue” language of the internet, for fitting bits and pieces together. Do you see Perl 6 as a release to satisfy the needs of existing users, or as a way to bring in new people, and bring about a resurgence in the language?** + +LW: The initial intent was to make a better Perl for Perl programmers. But as we looked at the some of the inadequacies of Perl 5, it became apparent that if we fixed these inadequacies, Perl 6 would be more applicable, as I mentioned in my talk – like how J. R. R. Tolkien talked about applicability [see http://tinyurl.com/nhpr8g2]. + +The idea that “easy things should be easy and hard things should be possible” goes way back, to the boundary between Perl 2 and Perl 3. In Perl 2, we couldn’t handle binary data or embedded nulls – it was just C-style strings. I said then that “Perl is just a text processing language – you don’t need those things in a text processing language”. + +But it occurred to me at the time that there were a large number of problems that were mostly text, and had a little bit of binary data in them – network addresses and things like that. You use binary data to open the socket but then text to process it. So the applicability of the language more than doubled by making it possible to handle binary data. + +That began a trade-off about what things should be easy in a language. Nowadays we have a principle in Perl, and we stole the phrase Huffman coding for it, from the bit encoding system where you have different sizes for characters. Common characters are encoded in a fewer number of bits, and rarer characters are encoded in more bits. + +> “There had to be a very careful balancing act. There were just so many good ideas at the beginning.” + +We stole that idea as a general principle for Perl, for things that are commonly used, or when you have to type them very often – the common things need to be shorter or more succinct. Another bit of that, however, is that they’re allowed to be more irregular. In natural language, it’s actually the most commonly used verbs that tend to be the most irregular. + +And there’s a reason for that, because you need more differentiation of them. One of my favourite books is called The Search for the Perfect Language by Umberto Eco, and it’s not about computer languages; it’s about philosophical languages, and the whole idea that maybe some ancient language was the perfect language and we should get back to it. + +All of those languages make the mistake of thinking that similar things should always be encoded similarly. But that’s not how you communicate. If you have a bunch of barnyard animals, and they all have related names, and you say “Go out and kill the Blerfoo”, but you really wanted them to kill the Blerfee, you might get a cow killed when you want a chicken killed. + +So in realms like that it’s actually better to differentiate the words, for more redundancy in the communication channel. The common words need to have more of that differentiation. It’s all about communicating efficiently, and then there’s also this idea of self-clocking codes. If you look at a UPC label on a product – a barcode – that’s actually a self-clocking code where each pair of bars and spaces is always in a unit of seven columns wide. You rely on that – you know the width of the bars will always add up to that. So it’s self-clocking. + +There are other self-clocking codes used in electronics. In the old transmission serial protocols there were stop and start bits so you could keep things synced up. Natural languages also do this. For instance, in the writing of Japanese, they don’t use spaces. Because the way they write it, they will have a Kanji character from Chinese at the head of each phrase, and then the endings are written in the a syllabary. + +**LV: Hiragana, right?** + +LW: Yes, Hiragana. So naturally the head of each phrase really stands out with this system. Similarly, in ancient Greek, most of the verbs were declined or conjugated. So they had standard endings were sort-of a clocking mechanism. Spaces were optional in their writing system as well – it was a more modern invention to put the spaces in. + +So similarly in computer languages, there’s value in having a self-clocking code. We rely on this heavily in Perl, and even more heavily in Perl 6 than in previous releases. The idea that when you’re parsing an expression, you’re either expecting a term or an infix operator. When you’re expecting a term you might also get a prefix operator – that’s kind-of in the same expectation slot – and when you’re expecting an infix you might also get a postfix for the previous term. + +But it flips back and forth. And if the compiler actually knows which it is expecting, you can overload those a little bit, and Perl does this. So a slash when it’s expecting a term will introduce a regular expression, whereas a slash when you’re expecting an infix will be division. On the other hand, we don’t want to overload everything, because then you lose the self-clocking redundancy. + +Most of our best error messages, for syntax errors, actually come out of noticing that you have two terms in a row. And then we try to figure out why there are two terms in a row – “oh, you must have left a semicolon out on the previous line”. So we can produce much better error messages than the more ad-hoc parsers. + +![](http://www.linuxvoice.com/wp-content/uploads/2015/07/wall3.jpg) + +**LV: Why has Perl 6 taken fifteen years? It must be hard overseeing a language when everyone has different opinions about things, and there’s not always the right way to do things, and the wrong way.** + +LW: There had to be a very careful balancing act. There were just so many good ideas at the beginning – well, I don’t want to say they were all good ideas. There were so many pain points, like there were 361 RFCs [feature proposal documents] when I expected maybe 20. We had to sit back and actually look at them all, and ignore the proposed solutions, because they were all over the map and all had tunnel vision. Each one many have just changed one thing, but if we had done them all, it would’ve been a complete mess. + +So we had to re-rationalise based on how people were actually hurting when they tried to use Perl 5. We started to look at the unifying, underlying ideas. Many of these RFCs were based on the fact that we had an inadequate type system. By introducing a more coherent type system we could fix many problems in a sane fashion and a cohesive fashion. + +And we started noticing other ways how we could unify the featuresets and start reusing ideas in different areas. Not necessarily that they were the same thing underneath. We have a standard way of writing pairs – well, two ways in Perl! But the way of writing pairs with a colon could also be reused for radix notation, or for literal numbers in any base. It could also be used for various alternative forms of quoting. We say in Perl that it’s “strangely consistent”. + +> “People who made early implementations of Perl 6 came back to me, cap in hand, and said “We really need a language designer.”” + +Similar ideas pop up, and you say “I’m already familiar with how that syntax works, but I see it’s being used for something else”. So it took some unity of vision to find these unifications. People who had the various ideas and made early implementations of Perl 6 came back to me, cap-in-hand, and said “We really need a language designer. Could you be our benevolent dictator?” + +So I was the language designer, but I was almost explicitly told: “Stay out of the implementation! We saw what you did made out of Perl 5, and we don’t like it!” It was really funny because the innards of the new implementation started looking a whole lot like Perl 5 inside, and maybe that’s why some of the early implementations didn’t work well. + +Because we were still feeling our way into the whole design, the implementations made a lot of assumptions about what VM should do and shouldn’t do, so we ended up with something like an object oriented assembly language. That sort of problem was fairly pervasive at the beginning. Then the Pugs guys came along and said “Let’s use Haskell, because it makes you think very clearly about what you’re doing. Let’s use it to clarify our semantic model underneath.” + +So we nailed down some of those semantic models, but more importantly, we started building the test suite at that point, to be consistent with those semantic models. Then after that, the Parrot VM continued developing, and then another implementation, Niecza, came along and it was based on .NET. It was by a young fellow who was very smart and implemented a large subset of Perl 6, but he was kind of a loner, didn’t really figure out a way to get other people involved in his project. + +At the same time the Parrot project was getting too big for anyone to really manage it inside, and very difficult to refactor. At that point the fellows working on Rakudo decided that we probably needed to be on more platforms than just the Parrot VM. So they invented a portability layer called NQP which stands for “Not Quite Perl”. They ported it to first of all run on the JVM (Java Virtual Machine), and while they were doing that they were also secretly working on a new VM called MoarVM. That became public a little over a year ago. + +Both MoarVM and JVM run a pretty much equivalent set of regression tests – Parrot is kind-of trailing back in some areas. So that has been very good to flush out VM-specific assumptions, and we’re starting to think about NQP targeting other things. There was a Google Summer of Code project year to target NQP to JavaScript, and that might fit right in, because MoarVM also uses Node.js for much of its more mundane processing. + +We probably need to concentrate on MoarVM for the rest of this year, until we actually define 6.0, and then the rest will catch up. + +**LV: Last year in the UK, the government kicked off the Year of Code, an attempt to get young people interested in programming. There are lots of opinions about how this should be done – like whether you should teach low-level languages at the start, so that people really understand memory usage, or a high-level language. What’s your take on that?** + +LW: Up until now, the Python community has done a much better job of getting into the lower levels of education than we have. We’d like to do something in that space too, and that’s partly why we have the butterfly logo, because it’s going to be appealing to seven year old girls! + +But we do think that Perl 6 will be learnable as a first language. A number of people have surprised us by learning Perl 5 as their first language. And you know, there are a number of fairly powerful concepts even in Perl 5, like closures, lexical scoping, and features you generally get from functional programming. Even more so in Perl 6. + +> “Until now, the Python community has done a much better job of getting into the lower levels of education.” + +Part of the reason the Perl 6 has taken so long is that we have around 50 different principles we try to stick to, and in language design you’re end up juggling everything and saying “what’s really the most important principle here”? There has been a lot of discussion about a lot of different things. Sometimes we commit to a decision, work with it for a while, and then realise it wasn’t quite the right decision. + +We didn’t design or specify pretty much anything about concurrent programming until someone came along who was smart enough about it and knew what the different trade-offs were, and that’s Jonathan Worthington. He has blended together ideas from other languages like Go and C#, with concurrent primitives that compose well. Composability is important in the rest of the language. + +There are an awful lot of concurrent and parallel programming systems that don’t compose well – like threads and locks, and there have been lots of ways to do it poorly. So in one sense, it’s been worth waiting this extra time to see some of these languages like Go and C# develop really good high-level primitives – that’s sort of a contradiction in terms – that compose well. + +-------------------------------------------------------------------------------- + +via: http://www.linuxvoice.com/interview-larry-wall/ + +作者:[Mike Saunders][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.linuxvoice.com/author/mike/ \ No newline at end of file From 01b55db7ec79fceb2860aa6141afd586d68b7fb4 Mon Sep 17 00:00:00 2001 From: ictlyh Date: Thu, 16 Jul 2015 15:12:39 +0800 Subject: [PATCH 615/965] [Translated] sources/tech/20150706 PHP Security.md --- sources/tech/20150706 PHP Security.md | 360 ----------------------- translated/tech/20150706 PHP Security.md | 358 ++++++++++++++++++++++ 2 files changed, 358 insertions(+), 360 deletions(-) delete mode 100644 sources/tech/20150706 PHP Security.md create mode 100644 translated/tech/20150706 PHP Security.md diff --git a/sources/tech/20150706 PHP Security.md b/sources/tech/20150706 PHP Security.md deleted file mode 100644 index 9b026884ec..0000000000 --- a/sources/tech/20150706 PHP Security.md +++ /dev/null @@ -1,360 +0,0 @@ -ictlyh Translating -PHP Security -================================================================================ -![](http://www.codeproject.com/KB/PHP/363897/php_security.jpg) - -### Introduction ### - -When offering an Internet service, you must always keep security in mind as you develop your code. It may appear that most PHP scripts aren't sensitive to security concerns; this is mainly due to the large number of inexperienced programmers working in the language. However, there is no reason for you to have an inconsistent security policy based on a rough guess at your code's significance. The moment you put anything financially interesting on your server, it becomes likely that someone will try to casually hack it. Create a forum program or any sort of shopping cart, and the probability of attack rises to a dead certainty. - -### Background ### - -Here are a few general security guidelines for securing your web content: - -#### Don't trust forms #### - -Hacking forms is trivial. Yes, by using a silly JavaScript trick, you may be able to limit your form to allow only the numbers 1 through 5 in a rating field. The moment someone turns JavaScript off in their browser or posts custom form data, your client-side validation flies out the window. - -Users interact with your scripts primarily through form parameters, and therefore they're the biggest security risk. What's the lesson? Always validate the data that gets passed to any PHP script in the PHP script. In this article, we show you how to analyze and protect against cross-site scripting (XSS) attacks, which can hijack your user's credentials (and worse). You'll also see how to prevent the MySQL injection attacks that can taint or destroy your data. - -#### Don't trust users #### - -Assume that every piece of data your website gathers is laden with harmful code. Sanitize every piece, even if you're positive that nobody would ever try to attack your site. - -#### Turn off global variables #### - -The biggest security hole you can have is having the register_globals configuration parameter enabled. Mercifully, it's turned off by default in PHP 4.2 and later. If **register_globals** is on, then you can disable this feature by turning the register_globals variable to Off in your server's php.ini file : - - register_globals = Off - -Novice programmers view registered globals as a convenience, but they don't realize how dangerous this setting is. A server with global variables enabled automatically assigns global variables to any form parameters. For an idea of how this works and why this is dangerous, let's look at an example. - -Let's say that you have a script named process.php that enters form data into your user database. The original form looked like this: - - - -When running process.php, PHP with registered globals enabled places the value of this parameter into the $username variable. This saves some typing over accessing them through **$_POST['username']** or **$_GET['username']**. Unfortunately, this also leaves you open to security problems, because PHP sets a variable for any value sent to the script via a GET or POST parameter, and that is a big problem if you didn't explicitly initialize the variable and you don't want someone to manipulate it. - -Take the script below, for example—if the $authorized variable is true, it shows confidential data to the user. Under normal circumstances, the $authorized variable is set to true only if the user has been properly authenticated via the hypothetical authenticated_user() function. But if you have **register_globals** active, anyone could send a GET parameter such as authorized=1 to override this: - - - -The moral of the story is that you should pull form data from predefined server variables. All data passed on to your web page via a posted form is automatically stored in a large array called $_POST, and all GET data is stored in a large array called **$_GET**. File upload information is stored in a special array called $_FILES. In addition, there is a combined variable called $_REQUEST. - -To access the username field from a POST method form, use **$_POST['username']**. Use **$_GET['username']** if the username is in the URL. If you don't care where the value came from, use **$_REQUEST['username']**. - - - -$_REQUEST is a union of the $_GET, $_POST, and $_COOKIE arrays. If you have two or more values of the same parameter name, be careful of which one PHP uses. The default order is cookie, POST, then GET. - -#### Recommended Security Configuration Options #### - -There are several PHP configuration settings that affect security features. Here are the ones that should obviously be used for production servers: - -- **register_globals** set to off -- **safe_mode** set to off -- **error_reporting** set to off. This is visible error reporting that sends a message to the user's browser if something goes wrong. For production servers, use error logging instead. Development servers can enable error logging as long as they're behind a firewall. -- Disable these functions: system(), exec(), passthru(), shell_exec(), proc_open(), and popen(). -- **open_basedir** set for both the /tmp directory (so that session information can be stored) and the web root so that scripts cannot access files outside a selected area. -- **expose_php** set to off. This feature adds a PHP signature that includes the version number to the Apache headers. -- **allow_url_fopen** set to off. This isn't strictly necessary if you're careful about how you access files in your code—that is, you validate all input parameters. -- **allow_url_include** set to off. There's really no sane reason for anyone to want to access include files via HTTP. - -In general, if you find code that wants to use these features, you shouldn't trust it. Be especially careful of anything that wants to use a function such as system()—it's almost certainly flawed. - -With these settings now behind us, let's look at some specific attacks and the methods that will help you protect your server. - -### SQL Injection Attacks ### - -Because the queries that PHP passes to MySQL databases are written in the powerful SQL programming language, you run the risk of someone attempting an SQL injection attack by using MySQL in web query parameters. By inserting malicious SQL code fragments into form parameters, an attacker attempts to break into (or disable) your server. - -Let's say that you have a form parameter that you eventually place into a variable named $product, and you create some SQL like this: - - $sql = "select * from pinfo where product = '$product'"; - -If that parameter came straight from the form, use database-specific escapes with PHP's native functions, like this: - - $sql = 'Select * from pinfo where product = '"' - mysql_real_escape_string($product) . '"'; - -If you don't, someone might just decide to throw this fragment into the form parameter: - - 39'; DROP pinfo; SELECT 'FOO - -Then the result of $sql is: - - select product from pinfo where product = '39'; DROP pinfo; SELECT 'FOO' - -Because the semicolon is MySQL's statement delimiter, the database processes these three statements: - - select * from pinfo where product = '39' - DROP pinfo - SELECT 'FOO' - -Well, there goes your table. - -Note that this particular syntax won't actually work with PHP and MySQL, because the **mysql_query()** function allows just one statement to be processed per request. However, a subquery will still work. - -To prevent SQL injection attacks, do two things: - -- Always validate all parameters. For example, if something needs to be a number, make sure that it's a number. -- Always use the mysql_real_escape_string() function on data to escape any quotes or double quotes in your data. - -**Note: To automatically escape any form data, you can turn on Magic Quotes.** - -Some MySQL damage can be avoided by restricting your MySQL user privileges. Any MySQL account can be restricted to only do certain kinds of queries on selected tables. For example, you could create a MySQL user who can select rows but nothing else. However, this is not terribly useful for dynamic data, and, furthermore, if you have sensitive customer information, it might be possible for someone to have access to some data that you didn't intend to make available. For example, a user accessing account data could try to inject some code that accesses another account number instead of the one assigned to the current session. - -### Preventing Basic XSS Attacks ### - -XSS stands for cross-site scripting. Unlike most attacks, this exploit works on the client side. The most basic form of XSS is to put some JavaScript in user-submitted content to steal the data in a user's cookie. Since most sites use cookies and sessions to identify visitors, the stolen data can then be used to impersonate that user—which is deeply troublesome when it's a typical user account, and downright disastrous if it's the administrative account. If you don't use cookies or session IDs on your site, your users aren't vulnerable, but you should still be aware of how this attack works. - -Unlike MySQL injection attacks, XSS attacks are difficult to prevent. Yahoo!, eBay, Apple, and Microsoft have all been affected by XSS. Although the attack doesn't involve PHP, you can use PHP to strip user data in order to prevent attacks. To stop an XSS attack, you have to restrict and filter the data a user submits to your site. It is for this precise reason that most online bulletin boards don't allow the use of HTML tags in posts and instead replace them with custom tag formats such as **[b]** and **[linkto]**. - -Let's look at a simple script that illustrates how to prevent some of these attacks. For a more complete solution, use SafeHTML, discussed later in this article. - - function transform_HTML($string, $length = null) { - // Helps prevent XSS attacks - // Remove dead space. - $string = trim($string); - // Prevent potential Unicode codec problems. - $string = utf8_decode($string); - // HTMLize HTML-specific characters. - $string = htmlentities($string, ENT_NOQUOTES); - $string = str_replace("#", "#", $string); - $string = str_replace("%", "%", $string); - $length = intval($length); - if ($length > 0) { - $string = substr($string, 0, $length); - } - return $string; - } - -This function transforms HTML-specific characters into HTML literals. A browser renders any HTML run through this script as text with no markup. For example, consider this HTML string: - - Bold Text - -Normally, this HTML would render as follows: - - Bold Text - -However, when run through **transform_HTML()**, it renders as the original input. The reason is that the tag characters are HTML entities in the processed string. The resulting string from **HTML()** in plaintext looks like this: - - <STRONG>Bold Text</STRONG> - -The essential piece of this function is the htmlentities() function call that transforms <, >, and & into their entity equivalents of **<**, **>**, and **&**. Although this takes care of the most common attacks, experienced XSS hackers have another sneaky trick up their sleeve: Encoding their malicious scripts in hexadecimal or UTF-8 instead of normal ASCII text, hoping to circumvent your filters. They can send the code along as a GET variable in the URL, saying, "Hey, this is hexadecimal code, but could you run it for me anyway?" A hexadecimal example looks something like this: - -
- -But when the browser renders that information, it turns out to be: - - - -To prevent this, transform_HTML() takes the additional steps of converting # and % signs into their entity, shutting down hex attacks, and converting UTF-8–encoded data. - -Finally, just in case someone tries to overload a string with a very long input, hoping to crash something, you can add an optional $length parameter to trim the string to the maximum length you specify. - -### Using SafeHTML ### - -The problem with the previous script is that it is simple, and it does not allow for any kind of user markup. Unfortunately, there are hundreds of ways to try to sneak JavaScript past someone's filters, and short of stripping all HTML from someone's input, there's no way of stopping it. - -Currently, there's no single script that's guaranteed to be unbreakable, though there are some that are better than most. There are two approaches to security, whitelisting and blacklisting, and whitelisting tends to be less complicated and more effective. - -One whitelisting solution is the SafeHTML anti-XSS parser from PixelApes. - -SafeHTML is smart enough to recognize valid HTML, so it can hunt and strip any dangerous tags. It does its parsing with another package called HTMLSax. - -To install and use SafeHTML, do the following: - -1. Go to [http://pixel-apes.com/safehtml/?page=safehtml][1] and download the latest version of SafeHTML. -1. Put the files in the classes directory on your server. This directory contains everything that SafeHTML and HTMLSax need to function. -1. Include the SafeHTML class file (safehtml.php) in your script. -1. Create a new SafeHTML object called $safehtml. -1. Sanitize your data with the $safehtml->parse() method. - -Here's a complete example: - - alert('XSS Attack')"; - // Create a safehtml object. - $safehtml = new safehtml(); - // Parse and sanitize the data. - $safe_data = $safehtml->parse($data); - // Display result. - echo 'The sanitized data is
' . $safe_data; - ?> - -If you want to sanitize any other data in your script, you don't have to create a new object; just use the $safehtml->parse() method throughout your script. - -#### What Can Go Wrong? #### - -The biggest mistake you can make is assuming that this class completely shuts down XSS attacks. SafeHTML is a fairly complex script that checks for almost everything, but nothing is guaranteed. You still want to do the parameter validation that applies to your site. For example, this class doesn't check the length of a given variable to ensure that it fits into a database field. It doesn't check for buffer overflow problems. - -XSS hackers are creative and use a variety of approaches to try to accomplish their objectives. Just look at RSnake's XSS tutorial at [http://ha.ckers.org/xss.html][2] to see how many ways there are to try to sneak code past someone's filters. The SafeHTML project has good programmers working overtime to try to stop XSS attacks, and it has a solid approach, but there's no guarantee that someone won't come up with some weird and fresh approach that could short-circuit its filters. - -**Note: For an example of the powerful effects of XSS attacks, check out [http://namb.la/popular/tech.html][3], which shows a step-by-step approach to creating the JavaScript XSS worm that overloaded the MySpace servers. ** - -### Protecting Data with a One-Way Hash ### - -This script performs a one-way transformation on data—in other words, it can make a hash signature of someone's password, but you can't ever decrypt it and go back to the original password. Why would you want to do that? The application is in storing passwords. An administrator doesn't need to know users' passwords—in fact, it's a good idea that only the user knows his or her password. The system (and the system alone) should be able to identify a correct password; this has been the Unix password security model for years. One-way password security works as follows: - -1. When a user or administrator creates or changes an account password, the system hashes the password and stores the result. The host system discards the plaintext password. -1. When the user logs in to a system via any means, the entered password is again hashed. -1. The host system throws away the plaintext password entered. -1. This newly hashed password is compared against the stored hash. -1. If the hashed passwords match, then the system grants access. - -The host system does this without ever knowing the original password; in fact, the original value is completely irrelevant. As a side effect, should someone break into your system and steal your password database, the intruder will have a bunch of hashed passwords without any way of reversing them to find the originals. Of course, given enough time, computer power, and poorly chosen user passwords, an attacker could probably use a dictionary attack to figure out the passwords. Therefore, don't make it easy for people to get their hands on your password database, and if someone does, have everyone change their passwords. - -#### Encryption Vs Hashing #### - -Technically speaking, this process is not encryption. It is a hash, which is different from encryption for two reasons: - -Unlike in encryption, data cannot be decrypted. - -It's possible (but extremely unlikely) that two different strings will produce the same hash. There's no guarantee that a hash is unique, so don't try to use a hash as something like a unique key in a database. - - function hash_ish($string) { - return md5($string); - } - -The md5() function returns a 32-character hexadecimal string, based on the RSA Data Security Inc. Message-Digest Algorithm (also known, conveniently enough, as MD5). You can then insert that 32-character string into your database, compare it against other md5'd strings, or just adore its 32-character perfection. - -#### Hacking the Script #### - -It is virtually impossible to decrypt MD5 data. That is, it's very hard. However, you still need good passwords, because it's still easy to make a database of hashes for the entire dictionary. There are online MD5 dictionaries where you can enter **06d80eb0c50b49a509b49f2424e8c805** and get a result of "dog." Thus, even though MD5s can't technically be decrypted, they're still vulnerable—and if someone gets your password database, you can be sure that they'll be consulting an MD5 dictionary. Thus, it's in your best interests when creating password-based systems that the passwords are long (a minimum of six characters and preferably eight) and contain both letters and numbers. And make sure that the password isn't in the dictionary. - -### Encrypting Data with Mcrypt ### - -MD5 hashes work just fine if you never need to see your data in readable form. Unfortunately, that's not always an option—if you offer to store someone's credit card information in encrypted format, you need to decrypt it at some later point. - -One of the easiest solutions is the Mcrypt module, an add-in for PHP that allows high-grade encryption. The Mcrypt library offers more than 30 ciphers to use in encryption and the possibility of a passphrase that ensures that only you (or, optionally, your users) can decrypt data. - -Let's see some hands-on use. The following script contains functions that use Mcrypt to encrypt and decrypt data: - - - -The **mcrypt()** function requires several pieces of information: - -- The data to encrypted. -- The passphrase used to encrypt and unlock your data, also known as the key. -- The cipher used to encrypt the data, which is the specific algorithm used to encrypt the data. This script uses **MCRYPT_SERPENT_256**, but you can choose from an array of fancy-sounding ciphers, including **MCRYPT_TWOFISH192**, **MCRYPT_RC2**, **MCRYPT_DES**, and **MCRYPT_LOKI97**. -- The mode used to encrypt the data. There are several modes you can use, including Electronic Codebook and Cipher Feedback. This script uses **MCRYPT_MODE_CBC**, Cipher Block Chaining. -- An **initialization vector**—also known as an IV, or a seed—an additional bit of binary data used to seed the encryption algorithm. That is, it's something extra thrown in to make the algorithm harder to crack. -- The length of the string needed for the key and IV, which vary by cipher and block. Use the **mcrypt_get_key_size()** and **mcrypt_get_block_size()** functions to find the appropriate length; then trim the key value to the appropriate length with a handy **substr()** function. (If the key is shorter than the required value, don't worry—Mcrypt pads it with zeros.) - -If someone steals both your data and your passphrase, they can just cycle through the ciphers until finding the one that works. Thus, we apply the additional security of using the **md5()** function on the key before we use it, so even having both data and passphrase won't get the intruder what she wants. - -An intruder would need the function, the data, and the passphrase all at once—and if that is the case, they probably have complete access to your server, and you're hosed anyway. - -There's a small data storage format problem here. Mcrypt returns its encrypted data in an ugly binary format that causes horrific errors when you try to store it in certain MySQL fields. Therefore, we use the **base64encode()** and **base64decode()** functions to transform the data into a SQL-compatible alphabetical format and retrieve rows. - -#### Hacking the Script #### - -In addition to experimenting with various encryption methods, you can add some convenience to this script. For example, rather than providing the key and mode every time, you could declare them as global constants in an included file. - -### Generating Random Passwords ### - -Random (but difficult-to-guess) strings are important in user security. For example, if someone loses a password and you're using MD5 hashes, you won't be able to, nor should you want to, look it up. Instead, you should generate a secure random password and send that to the user. Another application for random number generation is creating activation links in order to access your site's services. Here is a function that creates a password: - - 0) && - (! is_null($num_chars))) { - $password = ''; - $accepted_chars = 'abcdefghijklmnopqrstuvwxyz1234567890'; - // Seed the generator if necessary. - srand(((int)((double)microtime()*1000003)) ); - for ($i=0; $i<=$num_chars; $i++) { - $random_number = rand(0, (strlen($accepted_chars) -1)); - $password .= $accepted_chars[$random_number] ; - } - return $password; - } - } - ?> - -#### Using the Script #### - -The **make_password()** function returns a string, so all you need to do is supply the length of the string as an argument: - - - -The function works as follows: - -- The function makes sure that **$num_chars** is a positive nonzero integer. -- The function initializes the **$password** variable to an empty string. -- The function initializes the **$accepted_chars** variable to the list of characters the password may contain. This script uses all lowercase letters and the numbers 0 through 9, but you can choose any set of characters you like. -- The random number generator needs a seed, so it gets a bunch of random-like values. (This isn't strictly necessary on PHP 4.2 and later.) -- The function loops **$num_chars** times, one iteration for each character in the password to generate. -- For each new character, the script looks at the length of **$accepted_chars**, chooses a number between 0 and the length, and adds the character at that index in **$accepted_chars** to $password. -- After the loop completes, the function returns **$password**. - -### License ### - -This article, along with any associated source code and files, is licensed under [The Code Project Open License (CPOL)][4] - --------------------------------------------------------------------------------- - -via: http://www.codeproject.com/Articles/363897/PHP-Security - -作者:[SamarRizvi][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.codeproject.com/script/Membership/View.aspx?mid=7483622 -[1]:http://pixel-apes.com/safehtml/?page=safehtml -[2]:http://ha.ckers.org/xss.html -[3]:http://namb.la/popular/tech.html -[4]:http://www.codeproject.com/info/cpol10.aspx \ No newline at end of file diff --git a/translated/tech/20150706 PHP Security.md b/translated/tech/20150706 PHP Security.md new file mode 100644 index 0000000000..8d14bf3bb9 --- /dev/null +++ b/translated/tech/20150706 PHP Security.md @@ -0,0 +1,358 @@ +PHP 安全 +================================================================================ +![](http://www.codeproject.com/KB/PHP/363897/php_security.jpg) + +### 简介 ### + +为提供互联网服务,当你在开发代码的时候必须时刻保持安全意识。可能大部分 PHP 脚本都对安全问题不敏感;这很大程度上是因为有大量的无经验程序员在使用这门语言。但是,没有理由让你基于粗略估计你代码的影响性而有不一致的安全策略。当你在服务器上放任何经济相关的东西时,就有可能会有人尝试破解它。创建一个论坛程序或者任何形式的购物车,被攻击的可能性就上升到了无穷大。 + +### 背景 ### + +为了确保你的 web 内容安全,这里有一些一般的安全准则: + +#### 别相信表单 #### + +攻击表单很简单。通过使用一个简单的 JavaScript 技巧,你可以限制你的表单只允许在评分域中填写 1 到 5 的数字。如果有人关闭了他们浏览器的 JavaScript 功能或者提交自定义的表单数据,你客户端的验证就失败了。 + +用户主要通过表单参数和你的脚本交互,因此他们是最大的安全风险。你应该学到什么呢?总是要验证 PHP 脚本中传递到其它任何 PHP 脚本的数据。在本文中,我们向你演示了如何分析和防范跨站点脚本(XSS)攻击,它可能劫持用户凭据(甚至更严重)。你也会看到如何防止会玷污或毁坏你数据的 MySQL 注入攻击。 + +#### 别相信用户 #### + +假设你网站获取的每一份数据都充满了有害的代码。清理每一部分,就算你相信没有人会尝试攻击你的站点。 + +#### 关闭全局变量 #### + +你可能会有的最大安全漏洞是启用了 register\_globals 配置参数。幸运的是,PHP 4.2 及以后版本默认关闭了这个配置。如果打开了 **register\_globals**,你可以在你的 php.ini 文件中通过改变 register\_globals 变量为 Off 关闭该功能: + + register_globals = Off + +新手程序员觉得注册全局变量很方便,但他们不会意识到这个设置有多么危险。一个启用了全局变量的服务器会自动为全局变量赋任何形式的参数。为了了解它如何工作以及为什么有危险,让我们来看一个例子。 + +假设你有一个称为 process.php 的脚本,它会向你的数据库插入表单数据。初始的表单像下面这样: + + + +运行 process.php 的时候,启用了注册全局变量的 PHP 会为该参数赋值为 $username 变量。这会比通过 **$\_POST['username']** 或 **$\_GET['username']** 访问它节省敲击次数。不幸的是,这也会给你留下安全问题,因为 PHP 设置该变量的值为通过 GET 或 POST 参数发送到脚本的任何值,如果你没有显示地初始化该变量并且你不希望任何人去操作它,这就会有一个大问题。 + +看下面的脚本,假如 $authorized 变量的值为 true,它会给用户显示验证数据。正常情况下,只有当用户正确通过了假想的 authenticated\_user() 函数验证,$authorized 变量的值才会被设置为真。但是如果你启用了 **register\_globals**,任何人都可以发送一个 GET 参数,例如 authorized=1 去覆盖它: + + + +这个故事的寓意是,你应该从预定义的服务器变量中获取表单数据。所有通过 post 表单传递到你 web 页面的数据都会自动保存到一个称为 **$\_POST** 的大数组中,所有的 GET 数据都保存在 **$\_GET** 大数组中。文件上传信息保存在一个称为 **$\_FILES** 的特殊数据中。另外,还有一个称为 **$\_REQUEST** 的复合变量。 + +要从一个 POST 方法表单中访问 username 域,可以使用 **$\_POST['username']**。如果 username 在 URL 中就使用 **$\_GET['username']**。如果你不确定值来自哪里,用 **$\_REQUEST['username']**。 + + + +$\_REQUEST 是 $\_GET、$\_POST、和 $\_COOKIE 数组的结合。如果你有两个或多个值有相同的参数名称,注意 PHP 会使用哪个。默认的顺序是 cookie、POST、然后是 GET。 + +#### 推荐安全配置选项 #### + +这里有几个会影响安全功能的 PHP 配置设置。下面是一些显然应该用于生产服务器的: + +- **register\_globals** 设置为 off +- **safe\_mode** 设置为 off +- **error\_reporting** 设置为 off。如果出现错误了,这会向用户浏览器发送可见的错误报告信息。对于生产服务器,使用错误日志代替。开发服务器如果在防火墙后面就可以启用错误日志。 +- 停用这些函数:system()、exec()、passthru()、shell\_exec()、proc\_open()、和 popen()。 +- **open\_basedir** 为 /tmp(以便保存会话信息)目录和 web 根目录设置值,以便脚本不能访问选定区域外的文件。 +- **expose\_php** 设置为 off。该功能会向 Apache 头添加包含版本数字的 PHP 签名。 +- **allow\_url\_fopen** 设置为 off。如果你小心在你代码中访问文件的方式-也就是你验证所有输入参数,这并不严格需要。 +- **allow\_url\_include** 设置为 off。这实在没有明智的理由任何人会想要通过 HTTP 访问包含的文件。 + +一般来说,如果你发现想要使用这些功能的代码,你就不应该相信它。尤其要小心会使用类似 system() 函数的代码-它几乎肯定有缺陷。 + +启用了这些设置后,让我们来看看一些特定的攻击以及能帮助你保护你服务器的方法。 + +### SQL 注入攻击 ### + +由于 PHP 传递到 MySQL 数据库的查询语句是按照强大的 SQL 编程语言编写的,你就有某些人通过在 web 查询参数中使用 MySQL 语句尝试 SQL 注入攻击的风险。通过在参数中插入有害的 SQL 代码片段,攻击者会尝试进入(或破坏)你的服务器。 + +假如说你有一个最终会放入变量 $product 的表单参数,你使用了类似下面的 SQL 语句: + + $sql = "select * from pinfo where product = '$product'"; + +如果参数是直接从表单中获得的,使用 PHP 自带的数据库特定转义函数,类似: + + $sql = 'Select * from pinfo where product = '"' + mysql_real_escape_string($product) . '"'; + +如果不这样做的话,有人也许会把下面的代码段放到表单参数中: + + 39'; DROP pinfo; SELECT 'FOO + +$sql 的结果就是: + + select product from pinfo where product = '39'; DROP pinfo; SELECT 'FOO' + +由于分号是 MySQL 的语句分隔符,数据库会运行下面三条语句: + + select * from pinfo where product = '39' + DROP pinfo + SELECT 'FOO' + +好了,你丢失了你的表。 + +注意实际上 PHP 和 MySQL 不会运行这种特殊语法,因为 **mysql\_query()** 函数只允许每个请求处理一个语句。但是,一个子查询仍然会生效。 + +要防止 SQL 注入攻击,做这两件事: + +- 总是验证所有参数。例如,如果需要一个数字,就要确保它是一个数字。 +- 总是对数据使用 mysql\_real\_escape\_string() 函数转义数据中的任何引号和双引号。 + +**注意:要自动转义任何表单数据,可以启用魔术引号(Magic Quotes)。** + +一些 MySQL 破坏可以通过限制 MySQL 用户权限避免。任何 MySQL 账户可以限制为只允许对选定的表进行特定类型的查询。例如,你可以创建只能选择行的 MySQL 用户。但是,这对于动态数据并不十分有用,另外,如果你有敏感的用户信息,可能某些人能访问一些数据,但你并不希望如此。例如,一个访问账户数据的用户可能会尝试注入访问另一个账户号码的代码,而不是为当前会话指定的号码。 + +### 防止基本的 XSS 攻击 ### + +XSS 表示跨站点脚本。不像大部分攻击,该漏洞发生在客户端。XSS 最常见的基本形式是在用户提交的内容中放入 JavaScript 以便偷取用户 cookie 中的数据。由于大部分站点使用 cookie 和 session 验证访客,偷取的数据可用于模拟该用于-如果是一个典型的用户账户就会深受麻烦,如果是管理员账户甚至是彻底的惨败。如果你不在站点中使用 cookie 和 session ID,你的用户就不容易被攻击,但你仍然应该明白这种攻击是如何工作的。 + +不像 MySQL 注入攻击,XSS 攻击很难预防。Yahoo、eBay、Apple、以及 Microsoft 都曾经受 XSS 影响。尽管攻击不包含 PHP,你可以使用 PHP 来剥离用户数据以防止攻击。为了防止 XSS 攻击,你应该限制和过滤用户提交给你站点的数据。正是因为这个原因大部分在线公告板都不允许在提交的数据中使用 HTML 标签,而是用自定义的标签格式代替,例如 **[b]** 和 **[linkto]**。 + +让我们来看一个如何防止这类攻击的简单脚本。对于更完善的解决办法,可以使用 SafeHHTML,本文的后面部分会讨论到。 + + function transform_HTML($string, $length = null) { + // Helps prevent XSS attacks + // Remove dead space. + $string = trim($string); + // Prevent potential Unicode codec problems. + $string = utf8_decode($string); + // HTMLize HTML-specific characters. + $string = htmlentities($string, ENT_NOQUOTES); + $string = str_replace("#", "#", $string); + $string = str_replace("%", "%", $string); + $length = intval($length); + if ($length > 0) { + $string = substr($string, 0, $length); + } + return $string; + } + +这个函数将 HTML 特定字符转换为 HTML 字面字符。一个浏览器对任何通过这个脚本的 HTML 以无标记的文本呈现。例如,考虑下面的 HTML 字符串: + + Bold Text + +一般情况下,HTML 会显示为: + + Bold Text + +但是,通过 **transform\_HTML()** 后,它就像初始输入一样呈现。原因是处理的字符串中标签字符串是 HTML 条目。**transform\_HTML()** 结果字符串的纯文本看起来像下面这样: + + <STRONG>Bold Text</STRONG> + +该函数的实质是 htmlentities() 函数调用,它会将 <、>、和 & 转换为 **<**、**>**、和 **&**。尽管这会处理大部分的普通攻击,有经验的 XSS 攻击者有另一种把戏:用十六进制或 UTF-8 编码恶意脚本,而不是采用普通的 ASCII 文本,从而希望能饶过你的过滤器。他们可以在 URL 的 GET 变量中发送代码,例如,“这是十六进制代码,你能帮我运行吗?” 一个十六进制例子看起来像这样: + +
+ +浏览器渲染这信息的时候,结果就是: + + + +为了防止这种情况,transform\_HTML() 采用额外的步骤把 # 和 % 符号转换为它们的实体,从而避免十六进制攻击,并转换 UTF-8 编码的数据。 + +最后,为了防止某些人用很长的输入超载字符串从而导致某些东西崩溃,你可以添加一个可选的 $length 参数来截取你指定最大长度的字符串。 + +### 使用 SafeHTML ### + +之前脚本的问题比较简单,它不允许任何类型的用户标记。不幸的是,这里有上百种方法能使 JavaScript 跳过用户的过滤器,从用户输入中剥离 HTML,没有方法可以防止这种情况。 + +当前,没有任何一个脚本能保证无法被破解,尽管有一些确实比大部分要好。有白名单和黑名单两种方法加固安全,白名单比较简单而且更加有效。 + +一个白名单解决方案是 PixelApes 的 SafeHTML 反跨站点脚本解析器。 + +SafeHTML 能识别有效 HTML,能追踪并剥离任何危险标签。它用另一个称为 HTMLSax 的软件包进行解析。 + +按照下面步骤安装和使用 SafeHTML: + +1. 到 [http://pixel-apes.com/safehtml/?page=safehtml][1] 下载最新版本的 SafeHTML。 +1. 把文件放到你服务器的类文件夹。该文件夹包括 SafeHTML 和 HTMLSax 起作用需要的所有东西。 +1. 在脚本中包含 SafeHTML 类文件(safehtml.php)。 +1. 创建称为 $safehtml 的新 SafeHTML 对象。 +1. 用 $safehtml->parse() 方法清理你的数据。 + +这是一个完整的例子: + + alert('XSS Attack')"; + // Create a safehtml object. + $safehtml = new safehtml(); + // Parse and sanitize the data. + $safe_data = $safehtml->parse($data); + // Display result. + echo 'The sanitized data is
' . $safe_data; + ?> + +如果你想清理脚本中的任何其它数据,你不需要创建一个新的对象;在你的整个脚本中只需要使用 $safehtml->parse() 方法。 + +#### 什么可能会出现问题? #### + +你可能犯的最大错误是假设这个类能完全避免 XSS 攻击。SafeHTML 是一个相当复杂的脚本,几乎能检查所有事情,但没有什么是能保证的。你仍然需要对你的站点做参数验证。例如,该类不能检查给定变量的长度以确保能适应数据库的字段。它也不检查缓冲溢出问题。 + +XSS 攻击者很有创造力,他们使用各种各样的方法来尝试达到他们的目标。可以阅读 RSnake 的 XSS 教程[http://ha.ckers.org/xss.html][2] 看一下这里有多少种方法尝试使代码跳过过滤器。SafeHTML 项目有很好的程序员一直在尝试阻止 XSS 攻击,但无法保证某些人不会想起一些奇怪和新奇的方法来跳过过滤器。 + +**注意:XSS 攻击严重影响的一个例子 [http://namb.la/popular/tech.html][3],其中显示了如何一步一步创建会超载 MySpace 服务器的 JavaScript XSS 蠕虫。** + +### 用单向哈希保护数据 ### + +该脚本对输入的数据进行单向转换-换句话说,它能对某人的密码产生哈希签名,但不能解码获得原始密码。为什么你希望这样呢?应用程序会存储密码。一个管理员不需要知道用户的密码-事实上,只有用户知道他的/她的密码是个好主意。系统(也仅有系统)应该能识别一个正确的密码;这是 Unix 多年来的密码安全模型。单向密码安全按照下面的方式工作: + +1. 当一个用户或管理员创建或更改一个账户密码时,系统对密码进行哈希并保存结果。主机系统忽视明文密码。 +2. 当用户通过任何方式登录到系统时,再次对输入的密码进行哈希。 +3. 主机系统抛弃输入的明文密码。 +4. 当前新哈希的密码和之前保存的哈希相比较。 +5. 如果哈希的密码相匹配,系统就会授予访问权限。 + +主机系统完成这些并不需要知道原始密码;事实上,原始值完全不相关。一个副作用是,如果某人侵入系统并盗取了密码数据库,入侵者会获得很多哈希后的密码,但无法把它们反向转换为原始密码。当然,给足够时间、计算能力,以及弱用户密码,一个攻击者还是有可能采用字典攻击找出密码。因此,别轻易让人碰你的密码数据库,如果确实有人这样做了,让每个用户更改他们的密码。 + +#### 加密 Vs 哈希 #### + +技术上来来说,这过程并不是加密。哈希和加密是不相同的,这有两个理由: + +不像加密,数据不能被解密。 + +是有可能(但很不常见)两个不同的字符串会产生相同的哈希。并不能保证哈希是唯一的,因此别像数据库中的唯一键那样使用哈希。 + + function hash_ish($string) { + return md5($string); + } + +md5() 函数基于 RSA 数据安全公司的消息摘要算法(即 MD5)返回一个由 32 个字符组成的十六进制串。然后你可以将那个 32 位字符串插入到数据库中,和另一个 md5 字符串相比较,或者就用这 32 个字符。 + +#### 破解脚本 #### + +几乎不可能解密 MD5 数据。或者说很难。但是,你仍然需要好的密码,因为根据整个字典生成哈希数据库仍然很简单。这里有在线 MD5 字典,当你输入 **06d80eb0c50b49a509b49f2424e8c805** 后会得到结果 “dog”。因此,尽管技术上 MD5 不能被解密,这里仍然有漏洞-如果某人获得了你的密码数据库,你可以肯定他们肯定会使用 MD5 字典破译。因此,当你创建基于密码的系统的时候尤其要注意密码长度(最小 6 个字符,8 个或许会更好)和包括字母和数字。并确保字典中没有这个密码。 + +### 用 Mcrypt 加密数据 ### + +如果你不需要以可阅读形式查看密码,采用 MD5 就足够了。不幸的是,这里并不总是有可选项-如果你提供以加密形式存储某人的信用卡信息,你可能需要在后面的某个点进行解密。 + +最早的一个解决方案是 Mcrypt 模块,用于允许 PHP 高速加密的附件。Mcrypt 库提供了超过 30 种计算方法用于加密,并且提供短语确保只有你(或者你的用户)可以解密数据。 + +让我们来看看使用方法。下面的脚本包含了使用 Mcrypt 加密和解密数据的函数: + + + +**mcrypt()** 函数需要几个信息: + +- 需要加密的数据 +- 用于加密和解锁数据的短语,也称为键。 +- 用于加密数据的计算方法,也就是用于加密数据的算法。该脚本使用了 **MCRYPT\_SERPENT\_256**,但你可以从很多算法中选择,包括 **MCRYPT\_TWOFISH192**、**MCRYPT\_RC2**、**MCRYPT\_DES**、和 **MCRYPT\_LOKI97**。 +- 加密数据的模式。这里有几个你可以使用的模式,包括电子密码本(Electronic Codebook) 和加密反馈(Cipher Feedback)。该脚本使用 **MCRYPT\_MODE\_CBC** 密码块链接。 +- 一个 **初始化向量**-也称为 IV,或着一个种子-用于为加密算法设置种子的额外二进制位。也就是使算法更难于破解的额外信息。 +- 键和 IV 字符串的长度,这可能随着加密和块而不同。使用 **mcrypt\_get\_key\_size()** 和 **mcrypt\_get\_block\_size()** 函数获取合适的长度;然后用 **substr()** 函数将键的值截取为合适的长度。(如果键的长度比要求的短,别担心-Mcrypt 会用 0 填充。) + +如果有人窃取了你的数据和短语,他们只能一个个尝试加密算法直到找到正确的那一个。因此,在使用它之前我们通过对键使用 **md5()** 函数增加安全,就算他们获取了数据和短语,入侵者也不能获得想要的东西。 + +入侵者同时需要函数,数据和短语-如果真是如此,他们可能获得了对你服务器的完整访问,你只能大清洗了。 + +这里还有一个数据存储格式的小问题。Mcrypt 以难懂的二进制形式返回加密后的数据,这使得当你将其存储到 MySQL 字段的时候可能出现可怕错误。因此,我们使用 **base64encode()** 和 **base64decode()** 函数转换为和 SQL 兼容的字母格式和检索行。 + +#### 破解脚本 #### + +除了实验多种加密方法,你还可以在脚本中添加一些便利。例如,不是每次都提供键和模式,而是在包含的文件中声明为全局常量。 + +### 生成随机密码 ### + +随机(但难以猜测)字符串在用户安全中很重要。例如,如果某人丢失了密码并且你使用 MD5 哈希,你不可能,也不希望查找回来。而是应该生成一个安全的随机密码并发送给用户。为了访问你站点的服务,另外一个用于生成随机数字的应用程序会创建有效链接。下面是创建密码的一个函数: + + 0) && + (! is_null($num_chars))) { + $password = ''; + $accepted_chars = 'abcdefghijklmnopqrstuvwxyz1234567890'; + // Seed the generator if necessary. + srand(((int)((double)microtime()*1000003)) ); + for ($i=0; $i<=$num_chars; $i++) { + $random_number = rand(0, (strlen($accepted_chars) -1)); + $password .= $accepted_chars[$random_number] ; + } + return $password; + } + } + ?> + +#### 使用脚本 #### + +**make_password()** 函数返回一个字符串,因此你需要做的就是提供字符串的长度作为参数: + + + +函数按照下面步骤工作: + +- 函数确保 **$num\_chars** 是非零的正整数。 +- 函数初始化 **$accepted\_chars** 变量为密码可能包含的字符列表。该脚本使用所有小写字母和数字 0 到 9,但你可以使用你喜欢的任何字符集合。 +- 随机数生成器需要一个种子,从而获得一系列类随机值(PHP 4.2 及之后版本中并不严格要求)。 +- 函数循环 **$num\_chars** 次,每次迭代生成密码中的一个字符。 +- 对于每个新字符,脚本查看 **$accepted_chars** 的长度,选择 0 和长度之间的一个数字,然后添加 **$accepted\_chars** 中该数字为索引值的字符到 $password。 +- 循环结束后,函数返回 **$password**。 + +### 许可证 ### + +本篇文章,包括相关的源代码和文件,都是在 [The Code Project Open License (CPOL)][4] 协议下发布。 + +-------------------------------------------------------------------------------- + +via: http://www.codeproject.com/Articles/363897/PHP-Security + +作者:[SamarRizvi][a] +译者:[ictlyh](https://github.com/ictlyh) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.codeproject.com/script/Membership/View.aspx?mid=7483622 +[1]:http://pixel-apes.com/safehtml/?page=safehtml +[2]:http://ha.ckers.org/xss.html +[3]:http://namb.la/popular/tech.html +[4]:http://www.codeproject.com/info/cpol10.aspx \ No newline at end of file From 02812ef883af3ccb750c7592da8503154e4a43d8 Mon Sep 17 00:00:00 2001 From: ZTinoZ Date: Thu, 16 Jul 2015 15:49:52 +0800 Subject: [PATCH 616/965] Translating by ZTinoZ --- ...command line tools for monitoring your Linux system.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sources/talk/20150709 7 command line tools for monitoring your Linux system.md b/sources/talk/20150709 7 command line tools for monitoring your Linux system.md index 2362fefca4..fe82ef6436 100644 --- a/sources/talk/20150709 7 command line tools for monitoring your Linux system.md +++ b/sources/talk/20150709 7 command line tools for monitoring your Linux system.md @@ -10,13 +10,13 @@ ![Image courtesy Mark Gibbs](http://images.techhive.com/images/article/2015/06/command-line-tools-monitoring-linux-system-2-100591901-orig.png) -### How we did it ### +### 我们怎么做 ### -FYI: 本文中的截图取自[Debian Linux 8.1][1] (“Jessie”),其运行在[OS X 10.10.3][3] (“Yosemite”)操作系统下[Oracle VirtualBox 4.3.28][2]中的一台虚拟机里。想要建立你的Debian虚拟机,可以看看我的这篇教程——“[How to install Debian Linux in a VirtualBox VM][4]”。 +须知: 本文中的截图取自[Debian Linux 8.1][1] (“Jessie”),其运行在[OS X 10.10.3][3] (“Yosemite”)操作系统下[Oracle VirtualBox 4.3.28][2]中的一台虚拟机里。想要建立你的Debian虚拟机,可以看看我的这篇教程——“[How to install Debian Linux in a VirtualBox VM][4]”。 ![Image courtesy Mark Gibbs](http://images.techhive.com/images/article/2015/06/command-line-tools-monitoring-linux-system-3-100591902-orig.png) -### Top命令 ### +### Top ### 作为Linux系统监控工具中比较易用的一个,**top命令**能带我们一览Linux中的几乎每一处。以下这张图是它的默认界面,但是按“z”键可以切换不同的显示颜色。其它热键和命令则有其它的功能,例如显示概要信息和内存信息(第四行第二个),根据各种不一样的条件排序、终止进程任务等等(你可以在[这里][5]找到完整的列表)。 @@ -24,7 +24,7 @@ FYI: 本文中的截图取自[Debian Linux 8.1][1] (“Jessie”),其运行在 ### htop ### -相比top,它的替代品Htop则更为精致。维基百科是这样描述的:“Users often deploy htop in cases where Unix top does not provide enough information about the systems processes, for example when trying to find minor memory leaks in applications. Htop is also popularly used interactively as a system monitor. Compared to top, it provides a more convenient, cursor-controlled interface for sending signals to processes.” (For more detail go [here][6].) +相比top,它的替代品Htop则更为精致。维基百科是这样描述的:“用户经常会部署htop以防Unix top不能提供关于系统进程的足够信息,比如说当你在尝试发现应用程序里的一个小的内存泄露问题,Htop一般也能作为一个系统监听器来使用。相比top,它提供了一个更方便的光标控制界面来向进程发送信号。” (想了解更多细节猛戳[这里][6].) ![Image courtesy Mark Gibbs](http://images.techhive.com/images/article/2015/06/command-line-tools-monitoring-linux-system-5-100591903-orig.png) From 89dedc383a78c684edfc70105d2184b21a50050d Mon Sep 17 00:00:00 2001 From: DeadFire Date: Thu, 16 Jul 2015 16:22:42 +0800 Subject: [PATCH 617/965] =?UTF-8?q?20150716-3=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... CCleaner Alternatives For Ubuntu Linux.md | 118 ++++++++++++++++++ 1 file changed, 118 insertions(+) create mode 100644 sources/share/20150716 4 CCleaner Alternatives For Ubuntu Linux.md diff --git a/sources/share/20150716 4 CCleaner Alternatives For Ubuntu Linux.md b/sources/share/20150716 4 CCleaner Alternatives For Ubuntu Linux.md new file mode 100644 index 0000000000..75d5af190c --- /dev/null +++ b/sources/share/20150716 4 CCleaner Alternatives For Ubuntu Linux.md @@ -0,0 +1,118 @@ +4 CCleaner Alternatives For Ubuntu Linux +================================================================================ +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/ccleaner-10-700x393.jpg) + +Back in my Windows days, [CCleaner][1] was my favorite tool for freeing up space, delete junk files and speed up Windows. I know I am not the only one who looked for CCleaner for Linux when switched from Windows. If you are looking for CCleaner alternative in Linux, I am going to list here four such application that you can use to clean up Ubuntu or Ubuntu based Linux distributions. But before we see the list, let’s ponder over whether Linux requires system clean up tools or not. + +### Does Linux need system clean up utilities like CCleaner? ### + +To get this answer, let’s first see what does CCleaner do. As per [How-To Geek][2]: + +> CCleaner has two main uses. One, it scans for and deletes useless files, freeing up space. Two, it erases private data like your browsing history and list of most recently opened files in various programs. + +So in short, it performs a system wide clean up of temporary file be it in your web browser or in your media player. You might know that Windows has the affection for keeping junk files in the system for like since ever but what about Linux? What does it do with the temporary files? + +Unlike Windows, Linux cleans up all the temporary files (store in /tmp) automatically. You don’t have registry in Linux which further reduces the headache. At worst, you might have some broken packages, packages that are not needed anymore and internet browsing history, cookies and cache. + +### Does it mean that Linux does not need system clean up utilities? ### + +- Answer is no if you can run few commands for occasional package cleaning, manually deleting browser history etc. +- Answer is yes if you don’t want to run from places to places and want one tool to rule them all where you can clean up all the suggested things in one (or few) click(s). + +If you have got your answer as yes, let’s move on to see some CCleaner like utilities to clean up your Ubuntu Linux. + +### CCleaner alternatives for Ubuntu ### + +Please note that I am using Ubuntu here because some tools discussed here are only existing for Ubuntu based Linux distributions while some are available for all Linux distributions. + +#### 1. BleachBit #### + +![BleachBit System Cleaning Tool for Linux](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/BleachBit_Cleaning_Tool_Ubuntu.jpeg) + +[BleachBit][3] is cross platform app available for both Windows and Linux. It has a long list of applications that it support for cleaning and thus giving you option for cleaning cache, cookies and log files. A quick look at its feature: + +- Simple GUI check the boxes you want, preview it and delete it. +- Multi-platform: Linux and Windows +- Free and open source +- Shred files to hide their contents and prevent data recovery +- Overwrite free disk space to hide previously deleted files +- Command line interface also available + +BleachBit is available by default in Ubuntu 14.04 and 15.04. You can install it using the command below in terminal: + + sudo apt-get install bleachbit + +BleachBit has binaries available for all major Linux distributions. You can download BleachBit from the link below: + +- [Download BleachBit for Linux][4] + +#### 2. Sweeper #### + +![Sweeper system clean up tool for Ubuntu Linux](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/sweeper.jpeg) + +Sweeper is a system clean up utility which is a part of [KDE SC utilities][5] module. It’s main features are: + +- remove web-related traces: cookies, history, cache +- remove the image thumbnails cache +- clean the applications and documentes history + +Sweeper is available by default in Ubuntu repository. Use the command below in a terminal to install Sweeper: + + sudo apt-get install sweeper + +#### 3. Ubuntu Tweak #### + +![Ubuntu Tweak Tool for cleaning up Ubuntu system](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/Ubuntu_Tweak_Janitor.jpeg) + +As the name suggests, [Ubuntu Tweak][6] is more of a tweaking tool than a cleaning utility. But along with tweaking things like compiz settings, panel configuration, start up program control, power management etc, Ubuntu Tweak also provides a Janitor tab that lets you: + +- clean browser cache +- clean Ubuntu Software Center cache +- clean thumbnail cache +- clan apt repository cache +- clean old kernel files +- clean package configs + +You can get the .deb installer for Ubuntu Tweak from the link below: + +- [Download Ubuntu Tweak][7] + +#### 4. GCleaner (beta) #### + +![GCleaner CCleaner like tool](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/GCleaner.jpeg) + +One of the third party apps for elementaryOS Freya, GCleaner aims to be CCleaner in GNU world. The interface resembles heavily to CCleaner. Some of the main features of GCleaner are: + +- clean browser history +- clean app cache +- clean packages and configs +- clean recent document history +- empty recycle bin + +At the time of writing this article, GCleaner is in heavy development. You can check the project website and get the source code to build and use GCleaner. + +- [Know More About GCleaner][8] + +### Your choice? ### + +I have listed down the possibilities to you. I let you decide which tool you would use to clean Ubuntu 14.04. But I am certain that if you were looking for a CCleaner like application, one of these four end your search. + +-------------------------------------------------------------------------------- + +via: http://itsfoss.com/ccleaner-alternatives-ubuntu-linux/ + +作者:[Abhishek][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://itsfoss.com/author/abhishek/ +[1]:https://www.piriform.com/ccleaner/download +[2]:http://www.howtogeek.com/172820/beginner-geek-what-does-ccleaner-do-and-should-you-use-it/ +[3]:http://bleachbit.sourceforge.net/ +[4]:http://bleachbit.sourceforge.net/download/linux +[5]:https://www.kde.org/applications/utilities/ +[6]:http://ubuntu-tweak.com/ +[7]:http://ubuntu-tweak.com/ +[8]:https://quassy.github.io/elementary-apps/GCleaner/ \ No newline at end of file From 706a3d48f481a0bc5292a8574590cad31d18a2a2 Mon Sep 17 00:00:00 2001 From: DeadFire Date: Fri, 17 Jul 2015 13:00:05 +0800 Subject: [PATCH 618/965] =?UTF-8?q?20150717-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ver or client) on Ubuntu 14.04 or 15.04.md | 314 ++++++++++++++++++ ...re FTP Server with Proftpd on Fedora 22.md | 185 +++++++++++ 2 files changed, 499 insertions(+) create mode 100644 sources/tech/20150717 How to Configure Chef (server or client) on Ubuntu 14.04 or 15.04.md create mode 100644 sources/tech/20150717 Howto Configure FTP Server with Proftpd on Fedora 22.md diff --git a/sources/tech/20150717 How to Configure Chef (server or client) on Ubuntu 14.04 or 15.04.md b/sources/tech/20150717 How to Configure Chef (server or client) on Ubuntu 14.04 or 15.04.md new file mode 100644 index 0000000000..69efa63823 --- /dev/null +++ b/sources/tech/20150717 How to Configure Chef (server or client) on Ubuntu 14.04 or 15.04.md @@ -0,0 +1,314 @@ +How to Configure Chef (server/client) on Ubuntu 14.04 / 15.04 +================================================================================ +Chef is a configuration management and automation tool for information technology professionals that configures and manages your infrastructure whether it is on-premises or in the cloud. It can be used to speed up application deployment and to coordinate the work of multiple system administrators and developers involving hundreds, or even thousands, of servers and applications to support a large customer base. The key to Chef’s power is that it turns infrastructure into code. Once you master Chef, you will be able to enable web IT with first class support for managing your cloud infrastructure with an easy automation of your internal deployments or end users systems. + +Here are the major components of Chef that we are going to setup and configure in this tutorial. +chef components + +![](http://blog.linoxide.com/wp-content/uploads/2015/07/chef.png) + +### Chef Prerequisites and Versions ### + +We are going to setup Chef configuration management system under the following basic environment. + +注:表格 + + + + + + + + + + + + + + + + + + + + + + + + + + +
Chef, Configuration Management Tool
Base Operating SystemUbuntu 14.04.1 LTS (x86_64)
Chef ServerVersion 12.1.0
Chef ManageVersion 1.17.0
Chef Development KitVersion 0.6.2
RAM and CPU4 GB  , 2.0+2.0 GHZ
+ +### Chef Server's Installation and Configurations ### + +Chef Server is central core component that stores recipes as well as other configuration data and interact with the workstations and nodes. let's download the installation media by selecting the latest version of chef server from its official web link. + +We will get its installation package and install it by using following commands. + +**1) Downloading Chef Server** + + root@ubuntu-14-chef:/tmp# wget https://web-dl.packagecloud.io/chef/stable/packages/ubuntu/trusty/chef-server-core_12.1.0-1_amd64.deb + +**2) To install Chef Server** + + root@ubuntu-14-chef:/tmp# dpkg -i chef-server-core_12.1.0-1_amd64.deb + +**3) Reconfigure Chef Server** + +Now Run the following command to start all of the chef server services ,this step may take a few minutes to complete as its composed of many different services that work together to create a functioning system. + + root@ubuntu-14-chef:/tmp# chef-server-ctl reconfigure + +The chef server startup command 'chef-server-ctl reconfigure' needs to be run twice so that installation ends with the following completion output. + + Chef Client finished, 342/350 resources updated in 113.71139964 seconds + opscode Reconfigured! + +**4) Reboot OS** + +Once the installation complete reboot the operating system for the best working without doing this we you might get the following SSL_connect error during creation of User. + + ERROR: Errno::ECONNRESET: Connection reset by peer - SSL_connect + +**5) Create new Admin User** + +Run the following command to create a new administrator user with its profile settings. During its creation user’s RSA private key is generated automatically that should be saved to a safe location. The --filename option will save the RSA private key to a specified path. + + root@ubuntu-14-chef:/tmp# chef-server-ctl user-create kashi kashi kashi kashif.fareedi@gmail.com kashi123 --filename /root/kashi.pem + +### Chef Manage Setup on Chef Server ### + +Chef Manage is a management console for Enterprise Chef that enables a web-based user interface for visualizing and managing nodes, data bags, roles, environments, cookbooks and role-based access control (RBAC). + +**1) Downloading Chef Manage** + +Copy the link for Chef Manage from the official web site and download the chef manage package. + + root@ubuntu-14-chef:~# wget https://web-dl.packagecloud.io/chef/stable/packages/ubuntu/trusty/opscode-manage_1.17.0-1_amd64.deb + +**2) Installing Chef Manage** + +Let's install it into the root's home directory with below command. + + root@ubuntu-14-chef:~# chef-server-ctl install opscode-manage --path /root + +**3) Restart Chef Manage and Server** + +Once the installation is complete we need to restart chef manage and chef server services by executing following commands. + + root@ubuntu-14-chef:~# opscode-manage-ctl reconfigure + root@ubuntu-14-chef:~# chef-server-ctl reconfigure + +### Chef Manage Web Console ### + +We can access chef manage web console from the localhost as wel as its fqdn and login with the already created admin user account. + +![chef amanage](http://blog.linoxide.com/wp-content/uploads/2015/07/5-chef-web.png) + +**1) Create New Organization with Chef Manage** + +You would be asked to create new organization or accept the invitation from the organizations. Let's create a new organization by providing its short and full name as shown. + +![Create Org](http://blog.linoxide.com/wp-content/uploads/2015/07/7-create-org.png) + +**2) Create New Organization with Command line** + +We can also create new Organization from the command line by executing the following command. + + root@ubuntu-14-chef:~# chef-server-ctl org-create linux Linoxide Linux Org. --association_user kashi --filename linux.pem + +### Configuration and setup of Workstation ### + +As we had done with successful installation of chef server now we are going to setup its workstation to create and configure any recipes, cookbooks, attributes, and other changes that we want to made to our Chef configurations. + +**1) Create New User and Organization on Chef Server** + +In order to setup workstation we create a new user and an organization for this from the command line. + + root@ubuntu-14-chef:~# chef-server-ctl user-create bloger Bloger Kashif bloger.kashif@gmail.com bloger123 --filename bloger.pem + + root@ubuntu-14-chef:~# chef-server-ctl org-create blogs Linoxide Blogs Inc. --association_user bloger --filename blogs.pem + +**2) Download Starter Kit for Workstation** + +Now Download and Save starter-kit from the chef manage web console on a workstation and use it to work with Chef server. + +![Starter Kit](http://blog.linoxide.com/wp-content/uploads/2015/07/8-download-kit.png) + +**3) Click to "Proceed" with starter kit download** + +![starter kit](http://blog.linoxide.com/wp-content/uploads/2015/07/9-download-kit.png) + +### Chef Development Kit Setup for Workstation ### + +Chef Development Kit is a software package suite with all the development tools need to code Chef. It combines with the best of the breed tools developed by Chef community with Chef Client. + +**1) Downloading Chef DK** + +We can Download chef development kit from its official web link and choose the required operating system to get its chef development tool kit. + +![Chef DK](http://blog.linoxide.com/wp-content/uploads/2015/07/10-CDK.png) + +Copy the link and download it with wget command. + + root@ubuntu-15-WKS:~# wget https://opscode-omnibus-packages.s3.amazonaws.com/ubuntu/12.04/x86_64/chefdk_0.6.2-1_amd64.deb + +**1) Chef Development Kit Installatoion** + +Install chef-development kit using dpkg command + + root@ubuntu-15-WKS:~# dpkg -i chefdk_0.6.2-1_amd64.deb + +**3) Chef DK Verfication** + +Verify using the below command that the client got installed properly. + + root@ubuntu-15-WKS:~# chef verify + +---------- + + Running verification for component 'berkshelf' + Running verification for component 'test-kitchen' + Running verification for component 'chef-client' + Running verification for component 'chef-dk' + Running verification for component 'chefspec' + Running verification for component 'rubocop' + Running verification for component 'fauxhai' + Running verification for component 'knife-spork' + Running verification for component 'kitchen-vagrant' + Running verification for component 'package installation' + Running verification for component 'openssl' + .............. + --------------------------------------------- + Verification of component 'rubocop' succeeded. + Verification of component 'knife-spork' succeeded. + Verification of component 'openssl' succeeded. + Verification of component 'berkshelf' succeeded. + Verification of component 'chef-dk' succeeded. + Verification of component 'fauxhai' succeeded. + Verification of component 'test-kitchen' succeeded. + Verification of component 'kitchen-vagrant' succeeded. + Verification of component 'chef-client' succeeded. + Verification of component 'chefspec' succeeded. + Verification of component 'package installation' succeeded. + +**Connecting to Chef Server** + +We will Create ~/.chef and copy the two user and organization pem files to this folder from chef server. + + root@ubuntu-14-chef:~# scp bloger.pem blogs.pem kashi.pem linux.pem root@172.25.10.172:/.chef/ + +---------- + + root@172.25.10.172's password: + bloger.pem 100% 1674 1.6KB/s 00:00 + blogs.pem 100% 1674 1.6KB/s 00:00 + kashi.pem 100% 1678 1.6KB/s 00:00 + linux.pem 100% 1678 1.6KB/s 00:00 + +**Knife Configurations to Manage your Chef Environment** + +Now create "~/.chef/knife.rb" with following content as configured in previous steps. + + root@ubuntu-15-WKS:/.chef# vim knife.rb + current_dir = File.dirname(__FILE__) + + log_level :info + log_location STDOUT + node_name "kashi" + client_key "#{current_dir}/kashi.pem" + validation_client_name "kashi-linux" + validation_key "#{current_dir}/linux.pem" + chef_server_url "https://172.25.10.173/organizations/linux" + cache_type 'BasicFile' + cache_options( :path => "#{ENV['HOME']}/.chef/checksums" ) + cookbook_path ["#{current_dir}/../cookbooks"] + +Create "~/cookbooks" folder for cookbooks as specified knife.rb file. + + root@ubuntu-15-WKS:/# mkdir cookbooks + +**Testing with Knife Configurations** + +Run "knife user list" and "knife client list" commands to verify whether knife configuration is working. + + root@ubuntu-15-WKS:/.chef# knife user list + +You might get the following error while first time you run this command.This occurs because we do not have our Chef server's SSL certificate on our workstation. + + ERROR: SSL Validation failure connecting to host: 172.25.10.173 - SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed + ERROR: Could not establish a secure connection to the server. + Use `knife ssl check` to troubleshoot your SSL configuration. + If your Chef Server uses a self-signed certificate, you can use + `knife ssl fetch` to make knife trust the server's certificates. + +To recover from the above error run the following command to fetch ssl certs and once again run the knife user and client list command and it should be fine then. + + root@ubuntu-15-WKS:/.chef# knife ssl fetch + WARNING: Certificates from 172.25.10.173 will be fetched and placed in your trusted_cert + directory (/.chef/trusted_certs). + + Knife has no means to verify these are the correct certificates. You should + verify the authenticity of these certificates after downloading. + + Adding certificate for ubuntu-14-chef.test.com in /.chef/trusted_certs/ubuntu-14-chef_test_com.crt + +Now after fetching ssl certs with above command, let's again run the below command. + + root@ubuntu-15-WKS:/.chef#knife client list + kashi-linux + +### New Node Configuration to interact with chef-server ### + +Nodes contain chef-client which performs all the infrastructure automation. So, Its time to begin with adding new servers to our chef environment by Configuring a new node to interact with chef-server after we had Configured chef-server and knife workstation combinations. + +To configure a new node to work with chef server use below command. + + root@ubuntu-15-WKS:~# knife bootstrap 172.25.10.170 --ssh-user root --ssh-password kashi123 --node-name mydns + +---------- + + Doing old-style registration with the validation key at /.chef/linux.pem... + Delete your validation key in order to use your user credentials instead + + Connecting to 172.25.10.170 + 172.25.10.170 Installing Chef Client... + 172.25.10.170 --2015-07-04 22:21:16-- https://www.opscode.com/chef/install.sh + 172.25.10.170 Resolving www.opscode.com (www.opscode.com)... 184.106.28.91 + 172.25.10.170 Connecting to www.opscode.com (www.opscode.com)|184.106.28.91|:443... connected. + 172.25.10.170 HTTP request sent, awaiting response... 200 OK + 172.25.10.170 Length: 18736 (18K) [application/x-sh] + 172.25.10.170 Saving to: ‘STDOUT’ + 172.25.10.170 + 100%[======================================>] 18,736 --.-K/s in 0s + 172.25.10.170 + 172.25.10.170 2015-07-04 22:21:17 (200 MB/s) - written to stdout [18736/18736] + 172.25.10.170 + 172.25.10.170 Downloading Chef 12 for ubuntu... + 172.25.10.170 downloading https://www.opscode.com/chef/metadata?v=12&prerelease=false&nightlies=false&p=ubuntu&pv=14.04&m=x86_64 + 172.25.10.170 to file /tmp/install.sh.26024/metadata.txt + 172.25.10.170 trying wget... + +After all we can see the vewly created node under the knife node list and new client list as it it will also creates a new client with the node. + + root@ubuntu-15-WKS:~# knife node list + mydns + +Similarly we can add multiple number of nodes to our chef infrastructure by providing ssh credentials with the same above knofe bootstrap command. + +### Conclusion ### + +In this detailed article we learnt about the Chef Configuration Management tool with its basic understanding and overview of its components with installation and configuration settings. We hope you have enjoyed learning the installation and configuration of Chef server with its workstation and client nodes. + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/ubuntu-how-to/install-configure-chef-ubuntu-14-04-15-04/ + +作者:[Kashif Siddique][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://linoxide.com/author/kashifs/ \ No newline at end of file diff --git a/sources/tech/20150717 Howto Configure FTP Server with Proftpd on Fedora 22.md b/sources/tech/20150717 Howto Configure FTP Server with Proftpd on Fedora 22.md new file mode 100644 index 0000000000..89094c1010 --- /dev/null +++ b/sources/tech/20150717 Howto Configure FTP Server with Proftpd on Fedora 22.md @@ -0,0 +1,185 @@ +Howto Configure FTP Server with Proftpd on Fedora 22 +================================================================================ +In this article, we'll learn about setting up an FTP server with Proftpd running Fedora 22 in our machine or server. [ProFTPD][1] is a free and open source FTP daemon software licensed under GPL. It is among most popular FTP server among machines running Linux. Its primary design aims to have an FTP server with many advanced features and provisioning users for more configuration options for easy customization. It includes a number of configuration options that are still not available with many other FTP daemons. It was initially developed by the developers as an alternative with better security and configuration to wu-ftpd server. An FTP server is a program that allows us to upload or download files and folders from a remote server where it is setup using an FTP client. Some of the features of ProFTPD daemon are as follows, you can check more features on [http://www.proftpd.org/features.html][2] . + +- It includes a per directory ".ftpaccess" access configuration similar to Apache's ".htaccess" +- It features multiple virtual FTP server with multiple users login and anonymous FTP services. +- It can be run either as a stand-alone server or from inetd/xinetd. +- Its ownership, file/folder attributes and file/folder permissions are UNIX-based. +- It can be run as standalone mode in order to protect the system from damage that can be caused from root access. +- The modular design of it makes it easily extensible with modules like LDAP servers, SSL/TLS encryption, RADIUS support, etc. +- IPv6 support is also included in the ProFTPD server. + +Here are some easy to perform steps on how we can setup an FTP Server with ProFTPD in Fedora 22 operating system. + +### 1. Installing ProFTPD ### + +First of all, we'll wanna install Proftpd server in our box running Fedora 22 as its operating system. As yum package manager has been depreciated, we'll use the latest and greatest built package manager called dnf. DNF is pretty easy to use and highly user friendly package manager available in Fedora 22. We'll simply use it to install proftpd daemon server. To do so, we'll need to run the following command in a terminal or a console in sudo mode. + + $ sudo dnf -y install proftpd proftpd-utils + +### 2. Configuring ProFTPD ### + +Now, we'll make changes to some configurations in the daemon. To configure the daemon, we will need to edit /etc/proftpd.conf with a text editor. The main configuration file of the ProFTPD daemon is **/etc/proftpd.conf** so, any changes made to this file will affect the FTP server. Here, are some changes we make in this initial step. + + $ sudo vi /etc/proftpd.conf + +Next, after we open the file using a text editor, we'll wanna make changes to the ServerName and ServerAdmin as hostname and email address respectively. Here's what we have made changes to those configs. + + ServerName "ftp.linoxide.com" + ServerAdmin arun@linoxide.com + +After that, we'll wanna the following lines into the configuration file so that it logs access & auth into its specified log files. + + ExtendedLog /var/log/proftpd/access.log WRITE,READ default + ExtendedLog /var/log/proftpd/auth.log AUTH auth + +![Configuring ProFTPD Config](http://blog.linoxide.com/wp-content/uploads/2015/06/configuring-proftpd-config.png) + +### 3. Adding FTP users ### + +After configure the basics of the configuration file, we'll surely wanna create an FTP user which is rooted at a specific directory we want. The current users that we use to login into our machine are automatically enabled with the FTP service, we can even use it to login into the FTP server. But, in this tutorial, we'll gonna create a new user with a specified home directory to the ftp server. + +Here, we'll create a new group named ftpgroup. + + $ sudo groupadd ftpgroup + +Then, we'll gonna add a new user arunftp into the group with home directory specified as /ftp-dir/ + + $ sudo useradd -G ftpgroup arunftp -s /sbin/nologin -d /ftp-dir/ + +After the user has been created and added to the group, we'll wanna set a password to the user arunftp. + + $ sudo passwd arunftp + + Changing password for user arunftp. + New password: + Retype new password: + passwd: all authentication tokens updated successfully. + +Now, we'll set read and write permission of the home directory by the ftp users by executing the following command. + + $ sudo setsebool -P allow_ftpd_full_access=1 + $ sudo setsebool -P ftp_home_dir=1 + +Then, we'll wanna make that directory and its contents unable to get removed or renamed by any other users. + + $ sudo chmod -R 1777 /ftp-dir/ + +### 4. Enabling TLS Support ### + +FTP is considered less secure in comparison to the latest encryption methods used these days as anybody sniffing the network card can read the data pass through FTP. So, we'll enable TLS Encryption support in our FTP server. To do so, we'll need to a edit /etc/proftpd.conf configuration file. Before that, we'll wanna backup our existing configuration file to make sure we can revert our configuration if any unexpected happens. + + $ sudo cp /etc/proftpd.conf /etc/proftpd.conf.bak + +Then, we'll wanna edit the configuration file using our favorite text editor. + + $ sudo vi /etc/proftpd.conf + +Then, we'll wanna add the following lines just below line we configured in step 2 . + + TLSEngine on + TLSRequired on + TLSProtocol SSLv23 + TLSLog /var/log/proftpd/tls.log + TLSRSACertificateFile /etc/pki/tls/certs/proftpd.pem + TLSRSACertificateKeyFile /etc/pki/tls/certs/proftpd.pem + +![Enabling TLS Configuration](http://blog.linoxide.com/wp-content/uploads/2015/06/tls-configuration.png) + +After finishing up with the configuration, we'll wanna save and exit it. + +Next, we'll need to generate the SSL certificates inside **/etc/pki/tls/certs/** directory as proftpd.pem. To do so, first we'll need to install openssl in our Fedora 22 machine. + + $ sudo dnf install openssl + +Then, we'll gonna generate the SSL certificate by running the following command. + + $ sudo openssl req -x509 -nodes -newkey rsa:2048 -keyout /etc/pki/tls/certs/proftpd.pem -out /etc/pki/tls/certs/proftpd.pem + +We'll be asked with some information that will be associated into the certificate. After completing the required information, it will generate a 2048 bit RSA private key. + + Generating a 2048 bit RSA private key + ...................+++ + ...................+++ + writing new private key to '/etc/pki/tls/certs/proftpd.pem' + ----- + You are about to be asked to enter information that will be incorporated + into your certificate request. + What you are about to enter is what is called a Distinguished Name or a DN. + There are quite a few fields but you can leave some blank + For some fields there will be a default value, + If you enter '.', the field will be left blank. + ----- + Country Name (2 letter code) [XX]:NP + State or Province Name (full name) []:Narayani + Locality Name (eg, city) [Default City]:Bharatpur + Organization Name (eg, company) [Default Company Ltd]:Linoxide + Organizational Unit Name (eg, section) []:Linux Freedom + Common Name (eg, your name or your server's hostname) []:ftp.linoxide.com + Email Address []:arun@linoxide.com + +After that, we'll gonna change the permission of the generated certificate file in order to secure it. + + $ sudo chmod 600 /etc/pki/tls/certs/proftpd.pem + +### 5. Allowing FTP through Firewall ### + +Now, we'll need to allow the ftp ports that are usually blocked by the firewall by default. So, we'll allow ports and enable access to the ftp through firewall. + +If **TLS/SSL Encryption is enabled** run the following command. + + $sudo firewall-cmd --add-port=1024-65534/tcp + $ sudo firewall-cmd --add-port=1024-65534/tcp --permanent + +If **TLS/SSL Encryption is disabled** run the following command. + + $ sudo firewall-cmd --permanent --zone=public --add-service=ftp + + success + +Then, we'll need to reload the firewall configuration. + + $ sudo firewall-cmd --reload + + success + +### 6. Starting and Enabling ProFTPD ### + +After everything is set, we'll finally start our ProFTPD and give it a try. To start the proftpd ftp daemon, we'll need to run the following command. + + $ sudo systemctl start proftpd.service + +Then, we'll wanna enable proftpd to start on every boot. + + $ sudo systemctl enable proftpd.service + + Created symlink from /etc/systemd/system/multi-user.target.wants/proftpd.service to /usr/lib/systemd/system/proftpd.service. + +### 7. Logging into the FTP server ### + +Now, if everything was configured and done as expected, we must be able to connect to the ftp server and login with the details we set above. Here, we'll gonna configure our FTP client, filezilla with hostname as **server's ip or url**, Protocol as **FTP**, User as **arunftp** and password as the one we set in above step 3. If you followed step 4 for enabling TLS support, then we'll need to set the Encryption type as **Require explicit FTP over TLS** but if you didn't follow step 4 and don't wanna use TLS encryption then set the Encryption type as **Plain FTP**. + +![FTP Login Details](http://blog.linoxide.com/wp-content/uploads/2015/06/ftp-login-details.png) + +To setup the above configuration, we'll need goto File which is under the Menu and then click on Site Manager in which we can click on new site then configure as illustrated above. + +![FTP SSL Certificate](http://blog.linoxide.com/wp-content/uploads/2015/06/ftp-ssl-certificate.png) + +Then, we're asked to accept the SSL certificate, that can be done by click OK. After that, we are able to upload and download required files and folders from our FTP server. + +### Conclusion ### + +Finally, we have successfully installed and configured our Fedora 22 box with Proftpd FTP server. Proftpd is an awesome powerful highly configurable and extensible FTP daemon. The above tutorial illustrates us how we can configure a secure FTP server with TLS encryption. It is highly recommended to configure FTP server with TLS encryption as it enables SSL certificate security to the data transfer and login. Here, we haven't configured anonymous access to the FTP cause they are usually not recommended in a protected FTP system. An FTP access makes pretty easy for people to upload and download at good efficient performance. We can even change the ports for the users for additional security. So, if you have any questions, suggestions, feedback please write them in the comment box below so that we can improve or update our contents. Thank you ! Enjoy :-) + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/linux-how-to/configure-ftp-proftpd-fedora-22/ + +作者:[Arun Pyasi][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://linoxide.com/author/arunp/ \ No newline at end of file From d429943363ec3a029f2ca63f90404896e842f607 Mon Sep 17 00:00:00 2001 From: DeadFire Date: Fri, 17 Jul 2015 13:04:07 +0800 Subject: [PATCH 619/965] =?UTF-8?q?20150717-1=20=E5=85=B6=E4=B8=AD?= =?UTF-8?q?=E4=B8=80=E7=AF=87=E5=BF=98=E8=AE=B0=E5=8A=A0=E9=93=BE=E6=8E=A5?= =?UTF-8?q?=E5=9C=B0=E5=9D=80=E4=BA=86=EF=BC=8C=E8=A1=A5=E4=B8=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...17 Howto Configure FTP Server with Proftpd on Fedora 22.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150717 Howto Configure FTP Server with Proftpd on Fedora 22.md b/sources/tech/20150717 Howto Configure FTP Server with Proftpd on Fedora 22.md index 89094c1010..f87bcd7745 100644 --- a/sources/tech/20150717 Howto Configure FTP Server with Proftpd on Fedora 22.md +++ b/sources/tech/20150717 Howto Configure FTP Server with Proftpd on Fedora 22.md @@ -182,4 +182,6 @@ via: http://linoxide.com/linux-how-to/configure-ftp-proftpd-fedora-22/ 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 -[a]:http://linoxide.com/author/arunp/ \ No newline at end of file +[a]:http://linoxide.com/author/arunp/ +[1]:http://www.proftpd.org/ +[2]:http://www.proftpd.org/features.html \ No newline at end of file From 83b701cf720f0e8d8083ac53d75d20d642c8de08 Mon Sep 17 00:00:00 2001 From: DeadFire Date: Fri, 17 Jul 2015 14:57:42 +0800 Subject: [PATCH 620/965] =?UTF-8?q?20150717-2=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ancer for Web Servers on RHEL or CentOS.md | 159 ++++++++++++++++++ 1 file changed, 159 insertions(+) create mode 100644 sources/tech/20150717 Setting Up 'XR' (Crossroads) Load Balancer for Web Servers on RHEL or CentOS.md diff --git a/sources/tech/20150717 Setting Up 'XR' (Crossroads) Load Balancer for Web Servers on RHEL or CentOS.md b/sources/tech/20150717 Setting Up 'XR' (Crossroads) Load Balancer for Web Servers on RHEL or CentOS.md new file mode 100644 index 0000000000..6aba5e897e --- /dev/null +++ b/sources/tech/20150717 Setting Up 'XR' (Crossroads) Load Balancer for Web Servers on RHEL or CentOS.md @@ -0,0 +1,159 @@ +Setting Up ‘XR’ (Crossroads) Load Balancer for Web Servers on RHEL/CentOS +================================================================================ +Crossroads is a service independent, open source load balance and fail-over utility for Linux and TCP based services. It can be used for HTTP, HTTPS, SSH, SMTP and DNS etc. It is also a multi-threaded utility which consumes only one memory space which leads to increase the performance when balancing load. + +Let’s have a look at how XR works. We can locate XR between network clients and a nest of servers which dispatches client requests to the servers balancing the load. + +If a server is down, XR forwards next client request to the next server in line, so client feels no down time. Have a look at the below diagram to understand what kind of a situation we are going to handle with XR. + +![Install XR Crossroads Load Balancer](http://www.tecmint.com/wp-content/uploads/2015/07/Install-XR-Crossroads-Load-Balancer.jpg) + +Install XR Crossroads Load Balancer + +There are two web-servers, one gateway server which we install and setup XR to receive client requests and distribute them among the servers. + + XR Crossroads Gateway Server : 172.16.1.204 + Web Server 01 : 172.16.1.222 + Web Server 02 : 192.168.1.161 + +In above scenario, my gateway server (i.e XR Crossroads) bears the IP address 172.16.1.222, webserver01 is 172.16.1.222 and it listens through port 8888 and webserver02 is 192.168.1.161 and it listens through port 5555. + +Now all I need is to balance the load of all the requests that receives by the XR gateway from internet and distribute them among two web-servers balancing the load. + +### Step1: Install XR Crossroads Load Balancer on Gateway Server ### + +**1. Unfortunately, there isn’t any binary RPM packages available for crosscroads, the only way to install XR crossroads from source tarball.** + +To compile XR, you must have C++ compiler and Gnu make utilities installed on the system in order to continue installation error free. + + # yum install gcc gcc-c++ make + +Next, download the source tarball by going to their official site ([https://crossroads.e-tunity.com][1]), and grab the archived package (i.e. crossroads-stable.tar.gz). + +Alternatively, you use following wget utility to download the package and extract it in any location (eg: /usr/src/), go to unpacked directory and issue “make install” command. + + # wget https://crossroads.e-tunity.com/downloads/crossroads-stable.tar.gz + # tar -xvf crossroads-stable.tar.gz + # cd crossroads-2.74/ + # make install + +![Install XR Crossroads Load Balancer](http://www.tecmint.com/wp-content/uploads/2015/07/Install-XR-Crossroads-Load-Balancer.png) + +Install XR Crossroads Load Balancer + +After installation finishes, the binary files are created under /usr/sbin/ and XR configuration within /etc namely “xrctl.xml”. + +**2. As the last prerequisite, you need two web-servers. For ease of use, I have created two python SimpleHTTPServer instances in one server.** + +To see how to setup a python SimpleHTTPServer, read our article at [Create Two Web Servers Easily Using SimpleHTTPServer][2]. + +As I said, we’re using two web-servers, and they are webserver01 running on 172.16.1.222 through port 8888 and webserver02 running on 192.168.1.161 through port 5555. + +![XR WebServer 01](http://www.tecmint.com/wp-content/uploads/2015/07/XR-WebServer01.jpg) + +XR WebServer 01 + +![XR WebServer 02](http://www.tecmint.com/wp-content/uploads/2015/07/XR-WebServer02.jpg) + +XR WebServer 02 + +### Step 2: Configure XR Crossroads Load Balancer ### + +**3. All requisites are in place. Now what we have to do is configure the `xrctl.xml` file to distribute the load among the web-servers which receives by the XR server from the internet.** + +Now open `xrctl.xml` file with [vi/vim editor][3]. + + # vim /etc/xrctl.xml + +and make the changes as suggested below. + + 1.0<94> encoding=<94>UTF-8<94>?> + + + true + /tmp + + + Tecmint + +

172.16.1.204:8080
+ tcp + 0:8010 + yes + 0 + 0 + 0 + 0 + + +
172.16.1.222:8888
+
+ +
192.168.1.161:5555
+
+ + + +![Configure XR Crossroads Load Balancer](http://www.tecmint.com/wp-content/uploads/2015/07/Configure-XR-Crossroads-Load-Balancer.jpg) + +Configure XR Crossroads Load Balancer + +Here, you can see a very basic XR configuration done within xrctl.xml. I have defined what the XR server is, what are the back end servers and their ports and web interface port for the XR. + +**4. Now you need to start the XR daemon by issuing below commands.** + + # xrctl start + # xrctl status + +![Start XR Crossroads](http://www.tecmint.com/wp-content/uploads/2015/07/Start-XR-Crossroads.jpg) + +Start XR Crossroads + +**5. Okay great. Now it’s time to check whether the configs are working fine. Open two web browsers and enter the IP address of the XR server with port and see the output.** + +![Verify Web Server Load Balancing](http://www.tecmint.com/wp-content/uploads/2015/07/Verify-Web-Server-Load-Balancing.jpg) + +Verify Web Server Load Balancing + +Fantastic. It works fine. now it’s time to play with XR. + +**6. Now it’s time to login into XR Crossroads dashboard and see the port we’ve configured for web-interface. Enter your XR server’s IP address with the port number for web-interface you have configured in xrctl.xml.** + + http://172.16.1.204:8010 + +![XR Crossroads Dashboard](http://www.tecmint.com/wp-content/uploads/2015/07/XR-Crossroads-Dashboard.jpg) + +XR Crossroads Dashboard + +This is what it looks like. It’s easy to understand, user-friendly and easy to use. It shows how many connections each back end server received in the top right corner along with the additional details regarding the requests receiving. Even you can set the load weight each server you need to bear, maximum number of connections and load average etc.. + +The best part is, you actually can do this even without configuring xrctl.xml. Only thing you have to do is issue the command with following syntax and it will do the job done. + + # xr --verbose --server tcp:172.16.1.204:8080 --backend 172.16.1.222:8888 --backend 192.168.1.161:5555 + +Explanation of above syntax in detail: + +- –verbose will show what happens when the command has executed. +- –server defines the XR server you have installed the package in. +- –backend defines the webservers you need to balance the traffic to. +- Tcp defines it uses tcp services. + +For more details, about documentations and configuration of CROSSROADS, please visit their official site at: [https://crossroads.e-tunity.com/][4]. + +XR Corssroads enables many ways to enhance your server performance, protect downtime’s and make your admin tasks easier and handier. Hope you enjoyed the guide and feel free to comment below for the suggestions and clarifications. Keep in touch with Tecmint for handy How To’s. + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/setting-up-xr-crossroads-load-balancer-for-web-servers-on-rhel-centos/ + +作者:[Thilina Uvindasiri][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/thilidhanushka/ +[1]:https://crossroads.e-tunity.com/ +[2]:http://www.tecmint.com/python-simplehttpserver-to-create-webserver-or-serve-files-instantly/ +[3]:http://www.tecmint.com/vi-editor-usage/ +[4]:https://crossroads.e-tunity.com/ \ No newline at end of file From 506034fcc52aa96531d1093dbc639799a2d8e55f Mon Sep 17 00:00:00 2001 From: DeadFire Date: Fri, 17 Jul 2015 15:00:33 +0800 Subject: [PATCH 621/965] =?UTF-8?q?20150717-3=20=E9=80=89=E9=A2=98=20=20NG?= =?UTF-8?q?INX=20=E4=B8=93=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...7 How to collect NGINX metrics - Part 2.md | 237 ++++++++++ ... to monitor NGINX with Datadog - Part 3.md | 150 +++++++ .../20150717 How to monitor NGINX- Part 1.md | 408 ++++++++++++++++++ 3 files changed, 795 insertions(+) create mode 100644 sources/tech/20150717 How to collect NGINX metrics - Part 2.md create mode 100644 sources/tech/20150717 How to monitor NGINX with Datadog - Part 3.md create mode 100644 sources/tech/20150717 How to monitor NGINX- Part 1.md diff --git a/sources/tech/20150717 How to collect NGINX metrics - Part 2.md b/sources/tech/20150717 How to collect NGINX metrics - Part 2.md new file mode 100644 index 0000000000..8d83b3a0f6 --- /dev/null +++ b/sources/tech/20150717 How to collect NGINX metrics - Part 2.md @@ -0,0 +1,237 @@ +How to collect NGINX metrics - Part 2 +================================================================================ +![](http://www.datadoghq.com/wp-content/uploads/2015/07/NGINX_hero_2.png) + +### How to get the NGINX metrics you need ### + +How you go about capturing metrics depends on which version of NGINX you are using, as well as which metrics you wish to access. (See [the companion article][1] for an in-depth exploration of NGINX metrics.) Free, open-source NGINX and the commercial product NGINX Plus both have status modules that report metrics, and NGINX can also be configured to report certain metrics in its logs: + +注:表格 + +++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
MetricAvailability
NGINX (open-source)NGINX PlusNGINX logs
accepts / acceptedxx
handledxx
droppedxx
activexx
requests / totalxx
4xx codesxx
5xx codesxx
request timex
+ +#### Metrics collection: NGINX (open-source) #### + +Open-source NGINX exposes several basic metrics about server activity on a simple status page, provided that you have the HTTP [stub status module][2] enabled. To check if the module is already enabled, run: + + nginx -V 2>&1 | grep -o with-http_stub_status_module + +The status module is enabled if you see with-http_stub_status_module as output in the terminal. + +If that command returns no output, you will need to enable the status module. You can use the --with-http_stub_status_module configuration parameter when [building NGINX from source][3]: + + ./configure \ + … \ + --with-http_stub_status_module + make + sudo make install + +After verifying the module is enabled or enabling it yourself, you will also need to modify your NGINX configuration to set up a locally accessible URL (e.g., /nginx_status) for the status page: + + server { + location /nginx_status { + stub_status on; + + access_log off; + allow 127.0.0.1; + deny all; + } + } + +Note: The server blocks of the NGINX config are usually found not in the master configuration file (e.g., /etc/nginx/nginx.conf) but in supplemental configuration files that are referenced by the master config. To find the relevant configuration files, first locate the master config by running: + + nginx -t + +Open the master configuration file listed, and look for lines beginning with include near the end of the http block, such as: + + include /etc/nginx/conf.d/*.conf; + +In one of the referenced config files you should find the main server block, which you can modify as above to configure NGINX metrics reporting. After changing any configurations, reload the configs by executing: + + nginx -s reload + +Now you can view the status page to see your metrics: + + Active connections: 24 + server accepts handled requests + 1156958 1156958 4491319 + Reading: 0 Writing: 18 Waiting : 6 + +Note that if you are trying to access the status page from a remote machine, you will need to whitelist the remote machine’s IP address in your status configuration, just as 127.0.0.1 is whitelisted in the configuration snippet above. + +The NGINX status page is an easy way to get a quick snapshot of your metrics, but for continuous monitoring you will need to automatically record that data at regular intervals. Parsers for the NGINX status page already exist for monitoring tools such as [Nagios][4] and [Datadog][5], as well as for the statistics collection daemon [collectD][6]. + +#### Metrics collection: NGINX Plus #### + +The commercial NGINX Plus provides [many more metrics][7] through its ngx_http_status_module than are available in open-source NGINX. Among the additional metrics exposed by NGINX Plus are bytes streamed, as well as information about upstream systems and caches. NGINX Plus also reports counts of all HTTP status code types (1xx, 2xx, 3xx, 4xx, 5xx). A sample NGINX Plus status board is available [here][8]. + +![NGINX Plus status board](https://d33tyra1llx9zy.cloudfront.net/blog/images/2015-06-nginx/status_plus-2.png) + +*Note: the “Active” connections on the NGINX Plus status dashboard are defined slightly differently than the Active state connections in the metrics collected via the open-source NGINX stub status module. In NGINX Plus metrics, Active connections do not include connections in the Waiting state (aka Idle connections).* + +NGINX Plus also reports [metrics in JSON format][9] for easy integration with other monitoring systems. With NGINX Plus, you can see the metrics and health status [for a given upstream grouping of servers][10], or drill down to get a count of just the response codes [from a single server][11] in that upstream: + + {"1xx":0,"2xx":3483032,"3xx":0,"4xx":23,"5xx":0,"total":3483055} + +To enable the NGINX Plus metrics dashboard, you can add a status server block inside the http block of your NGINX configuration. ([See the section above][12] on collecting metrics from open-source NGINX for instructions on locating the relevant config files.) For example, to set up a status dashboard at http://your.ip.address:8080/status.html and a JSON interface at http://your.ip.address:8080/status, you would add the following server block: + + server { + listen 8080; + root /usr/share/nginx/html; + + location /status { + status; + } + + location = /status.html { + } + } + +The status pages should be live once you reload your NGINX configuration: + + nginx -s reload + +The official NGINX Plus docs have [more details][13] on how to configure the expanded status module. + +#### Metrics collection: NGINX logs #### + +NGINX’s [log module][14] writes configurable access logs to a destination of your choosing. You can customize the format of your logs and the data they contain by [adding or subtracting variables][15]. The simplest way to capture detailed logs is to add the following line in the server block of your config file (see [the section][16] on collecting metrics from open-source NGINX for instructions on locating your config files): + + access_log logs/host.access.log combined; + +After changing any NGINX configurations, reload the configs by executing: + + nginx -s reload + +The “combined” log format, included by default, captures [a number of key data points][17], such as the actual HTTP request and the corresponding response code. In the example logs below, NGINX logged a 200 (success) status code for a request for /index.html and a 404 (not found) error for the nonexistent /fail. + + 127.0.0.1 - - [19/Feb/2015:12:10:46 -0500] "GET /index.html HTTP/1.1" 200 612 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.111 Safari 537.36" + + 127.0.0.1 - - [19/Feb/2015:12:11:05 -0500] "GET /fail HTTP/1.1" 404 570 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.111 Safari/537.36" + +You can log request processing time as well by adding a new log format to the http block of your NGINX config file: + + log_format nginx '$remote_addr - $remote_user [$time_local] ' + '"$request" $status $body_bytes_sent $request_time ' + '"$http_referer" "$http_user_agent"'; + +And by adding or modifying the access_log line in the server block of your config file: + + access_log logs/host.access.log nginx; + +After reloading the updated configs (by running nginx -s reload), your access logs will include response times, as seen below. The units are seconds, with millisecond resolution. In this instance, the server received a request for /big.pdf, returning a 206 (success) status code after sending 33973115 bytes. Processing the request took 0.202 seconds (202 milliseconds): + + 127.0.0.1 - - [19/Feb/2015:15:50:36 -0500] "GET /big.pdf HTTP/1.1" 206 33973115 0.202 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.111 Safari/537.36" + +You can use a variety of tools and services to parse and analyze NGINX logs. For instance, [rsyslog][18] can monitor your logs and pass them to any number of log-analytics services; you can use a free, open-source tool such as [logstash][19] to collect and analyze logs; or you can use a unified logging layer such as [Fluentd][20] to collect and parse your NGINX logs. + +### Conclusion ### + +Which NGINX metrics you monitor will depend on the tools available to you, and whether the insight provided by a given metric justifies the overhead of monitoring that metric. For instance, is measuring error rates important enough to your organization to justify investing in NGINX Plus or implementing a system to capture and analyze logs? + +At Datadog, we have built integrations with both NGINX and NGINX Plus so that you can begin collecting and monitoring metrics from all your web servers with a minimum of setup. Learn how to monitor NGINX with Datadog [in this post][21], and get started right away with a [free trial of Datadog][22]. + +---------- + +Source Markdown for this post is available [on GitHub][23]. Questions, corrections, additions, etc.? Please [let us know][24]. + +-------------------------------------------------------------------------------- + +via: https://www.datadoghq.com/blog/how-to-collect-nginx-metrics/ + +作者:K Young +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[1]:https://www.datadoghq.com/blog/how-to-monitor-nginx/ +[2]:http://nginx.org/en/docs/http/ngx_http_stub_status_module.html +[3]:http://wiki.nginx.org/InstallOptions +[4]:https://exchange.nagios.org/directory/Plugins/Web-Servers/nginx +[5]:http://docs.datadoghq.com/integrations/nginx/ +[6]:https://collectd.org/wiki/index.php/Plugin:nginx +[7]:http://nginx.org/en/docs/http/ngx_http_status_module.html#data +[8]:http://demo.nginx.com/status.html +[9]:http://demo.nginx.com/status +[10]:http://demo.nginx.com/status/upstreams/demoupstreams +[11]:http://demo.nginx.com/status/upstreams/demoupstreams/0/responses +[12]:https://www.datadoghq.com/blog/how-to-collect-nginx-metrics/#open-source +[13]:http://nginx.org/en/docs/http/ngx_http_status_module.html#example +[14]:http://nginx.org/en/docs/http/ngx_http_log_module.html +[15]:http://nginx.org/en/docs/http/ngx_http_log_module.html#log_format +[16]:https://www.datadoghq.com/blog/how-to-collect-nginx-metrics/#open-source +[17]:http://nginx.org/en/docs/http/ngx_http_log_module.html#log_format +[18]:http://www.rsyslog.com/ +[19]:https://www.elastic.co/products/logstash +[20]:http://www.fluentd.org/ +[21]:https://www.datadoghq.com/blog/how-to-monitor-nginx-with-datadog/ +[22]:https://www.datadoghq.com/blog/how-to-collect-nginx-metrics/#sign-up +[23]:https://github.com/DataDog/the-monitor/blob/master/nginx/how_to_collect_nginx_metrics.md +[24]:https://github.com/DataDog/the-monitor/issues \ No newline at end of file diff --git a/sources/tech/20150717 How to monitor NGINX with Datadog - Part 3.md b/sources/tech/20150717 How to monitor NGINX with Datadog - Part 3.md new file mode 100644 index 0000000000..949fd3d949 --- /dev/null +++ b/sources/tech/20150717 How to monitor NGINX with Datadog - Part 3.md @@ -0,0 +1,150 @@ +How to monitor NGINX with Datadog - Part 3 +================================================================================ +![](http://www.datadoghq.com/wp-content/uploads/2015/07/NGINX_hero_3.png) + +If you’ve already read [our post on monitoring NGINX][1], you know how much information you can gain about your web environment from just a handful of metrics. And you’ve also seen just how easy it is to start collecting metrics from NGINX on ad hoc basis. But to implement comprehensive, ongoing NGINX monitoring, you will need a robust monitoring system to store and visualize your metrics, and to alert you when anomalies happen. In this post, we’ll show you how to set up NGINX monitoring in Datadog so that you can view your metrics on customizable dashboards like this: + +![NGINX dashboard](https://d33tyra1llx9zy.cloudfront.net/blog/images/2015-06-nginx/nginx_board_5.png) + +Datadog allows you to build graphs and alerts around individual hosts, services, processes, metrics—or virtually any combination thereof. For instance, you can monitor all of your NGINX hosts, or all hosts in a certain availability zone, or you can monitor a single key metric being reported by all hosts with a certain tag. This post will show you how to: + +- Monitor NGINX metrics on Datadog dashboards, alongside all your other systems +- Set up automated alerts to notify you when a key metric changes dramatically + +### Configuring NGINX ### + +To collect metrics from NGINX, you first need to ensure that NGINX has an enabled status module and a URL for reporting its status metrics. Step-by-step instructions [for configuring open-source NGINX][2] and [NGINX Plus][3] are available in our companion post on metric collection. + +### Integrating Datadog and NGINX ### + +#### Install the Datadog Agent #### + +The Datadog Agent is [the open-source software][4] that collects and reports metrics from your hosts so that you can view and monitor them in Datadog. Installing the agent usually takes [just a single command][5]. + +As soon as your Agent is up and running, you should see your host reporting metrics [in your Datadog account][6]. + +![Datadog infrastructure list](https://d33tyra1llx9zy.cloudfront.net/blog/images/2015-06-nginx/infra_2.png) + +#### Configure the Agent #### + +Next you’ll need to create a simple NGINX configuration file for the Agent. The location of the Agent’s configuration directory for your OS can be found [here][7]. + +Inside that directory, at conf.d/nginx.yaml.example, you will find [a sample NGINX config file][8] that you can edit to provide the status URL and optional tags for each of your NGINX instances: + + init_config: + + instances: + + - nginx_status_url: http://localhost/nginx_status/ + tags: + - instance:foo + +Once you have supplied the status URLs and any tags, save the config file as conf.d/nginx.yaml. + +#### Restart the Agent #### + +You must restart the Agent to load your new configuration file. The restart command varies somewhat by platform—see the specific commands for your platform [here][9]. + +#### Verify the configuration settings #### + +To check that Datadog and NGINX are properly integrated, run the Datadog info command. The command for each platform is available [here][10]. + +If the configuration is correct, you will see a section like this in the output: + + Checks + ====== + + [...] + + nginx + ----- + - instance #0 [OK] + - Collected 8 metrics & 0 events + +#### Install the integration #### + +Finally, switch on the NGINX integration inside your Datadog account. It’s as simple as clicking the “Install Integration” button under the Configuration tab in the [NGINX integration settings][11]. + +![Install integration](https://d33tyra1llx9zy.cloudfront.net/blog/images/2015-06-nginx/install.png) + +### Metrics! ### + +Once the Agent begins reporting NGINX metrics, you will see [an NGINX dashboard][12] among your list of available dashboards in Datadog. + +The basic NGINX dashboard displays a handful of graphs encapsulating most of the key metrics highlighted [in our introduction to NGINX monitoring][13]. (Some metrics, notably request processing time, require log analysis and are not available in Datadog.) + +You can easily create a comprehensive dashboard for monitoring your entire web stack by adding additional graphs with important metrics from outside NGINX. For example, you might want to monitor host-level metrics on your NGINX hosts, such as system load. To start building a custom dashboard, simply clone the default NGINX dashboard by clicking on the gear near the upper right of the dashboard and selecting “Clone Dash”. + +![Clone dash](https://d33tyra1llx9zy.cloudfront.net/blog/images/2015-06-nginx/clone_2.png) + +You can also monitor your NGINX instances at a higher level using Datadog’s [Host Maps][14]—for instance, color-coding all your NGINX hosts by CPU usage to identify potential hotspots. + +![](https://d33tyra1llx9zy.cloudfront.net/blog/images/2015-06-nginx/nginx-host-map-3.png) + +### Alerting on NGINX metrics ### + +Once Datadog is capturing and visualizing your metrics, you will likely want to set up some monitors to automatically keep tabs on your metrics—and to alert you when there are problems. Below we’ll walk through a representative example: a metric monitor that alerts on sudden drops in NGINX throughput. + +#### Monitor your NGINX throughput #### + +Datadog metric alerts can be threshold-based (alert when the metric exceeds a set value) or change-based (alert when the metric changes by a certain amount). In this case we’ll take the latter approach, alerting when our incoming requests per second drop precipitously. Such drops are often indicative of problems. + +1.**Create a new metric monitor**. Select “New Monitor” from the “Monitors” dropdown in Datadog. Select “Metric” as the monitor type. + +![NGINX metric monitor](https://d33tyra1llx9zy.cloudfront.net/blog/images/2015-06-nginx/monitor2_step_1.png) + +2.**Define your metric monitor**. We want to know when our total NGINX requests per second drop by a certain amount. So we define the metric of interest to be the sum of nginx.net.request_per_s across our infrastructure. + +![NGINX metric](https://d33tyra1llx9zy.cloudfront.net/blog/images/2015-06-nginx/monitor2_step_2.png) + +3.**Set metric alert conditions**. Since we want to alert on a change, rather than on a fixed threshold, we select “Change Alert.” We’ll set the monitor to alert us whenever the request volume drops by 30 percent or more. Here we use a one-minute window of data to represent the metric’s value “now” and alert on the average change across that interval, as compared to the metric’s value 10 minutes prior. + +![NGINX metric change alert](https://d33tyra1llx9zy.cloudfront.net/blog/images/2015-06-nginx/monitor2_step_3.png) + +4.**Customize the notification**. If our NGINX request volume drops, we want to notify our team. In this case we will post a notification in the ops team’s chat room and page the engineer on call. In “Say what’s happening”, we name the monitor and add a short message that will accompany the notification to suggest a first step for investigation. We @mention the Slack channel that we use for ops and use @pagerduty to [route the alert to PagerDuty][15] + +![NGINX metric notification](https://d33tyra1llx9zy.cloudfront.net/blog/images/2015-06-nginx/monitor2_step_4v3.png) + +5.**Save the integration monitor**. Click the “Save” button at the bottom of the page. You’re now monitoring a key NGINX [work metric][16], and your on-call engineer will be paged anytime it drops rapidly. + +### Conclusion ### + +In this post we’ve walked you through integrating NGINX with Datadog to visualize your key metrics and notify your team when your web infrastructure shows signs of trouble. + +If you’ve followed along using your own Datadog account, you should now have greatly improved visibility into what’s happening in your web environment, as well as the ability to create automated monitors tailored to your environment, your usage patterns, and the metrics that are most valuable to your organization. + +If you don’t yet have a Datadog account, you can sign up for [a free trial][17] and start monitoring your infrastructure, your applications, and your services today. + +---------- + +Source Markdown for this post is available [on GitHub][18]. Questions, corrections, additions, etc.? Please [let us know][19]. + +------------------------------------------------------------ + +via: https://www.datadoghq.com/blog/how-to-monitor-nginx-with-datadog/ + +作者:K Young +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[1]:https://www.datadoghq.com/blog/how-to-monitor-nginx/ +[2]:https://www.datadoghq.com/blog/how-to-collect-nginx-metrics/#open-source +[3]:https://www.datadoghq.com/blog/how-to-collect-nginx-metrics/#plus +[4]:https://github.com/DataDog/dd-agent +[5]:https://app.datadoghq.com/account/settings#agent +[6]:https://app.datadoghq.com/infrastructure +[7]:http://docs.datadoghq.com/guides/basic_agent_usage/ +[8]:https://github.com/DataDog/dd-agent/blob/master/conf.d/nginx.yaml.example +[9]:http://docs.datadoghq.com/guides/basic_agent_usage/ +[10]:http://docs.datadoghq.com/guides/basic_agent_usage/ +[11]:https://app.datadoghq.com/account/settings#integrations/nginx +[12]:https://app.datadoghq.com/dash/integration/nginx +[13]:https://www.datadoghq.com/blog/how-to-monitor-nginx/ +[14]:https://www.datadoghq.com/blog/introducing-host-maps-know-thy-infrastructure/ +[15]:https://www.datadoghq.com/blog/pagerduty/ +[16]:https://www.datadoghq.com/blog/monitoring-101-collecting-data/#metrics +[17]:https://www.datadoghq.com/blog/how-to-monitor-nginx-with-datadog/#sign-up +[18]:https://github.com/DataDog/the-monitor/blob/master/nginx/how_to_monitor_nginx_with_datadog.md +[19]:https://github.com/DataDog/the-monitor/issues \ No newline at end of file diff --git a/sources/tech/20150717 How to monitor NGINX- Part 1.md b/sources/tech/20150717 How to monitor NGINX- Part 1.md new file mode 100644 index 0000000000..25270eb5cb --- /dev/null +++ b/sources/tech/20150717 How to monitor NGINX- Part 1.md @@ -0,0 +1,408 @@ +How to monitor NGINX - Part 1 +================================================================================ +![](http://www.datadoghq.com/wp-content/uploads/2015/07/NGINX_hero_1.png) + +### What is NGINX? ### + +[NGINX][1] (pronounced “engine X”) is a popular HTTP server and reverse proxy server. As an HTTP server, NGINX serves static content very efficiently and reliably, using relatively little memory. As a [reverse proxy][2], it can be used as a single, controlled point of access for multiple back-end servers or for additional applications such as caching and load balancing. NGINX is available as a free, open-source product or in a more full-featured, commercially distributed version called NGINX Plus. + +NGINX can also be used as a mail proxy and a generic TCP proxy, but this article does not directly address NGINX monitoring for these use cases. + +### Key NGINX metrics ### + +By monitoring NGINX you can catch two categories of issues: resource issues within NGINX itself, and also problems developing elsewhere in your web infrastructure. Some of the metrics most NGINX users will benefit from monitoring include **requests per second**, which provides a high-level view of combined end-user activity; **server error rate**, which indicates how often your servers are failing to process seemingly valid requests; and **request processing time**, which describes how long your servers are taking to process client requests (and which can point to slowdowns or other problems in your environment). + +More generally, there are at least three key categories of metrics to watch: + +- Basic activity metrics +- Error metrics +- Performance metrics + +Below we’ll break down a few of the most important NGINX metrics in each category, as well as metrics for a fairly common use case that deserves special mention: using NGINX Plus for reverse proxying. We will also describe how you can monitor all of these metrics with your graphing or monitoring tools of choice. + +This article references metric terminology [introduced in our Monitoring 101 series][3], which provides a framework for metric collection and alerting. + +#### Basic activity metrics #### + +Whatever your NGINX use case, you will no doubt want to monitor how many client requests your servers are receiving and how those requests are being processed. + +NGINX Plus can report basic activity metrics exactly like open-source NGINX, but it also provides a secondary module that reports metrics slightly differently. We discuss open-source NGINX first, then the additional reporting capabilities provided by NGINX Plus. + +**NGINX** + +The diagram below shows the lifecycle of a client connection and how the open-source version of NGINX collects metrics during a connection. + +![connection, request states](https://d33tyra1llx9zy.cloudfront.net/blog/images/2015-06-nginx/nginx_connection_diagram-2.png) + +Accepts, handled, and requests are ever-increasing counters. Active, waiting, reading, and writing grow and shrink with request volume. + +注:表格 + ++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDescriptionMetric type
acceptsCount of client connections attempted by NGINXResource: Utilization
handledCount of successful client connectionsResource: Utilization
activeCurrently active client connectionsResource: Utilization
dropped (calculated)Count of dropped connections (accepts – handled)Work: Errors*
requestsCount of client requestsWork: Throughput
*Strictly speaking, dropped connections is a metric of resource saturation, but since saturation causes NGINX to stop servicing some work (rather than queuing it up for later), “dropped” is best thought of as a work metric.
+ +The **accepts** counter is incremented when an NGINX worker picks up a request for a connection from the OS, whereas **handled** is incremented when the worker actually gets a connection for the request (by establishing a new connection or reusing an open one). These two counts are usually the same—any divergence indicates that connections are being **dropped**, often because a resource limit, such as NGINX’s [worker_connections][4] limit, has been reached. + +Once NGINX successfully handles a connection, the connection moves to an **active** state, where it remains as client requests are processed: + +Active state + +- **Waiting**: An active connection may also be in a Waiting substate if there is no active request at the moment. New connections can bypass this state and move directly to Reading, most commonly when using “accept filter” or “deferred accept”, in which case NGINX does not receive notice of work until it has enough data to begin working on the response. Connections will also be in the Waiting state after sending a response if the connection is set to keep-alive. +- **Reading**: When a request is received, the connection moves out of the waiting state, and the request itself is counted as Reading. In this state NGINX is reading a client request header. Request headers are lightweight, so this is usually a fast operation. +- **Writing**: After the request is read, it is counted as Writing, and remains in that state until a response is returned to the client. That means that the request is Writing while NGINX is waiting for results from upstream systems (systems “behind” NGINX), and while NGINX is operating on the response. Requests will often spend the majority of their time in the Writing state. + +Often a connection will only support one request at a time. In this case, the number of Active connections == Waiting connections + Reading requests + Writing requests. However, the newer SPDY and HTTP/2 protocols allow multiple concurrent requests/responses to be multiplexed over a connection, so Active may be less than the sum of Waiting, Reading, and Writing. (As of this writing, NGINX does not support HTTP/2, but expects to add support during 2015.) + +**NGINX Plus** + +As mentioned above, all of open-source NGINX’s metrics are available within NGINX Plus, but Plus can also report additional metrics. The section covers the metrics that are only available from NGINX Plus. + +![connection, request states](https://d33tyra1llx9zy.cloudfront.net/blog/images/2015-06-nginx/nginx_plus_connection_diagram-2.png) + +Accepted, dropped, and total are ever-increasing counters. Active, idle, and current track the current number of connections or requests in each of those states, so they grow and shrink with request volume. + +注:表格 + ++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDescriptionMetric type
acceptedCount of client connections attempted by NGINXResource: Utilization
droppedCount of dropped connectionsWork: Errors*
activeCurrently active client connectionsResource: Utilization
idleClient connections with zero current requestsResource: Utilization
totalCount of client requestsWork: Throughput
*Strictly speaking, dropped connections is a metric of resource saturation, but since saturation causes NGINX to stop servicing some work (rather than queuing it up for later), “dropped” is best thought of as a work metric.
+ +The **accepted** counter is incremented when an NGINX Plus worker picks up a request for a connection from the OS. If the worker fails to get a connection for the request (by establishing a new connection or reusing an open one), then the connection is dropped and **dropped** is incremented. Ordinarily connections are dropped because a resource limit, such as NGINX Plus’s [worker_connections][4] limit, has been reached. + +**Active** and **idle** are the same as “active” and “waiting” states in open-source NGINX as described [above][5], with one key exception: in open-source NGINX, “waiting” falls under the “active” umbrella, whereas in NGINX Plus “idle” connections are excluded from the “active” count. **Current** is the same as the combined “reading + writing” states in open-source NGINX. + +**Total** is a cumulative count of client requests. Note that a single client connection can involve multiple requests, so this number may be significantly larger than the cumulative number of connections. In fact, (total / accepted) yields the average number of requests per connection. + +**Metric differences between Open-Source and Plus** + +注:表格 + +++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NGINX (open-source)NGINX Plus
acceptsaccepted
dropped must be calculateddropped is reported directly
reading + writingcurrent
waitingidle
active (includes “waiting” states)active (excludes “idle” states)
requeststotal
+ +**Metric to alert on: Dropped connections** + +The number of connections that have been dropped is equal to the difference between accepts and handled (NGINX) or is exposed directly as a standard metric (NGINX Plus). Under normal circumstances, dropped connections should be zero. If your rate of dropped connections per unit time starts to rise, look for possible resource saturation. + +![Dropped connections](https://d33tyra1llx9zy.cloudfront.net/blog/images/2015-06-nginx/dropped_connections.png) + +**Metric to alert on: Requests per second** + +Sampling your request data (**requests** in open-source, or **total** in Plus) with a fixed time interval provides you with the number of requests you’re receiving per unit of time—often minutes or seconds. Monitoring this metric can alert you to spikes in incoming web traffic, whether legitimate or nefarious, or sudden drops, which are usually indicative of problems. A drastic change in requests per second can alert you to problems brewing somewhere in your environment, even if it cannot tell you exactly where those problems lie. Note that all requests are counted the same, regardless of their URLs. + +![Requests per second](https://d33tyra1llx9zy.cloudfront.net/blog/images/2015-06-nginx/requests_per_sec.png) + +**Collecting activity metrics** + +Open-source NGINX exposes these basic server metrics on a simple status page. Because the status information is displayed in a standardized form, virtually any graphing or monitoring tool can be configured to parse the relevant data for analysis, visualization, or alerting. NGINX Plus provides a JSON feed with much richer data. Read the companion post on [NGINX metrics collection][6] for instructions on enabling metrics collection. + +#### Error metrics #### + +注:表格 + +++++ + + + + + + + + + + + + + + + + + + + + + + +
NameDescriptionMetric typeAvailability
4xx codesCount of client errorsWork: ErrorsNGINX logs, NGINX Plus
5xx codesCount of server errorsWork: ErrorsNGINX logs, NGINX Plus
+ +NGINX error metrics tell you how often your servers are returning errors instead of producing useful work. Client errors are represented by 4xx status codes, server errors with 5xx status codes. + +**Metric to alert on: Server error rate** + +Your server error rate is equal to the number of 5xx errors divided by the total number of [status codes][7] (1xx, 2xx, 3xx, 4xx, 5xx), per unit of time (often one to five minutes). If your error rate starts to climb over time, investigation may be in order. If it spikes suddenly, urgent action may be required, as clients are likely to report errors to the end user. + +![Server error rate](https://d33tyra1llx9zy.cloudfront.net/blog/images/2015-06-nginx/5xx_rate.png) + +A note on client errors: while it is tempting to monitor 4xx, there is limited information you can derive from that metric since it measures client behavior without offering any insight into particular URLs. In other words, a change in 4xx could be noise, e.g. web scanners blindly looking for vulnerabilities. + +**Collecting error metrics** + +Although open-source NGINX does not make error rates immediately available for monitoring, there are at least two ways to capture that information: + +- Use the expanded status module available with commercially supported NGINX Plus +- Configure NGINX’s log module to write response codes in access logs + +Read the companion post on NGINX metrics collection for detailed instructions on both approaches. + +#### Performance metrics #### + +注:表格 + +++++ + + + + + + + + + + + + + + + + +
NameDescriptionMetric typeAvailability
request timeTime to process each request, in secondsWork: PerformanceNGINX logs
+ +**Metric to alert on: Request processing time** + +The request time metric logged by NGINX records the processing time for each request, from the reading of the first client bytes to fulfilling the request. Long response times can point to problems upstream. + +**Collecting processing time metrics** + +NGINX and NGINX Plus users can capture data on processing time by adding the $request_time variable to the access log format. More details on configuring logs for monitoring are available in our companion post on [NGINX metrics collection][8]. + +#### Reverse proxy metrics #### + +注:表格 + +++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDescriptionMetric typeAvailability
Active connections by upstream serverCurrently active client connectionsResource: UtilizationNGINX Plus
5xx codes by upstream serverServer errorsWork: ErrorsNGINX Plus
Available servers per upstream groupServers passing health checksResource: AvailabilityNGINX Plus
+ +One of the most common ways to use NGINX is as a [reverse proxy][9]. The commercially supported NGINX Plus exposes a large number of metrics about backend (or “upstream”) servers, which are relevant to a reverse proxy setup. This section highlights a few of the key upstream metrics that are available to users of NGINX Plus. + +NGINX Plus segments its upstream metrics first by group, and then by individual server. So if, for example, your reverse proxy is distributing requests to five upstream web servers, you can see at a glance whether any of those individual servers is overburdened, and also whether you have enough healthy servers in the upstream group to ensure good response times. + +**Activity metrics** + +The number of **active connections per upstream server** can help you verify that your reverse proxy is properly distributing work across your server group. If you are using NGINX as a load balancer, significant deviations in the number of connections handled by any one server can indicate that the server is struggling to process requests in a timely manner or that the load-balancing method (e.g., [round-robin or IP hashing][10]) you have configured is not optimal for your traffic patterns + +**Error metrics** + +Recall from the error metric section above that 5xx (server error) codes are a valuable metric to monitor, particularly as a share of total response codes. NGINX Plus allows you to easily extract the number of **5xx codes per upstream server**, as well as the total number of responses, to determine that particular server’s error rate. + +**Availability metrics** + +For another view of the health of your web servers, NGINX also makes it simple to monitor the health of your upstream groups via the total number of **servers currently available within each group**. In a large reverse proxy setup, you may not care very much about the current state of any one server, just as long as your pool of available servers is capable of handling the load. But monitoring the total number of servers that are up within each upstream group can provide a very high-level view of the aggregate health of your web servers. + +**Collecting upstream metrics** + +NGINX Plus upstream metrics are exposed on the internal NGINX Plus monitoring dashboard, and are also available via a JSON interface that can serve up metrics into virtually any external monitoring platform. See examples in our companion post on [collecting NGINX metrics][11]. + +### Conclusion ### + +In this post we’ve touched on some of the most useful metrics you can monitor to keep tabs on your NGINX servers. If you are just getting started with NGINX, monitoring most or all of the metrics in the list below will provide good visibility into the health and activity levels of your web infrastructure: + +- [Dropped connections][12] +- [Requests per second][13] +- [Server error rate][14] +- [Request processing time][15] + +Eventually you will recognize additional, more specialized metrics that are particularly relevant to your own infrastructure and use cases. Of course, what you monitor will depend on the tools you have and the metrics available to you. See the companion post for [step-by-step instructions on metric collection][16], whether you use NGINX or NGINX Plus. + +At Datadog, we have built integrations with both NGINX and NGINX Plus so that you can begin collecting and monitoring metrics from all your web servers with a minimum of setup. Learn how to monitor NGINX with Datadog [in this post][17], and get started right away with [a free trial of Datadog][18]. + +### Acknowledgments ### + +Many thanks to the NGINX team for reviewing this article prior to publication and providing important feedback and clarifications. + +---------- + +Source Markdown for this post is available [on GitHub][19]. Questions, corrections, additions, etc.? Please [let us know][20]. + +-------------------------------------------------------------------------------- + +via: https://www.datadoghq.com/blog/how-to-monitor-nginx/ + +作者:K Young +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[1]:http://nginx.org/en/ +[2]:http://nginx.com/resources/glossary/reverse-proxy-server/ +[3]:https://www.datadoghq.com/blog/monitoring-101-collecting-data/ +[4]:http://nginx.org/en/docs/ngx_core_module.html#worker_connections +[5]:https://www.datadoghq.com/blog/how-to-monitor-nginx/#active-state +[6]:https://www.datadoghq.com/blog/how-to-collect-nginx-metrics/ +[7]:http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html +[8]:https://www.datadoghq.com/blog/how-to-collect-nginx-metrics/ +[9]:https://en.wikipedia.org/wiki/Reverse_proxy +[10]:http://nginx.com/blog/load-balancing-with-nginx-plus/ +[11]:https://www.datadoghq.com/blog/how-to-collect-nginx-metrics/ +[12]:https://www.datadoghq.com/blog/how-to-monitor-nginx/#dropped-connections +[13]:https://www.datadoghq.com/blog/how-to-monitor-nginx/#requests-per-second +[14]:https://www.datadoghq.com/blog/how-to-monitor-nginx/#server-error-rate +[15]:https://www.datadoghq.com/blog/how-to-monitor-nginx/#request-processing-time +[16]:https://www.datadoghq.com/blog/how-to-collect-nginx-metrics/ +[17]:https://www.datadoghq.com/blog/how-to-monitor-nginx-with-datadog/ +[18]:https://www.datadoghq.com/blog/how-to-monitor-nginx/#sign-up +[19]:https://github.com/DataDog/the-monitor/blob/master/nginx/how_to_monitor_nginx.md +[20]:https://github.com/DataDog/the-monitor/issues \ No newline at end of file From 6409911c6756b4acfdccc618073b68835bbba5d2 Mon Sep 17 00:00:00 2001 From: ZTinoZ Date: Fri, 17 Jul 2015 16:58:56 +0800 Subject: [PATCH 622/965] Translating by ZTinoZ --- ...709 7 command line tools for monitoring your Linux system.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/talk/20150709 7 command line tools for monitoring your Linux system.md b/sources/talk/20150709 7 command line tools for monitoring your Linux system.md index fe82ef6436..a48f8498e8 100644 --- a/sources/talk/20150709 7 command line tools for monitoring your Linux system.md +++ b/sources/talk/20150709 7 command line tools for monitoring your Linux system.md @@ -30,7 +30,7 @@ ### Vmstat ### -Vmstat is a simpler tool for monitoring your Linux system performance statistics but that makes it highly suitable for use in shell scripts. Fire up your regex-fu and you can do some amazing things with vmstat and cron jobs. “The first report produced gives averages since the last reboot. Additional reports give information on a sampling period of length delay. The process and memory reports are instantaneous in either case” (go [here][7] for more info.). +Vmstat是一款监控Linux系统性能数据的简易工具,这让它在shell脚本中使用更合适。打开你的regex-fu,用vmstat和cron作业来做一些激动人心的事情吧。“产出的第一份报告给出的是上一次系统重启之后的均值,另外其一份报告给出的则是从前一个报告起间隔周期中的信息。进程和内存报告在任何情况下都是不停更新的”(猛戳[这里][7]获取更多信息)。 ![Image courtesy Mark Gibbs](http://images.techhive.com/images/article/2015/06/command-line-tools-monitoring-linux-system-6-100591905-orig.png) From d9142adb7be64eaacea4a868c21d80b551d7ba8b Mon Sep 17 00:00:00 2001 From: Frank Zhang Date: Fri, 17 Jul 2015 17:03:05 +0800 Subject: [PATCH 623/965] [translating] 20150717 Howto Configure FTP Server with Proftpd on Fedora 22.md --- ...717 Howto Configure FTP Server with Proftpd on Fedora 22.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150717 Howto Configure FTP Server with Proftpd on Fedora 22.md b/sources/tech/20150717 Howto Configure FTP Server with Proftpd on Fedora 22.md index f87bcd7745..416696bc91 100644 --- a/sources/tech/20150717 Howto Configure FTP Server with Proftpd on Fedora 22.md +++ b/sources/tech/20150717 Howto Configure FTP Server with Proftpd on Fedora 22.md @@ -1,3 +1,4 @@ +zpl1025 Howto Configure FTP Server with Proftpd on Fedora 22 ================================================================================ In this article, we'll learn about setting up an FTP server with Proftpd running Fedora 22 in our machine or server. [ProFTPD][1] is a free and open source FTP daemon software licensed under GPL. It is among most popular FTP server among machines running Linux. Its primary design aims to have an FTP server with many advanced features and provisioning users for more configuration options for easy customization. It includes a number of configuration options that are still not available with many other FTP daemons. It was initially developed by the developers as an alternative with better security and configuration to wu-ftpd server. An FTP server is a program that allows us to upload or download files and folders from a remote server where it is setup using an FTP client. Some of the features of ProFTPD daemon are as follows, you can check more features on [http://www.proftpd.org/features.html][2] . @@ -184,4 +185,4 @@ via: http://linoxide.com/linux-how-to/configure-ftp-proftpd-fedora-22/ [a]:http://linoxide.com/author/arunp/ [1]:http://www.proftpd.org/ -[2]:http://www.proftpd.org/features.html \ No newline at end of file +[2]:http://www.proftpd.org/features.html From 96b6d89ca66a8a2b7a5fdb7944e0f12ce4fd1929 Mon Sep 17 00:00:00 2001 From: struggling <630441839@qq.com> Date: Fri, 17 Jul 2015 19:53:07 +0800 Subject: [PATCH 624/965] Update 20150717 Setting Up 'XR' (Crossroads) Load Balancer for Web Servers on RHEL or CentOS.md --- ...ssroads) Load Balancer for Web Servers on RHEL or CentOS.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150717 Setting Up 'XR' (Crossroads) Load Balancer for Web Servers on RHEL or CentOS.md b/sources/tech/20150717 Setting Up 'XR' (Crossroads) Load Balancer for Web Servers on RHEL or CentOS.md index 6aba5e897e..13312b6272 100644 --- a/sources/tech/20150717 Setting Up 'XR' (Crossroads) Load Balancer for Web Servers on RHEL or CentOS.md +++ b/sources/tech/20150717 Setting Up 'XR' (Crossroads) Load Balancer for Web Servers on RHEL or CentOS.md @@ -1,3 +1,4 @@ +translation by strugglingyouth Setting Up ‘XR’ (Crossroads) Load Balancer for Web Servers on RHEL/CentOS ================================================================================ Crossroads is a service independent, open source load balance and fail-over utility for Linux and TCP based services. It can be used for HTTP, HTTPS, SSH, SMTP and DNS etc. It is also a multi-threaded utility which consumes only one memory space which leads to increase the performance when balancing load. @@ -156,4 +157,4 @@ via: http://www.tecmint.com/setting-up-xr-crossroads-load-balancer-for-web-serve [1]:https://crossroads.e-tunity.com/ [2]:http://www.tecmint.com/python-simplehttpserver-to-create-webserver-or-serve-files-instantly/ [3]:http://www.tecmint.com/vi-editor-usage/ -[4]:https://crossroads.e-tunity.com/ \ No newline at end of file +[4]:https://crossroads.e-tunity.com/ From eb2f46d725c4993d208ef570dfcb202aa1c7f722 Mon Sep 17 00:00:00 2001 From: struggling <630441839@qq.com> Date: Fri, 17 Jul 2015 19:57:09 +0800 Subject: [PATCH 625/965] Update 20150717 Setting Up 'XR' (Crossroads) Load Balancer for Web Servers on RHEL or CentOS.md --- ...ssroads) Load Balancer for Web Servers on RHEL or CentOS.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150717 Setting Up 'XR' (Crossroads) Load Balancer for Web Servers on RHEL or CentOS.md b/sources/tech/20150717 Setting Up 'XR' (Crossroads) Load Balancer for Web Servers on RHEL or CentOS.md index 6aba5e897e..13312b6272 100644 --- a/sources/tech/20150717 Setting Up 'XR' (Crossroads) Load Balancer for Web Servers on RHEL or CentOS.md +++ b/sources/tech/20150717 Setting Up 'XR' (Crossroads) Load Balancer for Web Servers on RHEL or CentOS.md @@ -1,3 +1,4 @@ +translation by strugglingyouth Setting Up ‘XR’ (Crossroads) Load Balancer for Web Servers on RHEL/CentOS ================================================================================ Crossroads is a service independent, open source load balance and fail-over utility for Linux and TCP based services. It can be used for HTTP, HTTPS, SSH, SMTP and DNS etc. It is also a multi-threaded utility which consumes only one memory space which leads to increase the performance when balancing load. @@ -156,4 +157,4 @@ via: http://www.tecmint.com/setting-up-xr-crossroads-load-balancer-for-web-serve [1]:https://crossroads.e-tunity.com/ [2]:http://www.tecmint.com/python-simplehttpserver-to-create-webserver-or-serve-files-instantly/ [3]:http://www.tecmint.com/vi-editor-usage/ -[4]:https://crossroads.e-tunity.com/ \ No newline at end of file +[4]:https://crossroads.e-tunity.com/ From 66b9b3b917931400670604532db3de5d3035c2c0 Mon Sep 17 00:00:00 2001 From: wxy Date: Fri, 17 Jul 2015 21:30:01 +0800 Subject: [PATCH 626/965] PUB:20150612 Linux_Logo--A Command Line Tool to Print Color ANSI Logos of Linux Distributions @KevinSJ --- ...Color ANSI Logos of Linux Distributions.md | 60 +++++++++---------- 1 file changed, 30 insertions(+), 30 deletions(-) rename {translated/tech => published}/20150612 Linux_Logo--A Command Line Tool to Print Color ANSI Logos of Linux Distributions.md (72%) diff --git a/translated/tech/20150612 Linux_Logo--A Command Line Tool to Print Color ANSI Logos of Linux Distributions.md b/published/20150612 Linux_Logo--A Command Line Tool to Print Color ANSI Logos of Linux Distributions.md similarity index 72% rename from translated/tech/20150612 Linux_Logo--A Command Line Tool to Print Color ANSI Logos of Linux Distributions.md rename to published/20150612 Linux_Logo--A Command Line Tool to Print Color ANSI Logos of Linux Distributions.md index e9a27aff00..8c17cc4f64 100644 --- a/translated/tech/20150612 Linux_Logo--A Command Line Tool to Print Color ANSI Logos of Linux Distributions.md +++ b/published/20150612 Linux_Logo--A Command Line Tool to Print Color ANSI Logos of Linux Distributions.md @@ -1,23 +1,22 @@ Linux_Logo – 输出彩色 ANSI Linux 发行版徽标的命令行工具 ================================================================================ -linuxlogo 或 linux_logo 是一款在Linux命令行下生成附带系统信息的彩色 ANSI 发行版徽标的工具。 - +linuxlogo(或叫 linux_logo)是一款在Linux命令行下用彩色 ANSI 代码生成附带有系统信息的发行版徽标的工具。 ![Linux_Logo – 输出彩色 ANSI Linux 发行版徽标](http://www.tecmint.com/wp-content/uploads/2015/06/Linux_Logo.png) -Linux_Logo – 输出彩色 ANSI Linux 发行版徽标 +*Linux_Logo – 输出彩色 ANSI Linux 发行版徽标* -这个小工具可以从 /proc 文件系统中获取系统信息并可以显示包括主机发行版在内的其他很多发行版的徽标。 +这个小工具可以从 /proc 文件系统中获取系统信息并可以显示包括主机上安装的发行版在内的很多发行版的徽标。 -与徽标一同显示的系统信息包括 – Linux 内核版本,最近一次编译Linux内核的时间,处理器/核心数量,速度,制造商,以及哪一代处理器。它还能显示总共的物理内存大小。 +与徽标一同显示的系统信息包括 : Linux 内核版本,最近一次编译Linux内核的时间,处理器/核心数量,速度,制造商,以及哪一代处理器。它还能显示总共的物理内存大小。 -值得一提的是,screenfetch是一个拥有类似功能的工具,它也能显示发行版徽标,同时还提供更加详细美观的系统信息。我们之前已经介绍过这个工具,你可以参考一下链接: -- [ScreenFetch – Generates Linux System Information][1] +无独有偶,screenfetch是一个拥有类似功能的工具,它也能显示发行版徽标,同时还提供更加详细美观的系统信息。我们之前已经介绍过这个工具,你可以参考一下链接: +- [screenFetch: 命令行信息截图工具][1] -linux_logo 和 Screenfetch 并不能相提并论。尽管 screenfetch 的输出较为整洁并提供更多细节, linux_logo 则提供了更多的彩色 ANSI 图标, 并且提供了格式化输出的选项。 +linux\_logo 和 Screenfetch 并完全一样。尽管 screenfetch 的输出较为整洁并提供更多细节, 但 linux\_logo 则提供了更多的彩色 ANSI 图标, 并且提供了格式化输出的选项。 -linux_logo 主要使用C语言编写并将 linux 徽标呈现在 X 窗口系统中因此需要安装图形界面 X11 或 X 系统。这个软件使用GNU 2.0协议。 +linux\_logo 主要使用C语言编写并将 linux 徽标呈现在 X 窗口系统中因此需要安装图形界面 X11 或 X 系统(LCTT 译注:此处应是错误的。按说不需要任何图形界面支持,并且译者从其官方站 http://www.deater.net/weave/vmwprod/linux_logo 也没找到任何相关 X11的信息)。这个软件使用GNU 2.0协议。 本文中,我们将使用以下环境测试 linux_logo 工具。 @@ -26,7 +25,7 @@ linux_logo 主要使用C语言编写并将 linux 徽标呈现在 X 窗口系统 ### 在 Linux 中安装 Linux Logo工具 ### -**1. linuxlogo软件包 ( 5.11 稳定版) 可通过如下方式使用 apt, yum,或 dnf 在所有发行版中使用默认的软件仓库进行安装** +**1. linuxlogo软件包 ( 5.11 稳定版) 可通过如下方式使用 apt, yum 或 dnf 在所有发行版中使用默认的软件仓库进行安装** # apt-get install linux_logo [用于基于 Apt 的系统] (译者注:Ubuntu中,该软件包名为linuxlogo) # yum install linux_logo [用于基于 Yum 的系统] @@ -42,7 +41,7 @@ linux_logo 主要使用C语言编写并将 linux 徽标呈现在 X 窗口系统 ![获取默认系统徽标](http://www.tecmint.com/wp-content/uploads/2015/06/Get-Default-OS-Logo.png) -获取默认系统徽标 +*获取默认系统徽标* **3. 使用 `[-a]` 选项可以输出没有颜色的徽标。当在黑白终端里使用 linux_logo 时,这个选项会很有用。** @@ -50,7 +49,7 @@ linux_logo 主要使用C语言编写并将 linux 徽标呈现在 X 窗口系统 ![黑白 Linux 徽标](http://www.tecmint.com/wp-content/uploads/2015/06/Black-and-White-Linux-Logo.png) -黑白 Linux 徽标 +*黑白 Linux 徽标* **4. 使用 `[-l]` 选项可以仅输出徽标而不包含系统信息。** @@ -58,7 +57,7 @@ linux_logo 主要使用C语言编写并将 linux 徽标呈现在 X 窗口系统 ![输出发行版徽标](http://www.tecmint.com/wp-content/uploads/2015/06/Print-Distribution-Logo.png) -输出发行版徽标 +*输出发行版徽标* **5. `[-u]` 选项可以显示系统运行时间。** @@ -66,7 +65,7 @@ linux_logo 主要使用C语言编写并将 linux 徽标呈现在 X 窗口系统 ![输出系统运行时间](http://www.tecmint.com/wp-content/uploads/2015/06/Print-System-Uptime.png) -输出系统运行时间 +*输出系统运行时间* **6. 如果你对系统平均负载感兴趣,可以使用 `[-y]` 选项。你可以同时使用多个选项。** @@ -74,7 +73,7 @@ linux_logo 主要使用C语言编写并将 linux 徽标呈现在 X 窗口系统 ![输出系统平均负载](http://www.tecmint.com/wp-content/uploads/2015/06/Print-System-Load-Average.png) -输出系统平均负载 +*输出系统平均负载* 如需查看更多选项并获取相关帮助,你可以使用如下命令。 @@ -82,7 +81,7 @@ linux_logo 主要使用C语言编写并将 linux 徽标呈现在 X 窗口系统 ![Linuxlogo 选项及帮助](http://www.tecmint.com/wp-content/uploads/2015/06/linuxlogo-options.png) -Linuxlogo选项及帮助 +*Linuxlogo选项及帮助* **7. 此工具内置了很多不同发行版的徽标。你可以使用 `[-L list]` 选项查看在这些徽标的列表。** @@ -90,7 +89,7 @@ Linuxlogo选项及帮助 ![Linux 徽标列表](http://www.tecmint.com/wp-content/uploads/2015/06/List-of-Linux-Logos.png) -Linux 徽标列表 +*Linux 徽标列表* 如果你想输出这个列表中的任意徽标,可以使用 `-L NUM` 或 `-L NAME` 来显示想要选中的图标。 @@ -105,7 +104,7 @@ Linux 徽标列表 ![输出 AIX 图标](http://www.tecmint.com/wp-content/uploads/2015/06/Print-AIX-Logo.png) -输出 AIX 图标 +*输出 AIX 图标* **注**: 命令中的使用 `-L 1` 是因为 AIX 徽标在列表中的编号是1,而使用 `-L aix` 则是因为 AIX 徽标在列表中的名称为 aix @@ -116,13 +115,13 @@ Linux 徽标列表 ![各种 Linux 徽标](http://www.tecmint.com/wp-content/uploads/2015/06/Various-Linux-Logos.png) -各种 Linux 徽标 +*各种 Linux 徽标* -你可以通过徽标对应的编号或名字使用任意徽标 +你可以通过徽标对应的编号或名字使用任意徽标。 ### 一些使用 Linux_logo 的建议和提示### -**8. 你可以在登录界面输出你的 Linux 发行版徽标。要输出默认徽标,你可以在 ` ~/.bashrc`` 文件的最后添加以下内容。** +**8. 你可以在登录界面输出你的 Linux 发行版徽标。要输出默认徽标,你可以在 ` ~/.bashrc` 文件的最后添加以下内容。** if [ -f /usr/bin/linux_logo ]; then linux_logo; fi @@ -132,15 +131,15 @@ Linux 徽标列表 ![Print Logo on User Login](http://www.tecmint.com/wp-content/uploads/2015/06/Print-Logo-on-Login.png) -在用户登录时输出徽标 +*在用户登录时输出徽标* -其实你也可以在登录后输出任意图标,只需加入以下内容 +其实你也可以在登录后输出任意图标,只需加入以下内容: if [ -f /usr/bin/linux_logo ]; then linux_logo -L num; fi **重要**: 不要忘了将 num 替换成你想使用的图标。 -**10. You can also print your own logo by simply specifying the location of the logo as shown below.** +**10. 你也能直接指定徽标所在的位置来显示你自己的徽标。** # linux_logo -D /path/to/ASCII/logo @@ -152,12 +151,11 @@ Linux 徽标列表 # /usr/local/bin/linux_logo -a > /etc/issue.net -**12. 创建一个 Penguin 端口 - 用于回应连接的端口。要创建 Penguin 端口, 则需在 /etc/services 文件中加入以下内容 ** +**12. 创建一个 Linux 上的端口 - 用于回应连接的端口。要创建 Linux 端口, 则需在 /etc/services 文件中加入以下内容** penguin 4444/tcp penguin -这里的 `4444` 是一个未被任何其他资源使用的空闲端口。你也可以使用其他端口。 -你还需要在 /etc/inetd.conf中加入以下内容 +这里的 `4444` 是一个未被任何其他资源使用的空闲端口。你也可以使用其他端口。你还需要在 /etc/inetd.conf中加入以下内容: penguin stream tcp nowait root /usr/local/bin/linux_logo @@ -165,6 +163,8 @@ Linux 徽标列表 # killall -HUP inetd +(LCTT 译注:然后你就可以远程或本地连接到这个端口,并显示这个徽标了。) + linux_logo 还可以用做启动脚本来愚弄攻击者或对你朋友使用恶作剧。这是一个我经常在我的脚本中用来获取不同发行版输出的好工具。 试过一次后,你就不会忘记的。让我们知道你对这个工具的想法及它对你的作用吧。 不要忘记给评论、点赞或分享! @@ -174,10 +174,10 @@ linux_logo 还可以用做启动脚本来愚弄攻击者或对你朋友使用恶 via: http://www.tecmint.com/linux_logo-tool-to-print-color-ansi-logos-of-linux/ 作者:[Avishek Kumar][a] -译者:[KevSJ](https://github.com/KevSJ) -校对:[校对者ID](https://github.com/校对者ID) +译者:[KevinSJ](https://github.com/KevinSJ) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 [a]:http://www.tecmint.com/author/avishek/ -[1]:http://www.tecmint.com/screenfetch-system-information-generator-for-linux/ +[1]:https://linux.cn/article-1947-1.html From 602ecb30a86953eccf9c4e0330a7f8518f54bdc7 Mon Sep 17 00:00:00 2001 From: wxy Date: Fri, 17 Jul 2015 21:30:14 +0800 Subject: [PATCH 627/965] =?UTF-8?q?=E6=A0=A1=E5=AF=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...Why is the ibdata1 file continuously growing in MySQL.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/published/20150709 Why is the ibdata1 file continuously growing in MySQL.md b/published/20150709 Why is the ibdata1 file continuously growing in MySQL.md index af798b387a..64f74aecb0 100644 --- a/published/20150709 Why is the ibdata1 file continuously growing in MySQL.md +++ b/published/20150709 Why is the ibdata1 file continuously growing in MySQL.md @@ -6,7 +6,7 @@ 当监控服务器发送一个关于 MySQL 服务器存储的报警时,恐慌就开始了 —— 就是说磁盘快要满了。 -一番调查后你意识到大多数地盘空间被 InnoDB 的共享表空间 ibdata1 使用。而你已经启用了 [innodb_file_per_table][2],所以问题是: +一番调查后你意识到大多数地盘空间被 InnoDB 的共享表空间 ibdata1 使用。而你已经启用了 [innodb\_file\_per\_table][2],所以问题是: ### ibdata1存了什么? ### @@ -17,7 +17,7 @@ - 双写缓冲区 - 撤销日志 -其中的一些在 [Percona 服务器][3]上可以被配置来避免增长过大的。例如你可以通过 [innodb_ibuf_max_size][4] 设置最大变更缓冲区,或设置 [innodb_doublewrite_file][5] 来将双写缓冲区存储到一个分离的文件。 +其中的一些在 [Percona 服务器][3]上可以被配置来避免增长过大的。例如你可以通过 [innodb\_ibuf\_max\_size][4] 设置最大变更缓冲区,或设置 [innodb\_doublewrite\_file][5] 来将双写缓冲区存储到一个分离的文件。 MySQL 5.6 版中你也可以创建外部的撤销表空间,所以它们可以放到自己的文件来替代存储到 ibdata1。可以看看这个[文档][6]。 @@ -82,7 +82,7 @@ MySQL 5.6 版中你也可以创建外部的撤销表空间,所以它们可以 没有,目前还没有一个容易并且快速的方法。InnoDB 表空间从不收缩...参见[10 年之久的漏洞报告][10],最新更新自詹姆斯·戴(谢谢): -当你删除一些行,这个页被标为已删除稍后重用,但是这个空间从不会被回收。唯一的方法是使用新的 ibdata1 启动数据库。要做这个你应该需要使用 mysqldump 做一个逻辑全备份,然后停止 MySQL 并删除所有数据库、ib_logfile*、ibdata1* 文件。当你再启动 MySQL 的时候将会创建一个新的共享表空间。然后恢复逻辑备份。 +当你删除一些行,这个页被标为已删除稍后重用,但是这个空间从不会被回收。唯一的方法是使用新的 ibdata1 启动数据库。要做这个你应该需要使用 mysqldump 做一个逻辑全备份,然后停止 MySQL 并删除所有数据库、ib_logfile\*、ibdata1\* 文件。当你再启动 MySQL 的时候将会创建一个新的共享表空间。然后恢复逻辑备份。 ### 总结 ### From e15e363bb1a19ae1f1562babf87ca496e3140382 Mon Sep 17 00:00:00 2001 From: Chang Liu Date: Sat, 18 Jul 2015 13:15:35 +0800 Subject: [PATCH 628/965] Update 20150716 4 CCleaner Alternatives For Ubuntu Linux.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 准备翻译这篇文章。 --- .../20150716 4 CCleaner Alternatives For Ubuntu Linux.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/share/20150716 4 CCleaner Alternatives For Ubuntu Linux.md b/sources/share/20150716 4 CCleaner Alternatives For Ubuntu Linux.md index 75d5af190c..1246e7af1c 100644 --- a/sources/share/20150716 4 CCleaner Alternatives For Ubuntu Linux.md +++ b/sources/share/20150716 4 CCleaner Alternatives For Ubuntu Linux.md @@ -1,3 +1,5 @@ +FSSlc translating + 4 CCleaner Alternatives For Ubuntu Linux ================================================================================ ![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/ccleaner-10-700x393.jpg) @@ -115,4 +117,4 @@ via: http://itsfoss.com/ccleaner-alternatives-ubuntu-linux/ [5]:https://www.kde.org/applications/utilities/ [6]:http://ubuntu-tweak.com/ [7]:http://ubuntu-tweak.com/ -[8]:https://quassy.github.io/elementary-apps/GCleaner/ \ No newline at end of file +[8]:https://quassy.github.io/elementary-apps/GCleaner/ From 81a2a43246ce5d4e3b4c7aa884eb43b42677277e Mon Sep 17 00:00:00 2001 From: XLCYun Date: Sat, 18 Jul 2015 13:25:08 +0800 Subject: [PATCH 629/965] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=8E=9F=E6=96=87=20?= =?UTF-8?q?Syncthing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 删除原文 20150121 Syncthing--A Private And Secure Tool To Sync Files or Folders Between Computers.md --- ...Sync Files or Folders Between Computers.md | 208 ------------------ 1 file changed, 208 deletions(-) delete mode 100644 sources/tech/20150121 Syncthing--A Private And Secure Tool To Sync Files or Folders Between Computers.md diff --git a/sources/tech/20150121 Syncthing--A Private And Secure Tool To Sync Files or Folders Between Computers.md b/sources/tech/20150121 Syncthing--A Private And Secure Tool To Sync Files or Folders Between Computers.md deleted file mode 100644 index b3bca3d3db..0000000000 --- a/sources/tech/20150121 Syncthing--A Private And Secure Tool To Sync Files or Folders Between Computers.md +++ /dev/null @@ -1,208 +0,0 @@ -XLCYun translating. -Syncthing: A Private, And Secure Tool To Sync Files/Folders Between Computers -================================================================================ -### Introduction ### - -**Syncthing** is a free, Open Source tool that can be used to sync files/folders between your networked computers. Unlike other sync tools, such as **BitTorrent Sync** or **Dropbox**, Syncthing transfers data directly from one system to another system, and It is completely open source, secure and private. All of your precious data will be stored in your system so that you can have full control over your files and folders, and none of them are stored in any third party systems. Also, you deserve to choose where it is stored, if it is shared with some third party and how it’s transmitted over the Internet. - -All communication is encrypted using TLS, so your data is very secure from the prying eyes. Syncthing has a responsive and powerful WebGUI which will help the users to easily add, delete and manage directories to be synced over network. Using Syncthing, you can sync multiple folders to multiple systems at a time. Syncthing is very simple, portable, yet powerful tool in terms of installation and usage. Since all files/folders are directly transferred from one computer to another computer, you don’t have to worry about purchasing extra space from your Cloud provider. All you need is very stable LAN/WAN connection and enough disk space on your systems. It supports all modern operating systems, including GNU/Linux, Windows, Mac OS X, and ofcourse Android. - -### Installation ### - -For the purpose of this tutorial, We will be using two systems, one is running with Ubuntu 14.04 LTS, and another one is running with Ubuntu 14.10 server. To easily recognize these two systems, we will be calling them using names **system1**, and **system2**. - -### System1 Details: ### - -- **OS**: Ubuntu 14.04 LTS server; -- **Hostname**: server1.unixmen.local; -- **IP Address**: 192.168.1.150. -- **System user**: sk (You can use your own) -- **Sync Directory**: /home/Sync/ (Will be created by default by Syncthing) - -### System2 Details: ### - -- **OS**: Ubuntu 14.10 server; -- **Hostname**: server.unixmen.local; -- **IP Address**: 192.168.1.151. -- **System user**: sk (You can use your own) -- **Sync Directory**: /home/Sync/ (Will be created by default by Syncthing) - -### Creating User For Syncthing On System 1 & System2: ### - -Run the following commands on both system to create the user for Syncthing and the directory to be synced between two systems: - - sudo useradd sk - sudo passwd sk - -### Install Syncthing On System1 And System2: ### - -You should do the following steps on both System 1 and System 2. - -Download the latest version from the [official download page][1]. As I am using 64bit system, I downloaded the 6bbit package. - - wget https://github.com/syncthing/syncthing/releases/download/v0.10.20/syncthing-linux-amd64-v0.10.20.tar.gz - -Extract the download file: - - tar xzvf syncthing-linux-amd64-v0.10.20.tar.gz - -Cd to the extracted folder: - - cd syncthing-linux-amd64-v0.10.20/ - -Copy the excutable file “syncthing” to **$PATH**: - - sudo cp syncthing /usr/local/bin/ - -Now, run the following command to run the syncthing for the first time. - - syncthing - -When you run the above command, syncthing will generate a configuration and some keys and then start the admin GUI in your browser. You should see something like below. - -Sample output: - - [monitor] 15:40:27 INFO: Starting syncthing - 15:40:27 INFO: Generating RSA key and certificate for syncthing... - [BQXVO] 15:40:34 INFO: syncthing v0.10.20 (go1.4 linux-386 default) unknown-user@syncthing-builder 2015-01-13 16:27:47 UTC - [BQXVO] 15:40:34 INFO: My ID: BQXVO3D-VEBIDRE-MVMMGJI-ECD2PC3-T5LT3JB-OK4Z45E-MPIDWHI-IRW3NAZ - [BQXVO] 15:40:34 INFO: No config file; starting with empty defaults - [BQXVO] 15:40:34 INFO: Edit /home/sk/.config/syncthing/config.xml to taste or use the GUI - [BQXVO] 15:40:34 INFO: Starting web GUI on http://127.0.0.1:8080/ - [BQXVO] 15:40:34 INFO: Loading HTTPS certificate: open /home/sk/.config/syncthing/https-cert.pem: no such file or directory - [BQXVO] 15:40:34 INFO: Creating new HTTPS certificate - [BQXVO] 15:40:34 INFO: Generating RSA key and certificate for server1... - [BQXVO] 15:41:01 INFO: Starting UPnP discovery... - [BQXVO] 15:41:07 INFO: Starting local discovery announcements - [BQXVO] 15:41:07 INFO: Starting global discovery announcements - [BQXVO] 15:41:07 OK: Ready to synchronize default (read-write) - [BQXVO] 15:41:07 INFO: Device BQXVO3D-VEBIDRE-MVMMGJI-ECD2PC3-T5LT3JB-OK4Z45E-MPIDWHI-IRW3NAZ is "server1" at [dynamic] - [BQXVO] 15:41:07 INFO: Completed initial scan (rw) of folder default - -Syncthing has been successfully initialized, and the Web admin interface can be accessed using URL: **http://localhost:8080** from your browser. As you see in the above output, syncthing has automatically created a folder called **default** for you, in a directory called **Sync** in your **home** directory. - -By default, Syncthing WebGUI will only be accessed from the localhost itself. To access the WebGUI from the remote systems, you need to do the following changes on both systems. - -First, stop the Syncthing initialization process by pressing the CTRL+C. Now, you will be returned back to the Terminal. - -Edit file **config.xml**, - - sudo nano ~/.config/syncthing/config.xml - -Find this directive: - - [...] - -
127.0.0.1:8080
- -Su9v0lW80JWybGjK9vNK00YDraxXHGP -
- [...] - -In the **
** field, change **127.0.0.1:8080** to **0.0.0.0:8080**. So, your config.xml will look like below. - - -
0.0.0.0:8080
- -Su9v0lW80JWybGjK9vNK00YDraxXHGP -
- -Save and close the file. - -Now, start again the Syncthing initialization on both systems by entering the following command: - - syncthing - -### Access the WebGUI ### - -Now, open your browser **http://ip-address:8080/**. You will see the following screen, - -![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/Syncthing-server1-Mozilla-Firefox_001.png) - -The WebGUI has two panes. In the left pane, you may see the list of folders to be synced. As I mentioned before, the folder **default** has been automatically created for you while initializing Syncthing. If you want to sync more folders, you can add using **Add Folder** button. - -In the right pane, you see the number of devices connected. Currently there is only one device, the computer you are running this on. - -### Configure Syncthing Web GUI ### - -For the security enhancement, let us enable TLS, and setup administrative user and password to access the WebGUI. To od that, click on the gear button and select **Settings** on the top right corner. - -![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/Menu_002.png) - -Enter the admin username/password. In my case it is admin/ubuntu. You should use some strong password. And, check the box that says: **Use HTTPS for GUI**. - -![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/Syncthing-server1-Mozilla-Firefox_004.png) - -Click Save button. Now, you’ll be asked to restart the Syncthing to activate the changes. Click Restart. - -![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/Selection_005.png) - -Selection_005Refresh you web browser. You’ll see the SSL warning like below. Click on the button that says: **I understand the Risks**. And, click Add Exception button to add this page to the browser trusted lists. - -![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/Untrusted-Connection-Mozilla-Firefox_006.png) - -Enter the administrative user and password which we configured in the previous steps. In my case it’s **admin/ubuntu**. - -![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/Authentication-Required_007.png) - -We have secured the WebGUI now. Don’t forget to do the same steps on both server. - -### Connect Servers To Each Other ### - -To sync folders between systems, you must told them about each other. This is accomplished by exchanging “device IDs”. You can find it in the web GUI by selecting the “gear menu” (top right) and “Show ID”. - -For example, here is my System 1 ID. - -![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/Syncthing-server1-Mozilla-Firefox_008.png) - -Copy the ID, and go to the another system (system 2) WebGUI. From the second system (system 2) WebGUI window, click on the Add Device on the right side. - -![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/Syncthing-server-Mozilla-Firefox_010.png) - -The following screen should appear. Paste the **System 1 ID** in the Device section. Enter the Device name(optional). In the Addresses field, you can either enter the IP address of the other system or leave it as default. The default value is **dynamic**. Finally, select the folder to be synced. In our case, the sync folder is **default**. - -![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/Syncthing-server-Mozilla-Firefox_009.png) - -Once you done, click on the save button. You’ll be asked to restart the Syncthing. Click Restart button to activate the changes. - -Now, go to the **System 1** WebUI, you’ll see a request has been sent from the System 2 to connect and sync. Click **Add** button. Now, the System 2 will ask the System 1 to share and sync the folder called “default”. Click **Share** button. - -![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/Selection_013.png) - -Next restart the Syncthing service on the System 1 to activate the changes. - -![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/Selection_014.png) - -Wait for few seconds, approximately 60 seconds, and you’ll see the two systems have been successfully connected and synced to each other. - -You can verify it under the Add Device section of the WebGUI. - -System 1 WebGUI console after adding System 2: - -![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/Syncthing-server-Mozilla-Firefox_016.png) - -System 2 WebGUI console after adding System 1: - -![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/Syncthing-server-Mozilla-Firefox_018.png) - -![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/Syncthing-server-Mozilla-Firefox_018.png) - -Now, put any file or folder in any one of the systems “**default**” folder. You may see the file/folder will be synced to the other system automatically. - -That’s it! Happy Sync’ing!! - -Cheers!!! - -- [Syncthing Website][2] - --------------------------------------------------------------------------------- - -via: http://www.unixmen.com/syncthing-private-secure-tool-sync-filesfolders-computers/ - -作者:[SK][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://www.unixmen.com/author/sk/ -[1]:https://github.com/syncthing/syncthing/releases/tag/v0.10.20 -[2]:http://syncthing.net/ From 51d4bdd48c8d9471732228cbd927e81c031bc6bc Mon Sep 17 00:00:00 2001 From: XLCYun Date: Sat, 18 Jul 2015 13:28:23 +0800 Subject: [PATCH 630/965] Translated By XLCYun 20150121 Syncthing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 20150121 Syncthing--A Private And Secure Tool To Sync Files or Folders Between Computers.md XLCYun 翻译完成. --- ...Sync Files or Folders Between Computers.md | 206 ++++++++++++++++++ 1 file changed, 206 insertions(+) create mode 100644 translated/tech/20150121 Syncthing--A Private And Secure Tool To Sync Files or Folders Between Computers.md diff --git a/translated/tech/20150121 Syncthing--A Private And Secure Tool To Sync Files or Folders Between Computers.md b/translated/tech/20150121 Syncthing--A Private And Secure Tool To Sync Files or Folders Between Computers.md new file mode 100644 index 0000000000..8819c80744 --- /dev/null +++ b/translated/tech/20150121 Syncthing--A Private And Secure Tool To Sync Files or Folders Between Computers.md @@ -0,0 +1,206 @@ +Syncthing: 一个跨计算机的私人的文件/文件夹安全同步工具 +================================================================================ +### 简介 ### + +**Syncthing** 是一个免费开源的工具,它能在你的各个网络计算机间同步文件/文件夹。它不像其它的同步工具,如**BitTorrent Sync**和**Dropbox**那样,它的同步数据是直接从一个系统中直接传输到另一个系统的,并且它是完全开源的,安全且私有的。你所有的珍贵数据都会被存储在你的系统中,这样你就能对你的文件和文件夹拥有全面的控制权,没有任何的文件或文件夹会被存储在第三方系统中。此外,你有权决定这些数据该存于何处,是否要分享到第三方,或这些数据在互联网上的传输方式。 + +所有的信息通讯都使用TLS进行加密,这样你的数据便能十分安全地逃离窥探。Syncthing有一个强大的响应式的网页管理界面(WebGUI,下同),它能够帮助用户简便地添加,删除和管理那些通过网络进行同步的文件夹。通过使用Syncthing,你可以在多个系统上一次同步多个文件夹。在安装和使用上,Syncthing是一个可移植的,简单但强大的工具。即然文件或文件夹是从一部计算机中直接传输到另一计算机中的,那么你就无需考虑向云服务供应商支付金钱来获取额外的云空间。你所需要的仅仅是非常稳定的LAN/WAN连接和你的系统中足够的硬盘空间。它支持所有的现代操作系统,包括GNU/Linux, Windows, Mac OS X, 当然还有Android。 + +### 安装 ### + +基于本文的目的,我们将使用两个系统,一个是Ubuntu 14.04 LTS, 一个是Ubuntu 14.10 server。为了简单辨别这两个系统,我们将分别称其为**系统1**和**系统2**。 + +### 系统1细节: ### + +- **操作系统**: Ubuntu 14.04 LTS server; +- **主机名**: server1.unixmen.local; +- **IP地址**: 192.168.1.150. +- **系统用户**: sk (你可以使用你自己的系统用户) +- **同步文件夹**: /home/Sync/ (Syncthing会默认创建) + +### 系统2细节 ### + +- **操作系统**: Ubuntu 14.10 server; +- **主机名**: server.unixmen.local; +- **IP地址**: 192.168.1.151. +- **系统用户**: sk (你可以使用你自己的系统用户) +- **同步文件夹**: /home/Sync/ (Syncthing会默认创建) + +### 在系统1和系统2上为Syncthing创建用户 ### + +在两个系统上运行下面的命令来为Syncthing创建用户以及两系统间的同步文件夹。 + + sudo useradd sk + sudo passwd sk + +### 为系统1和系统2安装Syncthing ### + +在系统1和系统2上遵循以下步骤进行操作。 + +从[官方下载页][1]上下载最新版本。我使用的是64位版本,因此下载64位版的软件包。 + + wget https://github.com/syncthing/syncthing/releases/download/v0.10.20/syncthing-linux-amd64-v0.10.20.tar.gz + +解压缩下载的文件: + + tar xzvf syncthing-linux-amd64-v0.10.20.tar.gz + +切换到解压缩出来的文件夹: + + cd syncthing-linux-amd64-v0.10.20/ + +复制可执行文件"Syncthing"到**$PATH**: + + sudo cp syncthing /usr/local/bin/ + +现在,执行下列命令来首次运行Syncthing: + + syncthing + +当你执行上述命令后,syncthing会生成一个配置以及一些关键值(keys),并且在你的浏览器上打开一个管理界面。, + +输入示例: + + [monitor] 15:40:27 INFO: Starting syncthing + 15:40:27 INFO: Generating RSA key and certificate for syncthing... + [BQXVO] 15:40:34 INFO: syncthing v0.10.20 (go1.4 linux-386 default) unknown-user@syncthing-builder 2015-01-13 16:27:47 UTC + [BQXVO] 15:40:34 INFO: My ID: BQXVO3D-VEBIDRE-MVMMGJI-ECD2PC3-T5LT3JB-OK4Z45E-MPIDWHI-IRW3NAZ + [BQXVO] 15:40:34 INFO: No config file; starting with empty defaults + [BQXVO] 15:40:34 INFO: Edit /home/sk/.config/syncthing/config.xml to taste or use the GUI + [BQXVO] 15:40:34 INFO: Starting web GUI on http://127.0.0.1:8080/ + [BQXVO] 15:40:34 INFO: Loading HTTPS certificate: open /home/sk/.config/syncthing/https-cert.pem: no such file or directory + [BQXVO] 15:40:34 INFO: Creating new HTTPS certificate + [BQXVO] 15:40:34 INFO: Generating RSA key and certificate for server1... + [BQXVO] 15:41:01 INFO: Starting UPnP discovery... + [BQXVO] 15:41:07 INFO: Starting local discovery announcements + [BQXVO] 15:41:07 INFO: Starting global discovery announcements + [BQXVO] 15:41:07 OK: Ready to synchronize default (read-write) + [BQXVO] 15:41:07 INFO: Device BQXVO3D-VEBIDRE-MVMMGJI-ECD2PC3-T5LT3JB-OK4Z45E-MPIDWHI-IRW3NAZ is "server1" at [dynamic] + [BQXVO] 15:41:07 INFO: Completed initial scan (rw) of folder default + +Syncthing已经被成功地初始化了,网页管理接口也可以通过浏览器在URL: **http://localhost:8080**进行访问了。如上面输入所看到的,Syncthing在你的**home**目录中的Sync目录**下自动为你创建了一个名为**default**的文件夹。 + +默认情况下,Syncthing的网页管理界面(WebGUI)只能在本地端口(localhost)中进行访问,你需要在两个系统中进行以下操作: + +首先,按下CTRL+C键来停止Syncthing初始化进程。现在你回到了终端界面。 + +编辑**config.xml**文件, + + sudo nano ~/.config/syncthing/config.xml + +找到下面的指令: + + [...] + +
127.0.0.1:8080
+ -Su9v0lW80JWybGjK9vNK00YDraxXHGP +
+ [...] + +在**
**区域中,把**127.0.0.1:8080**改为**0.0.0.0:8080**。结果,你的config.xml看起来会是这样的: + + +
0.0.0.0:8080
+ -Su9v0lW80JWybGjK9vNK00YDraxXHGP +
+ +保存并关闭文件。 + +在两个系统上再次执行下述命令: + + syncthing + +### 访问网页管理界面 ### + +现在,在你的浏览器上打开**http://ip-address:8080/**。你会看到下面的界面: + +![](http://www.unixmen.com/wp-content/uploads/2015/01/Syncthing-server1-Mozilla-Firefox_001.png) +网页管理界面分为两个窗格,在左窗格中,你应该可以看到同步的文件夹列表。如前所述,文件夹**default**在你初始化Syncthing时被自动创建。如果你想同步更多文件夹,点击**Add Folder**按钮。 + +在右窗格中,你可以看到已连接的设备数。现在这里只有一个,就是你现在正在操作的计算机。 + +### 网页管理界面(WebGUI)上设置Syncthing ### + +为了提高安全性,让我们启用TLS,并且设置访问网页管理界面的管理员用户和密码。要做到这点,点击右上角的齿轮按钮,然后选择**Settings** + +![](http://www.unixmen.com/wp-content/uploads/2015/01/Menu_002.png) + +输入管理员的帐户名/密码。我设置的是admin/Ubuntu。你可以使用一些更复杂的密码。 + +![](http://www.unixmen.com/wp-content/uploads/2015/01/Syncthing-server1-Mozilla-Firefox_004.png) + +点击Save按钮,现在,你会被要求重启Syncthing使更改生效。点击Restart。 + +![](http://www.unixmen.com/wp-content/uploads/2015/01/Selection_005.png) + +刷新你的网页浏览器。你可以看到一个像下面一样的SSL警告。点击显示**我了解风险(I understand the Risks)**的按钮。接着,点击“添加例外(Add Exception)“按钮把当前页面添加进浏览器的信任列表中。 + +![](http://www.unixmen.com/wp-content/uploads/2015/01/Untrusted-Connection-Mozilla-Firefox_006.png) + +输入前面几步设置的管理员用户和密码。我设置的是**admin/ubuntu**。 + +![](http://www.unixmen.com/wp-content/uploads/2015/01/Authentication-Required_007.png) + +现在,我们提高了网页管理界面的安全性。别忘了两个系统都要执行上面同样的步骤。 + +### 连接到其它服务器 ### + +要在各个系统之间同步文件,你必须各自告诉它们其它服务器的信息。这是通过交换设备IDs(device IDs)来实现的。你可以通过选择“齿轮菜单(gear menu)”(在右上角)中的”Show ID(显示ID)“来找到它。 + +例如,下面是我系统1的ID. + +![](http://www.unixmen.com/wp-content/uploads/2015/01/Syncthing-server1-Mozilla-Firefox_008.png) + +复制这个ID,然后到另外一个系统(系统2)的网页管理界面,在右边窗格点击Add Device按钮。 + +![](http://www.unixmen.com/wp-content/uploads/2015/01/Syncthing-server-Mozilla-Firefox_010.png) + +接着会出现下面的界面。在Device区域粘贴**系统1 ID **。输入设备名称(可选)。在地址区域,你可以输入其它系统(译者注:即粘贴的ID所属的系统,此应为系统1)的IP地址,或者使用默认值。默认值为**dynamic**。最后,选择要同步的文件夹。在我们的例子中,同步文件夹为**default**。 + +![](http://www.unixmen.com/wp-content/uploads/2015/01/Syncthing-server-Mozilla-Firefox_009.png) + +一旦完成了,点击save按钮。你会被要求重启Syncthing。点击Restart按钮重启使更改生效。 + +现在,我们到**系统1**的网页管理界面,你会看到来自系统2的连接和同步请求。点击**Add**按钮。现在,系统2会要求系统1分享和同步名为default的文件夹。 + +![](http://www.unixmen.com/wp-content/uploads/2015/01/Selection_013.png) + +接着重启系统1的Syncthing服务使更改生效。 + +![](http://www.unixmen.com/wp-content/uploads/2015/01/Selection_014.png) + +等待大概60秒,接着你会看到两个系统之间已成功连接并同步。 + +你可以在网页管理界面中的Add Device区域核实该情况。 + +添加系统2后,系统1网页管理界面中的控制窗口如下: + +![](http://www.unixmen.com/wp-content/uploads/2015/01/Syncthing-server-Mozilla-Firefox_016.png) + +添加系统1后,系统2网页管理界面中的控制窗口如下: + +![](http://www.unixmen.com/wp-content/uploads/2015/01/Syncthing-server-Mozilla-Firefox_018.png) + +![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/Syncthing-server-Mozilla-Firefox_018.png) + +现在,在任一个系统中的“**default**”文件夹中放进任意文件或文件夹。你应该可以看到这些文件/文件夹被自动同步到其它系统。 + +本文完!祝同步愉快! + +噢耶!!! + +- [Syncthing网站][2] + +-------------------------------------------------------------------------------- + +via: http://www.unixmen.com/syncthing-private-secure-tool-sync-filesfolders-computers/ + +作者:[SK][a] +译者:[XLCYun](https://github.com/XLCYun) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://www.unixmen.com/author/sk/ +[1]:https://github.com/syncthing/syncthing/releases/tag/v0.10.20 +[2]:http://syncthing.net/ From da16548e5225a2ec2f3286d2ef8098473dfb2f75 Mon Sep 17 00:00:00 2001 From: martin qi Date: Sat, 18 Jul 2015 15:05:38 +0800 Subject: [PATCH 631/965] translating --- ...BASH like line editing is supported GRUB Error In Linux.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150227 Fix Minimal BASH like line editing is supported GRUB Error In Linux.md b/sources/tech/20150227 Fix Minimal BASH like line editing is supported GRUB Error In Linux.md index 88b742d4f9..a1efae1a37 100644 --- a/sources/tech/20150227 Fix Minimal BASH like line editing is supported GRUB Error In Linux.md +++ b/sources/tech/20150227 Fix Minimal BASH like line editing is supported GRUB Error In Linux.md @@ -1,3 +1,5 @@ +translating... + Fix Minimal BASH like line editing is supported GRUB Error In Linux ================================================================================ The other day when I [installed Elementary OS in dual boot with Windows][1], I encountered a Grub error at the reboot time. I was presented with command line with error message: @@ -83,4 +85,4 @@ via: http://itsfoss.com/fix-minimal-bash-line-editing-supported-grub-error-linux [1]:http://itsfoss.com/guide-install-elementary-os-luna/ [2]:http://www.gnu.org/software/grub/ [3]:http://itsfoss.com/solve-error-partition-grub-rescue-ubuntu-linux/ -[4]:http://itsfoss.com/fix-failed-fetch-cdrom-aptget-update-add-cdroms/ \ No newline at end of file +[4]:http://itsfoss.com/fix-failed-fetch-cdrom-aptget-update-add-cdroms/ From d1137a590971b25595a9888c07e2f9246ef04a8a Mon Sep 17 00:00:00 2001 From: wxy Date: Sat, 18 Jul 2015 17:31:08 +0800 Subject: [PATCH 632/965] =?UTF-8?q?=E7=BF=BB=E8=AF=91=20PHP=20=E5=8D=87?= =?UTF-8?q?=E7=BA=A7=E5=A4=87=E6=B3=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sources/tech/PHP 7 upgrading.md | 626 ++++++++++++++++++++++++++++++++ 1 file changed, 626 insertions(+) create mode 100644 sources/tech/PHP 7 upgrading.md diff --git a/sources/tech/PHP 7 upgrading.md b/sources/tech/PHP 7 upgrading.md new file mode 100644 index 0000000000..aa1530644d --- /dev/null +++ b/sources/tech/PHP 7 upgrading.md @@ -0,0 +1,626 @@ +PHP 7.0 升级备注 +=============== + +1. 向后不兼容的变化 +2. 新功能 +3. SAPI 模块中的变化 +4. 废弃的功能 +5. 变化的功能 +6. 新功能 +7. 新的类和接口 +8. 移除的扩展和 SAPI +9. 扩展的其它变化 +10. 新的全局常量 +11. INI 文件处理的变化 +12. Windows 支持 +13. 其它变化 + + +##1. 向后不兼容的变化 + +###语言变化 + +####变量处理的变化 + +* 间接变量、属性和方法引用现在以从左到右的语义进行解释。一些例子: + + $$foo['bar']['baz'] // 解释做 ($$foo)['bar']['baz'] + $foo->$bar['baz'] // 解释做 ($foo->$bar)['baz'] + $foo->$bar['baz']() // 解释做 ($foo->$bar)['baz']() + Foo::$bar['baz']() // 解释做 (Foo::$bar)['baz']() + + 要恢复以前的行为,需要显式地加大括号: + + ${$foo['bar']['baz']} + $foo->{$bar['baz']} + $foo->{$bar['baz']}() + Foo::{$bar['baz']}() + +* 全局关键字现在只接受简单变量。像以前的 + + global $$foo->bar; + + 现在要求如下写法: + + global ${$foo->bar}; + +* 变量或函数调用的前后加上括号不再有任何影响。例如下列代码,函数调用结果以引用的方式传给一个函数 + + function getArray() { return [1, 2, 3]; } + + $last = array_pop(getArray()); + // Strict Standards: 只有变量可以用引用方式传递 + $last = array_pop((getArray())); + // Strict Standards: 只有变量可以用引用方式传递 + + 现在无论是否使用括号,都会抛出一个严格标准错误。以前在第二种调用方式下不会有提示。 + +* 数组元素或对象属性自动安装引用顺序创建,现在的结果顺序将不同。例如: + + $array = []; + $array["a"] =& $array["b"]; + $array["b"] = 1; + var_dump($array); + + 现在结果是 ["a" => 1, "b" => 1],而以前的结果是 ["b" => 1, "a" => 1]。 + +相关的 RFC: +* https://wiki.php.net/rfc/uniform_variable_syntax +* https://wiki.php.net/rfc/abstract_syntax_tree + +####list() 的变化 + +* list() 不再以反序赋值,例如: + + list($array[], $array[], $array[]) = [1, 2, 3]; + var_dump($array); + + 现在结果是 $array == [1, 2, 3] ,而不是 [3, 2, 1]。注意仅赋值**顺序**变化了,而赋值仍然一致(LCTT 译注:即以前的 list()行为是从后面的变量开始逐一赋值,这样对与上述用法就会产生 [3,2,1] 这样的结果了。)。例如,类似如下的常规用法 + + list($a, $b, $c) = [1, 2, 3]; + // $a = 1; $b = 2; $c = 3; + + 仍然保持当前的行为。 + +* 不再允许对空的 list() 赋值。如下全是无效的: + + list() = $a; + list(,,) = $a; + list($x, list(), $y) = $a; + +* list() 不再支持对字符串的拆分(以前也只在某些情况下支持)。如下代码: + + $string = "xy"; + list($x, $y) = $string; + + 现在的结果是: $x == null 和 $y == null (没有提示),而以前的结果是: + $x == "x" 和 $y == "y" 。此外, list() 现在总是可以处理实现了 ArrayAccess 的对象,例如: + + list($a, $b) = (object) new ArrayObject([0, 1]); + + 现在的结果是: $a == 0 和 $b == 1。 以前 $a 和 $b 都是 null。 + +相关 RFC: +* https://wiki.php.net/rfc/abstract_syntax_tree#changes_to_list +* https://wiki.php.net/rfc/fix_list_behavior_inconsistency + +####foreach 的变化 + +* foreach() 迭代不再影响数组内部指针,数组指针可通过 current()/next() 等系列的函数访问。例如: + + $array = [0, 1, 2]; + foreach ($array as &$val) { + var_dump(current($array)); + } + + 现在将指向值 int(0) 三次。以前的输出是 int(1)、int(2) 和 bool(false)。 + +* 在对数组按值迭代时,foreach 总是在对数组副本进行操作,在迭代中任何对数组的操作都不会影响到迭代行为。例如: + + $array = [0, 1, 2]; + $ref =& $array; // Necessary to trigger the old behavior + foreach ($array as $val) { + var_dump($val); + unset($array[1]); + } + + 现在将打印出全部三个元素 (0 1 2),而以前第二个元素 1 会跳过 (0 2)。 + +* 在对数组按引用迭代时,对数组的修改将继续会影响到迭代。不过,现在 PHP 在使用数字作为键时可以更好的维护数组内的位置。例如,在按引用迭代过程中添加数组元素: + + $array = [0]; + foreach ($array as &$val) { + var_dump($val); + $array[1] = 1; + } + + 现在迭代会正确的添加了元素。如上代码输出是 "int(0) int(1)",而以前只是 "int(0)"。 + +* 对普通(不可遍历的)对象按值或按引用迭代的行为类似于对数组进行按引用迭代。这符合以前的行为,除了如上一点所述的更精确的位置管理的改进。 + +* 对可遍历对象的迭代行为保持不变。 + +相关 RFC: https://wiki.php.net/rfc/php7_foreach + +####参数处理的变化 + +* 不能定义两个同名的函数参数。例如,下面的方法将会触发编译时错误: + + public function foo($a, $b, $unused, $unused) { + // ... + } + + 如上的代码应该修改使用不同的参数名,如: + + public function foo($a, $b, $unused1, $unused2) { + // ... + } + +* func\_get\_arg() 和 func\_get\_args() 函数不再返回传递给参数的原始值,而是返回其当前值(也许会被修改)。例如: + + function foo($x) { + $x++; + var_dump(func_get_arg(0)); + } + foo(1); + + 将会打印 "2" 而不是 "1"。代码应该改成仅在调用 func\_get\_arg(s) 后进行修改操作。 + + function foo($x) { + var_dump(func_get_arg(0)); + $x++; + } + + 或者应该避免修改参数: + + function foo($x) { + $newX = $x + 1; + var_dump(func_get_arg(0)); + } + +* 类似的,异常回溯也不再显示传递给函数的原始值,而是修改后的值。例如: + + function foo($x) { + $x = 42; + throw new Exception; + } + foo("string"); + + 现在堆栈跟踪的结果是: + + Stack trace: + #0 file.php(4): foo(42) + #1 {main} + + 而以前是: + + Stack trace: + #0 file.php(4): foo('string') + #1 {main} + + 这并不会影响到你的代码的运行时行为,值得注意的是在调试时会有所不同。 + + 同样的限制也会影响到 debug\_backtrace() 及其它检查函数参数的函数。 + +相关 RFC: https://wiki.php.net/phpng + +####整数处理的变化 + +* 无效的八进制表示(包含大于7的数字)现在会产生编译错误。例如,下列代码不再有效: + + $i = 0781; // 8 不是一个有效的八进制数字! + + 以前,无效的数字(以及无效数字后的任何数字)会简单的忽略。以前如上 $i 的值是 7,因为后两位数字会被悄悄丢弃。 + +* 二进制以负数镜像位移现在会抛出一个算术错误: + + var_dump(1 >> -1); + // ArithmeticError: 以负数进行位移 + +* 向左位移的位数超出了整型宽度时,结果总是 0。 + + var_dump(1 << 64); // int(0) + + 以前上述代码的结果依赖于所用的 CPU 架构。例如,在 x86(包括 x86-64) 上结果是 int(1),因为其位移操作数在范围内。 + +* 类似的,向右位移的位数超出了整型宽度时,其结果总是 0 或 -1 (依赖于符号): + + var_dump(1 >> 64); // int(0) + var_dump(-1 >> 64); // int(-1) + +相关 RFC: https://wiki.php.net/rfc/integer_semantics + +####字符串处理的变化 + +* 包含十六进制数字的字符串不会再被当做数字,也不会被特殊处理。参见例子中的新行为: + + var_dump("0x123" == "291"); // bool(false) (以前是 true) + var_dump(is_numeric("0x123")); // bool(false) (以前是 true) + var_dump("0xe" + "0x1"); // int(0) (以前是 16) + + var_dump(substr("foo", "0x1")); // string(3) "foo" (以前是 "oo") + // 注意:遇到了一个非正常格式的数字 + + filter\_var() 可以用来检查一个字符串是否包含了十六进制数字,或这个字符串是否能转换为整数: + + $str = "0xffff"; + $int = filter_var($str, FILTER_VALIDATE_INT, FILTER_FLAG_ALLOW_HEX); + if (false === $int) { + throw new Exception("Invalid integer!"); + } + var_dump($int); // int(65535) + +* 由于给双引号字符串和 HERE 文档增加了 Unicode 码点转义格式(Unicode Codepoint Escape Syntax), 所以带有无效序列的 "\u{" 现在会造成错误: + + $str = "\u{xyz}"; // 致命错误:无效的 UTF-8 码点转义序列 + + 要避免这种情况,需要转义开头的反斜杠: + + $str = "\\u{xyz}"; // 正确 + + 不过,不跟随 { 的 "\u" 不受影响。如下代码不会生成错误,和前面的一样工作: + + $str = "\u202e"; // 正确 + +相关 RFC: +* https://wiki.php.net/rfc/remove_hex_support_in_numeric_strings +* https://wiki.php.net/rfc/unicode_escape + +####错误处理的变化 + +* 现在有两个异常类: Exception 和 Error 。这两个类都实现了一个新接口: Throwable 。在异常处理代码中的类型指示也许需要修改来处理这种情况。 + +* 一些致命错误和可恢复的致命错误现在改为抛出一个 Error 。由于 Error 是一个独立于 Exception 的类,这些异常不会被已有的 try/catch 块捕获。 + + 可恢复的致命错误被转换为一个异常,所以它们不能在错误处理里面悄悄的忽略。部分情况下,类型指示失败不再能忽略。 + +* 解析错误现在会生成一个 Error 扩展的 ParseError 。除了以前的基于返回值 / error_get_last() 的处理,对某些可能无效的代码的 eval() 的错误处理应该改为捕获 ParseError 。 + +* 内部类的构造函数在失败时总是会抛出一个异常。以前一些构造函数会返回 NULL 或一个不可用的对象。 + +* 一些 E_STRICT 提示的错误级别改变了。 + +相关 RFC: +* https://wiki.php.net/rfc/engine_exceptions_for_php7 +* https://wiki.php.net/rfc/throwable-interface +* https://wiki.php.net/rfc/internal_constructor_behaviour +* https://wiki.php.net/rfc/reclassify_e_strict + +####其它的语言变化 + +* 静态调用一个不兼容的 $this 上下文的非静态调用的做法不再支持。这种情况下,$this 是没有定义的,但是对它的调用是允许的,并带有一个废弃提示。例子: + + class A { + public function test() { var_dump($this); } + } + + // 注意:没有从类 A 进行扩展 + class B { + public function callNonStaticMethodOfA() { A::test(); } + } + + (new B)->callNonStaticMethodOfA(); + + // 废弃:非静态方法 A::test() 不应该被静态调用 + // 提示:未定义的变量 $this + NULL + + 注意,这仅出现在来自不兼容上下文的调用上。如果类 B 扩展自类 A ,调用会被允许,没有任何提示。 + +* 不能使用下列类名、接口名和特殊名(大小写敏感): + + bool + int + float + string + null + false + true + + 这用于 class/interface/trait 声明、 class_alias() 和 use 语句中。 + + 此外,下列类名、接口名和特殊名保留做将来使用,但是使用时尚不会抛出错误: + + resource + object + mixed + numeric + +* yield 语句结构当用在一个表达式上下文时,不再要求括号。它现在是一个优先级在 “print” 和 “=>” 之间的右结合操作符。在某些情况下这会导致不同的行为,例如: + + echo yield -1; + // 以前被解释如下 + echo (yield) - 1; + // 现在被解释如下 + echo yield (-1); + + yield $foo or die; + // 以前被解释如下 + yield ($foo or die); + // 现在被解释如下 + (yield $foo) or die; + + 这种情况可以通过增加括号来解决。 + +* 移除了 ASP (\<%) 和 script (\ @@ -163,20 +161,20 @@ XSS 表示跨站点脚本。不像大部分攻击,该漏洞发生在客户端 ### 使用 SafeHTML ### -之前脚本的问题比较简单,它不允许任何类型的用户标记。不幸的是,这里有上百种方法能使 JavaScript 跳过用户的过滤器,从用户输入中剥离 HTML,没有方法可以防止这种情况。 +之前脚本的问题比较简单,它不允许任何类型的用户标记。不幸的是,这里有上百种方法能使 JavaScript 跳过用户的过滤器,并且要从用户输入中剥离全部 HTML,还没有方法可以防止这种情况。 当前,没有任何一个脚本能保证无法被破解,尽管有一些确实比大部分要好。有白名单和黑名单两种方法加固安全,白名单比较简单而且更加有效。 -一个白名单解决方案是 PixelApes 的 SafeHTML 反跨站点脚本解析器。 +一个白名单解决方案是 PixelApes 的 SafeHTML 反跨站脚本解析器。 SafeHTML 能识别有效 HTML,能追踪并剥离任何危险标签。它用另一个称为 HTMLSax 的软件包进行解析。 按照下面步骤安装和使用 SafeHTML: 1. 到 [http://pixel-apes.com/safehtml/?page=safehtml][1] 下载最新版本的 SafeHTML。 -1. 把文件放到你服务器的类文件夹。该文件夹包括 SafeHTML 和 HTMLSax 起作用需要的所有东西。 -1. 在脚本中包含 SafeHTML 类文件(safehtml.php)。 -1. 创建称为 $safehtml 的新 SafeHTML 对象。 +1. 把文件放到你服务器的类文件夹。该文件夹包括 SafeHTML 和 HTMLSax 功能所需的所有东西。 +1. 在脚本中 `include` SafeHTML 类文件(safehtml.php)。 +1. 创建一个名为 $safehtml 的新 SafeHTML 对象。 1. 用 $safehtml->parse() 方法清理你的数据。 这是一个完整的例子: @@ -203,45 +201,45 @@ SafeHTML 能识别有效 HTML,能追踪并剥离任何危险标签。它用另 你可能犯的最大错误是假设这个类能完全避免 XSS 攻击。SafeHTML 是一个相当复杂的脚本,几乎能检查所有事情,但没有什么是能保证的。你仍然需要对你的站点做参数验证。例如,该类不能检查给定变量的长度以确保能适应数据库的字段。它也不检查缓冲溢出问题。 -XSS 攻击者很有创造力,他们使用各种各样的方法来尝试达到他们的目标。可以阅读 RSnake 的 XSS 教程[http://ha.ckers.org/xss.html][2] 看一下这里有多少种方法尝试使代码跳过过滤器。SafeHTML 项目有很好的程序员一直在尝试阻止 XSS 攻击,但无法保证某些人不会想起一些奇怪和新奇的方法来跳过过滤器。 +XSS 攻击者很有创造力,他们使用各种各样的方法来尝试达到他们的目标。可以阅读 RSnake 的 XSS 教程[http://ha.ckers.org/xss.html][2] ,看一下这里有多少种方法尝试使代码跳过过滤器。SafeHTML 项目有很好的程序员一直在尝试阻止 XSS 攻击,但无法保证某些人不会想起一些奇怪和新奇的方法来跳过过滤器。 -**注意:XSS 攻击严重影响的一个例子 [http://namb.la/popular/tech.html][3],其中显示了如何一步一步创建会超载 MySpace 服务器的 JavaScript XSS 蠕虫。** +**注意:XSS 攻击严重影响的一个例子 [http://namb.la/popular/tech.html][3],其中显示了如何一步一步创建一个让 MySpace 服务器过载的 JavaScript XSS 蠕虫。** ### 用单向哈希保护数据 ### -该脚本对输入的数据进行单向转换-换句话说,它能对某人的密码产生哈希签名,但不能解码获得原始密码。为什么你希望这样呢?应用程序会存储密码。一个管理员不需要知道用户的密码-事实上,只有用户知道他的/她的密码是个好主意。系统(也仅有系统)应该能识别一个正确的密码;这是 Unix 多年来的密码安全模型。单向密码安全按照下面的方式工作: +该脚本对输入的数据进行单向转换,换句话说,它能对某人的密码产生哈希签名,但不能解码获得原始密码。为什么你希望这样呢?应用程序会存储密码。一个管理员不需要知道用户的密码,事实上,只有用户知道他/她自己的密码是个好主意。系统(也仅有系统)应该能识别一个正确的密码;这是 Unix 多年来的密码安全模型。单向密码安全按照下面的方式工作: -1. 当一个用户或管理员创建或更改一个账户密码时,系统对密码进行哈希并保存结果。主机系统忽视明文密码。 +1. 当一个用户或管理员创建或更改一个账户密码时,系统对密码进行哈希并保存结果。主机系统会丢弃明文密码。 2. 当用户通过任何方式登录到系统时,再次对输入的密码进行哈希。 -3. 主机系统抛弃输入的明文密码。 +3. 主机系统丢弃输入的明文密码。 4. 当前新哈希的密码和之前保存的哈希相比较。 5. 如果哈希的密码相匹配,系统就会授予访问权限。 -主机系统完成这些并不需要知道原始密码;事实上,原始值完全不相关。一个副作用是,如果某人侵入系统并盗取了密码数据库,入侵者会获得很多哈希后的密码,但无法把它们反向转换为原始密码。当然,给足够时间、计算能力,以及弱用户密码,一个攻击者还是有可能采用字典攻击找出密码。因此,别轻易让人碰你的密码数据库,如果确实有人这样做了,让每个用户更改他们的密码。 +主机系统完成这些并不需要知道原始密码;事实上,原始密码完全无所谓。一个副作用是,如果某人侵入系统并盗取了密码数据库,入侵者会获得很多哈希后的密码,但无法把它们反向转换为原始密码。当然,给足够时间、计算能力,以及弱用户密码,一个攻击者还是有可能采用字典攻击找出密码。因此,别轻易让人碰你的密码数据库,如果确实有人这样做了,让每个用户更改他们的密码。 #### 加密 Vs 哈希 #### -技术上来来说,这过程并不是加密。哈希和加密是不相同的,这有两个理由: +技术上来来说,哈希过程并不是加密。哈希和加密是不同的,这有两个理由: -不像加密,数据不能被解密。 +不像加密,哈希数据不能被解密。 -是有可能(但很不常见)两个不同的字符串会产生相同的哈希。并不能保证哈希是唯一的,因此别像数据库中的唯一键那样使用哈希。 +是有可能(但非常罕见)两个不同的字符串会产生相同的哈希。并不能保证哈希是唯一的,因此别像数据库中的唯一键那样使用哈希。 function hash_ish($string) { return md5($string); } -md5() 函数基于 RSA 数据安全公司的消息摘要算法(即 MD5)返回一个由 32 个字符组成的十六进制串。然后你可以将那个 32 位字符串插入到数据库中,和另一个 md5 字符串相比较,或者就用这 32 个字符。 +上面的 md5() 函数基于 RSA 数据安全公司的消息摘要算法(即 MD5)返回一个由 32 个字符组成的十六进制串。然后你可以将那个 32 位字符串插入到数据库中和另一个 md5 字符串相比较,或者直接用这 32 个字符。 #### 破解脚本 #### -几乎不可能解密 MD5 数据。或者说很难。但是,你仍然需要好的密码,因为根据整个字典生成哈希数据库仍然很简单。这里有在线 MD5 字典,当你输入 **06d80eb0c50b49a509b49f2424e8c805** 后会得到结果 “dog”。因此,尽管技术上 MD5 不能被解密,这里仍然有漏洞-如果某人获得了你的密码数据库,你可以肯定他们肯定会使用 MD5 字典破译。因此,当你创建基于密码的系统的时候尤其要注意密码长度(最小 6 个字符,8 个或许会更好)和包括字母和数字。并确保字典中没有这个密码。 +几乎不可能解密 MD5 数据。或者说很难。但是,你仍然需要好的密码,因为用一整个字典生成哈希数据库仍然很简单。有一些在线 MD5 字典,当你输入 **06d80eb0c50b49a509b49f2424e8c805** 后会得到结果 “dog”。因此,尽管技术上 MD5 不能被解密,这里仍然有漏洞,如果某人获得了你的密码数据库,你可以肯定他们肯定会使用 MD5 字典破译。因此,当你创建基于密码的系统的时候尤其要注意密码长度(最小 6 个字符,8 个或许会更好)和包括字母和数字。并确保这个密码不在字典中。 ### 用 Mcrypt 加密数据 ### -如果你不需要以可阅读形式查看密码,采用 MD5 就足够了。不幸的是,这里并不总是有可选项-如果你提供以加密形式存储某人的信用卡信息,你可能需要在后面的某个点进行解密。 +如果你不需要以可阅读形式查看密码,采用 MD5 就足够了。不幸的是,这里并不总是有可选项,如果你提供以加密形式存储某人的信用卡信息,你可能需要在后面的某个地方进行解密。 -最早的一个解决方案是 Mcrypt 模块,用于允许 PHP 高速加密的附件。Mcrypt 库提供了超过 30 种计算方法用于加密,并且提供短语确保只有你(或者你的用户)可以解密数据。 +最早的一个解决方案是 Mcrypt 模块,这是一个用于允许 PHP 高速加密的插件。Mcrypt 库提供了超过 30 种用于加密的计算方法,并且提供口令确保只有你(或者你的用户)可以解密数据。 让我们来看看使用方法。下面的脚本包含了使用 Mcrypt 加密和解密数据的函数: @@ -282,21 +280,21 @@ md5() 函数基于 RSA 数据安全公司的消息摘要算法(即 MD5)返 **mcrypt()** 函数需要几个信息: - 需要加密的数据 -- 用于加密和解锁数据的短语,也称为键。 +- 用于加密和解锁数据的口令,也称为键。 - 用于加密数据的计算方法,也就是用于加密数据的算法。该脚本使用了 **MCRYPT\_SERPENT\_256**,但你可以从很多算法中选择,包括 **MCRYPT\_TWOFISH192**、**MCRYPT\_RC2**、**MCRYPT\_DES**、和 **MCRYPT\_LOKI97**。 - 加密数据的模式。这里有几个你可以使用的模式,包括电子密码本(Electronic Codebook) 和加密反馈(Cipher Feedback)。该脚本使用 **MCRYPT\_MODE\_CBC** 密码块链接。 -- 一个 **初始化向量**-也称为 IV,或着一个种子-用于为加密算法设置种子的额外二进制位。也就是使算法更难于破解的额外信息。 -- 键和 IV 字符串的长度,这可能随着加密和块而不同。使用 **mcrypt\_get\_key\_size()** 和 **mcrypt\_get\_block\_size()** 函数获取合适的长度;然后用 **substr()** 函数将键的值截取为合适的长度。(如果键的长度比要求的短,别担心-Mcrypt 会用 0 填充。) +- 一个 **初始化向量**-也称为 IV 或者种子,用于为加密算法设置种子的额外二进制位。也就是使算法更难于破解的额外信息。 +- 键和 IV 字符串的长度,这可能随着加密和块而不同。使用 **mcrypt\_get\_key\_size()** 和 **mcrypt\_get\_block\_size()** 函数获取合适的长度;然后用 **substr()** 函数将键的值截取为合适的长度。(如果键的长度比要求的短,别担心,Mcrypt 会用 0 填充。) 如果有人窃取了你的数据和短语,他们只能一个个尝试加密算法直到找到正确的那一个。因此,在使用它之前我们通过对键使用 **md5()** 函数增加安全,就算他们获取了数据和短语,入侵者也不能获得想要的东西。 -入侵者同时需要函数,数据和短语-如果真是如此,他们可能获得了对你服务器的完整访问,你只能大清洗了。 +入侵者同时需要函数,数据和口令,如果真是如此,他们可能获得了对你服务器的完整访问,你只能大清洗了。 -这里还有一个数据存储格式的小问题。Mcrypt 以难懂的二进制形式返回加密后的数据,这使得当你将其存储到 MySQL 字段的时候可能出现可怕错误。因此,我们使用 **base64encode()** 和 **base64decode()** 函数转换为和 SQL 兼容的字母格式和检索行。 +这里还有一个数据存储格式的小问题。Mcrypt 以难懂的二进制形式返回加密后的数据,这使得当你将其存储到 MySQL 字段的时候可能出现可怕错误。因此,我们使用 **base64encode()** 和 **base64decode()** 函数转换为和 SQL 兼容的字母格式和可检索行。 #### 破解脚本 #### -除了实验多种加密方法,你还可以在脚本中添加一些便利。例如,不是每次都提供键和模式,而是在包含的文件中声明为全局常量。 +除了实验多种加密方法,你还可以在脚本中添加一些便利。例如,不用每次都提供键和模式,而是在包含的文件中声明为全局常量。 ### 生成随机密码 ### @@ -331,8 +329,8 @@ md5() 函数基于 RSA 数据安全公司的消息摘要算法(即 MD5)返 函数按照下面步骤工作: - 函数确保 **$num\_chars** 是非零的正整数。 -- 函数初始化 **$accepted\_chars** 变量为密码可能包含的字符列表。该脚本使用所有小写字母和数字 0 到 9,但你可以使用你喜欢的任何字符集合。 -- 随机数生成器需要一个种子,从而获得一系列类随机值(PHP 4.2 及之后版本中并不严格要求)。 +- 函数初始化 **$accepted\_chars** 变量为密码可能包含的字符列表。该脚本使用所有小写字母和数字 0 到 9,但你可以使用你喜欢的任何字符集合。(LCTT 译注:有时候为了便于肉眼识别,你可以将其中的 0 和 O,1 和 l 之类的都去掉。) +- 随机数生成器需要一个种子,从而获得一系列类随机值(PHP 4.2 及之后版本中并不需要,会自动播种)。 - 函数循环 **$num\_chars** 次,每次迭代生成密码中的一个字符。 - 对于每个新字符,脚本查看 **$accepted_chars** 的长度,选择 0 和长度之间的一个数字,然后添加 **$accepted\_chars** 中该数字为索引值的字符到 $password。 - 循环结束后,函数返回 **$password**。 @@ -347,7 +345,7 @@ via: http://www.codeproject.com/Articles/363897/PHP-Security 作者:[SamarRizvi][a] 译者:[ictlyh](https://github.com/ictlyh) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From b3dfd8ac4c6eac6bc6f66683a20ea08f387a7c78 Mon Sep 17 00:00:00 2001 From: ZTinoZ Date: Thu, 23 Jul 2015 10:06:27 +0800 Subject: [PATCH 666/965] Translating by ZTinoZ --- ...709 7 command line tools for monitoring your Linux system.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/talk/20150709 7 command line tools for monitoring your Linux system.md b/sources/talk/20150709 7 command line tools for monitoring your Linux system.md index 8b0772f7b6..e036a70d50 100644 --- a/sources/talk/20150709 7 command line tools for monitoring your Linux system.md +++ b/sources/talk/20150709 7 command line tools for monitoring your Linux system.md @@ -42,7 +42,7 @@ ps命令展现的是正在运行中的进程列表。在这种情况下,我们 ### Pstree ### -Pstree “shows running processes as a tree. The tree is rooted at either pid or init if pid is omitted. If a user name is specified, all process trees rooted at processes owned by that user are shown.”This is a really useful tool as the tree helps you sort out which process is dependent on which process (go [here][9]). +Pstree“以树状图显示正在运行中的进程。如果pid被省略的话那树结构是以pid或init为父进程,如果用户名指定,那所有进程树都会以该用户所属的进程为父进程进行显示。”以树状图来帮你将进程之间的所属关系进行分类,这的确是个很有效的工具(戳[这里][9])。 ![Image courtesy Mark Gibbs](http://images.techhive.com/images/article/2015/06/command-line-tools-monitoring-linux-system-8-100591907-orig.png) From 8a7c166f3f17ef0cb41f2df39c3aa5b7e18f3a94 Mon Sep 17 00:00:00 2001 From: joeren Date: Thu, 23 Jul 2015 10:22:59 +0800 Subject: [PATCH 667/965] Update 20150722 How to Use and Execute PHP Codes in Linux Command Line--Part 1.md --- ... Use and Execute PHP Codes in Linux Command Line--Part 1.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150722 How to Use and Execute PHP Codes in Linux Command Line--Part 1.md b/sources/tech/20150722 How to Use and Execute PHP Codes in Linux Command Line--Part 1.md index 8f61e092f0..7e9688ed4a 100644 --- a/sources/tech/20150722 How to Use and Execute PHP Codes in Linux Command Line--Part 1.md +++ b/sources/tech/20150722 How to Use and Execute PHP Codes in Linux Command Line--Part 1.md @@ -1,3 +1,4 @@ +Translatign by GOLinux! How to Use and Execute PHP Codes in Linux Command Line – Part 1 ================================================================================ PHP is an open source server side scripting Language which originally stood for ‘Personal Home Page‘ now stands for ‘PHP: Hypertext Preprocessor‘, which is a recursive acronym. It is a cross platform scripting language which is highly influenced by C, C++ and Java. @@ -180,4 +181,4 @@ via: http://www.tecmint.com/run-php-codes-from-linux-commandline/ 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 [a]:http://www.tecmint.com/author/avishek/ -[1]:http://www.tecmint.com/execute-php-codes-functions-in-linux-commandline/ \ No newline at end of file +[1]:http://www.tecmint.com/execute-php-codes-functions-in-linux-commandline/ From 38abc4e6d675bd8e713c52aa9aea447eee89868b Mon Sep 17 00:00:00 2001 From: joeren Date: Thu, 23 Jul 2015 12:06:33 +0800 Subject: [PATCH 668/965] [Translated]20150722 How to Use and Execute PHP Codes in Linux Command Line--Part 1.md --- ...PHP Codes in Linux Command Line--Part 1.md | 184 ------------------ ...PHP Codes in Linux Command Line--Part 1.md | 174 +++++++++++++++++ 2 files changed, 174 insertions(+), 184 deletions(-) delete mode 100644 sources/tech/20150722 How to Use and Execute PHP Codes in Linux Command Line--Part 1.md create mode 100644 translated/tech/20150722 How to Use and Execute PHP Codes in Linux Command Line--Part 1.md diff --git a/sources/tech/20150722 How to Use and Execute PHP Codes in Linux Command Line--Part 1.md b/sources/tech/20150722 How to Use and Execute PHP Codes in Linux Command Line--Part 1.md deleted file mode 100644 index 7e9688ed4a..0000000000 --- a/sources/tech/20150722 How to Use and Execute PHP Codes in Linux Command Line--Part 1.md +++ /dev/null @@ -1,184 +0,0 @@ -Translatign by GOLinux! -How to Use and Execute PHP Codes in Linux Command Line – Part 1 -================================================================================ -PHP is an open source server side scripting Language which originally stood for ‘Personal Home Page‘ now stands for ‘PHP: Hypertext Preprocessor‘, which is a recursive acronym. It is a cross platform scripting language which is highly influenced by C, C++ and Java. - -![Run PHP Codes in Linux Command Line](http://www.tecmint.com/wp-content/uploads/2015/07/php-command-line-usage.jpeg) - -Run PHP Codes in Linux Command Line – Part 1 - -A PHP Syntax is very similar to Syntax in C, Java and Perl Programming Language with a few PHP-specific feature. PHP is used by some 260 Million websites, as of now. The current stable release is PHP Version 5.6.10. - -PHP is HTML embedded script which facilitates developers to write dynamically generated pages quickly. PHP is primarily used on Server-side (and JavaScript on Client Side) to generate dynamic web pages over HTTP, however you will be surprised to know that you can execute a PHP in a Linux Terminal without the need of a web browser. - -This article aims at throwing light on the command-line aspect of PHP scripting Language. - -**1. After PHP and Apache2 installation, we need to install PHP command Line Interpreter.** - - # apt-get install php5-cli [Debian and alike System) - # yum install php-cli [CentOS and alike System) - -Next thing, we do is to test a php (if installed correctly or not) commonly as by creating a file `infophp.php` at location ‘/var/www/html‘ (Apache2 working directory in most of the distros), with the content ``, simply by running the below command. - - # echo '' > /var/www/html/infophp.php - -and then point your browser to http://127.0.0.1/infophp.php which opens this file in web browser. - -![Check PHP Info](http://www.tecmint.com/wp-content/uploads/2015/07/Check-PHP-Info.png) - -Check PHP Info - -Same results can be obtained from the Linux terminal without the need of any browser. Run the PHP file located at ‘/var/www/html/infophp.php‘ in Linux Command Line as: - - # php -f /var/www/html/infophp.php - -![Check PHP info from Commandline](http://www.tecmint.com/wp-content/uploads/2015/07/Check-PHP-info-from-Commandline.png) - -Check PHP info from Commandline - -Since the output is too big we can pipeline the above output with ‘less‘ command to get one screen output at a time, simply as: - - # php -f /var/www/html/infophp.php | less - -![Check All PHP Info](http://www.tecmint.com/wp-content/uploads/2015/07/Check-All-PHP-Info.png) - -Check All PHP Info - -Here Option ‘-f‘ parse and execute the file that follows the command. - -**2. We can use `phpinfo()` which is a very valuable debugging tool directly on the Linux command-line without the need of calling it from a file, simply as:** - - # php -r 'phpinfo();' - -![PHP Debugging Tool](http://www.tecmint.com/wp-content/uploads/2015/07/PHP-Debugging-Tool.png) - -PHP Debugging Tool - -Here the option ‘-r‘ run the PHP Code in the Linux Terminal directly without tags `<` and `>`. - -**3. Run PHP in Interactive mode and do some mathematics. Here option ‘-a‘ is for running PHP in Interactive Mode.** - - # php -a - - Interactive shell - - php > echo 2+3; - 5 - php > echo 9-6; - 3 - php > echo 5*4; - 20 - php > echo 12/3; - 4 - php > echo 12/5; - 2.4 - php > echo 2+3-1; - 4 - php > echo 2+3-1*3; - 2 - php > exit - -Press ‘exit‘ or ‘ctrl+c‘ to close PHP interactive mode. - -![Enable PHP Interactive Mode](http://www.tecmint.com/wp-content/uploads/2015/07/Enable-PHP-interactive-mode1.png) - -Enable PHP Interactive Mode - -**4. You can run a PHP script simply as, if it is a shell script. First Create a PHP sample script in your current working directory.** - - # echo -e '#!/usr/bin/php\n' > phpscript.php - -Notice we used #!/usr/bin/php in the first line of this PHP script as we use to do in shell script (/bin/bash). The first line #!/usr/bin/php tells the Linux Command-Line to parse this script file to PHP Interpreter. - -Second make it executable as: - - # chmod 755 phpscript.php - -and run it as, - - # ./phpscript.php - -**5. You will be surprised to know you can create simple functions all by yourself using the interactive shell. Here is the step-by step instruction.** - -Start PHP interactive mode. - - # php -a - -Create a function and name it addition. Also declare two variables $a and $b. - - php > function addition ($a, $b) - -Use curly braces to define rules in between them for this function. - - php > { - -Define Rule(s). Here the rule say to add the two variables. - - php { echo $a + $b; - -All rules defined. Enclose rules by closing curly braces. - - php {} - -Test function and add digits 4 and 3 simply as : - - php > var_dump (addition(4,3)); - -#### Sample Output #### - - 7NULL - -You may run the below code to execute the function, as many times as you want with different values. Replace a and b with values of yours. - - php > var_dump (addition(a,b)); - ----------- - - php > var_dump (addition(9,3.3)); - -#### Sample Output #### - - 12.3NULL - -![Create PHP Functions](http://www.tecmint.com/wp-content/uploads/2015/07/Create-PHP-Functions.png) - -Create PHP Functions - -You may run this function till you quit interactive mode (Ctrl+z). Also you would have noticed that in the above output the data type returned is NULL. This can be fixed by asking php interactive shell to return in place of echo. - -Simply replace the ‘echo‘ statement in the above function with ‘return‘ - -Replace - - php { echo $a + $b; - -with - - php { return $a + $b; - -and rest of the things and principles remain same. - -Here is an Example, which returns appropriate data-type in the output. - -![PHP Functions](http://www.tecmint.com/wp-content/uploads/2015/07/PHP-Functions.png) - -PHP Functions - -Always Remember, user defined functions are not saved in history from shell session to shell session, hence once you exit the interactive shell, it is lost. - -Hope you liked this session. Keep Connected for more such posts. Stay Tuned and Healthy. Provide us with your valuable feedback in the comments. Like ans share us and help us get spread. - -Read Also: [12 Useful PHP Commandline Usage on Linux Terminal – Part 2][1] - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/run-php-codes-from-linux-commandline/ - -作者:[vishek Kumar][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.tecmint.com/author/avishek/ -[1]:http://www.tecmint.com/execute-php-codes-functions-in-linux-commandline/ diff --git a/translated/tech/20150722 How to Use and Execute PHP Codes in Linux Command Line--Part 1.md b/translated/tech/20150722 How to Use and Execute PHP Codes in Linux Command Line--Part 1.md new file mode 100644 index 0000000000..1d69a7c746 --- /dev/null +++ b/translated/tech/20150722 How to Use and Execute PHP Codes in Linux Command Line--Part 1.md @@ -0,0 +1,174 @@ +Linux命令行中使用和执行PHP代码——第一部分 +================================================================================ +PHP是一个开元服务器端脚本语言,最初这三个字母代表的是“Personal Home Page”,而现在则代表的是“PHP:Hypertext Preprocessor”,它是个递归首字母缩写。它是一个跨平台脚本语言,深受C、C++和Java的影响。 +![Run PHP Codes in Linux Command Line](http://www.tecmint.com/wp-content/uploads/2015/07/php-command-line-usage.jpeg) +Linux命令行中运行PHP代码——第一部分 + +PHP的语法和C、Java以及带有一些PHP特性的Perl变成语言中的语法十分相似,它眼下大约正被2.6亿个网站所使用,当前最新的稳定版本是PHP版本5.6.10。 + +PHP是HTML的嵌入脚本,它便于开发人员快速写出动态生成的页面。PHP主要用于服务器端(而Javascript则用于客户端)以通过HTTP生成动态网页,然而,当你知道可以在Linux终端中不需要网页浏览器来执行PHP时,你或许会大为惊讶。 + +本文将阐述PHP脚本语言的命令行方面。 + +**1. 在安装完PHP和Apache2后,我们需要安装PHP命令行解释器。** + + # apt-get install php5-cli [Debian and alike System) + # yum install php-cli [CentOS and alike System) + +接下来我们通常要做的是,在‘/var/www/html‘(这是 Apache2 在大多数发行版中的工作目录)这个位置创建一个内容为 ‘‘,名为 ‘infophp.php‘ 的文件来测试(是否安装正确),执行以下命令即可。 + + # echo '' > /var/www/html/infophp.php + +然后,将浏览器指向http://127.0.0.1/infophp.php, 这将会在网络浏览器中打开该文件。 + +![Check PHP Info](http://www.tecmint.com/wp-content/uploads/2015/07/Check-PHP-Info.png) +检查PHP信息 + +不需要任何浏览器,在Linux终端中也可以获得相同的结果。在Linux命令行中执行‘/var/www/html/infophp.php‘,如: + + # php -f /var/www/html/infophp.php + +![Check PHP info from Commandline](http://www.tecmint.com/wp-content/uploads/2015/07/Check-PHP-info-from-Commandline.png) +从命令行检查PHP信息 + +由于输出结果太大,我们可以通过管道将上述输出结果输送给 ‘less‘ 命令,这样就可以一次输出一屏了,命令如下: + + # php -f /var/www/html/infophp.php | less + +![Check All PHP Info](http://www.tecmint.com/wp-content/uploads/2015/07/Check-All-PHP-Info.png) +检查所有PHP信息 + +这里,‘-f‘选项解析病执行命令后跟随的文件。 + +**2. 我们可以直接在Linux命令行使用`phpinfo()`这个十分有价值的调试工具而不需要从文件来调用,只需执行以下命令:** + + # php -r 'phpinfo();' + +![PHP Debugging Tool](http://www.tecmint.com/wp-content/uploads/2015/07/PHP-Debugging-Tool.png) +PHP调试工具 + +这里,‘-r‘ 选项会让PHP代码在Linux终端中不带`<`和`>`标记直接执行。 + +**3. 以交互模式运行PHP并做一些数学运算。这里,‘-a‘ 选项用于以交互模式运行PHP。** + + # php -a + + Interactive shell + + php > echo 2+3; + 5 + php > echo 9-6; + 3 + php > echo 5*4; + 20 + php > echo 12/3; + 4 + php > echo 12/5; + 2.4 + php > echo 2+3-1; + 4 + php > echo 2+3-1*3; + 2 + php > exit + +输入 ‘exit‘ 或者按下 ‘ctrl+c‘ 来关闭PHP交互模式。 + +![Enable PHP Interactive Mode](http://www.tecmint.com/wp-content/uploads/2015/07/Enable-PHP-interactive-mode1.png) +启用PHP交互模式 + +**4. 你可以仅仅将PHP脚本作为shell脚本来运行。首先,创建在你当前工作目录中创建一个PHP样例脚本。** + + # echo -e '#!/usr/bin/php\n' > phpscript.php + +注意,我们在该PHP脚本的第一行使用#!/usr/bin/php,就像在shell脚本中那样(/bin/bash)。第一行的#!/usr/bin/php告诉Linux命令行将该脚本文件解析到PHP解释器中。 + +其次,让该脚本可执行: + + # chmod 755 phpscript.php + +接着来运行它, + + # ./phpscript.php + +**5. 你可以完全靠自己通过交互shell来创建简单函数,这你一定会被惊到了。下面是循序渐进的指南。** + +开启PHP交互模式。 + + # php -a + +创建一个函授,将它命名为 addition。同时,声明两个变量 $a 和 $b。 + + php > function addition ($a, $b) + +使用花括号来在其间为该函数定义规则。 + + php > { + +定义规则。这里,该规则讲的是添加这两个变量。 + + php { echo $a + $b; + +所有规则定义完毕,通过闭合花括号来封装规则。 + + php {} + +测试函数,添加数字4和3,命令如下: + + php > var_dump (addition(4,3)); + +#### 样例输出 #### + + 7NULL + +你可以运行以下代码来执行该函数,你可以测试不同的值,你想来多少次都行。将里头的 a 和 b 替换成你自己的值。 + + php > var_dump (addition(a,b)); + +---------- + + php > var_dump (addition(9,3.3)); + +#### 样例输出 #### + + 12.3NULL + +![Create PHP Functions](http://www.tecmint.com/wp-content/uploads/2015/07/Create-PHP-Functions.png) +创建PHP函数 + +你可以一直运行该函数,直至退出交互模式(ctrl+z)。同时,你也应该注意到了,上面输出结果中返回的数据类型为 NULL。这个问题可以通过要求 php 交互 shell用 return 代替 echo 返回结果来修复。 + +只需要在上面的函数的中 ‘echo‘ 声明用 ‘return‘ 来替换 + +替换 + + php { echo $a + $b; + +为 + + php { return $a + $b; + +剩下的东西和原理仍然一样。 + +这里是一个样例,在该样例的输出结果中返回了正确的数据类型。 + +![PHP Functions](http://www.tecmint.com/wp-content/uploads/2015/07/PHP-Functions.png) +PHP函数 + +永远都记住,用户定义的函数不会从一个shell会话保留到下一个shell会话,因此,一旦你退出交互shell,它就会丢失了。 + +希望你喜欢此次会话。保持连线,你会获得更多此类文章。保持关注,保持健康。请在下面的评论中为我们提供有价值的反馈。点赞并分享,帮助我们扩散。 + +还请阅读: [12个Linux终端中有用的的PHP命令行用法——第二部分][1] + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/run-php-codes-from-linux-commandline/ + +作者:[vishek Kumar][a] +译者:[GOLinux](https://github.com/GOLinux) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/avishek/ +[1]:http://www.tecmint.com/execute-php-codes-functions-in-linux-commandline/ From e4476460b8126830f1e06033a3c1ea44262d1670 Mon Sep 17 00:00:00 2001 From: joeren Date: Thu, 23 Jul 2015 12:11:51 +0800 Subject: [PATCH 669/965] Update 20150722 12 Useful PHP Commandline Usage Every Linux User Must Know.md --- ... Useful PHP Commandline Usage Every Linux User Must Know.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150722 12 Useful PHP Commandline Usage Every Linux User Must Know.md b/sources/tech/20150722 12 Useful PHP Commandline Usage Every Linux User Must Know.md index 88e20ea18f..8833405982 100644 --- a/sources/tech/20150722 12 Useful PHP Commandline Usage Every Linux User Must Know.md +++ b/sources/tech/20150722 12 Useful PHP Commandline Usage Every Linux User Must Know.md @@ -1,3 +1,4 @@ +Translating by GOLinu! 12 Useful PHP Commandline Usage Every Linux User Must Know ================================================================================ In my last post “[How to Use and Execute PHP Codes in Linux Command – line][1]”, I emphasized on running PHP codes directly in Linux Command-line as well as executing PHP script file in Linux Terminal. @@ -200,4 +201,4 @@ via: http://www.tecmint.com/execute-php-codes-functions-in-linux-commandline/ 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 [a]:http://www.tecmint.com/author/avishek/ -[1]:http://www.tecmint.com/run-php-codes-from-linux-commandline/ \ No newline at end of file +[1]:http://www.tecmint.com/run-php-codes-from-linux-commandline/ From 3e14e95358c71130aab49568d23dd8c9be32175e Mon Sep 17 00:00:00 2001 From: GOLinux Date: Thu, 23 Jul 2015 12:15:00 +0800 Subject: [PATCH 670/965] Update 20150722 12 Useful PHP Commandline Usage Every Linux User Must Know.md --- ... Useful PHP Commandline Usage Every Linux User Must Know.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150722 12 Useful PHP Commandline Usage Every Linux User Must Know.md b/sources/tech/20150722 12 Useful PHP Commandline Usage Every Linux User Must Know.md index 88e20ea18f..8833405982 100644 --- a/sources/tech/20150722 12 Useful PHP Commandline Usage Every Linux User Must Know.md +++ b/sources/tech/20150722 12 Useful PHP Commandline Usage Every Linux User Must Know.md @@ -1,3 +1,4 @@ +Translating by GOLinu! 12 Useful PHP Commandline Usage Every Linux User Must Know ================================================================================ In my last post “[How to Use and Execute PHP Codes in Linux Command – line][1]”, I emphasized on running PHP codes directly in Linux Command-line as well as executing PHP script file in Linux Terminal. @@ -200,4 +201,4 @@ via: http://www.tecmint.com/execute-php-codes-functions-in-linux-commandline/ 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 [a]:http://www.tecmint.com/author/avishek/ -[1]:http://www.tecmint.com/run-php-codes-from-linux-commandline/ \ No newline at end of file +[1]:http://www.tecmint.com/run-php-codes-from-linux-commandline/ From f972649a7ec5e459155312cf7582ca93851b0ce0 Mon Sep 17 00:00:00 2001 From: ZTinoZ Date: Thu, 23 Jul 2015 17:48:02 +0800 Subject: [PATCH 671/965] Translating by ZTinoZ --- ...709 7 command line tools for monitoring your Linux system.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/talk/20150709 7 command line tools for monitoring your Linux system.md b/sources/talk/20150709 7 command line tools for monitoring your Linux system.md index e036a70d50..caac29be68 100644 --- a/sources/talk/20150709 7 command line tools for monitoring your Linux system.md +++ b/sources/talk/20150709 7 command line tools for monitoring your Linux system.md @@ -48,7 +48,7 @@ Pstree“以树状图显示正在运行中的进程。如果pid被省略的话 ### pmap ### -Understanding just how an app uses memory is often crucial in debugging, and the pmap produces just such information when given a process ID (PID). The screenshot shows the medium weight output generated by using the “-x”switch. You can get pmap to produce even more detailed information using the “-X”switch but you’ll need a much wider terminal window. +理解一个应用程序在调试过程中如何使用内存是至关重要的,而pmap的作用就是当给出一个进程ID(PID)时显示出相关信息。上面的截图展示的是使用“-x”选项所产生的部分输出,你也可以用pmap的“-X”选项来获取更多的细节信息但是前提是你要有个更宽的终端窗口。 ![Image courtesy Mark Gibbs](http://images.techhive.com/images/article/2015/06/command-line-tools-monitoring-linux-system-9-100591900-orig.png) From 5bd7b0f495a39aef19acd0fe928247b6e1af1b16 Mon Sep 17 00:00:00 2001 From: alim0x Date: Thu, 23 Jul 2015 19:01:37 +0800 Subject: [PATCH 672/965] [translating]17 - The history of Android.md --- .../The history of Android/17 - The history of Android.md | 4 +++- .../16 - The history of Android.md | 0 2 files changed, 3 insertions(+), 1 deletion(-) rename translated/talk/{The-history-of-Android => The history of Android}/16 - The history of Android.md (100%) diff --git a/sources/talk/The history of Android/17 - The history of Android.md b/sources/talk/The history of Android/17 - The history of Android.md index 5422877252..2e60a864ab 100644 --- a/sources/talk/The history of Android/17 - The history of Android.md +++ b/sources/talk/The history of Android/17 - The history of Android.md @@ -1,3 +1,5 @@ +alim0x translating + The history of Android ================================================================================ ![The Honeycomb app lineup lost a ton of apps. This also shows the notification panel and the new quick settings.](http://cdn.arstechnica.net/wp-content/uploads/2014/02/apps-and-notifications2.png) @@ -83,4 +85,4 @@ via: http://arstechnica.com/gadgets/2014/06/building-android-a-40000-word-histor 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 [a]:http://arstechnica.com/author/ronamadeo -[t]:https://twitter.com/RonAmadeo \ No newline at end of file +[t]:https://twitter.com/RonAmadeo diff --git a/translated/talk/The-history-of-Android/16 - The history of Android.md b/translated/talk/The history of Android/16 - The history of Android.md similarity index 100% rename from translated/talk/The-history-of-Android/16 - The history of Android.md rename to translated/talk/The history of Android/16 - The history of Android.md From 42e46ee30dfb38c81590e008873021413ce9696b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=AE=A6=E6=88=90?= Date: Thu, 23 Jul 2015 20:00:49 +0800 Subject: [PATCH 673/965] Done --- ...ntial Commands and System Documentation.md | 179 +++++++++--------- 1 file changed, 92 insertions(+), 87 deletions(-) diff --git a/sources/tech/RHCSA Series/RHCSA Series--Part 01--Reviewing Essential Commands and System Documentation.md b/sources/tech/RHCSA Series/RHCSA Series--Part 01--Reviewing Essential Commands and System Documentation.md index ad3cecd0a2..93c2787c7e 100644 --- a/sources/tech/RHCSA Series/RHCSA Series--Part 01--Reviewing Essential Commands and System Documentation.md +++ b/sources/tech/RHCSA Series/RHCSA Series--Part 01--Reviewing Essential Commands and System Documentation.md @@ -10,174 +10,178 @@ RHCSA 考试准备指南 RHCSA 考试(考试编号 EX200)通过后可以获取由Red Hat 公司颁发的证书. RHCSA 考试是RHCT(红帽认证技师)的升级版,而且RHCSA必须在新的Red Hat Enterprise Linux(红帽企业版)下完成.RHCT和RHCSA的主要变化就是RHCT基于 RHEL5 , 而RHCSA基于RHEL6或者7, 这两个认证的等级也有所不同. -This Red Hat Certified System Administrator (RHCSA) is essential to perform the following core system administration tasks needed in Red Hat Enterprise Linux environments: +红帽认证管理员所会的最基础的是在红帽企业版的环境下执行如下系统管理任务: -- Understand and use necessary tools for handling files, directories, command-environments line, and system-wide / packages documentation. -- Operate running systems, even in different run levels, identify and control processes, start and stop virtual machines. -- Set up local storage using partitions and logical volumes. -- Create and configure local and network file systems and its attributes (permissions, encryption, and ACLs). -- Setup, configure, and control systems, including installing, updating and removing software. -- Manage system users and groups, along with use of a centralized LDAP directory for authentication. -- Ensure system security, including basic firewall and SELinux configuration. +- 理解并会使用命令管理文件、目录、命令行以及系统/软件包的文档 +- 使用不同的启动等级启动系统,认证和控制进程,启动或停止虚拟机 +- 使用分区和逻辑卷管理本地存储 +- 创建并且配置本地文件系统和网络文件系统,设置他们的属性(许可、加密、访问控制表) +- 部署、配置、并且控制系统,包括安装、升级和卸载软件 +- 管理系统用户和组,独立使用集中制的LDAP目录权限控制 +- 确保系统安全,包括基础的防火墙规则和SELinux配置 -To view fees and register for an exam in your country, check the [RHCSA Certification page][1]. -To view fees and register for an exam in your country, check the RHCSA Certification page. +关于你所在国家的考试注册费用参考 [RHCSA Certification page][1]. -In this 15-article RHCSA series, titled Preparation for the RHCSA (Red Hat Certified System Administrator) exam, we will going to cover the following topics on the latest releases of Red Hat Enterprise Linux 7. +关于你所在国家的考试注册费用参考RHCSA 认证页面 -- Part 1: Reviewing Essential Commands & System Documentation -- Part 2: How to Perform File and Directory Management in RHEL 7 -- Part 3: How to Manage Users and Groups in RHEL 7 -- Part 4: Editing Text Files with Nano and Vim / Analyzing text with grep and regexps -- Part 5: Process Management in RHEL 7: boot, shutdown, and everything in between -- Part 6: Using ‘Parted’ and ‘SSM’ to Configure and Encrypt System Storage -- Part 7: Using ACLs (Access Control Lists) and Mounting Samba / NFS Shares -- Part 8: Securing SSH, Setting Hostname and Enabling Network Services -- Part 9: Installing, Configuring and Securing a Web and FTP Server -- Part 10: Yum Package Management, Automating Tasks with Cron and Monitoring System Logs -- Part 11: Firewall Essentials and Control Network Traffic Using FirewallD and Iptables -- Part 12: Automate RHEL 7 Installations Using ‘Kickstart’ -- Part 13: RHEL 7: What is SELinux and how it works? -- Part 14: Use LDAP-based authentication in RHEL 7 -- Part 15: Virtualization in RHEL 7: KVM and Virtual machine management -In this Part 1 of the RHCSA series, we will explain how to enter and execute commands with the correct syntax in a shell prompt or terminal, and explained how to find, inspect, and use system documentation. +在这个有15章的RHCSA(红帽认证管理员)备考系列,我们将覆盖以下的关于红帽企业Linux第七版的最新的信息 + +- Part 1: 回顾必会的命令和系统文档 +- Part 2: 在RHEL7如何展示文件和管理目录 +- Part 3: 在RHEL7中如何管理用户和组 +- Part 4: 使用nano和vim管理命令/ 使用grep和正则表达式分析文本 +- Part 5: RHEL7的进程管理:启动,关机,以及其他介于二者之间的. +- Part 6: 使用 'Parted'和'SSM'来管理和加密系统存储 +- Part 7: 使用ACLs(访问控制表)并挂载 Samba /NFS 文件分享 +- Part 8: 加固SSH,设置主机名并开启网络服务 +- Part 9: 安装、配置和加固一个Web,FTP服务器 +- Part 10: Yum 包管理方式,使用Cron进行自动任务管理以及监控系统日志 +- Part 11: 使用FirewallD和Iptables设置防火墙,控制网络流量 +- Part 12: 使用Kickstart 自动安装RHEL 7 +- Part 13: RHEL7:什么是SeLinux?他的原理是什么? +- Part 14: 在RHEL7 中使用基于LDAP的权限控制 +- Part 15: RHEL7的虚拟化:KVM 和虚拟机管理 + +在第一章,我们讲解如何输入和运行正确的命令在终端或者Shell窗口,并且讲解如何找到、插入,以及使用系统文档 ![RHCSA: Reviewing Essential Linux Commands – Part 1](http://www.tecmint.com/wp-content/uploads/2015/02/Reviewing-Essential-Linux-Commands.png) -RHCSA: Reviewing Essential Linux Commands – Part 1 +RHCSA:回顾必会的Linux命令 - 第一部分 -#### Prerequisites: #### +#### 前提: #### -At least a slight degree of familiarity with basic Linux commands such as: +至少你要熟悉如下命令 -- [cd command][2] (change directory) -- [ls command][3] (list directory) -- [cp command][4] (copy files) -- [mv command][5] (move or rename files) -- [touch command][6] (create empty files or update the timestamp of existing ones) -- rm command (delete files) -- mkdir command (make directory) +- [cd command][2] (改变目录) +- [ls command][3] (列举文件) +- [cp command][4] (复制文件) +- [mv command][5] (移动或重命名文件) +- [touch command][6] (创建一个新的文件或更新已存在文件的时间表) +- rm command (删除文件) +- mkdir command (创建目录) -The correct usage of some of them are anyway exemplified in this article, and you can find further information about each of them using the suggested methods in this article. +在这篇文章中你将会找到更多的关于如何更好的使用他们的正确用法和特殊用法. -Though not strictly required to start, as we will be discussing general commands and methods for information search in a Linux system, you should try to install RHEL 7 as explained in the following article. It will make things easier down the road. +虽然没有严格的要求,但是作为讨论常用的Linux命令和方法,你应该安装RHEL7 来尝试使用文章中提到的命令.这将会使你学习起来更省力. -- [Red Hat Enterprise Linux (RHEL) 7 Installation Guide][7] +- [红帽企业版Linux(RHEL)7 安装指南][7] -### Interacting with the Linux Shell ### +### 使用Shell进行交互 ### +如果我们使用文本模式登陆Linux,我们就无法使用鼠标在默认的shell。另一方面,如果我们使用图形化界面登陆,我们将会通过启动一个终端来开启shell,无论那种方式,我们都会看到用户提示,并且我们可以开始输入并且执行命令(当按下Enter时,命令就会被执行) -If we log into a Linux box using a text-mode login screen, chances are we will be dropped directly into our default shell. On the other hand, if we login using a graphical user interface (GUI), we will have to open a shell manually by starting a terminal. Either way, we will be presented with the user prompt and we can start typing and executing commands (a command is executed by pressing the Enter key after we have typed it). -Commands are composed of two parts: +当我们使用文本模式登陆Linux时, +命令是由两个部分组成的: -- the name of the command itself, and -- arguments +- 命令本身 +- 参数 -Certain arguments, called options (usually preceded by a hyphen), alter the behavior of the command in a particular way while other arguments specify the objects upon which the command operates. +某些参数,称为选项(通常使用一个连字符区分),改变了由其他参数定义的命令操作. -The type command can help us identify whether another certain command is built into the shell or if it is provided by a separate package. The need to make this distinction lies in the place where we will find more information about the command. For shell built-ins we need to look in the shell’s man page, whereas for other binaries we can refer to its own man page. +命令的类型可以帮助我们识别某一个特定的命令是由shell内建的还是由一个单独的包提供。这样的区别在于我们能够找到更多关于该信息的命令,对shell内置的命令,我们需要看shell的ManPage,如果是其他提供的,我们需要看它自己的ManPage. ![Check Shell built in Commands](http://www.tecmint.com/wp-content/uploads/2015/02/Check-shell-built-in-Commands.png) -Check Shell built in Commands +检查Shell的内建命令 -In the examples above, cd and type are shell built-ins, while top and less are binaries external to the shell itself (in this case, the location of the command executable is returned by type). +在上面的例子中, cd 和 type 是shell内建的命令,top和 less 是由其他的二进制文件提供的(在这种情况下,type将返回命令的位置) +其他的内建命令 -Other well-known shell built-ins include: - -- [echo command][8]: Displays strings of text. -- [pwd command][9]: Prints the current working directory. +- [echo command][8]: 展示字符串 +- [pwd command][9]: 输出当前的工作目录 ![More Built in Shell Commands](http://www.tecmint.com/wp-content/uploads/2015/02/More-Built-in-Shell-Commands.png) -More Built in Shell Commands +更多内建函数 -**exec command** +**exec 命令** -Runs an external program that we specify. Note that in most cases, this is better accomplished by just typing the name of the program we want to run, but the exec command has one special feature: rather than create a new process that runs alongside the shell, the new process replaces the shell, as can verified by subsequent. +运行我们指定的外部程序。请注意,最好是只输入我们想要运行的程序的名字,不过exec命令有一个特殊的特性:使用旧的shell运行,而不是创建新的进程,可以作为子请求的验证. - # ps -ef | grep [original PID of the shell process] + # ps -ef | grep [shell 进程的PID] -When the new process terminates, the shell terminates with it. Run exec top and then hit the q key to quit top. You will notice that the shell session ends when you do, as shown in the following screencast: +当新的进程注销,Shell也随之注销,运行 exec top 然后按下 q键来退出top,你会注意到shell 会话会结束,如下面的屏幕录像展示的那样: 注:youtube视频 -**export command** +**export 命令** -Exports variables to the environment of subsequently executed commands. +输出之后执行的命令的环境的变量 -**history Command** +**history 命令** -Displays the command history list with line numbers. A command in the history list can be repeated by typing the command number preceded by an exclamation sign. If we need to edit a command in history list before executing it, we can press Ctrl + r and start typing the first letters associated with the command. When we see the command completed automatically, we can edit it as per our current need: +展示数行之前的历史命令.在感叹号前输入命令编号可以再次执行这个命令.如果我们需要编辑历史列表中的命令,我们可以按下 Ctrl + r 并输入与命令相关的第一个字符. +当我们看到的命令自动补全,我们可以根据我们目前的需要来编辑它: 注:youtube视频 -This list of commands is kept in our home directory in a file called .bash_history. The history facility is a useful resource for reducing the amount of typing, especially when combined with command line editing. By default, bash stores the last 500 commands you have entered, but this limit can be extended by using the HISTSIZE environment variable: +命令列表会保存在一个叫 .bash_history的文件里.history命令是一个非常有用的用于减少输入次数的工具,特别是进行命令行编辑的时候.默认情况下,bash保留最后输入的500个命令,不过可以通过修改 HISTSIZE 环境变量来增加: + ![Linux history Command](http://www.tecmint.com/wp-content/uploads/2015/02/Linux-history-Command.png) -Linux history Command +Linux history 命令 -But this change as performed above, will not be persistent on our next boot. In order to preserve the change in the HISTSIZE variable, we need to edit the .bashrc file by hand: +但上述变化,在我们的下一次启动不会保留。为了保持HISTSIZE变量的变化,我们需要通过手工修改文件编辑: - # for setting history length see HISTSIZE and HISTFILESIZE in bash(1) + # 设置history请看 HISTSIZE 和 HISTFILESIZE 在 bash(1)的文档 HISTSIZE=1000 -**Important**: Keep in mind that these changes will not take effect until we restart our shell session. +**重要**: 我们的更改不会生效,除非我们重启了系统 -**alias command** +**alias 命令** +没有参数或使用-p参数将会以 名称=值的标准形式输出alias 列表.当提供了参数时,一个alias 将被定义给给定的命令和值 -With no arguments or with the -p option prints the list of aliases in the form alias name=value on standard output. When arguments are provided, an alias is defined for each name whose value is given. +使用alias ,我们可以创建我们自己的命令,或修改现有的命令,包括需要的参数.举个例子,假设我们想别名 ls 到 ls –color=auto ,这样就可以使用不同颜色输出文件、目录、链接 -With alias, we can make up our own commands or modify existing ones by including desired options. For example, suppose we want to alias ls to ls –color=auto so that the output will display regular files, directories, symlinks, and so on, in different colors: # alias ls='ls --color=auto' ![Linux alias Command](http://www.tecmint.com/wp-content/uploads/2015/02/Linux-alias-Command.png) -Linux alias Command +Linux 别名命令 -**Note**: That you can assign any name to your “new command” and enclose as many commands as desired between single quotes, but in that case you need to separate them by semicolons, as follows: +**Note**: 你可以给你的新命令起任何的名字,并且附上足够多的使用单引号分割的参数,但是这样的情况下你要用分号区分开他们. # alias myNewCommand='cd /usr/bin; ls; cd; clear' -**exit command** +**exit 命令** -The exit and logout commands both terminate the shell. The exit command terminates any shell, but the logout command terminates only login shells—that is, those that are launched automatically when you initiate a text-mode login. +Exit和logout命令都是退出shell.exit命令退出所有的shell,logout命令只注销登陆的shell,其他的自动以文本模式启动的shell不算. -If we are ever in doubt as to what a program does, we can refer to its man page, which can be invoked using the man command. In addition, there are also man pages for important files (inittab, fstab, hosts, to name a few), library functions, shells, devices, and other features. +如果我们对某个程序由疑问,我们可以看他的man Page,可以使用man命令调出它,额外的,还有一些重要的文件的手册页(inittab,fstab,hosts等等),库函数,shells,设备及其他功能 -#### Examples: #### +#### 举例: #### -- man uname (print system information, such as kernel name, processor, operating system type, architecture, and so on). -- man inittab (init daemon configuration). +- man uname (输出系统信息,如内核名称、处理器、操作系统类型、架构等). +- man inittab (初始化守护设置). -Another important source of information is provided by the info command, which is used to read info documents. These documents often provide more information than the man page. It is invoked by using the info keyword followed by a command name, such as: +另外一个重要的信息的来源就是info命令提供的,info命令常常被用来读取信息文件.这些文件往往比manpage 提供更多信息.通过info 关键词调用某个命令的信息 # info ls # info cut -In addition, the /usr/share/doc directory contains several subdirectories where further documentation can be found. They either contain plain-text files or other friendly formats. -Make sure you make it a habit to use these three methods to look up information for commands. Pay special and careful attention to the syntax of each of them, which is explained in detail in the documentation. +另外,在/usr/share/doc 文件夹包含了大量的子目录,里面可以找到大量的文档.他们包含文本文件或其他友好的格式. +确保你使用这三种方法去查找命令的信息。重点关注每个命令文档中介绍的详细的语法 -**Converting Tabs into Spaces with expand Command** +**使用expand命令把tabs转换为空格** -Sometimes text files contain tabs but programs that need to process the files don’t cope well with tabs. Or maybe we just want to convert tabs into spaces. That’s where the expand tool (provided by the GNU coreutils package) comes in handy. +有时候文本文档包含了tabs但是程序无法很好的处理的tabs.或者我们只是简单的希望将tabs转换成空格.这就是为什么expand (GNU核心组件提供)工具出现, -For example, given the file NumbersList.txt, let’s run expand against it, changing tabs to one space, and display on standard output. +举个例子,给我们一个文件 NumberList.txt,让我们使用expand处理它,将tabs转换为一个空格.并且以标准形式输出. # expand --tabs=1 NumbersList.txt ![Linux expand Command](http://www.tecmint.com/wp-content/uploads/2015/02/Linux-expand-Command.png) -Linux expand Command +Linux expand 命令 -The unexpand command performs the reverse operation (converts spaces into tabs). +unexpand命令可以实现相反的功能(将空格转为tab) **使用head输出文件首行及使用tail输出文件尾行** @@ -234,7 +238,8 @@ tr 命令多用于变化(改变)一个一个的字符活使用字符范围. uniq命令可以帮我们查出或删除文件中的重复的行,默认会写出到stdout.我们应当注意, uniq 只能查出相邻的两个相同的单纯,所以, uniq 往往和sort 一起使用(sort一般用于对文本文件的内容进行排序) -By default, sort takes the first field (separated by spaces) as key field. To specify a different key field, we need to use the -k option. Please note how the output returned by sort and uniq change as we change the key field in the following example: + +默认的,sort 以第一个参数(使用空格区分)为关键字.想要定义特殊的关键字,我们需要使用 -k参数,请注意如何使用sort 和uniq输出我们想要的字段,具体可以看下面的例子 # cat file3 # sort file3 | uniq From a99d9d5631823c6397450eede3f68da9c0af81c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=AE=A6=E6=88=90?= Date: Thu, 23 Jul 2015 20:04:02 +0800 Subject: [PATCH 674/965] =?UTF-8?q?=E3=80=90=E7=BF=BB=E8=AF=91=E4=B8=AD?= =?UTF-8?q?=E3=80=91RHCSA=20Series?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Part 02--How to Perform File and Directory Management --- ...s--Part 02--How to Perform File and Directory Management.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/RHCSA Series/RHCSA Series--Part 02--How to Perform File and Directory Management.md b/sources/tech/RHCSA Series/RHCSA Series--Part 02--How to Perform File and Directory Management.md index 7566862597..abf9910994 100644 --- a/sources/tech/RHCSA Series/RHCSA Series--Part 02--How to Perform File and Directory Management.md +++ b/sources/tech/RHCSA Series/RHCSA Series--Part 02--How to Perform File and Directory Management.md @@ -1,3 +1,4 @@ +[translating by xiqingongzi] RHCSA Series: How to Perform File and Directory Management – Part 2 ================================================================================ In this article, RHCSA Part 2: File and directory management, we will review some essential skills that are required in the day-to-day tasks of a system administrator. @@ -319,4 +320,4 @@ via: http://www.tecmint.com/file-and-directory-management-in-linux/ [a]:http://www.tecmint.com/author/gacanepa/ [1]:http://www.tecmint.com/8-pratical-examples-of-linux-touch-command/ [2]:http://www.tecmint.com/13-basic-cat-command-examples-in-linux/ -[3]:http://www.tecmint.com/18-tar-command-examples-in-linux/ \ No newline at end of file +[3]:http://www.tecmint.com/18-tar-command-examples-in-linux/ From 26ebcf8f808aed9a554e009e1e8f747dfacb3c1b Mon Sep 17 00:00:00 2001 From: ictlyh Date: Thu, 23 Jul 2015 22:28:52 +0800 Subject: [PATCH 675/965] [Translating] sources/tech/20150722 Howto Interactively Perform Tasks with Docker using Kitematic.md --- ...to Interactively Perform Tasks with Docker using Kitematic.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20150722 Howto Interactively Perform Tasks with Docker using Kitematic.md b/sources/tech/20150722 Howto Interactively Perform Tasks with Docker using Kitematic.md index 7064da43f2..ca812ae944 100644 --- a/sources/tech/20150722 Howto Interactively Perform Tasks with Docker using Kitematic.md +++ b/sources/tech/20150722 Howto Interactively Perform Tasks with Docker using Kitematic.md @@ -1,3 +1,4 @@ +Translating by ictlyh Howto Interactively Perform Tasks with Docker using Kitematic ================================================================================ In this article, we'll learn about the installating Kitematic in Windows Operating System and deploying a Hello World Nginx Web Server. Kitematic is a free and open source software which is a modern designed GUI software that allows us to interactively perform tasks with docker. Kitematic has a beautiful design and pretty good interface. It is pretty fast and easy to setup our containers out of the box without needing to enter commands for it, we can deploy our apps it in just a click with its GUI inteface. Kitematic has Docker Hub Intergration which allows us to search any required image, pull and deploy our apps with it. It also has a beautiful feature to switch to CUI mode simultaneously. Currently, it includes some features like automatically map ports, visually change environment variables, configuring volumes, streamline logs and many more. From 9fcb9d83b21f2ef340f73e6b4a7025c73215bcff Mon Sep 17 00:00:00 2001 From: alim0x Date: Thu, 23 Jul 2015 23:52:54 +0800 Subject: [PATCH 676/965] [Part One]17 - The history of Android --- .../17 - The history of Android.md | 30 +++++++++---------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/sources/talk/The history of Android/17 - The history of Android.md b/sources/talk/The history of Android/17 - The history of Android.md index 2e60a864ab..397d4c3184 100644 --- a/sources/talk/The history of Android/17 - The history of Android.md +++ b/sources/talk/The history of Android/17 - The history of Android.md @@ -1,20 +1,18 @@ -alim0x translating - -The history of Android +安卓编年史 ================================================================================ -![The Honeycomb app lineup lost a ton of apps. This also shows the notification panel and the new quick settings.](http://cdn.arstechnica.net/wp-content/uploads/2014/02/apps-and-notifications2.png) -The Honeycomb app lineup lost a ton of apps. This also shows the notification panel and the new quick settings. -Photo by Ron Amadeo +![蜂巢的应用列表少了很多应用。上图还展示了通知中心和新的快速设置。](http://cdn.arstechnica.net/wp-content/uploads/2014/02/apps-and-notifications2.png) +蜂巢的应用列表少了很多应用。上图还展示了通知中心和新的快速设置。 +Ron Amadeo 供图 -The default app icons were slashed from 32 to 25, and two of those were third-party games. Since Honeycomb was not for phones and Google wanted the default apps to all be tablet-optimized, a lot of apps didn't make the cut. We lost the Amazon MP3 store, Car Home, Facebook, Google Goggles, Messaging, News and Weather, Phone, Twitter, Google Voice, and Voice Dialer. Google was quietly building a music service that would launch soon, so the Amazon MP3 store needed to go anyway. Car Home, Messaging, and Phone made little sense on a non-phone device, Facebook and Twitter still don't have tablet Android apps, and Goggles, News and Weather, and Voice Dialer were barely supported applications that most people wouldn't miss. +默认的应用图标从32个减少到了25个,其中还有两个是第三方的游戏。因为蜂巢不是为手机设计的,而且谷歌希望默认应用都是为平板优化的,很多应用因此没有成为默认应用。被去掉的应用有亚马逊 MP3 商店,Car Home,Facebook,Google Goggles,信息,新闻与天气,电话,Twitter,谷歌语音,以及语音拨号。谷歌正在悄悄打造的音乐服务将于不久后面世,所以亚马逊 MP3 商店需要为它让路。Car Home,信息以及电话对一部不是手机的设备来说没有多大意义,Facebook 和 Twitter还没有平板版应用,Goggles,新闻与天气以及语音拨号几乎没什么人注意,就算移除了大多数人也不会想念它们的。 -Almost every app icon was new. Just like the switch from the G1 to the Motorola Droid, the biggest impetus for change was probably the bump in resolution. The Nexus S had an 800×480 display, and Gingerbread came with art assets to match. The Xoom used a whopping 1280×800 10-inch display, which meant nearly every piece of art had to go. But again, this time a real designer was in charge, and things were a lot more cohesive. Honeycomb marked the switch from a vertically scrolling app drawer to paginated horizontal drawer. This change made sense on a horizontal device, but on phones it was still much faster to navigate the app drawer with a flingable, vertical list. +几乎每个应用图标都是全新设计的。就像是从 G1 切换到摩托罗拉 Droid,变化的最大动力是分辨率的提高。Nexus S 有一块800×480分辨率的显示屏,姜饼重新设计了图标等资源来适应它。Xoom 巨大的1280×800 10英寸显示屏意味着几乎所有设计都要重做。但是再说一次,这次是有真正的设计师在负责,所有东西看起来更有整体性了。蜂巢的应用列表从纵向滚动变为了横向分页式。这个变化对横屏设备有意义,而对手机来说,查找一个应用还是纵向滚动列表比较快。 -The second Honeycomb screenshot shows the new notification panel. The gray and black Gingerbread design was tossed for another straight-black panel that gave off a blue glow. At the top was a block showing the time, date, connection status, battery, and a shortcut to the notification quick settings, and below that were the actual notifications. Non-permanent notifications could now be dismissed by tapping on an "X" on the right side of the notification. Honeycomb was the first version to enable controls within a notification. The first (and at the launch of Honeycomb, only) app to take advantage of this was the new Google Music app, which placed previous, play/pause, and next buttons in its notification. These new controls could be accessed from any app and made controlling music a breeze. +第二张蜂巢截图展示的是新通知中心。姜饼中的灰色和黑色设计已经被抛弃了,现在是黑色面板带蓝色光晕。上面一块显示着日期时间,连接状态,电量和打开快速设置的按钮,下面是实际的通知。非持续性通知现在可以通过通知右侧的“X”来关闭。蜂巢是第一个支持通知内控制的版本。第一个(也是蜂巢发布时唯一一个)利用了此特性的应用是新的谷歌音乐,在它的通知上有上一曲,播放/暂停,下一曲按钮。这些控制可以在任何应用中访问到,这让控制音乐播放变成了一件轻而易举的事情。 !["Add to home screen" was given a zoomed-out interface for easy organizing. The search interface split auto suggest and universal search into different panes.](http://cdn.arstechnica.net/wp-content/uploads/2014/02/widgetkeyboard.png) "Add to home screen" was given a zoomed-out interface for easy organizing. The search interface split auto suggest and universal search into different panes. -Photo by Ron Amadeo +Ron Amadeo 供图 Pressing the plus button in the top right corner of the home screen or long pressing on the background would open the new home screen configuration interface. Honeycomb showed a zoomed-out view of all the home screens along the top of the screen, and it filled the bottom half of the screen with a tabbed drawer containing widgets and shortcuts. Items could be dragged out of the bottom drawer and into any of the five home screens. Gingerbread would just show a list of text, but Honeycomb showed full thumbnail previews of the widgets. This gave you a much better idea of what a widget would look like instead of an app-name-only description like "calendar." @@ -22,7 +20,7 @@ The larger screen of the Motorola Xoom allowed the keyboard to take on a more PC ![Gmail on Honeycomb versus Gmail on Gingerbread with the menu open. Buttons were placed on the main screen for easier discovery.](http://cdn.arstechnica.net/wp-content/uploads/2014/02/thebasics.png) Gmail on Honeycomb versus Gmail on Gingerbread with the menu open. Buttons were placed on the main screen for easier discovery. -Photo by Ron Amadeo +Ron Amadeo 供图 Gmail demonstrated all the new UI concepts in Honeycomb. Android 3.0 did away with hiding all the controls behind a menu button. There was now a strip of icons along the top of the screen called the Action Bar, which lifted many useful controls to the main screen where users could see them. Gmail showed buttons for search, compose, and refresh, and it put less useful controls like settings, help, and feedback in a dropdown called the "overflow" button. Tapping checkboxes or selecting text would cause the entire action bar to change to icons relating to those actions—for instance, selecting text would bring up cut, copy, and select all buttons. @@ -32,7 +30,7 @@ Honeycomb also introduced the "Fragments" API, which allowed developers to use a ![The calculator finally used regular Android buttons, but someone spilled blue ink on the calendar.](http://cdn.arstechnica.net/wp-content/uploads/2014/02/calculendar.png) The calculator finally used regular Android buttons, but someone spilled blue ink on the calendar. -Photo by Ron Amadeo +Ron Amadeo 供图 For the first time in Android's history, the calculator got a makeover with non-custom buttons, so it actually looked like part of the OS. The bigger screen made room for more buttons, enough that all the calculator functionality could fit on one screen. The calendar greatly benefited from the extra space, gaining much more room for appointment text and controls. The action bar at the top of the screen held buttons to switch views, along with showing the current time span and common controls. Appointment blocks switched to a white background with the calendar corner only showing in the top right corner. At the bottom (or side, in horizontal view) were boxes showing the month calendar and a list of displayed calendars. @@ -40,19 +38,19 @@ The scale of the calendar could be adjusted, too. By performing a pinch zoom ges ![The new camera interface, showing off the live "Negative" effect.](http://cdn.arstechnica.net/wp-content/uploads/2014/02/camera.png) The new camera interface, showing off the live "Negative" effect. -Photo by Ron Amadeo +Ron Amadeo 供图 The giant 10-inch Xoom tablet did have a camera, which meant that it also had a camera app. The Tron redesign finally got rid of the old faux-leather look that Google came up with in Android 1.6. The controls were laid out in a circle around the shutter button, bringing to mind the circular controls and dials on a real camera. The Cooliris-derived speech bubble popups were changed to glowing, semi-transparent black boxes. The Honeycomb screenshot shows the new "color effect" functionality, which applied a filter to the viewfinder in real time. Unlike the Gingerbread camera app, this didn't support a portrait orientation—it was limited to landscape only. Taking a portrait picture with a 10-inch tablet doesn't make much sense, but then neither does taking a landscape one. ![The clock app didn't get quite as much love as other areas. Google just threw it into a tiny box and called it a day.](http://cdn.arstechnica.net/wp-content/uploads/2014/02/clocks.png) The clock app didn't get quite as much love as other areas. Google just threw it into a tiny box and called it a day. -Photo by Ron Amadeo +Ron Amadeo 供图 Tons of functionality went out the door when it came time to remake the clock app. The entire "Deskclock" concept was kicked out the door, replaced with a simple large display of the time against a plain black background. The ability to launch other apps and view the weather was gone, as was the ability of the clock app to use your wallpaper. Google sometimes gave up when it came time to design a tablet-sized interface, like here, where it just threw the alarm interface into a tiny, centered dialog box. ![The Music app finally got the ground-up redesign it has needed forever.](http://cdn.arstechnica.net/wp-content/uploads/2014/02/muzack.png) The Music app finally got the ground-up redesign it has needed forever. -Photo by Ron Amadeo +Ron Amadeo 供图 While music received a few minor additions during its life, this was really the first time since Android 0.9 that it received serious attention. The highlight of the redesign was a don't-call-it-coverflow scrolling 3D album art view, called "New and Recent." Instead of the tabs added in Android 2.1, navigation was handled by a Dropbox box in the Action Bar. While "New and Recent" had 3D scrolling album art, "Albums" used a flat grid of albums thumbnails. The other sections had totally different designs, too. "Songs" used a vertically scrolling list of text, and "Playlists," "Genres," and "Artists" used stacked album art. @@ -62,7 +60,7 @@ Just like the Cooliris Gallery in Android 2.1, Google Music would blow up one of ![Some of the new Google Maps was really nice, and some of it was from Android 1.5.](http://cdn.arstechnica.net/wp-content/uploads/2014/02/maps.png) Some of the new Google Maps was really nice, and some of it was from Android 1.5. -Photo by Ron Amadeo +Ron Amadeo 供图 Google Maps received another redesign for the big screen. This one would stick around for a while and used a semi-transparent black action bar for all the controls. Search was again the primary function, given the first spot in the action bar, but this time it was an actual search bar you could type in, instead of a search bar-shaped button that launched a completely different interface. Google finally gave up on dedicating screen space to actual zoom buttons, relying on only gestures to control the map view. While the feature has since been ported to all old versions of Maps, Honeycomb was the first version to feature 3D building outlines on the map. Dragging two fingers down on the map would "tilt" the map view and show the sides of the buildings. You could freely rotate and the buildings would adjust, too. From d60b3356d63a9ce8161a89697866038254aae291 Mon Sep 17 00:00:00 2001 From: martin qi Date: Fri, 24 Jul 2015 00:54:00 +0800 Subject: [PATCH 677/965] Delete 20150227 Fix Minimal BASH like line editing is supported GRUB Error In Linux.md --- ...diting is supported GRUB Error In Linux.md | 88 ------------------- 1 file changed, 88 deletions(-) delete mode 100644 sources/tech/20150227 Fix Minimal BASH like line editing is supported GRUB Error In Linux.md diff --git a/sources/tech/20150227 Fix Minimal BASH like line editing is supported GRUB Error In Linux.md b/sources/tech/20150227 Fix Minimal BASH like line editing is supported GRUB Error In Linux.md deleted file mode 100644 index a1efae1a37..0000000000 --- a/sources/tech/20150227 Fix Minimal BASH like line editing is supported GRUB Error In Linux.md +++ /dev/null @@ -1,88 +0,0 @@ -translating... - -Fix Minimal BASH like line editing is supported GRUB Error In Linux -================================================================================ -The other day when I [installed Elementary OS in dual boot with Windows][1], I encountered a Grub error at the reboot time. I was presented with command line with error message: - -**Minimal BASH like line editing is supported. For the first word, TAB lists possible command completions. anywhere else TAB lists possible device or file completions.** - -![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/02/Boot_Repair_Ubuntu_Linux_1.jpeg) - -Indeed this is not an error specific to Elementary OS. It is a common [Grub][2] error that could occur with any Linux OS be it Ubuntu, Fedora, Linux Mint etc. - -In this post we shall see **how to fix this “minimal BASH like line editing is supported” Grub error in Ubuntu** based Linux systems. - -> You can read this tutorial to fix similar and more frequent issue, [error: no such partition grub rescue in Linux][3]. - -### Prerequisites ### - -To fix this issue, you would need the followings: - -- A live USB or disk of the same OS and same version -- A working internet connection in the live session - -Once you make sure that you have the prerequisites, let’s see how to fix the black screen of death for Linux (if I can call it that ;)). - -### How to fix this “minimal BASH like line editing is supported” Grub error in Ubuntu based Linux ### - -I know that you might point out that this Grub error is not exclusive to Ubuntu or Ubuntu based Linux distributions, then why am I putting emphasis on the world Ubuntu? The reason is, here we will take an easy way out and use a tool called **Boot Repair** to fix our problem. I am not sure if this tool is available for other distributions like Fedora. Without wasting anymore time, let’s see how to solve minimal BASH like line editing is supported Grub error. - -### Step 1: Boot in lives session ### - -Plug in the live USB and boot in to the live session. - -### Step 2: Install Boot Repair ### - -Once you are in the lives session, open the terminal and use the following commands to install Boot Repair: - - sudo add-apt-repository ppa:yannubuntu/boot-repair - sudo apt-get update - sudo apt-get install boot-repair - -Note: Follow this tutorial to [fix failed to fetch cdrom apt-get update cannot be used to add new CD-ROMs error][4], if you encounter it while running the above command. - -### Step 3: Repair boot with Boot Repair ### - -Once you installed Boot Repair, run it from the command line using the following command: - - boot-repair & - -Actually things are pretty straight forward from here. You just need to follow the instructions provided by Boot Repair tool. First, click on **Recommended repair** option in the Boot Repair. - -![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/02/Boot_Repair_Ubuntu.png) - -It will take couple of minutes for Boot Repair to analyze the problem with boot and Grub. Afterwards, it will provide you some commands to use in the command line. Copy the commands one by one in terminal. For me it showed me a screen like this: - -![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/02/Boot_Repair_Ubuntu_1.png) - -It will do some processes after you enter these commands: - -![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/02/Boot_Repair_Ubuntu_2.png) - -Once the process finishes, it will provide you a URL which consists of the logs of the boot repair. If your boot issue is not fixed even now, you can go to the forum or mail to the dev team and provide them the URL as a reference. Cool, isn’t it? - -![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/02/Boot_Repair_Final_Ubuntu.png) - -After the boot repair finishes successfully, shutdown your computer, remove the USB and boot again. For me it booted successfully but added two additional lines in the Grub screen. Something which was not of importance to me as I was happy to see the system booting normally again. - -![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/02/Boot_Repair_Ubuntu_Linux_2.jpeg) - -### Did it work for you? ### - -So this is how I fixed **minimal BASH like line editing is supported Grub error in Elementary OS Freya**. How about you? Did it work for you? Feel free to ask a question or drop a suggestion in the comment box below. - --------------------------------------------------------------------------------- - -via: http://itsfoss.com/fix-minimal-bash-line-editing-supported-grub-error-linux/ - -作者:[Abhishek][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://itsfoss.com/author/abhishek/ -[1]:http://itsfoss.com/guide-install-elementary-os-luna/ -[2]:http://www.gnu.org/software/grub/ -[3]:http://itsfoss.com/solve-error-partition-grub-rescue-ubuntu-linux/ -[4]:http://itsfoss.com/fix-failed-fetch-cdrom-aptget-update-add-cdroms/ From f350e4d324be02ca8a230655efb7b9cffb199901 Mon Sep 17 00:00:00 2001 From: martin qi Date: Fri, 24 Jul 2015 00:54:32 +0800 Subject: [PATCH 678/965] Create 20150227 Fix Minimal BASH like line editing is supported GRUB Error In Linux.md --- ...diting is supported GRUB Error In Linux.md | 86 +++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 translated/tech/20150227 Fix Minimal BASH like line editing is supported GRUB Error In Linux.md diff --git a/translated/tech/20150227 Fix Minimal BASH like line editing is supported GRUB Error In Linux.md b/translated/tech/20150227 Fix Minimal BASH like line editing is supported GRUB Error In Linux.md new file mode 100644 index 0000000000..4edaa333d8 --- /dev/null +++ b/translated/tech/20150227 Fix Minimal BASH like line editing is supported GRUB Error In Linux.md @@ -0,0 +1,86 @@ +修复Linux中的提供最小化类BASH命令行编辑GRUB错误 +================================================================================ +这两天我[安装了Elementary OS和Windows双系统][1],在启动的时候遇到了一个Grub错误。命令行中呈现如下信息: + +**提供最小化类BASH命令行编辑。对于第一个词,TAB键补全可以使用的命令。除此之外,TAB键补全可用的设备或文件。** + +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/02/Boot_Repair_Ubuntu_Linux_1.jpeg) + +事实上这并不是Elementary OS独有的错误。这是常见的[Grub][2]错误,会在Ubuntu,Fedora,Linux Mint等Linux操作系统上发生。 + +通过这篇文章里我们可以学到基于Linux系统**如何修复Ubuntu中出现的“minimal BASH like line editing is supported” Grub错误**。 + +> 你可以参阅这篇教程来修复类似的高频问题,[错误:分区未找到Linux grub救援模式][3]。 + +### 先决条件 ### + +要修复这个问题,你需要达成以下的条件: + +- 一个包含相同版本、相同OS的LiveUSB或磁盘 +- 当前会话的Internet连接正常工作 + +在确认了你拥有先决条件了之后,让我们看看如何修复Linux的死亡黑屏(如果我可以这样的称呼它的话;))。 + +### 如何在基于Ubuntu的Linux中修复“minimal BASH like line editing is supported” Grub错误 ### + +我知道你一定疑问这种Grub错误并不局限于在基于Ubuntu的Linux发行版上发生,那为什么我要强调在基于Ubuntu的发行版上呢?原因是,在这里我们将采用一个简单的方法并叫作**Boot Repair**的工具来修复我们的问题。我并不确定在其他的诸如Fedora的发行版中是否有这个工具可用。不再浪费时间,我们来看如何修复minimal BASH like line editing is supported Grub错误。 + +### 步骤 1: 引导进入lives会话 ### + +插入live USB,引导进入live会话。 + +### 步骤 2: 安装 Boot Repair ### + +等你进入了lives会话后,打开终端使用以下命令来安装Boot Repair: + + sudo add-apt-repository ppa:yannubuntu/boot-repair + sudo apt-get update + sudo apt-get install boot-repair + +注意:推荐这篇教程[如何修复 apt-get update 无法添加新的 CD-ROM 的错误][4],如果你在运行以上命令是遭遇同样的问题。 + +### 步骤 3: 使用Boot Repair修复引导 ### + +装完Boot Repair后,在命令行运行如下命令启动: + + boot-repair & + +其实操作非常简单直接,你仅需按照Boot Repair工具提供的说明操作即可。首先,点击Boot Repair中的**Recommended repair**选项。 + +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/02/Boot_Repair_Ubuntu.png) + +Boot Repair需要花费一些时间来分析引导和Grub中存在的问题。然后,它会提供一些可在命令行中直接运行的命令。将这些命令一个个在终端中执行。我这边屏幕上显示的是: + +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/02/Boot_Repair_Ubuntu_1.png) + +在输入了这些命令之后,它会执行执行一段时间: + +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/02/Boot_Repair_Ubuntu_2.png) + +在这一过程结束后,它会提供一个由boot repair的日志组成的网页网址。如果你的引导问题这样都没有修复,你就可以去社区或是发邮件给开发团队并提交该网址作为参考。很酷!不是吗? + +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/02/Boot_Repair_Final_Ubuntu.png) + +在boot repair成功完成后,关闭你的电脑,移除USB并再次引导。我这就能成功的引导了,但是在Grub画面上会多出额外的两行。相比于看到系统能够再次正常引导的喜悦这些对我来说并不重要。 + +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/02/Boot_Repair_Ubuntu_Linux_2.jpeg) + +### 对你有效吗? ### + +这就是我修复**Elementary OS Freya中的minimal BASH like line editing is supported Grub 错误**的方法。怎么样?是否对你也有效呢?请自由的在下方的评论区提出你的问题和建议。 + +-------------------------------------------------------------------------------- + +via: http://itsfoss.com/fix-minimal-bash-line-editing-supported-grub-error-linux/ + +作者:[Abhishek][a] +译者:[martin2011qi](https://github.com/martin2011qi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://itsfoss.com/author/abhishek/ +[1]:http://itsfoss.com/guide-install-elementary-os-luna/ +[2]:http://www.gnu.org/software/grub/ +[3]:http://itsfoss.com/solve-error-partition-grub-rescue-ubuntu-linux/ +[4]:http://itsfoss.com/fix-failed-fetch-cdrom-aptget-update-add-cdroms/ From 4a394b553573a26188f105912f575637c5b3f691 Mon Sep 17 00:00:00 2001 From: martin qi Date: Fri, 24 Jul 2015 01:00:48 +0800 Subject: [PATCH 679/965] Update 20150225 How to set up IPv6 BGP peering and filtering in Quagga BGP router.md --- ... up IPv6 BGP peering and filtering in Quagga BGP router.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150225 How to set up IPv6 BGP peering and filtering in Quagga BGP router.md b/sources/tech/20150225 How to set up IPv6 BGP peering and filtering in Quagga BGP router.md index cae05670ba..033e03be35 100644 --- a/sources/tech/20150225 How to set up IPv6 BGP peering and filtering in Quagga BGP router.md +++ b/sources/tech/20150225 How to set up IPv6 BGP peering and filtering in Quagga BGP router.md @@ -1,3 +1,5 @@ +translating... + How to set up IPv6 BGP peering and filtering in Quagga BGP router ================================================================================ In the previous tutorials, we demonstrated how we can set up a [full-fledged BGP router][1] and configure [prefix filtering][2] with Quagga. In this tutorial, we are going to show you how we can set up IPv6 BGP peering and advertise IPv6 prefixes through BGP. We will also demonstrate how we can filter IPv6 prefixes advertised or received by using prefix-list and route-map features. @@ -255,4 +257,4 @@ via: http://xmodulo.com/ipv6-bgp-peering-filtering-quagga-bgp-router.html [1]:http://xmodulo.com/centos-bgp-router-quagga.html [2]:http://xmodulo.com/filter-bgp-routes-quagga-bgp-router.html [3]:http://ask.xmodulo.com/open-port-firewall-centos-rhel.html -[4]:http://xmodulo.com/filter-bgp-routes-quagga-bgp-router.html \ No newline at end of file +[4]:http://xmodulo.com/filter-bgp-routes-quagga-bgp-router.html From d1c99b629a22b5ea8b291ec613398a337207ab34 Mon Sep 17 00:00:00 2001 From: Chang Liu Date: Fri, 24 Jul 2015 07:51:06 +0800 Subject: [PATCH 680/965] Update 20150722 How To Manage StartUp Applications In Ubuntu.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 准备翻译该篇。 --- .../20150722 How To Manage StartUp Applications In Ubuntu.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150722 How To Manage StartUp Applications In Ubuntu.md b/sources/tech/20150722 How To Manage StartUp Applications In Ubuntu.md index 3f41b91a19..f14d983707 100644 --- a/sources/tech/20150722 How To Manage StartUp Applications In Ubuntu.md +++ b/sources/tech/20150722 How To Manage StartUp Applications In Ubuntu.md @@ -1,3 +1,5 @@ +FSSlc translating + How To Manage StartUp Applications In Ubuntu ================================================================================ ![Manage startup applications in Ubuntu](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/Manage-Start-up-apps-in-Ubuntu.png) @@ -110,4 +112,4 @@ via: http://itsfoss.com/manage-startup-applications-ubuntu/ [a]:http://itsfoss.com/author/abhishek/ [1]:https://wiki.gnome.org/action/show/Projects/Caribou?action=show&redirect=Caribou -[2]:http://itsfoss.com/applications-manage-wallpapers-ubuntu/ \ No newline at end of file +[2]:http://itsfoss.com/applications-manage-wallpapers-ubuntu/ From 97dbfec2dad1b0a591426fa8f54f151964756ed7 Mon Sep 17 00:00:00 2001 From: wxy Date: Fri, 24 Jul 2015 08:33:11 +0800 Subject: [PATCH 681/965] =?UTF-8?q?=E8=A1=A5=E5=85=85=20PR?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @xiqingongzi 译文应该挪到 translated 的对应目录下。 --- ...t 01--Reviewing Essential Commands and System Documentation.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/RHCSA Series/RHCSA Series--Part 01--Reviewing Essential Commands and System Documentation.md (100%) diff --git a/sources/tech/RHCSA Series/RHCSA Series--Part 01--Reviewing Essential Commands and System Documentation.md b/translated/tech/RHCSA Series/RHCSA Series--Part 01--Reviewing Essential Commands and System Documentation.md similarity index 100% rename from sources/tech/RHCSA Series/RHCSA Series--Part 01--Reviewing Essential Commands and System Documentation.md rename to translated/tech/RHCSA Series/RHCSA Series--Part 01--Reviewing Essential Commands and System Documentation.md From 79be0795fd44a98d3f85077dc6b9dbee9d1d855f Mon Sep 17 00:00:00 2001 From: wxy Date: Fri, 24 Jul 2015 09:14:28 +0800 Subject: [PATCH 682/965] PUB:20150616 XBMC--build a remote control @zpl1025 --- .../20150616 XBMC--build a remote control.md | 148 +++++++++--------- 1 file changed, 74 insertions(+), 74 deletions(-) rename {translated/tech => published}/20150616 XBMC--build a remote control.md (59%) diff --git a/translated/tech/20150616 XBMC--build a remote control.md b/published/20150616 XBMC--build a remote control.md similarity index 59% rename from translated/tech/20150616 XBMC--build a remote control.md rename to published/20150616 XBMC--build a remote control.md index 7347aca243..a606bc1cab 100644 --- a/translated/tech/20150616 XBMC--build a remote control.md +++ b/published/20150616 XBMC--build a remote control.md @@ -1,16 +1,16 @@ -XBMC:自制遥控 +为 Kodi 自制遥控器 ================================================================================ **通过运行在 Android 手机上的自制遥控器来控制你的家庭媒体播放器。** -**XBMC** 一款很优秀的软件,能够将几乎所有电脑变身成媒体中心。它可以播放音乐和视频,显示图片,甚至还能显示天气预报。为了在配置成家庭影院后方便使用,你可以通过手机 app 访问运行在已连接到 Wi-Fi 的 XBMC 机器上的服务来控制它。可以找到很多这种工具,几乎覆盖所有智能手机系统。 +**Kodi** 是一款很优秀的软件,能够将几乎所有电脑变身成媒体中心。它可以播放音乐和视频,显示图片,甚至还能显示天气预报。为了在配置成家庭影院后方便使用,你可以通过手机 app 访问运行在连接到 Wi-Fi 的 XBMC 机器上的服务来控制它。可以找到很多这种工具,几乎覆盖所有智能手机系统。 -> ### Kodi ### +> **XBMC** > -> 在你阅读这篇文章的时候,**XBMC** 可能已经成为历史。因为法律原因(因为名字 **XBMC** 或 X**-Box Media Center** 里引用了不再支持的过时硬件)项目组决定使用新的名字 **Kodi**。不过,除了名字,其他的都会保持原样。或者说除开通常新版本中所期待的大量新改进。这一般不会影响到遥控软件,它应该能在已有的 **XBMC** 系统和新的 Kodi 系统上都能工作。 +> Kodi 原名叫做 XBMC,在你阅读这篇文章的时候,**XBMC** 已经成为历史。因为法律原因(因为名字 **XBMC** 或 X**-Box Media Center** 里引用了不再支持的过时硬件)项目组决定使用新的名字 **Kodi**。不过,除了名字,其他的都会保持原样。或者说除开通常新版本中所期待的大量新改进。这一般不会影响到遥控软件,它应该能在已有的 **XBMC** 系统和新的 Kodi 系统上都能工作。 -我们目前配置了一个 **XBMC** 系统用于播放音乐,不过我们找到的所有 XBMC 遥控没一个好用的,特别是和媒体中心连接的电视没打开的时候。它们都有点太复杂了,集成了太多功能在手机的小屏幕上。我们希望能有这样的系统,从最开始就是设计成只用于访问音乐库和电台插件,所以我们决定自己实现一个。它不需要用到 XBMC 的所有功能,因为除了音乐以外的任务,我们可以简单地切换使用通用的 XBMC 遥控。我们的测试系统是一个刷了 RaspBMC 发行版的树莓派,但是我们要做的工具并不受限于树莓派或那个发行版,它应该可以匹配任何安装了相关插件的基于 Linux 的 XBMC 系统。 +我们目前已经配置好了一个用于播放音乐的 **Kodi** 系统,不过我们找到的所有 Kodi 遥控没一个好用的,特别是和媒体中心连接的电视没打开的时候。它们都有点太复杂了,集成了太多功能在手机的小屏幕上。我们希望能有这样的系统,从最开始就是设计成只用于访问音乐库和电台插件,所以我们决定自己实现一个。它不需要用到 Kodi 的所有功能,因为除了音乐以外的任务,我们可以简单地切换使用通用的 Kodi 遥控。我们的测试系统是一个刷了 RaspBMC 发行版的树莓派,但是我们要做的工具并不受限于树莓派或Kodi那个发行版,它应该可以匹配任何安装了相关插件的基于 Linux 的 Kodi 系统。 -首先,遥控程序需要一个用户界面。大多数 XBMC 遥控程序都是独立的 app。不过对于我们要做的这个音乐控制程序,我们希望用户可以不用安装任何东西就可以使用。显然我们需要使用网页界面。XBMC 本身自带网页服务器,但是为了获得更多权限,我们还是使用了独立的网页框架。在同一台电脑上跑两个以上网页服务器没有问题,只不过它们不能使用相同的端口。 +首先,遥控程序需要一个用户界面。大多数 Kodi 遥控程序都是独立的 app。不过对于我们要做的这个音乐控制程序,我们希望用户可以不用安装任何东西就可以使用。显然我们需要使用网页界面。Kodi 本身自带网页服务器,但是为了获得更多权限,我们还是使用了独立的网页框架。在同一台电脑上跑两个以上网页服务器没有问题,只不过它们不能使用相同的端口。 有几个网页框架可以使用。而我们选用 Bottle 是因为它是一个简单高效的框架,而且我们也确实用不到任何高级功能。Bottle 是一个 Python 模块,所以这也将是我们编写服务器模块的语言。 @@ -18,7 +18,7 @@ XBMC:自制遥控 sudo apt-get install python-bottle -遥控程序实际上只是连接用户和系统的中间层。Bottle 提供了和用户交互的方式,而我们将通过 JSON API 来和 **XBMC** 交互。这样可以让我们通过发送 JSON 格式消息的方式去控制媒体播放器。 +遥控程序实际上只是连接用户和系统的中间层。Bottle 提供了和用户交互的方式,而我们将通过 JSON API 来和 **Kodi** 交互。这样可以让我们通过发送 JSON 格式消息的方式去控制媒体播放器。 我们将用到一个叫做 xbmcjson 的简单 XBMC JASON API 封装。足够用来发送控制请求,而不需要关心实际的 JSON 格式以及和服务器通讯的无聊事。它没有包含在 PIP 包管理中,所以你得直接从 **GitHub** 安装: @@ -35,13 +35,13 @@ XBMC:自制遥控 from xbmcjson import XBMC from bottle import route, run, template, redirect, static_file, request import os - xbmc = XBMC(“http://192.168.0.5/jsonrpc”, “xbmc”, “xbmc”) - @route(‘/hello/’) + xbmc = XBMC("http://192.168.0.5/jsonrpc", "xbmc", "xbmc") + @route('/hello/') def index(name): - return template(‘

Hello {{name}}!

’, name=name) - run(host=”0.0.0.0”, port=8000) + return template('

Hello {{name}}!

', name=name) + run(host="0.0.0.0", port=8000) -这样程序将连接到 **XBMC**(不过实际上用不到);然后 Bottle 会开始伺服网站。在我们的代码里,它将监听主机 0.0.0.0(意味着允许所有主机连接)的端口 8000。它只设定了一个站点,就是 /hello/XXXX,这里的 XXXX 可以是任何内容。不管 XXXX 是什么都将作为参数名传递给 index()。然后再替换进去 HTML 网页模版。 +这样程序将连接到 **Kodi**(不过实际上用不到);然后 Bottle 会开始提供网站服务。在我们的代码里,它将监听主机 0.0.0.0(意味着允许所有主机连接)的端口 8000。它只设定了一个站点,就是 /hello/XXXX,这里的 XXXX 可以是任何内容。不管 XXXX 是什么都将作为参数名传递给 index()。然后再替换进去 HTML 网页模版。 你可以先试着把上面内容写到一个文件(我们取的名字是 remote.py),然后用下面的命令启动: @@ -51,56 +51,56 @@ XBMC:自制遥控 @route() 用来设定网页服务器的路径,而函数 index() 会返回该路径的数据。通常是返回由模版生成的 HTML 页面,但是并不是说只能这样(后面会看到)。 -随后,我们将给应用添加更多页面入口,让它变成一个全功能的 XBMC 遥控,但仍将采用相同代码结构。 +随后,我们将给应用添加更多页面入口,让它变成一个全功能的 Kodi 遥控,但仍将采用相同代码结构。 -XBMC JSON API 接口可以从和 XBMC 机器同网段的任意电脑上访问。也就是说你可以在自己的笔记本上开发,然后再布置到媒体中心上,而不需要浪费时间上传每次改动。 +XBMC JSON API 接口可以从和 Kodi 机器同网段的任意电脑上访问。也就是说你可以在自己的笔记本上开发,然后再布置到媒体中心上,而不需要浪费时间上传每次改动。 模版 - 比如前面例子里的那个简单模版 - 是一种结合 Python 和 HTML 来控制输出的方式。理论上,这俩能做很多很多事,但是会非常混乱。我们将只是用它们来生成正确格式的数据。不过,在开始动手之前,我们先得准备点数据。 -> ### Paste ### +> **Paste** > -> Bottle 自带网页服务器,就是我们用来测试遥控程序的。不过,我们发现它性能有时不够好。当我们的遥控程序正式上线时,我们希望页面能更快一点显示出来。Bottle 可以和很多不同的网页服务器配合工作,而我们发现 Paste 用起来非常不错。而要使用的话,只要简单地安装(Debian 系统里的 python-paste 包),然后修改一下代码里的 run 调用: +> Bottle 自带网页服务器,我们用它来测试遥控程序。不过,我们发现它性能有时不够好。当我们的遥控程序正式上线时,我们希望页面能更快一点显示出来。Bottle 可以和很多不同的网页服务器配合工作,而我们发现 Paste 用起来非常不错。而要使用的话,只要简单地安装(Debian 系统里的 python-paste 包),然后修改一下代码里的 run 调用: > -> run(host=hostname, port=hostport, server=”paste”) +> run(host=hostname, port=hostport, server="paste") > > 你可以在 [http://bottlepy.org/docs/dev/deployment.html][1] 找到如何使用其他服务器的相关细节。 -#### 从 XBMC 获取数据 #### +#### 从 Kodi 获取数据 #### XBMC JSON API 分成 14 个命名空间:JSONRPC, Player, Playlist, Files, AudioLibrary, VideoLibrary, Input, Application, System, Favourites, Profiles, Settings, Textures 和 XBMC。每个都可以通过 Python 的 XBMC 对象访问(Favourites 除外,明显是个疏忽)。每个命名空间都包含许多方法用于对程序的控制。例如,Playlist.GetItems() 可以用来获取某个特定播放列表的内容。服务器会返回给我们 JSON 格式的数据,但 xbmcjson 模块会为我们转化成 Python 词典。 -我们需要用到 XBMC 里的两个组件来控制播放:播放器和播放列表。播放器带有播放列表并在每首歌结束时从列表里取下一首。为了查看当前正在播放的内容,我们需要获取正在工作的播放器的 ID,然后根据它找到当前播放列表的 ID。这个可以通过下面的代码来实现: +我们需要用到 Kodi 里的两个组件来控制播放:播放器和播放列表。播放器处理播放列表并在每首歌结束时从列表里取下一首。为了查看当前正在播放的内容,我们需要获取正在工作的播放器的 ID,然后根据它找到当前播放列表的 ID。这个可以通过下面的代码来实现: def get_playlistid(): player = xbmc.Player.GetActivePlayers() - if len(player[‘result’]) > 0: - playlist_data = xbmc.Player.GetProperties({“playerid”:0, “properties”:[“playlistid”]}) - if len(playlist_data[‘result’]) > 0 and “playlistid” in playlist_data[‘result’].keys(): - return playlist_data[‘result’][‘playlistid’] + if len(player['result']) > 0: + playlist_data = xbmc.Player.GetProperties({"playerid":0, "properties":["playlistid"]}) + if len(playlist_data['result']) > 0 and "playlistid" in playlist_data['result'].keys(): + return playlist_data['result']['playlistid'] return -1 -如果当前没有播放器在工作(就是说,返回数据的结果部分的长度是 0),或者当前播放器不带播放列表,这样的话函数会返回 -1。其他时候,它会返回当前播放列表的数字 ID。 +如果当前没有播放器在工作(就是说,返回数据的结果部分的长度是 0),或者当前播放器没有处理播放列表,这样的话函数会返回 -1。其他时候,它会返回当前播放列表的数字 ID。 -当我们拿到当前播放列表的 ID 后,就可以获取列表的细节内容。按照我们的需求,有两个重要的地方:播放列表里包含的项,以及当前播放所处的位置(已经播放过的项并不会从播放列表移除,只是移动当前播放位置)。 +当我们拿到当前播放列表的 ID 后,就可以获取该列表的细节内容。按照我们的需求,有两个重要的地方:播放列表里包含的项,以及当前播放所处的位置(已经播放过的项并不会从播放列表移除,只是移动当前播放位置)。 def get_playlist(): playlistid = get_playlistid() if playlistid >= 0: - data = xbmc.Playlist.GetItems({“playlistid”:playlistid, “properties”: [“title”, “album”, “artist”, “file”]}) - position_data = xbmc.Player.GetProperties({“playerid”:0, ‘properties’:[“position”]}) - position = int(position_data[‘result’][‘position’]) - return data[‘result’][‘items’][position:], position + data = xbmc.Playlist.GetItems({"playlistid":playlistid, "properties": ["title", "album", "artist", "file"]}) + position_data = xbmc.Player.GetProperties({"playerid":0, 'properties':["position"]}) + position = int(position_data['result']['position']) + return data['result']['items'][position:], position return [], -1 -这样可以返回以正在播放的项开始的列表(因为我们并不关心已经播放过的内容),而且也包含了位置信息用来从列表里移除项。 +这样可以返回正在播放的项开始的列表(因为我们并不关心已经播放过的内容),而且也包含了用来从列表里移除项的位置信息。 ![Image](http://www.linuxvoice.com/wp-content/uploads/2015/04/xbmc2-large.jpg) API 文档在这里:[http://wiki.xbmc.org/?title=JSON-RPC_API/v6][2]。它列出了所有支持的函数,但是关于具体如何使用的描述有点太简单了。 -> ### JSON ### +> **JSON** > -> JSON 是 JavaScript Object Notation 的缩写,开始设计用于 JavaScript 对象的序列化。目前仍然起到这个作用,但是它也是用来编码任意数据的一种很好用的方式。 +> JSON 是 JavaScript Object Notation 的缩写,最初设计用于 JavaScript 对象的序列化。目前仍然起到这个作用,但是它也是用来编码任意数据的一种很好用的方式。 > > JSON 对象都是这样的格式: > @@ -110,18 +110,18 @@ API 文档在这里:[http://wiki.xbmc.org/?title=JSON-RPC_API/v6][2]。它列 > > 在字典数据结构里,值本身可以是另一个 JSON 对象,或者一个列表,所以下面的格式也是正确的: > -> {“name”:“Ben”, “jobs”:[“cook”, “bottle-washer”], “appearance”: {“height”:195, “skin”:“fair”}} +> {"name":"Ben", "jobs":["cook", "bottle-washer"], "appearance": {"height":195, "skin":"fair"}} > -> JSON 通常在网络服务中用来发送和接收数据,并且大多数编程语言都能很好地支持,所以如果你熟悉 Python 的话,你应该可以使用你熟悉的编程语言调用相同的接口来轻松地控制 XBMC。 +> JSON 通常在网络服务中用来发送和接收数据,并且大多数编程语言都能很好地支持,所以如果你熟悉 Python 的话,你应该可以使用你熟悉的编程语言调用相同的接口来轻松地控制 Kodi。 #### 整合到一起 #### 把之前的功能连接到 HTML 页面很简单: - @route(‘/juke’) + @route('/juke') def index(): current_playlist, position = get_playlist() - return template(‘list’, playlist=current_playlist, offset = position) + return template('list', playlist=current_playlist, offset = position) 只需要抓取播放列表(调用我们之前定义的函数),然后将结果传递给负责显示的模版。 @@ -131,57 +131,57 @@ API 文档在这里:[http://wiki.xbmc.org/?title=JSON-RPC_API/v6][2]。它列 % if playlist is not None: % position = offset % for song in playlist: - {{song[‘title’]}} - % if song[‘type’] == ‘unknown’: + {{song['title']}} + % if song['type'] == 'unknown': Radio % else: - {{song[‘artist’][0]}} + {{song['artist'][0]}} % end % if position != offset: -
remove + remove % else: - skip + skip % end
% position += 1 % end -可以看到,模版大部分是用 HTML 写的,只有一小部分用来控制输出的其他代码。用两个括号括起来的变量是输出位置(像我们在第一个 ‘hello world’ 例子里看到的)。你也可以嵌入以百分号开头的 Python 代码。因为没有缩进,你需要用一个 % end 来结束当前的代码块(就像循环或 if 语句)。 +可以看到,模版大部分是用 HTML 写的,只有一小部分用来控制输出的其他代码。用两个大括号括起来的变量是输出位置(像我们在第一个 'hello world' 例子里看到的)。你也可以嵌入以百分号开头的 Python 代码。因为没有缩进,你需要用一个 `% end` 来结束当前的代码块(就像循环或 if 语句)。 -这个模版首先检查列表是否为空,然后遍历里面的每一项。每一项会用粗体显示歌曲名字,然后是艺术家名字,然后是一个是否跳过(如果是当前正在播的歌曲)或从列表移除的链接。所有歌曲的类型都是 ‘song’,如果类型是 ‘unknown’,那就不是歌曲而是网络电台。 +这个模版首先检查列表是否为空,然后遍历里面的每一项。每一项会用粗体显示歌曲名字,然后是艺术家名字,然后是一个是否跳过(如果是当前正在播的歌曲)或从列表移除的链接。所有歌曲的类型都是 'song',如果类型是 'unknown',那就不是歌曲而是网络电台。 /remove/ 和 /skip/ 路径只是简单地封装了 XBMC 控制功能,在改动生效后重新加载 /juke: - @route(‘/skip/’) + @route('/skip/') def index(position): - print xbmc.Player.GoTo({‘playerid’:0, ‘to’:’next’}) - redirect(“/juke”) - @route(‘/remove/’) + print xbmc.Player.GoTo({'playerid':0, 'to':'next'}) + redirect("/juke") + @route('/remove/') def index(position): playlistid = get_playlistid() if playlistid >= 0: - xbmc.Playlist.Remove({‘playlistid’:int(playlistid), ‘position’:int(position)}) - redirect(“/juke”) + xbmc.Playlist.Remove({'playlistid':int(playlistid), 'position':int(position)}) + redirect("/juke") 当然,如果不能往列表里添加歌曲的话那这个列表管理功能也不行。 因为一旦播放列表结束,它就消失了,所以你需要重新创建一个,这会让事情复杂一些。而且有点让人迷惑的是,播放列表是通过调用 Playlist.Clear() 方法来创建的。这个方法也还用来删除包含网络电台(类型是 unknown)的播放列表。另一个麻烦的地方是列表里的网络电台开始播放后就不会停,所以如果当前在播网络电台,也会需要清除播放列表。 -这些页面包含了指向 /play/ 的链接来播放歌曲。通过下面的代码处理: +这些页面包含了指向 /play/\ 的链接来播放歌曲。通过下面的代码处理: - @route(‘/play/’) + @route('/play/') def index(id): playlistid = get_playlistid() playlist, not_needed= get_playlist() - if playlistid < 0 or playlist[0][‘type’] == ‘unknown’: - xbmc.Playlist.Clear({“playlistid”:0}) - xbmc.Playlist.Add({“playlistid”:0, “item”:{“songid”:int(id)}}) - xbmc.Player.open({“item”:{“playlistid”:0}}) + if playlistid < 0 or playlist[0]['type'] == 'unknown': + xbmc.Playlist.Clear({"playlistid":0}) + xbmc.Playlist.Add({"playlistid":0, "item":{"songid":int(id)}}) + xbmc.Player.open({"item":{"playlistid":0}}) playlistid = 0 else: - xbmc.Playlist.Add({“playlistid”:playlistid, “item”:{“songid”:int(id)}}) + xbmc.Playlist.Add({"playlistid":playlistid, "item":{"songid":int(id)}}) remove_duplicates(playlistid) - redirect(“/juke”) + redirect("/juke") 最后一件事情是实现 remove_duplicates 调用。这并不是必须的 - 而且还有人并不喜欢这个 - 不过可以保证同一首歌不会多次出现在播放列表里。 @@ -191,40 +191,40 @@ API 文档在这里:[http://wiki.xbmc.org/?title=JSON-RPC_API/v6][2]。它列 还需要处理一下 UI,不过功能已经有了。 -> ### 日志 ### +> **日志** > > 通常拿到 XBMC JSON API 并不清楚能用来做什么,而且它的文档也有点模糊。找出如何使用的一种方式是看别的遥控程序是怎么做的。如果打开日志功能,就可以在使用其他遥控程序的时候看到哪个 API 被调用了,然后就可以应用到在自己的代码里。 > -> 要打开日志功能,把 XBMC 媒体中心 接到显示器上,再依次进入设置 > 系统 > 调试,打开允许调试日志。在打开日志功能后,还需要登录到 XBMC 机器上(比如通过 SSH),然后就可以查看日志了。日志文件的位置应该显示在 XBMC 界面左上角。在 RaspBMC 系统里,文件位置是 /home/pi/.xbmc/temp/xbmc.log。你可以通过下面的命令实时监视哪个 API 接口被调用了: +> 要打开日志功能,把 Kodi 媒体中心 接到显示器上,再依次进入设置 > 系统 > 调试,打开允许调试日志。在打开日志功能后,还需要登录到 Kodi 机器上(比如通过 SSH),然后就可以查看日志了。日志文件的位置应该显示在 Kodi 界面左上角。在 RaspBMC 系统里,文件位置是 /home/pi/.xbmc/temp/xbmc.log。你可以通过下面的命令实时监视哪个 API 接口被调用了: > > cd /home/pi/.xbmc/temp -> tail -f xbmc.log | grep “JSON” +> tail -f xbmc.log | grep "JSON" #### 增加功能 #### -上面的代码都是用来播放 XBMC 媒体库里的歌曲的,但我们还希望能播放网络电台。每个插件都有自己的独立 URL 可以通过普通的 XBMC JSON 命令来获取信息。举个例子,要从电台插件里获取选中的电台,可以使用; +上面的代码都是用来播放 Kodi 媒体库里的歌曲的,但我们还希望能播放网络电台。每个插件都有自己的独立 URL 可以通过普通的 XBMC JSON 命令来获取信息。举个例子,要从电台插件里获取选中的电台,可以使用; - @route(‘/radio/’) + @route('/radio/') def index(): - my_stations = xbmc.Files.GetDirectory({“directory”:”plugin://plugin.audio.radio_de/stations/my/”, “properties”: - [“title”,”thumbnail”,”playcount”,”artist”,”album”,”episode”,”season”,”showtitle”]}) - if ‘result’ in my_stations.keys(): - return template(‘radio’, stations=my_stations[‘result’][‘files’]) + my_stations = xbmc.Files.GetDirectory({"directory":"plugin://plugin.audio.radio_de/stations/my/", "properties": + ["title","thumbnail","playcount","artist","album","episode","season","showtitle"]}) + if 'result' in my_stations.keys(): + return template('radio', stations=my_stations['result']['files']) else: - return template(‘error’, error=’radio’) + return template('error', error='radio') 这样可以返回一个可以和歌曲一样能添加到播放列表的文件。不过,这些文件能一直播下去,所以(之前说过)在添加其他歌曲的时候需要重新创建列表。 #### 共享歌曲 #### -除了伺服页面模版,Bottle 还支持静态文件。方便用于那些不会因为用户输入而改变的内容。可以是 CSS 文件,一张图片或是一首 MP3 歌曲。在我们的简单遥控程序里(目前)还没有任何用来美化的 CSS 或图片,不过我们增加了一个下载歌曲的途径。这个可以让媒体中心变成一个存放歌曲的 NAS 盒子。在需要传输大量数据的时候,最好还是用类似 Samba 的功能,但只是下几首歌到手机上的话使用静态文件也是很好的方式。 +除了伺服页面模版,Bottle 还支持静态文件,方便用于那些不会因为用户输入而改变的内容。可以是 CSS 文件,一张图片或是一首 MP3 歌曲。在我们的简单遥控程序里(目前)还没有任何用来美化的 CSS 或图片,不过我们增加了一个下载歌曲的途径。这个可以让媒体中心变成一个存放歌曲的 NAS 盒子。在需要传输大量数据的时候,最好还是用类似 Samba 的功能,但只是下几首歌到手机上的话使用静态文件也是很好的方式。 通过歌曲 ID 来下载的 Bottle 代码: - @route(‘/download/’) + @route('/download/') def index(id): - data = xbmc.AudioLibrary.GetSongDetails({“songid”:int(id), “properties”:[“file”]}) - full_filename = data[‘result’][‘songdetails’][‘file’] + data = xbmc.AudioLibrary.GetSongDetails({"songid":int(id), "properties":["file"]}) + full_filename = data['result']['songdetails']['file'] path, filename = os.path.split(full_filename) return static_file(filename, root=path, download=True) @@ -232,13 +232,13 @@ API 文档在这里:[http://wiki.xbmc.org/?title=JSON-RPC_API/v6][2]。它列 我们已经把所有的代码过了一遍,不过还需要一点工作来把它们集合到一起。可以自己去 GitHub 页面 [https://github.com/ben-ev/xbmc-remote][3] 看下。 -> ### 设置 ### +> **设置** > > 我们的遥控程序已经开发完成,还需要保证让它在媒体中心每次开机的时候都能启动。有几种方式,最简单的是在 /etc/rc.local 里增加一行命令来启动。我们的文件位置在 /opt/xbmc-remote/remote.py,其他文件也和它一起。然后在 /etc/rc.local 最后的 exit 0 之前增加了下面一行。 > > cd /opt/xbmc-remote && python remote.py & -> ### GitHub ### +> **GitHub** > > 这个项目目前还只是个架子,但是 - 我们运营杂志就意味着没有太多自由时间来编程。不过,我们启动了一个 GitHub 项目,希望能持续完善, 而如果你觉得这个项目有用的话,欢迎做出贡献。 > @@ -252,7 +252,7 @@ via: http://www.linuxvoice.com/xbmc-build-a-remote-control/ 作者:[Ben Everard][a] 译者:[zpl1025](https://github.com/zpl1025) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From e64f420e21ff0539c4c9cace7934623e07f322e5 Mon Sep 17 00:00:00 2001 From: wxy Date: Fri, 24 Jul 2015 10:20:47 +0800 Subject: [PATCH 683/965] PUB:20150121 Syncthing--A Private And Secure Tool To Sync Files or Folders Between Computers @XLCYun --- ...Sync Files or Folders Between Computers.md | 31 ++++++++++--------- 1 file changed, 16 insertions(+), 15 deletions(-) rename {translated/tech => published}/20150121 Syncthing--A Private And Secure Tool To Sync Files or Folders Between Computers.md (79%) diff --git a/translated/tech/20150121 Syncthing--A Private And Secure Tool To Sync Files or Folders Between Computers.md b/published/20150121 Syncthing--A Private And Secure Tool To Sync Files or Folders Between Computers.md similarity index 79% rename from translated/tech/20150121 Syncthing--A Private And Secure Tool To Sync Files or Folders Between Computers.md rename to published/20150121 Syncthing--A Private And Secure Tool To Sync Files or Folders Between Computers.md index 8819c80744..73af381b22 100644 --- a/translated/tech/20150121 Syncthing--A Private And Secure Tool To Sync Files or Folders Between Computers.md +++ b/published/20150121 Syncthing--A Private And Secure Tool To Sync Files or Folders Between Computers.md @@ -1,10 +1,10 @@ -Syncthing: 一个跨计算机的私人的文件/文件夹安全同步工具 +Syncthing: 一个在计算机之间同步文件/文件夹的私密安全同步工具 ================================================================================ ### 简介 ### -**Syncthing** 是一个免费开源的工具,它能在你的各个网络计算机间同步文件/文件夹。它不像其它的同步工具,如**BitTorrent Sync**和**Dropbox**那样,它的同步数据是直接从一个系统中直接传输到另一个系统的,并且它是完全开源的,安全且私有的。你所有的珍贵数据都会被存储在你的系统中,这样你就能对你的文件和文件夹拥有全面的控制权,没有任何的文件或文件夹会被存储在第三方系统中。此外,你有权决定这些数据该存于何处,是否要分享到第三方,或这些数据在互联网上的传输方式。 +**Syncthing**是一个免费开源的工具,它能在你的各个网络计算机间同步文件/文件夹。它不像其它的同步工具,如**BitTorrent Sync**和**Dropbox**那样,它的同步数据是直接从一个系统中直接传输到另一个系统的,并且它是完全开源的,安全且私密的。你所有的珍贵数据都会被存储在你的系统中,这样你就能对你的文件和文件夹拥有全面的控制权,没有任何的文件或文件夹会被存储在第三方系统中。此外,你有权决定这些数据该存于何处,是否要分享到第三方,或这些数据在互联网上的传输方式。 -所有的信息通讯都使用TLS进行加密,这样你的数据便能十分安全地逃离窥探。Syncthing有一个强大的响应式的网页管理界面(WebGUI,下同),它能够帮助用户简便地添加,删除和管理那些通过网络进行同步的文件夹。通过使用Syncthing,你可以在多个系统上一次同步多个文件夹。在安装和使用上,Syncthing是一个可移植的,简单但强大的工具。即然文件或文件夹是从一部计算机中直接传输到另一计算机中的,那么你就无需考虑向云服务供应商支付金钱来获取额外的云空间。你所需要的仅仅是非常稳定的LAN/WAN连接和你的系统中足够的硬盘空间。它支持所有的现代操作系统,包括GNU/Linux, Windows, Mac OS X, 当然还有Android。 +所有的信息通讯都使用TLS进行加密,这样你的数据便能十分安全地逃离窥探。Syncthing有一个强大的响应式的网页管理界面(WebGUI,下同),它能够帮助用户简便地添加、删除和管理那些通过网络进行同步的文件夹。通过使用Syncthing,你可以在多个系统上一次同步多个文件夹。在安装和使用上,Syncthing是一个可移植的、简单而强大的工具。即然文件或文件夹是从一部计算机中直接传输到另一计算机中的,那么你就无需考虑向云服务供应商支付金钱来获取额外的云空间。你所需要的仅仅是非常稳定的LAN/WAN连接以及在你的系统中有足够的硬盘空间。它支持所有的现代操作系统,包括GNU/Linux, Windows, Mac OS X, 当然还有Android。 ### 安装 ### @@ -13,7 +13,7 @@ Syncthing: 一个跨计算机的私人的文件/文件夹安全同步工具 ### 系统1细节: ### - **操作系统**: Ubuntu 14.04 LTS server; -- **主机名**: server1.unixmen.local; +- **主机名**: **server1**.unixmen.local; - **IP地址**: 192.168.1.150. - **系统用户**: sk (你可以使用你自己的系统用户) - **同步文件夹**: /home/Sync/ (Syncthing会默认创建) @@ -21,7 +21,7 @@ Syncthing: 一个跨计算机的私人的文件/文件夹安全同步工具 ### 系统2细节 ### - **操作系统**: Ubuntu 14.10 server; -- **主机名**: server.unixmen.local; +- **主机名**: **server**.unixmen.local; - **IP地址**: 192.168.1.151. - **系统用户**: sk (你可以使用你自己的系统用户) - **同步文件夹**: /home/Sync/ (Syncthing会默认创建) @@ -49,7 +49,7 @@ Syncthing: 一个跨计算机的私人的文件/文件夹安全同步工具 cd syncthing-linux-amd64-v0.10.20/ -复制可执行文件"Syncthing"到**$PATH**: +复制可执行文件"syncthing"到**$PATH**: sudo cp syncthing /usr/local/bin/ @@ -57,7 +57,7 @@ Syncthing: 一个跨计算机的私人的文件/文件夹安全同步工具 syncthing -当你执行上述命令后,syncthing会生成一个配置以及一些关键值(keys),并且在你的浏览器上打开一个管理界面。, +当你执行上述命令后,syncthing会生成一个配置以及一些配置键值,并且在你的浏览器上打开一个管理界面。 输入示例: @@ -78,11 +78,11 @@ Syncthing: 一个跨计算机的私人的文件/文件夹安全同步工具 [BQXVO] 15:41:07 INFO: Device BQXVO3D-VEBIDRE-MVMMGJI-ECD2PC3-T5LT3JB-OK4Z45E-MPIDWHI-IRW3NAZ is "server1" at [dynamic] [BQXVO] 15:41:07 INFO: Completed initial scan (rw) of folder default -Syncthing已经被成功地初始化了,网页管理接口也可以通过浏览器在URL: **http://localhost:8080**进行访问了。如上面输入所看到的,Syncthing在你的**home**目录中的Sync目录**下自动为你创建了一个名为**default**的文件夹。 +Syncthing已经被成功地初始化了,网页管理接口也可以通过浏览器访问URL: **http://localhost:8080**。如上面输入所看到的,Syncthing在你的**home**目录中的Sync目录**下自动为你创建了一个名为**default**的文件夹。 -默认情况下,Syncthing的网页管理界面(WebGUI)只能在本地端口(localhost)中进行访问,你需要在两个系统中进行以下操作: +默认情况下,Syncthing的网页管理界面只能在本地端口(localhost)中进行访问,要从远程进行访问,你需要在两个系统中进行以下操作: -首先,按下CTRL+C键来停止Syncthing初始化进程。现在你回到了终端界面。 +首先,按下CTRL+C键来终止Syncthing初始化进程。现在你回到了终端界面。 编辑**config.xml**文件, @@ -115,17 +115,18 @@ Syncthing已经被成功地初始化了,网页管理接口也可以通过浏 现在,在你的浏览器上打开**http://ip-address:8080/**。你会看到下面的界面: ![](http://www.unixmen.com/wp-content/uploads/2015/01/Syncthing-server1-Mozilla-Firefox_001.png) + 网页管理界面分为两个窗格,在左窗格中,你应该可以看到同步的文件夹列表。如前所述,文件夹**default**在你初始化Syncthing时被自动创建。如果你想同步更多文件夹,点击**Add Folder**按钮。 在右窗格中,你可以看到已连接的设备数。现在这里只有一个,就是你现在正在操作的计算机。 -### 网页管理界面(WebGUI)上设置Syncthing ### +### 网页管理界面上设置Syncthing ### 为了提高安全性,让我们启用TLS,并且设置访问网页管理界面的管理员用户和密码。要做到这点,点击右上角的齿轮按钮,然后选择**Settings** ![](http://www.unixmen.com/wp-content/uploads/2015/01/Menu_002.png) -输入管理员的帐户名/密码。我设置的是admin/Ubuntu。你可以使用一些更复杂的密码。 +输入管理员的帐户名/密码。我设置的是admin/Ubuntu。你应该使用一些更复杂的密码。 ![](http://www.unixmen.com/wp-content/uploads/2015/01/Syncthing-server1-Mozilla-Firefox_004.png) @@ -155,7 +156,7 @@ Syncthing已经被成功地初始化了,网页管理接口也可以通过浏 ![](http://www.unixmen.com/wp-content/uploads/2015/01/Syncthing-server-Mozilla-Firefox_010.png) -接着会出现下面的界面。在Device区域粘贴**系统1 ID **。输入设备名称(可选)。在地址区域,你可以输入其它系统(译者注:即粘贴的ID所属的系统,此应为系统1)的IP地址,或者使用默认值。默认值为**dynamic**。最后,选择要同步的文件夹。在我们的例子中,同步文件夹为**default**。 +接着会出现下面的界面。在Device区域粘贴**系统1 ID **。输入设备名称(可选)。在地址区域,你可以输入其它系统( LCTT 译注:即粘贴的ID所属的系统,此应为系统1)的IP地址,或者使用默认值。默认值为**dynamic**。最后,选择要同步的文件夹。在我们的例子中,同步文件夹为**default**。 ![](http://www.unixmen.com/wp-content/uploads/2015/01/Syncthing-server-Mozilla-Firefox_009.png) @@ -181,7 +182,7 @@ Syncthing已经被成功地初始化了,网页管理接口也可以通过浏 ![](http://www.unixmen.com/wp-content/uploads/2015/01/Syncthing-server-Mozilla-Firefox_018.png) -![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/Syncthing-server-Mozilla-Firefox_018.png) +![](http://www.unixmen.com/wp-content/uploads/2015/01/Syncthing-server-Mozilla-Firefox_018.png) 现在,在任一个系统中的“**default**”文件夹中放进任意文件或文件夹。你应该可以看到这些文件/文件夹被自动同步到其它系统。 @@ -197,7 +198,7 @@ via: http://www.unixmen.com/syncthing-private-secure-tool-sync-filesfolders-comp 作者:[SK][a] 译者:[XLCYun](https://github.com/XLCYun) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 From 4670ba75bd1f6cc0287c02ded300eb95a46b8c66 Mon Sep 17 00:00:00 2001 From: GOLinux Date: Fri, 24 Jul 2015 10:51:47 +0800 Subject: [PATCH 684/965] [Translated]20150722 12 Useful PHP Commandline Usage Every Linux User Must Know.md --- ...ndline Usage Every Linux User Must Know.md | 204 ------------------ ...ndline Usage Every Linux User Must Know.md | 193 +++++++++++++++++ 2 files changed, 193 insertions(+), 204 deletions(-) delete mode 100644 sources/tech/20150722 12 Useful PHP Commandline Usage Every Linux User Must Know.md create mode 100644 translated/tech/20150722 12 Useful PHP Commandline Usage Every Linux User Must Know.md diff --git a/sources/tech/20150722 12 Useful PHP Commandline Usage Every Linux User Must Know.md b/sources/tech/20150722 12 Useful PHP Commandline Usage Every Linux User Must Know.md deleted file mode 100644 index 8833405982..0000000000 --- a/sources/tech/20150722 12 Useful PHP Commandline Usage Every Linux User Must Know.md +++ /dev/null @@ -1,204 +0,0 @@ -Translating by GOLinu! -12 Useful PHP Commandline Usage Every Linux User Must Know -================================================================================ -In my last post “[How to Use and Execute PHP Codes in Linux Command – line][1]”, I emphasized on running PHP codes directly in Linux Command-line as well as executing PHP script file in Linux Terminal. - -![Run PHP Codes in Linux Commandline](http://www.tecmint.com/wp-content/uploads/2015/07/Run-PHP-Codes-in-Linux-Commandline.jpeg) - -Run PHP Codes in Linux Commandline – Part 2 - -This post aims at making you aware of a few awesome features of PHP usage in Linux terminal. - -Let us configure a few `php.ini` settings in the PHP interactive shell. - -**6. Set PHP Command-line Prompt** - -To set PHP command-line prompt, you need to start a PHP interactive shell from the Linux terminal using following php -a (enabling PHP Interactive mode) command. - - $ php -a - -and then set anything (say Hi Tecmint ::) as PHP interactive shell command prompt, simply as: - - php > #cli.prompt=Hi Tecmint :: - -![Enable PHP Interactive Shell](http://www.tecmint.com/wp-content/uploads/2015/07/Enable-PHP-Interactive-Shell.png) - -Enable PHP Interactive Shell - -Also you can set current time as your command Line Prompt, simply as: - - php > #cli.prompt=`echo date('H:m:s');` > - - 22:15:43 > - -**7. Produce one screen output at a time** - -In our last article, we have used ‘less‘ command over a lots of places pipelined with original command. We did this to get one screen of output where output could not fit on one screen. But we can configure php.ini file to set pager value to less to produce one screen output at a time simply as, - - $ php -a - php > #cli.pager=less - -![Fix PHP Screen Output](http://www.tecmint.com/wp-content/uploads/2015/07/Fix-PHP-Screen-Output.png) - -Fix PHP Screen Output - -So, next time when you run a command (say debugger `phpinfo();`) where the output is too big to fit a screen, it will automatically produce output that fits your current. - - php > phpinfo(); - -![PHP Info Output](http://www.tecmint.com/wp-content/uploads/2015/07/PHP-Info-Output.png) - -PHP Info Output - -**8. Suggestions and TAB completion** - -PHP shell is a smart enough to show you suggestions and TAB Completion. You can use TAB key to use this feature. If more than one option is available for the string that you want to TAB completion, you have to use TAB key twice, else use it once. - -In-case of more than one possibility, use TAB twice. - - php > ZIP [TAB] [TAB] - -In-case of single possibility, use TAB once. - - php > #cli.pager [TAB] - -You can keep pressing TAB for options till values of option are satisfied. All the activities are logged to file `~/.php-history`. - -To check your PHP interactive shell activity log, you may run: - - $ nano ~/.php_history | less - -![Check PHP Interactive Shell Logs](http://www.tecmint.com/wp-content/uploads/2015/07/Check-PHP-Interactive-Shell-Logs.png) - -Check PHP Interactive Shell Logs - -**9. You can use color inside PHP interactive shell. All you need to know are the color codes.** - -Use echo to print the output into various colors, simply as: - - php > echo “color_code1 TEXT second_color_code”; - -or a more explaining example is: - - php > echo "\033[0;31m Hi Tecmint \x1B[0m"; - -![Enable Colors in PHP Shell](http://www.tecmint.com/wp-content/uploads/2015/07/Enable-Colors-in-PHP-Shell.png) - -Enable Colors in PHP Shell - -We have seen till now that pressing the return key means execute the command, however semicolon at the end of each command in Php shell is compulsory. - -**10. Basename in php shell prints the trailing name component of path** - -The basename function in php shell prints the trailing name component from a given string containing the path to a file or directory. - -basename() example #1 and #2. - - php > echo basename("/var/www/html/wp/wp-content/plugins"); - php > echo basename("www.tecmint.com/contact-us.html"); - -The above both examples will output: - - plugins - contact-us.html - -![Print Base Name in PHP](http://www.tecmint.com/wp-content/uploads/2015/07/Print-Base-Name-in-PHP.png) - -Print Base Name in PHP - -**11. You may create a file (say test1.txt) using php interactive shell at your Desktop, simply as** - - $ touch("/home/avi/Desktop/test1.txt"); - -We have already seen how fine PHP interactive shell is in Mathematics, Here are a few more examples to stun you. - -**12. Print the length of a string say tecmint.com using PHP interactive shell** - -strlen function used to get a length of the given string. - - php > echo strlen("tecmint.com"); - -![Print Length String in PHP](http://www.tecmint.com/wp-content/uploads/2015/07/Print-Length-String-in-PHP.png) - -Print Length String in PHP - -**13. PHP Interactive shell can sort an array. Yes you heard it right** - -Declare Variable a and set it’s value to array(7,9,2,5,10). - - php > $a=array(7,9,2,5,10); - -Sort the numbers in the array. - - php > sort($a); - -Print numbers of the array in sorted order along with their order. The first one is [0]. - - php > print_r($a); - Array - ( - [0] => 2 - [1] => 5 - [2] => 7 - [3] => 9 - [4] => 10 - ) - -![Sort Arrays in PHP](http://www.tecmint.com/wp-content/uploads/2015/07/Sort-Arrays-in-PHP.png) - -Sort Arrays in PHP - -**14. Get the value of Pi in PHP Interactive Shell** - - php > echo pi(); - - 3.1415926535898 - -**15. Print the square root of a number say 32** - - php > echo sqrt(150); - - 12.247448713916 - -**16. Echo a random number from the range be 0-10** - - php > echo rand(0, 10); - -![Get Random Number in PHP](http://www.tecmint.com/wp-content/uploads/2015/07/Get-Random-Number-in-PHP.png) - -Get Random Number in PHP - -**17. Get md5sum and sha1sum for a given string For example, let’s check the md5sum and sha1sum of a string (say avi) on php shell and cross check the result with those md5sum and sha1sum generated by bash shell.** - - php > echo md5(avi); - 3fca379b3f0e322b7b7967bfcfb948ad - - php > echo sha1(avi); - 8f920f22884d6fea9df883843c4a8095a2e5ac6f - ----------- - - $ echo -n avi | md5sum - 3fca379b3f0e322b7b7967bfcfb948ad - - - $ echo -n avi | sha1sum - 8f920f22884d6fea9df883843c4a8095a2e5ac6f - - -![Check md5sum and sha1sum in PHP](http://www.tecmint.com/wp-content/uploads/2015/07/Check-md5sum-and-sha1sum.png) - -Check md5sum and sha1sum in PHP - -This is just a glimpse of what can be achieved from a PHP Shell and how interactive is PHP shell. That’s all for now from me. Keep Connected to tecmint. Provide us with your valuable feedback in the comments. Like and share us to get spread. - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/execute-php-codes-functions-in-linux-commandline/ - -作者:[Avishek Kumar][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.tecmint.com/author/avishek/ -[1]:http://www.tecmint.com/run-php-codes-from-linux-commandline/ diff --git a/translated/tech/20150722 12 Useful PHP Commandline Usage Every Linux User Must Know.md b/translated/tech/20150722 12 Useful PHP Commandline Usage Every Linux User Must Know.md new file mode 100644 index 0000000000..8c00c6a75c --- /dev/null +++ b/translated/tech/20150722 12 Useful PHP Commandline Usage Every Linux User Must Know.md @@ -0,0 +1,193 @@ +每个Linux人应知应会的12个有用的PHP命令行用法 +================================================================================ +在我上一篇文章“[在Linux命令行中使用并执行PHP代码][1]”中,我同时着重讨论了直接在Linux命令行中运行PHP代码以及在Linux终端中执行PHP脚本文件。 + +![Run PHP Codes in Linux Commandline](http://www.tecmint.com/wp-content/uploads/2015/07/Run-PHP-Codes-in-Linux-Commandline.jpeg) + +在Linux命令行运行PHP代码——第二部分 + +本文旨在让你了解一些相当不错的Linux终端中的PHP用法特性。 + +让我们先在PHP交互shell中来对`php.ini`设置进行一些配置吧。 + +**6. 设置PHP命令行提示符** + +要设置PHP命令行提示,你需要在Linux终端中使用下面的php -a(启用PHP交互模式)命令开启一个PHP交互shell。 + + $ php -a + +然后,设置任何东西(比如说Hi Tecmint ::)作为PHP交互shell的命令提示符,操作如下: + + php > #cli.prompt=Hi Tecmint :: + +![Enable PHP Interactive Shell](http://www.tecmint.com/wp-content/uploads/2015/07/Enable-PHP-Interactive-Shell.png) +启用PHP交互Shell + +同时,你也可以设置当前时间作为你的命令行提示符,操作如下: + + php > #cli.prompt=`echo date('H:m:s');` > + + 22:15:43 > + +**7. 每次输出一屏** + +在我们上一篇文章中,我们已经在原始命令中通过管道在很多地方使用了‘less‘命令。通过该操作,我们可以在那些不能一次满屏输出的地方获得每次一屏的输出。但是,我们可以通过配置php.ini文件,设置pager的值为less以每次输出一屏,操作如下: + + $ php -a + php > #cli.pager=less + +![Fix PHP Screen Output](http://www.tecmint.com/wp-content/uploads/2015/07/Fix-PHP-Screen-Output.png) +固定PHP屏幕输出 + +这样,下次当你运行一个命令(比如说条调试器`phpinfo();`)的时候,而该命令的输出内容又太过庞大而不能固定在一屏,它就会自动产生适合你当前屏幕的输出结果。 + + php > phpinfo(); + +![PHP Info Output](http://www.tecmint.com/wp-content/uploads/2015/07/PHP-Info-Output.png) +PHP信息输出 + +**8. 建议和TAB补全** + +PHP shell足够智能,它可以显示给你建议和进行TAB补全,你可以通过TAB键来使用该功能。如果对于你想要用TAB补全的字符串而言有多个选项,那么你需要使用两次TAB键来完成,其它情况则使用一次即可。 + +如果有超过一个的可能性,请使用两次TAB键。 + + php > ZIP [TAB] [TAB] + +如果只有一个可能性,只要使用一次TAB键。 + + php > #cli.pager [TAB] + +你可以一直按TAB键来获得选项,直到选项值满足要求。所有的行为都将记录到`~/.php-history`文件。 + +要检查你的PHP交互shell活动日志,你可以执行: + + $ nano ~/.php_history | less + +![Check PHP Interactive Shell Logs](http://www.tecmint.com/wp-content/uploads/2015/07/Check-PHP-Interactive-Shell-Logs.png) +检查PHP交互Shell日志 + +**9. 你可以在PHP交互shell中使用颜色,你所需要知道的仅仅是颜色代码。** + +使用echo来打印各种颜色的输出结果,看我信手拈来: + + php > echo “color_code1 TEXT second_color_code”; + +一个更能说明问题的例子是: + + php > echo "\033[0;31m Hi Tecmint \x1B[0m"; + +![Enable Colors in PHP Shell](http://www.tecmint.com/wp-content/uploads/2015/07/Enable-Colors-in-PHP-Shell.png) +在PHP Shell中启用彩色 + +到目前为止,我们已经看到,按回车键意味着执行命令,然而PHP Shell中各个命令结尾的分号是必须的。 + +**10. PHP shell中的用以打印后续组件的路径名称** + +PHP shell中的basename函数从给出的包含有到文件或目录路径的后续组件的路径名称。 + +basename()样例#1和#2。 + + php > echo basename("/var/www/html/wp/wp-content/plugins"); + php > echo basename("www.tecmint.com/contact-us.html"); + +上述两个样例都将输出: + + plugins + contact-us.html + +![Print Base Name in PHP](http://www.tecmint.com/wp-content/uploads/2015/07/Print-Base-Name-in-PHP.png) +在PHP中打印基本名称 + +**11. 你可以使用PHP交互shell在你的桌面创建文件(比如说test1.txt),就像下面这么简单** + + $ touch("/home/avi/Desktop/test1.txt"); + +我们已经见识了PHP交互shell在数学运算中有多优秀,这里还有更多一些例子会令你吃惊。 + +**12. 使用PHP交互shell打印比如像tecmint.com这样的字符串的长度** + +strlen函数用于获取指定字符串的长度。 + + php > echo strlen("tecmint.com"); + +![Print Length String in PHP](http://www.tecmint.com/wp-content/uploads/2015/07/Print-Length-String-in-PHP.png) +在PHP中打印字符串长度 + +**13. PHP交互shell可以对数组排序,是的,你没听错** + +声明变量a,并将其值设置为array(7,9,2,5,10)。 + + php > $a=array(7,9,2,5,10); + +对数组中的数字进行排序。 + + php > sort($a); + +以排序后的顺序打印数组中的数字,同时打印序号,第一个为[0]。 + + php > print_r($a); + Array + ( + [0] => 2 + [1] => 5 + [2] => 7 + [3] => 9 + [4] => 10 + ) + +![Sort Arrays in PHP](http://www.tecmint.com/wp-content/uploads/2015/07/Sort-Arrays-in-PHP.png) +在PHP中对数组排序 + +**14. 在PHP交互Shell中获取Pi的值** + + php > echo pi(); + + 3.1415926535898 + +**15. 打印某个数比如32的平方根** + + php > echo sqrt(150); + + 12.247448713916 + +**16. 从0-10的范围内回显一个随机数** + + php > echo rand(0, 10); + +![Get Random Number in PHP](http://www.tecmint.com/wp-content/uploads/2015/07/Get-Random-Number-in-PHP.png) +在PHP中获取随机数 + +**17. 获取某个指定字符串的md5sum和sha1sum,例如,让我们在PHP Shell中检查某个字符串(比如说avi)的md5sum和sha1sum,并交叉检查这些带有bash shell生成的md5sum和sha1sum的结果。** + + php > echo md5(avi); + 3fca379b3f0e322b7b7967bfcfb948ad + + php > echo sha1(avi); + 8f920f22884d6fea9df883843c4a8095a2e5ac6f + +---------- + + $ echo -n avi | md5sum + 3fca379b3f0e322b7b7967bfcfb948ad - + + $ echo -n avi | sha1sum + 8f920f22884d6fea9df883843c4a8095a2e5ac6f - + +![Check md5sum and sha1sum in PHP](http://www.tecmint.com/wp-content/uploads/2015/07/Check-md5sum-and-sha1sum.png) +在PHP中检查md5sum和sha1sum + +这里只是PHP Shell中所能获取的功能和PHP Shell的交互特性的惊鸿一瞥,这些就是到现在为止我所讨论的一切。保持和tecmint的连线,在评论中为我们提供你有价值的反馈吧。为我们点赞并分享,帮助我们扩散哦。 + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/execute-php-codes-functions-in-linux-commandline/ + +作者:[Avishek Kumar][a] +译者:[GOLinux](https://github.com/GOLinux) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/avishek/ +[1]:http://www.tecmint.com/run-php-codes-from-linux-commandline/ From 55f02f7b194d4bcc0cd2dd3f80637d862d36d2dd Mon Sep 17 00:00:00 2001 From: joeren Date: Fri, 24 Jul 2015 10:55:00 +0800 Subject: [PATCH 685/965] Update 20150722 How To Fix 'The Update Information Is Outdated' In Ubuntu 14.04.md --- ...Fix 'The Update Information Is Outdated' In Ubuntu 14.04.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150722 How To Fix 'The Update Information Is Outdated' In Ubuntu 14.04.md b/sources/tech/20150722 How To Fix 'The Update Information Is Outdated' In Ubuntu 14.04.md index f278c19b5f..b7b95c43b1 100644 --- a/sources/tech/20150722 How To Fix 'The Update Information Is Outdated' In Ubuntu 14.04.md +++ b/sources/tech/20150722 How To Fix 'The Update Information Is Outdated' In Ubuntu 14.04.md @@ -1,3 +1,4 @@ +Translating by GOLinux! How To Fix “The Update Information Is Outdated” In Ubuntu 14.04 ================================================================================ ![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/Fix_update_information_is_outdated.jpeg) @@ -55,4 +56,4 @@ via: http://itsfoss.com/fix-update-information-outdated-ubuntu/ [2]:http://itsfoss.com/notification-terminal-command-completion-ubuntu/ [3]:http://itsfoss.com/solve-gpg-error-signatures-verified-ubuntu/ [4]:http://itsfoss.com/install-spotify-ubuntu-1504/ -[5]:http://itsfoss.com/fix-update-errors-ubuntu-1404/ \ No newline at end of file +[5]:http://itsfoss.com/fix-update-errors-ubuntu-1404/ From 955880c1bb38e8e71b8f746d5e04fe3dc3e7bd1b Mon Sep 17 00:00:00 2001 From: ZTinoZ Date: Fri, 24 Jul 2015 11:02:39 +0800 Subject: [PATCH 686/965] Translating by ZTinoZ --- ...709 7 command line tools for monitoring your Linux system.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/talk/20150709 7 command line tools for monitoring your Linux system.md b/sources/talk/20150709 7 command line tools for monitoring your Linux system.md index caac29be68..e33c259d5c 100644 --- a/sources/talk/20150709 7 command line tools for monitoring your Linux system.md +++ b/sources/talk/20150709 7 command line tools for monitoring your Linux system.md @@ -54,7 +54,7 @@ Pstree“以树状图显示正在运行中的进程。如果pid被省略的话 ### iostat ### -A crucial factor in your Linux system’s performance is processor and storage usage, which are what the iostat command reports on. As with the ps command, iostat has loads of switches that allow you to select the output format you need as well as sample performance over a time period and then repeat that sampling a number of times before reporting. See [here][10]. +Linux系统的一个至关重要的性能指标是处理器和存储的使用率,它也是iostat命令所报告的内容。如同ps命令一样,iostat有很多选项允许你选择你需要的输出格式,除此之外还有某一段时间范围内的简单性能输出并在报告之前重复抽样多次。详情戳[这里][10]。 -------------------------------------------------------------------------------- From d9e1b6b16fa2d0a5a51ccdd9b6765db167cbb9cb Mon Sep 17 00:00:00 2001 From: ZTinoZ Date: Fri, 24 Jul 2015 11:03:51 +0800 Subject: [PATCH 687/965] Finish the translation by ZTinoZ --- ...50709 7 command line tools for monitoring your Linux system.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/talk/20150709 7 command line tools for monitoring your Linux system.md (100%) diff --git a/sources/talk/20150709 7 command line tools for monitoring your Linux system.md b/translated/talk/20150709 7 command line tools for monitoring your Linux system.md similarity index 100% rename from sources/talk/20150709 7 command line tools for monitoring your Linux system.md rename to translated/talk/20150709 7 command line tools for monitoring your Linux system.md From 2ae4c72b6cb59a7835f10e19723125d81463fc61 Mon Sep 17 00:00:00 2001 From: wxy Date: Fri, 24 Jul 2015 13:17:53 +0800 Subject: [PATCH 688/965] PUB:20150713 How to manage Vim plugins @XLCYun --- .../20150713 How to manage Vim plugins.md | 140 ++++++++++++++++ .../20150713 How to manage Vim plugins.md | 149 ------------------ 2 files changed, 140 insertions(+), 149 deletions(-) create mode 100644 published/20150713 How to manage Vim plugins.md delete mode 100644 translated/tech/20150713 How to manage Vim plugins.md diff --git a/published/20150713 How to manage Vim plugins.md b/published/20150713 How to manage Vim plugins.md new file mode 100644 index 0000000000..52c65e5871 --- /dev/null +++ b/published/20150713 How to manage Vim plugins.md @@ -0,0 +1,140 @@ +如何管理 Vim 插件 +================================================================================ + +Vim是Linux上一个轻量级的通用文本编辑器。虽然它开始时的学习曲线对于一般的Linux用户来说可能很困难,但比起它的好处,这些付出完全是值得的。vim 可以通过完全可定制的插件来增加越来越多的功能。但是,由于它的功能配置比较难,你需要花一些时间去了解它的插件系统,然后才能够有效地去个性化定置Vim。幸运的是,我们已经有一些工具能够使我们在使用Vim插件时更加轻松。而我日常所使用的就是Vundle。 + +### 什么是Vundle ### + +[Vundle][1]意即Vim Bundle,是一个vim插件管理器。Vundle能让你很简单地实现插件的安装、升级、搜索或者清除。它还能管理你的运行环境并且在标签方面提供帮助。在本教程中我们将展示如何安装和使用Vundle。 + +### 安装Vundle ### + +首先,如果你的Linux系统上没有Git的话,先[安装Git][2]。 + +接着,创建一个目录,Vim的插件将会被下载并且安装在这个目录上。默认情况下,这个目录为~/.vim/bundle。 + + $ mkdir -p ~/.vim/bundle + +现在,使用如下指令安装Vundle。注意Vundle本身也是一个vim插件。因此我们同样把vundle安装到之前创建的目录~/.vim/bundle下。 + + $ git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim + +### 配置Vundle ### + +现在配置你的.vimrc文件如下: + + set nocompatible " 必需。 + filetype off " 必须。 + + " 在这里设置你的运行时环境的路径。 + set rtp+=~/.vim/bundle/Vundle.vim + + " 初始化vundle + call vundle#begin() + + " 这一行应该永远放在开头。 + Plugin 'gmarik/Vundle.vim' + + " 这个示范来自https://github.com/gmarik/Vundle.vim README + Plugin 'tpope/vim-fugitive' + + " 取自http://vim-scripts.org/vim/scripts.html的插件 + Plugin 'L9' + + " 该Git插件没有放在GitHub上。 + Plugin 'git://git.wincent.com/command-t.git' + + "本地计算机上的Git仓库路径 (例如,当你在开发你自己的插件时) + Plugin 'file:///home/gmarik/path/to/plugin' + + " vim脚本sparkup存放在这个名叫vim的仓库下的一个子目录中。 + " 将这个路径正确地设置为runtimepath。 + Plugin 'rstacruz/sparkup', {'rtp': 'vim/'} + + " 避免与L9发生名字上的冲突 + Plugin 'user/L9', {'name': 'newL9'} + + "所有的插件都应该在这一行之前。 + call vundle#end() " 必需。 + +容我简单解释一下上面的设置:默认情况下,Vundle将从github.com或者vim-scripts.org下载和安装vim插件。你也可以改变这个默认行为。 + +要从github安装插件: + + Plugin 'user/plugin' + +要从 http://vim-scripts.org/vim/scripts.html 处安装: + + Plugin 'plugin_name' + +要从另外一个git仓库中安装: + + Plugin 'git://git.another_repo.com/plugin' + +从本地文件中安装: + + Plugin 'file:///home/user/path/to/plugin' + +你同样可以定制其它东西,例如你的插件的运行时路径,当你自己在编写一个插件时,或者你只是想从其它目录——而不是~/.vim——中加载插件时,这样做就非常有用。 + + Plugin 'rstacruz/sparkup', {'rtp': 'another_vim_path/'} + +如果你有同名的插件,你可以重命名你的插件,这样它们就不会发生冲突了。 + + Plugin 'user/plugin', {'name': 'newPlugin'} + +### 使用Vum命令 ### + +一旦你用vundle设置好你的插件,你就可以通过几个vundle命令来安装、升级、搜索插件,或者清除没有用的插件。 + +#### 安装一个新的插件 #### + +`PluginInstall`命令将会安装所有列在你的.vimrc文件中的插件。你也可以通过传递一个插件名给它,来安装某个的特定插件。 + + :PluginInstall + :PluginInstall <插件名> + +![](https://farm1.staticflickr.com/559/18998707843_438cd55463_c.jpg) + +#### 清除没有用的插件 #### + +如果你有任何没有用到的插件,你可以通过`PluginClean`命令来删除它。 + + :PluginClean + +![](https://farm4.staticflickr.com/3814/19433047689_17d9822af6_c.jpg) + +#### 查找一个插件 #### + +如果你想从提供的插件清单中安装一个插件,搜索功能会很有用。 + + :PluginSearch <文本> + +![](https://farm1.staticflickr.com/541/19593459846_75b003443d_c.jpg) + +在搜索的时候,你可以在交互式分割窗口中安装、清除、重新搜索或者重新加载插件清单。安装后的插件不会自动加载生效,要使其加载生效,可以将它们添加进你的.vimrc文件中。 + +### 总结 ### + +Vim是一个妙不可言的工具。它不单单是一个能够使你的工作更加顺畅高效的默认文本编辑器,同时它还能够摇身一变,成为现存的几乎任何一门编程语言的IDE。 + +注意,有一些网站能帮你找到适合的vim插件。猛击 [http://www.vim-scripts.org][3], Github或者 [http://www.vimawesome.com][4] 获取新的脚本或插件。同时记得使用为你的插件提供的帮助。 + +和你最爱的编辑器一起嗨起来吧! + +-------------------------------------------------------------------------------- + +via: http://xmodulo.com/manage-vim-plugins.html + +作者:[Christopher Valerio][a] +译者:[XLCYun(袖里藏云)](https://github.com/XLCYun) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://xmodulo.com/author/valerio +[1]:https://github.com/VundleVim/Vundle.vim +[2]:http://ask.xmodulo.com/install-git-linux.html +[3]:http://www.vim-scripts.org/ +[4]:http://www.vimawesome.com/ + diff --git a/translated/tech/20150713 How to manage Vim plugins.md b/translated/tech/20150713 How to manage Vim plugins.md deleted file mode 100644 index c575d426e3..0000000000 --- a/translated/tech/20150713 How to manage Vim plugins.md +++ /dev/null @@ -1,149 +0,0 @@ - -如何管理Vim插件 -================================================================================ - - - - Vim是Linux上一个轻量级的通用文本编辑器。虽然它开始时的学习曲线对于一般的Linux用户来说可能很困难,但比起它的好处,这些付出完全是值得的。随着功能的增长,在插件工具的应用下,Vim是完全可定制的。但是,由于它高级的功能配置,你需要花一些时间去了解它的插件系统,然后才能够有效地去个性化定置Vim。幸运的是,我们已经有一些工具能够使我们在使用Vim插件时更加轻松。而我日常所使用的就是Vundle. -### 什么是Vundle ### - - [Vundle][1]是一个vim插件管理器,用于支持Vim包。Vundle能让你很简单地实现插件的安装,升级,搜索或者清除。它还能管理你的运行环境并且在标签方面提供帮助。 -### 安装Vundle ### - - 首先,如果你的Linux系统上没有Git的话,先[安装Git][2]. - - 接着,创建一个目录,Vim的插件将会被下载并且安装在这个目录上。默认情况下,这个目录为~/.vim/bundle。 - - $ mkdir -p ~/.vim/bundle - - 现在,安装Vundle如下。注意Vundle本身也是一个vim插件。因此我们同样把vundle安装到之前创建的目录~/.vim/bundle下。 - - $ git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim - -### 配置Vundle ### - - 现在配置你的.vimrc文件如下: - - set nocompatible " This is required - " 这是被要求的。(译注:中文注释为译者所加,下同。) - filetype off " This is required - " 这是被要求的。 - - " Here you set up the runtime path  - " 在这里设置你的运行时环境的路径。 - set rtp+=~/.vim/bundle/Vundle.vim - - " Initialize vundle  - " 初始化vundle - call vundle#begin() - - " This should always be the first  - " 这一行应该永远放在前面。 - Plugin 'gmarik/Vundle.vim' - - " This examples are from https://github.com/gmarik/Vundle.vim README - " 这个示范来自https://github.com/gmarik/Vundle.vim README - Plugin 'tpope/vim-fugitive' - - " Plugin from http://vim-scripts.org/vim/scripts.html - " 取自http://vim-scripts.org/vim/scripts.html的插件 - Plugin 'L9' - - " Git plugin not hosted on GitHub - " Git插件,但并不在GitHub上。 - Plugin 'git://git.wincent.com/command-t.git' - - "git repos on your local machine (i.e. when working on your own plugin) - "本地计算机上的Git仓库路径 (例如,当你在开发你自己的插件时) - Plugin 'file:///home/gmarik/path/to/plugin' - - " The sparkup vim script is in a subdirectory of this repo called vim. - " Pass the path to set the runtimepath properly. - " vim脚本sparkup存放在这个名叫vim的仓库下的一个子目录中。 - " 提交这个路径来正确地设置运行时路径 - Plugin 'rstacruz/sparkup', {'rtp': 'vim/'} - - " Avoid a name conflict with L9 - " 避免与L9发生名字上的冲突 - Plugin 'user/L9', {'name': 'newL9'} - - "Every Plugin should be before this line - "所有的插件都应该在这一行之前。 - call vundle#end() " required 被要求的 - - 容我简单解释一下上面的设置:默认情况下,Vundle将从github.com或者vim-scripts.org下载和安装vim插件。你也可以改变这个默认行为。 - - 要从github安装(安装插件,译者注,下同): - Plugin 'user/plugin' - - 要从http://vim-scripts.org/vim/scripts.html处安装: - Plugin 'plugin_name' - - 要从另外一个git仓库中安装: - - Plugin 'git://git.another_repo.com/plugin' - - 从本地文件中安装: - - Plugin 'file:///home/user/path/to/plugin' - - - 你同样可以定制其它东西,例如你的插件运行时路径,当你自己在编写一个插件时,或者你只是想从其它目录——而不是~/.vim——中加载插件时,这样做就非常有用。 - - Plugin 'rstacruz/sparkup', {'rtp': 'another_vim_path/'} - - 如果你有同名的插件,你可以重命名你的插件,这样它们就不会发生冲突了。 - - Plugin 'user/plugin', {'name': 'newPlugin'} - -### 使用Vum命令 ### - 一旦你用vundle设置好你的插件,你就可以通过几个vundle命令来安装,升级,搜索插件,或者清除没有用的插件。 - -#### 安装一个新的插件 #### - - 所有列在你的.vimrc文件中的插件,都会被PluginInstall命令安装。你也可以通递一个插件名给它,来安装某个的特定插件。 - :PluginInstall - :PluginInstall <插件名> - - ![](https://farm1.staticflickr.com/559/18998707843_438cd55463_c.jpg) - -#### 清除没有用的插件 #### - - 如果你有任何没有用到的插件,你可以通过PluginClean命令来删除它. - :PluginClean - - ![](https://farm4.staticflickr.com/3814/19433047689_17d9822af6_c.jpg) - -#### 查找一个插件 #### - - 如果你想从提供的插件清单中安装一个插件,搜索功能会很有用 - :PluginSearch <文本> - - ![](https://farm1.staticflickr.com/541/19593459846_75b003443d_c.jpg) - - - 在搜索的时候,你可以在交互式分割窗口中安装,清除,重新搜索或者重新加载插件清单.安装后的插件不会自动加载生效,要使其加载生效,可以将它们添加进你的.vimrc文件中. -### 总结 ### - - Vim是一个妙不可言的工具.它不单单是一个能够使你的工作更加顺畅高效的默认文本编辑器,同时它还能够摇身一变,成为现存的几乎任何一门编程语言的IDE. - - 注意,有一些网站能帮你找到适合的vim插件.猛击[http://www.vim-scripts.org][3], Github或者 [http://www.vimawesome.com][4] 获取新的脚本或插件.同时记得为你的插件使用帮助供应程序. - - 和你最爱的编辑器一起嗨起来吧! - - -------------------------------------------------------------------------------- - - via: http://xmodulo.com/manage-vim-plugins.html - - 作者:[Christopher Valerio][a] - 译者:[XLCYun(袖里藏云)](https://github.com/XLCYun) - 校对:[校对者ID](https://github.com/校对者ID) - - 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - - [a]:http://xmodulo.com/author/valerio - [1]:https://github.com/VundleVim/Vundle.vim - [2]:http://ask.xmodulo.com/install-git-linux.html - [3]:http://www.vim-scripts.org/ - [4]:http://www.vimawesome.com/ - From 4a754db1fbabed34a794afa6c829e15e8f412e2e Mon Sep 17 00:00:00 2001 From: Jindong Huang Date: Fri, 24 Jul 2015 16:12:41 +0800 Subject: [PATCH 689/965] Update 20150515 Install Plex Media Server On Ubuntu or CentOS 7.1 or Fedora 22.md --- ... Plex Media Server On Ubuntu or CentOS 7.1 or Fedora 22.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150515 Install Plex Media Server On Ubuntu or CentOS 7.1 or Fedora 22.md b/sources/tech/20150515 Install Plex Media Server On Ubuntu or CentOS 7.1 or Fedora 22.md index 837a7a2e73..1567211cd5 100644 --- a/sources/tech/20150515 Install Plex Media Server On Ubuntu or CentOS 7.1 or Fedora 22.md +++ b/sources/tech/20150515 Install Plex Media Server On Ubuntu or CentOS 7.1 or Fedora 22.md @@ -1,3 +1,5 @@ +Translating by dingdongnigetou + Install Plex Media Server On Ubuntu / CentOS 7.1 / Fedora 22 ================================================================================ In this article we will show you how easily you can setup Plex Home Media Server on major Linux distributions with their latest releases. After its successful installation of Plex you will be able to use your centralized home media playback system that streams its media to many Plex player Apps and the Plex Home will allows you to setup your environment by adding your devices and to setup a group of users that all can use Plex Together. So let’s start its installation first on Ubuntu 15.04. @@ -188,4 +190,4 @@ via: http://linoxide.com/tools/install-plex-media-server-ubuntu-centos-7-1-fedor 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 -[a]:http://linoxide.com/author/kashifs/ \ No newline at end of file +[a]:http://linoxide.com/author/kashifs/ From 079f5a5e043eaea37c76e3dea2fba64740226f20 Mon Sep 17 00:00:00 2001 From: alim0x Date: Fri, 24 Jul 2015 18:32:17 +0800 Subject: [PATCH 690/965] [Part Two]17 - The history of Android --- .../17 - The history of Android.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sources/talk/The history of Android/17 - The history of Android.md b/sources/talk/The history of Android/17 - The history of Android.md index 397d4c3184..591e766217 100644 --- a/sources/talk/The history of Android/17 - The history of Android.md +++ b/sources/talk/The history of Android/17 - The history of Android.md @@ -10,16 +10,16 @@ Ron Amadeo 供图 第二张蜂巢截图展示的是新通知中心。姜饼中的灰色和黑色设计已经被抛弃了,现在是黑色面板带蓝色光晕。上面一块显示着日期时间,连接状态,电量和打开快速设置的按钮,下面是实际的通知。非持续性通知现在可以通过通知右侧的“X”来关闭。蜂巢是第一个支持通知内控制的版本。第一个(也是蜂巢发布时唯一一个)利用了此特性的应用是新的谷歌音乐,在它的通知上有上一曲,播放/暂停,下一曲按钮。这些控制可以在任何应用中访问到,这让控制音乐播放变成了一件轻而易举的事情。 -!["Add to home screen" was given a zoomed-out interface for easy organizing. The search interface split auto suggest and universal search into different panes.](http://cdn.arstechnica.net/wp-content/uploads/2014/02/widgetkeyboard.png) -"Add to home screen" was given a zoomed-out interface for easy organizing. The search interface split auto suggest and universal search into different panes. +![“添加到主屏幕”的缩小视图更易于组织布局。搜索界面将自动搜索建议和通用搜索分为两个面板显示。](http://cdn.arstechnica.net/wp-content/uploads/2014/02/widgetkeyboard.png) +“添加到主屏幕”的缩小视图更易于组织布局。搜索界面将自动搜索建议和通用搜索分为两个面板显示。 Ron Amadeo 供图 -Pressing the plus button in the top right corner of the home screen or long pressing on the background would open the new home screen configuration interface. Honeycomb showed a zoomed-out view of all the home screens along the top of the screen, and it filled the bottom half of the screen with a tabbed drawer containing widgets and shortcuts. Items could be dragged out of the bottom drawer and into any of the five home screens. Gingerbread would just show a list of text, but Honeycomb showed full thumbnail previews of the widgets. This gave you a much better idea of what a widget would look like instead of an app-name-only description like "calendar." +点击主屏幕右上角的加号或长按背景空白处就会打开新的主屏幕设置界面。蜂巢会在屏幕上半部分显示所有主屏的缩小视图,下半部分分页显示的是小部件和快捷方式。小部件或快捷方式可以从下半部分的抽屉中拖动到五个主屏幕中的任意一个上。姜饼只会显示一个文本列表,而蜂巢会显示小部件完整的略缩图预览。这让你更清楚一个小部件是什么样子的,而不是像原来的“日历”一样只是一个只有应用名称的描述。 -The larger screen of the Motorola Xoom allowed the keyboard to take on a more PC-style layout, with keys like backspace, enter, shift, and tab put in the traditional locations. The keyboard took on a blueish tint and gained even more spacing between the keys. Google also added a dedicated smiley-face button. :-) +摩托罗拉 Xoom 更大的屏幕让键盘的布局更加接近 PC 风格,退格,回车,shift 以及 tab 都在传统的位置上。键盘带有浅蓝色,并且键与键之间的空间更大了。谷歌还添加了一个专门的笑脸按钮。 :-) -![Gmail on Honeycomb versus Gmail on Gingerbread with the menu open. Buttons were placed on the main screen for easier discovery.](http://cdn.arstechnica.net/wp-content/uploads/2014/02/thebasics.png) -Gmail on Honeycomb versus Gmail on Gingerbread with the menu open. Buttons were placed on the main screen for easier discovery. +![打开菜单的 Gmail 在蜂巢和姜饼上的效果。按钮布置在首屏更容易被发现。](http://cdn.arstechnica.net/wp-content/uploads/2014/02/thebasics.png) +打开菜单的 Gmail 在蜂巢和姜饼上的效果。按钮布置在首屏更容易被发现。 Ron Amadeo 供图 Gmail demonstrated all the new UI concepts in Honeycomb. Android 3.0 did away with hiding all the controls behind a menu button. There was now a strip of icons along the top of the screen called the Action Bar, which lifted many useful controls to the main screen where users could see them. Gmail showed buttons for search, compose, and refresh, and it put less useful controls like settings, help, and feedback in a dropdown called the "overflow" button. Tapping checkboxes or selecting text would cause the entire action bar to change to icons relating to those actions—for instance, selecting text would bring up cut, copy, and select all buttons. From b8b64c4d20be9545c8a7ad5c223e08086778de50 Mon Sep 17 00:00:00 2001 From: alim0x Date: Fri, 24 Jul 2015 23:15:54 +0800 Subject: [PATCH 691/965] [Part Three]17 - The history of Android --- .../17 - The history of Android.md | 48 +++++++++---------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/sources/talk/The history of Android/17 - The history of Android.md b/sources/talk/The history of Android/17 - The history of Android.md index 591e766217..bf86735b7c 100644 --- a/sources/talk/The history of Android/17 - The history of Android.md +++ b/sources/talk/The history of Android/17 - The history of Android.md @@ -22,55 +22,55 @@ Ron Amadeo 供图 打开菜单的 Gmail 在蜂巢和姜饼上的效果。按钮布置在首屏更容易被发现。 Ron Amadeo 供图 -Gmail demonstrated all the new UI concepts in Honeycomb. Android 3.0 did away with hiding all the controls behind a menu button. There was now a strip of icons along the top of the screen called the Action Bar, which lifted many useful controls to the main screen where users could see them. Gmail showed buttons for search, compose, and refresh, and it put less useful controls like settings, help, and feedback in a dropdown called the "overflow" button. Tapping checkboxes or selecting text would cause the entire action bar to change to icons relating to those actions—for instance, selecting text would bring up cut, copy, and select all buttons. +Gmail 示范了蜂巢所有的用户界面概念。安卓 3.0不再把所有控制都隐藏在菜单按钮之后。屏幕的顶部现在有一条带有图标的条带,叫做 Action Bar(操作栏),它将许多常用的控制选项提升到了主屏幕上,用户直接就能看到它们。Gmail 的操作栏显示着搜索,新邮件,刷新按钮,不常用的选项比如设置,帮助,以及反馈放在了“更多”按钮中。点击复选框或选中文本的时候时整个操作栏的图标会变成和操作相关的——举个例子,选择文本会出现复制,粘贴和全选按钮。 -The app icon displayed in the top left corner doubled as a navigation button called "Up." While "Back" worked similarly to a browser back button, navigating to previously visited screens, "Up" would navigate up the app hierarchy. For instance, if you were in the Android Market, pressed the "Email developer" button, and Gmail opened, "Back" would take you back to the Android Market, but "Up" would take you to the Gmail inbox. "Back" might close the current app, but "Up" never would. Apps could control the "Back" button, and they usually reprogrammed it to replicate the "Up" functionality. In practice, there was rarely a difference between the two buttons. +应用左上角显示的图标同时也作为称作“上一级”的导航按钮。“后退”的作用类似浏览器的后退按钮,导航到之前访问的页面,“上一级”则会导航至应用的上一层次。举例来说,如果你在安卓市场,点击“给开发者发邮件”,会打开 Gmail,“后退”会让你返回安卓市场,但是“上一级”会带你到 Gmail 的收件箱。“后退”可能会关闭当前应用,而“上一级”永远不会。应用可以控制“后退”按钮,它们往往重新定义它为“上一级”的功能。事实上,这两个按钮之间几乎没什么不同。 -Honeycomb also introduced the "Fragments" API, which allowed developers to use a single app for tablets and phones. A "Fragment" was a single pane of a user interface. In the Gmail picture above, the left folder list was one fragment and the inbox was another fragment. Phones would show one fragment per screen, and tablets could show two side-by-side. The developer defined the look of individual fragments, and Android would decide how they should be displayed based on the current device. +蜂巢还引入了 “Fragments” API,允许开发者开发同时适用于平板和手机的应用。一个 “Fragments”(格子) 是一个用户界面的面板。在上图的 Gmail 中,左边的文件夹列表是一个格子,收件箱是另一个格子。手机每屏显示一个格子,而平板则可以并列显示两个。开发者可以自行定义单独每个格子的外观,安卓会根据当前的设备决定如何显示它们。 -![The calculator finally used regular Android buttons, but someone spilled blue ink on the calendar.](http://cdn.arstechnica.net/wp-content/uploads/2014/02/calculendar.png) -The calculator finally used regular Android buttons, but someone spilled blue ink on the calendar. +![计算器使用了常规的安卓按钮,但日历看起来像是被谁打翻了蓝墨水。](http://cdn.arstechnica.net/wp-content/uploads/2014/02/calculendar.png) +计算器使用了常规的安卓按钮,但日历看起来像是被谁打翻了蓝墨水。 Ron Amadeo 供图 -For the first time in Android's history, the calculator got a makeover with non-custom buttons, so it actually looked like part of the OS. The bigger screen made room for more buttons, enough that all the calculator functionality could fit on one screen. The calendar greatly benefited from the extra space, gaining much more room for appointment text and controls. The action bar at the top of the screen held buttons to switch views, along with showing the current time span and common controls. Appointment blocks switched to a white background with the calendar corner only showing in the top right corner. At the bottom (or side, in horizontal view) were boxes showing the month calendar and a list of displayed calendars. +这是安卓历史上第一次计算器换上了没有特别定制的按钮,所以它看起来确实是系统的一部分。更大的屏幕有了更多空间容纳按钮,足够将计算器基本功能容纳在一个屏幕上。日历极大地受益于额外的显示空间,有了更多的空间显示事件文本和控制选项。顶部的操作栏有切换视图的按钮,显示当前时间跨度,以及常规按钮。事件块变成了白色背景,日历标识只在左上角显示。在底部(或横屏模式的侧边)显示的是月历和显示的日历列表。 -The scale of the calendar could be adjusted, too. By performing a pinch zoom gesture, portrait week and day views could show between five and 19 hours of appointments on a single screen. The background of the calendar was made up of an uneven blue splotch, which didn't look particularly great and was tossed on later versions. +日历的比例同样可以调整。通过两指缩放手势,纵向的周和日视图能够在一屏内显示五到十九小时的事件。日历的背景由不均匀的蓝色斑点组成,看起来不是特别棒,在随后的版本里就被抛弃了。 -![The new camera interface, showing off the live "Negative" effect.](http://cdn.arstechnica.net/wp-content/uploads/2014/02/camera.png) -The new camera interface, showing off the live "Negative" effect. +![新相机界面,取景器显示的是“负片”效果。](http://cdn.arstechnica.net/wp-content/uploads/2014/02/camera.png) +新相机界面,取景器显示的是“负片”效果。 Ron Amadeo 供图 -The giant 10-inch Xoom tablet did have a camera, which meant that it also had a camera app. The Tron redesign finally got rid of the old faux-leather look that Google came up with in Android 1.6. The controls were laid out in a circle around the shutter button, bringing to mind the circular controls and dials on a real camera. The Cooliris-derived speech bubble popups were changed to glowing, semi-transparent black boxes. The Honeycomb screenshot shows the new "color effect" functionality, which applied a filter to the viewfinder in real time. Unlike the Gingerbread camera app, this didn't support a portrait orientation—it was limited to landscape only. Taking a portrait picture with a 10-inch tablet doesn't make much sense, but then neither does taking a landscape one. +巨大的10英寸 Xoom 平板有个摄像头,这意味着它同样有个相机应用。电子风格的重新设计终于甩掉了谷歌从安卓 1.6 以来使用的仿皮革外观。控制选项以环形排布在快门键周围,让人想起真正的相机上的圆形控制转盘。Cooliris 衍生的弹出对话气泡变成了带光晕的半透明黑色选框。蜂巢的截图显示的是新的“颜色效果”功能,它能给取景器实时加上滤镜效果。不像姜饼的相机应用,它不支持竖屏模式——它被限制在横屏状态。用10英寸的平板拍摄纵向照片没多大意义,但拍摄横向照片也没多大意义。 -![The clock app didn't get quite as much love as other areas. Google just threw it into a tiny box and called it a day.](http://cdn.arstechnica.net/wp-content/uploads/2014/02/clocks.png) -The clock app didn't get quite as much love as other areas. Google just threw it into a tiny box and called it a day. +![时钟应用相比其它地方没受到多少关照。谷歌把它扔进一个小盒子里然后就收工了。](http://cdn.arstechnica.net/wp-content/uploads/2014/02/clocks.png) +时钟应用相比其它地方没受到多少关照。谷歌把它扔进一个小盒子里然后就收工了。 Ron Amadeo 供图 -Tons of functionality went out the door when it came time to remake the clock app. The entire "Deskclock" concept was kicked out the door, replaced with a simple large display of the time against a plain black background. The ability to launch other apps and view the weather was gone, as was the ability of the clock app to use your wallpaper. Google sometimes gave up when it came time to design a tablet-sized interface, like here, where it just threw the alarm interface into a tiny, centered dialog box. +无数功能已经成形了,现在是时候来重制一下时钟了。整个“桌面时钟”概念被踢出门外,取而代之的是在纯黑背景上显示的简单又巨大的时间数字。打开其它应用查看天气的功能不见了,随之而去的还有显示你的壁纸的功能。当要设计平板尺寸的界面时,有时候谷歌就放弃了,就像这里,就只是把时钟界面扔到了一个小小的,居中的对话框里。 -![The Music app finally got the ground-up redesign it has needed forever.](http://cdn.arstechnica.net/wp-content/uploads/2014/02/muzack.png) -The Music app finally got the ground-up redesign it has needed forever. +![音乐应用终于得到了一直以来都需要的完全重新设计。](http://cdn.arstechnica.net/wp-content/uploads/2014/02/muzack.png) +音乐应用终于得到了一直以来都需要的完全重新设计。 Ron Amadeo 供图 -While music received a few minor additions during its life, this was really the first time since Android 0.9 that it received serious attention. The highlight of the redesign was a don't-call-it-coverflow scrolling 3D album art view, called "New and Recent." Instead of the tabs added in Android 2.1, navigation was handled by a Dropbox box in the Action Bar. While "New and Recent" had 3D scrolling album art, "Albums" used a flat grid of albums thumbnails. The other sections had totally different designs, too. "Songs" used a vertically scrolling list of text, and "Playlists," "Genres," and "Artists" used stacked album art. +尽管音乐应用之前有得到一些小的加强,但这是自安卓 0.9 以来它第一次受到正视。重新设计的亮点是一个“别叫它封面流滚动 3D 专辑封面视图”,称作“最新和最近”。导航由操作栏的下拉框解决,取代了安卓 2.1 引入的标签页导航。尽管“最新和最近”有个 3D 滚动专辑封面,“专辑”使用的是专辑略缩图的平面方阵。另一个部分也有个完全不同的设计。“歌曲”使用了垂直滚动的文本列表,“播放列表”,“年代”和“艺术家”用的是堆砌专辑显示。 -In nearly every view, every single item had its own individual menu, usually little arrows in the bottom right corner of an item. For now, these would only show "Play" and "add to Playlist," but this version of Google Music was built for the future. Google was launching a Music service soon, and those individual menus would be needed for things like viewing other content from that artist in the Music Store and managing the cloud storage versus local storage options. +在几乎每个视图中,每个单独的项目有它自己单独的菜单,通常在每项的右下角有个小箭头。眼下这里只会显示“播放”和“添加到播放列表”,但这个版本的谷歌音乐是为未来搭建的。谷歌不久后就要发布音乐服务,这些独立菜单在像是在音乐商店里浏览该艺术家的其它内容,或是管理云存储和本地存储时将会是不可或缺的。 -Just like the Cooliris Gallery in Android 2.1, Google Music would blow up one of your thumbnails and use it as a background. The bottom "Now Playing" bar now displayed the album art, playback controls, and a song progress bar. +正如安卓 2.1 中的 Cooliris 风格的相册,谷歌音乐会将略缩图放大作为背景图片。底部的“正在播放”栏现在显示着专辑封面,播放控制,以及播放进度条。 -![Some of the new Google Maps was really nice, and some of it was from Android 1.5.](http://cdn.arstechnica.net/wp-content/uploads/2014/02/maps.png) -Some of the new Google Maps was really nice, and some of it was from Android 1.5. +![新谷歌地图的一些地方真的很棒,一些却是从安卓 1.5 来的。](http://cdn.arstechnica.net/wp-content/uploads/2014/02/maps.png) +新谷歌地图的一些地方真的很棒,一些却是从安卓 1.5 来的。 Ron Amadeo 供图 -Google Maps received another redesign for the big screen. This one would stick around for a while and used a semi-transparent black action bar for all the controls. Search was again the primary function, given the first spot in the action bar, but this time it was an actual search bar you could type in, instead of a search bar-shaped button that launched a completely different interface. Google finally gave up on dedicating screen space to actual zoom buttons, relying on only gestures to control the map view. While the feature has since been ported to all old versions of Maps, Honeycomb was the first version to feature 3D building outlines on the map. Dragging two fingers down on the map would "tilt" the map view and show the sides of the buildings. You could freely rotate and the buildings would adjust, too. +谷歌地图也为大屏幕进行了重新设计。这个设计将会持续一段时间,它对所有的控制选项用了一个半透明的黑色操作栏。搜索再次成为主要功能,占据了操作栏显要位置,但这回可是真的搜索栏,你可以在里面输入关键字,不像以前那个搜索栏形状的按钮会打开完全不同的界面。谷歌最终还是放弃了给缩放控件留屏幕空间,仅仅依靠手势来控制地图显示。尽管 3D 建筑轮廓这个特性已经被移植到了旧版本的地图中,蜂巢依然是拥有这个特性的第一个版本。双指在地图上向下拖放会“倾斜”地图的视角,展示建筑的侧面。你可以随意旋转,建筑同样会跟着进行调整。 -Not every part of Maps was redesigned. Navigation was untouched from Gingerbread, and some core parts of the interface, like directions, were pulled straight from Android 1.6 and centered in a tiny box. +并不是所有部分都进行了重新设计。导航自姜饼以来就没动过,还有些界面的核心部分,像是路线,直接从安卓 1.6 的设计拿出来,放到一个小盒子里居中放置,仅此而已。 ---------- ![Ron Amadeo](http://cdn.arstechnica.net/wp-content//uploads/authors/ron-amadeo-sq.jpg) -[Ron Amadeo][a] / Ron is the Reviews Editor at Ars Technica, where he specializes in Android OS and Google products. He is always on the hunt for a new gadget and loves to rip things apart to see how they work. +[Ron Amadeo][a] / Ron是Ars Technica的评论编缉,专注于安卓系统和谷歌产品。他总是在追寻新鲜事物,还喜欢拆解事物看看它们到底是怎么运作的。 [@RonAmadeo][t] @@ -78,7 +78,7 @@ Not every part of Maps was redesigned. Navigation was untouched from Gingerbread via: http://arstechnica.com/gadgets/2014/06/building-android-a-40000-word-history-of-googles-mobile-os/17/ -译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID) +译者:[alim0x](https://github.com/alim0x) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 From 302c26094ba3b2c27566762abb4b3470d725d62e Mon Sep 17 00:00:00 2001 From: alim0x Date: Fri, 24 Jul 2015 23:29:41 +0800 Subject: [PATCH 692/965] [complete]17 - The history of Android & [translating]18 --- .../The history of Android/18 - The history of Android.md | 4 +++- .../The history of Android/17 - The history of Android.md | 0 2 files changed, 3 insertions(+), 1 deletion(-) rename {sources => translated}/talk/The history of Android/17 - The history of Android.md (100%) diff --git a/sources/talk/The history of Android/18 - The history of Android.md b/sources/talk/The history of Android/18 - The history of Android.md index 2b795adba1..8b303033bc 100644 --- a/sources/talk/The history of Android/18 - The history of Android.md +++ b/sources/talk/The history of Android/18 - The history of Android.md @@ -1,3 +1,5 @@ +alim0x translating + The history of Android ================================================================================ ![Yet another Android Market redesign dips its toe into the "cards" interface that would become a Google staple.](http://cdn.arstechnica.net/wp-content/uploads/2014/02/play-store.png) @@ -80,4 +82,4 @@ via: http://arstechnica.com/gadgets/2014/06/building-android-a-40000-word-histor [1]:http://techcrunch.com/2014/03/03/gartner-195m-tablets-sold-in-2013-android-grabs-top-spot-from-ipad-with-62-share/ [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/talk/The history of Android/17 - The history of Android.md b/translated/talk/The history of Android/17 - The history of Android.md similarity index 100% rename from sources/talk/The history of Android/17 - The history of Android.md rename to translated/talk/The history of Android/17 - The history of Android.md From 4233e1ec3800567b389961c0a29d1e7420d025aa Mon Sep 17 00:00:00 2001 From: GOLinux Date: Sat, 25 Jul 2015 08:47:10 +0800 Subject: [PATCH 693/965] [Translated]20150722 How To Fix 'The Update Information Is Outdated' In Ubuntu 14.04.md --- ...nformation Is Outdated' In Ubuntu 14.04.md | 59 ------------------- ...nformation Is Outdated' In Ubuntu 14.04.md | 59 +++++++++++++++++++ 2 files changed, 59 insertions(+), 59 deletions(-) delete mode 100644 sources/tech/20150722 How To Fix 'The Update Information Is Outdated' In Ubuntu 14.04.md create mode 100644 translated/tech/20150722 How To Fix 'The Update Information Is Outdated' In Ubuntu 14.04.md diff --git a/sources/tech/20150722 How To Fix 'The Update Information Is Outdated' In Ubuntu 14.04.md b/sources/tech/20150722 How To Fix 'The Update Information Is Outdated' In Ubuntu 14.04.md deleted file mode 100644 index b7b95c43b1..0000000000 --- a/sources/tech/20150722 How To Fix 'The Update Information Is Outdated' In Ubuntu 14.04.md +++ /dev/null @@ -1,59 +0,0 @@ -Translating by GOLinux! -How To Fix “The Update Information Is Outdated” In Ubuntu 14.04 -================================================================================ -![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/Fix_update_information_is_outdated.jpeg) - -Seeing a red triangle in top panel in Ubuntu 14.04 that displays the following error? - -> The update information is outdated. This may be caused by network problems or by a repository that is no longer available. Please update manually by selecting ‘Show updates’ from indicator menu, and watching for any failing repositories. - -It looks something like this: - -![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/Update_error_Ubuntu.jpeg) - -Instead of red triangle, there is a pink exclamation sign because I am using one of the [best Ubuntu icon themes][1], Numix. Coming back to the error, this is a common update problem which you might see every now and then. Now you might be wondering what is causing this update error. - -### Reason for ‘update information is outdated’ error ### - -The reason is pretty explanatory in the error description itself. It reads “this may be caused by network problems or by a repository that is no longer available”. So, either you upgraded your system and some repository or PPA is no longer supported or you are facing some similar issue. - -While the error is self-explanatory, the action it suggests, “Please update manually by selecting ‘Show updates’ from the indicator menu, and watching for any failing repositories.”, doesn’t work properly. If you click on Show updates, all you’ll see is that the system is already updated. - -![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/System_updated_Ubuntu.png) - -Weird isn’t it? How will we find out what is failing where and why? - -### Fix ‘update information is outdated’ ### - -The ‘solution’ discussed here will work for Ubuntu versions be it Ubuntu 14.04, 12.04 or 14.04. All you need to do is to open a terminal (Ctrl+Alt+T) and use the following command: - - sudo apt-get update - -Wait for the command to finish and look at the result. Quick tip to add here, you can [add notifications in terminal][2] so that you are notified as soon as a long command finishes execution. In the last few lines at the end of the command, see what kind of error your system is facing. Yes, you’ll see an error for sure. - -In my case, I saw the famous [GPG error: The following could not be verified][3] error. Apparently there is some problem with [Spotify installation in Ubuntu 15.04][4]. - -![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/Update_error_Ubuntu_1.jpeg) - -It is very much possible that you might see a different error instead of the GPG error like me. In that case, I suggest you to go through this article which I wrote to [fix various common update errors in Ubuntu][5]. - -I know few people, specially beginners have strong aversion to command line but if you are using Linux, you simply cannot avoid terminal. Moreover, it is not that scary a thing. Give it a try, you will feel accustomed to it soon enough. - -I hope this quick tip helped you to fix the recurring “update information is outdated” in Ubuntu. Any questions or suggestions is welcomed. - --------------------------------------------------------------------------------- - -via: http://itsfoss.com/fix-update-information-outdated-ubuntu/ - -作者:[Abhishek][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://itsfoss.com/author/abhishek/ -[1]:http://itsfoss.com/best-icon-themes-ubuntu-1404/ -[2]:http://itsfoss.com/notification-terminal-command-completion-ubuntu/ -[3]:http://itsfoss.com/solve-gpg-error-signatures-verified-ubuntu/ -[4]:http://itsfoss.com/install-spotify-ubuntu-1504/ -[5]:http://itsfoss.com/fix-update-errors-ubuntu-1404/ diff --git a/translated/tech/20150722 How To Fix 'The Update Information Is Outdated' In Ubuntu 14.04.md b/translated/tech/20150722 How To Fix 'The Update Information Is Outdated' In Ubuntu 14.04.md new file mode 100644 index 0000000000..cebfab93c4 --- /dev/null +++ b/translated/tech/20150722 How To Fix 'The Update Information Is Outdated' In Ubuntu 14.04.md @@ -0,0 +1,59 @@ +Ubuntu 14.04中修复“update information is outdated”错误 +================================================================================ +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/Fix_update_information_is_outdated.jpeg) + +看到Ubuntu 14.04的顶部面板上那个显示下面这个错误的红色三角形了吗? + +> 更新信息过时。该错误可能是由网络问题,或者某个仓库不再可用而造成的。请通过从指示器菜单中选择‘显示更新’来手动更新,然后查看是否存在有失败的仓库。 +> + +它看起来像这样: + +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/Update_error_Ubuntu.jpeg) + +这里的粉红色感叹号标记就是原来的红色三角形,因为我使用了[最佳的Ubuntu图标主题][1]之一,Numix。让我们回到该错误中,这是一个常见的更新问题,你也许时不时地会碰到它。现在,你或许想知道的是,到底是什么导致了这个更新错误的出现。 + +### 引起‘update information is outdated’错误的原因 ### + +导致该错误的原因在其自身的错误描述中就讲得相当明白,它告诉你“这可能是由网络问题或者某个不再可用的仓库导致的”。所以,要么是你更新了系统和某些仓库,要么是PPA不再受到支持了,或者你正面对的类似问题。 + +虽然错误本身就讲得很明白,而它给出了的议操作“请通过从指示器菜单选择‘显示更新’来手动更新以查看失败的仓库”却并不能很好地解决问题。如果你点击显示更新,你所能看见的仅仅是系统已经更新。 + +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/System_updated_Ubuntu.png) + +很奇怪,不是吗?我们怎样才能找出是什么出错了,哪里出错了,以及为什么出错呢? + +### 修复‘update information is outdated’错误 ### + +这里讨论的‘解决方案’可能对Ubuntu的这些版本有用:Ubuntu 14.04,12.04或14.04。你所要做的仅仅是打开终端(Ctrl+Alt+T),然后使用下面的命令: + + sudo apt-get update + +等待命令结束,然后查看其结果。这里插个快速提示,你可以[在终端中添加通知][2],这样当一个耗时很长的命令结束执行时就会通知你。在该命令的最后几行中,可以看到你的系统正面临什么样的错误。是的,你肯定会看到一个错误。 + +在我这里,我看到了有名的[GPG error: The following could not be verified][3]错误。很明显,[在Ubuntu 15.04中安装声破天][4]有点问题。 + +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/Update_error_Ubuntu_1.jpeg) + +很可能你看到的不是像我一样的GPG错误,那样的话,我建议你读一读我写的这篇文章[修复Ubuntu中的各种常见更新错误][5]。 + +我知道有不少人,尤其是初学者,很是讨厌命令行,但是如果你正在使用Linux,你就无可避免会使用到终端。此外,那东西并没你想象的那么可怕。试试吧,你会很快上手的。 + +我希望这个快速提示对于你修复Ubuntu中的“update information is outdated”错误有帮助。如果你有任何问题或建议,请不吝提出,我们将无任欢迎。 + +-------------------------------------------------------------------------------- + +via: http://itsfoss.com/fix-update-information-outdated-ubuntu/ + +作者:[Abhishek][a] +译者:[GOLinux](https://github.com/GOLinux) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://itsfoss.com/author/abhishek/ +[1]:http://itsfoss.com/best-icon-themes-ubuntu-1404/ +[2]:http://itsfoss.com/notification-terminal-command-completion-ubuntu/ +[3]:http://itsfoss.com/solve-gpg-error-signatures-verified-ubuntu/ +[4]:http://itsfoss.com/install-spotify-ubuntu-1504/ +[5]:http://itsfoss.com/fix-update-errors-ubuntu-1404/ From 872a3b3245a23f44fabf5c0a2b1ab3d372ab12aa Mon Sep 17 00:00:00 2001 From: ictlyh Date: Sat, 25 Jul 2015 10:10:23 +0800 Subject: [PATCH 694/965] [Translated] tech/20150722 Howto Interactively Perform Tasks with Docker using Kitematic.md --- ...rform Tasks with Docker using Kitematic.md | 67 ------------------- ...rform Tasks with Docker using Kitematic.md | 66 ++++++++++++++++++ 2 files changed, 66 insertions(+), 67 deletions(-) delete mode 100644 sources/tech/20150722 Howto Interactively Perform Tasks with Docker using Kitematic.md create mode 100644 translated/tech/20150722 Howto Interactively Perform Tasks with Docker using Kitematic.md diff --git a/sources/tech/20150722 Howto Interactively Perform Tasks with Docker using Kitematic.md b/sources/tech/20150722 Howto Interactively Perform Tasks with Docker using Kitematic.md deleted file mode 100644 index ca812ae944..0000000000 --- a/sources/tech/20150722 Howto Interactively Perform Tasks with Docker using Kitematic.md +++ /dev/null @@ -1,67 +0,0 @@ -Translating by ictlyh -Howto Interactively Perform Tasks with Docker using Kitematic -================================================================================ -In this article, we'll learn about the installating Kitematic in Windows Operating System and deploying a Hello World Nginx Web Server. Kitematic is a free and open source software which is a modern designed GUI software that allows us to interactively perform tasks with docker. Kitematic has a beautiful design and pretty good interface. It is pretty fast and easy to setup our containers out of the box without needing to enter commands for it, we can deploy our apps it in just a click with its GUI inteface. Kitematic has Docker Hub Intergration which allows us to search any required image, pull and deploy our apps with it. It also has a beautiful feature to switch to CUI mode simultaneously. Currently, it includes some features like automatically map ports, visually change environment variables, configuring volumes, streamline logs and many more. - -So. here are the easy 3 steps on how we can install Kitematic and deploy Hello World Nginx Web Server in Windows. - -### 1. Download Kitematic ### - -First of all, we'll need to download the latest release of Kitematic available for windows operating system from the github repository ie [https://github.com/kitematic/kitematic/releases][1] . Here, we download its executable EXE file using a download manager or a web browser. After we finish downloading, we'll need to double-click the executable application file. - -![Running Kitematic](http://blog.linoxide.com/wp-content/uploads/2015/06/running-kitematic.png) - -After double clicking the application file, we'll be asked by a security issue we'll simply click OK as shown below. - -![Security Warning](http://blog.linoxide.com/wp-content/uploads/2015/06/security-warning.png) - -### 2. Installing Kitematic ### - -After the executable installer has been downloaded, we'll now gonna install Kitematic in our Windows Operating System. The installer will now begin to download and install the necessary dependencies virtual box and docker to run Kitematic. If you already virtualbox installed in your system, it will upgrade it to the latest version. The installer should finish in few minutes but that depends on how fast your internet and system is. If you don't have a virtual box installed already, it may ask you for installing the virtual box network driver. It is suggested to install that as it is useful for the virtual box networking. - -![Installing Kitematic](http://blog.linoxide.com/wp-content/uploads/2015/06/installing-kitematic.png) - -After the required dependencies Docker and Virtual box are installed and are running, we'll be asked to login to the Docker Hub. If we don't have an account or don't wanna login now, we can click **SKIP FOR NOW** to continue further. - -![Login Docker Hub](http://blog.linoxide.com/wp-content/uploads/2015/06/login-docker-hub.jpg) - -If you don't have an account, you can simply click on Sign Up link in the App and create an account in Docker Hub. - -After its done, our first interface of Kitematic App will load. Here, below is how it looks. We can search for the available docker images there as shown below. - -![Kitematic App Launched](http://blog.linoxide.com/wp-content/uploads/2015/07/kitematic-app-launched.jpg) - -### 3. Deploying Nginx Hello World Container ### - -Now, as our Kitematic has been successfully installed, we'll now go for the deployment of containers. To run a container, we can simply search for the image in the search area. Then click on Create to deploy the container. Here in this tutorial, we'll go for deploying a small Nginx Web Server having Hello World homepage. To do so, we'll search for Hello World Nginx in the search area. Then, after we see the container information, we'll click on Create to deploy the container. - -![Hello World Nginx Run](http://blog.linoxide.com/wp-content/uploads/2015/06/hello-world-nginx-run.jpg) - -Once the download of the image has been completed, it will get deployed. We can see the logs of the commands fired by the Kitematic to deploy that container. We can also see the web page preview right from the Kitematic interface. Now, we can check our Hello World page from our web browser by clicking on the preview. - -![Nginx Hello World Browser](http://blog.linoxide.com/wp-content/uploads/2015/07/nginx-hello-world-browser.jpg) - -If we wanna switch to command line interface and manage docker with it, there is a button called Docker CLI which will open a Powershell were we can execute docker commands. - -![Docker CLI PowerShell](http://blog.linoxide.com/wp-content/uploads/2015/07/docker-cli-powershell.png) - -Now, if we wanna configure our container and perform stuffs like changing the container name, assigning environment variables, assign ports, configure container's storage and other advanced features, we can do that from Settings tab of the container. - -![Kitematic Container Settings](http://blog.linoxide.com/wp-content/uploads/2015/07/kitematic-container-settings.png) - -### Conclusion ### - -Finally we've successfully installed Kitematic and deployed a hello world nginx web server in Windows Operating System. It is always recommended to download and install the latest release of Kitematic as many advanced features are to be embedded. As docker works in 64 bit platform, Kitematic is also currently built for 64-bit platform of operating system. It only works on the Windows 7 and greater versions of Windows. Here, in this tutorial, we deployed an Nginx web server like wise we can deploy any docker container from its image using Kitematic with few clicks only. Kitematic is already available for Mac OS X and Windows whereas a version for Linux is still under development and will be out very soon. If you have any questions, suggestions, feedback please write them in the comment box below so that we can improve or update our contents. Thank you ! Enjoy :-) - --------------------------------------------------------------------------------- - -via: http://linoxide.com/linux-how-to/interactively-docker-kitematic/ - -作者:[Arun Pyasi][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://linoxide.com/author/arunp/ -[1]:https://github.com/kitematic/kitematic/releases \ No newline at end of file diff --git a/translated/tech/20150722 Howto Interactively Perform Tasks with Docker using Kitematic.md b/translated/tech/20150722 Howto Interactively Perform Tasks with Docker using Kitematic.md new file mode 100644 index 0000000000..8ad03dd06c --- /dev/null +++ b/translated/tech/20150722 Howto Interactively Perform Tasks with Docker using Kitematic.md @@ -0,0 +1,66 @@ +如何在 Docker 中通过 Kitematic 交互式执行任务 +================================================================================ +在本篇文章中,我们会学习如何在 Windows 操作系统上安装 Kitematic 以及部署一个 Hello World Nginx Web 服务器。Kitematic 是一个自由开源软件,它有现代化的界面设计使得允许我们在 Docker 中交互式执行任务。Kitematic 设计非常漂亮、界面也很不错。我们可以简单快速地开箱搭建我们的容器而不需要输入命令,我们可以在图形用户界面中通过简单的点击从而在容器上部署我们的应用。Kitematic 集成了 Docker Hub,允许我们搜索、拉取任何需要的镜像,并在上面部署应用。它同时也能很好地切换到命令行用户接口模式。目前,它包括了自动映射端口、可视化更改环境变量、配置卷、精简日志以及其它功能。 + +下面是在 Windows 上安装 Kitematic 并部署 Hello World Nginx Web 服务器的 3 个简单步骤。 + +### 1. 下载 Kitematic ### + +首先,我们需要从 github 仓库 [https://github.com/kitematic/kitematic/releases][1] 中下载 Windows 操作系统可用的最新的 Kitematic 发行版。我们用下载器或者 web 浏览器下载了它的可执行 EXE 文件。下载完成后,我们需要双击可执行应用文件。 + +![运行 Kitematic](http://blog.linoxide.com/wp-content/uploads/2015/06/running-kitematic.png) + +双击应用文件之后,会问我们一个安全问题,我们只需要点击 OK 按钮,如下图所示。 + +![安全警告](http://blog.linoxide.com/wp-content/uploads/2015/06/security-warning.png) + +### 2. 安装 Kitematic ### + +下载好可执行安装程序之后,我们现在打算在我们的 Windows 操作系统上安装 Kitematic。安装程序现在会开始下载并安装运行 Kitematic 需要的依赖,包括 Virtual Box 和 Docker。如果已经在系统上安装了 Virtual Box,它会把它升级到最新版本。安装程序会在几分钟内完成,但取决于你网络和系统的速度。如果你还没有安装 Virtual Box,它会问你是否安装 Virtual Box 网络驱动。建议安装它,因为它有助于 Virtual Box 的网络。 + +![安装 Kitematic](http://blog.linoxide.com/wp-content/uploads/2015/06/installing-kitematic.png) + +需要的依赖 Docker 和 Virtual Box 安装完成并运行后,会让我们登录到 Docker Hub。如果我们还没有账户或者还不想登录,可以点击 **SKIP FOR NOW** 继续后面的步骤。 + +![登录 Docker Hub](http://blog.linoxide.com/wp-content/uploads/2015/06/login-docker-hub.jpg) + +如果你还没有账户,你可以在应用程序上点击注册链接并在 Docker Hub 上创建账户。 + +完成之后,就会出现 Kitematic 应用程序的第一个界面。正如下面看到的这样。我们可以搜索可用的 docker 镜像。 + +![启动 Kitematic](http://blog.linoxide.com/wp-content/uploads/2015/07/kitematic-app-launched.jpg) + +### 3. 部署 Nginx Hello World 容器 ### + +现在,成功安装完 Kitematic 之后,我们打算部署容器。要运行一个容器,我们只需要在搜索区域中搜索镜像。然后点击 Create 按钮部署容器。在这篇教程中,我们会部署一个小的包含了 Hello World 主页的 Nginx Web 服务器。为此,我们在搜索区域中搜索 Hello World Nginx。看到了容器信息之后,我们点击 Create 来部署容器。 + +![运行 Hello World Nginx](http://blog.linoxide.com/wp-content/uploads/2015/06/hello-world-nginx-run.jpg) + +镜像下载完成之后,它会自动部署。我们可以查看 Kitematic 部署容器的命令日志。我们也可以在 Kitematic 界面上预览 web 页面。现在,我们通过点击预览在 web 浏览器中查看我们的 Hello World 页面。 + +![浏览 Nginx Hello World](http://blog.linoxide.com/wp-content/uploads/2015/07/nginx-hello-world-browser.jpg) + +如果我们想切换到命令行接口并用它管理 docker,这里有个称为 Docker CLI 的按钮,它会打开一个 PowerShell,在里面我们可以执行 docker 命令。 + +![Docker CLI PowerShell](http://blog.linoxide.com/wp-content/uploads/2015/07/docker-cli-powershell.png) + +现在,如果我们想配置我们的容器并执行类似更改容器名称、设置环境变量、指定端口、配置容器存储以及其它高级功能的任务,我们可以在容器设置页面做到这些。 + +![设置 Kitematic Container](http://blog.linoxide.com/wp-content/uploads/2015/07/kitematic-container-settings.png) + +### 总结 ### + +我们终于成功在 Windows 操作系统上安装了 Kitematic 并部署了一个 Hello World Ngnix 服务器。总是推荐下载安装 Kitematic 最新的发行版,因为会增加很多新的高级功能。由于 Docker 运行在 64 位平台,当前 Kitematic 也是为 64 位操作系统构建。它只能在 Windows 7 以及更高版本上运行。在这篇教程中,我们部署了一个 Nginx Web 服务器,类似地我们可以在 Kitematic 中简单的点击就能通过镜像部署任何 docker 容器。Kitematic 已经有可用的 Mac OS X 和 Windows 版本,Linux 版本也在开发中很快就会发布。如果你有任何疑问、建议或者反馈,请在下面的评论框中写下来以便我们更改地改进或更新我们的内容。非常感谢!Enjoy :-) + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/linux-how-to/interactively-docker-kitematic/ + +作者:[Arun Pyasi][a] +译者:[ictlyh](https://github.com/ictlyh) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://linoxide.com/author/arunp/ +[1]:https://github.com/kitematic/kitematic/releases \ No newline at end of file From 25b5c29a7138e4bd085c2009a469c6d756fbb8df Mon Sep 17 00:00:00 2001 From: zpl Date: Sat, 25 Jul 2015 19:16:21 +0800 Subject: [PATCH 695/965] Update 20150717 Howto Configure FTP Server with Proftpd on Fedora 22.md --- ...re FTP Server with Proftpd on Fedora 22.md | 103 +++++++++--------- 1 file changed, 51 insertions(+), 52 deletions(-) diff --git a/sources/tech/20150717 Howto Configure FTP Server with Proftpd on Fedora 22.md b/sources/tech/20150717 Howto Configure FTP Server with Proftpd on Fedora 22.md index 416696bc91..0ccfe69b8f 100644 --- a/sources/tech/20150717 Howto Configure FTP Server with Proftpd on Fedora 22.md +++ b/sources/tech/20150717 Howto Configure FTP Server with Proftpd on Fedora 22.md @@ -1,55 +1,54 @@ -zpl1025 -Howto Configure FTP Server with Proftpd on Fedora 22 +如何在 Fedora 22 上配置 Proftpd 服务器 ================================================================================ -In this article, we'll learn about setting up an FTP server with Proftpd running Fedora 22 in our machine or server. [ProFTPD][1] is a free and open source FTP daemon software licensed under GPL. It is among most popular FTP server among machines running Linux. Its primary design aims to have an FTP server with many advanced features and provisioning users for more configuration options for easy customization. It includes a number of configuration options that are still not available with many other FTP daemons. It was initially developed by the developers as an alternative with better security and configuration to wu-ftpd server. An FTP server is a program that allows us to upload or download files and folders from a remote server where it is setup using an FTP client. Some of the features of ProFTPD daemon are as follows, you can check more features on [http://www.proftpd.org/features.html][2] . +在本文中,我们将了解如何在运行 Fedora 22 的电脑或服务器上使用 Proftpd 架设 FTP 服务器。[ProFTPD][1] 是一款免费的基于 GPL 授权开源的 FTP 服务器软件,是 Linux 上的主流 FTP 服务器。它的主要设计目标是具备许多高级功能以及能为用户提供丰富的配置选项可以轻松实现定制。它的许多配置选项在其他一些 FTP 服务器软件里仍然没有集成。最初它是被开发作为 wu-ftpd 服务器的一个更安全更容易配置的替代。FTP 服务器是这样一个软件,用户可以通过 FTP 客户端从安装了它的远端服务器上传或下载文件和目录。下面是一些 ProFTPD 服务器的主要功能,更详细的资料可以访问 [http://www.proftpd.org/features.html][2]。 -- It includes a per directory ".ftpaccess" access configuration similar to Apache's ".htaccess" -- It features multiple virtual FTP server with multiple users login and anonymous FTP services. -- It can be run either as a stand-alone server or from inetd/xinetd. -- Its ownership, file/folder attributes and file/folder permissions are UNIX-based. -- It can be run as standalone mode in order to protect the system from damage that can be caused from root access. -- The modular design of it makes it easily extensible with modules like LDAP servers, SSL/TLS encryption, RADIUS support, etc. -- IPv6 support is also included in the ProFTPD server. +- 每个目录都包含 ".ftpaccess" 文件用于访问控制,类似 Apache 的 ".htaccess" +- 支持多个虚拟 FTP 服务器以及多用户登录和匿名 FTP 服务。 +- 可以作为独立进程启动服务或者通过 inetd/xinetd 启动 +- 它的文件/目录属性、属主和权限采用类 UNIX 方式。 +- 它可以独立运行,保护系统避免 root 访问可能带来的损坏。 +- 模块化的设计让它可以轻松扩展其他模块,比如 LDAP 服务器,SSL/TLS 加密,RADIUS 支持,等等。 +- ProFTPD 服务器还支持 IPv6. -Here are some easy to perform steps on how we can setup an FTP Server with ProFTPD in Fedora 22 operating system. +下面是如何在运行 Fedora 22 操作系统的计算机上使用 ProFTPD 架设 FTP 服务器的一些简单步骤。 -### 1. Installing ProFTPD ### +### 1. 安装 ProFTPD ### -First of all, we'll wanna install Proftpd server in our box running Fedora 22 as its operating system. As yum package manager has been depreciated, we'll use the latest and greatest built package manager called dnf. DNF is pretty easy to use and highly user friendly package manager available in Fedora 22. We'll simply use it to install proftpd daemon server. To do so, we'll need to run the following command in a terminal or a console in sudo mode. +首先,我们将在运行 Fedora 22 的机器上安装 Proftpd 软件。因为 yum 包管理器已经被抛弃了,我们将使用最新最好的包管理器 dnf。DNF 很容易使用,是 Fedora 22 上采用的非常人性化的包管理器。我们将用它来安装 proftpd 软件。这需要在终端或控制台里用 sudo 模式运行下面的命令。 $ sudo dnf -y install proftpd proftpd-utils -### 2. Configuring ProFTPD ### +### 2. 配置 ProFTPD ### -Now, we'll make changes to some configurations in the daemon. To configure the daemon, we will need to edit /etc/proftpd.conf with a text editor. The main configuration file of the ProFTPD daemon is **/etc/proftpd.conf** so, any changes made to this file will affect the FTP server. Here, are some changes we make in this initial step. +现在,我们将修改软件的一些配置。要配置它,我们需要用文本编辑器编辑 /etc/proftpd.conf 文件。**/etc/proftpd.conf** 文件是 ProFTPD 软件的主要配置文件,所以,这个文件的任何改动都会影响到 FTP 服务器。在这里,是我们在初始步骤里做出的改动。 $ sudo vi /etc/proftpd.conf -Next, after we open the file using a text editor, we'll wanna make changes to the ServerName and ServerAdmin as hostname and email address respectively. Here's what we have made changes to those configs. +之后,在用文本编辑器打开这个文件后,我们会想改下 ServerName 以及 ServerAdmin,分别填入自己的域名和 email 地址。下面是我们改的。 ServerName "ftp.linoxide.com" ServerAdmin arun@linoxide.com -After that, we'll wanna the following lines into the configuration file so that it logs access & auth into its specified log files. +在这之后,我们将把下面的设定加到配置文件里,这样可以让服务器将访问和授权记录到相应的日志文件里。 ExtendedLog /var/log/proftpd/access.log WRITE,READ default ExtendedLog /var/log/proftpd/auth.log AUTH auth -![Configuring ProFTPD Config](http://blog.linoxide.com/wp-content/uploads/2015/06/configuring-proftpd-config.png) +![调整 ProFTPD 设置](http://blog.linoxide.com/wp-content/uploads/2015/06/configuring-proftpd-config.png) -### 3. Adding FTP users ### +### 3. 添加 FTP 用户 ### -After configure the basics of the configuration file, we'll surely wanna create an FTP user which is rooted at a specific directory we want. The current users that we use to login into our machine are automatically enabled with the FTP service, we can even use it to login into the FTP server. But, in this tutorial, we'll gonna create a new user with a specified home directory to the ftp server. +在设定好了基本的配置文件后,我们很自然地希望为指定目录添加 FTP 用户。目前用来登录的用户是 FTP 服务自动生成的,可以用来登录到 FTP 服务器。但是,在这篇教程里,我们将创建一个以 ftp 服务器上指定目录为主目录的新用户。 -Here, we'll create a new group named ftpgroup. +下面,我们将建立一个名字是 ftpgroup 的新用户组。 $ sudo groupadd ftpgroup -Then, we'll gonna add a new user arunftp into the group with home directory specified as /ftp-dir/ +然后,我们将以目录 /ftp-dir/ 作为主目录增加一个新用户 arunftp 并加入这个组中。 $ sudo useradd -G ftpgroup arunftp -s /sbin/nologin -d /ftp-dir/ -After the user has been created and added to the group, we'll wanna set a password to the user arunftp. +在创建好用户并加入用户组后,我们将为用户 arunftp 设置一个密码。 $ sudo passwd arunftp @@ -58,26 +57,26 @@ After the user has been created and added to the group, we'll wanna set a passwo Retype new password: passwd: all authentication tokens updated successfully. -Now, we'll set read and write permission of the home directory by the ftp users by executing the following command. +现在,我们将通过下面命令为这个 ftp 用户设定主目录的读写权限。 $ sudo setsebool -P allow_ftpd_full_access=1 $ sudo setsebool -P ftp_home_dir=1 -Then, we'll wanna make that directory and its contents unable to get removed or renamed by any other users. +然后,我们会设定不允许其他用户移动或重命名这个目录以及里面的内容。 $ sudo chmod -R 1777 /ftp-dir/ -### 4. Enabling TLS Support ### +### 4. 打开 TLS 支持 ### -FTP is considered less secure in comparison to the latest encryption methods used these days as anybody sniffing the network card can read the data pass through FTP. So, we'll enable TLS Encryption support in our FTP server. To do so, we'll need to a edit /etc/proftpd.conf configuration file. Before that, we'll wanna backup our existing configuration file to make sure we can revert our configuration if any unexpected happens. +目前 FTP 所用的加密手段并不安全,任何人都可以通过监听网卡来读取 FTP 传输的数据。所以,我们将为自己的服务器打开 TLS 加密支持。这样的话,需要编辑 /etc/proftpd.conf 配置文件。在这之前,我们先备份一下当前的配置文件,可以保证在改出问题后还可以恢复。 $ sudo cp /etc/proftpd.conf /etc/proftpd.conf.bak -Then, we'll wanna edit the configuration file using our favorite text editor. +然后,我们可以用自己喜欢的文本编辑器修改配置文件。 $ sudo vi /etc/proftpd.conf -Then, we'll wanna add the following lines just below line we configured in step 2 . +然后,把下面几行附加到我们在第 2 步中所增加内容的后面。 TLSEngine on TLSRequired on @@ -86,19 +85,19 @@ Then, we'll wanna add the following lines just below line we configured in step TLSRSACertificateFile /etc/pki/tls/certs/proftpd.pem TLSRSACertificateKeyFile /etc/pki/tls/certs/proftpd.pem -![Enabling TLS Configuration](http://blog.linoxide.com/wp-content/uploads/2015/06/tls-configuration.png) +![打开 TLS 配置](http://blog.linoxide.com/wp-content/uploads/2015/06/tls-configuration.png) -After finishing up with the configuration, we'll wanna save and exit it. +完成上面的设定后,保存退出。 -Next, we'll need to generate the SSL certificates inside **/etc/pki/tls/certs/** directory as proftpd.pem. To do so, first we'll need to install openssl in our Fedora 22 machine. +然后,我们需要生成 SSL 凭证 proftpd.pem 并放到 **/etc/pki/tls/certs/** 目录里。这样的话,首先需要在 Fedora 22 上安装 openssl。 $ sudo dnf install openssl -Then, we'll gonna generate the SSL certificate by running the following command. +然后,可以通过执行下面的命令生成 SSL 凭证。 $ sudo openssl req -x509 -nodes -newkey rsa:2048 -keyout /etc/pki/tls/certs/proftpd.pem -out /etc/pki/tls/certs/proftpd.pem -We'll be asked with some information that will be associated into the certificate. After completing the required information, it will generate a 2048 bit RSA private key. +系统会询问一些将写入凭证里的基本信息。在填完资料后,就会生成一个 2048 位的 RSA 私钥。 Generating a 2048 bit RSA private key ...................+++ @@ -120,65 +119,65 @@ We'll be asked with some information that will be associated into the certificat Common Name (eg, your name or your server's hostname) []:ftp.linoxide.com Email Address []:arun@linoxide.com -After that, we'll gonna change the permission of the generated certificate file in order to secure it. +在这之后,我们要改变所生成凭证文件的权限以增加安全性。 $ sudo chmod 600 /etc/pki/tls/certs/proftpd.pem -### 5. Allowing FTP through Firewall ### +### 5. 允许 FTP 通过 Firewall ### -Now, we'll need to allow the ftp ports that are usually blocked by the firewall by default. So, we'll allow ports and enable access to the ftp through firewall. +现在,需要允许 ftp 端口,一般默认被防火墙阻止了。就是说,需要允许 ftp 端口能通过防火墙访问。 -If **TLS/SSL Encryption is enabled** run the following command. +如果 **打开了 TLS/SSL 加密**,执行下面的命令。 $sudo firewall-cmd --add-port=1024-65534/tcp $ sudo firewall-cmd --add-port=1024-65534/tcp --permanent -If **TLS/SSL Encryption is disabled** run the following command. +如果 **没有打开 TLS/SSL 加密**,执行下面的命令。 $ sudo firewall-cmd --permanent --zone=public --add-service=ftp success -Then, we'll need to reload the firewall configuration. +然后,重新加载防火墙设定。 $ sudo firewall-cmd --reload success -### 6. Starting and Enabling ProFTPD ### +### 6. 启动并激活 ProFTPD ### -After everything is set, we'll finally start our ProFTPD and give it a try. To start the proftpd ftp daemon, we'll need to run the following command. +全部设定好后,最后就是启动 ProFTPD 并试一下。可以运行下面的命令来启动 proftpd ftp 守护程序。 $ sudo systemctl start proftpd.service -Then, we'll wanna enable proftpd to start on every boot. +然后,我们可以设定开机启动。 $ sudo systemctl enable proftpd.service Created symlink from /etc/systemd/system/multi-user.target.wants/proftpd.service to /usr/lib/systemd/system/proftpd.service. -### 7. Logging into the FTP server ### +### 7. 登录到 FTP 服务器 ### -Now, if everything was configured and done as expected, we must be able to connect to the ftp server and login with the details we set above. Here, we'll gonna configure our FTP client, filezilla with hostname as **server's ip or url**, Protocol as **FTP**, User as **arunftp** and password as the one we set in above step 3. If you followed step 4 for enabling TLS support, then we'll need to set the Encryption type as **Require explicit FTP over TLS** but if you didn't follow step 4 and don't wanna use TLS encryption then set the Encryption type as **Plain FTP**. +现在,如果都是按照本教程设置好的,我们一定可以连接到 ftp 服务器并使用以上设置的信息登录上去。在这里,我们将配置一下 FTP 客户端 filezilla,使用 **服务器的 IP 或 URL **作为主机名,协议选择 **FTP**,用户名填入 **arunftp**,密码是在上面第 3 步中设定的密码。如果你按照第 4 步中的方式打开了 TLS 支持,还需要在加密类型中选择 **显式要求基于 TLS 的 FTP**,如果没有打开,也不想使用 TLS 加密,那么加密类型选择 **简单 FTP**。 -![FTP Login Details](http://blog.linoxide.com/wp-content/uploads/2015/06/ftp-login-details.png) +![FTP 登录细节](http://blog.linoxide.com/wp-content/uploads/2015/06/ftp-login-details.png) -To setup the above configuration, we'll need goto File which is under the Menu and then click on Site Manager in which we can click on new site then configure as illustrated above. +要做上述设定,需要打开菜单里的文件,点击站点管理器,然后点击新建站点,再按上面的方式设置。 -![FTP SSL Certificate](http://blog.linoxide.com/wp-content/uploads/2015/06/ftp-ssl-certificate.png) +![FTP SSL 凭证](http://blog.linoxide.com/wp-content/uploads/2015/06/ftp-ssl-certificate.png) -Then, we're asked to accept the SSL certificate, that can be done by click OK. After that, we are able to upload and download required files and folders from our FTP server. +随后系统会要求允许 SSL 凭证,点确定。之后,就可以从我们的 FTP 服务器上传下载文件和文件夹了。 -### Conclusion ### +### 总结 ### -Finally, we have successfully installed and configured our Fedora 22 box with Proftpd FTP server. Proftpd is an awesome powerful highly configurable and extensible FTP daemon. The above tutorial illustrates us how we can configure a secure FTP server with TLS encryption. It is highly recommended to configure FTP server with TLS encryption as it enables SSL certificate security to the data transfer and login. Here, we haven't configured anonymous access to the FTP cause they are usually not recommended in a protected FTP system. An FTP access makes pretty easy for people to upload and download at good efficient performance. We can even change the ports for the users for additional security. So, if you have any questions, suggestions, feedback please write them in the comment box below so that we can improve or update our contents. Thank you ! Enjoy :-) +最后,我们成功地在 Fedora 22 机器上安装并配置好了 Proftpd FTP 服务器。Proftpd 是一个超级强大,能高度配置和扩展的 FTP 守护软件。上面的教程展示了如何配置一个采用 TLS 加密的安全 FTP 服务器。强烈建议设置 FTP 服务器支持 TLS 加密,因为它允许使用 SSL 凭证加密数据传输和登录。本文中,我们也没有配置 FTP 的匿名访问,因为一般受保护的 FTP 系统不建议这样做。 FTP 访问让人们的上传和下载变得非常简单也更高效。我们还可以改变用户端口增加安全性。好吧,如果你有任何疑问,建议,反馈,请在下面评论区留言,这样我们就能够改善并更新文章内容。谢谢!玩的开心 :-) -------------------------------------------------------------------------------- via: http://linoxide.com/linux-how-to/configure-ftp-proftpd-fedora-22/ 作者:[Arun Pyasi][a] -译者:[译者ID](https://github.com/译者ID) +译者:[zpl1025](https://github.com/zpl1025) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From f5423b8e2a1d02bc1fb95b4a7531f3781e0dd6c7 Mon Sep 17 00:00:00 2001 From: Frank Zhang Date: Sat, 25 Jul 2015 19:24:21 +0800 Subject: [PATCH 696/965] [translated] 20150717 Howto Configure FTP Server with Proftpd on Fedora 22.md --- ...150717 Howto Configure FTP Server with Proftpd on Fedora 22.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/20150717 Howto Configure FTP Server with Proftpd on Fedora 22.md (100%) diff --git a/sources/tech/20150717 Howto Configure FTP Server with Proftpd on Fedora 22.md b/translated/tech/20150717 Howto Configure FTP Server with Proftpd on Fedora 22.md similarity index 100% rename from sources/tech/20150717 Howto Configure FTP Server with Proftpd on Fedora 22.md rename to translated/tech/20150717 Howto Configure FTP Server with Proftpd on Fedora 22.md From 0869c1acd96e8716c988b4b8fec41da0c3c3e6cd Mon Sep 17 00:00:00 2001 From: wxy Date: Sat, 25 Jul 2015 23:57:19 +0800 Subject: [PATCH 697/965] PUB:20150629 Backup with these DeDuplicating Encryption Tools @FSSlc --- ...th these DeDuplicating Encryption Tools.md | 64 ++++++++----------- 1 file changed, 28 insertions(+), 36 deletions(-) rename {translated/share => published}/20150629 Backup with these DeDuplicating Encryption Tools.md (56%) diff --git a/translated/share/20150629 Backup with these DeDuplicating Encryption Tools.md b/published/20150629 Backup with these DeDuplicating Encryption Tools.md similarity index 56% rename from translated/share/20150629 Backup with these DeDuplicating Encryption Tools.md rename to published/20150629 Backup with these DeDuplicating Encryption Tools.md index 366be7dd32..8a0621a190 100644 --- a/translated/share/20150629 Backup with these DeDuplicating Encryption Tools.md +++ b/published/20150629 Backup with these DeDuplicating Encryption Tools.md @@ -1,47 +1,46 @@ -使用去重加密工具来备份 +使用这些去重加密工具来备份你的数据 ================================================================================ -在体积和价值方面,数据都在增长。快速而可靠地备份和恢复数据正变得越来越重要。社会已经适应了技术的广泛使用,并懂得了如何依靠电脑和移动设备,但很少有人能够处理丢失重要数据的现实。在遭受数据损失的公司中,30% 的公司将在一年内损失一半市值,70% 的公司将在五年内停止交易。这更加凸显了数据的价值。 -随着数据在体积上的增长,提高存储利用率尤为重要。In Computing(注:这里不知如何翻译),数据去重是一种特别的数据压缩技术,因为它可以消除重复数据的拷贝,所以这个技术可以提高存储利用率。 +无论是体积还是价值,数据都在不断增长。快速而可靠地备份和恢复数据正变得越来越重要。社会已经适应了技术的广泛使用,并懂得了如何依靠电脑和移动设备,但很少有人能够面对丢失重要数据的现实。在遭受数据损失的公司中,30% 的公司将在一年内损失一半市值,70% 的公司将在五年内停止交易。这更加凸显了数据的价值。 -数据并不仅仅只有其创造者感兴趣。政府、竞争者、犯罪分子、偷窥者可能都热衷于获取你的数据。他们或许想偷取你的数据,从你那里进行敲诈,或看你正在做什么。对于保护你的数据,加密是非常必要的。 +随着数据在体积上的增长,提高存储利用率尤为重要。从计算机的角度说,数据去重是一种特别的数据压缩技术,因为它可以消除重复数据的拷贝,所以这个技术可以提高存储利用率。 -所以,解决方法是我们需要一个去重加密备份软件。 +数据并不仅仅只有其创造者感兴趣。政府、竞争者、犯罪分子、偷窥者可能都热衷于获取你的数据。他们或许想偷取你的数据,从你那里进行敲诈,或看你正在做什么。因此,对于保护你的数据,加密是非常必要的。 -对于所有的用户而言,做文件备份是一件非常必要的事,至今为止许多用户还没有采取足够的措施来保护他们的数据。一台电脑不论是工作在一个合作的环境中,还是供私人使用,机器的硬盘可能在没有任何警告的情况下挂掉。另外,有些数据丢失可能是人为的错误所引发的。如果没有做经常性的备份,数据也可能不可避免地失去掉,即使请了专业的数据恢复公司来帮忙。 +所以,解决方法是我们需要一个可以去重的加密备份软件。 + +对于所有的用户而言,做文件备份是一件非常必要的事,至今为止许多用户还没有采取足够的措施来保护他们的数据。一台电脑不论是工作在一个合作的环境中,还是供私人使用,机器的硬盘可能在没有任何警告的情况下挂掉。另外,有些数据丢失可能是人为的错误所引发的。如果没有做经常性的备份,数据也可能不可避免地丢失,即使请了专业的数据恢复公司来帮忙。 这篇文章将对 6 个去重加密备份工具进行简要的介绍。 ----------- ### Attic ### -Attic 是一个可用于去重、加密,验证完整性的用 Python 写的压缩备份程序。Attic 的主要目标是提供一个高效且安全的方式来备份数据。Attic 使用的数据去重技术使得它适用于每日备份,因为只需存储改变的数据。 +Attic 是一个可用于去重、加密,验证完整性的压缩备份程序,它是用 Python 写的。Attic 的主要目标是提供一个高效且安全的方式来备份数据。Attic 使用的数据去重技术使得它适用于每日备份,因为只需存储改变的数据。 其特点有: - 易用 -- 可高效利用存储空间,通过检查冗余的数据,数据块大小的去重被用来减少存储所用的空间 -- 可选的数据加密,使用 256 位的 AES 加密算法。数据的完整性和可靠性使用 HMAC-SHA256 来检查 +- 可高效利用存储空间,通过检查冗余的数据,对可变块大小的去重可以减少存储所用的空间 +- 可选的数据加密,使用 256 位的 AES 加密算法。数据的完整性和可靠性使用 HMAC-SHA256 来校验 - 使用 SDSH 来进行离线备份 - 备份可作为文件系统来挂载 网站: [attic-backup.org][1] ----------- ### Borg ### -Borg 是 Attic 的分支。它是一个安全的开源备份程序,被设计用来高效地存储那些新的或修改过的数据。 +Borg 是 Attic 的一个分支。它是一个安全的开源备份程序,被设计用来高效地存储那些新的或修改过的数据。 -Borg 的主要目标是提供一个高效、安全的方式来存储数据。Borg 使用的数据去重技术使得它适用于每日备份,因为只需存储改变的数据。认证加密使得它适用于不完全可信的目标的存储。 +Borg 的主要目标是提供一个高效、安全的方式来存储数据。Borg 使用的数据去重技术使得它适用于每日备份,因为只需存储改变的数据。认证加密使得它适用于存储在不完全可信的位置。 -Borg 由 Python 写成。Borg 于 2015 年 5 月被创造出来,为了回应让新的代码或重大的改变带入 Attic 的困难。 +Borg 由 Python 写成。Borg 于 2015 年 5 月被创造出来,是为了解决让新的代码或重大的改变带入 Attic 的困难。 其特点包括: - 易用 -- 可高效利用存储空间,通过检查冗余的数据,数据块大小的去重被用来减少存储所用的空间 -- 可选的数据加密,使用 256 位的 AES 加密算法。数据的完整性和可靠性使用 HMAC-SHA256 来检查 +- 可高效利用存储空间,通过检查冗余的数据,对可变块大小的去重被用来减少存储所用的空间 +- 可选的数据加密,使用 256 位的 AES 加密算法。数据的完整性和可靠性使用 HMAC-SHA256 来校验 - 使用 SDSH 来进行离线备份 - 备份可作为文件系统来挂载 @@ -49,36 +48,32 @@ Borg 与 Attic 不兼容。 网站: [borgbackup.github.io/borgbackup][2] ----------- - ### Obnam ### Obnam (OBligatory NAMe) 是一个易用、安全的基于 Python 的备份程序。备份可被存储在本地硬盘或通过 SSH SFTP 协议存储到网上。若使用了备份服务器,它并不需要任何特殊的软件,只需要使用 SSH 即可。 -Obnam 通过将数据数据分成数据块,并单独存储它们来达到去重的目的,每次通过增量备份来生成备份,每次备份的生成就像是一次新的快照,但事实上是真正的增量备份。Obnam 由 Lars Wirzenius 开发。 +Obnam 通过将数据分成数据块,并单独存储它们来达到去重的目的,每次通过增量备份来生成备份,每次备份的生成就像是一次新的快照,但事实上是真正的增量备份。Obnam 由 Lars Wirzenius 开发。 其特点有: - 易用 - 快照备份 -- 数据去重,跨文件,生成备份 +- 数据去重,跨文件,然后生成备份 - 可使用 GnuPG 来加密备份 - 向一个单独的仓库中备份多个客户端的数据 - 备份检查点 (创建一个保存点,以每 100MB 或其他容量) - 包含多个选项来调整性能,包括调整 lru-size 或 upload-queue-size -- 支持 MD5 校验和算法来识别重复的数据块 +- 支持 MD5 校验算法来识别重复的数据块 - 通过 SFTP 将备份存储到一个服务器上 - 同时支持 push(即在客户端上运行) 和 pull(即在服务器上运行) 网站: [obnam.org][3] ----------- - ### Duplicity ### -Duplicity 持续地以 tar 文件格式备份文件和目录,并使用 GnuPG 来进行加密,同时将它们上传到远程(或本地)的文件服务器上。它可以使用 ssh/scp, 本地文件获取, rsync, ftp, 和 Amazon S3 等来传递数据。 +Duplicity 以 tar 文件格式增量备份文件和目录,并使用 GnuPG 来进行加密,同时将它们上传到远程(或本地)的文件服务器上。它可以使用 ssh/scp、本地文件获取、rsync、 ftp 和 Amazon S3 等来传递数据。 -因为 duplicity 使用了 librsync, 增加的存档高效地利用了存储空间,且只记录自从上次备份依赖改变的那部分文件。由于该软件使用 GnuPG 来机密或对这些归档文件进行进行签名,这使得它们免于服务器的监视或修改。 +因为 duplicity 使用了 librsync, 增量存档可以高效地利用存储空间,且只记录自从上次备份依赖改变的那部分文件。由于该软件使用 GnuPG 来加密或对这些归档文件进行进行签名,这使得它们免于服务器的监视或修改。 当前 duplicity 支持备份删除的文件,全部的 unix 权限,目录,符号链接, fifo 等。 @@ -101,39 +96,36 @@ duplicity 软件包还包含有 rdiffdir 工具。 Rdiffdir 是 librsync 的 rdi 网站: [duplicity.nongnu.org][4] ----------- - ### ZBackup ### ZBackup 是一个通用的全局去重备份工具。 其特点包括: -- 存储数据的并行 LZMA 或 LZO 压缩,在一个仓库中,你还可以混合使用 LZMA 和 LZO +- 对存储数据并行进行 LZMA 或 LZO 压缩,在一个仓库中,你还可以混合使用 LZMA 和 LZO - 内置对存储数据的 AES 加密 -- 可选择地删除旧的备份数据 +- 能够删除旧的备份数据 - 可以使用 64 位的滚动哈希算法,使得文件冲突的数量几乎为零 -- Repository consists of immutable files. No existing files are ever modified ==== +- 仓库中存储的文件是不可修改的,已备份的文件不会被修改。 - 用 C++ 写成,只需少量的库文件依赖 - 在生成环境中可以安全使用 - 可以在不同仓库中进行数据交换而不必再进行压缩 -- 可以使用 64 位改进型 Rabin-Karp 滚动哈希算法 +- 使用 64 位改进型 Rabin-Karp 滚动哈希算法 网站: [zbackup.org][5] ----------- ### bup ### -bup 是一个用 Python 写的备份程序,其名称是 "backup" 的缩写。在 git packfile 文件的基础上, bup 提供了一个高效的方式来备份一个系统,提供快速的增量备份和全局去重(在文件中或文件里,甚至包括虚拟机镜像)。 +bup 是一个用 Python 写的备份程序,其名称是 "backup" 的缩写。基于 git packfile 文件格式, bup 提供了一个高效的方式来备份一个系统,提供快速的增量备份和全局去重(在文件中或文件里,甚至包括虚拟机镜像)。 bup 在 LGPL 版本 2 协议下发行。 其特点包括: -- 全局去重 (在文件中或文件里,甚至包括虚拟机镜像) +- 全局去重 (在文件之间或文件内部,甚至包括虚拟机镜像) - 使用一个滚动的校验和算法(类似于 rsync) 来将大文件分为多个数据块 -- 使用来自 git 的 packfile 格式 +- 使用来自 git 的 packfile 文件格式 - 直接写入 packfile 文件,以此提供快速的增量备份 - 可以使用 "par2" 冗余来恢复冲突的备份 - 可以作为一个 FUSE 文件系统来挂载你的 bup 仓库 @@ -145,7 +137,7 @@ bup 在 LGPL 版本 2 协议下发行。 via: http://www.linuxlinks.com/article/20150628060000607/BackupTools.html 译者:[FSSlc](https://github.com/FSSlc) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 90be4e6a3fbabd1fd431935b1f50cfcc8dac5e73 Mon Sep 17 00:00:00 2001 From: wi-cuckoo Date: Sun, 26 Jul 2015 00:12:43 +0800 Subject: [PATCH 698/965] translating wi-cuckoo --- .../tech/20150717 How to monitor NGINX with Datadog - Part 3.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20150717 How to monitor NGINX with Datadog - Part 3.md b/sources/tech/20150717 How to monitor NGINX with Datadog - Part 3.md index 949fd3d949..40787cdd96 100644 --- a/sources/tech/20150717 How to monitor NGINX with Datadog - Part 3.md +++ b/sources/tech/20150717 How to monitor NGINX with Datadog - Part 3.md @@ -1,3 +1,4 @@ +translating wi-cuckoo How to monitor NGINX with Datadog - Part 3 ================================================================================ ![](http://www.datadoghq.com/wp-content/uploads/2015/07/NGINX_hero_3.png) From f9289eb42b265f55e582028d16864f5cfddd2d3a Mon Sep 17 00:00:00 2001 From: Chang Liu Date: Sun, 26 Jul 2015 10:08:54 +0800 Subject: [PATCH 699/965] [Translated]20150722 How To Manage StartUP Applications In Ubuntu.md --- ...o Manage StartUp Applications In Ubuntu.md | 115 ------------------ ...o Manage StartUp Applications In Ubuntu.md | 112 +++++++++++++++++ 2 files changed, 112 insertions(+), 115 deletions(-) delete mode 100644 sources/tech/20150722 How To Manage StartUp Applications In Ubuntu.md create mode 100644 translated/tech/20150722 How To Manage StartUp Applications In Ubuntu.md diff --git a/sources/tech/20150722 How To Manage StartUp Applications In Ubuntu.md b/sources/tech/20150722 How To Manage StartUp Applications In Ubuntu.md deleted file mode 100644 index f14d983707..0000000000 --- a/sources/tech/20150722 How To Manage StartUp Applications In Ubuntu.md +++ /dev/null @@ -1,115 +0,0 @@ -FSSlc translating - -How To Manage StartUp Applications In Ubuntu -================================================================================ -![Manage startup applications in Ubuntu](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/Manage-Start-up-apps-in-Ubuntu.png) - -Ever felt the need to **control startup applications in Ubuntu**? You should, if you feel that your Ubuntu system is very slow at the boot time. - -Every time you boot in to an operating system, a number of applications start automatically. These are called ‘startup applications’ or ‘start up programs’. Over the time, when you have plenty of application installed in your system, you’ll find that there are too many of these ‘startup applications’ which start at the boot time automatically, eats up the system resource and slows down the system. This might result in a sluggish Ubuntu experience, which I think, you don’t want at all. - -A way to make Ubuntu faster is to control startup applications. Ubuntu provides you GUI tools that you can use to find out the startup programs, disable them entirely or delay their execution so that you won’t have each application trying to run at the same time. - -In this post we shall see **how to control startup applications, how to run an application at startup and how to find hidden startup applications in Ubuntu**. The instructions provided here are applicable to all Ubuntu versions such as Ubuntu 12.04, Ubuntu 14.04 and Ubuntu 15.04. - -### Manage startup applications in Ubuntu ### - -By default, Ubuntu provides Startup Applications utility that you could use. No need of installation. Just go in Unity Dash and look for startup applications. - -![Startup applications Ubuntu](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/startup_applications_Ubuntu.jpeg) - -Click on it to start. Here is what my startup applications look like: - -![Find startup programs in Ubuntu](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/Screenshot-from-2015-07-18-122550.png) - -### Remove startup applications in Ubuntu ### - -Now it is up to you what you find useless. For me [Caribou][1], on screen keyboard program, is not of any use at the startup. I would prefer to remove it. - -You can choose to either prevent it from starting up at boot time but keeping it in the startup applications list for future reactivation. Click on close to save your preference. - -![remove startup programs in Ubuntu](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/startup_applications_ubuntu_2.png) - -To remove a program from startup applications list, select it and click on Remove from the right window pane. - -![remove programs from startup applications in Ubuntu](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/startup_applications_Ubuntu_1.jpeg) - -Note that, this will NOT uninstall the program. Just that the program will not start automatically at each boot. You can do it with all the programs that you don’t like. - -### Delay the start up programs ### - -What if you do not want to remove programs at the start up but you are worried about system performance at the boot time. What you can do is to add a delay in various programs so that not all the programs will be starting at the same time. - -Select a program and click Edit. - -![edit startup applications ubuntu](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/startup_applications_ubuntu_3.png) - -This will show the command that runs this particular program. - -![commands at startup programs](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/startup_applications_ubuntu_4.jpg) - -All you need to do is to add sleep XX; before the command. It will add a delay of XX seconds before running the actual commands to run the applications. For example if I want Variety [wallpaper management application][2] for 2 minutes, I’ll add sleep 120; before the command like this: - -![delay the startup of programs in Ubuntu](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/startup_applications_ubuntu_5.png) - -Save it and close it. You’ll see the impact at the next boot. - -### Add a program in the startup applications ### - -This could be tricky for beginners. You see, things are in commands at the bottom of everything in Linux. We just saw in the previous section that these startup programs are just some commands being run at each boot. If you want to add a new program in the startup, you’ll need to know the command that runs the application. - -#### Step 1: How to find the command to run an application? #### - -Go in the Unity Dash and search for Main Menu: - -![Program Menu Ubuntu](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/Program_menu_Ubuntu.jpg) - -This contains all the program that you have installed in various categories. In old Ubuntu days, you would see similar menu for selecting and running applications. - -![main menu in ubuntu](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/Main_menu_ubuntu.jpeg) - -Just look for your application under various categories and click on the Properties tab to see the command that runs this application. For example, I want to run Transmission Torrent client on start up. - -![find running command of programs in ubuntu](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/Main_menu_ubuntu_1.jpeg) - -This will give me the command that runs Transmission: - -![find running commands of a program in Ubuntu](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/startup_programs_commands.png) - -Now I’ll use the same information to add Transmission in startup applications. - -#### Step 2: Adding programs in startup #### - -Go again in Startup Applications and click on Add. This will ask you enter a name, command and description. The command is the most important of all. You can use whatever name and description you want. Use the command you got from previous step and click on Add. - -![Adding a startup program in Ubuntu](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/Add_startup_program_Ubuntu.jpg) - -That’s it. You’ll see it in the next boot up, running automatically. This is all you can do with startup applications in Ubuntu. - -So, far we have discussed about applications that are visible in startup but there are many more services, daemons and programs that are not visible to Startup applications. In next section, we shall see how to see hidden startup programs in Ubuntu. - -### See hidden startup program in Ubuntu ### - -To see what are the services running at startup, open a terminal and use the following command: - - sudo sed -i 's/NoDisplay=true/NoDisplay=false/g' /etc/xdg/autostart/*.desktop - -This is just a quick find and replace command that changes the NoDisplay=false with NoDisplay=true in all the programs that are in autostart. Once you do this, open Startup Applications again and now you shall see many more programs here: - -![See Hidden Start up programs in Ubuntu](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/Hidden_startup_program_Ubuntu.jpg) - -You can manage these startup applications the same way which were described earlier. I hope this tutorial helped you to control startup program in Ubuntu. Any questions or suggestions are always welcomed. - --------------------------------------------------------------------------------- - -via: http://itsfoss.com/manage-startup-applications-ubuntu/ - -作者:[Abhishek][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://itsfoss.com/author/abhishek/ -[1]:https://wiki.gnome.org/action/show/Projects/Caribou?action=show&redirect=Caribou -[2]:http://itsfoss.com/applications-manage-wallpapers-ubuntu/ diff --git a/translated/tech/20150722 How To Manage StartUp Applications In Ubuntu.md b/translated/tech/20150722 How To Manage StartUp Applications In Ubuntu.md new file mode 100644 index 0000000000..745a84860a --- /dev/null +++ b/translated/tech/20150722 How To Manage StartUp Applications In Ubuntu.md @@ -0,0 +1,112 @@ +如何在 Ubuntu 中管理开机启动应用 +================================================================================ +![在 Ubuntu 中管理开机启动应用](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/Manage-Start-up-apps-in-Ubuntu.png) + +你曾经考虑过 **在 Ubuntu 中管理开机启动应用** 吗?如果在开机时,你的 Ubuntu 系统启动得非常缓慢,那么你就需要考虑这个问题了。 + +每当你开机进入一个操作系统,一系列的应用将会自动启动。这些应用被称为‘开机启动应用’ 或‘开机启动程序’。随着时间的推移,当你在系统中安装了足够多的应用时,你将发现有太多的‘开机启动应用’在开机时自动地启动了,它们吃掉了很多的系统资源,并将你的系统拖慢。这可能会让你感觉卡顿,我想这种情况并不是你想要的。 + +让 Ubuntu 变得更快的方法之一是对这些开机启动应用进行控制。 Ubuntu 为你提供了一个 GUI 工具来让你发现这些开机启动应用,然后完全禁止或延迟它们的启动,这样就可以不让每个应用在开机时同时运行。 + +在这篇文章中,我们将看到 **在 Ubuntu 中,如何控制开机启动应用,如何让一个应用在开机时启动以及如何发现隐藏的开机启动应用。**这里提供的指导对所有的 Ubuntu 版本均适用,例如 Ubuntu 12.04, Ubuntu 14.04 和 Ubuntu 15.04。 + +### 在 Ubuntu 中管理开机启动应用 ### + +默认情况下, Ubuntu 提供了一个`开机启动应用工具`来供你使用,你不必再进行安装。只需到 Unity 面板中就可以查找到该工具。 + +![ubuntu 中的开机启动应用工具](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/startup_applications_Ubuntu.jpeg) + +点击它来启动。下面是我的`开机启动应用`的样子: + +![在 Ubuntu 中查看开机启动程序](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/Screenshot-from-2015-07-18-122550.png) + +### 在 Ubuntu 中移除开机启动应用 ### + +现在由你来发现哪个程序对你用处不大,对我来说,是 [Caribou][1] 这个软件,它是一个屏幕键盘程序,在开机时它并没有什么用处,所以我想将它移除出开机启动程序的列表中。 + +你可以选择阻止某个程序在开机时启动,而在开机启动程序列表中保留该选项以便以后再进行激活。点击 `关闭`按钮来保留你的偏好设置。 + +![在 Ubuntu 中移除开机启动程序](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/startup_applications_ubuntu_2.png) + +要将一个程序从开机启动程序列表中移除,选择对应的选项然后从窗口右边的面板中点击`移除`按钮来保留你的偏好设置。 + +![在 Ubuntu 中将程序从开机启动列表中移除](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/startup_applications_Ubuntu_1.jpeg) + +需要提醒的是,这并不会将该程序卸载掉,只是让该程序不再在每次开机时自动启动。你可以对所有你不喜欢的程序做类似的处理。 + +### 让开机启动程序延迟启动 ### + +若你并不想在开机启动列表中移除掉程序,但同时又忧虑着系统性能的问题,那么你所需要做的是给程序添加一个延迟启动命令,这样所有的程序就不会在开机时同时启动。 + +选择一个程序然后点击 `编辑` 按钮。 + +![编辑开机启动应用列表](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/startup_applications_ubuntu_3.png) + +这将展示出运行这个特定的程序所需的命令。 + +![在开机启动列表的程序运行所需的命令](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/startup_applications_ubuntu_4.jpg) + +所有你需要做的就是在程序运行命令前添加一句 `sleep XX;` 。这样就为实际运行该命令来启动的对应程序添加了 `XX` 秒的延迟。例如,假如我想让 Variety [壁纸管理应用][2] 延迟启动 2 分钟,我就需要像下面那样在命令前添加 `sleep 120;` + +![在 Ubuntu 中延迟开机启动的程序](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/startup_applications_ubuntu_5.png) + +保存并关闭设置。你将在下一次启动时看到效果。 + +### 增添一个程序到开机启动应用列表中 ### + +这对于新手来说需要一点技巧。我们知道,在 Linux 的底层都是一些命令,在上一节我们看到这些开机启动程序只是在每次开机时运行一些命令。假如你想在开机启动列表中添加一个新的程序,你需要知道运行该应用所需的命令。 + +#### 第 1 步:如何查找运行一个程序所需的命令? #### + +首先来到 Unity Dash 面板然后搜索 `Main Menu`: + +![Ubuntu 下的程序菜单](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/Program_menu_Ubuntu.jpg) + +这将展示出在各种类别下你安装的所有程序。在 Ubuntu 的低版本中,你将看到一个相似的菜单,通过它来选择并运行应用。 + +![Ubuntu 下的 main menu ](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/Main_menu_ubuntu.jpeg) + +在各种类别下找到你找寻的应用,然后点击 `属性` 按钮来查看运行该应用所需的命令。例如,我想在开机时运行 `Transmission Torrent 客户端`。 + +![在 Ubuntu 下查找运行程序所需的命令](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/Main_menu_ubuntu_1.jpeg) + +这就会向我给出运行 `Transmission` 应用的命令: + +![在 Ubuntu 下查找运行某个程序所需的命令](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/startup_programs_commands.png) + +接着,我将用相同的信息来将 `Transmission` 应用添加到开机启动列表中。 + +#### 第 2 步: 添加一个程序到开机启动列表中 #### + +再次来到开机启动应用工具中并点击 `添加` 按钮。这将让你输入一个应用的名称,对应的命令和相关的描述。其中命令最为重要,你可以使用任何你想用的名称和描述。使用上一步得到的命令然后点击 `添加` 按钮。 + +![在 Ubuntu 中添加一个开机启动程序](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/Add_startup_program_Ubuntu.jpg) + +就这样,你将在下一次开机时看到这个程序会自动运行。这就是在 Ubuntu 中你能做的关于开机启动应用的所有事情。 + +到现在为止,我们已经讨论在开机时可见的应用,但仍有更多的服务,守护进程和程序并不在`开机启动应用工具`中可见。下一节中,我们将看到如何在 Ubuntu 中查看这些隐藏的开机启动程序。 + +### 在 Ubuntu 中查看隐藏的开机启动程序 ### + +要查看在开机时哪些服务在运行,可以打开一个终端并使用下面的命令: + + sudo sed -i 's/NoDisplay=true/NoDisplay=false/g' /etc/xdg/autostart/*.desktop + +上面的命令是一个快速查找和替换命令,它将在所有自动启动的程序里的 `NoDisplay=false` 改为 `NoDisplay=true` ,一旦执行了这个命令后,再次打开`开机启动应用工具`,现在你应该可以看到更多的程序: + +![在 Ubuntu 中查看隐藏的开机启动程序](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/Hidden_startup_program_Ubuntu.jpg) + + 你可以像先前我们讨论的那样管理这些开机启动应用。我希望这篇教程可以帮助你在 Ubuntu 中控制开机启动程序。任何的问题或建议总是欢迎的。 +-------------------------------------------------------------------------------- + +via: http://itsfoss.com/manage-startup-applications-ubuntu/ + +作者:[Abhishek][a] +译者:[FSSlc](https://github.com/FSSlc) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://itsfoss.com/author/abhishek/ +[1]:https://wiki.gnome.org/action/show/Projects/Caribou?action=show&redirect=Caribou +[2]:http://itsfoss.com/applications-manage-wallpapers-ubuntu/ From f680bafafc7eab69737ff4695716d920027cf3f8 Mon Sep 17 00:00:00 2001 From: Chang Liu Date: Sun, 26 Jul 2015 10:13:23 +0800 Subject: [PATCH 700/965] Update 20150128 7 communities driving open source development.md --- .../20150128 7 communities driving open source development.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/talk/20150128 7 communities driving open source development.md b/sources/talk/20150128 7 communities driving open source development.md index 3b3c450cf8..c3b6df31d2 100644 --- a/sources/talk/20150128 7 communities driving open source development.md +++ b/sources/talk/20150128 7 communities driving open source development.md @@ -1,3 +1,5 @@ +FSSlc Translating + 7 communities driving open source development ================================================================================ Not so long ago, the open source model was the rebellious kid on the block, viewed with suspicion by established industry players. Today, open initiatives and foundations are flourishing with long lists of vendor committers who see the model as a key to innovation. @@ -83,4 +85,4 @@ via: http://www.networkworld.com/article/2866074/opensource-subnet/7-communities [4]:http://www.openstack.org/foundation/ [5]:http://www.opendaylight.org/ [6]:http://www.apache.org/ -[7]:http://www.opencompute.org/ \ No newline at end of file +[7]:http://www.opencompute.org/ From 00359234b66bcaa1180c48bf5b2190cde4ddcb9d Mon Sep 17 00:00:00 2001 From: geekpi Date: Sun, 26 Jul 2015 11:23:53 +0800 Subject: [PATCH 701/965] translating----geekpi --- ...igure Chef (server or client) on Ubuntu 14.04 or 15.04.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150717 How to Configure Chef (server or client) on Ubuntu 14.04 or 15.04.md b/sources/tech/20150717 How to Configure Chef (server or client) on Ubuntu 14.04 or 15.04.md index 69efa63823..d9257490cf 100644 --- a/sources/tech/20150717 How to Configure Chef (server or client) on Ubuntu 14.04 or 15.04.md +++ b/sources/tech/20150717 How to Configure Chef (server or client) on Ubuntu 14.04 or 15.04.md @@ -1,3 +1,6 @@ +Translating----geekpi + + How to Configure Chef (server/client) on Ubuntu 14.04 / 15.04 ================================================================================ Chef is a configuration management and automation tool for information technology professionals that configures and manages your infrastructure whether it is on-premises or in the cloud. It can be used to speed up application deployment and to coordinate the work of multiple system administrators and developers involving hundreds, or even thousands, of servers and applications to support a large customer base. The key to Chef’s power is that it turns infrastructure into code. Once you master Chef, you will be able to enable web IT with first class support for managing your cloud infrastructure with an easy automation of your internal deployments or end users systems. @@ -311,4 +314,4 @@ via: http://linoxide.com/ubuntu-how-to/install-configure-chef-ubuntu-14-04-15-04 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 -[a]:http://linoxide.com/author/kashifs/ \ No newline at end of file +[a]:http://linoxide.com/author/kashifs/ From d04c8c0c0f3c51baf55c5fb9df131e7834d708b0 Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 26 Jul 2015 12:08:26 +0800 Subject: [PATCH 702/965] PUB:20150410 10 Top Distributions in Demand to Get Your Dream Job @sevenot --- ...butions in Demand to Get Your Dream Job.md | 33 +++++++++---------- 1 file changed, 16 insertions(+), 17 deletions(-) rename {translated/talk => published}/20150410 10 Top Distributions in Demand to Get Your Dream Job.md (83%) diff --git a/translated/talk/20150410 10 Top Distributions in Demand to Get Your Dream Job.md b/published/20150410 10 Top Distributions in Demand to Get Your Dream Job.md similarity index 83% rename from translated/talk/20150410 10 Top Distributions in Demand to Get Your Dream Job.md rename to published/20150410 10 Top Distributions in Demand to Get Your Dream Job.md index b908276fc3..5d0033c457 100644 --- a/translated/talk/20150410 10 Top Distributions in Demand to Get Your Dream Job.md +++ b/published/20150410 10 Top Distributions in Demand to Get Your Dream Job.md @@ -1,25 +1,24 @@ -sevenot translated -10大帮助你获得理想的职业的需求分布 +10 大帮助你获得理想的职业的操作系统技能 ================================================================================ 我们用了5篇系列文章,来让人们意识到那些可以帮助他们获得理想职业的顶级技能。在这个充满竞争的社会里,你不能仅仅依赖一项仅能,你需要在多个职业技能上都有所涉猎。我们并不能权衡这些技能,但是我们可以参考这些几乎不变的惯例和统计数据。 下面的文章和紧跟其后的内容,是针对全球各大IT公司上一季度对员工技能要求的详细调查报告。统计数据真实的反映了需求和市场的变化。我们会尽力让这份报告保持时效性,特别是有明显变化的时候。这五篇系列文章是: --10大帮助你获得理想的职业的需求分布 --[10大帮助你获得职位的著名 IT 技能][1] --10大帮助你获得理想职位的项目技能 --10大帮助你赢得理想职位的网络技能 --10大帮助你获得理想职位的个人认证 +- 10大帮助你获得理想的职业的需求分布 +- [10大帮助你获得职位的著名 IT 技能][1] +- [10大帮助你获得理想职位的项目技能][2] +- [10大帮助你赢得理想职位的网络技能][3] +- [10大帮助你获得理想职位的个人认证][4] ### 1. Windows ### -微软研发的windows操作系统不仅在PC市场上占据龙头地位,而且从职位视角来看也是最枪手的操作系统工作,不管你是赞成还是反对。有资料显示上一季度需求增长达到0.1%. +微软研发的windows操作系统不仅在PC市场上占据龙头地位,而且从职位视角来看也是最抢手的操作系统技能,不管你是赞成还是反对。有资料显示上一季度需求增长达到0.1%. 最新版本 : Windows 8.1 ### 2. Red Hat Enterprise Linux ### -Red Hat Enterprise Linux 是一个商业发行版本的企业级Linux,它由红帽公司研发。它是世界上运用最广的Linux发行版本,特别是在生产环境和协同工作方面。上一季度其整体需求上涨17%,位列第二。 +Red Hat Enterprise Linux 是一个商业的Linux发行版本,它由红帽公司研发。它是世界上运用最广的Linux发行版本之一,特别是在生产环境和协同工作方面。上一季度其整体需求上涨17%,位列第二。 最新版本 : RedHat Enterprise Linux 7.1 @@ -50,9 +49,10 @@ Red Hat Enterprise Linux 是一个商业发行版本的企业级Linux,它由 ### 7. Ubuntu ### 排在第7的是Ubuntu,这是一款由Canonicals公司研发设计的Linux系统,旨在服务于个人。上一季度需求率上涨11%。 + 最新版本 : -- Ubuntu 14.10 (9 months security and maintenance update). +- Ubuntu 14.10 (已有九个月的安全和维护更新). - Ubuntu 14.04.2 LTS ### 8. Suse ### @@ -63,19 +63,16 @@ Red Hat Enterprise Linux 是一个商业发行版本的企业级Linux,它由 ### 9. Debian ### -The very famous Linux Operating System, mother of 100’s of Distro and closest to GNU comes at number nine. -排在第9的是非常有名的 Linux 操作系统Debian,非常贴近GNU。其上一季度需求率上涨9%。 +排在第9的是非常有名的 Linux 操作系统Debian,它是上百种Linux 发行版之母,非常接近GNU理念。其上一季度需求率上涨9%。 最新版本: Debian 7.8 ### 10. HP-UX ### -The Proprietary UNIX Operating System designed by Hewlett-Packard comes at number ten. It has shown a decline in the last quarter by 5%. 排在第10的是Hewlett-Packard公司研发的专用 Linux 操作系统HP-UX,上一季度需求率上涨5%。 最新版本 : 11i v3 Update 13 -注:表格数据--不需要翻译--开始 @@ -133,7 +130,6 @@ The Proprietary UNIX Operating System designed by Hewlett-Packard comes at numbe
-注:表格数据--不需要翻译--结束 以上便是全部信息,我会尽快推出下一篇系列文章,敬请关注Tecmint。不要忘了留下您宝贵的评论。如果您喜欢我们的文章并且与我们分享您的见解,这对我们的工作是一种鼓励。 @@ -143,9 +139,12 @@ via: http://www.tecmint.com/top-distributions-in-demand-to-get-your-dream-job/ 作者:[Avishek Kumar][a] 译者:[sevenot](https://github.com/sevenot) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 [a]:http://www.tecmint.com/author/avishek/ -[1]:http://www.tecmint.com/top-distributions-in-demand-to-get-your-dream-job/www.tecmint.com/famous-it-skills-in-demand-that-will-get-you-hired/ +[1]:http://www.tecmint.com/famous-it-skills-in-demand-that-will-get-you-hired/ +[2]:https://linux.cn/article-5303-1.html +[3]:http://www.tecmint.com/networking-protocols-skills-to-land-your-dream-job/ +[4]:http://www.tecmint.com/professional-certifications-in-demand-that-will-get-you-hired/ From 4b6c767c8691d2c4600fc9169d9a526a0ca4bd80 Mon Sep 17 00:00:00 2001 From: geekpi Date: Sun, 26 Jul 2015 13:26:22 +0800 Subject: [PATCH 703/965] translated----geekpi --- ...ver or client) on Ubuntu 14.04 or 15.04.md | 142 +++++++++--------- 1 file changed, 70 insertions(+), 72 deletions(-) diff --git a/sources/tech/20150717 How to Configure Chef (server or client) on Ubuntu 14.04 or 15.04.md b/sources/tech/20150717 How to Configure Chef (server or client) on Ubuntu 14.04 or 15.04.md index d9257490cf..38574e6fa7 100644 --- a/sources/tech/20150717 How to Configure Chef (server or client) on Ubuntu 14.04 or 15.04.md +++ b/sources/tech/20150717 How to Configure Chef (server or client) on Ubuntu 14.04 or 15.04.md @@ -1,27 +1,23 @@ -Translating----geekpi - - -How to Configure Chef (server/client) on Ubuntu 14.04 / 15.04 +如何在Ubuntu 14.04/15.04上配置Chef(服务端/客户端) ================================================================================ -Chef is a configuration management and automation tool for information technology professionals that configures and manages your infrastructure whether it is on-premises or in the cloud. It can be used to speed up application deployment and to coordinate the work of multiple system administrators and developers involving hundreds, or even thousands, of servers and applications to support a large customer base. The key to Chef’s power is that it turns infrastructure into code. Once you master Chef, you will be able to enable web IT with first class support for managing your cloud infrastructure with an easy automation of your internal deployments or end users systems. +Chef是对于信息技术专业人员的一款配置管理和自动化工具,它可以配置和管理你的设备无论它在本地还是在云上。它可以用于加速应用部署并协调多个系统管理员和开发人员的工作,涉及到成百甚至上千的服务器和程序来支持大量的客户群。chef最有用的是让设备变成代码。一旦你掌握了Chef,你可以获得一流的网络IT支持来自动化管理你的云端设备或者终端用户。 -Here are the major components of Chef that we are going to setup and configure in this tutorial. -chef components +下面是我们将要在本篇中要设置和配置Chef的主要组件。 ![](http://blog.linoxide.com/wp-content/uploads/2015/07/chef.png) -### Chef Prerequisites and Versions ### +### 安装Chef的要求和版本 ### -We are going to setup Chef configuration management system under the following basic environment. +我们将在下面的基础环境下设置Chef配置管理系统。 注:表格 - + - + @@ -37,135 +33,138 @@ We are going to setup Chef configuration management system under the following b - +
Chef, Configuration Management Tool管理和配置工具:Chef
Base Operating System基础操作系统 Ubuntu 14.04.1 LTS (x86_64)
Version 0.6.2
RAM and CPU内存和CPU 4 GB  , 2.0+2.0 GHZ
-### Chef Server's Installation and Configurations ### +### Chef服务端的安装和配置 ### -Chef Server is central core component that stores recipes as well as other configuration data and interact with the workstations and nodes. let's download the installation media by selecting the latest version of chef server from its official web link. +Chef服务端是核心组件,它存储配置以及其他和工作站交互的配置数据。让我们在他们的官网下载最新的安装文件。 -We will get its installation package and install it by using following commands. +我使用下面的命令来下载和安装它。 -**1) Downloading Chef Server** +**1) 下载Chef服务端** root@ubuntu-14-chef:/tmp# wget https://web-dl.packagecloud.io/chef/stable/packages/ubuntu/trusty/chef-server-core_12.1.0-1_amd64.deb -**2) To install Chef Server** +**2) 安装Chef服务端** root@ubuntu-14-chef:/tmp# dpkg -i chef-server-core_12.1.0-1_amd64.deb -**3) Reconfigure Chef Server** +**3) 重新配置Chef服务端** -Now Run the following command to start all of the chef server services ,this step may take a few minutes to complete as its composed of many different services that work together to create a functioning system. +现在运行下面的命令来启动所有的chef服务端服务,这步也许会花费一些时间,因为它有许多不同一起工作的服务组成来创建一个正常运作的系统。 root@ubuntu-14-chef:/tmp# chef-server-ctl reconfigure -The chef server startup command 'chef-server-ctl reconfigure' needs to be run twice so that installation ends with the following completion output. +chef服务端启动命令'chef-server-ctl reconfigure'需要运行两次,这样就会在安装后看到这样的输出。 Chef Client finished, 342/350 resources updated in 113.71139964 seconds opscode Reconfigured! -**4) Reboot OS** +**4) 重启系统 ** -Once the installation complete reboot the operating system for the best working without doing this we you might get the following SSL_connect error during creation of User. +安装完成后重启系统使系统能最好的工作,不然我们或许会在创建用户的时候看到下面的SSL连接错误。 ERROR: Errno::ECONNRESET: Connection reset by peer - SSL_connect -**5) Create new Admin User** +**5) 创建心的管理员** -Run the following command to create a new administrator user with its profile settings. During its creation user’s RSA private key is generated automatically that should be saved to a safe location. The --filename option will save the RSA private key to a specified path. +运行下面的命令来创建一个新的用它自己的配置的管理员账户。创建过程中,用户的RSA私钥会自动生成并需要被保存到一个安全的地方。--file选项会保存RSA私钥到指定的路径下。 root@ubuntu-14-chef:/tmp# chef-server-ctl user-create kashi kashi kashi kashif.fareedi@gmail.com kashi123 --filename /root/kashi.pem -### Chef Manage Setup on Chef Server ### +### Chef服务端的管理设置 ### -Chef Manage is a management console for Enterprise Chef that enables a web-based user interface for visualizing and managing nodes, data bags, roles, environments, cookbooks and role-based access control (RBAC). +Chef Manage是一个针对企业Chef用户的管理控制台,它启用了可视化的web用户界面并可以管理节点、数据包、规则、环境、配置和基于角色的访问控制(RBAC) -**1) Downloading Chef Manage** +**1) 下载Chef Manage** -Copy the link for Chef Manage from the official web site and download the chef manage package. +从官网复制链接病下载chef manage的安装包。 root@ubuntu-14-chef:~# wget https://web-dl.packagecloud.io/chef/stable/packages/ubuntu/trusty/opscode-manage_1.17.0-1_amd64.deb -**2) Installing Chef Manage** +**2) 安装Chef Manage** -Let's install it into the root's home directory with below command. +使用下面的命令在root的家目录下安装它。 root@ubuntu-14-chef:~# chef-server-ctl install opscode-manage --path /root -**3) Restart Chef Manage and Server** +**3) 重启Chef Manage和服务端** -Once the installation is complete we need to restart chef manage and chef server services by executing following commands. +安装完成后我们需要运行下面的命令来重启chef manage和服务端。 root@ubuntu-14-chef:~# opscode-manage-ctl reconfigure root@ubuntu-14-chef:~# chef-server-ctl reconfigure -### Chef Manage Web Console ### +### Chef Manage网页控制台 ### -We can access chef manage web console from the localhost as wel as its fqdn and login with the already created admin user account. +我们可以使用localhost访问网页控制台以及fqdn,并用已经创建的管理员登录 ![chef amanage](http://blog.linoxide.com/wp-content/uploads/2015/07/5-chef-web.png) -**1) Create New Organization with Chef Manage** +**1) Chef Manage创建新的组织 ** -You would be asked to create new organization or accept the invitation from the organizations. Let's create a new organization by providing its short and full name as shown. +你或许被要求创建新的组织或者接受其他阻止的邀请。如下所示,使用缩写和全名来创建一个新的组织。 ![Create Org](http://blog.linoxide.com/wp-content/uploads/2015/07/7-create-org.png) -**2) Create New Organization with Command line** +**2) 用命令行创建心的组织 ** We can also create new Organization from the command line by executing the following command. +我们同样也可以运行下面的命令来创建新的组织。 root@ubuntu-14-chef:~# chef-server-ctl org-create linux Linoxide Linux Org. --association_user kashi --filename linux.pem -### Configuration and setup of Workstation ### +### 设置工作站 ### -As we had done with successful installation of chef server now we are going to setup its workstation to create and configure any recipes, cookbooks, attributes, and other changes that we want to made to our Chef configurations. +我们已经完成安装chef服务端,现在我们可以开始创建任何recipes、cookbooks、属性和其他任何的我们想要对Chef的修改。 -**1) Create New User and Organization on Chef Server** +**1) 在Chef服务端上创建新的用户和组织 ** -In order to setup workstation we create a new user and an organization for this from the command line. +为了设置工作站,我们用命令行创建一个新的用户和组织。 root@ubuntu-14-chef:~# chef-server-ctl user-create bloger Bloger Kashif bloger.kashif@gmail.com bloger123 --filename bloger.pem root@ubuntu-14-chef:~# chef-server-ctl org-create blogs Linoxide Blogs Inc. --association_user bloger --filename blogs.pem -**2) Download Starter Kit for Workstation** +**2) 下载工作站入门套件 ** Now Download and Save starter-kit from the chef manage web console on a workstation and use it to work with Chef server. +在工作站的网页控制台中下面并保存入门套件用于与服务端协同工作 ![Starter Kit](http://blog.linoxide.com/wp-content/uploads/2015/07/8-download-kit.png) -**3) Click to "Proceed" with starter kit download** +**3) 点击"Proceed"下载套件 ** ![starter kit](http://blog.linoxide.com/wp-content/uploads/2015/07/9-download-kit.png) -### Chef Development Kit Setup for Workstation ### +### 对于工作站的Chef开发套件设置 ### -Chef Development Kit is a software package suite with all the development tools need to code Chef. It combines with the best of the breed tools developed by Chef community with Chef Client. +Chef开发套件是一款包含所有开发chef所需工具的软件包。它捆绑了由Chef开发的带Chef客户端的工具。 -**1) Downloading Chef DK** +**1) 下载 Chef DK** We can Download chef development kit from its official web link and choose the required operating system to get its chef development tool kit. +我们可以从它的官网链接中下载开发包,并选择操作系统来得到chef开发包。 ![Chef DK](http://blog.linoxide.com/wp-content/uploads/2015/07/10-CDK.png) -Copy the link and download it with wget command. +复制链接并用wget下载 root@ubuntu-15-WKS:~# wget https://opscode-omnibus-packages.s3.amazonaws.com/ubuntu/12.04/x86_64/chefdk_0.6.2-1_amd64.deb -**1) Chef Development Kit Installatoion** +**1) Chef开发套件安装** -Install chef-development kit using dpkg command +使用dpkg命令安装开发套件 root@ubuntu-15-WKS:~# dpkg -i chefdk_0.6.2-1_amd64.deb -**3) Chef DK Verfication** +**3) Chef DK 验证** -Verify using the below command that the client got installed properly. +使用下面的命令验证客户端是否已经正确安装。 root@ubuntu-15-WKS:~# chef verify @@ -196,9 +195,9 @@ Verify using the below command that the client got installed properly. Verification of component 'chefspec' succeeded. Verification of component 'package installation' succeeded. -**Connecting to Chef Server** +**连接Chef服务端** -We will Create ~/.chef and copy the two user and organization pem files to this folder from chef server. +我们将创建 ~/.chef并从chef服务端复制两个用户和组织的pem文件到chef的文件到这个目录下。 root@ubuntu-14-chef:~# scp bloger.pem blogs.pem kashi.pem linux.pem root@172.25.10.172:/.chef/ @@ -210,9 +209,9 @@ We will Create ~/.chef and copy the two user and organization pem files to this kashi.pem 100% 1678 1.6KB/s 00:00 linux.pem 100% 1678 1.6KB/s 00:00 -**Knife Configurations to Manage your Chef Environment** +** 编辑配置来管理chef环境 ** -Now create "~/.chef/knife.rb" with following content as configured in previous steps. +现在使用下面的内容创建"~/.chef/knife.rb"。 root@ubuntu-15-WKS:/.chef# vim knife.rb current_dir = File.dirname(__FILE__) @@ -228,17 +227,17 @@ Now create "~/.chef/knife.rb" with following content as configured in previous s cache_options( :path => "#{ENV['HOME']}/.chef/checksums" ) cookbook_path ["#{current_dir}/../cookbooks"] -Create "~/cookbooks" folder for cookbooks as specified knife.rb file. +创建knife.rb中指定的“~/cookbooks”文件夹。 root@ubuntu-15-WKS:/# mkdir cookbooks -**Testing with Knife Configurations** +**测试Knife配置** -Run "knife user list" and "knife client list" commands to verify whether knife configuration is working. +运行“knife user list”和“knife client list”来验证knife是否在工作。 root@ubuntu-15-WKS:/.chef# knife user list -You might get the following error while first time you run this command.This occurs because we do not have our Chef server's SSL certificate on our workstation. +第一次运行的时候可能会得到下面的错误,这是因为工作站上还没有chef服务端的SSL证书。 ERROR: SSL Validation failure connecting to host: 172.25.10.173 - SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed ERROR: Could not establish a secure connection to the server. @@ -246,27 +245,26 @@ You might get the following error while first time you run this command.This occ If your Chef Server uses a self-signed certificate, you can use `knife ssl fetch` to make knife trust the server's certificates. -To recover from the above error run the following command to fetch ssl certs and once again run the knife user and client list command and it should be fine then. +要从上面的命令中恢复,运行下面的命令来获取ssl整数并重新运行knife user和client list,这时候应该就可以了。 root@ubuntu-15-WKS:/.chef# knife ssl fetch WARNING: Certificates from 172.25.10.173 will be fetched and placed in your trusted_cert directory (/.chef/trusted_certs). - Knife has no means to verify these are the correct certificates. You should - verify the authenticity of these certificates after downloading. + knife没有办法验证这些是有效的证书。你应该在下载时候验证这些证书的真实性。 - Adding certificate for ubuntu-14-chef.test.com in /.chef/trusted_certs/ubuntu-14-chef_test_com.crt + 在/.chef/trusted_certs/ubuntu-14-chef_test_com.crt下面添加ubuntu-14-chef.test.com的证书。 -Now after fetching ssl certs with above command, let's again run the below command. +在上面的命令取得ssl证书后,接着运行下面的命令。 root@ubuntu-15-WKS:/.chef#knife client list kashi-linux -### New Node Configuration to interact with chef-server ### +### 与chef服务端交互的新的节点 ### -Nodes contain chef-client which performs all the infrastructure automation. So, Its time to begin with adding new servers to our chef environment by Configuring a new node to interact with chef-server after we had Configured chef-server and knife workstation combinations. +节点是执行所有设备自动化的chef客户端。因此是时侯添加新的服务端到我们的chef环境下,在配置完chef-server和knife工作站后配置新的节点与chef-server交互。 -To configure a new node to work with chef server use below command. +我们使用下面的命令来添加新的节点与chef服务端工作。 root@ubuntu-15-WKS:~# knife bootstrap 172.25.10.170 --ssh-user root --ssh-password kashi123 --node-name mydns @@ -293,23 +291,23 @@ To configure a new node to work with chef server use below command. 172.25.10.170 to file /tmp/install.sh.26024/metadata.txt 172.25.10.170 trying wget... -After all we can see the vewly created node under the knife node list and new client list as it it will also creates a new client with the node. +之后我们可以在knife节点列表下看到新创建的节点,也会新节点列表下创建新的客户端。 root@ubuntu-15-WKS:~# knife node list mydns -Similarly we can add multiple number of nodes to our chef infrastructure by providing ssh credentials with the same above knofe bootstrap command. +相似地我们只要提供ssh证书通过上面的knife命令来创建多个节点到chef设备上。 -### Conclusion ### +### 总结 ### -In this detailed article we learnt about the Chef Configuration Management tool with its basic understanding and overview of its components with installation and configuration settings. We hope you have enjoyed learning the installation and configuration of Chef server with its workstation and client nodes. +本篇我们学习了chef管理工具并通过安装和配置设置浏览了它的组件。我希望你在学习安装和配置Chef服务端以及它的工作站和客户端节点中获得乐趣。 -------------------------------------------------------------------------------- via: http://linoxide.com/ubuntu-how-to/install-configure-chef-ubuntu-14-04-15-04/ 作者:[Kashif Siddique][a] -译者:[译者ID](https://github.com/译者ID) +译者:[geekpi](https://github.com/geekpi) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 8193ffd0ddaa727b06c270d0e07d9eed7cfc694c Mon Sep 17 00:00:00 2001 From: geekpi Date: Sun, 26 Jul 2015 13:28:47 +0800 Subject: [PATCH 704/965] Rename sources/tech/20150717 How to Configure Chef (server or client) on Ubuntu 14.04 or 15.04.md to translated/tech/20150717 How to Configure Chef (server or client) on Ubuntu 14.04 or 15.04.md --- ... Configure Chef (server or client) on Ubuntu 14.04 or 15.04.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/20150717 How to Configure Chef (server or client) on Ubuntu 14.04 or 15.04.md (100%) diff --git a/sources/tech/20150717 How to Configure Chef (server or client) on Ubuntu 14.04 or 15.04.md b/translated/tech/20150717 How to Configure Chef (server or client) on Ubuntu 14.04 or 15.04.md similarity index 100% rename from sources/tech/20150717 How to Configure Chef (server or client) on Ubuntu 14.04 or 15.04.md rename to translated/tech/20150717 How to Configure Chef (server or client) on Ubuntu 14.04 or 15.04.md From f3ba8827980d1298be58ad92e758bbf10ae9536f Mon Sep 17 00:00:00 2001 From: struggling <630441839@qq.com> Date: Sun, 26 Jul 2015 15:42:35 +0800 Subject: [PATCH 705/965] Update 20150717 How to collect NGINX metrics - Part 2.md --- .../tech/20150717 How to collect NGINX metrics - Part 2.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150717 How to collect NGINX metrics - Part 2.md b/sources/tech/20150717 How to collect NGINX metrics - Part 2.md index 8d83b3a0f6..eb627649a7 100644 --- a/sources/tech/20150717 How to collect NGINX metrics - Part 2.md +++ b/sources/tech/20150717 How to collect NGINX metrics - Part 2.md @@ -1,3 +1,5 @@ +translation by strugglingyouth + How to collect NGINX metrics - Part 2 ================================================================================ ![](http://www.datadoghq.com/wp-content/uploads/2015/07/NGINX_hero_2.png) @@ -234,4 +236,4 @@ via: https://www.datadoghq.com/blog/how-to-collect-nginx-metrics/ [21]:https://www.datadoghq.com/blog/how-to-monitor-nginx-with-datadog/ [22]:https://www.datadoghq.com/blog/how-to-collect-nginx-metrics/#sign-up [23]:https://github.com/DataDog/the-monitor/blob/master/nginx/how_to_collect_nginx_metrics.md -[24]:https://github.com/DataDog/the-monitor/issues \ No newline at end of file +[24]:https://github.com/DataDog/the-monitor/issues From fc1793e50b26a24eb254fabdf94009c6badf9254 Mon Sep 17 00:00:00 2001 From: wxy Date: Mon, 27 Jul 2015 00:09:22 +0800 Subject: [PATCH 706/965] PUB:20150520 Is Linux Better than OS X GNU Open Source and Apple in History MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @wi-cuckoo 翻译的很不错。 --- ... X GNU Open Source and Apple in History.md | 57 +++++++++++++++++++ ... X GNU Open Source and Apple in History.md | 57 ------------------- 2 files changed, 57 insertions(+), 57 deletions(-) create mode 100644 published/20150520 Is Linux Better than OS X GNU Open Source and Apple in History.md delete mode 100644 translated/talk/20150520 Is Linux Better than OS X GNU Open Source and Apple in History.md diff --git a/published/20150520 Is Linux Better than OS X GNU Open Source and Apple in History.md b/published/20150520 Is Linux Better than OS X GNU Open Source and Apple in History.md new file mode 100644 index 0000000000..fef89825fe --- /dev/null +++ b/published/20150520 Is Linux Better than OS X GNU Open Source and Apple in History.md @@ -0,0 +1,57 @@ +GNU、开源和 Apple 的那些黑历史 +============================================================================== +> 自由软件/开源社区与 Apple 之间的争论可以回溯到上世纪80年代,当时 Linux 的创始人称 Mac OS X 的核心就是“一堆废物”。还有其他一些软件史上的轶事。 + +![](http://thevarguy.com/site-files/thevarguy.com/files/imagecache/medium_img/uploads/2015/05/untitled_2.png) + +开源拥护者们与微软之间有着很长、而且摇摆的关系。每个人都知道这个。但是,在许多方面,自由或者开源软件的支持者们与 Apple 之间的争执则更加突出——尽管这很少受到媒体的关注。 + +需要说明的是,并不是所有的开源拥护者都厌恶苹果。从各种轶事中,我已经见过很多 Linux 的黑客玩耍 iPhone 和iPad。实际上,许多 Linux 用户是十分喜欢 Apple 的 OS X 系统的,以至于他们[创造了很多Linux的发行版][1],都设计得看起来像OS X。(顺便说下,[北朝鲜政府][2]就这样做了。) + +但是 Mac 的信徒与企鹅的信徒——即 Linux 社区(不包括别的,仅指自由与开源软件世界中的这一小部分)之间的关系,并不一直是完全的和谐。并且这绝不是一个新的现象,在我研究Linux和自由软件基金会历史的时候就发现了。 + +### GNU vs. Apple ### + +这场战争将回溯到至少上世纪80年代后期。1988年6月,Richard Stallman 发起了 [GNU][3] 项目,希望建立一个完全自由的类 Unix 操作系统,其源代码将会免费共享,[强烈指责][4] Apple 对 [Hewlett-Packard][5](HPQ)和 [Microsoft][6](MSFT)的诉讼,称Apple的声明中说别人对 Macintosh 操作系统的界面和体验的抄袭是不正确。如果 Apple 流行的话,GNU 警告到,这家公司“将会借助大众的新力量终结掉为取代商业软件而生的自由软件。” + +那个时候,GNU 对抗 Apple 的诉讼(这意味着,十分讽刺的是,GNU 正在支持 Microsoft,尽管当时的情况不一样),通过发布[“让你的律师远离我的电脑”按钮][7]。同时呼吁 GNU 的支持者们抵制 Apple,警告虽然 Macintosh 看起来是不错的计算机,但 Apple 一旦赢得了诉讼就会给市场带来垄断,这会极大地提高计算机的售价。 + +Apple 最终[输掉了这场诉讼][8],但是直到1994年之后,GNU 才[撤销对 Apple 的抵制][9]。这期间,GNU 一直不断指责 Apple。在上世纪90年代早期甚至之后,GNU 开始发展 GNU 软件项目,可以在其他个人电脑平台包括 MS-DOS 计算机上使用。[GNU 宣称][10],除非 Apple 停止在计算机领域垄断的野心,让用户界面可以模仿 Macintosh 的一些东西,否则“我们不会提供任何对 Apple 机器的支持。”(因此讽刺的是 Apple 在90年代后期开发的类 UNIX 系统 OS X 有一大堆软件来自GNU。但是那是另外的故事了。) + +### Torvalds 与 Jobs ### + +除去他对大多数发行版比较自由放任的态度,Linux内核的创造者 Liuns Torvalds 相较于 Stallman 和 GNU 过去对Apple 的态度和善得多。在他 2001 年出版的书”Just For Fun: The Story of an Accidental Revolutionary“中,Torvalds 描述到与 Steve Jobs 的一次会面,大约是 1997 年收到后者的邀请去讨论 Mac OS X,当时 Apple 正在开发中,但还没有公开发布。 + +“基本上,Jobs 一开始就试图告诉我在桌面上的玩家就两个,Microsoft 和 Apple,而且他认为我能为 Linux 做的最好的事,就是从了 Apple,努力让开源用户去支持 Mac OS X” Torvalds 写道。 + +这次会谈显然让 Torvalds 很不爽。争吵的一点集中在 Torvalds 对 Mach 技术上的藐视,对于 Apple 正在用于构建新的 OS X 操作系统的内核,Torvalds 称其“一堆废物。它包含了所有你能做到的设计错误,并且甚至打算只弥补一小部分。” + +但是更令人不快的是,显然是 Jobs 在开发 OS X 时入侵开源的方式(OS X 的核心里上有很多开源程序):“他有点贬低了结构的瑕疵:谁在乎基础操作系统这个真正的 low-core 东西是不是开源,如果你有 Mac 层在最上面,这不是开源?” + +一切的一切,Torvalds 总结到,Jobs “并没有太多争论。他仅仅很简单地说着,胸有成竹地认为我会对与 Apple 合作感兴趣”。“他一无所知,不能去想像还会有人并不关心 Mac 市场份额的增长。我认为他真的感到惊讶了,当我表现出对 Mac 的市场有多大,或者 Microsoft 市场有多大的毫不关心时。” + +当然,Torvalds 并没有对所有 Linux 用户说起过。他对于 OS X 和 Apple 的看法从 2001 年开始就渐渐软化了。但实际上,早在2000年,Linux 社区的领导角色表现出对 Apple 及其高层的傲慢的深深的鄙视,可以看出一些重要的东西,关于 Apple 世界和开源/自由软件世界的矛盾是多么的根深蒂固。 + +从以上两则历史上的花边新闻中,可以看到关于 Apple 产品价值的重大争议,即是否该公司致力于提升其创造的软硬件的质量,或者仅仅是借市场的小聪明获利,让Apple产品卖出更多的钱而不是创造等同其价值的功能。但是不管怎样,我会暂时置身讨论之外。 + +-------------------------------------------------------------------------------- + +via: http://thevarguy.com/open-source-application-software-companies/051815/linux-better-os-x-gnu-open-source-and-apple- + +作者:[Christopher Tozzi][a] +译者:[wi-cuckoo](https://github.com/wi-cuckoo) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://thevarguy.com/author/christopher-tozzi +[1]:https://www.linux.com/news/software/applications/773516-the-mac-ifying-of-the-linux-desktop/ +[2]:http://thevarguy.com/open-source-application-software-companies/010615/north-koreas-red-star-linux-os-made-apples-image +[3]:http://gnu.org/ +[4]:https://www.gnu.org/bulletins/bull5.html +[5]:http://www.hp.com/ +[6]:http://www.microsoft.com/ +[7]:http://www.duntemann.com/AppleSnakeButton.jpg +[8]:http://www.freibrun.com/articles/articl12.htm +[9]:https://www.gnu.org/bulletins/bull18.html#SEC6 +[10]:https://www.gnu.org/bulletins/bull12.html diff --git a/translated/talk/20150520 Is Linux Better than OS X GNU Open Source and Apple in History.md b/translated/talk/20150520 Is Linux Better than OS X GNU Open Source and Apple in History.md deleted file mode 100644 index 667a951f39..0000000000 --- a/translated/talk/20150520 Is Linux Better than OS X GNU Open Source and Apple in History.md +++ /dev/null @@ -1,57 +0,0 @@ -Linux比Mac OS X更好吗?历史中的GNU,开源和Apple -============================================================================== -> 自由软件/开源社区与Apple之间的争论可以回溯到上世纪80年代,当时Linux的创始人称Mac OS X的核心就是"一个废物",还有其他一些软件历史上的轶事。 - -![](http://thevarguy.com/site-files/thevarguy.com/files/imagecache/medium_img/uploads/2015/05/untitled_2.png) - -开源拥护者们与微软之间有着很长,而且摇摆的关系。每个人都知道这个。但是,在许多方面,自由或者开源软件的支持者们与Apple之间的紧张关系则更加突出——尽管这很少受到媒体的关注。 - -需要说明的是,并不是所有的开源拥护者都厌恶苹果。Anecdotally(待译),我已经见过很多Linux的黑客玩弄iPhones和iPads。实际上,许多Linux用户是十分喜欢Apple的OS X系统的,以至于他们[创造了很多Linux的发行版][1],都设计得看起来像OS X。(顺便说下,[北朝鲜政府][2]就这样做了。) - -但是Mac的信徒与企鹅——即Linux社区(未提及自由与开源软件世界的小众群体)的信徒之间的关系,并不一直是完全的和谐。并且这绝不是一个新的现象,在我研究Linux历史和开源基金会的时候就发现了。 - -### GNU vs. Apple ### - -这场战争将回溯到至少上世界80年代后期。1988年6月,Richard Stallman发起了[GNU][3]项目,希望建立一个完全自由的类Unix操作系统,其源代码讲会免费共享,[[强烈指责][4]Apple对[Hewlett-Packard][5](HPQ)和[Microsoft][6](MSFT)的诉讼,称Apple的声明中,说别人对Macintosh操作系统的界面和体验的抄袭是不正确。如果Apple流行,GNU警告到,这家公司“将会借助大众的新力量终结掉自由软件,而自由软件可以成为商业软件的替代品。” - -那个时候,GNU对抗Apple的诉讼(这意味着,十分讽刺的是,GNU正在支持Microsoft,尽管当时的情况不一样),通过发布["让你的律师远离我的电脑”按钮][7]。同时呼吁GNU的支持者们抵制Apple,警告如果Macintoshes看起来是不错的计算机,但Apple一旦赢得了诉讼就会给市场带来垄断,这会极大地提高计算机的售价。 - -Apple最终[输掉了诉讼][8],但是直到1994年之后,GNU才[撤销对Apple的抵制][9]。这期间,GNU一直不断指责Apple。在上世纪90年代早期甚至之后,GNU开始发展GNU软件项目,可以在其他个人电脑平台包括MS-DOS上使用。[GNU 宣称][10],除非Apple停止在计算机领域垄断的野心,让用户界面可以模仿Macintosh的一些东西,否则“我们不会提供任何对Apple机器的支持。”(因此讽刺的是一大堆软件都开发了OS X和类Unix系统的版本,于是Apple在90年代后期介绍这些软件来自GNU。但是那是另外的故事了。) - -### Trovalds on Jobs ### - -除去他对大多数发行版比较自由放任的态度,Liuns Trovalds,Linux内核的创造者,相较于Stallman和GNU过去对Apple的态度没有多一点仁慈。在他2001年出版的书"Just For Fun: The Story of an Accidental Revolutionary"中,Trovalds描述到与Steve Jobs的一个会面,大约是1997年收到后者的邀请去讨论Mac OS X,Apple正在开发,但还没有公开发布。 - -"基本上,Jobs一开始就试图告诉我在桌面上的玩家就两个,Microsoft和Apple,而且他认为我能为Linux做的最好的事,就是从了Apple,努力让开源用户站到Mac OS X后面去"Trovalds写道。 - -这次谈判显然让Trovalds很不爽。争吵的一点集中在Trovalds对Mach技术上的藐视,对于Apple正在用于构建新的OS X操作系统的内核,Trovalds称其“一推废物。它包含了所有你能做到的设计错误,并且甚至打算只弥补一小部分。” - -但是更令人不快的是,显然是Jobs在开发OS X时入侵开源的方式(OS X的核心里上有很多开源程序):“他有点贬低了结构的瑕疵:谁在乎基础操作系统,真正的low-core东西是不是开源,如果你有Mac层在最上面,这不是开源?” - -一切的一切,Trovalds总结到,Jobs“并没有使用太多争论。他仅仅很简单地说着,胸有成竹地认为我会对与Apple合作感兴趣”。“他没有任何线索,不能去想像还会有人并不关心Mac市场份额的增长。我认为他真的感到惊讶了,当我表现出对Mac的市场有多大,或者Microsoft市场有多大的可怜的关心时。” - -当然,Trovalds并没有对所有Linux用户说起。他对于OS X和Apple的看法从2001年开始就渐渐软化了。但实际上,早在2000年,Linux社区的领导角色表现出对Apple和其高层的傲慢的深深的鄙视,可以看出一些重要的东西,关于Apple和开源/自由软件世界的矛盾是多么的根深蒂固。 - -从以上两则历史上的花边新闻中,可以看到关于Apple产品价值的重大争议,即是否该公司致力于提升软硬件的质量,或者仅仅是借市场的小聪明获利,后者会让Apple产品卖出更多的钱,**********(该处不知如何翻译)。但是不管怎样,我会暂时置身讨论之外。 - --------------------------------------------------------------------------------- - -via: http://thevarguy.com/open-source-application-software-companies/051815/linux-better-os-x-gnu-open-source-and-apple- - -作者:[Christopher Tozzi][a] -译者:[wi-cuckoo](https://github.com/wi-cuckoo) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://thevarguy.com/author/christopher-tozzi -[1]:https://www.linux.com/news/software/applications/773516-the-mac-ifying-of-the-linux-desktop/ -[2]:http://thevarguy.com/open-source-application-software-companies/010615/north-koreas-red-star-linux-os-made-apples-image -[3]:http://gnu.org/ -[4]:https://www.gnu.org/bulletins/bull5.html -[5]:http://www.hp.com/ -[6]:http://www.microsoft.com/ -[7]:http://www.duntemann.com/AppleSnakeButton.jpg -[8]:http://www.freibrun.com/articles/articl12.htm -[9]:https://www.gnu.org/bulletins/bull18.html#SEC6 -[10]:https://www.gnu.org/bulletins/bull12.html From 97e33d764177e7d95bba17e48334705058771534 Mon Sep 17 00:00:00 2001 From: joeren Date: Mon, 27 Jul 2015 08:16:44 +0800 Subject: [PATCH 707/965] Update 20150612 How to Configure Swarm Native Clustering for Docker.md --- ...0612 How to Configure Swarm Native Clustering for Docker.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150612 How to Configure Swarm Native Clustering for Docker.md b/sources/tech/20150612 How to Configure Swarm Native Clustering for Docker.md index d07cd26428..0cf3d9cbb7 100644 --- a/sources/tech/20150612 How to Configure Swarm Native Clustering for Docker.md +++ b/sources/tech/20150612 How to Configure Swarm Native Clustering for Docker.md @@ -1,3 +1,4 @@ +Translating by GOLinux! How to Configure Swarm Native Clustering for Docker ================================================================================ Hi everyone, today we'll learn about Swarm and how we can create native clusters using Docker with Swarm. [Docker Swarm][1] is a native clustering program for Docker which turns a pool of Docker hosts into a single virtual host. Swarm serves the standard Docker API, so any tool which can communicate with a Docker daemon can use Swarm to transparently scale to multiple hosts. Swarm follows the "batteries included but removable" principle as other Docker Projects. It ships with a simple scheduling backend out of the box, and as initial development settles, an API will develop to enable pluggable backends. The goal is to provide a smooth out-of-box experience for simple use cases, and allow swapping in more powerful backends, like Mesos, for large scale production deployments. Swarm is extremely easy to setup and get started. @@ -92,4 +93,4 @@ via: http://linoxide.com/linux-how-to/configure-swarm-clustering-docker/ 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 [a]:http://linoxide.com/author/arunp/ -[1]:https://docs.docker.com/swarm/ \ No newline at end of file +[1]:https://docs.docker.com/swarm/ From a41db0b179ec43989557861872c2ec8204a4f656 Mon Sep 17 00:00:00 2001 From: GOLinux Date: Mon, 27 Jul 2015 09:31:05 +0800 Subject: [PATCH 708/965] [Translated]20150612 How to Configure Swarm Native Clustering for Docker.md --- ...gure Swarm Native Clustering for Docker.md | 96 ------------------- ...gure Swarm Native Clustering for Docker.md | 95 ++++++++++++++++++ 2 files changed, 95 insertions(+), 96 deletions(-) delete mode 100644 sources/tech/20150612 How to Configure Swarm Native Clustering for Docker.md create mode 100644 translated/tech/20150612 How to Configure Swarm Native Clustering for Docker.md diff --git a/sources/tech/20150612 How to Configure Swarm Native Clustering for Docker.md b/sources/tech/20150612 How to Configure Swarm Native Clustering for Docker.md deleted file mode 100644 index 0cf3d9cbb7..0000000000 --- a/sources/tech/20150612 How to Configure Swarm Native Clustering for Docker.md +++ /dev/null @@ -1,96 +0,0 @@ -Translating by GOLinux! -How to Configure Swarm Native Clustering for Docker -================================================================================ -Hi everyone, today we'll learn about Swarm and how we can create native clusters using Docker with Swarm. [Docker Swarm][1] is a native clustering program for Docker which turns a pool of Docker hosts into a single virtual host. Swarm serves the standard Docker API, so any tool which can communicate with a Docker daemon can use Swarm to transparently scale to multiple hosts. Swarm follows the "batteries included but removable" principle as other Docker Projects. It ships with a simple scheduling backend out of the box, and as initial development settles, an API will develop to enable pluggable backends. The goal is to provide a smooth out-of-box experience for simple use cases, and allow swapping in more powerful backends, like Mesos, for large scale production deployments. Swarm is extremely easy to setup and get started. - -So, here are some features of Swarm 0.2 out of the box. - -1. Swarm 0.2.0 is about 85% compatible with the Docker Engine. -2. It supports Resource Management. -3. It has Advanced Scheduling feature with constraints and affinities. -4. It supports multiple Discovery Backends (hubs, consul, etcd, zookeeper) -5. It uses TLS encryption method for security and authentication. - -So, here are some very simple and easy steps on how we can use Swarm. - -### 1. Pre-requisites to run Swarm ### - -We must install Docker 1.4.0 or later on all nodes. While each node's IP need not be public, the Swarm manager must be able to access each node across the network. - -Note: Swarm is currently in beta, so things are likely to change. We don't recommend you use it in production yet. - -### 2. Creating Swarm Cluster ### - -Now, we'll create swarm cluster by running the below command. Each node will run a swarm node agent. The agent registers the referenced Docker daemon, monitors it, and updates the discovery backend with the node's status. The below command returns a token which is a unique cluster id, it will be used when starting the Swarm Agent on nodes. - - # docker run swarm create - -![Creating Swarm Cluster](http://blog.linoxide.com/wp-content/uploads/2015/05/creating-swarm-cluster.png) - -### 3. Starting the Docker Daemon in each nodes ### - -We'll need to login into each node that we'll use to create clusters and start the Docker Daemon into it using flag -H . It ensures that the docker remote API on the node is available over TCP for the Swarm Manager. To do start the docker daemon, we'll need to run the following command inside the nodes. - - # docker -H tcp://0.0.0.0:2375 -d - -![Starting Docker Daemon](http://blog.linoxide.com/wp-content/uploads/2015/05/starting-docker-daemon.png) - -### 4. Adding the Nodes ### - -After enabling Docker Daemon, we'll need to add the Swarm Nodes to the discovery service. We must ensure that node's IP must be accessible from the Swarm Manager. To do so, we'll need to run the following command. - - # docker run -d swarm join --addr=:2375 token:// - -![Adding Nodes to Cluster](http://blog.linoxide.com/wp-content/uploads/2015/05/adding-nodes-to-cluster.png) - -**Note**: Here, we'll need to replace and with the IP address of the Node and the cluster ID we got from step 2. - -### 5. Starting the Swarm Manager ### - -Now, as we have got the nodes connected to the cluster. Now, we'll start the swarm manager, we'll need to run the following command in the node. - - # docker run -d -p :2375 swarm manage token:// - -![Starting Swarm Manager](http://blog.linoxide.com/wp-content/uploads/2015/05/starting-swarm-manager.png) - -### 6. Checking the Configuration ### - -Once the manager is running, we can check the configuration by running the following command. - - # docker -H tcp:// info - -![Accessing Swarm Clusters](http://blog.linoxide.com/wp-content/uploads/2015/05/accessing-swarm-cluster.png) - -**Note**: We'll need to replace with the ip address and port of the host running the swarm manager. - -### 7. Using the docker CLI to access nodes ### - -After everything is done perfectly as explained above, this part is the most important part of the Docker Swarm. We can use Docker CLI to access the nodes and run containers on them. - - # docker -H tcp:// info - # docker -H tcp:// run ... - -### 8. Listing nodes in the cluster ### - -We can get a list of all of the running nodes using the swarm list command. - - # docker run --rm swarm list token:// - -![Listing Swarm Nodes](http://blog.linoxide.com/wp-content/uploads/2015/05/listing-swarm-nodes.png) - -### Conclusion ### - -Swarm is really an awesome feature of docker that can be used for creating and managing clusters. It is pretty easy to setup and use. It is more beautiful when we use constraints and affinities on top of it. Advanced Scheduling is an awesome feature of it which applies filters to exclude nodes with ports, labels, health and it uses strategies to pick the best node. So, if you have any questions, comments, feedback please do write on the comment box below and let us know what stuffs needs to be added or improved. Thank You! Enjoy :-) - --------------------------------------------------------------------------------- - -via: http://linoxide.com/linux-how-to/configure-swarm-clustering-docker/ - -作者:[Arun Pyasi][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://linoxide.com/author/arunp/ -[1]:https://docs.docker.com/swarm/ diff --git a/translated/tech/20150612 How to Configure Swarm Native Clustering for Docker.md b/translated/tech/20150612 How to Configure Swarm Native Clustering for Docker.md new file mode 100644 index 0000000000..82849b4661 --- /dev/null +++ b/translated/tech/20150612 How to Configure Swarm Native Clustering for Docker.md @@ -0,0 +1,95 @@ +为Docker配置Swarm本地集群 +================================================================================ +嗨,大家好。今天我们来学一学Swarm相关的内容吧,我们将学习通过Swarm来创建Docker本地集群。[Docker Swarm][1]是用于Docker的本地集群项目,它可以将Docker主机池转换成单个的虚拟主机。Swarm提供了标准的Docker API,所以任何可以和Docker守护进程通信的工具都可以使用Swarm来透明地规模化多个主机。Swarm遵循“包含电池并可拆卸”的原则,就像其它Docker项目一样。它附带有一个开箱即用的简单的后端调度程序,而且作为初始开发套件,也为其开发了一个可启用即插即用后端的API。其目标在于为一些简单的使用情况提供一个平滑的、开箱即用的体验,并且它允许在更强大的后端,如Mesos,中开启交换,以达到大量生产部署的目的。Swarm配置和使用极其简单。 + +这里给大家提供Swarm 0.2开箱的即用一些特性。 + +1. Swarm 0.2.0大约85%与Docker引擎兼容。 +2. 它支持资源管理。 +3. 它具有一些带有限制器和类同器高级调度特性。 +4. 它支持多个发现后端(hubs,consul,etcd,zookeeper) +5. 它使用TLS加密方法进行安全通信和验证。 + +那么,我们来看一看Swarm的一些相当简单而简易的使用步骤吧。 + +### 1. 运行Swarm的先决条件 ### + +我们必须在所有节点安装Docker 1.4.0或更高版本。虽然哥哥节点的IP地址不需要要公共地址,但是Swarm管理器必须可以通过网络访问各个节点。 + +注意:Swarm当前还处于beta版本,因此功能特性等还有可能发生改变,我们不推荐你在生产环境中使用。 + +### 2. 创建Swarm集群 ### + +现在,我们将通过运行下面的命令来创建Swarm集群。各个节点都将运行一个swarm节点代理,该代理会注册、监控相关的Docker守护进程,并更新发现后端获取的节点状态。下面的命令会返回一个唯一的集群ID标记,在启动节点上的Swarm代理时会用到它。 + + # docker run swarm create + +![Creating Swarm Cluster](http://blog.linoxide.com/wp-content/uploads/2015/05/creating-swarm-cluster.png) + +### 3. 启动各个节点上的Docker守护进程 ### + +我们需要使用-H标记登陆进我们将用来创建几圈和启动Docker守护进程的各个节点,它会保证Swarm管理器能够通过TCP访问到各个节点上的Docker远程API。要启动Docker守护进程,我们需要在各个节点内部运行以下命令。 + + # docker -H tcp://0.0.0.0:2375 -d + +![Starting Docker Daemon](http://blog.linoxide.com/wp-content/uploads/2015/05/starting-docker-daemon.png) + +### 4. 添加节点 ### + +在启用Docker守护进程后,我们需要添加Swarm节点到发现服务,我们必须确保节点IP可从Swarm管理器访问到。要完成该操作,我们需要运行以下命令。 + + # docker run -d swarm join --addr=:2375 token:// + +![Adding Nodes to Cluster](http://blog.linoxide.com/wp-content/uploads/2015/05/adding-nodes-to-cluster.png) + +** 注意**:我们需要用步骤2中获取到的节点IP地址和集群ID替换这里的。 + +### 5. 开启Swarm管理器 ### + +现在,由于我们已经获得了连接到集群的节点,我们将启动swarm管理器。我们需要在节点中运行以下命令。 + + # docker run -d -p :2375 swarm manage token:// + +![Starting Swarm Manager](http://blog.linoxide.com/wp-content/uploads/2015/05/starting-swarm-manager.png) + +### 6. 检查配置 ### + +一旦管理运行起来后,我们可以通过运行以下命令来检查配置。 + + # docker -H tcp:// info + +![Accessing Swarm Clusters](http://blog.linoxide.com/wp-content/uploads/2015/05/accessing-swarm-cluster.png) + +** 注意**:我们需要替换为运行swarm管理器的主机的IP地址和端口。 + +### 7. 使用docker CLI来访问节点 ### + +在一切都像上面说得那样完美地完成后,这一部分是Docker Swarm最为重要的部分。我们可以使用Docker CLI来访问节点,并在节点上运行容器。 + + # docker -H tcp:// info + # docker -H tcp:// run ... + +### 8. 监听集群中的节点 ### + +我们可以使用swarm list命令来获取所有运行中节点的列表。 + + # docker run --rm swarm list token:// + +![Listing Swarm Nodes](http://blog.linoxide.com/wp-content/uploads/2015/05/listing-swarm-nodes.png) + +### 尾声 ### + +Swarm真的是一个有着相当不错的功能的docker,它可以用于创建和管理集群。它相当易于配置和使用,当我们在它上面使用限制器和类同器师它更为出色。高级调度程序是一个相当不错的特性,它可以应用过滤器来通过端口、标签、健康状况来排除节点,并且它使用策略来挑选最佳节点。那么,如果你有任何问题、评论、反馈,请在下面的评论框中写出来吧,好让我们知道哪些材料需要补充或改进。谢谢大家了!尽情享受吧 :-) + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/linux-how-to/configure-swarm-clustering-docker/ + +作者:[Arun Pyasi][a] +译者:[GOLinux](https://github.com/GOLinux) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://linoxide.com/author/arunp/ +[1]:https://docs.docker.com/swarm/ From 4106ff98c00ea84ea431bb254c5699d09671790d Mon Sep 17 00:00:00 2001 From: Jindong Huang Date: Mon, 27 Jul 2015 13:24:26 +0800 Subject: [PATCH 709/965] Delete 20150515 Install Plex Media Server On Ubuntu or CentOS 7.1 or Fedora 22.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 翻译完毕 --- ...er On Ubuntu or CentOS 7.1 or Fedora 22.md | 193 ------------------ 1 file changed, 193 deletions(-) delete mode 100644 sources/tech/20150515 Install Plex Media Server On Ubuntu or CentOS 7.1 or Fedora 22.md diff --git a/sources/tech/20150515 Install Plex Media Server On Ubuntu or CentOS 7.1 or Fedora 22.md b/sources/tech/20150515 Install Plex Media Server On Ubuntu or CentOS 7.1 or Fedora 22.md deleted file mode 100644 index 1567211cd5..0000000000 --- a/sources/tech/20150515 Install Plex Media Server On Ubuntu or CentOS 7.1 or Fedora 22.md +++ /dev/null @@ -1,193 +0,0 @@ -Translating by dingdongnigetou - -Install Plex Media Server On Ubuntu / CentOS 7.1 / Fedora 22 -================================================================================ -In this article we will show you how easily you can setup Plex Home Media Server on major Linux distributions with their latest releases. After its successful installation of Plex you will be able to use your centralized home media playback system that streams its media to many Plex player Apps and the Plex Home will allows you to setup your environment by adding your devices and to setup a group of users that all can use Plex Together. So let’s start its installation first on Ubuntu 15.04. - -### Basic System Resources ### - -System resources mainly depend on the type and number of devices that you are planning to connect with the server. So according to our requirements we will be using as following system resources and software for a standalone server. - -注:表格 - - - - - - - - - - - - - - - - - - - - - - -
Plex Home Media Server
Base Operating SystemUbuntu 15.04 / CentOS 7.1 / Fedora 22 Work Station
Plex Media ServerVersion 0.9.12.3.1173-937aac3
RAM and CPU1 GB  , 2.0 GHZ
Hard Disk30 GB
- -### Plex Media Server 0.9.12.3 on Ubuntu 15.04 ### - -We are now ready to start the installations process of Plex Media Server on Ubuntu so let’s start with the following steps to get it ready. - -#### Step 1: System Update #### - -Login to your server with root privileges Make your that your system is upto date if not then do by using below command. - - root@ubuntu-15:~#apt-get update - -#### Step 2: Download the Latest Plex Media Server Package #### - -Create a new directory and download .deb plex Media Package in it from the official website of Plex for Ubuntu using wget command. - - root@ubuntu-15:~# cd /plex/ - root@ubuntu-15:/plex# - root@ubuntu-15:/plex# wget https://downloads.plex.tv/plex-media-server/0.9.12.3.1173-937aac3/plexmediaserver_0.9.12.3.1173-937aac3_amd64.deb - -#### Step 3: Install the Debian Package of Plex Media Server #### - -Now within the same directory run following command to start installation of debian package and then check the status of plekmediaserver. - - root@ubuntu-15:/plex# dpkg -i plexmediaserver_0.9.12.3.1173-937aac3_amd64.deb - ----------- - - root@ubuntu-15:~# service plexmediaserver status - -![Plexmediaserver Service](http://blog.linoxide.com/wp-content/uploads/2015/06/plex-status.png) - -### Plex Home Media Web App Setup on Ubuntu 15.04 ### - -Let's open your web browser within your localhost network and open the Web Interface with your localhost IP and port 32400 and do following steps to configure it: - - http://172.25.10.179:32400/web - http://localhost:32400/web - -#### Step 1:Sign UP before Login #### - -After you have access to the web interface of Plesk Media Server make sure to Sign Up and set your username email ID and Password to login as. - -![Plex Sign In](http://blog.linoxide.com/wp-content/uploads/2015/06/PMS-Login.png) - -#### Step 2: Enter Your Pin to Secure Your Plex Media Home User #### - -![Plex User Pin](http://blog.linoxide.com/wp-content/uploads/2015/06/333.png) - -Now you have successfully configured your user under Plex Home Media. - -![Welcome To Plex](http://blog.linoxide.com/wp-content/uploads/2015/06/3333.png) - -### Opening Plex Web App on Devices Other than Localhost Server ### - -As we have seen in our Plex media home page that it indicates that "You do not have permissions to access this server". Its because of we are on a different network than the Server computer. - -![Plex Server Permissions](http://blog.linoxide.com/wp-content/uploads/2015/06/33.png) - -Now we need to resolve this permissions issue so that we can have access to server on the devices other than the hosted server by doing following setup. - -### Setup SSH Tunnel for Windows System to access Linux Server ### - -First we need to set up a SSH tunnel so that we can access things as if they were local. This is only necessary for the initial setup. - -If you are using Windows as your local system and server on Linux then we can setup SSH-Tunneling using Putty as shown. - -![Plex SSH Tunnel](http://blog.linoxide.com/wp-content/uploads/2015/06/ssh-tunnel.png) - -**Once you have the SSH tunnel set up:** - -Open your Web browser window and type following URL in the address bar. - - http://localhost:8888/web - -The browser will connect to the server and load the Plex Web App with same functionality as on local. -Agree to the terms of Services and start - -![Agree to Plex term](http://blog.linoxide.com/wp-content/uploads/2015/06/5.png) - -Now a fully functional Plex Home Media Server is ready to add new media libraries, channels, playlists etc. - -![PMS Settings](http://blog.linoxide.com/wp-content/uploads/2015/06/8.png) - -### Plex Media Server 0.9.12.3 on CentOS 7.1 ### - -We will follow the same steps on CentOS-7.1 that we did for the installation of Plex Home Media Server on Ubuntu 15.04. - -So lets start with Plex Media Servers Package Installation. - -#### Step 1: Plex Media Server Installation #### - -To install Plex Media Server on centOS 7.1 we need to download the .rpm package from the official website of Plex. So we will use wget command to download .rpm package for this purpose in a new directory. - - [root@linux-tutorials ~]# cd /plex - [root@linux-tutorials plex]# wget https://downloads.plex.tv/plex-media-server/0.9.12.3.1173-937aac3/plexmediaserver-0.9.12.3.1173-937aac3.x86_64.rpm - -#### Step 2: Install .RPM Package #### - -After completion of complete download package we will install this package using rpm command within the same direcory where we installed the .rpm package. - - [root@linux-tutorials plex]# ls - plexmediaserver-0.9.12.3.1173-937aac3.x86_64.rpm - [root@linux-tutorials plex]# rpm -i plexmediaserver-0.9.12.3.1173-937aac3.x86_64.rpm - -#### Step 3: Start Plexmediaservice #### - -We have successfully installed Plex Media Server Now we just need to restart its service and then enable it permanently. - - [root@linux-tutorials plex]# systemctl start plexmediaserver.service - [root@linux-tutorials plex]# systemctl enable plexmediaserver.service - [root@linux-tutorials plex]# systemctl status plexmediaserver.service - -### Plex Home Media Web App Setup on CentOS-7.1 ### - -Now we just need to repeat all steps that we performed during the Web app setup of Ubuntu. -So let's Open a new window in your web browser and access the Plex Media Server Web app using localhost or IP or your Plex server. - - http://172.20.3.174:32400/web - http://localhost:32400/web - -Then to get full permissions on the server you need to repeat the steps to create the SSH-Tunnel. -After signing up with new user account we will be able to access its all features and can add new users, add new libraries and setup it per our needs. - -![Plex Device Centos](http://blog.linoxide.com/wp-content/uploads/2015/06/plex-devices-centos.png) - -### Plex Media Server 0.9.12.3 on Fedora 22 Work Station ### - -The Basic steps to download and install Plex Media Server are the same as its we did for in CentOS 7.1. -We just need to download its .rpm package and then install it with rpm command. - -![PMS Installation](http://blog.linoxide.com/wp-content/uploads/2015/06/plex-on-fedora.png) - -### Plex Home Media Web App Setup on Fedora 22 Work Station ### - -We had setup Plex Media Server on the same host so we don't need to setup SSH-Tunnel in this time scenario. Just open the web browser in your Fedora 22 Workstation with default port 32400 of Plex Home Media Server and accept the Plex Terms of Services Agreement. - -![Plex Agreement](http://blog.linoxide.com/wp-content/uploads/2015/06/Plex-Terms.png) - -**Welcome to Plex Home Media Server on Fedora 22 Workstation** - -Lets login with your plex account and start with adding your libraries for your favorite movie channels , create your playlists, add your photos and enjoy with many other features of Plex Home Media Server. - -![Plex Add Libraries](http://blog.linoxide.com/wp-content/uploads/2015/06/create-library.png) - -### Conclusion ### - -We had successfully installed and configured Plex Media Server on Major Linux Distributions. So, Plex Home Media Server has always been a best choice for media management. Its so simple to setup on cross platform as we did for Ubuntu, CentOS and Fedora. It has simplifies the tasks of organizing your media content and streaming to other computers and devices then to share it with your friends. - --------------------------------------------------------------------------------- - -via: http://linoxide.com/tools/install-plex-media-server-ubuntu-centos-7-1-fedora-22/ - -作者:[Kashif Siddique][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://linoxide.com/author/kashifs/ From baa2ea46dafd6edd8c1dd34ca455e034abdfb7af Mon Sep 17 00:00:00 2001 From: Jindong Huang Date: Mon, 27 Jul 2015 13:27:22 +0800 Subject: [PATCH 710/965] Create Install Plex Media Server On Ubuntu or CentOS 7.1 or Fedora 22.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 翻译完毕 --- ...er On Ubuntu or CentOS 7.1 or Fedora 22.md | 190 ++++++++++++++++++ 1 file changed, 190 insertions(+) create mode 100644 translated/tech/Install Plex Media Server On Ubuntu or CentOS 7.1 or Fedora 22.md diff --git a/translated/tech/Install Plex Media Server On Ubuntu or CentOS 7.1 or Fedora 22.md b/translated/tech/Install Plex Media Server On Ubuntu or CentOS 7.1 or Fedora 22.md new file mode 100644 index 0000000000..813057798b --- /dev/null +++ b/translated/tech/Install Plex Media Server On Ubuntu or CentOS 7.1 or Fedora 22.md @@ -0,0 +1,190 @@ + +如何在 Ubuntu/CentOS7.1/Fedora22 上安装 Plex Media Server ? +================================================================================ +在本文中我们将会向你展示如何容易地在主流的最新发布的Linux发行版上安装Plex Home Media Server。在Plex安装成功后你将可以使用你的集中式家庭媒体播放系统,该系统能让多个Plex播放器App共享它的媒体资源,并且该系统允许你设置你的环境,通过增加你的设备以及设置一个可以一起使用Plex的用户组。让我们首先在Ubuntu15.04上开始Plex的安装。 + +### 基本的系统资源 ### + +系统资源主要取决于你打算用来连接服务的设备类型和数量, 所以根据我们的需求我们将会在一个单独的服务器上使用以下系统资源。 + +注:表格 + + + + + + + + + + + + + + + + + + + + + + +
Plex Home Media Server
Base Operating SystemUbuntu 15.04 / CentOS 7.1 / Fedora 22 Work Station
Plex Media ServerVersion 0.9.12.3.1173-937aac3
RAM and CPU1 GB  , 2.0 GHZ
Hard Disk30 GB
+ +### 在Ubuntu 15.04上安装Plex Media Server 0.9.12.3 ### + +我们现在准备开始在Ubuntu上安装Plex Media Server,让我们从下面的步骤开始来让Plex做好准备。 + +#### 步骤 1: 系统更新 #### + +用root权限登陆你的服务器。确保你的系统是最新的,如果不是就使用下面的命令。 + + root@ubuntu-15:~#apt-get update + +#### 步骤 2: 下载最新的Plex Media Server包 #### + +创建一个新目录,用wget命令从Plex官网下载为Ubuntu提供的.deb包并放入该目录中。 + + root@ubuntu-15:~# cd /plex/ + root@ubuntu-15:/plex# + root@ubuntu-15:/plex# wget https://downloads.plex.tv/plex-media-server/0.9.12.3.1173-937aac3/plexmediaserver_0.9.12.3.1173-937aac3_amd64.deb + +#### 步骤 3: 安装Plex Media Server的Debian包 #### + +现在在相同的目录下执行下面的命令来开始debian包的安装, 然后检查plexmediaserver(译者注: 原文plekmediaserver, 明显笔误)的状态。 + + root@ubuntu-15:/plex# dpkg -i plexmediaserver_0.9.12.3.1173-937aac3_amd64.deb + +---------- + + root@ubuntu-15:~# service plexmediaserver status + +![Plexmediaserver Service](http://blog.linoxide.com/wp-content/uploads/2015/06/plex-status.png) + +### 在Ubuntu 15.04上设置Plex Home Media Web应用 ### + +让我们在你的本地网络主机中打开web浏览器, 并用你的本地主机IP以及端口32400来打开Web界面并完成以下步骤来配置Plex。 + + http://172.25.10.179:32400/web + http://localhost:32400/web + +#### 步骤 1: 登陆前先注册 #### + +在你访问到Plex Media Server的Web界面之后(译者注: 原文是Plesk, 应该是笔误), 确保注册并填上你的用户名(译者注: 原文username email ID感觉怪怪:))和密码来登陆。 + +![Plex Sign In](http://blog.linoxide.com/wp-content/uploads/2015/06/PMS-Login.png) + +#### 输入你的PIN码来保护你的Plex Home Media用户(译者注: 原文Plex Media Home, 个人觉得专业称谓应该保持一致) #### + +![Plex User Pin](http://blog.linoxide.com/wp-content/uploads/2015/06/333.png) + +现在你已经成功的在Plex Home Media下配置你的用户。 + +![Welcome To Plex](http://blog.linoxide.com/wp-content/uploads/2015/06/3333.png) + +### 在设备上而不是本地服务器上打开Plex Web应用 ### + +正如我们在Plex Media主页看到的表明"你没有权限访问这个服务"。 这是因为我们跟服务器计算机不在同个网络。 + +![Plex Server Permissions](http://blog.linoxide.com/wp-content/uploads/2015/06/33.png) + +现在我们需要解决这个权限问题以便我们通过设备访问服务器而不是通过托管服务器(Plex服务器), 通过完成下面的步骤。 + +### 设置SSH隧道使Windows系统访问到Linux服务器 ### + +首先我们需要建立一条SSH隧道以便我们访问远程服务器资源,就好像资源在本地一样。 这仅仅是必要的初始设置。 + +如果你正在使用Windows作为你的本地系统,Linux作为服务器,那么我们可以参照下图通过Putty来设置SSH隧道。 +(译者注: 首先要在Putty的Session中用Plex服务器IP配置一个SSH的会话,才能进行下面的隧道转发规则配置。 +然后点击“Open”,输入远端服务器用户名密码, 来保持SSH会话连接。) + +![Plex SSH Tunnel](http://blog.linoxide.com/wp-content/uploads/2015/06/ssh-tunnel.png) + +**一旦你完成SSH隧道设置:** + +打开你的Web浏览器窗口并在地址栏输入下面的URL。 + + http://localhost:8888/web + +浏览器将会连接到Plex服务器并且加载与服务器本地功能一致的Plex Web应用。 同意服务条款并开始。 + +![Agree to Plex term](http://blog.linoxide.com/wp-content/uploads/2015/06/5.png) + +现在一个功能齐全的Plex Home Media Server已经准备好添加新的媒体库、频道、播放列表等资源。 + +![PMS Settings](http://blog.linoxide.com/wp-content/uploads/2015/06/8.png) + +### 在CentOS 7.1上安装Plex Media Server 0.9.12.3 ### + +我们将会按照上述在Ubuntu15.04上安装Plex Home Media Server的步骤来将Plex安装到CentOS 7.1上。 + +让我们从安装Plex Media Server开始。 + +#### 步骤1: 安装Plex Media Server #### + +为了在CentOS7.1上安装Plex Media Server,我们需要从Plex官网下载rpm安装包。 因此我们使用wget命令来将rpm包下载到一个新的目录下。 + + [root@linux-tutorials ~]# cd /plex + [root@linux-tutorials plex]# wget https://downloads.plex.tv/plex-media-server/0.9.12.3.1173-937aac3/plexmediaserver-0.9.12.3.1173-937aac3.x86_64.rpm + +#### 步骤2: 安装RPM包 #### + +在完成安装包完整的下载之后, 我们将会使用rpm命令在相同的目录下安装这个rpm包。 + + [root@linux-tutorials plex]# ls + plexmediaserver-0.9.12.3.1173-937aac3.x86_64.rpm + [root@linux-tutorials plex]# rpm -i plexmediaserver-0.9.12.3.1173-937aac3.x86_64.rpm + +#### 步骤3: 启动Plexmediaservice #### + +我们已经成功地安装Plex Media Server, 现在我们只需要重启它的服务然后让它永久地启用。 + + [root@linux-tutorials plex]# systemctl start plexmediaserver.service + [root@linux-tutorials plex]# systemctl enable plexmediaserver.service + [root@linux-tutorials plex]# systemctl status plexmediaserver.service + +### 在CentOS-7.1上设置Plex Home Media Web应用 ### + +现在我们只需要重复在Ubuntu上设置Plex Web应用的所有步骤就可以了。 让我们在Web浏览器上打开一个新窗口并用localhost或者Plex服务器的IP(译者注: 原文为or your Plex server, 明显的笔误)来访问Plex Home Media Web应用(译者注:称谓一致)。 + + http://172.20.3.174:32400/web + http://localhost:32400/web + +为了获取服务的完整权限你需要重复创建SSH隧道的步骤。 在你用新账户注册后我们将可以访问到服务的所有特性,并且可以添加新用户、添加新的媒体库以及根据我们的需求来设置它。 + +![Plex Device Centos](http://blog.linoxide.com/wp-content/uploads/2015/06/plex-devices-centos.png) + +### 在Fedora 22工作站上安装Plex Media Server 0.9.12.3 ### + +基本的下载和安装Plex Media Server步骤跟在CentOS 7.1上安装的步骤一致。我们只需要下载对应的rpm包然后用rpm命令来安装它。 + +![PMS Installation](http://blog.linoxide.com/wp-content/uploads/2015/06/plex-on-fedora.png) + +### 在Fedora 22工作站上配置Plex Home Media Web应用 ### + +我们在(与Plex服务器)相同的主机上配置Plex Media Server,因此不需要设置SSH隧道。只要在你的Fedora 22工作站上用Plex Home Media Server的默认端口号32400打开Web浏览器并同意Plex的服务条款即可。 + +![Plex Agreement](http://blog.linoxide.com/wp-content/uploads/2015/06/Plex-Terms.png) + +**欢迎来到Fedora 22工作站上的Plex Home Media Server** + +让我们用你的Plex账户登陆,并且开始将你喜欢的电影频道添加到媒体库、创建你的播放列表、添加你的图片以及享用更多其他的特性。 + +![Plex Add Libraries](http://blog.linoxide.com/wp-content/uploads/2015/06/create-library.png) + +### 总结 ### + +我们已经成功完成Plex Media Server在主流Linux发行版上安装和配置。Plex Home Media Server永远都是媒体管理的最佳选择。 它在跨平台上的设置是如此的简单,就像我们在Ubuntu,CentOS以及Fedora上的设置一样。它简化了你组织媒体内容的工作,并将媒体内容“流”向其他计算机以及设备以便你跟你的朋友分享媒体内容。 + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/tools/install-plex-media-server-ubuntu-centos-7-1-fedora-22/ + +作者:[Kashif Siddique][a] +译者:[dingdongnigetou](https://github.com/dingdongnigetou) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://linoxide.com/author/kashifs/ From 235d39a2694ec8f4e10e835f7a0041a3767113e8 Mon Sep 17 00:00:00 2001 From: wxy Date: Mon, 27 Jul 2015 13:30:38 +0800 Subject: [PATCH 711/965] PUB:20150709 7 command line tools for monitoring your Linux system @ZTinoZ --- ... tools for monitoring your Linux system.md | 83 +++++++++++++++++++ ... tools for monitoring your Linux system.md | 79 ------------------ 2 files changed, 83 insertions(+), 79 deletions(-) create mode 100644 published/20150709 7 command line tools for monitoring your Linux system.md delete mode 100644 translated/talk/20150709 7 command line tools for monitoring your Linux system.md diff --git a/published/20150709 7 command line tools for monitoring your Linux system.md b/published/20150709 7 command line tools for monitoring your Linux system.md new file mode 100644 index 0000000000..da46bd124e --- /dev/null +++ b/published/20150709 7 command line tools for monitoring your Linux system.md @@ -0,0 +1,83 @@ +监控 Linux 系统的 7 个命令行工具 +================================================================================ +**这里有一些基本的命令行工具,让你能更简单地探索和操作Linux。** + +![Image courtesy Meltys-stock](http://images.techhive.com/images/article/2015/06/command-line-tools-monitoring-linux-system-1-100591899-orig.png) + +### 深入 ### + +关于Linux最棒的一件事之一是你能深入操作系统,来探索它是如何工作的,并寻找机会来微调性能或诊断问题。这里有一些基本的命令行工具,让你能更简单地探索和操作Linux。大多数的这些命令是在你的Linux系统中已经内建的,但假如它们没有的话,就用谷歌搜索命令名和你的发行版名吧,你会找到哪些包需要安装(注意,一些命令是和其它命令捆绑起来打成一个包的,你所找的包可能写的是其它的名字)。如果你知道一些你所使用的其它工具,欢迎评论。 + + +### 我们怎么开始 ### + +![](http://images.techhive.com/images/article/2015/06/command-line-tools-monitoring-linux-system-2-100591901-orig.png) + +须知: 本文中的截图取自一台[Debian Linux 8.1][1] (“Jessie”),其运行在[OS X 10.10.3][3] (“Yosemite”)操作系统下的[Oracle VirtualBox 4.3.28][2]中的一台虚拟机里。想要建立你的Debian虚拟机,可以看看我的这篇教程——“[如何在 VirtualBox VM 下安装 Debian][4]”。 + + +### Top ### + +![](http://images.techhive.com/images/article/2015/06/command-line-tools-monitoring-linux-system-3-100591902-orig.png) + +作为Linux系统监控工具中比较易用的一个,**top命令**能带我们一览Linux中的几乎每一处。以下这张图是它的默认界面,但是按“z”键可以切换不同的显示颜色。其它热键和命令则有其它的功能,例如显示概要信息和内存信息(第四行第二个),根据各种不一样的条件排序、终止进程任务等等(你可以在[这里][5]找到完整的列表)。 + + +### htop ### + +![](http://images.techhive.com/images/article/2015/06/command-line-tools-monitoring-linux-system-4-100591904-orig.png) + +相比top,它的替代品Htop则更为精致。维基百科是这样描述的:“用户经常会部署htop以免Unix top不能提供关于系统进程的足够信息,比如说当你在尝试发现应用程序里的一个小的内存泄露问题,Htop一般也能作为一个系统监听器来使用。相比top,它提供了一个更方便的光标控制界面来向进程发送信号。” (想了解更多细节猛戳[这里][6]) + + +### Vmstat ### + +![](http://images.techhive.com/images/article/2015/06/command-line-tools-monitoring-linux-system-5-100591903-orig.png) + +Vmstat是一款监控Linux系统性能数据的简易工具,这让它更合适使用在shell脚本中。使出你的正则表达式绝招,用vmstat和cron作业来做一些激动人心的事情吧。“后面的报告给出的是上一次系统重启之后的均值,另外一份报告给出的则是从前一个报告起间隔周期中的信息。其它的进程和内存报告是那个瞬态的情况”(猛戳[这里][7]获取更多信息)。 + +### ps ### + +![](http://images.techhive.com/images/article/2015/06/command-line-tools-monitoring-linux-system-6-100591905-orig.png) + +ps命令展现的是正在运行中的进程列表。在这种情况下,我们用“-e”选项来显示每个进程,也就是所有正在运行的进程了(我把列表滚动到了前面,否则列名就看不到了)。这个命令有很多选项允许你去按需格式化输出。只要使用上述一点点的正则表达式技巧,你就能得到一个强大的工具了。猛戳[这里][8]获取更多信息。 + +### Pstree ### + +![](http://images.techhive.com/images/article/2015/06/command-line-tools-monitoring-linux-system-7-100591906-orig.png) + +Pstree“以树状图显示正在运行中的进程。这个进程树是以某个 pid 为根节点的,如果pid被省略的话那树是以init为根节点的。如果指定用户名,那所有进程树都会以该用户所属的进程为父进程进行显示。”以树状图来帮你将进程之间的所属关系进行分类,这的确是个很有效的工具(戳[这里][9])。 + +### pmap ### + +![](http://images.techhive.com/images/article/2015/06/command-line-tools-monitoring-linux-system-8-100591907-orig.png) + +在调试过程中,理解一个应用程序如何使用内存是至关重要的,而pmap的作用就是当给出一个进程ID时显示出相关信息。上面的截图展示的是使用“-x”选项所产生的部分输出,你也可以用pmap的“-X”选项来获取更多的细节信息,但是前提是你要有个更宽的终端窗口。 + +### iostat ### + +![](http://images.techhive.com/images/article/2015/06/command-line-tools-monitoring-linux-system-9-100591900-orig.png) + +Linux系统的一个至关重要的性能指标是处理器和存储的使用率,它也是iostat命令所报告的内容。如同ps命令一样,iostat有很多选项允许你选择你需要的输出格式,除此之外还可以在某一段时间范围内的重复采样几次。详情请戳[这里][10]。 + +-------------------------------------------------------------------------------- + +via: http://www.networkworld.com/article/2937219/linux/7-command-line-tools-for-monitoring-your-linux-system.html + +作者:[Mark Gibbs][a] +译者:[ZTinoZ](https://github.com/ZTinoZ) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.networkworld.com/author/Mark-Gibbs/ +[1]:https://www.debian.org/releases/stable/ +[2]:https://www.virtualbox.org/ +[3]:http://www.apple.com/osx/ +[4]:http://www.networkworld.com/article/2937148/how-to-install-debian-linux-8-1-in-a-virtualbox-vm +[5]:http://linux.die.net/man/1/top +[6]:http://linux.die.net/man/1/htop +[7]:http://linuxcommand.org/man_pages/vmstat8.html +[8]:http://linux.die.net/man/1/ps +[9]:http://linux.die.net/man/1/pstree +[10]:http://linux.die.net/man/1/iostat diff --git a/translated/talk/20150709 7 command line tools for monitoring your Linux system.md b/translated/talk/20150709 7 command line tools for monitoring your Linux system.md deleted file mode 100644 index e33c259d5c..0000000000 --- a/translated/talk/20150709 7 command line tools for monitoring your Linux system.md +++ /dev/null @@ -1,79 +0,0 @@ -监控你的Linux系统的7个命令行工具 -================================================================================ -**这里有一些基本的命令行工具,让你能更简单地探索和操作Linux。** - -![Image courtesy Meltys-stock](http://images.techhive.com/images/article/2015/06/command-line-tools-monitoring-linux-system-1-100591899-orig.png) - -### 深入 ### - -关于Linux最棒的一件事之一是你能深入操作系统多深,来探索它是如何工作的并寻找机会来微调性能或诊断问题。这里有一些基本的命令行工具,让你能更简单地探索和操作Linux。大多数的这些命令是在你的Linux系统中已经内建的,但假设它们不是,就用谷歌搜索命令名和你的发行版名吧,你会找到哪些包需要安装(注意,一些命令是和其它命令捆绑起来打成一个包的,你所找的包可能写的是其它的名字)。如果你知道一些你所使用的其它工具,欢迎评论。 - -![Image courtesy Mark Gibbs](http://images.techhive.com/images/article/2015/06/command-line-tools-monitoring-linux-system-2-100591901-orig.png) - -### 我们怎么做 ### - -须知: 本文中的截图取自[Debian Linux 8.1][1] (“Jessie”),其运行在[OS X 10.10.3][3] (“Yosemite”)操作系统下[Oracle VirtualBox 4.3.28][2]中的一台虚拟机里。想要建立你的Debian虚拟机,可以看看我的这篇教程——“[How to install Debian Linux in a VirtualBox VM][4]”。 - -![Image courtesy Mark Gibbs](http://images.techhive.com/images/article/2015/06/command-line-tools-monitoring-linux-system-3-100591902-orig.png) - -### Top ### - -作为Linux系统监控工具中比较易用的一个,**top命令**能带我们一览Linux中的几乎每一处。以下这张图是它的默认界面,但是按“z”键可以切换不同的显示颜色。其它热键和命令则有其它的功能,例如显示概要信息和内存信息(第四行第二个),根据各种不一样的条件排序、终止进程任务等等(你可以在[这里][5]找到完整的列表)。 - -![Image courtesy Mark Gibbs](http://images.techhive.com/images/article/2015/06/command-line-tools-monitoring-linux-system-4-100591904-orig.png) - -### htop ### - -相比top,它的替代品Htop则更为精致。维基百科是这样描述的:“用户经常会部署htop以防Unix top不能提供关于系统进程的足够信息,比如说当你在尝试发现应用程序里的一个小的内存泄露问题,Htop一般也能作为一个系统监听器来使用。相比top,它提供了一个更方便的光标控制界面来向进程发送信号。” (想了解更多细节猛戳[这里][6].) - -![Image courtesy Mark Gibbs](http://images.techhive.com/images/article/2015/06/command-line-tools-monitoring-linux-system-5-100591903-orig.png) - -### Vmstat ### - -Vmstat是一款监控Linux系统性能数据的简易工具,这让它在shell脚本中使用更合适。打开你的regex-fu,用vmstat和cron作业来做一些激动人心的事情吧。“产出的第一份报告给出的是上一次系统重启之后的均值,另外其一份报告给出的则是从前一个报告起间隔周期中的信息。进程和内存报告在任何情况下都是不停更新的”(猛戳[这里][7]获取更多信息)。 - -![Image courtesy Mark Gibbs](http://images.techhive.com/images/article/2015/06/command-line-tools-monitoring-linux-system-6-100591905-orig.png) - -### ps ### - -ps命令展现的是正在运行中的进程列表。在这种情况下,我们用“-e”选项来显示每个进程,也就是所有正在运行的进程了(我把列表滚动到了头部否则列名就看不到了)。这个命令有很多选项允许你去按需格式化输出。只要使用上述一点点的regex-fu你就能得到一个强大的工具了。猛戳[这里][8]获取更多信息。 - -![Image courtesy Mark Gibbs](http://images.techhive.com/images/article/2015/06/command-line-tools-monitoring-linux-system-7-100591906-orig.png) - -### Pstree ### - -Pstree“以树状图显示正在运行中的进程。如果pid被省略的话那树结构是以pid或init为父进程,如果用户名指定,那所有进程树都会以该用户所属的进程为父进程进行显示。”以树状图来帮你将进程之间的所属关系进行分类,这的确是个很有效的工具(戳[这里][9])。 - -![Image courtesy Mark Gibbs](http://images.techhive.com/images/article/2015/06/command-line-tools-monitoring-linux-system-8-100591907-orig.png) - -### pmap ### - -理解一个应用程序在调试过程中如何使用内存是至关重要的,而pmap的作用就是当给出一个进程ID(PID)时显示出相关信息。上面的截图展示的是使用“-x”选项所产生的部分输出,你也可以用pmap的“-X”选项来获取更多的细节信息但是前提是你要有个更宽的终端窗口。 - -![Image courtesy Mark Gibbs](http://images.techhive.com/images/article/2015/06/command-line-tools-monitoring-linux-system-9-100591900-orig.png) - -### iostat ### - -Linux系统的一个至关重要的性能指标是处理器和存储的使用率,它也是iostat命令所报告的内容。如同ps命令一样,iostat有很多选项允许你选择你需要的输出格式,除此之外还有某一段时间范围内的简单性能输出并在报告之前重复抽样多次。详情戳[这里][10]。 - --------------------------------------------------------------------------------- - -via: http://www.networkworld.com/article/2937219/linux/7-command-line-tools-for-monitoring-your-linux-system.html - -作者:[Mark Gibbs][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.networkworld.com/author/Mark-Gibbs/ -[1]:https://www.debian.org/releases/stable/ -[2]:https://www.virtualbox.org/ -[3]:http://www.apple.com/osx/ -[4]:http://www.networkworld.com/article/2937148/how-to-install-debian-linux-8-1-in-a-virtualbox-vm -[5]:http://linux.die.net/man/1/top -[6]:http://linux.die.net/man/1/htop -[7]:http://linuxcommand.org/man_pages/vmstat8.html -[8]:http://linux.die.net/man/1/ps -[9]:http://linux.die.net/man/1/pstree -[10]:http://linux.die.net/man/1/iostat From 6e389ee8d08ba743b98c15634d197ffe908ebf7c Mon Sep 17 00:00:00 2001 From: DeadFire Date: Mon, 27 Jul 2015 16:45:43 +0800 Subject: [PATCH 712/965] =?UTF-8?q?20150727-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...estore and Migrate Containers in Docker.md | 90 +++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 sources/tech/20150727 Easy Backup Restore and Migrate Containers in Docker.md diff --git a/sources/tech/20150727 Easy Backup Restore and Migrate Containers in Docker.md b/sources/tech/20150727 Easy Backup Restore and Migrate Containers in Docker.md new file mode 100644 index 0000000000..fc21489ec9 --- /dev/null +++ b/sources/tech/20150727 Easy Backup Restore and Migrate Containers in Docker.md @@ -0,0 +1,90 @@ +Easy Backup, Restore and Migrate Containers in Docker +================================================================================ +Today we'll learn how we can easily backup, restore and migrate docker containers out of the box. [Docker][1] is an open source platform that automates the deployment of applications with fast and easy way to pack, ship and run it under a lightweight layer of software called container. It makes the applications platform independent as it acts an additional layer of abstraction and automation of operating system level virtualization on Linux. It utilizes resource isolation features of Linux Kernel with its components cgroups and namespace for avoiding the overhead of virtual machines. It makes the great building blocks for deploying and scaling web apps, databases, and back-end services without depending on a particular stack or provider. Containers are those software layers which are created from a docker image that contains the respective linux filesystem and applications out of the box. If we have a docker container running in our box and need to backup those containers for future use or wanna migrate those containers, then this tutorial will help you how we can backup, restore and migrate docker containers in linux operating system. + +Here are some easy steps on how we can backup, restore and migrate the docker containers in linux. + +### 1. Backing up the Containers ### + +First of all, in order to backup the containers in docker, we'll wanna see the list of containers that we wanna backup. To do so, we'll need to run docker ps in our linux machine running docker engine with containers already created. + + # docker ps + +![Docker Containers List](http://blog.linoxide.com/wp-content/uploads/2015/07/docker-containers-list.png) + +After that, we'll choose the containers we wanna backup and then we'll go for creating the snapshot of the container. We can use docker commit command in order to create the snapshot. + + # docker commit -p 30b8f18f20b4 container-backup + +![Docker Commit](http://blog.linoxide.com/wp-content/uploads/2015/07/docker-commit.png) + +This will generated a snapshot of the container as the docker image. We can see the docker image by running the command docker images as shown below. + + # docker images + +![Docker Images](http://blog.linoxide.com/wp-content/uploads/2015/07/docker-images.png) + +As we can see the snapshot that was taken above has been preserved as docker image. Now, inorder to backup that snapshot, we have two options, one is that we can login into the docker registry hub and push the image and the next is that we can backup the docker image as tarballs for further use. + +If we wanna upload or backup the image in the [docker registry hub][2], we can simply run docker login command to login into the docker registry hub and then push the required image. + + # docker login + +![Docker Login](http://blog.linoxide.com/wp-content/uploads/2015/07/docker-login.png) + + # docker tag a25ddfec4d2a arunpyasi/container-backup:test + # docker push arunpyasi/container-backup + +![Docker Push](http://blog.linoxide.com/wp-content/uploads/2015/07/docker-push.png) + +If we don't wanna backup to the docker registry hub and wanna save the image for future use in the machine locally then we can backup the image as tarballs. To do so, we'll need to run the following docker save command. + + # docker save -o ~/container-backup.tar container-backup + +![taking tarball backup](http://blog.linoxide.com/wp-content/uploads/2015/07/taking-tarball-backup.png) + +To verify if the tarball has been generated or not, we can simply run docker ls inside the directory where we saved the tarball. + +### 2. Restoring the Containers ### + +Next, after we have successfully backed up our docker containers, we'll now go for restoring those contianers which are snapshotted as docker images. If we have pushed those docker images in the registry hub, then we can simply pull that docker image and run it out of the box. + + # docker pull arunpyasi/container-backup:test + +![Docker Pull](http://blog.linoxide.com/wp-content/uploads/2015/07/docker-pull.png) + +But if we have backed up those docker images locally as tarball file, then we can easy load that docker image using docker load command followed by the backed up tarball. + + # docker load -i ~/container-backup.tar + +Now, to ensure that those docker images have been loaded successfully, we'll run docker images command. + + # docker images + +After the images have been loaded, we'll gonna run the docker container from the loaded image. + + # docker run -d -p 80:80 container-backup + +![Restoring Docker Tarball](http://blog.linoxide.com/wp-content/uploads/2015/07/restoring-docker-tarballs.png) + +### 3. Migrating the Docker Containers ### + +Migrating the containers involve both the above process ie Backup and Restore. We can migrate any docker container from one machine to another. In the process of migration, first we take the backup of the container as snapshot docker image. Then, that docker image is either pushed to the docker registry hub or saved as tarball files in the locally. If we have pushed the image to the docker registry hub, we can easily restore and run the container using docker run command from any machine we want. But if we have saved the image as tarballs locally, we can simply copy or move the image to the machine where we want to load image and run the required container. + +### Conclusion ### + +Finally, we have learned how we can backup, restore and migrate the docker containers out of the box. This tutorial is exactly same for every platform of operating system where docker runs successfully. Really, docker is pretty simple and easy to use but very powerful tool. It has pretty easy to remember commands which are short enough with many simple but powerful flags and parameters. The above methods makes us comfortable to backup our containers so that we can restore them when needed in future. This can help us recover our containers and images even if our host system crashes or gets wiped out accidentally. If you have any questions, suggestions, feedback please write them in the comment box below so that we can improve or update our contents. Thank you ! Enjoy :-) + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/linux-how-to/backup-restore-migrate-containers-docker/ + +作者:[Arun Pyasi][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://linoxide.com/author/arunp/ +[1]:http://docker.com/ +[2]:https://registry.hub.docker.com/ \ No newline at end of file From 54c0e5492e53abfadb87df7bc727714942a47e55 Mon Sep 17 00:00:00 2001 From: zpl1025 Date: Mon, 27 Jul 2015 21:18:53 +0800 Subject: [PATCH 713/965] [translating] 20150709 Interviews--Linus Torvalds Answers Your Question.md --- ...0150709 Interviews--Linus Torvalds Answers Your Question.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/talk/20150709 Interviews--Linus Torvalds Answers Your Question.md b/sources/talk/20150709 Interviews--Linus Torvalds Answers Your Question.md index e723658787..f1420fd0e4 100644 --- a/sources/talk/20150709 Interviews--Linus Torvalds Answers Your Question.md +++ b/sources/talk/20150709 Interviews--Linus Torvalds Answers Your Question.md @@ -1,3 +1,4 @@ +zpl1025 Interviews: Linus Torvalds Answers Your Question ================================================================================ Last Thursday you had a chance to [ask Linus Torvalds][1] about programming, hardware, and all things Linux. You can read his answers to those questions below. If you'd like to see what he had to say the last time we sat down with him, [you can do so here][2]. @@ -181,4 +182,4 @@ via: http://linux.slashdot.org/story/15/06/30/0058243/interviews-linus-torvalds- [a]:samzenpus@slashdot.org [1]:http://interviews.slashdot.org/story/15/06/24/1718247/interview-ask-linus-torvalds-a-question [2]:http://meta.slashdot.org/story/12/10/11/0030249/linus-torvalds-answers-your-questions -[3]:https://lwn.net/Articles/604695/ \ No newline at end of file +[3]:https://lwn.net/Articles/604695/ From 439bc9a7b9cc721341ec2eb5c23d8ec9fe3821c8 Mon Sep 17 00:00:00 2001 From: wxy Date: Mon, 27 Jul 2015 23:57:15 +0800 Subject: [PATCH 714/965] PUB:20150713 How To Fix System Program Problem Detected In Ubuntu 14.04 @XLCYun --- ...rogram Problem Detected In Ubuntu 14.04.md | 29 ++++++++++--------- 1 file changed, 16 insertions(+), 13 deletions(-) rename {translated/tech => published}/20150713 How To Fix System Program Problem Detected In Ubuntu 14.04.md (74%) diff --git a/translated/tech/20150713 How To Fix System Program Problem Detected In Ubuntu 14.04.md b/published/20150713 How To Fix System Program Problem Detected In Ubuntu 14.04.md similarity index 74% rename from translated/tech/20150713 How To Fix System Program Problem Detected In Ubuntu 14.04.md rename to published/20150713 How To Fix System Program Problem Detected In Ubuntu 14.04.md index 3658528e77..92aa82ac03 100644 --- a/translated/tech/20150713 How To Fix System Program Problem Detected In Ubuntu 14.04.md +++ b/published/20150713 How To Fix System Program Problem Detected In Ubuntu 14.04.md @@ -1,10 +1,9 @@ - -如何修复ubuntu 14.04中检测到系统程序错误的问题 +如何修复 ubuntu 中检测到系统程序错误的问题 ================================================================================ + ![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/system_program_Problem_detected.jpeg) - -在过去的几个星期,(几乎)每次都有消息 **Ubuntu 15.04在启动时检测到系统程序错误(system program problem detected on startup in Ubuntu 15.04)** 跑出来“欢迎”我。那时我是直接忽略掉它的,但是这种情况到了某个时刻,它就让人觉得非常烦人了! +在过去的几个星期,(几乎)每次都有消息 **Ubuntu 15.04在启动时检测到系统程序错误** 跑出来“欢迎”我。那时我是直接忽略掉它的,但是这种情况到了某个时刻,它就让人觉得非常烦人了! > 检测到系统程序错误(System program problem detected) > @@ -18,15 +17,16 @@ #### 那么这个通知到底是关于什么的? #### -大体上讲,它是在告知你,你的系统的一部分崩溃了。可别因为“崩溃”这个词而恐慌。这不是一个严重的问题,你的系统还是完完全全可用的。只是在以前的某个时刻某个程序崩溃了,而Ubuntu想让你决定要不要把这个问题报告给开发者,这样他们就能够修复这个问题。 +大体上讲,它是在告知你,你的系统的一部分崩溃了。可别因为“崩溃”这个词而恐慌。这不是一个严重的问题,你的系统还是完完全全可用的。只是在之前的某个时刻某个程序崩溃了,而Ubuntu想让你决定要不要把这个问题报告给开发者,这样他们就能够修复这个问题。 #### 那么,我们点了“报告错误”的按钮后,它以后就不再显示了?#### +不,不是的!即使你点了“报告错误”按钮,最后你还是会被一个如下的弹窗再次“欢迎”一下: -不,不是的!即使你点了“报告错误”按钮,最后你还是会被一个如下的弹窗再次“欢迎”: ![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/Ubuntu_Internal_error.png) -[对不起,Ubuntu发生了一个内部错误(Sorry, Ubuntu has experienced an internal error)][1]是一个Apport(Apport是Ubuntu中错误信息的收集报告系统,详见Ubuntu Wiki中的Apport篇,译者注),它将会进一步的打开网页浏览器,然后你可以通过登录或创建[Launchpad][2]帐户来填写一份漏洞(Bug)报告文件。你看,这是一个复杂的过程,它要花整整四步来完成. +[对不起,Ubuntu发生了一个内部错误][1]是个Apport(LCTT 译注:Apport是Ubuntu中错误信息的收集报告系统,详见Ubuntu Wiki中的Apport篇),它将会进一步的打开网页浏览器,然后你可以通过登录或创建[Launchpad][2]帐户来填写一份漏洞(Bug)报告文件。你看,这是一个复杂的过程,它要花整整四步来完成。 + #### 但是我想帮助开发者,让他们知道这个漏洞啊 !#### 你这样想的确非常地周到体贴,而且这样做也是正确的。但是这样做的话,存在两个问题。第一,存在非常高的概率,这个漏洞已经被报告过了;第二,即使你报告了个这次崩溃,也无法保证你不会再看到它。 @@ -34,35 +34,38 @@ #### 那么,你的意思就是说别报告这次崩溃了?#### 对,也不对。如果你想的话,在你第一次看到它的时候报告它。你可以在上面图片显示的“显示细节(Show Details)”中,查看崩溃的程序。但是如果你总是看到它,或者你不想报告漏洞(Bug),那么我建议你还是一次性摆脱这个问题吧。 + ### 修复Ubuntu中“检测到系统程序错误”的错误 ### 这些错误报告被存放在Ubuntu中目录/var/crash中。如果你翻看这个目录的话,应该可以看到有一些以crash结尾的文件。 + ![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/Crash_reports_Ubuntu.jpeg) 我的建议是删除这些错误报告。打开一个终端,执行下面的命令: sudo rm /var/crash/* -这个操作会删除所有在/var/crash目录下的所有内容。这样你就不会再被这些报告以前程序错误的弹窗所扰。但是如果有一个程序又崩溃了,你就会再次看到“检测到系统程序错误”的错误。你可以再次删除这些报告文件,或者你可以禁用Apport来彻底地摆脱这个错误弹窗。 +这个操作会删除所有在/var/crash目录下的所有内容。这样你就不会再被这些报告以前程序错误的弹窗所扰。但是如果又有一个程序崩溃了,你就会再次看到“检测到系统程序错误”的错误。你可以再次删除这些报告文件,或者你可以禁用Apport来彻底地摆脱这个错误弹窗。 + #### 彻底地摆脱Ubuntu中的系统错误弹窗 #### 如果你这样做,系统中任何程序崩溃时,系统都不会再通知你。如果你想问问我的看法的话,我会说,这不是一件坏事,除非你愿意填写错误报告。如果你不想填写错误报告,那么这些错误通知存不存在都不会有什么区别。 要禁止Apport,并且彻底地摆脱Ubuntu系统中的程序崩溃报告,打开一个终端,输入以下命令: + gksu gedit /etc/default/apport 这个文件的内容是: - # set this to 0 to disable apport, or to 1 to enable it - # 设置0表示禁用Apportw,或者1开启它。译者注,下同。 - # you can temporarily override this with + # 设置0表示禁用Apportw,或者1开启它。 # 你可以用下面的命令暂时关闭它: # sudo service apport start force_start=1 enabled=1 -把**enabled=1**改为**enabled=0**.保存并关闭文件。完成之后你就再也不会看到弹窗报告错误了。很显然,如果我们想重新开启错误报告功能,只要再打开这个文件,把enabled设置为1就可以了。 +把**enabled=1**改为**enabled=0**。保存并关闭文件。完成之后你就再也不会看到弹窗报告错误了。很显然,如果我们想重新开启错误报告功能,只要再打开这个文件,把enabled设置为1就可以了。 #### 你的有效吗? #### + 我希望这篇教程能够帮助你修复Ubuntu 14.04和Ubuntu 15.04中检测到系统程序错误的问题。如果这个小窍门帮你摆脱了这个烦人的问题,请让我知道。 -------------------------------------------------------------------------------- @@ -71,7 +74,7 @@ via: http://itsfoss.com/how-to-fix-system-program-problem-detected-ubuntu/ 作者:[Abhishek][a] 译者:[XLCYun](https://github.com/XLCYun) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 3340d5e78d492c8950aee6ac30e9ec157654d46d Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 28 Jul 2015 00:05:54 +0800 Subject: [PATCH 715/965] PUB:20150709 Install Google Hangouts Desktop Client In Linux @FSSlc --- ...all Google Hangouts Desktop Client In Linux.md | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) rename {translated/tech => published}/20150709 Install Google Hangouts Desktop Client In Linux.md (89%) diff --git a/translated/tech/20150709 Install Google Hangouts Desktop Client In Linux.md b/published/20150709 Install Google Hangouts Desktop Client In Linux.md similarity index 89% rename from translated/tech/20150709 Install Google Hangouts Desktop Client In Linux.md rename to published/20150709 Install Google Hangouts Desktop Client In Linux.md index e8257cbedf..4adca83c52 100644 --- a/translated/tech/20150709 Install Google Hangouts Desktop Client In Linux.md +++ b/published/20150709 Install Google Hangouts Desktop Client In Linux.md @@ -1,24 +1,25 @@ 在 Linux 中安装 Google 环聊桌面客户端 ================================================================================ + ![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/google-hangouts-header-664x374.jpg) 先前,我们已经介绍了如何[在 Linux 中安装 Facebook Messenger][1] 和[WhatsApp 桌面客户端][2]。这些应用都是非官方的应用。今天,我将为你推荐另一款非官方的应用,它就是 [Google 环聊][3] -当然,你可以在 Web 浏览器中使用 Google 环聊,但相比于此,使用桌面客户端会更加有趣。好奇吗?那就跟着我看看如何 **在 Linux 中安装 Google 环聊** 以及如何使用它把。 +当然,你可以在 Web 浏览器中使用 Google 环聊,但相比于此,使用桌面客户端会更加有趣。好奇吗?那就跟着我看看如何 **在 Linux 中安装 Google 环聊** 以及如何使用它吧。 ### 在 Linux 中安装 Google 环聊 ### 我们将使用一个名为 [yakyak][4] 的开源项目,它是一个针对 Linux,Windows 和 OS X 平台的非官方 Google 环聊客户端。我将向你展示如何在 Ubuntu 中使用 yakyak,但我相信在其他的 Linux 发行版本中,你可以使用同样的方法来使用它。在了解如何使用它之前,让我们先看看 yakyak 的主要特点: - 发送和接受聊天信息 -- 创建和更改对话 (重命名, 添加人物) +- 创建和更改对话 (重命名, 添加参与者) - 离开或删除对话 - 桌面提醒通知 - 打开或关闭通知 -- 针对图片上传,支持拖放,复制粘贴或使用上传按钮 -- Hangupsbot 房间同步(实际的用户图片) (注: 这里翻译不到位,希望改善一下) +- 对于图片上传,支持拖放,复制粘贴或使用上传按钮 +- Hangupsbot 房间同步(使用用户实际的图片) - 展示行内图片 -- 历史回放 +- 翻阅历史 听起来不错吧,你可以从下面的链接下载到该软件的安装文件: @@ -36,7 +37,7 @@ ![Google_Hangout_Linux_4](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/Google_Hangout_Linux_4.jpeg) -假如你想看看对话的配置图,你可以选择 `查看-> 展示对话缩略图` +假如你想在联系人里面显示用户头像,你可以选择 `查看-> 展示对话缩略图` ![Google 环聊缩略图](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/Google_Hangout_Linux_5.jpeg) @@ -54,7 +55,7 @@ via: http://itsfoss.com/install-google-hangouts-linux/ 作者:[Abhishek][a] 译者:[FSSlc](https://github.com/FSSlc) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 2f8bb078e09a6ad0807e328d24d71fd780e00a10 Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 28 Jul 2015 00:22:44 +0800 Subject: [PATCH 716/965] PUB:20150722 How to Use and Execute PHP Codes in Linux Command Line--Part 1 @GOLinux --- ...PHP Codes in Linux Command Line--Part 1.md | 57 +++++++++++-------- 1 file changed, 33 insertions(+), 24 deletions(-) rename {translated/tech => published}/20150722 How to Use and Execute PHP Codes in Linux Command Line--Part 1.md (77%) diff --git a/translated/tech/20150722 How to Use and Execute PHP Codes in Linux Command Line--Part 1.md b/published/20150722 How to Use and Execute PHP Codes in Linux Command Line--Part 1.md similarity index 77% rename from translated/tech/20150722 How to Use and Execute PHP Codes in Linux Command Line--Part 1.md rename to published/20150722 How to Use and Execute PHP Codes in Linux Command Line--Part 1.md index 1d69a7c746..79fa6b6b12 100644 --- a/translated/tech/20150722 How to Use and Execute PHP Codes in Linux Command Line--Part 1.md +++ b/published/20150722 How to Use and Execute PHP Codes in Linux Command Line--Part 1.md @@ -1,10 +1,12 @@ -Linux命令行中使用和执行PHP代码——第一部分 +在 Linux 命令行中使用和执行 PHP 代码(一) ================================================================================ -PHP是一个开元服务器端脚本语言,最初这三个字母代表的是“Personal Home Page”,而现在则代表的是“PHP:Hypertext Preprocessor”,它是个递归首字母缩写。它是一个跨平台脚本语言,深受C、C++和Java的影响。 -![Run PHP Codes in Linux Command Line](http://www.tecmint.com/wp-content/uploads/2015/07/php-command-line-usage.jpeg) -Linux命令行中运行PHP代码——第一部分 +PHP是一个开源服务器端脚本语言,最初这三个字母代表的是“Personal Home Page”,而现在则代表的是“PHP:Hypertext Preprocessor”,它是个递归首字母缩写。它是一个跨平台脚本语言,深受C、C++和Java的影响。 -PHP的语法和C、Java以及带有一些PHP特性的Perl变成语言中的语法十分相似,它眼下大约正被2.6亿个网站所使用,当前最新的稳定版本是PHP版本5.6.10。 +![Run PHP Codes in Linux Command Line](http://www.tecmint.com/wp-content/uploads/2015/07/php-command-line-usage.jpeg) + +*在 Linux 命令行中运行 PHP 代码* + +PHP的语法和C、Java以及带有一些PHP特性的Perl变成语言中的语法十分相似,它当下大约正被2.6亿个网站所使用,当前最新的稳定版本是PHP版本5.6.10。 PHP是HTML的嵌入脚本,它便于开发人员快速写出动态生成的页面。PHP主要用于服务器端(而Javascript则用于客户端)以通过HTTP生成动态网页,然而,当你知道可以在Linux终端中不需要网页浏览器来执行PHP时,你或许会大为惊讶。 @@ -12,40 +14,44 @@ PHP是HTML的嵌入脚本,它便于开发人员快速写出动态生成的页 **1. 在安装完PHP和Apache2后,我们需要安装PHP命令行解释器。** - # apt-get install php5-cli [Debian and alike System) - # yum install php-cli [CentOS and alike System) + # apt-get install php5-cli [Debian 及类似系统] + # yum install php-cli [CentOS 及类似系统] -接下来我们通常要做的是,在‘/var/www/html‘(这是 Apache2 在大多数发行版中的工作目录)这个位置创建一个内容为 ‘‘,名为 ‘infophp.php‘ 的文件来测试(是否安装正确),执行以下命令即可。 +接下来我们通常要做的是,在`/var/www/html`(这是 Apache2 在大多数发行版中的工作目录)这个位置创建一个内容为 ``,名为 `infophp.php` 的文件来测试(PHP是否安装正确),执行以下命令即可。 # echo '' > /var/www/html/infophp.php -然后,将浏览器指向http://127.0.0.1/infophp.php, 这将会在网络浏览器中打开该文件。 +然后,将浏览器访问 http://127.0.0.1/infophp.php ,这将会在网络浏览器中打开该文件。 ![Check PHP Info](http://www.tecmint.com/wp-content/uploads/2015/07/Check-PHP-Info.png) -检查PHP信息 -不需要任何浏览器,在Linux终端中也可以获得相同的结果。在Linux命令行中执行‘/var/www/html/infophp.php‘,如: +*检查PHP信息* + +不需要任何浏览器,在Linux终端中也可以获得相同的结果。在Linux命令行中执行`/var/www/html/infophp.php`,如: # php -f /var/www/html/infophp.php ![Check PHP info from Commandline](http://www.tecmint.com/wp-content/uploads/2015/07/Check-PHP-info-from-Commandline.png) -从命令行检查PHP信息 -由于输出结果太大,我们可以通过管道将上述输出结果输送给 ‘less‘ 命令,这样就可以一次输出一屏了,命令如下: +*从命令行检查PHP信息* + +由于输出结果太大,我们可以通过管道将上述输出结果输送给 `less` 命令,这样就可以一次输出一屏了,命令如下: # php -f /var/www/html/infophp.php | less ![Check All PHP Info](http://www.tecmint.com/wp-content/uploads/2015/07/Check-All-PHP-Info.png) -检查所有PHP信息 -这里,‘-f‘选项解析病执行命令后跟随的文件。 +*检查所有PHP信息* + +这里,‘-f‘选项解析并执行命令后跟随的文件。 **2. 我们可以直接在Linux命令行使用`phpinfo()`这个十分有价值的调试工具而不需要从文件来调用,只需执行以下命令:** # php -r 'phpinfo();' ![PHP Debugging Tool](http://www.tecmint.com/wp-content/uploads/2015/07/PHP-Debugging-Tool.png) -PHP调试工具 + +*PHP调试工具* 这里,‘-r‘ 选项会让PHP代码在Linux终端中不带`<`和`>`标记直接执行。 @@ -74,13 +80,14 @@ PHP调试工具 输入 ‘exit‘ 或者按下 ‘ctrl+c‘ 来关闭PHP交互模式。 ![Enable PHP Interactive Mode](http://www.tecmint.com/wp-content/uploads/2015/07/Enable-PHP-interactive-mode1.png) -启用PHP交互模式 + +*启用PHP交互模式* **4. 你可以仅仅将PHP脚本作为shell脚本来运行。首先,创建在你当前工作目录中创建一个PHP样例脚本。** # echo -e '#!/usr/bin/php\n' > phpscript.php -注意,我们在该PHP脚本的第一行使用#!/usr/bin/php,就像在shell脚本中那样(/bin/bash)。第一行的#!/usr/bin/php告诉Linux命令行将该脚本文件解析到PHP解释器中。 +注意,我们在该PHP脚本的第一行使用`#!/usr/bin/php`,就像在shell脚本中那样(`/bin/bash`)。第一行的`#!/usr/bin/php`告诉Linux命令行用 PHP 解释器来解析该脚本文件。 其次,让该脚本可执行: @@ -96,7 +103,7 @@ PHP调试工具 # php -a -创建一个函授,将它命名为 addition。同时,声明两个变量 $a 和 $b。 +创建一个函数,将它命名为 `addition`。同时,声明两个变量 `$a` 和 `$b`。 php > function addition ($a, $b) @@ -133,7 +140,8 @@ PHP调试工具 12.3NULL ![Create PHP Functions](http://www.tecmint.com/wp-content/uploads/2015/07/Create-PHP-Functions.png) -创建PHP函数 + +*创建PHP函数* 你可以一直运行该函数,直至退出交互模式(ctrl+z)。同时,你也应该注意到了,上面输出结果中返回的数据类型为 NULL。这个问题可以通过要求 php 交互 shell用 return 代替 echo 返回结果来修复。 @@ -152,11 +160,12 @@ PHP调试工具 这里是一个样例,在该样例的输出结果中返回了正确的数据类型。 ![PHP Functions](http://www.tecmint.com/wp-content/uploads/2015/07/PHP-Functions.png) -PHP函数 + +*PHP函数* 永远都记住,用户定义的函数不会从一个shell会话保留到下一个shell会话,因此,一旦你退出交互shell,它就会丢失了。 -希望你喜欢此次会话。保持连线,你会获得更多此类文章。保持关注,保持健康。请在下面的评论中为我们提供有价值的反馈。点赞并分享,帮助我们扩散。 +希望你喜欢此次教程。保持连线,你会获得更多此类文章。保持关注,保持健康。请在下面的评论中为我们提供有价值的反馈。点赞并分享,帮助我们扩散。 还请阅读: [12个Linux终端中有用的的PHP命令行用法——第二部分][1] @@ -164,9 +173,9 @@ PHP函数 via: http://www.tecmint.com/run-php-codes-from-linux-commandline/ -作者:[vishek Kumar][a] +作者:[Avishek Kumar][a] 译者:[GOLinux](https://github.com/GOLinux) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 9bd072c35fe1925c440fd8215c0d74d3126d4418 Mon Sep 17 00:00:00 2001 From: DeadFire Date: Tue, 28 Jul 2015 09:43:05 +0800 Subject: [PATCH 717/965] =?UTF-8?q?20150728-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...28 Process of the Linux kernel building.md | 674 ++++++++++++++++++ 1 file changed, 674 insertions(+) create mode 100644 sources/tech/20150728 Process of the Linux kernel building.md diff --git a/sources/tech/20150728 Process of the Linux kernel building.md b/sources/tech/20150728 Process of the Linux kernel building.md new file mode 100644 index 0000000000..cb7ec19b45 --- /dev/null +++ b/sources/tech/20150728 Process of the Linux kernel building.md @@ -0,0 +1,674 @@ +Process of the Linux kernel building +================================================================================ +Introduction +-------------------------------------------------------------------------------- + +I will not tell you how to build and install custom Linux kernel on your machine, you can find many many [resources](https://encrypted.google.com/search?q=building+linux+kernel#q=building+linux+kernel+from+source+code) that will help you to do it. Instead, we will know what does occur when you are typed `make` in the directory with Linux kernel source code in this part. When I just started to learn source code of the Linux kernel, the [Makefile](https://github.com/torvalds/linux/blob/master/Makefile) file was a first file that I've opened. And it was scary :) This [makefile](https://en.wikipedia.org/wiki/Make_%28software%29) contains `1591` lines of code at the time when I wrote this part and it was [third](https://github.com/torvalds/linux/commit/52721d9d3334c1cb1f76219a161084094ec634dc) release candidate. + +This makefile is the the top makefile in the Linux kernel source code and kernel build starts here. Yes, it is big, but moreover, if you've read the source code of the Linux kernel you can noted that all directories with a source code has an own makefile. Of course it is not real to describe how each source files compiled and linked. So, we will see compilation only for the standard case. You will not find here building of the kernel's documentation, cleaning of the kernel source code, [tags](https://en.wikipedia.org/wiki/Ctags) generation, [cross-compilation](https://en.wikipedia.org/wiki/Cross_compiler) related stuff and etc. We will start from the `make` execution with the standard kernel configuration file and will finish with the building of the [bzImage](https://en.wikipedia.org/wiki/Vmlinux#bzImage). + +It would be good if you're already familiar with the [make](https://en.wikipedia.org/wiki/Make_%28software%29) util, but I will anyway try to describe all code that will be in this part. + +So let's start. + +Preparation before the kernel compilation +--------------------------------------------------------------------------------- + +There are many things to preparate before the kernel compilation will be started. The main point here is to find and configure +the type of compilation, to parse command line arguments that are passed to the `make` util and etc. So let's dive into the top `Makefile` of the Linux kernel. + +The Linux kernel top `Makefile` is responsible for building two major products: [vmlinux](https://en.wikipedia.org/wiki/Vmlinux) (the resident kernel image) and the modules (any module files). The [Makefile](https://github.com/torvalds/linux/blob/master/Makefile) of the Linux kernel starts from the definition of the following variables: + +```Makefile +VERSION = 4 +PATCHLEVEL = 2 +SUBLEVEL = 0 +EXTRAVERSION = -rc3 +NAME = Hurr durr I'ma sheep +``` + +These variables determine the current version of the Linux kernel and are used in the different places, for example in the forming of the `KERNELVERSION` variable: + +```Makefile +KERNELVERSION = $(VERSION)$(if $(PATCHLEVEL),.$(PATCHLEVEL)$(if $(SUBLEVEL),.$(SUBLEVEL)))$(EXTRAVERSION) +``` + +After this we can see a couple of the `ifeq` condition that check some of the parameters passed to `make`. The Linux kernel `makefiles` provides a special `make help` target that prints all available targets and some of the command line arguments that can be passed to `make`. For example: `make V=1` - provides verbose builds. The first `ifeq` condition checks if the `V=n` option is passed to make: + +```Makefile +ifeq ("$(origin V)", "command line") + KBUILD_VERBOSE = $(V) +endif +ifndef KBUILD_VERBOSE + KBUILD_VERBOSE = 0 +endif + +ifeq ($(KBUILD_VERBOSE),1) + quiet = + Q = +else + quiet=quiet_ + Q = @ +endif + +export quiet Q KBUILD_VERBOSE +``` + +If this option is passed to `make` we set the `KBUILD_VERBOSE` variable to the value of the `V` option. Otherwise we set the `KBUILD_VERBOSE` variable to zero. After this we check value of the `KBUILD_VERBOSE` variable and set values of the `quiet` and `Q` variables depends on the `KBUILD_VERBOSE` value. The `@` symbols suppress the output of the command and if it will be set before a command we will see something like this: `CC scripts/mod/empty.o` instead of the `Compiling .... scripts/mod/empty.o`. In the end we just export all of these variables. The next `ifeq` statement checks that `O=/dir` option was passed to the `make`. This option allows to locate all output files in the given `dir`: + +```Makefile +ifeq ($(KBUILD_SRC),) + +ifeq ("$(origin O)", "command line") + KBUILD_OUTPUT := $(O) +endif + +ifneq ($(KBUILD_OUTPUT),) +saved-output := $(KBUILD_OUTPUT) +KBUILD_OUTPUT := $(shell mkdir -p $(KBUILD_OUTPUT) && cd $(KBUILD_OUTPUT) \ + && /bin/pwd) +$(if $(KBUILD_OUTPUT),, \ + $(error failed to create output directory "$(saved-output)")) + +sub-make: FORCE + $(Q)$(MAKE) -C $(KBUILD_OUTPUT) KBUILD_SRC=$(CURDIR) \ + -f $(CURDIR)/Makefile $(filter-out _all sub-make,$(MAKECMDGOALS)) + +skip-makefile := 1 +endif # ifneq ($(KBUILD_OUTPUT),) +endif # ifeq ($(KBUILD_SRC),) +``` + +We check the `KBUILD_SRC` that represent top directory of the source code of the linux kernel and if it is empty (it is empty every time while makefile executes first time) and the set the `KBUILD_OUTPUT` variable to the value that passed with the `O` option (if this option was passed). In the next step we check this `KBUILD_OUTPUT` variable and if we set it, we do following things: + +* Store value of the `KBUILD_OUTPUT` in the temp `saved-output` variable; +* Try to create given output directory; +* Check that directory created, in other way print error; +* If custom output directory created sucessfully, execute `make` again with the new directory (see `-C` option). + +The next `ifeq` statements checks that `C` or `M` options was passed to the make: + +```Makefile +ifeq ("$(origin C)", "command line") + KBUILD_CHECKSRC = $(C) +endif +ifndef KBUILD_CHECKSRC + KBUILD_CHECKSRC = 0 +endif + +ifeq ("$(origin M)", "command line") + KBUILD_EXTMOD := $(M) +endif +``` + +The first `C` option tells to the `makefile` that need to check all `c` source code with a tool provided by the `$CHECK` environment variable, by default it is [sparse](https://en.wikipedia.org/wiki/Sparse). The second `M` option provides build for the external modules (will not see this case in this part). As we set this variables we make a check of the `KBUILD_SRC` variable and if it is not set we set `srctree` variable to `.`: + +```Makefile +ifeq ($(KBUILD_SRC),) + srctree := . +endif + +objtree := . +src := $(srctree) +obj := $(objtree) + +export srctree objtree VPATH +``` + +That tells to `Makefile` that source tree of the Linux kernel will be in the current directory where `make` command was executed. After this we set `objtree` and other variables to this directory and export these variables. The next step is the getting value for the `SUBARCH` variable that will represent tewhat the underlying archicecture is: + +```Makefile +SUBARCH := $(shell uname -m | sed -e s/i.86/x86/ -e s/x86_64/x86/ \ + -e s/sun4u/sparc64/ \ + -e s/arm.*/arm/ -e s/sa110/arm/ \ + -e s/s390x/s390/ -e s/parisc64/parisc/ \ + -e s/ppc.*/powerpc/ -e s/mips.*/mips/ \ + -e s/sh[234].*/sh/ -e s/aarch64.*/arm64/ ) +``` + +As you can see it executes [uname](https://en.wikipedia.org/wiki/Uname) utils that prints information about machine, operating system and architecture. As it will get output of the `uname` util, it will parse it and assign to the `SUBARCH` variable. As we got `SUBARCH`, we set the `SRCARCH` variable that provides directory of the certain architecture and `hfr-arch` that provides directory for the header files: + +```Makefile +ifeq ($(ARCH),i386) + SRCARCH := x86 +endif +ifeq ($(ARCH),x86_64) + SRCARCH := x86 +endif + +hdr-arch := $(SRCARCH) +``` + +Note that `ARCH` is the alias for the `SUBARCH`. In the next step we set the `KCONFIG_CONFIG` variable that represents path to the kernel configuration file and if it was not set before, it will be `.config` by default: + +```Makefile +KCONFIG_CONFIG ?= .config +export KCONFIG_CONFIG +``` + +and the [shell](https://en.wikipedia.org/wiki/Shell_%28computing%29) that will be used during kernel compilation: + +```Makefile +CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \ + else if [ -x /bin/bash ]; then echo /bin/bash; \ + else echo sh; fi ; fi) +``` + +The next set of variables related to the compiler that will be used during Linux kernel compilation. We set the host compilers for the `c` and `c++` and flags for it: + +```Makefile +HOSTCC = gcc +HOSTCXX = g++ +HOSTCFLAGS = -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer -std=gnu89 +HOSTCXXFLAGS = -O2 +``` + +Next we will meet the `CC` variable that represent compiler too, so why do we need in the `HOST*` variables? The `CC` is the target compiler that will be used during kernel compilation, but `HOSTCC` will be used during compilation of the set of the `host` programs (we will see it soon). After this we can see definition of the `KBUILD_MODULES` and `KBUILD_BUILTIN` variables that are used for the determination of the what to compile (kernel, modules or both): + +```Makefile +KBUILD_MODULES := +KBUILD_BUILTIN := 1 + +ifeq ($(MAKECMDGOALS),modules) + KBUILD_BUILTIN := $(if $(CONFIG_MODVERSIONS),1) +endif +``` + +Here we can see definition of these variables and the value of the `KBUILD_BUILTIN` will depens on the `CONFIG_MODVERSIONS` kernel configuration parameter if we pass only `modules` to the `make`. The next step is including of the: + +```Makefile +include scripts/Kbuild.include +``` + +`kbuild` file. The [Kbuild](https://github.com/torvalds/linux/blob/master/Documentation/kbuild/kbuild.txt) or `Kernel Build System` is the special infrastructure to manage building of the kernel and its modules. The `kbuild` files has the same syntax that makefiles. The [scripts/Kbuild.include](https://github.com/torvalds/linux/blob/master/scripts/Kbuild.include) file provides some generic definitions for the `kbuild` system. As we included this `kbuild` files we can see definition of the variables that are related to the different tools that will be used during kernel and modules compilation (like linker, compilers, utils from the [binutils](http://www.gnu.org/software/binutils/) and etc...): + +```Makefile +AS = $(CROSS_COMPILE)as +LD = $(CROSS_COMPILE)ld +CC = $(CROSS_COMPILE)gcc +CPP = $(CC) -E +AR = $(CROSS_COMPILE)ar +NM = $(CROSS_COMPILE)nm +STRIP = $(CROSS_COMPILE)strip +OBJCOPY = $(CROSS_COMPILE)objcopy +OBJDUMP = $(CROSS_COMPILE)objdump +AWK = awk +... +... +... +``` + +After definition of these variables we define two variables: `USERINCLUDE` and `LINUXINCLUDE`. They will contain paths of the directories with headers (public for users in the first case and for kernel in the second case): + +```Makefile +USERINCLUDE := \ + -I$(srctree)/arch/$(hdr-arch)/include/uapi \ + -Iarch/$(hdr-arch)/include/generated/uapi \ + -I$(srctree)/include/uapi \ + -Iinclude/generated/uapi \ + -include $(srctree)/include/linux/kconfig.h + +LINUXINCLUDE := \ + -I$(srctree)/arch/$(hdr-arch)/include \ + ... +``` + +And the standard flags for the C compiler: + +```Makefile +KBUILD_CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \ + -fno-strict-aliasing -fno-common \ + -Werror-implicit-function-declaration \ + -Wno-format-security \ + -std=gnu89 +``` + +It is the not last compiler flags, they can be updated by the other makefiles (for example kbuilds from `arch/`). After all of these, all variables will be exported to be available in the other makefiles. The following two the `RCS_FIND_IGNORE` and the `RCS_TAR_IGNORE` variables will contain files that will be ignored in the version control system: + +```Makefile +export RCS_FIND_IGNORE := \( -name SCCS -o -name BitKeeper -o -name .svn -o \ + -name CVS -o -name .pc -o -name .hg -o -name .git \) \ + -prune -o +export RCS_TAR_IGNORE := --exclude SCCS --exclude BitKeeper --exclude .svn \ + --exclude CVS --exclude .pc --exclude .hg --exclude .git +``` + +That's all. We have finished with the all preparations, next point is the building of `vmlinux`. + +Directly to the kernel build +-------------------------------------------------------------------------------- + +As we have finished all preparations, next step in the root makefile is related to the kernel build. Before this moment we will not see in the our terminal after the execution of the `make` command. But now first steps of the compilation are started. In this moment we need to go on the [598](https://github.com/torvalds/linux/blob/master/Makefile#L598) line of the Linux kernel top makefile and we will see `vmlinux` target there: + +```Makefile +all: vmlinux + include arch/$(SRCARCH)/Makefile +``` + +Don't worry that we have missed many lines in Makefile that are placed after `export RCS_FIND_IGNORE.....` and before `all: vmlinux.....`. This part of the makefile is responsible for the `make *.config` targets and as I wrote in the beginning of this part we will see only building of the kernel in a general way. + +The `all:` target is the default when no target is given on the command line. You can see here that we include architecture specific makefile there (in our case it will be [arch/x86/Makefile](https://github.com/torvalds/linux/blob/master/arch/x86/Makefile)). From this moment we will continue from this makefile. As we can see `all` target depends on the `vmlinux` target that defined a little lower in the top makefile: + +```Makefile +vmlinux: scripts/link-vmlinux.sh $(vmlinux-deps) FORCE +``` + +The `vmlinux` is is the Linux kernel in an statically linked executable file format. The [scripts/link-vmlinux.sh](https://github.com/torvalds/linux/blob/master/scripts/link-vmlinux.sh) script links combines different compiled subsystems into vmlinux. The second target is the `vmlinux-deps` that defined as: + +```Makefile +vmlinux-deps := $(KBUILD_LDS) $(KBUILD_VMLINUX_INIT) $(KBUILD_VMLINUX_MAIN) +``` + +and consists from the set of the `built-in.o` from the each top directory of the Linux kernel. Later, when we will go through all directories in the Linux kernel, the `Kbuild` will compile all the `$(obj-y)` files. It then calls `$(LD) -r` to merge these files into one `built-in.o` file. For this moment we have no `vmlinux-deps`, so the `vmlinux` target will not be executed now. For me `vmlinux-deps` contains following files: + +``` +arch/x86/kernel/vmlinux.lds arch/x86/kernel/head_64.o +arch/x86/kernel/head64.o arch/x86/kernel/head.o +init/built-in.o usr/built-in.o +arch/x86/built-in.o kernel/built-in.o +mm/built-in.o fs/built-in.o +ipc/built-in.o security/built-in.o +crypto/built-in.o block/built-in.o +lib/lib.a arch/x86/lib/lib.a +lib/built-in.o arch/x86/lib/built-in.o +drivers/built-in.o sound/built-in.o +firmware/built-in.o arch/x86/pci/built-in.o +arch/x86/power/built-in.o arch/x86/video/built-in.o +net/built-in.o +``` + +The next target that can be executed is following: + +```Makefile +$(sort $(vmlinux-deps)): $(vmlinux-dirs) ; +$(vmlinux-dirs): prepare scripts + $(Q)$(MAKE) $(build)=$@ +``` + +As we can see the `vmlinux-dirs` depends on the two targets: `prepare` and `scripts`. The first `prepare` defined in the top `Makefile` of the Linux kernel and executes three stages of preparations: + +```Makefile +prepare: prepare0 +prepare0: archprepare FORCE + $(Q)$(MAKE) $(build)=. +archprepare: archheaders archscripts prepare1 scripts_basic + +prepare1: prepare2 $(version_h) include/generated/utsrelease.h \ + include/config/auto.conf + $(cmd_crmodverdir) +prepare2: prepare3 outputmakefile asm-generic +``` + +The first `prepare0` expands to the `archprepare` that exapnds to the `archheaders` and `archscripts` that defined in the `x86_64` specific [Makefile](https://github.com/torvalds/linux/blob/master/arch/x86/Makefile). Let's look on it. The `x86_64` specific makefile starts from the definition of the variables that are related to the archicteture-specific configs ([defconfig](https://github.com/torvalds/linux/tree/master/arch/x86/configs) and etc.). After this it defines flags for the compiling of the [16-bit](https://en.wikipedia.org/wiki/Real_mode) code, calculating of the `BITS` variable that can be `32` for `i386` or `64` for the `x86_64` flags for the assembly source code, flags for the linker and many many more (all definitions you can find in the [arch/x86/Makefile](https://github.com/torvalds/linux/blob/master/arch/x86/Makefile)). The first target is `archheaders` in the makefile generates syscall table: + +```Makefile +archheaders: + $(Q)$(MAKE) $(build)=arch/x86/entry/syscalls all +``` + +And the second target is `archscripts` in this makefile is: + +```Makefile +archscripts: scripts_basic + $(Q)$(MAKE) $(build)=arch/x86/tools relocs +``` + +We can see that it depends on the `scripts_basic` target from the top [Makefile](https://github.com/torvalds/linux/blob/master/Makefile). At the first we can see the `scripts_basic` target that executes make for the [scripts/basic](https://github.com/torvalds/linux/blob/master/scripts/basic/Makefile) makefile: + +```Maklefile +scripts_basic: + $(Q)$(MAKE) $(build)=scripts/basic +``` + +The `scripts/basic/Makefile` contains targets for compilation of the two host programs: `fixdep` and `bin2`: + +```Makefile +hostprogs-y := fixdep +hostprogs-$(CONFIG_BUILD_BIN2C) += bin2c +always := $(hostprogs-y) + +$(addprefix $(obj)/,$(filter-out fixdep,$(always))): $(obj)/fixdep +``` + +First program is `fixdep` - optimizes list of dependencies generated by the [gcc](https://gcc.gnu.org/) that tells make when to remake a source code file. The second program is `bin2c` depends on the value of the `CONFIG_BUILD_BIN2C` kernel configuration option and very little C program that allows to convert a binary on stdin to a C include on stdout. You can note here strange notation: `hostprogs-y` and etc. This notation is used in the all `kbuild` files and more about it you can read in the [documentation](https://github.com/torvalds/linux/blob/master/Documentation/kbuild/makefiles.txt). In our case the `hostprogs-y` tells to the `kbuild` that there is one host program named `fixdep` that will be built from the will be built from `fixdep.c` that located in the same directory that `Makefile`. The first output after we will execute `make` command in our terminal will be result of this `kbuild` file: + +``` +$ make + HOSTCC scripts/basic/fixdep +``` + +As `script_basic` target was executed, the `archscripts` target will execute `make` for the [arch/x86/tools](https://github.com/torvalds/linux/blob/master/arch/x86/tools/Makefile) makefile with the `relocs` target: + +```Makefile +$(Q)$(MAKE) $(build)=arch/x86/tools relocs +``` + +The `relocs_32.c` and the `relocs_64.c` will be compiled that will contain [relocation](https://en.wikipedia.org/wiki/Relocation_%28computing%29) information and we will see it in the `make` output: + +```Makefile + HOSTCC arch/x86/tools/relocs_32.o + HOSTCC arch/x86/tools/relocs_64.o + HOSTCC arch/x86/tools/relocs_common.o + HOSTLD arch/x86/tools/relocs +``` + +There is checking of the `version.h` after compiling of the `relocs.c`: + +```Makefile +$(version_h): $(srctree)/Makefile FORCE + $(call filechk,version.h) + $(Q)rm -f $(old_version_h) +``` + +We can see it in the output: + +``` +CHK include/config/kernel.release +``` + +and the building of the `generic` assembly headers with the `asm-generic` target from the `arch/x86/include/generated/asm` that generated in the top Makefile of the Linux kernel. After the `asm-generic` target the `archprepare` will be done, so the `prepare0` target will be executed. As I wrote above: + +```Makefile +prepare0: archprepare FORCE + $(Q)$(MAKE) $(build)=. +``` + +Note on the `build`. It defined in the [scripts/Kbuild.include](https://github.com/torvalds/linux/blob/master/scripts/Kbuild.include) and looks like this: + +```Makefile +build := -f $(srctree)/scripts/Makefile.build obj +``` + +or in our case it is current source directory - `.`: + +```Makefile +$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.build obj=. +``` + +The [scripts/Makefile.build](https://github.com/torvalds/linux/blob/master/scripts/Makefile.build) tries to find the `Kbuild` file by the given directory via the `obj` parameter, include this `Kbuild` files: + +```Makefile +include $(kbuild-file) +``` + +and build targets from it. In our case `.` contains the [Kbuild](https://github.com/torvalds/linux/blob/master/Kbuild) file that generates the `kernel/bounds.s` and the `arch/x86/kernel/asm-offsets.s`. After this the `prepare` target finished to work. The `vmlinux-dirs` also depends on the second target - `scripts` that compiles following programs: `file2alias`, `mk_elfconfig`, `modpost` and etc... After scripts/host-programs compilation our `vmlinux-dirs` target can be executed. First of all let's try to understand what does `vmlinux-dirs` contain. For my case it contains paths of the following kernel directories: + +``` +init usr arch/x86 kernel mm fs ipc security crypto block +drivers sound firmware arch/x86/pci arch/x86/power +arch/x86/video net lib arch/x86/lib +``` + +We can find definition of the `vmlinux-dirs` in the top [Makefile](https://github.com/torvalds/linux/blob/master/Makefile) of the Linux kernel: + +```Makefile +vmlinux-dirs := $(patsubst %/,%,$(filter %/, $(init-y) $(init-m) \ + $(core-y) $(core-m) $(drivers-y) $(drivers-m) \ + $(net-y) $(net-m) $(libs-y) $(libs-m))) + +init-y := init/ +drivers-y := drivers/ sound/ firmware/ +net-y := net/ +libs-y := lib/ +... +... +... +``` + +Here we remove the `/` symbol from the each directory with the help of the `patsubst` and `filter` functions and put it to the `vmlinux-dirs`. So we have list of directories in the `vmlinux-dirs` and the following code: + +```Makefile +$(vmlinux-dirs): prepare scripts + $(Q)$(MAKE) $(build)=$@ +``` + +The `$@` represents `vmlinux-dirs` here that means that it will go recursively over all directories from the `vmlinux-dirs` and its internal directories (depens on configuration) and will execute `make` in there. We can see it in the output: + +``` + CC init/main.o + CHK include/generated/compile.h + CC init/version.o + CC init/do_mounts.o + ... + CC arch/x86/crypto/glue_helper.o + AS arch/x86/crypto/aes-x86_64-asm_64.o + CC arch/x86/crypto/aes_glue.o + ... + AS arch/x86/entry/entry_64.o + AS arch/x86/entry/thunk_64.o + CC arch/x86/entry/syscall_64.o +``` + +Source code in each directory will be compiled and linked to the `built-in.o`: + +``` +$ find . -name built-in.o +./arch/x86/crypto/built-in.o +./arch/x86/crypto/sha-mb/built-in.o +./arch/x86/net/built-in.o +./init/built-in.o +./usr/built-in.o +... +... +``` + +Ok, all buint-in.o(s) built, now we can back to the `vmlinux` target. As you remember, the `vmlinux` target is in the top Makefile of the Linux kernel. Before the linking of the `vmlinux` it builds [samples](https://github.com/torvalds/linux/tree/master/samples), [Documentation](https://github.com/torvalds/linux/tree/master/Documentation) and etc., but I will not describe it in this part as I wrote in the beginning of this part. + +```Makefile +vmlinux: scripts/link-vmlinux.sh $(vmlinux-deps) FORCE + ... + ... + +$(call if_changed,link-vmlinux) +``` + +As you can see main purpose of it is a call of the [scripts/link-vmlinux.sh](https://github.com/torvalds/linux/blob/master/scripts/link-vmlinux.sh) script is linking of the all `built-in.o`(s) to the one statically linked executable and creation of the [System.map](https://en.wikipedia.org/wiki/System.map). In the end we will see following output: + +``` + LINK vmlinux + LD vmlinux.o + MODPOST vmlinux.o + GEN .version + CHK include/generated/compile.h + UPD include/generated/compile.h + CC init/version.o + LD init/built-in.o + KSYM .tmp_kallsyms1.o + KSYM .tmp_kallsyms2.o + LD vmlinux + SORTEX vmlinux + SYSMAP System.map +``` + +and `vmlinux` and `System.map` in the root of the Linux kernel source tree: + +``` +$ ls vmlinux System.map +System.map vmlinux +``` + +That's all, `vmlinux` is ready. The next step is creation of the [bzImage](https://en.wikipedia.org/wiki/Vmlinux#bzImage). + +Building bzImage +-------------------------------------------------------------------------------- + +The `bzImage` is the compressed Linux kernel image. We can get it with the execution of the `make bzImage` after the `vmlinux` built. In other way we can just execute `make` without arguments and will get `bzImage` anyway because it is default image: + +```Makefile +all: bzImage +``` + +in the [arch/x86/kernel/Makefile](https://github.com/torvalds/linux/blob/master/arch/x86/Makefile). Let's look on this target, it will help us to understand how this image builds. As I already said the `bzImage` target defined in the [arch/x86/kernel/Makefile](https://github.com/torvalds/linux/blob/master/arch/x86/Makefile) and looks like this: + +```Makefile +bzImage: vmlinux + $(Q)$(MAKE) $(build)=$(boot) $(KBUILD_IMAGE) + $(Q)mkdir -p $(objtree)/arch/$(UTS_MACHINE)/boot + $(Q)ln -fsn ../../x86/boot/bzImage $(objtree)/arch/$(UTS_MACHINE)/boot/$@ +``` + +We can see here, that first of all called `make` for the boot directory, in our case it is: + +```Makefile +boot := arch/x86/boot +``` + +The main goal now to build source code in the `arch/x86/boot` and `arch/x86/boot/compressed` directories, build `setup.bin` and `vmlinux.bin`, and build the `bzImage` from they in the end. First target in the [arch/x86/boot/Makefile](https://github.com/torvalds/linux/blob/master/arch/x86/boot/Makefile) is the `$(obj)/setup.elf`: + +```Makefile +$(obj)/setup.elf: $(src)/setup.ld $(SETUP_OBJS) FORCE + $(call if_changed,ld) +``` + +We already have the `setup.ld` linker script in the `arch/x86/boot` directory and the `SETUP_OBJS` expands to the all source files from the `boot` directory. We can see first output: + +```Makefile + AS arch/x86/boot/bioscall.o + CC arch/x86/boot/cmdline.o + AS arch/x86/boot/copy.o + HOSTCC arch/x86/boot/mkcpustr + CPUSTR arch/x86/boot/cpustr.h + CC arch/x86/boot/cpu.o + CC arch/x86/boot/cpuflags.o + CC arch/x86/boot/cpucheck.o + CC arch/x86/boot/early_serial_console.o + CC arch/x86/boot/edd.o +``` + +The next source code file is the [arch/x86/boot/header.S](https://github.com/torvalds/linux/blob/master/arch/x86/boot/header.S), but we can't build it now because this target depends on the following two header files: + +```Makefile +$(obj)/header.o: $(obj)/voffset.h $(obj)/zoffset.h +``` + +The first is `voffset.h` generated by the `sed` script that gets two addresses from the `vmlinux` with the `nm` util: + +```C +#define VO__end 0xffffffff82ab0000 +#define VO__text 0xffffffff81000000 +``` + +They are start and end of the kernel. The second is `zoffset.h` depens on the `vmlinux` target from the [arch/x86/boot/compressed/Makefile](https://github.com/torvalds/linux/blob/master/arch/x86/boot/compressed/Makefile): + +```Makefile +$(obj)/zoffset.h: $(obj)/compressed/vmlinux FORCE + $(call if_changed,zoffset) +``` + +The `$(obj)/compressed/vmlinux` target depends on the `vmlinux-objs-y` that compiles source code files from the [arch/x86/boot/compressed](https://github.com/torvalds/linux/tree/master/arch/x86/boot/compressed) directory and generates `vmlinux.bin`, `vmlinux.bin.bz2`, and compiles programm - `mkpiggy`. We can see this in the output: + +```Makefile + LDS arch/x86/boot/compressed/vmlinux.lds + AS arch/x86/boot/compressed/head_64.o + CC arch/x86/boot/compressed/misc.o + CC arch/x86/boot/compressed/string.o + CC arch/x86/boot/compressed/cmdline.o + OBJCOPY arch/x86/boot/compressed/vmlinux.bin + BZIP2 arch/x86/boot/compressed/vmlinux.bin.bz2 + HOSTCC arch/x86/boot/compressed/mkpiggy +``` + +Where the `vmlinux.bin` is the `vmlinux` with striped debuging information and comments and the `vmlinux.bin.bz2` compressed `vmlinux.bin.all` + `u32` size of `vmlinux.bin.all`. The `vmlinux.bin.all` is `vmlinux.bin + vmlinux.relocs`, where `vmlinux.relocs` is the `vmlinux` that was handled by the `relocs` program (see above). As we got these files, the `piggy.S` assembly files will be generated with the `mkpiggy` program and compiled: + +```Makefile + MKPIGGY arch/x86/boot/compressed/piggy.S + AS arch/x86/boot/compressed/piggy.o +``` + +This assembly files will contain computed offset from a compressed kernel. After this we can see that `zoffset` generated: + +```Makefile + ZOFFSET arch/x86/boot/zoffset.h +``` + +As the `zoffset.h` and the `voffset.h` are generated, compilation of the source code files from the [arch/x86/boot](https://github.com/torvalds/linux/tree/master/arch/x86/boot/) can be continued: + +```Makefile + AS arch/x86/boot/header.o + CC arch/x86/boot/main.o + CC arch/x86/boot/mca.o + CC arch/x86/boot/memory.o + CC arch/x86/boot/pm.o + AS arch/x86/boot/pmjump.o + CC arch/x86/boot/printf.o + CC arch/x86/boot/regs.o + CC arch/x86/boot/string.o + CC arch/x86/boot/tty.o + CC arch/x86/boot/video.o + CC arch/x86/boot/video-mode.o + CC arch/x86/boot/video-vga.o + CC arch/x86/boot/video-vesa.o + CC arch/x86/boot/video-bios.o +``` + +As all source code files will be compiled, they will be linked to the `setup.elf`: + +```Makefile + LD arch/x86/boot/setup.elf +``` + +or: + +``` +ld -m elf_x86_64 -T arch/x86/boot/setup.ld arch/x86/boot/a20.o arch/x86/boot/bioscall.o arch/x86/boot/cmdline.o arch/x86/boot/copy.o arch/x86/boot/cpu.o arch/x86/boot/cpuflags.o arch/x86/boot/cpucheck.o arch/x86/boot/early_serial_console.o arch/x86/boot/edd.o arch/x86/boot/header.o arch/x86/boot/main.o arch/x86/boot/mca.o arch/x86/boot/memory.o arch/x86/boot/pm.o arch/x86/boot/pmjump.o arch/x86/boot/printf.o arch/x86/boot/regs.o arch/x86/boot/string.o arch/x86/boot/tty.o arch/x86/boot/video.o arch/x86/boot/video-mode.o arch/x86/boot/version.o arch/x86/boot/video-vga.o arch/x86/boot/video-vesa.o arch/x86/boot/video-bios.o -o arch/x86/boot/setup.elf +``` + +The last two things is the creation of the `setup.bin` that will contain compiled code from the `arch/x86/boot/*` directory: + +``` +objcopy -O binary arch/x86/boot/setup.elf arch/x86/boot/setup.bin +``` + +and the creation of the `vmlinux.bin` from the `vmlinux`: + +``` +objcopy -O binary -R .note -R .comment -S arch/x86/boot/compressed/vmlinux arch/x86/boot/vmlinux.bin +``` + +In the end we compile host program: [arch/x86/boot/tools/build.c](https://github.com/torvalds/linux/blob/master/arch/x86/boot/tools/build.c) that will create our `bzImage` from the `setup.bin` and the `vmlinux.bin`: + +``` +arch/x86/boot/tools/build arch/x86/boot/setup.bin arch/x86/boot/vmlinux.bin arch/x86/boot/zoffset.h arch/x86/boot/bzImage +``` + +Actually the `bzImage` is the concatenated `setup.bin` and the `vmlinux.bin`. In the end we will see the output which familiar to all who once build the Linux kernel from source: + +``` +Setup is 16268 bytes (padded to 16384 bytes). +System is 4704 kB +CRC 94a88f9a +Kernel: arch/x86/boot/bzImage is ready (#5) +``` + +That's all. + +Conclusion +================================================================================ + +It is the end of this part and here we saw all steps from the execution of the `make` command to the generation of the `bzImage`. I know, the Linux kernel makefiles and process of the Linux kernel building may seem confusing at first glance, but it is not so hard. Hope this part will help you to understand process of the Linux kernel building. + +Links +================================================================================ + +* [GNU make util](https://en.wikipedia.org/wiki/Make_%28software%29) +* [Linux kernel top Makefile](https://github.com/torvalds/linux/blob/master/Makefile) +* [cross-compilation](https://en.wikipedia.org/wiki/Cross_compiler) +* [Ctags](https://en.wikipedia.org/wiki/Ctags) +* [sparse](https://en.wikipedia.org/wiki/Sparse) +* [bzImage](https://en.wikipedia.org/wiki/Vmlinux#bzImage) +* [uname](https://en.wikipedia.org/wiki/Uname) +* [shell](https://en.wikipedia.org/wiki/Shell_%28computing%29) +* [Kbuild](https://github.com/torvalds/linux/blob/master/Documentation/kbuild/kbuild.txt) +* [binutils](http://www.gnu.org/software/binutils/) +* [gcc](https://gcc.gnu.org/) +* [Documentation](https://github.com/torvalds/linux/blob/master/Documentation/kbuild/makefiles.txt) +* [System.map](https://en.wikipedia.org/wiki/System.map) +* [Relocation](https://en.wikipedia.org/wiki/Relocation_%28computing%29) + +-------------------------------------------------------------------------------- + +via: https://github.com/0xAX/linux-insides/blob/master/Misc/how_kernel_compiled.md + +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 \ No newline at end of file From 0c6b380f27e7308dbef79d5a736f7a6efc9f71e6 Mon Sep 17 00:00:00 2001 From: DeadFire Date: Tue, 28 Jul 2015 10:53:51 +0800 Subject: [PATCH 718/965] =?UTF-8?q?20150728-2=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...vity and Check Memory Usages of Browser.md | 129 ++++++++++++++++++ ...y Using 'Explain Shell' Script in Linux.md | 118 ++++++++++++++++ 2 files changed, 247 insertions(+) create mode 100644 sources/tech/20150728 Tips to Create ISO from CD, Watch User Activity and Check Memory Usages of Browser.md create mode 100644 sources/tech/20150728 Understanding Shell Commands Easily Using 'Explain Shell' Script in Linux.md diff --git a/sources/tech/20150728 Tips to Create ISO from CD, Watch User Activity and Check Memory Usages of Browser.md b/sources/tech/20150728 Tips to Create ISO from CD, Watch User Activity and Check Memory Usages of Browser.md new file mode 100644 index 0000000000..6adc5abaa6 --- /dev/null +++ b/sources/tech/20150728 Tips to Create ISO from CD, Watch User Activity and Check Memory Usages of Browser.md @@ -0,0 +1,129 @@ +Tips to Create ISO from CD, Watch User Activity and Check Memory Usages of Browser +================================================================================ +Here again, I have written another post on [Linux Tips and Tricks][1] series. Since beginning the objective of this post is to make you aware of those small tips and hacks that lets you manage your system/server efficiently. + +![Create Cdrom ISO Image and Monitor Users in Linux](http://www.tecmint.com/wp-content/uploads/2015/07/creating-cdrom-iso-watch-users-in-linux.jpg) + +Create Cdrom ISO Image and Monitor Users in Linux + +In this post we will see how to create ISO image from the contents of CD/DVD loaded in the drive, Open random man pages for learning, know details of other logged-in users and what they are doing and monitoring the memory usages of a browser, and all these using native tools/commands without any third-party application/utility. Here we go… + +### Create ISO image from a CD ### + +Often we need to backup/copy the content of CD/DVD. If you are on Linux platform you do not need any additional software. All you need is the access to Linux console. + +To create ISO image of the files in your CD/DVD ROM, you need two things. The first thing is you need to find the name of your CD/DVD drive. To find the name of your CD/DVD drive, you may choose any of the below three methods. + +**1. Run command lsblk (list block devices) from your terminal/console.** + + $ lsblk + +![Find Block Devices in Linux](http://www.tecmint.com/wp-content/uploads/2015/07/Find-Block-Devices.png) + +Find Block Devices + +**2. To see information about CD-ROM, you may use commands like less or more.** + + $ less /proc/sys/dev/cdrom/info + +![Check Cdrom Information](http://www.tecmint.com/wp-content/uploads/2015/07/Check-Cdrom-Inforamtion.png) + +Check Cdrom Information + +**3. You may get the same information from [dmesg command][2] and customize the output using egrep.** + +The command ‘dmesg‘ print/control the kernel buffer ring. ‘egrep‘ command is used to print lines that matches a pattern. Option -i and –color with egrep is used to ignore case sensitive search and highlight the matching string respectively. + + $ dmesg | egrep -i --color 'cdrom|dvd|cd/rw|writer' + +![Find Device Information](http://www.tecmint.com/wp-content/uploads/2015/07/Find-Device-Information.png) + +Find Device Information + +Once you know the name of your CD/DVD, you can use following command to create a ISO image of your cdrom in Linux. + + $ cat /dev/sr0 > /path/to/output/folder/iso_name.iso + +Here ‘sr0‘ is the name of my CD/DVD drive. You should replace this with the name of your CD/DVD. This will help you in creating ISO image and backup contents of CD/DVD without any third-party application. + +![Create ISO Image of CDROM in Linux](http://www.tecmint.com/wp-content/uploads/2015/07/Create-ISO-Image-of-CDROM.png) + +Create ISO Image of CDROM + +### Open a man page randomly for Reading ### + +If you are new to Linux and want to learn commands and switches, this tweak is for you. Put the below line of code at the end of your `~/.bashrc` file. + + /use/bin/man $(ls /bin | shuf | head -1) + +Remember to put the above one line script in users’s `.bashrc` file and not in the .bashrc file of root. So when the next you login either locally or remotely using SSH you will see a man page randomly opened for you to read. For the newbies who want to learn commands and command-line switches, this will prove helpful. + +Here is what I got in my terminal after logging in to session for two times back-to-back. + +![LoadKeys Man Pages](http://www.tecmint.com/wp-content/uploads/2015/07/LoadKeys-Man-Pages.png) + +LoadKeys Man Pages + +![Zgrep Man Pages](http://www.tecmint.com/wp-content/uploads/2015/07/Zgrep-Man-Pages.png) + +Zgrep Man Pages + +### Check Activity of Logged-in Users ### + +Know what other users are doing on your shared server. + +In most general case, either you are a user of Shared Linux Server or the Admin. If you are concerned about your server and want to check what other users are doing, you may try command ‘w‘. + +This command lets you know if someone is executing any malicious code or tampering the server, slowing it down or anything else. ‘w‘ is the preferred way of keeping an eye on logged on users and what they are doing. + +To see logged on users and what they re doing, run command ‘w’ from terminal, preferably as root. + + # w + +![Check Linux User Activity](http://www.tecmint.com/wp-content/uploads/2015/07/Check-Linux-User-Activity.png) + +Check Linux User Activity + +### Check Memory usages by Browser ### + +These days a lot of jokes are cracked on Google-chrome and its demand of memory. If you want to know the memory usages of a browser, you can list the name of the process, its PID and Memory usages of it. To check memory usages of a browser, just enter the “about:memory” in the address bar without quotes. + +I have tested it on Google-Chrome and Mozilla Firefox web browser. If you can check it on any other browser and it works well you may acknowledge us in the comments below. Also you may kill the browser process simply as if you have done for any Linux terminal process/service. + +In Google Chrome, type `about:memory` in address bar, you should get something similar to below image. + +![Check Chrome Memory Usage](http://www.tecmint.com/wp-content/uploads/2015/07/Check-Chrome-Memory-Usage.png) + +Check Chrome Memory Usage + +In Mozilla Firefox, type `about:memory` in address bar, you should get something similar to below image. + +![Check Firefox Memory Usage](http://www.tecmint.com/wp-content/uploads/2015/07/Check-Firefox-Memory-Usage.png) + +Check Firefox Memory Usage + +Out of these options you may select any of them, if you understand what it is. To check memory usages, click the left most option ‘Measure‘. + +![Firefox Main Process](http://www.tecmint.com/wp-content/uploads/2015/07/Firefox-Main-Processes.png) + +Firefox Main Process + +It shows tree like process-memory usages by browser. + +That’s all for now. Hope all the above tips will help you at some point of time. If you have one (or more) tips/tricks that will help Linux Users to manage their Linux System/Server more efficiently ans is lesser known, you may like to share it with us. + +I’ll be here with another post soon, till then stay tuned and connected to TecMint. Provide us with your valuable feedback in the comments below. Like and share us and help us get spread. + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/creating-cdrom-iso-image-watch-user-activity-in-linux/ + +作者:[Avishek Kumar][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/avishek/ +[1]:http://www.tecmint.com/tag/linux-tricks/ +[2]:http://www.tecmint.com/dmesg-commands/ \ No newline at end of file diff --git a/sources/tech/20150728 Understanding Shell Commands Easily Using 'Explain Shell' Script in Linux.md b/sources/tech/20150728 Understanding Shell Commands Easily Using 'Explain Shell' Script in Linux.md new file mode 100644 index 0000000000..fe76f160cb --- /dev/null +++ b/sources/tech/20150728 Understanding Shell Commands Easily Using 'Explain Shell' Script in Linux.md @@ -0,0 +1,118 @@ +Understanding Shell Commands Easily Using “Explain Shell” Script in Linux +================================================================================ +While working on Linux platform all of us need help on shell commands, at some point of time. Although inbuilt help like man pages, whatis command is helpful, but man pages output are too lengthy and until and unless one has some experience with Linux, it is very difficult to get any help from massive man pages. The output of whatis command is rarely more than one line which is not sufficient for newbies. + +![Explain Shell Commands in Linux Shell](http://www.tecmint.com/wp-content/uploads/2015/07/Explain-Shell-Commands-in-Linux-Shell.jpeg) + +Explain Shell Commands in Linux Shell + +There are third-party application like ‘cheat‘, which we have covered here “[Commandline Cheat Sheet for Linux Users][1]. Although Cheat is an exceptionally good application which shows help on shell command even when computer is not connected to Internet, it shows help on predefined commands only. + +There is a small piece of code written by Jackson which is able to explain shell commands within the bash shell very effectively and guess what the best part is you don’t need to install any third party package. He named the file containing this piece of code as `'explain.sh'`. + +#### Features of Explain Utility #### + +- Easy Code Embedding. +- No third-party utility needed to be installed. +- Output just enough information in course of explanation. +- Requires internet connection to work. +- Pure command-line utility. +- Able to explain most of the shell commands in bash shell. +- No root Account involvement required. + +**Prerequisite** + +The only requirement is `'curl'` package. In most of the today’s latest Linux distributions, curl package comes pre-installed, if not you can install it using package manager as shown below. + + # apt-get install curl [On Debian systems] + # yum install curl [On CentOS systems] + +### Installation of explain.sh Utility in Linux ### + +We have to insert the below piece of code as it is in the `~/.bashrc` file. The code should be inserted for each user and each `.bashrc` file. It is suggested to insert the code to the user’s .bashrc file only and not in the .bashrc of root user. + +Notice the first line of code that starts with hash `(#)` is optional and added just to differentiate rest of the codes of .bashrc. + +# explain.sh marks the beginning of the codes, we are inserting in .bashrc file at the bottom of this file. + + # explain.sh begins + explain () { + if [ "$#" -eq 0 ]; then + while read -p "Command: " cmd; do + curl -Gs "https://www.mankier.com/api/explain/?cols="$(tput cols) --data-urlencode "q=$cmd" + done + echo "Bye!" + elif [ "$#" -eq 1 ]; then + curl -Gs "https://www.mankier.com/api/explain/?cols="$(tput cols) --data-urlencode "q=$1" + else + echo "Usage" + echo "explain interactive mode." + echo "explain 'cmd -o | ...' one quoted command to explain it." + fi + } + +### Working of explain.sh Utility ### + +After inserting the code and saving it, you must logout of the current session and login back to make the changes taken into effect. Every thing is taken care of by the ‘curl’ command which transfer the input command and flag that need explanation to the mankier server and then print just necessary information to the Linux command-line. Not to mention to use this utility you must be connected to internet always. + +Let’s test few examples of command which I don’t know the meaning with explain.sh script. + +**1. I forgot what ‘du -h‘ does. All I need to do is:** + + $ explain 'du -h' + +![Get Help on du Command](http://www.tecmint.com/wp-content/uploads/2015/07/Get-Help-on-du-Command.png) + +Get Help on du Command + +**2. If you forgot what ‘tar -zxvf‘ does, you may simply do:** + + $ explain 'tar -zxvf' + +![Tar Command Help](http://www.tecmint.com/wp-content/uploads/2015/07/Tar-Command-Help.png) + +Tar Command Help + +**3. One of my friend often confuse the use of ‘whatis‘ and ‘whereis‘ command, so I advised him.** + +Go to Interactive Mode by simply typing explain command on the terminal. + + $ explain + +and then type the commands one after another to see what they do in one window, as: + + Command: whatis + Command: whereis + +![Whatis Whereis Commands Help](http://www.tecmint.com/wp-content/uploads/2015/07/Whatis-Whereis-Commands-Help.png) + +Whatis Whereis Commands Help + +To exit interactive mode he just need to do Ctrl + c. + +**4. You can ask to explain more than one command chained by pipeline.** + + $ explain 'ls -l | grep -i Desktop' + +![Get Help on Multiple Commands](http://www.tecmint.com/wp-content/uploads/2015/07/Get-Help-on-Multiple-Commands.png) + +Get Help on Multiple Commands + +Similarly you can ask your shell to explain any shell command. All you need is a working Internet connection. The output is generated based upon the explanation needed from the server and hence the output result is not customizable. + +For me this utility is really helpful and it has been honored being added to my .bashrc. Let me know what is your thought on this project? How it can useful for you? Is the explanation satisfactory? + +Provide us with your valuable feedback in the comments below. Like and share us and help us get spread. + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/explain-shell-commands-in-the-linux-shell/ + +作者:[Avishek Kumar][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/avishek/ +[1]:http://www.tecmint.com/cheat-command-line-cheat-sheet-for-linux-users/ \ No newline at end of file From beebe0747c11b66ca82060586fb19a68ec826dbb Mon Sep 17 00:00:00 2001 From: Jindong Huang Date: Tue, 28 Jul 2015 12:40:29 +0800 Subject: [PATCH 719/965] =?UTF-8?q?=E3=80=90Translating=20by=20dingdongnig?= =?UTF-8?q?etou=E3=80=9120150728=20Understanding=20Shell=20Commands=20Easi?= =?UTF-8?q?ly=20Using=20'Explain=20Shell'=20Script=20in=20Linux.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【Translating by dingdongnigetou】20150728 Understanding Shell Commands Easily Using 'Explain Shell' Script in Linux.md --- ... Commands Easily Using 'Explain Shell' Script in Linux.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150728 Understanding Shell Commands Easily Using 'Explain Shell' Script in Linux.md b/sources/tech/20150728 Understanding Shell Commands Easily Using 'Explain Shell' Script in Linux.md index fe76f160cb..ab7572cd7a 100644 --- a/sources/tech/20150728 Understanding Shell Commands Easily Using 'Explain Shell' Script in Linux.md +++ b/sources/tech/20150728 Understanding Shell Commands Easily Using 'Explain Shell' Script in Linux.md @@ -1,3 +1,6 @@ + +Translating by dingdongnigetou + Understanding Shell Commands Easily Using “Explain Shell” Script in Linux ================================================================================ While working on Linux platform all of us need help on shell commands, at some point of time. Although inbuilt help like man pages, whatis command is helpful, but man pages output are too lengthy and until and unless one has some experience with Linux, it is very difficult to get any help from massive man pages. The output of whatis command is rarely more than one line which is not sufficient for newbies. @@ -115,4 +118,4 @@ via: http://www.tecmint.com/explain-shell-commands-in-the-linux-shell/ 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 [a]:http://www.tecmint.com/author/avishek/ -[1]:http://www.tecmint.com/cheat-command-line-cheat-sheet-for-linux-users/ \ No newline at end of file +[1]:http://www.tecmint.com/cheat-command-line-cheat-sheet-for-linux-users/ From 77d5ab6c1a57922d59f0f878d011269099f212a4 Mon Sep 17 00:00:00 2001 From: struggling <630441839@qq.com> Date: Tue, 28 Jul 2015 15:27:20 +0800 Subject: [PATCH 720/965] Update 20150728 Tips to Create ISO from CD, Watch User Activity and Check Memory Usages of Browser.md --- ..., Watch User Activity and Check Memory Usages of Browser.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150728 Tips to Create ISO from CD, Watch User Activity and Check Memory Usages of Browser.md b/sources/tech/20150728 Tips to Create ISO from CD, Watch User Activity and Check Memory Usages of Browser.md index 6adc5abaa6..2219e5e25e 100644 --- a/sources/tech/20150728 Tips to Create ISO from CD, Watch User Activity and Check Memory Usages of Browser.md +++ b/sources/tech/20150728 Tips to Create ISO from CD, Watch User Activity and Check Memory Usages of Browser.md @@ -1,3 +1,4 @@ +translation by strugglingyouth Tips to Create ISO from CD, Watch User Activity and Check Memory Usages of Browser ================================================================================ Here again, I have written another post on [Linux Tips and Tricks][1] series. Since beginning the objective of this post is to make you aware of those small tips and hacks that lets you manage your system/server efficiently. @@ -126,4 +127,4 @@ via: http://www.tecmint.com/creating-cdrom-iso-image-watch-user-activity-in-linu [a]:http://www.tecmint.com/author/avishek/ [1]:http://www.tecmint.com/tag/linux-tricks/ -[2]:http://www.tecmint.com/dmesg-commands/ \ No newline at end of file +[2]:http://www.tecmint.com/dmesg-commands/ From 8b32002911ade88fd15d5e51d103fd813e781ca0 Mon Sep 17 00:00:00 2001 From: DeadFire Date: Tue, 28 Jul 2015 15:48:00 +0800 Subject: [PATCH 721/965] =?UTF-8?q?20150728-3=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...mmand installed for 7-zip archive files.md | 49 +++++++ ... Kernel for Improved System Performance.md | 127 ++++++++++++++++++ 2 files changed, 176 insertions(+) create mode 100644 sources/tech/20150728 How To Fix--There is no command installed for 7-zip archive files.md create mode 100644 sources/tech/20150728 How to Update Linux Kernel for Improved System Performance.md diff --git a/sources/tech/20150728 How To Fix--There is no command installed for 7-zip archive files.md b/sources/tech/20150728 How To Fix--There is no command installed for 7-zip archive files.md new file mode 100644 index 0000000000..8c9b781117 --- /dev/null +++ b/sources/tech/20150728 How To Fix--There is no command installed for 7-zip archive files.md @@ -0,0 +1,49 @@ +How To Fix: There is no command installed for 7-zip archive files +================================================================================ +### Problem ### + +I was trying to install Emerald icon theme in Ubuntu and the theme came in .7z archive. As always, I tried to extract it, in GUI, using the right click and “extract here”. Instead of extracting the file, Ubuntu 15.04 threw an error which read: + +> Could not open this file +> +> There is no command installed for 7-zip archive files. Do you want to search for a command to open this file? + +The error looked like this: + +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/Install_7zip_ubuntu_1.png) + +### Reason ### + +Reason is quite evident from the error message itself. The 7Z, better to call it [7-zip][1], program is not installed and hence 7Z compressed files are not being extracted. This also hints that Ubuntu doesn’t support 7-Zip files by default. + +### Solution: Install 7zip in Ubuntu ### + +Solution is quite simple as well. Install the 7-Zip package in Ubuntu. Now you might wonder how to install 7Zip in Ubuntu? Well, in the previous error dialogue box if you click on “Search Command”, it will look for available p7zip package. Just click on “Install” here: + +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/Install_7zip_ubuntu.png) + +### Alternative: Install 7zip in terminal ### + +If you prefer terminal, you can install 7zip in terminal using the following command: + + sudo apt-get install p7zip-full + +Note: You’ll find three 7zip packages in Ubuntu: p7zip, p7zip-full and p7zip-rar. The difference between p7zip and p7zip-full is that p7zip is a lighter version providing support only for .7z and .7za files while the full version provides support for more 7z compression algorithms (for audio files etc). For p7zip-rar, it provides support for .rar files along with 7z. + +In fact similar error can be encountered with [RAR files in Ubuntu][2]. Solution is the same, install the correct program. + +I hope this quick post helped you to solve the mystery of **how to open 7zip in Ubuntu 14.04**. Any questions or suggestions are always welcomed. + +-------------------------------------------------------------------------------- + +via: http://itsfoss.com/fix-there-is-no-command-installed-for-7-zip-archive-files/ + +作者:[Abhishek][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://itsfoss.com/author/abhishek/ +[1]:http://www.7-zip.org/ +[2]:http://itsfoss.com/fix-there-is-no-command-installed-for-rar-archive-files/ \ No newline at end of file diff --git a/sources/tech/20150728 How to Update Linux Kernel for Improved System Performance.md b/sources/tech/20150728 How to Update Linux Kernel for Improved System Performance.md new file mode 100644 index 0000000000..4e238de09d --- /dev/null +++ b/sources/tech/20150728 How to Update Linux Kernel for Improved System Performance.md @@ -0,0 +1,127 @@ +How to Update Linux Kernel for Improved System Performance +================================================================================ +![](http://cdn.makeuseof.com/wp-content/uploads/2015/07/update-linux-kernel-644x373.jpg?2c3c1f) + +The rate of development for [the Linux kernel][1] is unprecedented, with a new major release approximately every two to three months. Each release offers several new features and improvements that a lot of people could take advantage of to make their computing experience faster, more efficient, or better in other ways. + +The problem, however, is that you usually can’t take advantage of these new kernel releases as soon as they come out — you have to wait until your distribution comes out with a new release that packs a newer kernel with it. We’ve previously laid out [the benefits for regularly updating your kernel][2], and you don’t have to wait to get your hands on them. We’ll show you how. + +> Disclaimer: As some of our literature may have mentioned before, updating your kernel does carry a (small) risk of breaking your system. If this is the case, it’s usually easy to pick an older kernel at boot time that works, but something may always go wrong. Therefore, we’re not responsible for any damage to your system — use at your own risk! + +### Prep Work ### + +![](http://cdn.makeuseof.com/wp-content/uploads/2015/07/linux_kernel_arch.jpg?2c3c1f) + +To update your kernel, you’ll first need to determine whether you’re using a 32-bit or 64-bit system. Open up a terminal window and run + + uname -a + +Then check to see if the output says x86_64 or i686. If it’s x86_64, then you’re running the 64-bit version; otherwise, you’re running the 32-bit version. Remember this, because it will be important. + +![](http://cdn.makeuseof.com/wp-content/uploads/2015/07/kernel_latest_version.jpg?2c3c1f) + +Next, visit the [official Linux kernel website][3]. This will tell you what the current stable version of the kernel is. You can try out release candidates if you’d like, but they are a lot less tested than the stable releases. Stick with the stable kernel unless you are certain you need a release candidate version. + +### Ubuntu Instructions ### + +It’s quite easy for Ubuntu and Ubuntu-derivative users to update their kernel, thanks to the Ubuntu Mainline Kernel PPA. Although it’s officially called a PPA, you cannot use it like other PPAs by adding them to your software sources list and expecting it to automatically update the kernel for you. Instead, it’s simply a webpage you navigate through to download the kernel you want. + +![](http://cdn.makeuseof.com/wp-content/uploads/2015/07/ubuntu_new_kernels.jpg?2c3c1f) + +Now, visit the [kernel PPA webpage][4] and scroll all the way to the bottom. The absolute bottom of the list will probably contain some release candidate versions (which you can see by the “rc” in the name), but just above them should be the latest stable kernel (to make this easier to explain, at the time of writing the stable version was 4.1.2). Click on that, and you’ll be presented with several options. You’ll need to grab three files and save them in their own folder (within the Downloads folder if you’d like) so that they’re isolated from all other files: + +- The “generic” header file for your architecture (in my case, 64-bit or “amd64″) +- The header file in the middle that has “all” towards the end of the filename +- The “generic” kernel file for your architecture (again, I would pick “amd64″ but if you use 32-bit you’ll need “i686″) + +You’ll notice that there are also “lowlatency” files available to download, but it’s fine to ignore this. These files are relatively unstable and are only made available for people who need their low-latency benefits if the general files don’t suffice for tasks such as audio recording. Again, the recommendation is to always use generic first and only try lowlatency if your performance isn’t good enough for certain tasks. No, gaming or Internet browsing aren’t excuses to try lowlatency. + +![](http://cdn.makeuseof.com/wp-content/uploads/2015/07/ubuntu_install_kernel.jpg?2c3c1f) + +You put these files into their own folder, right? Now open up the Terminal, use the + + cd + +command to go to your newly-created folder, such as + + cd /home/user/Downloads/Kernel + +and then run: + + sudo dpkg -i *.deb + +This command marks all .deb files within the folder as “to be installed” and then performs the installation. This is the recommended way to install these files because otherwise it’s easy to pick one file to install and it’ll complain about dependency issues. This approach avoids that problem. If you’re not sure what cd or sudo are, get a quick crash course on [essential Linux commands][5]. + +Once the installation is complete, **Restart** your system and you should be running the just-installed kernel! You can check this by running uname -a in the Terminal and checking the output. + +### Fedora Instructions ### + +If you use Fedora or one of its derivatives, the process is very similar to Ubuntu. There’s just a different location to grab different files, and a different command to install them. + +![](http://cdn.makeuseof.com/wp-content/uploads/2015/07/fedora_new_kernels.jpg?2c3c1f) + +VIew the list of the most [recent kernel builds for Fedora][6]. Pick the latest stable version out of the list, and then scroll down to either the i686 or x86_64 section, depending on your system’s architecture. In this section, you’ll need to grab the following files and save them in their own folder (such as “Kernel” within your Downloads folder, as an example): + +- kernel +- kernel-core +- kernel-headers +- kernel-modules +- kernel-modules-extra +- kernel-tools +- perf and python-perf (optional) + +If your system is i686 (32-bit) and you have 4GB of RAM or more, you’ll need to grab the PAE version of all of these files where available. PAE is an address extension technique used for 32-bit system to allow them to use more than 3GB of RAM. + +Now, use the + + cd + +command to go to that folder, such as + + cd /home/user/Downloads/Kernel + +and then run the following command to install all the files: + + yum --nogpgcheck localinstall *.rpm + +Finally **Restart** your computer and you should be running a new kernel! + +### Using Rawhide ### + +Alternatively, Fedora users can also simply [switch to Rawhide][7] and it’ll automatically update every package to the latest version, including the kernel. However, Rawhide is known to break quite often (especially early on in the development cycle) and should **not** be used on a system that you need to rely on. + +### Arch Instructions ### + +[Arch users][8] should always have the latest and greatest stable kernel available (or one pretty close to it). If you want to get even closer to the latest-released stable kernel, you can enable the testing repo which will give you access to major new releases roughly two to four weeks early. + +To do this, open the file located at + + /etc/pacman.conf + +with sudo permissions in [your favorite terminal text editor][9], and then uncomment (delete the pound symbols from the front of each line) the three lines associated with testing. If you have the multilib repository enabled, then do the same for the multilib-testing repository. See [this Arch Linux wiki page][10] if you need more information. + +Upgrading your kernel isn’t easy (done so intentionally), but it can give you a lot of benefits. So long as your new kernel didn’t break anything, you can now enjoy improved performance, better efficiency, support for more hardware, and potential new features. Especially if you’re running relatively new hardware, upgrading the kernel can really help out. + +**How has upgraded the kernel helped you? Do you think your favorite distribution’s policy on kernel releases is what it should be?** Let us know in the comments! + +-------------------------------------------------------------------------------- + +via: http://www.makeuseof.com/tag/update-linux-kernel-improved-system-performance/ + +作者:[Danny Stieben][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.makeuseof.com/tag/author/danny/ +[1]:http://www.makeuseof.com/tag/linux-kernel-explanation-laymans-terms/ +[2]:http://www.makeuseof.com/tag/5-reasons-update-kernel-linux/ +[3]:http://www.kernel.org/ +[4]:http://kernel.ubuntu.com/~kernel-ppa/mainline/ +[5]:http://www.makeuseof.com/tag/an-a-z-of-linux-40-essential-commands-you-should-know/ +[6]:http://koji.fedoraproject.org/koji/packageinfo?packageID=8 +[7]:http://www.makeuseof.com/tag/bleeding-edge-linux-fedora-rawhide/ +[8]:http://www.makeuseof.com/tag/arch-linux-letting-you-build-your-linux-system-from-scratch/ +[9]:http://www.makeuseof.com/tag/nano-vs-vim-terminal-text-editors-compared/ +[10]:https://wiki.archlinux.org/index.php/Pacman#Repositories \ No newline at end of file From b91b501850e195c679f207773b0a7b515ef87239 Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 28 Jul 2015 20:24:55 +0800 Subject: [PATCH 722/965] =?UTF-8?q?=E5=9B=9E=E6=94=B6=E5=92=8C=E6=B8=85?= =?UTF-8?q?=E9=99=A4=E6=96=87=E7=AB=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 回收:@barney-ro @2q1w2007 @zhangboyue 补充删除:@wwy-hust --- ...er the enterprise and other predictions.md | 74 ------- ...urious Case of the Disappearing Distros.md | 120 ---------- ...ff -u--What's New in Kernel Development.md | 36 --- ...1 Did this JavaScript break the console.md | 91 -------- ... Revealed--The best and worst of Docker.md | 66 ------ ...erver behind NAT via reverse SSH tunnel.md | 1 - sources/tech/20150522 Analyzing Linux Logs.md | 1 - ...Experience on Linux 'iptables' Firewall.md | 209 ------------------ 8 files changed, 598 deletions(-) delete mode 100644 sources/talk/20141219 2015 will be the year Linux takes over the enterprise and other predictions.md delete mode 100644 sources/talk/20141224 The Curious Case of the Disappearing Distros.md delete mode 100644 sources/talk/20150112 diff -u--What's New in Kernel Development.md delete mode 100644 sources/talk/20150121 Did this JavaScript break the console.md delete mode 100644 sources/talk/20150320 Revealed--The best and worst of Docker.md delete mode 100644 sources/tech/20150604 Nishita Agarwal Shares Her Interview Experience on Linux 'iptables' Firewall.md diff --git a/sources/talk/20141219 2015 will be the year Linux takes over the enterprise and other predictions.md b/sources/talk/20141219 2015 will be the year Linux takes over the enterprise and other predictions.md deleted file mode 100644 index 0d2b26cc98..0000000000 --- a/sources/talk/20141219 2015 will be the year Linux takes over the enterprise and other predictions.md +++ /dev/null @@ -1,74 +0,0 @@ -2015 will be the year Linux takes over the enterprise (and other predictions) -================================================================================ -> Jack Wallen removes his rose-colored glasses and peers into the crystal ball to predict what 2015 has in store for Linux. - -![](http://tr1.cbsistatic.com/hub/i/r/2014/12/15/f79d21fe-f1d1-416d-ba22-7e757dfcdb31/resize/620x485/52a10d26d34c3fc4201c5daa8ff277ff/linux2015hero.jpg) - -The crystal ball has been vague and fuzzy for quite some time. Every pundit and voice has opined on what the upcoming year will mean to whatever topic it is they hold dear to their heart. In my case, we're talking Linux and open source. - -In previous years, I'd don the rose-colored glasses and make predictions that would shine a fantastic light over the Linux landscape and proclaim 20** will be the year of Linux on the _____ (name your platform). Many times, those predictions were wrong, and Linux would wind up grinding on in the background. - -This coming year, however, there are some fairly bold predictions to be made, some of which are sure things. Read on and see if you agree. - -### Linux takes over big data ### - -This should come as no surprise, considering the advancements Linux and open source has made over the previous few years. With the help of SuSE, Red Hat, and SAP Hana, Linux will hold powerful sway over big data in 2015. In-memory computing and live kernel patching will be the thing that catapults big data into realms of uptime and reliability never before known. SuSE will lead this charge like a warrior rushing into a battle it cannot possibly lose. - -This rise of Linux in the world of big data will have serious trickle down over the rest of the business world. We already know how fond enterprise businesses are of Linux and big data. What we don't know is how this relationship will alter the course of Linux with regards to the rest of the business world. - -My prediction is that the success of Linux with big data will skyrocket the popularity of Linux throughout the business landscape. More contracts for SuSE and Red Hat will equate to more deployments of Linux servers that handle more tasks within the business world. This will especially apply to the cloud, where OpenStack should easily become an overwhelming leader. - -As the end of 2015 draws to a close, Linux will continue its take over of more backend services, which may include the likes of collaboration servers, security, and much more. - -### Smart machines ### - -Linux is already leading the trend for making homes and autos more intelligent. With improvements in the likes of Nest (which currently uses an embedded Linux), the open source platform is poised to take over your machines. Because 2015 should see a massive rise in smart machines, it goes without saying that Linux will be a huge part of that growth. I firmly believe more homes and businesses will take advantage of such smart controls, and that will lead to more innovations (all of which will be built on Linux). - -One of the issues facing Nest, however, is that it was purchased by Google. What does this mean for the thermostat controller? Will Google continue using the Linux platform -- or will it opt to scrap that in favor of Android? Of course, a switch would set the Nest platform back a bit. - -The upcoming year will see Linux lead the rise in popularity of home automation. Wink, Iris, Q Station, Staples Connect, and more (similar) systems will help to bridge Linux and home users together. - -### The desktop ### - -The big question, as always, is one that tends to hang over the heads of the Linux community like a dark cloud. That question is in relation to the desktop. Unfortunately, my predictions here aren't nearly as positive. I believe that the year 2015 will remain quite stagnant for Linux on the desktop. That complacency will center around Ubuntu. - -As much as I love Ubuntu (and the Unity desktop), this particular distribution will continue to drag the Linux desktop down. Why? - -Convergence... or the lack thereof. - -Canonical has been so headstrong about converging the desktop and mobile experience that they are neglecting the current state of the desktop. The last two releases of Ubuntu (one being an LTS release) have been stagnant (at best). The past year saw two of the most unexciting releases of Ubuntu that I can recall. The reason? Because the developers of Ubuntu are desperately trying to make Unity 8/Mir and the ubiquitous Ubuntu Phone a reality. The vaporware that is the Ubuntu Phone will continue on through 2015, and Unity 8/Mir may or may not be released. - -When the new iteration of the Ubuntu Unity desktop is finally released, it will suffer a serious setback, because there will be so little hardware available to truly show it off. [System76][1] will sell their outstanding [Sable Touch][2], which will probably become the flagship system for Unity 8/Mir. As for the Ubuntu Phone? How many reports have you read that proclaimed "Ubuntu Phone will ship this year"? - -I'm now going on the record to predict that the Ubuntu Phone will not ship in 2015. Why? Canonical created partnerships with two OEMs over a year ago. Those partnerships have yet to produce a single shippable product. The closest thing to a shippable product is the Meizu MX4 phone. The "Pro" version of that phone was supposed to have a formal launch of Sept 25. Like everything associated with the Ubuntu Phone, it didn't happen. - -Unless Canonical stops putting all of its eggs in one vaporware basket, desktop Linux will take a major hit in 2015. Ubuntu needs to release something major -- something to make heads turn -- otherwise, 2015 will be just another year where we all look back and think "we could have done something special." - -Outside of Ubuntu, I do believe there are some outside chances that Linux could still make some noise on the desktop. I think two distributions, in particular, will bring something rather special to the table: - -- [Evolve OS][3] -- a ChromeOS-like Linux distribution -- [Quantum OS][4] -- a Linux distribution that uses Android's Material Design specs - -Both of these projects are quite exciting and offer unique, user-friendly takes on the Linux desktop. This is quickly become a necessity in a landscape being dragged down by out-of-date design standards (think the likes of Cinnamon, Mate, XFCE, LXCE -- all desperately clinging to the past). - -This is not to say that Linux on the desktop doesn't have a chance in 2015. It does. In order to grasp the reins of that chance, it will have to move beyond the past and drop the anchors that prevent it from moving out to deeper, more viable waters. - -Linux stands to make more waves in 2015 than it has in a very long time. From enterprise to home automation -- the world could be the oyster that Linux uses as a springboard to the desktop and beyond. - -What are your predictions for Linux and open source in 2015? Share your thoughts in the discussion thread below. - --------------------------------------------------------------------------------- - -via: http://www.techrepublic.com/article/2015-will-be-the-year-linux-takes-over-the-enterprise-and-other-predictions/ - -作者:[Jack Wallen][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.techrepublic.com/search/?a=jack+wallen -[1]:https://system76.com/ -[2]:https://system76.com/desktops/sable -[3]:https://evolve-os.com/ -[4]:http://quantum-os.github.io/ \ No newline at end of file diff --git a/sources/talk/20141224 The Curious Case of the Disappearing Distros.md b/sources/talk/20141224 The Curious Case of the Disappearing Distros.md deleted file mode 100644 index b9fc7875d7..0000000000 --- a/sources/talk/20141224 The Curious Case of the Disappearing Distros.md +++ /dev/null @@ -1,120 +0,0 @@ -The Curious Case of the Disappearing Distros -================================================================================ -![](http://www.linuxinsider.com/ai/828896/linux-distros.jpg) - -"Linux is a big game now, with billions of dollars of profit, and it's the best thing since sliced bread, but corporations are taking control, and slowly but systematically, community distros are being killed," said Google+ blogger Alessandro Ebersol. "Linux is slowly becoming just like BSD, where companies use and abuse it and give very little in return." - -Well the holidays are pretty much upon us at last here in the Linux blogosphere, and there's nowhere left to hide. The next two weeks or so promise little more than a blur of forced social occasions and too-large meals, punctuated only -- for the luckier ones among us -- by occasional respite down at the Broken Windows Lounge. - -Perhaps that's why Linux bloggers seized with such glee upon the good old-fashioned mystery that came up recently -- delivered in the nick of time, as if on cue. - -"Why is the Number of Linux Distros Declining?" is the [question][1] posed over at Datamation, and it's just the distraction so many FOSS fans have been needing. - -"Until about 2011, the number of active distributions slowly increased by a few each year," wrote author Bruce Byfield. "By contrast, the last three years have seen a 12 percent decline -- a decrease too high to be likely to be coincidence. - -"So what's happening?" Byfield wondered. - -It would be difficult to imagine a more thought-provoking question with which to spend the Northern hemisphere's shortest days. - -### 'There Are Too Many Distros' ### - -![](http://www.linuxinsider.com/images/article_images/linuxgirl_bg_pinkswirl_150x245.jpg) - -"That's an easy question," began blogger [Robert Pogson][2]. "There are too many distros." - -After all, "if a fanatic like me can enjoy life having sampled only a dozen distros, why have any more?" Pogson explained. "If someone has a concept different from the dozen or so most common distros, that concept can likely be demonstrated by documenting the tweaks and package-lists and, perhaps, some code." - -Trying to compete with some 40,000 package repositories like Debian's, however, is "just silly," he said. - -"No startup can compete with such a distro," Pogson asserted. "Why try? Just use it to do what you want and tell the world about it." - -### 'I Don't Distro-Hop Anymore' ### - -The major existing distros are doing a good job, so "we don't need so many derivative works," Google+ blogger Kevin O'Brien agreed. - -"I know I don't 'distro-hop' anymore, and my focus is on using my computer to get work done," O'Brien added. - -"If my apps run fine every day, that is all that I need," he said. "Right now I am sticking with Ubuntu LTS 14.04, and probably will until 2016." - -### 'The More Distros, the Better' ### - -It stands to reason that "as distros get better, there will be less reasons to roll your own," concurred [Linux Rants][3] blogger Mike Stone. - -"I think the modern Linux distros cover the bases of a larger portion of the Linux-using crowd, so fewer and fewer people are starting their own distribution to compensate for something that the others aren't satisfying," he explained. "Add to that the fact that corporations are more heavily involved in the development of Linux now than they ever have been, and they're going to focus their resources." - -So, the decline isn't necessarily a bad thing, as it only points to the strength of the current offerings, he asserted. - -At the same time, "I do think there are some negative consequences as well," Stone added. "Variation in the distros is a way that Linux grows and evolves, and with a narrower field, we're seeing less opportunity to put new ideas out there. In my mind, the more distros, the better -- hopefully the trend reverses soon." - -### 'I Hope Some Diversity Survives' ### - -Indeed, "the era of novelty and experimentation is over," Google+ blogger Gonzalo Velasco C. told Linux Girl. - -"Linux is 20+ years old and got professional," he noted. "There is always room for experimentation, but the top 20 are here since more than a decade ago. - -"Godspeed GNU/Linux," he added. "I hope some diversity survives -- especially distros without Systemd; on the other hand, some standards are reached through consensus." - -### A Question of Package Managers ### - -There are two trends at work here, suggested consultant and [Slashdot][4] blogger Gerhard Mack. - -First, "there are fewer reasons to start a new distro," he said. "The basic nuts and bolts are mostly done, installation is pretty easy across most distros, and it's not difficult on most hardware to get a working system without having to resort to using the command line." - -The second thing is that "we are seeing a reduction of distros with inferior package managers," Mack suggested. "It is clear that .deb-based distros had fewer losses and ended up with a larger overall share." - -### Survival of the Fittest ### - -It's like survival of the fittest, suggested consultant Rodolfo Saenz, who is certified in Linux, IBM Tivoli Storage Manager and Microsoft Active Directory. - -"I prefer to see a strong Linux with less distros," Saenz added. "Too many distros dilutes development efforts and can confuse potential future users." - -Fewer distros, on the other hand, "focuses development efforts into the stronger distros and also attracts new potential users with clear choices for their needs," he said. - -### All About the Money ### - -Google+ blogger Alessandro Ebersol also saw survival of the fittest at play, but he took a darker view. - -"Linux is a big game now, with billions of dollars of profit, and it's the best thing since sliced bread," Ebersol began. "But corporations are taking control, and slowly but systematically, community distros are being killed." - -It's difficult for community distros to keep pace with the ever-changing field, and cash is a necessity, he conceded. - -Still, "Linux is slowly becoming just like BSD, where companies use and abuse it and give very little in return," Ebersol said. "It saddens me, but GNU/Linux's best days were 10 years ago, circa 2002 to 2004. Now, it's the survival of the fittest -- and of course, the ones with more money will prevail." - -### 'Fewer Devs Care' ### - -SoylentNews blogger hairyfeet focused on today's altered computing landscape. - -"The reason there are fewer distros is simple: With everybody moving to the Google Playwall of Android, and Windows 10 looking to be the next XP, fewer devs care," hairyfeet said. - -"Why should they?" he went on. "The desktop wars are over, MSFT won, and the mobile wars are gonna be proprietary Google, proprietary Apple and proprietary MSFT. The money is in apps and services, and with a slow economy, there just isn't time for pulling a Taco Bell and rerolling yet another distro. - -"For the few that care about Linux desktops you have Ubuntu, Mint and Cent, and that is plenty," hairyfeet said. - -### 'No Less Diversity' ### - -Last but not least, Chris Travers, a [blogger][5] who works on the [LedgerSMB][6] project, took an optimistic view. - -"Ever since I have been around Linux, there have been a few main families -- [SuSE][7], [Red Hat][8], Debian, Gentoo, Slackware -- and a number of forks of these," Travers said. "The number of major families of distros has been declining for some time -- Mandrake and Connectiva merging, for example, Caldera disappearing -- but each of these families is ending up with fewer members as well. - -"I think this is a good thing," he concluded. - -"The big community distros -- Debian, Slackware, Gentoo, Fedora -- are going strong and picking up a lot of the niche users that other distros catered to," he pointed out. "Many of these distros are making it easier to come up with customized variants for niche markets. So what you have is a greater connectedness within the big distros, and no less diversity." - --------------------------------------------------------------------------------- - -via: http://www.linuxinsider.com/story/The-Curious-Case-of-the-Disappearing-Distros-81518.html - -作者:Katherine Noyes -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[1]:http://www.datamation.com/open-source/why-is-the-number-of-linux-distros-declining.html -[2]:http://mrpogson.com/ -[3]:http://linuxrants.com/ -[4]:http://slashdot.org/ -[5]:http://ledgersmbdev.blogspot.com/ -[6]:http://www.ledgersmb.org/ -[7]:http://www.novell.com/linux -[8]:http://www.redhat.com/ diff --git a/sources/talk/20150112 diff -u--What's New in Kernel Development.md b/sources/talk/20150112 diff -u--What's New in Kernel Development.md deleted file mode 100644 index 2e6f8e3480..0000000000 --- a/sources/talk/20150112 diff -u--What's New in Kernel Development.md +++ /dev/null @@ -1,36 +0,0 @@ -diff -u: What's New in Kernel Development -================================================================================ -**David Drysdale** wanted to add Capsicum security features to Linux after he noticed that FreeBSD already had Capsicum support. Capsicum defines fine-grained security privileges, not unlike filesystem capabilities. But as David discovered, Capsicum also has some controversy surrounding it. - -Capsicum has been around for a while and was described in a USENIX paper in 2010: [http://www.cl.cam.ac.uk/research/security/capsicum/papers/2010usenix-security-capsicum-website.pdf][1]. - -Part of the controversy is just because of the similarity with capabilities. As Eric Biderman pointed out during the discussion, it would be possible to implement features approaching Capsicum's as an extension of capabilities, but implementing Capsicum directly would involve creating a whole new (and extensive) abstraction layer in the kernel. Although David argued that capabilities couldn't actually be extended far enough to match Capsicum's fine-grained security controls. - -Capsicum also was controversial within its own developer community. For example, as Eric described, it lacked a specification for how to revoke privileges. And, David pointed out that this was because the community couldn't agree on how that could best be done. David quoted an e-mail sent by Ben Laurie to the cl-capsicum-discuss mailing list in 2011, where Ben said, "It would require additional book-keeping to find and revoke outstanding capabilities, which requires knowing how to reach capabilities, and then whether they are derived from the capability being revoked. It also requires an authorization model for revocation. The former two points mean additional overhead in terms of data structure operations and synchronisation." - -Given the ongoing controversy within the Capsicum developer community and the corresponding lack of specification of key features, and given the existence of capabilities that already perform a similar function in the kernel and the invasiveness of Capsicum patches, Eric was opposed to David implementing Capsicum in Linux. - -But, given the fact that capabilities are much coarser-grained than Capsicum's security features, to the point that capabilities can't really be extended far enough to mimic Capsicum's features, and given that FreeBSD already has Capsicum implemented in its kernel, showing that it can be done and that people might want it, it seems there will remain a lot of folks interested in getting Capsicum into the Linux kernel. - -Sometimes it's unclear whether there's a bug in the code or just a bug in the written specification. Henrique de Moraes Holschuh noticed that the Intel Software Developer Manual (vol. 3A, section 9.11.6) said quite clearly that microcode updates required 16-byte alignment for the P6 family of CPUs, the Pentium 4 and the Xeon. But, the code in the kernel's microcode driver didn't enforce that alignment. - -In fact, Henrique's investigation uncovered the fact that some Intel chips, like the Xeon X5550 and the second-generation i5 chips, needed only 4-byte alignment in practice, and not 16. However, to conform to the documented specification, he suggested fixing the kernel code to match the spec. - -Borislav Petkov objected to this. He said Henrique was looking for problems where there weren't any. He said that Henrique simply had discovered a bug in Intel's documentation, because the alignment issue clearly wasn't a problem in the real world. He suggested alerting the Intel folks to the documentation problem and moving on. As he put it, "If the processor accepts the non-16-byte-aligned update, why do you care?" - -But, as H. Peter Anvin remarked, the written spec was Intel's guarantee that certain behaviors would work. If the kernel ignored the spec, it could lead to subtle bugs later on. And, Bill Davidsen said that if the kernel ignored the alignment requirement, and "if the requirement is enforced in some future revision, and updates then fail in some insane way, the vendor is justified in claiming 'I told you so'." - -The end result was that Henrique sent in some patches to make the microcode driver enforce the 16-byte alignment requirement. - --------------------------------------------------------------------------------- - -via: http://www.linuxjournal.com/content/diff-u-whats-new-kernel-development-6 - -作者:[Zack Brown][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://www.linuxjournal.com/user/801501 -[1]:http://www.cl.cam.ac.uk/research/security/capsicum/papers/2010usenix-security-capsicum-website.pdf \ No newline at end of file diff --git a/sources/talk/20150121 Did this JavaScript break the console.md b/sources/talk/20150121 Did this JavaScript break the console.md deleted file mode 100644 index aab924ab33..0000000000 --- a/sources/talk/20150121 Did this JavaScript break the console.md +++ /dev/null @@ -1,91 +0,0 @@ -Did this JavaScript break the console? ---------- - -#Q: - -Just doing some JavaScript stuff in google chrome (don't want to try in other browsers for now, in case this is really doing real damage) and I'm not sure why this seemed to break my console. - -```javascript ->var x = "http://www.foo.bar/q?name=%%this%%"; -x -``` - -After x (and enter) the console stops working... I restarted chrome and now when I do a simple - -```javascript -console.clear(); -``` - -It's giving me - -```javascript -Console was cleared -``` - -And not clearing the console. Now in my scripts console.log's do not register and I'm wondering what is going on. 99% sure it has to do with the double percent signs (%%). - -Anyone know what I did wrong or better yet, how to fix the console? - -[A bug report for this issue has been filed here.][1] -Edit: Feeling pretty dumb, but I had Preserve log checked... That's why the console wasn't clearing. - -#A: - -As discussed in the comments, there are actually many different ways of constructing a string that causes this issue, and it is not necessary for there to be two percent signs in most cases. - -```TXT -http://example.com/% -http://%%% -http://ab% -http://%ab -http://%zz -``` - -However, it's not just the presence of a percent sign that breaks the Chrome console, as when we enter the following well-formed URL, the console continues to work properly and produces a clickable link. - -```TXT -http://ab%20cd -``` - -Additionally, the strings `http://%`, and `http://%%` will also print properly, since Chrome will not auto-link a URL-link string unless the [`http://`][2] is followed by at least 3 characters. - -From here I hypothesized that the issue must be in the process of linking a URL string in the console, likely in the process of decoding a malformed URL. I remembered that the JavaScript function `decodeURI` will throw an exception if given a malformed URL, and since Chrome's developer tools are largely written in JavaScript, could this be the issue that is evidently crashing the developer console? - -To test this theory, I ran Chrome by the command link, to see if any errors were being logged. - -Indeed, the same error you would see if you ran decodeURI on a malformed URL (i.e. decodeURI('http://example.com/%')) was being printed to the console: - ->[4810:1287:0107/164725:ERROR:CONSOLE(683)] "Uncaught URIError: URI malformed", source: chrome-devtools://devtools/bundled/devtools.js (683) ->So, I opened the URL 'chrome-devtools://devtools/bundled/devtools.js' in Chrome, and on line 683, I found the following. - -```javascript -{var parsedURL=new WebInspector.ParsedURL(decodeURI(url));var origin;var folderPath;var name;if(parsedURL.isValid){origin=parsedURL.scheme+"://"+parsedURL.host;if(parsedURL.port) -``` - -As we can see, `decodeURI(url)` is being called on the URL without any error checking, thus throwing the exception and crashing the developer console. - -A real fix for this issue will come from adding error handling to the Chrome console code, but in the meantime, one way to avoid the issue would be to wrap the string in a complex data type like an array to prevent parsing when logging. - -```javascript -var x = "http://example.com/%"; -console.log([x]); -``` - -Thankfully, the broken console issue does not persist once the tab is closed, and will not affect other tabs. - -###Update: - -Apparently, the issue can persist across tabs and restarts if Preserve Log is checked. Uncheck this if you are having this issue. - -via:[stackoverflow](http://stackoverflow.com/questions/27828804/did-this-javascript-break-the-console/27830948#27830948) - -作者:[Alexander O'Mara][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://stackoverflow.com/users/3155639/alexander-omara -[1]:https://code.google.com/p/chromium/issues/detail?id=446975 -[2]:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURI \ No newline at end of file diff --git a/sources/talk/20150320 Revealed--The best and worst of Docker.md b/sources/talk/20150320 Revealed--The best and worst of Docker.md deleted file mode 100644 index 1e188d6cba..0000000000 --- a/sources/talk/20150320 Revealed--The best and worst of Docker.md +++ /dev/null @@ -1,66 +0,0 @@ -Revealed: The best and worst of Docker -================================================================================ -![](http://images.techhive.com/images/article/2015/01/best_worst_places_to_work-100564193-primary.idge.jpg) -Credit: [Shutterstock][1] - -> Docker experts talk about the good, the bad, and the ugly of the ubiquitous application container system - -No question about it: Docker's app container system has made its mark and become a staple in many IT environments. With its accelerating adoption, it's bound to stick around for a good long time. - -But there's no end to the debate about what Docker's best for, where it falls short, or how to most sensibly move it forward without alienating its existing users or damaging its utility. Here, we've turned to a few of the folks who have made Docker their business to get their takes on Docker's good, bad, and ugly sides. - -### The good ### - -One hardly expects Steve Francia, chief of operations of the Docker open source project, to speak of Docker in anything less than glowing terms. When asked by email about Docker's best attributes, he didn't disappoint: "I think the best thing about Docker is that it enables people, enables developers, enables users to very easily run an application anywhere," he said. "It's almost like the Holy Grail of development in that you can run an application on your desktop, and the exact same application without any changes can run on the server. That's never been done before." - -Alexis Richardson of [Weaveworks][2], a virtual networking product, praised Docker for enabling simplicity. "Docker offers immense potential to radically simplify and speed up how software gets built," he replied in an email. "This is why it has delivered record-breaking initial mind share and traction." - -Bob Quillin, CEO of [StackEngine][3], which makes Docker management and automation solutions, noted in an email that Docker (the company) has done a fine job of maintaining Docker's (the product) appeal to its audience. "Docker has been best at delivering strong developer support and focused investment in its product," he wrote. "Clearly, they know they have to keep the momentum, and they are doing that by putting intense effort into product functionality." He also mentioned that Docker's commitment to open source has accelerated adoption by "[allowing] people to build around their features as they are being built." - -Though containerization itself isn't new, as Rob Markovich of IT monitoring-service makers [Moogsoft][4] pointed out, Docker's implementation makes it new. "Docker is considered a next-generation virtualization technology given its more modern, lightweight form [of containerization]," he wrote in an email. "[It] brings an opportunity for an order-of-magnitude leap forward for software development teams seeking to deploy code faster." - -### The bad ### - -What's less appealing about Docker boils down to two issues: the complexity of using the product, and the direction of the company behind it. - -Samir Ghosh, CEO of enterprise PaaS outfit [WaveMaker][5], gave Docker a thumbs-up for simplifying the complex scripting typically needed for continuous delivery. That said, he added, "That doesn't mean Docker is simple. Implementing Docker is complicated. There are a lot of supporting technologies needed for things like container management, orchestration, app stack packaging, intercontainer networking, data snapshots, and so on." - -Ghosh noted the ones who feel the most of that pain are enterprises that want to leverage Docker for continuous delivery, but "it's even more complicated for enterprises that have diverse workloads, various app stacks, heterogenous infrastructures, and limited resources, not to mention unique IT needs for visibility, control and security." - -Complexity also becomes an issue in troubleshooting and analysis, and Markovich cited the fact that Docker provides application abstraction as the reason why. "It is nearly impossible to relate problems with application performance running on Docker to the performance of the underlying infrastructure domains," he said in an email. "IT teams are going to need visibility -- a new class of monitoring and analysis tools that can correlate across and relate how everything is working up and down the Docker stack, from the applications down to the private or public infrastructure." - -Quillin is most concerned about Docker's direction vis-à-vis its partner community: "Where will Docker make money, and where will their partners? If [Docker] wants to be the next VMware, it will need to take a page out of VMware's playbook in how to build and support a thriving partner ecosystem. - -"Additionally, to drive broader adoption, especially in the enterprise, Docker needs to start acting like a market leader by releasing more fully formed capabilities that organizations can count on, versus announcements of features with 'some assembly required,' that don't exist yet, or that require you to 'submit a pull request' to fix it yourself." - -Francia pointed to Docker's rapid ascent for creating its own difficulties. "[Docker] caught on so quickly that there's definitely places that we're focused on to add some features that a lot of users are looking forward to." - -One such feature, he noted, was having a GUI. "Right now to use Docker," he said, "you have to be comfortable with the command line. There's no visual interface to using Docker. Right now it's all command line-based. And we know if we want to really be as successful as we think we can be, we need to be more approachable and a lot of people when they see a command line, it's a bit intimidating for a lot of users." - -### The future ### - -In that last respect, Docker recently started to make advances. Last week it [bought the startup Kitematic][6], whose product gave Docker a convenient GUI on Mac OS X (and will eventually do the same for Windows). Another acqui-hire, [SocketPlane][7], is being spun in to work on Docker's networking. - -What remains to be seen is whether Docker's proposed solutions to its problems will be adopted, or whether another party -- say, [Red Hat][8] -- will provide a more immediately useful solution for enterprise customers who can't wait around for the chips to stop falling. - -"Good technology is hard and takes time to build," said Richardson. "The big risk is that expectations spin wildly out of control and customers are disappointed." - --------------------------------------------------------------------------------- - -via: http://www.infoworld.com/article/2896895/application-virtualization/best-and-worst-about-docker.html - -作者:[Serdar Yegulalp][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://www.infoworld.com/author/Serdar-Yegulalp/ -[1]:http://shutterstock.com/ -[2]:http://weave.works/ -[3]:http://stackengine.com/ -[4]:http://www.moogsoft.com/ -[5]:http://www.wavemaker.com/ -[6]:http://www.infoworld.com/article/2896099/application-virtualization/dockers-new-acquisition-does-containers-on-the-desktop.html -[7]:http://www.infoworld.com/article/2892916/application-virtualization/docker-snaps-up-socketplane-to-fix-networking-flaws.html -[8]:http://www.infoworld.com/article/2895804/application-virtualization/red-hat-wants-to-do-for-containers-what-its-done-for-linux.html \ No newline at end of file diff --git a/sources/tech/20150504 How to access a Linux server behind NAT via reverse SSH tunnel.md b/sources/tech/20150504 How to access a Linux server behind NAT via reverse SSH tunnel.md index 7eeb33676b..b67f5aee26 100644 --- a/sources/tech/20150504 How to access a Linux server behind NAT via reverse SSH tunnel.md +++ b/sources/tech/20150504 How to access a Linux server behind NAT via reverse SSH tunnel.md @@ -1,4 +1,3 @@ -2q1w2007申领 How to access a Linux server behind NAT via reverse SSH tunnel ================================================================================ You are running a Linux server at home, which is behind a NAT router or restrictive firewall. Now you want to SSH to the home server while you are away from home. How would you set that up? SSH port forwarding will certainly be an option. However, port forwarding can become tricky if you are dealing with multiple nested NAT environment. Besides, it can be interfered with under various ISP-specific conditions, such as restrictive ISP firewalls which block forwarded ports, or carrier-grade NAT which shares IPv4 addresses among users. diff --git a/sources/tech/20150522 Analyzing Linux Logs.md b/sources/tech/20150522 Analyzing Linux Logs.md index 38d5b4636e..aebc28deae 100644 --- a/sources/tech/20150522 Analyzing Linux Logs.md +++ b/sources/tech/20150522 Analyzing Linux Logs.md @@ -1,4 +1,3 @@ -translating by zhangboyue Analyzing Linux Logs ================================================================================ There’s a great deal of information waiting for you within your logs, although it’s not always as easy as you’d like to extract it. In this section we will cover some examples of basic analysis you can do with your logs right away (just search what’s there). We’ll also cover more advanced analysis that may take some upfront effort to set up properly, but will save you time on the back end. Examples of advanced analysis you can do on parsed data include generating summary counts, filtering on field values, and more. diff --git a/sources/tech/20150604 Nishita Agarwal Shares Her Interview Experience on Linux 'iptables' Firewall.md b/sources/tech/20150604 Nishita Agarwal Shares Her Interview Experience on Linux 'iptables' Firewall.md deleted file mode 100644 index ca51791986..0000000000 --- a/sources/tech/20150604 Nishita Agarwal Shares Her Interview Experience on Linux 'iptables' Firewall.md +++ /dev/null @@ -1,209 +0,0 @@ -translating by wwy-hust - -Nishita Agarwal Shares Her Interview Experience on Linux ‘iptables’ Firewall -================================================================================ -Nishita Agarwal, a frequent Tecmint Visitor shared her experience (Question and Answer) with us regarding the job interview she had just given in a privately owned hosting company in Pune, India. She was asked a lot of questions on a variety of topics however she is an expert in iptables and she wanted to share those questions and their answer (she gave) related to iptables to others who may be going to give interview in near future. - -![Linux Firewall Iptables Interview Questions](http://www.tecmint.com/wp-content/uploads/2015/05/Linux-iptables-Interview-Questions.jpg) - -All the questions and their Answer are rewritten based upon the memory of Nishita Agarwal. - -> “Hello Friends! My name is **Nishita Agarwal**. I have Pursued Bachelor Degree in Technology. My area of Specialization is UNIX and Variants of UNIX (BSD, Linux) fascinates me since the time I heard it. I have 1+ years of experience in storage. I was looking for a job change which ended with a hosting company in Pune, India.” - -Here is the collection of what I was asked during the Interview. I’ve documented only those questions and their answer that were related to iptables based upon my memory. Hope this will help you in cracking your Interview. - -### 1. Have you heard of iptables and firewall in Linux? Any idea of what they are and for what it is used? ### - -> **Answer** : I’ve been using iptables for quite long time and I am aware of both iptables and firewall. Iptables is an application program mostly written in C Programming Language and is released under GNU General Public License. Written for System administration point of view, the latest stable release if iptables 1.4.21.iptables may be considered as firewall for UNIX like operating system which can be called as iptables/netfilter, more accurately. The Administrator interact with iptables via console/GUI front end tools to add and define firewall rules into predefined tables. Netfilter is a module built inside of kernel that do the job of filtering. -> -> Firewalld is the latest implementation of filtering rules in RHEL/CentOS 7 (may be implemented in other distributions which I may not be aware of). It has replaced iptables interface and connects to netfilter. - -### 2. Have you used some kind of GUI based front end tool for iptables or the Linux Command Line? ### - -> **Answer** : Though I have used both the GUI based front end tools for iptables like Shorewall in conjugation of [Webmin][1] in GUI and Direct access to iptables via console.And I must admit that direct access to iptables via Linux console gives a user immense power in the form of higher degree of flexibility and better understanding of what is going on in the background, if not anything other. GUI is for novice administrator while console is for experienced. - -### 3. What are the basic differences between between iptables and firewalld? ### - -> **Answer** : iptables and firewalld serves the same purpose (Packet Filtering) but with different approach. iptables flush the entire rules set each time a change is made unlike firewalld. Typically the location of iptables configuration lies at ‘/etc/sysconfig/iptables‘ whereas firewalld configuration lies at ‘/etc/firewalld/‘, which is a set of XML files.Configuring a XML based firewalld is easier as compared to configuration of iptables, however same task can be achieved using both the packet filtering application ie., iptables and firewalld. Firewalld runs iptables under its hood along with it’s own command line interface and configuration file that is XML based and said above. - -### 4. Would you replace iptables with firewalld on all your servers, if given a chance? ### - -> **Answer** : I am familiar with iptables and it’s working and if there is nothing that requires dynamic aspect of firewalld, there seems no reason to migrate all my configuration from iptables to firewalld.In most of the cases, so far I have never seen iptables creating an issue. Also the general rule of Information technology says “why fix if it is not broken”. However this is my personal thought and I would never mind implementing firewalld if the Organization is going to replace iptables with firewalld. - -### 5. You seems confident with iptables and the plus point is even we are using iptables on our server. ### - -What are the tables used in iptables? Give a brief description of the tables used in iptables and the chains they support. - -> **Answer** : Thanks for the recognition. Moving to question part, There are four tables used in iptables, namely they are: -> -> Nat Table -> Mangle Table -> Filter Table -> Raw Table -> -> Nat Table : Nat table is primarily used for Network Address Translation. Masqueraded packets get their IP address altered as per the rules in the table. Packets in the stream traverse Nat Table only once. ie., If a packet from a jet of Packets is masqueraded they rest of the packages in the stream will not traverse through this table again. It is recommended not to filter in this table. Chains Supported by NAT Table are PREROUTING Chain, POSTROUTING Chain and OUTPUT Chain. -> -> Mangle Table : As the name suggests, this table serves for mangling the packets. It is used for Special package alteration. It can be used to alter the content of different packets and their headers. Mangle table can’t be used for Masquerading. Supported chains are PREROUTING Chain, OUTPUT Chain, Forward Chain, INPUT Chain, POSTROUTING Chain. -> -> Filter Table : Filter Table is the default table used in iptables. It is used for filtering Packets. If no rules are defined, Filter Table is taken as default table and filtering is done on the basis of this table. Supported Chains are INPUT Chain, OUTPUT Chain, FORWARD Chain. -> -> Raw Table : Raw table comes into action when we want to configure packages that were exempted earlier. It supports PREROUTING Chain and OUTPUT Chain. - -### 6. What are the target values (that can be specified in target) in iptables and what they do, be brief! ### - -> **Answer** : Following are the target values that we can specify in target in iptables: -> -> ACCEPT : Accept Packets -> QUEUE : Paas Package to user space (place where application and drivers reside) -> DROP : Drop Packets -> RETURN : Return Control to calling chain and stop executing next set of rules for the current Packets in the chain. - - -### 7. Lets move to the technical aspects of iptables, by technical I means practical. ### - -How will you Check iptables rpm that is required to install iptables in CentOS?. - -> **Answer** : iptables rpm are included in standard CentOS installation and we do not need to install it separately. We can check the rpm as: -> -> # rpm -qa iptables -> -> iptables-1.4.21-13.el7.x86_64 -> -> If you need to install it, you may do yum to get it. -> -> # yum install iptables-services - -### 8. How to Check and ensure if iptables service is running? ### - -> **Answer** : To check the status of iptables, you may run the following command on the terminal. -> -> # service status iptables [On CentOS 6/5] -> # systemctl status iptables [On CentOS 7] -> -> If it is not running, the below command may be executed. -> -> ---------------- On CentOS 6/5 ---------------- -> # chkconfig --level 35 iptables on -> # service iptables start -> -> ---------------- On CentOS 7 ---------------- -> # systemctl enable iptables -> # systemctl start iptables -> -> We may also check if the iptables module is loaded or not, as: -> -> # lsmod | grep ip_tables - -### 9. How will you review the current Rules defined in iptables? ### - -> **Answer** : The current rules in iptables can be review as simple as: -> -> # iptables -L -> -> Sample Output -> -> Chain INPUT (policy ACCEPT) -> target prot opt source destination -> ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED -> ACCEPT icmp -- anywhere anywhere -> ACCEPT all -- anywhere anywhere -> ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:ssh -> REJECT all -- anywhere anywhere reject-with icmp-host-prohibited -> -> Chain FORWARD (policy ACCEPT) -> target prot opt source destination -> REJECT all -- anywhere anywhere reject-with icmp-host-prohibited -> -> Chain OUTPUT (policy ACCEPT) -> target prot opt source destination - -### 10. How will you flush all iptables rules or a particular chain? ### - -> **Answer** : To flush a particular iptables chain, you may use following commands. -> -> -> # iptables --flush OUTPUT -> -> To Flush all the iptables rules. -> -> # iptables --flush - -### 11. Add a rule in iptables to accept packets from a trusted IP Address (say 192.168.0.7) ### - -> **Answer** : The above scenario can be achieved simply by running the below command. -> -> # iptables -A INPUT -s 192.168.0.7 -j ACCEPT -> -> We may include standard slash or subnet mask in the source as: -> -> # iptables -A INPUT -s 192.168.0.7/24 -j ACCEPT -> # iptables -A INPUT -s 192.168.0.7/255.255.255.0 -j ACCEPT - -### 12. How to add rules to ACCEPT, REJECT, DENY and DROP ssh service in iptables. ### - -> **Answer** : Hoping ssh is running on port 22, which is also the default port for ssh, we can add rule to iptables as:To ACCEPT tcp packets for ssh service (port 22). -> -> # iptables -A INPUT -s -p tcp - -dport -j ACCEPT -> -> To REJECT tcp packets for ssh service (port 22). -> -> # iptables -A INPUT -s -p tcp - -dport -j REJECT -> -> To DENY tcp packets for ssh service (port 22). -> -> -> # iptables -A INPUT -s -p tcp - -dport -j DENY -> -> To DROP tcp packets for ssh service (port 22). -> -> -> # iptables -A INPUT -s -p tcp - -dport -j DROP - -### 13. Let me give you a scenario. Say there is a machine the local ip address of which is 192.168.0.6. You need to block connections on port 21, 22, 23, and 80 to your machine. What will you do? ### - -> **Answer** : Well all I need to use is the ‘multiport‘ option with iptables followed by port numbers to be blocked and the above scenario can be achieved in a single go as. -> -> # iptables -A INPUT -s 192.168.0.6 -p tcp -m multiport --dport 22,23,80,8080 -j DROP -> -> The written rules can be checked using the below command. -> -> # iptables -L -> -> Chain INPUT (policy ACCEPT) -> target prot opt source destination -> ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED -> ACCEPT icmp -- anywhere anywhere -> ACCEPT all -- anywhere anywhere -> ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:ssh -> REJECT all -- anywhere anywhere reject-with icmp-host-prohibited -> DROP tcp -- 192.168.0.6 anywhere multiport dports ssh,telnet,http,webcache -> -> Chain FORWARD (policy ACCEPT) -> target prot opt source destination -> REJECT all -- anywhere anywhere reject-with icmp-host-prohibited -> -> Chain OUTPUT (policy ACCEPT) -> target prot opt source destination - -**Interviewer** : That’s all I wanted to ask. You are a valuable employee we won’t like to miss. I will recommend your name to the HR. If you have any question you may ask me. - -As a candidate I don’t wanted to kill the conversation hence keep asking about the projects I would be handling if selected and what are the other openings in the company. Not to mention HR round was not difficult to crack and I got the opportunity. - -Also I would like to thank Avishek and Ravi (whom I am a friend since long) for taking the time to document my interview. - -Friends! If you had given any such interview and you would like to share your interview experience to millions of Tecmint readers around the globe? then send your questions and answers to admin@tecmint.com. - -Thank you! Keep Connected. Also let me know if I could have answered a question more correctly than what I did. - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/linux-firewall-iptables-interview-questions-and-answers/ - -作者:[Avishek Kumar][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.tecmint.com/author/avishek/ -[1]:http://www.tecmint.com/install-webmin-web-based-system-administration-tool-for-rhel-centos-fedora/ From f70052ce39a0a68d2b265f29c5901294130447fd Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 28 Jul 2015 22:10:15 +0800 Subject: [PATCH 723/965] PUB:20150227 Fix Minimal BASH like line editing is supported GRUB Error In Linux @martin2011qi --- ...ne editing is supported GRUB Error In Linux.md | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) rename {translated/tech => published}/20150227 Fix Minimal BASH like line editing is supported GRUB Error In Linux.md (83%) diff --git a/translated/tech/20150227 Fix Minimal BASH like line editing is supported GRUB Error In Linux.md b/published/20150227 Fix Minimal BASH like line editing is supported GRUB Error In Linux.md similarity index 83% rename from translated/tech/20150227 Fix Minimal BASH like line editing is supported GRUB Error In Linux.md rename to published/20150227 Fix Minimal BASH like line editing is supported GRUB Error In Linux.md index 4edaa333d8..66ab15e999 100644 --- a/translated/tech/20150227 Fix Minimal BASH like line editing is supported GRUB Error In Linux.md +++ b/published/20150227 Fix Minimal BASH like line editing is supported GRUB Error In Linux.md @@ -1,8 +1,11 @@ -修复Linux中的提供最小化类BASH命令行编辑GRUB错误 +修复Linux中的“提供类似行编辑的袖珍BASH...”的GRUB错误 ================================================================================ + 这两天我[安装了Elementary OS和Windows双系统][1],在启动的时候遇到了一个Grub错误。命令行中呈现如下信息: -**提供最小化类BASH命令行编辑。对于第一个词,TAB键补全可以使用的命令。除此之外,TAB键补全可用的设备或文件。** +**Minimal BASH like line editing is supported. For the first word, TAB lists possible command completions. anywhere else TAB lists possible device or file completions.** + +**提供类似行编辑的袖珍 BASH。TAB键补全第一个词,列出可以使用的命令。除此之外,TAB键补全可以列出可用的设备或文件。** ![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/02/Boot_Repair_Ubuntu_Linux_1.jpeg) @@ -10,7 +13,7 @@ 通过这篇文章里我们可以学到基于Linux系统**如何修复Ubuntu中出现的“minimal BASH like line editing is supported” Grub错误**。 -> 你可以参阅这篇教程来修复类似的高频问题,[错误:分区未找到Linux grub救援模式][3]。 +> 你可以参阅这篇教程来修复类似的常见问题,[错误:分区未找到Linux grub救援模式][3]。 ### 先决条件 ### @@ -19,11 +22,11 @@ - 一个包含相同版本、相同OS的LiveUSB或磁盘 - 当前会话的Internet连接正常工作 -在确认了你拥有先决条件了之后,让我们看看如何修复Linux的死亡黑屏(如果我可以这样的称呼它的话;))。 +在确认了你拥有先决条件了之后,让我们看看如何修复Linux的死亡黑屏(如果我可以这样的称呼它的话 ;) )。 ### 如何在基于Ubuntu的Linux中修复“minimal BASH like line editing is supported” Grub错误 ### -我知道你一定疑问这种Grub错误并不局限于在基于Ubuntu的Linux发行版上发生,那为什么我要强调在基于Ubuntu的发行版上呢?原因是,在这里我们将采用一个简单的方法并叫作**Boot Repair**的工具来修复我们的问题。我并不确定在其他的诸如Fedora的发行版中是否有这个工具可用。不再浪费时间,我们来看如何修复minimal BASH like line editing is supported Grub错误。 +我知道你一定疑问这种Grub错误并不局限于在基于Ubuntu的Linux发行版上发生,那为什么我要强调在基于Ubuntu的发行版上呢?原因是,在这里我们将采用一个简单的方法,用个叫做**Boot Repair**的工具来修复我们的问题。我并不确定在其他的诸如Fedora的发行版中是否有这个工具可用。不再浪费时间,我们来看如何修复“minimal BASH like line editing is supported” Grub错误。 ### 步骤 1: 引导进入lives会话 ### @@ -75,7 +78,7 @@ via: http://itsfoss.com/fix-minimal-bash-line-editing-supported-grub-error-linux 作者:[Abhishek][a] 译者:[martin2011qi](https://github.com/martin2011qi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 From 62e6cbbd139246c280b1e4dc5c1c314606481265 Mon Sep 17 00:00:00 2001 From: ictlyh Date: Tue, 28 Jul 2015 22:27:26 +0800 Subject: [PATCH 724/965] [Translating] sources/tech/20150522 Analyzing Linux Logs.md --- sources/tech/20150522 Analyzing Linux Logs.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20150522 Analyzing Linux Logs.md b/sources/tech/20150522 Analyzing Linux Logs.md index aebc28deae..832ea369ec 100644 --- a/sources/tech/20150522 Analyzing Linux Logs.md +++ b/sources/tech/20150522 Analyzing Linux Logs.md @@ -1,3 +1,4 @@ +ictlyh Translating Analyzing Linux Logs ================================================================================ There’s a great deal of information waiting for you within your logs, although it’s not always as easy as you’d like to extract it. In this section we will cover some examples of basic analysis you can do with your logs right away (just search what’s there). We’ll also cover more advanced analysis that may take some upfront effort to set up properly, but will save you time on the back end. Examples of advanced analysis you can do on parsed data include generating summary counts, filtering on field values, and more. From 7634a479357b9e584bb6dc8fe30d6b8b7bfa77b3 Mon Sep 17 00:00:00 2001 From: wxy Date: Wed, 29 Jul 2015 00:03:39 +0800 Subject: [PATCH 725/965] PUB:20150616 LINUX 101--POWER UP YOUR SHELL MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @FSSlc 辛苦啦。 --- ...20150616 LINUX 101--POWER UP YOUR SHELL.md | 177 ++++++++++++++++++ ...20150616 LINUX 101--POWER UP YOUR SHELL.md | 177 ------------------ 2 files changed, 177 insertions(+), 177 deletions(-) create mode 100644 published/20150616 LINUX 101--POWER UP YOUR SHELL.md delete mode 100644 translated/tech/20150616 LINUX 101--POWER UP YOUR SHELL.md diff --git a/published/20150616 LINUX 101--POWER UP YOUR SHELL.md b/published/20150616 LINUX 101--POWER UP YOUR SHELL.md new file mode 100644 index 0000000000..dd7b985b01 --- /dev/null +++ b/published/20150616 LINUX 101--POWER UP YOUR SHELL.md @@ -0,0 +1,177 @@ +LINUX 101: 让你的 SHELL 更强大 +================================================================================ +> 在我们的关于 shell 基础的指导下, 得到一个更灵活,功能更强大且多彩的命令行界面 + +**为何要这样做?** + +- 使得在 shell 提示符下过得更轻松,高效 +- 在失去连接后恢复先前的会话 +- Stop pushing around that fiddly rodent! + +![bash1](http://www.linuxvoice.com/wp-content/uploads/2015/02/bash1-large15.png) + +这是我的命令行提示符的设置。对于这个小的终端窗口来说,这或许有些长。但你可以根据你的喜好来调整它。 + +作为一个 Linux 用户, 你可能熟悉 shell (又名为命令行)。 或许你需要时不时的打开终端来完成那些不能在 GUI 下处理的必要任务,抑或是因为你处在一个将窗口铺满桌面的环境中,而 shell 是你与你的 linux 机器交互的主要方式。 + +在上面那些情况下,你可能正在使用你所使用的发行版本自带的 Bash 配置。 尽管对于大多数的任务而言,它足够好了,但它可以更加强大。 在本教程中,我们将向你展示如何使得你的 shell 提供更多有用信息、更加实用且更适合工作。 我们将对提示符进行自定义,让它比默认情况下提供更好的反馈,并向你展示如何使用炫酷的 `tmux` 工具来管理会话并同时运行多个程序。 并且,为了让眼睛舒服一点,我们还将关注配色方案。那么,进击吧,少女! + +### 让提示符更美妙 ### + +大多数的发行版本配置有一个非常简单的提示符,它们大多向你展示了一些基本信息, 但提示符可以为你提供更多的内容。例如,在 Debian 7 下,默认的提示符是这样的: + + mike@somebox:~$ + +上面的提示符展示出了用户、主机名、当前目录和账户类型符号(假如你切换到 root 账户, **$** 会变为 **#**)。 那这些信息是在哪里存储的呢? 答案是:在 **PS1** 环境变量中。 假如你键入 `echo $PS1`, 你将会在这个命令的输出字符串的最后有如下的字符: + + \u@\h:\w$ + +这看起来有一些丑陋,并在瞥见它的第一眼时,你可能会开始尖叫,认为它是令人恐惧的正则表达式,但我们不打算用这些复杂的字符来煎熬我们的大脑。这不是正则表达式,这里的斜杠是转义序列,它告诉提示符进行一些特别的处理。 例如,上面的 **u** 部分,告诉提示符展示用户名, 而 w 则展示工作路径. + +下面是一些你可以在提示符中用到的字符的列表: + +- d 当前的日期 +- h 主机名 +- n 代表换行的字符 +- A 当前的时间 (HH:MM) +- u 当前的用户 +- w (小写) 整个工作路径的全称 +- W (大写) 工作路径的简短名称 +- $ 一个提示符号,对于 root 用户为 # 号 +- ! 当前命令在 shell 历史记录中的序号 + +下面解释 **w** 和 **W** 选项的区别: 对于前者,你将看到你所在的工作路径的完整地址,(例如 **/usr/local/bin**),而对于后者, 它则只显示 **bin** 这一部分。 + +现在,我们该怎样改变提示符呢? 你需要更改 **PS1** 环境变量的内容,试试下面这个: + + export PS1="I am \u and it is \A $" + +现在,你的提示符将会像下面这样: + + I am mike and it is 11:26 $ + +从这个例子出发,你就可以按照你的想法来试验一下上面列出的其他转义序列。 但等等 – 当你登出后,你的这些努力都将消失,因为在你每次打开终端时,**PS1** 环境变量的值都会被重置。解决这个问题的最简单方式是打开 **.bashrc** 配置文件(在你的家目录下) 并在这个文件的最下方添加上完整的 `export` 命令。在每次你启动一个新的 shell 会话时,这个 **.bashrc** 会被 `Bash` 读取, 所以你的加强的提示符就可以一直出现。你还可以使用额外的颜色来装扮提示符。刚开始,这将有点棘手,因为你必须使用一些相当奇怪的转义序列,但结果是非常漂亮的。 将下面的字符添加到你的 **PS1**字符串中的某个位置,最终这将把文本变为红色: + + \[\e[31m\] + +你可以将这里的 31 更改为其他的数字来获得不同的颜色: + +- 30 黑色 +- 32 绿色 +- 33 黄色 +- 34 蓝色 +- 35 洋红色 +- 36 青色 +- 37 白色 + +所以,让我们使用先前看到的转义序列和颜色来创造一个提示符,以此来结束这一小节的内容。深吸一口气,弯曲你的手指,然后键入下面这只“野兽”: + + export PS1="(\!) \[\e[31m\] \[\A\] \[\e[32m\]\u@\h \[\e[34m\]\w \[\e[30m\]$" + +上面的命令提供了一个 Bash 命令历史序号、当前的时间、彩色的用户或主机名组合、以及工作路径。假如你“野心勃勃”,利用一些惊人的组合,你还可以更改提示符的背景色和前景色。非常有用的 Arch wiki 有一个关于颜色代码的完整列表:[http://tinyurl.com/3gvz4ec][1]。 + +> **Shell 精要** +> +> 假如你是一个彻底的 Linux 新手并第一次阅读这份杂志,或许你会发觉阅读这些教程有些吃力。 所以这里有一些基础知识来让你熟悉一些 shell。 通常在你的菜单中, shell 指的是 Terminal、 XTerm 或 Konsole, 当你启动它后, 最为实用的命令有这些: +> +> **ls** (列出文件名); **cp one.txt two.txt** (复制文件); **rm file.txt** (移除文件); **mv old.txt new.txt** (移动或重命名文件); +> +> **cd /some/directory** (改变目录); **cd ..** (回到上级目录); **./program** (在当前目录下运行一个程序); **ls > list.txt** (重定向输出到一个文件)。 +> +> 几乎每个命令都有一个手册页用来解释其选项(例如 **man ls** – 按 Q 来退出)。在那里,你可以知晓命令的选项,这样你就知道 **ls -la** 展示一个详细的列表,其中也列出了隐藏文件, 并且在键入一个文件或目录的名字的一部分后, 可以使用 Tab 键来自动补全。 + +### Tmux: 针对 shell 的窗口管理器 ### + +在文本模式的环境中使用一个窗口管理器 – 这听起来有点不可思议, 是吧? 然而,你应该记得当 Web 浏览器第一次实现分页浏览的时候吧? 在当时, 这是在可用性上的一个重大进步,它减少了桌面任务栏的杂乱无章和繁多的窗口列表。 对于你的浏览器来说,你只需要一个按钮便可以在浏览器中切换到你打开的每个单独网站, 而不是针对每个网站都有一个任务栏或导航图标。 这个功能非常有意义。 + +若有时你同时运行着几个虚拟终端,你便会遇到相似的情况; 在这些终端之间跳转,或每次在任务栏或窗口列表中找到你所需要的那一个终端,都可能会让你觉得麻烦。 拥有一个文本模式的窗口管理器不仅可以让你像在同一个终端窗口中运行多个 shell 会话,而且你甚至还可以将这些窗口排列在一起。 + +另外,这样还有另一个好处:可以将这些窗口进行分离和重新连接。想要看看这是如何运行的最好方式是自己尝试一下。在一个终端窗口中,输入 `screen` (在大多数发行版本中,它已经默认安装了或者可以在软件包仓库中找到)。 某些欢迎的文字将会出现 – 只需敲击 Enter 键这些文字就会消失。 现在运行一个交互式的文本模式的程序,例如 `nano`, 并关闭这个终端窗口。 + +在一个正常的 shell 对话中, 关闭窗口将会终止所有在该终端中运行的进程 – 所以刚才的 Nano 编辑对话也就被终止了, 但对于 screen 来说,并不是这样的。打开一个新的终端并输入如下命令: + + screen -r + +瞧,你刚开打开的 Nano 会话又回来了! + +当刚才你运行 **screen** 时, 它会创建了一个新的独立的 shell 会话, 它不与某个特定的终端窗口绑定在一起,所以可以在后面被分离并重新连接(即 **-r** 选项)。 + +当你正使用 SSH 去连接另一台机器并做着某些工作时, 但并不想因为一个脆弱的连接而影响你的进度,这个方法尤其有用。假如你在一个 **screen** 会话中做着某些工作,并且你的连接突然中断了(或者你的笔记本没电了,又或者你的电脑报废了——不是这么悲催吧),你只需重新连接或给电脑充电或重新买一台电脑,接着运行 **screen -r** 来重新连接到远程的电脑,并在刚才掉线的地方接着开始。 + +现在,我们都一直在讨论 GNU 的 **screen**,但这个小节的标题提到的是 tmux。 实质上, **tmux** (terminal multiplexer) 就像是 **screen** 的一个进阶版本,带有许多有用的额外功能,所以现在我们开始关注 tmux。 某些发行版本默认包含了 **tmux**; 在其他的发行版本上,通常只需要一个 **apt-get、 yum install** 或 **pacman -S** 命令便可以安装它。 + +一旦你安装了它过后,键入 **tmux** 来启动它。接着你将注意到,在终端窗口的底部有一条绿色的信息栏,它非常像传统的窗口管理器中的任务栏: 上面显示着一个运行着的程序的列表、机器的主机名、当前时间和日期。 现在运行一个程序,同样以 Nano 为例, 敲击 Ctrl+B 后接着按 C 键, 这将在 tmux 会话中创建一个新的窗口,你便可以在终端的底部的任务栏中看到如下的信息: + + 0:nano- 1:bash* + +每一个窗口都有一个数字,当前呈现的程序被一个星号所标记。 Ctrl+B 是与 tmux 交互的标准方式, 所以若你敲击这个按键组合并带上一个窗口序号, 那么就会切换到对应的那个窗口。你也可以使用 Ctrl+B 再加上 N 或 P 来分别切换到下一个或上一个窗口 – 或者使用 Ctrl+B 加上 L 来在最近使用的两个窗口之间来进行切换(有点类似于桌面中的经典的 Alt+Tab 组合键的效果)。 若需要知道窗口列表,使用 Ctrl+B 再加上 W。 + +目前为止,一切都还好:现在你可以在一个单独的终端窗口中运行多个程序,避免混乱(尤其是当你经常与同一个远程主机保持多个 SSH 连接时)。 当想同时看两个程序又该怎么办呢? + +针对这种情况, 可以使用 tmux 中的窗格。 敲击 Ctrl+B 再加上 % , 则当前窗口将分为两个部分:一个在左一个在右。你可以使用 Ctrl+B 再加上 O 来在这两个部分之间切换。 这尤其在你想同时看两个东西时非常实用, – 例如一个窗格看指导手册,另一个窗格里用编辑器看一个配置文件。 + +有时,你想对一个单独的窗格进行缩放,而这需要一定的技巧。 首先你需要敲击 Ctrl+B 再加上一个 :(冒号),这将使得位于底部的 tmux 栏变为深橙色。 现在,你进入了命令模式,在这里你可以输入命令来操作 tmux。 输入 **resize-pane -R** 来使当前窗格向右移动一个字符的间距, 或使用 **-L** 来向左移动。 对于一个简单的操作,这些命令似乎有些长,但请注意,在 tmux 的命令模式(前面提到的一个分号开始的模式)下,可以使用 Tab 键来补全命令。 另外需要提及的是, **tmux** 同样也有一个命令历史记录,所以若你想重复刚才的缩放操作,可以先敲击 Ctrl+B 再跟上一个分号,并使用向上的箭头来取回刚才输入的命令。 + +最后,让我们看一下分离和重新连接 - 即我们刚才介绍的 screen 的特色功能。 在 tmux 中,敲击 Ctrl+B 再加上 D 来从当前的终端窗口中分离当前的 tmux 会话。这使得这个会话的一切工作都在后台中运行、使用 `tmux a` 可以再重新连接到刚才的会话。但若你同时有多个 tmux 会话在运行时,又该怎么办呢? 我们可以使用下面的命令来列出它们: + + tmux ls + +这个命令将为每个会话分配一个序号; 假如你想重新连接到会话 1, 可以使用 `tmux a -t 1`. tmux 是可以高度定制的,你可以自定义按键绑定并更改配色方案, 所以一旦你适应了它的主要功能,请钻研指导手册以了解更多的内容。 + + +![tmux](http://www.linuxvoice.com/wp-content/uploads/2015/02/tmux-large13.jpg) + +上图中, tmux 开启了两个窗格: 左边是 Vim 正在编辑一个配置文件,而右边则展示着指导手册页。 + +> **Zsh: 另一个 shell** +> +> 选择是好的,但标准同样重要。 你要知道几乎每个主流的 Linux 发行版本都默认使用 Bash shell – 尽管还存在其他的 shell。 Bash 为你提供了一个 shell 能够给你提供的几乎任何功能,包括命令历史记录,文件名补全和许多脚本编程的能力。它成熟、可靠并文档丰富 – 但它不是你唯一的选择。 +> +> 许多高级用户热衷于 Zsh, 即 Z shell。 这是 Bash 的一个替代品并提供了 Bash 的几乎所有功能,另外还提供了一些额外的功能。 例如, 在 Zsh 中,你输入 **ls** ,并敲击 Tab 键可以得到 **ls** 可用的各种不同选项的一个大致描述。 而不需要再打开 man page 了! +> +> Zsh 还支持其他强大的自动补全功能: 例如,输入 **cd /u/lo/bi** 再敲击 Tab 键, 则完整的路径名 **/usr/local/bin** 就会出现(这里假设没有其他的路径包含 **u**, **lo** 和 **bi** 等字符)。 或者只输入 **cd** 再跟上 Tab 键,则你将看到着色后的路径名的列表 – 这比 Bash 给出的简单的结果好看得多。 +> +> Zsh 在大多数的主要发行版本上都可以得到了; 安装它后并输入 **zsh** 便可启动它。 要将你的默认 shell 从 Bash 改为 Zsh, 可以使用 **chsh** 命令。 若需了解更多的信息,请访问 [www.zsh.org][2]。 + +### “未来”的终端 ### + +你或许会好奇为什么包含你的命令行提示符的应用被叫做终端。 这需要追溯到 Unix 的早期, 那时人们一般工作在一个多用户的机器上,这个巨大的电脑主机将占据一座建筑中的一个房间, 人们通过某些线路,使用屏幕和键盘来连接到这个主机, 这些终端机通常被称为“哑终端”, 因为它们不能靠自己做任何重要的执行任务 – 它们只展示通过线路从主机传来的信息,并输送回从键盘的敲击中得到的输入信息。 + +今天,我们在自己的机器上执行几乎所有的实际操作,所以我们的电脑不是传统意义下的终端,这就是为什么诸如 **XTerm**、 Gnome Terminal、 Konsole 等程序被称为“终端模拟器” 的原因 – 他们提供了同昔日的物理终端一样的功能。事实上,在许多方面它们并没有改变多少。诚然,现在我们有了反锯齿字体,更好的颜色和点击网址的能力,但总的来说,几十年来我们一直以同样的方式在工作。 + +所以某些程序员正尝试改变这个状况。 **Terminology** ([http://tinyurl.com/osopjv9][3]), 它来自于超级时髦的 Enlightenment 窗口管理器背后的团队,旨在让终端步入到 21 世纪,例如带有在线媒体显示功能。你可以在一个充满图片的目录里输入 **ls** 命令,便可以看到它们的缩略图,或甚至可以直接在你的终端里播放视频。 这使得一个终端有点类似于一个文件管理器,意味着你可以快速地检查媒体文件的内容而不必用另一个应用来打开它们。 + +接着还有 Xiki ([www.xiki.org][4]),它自身的描述为“命令的革新”。它就像是一个传统的 shell、一个 GUI 和一个 wiki 之间的过渡;你可以在任何地方输入命令,并在后面将它们的输出存储为笔记以作为参考,并可以创建非常强大的自定义命令。用几句话是很能描述它的,所以作者们已经创作了一个视频来展示它的潜力是多么的巨大(请看 **Xiki** 网站的截屏视频部分)。 + +并且 Xiki 绝不是那种在几个月之内就消亡的昙花一现的项目,作者们成功地进行了一次 Kickstarter 众筹,在七月底已募集到超过 $84,000。 是的,你没有看错 – $84K 来支持一个终端模拟器。这可能是最不寻常的集资活动了,因为某些疯狂的家伙已经决定开始创办它们自己的 Linux 杂志 ...... + +### 下一代终端 ### + +许多命令行和基于文本的程序在功能上与它们的 GUI 程序是相同的,并且常常更加快速和高效。我们的推荐有: +**Irssi** (IRC 客户端); **Mutt** (mail 客户端); **rTorrent** (BitTorrent); **Ranger** (文件管理器); **htop** (进程监视器)。 若给定在终端的限制下来进行 Web 浏览, Elinks 确实做的很好,并且对于阅读那些以文字为主的网站例如 Wikipedia 来说。它非常实用。 + +> **微调配色方案** +> +> 在《Linux Voice》杂志社中,我们并不迷恋那些养眼的东西,但当你每天花费几个小时盯着屏幕看东西时,我们确实认识到美学的重要性。我们中的许多人都喜欢调整我们的桌面和窗口管理器来达到完美的效果,调整阴影效果、摆弄不同的配色方案,直到我们 100% 的满意(然后出于习惯,摆弄更多的东西)。 +> +> 但我们倾向于忽视终端窗口,它理应也获得我们的喜爱,并且在 [http://ciembor.github.io/4bit][5] 你将看到一个极其棒的配色方案设计器,对于所有受欢迎的终端模拟器(**XTerm, Gnome Terminal, Konsole 和 Xfce4 Terminal 等都是支持的应用。**),它可以输出其设定。移动滑块直到你看到配色方案最佳, 然后点击位于该页面右上角的 `得到方案` 按钮。 +> +> 相似的,假如你在一个文本编辑器,如 Vim 或 Emacs 上花费了很多的时间,使用一个精心设计的调色板也是非常值得的。 **Solarized** [http://ethanschoonover.com/solarized][6] 是一个卓越的方案,它不仅漂亮,而且因追求最大的可用性而设计,在其背后有着大量的研究和测试。 + +-------------------------------------------------------------------------------- + +via: http://www.linuxvoice.com/linux-101-power-up-your-shell-8/ + +作者:[Ben Everard][a] +译者:[FSSlc](https://github.com/FSSlc) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.linuxvoice.com/author/ben_everard/ +[1]:http://tinyurl.com/3gvz4ec +[2]:http://www.zsh.org/ +[3]:http://tinyurl.com/osopjv9 +[4]:http://www.xiki.org/ +[5]:http://ciembor.github.io/4bit +[6]:http://ethanschoonover.com/solarized \ No newline at end of file diff --git a/translated/tech/20150616 LINUX 101--POWER UP YOUR SHELL.md b/translated/tech/20150616 LINUX 101--POWER UP YOUR SHELL.md deleted file mode 100644 index fac7fa2e1b..0000000000 --- a/translated/tech/20150616 LINUX 101--POWER UP YOUR SHELL.md +++ /dev/null @@ -1,177 +0,0 @@ -LINUX 101: 让你的 SHELL 更强大 -================================================================================ -> 在我们的有关 shell 基础的指导下, 得到一个更灵活,功能更强大且多彩的命令行界面 - -**为何要这样做?** - -- 使得在 shell 提示符下过得更轻松,高效 -- 在失去连接后恢复先前的会话 -- Stop pushing around that fiddly rodent! (注: 我不知道这句该如何翻译) - -![bash1](http://www.linuxvoice.com/wp-content/uploads/2015/02/bash1-large15.png) - -Here’s our souped-up prompt on steroids.(注: 我不知道该如何翻译这句)对于这个细小的终端窗口来说,这或许有些长.但你可以根据你的喜好来调整它的大小. - -作为一个 Linux 用户, 对 shell (又名为命令行),你可能会熟悉. 或许你需要时不时的打开终端来完成那些不能在 GUI 下处理的必要任务,抑或是因为你处在一个平铺窗口管理器的环境中, 而 shell 是你与你的 linux 机器交互的主要方式. - -在上面的任一情况下,你可能正在使用你所使用的发行版本自带的 Bash 配置. 尽管对于大多数的任务而言,它足够强大,但它可以更加强大. 在本教程中,我们将向你展示如何使得你的 shell 更具信息性,更加实用且更适于在其中工作. 我们将对提示符进行自定义,让它比默认情况下提供更好的反馈,并向你展示如何使用炫酷的 `tmux` 工具来管理会话并同时运行多个程序. 并且,为了让眼睛舒服一点,我们还将关注配色方案. 接着,就让我们向前吧! - -### 让提示符 "唱歌" ### - -大多数的发行版本配置有一个非常简单的提示符 – 它们大多向你展示了一些基本信息, 但提示符可以为你提供更多的内容.例如,在 Debian 7 下,默认的提示符是这样的: - - mike@somebox:~$ - -上面的提示符展示出了用户,主机名,当前目录和账户类型符号(假如你切换到 root 账户, **$** 会变为 # ). 那这些信息是在哪里存储的呢? 答案是:在 **PS1** 环境变量中. 假如你键入 **echo $PS1**, 你将会在这个命令的输出字符串的最后有如下的字符: - - \u@\h:\w$ (注:这里没有加上斜杠 \,应该是没有转义 ,下面的有些命令也一样,我把 \ 都加上了,发表的时候也得注意一下) - -这看起来有一些丑陋,并在瞥见它的第一眼时,你可能会开始尖叫,认为它是令人恐惧的正则表达式,但我们不打算用这些复杂的字符来煎熬我们的大脑. 这不是正则表达式, 这里的斜杠是转义序列,它告诉提示符进行一些特别的处理. 例如,上面的 **u** 部分,告诉提示符展示用户名, 而 w 则展示工作路径. - -下面是一些你可以在提示符中用到的字符的列表: - -- d 当前的日期. -- h 主机名. -- n 代表新的一行的字符. -- A 当前的时间 (HH:MM). -- u 当前的用户. -- w (小写) 整个工作路径的全称. -- W (大写) 工作路径的简短名称. -- $ 一个提示符号,对于 root 用户为 # 号. -- ! 当前命令在 shell 历史记录中的序号. - -下面解释 **w** 和 **W** 选项的区别: 对于前者,你将看到你所在的工作路径的完整地址,(例如 **/usr/local/bin**), 而对于后者, 它则只显示 **bin** 这一部分. - -现在, 我们该怎样改变提示符呢? 你需要更改 **PS1** 环境变量的内容, 试试下面这个: - - export PS1=”I am \u and it is \A $” - -现在, 你的提示符将会像下面这样: - - I am mike and it is 11:26 $ - -从这个例子出发, 你就可以按照你的想法来试验一下上面列出的其他转义序列. 但稍等片刻 – 当你登出后,你的这些努力都将消失,因为在你每次打开终端时, **PS1** 环境变量的值都会被重置. 解决这个问题的最简单方式是打开 **.bashrc** 配置文件(在你的家目录下) 并在这个文件的最下方添加上完整的 `export` 命令.在每次你启动一个新的 shell 会话时,这个 **.bashrc** 会被 `Bash` 读取, 所以你的被加强了的提示符就可以一直出现.你还可以使用额外的颜色来装扮提示符.刚开始,这将有点棘手,因为你必须使用一些相当奇怪的转义序列,但结果是非常漂亮的. 将下面的字符添加到你的 **PS1**字符串中的某个位置,最终这将把文本变为红色: - - \[\e[31m\] - -你可以将这里的 31 更改为其他的数字来获得不同的颜色: - -- 30 黑色 -- 32 绿色 -- 33 黄色 -- 34 蓝色 -- 35 洋红色 -- 36 青色 -- 37 白色 - -所以,让我们使用先前看到的转义序列和颜色来创造一个提示符,以此来结束这一小节的内容. 深吸一口气,弯曲你的手指,然后键入下面这只"野兽": - - export PS1="(\!) \[\e[31m\] \[\A\] \[\e[32m\]\u@\h \[\e[34m\]\w \[\e[30m\]$" - -上面的命令提供了一个 Bash 命令历史序号, 当前的时间,用户或主机名与颜色之间的组合,以及工作路径.假如你"野心勃勃",利用一些惊人的组合,你还可以更改提示符的背景色和前景色.先前实用的 Arch wiki 有一个关于颜色代码的完整列表:[http://tinyurl.com/3gvz4ec][1]. - -> ### Shell 精要 ### -> -> 假如你是一个彻底的 Linux 新手并第一次阅读这份杂志,或许你会发觉阅读这些教程有些吃力. 所以这里有一些基础知识来让你熟悉一些 shell. 通常在你的菜单中, shell 指的是 Terminal, XTerm 或 Konsole, 但你启动它后, 最为实用的命令有这些: -> -> **ls** (列出文件名); **cp one.txt two.txt** (复制文件); **rm file.txt** (移除文件); **mv old.txt new.txt** (移动或重命名文件); -> -> **cd /some/directory** (改变目录); **cd ..** (回到上级目录); **./program** (在当前目录下运行一个程序); **ls > list.txt** (重定向输出到一个文件). -> -> 几乎每个命令都有一个手册页用来解释其选项(例如 **man ls** – 按 Q 来退出).在那里,你可以知晓命令的选项,这样你就知道 **ls -la** 展示一个详细的列表,其中也列出了隐藏文件, 并且在键入一个文件或目录的名字的一部分后, 可以使用 Tab 键来自动补全. - -### Tmux: 针对 shell 的窗口管理器 ### - -在文本模式的环境中使用一个窗口管理器 – 这听起来有点不可思议, 是吧? 然而,你应该记得当 Web 浏览器第一次实现分页浏览的时候吧? 在当时, 这是在可用性上的一个重大进步,它减少了桌面任务栏的杂乱无章和繁多的窗口列表. 对于你的浏览器来说,你只需要一个按钮便可以在浏览器中切换到你打开的每个单独网站, 而不是针对每个网站都有一个任务栏或导航图标. 这个功能非常有意义. - -若有时你同时运行着几个虚拟终端,你便会遇到相似的情况; 在这些终端之间跳转,或每次在任务栏或窗口列表中找到你所需要的那一个终端,都可能会让你觉得麻烦. 拥有一个文本模式的窗口管理器不仅可以让你像在同一个终端窗口中运行多个 shell 会话,而且你甚至还可以将这些窗口排列在一起. - -另外,这样还有另一个好处:可以将这些窗口进行分离和重新连接.想要看看这是如何运行的最好方式是自己尝试一下. 在一个终端窗口中,输入 **screen** (在大多数发行版本中,它被默认安装了或者可以在软件包仓库中找到). 某些欢迎的文字将会出现 – 只需敲击 Enter 键这些文字就会消失. 现在运行一个交互式的文本模式的程序,例如 **nano**, 并关闭这个终端窗口. - -在一个正常的 shell 对话中, 关闭窗口将会终止所有在该终端中运行的进程 – 所以刚才的 Nano 编辑对话也就被终止了, 但对于 screen 来说,并不是这样的. 打开一个新的终端并输入如下命令: - - screen -r - -瞧, 你刚开打开的 Nano 会话又回来了! - -当刚才你运行 **screen** 时, 它会创建了一个新的独立的 shell 会话, 它不与某个特定的终端窗口绑定在一起,所以可以在后面被分离并重新连接( 即 **-r** 选项). - -当你正使用 SSH 去连接另一台机器并做着某些工作, 但并不想因为一个单独的连接而毁掉你的所有进程时,这个方法尤其有用.假如你在一个 **screen** 会话中做着某些工作,并且你的连接突然中断了(或者你的笔记本没电了,又或者你的电脑报废了),你只需重新连接一个新的电脑或给电脑充电或重新买一台电脑,接着运行 **screen -r** 来重新连接到远程的电脑,并在刚才掉线的地方接着开始. - -现在,我们都一直在讨论 GNU 的 **screen**,但这个小节的标题提到的是 tmux. 实质上, **tmux** (terminal multiplexer) 就像是 **screen** 的一个进阶版本,带有许多有用的额外功能,所以现在我们开始关注 tmux. 某些发行版本默认包含了 **tmux**; 在其他的发行版本上,通常只需要一个 **apt-get, yum install** 或 **pacman -S** 命令便可以安装它. - -一旦你安装了它过后,键入 **tmux** 来启动它.接着你将注意到,在终端窗口的底部有一条绿色的信息栏,它非常像传统的窗口管理器中的任务栏: 上面显示着一个运行着的程序的列表,机器的主机名,当前时间和日期. 现在运行一个程序,又以 Nano 为例, 敲击 Ctrl+B 后接着按 C 键, 这将在 tmux 会话中创建一个新的窗口,你便可以在终端的底部的任务栏中看到如下的信息: - - 0:nano- 1:bash* - -每一个窗口都有一个数字,当前呈现的程序被一个星号所标记. Ctrl+B 是与 tmux 交互的标准方式, 所以若你敲击这个按键组合并带上一个窗口序号, 那么就会切换到对应的那个窗口.你也可以使用 Ctrl+B 再加上 N 或 P 来分别切换到下一个或上一个窗口 – 或者使用 Ctrl+B 加上 L 来在最近使用的两个窗口之间来进行切换(有点类似于桌面中的经典的 Alt+Tab 组合键的效果). 若需要知道窗口列表,使用 Ctrl+B 再加上 W. - -目前为止,一切都还好:现在你可以在一个单独的终端窗口中运行多个程序,避免混乱(尤其是当你经常与同一个远程主机保持多个 SSH 连接时.). 当想同时看两个程序又该怎么办呢? - -针对这种情况, 可以使用 tmux 中的窗格. 敲击 Ctrl+B 再加上 % , 则当前窗口将分为两个部分,一个在左一个在右.你可以使用 Ctrl+B 再加上 O 来在这两个部分之间切换. 这尤其在你想同时看两个东西时非常实用, – 例如一个窗格看指导手册,另一个窗格里用编辑器看一个配置文件. - -有时,你想对一个单独的窗格进行缩放,而这需要一定的技巧. 首先你需要敲击 Ctrl+B 再加上一个 :(分号),这将使得位于底部的 tmux 栏变为深橙色. 现在,你进入了命令模式,在这里你可以输入命令来操作 tmux. 输入 **resize-pane -R** 来使当前窗格向右移动一个字符的间距, 或使用 **-L** 来向左移动. 对于一个简单的操作,这些命令似乎有些长,但请注意,在 tmux 的命令模式(以前面提到的一个分号开始的模式)下,可以使用 Tab 键来补全命令. 另外需要提及的是, **tmux** 同样也有一个命令历史记录,所以若你想重复刚才的缩放操作,可以先敲击 Ctrl+B 再跟上一个分号并使用向上的箭头来取回刚才输入的命令. - -最后,让我们看一下分离和重新连接 - 即我们刚才介绍的 screen 的特色功能. 在 tmux 中,敲击 Ctrl+B 再加上 D 来从当前的终端窗口中分离当前的 tmux 会话, 这使得这个会话的一切工作都在后台中运行.使用 **tmux a** 可以再重新连接到刚才的会话. 但若你同时有多个 tmux 会话在运行时,又该怎么办呢? 我们可以使用下面的命令来列出它们: - - tmux ls - -这个命令将为每个会话分配一个序号; 假如你想重新连接到会话 1, 可以使用 `tmux a -t 1`. tmux 是可以高度定制的,你可以自定义按键绑定并更改配色方案, 所以一旦你适应了它的主要功能,请钻研指导手册以了解更多的内容. - -tmux: 一个针对 shell 的窗口管理器 - -![tmux](http://www.linuxvoice.com/wp-content/uploads/2015/02/tmux-large13.jpg) - -上图中, tmux 开启了两个窗格: 左边是 Vim 正在编辑一个配置文件,而右边则展示着指导手册页. - -> ### Zsh: 另一个 shell ### -> -> 选择是好的,但标准同样重要. 你要知道几乎每个主流的 Linux 发行版本都默认使用 Bash shell – 尽管还存在其他的 shell. Bash 为你提供了一个 shell 能够给你提供的几乎任何功能,包括命令历史记录,文件名补全和许多脚本编程的能力.它成熟,可靠并文档丰富 – 但它不是你唯一的选择. -> -> 许多高级用户热衷于 Zsh, 即 Z shell. 这是 Bash 的一个替代品并提供了 Bash 的几乎所有功能,令外还提供了一些额外的功能. 例如, 在 Zsh 中,你输入 **ls** - 并敲击 Tab 键可以得到 **ls** 可用的各种不同选项的一个大致描述. 而不需要再打开 man page 了! -> -> Zsh 还支持其他强大的自动补全功能: 例如,输入 **cd /u/lo/bi** 再敲击 Tab 键, 则完整的路径名 **/usr/local/bin** 就会出现(这里假设没有其他的路径包含 **u**, **lo** 和 **bi** 等字符.). 或者只输入 **cd** 再跟上 Tab 键,则你将看到着色后的路径名的列表 – 这比 Bash 给出的简单的结果好看得多. -> -> Zsh 在大多数的主要发行版本上都可以得到; 安装它后并输入 **zsh** 便可启动它. 要将你的默认 shell 从 Bash 改为 Zsh, 可以使用 **chsh** 命令. 若需了解更多的信息,请访问 [www.zsh.org][2]. - -### "未来" 的终端 ### - -你或许会好奇为什么包含你的命令行提示符的应用被叫做终端. 这需要追溯到 Unix 的早期, 那时人们一般工作在一个多用户的机器上,这个巨大的电脑主机将占据一座建筑中的一个房间, 人们在某些线路的配合下,使用屏幕和键盘来连接到这个主机, 这些终端机通常被称为 "哑终端", 因为它们不能靠自己做任何重要的执行任务 – 它们只展示通过线路从主机传来的信息,并输送回从键盘的敲击中得到的输入信息. - -今天,几乎所有的我们在自己的机器上执行实际的操作,所以我们的电脑不是传统意义下的终端, 这就是为什么诸如 **XTerm**, Gnome Terminal, Konsole 等程序被称为 "终端模拟器" 的原因 – 他们提供了同昔日的物理终端一样的功能.事实上,在许多方面它们并没有改变多少.诚然,现在我们有了反锯齿字体,更好的颜色和点击网址的能力,但总的来说,几十年来我们一直以同样的方式在工作. - -所以某些程序员正尝试改变这个状况. **Terminology** ([http://tinyurl.com/osopjv9][3]), 它来自于超级时髦的 Enlightenment 窗口管理器背后的团队,旨在将终端引入 21 世纪,例如带有在线媒体显示功能.你可以在一个充满图片的目录里输入 **ls** 命令,便可以看到它们的缩略图,或甚至可以直接在你的终端里播放视频. 这使得一个终端有点类似于一个文件管理器,意味着你可以快速地检查媒体文件的内容而不必用另一个应用来打开它们. - -接着还有 Xiki ([www.xiki.org][4]),它自身的描述为 "命令的革新".它就像是一个传统的 shell, 一个 GUI 和一个 wiki 之间的过渡; 你可以在任何地方输入命令,并在后面将它们的输出存储为笔记以作为参考,并可以创建非常强大的自定义命令.用几句话是很能描述它的,所以作者们已经创作了一个视频来展示它的潜力是多么的巨大(请看 **Xiki** 网站的截屏视频部分). - -并且 Xiki 绝不是那种在几个月之内就消亡的昙花一现的项目,作者们成功地进行了一次 Kickstarter 众筹,在七月底已募集到超过 $84,000. 是的,你没有看错 – $84K 来支持一个终端模拟器.这可能是最不寻常的集资活动,因为某些疯狂的家伙已经决定开始创办它们自己的 Linux 杂志 ...... - -### 下一代终端 ### - -许多命令行和基于文本的程序在功能上与它们的 GUI 程序是相同的,并且常常更加快速和高效. 我们的推荐有: -**Irssi** (IRC 客户端); **Mutt** (mail 客户端); **rTorrent** (BitTorrent); **Ranger** (文件管理器); **htop** (进程监视器). 若给定在终端的限制下来进行 Web 浏览, Elinks 确实做的很好,并且对于阅读那些以文字为主的网站例如 Wikipedia 来说,它非常实用. - -> ### 微调配色方案 ### -> -> 在 Linux Voice 中,我们并不迷恋养眼的东西,但当你每天花费几个小时盯着屏幕看东西时,我们确实认识到美学的重要性.我们中的许多人都喜欢调整我们的桌面和窗口管理器来达到完美的效果,调整阴影效果,摆弄不同的配色方案,直到我们 100% 的满意.(然后出于习惯,摆弄更多的东西.) -> -> 但我们倾向于忽视终端窗口,它理应也获得我们的喜爱, 并且在 [http://ciembor.github.io/4bit][5] 你将看到一个极其棒的配色方案设计器,对于所有受欢迎的终端模拟器(**XTerm, Gnome Terminal, Konsole and Xfce4 Terminal are among the apps supported.**),它可以色设定.移动滑动条直到你看到配色方案 norvana, 然后点击位于该页面右上角的 `得到方案` 按钮. -> -> 相似的,假如你在一个文本编辑器,如 Vim 或 Emacs 上花费很多的时间,使用一个精心设计的调色板也是非常值得的. **Solarized at** [http://ethanschoonover.com/solarized][6] 是一个卓越的方案,它不仅漂亮,而且因追求最大的可用性而设计,在其背后有着大量的研究和测试. --------------------------------------------------------------------------------- - -via: http://www.linuxvoice.com/linux-101-power-up-your-shell-8/ - -作者:[Ben Everard][a] -译者:[FSSlc](https://github.com/FSSlc) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.linuxvoice.com/author/ben_everard/ -[1]:http://tinyurl.com/3gvz4ec -[2]:http://www.zsh.org/ -[3]:http://tinyurl.com/osopjv9 -[4]:http://www.xiki.org/ -[5]:http://ciembor.github.io/4bit -[6]:http://ethanschoonover.com/solarized \ No newline at end of file From b0df98351b4c4b573e0045e942b202005f148035 Mon Sep 17 00:00:00 2001 From: joeren Date: Wed, 29 Jul 2015 08:46:27 +0800 Subject: [PATCH 726/965] Update 20150728 How To Fix--There is no command installed for 7-zip archive files.md --- ...x--There is no command installed for 7-zip archive files.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150728 How To Fix--There is no command installed for 7-zip archive files.md b/sources/tech/20150728 How To Fix--There is no command installed for 7-zip archive files.md index 8c9b781117..dd3f7211ce 100644 --- a/sources/tech/20150728 How To Fix--There is no command installed for 7-zip archive files.md +++ b/sources/tech/20150728 How To Fix--There is no command installed for 7-zip archive files.md @@ -1,3 +1,4 @@ +Translating by GOLinux! How To Fix: There is no command installed for 7-zip archive files ================================================================================ ### Problem ### @@ -46,4 +47,4 @@ via: http://itsfoss.com/fix-there-is-no-command-installed-for-7-zip-archive-file [a]:http://itsfoss.com/author/abhishek/ [1]:http://www.7-zip.org/ -[2]:http://itsfoss.com/fix-there-is-no-command-installed-for-rar-archive-files/ \ No newline at end of file +[2]:http://itsfoss.com/fix-there-is-no-command-installed-for-rar-archive-files/ From db5aa16eb7ba418bba279f4d795cf80d0fdb303a Mon Sep 17 00:00:00 2001 From: GOLinux Date: Wed, 29 Jul 2015 09:21:53 +0800 Subject: [PATCH 727/965] [Translated]20150728 How To Fix--There is no command installed for 7-zip archive files.md --- ...mmand installed for 7-zip archive files.md | 50 ------------------ ...mmand installed for 7-zip archive files.md | 51 +++++++++++++++++++ 2 files changed, 51 insertions(+), 50 deletions(-) delete mode 100644 sources/tech/20150728 How To Fix--There is no command installed for 7-zip archive files.md create mode 100644 translated/tech/20150728 How To Fix--There is no command installed for 7-zip archive files.md diff --git a/sources/tech/20150728 How To Fix--There is no command installed for 7-zip archive files.md b/sources/tech/20150728 How To Fix--There is no command installed for 7-zip archive files.md deleted file mode 100644 index dd3f7211ce..0000000000 --- a/sources/tech/20150728 How To Fix--There is no command installed for 7-zip archive files.md +++ /dev/null @@ -1,50 +0,0 @@ -Translating by GOLinux! -How To Fix: There is no command installed for 7-zip archive files -================================================================================ -### Problem ### - -I was trying to install Emerald icon theme in Ubuntu and the theme came in .7z archive. As always, I tried to extract it, in GUI, using the right click and “extract here”. Instead of extracting the file, Ubuntu 15.04 threw an error which read: - -> Could not open this file -> -> There is no command installed for 7-zip archive files. Do you want to search for a command to open this file? - -The error looked like this: - -![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/Install_7zip_ubuntu_1.png) - -### Reason ### - -Reason is quite evident from the error message itself. The 7Z, better to call it [7-zip][1], program is not installed and hence 7Z compressed files are not being extracted. This also hints that Ubuntu doesn’t support 7-Zip files by default. - -### Solution: Install 7zip in Ubuntu ### - -Solution is quite simple as well. Install the 7-Zip package in Ubuntu. Now you might wonder how to install 7Zip in Ubuntu? Well, in the previous error dialogue box if you click on “Search Command”, it will look for available p7zip package. Just click on “Install” here: - -![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/Install_7zip_ubuntu.png) - -### Alternative: Install 7zip in terminal ### - -If you prefer terminal, you can install 7zip in terminal using the following command: - - sudo apt-get install p7zip-full - -Note: You’ll find three 7zip packages in Ubuntu: p7zip, p7zip-full and p7zip-rar. The difference between p7zip and p7zip-full is that p7zip is a lighter version providing support only for .7z and .7za files while the full version provides support for more 7z compression algorithms (for audio files etc). For p7zip-rar, it provides support for .rar files along with 7z. - -In fact similar error can be encountered with [RAR files in Ubuntu][2]. Solution is the same, install the correct program. - -I hope this quick post helped you to solve the mystery of **how to open 7zip in Ubuntu 14.04**. Any questions or suggestions are always welcomed. - --------------------------------------------------------------------------------- - -via: http://itsfoss.com/fix-there-is-no-command-installed-for-7-zip-archive-files/ - -作者:[Abhishek][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://itsfoss.com/author/abhishek/ -[1]:http://www.7-zip.org/ -[2]:http://itsfoss.com/fix-there-is-no-command-installed-for-rar-archive-files/ diff --git a/translated/tech/20150728 How To Fix--There is no command installed for 7-zip archive files.md b/translated/tech/20150728 How To Fix--There is no command installed for 7-zip archive files.md new file mode 100644 index 0000000000..61237467ca --- /dev/null +++ b/translated/tech/20150728 How To Fix--There is no command installed for 7-zip archive files.md @@ -0,0 +1,51 @@ +如何修复:There is no command installed for 7-zip archive files +================================================================================ +### 问题 ### + +我试着在Ubuntu中安装Emerald图标主题,而这个主题被打包成了.7z归档包。和以往一样,我试着通过在GUI中右击并选择“提取到这里”来将它解压缩。但是Ubuntu 15.04却并没有解压文件,取而代之的,却是丢给了我一个下面这样的错误信息: + +> Could not open this file +> 无法打开该文件 +> +> There is no command installed for 7-zip archive files. Do you want to search for a command to open this file? +> 没有安装用于7-zip归档文件的命令。你是否想要搜索命令来打开该文件? + +错误信息看上去是这样的: + +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/Install_7zip_ubuntu_1.png) + +### 原因 ### + +发生该错误的原因从错误信息本身来看就十分明了。7Z,称之为[7-zip][1]更好,该程序没有安装,因此7Z压缩文件就无法解压缩。这也暗示着Ubuntu默认不支持7-zip文件。 + +### 解决方案:在Ubuntu中安装 7zip ### + +要解决该问题也十分简单,在Ubuntu中安装7-Zip包即可。现在,你也许想知道如何在Ubuntu中安装 7Zip吧?好吧,在前面的错误对话框中,如果你右击“Search Command”搜索命令,它会查找可用的 p7zip 包。只要点击“Install”安装,如下图: + +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/Install_7zip_ubuntu.png) + +### 可选方案:在终端中安装 7Zip ### + +如果偏好使用终端,你可以使用以下命令在终端中安装 7zip: + + sudo apt-get install p7zip-full + +注意:在Ubuntu中,你会发现有3个7zip包:p7zip,p7zip-full 和 p7zip-rar。p7zip和p7zip-full的区别在于,p7zip是一个更轻量化的版本,仅仅提供了对 .7z 和 .7za 文件的支持,而完整版则提供了对更多(用于音频文件等的) 7z 压缩算法的支持。对于 p7zip-rar,它除了对 7z 文件的支持外,也提供了对 .rar 文件的支持。 + +事实上,相同的错误也会发生在[Ubuntu中的RAR文件][2]身上。解决方案也一样,安装正确的程序即可。 + +希望这篇快文帮助你解决了**Ubuntu 14.04中如何打开 7zip**的谜团。如有任何问题或建议,我们将无任欢迎。 + +-------------------------------------------------------------------------------- + +via: http://itsfoss.com/fix-there-is-no-command-installed-for-7-zip-archive-files/ + +作者:[Abhishek][a] +译者:[GOLinux](https://github.com/GOLinux) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://itsfoss.com/author/abhishek/ +[1]:http://www.7-zip.org/ +[2]:http://itsfoss.com/fix-there-is-no-command-installed-for-rar-archive-files/ From e60fc38a7eceff5263a59b72534684bc910f2ffd Mon Sep 17 00:00:00 2001 From: joeren Date: Wed, 29 Jul 2015 09:24:22 +0800 Subject: [PATCH 728/965] Update 20150727 Easy Backup Restore and Migrate Containers in Docker.md --- ...727 Easy Backup Restore and Migrate Containers in Docker.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150727 Easy Backup Restore and Migrate Containers in Docker.md b/sources/tech/20150727 Easy Backup Restore and Migrate Containers in Docker.md index fc21489ec9..7607fe58f7 100644 --- a/sources/tech/20150727 Easy Backup Restore and Migrate Containers in Docker.md +++ b/sources/tech/20150727 Easy Backup Restore and Migrate Containers in Docker.md @@ -1,3 +1,4 @@ +Translating by GOLinux! Easy Backup, Restore and Migrate Containers in Docker ================================================================================ Today we'll learn how we can easily backup, restore and migrate docker containers out of the box. [Docker][1] is an open source platform that automates the deployment of applications with fast and easy way to pack, ship and run it under a lightweight layer of software called container. It makes the applications platform independent as it acts an additional layer of abstraction and automation of operating system level virtualization on Linux. It utilizes resource isolation features of Linux Kernel with its components cgroups and namespace for avoiding the overhead of virtual machines. It makes the great building blocks for deploying and scaling web apps, databases, and back-end services without depending on a particular stack or provider. Containers are those software layers which are created from a docker image that contains the respective linux filesystem and applications out of the box. If we have a docker container running in our box and need to backup those containers for future use or wanna migrate those containers, then this tutorial will help you how we can backup, restore and migrate docker containers in linux operating system. @@ -87,4 +88,4 @@ via: http://linoxide.com/linux-how-to/backup-restore-migrate-containers-docker/ [a]:http://linoxide.com/author/arunp/ [1]:http://docker.com/ -[2]:https://registry.hub.docker.com/ \ No newline at end of file +[2]:https://registry.hub.docker.com/ From e695b053546e6c6f30930a7e91500a7671dcbb09 Mon Sep 17 00:00:00 2001 From: GOLinux Date: Wed, 29 Jul 2015 11:16:25 +0800 Subject: [PATCH 729/965] [Translated]20150727 Easy Backup Restore and Migrate Containers in Docker.md --- ...estore and Migrate Containers in Docker.md | 91 ------------------ ...estore and Migrate Containers in Docker.md | 92 +++++++++++++++++++ 2 files changed, 92 insertions(+), 91 deletions(-) delete mode 100644 sources/tech/20150727 Easy Backup Restore and Migrate Containers in Docker.md create mode 100644 translated/tech/20150727 Easy Backup Restore and Migrate Containers in Docker.md diff --git a/sources/tech/20150727 Easy Backup Restore and Migrate Containers in Docker.md b/sources/tech/20150727 Easy Backup Restore and Migrate Containers in Docker.md deleted file mode 100644 index 7607fe58f7..0000000000 --- a/sources/tech/20150727 Easy Backup Restore and Migrate Containers in Docker.md +++ /dev/null @@ -1,91 +0,0 @@ -Translating by GOLinux! -Easy Backup, Restore and Migrate Containers in Docker -================================================================================ -Today we'll learn how we can easily backup, restore and migrate docker containers out of the box. [Docker][1] is an open source platform that automates the deployment of applications with fast and easy way to pack, ship and run it under a lightweight layer of software called container. It makes the applications platform independent as it acts an additional layer of abstraction and automation of operating system level virtualization on Linux. It utilizes resource isolation features of Linux Kernel with its components cgroups and namespace for avoiding the overhead of virtual machines. It makes the great building blocks for deploying and scaling web apps, databases, and back-end services without depending on a particular stack or provider. Containers are those software layers which are created from a docker image that contains the respective linux filesystem and applications out of the box. If we have a docker container running in our box and need to backup those containers for future use or wanna migrate those containers, then this tutorial will help you how we can backup, restore and migrate docker containers in linux operating system. - -Here are some easy steps on how we can backup, restore and migrate the docker containers in linux. - -### 1. Backing up the Containers ### - -First of all, in order to backup the containers in docker, we'll wanna see the list of containers that we wanna backup. To do so, we'll need to run docker ps in our linux machine running docker engine with containers already created. - - # docker ps - -![Docker Containers List](http://blog.linoxide.com/wp-content/uploads/2015/07/docker-containers-list.png) - -After that, we'll choose the containers we wanna backup and then we'll go for creating the snapshot of the container. We can use docker commit command in order to create the snapshot. - - # docker commit -p 30b8f18f20b4 container-backup - -![Docker Commit](http://blog.linoxide.com/wp-content/uploads/2015/07/docker-commit.png) - -This will generated a snapshot of the container as the docker image. We can see the docker image by running the command docker images as shown below. - - # docker images - -![Docker Images](http://blog.linoxide.com/wp-content/uploads/2015/07/docker-images.png) - -As we can see the snapshot that was taken above has been preserved as docker image. Now, inorder to backup that snapshot, we have two options, one is that we can login into the docker registry hub and push the image and the next is that we can backup the docker image as tarballs for further use. - -If we wanna upload or backup the image in the [docker registry hub][2], we can simply run docker login command to login into the docker registry hub and then push the required image. - - # docker login - -![Docker Login](http://blog.linoxide.com/wp-content/uploads/2015/07/docker-login.png) - - # docker tag a25ddfec4d2a arunpyasi/container-backup:test - # docker push arunpyasi/container-backup - -![Docker Push](http://blog.linoxide.com/wp-content/uploads/2015/07/docker-push.png) - -If we don't wanna backup to the docker registry hub and wanna save the image for future use in the machine locally then we can backup the image as tarballs. To do so, we'll need to run the following docker save command. - - # docker save -o ~/container-backup.tar container-backup - -![taking tarball backup](http://blog.linoxide.com/wp-content/uploads/2015/07/taking-tarball-backup.png) - -To verify if the tarball has been generated or not, we can simply run docker ls inside the directory where we saved the tarball. - -### 2. Restoring the Containers ### - -Next, after we have successfully backed up our docker containers, we'll now go for restoring those contianers which are snapshotted as docker images. If we have pushed those docker images in the registry hub, then we can simply pull that docker image and run it out of the box. - - # docker pull arunpyasi/container-backup:test - -![Docker Pull](http://blog.linoxide.com/wp-content/uploads/2015/07/docker-pull.png) - -But if we have backed up those docker images locally as tarball file, then we can easy load that docker image using docker load command followed by the backed up tarball. - - # docker load -i ~/container-backup.tar - -Now, to ensure that those docker images have been loaded successfully, we'll run docker images command. - - # docker images - -After the images have been loaded, we'll gonna run the docker container from the loaded image. - - # docker run -d -p 80:80 container-backup - -![Restoring Docker Tarball](http://blog.linoxide.com/wp-content/uploads/2015/07/restoring-docker-tarballs.png) - -### 3. Migrating the Docker Containers ### - -Migrating the containers involve both the above process ie Backup and Restore. We can migrate any docker container from one machine to another. In the process of migration, first we take the backup of the container as snapshot docker image. Then, that docker image is either pushed to the docker registry hub or saved as tarball files in the locally. If we have pushed the image to the docker registry hub, we can easily restore and run the container using docker run command from any machine we want. But if we have saved the image as tarballs locally, we can simply copy or move the image to the machine where we want to load image and run the required container. - -### Conclusion ### - -Finally, we have learned how we can backup, restore and migrate the docker containers out of the box. This tutorial is exactly same for every platform of operating system where docker runs successfully. Really, docker is pretty simple and easy to use but very powerful tool. It has pretty easy to remember commands which are short enough with many simple but powerful flags and parameters. The above methods makes us comfortable to backup our containers so that we can restore them when needed in future. This can help us recover our containers and images even if our host system crashes or gets wiped out accidentally. If you have any questions, suggestions, feedback please write them in the comment box below so that we can improve or update our contents. Thank you ! Enjoy :-) - --------------------------------------------------------------------------------- - -via: http://linoxide.com/linux-how-to/backup-restore-migrate-containers-docker/ - -作者:[Arun Pyasi][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://linoxide.com/author/arunp/ -[1]:http://docker.com/ -[2]:https://registry.hub.docker.com/ diff --git a/translated/tech/20150727 Easy Backup Restore and Migrate Containers in Docker.md b/translated/tech/20150727 Easy Backup Restore and Migrate Containers in Docker.md new file mode 100644 index 0000000000..420430cca8 --- /dev/null +++ b/translated/tech/20150727 Easy Backup Restore and Migrate Containers in Docker.md @@ -0,0 +1,92 @@ +无忧之道:Docker中容器的备份、恢复和迁移 +================================================================================ +今天,我们将学习如何快速地对docker容器进行快捷备份、恢复和迁移。[Docker][1]是一个开源平台,用于自动化部署应用,以通过快捷的途径在称之为容器的轻量级软件层下打包、发布和运行这些应用。它使得应用平台独立,因为它扮演了Linux上一个额外的操作系统级虚拟化的自动化抽象层。它通过其组件cgroups和命名空间利用Linux内核的资源分离特性,达到避免虚拟机开销的目的。它使得用于部署和扩展web应用、数据库和后端服务的大规模构建块无需依赖于特定的堆栈或供应者。 + +所谓的容器,就是那些创建自Docker镜像的软件层,它包含了独立的Linux文件系统和开箱即用的应用程序。如果我们有一个在盒子中运行着的Docker容器,并且想要备份这些容器以便今后使用,或者想要迁移这些容器,那么,本教程将帮助你掌握在Linux操作系统中备份、恢复和迁移Docker容器。 + +我们怎样才能在Linux中备份、恢复和迁移Docker容器呢?这里为您提供了一些便捷的步骤。 + +### 1. 备份容器 ### + +首先,为了备份Docker中的容器,我们会想看看我们想要备份的容器列表。要达成该目的,我们需要在我们运行这Docker引擎,并已创建了容器的Linux机器中运行 docker ps 命令。 + + # docker ps + +![Docker Containers List](http://blog.linoxide.com/wp-content/uploads/2015/07/docker-containers-list.png) + +在此之后,我们要选择我们想要备份的容器,然后我们会去创建该容器的快照。我们可以使用 docker commit 命令来创建快照。 + + # docker commit -p 30b8f18f20b4 container-backup + +![Docker Commit](http://blog.linoxide.com/wp-content/uploads/2015/07/docker-commit.png) + +该命令会生成一个作为Docker镜像的容器快照,我们可以通过运行 docker images 命令来查看Docker镜像,如下。 + + # docker images + +![Docker Images](http://blog.linoxide.com/wp-content/uploads/2015/07/docker-images.png) + +正如我们所看见的,上面做的快照已经作为Docker镜像保存了。现在,为了备份该快照,我们有两个选择,一个是我们可以登陆进Docker注册中心,并推送该镜像;另一个是我们可以将Docker镜像打包成tarball备份,以供今后使用。 + +如果我们想要在[Docker注册中心][2]上传或备份镜像,我们只需要运行 docker login 命令来登录进Docker注册中心,然后推送所需的镜像即可。 + + # docker login + +![Docker Login](http://blog.linoxide.com/wp-content/uploads/2015/07/docker-login.png) + + # docker tag a25ddfec4d2a arunpyasi/container-backup:test + # docker push arunpyasi/container-backup + +![Docker Push](http://blog.linoxide.com/wp-content/uploads/2015/07/docker-push.png) + +如果我们不想备份到docker注册中心,而是想要将此镜像保存在本地机器中,以供日后使用,那么我们可以将其作为tarball备份。要完成该操作,我们需要运行以下 docker save 命令。 + + # docker save -o ~/container-backup.tar container-backup + +![taking tarball backup](http://blog.linoxide.com/wp-content/uploads/2015/07/taking-tarball-backup.png) + +要验证tarball时候已经生成,我们只需要在保存tarball的目录中运行 ls 命令。 + +### 2. 恢复容器 ### + +接下来,在我们成功备份了我们的Docker容器后,我们现在来恢复这些被快照成Docker镜像的容器。如果我们已经在注册中心推送了这些Docker镜像,那么我们仅仅需要把那个Docker镜像拖回并直接运行即可。 + + # docker pull arunpyasi/container-backup:test + +![Docker Pull](http://blog.linoxide.com/wp-content/uploads/2015/07/docker-pull.png) + +但是,如果我们将这些Docker镜像作为tarball文件备份到了本地,那么我们只要使用 docker load 命令,后面加上tarball的备份路径,就可以加载该Docker镜像了。 + + # docker load -i ~/container-backup.tar + +现在,为了确保这些Docker镜像已经加载成功,我们来运行 docker images 命令。 + + # docker images + +在镜像被加载后,我们将从加载的镜像去运行Docker容器。 + + # docker run -d -p 80:80 container-backup + +![Restoring Docker Tarball](http://blog.linoxide.com/wp-content/uploads/2015/07/restoring-docker-tarballs.png) + +### 3. 迁移Docker容器 ### + +迁移容器同时涉及到了上面两个操作,备份和恢复。我们可以将任何一个Docker容器从一台机器迁移到另一台机器。在迁移过程中,首先我们将容器的备份作为快照Docker镜像。然后,该Docker镜像或者是被推送到了Docker注册中心,或者被作为tarball文件保存到了本地。如果我们将镜像推送到了Docker注册中心,我们简单地从任何我们想要的机器上使用 docker run 命令来恢复并运行该容器。但是,如果我们将镜像打包成tarball备份到了本地,我们只需要拷贝或移动该镜像到我们想要的机器上,加载该镜像并运行需要的容器即可。 + +### 尾声 ### + +最后,我们已经学习了如何快速地备份、恢复和迁移Docker容器,本教程适用于各个成功运行Docker的操作系统平台。真的,Docker是一个相当简单易用,然而功能却十分强大的工具。它的命令相当易记,这些命令都非常短,带有许多简单而强大的标记和参数。上面的方法让我们备份容器时很是安逸,使得我们可以在日后很轻松地恢复它们。这会帮助我们恢复我们的容器和镜像,即便主机系统崩溃,甚至意外地被清除。如果你还有很多问题、建议、反馈,请在下面的评论框中写出来吧,可以帮助我们改进或更新我们的内容。谢谢大家!享受吧 :-) + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/linux-how-to/backup-restore-migrate-containers-docker/ + +作者:[Arun Pyasi][a] +译者:[GOLinux](https://github.com/GOLinux) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://linoxide.com/author/arunp/ +[1]:http://docker.com/ +[2]:https://registry.hub.docker.com/ From c135e226aad8457e323f83d79c2264dc3dff4da9 Mon Sep 17 00:00:00 2001 From: wxy Date: Wed, 29 Jul 2015 14:32:23 +0800 Subject: [PATCH 730/965] PUB:20150612 How to Configure Swarm Native Clustering for Docker @GOLinux --- ...gure Swarm Native Clustering for Docker.md | 25 +++++++++++-------- 1 file changed, 14 insertions(+), 11 deletions(-) rename {translated/tech => published}/20150612 How to Configure Swarm Native Clustering for Docker.md (65%) diff --git a/translated/tech/20150612 How to Configure Swarm Native Clustering for Docker.md b/published/20150612 How to Configure Swarm Native Clustering for Docker.md similarity index 65% rename from translated/tech/20150612 How to Configure Swarm Native Clustering for Docker.md rename to published/20150612 How to Configure Swarm Native Clustering for Docker.md index 82849b4661..66ff94367e 100644 --- a/translated/tech/20150612 How to Configure Swarm Native Clustering for Docker.md +++ b/published/20150612 How to Configure Swarm Native Clustering for Docker.md @@ -1,34 +1,37 @@ -为Docker配置Swarm本地集群 +如何配置一个 Docker Swarm 原生集群 ================================================================================ -嗨,大家好。今天我们来学一学Swarm相关的内容吧,我们将学习通过Swarm来创建Docker本地集群。[Docker Swarm][1]是用于Docker的本地集群项目,它可以将Docker主机池转换成单个的虚拟主机。Swarm提供了标准的Docker API,所以任何可以和Docker守护进程通信的工具都可以使用Swarm来透明地规模化多个主机。Swarm遵循“包含电池并可拆卸”的原则,就像其它Docker项目一样。它附带有一个开箱即用的简单的后端调度程序,而且作为初始开发套件,也为其开发了一个可启用即插即用后端的API。其目标在于为一些简单的使用情况提供一个平滑的、开箱即用的体验,并且它允许在更强大的后端,如Mesos,中开启交换,以达到大量生产部署的目的。Swarm配置和使用极其简单。 + +嗨,大家好。今天我们来学一学Swarm相关的内容吧,我们将学习通过Swarm来创建Docker原生集群。[Docker Swarm][1]是用于Docker的原生集群项目,它可以将一个Docker主机池转换成单个的虚拟主机。Swarm工作于标准的Docker API,所以任何可以和Docker守护进程通信的工具都可以使用Swarm来透明地伸缩到多个主机上。就像其它Docker项目一样,Swarm遵循“内置电池,并可拆卸”的原则(LCTT 译注:batteries included,内置电池原来是 Python 圈里面对 Python 的一种赞誉,指自给自足,无需外求的丰富环境;but removable,并可拆卸应该指的是非强制耦合)。它附带有一个开箱即用的简单的后端调度程序,而且作为初始开发套件,也为其开发了一个可插拔不同后端的API。其目标在于为一些简单的使用情况提供一个平滑的、开箱即用的体验,并且它允许切换为更强大的后端,如Mesos,以用于大规模生产环境部署。Swarm配置和使用极其简单。 这里给大家提供Swarm 0.2开箱的即用一些特性。 1. Swarm 0.2.0大约85%与Docker引擎兼容。 2. 它支持资源管理。 -3. 它具有一些带有限制器和类同器高级调度特性。 +3. 它具有一些带有限制和类同功能的高级调度特性。 4. 它支持多个发现后端(hubs,consul,etcd,zookeeper) 5. 它使用TLS加密方法进行安全通信和验证。 -那么,我们来看一看Swarm的一些相当简单而简易的使用步骤吧。 +那么,我们来看一看Swarm的一些相当简单而简用的使用步骤吧。 ### 1. 运行Swarm的先决条件 ### -我们必须在所有节点安装Docker 1.4.0或更高版本。虽然哥哥节点的IP地址不需要要公共地址,但是Swarm管理器必须可以通过网络访问各个节点。 +我们必须在所有节点安装Docker 1.4.0或更高版本。虽然各个节点的IP地址不需要要公共地址,但是Swarm管理器必须可以通过网络访问各个节点。 -注意:Swarm当前还处于beta版本,因此功能特性等还有可能发生改变,我们不推荐你在生产环境中使用。 +**注意**:Swarm当前还处于beta版本,因此功能特性等还有可能发生改变,我们不推荐你在生产环境中使用。 ### 2. 创建Swarm集群 ### 现在,我们将通过运行下面的命令来创建Swarm集群。各个节点都将运行一个swarm节点代理,该代理会注册、监控相关的Docker守护进程,并更新发现后端获取的节点状态。下面的命令会返回一个唯一的集群ID标记,在启动节点上的Swarm代理时会用到它。 +在集群管理器中: + # docker run swarm create ![Creating Swarm Cluster](http://blog.linoxide.com/wp-content/uploads/2015/05/creating-swarm-cluster.png) ### 3. 启动各个节点上的Docker守护进程 ### -我们需要使用-H标记登陆进我们将用来创建几圈和启动Docker守护进程的各个节点,它会保证Swarm管理器能够通过TCP访问到各个节点上的Docker远程API。要启动Docker守护进程,我们需要在各个节点内部运行以下命令。 +我们需要登录进我们将用来创建集群的每个节点,并在其上使用-H标记启动Docker守护进程。它会保证Swarm管理器能够通过TCP访问到各个节点上的Docker远程API。要启动Docker守护进程,我们需要在各个节点内部运行以下命令。 # docker -H tcp://0.0.0.0:2375 -d @@ -42,7 +45,7 @@ ![Adding Nodes to Cluster](http://blog.linoxide.com/wp-content/uploads/2015/05/adding-nodes-to-cluster.png) -** 注意**:我们需要用步骤2中获取到的节点IP地址和集群ID替换这里的。 +**注意**:我们需要用步骤2中获取到的节点IP地址和集群ID替换这里的。 ### 5. 开启Swarm管理器 ### @@ -60,7 +63,7 @@ ![Accessing Swarm Clusters](http://blog.linoxide.com/wp-content/uploads/2015/05/accessing-swarm-cluster.png) -** 注意**:我们需要替换为运行swarm管理器的主机的IP地址和端口。 +**注意**:我们需要替换为运行swarm管理器的主机的IP地址和端口。 ### 7. 使用docker CLI来访问节点 ### @@ -79,7 +82,7 @@ ### 尾声 ### -Swarm真的是一个有着相当不错的功能的docker,它可以用于创建和管理集群。它相当易于配置和使用,当我们在它上面使用限制器和类同器师它更为出色。高级调度程序是一个相当不错的特性,它可以应用过滤器来通过端口、标签、健康状况来排除节点,并且它使用策略来挑选最佳节点。那么,如果你有任何问题、评论、反馈,请在下面的评论框中写出来吧,好让我们知道哪些材料需要补充或改进。谢谢大家了!尽情享受吧 :-) +Swarm真的是一个有着相当不错的功能的docker,它可以用于创建和管理集群。它相当易于配置和使用,当我们在它上面使用限制器和类同器时它更为出色。高级调度程序是一个相当不错的特性,它可以应用过滤器来通过端口、标签、健康状况来排除节点,并且它使用策略来挑选最佳节点。那么,如果你有任何问题、评论、反馈,请在下面的评论框中写出来吧,好让我们知道哪些材料需要补充或改进。谢谢大家了!尽情享受吧 :-) -------------------------------------------------------------------------------- @@ -87,7 +90,7 @@ via: http://linoxide.com/linux-how-to/configure-swarm-clustering-docker/ 作者:[Arun Pyasi][a] 译者:[GOLinux](https://github.com/GOLinux) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From e1cfb34b0b010db96d7f11f02504fd3187ed8b12 Mon Sep 17 00:00:00 2001 From: wxy Date: Wed, 29 Jul 2015 14:54:46 +0800 Subject: [PATCH 731/965] PUB:20150722 12 Useful PHP Commandline Usage Every Linux User Must Know @GOLinux --- ...ndline Usage Every Linux User Must Know.md | 70 +++++++++++-------- 1 file changed, 39 insertions(+), 31 deletions(-) rename {translated/tech => published}/20150722 12 Useful PHP Commandline Usage Every Linux User Must Know.md (71%) diff --git a/translated/tech/20150722 12 Useful PHP Commandline Usage Every Linux User Must Know.md b/published/20150722 12 Useful PHP Commandline Usage Every Linux User Must Know.md similarity index 71% rename from translated/tech/20150722 12 Useful PHP Commandline Usage Every Linux User Must Know.md rename to published/20150722 12 Useful PHP Commandline Usage Every Linux User Must Know.md index 8c00c6a75c..2b5a6e9cf9 100644 --- a/translated/tech/20150722 12 Useful PHP Commandline Usage Every Linux User Must Know.md +++ b/published/20150722 12 Useful PHP Commandline Usage Every Linux User Must Know.md @@ -1,14 +1,12 @@ -每个Linux人应知应会的12个有用的PHP命令行用法 +在 Linux 命令行中使用和执行 PHP 代码(二):12 个 PHP 交互性 shell 的用法 ================================================================================ -在我上一篇文章“[在Linux命令行中使用并执行PHP代码][1]”中,我同时着重讨论了直接在Linux命令行中运行PHP代码以及在Linux终端中执行PHP脚本文件。 +在上一篇文章“[在 Linux 命令行中使用和执行 PHP 代码(一)][1]”中,我同时着重讨论了直接在Linux命令行中运行PHP代码以及在Linux终端中执行PHP脚本文件。 ![Run PHP Codes in Linux Commandline](http://www.tecmint.com/wp-content/uploads/2015/07/Run-PHP-Codes-in-Linux-Commandline.jpeg) -在Linux命令行运行PHP代码——第二部分 +本文旨在让你了解一些相当不错的Linux终端中的PHP交互性 shell 的用法特性。 -本文旨在让你了解一些相当不错的Linux终端中的PHP用法特性。 - -让我们先在PHP交互shell中来对`php.ini`设置进行一些配置吧。 +让我们先在PHP 的交互shell中来对`php.ini`设置进行一些配置吧。 **6. 设置PHP命令行提示符** @@ -21,7 +19,8 @@ php > #cli.prompt=Hi Tecmint :: ![Enable PHP Interactive Shell](http://www.tecmint.com/wp-content/uploads/2015/07/Enable-PHP-Interactive-Shell.png) -启用PHP交互Shell + +*启用PHP交互Shell* 同时,你也可以设置当前时间作为你的命令行提示符,操作如下: @@ -31,20 +30,22 @@ **7. 每次输出一屏** -在我们上一篇文章中,我们已经在原始命令中通过管道在很多地方使用了‘less‘命令。通过该操作,我们可以在那些不能一次满屏输出的地方获得每次一屏的输出。但是,我们可以通过配置php.ini文件,设置pager的值为less以每次输出一屏,操作如下: +在我们上一篇文章中,我们已经在原始命令中通过管道在很多地方使用了`less`命令。通过该操作,我们可以在那些不能一屏全部输出的地方获得分屏显示。但是,我们可以通过配置php.ini文件,设置pager的值为less以每次输出一屏,操作如下: $ php -a php > #cli.pager=less ![Fix PHP Screen Output](http://www.tecmint.com/wp-content/uploads/2015/07/Fix-PHP-Screen-Output.png) -固定PHP屏幕输出 + +*限制PHP屏幕输出* 这样,下次当你运行一个命令(比如说条调试器`phpinfo();`)的时候,而该命令的输出内容又太过庞大而不能固定在一屏,它就会自动产生适合你当前屏幕的输出结果。 php > phpinfo(); ![PHP Info Output](http://www.tecmint.com/wp-content/uploads/2015/07/PHP-Info-Output.png) -PHP信息输出 + +*PHP信息输出* **8. 建议和TAB补全** @@ -58,50 +59,53 @@ PHP shell足够智能,它可以显示给你建议和进行TAB补全,你可 php > #cli.pager [TAB] -你可以一直按TAB键来获得选项,直到选项值满足要求。所有的行为都将记录到`~/.php-history`文件。 +你可以一直按TAB键来获得建议的补全,直到该值满足要求。所有的行为都将记录到`~/.php-history`文件。 要检查你的PHP交互shell活动日志,你可以执行: $ nano ~/.php_history | less ![Check PHP Interactive Shell Logs](http://www.tecmint.com/wp-content/uploads/2015/07/Check-PHP-Interactive-Shell-Logs.png) -检查PHP交互Shell日志 + +*检查PHP交互Shell日志* **9. 你可以在PHP交互shell中使用颜色,你所需要知道的仅仅是颜色代码。** -使用echo来打印各种颜色的输出结果,看我信手拈来: +使用echo来打印各种颜色的输出结果,类似这样: - php > echo “color_code1 TEXT second_color_code”; + php > echo "color_code1 TEXT second_color_code"; -一个更能说明问题的例子是: +具体来说是: php > echo "\033[0;31m Hi Tecmint \x1B[0m"; ![Enable Colors in PHP Shell](http://www.tecmint.com/wp-content/uploads/2015/07/Enable-Colors-in-PHP-Shell.png) -在PHP Shell中启用彩色 + +*在PHP Shell中启用彩色* 到目前为止,我们已经看到,按回车键意味着执行命令,然而PHP Shell中各个命令结尾的分号是必须的。 -**10. PHP shell中的用以打印后续组件的路径名称** +**10. 在PHP shell中用basename()输出路径中最后一部分** -PHP shell中的basename函数从给出的包含有到文件或目录路径的后续组件的路径名称。 +PHP shell中的basename函数可以从给出的包含有到文件或目录路径的最后部分。 basename()样例#1和#2。 php > echo basename("/var/www/html/wp/wp-content/plugins"); php > echo basename("www.tecmint.com/contact-us.html"); -上述两个样例都将输出: +上述两个样例将输出: plugins contact-us.html ![Print Base Name in PHP](http://www.tecmint.com/wp-content/uploads/2015/07/Print-Base-Name-in-PHP.png) -在PHP中打印基本名称 + +*在PHP中打印基本名称* **11. 你可以使用PHP交互shell在你的桌面创建文件(比如说test1.txt),就像下面这么简单** - $ touch("/home/avi/Desktop/test1.txt"); + php> touch("/home/avi/Desktop/test1.txt"); 我们已经见识了PHP交互shell在数学运算中有多优秀,这里还有更多一些例子会令你吃惊。 @@ -112,7 +116,8 @@ strlen函数用于获取指定字符串的长度。 php > echo strlen("tecmint.com"); ![Print Length String in PHP](http://www.tecmint.com/wp-content/uploads/2015/07/Print-Length-String-in-PHP.png) -在PHP中打印字符串长度 + +*在PHP中打印字符串长度* **13. PHP交互shell可以对数组排序,是的,你没听错** @@ -137,9 +142,10 @@ strlen函数用于获取指定字符串的长度。 ) ![Sort Arrays in PHP](http://www.tecmint.com/wp-content/uploads/2015/07/Sort-Arrays-in-PHP.png) -在PHP中对数组排序 -**14. 在PHP交互Shell中获取Pi的值** +*在PHP中对数组排序* + +**14. 在PHP交互Shell中获取π的值** php > echo pi(); @@ -151,14 +157,15 @@ strlen函数用于获取指定字符串的长度。 12.247448713916 -**16. 从0-10的范围内回显一个随机数** +**16. 从0-10的范围内挑选一个随机数** php > echo rand(0, 10); ![Get Random Number in PHP](http://www.tecmint.com/wp-content/uploads/2015/07/Get-Random-Number-in-PHP.png) -在PHP中获取随机数 -**17. 获取某个指定字符串的md5sum和sha1sum,例如,让我们在PHP Shell中检查某个字符串(比如说avi)的md5sum和sha1sum,并交叉检查这些带有bash shell生成的md5sum和sha1sum的结果。** +*在PHP中获取随机数* + +**17. 获取某个指定字符串的md5校验和sha1校验,例如,让我们在PHP Shell中检查某个字符串(比如说avi)的md5校验和sha1校验,并交叉校验bash shell生成的md5校验和sha1校验的结果。** php > echo md5(avi); 3fca379b3f0e322b7b7967bfcfb948ad @@ -175,9 +182,10 @@ strlen函数用于获取指定字符串的长度。 8f920f22884d6fea9df883843c4a8095a2e5ac6f - ![Check md5sum and sha1sum in PHP](http://www.tecmint.com/wp-content/uploads/2015/07/Check-md5sum-and-sha1sum.png) -在PHP中检查md5sum和sha1sum -这里只是PHP Shell中所能获取的功能和PHP Shell的交互特性的惊鸿一瞥,这些就是到现在为止我所讨论的一切。保持和tecmint的连线,在评论中为我们提供你有价值的反馈吧。为我们点赞并分享,帮助我们扩散哦。 +*在PHP中检查md5校验和sha1校验* + +这里只是PHP Shell中所能获取的功能和PHP Shell的交互特性的惊鸿一瞥,这些就是到现在为止我所讨论的一切。保持连线,在评论中为我们提供你有价值的反馈吧。为我们点赞并分享,帮助我们扩散哦。 -------------------------------------------------------------------------------- @@ -185,9 +193,9 @@ via: http://www.tecmint.com/execute-php-codes-functions-in-linux-commandline/ 作者:[Avishek Kumar][a] 译者:[GOLinux](https://github.com/GOLinux) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 [a]:http://www.tecmint.com/author/avishek/ -[1]:http://www.tecmint.com/run-php-codes-from-linux-commandline/ +[1]:https://linux.cn/article-5906-1.html From 685a9945742f54247a9d66c842f01521b85cf0e1 Mon Sep 17 00:00:00 2001 From: DongShuaike Date: Wed, 29 Jul 2015 16:39:35 +0800 Subject: [PATCH 732/965] Translated by DongShuaike --- ...ion Swarm Clusters using Docker Machine.md | 125 ++++++++++++++++++ 1 file changed, 125 insertions(+) create mode 100644 translated/tech/20150625 How to Provision Swarm Clusters using Docker Machine.md diff --git a/translated/tech/20150625 How to Provision Swarm Clusters using Docker Machine.md b/translated/tech/20150625 How to Provision Swarm Clusters using Docker Machine.md new file mode 100644 index 0000000000..940c68b55d --- /dev/null +++ b/translated/tech/20150625 How to Provision Swarm Clusters using Docker Machine.md @@ -0,0 +1,125 @@ +如何使用Docker Machine部署Swarm集群 +================================================================================ +大家好,今天我们来研究一下如何使用Docker Machine部署Swarm集群。Docker Machine提供了独立的Docker API,所以任何与Docker守护进程进行交互的工具都可以使用Swarm来(透明地)扩增到多台主机上。Docker Machine可以用来在个人电脑、云端以及的数据中心里创建Docker主机。它为创建服务器,安装Docker以及根据用户设定配置Docker客户端提供了便捷化的解决方案。我们可以使用任何驱动来部署swarm集群,并且swarm集群将由于使用了TLS加密具有极好的安全性。 + +下面是我提供的简便方法。 +### 1. 安装Docker Machine ### + +Docker Machine 在任何Linux系统上都被支持。首先,我们需要从Github上下载最新版本的Docker Machine。我们使用curl命令来下载最先版本Docker Machine ie 0.2.0。 +64位操作系统: + + # curl -L https://github.com/docker/machine/releases/download/v0.2.0/docker-machine_linux-amd64 > /usr/local/bin/docker-machine + +32位操作系统: + + # curl -L https://github.com/docker/machine/releases/download/v0.2.0/docker-machine_linux-i386 > /usr/local/bin/docker-machine + +下载了最先版本的Docker Machine之后,我们需要对 /usr/local/bin/ 目录下的docker-machine文件的权限进行修改。命令如下: + + # chmod +x /usr/local/bin/docker-machine + +在做完上面的事情以后,我们必须确保docker-machine已经安装好。怎么检查呢?运行docker-machine -v指令,指令将会给出我们系统上所安装的docker-machine版本。 + + # docker-machine -v + +![Installing Docker Machine](http://blog.linoxide.com/wp-content/uploads/2015/05/installing-docker-machine.png) + +为了让Docker命令能够在我们的机器上运行,必须还要在机器上安装Docker客户端。命令如下。 + + # curl -L https://get.docker.com/builds/linux/x86_64/docker-latest > /usr/local/bin/docker + # chmod +x /usr/local/bin/docker + +### 2. 创建Machine ### + +在将Docker Machine安装到我们的设备上之后,我们需要使用Docker Machine创建一个machine。在这片文章中,我们会将其部署在Digital Ocean Platform上。所以我们将使用“digitalocean”作为它的Driver API,然后将docker swarm运行在其中。这个Droplet会被设置为Swarm主节点,我们还要创建另外一个Droplet,并将其设定为Swarm节点代理。 +创建machine的命令如下: + + # docker-machine create --driver digitalocean --digitalocean-access-token linux-dev + +**Note**: 假设我们要创建一个名为“linux-dev”的machine。是用户在Digital Ocean Cloud Platform的Digital Ocean控制面板中生成的密钥。为了获取这个密钥,我们需要登录我们的Digital Ocean控制面板,然后点击API选项,之后点击Generate New Token,起个名字,然后在Read和Write两个选项上打钩。之后我们将得到一个很长的十六进制密钥,这个就是了。用其替换上面那条命令中的API-Token字段。 + +现在,运行下面的指令,将Machine configuration装载进shell。 + + # eval "$(docker-machine env linux-dev)" + +![Docker Machine Digitalocean Cloud](http://blog.linoxide.com/wp-content/uploads/2015/05/docker-machine-digitalocean-cloud.png) + +然后,我们使用如下命令将我们的machine标记为ACTIVE状态。 + + # docker-machine active linux-dev + +现在,我们检查是否它(指machine)被标记为了 ACTIVE "*"。 + + # docker-machine ls + +![Docker Machine Active List](http://blog.linoxide.com/wp-content/uploads/2015/05/docker-machine-active-list.png) + +### 3. 运行Swarm Docker镜像 ### + +现在,在我们创建完成了machine之后。我们需要将swarm docker镜像部署上去。这个machine将会运行这个docker镜像并且控制Swarm主节点和从节点。使用下面的指令运行镜像: + + # docker run swarm create + +![Docker Machine Swarm Create](http://blog.linoxide.com/wp-content/uploads/2015/05/docker-machine-swarm-create.png) + +If you are trying to run swarm docker image using **32 bit Operating System** in the computer where Docker Machine is running, we'll need to SSH into the Droplet. +如果你想要在**32位操作系统**上运行swarm docker镜像。你需要SSH登录到Droplet当中。 + + # docker-machine ssh + #docker run swarm create + #exit + +### 4. 创建Swarm主节点 ### + +在我们的swarm image已经运行在machine当中之后,我们将要创建一个Swarm主节点。使用下面的语句,添加一个主节点。(这里的感觉怪怪的,好像少翻译了很多东西,是我把Master翻译为主节点的原因吗?) + + # docker-machine create \ + -d digitalocean \ + --digitalocean-access-token + --swarm \ + --swarm-master \ + --swarm-discovery token:// \ + swarm-master + +![Docker Machine Swarm Master Create](http://blog.linoxide.com/wp-content/uploads/2015/05/docker-machine-swarm-master-create.png) + +### 5. 创建Swarm结点群 ### + +现在,我们将要创建一个swarm结点,此结点将与Swarm主节点相连接。下面的指令将创建一个新的名为swarm-node的droplet,其与Swarm主节点相连。到此,我们就拥有了一个两节点的swarm集群了。 + + # docker-machine create \ + -d digitalocean \ + --digitalocean-access-token + --swarm \ + --swarm-discovery token:// \ + swarm-node + +![Docker Machine Swarm Nodes](http://blog.linoxide.com/wp-content/uploads/2015/05/docker-machine-swarm-nodes.png) + +### 6. Connecting to the Swarm Master ### +### 6. 与Swarm主节点连接 ### + +现在,我们连接Swarm主节点以便我们可以依照需求和配置文件在节点间部署Docker容器。运行下列命令将Swarm主节点的Machine配置文件加载到环境当中。 + + # eval "$(docker-machine env --swarm swarm-master)" + +然后,我们就可以跨结点地运行我们所需的容器了。在这里,我们还要检查一下是否一切正常。所以,运行**docker info**命令来检查Swarm集群的信息。 + + # docker info + +### Conclusion ### +### 总结 ### + +我们可以用Docker Machine轻而易举地创建Swarm集群。这种方法有非常高的效率,因为它极大地减少了系统管理员和用户的时间消耗。在这篇文章中,我们以Digital Ocean作为驱动,通过创建一个主节点和一个从节点成功地部署了集群。其他类似的应用还有VirtualBox,Google Cloud Computing,Amazon Web Service,Microsoft Azure等等。这些连接都是通过TLS进行加密的,具有很高的安全性。如果你有任何的疑问,建议,反馈,欢迎在下面的评论框中注明以便我们可以更好地提高文章的质量! + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/linux-how-to/provision-swarm-clusters-using-docker-machine/ + +作者:[Arun Pyasi][a] +译者:[DongShuaike](https://github.com/DongShuaike) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://linoxide.com/author/arunp/ From d2a812c5715c967171b989f64f1389b39cb5f547 Mon Sep 17 00:00:00 2001 From: DeadFire Date: Wed, 29 Jul 2015 17:40:16 +0800 Subject: [PATCH 733/965] =?UTF-8?q?20150729-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ment and How Do You Enable It in Ubuntu.md | 72 +++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 sources/tech/20150729 What is Logical Volume Management and How Do You Enable It in Ubuntu.md diff --git a/sources/tech/20150729 What is Logical Volume Management and How Do You Enable It in Ubuntu.md b/sources/tech/20150729 What is Logical Volume Management and How Do You Enable It in Ubuntu.md new file mode 100644 index 0000000000..1641bd8f20 --- /dev/null +++ b/sources/tech/20150729 What is Logical Volume Management and How Do You Enable It in Ubuntu.md @@ -0,0 +1,72 @@ +What is Logical Volume Management and How Do You Enable It in Ubuntu? +================================================================================ +> Logical Volume Management (LVM) is a disk management option that every major Linux distribution includes. Whether you need to set up storage pools or just need to dynamically create partitions, LVM is probably what you are looking for. + +### What is LVM? ### + +Logical Volume Manager allows for a layer of abstraction between your operating system and the disks/partitions it uses. In traditional disk management your operating system looks for what disks are available (/dev/sda, /dev/sdb, etc.) and then looks at what partitions are available on those disks (/dev/sda1, /dev/sda2, etc.). + +With LVM, disks and partitions can be abstracted to contain multiple disks and partitions into one device. Your operating systems will never know the difference because LVM will only show the OS the volume groups (disks) and logical volumes (partitions) that you have set up. + +Because volume groups and logical volumes aren’t physically tied to a hard drive, it makes it easy to dynamically resize and create new disks and partitions. In addition, LVM can give you features that your file system is not capable of doing. For example, Ext3 does not have support for live snapshots, but if you’re using LVM you have the ability to take a snapshot of your logical volumes without unmounting the disk. + +### When Should You Use LVM? ### + +The first thing your should consider before setting up LVM is what you want to accomplish with your disks and partitions. Some distributions, like Fedora, install with LVM by default. + +If you are using Ubuntu on a laptop with only one internal hard drive and you don’t need extended features like live snapshots, then you may not need LVM. If you need easy expansion or want to combine multiple hard drives into a single pool of storage then LVM may be what you have been looking for. + +### Setting up LVM in Ubuntu ### + +First thing to know about using LVM is there is no easy way to convert your existing traditional partitions to logical volumes. It is possible to move to a new partition that uses LVM, but that won’t be something that we will cover in this article; instead we are going to take the approach of setting up LVM on a fresh installation of Ubuntu 10.10. + +![](http://cdn3.howtogeek.com/wp-content/uploads/2010/12/ubuntu-10-banner.png) + +To install Ubuntu using LVM you need to use the alternate install CD. Download it from the link below and burn a CD or [use unetbootin to create a USB drive][1]. + +![](http://cdn3.howtogeek.com/wp-content/uploads/2010/12/download-web.png) + +Boot your computer from the alternate install disk and select your options up until the partition disks screen and select guided – use entire disk and set up LVM. + +*Note: This will format your entire hard drive so if you are trying to dual boot or have another installation select manual instead.* + +![](http://cdn3.howtogeek.com/wp-content/uploads/2010/12/setup-1.png) + +Select the main disk you want to use, typically your largest drive, and then go to the next step. + +![](http://cdn3.howtogeek.com/wp-content/uploads/2010/12/setup-2.png) + +You will immediately need to write the changes to disk so make sure you selected the right disk and then write the changes. + +![](http://cdn3.howtogeek.com/wp-content/uploads/2010/12/setup-3.png) + +Select the size you want the first logical volume to be and then continue. + +![](http://cdn3.howtogeek.com/wp-content/uploads/2011/01/setup-4.png) + +Confirm your disk partitions and continue with the installation. + +![](http://cdn3.howtogeek.com/wp-content/uploads/2011/01/setup-5.png) + +The final step will write the GRUB bootloader to the hard drive. It is important to note that GRUB cannot be on an LVM partition because computer BIOSes cannot directly read from a logical volume. Ubuntu will automatically create a 255 MB ext2 partition for your bootloader. + +![](http://cdn3.howtogeek.com/wp-content/uploads/2011/01/setup-6.png) + +After the installation is complete, reboot the machine and boot into Ubuntu as normal. There should be no perceivable difference between using LVM or traditional disk management with this type of installation. + +![](http://cdn3.howtogeek.com/wp-content/uploads/2011/01/disk-manager.png) + +To use LVM to its full potential, stay tuned for our upcoming article on managing your LVM installation. + +-------------------------------------------------------------------------------- + +via: http://www.howtogeek.com/howto/36568/what-is-logical-volume-management-and-how-do-you-enable-it-in-ubuntu/ + +作者:[How-To Geek][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://plus.google.com/+howtogeek?prsrc=5 +[1]:http://www.howtogeek.com/howto/13379/create-a-bootable-ubuntu-9.10-usb-flash-drive/ \ No newline at end of file From 07d57a8f363881dc7d8b235803819e907bc43f1b Mon Sep 17 00:00:00 2001 From: wxy Date: Wed, 29 Jul 2015 22:24:39 +0800 Subject: [PATCH 734/965] =?UTF-8?q?=E8=A1=A5=E5=AE=8C=20PR?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @DongShuaike --- ...ion Swarm Clusters using Docker Machine.md | 127 ------------------ 1 file changed, 127 deletions(-) delete mode 100644 sources/tech/20150625 How to Provision Swarm Clusters using Docker Machine.md diff --git a/sources/tech/20150625 How to Provision Swarm Clusters using Docker Machine.md b/sources/tech/20150625 How to Provision Swarm Clusters using Docker Machine.md deleted file mode 100644 index 092eb3dbbd..0000000000 --- a/sources/tech/20150625 How to Provision Swarm Clusters using Docker Machine.md +++ /dev/null @@ -1,127 +0,0 @@ -Translating by DongShuaike - -How to Provision Swarm Clusters using Docker Machine -================================================================================ -Hi all, today we'll learn how we can deploy Swarm Clusters using Docker Machine. It serves the standard Docker API, so any tool which can communicate with a Docker daemon can use Swarm to transparently scale to multiple hosts. Docker Machine is an application that helps to create Docker hosts on our computer, on cloud providers and inside our own data center. It provides easy solution for creating servers, installing Docker on them and then configuring the Docker client according the users configuration and requirements. We can provision swarm clusters with any driver we need and is highly secured with TLS Encryption. - -Here are some quick and easy steps on how to provision swarm clusters with Docker Machine. - -### 1. Installing Docker Machine ### - -Docker Machine supports awesome on every Linux Operating System. First of all, we'll need to download the latest version of Docker Machine from the Github site . Here, we'll use curl to download the latest version of Docker Machine ie 0.2.0 . - -For 64 Bit Operating System - - # curl -L https://github.com/docker/machine/releases/download/v0.2.0/docker-machine_linux-amd64 > /usr/local/bin/docker-machine - -For 32 Bit Operating System - - # curl -L https://github.com/docker/machine/releases/download/v0.2.0/docker-machine_linux-i386 > /usr/local/bin/docker-machine - -After downloading the latest release of Docker Machine, we'll make the file named docker-machine under /usr/local/bin/ executable using the command below. - - # chmod +x /usr/local/bin/docker-machine - -After doing the above, we'll wanna ensure that we have successfully installed docker-machine. To check it, we can run the docker-machine -v which will give output of the version of docker-machine installed in our system. - - # docker-machine -v - -![Installing Docker Machine](http://blog.linoxide.com/wp-content/uploads/2015/05/installing-docker-machine.png) - -To enable Docker commands on our machines, make sure to install the Docker client as well by running the command below. - - # curl -L https://get.docker.com/builds/linux/x86_64/docker-latest > /usr/local/bin/docker - # chmod +x /usr/local/bin/docker - -### 2. Creating Machine ### - -After installing Machine into our working PC or device, we'll wanna go forward to create a machine using Docker Machine. Here, in this tutorial we'll gonna deploy a machine in the Digital Ocean Platform so we'll gonna use "digitalocean" as its Driver API then, docker swarm will be running into that Droplet which will be further configured as Swarm Master and another droplet will be created which will be configured as Swarm Node Agent. - -So, to create the machine, we'll need to run the following command. - - # docker-machine create --driver digitalocean --digitalocean-access-token linux-dev - -**Note**: Here, linux-dev is the name of the machine we are wanting to create. is a security key which can be generated from the Digital Ocean Control Panel of the account holder of Digital Ocean Cloud Platform. To retrieve that key, we simply need to login to our Digital Ocean Control Panel then click on API, then click on Generate New Token and give it a name tick on both Read and Write. Then we'll get a long hex key, thats the now, simply replace it into the command above. - -Now, to load the Machine configuration into the shell we are running the comamands, run the following command. - - # eval "$(docker-machine env linux-dev)" - -![Docker Machine Digitalocean Cloud](http://blog.linoxide.com/wp-content/uploads/2015/05/docker-machine-digitalocean-cloud.png) - -Then, we'll mark our machine as ACTIVE by running the below command. - - # docker-machine active linux-dev - -Now, we'll check whether its been marked as ACTIVE "*" or not. - - # docker-machine ls - -![Docker Machine Active List](http://blog.linoxide.com/wp-content/uploads/2015/05/docker-machine-active-list.png) - -### 3. Running Swarm Docker Image ### - -Now, after we finish creating the required machine. We'll gonna deploy swarm docker image in our active machine. This machine will run the docker image and will control over the Swarm master and node. To run the image, we can simply run the below command. - - # docker run swarm create - -![Docker Machine Swarm Create](http://blog.linoxide.com/wp-content/uploads/2015/05/docker-machine-swarm-create.png) - -If you are trying to run swarm docker image using **32 bit Operating System** in the computer where Docker Machine is running, we'll need to SSH into the Droplet. - - # docker-machine ssh - #docker run swarm create - #exit - -### 4. Creating Swarm Master ### - -Now, after our machine and swarm image is running into the machine, we'll now create a Swarm Master. This will also add the master as a node. To do so, here's the command below. - - # docker-machine create \ - -d digitalocean \ - --digitalocean-access-token - --swarm \ - --swarm-master \ - --swarm-discovery token:// \ - swarm-master - -![Docker Machine Swarm Master Create](http://blog.linoxide.com/wp-content/uploads/2015/05/docker-machine-swarm-master-create.png) - -### 5. Creating Swarm Nodes ### - -Now, we'll create a swarm node which will get connected with the Swarm Master. The command below will create a new droplet which will be named as swarm-node and will get connected with the Swarm Master as node. This will create a Swarm cluster across the two nodes. - - # docker-machine create \ - -d digitalocean \ - --digitalocean-access-token - --swarm \ - --swarm-discovery token:// \ - swarm-node - -![Docker Machine Swarm Nodes](http://blog.linoxide.com/wp-content/uploads/2015/05/docker-machine-swarm-nodes.png) - -### 6. Connecting to the Swarm Master ### - -We, now connect to the Swarm Master so that we can deploy Docker containers across the nodes as per the requirement and configuration. To load the Swarm Master's Machine configuration into our environment, we can run the below command. - - # eval "$(docker-machine env --swarm swarm-master)" - -After that, we can run the required containers of our choice across the nodes. Here, we'll check if everything went fine or not. So, we'll run **docker info** to check the information about the Swarm Clusters. - - # docker info - -### Conclusion ### - -We can pretty easily create Swarm Cluster with Docker Machine. This method is a lot productive because it reduces a lot of time of a system admin or users. In this article, we successfully provisioned clusters by creating a master and a node using a machine with Digital Ocean as driver. It can be created using any driver like VirtualBox, Google Cloud Computing, Amazon Web Service, Microsoft Azure and more according to the need and requirement of the user and the connection is highly secured with TLS Encryption. If you have any questions, suggestions, feedback please write them in the comment box below so that we can improve or update our contents. Thank you ! Enjoy :-) - --------------------------------------------------------------------------------- - -via: http://linoxide.com/linux-how-to/provision-swarm-clusters-using-docker-machine/ - -作者:[Arun Pyasi][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://linoxide.com/author/arunp/ From 92dc1ab34b83aaf48e3b5a864a372d8fc1984827 Mon Sep 17 00:00:00 2001 From: DeadFire Date: Thu, 30 Jul 2015 17:48:22 +0800 Subject: [PATCH 735/965] =?UTF-8?q?20150730-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...TOP (IT Operational Portal) on CentOS 7.md | 174 ++++++++++++++++++ ... or Load Balancer with Weave and Docker.md | 126 +++++++++++++ 2 files changed, 300 insertions(+) create mode 100644 sources/tech/20150730 How to Setup iTOP (IT Operational Portal) on CentOS 7.md create mode 100644 sources/tech/20150730 Howto Configure Nginx as Rreverse Proxy or Load Balancer with Weave and Docker.md diff --git a/sources/tech/20150730 How to Setup iTOP (IT Operational Portal) on CentOS 7.md b/sources/tech/20150730 How to Setup iTOP (IT Operational Portal) on CentOS 7.md new file mode 100644 index 0000000000..38477bb662 --- /dev/null +++ b/sources/tech/20150730 How to Setup iTOP (IT Operational Portal) on CentOS 7.md @@ -0,0 +1,174 @@ +How to Setup iTOP (IT Operational Portal) on CentOS 7 +================================================================================ +iTOP is a simple, Open source web based IT Service Management tool. It has all of ITIL functionality that includes with Service desk, Configuration Management, Incident Management, Problem Management, Change Management and Service Management. iTop relays on Apache/IIS, MySQL and PHP, so it can run on any operating system supporting these applications. Since iTop is a web based application you don’t need to deploy any client software on each user’s PC. A simple web browser is enough to perform day to day operations of an IT environment with iTOP. + +To install and configure iTOP we will be using CentOS 7 as base operating with basic LAMP Stack environment installed on it that will cover its almost all prerequisites. + +### Downloading iTOP ### + +iTop download package is present on SourceForge, we can get its link from their official website [link][1]. + +![itop download](http://blog.linoxide.com/wp-content/uploads/2015/07/1-itop-download.png) + +We will the download link from here and get this zipped file on server with wget command as below. + + [root@centos-007 ~]# wget http://downloads.sourceforge.net/project/itop/itop/2.1.0/iTop-2.1.0-2127.zip + +### iTop Extensions and Web Setup ### + +By using unzip command we will extract the downloaded packages in the document root directory of our apache web server in a new directory with name itop. + + [root@centos-7 ~]# ls + iTop-2.1.0-2127.zip + [root@centos-7 ~]# unzip iTop-2.1.0-2127.zip -d /var/www/html/itop/ + +List the folder to view installation packages in it. + + [root@centos-7 ~]# ls -lh /var/www/html/itop/ + total 68K + -rw-r--r--. 1 root root 1.4K Dec 17 2014 INSTALL + -rw-r--r--. 1 root root 35K Dec 17 2014 LICENSE + -rw-r--r--. 1 root root 23K Dec 17 2014 README + drwxr-xr-x. 19 root root 4.0K Jul 14 13:10 web + +Here is all the extensions that we can install. + + [root@centos-7 2.x]# ls + authent-external itop-backup itop-config-mgmt itop-problem-mgmt itop-service-mgmt-provider itop-welcome-itil + authent-ldap itop-bridge-virtualization-storage itop-datacenter-mgmt itop-profiles-itil itop-sla-computation version.xml + authent-local itop-change-mgmt itop-endusers-devices itop-request-mgmt itop-storage-mgmt wizard-icons + installation.xml itop-change-mgmt-itil itop-incident-mgmt-itil itop-request-mgmt-itil itop-tickets + itop-attachments itop-config itop-knownerror-mgmt itop-service-mgmt itop-virtualization-mgmt + +Now from the extracted web directory, moving through different data models we will migrate the required extensions from the datamodels into the web extensions directory of web document root directory with copy command. + + [root@centos-7 2.x]# pwd + /var/www/html/itop/web/datamodels/2.x + [root@centos-7 2.x]# cp -r itop-request-mgmt itop-service-mgmt itop-service-mgmt itop-config itop-change-mgmt /var/www/html/itop/web/extensions/ + +### Installing iTop Web Interface ### + +Most of our server side settings and configurations are done.Finally we need to complete its web interface installation process to finalize the setup. + +Open your favorite web browser and access the WordPress web directory in your web browser using your server IP or FQDN like. + + http://servers_ip_address/itop/web/ + +You will be redirected towards the web installation process for iTop. Let’s configure it as per your requirements like we did here in this tutorial. + +#### Prerequisites Validation #### + +At the stage you will be prompted for welcome screen with prerequisites validation ok. If you get some warning then you have to make resolve it by installing its prerequisites. + +![mcrypt missing](http://blog.linoxide.com/wp-content/uploads/2015/07/2-itop-web-install.png) + +At this stage one optional package named php mcrypt will be missing. Download the following rpm package then try to install php mcrypt package. + + [root@centos-7 ~]#yum localinstall php-mcrypt-5.3.3-1.el6.x86_64.rpm libmcrypt-2.5.8-9.el6.x86_64.rpm. + +After successful installation of php-mcrypt library we need to restart apache web service, then reload the web page and this time its prerequisites validation should be OK. + +#### Install or Upgrade iTop #### + +Here we will choose the fresh installation as we have not installed iTop previously on our server. + +![Install New iTop](http://blog.linoxide.com/wp-content/uploads/2015/07/3.png) + +#### iTop License Agreement #### + +Chose the option to accept the terms of the licenses of all the components of iTop and click "NEXT". + +![License Agreement](http://blog.linoxide.com/wp-content/uploads/2015/07/4.png) + +#### Database Configuration #### + +Here we the do Configuration of the database connection by giving our database servers credentials and then choose from the option to create new database as shown. + +![DB Connection](http://blog.linoxide.com/wp-content/uploads/2015/07/5.png) + +#### Administrator Account #### + +In this step we will configure an Admin account by filling out its login details as. + +![Admin Account](http://blog.linoxide.com/wp-content/uploads/2015/07/6.png) + +#### Miscellaneous Parameters #### + +Let's choose the additional parameters whether you want to install with demo contents or with fresh database and proceed forward. + +![Misc Parameters](http://blog.linoxide.com/wp-content/uploads/2015/07/7.png) + +### iTop Configurations Management ### + +The options below allow you to configure the type of elements that are to be managed inside iTop like all the base objects that are mandatory in the iTop CMDB, Manage Data Center devices, storage device and virtualization. + +![Conf Management](http://blog.linoxide.com/wp-content/uploads/2015/07/8.png) + +#### Service Management #### + +Select from the choices that best describes the relationships between the services and the IT infrastructure in your IT environment. So we are choosing Service Management for Service Providers here. + +![Service Management](http://blog.linoxide.com/wp-content/uploads/2015/07/9.png) + +#### iTop Tickets Management #### + +From the different available options we will Select the ITIL Compliant Tickets Management option to have different types of ticket for managing user requests and incidents. + +![Ticket Management](http://blog.linoxide.com/wp-content/uploads/2015/07/10.png) + +#### Change Management Options #### + +Select the type of tickets you want to use in order to manage changes to the IT infrastructure from the available options. We are going to choose ITIL change management option here. + +![ITIL Change](http://blog.linoxide.com/wp-content/uploads/2015/07/11.png) + +#### iTop Extensions #### + +In this section we can select the additional extensions to install or we can unchecked the ones that you want to skip. + +![iTop Extensions](http://blog.linoxide.com/wp-content/uploads/2015/07/13.png) + +### Ready to Start Web Installation ### + +Now we are ready to start installing the components that we choose in previous steps. We can also drop down these installation parameters to view our configuration from the drop down. + +Once you are confirmed with the installation parameters click on the install button. + +![Installation Parameters](http://blog.linoxide.com/wp-content/uploads/2015/07/16.png) + +Let's wait for the progress bar to complete the installation process. It might takes few minutes to complete its installation process. + +![iTop Installation Process](http://blog.linoxide.com/wp-content/uploads/2015/07/17.png) + +### iTop Installation Done ### + +Our iTop installation setup is complete, just need to do a simple manual operation as shown and then click to enter iTop. + +![iTop Done](http://blog.linoxide.com/wp-content/uploads/2015/07/18.png) + +### Welcome to iTop (IT Operational Portal) ### + +![itop welcome note](http://blog.linoxide.com/wp-content/uploads/2015/07/20.png) + +### iTop Dashboard ### + +You can manage configuration of everything from here Servers, computers, Contacts, Locations, Contracts, Network devices…. You can create your own. Just the fact, that the installed CMDB module is great which is an essential part of every bigger IT. + +![iTop Dashboard](http://blog.linoxide.com/wp-content/uploads/2015/07/19.png) + +### Conclusion ### + +ITOP is one of the best Open Source Service Desk solutions. We have successfully installed and configured it on our CentOS 7 cloud host. So, the most powerful aspect of iTop is the ease with which it can be customized via its “extensions”. Feel free to comment if you face any trouble during its setup. + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/tools/setup-itop-centos-7/ + +作者:[Kashif Siddique][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://linoxide.com/author/kashifs/ +[1]:http://www.combodo.com/spip.php?page=rubrique&id_rubrique=8 \ No newline at end of file diff --git a/sources/tech/20150730 Howto Configure Nginx as Rreverse Proxy or Load Balancer with Weave and Docker.md b/sources/tech/20150730 Howto Configure Nginx as Rreverse Proxy or Load Balancer with Weave and Docker.md new file mode 100644 index 0000000000..82c592d3b4 --- /dev/null +++ b/sources/tech/20150730 Howto Configure Nginx as Rreverse Proxy or Load Balancer with Weave and Docker.md @@ -0,0 +1,126 @@ +Howto Configure Nginx as Rreverse Proxy / Load Balancer with Weave and Docker +================================================================================ +Hi everyone today we'll learnHowto configure Nginx as Rreverse Proxy / Load balancer with Weave and Docker Weave creates a virtual network that connects Docker containers with each other, deploys across multiple hosts and enables their automatic discovery. It allows us to focus on developing our application, rather than our infrastructure. It provides such an awesome environment that the applications uses the network as if its containers were all plugged into the same network without need to configure ports, mappings, link, etc. The services of the application containers on the network can be easily accessible to the external world with no matter where its running. Here, in this tutorial we'll be using weave to quickly and easily deploy nginx web server as a load balancer for a simple php application running in docker containers on multiple nodes in Amazon Web Services. Here, we will be introduced to WeaveDNS, which provides a simple way for containers to find each other using hostname with no changes in codes and tells other containers to connect to those names. + +Here, in this tutorial, we will use Nginx to load balance requests to a set of containers running Apache. Here are the simple and easy to do steps on using Weave to configure nginx as a load balancer running in ubuntu docker container. + +### 1. Settting up AWS Instances ### + +First of all, we'll need to setup Amazon Web Service Instances so that we can run docker containers with Weave and Ubuntu as Operating System. We will use the [AWS CLI][1] to setup and configure two AWS EC2 instances. Here, in this tutorial, we'll use the smallest available instances, t1.micro. We will need to have a valid **Amazon Web Services account** with AWS CLI setup and configured. We'll first gonna clone the repository of weave from the github by running the following command in AWS CLI. + + $ git clone http://github.com/fintanr/weave-gs + $ cd weave-gs/aws-nginx-ubuntu-simple + +After cloning the repository, we wanna run the script that will deploy two instances of t1.micro instance running Weave and Docker in Ubuntu Operating System. + + $ sudo ./demo-aws-setup.sh + +Here, for this tutorial we'll need the IP addresses of these instances further in future. These are stored in an environment file weavedemo.env which is created during the execution of the demo-aws-setup.sh. To get those ip addresses, we need to run the following command which will give the output similar to the output below. + + $ cat weavedemo.env + + export WEAVE_AWS_DEMO_HOST1=52.26.175.175 + export WEAVE_AWS_DEMO_HOST2=52.26.83.141 + export WEAVE_AWS_DEMO_HOSTCOUNT=2 + export WEAVE_AWS_DEMO_HOSTS=(52.26.175.175 52.26.83.141) + +Please note these are not the IP addresses for our tutorial, AWS dynamically allocate IP addresses to our instances. + +As were are using a bash, we will just source this file and execute it using the command below. + + . ./weavedemo.env + +### 2. Launching Weave and WeaveDNS ### + +After deploying the instances, we'll want to launch weave and weavedns on each hosts. Weave and weavedns allows us to easily deploy our containers to a new infrastructure and configuration without the need of changing the codes and without the need to understand concepts such as ambassador containers and links. Here are the commands to launch them in the first host. + + ssh -i weavedemo-key.pem ubuntu@$WEAVE_AWS_DEMO_HOST1 + $ sudo weave launch + $ sudo weave launch-dns 10.2.1.1/24 + +Next, we'll also wanna launch them in our second host. + + ssh -i weavedemo-key.pem ubuntu@$WEAVE_AWS_DEMO_HOST2 + $ sudo weave launch $WEAVE_AWS_DEMO_HOST1 + $ sudo weave launch-dns 10.2.1.2/24 + +### 3. Launching Application Containers ### + +Now, we wanna launch six containers across our two hosts running an Apache2 Web Server instance with our simple php site. So, we'll be running the following commands which will run 3 containers running Apache2 Web Server on our 1st instance. + + ssh -i weavedemo-key.pem ubuntu@$WEAVE_AWS_DEMO_HOST1 + $ sudo weave run --with-dns 10.3.1.1/24 -h ws1.weave.local fintanr/weave-gs-nginx-apache + $ sudo weave run --with-dns 10.3.1.2/24 -h ws2.weave.local fintanr/weave-gs-nginx-apache + $ sudo weave run --with-dns 10.3.1.3/24 -h ws3.weave.local fintanr/weave-gs-nginx-apache + +After that, we'll again launch 3 containers running apache2 web server in our 2nd instance as shown below. + + ssh -i weavedemo-key.pem ubuntu@$WEAVE_AWS_DEMO_HOST2 + $ sudo weave run --with-dns 10.3.1.4/24 -h ws4.weave.local fintanr/weave-gs-nginx-apache + $ sudo weave run --with-dns 10.3.1.5/24 -h ws5.weave.local fintanr/weave-gs-nginx-apache + $ sudo weave run --with-dns 10.3.1.6/24 -h ws6.weave.local fintanr/weave-gs-nginx-apache + +Note: Here, --with-dns option tells the container to use weavedns to resolve names and -h x.weave.local allows the host to be resolvable with WeaveDNS. + +### 4. Launching Nginx Container ### + +After our application containers are running well as expected, we'll wanna launch an nginx container which contains the nginx configuration which will round-robin across the severs for the reverse proxy or load balancing. To run the nginx container, we'll need to run the following command. + + ssh -i weavedemo-key.pem ubuntu@$WEAVE_AWS_DEMO_HOST1 + $ sudo weave run --with-dns 10.3.1.7/24 -ti -h nginx.weave.local -d -p 80:80 fintanr/weave-gs-nginx-simple + +Hence, our Nginx container is publicly exposed as a http server on $WEAVE_AWS_DEMO_HOST1. + +### 5. Testing the Load Balancer ### + +To test our load balancer is working or not, we'll run a script that will make http requests to our nginx container. We'll make six requests so that we can see nginx moving through each of the webservers in round-robin turn. + + $ ./access-aws-hosts.sh + + { + "message" : "Hello Weave - nginx example", + "hostname" : "ws1.weave.local", + "date" : "2015-06-26 12:24:23" + } + { + "message" : "Hello Weave - nginx example", + "hostname" : "ws2.weave.local", + "date" : "2015-06-26 12:24:23" + } + { + "message" : "Hello Weave - nginx example", + "hostname" : "ws3.weave.local", + "date" : "2015-06-26 12:24:23" + } + { + "message" : "Hello Weave - nginx example", + "hostname" : "ws4.weave.local", + "date" : "2015-06-26 12:24:23" + } + { + "message" : "Hello Weave - nginx example", + "hostname" : "ws5.weave.local", + "date" : "2015-06-26 12:24:23" + } + { + "message" : "Hello Weave - nginx example", + "hostname" : "ws6.weave.local", + "date" : "2015-06-26 12:24:23" + } + +### Conclusion ### + +Finally, we've successfully configured nginx as a reverse proxy or load balancer with weave and docker running ubuntu server in AWS (Amazon Web Service) EC2 . From the above output in above step, it is clear that we have configured it correctly. We can see that the request is being sent to 6 application containers in round-robin turn which is running a PHP app hosted in apache web server. Here, weave and weavedns did great work to deploy a containerised PHP application using nginx across multiple hosts on AWS EC2 without need to change in codes and connected the containers to eachother with the hostname using weavedns. If you have any questions, suggestions, feedback please write them in the comment box below so that we can improve or update our contents. Thank you ! Enjoy :-) + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/linux-how-to/nginx-load-balancer-weave-docker/ + +作者:[Arun Pyasi][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://linoxide.com/author/arunp/ +[1]:http://console.aws.amazon.com/ \ No newline at end of file From b0452f98fac85ec842786a5e91371484ba4b16fe Mon Sep 17 00:00:00 2001 From: DeadFire Date: Thu, 30 Jul 2015 18:19:51 +0800 Subject: [PATCH 736/965] =?UTF-8?q?20150730-2=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20150730 Compare PDF Files on Ubuntu.md | 47 +++++ ... Must-Know Linux Commands For New Users.md | 185 ++++++++++++++++++ 2 files changed, 232 insertions(+) create mode 100644 sources/tech/20150730 Compare PDF Files on Ubuntu.md create mode 100644 sources/tech/20150730 Must-Know Linux Commands For New Users.md diff --git a/sources/tech/20150730 Compare PDF Files on Ubuntu.md b/sources/tech/20150730 Compare PDF Files on Ubuntu.md new file mode 100644 index 0000000000..9612f0430e --- /dev/null +++ b/sources/tech/20150730 Compare PDF Files on Ubuntu.md @@ -0,0 +1,47 @@ +Compare PDF Files on Ubuntu +================================================================================ +If you want to compare PDF files you can use one of the following utility + +### Comparepdf ### + +comparepdf is a command line application used to compare two PDF files.The default comparison mode is text mode where the text of each corresponding pair of pages is compared. As soon as a difference is detected the program terminates with a message (unless -v0 is set) and an indicative return code. + +The OPTIONS are -ct or --compare=text (the default) for text mode comparisons or -ca or --compare=appearance for visual comparisons (useful if diagrams or other images have changed), and -v=1 or --verbose=1 for reporting differences (and saying nothing for matching files): use -v=0 for no reporting or -v=2 for reporting both different and matching files. + +### Install Comparepdf on ubuntu ### + +Open the terminal and run the following command + + sudo apt-get install comparepdf + +**Comparepdf syntax** + + comparepdf [OPTIONS] file1.pdf file2.pdf + +**Diffpdf** + +DiffPDF is a GUI application used to compare two PDF files.By default the comparison is of the text on each pair of pages, but comparing the visual appearance of pages is also supported (for example, if a diagram is changed or if a paragraph is reformatted). It is also possible to compare pticular pages or page ranges. For example, if there are two versions of a PDF file, one with pages 1-12 and the other with pages 1-13 because of an extra page having been added as page 4, they can be compared by specifying two page ranges, 1-12 for the first and 1-3, 5-13 for the second. This will make DiffPDF compare pages in the pairs (1, 1), (2, 2), (3, 3), (4, 5), (5, 6), and so on, to (12, 13). + +### Install diffpdf on ubuntu ### + +Open the terminal and run the following command + + sudo apt-get install diffpdf + +### Screenshots ### + +![](http://www.ubuntugeek.com/wp-content/uploads/2015/07/14.png) + +![](http://www.ubuntugeek.com/wp-content/uploads/2015/07/23.png) + +-------------------------------------------------------------------------------- + +via: http://www.ubuntugeek.com/compare-pdf-files-on-ubuntu.html + +作者:[ruchi][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.ubuntugeek.com/author/ubuntufix \ No newline at end of file diff --git a/sources/tech/20150730 Must-Know Linux Commands For New Users.md b/sources/tech/20150730 Must-Know Linux Commands For New Users.md new file mode 100644 index 0000000000..ea21c001e0 --- /dev/null +++ b/sources/tech/20150730 Must-Know Linux Commands For New Users.md @@ -0,0 +1,185 @@ +Must-Know Linux Commands For New Users +================================================================================ +![Manage system updates via the command line with dnf on Fedora.](http://www.linux.com/images/stories/41373/fedora-cli.png) +Manage system updates via the command line with dnf on Fedora. + +One of the beauties of Linux-based systems is that you can manage your entire system right from the terminal using the command line. The advantage of using the command line is that you can use the same knowledge and skills to manage any Linux distribution. + +This is not possible through the graphical user interface (GUI) as each distro, and desktop environment (DE), offers its own user interfaces. To be clear, there are cases in which you will need different commands to perform certain tasks on different distributions, but more or less the concept and ideas remain the same. + +In this article, we are going to talk about some of the basic commands that a new Linux user should know. I will show you how to update your system, manage software, manipulate files and switch to root using the command line on three major distributions: Ubuntu (which also includes its flavors and derivatives, and Debian), openSUSE and Fedora. + +*Let's get started!* + +### Keep your system safe and up-to-date ### + +Linux is secure by design, but the fact is that all software has bugs and there could be security holes. So it's very important to keep your system updated. Think of it this way: Running an out-of-date operating system is like being in an armored tank with the doors unlocked. Will the armor protect you? Anyone can enter through the open doors and cause harm. Similarly there can be un-patched holes in your OS which can compromise your systems. Open source communities, unlike the proprietary world, are extremely quick at patching holes, so if you keep your system updated you'll stay safe. + +Keep an eye on news sites to be aware of security vulnerabilities. If there is a hole discovered, read about it and update your system as soon as a patch is out. Either way you must make it a practice to run the update commands at least once a week on production machines. If you are running a complicated server then be extra careful and go through the changelog to ensure updates won't break your customization. + +**Ubuntu**: Bear one thing in mind: you must always refresh repositories (aka repos) before upgrading the system or installing any software. On Ubuntu, you can update your system with the following commands. The first command refreshes repositories: + + sudo apt-get update + +Once the repos are updated you can now run the system update command: + + sudo apt-get upgrade + +However this command doesn't update the kernel and some other packages, so you must also run this command: + + sudo apt-get dist-upgrade + +**openSUSE**: If you are on openSUSE, you can update the system using these commands (as usual, the first command is meant to update repos) + + sudo zypper refresh + sudo zypper up + +**Fedora**: If you are on Fedora, you can use the 'dnf' command which is 'kind' of equivalent to zypper and apt-get: + + sudo dnf update + sudo dnf upgrade + +### Software installation and removal ### + +You can install only those packages which are available in the repositories enabled on your system. Every distro comes with some official or third-party repos enabled by default. + +**Ubuntu**: To install any package on Ubuntu, first update the repo and then use this syntax: + + sudo apt-get install [package_name] + +Example: + + sudo apt-get install gimp + +**openSUSE**: The commands would be: + + sudo zypper install [package_name] + +**Fedora**: Fedora has dropped 'yum' and now uses 'dnf' so the command would be: + + sudo dnf install [package_name] + +The procedure to remove the software is the same, just exchange 'install' with 'remove'. + +**Ubuntu**: + + sudo apt-get remove [package_name] + +**openSUSE**: + + sudo zypper remove [package_name] + +**Fedora**: + + sudo dnf remove [package_name] + +### How to manage third party software? ### + +There is a huge community of developers who offer their software to users. Different distributions use different mechanisms to make third party software available to their users. It also depends on how a developer offers their software to users; some offer binaries and others offer it through repositories. + +Ubuntu heavily relies on PPAs (personal package archives) but, unfortunately, there is no built-in tool which can assist a user in searching PPAs. You will need to Google the PPA and then add the repository manually before installing the software. This is how you would add any PPA to your system: + + sudo add-apt-repository ppa: + +Example: Let's say I want to add LibreOffice PPA to my system. I would Google the PPA and then acquire the repo name from Launchpad, which in this case is "libreoffice/ppa". Then add the ppa using the following command: + + sudo add-apt-repository ppa:libreoffice/ppa + +It will ask you to hit the Enter key in order to import the keys. Once it's done, refresh the repos with the 'update' command and then install the package. + +openSUSE has an elegant solution for third-party apps. You can visit software.opensuse.org, search for the package and install it with one click. It will automatically add the repo to your system. If you want to add any repo manually, use this command:. + + sudo zypper ar -f url_of_the_repo name_of_repo + sudo zypper ar -f http://download.opensuse.org/repositories/LibreOffice:Factory/openSUSE_13.2/LibreOffice:Factory.repo LOF + +Then refresh the repo and install software: + + sudo zypper refresh + sudo zypper install libreoffice + +Fedora users can simply add RPMFusion (both free and non-free repos) which contain a majority of applications. In case you do need to add a repo, this is the command: + +dnf config-manager --add-repo http://www.example.com/example.repo + +### Some basic commands ### + +I have written a few [articles][1] on how to manage files on your system using the CLI, here are some of the basic commands which are common across all distributions. + +Copy files or directories to a new location: + + cp path_of_file_1 path_of_the_directory_where_you_want_to_copy/ + +Copy all files from a directory to a new location (notice the slash and asterisk, which implies all files within that directory): + + cp path_of_files/* path_of_the_directory_where_you_want_to_copy/ + +Move a file from one location to another (the trailing slash means inside that directory): + + mv path_of_file_1 path_of_the_directory_where_you_want_to_move/ + +Move all file from one location to another: + + mv path_of_directory_where_files_are/* path_of_the_directory_where_you_want_to_move/ + +Delete a file: + + rm path_of_file + +Delete a directory: + + rm -r path_of_directory + +Remove all content from the directory, leaving the directory folder intact: + + rm -r path_of_directory/* + +### Create new directory ### + +To create a new directory, first enter the location where you want to create a directory. Let's say you want to create a 'foundation' folder inside your Documents directory. Let's change the directory using the cd (aka change directory) command: + + cd /home/swapnil/Documents + +(exchange 'swapnil with the user on your system) + +Then create the directory with mkdir command: + + mkdir foundation + +You can also create a directory from anywhere, by giving the path of the directory. For example: + + mdkir /home/swapnil/Documents/foundation + +If you want to create parent-child directories, which means directories within other directories then use the -p option. It will create all directories in the given path: + + mdkir -p /home/swapnil/Documents/linux/foundation + +### Become root ### + +You either need to be root or the user should have sudo powers to perform some administrative tasks such as managing packages or making changes to the root directories or files. An example would be to edit the 'fstab' file which keeps a record of mounted hard drives. It's inside the 'etc' directory which is within the root directory. You can make changes to this file only as a super user. In most distros you can become root by 'switching user'. Let's say on openSUSE I want to become root as I am going to work inside the root directory. You can use either command: + + sudo su - + +Or + + su - + +That will ask for the password and then you will have root privileges. Keep one point in mind: never run your system as root user unless you know what you are doing. Another important point to note is that the files or directories you modify as root also change ownership of those files from that user or specific service to root. You may have to revert the ownership of those files otherwise the services or users won't be able to to access or write to those files. To change users, this is the command: + + sudo chown -R user:user /path_of_file_or_directory + +You may often need this when you have partitions from other distros mounted on the system. When you try to access files on such partitions, you may come across a permission denied error. You can simply change the ownership of such partitions to access them. Just be extra careful, don't change permissions or ownership of root directories. + +These are the basic commands any new Linux user needs. If you have any questions or if you want us to cover a specific topic, please mention them in the comments below. + +-------------------------------------------------------------------------------- + +via: http://www.linux.com/learn/tutorials/842251-must-know-linux-commands-for-new-users + +作者:[Swapnil Bhartiya][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.linux.com/community/forums/person/61003 +[1]:http://www.linux.com/learn/tutorials/828027-how-to-manage-your-files-from-the-command-line \ No newline at end of file From 29c54a558a994752cf69ae812866e79eab6ea135 Mon Sep 17 00:00:00 2001 From: wxy Date: Thu, 30 Jul 2015 21:03:28 +0800 Subject: [PATCH 737/965] PUB:20150505 How to Manage 'Systemd' Services and Units Using 'Systemctl' in Linux @GOLinux --- ...es and Units Using 'Systemctl' in Linux.md | 33 +++++++++---------- 1 file changed, 16 insertions(+), 17 deletions(-) rename {translated/tech => published}/20150505 How to Manage 'Systemd' Services and Units Using 'Systemctl' in Linux.md (95%) diff --git a/translated/tech/20150505 How to Manage 'Systemd' Services and Units Using 'Systemctl' in Linux.md b/published/20150505 How to Manage 'Systemd' Services and Units Using 'Systemctl' in Linux.md similarity index 95% rename from translated/tech/20150505 How to Manage 'Systemd' Services and Units Using 'Systemctl' in Linux.md rename to published/20150505 How to Manage 'Systemd' Services and Units Using 'Systemctl' in Linux.md index a78dc01820..e8b8466f90 100644 --- a/translated/tech/20150505 How to Manage 'Systemd' Services and Units Using 'Systemctl' in Linux.md +++ b/published/20150505 How to Manage 'Systemd' Services and Units Using 'Systemctl' in Linux.md @@ -1,13 +1,14 @@ -在Linux中使用‘Systemctl’管理‘Systemd’服务和单元 +systemctl 完全指南 ================================================================================ Systemctl是一个systemd工具,主要负责控制systemd系统和服务管理器。 Systemd是一个系统管理守护进程、工具和库的集合,用于取代System V初始进程。Systemd的功能是用于集中管理和配置类UNIX系统。 -在Linux生态系统中,Systemd被部署到了大多数的标准Linux发行版中,只有位数不多的几个尚未部署。Systemd通常是所有其它守护进程的父进程,但并非总是如此。 +在Linux生态系统中,Systemd被部署到了大多数的标准Linux发行版中,只有为数不多的几个发行版尚未部署。Systemd通常是所有其它守护进程的父进程,但并非总是如此。 ![Manage Linux Services Using Systemctl](http://www.tecmint.com/wp-content/uploads/2015/04/Manage-Linux-Services-Using-Systemctl.jpg) -使用Systemctl管理Linux服务 + +*使用Systemctl管理Linux服务* 本文旨在阐明在运行systemd的系统上“如何控制系统和服务”。 @@ -41,11 +42,9 @@ Systemd是一个系统管理守护进程、工具和库的集合,用于取代S root 555 1 0 16:27 ? 00:00:00 /usr/lib/systemd/systemd-logind dbus 556 1 0 16:27 ? 00:00:00 /bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation -**注意**:systemd是作为父进程(PID=1)运行的。在上面带(-e)参数的ps命令输出中,选择所有进程,(- +**注意**:systemd是作为父进程(PID=1)运行的。在上面带(-e)参数的ps命令输出中,选择所有进程,(-a)选择除会话前导外的所有进程,并使用(-f)参数输出完整格式列表(即 -eaf)。 -a)选择除会话前导外的所有进程,并使用(-f)参数输出完整格式列表(如 -eaf)。 - -也请注意上例中后随的方括号和样例剩余部分。方括号表达式是grep的字符类表达式的一部分。 +也请注意上例中后随的方括号和例子中剩余部分。方括号表达式是grep的字符类表达式的一部分。 #### 4. 分析systemd启动进程 #### @@ -147,7 +146,7 @@ a)选择除会话前导外的所有进程,并使用(-f)参数输出完 1 loaded units listed. Pass --all to see loaded but inactive units, too. To show all installed unit files use 'systemctl list-unit-files'. -#### 10. 检查某个单元(cron.service)是否启用 #### +#### 10. 检查某个单元(如 cron.service)是否启用 #### # systemctl is-enabled crond.service @@ -187,7 +186,7 @@ a)选择除会话前导外的所有进程,并使用(-f)参数输出完 dbus-org.fedoraproject.FirewallD1.service enabled .... -#### 13. Linux中如何启动、重启、停止、重载服务以及检查服务(httpd.service)状态 #### +#### 13. Linux中如何启动、重启、停止、重载服务以及检查服务(如 httpd.service)状态 #### # systemctl start httpd.service # systemctl restart httpd.service @@ -214,15 +213,15 @@ a)选择除会话前导外的所有进程,并使用(-f)参数输出完 Apr 28 17:21:30 tecmint systemd[1]: Started The Apache HTTP Server. Hint: Some lines were ellipsized, use -l to show in full. -**注意**:当我们使用systemctl的start,restart,stop和reload命令时,我们不会不会从终端获取到任何输出内容,只有status命令可以打印输出。 +**注意**:当我们使用systemctl的start,restart,stop和reload命令时,我们不会从终端获取到任何输出内容,只有status命令可以打印输出。 -#### 14. 如何激活服务并在启动时启用或禁用服务(系统启动时自动启动服务) #### +#### 14. 如何激活服务并在启动时启用或禁用服务(即系统启动时自动启动服务) #### # systemctl is-active httpd.service # systemctl enable httpd.service # systemctl disable httpd.service -#### 15. 如何屏蔽(让它不能启动)或显示服务(httpd.service) #### +#### 15. 如何屏蔽(让它不能启动)或显示服务(如 httpd.service) #### # systemctl mask httpd.service ln -s '/dev/null' '/etc/systemd/system/httpd.service' @@ -297,7 +296,7 @@ a)选择除会话前导外的所有进程,并使用(-f)参数输出完 # systemctl enable tmp.mount # systemctl disable tmp.mount -#### 20. 在Linux中屏蔽(让它不能启动)或显示挂载点 #### +#### 20. 在Linux中屏蔽(让它不能启用)或可见挂载点 #### # systemctl mask tmp.mount @@ -375,7 +374,7 @@ a)选择除会话前导外的所有进程,并使用(-f)参数输出完 CPUShares=2000 -**注意**:当你为某个服务设置CPUShares,会自动创建一个以服务名命名的目录(httpd.service),里面包含了一个名为90-CPUShares.conf的文件,该文件含有CPUShare限制信息,你可以通过以下方式查看该文件: +**注意**:当你为某个服务设置CPUShares,会自动创建一个以服务名命名的目录(如 httpd.service),里面包含了一个名为90-CPUShares.conf的文件,该文件含有CPUShare限制信息,你可以通过以下方式查看该文件: # vi /etc/systemd/system/httpd.service.d/90-CPUShares.conf @@ -528,13 +527,13 @@ a)选择除会话前导外的所有进程,并使用(-f)参数输出完 #### 35. 启动运行等级5,即图形模式 #### # systemctl isolate runlevel5.target - OR + 或 # systemctl isolate graphical.target #### 36. 启动运行等级3,即多用户模式(命令行) #### # systemctl isolate runlevel3.target - OR + 或 # systemctl isolate multiuser.target #### 36. 设置多用户模式或图形模式为默认运行等级 #### @@ -572,7 +571,7 @@ via: http://www.tecmint.com/manage-services-using-systemd-and-systemctl-in-linux 作者:[Avishek Kumar][a] 译者:[GOLinux](https://github.com/GOLinux) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From dc8ba02e754ba942f2b89627d05a4044aa97e7af Mon Sep 17 00:00:00 2001 From: joeren Date: Fri, 31 Jul 2015 08:11:39 +0800 Subject: [PATCH 738/965] Update 20150730 Compare PDF Files on Ubuntu.md --- sources/tech/20150730 Compare PDF Files on Ubuntu.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150730 Compare PDF Files on Ubuntu.md b/sources/tech/20150730 Compare PDF Files on Ubuntu.md index 9612f0430e..6319508af5 100644 --- a/sources/tech/20150730 Compare PDF Files on Ubuntu.md +++ b/sources/tech/20150730 Compare PDF Files on Ubuntu.md @@ -1,3 +1,4 @@ +Translating by GOLinux! Compare PDF Files on Ubuntu ================================================================================ If you want to compare PDF files you can use one of the following utility @@ -44,4 +45,4 @@ via: http://www.ubuntugeek.com/compare-pdf-files-on-ubuntu.html 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 -[a]:http://www.ubuntugeek.com/author/ubuntufix \ No newline at end of file +[a]:http://www.ubuntugeek.com/author/ubuntufix From 2fe341d9fc32764011f35ecb459afbba39f066b4 Mon Sep 17 00:00:00 2001 From: GOLinux Date: Fri, 31 Jul 2015 08:41:12 +0800 Subject: [PATCH 739/965] [Translated]20150730 Compare PDF Files on Ubuntu.md --- .../20150730 Compare PDF Files on Ubuntu.md | 48 ------------------- .../20150730 Compare PDF Files on Ubuntu.md | 48 +++++++++++++++++++ 2 files changed, 48 insertions(+), 48 deletions(-) delete mode 100644 sources/tech/20150730 Compare PDF Files on Ubuntu.md create mode 100644 translated/tech/20150730 Compare PDF Files on Ubuntu.md diff --git a/sources/tech/20150730 Compare PDF Files on Ubuntu.md b/sources/tech/20150730 Compare PDF Files on Ubuntu.md deleted file mode 100644 index 6319508af5..0000000000 --- a/sources/tech/20150730 Compare PDF Files on Ubuntu.md +++ /dev/null @@ -1,48 +0,0 @@ -Translating by GOLinux! -Compare PDF Files on Ubuntu -================================================================================ -If you want to compare PDF files you can use one of the following utility - -### Comparepdf ### - -comparepdf is a command line application used to compare two PDF files.The default comparison mode is text mode where the text of each corresponding pair of pages is compared. As soon as a difference is detected the program terminates with a message (unless -v0 is set) and an indicative return code. - -The OPTIONS are -ct or --compare=text (the default) for text mode comparisons or -ca or --compare=appearance for visual comparisons (useful if diagrams or other images have changed), and -v=1 or --verbose=1 for reporting differences (and saying nothing for matching files): use -v=0 for no reporting or -v=2 for reporting both different and matching files. - -### Install Comparepdf on ubuntu ### - -Open the terminal and run the following command - - sudo apt-get install comparepdf - -**Comparepdf syntax** - - comparepdf [OPTIONS] file1.pdf file2.pdf - -**Diffpdf** - -DiffPDF is a GUI application used to compare two PDF files.By default the comparison is of the text on each pair of pages, but comparing the visual appearance of pages is also supported (for example, if a diagram is changed or if a paragraph is reformatted). It is also possible to compare pticular pages or page ranges. For example, if there are two versions of a PDF file, one with pages 1-12 and the other with pages 1-13 because of an extra page having been added as page 4, they can be compared by specifying two page ranges, 1-12 for the first and 1-3, 5-13 for the second. This will make DiffPDF compare pages in the pairs (1, 1), (2, 2), (3, 3), (4, 5), (5, 6), and so on, to (12, 13). - -### Install diffpdf on ubuntu ### - -Open the terminal and run the following command - - sudo apt-get install diffpdf - -### Screenshots ### - -![](http://www.ubuntugeek.com/wp-content/uploads/2015/07/14.png) - -![](http://www.ubuntugeek.com/wp-content/uploads/2015/07/23.png) - --------------------------------------------------------------------------------- - -via: http://www.ubuntugeek.com/compare-pdf-files-on-ubuntu.html - -作者:[ruchi][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.ubuntugeek.com/author/ubuntufix diff --git a/translated/tech/20150730 Compare PDF Files on Ubuntu.md b/translated/tech/20150730 Compare PDF Files on Ubuntu.md new file mode 100644 index 0000000000..3215caf23f --- /dev/null +++ b/translated/tech/20150730 Compare PDF Files on Ubuntu.md @@ -0,0 +1,48 @@ +Ubuntu上比较PDF文件 +================================================================================ + +如果你想要对PDF文件进行比较,你可以使用下面工具之一。 + +### Comparepdf ### + +comparepdf是一个命令行应用,用于将两个PDF文件进行对比。默认对比模式文本模式,该模式会对各对相关页面进行文字对比。只要一检测到差异,该程序就会终止,并显示一条信息(除非设置了-v0)和一个指示性的返回码。 + +用于文本模式对比的选项有 -ct 或 --compare=text(默认),用于视觉对比(这对图标或其它图像发生改变时很有用)的选项有 -ca 或 --compare=appearance。而 -v=1 或 --verbose=1 选项则用于报告差异(或者对匹配文件不作任何回应):使用 -v=0 选项取消报告,或者 -v=2 来同时报告不同的和匹配的文件。 + +### 安装comparepdf到Ubuntu ### + +打开终端,然后运行以下命令 + + sudo apt-get install comparepdf + +**Comparepdf 语法** + + comparepdf [OPTIONS] file1.pdf file2.pdf + +**Diffpdf** + +DiffPDF是一个图形化应用程序,用于对两个PDF文件进行对比。默认情况下,它只会对比两个相关页面的文字,但是也支持对图形化页面进行对比(例如,如果图表被修改过,或者段落被重新格式化过)。它也可以对特定的页面或者页面范围进行对比。例如,如果同一个PDF文件有两个版本,其中一个有页面1-12,而另一个则有页面1-13,因为这里添加了一个额外的页面4,它们可以通过指定两个页面范围来进行对比,第一个是1-12,而1-3,5-13则可以作为第二个页面范围。这将使得DiffPDF成对地对比这些页面(1,1),(2,2),(3,3),(4,5),(5,6),以此类推,直到(12,13)。 + +### 安装 diffpdf 到 ubuntu ### + +打开终端,然后运行以下命令 + + sudo apt-get install diffpdf + +### 截图 ### + +![](http://www.ubuntugeek.com/wp-content/uploads/2015/07/14.png) + +![](http://www.ubuntugeek.com/wp-content/uploads/2015/07/23.png) + +-------------------------------------------------------------------------------- + +via: http://www.ubuntugeek.com/compare-pdf-files-on-ubuntu.html + +作者:[ruchi][a] +译者:[GOLinux](https://github.com/GOLinux) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.ubuntugeek.com/author/ubuntufix From 26b3b9d09f839328314e3cf37fa56537ae6bb759 Mon Sep 17 00:00:00 2001 From: joeren Date: Fri, 31 Jul 2015 08:43:39 +0800 Subject: [PATCH 740/965] Update 20150730 Must-Know Linux Commands For New Users.md --- .../tech/20150730 Must-Know Linux Commands For New Users.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150730 Must-Know Linux Commands For New Users.md b/sources/tech/20150730 Must-Know Linux Commands For New Users.md index ea21c001e0..55f1b0dbfe 100644 --- a/sources/tech/20150730 Must-Know Linux Commands For New Users.md +++ b/sources/tech/20150730 Must-Know Linux Commands For New Users.md @@ -1,3 +1,4 @@ +Translating by GOLinux! Must-Know Linux Commands For New Users ================================================================================ ![Manage system updates via the command line with dnf on Fedora.](http://www.linux.com/images/stories/41373/fedora-cli.png) @@ -182,4 +183,4 @@ via: http://www.linux.com/learn/tutorials/842251-must-know-linux-commands-for-ne 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 [a]:http://www.linux.com/community/forums/person/61003 -[1]:http://www.linux.com/learn/tutorials/828027-how-to-manage-your-files-from-the-command-line \ No newline at end of file +[1]:http://www.linux.com/learn/tutorials/828027-how-to-manage-your-files-from-the-command-line From 0ba2c6878f0407180b357ef62e776996a3896903 Mon Sep 17 00:00:00 2001 From: struggling <630441839@qq.com> Date: Fri, 31 Jul 2015 10:11:58 +0800 Subject: [PATCH 741/965] Delete 20150717 How to collect NGINX metrics - Part 2.md --- ...7 How to collect NGINX metrics - Part 2.md | 239 ------------------ 1 file changed, 239 deletions(-) delete mode 100644 sources/tech/20150717 How to collect NGINX metrics - Part 2.md diff --git a/sources/tech/20150717 How to collect NGINX metrics - Part 2.md b/sources/tech/20150717 How to collect NGINX metrics - Part 2.md deleted file mode 100644 index eb627649a7..0000000000 --- a/sources/tech/20150717 How to collect NGINX metrics - Part 2.md +++ /dev/null @@ -1,239 +0,0 @@ -translation by strugglingyouth - -How to collect NGINX metrics - Part 2 -================================================================================ -![](http://www.datadoghq.com/wp-content/uploads/2015/07/NGINX_hero_2.png) - -### How to get the NGINX metrics you need ### - -How you go about capturing metrics depends on which version of NGINX you are using, as well as which metrics you wish to access. (See [the companion article][1] for an in-depth exploration of NGINX metrics.) Free, open-source NGINX and the commercial product NGINX Plus both have status modules that report metrics, and NGINX can also be configured to report certain metrics in its logs: - -注:表格 - ----- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MetricAvailability
NGINX (open-source)NGINX PlusNGINX logs
accepts / acceptedxx
handledxx
droppedxx
activexx
requests / totalxx
4xx codesxx
5xx codesxx
request timex
- -#### Metrics collection: NGINX (open-source) #### - -Open-source NGINX exposes several basic metrics about server activity on a simple status page, provided that you have the HTTP [stub status module][2] enabled. To check if the module is already enabled, run: - - nginx -V 2>&1 | grep -o with-http_stub_status_module - -The status module is enabled if you see with-http_stub_status_module as output in the terminal. - -If that command returns no output, you will need to enable the status module. You can use the --with-http_stub_status_module configuration parameter when [building NGINX from source][3]: - - ./configure \ - … \ - --with-http_stub_status_module - make - sudo make install - -After verifying the module is enabled or enabling it yourself, you will also need to modify your NGINX configuration to set up a locally accessible URL (e.g., /nginx_status) for the status page: - - server { - location /nginx_status { - stub_status on; - - access_log off; - allow 127.0.0.1; - deny all; - } - } - -Note: The server blocks of the NGINX config are usually found not in the master configuration file (e.g., /etc/nginx/nginx.conf) but in supplemental configuration files that are referenced by the master config. To find the relevant configuration files, first locate the master config by running: - - nginx -t - -Open the master configuration file listed, and look for lines beginning with include near the end of the http block, such as: - - include /etc/nginx/conf.d/*.conf; - -In one of the referenced config files you should find the main server block, which you can modify as above to configure NGINX metrics reporting. After changing any configurations, reload the configs by executing: - - nginx -s reload - -Now you can view the status page to see your metrics: - - Active connections: 24 - server accepts handled requests - 1156958 1156958 4491319 - Reading: 0 Writing: 18 Waiting : 6 - -Note that if you are trying to access the status page from a remote machine, you will need to whitelist the remote machine’s IP address in your status configuration, just as 127.0.0.1 is whitelisted in the configuration snippet above. - -The NGINX status page is an easy way to get a quick snapshot of your metrics, but for continuous monitoring you will need to automatically record that data at regular intervals. Parsers for the NGINX status page already exist for monitoring tools such as [Nagios][4] and [Datadog][5], as well as for the statistics collection daemon [collectD][6]. - -#### Metrics collection: NGINX Plus #### - -The commercial NGINX Plus provides [many more metrics][7] through its ngx_http_status_module than are available in open-source NGINX. Among the additional metrics exposed by NGINX Plus are bytes streamed, as well as information about upstream systems and caches. NGINX Plus also reports counts of all HTTP status code types (1xx, 2xx, 3xx, 4xx, 5xx). A sample NGINX Plus status board is available [here][8]. - -![NGINX Plus status board](https://d33tyra1llx9zy.cloudfront.net/blog/images/2015-06-nginx/status_plus-2.png) - -*Note: the “Active” connections on the NGINX Plus status dashboard are defined slightly differently than the Active state connections in the metrics collected via the open-source NGINX stub status module. In NGINX Plus metrics, Active connections do not include connections in the Waiting state (aka Idle connections).* - -NGINX Plus also reports [metrics in JSON format][9] for easy integration with other monitoring systems. With NGINX Plus, you can see the metrics and health status [for a given upstream grouping of servers][10], or drill down to get a count of just the response codes [from a single server][11] in that upstream: - - {"1xx":0,"2xx":3483032,"3xx":0,"4xx":23,"5xx":0,"total":3483055} - -To enable the NGINX Plus metrics dashboard, you can add a status server block inside the http block of your NGINX configuration. ([See the section above][12] on collecting metrics from open-source NGINX for instructions on locating the relevant config files.) For example, to set up a status dashboard at http://your.ip.address:8080/status.html and a JSON interface at http://your.ip.address:8080/status, you would add the following server block: - - server { - listen 8080; - root /usr/share/nginx/html; - - location /status { - status; - } - - location = /status.html { - } - } - -The status pages should be live once you reload your NGINX configuration: - - nginx -s reload - -The official NGINX Plus docs have [more details][13] on how to configure the expanded status module. - -#### Metrics collection: NGINX logs #### - -NGINX’s [log module][14] writes configurable access logs to a destination of your choosing. You can customize the format of your logs and the data they contain by [adding or subtracting variables][15]. The simplest way to capture detailed logs is to add the following line in the server block of your config file (see [the section][16] on collecting metrics from open-source NGINX for instructions on locating your config files): - - access_log logs/host.access.log combined; - -After changing any NGINX configurations, reload the configs by executing: - - nginx -s reload - -The “combined” log format, included by default, captures [a number of key data points][17], such as the actual HTTP request and the corresponding response code. In the example logs below, NGINX logged a 200 (success) status code for a request for /index.html and a 404 (not found) error for the nonexistent /fail. - - 127.0.0.1 - - [19/Feb/2015:12:10:46 -0500] "GET /index.html HTTP/1.1" 200 612 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.111 Safari 537.36" - - 127.0.0.1 - - [19/Feb/2015:12:11:05 -0500] "GET /fail HTTP/1.1" 404 570 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.111 Safari/537.36" - -You can log request processing time as well by adding a new log format to the http block of your NGINX config file: - - log_format nginx '$remote_addr - $remote_user [$time_local] ' - '"$request" $status $body_bytes_sent $request_time ' - '"$http_referer" "$http_user_agent"'; - -And by adding or modifying the access_log line in the server block of your config file: - - access_log logs/host.access.log nginx; - -After reloading the updated configs (by running nginx -s reload), your access logs will include response times, as seen below. The units are seconds, with millisecond resolution. In this instance, the server received a request for /big.pdf, returning a 206 (success) status code after sending 33973115 bytes. Processing the request took 0.202 seconds (202 milliseconds): - - 127.0.0.1 - - [19/Feb/2015:15:50:36 -0500] "GET /big.pdf HTTP/1.1" 206 33973115 0.202 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.111 Safari/537.36" - -You can use a variety of tools and services to parse and analyze NGINX logs. For instance, [rsyslog][18] can monitor your logs and pass them to any number of log-analytics services; you can use a free, open-source tool such as [logstash][19] to collect and analyze logs; or you can use a unified logging layer such as [Fluentd][20] to collect and parse your NGINX logs. - -### Conclusion ### - -Which NGINX metrics you monitor will depend on the tools available to you, and whether the insight provided by a given metric justifies the overhead of monitoring that metric. For instance, is measuring error rates important enough to your organization to justify investing in NGINX Plus or implementing a system to capture and analyze logs? - -At Datadog, we have built integrations with both NGINX and NGINX Plus so that you can begin collecting and monitoring metrics from all your web servers with a minimum of setup. Learn how to monitor NGINX with Datadog [in this post][21], and get started right away with a [free trial of Datadog][22]. - ----------- - -Source Markdown for this post is available [on GitHub][23]. Questions, corrections, additions, etc.? Please [let us know][24]. - --------------------------------------------------------------------------------- - -via: https://www.datadoghq.com/blog/how-to-collect-nginx-metrics/ - -作者:K Young -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[1]:https://www.datadoghq.com/blog/how-to-monitor-nginx/ -[2]:http://nginx.org/en/docs/http/ngx_http_stub_status_module.html -[3]:http://wiki.nginx.org/InstallOptions -[4]:https://exchange.nagios.org/directory/Plugins/Web-Servers/nginx -[5]:http://docs.datadoghq.com/integrations/nginx/ -[6]:https://collectd.org/wiki/index.php/Plugin:nginx -[7]:http://nginx.org/en/docs/http/ngx_http_status_module.html#data -[8]:http://demo.nginx.com/status.html -[9]:http://demo.nginx.com/status -[10]:http://demo.nginx.com/status/upstreams/demoupstreams -[11]:http://demo.nginx.com/status/upstreams/demoupstreams/0/responses -[12]:https://www.datadoghq.com/blog/how-to-collect-nginx-metrics/#open-source -[13]:http://nginx.org/en/docs/http/ngx_http_status_module.html#example -[14]:http://nginx.org/en/docs/http/ngx_http_log_module.html -[15]:http://nginx.org/en/docs/http/ngx_http_log_module.html#log_format -[16]:https://www.datadoghq.com/blog/how-to-collect-nginx-metrics/#open-source -[17]:http://nginx.org/en/docs/http/ngx_http_log_module.html#log_format -[18]:http://www.rsyslog.com/ -[19]:https://www.elastic.co/products/logstash -[20]:http://www.fluentd.org/ -[21]:https://www.datadoghq.com/blog/how-to-monitor-nginx-with-datadog/ -[22]:https://www.datadoghq.com/blog/how-to-collect-nginx-metrics/#sign-up -[23]:https://github.com/DataDog/the-monitor/blob/master/nginx/how_to_collect_nginx_metrics.md -[24]:https://github.com/DataDog/the-monitor/issues From 1d8b52392ab4df0d1aaeb22c601c5565a2434d66 Mon Sep 17 00:00:00 2001 From: struggling <630441839@qq.com> Date: Fri, 31 Jul 2015 10:14:58 +0800 Subject: [PATCH 742/965] Create How to collect NGINX metrics - Part 2 --- .../How to collect NGINX metrics - Part 2 | 237 ++++++++++++++++++ 1 file changed, 237 insertions(+) create mode 100644 translated/tech/How to collect NGINX metrics - Part 2 diff --git a/translated/tech/How to collect NGINX metrics - Part 2 b/translated/tech/How to collect NGINX metrics - Part 2 new file mode 100644 index 0000000000..848042bf2c --- /dev/null +++ b/translated/tech/How to collect NGINX metrics - Part 2 @@ -0,0 +1,237 @@ + +如何收集NGINX指标 - 第2部分 +================================================================================ +![](http://www.datadoghq.com/wp-content/uploads/2015/07/NGINX_hero_2.png) + +### 如何获取你所需要的NGINX指标 ### + +如何获取需要的指标取决于你正在使用的 NGINX 版本。(参见 [the companion article][1] 将深入探索NGINX指标。)免费,开源版的 NGINX 和商业版的 NGINX 都有指标度量的状态模块,NGINX 也可以在其日志中配置指标模块: + +注:表格 + +++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
MetricAvailability
NGINX (open-source)NGINX PlusNGINX logs
accepts / acceptedxx
handledxx
droppedxx
activexx
requests / totalxx
4xx codesxx
5xx codesxx
request timex
+ +#### 指标收集:NGINX(开源版) #### + +开源版的 NGINX 会显示几个与服务器状态有关的指标在状态页面上,只要你启用了 HTTP [stub status module][2] 。要检查模块是否被加载,运行以下命令: + + nginx -V 2>&1 | grep -o with-http_stub_status_module + +如果你看到 http_stub_status_module 被输出在终端,说明状态模块已启用。 + +如果该命令没有输出,你需要启用状态模块。你可以使用 --with-http_stub_status_module 参数去配置 [building NGINX from source][3]: + + ./configure \ + … \ + --with-http_stub_status_module + make + sudo make install + +验证模块已经启用或你自己启用它后,你还需要修改 NGINX 配置文件为状态页面设置本地访问的 URL(例如,/ nginx_status): + + server { + location /nginx_status { + stub_status on; + + access_log off; + allow 127.0.0.1; + deny all; + } + } + +注:nginx 配置中的 server 块通常并不在主配置文件中(例如,/etc/nginx/nginx.conf),但主配置中会加载补充的配置文件。要找到主配置文件,首先运行以下命令: + + nginx -t + +打开主配置文件,在以 http 模块结尾的附近查找以 include 开头的行包,如: + + include /etc/nginx/conf.d/*.conf; + +在所包含的配置文件中,你应该会找到主服务器模块,你可以如上所示修改 NGINX 的指标报告。更改任何配置后,通过执行以下命令重新加载配置文件: + + nginx -s reload + +现在,你可以查看指标的状态页: + + Active connections: 24 + server accepts handled requests + 1156958 1156958 4491319 + Reading: 0 Writing: 18 Waiting : 6 + +请注意,如果你正试图从远程计算机访问状态页面,则需要将远程计算机的 IP 地址添加到你的状态配置文件的白名单中,在上面的配置文件中 127.0.0.1 仅在白名单中。 + +nginx 的状态页面是一中查看指标快速又简单的方法,但当连续监测时,你需要每隔一段时间自动记录该数据。然后通过监控工具箱 [Nagios][4] 或者 [Datadog][5],以及收集统计信息的服务 [collectD][6] 来分析已保存的 NGINX 状态信息。 + +#### 指标收集: NGINX Plus #### + +商业版的 NGINX Plus 通过 ngx_http_status_module 提供的可用指标比开源版 NGINX 更多 [many more metrics][7] 。NGINX Plus 附加了更多的字节流指标,以及负载均衡系统和高速缓存的信息。NGINX Plus 还报告所有的 HTTP 状态码类型(1XX,2XX,3XX,4XX,5XX)的计数。一个简单的 NGINX Plus 状态报告 [here][8]。 + +![NGINX Plus status board](https://d33tyra1llx9zy.cloudfront.net/blog/images/2015-06-nginx/status_plus-2.png) + +*注: NGINX Plus 在状态仪表盘"Active”连接定义的收集指标的状态模块和开源 NGINX 的略有不同。在 NGINX Plus 指标中,活动连接不包括等待状态(又叫空闲连接)连接。* + +NGINX Plus 也集成了其他监控系统的报告 [JSON格式指标][9] 。用 NGINX Plus 时,你可以看到 [负载均衡服务器组的][10]指标和健康状况,或着再向下能取得的仅是响应代码计数[从单个服务器][11]在负载均衡服务器中: + {"1xx":0,"2xx":3483032,"3xx":0,"4xx":23,"5xx":0,"total":3483055} + +启动 NGINX Plus 指标仪表盘,你可以在 NGINX 配置文件的 http 块内添加状态 server 块。 ([参见上一页][12]查找相关的配置文件,收集开源 NGINX 版指标的说明。)例如,设立以下一个状态仪表盘在http://your.ip.address:8080/status.html 和一个 JSON 接口 http://your.ip.address:8080/status,可以添加以下 server block 来设定: + + server { + listen 8080; + root /usr/share/nginx/html; + + location /status { + status; + } + + location = /status.html { + } + } + +一旦你重新加载 NGINX 配置,状态页就会被加载: + + nginx -s reload + +关于如何配置扩展状态模块,官方 NGINX Plus 文档有 [详细介绍][13] 。 + +#### 指标收集:NGINX日志 #### + +NGINX 的 [日志模块][14] 写到配置可以自定义访问日志到指定文件。你可以自定义日志的格式和时间通过 [添加或移除变量][15]。捕获日志的详细信息,最简单的方法是添加下面一行在你配置文件的server 块中(参见[此节][16] 通过加载配置文件的信息来收集开源 NGINX 的指标): + + access_log logs/host.access.log combined; + +更改 NGINX 配置文件后,必须要重新加载配置文件: + + nginx -s reload + +“combined” 的日志格式,只包含默认参数,包括[一些关键数据][17],如实际的 HTTP 请求和相应的响应代码。在下面的示例日志中,NGINX 记录了200(成功)状态码当请求 /index.html 时和404(未找到)错误不存在的请求文件 /fail。 + + 127.0.0.1 - - [19/Feb/2015:12:10:46 -0500] "GET /index.html HTTP/1.1" 200 612 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.111 Safari 537.36" + + 127.0.0.1 - - [19/Feb/2015:12:11:05 -0500] "GET /fail HTTP/1.1" 404 570 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.111 Safari/537.36" + +你可以记录请求处理的时间通过添加一个新的日志格式在 NGINX 配置文件中的 http 块: + + log_format nginx '$remote_addr - $remote_user [$time_local] ' + '"$request" $status $body_bytes_sent $request_time ' + '"$http_referer" "$http_user_agent"'; + +通过修改配置文件中 server 块的 access_log 行: + + access_log logs/host.access.log nginx; + +重新加载配置文件(运行 nginx -s reload)后,你的访问日志将包括响应时间,如下图所示。单位为秒,毫秒。在这种情况下,服务器接收 /big.pdf 的请求时,发送33973115字节后返回206(成功)状态码。处理请求用时0.202秒(202毫秒): + + 127.0.0.1 - - [19/Feb/2015:15:50:36 -0500] "GET /big.pdf HTTP/1.1" 206 33973115 0.202 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.111 Safari/537.36" + +你可以使用各种工具和服务来收集和分析 NGINX 日志。例如,[rsyslog][18] 可以监视你的日志,并将其传递给多个日志分析服务;你也可以使用免费的开源工具,如[logstash][19]来收集和分析日志;或者你可以使用一个统一日志记录层,如[Fluentd][20]来收集和分析你的 NGINX 日志。 + +### 结论 ### + +监视 NGINX 的哪一项指标将取决于你提供的工具,以及是否由给定指标证明监控指标的开销。例如,通过收集和分析日志来定位问题是非常重要的在 NGINX Plus 或者 运行的系统中。 + +在 Datadog 中,我们已经集成了 NGINX 和 NGINX Plus,这样你就可以以最小的设置来收集和监控所有 Web 服务器的指标。了解如何用 NGINX Datadog来监控 [在本文中][21],并开始使用 [免费的Datadog][22]。 + +---------- + +原文在这 [on GitHub][23]。问题,更正,补充等?请[让我们知道][24]。 + +-------------------------------------------------------------------------------- + +via: https://www.datadoghq.com/blog/how-to-collect-nginx-metrics/ + +作者:K Young +译者:[strugglingyouth](https://github.com/strugglingyouth) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[1]:https://www.datadoghq.com/blog/how-to-monitor-nginx/ +[2]:http://nginx.org/en/docs/http/ngx_http_stub_status_module.html +[3]:http://wiki.nginx.org/InstallOptions +[4]:https://exchange.nagios.org/directory/Plugins/Web-Servers/nginx +[5]:http://docs.datadoghq.com/integrations/nginx/ +[6]:https://collectd.org/wiki/index.php/Plugin:nginx +[7]:http://nginx.org/en/docs/http/ngx_http_status_module.html#data +[8]:http://demo.nginx.com/status.html +[9]:http://demo.nginx.com/status +[10]:http://demo.nginx.com/status/upstreams/demoupstreams +[11]:http://demo.nginx.com/status/upstreams/demoupstreams/0/responses +[12]:https://www.datadoghq.com/blog/how-to-collect-nginx-metrics/#open-source +[13]:http://nginx.org/en/docs/http/ngx_http_status_module.html#example +[14]:http://nginx.org/en/docs/http/ngx_http_log_module.html +[15]:http://nginx.org/en/docs/http/ngx_http_log_module.html#log_format +[16]:https://www.datadoghq.com/blog/how-to-collect-nginx-metrics/#open-source +[17]:http://nginx.org/en/docs/http/ngx_http_log_module.html#log_format +[18]:http://www.rsyslog.com/ +[19]:https://www.elastic.co/products/logstash +[20]:http://www.fluentd.org/ +[21]:https://www.datadoghq.com/blog/how-to-monitor-nginx-with-datadog/ +[22]:https://www.datadoghq.com/blog/how-to-collect-nginx-metrics/#sign-up +[23]:https://github.com/DataDog/the-monitor/blob/master/nginx/how_to_collect_nginx_metrics.md +[24]:https://github.com/DataDog/the-monitor/issues From 059f098f30616efcd0809e7f157a2d2d1277c008 Mon Sep 17 00:00:00 2001 From: struggling <630441839@qq.com> Date: Fri, 31 Jul 2015 10:23:53 +0800 Subject: [PATCH 743/965] Delete 20150728 Tips to Create ISO from CD, Watch User Activity and Check Memory Usages of Browser.md --- ...vity and Check Memory Usages of Browser.md | 130 ------------------ 1 file changed, 130 deletions(-) delete mode 100644 sources/tech/20150728 Tips to Create ISO from CD, Watch User Activity and Check Memory Usages of Browser.md diff --git a/sources/tech/20150728 Tips to Create ISO from CD, Watch User Activity and Check Memory Usages of Browser.md b/sources/tech/20150728 Tips to Create ISO from CD, Watch User Activity and Check Memory Usages of Browser.md deleted file mode 100644 index 2219e5e25e..0000000000 --- a/sources/tech/20150728 Tips to Create ISO from CD, Watch User Activity and Check Memory Usages of Browser.md +++ /dev/null @@ -1,130 +0,0 @@ -translation by strugglingyouth -Tips to Create ISO from CD, Watch User Activity and Check Memory Usages of Browser -================================================================================ -Here again, I have written another post on [Linux Tips and Tricks][1] series. Since beginning the objective of this post is to make you aware of those small tips and hacks that lets you manage your system/server efficiently. - -![Create Cdrom ISO Image and Monitor Users in Linux](http://www.tecmint.com/wp-content/uploads/2015/07/creating-cdrom-iso-watch-users-in-linux.jpg) - -Create Cdrom ISO Image and Monitor Users in Linux - -In this post we will see how to create ISO image from the contents of CD/DVD loaded in the drive, Open random man pages for learning, know details of other logged-in users and what they are doing and monitoring the memory usages of a browser, and all these using native tools/commands without any third-party application/utility. Here we go… - -### Create ISO image from a CD ### - -Often we need to backup/copy the content of CD/DVD. If you are on Linux platform you do not need any additional software. All you need is the access to Linux console. - -To create ISO image of the files in your CD/DVD ROM, you need two things. The first thing is you need to find the name of your CD/DVD drive. To find the name of your CD/DVD drive, you may choose any of the below three methods. - -**1. Run command lsblk (list block devices) from your terminal/console.** - - $ lsblk - -![Find Block Devices in Linux](http://www.tecmint.com/wp-content/uploads/2015/07/Find-Block-Devices.png) - -Find Block Devices - -**2. To see information about CD-ROM, you may use commands like less or more.** - - $ less /proc/sys/dev/cdrom/info - -![Check Cdrom Information](http://www.tecmint.com/wp-content/uploads/2015/07/Check-Cdrom-Inforamtion.png) - -Check Cdrom Information - -**3. You may get the same information from [dmesg command][2] and customize the output using egrep.** - -The command ‘dmesg‘ print/control the kernel buffer ring. ‘egrep‘ command is used to print lines that matches a pattern. Option -i and –color with egrep is used to ignore case sensitive search and highlight the matching string respectively. - - $ dmesg | egrep -i --color 'cdrom|dvd|cd/rw|writer' - -![Find Device Information](http://www.tecmint.com/wp-content/uploads/2015/07/Find-Device-Information.png) - -Find Device Information - -Once you know the name of your CD/DVD, you can use following command to create a ISO image of your cdrom in Linux. - - $ cat /dev/sr0 > /path/to/output/folder/iso_name.iso - -Here ‘sr0‘ is the name of my CD/DVD drive. You should replace this with the name of your CD/DVD. This will help you in creating ISO image and backup contents of CD/DVD without any third-party application. - -![Create ISO Image of CDROM in Linux](http://www.tecmint.com/wp-content/uploads/2015/07/Create-ISO-Image-of-CDROM.png) - -Create ISO Image of CDROM - -### Open a man page randomly for Reading ### - -If you are new to Linux and want to learn commands and switches, this tweak is for you. Put the below line of code at the end of your `~/.bashrc` file. - - /use/bin/man $(ls /bin | shuf | head -1) - -Remember to put the above one line script in users’s `.bashrc` file and not in the .bashrc file of root. So when the next you login either locally or remotely using SSH you will see a man page randomly opened for you to read. For the newbies who want to learn commands and command-line switches, this will prove helpful. - -Here is what I got in my terminal after logging in to session for two times back-to-back. - -![LoadKeys Man Pages](http://www.tecmint.com/wp-content/uploads/2015/07/LoadKeys-Man-Pages.png) - -LoadKeys Man Pages - -![Zgrep Man Pages](http://www.tecmint.com/wp-content/uploads/2015/07/Zgrep-Man-Pages.png) - -Zgrep Man Pages - -### Check Activity of Logged-in Users ### - -Know what other users are doing on your shared server. - -In most general case, either you are a user of Shared Linux Server or the Admin. If you are concerned about your server and want to check what other users are doing, you may try command ‘w‘. - -This command lets you know if someone is executing any malicious code or tampering the server, slowing it down or anything else. ‘w‘ is the preferred way of keeping an eye on logged on users and what they are doing. - -To see logged on users and what they re doing, run command ‘w’ from terminal, preferably as root. - - # w - -![Check Linux User Activity](http://www.tecmint.com/wp-content/uploads/2015/07/Check-Linux-User-Activity.png) - -Check Linux User Activity - -### Check Memory usages by Browser ### - -These days a lot of jokes are cracked on Google-chrome and its demand of memory. If you want to know the memory usages of a browser, you can list the name of the process, its PID and Memory usages of it. To check memory usages of a browser, just enter the “about:memory” in the address bar without quotes. - -I have tested it on Google-Chrome and Mozilla Firefox web browser. If you can check it on any other browser and it works well you may acknowledge us in the comments below. Also you may kill the browser process simply as if you have done for any Linux terminal process/service. - -In Google Chrome, type `about:memory` in address bar, you should get something similar to below image. - -![Check Chrome Memory Usage](http://www.tecmint.com/wp-content/uploads/2015/07/Check-Chrome-Memory-Usage.png) - -Check Chrome Memory Usage - -In Mozilla Firefox, type `about:memory` in address bar, you should get something similar to below image. - -![Check Firefox Memory Usage](http://www.tecmint.com/wp-content/uploads/2015/07/Check-Firefox-Memory-Usage.png) - -Check Firefox Memory Usage - -Out of these options you may select any of them, if you understand what it is. To check memory usages, click the left most option ‘Measure‘. - -![Firefox Main Process](http://www.tecmint.com/wp-content/uploads/2015/07/Firefox-Main-Processes.png) - -Firefox Main Process - -It shows tree like process-memory usages by browser. - -That’s all for now. Hope all the above tips will help you at some point of time. If you have one (or more) tips/tricks that will help Linux Users to manage their Linux System/Server more efficiently ans is lesser known, you may like to share it with us. - -I’ll be here with another post soon, till then stay tuned and connected to TecMint. Provide us with your valuable feedback in the comments below. Like and share us and help us get spread. - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/creating-cdrom-iso-image-watch-user-activity-in-linux/ - -作者:[Avishek Kumar][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.tecmint.com/author/avishek/ -[1]:http://www.tecmint.com/tag/linux-tricks/ -[2]:http://www.tecmint.com/dmesg-commands/ From ad35cb507dd4985b31bcb82bd359776ca201be6b Mon Sep 17 00:00:00 2001 From: struggling <630441839@qq.com> Date: Fri, 31 Jul 2015 10:24:34 +0800 Subject: [PATCH 744/965] Delete 20150728 Tips to Create ISO from CD, Watch User Activity and Check Memory Usages of Browser.md --- ...vity and Check Memory Usages of Browser.md | 130 ------------------ 1 file changed, 130 deletions(-) delete mode 100644 sources/tech/20150728 Tips to Create ISO from CD, Watch User Activity and Check Memory Usages of Browser.md diff --git a/sources/tech/20150728 Tips to Create ISO from CD, Watch User Activity and Check Memory Usages of Browser.md b/sources/tech/20150728 Tips to Create ISO from CD, Watch User Activity and Check Memory Usages of Browser.md deleted file mode 100644 index 2219e5e25e..0000000000 --- a/sources/tech/20150728 Tips to Create ISO from CD, Watch User Activity and Check Memory Usages of Browser.md +++ /dev/null @@ -1,130 +0,0 @@ -translation by strugglingyouth -Tips to Create ISO from CD, Watch User Activity and Check Memory Usages of Browser -================================================================================ -Here again, I have written another post on [Linux Tips and Tricks][1] series. Since beginning the objective of this post is to make you aware of those small tips and hacks that lets you manage your system/server efficiently. - -![Create Cdrom ISO Image and Monitor Users in Linux](http://www.tecmint.com/wp-content/uploads/2015/07/creating-cdrom-iso-watch-users-in-linux.jpg) - -Create Cdrom ISO Image and Monitor Users in Linux - -In this post we will see how to create ISO image from the contents of CD/DVD loaded in the drive, Open random man pages for learning, know details of other logged-in users and what they are doing and monitoring the memory usages of a browser, and all these using native tools/commands without any third-party application/utility. Here we go… - -### Create ISO image from a CD ### - -Often we need to backup/copy the content of CD/DVD. If you are on Linux platform you do not need any additional software. All you need is the access to Linux console. - -To create ISO image of the files in your CD/DVD ROM, you need two things. The first thing is you need to find the name of your CD/DVD drive. To find the name of your CD/DVD drive, you may choose any of the below three methods. - -**1. Run command lsblk (list block devices) from your terminal/console.** - - $ lsblk - -![Find Block Devices in Linux](http://www.tecmint.com/wp-content/uploads/2015/07/Find-Block-Devices.png) - -Find Block Devices - -**2. To see information about CD-ROM, you may use commands like less or more.** - - $ less /proc/sys/dev/cdrom/info - -![Check Cdrom Information](http://www.tecmint.com/wp-content/uploads/2015/07/Check-Cdrom-Inforamtion.png) - -Check Cdrom Information - -**3. You may get the same information from [dmesg command][2] and customize the output using egrep.** - -The command ‘dmesg‘ print/control the kernel buffer ring. ‘egrep‘ command is used to print lines that matches a pattern. Option -i and –color with egrep is used to ignore case sensitive search and highlight the matching string respectively. - - $ dmesg | egrep -i --color 'cdrom|dvd|cd/rw|writer' - -![Find Device Information](http://www.tecmint.com/wp-content/uploads/2015/07/Find-Device-Information.png) - -Find Device Information - -Once you know the name of your CD/DVD, you can use following command to create a ISO image of your cdrom in Linux. - - $ cat /dev/sr0 > /path/to/output/folder/iso_name.iso - -Here ‘sr0‘ is the name of my CD/DVD drive. You should replace this with the name of your CD/DVD. This will help you in creating ISO image and backup contents of CD/DVD without any third-party application. - -![Create ISO Image of CDROM in Linux](http://www.tecmint.com/wp-content/uploads/2015/07/Create-ISO-Image-of-CDROM.png) - -Create ISO Image of CDROM - -### Open a man page randomly for Reading ### - -If you are new to Linux and want to learn commands and switches, this tweak is for you. Put the below line of code at the end of your `~/.bashrc` file. - - /use/bin/man $(ls /bin | shuf | head -1) - -Remember to put the above one line script in users’s `.bashrc` file and not in the .bashrc file of root. So when the next you login either locally or remotely using SSH you will see a man page randomly opened for you to read. For the newbies who want to learn commands and command-line switches, this will prove helpful. - -Here is what I got in my terminal after logging in to session for two times back-to-back. - -![LoadKeys Man Pages](http://www.tecmint.com/wp-content/uploads/2015/07/LoadKeys-Man-Pages.png) - -LoadKeys Man Pages - -![Zgrep Man Pages](http://www.tecmint.com/wp-content/uploads/2015/07/Zgrep-Man-Pages.png) - -Zgrep Man Pages - -### Check Activity of Logged-in Users ### - -Know what other users are doing on your shared server. - -In most general case, either you are a user of Shared Linux Server or the Admin. If you are concerned about your server and want to check what other users are doing, you may try command ‘w‘. - -This command lets you know if someone is executing any malicious code or tampering the server, slowing it down or anything else. ‘w‘ is the preferred way of keeping an eye on logged on users and what they are doing. - -To see logged on users and what they re doing, run command ‘w’ from terminal, preferably as root. - - # w - -![Check Linux User Activity](http://www.tecmint.com/wp-content/uploads/2015/07/Check-Linux-User-Activity.png) - -Check Linux User Activity - -### Check Memory usages by Browser ### - -These days a lot of jokes are cracked on Google-chrome and its demand of memory. If you want to know the memory usages of a browser, you can list the name of the process, its PID and Memory usages of it. To check memory usages of a browser, just enter the “about:memory” in the address bar without quotes. - -I have tested it on Google-Chrome and Mozilla Firefox web browser. If you can check it on any other browser and it works well you may acknowledge us in the comments below. Also you may kill the browser process simply as if you have done for any Linux terminal process/service. - -In Google Chrome, type `about:memory` in address bar, you should get something similar to below image. - -![Check Chrome Memory Usage](http://www.tecmint.com/wp-content/uploads/2015/07/Check-Chrome-Memory-Usage.png) - -Check Chrome Memory Usage - -In Mozilla Firefox, type `about:memory` in address bar, you should get something similar to below image. - -![Check Firefox Memory Usage](http://www.tecmint.com/wp-content/uploads/2015/07/Check-Firefox-Memory-Usage.png) - -Check Firefox Memory Usage - -Out of these options you may select any of them, if you understand what it is. To check memory usages, click the left most option ‘Measure‘. - -![Firefox Main Process](http://www.tecmint.com/wp-content/uploads/2015/07/Firefox-Main-Processes.png) - -Firefox Main Process - -It shows tree like process-memory usages by browser. - -That’s all for now. Hope all the above tips will help you at some point of time. If you have one (or more) tips/tricks that will help Linux Users to manage their Linux System/Server more efficiently ans is lesser known, you may like to share it with us. - -I’ll be here with another post soon, till then stay tuned and connected to TecMint. Provide us with your valuable feedback in the comments below. Like and share us and help us get spread. - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/creating-cdrom-iso-image-watch-user-activity-in-linux/ - -作者:[Avishek Kumar][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.tecmint.com/author/avishek/ -[1]:http://www.tecmint.com/tag/linux-tricks/ -[2]:http://www.tecmint.com/dmesg-commands/ From 6d077f1f911fb9810de044db8898ca2c9be3b5a9 Mon Sep 17 00:00:00 2001 From: struggling <630441839@qq.com> Date: Fri, 31 Jul 2015 10:25:36 +0800 Subject: [PATCH 745/965] Create Tips to Create ISO from CD, Watch User Activity and Check Memory Usages of Browser --- ...ctivity and Check Memory Usages of Browser | 131 ++++++++++++++++++ 1 file changed, 131 insertions(+) create mode 100644 translated/Tips to Create ISO from CD, Watch User Activity and Check Memory Usages of Browser diff --git a/translated/Tips to Create ISO from CD, Watch User Activity and Check Memory Usages of Browser b/translated/Tips to Create ISO from CD, Watch User Activity and Check Memory Usages of Browser new file mode 100644 index 0000000000..02805f62ff --- /dev/null +++ b/translated/Tips to Create ISO from CD, Watch User Activity and Check Memory Usages of Browser @@ -0,0 +1,131 @@ + +用 CD 创建 ISO,观察用户活动和检查浏览器内存的技巧 +================================================================================ +我已经写过 [Linux 提示和技巧][1] 系列的一篇文章。写这篇文章的目的是让你知道这些小技巧可以有效地管理你的系统/服务器。 + +![Create Cdrom ISO Image and Monitor Users in Linux](http://www.tecmint.com/wp-content/uploads/2015/07/creating-cdrom-iso-watch-users-in-linux.jpg) + +在Linux中创建 Cdrom ISO 镜像和监控用户 + +在这篇文章中,我们将看到如何使用 CD/DVD 驱动器中加载到的内容来创建 ISO 镜像,打开随机手册页学习,看到登录用户的详细情况和查看浏览器内存使用量,而所有这些完全使用本地工具/命令无任何第三方应用程序/组件。让我们开始吧... + +### 用 CD 中创建 ISO 映像 ### + +我们经常需要备份/复制 CD/DVD 的内容。如果你是在 Linux 平台上,不需要任何额外的软件。所有需要的是进入 Linux 终端。 + +要从 CD/DVD 上创建 ISO 镜像,你需要做两件事。第一件事就是需要找到CD/DVD 驱动器的名称。要找到 CD/DVD 驱动器的名称,可以使用以下三种方法。 + +**1. 从终端/控制台上运行 lsblk 命令(单个驱动器).** + + $ lsblk + +![Find Block Devices in Linux](http://www.tecmint.com/wp-content/uploads/2015/07/Find-Block-Devices.png) + +找驱动器 + +**2.要查看有关 CD-ROM 的信息,可以使用以下命令。** + + $ less /proc/sys/dev/cdrom/info + +![Check Cdrom Information](http://www.tecmint.com/wp-content/uploads/2015/07/Check-Cdrom-Inforamtion.png) + +检查 Cdrom 信息 + +**3. 使用 [dmesg 命令][2] 也会得到相同的信息,并使用 egrep 来自定义输出。** + +命令 ‘dmesg‘ 命令的输出/控制内核缓冲区信息。‘egrep‘ 命令输出匹配到的行。选项 -i 和 -color 与 egrep 连用时会忽略大小写,并高亮显示匹配的字符串。 + + $ dmesg | egrep -i --color 'cdrom|dvd|cd/rw|writer' + +![Find Device Information](http://www.tecmint.com/wp-content/uploads/2015/07/Find-Device-Information.png) + +查找设备信息 + +一旦知道 CD/DVD 的名称后,在 Linux 上你可以用下面的命令来创建 ISO 镜像。 + + $ cat /dev/sr0 > /path/to/output/folder/iso_name.iso + +这里的‘sr0‘是我的 CD/DVD 驱动器的名称。你应该用你的 CD/DVD 名称来代替。这将帮你创建 ISO 镜像并备份 CD/DVD 的内容无需任何第三方应用程序。 + +![Create ISO Image of CDROM in Linux](http://www.tecmint.com/wp-content/uploads/2015/07/Create-ISO-Image-of-CDROM.png) + +创建 CDROM 的 ISO 映像 + +### 随机打开一个手册页 ### + +如果你是 Linux 新人并想学习使用命令行开关,这个修改是为你做的。把下面的代码行添加在`〜/ .bashrc`文件的末尾。 + + /use/bin/man $(ls /bin | shuf | head -1) + +记得把上面一行脚本添加在用户的`.bashrc`文件中,而不是根目录的 .bashrc 文件。所以,当你下次登录本地或远程使用 SSH 时,你会看到一个随机打开的手册页供你阅读。对于想要学习命令行开关的新手,这被证明是有益的。 + +下面是在终端登录两次分别看到的。 + +![LoadKeys Man Pages](http://www.tecmint.com/wp-content/uploads/2015/07/LoadKeys-Man-Pages.png) + +LoadKeys 手册页 + +![Zgrep Man Pages](http://www.tecmint.com/wp-content/uploads/2015/07/Zgrep-Man-Pages.png) + +Zgrep 手册页 + +### 查看登录用户的状态 ### + +了解其他用户正在共享服务器上做什么。 + +一般情况下,你是共享的 Linux 服务器的用户或管理员的。如果你担心自己服务器的安全并想要查看哪些用户在做什么,你可以使用命令 'w'。 + +这个命令可以让你知道是否有人在执行恶意代码或篡改服务器,让他停下或使用其他方法。'w' 是查看登录用户状态的首选方式。 + +要查看登录的用户正在做什么,从终端运行命令“w”,最好是 root 用户。 + + # w + +![Check Linux User Activity](http://www.tecmint.com/wp-content/uploads/2015/07/Check-Linux-User-Activity.png) + +检查 Linux 用户状态 + +### 查看浏览器的内存使用状况 ### + +最近有不少谈论关于 Google-chrome 内存使用量。如果你想知道一个浏览器的内存用量,你可以列出进程名,PID 和它的使用情况。要检查浏览器的内存使用情况,只需在地址栏输入 “about:memory” 不要带引号。 + +我已经在 Google-Chrome 和 Mozilla 的 Firefox 网页浏览器进行了测试。你可以查看任何浏览器,如果它工作得很好,你可能会承认我们在下面的评论。你也可以杀死浏览器进程在 Linux 终端的进程/服务中。 + +在 Google Chrome 中,在地址栏输入 `about:memory`,你应该得到类似下图的东西。 + +![Check Chrome Memory Usage](http://www.tecmint.com/wp-content/uploads/2015/07/Check-Chrome-Memory-Usage.png) + +查看 Chrome 内存使用状况 + +在Mozilla Firefox浏览器,在地址栏输入 `about:memory`,你应该得到类似下图的东西。 + +![Check Firefox Memory Usage](http://www.tecmint.com/wp-content/uploads/2015/07/Check-Firefox-Memory-Usage.png) + +查看 Firefox 内存使用状况 + +如果你已经了解它是什么,除了这些选项。要检查内存用量,你也可以点击最左边的 ‘Measure‘ 选项。 + +![Firefox Main Process](http://www.tecmint.com/wp-content/uploads/2015/07/Firefox-Main-Processes.png) + +Firefox 主进程 + +它将通过浏览器树形展示进程内存使用量 + +目前为止就这样了。希望上述所有的提示将会帮助你。如果你有一个(或多个)技巧,分享给我们,将帮助 Linux 用户更有效地管理他们的 Linux 系统/服务器。 + +我会很快在这里发帖,到时候敬请关注。请在下面的评论里提供你的宝贵意见。喜欢请分享并帮助我们传播。 + + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/creating-cdrom-iso-image-watch-user-activity-in-linux/ + +作者:[Avishek Kumar][a] +译者:[strugglingyouth](https://github.com/strugglingyouth) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/avishek/ +[1]:http://www.tecmint.com/tag/linux-tricks/ +[2]:http://www.tecmint.com/dmesg-commands/ From 106b5e487e43838d84df99a557be5b9a6801b5ea Mon Sep 17 00:00:00 2001 From: GOLinux Date: Fri, 31 Jul 2015 10:54:26 +0800 Subject: [PATCH 746/965] [Translated]20150730 Must-Know Linux Commands For New Users.md --- ... Must-Know Linux Commands For New Users.md | 186 ------------------ ... Must-Know Linux Commands For New Users.md | 185 +++++++++++++++++ 2 files changed, 185 insertions(+), 186 deletions(-) delete mode 100644 sources/tech/20150730 Must-Know Linux Commands For New Users.md create mode 100644 translated/tech/20150730 Must-Know Linux Commands For New Users.md diff --git a/sources/tech/20150730 Must-Know Linux Commands For New Users.md b/sources/tech/20150730 Must-Know Linux Commands For New Users.md deleted file mode 100644 index 55f1b0dbfe..0000000000 --- a/sources/tech/20150730 Must-Know Linux Commands For New Users.md +++ /dev/null @@ -1,186 +0,0 @@ -Translating by GOLinux! -Must-Know Linux Commands For New Users -================================================================================ -![Manage system updates via the command line with dnf on Fedora.](http://www.linux.com/images/stories/41373/fedora-cli.png) -Manage system updates via the command line with dnf on Fedora. - -One of the beauties of Linux-based systems is that you can manage your entire system right from the terminal using the command line. The advantage of using the command line is that you can use the same knowledge and skills to manage any Linux distribution. - -This is not possible through the graphical user interface (GUI) as each distro, and desktop environment (DE), offers its own user interfaces. To be clear, there are cases in which you will need different commands to perform certain tasks on different distributions, but more or less the concept and ideas remain the same. - -In this article, we are going to talk about some of the basic commands that a new Linux user should know. I will show you how to update your system, manage software, manipulate files and switch to root using the command line on three major distributions: Ubuntu (which also includes its flavors and derivatives, and Debian), openSUSE and Fedora. - -*Let's get started!* - -### Keep your system safe and up-to-date ### - -Linux is secure by design, but the fact is that all software has bugs and there could be security holes. So it's very important to keep your system updated. Think of it this way: Running an out-of-date operating system is like being in an armored tank with the doors unlocked. Will the armor protect you? Anyone can enter through the open doors and cause harm. Similarly there can be un-patched holes in your OS which can compromise your systems. Open source communities, unlike the proprietary world, are extremely quick at patching holes, so if you keep your system updated you'll stay safe. - -Keep an eye on news sites to be aware of security vulnerabilities. If there is a hole discovered, read about it and update your system as soon as a patch is out. Either way you must make it a practice to run the update commands at least once a week on production machines. If you are running a complicated server then be extra careful and go through the changelog to ensure updates won't break your customization. - -**Ubuntu**: Bear one thing in mind: you must always refresh repositories (aka repos) before upgrading the system or installing any software. On Ubuntu, you can update your system with the following commands. The first command refreshes repositories: - - sudo apt-get update - -Once the repos are updated you can now run the system update command: - - sudo apt-get upgrade - -However this command doesn't update the kernel and some other packages, so you must also run this command: - - sudo apt-get dist-upgrade - -**openSUSE**: If you are on openSUSE, you can update the system using these commands (as usual, the first command is meant to update repos) - - sudo zypper refresh - sudo zypper up - -**Fedora**: If you are on Fedora, you can use the 'dnf' command which is 'kind' of equivalent to zypper and apt-get: - - sudo dnf update - sudo dnf upgrade - -### Software installation and removal ### - -You can install only those packages which are available in the repositories enabled on your system. Every distro comes with some official or third-party repos enabled by default. - -**Ubuntu**: To install any package on Ubuntu, first update the repo and then use this syntax: - - sudo apt-get install [package_name] - -Example: - - sudo apt-get install gimp - -**openSUSE**: The commands would be: - - sudo zypper install [package_name] - -**Fedora**: Fedora has dropped 'yum' and now uses 'dnf' so the command would be: - - sudo dnf install [package_name] - -The procedure to remove the software is the same, just exchange 'install' with 'remove'. - -**Ubuntu**: - - sudo apt-get remove [package_name] - -**openSUSE**: - - sudo zypper remove [package_name] - -**Fedora**: - - sudo dnf remove [package_name] - -### How to manage third party software? ### - -There is a huge community of developers who offer their software to users. Different distributions use different mechanisms to make third party software available to their users. It also depends on how a developer offers their software to users; some offer binaries and others offer it through repositories. - -Ubuntu heavily relies on PPAs (personal package archives) but, unfortunately, there is no built-in tool which can assist a user in searching PPAs. You will need to Google the PPA and then add the repository manually before installing the software. This is how you would add any PPA to your system: - - sudo add-apt-repository ppa: - -Example: Let's say I want to add LibreOffice PPA to my system. I would Google the PPA and then acquire the repo name from Launchpad, which in this case is "libreoffice/ppa". Then add the ppa using the following command: - - sudo add-apt-repository ppa:libreoffice/ppa - -It will ask you to hit the Enter key in order to import the keys. Once it's done, refresh the repos with the 'update' command and then install the package. - -openSUSE has an elegant solution for third-party apps. You can visit software.opensuse.org, search for the package and install it with one click. It will automatically add the repo to your system. If you want to add any repo manually, use this command:. - - sudo zypper ar -f url_of_the_repo name_of_repo - sudo zypper ar -f http://download.opensuse.org/repositories/LibreOffice:Factory/openSUSE_13.2/LibreOffice:Factory.repo LOF - -Then refresh the repo and install software: - - sudo zypper refresh - sudo zypper install libreoffice - -Fedora users can simply add RPMFusion (both free and non-free repos) which contain a majority of applications. In case you do need to add a repo, this is the command: - -dnf config-manager --add-repo http://www.example.com/example.repo - -### Some basic commands ### - -I have written a few [articles][1] on how to manage files on your system using the CLI, here are some of the basic commands which are common across all distributions. - -Copy files or directories to a new location: - - cp path_of_file_1 path_of_the_directory_where_you_want_to_copy/ - -Copy all files from a directory to a new location (notice the slash and asterisk, which implies all files within that directory): - - cp path_of_files/* path_of_the_directory_where_you_want_to_copy/ - -Move a file from one location to another (the trailing slash means inside that directory): - - mv path_of_file_1 path_of_the_directory_where_you_want_to_move/ - -Move all file from one location to another: - - mv path_of_directory_where_files_are/* path_of_the_directory_where_you_want_to_move/ - -Delete a file: - - rm path_of_file - -Delete a directory: - - rm -r path_of_directory - -Remove all content from the directory, leaving the directory folder intact: - - rm -r path_of_directory/* - -### Create new directory ### - -To create a new directory, first enter the location where you want to create a directory. Let's say you want to create a 'foundation' folder inside your Documents directory. Let's change the directory using the cd (aka change directory) command: - - cd /home/swapnil/Documents - -(exchange 'swapnil with the user on your system) - -Then create the directory with mkdir command: - - mkdir foundation - -You can also create a directory from anywhere, by giving the path of the directory. For example: - - mdkir /home/swapnil/Documents/foundation - -If you want to create parent-child directories, which means directories within other directories then use the -p option. It will create all directories in the given path: - - mdkir -p /home/swapnil/Documents/linux/foundation - -### Become root ### - -You either need to be root or the user should have sudo powers to perform some administrative tasks such as managing packages or making changes to the root directories or files. An example would be to edit the 'fstab' file which keeps a record of mounted hard drives. It's inside the 'etc' directory which is within the root directory. You can make changes to this file only as a super user. In most distros you can become root by 'switching user'. Let's say on openSUSE I want to become root as I am going to work inside the root directory. You can use either command: - - sudo su - - -Or - - su - - -That will ask for the password and then you will have root privileges. Keep one point in mind: never run your system as root user unless you know what you are doing. Another important point to note is that the files or directories you modify as root also change ownership of those files from that user or specific service to root. You may have to revert the ownership of those files otherwise the services or users won't be able to to access or write to those files. To change users, this is the command: - - sudo chown -R user:user /path_of_file_or_directory - -You may often need this when you have partitions from other distros mounted on the system. When you try to access files on such partitions, you may come across a permission denied error. You can simply change the ownership of such partitions to access them. Just be extra careful, don't change permissions or ownership of root directories. - -These are the basic commands any new Linux user needs. If you have any questions or if you want us to cover a specific topic, please mention them in the comments below. - --------------------------------------------------------------------------------- - -via: http://www.linux.com/learn/tutorials/842251-must-know-linux-commands-for-new-users - -作者:[Swapnil Bhartiya][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.linux.com/community/forums/person/61003 -[1]:http://www.linux.com/learn/tutorials/828027-how-to-manage-your-files-from-the-command-line diff --git a/translated/tech/20150730 Must-Know Linux Commands For New Users.md b/translated/tech/20150730 Must-Know Linux Commands For New Users.md new file mode 100644 index 0000000000..230cecf736 --- /dev/null +++ b/translated/tech/20150730 Must-Know Linux Commands For New Users.md @@ -0,0 +1,185 @@ +新手应知应会的Linux命令 +================================================================================ +![Manage system updates via the command line with dnf on Fedora.](http://www.linux.com/images/stories/41373/fedora-cli.png) +在Fedora上通过命令行使用dnf来管理系统更新 + +基于Linux的系统的优点之一,就是你可以通过终端中使用命令该ing来管理整个系统。使用命令行的优势在于,你可以使用相同的知识和技能来管理随便哪个Linux发行版。 + +对于各个发行版以及桌面环境(DE)而言,要一致地使用图形化用户界面(GUI)却几乎是不可能的,因为它们都提供了各自的用户界面。要明确的是,有那么些情况,你需要在不同的发行版上使用不同的命令来部署某些特定的任务,但是,或多或少它们的概念和意图却仍然是一致的。 + +在本文中,我们打算讨论Linux用户应当掌握的一些基本命令。我将给大家演示怎样使用命令行来更新系统、管理软件、操作文件以及切换到root,这些操作将在三个主要发行版上进行:Ubuntu(也包括其定制版和衍生版,还有Debian),openSUSE,以及Fedora。 + +*让我们开始吧!* + +### 保持系统安全和最新 ### + +Linux是基于安全设计的,但事实上是,任何软件都有缺陷,会导致安全漏洞。所以,保持你的系统更新到最新是十分重要的。这么想吧:运行过时的操作系统,就像是你坐在全副武装的坦克里头,而门却没有锁。武器会保护你吗?任何人都可以进入开放的大门,对你造成伤害。同样,在你的系统中也有没有打补丁的漏洞,这些漏洞会危害到你的系统。开源社区,不像专利世界,在漏洞补丁方面反应是相当快的,所以,如果你保持系统最新,你也获得了安全保证。 + +留意新闻站点,了解安全漏洞。如果发现了一个漏洞,请阅读之,然后在补丁出来的第一时间更新。不管怎样,在生产机器上,你每星期必须至少运行一次更新命令。如果你运行这一台复杂的服务器,那么就要额外当心了。仔细阅读变更日志,以确保更新不会搞坏你的自定义服务。 + +**Ubuntu**:牢记一点:你在升级系统或安装不管什么软件之前,都必须要刷新仓库(也就是repos)。在Ubuntu上,你可以使用下面的命令来更新系统,第一个命令用于刷新仓库: + + sudo apt-get update + +仓库更新后,现在你可以运行系统更新命令了: + + sudo apt-get upgrade + +然而,这个命令不会更新内核和其它一些包,所以你也必须要运行下面这个命令: + + sudo apt-get dist-upgrade + +**openSUSE**:如果你是在openSUSE上,你可以使用以下命令来更新系统(照例,第一个命令的意思是更新仓库) + + sudo zypper refresh + sudo zypper up + +**Fedora**:如果你是在Fedora上,你可以使用'dnf'命令,它是zypper和apt-get的'同类': + + sudo dnf update + sudo dnf upgrade + +### 软件安装与移除 ### + +你只可以安装那些你系统上启用的仓库中可用的包,各个发行版默认都附带有并启用了一些官方或者第三方仓库。 +**Ubuntu**: To install any package on Ubuntu, first update the repo and then use this syntax: +**Ubuntu**:要在Ubuntu上安装包,首先更新仓库,然后使用下面的语句: + + sudo apt-get install [package_name] + +样例: + + sudo apt-get install gimp + +**openSUSE**:命令是这样的: + + sudo zypper install [package_name] + +**Fedora**:Fedora已经丢弃了'yum',现在换成了'dnf',所以命令是这样的: + + sudo dnf install [package_name] + +移除软件的过程也一样,只要把'install'改成'remove'。 + +**Ubuntu**: + + sudo apt-get remove [package_name] + +**openSUSE**: + + sudo zypper remove [package_name] + +**Fedora**: + + sudo dnf remove [package_name] + +### 如何管理第三方软件? ### + +在一个庞大的开发者社区中,这些开发者们为用户提供了许多的软件。不同的发行版有不同的机制来使用这些第三方软件,将它们提供给用户。同时也取决于开发者怎样将这些软件提供给用户,有些开发者会提供二进制包,而另外一些开发者则将软件发布到仓库中。 + +Ubuntu严重依赖于PPA(个人包归档),但是,不幸的是,它却没有提供一个内建工具来帮助用于搜索这些PPA仓库。在安装软件前,你将需要通过Google搜索PPA,然后手工添加该仓库。下面就是添加PPA到系统的方法: + + sudo add-apt-repository ppa: + +样例:比如说,我想要添加LibreOffice PPA到我的系统中。我应该Google该PPA,然后从Launchpad获得该仓库的名称,在本例中它是"libreoffice/ppa"。然后,使用下面的命令来添加该PPA: + + sudo add-apt-repository ppa:libreoffice/ppa + +它会要你按下回车键来导入秘钥。完成后,使用'update'命令来刷新仓库,然后安装该包。 + +openSUSE拥有一个针对第三方应用的优雅的解决方案。你可以访问software.opensuse.org,一键点击搜索并安装相应包,它会自动将对应的仓库添加到你的系统中。如果你想要手工添加仓库,可以使用该命令: + + sudo zypper ar -f url_of_the_repo name_of_repo + sudo zypper ar -f http://download.opensuse.org/repositories/LibreOffice:Factory/openSUSE_13.2/LibreOffice:Factory.repo LOF + +然后,刷新仓库并安装软件: + + sudo zypper refresh + sudo zypper install libreoffice + +Fedora用户只需要添加RPMFusion(free和non-free仓库一起),该仓库包含了大量的应用。如果你需要添加仓库,命令如下: + +dnf config-manager --add-repo http://www.example.com/example.repo + +### 一些基本命令 ### + +我已经写了一些关于使用CLI来管理你系统上的文件的[文章][1],下面介绍一些基本米ing令,这些命令在所有发行版上都经常会用到。 + +拷贝文件或目录到一个新的位置: + + cp path_of_file_1 path_of_the_directory_where_you_want_to_copy/ + +将某个目录中的所有文件拷贝到一个新的位置(注意斜线和星号,它指的是该目录下的所有文件): + + cp path_of_files/* path_of_the_directory_where_you_want_to_copy/ + +将一个文件从某个位置移动到另一个位置(尾斜杠是说在该目录中): + + mv path_of_file_1 path_of_the_directory_where_you_want_to_move/ + +将所有文件从一个位置移动到另一个位置: + + mv path_of_directory_where_files_are/* path_of_the_directory_where_you_want_to_move/ + +删除一个文件: + + rm path_of_file + +删除一个目录: + + rm -r path_of_directory + +移除目录中所有内容,完整保留目录文件夹: + + rm -r path_of_directory/* + +### 创建新目录 ### + +要创建一个新目录,首先输入你要创建的目录的位置。比如说,你想要在你的Documents目录中创建一个名为'foundation'的文件夹。让我们使用 cd (即change directory,改变目录)命令来改变目录: + + cd /home/swapnil/Documents + +(替换'swapnil'为你系统中的用户) + +然后,使用 mkdir 命令来创建该目录: + + mkdir foundation + +你也可以从任何地方创建一个目录,通过指定该目录的路径即可。例如: + + mdkir /home/swapnil/Documents/foundation + +如果你想要创建父-子目录,那是指目录中的目录,那么可以使用 -p 选项。它会在指定路径中创建所有目录: + + mdkir -p /home/swapnil/Documents/linux/foundation + +### 成为root ### + +你或许需要成为root,或者具有sudo权力的用户,来实施一些管理任务,如管理软件包或者对根目录或其下的文件进行一些修改。其中一个例子就是编辑'fstab'文件,该文件记录了挂载的硬件驱动器。它在'etc'目录中,而该目录又在根目录中,你只能作为超级用户来修改该文件。在大多数的发行版中,你可以通过'切换用户'来成为root。比如说,在openSUSE上,我想要成为root,因为我要在根目录中工作,你可以使用下面的命令之一: + + sudo su - + +或 + + su - + +该命令会要求输入密码,然后你就具有root特权了。记住一点:千万不要以root用户来运行系统,除非你知道你正在做什么。另外重要的一点需要注意的是,你以root什么对目录或文件进行修改后,会将它们的拥有关系从该用户或特定的服务改变为root。你必须恢复这些文件的拥有关系,否则该服务或用户就不能访问或写入到那些文件。要改变用户,命令如下: + + sudo chown -R user:user /path_of_file_or_directory + +当你将其它发行版上的分区挂载到系统中时,你可能经常需要该操作。当你试着访问这些分区上的文件时,你可能会碰到权限拒绝错误,你只需要改变这些分区的拥有关系就可以访问它们了。需要额外当心的是,不要改变根目录的权限或者拥有关系。 + +这些就是Linux新手们需要的基本命令。如果你有任何问题,或者如果你想要我们涵盖一个特定的话题,请在下面的评论中告诉我们吧。 + +-------------------------------------------------------------------------------- + +via: http://www.linux.com/learn/tutorials/842251-must-know-linux-commands-for-new-users + +作者:[Swapnil Bhartiya][a] +译者:[GOLinux](https://github.com/GOLinux) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.linux.com/community/forums/person/61003 +[1]:http://www.linux.com/learn/tutorials/828027-how-to-manage-your-files-from-the-command-line From bc558997ab70ad174767f013c6a2dac05e959e9b Mon Sep 17 00:00:00 2001 From: wxy Date: Thu, 30 Jul 2015 22:23:23 +0800 Subject: [PATCH 747/965] PUB:20150309 Comparative Introduction To FreeBSD For Linux Users MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @wwy-hust 翻译的不错! --- ...Introduction To FreeBSD For Linux Users.md | 101 ++++++++++++++++++ ...Introduction To FreeBSD For Linux Users.md | 98 ----------------- 2 files changed, 101 insertions(+), 98 deletions(-) create mode 100644 published/20150309 Comparative Introduction To FreeBSD For Linux Users.md delete mode 100644 translated/talk/20150309 Comparative Introduction To FreeBSD For Linux Users.md diff --git a/published/20150309 Comparative Introduction To FreeBSD For Linux Users.md b/published/20150309 Comparative Introduction To FreeBSD For Linux Users.md new file mode 100644 index 0000000000..01ee52d26a --- /dev/null +++ b/published/20150309 Comparative Introduction To FreeBSD For Linux Users.md @@ -0,0 +1,101 @@ +FreeBSD 和 Linux 有什么不同? +================================================================================ + +![](https://1102047360.rsc.cdn77.org/wp-content/uploads/2015/03/FreeBSD-790x494.jpg) + +### 简介 ### + +BSD最初从UNIX继承而来,目前,有许多的类Unix操作系统是基于BSD的。FreeBSD是使用最广泛的开源的伯克利软件发行版(即 BSD 发行版)。就像它隐含的意思一样,它是一个自由开源的类Unix操作系统,并且是公共服务器平台。FreeBSD源代码通常以宽松的BSD许可证发布。它与Linux有很多相似的地方,但我们得承认它们在很多方面仍有不同。 + +本文的其余部分组织如下:FreeBSD的描述在第一部分,FreeBSD和Linux的相似点在第二部分,它们的区别将在第三部分讨论,对他们功能的讨论和总结在最后一节。 + +### FreeBSD描述 ### + +#### 历史 #### + +- FreeBSD的第一个版本发布于1993年,它的第一张CD-ROM是FreeBSD1.0,发行于1993年12月。接下来,FreeBSD 2.1.0在1995年发布,并且获得了所有用户的青睐。实际上许多IT公司都使用FreeBSD并且很满意,我们可以列出其中的一些:IBM、Nokia、NetApp和Juniper Network。 + +#### 许可证 #### + +- 关于它的许可证,FreeBSD以多种开源许可证进行发布,它的名为Kernel的最新代码以两句版BSD许可证进行了发布,给予使用和重新发布FreeBSD的绝对自由。其它的代码则以三句版或四句版BSD许可证进行发布,有些是以GPL和CDDL的许可证发布的。 + +(LCTT 译注:BSD 许可证与 GPL 许可证相比,相当简短,最初只有四句规则;1999年应 RMS 请求,删除了第三句,新的许可证称作“新 BSD”或三句版BSD;原来的 BSD 许可证称作“旧 BSD”、“修订的 BSD”或四句版BSD;也有一种删除了第三、第四两句的版本,称之为两句版 BSD,等价于 MIT 许可证。) + +#### 用户 #### + +- FreeBSD的重要特点之一就是它的用户多样性。实际上,FreeBSD可以作为邮件服务器、Web 服务器、FTP 服务器以及路由器等,您只需要在它上运行服务相关的软件即可。而且FreeBSD还支持ARM、PowerPC、MIPS、x86、x86-64架构。 + +### FreeBSD和Linux的相似处 ### + +FreeBSD和Linux是两个自由开源的软件。实际上,它们的用户可以很容易的检查并修改源代码,用户拥有绝对的自由。而且,FreeBSD和Linux都是类Unix系统,它们的内核、内部组件、库程序都使用从历史上的AT&T Unix继承来的算法。FreeBSD从根基上更像Unix系统,而Linux是作为自由的类Unix系统发布的。许多工具应用都可以在FreeBSD和Linux中找到,实际上,他们几乎有同样的功能。 + +此外,FreeBSD能够运行大量的Linux应用。它可以安装一个Linux的兼容层,这个兼容层可以在编译FreeBSD时加入AAC Compact Linux得到,或通过下载已编译了Linux兼容层的FreeBSD系统,其中会包括兼容程序:aac_linux.ko。不同于FreeBSD的是,Linux无法运行FreeBSD的软件。 + +最后,我们注意到虽然二者有同样的目标,但二者还是有一些不同之处,我们在下一节中列出。 + +### FreeBSD和Linux的区别 ### + +目前对于大多数用户来说并没有一个选择FreeBSD还是Linux的明确的准则。因为他们有着很多同样的应用程序,因为他们都被称作类Unix系统。 + +在这一章,我们将列出这两种系统的一些重要的不同之处。 + +#### 许可证 #### + +- 两个系统的区别首先在于它们的许可证。Linux以GPL许可证发行,它为用户提供阅读、发行和修改源代码的自由,GPL许可证帮助用户避免仅仅发行二进制。而FreeBSD以BSD许可证发布,BSD许可证比GPL更宽容,因为其衍生著作不需要仍以该许可证发布。这意味着任何用户能够使用、发布、修改代码,并且不需要维持之前的许可证。 +- 您可以依据您的需求,在两种许可证中选择一种。首先是BSD许可证,由于其特殊的条款,它更受用户青睐。实际上,这个许可证使用户在保证源代码的封闭性的同时,可以售卖以该许可证发布的软件。再说说GPL,它需要每个使用以该许可证发布的软件的用户多加注意。 +- 如果想在以不同许可证发布的两种软件中做出选择,您需要了解他们各自的许可证,以及他们开发中的方法论,从而能了解他们特性的区别,来选择更适合自己需求的。 + +#### 控制 #### + +- 由于FreeBSD和Linux是以不同的许可证发布的,Linus Torvalds控制着Linux的内核,而FreeBSD却与Linux不同,它并未被控制。我个人更倾向于使用FreeBSD而不是Linux,这是因为FreeBSD才是绝对自由的软件,没有任何控制许可证的存在。Linux和FreeBSD还有其他的不同之处,我建议您先不急着做出选择,等读完本文后再做出您的选择。 + +#### 操作系统 #### + +- Linux主要指内核系统,这与FreeBSD不同,FreeBSD的整个系统都被维护着。FreeBSD的内核和一组由FreeBSD团队开发的软件被作为一个整体进行维护。实际上,FreeBSD开发人员能够远程且高效的管理核心操作系统。 +- 而Linux方面,在管理系统方面有一些困难。由于不同的组件由不同的源维护,Linux开发者需要将它们汇集起来,才能达到同样的功能。 +- FreeBSD和Linux都给了用户大量的可选软件和发行版,但他们管理的方式不同。FreeBSD是统一的管理方式,而Linux需要被分别维护。 + +#### 硬件支持 #### + +- 说到硬件支持,Linux比FreeBSD做的更好。但这不意味着FreeBSD没有像Linux那样支持硬件的能力。他们只是在管理的方式不同,这通常还依赖于您的需求。因此,如果您在寻找最新的解决方案,FreeBSD更适应您;但如果您在寻找更多的普适性,那最好使用Linux。 + +#### 原生FreeBSD Vs 原生Linux #### + +- 两者的原生系统的区别又有不同。就像我之前说的,Linux是一个Unix的替代系统,由Linux Torvalds编写,并由网络上的许多极客一起协助实现的。Linux有一个现代系统所需要的全部功能,诸如虚拟内存、共享库、动态加载、优秀的内存管理等。它以GPL许可证发布。 +- FreeBSD也继承了Unix的许多重要的特性。FreeBSD作为在加州大学开发的BSD的一种发行版。开发BSD的最重要的原因是用一个开源的系统来替代AT&T操作系统,从而给用户无需AT&T许可证便可使用的能力。 +- 许可证的问题是开发者们最关心的问题。他们试图提供一个最大化克隆Unix的开源系统。这影响了用户的选择,由于FreeBSD使用BSD许可证进行发布,因而相比Linux更加自由。 + +#### 支持的软件包 #### + +- 从用户的角度来看,另一个二者不同的地方便是软件包以及从源码安装的软件的可用性和支持。Linux只提供了预编译的二进制包,这与FreeBSD不同,它不但提供预编译的包,而且还提供从源码编译和安装的构建系统。使用它的 ports 工具,FreeBSD给了您选择使用预编译的软件包(默认)和在编译时定制您软件的能力。(LCTT 译注:此处说明有误。Linux 也提供了源代码方式的包,并支持自己构建。) +- 这些 ports 允许您构建所有支持FreeBSD的软件。而且,它们的管理还是层次化的,您可以在/usr/ports下找到源文件的地址以及一些正确使用FreeBSD的文档。 +- 这些提到的 ports给予你产生不同软件包版本的可能性。FreeBSD给了您通过源代码构建以及预编译的两种软件,而不是像Linux一样只有预编译的软件包。您可以使用两种安装方式管理您的系统。 + +#### FreeBSD 和 Linux 常用工具比较 #### + +- 有大量的常用工具在FreeBSD上可用,并且有趣的是他们由FreeBSD的团队所拥有。相反的,Linux工具来自GNU,这就是为什么在使用中有一些限制。(LCTT 译注:这也是 Linux 正式的名称被称作“GNU/Linux”的原因,因为本质上 Linux 其实只是指内核。) +- 实际上FreeBSD采用的BSD许可证非常有益且有用。因此,您有能力维护核心操作系统,控制这些应用程序的开发。有一些工具类似于它们的祖先 - BSD和Unix的工具,但不同于GNU的套件,GNU套件只想做到最小的向后兼容。 + +#### 标准 Shell #### + +- FreeBSD默认使用tcsh。它是csh的评估版,由于FreeBSD以BSD许可证发行,因此不建议您在其中使用GNU的组件 bash shell。bash和tcsh的区别仅仅在于tcsh的脚本功能。实际上,我们更推荐在FreeBSD中使用sh shell,因为它更加可靠,可以避免一些使用tcsh和csh时出现的脚本问题。 + +#### 一个更加层次化的文件系统 #### + +- 像之前提到的一样,使用FreeBSD时,基础操作系统以及可选组件可以被很容易的区别开来。这导致了一些管理它们的标准。在Linux下,/bin,/sbin,/usr/bin或者/usr/sbin都是存放可执行文件的目录。FreeBSD不同,它有一些附加的对其进行组织的规范。基础操作系统被放在/usr/local/bin或者/usr/local/sbin目录下。这种方法可以帮助管理和区分基础操作系统和可选组件。 + +### 结论 ### + +FreeBSD和Linux都是自由且开源的系统,他们有相似点也有不同点。上面列出的内容并不能说哪个系统比另一个更好。实际上,FreeBSD和Linux都有自己的特点和技术规格,这使它们与别的系统区别开来。那么,您有什么看法呢?您已经有在使用它们中的某个系统了么?如果答案为是的话,请给我们您的反馈;如果答案是否的话,在读完我们的描述后,您怎么看?请在留言处发表您的观点。 + +-------------------------------------------------------------------------------- + +via: http://www.unixmen.com/comparative-introduction-freebsd-linux-users/ + +作者:[anismaj][a] +译者:[wwy-hust](https://github.com/wwy-hust) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:https://www.unixmen.com/author/anis/ \ No newline at end of file diff --git a/translated/talk/20150309 Comparative Introduction To FreeBSD For Linux Users.md b/translated/talk/20150309 Comparative Introduction To FreeBSD For Linux Users.md deleted file mode 100644 index 76368e1033..0000000000 --- a/translated/talk/20150309 Comparative Introduction To FreeBSD For Linux Users.md +++ /dev/null @@ -1,98 +0,0 @@ -ԱȽϵķʽLinuxûFreeBSD -================================================================================ -![](https://1102047360.rsc.cdn77.org/wp-content/uploads/2015/03/FreeBSD-790x494.jpg) - -### ### - -BSDUNIX̳жĿǰUnixϵͳǻBSDġFreeBSDʹ㷺ĿԴа棨BSDа棩˼һһѿԴUnixϵͳǹƽ̨FreeBSDԴͨԿɵBSD֤LinuxкܶƵĵطǵóںܶ෽вͬ - -ĵಿ֯£FreeBSDڵһ֣FreeBSDLinuxƵڵڶ֣ǵڵۣǹܵۺܽһڡ - -### FreeBSD ### - -#### ʷ #### - -- FreeBSDĵһ汾1993꣬ĵһCD-ROMFreeBSD1.0Ҳ1993ꡣFreeBSD 2.1.01995귢һûʵIT˾ʹFreeBSDҺ⣬ǿгеһЩIBMNokiaNetAppJuniper Network - -#### ֤ #### - -- ֤FreeBSDԶֿԴ֤зµΪKernelĴBSD֤˷ʹú·FreeBSDľɡĴBSD֤зЩGPLCDDL֤ġ - -#### û #### - -- FreeBSDҪص֮һûʵϣFreeBSDΪʼWeb ServerFTPԼ·ȣֻҪзصɡFreeBSD֧ARMPowerPCMIPSx86x86-64ܹ - -### FreeBSDLinuxƴ ### - -FreeBSDLinuxѿԴʵϣǵûԺ׵ļ鲢޸Դ룬ûӵоԵɡңFreeBSDLinuxUnixϵͳǵںˡڲʹôʷϵAT&T Unix̳е㷨FreeBSDӸϸUnixϵͳLinuxΪѵUnixϵͳġ๤ӦöFreeBSDLinuxҵʵϣǼͬĹܡ - -⣬FreeBSDܹдLinuxӦá԰װһLinuxļݲ㣬ݲڱFreeBSDʱAAC Compact LinuxõͨѱLinuxݲFreeBSDϵͳлݳaac_linux.koͬFreeBSDǣLinux޷FreeBSD - -ע⵽ȻͬĿ꣬߻һЩ֮ͬһг - -### FreeBSDLinux ### - -Ŀǰڴû˵ûһѡFreeBSDLinux׼ΪźܶͬӦóΪǶUnixϵͳ - -һ£ǽгϵͳһЩҪIJ֮ͬ - -#### ֤ #### - -- ϵͳǵ֤LinuxGPL֤УΪûṩĶк޸ԴɣGPL֤ûжơFreeBSDBSD֤BSD֤GPLݣΪҪԸ֤ζκûܹʹá޸Ĵ룬ҲҪά֮ǰ֤ -- ֤ѡһ֡BSD֤ûʵϣ֤ʹûڱ֤ԴķԵͬʱԸ֤˵˵GPLҪÿʹԸ֤ûע⡣ -- Բ֤ͬѡҪ˽ǸԵ֤ԼǿеķۣӶ˽ԵѡʺԼġ - -#### #### - -- FreeBSDLinuxԲ֤ͬģLinus TorvaldsLinuxںˣFreeBSDȴLinuxͬδơҸ˸ʹFreeBSDLinuxΪFreeBSDǾɵûκοɵĴڡLinuxFreeBSDIJ֮ͬҽȲѡ񣬵ȶ걾ĺѡ - -#### ϵͳ #### - -- Linux۽ںϵͳFreeBSDͬFreeBSDϵͳάšFreeBSDں˺һFreeBSDŶӿΪһάʵϣFreeBSDԱܹԶҸЧĹIJϵͳ -- Linux棬ڹϵͳһЩѡڲͬɲͬԴάLinuxҪǻ㼯ܴﵽͬĹܡ -- FreeBSDLinuxûĿѡͷа棬ǹķʽͬFreeBSDͳһĹʽLinuxҪֱά - -#### Ӳ֧ #### - -- ˵Ӳ֧֣LinuxFreeBSDĸáⲻζFreeBSDûLinux֧ӲֻڹķʽͬͨˣѰµĽFreeBSDӦѰһĻʹLinux - -#### ԭFreeBSD Vs ԭLinux #### - -- ߵԭϵͳв֮ͬǰ˵ģLinuxһUnixϵͳLinux Torvaldsдϵ༫һЭʵֵġLinuxһִϵͳҪȫܣڴ桢⡢̬ءڴȡGPL֤ -- FreeBSDҲ̳UnixҪԡFreeBSDΪڼݴѧBSDһַа档BSDҪԭһԴϵͳAT&TϵͳӶûAT&T֤ʹõ -- ֤ǿĵ⡣ͼṩһ󻯿¡UnixĿԴϵͳӰûѡFreeBSDLinuxʹBSD֤зɡ - -#### ֵ֧ #### - -- ûĽǶһ߲ͬĵطԼԴ밲װĿԺ֧֡LinuxֻṩԤĶưFreeBSDͬṩԤİһṩԴͰװĹϵͳֲFreeBSDѡʹԤĬϣڱʱ -- ЩѡFreeBSDеңǵĹDzλģ/usr/portsҵԴļĵַԼһЩȷʹFreeBSDĵ -- ЩᵽĿѡ˲ͬ汾ĿԡFreeBSDͨԴ빹ԼԤLinuxһֻԤʹְװʽϵͳ - -#### FreeBSD Linux ù߱Ƚ #### - -- дijùFreeBSDϿãȤFreeBSDŶӵС෴ģLinuxGNUΪʲôʹһЩơ -- ʵFreeBSDõBSD֤dzáˣάIJϵͳЩӦóĿһЩǵ - BSDUnixĹߣͬGNU׼GNU׼ֻСݡ - -#### ׼ Shell #### - -- FreeBSDĬʹtcshcsh棬FreeBSDBSD֤У˲ʹGNU bash shellbashtcshtcshĽűܡʵϣǸƼFreeBSDʹsh shellΪӿɿԱһЩʹtcshcshʱֵĽű⡣ - -#### һӲλļϵͳ #### - -- ֮ǰᵽһʹFreeBSDʱϵͳԼѡԱ׵⵼һЩǵı׼Linux£/bin/sbin/usr/bin/usr/sbinǴſִļĿ¼FreeBSDͬһЩӵĶ֯Ĺ淶ϵͳ/usr/local/bin/usr/local/sbinĿ¼¡ַ԰ֻϵͳͿѡ - -### ### - -FreeBSDLinuxҿԴϵͳƵҲвͬ㡣гݲ˵ĸϵͳһáʵϣFreeBSDLinuxԼصͼʹϵͳôʲôأѾʹеijϵͳôΪǵĻķǷĻڶǵôԴĹ۵㡣 - --------------------------------------------------------------------------------- - -via: https://www.unixmen.com/comparative-introduction-freebsd-linux-users/ - -ߣ[anismaj][a] -ߣ[wwy-hust](https://github.com/wwy-hust) -Уԣ[УID](https://github.com/УID) - - [LCTT](https://github.com/LCTT/TranslateProject) ԭ룬[Linuxй](http://linux.cn/) Ƴ - -[a]:https://www.unixmen.com/author/anis/ \ No newline at end of file From 471b7f98d2364433e49d47db97c1070b4ecbdd8a Mon Sep 17 00:00:00 2001 From: wxy Date: Fri, 31 Jul 2015 13:57:30 +0800 Subject: [PATCH 748/965] =?UTF-8?q?=E8=A1=A5=E5=AE=8C=20PR?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @strugglingyouth 另外,也别忘记扩展名。 --- ...- Part 2 => 20150717 How to collect NGINX metrics - Part 2.md} | 0 ...CD, Watch User Activity and Check Memory Usages of Browser.md} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename translated/tech/{How to collect NGINX metrics - Part 2 => 20150717 How to collect NGINX metrics - Part 2.md} (100%) rename translated/{Tips to Create ISO from CD, Watch User Activity and Check Memory Usages of Browser => tech/20150728 Tips to Create ISO from CD, Watch User Activity and Check Memory Usages of Browser.md} (100%) diff --git a/translated/tech/How to collect NGINX metrics - Part 2 b/translated/tech/20150717 How to collect NGINX metrics - Part 2.md similarity index 100% rename from translated/tech/How to collect NGINX metrics - Part 2 rename to translated/tech/20150717 How to collect NGINX metrics - Part 2.md diff --git a/translated/Tips to Create ISO from CD, Watch User Activity and Check Memory Usages of Browser b/translated/tech/20150728 Tips to Create ISO from CD, Watch User Activity and Check Memory Usages of Browser.md similarity index 100% rename from translated/Tips to Create ISO from CD, Watch User Activity and Check Memory Usages of Browser rename to translated/tech/20150728 Tips to Create ISO from CD, Watch User Activity and Check Memory Usages of Browser.md From f76fa728ffb1bcb30bab43d4ab4bc4976b3530a4 Mon Sep 17 00:00:00 2001 From: wxy Date: Fri, 31 Jul 2015 14:36:26 +0800 Subject: [PATCH 749/965] PUB:Install Plex Media Server On Ubuntu or CentOS 7.1 or Fedora 22 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @dingdongnigetou 原文中多次混杂 Plex Media Server 和 Plex Home Media Server,经过到官网的查看,并无 Home 产品及名称,所以统一了。 --- ...er On Ubuntu or CentOS 7.1 or Fedora 22.md | 62 +++++++++---------- 1 file changed, 30 insertions(+), 32 deletions(-) rename {translated/tech => published}/Install Plex Media Server On Ubuntu or CentOS 7.1 or Fedora 22.md (63%) diff --git a/translated/tech/Install Plex Media Server On Ubuntu or CentOS 7.1 or Fedora 22.md b/published/Install Plex Media Server On Ubuntu or CentOS 7.1 or Fedora 22.md similarity index 63% rename from translated/tech/Install Plex Media Server On Ubuntu or CentOS 7.1 or Fedora 22.md rename to published/Install Plex Media Server On Ubuntu or CentOS 7.1 or Fedora 22.md index 813057798b..f8f1a26a3b 100644 --- a/translated/tech/Install Plex Media Server On Ubuntu or CentOS 7.1 or Fedora 22.md +++ b/published/Install Plex Media Server On Ubuntu or CentOS 7.1 or Fedora 22.md @@ -1,20 +1,18 @@ - -如何在 Ubuntu/CentOS7.1/Fedora22 上安装 Plex Media Server ? +如何在 Ubuntu/CentOS7.1/Fedora22 上安装 Plex Media Server ================================================================================ -在本文中我们将会向你展示如何容易地在主流的最新发布的Linux发行版上安装Plex Home Media Server。在Plex安装成功后你将可以使用你的集中式家庭媒体播放系统,该系统能让多个Plex播放器App共享它的媒体资源,并且该系统允许你设置你的环境,通过增加你的设备以及设置一个可以一起使用Plex的用户组。让我们首先在Ubuntu15.04上开始Plex的安装。 +在本文中我们将会向你展示如何容易地在主流的最新Linux发行版上安装Plex Media Server。在Plex安装成功后你将可以使用你的中央式家庭媒体播放系统,该系统能让多个Plex播放器App共享它的媒体资源,并且该系统允许你设置你的环境,增加你的设备以及设置一个可以一起使用Plex的用户组。让我们首先在Ubuntu15.04上开始Plex的安装。 ### 基本的系统资源 ### 系统资源主要取决于你打算用来连接服务的设备类型和数量, 所以根据我们的需求我们将会在一个单独的服务器上使用以下系统资源。 -注:表格 - + - + @@ -22,11 +20,11 @@ - + - + @@ -38,13 +36,13 @@ #### 步骤 1: 系统更新 #### -用root权限登陆你的服务器。确保你的系统是最新的,如果不是就使用下面的命令。 +用root权限登录你的服务器。确保你的系统是最新的,如果不是就使用下面的命令。 root@ubuntu-15:~#apt-get update #### 步骤 2: 下载最新的Plex Media Server包 #### -创建一个新目录,用wget命令从Plex官网下载为Ubuntu提供的.deb包并放入该目录中。 +创建一个新目录,用wget命令从[Plex官网](https://plex.tv/)下载为Ubuntu提供的.deb包并放入该目录中。 root@ubuntu-15:~# cd /plex/ root@ubuntu-15:/plex# @@ -52,7 +50,7 @@ #### 步骤 3: 安装Plex Media Server的Debian包 #### -现在在相同的目录下执行下面的命令来开始debian包的安装, 然后检查plexmediaserver(译者注: 原文plekmediaserver, 明显笔误)的状态。 +现在在相同的目录下执行下面的命令来开始debian包的安装, 然后检查plexmediaserver服务的状态。 root@ubuntu-15:/plex# dpkg -i plexmediaserver_0.9.12.3.1173-937aac3_amd64.deb @@ -62,41 +60,41 @@ ![Plexmediaserver Service](http://blog.linoxide.com/wp-content/uploads/2015/06/plex-status.png) -### 在Ubuntu 15.04上设置Plex Home Media Web应用 ### +### 在Ubuntu 15.04上设置Plex Media Web应用 ### -让我们在你的本地网络主机中打开web浏览器, 并用你的本地主机IP以及端口32400来打开Web界面并完成以下步骤来配置Plex。 +让我们在你的本地网络主机中打开web浏览器, 并用你的本地主机IP以及端口32400来打开Web界面,并完成以下步骤来配置Plex。 http://172.25.10.179:32400/web http://localhost:32400/web -#### 步骤 1: 登陆前先注册 #### +#### 步骤 1: 登录前先注册 #### -在你访问到Plex Media Server的Web界面之后(译者注: 原文是Plesk, 应该是笔误), 确保注册并填上你的用户名(译者注: 原文username email ID感觉怪怪:))和密码来登陆。 +在你访问到Plex Media Server的Web界面之后, 确保注册并填上你的用户名和密码来登录。 ![Plex Sign In](http://blog.linoxide.com/wp-content/uploads/2015/06/PMS-Login.png) -#### 输入你的PIN码来保护你的Plex Home Media用户(译者注: 原文Plex Media Home, 个人觉得专业称谓应该保持一致) #### +#### 输入你的PIN码来保护你的Plex Media用户#### ![Plex User Pin](http://blog.linoxide.com/wp-content/uploads/2015/06/333.png) -现在你已经成功的在Plex Home Media下配置你的用户。 +现在你已经成功的在Plex Media下配置你的用户。 ![Welcome To Plex](http://blog.linoxide.com/wp-content/uploads/2015/06/3333.png) ### 在设备上而不是本地服务器上打开Plex Web应用 ### -正如我们在Plex Media主页看到的表明"你没有权限访问这个服务"。 这是因为我们跟服务器计算机不在同个网络。 +如我们在Plex Media主页看到的提示“你没有权限访问这个服务”。 这说明我们跟服务器计算机不在同个网络。 ![Plex Server Permissions](http://blog.linoxide.com/wp-content/uploads/2015/06/33.png) -现在我们需要解决这个权限问题以便我们通过设备访问服务器而不是通过托管服务器(Plex服务器), 通过完成下面的步骤。 +现在我们需要解决这个权限问题,以便我们通过设备访问服务器而不是只能在服务器上访问。通过完成下面的步骤完成。 -### 设置SSH隧道使Windows系统访问到Linux服务器 ### +### 设置SSH隧道使Windows系统可以访问到Linux服务器 ### 首先我们需要建立一条SSH隧道以便我们访问远程服务器资源,就好像资源在本地一样。 这仅仅是必要的初始设置。 如果你正在使用Windows作为你的本地系统,Linux作为服务器,那么我们可以参照下图通过Putty来设置SSH隧道。 -(译者注: 首先要在Putty的Session中用Plex服务器IP配置一个SSH的会话,才能进行下面的隧道转发规则配置。 +(LCTT译注: 首先要在Putty的Session中用Plex服务器IP配置一个SSH的会话,才能进行下面的隧道转发规则配置。 然后点击“Open”,输入远端服务器用户名密码, 来保持SSH会话连接。) ![Plex SSH Tunnel](http://blog.linoxide.com/wp-content/uploads/2015/06/ssh-tunnel.png) @@ -111,13 +109,13 @@ ![Agree to Plex term](http://blog.linoxide.com/wp-content/uploads/2015/06/5.png) -现在一个功能齐全的Plex Home Media Server已经准备好添加新的媒体库、频道、播放列表等资源。 +现在一个功能齐全的Plex Media Server已经准备好添加新的媒体库、频道、播放列表等资源。 ![PMS Settings](http://blog.linoxide.com/wp-content/uploads/2015/06/8.png) ### 在CentOS 7.1上安装Plex Media Server 0.9.12.3 ### -我们将会按照上述在Ubuntu15.04上安装Plex Home Media Server的步骤来将Plex安装到CentOS 7.1上。 +我们将会按照上述在Ubuntu15.04上安装Plex Media Server的步骤来将Plex安装到CentOS 7.1上。 让我们从安装Plex Media Server开始。 @@ -144,9 +142,9 @@ [root@linux-tutorials plex]# systemctl enable plexmediaserver.service [root@linux-tutorials plex]# systemctl status plexmediaserver.service -### 在CentOS-7.1上设置Plex Home Media Web应用 ### +### 在CentOS-7.1上设置Plex Media Web应用 ### -现在我们只需要重复在Ubuntu上设置Plex Web应用的所有步骤就可以了。 让我们在Web浏览器上打开一个新窗口并用localhost或者Plex服务器的IP(译者注: 原文为or your Plex server, 明显的笔误)来访问Plex Home Media Web应用(译者注:称谓一致)。 +现在我们只需要重复在Ubuntu上设置Plex Web应用的所有步骤就可以了。 让我们在Web浏览器上打开一个新窗口并用localhost或者Plex服务器的IP来访问Plex Media Web应用。 http://172.20.3.174:32400/web http://localhost:32400/web @@ -157,25 +155,25 @@ ### 在Fedora 22工作站上安装Plex Media Server 0.9.12.3 ### -基本的下载和安装Plex Media Server步骤跟在CentOS 7.1上安装的步骤一致。我们只需要下载对应的rpm包然后用rpm命令来安装它。 +下载和安装Plex Media Server步骤基本跟在CentOS 7.1上安装的步骤一致。我们只需要下载对应的rpm包然后用rpm命令来安装它。 ![PMS Installation](http://blog.linoxide.com/wp-content/uploads/2015/06/plex-on-fedora.png) -### 在Fedora 22工作站上配置Plex Home Media Web应用 ### +### 在Fedora 22工作站上配置Plex Media Web应用 ### -我们在(与Plex服务器)相同的主机上配置Plex Media Server,因此不需要设置SSH隧道。只要在你的Fedora 22工作站上用Plex Home Media Server的默认端口号32400打开Web浏览器并同意Plex的服务条款即可。 +我们在(与Plex服务器)相同的主机上配置Plex Media Server,因此不需要设置SSH隧道。只要在你的Fedora 22工作站上用Plex Media Server的默认端口号32400打开Web浏览器并同意Plex的服务条款即可。 ![Plex Agreement](http://blog.linoxide.com/wp-content/uploads/2015/06/Plex-Terms.png) -**欢迎来到Fedora 22工作站上的Plex Home Media Server** +*欢迎来到Fedora 22工作站上的Plex Media Server* -让我们用你的Plex账户登陆,并且开始将你喜欢的电影频道添加到媒体库、创建你的播放列表、添加你的图片以及享用更多其他的特性。 +让我们用你的Plex账户登录,并且开始将你喜欢的电影频道添加到媒体库、创建你的播放列表、添加你的图片以及享用更多其他的特性。 ![Plex Add Libraries](http://blog.linoxide.com/wp-content/uploads/2015/06/create-library.png) ### 总结 ### -我们已经成功完成Plex Media Server在主流Linux发行版上安装和配置。Plex Home Media Server永远都是媒体管理的最佳选择。 它在跨平台上的设置是如此的简单,就像我们在Ubuntu,CentOS以及Fedora上的设置一样。它简化了你组织媒体内容的工作,并将媒体内容“流”向其他计算机以及设备以便你跟你的朋友分享媒体内容。 +我们已经成功完成Plex Media Server在主流Linux发行版上安装和配置。Plex Media Server永远都是媒体管理的最佳选择。 它在跨平台上的设置是如此的简单,就像我们在Ubuntu,CentOS以及Fedora上的设置一样。它简化了你组织媒体内容的工作,并将媒体内容“流”向其他计算机以及设备以便你跟你的朋友分享媒体内容。 -------------------------------------------------------------------------------- @@ -183,7 +181,7 @@ via: http://linoxide.com/tools/install-plex-media-server-ubuntu-centos-7-1-fedor 作者:[Kashif Siddique][a] 译者:[dingdongnigetou](https://github.com/dingdongnigetou) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From e90526660c916abce2730f20217ab36b1ff9840c Mon Sep 17 00:00:00 2001 From: ictlyh Date: Sat, 1 Aug 2015 10:05:00 +0800 Subject: [PATCH 750/965] [Translated] tech/20150522 Analyzing Linux Logs.md --- sources/tech/20150522 Analyzing Linux Logs.md | 182 ------------------ .../tech/20150522 Analyzing Linux Logs.md | 181 +++++++++++++++++ 2 files changed, 181 insertions(+), 182 deletions(-) delete mode 100644 sources/tech/20150522 Analyzing Linux Logs.md create mode 100644 translated/tech/20150522 Analyzing Linux Logs.md diff --git a/sources/tech/20150522 Analyzing Linux Logs.md b/sources/tech/20150522 Analyzing Linux Logs.md deleted file mode 100644 index 832ea369ec..0000000000 --- a/sources/tech/20150522 Analyzing Linux Logs.md +++ /dev/null @@ -1,182 +0,0 @@ -ictlyh Translating -Analyzing Linux Logs -================================================================================ -There’s a great deal of information waiting for you within your logs, although it’s not always as easy as you’d like to extract it. In this section we will cover some examples of basic analysis you can do with your logs right away (just search what’s there). We’ll also cover more advanced analysis that may take some upfront effort to set up properly, but will save you time on the back end. Examples of advanced analysis you can do on parsed data include generating summary counts, filtering on field values, and more. - -We’ll show you first how to do this yourself on the command line using several different tools and then show you how a log management tool can automate much of the grunt work and make this so much more streamlined. - -### Searching with Grep ### - -Searching for text is the most basic way to find what you’re looking for. The most common tool for searching text is [grep][1]. This command line tool, available on most Linux distributions, allows you to search your logs using regular expressions. A regular expression is a pattern written in a special language that can identify matching text. The simplest pattern is to put the string you’re searching for surrounded by quotes - -#### Regular Expressions #### - -Here’s an example to find authentication logs for “user hoover” on an Ubuntu system: - - $ grep "user hoover" /var/log/auth.log - Accepted password for hoover from 10.0.2.2 port 4792 ssh2 - pam_unix(sshd:session): session opened for user hoover by (uid=0) - pam_unix(sshd:session): session closed for user hoover - -It can be hard to construct regular expressions that are accurate. For example, if we searched for a number like the port “4792” it could also match timestamps, URLs, and other undesired data. In the below example for Ubuntu, it matched an Apache log that we didn’t want. - - $ grep "4792" /var/log/auth.log - Accepted password for hoover from 10.0.2.2 port 4792 ssh2 - 74.91.21.46 - - [31/Mar/2015:19:44:32 +0000] "GET /scripts/samples/search?q=4972HTTP/1.0" 404 545 "-" "-” - -#### Surround Search #### - -Another useful tip is that you can do surround search with grep. This will show you what happened a few lines before or after a match. It can help you debug what lead up to a particular error or problem. The B flag gives you lines before, and A gives you lines after. For example, we can see that when someone failed to login as an admin, they also failed the reverse mapping which means they might not have a valid domain name. This is very suspicious! - - $ grep -B 3 -A 2 'Invalid user' /var/log/auth.log - Apr 28 17:06:20 ip-172-31-11-241 sshd[12545]: reverse mapping checking getaddrinfo for 216-19-2-8.commspeed.net [216.19.2.8] failed - POSSIBLE BREAK-IN ATTEMPT! - Apr 28 17:06:20 ip-172-31-11-241 sshd[12545]: Received disconnect from 216.19.2.8: 11: Bye Bye [preauth] - Apr 28 17:06:20 ip-172-31-11-241 sshd[12547]: Invalid user admin from 216.19.2.8 - Apr 28 17:06:20 ip-172-31-11-241 sshd[12547]: input_userauth_request: invalid user admin [preauth] - Apr 28 17:06:20 ip-172-31-11-241 sshd[12547]: Received disconnect from 216.19.2.8: 11: Bye Bye [preauth] - -#### Tail #### - -You can also pair grep with [tail][2] to get the last few lines of a file, or to follow the logs and print them in real time. This is useful if you are making interactive changes like starting a server or testing a code change. - - $ tail -f /var/log/auth.log | grep 'Invalid user' - Apr 30 19:49:48 ip-172-31-11-241 sshd[6512]: Invalid user ubnt from 219.140.64.136 - Apr 30 19:49:49 ip-172-31-11-241 sshd[6514]: Invalid user admin from 219.140.64.136 - -A full introduction on grep and regular expressions is outside the scope of this guide, but [Ryan’s Tutorials][3] include more in-depth information. - -Log management systems have higher performance and more powerful searching abilities. They often index their data and parallelize queries so you can quickly search gigabytes or terabytes of logs in seconds. In contrast, this would take minutes or in extreme cases hours with grep. Log management systems also use query languages like [Lucene][4] which offer an easier syntax for searching on numbers, fields, and more. - -### Parsing with Cut, AWK, and Grok ### - -#### Command Line Tools #### - -Linux offers several command line tools for text parsing and analysis. They are great if you want to quickly parse a small amount of data but can take a long time to process large volumes of data - -#### Cut #### - -The [cut][5] command allows you to parse fields from delimited logs. Delimiters are characters like equal signs or commas that break up fields or key value pairs. - -Let’s say we want to parse the user from this log: - - pam_unix(su:auth): authentication failure; logname=hoover uid=1000 euid=0 tty=/dev/pts/0 ruser=hoover rhost= user=root - -We can use the cut command like this to get the text after the eighth equal sign. This example is on an Ubuntu system: - - $ grep "authentication failure" /var/log/auth.log | cut -d '=' -f 8 - root - hoover - root - nagios - nagios - -#### AWK #### - -Alternately, you can use [awk][6], which offers more powerful features to parse out fields. It offers a scripting language so you can filter out nearly everything that’s not relevant. - -For example, let’s say we have the following log line on an Ubuntu system and we want to extract the username that failed to login: - - Mar 24 08:28:18 ip-172-31-11-241 sshd[32701]: input_userauth_request: invalid user guest [preauth] - -Here’s how you can use the awk command. First, put a regular expression /sshd.*invalid user/ to match the sshd invalid user lines. Then print the ninth field using the default delimiter of space using { print $9 }. This outputs the usernames. - - $ awk '/sshd.*invalid user/ { print $9 }' /var/log/auth.log - guest - admin - info - test - ubnt - -You can read more about how to use regular expressions and print fields in the [Awk User’s Guide][7]. - -#### Log Management Systems #### - -Log management systems make parsing easier and enable users to quickly analyze large collections of log files. They can automatically parse standard log formats like common Linux logs or web server logs. This saves a lot of time because you don’t have to think about writing your own parsing logic when troubleshooting a system problem. - -Here you can see an example log message from sshd which has each of the fields remoteHost and user parsed out. This is a screenshot from Loggly, a cloud-based log management service. - -![](http://www.loggly.com/ultimate-guide/wp-content/uploads/2015/05/Screen-Shot-2015-03-12-at-11.25.09-AM.png) - -You can also do custom parsing for non-standard formats. A common tool to use is [Grok][8] which uses a library of common regular expressions to parse raw text into structured JSON. Here is an example configuration for Grok to parse kernel log files inside Logstash: - - filter{ - grok { - match => {"message" => "%{CISCOTIMESTAMP:timestamp} %{HOST:host} %{WORD:program}%{NOTSPACE} %{NOTSPACE}%{NUMBER:duration}%{NOTSPACE} %{GREEDYDATA:kernel_logs}" - } - } - -And here is what the parsed output looks like from Grok: - -![](http://www.loggly.com/ultimate-guide/wp-content/uploads/2015/05/Screen-Shot-2015-03-12-at-11.30.37-AM.png) - -### Filtering with Rsyslog and AWK ### - -Filtering allows you to search on a specific field value instead of doing a full text search. This makes your log analysis more accurate because it will ignore undesired matches from other parts of the log message. In order to search on a field value, you need to parse your logs first or at least have a way of searching based on the event structure. - -#### How to Filter on One App #### - -Often, you just want to see the logs from just one application. This is easy if your application always logs to a single file. It’s more complicated if you need to filter one application among many in an aggregated or centralized log. Here are several ways to do this: - -1. Use the rsyslog daemon to parse and filter logs. This example writes logs from the sshd application to a file named sshd-messages, then discards the event so it’s not repeated elsewhere. You can try this example by adding it to your rsyslog.conf file. - - :programname, isequal, “sshd” /var/log/sshd-messages - &~ - -2. Use command line tools like awk to extract the values of a particular field like the sshd username. This example is from an Ubuntu system. - - $ awk '/sshd.*invalid user/ { print $9 }' /var/log/auth.log - guest - admin - info - test - ubnt - -3. Use a log management system that automatically parses your logs, then click to filter on the desired application name. Here is a screenshot showing the syslog fields in a log management service called Loggly. We are filtering on the appName “sshd” as indicated by the Venn diagram icon. - -![](http://www.loggly.com/ultimate-guide/wp-content/uploads/2015/05/Screen-Shot-2015-03-12-at-11.05.02-AM.png) - -#### How to Filter on Errors #### - -One of the most common thing people want to see in their logs is errors. Unfortunately, the default syslog configuration doesn’t output the severity of errors directly, making it difficult to filter on them. - -There are two ways you can solve this problem. First, you can modify your rsyslog configuration to output the severity in the log file to make it easier to read and search. In your rsyslog configuration you can add a [template][9] with pri-text such as the following: - - "<%pri-text%> : %timegenerated%,%HOSTNAME%,%syslogtag%,%msg%n" - -This example gives you output in the following format. You can see that the severity in this message is err. - - : Mar 11 18:18:00,hoover-VirtualBox,su[5026]:, pam_authenticate: Authentication failure - -You can use awk or grep to search for just the error messages. In this example for Ubuntu, we’re including some surrounding syntax like the . and the > which match only this field. - - $ grep '.err>' /var/log/auth.log - : Mar 11 18:18:00,hoover-VirtualBox,su[5026]:, pam_authenticate: Authentication failure - -Your second option is to use a log management system. Good log management systems automatically parse syslog messages and extract the severity field. They also allow you to filter on log messages of a certain severity with a single click. - -Here is a screenshot from Loggly showing the syslog fields with the error severity highlighted to show we are filtering for errors: - -![](http://www.loggly.com/ultimate-guide/wp-content/uploads/2015/05/Screen-Shot-2015-03-12-at-11.00.36-AM.png) - --------------------------------------------------------------------------------- - -via: http://www.loggly.com/ultimate-guide/logging/analyzing-linux-logs/ - -作者:[Jason Skowronski][a] [Amy Echeverri][b] [ Sadequl Hussain][c] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://www.linkedin.com/in/jasonskowronski -[b]:https://www.linkedin.com/in/amyecheverri -[c]:https://www.linkedin.com/pub/sadequl-hussain/14/711/1a7 -[1]:http://linux.die.net/man/1/grep -[2]:http://linux.die.net/man/1/tail -[3]:http://ryanstutorials.net/linuxtutorial/grep.php -[4]:https://lucene.apache.org/core/2_9_4/queryparsersyntax.html -[5]:http://linux.die.net/man/1/cut -[6]:http://linux.die.net/man/1/awk -[7]:http://www.delorie.com/gnu/docs/gawk/gawk_26.html#IDX155 -[8]:http://logstash.net/docs/1.4.2/filters/grok -[9]:http://www.rsyslog.com/doc/v8-stable/configuration/templates.html diff --git a/translated/tech/20150522 Analyzing Linux Logs.md b/translated/tech/20150522 Analyzing Linux Logs.md new file mode 100644 index 0000000000..c037fc60aa --- /dev/null +++ b/translated/tech/20150522 Analyzing Linux Logs.md @@ -0,0 +1,181 @@ +Linux 日志分析 +============================================================================== +日志中有大量的信息需要你处理,尽管有时候想要提取并非想象中的容易。在这篇文章中我们会介绍一些你现在就能做的基本日志分析例子。我们还将设计一些更高级的分析,但这些需要你前期努力做出切当的设置,后期就能节省很多时间。对数据进行高级分析的例子包括生成汇总计数、对有效值进行过滤,等等。 + +我们首先会想你展示如何在命令行中使用多个不同的工具,然后展示了一个日志管理工具如何能自动完成大部分繁重工作从而使得日志分析变得简单。 + +### 用 Grep 搜索 ### + +搜索文本是查找信息最基本的方式。搜索文本最常用的工具是 [grep][1]。这个命令行工具在大部分 Linux 发行版中都有,它允许你用正则表达式搜索日志。一个正则表达式是用特殊的语言写的、能识别匹配文本的模式。最简单的模式就是用引号把你想要查找的字符串括起来。 + +#### 正则表达式 #### + +这是一个在 Ubuntu 系统中查找 “user hoover” 认证日志的例子: + + $ grep "user hoover" /var/log/auth.log + Accepted password for hoover from 10.0.2.2 port 4792 ssh2 + pam_unix(sshd:session): session opened for user hoover by (uid=0) + pam_unix(sshd:session): session closed for user hoover + +构建精确的正则表达式可能很难。例如,如果我们想要搜索一个类似端口 “4792” 的数字,它可能也会匹配时间戳、URLs 以及其它不需要的数据。Ubuntu 中下面的例子,它匹配了一个我们不想要的 Apache 日志。 + + $ grep "4792" /var/log/auth.log + Accepted password for hoover from 10.0.2.2 port 4792 ssh2 + 74.91.21.46 - - [31/Mar/2015:19:44:32 +0000] "GET /scripts/samples/search?q=4972HTTP/1.0" 404 545 "-" "-” + +#### 环绕搜索 #### + +另一个有用的小技巧是你可以用 grep 做环绕搜索。这会向你展示一个匹配前面或后面几行是什么。它能帮助你调试导致错误或问题的东西。B 选项展示前面几行,A 展示后面几行。举个例子,我们知道当一个人以管理员员身份登录失败时,他们也没有逆映射,也就意味着他们可能没有有效的域名。这非常可疑! + + $ grep -B 3 -A 2 'Invalid user' /var/log/auth.log + Apr 28 17:06:20 ip-172-31-11-241 sshd[12545]: reverse mapping checking getaddrinfo for 216-19-2-8.commspeed.net [216.19.2.8] failed - POSSIBLE BREAK-IN ATTEMPT! + Apr 28 17:06:20 ip-172-31-11-241 sshd[12545]: Received disconnect from 216.19.2.8: 11: Bye Bye [preauth] + Apr 28 17:06:20 ip-172-31-11-241 sshd[12547]: Invalid user admin from 216.19.2.8 + Apr 28 17:06:20 ip-172-31-11-241 sshd[12547]: input_userauth_request: invalid user admin [preauth] + Apr 28 17:06:20 ip-172-31-11-241 sshd[12547]: Received disconnect from 216.19.2.8: 11: Bye Bye [preauth] + +#### Tail #### + +你也可以把 grep 和 [tail][2] 结合使用来获取一个文件的最后几行,或者跟踪日志并实时打印。这在你做交互式更改的时候非常有用,例如启动服务器或者测试代码更改。 + + $ tail -f /var/log/auth.log | grep 'Invalid user' + Apr 30 19:49:48 ip-172-31-11-241 sshd[6512]: Invalid user ubnt from 219.140.64.136 + Apr 30 19:49:49 ip-172-31-11-241 sshd[6514]: Invalid user admin from 219.140.64.136 + +关于 grep 和正则表达式的详细介绍并不在该指南的范围,但 [Ryan’s Tutorials][3] 有更深入的介绍。 + +日志管理系统有更高的性能和更强大的搜索能力。它们通常会索引数据并进行并行查询,因此你可以很快的在几秒内就能搜索 GB 或 TB 的日志。相比之下,grep 就需要几分钟,在极端情况下可能甚至几小时。日志管理系统也使用类似 [Lucene][4] 的查询语言,它提供更简单的语法来检索数字、域以及其它。 + +### 用 Cut、 AWK、 和 Grok 解析 ### + +#### 命令行工具 #### + +Linux 提供了多个命令行工具用于文本解析和分析。当你想要快速解析少量数据时非常有用,但处理大量数据时可能需要很长时间。 + +#### Cut #### + +[cut][5] 命令允许你从分隔的日志解析域。分隔符是指能分开域或键值对的等号或逗号。 + +假设我们想从下面的日志中解析出用户: + + pam_unix(su:auth): authentication failure; logname=hoover uid=1000 euid=0 tty=/dev/pts/0 ruser=hoover rhost= user=root + +我们可以像下面这样用 cut 命令获取第八个等号后面的文本。这是一个 Ubuntu 系统上的例子: + + $ grep "authentication failure" /var/log/auth.log | cut -d '=' -f 8 + root + hoover + root + nagios + nagios + +#### AWK #### + +另外,你也可以使用 [awk][6],它能提供解析域更强大的功能。它提供了一个脚本语言,你可以过滤出几乎任何不相干的东西。 + +例如,假设在 Ubuntu 系统中我们有下面的一行日志,我们想要提取登录失败的用户名称: + + Mar 24 08:28:18 ip-172-31-11-241 sshd[32701]: input_userauth_request: invalid user guest [preauth] + +你可以像下面这样使用 awk 命令。首先,用一个正则表达式 /sshd.*invalid user/ 来匹配 sshd 无效用户行。然后用 { print $9 } 根据默认的分隔符空格打印第九个域。然后就输出了用户名。 + + $ awk '/sshd.*invalid user/ { print $9 }' /var/log/auth.log + guest + admin + info + test + ubnt + +你可以在 [Awk 用户指南][7] 中阅读更多关于如何使用正则表达式和输出域的信息。 + +#### 日志管理系统 #### + +日志管理系统使得解析变得更加简单,使用户能快速的分析很多的日志文件。他们能自动解析标准的日志格式,比如常见的 Linux 日志和 Web 服务器日志。这能节省很多时间,因为当处理系统问题的时候你不需要考虑写自己的解析逻辑。 + +下面是一个 sshd 日志消息的例子,解析出了每个 remoteHost 和 user。这是 Loggly 中的一张截图,它是一个基于云的日志管理服务。 + +![](http://www.loggly.com/ultimate-guide/wp-content/uploads/2015/05/Screen-Shot-2015-03-12-at-11.25.09-AM.png) + +你也可以对非标准格式自定义解析。一个常用的工具是 [Grok][8],它用一个常见正则表达式库解析原始文本为结构化 JSON。下面是一个 Grok 在 Logstash 中解析内核日志文件的事例配置: + + filter{ + grok { + match => {"message" => "%{CISCOTIMESTAMP:timestamp} %{HOST:host} %{WORD:program}%{NOTSPACE} %{NOTSPACE}%{NUMBER:duration}%{NOTSPACE} %{GREEDYDATA:kernel_logs}" + } + } + +下图是 Grok 解析后输出的结果: + +![](http://www.loggly.com/ultimate-guide/wp-content/uploads/2015/05/Screen-Shot-2015-03-12-at-11.30.37-AM.png) + +### 用 Rsyslog 和 AWK 过滤 ### + +过滤使得你能检索一个特定的域值而不是进行全文检索。这使你的日志分析更加准确,因为它会忽略来自其它部分日志信息不需要的匹配。为了对一个域值进行搜索,你首先需要解析日志或者至少有对事件结构进行检索的方式。 + +#### 如果对 App 进行过滤 #### + +通常,你可能只想看一个应用的日志。如果你的应用把记录都保存到一个文件中就会很容易。如果你需要在一个聚集或集中式日志中过滤一个应用就会比较复杂。下面有几种方法来实现: + +1. 用 rsyslog 守护进程解析和过滤日志。下面的例子将 sshd 应用的日志写入一个名为 sshd-message 的文件,然后丢弃事件也就不会在其它地方重复。你可以将它添加到你的 rsyslog.conf 文件中测试这个例子。 + + :programname, isequal, “sshd” /var/log/sshd-messages + &~ + +2. 用类似 awk 的命令行工具提取特定域的值,例如 sshd 用户名。下面是 Ubuntu 系统中的一个例子。 + + $ awk '/sshd.*invalid user/ { print $9 }' /var/log/auth.log + guest + admin + info + test + ubnt + +3. 用日志管理系统自动解析日志,然后在需要的应用名称上点击过滤。下面是在 Loggly 日志管理服务中提取 syslog 域的截图。我们对应用名称 “sshd” 进行过滤,如维恩图图标所示。 + +![](http://www.loggly.com/ultimate-guide/wp-content/uploads/2015/05/Screen-Shot-2015-03-12-at-11.05.02-AM.png) + +#### 如何过滤错误 #### + +一个人最希望看到日志中的错误。不幸的是,默认的 syslog 配置不直接输出错误的严重性,也就使得难以过滤它们。 + +这里有两个解决该问题的方法。首先,你可以修改你的 rsyslog 配置,在日志文件中输出错误的严重性,使得便于查看和检索。在你的 rsyslog 配置中你可以用 pri-text 添加一个 [模板][9],像下面这样: + + "<%pri-text%> : %timegenerated%,%HOSTNAME%,%syslogtag%,%msg%n" + +这个例子会按照下面的格式输出。你可以看到该信息中指示错误的 err。 + + : Mar 11 18:18:00,hoover-VirtualBox,su[5026]:, pam_authenticate: Authentication failure + +你可以用 awk 或者 grep 检索错误信息。在 Ubuntu 中,对这个例子,我们可以用一些环绕语法,例如 . 和 >,它们只会匹配这个域。 + + $ grep '.err>' /var/log/auth.log + : Mar 11 18:18:00,hoover-VirtualBox,su[5026]:, pam_authenticate: Authentication failure + +你的第二个选择是使用日志管理系统。好的日志管理系统能自动解析 syslog 消息并抽取错误域。它们也允许你用简单的点击过滤日志消息中的特定错误。 + +下面是 Loggly 中一个截图,显示了高亮错误严重性的 syslog 域,表示我们正在过滤错误: + +![](http://www.loggly.com/ultimate-guide/wp-content/uploads/2015/05/Screen-Shot-2015-03-12-at-11.00.36-AM.png) + +-------------------------------------------------------------------------------- + +via: http://www.loggly.com/ultimate-guide/logging/analyzing-linux-logs/ + +作者:[Jason Skowronski][a] [Amy Echeverri][b] [ Sadequl Hussain][c] +译者:[ictlyh](https://github.com/ictlyh) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://www.linkedin.com/in/jasonskowronski +[b]:https://www.linkedin.com/in/amyecheverri +[c]:https://www.linkedin.com/pub/sadequl-hussain/14/711/1a7 +[1]:http://linux.die.net/man/1/grep +[2]:http://linux.die.net/man/1/tail +[3]:http://ryanstutorials.net/linuxtutorial/grep.php +[4]:https://lucene.apache.org/core/2_9_4/queryparsersyntax.html +[5]:http://linux.die.net/man/1/cut +[6]:http://linux.die.net/man/1/awk +[7]:http://www.delorie.com/gnu/docs/gawk/gawk_26.html#IDX155 +[8]:http://logstash.net/docs/1.4.2/filters/grok +[9]:http://www.rsyslog.com/doc/v8-stable/configuration/templates.html From dba1249da1d325f56aa736e5216d6ac2b0f12eb1 Mon Sep 17 00:00:00 2001 From: geekpi Date: Sat, 1 Aug 2015 10:06:00 +0800 Subject: [PATCH 751/965] translating --- ... to Update Linux Kernel for Improved System Performance.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150728 How to Update Linux Kernel for Improved System Performance.md b/sources/tech/20150728 How to Update Linux Kernel for Improved System Performance.md index 4e238de09d..2ee2ff4f15 100644 --- a/sources/tech/20150728 How to Update Linux Kernel for Improved System Performance.md +++ b/sources/tech/20150728 How to Update Linux Kernel for Improved System Performance.md @@ -1,3 +1,5 @@ +Translating---geekpi + How to Update Linux Kernel for Improved System Performance ================================================================================ ![](http://cdn.makeuseof.com/wp-content/uploads/2015/07/update-linux-kernel-644x373.jpg?2c3c1f) @@ -124,4 +126,4 @@ via: http://www.makeuseof.com/tag/update-linux-kernel-improved-system-performanc [7]:http://www.makeuseof.com/tag/bleeding-edge-linux-fedora-rawhide/ [8]:http://www.makeuseof.com/tag/arch-linux-letting-you-build-your-linux-system-from-scratch/ [9]:http://www.makeuseof.com/tag/nano-vs-vim-terminal-text-editors-compared/ -[10]:https://wiki.archlinux.org/index.php/Pacman#Repositories \ No newline at end of file +[10]:https://wiki.archlinux.org/index.php/Pacman#Repositories From 5b0ae3268ba031a4eb9295f5b27c712c278484a9 Mon Sep 17 00:00:00 2001 From: geekpi Date: Sat, 1 Aug 2015 11:49:49 +0800 Subject: [PATCH 752/965] translated --- ... Kernel for Improved System Performance.md | 129 ------------------ ... Kernel for Improved System Performance.md | 129 ++++++++++++++++++ 2 files changed, 129 insertions(+), 129 deletions(-) delete mode 100644 sources/tech/20150728 How to Update Linux Kernel for Improved System Performance.md create mode 100644 translated/tech/20150728 How to Update Linux Kernel for Improved System Performance.md diff --git a/sources/tech/20150728 How to Update Linux Kernel for Improved System Performance.md b/sources/tech/20150728 How to Update Linux Kernel for Improved System Performance.md deleted file mode 100644 index 2ee2ff4f15..0000000000 --- a/sources/tech/20150728 How to Update Linux Kernel for Improved System Performance.md +++ /dev/null @@ -1,129 +0,0 @@ -Translating---geekpi - -How to Update Linux Kernel for Improved System Performance -================================================================================ -![](http://cdn.makeuseof.com/wp-content/uploads/2015/07/update-linux-kernel-644x373.jpg?2c3c1f) - -The rate of development for [the Linux kernel][1] is unprecedented, with a new major release approximately every two to three months. Each release offers several new features and improvements that a lot of people could take advantage of to make their computing experience faster, more efficient, or better in other ways. - -The problem, however, is that you usually can’t take advantage of these new kernel releases as soon as they come out — you have to wait until your distribution comes out with a new release that packs a newer kernel with it. We’ve previously laid out [the benefits for regularly updating your kernel][2], and you don’t have to wait to get your hands on them. We’ll show you how. - -> Disclaimer: As some of our literature may have mentioned before, updating your kernel does carry a (small) risk of breaking your system. If this is the case, it’s usually easy to pick an older kernel at boot time that works, but something may always go wrong. Therefore, we’re not responsible for any damage to your system — use at your own risk! - -### Prep Work ### - -![](http://cdn.makeuseof.com/wp-content/uploads/2015/07/linux_kernel_arch.jpg?2c3c1f) - -To update your kernel, you’ll first need to determine whether you’re using a 32-bit or 64-bit system. Open up a terminal window and run - - uname -a - -Then check to see if the output says x86_64 or i686. If it’s x86_64, then you’re running the 64-bit version; otherwise, you’re running the 32-bit version. Remember this, because it will be important. - -![](http://cdn.makeuseof.com/wp-content/uploads/2015/07/kernel_latest_version.jpg?2c3c1f) - -Next, visit the [official Linux kernel website][3]. This will tell you what the current stable version of the kernel is. You can try out release candidates if you’d like, but they are a lot less tested than the stable releases. Stick with the stable kernel unless you are certain you need a release candidate version. - -### Ubuntu Instructions ### - -It’s quite easy for Ubuntu and Ubuntu-derivative users to update their kernel, thanks to the Ubuntu Mainline Kernel PPA. Although it’s officially called a PPA, you cannot use it like other PPAs by adding them to your software sources list and expecting it to automatically update the kernel for you. Instead, it’s simply a webpage you navigate through to download the kernel you want. - -![](http://cdn.makeuseof.com/wp-content/uploads/2015/07/ubuntu_new_kernels.jpg?2c3c1f) - -Now, visit the [kernel PPA webpage][4] and scroll all the way to the bottom. The absolute bottom of the list will probably contain some release candidate versions (which you can see by the “rc” in the name), but just above them should be the latest stable kernel (to make this easier to explain, at the time of writing the stable version was 4.1.2). Click on that, and you’ll be presented with several options. You’ll need to grab three files and save them in their own folder (within the Downloads folder if you’d like) so that they’re isolated from all other files: - -- The “generic” header file for your architecture (in my case, 64-bit or “amd64″) -- The header file in the middle that has “all” towards the end of the filename -- The “generic” kernel file for your architecture (again, I would pick “amd64″ but if you use 32-bit you’ll need “i686″) - -You’ll notice that there are also “lowlatency” files available to download, but it’s fine to ignore this. These files are relatively unstable and are only made available for people who need their low-latency benefits if the general files don’t suffice for tasks such as audio recording. Again, the recommendation is to always use generic first and only try lowlatency if your performance isn’t good enough for certain tasks. No, gaming or Internet browsing aren’t excuses to try lowlatency. - -![](http://cdn.makeuseof.com/wp-content/uploads/2015/07/ubuntu_install_kernel.jpg?2c3c1f) - -You put these files into their own folder, right? Now open up the Terminal, use the - - cd - -command to go to your newly-created folder, such as - - cd /home/user/Downloads/Kernel - -and then run: - - sudo dpkg -i *.deb - -This command marks all .deb files within the folder as “to be installed” and then performs the installation. This is the recommended way to install these files because otherwise it’s easy to pick one file to install and it’ll complain about dependency issues. This approach avoids that problem. If you’re not sure what cd or sudo are, get a quick crash course on [essential Linux commands][5]. - -Once the installation is complete, **Restart** your system and you should be running the just-installed kernel! You can check this by running uname -a in the Terminal and checking the output. - -### Fedora Instructions ### - -If you use Fedora or one of its derivatives, the process is very similar to Ubuntu. There’s just a different location to grab different files, and a different command to install them. - -![](http://cdn.makeuseof.com/wp-content/uploads/2015/07/fedora_new_kernels.jpg?2c3c1f) - -VIew the list of the most [recent kernel builds for Fedora][6]. Pick the latest stable version out of the list, and then scroll down to either the i686 or x86_64 section, depending on your system’s architecture. In this section, you’ll need to grab the following files and save them in their own folder (such as “Kernel” within your Downloads folder, as an example): - -- kernel -- kernel-core -- kernel-headers -- kernel-modules -- kernel-modules-extra -- kernel-tools -- perf and python-perf (optional) - -If your system is i686 (32-bit) and you have 4GB of RAM or more, you’ll need to grab the PAE version of all of these files where available. PAE is an address extension technique used for 32-bit system to allow them to use more than 3GB of RAM. - -Now, use the - - cd - -command to go to that folder, such as - - cd /home/user/Downloads/Kernel - -and then run the following command to install all the files: - - yum --nogpgcheck localinstall *.rpm - -Finally **Restart** your computer and you should be running a new kernel! - -### Using Rawhide ### - -Alternatively, Fedora users can also simply [switch to Rawhide][7] and it’ll automatically update every package to the latest version, including the kernel. However, Rawhide is known to break quite often (especially early on in the development cycle) and should **not** be used on a system that you need to rely on. - -### Arch Instructions ### - -[Arch users][8] should always have the latest and greatest stable kernel available (or one pretty close to it). If you want to get even closer to the latest-released stable kernel, you can enable the testing repo which will give you access to major new releases roughly two to four weeks early. - -To do this, open the file located at - - /etc/pacman.conf - -with sudo permissions in [your favorite terminal text editor][9], and then uncomment (delete the pound symbols from the front of each line) the three lines associated with testing. If you have the multilib repository enabled, then do the same for the multilib-testing repository. See [this Arch Linux wiki page][10] if you need more information. - -Upgrading your kernel isn’t easy (done so intentionally), but it can give you a lot of benefits. So long as your new kernel didn’t break anything, you can now enjoy improved performance, better efficiency, support for more hardware, and potential new features. Especially if you’re running relatively new hardware, upgrading the kernel can really help out. - -**How has upgraded the kernel helped you? Do you think your favorite distribution’s policy on kernel releases is what it should be?** Let us know in the comments! - --------------------------------------------------------------------------------- - -via: http://www.makeuseof.com/tag/update-linux-kernel-improved-system-performance/ - -作者:[Danny Stieben][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.makeuseof.com/tag/author/danny/ -[1]:http://www.makeuseof.com/tag/linux-kernel-explanation-laymans-terms/ -[2]:http://www.makeuseof.com/tag/5-reasons-update-kernel-linux/ -[3]:http://www.kernel.org/ -[4]:http://kernel.ubuntu.com/~kernel-ppa/mainline/ -[5]:http://www.makeuseof.com/tag/an-a-z-of-linux-40-essential-commands-you-should-know/ -[6]:http://koji.fedoraproject.org/koji/packageinfo?packageID=8 -[7]:http://www.makeuseof.com/tag/bleeding-edge-linux-fedora-rawhide/ -[8]:http://www.makeuseof.com/tag/arch-linux-letting-you-build-your-linux-system-from-scratch/ -[9]:http://www.makeuseof.com/tag/nano-vs-vim-terminal-text-editors-compared/ -[10]:https://wiki.archlinux.org/index.php/Pacman#Repositories diff --git a/translated/tech/20150728 How to Update Linux Kernel for Improved System Performance.md b/translated/tech/20150728 How to Update Linux Kernel for Improved System Performance.md new file mode 100644 index 0000000000..2114549452 --- /dev/null +++ b/translated/tech/20150728 How to Update Linux Kernel for Improved System Performance.md @@ -0,0 +1,129 @@ +如何更新Linux内核提升系统性能 +================================================================================ +![](http://cdn.makeuseof.com/wp-content/uploads/2015/07/update-linux-kernel-644x373.jpg?2c3c1f) + +[Linux内核][1]内核的开发速度目前是空前,大概每2到3个月就会有一个主要的版本发布。每个发布都带来让很多人的计算更加快、更加有效率、或者更好的功能和提升。 + +问题是你不能在这些内核发布的时候就用它们-你要等到你的发行版带来新内核的发布。我们先前发布了[定期更新内核的好处][2],你不必等到那时。我们会向你展示该怎么做。 + +> 免责声明: 我们先前的一些文章已经提到过,升级内核会带来(很小的)破坏你系统的风险。在这种情况下,通常可以通过旧内核来使系统工作,但是有时还是不行。因此我们对系统的任何损坏都不负责-你自己承担风险! + +### 预备工作 ### + +![](http://cdn.makeuseof.com/wp-content/uploads/2015/07/linux_kernel_arch.jpg?2c3c1f) + +要更新你的内核,你首先要确定你使用的是32位还是64位的系统。打开终端并运行: + + uname -a + +检查一下输出的是x86_64还是i686。如果是x86_64,你就运行64位的版本,否则就运行32位的版本。记住这个因为这个很重要。 + +![](http://cdn.makeuseof.com/wp-content/uploads/2015/07/kernel_latest_version.jpg?2c3c1f) + +接下来,访问[官方Linux内核网站][3],它会告诉你目前稳定内核的版本。如果你喜欢你可以尝试发布预选版,但是这比稳定版少了很多测试。除非你确定想要用发布预选版否则就用稳定内核。 + +### Ubuntu指导 ### + +对Ubuntu及其衍生版的用户而言升级内核非常简单,这要感谢Ubuntu主线内核PPA。虽然,官方称为一个PPA。但是你不能像其他PPA一样用来添加它到你软件源列表中,并指望它自动升级你的内核。而它只是一个简单的网页,你可以下载到你想要的内核。 + +![](http://cdn.makeuseof.com/wp-content/uploads/2015/07/ubuntu_new_kernels.jpg?2c3c1f) + +现在,访问[内核PPA网页][4],并滚到底部。列表的最下面会含有最新发布的预选版本(你可以在名字中看到“rc”字样),但是这上面就可以看到最新的稳定版(为了更容易地解释这个,这时最新的稳定版是4.1.2)。点击它,你会看到几个选项。你需要下载3个文件并保存到各自的文件夹中(如果你喜欢的话可以在下载文件夹中),这样就可以将它们相互隔离了: + +- 针对架构的含“generic”的头文件(我这里是64位或者“amd64”) +- 中间的头文件在文件名末尾有“all” +- 针对架构的含“generic”内核文件(再说一次,我会用“amd64”,但是你如果用32位的,你需要使用“i686”) + +你会看到还有含有“lowlatency”的文件可以下面。但最好忽略它们。这些文件相对不稳定,并且只为那些通用文件不能满足像录音这类任务想要低延迟的人准备的。再说一次,首选通用版除非你特定的任务需求不能很好地满足。一般的游戏和网络浏览不是使用低延时版的借口。 + +![](http://cdn.makeuseof.com/wp-content/uploads/2015/07/ubuntu_install_kernel.jpg?2c3c1f) + +你把它们放在各自的文件夹下,对么?现在打开终端,使用 + + cd + +命令到新创建的文件夹下,像 + + cd /home/user/Downloads/Kernel + +接着运行: + + sudo dpkg -i *.deb + +这个命令会标记所有文件夹的“.deb”文件为“待安装”,接着执行安装。这是推荐的安装放大,因为除非可以很简单地选择一个文件安装,它总会报出依赖问题。这个方法可以避免这个问题。如果你不清楚cd和sudo是什么。快速地看一下[Linux基本命令][5]这篇文章。 + +安装完成后,**重启**你的系统,这时应该就会运行刚安装的内核了!你可以在命令行中使用uname -a来检查输出。 + +### Fedora指导 ### + +如果你使用的是Fedora或者它的衍生版,过程跟Ubuntu很类似。不同的是文件获取的位置不同,安装的命令也不同。 + +![](http://cdn.makeuseof.com/wp-content/uploads/2015/07/fedora_new_kernels.jpg?2c3c1f) + +查看[Fedora最新内核编译][6]列表。选取列表中最新的稳定版并滚到下面选择i686或者x86_64版。这依赖于你的系统架构。这时你需要下载下面这些文件并保存到它们对应的目录下(比如“Kernel”到下载目录下): + +- kernel +- kernel-core +- kernel-headers +- kernel-modules +- kernel-modules-extra +- kernel-tools +- perf and python-perf (optional) + +如果你的系统是i686(32位)同时你有4GB或者更大的内存,你需要下载所有这些文件的PAE版本。PAE是用于32位的地址扩展技术上,它允许你使用3GB的内存。 + +现在使用 + + cd + +命令进入文件夹,像这样 + + cd /home/user/Downloads/Kernel + +and then run the following command to install all the files: +接着运行下面的命令来安装所有的文件 + + yum --nogpgcheck localinstall *.rpm + +最后**重启**你的系统,这样你就可以运行新的内核了! + +### 使用 Rawhide ### + +另外一个方案是,Fedora用户也可以[切换到Rawhide][7],它会自动更新所有的包到最新版本,包括内核。然而,Rawhide经常会破坏系统(尤其是在早期的开发版中),它**不应该**在你日常使用的系统中用。 + +### Arch指导 ### + +[Arch][8]应该总是使用的是最新和最棒的稳定版(或者相当接近的版本)。如果你想要更接近最新发布的稳定版,你可以启用测试库提前2到3周获取到主要的更新。 + +要这么做,用[你喜欢的编辑器][9]以sudo权限打开下面的文件 + + /etc/pacman.conf + +接着取消注释带有testing的三行(删除行前面的井号)。如果你想要启用multilib仓库,就把multilib-testing也做相同的事情。如果想要了解更多参考[这个Arch的wiki界面][10]。 + +升级内核并不简单(有意这么做),但是这会给你带来很多好处。只要你的新内核不会破坏任何东西,你可以享受它带来的性能提升,更好的效率,支持更多的硬件和潜在的新特性。尤其是你正在使用相对更新的硬件,升级内核可以帮助到它。 + + +**怎么升级内核这篇文章帮助到你了么?你认为你所喜欢的发行版对内核的发布策略应该是怎样的?**。在评论栏让我们知道! + +-------------------------------------------------------------------------------- + +via: http://www.makeuseof.com/tag/update-linux-kernel-improved-system-performance/ + +作者:[Danny Stieben][a] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.makeuseof.com/tag/author/danny/ +[1]:http://www.makeuseof.com/tag/linux-kernel-explanation-laymans-terms/ +[2]:http://www.makeuseof.com/tag/5-reasons-update-kernel-linux/ +[3]:http://www.kernel.org/ +[4]:http://kernel.ubuntu.com/~kernel-ppa/mainline/ +[5]:http://www.makeuseof.com/tag/an-a-z-of-linux-40-essential-commands-you-should-know/ +[6]:http://koji.fedoraproject.org/koji/packageinfo?packageID=8 +[7]:http://www.makeuseof.com/tag/bleeding-edge-linux-fedora-rawhide/ +[8]:http://www.makeuseof.com/tag/arch-linux-letting-you-build-your-linux-system-from-scratch/ +[9]:http://www.makeuseof.com/tag/nano-vs-vim-terminal-text-editors-compared/ +[10]:https://wiki.archlinux.org/index.php/Pacman#Repositories From fc1fe1c59b1dc55bb6d7999166a40203a803d870 Mon Sep 17 00:00:00 2001 From: wxy Date: Sat, 1 Aug 2015 22:55:13 +0800 Subject: [PATCH 753/965] PUB:20150602 Howto Configure OpenVPN Server-Client on Ubuntu 15.04 @GOLinux --- ...e OpenVPN Server-Client on Ubuntu 15.04.md | 96 +++++++++---------- 1 file changed, 48 insertions(+), 48 deletions(-) rename {translated/tech => published}/20150602 Howto Configure OpenVPN Server-Client on Ubuntu 15.04.md (69%) diff --git a/translated/tech/20150602 Howto Configure OpenVPN Server-Client on Ubuntu 15.04.md b/published/20150602 Howto Configure OpenVPN Server-Client on Ubuntu 15.04.md similarity index 69% rename from translated/tech/20150602 Howto Configure OpenVPN Server-Client on Ubuntu 15.04.md rename to published/20150602 Howto Configure OpenVPN Server-Client on Ubuntu 15.04.md index 5b6c2fc6bd..7ec20f794e 100644 --- a/translated/tech/20150602 Howto Configure OpenVPN Server-Client on Ubuntu 15.04.md +++ b/published/20150602 Howto Configure OpenVPN Server-Client on Ubuntu 15.04.md @@ -1,18 +1,18 @@ -Ubuntu 15.04上配置OpenVPN服务器-客户端 +在 Ubuntu 15.04 上配置 OpenVPN 服务器和客户端 ================================================================================ -虚拟专用网(VPN)是几种用于建立与其它网络连接的网络技术中常见的一个名称。它被称为虚拟网,因为各个节点的连接不是通过物理线路实现的。而由于没有网络所有者的正确授权是不能通过公共线路访问到网络,所以它是专用的。 +虚拟专用网(VPN)常指几种通过其它网络建立连接技术。它之所以被称为“虚拟”,是因为各个节点间的连接不是通过物理线路实现的,而“专用”是指如果没有网络所有者的正确授权是不能被公开访问到。 ![](http://blog.linoxide.com/wp-content/uploads/2015/05/vpn_custom_illustration.jpg) -[OpenVPN][1]软件通过TUN/TAP驱动的帮助,使用TCP和UDP协议来传输数据。UDP协议和TUN驱动允许NAT后的用户建立到OpenVPN服务器的连接。此外,OpenVPN允许指定自定义端口。它提额外提供了灵活的配置,可以帮助你避免防火墙限制。 +[OpenVPN][1]软件借助TUN/TAP驱动使用TCP和UDP协议来传输数据。UDP协议和TUN驱动允许NAT后的用户建立到OpenVPN服务器的连接。此外,OpenVPN允许指定自定义端口。它提供了更多的灵活配置,可以帮助你避免防火墙限制。 OpenVPN中,由OpenSSL库和传输层安全协议(TLS)提供了安全和加密。TLS是SSL协议的一个改进版本。 -OpenSSL提供了两种加密方法:对称和非对称。下面,我们展示了如何配置OpenVPN的服务器端,以及如何预备使用带有公共密钥非对称加密和TLS协议基础结构(PKI)。 +OpenSSL提供了两种加密方法:对称和非对称。下面,我们展示了如何配置OpenVPN的服务器端,以及如何配置使用带有公共密钥基础结构(PKI)的非对称加密和TLS协议。 ### 服务器端配置 ### -首先,我们必须安装OpenVPN。在Ubuntu 15.04和其它带有‘apt’报管理器的Unix系统中,可以通过如下命令安装: +首先,我们必须安装OpenVPN软件。在Ubuntu 15.04和其它带有‘apt’包管理器的Unix系统中,可以通过如下命令安装: sudo apt-get install openvpn @@ -20,7 +20,7 @@ OpenSSL提供了两种加密方法:对称和非对称。下面,我们展示 sudo apt-get unstall easy-rsa -**注意**: 所有接下来的命令要以超级用户权限执行,如在“sudo -i”命令后;此外,你可以使用“sudo -E”作为接下来所有命令的前缀。 +**注意**: 所有接下来的命令要以超级用户权限执行,如在使用`sudo -i`命令后执行,或者你可以使用`sudo -E`作为接下来所有命令的前缀。 开始之前,我们需要拷贝“easy-rsa”到openvpn文件夹。 @@ -32,15 +32,15 @@ OpenSSL提供了两种加密方法:对称和非对称。下面,我们展示 cd /etc/openvpn/easy-rsa/2.0 -这里,我们开启了一个密钥生成进程。 +这里,我们开始密钥生成进程。 -首先,我们编辑一个“var”文件。为了简化生成过程,我们需要在里面指定数据。这里是“var”文件的一个样例: +首先,我们编辑一个“vars”文件。为了简化生成过程,我们需要在里面指定数据。这里是“vars”文件的一个样例: - export KEY_COUNTRY="US" - export KEY_PROVINCE="CA" - export KEY_CITY="SanFrancisco" - export KEY_ORG="Fort-Funston" - export KEY_EMAIL="my@myhost.mydomain" + export KEY_COUNTRY="CN" + export KEY_PROVINCE="BJ" + export KEY_CITY="Beijing" + export KEY_ORG="Linux.CN" + export KEY_EMAIL="open@vpn.linux.cn" export KEY_OU=server 希望这些字段名称对你而言已经很清楚,不需要进一步说明了。 @@ -61,7 +61,7 @@ OpenSSL提供了两种加密方法:对称和非对称。下面,我们展示 ./build-ca -在对话中,我们可以看到默认的变量,这些变量是我们先前在“vars”中指定的。我们可以检查以下,如有必要进行编辑,然后按回车几次。对话如下 +在对话中,我们可以看到默认的变量,这些变量是我们先前在“vars”中指定的。我们可以检查一下,如有必要进行编辑,然后按回车几次。对话如下 Generating a 2048 bit RSA private key .............................................+++ @@ -75,14 +75,14 @@ OpenSSL提供了两种加密方法:对称和非对称。下面,我们展示 For some fields there will be a default value, If you enter '.', the field will be left blank. ----- - Country Name (2 letter code) [US]: - State or Province Name (full name) [CA]: - Locality Name (eg, city) [SanFrancisco]: - Organization Name (eg, company) [Fort-Funston]: - Organizational Unit Name (eg, section) [MyOrganizationalUnit]: - Common Name (eg, your name or your server's hostname) [Fort-Funston CA]: + Country Name (2 letter code) [CN]: + State or Province Name (full name) [BJ]: + Locality Name (eg, city) [Beijing]: + Organization Name (eg, company) [Linux.CN]: + Organizational Unit Name (eg, section) [Tech]: + Common Name (eg, your name or your server's hostname) [Linux.CN CA]: Name [EasyRSA]: - Email Address [me@myhost.mydomain]: + Email Address [open@vpn.linux.cn]: 接下来,我们需要生成一个服务器密钥 @@ -102,14 +102,14 @@ OpenSSL提供了两种加密方法:对称和非对称。下面,我们展示 For some fields there will be a default value, If you enter '.', the field will be left blank. ----- - Country Name (2 letter code) [US]: - State or Province Name (full name) [CA]: - Locality Name (eg, city) [SanFrancisco]: - Organization Name (eg, company) [Fort-Funston]: - Organizational Unit Name (eg, section) [MyOrganizationalUnit]: - Common Name (eg, your name or your server's hostname) [server]: + Country Name (2 letter code) [CN]: + State or Province Name (full name) [BJ]: + Locality Name (eg, city) [Beijing]: + Organization Name (eg, company) [Linux.CN]: + Organizational Unit Name (eg, section) [Tech]: + Common Name (eg, your name or your server's hostname) [Linux.CN server]: Name [EasyRSA]: - Email Address [me@myhost.mydomain]: + Email Address [open@vpn.linux.cn]: Please enter the following 'extra' attributes to be sent with your certificate request @@ -119,14 +119,14 @@ OpenSSL提供了两种加密方法:对称和非对称。下面,我们展示 Check that the request matches the signature Signature ok The Subject's Distinguished Name is as follows - countryName :PRINTABLE:'US' - stateOrProvinceName :PRINTABLE:'CA' - localityName :PRINTABLE:'SanFrancisco' - organizationName :PRINTABLE:'Fort-Funston' - organizationalUnitName:PRINTABLE:'MyOrganizationalUnit' - commonName :PRINTABLE:'server' + countryName :PRINTABLE:'CN' + stateOrProvinceName :PRINTABLE:'BJ' + localityName :PRINTABLE:'Beijing' + organizationName :PRINTABLE:'Linux.CN' + organizationalUnitName:PRINTABLE:'Tech' + commonName :PRINTABLE:'Linux.CN server' name :PRINTABLE:'EasyRSA' - emailAddress :IA5STRING:'me@myhost.mydomain' + emailAddress :IA5STRING:'open@vpn.linux.cn' Certificate is to be certified until May 22 19:00:25 2025 GMT (3650 days) Sign the certificate? [y/n]:y 1 out of 1 certificate requests certified, commit? [y/n]y @@ -143,7 +143,7 @@ OpenSSL提供了两种加密方法:对称和非对称。下面,我们展示 Generating DH parameters, 2048 bit long safe prime, generator 2 This is going to take a long time - ................................+................ + ................................+................<许多的点> 在漫长的等待之后,我们可以继续生成最后的密钥了,该密钥用于TLS验证。命令如下: @@ -176,7 +176,7 @@ OpenSSL提供了两种加密方法:对称和非对称。下面,我们展示 ### Unix的客户端配置 ### -假定我们有一台装有类Unix操作系统的设备,比如Ubuntu 15.04,并安装有OpenVPN。我们想要从先前的部分连接到OpenVPN服务器。首先,我们需要为客户端生成密钥。为了生成该密钥,请转到服务器上的目录中: +假定我们有一台装有类Unix操作系统的设备,比如Ubuntu 15.04,并安装有OpenVPN。我们想要连接到前面建立的OpenVPN服务器。首先,我们需要为客户端生成密钥。为了生成该密钥,请转到服务器上的对应目录中: cd /etc/openvpn/easy-rsa/2.0 @@ -211,7 +211,7 @@ OpenSSL提供了两种加密方法:对称和非对称。下面,我们展示 dev tun proto udp - # IP and Port of remote host with OpenVPN server + # 远程 OpenVPN 服务器的 IP 和 端口号 remote 111.222.333.444 1194 resolv-retry infinite @@ -243,7 +243,7 @@ OpenSSL提供了两种加密方法:对称和非对称。下面,我们展示 安卓设备上的OpenVPN配置和Unix系统上的十分类似,我们需要一个含有配置文件、密钥和证书的包。文件列表如下: -- configuration file (.ovpn), +- 配置文件 (扩展名 .ovpn), - ca.crt, - dh2048.pem, - client.crt, @@ -257,7 +257,7 @@ OpenSSL提供了两种加密方法:对称和非对称。下面,我们展示 dev tun proto udp - # IP and Port of remote host with OpenVPN server + # 远程 OpenVPN 服务器的 IP 和 端口号 remote 111.222.333.444 1194 resolv-retry infinite @@ -274,21 +274,21 @@ OpenSSL提供了两种加密方法:对称和非对称。下面,我们展示 所有这些文件我们必须移动我们设备的SD卡上。 -然后,我们需要安装[OpenVPN连接][2]。 +然后,我们需要安装一个[OpenVPN Connect][2] 应用。 接下来,配置过程很是简单: - open setting of OpenVPN and select Import options - select Import Profile from SD card option - in opened window go to folder with prepared files and select .ovpn file - application offered us to create a new profile - tap on the Connect button and wait a second +- 打开 OpenVPN 并选择“Import”选项 +- 选择“Import Profile from SD card” +- 在打开的窗口中导航到我们放置好文件的目录,并选择那个 .ovpn 文件 +- 应用会要求我们创建一个新的配置文件 +- 点击“Connect”按钮并稍等一下 搞定。现在,我们的安卓设备已经通过安全的VPN连接连接到我们的专用网。 ### 尾声 ### -虽然OpenVPN初始配置花费不少时间,但是简易客户端配置为我们弥补了时间上的损失,也提供了从任何设备连接的能力。此外,OpenVPN提供了一个很高的安全等级,以及从不同地方连接的能力,包括位于NAT后面的客户端。因此,OpenVPN可以同时在家和在企业中使用。 +虽然OpenVPN初始配置花费不少时间,但是简易的客户端配置为我们弥补了时间上的损失,也提供了从任何设备连接的能力。此外,OpenVPN提供了一个很高的安全等级,以及从不同地方连接的能力,包括位于NAT后面的客户端。因此,OpenVPN可以同时在家和企业中使用。 -------------------------------------------------------------------------------- @@ -296,7 +296,7 @@ via: http://linoxide.com/ubuntu-how-to/configure-openvpn-server-client-ubuntu-15 作者:[Ivan Zabrovskiy][a] 译者:[GOLinux](https://github.com/GOLinux) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 820aed5474fc757f233339713410d0767678ec0c Mon Sep 17 00:00:00 2001 From: wxy Date: Sat, 1 Aug 2015 23:33:38 +0800 Subject: [PATCH 754/965] PUB:20150522 Analyzing Linux Logs @ictlyh --- .../20150522 Analyzing Linux Logs.md | 66 ++++++++++--------- 1 file changed, 34 insertions(+), 32 deletions(-) rename {translated/tech => published}/20150522 Analyzing Linux Logs.md (71%) diff --git a/translated/tech/20150522 Analyzing Linux Logs.md b/published/20150522 Analyzing Linux Logs.md similarity index 71% rename from translated/tech/20150522 Analyzing Linux Logs.md rename to published/20150522 Analyzing Linux Logs.md index c037fc60aa..5c7e53c629 100644 --- a/translated/tech/20150522 Analyzing Linux Logs.md +++ b/published/20150522 Analyzing Linux Logs.md @@ -1,31 +1,33 @@ -Linux 日志分析 +如何分析 Linux 日志 ============================================================================== -日志中有大量的信息需要你处理,尽管有时候想要提取并非想象中的容易。在这篇文章中我们会介绍一些你现在就能做的基本日志分析例子。我们还将设计一些更高级的分析,但这些需要你前期努力做出切当的设置,后期就能节省很多时间。对数据进行高级分析的例子包括生成汇总计数、对有效值进行过滤,等等。 +![](http://www.loggly.com/ultimate-guide/wp-content/uploads/2015/05/Linux-Copy@2x1.png) -我们首先会想你展示如何在命令行中使用多个不同的工具,然后展示了一个日志管理工具如何能自动完成大部分繁重工作从而使得日志分析变得简单。 +日志中有大量的信息需要你处理,尽管有时候想要提取并非想象中的容易。在这篇文章中我们会介绍一些你现在就能做的基本日志分析例子(只需要搜索即可)。我们还将涉及一些更高级的分析,但这些需要你前期努力做出适当的设置,后期就能节省很多时间。对数据进行高级分析的例子包括生成汇总计数、对有效值进行过滤,等等。 + +我们首先会向你展示如何在命令行中使用多个不同的工具,然后展示了一个日志管理工具如何能自动完成大部分繁重工作从而使得日志分析变得简单。 ### 用 Grep 搜索 ### -搜索文本是查找信息最基本的方式。搜索文本最常用的工具是 [grep][1]。这个命令行工具在大部分 Linux 发行版中都有,它允许你用正则表达式搜索日志。一个正则表达式是用特殊的语言写的、能识别匹配文本的模式。最简单的模式就是用引号把你想要查找的字符串括起来。 +搜索文本是查找信息最基本的方式。搜索文本最常用的工具是 [grep][1]。这个命令行工具在大部分 Linux 发行版中都有,它允许你用正则表达式搜索日志。正则表达式是一种用特殊的语言写的、能识别匹配文本的模式。最简单的模式就是用引号把你想要查找的字符串括起来。 #### 正则表达式 #### -这是一个在 Ubuntu 系统中查找 “user hoover” 认证日志的例子: +这是一个在 Ubuntu 系统的认证日志中查找 “user hoover” 的例子: $ grep "user hoover" /var/log/auth.log Accepted password for hoover from 10.0.2.2 port 4792 ssh2 pam_unix(sshd:session): session opened for user hoover by (uid=0) pam_unix(sshd:session): session closed for user hoover -构建精确的正则表达式可能很难。例如,如果我们想要搜索一个类似端口 “4792” 的数字,它可能也会匹配时间戳、URLs 以及其它不需要的数据。Ubuntu 中下面的例子,它匹配了一个我们不想要的 Apache 日志。 +构建精确的正则表达式可能很难。例如,如果我们想要搜索一个类似端口 “4792” 的数字,它可能也会匹配时间戳、URL 以及其它不需要的数据。Ubuntu 中下面的例子,它匹配了一个我们不想要的 Apache 日志。 $ grep "4792" /var/log/auth.log Accepted password for hoover from 10.0.2.2 port 4792 ssh2 - 74.91.21.46 - - [31/Mar/2015:19:44:32 +0000] "GET /scripts/samples/search?q=4972HTTP/1.0" 404 545 "-" "-” + 74.91.21.46 - - [31/Mar/2015:19:44:32 +0000] "GET /scripts/samples/search?q=4972 HTTP/1.0" 404 545 "-" "-” #### 环绕搜索 #### -另一个有用的小技巧是你可以用 grep 做环绕搜索。这会向你展示一个匹配前面或后面几行是什么。它能帮助你调试导致错误或问题的东西。B 选项展示前面几行,A 展示后面几行。举个例子,我们知道当一个人以管理员员身份登录失败时,他们也没有逆映射,也就意味着他们可能没有有效的域名。这非常可疑! +另一个有用的小技巧是你可以用 grep 做环绕搜索。这会向你展示一个匹配前面或后面几行是什么。它能帮助你调试导致错误或问题的东西。`B` 选项展示前面几行,`A` 选项展示后面几行。举个例子,我们知道当一个人以管理员员身份登录失败时,同时他们的 IP 也没有反向解析,也就意味着他们可能没有有效的域名。这非常可疑! $ grep -B 3 -A 2 'Invalid user' /var/log/auth.log Apr 28 17:06:20 ip-172-31-11-241 sshd[12545]: reverse mapping checking getaddrinfo for 216-19-2-8.commspeed.net [216.19.2.8] failed - POSSIBLE BREAK-IN ATTEMPT! @@ -42,7 +44,7 @@ Linux 日志分析 Apr 30 19:49:48 ip-172-31-11-241 sshd[6512]: Invalid user ubnt from 219.140.64.136 Apr 30 19:49:49 ip-172-31-11-241 sshd[6514]: Invalid user admin from 219.140.64.136 -关于 grep 和正则表达式的详细介绍并不在该指南的范围,但 [Ryan’s Tutorials][3] 有更深入的介绍。 +关于 grep 和正则表达式的详细介绍并不在本指南的范围,但 [Ryan’s Tutorials][3] 有更深入的介绍。 日志管理系统有更高的性能和更强大的搜索能力。它们通常会索引数据并进行并行查询,因此你可以很快的在几秒内就能搜索 GB 或 TB 的日志。相比之下,grep 就需要几分钟,在极端情况下可能甚至几小时。日志管理系统也使用类似 [Lucene][4] 的查询语言,它提供更简单的语法来检索数字、域以及其它。 @@ -54,13 +56,13 @@ Linux 提供了多个命令行工具用于文本解析和分析。当你想要 #### Cut #### -[cut][5] 命令允许你从分隔的日志解析域。分隔符是指能分开域或键值对的等号或逗号。 +[cut][5] 命令允许你从有分隔符的日志解析字段。分隔符是指能分开字段或键值对的等号或逗号等。 假设我们想从下面的日志中解析出用户: pam_unix(su:auth): authentication failure; logname=hoover uid=1000 euid=0 tty=/dev/pts/0 ruser=hoover rhost= user=root -我们可以像下面这样用 cut 命令获取第八个等号后面的文本。这是一个 Ubuntu 系统上的例子: +我们可以像下面这样用 cut 命令获取用等号分割后的第八个字段的文本。这是一个 Ubuntu 系统上的例子: $ grep "authentication failure" /var/log/auth.log | cut -d '=' -f 8 root @@ -71,13 +73,13 @@ Linux 提供了多个命令行工具用于文本解析和分析。当你想要 #### AWK #### -另外,你也可以使用 [awk][6],它能提供解析域更强大的功能。它提供了一个脚本语言,你可以过滤出几乎任何不相干的东西。 +另外,你也可以使用 [awk][6],它能提供更强大的解析字段功能。它提供了一个脚本语言,你可以过滤出几乎任何不相干的东西。 例如,假设在 Ubuntu 系统中我们有下面的一行日志,我们想要提取登录失败的用户名称: Mar 24 08:28:18 ip-172-31-11-241 sshd[32701]: input_userauth_request: invalid user guest [preauth] -你可以像下面这样使用 awk 命令。首先,用一个正则表达式 /sshd.*invalid user/ 来匹配 sshd 无效用户行。然后用 { print $9 } 根据默认的分隔符空格打印第九个域。然后就输出了用户名。 +你可以像下面这样使用 awk 命令。首先,用一个正则表达式 /sshd.*invalid user/ 来匹配 sshd invalid user 行。然后用 { print $9 } 根据默认的分隔符空格打印第九个字段。这样就输出了用户名。 $ awk '/sshd.*invalid user/ { print $9 }' /var/log/auth.log guest @@ -86,17 +88,17 @@ Linux 提供了多个命令行工具用于文本解析和分析。当你想要 test ubnt -你可以在 [Awk 用户指南][7] 中阅读更多关于如何使用正则表达式和输出域的信息。 +你可以在 [Awk 用户指南][7] 中阅读更多关于如何使用正则表达式和输出字段的信息。 #### 日志管理系统 #### -日志管理系统使得解析变得更加简单,使用户能快速的分析很多的日志文件。他们能自动解析标准的日志格式,比如常见的 Linux 日志和 Web 服务器日志。这能节省很多时间,因为当处理系统问题的时候你不需要考虑写自己的解析逻辑。 +日志管理系统使得解析变得更加简单,使用户能快速的分析很多的日志文件。他们能自动解析标准的日志格式,比如常见的 Linux 日志和 Web 服务器日志。这能节省很多时间,因为当处理系统问题的时候你不需要考虑自己写解析逻辑。 下面是一个 sshd 日志消息的例子,解析出了每个 remoteHost 和 user。这是 Loggly 中的一张截图,它是一个基于云的日志管理服务。 ![](http://www.loggly.com/ultimate-guide/wp-content/uploads/2015/05/Screen-Shot-2015-03-12-at-11.25.09-AM.png) -你也可以对非标准格式自定义解析。一个常用的工具是 [Grok][8],它用一个常见正则表达式库解析原始文本为结构化 JSON。下面是一个 Grok 在 Logstash 中解析内核日志文件的事例配置: +你也可以对非标准格式自定义解析。一个常用的工具是 [Grok][8],它用一个常见正则表达式库,可以解析原始文本为结构化 JSON。下面是一个 Grok 在 Logstash 中解析内核日志文件的事例配置: filter{ grok { @@ -110,29 +112,29 @@ Linux 提供了多个命令行工具用于文本解析和分析。当你想要 ### 用 Rsyslog 和 AWK 过滤 ### -过滤使得你能检索一个特定的域值而不是进行全文检索。这使你的日志分析更加准确,因为它会忽略来自其它部分日志信息不需要的匹配。为了对一个域值进行搜索,你首先需要解析日志或者至少有对事件结构进行检索的方式。 +过滤使得你能检索一个特定的字段值而不是进行全文检索。这使你的日志分析更加准确,因为它会忽略来自其它部分日志信息不需要的匹配。为了对一个字段值进行搜索,你首先需要解析日志或者至少有对事件结构进行检索的方式。 -#### 如果对 App 进行过滤 #### +#### 如何对应用进行过滤 #### 通常,你可能只想看一个应用的日志。如果你的应用把记录都保存到一个文件中就会很容易。如果你需要在一个聚集或集中式日志中过滤一个应用就会比较复杂。下面有几种方法来实现: -1. 用 rsyslog 守护进程解析和过滤日志。下面的例子将 sshd 应用的日志写入一个名为 sshd-message 的文件,然后丢弃事件也就不会在其它地方重复。你可以将它添加到你的 rsyslog.conf 文件中测试这个例子。 +1. 用 rsyslog 守护进程解析和过滤日志。下面的例子将 sshd 应用的日志写入一个名为 sshd-message 的文件,然后丢弃事件以便它不会在其它地方重复出现。你可以将它添加到你的 rsyslog.conf 文件中测试这个例子。 - :programname, isequal, “sshd” /var/log/sshd-messages - &~ + :programname, isequal, “sshd” /var/log/sshd-messages + &~ -2. 用类似 awk 的命令行工具提取特定域的值,例如 sshd 用户名。下面是 Ubuntu 系统中的一个例子。 +2. 用类似 awk 的命令行工具提取特定字段的值,例如 sshd 用户名。下面是 Ubuntu 系统中的一个例子。 - $ awk '/sshd.*invalid user/ { print $9 }' /var/log/auth.log - guest - admin - info - test - ubnt + $ awk '/sshd.*invalid user/ { print $9 }' /var/log/auth.log + guest + admin + info + test + ubnt 3. 用日志管理系统自动解析日志,然后在需要的应用名称上点击过滤。下面是在 Loggly 日志管理服务中提取 syslog 域的截图。我们对应用名称 “sshd” 进行过滤,如维恩图图标所示。 -![](http://www.loggly.com/ultimate-guide/wp-content/uploads/2015/05/Screen-Shot-2015-03-12-at-11.05.02-AM.png) + ![](http://www.loggly.com/ultimate-guide/wp-content/uploads/2015/05/Screen-Shot-2015-03-12-at-11.05.02-AM.png) #### 如何过滤错误 #### @@ -146,7 +148,7 @@ Linux 提供了多个命令行工具用于文本解析和分析。当你想要 : Mar 11 18:18:00,hoover-VirtualBox,su[5026]:, pam_authenticate: Authentication failure -你可以用 awk 或者 grep 检索错误信息。在 Ubuntu 中,对这个例子,我们可以用一些环绕语法,例如 . 和 >,它们只会匹配这个域。 +你可以用 awk 或者 grep 检索错误信息。在 Ubuntu 中,对这个例子,我们可以用一些语法特征,例如 . 和 >,它们只会匹配这个域。 $ grep '.err>' /var/log/auth.log : Mar 11 18:18:00,hoover-VirtualBox,su[5026]:, pam_authenticate: Authentication failure @@ -161,9 +163,9 @@ Linux 提供了多个命令行工具用于文本解析和分析。当你想要 via: http://www.loggly.com/ultimate-guide/logging/analyzing-linux-logs/ -作者:[Jason Skowronski][a] [Amy Echeverri][b] [ Sadequl Hussain][c] +作者:[Jason Skowronski][a],[Amy Echeverri][b],[ Sadequl Hussain][c] 译者:[ictlyh](https://github.com/ictlyh) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From d643100f422d15c3d3858304b8aa3a65369d3a82 Mon Sep 17 00:00:00 2001 From: wxy Date: Sat, 1 Aug 2015 23:35:42 +0800 Subject: [PATCH 755/965] =?UTF-8?q?=E5=BD=92=E6=A1=A3=20201507?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... And Secure Tool To Sync Files or Folders Between Computers.md | 0 ... Apache '.htaccess' Tricks to Secure and Customize Websites.md | 0 ...mal BASH like line editing is supported GRUB Error In Linux.md | 0 ...0150309 Comparative Introduction To FreeBSD For Linux Users.md | 0 published/{ => 201507}/20150401 ZMap Documentation.md | 0 .../20150407 10 Truly Amusing Easter Eggs in Linux.md | 0 ...150410 10 Top Distributions in Demand to Get Your Dream Job.md | 0 ...age 'Systemd' Services and Units Using 'Systemctl' in Linux.md | 0 ...and Line Tool to Output Rainbow Of Colors in Linux Terminal.md | 0 ...Linux Better than OS X GNU Open Source and Apple in History.md | 0 .../20150526 20 Useful Terminal Emulators for Linux.md | 0 ...7 Animated Wallpaper Adds Live Backgrounds To Linux Distros.md | 0 ...7 How to Develop Own Custom Linux Distribution From Scratch.md | 0 ...0150527 How to edit your documents collaboratively on Linux.md | 0 .../20150601 How to monitor Linux servers with SNMP and Cacti.md | 0 .../20150601 How to monitor common services with Nagios.md | 0 ...150603 Installing Ruby on Rails using rbenv on Ubuntu 15.04.md | 0 .../20150604 How to access SQLite database in Perl.md | 0 ...ate Filenames Having Spaces and Special Characters in Linux.md | 0 .../{ => 201507}/20150610 How to secure your Linux server.md | 0 ...0610 watch--Repeat Linux or Unix Commands Regular Intervals.md | 0 ...How to Configure Apache Containers with Docker on Fedora 22.md | 0 ...0150612 How to Configure Swarm Native Clustering for Docker.md | 0 ... Line Tool to Print Color ANSI Logos of Linux Distributions.md | 0 .../{ => 201507}/20150615 How to combine two graphs on Cacti.md | 0 ...x, Apache, MariaDB, PHP or PhpMyAdmin in RHEL or CentOS 7.0.md | 0 published/{ => 201507}/20150616 LINUX 101--POWER UP YOUR SHELL.md | 0 .../{ => 201507}/20150616 Linux Humor on the Command-line.md | 0 published/{ => 201507}/20150616 XBMC--build a remote control.md | 0 ...An Ultimate Web Browser for Anonymous Web Browsing in Linux.md | 0 ...How to Setup Node.JS on Ubuntu 15.04 with Different Methods.md | 0 .../20150618 What will be the future of Linux without Linus.md | 0 ...0150625 Screen Capture Made Easy with these Dedicated Tools.md | 0 ...0629 4 Useful Tips on mkdir, tar and kill Commands in Linux.md | 0 .../20150629 Backup with these DeDuplicating Encryption Tools.md | 0 ... First Stable Version Of Atom Code Editor Has Been Released.md | 0 published/{ => 201507}/20150706 PHP Security.md | 0 ...50709 7 command line tools for monitoring your Linux system.md | 0 .../20150709 Install Google Hangouts Desktop Client In Linux.md | 0 ...alds Says People Who Believe in AI Singularity Are on Drugs.md | 0 ...x 'tar--Exiting with failure status due to previous errors'.md | 0 ...AQs with Answers--How to install a Brother printer on Linux.md | 0 ...w to open multiple tabs in a GNOME terminal on Ubuntu 15.04.md | 0 ...50709 Why is the ibdata1 file continuously growing in MySQL.md | 0 ... How To Fix System Program Problem Detected In Ubuntu 14.04.md | 0 published/{ => 201507}/20150713 How to manage Vim plugins.md | 0 .../20150716 4 CCleaner Alternatives For Ubuntu Linux.md | 0 ...Crossroads) Load Balancer for Web Servers on RHEL or CentOS.md | 0 ... 12 Useful PHP Commandline Usage Every Linux User Must Know.md | 0 ... to Use and Execute PHP Codes in Linux Command Line--Part 1.md | 0 ...tall Plex Media Server On Ubuntu or CentOS 7.1 or Fedora 22.md | 0 published/{ => 201507}/PHP 7 upgrading.md | 0 52 files changed, 0 insertions(+), 0 deletions(-) rename published/{ => 201507}/20150121 Syncthing--A Private And Secure Tool To Sync Files or Folders Between Computers.md (100%) rename published/{ => 201507}/20150127 25 Useful Apache '.htaccess' Tricks to Secure and Customize Websites.md (100%) rename published/{ => 201507}/20150227 Fix Minimal BASH like line editing is supported GRUB Error In Linux.md (100%) rename published/{ => 201507}/20150309 Comparative Introduction To FreeBSD For Linux Users.md (100%) rename published/{ => 201507}/20150401 ZMap Documentation.md (100%) rename published/{ => 201507}/20150407 10 Truly Amusing Easter Eggs in Linux.md (100%) rename published/{ => 201507}/20150410 10 Top Distributions in Demand to Get Your Dream Job.md (100%) rename published/{ => 201507}/20150505 How to Manage 'Systemd' Services and Units Using 'Systemctl' in Linux.md (100%) rename published/{ => 201507}/20150515 Lolcat--A Command Line Tool to Output Rainbow Of Colors in Linux Terminal.md (100%) rename published/{ => 201507}/20150520 Is Linux Better than OS X GNU Open Source and Apple in History.md (100%) rename published/{ => 201507}/20150526 20 Useful Terminal Emulators for Linux.md (100%) rename published/{ => 201507}/20150527 Animated Wallpaper Adds Live Backgrounds To Linux Distros.md (100%) rename published/{ => 201507}/20150527 How to Develop Own Custom Linux Distribution From Scratch.md (100%) rename published/{ => 201507}/20150527 How to edit your documents collaboratively on Linux.md (100%) rename published/{ => 201507}/20150601 How to monitor Linux servers with SNMP and Cacti.md (100%) rename published/{ => 201507}/20150601 How to monitor common services with Nagios.md (100%) rename published/{ => 201507}/20150603 Installing Ruby on Rails using rbenv on Ubuntu 15.04.md (100%) rename published/{ => 201507}/20150604 How to access SQLite database in Perl.md (100%) rename published/{ => 201507}/20150610 How to Manipulate Filenames Having Spaces and Special Characters in Linux.md (100%) rename published/{ => 201507}/20150610 How to secure your Linux server.md (100%) rename published/{ => 201507}/20150610 watch--Repeat Linux or Unix Commands Regular Intervals.md (100%) rename published/{ => 201507}/20150612 How to Configure Apache Containers with Docker on Fedora 22.md (100%) rename published/{ => 201507}/20150612 How to Configure Swarm Native Clustering for Docker.md (100%) rename published/{ => 201507}/20150612 Linux_Logo--A Command Line Tool to Print Color ANSI Logos of Linux Distributions.md (100%) rename published/{ => 201507}/20150615 How to combine two graphs on Cacti.md (100%) rename published/{ => 201507}/20150616 Installing LAMP Linux, Apache, MariaDB, PHP or PhpMyAdmin in RHEL or CentOS 7.0.md (100%) rename published/{ => 201507}/20150616 LINUX 101--POWER UP YOUR SHELL.md (100%) rename published/{ => 201507}/20150616 Linux Humor on the Command-line.md (100%) rename published/{ => 201507}/20150616 XBMC--build a remote control.md (100%) rename published/{ => 201507}/20150617 Tor Browser--An Ultimate Web Browser for Anonymous Web Browsing in Linux.md (100%) rename published/{ => 201507}/20150618 How to Setup Node.JS on Ubuntu 15.04 with Different Methods.md (100%) rename published/{ => 201507}/20150618 What will be the future of Linux without Linus.md (100%) rename published/{ => 201507}/20150625 Screen Capture Made Easy with these Dedicated Tools.md (100%) rename published/{ => 201507}/20150629 4 Useful Tips on mkdir, tar and kill Commands in Linux.md (100%) rename published/{ => 201507}/20150629 Backup with these DeDuplicating Encryption Tools.md (100%) rename published/{ => 201507}/20150629 First Stable Version Of Atom Code Editor Has Been Released.md (100%) rename published/{ => 201507}/20150706 PHP Security.md (100%) rename published/{ => 201507}/20150709 7 command line tools for monitoring your Linux system.md (100%) rename published/{ => 201507}/20150709 Install Google Hangouts Desktop Client In Linux.md (100%) rename published/{ => 201507}/20150709 Linus Torvalds Says People Who Believe in AI Singularity Are on Drugs.md (100%) rename published/{ => 201507}/20150709 Linux FAQs with Answers--How to fix 'tar--Exiting with failure status due to previous errors'.md (100%) rename published/{ => 201507}/20150709 Linux FAQs with Answers--How to install a Brother printer on Linux.md (100%) rename published/{ => 201507}/20150709 Linux FAQs with Answers--How to open multiple tabs in a GNOME terminal on Ubuntu 15.04.md (100%) rename published/{ => 201507}/20150709 Why is the ibdata1 file continuously growing in MySQL.md (100%) rename published/{ => 201507}/20150713 How To Fix System Program Problem Detected In Ubuntu 14.04.md (100%) rename published/{ => 201507}/20150713 How to manage Vim plugins.md (100%) rename published/{ => 201507}/20150716 4 CCleaner Alternatives For Ubuntu Linux.md (100%) rename published/{ => 201507}/20150717 Setting Up 'XR' (Crossroads) Load Balancer for Web Servers on RHEL or CentOS.md (100%) rename published/{ => 201507}/20150722 12 Useful PHP Commandline Usage Every Linux User Must Know.md (100%) rename published/{ => 201507}/20150722 How to Use and Execute PHP Codes in Linux Command Line--Part 1.md (100%) rename published/{ => 201507}/Install Plex Media Server On Ubuntu or CentOS 7.1 or Fedora 22.md (100%) rename published/{ => 201507}/PHP 7 upgrading.md (100%) diff --git a/published/20150121 Syncthing--A Private And Secure Tool To Sync Files or Folders Between Computers.md b/published/201507/20150121 Syncthing--A Private And Secure Tool To Sync Files or Folders Between Computers.md similarity index 100% rename from published/20150121 Syncthing--A Private And Secure Tool To Sync Files or Folders Between Computers.md rename to published/201507/20150121 Syncthing--A Private And Secure Tool To Sync Files or Folders Between Computers.md diff --git a/published/20150127 25 Useful Apache '.htaccess' Tricks to Secure and Customize Websites.md b/published/201507/20150127 25 Useful Apache '.htaccess' Tricks to Secure and Customize Websites.md similarity index 100% rename from published/20150127 25 Useful Apache '.htaccess' Tricks to Secure and Customize Websites.md rename to published/201507/20150127 25 Useful Apache '.htaccess' Tricks to Secure and Customize Websites.md diff --git a/published/20150227 Fix Minimal BASH like line editing is supported GRUB Error In Linux.md b/published/201507/20150227 Fix Minimal BASH like line editing is supported GRUB Error In Linux.md similarity index 100% rename from published/20150227 Fix Minimal BASH like line editing is supported GRUB Error In Linux.md rename to published/201507/20150227 Fix Minimal BASH like line editing is supported GRUB Error In Linux.md diff --git a/published/20150309 Comparative Introduction To FreeBSD For Linux Users.md b/published/201507/20150309 Comparative Introduction To FreeBSD For Linux Users.md similarity index 100% rename from published/20150309 Comparative Introduction To FreeBSD For Linux Users.md rename to published/201507/20150309 Comparative Introduction To FreeBSD For Linux Users.md diff --git a/published/20150401 ZMap Documentation.md b/published/201507/20150401 ZMap Documentation.md similarity index 100% rename from published/20150401 ZMap Documentation.md rename to published/201507/20150401 ZMap Documentation.md diff --git a/published/20150407 10 Truly Amusing Easter Eggs in Linux.md b/published/201507/20150407 10 Truly Amusing Easter Eggs in Linux.md similarity index 100% rename from published/20150407 10 Truly Amusing Easter Eggs in Linux.md rename to published/201507/20150407 10 Truly Amusing Easter Eggs in Linux.md diff --git a/published/20150410 10 Top Distributions in Demand to Get Your Dream Job.md b/published/201507/20150410 10 Top Distributions in Demand to Get Your Dream Job.md similarity index 100% rename from published/20150410 10 Top Distributions in Demand to Get Your Dream Job.md rename to published/201507/20150410 10 Top Distributions in Demand to Get Your Dream Job.md diff --git a/published/20150505 How to Manage 'Systemd' Services and Units Using 'Systemctl' in Linux.md b/published/201507/20150505 How to Manage 'Systemd' Services and Units Using 'Systemctl' in Linux.md similarity index 100% rename from published/20150505 How to Manage 'Systemd' Services and Units Using 'Systemctl' in Linux.md rename to published/201507/20150505 How to Manage 'Systemd' Services and Units Using 'Systemctl' in Linux.md diff --git a/published/20150515 Lolcat--A Command Line Tool to Output Rainbow Of Colors in Linux Terminal.md b/published/201507/20150515 Lolcat--A Command Line Tool to Output Rainbow Of Colors in Linux Terminal.md similarity index 100% rename from published/20150515 Lolcat--A Command Line Tool to Output Rainbow Of Colors in Linux Terminal.md rename to published/201507/20150515 Lolcat--A Command Line Tool to Output Rainbow Of Colors in Linux Terminal.md diff --git a/published/20150520 Is Linux Better than OS X GNU Open Source and Apple in History.md b/published/201507/20150520 Is Linux Better than OS X GNU Open Source and Apple in History.md similarity index 100% rename from published/20150520 Is Linux Better than OS X GNU Open Source and Apple in History.md rename to published/201507/20150520 Is Linux Better than OS X GNU Open Source and Apple in History.md diff --git a/published/20150526 20 Useful Terminal Emulators for Linux.md b/published/201507/20150526 20 Useful Terminal Emulators for Linux.md similarity index 100% rename from published/20150526 20 Useful Terminal Emulators for Linux.md rename to published/201507/20150526 20 Useful Terminal Emulators for Linux.md diff --git a/published/20150527 Animated Wallpaper Adds Live Backgrounds To Linux Distros.md b/published/201507/20150527 Animated Wallpaper Adds Live Backgrounds To Linux Distros.md similarity index 100% rename from published/20150527 Animated Wallpaper Adds Live Backgrounds To Linux Distros.md rename to published/201507/20150527 Animated Wallpaper Adds Live Backgrounds To Linux Distros.md diff --git a/published/20150527 How to Develop Own Custom Linux Distribution From Scratch.md b/published/201507/20150527 How to Develop Own Custom Linux Distribution From Scratch.md similarity index 100% rename from published/20150527 How to Develop Own Custom Linux Distribution From Scratch.md rename to published/201507/20150527 How to Develop Own Custom Linux Distribution From Scratch.md diff --git a/published/20150527 How to edit your documents collaboratively on Linux.md b/published/201507/20150527 How to edit your documents collaboratively on Linux.md similarity index 100% rename from published/20150527 How to edit your documents collaboratively on Linux.md rename to published/201507/20150527 How to edit your documents collaboratively on Linux.md diff --git a/published/20150601 How to monitor Linux servers with SNMP and Cacti.md b/published/201507/20150601 How to monitor Linux servers with SNMP and Cacti.md similarity index 100% rename from published/20150601 How to monitor Linux servers with SNMP and Cacti.md rename to published/201507/20150601 How to monitor Linux servers with SNMP and Cacti.md diff --git a/published/20150601 How to monitor common services with Nagios.md b/published/201507/20150601 How to monitor common services with Nagios.md similarity index 100% rename from published/20150601 How to monitor common services with Nagios.md rename to published/201507/20150601 How to monitor common services with Nagios.md diff --git a/published/20150603 Installing Ruby on Rails using rbenv on Ubuntu 15.04.md b/published/201507/20150603 Installing Ruby on Rails using rbenv on Ubuntu 15.04.md similarity index 100% rename from published/20150603 Installing Ruby on Rails using rbenv on Ubuntu 15.04.md rename to published/201507/20150603 Installing Ruby on Rails using rbenv on Ubuntu 15.04.md diff --git a/published/20150604 How to access SQLite database in Perl.md b/published/201507/20150604 How to access SQLite database in Perl.md similarity index 100% rename from published/20150604 How to access SQLite database in Perl.md rename to published/201507/20150604 How to access SQLite database in Perl.md diff --git a/published/20150610 How to Manipulate Filenames Having Spaces and Special Characters in Linux.md b/published/201507/20150610 How to Manipulate Filenames Having Spaces and Special Characters in Linux.md similarity index 100% rename from published/20150610 How to Manipulate Filenames Having Spaces and Special Characters in Linux.md rename to published/201507/20150610 How to Manipulate Filenames Having Spaces and Special Characters in Linux.md diff --git a/published/20150610 How to secure your Linux server.md b/published/201507/20150610 How to secure your Linux server.md similarity index 100% rename from published/20150610 How to secure your Linux server.md rename to published/201507/20150610 How to secure your Linux server.md diff --git a/published/20150610 watch--Repeat Linux or Unix Commands Regular Intervals.md b/published/201507/20150610 watch--Repeat Linux or Unix Commands Regular Intervals.md similarity index 100% rename from published/20150610 watch--Repeat Linux or Unix Commands Regular Intervals.md rename to published/201507/20150610 watch--Repeat Linux or Unix Commands Regular Intervals.md diff --git a/published/20150612 How to Configure Apache Containers with Docker on Fedora 22.md b/published/201507/20150612 How to Configure Apache Containers with Docker on Fedora 22.md similarity index 100% rename from published/20150612 How to Configure Apache Containers with Docker on Fedora 22.md rename to published/201507/20150612 How to Configure Apache Containers with Docker on Fedora 22.md diff --git a/published/20150612 How to Configure Swarm Native Clustering for Docker.md b/published/201507/20150612 How to Configure Swarm Native Clustering for Docker.md similarity index 100% rename from published/20150612 How to Configure Swarm Native Clustering for Docker.md rename to published/201507/20150612 How to Configure Swarm Native Clustering for Docker.md diff --git a/published/20150612 Linux_Logo--A Command Line Tool to Print Color ANSI Logos of Linux Distributions.md b/published/201507/20150612 Linux_Logo--A Command Line Tool to Print Color ANSI Logos of Linux Distributions.md similarity index 100% rename from published/20150612 Linux_Logo--A Command Line Tool to Print Color ANSI Logos of Linux Distributions.md rename to published/201507/20150612 Linux_Logo--A Command Line Tool to Print Color ANSI Logos of Linux Distributions.md diff --git a/published/20150615 How to combine two graphs on Cacti.md b/published/201507/20150615 How to combine two graphs on Cacti.md similarity index 100% rename from published/20150615 How to combine two graphs on Cacti.md rename to published/201507/20150615 How to combine two graphs on Cacti.md diff --git a/published/20150616 Installing LAMP Linux, Apache, MariaDB, PHP or PhpMyAdmin in RHEL or CentOS 7.0.md b/published/201507/20150616 Installing LAMP Linux, Apache, MariaDB, PHP or PhpMyAdmin in RHEL or CentOS 7.0.md similarity index 100% rename from published/20150616 Installing LAMP Linux, Apache, MariaDB, PHP or PhpMyAdmin in RHEL or CentOS 7.0.md rename to published/201507/20150616 Installing LAMP Linux, Apache, MariaDB, PHP or PhpMyAdmin in RHEL or CentOS 7.0.md diff --git a/published/20150616 LINUX 101--POWER UP YOUR SHELL.md b/published/201507/20150616 LINUX 101--POWER UP YOUR SHELL.md similarity index 100% rename from published/20150616 LINUX 101--POWER UP YOUR SHELL.md rename to published/201507/20150616 LINUX 101--POWER UP YOUR SHELL.md diff --git a/published/20150616 Linux Humor on the Command-line.md b/published/201507/20150616 Linux Humor on the Command-line.md similarity index 100% rename from published/20150616 Linux Humor on the Command-line.md rename to published/201507/20150616 Linux Humor on the Command-line.md diff --git a/published/20150616 XBMC--build a remote control.md b/published/201507/20150616 XBMC--build a remote control.md similarity index 100% rename from published/20150616 XBMC--build a remote control.md rename to published/201507/20150616 XBMC--build a remote control.md diff --git a/published/20150617 Tor Browser--An Ultimate Web Browser for Anonymous Web Browsing in Linux.md b/published/201507/20150617 Tor Browser--An Ultimate Web Browser for Anonymous Web Browsing in Linux.md similarity index 100% rename from published/20150617 Tor Browser--An Ultimate Web Browser for Anonymous Web Browsing in Linux.md rename to published/201507/20150617 Tor Browser--An Ultimate Web Browser for Anonymous Web Browsing in Linux.md diff --git a/published/20150618 How to Setup Node.JS on Ubuntu 15.04 with Different Methods.md b/published/201507/20150618 How to Setup Node.JS on Ubuntu 15.04 with Different Methods.md similarity index 100% rename from published/20150618 How to Setup Node.JS on Ubuntu 15.04 with Different Methods.md rename to published/201507/20150618 How to Setup Node.JS on Ubuntu 15.04 with Different Methods.md diff --git a/published/20150618 What will be the future of Linux without Linus.md b/published/201507/20150618 What will be the future of Linux without Linus.md similarity index 100% rename from published/20150618 What will be the future of Linux without Linus.md rename to published/201507/20150618 What will be the future of Linux without Linus.md diff --git a/published/20150625 Screen Capture Made Easy with these Dedicated Tools.md b/published/201507/20150625 Screen Capture Made Easy with these Dedicated Tools.md similarity index 100% rename from published/20150625 Screen Capture Made Easy with these Dedicated Tools.md rename to published/201507/20150625 Screen Capture Made Easy with these Dedicated Tools.md diff --git a/published/20150629 4 Useful Tips on mkdir, tar and kill Commands in Linux.md b/published/201507/20150629 4 Useful Tips on mkdir, tar and kill Commands in Linux.md similarity index 100% rename from published/20150629 4 Useful Tips on mkdir, tar and kill Commands in Linux.md rename to published/201507/20150629 4 Useful Tips on mkdir, tar and kill Commands in Linux.md diff --git a/published/20150629 Backup with these DeDuplicating Encryption Tools.md b/published/201507/20150629 Backup with these DeDuplicating Encryption Tools.md similarity index 100% rename from published/20150629 Backup with these DeDuplicating Encryption Tools.md rename to published/201507/20150629 Backup with these DeDuplicating Encryption Tools.md diff --git a/published/20150629 First Stable Version Of Atom Code Editor Has Been Released.md b/published/201507/20150629 First Stable Version Of Atom Code Editor Has Been Released.md similarity index 100% rename from published/20150629 First Stable Version Of Atom Code Editor Has Been Released.md rename to published/201507/20150629 First Stable Version Of Atom Code Editor Has Been Released.md diff --git a/published/20150706 PHP Security.md b/published/201507/20150706 PHP Security.md similarity index 100% rename from published/20150706 PHP Security.md rename to published/201507/20150706 PHP Security.md diff --git a/published/20150709 7 command line tools for monitoring your Linux system.md b/published/201507/20150709 7 command line tools for monitoring your Linux system.md similarity index 100% rename from published/20150709 7 command line tools for monitoring your Linux system.md rename to published/201507/20150709 7 command line tools for monitoring your Linux system.md diff --git a/published/20150709 Install Google Hangouts Desktop Client In Linux.md b/published/201507/20150709 Install Google Hangouts Desktop Client In Linux.md similarity index 100% rename from published/20150709 Install Google Hangouts Desktop Client In Linux.md rename to published/201507/20150709 Install Google Hangouts Desktop Client In Linux.md diff --git a/published/20150709 Linus Torvalds Says People Who Believe in AI Singularity Are on Drugs.md b/published/201507/20150709 Linus Torvalds Says People Who Believe in AI Singularity Are on Drugs.md similarity index 100% rename from published/20150709 Linus Torvalds Says People Who Believe in AI Singularity Are on Drugs.md rename to published/201507/20150709 Linus Torvalds Says People Who Believe in AI Singularity Are on Drugs.md diff --git a/published/20150709 Linux FAQs with Answers--How to fix 'tar--Exiting with failure status due to previous errors'.md b/published/201507/20150709 Linux FAQs with Answers--How to fix 'tar--Exiting with failure status due to previous errors'.md similarity index 100% rename from published/20150709 Linux FAQs with Answers--How to fix 'tar--Exiting with failure status due to previous errors'.md rename to published/201507/20150709 Linux FAQs with Answers--How to fix 'tar--Exiting with failure status due to previous errors'.md diff --git a/published/20150709 Linux FAQs with Answers--How to install a Brother printer on Linux.md b/published/201507/20150709 Linux FAQs with Answers--How to install a Brother printer on Linux.md similarity index 100% rename from published/20150709 Linux FAQs with Answers--How to install a Brother printer on Linux.md rename to published/201507/20150709 Linux FAQs with Answers--How to install a Brother printer on Linux.md diff --git a/published/20150709 Linux FAQs with Answers--How to open multiple tabs in a GNOME terminal on Ubuntu 15.04.md b/published/201507/20150709 Linux FAQs with Answers--How to open multiple tabs in a GNOME terminal on Ubuntu 15.04.md similarity index 100% rename from published/20150709 Linux FAQs with Answers--How to open multiple tabs in a GNOME terminal on Ubuntu 15.04.md rename to published/201507/20150709 Linux FAQs with Answers--How to open multiple tabs in a GNOME terminal on Ubuntu 15.04.md diff --git a/published/20150709 Why is the ibdata1 file continuously growing in MySQL.md b/published/201507/20150709 Why is the ibdata1 file continuously growing in MySQL.md similarity index 100% rename from published/20150709 Why is the ibdata1 file continuously growing in MySQL.md rename to published/201507/20150709 Why is the ibdata1 file continuously growing in MySQL.md diff --git a/published/20150713 How To Fix System Program Problem Detected In Ubuntu 14.04.md b/published/201507/20150713 How To Fix System Program Problem Detected In Ubuntu 14.04.md similarity index 100% rename from published/20150713 How To Fix System Program Problem Detected In Ubuntu 14.04.md rename to published/201507/20150713 How To Fix System Program Problem Detected In Ubuntu 14.04.md diff --git a/published/20150713 How to manage Vim plugins.md b/published/201507/20150713 How to manage Vim plugins.md similarity index 100% rename from published/20150713 How to manage Vim plugins.md rename to published/201507/20150713 How to manage Vim plugins.md diff --git a/published/20150716 4 CCleaner Alternatives For Ubuntu Linux.md b/published/201507/20150716 4 CCleaner Alternatives For Ubuntu Linux.md similarity index 100% rename from published/20150716 4 CCleaner Alternatives For Ubuntu Linux.md rename to published/201507/20150716 4 CCleaner Alternatives For Ubuntu Linux.md diff --git a/published/20150717 Setting Up 'XR' (Crossroads) Load Balancer for Web Servers on RHEL or CentOS.md b/published/201507/20150717 Setting Up 'XR' (Crossroads) Load Balancer for Web Servers on RHEL or CentOS.md similarity index 100% rename from published/20150717 Setting Up 'XR' (Crossroads) Load Balancer for Web Servers on RHEL or CentOS.md rename to published/201507/20150717 Setting Up 'XR' (Crossroads) Load Balancer for Web Servers on RHEL or CentOS.md diff --git a/published/20150722 12 Useful PHP Commandline Usage Every Linux User Must Know.md b/published/201507/20150722 12 Useful PHP Commandline Usage Every Linux User Must Know.md similarity index 100% rename from published/20150722 12 Useful PHP Commandline Usage Every Linux User Must Know.md rename to published/201507/20150722 12 Useful PHP Commandline Usage Every Linux User Must Know.md diff --git a/published/20150722 How to Use and Execute PHP Codes in Linux Command Line--Part 1.md b/published/201507/20150722 How to Use and Execute PHP Codes in Linux Command Line--Part 1.md similarity index 100% rename from published/20150722 How to Use and Execute PHP Codes in Linux Command Line--Part 1.md rename to published/201507/20150722 How to Use and Execute PHP Codes in Linux Command Line--Part 1.md diff --git a/published/Install Plex Media Server On Ubuntu or CentOS 7.1 or Fedora 22.md b/published/201507/Install Plex Media Server On Ubuntu or CentOS 7.1 or Fedora 22.md similarity index 100% rename from published/Install Plex Media Server On Ubuntu or CentOS 7.1 or Fedora 22.md rename to published/201507/Install Plex Media Server On Ubuntu or CentOS 7.1 or Fedora 22.md diff --git a/published/PHP 7 upgrading.md b/published/201507/PHP 7 upgrading.md similarity index 100% rename from published/PHP 7 upgrading.md rename to published/201507/PHP 7 upgrading.md From 7a48a26cd5e38cfab5140f261777e84ce39351f1 Mon Sep 17 00:00:00 2001 From: geekpi Date: Sun, 2 Aug 2015 07:38:30 +0800 Subject: [PATCH 756/965] translating --- ...al Volume Management and How Do You Enable It in Ubuntu.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150729 What is Logical Volume Management and How Do You Enable It in Ubuntu.md b/sources/tech/20150729 What is Logical Volume Management and How Do You Enable It in Ubuntu.md index 1641bd8f20..2a95f127d0 100644 --- a/sources/tech/20150729 What is Logical Volume Management and How Do You Enable It in Ubuntu.md +++ b/sources/tech/20150729 What is Logical Volume Management and How Do You Enable It in Ubuntu.md @@ -1,3 +1,5 @@ +translating----geekpi + What is Logical Volume Management and How Do You Enable It in Ubuntu? ================================================================================ > Logical Volume Management (LVM) is a disk management option that every major Linux distribution includes. Whether you need to set up storage pools or just need to dynamically create partitions, LVM is probably what you are looking for. @@ -69,4 +71,4 @@ via: http://www.howtogeek.com/howto/36568/what-is-logical-volume-management-and- 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 [a]:https://plus.google.com/+howtogeek?prsrc=5 -[1]:http://www.howtogeek.com/howto/13379/create-a-bootable-ubuntu-9.10-usb-flash-drive/ \ No newline at end of file +[1]:http://www.howtogeek.com/howto/13379/create-a-bootable-ubuntu-9.10-usb-flash-drive/ From 6719850a73e7d0985b14cacac51b88052e1be9cf Mon Sep 17 00:00:00 2001 From: geekpi Date: Sun, 2 Aug 2015 08:20:22 +0800 Subject: [PATCH 757/965] translated --- ...ment and How Do You Enable It in Ubuntu.md | 74 ------------------- ...ment and How Do You Enable It in Ubuntu.md | 72 ++++++++++++++++++ 2 files changed, 72 insertions(+), 74 deletions(-) delete mode 100644 sources/tech/20150729 What is Logical Volume Management and How Do You Enable It in Ubuntu.md create mode 100644 translated/tech/20150729 What is Logical Volume Management and How Do You Enable It in Ubuntu.md diff --git a/sources/tech/20150729 What is Logical Volume Management and How Do You Enable It in Ubuntu.md b/sources/tech/20150729 What is Logical Volume Management and How Do You Enable It in Ubuntu.md deleted file mode 100644 index 2a95f127d0..0000000000 --- a/sources/tech/20150729 What is Logical Volume Management and How Do You Enable It in Ubuntu.md +++ /dev/null @@ -1,74 +0,0 @@ -translating----geekpi - -What is Logical Volume Management and How Do You Enable It in Ubuntu? -================================================================================ -> Logical Volume Management (LVM) is a disk management option that every major Linux distribution includes. Whether you need to set up storage pools or just need to dynamically create partitions, LVM is probably what you are looking for. - -### What is LVM? ### - -Logical Volume Manager allows for a layer of abstraction between your operating system and the disks/partitions it uses. In traditional disk management your operating system looks for what disks are available (/dev/sda, /dev/sdb, etc.) and then looks at what partitions are available on those disks (/dev/sda1, /dev/sda2, etc.). - -With LVM, disks and partitions can be abstracted to contain multiple disks and partitions into one device. Your operating systems will never know the difference because LVM will only show the OS the volume groups (disks) and logical volumes (partitions) that you have set up. - -Because volume groups and logical volumes aren’t physically tied to a hard drive, it makes it easy to dynamically resize and create new disks and partitions. In addition, LVM can give you features that your file system is not capable of doing. For example, Ext3 does not have support for live snapshots, but if you’re using LVM you have the ability to take a snapshot of your logical volumes without unmounting the disk. - -### When Should You Use LVM? ### - -The first thing your should consider before setting up LVM is what you want to accomplish with your disks and partitions. Some distributions, like Fedora, install with LVM by default. - -If you are using Ubuntu on a laptop with only one internal hard drive and you don’t need extended features like live snapshots, then you may not need LVM. If you need easy expansion or want to combine multiple hard drives into a single pool of storage then LVM may be what you have been looking for. - -### Setting up LVM in Ubuntu ### - -First thing to know about using LVM is there is no easy way to convert your existing traditional partitions to logical volumes. It is possible to move to a new partition that uses LVM, but that won’t be something that we will cover in this article; instead we are going to take the approach of setting up LVM on a fresh installation of Ubuntu 10.10. - -![](http://cdn3.howtogeek.com/wp-content/uploads/2010/12/ubuntu-10-banner.png) - -To install Ubuntu using LVM you need to use the alternate install CD. Download it from the link below and burn a CD or [use unetbootin to create a USB drive][1]. - -![](http://cdn3.howtogeek.com/wp-content/uploads/2010/12/download-web.png) - -Boot your computer from the alternate install disk and select your options up until the partition disks screen and select guided – use entire disk and set up LVM. - -*Note: This will format your entire hard drive so if you are trying to dual boot or have another installation select manual instead.* - -![](http://cdn3.howtogeek.com/wp-content/uploads/2010/12/setup-1.png) - -Select the main disk you want to use, typically your largest drive, and then go to the next step. - -![](http://cdn3.howtogeek.com/wp-content/uploads/2010/12/setup-2.png) - -You will immediately need to write the changes to disk so make sure you selected the right disk and then write the changes. - -![](http://cdn3.howtogeek.com/wp-content/uploads/2010/12/setup-3.png) - -Select the size you want the first logical volume to be and then continue. - -![](http://cdn3.howtogeek.com/wp-content/uploads/2011/01/setup-4.png) - -Confirm your disk partitions and continue with the installation. - -![](http://cdn3.howtogeek.com/wp-content/uploads/2011/01/setup-5.png) - -The final step will write the GRUB bootloader to the hard drive. It is important to note that GRUB cannot be on an LVM partition because computer BIOSes cannot directly read from a logical volume. Ubuntu will automatically create a 255 MB ext2 partition for your bootloader. - -![](http://cdn3.howtogeek.com/wp-content/uploads/2011/01/setup-6.png) - -After the installation is complete, reboot the machine and boot into Ubuntu as normal. There should be no perceivable difference between using LVM or traditional disk management with this type of installation. - -![](http://cdn3.howtogeek.com/wp-content/uploads/2011/01/disk-manager.png) - -To use LVM to its full potential, stay tuned for our upcoming article on managing your LVM installation. - --------------------------------------------------------------------------------- - -via: http://www.howtogeek.com/howto/36568/what-is-logical-volume-management-and-how-do-you-enable-it-in-ubuntu/ - -作者:[How-To Geek][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://plus.google.com/+howtogeek?prsrc=5 -[1]:http://www.howtogeek.com/howto/13379/create-a-bootable-ubuntu-9.10-usb-flash-drive/ diff --git a/translated/tech/20150729 What is Logical Volume Management and How Do You Enable It in Ubuntu.md b/translated/tech/20150729 What is Logical Volume Management and How Do You Enable It in Ubuntu.md new file mode 100644 index 0000000000..05f07b74e6 --- /dev/null +++ b/translated/tech/20150729 What is Logical Volume Management and How Do You Enable It in Ubuntu.md @@ -0,0 +1,72 @@ +什么是逻辑分区管理工具,它怎么在Ubuntu启用? +================================================================================ +> 逻辑分区管理(LVM)是每一个主流Linux发行版都含有的磁盘管理选项。无论你是否需要设置存储池或者只需要动态创建分区,LVM就是你正在寻找的。 + +### 什么是 LVM? ### + +逻辑分区管理是一个存在于磁盘/分区和操作系统之间的一个抽象层。在传统的磁盘管理中,你的操作系统寻找有哪些磁盘可用(/dev/sda、/dev/sdb等等)接着这些磁盘有哪些可用的分区(如/dev/sda1、/dev/sda2等等)。 + +在LVM下,磁盘和分区可以抽象成一个设备中含有多个磁盘和分区。你的操作系统将不会知道这些区别,因为LVM只会给操作系统展示你设置的卷组(磁盘)和逻辑卷(分区) + +,因此可以很容易地动态调整和创建新的磁盘和分区。除此之外,LVM带来你的文件系统不具备的功能。比如,ext3不支持实时快照,但是如果你正在使用LVM你可以不卸载磁盘的情况下做一个逻辑卷的快照。 + +### 你什么时候该使用LVM? ### + +在使用LVM之前首先得考虑的一件事是你要用你的磁盘和分区完成什么。一些发行版如Fedora已经默认安装了LVM。 + +如果你使用的是一台只有一块磁盘的Ubuntu笔记本电脑,并且你不需要像实时快照这样的扩展功能,那么你或许不需要LVM。如果I想要轻松地扩展或者想要将多块磁盘组成一个存储池,那么LVM或许正式你郑寻找的。 + +### 在Ubuntu中设置LVM ### + +使用LVM首先要了解的一件事是没有简单的方法将已经存在传统的分区转换成逻辑分区。可以将它移到一个使用LVM的新分区下,但是这并不会在本篇中提到;反之我们将全新安装一台Ubuntu 10.10来设置LVM + +![](http://cdn3.howtogeek.com/wp-content/uploads/2010/12/ubuntu-10-banner.png) + +要使用LVM安装Ubuntu你需要使用另外的安装CD。从下面的链接中下载并烧录到CD中或者[使用unetbootin创建一个USB盘][1]。 + +![](http://cdn3.howtogeek.com/wp-content/uploads/2010/12/download-web.png) + +从安装盘启动你的电脑,并在磁盘选择界面选择整个磁盘并设置LVM。 + +*注意:这会格式化你的整个磁盘,因此如果正在尝试双启动或者其他的安装选择,选择手动。* + +![](http://cdn3.howtogeek.com/wp-content/uploads/2010/12/setup-1.png) + +选择你想用的主磁盘,最典型的是使用你最大的磁盘,接着进入下一步。 + +![](http://cdn3.howtogeek.com/wp-content/uploads/2010/12/setup-2.png) + +你马上会将改变写入磁盘所以确保此时你选择的是正确的磁盘接着才写入设置。 + +![](http://cdn3.howtogeek.com/wp-content/uploads/2010/12/setup-3.png) + +选择第一个逻辑卷的大小并继续。 + +![](http://cdn3.howtogeek.com/wp-content/uploads/2011/01/setup-4.png) + +确认你的磁盘分区并继续安装。 + +![](http://cdn3.howtogeek.com/wp-content/uploads/2011/01/setup-5.png) + +最后一步将GRUB的bootloader写到磁盘中。重点注意的是GRUB不能作为一个LVM分区因为计算机BIOS不能直接从逻辑卷中读取数据。Ubuntu将自动创建一个255MB的ext2分区用于bootloder。 + +![](http://cdn3.howtogeek.com/wp-content/uploads/2011/01/setup-6.png) + +安装完成之后。重启电脑并如往常一样进入Ubuntu。使用这种方式安装之后应该就感受不到LVM和传统磁盘管理之间的区别了。 + +![](http://cdn3.howtogeek.com/wp-content/uploads/2011/01/disk-manager.png) + +要使用LVM的全部功能,静待我们的下篇关于管理LVM的文章。 + +-------------------------------------------------------------------------------- + +via: http://www.howtogeek.com/howto/36568/what-is-logical-volume-management-and-how-do-you-enable-it-in-ubuntu/ + +作者:[How-To Geek][a] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://plus.google.com/+howtogeek?prsrc=5 +[1]:http://www.howtogeek.com/howto/13379/create-a-bootable-ubuntu-9.10-usb-flash-drive/ From 110ba8016c7041b6c478c5b3c20e7ca435b75a3d Mon Sep 17 00:00:00 2001 From: ictlyh Date: Sun, 2 Aug 2015 12:51:45 +0800 Subject: [PATCH 758/965] [Translating] sources/tech/20150504 How to access a Linux server behind NAT via reverse SSH tunnel.md --- ...to access a Linux server behind NAT via reverse SSH tunnel.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20150504 How to access a Linux server behind NAT via reverse SSH tunnel.md b/sources/tech/20150504 How to access a Linux server behind NAT via reverse SSH tunnel.md index b67f5aee26..4239073013 100644 --- a/sources/tech/20150504 How to access a Linux server behind NAT via reverse SSH tunnel.md +++ b/sources/tech/20150504 How to access a Linux server behind NAT via reverse SSH tunnel.md @@ -1,3 +1,4 @@ +ictlyh Translating How to access a Linux server behind NAT via reverse SSH tunnel ================================================================================ You are running a Linux server at home, which is behind a NAT router or restrictive firewall. Now you want to SSH to the home server while you are away from home. How would you set that up? SSH port forwarding will certainly be an option. However, port forwarding can become tricky if you are dealing with multiple nested NAT environment. Besides, it can be interfered with under various ISP-specific conditions, such as restrictive ISP firewalls which block forwarded ports, or carrier-grade NAT which shares IPv4 addresses among users. From 1bc3516185f27417f9a750a8cd6b756010c72929 Mon Sep 17 00:00:00 2001 From: Ezio Date: Sun, 2 Aug 2015 13:58:34 +0800 Subject: [PATCH 759/965] Update 20150410 How to run Ubuntu Snappy Core on Raspberry Pi 2.md [Translating] 20150410 How to run Ubuntu Snappy Core on Raspberry Pi 2.md --- ...0150410 How to run Ubuntu Snappy Core on Raspberry Pi 2.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150410 How to run Ubuntu Snappy Core on Raspberry Pi 2.md b/sources/tech/20150410 How to run Ubuntu Snappy Core on Raspberry Pi 2.md index 4b49e3acca..99b2b3acc1 100644 --- a/sources/tech/20150410 How to run Ubuntu Snappy Core on Raspberry Pi 2.md +++ b/sources/tech/20150410 How to run Ubuntu Snappy Core on Raspberry Pi 2.md @@ -1,3 +1,5 @@ ++Translating by Ezio + How to run Ubuntu Snappy Core on Raspberry Pi 2 ================================================================================ The Internet of Things (IoT) is upon us. In a couple of years some of us might ask ourselves how we ever survived without it, just like we question our past without cellphones today. Canonical is a contender in this fast growing, but still wide open market. The company wants to claim their stakes in IoT just as they already did for the cloud. At the end of January, the company launched a small operating system that goes by the name of [Ubuntu Snappy Core][1] which is based on Ubuntu Core. @@ -86,4 +88,4 @@ via: http://xmodulo.com/ubuntu-snappy-core-raspberry-pi-2.html [1]:http://www.ubuntu.com/things [2]:http://www.raspberrypi.org/downloads/ [3]:http://xmodulo.com/write-raspberry-pi-image-sd-card.html -[4]:https://developer.ubuntu.com/en/snappy/ \ No newline at end of file +[4]:https://developer.ubuntu.com/en/snappy/ From 70694119830a191fbcd888e946c9b7ecb3d0619b Mon Sep 17 00:00:00 2001 From: struggling <630441839@qq.com> Date: Sun, 2 Aug 2015 16:13:22 +0800 Subject: [PATCH 760/965] Delete Part 1 - Introduction to RAID, Concepts of RAID and RAID Levels.md --- ... RAID, Concepts of RAID and RAID Levels.md | 144 ------------------ 1 file changed, 144 deletions(-) delete mode 100644 sources/tech/RAID/Part 1 - Introduction to RAID, Concepts of RAID and RAID Levels.md diff --git a/sources/tech/RAID/Part 1 - Introduction to RAID, Concepts of RAID and RAID Levels.md b/sources/tech/RAID/Part 1 - Introduction to RAID, Concepts of RAID and RAID Levels.md deleted file mode 100644 index 0f393fd7c4..0000000000 --- a/sources/tech/RAID/Part 1 - Introduction to RAID, Concepts of RAID and RAID Levels.md +++ /dev/null @@ -1,144 +0,0 @@ -struggling 翻译中 -Introduction to RAID, Concepts of RAID and RAID Levels – Part 1 -================================================================================ -RAID is a Redundant Array of Inexpensive disks, but nowadays it is called Redundant Array of Independent drives. Earlier it is used to be very costly to buy even a smaller size of disk, but nowadays we can buy a large size of disk with the same amount like before. Raid is just a collection of disks in a pool to become a logical volume. - -![RAID in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/RAID.jpg) - -Understanding RAID Setups in Linux - -Raid contains groups or sets or Arrays. A combine of drivers make a group of disks to form a RAID Array or RAID set. It can be a minimum of 2 number of disk connected to a raid controller and make a logical volume or more drives can be in a group. Only one Raid level can be applied in a group of disks. Raid are used when we need excellent performance. According to our selected raid level, performance will differ. Saving our data by fault tolerance & high availability. - -This series will be titled Preparation for the setting up RAID ‘s through Parts 1-9 and covers the following topics. - -- Part 1: Introduction to RAID, Concepts of RAID and RAID Levels -- Part 2: How to setup RAID0 (Stripe) in Linux -- Part 3: How to setup RAID1 (Mirror) in Linux -- Part 4: How to setup RAID5 (Striping with Distributed Parity) in Linux -- Part 5: How to setup RAID6 (Striping with Double Distributed Parity) in Linux -- Part 6: Setting Up RAID 10 or 1+0 (Nested) in Linux -- Part 7: Growing an Existing RAID Array and Removing Failed Disks in Raid -- Part 8: Recovering (Rebuilding) failed drives in RAID -- Part 9: Managing RAID in Linux - -This is the Part 1 of a 9-tutorial series, here we will cover the introduction of RAID, Concepts of RAID and RAID Levels that are required for the setting up RAID in Linux. - -### Software RAID and Hardware RAID ### - -Software RAID have low performance, because of consuming resource from hosts. Raid software need to load for read data from software raid volumes. Before loading raid software, OS need to get boot to load the raid software. No need of Physical hardware in software raids. Zero cost investment. - -Hardware RAID have high performance. They are dedicated RAID Controller which is Physically built using PCI express cards. It won’t use the host resource. They have NVRAM for cache to read and write. Stores cache while rebuild even if there is power-failure, it will store the cache using battery power backups. Very costly investments needed for a large scale. - -Hardware RAID Card will look like below: - -![Hardware RAID](http://www.tecmint.com/wp-content/uploads/2014/10/Hardware-RAID.jpg) - -Hardware RAID - -#### Featured Concepts of RAID #### - -- Parity method in raid regenerate the lost content from parity saved information’s. RAID 5, RAID 6 Based on Parity. -- Stripe is sharing data randomly to multiple disk. This won’t have full data in a single disk. If we use 3 disks half of our data will be in each disks. -- Mirroring is used in RAID 1 and RAID 10. Mirroring is making a copy of same data. In RAID 1 it will save the same content to the other disk too. -- Hot spare is just a spare drive in our server which can automatically replace the failed drives. If any one of the drive failed in our array this hot spare drive will be used and rebuild automatically. -- Chunks are just a size of data which can be minimum from 4KB and more. By defining chunk size we can increase the I/O performance. - -RAID’s are in various Levels. Here we will see only the RAID Levels which is used mostly in real environment. - -- RAID0 = Striping -- RAID1 = Mirroring -- RAID5 = Single Disk Distributed Parity -- RAID6 = Double Disk Distributed Parity -- RAID10 = Combine of Mirror & Stripe. (Nested RAID) - -RAID are managed using mdadm package in most of the Linux distributions. Let us get a Brief look into each RAID Levels. - -#### RAID 0 (or) Striping #### - -Striping have a excellent performance. In Raid 0 (Striping) the data will be written to disk using shared method. Half of the content will be in one disk and another half will be written to other disk. - -Let us assume we have 2 Disk drives, for example, if we write data “TECMINT” to logical volume it will be saved as ‘T‘ will be saved in first disk and ‘E‘ will be saved in Second disk and ‘C‘ will be saved in First disk and again ‘M‘ will be saved in Second disk and it continues in round-robin process. - -In this situation if any one of the drive fails we will loose our data, because with half of data from one of the disk can’t use to rebuilt the raid. But while comparing to Write Speed and performance RAID 0 is Excellent. We need at least minimum 2 disks to create a RAID 0 (Striping). If you need your valuable data don’t use this RAID LEVEL. - -- High Performance. -- There is Zero Capacity Loss in RAID 0 -- Zero Fault Tolerance. -- Write and Reading will be good performance. - -#### RAID 1 (or) Mirroring #### - -Mirroring have a good performance. Mirroring can make a copy of same data what we have. Assuming we have two numbers of 2TB Hard drives, total there we have 4TB, but in mirroring while the drives are behind the RAID Controller to form a Logical drive Only we can see the 2TB of logical drive. - -While we save any data, it will write to both 2TB Drives. Minimum two drives are needed to create a RAID 1 or Mirror. If a disk failure occurred we can reproduce the raid set by replacing a new disk. If any one of the disk fails in RAID 1, we can get the data from other one as there was a copy of same content in the other disk. So there is zero data loss. - -- Good Performance. -- Here Half of the Space will be lost in total capacity. -- Full Fault Tolerance. -- Rebuilt will be faster. -- Writing Performance will be slow. -- Reading will be good. -- Can be used for operating systems and database for small scale. - -#### RAID 5 (or) Distributed Parity #### - -RAID 5 is mostly used in enterprise levels. RAID 5 work by distributed parity method. Parity info will be used to rebuild the data. It rebuilds from the information left on the remaining good drives. This will protect our data from drive failure. - -Assume we have 4 drives, if one drive fails and while we replace the failed drive we can rebuild the replaced drive from parity informations. Parity information’s are Stored in all 4 drives, if we have 4 numbers of 1TB hard-drive. The parity information will be stored in 256GB in each drivers and other 768GB in each drives will be defined for Users. RAID 5 can be survive from a single Drive failure, If drives fails more than 1 will cause loss of data’s. - -- Excellent Performance -- Reading will be extremely very good in speed. -- Writing will be Average, slow if we won’t use a Hardware RAID Controller. -- Rebuild from Parity information from all drives. -- Full Fault Tolerance. -- 1 Disk Space will be under Parity. -- Can be used in file servers, web servers, very important backups. - -#### RAID 6 Two Parity Distributed Disk #### - -RAID 6 is same as RAID 5 with two parity distributed system. Mostly used in a large number of arrays. We need minimum 4 Drives, even if there 2 Drive fails we can rebuild the data while replacing new drives. - -Very slower than RAID 5, because it writes data to all 4 drivers at same time. Will be average in speed while we using a Hardware RAID Controller. If we have 6 numbers of 1TB hard-drives 4 drives will be used for data and 2 drives will be used for Parity. - -- Poor Performance. -- Read Performance will be good. -- Write Performance will be Poor if we not using a Hardware RAID Controller. -- Rebuild from 2 Parity Drives. -- Full Fault tolerance. -- 2 Disks space will be under Parity. -- Can be Used in Large Arrays. -- Can be use in backup purpose, video streaming, used in large scale. - -#### RAID 10 (or) Mirror & Stripe #### - -RAID 10 can be called as 1+0 or 0+1. This will do both works of Mirror & Striping. Mirror will be first and stripe will be the second in RAID 10. Stripe will be the first and mirror will be the second in RAID 01. RAID 10 is better comparing to 01. - -Assume, we have 4 Number of drives. While I’m writing some data to my logical volume it will be saved under All 4 drives using mirror and stripe methods. - -If I’m writing a data “TECMINT” in RAID 10 it will save the data as follow. First “T” will write to both disks and second “E” will write to both disk, this step will be used for all data write. It will make a copy of every data to other disk too. - -Same time it will use the RAID 0 method and write data as follow “T” will write to first disk and “E” will write to second disk. Again “C” will write to first Disk and “M” to second disk. - -- Good read and write performance. -- Here Half of the Space will be lost in total capacity. -- Fault Tolerance. -- Fast rebuild from copying data. -- Can be used in Database storage for high performance and availability. - -### Conclusion ### - -In this article we have seen what is RAID and which levels are mostly used in RAID in real environment. Hope you have learned the write-up about RAID. For RAID setup one must know about the basic Knowledge about RAID. The above content will fulfil basic understanding about RAID. - -In the next upcoming articles I’m going to cover how to setup and create a RAID using Various Levels, Growing a RAID Group (Array) and Troubleshooting with failed Drives and much more. - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/understanding-raid-setup-in-linux/ - -作者:[Babin Lonston][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.tecmint.com/author/babinlonston/ \ No newline at end of file From 4e630c4b50c5c68b42fb2706cad309db1d8320b8 Mon Sep 17 00:00:00 2001 From: struggling <630441839@qq.com> Date: Sun, 2 Aug 2015 16:13:38 +0800 Subject: [PATCH 761/965] Delete Part 2 - Creating Software RAID0 (Stripe) on 'Two Devices' Using 'mdadm' Tool in Linux.md --- ...wo Devices' Using 'mdadm' Tool in Linux.md | 219 ------------------ 1 file changed, 219 deletions(-) delete mode 100644 sources/tech/RAID/Part 2 - Creating Software RAID0 (Stripe) on 'Two Devices' Using 'mdadm' Tool in Linux.md diff --git a/sources/tech/RAID/Part 2 - Creating Software RAID0 (Stripe) on 'Two Devices' Using 'mdadm' Tool in Linux.md b/sources/tech/RAID/Part 2 - Creating Software RAID0 (Stripe) on 'Two Devices' Using 'mdadm' Tool in Linux.md deleted file mode 100644 index 8057e4828e..0000000000 --- a/sources/tech/RAID/Part 2 - Creating Software RAID0 (Stripe) on 'Two Devices' Using 'mdadm' Tool in Linux.md +++ /dev/null @@ -1,219 +0,0 @@ -struggling 翻译中 -Creating Software RAID0 (Stripe) on ‘Two Devices’ Using ‘mdadm’ Tool in Linux – Part 2 -================================================================================ -RAID is Redundant Array of Inexpensive disks, used for high availability and reliability in large scale environments, where data need to be protected than normal use. Raid is just a collection of disks in a pool to become a logical volume and contains an array. A combine drivers makes an array or called as set of (group). - -RAID can be created, if there are minimum 2 number of disk connected to a raid controller and make a logical volume or more drives can be added in an array according to defined RAID Levels. Software Raid are available without using Physical hardware those are called as software raid. Software Raid will be named as Poor man raid. - -![Setup RAID0 in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Raid0-in-Linux.jpg) - -Setup RAID0 in Linux - -Main concept of using RAID is to save data from Single point of failure, means if we using a single disk to store the data and if it’s failed, then there is no chance of getting our data back, to stop the data loss we need a fault tolerance method. So, that we can use some collection of disk to form a RAID set. - -#### What is Stripe in RAID 0? #### - -Stripe is striping data across multiple disk at the same time by dividing the contents. Assume we have two disks and if we save content to logical volume it will be saved under both two physical disks by dividing the content. For better performance RAID 0 will be used, but we can’t get the data if one of the drive fails. So, it isn’t a good practice to use RAID 0. The only solution is to install operating system with RAID0 applied logical volumes to safe your important files. - -- RAID 0 has High Performance. -- Zero Capacity Loss in RAID 0. No Space will be wasted. -- Zero Fault Tolerance ( Can’t get back the data if any one of disk fails). -- Write and Reading will be Excellent. - -#### Requirements #### - -Minimum number of disks are allowed to create RAID 0 is 2, but you can add more disk but the order should be twice as 2, 4, 6, 8. If you have a Physical RAID card with enough ports, you can add more disks. - -Here we are not using a Hardware raid, this setup depends only on Software RAID. If we have a physical hardware raid card we can access it from it’s utility UI. Some motherboard by default in-build with RAID feature, there UI can be accessed using Ctrl+I keys. - -If you’re new to RAID setups, please read our earlier article, where we’ve covered some basic introduction of about RAID. - -- [Introduction to RAID and RAID Concepts][1] - -**My Server Setup** - - Operating System : CentOS 6.5 Final - IP Address : 192.168.0.225 - Two Disks : 20 GB each - -This article is Part 2 of a 9-tutorial RAID series, here in this part, we are going to see how we can create and setup Software RAID0 or striping in Linux systems or servers using two 20GB disks named sdb and sdc. - -### Step 1: Updating System and Installing mdadm for Managing RAID ### - -1. Before setting up RAID0 in Linux, let’s do a system update and then install ‘mdadm‘ package. The mdadm is a small program, which will allow us to configure and manage RAID devices in Linux. - - # yum clean all && yum update - # yum install mdadm -y - -![install mdadm in linux](http://www.tecmint.com/wp-content/uploads/2014/10/install-mdadm-in-linux.png) - -Install mdadm Tool - -### Step 2: Verify Attached Two 20GB Drives ### - -2. Before creating RAID 0, make sure to verify that the attached two hard drives are detected or not, using the following command. - - # ls -l /dev | grep sd - -![Check Hard Drives in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Check-Hard-Drives.png) - -Check Hard Drives - -3. Once the new hard drives detected, it’s time to check whether the attached drives are already using any existing raid with the help of following ‘mdadm’ command. - - # mdadm --examine /dev/sd[b-c] - -![Check RAID Devices in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Check-Drives-using-RAID.png) - -Check RAID Devices - -In the above output, we come to know that none of the RAID have been applied to these two sdb and sdc drives. - -### Step 3: Creating Partitions for RAID ### - -4. Now create sdb and sdc partitions for raid, with the help of following fdisk command. Here, I will show how to create partition on sdb drive. - - # fdisk /dev/sdb - -Follow below instructions for creating partitions. - -- Press ‘n‘ for creating new partition. -- Then choose ‘P‘ for Primary partition. -- Next select the partition number as 1. -- Give the default value by just pressing two times Enter key. -- Next press ‘P‘ to print the defined partition. - -![Create Partitions in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Create-Partitions-in-Linux.png) - -Create Partitions - -Follow below instructions for creating Linux raid auto on partitions. - -- Press ‘L‘ to list all available types. -- Type ‘t‘to choose the partitions. -- Choose ‘fd‘ for Linux raid auto and press Enter to apply. -- Then again use ‘P‘ to print the changes what we have made. -- Use ‘w‘ to write the changes. - -![Create RAID Partitions](http://www.tecmint.com/wp-content/uploads/2014/10/Create-RAID-Partitions.png) - -Create RAID Partitions in Linux - -**Note**: Please follow same above instructions to create partition on sdc drive now. - -5. After creating partitions, verify both the drivers are correctly defined for RAID using following command. - - # mdadm --examine /dev/sd[b-c] - # mdadm --examine /dev/sd[b-c]1 - -![Verify RAID Partitions](http://www.tecmint.com/wp-content/uploads/2014/10/Verify-RAID-Partitions.png) - -Verify RAID Partitions - -### Step 4: Creating RAID md Devices ### - -6. Now create md device (i.e. /dev/md0) and apply raid level using below command. - - # mdadm -C /dev/md0 -l raid0 -n 2 /dev/sd[b-c]1 - # mdadm --create /dev/md0 --level=stripe --raid-devices=2 /dev/sd[b-c]1 - -- -C – create -- -l – level -- -n – No of raid-devices - -7. Once md device has been created, now verify the status of RAID Level, Devices and Array used, with the help of following series of commands as shown. - - # cat /proc/mdstat - -![Verify RAID Level](http://www.tecmint.com/wp-content/uploads/2014/10/Verify-RAID-Level.png) - -Verify RAID Level - - # mdadm -E /dev/sd[b-c]1 - -![Verify RAID Device](http://www.tecmint.com/wp-content/uploads/2014/10/Verify-RAID-Device.png) - -Verify RAID Device - - # mdadm --detail /dev/md0 - -![Verify RAID Array](http://www.tecmint.com/wp-content/uploads/2014/10/Verify-RAID-Array.png) - -Verify RAID Array - -### Step 5: Assiging RAID Devices to Filesystem ### - -8. Create a ext4 filesystem for a RAID device /dev/md0 and mount it under /dev/raid0. - - # mkfs.ext4 /dev/md0 - -![Create ext4 Filesystem in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Create-ext4-Filesystem.png) - -Create ext4 Filesystem - -9. Once ext4 filesystem has been created for Raid device, now create a mount point directory (i.e. /mnt/raid0) and mount the device /dev/md0 under it. - - # mkdir /mnt/raid0 - # mount /dev/md0 /mnt/raid0/ - -10. Next, verify that the device /dev/md0 is mounted under /mnt/raid0 directory using df command. - - # df -h - -11. Next, create a file called ‘tecmint.txt‘ under the mount point /mnt/raid0, add some content to the created file and view the content of a file and directory. - - # touch /mnt/raid0/tecmint.txt - # echo "Hi everyone how you doing ?" > /mnt/raid0/tecmint.txt - # cat /mnt/raid0/tecmint.txt - # ls -l /mnt/raid0/ - -![Verify Mount Device](http://www.tecmint.com/wp-content/uploads/2014/10/Verify-Mount-Device.png) - -Verify Mount Device - -12. Once you’ve verified mount points, it’s time to create an fstab entry in /etc/fstab file. - - # vim /etc/fstab - -Add the following entry as described. May vary according to your mount location and filesystem you using. - - /dev/md0 /mnt/raid0 ext4 deaults 0 0 - -![Add Device to Fstab](http://www.tecmint.com/wp-content/uploads/2014/10/Add-Device-to-Fstab.png) - -Add Device to Fstab - -13. Run mount ‘-a‘ to check if there is any error in fstab entry. - - # mount -av - -![Check Errors in Fstab](http://www.tecmint.com/wp-content/uploads/2014/10/Check-Errors-in-Fstab.png) - -Check Errors in Fstab - -### Step 6: Saving RAID Configurations ### - -14. Finally, save the raid configuration to one of the file to keep the configurations for future use. Again we use ‘mdadm’ command with ‘-s‘ (scan) and ‘-v‘ (verbose) options as shown. - - # mdadm -E -s -v >> /etc/mdadm.conf - # mdadm --detail --scan --verbose >> /etc/mdadm.conf - # cat /etc/mdadm.conf - -![Save RAID Configurations](http://www.tecmint.com/wp-content/uploads/2014/10/Save-RAID-Configurations.png) - -Save RAID Configurations - -That’s it, we have seen here, how to configure RAID0 striping with raid levels by using two hard disks. In next article, we will see how to setup RAID5. - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/create-raid0-in-linux/ - -作者:[Babin Lonston][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.tecmint.com/author/babinlonston/ -[1]:http://www.tecmint.com/understanding-raid-setup-in-linux/ \ No newline at end of file From 5a2d8d351fa17cb222c3ab9429902a75352d9804 Mon Sep 17 00:00:00 2001 From: struggling <630441839@qq.com> Date: Sun, 2 Aug 2015 16:15:47 +0800 Subject: [PATCH 762/965] =?UTF-8?q?Create=20Introduction=20to=20RAID,=20Co?= =?UTF-8?q?ncepts=20of=20RAID=20and=20RAID=20Levels=20=E2=80=93=20Part=201?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... Concepts of RAID and RAID Levels – Part 1 | 146 ++++++++++++++++++ 1 file changed, 146 insertions(+) create mode 100644 translated/Introduction to RAID, Concepts of RAID and RAID Levels – Part 1 diff --git a/translated/Introduction to RAID, Concepts of RAID and RAID Levels – Part 1 b/translated/Introduction to RAID, Concepts of RAID and RAID Levels – Part 1 new file mode 100644 index 0000000000..8ca0ecbd7e --- /dev/null +++ b/translated/Introduction to RAID, Concepts of RAID and RAID Levels – Part 1 @@ -0,0 +1,146 @@ + +RAID的级别和概念的介绍 - 第1部分 +================================================================================ +RAID是廉价磁盘冗余阵列,但现在它被称为独立磁盘冗余阵列。早先一个容量很小的磁盘都是非常昂贵的,但是现在我们可以很便宜的买到一个更大的磁盘。Raid 是磁盘的一个集合,被称为逻辑卷。 + + +![RAID in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/RAID.jpg) + +在 Linux 中理解 RAID 的设置 + +RAID包含一组或者一个集合甚至一个阵列。使用一组磁盘结合驱动器组成 RAID 阵列或 RAID 集。一个 RAID 控制器至少使用两个磁盘并且使用一个逻辑卷或者多个驱动器在一个组中。在一个磁盘组的应用中只能使用一个 RAID 级别。使用 RAID 可以提高服务器的性能。不同 RAID 的级别,性能会有所不同。它通过容错和高可用性来保存我们的数据。 + +这个系列被命名为RAID的构建共包含9个部分包括以下主题。 + +- 第1部分:RAID的级别和概念的介绍 +- 第2部分:在Linux中如何设置 RAID0(条带化) +- 第3部分:在Linux中如何设置 RAID1(镜像化) +- 第4部分:在Linux中如何设置 RAID5(条带化与分布式奇偶校验) +- 第5部分:在Linux中如何设置 RAID6(条带双分布式奇偶校验) +- 第6部分:在Linux中设置 RAID 10 或1 + 0(嵌套) +- 第7部分:增加现有的 RAID 阵列并删除损坏的磁盘 +- 第8部分:在 RAID 中恢复(重建)损坏的驱动器 +- 第9部分:在 Linux 中管理 RAID + +这是9系列教程的第1部分,在这里我们将介绍 RAID 的概念和 RAID 级别,这是在 Linux 中构建 RAID 需要理解的。 + + +### 软件RAID和硬件RAID ### + +软件 RAID 的性能很低,因为其从主机资源消耗。 RAID 软件需要加载可读取数据从软件 RAID 卷中。在加载 RAID 软件前,操作系统需要得到加载 RAID 软件的引导。在软件 RAID 中无需物理硬件。零成本投资。 + +硬件 RAID 具有很高的性能。他们有专用的 RAID 控制器,采用 PCI Express卡物理内置的。它不会使用主机资源。他们有 NVRAM 缓存读取和写入。当重建时即使出现电源故障,它会使用电池电源备份存储缓存。对于大规模使用需要非常昂贵的投资。 + +硬件 RAID 卡如下所示: + +![Hardware RAID](http://www.tecmint.com/wp-content/uploads/2014/10/Hardware-RAID.jpg) + +硬件RAID + +#### 精选的 RAID 概念 #### + +- 在 RAID 重建中校验方法中丢失的内容来自从校验中保存的信息。 RAID 5,RAID 6 基于校验。 +- 条带化是随机共享数据到多个磁盘。它不会在单个磁盘中保存完整的数据。如果我们使用3个磁盘,则数据将会存在于每个磁盘上。 +- 镜像被用于 RAID 1 和 RAID 10。镜像会自动备份数据。在 RAID 1,它将保存相同的内容到其他盘上。 +- 在我们的服务器上,热备份只是一个备用驱动器,它可以自动更换发生故障的驱动器。在我们的阵列中,如果任何一个驱动器损坏,热备份驱动器会自动重建。 +- 块是 RAID 控制器每次读写数据时的最小单位,最小4KB。通过定义块大小,我们可以增加 I/O 性能。 + +RAID有不同的级别。在这里,我们仅看到在真实环境下的使用最多的 RAID 级别。 + +- RAID0 = 条带化 +- RAID1 = 镜像 +- RAID5 = 单个磁盘分布式奇偶校验 +- RAID6 = 双盘分布式奇偶校验 +- RAID10 = 镜像 + 条带。(嵌套RAID) + +RAID 在大多数 Linux 发行版上使用 mdadm 的包管理。让我们先对每个 RAID 级别认识一下。 + +#### RAID 0(或)条带化 #### + +条带化有很好的性能。在 RAID 0(条带化)中数据将使用共享的方式被写入到磁盘。一半的内容将是在一个磁盘上,另一半内容将被写入到其它磁盘。 + +假设我们有2个磁盘驱动器,例如,如果我们将数据“TECMINT”写到逻辑卷中,“T”将被保存在第一盘中,“E”将保存在第二盘,'C'将被保存在第一盘,“M”将保存在第二盘,它会一直继续此循环过程。 + +在这种情况下,如果驱动器中的任何一个发生故障,我们将丢失所有的数据,因为一个盘中只有一半的数据,不能用于重建。不过,当比较写入速度和性能时,RAID0 是非常好的。创建 RAID 0(条带化)至少需要2个磁盘。如果你的数据是非常宝贵的,那么不要使用此 RAID 级别。 + +- 高性能。 +- 在 RAID0 上零容量损失。 +- 零容错。 +- 写和读有很高的性能。 + +#### RAID1(或)镜像化 #### + +镜像也有不错的性能。镜像可以备份我们的数据。假设我们有两组2TB的硬盘驱动器,我们总共有4TB,但在镜像中,驱动器在 RAID 控制器的后面形成一个逻辑驱动器,我们只能看到逻辑驱动器有2TB。 + +当我们保存数据时,它将同时写入2TB驱动器中。创建 RAID 1 (镜像化)最少需要两个驱动器。如果发生磁盘故障,我们可以恢复 RAID 通过更换一个新的磁盘。如果在 RAID 1 中任何一个磁盘发生故障,我们可以从另一个磁盘中获取相同的数据,因为其他的磁盘中也有相同的数据。所以是零数据丢失。 + +- 良好的性能。 +- 空间的一半将在总容量丢失。 +- 完全容错。 +- 重建会更快。 +- 写性能将是缓慢的。 +- 读将会很好。 +- 被操作系统和数据库使用的规模很小。 + +#### RAID 5(或)分布式奇偶校验 #### + +RAID 5 多用于企业的水平。 RAID 5 的工作通过分布式奇偶校验的方法。奇偶校验信息将被用于重建数据。它需要留下的正常驱动器上的信息去重建。驱动器故障时,这会保护我们的数据。 + +假设我们有4个驱动器,如果一个驱动器发生故障而后我们更换发生故障的驱动器后,我们可以从奇偶校验中重建数据到更换的驱动器上。奇偶校验信息存储在所有的4个驱动器上,如果我们有4个 1TB 的驱动器。奇偶校验信息将被存储在每个驱动器的256G中而其它768GB是用户自己使用的。单个驱动器故障后,RAID 5 依旧正常工作,如果驱动器损坏个数超过1个会导致数据的丢失。 + +- 性能卓越 +- 读速度将非常好。 +- 如果我们不使用硬件 RAID 控制器,写速度是缓慢的。 +- 从所有驱动器的奇偶校验信息中重建。 +- 完全容错。 +- 1个磁盘空间将用于奇偶校验。 +- 可以被用在文件服务器,Web服务器,非常重要的备份中。 + +#### RAID 6 两个分布式奇偶校验磁盘 #### + +RAID 6 和 RAID 5 相似但它有两个分布式奇偶校验。大多用在大量的阵列中。我们最少需要4个驱动器,即使有2个驱动器发生故障,我们依然可以重建数据,同时更换新的驱动器。 + +它比 RAID 5 非常慢,因为它将数据同时写到4个驱动器上。当我们使用硬件 RAID 控制器时速度将被平均。如果我们有6个的1TB驱动器,4个驱动器将用于数据保存,2个驱动器将用于校验。 + +- 性能不佳。 +- 读的性能很好。 +- 如果我们不使用硬件 RAID 控制器写的性能会很差。 +- 从2奇偶校验驱动器上重建。 +- 完全容错。 +- 2个磁盘空间将用于奇偶校验。 +- 可用于大型阵列。 +- 在备份和视频流中大规模使用。 + +#### RAID 10(或)镜像+条带 #### + +RAID 10 可以被称为1 + 0或0 +1。它将做镜像+条带两个工作。在 RAID 10 中首先做镜像然后做条带。在 RAID 01 上首先做条带,然后做镜像。RAID 10 比 01 好。 + +假设,我们有4个驱动器。当我写了一些数据到逻辑卷上,它会使用镜像和条带将数据保存到4个驱动器上。 + +如果我在 RAID 10 上写入数据“TECMINT”,数据将使用如下形式保存。首先将“T”同时写入两个磁盘,“E”也将同时写入两个磁盘,这一步将所有数据都写入。这使数据得到备份。 + +同时它将使用 RAID 0 方式写入数据,遵循将“T”写入第一个盘,“E”写入第二个盘。再次将“C”写入第一个盘,“M”到第二个盘。 + +- 良好的读写性能。 +- 空间的一半将在总容量丢失。 +- 容错。 +- 从备份数据中快速重建。 +- 它的高性能和高可用性常被用于数据库的存储中。 + +### 结论 ### + +在这篇文章中,我们已经看到了什么是 RAID 和在实际环境大多采用 RAID 的哪个级别。希望你已经学会了上面所写的。对于 RAID 的构建必须了解有关 RAID 的基本知识。以上内容对于你了解 RAID 基本满足。 + +在接下来的文章中,我将介绍如何设置和使用各种级别创建 RAID,增加 RAID 组(阵列)和驱动器故障排除等。 + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/understanding-raid-setup-in-linux/ + +作者:[Babin Lonston][a] +译者:[strugglingyouth](https://github.com/strugglingyouth) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/babinlonston/ From f1ab428b04c8e3d225b0e5bfdde1c28f541282e3 Mon Sep 17 00:00:00 2001 From: struggling <630441839@qq.com> Date: Sun, 2 Aug 2015 16:16:13 +0800 Subject: [PATCH 763/965] =?UTF-8?q?Delete=20Introduction=20to=20RAID,=20Co?= =?UTF-8?q?ncepts=20of=20RAID=20and=20RAID=20Levels=20=E2=80=93=20Part=201?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... Concepts of RAID and RAID Levels – Part 1 | 146 ------------------ 1 file changed, 146 deletions(-) delete mode 100644 translated/Introduction to RAID, Concepts of RAID and RAID Levels – Part 1 diff --git a/translated/Introduction to RAID, Concepts of RAID and RAID Levels – Part 1 b/translated/Introduction to RAID, Concepts of RAID and RAID Levels – Part 1 deleted file mode 100644 index 8ca0ecbd7e..0000000000 --- a/translated/Introduction to RAID, Concepts of RAID and RAID Levels – Part 1 +++ /dev/null @@ -1,146 +0,0 @@ - -RAID的级别和概念的介绍 - 第1部分 -================================================================================ -RAID是廉价磁盘冗余阵列,但现在它被称为独立磁盘冗余阵列。早先一个容量很小的磁盘都是非常昂贵的,但是现在我们可以很便宜的买到一个更大的磁盘。Raid 是磁盘的一个集合,被称为逻辑卷。 - - -![RAID in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/RAID.jpg) - -在 Linux 中理解 RAID 的设置 - -RAID包含一组或者一个集合甚至一个阵列。使用一组磁盘结合驱动器组成 RAID 阵列或 RAID 集。一个 RAID 控制器至少使用两个磁盘并且使用一个逻辑卷或者多个驱动器在一个组中。在一个磁盘组的应用中只能使用一个 RAID 级别。使用 RAID 可以提高服务器的性能。不同 RAID 的级别,性能会有所不同。它通过容错和高可用性来保存我们的数据。 - -这个系列被命名为RAID的构建共包含9个部分包括以下主题。 - -- 第1部分:RAID的级别和概念的介绍 -- 第2部分:在Linux中如何设置 RAID0(条带化) -- 第3部分:在Linux中如何设置 RAID1(镜像化) -- 第4部分:在Linux中如何设置 RAID5(条带化与分布式奇偶校验) -- 第5部分:在Linux中如何设置 RAID6(条带双分布式奇偶校验) -- 第6部分:在Linux中设置 RAID 10 或1 + 0(嵌套) -- 第7部分:增加现有的 RAID 阵列并删除损坏的磁盘 -- 第8部分:在 RAID 中恢复(重建)损坏的驱动器 -- 第9部分:在 Linux 中管理 RAID - -这是9系列教程的第1部分,在这里我们将介绍 RAID 的概念和 RAID 级别,这是在 Linux 中构建 RAID 需要理解的。 - - -### 软件RAID和硬件RAID ### - -软件 RAID 的性能很低,因为其从主机资源消耗。 RAID 软件需要加载可读取数据从软件 RAID 卷中。在加载 RAID 软件前,操作系统需要得到加载 RAID 软件的引导。在软件 RAID 中无需物理硬件。零成本投资。 - -硬件 RAID 具有很高的性能。他们有专用的 RAID 控制器,采用 PCI Express卡物理内置的。它不会使用主机资源。他们有 NVRAM 缓存读取和写入。当重建时即使出现电源故障,它会使用电池电源备份存储缓存。对于大规模使用需要非常昂贵的投资。 - -硬件 RAID 卡如下所示: - -![Hardware RAID](http://www.tecmint.com/wp-content/uploads/2014/10/Hardware-RAID.jpg) - -硬件RAID - -#### 精选的 RAID 概念 #### - -- 在 RAID 重建中校验方法中丢失的内容来自从校验中保存的信息。 RAID 5,RAID 6 基于校验。 -- 条带化是随机共享数据到多个磁盘。它不会在单个磁盘中保存完整的数据。如果我们使用3个磁盘,则数据将会存在于每个磁盘上。 -- 镜像被用于 RAID 1 和 RAID 10。镜像会自动备份数据。在 RAID 1,它将保存相同的内容到其他盘上。 -- 在我们的服务器上,热备份只是一个备用驱动器,它可以自动更换发生故障的驱动器。在我们的阵列中,如果任何一个驱动器损坏,热备份驱动器会自动重建。 -- 块是 RAID 控制器每次读写数据时的最小单位,最小4KB。通过定义块大小,我们可以增加 I/O 性能。 - -RAID有不同的级别。在这里,我们仅看到在真实环境下的使用最多的 RAID 级别。 - -- RAID0 = 条带化 -- RAID1 = 镜像 -- RAID5 = 单个磁盘分布式奇偶校验 -- RAID6 = 双盘分布式奇偶校验 -- RAID10 = 镜像 + 条带。(嵌套RAID) - -RAID 在大多数 Linux 发行版上使用 mdadm 的包管理。让我们先对每个 RAID 级别认识一下。 - -#### RAID 0(或)条带化 #### - -条带化有很好的性能。在 RAID 0(条带化)中数据将使用共享的方式被写入到磁盘。一半的内容将是在一个磁盘上,另一半内容将被写入到其它磁盘。 - -假设我们有2个磁盘驱动器,例如,如果我们将数据“TECMINT”写到逻辑卷中,“T”将被保存在第一盘中,“E”将保存在第二盘,'C'将被保存在第一盘,“M”将保存在第二盘,它会一直继续此循环过程。 - -在这种情况下,如果驱动器中的任何一个发生故障,我们将丢失所有的数据,因为一个盘中只有一半的数据,不能用于重建。不过,当比较写入速度和性能时,RAID0 是非常好的。创建 RAID 0(条带化)至少需要2个磁盘。如果你的数据是非常宝贵的,那么不要使用此 RAID 级别。 - -- 高性能。 -- 在 RAID0 上零容量损失。 -- 零容错。 -- 写和读有很高的性能。 - -#### RAID1(或)镜像化 #### - -镜像也有不错的性能。镜像可以备份我们的数据。假设我们有两组2TB的硬盘驱动器,我们总共有4TB,但在镜像中,驱动器在 RAID 控制器的后面形成一个逻辑驱动器,我们只能看到逻辑驱动器有2TB。 - -当我们保存数据时,它将同时写入2TB驱动器中。创建 RAID 1 (镜像化)最少需要两个驱动器。如果发生磁盘故障,我们可以恢复 RAID 通过更换一个新的磁盘。如果在 RAID 1 中任何一个磁盘发生故障,我们可以从另一个磁盘中获取相同的数据,因为其他的磁盘中也有相同的数据。所以是零数据丢失。 - -- 良好的性能。 -- 空间的一半将在总容量丢失。 -- 完全容错。 -- 重建会更快。 -- 写性能将是缓慢的。 -- 读将会很好。 -- 被操作系统和数据库使用的规模很小。 - -#### RAID 5(或)分布式奇偶校验 #### - -RAID 5 多用于企业的水平。 RAID 5 的工作通过分布式奇偶校验的方法。奇偶校验信息将被用于重建数据。它需要留下的正常驱动器上的信息去重建。驱动器故障时,这会保护我们的数据。 - -假设我们有4个驱动器,如果一个驱动器发生故障而后我们更换发生故障的驱动器后,我们可以从奇偶校验中重建数据到更换的驱动器上。奇偶校验信息存储在所有的4个驱动器上,如果我们有4个 1TB 的驱动器。奇偶校验信息将被存储在每个驱动器的256G中而其它768GB是用户自己使用的。单个驱动器故障后,RAID 5 依旧正常工作,如果驱动器损坏个数超过1个会导致数据的丢失。 - -- 性能卓越 -- 读速度将非常好。 -- 如果我们不使用硬件 RAID 控制器,写速度是缓慢的。 -- 从所有驱动器的奇偶校验信息中重建。 -- 完全容错。 -- 1个磁盘空间将用于奇偶校验。 -- 可以被用在文件服务器,Web服务器,非常重要的备份中。 - -#### RAID 6 两个分布式奇偶校验磁盘 #### - -RAID 6 和 RAID 5 相似但它有两个分布式奇偶校验。大多用在大量的阵列中。我们最少需要4个驱动器,即使有2个驱动器发生故障,我们依然可以重建数据,同时更换新的驱动器。 - -它比 RAID 5 非常慢,因为它将数据同时写到4个驱动器上。当我们使用硬件 RAID 控制器时速度将被平均。如果我们有6个的1TB驱动器,4个驱动器将用于数据保存,2个驱动器将用于校验。 - -- 性能不佳。 -- 读的性能很好。 -- 如果我们不使用硬件 RAID 控制器写的性能会很差。 -- 从2奇偶校验驱动器上重建。 -- 完全容错。 -- 2个磁盘空间将用于奇偶校验。 -- 可用于大型阵列。 -- 在备份和视频流中大规模使用。 - -#### RAID 10(或)镜像+条带 #### - -RAID 10 可以被称为1 + 0或0 +1。它将做镜像+条带两个工作。在 RAID 10 中首先做镜像然后做条带。在 RAID 01 上首先做条带,然后做镜像。RAID 10 比 01 好。 - -假设,我们有4个驱动器。当我写了一些数据到逻辑卷上,它会使用镜像和条带将数据保存到4个驱动器上。 - -如果我在 RAID 10 上写入数据“TECMINT”,数据将使用如下形式保存。首先将“T”同时写入两个磁盘,“E”也将同时写入两个磁盘,这一步将所有数据都写入。这使数据得到备份。 - -同时它将使用 RAID 0 方式写入数据,遵循将“T”写入第一个盘,“E”写入第二个盘。再次将“C”写入第一个盘,“M”到第二个盘。 - -- 良好的读写性能。 -- 空间的一半将在总容量丢失。 -- 容错。 -- 从备份数据中快速重建。 -- 它的高性能和高可用性常被用于数据库的存储中。 - -### 结论 ### - -在这篇文章中,我们已经看到了什么是 RAID 和在实际环境大多采用 RAID 的哪个级别。希望你已经学会了上面所写的。对于 RAID 的构建必须了解有关 RAID 的基本知识。以上内容对于你了解 RAID 基本满足。 - -在接下来的文章中,我将介绍如何设置和使用各种级别创建 RAID,增加 RAID 组(阵列)和驱动器故障排除等。 - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/understanding-raid-setup-in-linux/ - -作者:[Babin Lonston][a] -译者:[strugglingyouth](https://github.com/strugglingyouth) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.tecmint.com/author/babinlonston/ From 9e4df4271683151f4f04b3cc44bc04b1f16cf1e0 Mon Sep 17 00:00:00 2001 From: struggling <630441839@qq.com> Date: Sun, 2 Aug 2015 16:16:43 +0800 Subject: [PATCH 764/965] =?UTF-8?q?Create=20Introduction=20to=20RAID,=20Co?= =?UTF-8?q?ncepts=20of=20RAID=20and=20RAID=20Levels=20=E2=80=93=20Part=201?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... Concepts of RAID and RAID Levels – Part 1 | 218 ++++++++++++++++++ 1 file changed, 218 insertions(+) create mode 100644 translated/tech/Introduction to RAID, Concepts of RAID and RAID Levels – Part 1 diff --git a/translated/tech/Introduction to RAID, Concepts of RAID and RAID Levels – Part 1 b/translated/tech/Introduction to RAID, Concepts of RAID and RAID Levels – Part 1 new file mode 100644 index 0000000000..9feba99609 --- /dev/null +++ b/translated/tech/Introduction to RAID, Concepts of RAID and RAID Levels – Part 1 @@ -0,0 +1,218 @@ +在 Linux 上使用 ‘mdadm’ 工具创建软件 RAID0 (条带化)在 ‘两个设备’ 上 - 第2部分 +================================================================================ +RAID 是廉价磁盘的冗余阵列,其高可用性和可靠性适用于大规模环境中,为了使数据被保护而不是被正常使用。RAID 只是磁盘的一个集合被称为逻辑卷。结合驱动器,使其成为一个阵列或称为集合(组)。 + +创建 RAID 最少应使用2个磁盘被连接组成 RAID 控制器,逻辑卷或多个驱动器可以根据定义的 RAID 级别添加在一个阵列中。不使用物理硬件创建的 RAID 被称为软件 RAID。软件 RAID 一般都是不太有钱的人才使用的。 + +![Setup RAID0 in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Raid0-in-Linux.jpg) + +在 Linux 中创建 RAID0 + +使用 RAID 的主要目的是为了在单点故障时保存数据,如果我们使用单个磁盘来存储数据,如果它损坏了,那么就没有机会取回我们的数据了,为了防止数据丢失我们需要一个容错的方法。所以,我们可以使用多个磁盘组成 RAID 阵列。 + +#### 在 RAID 0 中条带是什么 #### + +条带是通过将数据在同一时间分割到多个磁盘上。假设我们有两个磁盘,如果我们将数据保存到逻辑卷上,它会将数据保存在两个磁盘上。使用 RAID 0 是为了获得更好的性能,但是如果驱动器中一个出现故障,我们将不能得到完整的数据。因此,使用 RAID 0 不是一种好的做法。唯一的解决办法就是安装有 RAID0 逻辑卷的操作系统来提高文件的安全性。 + +- RAID 0 性能较高。 +- 在 RAID 0 上,空间零浪费。 +- 零容错(如果硬盘中的任何一个发生故障,无法取回数据)。 +- 写和读性能得以提高。 + +#### 要求 #### + +创建 RAID 0 允许的最小磁盘数目是2个,但你可以添加更多的磁盘,但数目应该是2,4,6,8等的两倍。如果你有一个物理 RAID 卡并且有足够的端口,你可以添加更多磁盘。 + +在这里,我们没有使用硬件 RAID,此设置只依赖于软件 RAID。如果我们有一个物理硬件 RAID 卡,我们可以从它的 UI 组件访问它。有些主板默认内建 RAID 功能,还可以使用 Ctrl + I 键访问 UI。 + +如果你是刚开始设置 RAID,请阅读我们前面的文章,我们已经介绍了一些关于 RAID 基本的概念。 + +- [Introduction to RAID and RAID Concepts][1] + +**我的服务器设置** + + Operating System : CentOS 6.5 Final + IP Address : 192.168.0.225 + Two Disks : 20 GB each + +这篇文章是9个 RAID 系列教程的第2部分,在这部分,我们将看看如何能够在 Linux 上创建和使用 RAID0(条带化),以名为 sdb 和 sdc 两个20GB的硬盘为例。 + +### 第1步:更新系统和安装管理 RAID 的 mdadm 软件 ### + +1.在 Linux 上设置 RAID0 前,我们先更新一下系统,然后安装 ‘mdadm’ 包。mdadm 是一个小程序,这将使我们能够在Linux下配置和管理 RAID 设备。 + + # yum clean all && yum update + # yum install mdadm -y + +![install mdadm in linux](http://www.tecmint.com/wp-content/uploads/2014/10/install-mdadm-in-linux.png) + +安装 mdadm 工具 + +### 第2步:检测并连接两个 20GB 的硬盘 ### + +2.在创建 RAID 0 前,请务必确认两个硬盘能被检测到,使用下面的命令确认。 + + # ls -l /dev | grep sd + +![Check Hard Drives in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Check-Hard-Drives.png) + +检查硬盘 + +3.一旦检测到新的硬盘驱动器,同时检查是否连接的驱动器已经被现有的 RAID 使用,使用下面的 ‘mdadm’ 命令来查看。 + + # mdadm --examine /dev/sd[b-c] + +![Check RAID Devices in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Check-Drives-using-RAID.png) + +检查 RAID 设备 + +从上面的输出我们可以看到,没有任何 RAID 使用 sdb 和 sdc 这两个驱动器。 + +### 第3步:创建 RAID 分区 ### + +4.现在用 sdb 和 sdc 创建 RAID 的分区,使用 fdisk 命令来创建。在这里,我将展示如何创建 sdb 驱动器上的分区。 + + # fdisk /dev/sdb + +请按照以下说明创建分区。 + +- 按 ‘n’ 创建新的分区。 +- 然后按 ‘P’ 选择主分区。 +- 接下来选择分区号为1。 +- 只需按两次回车键选择默认值即可。 +- 然后,按 ‘P’ 来打印创建好的分区。 + +![Create Partitions in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Create-Partitions-in-Linux.png) + +创建分区 + +请按照以下说明将分区创建为 Linux 的 RAID 类型。 + +- 按 ‘L’,列出所有可用的类型。 +- 按 ‘t’ 去修改分区。 +- 键入 ‘fd’ 设置为Linux 的 RAID 类型,然后按 Enter 确认。 +- 然后再次使用‘p’查看我们所做的更改。 +- 使用‘w’保存更改。 + +![Create RAID Partitions](http://www.tecmint.com/wp-content/uploads/2014/10/Create-RAID-Partitions.png) + +在 Linux 上创建 RAID 分区 + +**注**: 请使用上述步骤同样在 sdc 驱动器上创建分区。 + +5.创建分区后,验证这两个驱动器能使用下面的命令来正确定义 RAID。 + + # mdadm --examine /dev/sd[b-c] + # mdadm --examine /dev/sd[b-c]1 + +![Verify RAID Partitions](http://www.tecmint.com/wp-content/uploads/2014/10/Verify-RAID-Partitions.png) + +验证 RAID 分区 + +### 第4步:创建 RAID md 设备 ### + +6.现在使用以下命令创建 md 设备(即 /dev/md0),并选择 RAID 合适的级别。 + + # mdadm -C /dev/md0 -l raid0 -n 2 /dev/sd[b-c]1 + # mdadm --create /dev/md0 --level=stripe --raid-devices=2 /dev/sd[b-c]1 + +- -C – create +- -l – level +- -n – No of raid-devices + +7.一旦 md 设备已经建立,使用如下命令可以查看 RAID 级别,设备和阵列的使用状态。 + + # cat /proc/mdstat + +![Verify RAID Level](http://www.tecmint.com/wp-content/uploads/2014/10/Verify-RAID-Level.png) + +查看 RAID 级别 + + # mdadm -E /dev/sd[b-c]1 + +![Verify RAID Device](http://www.tecmint.com/wp-content/uploads/2014/10/Verify-RAID-Device.png) + +查看 RAID 设备 + + # mdadm --detail /dev/md0 + +![Verify RAID Array](http://www.tecmint.com/wp-content/uploads/2014/10/Verify-RAID-Array.png) + +查看 RAID 阵列 + +### 第5步:挂载 RAID 设备到文件系统 ### + +8.将 RAID 设备 /dev/md0 创建为 ext4 文件系统并挂载到 /mnt/raid0 下。 + + # mkfs.ext4 /dev/md0 + +![Create ext4 Filesystem in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Create-ext4-Filesystem.png) + +创建 ext4 文件系统 + +9. ext4 文件系统为 RAID 设备创建好后,现在创建一个挂载点(即 /mnt/raid0),并将设备 /dev/md0 挂载在它下。 + + # mkdir /mnt/raid0 + # mount /dev/md0 /mnt/raid0/ + +10.下一步,使用 df 命令验证设备 /dev/md0 是否被挂载在 /mnt/raid0 下。 + + # df -h + +11.接下来,创建一个名为 ‘tecmint.txt’ 的文件挂载到 /mnt/raid0 下,为创建的文件添加一些内容,并查看文件和目录的内容。 + + # touch /mnt/raid0/tecmint.txt + # echo "Hi everyone how you doing ?" > /mnt/raid0/tecmint.txt + # cat /mnt/raid0/tecmint.txt + # ls -l /mnt/raid0/ + +![Verify Mount Device](http://www.tecmint.com/wp-content/uploads/2014/10/Verify-Mount-Device.png) + +验证挂载的设备 + +12.一旦你验证挂载点后,同时将它添加到 /etc/fstab 文件中。 + + # vim /etc/fstab + +添加以下条目,根据你的安装位置和使用文件系统的不同,自行做修改。 + + /dev/md0 /mnt/raid0 ext4 deaults 0 0 + +![Add Device to Fstab](http://www.tecmint.com/wp-content/uploads/2014/10/Add-Device-to-Fstab.png) + +添加设备到 fstab 文件中 + +13.使用 mount ‘-a‘ 来检查 fstab 的条目是否有误。 + + # mount -av + +![Check Errors in Fstab](http://www.tecmint.com/wp-content/uploads/2014/10/Check-Errors-in-Fstab.png) + +检查 fstab 文件是否有误 + +### 第6步:保存 RAID 配置 ### + +14.最后,保存 RAID 配置到一个文件中,以供将来使用。同样,我们使用 ‘mdadm’ 命令带有 ‘-s‘ (scan) 和 ‘-v‘ (verbose) 选项,如图所示。 + + # mdadm -E -s -v >> /etc/mdadm.conf + # mdadm --detail --scan --verbose >> /etc/mdadm.conf + # cat /etc/mdadm.conf + +![Save RAID Configurations](http://www.tecmint.com/wp-content/uploads/2014/10/Save-RAID-Configurations.png) + +保存 RAID 配置 + +就这样,我们在这里看到,如何通过使用两个硬盘配置具有条带化的 RAID0 级别。在接下来的文章中,我们将看到如何设置 RAID5。 + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/create-raid0-in-linux/ + +作者:[Babin Lonston][a] +译者:[strugglingyouth](https://github.com/strugglingyouth) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/babinlonston/ +[1]:http://www.tecmint.com/understanding-raid-setup-in-linux/ From 0b475953acb42284d0e6595285b29c20745b9124 Mon Sep 17 00:00:00 2001 From: struggling <630441839@qq.com> Date: Sun, 2 Aug 2015 16:17:39 +0800 Subject: [PATCH 765/965] =?UTF-8?q?Update=20Introduction=20to=20RAID,=20Co?= =?UTF-8?q?ncepts=20of=20RAID=20and=20RAID=20Levels=20=E2=80=93=20Part=201?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... Concepts of RAID and RAID Levels – Part 1 | 250 +++++++----------- 1 file changed, 89 insertions(+), 161 deletions(-) diff --git a/translated/tech/Introduction to RAID, Concepts of RAID and RAID Levels – Part 1 b/translated/tech/Introduction to RAID, Concepts of RAID and RAID Levels – Part 1 index 9feba99609..8ca0ecbd7e 100644 --- a/translated/tech/Introduction to RAID, Concepts of RAID and RAID Levels – Part 1 +++ b/translated/tech/Introduction to RAID, Concepts of RAID and RAID Levels – Part 1 @@ -1,212 +1,141 @@ -在 Linux 上使用 ‘mdadm’ 工具创建软件 RAID0 (条带化)在 ‘两个设备’ 上 - 第2部分 + +RAID的级别和概念的介绍 - 第1部分 ================================================================================ -RAID 是廉价磁盘的冗余阵列,其高可用性和可靠性适用于大规模环境中,为了使数据被保护而不是被正常使用。RAID 只是磁盘的一个集合被称为逻辑卷。结合驱动器,使其成为一个阵列或称为集合(组)。 +RAID是廉价磁盘冗余阵列,但现在它被称为独立磁盘冗余阵列。早先一个容量很小的磁盘都是非常昂贵的,但是现在我们可以很便宜的买到一个更大的磁盘。Raid 是磁盘的一个集合,被称为逻辑卷。 -创建 RAID 最少应使用2个磁盘被连接组成 RAID 控制器,逻辑卷或多个驱动器可以根据定义的 RAID 级别添加在一个阵列中。不使用物理硬件创建的 RAID 被称为软件 RAID。软件 RAID 一般都是不太有钱的人才使用的。 -![Setup RAID0 in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Raid0-in-Linux.jpg) +![RAID in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/RAID.jpg) -在 Linux 中创建 RAID0 +在 Linux 中理解 RAID 的设置 -使用 RAID 的主要目的是为了在单点故障时保存数据,如果我们使用单个磁盘来存储数据,如果它损坏了,那么就没有机会取回我们的数据了,为了防止数据丢失我们需要一个容错的方法。所以,我们可以使用多个磁盘组成 RAID 阵列。 +RAID包含一组或者一个集合甚至一个阵列。使用一组磁盘结合驱动器组成 RAID 阵列或 RAID 集。一个 RAID 控制器至少使用两个磁盘并且使用一个逻辑卷或者多个驱动器在一个组中。在一个磁盘组的应用中只能使用一个 RAID 级别。使用 RAID 可以提高服务器的性能。不同 RAID 的级别,性能会有所不同。它通过容错和高可用性来保存我们的数据。 -#### 在 RAID 0 中条带是什么 #### +这个系列被命名为RAID的构建共包含9个部分包括以下主题。 -条带是通过将数据在同一时间分割到多个磁盘上。假设我们有两个磁盘,如果我们将数据保存到逻辑卷上,它会将数据保存在两个磁盘上。使用 RAID 0 是为了获得更好的性能,但是如果驱动器中一个出现故障,我们将不能得到完整的数据。因此,使用 RAID 0 不是一种好的做法。唯一的解决办法就是安装有 RAID0 逻辑卷的操作系统来提高文件的安全性。 +- 第1部分:RAID的级别和概念的介绍 +- 第2部分:在Linux中如何设置 RAID0(条带化) +- 第3部分:在Linux中如何设置 RAID1(镜像化) +- 第4部分:在Linux中如何设置 RAID5(条带化与分布式奇偶校验) +- 第5部分:在Linux中如何设置 RAID6(条带双分布式奇偶校验) +- 第6部分:在Linux中设置 RAID 10 或1 + 0(嵌套) +- 第7部分:增加现有的 RAID 阵列并删除损坏的磁盘 +- 第8部分:在 RAID 中恢复(重建)损坏的驱动器 +- 第9部分:在 Linux 中管理 RAID -- RAID 0 性能较高。 -- 在 RAID 0 上,空间零浪费。 -- 零容错(如果硬盘中的任何一个发生故障,无法取回数据)。 -- 写和读性能得以提高。 +这是9系列教程的第1部分,在这里我们将介绍 RAID 的概念和 RAID 级别,这是在 Linux 中构建 RAID 需要理解的。 -#### 要求 #### -创建 RAID 0 允许的最小磁盘数目是2个,但你可以添加更多的磁盘,但数目应该是2,4,6,8等的两倍。如果你有一个物理 RAID 卡并且有足够的端口,你可以添加更多磁盘。 +### 软件RAID和硬件RAID ### -在这里,我们没有使用硬件 RAID,此设置只依赖于软件 RAID。如果我们有一个物理硬件 RAID 卡,我们可以从它的 UI 组件访问它。有些主板默认内建 RAID 功能,还可以使用 Ctrl + I 键访问 UI。 +软件 RAID 的性能很低,因为其从主机资源消耗。 RAID 软件需要加载可读取数据从软件 RAID 卷中。在加载 RAID 软件前,操作系统需要得到加载 RAID 软件的引导。在软件 RAID 中无需物理硬件。零成本投资。 -如果你是刚开始设置 RAID,请阅读我们前面的文章,我们已经介绍了一些关于 RAID 基本的概念。 +硬件 RAID 具有很高的性能。他们有专用的 RAID 控制器,采用 PCI Express卡物理内置的。它不会使用主机资源。他们有 NVRAM 缓存读取和写入。当重建时即使出现电源故障,它会使用电池电源备份存储缓存。对于大规模使用需要非常昂贵的投资。 -- [Introduction to RAID and RAID Concepts][1] +硬件 RAID 卡如下所示: -**我的服务器设置** +![Hardware RAID](http://www.tecmint.com/wp-content/uploads/2014/10/Hardware-RAID.jpg) - Operating System : CentOS 6.5 Final - IP Address : 192.168.0.225 - Two Disks : 20 GB each +硬件RAID -这篇文章是9个 RAID 系列教程的第2部分,在这部分,我们将看看如何能够在 Linux 上创建和使用 RAID0(条带化),以名为 sdb 和 sdc 两个20GB的硬盘为例。 +#### 精选的 RAID 概念 #### -### 第1步:更新系统和安装管理 RAID 的 mdadm 软件 ### +- 在 RAID 重建中校验方法中丢失的内容来自从校验中保存的信息。 RAID 5,RAID 6 基于校验。 +- 条带化是随机共享数据到多个磁盘。它不会在单个磁盘中保存完整的数据。如果我们使用3个磁盘,则数据将会存在于每个磁盘上。 +- 镜像被用于 RAID 1 和 RAID 10。镜像会自动备份数据。在 RAID 1,它将保存相同的内容到其他盘上。 +- 在我们的服务器上,热备份只是一个备用驱动器,它可以自动更换发生故障的驱动器。在我们的阵列中,如果任何一个驱动器损坏,热备份驱动器会自动重建。 +- 块是 RAID 控制器每次读写数据时的最小单位,最小4KB。通过定义块大小,我们可以增加 I/O 性能。 -1.在 Linux 上设置 RAID0 前,我们先更新一下系统,然后安装 ‘mdadm’ 包。mdadm 是一个小程序,这将使我们能够在Linux下配置和管理 RAID 设备。 +RAID有不同的级别。在这里,我们仅看到在真实环境下的使用最多的 RAID 级别。 - # yum clean all && yum update - # yum install mdadm -y +- RAID0 = 条带化 +- RAID1 = 镜像 +- RAID5 = 单个磁盘分布式奇偶校验 +- RAID6 = 双盘分布式奇偶校验 +- RAID10 = 镜像 + 条带。(嵌套RAID) -![install mdadm in linux](http://www.tecmint.com/wp-content/uploads/2014/10/install-mdadm-in-linux.png) +RAID 在大多数 Linux 发行版上使用 mdadm 的包管理。让我们先对每个 RAID 级别认识一下。 -安装 mdadm 工具 +#### RAID 0(或)条带化 #### -### 第2步:检测并连接两个 20GB 的硬盘 ### +条带化有很好的性能。在 RAID 0(条带化)中数据将使用共享的方式被写入到磁盘。一半的内容将是在一个磁盘上,另一半内容将被写入到其它磁盘。 -2.在创建 RAID 0 前,请务必确认两个硬盘能被检测到,使用下面的命令确认。 +假设我们有2个磁盘驱动器,例如,如果我们将数据“TECMINT”写到逻辑卷中,“T”将被保存在第一盘中,“E”将保存在第二盘,'C'将被保存在第一盘,“M”将保存在第二盘,它会一直继续此循环过程。 - # ls -l /dev | grep sd +在这种情况下,如果驱动器中的任何一个发生故障,我们将丢失所有的数据,因为一个盘中只有一半的数据,不能用于重建。不过,当比较写入速度和性能时,RAID0 是非常好的。创建 RAID 0(条带化)至少需要2个磁盘。如果你的数据是非常宝贵的,那么不要使用此 RAID 级别。 -![Check Hard Drives in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Check-Hard-Drives.png) +- 高性能。 +- 在 RAID0 上零容量损失。 +- 零容错。 +- 写和读有很高的性能。 -检查硬盘 +#### RAID1(或)镜像化 #### -3.一旦检测到新的硬盘驱动器,同时检查是否连接的驱动器已经被现有的 RAID 使用,使用下面的 ‘mdadm’ 命令来查看。 +镜像也有不错的性能。镜像可以备份我们的数据。假设我们有两组2TB的硬盘驱动器,我们总共有4TB,但在镜像中,驱动器在 RAID 控制器的后面形成一个逻辑驱动器,我们只能看到逻辑驱动器有2TB。 - # mdadm --examine /dev/sd[b-c] +当我们保存数据时,它将同时写入2TB驱动器中。创建 RAID 1 (镜像化)最少需要两个驱动器。如果发生磁盘故障,我们可以恢复 RAID 通过更换一个新的磁盘。如果在 RAID 1 中任何一个磁盘发生故障,我们可以从另一个磁盘中获取相同的数据,因为其他的磁盘中也有相同的数据。所以是零数据丢失。 -![Check RAID Devices in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Check-Drives-using-RAID.png) +- 良好的性能。 +- 空间的一半将在总容量丢失。 +- 完全容错。 +- 重建会更快。 +- 写性能将是缓慢的。 +- 读将会很好。 +- 被操作系统和数据库使用的规模很小。 -检查 RAID 设备 +#### RAID 5(或)分布式奇偶校验 #### -从上面的输出我们可以看到,没有任何 RAID 使用 sdb 和 sdc 这两个驱动器。 +RAID 5 多用于企业的水平。 RAID 5 的工作通过分布式奇偶校验的方法。奇偶校验信息将被用于重建数据。它需要留下的正常驱动器上的信息去重建。驱动器故障时,这会保护我们的数据。 -### 第3步:创建 RAID 分区 ### +假设我们有4个驱动器,如果一个驱动器发生故障而后我们更换发生故障的驱动器后,我们可以从奇偶校验中重建数据到更换的驱动器上。奇偶校验信息存储在所有的4个驱动器上,如果我们有4个 1TB 的驱动器。奇偶校验信息将被存储在每个驱动器的256G中而其它768GB是用户自己使用的。单个驱动器故障后,RAID 5 依旧正常工作,如果驱动器损坏个数超过1个会导致数据的丢失。 -4.现在用 sdb 和 sdc 创建 RAID 的分区,使用 fdisk 命令来创建。在这里,我将展示如何创建 sdb 驱动器上的分区。 +- 性能卓越 +- 读速度将非常好。 +- 如果我们不使用硬件 RAID 控制器,写速度是缓慢的。 +- 从所有驱动器的奇偶校验信息中重建。 +- 完全容错。 +- 1个磁盘空间将用于奇偶校验。 +- 可以被用在文件服务器,Web服务器,非常重要的备份中。 - # fdisk /dev/sdb +#### RAID 6 两个分布式奇偶校验磁盘 #### -请按照以下说明创建分区。 +RAID 6 和 RAID 5 相似但它有两个分布式奇偶校验。大多用在大量的阵列中。我们最少需要4个驱动器,即使有2个驱动器发生故障,我们依然可以重建数据,同时更换新的驱动器。 -- 按 ‘n’ 创建新的分区。 -- 然后按 ‘P’ 选择主分区。 -- 接下来选择分区号为1。 -- 只需按两次回车键选择默认值即可。 -- 然后,按 ‘P’ 来打印创建好的分区。 +它比 RAID 5 非常慢,因为它将数据同时写到4个驱动器上。当我们使用硬件 RAID 控制器时速度将被平均。如果我们有6个的1TB驱动器,4个驱动器将用于数据保存,2个驱动器将用于校验。 -![Create Partitions in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Create-Partitions-in-Linux.png) +- 性能不佳。 +- 读的性能很好。 +- 如果我们不使用硬件 RAID 控制器写的性能会很差。 +- 从2奇偶校验驱动器上重建。 +- 完全容错。 +- 2个磁盘空间将用于奇偶校验。 +- 可用于大型阵列。 +- 在备份和视频流中大规模使用。 -创建分区 +#### RAID 10(或)镜像+条带 #### -请按照以下说明将分区创建为 Linux 的 RAID 类型。 +RAID 10 可以被称为1 + 0或0 +1。它将做镜像+条带两个工作。在 RAID 10 中首先做镜像然后做条带。在 RAID 01 上首先做条带,然后做镜像。RAID 10 比 01 好。 -- 按 ‘L’,列出所有可用的类型。 -- 按 ‘t’ 去修改分区。 -- 键入 ‘fd’ 设置为Linux 的 RAID 类型,然后按 Enter 确认。 -- 然后再次使用‘p’查看我们所做的更改。 -- 使用‘w’保存更改。 +假设,我们有4个驱动器。当我写了一些数据到逻辑卷上,它会使用镜像和条带将数据保存到4个驱动器上。 -![Create RAID Partitions](http://www.tecmint.com/wp-content/uploads/2014/10/Create-RAID-Partitions.png) +如果我在 RAID 10 上写入数据“TECMINT”,数据将使用如下形式保存。首先将“T”同时写入两个磁盘,“E”也将同时写入两个磁盘,这一步将所有数据都写入。这使数据得到备份。 -在 Linux 上创建 RAID 分区 +同时它将使用 RAID 0 方式写入数据,遵循将“T”写入第一个盘,“E”写入第二个盘。再次将“C”写入第一个盘,“M”到第二个盘。 -**注**: 请使用上述步骤同样在 sdc 驱动器上创建分区。 +- 良好的读写性能。 +- 空间的一半将在总容量丢失。 +- 容错。 +- 从备份数据中快速重建。 +- 它的高性能和高可用性常被用于数据库的存储中。 -5.创建分区后,验证这两个驱动器能使用下面的命令来正确定义 RAID。 +### 结论 ### - # mdadm --examine /dev/sd[b-c] - # mdadm --examine /dev/sd[b-c]1 +在这篇文章中,我们已经看到了什么是 RAID 和在实际环境大多采用 RAID 的哪个级别。希望你已经学会了上面所写的。对于 RAID 的构建必须了解有关 RAID 的基本知识。以上内容对于你了解 RAID 基本满足。 -![Verify RAID Partitions](http://www.tecmint.com/wp-content/uploads/2014/10/Verify-RAID-Partitions.png) - -验证 RAID 分区 - -### 第4步:创建 RAID md 设备 ### - -6.现在使用以下命令创建 md 设备(即 /dev/md0),并选择 RAID 合适的级别。 - - # mdadm -C /dev/md0 -l raid0 -n 2 /dev/sd[b-c]1 - # mdadm --create /dev/md0 --level=stripe --raid-devices=2 /dev/sd[b-c]1 - -- -C – create -- -l – level -- -n – No of raid-devices - -7.一旦 md 设备已经建立,使用如下命令可以查看 RAID 级别,设备和阵列的使用状态。 - - # cat /proc/mdstat - -![Verify RAID Level](http://www.tecmint.com/wp-content/uploads/2014/10/Verify-RAID-Level.png) - -查看 RAID 级别 - - # mdadm -E /dev/sd[b-c]1 - -![Verify RAID Device](http://www.tecmint.com/wp-content/uploads/2014/10/Verify-RAID-Device.png) - -查看 RAID 设备 - - # mdadm --detail /dev/md0 - -![Verify RAID Array](http://www.tecmint.com/wp-content/uploads/2014/10/Verify-RAID-Array.png) - -查看 RAID 阵列 - -### 第5步:挂载 RAID 设备到文件系统 ### - -8.将 RAID 设备 /dev/md0 创建为 ext4 文件系统并挂载到 /mnt/raid0 下。 - - # mkfs.ext4 /dev/md0 - -![Create ext4 Filesystem in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Create-ext4-Filesystem.png) - -创建 ext4 文件系统 - -9. ext4 文件系统为 RAID 设备创建好后,现在创建一个挂载点(即 /mnt/raid0),并将设备 /dev/md0 挂载在它下。 - - # mkdir /mnt/raid0 - # mount /dev/md0 /mnt/raid0/ - -10.下一步,使用 df 命令验证设备 /dev/md0 是否被挂载在 /mnt/raid0 下。 - - # df -h - -11.接下来,创建一个名为 ‘tecmint.txt’ 的文件挂载到 /mnt/raid0 下,为创建的文件添加一些内容,并查看文件和目录的内容。 - - # touch /mnt/raid0/tecmint.txt - # echo "Hi everyone how you doing ?" > /mnt/raid0/tecmint.txt - # cat /mnt/raid0/tecmint.txt - # ls -l /mnt/raid0/ - -![Verify Mount Device](http://www.tecmint.com/wp-content/uploads/2014/10/Verify-Mount-Device.png) - -验证挂载的设备 - -12.一旦你验证挂载点后,同时将它添加到 /etc/fstab 文件中。 - - # vim /etc/fstab - -添加以下条目,根据你的安装位置和使用文件系统的不同,自行做修改。 - - /dev/md0 /mnt/raid0 ext4 deaults 0 0 - -![Add Device to Fstab](http://www.tecmint.com/wp-content/uploads/2014/10/Add-Device-to-Fstab.png) - -添加设备到 fstab 文件中 - -13.使用 mount ‘-a‘ 来检查 fstab 的条目是否有误。 - - # mount -av - -![Check Errors in Fstab](http://www.tecmint.com/wp-content/uploads/2014/10/Check-Errors-in-Fstab.png) - -检查 fstab 文件是否有误 - -### 第6步:保存 RAID 配置 ### - -14.最后,保存 RAID 配置到一个文件中,以供将来使用。同样,我们使用 ‘mdadm’ 命令带有 ‘-s‘ (scan) 和 ‘-v‘ (verbose) 选项,如图所示。 - - # mdadm -E -s -v >> /etc/mdadm.conf - # mdadm --detail --scan --verbose >> /etc/mdadm.conf - # cat /etc/mdadm.conf - -![Save RAID Configurations](http://www.tecmint.com/wp-content/uploads/2014/10/Save-RAID-Configurations.png) - -保存 RAID 配置 - -就这样,我们在这里看到,如何通过使用两个硬盘配置具有条带化的 RAID0 级别。在接下来的文章中,我们将看到如何设置 RAID5。 +在接下来的文章中,我将介绍如何设置和使用各种级别创建 RAID,增加 RAID 组(阵列)和驱动器故障排除等。 -------------------------------------------------------------------------------- -via: http://www.tecmint.com/create-raid0-in-linux/ +via: http://www.tecmint.com/understanding-raid-setup-in-linux/ 作者:[Babin Lonston][a] 译者:[strugglingyouth](https://github.com/strugglingyouth) @@ -215,4 +144,3 @@ via: http://www.tecmint.com/create-raid0-in-linux/ 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 [a]:http://www.tecmint.com/author/babinlonston/ -[1]:http://www.tecmint.com/understanding-raid-setup-in-linux/ From 958d434bed7380f898c012761a351780b273d9bd Mon Sep 17 00:00:00 2001 From: struggling <630441839@qq.com> Date: Sun, 2 Aug 2015 16:18:07 +0800 Subject: [PATCH 766/965] =?UTF-8?q?Create=20Creating=20Software=20RAID0=20?= =?UTF-8?q?(Stripe)=20on=20=E2=80=98Two=20Devices=E2=80=99=20Using=20?= =?UTF-8?q?=E2=80=98mdadm=E2=80=99=20Tool=20in=20Linux=20=E2=80=93=20Part?= =?UTF-8?q?=202?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...evices’ Using ‘mdadm’ Tool in Linux – Part 2 | 218 ++++++++++++++++++ 1 file changed, 218 insertions(+) create mode 100644 translated/tech/Creating Software RAID0 (Stripe) on ‘Two Devices’ Using ‘mdadm’ Tool in Linux – Part 2 diff --git a/translated/tech/Creating Software RAID0 (Stripe) on ‘Two Devices’ Using ‘mdadm’ Tool in Linux – Part 2 b/translated/tech/Creating Software RAID0 (Stripe) on ‘Two Devices’ Using ‘mdadm’ Tool in Linux – Part 2 new file mode 100644 index 0000000000..9feba99609 --- /dev/null +++ b/translated/tech/Creating Software RAID0 (Stripe) on ‘Two Devices’ Using ‘mdadm’ Tool in Linux – Part 2 @@ -0,0 +1,218 @@ +在 Linux 上使用 ‘mdadm’ 工具创建软件 RAID0 (条带化)在 ‘两个设备’ 上 - 第2部分 +================================================================================ +RAID 是廉价磁盘的冗余阵列,其高可用性和可靠性适用于大规模环境中,为了使数据被保护而不是被正常使用。RAID 只是磁盘的一个集合被称为逻辑卷。结合驱动器,使其成为一个阵列或称为集合(组)。 + +创建 RAID 最少应使用2个磁盘被连接组成 RAID 控制器,逻辑卷或多个驱动器可以根据定义的 RAID 级别添加在一个阵列中。不使用物理硬件创建的 RAID 被称为软件 RAID。软件 RAID 一般都是不太有钱的人才使用的。 + +![Setup RAID0 in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Raid0-in-Linux.jpg) + +在 Linux 中创建 RAID0 + +使用 RAID 的主要目的是为了在单点故障时保存数据,如果我们使用单个磁盘来存储数据,如果它损坏了,那么就没有机会取回我们的数据了,为了防止数据丢失我们需要一个容错的方法。所以,我们可以使用多个磁盘组成 RAID 阵列。 + +#### 在 RAID 0 中条带是什么 #### + +条带是通过将数据在同一时间分割到多个磁盘上。假设我们有两个磁盘,如果我们将数据保存到逻辑卷上,它会将数据保存在两个磁盘上。使用 RAID 0 是为了获得更好的性能,但是如果驱动器中一个出现故障,我们将不能得到完整的数据。因此,使用 RAID 0 不是一种好的做法。唯一的解决办法就是安装有 RAID0 逻辑卷的操作系统来提高文件的安全性。 + +- RAID 0 性能较高。 +- 在 RAID 0 上,空间零浪费。 +- 零容错(如果硬盘中的任何一个发生故障,无法取回数据)。 +- 写和读性能得以提高。 + +#### 要求 #### + +创建 RAID 0 允许的最小磁盘数目是2个,但你可以添加更多的磁盘,但数目应该是2,4,6,8等的两倍。如果你有一个物理 RAID 卡并且有足够的端口,你可以添加更多磁盘。 + +在这里,我们没有使用硬件 RAID,此设置只依赖于软件 RAID。如果我们有一个物理硬件 RAID 卡,我们可以从它的 UI 组件访问它。有些主板默认内建 RAID 功能,还可以使用 Ctrl + I 键访问 UI。 + +如果你是刚开始设置 RAID,请阅读我们前面的文章,我们已经介绍了一些关于 RAID 基本的概念。 + +- [Introduction to RAID and RAID Concepts][1] + +**我的服务器设置** + + Operating System : CentOS 6.5 Final + IP Address : 192.168.0.225 + Two Disks : 20 GB each + +这篇文章是9个 RAID 系列教程的第2部分,在这部分,我们将看看如何能够在 Linux 上创建和使用 RAID0(条带化),以名为 sdb 和 sdc 两个20GB的硬盘为例。 + +### 第1步:更新系统和安装管理 RAID 的 mdadm 软件 ### + +1.在 Linux 上设置 RAID0 前,我们先更新一下系统,然后安装 ‘mdadm’ 包。mdadm 是一个小程序,这将使我们能够在Linux下配置和管理 RAID 设备。 + + # yum clean all && yum update + # yum install mdadm -y + +![install mdadm in linux](http://www.tecmint.com/wp-content/uploads/2014/10/install-mdadm-in-linux.png) + +安装 mdadm 工具 + +### 第2步:检测并连接两个 20GB 的硬盘 ### + +2.在创建 RAID 0 前,请务必确认两个硬盘能被检测到,使用下面的命令确认。 + + # ls -l /dev | grep sd + +![Check Hard Drives in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Check-Hard-Drives.png) + +检查硬盘 + +3.一旦检测到新的硬盘驱动器,同时检查是否连接的驱动器已经被现有的 RAID 使用,使用下面的 ‘mdadm’ 命令来查看。 + + # mdadm --examine /dev/sd[b-c] + +![Check RAID Devices in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Check-Drives-using-RAID.png) + +检查 RAID 设备 + +从上面的输出我们可以看到,没有任何 RAID 使用 sdb 和 sdc 这两个驱动器。 + +### 第3步:创建 RAID 分区 ### + +4.现在用 sdb 和 sdc 创建 RAID 的分区,使用 fdisk 命令来创建。在这里,我将展示如何创建 sdb 驱动器上的分区。 + + # fdisk /dev/sdb + +请按照以下说明创建分区。 + +- 按 ‘n’ 创建新的分区。 +- 然后按 ‘P’ 选择主分区。 +- 接下来选择分区号为1。 +- 只需按两次回车键选择默认值即可。 +- 然后,按 ‘P’ 来打印创建好的分区。 + +![Create Partitions in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Create-Partitions-in-Linux.png) + +创建分区 + +请按照以下说明将分区创建为 Linux 的 RAID 类型。 + +- 按 ‘L’,列出所有可用的类型。 +- 按 ‘t’ 去修改分区。 +- 键入 ‘fd’ 设置为Linux 的 RAID 类型,然后按 Enter 确认。 +- 然后再次使用‘p’查看我们所做的更改。 +- 使用‘w’保存更改。 + +![Create RAID Partitions](http://www.tecmint.com/wp-content/uploads/2014/10/Create-RAID-Partitions.png) + +在 Linux 上创建 RAID 分区 + +**注**: 请使用上述步骤同样在 sdc 驱动器上创建分区。 + +5.创建分区后,验证这两个驱动器能使用下面的命令来正确定义 RAID。 + + # mdadm --examine /dev/sd[b-c] + # mdadm --examine /dev/sd[b-c]1 + +![Verify RAID Partitions](http://www.tecmint.com/wp-content/uploads/2014/10/Verify-RAID-Partitions.png) + +验证 RAID 分区 + +### 第4步:创建 RAID md 设备 ### + +6.现在使用以下命令创建 md 设备(即 /dev/md0),并选择 RAID 合适的级别。 + + # mdadm -C /dev/md0 -l raid0 -n 2 /dev/sd[b-c]1 + # mdadm --create /dev/md0 --level=stripe --raid-devices=2 /dev/sd[b-c]1 + +- -C – create +- -l – level +- -n – No of raid-devices + +7.一旦 md 设备已经建立,使用如下命令可以查看 RAID 级别,设备和阵列的使用状态。 + + # cat /proc/mdstat + +![Verify RAID Level](http://www.tecmint.com/wp-content/uploads/2014/10/Verify-RAID-Level.png) + +查看 RAID 级别 + + # mdadm -E /dev/sd[b-c]1 + +![Verify RAID Device](http://www.tecmint.com/wp-content/uploads/2014/10/Verify-RAID-Device.png) + +查看 RAID 设备 + + # mdadm --detail /dev/md0 + +![Verify RAID Array](http://www.tecmint.com/wp-content/uploads/2014/10/Verify-RAID-Array.png) + +查看 RAID 阵列 + +### 第5步:挂载 RAID 设备到文件系统 ### + +8.将 RAID 设备 /dev/md0 创建为 ext4 文件系统并挂载到 /mnt/raid0 下。 + + # mkfs.ext4 /dev/md0 + +![Create ext4 Filesystem in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Create-ext4-Filesystem.png) + +创建 ext4 文件系统 + +9. ext4 文件系统为 RAID 设备创建好后,现在创建一个挂载点(即 /mnt/raid0),并将设备 /dev/md0 挂载在它下。 + + # mkdir /mnt/raid0 + # mount /dev/md0 /mnt/raid0/ + +10.下一步,使用 df 命令验证设备 /dev/md0 是否被挂载在 /mnt/raid0 下。 + + # df -h + +11.接下来,创建一个名为 ‘tecmint.txt’ 的文件挂载到 /mnt/raid0 下,为创建的文件添加一些内容,并查看文件和目录的内容。 + + # touch /mnt/raid0/tecmint.txt + # echo "Hi everyone how you doing ?" > /mnt/raid0/tecmint.txt + # cat /mnt/raid0/tecmint.txt + # ls -l /mnt/raid0/ + +![Verify Mount Device](http://www.tecmint.com/wp-content/uploads/2014/10/Verify-Mount-Device.png) + +验证挂载的设备 + +12.一旦你验证挂载点后,同时将它添加到 /etc/fstab 文件中。 + + # vim /etc/fstab + +添加以下条目,根据你的安装位置和使用文件系统的不同,自行做修改。 + + /dev/md0 /mnt/raid0 ext4 deaults 0 0 + +![Add Device to Fstab](http://www.tecmint.com/wp-content/uploads/2014/10/Add-Device-to-Fstab.png) + +添加设备到 fstab 文件中 + +13.使用 mount ‘-a‘ 来检查 fstab 的条目是否有误。 + + # mount -av + +![Check Errors in Fstab](http://www.tecmint.com/wp-content/uploads/2014/10/Check-Errors-in-Fstab.png) + +检查 fstab 文件是否有误 + +### 第6步:保存 RAID 配置 ### + +14.最后,保存 RAID 配置到一个文件中,以供将来使用。同样,我们使用 ‘mdadm’ 命令带有 ‘-s‘ (scan) 和 ‘-v‘ (verbose) 选项,如图所示。 + + # mdadm -E -s -v >> /etc/mdadm.conf + # mdadm --detail --scan --verbose >> /etc/mdadm.conf + # cat /etc/mdadm.conf + +![Save RAID Configurations](http://www.tecmint.com/wp-content/uploads/2014/10/Save-RAID-Configurations.png) + +保存 RAID 配置 + +就这样,我们在这里看到,如何通过使用两个硬盘配置具有条带化的 RAID0 级别。在接下来的文章中,我们将看到如何设置 RAID5。 + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/create-raid0-in-linux/ + +作者:[Babin Lonston][a] +译者:[strugglingyouth](https://github.com/strugglingyouth) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/babinlonston/ +[1]:http://www.tecmint.com/understanding-raid-setup-in-linux/ From 6a03d892dc65eba50a5390d41dc88241690b109b Mon Sep 17 00:00:00 2001 From: XLCYun Date: Sun, 2 Aug 2015 19:39:53 +0800 Subject: [PATCH 767/965] Delete 20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 1 - Introduction.md --- ...t Right & Wrong - Page 1 - Introduction.md | 55 ------------------- 1 file changed, 55 deletions(-) delete mode 100644 sources/tech/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 1 - Introduction.md diff --git a/sources/tech/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 1 - Introduction.md b/sources/tech/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 1 - Introduction.md deleted file mode 100644 index 43735170c3..0000000000 --- a/sources/tech/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 1 - Introduction.md +++ /dev/null @@ -1,55 +0,0 @@ -Translating by XLCYun. -A Week With GNOME As My Linux Desktop: What They Get Right & Wrong - Page 1 - Introduction -================================================================================ -*Author's Note: If by some miracle you managed to click this article without reading the title then I want to re-iterate something... This is an editorial. These are my opinions. They are not representative of Phoronix, or Michael, these are my own thoughts.* - -Additionally, yes... This is quite possibly a flame-bait article. I hope the community is better than that, because I do want to start a discussion and give feedback to both the KDE and Gnome communities. For that reason when I point out, what I see as, a flaw I will try to be specific and direct so that any discussion can be equally specific and direct. For the record: The alternative title for this article was "Death By A Thousand [Paper Cuts][1]". - -Now, with that out of the way... Onto the article. - -![](http://www.phoronix.net/image.php?id=fedora-22-fan&image=fedora_22_good1_show&w=1920) - -When I sent the [Fedora 22 KDE Review][2] off to Michael I did it with a bit of a bad taste in my mouth. It wasn't because I didn't like KDE, or hadn't been enjoying Fedora, far from it. In fact, I started to transition my T450s over to Arch Linux but quickly decided against that, as I enjoyed the level of convenience that Fedora brings to me for many things. - -The reason I had a bad taste in my mouth was because the Fedora developers put a lot of time and effort into their "Workstation" product and I wasn't seeing any of it. I wasn't using Fedora the way the main developers had intended it to be used and therefore wasn't getting the "Fedora Experience." It felt like someone reviewing Ubuntu by using Kubuntu, using a Hackintosh to review OS X, or reviewing Gentoo by using Sabayon. A lot of readers in the forums bash on Michael for reviewing distributions in their default configurations-- myself included. While I still do believe that reviews should be done under 'real-world' configurations, I do see the value in reviewing something in the condition it was given to you-- for better or worse. - -It was with that attitude in mind that I decided to take a dip in the Gnome pool. - -I do, however, need to add one more disclaimer... I am looking at KDE and Gnome as they are packaged in Fedora. OpenSUSE, Kubuntu, Arch, etc, might all have different implementations of each desktop that will change whether my specific 'pain points' are relevant to your distribution. Furthermore, despite the title, this is going to be a VERY KDE heavy article. I called the article what I did because it was actually USING Gnome that made me realize how many "paper cuts" KDE actually has. - -### Login Screen ### - -![](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_login1_show&w=1920) - -I normally don't mind Distributions shipping distro-specific themes, because most of them make the desktop look nicer. I finally found my exception. - -First impression's count for a lot, right? Well, GDM definitely gets this one right. The login screen is incredibly clean with consistent design language through every single part of it. The use of common-language icons instead of text boxes helps in that regard. - -![](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_login2_show&w=1920) - -That is not to say that the Fedora 22 KDE login screen-- now SDDM rather than KDM-- looks 'bad' per say but its definitely more jarring. - -Where's the fault? The top bar. Look at the Gnome screenshot-- you select a user and you get a tiny little gear simple for selecting what session you want to log into. The design is clean, it gets out of your way, you could honestly miss it completely if you weren't paying attention. Now look at the blue KDE screenshot, the bar doesn't look it was even rendered using the same widgets, and its entire placement feels like an after thought of "Well shit, we need to throw this option somewhere..." - -The same can be said for the Reboot and Shutdown options in the top right. Why not just a power button that creates a drop down menu that has a drop down for Reboot, Shutdown, Suspend? Having the buttons be different colors than the background certainly makes them stick out and be noticeable... but I don't think in a good way. Again, they feel like an after thought. - -GDM is also far more useful from a practical standpoint, look again along the top row. The time is listed, there's a volume control so that if you are trying to be quiet you can mute all sounds before you even login, there's an accessibility button for things like high contrast, zooming, test to speech, etc, all available via simple toggle buttons. - -![](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_login3_show&w=1920) - -Swap it to upstream's Breeze theme and... suddenly most of my complaints are fixed. Common-language icons, everything is in the center of the screen, but the less important stuff is off to the sides. This creates a nice harmony between the top and bottom of the screen since they are equally empty. You still have a text box for the session switcher, but I can forgive that since the power buttons are now common language icons. Current time is available which is a nice touch, as is a battery life indicator. Sure gnome still has a few nice additions, such as the volume applet and the accessibility buttons, but Breeze is a step up from Fedora's KDE theme. - -Go to Windows (pre-Windows 8 & 10...) or OS X and you will see similar things – very clean, get-out-of-your-way lock screens and login screens that are devoid of text boxes or other widgets that distract the eye. It's a design that works and that is non-distracting. Fedora... Ship Breeze by default. VDG got the design of the Breeze theme right. Don't mess it up. - --------------------------------------------------------------------------------- - -via: http://www.phoronix.com/scan.php?page=article&item=gnome-week-editorial&num=1 - -作者:Eric Griffith -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[1]:https://wiki.ubuntu.com/One%20Hundred%20Papercuts -[2]:http://www.phoronix.com/scan.php?page=article&item=fedora-22-kde&num=1 From b2d7ab2ba05d746334150505746e8c43bbe4f3a8 Mon Sep 17 00:00:00 2001 From: XLCYun Date: Sun, 2 Aug 2015 19:40:51 +0800 Subject: [PATCH 768/965] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit XLCYun 翻译完成 --- ...t Right & Wrong - Page 1 - Introduction.md | 55 +++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 translated/tech/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 1 - Introduction.md diff --git a/translated/tech/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 1 - Introduction.md b/translated/tech/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 1 - Introduction.md new file mode 100644 index 0000000000..de47f0864e --- /dev/null +++ b/translated/tech/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 1 - Introduction.md @@ -0,0 +1,55 @@ +将GNOME作为我的Linux桌面的一周: 他们做对的与做错的 - 第一节 - 简介 +================================================================================ +*作者声明: 如果你是因为某种神迹而在没看标题的情况下点开了这篇文章,那么我想再重申一些东西...这是一篇评论文章。文中的观点都是我自己的,不代表Phoronix和Michael的观点。它们完全是我自己的想法。 + +另外,没错……这可能是一篇引战的文章。我希望社团成员们更沉稳一些,因为我确实想在KDE和Gnome的社团上发起讨论,反馈。因此当我想指出——我所看到的——一个瑕疵时,我会尽量地做到具体而直接。这样,相关的讨论也能做到同样的具体和直接。再次声明:本文另一可选标题为“被[剪纸][1]千刀万剐”(原文剪纸一词为papercuts, 指易修复而烦人的漏洞,译者注)。 + +现在,重申完毕……文章开始。 + +![](http://www.phoronix.net/image.php?id=fedora-22-fan&image=fedora_22_good1_show&w=1920) + +当我把[《评价Fedora 22 KDE》][2]一文发给Michael时,感觉很不是滋味。不是因为我不喜欢KDE,或者不享受Fedora,远非如此。事实上,我刚开始想把我的T450s的系统换为Arch Linux时,马上又决定放弃了,因为我很享受fedora在很多方面所带来的便捷性。 + +我感觉很不是滋味的原因是Fedora的开发者花费了大量的时间和精力在他们的“工作站”产品上,但是我却一点也没看到。在使用Fedora时,我采用的并非那些主要开发者希望用户采用的那种使用方式,因此我也就体验不到所谓的“Fedora体验”。它感觉就像一个人评价Ubuntu时用的却是Kubuntu,评价OS X时用的却是Hackintosh,或者评价Gentoo时用的却是Sabayon。根据大量Michael论坛的读者的说法,它们在评价各种发行版时使用的都是默认设置的发行版——我也不例外。但是我还是认为这些评价应该在“真实”配置下完成,当然我也知道在给定的情况下评论某些东西也的确是有价值的——无论是好是坏。 + +正是在怀着这种态度的情况下,我决定到Gnome这个水坑里来泡泡澡。 + +但是,我还要在此多加一个声明……我在这里所看到的KDE和Gnome都是打包在Fedora中的。OpenSUSE, Kubuntu, Arch等发行版的各个桌面可能有不同的实现方法,使得我这里所说的具体的“痛处”跟你所用的发行版有所不同。还有,虽然用了这个标题,但这篇文章将会是一篇很沉重的非常“KDE”的文章。之所以这样称呼这篇文章,是因为我在使用了Gnome之后,才知道KDE的“剪纸”到底有多多。 + +### 登录界面 ### + +![](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_login1_show&w=1920) + +我一般情况下都不会介意发行版装载它们自己的特别主题,因为一般情况下桌面看起来会更好看。可我今天可算是找到了一个例外。 + +第一印象很重要,对吧?那么,GDM(Gnome Display Manage:Gnome显示管理器,译者注,下同。)决对干得漂亮。它的登录界面看起来极度简洁,每一部分都应用了一致的设计风格。使用通用图标而不是输入框为它的简洁加了分。 + +![](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_login2_show&w=1920) + +这并不是说Fedora 22 KDE——现在已经是SDDM而不是KDM了——的登录界面不好看,但是看起来决对没有它这样和谐。 + +问题到底出来在哪?顶部栏。看看Gnome的截图——你选择一个用户,然后用一个很小的齿轮简单地选择想登入哪个会话。设计很简洁,它不挡着你的道儿,实话讲,如果你没注意的话可能完全会看不到它。现在看看那蓝色( blue,有忧郁之意,一语双关,译者注)的KDE截图,顶部栏看起来甚至不像是用同一个工具渲染出来的,它的整个位置的安排好像是某人想着:“哎哟妈呀,我们需要把这个选项扔在哪个地方……”之后决定下来的。 + +对于右上角的重启和关机选项也一样。为什么不单单用一个电源按钮,点击后会下拉出一个菜单,里面包括重启,关机,挂起的功能?按钮的颜色跟背景色不同肯定会让它更加突兀和显眼……但我可不觉得这样子有多好。同样,这看起来可真像“苦思”后的决定。 + +从实用观点来看,GDM还要远远实用的多,再看看顶部一栏。时间被列了出来,还有一个音量控制按钮,如果你想保持周围安静,你甚至可以在登录前设置静音,还有一个可用的按钮来实现高对比度,缩放,语音转文字等功能,所有可用的功能通过简单的一个开关按钮就能得到。 + +![](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_login3_show&w=1920) + +切换到上流的Breeve主题……突然间,我抱怨的大部分问题都被完善了。通用图标,所有东西都放在了屏幕中央,但不是那么重要的被放到了一边。因为屏幕顶部和底部都是同样的空白,在中间也就酝酿出了一种美好的和谐。还是有一个输入框来切换会话,但既然电源按钮被做成了通用图标,那么这点还算可以原谅。当然gnome还是有一些很好的附加物,例如音量小程序和可访问按钮,但Breeze总归是Fedora的KDE主题的一个进步。 + +到Windows(Windows 8和10之前)或者OS X中去,你会看到类似的东西——非常简洁的,“不挡你道”的锁屏与登录界面,它们都没有输入框或者其它分散视觉的小工具。这是一种有效的不分散人注意力的设计。Fedora……默认装有Breeze。VDG在Breeze主题设计上干得不错。可别糟蹋了它。 + +-------------------------------------------------------------------------------- + +via: http://www.phoronix.com/scan.php?page=article&item=gnome-week-editorial&num=1 + +作者:Eric Griffith +译者:[XLCYun](https://github.com/XLCYun) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[1]:https://wiki.ubuntu.com/One%20Hundred%20Papercuts +[2]:http://www.phoronix.com/scan.php?page=article&item=fedora-22-kde&num=1 +[3]:https://launchpad.net/hundredpapercuts From 5426b4cc3c2b5f0acb6550d8a6ae1cb0686537dc Mon Sep 17 00:00:00 2001 From: martin qi Date: Sun, 2 Aug 2015 21:04:30 +0800 Subject: [PATCH 769/965] Delete 20150225 How to set up IPv6 BGP peering and filtering in Quagga BGP router.md --- ...ring and filtering in Quagga BGP router.md | 260 ------------------ 1 file changed, 260 deletions(-) delete mode 100644 sources/tech/20150225 How to set up IPv6 BGP peering and filtering in Quagga BGP router.md diff --git a/sources/tech/20150225 How to set up IPv6 BGP peering and filtering in Quagga BGP router.md b/sources/tech/20150225 How to set up IPv6 BGP peering and filtering in Quagga BGP router.md deleted file mode 100644 index 033e03be35..0000000000 --- a/sources/tech/20150225 How to set up IPv6 BGP peering and filtering in Quagga BGP router.md +++ /dev/null @@ -1,260 +0,0 @@ -translating... - -How to set up IPv6 BGP peering and filtering in Quagga BGP router -================================================================================ -In the previous tutorials, we demonstrated how we can set up a [full-fledged BGP router][1] and configure [prefix filtering][2] with Quagga. In this tutorial, we are going to show you how we can set up IPv6 BGP peering and advertise IPv6 prefixes through BGP. We will also demonstrate how we can filter IPv6 prefixes advertised or received by using prefix-list and route-map features. - -### Topology ### - -For this tutorial, we will be considering the following topology. - -![](https://farm9.staticflickr.com/8599/15944659374_1c65852df2_c.jpg) - -Service providers A and B want to establish an IPv6 BGP peering between them. Their IPv6 and AS information is as follows. - -- Peering IP block: 2001:DB8:3::/64 -- Service provider A: AS 100, 2001:DB8:1::/48 -- Service provider B: AS 200, 2001:DB8:2::/48 - -### Installing Quagga on CentOS/RHEL ### - -If Quagga has not already been installed, we can install it using yum. - - # yum install quagga - -On CentOS/RHEL 7, the default SELinux policy, which prevents /usr/sbin/zebra from writing to its configuration directory, can interfere with the setup procedure we are going to describe. Thus we want to disable this policy as follows. Skip this step if you are using CentOS/RHEL 6. - - # setsebool -P zebra_write_config 1 - -### Creating Configuration Files ### - -After installation, we start the configuration process by creating the zebra/bgpd configuration files. - - # cp /usr/share/doc/quagga-XXXXX/zebra.conf.sample /etc/quagga/zebra.conf - # cp /usr/share/doc/quagga-XXXXX/bgpd.conf.sample /etc/quagga/bgpd.conf - -Next, enable auto-start of these services. - -**On CentOS/RHEL 6:** - - # service zebra start; service bgpd start - # chkconfig zebra on; chkconfig bgpd on - -**On CentOS/RHEL 7:** - - # systemctl start zebra; systemctl start bgpd - # systemctl enable zebra; systmectl enable bgpd - -Quagga provides a built-in shell called vtysh, whose interface is similar to those of major router vendors such as Cisco or Juniper. Launch vtysh command shell: - - # vtysh - -The prompt will be changed to: - - router-a# - -or - - router-b# - -In the rest of the tutorials, these prompts indicate that you are inside vtysh shell of either router. - -### Specifying Log File for Zebra ### - -Let's configure the log file for Zebra, which will be helpful for debugging. - -First, enter the global configuration mode by typing: - - router-a# configure terminal - -The prompt will be changed to: - - router-a(config)# - -Now specify log file location. Then exit the configuration mode: - - router-a(config)# log file /var/log/quagga/quagga.log - router-a(config)# exit - -Save configuration permanently by: - - router-a# write - -### Configuring Interface IP Addresses ### - -Let's now configure the IP addresses for Quagga's physical interfaces. - -First, we check the available interfaces from inside vtysh. - - router-a# show interfaces - ----------- - - Interface eth0 is up, line protocol detection is disabled - ## OUTPUT TRUNCATED ### - Interface eth1 is up, line protocol detection is disabled - ## OUTPUT TRUNCATED ## - -Now we assign necessary IPv6 addresses. - - router-a# conf terminal - router-a(config)# interface eth0 - router-a(config-if)# ipv6 address 2001:db8:3::1/64 - router-a(config-if)# interface eth1 - router-a(config-if)# ipv6 address 2001:db8:1::1/64 - -We use the same method to assign IPv6 addresses to router-B. I am summarizing the configuration below. - - router-b# show running-config - ----------- - - interface eth0 - ipv6 address 2001:db8:3::2/64 - - interface eth1 - ipv6 address 2001:db8:2::1/64 - -Since the eth0 interface of both routers are in the same subnet, i.e., 2001:DB8:3::/64, you should be able to ping from one router to another. Make sure that you can ping successfully before moving on to the next step. - - router-a# ping ipv6 2001:db8:3::2 - ----------- - - PING 2001:db8:3::2(2001:db8:3::2) 56 data bytes - 64 bytes from 2001:db8:3::2: icmp_seq=1 ttl=64 time=3.20 ms - 64 bytes from 2001:db8:3::2: icmp_seq=2 ttl=64 time=1.05 ms - -### Phase 1: IPv6 BGP Peering ### - -In this section, we will configure IPv6 BGP between the two routers. We start by specifying BGP neighbors in router-A. - - router-a# conf t - router-a(config)# router bgp 100 - router-a(config-router)# no auto-summary - router-a(config-router)# no synchronization - router-a(config-router)# neighbor 2001:DB8:3::2 remote-as 200 - -Next, we define the address family for IPv6. Within the address family section, we will define the network to be advertised, and activate the neighbors as well. - - router-a(config-router)# address-family ipv6 - router-a(config-router-af)# network 2001:DB8:1::/48 - router-a(config-router-af)# neighbor 2001:DB8:3::2 activate - -We will go through the same configuration for router-B. I'm providing the summary of the configuration. - - router-b# conf t - router-b(config)# router bgp 200 - router-b(config-router)# no auto-summary - router-b(config-router)# no synchronization - router-b(config-router)# neighbor 2001:DB8:3::1 remote-as 100 - router-b(config-router)# address-family ipv6 - router-b(config-router-af)# network 2001:DB8:2::/48 - router-b(config-router-af)# neighbor 2001:DB8:3::1 activate - -If all goes well, an IPv6 BGP session should be up between the two routers. If not already done, please make sure that necessary ports (TCP 179) are [open in your firewall][3]. - -We can check IPv6 BGP session information using the following commands. - -**For BGP summary:** - - router-a# show bgp ipv6 unicast summary - -**For BGP advertised routes:** - - router-a# show bgp ipv6 neighbors advertised-routes - -**For BGP received routes:** - - router-a# show bgp ipv6 neighbors routes - -![](https://farm8.staticflickr.com/7317/16379555088_6e29cb6884_b.jpg) - -### Phase 2: Filtering IPv6 Prefixes ### - -As we can see from the above output, the routers are advertising their full /48 IPv6 prefix. For demonstration purposes, we will consider the following requirements. - -- Router-B will advertise one /64 prefix, one /56 prefix, as well as one full /48 prefix. -- Router-A will accept any IPv6 prefix owned by service provider B, which has a netmask length between /56 and /64. - -We are going to filter the prefix as required, using prefix-list and route-map in router-A. - -![](https://farm8.staticflickr.com/7367/16381297417_6549218289_c.jpg) - -#### Modifying prefix advertisement for Router-B #### - -Currently, router-B is advertising only one /48 prefix. We will modify router-B's BGP configuration so that it advertises additional /56 and /64 prefixes as well. - - router-b# conf t - router-b(config)# router bgp 200 - router-b(config-router)# address-family ipv6 - router-b(config-router-af)# network 2001:DB8:2::/56 - router-b(config-router-af)# network 2001:DB8:2::/64 - -We will verify that all prefixes are received at router-A. - -![](https://farm9.staticflickr.com/8598/16379761980_7c083ae977_b.jpg) - -Great! As we are receiving all prefixes in router-A, we will move forward and create prefix-list and route-map entries to filter these prefixes. - -#### Creating Prefix-List #### - -As described in the [previous tutorial][4], prefix-list is a mechanism that is used to match an IP address prefix with a subnet length. Once a matched prefix is found, we can apply filtering or other actions to the matched prefix. To meet our requirements, we will go ahead and create a necessary prefix-list entry in router-A. - - router-a# conf t - router-a(config)# ipv6 prefix-list FILTER-IPV6-PRFX permit 2001:DB8:2::/56 le 64 - -The above commands will create a prefix-list entry named 'FILTER-IPV6-PRFX' which will match any prefix in the 2001:DB8:2:: pool with a netmask between 56 and 64. - -#### Creating and Applying Route-Map #### - -Now that the prefix-list entry is created, we will create a corresponding route-map rule which uses the prefix-list entry. - - router-a# conf t - router-a(config)# route-map FILTER-IPV6-RMAP permit 10 - router-a(config-route-map)# match ipv6 address prefix-list FILTER-IPV6-PRFX - -The above commands will create a route-map rule named 'FILTER-IPV6-RMAP'. This rule will permit IPv6 addresses matched by the prefix-list 'FILTER-IPV6-PRFX' that we have created earlier. - -Remember that a route-map rule is only effective when it is applied to a neighbor or an interface in a certain direction. We will apply the route-map in the BGP neighbor configuration. As the filter is meant for inbound prefixes, we apply the route-map in the inbound direction. - - router-a# conf t - router-a(config)# router bgp 100 - router-a(config-router)# address-family ipv6 - router-a(config-router-af)# neighbor 2001:DB8:3::2 route-map FILTER-IPV6-RMAP in - -Now when we check the routes received at router-A, we should see only two prefixes that are allowed. - -![](https://farm8.staticflickr.com/7337/16379762020_ec2dc39b31_c.jpg) - -**Note**: You may need to reset the BGP session for the route-map to take effect. - -All IPv6 BGP sessions can be restarted using the following command: - - router-a# clear bgp ipv6 * - -I am summarizing the configuration of both routers so you get a clear picture at a glance. - -![](https://farm9.staticflickr.com/8672/16567240165_eee4398dc8_c.jpg) - -### Summary ### - -To sum up, this tutorial focused on how to set up BGP peering and filtering using IPv6. We showed how to advertise IPv6 prefixes to a neighboring BGP router, and how to filter the prefixes advertised or received are advertised. Note that the process described in this tutorial may affect production networks of a service provider, so please use caution. - -Hope this helps. - --------------------------------------------------------------------------------- - -via: http://xmodulo.com/ipv6-bgp-peering-filtering-quagga-bgp-router.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/centos-bgp-router-quagga.html -[2]:http://xmodulo.com/filter-bgp-routes-quagga-bgp-router.html -[3]:http://ask.xmodulo.com/open-port-firewall-centos-rhel.html -[4]:http://xmodulo.com/filter-bgp-routes-quagga-bgp-router.html From 28454501d7beafe8c0a622740e71ce7b160df929 Mon Sep 17 00:00:00 2001 From: martin qi Date: Sun, 2 Aug 2015 21:05:08 +0800 Subject: [PATCH 770/965] Create 20150225 How to set up IPv6 BGP peering and filtering in Quagga BGP router.md --- ...ring and filtering in Quagga BGP router.md | 258 ++++++++++++++++++ 1 file changed, 258 insertions(+) create mode 100644 translated/tech/20150225 How to set up IPv6 BGP peering and filtering in Quagga BGP router.md diff --git a/translated/tech/20150225 How to set up IPv6 BGP peering and filtering in Quagga BGP router.md b/translated/tech/20150225 How to set up IPv6 BGP peering and filtering in Quagga BGP router.md new file mode 100644 index 0000000000..23e2314576 --- /dev/null +++ b/translated/tech/20150225 How to set up IPv6 BGP peering and filtering in Quagga BGP router.md @@ -0,0 +1,258 @@ +如何设置在Quagga BGP路由器中设置IPv6的BGP对等体和过滤 +================================================================================ +在之前的教程中,我们演示了如何使用Quagga建立一个[完备的BGP路由器][1]和配置[前缀过滤][2]。在本教程中,我们会向你演示如何创建IPv6 BGP对等体并通过BGP通告IPv6前缀。同时我们也将演示如何使用前缀列表和路由映射特性来过滤通告的或者获取到的IPv6前缀。 + +### 拓扑 ### + +教程中,我们主要参考如下拓扑。 + +![](https://farm9.staticflickr.com/8599/15944659374_1c65852df2_c.jpg) + +服务供应商A和B希望在他们之间建立一个IPv6的BGP对等体。他们的IPv6地址和AS信息如下所示。 + +- 对等体IP块: 2001:DB8:3::/64 +- 供应商A: AS 100, 2001:DB8:1::/48 +- 供应商B: AS 200, 2001:DB8:2::/48 + +### CentOS/RHEL安装Quagga ### + +如果Quagga还没有安装,我们可以先使用yum安装。 + + # yum install quagga + +在CentOS/RHEL 7,SELinux策略会默认的阻止对于/usr/sbin/zebra配置目录的写操作,这会对我们将要介绍的安装操作有所影响。因此我们需要像下面这样关闭这个策略。如果你使用的是CentOS/RHEL 6可以跳过这一步。 + + # setsebool -P zebra_write_config 1 + +### 创建配置文件 ### + +在安装过后,我们先创建配置文件zebra/bgpd作为配置流程的开始。 + + # cp /usr/share/doc/quagga-XXXXX/zebra.conf.sample /etc/quagga/zebra.conf + # cp /usr/share/doc/quagga-XXXXX/bgpd.conf.sample /etc/quagga/bgpd.conf + +然后,允许这些服务开机自启。 + +**在 CentOS/RHEL 6:** + + # service zebra start; service bgpd start + # chkconfig zebra on; chkconfig bgpd on + +**在 CentOS/RHEL 7:** + + # systemctl start zebra; systemctl start bgpd + # systemctl enable zebra; systmectl enable bgpd + +Quagga内部提供一个叫作vtysh的shell,其界面与那些主流路由厂商Cisco或Juniper十分相似。启动vtysh shell命令行: + + # vtysh + +提示将改为: + + router-a# + +或 + + router-b# + +在教程的其余部分,这个提示可以表明你正身处在哪个路由的vtysh shell中。 + +### 为Zebra指定日志文件 ### + +来为Zebra配置日志文件,这会有助于调试。 + +首先,进入全局配置模式通过输入: + + router-a# configure terminal + +提示将变更成: + + router-a(config)# + +指定日志文件的位置。然后退出配置模式: + + router-a(config)# log file /var/log/quagga/quagga.log + router-a(config)# exit + +保存配置通过: + + router-a# write + +### 配置接口IP地址 ### + +现在,让我们为Quagga的物理接口配置IP地址。 + +首先,查看一下vtysh中现有的接口。 + + router-a# show interfaces + +---------- + + Interface eth0 is up, line protocol detection is disabled + ## OUTPUT TRUNCATED ### + Interface eth1 is up, line protocol detection is disabled + ## OUTPUT TRUNCATED ## + +现在我们配置IPv6地址。 + + router-a# conf terminal + router-a(config)# interface eth0 + router-a(config-if)# ipv6 address 2001:db8:3::1/64 + router-a(config-if)# interface eth1 + router-a(config-if)# ipv6 address 2001:db8:1::1/64 + +在路由B上采用同样的方式分配IPv6地址。我将配置汇总成如下。 + + router-b# show running-config + +---------- + + interface eth0 + ipv6 address 2001:db8:3::2/64 + + interface eth1 + ipv6 address 2001:db8:2::1/64 + +由于两台路由的eth0端口同属一个子网,即2001:DB8:3::/64,你应该可以相互ping通。在保证ping通的情况下,我们开始下面的内容。 + + router-a# ping ipv6 2001:db8:3::2 + +---------- + + PING 2001:db8:3::2(2001:db8:3::2) 56 data bytes + 64 bytes from 2001:db8:3::2: icmp_seq=1 ttl=64 time=3.20 ms + 64 bytes from 2001:db8:3::2: icmp_seq=2 ttl=64 time=1.05 ms + +### 步骤 1: IPv6 BGP 对等体 ### + +本段,我们将在两个路由之间配置IPv6 BGP。首先,我们在路由A上指定BGP邻居。 + + router-a# conf t + router-a(config)# router bgp 100 + router-a(config-router)# no auto-summary + router-a(config-router)# no synchronization + router-a(config-router)# neighbor 2001:DB8:3::2 remote-as 200 + +然后,我们定义IPv6的地址族。在地址族中,我们需要定义要通告的网段,并激活邻居。 + + router-a(config-router)# address-family ipv6 + router-a(config-router-af)# network 2001:DB8:1::/48 + router-a(config-router-af)# neighbor 2001:DB8:3::2 activate + +我们在路由B上也实施相同的配置。这里提供我归总后的配置。 + + router-b# conf t + router-b(config)# router bgp 200 + router-b(config-router)# no auto-summary + router-b(config-router)# no synchronization + router-b(config-router)# neighbor 2001:DB8:3::1 remote-as 100 + router-b(config-router)# address-family ipv6 + router-b(config-router-af)# network 2001:DB8:2::/48 + router-b(config-router-af)# neighbor 2001:DB8:3::1 activate + +如果一切顺利,在路由间将会形成一个IPv6 BGP会话。如果失败了,请确保[在防火墙中开启了][3]必要的端口(TCP 179)。 + +我们使用以下命令来确认IPv6 BGP会话的信息。 + +**查看BGP汇总:** + + router-a# show bgp ipv6 unicast summary + +**查看BGP通告的路由:** + + router-a# show bgp ipv6 neighbors advertised-routes + +**查看BGP获得的路由:** + + router-a# show bgp ipv6 neighbors routes + +![](https://farm8.staticflickr.com/7317/16379555088_6e29cb6884_b.jpg) + +### 步骤 2: 过滤IPv6前缀 ### + +正如我们在上面看到的输出信息那样,路由间通告了他们完整的/48 IPv6前缀。出于演示的目的,我们会考虑以下要求。 + +- Router-B将通告一个/64前缀,一个/56前缀,和一个完整的/48前缀. +- Router-A将接受任由B提供的何形式的IPv6前缀,其中包含有/56和/64之间的网络掩码长度。 + +我们将根据需要过滤的前缀,来使用路由器的前缀列表和路由映射。 + +![](https://farm8.staticflickr.com/7367/16381297417_6549218289_c.jpg) + +#### 为路由B修改通告的前缀 #### + +目前,路由B只通告一个/48前缀。我们修改路由B的BGP配置使它可以通告额外的/56和/64前缀。 + + router-b# conf t + router-b(config)# router bgp 200 + router-b(config-router)# address-family ipv6 + router-b(config-router-af)# network 2001:DB8:2::/56 + router-b(config-router-af)# network 2001:DB8:2::/64 + +我们将路由A上验证了所有的前缀都获得到了。 + +![](https://farm9.staticflickr.com/8598/16379761980_7c083ae977_b.jpg) + +太好了!我们在路由A上收到了所有的前缀,那么我们可以更进一步创建前缀列表和路由映射来过滤这些前缀。 + +#### 创建前缀列表 #### + +就像在[上则教程中][4]描述的那样,前缀列表是一种机制用来匹配带有子网长度的IP地址前缀。按照我们指定的需求,我们需要在路由A的前缀列表中创建一则必要的条目。 + + router-a# conf t + router-a(config)# ipv6 prefix-list FILTER-IPV6-PRFX permit 2001:DB8:2::/56 le 64 + +以上的命令会创建一个名为'FILTER-IPV6-PRFX'的前缀列表,用以匹配任何2001:DB8:2::池内掩码在56和64之间的所有前缀。 + +#### 创建并应用路由映射 #### + +现在已经在前缀列表中创建了条目,我们也应该相应的创建一条使用此条目的路由映射规则了。 + + router-a# conf t + router-a(config)# route-map FILTER-IPV6-RMAP permit 10 + router-a(config-route-map)# match ipv6 address prefix-list FILTER-IPV6-PRFX + +以上的命令会创建一条名为'FILTER-IPV6-RMAP'的路由映射规则。这则规则将会允许与之前在前缀列表中创建'FILTER-IPV6-PRFX'所匹配的IPv6 + +要记住路由映射规则只有在应用在邻居或者端口的指定方向时才有效。我们将把路由映射应用到BGP的邻居配置中。我们将路由映射应用于入方向,作为进入路由端的前缀过滤器。 + + router-a# conf t + router-a(config)# router bgp 100 + router-a(config-router)# address-family ipv6 + router-a(config-router-af)# neighbor 2001:DB8:3::2 route-map FILTER-IPV6-RMAP in + +现在我们在路由A上再查看一边获得到的路由,我们应该只能看见两个被允许的前缀了。 + +![](https://farm8.staticflickr.com/7337/16379762020_ec2dc39b31_c.jpg) + +**注意**: 你可能需要重置BGP会话来刷新路由表。 + +所有IPv6的BGP会话可以使用以下的命令重启: + + router-a# clear bgp ipv6 * + +我汇总了两个路由的配置,并做成了一张清晰的图片以便阅读。 + +![](https://farm9.staticflickr.com/8672/16567240165_eee4398dc8_c.jpg) + +### 总结 ### + +总结一下,这篇教程重点在于如何创建BGP对等体和IPv6的过滤。我们演示了如何向邻居BGP路由通告IPv6前缀,和如何过滤通告前缀或获得的通告。需要注意,本教程使用的过程可能会对网络供应商的网络运作有所影响,请谨慎参考。 + +希望这些对你有用。 + +-------------------------------------------------------------------------------- + +via: http://xmodulo.com/ipv6-bgp-peering-filtering-quagga-bgp-router.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/centos-bgp-router-quagga.html +[2]:http://xmodulo.com/filter-bgp-routes-quagga-bgp-router.html +[3]:http://ask.xmodulo.com/open-port-firewall-centos-rhel.html +[4]:http://xmodulo.com/filter-bgp-routes-quagga-bgp-router.html From e01d81f5945506d1b0098cdc625a8ab565442e2e Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 2 Aug 2015 22:06:53 +0800 Subject: [PATCH 771/965] PUB:20150722 How To Manage StartUp Applications In Ubuntu @FSSlc --- ...22 How To Manage StartUp Applications In Ubuntu.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) rename {translated/tech => published}/20150722 How To Manage StartUp Applications In Ubuntu.md (92%) diff --git a/translated/tech/20150722 How To Manage StartUp Applications In Ubuntu.md b/published/20150722 How To Manage StartUp Applications In Ubuntu.md similarity index 92% rename from translated/tech/20150722 How To Manage StartUp Applications In Ubuntu.md rename to published/20150722 How To Manage StartUp Applications In Ubuntu.md index 745a84860a..3494e90a61 100644 --- a/translated/tech/20150722 How To Manage StartUp Applications In Ubuntu.md +++ b/published/20150722 How To Manage StartUp Applications In Ubuntu.md @@ -6,17 +6,17 @@ 每当你开机进入一个操作系统,一系列的应用将会自动启动。这些应用被称为‘开机启动应用’ 或‘开机启动程序’。随着时间的推移,当你在系统中安装了足够多的应用时,你将发现有太多的‘开机启动应用’在开机时自动地启动了,它们吃掉了很多的系统资源,并将你的系统拖慢。这可能会让你感觉卡顿,我想这种情况并不是你想要的。 -让 Ubuntu 变得更快的方法之一是对这些开机启动应用进行控制。 Ubuntu 为你提供了一个 GUI 工具来让你发现这些开机启动应用,然后完全禁止或延迟它们的启动,这样就可以不让每个应用在开机时同时运行。 +让 Ubuntu 变得更快的方法之一是对这些开机启动应用进行控制。 Ubuntu 为你提供了一个 GUI 工具来让你找到这些开机启动应用,然后完全禁止或延迟它们的启动,这样就可以不让每个应用在开机时同时运行。 在这篇文章中,我们将看到 **在 Ubuntu 中,如何控制开机启动应用,如何让一个应用在开机时启动以及如何发现隐藏的开机启动应用。**这里提供的指导对所有的 Ubuntu 版本均适用,例如 Ubuntu 12.04, Ubuntu 14.04 和 Ubuntu 15.04。 ### 在 Ubuntu 中管理开机启动应用 ### -默认情况下, Ubuntu 提供了一个`开机启动应用工具`来供你使用,你不必再进行安装。只需到 Unity 面板中就可以查找到该工具。 +默认情况下, Ubuntu 提供了一个`Startup Applications`工具来供你使用,你不必再进行安装。只需到 Unity 面板中就可以查找到该工具。 ![ubuntu 中的开机启动应用工具](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/startup_applications_Ubuntu.jpeg) -点击它来启动。下面是我的`开机启动应用`的样子: +点击它来启动。下面是我的`Startup Applications`的样子: ![在 Ubuntu 中查看开机启动程序](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/Screenshot-from-2015-07-18-122550.png) @@ -84,7 +84,7 @@ 就这样,你将在下一次开机时看到这个程序会自动运行。这就是在 Ubuntu 中你能做的关于开机启动应用的所有事情。 -到现在为止,我们已经讨论在开机时可见的应用,但仍有更多的服务,守护进程和程序并不在`开机启动应用工具`中可见。下一节中,我们将看到如何在 Ubuntu 中查看这些隐藏的开机启动程序。 +到现在为止,我们已经讨论在开机时可见到的应用,但仍有更多的服务,守护进程和程序并不在`开机启动应用工具`中可见。下一节中,我们将看到如何在 Ubuntu 中查看这些隐藏的开机启动程序。 ### 在 Ubuntu 中查看隐藏的开机启动程序 ### @@ -97,13 +97,14 @@ ![在 Ubuntu 中查看隐藏的开机启动程序](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/Hidden_startup_program_Ubuntu.jpg) 你可以像先前我们讨论的那样管理这些开机启动应用。我希望这篇教程可以帮助你在 Ubuntu 中控制开机启动程序。任何的问题或建议总是欢迎的。 + -------------------------------------------------------------------------------- via: http://itsfoss.com/manage-startup-applications-ubuntu/ 作者:[Abhishek][a] 译者:[FSSlc](https://github.com/FSSlc) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 7f1ac1f1041cd8f0db2d5bee74dbb9b1151a5ccf Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 2 Aug 2015 22:33:58 +0800 Subject: [PATCH 772/965] PUB:20150625 How to Provision Swarm Clusters using Docker Machine @DongShuaike --- ...ion Swarm Clusters using Docker Machine.md | 41 ++++++++++--------- 1 file changed, 21 insertions(+), 20 deletions(-) rename {translated/tech => published}/20150625 How to Provision Swarm Clusters using Docker Machine.md (54%) diff --git a/translated/tech/20150625 How to Provision Swarm Clusters using Docker Machine.md b/published/20150625 How to Provision Swarm Clusters using Docker Machine.md similarity index 54% rename from translated/tech/20150625 How to Provision Swarm Clusters using Docker Machine.md rename to published/20150625 How to Provision Swarm Clusters using Docker Machine.md index 940c68b55d..a36284e6de 100644 --- a/translated/tech/20150625 How to Provision Swarm Clusters using Docker Machine.md +++ b/published/20150625 How to Provision Swarm Clusters using Docker Machine.md @@ -1,11 +1,14 @@ 如何使用Docker Machine部署Swarm集群 ================================================================================ -大家好,今天我们来研究一下如何使用Docker Machine部署Swarm集群。Docker Machine提供了独立的Docker API,所以任何与Docker守护进程进行交互的工具都可以使用Swarm来(透明地)扩增到多台主机上。Docker Machine可以用来在个人电脑、云端以及的数据中心里创建Docker主机。它为创建服务器,安装Docker以及根据用户设定配置Docker客户端提供了便捷化的解决方案。我们可以使用任何驱动来部署swarm集群,并且swarm集群将由于使用了TLS加密具有极好的安全性。 + +大家好,今天我们来研究一下如何使用Docker Machine部署Swarm集群。Docker Machine提供了标准的Docker API 支持,所以任何可以与Docker守护进程进行交互的工具都可以使用Swarm来(透明地)扩增到多台主机上。Docker Machine可以用来在个人电脑、云端以及的数据中心里创建Docker主机。它为创建服务器,安装Docker以及根据用户设定来配置Docker客户端提供了便捷化的解决方案。我们可以使用任何驱动来部署swarm集群,并且swarm集群将由于使用了TLS加密具有极好的安全性。 下面是我提供的简便方法。 + ### 1. 安装Docker Machine ### -Docker Machine 在任何Linux系统上都被支持。首先,我们需要从Github上下载最新版本的Docker Machine。我们使用curl命令来下载最先版本Docker Machine ie 0.2.0。 +Docker Machine 在各种Linux系统上都支持的很好。首先,我们需要从Github上下载最新版本的Docker Machine。我们使用curl命令来下载最先版本Docker Machine ie 0.2.0。 + 64位操作系统: # curl -L https://github.com/docker/machine/releases/download/v0.2.0/docker-machine_linux-amd64 > /usr/local/bin/docker-machine @@ -18,7 +21,7 @@ Docker Machine 在任何Linux系统上都被支持。首先,我们需要从Git # chmod +x /usr/local/bin/docker-machine -在做完上面的事情以后,我们必须确保docker-machine已经安装好。怎么检查呢?运行docker-machine -v指令,指令将会给出我们系统上所安装的docker-machine版本。 +在做完上面的事情以后,我们要确保docker-machine已经安装正确。怎么检查呢?运行`docker-machine -v`指令,该指令将会给出我们系统上所安装的docker-machine版本。 # docker-machine -v @@ -31,14 +34,15 @@ Docker Machine 在任何Linux系统上都被支持。首先,我们需要从Git ### 2. 创建Machine ### -在将Docker Machine安装到我们的设备上之后,我们需要使用Docker Machine创建一个machine。在这片文章中,我们会将其部署在Digital Ocean Platform上。所以我们将使用“digitalocean”作为它的Driver API,然后将docker swarm运行在其中。这个Droplet会被设置为Swarm主节点,我们还要创建另外一个Droplet,并将其设定为Swarm节点代理。 +在将Docker Machine安装到我们的设备上之后,我们需要使用Docker Machine创建一个machine。在这篇文章中,我们会将其部署在Digital Ocean Platform上。所以我们将使用“digitalocean”作为它的Driver API,然后将docker swarm运行在其中。这个Droplet会被设置为Swarm主控节点,我们还要创建另外一个Droplet,并将其设定为Swarm节点代理。 + 创建machine的命令如下: # docker-machine create --driver digitalocean --digitalocean-access-token linux-dev -**Note**: 假设我们要创建一个名为“linux-dev”的machine。是用户在Digital Ocean Cloud Platform的Digital Ocean控制面板中生成的密钥。为了获取这个密钥,我们需要登录我们的Digital Ocean控制面板,然后点击API选项,之后点击Generate New Token,起个名字,然后在Read和Write两个选项上打钩。之后我们将得到一个很长的十六进制密钥,这个就是了。用其替换上面那条命令中的API-Token字段。 +**备注**: 假设我们要创建一个名为“linux-dev”的machine。是用户在Digital Ocean Cloud Platform的Digital Ocean控制面板中生成的密钥。为了获取这个密钥,我们需要登录我们的Digital Ocean控制面板,然后点击API选项,之后点击Generate New Token,起个名字,然后在Read和Write两个选项上打钩。之后我们将得到一个很长的十六进制密钥,这个就是了。用其替换上面那条命令中的API-Token字段。 -现在,运行下面的指令,将Machine configuration装载进shell。 +现在,运行下面的指令,将Machine 的配置变量加载进shell里。 # eval "$(docker-machine env linux-dev)" @@ -48,7 +52,7 @@ Docker Machine 在任何Linux系统上都被支持。首先,我们需要从Git # docker-machine active linux-dev -现在,我们检查是否它(指machine)被标记为了 ACTIVE "*"。 +现在,我们检查它(指machine)是否被标记为了 ACTIVE "*"。 # docker-machine ls @@ -56,22 +60,21 @@ Docker Machine 在任何Linux系统上都被支持。首先,我们需要从Git ### 3. 运行Swarm Docker镜像 ### -现在,在我们创建完成了machine之后。我们需要将swarm docker镜像部署上去。这个machine将会运行这个docker镜像并且控制Swarm主节点和从节点。使用下面的指令运行镜像: +现在,在我们创建完成了machine之后。我们需要将swarm docker镜像部署上去。这个machine将会运行这个docker镜像,并且控制Swarm主控节点和从节点。使用下面的指令运行镜像: # docker run swarm create ![Docker Machine Swarm Create](http://blog.linoxide.com/wp-content/uploads/2015/05/docker-machine-swarm-create.png) -If you are trying to run swarm docker image using **32 bit Operating System** in the computer where Docker Machine is running, we'll need to SSH into the Droplet. 如果你想要在**32位操作系统**上运行swarm docker镜像。你需要SSH登录到Droplet当中。 # docker-machine ssh #docker run swarm create #exit -### 4. 创建Swarm主节点 ### +### 4. 创建Swarm主控节点 ### -在我们的swarm image已经运行在machine当中之后,我们将要创建一个Swarm主节点。使用下面的语句,添加一个主节点。(这里的感觉怪怪的,好像少翻译了很多东西,是我把Master翻译为主节点的原因吗?) +在我们的swarm image已经运行在machine当中之后,我们将要创建一个Swarm主控节点。使用下面的语句,添加一个主控节点。 # docker-machine create \ -d digitalocean \ @@ -83,9 +86,9 @@ If you are trying to run swarm docker image using **32 bit Operating System** in ![Docker Machine Swarm Master Create](http://blog.linoxide.com/wp-content/uploads/2015/05/docker-machine-swarm-master-create.png) -### 5. 创建Swarm结点群 ### +### 5. 创建Swarm从节点 ### -现在,我们将要创建一个swarm结点,此结点将与Swarm主节点相连接。下面的指令将创建一个新的名为swarm-node的droplet,其与Swarm主节点相连。到此,我们就拥有了一个两节点的swarm集群了。 +现在,我们将要创建一个swarm从节点,此节点将与Swarm主控节点相连接。下面的指令将创建一个新的名为swarm-node的droplet,其与Swarm主控节点相连。到此,我们就拥有了一个两节点的swarm集群了。 # docker-machine create \ -d digitalocean \ @@ -96,21 +99,19 @@ If you are trying to run swarm docker image using **32 bit Operating System** in ![Docker Machine Swarm Nodes](http://blog.linoxide.com/wp-content/uploads/2015/05/docker-machine-swarm-nodes.png) -### 6. Connecting to the Swarm Master ### -### 6. 与Swarm主节点连接 ### +### 6. 与Swarm主控节点连接 ### -现在,我们连接Swarm主节点以便我们可以依照需求和配置文件在节点间部署Docker容器。运行下列命令将Swarm主节点的Machine配置文件加载到环境当中。 +现在,我们连接Swarm主控节点以便我们可以依照需求和配置文件在节点间部署Docker容器。运行下列命令将Swarm主控节点的Machine配置文件加载到环境当中。 # eval "$(docker-machine env --swarm swarm-master)" -然后,我们就可以跨结点地运行我们所需的容器了。在这里,我们还要检查一下是否一切正常。所以,运行**docker info**命令来检查Swarm集群的信息。 +然后,我们就可以跨节点地运行我们所需的容器了。在这里,我们还要检查一下是否一切正常。所以,运行**docker info**命令来检查Swarm集群的信息。 # docker info -### Conclusion ### ### 总结 ### -我们可以用Docker Machine轻而易举地创建Swarm集群。这种方法有非常高的效率,因为它极大地减少了系统管理员和用户的时间消耗。在这篇文章中,我们以Digital Ocean作为驱动,通过创建一个主节点和一个从节点成功地部署了集群。其他类似的应用还有VirtualBox,Google Cloud Computing,Amazon Web Service,Microsoft Azure等等。这些连接都是通过TLS进行加密的,具有很高的安全性。如果你有任何的疑问,建议,反馈,欢迎在下面的评论框中注明以便我们可以更好地提高文章的质量! +我们可以用Docker Machine轻而易举地创建Swarm集群。这种方法有非常高的效率,因为它极大地减少了系统管理员和用户的时间消耗。在这篇文章中,我们以Digital Ocean作为驱动,通过创建一个主控节点和一个从节点成功地部署了集群。其他类似的驱动还有VirtualBox,Google Cloud Computing,Amazon Web Service,Microsoft Azure等等。这些连接都是通过TLS进行加密的,具有很高的安全性。如果你有任何的疑问,建议,反馈,欢迎在下面的评论框中注明以便我们可以更好地提高文章的质量! -------------------------------------------------------------------------------- @@ -118,7 +119,7 @@ via: http://linoxide.com/linux-how-to/provision-swarm-clusters-using-docker-mach 作者:[Arun Pyasi][a] 译者:[DongShuaike](https://github.com/DongShuaike) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 9b61686c047dd14af43d13b1e593789c388b6aaf Mon Sep 17 00:00:00 2001 From: XLCYun Date: Mon, 3 Aug 2015 08:25:33 +0800 Subject: [PATCH 773/965] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=8E=9F=E6=96=87=20?= =?UTF-8?q?=20XLCYun?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ht & Wrong - Page 2 - The GNOME Desktop.md | 32 ------------------- 1 file changed, 32 deletions(-) delete mode 100644 sources/tech/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 2 - The GNOME Desktop.md diff --git a/sources/tech/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 2 - The GNOME Desktop.md b/sources/tech/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 2 - The GNOME Desktop.md deleted file mode 100644 index 1bf684313b..0000000000 --- a/sources/tech/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 2 - The GNOME Desktop.md +++ /dev/null @@ -1,32 +0,0 @@ -Translating by XLCYun. -A Week With GNOME As My Linux Desktop: What They Get Right & Wrong - Page 2 - The GNOME Desktop -================================================================================ -### The Desktop ### - -![](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_gdm_show&w=1920) - -I spent the first five days of my week logging into Gnome manually-- not turning on automatic login. On night of the fifth day I got annoyed with having to login by hand and so I went into the User Manager and turned on automatic login. The next time I logged in I got a prompt: "Your keychain was not unlocked. Please enter your password to unlock your keychain." That was when I realized something... Gnome had been automatically unlocking my keychain—my wallet in KDE speak-- every time I logged in via GDM. It was only when I bypassed GDM's login that Gnome had to step in and make me do it manually. - -Now, I am under the personal belief that if you enable automatic login then your key chain should be unlocked automatically as well-- otherwise what's the point? Either way you still have to type in your password and at least if you hit the GDM Login screen you have a chance to change your session if you want to. - -But, regardless of that, it was at that moment that I realized it was such a simple thing that made the desktop feel so much more like it was working WITH ME. When I log into KDE via SDDM? Before the splash screen is even finished loading there is a window popping up over top the splash animation-- thereby disrupting the splash screen-- prompting me to unlock my KDE wallet or GPG keyring. - -If a wallet doesn't exist already you get prompted to create a wallet-- why couldn't one have been created for me at user creation?-- and then get asked to pick between two encryption methods, where one is even implied as insecure (Blowfish), why are you letting me pick something that's insecure for my security? Author's Note: If you install the actual KDE spin and don't just install KDE after-the-fact then a wallet is created for you at user creation. Unfortunately it's not unlocked for you automatically, and it seems to use the older Blowfish method rather than the new, and more secure, GPG method. - -![](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_kgpg_show&w=1920) - -If you DO pick the secure one (GPG) then it tries to load an Gpg key... which I hope you had one created already because if you don't you get yelled at. How do you create one? Well, it doesn't offer to make one for you... nor It doesn't tell you... and if you do manage TO figure out that you are supposed to use KGpg to create the key then you get taken through several menus and prompts that are nothing but confusing to new users. Why are you asking me where the GPG binary is located? How on earth am I supposed to know? Can't you just use the most recent one if there's more than one? And if there IS only one then, I ask again, why are you prompting me? - -Why are you asking me what key size and encryption algorithm to use? You select 2048 and RSA/RSA by default, so why not just use those? If you want to have those options available then throw them under the "Expert mode" button that is right there. This isn't just about having configuration options available, its about needless things that get thrown in the user's face by default. This is going to be a theme for the rest of the article... KDE needs better sane defaults. Configuration is great, I love the configuration I get with KDE, but it needs to learn when to and when not to prompt. It also needs to learn that "Well its configurable" is no excuse for bad defaults. Defaults are what users see initially, bad defaults will lose users. - -Let's move on from the key chain issue though, because I think I made my point. - --------------------------------------------------------------------------------- - -via: http://www.phoronix.com/scan.php?page=article&item=gnome-week-editorial&num=2 - -作者:Eric Griffith -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 03c44a7869162c8f82d29bf73501ef7984f124bd Mon Sep 17 00:00:00 2001 From: XLCYun Date: Mon, 3 Aug 2015 08:27:06 +0800 Subject: [PATCH 774/965] =?UTF-8?q?XLCYun=20=20Gnome=E7=AC=AC=E4=BA=8C?= =?UTF-8?q?=E8=8A=82=E7=BF=BB=E8=AF=91=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit translated by XLCYun --- ...ht & Wrong - Page 2 - The GNOME Desktop.md | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 translated/tech/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 2 - The GNOME Desktop.md diff --git a/translated/tech/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 2 - The GNOME Desktop.md b/translated/tech/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 2 - The GNOME Desktop.md new file mode 100644 index 0000000000..5ce4dcd8d5 --- /dev/null +++ b/translated/tech/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 2 - The GNOME Desktop.md @@ -0,0 +1,31 @@ +将GNOME作为我的Linux桌面的一周:他们做对的与做错的 - 第二节 - GNOME桌面 +================================================================================ +### 桌面 ### + +![](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_gdm_show&w=1920) + +在我这一周的前五天中,我都是直接手动登录进Gnome的——没有打开自动登录功能。在第五天的晚上,每一次都要手动登录让我觉得很厌烦,所以我就到用户管理器中打开了自动登录功能。下一次我登录的时候收到了一个提示:“你的密钥链(keychain)未解锁,请输入你的密码解锁”。在这时我才意识到了什么……每一次我通过GDM登录时——我的KDB钱包提示——Gnome以前一直都在自动解锁我的密钥链!当我绕开GDM的登录程序时,Gnome才不得不介入让我手动解锁。 + +现在,鄙人的陋见是如果你打开了自动登录功能,那么你的密钥链也应当自动解锁——否则,这功能还有何用?无论如何,你还是要输入你的密码,况且在GDM登录界面你还能有机会选择要登录的会话。 + +但是,这点且不提,也就是在那一刻,我意识到要让这桌面感觉是它在**和我**一起工作是多么简单的一件事。当我通过SDDM登录KDE时?甚至连启动界面都还没加载完成,就有一个窗口弹出来遮挡了启动动画——因此启动动画也就被破坏了——提示我解锁我的KDE钱包或GPG钥匙环。 + +如果当前不存在钱包,你就会收到一个创建钱包的提醒——就不能在创建用户的时候同时为我创建一个吗?——接着它又让你在两种加密模式中选择一种,甚至还暗示我们其中一种是不安全的(Blowfish),既然是为了安全,为什么还要我选择一个不安全的东西?作者声明:如果你安装了真正的KDE spin版本而不是仅仅安装了KDE的事后版本,那么在创建用户时,它就会为你创建一个钱包。但很不幸的是,它不会帮你解锁,并且它似乎还使用了更老的Blowfish加密模式,而不是更新而且更安全的GPG模式。 + +![](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_kgpg_show&w=1920) + +如果你选择了那个安全的加密模式(GPG),那么它会尝试加载GPG密钥……我希望你已经创建过一个了,因为如果你没有,那么你可又要被批一顿了。怎么样才能创建一个?额……它不帮你创建一个……也不告诉你怎么创建……假如你真的搞明白了你应该使用KGpg来创建一个密钥,接着在你就会遇到一层层的菜单和一个个的提示,而这些菜单和提示只能让新手感到困惑。为什么你要问我GPG的二进制文件在哪?天知道在哪!如果不止一个,你就不能为我选择一个最新的吗?如果只有一个,我再问一次,为什么你还要问我? + +为什么你要问我要使用多大的密钥大小和加密算法?你既然默认选择了2048和RSA/RSA,为什么不直接使用?如果你想让这些选项能够被改变,那就把它们扔在下面的"Expert mode(专家模式)"按钮里去。这不仅仅关于使配置可被用户改变,而是关于默认地把多余的东西扔在了用户面前。这种问题将会成为剩下文章的主题之一……KDE需要更好更理智的默认配置。配置是好的,我很喜欢在使用KDE时的配置,但它还需要知道什么时候应该,什么时候不应该去提示用户。而且它还需要知道“嗯,它是可配置的”不能做为默认配置做得不好的借口。用户最先接触到的就是默认配置,不好的默认配置注定要失去用户。 + +让我们抛开密钥链的问题,因为我想我已经表达出了我的想法。 + +-------------------------------------------------------------------------------- + +via: http://www.phoronix.com/scan.php?page=article&item=gnome-week-editorial&num=2 + +作者:Eric Griffith +译者:[XLCYun](https://github.com/XLCYun) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 1665f293d1a20b351480b49a9a2a9be67ca16af9 Mon Sep 17 00:00:00 2001 From: joeren Date: Mon, 3 Aug 2015 09:58:33 +0800 Subject: [PATCH 775/965] =?UTF-8?q?github=202.0=E6=B5=8B=E8=AF=95=E6=8E=A8?= =?UTF-8?q?=E9=80=81=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- github 2.0测试.txt | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 github 2.0测试.txt diff --git a/github 2.0测试.txt b/github 2.0测试.txt new file mode 100644 index 0000000000..e69de29bb2 From d90f37fdb59f8130a83c3894ef2c247870979aef Mon Sep 17 00:00:00 2001 From: joeren Date: Mon, 3 Aug 2015 10:11:49 +0800 Subject: [PATCH 776/965] =?UTF-8?q?=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- github 2.0测试.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/github 2.0测试.txt b/github 2.0测试.txt index e69de29bb2..9d07aa0df5 100644 --- a/github 2.0测试.txt +++ b/github 2.0测试.txt @@ -0,0 +1 @@ +111 \ No newline at end of file From f7b881a22862a051f1f2529900989bce239dcf51 Mon Sep 17 00:00:00 2001 From: joeren Date: Mon, 3 Aug 2015 10:15:21 +0800 Subject: [PATCH 777/965] Test --- github 2.0测试.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/github 2.0测试.txt b/github 2.0测试.txt index 9d07aa0df5..7787faa3c1 100644 --- a/github 2.0测试.txt +++ b/github 2.0测试.txt @@ -1 +1,2 @@ -111 \ No newline at end of file +111 +222 \ No newline at end of file From 60689c5fc61a277731adf66298f33409f95dcde2 Mon Sep 17 00:00:00 2001 From: Ezio Date: Mon, 3 Aug 2015 10:57:25 +0800 Subject: [PATCH 778/965] Delete 20150410 How to run Ubuntu Snappy Core on Raspberry Pi 2.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 删除原文 oska874 --- ...un Ubuntu Snappy Core on Raspberry Pi 2.md | 91 ------------------- 1 file changed, 91 deletions(-) delete mode 100644 sources/tech/20150410 How to run Ubuntu Snappy Core on Raspberry Pi 2.md diff --git a/sources/tech/20150410 How to run Ubuntu Snappy Core on Raspberry Pi 2.md b/sources/tech/20150410 How to run Ubuntu Snappy Core on Raspberry Pi 2.md deleted file mode 100644 index 99b2b3acc1..0000000000 --- a/sources/tech/20150410 How to run Ubuntu Snappy Core on Raspberry Pi 2.md +++ /dev/null @@ -1,91 +0,0 @@ -+Translating by Ezio - -How to run Ubuntu Snappy Core on Raspberry Pi 2 -================================================================================ -The Internet of Things (IoT) is upon us. In a couple of years some of us might ask ourselves how we ever survived without it, just like we question our past without cellphones today. Canonical is a contender in this fast growing, but still wide open market. The company wants to claim their stakes in IoT just as they already did for the cloud. At the end of January, the company launched a small operating system that goes by the name of [Ubuntu Snappy Core][1] which is based on Ubuntu Core. - -Snappy, the new component in the mix, represents a package format that is derived from DEB, is a frontend to update the system that lends its idea from atomic upgrades used in CoreOS, Red Hat's Atomic and elsewhere. As soon as the Raspberry Pi 2 was marketed, Canonical released Snappy Core for that plattform. The first edition of the Raspberry Pi was not able to run Ubuntu because Ubuntu's ARM images use the ARMv7 architecture, while the first Raspberry Pis were based on ARMv6. That has changed now, and Canonical, by releasing a RPI2-Image of Snappy Core, took the opportunity to make clear that Snappy was meant for the cloud and especially for IoT. - -Snappy also runs on other platforms like Amazon EC2, Microsofts Azure, and Google's Compute Engine, and can also be virtualized with KVM, Virtualbox, or Vagrant. Canonical has embraced big players like Microsoft, Google, Docker or OpenStack and, at the same time, also included small projects from the maker scene as partners. Besides startups like Ninja Sphere and Erle Robotics, there are board manufacturers like Odroid, Banana Pro, Udoo, PCDuino and Parallella as well as Allwinner. Snappy Core will also run in routers soon to help with the poor upgrade policy that vendors perform. - -In this post, let's see how we can test Ubuntu Snappy Core on Raspberry Pi 2. - -The image for Snappy Core for the RPI2 can be downloaded from the [Raspberry Pi website][2]. Unpacked from the archive, the resulting image should be [written to an SD card][3] of at least 8 GB. Even though the OS is small, atomic upgrades and the rollback function eat up quite a bit of space. After booting up your Raspberry Pi 2 with Snappy Core, you can log into the system with the default username and password being 'ubuntu'. - -![](https://farm8.staticflickr.com/7639/16428527263_f7bdd56a0d_c.jpg) - -sudo is already configured and ready for use. For security reasons you should change the username with: - - $ sudo usermod -l - -Alternatively, you can add a new user with the command `adduser`. - -Due to the lack of a hardware clock on the RPI, that the Snappy Core image does not take account of, the image has a small bug that will throw a lot of errors when processing commands. It is easy to fix. - -To find out if the bug affects you, use the command: - - $ date - -If the output is "Thu Jan 1 01:56:44 UTC 1970", you can fix it with: - - $ sudo date --set="Sun Apr 04 17:43:26 UTC 2015" - -adapted to your actual time. - -![](https://farm9.staticflickr.com/8735/16426231744_c54d9b8877_b.jpg) - -Now you might want to check if there are any updates available. Note that the usual commands: - - $ sudo apt-get update && sudo apt-get distupgrade - -will not get you very far though, as Snappy uses its own simplified package management system which is based on dpkg. This makes sense, as Snappy will run on a lot of embedded appliances, and you want things to be as simple as possible. - -Let's dive into the engine room for a minute to understand how things work with Snappy. The SD card you run Snappy on has three partitions besides the boot partition. Two of those house a duplicated file system. Both of those parallel file systems are permanently mounted as "read only", and only one is active at any given time. The third partition holds a partial writable file system and the users persistent data. With a fresh system, the partition labeled 'system-a' holds one complete file system, called a core, leaving the parallel partition still empty. - -![](https://farm9.staticflickr.com/8758/16841251947_21f42609ce_b.jpg) - -If we run the following command now: - - $ sudo snappy update - -the system will install the update as a complete core, similar to an image, on 'system-b'. You will be asked to reboot your device afterwards to activate the new core. - -After the reboot, run the following command to check if your system is up to date and which core is active. - - $ sudo snappy versions -a - -After rolling out the update and rebooting, you should see that the core that is now active has changed. - -As we have not installed any apps yet, the following command: - - $ sudo snappy update ubuntu-core - -would have been sufficient, and is the way if you want to upgrade just the underlying OS. Should something go wrong, you can rollback by: - - $ sudo snappy rollback ubuntu-core - -which will take you back to the system's state before the update. - -![](https://farm8.staticflickr.com/7666/17022676786_5fe6804ed8_c.jpg) - -Speaking of apps, they are what makes Snappy useful. There are not that many at this point, but the IRC channel #snappy on Freenode is humming along nicely and with a lot of people involved, the Snappy App Store gets new apps added on a regular basis. You can visit the shop by pointing your browser to http://:4200, and you can install apps right from the shop and then launch them with http://webdm.local in your browser. Building apps yourself for Snappy is not all that hard, and [well documented][4]. You can also port DEB packages into the snappy format quite easily. - -![](https://farm8.staticflickr.com/7656/17022676836_968a2a7254_c.jpg) - -Ubuntu Snappy Core, due to the limited number of available apps, is not overly useful in a productive way at this point in time, although it invites us to dive into the new Snappy package format and play with atomic upgrades the Canonical way. Since it is easy to set up, this seems like a good opportunity to learn something new. - --------------------------------------------------------------------------------- - -via: http://xmodulo.com/ubuntu-snappy-core-raspberry-pi-2.html - -作者:[Ferdinand Thommes][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/ferdinand -[1]:http://www.ubuntu.com/things -[2]:http://www.raspberrypi.org/downloads/ -[3]:http://xmodulo.com/write-raspberry-pi-image-sd-card.html -[4]:https://developer.ubuntu.com/en/snappy/ From 0b73d40c0e585226303bc4dcff5ed5a172c87ee8 Mon Sep 17 00:00:00 2001 From: Ezio Date: Mon, 3 Aug 2015 11:01:10 +0800 Subject: [PATCH 779/965] Create 20150410 How to run Ubuntu Snappy Core on Raspberry Pi 2.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 添加翻译过的文章 oska874 --- ...un Ubuntu Snappy Core on Raspberry Pi 2.md | 89 +++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 translated/tech/20150410 How to run Ubuntu Snappy Core on Raspberry Pi 2.md diff --git a/translated/tech/20150410 How to run Ubuntu Snappy Core on Raspberry Pi 2.md b/translated/tech/20150410 How to run Ubuntu Snappy Core on Raspberry Pi 2.md new file mode 100644 index 0000000000..c4475f39a2 --- /dev/null +++ b/translated/tech/20150410 How to run Ubuntu Snappy Core on Raspberry Pi 2.md @@ -0,0 +1,89 @@ +如何在树莓派2 代运行ubuntu Snappy Core +================================================================================ +物联网(Internet of Things, IoT) 时代即将来临。很快,过不了几年,我们就会问自己当初是怎么在没有物联网的情况下生存的,就像我们现在怀疑过去没有手机的年代。Canonical 就是一个物联网快速发展却还是开放市场下的竞争者。这家公司宣称自己把赌注压到了IoT 上,就像他们已经在“云”上做过的一样。。在今年一月底,Canonical 启动了一个基于Ubuntu Core 的小型操作系统,名字叫做 [Ubuntu Snappy Core][1] 。 + +Snappy 是一种用来替代deb 的新的打包格式,是一个用来更新系统的前端,从CoreOS、红帽子和其他地方借鉴了原子更新这个想法。很快树莓派2 代投入市场,Canonical 就发布了用于树莓派的Snappy Core 版本。第一代树莓派因为是基于ARMv6 ,而Ubuntu 的ARM 镜像是基于ARMv7 ,所以不能运行ubuntu 。不过这种状况现在改变了,Canonical 通过发布用于RPI2 的镜像,抓住机会澄清了Snappy 就是一个用于云计算,特别是IoT 的系统。 + +Snappy 同样可以运行在其它像Amazon EC2, Microsofts Azure, Google's Compute Engine 这样的云端上,也可以虚拟化在KVM、Virtuabox 和vagrant 上。Canonical 已经拥抱了微软、谷歌、Docker、OpenStack 这些重量级选手,同时也与一些小项目达成合作关系。除了一些创业公司,像Ninja Sphere、Erle Robotics,还有一些开发板生产商比如Odroid、Banana Pro, Udoo, PCDuino 和Parallella 、全志。Snappy Core 也希望很快能运行在路由器上,来帮助改进路由器生产商目前很少更新固件的策略。 + +接下来,让我们看看怎么样在树莓派2 上运行Snappy。 + +用于树莓派2 的Snappy 镜像可以从 [Raspberry Pi 网站][2] 上下载。解压缩出来的镜像必须[写到一个至少8GB 大小的SD 卡][3]。尽管原始系统很小,但是院子升级和回滚功能会蚕食不小的空间。使用Snappy 启动树莓派2 后你就可以使用默认用户名和密码(都是ubuntu)登录系统。 + +![](https://farm8.staticflickr.com/7639/16428527263_f7bdd56a0d_c.jpg) + +sudo 已经配置好了可以直接用,安全起见,你应该使用以下命令来修改你的用户名 + + $ sudo usermod -l + +或者也可以使用`adduser` 为你添加一个新用户。 + +因为RPI缺少硬件始终,而Snappy 不知道这一点,所以系统会有一个小bug:处理命令时会报很多错。不过这个很容易解决: + +使用这个命令来确认这个bug 是否影响: + + $ date + +如果输出是 "Thu Jan 1 01:56:44 UTC 1970", 你可以这样做来改正: + + $ sudo date --set="Sun Apr 04 17:43:26 UTC 2015" + +改成你的实际时间。 + +![](https://farm9.staticflickr.com/8735/16426231744_c54d9b8877_b.jpg) + +现在你可能打算检查一下,看看有没有可用的更新。注意通常使用的命令: + + $ sudo apt-get update && sudo apt-get distupgrade + +现在将不会让你通过,因为Snappy 会使用它自己精简过的、基于dpkg 的包管理系统。这是做是应为Snappy 会运行很多嵌入式程序,而你也会想着所有事情尽可能的简化。 + +让我们来看看最关键的部分,理解一下程序是如何与Snappy 工作的。运行Snappy 的SD 卡上除了boot 分区外还有3个分区。其中的两个构成了一个重复的文件系统。这两个平行文件系统被固定挂载为只读模式,并且任何时刻只有一个是激活的。第三个分区是一个部分可写的文件系统,用来让用户存储数据。通过更新系统,标记为'system-a' 的分区会保持一个完整的文件系统,被称作核心,而另一个平行文件系统仍然会是空的。 + +![](https://farm9.staticflickr.com/8758/16841251947_21f42609ce_b.jpg) + +如果我们运行以下命令: + + $ sudo snappy update + +系统将会在'system-b' 上作为一个整体进行更新,这有点像是更新一个镜像文件。接下来你将会被告知要重启系统来激活新核心。 + +重启之后,运行下面的命令可以检查你的系统是否已经更新到最新版本,以及当前被激活的是那个核心 + + $ sudo snappy versions -a + +经过更新-重启的操作,你应该可以看到被激活的核心已经被改变了。 + +因为到目前为止我们还没有安装任何软件,下面的命令: + + $ sudo snappy update ubuntu-core + +将会生效,而且如果你打算仅仅更新特定的OS,这也是一个办法。如果出了问题,你可以使用下面的命令回滚: + + $ sudo snappy rollback ubuntu-core + +这将会把系统状态回滚到更新之前。 + +![](https://farm8.staticflickr.com/7666/17022676786_5fe6804ed8_c.jpg) + +再来说说那些让Snappy 有用的软件。这里不会讲的太多关于如何构建软件、向Snappy 应用商店添加软件的基础知识,但是你可以通过Freenode 上的IRC 频道#snappy 了解更多信息,那个上面有很多人参与。你可以通过浏览器访问http://:4200 来浏览应用商店,然后从商店安装软件,再在浏览器里访问http://webdm.local 来启动程序。如何构建用于Snappy 的软件并不难,而且也有了现成的[参考文档][4] 。你也可以很容易的把DEB 安装包使用Snappy 格式移植到Snappy 上。 + +![](https://farm8.staticflickr.com/7656/17022676836_968a2a7254_c.jpg) + +尽管Ubuntu Snappy Core 吸引我们去研究新型的Snappy 安装包格式和Canonical 式的原子更新操作,但是因为有限的可用应用,它现在在生产环境里还不是很有用。但是既然搭建一个Snappy 环境如此简单,这看起来是一个学点新东西的好机会。 + +-------------------------------------------------------------------------------- + +via: http://xmodulo.com/ubuntu-snappy-core-raspberry-pi-2.html + +作者:[Ferdinand Thommes][a] +译者:[译者ID](https://github.com/oska874) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://xmodulo.com/author/ferdinand +[1]:http://www.ubuntu.com/things +[2]:http://www.raspberrypi.org/downloads/ +[3]:http://xmodulo.com/write-raspberry-pi-image-sd-card.html +[4]:https://developer.ubuntu.com/en/snappy/ From 9e78da3fe288fdc6346cc4cefff359b1f56d8915 Mon Sep 17 00:00:00 2001 From: DeadFire Date: Mon, 3 Aug 2015 16:00:21 +0800 Subject: [PATCH 780/965] =?UTF-8?q?20150803-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ds for profiling your Unix file systems.md | 64 +++ sources/tech/20150803 Linux Logging Basics.md | 90 ++++ sources/tech/20150803 Managing Linux Logs.md | 418 ++++++++++++++++++ ...0150803 Troubleshooting with Linux Logs.md | 116 +++++ 4 files changed, 688 insertions(+) create mode 100644 sources/tech/20150803 Handy commands for profiling your Unix file systems.md create mode 100644 sources/tech/20150803 Linux Logging Basics.md create mode 100644 sources/tech/20150803 Managing Linux Logs.md create mode 100644 sources/tech/20150803 Troubleshooting with Linux Logs.md diff --git a/sources/tech/20150803 Handy commands for profiling your Unix file systems.md b/sources/tech/20150803 Handy commands for profiling your Unix file systems.md new file mode 100644 index 0000000000..ae5951b0d7 --- /dev/null +++ b/sources/tech/20150803 Handy commands for profiling your Unix file systems.md @@ -0,0 +1,64 @@ +Handy commands for profiling your Unix file systems +================================================================================ +![Credit: Sandra H-S](http://images.techhive.com/images/article/2015/07/file-profile-100597239-primary.idge.png) +Credit: Sandra H-S + +One of the problems that seems to plague nearly all file systems -- Unix and others -- is the continuous buildup of files. Almost no one takes the time to clean out files that they no longer use and file systems, as a result, become so cluttered with material of little or questionable value that keeping them them running well, adequately backed up, and easy to manage is a constant challenge. + +One way that I have seen to help encourage the owners of all that data detritus to address the problem is to create a summary report or "profile" of a file collection that reports on such things as the number of files; the oldest, newest, and largest of those files; and a count of who owns those files. If someone realizes that a collection of half a million files contains none less than five years old, they might go ahead and remove them -- or, at least, archive and compress them. The basic problem is that huge collections of files are overwhelming and most people are afraid that they might accidentally delete something important. Having a way to characterize a file collection can help demonstrate the nature of the content and encourage those digital packrats to clean out their nests. + +When I prepare a file system summary report on Unix, a handful of Unix commands easily provide some very useful statistics. To count the files in a directory, you can use a find command like this. + + $ find . -type f | wc -l + 187534 + +Finding the oldest and newest files is a bit more complicated, but still quite easy. In the commands below, we're using the find command again to find files, displaying the data with a year-month-day format that makes it possible to sort by file age, and then displaying the top -- thus the oldest -- file in that list. + +In the second command, we do the same, but print the last line -- thus the newest -- file. + + $ find -type f -printf '%T+ %p\n' | sort | head -n 1 + 2006-02-03+02:40:33 ./skel/.xemacs/init.el + $ find -type f -printf '%T+ %p\n' | sort | tail -n 1 + 2015-07-19+14:20:16 ./.bash_history + +The %T (file date and time) and %p (file name with path) parameters with the printf command allow this to work. + +If we're looking at home directories, we're undoubtedly going to find that history files are the newest files and that isn't likely to be a very interesting bit of information. You can omit those files by "un-grepping" them or you can omit all files that start with dots as shown below. + + $ find -type f -printf '%T+ %p\n' | grep -v "\./\." | sort | tail -n 1 + 2015-07-19+13:02:12 ./isPrime + +Finding the largest file involves using the %s (size) parameter and we include the file name (%f) since that's what we want the report to show. + + $ find -type f -printf '%s %f \n' | sort -n | uniq | tail -1 + 20183040 project.org.tar + +To summarize file ownership, use the %u (owner) + + $ find -type f -printf '%u \n' | grep -v "\./\." | sort | uniq -c + 180034 shs + 7500 jdoe + +If your file system also records the last access date, it can be very useful to show that files haven't been accessed in, say, more than two years. This would give your reviewers an important insight into the value of those files. The last access parameter (%a) could be used like this: + + $ find -type f -printf '%a+ %p\n' | sort | head -n 1 + Fri Dec 15 03:00:30 2006+ ./statreport + +Of course, if the most recently accessed file is also in the deep dark past, that's likely to get even more of a reaction. + + $ find -type f -printf '%a+ %p\n' | sort | tail -n 1 + Wed Nov 26 03:00:27 2007+ ./my-notes + +Getting a sense of what's in a file system or large directory by creating a summary report showing the file date ranges, the largest files, the file owners, and the oldest and new access times can help to demonstrate how current and how important a file collection is and help its owners decide if it's time to clean up. + +-------------------------------------------------------------------------------- + +via: http://www.itworld.com/article/2949898/linux/profiling-your-file-systems.html + +作者:[Sandra Henry-Stocker][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.itworld.com/author/Sandra-Henry_Stocker/ \ No newline at end of file diff --git a/sources/tech/20150803 Linux Logging Basics.md b/sources/tech/20150803 Linux Logging Basics.md new file mode 100644 index 0000000000..d20f68f140 --- /dev/null +++ b/sources/tech/20150803 Linux Logging Basics.md @@ -0,0 +1,90 @@ +Linux Logging Basics +================================================================================ +First we’ll describe the basics of what Linux logs are, where to find them, and how they get created. If you already know this stuff, feel free to skip to the next section. + +### Linux System Logs ### + +Many valuable log files are automatically created for you by Linux. You can find them in your /var/log directory. Here is what this directory looks like on a typical Ubuntu system: + +![](http://www.loggly.com/ultimate-guide/wp-content/uploads/2015/05/Linux-system-log-terminal.png) + +Some of the most important Linux system logs include: + +- /var/log/syslog or /var/log/messages stores all global system activity data, including startup messages. Debian-based systems like Ubuntu store this in /var/log/syslog. RedHat-based systems like RHEL or CentOS store this in /var/log/messages. +- /var/log/auth.log or /var/log/secure stores logs from the Pluggable Authentication Module (pam) including successful logins, failed login attempts, and authentication methods. Ubuntu and Debian store authentication messages in /var/log/auth.log. RedHat and CentOS store this data in /var/log/secure. +- /var/log/kern stores kernel error and warning data, which is particularly helpful for troubleshooting custom kernels. +- /var/log/cron stores information about cron jobs. Use this data to verify that your cron jobs are running successfully. + +Digital Ocean has a thorough [tutorial][1] on these files and how rsyslog creates them on common distributions like RedHat and CentOS. + +Applications also write log files in this directory. For example, popular servers like Apache, Nginx, MySQL, and more can write log files here. Some of these log files are written by the application itself. Others are created through syslog (see below). + +### What’s Syslog? ### + +How do Linux system log files get created? The answer is through the syslog daemon, which listens for log messages on the syslog socket /dev/log and then writes them to the appropriate log file. + +The word “syslog” is an overloaded term and is often used in short to refer to one of these: + +1. **Syslog daemon** — a program to receive, process, and send syslog messages. It can [send syslog remotely][2] to a centralized server or write it to a local file. Common examples include rsyslogd and syslog-ng. In this usage, people will often say “sending to syslog.” +1. **Syslog protocol** — a transport protocol specifying how logs can be sent over a network and a data format definition for syslog messages (below). It’s officially defined in [RFC-5424][3]. The standard ports are 514 for plaintext logs and 6514 for encrypted logs. In this usage, people will often say “sending over syslog.” +1. **Syslog messages** — log messages or events in the syslog format, which includes a header with several standard fields. In this usage, people will often say “sending syslog.” + +Syslog messages or events include a header with several standard fields, making analysis and routing easier. They include the timestamp, the name of the application, the classification or location in the system where the message originates, and the priority of the issue. + +Here is an example log message with the syslog header included. It’s from the sshd daemon, which controls remote logins to the system. This message describes a failed login attempt: + + <34>1 2003-10-11T22:14:15.003Z server1.com sshd - - pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=10.0.2.2 + +### Syslog Format and Fields ### + +Each syslog message includes a header with fields. Fields are structured data that makes it easier to analyze and route the events. Here is the format we used to generate the above syslog example. You can match each value to a specific field name. + + <%pri%>%protocol-version% %timestamp:::date-rfc3339% %HOSTNAME% %app-name% %procid% %msgid% %msg%n + +Below, you’ll find descriptions of some of the most commonly used syslog fields when searching or troubleshooting issues. + +#### Timestamp #### + +The [timestamp][4] field (2003-10-11T22:14:15.003Z in the example) indicates the time and date that the message was generated on the system sending the message. That time can be different from when another system receives the message. The example timestamp breaks down like this: + +- **2003-10-11** is the year, month, and day. +- **T** is a required element of the TIMESTAMP field, separating the date and the time. +- **22:14:15.003** is the 24-hour format of the time, including the number of milliseconds (**003**) into the next second. +- **Z** is an optional element, indicating UTC time. Instead of Z, the example could have included an offset, such as -08:00, which indicates that the time is offset from UTC by 8 hours, PST. + +#### Hostname #### + +The [hostname][5] field (server1.com in the example above) indicates the name of the host or system that sent the message. + +#### App-Name #### + +The [app-name][6] field (sshd:auth in the example) indicates the name of the application that sent the message. + +#### Priority #### + +The priority field or [pri][7] for short (<34> in the example above) tells you how urgent or severe the event is. It’s a combination of two numerical fields: the facility and the severity. The severity ranges from the number 7 for debug events all the way to 0 which is an emergency. The facility describes which process created the event. It ranges from 0 for kernel messages to 23 for local application use. + +Pri can be output in two ways. The first is as a single number prival which is calculated as the facility field value multiplied by 8, then the result is added to the severity field value: (facility)(8) + (severity). The second is pri-text which will output in the string format “facility.severity.” The latter format can often be easier to read and search but takes up more storage space. + +-------------------------------------------------------------------------------- + +via: http://www.loggly.com/ultimate-guide/logging/linux-logging-basics/ + +作者:[Jason Skowronski][a1] +作者:[Amy Echeverri][a2] +作者:[Sadequl Hussain][a3] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a1]:https://www.linkedin.com/in/jasonskowronski +[a2]:https://www.linkedin.com/in/amyecheverri +[a3]:https://www.linkedin.com/pub/sadequl-hussain/14/711/1a7 +[1]:https://www.digitalocean.com/community/tutorials/how-to-view-and-configure-linux-logs-on-ubuntu-and-centos +[2]:https://docs.google.com/document/d/11LXZxWlkNSHkcrCWTUdnLRf_CiZz9kK0cr3yGM_BU_0/edit#heading=h.y2e9tdfk1cdb +[3]:https://tools.ietf.org/html/rfc5424 +[4]:https://tools.ietf.org/html/rfc5424#section-6.2.3 +[5]:https://tools.ietf.org/html/rfc5424#section-6.2.4 +[6]:https://tools.ietf.org/html/rfc5424#section-6.2.5 +[7]:https://tools.ietf.org/html/rfc5424#section-6.2.1 \ No newline at end of file diff --git a/sources/tech/20150803 Managing Linux Logs.md b/sources/tech/20150803 Managing Linux Logs.md new file mode 100644 index 0000000000..d68adddf52 --- /dev/null +++ b/sources/tech/20150803 Managing Linux Logs.md @@ -0,0 +1,418 @@ +Managing Linux Logs +================================================================================ +A key best practice for logging is to centralize or aggregate your logs in one place, especially if you have multiple servers or tiers in your architecture. We’ll tell you why this is a good idea and give tips on how to do it easily. + +### Benefits of Centralizing Logs ### + +It can be cumbersome to look at individual log files if you have many servers. Modern web sites and services often include multiple tiers of servers, distributed with load balancers, and more. It’d take a long time to hunt down the right file, and even longer to correlate problems across servers. There’s nothing more frustrating than finding the information you are looking for hasn’t been captured, or the log file that could have held the answer has just been lost after a restart. + +Centralizing your logs makes them faster to search, which can help you solve production issues faster. You don’t have to guess which server had the issue because all the logs are in one place. Additionally, you can use more powerful tools to analyze them, including log management solutions. These solutions can [transform plain text logs][1] into fields that can be easily searched and analyzed. + +Centralizing your logs also makes them easier to manage: + +- They are safer from accidental or intentional loss when they are backed up and archived in a separate location. If your servers go down or are unresponsive, you can use the centralized logs to debug the problem. +- You don’t have to worry about ssh or inefficient grep commands requiring more resources on troubled systems. +- You don’t have to worry about full disks, which can crash your servers. +- You can keep your production servers secure without giving your entire team access just to look at logs. It’s much safer to give your team access to logs from the central location. + +With centralized log management, you still must deal with the risk of being unable to transfer logs to the centralized location due to poor network connectivity or of using up a lot of network bandwidth. We’ll discuss how to intelligently address these issues in the sections below. + +### Popular Tools for Centralizing Logs ### + +The most common way of centralizing logs on Linux is by using syslog daemons or agents. The syslog daemon supports local log collection, then transports logs through the syslog protocol to a central server. There are several popular daemons that you can use to centralize your log files: + +- [rsyslog][2] is a light-weight daemon installed on most common Linux distributions. +- [syslog-ng][3] is the second most popular syslog daemon for Linux. +- [logstash][4] is a heavier-weight agent that can do more advanced processing and parsing. +- [fluentd][5] is another agent with advanced processing capabilities. + +Rsyslog is the most popular daemon for centralizing your log data because it’s installed by default in most common distributions of Linux. You don’t need to download it or install it, and it’s lightweight so it won’t take up much of your system resources. + +If you need more advanced filtering or custom parsing capabilities, Logstash is the next most popular choice if you don’t mind the extra system footprint. + +### Configure Rsyslog.conf ### + +Since rsyslog is the most widely used syslog daemon, we’ll show how to configure it to centralize logs. The global configuration file is located at /etc/rsyslog.conf. It loads modules, sets global directives, and has an include for application-specific files located in the directory /etc/rsyslog.d/. This directory contains /etc/rsyslog.d/50-default.conf which instructs rsyslog to write the system logs to file. You can read more about the configuration files in the [rsyslog documentation][6]. + +The configuration language for rsyslog is [RainerScript][7]. You set up specific inputs for logs as well as actions to output them to another destination. Rsyslog already configures standard defaults for syslog input, so you usually just need to add an output to your log server. Here is an example configuration for rsyslog to output logs to an external server. In this example, **BEBOP** is the hostname of the server, so you should replace it with your own server name. + + action(type="omfwd" protocol="tcp" target="BEBOP" port="514") + +You could send your logs to a log server with ample storage to keep a copy for search, backup, and analysis. If you’re storing logs in the file system, then you should set up [log rotation][8] to keep your disk from getting full. + +Alternatively, you can send these logs to a log management solution. If your solution is installed locally you can send it to your local host and port as specified in your system documentation. If you use a cloud-based provider, you will send them to the hostname and port specified by your provider. + +### Log Directories ### + +You can centralize all the files in a directory or matching a wildcard pattern. The nxlog and syslog-ng daemons support both directories and wildcards (*). + +Common versions of rsyslog can’t monitor directories directly. As a workaround, you can setup a cron job to monitor the directory for new files, then configure rsyslog to send those files to a destination, such as your log management system. As an example, the log management vendor Loggly has an open source version of a [script to monitor directories][9]. + +### Which Protocol: UDP, TCP, or RELP? ### + +There are three main protocols that you can choose from when you transmit data over the Internet. The most common is UDP for your local network and TCP for the Internet. If you cannot lose logs, then use the more advanced RELP protocol. + +[UDP][10] sends a datagram packet, which is a single packet of information. It’s an outbound-only protocol, so it doesn’t send you an acknowledgement of receipt (ACK). It makes only one attempt to send the packet. UDP can be used to smartly degrade or drop logs when the network gets congested. It’s most commonly used on reliable networks like localhost. + +[TCP][11] sends streaming information in multiple packets and returns an ACK. TCP makes multiple attempts to send the packet, but is limited by the size of the [TCP buffer][12]. This is the most common protocol for sending logs over the Internet. + +[RELP][13] is the most reliable of these three protocols but was created for rsyslog and has less industry adoption. It acknowledges receipt of data in the application layer and will resend if there is an error. Make sure your destination also supports this protocol. + +### Reliably Send with Disk Assisted Queues ### + +If rsyslog encounters a problem when storing logs, such as an unavailable network connection, it can queue the logs until the connection is restored. The queued logs are stored in memory by default. However, memory is limited and if the problem persists, the logs can exceed memory capacity. + +**Warning: You can lose data if you store logs only in memory.** + +Rsyslog can queue your logs to disk when memory is full. [Disk-assisted queues][14] make transport of logs more reliable. Here is an example of how to configure rsyslog with a disk-assisted queue: + + $WorkDirectory /var/spool/rsyslog # where to place spool files + $ActionQueueFileName fwdRule1 # unique name prefix for spool files + $ActionQueueMaxDiskSpace 1g # 1gb space limit (use as much as possible) + $ActionQueueSaveOnShutdown on # save messages to disk on shutdown + $ActionQueueType LinkedList # run asynchronously + $ActionResumeRetryCount -1 # infinite retries if host is down + +### Encrypt Logs Using TLS ### + +When the security and privacy of your data is a concern, you should consider encrypting your logs. Sniffers and middlemen could read your log data if you transmit it over the Internet in clear text. You should encrypt your logs if they contain private information, sensitive identification data, or government-regulated data. The rsyslog daemon can encrypt your logs using the TLS protocol and keep your data safer. + +To set up TLS encryption, you need to do the following tasks: + +1. Generate a [certificate authority][15] (CA). There are sample certificates in /contrib/gnutls, which are good only for testing, but you need to create your own for production. If you’re using a log management service, it will have one ready for you. +1. Generate a [digital certificate][16] for your server to enable SSL operation, or use one from your log management service provider. +1. Configure your rsyslog daemon to send TLS-encrypted data to your log management system. + +Here’s an example rsyslog configuration with TLS encryption. Replace CERT and DOMAIN_NAME with your own server setting. + + $DefaultNetstreamDriverCAFile /etc/rsyslog.d/keys/ca.d/CERT.crt + $ActionSendStreamDriver gtls + $ActionSendStreamDriverMode 1 + $ActionSendStreamDriverAuthMode x509/name + $ActionSendStreamDriverPermittedPeer *.DOMAIN_NAME.com + +### Best Practices for Application Logging ### + +In addition to the logs that Linux creates by default, it’s also a good idea to centralize logs from important applications. Almost all Linux-based server class applications write their status information in separate, dedicated log files. This includes database products like PostgreSQL or MySQL, web servers like Nginx or Apache, firewalls, print and file sharing services, directory and DNS servers and so on. + +The first thing administrators do after installing an application is to configure it. Linux applications typically have a .conf file somewhere within the /etc directory. It can be somewhere else too, but that’s the first place where people look for configuration files. + +Depending on how complex or large the application is, the number of settable parameters can be few or in hundreds. As mentioned before, most applications would write their status in some sort of log file: configuration file is where log settings are defined among other things. + +If you’re not sure where it is, you can use the locate command to find it: + + [root@localhost ~]# locate postgresql.conf + /usr/pgsql-9.4/share/postgresql.conf.sample + /var/lib/pgsql/9.4/data/postgresql.conf + +#### Set a Standard Location for Log Files #### + +Linux systems typically save their log files under /var/log directory. This works fine, but check if the application saves under a specific directory under /var/log. If it does, great, if not, you may want to create a dedicated directory for the app under /var/log. Why? That’s because other applications save their log files under /var/log too and if your app saves more than one log file – perhaps once every day or after each service restart – it may be a bit difficult to trawl through a large directory to find the file you want. + +If you have the more than one instance of the application running in your network, this approach also comes handy. Think about a situation where you may have a dozen web servers running in your network. When troubleshooting any one of the boxes, you would know exactly where to go. + +#### Use A Standard Filename #### + +Use a standard filename for the latest logs from your application. This makes it easy because you can monitor and tail a single file. Many applications add some sort of date time stamp in them. This makes it much more difficult to find the latest file and to setup file monitoring by rsyslog. A better approach is to add timestamps to older log files using logrotate. This makes them easier to archive and search historically. + +#### Append the Log File #### + +Is the log file going to be overwritten after each application restart? If so, we recommend turning that off. After each restart the app should append to the log file. That way, you can always go back to the last log line before the restart. + +#### Appending vs. Rotation of Log File #### + +Even if the application writes a new log file after each restart, how is it saving in the current log? Is it appending to one single, massive file? Linux systems are not known for frequent reboots or crashes: applications can run for very long periods without even blinking, but that can also make the log file very large. If you are trying to analyze the root cause of a connection failure that happened last week, you could easily be searching through tens of thousands of lines. + +We recommend you configure the application to rotate its log file once every day, say at mid-night. + +Why? Well it becomes manageable for a starter. It’s much easier to find a file name with a specific date time pattern than to search through one file for that date’s entries. Files are also much smaller: you don’t think vi has frozen when you open a log file. Secondly, if you are sending the log file over the wire to a different location – perhaps a nightly backup job copying to a centralized log server – it doesn’t chew up your network’s bandwidth. Third and final, it helps with your log retention. If you want to cull old log entries, it’s easier to delete files older than a particular date than to have an application parsing one single large file. + +#### Retention of Log File #### + +How long do you keep a log file? That definitely comes down to business requirement. You could be asked to keep one week’s worth of logging information, or it may be a regulatory requirement to keep ten years’ worth of data. Whatever it is, logs need to go from the server at one time or other. + +In our opinion, unless otherwise required, keep at least a month’s worth of log files online, plus copy them to a secondary location like a logging server. Anything older than that can be offloaded to a separate media. For example, if you are on AWS, your older logs can be copied to Glacier. + +#### Separate Disk Location for Log Files #### + +Linux best practice usually suggests mounting the /var directory to a separate file system. This is because of the high number of I/Os associated with this directory. We would recommend mounting /var/log directory under a separate disk system. This can save I/O contention with the main application’s data. Also, if the number of log files becomes too large or the single log file becomes too big, it doesn’t fill up the entire disk. + +#### Log Entries #### + +What information should be captured in each log entry? + +That depends on what you want to use the log for. Do you want to use it only for troubleshooting purposes, or do you want to capture everything that’s happening? Is it a legal requirement to capture what each user is running or viewing? + +If you are using logs for troubleshooting purposes, save only errors, warnings or fatal messages. There’s no reason to capture debug messages, for example. The app may log debug messages by default or another administrator might have turned this on for another troubleshooting exercise, but you need to turn this off because it can definitely fill up the space quickly. At a minimum, capture the date, time, client application name, source IP or client host name, action performed and the message itself. + +#### A Practical Example for PostgreSQL #### + +As an example, let’s look at the main configuration file for a vanilla PostgreSQL 9.4 installation. It’s called postgresql.conf and contrary to other config files in Linux systems, it’s not saved under /etc directory. In the code snippet below, we can see it’s in /var/lib/pgsql directory of our CentOS 7 server: + + root@localhost ~]# vi /var/lib/pgsql/9.4/data/postgresql.conf + ... + #------------------------------------------------------------------------------ + # ERROR REPORTING AND LOGGING + #------------------------------------------------------------------------------ + # - Where to Log - + log_destination = 'stderr' + # Valid values are combinations of + # stderr, csvlog, syslog, and eventlog, + # depending on platform. csvlog + # requires logging_collector to be on. + # This is used when logging to stderr: + logging_collector = on + # Enable capturing of stderr and csvlog + # into log files. Required to be on for + # csvlogs. + # (change requires restart) + # These are only used if logging_collector is on: + log_directory = 'pg_log' + # directory where log files are written, + # can be absolute or relative to PGDATA + log_filename = 'postgresql-%a.log' # log file name pattern, + # can include strftime() escapes + # log_file_mode = 0600 . + # creation mode for log files, + # begin with 0 to use octal notation + log_truncate_on_rotation = on # If on, an existing log file with the + # same name as the new log file will be + # truncated rather than appended to. + # But such truncation only occurs on + # time-driven rotation, not on restarts + # or size-driven rotation. Default is + # off, meaning append to existing files + # in all cases. + log_rotation_age = 1d + # Automatic rotation of logfiles will happen after that time. 0 disables. + log_rotation_size = 0 # Automatic rotation of logfiles will happen after that much log output. 0 disables. + # These are relevant when logging to syslog: + #syslog_facility = 'LOCAL0' + #syslog_ident = 'postgres' + # This is only relevant when logging to eventlog (win32): + #event_source = 'PostgreSQL' + # - When to Log - + #client_min_messages = notice # values in order of decreasing detail: + # debug5 + # debug4 + # debug3 + # debug2 + # debug1 + # log + # notice + # warning + # error + #log_min_messages = warning # values in order of decreasing detail: + # debug5 + # debug4 + # debug3 + # debug2 + # debug1 + # info + # notice + # warning + # error + # log + # fatal + # panic + #log_min_error_statement = error # values in order of decreasing detail: + # debug5 + # debug4 + # debug3 + # debug2 + # debug1 + # info + # notice + # warning + # error + # log + # fatal + # panic (effectively off) + #log_min_duration_statement = -1 # -1 is disabled, 0 logs all statements + # and their durations, > 0 logs only + # statements running at least this number + # of milliseconds + # - What to Log + #debug_print_parse = off + #debug_print_rewritten = off + #debug_print_plan = off + #debug_pretty_print = on + #log_checkpoints = off + #log_connections = off + #log_disconnections = off + #log_duration = off + #log_error_verbosity = default + # terse, default, or verbose messages + #log_hostname = off + log_line_prefix = '< %m >' # special values: + # %a = application name + # %u = user name + # %d = database name + # %r = remote host and port + # %h = remote host + # %p = process ID + # %t = timestamp without milliseconds + # %m = timestamp with milliseconds + # %i = command tag + # %e = SQL state + # %c = session ID + # %l = session line number + # %s = session start timestamp + # %v = virtual transaction ID + # %x = transaction ID (0 if none) + # %q = stop here in non-session + # processes + # %% = '%' + # e.g. '<%u%%%d> ' + #log_lock_waits = off # log lock waits >= deadlock_timeout + #log_statement = 'none' # none, ddl, mod, all + #log_temp_files = -1 # log temporary files equal or larger + # than the specified size in kilobytes;5# -1 disables, 0 logs all temp files5 + log_timezone = 'Australia/ACT' + +Although most parameters are commented out, they assume default values. We can see the log file directory is pg_log (log_directory parameter), the file names should start with postgresql (log_filename parameter), the files are rotated once every day (log_rotation_age parameter) and the log entries start with a timestamp (log_line_prefix parameter). Of particular interest is the log_line_prefix parameter: there is a whole gamut of information you can include there. + +Looking under /var/lib/pgsql/9.4/data/pg_log directory shows us these files: + + [root@localhost ~]# ls -l /var/lib/pgsql/9.4/data/pg_log + total 20 + -rw-------. 1 postgres postgres 1212 May 1 20:11 postgresql-Fri.log + -rw-------. 1 postgres postgres 243 Feb 9 21:49 postgresql-Mon.log + -rw-------. 1 postgres postgres 1138 Feb 7 11:08 postgresql-Sat.log + -rw-------. 1 postgres postgres 1203 Feb 26 21:32 postgresql-Thu.log + -rw-------. 1 postgres postgres 326 Feb 10 01:20 postgresql-Tue.log + +So the log files only have the name of the weekday stamped in the file name. We can change it. How? Configure the log_filename parameter in postgresql.conf. + +Looking inside one log file shows its entries start with date time only: + + [root@localhost ~]# cat /var/lib/pgsql/9.4/data/pg_log/postgresql-Fri.log + ... + < 2015-02-27 01:21:27.020 EST >LOG: received fast shutdown request + < 2015-02-27 01:21:27.025 EST >LOG: aborting any active transactions + < 2015-02-27 01:21:27.026 EST >LOG: autovacuum launcher shutting down + < 2015-02-27 01:21:27.036 EST >LOG: shutting down + < 2015-02-27 01:21:27.211 EST >LOG: database system is shut down + +### Centralizing Application Logs ### + +#### Log File Monitoring with Imfile #### + +Traditionally, the most common way for applications to log their data is with files. Files are easy to search on a single machine but don’t scale well with more servers. You can set up log file monitoring and send the events to a centralized server when new logs are appended to the bottom. Create a new configuration file in /etc/rsyslog.d/ then add a file input like this: + + $ModLoad imfile + $InputFilePollInterval 10 + $PrivDropToGroup adm + +---------- + + # Input for FILE1 + $InputFileName /FILE1 + $InputFileTag APPNAME1 + $InputFileStateFile stat-APPNAME1 #this must be unique for each file being polled + $InputFileSeverity info + $InputFilePersistStateInterval 20000 + $InputRunFileMonitor + +Replace FILE1 and APPNAME1 with your own file and application names. Rsyslog will send it to the outputs you have configured. + +#### Local Socket Logs with Imuxsock #### + +A socket is similar to a UNIX file handle except that the socket is read into memory by your syslog daemon and then sent to the destination. No file needs to be written. As an example, the logger command sends its logs to this UNIX socket. + +This approach makes efficient use of system resources if your server is constrained by disk I/O or you have no need for local file logs. The disadvantage of this approach is that the socket has a limited queue size. If your syslog daemon goes down or can’t keep up, then you could lose log data. + +The rsyslog daemon will read from the /dev/log socket by default, but you can specifically enable it with the [imuxsock input module][17] using the following command: + + $ModLoad imuxsock + +#### UDP Logs with Imupd #### + +Some applications output log data in UDP format, which is the standard syslog protocol when transferring log files over a network or your localhost. Your syslog daemon receives these logs and can process them or transmit them in a different format. Alternately, you can send the logs to your log server or to a log management solution. + +Use the following command to configure rsyslog to accept syslog data over UDP on the standard port 514: + + $ModLoad imudp + +---------- + + $UDPServerRun 514 + +### Manage Logs with Logrotate ### + +Log rotation is a process that archives log files automatically when they reach a specified age. Without intervention, log files keep growing, using up disk space. Eventually they will crash your machine. + +The logrotate utility can truncate your logs as they age, freeing up space. Your new log file retains the filename. Your old log file is renamed with a number appended to the end of it. Each time the logrotate utility runs, a new file is created and the existing file is renamed in sequence. You determine the threshold when old files are deleted or archived. + +When logrotate copies a file, the new file has a new inode, which can interfere with rsyslog’s ability to monitor the new file. You can alleviate this issue by adding the copytruncate parameter to your logrotate cron job. This parameter copies existing log file contents to a new file and truncates these contents from the existing file. The inode never changes because the log file itself remains the same; its contents are in a new file. + +The logrotate utility uses the main configuration file at /etc/logrotate.conf and application-specific settings in the directory /etc/logrotate.d/. DigitalOcean has a detailed [tutorial on logrotate][18]. + +### Manage Configuration on Many Servers ### + +When you have just a few servers, you can manually configure logging on them. Once you have a few dozen or more servers, you can take advantage of tools that make this easier and more scalable. At a basic level, all of these copy your rsyslog configuration to each server, and then restart rsyslog so the changes take effect. + +#### Pssh #### + +This tool lets you run an ssh command on several servers in parallel. Use a pssh deployment for only a small number of servers. If one of your servers fails, then you have to ssh into the failed server and do the deployment manually. If you have several failed servers, then the manual deployment on them can take a long time. + +#### Puppet/Chef #### + +Puppet and Chef are two different tools that can automatically configure all of the servers in your network to a specified standard. Their reporting tools let you know about failures and can resync periodically. Both Puppet and Chef have enthusiastic supporters. If you aren’t sure which one is more suitable for your deployment configuration management, you might appreciate [InfoWorld’s comparison of the two tools][19]. + +Some vendors also offer modules or recipes for configuring rsyslog. Here is an example from Loggly’s Puppet module. It offers a class for rsyslog to which you can add an identifying token: + + node 'my_server_node.example.net' { + # Send syslog events to Loggly + class { 'loggly::rsyslog': + customer_token => 'de7b5ccd-04de-4dc4-fbc9-501393600000', + } + } + +#### Docker #### + +Docker uses containers to run applications independent of the underlying server. Everything runs from inside a container, which you can think of as a unit of functionality. ZDNet has an in-depth article about [using Docker][20] in your data center. + +There are several ways to log from Docker containers including linking to a logging container, logging to a shared volume, or adding a syslog agent directly inside the container. One of the most popular logging containers is called [logspout][21]. + +#### Vendor Scripts or Agents #### + +Most log management solutions offer scripts or agents to make sending data from one or more servers relatively easy. Heavyweight agents can use up extra system resources. Some vendors like Loggly offer configuration scripts to make using existing syslog daemons easier. Here is an example [script][22] from Loggly which can run on any number of servers. + +-------------------------------------------------------------------------------- + +via: http://www.loggly.com/ultimate-guide/logging/managing-linux-logs/ + +作者:[Jason Skowronski][a1] +作者:[Amy Echeverri][a2] +作者:[Sadequl Hussain][a3] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a1]:https://www.linkedin.com/in/jasonskowronski +[a2]:https://www.linkedin.com/in/amyecheverri +[a3]:https://www.linkedin.com/pub/sadequl-hussain/14/711/1a7 +[1]:https://docs.google.com/document/d/11LXZxWlkNSHkcrCWTUdnLRf_CiZz9kK0cr3yGM_BU_0/edit#heading=h.esrreycnpnbl +[2]:http://www.rsyslog.com/ +[3]:http://www.balabit.com/network-security/syslog-ng/opensource-logging-system +[4]:http://logstash.net/ +[5]:http://www.fluentd.org/ +[6]:http://www.rsyslog.com/doc/rsyslog_conf.html +[7]:http://www.rsyslog.com/doc/master/rainerscript/index.html +[8]:https://docs.google.com/document/d/11LXZxWlkNSHkcrCWTUdnLRf_CiZz9kK0cr3yGM_BU_0/edit#heading=h.eck7acdxin87 +[9]:https://www.loggly.com/docs/file-monitoring/ +[10]:http://www.networksorcery.com/enp/protocol/udp.htm +[11]:http://www.networksorcery.com/enp/protocol/tcp.htm +[12]:http://blog.gerhards.net/2008/04/on-unreliability-of-plain-tcp-syslog.html +[13]:http://www.rsyslog.com/doc/relp.html +[14]:http://www.rsyslog.com/doc/queues.html +[15]:http://www.rsyslog.com/doc/tls_cert_ca.html +[16]:http://www.rsyslog.com/doc/tls_cert_machine.html +[17]:http://www.rsyslog.com/doc/v8-stable/configuration/modules/imuxsock.html +[18]:https://www.digitalocean.com/community/tutorials/how-to-manage-log-files-with-logrotate-on-ubuntu-12-10 +[19]:http://www.infoworld.com/article/2614204/data-center/puppet-or-chef--the-configuration-management-dilemma.html +[20]:http://www.zdnet.com/article/what-is-docker-and-why-is-it-so-darn-popular/ +[21]:https://github.com/progrium/logspout +[22]:https://www.loggly.com/docs/sending-logs-unixlinux-system-setup/ \ No newline at end of file diff --git a/sources/tech/20150803 Troubleshooting with Linux Logs.md b/sources/tech/20150803 Troubleshooting with Linux Logs.md new file mode 100644 index 0000000000..8f595427a9 --- /dev/null +++ b/sources/tech/20150803 Troubleshooting with Linux Logs.md @@ -0,0 +1,116 @@ +Troubleshooting with Linux Logs +================================================================================ +Troubleshooting is the main reason people create logs. Often you’ll want to diagnose why a problem happened with your Linux system or application. An error message or a sequence of events can give you clues to the root cause, indicate how to reproduce the issue, and point out ways to fix it. Here are a few use cases for things you might want to troubleshoot in your logs. + +### Cause of Login Failures ### + +If you want to check if your system is secure, you can check your authentication logs for failed login attempts and unfamiliar successes. Authentication failures occur when someone passes incorrect or otherwise invalid login credentials, often to ssh for remote access or su for local access to another user’s permissions. These are logged by the [pluggable authentication module][1], or pam for short. Look in your logs for strings like Failed password and user unknown. Successful authentication records include strings like Accepted password and session opened. + +Failure Examples: + + pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=10.0.2.2 + Failed password for invalid user hoover from 10.0.2.2 port 4791 ssh2 + pam_unix(sshd:auth): check pass; user unknown + PAM service(sshd) ignoring max retries; 6 > 3 + +Success Examples: + + Accepted password for hoover from 10.0.2.2 port 4792 ssh2 + pam_unix(sshd:session): session opened for user hoover by (uid=0) + pam_unix(sshd:session): session closed for user hoover + +You can use grep to find which users accounts have the most failed logins. These are the accounts that potential attackers are trying and failing to access. This example is for an Ubuntu system. + + $ grep "invalid user" /var/log/auth.log | cut -d ' ' -f 10 | sort | uniq -c | sort -nr + 23 oracle + 18 postgres + 17 nagios + 10 zabbix + 6 test + +You’ll need to write a different command for each application and message because there is no standard format. Log management systems that automatically parse logs will effectively normalize them and help you extract key fields like username. + +Log management systems can extract the usernames from your Linux logs using automated parsing. This lets you see an overview of the users and filter on them with a single click. In this example, we can see that the root user logged in over 2,700 times because we are filtering the logs to show login attempts only for the root user. + +![](http://www.loggly.com/ultimate-guide/wp-content/uploads/2015/05/Screen-Shot-2015-03-12-at-11.05.36-AM.png) + +Log management systems also let you view graphs over time to spot unusual trends. If someone had one or two failed logins within a few minutes, it might be that a real user forgot his or her password. However, if there are hundreds of failed logins or they are all different usernames, it’s more likely that someone is trying to attack the system. Here you can see that on March 12, someone tried to login as test and nagios several hundred times. This is clearly not a legitimate use of the system. + +![](http://www.loggly.com/ultimate-guide/wp-content/uploads/2015/05/Screen-Shot-2015-03-12-at-11.12.18-AM.png) + +### Cause of Reboots ### + +Sometimes a server can stop due to a system crash or reboot. How do you know when it happened and who did it? + +#### Shutdown Command #### + +If someone ran the shutdown command manually, you can see it in the auth log file. Here you can see that someone remotely logged in from the IP 50.0.134.125 as the user ubuntu and then shut the system down. + + Mar 19 18:36:41 ip-172-31-11-231 sshd[23437]: Accepted publickey for ubuntu from 50.0.134.125 port 52538 ssh + Mar 19 18:36:41 ip-172-31-11-231 23437]:sshd[ pam_unix(sshd:session): session opened for user ubuntu by (uid=0) + Mar 19 18:37:09 ip-172-31-11-231 sudo: ubuntu : TTY=pts/1 ; PWD=/home/ubuntu ; USER=root ; COMMAND=/sbin/shutdown -r now + +#### Kernel Initializing #### + +If you want to see when the server restarted regardless of reason (including crashes) you can search logs from the kernel initializing. You’d search for the facility kernel messages and Initializing cpu. + + Mar 19 18:39:30 ip-172-31-11-231 kernel: [ 0.000000] Initializing cgroup subsys cpuset + Mar 19 18:39:30 ip-172-31-11-231 kernel: [ 0.000000] Initializing cgroup subsys cpu + Mar 19 18:39:30 ip-172-31-11-231 kernel: [ 0.000000] Linux version 3.8.0-44-generic (buildd@tipua) (gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5) ) #66~precise1-Ubuntu SMP Tue Jul 15 04:01:04 UTC 2014 (Ubuntu 3.8.0-44.66~precise1-generic 3.8.13.25) + +### Detect Memory Problems ### + +There are lots of reasons a server might crash, but one common cause is running out of memory. + +When your system is low on memory, processes are killed, typically in the order of which ones will release the most resources. The error occurs when your system is using all of its memory and a new or existing process attempts to access additional memory. Look in your log files for strings like Out of Memory or for kernel warnings like to kill. These strings indicate that your system intentionally killed the process or application rather than allowing the process to crash. + +Examples: + + [33238.178288] Out of memory: Kill process 6230 (firefox) score 53 or sacrifice child + [29923450.995084] select 5230 (docker), adj 0, size 708, to kill + +You can find these logs using a tool like grep. This example is for Ubuntu: + + $ grep “Out of memory” /var/log/syslog + [33238.178288] Out of memory: Kill process 6230 (firefox) score 53 or sacrifice child + +Keep in mind that grep itself uses memory, so you might cause an out of memory error just by running grep. This is another reason it’s a fabulous idea to centralize your logs! + +### Log Cron Job Errors ### + +The cron daemon is a scheduler that runs processes at specified dates and times. If the process fails to run or fails to finish, then a cron error appears in your log files. You can find these files in /var/log/cron, /var/log/messages, and /var/log/syslog depending on your distribution. There are many reasons a cron job can fail. Usually the problems lie with the process rather than the cron daemon itself. + +By default, cron jobs output through email using Postfix. Here is a log showing that an email was sent. Unfortunately, you cannot see the contents of the message here. + + Mar 13 16:35:01 PSQ110 postfix/pickup[15158]: C3EDC5800B4: uid=1001 from= + Mar 13 16:35:01 PSQ110 postfix/cleanup[15727]: C3EDC5800B4: message-id=<20150310110501.C3EDC5800B4@PSQ110> + Mar 13 16:35:01 PSQ110 postfix/qmgr[15159]: C3EDC5800B4: from=, size=607, nrcpt=1 (queue active) + Mar 13 16:35:05 PSQ110 postfix/smtp[15729]: C3EDC5800B4: to=, relay=gmail-smtp-in.l.google.com[74.125.130.26]:25, delay=4.1, delays=0.26/0/2.2/1.7, dsn=2.0.0, status=sent (250 2.0.0 OK 1425985505 f16si501651pdj.5 - gsmtp) + +You should consider logging the cron standard output to help debug problems. Here is how you can redirect your cron standard output to syslog using the logger command. Replace the echo command with your own script and helloCron with whatever you want to set the appName to. + + */5 * * * * echo ‘Hello World’ 2>&1 | /usr/bin/logger -t helloCron + +Which creates the log entries: + + Apr 28 22:20:01 ip-172-31-11-231 CRON[15296]: (ubuntu) CMD (echo 'Hello World!' 2>&1 | /usr/bin/logger -t helloCron) + Apr 28 22:20:01 ip-172-31-11-231 helloCron: Hello World! + +Each cron job will log differently based on the specific type of job and how it outputs data. Hopefully there are clues to the root cause of problems within the logs, or you can add additional logging as needed. + +-------------------------------------------------------------------------------- + +via: http://www.loggly.com/ultimate-guide/logging/troubleshooting-with-linux-logs/ + +作者:[Jason Skowronski][a1] +作者:[Amy Echeverri][a2] +作者:[Sadequl Hussain][a3] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a1]:https://www.linkedin.com/in/jasonskowronski +[a2]:https://www.linkedin.com/in/amyecheverri +[a3]:https://www.linkedin.com/pub/sadequl-hussain/14/711/1a7 +[1]:http://linux.die.net/man/8/pam.d \ No newline at end of file From c06d768d03a95906e23bb18e5f4db16df178c668 Mon Sep 17 00:00:00 2001 From: struggling <630441839@qq.com> Date: Mon, 3 Aug 2015 19:52:52 +0800 Subject: [PATCH 781/965] Update 20150803 Handy commands for profiling your Unix file systems.md --- ...0803 Handy commands for profiling your Unix file systems.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150803 Handy commands for profiling your Unix file systems.md b/sources/tech/20150803 Handy commands for profiling your Unix file systems.md index ae5951b0d7..359aba14c9 100644 --- a/sources/tech/20150803 Handy commands for profiling your Unix file systems.md +++ b/sources/tech/20150803 Handy commands for profiling your Unix file systems.md @@ -1,3 +1,4 @@ +translation by strugglingyouth Handy commands for profiling your Unix file systems ================================================================================ ![Credit: Sandra H-S](http://images.techhive.com/images/article/2015/07/file-profile-100597239-primary.idge.png) @@ -61,4 +62,4 @@ via: http://www.itworld.com/article/2949898/linux/profiling-your-file-systems.ht 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 -[a]:http://www.itworld.com/author/Sandra-Henry_Stocker/ \ No newline at end of file +[a]:http://www.itworld.com/author/Sandra-Henry_Stocker/ From 6660ef7b90c207bfa032b6db21ae448434ecfa47 Mon Sep 17 00:00:00 2001 From: struggling <630441839@qq.com> Date: Mon, 3 Aug 2015 19:55:12 +0800 Subject: [PATCH 782/965] Update 20150803 Troubleshooting with Linux Logs.md --- sources/tech/20150803 Troubleshooting with Linux Logs.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150803 Troubleshooting with Linux Logs.md b/sources/tech/20150803 Troubleshooting with Linux Logs.md index 8f595427a9..9ee0820a9c 100644 --- a/sources/tech/20150803 Troubleshooting with Linux Logs.md +++ b/sources/tech/20150803 Troubleshooting with Linux Logs.md @@ -1,3 +1,4 @@ +translation by strugglingyouth Troubleshooting with Linux Logs ================================================================================ Troubleshooting is the main reason people create logs. Often you’ll want to diagnose why a problem happened with your Linux system or application. An error message or a sequence of events can give you clues to the root cause, indicate how to reproduce the issue, and point out ways to fix it. Here are a few use cases for things you might want to troubleshoot in your logs. @@ -113,4 +114,4 @@ via: http://www.loggly.com/ultimate-guide/logging/troubleshooting-with-linux-log [a1]:https://www.linkedin.com/in/jasonskowronski [a2]:https://www.linkedin.com/in/amyecheverri [a3]:https://www.linkedin.com/pub/sadequl-hussain/14/711/1a7 -[1]:http://linux.die.net/man/8/pam.d \ No newline at end of file +[1]:http://linux.die.net/man/8/pam.d From 59b2f6c25fc31bc791983d869f02b3f2bf97d78a Mon Sep 17 00:00:00 2001 From: ictlyh Date: Mon, 3 Aug 2015 20:21:50 +0800 Subject: [PATCH 783/965] [Translated] tech/20150504 How to access a Linux server behind NAT via reverse SSH tunnel.md --- ...erver behind NAT via reverse SSH tunnel.md | 131 ------------------ ...erver behind NAT via reverse SSH tunnel.md | 131 ++++++++++++++++++ ...Two Devices’ Using ‘mdadm’ Tool in Linux – Part 2.md} | 0 ...oncepts of RAID and RAID Levels – Part 1.md} | 0 4 files changed, 131 insertions(+), 131 deletions(-) delete mode 100644 sources/tech/20150504 How to access a Linux server behind NAT via reverse SSH tunnel.md create mode 100644 translated/tech/20150504 How to access a Linux server behind NAT via reverse SSH tunnel.md rename translated/tech/{Creating Software RAID0 (Stripe) on ‘Two Devices’ Using ‘mdadm’ Tool in Linux – Part 2 => Creating Software RAID0 (Stripe) on ‘Two Devices’ Using ‘mdadm’ Tool in Linux – Part 2.md} (100%) rename translated/tech/{Introduction to RAID, Concepts of RAID and RAID Levels – Part 1 => Introduction to RAID, Concepts of RAID and RAID Levels – Part 1.md} (100%) diff --git a/sources/tech/20150504 How to access a Linux server behind NAT via reverse SSH tunnel.md b/sources/tech/20150504 How to access a Linux server behind NAT via reverse SSH tunnel.md deleted file mode 100644 index 4239073013..0000000000 --- a/sources/tech/20150504 How to access a Linux server behind NAT via reverse SSH tunnel.md +++ /dev/null @@ -1,131 +0,0 @@ -ictlyh Translating -How to access a Linux server behind NAT via reverse SSH tunnel -================================================================================ -You are running a Linux server at home, which is behind a NAT router or restrictive firewall. Now you want to SSH to the home server while you are away from home. How would you set that up? SSH port forwarding will certainly be an option. However, port forwarding can become tricky if you are dealing with multiple nested NAT environment. Besides, it can be interfered with under various ISP-specific conditions, such as restrictive ISP firewalls which block forwarded ports, or carrier-grade NAT which shares IPv4 addresses among users. - -### What is Reverse SSH Tunneling? ### - -One alternative to SSH port forwarding is **reverse SSH tunneling**. The concept of reverse SSH tunneling is simple. For this, you will need another host (so-called "relay host") outside your restrictive home network, which you can connect to via SSH from where you are. You could set up a relay host using a [VPS instance][1] with a public IP address. What you do then is to set up a persistent SSH tunnel from the server in your home network to the public relay host. With that, you can connect "back" to the home server from the relay host (which is why it's called a "reverse" tunnel). As long as the relay host is reachable to you, you can connect to your home server wherever you are, or however restrictive your NAT or firewall is in your home network. - -![](https://farm8.staticflickr.com/7742/17162647378_c7d9f10de8_b.jpg) - -### Set up a Reverse SSH Tunnel on Linux ### - -Let's see how we can create and use a reverse SSH tunnel. We assume the following. We will be setting up a reverse SSH tunnel from homeserver to relayserver, so that we can SSH to homeserver via relayserver from another computer called clientcomputer. The public IP address of **relayserver** is 1.1.1.1. - -On homeserver, open an SSH connection to relayserver as follows. - - homeserver~$ ssh -fN -R 10022:localhost:22 relayserver_user@1.1.1.1 - -Here the port 10022 is any arbitrary port number you can choose. Just make sure that this port is not used by other programs on relayserver. - -The "-R 10022:localhost:22" option defines a reverse tunnel. It forwards traffic on port 10022 of relayserver to port 22 of homeserver. - -With "-fN" option, SSH will go right into the background once you successfully authenticate with an SSH server. This option is useful when you do not want to execute any command on a remote SSH server, and just want to forward ports, like in our case. - -After running the above command, you will be right back to the command prompt of homeserver. - -Log in to relayserver, and verify that 127.0.0.1:10022 is bound to sshd. If so, that means a reverse tunnel is set up correctly. - - relayserver~$ sudo netstat -nap | grep 10022 - ----------- - - tcp 0 0 127.0.0.1:10022 0.0.0.0:* LISTEN 8493/sshd - -Now from any other computer (e.g., clientcomputer), log in to relayserver. Then access homeserver as follows. - - relayserver~$ ssh -p 10022 homeserver_user@localhost - -One thing to take note is that the SSH login/password you type for localhost should be for homeserver, not for relayserver, since you are logging in to homeserver via the tunnel's local endpoint. So do not type login/password for relayserver. After successful login, you will be on homeserver. - -### Connect Directly to a NATed Server via a Reverse SSH Tunnel ### - -While the above method allows you to reach **homeserver** behind NAT, you need to log in twice: first to **relayserver**, and then to **homeserver**. This is because the end point of an SSH tunnel on relayserver is binding to loopback address (127.0.0.1). - -But in fact, there is a way to reach NATed homeserver directly with a single login to relayserver. For this, you will need to let sshd on relayserver forward a port not only from loopback address, but also from an external host. This is achieved by specifying **GatewayPorts** option in sshd running on relayserver. - -Open /etc/ssh/sshd_conf of **relayserver** and add the following line. - - relayserver~$ vi /etc/ssh/sshd_conf - ----------- - - GatewayPorts clientspecified - -Restart sshd. - -Debian-based system: - - relayserver~$ sudo /etc/init.d/ssh restart - -Red Hat-based system: - - relayserver~$ sudo systemctl restart sshd - -Now let's initiate a reverse SSH tunnel from homeserver as follows. -homeserver~$ ssh -fN -R 1.1.1.1:10022:localhost:22 relayserver_user@1.1.1.1 - -Log in to relayserver and confirm with netstat command that a reverse SSH tunnel is established successfully. - - relayserver~$ sudo netstat -nap | grep 10022 - ----------- - - tcp 0 0 1.1.1.1:10022 0.0.0.0:* LISTEN 1538/sshd: dev - -Unlike a previous case, the end point of a tunnel is now at 1.1.1.1:10022 (relayserver's public IP address), not 127.0.0.1:10022. This means that the end point of the tunnel is reachable from an external host. - -Now from any other computer (e.g., clientcomputer), type the following command to gain access to NATed homeserver. - - clientcomputer~$ ssh -p 10022 homeserver_user@1.1.1.1 - -In the above command, while 1.1.1.1 is the public IP address of relayserver, homeserver_user must be the user account associated with homeserver. This is because the real host you are logging in to is homeserver, not relayserver. The latter simply relays your SSH traffic to homeserver. - -### Set up a Persistent Reverse SSH Tunnel on Linux ### - -Now that you understand how to create a reverse SSH tunnel, let's make the tunnel "persistent", so that the tunnel is up and running all the time (regardless of temporary network congestion, SSH timeout, relay host rebooting, etc.). After all, if the tunnel is not always up, you won't be able to connect to your home server reliably. - -For a persistent tunnel, I am going to use a tool called autossh. As the name implies, this program allows you to automatically restart an SSH session should it breaks for any reason. So it is useful to keep a reverse SSH tunnel active. - -As the first step, let's set up [passwordless SSH login][2] from homeserver to relayserver. That way, autossh can restart a broken reverse SSH tunnel without user's involvement. - -Next, [install autossh][3] on homeserver where a tunnel is initiated. - -From homeserver, run autossh with the following arguments to create a persistent SSH tunnel destined to relayserver. - - homeserver~$ autossh -M 10900 -fN -o "PubkeyAuthentication=yes" -o "StrictHostKeyChecking=false" -o "PasswordAuthentication=no" -o "ServerAliveInterval 60" -o "ServerAliveCountMax 3" -R 1.1.1.1:10022:localhost:22 relayserver_user@1.1.1.1 - -The "-M 10900" option specifies a monitoring port on relayserver which will be used to exchange test data to monitor an SSH session. This port should not be used by any program on relayserver. - -The "-fN" option is passed to ssh command, which will let the SSH tunnel run in the background. - -The "-o XXXX" options tell ssh to: - -- Use key authentication, not password authentication. -- Automatically accept (unknown) SSH host keys. -- Exchange keep-alive messages every 60 seconds. -- Send up to 3 keep-alive messages without receiving any response back. - -The rest of reverse SSH tunneling related options remain the same as before. - -If you want an SSH tunnel to be automatically up upon boot, you can add the above autossh command in /etc/rc.local. - -### Conclusion ### - -In this post, I talked about how you can use a reverse SSH tunnel to access a Linux server behind a restrictive firewall or NAT gateway from outside world. While I demonstrated its use case for a home network, you must be careful when applying it for corporate networks. Such a tunnel can be considered as a breach of a corporate policy, as it circumvents corporate firewalls and can expose corporate networks to outside attacks. There is a great chance it can be misused or abused. So always remember its implication before setting it up. - --------------------------------------------------------------------------------- - -via: http://xmodulo.com/access-linux-server-behind-nat-reverse-ssh-tunnel.html - -作者:[Dan Nanni][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://xmodulo.com/author/nanni -[1]:http://xmodulo.com/go/digitalocean -[2]:http://xmodulo.com/how-to-enable-ssh-login-without.html -[3]:http://ask.xmodulo.com/install-autossh-linux.html diff --git a/translated/tech/20150504 How to access a Linux server behind NAT via reverse SSH tunnel.md b/translated/tech/20150504 How to access a Linux server behind NAT via reverse SSH tunnel.md new file mode 100644 index 0000000000..5f9828e912 --- /dev/null +++ b/translated/tech/20150504 How to access a Linux server behind NAT via reverse SSH tunnel.md @@ -0,0 +1,131 @@ +如何通过反向 SSH 隧道访问 NAT 后面的 Linux 服务器 +================================================================================ +你在家里运行着一台 Linux 服务器,访问它需要先经过 NAT 路由器或者限制性防火墙。现在你想不在家的时候用 SSH 登录到这台服务器。你如何才能做到呢?SSH 端口转发当然是一种选择。但是,如果你需要处理多个嵌套的 NAT 环境,端口转发可能会变得非常棘手。另外,在多种 ISP 特定条件下可能会受到干扰,例如阻塞转发端口的限制性 ISP 防火墙、或者在用户间共享 IPv4 地址的运营商级 NAT。 + +### 什么是反向 SSH 隧道? ### + +SSH 端口转发的一种替代方案是 **反向 SSH 隧道**。反向 SSH 隧道的概念非常简单。对于此,在限制性家庭网络之外你需要另一台主机(所谓的“中继主机”),你能从当前所在地通过 SSH 登录。你可以用有公共 IP 地址的 [VPS 实例][1] 配置一个中继主机。然后要做的就是从你家庭网络服务器中建立一个到公共中继主机的永久 SSH 隧道。有了这个隧道,你就可以从中继主机中连接“回”家庭服务器(这就是为什么称之为 “反向” 隧道)。不管你在哪里、你家庭网络中的 NAT 或 防火墙限制多么严重,只要你可以访问中继主机,你就可以连接到家庭服务器。 + +![](https://farm8.staticflickr.com/7742/17162647378_c7d9f10de8_b.jpg) + +### 在 Linux 上设置反向 SSH 隧道 ### + +让我们来看看怎样创建和使用反向 SSH 隧道。我们有如下假设。我们会设置一个从家庭服务器到中继服务器的反向 SSH 隧道,然后我们可以通过中继服务器从客户端计算机 SSH 登录到家庭服务器。**中继服务器** 的公共 IP 地址是 1.1.1.1。 + +在家庭主机上,按照以下方式打开一个到中继服务器的 SSH 连接。 + + homeserver~$ ssh -fN -R 10022:localhost:22 relayserver_user@1.1.1.1 + +这里端口 10022 是任何你可以使用的端口数字。只需要确保中继服务器上不会有其它程序使用这个端口。 + +“-R 10022:localhost:22” 选项定义了一个反向隧道。它转发中继服务器 10022 端口的流量到家庭服务器的 22 号端口。 + +用 “-fN” 选项,当你用一个 SSH 服务器成功通过验证时 SSH 会进入后台运行。当你不想在远程 SSH 服务器执行任何命令、就像我们的例子中只想转发端口的时候非常有用。 + +运行上面的命令之后,你就会回到家庭主机的命令行提示框中。 + +登录到中继服务器,确认 127.0.0.1:10022 绑定到了 sshd。如果是的话就表示已经正确设置了反向隧道。 + + relayserver~$ sudo netstat -nap | grep 10022 + +---------- + + tcp 0 0 127.0.0.1:10022 0.0.0.0:* LISTEN 8493/sshd + +现在就可以从任何其它计算机(客户端计算机)登录到中继服务器,然后按照下面的方法访问家庭服务器。 + + relayserver~$ ssh -p 10022 homeserver_user@localhost + +需要注意的一点是你在本地输入的 SSH 登录/密码应该是家庭服务器的,而不是中继服务器的,因为你是通过隧道的本地端点登录到家庭服务器。因此不要输入中继服务器的登录/密码。成功登陆后,你就在家庭服务器上了。 + +### 通过反向 SSH 隧道直接连接到网络地址变换后的服务器 ### + +上面的方法允许你访问 NAT 后面的 **家庭服务器**,但你需要登录两次:首先登录到 **中继服务器**,然后再登录到**家庭服务器**。这是因为中继服务器上 SSH 隧道的端点绑定到了回环地址(127.0.0.1)。 + +事实上,有一种方法可以只需要登录到中继服务器就能直接访问网络地址变换之后的家庭服务器。要做到这点,你需要让中继服务器上的 sshd 不仅转发回环地址上的端口,还要转发外部主机的端口。这通过指定中继服务器上运行的 sshd 的 **网关端口** 实现。 + +打开**中继服务器**的 /etc/ssh/sshd_conf 并添加下面的行。 + + relayserver~$ vi /etc/ssh/sshd_conf + +---------- + + GatewayPorts clientspecified + +重启 sshd。 + +基于 Debian 的系统: + + relayserver~$ sudo /etc/init.d/ssh restart + +基于红帽的系统: + + relayserver~$ sudo systemctl restart sshd + +现在在家庭服务器中按照下面方式初始化一个反向 SSH 隧道。 + + homeserver~$ ssh -fN -R 1.1.1.1:10022:localhost:22 relayserver_user@1.1.1.1 + +登录到中继服务器然后用 netstat 命令确认成功建立的一个反向 SSH 隧道。 + + relayserver~$ sudo netstat -nap | grep 10022 + +---------- + + tcp 0 0 1.1.1.1:10022 0.0.0.0:* LISTEN 1538/sshd: dev + +不像之前的情况,现在隧道的端点是 1.1.1.1:10022(中继服务器的公共 IP 地址),而不是 127.0.0.1:10022。这就意味着从外部主机可以访问隧道的端点。 + +现在在任何其它计算机(客户端计算机),输入以下命令访问网络地址变换之后的家庭服务器。 + + clientcomputer~$ ssh -p 10022 homeserver_user@1.1.1.1 + +在上面的命令中,1.1.1.1 是中继服务器的公共 IP 地址,家庭服务器用户必须是和家庭服务器相关联的用户账户。这是因为你真正登录到的主机是家庭服务器,而不是中继服务器。后者只是中继你的 SSH 流量到家庭服务器。 + +### 在 Linux 上设置一个永久反向 SSH 隧道 ### + +现在你已经明白了怎样创建一个反向 SSH 隧道,然后把隧道设置为 “永久”,这样隧道启动后就会一直运行(不管临时的网络拥塞、SSH 超时、中继主机重启,等等)。毕竟,如果隧道不是一直有效,你不可能可靠的登录到你的家庭服务器。 + +对于永久隧道,我打算使用一个叫 autossh 的工具。正如名字暗示的,这个程序允许你不管任何理由自动重启 SSH 会话。因此对于保存一个反向 SSH 隧道有效非常有用。 + +第一步,我们要设置从家庭服务器到中继服务器的[无密码 SSH 登录][2]。这样的话,autossh 可以不需要用户干预就能重启一个损坏的反向 SSH 隧道。 + +下一步,在初始化隧道的家庭服务器上[安装 autossh][3]。 + +在家庭服务器上,用下面的参数运行 autossh 来创建一个连接到中继服务器的永久 SSH 隧道。 + + homeserver~$ autossh -M 10900 -fN -o "PubkeyAuthentication=yes" -o "StrictHostKeyChecking=false" -o "PasswordAuthentication=no" -o "ServerAliveInterval 60" -o "ServerAliveCountMax 3" -R 1.1.1.1:10022:localhost:22 relayserver_user@1.1.1.1 + +“-M 10900” 选项指定中继服务器上的监视端口,用于交换监视 SSH 会话的测试数据。中继服务器上的其它程序不能使用这个端口。 + +“-fN” 选项传递给 ssh 命令,让 SSH 隧道在后台运行。 + +“-o XXXX” 选项让 ssh: + +- 使用密钥验证,而不是密码验证。 +- 自动接受(未知)SSH 主机密钥。 +- 每 60 秒交换 keep-alive 消息。 +- 没有收到任何响应时最多发送 3 条 keep-alive 消息。 + +其余 SSH 隧道相关的选项和之前介绍的一样。 + +如果你想系统启动时自动运行 SSH 隧道,你可以将上面的 autossh 命令添加到 /etc/rc.local。 + +### 总结 ### + +在这篇博文中,我介绍了你如何能从外部中通过反向 SSH 隧道访问限制性防火墙或 NAT 网关之后的 Linux 服务器。尽管我介绍了家庭网络中的一个使用事例,在企业网络中使用时你尤其要小心。这样的一个隧道可能被视为违反公司政策,因为它绕过了企业的防火墙并把企业网络暴露给外部攻击。这很可能被误用或者滥用。因此在使用之前一定要记住它的作用。 + +-------------------------------------------------------------------------------- + +via: http://xmodulo.com/access-linux-server-behind-nat-reverse-ssh-tunnel.html + +作者:[Dan Nanni][a] +译者:[ictlyh](https://github.com/ictlyh) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://xmodulo.com/author/nanni +[1]:http://xmodulo.com/go/digitalocean +[2]:http://xmodulo.com/how-to-enable-ssh-login-without.html +[3]:http://ask.xmodulo.com/install-autossh-linux.html diff --git a/translated/tech/Creating Software RAID0 (Stripe) on ‘Two Devices’ Using ‘mdadm’ Tool in Linux – Part 2 b/translated/tech/Creating Software RAID0 (Stripe) on ‘Two Devices’ Using ‘mdadm’ Tool in Linux – Part 2.md similarity index 100% rename from translated/tech/Creating Software RAID0 (Stripe) on ‘Two Devices’ Using ‘mdadm’ Tool in Linux – Part 2 rename to translated/tech/Creating Software RAID0 (Stripe) on ‘Two Devices’ Using ‘mdadm’ Tool in Linux – Part 2.md diff --git a/translated/tech/Introduction to RAID, Concepts of RAID and RAID Levels – Part 1 b/translated/tech/Introduction to RAID, Concepts of RAID and RAID Levels – Part 1.md similarity index 100% rename from translated/tech/Introduction to RAID, Concepts of RAID and RAID Levels – Part 1 rename to translated/tech/Introduction to RAID, Concepts of RAID and RAID Levels – Part 1.md From f1e0bd44ae78a3ffd31607226d2d44e846a15e5a Mon Sep 17 00:00:00 2001 From: Chang Liu Date: Mon, 3 Aug 2015 21:31:58 +0800 Subject: [PATCH 784/965] [Translated]20150128 7 communities driving open source development.md --- ...unities driving open source development.md | 56 +++++++++---------- 1 file changed, 27 insertions(+), 29 deletions(-) diff --git a/sources/talk/20150128 7 communities driving open source development.md b/sources/talk/20150128 7 communities driving open source development.md index c3b6df31d2..2074ad9e23 100644 --- a/sources/talk/20150128 7 communities driving open source development.md +++ b/sources/talk/20150128 7 communities driving open source development.md @@ -1,79 +1,77 @@ -FSSlc Translating - -7 communities driving open source development +7 个驱动开源发展的社区 ================================================================================ -Not so long ago, the open source model was the rebellious kid on the block, viewed with suspicion by established industry players. Today, open initiatives and foundations are flourishing with long lists of vendor committers who see the model as a key to innovation. +不久前,开源模式还被成熟的工业厂商以怀疑的态度认作是叛逆小孩的玩物。如今,开放的倡议和基金会在一长列的供应商提供者的支持下正蓬勃发展,而他们将开源模式视作创新的关键。 ![](http://images.techhive.com/images/article/2015/01/0_opensource-title-100539095-orig.jpg) -### Open Development of Tech Drives Innovation ### +### 技术的开放发展驱动着创新 ### -Over the past two decades, open development of technology has come to be seen as a key to driving innovation. Even companies that once saw open source as a threat have come around — Microsoft, for example, is now active in a number of open source initiatives. To date, most open development has focused on software. But even that is changing as communities have begun to coalesce around open hardware initiatives. Here are seven organizations that are successfully promoting and developing open technologies, both hardware and software. +在过去的 20 几年间,技术的开放发展已被视作驱动创新的关键因素。即使那些以前将开源视作威胁的公司也开始接受这个观点 — 例如微软,如今它在一系列的开源倡议中表现活跃。到目前为止,大多数的开放发展都集中在软件方面,但甚至这个也正在改变,因为社区已经开始向开源硬件倡议方面聚拢。这里有 7 个成功地在硬件和软件方面同时促进和发展开源技术的组织。 -### OpenPOWER Foundation ### +### OpenPOWER 基金会 ### ![](http://images.techhive.com/images/article/2015/01/1_openpower-100539100-orig.jpg) -The [OpenPOWER Foundation][2] was founded by IBM, Google, Mellanox, Tyan and NVIDIA in 2013 to drive open collaboration hardware development in the same spirit as the open source software development which has found fertile ground in the past two decades. +[OpenPOWER 基金会][2] 由 IBM, Google, Mellanox, Tyan 和 NVIDIA 于 2013 年共同创建,在与开源软件发展相同的精神下,旨在驱动开放协作硬件的发展,在过去的 20 几年间,开源软件发展已经找到了肥沃的土壤。 -IBM seeded the foundation by opening up its Power-based hardware and software technologies, offering licenses to use Power IP in independent hardware products. More than 70 members now work together to create custom open servers, components and software for Linux-based data centers. +IBM 通过开放其基于 Power 架构的硬件和软件技术,向使用 Power IP 的独立硬件产品提供许可证等方式为基金会的建立播下种子。如今超过 70 个成员共同协作来为基于 Linux 的数据中心提供自定义的开放服务器,组件和硬件。 -In April, OpenPOWER unveiled a technology roadmap based on new POWER8 process-based servers capable of analyzing data 50 times faster than the latest x86-based systems. In July, IBM and Google released a firmware stack. October saw the availability of NVIDIA GPU accelerated POWER8 systems and the first OpenPOWER reference server from Tyan. +今年四月,在比最新基于 x86 系统快 50 倍的数据分析能力的新的 POWER8 处理器的服务器的基础上, OpenPOWER 推出了一个技术路线图。七月, IBM 和 Google 发布了一个固件堆栈。十月见证了 NVIDIA GPU 带来加速 POWER8 系统的能力和来自 Tyan 的第一个 OpenPOWER 参考服务器。 -### The Linux Foundation ### +### Linux 基金会 ### ![](http://images.techhive.com/images/article/2015/01/2_the-linux-foundation-100539101-orig.jpg) -Founded in 2000, [The Linux Foundation][2] is now the host for the largest open source, collaborative development effort in history, with more than 180 corporate members and many individual and student members. It sponsors the work of key Linux developers and promotes, protects and advances the Linux operating system and collaborative software development. +于 2000 年建立的 [Linux 基金会][2] 如今成为掌控着历史上最大的开源协同发展成果,它有着超过 180 个合作成员和许多独立成员及学生成员。它赞助核心 Linux 开发者的工作并促进、保护和推进 Linux 操作系统和协作软件的开发。 -Some of its most successful collaborative projects include Code Aurora Forum (a consortium of companies with projects serving the mobile wireless industry), MeeGo (a project to build a Linux kernel-based operating system for mobile devices and IVI) and the Open Virtualization Alliance (which fosters the adoption of free and open source software virtualization solutions). +它最为成功的协作项目包括 Code Aurora Forum (一个拥有为移动无线产业服务的企业财团),MeeGo (一个为移动设备和 IVI (注:指的是车载消息娱乐设备,为 In-Vehicle Infotainment 的简称) 构建一个基于 Linux 内核的操作系统的项目) 和 Open Virtualization Alliance (开放虚拟化联盟,它促进自由和开源软件虚拟化解决方案的采用)。 -### Open Virtualization Alliance ### +### 开放虚拟化联盟 ### ![](http://images.techhive.com/images/article/2015/01/3_open-virtualization-alliance-100539102-orig.jpg) -The [Open Virtualization Alliance (OVA)][3] exists to foster the adoption of free and open source software virtualization solutions like Kernel-based Virtual Machine (KVM) through use cases and support for the development of interoperable common interfaces and APIs. KVM turns the Linux kernel into a hypervisor. +[开放虚拟化联盟(OVA)][3] 的存在目的为:通过提供使用案例和对具有互操作性的通用接口和 API 的发展提供支持,来促进自由、开源软件的虚拟化解决方案例如 KVM 的采用。KVM 将 Linux 内核转变为一个虚拟机管理程序。 -Today, KVM is the most commonly used hypervisor with OpenStack. +如今, KVM 已成为和 OpenStack 共同使用的最为常见的虚拟机管理程序。 -### The OpenStack Foundation ### +### OpenStack 基金会 ### ![](http://images.techhive.com/images/article/2015/01/4_the-openstack-foundation-100539096-orig.jpg) -Originally launched as an Infrastructure-as-a-Service (IaaS) product by NASA and Rackspace hosting in 2010, the [OpenStack Foundation][4] has become the home for one of the biggest open source projects around. It boasts more than 200 member companies, including AT&T, AMD, Avaya, Canonical, Cisco, Dell and HP. +原本作为一个 IaaS(基础设施即服务) 产品由 NASA 和 Rackspace 于 2010 年启动,[OpenStack 基金会][4] 已成为最大的开源项目聚居地之一。它拥有超过 200 家公司成员,其中包括 AT&T, AMD, Avaya, Canonical, Cisco, Dell 和 HP。 -Organized around a six-month release cycle, the foundation's OpenStack projects are developed to control pools of processing, storage and networking resources through a data center — all managed or provisioned through a Web-based dashboard, command-line tools or a RESTful API. So far, the collaborative development supported by the foundation has resulted in the creation of OpenStack components including OpenStack Compute (a cloud computing fabric controller that is the main part of an IaaS system), OpenStack Networking (a system for managing networks and IP addresses) and OpenStack Object Storage (a scalable redundant storage system). +大约以 6 个月为一个发行周期,基金会的 OpenStack 项目被发展用来通过一个基于 Web 的仪表盘,命令行工具或一个 RESTful 风格的 API 来控制或调配流经一个数据中心的处理存储池和网络资源。至今为止,基金会支持的协作发展已经孕育出了一系列 OpenStack 组件,其中包括 OpenStack Compute(一个云计算网络控制器,它是一个 IaaS 系统的主要部分),OpenStack Networking(一个用以管理网络和 IP 地址的系统) 和 OpenStack Object Storage(一个可扩展的冗余存储系统)。 ### OpenDaylight ### ![](http://images.techhive.com/images/article/2015/01/5_opendaylight-100539097-orig.jpg) -Another collaborative project to come out of the Linux Foundation, [OpenDaylight][5] is a joint initiative of industry vendors, like Dell, HP, Oracle and Avaya founded in April 2013. Its mandate is the creation of a community-led, open, industry-supported framework consisting of code and blueprints for Software-Defined Networking (SDN). The idea is to provide a fully functional SDN platform that can be deployed directly, without requiring other components, though vendors can offer add-ons and enhancements. +作为来自 Linux 基金会的另一个协作项目, [OpenDaylight][5] 是一个由诸如 Dell, HP, Oracle 和 Avaya 等行业厂商于 2013 年 4 月建立的联合倡议。它的任务是建立一个由社区主导,开放,有工业支持的针对 Software-Defined Networking (SDN) 的包含代码和蓝图的框架。其思路是提供一个可直接部署的全功能 SDN 平台,而不需要其他组件,供应商可提供附件组件和增强组件。 -### Apache Software Foundation ### +### Apache 软件基金会 ### ![](http://images.techhive.com/images/article/2015/01/6_apache-software-foundation-100539098-orig.jpg) -The [Apache Software Foundation (ASF)][7] is home to nearly 150 top level projects ranging from open source enterprise automation software to a whole ecosystem of distributed computing projects related to Apache Hadoop. These projects deliver enterprise-grade, freely available software products, while the Apache License is intended to make it easy for users, whether commercial or individual, to deploy Apache products. +[Apache 软件基金会 (ASF)][7] 是将近 150 个顶级项目的聚居地,这些项目涵盖从开源企业级自动化软件到与 Apache Hadoop 相关的分布式计算的整个生态系统。这些项目分发企业级、可免费获取的软件产品,而 Apache 协议则是为了让无论是商业用户还是个人用户更方便地部署 Apache 的产品。 -ASF was incorporated in 1999 as a membership-based, not-for-profit corporation with meritocracy at its heart — to become a member you must first be actively contributing to one or more of the foundation's collaborative projects. +ASF 于 1999 年作为一个会员制,非盈利公司注册,其核心为精英 — 要成为它的成员,你必须首先在基金会的一个或多个协作项目中做出积极贡献。 -### Open Compute Project ### +### 开放计算项目 ### ![](http://images.techhive.com/images/article/2015/01/7_open-compute-project-100539099-orig.jpg) -An outgrowth of Facebook's redesign of its Oregon data center, the [Open Compute Project (OCP)][7] aims to develop open hardware solutions for data centers. The OCP is an initiative made up of cheap, vanity-free servers, modular I/O storage for Open Rack (a rack standard designed for data centers to integrate the rack into the data center infrastructure) and a relatively "green" data center design. +作为 Facebook 重新设计其 Oregon 数据中心的副产物, [开放计算项目][7] 旨在发展针对数据中心的开放硬件解决方案。 OCP 是一个由廉价、无浪费的服务器,针对 Open Rack(为数据中心设计的机架标准,来让机架集成到数据中心的基础设施中) 的模块化 I/O 存储和一个相对 "绿色" 的数据中心设计方案等构成。 -OCP board members include representatives from Facebook, Intel, Goldman Sachs, Rackspace and Microsoft. +OCP 董事会成员包括来自 Facebook,Intel,Goldman Sachs,Rackspace 和 Microsoft 的代表。 -OCP recently announced two options for licensing: an Apache 2.0-like license that allows for derivative works and a more prescriptive license that encourages changes to be rolled back into the original software. +OCP 最近宣布了许可证的两个选择: 一个类似 Apache 2.0 的允许衍生工作的许可证和一个更规范的鼓励回滚到原有软件的更改的许可证。 -------------------------------------------------------------------------------- via: http://www.networkworld.com/article/2866074/opensource-subnet/7-communities-driving-open-source-development.html 作者:[Thor Olavsrud][a] -译者:[译者ID](https://github.com/译者ID) +译者:[FSSlc](https://github.com/FSSlc) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 @@ -85,4 +83,4 @@ via: http://www.networkworld.com/article/2866074/opensource-subnet/7-communities [4]:http://www.openstack.org/foundation/ [5]:http://www.opendaylight.org/ [6]:http://www.apache.org/ -[7]:http://www.opencompute.org/ +[7]:http://www.opencompute.org/ \ No newline at end of file From 87c50a0cd95d1f25360ef2b85cf47a997aa333e0 Mon Sep 17 00:00:00 2001 From: wxy Date: Mon, 3 Aug 2015 22:27:09 +0800 Subject: [PATCH 785/965] =?UTF-8?q?=E8=A1=A5=E5=AE=8C=20PR?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @FSSlc --- .../20150128 7 communities driving open source development.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/talk/20150128 7 communities driving open source development.md (100%) diff --git a/sources/talk/20150128 7 communities driving open source development.md b/translated/talk/20150128 7 communities driving open source development.md similarity index 100% rename from sources/talk/20150128 7 communities driving open source development.md rename to translated/talk/20150128 7 communities driving open source development.md From 2ee44522e991b6d9f8be3aab4e341a3c473772dc Mon Sep 17 00:00:00 2001 From: wxy Date: Mon, 3 Aug 2015 22:36:14 +0800 Subject: [PATCH 786/965] =?UTF-8?q?=E8=B6=85=E6=9C=9F=E5=9B=9E=E6=94=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @wi-cuckoo @KevinSJ --- .../tech/20150717 How to monitor NGINX with Datadog - Part 3.md | 1 - sources/tech/20150717 How to monitor NGINX- Part 1.md | 1 - 2 files changed, 2 deletions(-) diff --git a/sources/tech/20150717 How to monitor NGINX with Datadog - Part 3.md b/sources/tech/20150717 How to monitor NGINX with Datadog - Part 3.md index 40787cdd96..949fd3d949 100644 --- a/sources/tech/20150717 How to monitor NGINX with Datadog - Part 3.md +++ b/sources/tech/20150717 How to monitor NGINX with Datadog - Part 3.md @@ -1,4 +1,3 @@ -translating wi-cuckoo How to monitor NGINX with Datadog - Part 3 ================================================================================ ![](http://www.datadoghq.com/wp-content/uploads/2015/07/NGINX_hero_3.png) diff --git a/sources/tech/20150717 How to monitor NGINX- Part 1.md b/sources/tech/20150717 How to monitor NGINX- Part 1.md index 97ab822fca..1ae6858792 100644 --- a/sources/tech/20150717 How to monitor NGINX- Part 1.md +++ b/sources/tech/20150717 How to monitor NGINX- Part 1.md @@ -1,4 +1,3 @@ -KevinSJ Translating How to monitor NGINX - Part 1 ================================================================================ ![](http://www.datadoghq.com/wp-content/uploads/2015/07/NGINX_hero_1.png) From 42083f4166af08cd49ac5749ca8f770663545f95 Mon Sep 17 00:00:00 2001 From: struggling <630441839@qq.com> Date: Mon, 3 Aug 2015 22:42:03 +0800 Subject: [PATCH 787/965] Update 20150717 How to monitor NGINX with Datadog - Part 3.md --- .../20150717 How to monitor NGINX with Datadog - Part 3.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150717 How to monitor NGINX with Datadog - Part 3.md b/sources/tech/20150717 How to monitor NGINX with Datadog - Part 3.md index 949fd3d949..727c552ed0 100644 --- a/sources/tech/20150717 How to monitor NGINX with Datadog - Part 3.md +++ b/sources/tech/20150717 How to monitor NGINX with Datadog - Part 3.md @@ -1,3 +1,4 @@ +translation by strugglingyouth How to monitor NGINX with Datadog - Part 3 ================================================================================ ![](http://www.datadoghq.com/wp-content/uploads/2015/07/NGINX_hero_3.png) @@ -147,4 +148,4 @@ via: https://www.datadoghq.com/blog/how-to-monitor-nginx-with-datadog/ [16]:https://www.datadoghq.com/blog/monitoring-101-collecting-data/#metrics [17]:https://www.datadoghq.com/blog/how-to-monitor-nginx-with-datadog/#sign-up [18]:https://github.com/DataDog/the-monitor/blob/master/nginx/how_to_monitor_nginx_with_datadog.md -[19]:https://github.com/DataDog/the-monitor/issues \ No newline at end of file +[19]:https://github.com/DataDog/the-monitor/issues From c52f369407f617927b6cc65e9a07937e957acd50 Mon Sep 17 00:00:00 2001 From: struggling <630441839@qq.com> Date: Mon, 3 Aug 2015 22:44:22 +0800 Subject: [PATCH 788/965] Update 20150717 How to monitor NGINX- Part 1.md --- sources/tech/20150717 How to monitor NGINX- Part 1.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20150717 How to monitor NGINX- Part 1.md b/sources/tech/20150717 How to monitor NGINX- Part 1.md index 1ae6858792..690ab192ba 100644 --- a/sources/tech/20150717 How to monitor NGINX- Part 1.md +++ b/sources/tech/20150717 How to monitor NGINX- Part 1.md @@ -1,3 +1,4 @@ +translation by strugglingyouth How to monitor NGINX - Part 1 ================================================================================ ![](http://www.datadoghq.com/wp-content/uploads/2015/07/NGINX_hero_1.png) From afcff7a42fd2eb7d06bc5cdf51ca624424c8f75a Mon Sep 17 00:00:00 2001 From: wxy Date: Mon, 3 Aug 2015 23:14:11 +0800 Subject: [PATCH 789/965] PUB:20150717 Howto Configure FTP Server with Proftpd on Fedora 22 @zpl1025 --- ...re FTP Server with Proftpd on Fedora 22.md | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) rename {translated/tech => published}/20150717 Howto Configure FTP Server with Proftpd on Fedora 22.md (83%) diff --git a/translated/tech/20150717 Howto Configure FTP Server with Proftpd on Fedora 22.md b/published/20150717 Howto Configure FTP Server with Proftpd on Fedora 22.md similarity index 83% rename from translated/tech/20150717 Howto Configure FTP Server with Proftpd on Fedora 22.md rename to published/20150717 Howto Configure FTP Server with Proftpd on Fedora 22.md index 0ccfe69b8f..d812c1b0ac 100644 --- a/translated/tech/20150717 Howto Configure FTP Server with Proftpd on Fedora 22.md +++ b/published/20150717 Howto Configure FTP Server with Proftpd on Fedora 22.md @@ -1,11 +1,13 @@ 如何在 Fedora 22 上配置 Proftpd 服务器 ================================================================================ -在本文中,我们将了解如何在运行 Fedora 22 的电脑或服务器上使用 Proftpd 架设 FTP 服务器。[ProFTPD][1] 是一款免费的基于 GPL 授权开源的 FTP 服务器软件,是 Linux 上的主流 FTP 服务器。它的主要设计目标是具备许多高级功能以及能为用户提供丰富的配置选项可以轻松实现定制。它的许多配置选项在其他一些 FTP 服务器软件里仍然没有集成。最初它是被开发作为 wu-ftpd 服务器的一个更安全更容易配置的替代。FTP 服务器是这样一个软件,用户可以通过 FTP 客户端从安装了它的远端服务器上传或下载文件和目录。下面是一些 ProFTPD 服务器的主要功能,更详细的资料可以访问 [http://www.proftpd.org/features.html][2]。 +在本文中,我们将了解如何在运行 Fedora 22 的电脑或服务器上使用 Proftpd 架设 FTP 服务器。[ProFTPD][1] 是一款基于 GPL 授权的自由开源 FTP 服务器软件,是 Linux 上的主流 FTP 服务器。它的主要设计目标是提供许多高级功能以及给用户提供丰富的配置选项以轻松实现定制。它具备许多在其他一些 FTP 服务器软件里仍然没有的配置选项。最初它是被开发作为 wu-ftpd 服务器的一个更安全更容易配置的替代。 -- 每个目录都包含 ".ftpaccess" 文件用于访问控制,类似 Apache 的 ".htaccess" +FTP 服务器是这样一个软件,用户可以通过 FTP 客户端从安装了它的远端服务器上传或下载文件和目录。下面是一些 ProFTPD 服务器的主要功能,更详细的资料可以访问 [http://www.proftpd.org/features.html][2]。 + +- 每个目录都可以包含 ".ftpaccess" 文件用于访问控制,类似 Apache 的 ".htaccess" - 支持多个虚拟 FTP 服务器以及多用户登录和匿名 FTP 服务。 - 可以作为独立进程启动服务或者通过 inetd/xinetd 启动 -- 它的文件/目录属性、属主和权限采用类 UNIX 方式。 +- 它的文件/目录属性、属主和权限是基于 UNIX 方式的。 - 它可以独立运行,保护系统避免 root 访问可能带来的损坏。 - 模块化的设计让它可以轻松扩展其他模块,比如 LDAP 服务器,SSL/TLS 加密,RADIUS 支持,等等。 - ProFTPD 服务器还支持 IPv6. @@ -38,7 +40,7 @@ ### 3. 添加 FTP 用户 ### -在设定好了基本的配置文件后,我们很自然地希望为指定目录添加 FTP 用户。目前用来登录的用户是 FTP 服务自动生成的,可以用来登录到 FTP 服务器。但是,在这篇教程里,我们将创建一个以 ftp 服务器上指定目录为主目录的新用户。 +在设定好了基本的配置文件后,我们很自然地希望添加一个以特定目录为根目录的 FTP 用户。目前登录的用户自动就可以使用 FTP 服务,可以用来登录到 FTP 服务器。但是,在这篇教程里,我们将创建一个以 ftp 服务器上指定目录为主目录的新用户。 下面,我们将建立一个名字是 ftpgroup 的新用户组。 @@ -57,7 +59,7 @@ Retype new password: passwd: all authentication tokens updated successfully. -现在,我们将通过下面命令为这个 ftp 用户设定主目录的读写权限。 +现在,我们将通过下面命令为这个 ftp 用户设定主目录的读写权限(LCTT 译注:这是SELinux 相关设置,如果未启用 SELinux,可以不用)。 $ sudo setsebool -P allow_ftpd_full_access=1 $ sudo setsebool -P ftp_home_dir=1 @@ -129,7 +131,7 @@ 如果 **打开了 TLS/SSL 加密**,执行下面的命令。 - $sudo firewall-cmd --add-port=1024-65534/tcp + $ sudo firewall-cmd --add-port=1024-65534/tcp $ sudo firewall-cmd --add-port=1024-65534/tcp --permanent 如果 **没有打开 TLS/SSL 加密**,执行下面的命令。 @@ -158,7 +160,7 @@ ### 7. 登录到 FTP 服务器 ### -现在,如果都是按照本教程设置好的,我们一定可以连接到 ftp 服务器并使用以上设置的信息登录上去。在这里,我们将配置一下 FTP 客户端 filezilla,使用 **服务器的 IP 或 URL **作为主机名,协议选择 **FTP**,用户名填入 **arunftp**,密码是在上面第 3 步中设定的密码。如果你按照第 4 步中的方式打开了 TLS 支持,还需要在加密类型中选择 **显式要求基于 TLS 的 FTP**,如果没有打开,也不想使用 TLS 加密,那么加密类型选择 **简单 FTP**。 +现在,如果都是按照本教程设置好的,我们一定可以连接到 ftp 服务器并使用以上设置的信息登录上去。在这里,我们将配置一下 FTP 客户端 filezilla,使用 **服务器的 IP 或名称 **作为主机名,协议选择 **FTP**,用户名填入 **arunftp**,密码是在上面第 3 步中设定的密码。如果你按照第 4 步中的方式打开了 TLS 支持,还需要在加密类型中选择 **要求显式的基于 TLS 的 FTP**,如果没有打开,也不想使用 TLS 加密,那么加密类型选择 **简单 FTP**。 ![FTP 登录细节](http://blog.linoxide.com/wp-content/uploads/2015/06/ftp-login-details.png) @@ -170,7 +172,7 @@ ### 总结 ### -最后,我们成功地在 Fedora 22 机器上安装并配置好了 Proftpd FTP 服务器。Proftpd 是一个超级强大,能高度配置和扩展的 FTP 守护软件。上面的教程展示了如何配置一个采用 TLS 加密的安全 FTP 服务器。强烈建议设置 FTP 服务器支持 TLS 加密,因为它允许使用 SSL 凭证加密数据传输和登录。本文中,我们也没有配置 FTP 的匿名访问,因为一般受保护的 FTP 系统不建议这样做。 FTP 访问让人们的上传和下载变得非常简单也更高效。我们还可以改变用户端口增加安全性。好吧,如果你有任何疑问,建议,反馈,请在下面评论区留言,这样我们就能够改善并更新文章内容。谢谢!玩的开心 :-) +最后,我们成功地在 Fedora 22 机器上安装并配置好了 Proftpd FTP 服务器。Proftpd 是一个超级强大,能高度定制和扩展的 FTP 守护软件。上面的教程展示了如何配置一个采用 TLS 加密的安全 FTP 服务器。强烈建议设置 FTP 服务器支持 TLS 加密,因为它允许使用 SSL 凭证加密数据传输和登录。本文中,我们也没有配置 FTP 的匿名访问,因为一般受保护的 FTP 系统不建议这样做。 FTP 访问让人们的上传和下载变得非常简单也更高效。我们还可以改变用户端口增加安全性。好吧,如果你有任何疑问,建议,反馈,请在下面评论区留言,这样我们就能够改善并更新文章内容。谢谢!玩的开心 :-) -------------------------------------------------------------------------------- @@ -178,7 +180,7 @@ via: http://linoxide.com/linux-how-to/configure-ftp-proftpd-fedora-22/ 作者:[Arun Pyasi][a] 译者:[zpl1025](https://github.com/zpl1025) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 1908ba60a53e99fcfc69f82dba743935707b41d3 Mon Sep 17 00:00:00 2001 From: wxy Date: Mon, 3 Aug 2015 23:46:03 +0800 Subject: [PATCH 790/965] PUB:20150604 Nishita Agarwal Shares Her Interview Experience on Linux 'iptables' Firewall @wwy-hust --- ...Experience on Linux 'iptables' Firewall.md | 205 ++++++++++++++++++ ...Experience on Linux 'iptables' Firewall.md | 205 ------------------ 2 files changed, 205 insertions(+), 205 deletions(-) create mode 100644 published/20150604 Nishita Agarwal Shares Her Interview Experience on Linux 'iptables' Firewall.md delete mode 100644 translated/tech/20150604 Nishita Agarwal Shares Her Interview Experience on Linux 'iptables' Firewall.md diff --git a/published/20150604 Nishita Agarwal Shares Her Interview Experience on Linux 'iptables' Firewall.md b/published/20150604 Nishita Agarwal Shares Her Interview Experience on Linux 'iptables' Firewall.md new file mode 100644 index 0000000000..9d8d582dfb --- /dev/null +++ b/published/20150604 Nishita Agarwal Shares Her Interview Experience on Linux 'iptables' Firewall.md @@ -0,0 +1,205 @@ +关于Linux防火墙'iptables'的面试问答 +================================================================================ +Nishita Agarwal是Tecmint的用户,她将分享关于她刚刚经历的一家公司(印度的一家私人公司Pune)的面试经验。在面试中她被问及许多不同的问题,但她是iptables方面的专家,因此她想分享这些关于iptables的问题和相应的答案给那些以后可能会进行相关面试的人。 + +![Linux防火墙Iptables面试问题](http://www.tecmint.com/wp-content/uploads/2015/05/Linux-iptables-Interview-Questions.jpg) + +所有的问题和相应的答案都基于Nishita Agarwal的记忆并经过了重写。 + +> “嗨,朋友!我叫**Nishita Agarwal**。我已经取得了理学学士学位,我的专业集中在UNIX和它的变种(BSD,Linux)。它们一直深深的吸引着我。我在存储方面有1年多的经验。我正在寻求职业上的变化,并将供职于印度的Pune公司。” + +下面是我在面试中被问到的问题的集合。我已经把我记忆中有关iptables的问题和它们的答案记录了下来。希望这会对您未来的面试有所帮助。 + +### 1. 你听说过Linux下面的iptables和Firewalld么?知不知道它们是什么,是用来干什么的? ### + +**答案** : iptables和Firewalld我都知道,并且我已经使用iptables好一段时间了。iptables主要由C语言写成,并且以GNU GPL许可证发布。它是从系统管理员的角度写的,最新的稳定版是iptables 1.4.21。iptables通常被用作类UNIX系统中的防火墙,更准确的说,可以称为iptables/netfilter。管理员通过终端/GUI工具与iptables打交道,来添加和定义防火墙规则到预定义的表中。Netfilter是内核中的一个模块,它执行包过滤的任务。 + +Firewalld是RHEL/CentOS 7(也许还有其他发行版,但我不太清楚)中最新的过滤规则的实现。它已经取代了iptables接口,并与netfilter相连接。 + +### 2. 你用过一些iptables的GUI或命令行工具么? ### + +**答案** : 虽然我既用过GUI工具,比如与[Webmin][1]结合的Shorewall;以及直接通过终端访问iptables,但我必须承认通过Linux终端直接访问iptables能给予用户更高级的灵活性、以及对其背后工作更好的理解的能力。GUI适合初级管理员,而终端适合有经验的管理员。 + +### 3. 那么iptables和firewalld的基本区别是什么呢? ### + +**答案** : iptables和firewalld都有着同样的目的(包过滤),但它们使用不同的方式。iptables与firewalld不同,在每次发生更改时都刷新整个规则集。通常iptables配置文件位于‘/etc/sysconfig/iptables‘,而firewalld的配置文件位于‘/etc/firewalld/‘。firewalld的配置文件是一组XML文件。以XML为基础进行配置的firewalld比iptables的配置更加容易,但是两者都可以完成同样的任务。例如,firewalld可以在自己的命令行界面以及基于XML的配置文件下使用iptables。 + +### 4. 如果有机会的话,你会在你所有的服务器上用firewalld替换iptables么? ### + +**答案** : 我对iptables很熟悉,它也工作的很好。如果没有任何需求需要firewalld的动态特性,那么没有理由把所有的配置都从iptables移动到firewalld。通常情况下,目前为止,我还没有看到iptables造成什么麻烦。IT技术的通用准则也说道“为什么要修一件没有坏的东西呢?”。上面是我自己的想法,但如果组织愿意用firewalld替换iptables的话,我不介意。 + +### 5. 你看上去对iptables很有信心,巧的是,我们的服务器也在使用iptables。 ### + +iptables使用的表有哪些?请简要的描述iptables使用的表以及它们所支持的链。 + +**答案** : 谢谢您的赞赏。至于您问的问题,iptables使用的表有四个,它们是: + +- Nat 表 +- Mangle 表 +- Filter 表 +- Raw 表 + +Nat表 : Nat表主要用于网络地址转换。根据表中的每一条规则修改网络包的IP地址。流中的包仅遍历一遍Nat表。例如,如果一个通过某个接口的包被修饰(修改了IP地址),该流中其余的包将不再遍历这个表。通常不建议在这个表中进行过滤,由NAT表支持的链称为PREROUTING 链,POSTROUTING 链和OUTPUT 链。 + +Mangle表 : 正如它的名字一样,这个表用于校正网络包。它用来对特殊的包进行修改。它能够修改不同包的头部和内容。Mangle表不能用于地址伪装。支持的链包括PREROUTING 链,OUTPUT 链,Forward 链,Input 链和POSTROUTING 链。 + +Filter表 : Filter表是iptables中使用的默认表,它用来过滤网络包。如果没有定义任何规则,Filter表则被当作默认的表,并且基于它来过滤。支持的链有INPUT 链,OUTPUT 链,FORWARD 链。 + +Raw表 : Raw表在我们想要配置之前被豁免的包时被使用。它支持PREROUTING 链和OUTPUT 链。 + +### 6. 简要谈谈什么是iptables中的目标值(能被指定为目标),他们有什么用 ### + +**答案** : 下面是在iptables中可以指定为目标的值: + +- ACCEPT : 接受包 +- QUEUE : 将包传递到用户空间 (应用程序和驱动所在的地方) +- DROP : 丢弃包 +- RETURN : 将控制权交回调用的链并且为当前链中的包停止执行下一调用规则 + +### 7. 让我们来谈谈iptables技术方面的东西,我的意思是说实际使用方面 ### + +你怎么检测在CentOS中安装iptables时需要的iptables的rpm? + +**答案** : iptables已经被默认安装在CentOS中,我们不需要单独安装它。但可以这样检测rpm: + + # rpm -qa iptables + + iptables-1.4.21-13.el7.x86_64 + +如果您需要安装它,您可以用yum来安装。 + + # yum install iptables-services + +### 8. 怎样检测并且确保iptables服务正在运行? ### + +**答案** : 您可以在终端中运行下面的命令来检测iptables的状态。 + + # service status iptables [On CentOS 6/5] + # systemctl status iptables [On CentOS 7] + +如果iptables没有在运行,可以使用下面的语句 + + ---------------- 在CentOS 6/5下 ---------------- + # chkconfig --level 35 iptables on + # service iptables start + + ---------------- 在CentOS 7下 ---------------- + # systemctl enable iptables + # systemctl start iptables + +我们还可以检测iptables的模块是否被加载: + + # lsmod | grep ip_tables + +### 9. 你怎么检查iptables中当前定义的规则呢? ### + +**答案** : 当前的规则可以简单的用下面的命令查看: + + # iptables -L + +示例输出 + + Chain INPUT (policy ACCEPT) + target prot opt source destination + ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED + ACCEPT icmp -- anywhere anywhere + ACCEPT all -- anywhere anywhere + ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:ssh + REJECT all -- anywhere anywhere reject-with icmp-host-prohibited + + Chain FORWARD (policy ACCEPT) + target prot opt source destination + REJECT all -- anywhere anywhere reject-with icmp-host-prohibited + + Chain OUTPUT (policy ACCEPT) + target prot opt source destination + +### 10. 你怎样刷新所有的iptables规则或者特定的链呢? ### + +**答案** : 您可以使用下面的命令来刷新一个特定的链。 + + # iptables --flush OUTPUT + +要刷新所有的规则,可以用: + + # iptables --flush + +### 11. 请在iptables中添加一条规则,接受所有从一个信任的IP地址(例如,192.168.0.7)过来的包。 ### + +**答案** : 上面的场景可以通过运行下面的命令来完成。 + + # iptables -A INPUT -s 192.168.0.7 -j ACCEPT + +我们还可以在源IP中使用标准的斜线和子网掩码: + + # iptables -A INPUT -s 192.168.0.7/24 -j ACCEPT + # iptables -A INPUT -s 192.168.0.7/255.255.255.0 -j ACCEPT + +### 12. 怎样在iptables中添加规则以ACCEPT,REJECT,DENY和DROP ssh的服务? ### + +**答案** : 但愿ssh运行在22端口,那也是ssh的默认端口,我们可以在iptables中添加规则来ACCEPT ssh的tcp包(在22号端口上)。 + + # iptables -A INPUT -s -p tcp --dport 22 -j ACCEPT + +REJECT ssh服务(22号端口)的tcp包。 + + # iptables -A INPUT -s -p tcp --dport 22 -j REJECT + +DENY ssh服务(22号端口)的tcp包。 + + + # iptables -A INPUT -s -p tcp --dport 22 -j DENY + +DROP ssh服务(22号端口)的tcp包。 + + + # iptables -A INPUT -s -p tcp --dport 22 -j DROP + +### 13. 让我给你另一个场景,假如有一台电脑的本地IP地址是192.168.0.6。你需要封锁在21、22、23和80号端口上的连接,你会怎么做? ### + +**答案** : 这时,我所需要的就是在iptables中使用‘multiport‘选项,并将要封锁的端口号跟在它后面。上面的场景可以用下面的一条语句搞定: + + # iptables -A INPUT -s 192.168.0.6 -p tcp -m multiport --dport 22,23,80,8080 -j DROP + +可以用下面的语句查看写入的规则。 + + # iptables -L + + Chain INPUT (policy ACCEPT) + target prot opt source destination + ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED + ACCEPT icmp -- anywhere anywhere + ACCEPT all -- anywhere anywhere + ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:ssh + REJECT all -- anywhere anywhere reject-with icmp-host-prohibited + DROP tcp -- 192.168.0.6 anywhere multiport dports ssh,telnet,http,webcache + + Chain FORWARD (policy ACCEPT) + target prot opt source destination + REJECT all -- anywhere anywhere reject-with icmp-host-prohibited + + Chain OUTPUT (policy ACCEPT) + target prot opt source destination + +**面试官** : 好了,我问的就是这些。你是一个很有价值的雇员,我们不会错过你的。我将会向HR推荐你的名字。如果你有什么问题,请问我。 + +作为一个候选人我不愿不断的问将来要做的项目的事以及公司里其他的事,这样会打断愉快的对话。更不用说HR轮会不会比较难,总之,我获得了机会。 + +同时我要感谢Avishek和Ravi(我的朋友)花时间帮我整理我的面试。 + +朋友!如果您有过类似的面试,并且愿意与数百万Tecmint读者一起分享您的面试经历,请将您的问题和答案发送到admin@tecmint.com。 + +谢谢!保持联系。如果我能更好的回答我上面的问题的话,请记得告诉我。 + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/linux-firewall-iptables-interview-questions-and-answers/ + +作者:[Avishek Kumar][a] +译者:[wwy-hust](https://github.com/wwy-hust) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/avishek/ +[1]:http://www.tecmint.com/install-webmin-web-based-system-administration-tool-for-rhel-centos-fedora/ diff --git a/translated/tech/20150604 Nishita Agarwal Shares Her Interview Experience on Linux 'iptables' Firewall.md b/translated/tech/20150604 Nishita Agarwal Shares Her Interview Experience on Linux 'iptables' Firewall.md deleted file mode 100644 index 1d476d0f18..0000000000 --- a/translated/tech/20150604 Nishita Agarwal Shares Her Interview Experience on Linux 'iptables' Firewall.md +++ /dev/null @@ -1,205 +0,0 @@ -Nishita Agarwal分享它关于Linux防火墙'iptables'的面试经验 -================================================================================ -Nishita Agarwal是Tecmint的用户,她将分享关于她刚刚经历的一家公司(私人公司Pune,印度)的面试经验。在面试中她被问及许多不同的问题,但她是iptables方面的专家,因此她想分享这些关于iptables的问题和相应的答案给那些以后可能会进行相关面试的人。 - -![Linux防火墙Iptables面试问题](http://www.tecmint.com/wp-content/uploads/2015/05/Linux-iptables-Interview-Questions.jpg) - -所有的问题和相应的答案都基于Nishita Agarwal的记忆并经过了重写。 - -> “嗨,朋友!我叫**Nishita Agarwal**。我已经取得了理学学士学位,我的专业集中在UNIX和它的变种(BSD,Linux)。它们一直深深的吸引着我。我在存储方面有1年多的经验。我正在寻求职业上的变化,并将供职于印度的Pune公司。” - -下面是我在面试中被问到的问题的集合。我已经把我记忆中有关iptables的问题和它们的答案记录了下来。希望这会对您未来的面试有所帮助。 - -### 1. 你听说过Linux下面的iptables和Firewalld么?知不知道它们是什么,是用来干什么的? ### - -> **答案** : iptables和Firewalld我都知道,并且我已经使用iptables好一段时间了。iptables主要由C语言写成,并且以GNU GPL许可证发布。它是从系统管理员的角度写的,最新的稳定版是iptables 1.4.21。iptables通常被认为是类UNIX系统中的防火墙,更准确的说,可以称为iptables/netfilter。管理员通过终端/GUI工具与iptables打交道,来添加和定义防火墙规则到预定义的表中。Netfilter是内核中的一个模块,它执行过滤的任务。 -> -> Firewalld是RHEL/CentOS 7(也许还有其他发行版,但我不太清楚)中最新的过滤规则的实现。它已经取代了iptables接口,并与netfilter相连接。 - -### 2. 你用过一些iptables的GUI或命令行工具么? ### - -> **答案** : 虽然我既用过GUI工具,比如与[Webmin][1]结合的Shorewall;以及直接通过终端访问iptables。但我必须承认通过Linux终端直接访问iptables能给予用户更高级的灵活性、以及对其背后工作更好的理解的能力。GUI适合初级管理员而终端适合有经验的管理员。 - -### 3. 那么iptables和firewalld的基本区别是什么呢? ### - -> **答案** : iptables和firewalld都有着同样的目的(包过滤),但它们使用不同的方式。iptables与firewalld不同,在每次发生更改时都刷新整个规则集。通常iptables配置文件位于‘/etc/sysconfig/iptables‘,而firewalld的配置文件位于‘/etc/firewalld/‘。firewalld的配置文件是一组XML文件。以XML为基础进行配置的firewalld比iptables的配置更加容易,但是两者都可以完成同样的任务。例如,firewalld可以在自己的命令行界面以及基于XML的配置文件下使用iptables。 - -### 4. 如果有机会的话,你会在你所有的服务器上用firewalld替换iptables么? ### - -> **答案** : 我对iptables很熟悉,它也工作的很好。如果没有任何需求需要firewalld的动态特性,那么没有理由把所有的配置都从iptables移动到firewalld。通常情况下,目前为止,我还没有看到iptables造成什么麻烦。IT技术的通用准则也说道“为什么要修一件没有坏的东西呢?”。上面是我自己的想法,但如果组织愿意用firewalld替换iptables的话,我不介意。 - -### 5. 你看上去对iptables很有信心,巧的是,我们的服务器也在使用iptables。 ### - -iptables使用的表有哪些?请简要的描述iptables使用的表以及它们所支持的链。 - -> **答案** : 谢谢您的赞赏。至于您问的问题,iptables使用的表有四个,它们是: -> -> Nat 表 -> Mangle 表 -> Filter 表 -> Raw 表 -> -> Nat表 : Nat表主要用于网络地址转换。根据表中的每一条规则修改网络包的IP地址。流中的包仅遍历一遍Nat表。例如,如果一个通过某个接口的包被修饰(修改了IP地址),该流中其余的包将不再遍历这个表。通常不建议在这个表中进行过滤,由NAT表支持的链称为PREROUTING Chain,POSTROUTING Chain和OUTPUT Chain。 -> -> Mangle表 : 正如它的名字一样,这个表用于校正网络包。它用来对特殊的包进行修改。它能够修改不同包的头部和内容。Mangle表不能用于地址伪装。支持的链包括PREROUTING Chain,OUTPUT Chain,Forward Chain,InputChain和POSTROUTING Chain。 -> -> Filter表 : Filter表是iptables中使用的默认表,它用来过滤网络包。如果没有定义任何规则,Filter表则被当作默认的表,并且基于它来过滤。支持的链有INPUT Chain,OUTPUT Chain,FORWARD Chain。 -> -> Raw表 : Raw表在我们想要配置之前被豁免的包时被使用。它支持PREROUTING Chain 和OUTPUT Chain。 - -### 6. 简要谈谈什么是iptables中的目标值(能被指定为目标),他们有什么用 ### - -> **答案** : 下面是在iptables中可以指定为目标的值: -> -> ACCEPT : 接受包 -> QUEUE : 将包传递到用户空间 (应用程序和驱动所在的地方) -> DROP : 丢弃包 -> RETURN : 将控制权交回调用的链并且为当前链中的包停止执行下一调规则 - -### 7. 让我们来谈谈iptables技术方面的东西,我的意思是说实际使用方面 ### - -你怎么检测在CentOS中安装iptables时需要的iptables的rpm? - -> **答案** : iptables已经被默认安装在CentOS中,我们不需要单独安装它。但可以这样检测rpm: -> -> # rpm -qa iptables -> -> iptables-1.4.21-13.el7.x86_64 -> -> 如果您需要安装它,您可以用yum来安装。 -> -> # yum install iptables-services - -### 8. 怎样检测并且确保iptables服务正在运行? ### - -> **答案** : 您可以在终端中运行下面的命令来检测iptables的状态。 -> -> # service status iptables [On CentOS 6/5] -> # systemctl status iptables [On CentOS 7] -> -> 如果iptables没有在运行,可以使用下面的语句 -> -> ---------------- 在CentOS 6/5下 ---------------- -> # chkconfig --level 35 iptables on -> # service iptables start -> -> ---------------- 在CentOS 7下 ---------------- -> # systemctl enable iptables -> # systemctl start iptables -> -> 我们还可以检测iptables的模块是否被加载: -> -> # lsmod | grep ip_tables - -### 9. 你怎么检查iptables中当前定义的规则呢? ### - -> **答案** : 当前的规则可以简单的用下面的命令查看: -> -> # iptables -L -> -> 示例输出 -> -> Chain INPUT (policy ACCEPT) -> target prot opt source destination -> ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED -> ACCEPT icmp -- anywhere anywhere -> ACCEPT all -- anywhere anywhere -> ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:ssh -> REJECT all -- anywhere anywhere reject-with icmp-host-prohibited -> -> Chain FORWARD (policy ACCEPT) -> target prot opt source destination -> REJECT all -- anywhere anywhere reject-with icmp-host-prohibited -> -> Chain OUTPUT (policy ACCEPT) -> target prot opt source destination - -### 10. 你怎样刷新所有的iptables规则或者特定的链呢? ### - -> **答案** : 您可以使用下面的命令来刷新一个特定的链。 -> -> # iptables --flush OUTPUT -> -> 要刷新所有的规则,可以用: -> -> # iptables --flush - -### 11. 请在iptables中添加一条规则,接受所有从一个信任的IP地址(例如,192.168.0.7)过来的包。 ### - -> **答案** : 上面的场景可以通过运行下面的命令来完成。 -> -> # iptables -A INPUT -s 192.168.0.7 -j ACCEPT -> -> 我们还可以在源IP中使用标准的斜线和子网掩码: -> -> # iptables -A INPUT -s 192.168.0.7/24 -j ACCEPT -> # iptables -A INPUT -s 192.168.0.7/255.255.255.0 -j ACCEPT - -### 12. 怎样在iptables中添加规则以ACCEPT,REJECT,DENY和DROP ssh的服务? ### - -> **答案** : 但愿ssh运行在22端口,那也是ssh的默认端口,我们可以在iptables中添加规则来ACCEPT ssh的tcp包(在22号端口上)。 -> -> # iptables -A INPUT -s -p tcp --dport 22 -j ACCEPT -> -> REJECT ssh服务(22号端口)的tcp包。 -> -> # iptables -A INPUT -s -p tcp --dport 22 -j REJECT -> -> DENY ssh服务(22号端口)的tcp包。 -> -> -> # iptables -A INPUT -s -p tcp --dport 22 -j DENY -> -> DROP ssh服务(22号端口)的tcp包。 -> -> -> # iptables -A INPUT -s -p tcp --dport 22 -j DROP - -### 13. 让我给你另一个场景,假如有一台电脑的本地IP地址是192.168.0.6。你需要封锁在21、22、23和80号端口上的连接,你会怎么做? ### - -> **答案** : 这时,我所需要的就是在iptables中使用‘multiport‘选项,并将要封锁的端口号跟在它后面。上面的场景可以用下面的一条语句搞定: -> -> # iptables -A INPUT -s 192.168.0.6 -p tcp -m multiport --dport 22,23,80,8080 -j DROP -> -> 可以用下面的语句查看写入的规则。 -> -> # iptables -L -> -> Chain INPUT (policy ACCEPT) -> target prot opt source destination -> ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED -> ACCEPT icmp -- anywhere anywhere -> ACCEPT all -- anywhere anywhere -> ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:ssh -> REJECT all -- anywhere anywhere reject-with icmp-host-prohibited -> DROP tcp -- 192.168.0.6 anywhere multiport dports ssh,telnet,http,webcache -> -> Chain FORWARD (policy ACCEPT) -> target prot opt source destination -> REJECT all -- anywhere anywhere reject-with icmp-host-prohibited -> -> Chain OUTPUT (policy ACCEPT) -> target prot opt source destination - -**面试官** : 好了,我问的就是这些。你是一个很有价值的雇员,我们不会错过你的。我将会向HR推荐你的名字。如果你有什么问题,请问我。 - -作为一个候选人我不愿不断的问将来要做的项目的事以及公司里其他的事,这样会打断愉快的对话。更不用说HR轮会不会比较难,总之,我获得了机会。 - -同时我要感谢Avishek和Ravi(我的朋友)花时间帮我整理我的面试。 - -朋友!如果您有过类似的面试,并且愿意与数百万Tecmint读者一起分享您的面试经历,请将您的问题和答案发送到admin@tecmint.com。 - -谢谢!保持联系。如果我能更好的回答我上面的问题的话,请记得告诉我。 - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/linux-firewall-iptables-interview-questions-and-answers/ - -作者:[Avishek Kumar][a] -译者:[wwy-hust](https://github.com/wwy-hust) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.tecmint.com/author/avishek/ -[1]:http://www.tecmint.com/install-webmin-web-based-system-administration-tool-for-rhel-centos-fedora/ From f250353b717561555612c15b4fe71910487aec56 Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 4 Aug 2015 00:08:13 +0800 Subject: [PATCH 791/965] PUB:20150730 Compare PDF Files on Ubuntu @GOLinux --- .../20150730 Compare PDF Files on Ubuntu.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) rename {translated/tech => published}/20150730 Compare PDF Files on Ubuntu.md (81%) diff --git a/translated/tech/20150730 Compare PDF Files on Ubuntu.md b/published/20150730 Compare PDF Files on Ubuntu.md similarity index 81% rename from translated/tech/20150730 Compare PDF Files on Ubuntu.md rename to published/20150730 Compare PDF Files on Ubuntu.md index 3215caf23f..57b933765f 100644 --- a/translated/tech/20150730 Compare PDF Files on Ubuntu.md +++ b/published/20150730 Compare PDF Files on Ubuntu.md @@ -1,15 +1,15 @@ -Ubuntu上比较PDF文件 +如何在 Ubuntu 上比较 PDF 文件 ================================================================================ 如果你想要对PDF文件进行比较,你可以使用下面工具之一。 ### Comparepdf ### -comparepdf是一个命令行应用,用于将两个PDF文件进行对比。默认对比模式文本模式,该模式会对各对相关页面进行文字对比。只要一检测到差异,该程序就会终止,并显示一条信息(除非设置了-v0)和一个指示性的返回码。 +comparepdf是一个命令行应用,用于将两个PDF文件进行对比。默认对比模式是文本模式,该模式会对各对相关页面进行文字对比。只要一检测到差异,该程序就会终止,并显示一条信息(除非设置了-v0)和一个指示性的返回码。 -用于文本模式对比的选项有 -ct 或 --compare=text(默认),用于视觉对比(这对图标或其它图像发生改变时很有用)的选项有 -ca 或 --compare=appearance。而 -v=1 或 --verbose=1 选项则用于报告差异(或者对匹配文件不作任何回应):使用 -v=0 选项取消报告,或者 -v=2 来同时报告不同的和匹配的文件。 +用于文本模式对比的选项有 -ct 或 --compare=text(默认),用于视觉对比(这对图标或其它图像发生改变时很有用)的选项有 -ca 或 --compare=appearance。而 -v=1 或 --verbose=1 选项则用于报告差异(或者对匹配文件不作任何回应);使用 -v=0 选项取消报告,或者 -v=2 来同时报告不同的和匹配的文件。 -### 安装comparepdf到Ubuntu ### +#### 安装comparepdf到Ubuntu #### 打开终端,然后运行以下命令 @@ -19,17 +19,17 @@ comparepdf是一个命令行应用,用于将两个PDF文件进行对比。默 comparepdf [OPTIONS] file1.pdf file2.pdf -**Diffpdf** +###Diffpdf### DiffPDF是一个图形化应用程序,用于对两个PDF文件进行对比。默认情况下,它只会对比两个相关页面的文字,但是也支持对图形化页面进行对比(例如,如果图表被修改过,或者段落被重新格式化过)。它也可以对特定的页面或者页面范围进行对比。例如,如果同一个PDF文件有两个版本,其中一个有页面1-12,而另一个则有页面1-13,因为这里添加了一个额外的页面4,它们可以通过指定两个页面范围来进行对比,第一个是1-12,而1-3,5-13则可以作为第二个页面范围。这将使得DiffPDF成对地对比这些页面(1,1),(2,2),(3,3),(4,5),(5,6),以此类推,直到(12,13)。 -### 安装 diffpdf 到 ubuntu ### +#### 安装 diffpdf 到 ubuntu #### 打开终端,然后运行以下命令 sudo apt-get install diffpdf -### 截图 ### +#### 截图 #### ![](http://www.ubuntugeek.com/wp-content/uploads/2015/07/14.png) @@ -41,7 +41,7 @@ via: http://www.ubuntugeek.com/compare-pdf-files-on-ubuntu.html 作者:[ruchi][a] 译者:[GOLinux](https://github.com/GOLinux) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 07af5c5aa9a77aeb84e0faa8874660c511116f95 Mon Sep 17 00:00:00 2001 From: Chang Liu Date: Tue, 4 Aug 2015 06:51:47 +0800 Subject: [PATCH 792/965] =?UTF-8?q?=E7=A7=BB=E5=8A=A8=E8=AF=91=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20150128 7 communities driving open source development.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/talk/20150128 7 communities driving open source development.md (100%) diff --git a/sources/talk/20150128 7 communities driving open source development.md b/translated/talk/20150128 7 communities driving open source development.md similarity index 100% rename from sources/talk/20150128 7 communities driving open source development.md rename to translated/talk/20150128 7 communities driving open source development.md From 065cdbb77acac0170f8604631294c1790fd55bb5 Mon Sep 17 00:00:00 2001 From: Chang Liu Date: Tue, 4 Aug 2015 07:04:09 +0800 Subject: [PATCH 793/965] Update 20150803 Linux Logging Basics.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 准备翻译该篇。 --- sources/tech/20150803 Linux Logging Basics.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150803 Linux Logging Basics.md b/sources/tech/20150803 Linux Logging Basics.md index d20f68f140..6c3c3693a4 100644 --- a/sources/tech/20150803 Linux Logging Basics.md +++ b/sources/tech/20150803 Linux Logging Basics.md @@ -1,3 +1,5 @@ +FSSlc translating + Linux Logging Basics ================================================================================ First we’ll describe the basics of what Linux logs are, where to find them, and how they get created. If you already know this stuff, feel free to skip to the next section. @@ -87,4 +89,4 @@ via: http://www.loggly.com/ultimate-guide/logging/linux-logging-basics/ [4]:https://tools.ietf.org/html/rfc5424#section-6.2.3 [5]:https://tools.ietf.org/html/rfc5424#section-6.2.4 [6]:https://tools.ietf.org/html/rfc5424#section-6.2.5 -[7]:https://tools.ietf.org/html/rfc5424#section-6.2.1 \ No newline at end of file +[7]:https://tools.ietf.org/html/rfc5424#section-6.2.1 From 0a2bc302010ada1e2f78027cc3965b655e62aa56 Mon Sep 17 00:00:00 2001 From: joeren Date: Tue, 4 Aug 2015 07:54:44 +0800 Subject: [PATCH 794/965] Change --- github 2.0测试.txt | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 github 2.0测试.txt diff --git a/github 2.0测试.txt b/github 2.0测试.txt deleted file mode 100644 index 7787faa3c1..0000000000 --- a/github 2.0测试.txt +++ /dev/null @@ -1,2 +0,0 @@ -111 -222 \ No newline at end of file From 6811374932148a3ce7bfe446c8670a63ace04b3e Mon Sep 17 00:00:00 2001 From: struggling <630441839@qq.com> Date: Tue, 4 Aug 2015 09:08:16 +0800 Subject: [PATCH 795/965] =?UTF-8?q?Create=20Setting=20up=20RAID=201=20(Mir?= =?UTF-8?q?roring)=20using=20=E2=80=98Two=20Disks=E2=80=99=20in=20Linux=20?= =?UTF-8?q?=E2=80=93=20Part=203?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...oring) using ‘Two Disks’ in Linux – Part 3 | 217 ++++++++++++++++++ 1 file changed, 217 insertions(+) create mode 100644 translated/tech/Setting up RAID 1 (Mirroring) using ‘Two Disks’ in Linux – Part 3 diff --git a/translated/tech/Setting up RAID 1 (Mirroring) using ‘Two Disks’ in Linux – Part 3 b/translated/tech/Setting up RAID 1 (Mirroring) using ‘Two Disks’ in Linux – Part 3 new file mode 100644 index 0000000000..948e530ed8 --- /dev/null +++ b/translated/tech/Setting up RAID 1 (Mirroring) using ‘Two Disks’ in Linux – Part 3 @@ -0,0 +1,217 @@ +在 Linux 中使用"两个磁盘"创建 RAID 1(镜像) - 第3部分 +================================================================================ +RAID 镜像意味着相同数据的完整克隆(或镜像)写入到两个磁盘中。创建 RAID1 至少需要两个磁盘,它的读取性能或者可靠性比数据存储容量更好。 + + +![Create Raid1 in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Create-RAID1-in-Linux.jpeg) + +在 Linux 中设置 RAID1 + +创建镜像是为了防止因硬盘故障导致数据丢失。镜像中的每个磁盘包含数据的完整副本。当一个磁盘发生故障时,相同的数据可以从其它正常磁盘中读取。而后,可以从正在运行的计算机中直接更换发生故障的磁盘,无需任何中断。 + +### RAID 1 的特点 ### + +-镜像具有良好的性能。 + +-磁盘利用率为50%。也就是说,如果我们有两个磁盘每个500GB,总共是1TB,但在镜像中它只会显示500GB。 + +-在镜像如果一个磁盘发生故障不会有数据丢失,因为两个磁盘中的内容相同。 + +-读取数据会比写入性能更好。 + +#### 要求 #### + + +创建 RAID 1 至少要有两个磁盘,你也可以添加更多的磁盘,磁盘数需为2,4,6,8的两倍。为了能够添加更多的磁盘,你的系统必须有 RAID 物理适配器(硬件卡)。 + +这里,我们使用软件 RAID 不是硬件 RAID,如果你的系统有一个内置的物理硬件 RAID 卡,你可以从它的 UI 组件或使用 Ctrl + I 键来访问它。 + +需要阅读: [Basic Concepts of RAID in Linux][1] + +#### 在我的服务器安装 #### + + Operating System : CentOS 6.5 Final + IP Address : 192.168.0.226 + Hostname : rd1.tecmintlocal.com + Disk 1 [20GB] : /dev/sdb + Disk 2 [20GB] : /dev/sdc + +本文将指导你使用 mdadm (创建和管理 RAID 的)一步一步的建立一个软件 RAID 1 或镜像在 Linux 平台上。但同样的做法也适用于其它 Linux 发行版如 RedHat,CentOS,Fedora 等等。 + +### 第1步:安装所需要的并且检查磁盘 ### + +1.正如我前面所说,在 Linux 中我们需要使用 mdadm 软件来创建和管理 RAID。所以,让我们用 yum 或 apt-get 的软件包管理工具在 Linux 上安装 mdadm 软件包。 + + # yum install mdadm [on RedHat systems] + # apt-get install mdadm [on Debain systems] + +2. 一旦安装好‘mdadm‘包,我们需要使用下面的命令来检查磁盘是否已经配置好。 + + # mdadm -E /dev/sd[b-c] + +![Check RAID on Disks](http://www.tecmint.com/wp-content/uploads/2014/10/Check-RAID-on-Disks.png) + +检查 RAID 的磁盘 + + +正如你从上面图片看到的,没有检测到任何超级块,这意味着还没有创建RAID。 + +### 第2步:为 RAID 创建分区 ### + +3. 正如我提到的,我们最少使用两个分区 /dev/sdb 和 /dev/sdc 来创建 RAID1。我们首先使用‘fdisk‘命令来创建这两个分区并更改其类型为 raid。 + + # fdisk /dev/sdb + +按照下面的说明 + +- 按 ‘n’ 创建新的分区。 +- 然后按 ‘P’ 选择主分区。 +- 接下来选择分区号为1。 +- 按两次回车键默认将整个容量分配给它。 +- 然后,按 ‘P’ 来打印创建好的分区。 +- 按 ‘L’,列出所有可用的类型。 +- 按 ‘t’ 修改分区类型。 +- 键入 ‘fd’ 设置为Linux 的 RAID 类型,然后按 Enter 确认。 +- 然后再次使用‘p’查看我们所做的更改。 +- 使用‘w’保存更改。 + +![Create Disk Partitions](http://www.tecmint.com/wp-content/uploads/2014/10/Create-Disk-Partitions.png) + +创建磁盘分区 + +在创建“/dev/sdb”分区后,接下来按照同样的方法创建分区 /dev/sdc 。 + + # fdisk /dev/sdc + +![Create Second Partitions](http://www.tecmint.com/wp-content/uploads/2014/10/Create-Second-Partitions.png) + +创建第二个分区 + +4. 一旦这两个分区创建成功后,使用相同的命令来检查 sdb & sdc 分区并确认 RAID 分区的类型如上图所示。 + + # mdadm -E /dev/sd[b-c] + +![Verify Partitions Changes](http://www.tecmint.com/wp-content/uploads/2014/10/Verify-Partitions-Changes.png) + +验证分区变化 + +![Check RAID Type](http://www.tecmint.com/wp-content/uploads/2014/10/Check-RAID-Type.png) + +检查 RAID 类型 + +**注意**: 正如你在上图所看到的,在 sdb1 和 sdc1 中没有任何对 RAID 的定义,这就是我们没有检测到超级块的原因。 + +### 步骤3:创建 RAID1 设备 ### + +5.接下来使用以下命令来创建一个名为 /dev/md0 的“RAID1”设备并验证它 + + # mdadm --create /dev/md0 --level=mirror --raid-devices=2 /dev/sd[b-c]1 + # cat /proc/mdstat + +![Create RAID Device](http://www.tecmint.com/wp-content/uploads/2014/10/Create-RAID-Device.png) + +创建RAID设备 + +6. 接下来使用如下命令来检查 RAID 设备类型和 RAID 阵列 + + # mdadm -E /dev/sd[b-c]1 + # mdadm --detail /dev/md0 + +![Check RAID Device type](http://www.tecmint.com/wp-content/uploads/2014/10/Check-RAID-Device-type.png) + +检查 RAID 设备类型 + +![Check RAID Device Array](http://www.tecmint.com/wp-content/uploads/2014/10/Check-RAID-Device-Array.png) + +检查 RAID 设备阵列 + +从上图中,人们很容易理解,RAID1 已经使用的 /dev/sdb1 和 /dev/sdc1 分区被创建,你也可以看到状态为 resyncing。 + +### 第4步:在 RAID 设备上创建文件系统 ### + +7. 使用 ext4 为 md0 创建文件系统并挂载到 /mnt/raid1 . + + # mkfs.ext4 /dev/md0 + +![Create RAID Device Filesystem](http://www.tecmint.com/wp-content/uploads/2014/10/Create-RAID-Device-Filesystem.png) + +创建 RAID 设备文件系统 + +8. 接下来,挂载新创建的文件系统到“/mnt/raid1”,并创建一些文件,验证在挂载点的数据 + + # mkdir /mnt/raid1 + # mount /dev/md0 /mnt/raid1/ + # touch /mnt/raid1/tecmint.txt + # echo "tecmint raid setups" > /mnt/raid1/tecmint.txt + +![Mount Raid Device](http://www.tecmint.com/wp-content/uploads/2014/10/Mount-RAID-Device.png) + +挂载 RAID 设备 + +9.为了在系统重新启动自动挂载 RAID1,需要在 fstab 文件中添加条目。打开“/etc/fstab”文件并添加以下行。 + + /dev/md0 /mnt/raid1 ext4 defaults 0 0 + +![Raid Automount Device](http://www.tecmint.com/wp-content/uploads/2014/10/RAID-Automount-Filesystem.png) + +自动挂载 Raid 设备 + +10. 运行“mount -a”,检查 fstab 中的条目是否有错误 + # mount -av + +![Check Errors in fstab](http://www.tecmint.com/wp-content/uploads/2014/10/Check-Errors-in-fstab.png) + +检查 fstab 中的错误 + +11. 接下来,使用下面的命令保存 raid 的配置到文件“mdadm.conf”中。 + + # mdadm --detail --scan --verbose >> /etc/mdadm.conf + +![Save Raid Configuration](http://www.tecmint.com/wp-content/uploads/2014/10/Save-Raid-Configuration.png) + +保存 Raid 的配置 + +上述配置文件在系统重启时会读取并加载 RAID 设备。 + +### 第5步:在磁盘故障后检查数据 ### + +12.我们的主要目的是,即使在任何磁盘故障或死机时必须保证数据是可用的。让我们来看看,当任何一个磁盘不可用时会发生什么。 + + # mdadm --detail /dev/md0 + +![Raid Device Verify](http://www.tecmint.com/wp-content/uploads/2014/10/Raid-Device-Verify.png) + +验证 Raid 设备 + +在上面的图片中,我们可以看到在 RAID 中有2个设备是可用的并且 Active Devices 是2.现在让我们看看,当一个磁盘拔出(移除 sdc 磁盘)或损坏后会发生什么。 + + # ls -l /dev | grep sd + # mdadm --detail /dev/md0 + +![Test RAID Devices](http://www.tecmint.com/wp-content/uploads/2014/10/Test-RAID-Devices.png) + +测试 RAID 设备 + +现在,在上面的图片中你可以看到,一个磁盘不见了。我从虚拟机上删除了一个磁盘。此时让我们来检查我们宝贵的数据。 + + # cd /mnt/raid1/ + # cat tecmint.txt + +![Verify RAID Data](http://www.tecmint.com/wp-content/uploads/2014/10/Verify-RAID-Data.png) + +验证 RAID 数据 + +你有没有看到我们的数据仍然可用。由此,我们可以知道 RAID 1(镜像)的优势。在接下来的文章中,我们将看到如何设置一个 RAID 5 条带化分布式奇偶校验。希望这可以帮助你了解 RAID 1(镜像)是如何工作的。 + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/create-raid1-in-linux/ + +作者:[Babin Lonston][a] +译者:[strugglingyouth](https://github.com/strugglingyouth) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/babinlonston/ +[1]:http://www.tecmint.com/understanding-raid-setup-in-linux/ From 2ec2917fdba92c31201a7bdde94ac2e8befb41ed Mon Sep 17 00:00:00 2001 From: struggling <630441839@qq.com> Date: Tue, 4 Aug 2015 09:09:17 +0800 Subject: [PATCH 796/965] =?UTF-8?q?Create=20Creating=20RAID=205=20(Stripin?= =?UTF-8?q?g=20with=20Distributed=20Parity)=20in=20Linux=20=E2=80=93=20Par?= =?UTF-8?q?t=204?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...with Distributed Parity) in Linux – Part 4 | 285 ++++++++++++++++++ 1 file changed, 285 insertions(+) create mode 100644 translated/tech/Creating RAID 5 (Striping with Distributed Parity) in Linux – Part 4 diff --git a/translated/tech/Creating RAID 5 (Striping with Distributed Parity) in Linux – Part 4 b/translated/tech/Creating RAID 5 (Striping with Distributed Parity) in Linux – Part 4 new file mode 100644 index 0000000000..7de5199a08 --- /dev/null +++ b/translated/tech/Creating RAID 5 (Striping with Distributed Parity) in Linux – Part 4 @@ -0,0 +1,285 @@ + +在 Linux 中创建 RAID 5(条带化与分布式奇偶校验) - 第4部分 +================================================================================ +在 RAID 5 中,条带化数据跨多个驱磁盘使用分布式奇偶校验。分布式奇偶校验的条带化意味着它将奇偶校验信息和条带中的数据分布在多个磁盘上,它将有很好的数据冗余。 + +![Setup Raid 5 in CentOS](http://www.tecmint.com/wp-content/uploads/2014/11/setup-raid-5-in-linux.jpg) + +在 Linux 中配置 RAID 5 + +对于此 RAID 级别它至少应该有三个或更多个磁盘。RAID 5 通常被用于大规模生产环境中花费更多的成本来提供更好的数据冗余性能。 + +#### 什么是奇偶校验? #### + +奇偶校验是在数据存储中检测错误最简单的一个方法。奇偶校验信息存储在每个磁盘中,比如说,我们有4个磁盘,其中一个磁盘空间被分割去存储所有磁盘的奇偶校验信息。如果任何一个磁盘出现故障,我们可以通过更换故障磁盘后,从奇偶校验信息重建得到原来的数据。 + +#### RAID 5 的优点和缺点 #### + +- 提供更好的性能 +- 支持冗余和容错。 +- 支持热备份。 +- 将失去一个磁盘的容量存储奇偶校验信息。 +- 单个磁盘发生故障后不会丢失数据。我们可以更换故障硬盘后从奇偶校验信息中重建数据。 +- 事务处理读操作会更快。 +- 由于奇偶校验占用资源,写操作将是缓慢的。 +- 重建需要很长的时间。 + +#### 要求 #### +创建 RAID 5 最少需要3个磁盘,你也可以添加更多的磁盘,前提是你要有多端口的专用硬件 RAID 控制器。在这里,我们使用“mdadm”包来创建软件 RAID。 + +mdadm 是一个允许我们在 Linux 下配置和管理 RAID 设备的包。默认情况下 RAID 没有可用的配置文件,我们在创建和配置 RAID 后必须将配置文件保存在一个单独的文件中,例如:mdadm.conf。 + +在进一步学习之前,我建议你通过下面的文章去了解 Linux 中 RAID 的基础知识。 + +- [Basic Concepts of RAID in Linux – Part 1][1] +- [Creating RAID 0 (Stripe) in Linux – Part 2][2] +- [Setting up RAID 1 (Mirroring) in Linux – Part 3][3] + +#### 我的服务器设置 #### + + Operating System : CentOS 6.5 Final + IP Address : 192.168.0.227 + Hostname : rd5.tecmintlocal.com + Disk 1 [20GB] : /dev/sdb + Disk 2 [20GB] : /dev/sdc + Disk 3 [20GB] : /dev/sdd + +这篇文章是 RAID 系列9教程的第4部分,在这里我们要建立一个软件 RAID 5(分布式奇偶校验)使用三个20GB(名为/dev/sdb, /dev/sdc 和 /dev/sdd)的磁盘在 Linux 系统或服务器中上。 + +### 第1步:安装 mdadm 并检验磁盘 ### + +1.正如我们前面所说,我们使用 CentOS 6.5 Final 版本来创建 RAID 设置,但同样的做法也适用于其他 Linux 发行版。 + + # lsb_release -a + # ifconfig | grep inet + +![Setup Raid 5 in CentOS](http://www.tecmint.com/wp-content/uploads/2014/11/CentOS-6.5-Summary.png) + +CentOS 6.5 摘要 + +2. 如果你按照我们的 RAID 系列去配置的,我们假设你已经安装了“mdadm”包,如果没有,根据你的 Linux 发行版使用下面的命令安装。 + + # yum install mdadm [on RedHat systems] + # apt-get install mdadm [on Debain systems] + +3. “mdadm”包安装后,先使用‘fdisk‘命令列出我们在系统上增加的三个20GB的硬盘。 + + # fdisk -l | grep sd + +![Install mdadm Tool in CentOS](http://www.tecmint.com/wp-content/uploads/2014/11/Install-mdadm-Tool.png) + +安装 mdadm 工具 + +4. 现在该检查这三个磁盘是否存在 RAID 块,使用下面的命令来检查。 + + # mdadm -E /dev/sd[b-d] + # mdadm --examine /dev/sdb /dev/sdc /dev/sdd + +![Examine Drives For Raid](http://www.tecmint.com/wp-content/uploads/2014/11/Examine-Drives-For-Raid.png) + +检查 Raid 磁盘 + +**注意**: 上面的图片说明,没有检测到任何超级块。所以,这三个磁盘中没有定义 RAID。让我们现在开始创建一个吧! + +### 第2步:为磁盘创建 RAID 分区 ### + +5. 首先,在创建 RAID 前我们要为磁盘分区(/dev/sdb, /dev/sdc 和 /dev/sdd),在进行下一步之前,先使用‘fdisk’命令进行分区。 + + # fdisk /dev/sdb + # fdisk /dev/sdc + # fdisk /dev/sdd + +#### 创建 /dev/sdb 分区 #### + +请按照下面的说明在 /dev/sdb 硬盘上创建分区。 + +- 按 ‘n’ 创建新的分区。 +- 然后按 ‘P’ 选择主分区。选择主分区是因为还没有定义过分区。 +- 接下来选择分区号为1。默认就是1. +- 这里是选择柱面大小,我们没必要选择指定的大小,因为我们需要为 RAID 使用整个分区,所以只需按两次 Enter 键默认将整个容量分配给它。 +- 然后,按 ‘P’ 来打印创建好的分区。 +- 改变分区类型,按 ‘L’可以列出所有可用的类型。 +- 按 ‘t’ 修改分区类型。 +- 这里使用‘fd’设置为 RAID 的类型。 +- 然后再次使用‘p’查看我们所做的更改。 +- 使用‘w’保存更改。 + +![Create sdb Partition](http://www.tecmint.com/wp-content/uploads/2014/11/Create-sdb-Partition1.png) + +创建 sdb 分区 + +**注意**: 我们仍要按照上面的步骤来创建 sdc 和 sdd 的分区。 + +#### 创建 /dev/sdc 分区 #### + +现在,通过下面的截图给出创建 sdc 和 sdd 磁盘分区的方法,或者你可以按照上面的步骤。 + + # fdisk /dev/sdc + +![Create sdc Partition](http://www.tecmint.com/wp-content/uploads/2014/11/Create-sdc-Partition1.png) + +创建 sdc 分区 + +#### 创建 /dev/sdd 分区 #### + + # fdisk /dev/sdd + +![Create sdd Partition](http://www.tecmint.com/wp-content/uploads/2014/11/Create-sdd-Partition1.png) + +创建 sdd 分区 + +6. 创建分区后,检查三个磁盘 sdb, sdc, sdd 的变化。 + + # mdadm --examine /dev/sdb /dev/sdc /dev/sdd + + or + + # mdadm -E /dev/sd[b-c] + +![Check Partition Changes](http://www.tecmint.com/wp-content/uploads/2014/11/Check-Changes-on-Partitions.png) + +检查磁盘变化 + +**注意**: 在上面的图片中,磁盘的类型是 fd。 + +7.现在在新创建的分区检查 RAID 块。如果没有检测到超级块,我们就能够继续下一步,创建一个新的 RAID 5 的设置在这些磁盘中。 + +![Check Raid on Partition](http://www.tecmint.com/wp-content/uploads/2014/11/Check-Raid-on-Partitions.png) + +在分区中检查 Raid + +### 第3步:创建 md 设备 md0 ### + +8. 现在创建一个 RAID 设备“md0”(即 /dev/md0)使用所有新创建的分区(sdb1, sdc1 and sdd1) ,使用以下命令。 + + # mdadm --create /dev/md0 --level=5 --raid-devices=3 /dev/sdb1 /dev/sdc1 /dev/sdd1 + + or + + # mdadm -C /dev/md0 -l=5 -n=3 /dev/sd[b-d]1 + +9. 创建 RAID 设备后,检查并确认 RAID,包括设备和从 mdstat 中输出的 RAID 级别。 + + # cat /proc/mdstat + +![Verify Raid Device](http://www.tecmint.com/wp-content/uploads/2014/11/Verify-Raid-Device.png) + +验证 Raid 设备 + +如果你想监视当前的创建过程,你可以使用‘watch‘命令,使用 watch ‘cat /proc/mdstat‘,它会在屏幕上显示且每隔1秒刷新一次。 + + # watch -n1 cat /proc/mdstat + +![Monitor Raid Process](http://www.tecmint.com/wp-content/uploads/2014/11/Monitor-Raid-Process.png) + +监控 Raid 5 过程 + +![Raid 5 Process Summary](http://www.tecmint.com/wp-content/uploads/2014/11/Raid-Process-Summary.png) + +Raid 5 过程概要 + +10. 创建 RAID 后,使用以下命令验证 RAID 设备 + + # mdadm -E /dev/sd[b-d]1 + +![Verify Raid Level](http://www.tecmint.com/wp-content/uploads/2014/11/Verify-Raid-Level.png) + +验证 Raid 级别 + +**注意**: 因为它显示三个磁盘的信息,上述命令的输出会有点长。 + +11. 接下来,验证 RAID 阵列的假设,这包含正在运行 RAID 的设备,并开始重新同步。 + + # mdadm --detail /dev/md0 + +![Verify Raid Array](http://www.tecmint.com/wp-content/uploads/2014/11/Verify-Raid-Array.png) + +验证 Raid 阵列 + +### 第4步:为 md0 创建文件系统### + +12. 在挂载前为“md0”设备创建 ext4 文件系统。 + + # mkfs.ext4 /dev/md0 + +![Create md0 Filesystem](http://www.tecmint.com/wp-content/uploads/2014/11/Create-md0-Filesystem.png) + +创建 md0 文件系统 + +13.现在,在‘/mnt‘下创建目录 raid5,然后挂载文件系统到 /mnt/raid5/ 下并检查下挂载点的文件,你会看到 lost+found 目录。 + + # mkdir /mnt/raid5 + # mount /dev/md0 /mnt/raid5/ + # ls -l /mnt/raid5/ + +14. 在挂载点 /mnt/raid5 下创建几个文件,并在其中一个文件中添加一些内容然后去验证。 + + # touch /mnt/raid5/raid5_tecmint_{1..5} + # ls -l /mnt/raid5/ + # echo "tecmint raid setups" > /mnt/raid5/raid5_tecmint_1 + # cat /mnt/raid5/raid5_tecmint_1 + # cat /proc/mdstat + +![Mount Raid 5 Device](http://www.tecmint.com/wp-content/uploads/2014/11/Mount-Raid-Device.png) + +挂载 Raid 设备 + +15. 我们需要在 fstab 中添加条目,否则系统重启后将不会显示我们的挂载点。然后编辑 fstab 文件添加条目,在文件尾追加以下行,如下图所示。挂载点会根据你环境的不同而不同。 + + # vim /etc/fstab + + /dev/md0 /mnt/raid5 ext4 defaults 0 0 + +![Raid 5 Automount](http://www.tecmint.com/wp-content/uploads/2014/11/Raid-Device-Automount.png) + +自动挂载 Raid 5 + +16. 接下来,运行‘mount -av‘命令检查 fstab 条目中是否有错误。 + + # mount -av + +![Check Fstab Errors](http://www.tecmint.com/wp-content/uploads/2014/11/Check-Fstab-Errors.png) + +检查 Fstab 错误 + +### 第5步:保存 Raid 5 的配置 ### + +17. 在前面章节已经说过,默认情况下 RAID 没有配置文件。我们必须手动保存。如果此步不跟 RAID 设备将不会存在 md0,它将会跟一些其他数子。 + +所以,我们必须要在系统重新启动之前保存配置。如果配置保存它在系统重新启动时会被加载到内核中然后 RAID 也将被加载。 + + # mdadm --detail --scan --verbose >> /etc/mdadm.conf + +![Save Raid 5 Configuration](http://www.tecmint.com/wp-content/uploads/2014/11/Save-Raid-5-Configuration.png) + +保存 Raid 5 配置 + +注意:保存配置将保持 RAID 级别的稳定性在 md0 设备中。 + +### 第6步:添加备用磁盘 ### + +18.备用磁盘有什么用?它是非常有用的,如果我们有一个备用磁盘,当我们阵列中的任何一个磁盘发生故障后,这个备用磁盘会主动添加并重建进程,并从其他磁盘上同步数据,所以我们可以在这里看到冗余。 + +更多关于添加备用磁盘和检查 RAID 5 容错的指令,请阅读下面文章中的第6步和第7步。 + +- [Add Spare Drive to Raid 5 Setup][4] + +### 结论 ### + +在这篇文章中,我们已经看到了如何使用三个磁盘配置一个 RAID 5 。在接下来的文章中,我们将看到如何故障排除并且当 RAID 5 中的一个磁盘损坏后如何恢复。 + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/create-raid-5-in-linux/ + +作者:[Babin Lonston][a] +译者:[strugglingyouth](https://github.com/strugglingyouth) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/babinlonston/ +[1]:http://www.tecmint.com/understanding-raid-setup-in-linux/ +[2]:http://www.tecmint.com/create-raid0-in-linux/ +[3]:http://www.tecmint.com/create-raid1-in-linux/ +[4]:http://www.tecmint.com/create-raid-6-in-linux/ From 593eb1799e96e40d4a8d88141bf4de850382f253 Mon Sep 17 00:00:00 2001 From: XLCYun Date: Tue, 4 Aug 2015 09:30:10 +0800 Subject: [PATCH 797/965] Update 20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 1 - Introduction.md --- ...ktop--What They Get Right & Wrong - Page 1 - Introduction.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/translated/tech/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 1 - Introduction.md b/translated/tech/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 1 - Introduction.md index de47f0864e..39f29af147 100644 --- a/translated/tech/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 1 - Introduction.md +++ b/translated/tech/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 1 - Introduction.md @@ -36,7 +36,7 @@ ![](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_login3_show&w=1920) -切换到上流的Breeve主题……突然间,我抱怨的大部分问题都被完善了。通用图标,所有东西都放在了屏幕中央,但不是那么重要的被放到了一边。因为屏幕顶部和底部都是同样的空白,在中间也就酝酿出了一种美好的和谐。还是有一个输入框来切换会话,但既然电源按钮被做成了通用图标,那么这点还算可以原谅。当然gnome还是有一些很好的附加物,例如音量小程序和可访问按钮,但Breeze总归是Fedora的KDE主题的一个进步。 +切换到upstream的Breeve主题……突然间,我抱怨的大部分问题都被完善了。通用图标,所有东西都放在了屏幕中央,但不是那么重要的被放到了一边。因为屏幕顶部和底部都是同样的空白,在中间也就酝酿出了一种美好的和谐。还是有一个输入框来切换会话,但既然电源按钮被做成了通用图标,那么这点还算可以原谅。当然gnome还是有一些很好的附加物,例如音量小程序和可访问按钮,但Breeze总归是Fedora的KDE主题的一个进步。 到Windows(Windows 8和10之前)或者OS X中去,你会看到类似的东西——非常简洁的,“不挡你道”的锁屏与登录界面,它们都没有输入框或者其它分散视觉的小工具。这是一种有效的不分散人注意力的设计。Fedora……默认装有Breeze。VDG在Breeze主题设计上干得不错。可别糟蹋了它。 From bba6ac1d9e04d9cdf1a2d35a77a549e83873350d Mon Sep 17 00:00:00 2001 From: XLCYun Date: Tue, 4 Aug 2015 09:34:03 +0800 Subject: [PATCH 798/965] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=8E=9F=E6=96=87=20?= =?UTF-8?q?=20XLCYun?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...t & Wrong - Page 3 - GNOME Applications.md | 62 ------------------- 1 file changed, 62 deletions(-) delete mode 100644 sources/tech/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 3 - GNOME Applications.md diff --git a/sources/tech/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 3 - GNOME Applications.md b/sources/tech/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 3 - GNOME Applications.md deleted file mode 100644 index c70978dc9b..0000000000 --- a/sources/tech/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 3 - GNOME Applications.md +++ /dev/null @@ -1,62 +0,0 @@ -Translating by XLCYun. -A Week With GNOME As My Linux Desktop: What They Get Right & Wrong - Page 3 - GNOME Applications -================================================================================ -### Applications ### - -![](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_videos_show&w=1920) - -This is the one area where things are basically a wash. Each environment has a few applications that are really nice, and a few that are not so great. Once again though, Gnome gets the little things right in a way that KDE completely misses. None of KDE's applications are bad or broken, that's not what I'm saying. They function. But that's about it. To use an analogy: they passed the test, but they sure didn't get any where close to 100% on it. - -Gnome on left, KDE on right. Dragon performs perfectly fine, it has clearly marked buttons for playing a file, URL, or a disc, just as you can do under Gnome Videos... but Gnome takes it one extra little step further in the name of convenience and user friendliness: they show all the videos detected under your system by default, without you having to do anything. KDE has Baloo-- just as they had Nepomuk before that-- why not use them? They've got a list video files that are freely accessible... but don't make use of the feature. - -Moving on... Music Players. - -![](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_rhythmbox_show&w=1920) - -![](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_amarok_show&w=1920) - -Both of these applications, Rhythmbox on the left and Amarok on the right were opened up and then a screenshot was immediately taken, nothing was clicked, or altered. See the difference? Rhythmbox looks like a music player. It's direct, there's obvious ways to sort the results, it knows what is trying to be and what it's job is: to play music. - -Amarok feels like one of the tech demos, or library demos where someone puts every option and extension they possible can all inside one application in order to show them off-- it's never something that gets shipped as production, it's just there to show off bits and pieces. And that's exactly what Amarok feels like: its someone trying to show off every single possible cool thing they shove into a media player without ever stopping to think "Wait, what were trying to write again? An app to play music?" - -Just look at the default layout. What is front and center for the user? A visualizer and Wikipedia integration-- the largest and most prominent column on the page. What's the second largest? Playlist list. Third largest, aka smallest? The actual music listing. How on earth are these sane defaults for a core application? - -Software Managers! Something that has seen a lot of push in recent years and will likely only see a bigger push in the months to come. Unfortunately, it's another area where KDE was so close... and then fell on its face right at the finish line. - -![](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_software_show&w=1920) - -![](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_apper_show&w=1920) - -![](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_muon_show&w=1920) - -Gnome Software is probably my new favorite software center, minus one gripe which I will get to in a bit. Muon, I wanted to like you. I really did. But you are a design nightmare. When the VDG was drawing up plans for you (mockup below), you looked pretty slick. Good use of white space, clean design, nice category listing, your whole not-being-split-into-two-applications. - -![](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_muon1_show&w=1920) - -Then someone got around to coding you and doing your actual UI, and I can only guess they were drunk while they did it. - -Let's look at Gnome Software. What's smack dab in the middle? The application, its screenshots, its description, etc. What's smack dab in the middle of Muon? Gigantic waste of white space. Gnome Software also includes the lovely convenience feature of putting a "Launch" button right there in case you already have an application installed. Convenience and ease of use are important, people. Honestly, JUST having things in Muon be centered aligned would probably make things look better already. - -What's along the top edge of Gnome Software, like a tab listing? All Software, Installed, Updates. Clean language, direct, to the point. Muon? Well, we have "Discover", which works okay as far as language goes, and then we have Installed, and then nothing. Where's updates? - -Well.. the developers decided to split updates off into its own application, thus requiring you to open two applications to handle your software-- one to install it, and one to update it-- going against every Software Center paradigm that has ever existed since the Synaptic graphical package manager. - -I'm not going to show it in a screenshot just because I don't want to have to clean up my system afterwards, but if you go into Muon and start installing something the way it shows that is by adding a little tab to the bottom of your screen with the application's name. That tab doesn't go away when the application is done installing either, so if you're installing a lot of applications at a single time then you'll just slowly accumulate tabs along the bottom that you then have to go through and clean up manually, because if you don't then they grow off the screen and you have to swipe through them all to get to the most recent ones. Think: opening 50 tabs in Firefox. Major annoyance, major inconvenience. - -I did say I would bash on Gnome a bit, and I meant it. Muon does get one thing very right that Gnome Software doesn't. Under the settings bar Muon has an option for "Show Technical Packages" aka: compilers, software libraries, non-graphical applications, applications without AppData, etc. Gnome doesn't. If you want to install any of those you have to drop down to the terminal. I think that's wrong. I certainly understand wanting to push AppData but I think they pushed it too soon. What made me realize Gnome didn't have this setting was when I went to install PowerTop and couldn't get Gnome to display it-- no AppData, no "Show Technical Packages" setting. - -Doubly unfortunate is the fact that you can't "just use apper" if you're under KDE since... - -![](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_apperlocal_show&w=1920) - -Apper's support for installing local packages has been broken for since Fedora 19 or so, almost two years. I love the attention to detail and quality. - --------------------------------------------------------------------------------- - -via: http://www.phoronix.com/scan.php?page=article&item=gnome-week-editorial&num=3 - -作者:Eric Griffith -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From f7e118d42898004ec5ce6ce2c842c94822a2f148 Mon Sep 17 00:00:00 2001 From: XLCYun Date: Tue, 4 Aug 2015 09:39:34 +0800 Subject: [PATCH 799/965] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...t & Wrong - Page 3 - GNOME Applications.md | 61 +++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 translated/tech/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 3 - GNOME Applications.md diff --git a/translated/tech/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 3 - GNOME Applications.md b/translated/tech/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 3 - GNOME Applications.md new file mode 100644 index 0000000000..42539badcc --- /dev/null +++ b/translated/tech/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 3 - GNOME Applications.md @@ -0,0 +1,61 @@ +将GNOME作为我的Linux桌面的一周: 他们做对的与做错的 - 第三节 - GNOME应用 +================================================================================ +### 应用 ### + +![](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_videos_show&w=1920) + +这是一个基本上一潭死水的地方。每一个桌面环境都有一些非常好的和不怎么样的应用。再次强调,Gnome把那些KDE完全错失的小细节给做对了。我不是想说KDE中有哪些应用不好。他们都能工作。但仅此而已。也就是说:它们合格了,但确实还没有达到甚至接近100分。 + +Gnome的在左边,KDE的在右边。Dragon运行得很好,清晰的标出了播放文件、URL或和光盘的按钮,正如你在Gnome Videos中能做到的一样……但是在便利的文件名和用户的友好度方面,Gnome多走了一小步。它默认显示了在你的电脑上检测到的所有影像文件,不需要你做任何事情。KDE有Baloo——正如之前有Nepomuk——为什么不使用它们?它们能列出可读取的影像文件……但却没被使用。 + +下一步……音乐播放器 + +![](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_rhythmbox_show&w=1920) + +![](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_amarok_show&w=1920) + +这两个应用,左边的Rhythmbox和右边的Amarok,都是打开后没有做任何修改直接截屏的。看到差别了吗?Rhythmbox看起来像个音乐播放器,直接了当,排序文件的方法也很清晰,它知道它应该是什么样的,它的工作是什么:就是播放音乐。 + +Amarok感觉就像是某个人为了展示而把所有的扩展和选项都尽可能地塞进一个应用程序中去而做出来的一个技术演示产品(tech demos),或者一个库演示产品(library demos)——而这些是不应该做为产品装进去的,它只应该展示一些零碎的东西。而Amarok给人的感觉却是这样的:好像是某个人想把每一个感觉可能很酷的东西都塞进一个媒体播放器里,甚至都不停下来想“我想写啥来着?一个播放音乐的应用?” + +看看默认布局就行了。前面和中心都呈现了什么?一个可视化工具和维基集成(wikipedia integration)——占了整个页面最大和最显眼的区域。第二大的呢?播放列表。第三大,同时也是最小的呢?真正的音乐列表。这种默认设置对于一个核心应用来说,怎么可能称得上理智? + +软件管理器!它在最近几年当中有很大的进步,而且接下来的几个月中,很可能只能看到它更大的进步。不幸的是,这是另一个地方KDE做得差一点点就能……但还是在终点线前摔了脸。 + +![](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_software_show&w=1920) + +![](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_apper_show&w=1920) + +![](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_muon_show&w=1920) + +Gnome软件中心可能是我最新的最爱,先放下牢骚等下再发。Muon, 我想爱上你,真的。但你就是个设计上的梦魇。当VDG给你画设计草稿时(模型在下面),你看起来真漂亮。白色空间用得很好,设计简洁,类别列表也很好,你的整个“不要分开做成两个应用程序”的设计都很不错。 + +![](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_muon1_show&w=1920) + +接着就有人为你写代码,实现真正的UI,但是,我猜这些家伙当时一定是喝醉了。 + +我们来看看Gnome软件中心。正中间是什么?软件,软件截图和软件描述等等。Muon的正中心是什么?白白浪费的大块白色空间。Gnome软件中心还有一个贴心便利特点,那就是放了一个“运行“的按钮在那儿,以防你已经安装了这个软件。便利性和易用性很重要啊,大哥。说实话,仅仅让Muon把东西都居中对齐了可能看起来的效果都要好得多。 + +Gnome软件中心沿着顶部的东西是什么,像个标签列表?所有软件,已安装软件,软件升级。语言简洁,直接,直指要点。Muon,好吧,我们有个”发现“,这个语言表达上还算差强人意,然后我们又有一个”已安装软件“,然后,就没有然后了。软件升级哪去了? + +好吧……开发者决定把升级独立分开成一个应用程序,这样你就得打开两个应用程序才能管理你的软件——一个用来安装,一个用来升级——自从有了新得立图形软件包管理器以来,首次有这种破天荒的设计,与任何已存的软件中心的设计范例相违背。 + +我不想贴上截图给你们看,因为我不想等下还得清理我的电脑,如果你进入Muon安装了什么,那么它就会在屏幕下方根据安装的应用名创建一个标签,所以如果你一次性安装很多软件的话,那么下面的标签数量就会慢慢的增长,然后你就不得不手动检查清除它们,因为如果你不这样做,当标签增长到超过屏幕显示时,你就不得不一个个找过去来才能找到最近正在安装的软件。想想:在火狐浏览器打开50个标签。太烦人,太不方便! + +我说过我会给Gnome一点打击,我是认真的。Muon有一点做得比Gnome软件中心做得好。在Muon的设置栏下面有个“显示技术包”,即:编辑器,软件库,非图形应用程序,无AppData的应用等等(AppData,软件包中的一个特殊文件,用于专门存储软件的信息,译注)。Gnome则没有。如果你想安装其中任何一项你必须跑到终端操作。我想这是他们做得不对的一点。我完全理解他们推行AppData的心情,但我想他们太急了(推行所有软件包带有AppData,是Gnome软件中心的目标之一,译注)。我是在想安装PowerTop,而Gnome不显示这个软件时我才发现这点的——没有AppData,没有“显示技术包“设置。 + +更不幸的事实是你不能“用Apper就行了”,自从…… + +![](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_apperlocal_show&w=1920) + +Apper对安装本地软件包的支持大约在Fedora 19时就中止了,几乎两年了。我喜欢那种对细节与质量的关注。 + +-------------------------------------------------------------------------------- + +via: http://www.phoronix.com/scan.php?page=article&item=gnome-week-editorial&num=3 + +作者:Eric Griffith +译者:[XLCYun](https://github.com/XLCYun) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 6c78506ad82f4ca2fa473cb2e7e609813b5637f6 Mon Sep 17 00:00:00 2001 From: Ezio Date: Tue, 4 Aug 2015 09:48:34 +0800 Subject: [PATCH 800/965] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修改一些笔误 --- ...o run Ubuntu Snappy Core on Raspberry Pi 2.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/translated/tech/20150410 How to run Ubuntu Snappy Core on Raspberry Pi 2.md b/translated/tech/20150410 How to run Ubuntu Snappy Core on Raspberry Pi 2.md index c4475f39a2..f5e6fe60b2 100644 --- a/translated/tech/20150410 How to run Ubuntu Snappy Core on Raspberry Pi 2.md +++ b/translated/tech/20150410 How to run Ubuntu Snappy Core on Raspberry Pi 2.md @@ -2,13 +2,13 @@ ================================================================================ 物联网(Internet of Things, IoT) 时代即将来临。很快,过不了几年,我们就会问自己当初是怎么在没有物联网的情况下生存的,就像我们现在怀疑过去没有手机的年代。Canonical 就是一个物联网快速发展却还是开放市场下的竞争者。这家公司宣称自己把赌注压到了IoT 上,就像他们已经在“云”上做过的一样。。在今年一月底,Canonical 启动了一个基于Ubuntu Core 的小型操作系统,名字叫做 [Ubuntu Snappy Core][1] 。 -Snappy 是一种用来替代deb 的新的打包格式,是一个用来更新系统的前端,从CoreOS、红帽子和其他地方借鉴了原子更新这个想法。很快树莓派2 代投入市场,Canonical 就发布了用于树莓派的Snappy Core 版本。第一代树莓派因为是基于ARMv6 ,而Ubuntu 的ARM 镜像是基于ARMv7 ,所以不能运行ubuntu 。不过这种状况现在改变了,Canonical 通过发布用于RPI2 的镜像,抓住机会澄清了Snappy 就是一个用于云计算,特别是IoT 的系统。 +Snappy 是一种用来替代deb 的新的打包格式,是一个用来更新系统的前端,从CoreOS、红帽子和其他系统借鉴了**原子更新**这个想法。树莓派2 代投入市场,Canonical 很快就发布了用于树莓派的Snappy Core 版本。而第一代树莓派因为是基于ARMv6 ,Ubuntu 的ARM 镜像是基于ARMv7 ,所以不能运行ubuntu 。不过这种状况现在改变了,Canonical 通过发布用于RPI2 的镜像,抓住机会证明了Snappy 就是一个用于云计算,特别是用于物联网的系统。 -Snappy 同样可以运行在其它像Amazon EC2, Microsofts Azure, Google's Compute Engine 这样的云端上,也可以虚拟化在KVM、Virtuabox 和vagrant 上。Canonical 已经拥抱了微软、谷歌、Docker、OpenStack 这些重量级选手,同时也与一些小项目达成合作关系。除了一些创业公司,像Ninja Sphere、Erle Robotics,还有一些开发板生产商比如Odroid、Banana Pro, Udoo, PCDuino 和Parallella 、全志。Snappy Core 也希望很快能运行在路由器上,来帮助改进路由器生产商目前很少更新固件的策略。 +Snappy 同样可以运行在其它像Amazon EC2, Microsofts Azure, Google的 Compute Engine 这样的云端上,也可以虚拟化在KVM、Virtuabox 和vagrant 上。Canonical Ubuntu 已经拥抱了微软、谷歌、Docker、OpenStack 这些重量级选手,同时也与一些小项目达成合作关系。除了一些创业公司,比如Ninja Sphere、Erle Robotics,还有一些开发板生产商,比如Odroid、Banana Pro, Udoo, PCDuino 和Parallella 、全志,Snappy 也提供了支持。Snappy Core 同时也希望尽快运行到路由器上来帮助改进路由器生产商目前很少更新固件的策略。 接下来,让我们看看怎么样在树莓派2 上运行Snappy。 -用于树莓派2 的Snappy 镜像可以从 [Raspberry Pi 网站][2] 上下载。解压缩出来的镜像必须[写到一个至少8GB 大小的SD 卡][3]。尽管原始系统很小,但是院子升级和回滚功能会蚕食不小的空间。使用Snappy 启动树莓派2 后你就可以使用默认用户名和密码(都是ubuntu)登录系统。 +用于树莓派2 的Snappy 镜像可以从 [Raspberry Pi 网站][2] 上下载。解压缩出来的镜像必须[写到一个至少8GB 大小的SD 卡][3]。尽管原始系统很小,但是原子升级和回滚功能会占用不小的空间。使用Snappy 启动树莓派2 后你就可以使用默认用户名和密码(都是ubuntu)登录系统。 ![](https://farm8.staticflickr.com/7639/16428527263_f7bdd56a0d_c.jpg) @@ -18,7 +18,7 @@ sudo 已经配置好了可以直接用,安全起见,你应该使用以下命 或者也可以使用`adduser` 为你添加一个新用户。 -因为RPI缺少硬件始终,而Snappy 不知道这一点,所以系统会有一个小bug:处理命令时会报很多错。不过这个很容易解决: +因为RPI缺少硬件时钟,而Snappy 并不知道这一点,所以系统会有一个小bug:处理某些命令时会报很多错。不过这个很容易解决: 使用这个命令来确认这个bug 是否影响: @@ -36,7 +36,7 @@ sudo 已经配置好了可以直接用,安全起见,你应该使用以下命 $ sudo apt-get update && sudo apt-get distupgrade -现在将不会让你通过,因为Snappy 会使用它自己精简过的、基于dpkg 的包管理系统。这是做是应为Snappy 会运行很多嵌入式程序,而你也会想着所有事情尽可能的简化。 +不过这时系统不会让你通过,因为Snappy 使用它自己精简过的、基于dpkg 的包管理系统。这么做的原因是Snappy 会运行很多嵌入式程序,而同时你也会想着所有事情尽可能的简化。 让我们来看看最关键的部分,理解一下程序是如何与Snappy 工作的。运行Snappy 的SD 卡上除了boot 分区外还有3个分区。其中的两个构成了一个重复的文件系统。这两个平行文件系统被固定挂载为只读模式,并且任何时刻只有一个是激活的。第三个分区是一个部分可写的文件系统,用来让用户存储数据。通过更新系统,标记为'system-a' 的分区会保持一个完整的文件系统,被称作核心,而另一个平行文件系统仍然会是空的。 @@ -52,13 +52,13 @@ sudo 已经配置好了可以直接用,安全起见,你应该使用以下命 $ sudo snappy versions -a -经过更新-重启的操作,你应该可以看到被激活的核心已经被改变了。 +经过更新-重启两步操作,你应该可以看到被激活的核心已经被改变了。 因为到目前为止我们还没有安装任何软件,下面的命令: $ sudo snappy update ubuntu-core -将会生效,而且如果你打算仅仅更新特定的OS,这也是一个办法。如果出了问题,你可以使用下面的命令回滚: +将会生效,而且如果你打算仅仅更新特定的OS 版本,这也是一个办法。如果出了问题,你可以使用下面的命令回滚: $ sudo snappy rollback ubuntu-core @@ -77,7 +77,7 @@ sudo 已经配置好了可以直接用,安全起见,你应该使用以下命 via: http://xmodulo.com/ubuntu-snappy-core-raspberry-pi-2.html 作者:[Ferdinand Thommes][a] -译者:[译者ID](https://github.com/oska874) +译者:[Ezio](https://github.com/oska874) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 From 5e44c4c18b98bbb459008ca388adc4f54a5a59e3 Mon Sep 17 00:00:00 2001 From: struggling <630441839@qq.com> Date: Tue, 4 Aug 2015 10:29:24 +0800 Subject: [PATCH 801/965] Create Part 3 - Setting up RAID 1 (Mirroring) using 'Two Disks' in Linux.md --- ... (Mirroring) using 'Two Disks' in Linux.md | 217 ++++++++++++++++++ 1 file changed, 217 insertions(+) create mode 100644 translated/tech/Part 3 - Setting up RAID 1 (Mirroring) using 'Two Disks' in Linux.md diff --git a/translated/tech/Part 3 - Setting up RAID 1 (Mirroring) using 'Two Disks' in Linux.md b/translated/tech/Part 3 - Setting up RAID 1 (Mirroring) using 'Two Disks' in Linux.md new file mode 100644 index 0000000000..948e530ed8 --- /dev/null +++ b/translated/tech/Part 3 - Setting up RAID 1 (Mirroring) using 'Two Disks' in Linux.md @@ -0,0 +1,217 @@ +在 Linux 中使用"两个磁盘"创建 RAID 1(镜像) - 第3部分 +================================================================================ +RAID 镜像意味着相同数据的完整克隆(或镜像)写入到两个磁盘中。创建 RAID1 至少需要两个磁盘,它的读取性能或者可靠性比数据存储容量更好。 + + +![Create Raid1 in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Create-RAID1-in-Linux.jpeg) + +在 Linux 中设置 RAID1 + +创建镜像是为了防止因硬盘故障导致数据丢失。镜像中的每个磁盘包含数据的完整副本。当一个磁盘发生故障时,相同的数据可以从其它正常磁盘中读取。而后,可以从正在运行的计算机中直接更换发生故障的磁盘,无需任何中断。 + +### RAID 1 的特点 ### + +-镜像具有良好的性能。 + +-磁盘利用率为50%。也就是说,如果我们有两个磁盘每个500GB,总共是1TB,但在镜像中它只会显示500GB。 + +-在镜像如果一个磁盘发生故障不会有数据丢失,因为两个磁盘中的内容相同。 + +-读取数据会比写入性能更好。 + +#### 要求 #### + + +创建 RAID 1 至少要有两个磁盘,你也可以添加更多的磁盘,磁盘数需为2,4,6,8的两倍。为了能够添加更多的磁盘,你的系统必须有 RAID 物理适配器(硬件卡)。 + +这里,我们使用软件 RAID 不是硬件 RAID,如果你的系统有一个内置的物理硬件 RAID 卡,你可以从它的 UI 组件或使用 Ctrl + I 键来访问它。 + +需要阅读: [Basic Concepts of RAID in Linux][1] + +#### 在我的服务器安装 #### + + Operating System : CentOS 6.5 Final + IP Address : 192.168.0.226 + Hostname : rd1.tecmintlocal.com + Disk 1 [20GB] : /dev/sdb + Disk 2 [20GB] : /dev/sdc + +本文将指导你使用 mdadm (创建和管理 RAID 的)一步一步的建立一个软件 RAID 1 或镜像在 Linux 平台上。但同样的做法也适用于其它 Linux 发行版如 RedHat,CentOS,Fedora 等等。 + +### 第1步:安装所需要的并且检查磁盘 ### + +1.正如我前面所说,在 Linux 中我们需要使用 mdadm 软件来创建和管理 RAID。所以,让我们用 yum 或 apt-get 的软件包管理工具在 Linux 上安装 mdadm 软件包。 + + # yum install mdadm [on RedHat systems] + # apt-get install mdadm [on Debain systems] + +2. 一旦安装好‘mdadm‘包,我们需要使用下面的命令来检查磁盘是否已经配置好。 + + # mdadm -E /dev/sd[b-c] + +![Check RAID on Disks](http://www.tecmint.com/wp-content/uploads/2014/10/Check-RAID-on-Disks.png) + +检查 RAID 的磁盘 + + +正如你从上面图片看到的,没有检测到任何超级块,这意味着还没有创建RAID。 + +### 第2步:为 RAID 创建分区 ### + +3. 正如我提到的,我们最少使用两个分区 /dev/sdb 和 /dev/sdc 来创建 RAID1。我们首先使用‘fdisk‘命令来创建这两个分区并更改其类型为 raid。 + + # fdisk /dev/sdb + +按照下面的说明 + +- 按 ‘n’ 创建新的分区。 +- 然后按 ‘P’ 选择主分区。 +- 接下来选择分区号为1。 +- 按两次回车键默认将整个容量分配给它。 +- 然后,按 ‘P’ 来打印创建好的分区。 +- 按 ‘L’,列出所有可用的类型。 +- 按 ‘t’ 修改分区类型。 +- 键入 ‘fd’ 设置为Linux 的 RAID 类型,然后按 Enter 确认。 +- 然后再次使用‘p’查看我们所做的更改。 +- 使用‘w’保存更改。 + +![Create Disk Partitions](http://www.tecmint.com/wp-content/uploads/2014/10/Create-Disk-Partitions.png) + +创建磁盘分区 + +在创建“/dev/sdb”分区后,接下来按照同样的方法创建分区 /dev/sdc 。 + + # fdisk /dev/sdc + +![Create Second Partitions](http://www.tecmint.com/wp-content/uploads/2014/10/Create-Second-Partitions.png) + +创建第二个分区 + +4. 一旦这两个分区创建成功后,使用相同的命令来检查 sdb & sdc 分区并确认 RAID 分区的类型如上图所示。 + + # mdadm -E /dev/sd[b-c] + +![Verify Partitions Changes](http://www.tecmint.com/wp-content/uploads/2014/10/Verify-Partitions-Changes.png) + +验证分区变化 + +![Check RAID Type](http://www.tecmint.com/wp-content/uploads/2014/10/Check-RAID-Type.png) + +检查 RAID 类型 + +**注意**: 正如你在上图所看到的,在 sdb1 和 sdc1 中没有任何对 RAID 的定义,这就是我们没有检测到超级块的原因。 + +### 步骤3:创建 RAID1 设备 ### + +5.接下来使用以下命令来创建一个名为 /dev/md0 的“RAID1”设备并验证它 + + # mdadm --create /dev/md0 --level=mirror --raid-devices=2 /dev/sd[b-c]1 + # cat /proc/mdstat + +![Create RAID Device](http://www.tecmint.com/wp-content/uploads/2014/10/Create-RAID-Device.png) + +创建RAID设备 + +6. 接下来使用如下命令来检查 RAID 设备类型和 RAID 阵列 + + # mdadm -E /dev/sd[b-c]1 + # mdadm --detail /dev/md0 + +![Check RAID Device type](http://www.tecmint.com/wp-content/uploads/2014/10/Check-RAID-Device-type.png) + +检查 RAID 设备类型 + +![Check RAID Device Array](http://www.tecmint.com/wp-content/uploads/2014/10/Check-RAID-Device-Array.png) + +检查 RAID 设备阵列 + +从上图中,人们很容易理解,RAID1 已经使用的 /dev/sdb1 和 /dev/sdc1 分区被创建,你也可以看到状态为 resyncing。 + +### 第4步:在 RAID 设备上创建文件系统 ### + +7. 使用 ext4 为 md0 创建文件系统并挂载到 /mnt/raid1 . + + # mkfs.ext4 /dev/md0 + +![Create RAID Device Filesystem](http://www.tecmint.com/wp-content/uploads/2014/10/Create-RAID-Device-Filesystem.png) + +创建 RAID 设备文件系统 + +8. 接下来,挂载新创建的文件系统到“/mnt/raid1”,并创建一些文件,验证在挂载点的数据 + + # mkdir /mnt/raid1 + # mount /dev/md0 /mnt/raid1/ + # touch /mnt/raid1/tecmint.txt + # echo "tecmint raid setups" > /mnt/raid1/tecmint.txt + +![Mount Raid Device](http://www.tecmint.com/wp-content/uploads/2014/10/Mount-RAID-Device.png) + +挂载 RAID 设备 + +9.为了在系统重新启动自动挂载 RAID1,需要在 fstab 文件中添加条目。打开“/etc/fstab”文件并添加以下行。 + + /dev/md0 /mnt/raid1 ext4 defaults 0 0 + +![Raid Automount Device](http://www.tecmint.com/wp-content/uploads/2014/10/RAID-Automount-Filesystem.png) + +自动挂载 Raid 设备 + +10. 运行“mount -a”,检查 fstab 中的条目是否有错误 + # mount -av + +![Check Errors in fstab](http://www.tecmint.com/wp-content/uploads/2014/10/Check-Errors-in-fstab.png) + +检查 fstab 中的错误 + +11. 接下来,使用下面的命令保存 raid 的配置到文件“mdadm.conf”中。 + + # mdadm --detail --scan --verbose >> /etc/mdadm.conf + +![Save Raid Configuration](http://www.tecmint.com/wp-content/uploads/2014/10/Save-Raid-Configuration.png) + +保存 Raid 的配置 + +上述配置文件在系统重启时会读取并加载 RAID 设备。 + +### 第5步:在磁盘故障后检查数据 ### + +12.我们的主要目的是,即使在任何磁盘故障或死机时必须保证数据是可用的。让我们来看看,当任何一个磁盘不可用时会发生什么。 + + # mdadm --detail /dev/md0 + +![Raid Device Verify](http://www.tecmint.com/wp-content/uploads/2014/10/Raid-Device-Verify.png) + +验证 Raid 设备 + +在上面的图片中,我们可以看到在 RAID 中有2个设备是可用的并且 Active Devices 是2.现在让我们看看,当一个磁盘拔出(移除 sdc 磁盘)或损坏后会发生什么。 + + # ls -l /dev | grep sd + # mdadm --detail /dev/md0 + +![Test RAID Devices](http://www.tecmint.com/wp-content/uploads/2014/10/Test-RAID-Devices.png) + +测试 RAID 设备 + +现在,在上面的图片中你可以看到,一个磁盘不见了。我从虚拟机上删除了一个磁盘。此时让我们来检查我们宝贵的数据。 + + # cd /mnt/raid1/ + # cat tecmint.txt + +![Verify RAID Data](http://www.tecmint.com/wp-content/uploads/2014/10/Verify-RAID-Data.png) + +验证 RAID 数据 + +你有没有看到我们的数据仍然可用。由此,我们可以知道 RAID 1(镜像)的优势。在接下来的文章中,我们将看到如何设置一个 RAID 5 条带化分布式奇偶校验。希望这可以帮助你了解 RAID 1(镜像)是如何工作的。 + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/create-raid1-in-linux/ + +作者:[Babin Lonston][a] +译者:[strugglingyouth](https://github.com/strugglingyouth) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/babinlonston/ +[1]:http://www.tecmint.com/understanding-raid-setup-in-linux/ From 21d4f77e67c1780b8f0a67defbe4dc8487cd512a Mon Sep 17 00:00:00 2001 From: struggling <630441839@qq.com> Date: Tue, 4 Aug 2015 10:31:36 +0800 Subject: [PATCH 802/965] Create Part 4 - Creating RAID 5 (Striping with Distributed Parity) in Linux.md --- ...iping with Distributed Parity) in Linux.md | 285 ++++++++++++++++++ 1 file changed, 285 insertions(+) create mode 100644 translated/tech/RAID/Part 4 - Creating RAID 5 (Striping with Distributed Parity) in Linux.md diff --git a/translated/tech/RAID/Part 4 - Creating RAID 5 (Striping with Distributed Parity) in Linux.md b/translated/tech/RAID/Part 4 - Creating RAID 5 (Striping with Distributed Parity) in Linux.md new file mode 100644 index 0000000000..7de5199a08 --- /dev/null +++ b/translated/tech/RAID/Part 4 - Creating RAID 5 (Striping with Distributed Parity) in Linux.md @@ -0,0 +1,285 @@ + +在 Linux 中创建 RAID 5(条带化与分布式奇偶校验) - 第4部分 +================================================================================ +在 RAID 5 中,条带化数据跨多个驱磁盘使用分布式奇偶校验。分布式奇偶校验的条带化意味着它将奇偶校验信息和条带中的数据分布在多个磁盘上,它将有很好的数据冗余。 + +![Setup Raid 5 in CentOS](http://www.tecmint.com/wp-content/uploads/2014/11/setup-raid-5-in-linux.jpg) + +在 Linux 中配置 RAID 5 + +对于此 RAID 级别它至少应该有三个或更多个磁盘。RAID 5 通常被用于大规模生产环境中花费更多的成本来提供更好的数据冗余性能。 + +#### 什么是奇偶校验? #### + +奇偶校验是在数据存储中检测错误最简单的一个方法。奇偶校验信息存储在每个磁盘中,比如说,我们有4个磁盘,其中一个磁盘空间被分割去存储所有磁盘的奇偶校验信息。如果任何一个磁盘出现故障,我们可以通过更换故障磁盘后,从奇偶校验信息重建得到原来的数据。 + +#### RAID 5 的优点和缺点 #### + +- 提供更好的性能 +- 支持冗余和容错。 +- 支持热备份。 +- 将失去一个磁盘的容量存储奇偶校验信息。 +- 单个磁盘发生故障后不会丢失数据。我们可以更换故障硬盘后从奇偶校验信息中重建数据。 +- 事务处理读操作会更快。 +- 由于奇偶校验占用资源,写操作将是缓慢的。 +- 重建需要很长的时间。 + +#### 要求 #### +创建 RAID 5 最少需要3个磁盘,你也可以添加更多的磁盘,前提是你要有多端口的专用硬件 RAID 控制器。在这里,我们使用“mdadm”包来创建软件 RAID。 + +mdadm 是一个允许我们在 Linux 下配置和管理 RAID 设备的包。默认情况下 RAID 没有可用的配置文件,我们在创建和配置 RAID 后必须将配置文件保存在一个单独的文件中,例如:mdadm.conf。 + +在进一步学习之前,我建议你通过下面的文章去了解 Linux 中 RAID 的基础知识。 + +- [Basic Concepts of RAID in Linux – Part 1][1] +- [Creating RAID 0 (Stripe) in Linux – Part 2][2] +- [Setting up RAID 1 (Mirroring) in Linux – Part 3][3] + +#### 我的服务器设置 #### + + Operating System : CentOS 6.5 Final + IP Address : 192.168.0.227 + Hostname : rd5.tecmintlocal.com + Disk 1 [20GB] : /dev/sdb + Disk 2 [20GB] : /dev/sdc + Disk 3 [20GB] : /dev/sdd + +这篇文章是 RAID 系列9教程的第4部分,在这里我们要建立一个软件 RAID 5(分布式奇偶校验)使用三个20GB(名为/dev/sdb, /dev/sdc 和 /dev/sdd)的磁盘在 Linux 系统或服务器中上。 + +### 第1步:安装 mdadm 并检验磁盘 ### + +1.正如我们前面所说,我们使用 CentOS 6.5 Final 版本来创建 RAID 设置,但同样的做法也适用于其他 Linux 发行版。 + + # lsb_release -a + # ifconfig | grep inet + +![Setup Raid 5 in CentOS](http://www.tecmint.com/wp-content/uploads/2014/11/CentOS-6.5-Summary.png) + +CentOS 6.5 摘要 + +2. 如果你按照我们的 RAID 系列去配置的,我们假设你已经安装了“mdadm”包,如果没有,根据你的 Linux 发行版使用下面的命令安装。 + + # yum install mdadm [on RedHat systems] + # apt-get install mdadm [on Debain systems] + +3. “mdadm”包安装后,先使用‘fdisk‘命令列出我们在系统上增加的三个20GB的硬盘。 + + # fdisk -l | grep sd + +![Install mdadm Tool in CentOS](http://www.tecmint.com/wp-content/uploads/2014/11/Install-mdadm-Tool.png) + +安装 mdadm 工具 + +4. 现在该检查这三个磁盘是否存在 RAID 块,使用下面的命令来检查。 + + # mdadm -E /dev/sd[b-d] + # mdadm --examine /dev/sdb /dev/sdc /dev/sdd + +![Examine Drives For Raid](http://www.tecmint.com/wp-content/uploads/2014/11/Examine-Drives-For-Raid.png) + +检查 Raid 磁盘 + +**注意**: 上面的图片说明,没有检测到任何超级块。所以,这三个磁盘中没有定义 RAID。让我们现在开始创建一个吧! + +### 第2步:为磁盘创建 RAID 分区 ### + +5. 首先,在创建 RAID 前我们要为磁盘分区(/dev/sdb, /dev/sdc 和 /dev/sdd),在进行下一步之前,先使用‘fdisk’命令进行分区。 + + # fdisk /dev/sdb + # fdisk /dev/sdc + # fdisk /dev/sdd + +#### 创建 /dev/sdb 分区 #### + +请按照下面的说明在 /dev/sdb 硬盘上创建分区。 + +- 按 ‘n’ 创建新的分区。 +- 然后按 ‘P’ 选择主分区。选择主分区是因为还没有定义过分区。 +- 接下来选择分区号为1。默认就是1. +- 这里是选择柱面大小,我们没必要选择指定的大小,因为我们需要为 RAID 使用整个分区,所以只需按两次 Enter 键默认将整个容量分配给它。 +- 然后,按 ‘P’ 来打印创建好的分区。 +- 改变分区类型,按 ‘L’可以列出所有可用的类型。 +- 按 ‘t’ 修改分区类型。 +- 这里使用‘fd’设置为 RAID 的类型。 +- 然后再次使用‘p’查看我们所做的更改。 +- 使用‘w’保存更改。 + +![Create sdb Partition](http://www.tecmint.com/wp-content/uploads/2014/11/Create-sdb-Partition1.png) + +创建 sdb 分区 + +**注意**: 我们仍要按照上面的步骤来创建 sdc 和 sdd 的分区。 + +#### 创建 /dev/sdc 分区 #### + +现在,通过下面的截图给出创建 sdc 和 sdd 磁盘分区的方法,或者你可以按照上面的步骤。 + + # fdisk /dev/sdc + +![Create sdc Partition](http://www.tecmint.com/wp-content/uploads/2014/11/Create-sdc-Partition1.png) + +创建 sdc 分区 + +#### 创建 /dev/sdd 分区 #### + + # fdisk /dev/sdd + +![Create sdd Partition](http://www.tecmint.com/wp-content/uploads/2014/11/Create-sdd-Partition1.png) + +创建 sdd 分区 + +6. 创建分区后,检查三个磁盘 sdb, sdc, sdd 的变化。 + + # mdadm --examine /dev/sdb /dev/sdc /dev/sdd + + or + + # mdadm -E /dev/sd[b-c] + +![Check Partition Changes](http://www.tecmint.com/wp-content/uploads/2014/11/Check-Changes-on-Partitions.png) + +检查磁盘变化 + +**注意**: 在上面的图片中,磁盘的类型是 fd。 + +7.现在在新创建的分区检查 RAID 块。如果没有检测到超级块,我们就能够继续下一步,创建一个新的 RAID 5 的设置在这些磁盘中。 + +![Check Raid on Partition](http://www.tecmint.com/wp-content/uploads/2014/11/Check-Raid-on-Partitions.png) + +在分区中检查 Raid + +### 第3步:创建 md 设备 md0 ### + +8. 现在创建一个 RAID 设备“md0”(即 /dev/md0)使用所有新创建的分区(sdb1, sdc1 and sdd1) ,使用以下命令。 + + # mdadm --create /dev/md0 --level=5 --raid-devices=3 /dev/sdb1 /dev/sdc1 /dev/sdd1 + + or + + # mdadm -C /dev/md0 -l=5 -n=3 /dev/sd[b-d]1 + +9. 创建 RAID 设备后,检查并确认 RAID,包括设备和从 mdstat 中输出的 RAID 级别。 + + # cat /proc/mdstat + +![Verify Raid Device](http://www.tecmint.com/wp-content/uploads/2014/11/Verify-Raid-Device.png) + +验证 Raid 设备 + +如果你想监视当前的创建过程,你可以使用‘watch‘命令,使用 watch ‘cat /proc/mdstat‘,它会在屏幕上显示且每隔1秒刷新一次。 + + # watch -n1 cat /proc/mdstat + +![Monitor Raid Process](http://www.tecmint.com/wp-content/uploads/2014/11/Monitor-Raid-Process.png) + +监控 Raid 5 过程 + +![Raid 5 Process Summary](http://www.tecmint.com/wp-content/uploads/2014/11/Raid-Process-Summary.png) + +Raid 5 过程概要 + +10. 创建 RAID 后,使用以下命令验证 RAID 设备 + + # mdadm -E /dev/sd[b-d]1 + +![Verify Raid Level](http://www.tecmint.com/wp-content/uploads/2014/11/Verify-Raid-Level.png) + +验证 Raid 级别 + +**注意**: 因为它显示三个磁盘的信息,上述命令的输出会有点长。 + +11. 接下来,验证 RAID 阵列的假设,这包含正在运行 RAID 的设备,并开始重新同步。 + + # mdadm --detail /dev/md0 + +![Verify Raid Array](http://www.tecmint.com/wp-content/uploads/2014/11/Verify-Raid-Array.png) + +验证 Raid 阵列 + +### 第4步:为 md0 创建文件系统### + +12. 在挂载前为“md0”设备创建 ext4 文件系统。 + + # mkfs.ext4 /dev/md0 + +![Create md0 Filesystem](http://www.tecmint.com/wp-content/uploads/2014/11/Create-md0-Filesystem.png) + +创建 md0 文件系统 + +13.现在,在‘/mnt‘下创建目录 raid5,然后挂载文件系统到 /mnt/raid5/ 下并检查下挂载点的文件,你会看到 lost+found 目录。 + + # mkdir /mnt/raid5 + # mount /dev/md0 /mnt/raid5/ + # ls -l /mnt/raid5/ + +14. 在挂载点 /mnt/raid5 下创建几个文件,并在其中一个文件中添加一些内容然后去验证。 + + # touch /mnt/raid5/raid5_tecmint_{1..5} + # ls -l /mnt/raid5/ + # echo "tecmint raid setups" > /mnt/raid5/raid5_tecmint_1 + # cat /mnt/raid5/raid5_tecmint_1 + # cat /proc/mdstat + +![Mount Raid 5 Device](http://www.tecmint.com/wp-content/uploads/2014/11/Mount-Raid-Device.png) + +挂载 Raid 设备 + +15. 我们需要在 fstab 中添加条目,否则系统重启后将不会显示我们的挂载点。然后编辑 fstab 文件添加条目,在文件尾追加以下行,如下图所示。挂载点会根据你环境的不同而不同。 + + # vim /etc/fstab + + /dev/md0 /mnt/raid5 ext4 defaults 0 0 + +![Raid 5 Automount](http://www.tecmint.com/wp-content/uploads/2014/11/Raid-Device-Automount.png) + +自动挂载 Raid 5 + +16. 接下来,运行‘mount -av‘命令检查 fstab 条目中是否有错误。 + + # mount -av + +![Check Fstab Errors](http://www.tecmint.com/wp-content/uploads/2014/11/Check-Fstab-Errors.png) + +检查 Fstab 错误 + +### 第5步:保存 Raid 5 的配置 ### + +17. 在前面章节已经说过,默认情况下 RAID 没有配置文件。我们必须手动保存。如果此步不跟 RAID 设备将不会存在 md0,它将会跟一些其他数子。 + +所以,我们必须要在系统重新启动之前保存配置。如果配置保存它在系统重新启动时会被加载到内核中然后 RAID 也将被加载。 + + # mdadm --detail --scan --verbose >> /etc/mdadm.conf + +![Save Raid 5 Configuration](http://www.tecmint.com/wp-content/uploads/2014/11/Save-Raid-5-Configuration.png) + +保存 Raid 5 配置 + +注意:保存配置将保持 RAID 级别的稳定性在 md0 设备中。 + +### 第6步:添加备用磁盘 ### + +18.备用磁盘有什么用?它是非常有用的,如果我们有一个备用磁盘,当我们阵列中的任何一个磁盘发生故障后,这个备用磁盘会主动添加并重建进程,并从其他磁盘上同步数据,所以我们可以在这里看到冗余。 + +更多关于添加备用磁盘和检查 RAID 5 容错的指令,请阅读下面文章中的第6步和第7步。 + +- [Add Spare Drive to Raid 5 Setup][4] + +### 结论 ### + +在这篇文章中,我们已经看到了如何使用三个磁盘配置一个 RAID 5 。在接下来的文章中,我们将看到如何故障排除并且当 RAID 5 中的一个磁盘损坏后如何恢复。 + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/create-raid-5-in-linux/ + +作者:[Babin Lonston][a] +译者:[strugglingyouth](https://github.com/strugglingyouth) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/babinlonston/ +[1]:http://www.tecmint.com/understanding-raid-setup-in-linux/ +[2]:http://www.tecmint.com/create-raid0-in-linux/ +[3]:http://www.tecmint.com/create-raid1-in-linux/ +[4]:http://www.tecmint.com/create-raid-6-in-linux/ From c16ed6b8063def3f227e5e3f783a1b1520569574 Mon Sep 17 00:00:00 2001 From: struggling <630441839@qq.com> Date: Tue, 4 Aug 2015 10:32:00 +0800 Subject: [PATCH 803/965] =?UTF-8?q?Delete=20Setting=20up=20RAID=201=20(Mir?= =?UTF-8?q?roring)=20using=20=E2=80=98Two=20Disks=E2=80=99=20in=20Linux=20?= =?UTF-8?q?=E2=80=93=20Part=203?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...oring) using ‘Two Disks’ in Linux – Part 3 | 217 ------------------ 1 file changed, 217 deletions(-) delete mode 100644 translated/tech/Setting up RAID 1 (Mirroring) using ‘Two Disks’ in Linux – Part 3 diff --git a/translated/tech/Setting up RAID 1 (Mirroring) using ‘Two Disks’ in Linux – Part 3 b/translated/tech/Setting up RAID 1 (Mirroring) using ‘Two Disks’ in Linux – Part 3 deleted file mode 100644 index 948e530ed8..0000000000 --- a/translated/tech/Setting up RAID 1 (Mirroring) using ‘Two Disks’ in Linux – Part 3 +++ /dev/null @@ -1,217 +0,0 @@ -在 Linux 中使用"两个磁盘"创建 RAID 1(镜像) - 第3部分 -================================================================================ -RAID 镜像意味着相同数据的完整克隆(或镜像)写入到两个磁盘中。创建 RAID1 至少需要两个磁盘,它的读取性能或者可靠性比数据存储容量更好。 - - -![Create Raid1 in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Create-RAID1-in-Linux.jpeg) - -在 Linux 中设置 RAID1 - -创建镜像是为了防止因硬盘故障导致数据丢失。镜像中的每个磁盘包含数据的完整副本。当一个磁盘发生故障时,相同的数据可以从其它正常磁盘中读取。而后,可以从正在运行的计算机中直接更换发生故障的磁盘,无需任何中断。 - -### RAID 1 的特点 ### - --镜像具有良好的性能。 - --磁盘利用率为50%。也就是说,如果我们有两个磁盘每个500GB,总共是1TB,但在镜像中它只会显示500GB。 - --在镜像如果一个磁盘发生故障不会有数据丢失,因为两个磁盘中的内容相同。 - --读取数据会比写入性能更好。 - -#### 要求 #### - - -创建 RAID 1 至少要有两个磁盘,你也可以添加更多的磁盘,磁盘数需为2,4,6,8的两倍。为了能够添加更多的磁盘,你的系统必须有 RAID 物理适配器(硬件卡)。 - -这里,我们使用软件 RAID 不是硬件 RAID,如果你的系统有一个内置的物理硬件 RAID 卡,你可以从它的 UI 组件或使用 Ctrl + I 键来访问它。 - -需要阅读: [Basic Concepts of RAID in Linux][1] - -#### 在我的服务器安装 #### - - Operating System : CentOS 6.5 Final - IP Address : 192.168.0.226 - Hostname : rd1.tecmintlocal.com - Disk 1 [20GB] : /dev/sdb - Disk 2 [20GB] : /dev/sdc - -本文将指导你使用 mdadm (创建和管理 RAID 的)一步一步的建立一个软件 RAID 1 或镜像在 Linux 平台上。但同样的做法也适用于其它 Linux 发行版如 RedHat,CentOS,Fedora 等等。 - -### 第1步:安装所需要的并且检查磁盘 ### - -1.正如我前面所说,在 Linux 中我们需要使用 mdadm 软件来创建和管理 RAID。所以,让我们用 yum 或 apt-get 的软件包管理工具在 Linux 上安装 mdadm 软件包。 - - # yum install mdadm [on RedHat systems] - # apt-get install mdadm [on Debain systems] - -2. 一旦安装好‘mdadm‘包,我们需要使用下面的命令来检查磁盘是否已经配置好。 - - # mdadm -E /dev/sd[b-c] - -![Check RAID on Disks](http://www.tecmint.com/wp-content/uploads/2014/10/Check-RAID-on-Disks.png) - -检查 RAID 的磁盘 - - -正如你从上面图片看到的,没有检测到任何超级块,这意味着还没有创建RAID。 - -### 第2步:为 RAID 创建分区 ### - -3. 正如我提到的,我们最少使用两个分区 /dev/sdb 和 /dev/sdc 来创建 RAID1。我们首先使用‘fdisk‘命令来创建这两个分区并更改其类型为 raid。 - - # fdisk /dev/sdb - -按照下面的说明 - -- 按 ‘n’ 创建新的分区。 -- 然后按 ‘P’ 选择主分区。 -- 接下来选择分区号为1。 -- 按两次回车键默认将整个容量分配给它。 -- 然后,按 ‘P’ 来打印创建好的分区。 -- 按 ‘L’,列出所有可用的类型。 -- 按 ‘t’ 修改分区类型。 -- 键入 ‘fd’ 设置为Linux 的 RAID 类型,然后按 Enter 确认。 -- 然后再次使用‘p’查看我们所做的更改。 -- 使用‘w’保存更改。 - -![Create Disk Partitions](http://www.tecmint.com/wp-content/uploads/2014/10/Create-Disk-Partitions.png) - -创建磁盘分区 - -在创建“/dev/sdb”分区后,接下来按照同样的方法创建分区 /dev/sdc 。 - - # fdisk /dev/sdc - -![Create Second Partitions](http://www.tecmint.com/wp-content/uploads/2014/10/Create-Second-Partitions.png) - -创建第二个分区 - -4. 一旦这两个分区创建成功后,使用相同的命令来检查 sdb & sdc 分区并确认 RAID 分区的类型如上图所示。 - - # mdadm -E /dev/sd[b-c] - -![Verify Partitions Changes](http://www.tecmint.com/wp-content/uploads/2014/10/Verify-Partitions-Changes.png) - -验证分区变化 - -![Check RAID Type](http://www.tecmint.com/wp-content/uploads/2014/10/Check-RAID-Type.png) - -检查 RAID 类型 - -**注意**: 正如你在上图所看到的,在 sdb1 和 sdc1 中没有任何对 RAID 的定义,这就是我们没有检测到超级块的原因。 - -### 步骤3:创建 RAID1 设备 ### - -5.接下来使用以下命令来创建一个名为 /dev/md0 的“RAID1”设备并验证它 - - # mdadm --create /dev/md0 --level=mirror --raid-devices=2 /dev/sd[b-c]1 - # cat /proc/mdstat - -![Create RAID Device](http://www.tecmint.com/wp-content/uploads/2014/10/Create-RAID-Device.png) - -创建RAID设备 - -6. 接下来使用如下命令来检查 RAID 设备类型和 RAID 阵列 - - # mdadm -E /dev/sd[b-c]1 - # mdadm --detail /dev/md0 - -![Check RAID Device type](http://www.tecmint.com/wp-content/uploads/2014/10/Check-RAID-Device-type.png) - -检查 RAID 设备类型 - -![Check RAID Device Array](http://www.tecmint.com/wp-content/uploads/2014/10/Check-RAID-Device-Array.png) - -检查 RAID 设备阵列 - -从上图中,人们很容易理解,RAID1 已经使用的 /dev/sdb1 和 /dev/sdc1 分区被创建,你也可以看到状态为 resyncing。 - -### 第4步:在 RAID 设备上创建文件系统 ### - -7. 使用 ext4 为 md0 创建文件系统并挂载到 /mnt/raid1 . - - # mkfs.ext4 /dev/md0 - -![Create RAID Device Filesystem](http://www.tecmint.com/wp-content/uploads/2014/10/Create-RAID-Device-Filesystem.png) - -创建 RAID 设备文件系统 - -8. 接下来,挂载新创建的文件系统到“/mnt/raid1”,并创建一些文件,验证在挂载点的数据 - - # mkdir /mnt/raid1 - # mount /dev/md0 /mnt/raid1/ - # touch /mnt/raid1/tecmint.txt - # echo "tecmint raid setups" > /mnt/raid1/tecmint.txt - -![Mount Raid Device](http://www.tecmint.com/wp-content/uploads/2014/10/Mount-RAID-Device.png) - -挂载 RAID 设备 - -9.为了在系统重新启动自动挂载 RAID1,需要在 fstab 文件中添加条目。打开“/etc/fstab”文件并添加以下行。 - - /dev/md0 /mnt/raid1 ext4 defaults 0 0 - -![Raid Automount Device](http://www.tecmint.com/wp-content/uploads/2014/10/RAID-Automount-Filesystem.png) - -自动挂载 Raid 设备 - -10. 运行“mount -a”,检查 fstab 中的条目是否有错误 - # mount -av - -![Check Errors in fstab](http://www.tecmint.com/wp-content/uploads/2014/10/Check-Errors-in-fstab.png) - -检查 fstab 中的错误 - -11. 接下来,使用下面的命令保存 raid 的配置到文件“mdadm.conf”中。 - - # mdadm --detail --scan --verbose >> /etc/mdadm.conf - -![Save Raid Configuration](http://www.tecmint.com/wp-content/uploads/2014/10/Save-Raid-Configuration.png) - -保存 Raid 的配置 - -上述配置文件在系统重启时会读取并加载 RAID 设备。 - -### 第5步:在磁盘故障后检查数据 ### - -12.我们的主要目的是,即使在任何磁盘故障或死机时必须保证数据是可用的。让我们来看看,当任何一个磁盘不可用时会发生什么。 - - # mdadm --detail /dev/md0 - -![Raid Device Verify](http://www.tecmint.com/wp-content/uploads/2014/10/Raid-Device-Verify.png) - -验证 Raid 设备 - -在上面的图片中,我们可以看到在 RAID 中有2个设备是可用的并且 Active Devices 是2.现在让我们看看,当一个磁盘拔出(移除 sdc 磁盘)或损坏后会发生什么。 - - # ls -l /dev | grep sd - # mdadm --detail /dev/md0 - -![Test RAID Devices](http://www.tecmint.com/wp-content/uploads/2014/10/Test-RAID-Devices.png) - -测试 RAID 设备 - -现在,在上面的图片中你可以看到,一个磁盘不见了。我从虚拟机上删除了一个磁盘。此时让我们来检查我们宝贵的数据。 - - # cd /mnt/raid1/ - # cat tecmint.txt - -![Verify RAID Data](http://www.tecmint.com/wp-content/uploads/2014/10/Verify-RAID-Data.png) - -验证 RAID 数据 - -你有没有看到我们的数据仍然可用。由此,我们可以知道 RAID 1(镜像)的优势。在接下来的文章中,我们将看到如何设置一个 RAID 5 条带化分布式奇偶校验。希望这可以帮助你了解 RAID 1(镜像)是如何工作的。 - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/create-raid1-in-linux/ - -作者:[Babin Lonston][a] -译者:[strugglingyouth](https://github.com/strugglingyouth) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.tecmint.com/author/babinlonston/ -[1]:http://www.tecmint.com/understanding-raid-setup-in-linux/ From e7e25c9cb5858924af23c3ba900b69568250285e Mon Sep 17 00:00:00 2001 From: struggling <630441839@qq.com> Date: Tue, 4 Aug 2015 10:32:12 +0800 Subject: [PATCH 804/965] =?UTF-8?q?Delete=20Introduction=20to=20RAID,=20Co?= =?UTF-8?q?ncepts=20of=20RAID=20and=20RAID=20Levels=20=E2=80=93=20Part=201?= =?UTF-8?q?.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ncepts of RAID and RAID Levels – Part 1.md | 146 ------------------ 1 file changed, 146 deletions(-) delete mode 100644 translated/tech/Introduction to RAID, Concepts of RAID and RAID Levels – Part 1.md diff --git a/translated/tech/Introduction to RAID, Concepts of RAID and RAID Levels – Part 1.md b/translated/tech/Introduction to RAID, Concepts of RAID and RAID Levels – Part 1.md deleted file mode 100644 index 8ca0ecbd7e..0000000000 --- a/translated/tech/Introduction to RAID, Concepts of RAID and RAID Levels – Part 1.md +++ /dev/null @@ -1,146 +0,0 @@ - -RAID的级别和概念的介绍 - 第1部分 -================================================================================ -RAID是廉价磁盘冗余阵列,但现在它被称为独立磁盘冗余阵列。早先一个容量很小的磁盘都是非常昂贵的,但是现在我们可以很便宜的买到一个更大的磁盘。Raid 是磁盘的一个集合,被称为逻辑卷。 - - -![RAID in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/RAID.jpg) - -在 Linux 中理解 RAID 的设置 - -RAID包含一组或者一个集合甚至一个阵列。使用一组磁盘结合驱动器组成 RAID 阵列或 RAID 集。一个 RAID 控制器至少使用两个磁盘并且使用一个逻辑卷或者多个驱动器在一个组中。在一个磁盘组的应用中只能使用一个 RAID 级别。使用 RAID 可以提高服务器的性能。不同 RAID 的级别,性能会有所不同。它通过容错和高可用性来保存我们的数据。 - -这个系列被命名为RAID的构建共包含9个部分包括以下主题。 - -- 第1部分:RAID的级别和概念的介绍 -- 第2部分:在Linux中如何设置 RAID0(条带化) -- 第3部分:在Linux中如何设置 RAID1(镜像化) -- 第4部分:在Linux中如何设置 RAID5(条带化与分布式奇偶校验) -- 第5部分:在Linux中如何设置 RAID6(条带双分布式奇偶校验) -- 第6部分:在Linux中设置 RAID 10 或1 + 0(嵌套) -- 第7部分:增加现有的 RAID 阵列并删除损坏的磁盘 -- 第8部分:在 RAID 中恢复(重建)损坏的驱动器 -- 第9部分:在 Linux 中管理 RAID - -这是9系列教程的第1部分,在这里我们将介绍 RAID 的概念和 RAID 级别,这是在 Linux 中构建 RAID 需要理解的。 - - -### 软件RAID和硬件RAID ### - -软件 RAID 的性能很低,因为其从主机资源消耗。 RAID 软件需要加载可读取数据从软件 RAID 卷中。在加载 RAID 软件前,操作系统需要得到加载 RAID 软件的引导。在软件 RAID 中无需物理硬件。零成本投资。 - -硬件 RAID 具有很高的性能。他们有专用的 RAID 控制器,采用 PCI Express卡物理内置的。它不会使用主机资源。他们有 NVRAM 缓存读取和写入。当重建时即使出现电源故障,它会使用电池电源备份存储缓存。对于大规模使用需要非常昂贵的投资。 - -硬件 RAID 卡如下所示: - -![Hardware RAID](http://www.tecmint.com/wp-content/uploads/2014/10/Hardware-RAID.jpg) - -硬件RAID - -#### 精选的 RAID 概念 #### - -- 在 RAID 重建中校验方法中丢失的内容来自从校验中保存的信息。 RAID 5,RAID 6 基于校验。 -- 条带化是随机共享数据到多个磁盘。它不会在单个磁盘中保存完整的数据。如果我们使用3个磁盘,则数据将会存在于每个磁盘上。 -- 镜像被用于 RAID 1 和 RAID 10。镜像会自动备份数据。在 RAID 1,它将保存相同的内容到其他盘上。 -- 在我们的服务器上,热备份只是一个备用驱动器,它可以自动更换发生故障的驱动器。在我们的阵列中,如果任何一个驱动器损坏,热备份驱动器会自动重建。 -- 块是 RAID 控制器每次读写数据时的最小单位,最小4KB。通过定义块大小,我们可以增加 I/O 性能。 - -RAID有不同的级别。在这里,我们仅看到在真实环境下的使用最多的 RAID 级别。 - -- RAID0 = 条带化 -- RAID1 = 镜像 -- RAID5 = 单个磁盘分布式奇偶校验 -- RAID6 = 双盘分布式奇偶校验 -- RAID10 = 镜像 + 条带。(嵌套RAID) - -RAID 在大多数 Linux 发行版上使用 mdadm 的包管理。让我们先对每个 RAID 级别认识一下。 - -#### RAID 0(或)条带化 #### - -条带化有很好的性能。在 RAID 0(条带化)中数据将使用共享的方式被写入到磁盘。一半的内容将是在一个磁盘上,另一半内容将被写入到其它磁盘。 - -假设我们有2个磁盘驱动器,例如,如果我们将数据“TECMINT”写到逻辑卷中,“T”将被保存在第一盘中,“E”将保存在第二盘,'C'将被保存在第一盘,“M”将保存在第二盘,它会一直继续此循环过程。 - -在这种情况下,如果驱动器中的任何一个发生故障,我们将丢失所有的数据,因为一个盘中只有一半的数据,不能用于重建。不过,当比较写入速度和性能时,RAID0 是非常好的。创建 RAID 0(条带化)至少需要2个磁盘。如果你的数据是非常宝贵的,那么不要使用此 RAID 级别。 - -- 高性能。 -- 在 RAID0 上零容量损失。 -- 零容错。 -- 写和读有很高的性能。 - -#### RAID1(或)镜像化 #### - -镜像也有不错的性能。镜像可以备份我们的数据。假设我们有两组2TB的硬盘驱动器,我们总共有4TB,但在镜像中,驱动器在 RAID 控制器的后面形成一个逻辑驱动器,我们只能看到逻辑驱动器有2TB。 - -当我们保存数据时,它将同时写入2TB驱动器中。创建 RAID 1 (镜像化)最少需要两个驱动器。如果发生磁盘故障,我们可以恢复 RAID 通过更换一个新的磁盘。如果在 RAID 1 中任何一个磁盘发生故障,我们可以从另一个磁盘中获取相同的数据,因为其他的磁盘中也有相同的数据。所以是零数据丢失。 - -- 良好的性能。 -- 空间的一半将在总容量丢失。 -- 完全容错。 -- 重建会更快。 -- 写性能将是缓慢的。 -- 读将会很好。 -- 被操作系统和数据库使用的规模很小。 - -#### RAID 5(或)分布式奇偶校验 #### - -RAID 5 多用于企业的水平。 RAID 5 的工作通过分布式奇偶校验的方法。奇偶校验信息将被用于重建数据。它需要留下的正常驱动器上的信息去重建。驱动器故障时,这会保护我们的数据。 - -假设我们有4个驱动器,如果一个驱动器发生故障而后我们更换发生故障的驱动器后,我们可以从奇偶校验中重建数据到更换的驱动器上。奇偶校验信息存储在所有的4个驱动器上,如果我们有4个 1TB 的驱动器。奇偶校验信息将被存储在每个驱动器的256G中而其它768GB是用户自己使用的。单个驱动器故障后,RAID 5 依旧正常工作,如果驱动器损坏个数超过1个会导致数据的丢失。 - -- 性能卓越 -- 读速度将非常好。 -- 如果我们不使用硬件 RAID 控制器,写速度是缓慢的。 -- 从所有驱动器的奇偶校验信息中重建。 -- 完全容错。 -- 1个磁盘空间将用于奇偶校验。 -- 可以被用在文件服务器,Web服务器,非常重要的备份中。 - -#### RAID 6 两个分布式奇偶校验磁盘 #### - -RAID 6 和 RAID 5 相似但它有两个分布式奇偶校验。大多用在大量的阵列中。我们最少需要4个驱动器,即使有2个驱动器发生故障,我们依然可以重建数据,同时更换新的驱动器。 - -它比 RAID 5 非常慢,因为它将数据同时写到4个驱动器上。当我们使用硬件 RAID 控制器时速度将被平均。如果我们有6个的1TB驱动器,4个驱动器将用于数据保存,2个驱动器将用于校验。 - -- 性能不佳。 -- 读的性能很好。 -- 如果我们不使用硬件 RAID 控制器写的性能会很差。 -- 从2奇偶校验驱动器上重建。 -- 完全容错。 -- 2个磁盘空间将用于奇偶校验。 -- 可用于大型阵列。 -- 在备份和视频流中大规模使用。 - -#### RAID 10(或)镜像+条带 #### - -RAID 10 可以被称为1 + 0或0 +1。它将做镜像+条带两个工作。在 RAID 10 中首先做镜像然后做条带。在 RAID 01 上首先做条带,然后做镜像。RAID 10 比 01 好。 - -假设,我们有4个驱动器。当我写了一些数据到逻辑卷上,它会使用镜像和条带将数据保存到4个驱动器上。 - -如果我在 RAID 10 上写入数据“TECMINT”,数据将使用如下形式保存。首先将“T”同时写入两个磁盘,“E”也将同时写入两个磁盘,这一步将所有数据都写入。这使数据得到备份。 - -同时它将使用 RAID 0 方式写入数据,遵循将“T”写入第一个盘,“E”写入第二个盘。再次将“C”写入第一个盘,“M”到第二个盘。 - -- 良好的读写性能。 -- 空间的一半将在总容量丢失。 -- 容错。 -- 从备份数据中快速重建。 -- 它的高性能和高可用性常被用于数据库的存储中。 - -### 结论 ### - -在这篇文章中,我们已经看到了什么是 RAID 和在实际环境大多采用 RAID 的哪个级别。希望你已经学会了上面所写的。对于 RAID 的构建必须了解有关 RAID 的基本知识。以上内容对于你了解 RAID 基本满足。 - -在接下来的文章中,我将介绍如何设置和使用各种级别创建 RAID,增加 RAID 组(阵列)和驱动器故障排除等。 - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/understanding-raid-setup-in-linux/ - -作者:[Babin Lonston][a] -译者:[strugglingyouth](https://github.com/strugglingyouth) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.tecmint.com/author/babinlonston/ From be241caf54d4564570a4897b5f68aa2e5e2a9842 Mon Sep 17 00:00:00 2001 From: struggling <630441839@qq.com> Date: Tue, 4 Aug 2015 10:32:27 +0800 Subject: [PATCH 805/965] =?UTF-8?q?Delete=20Creating=20RAID=205=20(Stripin?= =?UTF-8?q?g=20with=20Distributed=20Parity)=20in=20Linux=20=E2=80=93=20Par?= =?UTF-8?q?t=204?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...with Distributed Parity) in Linux – Part 4 | 285 ------------------ 1 file changed, 285 deletions(-) delete mode 100644 translated/tech/Creating RAID 5 (Striping with Distributed Parity) in Linux – Part 4 diff --git a/translated/tech/Creating RAID 5 (Striping with Distributed Parity) in Linux – Part 4 b/translated/tech/Creating RAID 5 (Striping with Distributed Parity) in Linux – Part 4 deleted file mode 100644 index 7de5199a08..0000000000 --- a/translated/tech/Creating RAID 5 (Striping with Distributed Parity) in Linux – Part 4 +++ /dev/null @@ -1,285 +0,0 @@ - -在 Linux 中创建 RAID 5(条带化与分布式奇偶校验) - 第4部分 -================================================================================ -在 RAID 5 中,条带化数据跨多个驱磁盘使用分布式奇偶校验。分布式奇偶校验的条带化意味着它将奇偶校验信息和条带中的数据分布在多个磁盘上,它将有很好的数据冗余。 - -![Setup Raid 5 in CentOS](http://www.tecmint.com/wp-content/uploads/2014/11/setup-raid-5-in-linux.jpg) - -在 Linux 中配置 RAID 5 - -对于此 RAID 级别它至少应该有三个或更多个磁盘。RAID 5 通常被用于大规模生产环境中花费更多的成本来提供更好的数据冗余性能。 - -#### 什么是奇偶校验? #### - -奇偶校验是在数据存储中检测错误最简单的一个方法。奇偶校验信息存储在每个磁盘中,比如说,我们有4个磁盘,其中一个磁盘空间被分割去存储所有磁盘的奇偶校验信息。如果任何一个磁盘出现故障,我们可以通过更换故障磁盘后,从奇偶校验信息重建得到原来的数据。 - -#### RAID 5 的优点和缺点 #### - -- 提供更好的性能 -- 支持冗余和容错。 -- 支持热备份。 -- 将失去一个磁盘的容量存储奇偶校验信息。 -- 单个磁盘发生故障后不会丢失数据。我们可以更换故障硬盘后从奇偶校验信息中重建数据。 -- 事务处理读操作会更快。 -- 由于奇偶校验占用资源,写操作将是缓慢的。 -- 重建需要很长的时间。 - -#### 要求 #### -创建 RAID 5 最少需要3个磁盘,你也可以添加更多的磁盘,前提是你要有多端口的专用硬件 RAID 控制器。在这里,我们使用“mdadm”包来创建软件 RAID。 - -mdadm 是一个允许我们在 Linux 下配置和管理 RAID 设备的包。默认情况下 RAID 没有可用的配置文件,我们在创建和配置 RAID 后必须将配置文件保存在一个单独的文件中,例如:mdadm.conf。 - -在进一步学习之前,我建议你通过下面的文章去了解 Linux 中 RAID 的基础知识。 - -- [Basic Concepts of RAID in Linux – Part 1][1] -- [Creating RAID 0 (Stripe) in Linux – Part 2][2] -- [Setting up RAID 1 (Mirroring) in Linux – Part 3][3] - -#### 我的服务器设置 #### - - Operating System : CentOS 6.5 Final - IP Address : 192.168.0.227 - Hostname : rd5.tecmintlocal.com - Disk 1 [20GB] : /dev/sdb - Disk 2 [20GB] : /dev/sdc - Disk 3 [20GB] : /dev/sdd - -这篇文章是 RAID 系列9教程的第4部分,在这里我们要建立一个软件 RAID 5(分布式奇偶校验)使用三个20GB(名为/dev/sdb, /dev/sdc 和 /dev/sdd)的磁盘在 Linux 系统或服务器中上。 - -### 第1步:安装 mdadm 并检验磁盘 ### - -1.正如我们前面所说,我们使用 CentOS 6.5 Final 版本来创建 RAID 设置,但同样的做法也适用于其他 Linux 发行版。 - - # lsb_release -a - # ifconfig | grep inet - -![Setup Raid 5 in CentOS](http://www.tecmint.com/wp-content/uploads/2014/11/CentOS-6.5-Summary.png) - -CentOS 6.5 摘要 - -2. 如果你按照我们的 RAID 系列去配置的,我们假设你已经安装了“mdadm”包,如果没有,根据你的 Linux 发行版使用下面的命令安装。 - - # yum install mdadm [on RedHat systems] - # apt-get install mdadm [on Debain systems] - -3. “mdadm”包安装后,先使用‘fdisk‘命令列出我们在系统上增加的三个20GB的硬盘。 - - # fdisk -l | grep sd - -![Install mdadm Tool in CentOS](http://www.tecmint.com/wp-content/uploads/2014/11/Install-mdadm-Tool.png) - -安装 mdadm 工具 - -4. 现在该检查这三个磁盘是否存在 RAID 块,使用下面的命令来检查。 - - # mdadm -E /dev/sd[b-d] - # mdadm --examine /dev/sdb /dev/sdc /dev/sdd - -![Examine Drives For Raid](http://www.tecmint.com/wp-content/uploads/2014/11/Examine-Drives-For-Raid.png) - -检查 Raid 磁盘 - -**注意**: 上面的图片说明,没有检测到任何超级块。所以,这三个磁盘中没有定义 RAID。让我们现在开始创建一个吧! - -### 第2步:为磁盘创建 RAID 分区 ### - -5. 首先,在创建 RAID 前我们要为磁盘分区(/dev/sdb, /dev/sdc 和 /dev/sdd),在进行下一步之前,先使用‘fdisk’命令进行分区。 - - # fdisk /dev/sdb - # fdisk /dev/sdc - # fdisk /dev/sdd - -#### 创建 /dev/sdb 分区 #### - -请按照下面的说明在 /dev/sdb 硬盘上创建分区。 - -- 按 ‘n’ 创建新的分区。 -- 然后按 ‘P’ 选择主分区。选择主分区是因为还没有定义过分区。 -- 接下来选择分区号为1。默认就是1. -- 这里是选择柱面大小,我们没必要选择指定的大小,因为我们需要为 RAID 使用整个分区,所以只需按两次 Enter 键默认将整个容量分配给它。 -- 然后,按 ‘P’ 来打印创建好的分区。 -- 改变分区类型,按 ‘L’可以列出所有可用的类型。 -- 按 ‘t’ 修改分区类型。 -- 这里使用‘fd’设置为 RAID 的类型。 -- 然后再次使用‘p’查看我们所做的更改。 -- 使用‘w’保存更改。 - -![Create sdb Partition](http://www.tecmint.com/wp-content/uploads/2014/11/Create-sdb-Partition1.png) - -创建 sdb 分区 - -**注意**: 我们仍要按照上面的步骤来创建 sdc 和 sdd 的分区。 - -#### 创建 /dev/sdc 分区 #### - -现在,通过下面的截图给出创建 sdc 和 sdd 磁盘分区的方法,或者你可以按照上面的步骤。 - - # fdisk /dev/sdc - -![Create sdc Partition](http://www.tecmint.com/wp-content/uploads/2014/11/Create-sdc-Partition1.png) - -创建 sdc 分区 - -#### 创建 /dev/sdd 分区 #### - - # fdisk /dev/sdd - -![Create sdd Partition](http://www.tecmint.com/wp-content/uploads/2014/11/Create-sdd-Partition1.png) - -创建 sdd 分区 - -6. 创建分区后,检查三个磁盘 sdb, sdc, sdd 的变化。 - - # mdadm --examine /dev/sdb /dev/sdc /dev/sdd - - or - - # mdadm -E /dev/sd[b-c] - -![Check Partition Changes](http://www.tecmint.com/wp-content/uploads/2014/11/Check-Changes-on-Partitions.png) - -检查磁盘变化 - -**注意**: 在上面的图片中,磁盘的类型是 fd。 - -7.现在在新创建的分区检查 RAID 块。如果没有检测到超级块,我们就能够继续下一步,创建一个新的 RAID 5 的设置在这些磁盘中。 - -![Check Raid on Partition](http://www.tecmint.com/wp-content/uploads/2014/11/Check-Raid-on-Partitions.png) - -在分区中检查 Raid - -### 第3步:创建 md 设备 md0 ### - -8. 现在创建一个 RAID 设备“md0”(即 /dev/md0)使用所有新创建的分区(sdb1, sdc1 and sdd1) ,使用以下命令。 - - # mdadm --create /dev/md0 --level=5 --raid-devices=3 /dev/sdb1 /dev/sdc1 /dev/sdd1 - - or - - # mdadm -C /dev/md0 -l=5 -n=3 /dev/sd[b-d]1 - -9. 创建 RAID 设备后,检查并确认 RAID,包括设备和从 mdstat 中输出的 RAID 级别。 - - # cat /proc/mdstat - -![Verify Raid Device](http://www.tecmint.com/wp-content/uploads/2014/11/Verify-Raid-Device.png) - -验证 Raid 设备 - -如果你想监视当前的创建过程,你可以使用‘watch‘命令,使用 watch ‘cat /proc/mdstat‘,它会在屏幕上显示且每隔1秒刷新一次。 - - # watch -n1 cat /proc/mdstat - -![Monitor Raid Process](http://www.tecmint.com/wp-content/uploads/2014/11/Monitor-Raid-Process.png) - -监控 Raid 5 过程 - -![Raid 5 Process Summary](http://www.tecmint.com/wp-content/uploads/2014/11/Raid-Process-Summary.png) - -Raid 5 过程概要 - -10. 创建 RAID 后,使用以下命令验证 RAID 设备 - - # mdadm -E /dev/sd[b-d]1 - -![Verify Raid Level](http://www.tecmint.com/wp-content/uploads/2014/11/Verify-Raid-Level.png) - -验证 Raid 级别 - -**注意**: 因为它显示三个磁盘的信息,上述命令的输出会有点长。 - -11. 接下来,验证 RAID 阵列的假设,这包含正在运行 RAID 的设备,并开始重新同步。 - - # mdadm --detail /dev/md0 - -![Verify Raid Array](http://www.tecmint.com/wp-content/uploads/2014/11/Verify-Raid-Array.png) - -验证 Raid 阵列 - -### 第4步:为 md0 创建文件系统### - -12. 在挂载前为“md0”设备创建 ext4 文件系统。 - - # mkfs.ext4 /dev/md0 - -![Create md0 Filesystem](http://www.tecmint.com/wp-content/uploads/2014/11/Create-md0-Filesystem.png) - -创建 md0 文件系统 - -13.现在,在‘/mnt‘下创建目录 raid5,然后挂载文件系统到 /mnt/raid5/ 下并检查下挂载点的文件,你会看到 lost+found 目录。 - - # mkdir /mnt/raid5 - # mount /dev/md0 /mnt/raid5/ - # ls -l /mnt/raid5/ - -14. 在挂载点 /mnt/raid5 下创建几个文件,并在其中一个文件中添加一些内容然后去验证。 - - # touch /mnt/raid5/raid5_tecmint_{1..5} - # ls -l /mnt/raid5/ - # echo "tecmint raid setups" > /mnt/raid5/raid5_tecmint_1 - # cat /mnt/raid5/raid5_tecmint_1 - # cat /proc/mdstat - -![Mount Raid 5 Device](http://www.tecmint.com/wp-content/uploads/2014/11/Mount-Raid-Device.png) - -挂载 Raid 设备 - -15. 我们需要在 fstab 中添加条目,否则系统重启后将不会显示我们的挂载点。然后编辑 fstab 文件添加条目,在文件尾追加以下行,如下图所示。挂载点会根据你环境的不同而不同。 - - # vim /etc/fstab - - /dev/md0 /mnt/raid5 ext4 defaults 0 0 - -![Raid 5 Automount](http://www.tecmint.com/wp-content/uploads/2014/11/Raid-Device-Automount.png) - -自动挂载 Raid 5 - -16. 接下来,运行‘mount -av‘命令检查 fstab 条目中是否有错误。 - - # mount -av - -![Check Fstab Errors](http://www.tecmint.com/wp-content/uploads/2014/11/Check-Fstab-Errors.png) - -检查 Fstab 错误 - -### 第5步:保存 Raid 5 的配置 ### - -17. 在前面章节已经说过,默认情况下 RAID 没有配置文件。我们必须手动保存。如果此步不跟 RAID 设备将不会存在 md0,它将会跟一些其他数子。 - -所以,我们必须要在系统重新启动之前保存配置。如果配置保存它在系统重新启动时会被加载到内核中然后 RAID 也将被加载。 - - # mdadm --detail --scan --verbose >> /etc/mdadm.conf - -![Save Raid 5 Configuration](http://www.tecmint.com/wp-content/uploads/2014/11/Save-Raid-5-Configuration.png) - -保存 Raid 5 配置 - -注意:保存配置将保持 RAID 级别的稳定性在 md0 设备中。 - -### 第6步:添加备用磁盘 ### - -18.备用磁盘有什么用?它是非常有用的,如果我们有一个备用磁盘,当我们阵列中的任何一个磁盘发生故障后,这个备用磁盘会主动添加并重建进程,并从其他磁盘上同步数据,所以我们可以在这里看到冗余。 - -更多关于添加备用磁盘和检查 RAID 5 容错的指令,请阅读下面文章中的第6步和第7步。 - -- [Add Spare Drive to Raid 5 Setup][4] - -### 结论 ### - -在这篇文章中,我们已经看到了如何使用三个磁盘配置一个 RAID 5 。在接下来的文章中,我们将看到如何故障排除并且当 RAID 5 中的一个磁盘损坏后如何恢复。 - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/create-raid-5-in-linux/ - -作者:[Babin Lonston][a] -译者:[strugglingyouth](https://github.com/strugglingyouth) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.tecmint.com/author/babinlonston/ -[1]:http://www.tecmint.com/understanding-raid-setup-in-linux/ -[2]:http://www.tecmint.com/create-raid0-in-linux/ -[3]:http://www.tecmint.com/create-raid1-in-linux/ -[4]:http://www.tecmint.com/create-raid-6-in-linux/ From b1fd032e97a42a7256d951cbc670bdce03cc08cb Mon Sep 17 00:00:00 2001 From: struggling <630441839@qq.com> Date: Tue, 4 Aug 2015 10:32:40 +0800 Subject: [PATCH 806/965] Delete Part 3 - Setting up RAID 1 (Mirroring) using 'Two Disks' in Linux.md --- ... (Mirroring) using 'Two Disks' in Linux.md | 217 ------------------ 1 file changed, 217 deletions(-) delete mode 100644 translated/tech/Part 3 - Setting up RAID 1 (Mirroring) using 'Two Disks' in Linux.md diff --git a/translated/tech/Part 3 - Setting up RAID 1 (Mirroring) using 'Two Disks' in Linux.md b/translated/tech/Part 3 - Setting up RAID 1 (Mirroring) using 'Two Disks' in Linux.md deleted file mode 100644 index 948e530ed8..0000000000 --- a/translated/tech/Part 3 - Setting up RAID 1 (Mirroring) using 'Two Disks' in Linux.md +++ /dev/null @@ -1,217 +0,0 @@ -在 Linux 中使用"两个磁盘"创建 RAID 1(镜像) - 第3部分 -================================================================================ -RAID 镜像意味着相同数据的完整克隆(或镜像)写入到两个磁盘中。创建 RAID1 至少需要两个磁盘,它的读取性能或者可靠性比数据存储容量更好。 - - -![Create Raid1 in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Create-RAID1-in-Linux.jpeg) - -在 Linux 中设置 RAID1 - -创建镜像是为了防止因硬盘故障导致数据丢失。镜像中的每个磁盘包含数据的完整副本。当一个磁盘发生故障时,相同的数据可以从其它正常磁盘中读取。而后,可以从正在运行的计算机中直接更换发生故障的磁盘,无需任何中断。 - -### RAID 1 的特点 ### - --镜像具有良好的性能。 - --磁盘利用率为50%。也就是说,如果我们有两个磁盘每个500GB,总共是1TB,但在镜像中它只会显示500GB。 - --在镜像如果一个磁盘发生故障不会有数据丢失,因为两个磁盘中的内容相同。 - --读取数据会比写入性能更好。 - -#### 要求 #### - - -创建 RAID 1 至少要有两个磁盘,你也可以添加更多的磁盘,磁盘数需为2,4,6,8的两倍。为了能够添加更多的磁盘,你的系统必须有 RAID 物理适配器(硬件卡)。 - -这里,我们使用软件 RAID 不是硬件 RAID,如果你的系统有一个内置的物理硬件 RAID 卡,你可以从它的 UI 组件或使用 Ctrl + I 键来访问它。 - -需要阅读: [Basic Concepts of RAID in Linux][1] - -#### 在我的服务器安装 #### - - Operating System : CentOS 6.5 Final - IP Address : 192.168.0.226 - Hostname : rd1.tecmintlocal.com - Disk 1 [20GB] : /dev/sdb - Disk 2 [20GB] : /dev/sdc - -本文将指导你使用 mdadm (创建和管理 RAID 的)一步一步的建立一个软件 RAID 1 或镜像在 Linux 平台上。但同样的做法也适用于其它 Linux 发行版如 RedHat,CentOS,Fedora 等等。 - -### 第1步:安装所需要的并且检查磁盘 ### - -1.正如我前面所说,在 Linux 中我们需要使用 mdadm 软件来创建和管理 RAID。所以,让我们用 yum 或 apt-get 的软件包管理工具在 Linux 上安装 mdadm 软件包。 - - # yum install mdadm [on RedHat systems] - # apt-get install mdadm [on Debain systems] - -2. 一旦安装好‘mdadm‘包,我们需要使用下面的命令来检查磁盘是否已经配置好。 - - # mdadm -E /dev/sd[b-c] - -![Check RAID on Disks](http://www.tecmint.com/wp-content/uploads/2014/10/Check-RAID-on-Disks.png) - -检查 RAID 的磁盘 - - -正如你从上面图片看到的,没有检测到任何超级块,这意味着还没有创建RAID。 - -### 第2步:为 RAID 创建分区 ### - -3. 正如我提到的,我们最少使用两个分区 /dev/sdb 和 /dev/sdc 来创建 RAID1。我们首先使用‘fdisk‘命令来创建这两个分区并更改其类型为 raid。 - - # fdisk /dev/sdb - -按照下面的说明 - -- 按 ‘n’ 创建新的分区。 -- 然后按 ‘P’ 选择主分区。 -- 接下来选择分区号为1。 -- 按两次回车键默认将整个容量分配给它。 -- 然后,按 ‘P’ 来打印创建好的分区。 -- 按 ‘L’,列出所有可用的类型。 -- 按 ‘t’ 修改分区类型。 -- 键入 ‘fd’ 设置为Linux 的 RAID 类型,然后按 Enter 确认。 -- 然后再次使用‘p’查看我们所做的更改。 -- 使用‘w’保存更改。 - -![Create Disk Partitions](http://www.tecmint.com/wp-content/uploads/2014/10/Create-Disk-Partitions.png) - -创建磁盘分区 - -在创建“/dev/sdb”分区后,接下来按照同样的方法创建分区 /dev/sdc 。 - - # fdisk /dev/sdc - -![Create Second Partitions](http://www.tecmint.com/wp-content/uploads/2014/10/Create-Second-Partitions.png) - -创建第二个分区 - -4. 一旦这两个分区创建成功后,使用相同的命令来检查 sdb & sdc 分区并确认 RAID 分区的类型如上图所示。 - - # mdadm -E /dev/sd[b-c] - -![Verify Partitions Changes](http://www.tecmint.com/wp-content/uploads/2014/10/Verify-Partitions-Changes.png) - -验证分区变化 - -![Check RAID Type](http://www.tecmint.com/wp-content/uploads/2014/10/Check-RAID-Type.png) - -检查 RAID 类型 - -**注意**: 正如你在上图所看到的,在 sdb1 和 sdc1 中没有任何对 RAID 的定义,这就是我们没有检测到超级块的原因。 - -### 步骤3:创建 RAID1 设备 ### - -5.接下来使用以下命令来创建一个名为 /dev/md0 的“RAID1”设备并验证它 - - # mdadm --create /dev/md0 --level=mirror --raid-devices=2 /dev/sd[b-c]1 - # cat /proc/mdstat - -![Create RAID Device](http://www.tecmint.com/wp-content/uploads/2014/10/Create-RAID-Device.png) - -创建RAID设备 - -6. 接下来使用如下命令来检查 RAID 设备类型和 RAID 阵列 - - # mdadm -E /dev/sd[b-c]1 - # mdadm --detail /dev/md0 - -![Check RAID Device type](http://www.tecmint.com/wp-content/uploads/2014/10/Check-RAID-Device-type.png) - -检查 RAID 设备类型 - -![Check RAID Device Array](http://www.tecmint.com/wp-content/uploads/2014/10/Check-RAID-Device-Array.png) - -检查 RAID 设备阵列 - -从上图中,人们很容易理解,RAID1 已经使用的 /dev/sdb1 和 /dev/sdc1 分区被创建,你也可以看到状态为 resyncing。 - -### 第4步:在 RAID 设备上创建文件系统 ### - -7. 使用 ext4 为 md0 创建文件系统并挂载到 /mnt/raid1 . - - # mkfs.ext4 /dev/md0 - -![Create RAID Device Filesystem](http://www.tecmint.com/wp-content/uploads/2014/10/Create-RAID-Device-Filesystem.png) - -创建 RAID 设备文件系统 - -8. 接下来,挂载新创建的文件系统到“/mnt/raid1”,并创建一些文件,验证在挂载点的数据 - - # mkdir /mnt/raid1 - # mount /dev/md0 /mnt/raid1/ - # touch /mnt/raid1/tecmint.txt - # echo "tecmint raid setups" > /mnt/raid1/tecmint.txt - -![Mount Raid Device](http://www.tecmint.com/wp-content/uploads/2014/10/Mount-RAID-Device.png) - -挂载 RAID 设备 - -9.为了在系统重新启动自动挂载 RAID1,需要在 fstab 文件中添加条目。打开“/etc/fstab”文件并添加以下行。 - - /dev/md0 /mnt/raid1 ext4 defaults 0 0 - -![Raid Automount Device](http://www.tecmint.com/wp-content/uploads/2014/10/RAID-Automount-Filesystem.png) - -自动挂载 Raid 设备 - -10. 运行“mount -a”,检查 fstab 中的条目是否有错误 - # mount -av - -![Check Errors in fstab](http://www.tecmint.com/wp-content/uploads/2014/10/Check-Errors-in-fstab.png) - -检查 fstab 中的错误 - -11. 接下来,使用下面的命令保存 raid 的配置到文件“mdadm.conf”中。 - - # mdadm --detail --scan --verbose >> /etc/mdadm.conf - -![Save Raid Configuration](http://www.tecmint.com/wp-content/uploads/2014/10/Save-Raid-Configuration.png) - -保存 Raid 的配置 - -上述配置文件在系统重启时会读取并加载 RAID 设备。 - -### 第5步:在磁盘故障后检查数据 ### - -12.我们的主要目的是,即使在任何磁盘故障或死机时必须保证数据是可用的。让我们来看看,当任何一个磁盘不可用时会发生什么。 - - # mdadm --detail /dev/md0 - -![Raid Device Verify](http://www.tecmint.com/wp-content/uploads/2014/10/Raid-Device-Verify.png) - -验证 Raid 设备 - -在上面的图片中,我们可以看到在 RAID 中有2个设备是可用的并且 Active Devices 是2.现在让我们看看,当一个磁盘拔出(移除 sdc 磁盘)或损坏后会发生什么。 - - # ls -l /dev | grep sd - # mdadm --detail /dev/md0 - -![Test RAID Devices](http://www.tecmint.com/wp-content/uploads/2014/10/Test-RAID-Devices.png) - -测试 RAID 设备 - -现在,在上面的图片中你可以看到,一个磁盘不见了。我从虚拟机上删除了一个磁盘。此时让我们来检查我们宝贵的数据。 - - # cd /mnt/raid1/ - # cat tecmint.txt - -![Verify RAID Data](http://www.tecmint.com/wp-content/uploads/2014/10/Verify-RAID-Data.png) - -验证 RAID 数据 - -你有没有看到我们的数据仍然可用。由此,我们可以知道 RAID 1(镜像)的优势。在接下来的文章中,我们将看到如何设置一个 RAID 5 条带化分布式奇偶校验。希望这可以帮助你了解 RAID 1(镜像)是如何工作的。 - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/create-raid1-in-linux/ - -作者:[Babin Lonston][a] -译者:[strugglingyouth](https://github.com/strugglingyouth) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.tecmint.com/author/babinlonston/ -[1]:http://www.tecmint.com/understanding-raid-setup-in-linux/ From 10ee418d6422f54036002872fd4a328bdf691557 Mon Sep 17 00:00:00 2001 From: struggling <630441839@qq.com> Date: Tue, 4 Aug 2015 10:32:59 +0800 Subject: [PATCH 807/965] =?UTF-8?q?Delete=20Creating=20Software=20RAID0=20?= =?UTF-8?q?(Stripe)=20on=20=E2=80=98Two=20Devices=E2=80=99=20Using=20?= =?UTF-8?q?=E2=80=98mdadm=E2=80=99=20Tool=20in=20Linux=20=E2=80=93=20Part?= =?UTF-8?q?=202.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ces’ Using ‘mdadm’ Tool in Linux – Part 2.md | 218 ------------------ 1 file changed, 218 deletions(-) delete mode 100644 translated/tech/Creating Software RAID0 (Stripe) on ‘Two Devices’ Using ‘mdadm’ Tool in Linux – Part 2.md diff --git a/translated/tech/Creating Software RAID0 (Stripe) on ‘Two Devices’ Using ‘mdadm’ Tool in Linux – Part 2.md b/translated/tech/Creating Software RAID0 (Stripe) on ‘Two Devices’ Using ‘mdadm’ Tool in Linux – Part 2.md deleted file mode 100644 index 9feba99609..0000000000 --- a/translated/tech/Creating Software RAID0 (Stripe) on ‘Two Devices’ Using ‘mdadm’ Tool in Linux – Part 2.md +++ /dev/null @@ -1,218 +0,0 @@ -在 Linux 上使用 ‘mdadm’ 工具创建软件 RAID0 (条带化)在 ‘两个设备’ 上 - 第2部分 -================================================================================ -RAID 是廉价磁盘的冗余阵列,其高可用性和可靠性适用于大规模环境中,为了使数据被保护而不是被正常使用。RAID 只是磁盘的一个集合被称为逻辑卷。结合驱动器,使其成为一个阵列或称为集合(组)。 - -创建 RAID 最少应使用2个磁盘被连接组成 RAID 控制器,逻辑卷或多个驱动器可以根据定义的 RAID 级别添加在一个阵列中。不使用物理硬件创建的 RAID 被称为软件 RAID。软件 RAID 一般都是不太有钱的人才使用的。 - -![Setup RAID0 in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Raid0-in-Linux.jpg) - -在 Linux 中创建 RAID0 - -使用 RAID 的主要目的是为了在单点故障时保存数据,如果我们使用单个磁盘来存储数据,如果它损坏了,那么就没有机会取回我们的数据了,为了防止数据丢失我们需要一个容错的方法。所以,我们可以使用多个磁盘组成 RAID 阵列。 - -#### 在 RAID 0 中条带是什么 #### - -条带是通过将数据在同一时间分割到多个磁盘上。假设我们有两个磁盘,如果我们将数据保存到逻辑卷上,它会将数据保存在两个磁盘上。使用 RAID 0 是为了获得更好的性能,但是如果驱动器中一个出现故障,我们将不能得到完整的数据。因此,使用 RAID 0 不是一种好的做法。唯一的解决办法就是安装有 RAID0 逻辑卷的操作系统来提高文件的安全性。 - -- RAID 0 性能较高。 -- 在 RAID 0 上,空间零浪费。 -- 零容错(如果硬盘中的任何一个发生故障,无法取回数据)。 -- 写和读性能得以提高。 - -#### 要求 #### - -创建 RAID 0 允许的最小磁盘数目是2个,但你可以添加更多的磁盘,但数目应该是2,4,6,8等的两倍。如果你有一个物理 RAID 卡并且有足够的端口,你可以添加更多磁盘。 - -在这里,我们没有使用硬件 RAID,此设置只依赖于软件 RAID。如果我们有一个物理硬件 RAID 卡,我们可以从它的 UI 组件访问它。有些主板默认内建 RAID 功能,还可以使用 Ctrl + I 键访问 UI。 - -如果你是刚开始设置 RAID,请阅读我们前面的文章,我们已经介绍了一些关于 RAID 基本的概念。 - -- [Introduction to RAID and RAID Concepts][1] - -**我的服务器设置** - - Operating System : CentOS 6.5 Final - IP Address : 192.168.0.225 - Two Disks : 20 GB each - -这篇文章是9个 RAID 系列教程的第2部分,在这部分,我们将看看如何能够在 Linux 上创建和使用 RAID0(条带化),以名为 sdb 和 sdc 两个20GB的硬盘为例。 - -### 第1步:更新系统和安装管理 RAID 的 mdadm 软件 ### - -1.在 Linux 上设置 RAID0 前,我们先更新一下系统,然后安装 ‘mdadm’ 包。mdadm 是一个小程序,这将使我们能够在Linux下配置和管理 RAID 设备。 - - # yum clean all && yum update - # yum install mdadm -y - -![install mdadm in linux](http://www.tecmint.com/wp-content/uploads/2014/10/install-mdadm-in-linux.png) - -安装 mdadm 工具 - -### 第2步:检测并连接两个 20GB 的硬盘 ### - -2.在创建 RAID 0 前,请务必确认两个硬盘能被检测到,使用下面的命令确认。 - - # ls -l /dev | grep sd - -![Check Hard Drives in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Check-Hard-Drives.png) - -检查硬盘 - -3.一旦检测到新的硬盘驱动器,同时检查是否连接的驱动器已经被现有的 RAID 使用,使用下面的 ‘mdadm’ 命令来查看。 - - # mdadm --examine /dev/sd[b-c] - -![Check RAID Devices in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Check-Drives-using-RAID.png) - -检查 RAID 设备 - -从上面的输出我们可以看到,没有任何 RAID 使用 sdb 和 sdc 这两个驱动器。 - -### 第3步:创建 RAID 分区 ### - -4.现在用 sdb 和 sdc 创建 RAID 的分区,使用 fdisk 命令来创建。在这里,我将展示如何创建 sdb 驱动器上的分区。 - - # fdisk /dev/sdb - -请按照以下说明创建分区。 - -- 按 ‘n’ 创建新的分区。 -- 然后按 ‘P’ 选择主分区。 -- 接下来选择分区号为1。 -- 只需按两次回车键选择默认值即可。 -- 然后,按 ‘P’ 来打印创建好的分区。 - -![Create Partitions in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Create-Partitions-in-Linux.png) - -创建分区 - -请按照以下说明将分区创建为 Linux 的 RAID 类型。 - -- 按 ‘L’,列出所有可用的类型。 -- 按 ‘t’ 去修改分区。 -- 键入 ‘fd’ 设置为Linux 的 RAID 类型,然后按 Enter 确认。 -- 然后再次使用‘p’查看我们所做的更改。 -- 使用‘w’保存更改。 - -![Create RAID Partitions](http://www.tecmint.com/wp-content/uploads/2014/10/Create-RAID-Partitions.png) - -在 Linux 上创建 RAID 分区 - -**注**: 请使用上述步骤同样在 sdc 驱动器上创建分区。 - -5.创建分区后,验证这两个驱动器能使用下面的命令来正确定义 RAID。 - - # mdadm --examine /dev/sd[b-c] - # mdadm --examine /dev/sd[b-c]1 - -![Verify RAID Partitions](http://www.tecmint.com/wp-content/uploads/2014/10/Verify-RAID-Partitions.png) - -验证 RAID 分区 - -### 第4步:创建 RAID md 设备 ### - -6.现在使用以下命令创建 md 设备(即 /dev/md0),并选择 RAID 合适的级别。 - - # mdadm -C /dev/md0 -l raid0 -n 2 /dev/sd[b-c]1 - # mdadm --create /dev/md0 --level=stripe --raid-devices=2 /dev/sd[b-c]1 - -- -C – create -- -l – level -- -n – No of raid-devices - -7.一旦 md 设备已经建立,使用如下命令可以查看 RAID 级别,设备和阵列的使用状态。 - - # cat /proc/mdstat - -![Verify RAID Level](http://www.tecmint.com/wp-content/uploads/2014/10/Verify-RAID-Level.png) - -查看 RAID 级别 - - # mdadm -E /dev/sd[b-c]1 - -![Verify RAID Device](http://www.tecmint.com/wp-content/uploads/2014/10/Verify-RAID-Device.png) - -查看 RAID 设备 - - # mdadm --detail /dev/md0 - -![Verify RAID Array](http://www.tecmint.com/wp-content/uploads/2014/10/Verify-RAID-Array.png) - -查看 RAID 阵列 - -### 第5步:挂载 RAID 设备到文件系统 ### - -8.将 RAID 设备 /dev/md0 创建为 ext4 文件系统并挂载到 /mnt/raid0 下。 - - # mkfs.ext4 /dev/md0 - -![Create ext4 Filesystem in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Create-ext4-Filesystem.png) - -创建 ext4 文件系统 - -9. ext4 文件系统为 RAID 设备创建好后,现在创建一个挂载点(即 /mnt/raid0),并将设备 /dev/md0 挂载在它下。 - - # mkdir /mnt/raid0 - # mount /dev/md0 /mnt/raid0/ - -10.下一步,使用 df 命令验证设备 /dev/md0 是否被挂载在 /mnt/raid0 下。 - - # df -h - -11.接下来,创建一个名为 ‘tecmint.txt’ 的文件挂载到 /mnt/raid0 下,为创建的文件添加一些内容,并查看文件和目录的内容。 - - # touch /mnt/raid0/tecmint.txt - # echo "Hi everyone how you doing ?" > /mnt/raid0/tecmint.txt - # cat /mnt/raid0/tecmint.txt - # ls -l /mnt/raid0/ - -![Verify Mount Device](http://www.tecmint.com/wp-content/uploads/2014/10/Verify-Mount-Device.png) - -验证挂载的设备 - -12.一旦你验证挂载点后,同时将它添加到 /etc/fstab 文件中。 - - # vim /etc/fstab - -添加以下条目,根据你的安装位置和使用文件系统的不同,自行做修改。 - - /dev/md0 /mnt/raid0 ext4 deaults 0 0 - -![Add Device to Fstab](http://www.tecmint.com/wp-content/uploads/2014/10/Add-Device-to-Fstab.png) - -添加设备到 fstab 文件中 - -13.使用 mount ‘-a‘ 来检查 fstab 的条目是否有误。 - - # mount -av - -![Check Errors in Fstab](http://www.tecmint.com/wp-content/uploads/2014/10/Check-Errors-in-Fstab.png) - -检查 fstab 文件是否有误 - -### 第6步:保存 RAID 配置 ### - -14.最后,保存 RAID 配置到一个文件中,以供将来使用。同样,我们使用 ‘mdadm’ 命令带有 ‘-s‘ (scan) 和 ‘-v‘ (verbose) 选项,如图所示。 - - # mdadm -E -s -v >> /etc/mdadm.conf - # mdadm --detail --scan --verbose >> /etc/mdadm.conf - # cat /etc/mdadm.conf - -![Save RAID Configurations](http://www.tecmint.com/wp-content/uploads/2014/10/Save-RAID-Configurations.png) - -保存 RAID 配置 - -就这样,我们在这里看到,如何通过使用两个硬盘配置具有条带化的 RAID0 级别。在接下来的文章中,我们将看到如何设置 RAID5。 - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/create-raid0-in-linux/ - -作者:[Babin Lonston][a] -译者:[strugglingyouth](https://github.com/strugglingyouth) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.tecmint.com/author/babinlonston/ -[1]:http://www.tecmint.com/understanding-raid-setup-in-linux/ From f3d587ede36d68eb11002fb77c4eb66db7af746d Mon Sep 17 00:00:00 2001 From: struggling <630441839@qq.com> Date: Tue, 4 Aug 2015 10:33:36 +0800 Subject: [PATCH 808/965] Create Part 3 - Setting up RAID 1 (Mirroring) using 'Two Disks' in Linux.md --- ... (Mirroring) using 'Two Disks' in Linux.md | 217 ++++++++++++++++++ 1 file changed, 217 insertions(+) create mode 100644 translated/tech/RAID/Part 3 - Setting up RAID 1 (Mirroring) using 'Two Disks' in Linux.md diff --git a/translated/tech/RAID/Part 3 - Setting up RAID 1 (Mirroring) using 'Two Disks' in Linux.md b/translated/tech/RAID/Part 3 - Setting up RAID 1 (Mirroring) using 'Two Disks' in Linux.md new file mode 100644 index 0000000000..948e530ed8 --- /dev/null +++ b/translated/tech/RAID/Part 3 - Setting up RAID 1 (Mirroring) using 'Two Disks' in Linux.md @@ -0,0 +1,217 @@ +在 Linux 中使用"两个磁盘"创建 RAID 1(镜像) - 第3部分 +================================================================================ +RAID 镜像意味着相同数据的完整克隆(或镜像)写入到两个磁盘中。创建 RAID1 至少需要两个磁盘,它的读取性能或者可靠性比数据存储容量更好。 + + +![Create Raid1 in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Create-RAID1-in-Linux.jpeg) + +在 Linux 中设置 RAID1 + +创建镜像是为了防止因硬盘故障导致数据丢失。镜像中的每个磁盘包含数据的完整副本。当一个磁盘发生故障时,相同的数据可以从其它正常磁盘中读取。而后,可以从正在运行的计算机中直接更换发生故障的磁盘,无需任何中断。 + +### RAID 1 的特点 ### + +-镜像具有良好的性能。 + +-磁盘利用率为50%。也就是说,如果我们有两个磁盘每个500GB,总共是1TB,但在镜像中它只会显示500GB。 + +-在镜像如果一个磁盘发生故障不会有数据丢失,因为两个磁盘中的内容相同。 + +-读取数据会比写入性能更好。 + +#### 要求 #### + + +创建 RAID 1 至少要有两个磁盘,你也可以添加更多的磁盘,磁盘数需为2,4,6,8的两倍。为了能够添加更多的磁盘,你的系统必须有 RAID 物理适配器(硬件卡)。 + +这里,我们使用软件 RAID 不是硬件 RAID,如果你的系统有一个内置的物理硬件 RAID 卡,你可以从它的 UI 组件或使用 Ctrl + I 键来访问它。 + +需要阅读: [Basic Concepts of RAID in Linux][1] + +#### 在我的服务器安装 #### + + Operating System : CentOS 6.5 Final + IP Address : 192.168.0.226 + Hostname : rd1.tecmintlocal.com + Disk 1 [20GB] : /dev/sdb + Disk 2 [20GB] : /dev/sdc + +本文将指导你使用 mdadm (创建和管理 RAID 的)一步一步的建立一个软件 RAID 1 或镜像在 Linux 平台上。但同样的做法也适用于其它 Linux 发行版如 RedHat,CentOS,Fedora 等等。 + +### 第1步:安装所需要的并且检查磁盘 ### + +1.正如我前面所说,在 Linux 中我们需要使用 mdadm 软件来创建和管理 RAID。所以,让我们用 yum 或 apt-get 的软件包管理工具在 Linux 上安装 mdadm 软件包。 + + # yum install mdadm [on RedHat systems] + # apt-get install mdadm [on Debain systems] + +2. 一旦安装好‘mdadm‘包,我们需要使用下面的命令来检查磁盘是否已经配置好。 + + # mdadm -E /dev/sd[b-c] + +![Check RAID on Disks](http://www.tecmint.com/wp-content/uploads/2014/10/Check-RAID-on-Disks.png) + +检查 RAID 的磁盘 + + +正如你从上面图片看到的,没有检测到任何超级块,这意味着还没有创建RAID。 + +### 第2步:为 RAID 创建分区 ### + +3. 正如我提到的,我们最少使用两个分区 /dev/sdb 和 /dev/sdc 来创建 RAID1。我们首先使用‘fdisk‘命令来创建这两个分区并更改其类型为 raid。 + + # fdisk /dev/sdb + +按照下面的说明 + +- 按 ‘n’ 创建新的分区。 +- 然后按 ‘P’ 选择主分区。 +- 接下来选择分区号为1。 +- 按两次回车键默认将整个容量分配给它。 +- 然后,按 ‘P’ 来打印创建好的分区。 +- 按 ‘L’,列出所有可用的类型。 +- 按 ‘t’ 修改分区类型。 +- 键入 ‘fd’ 设置为Linux 的 RAID 类型,然后按 Enter 确认。 +- 然后再次使用‘p’查看我们所做的更改。 +- 使用‘w’保存更改。 + +![Create Disk Partitions](http://www.tecmint.com/wp-content/uploads/2014/10/Create-Disk-Partitions.png) + +创建磁盘分区 + +在创建“/dev/sdb”分区后,接下来按照同样的方法创建分区 /dev/sdc 。 + + # fdisk /dev/sdc + +![Create Second Partitions](http://www.tecmint.com/wp-content/uploads/2014/10/Create-Second-Partitions.png) + +创建第二个分区 + +4. 一旦这两个分区创建成功后,使用相同的命令来检查 sdb & sdc 分区并确认 RAID 分区的类型如上图所示。 + + # mdadm -E /dev/sd[b-c] + +![Verify Partitions Changes](http://www.tecmint.com/wp-content/uploads/2014/10/Verify-Partitions-Changes.png) + +验证分区变化 + +![Check RAID Type](http://www.tecmint.com/wp-content/uploads/2014/10/Check-RAID-Type.png) + +检查 RAID 类型 + +**注意**: 正如你在上图所看到的,在 sdb1 和 sdc1 中没有任何对 RAID 的定义,这就是我们没有检测到超级块的原因。 + +### 步骤3:创建 RAID1 设备 ### + +5.接下来使用以下命令来创建一个名为 /dev/md0 的“RAID1”设备并验证它 + + # mdadm --create /dev/md0 --level=mirror --raid-devices=2 /dev/sd[b-c]1 + # cat /proc/mdstat + +![Create RAID Device](http://www.tecmint.com/wp-content/uploads/2014/10/Create-RAID-Device.png) + +创建RAID设备 + +6. 接下来使用如下命令来检查 RAID 设备类型和 RAID 阵列 + + # mdadm -E /dev/sd[b-c]1 + # mdadm --detail /dev/md0 + +![Check RAID Device type](http://www.tecmint.com/wp-content/uploads/2014/10/Check-RAID-Device-type.png) + +检查 RAID 设备类型 + +![Check RAID Device Array](http://www.tecmint.com/wp-content/uploads/2014/10/Check-RAID-Device-Array.png) + +检查 RAID 设备阵列 + +从上图中,人们很容易理解,RAID1 已经使用的 /dev/sdb1 和 /dev/sdc1 分区被创建,你也可以看到状态为 resyncing。 + +### 第4步:在 RAID 设备上创建文件系统 ### + +7. 使用 ext4 为 md0 创建文件系统并挂载到 /mnt/raid1 . + + # mkfs.ext4 /dev/md0 + +![Create RAID Device Filesystem](http://www.tecmint.com/wp-content/uploads/2014/10/Create-RAID-Device-Filesystem.png) + +创建 RAID 设备文件系统 + +8. 接下来,挂载新创建的文件系统到“/mnt/raid1”,并创建一些文件,验证在挂载点的数据 + + # mkdir /mnt/raid1 + # mount /dev/md0 /mnt/raid1/ + # touch /mnt/raid1/tecmint.txt + # echo "tecmint raid setups" > /mnt/raid1/tecmint.txt + +![Mount Raid Device](http://www.tecmint.com/wp-content/uploads/2014/10/Mount-RAID-Device.png) + +挂载 RAID 设备 + +9.为了在系统重新启动自动挂载 RAID1,需要在 fstab 文件中添加条目。打开“/etc/fstab”文件并添加以下行。 + + /dev/md0 /mnt/raid1 ext4 defaults 0 0 + +![Raid Automount Device](http://www.tecmint.com/wp-content/uploads/2014/10/RAID-Automount-Filesystem.png) + +自动挂载 Raid 设备 + +10. 运行“mount -a”,检查 fstab 中的条目是否有错误 + # mount -av + +![Check Errors in fstab](http://www.tecmint.com/wp-content/uploads/2014/10/Check-Errors-in-fstab.png) + +检查 fstab 中的错误 + +11. 接下来,使用下面的命令保存 raid 的配置到文件“mdadm.conf”中。 + + # mdadm --detail --scan --verbose >> /etc/mdadm.conf + +![Save Raid Configuration](http://www.tecmint.com/wp-content/uploads/2014/10/Save-Raid-Configuration.png) + +保存 Raid 的配置 + +上述配置文件在系统重启时会读取并加载 RAID 设备。 + +### 第5步:在磁盘故障后检查数据 ### + +12.我们的主要目的是,即使在任何磁盘故障或死机时必须保证数据是可用的。让我们来看看,当任何一个磁盘不可用时会发生什么。 + + # mdadm --detail /dev/md0 + +![Raid Device Verify](http://www.tecmint.com/wp-content/uploads/2014/10/Raid-Device-Verify.png) + +验证 Raid 设备 + +在上面的图片中,我们可以看到在 RAID 中有2个设备是可用的并且 Active Devices 是2.现在让我们看看,当一个磁盘拔出(移除 sdc 磁盘)或损坏后会发生什么。 + + # ls -l /dev | grep sd + # mdadm --detail /dev/md0 + +![Test RAID Devices](http://www.tecmint.com/wp-content/uploads/2014/10/Test-RAID-Devices.png) + +测试 RAID 设备 + +现在,在上面的图片中你可以看到,一个磁盘不见了。我从虚拟机上删除了一个磁盘。此时让我们来检查我们宝贵的数据。 + + # cd /mnt/raid1/ + # cat tecmint.txt + +![Verify RAID Data](http://www.tecmint.com/wp-content/uploads/2014/10/Verify-RAID-Data.png) + +验证 RAID 数据 + +你有没有看到我们的数据仍然可用。由此,我们可以知道 RAID 1(镜像)的优势。在接下来的文章中,我们将看到如何设置一个 RAID 5 条带化分布式奇偶校验。希望这可以帮助你了解 RAID 1(镜像)是如何工作的。 + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/create-raid1-in-linux/ + +作者:[Babin Lonston][a] +译者:[strugglingyouth](https://github.com/strugglingyouth) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/babinlonston/ +[1]:http://www.tecmint.com/understanding-raid-setup-in-linux/ From 03f40b38babfc323a30e846016f4743afa8ca4d8 Mon Sep 17 00:00:00 2001 From: struggling <630441839@qq.com> Date: Tue, 4 Aug 2015 10:48:30 +0800 Subject: [PATCH 809/965] =?UTF-8?q?Create=20Part=202=20-=20Creating=20Soft?= =?UTF-8?q?ware=20RAID0=20(Stripe)=20on=20=E2=80=98Two=20Devices=E2=80=99?= =?UTF-8?q?=20Using=20=E2=80=98mdadm=E2=80=99=20Tool=20in=20Linux.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...Two Devices’ Using ‘mdadm’ Tool in Linux.md | 218 ++++++++++++++++++ 1 file changed, 218 insertions(+) create mode 100644 translated/tech/RAID/Part 2 - Creating Software RAID0 (Stripe) on ‘Two Devices’ Using ‘mdadm’ Tool in Linux.md diff --git a/translated/tech/RAID/Part 2 - Creating Software RAID0 (Stripe) on ‘Two Devices’ Using ‘mdadm’ Tool in Linux.md b/translated/tech/RAID/Part 2 - Creating Software RAID0 (Stripe) on ‘Two Devices’ Using ‘mdadm’ Tool in Linux.md new file mode 100644 index 0000000000..9feba99609 --- /dev/null +++ b/translated/tech/RAID/Part 2 - Creating Software RAID0 (Stripe) on ‘Two Devices’ Using ‘mdadm’ Tool in Linux.md @@ -0,0 +1,218 @@ +在 Linux 上使用 ‘mdadm’ 工具创建软件 RAID0 (条带化)在 ‘两个设备’ 上 - 第2部分 +================================================================================ +RAID 是廉价磁盘的冗余阵列,其高可用性和可靠性适用于大规模环境中,为了使数据被保护而不是被正常使用。RAID 只是磁盘的一个集合被称为逻辑卷。结合驱动器,使其成为一个阵列或称为集合(组)。 + +创建 RAID 最少应使用2个磁盘被连接组成 RAID 控制器,逻辑卷或多个驱动器可以根据定义的 RAID 级别添加在一个阵列中。不使用物理硬件创建的 RAID 被称为软件 RAID。软件 RAID 一般都是不太有钱的人才使用的。 + +![Setup RAID0 in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Raid0-in-Linux.jpg) + +在 Linux 中创建 RAID0 + +使用 RAID 的主要目的是为了在单点故障时保存数据,如果我们使用单个磁盘来存储数据,如果它损坏了,那么就没有机会取回我们的数据了,为了防止数据丢失我们需要一个容错的方法。所以,我们可以使用多个磁盘组成 RAID 阵列。 + +#### 在 RAID 0 中条带是什么 #### + +条带是通过将数据在同一时间分割到多个磁盘上。假设我们有两个磁盘,如果我们将数据保存到逻辑卷上,它会将数据保存在两个磁盘上。使用 RAID 0 是为了获得更好的性能,但是如果驱动器中一个出现故障,我们将不能得到完整的数据。因此,使用 RAID 0 不是一种好的做法。唯一的解决办法就是安装有 RAID0 逻辑卷的操作系统来提高文件的安全性。 + +- RAID 0 性能较高。 +- 在 RAID 0 上,空间零浪费。 +- 零容错(如果硬盘中的任何一个发生故障,无法取回数据)。 +- 写和读性能得以提高。 + +#### 要求 #### + +创建 RAID 0 允许的最小磁盘数目是2个,但你可以添加更多的磁盘,但数目应该是2,4,6,8等的两倍。如果你有一个物理 RAID 卡并且有足够的端口,你可以添加更多磁盘。 + +在这里,我们没有使用硬件 RAID,此设置只依赖于软件 RAID。如果我们有一个物理硬件 RAID 卡,我们可以从它的 UI 组件访问它。有些主板默认内建 RAID 功能,还可以使用 Ctrl + I 键访问 UI。 + +如果你是刚开始设置 RAID,请阅读我们前面的文章,我们已经介绍了一些关于 RAID 基本的概念。 + +- [Introduction to RAID and RAID Concepts][1] + +**我的服务器设置** + + Operating System : CentOS 6.5 Final + IP Address : 192.168.0.225 + Two Disks : 20 GB each + +这篇文章是9个 RAID 系列教程的第2部分,在这部分,我们将看看如何能够在 Linux 上创建和使用 RAID0(条带化),以名为 sdb 和 sdc 两个20GB的硬盘为例。 + +### 第1步:更新系统和安装管理 RAID 的 mdadm 软件 ### + +1.在 Linux 上设置 RAID0 前,我们先更新一下系统,然后安装 ‘mdadm’ 包。mdadm 是一个小程序,这将使我们能够在Linux下配置和管理 RAID 设备。 + + # yum clean all && yum update + # yum install mdadm -y + +![install mdadm in linux](http://www.tecmint.com/wp-content/uploads/2014/10/install-mdadm-in-linux.png) + +安装 mdadm 工具 + +### 第2步:检测并连接两个 20GB 的硬盘 ### + +2.在创建 RAID 0 前,请务必确认两个硬盘能被检测到,使用下面的命令确认。 + + # ls -l /dev | grep sd + +![Check Hard Drives in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Check-Hard-Drives.png) + +检查硬盘 + +3.一旦检测到新的硬盘驱动器,同时检查是否连接的驱动器已经被现有的 RAID 使用,使用下面的 ‘mdadm’ 命令来查看。 + + # mdadm --examine /dev/sd[b-c] + +![Check RAID Devices in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Check-Drives-using-RAID.png) + +检查 RAID 设备 + +从上面的输出我们可以看到,没有任何 RAID 使用 sdb 和 sdc 这两个驱动器。 + +### 第3步:创建 RAID 分区 ### + +4.现在用 sdb 和 sdc 创建 RAID 的分区,使用 fdisk 命令来创建。在这里,我将展示如何创建 sdb 驱动器上的分区。 + + # fdisk /dev/sdb + +请按照以下说明创建分区。 + +- 按 ‘n’ 创建新的分区。 +- 然后按 ‘P’ 选择主分区。 +- 接下来选择分区号为1。 +- 只需按两次回车键选择默认值即可。 +- 然后,按 ‘P’ 来打印创建好的分区。 + +![Create Partitions in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Create-Partitions-in-Linux.png) + +创建分区 + +请按照以下说明将分区创建为 Linux 的 RAID 类型。 + +- 按 ‘L’,列出所有可用的类型。 +- 按 ‘t’ 去修改分区。 +- 键入 ‘fd’ 设置为Linux 的 RAID 类型,然后按 Enter 确认。 +- 然后再次使用‘p’查看我们所做的更改。 +- 使用‘w’保存更改。 + +![Create RAID Partitions](http://www.tecmint.com/wp-content/uploads/2014/10/Create-RAID-Partitions.png) + +在 Linux 上创建 RAID 分区 + +**注**: 请使用上述步骤同样在 sdc 驱动器上创建分区。 + +5.创建分区后,验证这两个驱动器能使用下面的命令来正确定义 RAID。 + + # mdadm --examine /dev/sd[b-c] + # mdadm --examine /dev/sd[b-c]1 + +![Verify RAID Partitions](http://www.tecmint.com/wp-content/uploads/2014/10/Verify-RAID-Partitions.png) + +验证 RAID 分区 + +### 第4步:创建 RAID md 设备 ### + +6.现在使用以下命令创建 md 设备(即 /dev/md0),并选择 RAID 合适的级别。 + + # mdadm -C /dev/md0 -l raid0 -n 2 /dev/sd[b-c]1 + # mdadm --create /dev/md0 --level=stripe --raid-devices=2 /dev/sd[b-c]1 + +- -C – create +- -l – level +- -n – No of raid-devices + +7.一旦 md 设备已经建立,使用如下命令可以查看 RAID 级别,设备和阵列的使用状态。 + + # cat /proc/mdstat + +![Verify RAID Level](http://www.tecmint.com/wp-content/uploads/2014/10/Verify-RAID-Level.png) + +查看 RAID 级别 + + # mdadm -E /dev/sd[b-c]1 + +![Verify RAID Device](http://www.tecmint.com/wp-content/uploads/2014/10/Verify-RAID-Device.png) + +查看 RAID 设备 + + # mdadm --detail /dev/md0 + +![Verify RAID Array](http://www.tecmint.com/wp-content/uploads/2014/10/Verify-RAID-Array.png) + +查看 RAID 阵列 + +### 第5步:挂载 RAID 设备到文件系统 ### + +8.将 RAID 设备 /dev/md0 创建为 ext4 文件系统并挂载到 /mnt/raid0 下。 + + # mkfs.ext4 /dev/md0 + +![Create ext4 Filesystem in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Create-ext4-Filesystem.png) + +创建 ext4 文件系统 + +9. ext4 文件系统为 RAID 设备创建好后,现在创建一个挂载点(即 /mnt/raid0),并将设备 /dev/md0 挂载在它下。 + + # mkdir /mnt/raid0 + # mount /dev/md0 /mnt/raid0/ + +10.下一步,使用 df 命令验证设备 /dev/md0 是否被挂载在 /mnt/raid0 下。 + + # df -h + +11.接下来,创建一个名为 ‘tecmint.txt’ 的文件挂载到 /mnt/raid0 下,为创建的文件添加一些内容,并查看文件和目录的内容。 + + # touch /mnt/raid0/tecmint.txt + # echo "Hi everyone how you doing ?" > /mnt/raid0/tecmint.txt + # cat /mnt/raid0/tecmint.txt + # ls -l /mnt/raid0/ + +![Verify Mount Device](http://www.tecmint.com/wp-content/uploads/2014/10/Verify-Mount-Device.png) + +验证挂载的设备 + +12.一旦你验证挂载点后,同时将它添加到 /etc/fstab 文件中。 + + # vim /etc/fstab + +添加以下条目,根据你的安装位置和使用文件系统的不同,自行做修改。 + + /dev/md0 /mnt/raid0 ext4 deaults 0 0 + +![Add Device to Fstab](http://www.tecmint.com/wp-content/uploads/2014/10/Add-Device-to-Fstab.png) + +添加设备到 fstab 文件中 + +13.使用 mount ‘-a‘ 来检查 fstab 的条目是否有误。 + + # mount -av + +![Check Errors in Fstab](http://www.tecmint.com/wp-content/uploads/2014/10/Check-Errors-in-Fstab.png) + +检查 fstab 文件是否有误 + +### 第6步:保存 RAID 配置 ### + +14.最后,保存 RAID 配置到一个文件中,以供将来使用。同样,我们使用 ‘mdadm’ 命令带有 ‘-s‘ (scan) 和 ‘-v‘ (verbose) 选项,如图所示。 + + # mdadm -E -s -v >> /etc/mdadm.conf + # mdadm --detail --scan --verbose >> /etc/mdadm.conf + # cat /etc/mdadm.conf + +![Save RAID Configurations](http://www.tecmint.com/wp-content/uploads/2014/10/Save-RAID-Configurations.png) + +保存 RAID 配置 + +就这样,我们在这里看到,如何通过使用两个硬盘配置具有条带化的 RAID0 级别。在接下来的文章中,我们将看到如何设置 RAID5。 + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/create-raid0-in-linux/ + +作者:[Babin Lonston][a] +译者:[strugglingyouth](https://github.com/strugglingyouth) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/babinlonston/ +[1]:http://www.tecmint.com/understanding-raid-setup-in-linux/ From 81f06d85c3773c901edb69c80c182fd225a8f217 Mon Sep 17 00:00:00 2001 From: struggling <630441839@qq.com> Date: Tue, 4 Aug 2015 10:52:16 +0800 Subject: [PATCH 810/965] Create Part 1 - Introduction to RAID, Concepts of RAID and RAID Levels.md --- ... RAID, Concepts of RAID and RAID Levels.md | 146 ++++++++++++++++++ 1 file changed, 146 insertions(+) create mode 100644 translated/tech/RAID/Part 1 - Introduction to RAID, Concepts of RAID and RAID Levels.md diff --git a/translated/tech/RAID/Part 1 - Introduction to RAID, Concepts of RAID and RAID Levels.md b/translated/tech/RAID/Part 1 - Introduction to RAID, Concepts of RAID and RAID Levels.md new file mode 100644 index 0000000000..8ca0ecbd7e --- /dev/null +++ b/translated/tech/RAID/Part 1 - Introduction to RAID, Concepts of RAID and RAID Levels.md @@ -0,0 +1,146 @@ + +RAID的级别和概念的介绍 - 第1部分 +================================================================================ +RAID是廉价磁盘冗余阵列,但现在它被称为独立磁盘冗余阵列。早先一个容量很小的磁盘都是非常昂贵的,但是现在我们可以很便宜的买到一个更大的磁盘。Raid 是磁盘的一个集合,被称为逻辑卷。 + + +![RAID in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/RAID.jpg) + +在 Linux 中理解 RAID 的设置 + +RAID包含一组或者一个集合甚至一个阵列。使用一组磁盘结合驱动器组成 RAID 阵列或 RAID 集。一个 RAID 控制器至少使用两个磁盘并且使用一个逻辑卷或者多个驱动器在一个组中。在一个磁盘组的应用中只能使用一个 RAID 级别。使用 RAID 可以提高服务器的性能。不同 RAID 的级别,性能会有所不同。它通过容错和高可用性来保存我们的数据。 + +这个系列被命名为RAID的构建共包含9个部分包括以下主题。 + +- 第1部分:RAID的级别和概念的介绍 +- 第2部分:在Linux中如何设置 RAID0(条带化) +- 第3部分:在Linux中如何设置 RAID1(镜像化) +- 第4部分:在Linux中如何设置 RAID5(条带化与分布式奇偶校验) +- 第5部分:在Linux中如何设置 RAID6(条带双分布式奇偶校验) +- 第6部分:在Linux中设置 RAID 10 或1 + 0(嵌套) +- 第7部分:增加现有的 RAID 阵列并删除损坏的磁盘 +- 第8部分:在 RAID 中恢复(重建)损坏的驱动器 +- 第9部分:在 Linux 中管理 RAID + +这是9系列教程的第1部分,在这里我们将介绍 RAID 的概念和 RAID 级别,这是在 Linux 中构建 RAID 需要理解的。 + + +### 软件RAID和硬件RAID ### + +软件 RAID 的性能很低,因为其从主机资源消耗。 RAID 软件需要加载可读取数据从软件 RAID 卷中。在加载 RAID 软件前,操作系统需要得到加载 RAID 软件的引导。在软件 RAID 中无需物理硬件。零成本投资。 + +硬件 RAID 具有很高的性能。他们有专用的 RAID 控制器,采用 PCI Express卡物理内置的。它不会使用主机资源。他们有 NVRAM 缓存读取和写入。当重建时即使出现电源故障,它会使用电池电源备份存储缓存。对于大规模使用需要非常昂贵的投资。 + +硬件 RAID 卡如下所示: + +![Hardware RAID](http://www.tecmint.com/wp-content/uploads/2014/10/Hardware-RAID.jpg) + +硬件RAID + +#### 精选的 RAID 概念 #### + +- 在 RAID 重建中校验方法中丢失的内容来自从校验中保存的信息。 RAID 5,RAID 6 基于校验。 +- 条带化是随机共享数据到多个磁盘。它不会在单个磁盘中保存完整的数据。如果我们使用3个磁盘,则数据将会存在于每个磁盘上。 +- 镜像被用于 RAID 1 和 RAID 10。镜像会自动备份数据。在 RAID 1,它将保存相同的内容到其他盘上。 +- 在我们的服务器上,热备份只是一个备用驱动器,它可以自动更换发生故障的驱动器。在我们的阵列中,如果任何一个驱动器损坏,热备份驱动器会自动重建。 +- 块是 RAID 控制器每次读写数据时的最小单位,最小4KB。通过定义块大小,我们可以增加 I/O 性能。 + +RAID有不同的级别。在这里,我们仅看到在真实环境下的使用最多的 RAID 级别。 + +- RAID0 = 条带化 +- RAID1 = 镜像 +- RAID5 = 单个磁盘分布式奇偶校验 +- RAID6 = 双盘分布式奇偶校验 +- RAID10 = 镜像 + 条带。(嵌套RAID) + +RAID 在大多数 Linux 发行版上使用 mdadm 的包管理。让我们先对每个 RAID 级别认识一下。 + +#### RAID 0(或)条带化 #### + +条带化有很好的性能。在 RAID 0(条带化)中数据将使用共享的方式被写入到磁盘。一半的内容将是在一个磁盘上,另一半内容将被写入到其它磁盘。 + +假设我们有2个磁盘驱动器,例如,如果我们将数据“TECMINT”写到逻辑卷中,“T”将被保存在第一盘中,“E”将保存在第二盘,'C'将被保存在第一盘,“M”将保存在第二盘,它会一直继续此循环过程。 + +在这种情况下,如果驱动器中的任何一个发生故障,我们将丢失所有的数据,因为一个盘中只有一半的数据,不能用于重建。不过,当比较写入速度和性能时,RAID0 是非常好的。创建 RAID 0(条带化)至少需要2个磁盘。如果你的数据是非常宝贵的,那么不要使用此 RAID 级别。 + +- 高性能。 +- 在 RAID0 上零容量损失。 +- 零容错。 +- 写和读有很高的性能。 + +#### RAID1(或)镜像化 #### + +镜像也有不错的性能。镜像可以备份我们的数据。假设我们有两组2TB的硬盘驱动器,我们总共有4TB,但在镜像中,驱动器在 RAID 控制器的后面形成一个逻辑驱动器,我们只能看到逻辑驱动器有2TB。 + +当我们保存数据时,它将同时写入2TB驱动器中。创建 RAID 1 (镜像化)最少需要两个驱动器。如果发生磁盘故障,我们可以恢复 RAID 通过更换一个新的磁盘。如果在 RAID 1 中任何一个磁盘发生故障,我们可以从另一个磁盘中获取相同的数据,因为其他的磁盘中也有相同的数据。所以是零数据丢失。 + +- 良好的性能。 +- 空间的一半将在总容量丢失。 +- 完全容错。 +- 重建会更快。 +- 写性能将是缓慢的。 +- 读将会很好。 +- 被操作系统和数据库使用的规模很小。 + +#### RAID 5(或)分布式奇偶校验 #### + +RAID 5 多用于企业的水平。 RAID 5 的工作通过分布式奇偶校验的方法。奇偶校验信息将被用于重建数据。它需要留下的正常驱动器上的信息去重建。驱动器故障时,这会保护我们的数据。 + +假设我们有4个驱动器,如果一个驱动器发生故障而后我们更换发生故障的驱动器后,我们可以从奇偶校验中重建数据到更换的驱动器上。奇偶校验信息存储在所有的4个驱动器上,如果我们有4个 1TB 的驱动器。奇偶校验信息将被存储在每个驱动器的256G中而其它768GB是用户自己使用的。单个驱动器故障后,RAID 5 依旧正常工作,如果驱动器损坏个数超过1个会导致数据的丢失。 + +- 性能卓越 +- 读速度将非常好。 +- 如果我们不使用硬件 RAID 控制器,写速度是缓慢的。 +- 从所有驱动器的奇偶校验信息中重建。 +- 完全容错。 +- 1个磁盘空间将用于奇偶校验。 +- 可以被用在文件服务器,Web服务器,非常重要的备份中。 + +#### RAID 6 两个分布式奇偶校验磁盘 #### + +RAID 6 和 RAID 5 相似但它有两个分布式奇偶校验。大多用在大量的阵列中。我们最少需要4个驱动器,即使有2个驱动器发生故障,我们依然可以重建数据,同时更换新的驱动器。 + +它比 RAID 5 非常慢,因为它将数据同时写到4个驱动器上。当我们使用硬件 RAID 控制器时速度将被平均。如果我们有6个的1TB驱动器,4个驱动器将用于数据保存,2个驱动器将用于校验。 + +- 性能不佳。 +- 读的性能很好。 +- 如果我们不使用硬件 RAID 控制器写的性能会很差。 +- 从2奇偶校验驱动器上重建。 +- 完全容错。 +- 2个磁盘空间将用于奇偶校验。 +- 可用于大型阵列。 +- 在备份和视频流中大规模使用。 + +#### RAID 10(或)镜像+条带 #### + +RAID 10 可以被称为1 + 0或0 +1。它将做镜像+条带两个工作。在 RAID 10 中首先做镜像然后做条带。在 RAID 01 上首先做条带,然后做镜像。RAID 10 比 01 好。 + +假设,我们有4个驱动器。当我写了一些数据到逻辑卷上,它会使用镜像和条带将数据保存到4个驱动器上。 + +如果我在 RAID 10 上写入数据“TECMINT”,数据将使用如下形式保存。首先将“T”同时写入两个磁盘,“E”也将同时写入两个磁盘,这一步将所有数据都写入。这使数据得到备份。 + +同时它将使用 RAID 0 方式写入数据,遵循将“T”写入第一个盘,“E”写入第二个盘。再次将“C”写入第一个盘,“M”到第二个盘。 + +- 良好的读写性能。 +- 空间的一半将在总容量丢失。 +- 容错。 +- 从备份数据中快速重建。 +- 它的高性能和高可用性常被用于数据库的存储中。 + +### 结论 ### + +在这篇文章中,我们已经看到了什么是 RAID 和在实际环境大多采用 RAID 的哪个级别。希望你已经学会了上面所写的。对于 RAID 的构建必须了解有关 RAID 的基本知识。以上内容对于你了解 RAID 基本满足。 + +在接下来的文章中,我将介绍如何设置和使用各种级别创建 RAID,增加 RAID 组(阵列)和驱动器故障排除等。 + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/understanding-raid-setup-in-linux/ + +作者:[Babin Lonston][a] +译者:[strugglingyouth](https://github.com/strugglingyouth) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/babinlonston/ From 58e17d89a5653abf7d8f4d7315e4f19a684099c0 Mon Sep 17 00:00:00 2001 From: Jindong Huang Date: Tue, 4 Aug 2015 19:12:16 +0800 Subject: [PATCH 811/965] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E5=AE=8C=E6=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 翻译完毕 --- ...y Using 'Explain Shell' Script in Linux.md | 121 ------------------ 1 file changed, 121 deletions(-) delete mode 100644 sources/tech/20150728 Understanding Shell Commands Easily Using 'Explain Shell' Script in Linux.md diff --git a/sources/tech/20150728 Understanding Shell Commands Easily Using 'Explain Shell' Script in Linux.md b/sources/tech/20150728 Understanding Shell Commands Easily Using 'Explain Shell' Script in Linux.md deleted file mode 100644 index ab7572cd7a..0000000000 --- a/sources/tech/20150728 Understanding Shell Commands Easily Using 'Explain Shell' Script in Linux.md +++ /dev/null @@ -1,121 +0,0 @@ - -Translating by dingdongnigetou - -Understanding Shell Commands Easily Using “Explain Shell” Script in Linux -================================================================================ -While working on Linux platform all of us need help on shell commands, at some point of time. Although inbuilt help like man pages, whatis command is helpful, but man pages output are too lengthy and until and unless one has some experience with Linux, it is very difficult to get any help from massive man pages. The output of whatis command is rarely more than one line which is not sufficient for newbies. - -![Explain Shell Commands in Linux Shell](http://www.tecmint.com/wp-content/uploads/2015/07/Explain-Shell-Commands-in-Linux-Shell.jpeg) - -Explain Shell Commands in Linux Shell - -There are third-party application like ‘cheat‘, which we have covered here “[Commandline Cheat Sheet for Linux Users][1]. Although Cheat is an exceptionally good application which shows help on shell command even when computer is not connected to Internet, it shows help on predefined commands only. - -There is a small piece of code written by Jackson which is able to explain shell commands within the bash shell very effectively and guess what the best part is you don’t need to install any third party package. He named the file containing this piece of code as `'explain.sh'`. - -#### Features of Explain Utility #### - -- Easy Code Embedding. -- No third-party utility needed to be installed. -- Output just enough information in course of explanation. -- Requires internet connection to work. -- Pure command-line utility. -- Able to explain most of the shell commands in bash shell. -- No root Account involvement required. - -**Prerequisite** - -The only requirement is `'curl'` package. In most of the today’s latest Linux distributions, curl package comes pre-installed, if not you can install it using package manager as shown below. - - # apt-get install curl [On Debian systems] - # yum install curl [On CentOS systems] - -### Installation of explain.sh Utility in Linux ### - -We have to insert the below piece of code as it is in the `~/.bashrc` file. The code should be inserted for each user and each `.bashrc` file. It is suggested to insert the code to the user’s .bashrc file only and not in the .bashrc of root user. - -Notice the first line of code that starts with hash `(#)` is optional and added just to differentiate rest of the codes of .bashrc. - -# explain.sh marks the beginning of the codes, we are inserting in .bashrc file at the bottom of this file. - - # explain.sh begins - explain () { - if [ "$#" -eq 0 ]; then - while read -p "Command: " cmd; do - curl -Gs "https://www.mankier.com/api/explain/?cols="$(tput cols) --data-urlencode "q=$cmd" - done - echo "Bye!" - elif [ "$#" -eq 1 ]; then - curl -Gs "https://www.mankier.com/api/explain/?cols="$(tput cols) --data-urlencode "q=$1" - else - echo "Usage" - echo "explain interactive mode." - echo "explain 'cmd -o | ...' one quoted command to explain it." - fi - } - -### Working of explain.sh Utility ### - -After inserting the code and saving it, you must logout of the current session and login back to make the changes taken into effect. Every thing is taken care of by the ‘curl’ command which transfer the input command and flag that need explanation to the mankier server and then print just necessary information to the Linux command-line. Not to mention to use this utility you must be connected to internet always. - -Let’s test few examples of command which I don’t know the meaning with explain.sh script. - -**1. I forgot what ‘du -h‘ does. All I need to do is:** - - $ explain 'du -h' - -![Get Help on du Command](http://www.tecmint.com/wp-content/uploads/2015/07/Get-Help-on-du-Command.png) - -Get Help on du Command - -**2. If you forgot what ‘tar -zxvf‘ does, you may simply do:** - - $ explain 'tar -zxvf' - -![Tar Command Help](http://www.tecmint.com/wp-content/uploads/2015/07/Tar-Command-Help.png) - -Tar Command Help - -**3. One of my friend often confuse the use of ‘whatis‘ and ‘whereis‘ command, so I advised him.** - -Go to Interactive Mode by simply typing explain command on the terminal. - - $ explain - -and then type the commands one after another to see what they do in one window, as: - - Command: whatis - Command: whereis - -![Whatis Whereis Commands Help](http://www.tecmint.com/wp-content/uploads/2015/07/Whatis-Whereis-Commands-Help.png) - -Whatis Whereis Commands Help - -To exit interactive mode he just need to do Ctrl + c. - -**4. You can ask to explain more than one command chained by pipeline.** - - $ explain 'ls -l | grep -i Desktop' - -![Get Help on Multiple Commands](http://www.tecmint.com/wp-content/uploads/2015/07/Get-Help-on-Multiple-Commands.png) - -Get Help on Multiple Commands - -Similarly you can ask your shell to explain any shell command. All you need is a working Internet connection. The output is generated based upon the explanation needed from the server and hence the output result is not customizable. - -For me this utility is really helpful and it has been honored being added to my .bashrc. Let me know what is your thought on this project? How it can useful for you? Is the explanation satisfactory? - -Provide us with your valuable feedback in the comments below. Like and share us and help us get spread. - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/explain-shell-commands-in-the-linux-shell/ - -作者:[Avishek Kumar][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.tecmint.com/author/avishek/ -[1]:http://www.tecmint.com/cheat-command-line-cheat-sheet-for-linux-users/ From b8127cd50d3c05e938f45795e9f37e617112cc99 Mon Sep 17 00:00:00 2001 From: Jindong Huang Date: Tue, 4 Aug 2015 19:17:36 +0800 Subject: [PATCH 812/965] =?UTF-8?q?Create=20=E3=80=90=E7=BF=BB=E8=AF=91?= =?UTF-8?q?=E5=AE=8C=E6=AF=95=E3=80=9120150728=20Understanding=20Shell=20C?= =?UTF-8?q?ommands=20Easily=20Using=20'Explain=20Shell'=20Script=20in=20Li?= =?UTF-8?q?nux.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... Easily Using 'Explain Shell' Script in Linux.md | 118 ++++++++++++++++++ 1 file changed, 118 insertions(+) create mode 100644 translated/tech/【翻译完毕】20150728 Understanding Shell Commands Easily Using 'Explain Shell' Script in Linux.md diff --git a/translated/tech/【翻译完毕】20150728 Understanding Shell Commands Easily Using 'Explain Shell' Script in Linux.md b/translated/tech/【翻译完毕】20150728 Understanding Shell Commands Easily Using 'Explain Shell' Script in Linux.md new file mode 100644 index 0000000000..b8f993676c --- /dev/null +++ b/translated/tech/【翻译完毕】20150728 Understanding Shell Commands Easily Using 'Explain Shell' Script in Linux.md @@ -0,0 +1,118 @@ +在Linux中利用"Explain Shell"脚本更容易地理解Shell命令 +================================================================================ +在某些时刻, 当我们在Linux平台上工作时我们所有人都需要shell命令的帮助信息。 尽管内置的帮助像man pages、whatis命令是有帮助的, 但man pages的输出非常冗长, 除非是个有linux经验的人,不然从大量的man pages中获取帮助信息是非常困难的,而whatis命令的输出很少超过一行, 这对初学者来说是不够的。 + +![Explain Shell Commands in Linux Shell](http://www.tecmint.com/wp-content/uploads/2015/07/Explain-Shell-Commands-in-Linux-Shell.jpeg) + +在Linux Shell中解释Shell命令 + +有一些第三方应用程序, 像我们在[Commandline Cheat Sheet for Linux Users][1]提及过的'cheat'命令。Cheat是个杰出的应用程序,即使计算机没有联网也能提供shell命令的帮助, 但是它仅限于预先定义好的命令。 + +Jackson写了一小段代码,它能非常有效地在bash shell里面解释shell命令,可能最美之处就是你不需要安装第三方包了。他把包含这段代码的的文件命名为”explain.sh“。 + +#### Explain工具的特性 #### + +- 易嵌入代码。 +- 不需要安装第三方工具。 +- 在解释过程中输出恰到好处的信息。 +- 需要网络连接才能工作。 +- 纯命令行工具。 +- 可以解释bash shell里面的大部分shell命令。 +- 无需root账户参与。 + +**先决条件** + +唯一的条件就是'curl'包了。 在如今大多数Linux发行版里面已经预安装了culr包, 如果没有你可以按照下面的命令来安装。 + + # apt-get install curl [On Debian systems] + # yum install curl [On CentOS systems] + +### 在Linux上安装explain.sh工具 ### + +我们要将下面这段代码插入'~/.bashrc'文件(LCTT注: 若没有该文件可以自己新建一个)中。我们必须为每个用户以及对应的'.bashrc'文件插入这段代码,笔者建议你不要加在root用户下。 + +我们注意到.bashrc文件的第一行代码以(#)开始, 这个是可选的并且只是为了区分余下的代码。 + +# explain.sh 标记代码的开始, 我们将代码插入.bashrc文件的底部。 + + # explain.sh begins + explain () { + if [ "$#" -eq 0 ]; then + while read -p "Command: " cmd; do + curl -Gs "https://www.mankier.com/api/explain/?cols="$(tput cols) --data-urlencode "q=$cmd" + done + echo "Bye!" + elif [ "$#" -eq 1 ]; then + curl -Gs "https://www.mankier.com/api/explain/?cols="$(tput cols) --data-urlencode "q=$1" + else + echo "Usage" + echo "explain interactive mode." + echo "explain 'cmd -o | ...' one quoted command to explain it." + fi + } + +### explain.sh工具的使用 ### + +在插入代码并保存之后,你必须退出当前的会话然后重新登录来使改变生效(LCTT注:你也可以直接使用命令“source~/.bashrc”来让改变生效)。每件事情都是交由‘curl’命令处理, 它负责将需要解释的命令以及命令选项传送给mankier服务,然后将必要的信息打印到Linux命令行。不必说的就是使用这个工具你总是需要连接网络。 + +让我们用explain.sh脚本测试几个笔者不懂的命令例子。 + +**1.我忘了‘du -h’是干嘛用的, 我只需要这样做:** + + $ explain 'du -h' + +![Get Help on du Command](http://www.tecmint.com/wp-content/uploads/2015/07/Get-Help-on-du-Command.png) + +获得du命令的帮助 + +**2.如果你忘了'tar -zxvf'的作用,你可以简单地如此做:** + + $ explain 'tar -zxvf' + +![Tar Command Help](http://www.tecmint.com/wp-content/uploads/2015/07/Tar-Command-Help.png) + +Tar命令帮助 + +**3.我的一个朋友经常对'whatis'以及'whereis'命令的使用感到困惑,所以我建议他:** + +在终端简单的地敲下explain命令进入交互模式。 + + $ explain + +然后一个接着一个地输入命令,就能在一个窗口看到他们各自的作用: + + Command: whatis + Command: whereis + +![Whatis Whereis Commands Help](http://www.tecmint.com/wp-content/uploads/2015/07/Whatis-Whereis-Commands-Help.png) + +Whatis/Whereis命令的帮助 + +你只需要使用“Ctrl+c”就能退出交互模式。 + +**4. 你可以通过管道来请求解释更多的命令。** + + $ explain 'ls -l | grep -i Desktop' + +![Get Help on Multiple Commands](http://www.tecmint.com/wp-content/uploads/2015/07/Get-Help-on-Multiple-Commands.png) + +获取多条命令的帮助 + +同样地,你可以请求你的shell来解释任何shell命令。 前提是你需要一个可用的网络。输出的信息是基于解释的需要从服务器中生成的,因此输出的结果是不可定制的。 + +对于我来说这个工具真的很有用并且它已经荣幸地添加在我的.bashrc文件中。你对这个项目有什么想法?它对你有用么?它的解释令你满意吗?请让我知道吧! + +请在下面评论为我们提供宝贵意见,喜欢并分享我们以及帮助我们得到传播。 + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/explain-shell-commands-in-the-linux-shell/ + +作者:[Avishek Kumar][a] +译者:[dingdongnigetou](https://github.com/dingdongnigetou) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/avishek/ +[1]:http://www.tecmint.com/cheat-command-line-cheat-sheet-for-linux-users/ From a61412acbc3535975deb7581f54844a83d1f1e99 Mon Sep 17 00:00:00 2001 From: Jindong Huang Date: Tue, 4 Aug 2015 19:18:09 +0800 Subject: [PATCH 813/965] =?UTF-8?q?Rename=20=E3=80=90=E7=BF=BB=E8=AF=91?= =?UTF-8?q?=E5=AE=8C=E6=AF=95=E3=80=9120150728=20Understanding=20Shell=20C?= =?UTF-8?q?ommands=20Easily=20Using=20'Explain=20Shell'=20Script=20in=20Li?= =?UTF-8?q?nux.md=20to=2020150728=20Understanding=20Shell=20Commands=20Eas?= =?UTF-8?q?ily=20Using=20'Explain=20Shell'=20Script=20in=20Linux.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ding Shell Commands Easily Using 'Explain Shell' Script in Linux.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename translated/tech/{【翻译完毕】20150728 Understanding Shell Commands Easily Using 'Explain Shell' Script in Linux.md => 20150728 Understanding Shell Commands Easily Using 'Explain Shell' Script in Linux.md} (100%) diff --git a/translated/tech/【翻译完毕】20150728 Understanding Shell Commands Easily Using 'Explain Shell' Script in Linux.md b/translated/tech/20150728 Understanding Shell Commands Easily Using 'Explain Shell' Script in Linux.md similarity index 100% rename from translated/tech/【翻译完毕】20150728 Understanding Shell Commands Easily Using 'Explain Shell' Script in Linux.md rename to translated/tech/20150728 Understanding Shell Commands Easily Using 'Explain Shell' Script in Linux.md From c823978d30497a34d2e73d8ace42140ddc4567c1 Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 4 Aug 2015 22:32:09 +0800 Subject: [PATCH 814/965] PUB:20150729 What is Logical Volume Management and How Do You Enable It in Ubuntu @geekpi --- ...ment and How Do You Enable It in Ubuntu.md | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) rename {translated/tech => published}/20150729 What is Logical Volume Management and How Do You Enable It in Ubuntu.md (67%) diff --git a/translated/tech/20150729 What is Logical Volume Management and How Do You Enable It in Ubuntu.md b/published/20150729 What is Logical Volume Management and How Do You Enable It in Ubuntu.md similarity index 67% rename from translated/tech/20150729 What is Logical Volume Management and How Do You Enable It in Ubuntu.md rename to published/20150729 What is Logical Volume Management and How Do You Enable It in Ubuntu.md index 05f07b74e6..86569b0128 100644 --- a/translated/tech/20150729 What is Logical Volume Management and How Do You Enable It in Ubuntu.md +++ b/published/20150729 What is Logical Volume Management and How Do You Enable It in Ubuntu.md @@ -1,26 +1,25 @@ -什么是逻辑分区管理工具,它怎么在Ubuntu启用? +什么是逻辑分区管理 LVM ,如何在Ubuntu中使用? ================================================================================ -> 逻辑分区管理(LVM)是每一个主流Linux发行版都含有的磁盘管理选项。无论你是否需要设置存储池或者只需要动态创建分区,LVM就是你正在寻找的。 + +> 逻辑分区管理(LVM)是每一个主流Linux发行版都含有的磁盘管理选项。无论是你需要设置存储池,还是只想动态创建分区,那么LVM就是你正在寻找的。 ### 什么是 LVM? ### -逻辑分区管理是一个存在于磁盘/分区和操作系统之间的一个抽象层。在传统的磁盘管理中,你的操作系统寻找有哪些磁盘可用(/dev/sda、/dev/sdb等等)接着这些磁盘有哪些可用的分区(如/dev/sda1、/dev/sda2等等)。 +逻辑分区管理是一个存在于磁盘/分区和操作系统之间的一个抽象层。在传统的磁盘管理中,你的操作系统寻找有哪些磁盘可用(/dev/sda、/dev/sdb等等),并且这些磁盘有哪些可用的分区(如/dev/sda1、/dev/sda2等等)。 -在LVM下,磁盘和分区可以抽象成一个设备中含有多个磁盘和分区。你的操作系统将不会知道这些区别,因为LVM只会给操作系统展示你设置的卷组(磁盘)和逻辑卷(分区) +在LVM下,磁盘和分区可以抽象成一个含有多个磁盘和分区的设备。你的操作系统将不会知道这些区别,因为LVM只会给操作系统展示你设置的卷组(磁盘)和逻辑卷(分区) -,因此可以很容易地动态调整和创建新的磁盘和分区。除此之外,LVM带来你的文件系统不具备的功能。比如,ext3不支持实时快照,但是如果你正在使用LVM你可以不卸载磁盘的情况下做一个逻辑卷的快照。 +因为卷组和逻辑卷并不物理地对应到影片,因此可以很容易地动态调整和创建新的磁盘和分区。除此之外,LVM带来了你的文件系统所不具备的功能。比如,ext3不支持实时快照,但是如果你正在使用LVM你可以不卸载磁盘的情况下做一个逻辑卷的快照。 ### 你什么时候该使用LVM? ### -在使用LVM之前首先得考虑的一件事是你要用你的磁盘和分区完成什么。一些发行版如Fedora已经默认安装了LVM。 +在使用LVM之前首先得考虑的一件事是你要用你的磁盘和分区来做什么。注意,一些发行版如Fedora已经默认安装了LVM。 -如果你使用的是一台只有一块磁盘的Ubuntu笔记本电脑,并且你不需要像实时快照这样的扩展功能,那么你或许不需要LVM。如果I想要轻松地扩展或者想要将多块磁盘组成一个存储池,那么LVM或许正式你郑寻找的。 +如果你使用的是一台只有一块磁盘的Ubuntu笔记本电脑,并且你不需要像实时快照这样的扩展功能,那么你或许不需要LVM。如果你想要轻松地扩展或者想要将多块磁盘组成一个存储池,那么LVM或许正是你所寻找的。 ### 在Ubuntu中设置LVM ### -使用LVM首先要了解的一件事是没有简单的方法将已经存在传统的分区转换成逻辑分区。可以将它移到一个使用LVM的新分区下,但是这并不会在本篇中提到;反之我们将全新安装一台Ubuntu 10.10来设置LVM - -![](http://cdn3.howtogeek.com/wp-content/uploads/2010/12/ubuntu-10-banner.png) +使用LVM首先要了解的一件事是,没有一个简单的方法可以将已有的传统分区转换成逻辑卷。可以将数据移到一个使用LVM的新分区下,但是这并不会在本篇中提到;在这里,我们将全新安装一台Ubuntu 10.10来设置LVM。(LCTT 译注:本文针对的是较老的版本,新的版本已经不需如此麻烦了) 要使用LVM安装Ubuntu你需要使用另外的安装CD。从下面的链接中下载并烧录到CD中或者[使用unetbootin创建一个USB盘][1]。 @@ -64,7 +63,7 @@ via: http://www.howtogeek.com/howto/36568/what-is-logical-volume-management-and- 作者:[How-To Geek][a] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 7c8fd52aa7704ddee0fa04a71fee6b5b06647180 Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 4 Aug 2015 23:11:02 +0800 Subject: [PATCH 815/965] PUB:20150318 How to Manage and Use LVM (Logical Volume Management) in Ubuntu @ictlyh --- ...M (Logical Volume Management) in Ubuntu.md | 52 +++++++++---------- 1 file changed, 26 insertions(+), 26 deletions(-) rename {translated/tech => published}/20150318 How to Manage and Use LVM (Logical Volume Management) in Ubuntu.md (79%) diff --git a/translated/tech/20150318 How to Manage and Use LVM (Logical Volume Management) in Ubuntu.md b/published/20150318 How to Manage and Use LVM (Logical Volume Management) in Ubuntu.md similarity index 79% rename from translated/tech/20150318 How to Manage and Use LVM (Logical Volume Management) in Ubuntu.md rename to published/20150318 How to Manage and Use LVM (Logical Volume Management) in Ubuntu.md index c3a84f5fcf..76a2c8d224 100644 --- a/translated/tech/20150318 How to Manage and Use LVM (Logical Volume Management) in Ubuntu.md +++ b/published/20150318 How to Manage and Use LVM (Logical Volume Management) in Ubuntu.md @@ -1,20 +1,20 @@ -如何在 Ubuntu 中管理和使用 LVM(Logical Volume Management,逻辑卷管理) +如何在 Ubuntu 中管理和使用 逻辑卷管理 LVM ================================================================================ ![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/652x202xbanner-1.png.pagespeed.ic.VGSxDeVS9P.png) 在我们之前的文章中,我们介绍了[什么是 LVM 以及能用 LVM 做什么][1],今天我们会给你介绍一些 LVM 的主要管理工具,使得你在设置和扩展安装时更游刃有余。 -正如之前所述,LVM 是介于你的操作系统和物理硬盘驱动器之间的抽象层。这意味着你的物理硬盘驱动器和分区不再依赖于他们所在的硬盘驱动和分区。而是,你的操作系统所见的硬盘驱动和分区可以是由任意数目的独立硬盘驱动汇集而成或是一个软件磁盘阵列。 +正如之前所述,LVM 是介于你的操作系统和物理硬盘驱动器之间的抽象层。这意味着你的物理硬盘驱动器和分区不再依赖于他们所在的硬盘驱动和分区。而是你的操作系统所见的硬盘驱动和分区可以是由任意数目的独立硬盘汇集而成的或是一个软件磁盘阵列。 要管理 LVM,这里有很多可用的 GUI 工具,但要真正理解 LVM 配置发生的事情,最好要知道一些命令行工具。这当你在一个服务器或不提供 GUI 工具的发行版上管理 LVM 时尤为有用。 LVM 的大部分命令和彼此都非常相似。每个可用的命令都由以下其中之一开头: -- Physical Volume = pv -- Volume Group = vg -- Logical Volume = lv +- Physical Volume (物理卷) = pv +- Volume Group (卷组)= vg +- Logical Volume (逻辑卷)= lv -物理卷命令用于在卷组中添加或删除硬盘驱动。卷组命令用于为你的逻辑卷操作更改显示的物理分区抽象集。逻辑卷命令会以分区形式显示卷组使得你的操作系统能使用指定的空间。 +物理卷命令用于在卷组中添加或删除硬盘驱动。卷组命令用于为你的逻辑卷操作更改显示的物理分区抽象集。逻辑卷命令会以分区形式显示卷组,使得你的操作系统能使用指定的空间。 ### 可下载的 LVM 备忘单 ### @@ -26,7 +26,7 @@ LVM 的大部分命令和彼此都非常相似。每个可用的命令都由以 ### 如何查看当前 LVM 信息 ### -你首先需要做的事情是检查你的 LVM 设置。s 和 display 命令和物理卷(pv)、卷组(vg)以及逻辑卷(lv)一起使用,是一个找出当前设置好的开始点。 +你首先需要做的事情是检查你的 LVM 设置。s 和 display 命令可以和物理卷(pv)、卷组(vg)以及逻辑卷(lv)一起使用,是一个找出当前设置的好起点。 display 命令会格式化输出信息,因此比 s 命令更易于理解。对每个命令你会看到名称和 pv/vg 的路径,它还会给出空闲和已使用空间的信息。 @@ -40,17 +40,17 @@ display 命令会格式化输出信息,因此比 s 命令更易于理解。对 #### 创建物理卷 #### -我们会从一个完全新的没有任何分区和信息的硬盘驱动开始。首先找出你将要使用的磁盘。(/dev/sda, sdb, 等) +我们会从一个全新的没有任何分区和信息的硬盘开始。首先找出你将要使用的磁盘。(/dev/sda, sdb, 等) > 注意:记住所有的命令都要以 root 身份运行或者在命令前面添加 'sudo' 。 fdisk -l -如果之前你的硬盘驱动从没有格式化或分区,在 fdisk 的输出中你很可能看到类似下面的信息。这完全正常,因为我们会在下面的步骤中创建需要的分区。 +如果之前你的硬盘从未格式化或分区过,在 fdisk 的输出中你很可能看到类似下面的信息。这完全正常,因为我们会在下面的步骤中创建需要的分区。 ![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/fdisk.png.pagespeed.ce.AmAEsxm-7Q.png) -我们的新磁盘位置是 /dev/sdb,让我们用 fdisk 命令在驱动上创建一个新的分区。 +我们的新磁盘位置是 /dev/sdb,让我们用 fdisk 命令在磁盘上创建一个新的分区。 这里有大量能创建新分区的 GUI 工具,包括 [Gparted][2],但由于我们已经打开了终端,我们将使用 fdisk 命令创建需要的分区。 @@ -62,9 +62,9 @@ display 命令会格式化输出信息,因此比 s 命令更易于理解。对 ![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/627x145xfdisk00.png.pagespeed.ic.I7S8bjoXQG.png) -以指定的顺序输入命令创建一个使用新硬盘驱动 100% 空间的主分区并为 LVM 做好了准备。如果你需要更改分区的大小或相应多个分区,我建议使用 GParted 或自己了解关于 fdisk 命令的使用。 +以指定的顺序输入命令创建一个使用新硬盘 100% 空间的主分区并为 LVM 做好了准备。如果你需要更改分区的大小或想要多个分区,我建议使用 GParted 或自己了解一下关于 fdisk 命令的使用。 -**警告:下面的步骤会格式化你的硬盘驱动。确保在进行下面步骤之前你的硬盘驱动中没有任何信息。** +**警告:下面的步骤会格式化你的硬盘驱动。确保在进行下面步骤之前你的硬盘驱动中没有任何有用的信息。** - n = 创建新分区 - p = 创建主分区 @@ -79,9 +79,9 @@ display 命令会格式化输出信息,因此比 s 命令更易于理解。对 - t = 更改分区类型 - 8e = 更改为 LVM 分区类型 -核实并将信息写入硬盘驱动器。 +核实并将信息写入硬盘。 -- p = 查看分区设置使得写入更改到磁盘之前可以回看 +- p = 查看分区设置使得在写入更改到磁盘之前可以回看 - w = 写入更改到磁盘 ![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/560x339xfdisk03.png.pagespeed.ic.FC8foICZsb.png) @@ -102,7 +102,7 @@ display 命令会格式化输出信息,因此比 s 命令更易于理解。对 ![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/vgcreate.png.pagespeed.ce.fVLzSmPZou.png) -Vgpool 是新创建的卷组的名称。你可以使用任何你喜欢的名称,但建议标签以 vg 开头,以便后面你使用它时能意识到这是一个卷组。 +vgpool 是新创建的卷组的名称。你可以使用任何你喜欢的名称,但建议标签以 vg 开头,以便后面你使用它时能意识到这是一个卷组。 #### 创建逻辑卷 #### @@ -112,7 +112,7 @@ Vgpool 是新创建的卷组的名称。你可以使用任何你喜欢的名称 ![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/lvcreate.png.pagespeed.ce.vupLB-LJEW.png) --L 命令指定逻辑卷的大小,在该情况中是 3 GB,-n 命令指定卷的名称。 指定 vgpool 所以 lvcreate 命令知道从什么卷获取空间。 +-L 命令指定逻辑卷的大小,在该情况中是 3 GB,-n 命令指定卷的名称。 指定 vgpool 以便 lvcreate 命令知道从什么卷获取空间。 #### 格式化并挂载逻辑卷 #### @@ -131,7 +131,7 @@ Vgpool 是新创建的卷组的名称。你可以使用任何你喜欢的名称 #### 重新设置逻辑卷大小 #### -逻辑卷的一个好处是你能使你的共享物理变大或变小而不需要移动所有东西到一个更大的硬盘驱动。另外,你可以添加新的硬盘驱动并同时扩展你的卷组。或者如果你有一个不使用的硬盘驱动,你可以从卷组中移除它使得逻辑卷变小。 +逻辑卷的一个好处是你能使你的存储物理地变大或变小,而不需要移动所有东西到一个更大的硬盘。另外,你可以添加新的硬盘并同时扩展你的卷组。或者如果你有一个不使用的硬盘,你可以从卷组中移除它使得逻辑卷变小。 这里有三个用于使物理卷、卷组和逻辑卷变大或变小的基础工具。 @@ -147,9 +147,9 @@ Vgpool 是新创建的卷组的名称。你可以使用任何你喜欢的名称 按照上面创建新分区并更改分区类型为 LVM(8e) 的步骤安装一个新硬盘驱动。然后用 pvcreate 命令创建一个 LVM 能识别的物理卷。 -#### 添加新硬盘驱动到卷组 #### +#### 添加新硬盘到卷组 #### -要添加新的硬盘驱动到一个卷组,你只需要知道你的新分区,在我们的例子中是 /dev/sdc1,以及想要添加到的卷组的名称。 +要添加新的硬盘到一个卷组,你只需要知道你的新分区,在我们的例子中是 /dev/sdc1,以及想要添加到的卷组的名称。 这会添加新物理卷到已存在的卷组中。 @@ -189,7 +189,7 @@ Vgpool 是新创建的卷组的名称。你可以使用任何你喜欢的名称 1. 调整文件系统大小 (调整之前确保已经移动文件到硬盘驱动安全的地方) 1. 减小逻辑卷 (除了 + 可以扩展大小,你也可以用 - 压缩大小) -1. 用 vgreduce 从卷组中移除硬盘驱动 +1. 用 vgreduce 从卷组中移除硬盘 #### 备份逻辑卷 #### @@ -197,7 +197,7 @@ Vgpool 是新创建的卷组的名称。你可以使用任何你喜欢的名称 ![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/652x202xbanner-2.png.pagespeed.ic.VtOUuqYX1W.png) -LVM 获取快照的时候,会有一张和逻辑卷完全相同的照片,该照片可以用于在不同的硬盘驱动上进行备份。生成一个备份的时候,任何需要添加到逻辑卷的新信息会如往常一样写入磁盘,但会跟踪更改使得原始快照永远不会损毁。 +LVM 获取快照的时候,会有一张和逻辑卷完全相同的“照片”,该“照片”可以用于在不同的硬盘上进行备份。生成一个备份的时候,任何需要添加到逻辑卷的新信息会如往常一样写入磁盘,但会跟踪更改使得原始快照永远不会损毁。 要创建一个快照,我们需要创建拥有足够空闲空间的逻辑卷,用于保存我们备份的时候会写入该逻辑卷的任何新信息。如果驱动并不是经常写入,你可以使用很小的一个存储空间。备份完成的时候我们只需要移除临时逻辑卷,原始逻辑卷会和往常一样。 @@ -209,7 +209,7 @@ LVM 获取快照的时候,会有一张和逻辑卷完全相同的照片,该 ![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/597x68xlvcreate-snapshot.png.pagespeed.ic.Rw2ivtcpPg.png) -这里我们创建了一个只有 512MB 的逻辑卷,因为驱动实际上并不会使用。512MB 的空间会保存备份时产生的任何新数据。 +这里我们创建了一个只有 512MB 的逻辑卷,因为该硬盘实际上并不会使用。512MB 的空间会保存备份时产生的任何新数据。 #### 挂载新快照 #### @@ -222,7 +222,7 @@ LVM 获取快照的时候,会有一张和逻辑卷完全相同的照片,该 #### 复制快照和删除逻辑卷 #### -你剩下需要做的是从 /mnt/lvstuffbackup/ 中复制所有文件到一个外部的硬盘驱动或者打包所有文件到一个文件。 +你剩下需要做的是从 /mnt/lvstuffbackup/ 中复制所有文件到一个外部的硬盘或者打包所有文件到一个文件。 **注意:tar -c 会创建一个归档文件,-f 要指出归档文件的名称和路径。要获取 tar 命令的帮助信息,可以在终端中输入 man tar。** @@ -230,7 +230,7 @@ LVM 获取快照的时候,会有一张和逻辑卷完全相同的照片,该 ![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/627x67xsnapshot-backup.png.pagespeed.ic.tw-2AK_lfZ.png) -记住备份发生的时候写到 lvstuff 的所有文件都会在我们之前创建的临时逻辑卷中被跟踪。确保备份的时候你有足够的空闲空间。 +记住备份时候写到 lvstuff 的所有文件都会在我们之前创建的临时逻辑卷中被跟踪。确保备份的时候你有足够的空闲空间。 备份完成后,卸载卷并移除临时快照。 @@ -259,10 +259,10 @@ LVM 获取快照的时候,会有一张和逻辑卷完全相同的照片,该 via: http://www.howtogeek.com/howto/40702/how-to-manage-and-use-lvm-logical-volume-management-in-ubuntu/ 译者:[ictlyh](https://github.com/ictlyh) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 -[1]:http://www.howtogeek.com/howto/36568/what-is-logical-volume-management-and-how-do-you-enable-it-in-ubuntu/ +[1]:https://linux.cn/article-5953-1.html [2]:http://www.howtogeek.com/howto/17001/how-to-format-a-usb-drive-in-ubuntu-using-gparted/ [3]:http://www.howtogeek.com/howto/33552/htg-explains-which-linux-file-system-should-you-choose/ \ No newline at end of file From 2d90d07755d4b8bcc6786007e1324fdb48f49f22 Mon Sep 17 00:00:00 2001 From: wxy Date: Wed, 5 Aug 2015 00:06:26 +0800 Subject: [PATCH 816/965] PUB:20150128 7 communities driving open source development @FSSlc --- ...unities driving open source development.md | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) rename {translated/talk => published}/20150128 7 communities driving open source development.md (58%) diff --git a/translated/talk/20150128 7 communities driving open source development.md b/published/20150128 7 communities driving open source development.md similarity index 58% rename from translated/talk/20150128 7 communities driving open source development.md rename to published/20150128 7 communities driving open source development.md index 2074ad9e23..1f4aac1a09 100644 --- a/translated/talk/20150128 7 communities driving open source development.md +++ b/published/20150128 7 communities driving open source development.md @@ -1,12 +1,12 @@ 7 个驱动开源发展的社区 ================================================================================ -不久前,开源模式还被成熟的工业厂商以怀疑的态度认作是叛逆小孩的玩物。如今,开放的倡议和基金会在一长列的供应商提供者的支持下正蓬勃发展,而他们将开源模式视作创新的关键。 +不久前,开源模式还被成熟的工业级厂商以怀疑的态度认作是叛逆小孩的玩物。如今,开源的促进会和基金会在一长列的供应商提供者的支持下正蓬勃发展,而他们将开源模式视作创新的关键。 ![](http://images.techhive.com/images/article/2015/01/0_opensource-title-100539095-orig.jpg) ### 技术的开放发展驱动着创新 ### -在过去的 20 几年间,技术的开放发展已被视作驱动创新的关键因素。即使那些以前将开源视作威胁的公司也开始接受这个观点 — 例如微软,如今它在一系列的开源倡议中表现活跃。到目前为止,大多数的开放发展都集中在软件方面,但甚至这个也正在改变,因为社区已经开始向开源硬件倡议方面聚拢。这里有 7 个成功地在硬件和软件方面同时促进和发展开源技术的组织。 +在过去的 20 几年间,技术的开源推进已被视作驱动创新的关键因素。即使那些以前将开源视作威胁的公司也开始接受这个观点 — 例如微软,如今它在一系列的开源的促进会中表现活跃。到目前为止,大多数的开源推进都集中在软件方面,但甚至这个也正在改变,因为社区已经开始向开源硬件倡议方面聚拢。这里介绍 7 个成功地在硬件和软件方面同时促进和发展开源技术的组织。 ### OpenPOWER 基金会 ### @@ -16,21 +16,21 @@ IBM 通过开放其基于 Power 架构的硬件和软件技术,向使用 Power IP 的独立硬件产品提供许可证等方式为基金会的建立播下种子。如今超过 70 个成员共同协作来为基于 Linux 的数据中心提供自定义的开放服务器,组件和硬件。 -今年四月,在比最新基于 x86 系统快 50 倍的数据分析能力的新的 POWER8 处理器的服务器的基础上, OpenPOWER 推出了一个技术路线图。七月, IBM 和 Google 发布了一个固件堆栈。十月见证了 NVIDIA GPU 带来加速 POWER8 系统的能力和来自 Tyan 的第一个 OpenPOWER 参考服务器。 +去年四月,在比最新基于 x86 系统快 50 倍的数据分析能力的新的 POWER8 处理器的服务器的基础上, OpenPOWER 推出了一个技术路线图。七月, IBM 和 Google 发布了一个固件堆栈。去年十月见证了 NVIDIA GPU 带来加速 POWER8 系统的能力和来自 Tyan 的第一个 OpenPOWER 参考服务器。 ### Linux 基金会 ### ![](http://images.techhive.com/images/article/2015/01/2_the-linux-foundation-100539101-orig.jpg) -于 2000 年建立的 [Linux 基金会][2] 如今成为掌控着历史上最大的开源协同发展成果,它有着超过 180 个合作成员和许多独立成员及学生成员。它赞助核心 Linux 开发者的工作并促进、保护和推进 Linux 操作系统和协作软件的开发。 +于 2000 年建立的 [Linux 基金会][2] 如今成为掌控着历史上最大的开源协同开发成果,它有着超过 180 个合作成员和许多独立成员及学生成员。它赞助 Linux 核心开发者的工作并促进、保护和推进 Linux 操作系统,并协调软件的协作开发。 -它最为成功的协作项目包括 Code Aurora Forum (一个拥有为移动无线产业服务的企业财团),MeeGo (一个为移动设备和 IVI (注:指的是车载消息娱乐设备,为 In-Vehicle Infotainment 的简称) 构建一个基于 Linux 内核的操作系统的项目) 和 Open Virtualization Alliance (开放虚拟化联盟,它促进自由和开源软件虚拟化解决方案的采用)。 +它最为成功的协作项目包括 Code Aurora Forum (一个拥有为移动无线产业服务的企业财团),MeeGo (一个为移动设备和 IVI [注:指的是车载消息娱乐设备,为 In-Vehicle Infotainment 的简称] 构建一个基于 Linux 内核的操作系统的项目) 和 Open Virtualization Alliance (开放虚拟化联盟,它促进自由和开源软件虚拟化解决方案的采用)。 ### 开放虚拟化联盟 ### ![](http://images.techhive.com/images/article/2015/01/3_open-virtualization-alliance-100539102-orig.jpg) -[开放虚拟化联盟(OVA)][3] 的存在目的为:通过提供使用案例和对具有互操作性的通用接口和 API 的发展提供支持,来促进自由、开源软件的虚拟化解决方案例如 KVM 的采用。KVM 将 Linux 内核转变为一个虚拟机管理程序。 +[开放虚拟化联盟(OVA)][3] 的存在目的为:通过提供使用案例和对具有互操作性的通用接口和 API 的发展提供支持,来促进自由、开源软件的虚拟化解决方案,例如 KVM 的采用。KVM 将 Linux 内核转变为一个虚拟机管理程序。 如今, KVM 已成为和 OpenStack 共同使用的最为常见的虚拟机管理程序。 @@ -40,31 +40,31 @@ IBM 通过开放其基于 Power 架构的硬件和软件技术,向使用 Power 原本作为一个 IaaS(基础设施即服务) 产品由 NASA 和 Rackspace 于 2010 年启动,[OpenStack 基金会][4] 已成为最大的开源项目聚居地之一。它拥有超过 200 家公司成员,其中包括 AT&T, AMD, Avaya, Canonical, Cisco, Dell 和 HP。 -大约以 6 个月为一个发行周期,基金会的 OpenStack 项目被发展用来通过一个基于 Web 的仪表盘,命令行工具或一个 RESTful 风格的 API 来控制或调配流经一个数据中心的处理存储池和网络资源。至今为止,基金会支持的协作发展已经孕育出了一系列 OpenStack 组件,其中包括 OpenStack Compute(一个云计算网络控制器,它是一个 IaaS 系统的主要部分),OpenStack Networking(一个用以管理网络和 IP 地址的系统) 和 OpenStack Object Storage(一个可扩展的冗余存储系统)。 +大约以 6 个月为一个发行周期,基金会的 OpenStack 项目开发用于通过一个基于 Web 的仪表盘,命令行工具或一个 RESTful 风格的 API 来控制或调配流经一个数据中心的处理存储池和网络资源。至今为止,基金会支持的协同开发已经孕育出了一系列 OpenStack 组件,其中包括 OpenStack Compute(一个云计算网络控制器,它是一个 IaaS 系统的主要部分),OpenStack Networking(一个用以管理网络和 IP 地址的系统) 和 OpenStack Object Storage(一个可扩展的冗余存储系统)。 ### OpenDaylight ### ![](http://images.techhive.com/images/article/2015/01/5_opendaylight-100539097-orig.jpg) -作为来自 Linux 基金会的另一个协作项目, [OpenDaylight][5] 是一个由诸如 Dell, HP, Oracle 和 Avaya 等行业厂商于 2013 年 4 月建立的联合倡议。它的任务是建立一个由社区主导,开放,有工业支持的针对 Software-Defined Networking (SDN) 的包含代码和蓝图的框架。其思路是提供一个可直接部署的全功能 SDN 平台,而不需要其他组件,供应商可提供附件组件和增强组件。 +作为来自 Linux 基金会的另一个协作项目, [OpenDaylight][5] 是一个由诸如 Dell, HP, Oracle 和 Avaya 等行业厂商于 2013 年 4 月建立的联合倡议。它的任务是建立一个由社区主导、开源、有工业支持的针对软件定义网络( SDN: Software-Defined Networking)的包含代码和蓝图的框架。其思路是提供一个可直接部署的全功能 SDN 平台,而不需要其他组件,供应商可提供附件组件和增强组件。 ### Apache 软件基金会 ### ![](http://images.techhive.com/images/article/2015/01/6_apache-software-foundation-100539098-orig.jpg) -[Apache 软件基金会 (ASF)][7] 是将近 150 个顶级项目的聚居地,这些项目涵盖从开源企业级自动化软件到与 Apache Hadoop 相关的分布式计算的整个生态系统。这些项目分发企业级、可免费获取的软件产品,而 Apache 协议则是为了让无论是商业用户还是个人用户更方便地部署 Apache 的产品。 +[Apache 软件基金会 (ASF)][7] 是将近 150 个顶级项目的聚居地,这些项目涵盖从开源的企业级自动化软件到与 Apache Hadoop 相关的分布式计算的整个生态系统。这些项目分发企业级、可免费获取的软件产品,而 Apache 协议则是为了让无论是商业用户还是个人用户更方便地部署 Apache 的产品。 -ASF 于 1999 年作为一个会员制,非盈利公司注册,其核心为精英 — 要成为它的成员,你必须首先在基金会的一个或多个协作项目中做出积极贡献。 +ASF 是 1999 年成立的一个会员制,非盈利公司,以精英为其核心 — 要成为它的成员,你必须首先在基金会的一个或多个协作项目中做出积极贡献。 ### 开放计算项目 ### ![](http://images.techhive.com/images/article/2015/01/7_open-compute-project-100539099-orig.jpg) -作为 Facebook 重新设计其 Oregon 数据中心的副产物, [开放计算项目][7] 旨在发展针对数据中心的开放硬件解决方案。 OCP 是一个由廉价、无浪费的服务器,针对 Open Rack(为数据中心设计的机架标准,来让机架集成到数据中心的基础设施中) 的模块化 I/O 存储和一个相对 "绿色" 的数据中心设计方案等构成。 +作为 Facebook 重新设计其 Oregon 数据中心的副产物, [开放计算项目][7] 旨在发展针对数据中心的开源硬件解决方案。 OCP 是一个由廉价无浪费的服务器、针对 Open Rack(为数据中心设计的机架标准,来让机架集成到数据中心的基础设施中) 的模块化 I/O 存储和一个相对 "绿色" 的数据中心设计方案等构成。 OCP 董事会成员包括来自 Facebook,Intel,Goldman Sachs,Rackspace 和 Microsoft 的代表。 -OCP 最近宣布了许可证的两个选择: 一个类似 Apache 2.0 的允许衍生工作的许可证和一个更规范的鼓励回滚到原有软件的更改的许可证。 +OCP 最近宣布了有两种可选的许可证: 一个类似 Apache 2.0 的允许衍生工作的许可证,和一个更规范的鼓励将更改回馈到原有软件的许可证。 -------------------------------------------------------------------------------- @@ -72,7 +72,7 @@ via: http://www.networkworld.com/article/2866074/opensource-subnet/7-communities 作者:[Thor Olavsrud][a] 译者:[FSSlc](https://github.com/FSSlc) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 From 77b1de1f10b9e5d07426da4163dd6b57197078ee Mon Sep 17 00:00:00 2001 From: joeren Date: Wed, 5 Aug 2015 07:42:36 +0800 Subject: [PATCH 817/965] Update 20150318 How to Use LVM on Ubuntu for Easy Partition Resizing and Snapshots.md --- ...LVM on Ubuntu for Easy Partition Resizing and Snapshots.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20150318 How to Use LVM on Ubuntu for Easy Partition Resizing and Snapshots.md b/sources/tech/20150318 How to Use LVM on Ubuntu for Easy Partition Resizing and Snapshots.md index 883c5e3203..2cb09193b6 100644 --- a/sources/tech/20150318 How to Use LVM on Ubuntu for Easy Partition Resizing and Snapshots.md +++ b/sources/tech/20150318 How to Use LVM on Ubuntu for Easy Partition Resizing and Snapshots.md @@ -1,4 +1,4 @@ - +Translating by GOLinux! How to Use LVM on Ubuntu for Easy Partition Resizing and Snapshots ================================================================================ ![](http://cdn5.howtogeek.com/wp-content/uploads/2015/03/ximg_55035707bbd74.png.pagespeed.ic.9_yebxUF1C.png) @@ -65,4 +65,4 @@ via: http://www.howtogeek.com/211937/how-to-use-lvm-on-ubuntu-for-easy-partition [3]:http://www.howtogeek.com/114503/how-to-resize-your-ubuntu-partitions/ [4]:http://www.howtogeek.com/howto/40702/how-to-manage-and-use-lvm-logical-volume-management-in-ubuntu/ [5]:http://www.howtogeek.com/howto/40702/how-to-manage-and-use-lvm-logical-volume-management-in-ubuntu/ -[6]:http://www.howtogeek.com/howto/40702/how-to-manage-and-use-lvm-logical-volume-management-in-ubuntu/ \ No newline at end of file +[6]:http://www.howtogeek.com/howto/40702/how-to-manage-and-use-lvm-logical-volume-management-in-ubuntu/ From d8b9908e0f63f78c4156bedc13c45698bd21f205 Mon Sep 17 00:00:00 2001 From: XLCYun Date: Wed, 5 Aug 2015 08:29:58 +0800 Subject: [PATCH 818/965] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=8E=9F=E6=96=87=20?= =?UTF-8?q?=20XLCYun?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...Right & Wrong - Page 4 - GNOME Settings.md | 52 ------------------- 1 file changed, 52 deletions(-) delete mode 100644 sources/tech/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 4 - GNOME Settings.md diff --git a/sources/tech/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 4 - GNOME Settings.md b/sources/tech/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 4 - GNOME Settings.md deleted file mode 100644 index bf233ce5d3..0000000000 --- a/sources/tech/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 4 - GNOME Settings.md +++ /dev/null @@ -1,52 +0,0 @@ -Translating by XLCYun. -A Week With GNOME As My Linux Desktop: What They Get Right & Wrong - Page 4 - GNOME Settings -================================================================================ -### Settings ### - -There are a few specific KDE Control modules that I am going to pick at, mostly because they are so laughable horrible compared to their gnome counter-part that its honestly pathetic. - -First one up? Printers. - -![](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_printers1_show&w=1920) - -Gnome is on the left, KDE is on the right. You know what the difference is between the printer applet on the left, and the one on the right? When I opened up Gnome Control Center and hit "Printers" the applet popped up and nothing happened. When I opened up KDE System Settings and hit "Printers" I got a password prompt. Before I was even allowed to LOOK at the printers I had to give up ROOT'S password. - -Let me just re-iterate that. In this, the days of PolicyKit and Logind, I am still being asked for Root's password for what should be a sudo operation. I didn't even SETUP root's password when I installed the system. I had to drop down to Konsole and run 'sudo passwd root' so that I could GIVE root a password so that I could go back into System Setting's printer applet and then give up root's password to even LOOK at what printers were available. Once I did that I got prompted for root's password AGAIN when I hit "Add Printer" then I got prompted for root's password AGAIN after I went through and selected a printer and driver. Three times I got asked for ROOT'S password just to add a printer to the system. - -When I added a printer under Gnome I didn't get prompted for my SUDO password until I hit "Unlock" in the printer applet. I got asked once, then I never got asked again. KDE, I am begging you... Adopt Gnome's "Unlock" methodology. Do not prompt for a password until you really need one. Furthermore, whatever library is out there that allows for KDE applications to bypass PolicyKit / Logind (if its available) and prompt directly for root... Bin that code. If this was a multi-user system I either have to give up root's password, or be there every second of every day in order to put it in any time a user might have to update, change, or add a new printer. Both options are completely unacceptable. - -One more thing... - -![](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_printers2_show&w=1920) - -![](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_printers3_show&w=1920) - -Question to the forums: What looks cleaner to you? I had this realization when I was writing this article: Gnome's applet makes it very clear where any additional printers are going to go, they set aside a column on the left to list them. Before I added a second printer to KDE, and it suddenly grew a left side column, I had this nightmare-image in my head of the applet just shoving another icon into the screen and them being listed out like preview images in a folder of pictures. I was pleasantly surprised to see that I was wrong but the fact that the applet just 'grew' another column that didn't exist before and drastically altered its presentation is not really 'good' either. It's a design that's confusing, shocking, and non-intuitive. - -Enough about printers though... Next KDE System Setting that is up for my public stoning? Multimedia, Aka Phonon. - -![](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_sound_show&w=1920) - -As always, Gnome's on the left, KDE is on the right. Let's just run through the Gnome setting first... The eyes go left to right, top to bottom, right? So let's do the same. First up: volume control slider. The blue hint against the empty bar with 100% clearly marked removes all confusion about which way is "volume up." Immediately after the slider is an easy On/Off toggle that functions a mute on/off. Points to Gnome for remembering what the volume was set to BEFORE I muted sound, and returning to that same level AFTER I press volume-up to un-mute. Kmixer, you amnesiac piece of crap, I wish I could say as much about you. - -Moving on! Tabbed options for Output, Input and Applications? With per application volume controls within easy reach? Gnome I love you more and more with every passing second. Balance options, sound profiles, and a clearly marked "Test Speakers" option. - -I'm not sure how this could have been implemented in a cleaner, more concise way. Yes, it's just a Gnome-ized Pavucontrol but I think that's the point. Pavucontrol got it mostly right to begin with, the Sound applet in Gnome Control Center just refines it slightly to make it even closer to perfect. - -Phonon, you're up. And let me start by saying: What the fsck am I looking at? -I- get that I am looking at the priority list for the audio devices on the system, but the way it is presented is a bit of a nightmare. Also where are the things the user probably cares about? A priority list is a great thing to have, it SHOULD be available, but it's something the user messes with once or twice and then never touches again. It's not important, or common, enough to warrant being front and center. Where's the volume slider? Where's per application controls? The things that users will be using more frequently? Well.. those are under Kmix, a separate program, with its own settings and configuration... not under the System Settings... which kind of makes System Settings a bit of a misnomer. And in that same vein, Let's hop over to network settings. - -![](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_network_show&w=1920) - -Presented above is the Gnome Network Settings. KDE's isn't included because of the reason I'm about to hit on. If you go to KDE's System Settings and hit any of the three options under the "Network" Section you get tons of options: Bluetooth settings, default username and password for Samba shares (Seriously, "Connectivity" only has 2 options: Username and password for SMB shares. How the fsck does THAT deserve the all-inclusive title "Connectivity"?), controls for Browser Identification (which only work for Konqueror...a dead project), proxy settings, etc... Where's my wifi settings? They aren't there. Where are they? Well, they are in the network applet's private settings... not under Network Settings... - -KDE, you're killing me. You have "System Settings" USE IT! - --------------------------------------------------------------------------------- - -via: http://www.phoronix.com/scan.php?page=article&item=gnome-week-editorial&num=4 - -作者:Eric Griffith -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 67e1d8db380b6fdbd959f30e473853725945904c Mon Sep 17 00:00:00 2001 From: XLCYun Date: Wed, 5 Aug 2015 08:36:39 +0800 Subject: [PATCH 819/965] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E5=AE=8C=E6=88=90=20?= =?UTF-8?q?=E7=AC=AC=E5=9B=9B=E8=8A=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...Right & Wrong - Page 4 - GNOME Settings.md | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 translated/tech/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 4 - GNOME Settings.md diff --git a/translated/tech/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 4 - GNOME Settings.md b/translated/tech/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 4 - GNOME Settings.md new file mode 100644 index 0000000000..1c0cc4bd86 --- /dev/null +++ b/translated/tech/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 4 - GNOME Settings.md @@ -0,0 +1,54 @@ +将GNOME作为我的Linux桌面的一周: 他们做对的与做错的 - 第四节 - GNOME设置 +================================================================================ +### Settings设置 ### + +在这我要挑一挑几个特定KDE控制模块的毛病,大部分原因是因为相比它们的对手GNOME来说,糟糕得太可笑,实话说,真是悲哀。 + +第一个接招的?打印机。 + +![](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_printers1_show&w=1920) + +GNOME在左,KDE在右。你知道左边跟右边的打印程序有什么区别吗?当我在GNOME控制中心打开“打印机”时,程序窗口弹出来了,之后没有也没发生。而当我在KDE系统设置打开“打印机”时,我收到了一条密码提示。甚至我都没能看一眼打印机呢,我就必须先交出ROOT密码。 + +让我再重复一遍。在今天,PolicyKit和Logind的日子里,对一个应该是sudo的操作,我依然被询问要求ROOT的密码。我安装系统的时候甚至都没设置root密码。所以我必须跑到Konsole去,然后运行'sudo passwd root'命令,这样我才能给root设一个密码,这样我才能回到系统设置中的打印程序,然后交出root密码,然后仅仅是看一看哪些打印机可用。完成了这些工作后,当我点击“添加打印机”时,我再次收到请求ROOT密码的提示,当我解决了它后再选择一个打印机和驱动时,我再次收到请求ROOT密码的提示。仅仅是为了添加一个打印机到系统我就收到三次密码请求。 + +而在GNOME下添加打印机,在点击打印机程序中的”解锁“之前,我没有收到任何请求SUDO密码的提示。整个过程我只被请求过一次,仅此而已。KDE,求你了……采用GNOME的”解锁“模式吧。不到一定需要的时候不要发出提示。还有,不管是哪个库,只要它允许KDE应用程序绕过PolicyKit/Logind(如果有的话)并直接请求ROOT权限……那就把它封进箱里吧。如果这是个多用户系统,那我要么必须交出ROOT密码,要么我必须时时刻刻呆着以免有一个用户需要升级、更改或添加一个新的打印机。而这两种情况都是完全无法接受的。 + +有还一件事…… + +![](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_printers2_show&w=1920) + +![](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_printers3_show&w=1920) + +给论坛的问题:怎么样看起来更简洁?我在写这篇文章时意识到:当有任何的附加打印机准备好时,Gnome打印机程序会把过程做得非常简洁,它们在左边上放了一个竖直栏来列出这些打印机。而我在KDE添加第二台打印机时,它突然增加出一个左边栏来。而在添加之前,我脑海中已经有了一个恐怖的画面它会像图片文件夹显示预览图一样,直接插入另外一个图标到界面里去。我很高兴也很惊讶的看到我是错的。但是事实是它直接”长出”另外一个从末存在的竖直栏,彻底改变了它的界面布局,而这样也称不上“好”。终究还是一种令人困惑,奇怪而又不直观的设计。 + +打印机说得够多了……下一个接受我公开石刑的KDE系统设置是?多媒体,即Phonon。 + +![](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_sound_show&w=1920) + +一如既往,GNOME在左边,KDE在右边。让我们先看看GNOME的系统设置先……眼睛从左到右,从上到下,对吧?来吧,就这样做。首先:音量控制滑条。滑条中的蓝色条与空白条百分百清晰地消除了哪边是“音量增加”的困惑。在音量控制条后马上就是一个On/Off开关,用来开关静音功能。Gnome的再次得分在于静音后能记住当前设置的音量,而在点击音量增加按钮取消静音后能回到原来设置的音量中来。Kmixer,你个健忘的垃圾,我真的希望我能多讨论你。 + + +继续!输入输出和应用程序的标签选项?每一个应用程序的音量随时可控?Gnome,每过一秒,我爱你越深。均衡的选项设置,声音配置,和清晰地标上标志的“测试麦克风”选项。 + + + +我不清楚它能否以一种更干净更简洁的设计实现。是的,它只是一个Gnome化的Pavucontrol,但我想这就是重要的地方。Pavucontrol在这方面几乎完全做对了,Gnome控制中心中的“声音”应用程序的改善使它向完美更进了一步。 + +Phonon,该你上了。但开始前我想说:我TM看到的是什么?我知道我看到的是音频设备的权限列表,但是它呈现的方式有点太坑。还有,那些用户可能关心的那些东西哪去了?拥有一个权限列表当然很好,它也应该存在,但问题是权限列表属于那种用户乱搞一两次之后就不会再碰的东西。它还不够重要,或者说常用到可以直接放在正中间位置的程度。音量控制滑块呢?对每个应用程序的音量控制功能呢?那些用户使用最频繁的东西呢?好吧,它们在Kmix中,一个分离的程序,拥有它自己的配置选项……而不是在系统设置下……这样真的让“系统设置”这个词变得有点用词不当。 + +![](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_network_show&w=1920) + +上面展示的Gnome的网络设置。KDE的没有展示,原因就是我接下来要吐槽的内容了。如果你进入KDE的系统设置里,然后点击“网络”区域中三个选项中的任何一个,你会得到一大堆的选项:蓝牙设置,Samba分享的默认用户名和密码(说真的,“连通性(Connectivity)”下面只有两个选项:SMB的用户名和密码。TMD怎么就配得上“连通性”这么大的词?),浏览器身份验证控制(只有Konqueror能用……一个已经倒闭的项目),代理设置,等等……我的wifi设置哪去了?它们没在这。哪去了?好吧,它们在网络应用程序的设置里面……而不是在网络设置里…… + +KDE,你这是要杀了我啊,你有“系统设置”当凶器,拿着它动手吧! + +-------------------------------------------------------------------------------- + +via: http://www.phoronix.com/scan.php?page=article&item=gnome-week-editorial&num=4 + +作者:Eric Griffith +译者:[XLCYun](https://github.com/XLCYun) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From e9411c42a3eeead7b498a8950f1625bcbb326c5b Mon Sep 17 00:00:00 2001 From: joeren Date: Wed, 5 Aug 2015 09:04:29 +0800 Subject: [PATCH 820/965] [Translated]201150318How to Use LVM on Ubuntu for Easy Partition Resizing and Snapshots.md --- ...r Easy Partition Resizing and Snapshots.md | 68 ------------------- ...r Easy Partition Resizing and Snapshots.md | 67 ++++++++++++++++++ 2 files changed, 67 insertions(+), 68 deletions(-) delete mode 100644 sources/tech/20150318 How to Use LVM on Ubuntu for Easy Partition Resizing and Snapshots.md create mode 100644 translated/tech/20150318 How to Use LVM on Ubuntu for Easy Partition Resizing and Snapshots.md diff --git a/sources/tech/20150318 How to Use LVM on Ubuntu for Easy Partition Resizing and Snapshots.md b/sources/tech/20150318 How to Use LVM on Ubuntu for Easy Partition Resizing and Snapshots.md deleted file mode 100644 index 2cb09193b6..0000000000 --- a/sources/tech/20150318 How to Use LVM on Ubuntu for Easy Partition Resizing and Snapshots.md +++ /dev/null @@ -1,68 +0,0 @@ -Translating by GOLinux! -How to Use LVM on Ubuntu for Easy Partition Resizing and Snapshots -================================================================================ -![](http://cdn5.howtogeek.com/wp-content/uploads/2015/03/ximg_55035707bbd74.png.pagespeed.ic.9_yebxUF1C.png) - -Ubuntu’s installer offers an easy “Use LVM” checkbox. The description says it enables Logical Volume Management so you can take snapshots and more easily resize your hard disk partitions — here’s how to do that. - -LVM is a technology that’s similar to [RAID arrays][1] or [Storage Spaces on Windows][2] in some ways. While this technology is particularly useful on servers, it can be used on desktop PCs, too. - -### Should You Use LVM With Your New Ubuntu Installation? ### - -The first question is whether you even want to use LVM with your Ubuntu installation. Ubuntu makes this easy to enable with a quick click, but this option isn’t enabled by default. As the installer says, this allows you to resize partitions, create snapshots, merge multiple disks into a single logical volume, and so on — all while the system is running. Unlike with typical partitions, you don’t have to shut down your system, boot from a live CD or USB drive, and [resize your partitions while they aren’t in use][3]. - -To be perfectly honest, the average Ubuntu desktop user probably won’t realize whether they’re using LVM or not. But, if you want to do more advanced things later, LVM can help. LVM is potentially more complex, which could cause problems if you need to recover your data later — especially if you’re not that experienced with it. There shouldn’t be a noticeable performance penalty here — LVM is implemented right down in the Linux kernel. - -![](http://cdn5.howtogeek.com/wp-content/uploads/2015/03/ximg_55035cbada6ae.png.pagespeed.ic.cnqyiKfCvi.png) - -### Logical Volume Management Explained ### - -We’re previously [explained what LVM is][4]. In a nutshell, it provides a layer of abstraction between your physical disks and the partitions presented to your operating system. For example, your computer might have two hard drives inside it, each 1 TB in size. You’d have to have at least two partitions on these disks, and each of these partitions would be 1 TB in size. - -LVM provides a layer of abstraction over this. Instead of the traditional partition on a disk, LVM would treat the disks as two separate “physical volumes” after you initialize them. You could then create “logical volumes” based on these physical volumes. For example, you could combine those two 1 TB disks into a single 2 TB partition. Your operating system would just see a 2 TB volume, and LVM would deal with everything in the background. A group of physical volumes and logical volumes is known as a “volume group.” A typical system will just have a single volume group. - -This layer of abstraction makes it possibly to easily resize partitions, combine multiple disks into a single volume, and even take “snapshots” of a partition’s file system while it’s running, all without unmounting it. - -Note that merging multiple disks into a single volume can be a bad idea if you’re not creating backups. It’s like with RAID 0 — if you combine two 1 TB volumes into a single 2 TB volume, you could lose important data on the volume if just one of your hard disks fails. Backups are crucial if you go this route. - -### Graphical Utilities for Managing Your LVM Volumes ### - -Traditionally, [LVM volumes are managed with Linux terminal commands][5].These will work for you on Ubuntu, but there’s an easier, graphical method anyone can take advantage of. If you’re a Linux user used to using GParted or a similar partition manager, don’t bother — GParted doesn’t have support for LVM disks. - -Instead, you can use the Disks utility included along with Ubuntu for this. This utility is also known as GNOME Disk Utility, or Palimpsest. Launch it by clicking the icon on the dash, searching for Disks, and pressing Enter. Unlike GParted, the Disks utility will display your LVM partitions under “Other Devices,” so you can format them and adjust other options if you need to. This utility will also work from a live CD or USB drive, too. - -![](http://cdn5.howtogeek.com/wp-content/uploads/2015/03/ximg_550361b3772f7.png.pagespeed.ic.nZWwLJUywR.png) - -Unfortunately, the Disks utility doesn’t include support for taking advantage of LVM’s most powerful features. There’s no options for managing your volume groups, extending partitions, or taking snapshots. You could do that from the terminal, but you don’t have to. Instead, you can open the Ubuntu Software Center, search for LVM, and install the Logical Volume Management tool. You could also just run the **sudo apt-get install system-config-lvm** command in a terminal window. After it’s installed, you can open the Logical Volume Management utility from the dash. - -This graphical configuration tool was made by Red Hat. It’s a bit dated, but it’s the only graphical way to do this stuff without resorting to terminal commands. - -Let’s say you wanted to add a new physical volume to your volume group. You’d open the tool, select the new disk under Uninitialized Entries, and click the “Initialize Entry” button. You’d then find the new physical volume under Unallocated Volumes, and you could use the “Add to existing Volume Group” button to add it to the “ubuntu-vg” volume group Ubuntu created during the installation process. - -![](http://cdn5.howtogeek.com/wp-content/uploads/2015/03/ximg_550363106789c.png.pagespeed.ic.drVInt3Weq.png) - -The volume group view shows you a visual overview of your physical volumes and logical volumes. Here, we have two physical partitions across two separate hard drives. We have a swap partition and a root partition, just as Ubuntu sets up its partitioning scheme by default. Because we’ve added a second physical partition from another drive, there’s now a good chunk of unused space. - -![](http://cdn5.howtogeek.com/wp-content/uploads/2015/03/ximg_550363f631c19.png.pagespeed.ic.54E_Owcq8y.png) - -To expand a logical partition into the physical space, you could select it under Logical View, click Edit Properties, and modify the size to grow the partition. You could also shrink it from here. - -![](http://cdn5.howtogeek.com/wp-content/uploads/2015/03/ximg_55036893712d3.png.pagespeed.ic.ce7y_Mt0uF.png) - -The other options in system-config-lvm allow you to set up snapshots and mirroring. You probably won’t need these features on a typical desktop, but they’re available graphically here. Remember, you can also [do all of this with terminal commands][6]. - --------------------------------------------------------------------------------- - -via: http://www.howtogeek.com/211937/how-to-use-lvm-on-ubuntu-for-easy-partition-resizing-and-snapshots/ - -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[1]:http://www.howtogeek.com/162676/how-to-use-multiple-disks-intelligently-an-introduction-to-raid/ -[2]:http://www.howtogeek.com/109380/how-to-use-windows-8s-storage-spaces-to-mirror-combine-drives/ -[3]:http://www.howtogeek.com/114503/how-to-resize-your-ubuntu-partitions/ -[4]:http://www.howtogeek.com/howto/40702/how-to-manage-and-use-lvm-logical-volume-management-in-ubuntu/ -[5]:http://www.howtogeek.com/howto/40702/how-to-manage-and-use-lvm-logical-volume-management-in-ubuntu/ -[6]:http://www.howtogeek.com/howto/40702/how-to-manage-and-use-lvm-logical-volume-management-in-ubuntu/ diff --git a/translated/tech/20150318 How to Use LVM on Ubuntu for Easy Partition Resizing and Snapshots.md b/translated/tech/20150318 How to Use LVM on Ubuntu for Easy Partition Resizing and Snapshots.md new file mode 100644 index 0000000000..2e66e27f31 --- /dev/null +++ b/translated/tech/20150318 How to Use LVM on Ubuntu for Easy Partition Resizing and Snapshots.md @@ -0,0 +1,67 @@ +Ubuntu上使用LVM轻松调整分区并制作快照 +================================================================================ +![](http://cdn5.howtogeek.com/wp-content/uploads/2015/03/ximg_55035707bbd74.png.pagespeed.ic.9_yebxUF1C.png) + +Ubuntu的安装器提供了一个轻松“使用LVM”的复选框。说明中说,它启用了逻辑卷管理,因此你可以制作快照,并更容易地调整硬盘分区大小——这里将为大家讲述如何完成这些操作。 + +LVM是一种技术,某种程度上和[RAID阵列][1]或[Windows上的存储空间][2]类似。虽然该技术在服务器上更为有用,但是它也可以在桌面端PC上使用。 + +### 你应该在新安装Ubuntu时使用LVM吗? ### + +第一个问题是,你是否想要在安装Ubuntu时使用LVM?如果是,那么Ubuntu让这一切变得很简单,只需要轻点鼠标就可以完成,但是该选项默认是不启用的。正如安装器所说的,它允许你调整分区、创建快照、合并多个磁盘到一个逻辑卷等等——所有这一切都可以在系统运行时完成。不同于传统分区,你不需要关掉你的系统,从Live CD或USB驱动,然后[调整这些不使用的分区][3]。 + +完全坦率地说,普通Ubuntu桌面用户可能不会意识到他们是否正在使用LVM。但是,如果你想要在今后做一些更高深的事情,那么LVM就会有所帮助了。LVM可能更复杂,可能会在你今后恢复数据时会导致问题——尤其是在你经验不足时。这里不会有显著的性能损失——LVM是彻底地在Linux内核中实现的。 + +![](http://cdn5.howtogeek.com/wp-content/uploads/2015/03/ximg_55035cbada6ae.png.pagespeed.ic.cnqyiKfCvi.png) + +### 逻辑卷管理说明 ### + +前面,我们已经[说明了何谓LVM][4]。概括来讲,它在你的物理磁盘和呈现在你系统中的分区之间提供了一个抽象层。例如,你的计算机可能装有两个硬盘驱动器,它们的大小都是 1 TB。你必须得在这些磁盘上至少分两个区,每个区大小 1 TB。 + +LVM就在这些分区上提供了一个抽象层。用于取代磁盘上的传统分区,LVM将在你对这些磁盘初始化后,将它们当作独立的“物理卷”来对待。然后,你就可以基于这些物理卷创建“逻辑卷”。例如,你可以将这两个 1 TB 的磁盘组合成一个 2 TB 的分区,你的系统将只看到一个 2 TB 的卷,而LVM将会在后台处理这一切。一组物理卷以及一组逻辑卷被称之为“卷组”,一个标准的系统只会有一个卷组。 + +该抽象层使得调整分区、将多个磁盘组合成单个卷、甚至为一个运行着的分区的文件系统创建“快照”变得十分简单,而完成所有这一切都无需先卸载分区。 + +注意,如果你没有创建备份,那么将多个磁盘合并成一个卷将会是个糟糕的想法。它就像RAID 0——如果你将两个 1 TB 的卷组合成一个 2 TB 的卷,只要其中一个硬盘失败,你将丢失该卷上的重要数据。所以,如果你要走这条路,那么备份就及其重要。 + +### 管理LVM卷的图形化工具 ### + +通常,[LVM通过Linux终端命令来管理][5]。这在Ubuntu上也行得通,但是有个更简单的图形化方法可供大家采用。如果你是一个Linux用户,对GParted或者与其类似的分区管理器熟悉,算了,别瞎掰了——GParted根本不支持LVM磁盘。 + +然而,你可以使用Ubuntu附带的磁盘工具。该工具也被称之为GNOME磁盘工具,或者叫Palimpsest。点击停靠盘上的图标来开启它吧,搜索磁盘然后敲击回车。不像GParted,该磁盘工具将会在“其它设备”下显示LVM分区,因此你可以根据需要格式化这些分区,也可以调整其它选项。该工具在Live CD或USB 驱动下也可以使用。 + +![](http://cdn5.howtogeek.com/wp-content/uploads/2015/03/ximg_550361b3772f7.png.pagespeed.ic.nZWwLJUywR.png) + +不幸的是,该磁盘工具不支持LVM的大多数强大的特性,没有管理卷组、扩展分区,或者创建快照等选项。对于这些操作,你可以通过终端来实现,但是你没有那个必要。相反,你可以打开Ubuntu软件中心,搜索关键字LVM,然后安装逻辑卷管理工具,你可以在终端窗口中运行**sudo apt-get install system-config-lvm**命令来安装它。安装完之后,你就可以从停靠盘上打开逻辑卷管理工具了。 + +这个图形化配置工具是由红帽公司开发的,虽然有点陈旧了,但却是唯一的图形化方式,你可以通过它来完成上述操作,将那些终端命令抛诸脑后了。 + +比如说,你想要添加一个新的物理卷到卷组中。你可以打开该工具,选择未初始化条目下的新磁盘,然后点击“初始化条目”按钮。然后,你就可以在未分配卷下找到新的物理卷了,你可以使用“添加到现存卷组”按钮来将它添加到“ubuntu-vg”卷组,这是Ubuntu在安装过程中创建的卷组。 + +![](http://cdn5.howtogeek.com/wp-content/uploads/2015/03/ximg_550363106789c.png.pagespeed.ic.drVInt3Weq.png) + +卷组视图会列出你所有物理卷和逻辑卷的总览。这里,我们有两个横跨两个独立硬盘驱动器的物理分区,我们有一个交换分区和一个根分区,就像Ubuntu默认设置的分区图表。由于我们从另一个驱动器添加了第二个物理分区,现在那里有大量未使用空间。 + +![](http://cdn5.howtogeek.com/wp-content/uploads/2015/03/ximg_550363f631c19.png.pagespeed.ic.54E_Owcq8y.png) + +要扩展逻辑分区到物理空间,你可以在逻辑视图下选择它,点击编辑属性,然后修改大小来扩大分区。你也可以在这里缩减分区。 + +![](http://cdn5.howtogeek.com/wp-content/uploads/2015/03/ximg_55036893712d3.png.pagespeed.ic.ce7y_Mt0uF.png) + +system-config-lvm的其它选项允许你设置快照和镜像。对于传统桌面而言,你或许不需要这些特性,但是在这里也可以通过图形化处理。记住,你也可以[使用终端命令完成这一切][6]。 + +-------------------------------------------------------------------------------- + +via: http://www.howtogeek.com/211937/how-to-use-lvm-on-ubuntu-for-easy-partition-resizing-and-snapshots/ + +译者:[GOLinux](https://github.com/GOLinux) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[1]:http://www.howtogeek.com/162676/how-to-use-multiple-disks-intelligently-an-introduction-to-raid/ +[2]:http://www.howtogeek.com/109380/how-to-use-windows-8s-storage-spaces-to-mirror-combine-drives/ +[3]:http://www.howtogeek.com/114503/how-to-resize-your-ubuntu-partitions/ +[4]:http://www.howtogeek.com/howto/40702/how-to-manage-and-use-lvm-logical-volume-management-in-ubuntu/ +[5]:http://www.howtogeek.com/howto/40702/how-to-manage-and-use-lvm-logical-volume-management-in-ubuntu/ +[6]:http://www.howtogeek.com/howto/40702/how-to-manage-and-use-lvm-logical-volume-management-in-ubuntu/ From c9ee20d2d32beefb6ae69c12d2ae696ce352213b Mon Sep 17 00:00:00 2001 From: struggling <630441839@qq.com> Date: Wed, 5 Aug 2015 13:38:18 +0800 Subject: [PATCH 821/965] Delete 20150717 How to monitor NGINX- Part 1.md --- .../20150717 How to monitor NGINX- Part 1.md | 409 ------------------ 1 file changed, 409 deletions(-) delete mode 100644 sources/tech/20150717 How to monitor NGINX- Part 1.md diff --git a/sources/tech/20150717 How to monitor NGINX- Part 1.md b/sources/tech/20150717 How to monitor NGINX- Part 1.md deleted file mode 100644 index 690ab192ba..0000000000 --- a/sources/tech/20150717 How to monitor NGINX- Part 1.md +++ /dev/null @@ -1,409 +0,0 @@ -translation by strugglingyouth -How to monitor NGINX - Part 1 -================================================================================ -![](http://www.datadoghq.com/wp-content/uploads/2015/07/NGINX_hero_1.png) - -### What is NGINX? ### - -[NGINX][1] (pronounced “engine X”) is a popular HTTP server and reverse proxy server. As an HTTP server, NGINX serves static content very efficiently and reliably, using relatively little memory. As a [reverse proxy][2], it can be used as a single, controlled point of access for multiple back-end servers or for additional applications such as caching and load balancing. NGINX is available as a free, open-source product or in a more full-featured, commercially distributed version called NGINX Plus. - -NGINX can also be used as a mail proxy and a generic TCP proxy, but this article does not directly address NGINX monitoring for these use cases. - -### Key NGINX metrics ### - -By monitoring NGINX you can catch two categories of issues: resource issues within NGINX itself, and also problems developing elsewhere in your web infrastructure. Some of the metrics most NGINX users will benefit from monitoring include **requests per second**, which provides a high-level view of combined end-user activity; **server error rate**, which indicates how often your servers are failing to process seemingly valid requests; and **request processing time**, which describes how long your servers are taking to process client requests (and which can point to slowdowns or other problems in your environment). - -More generally, there are at least three key categories of metrics to watch: - -- Basic activity metrics -- Error metrics -- Performance metrics - -Below we’ll break down a few of the most important NGINX metrics in each category, as well as metrics for a fairly common use case that deserves special mention: using NGINX Plus for reverse proxying. We will also describe how you can monitor all of these metrics with your graphing or monitoring tools of choice. - -This article references metric terminology [introduced in our Monitoring 101 series][3], which provides a framework for metric collection and alerting. - -#### Basic activity metrics #### - -Whatever your NGINX use case, you will no doubt want to monitor how many client requests your servers are receiving and how those requests are being processed. - -NGINX Plus can report basic activity metrics exactly like open-source NGINX, but it also provides a secondary module that reports metrics slightly differently. We discuss open-source NGINX first, then the additional reporting capabilities provided by NGINX Plus. - -**NGINX** - -The diagram below shows the lifecycle of a client connection and how the open-source version of NGINX collects metrics during a connection. - -![connection, request states](https://d33tyra1llx9zy.cloudfront.net/blog/images/2015-06-nginx/nginx_connection_diagram-2.png) - -Accepts, handled, and requests are ever-increasing counters. Active, waiting, reading, and writing grow and shrink with request volume. - -注:表格 -
Plex Home Media ServerPlex Media Server
Base Operating System基础操作系统 Ubuntu 15.04 / CentOS 7.1 / Fedora 22 Work Station
Version 0.9.12.3.1173-937aac3
RAM and CPURAM 和 CPU 1 GB  , 2.0 GHZ
Hard Disk硬盘 30 GB
---- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionMetric type
acceptsCount of client connections attempted by NGINXResource: Utilization
handledCount of successful client connectionsResource: Utilization
activeCurrently active client connectionsResource: Utilization
dropped (calculated)Count of dropped connections (accepts – handled)Work: Errors*
requestsCount of client requestsWork: Throughput
*Strictly speaking, dropped connections is a metric of resource saturation, but since saturation causes NGINX to stop servicing some work (rather than queuing it up for later), “dropped” is best thought of as a work metric.
- -The **accepts** counter is incremented when an NGINX worker picks up a request for a connection from the OS, whereas **handled** is incremented when the worker actually gets a connection for the request (by establishing a new connection or reusing an open one). These two counts are usually the same—any divergence indicates that connections are being **dropped**, often because a resource limit, such as NGINX’s [worker_connections][4] limit, has been reached. - -Once NGINX successfully handles a connection, the connection moves to an **active** state, where it remains as client requests are processed: - -Active state - -- **Waiting**: An active connection may also be in a Waiting substate if there is no active request at the moment. New connections can bypass this state and move directly to Reading, most commonly when using “accept filter” or “deferred accept”, in which case NGINX does not receive notice of work until it has enough data to begin working on the response. Connections will also be in the Waiting state after sending a response if the connection is set to keep-alive. -- **Reading**: When a request is received, the connection moves out of the waiting state, and the request itself is counted as Reading. In this state NGINX is reading a client request header. Request headers are lightweight, so this is usually a fast operation. -- **Writing**: After the request is read, it is counted as Writing, and remains in that state until a response is returned to the client. That means that the request is Writing while NGINX is waiting for results from upstream systems (systems “behind” NGINX), and while NGINX is operating on the response. Requests will often spend the majority of their time in the Writing state. - -Often a connection will only support one request at a time. In this case, the number of Active connections == Waiting connections + Reading requests + Writing requests. However, the newer SPDY and HTTP/2 protocols allow multiple concurrent requests/responses to be multiplexed over a connection, so Active may be less than the sum of Waiting, Reading, and Writing. (As of this writing, NGINX does not support HTTP/2, but expects to add support during 2015.) - -**NGINX Plus** - -As mentioned above, all of open-source NGINX’s metrics are available within NGINX Plus, but Plus can also report additional metrics. The section covers the metrics that are only available from NGINX Plus. - -![connection, request states](https://d33tyra1llx9zy.cloudfront.net/blog/images/2015-06-nginx/nginx_plus_connection_diagram-2.png) - -Accepted, dropped, and total are ever-increasing counters. Active, idle, and current track the current number of connections or requests in each of those states, so they grow and shrink with request volume. - -注:表格 - ---- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionMetric type
acceptedCount of client connections attempted by NGINXResource: Utilization
droppedCount of dropped connectionsWork: Errors*
activeCurrently active client connectionsResource: Utilization
idleClient connections with zero current requestsResource: Utilization
totalCount of client requestsWork: Throughput
*Strictly speaking, dropped connections is a metric of resource saturation, but since saturation causes NGINX to stop servicing some work (rather than queuing it up for later), “dropped” is best thought of as a work metric.
- -The **accepted** counter is incremented when an NGINX Plus worker picks up a request for a connection from the OS. If the worker fails to get a connection for the request (by establishing a new connection or reusing an open one), then the connection is dropped and **dropped** is incremented. Ordinarily connections are dropped because a resource limit, such as NGINX Plus’s [worker_connections][4] limit, has been reached. - -**Active** and **idle** are the same as “active” and “waiting” states in open-source NGINX as described [above][5], with one key exception: in open-source NGINX, “waiting” falls under the “active” umbrella, whereas in NGINX Plus “idle” connections are excluded from the “active” count. **Current** is the same as the combined “reading + writing” states in open-source NGINX. - -**Total** is a cumulative count of client requests. Note that a single client connection can involve multiple requests, so this number may be significantly larger than the cumulative number of connections. In fact, (total / accepted) yields the average number of requests per connection. - -**Metric differences between Open-Source and Plus** - -注:表格 - --- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NGINX (open-source)NGINX Plus
acceptsaccepted
dropped must be calculateddropped is reported directly
reading + writingcurrent
waitingidle
active (includes “waiting” states)active (excludes “idle” states)
requeststotal
- -**Metric to alert on: Dropped connections** - -The number of connections that have been dropped is equal to the difference between accepts and handled (NGINX) or is exposed directly as a standard metric (NGINX Plus). Under normal circumstances, dropped connections should be zero. If your rate of dropped connections per unit time starts to rise, look for possible resource saturation. - -![Dropped connections](https://d33tyra1llx9zy.cloudfront.net/blog/images/2015-06-nginx/dropped_connections.png) - -**Metric to alert on: Requests per second** - -Sampling your request data (**requests** in open-source, or **total** in Plus) with a fixed time interval provides you with the number of requests you’re receiving per unit of time—often minutes or seconds. Monitoring this metric can alert you to spikes in incoming web traffic, whether legitimate or nefarious, or sudden drops, which are usually indicative of problems. A drastic change in requests per second can alert you to problems brewing somewhere in your environment, even if it cannot tell you exactly where those problems lie. Note that all requests are counted the same, regardless of their URLs. - -![Requests per second](https://d33tyra1llx9zy.cloudfront.net/blog/images/2015-06-nginx/requests_per_sec.png) - -**Collecting activity metrics** - -Open-source NGINX exposes these basic server metrics on a simple status page. Because the status information is displayed in a standardized form, virtually any graphing or monitoring tool can be configured to parse the relevant data for analysis, visualization, or alerting. NGINX Plus provides a JSON feed with much richer data. Read the companion post on [NGINX metrics collection][6] for instructions on enabling metrics collection. - -#### Error metrics #### - -注:表格 - ----- - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionMetric typeAvailability
4xx codesCount of client errorsWork: ErrorsNGINX logs, NGINX Plus
5xx codesCount of server errorsWork: ErrorsNGINX logs, NGINX Plus
- -NGINX error metrics tell you how often your servers are returning errors instead of producing useful work. Client errors are represented by 4xx status codes, server errors with 5xx status codes. - -**Metric to alert on: Server error rate** - -Your server error rate is equal to the number of 5xx errors divided by the total number of [status codes][7] (1xx, 2xx, 3xx, 4xx, 5xx), per unit of time (often one to five minutes). If your error rate starts to climb over time, investigation may be in order. If it spikes suddenly, urgent action may be required, as clients are likely to report errors to the end user. - -![Server error rate](https://d33tyra1llx9zy.cloudfront.net/blog/images/2015-06-nginx/5xx_rate.png) - -A note on client errors: while it is tempting to monitor 4xx, there is limited information you can derive from that metric since it measures client behavior without offering any insight into particular URLs. In other words, a change in 4xx could be noise, e.g. web scanners blindly looking for vulnerabilities. - -**Collecting error metrics** - -Although open-source NGINX does not make error rates immediately available for monitoring, there are at least two ways to capture that information: - -- Use the expanded status module available with commercially supported NGINX Plus -- Configure NGINX’s log module to write response codes in access logs - -Read the companion post on NGINX metrics collection for detailed instructions on both approaches. - -#### Performance metrics #### - -注:表格 - ----- - - - - - - - - - - - - - - - - -
NameDescriptionMetric typeAvailability
request timeTime to process each request, in secondsWork: PerformanceNGINX logs
- -**Metric to alert on: Request processing time** - -The request time metric logged by NGINX records the processing time for each request, from the reading of the first client bytes to fulfilling the request. Long response times can point to problems upstream. - -**Collecting processing time metrics** - -NGINX and NGINX Plus users can capture data on processing time by adding the $request_time variable to the access log format. More details on configuring logs for monitoring are available in our companion post on [NGINX metrics collection][8]. - -#### Reverse proxy metrics #### - -注:表格 - ----- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionMetric typeAvailability
Active connections by upstream serverCurrently active client connectionsResource: UtilizationNGINX Plus
5xx codes by upstream serverServer errorsWork: ErrorsNGINX Plus
Available servers per upstream groupServers passing health checksResource: AvailabilityNGINX Plus
- -One of the most common ways to use NGINX is as a [reverse proxy][9]. The commercially supported NGINX Plus exposes a large number of metrics about backend (or “upstream”) servers, which are relevant to a reverse proxy setup. This section highlights a few of the key upstream metrics that are available to users of NGINX Plus. - -NGINX Plus segments its upstream metrics first by group, and then by individual server. So if, for example, your reverse proxy is distributing requests to five upstream web servers, you can see at a glance whether any of those individual servers is overburdened, and also whether you have enough healthy servers in the upstream group to ensure good response times. - -**Activity metrics** - -The number of **active connections per upstream server** can help you verify that your reverse proxy is properly distributing work across your server group. If you are using NGINX as a load balancer, significant deviations in the number of connections handled by any one server can indicate that the server is struggling to process requests in a timely manner or that the load-balancing method (e.g., [round-robin or IP hashing][10]) you have configured is not optimal for your traffic patterns - -**Error metrics** - -Recall from the error metric section above that 5xx (server error) codes are a valuable metric to monitor, particularly as a share of total response codes. NGINX Plus allows you to easily extract the number of **5xx codes per upstream server**, as well as the total number of responses, to determine that particular server’s error rate. - -**Availability metrics** - -For another view of the health of your web servers, NGINX also makes it simple to monitor the health of your upstream groups via the total number of **servers currently available within each group**. In a large reverse proxy setup, you may not care very much about the current state of any one server, just as long as your pool of available servers is capable of handling the load. But monitoring the total number of servers that are up within each upstream group can provide a very high-level view of the aggregate health of your web servers. - -**Collecting upstream metrics** - -NGINX Plus upstream metrics are exposed on the internal NGINX Plus monitoring dashboard, and are also available via a JSON interface that can serve up metrics into virtually any external monitoring platform. See examples in our companion post on [collecting NGINX metrics][11]. - -### Conclusion ### - -In this post we’ve touched on some of the most useful metrics you can monitor to keep tabs on your NGINX servers. If you are just getting started with NGINX, monitoring most or all of the metrics in the list below will provide good visibility into the health and activity levels of your web infrastructure: - -- [Dropped connections][12] -- [Requests per second][13] -- [Server error rate][14] -- [Request processing time][15] - -Eventually you will recognize additional, more specialized metrics that are particularly relevant to your own infrastructure and use cases. Of course, what you monitor will depend on the tools you have and the metrics available to you. See the companion post for [step-by-step instructions on metric collection][16], whether you use NGINX or NGINX Plus. - -At Datadog, we have built integrations with both NGINX and NGINX Plus so that you can begin collecting and monitoring metrics from all your web servers with a minimum of setup. Learn how to monitor NGINX with Datadog [in this post][17], and get started right away with [a free trial of Datadog][18]. - -### Acknowledgments ### - -Many thanks to the NGINX team for reviewing this article prior to publication and providing important feedback and clarifications. - ----------- - -Source Markdown for this post is available [on GitHub][19]. Questions, corrections, additions, etc.? Please [let us know][20]. - --------------------------------------------------------------------------------- - -via: https://www.datadoghq.com/blog/how-to-monitor-nginx/ - -作者:K Young -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[1]:http://nginx.org/en/ -[2]:http://nginx.com/resources/glossary/reverse-proxy-server/ -[3]:https://www.datadoghq.com/blog/monitoring-101-collecting-data/ -[4]:http://nginx.org/en/docs/ngx_core_module.html#worker_connections -[5]:https://www.datadoghq.com/blog/how-to-monitor-nginx/#active-state -[6]:https://www.datadoghq.com/blog/how-to-collect-nginx-metrics/ -[7]:http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html -[8]:https://www.datadoghq.com/blog/how-to-collect-nginx-metrics/ -[9]:https://en.wikipedia.org/wiki/Reverse_proxy -[10]:http://nginx.com/blog/load-balancing-with-nginx-plus/ -[11]:https://www.datadoghq.com/blog/how-to-collect-nginx-metrics/ -[12]:https://www.datadoghq.com/blog/how-to-monitor-nginx/#dropped-connections -[13]:https://www.datadoghq.com/blog/how-to-monitor-nginx/#requests-per-second -[14]:https://www.datadoghq.com/blog/how-to-monitor-nginx/#server-error-rate -[15]:https://www.datadoghq.com/blog/how-to-monitor-nginx/#request-processing-time -[16]:https://www.datadoghq.com/blog/how-to-collect-nginx-metrics/ -[17]:https://www.datadoghq.com/blog/how-to-monitor-nginx-with-datadog/ -[18]:https://www.datadoghq.com/blog/how-to-monitor-nginx/#sign-up -[19]:https://github.com/DataDog/the-monitor/blob/master/nginx/how_to_monitor_nginx.md -[20]:https://github.com/DataDog/the-monitor/issues From 2b38bda7026c505229b4de281ac9ef5823b7f6d6 Mon Sep 17 00:00:00 2001 From: struggling <630441839@qq.com> Date: Wed, 5 Aug 2015 13:41:46 +0800 Subject: [PATCH 822/965] Create 20150717 How to monitor NGINX- Part 1.md --- .../20150717 How to monitor NGINX- Part 1.md | 416 ++++++++++++++++++ 1 file changed, 416 insertions(+) create mode 100644 translated/tech/20150717 How to monitor NGINX- Part 1.md diff --git a/translated/tech/20150717 How to monitor NGINX- Part 1.md b/translated/tech/20150717 How to monitor NGINX- Part 1.md new file mode 100644 index 0000000000..86e72c0324 --- /dev/null +++ b/translated/tech/20150717 How to monitor NGINX- Part 1.md @@ -0,0 +1,416 @@ +如何监控 NGINX - 第1部分 +================================================================================ +![](http://www.datadoghq.com/wp-content/uploads/2015/07/NGINX_hero_1.png) + +### NGINX 是什么? ### + +[NGINX][1] (发音为 “engine X”) 是一种流行的 HTTP 和反向代理服务器。作为一个 HTTP 服务器,NGINX 提供静态内容非常高效可靠,使用较少的内存。作为[反向代理][2],它可以用作一个单一的控制器来为其他应用代理至后端的多个服务器上,如高速缓存和负载平衡。NGINX 是作为一个免费,开源的产品并有更全的功能,商业版的叫 NGINX Plus。 + +NGINX 也可以用作邮件代理和通用的 TCP 代理,但本文并不直接说明对 NGINX 的这些用例做监控。 + +### NGINX 主要指标 ### + +通过监控 NGINX 可以捕捉两类问题:NGINX 本身的资源问题,也有很多问题会出现在你的基础网络设施处。大多数 NGINX 用户受益于以下指标的监控,包括**requests per second**,它提供了一个所有用户活动的高级视图;**server error rate** ,这表明你的服务器已经多长没有处理看似有效的请求;还有**request processing time**,这说明你的服务器处理客户端请求的总共时长(并且可以看出性能降低时或当前环境的其他问题)。 + +更一般地,至少有三个主要的指标类别来监视: + +- 基本活动指标 +- 错误指标 +- 性能指标 + +下面我们将分析在每个类别中最重要的 NGINX 指标,以及用一个相当普遍的案例来说明,值得特别说明的是:使用 NGINX Plus 作反向代理。我们还将介绍如何使用图形工具或可选择的监控工具来监控所有的指标。 + +本文引用指标术语[介绍我们的监控在 101 系列][3],,它提供了指标收集和警告框架。 + +#### 基本活动指标 #### + +无论你在怎样的情况下使用 NGINX,毫无疑问你要监视服务器接收多少客户端请求和如何处理这些请求。 + +NGINX Plus 上像开源 NGINX 一样可以报告基本活动指标,但它也提供了略有不同的辅助模块。我们首先讨论开源的 NGINX,再来说明 NGINX Plus 提供的其他指标的功能。 + +**NGINX** + +下图显示了一个客户端连接,以及如何在连接过程中收集指标的活动周期在开源 NGINX 版本上。 + +![connection, request states](https://d33tyra1llx9zy.cloudfront.net/blog/images/2015-06-nginx/nginx_connection_diagram-2.png) + +接受,处理,增加请求的计数器。主动,等待,读,写增加和减少请求量。 + +注:表格 + ++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDescriptionMetric type
acceptsCount of client connections attempted by NGINXResource: Utilization
handledCount of successful client connectionsResource: Utilization
activeCurrently active client connectionsResource: Utilization
dropped (calculated)Count of dropped connections (accepts – handled)Work: Errors*
requestsCount of client requestsWork: Throughput
*Strictly speaking, dropped connections is a metric of resource saturation, but since saturation causes NGINX to stop servicing some work (rather than queuing it up for later), “dropped” is best thought of as a work metric.
+ +NGINX 进程接受 OS 的连接请求时**accepts** 计数器增加,而**handled** 是当实际的请求得到连接时(通过建立一个新的连接或重新使用一个空闲的)。这两个计数器的值通常都是相同的,表明连接正在被**dropped**,往往由于资源限制,如 NGINX 的[worker_connections][4]的限制已经达到。 + +一旦 NGINX 成功处理一个连接时,连接会移动到**active**状态,然后保持为客户端请求进行处理: + +Active 状态 + +- **Waiting**: 活动的连接也可以是一个 Waiting 子状态,如果有在此刻没有活动请求。新连接绕过这个状态并直接移动到读,最常见的是使用“accept filter” 和 “deferred accept”,在这种情况下,NGINX 不会接收进程的通知,直到它具有足够的数据来开始响应工作。如果连接设置为 keep-alive ,连接在发送响应后将处于等待状态。 + +- **Reading**: 当接收到请求时,连接移出等待状态,并且该请求本身也被视为 Reading。在这种状态下NGINX 正在读取客户端请求首部。请求首部是比较少的,因此这通常是一个快速的操作。 + +- **Writing**: 请求被读取之后,将其计为 Writing,并保持在该状态,直到响应返回给客户端。这意味着,该请求在 Writing 时, NGINX 同时等待来自负载均衡服务器的结果(系统“背后”的 NGINX),NGINX 也同时响应。请求往往会花费大量的时间在 Writing 状态。 + +通常,一个连接在同一时间只接受一个请求。在这种情况下,Active 连接的数目 == Waiting 连接 + Reading 请求 + Writing 请求。然而,较新的 SPDY 和 HTTP/2 协议允许多个并发请求/响应对被复用的连接,所以 Active 可小于 Waiting,Reading,Writing 的总和。 (在撰写本文时,NGINX 不支持 HTTP/2,但预计到2015年期间将会支持。) + +**NGINX Plus** + +正如上面提到的,所有开源 NGINX 的指标在 NGINX Plus 中是可用的,但另外也提供其他的指标。本节仅说明了 NGINX Plus 可用的指标。 + + +![connection, request states](https://d33tyra1llx9zy.cloudfront.net/blog/images/2015-06-nginx/nginx_plus_connection_diagram-2.png) + +接受,中断,总数是不断增加的。活动,空闲和已建立连接的,当前状态下每一个连接或请​​求的数量是随着请求量增加和收缩的。 + +注:表格 + ++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDescriptionMetric type
acceptedCount of client connections attempted by NGINXResource: Utilization
droppedCount of dropped connectionsWork: Errors*
activeCurrently active client connectionsResource: Utilization
idleClient connections with zero current requestsResource: Utilization
totalCount of client requestsWork: Throughput
*Strictly speaking, dropped connections is a metric of resource saturation, but since saturation causes NGINX to stop servicing some work (rather than queuing it up for later), “dropped” is best thought of as a work metric.
+ +当 NGINX Plus 进程接受 OS 的连接请求时 **accepted** 计数器递增。如果进程请求连接失败(通过建立一个新的连接或重新使用一个空闲),则该连接断开 **dropped** 计数增加。通常连接被中断是因为资源限制,如 NGINX Plus 的[worker_connections][4]的限制已经达到。 + +**Active** 和 **idle** 和开源 NGINX 的“active” 和 “waiting”状态是相同的,[如上所述][5],有一个不同的地方:在开源 NGINX 上,“waiting”状态包括在“active”中,而在 NGINX Plus 上“idle”的连接被排除在“active” 计数外。**Current** 和开源 NGINX 是一样的也是由“reading + writing” 状态组成。 + + +**Total** 为客户端请求的累积计数。请注意,单个客户端连接可涉及多个请求,所以这个数字可能会比连接的累计次数明显大。事实上,(total / accepted)是每个连接请求的平均数量。 + +**开源 和 Plus 之间指标的不同** + +注:表格 + +++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NGINX (open-source)NGINX Plus
acceptsaccepted
dropped must be calculateddropped is reported directly
reading + writingcurrent
waitingidle
active (includes “waiting” states)active (excludes “idle” states)
requeststotal
+ +**提醒指标: 中断连接** + +被中断的连接数目等于接受和处理之差(NGINX),或被公开直接作为指标的标准(NGINX加)。在正常情况下,中断连接数应该是零。如果每秒中中断连接的速度开始上升,寻找资源可能用尽的地方。 + +![Dropped connections](https://d33tyra1llx9zy.cloudfront.net/blog/images/2015-06-nginx/dropped_connections.png) + +**提醒指标: 每秒请求数** + +提供你(开源中的**requests**或者 Plus 中**total**)固定时间间隔每秒或每分钟请求的平均数据。监测这个指标可以查看 Web 的输入流量的最大值,无论是合法的还是恶意的,有可能会突然下降,通常可以看出问题。每秒的请求若发生急剧变化可以提醒你出问题了,即使它不能告诉你确切问题的位置所在。请注意,所有的请求都算作是相同的,无论哪个 URLs。 + +![Requests per second](https://d33tyra1llx9zy.cloudfront.net/blog/images/2015-06-nginx/requests_per_sec.png) + +**收集活动指标** + +开源的 NGINX 提供了一个简单状态页面来显示基本的服务器指标。该状态信息以标准格式被显示,实际上任何图形或监控工具可以被配置去解析相关的数据为分析,可视化,或提醒而用。NGINX Plus 提供一个 JSON 接口来显示更多的数据。阅读[NGINX 指标收集][6]后来启用指标收集的功能。 + +#### 错误指标 #### + +注:表格 + +++++ + + + + + + + + + + + + + + + + + + + + + + +
NameDescriptionMetric typeAvailability
4xx codesCount of client errorsWork: ErrorsNGINX logs, NGINX Plus
5xx codesCount of server errorsWork: ErrorsNGINX logs, NGINX Plus
+ +NGINX 错误指标告诉你服务器经常返回哪些错误,这也是有用的。客户端错误返回4XX状态码,服务器端错误返回5XX状态码。 + +**提醒指标: 服务器错误率** + +服务器错误率等于5xx错误状态代码的总数除以[状态码][7](1XX,2XX,3XX,4XX,5XX)的总数,每单位时间(通常为一到五分钟)的数目。如果你的错误率随着时间的推移开始攀升,调查可能的原因。如果突然增加,可能需要采取紧急行动,因为客户端可能收到错误信息。 + +![Server error rate](https://d33tyra1llx9zy.cloudfront.net/blog/images/2015-06-nginx/5xx_rate.png) + +客户端收到错误时的注意事项:虽然监控4XX是很有用的,但从该指标中你仅可以捕捉有限的信息,因为它只是衡量客户的行为而不捕捉任何特殊的 URLs。换句话说,在4xx出现时只是相当于一点噪音,例如寻找漏洞的网络扫描仪。 + +**收集错误度量** + +虽然开源 NGINX 不会监测错误率,但至少有两种方法可以捕获其信息: + +- 使用商业支持的 NGINX Plus 提供的可扩展状态模块 +- 配置 NGINX 的日志模块将响应码写入访问日志 + +阅读关于 NGINX 指标收集的后两个方法的详细说明。 + +#### 性能指标 #### + +注:表格 + +++++ + + + + + + + + + + + + + + + + +
NameDescriptionMetric typeAvailability
request timeTime to process each request, in secondsWork: PerformanceNGINX logs
+ +**提醒指标: 请求处理时间** + +请求时间指标记录 NGINX 处理每个请求的时间,从第一个客户端的请求字节读出到完成请求。较长的响应时间可以将问题指向负载均衡服务器。 + +**收集处理时间指标** + +NGINX 和 NGINX Plus 用户可以通过添加 $request_time 变量到访问日志格式中来捕​​捉处理时间数据。关于配置日志监控的更多细节在[NGINX指标收集][8]。 + +#### 反向代理指标 #### + +注:表格 + +++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDescriptionMetric typeAvailability
Active connections by upstream serverCurrently active client connectionsResource: UtilizationNGINX Plus
5xx codes by upstream serverServer errorsWork: ErrorsNGINX Plus
Available servers per upstream groupServers passing health checksResource: AvailabilityNGINX Plus
+ +[反向代理][9]是 NGINX 最常见的使用方法之一。商业支持的 NGINX Plus 显示了大量有关后端(或“负载均衡”)的服务器指标,这是反向代理设置的。本节重点介绍了几个关键的负载均衡服务器的指标为 NGINX Plus 用户。 + +NGINX Plus 的负载均衡服务器指标首先是组的,然后是单个服务器的。因此,例如,你的反向代理将请求分配到五个 Web 负载均衡服务器上,你可以一眼看出是否有单个服务器压力过大,也可以看出负载均衡服务器组的健康状况,以确保良好的响应时间。 + +**活动指标** + +**active connections per upstream server**的数量可以帮助你确认反向代理是否正确的分配工作到负载均衡服务器上。如果你正在使用 NGINX 作为负载均衡器,任何一台服务器处理的连接数有显著的偏差都可能表明服务器正在努力处理请求或你配置处理请求的负载均衡的方法(例如[round-robin or IP hashing][10])不是最适合你流量模式的。 + +**错误指标** + +错误指标,上面所说的高于5XX(服务器错误)状态码,是监控指标中有价值的一个,尤其是响应码部分。 NGINX Plus 允许你轻松地提取每个负载均衡服务器 **5xx codes per upstream server**的数量,以及响应的总数量,以此来确定该特定服务器的错误率。 + + +**可用性指标** + +对于 web 服务器的运行状况,另一种观点认为,NGINX 也可以很方便监控你的负载均衡服务器组的健康通过**servers currently available within each group**的总量​​。在一个大的反向代理上,你可能不会非常关心其中一个服务器的当前状态,就像你只要可用的服务器组能够处理当前的负载就行了。但监视负载均衡服务器组内的所有服务器可以提供一个高水平的图像来判断 Web 服务器的健康状况。 + +**收集负载均衡服务器的指标** + +NGINX Plus 负载均衡服务器的指标显示在内部 NGINX Plus 的监控仪表盘上,并且也可通过一个JSON 接口来服务于所有外部的监控平台。在这儿看一个例子[收集 NGINX 指标][11]。 + +### 结论 ### + +在这篇文章中,我们已经谈到了一些有用的指标,你可以使用表格来监控 NGINX 服务器。如果你是刚开始使用 NGINX,下面提供了良好的网络基础设施的健康和活动的可视化工具来监控大部分或所有的指标: + +- [Dropped connections][12] +- [Requests per second][13] +- [Server error rate][14] +- [Request processing time][15] + +最终,你会学到更多,更专业的衡量指标,尤其是关于你自己基础设施和使用情况的。当然,监控哪一项指标将取决于你可用的工具。参见[一步一步来说明指标收集][16],不管你使用 NGINX 还是 NGINX Plus。 + + + +在 Datadog 中,我们已经集成了 NGINX 和 NGINX Plus,这样你就可以以最小的设置来收集和监控所有 Web 服务器的指标。了解如何用 NGINX Datadog来监控 [在本文中][17],并开始使用 [免费的 Datadog][18]。 + +### Acknowledgments ### + +在文章发表之前非常感谢 NGINX 团队审阅这篇,并提供重要的反馈和说明。 + +---------- + +文章来源在这儿 [on GitHub][19]。问题,更正,补充等?请[告诉我们][20]。 + + +-------------------------------------------------------------------------------- + +via: https://www.datadoghq.com/blog/how-to-monitor-nginx/ + +作者:K Young +译者:[strugglingyouth](https://github.com/strugglingyouth) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[1]:http://nginx.org/en/ +[2]:http://nginx.com/resources/glossary/reverse-proxy-server/ +[3]:https://www.datadoghq.com/blog/monitoring-101-collecting-data/ +[4]:http://nginx.org/en/docs/ngx_core_module.html#worker_connections +[5]:https://www.datadoghq.com/blog/how-to-monitor-nginx/#active-state +[6]:https://www.datadoghq.com/blog/how-to-collect-nginx-metrics/ +[7]:http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html +[8]:https://www.datadoghq.com/blog/how-to-collect-nginx-metrics/ +[9]:https://en.wikipedia.org/wiki/Reverse_proxy +[10]:http://nginx.com/blog/load-balancing-with-nginx-plus/ +[11]:https://www.datadoghq.com/blog/how-to-collect-nginx-metrics/ +[12]:https://www.datadoghq.com/blog/how-to-monitor-nginx/#dropped-connections +[13]:https://www.datadoghq.com/blog/how-to-monitor-nginx/#requests-per-second +[14]:https://www.datadoghq.com/blog/how-to-monitor-nginx/#server-error-rate +[15]:https://www.datadoghq.com/blog/how-to-monitor-nginx/#request-processing-time +[16]:https://www.datadoghq.com/blog/how-to-collect-nginx-metrics/ +[17]:https://www.datadoghq.com/blog/how-to-monitor-nginx-with-datadog/ +[18]:https://www.datadoghq.com/blog/how-to-monitor-nginx/#sign-up +[19]:https://github.com/DataDog/the-monitor/blob/master/nginx/how_to_monitor_nginx.md +[20]:https://github.com/DataDog/the-monitor/issues From d883f1ef7607ced1c97a49c36994a3c51934d636 Mon Sep 17 00:00:00 2001 From: DeadFire Date: Thu, 6 Aug 2015 11:27:53 +0800 Subject: [PATCH 823/965] =?UTF-8?q?20150806-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20150806 5 heroes of the Linux world.md | 99 +++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 sources/talk/20150806 5 heroes of the Linux world.md diff --git a/sources/talk/20150806 5 heroes of the Linux world.md b/sources/talk/20150806 5 heroes of the Linux world.md new file mode 100644 index 0000000000..ae35d674a1 --- /dev/null +++ b/sources/talk/20150806 5 heroes of the Linux world.md @@ -0,0 +1,99 @@ +5 heroes of the Linux world +================================================================================ +Who are these people, seen and unseen, whose work affects all of us every day? + +![Image courtesy Christopher Michel/Flickr](http://core0.staticworld.net/images/article/2015/07/penguin-100599348-orig.jpg) +Image courtesy [Christopher Michel/Flickr][1] + +### High-flying penguins ### + +Linux and open source is driven by passionate people who write best-of-breed software and then release the code to the public so anyone can use it, without any strings attached. (Well, there is one string attached and that’s licence.) + +Who are these people? These heroes of the Linux world, whose work affects all of us every day. Allow me to introduce you. + +![Image courtesy Swapnil Bhartiya](http://images.techhive.com/images/article/2015/07/swap-klaus-100599357-orig.jpg) +Image courtesy Swapnil Bhartiya + +### Klaus Knopper ### + +Klaus Knopper, an Austrian developer who lives in Germany, is the founder of Knoppix and Adriana Linux, which he developed for his blind wife. + +Knoppix holds a very special place in heart of those Linux users who started using Linux before Ubuntu came along. What makes Knoppix so special is that it popularized the concept of Live CD. Unlike Windows or Mac OS X, you could run the entire operating system from the CD without installing anything on the system. It allowed new users to test Linux on their systems without formatting the hard drive. The live feature of Linux alone contributed heavily to its popularity. + +![Image courtesy Fórum Internacional Software Live/Flickr](http://images.techhive.com/images/article/2015/07/lennart-100599356-orig.jpg) +Image courtesy [Fórum Internacional Software Live/Flickr][2] + +### Lennart Pottering ### + +Lennart Pottering is yet another genius from Germany. He has written so many core components of a Linux (as well as BSD) system that it’s hard to keep track. Most of his work is towards the successors of aging or broken components of the Linux systems. + +Pottering wrote the modern init system systemd, which shook the Linux world and created a [rift in the Debian community][3]. + +While Linus Torvalds has no problems with systemd, and praises it, he is not a huge fan of the way systemd developers (including the co-author Kay Sievers,) respond to bug reports and criticism. At one point Linus said on the LKML (Linux Kernel Mailing List) that he would [never work with Sievers][4]. + +Lennart is also the author of Pulseaudio, sound server on Linux and Avahi, zero-configuration networking (zeroconf) implementation. + +![Image courtesy Meego Com/Flickr](http://images.techhive.com/images/article/2015/07/jim-zemlin-100599362-orig.jpg) +Image courtesy [Meego Com/Flickr][5] + +### Jim Zemlin ### + +Jim Zemlin isn't a developer, but as founder of The Linux Foundation he is certainly one of the most important figures of the Linux world. + +In 2007, The Linux Foundation was formed as a result of merger between two open source bodies: the Free Standards Group and the Open Source Development Labs. Zemlin was the executive director of the Free Standards Group. Post-merger Zemlin became the executive director of The Linux Foundation and has held that position since. + +Under his leadership, The Linux Foundation has become the central figure in the modern IT world and plays a very critical role for the Linux ecosystem. In order to ensure that key developers like Torvalds and Kroah-Hartman can focus on Linux, the foundation sponsors them as fellows. + +Zemlin also made the foundation a bridge between companies so they can collaborate on Linux while at the same time competing in the market. The foundation also organizes many conferences around the world and [offers many courses for Linux developers][6]. + +People may think of Zemlin as Linus Torvalds' boss, but he refers to himself as "Linus Torvalds' janitor." + +![Image courtesy Coscup/Flickr](http://images.techhive.com/images/article/2015/07/greg-kh-100599350-orig.jpg) +Image courtesy [Coscup/Flickr][7] + +### Greg Kroah-Hartman ### + +Greg Kroah-Hartman is known as second-in-command of the Linux kernel. The ‘gentle giant’ is the maintainer of the stable branch of the kernel and of staging subsystem, USB, driver core, debugfs, kref, kobject, and the [sysfs][8] kernel subsystems along with many other components of a Linux system. + +He is also credited for device drivers for Linux. One of his jobs is to travel around the globe, meet hardware makers and persuade them to make their drivers available for Linux. The next time you plug some random USB device to your system and it works out of the box, thank Kroah-Hartman. (Don't thank the distro. Some distros try to take credit for the work Kroah-Hartman or the Linux kernel did.) + +Kroah-Hartman previously worked for Novell and then joined the Linux Foundation as a fellow, alongside Linus Torvalds. + +Kroah-Hartman is the total opposite of Linus and never rants (at least publicly). One time there was some ripple was when he stated that [Canonical doesn’t contribute much to the Linux kernel][9]. + +On a personal level, Kroah-Hartman is extremely helpful to new developers and users and is easily accessible. + +![Image courtesy Swapnil Bhartiya](http://images.techhive.com/images/article/2015/07/linus-swapnil-100599349-orig.jpg) +Image courtesy Swapnil Bhartiya + +### Linus Torvalds ### + +No collection of Linux heroes would be complete without Linus Torvalds. He is the author of the Linux kernel, the most used open source technology on the planet and beyond. His software powers everything from space stations to supercomputers, military drones to mobile devices and tiny smartwatches. Linus remains the authority on the Linux kernel and makes the final decision on which patches to merge to the kernel. + +Linux isn't Torvalds' only contribution open source. When he got fed-up with the existing software revision control systems, which his kernel heavily relied on, he wrote his own, called Git. Git enjoys the same reputation as Linux; it is the most used version control system in the world. + +Torvalds is also a passionate scuba diver and when he found no decent dive logs for Linux, he wrote his own and called it SubSurface. + +Torvalds is [well known for his rants][10] and once admitted that his ego is as big as a small planet. But he is also known for admitting his mistakes if he realizes he was wrong. + +-------------------------------------------------------------------------------- + +via: http://www.itworld.com/article/2955001/linux/5-heros-of-the-linux-world.html + +作者:[Swapnil Bhartiya][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.itworld.com/author/Swapnil-Bhartiya/ +[1]:https://flic.kr/p/siJ25M +[2]:https://flic.kr/p/uTzj54 +[3]:http://www.itwire.com/business-it-news/open-source/66153-systemd-fallout-two-debian-technical-panel-members-resign +[4]:http://www.linuxveda.com/2014/04/04/linus-torvalds-systemd-kay-sievers/ +[5]:https://flic.kr/p/9Lnhpu +[6]:http://www.itworld.com/article/2951968/linux/linux-foundation-offers-cheaper-courses-and-certifications-for-india.html +[7]:https://flic.kr/p/hBv8Pp +[8]:https://en.wikipedia.org/wiki/Sysfs +[9]:https://www.youtube.com/watch?v=CyHAeGBFS8k +[10]:http://www.itworld.com/article/2873200/operating-systems/11-technologies-that-tick-off-linus-torvalds.html \ No newline at end of file From 308319dffbe0f9e27d61c482b71b9ba46823cadd Mon Sep 17 00:00:00 2001 From: DeadFire Date: Thu, 6 Aug 2015 11:38:08 +0800 Subject: [PATCH 824/965] =?UTF-8?q?20150806-2=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...lation Guide for Puppet on Ubuntu 15.04.md | 429 ++++++++++++++++++ 1 file changed, 429 insertions(+) create mode 100644 sources/tech/20150806 Installation Guide for Puppet on Ubuntu 15.04.md diff --git a/sources/tech/20150806 Installation Guide for Puppet on Ubuntu 15.04.md b/sources/tech/20150806 Installation Guide for Puppet on Ubuntu 15.04.md new file mode 100644 index 0000000000..ea8fcd6e2e --- /dev/null +++ b/sources/tech/20150806 Installation Guide for Puppet on Ubuntu 15.04.md @@ -0,0 +1,429 @@ +Installation Guide for Puppet on Ubuntu 15.04 +================================================================================ +Hi everyone, today in this article we'll learn how to install puppet to manage your server infrastructure running ubuntu 15.04. Puppet is an open source software configuration management tool which is developed and maintained by Puppet Labs that allows us to automate the provisioning, configuration and management of a server infrastructure. Whether we're managing just a few servers or thousands of physical and virtual machines to orchestration and reporting, puppet automates tasks that system administrators often do manually which frees up time and mental space so sysadmins can work on improving other aspects of your overall setup. It ensures consistency, reliability and stability of the automated jobs processed. It facilitates closer collaboration between sysadmins and developers, enabling more efficient delivery of cleaner, better-designed code. Puppet is available in two solutions configuration management and data center automation. They are **puppet open source and puppet enterprise**. Puppet open source is a flexible, customizable solution available under the Apache 2.0 license, designed to help system administrators automate the many repetitive tasks they regularly perform. Whereas puppet enterprise edition is a proven commercial solution for diverse enterprise IT environments which lets us get all the benefits of open source puppet, plus puppet apps, commercial-only enhancements, supported modules and integrations, and the assurance of a fully supported platform. Puppet uses SSL certificates to authenticate communication between master and agent nodes. + +In this tutorial, we will cover how to install open source puppet in an agent and master setup running ubuntu 15.04 linux distribution. Here, Puppet master is a server from where all the configurations will be controlled and managed and all our remaining servers will be puppet agent nodes, which is configured according to the configuration of puppet master server. Here are some easy steps to install and configure puppet to manage our server infrastructure running Ubuntu 15.04. + +### 1. Setting up Hosts ### + +In this tutorial, we'll use two machines, one as puppet master server and another as puppet node agent both running ubuntu 15.04 "Vivid Vervet" in both the machines. Here is the infrastructure of the server that we're gonna use for this tutorial. + +puppet master server with IP 44.55.88.6 and hostname : puppetmaster +puppet node agent with IP 45.55.86.39 and hostname : puppetnode + +Now we'll add the entry of the machines to /etc/hosts on both machines node agent and master server. + + # nano /etc/hosts + + 45.55.88.6 puppetmaster.example.com puppetmaster + 45.55.86.39 puppetnode.example.com puppetnode + +Please note that the Puppet Master server must be reachable on port 8140. So, we'll need to open port 8140 in it. + +### 2. Updating Time with NTP ### + +As puppet nodes needs to maintain accurate system time to avoid problems when it issues agent certificates. Certificates can appear to be expired if there is time difference, the time of the both the master and the node agent must be synced with each other. To sync the time, we'll update the time with NTP. To do so, here's the command below that we need to run on both master and node agent. + + # ntpdate pool.ntp.org + + 17 Jun 00:17:08 ntpdate[882]: adjust time server 66.175.209.17 offset -0.001938 sec + +Now, we'll update our local repository index and install ntp as follows. + + # apt-get update && sudo apt-get -y install ntp ; service ntp restart + +### 3. Puppet Master Package Installation ### + +There are many ways to install open source puppet. In this tutorial, we'll download and install a debian binary package named as **puppetlabs-release** packaged by the Puppet Labs which will add the source of the **puppetmaster-passenger** package. The puppetmaster-passenger includes the puppet master with apache web server. So, we'll now download the Puppet Labs package. + + # cd /tmp/ + # wget https://apt.puppetlabs.com/puppetlabs-release-trusty.deb + + --2015-06-17 00:19:26-- https://apt.puppetlabs.com/puppetlabs-release-trusty.deb + Resolving apt.puppetlabs.com (apt.puppetlabs.com)... 192.155.89.90, 2600:3c03::f03c:91ff:fedb:6b1d + Connecting to apt.puppetlabs.com (apt.puppetlabs.com)|192.155.89.90|:443... connected. + HTTP request sent, awaiting response... 200 OK + Length: 7384 (7.2K) [application/x-debian-package] + Saving to: ‘puppetlabs-release-trusty.deb’ + + puppetlabs-release-tr 100%[===========================>] 7.21K --.-KB/s in 0.06s + + 2015-06-17 00:19:26 (130 KB/s) - ‘puppetlabs-release-trusty.deb’ saved [7384/7384] + +After the download has been completed, we'll wanna install the package. + + # dpkg -i puppetlabs-release-trusty.deb + + Selecting previously unselected package puppetlabs-release. + (Reading database ... 85899 files and directories currently installed.) + Preparing to unpack puppetlabs-release-trusty.deb ... + Unpacking puppetlabs-release (1.0-11) ... + Setting up puppetlabs-release (1.0-11) ... + +Then, we'll update the local respository index with the server using apt package manager. + + # apt-get update + +Then, we'll install the puppetmaster-passenger package by running the below command. + + # apt-get install puppetmaster-passenger + +**Note**: While installing we may get an error **Warning: Setting templatedir is deprecated. See http://links.puppetlabs.com/env-settings-deprecations (at /usr/lib/ruby/vendor_ruby/puppet/settings.rb:1139:in `issue_deprecation_warning')** but we no need to worry, we'll just simply ignore this as it says that the templatedir is deprecated so, we'll simply disbale that setting in the configuration. :) + +To check whether puppetmaster has been installed successfully in our Master server not not, we'll gonna try to check its version. + + # puppet --version + + 3.8.1 + +We have successfully installed puppet master package in our puppet master box. As we are using passenger with apache, the puppet master process is controlled by apache server, that means it runs when apache is running. + +Before continuing, we'll need to stop the Puppet master by stopping the apache2 service. + + # systemctl stop apache2 + +### 4. Master version lock with Apt ### + +As We have puppet version as 3.8.1, we need to lock the puppet version update as this will mess up the configurations while updating the puppet. So, we'll use apt's locking feature for that. To do so, we'll need to create a new file **/etc/apt/preferences.d/00-puppet.pref** using our favorite text editor. + + # nano /etc/apt/preferences.d/00-puppet.pref + +Then, we'll gonna add the entries in the newly created file as: + + # /etc/apt/preferences.d/00-puppet.pref + Package: puppet puppet-common puppetmaster-passenger + Pin: version 3.8* + Pin-Priority: 501 + +Now, it will not update the puppet while running updates in the system. + +### 5. Configuring Puppet Config ### + +Puppet master acts as a certificate authority and must generate its own certificates which is used to sign agent certificate requests. First of all, we'll need to remove any existing SSL certificates that were created during the installation of package. The default location of puppet's SSL certificates is /var/lib/puppet/ssl. So, we'll remove the entire ssl directory using rm command. + + # rm -rf /var/lib/puppet/ssl + +Then, we'll configure the certificate. While creating the puppet master's certificate, we need to include every DNS name at which agent nodes can contact the master at. So, we'll edit the master's puppet.conf using our favorite text editor. + + # nano /etc/puppet/puppet.conf + +The output seems as shown below. + + [main] + logdir=/var/log/puppet + vardir=/var/lib/puppet + ssldir=/var/lib/puppet/ssl + rundir=/var/run/puppet + factpath=$vardir/lib/facter + templatedir=$confdir/templates + + [master] + # These are needed when the puppetmaster is run by passenger + # and can safely be removed if webrick is used. + ssl_client_header = SSL_CLIENT_S_DN + ssl_client_verify_header = SSL_CLIENT_VERIFY + +Here, we'll need to comment the templatedir line to disable the setting as it has been already depreciated. After that, we'll add the following line at the end of the file under [main]. + + server = puppetmaster + environment = production + runinterval = 1h + strict_variables = true + certname = puppetmaster + dns_alt_names = puppetmaster, puppetmaster.example.com + +This configuration file has many options which might be useful in order to setup own configuration. A full description of the file is available at Puppet Labs [Main Config File (puppet.conf)][1]. + +After editing the file, we'll wanna save that and exit. + +Now, we'll gonna generate a new CA certificates by running the following command. + + # puppet master --verbose --no-daemonize + + Info: Creating a new SSL key for ca + Info: Creating a new SSL certificate request for ca + Info: Certificate Request fingerprint (SHA256): F6:2F:69:89:BA:A5:5E:FF:7F:94:15:6B:A7:C4:20:CE:23:C7:E3:C9:63:53:E0:F2:76:D7:2E:E0:BF:BD:A6:78 + ... + Notice: puppetmaster has a waiting certificate request + Notice: Signed certificate request for puppetmaster + Notice: Removing file Puppet::SSL::CertificateRequest puppetmaster at '/var/lib/puppet/ssl/ca/requests/puppetmaster.pem' + Notice: Removing file Puppet::SSL::CertificateRequest puppetmaster at '/var/lib/puppet/ssl/certificate_requests/puppetmaster.pem' + Notice: Starting Puppet master version 3.8.1 + ^CNotice: Caught INT; storing stop + Notice: Processing stop + +Now, the certificate is being generated. Once we see **Notice: Starting Puppet master version 3.8.1**, the certificate setup is complete. Then we'll press CTRL-C to return to the shell. + +If we wanna look at the cert information of the certificate that was just created, we can get the list by running in the following command. + + # puppet cert list -all + + + "puppetmaster" (SHA256) 33:28:97:86:A1:C3:2F:73:10:D1:FB:42:DA:D5:42:69:71:84:F0:E2:8A:01:B9:58:38:90:E4:7D:B7:25:23:EC (alt names: "DNS:puppetmaster", "DNS:puppetmaster.example.com") + +### 6. Creating a Puppet Manifest ### + +The default location of the main manifest is /etc/puppet/manifests/site.pp. The main manifest file contains the definition of configuration that is used to execute in the puppet node agent. Now, we'll create the manifest file by running the following command. + + # nano /etc/puppet/manifests/site.pp + +Then, we'll add the following lines of configuration in the file that we just opened. + + # execute 'apt-get update' + exec { 'apt-update': # exec resource named 'apt-update' + command => '/usr/bin/apt-get update' # command this resource will run + } + + # install apache2 package + package { 'apache2': + require => Exec['apt-update'], # require 'apt-update' before installing + ensure => installed, + } + + # ensure apache2 service is running + service { 'apache2': + ensure => running, + } + +The above lines of configuration are responsible for the deployment of the installation of apache web server across the node agent. + +### 7. Starting Master Service ### + +We are now ready to start the puppet master. We can start it by running the apache2 service. + + # systemctl start apache2 + +Here, our puppet master is running, but it isn't managing any agent nodes yet. Now, we'll gonna add the puppet node agents to the master. + +**Note**: If you get an error **Job for apache2.service failed. See "systemctl status apache2.service" and "journalctl -xe" for details.** then it must be that there is some problem with the apache server. So, we can see the log what exactly has happened by running **apachectl start** under root or sudo mode. Here, while performing this tutorial, we got a misconfiguration of the certificates under **/etc/apache2/sites-enabled/puppetmaster.conf** file. We replaced **SSLCertificateFile /var/lib/puppet/ssl/certs/server.pem with SSLCertificateFile /var/lib/puppet/ssl/certs/puppetmaster.pem** and commented **SSLCertificateKeyFile** line. Then we'll need to rerun the above command to run apache server. + +### 8. Puppet Agent Package Installation ### + +Now, as we have our puppet master ready and it needs an agent to manage, we'll need to install puppet agent into the nodes. We'll need to install puppet agent in every nodes in our infrastructure we want puppet master to manage. We'll need to make sure that we have added our node agents in the DNS. Now, we'll gonna install the latest puppet agent in our agent node ie. puppetnode.example.com . + +We'll run the following command to download the Puppet Labs package in our puppet agent nodes. + + # cd /tmp/ + # wget https://apt.puppetlabs.com/puppetlabs-release-trusty.deb\ + + --2015-06-17 00:54:42-- https://apt.puppetlabs.com/puppetlabs-release-trusty.deb + Resolving apt.puppetlabs.com (apt.puppetlabs.com)... 192.155.89.90, 2600:3c03::f03c:91ff:fedb:6b1d + Connecting to apt.puppetlabs.com (apt.puppetlabs.com)|192.155.89.90|:443... connected. + HTTP request sent, awaiting response... 200 OK + Length: 7384 (7.2K) [application/x-debian-package] + Saving to: ‘puppetlabs-release-trusty.deb’ + + puppetlabs-release-tr 100%[===========================>] 7.21K --.-KB/s in 0.04s + + 2015-06-17 00:54:42 (162 KB/s) - ‘puppetlabs-release-trusty.deb’ saved [7384/7384] + +Then, as we're running ubuntu 15.04, we'll use debian package manager to install it. + + # dpkg -i puppetlabs-release-trusty.deb + +Now, we'll gonna update the repository index using apt-get. + + # apt-get update + +Finally, we'll gonna install the puppet agent directly from the remote repository. + + # apt-get install puppet + +Puppet agent is always disabled by default, so we'll need to enable it. To do so we'll need to edit /etc/default/puppet file using a text editor. + + # nano /etc/default/puppet + +Then, we'll need to change value of **START** to "yes" as shown below. + + START=yes + +Then, we'll need to save and exit the file. + +### 9. Agent Version Lock with Apt ### + +As We have puppet version as 3.8.1, we need to lock the puppet version update as this will mess up the configurations while updating the puppet. So, we'll use apt's locking feature for that. To do so, we'll need to create a file /etc/apt/preferences.d/00-puppet.pref using our favorite text editor. + + # nano /etc/apt/preferences.d/00-puppet.pref + +Then, we'll gonna add the entries in the newly created file as: + + # /etc/apt/preferences.d/00-puppet.pref + Package: puppet puppet-common + Pin: version 3.8* + Pin-Priority: 501 + +Now, it will not update the Puppet while running updates in the system. + +### 10. Configuring Puppet Node Agent ### + +Next, We must make a few configuration changes before running the agent. To do so, we'll need to edit the agent's puppet.conf + + # nano /etc/puppet/puppet.conf + +It will look exactly like the Puppet master's initial configuration file. + +This time also we'll comment the **templatedir** line. Then we'll gonna delete the [master] section, and all of the lines below it. + +Assuming that the puppet master is reachable at "puppet-master", the agent should be able to connect to the master. If not we'll need to use its fully qualified domain name ie. puppetmaster.example.com . + + [agent] + server = puppetmaster.example.com + certname = puppetnode.example.com + +After adding this, it will look alike this. + + [main] + logdir=/var/log/puppet + vardir=/var/lib/puppet + ssldir=/var/lib/puppet/ssl + rundir=/var/run/puppet + factpath=$vardir/lib/facter + #templatedir=$confdir/templates + + [agent] + server = puppetmaster.example.com + certname = puppetnode.example.com + +After done with that, we'll gonna save and exit it. + +Next, we'll wanna start our latest puppet agent in our Ubuntu 15.04 nodes. To start our puppet agent, we'll need to run the following command. + + # systemctl start puppet + +If everything went as expected and configured properly, we should not see any output displayed by running the above command. When we run an agent for the first time, it generates an SSL certificate and sends a request to the puppet master then if the master signs the agent's certificate, it will be able to communicate with the agent node. + +**Note**: If you are adding your first node, it is recommended that you attempt to sign the certificate on the puppet master before adding your other agents. Once you have verified that everything works properly, then you can go back and add the remaining agent nodes further. + +### 11. Signing certificate Requests on Master ### + +While puppet agent runs for the first time, it generates an SSL certificate and sends a request for signing to the master server. Before the master will be able to communicate and control the agent node, it must sign that specific agent node's certificate. + +To get the list of the certificate requests, we'll run the following command in the puppet master server. + + # puppet cert list + + "puppetnode.example.com" (SHA256) 31:A1:7E:23:6B:CD:7B:7D:83:98:33:8B:21:01:A6:C4:01:D5:53:3D:A0:0E:77:9A:77:AE:8F:05:4A:9A:50:B2 + +As we just setup our first agent node, we will see one request. It will look something like the following, with the agent node's Domain name as the hostname. + +Note that there is no + in front of it which indicates that it has not been signed yet. + +Now, we'll go for signing a certification request. In order to sign a certification request, we should simply run **puppet cert sign** with the **hostname** as shown below. + + # puppet cert sign puppetnode.example.com + + Notice: Signed certificate request for puppetnode.example.com + Notice: Removing file Puppet::SSL::CertificateRequest puppetnode.example.com at '/var/lib/puppet/ssl/ca/requests/puppetnode.example.com.pem' + +The Puppet master can now communicate and control the node that the signed certificate belongs to. + +If we want to sign all of the current requests, we can use the -all option as shown below. + + # puppet cert sign --all + +### Removing a Puppet Certificate ### + +If we wanna remove a host from it or wanna rebuild a host then add it back to it. In this case, we will want to revoke the host's certificate from the puppet master. To do this, we will want to use the clean action as follows. + + # puppet cert clean hostname + + Notice: Revoked certificate with serial 5 + Notice: Removing file Puppet::SSL::Certificate puppetnode.example.com at '/var/lib/puppet/ssl/ca/signed/puppetnode.example.com.pem' + Notice: Removing file Puppet::SSL::Certificate puppetnode.example.com at '/var/lib/puppet/ssl/certs/puppetnode.example.com.pem' + +If we want to view all of the requests signed and unsigned, run the following command: + + # puppet cert list --all + + + "puppetmaster" (SHA256) 33:28:97:86:A1:C3:2F:73:10:D1:FB:42:DA:D5:42:69:71:84:F0:E2:8A:01:B9:58:38:90:E4:7D:B7:25:23:EC (alt names: "DNS:puppetmaster", "DNS:puppetmaster.example.com") + +### 12. Deploying a Puppet Manifest ### + +After we configure and complete the puppet manifest, we'll wanna deploy the manifest to the agent nodes server. To apply and load the main manifest we can simply run the following command in the agent node. + + # puppet agent --test + + Info: Retrieving pluginfacts + Info: Retrieving plugin + Info: Caching catalog for puppetnode.example.com + Info: Applying configuration version '1434563858' + Notice: /Stage[main]/Main/Exec[apt-update]/returns: executed successfully + Notice: Finished catalog run in 10.53 seconds + +This will show us all the processes how the main manifest will affect a single server immediately. + +If we wanna run a puppet manifest that is not related to the main manifest, we can simply use puppet apply followed by the manifest file path. It only applies the manifest to the node that we run the apply from. + + # puppet apply /etc/puppet/manifest/test.pp + +### 13. Configuring Manifest for a Specific Node ### + +If we wanna deploy a manifest only to a specific node then we'll need to configure the manifest as follows. + +We'll need to edit the manifest on the master server using a text editor. + + # nano /etc/puppet/manifest/site.pp + +Now, we'll gonna add the following lines there. + + node 'puppetnode', 'puppetnode1' { + # execute 'apt-get update' + exec { 'apt-update': # exec resource named 'apt-update' + command => '/usr/bin/apt-get update' # command this resource will run + } + + # install apache2 package + package { 'apache2': + require => Exec['apt-update'], # require 'apt-update' before installing + ensure => installed, + } + + # ensure apache2 service is running + service { 'apache2': + ensure => running, + } + } + +Here, the above configuration will install and deploy the apache web server only to the two specified nodes having shortname puppetnode and puppetnode1. We can add more nodes that we need to get deployed with the manifest specifically. + +### 14. Configuring Manifest with a Module ### + +Modules are useful for grouping tasks together, they are many available in the Puppet community which anyone can contribute further. + +On the puppet master, we'll gonna install the **puppetlabs-apache** module using the puppet module command. + + # puppet module install puppetlabs-apache + +**Warning**: Please do not use this module on an existing apache setup else it will purge your apache configurations that are not managed by puppet. + +Now we'll gonna edit the main manifest ie **site.pp** using a text editor. + + # nano /etc/puppet/manifest/site.pp + +Now add the following lines to install apache under puppetnode. + + node 'puppet-node' { + class { 'apache': } # use apache module + apache::vhost { 'example.com': # define vhost resource + port => '80', + docroot => '/var/www/html' + } + } + +Then we'll wanna save and exit it. Then, we'll wanna rerun the manifest to deploy the configuration to the agents for our infrastructure. + +### Conclusion ### + +Finally we have successfully installed puppet to manage our Server Infrastructure running Ubuntu 15.04 "Vivid Vervet" linux operating system. We learned how puppet works, configure a manifest configuration, communicate with nodes and deploy the manifest on the agent nodes with secure SSL certification. Controlling, managing and configuring repeated task in several N number of nodes is very easy with puppet open source software configuration management tool. If you have any questions, suggestions, feedback please write them in the comment box below so that we can improve or update our contents. Thank you ! Enjoy :-) + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/linux-how-to/install-puppet-ubuntu-15-04/ + +作者:[Arun Pyasi][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://linoxide.com/author/arunp/ +[1]:https://docs.puppetlabs.com/puppet/latest/reference/config_file_main.html \ No newline at end of file From 1093cce5b950327736eea1b94718c7864a58edaf Mon Sep 17 00:00:00 2001 From: XLCYun Date: Thu, 6 Aug 2015 12:29:08 +0800 Subject: [PATCH 825/965] Update 20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 1 - Introduction.md --- ...ktop--What They Get Right & Wrong - Page 1 - Introduction.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/translated/tech/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 1 - Introduction.md b/translated/tech/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 1 - Introduction.md index 39f29af147..582708f5a4 100644 --- a/translated/tech/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 1 - Introduction.md +++ b/translated/tech/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 1 - Introduction.md @@ -2,7 +2,7 @@ ================================================================================ *作者声明: 如果你是因为某种神迹而在没看标题的情况下点开了这篇文章,那么我想再重申一些东西...这是一篇评论文章。文中的观点都是我自己的,不代表Phoronix和Michael的观点。它们完全是我自己的想法。 -另外,没错……这可能是一篇引战的文章。我希望社团成员们更沉稳一些,因为我确实想在KDE和Gnome的社团上发起讨论,反馈。因此当我想指出——我所看到的——一个瑕疵时,我会尽量地做到具体而直接。这样,相关的讨论也能做到同样的具体和直接。再次声明:本文另一可选标题为“被[剪纸][1]千刀万剐”(原文剪纸一词为papercuts, 指易修复而烦人的漏洞,译者注)。 +另外,没错……这可能是一篇引战的文章。我希望社团成员们更沉稳一些,因为我确实想在KDE和Gnome的社团上发起讨论,反馈。因此当我想指出——我所看到的——一个瑕疵时,我会尽量地做到具体而直接。这样,相关的讨论也能做到同样的具体和直接。再次声明:本文另一可选标题为“被[细纸片][1]千刀万剐”(原文含paper cuts一词,指易修复但烦人的缺陷,译者注)。 现在,重申完毕……文章开始。 From 41b90d9bdfb996de4549c2bafa82a921844a8ed8 Mon Sep 17 00:00:00 2001 From: XLCYun Date: Thu, 6 Aug 2015 12:30:28 +0800 Subject: [PATCH 826/965] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E5=AE=8C=E6=88=90=20?= =?UTF-8?q?=E7=AC=AC=E4=BA=94=E8=8A=82=20XLCYun?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...Get Right & Wrong - Page 5 - Conclusion.md | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 translated/tech/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 5 - Conclusion.md diff --git a/translated/tech/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 5 - Conclusion.md b/translated/tech/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 5 - Conclusion.md new file mode 100644 index 0000000000..02ee7425fc --- /dev/null +++ b/translated/tech/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 5 - Conclusion.md @@ -0,0 +1,39 @@ +将GNOME作为我的Linux桌面的一周:他们做对的与做错的 - 第五节 - 总结 +================================================================================ +### 用户体验和最后想法 ### + +当Gnome 2.x和KDE 4.x要正面交锋时……我相当开心的跳到其中。我爱的东西它们有,恨的东西也有,但总的来说它们使用起来还算是一种乐趣。然后Gnome 3.x来了,带着一场Gnome Shell的戏剧。那时我就放弃了Gnome,我尽我所能的避开它。当时它对用户是不友好的,而且不直观,它打破了原有的设计典范,只为平板的统治世界做准备……而根据平板下跌的销量来看,这样的未来不可能实现。 + +Gnome 3后续发面了八个版本后,奇迹发生了。Gnome变得对对用户友好了。变得直观了。它完美吗?当然不了。我还是很讨厌它想推动的那种设计范例,我讨厌它总想把工作流(work flow)强加给我,但是在时间和耐心的作用下,这两都能被接受。只要你能够回头去看看Gnome Shell那外星人一样的界面,然后开始跟Gnome的其它部分(特别是控制中心)互动,你就能发现Gnome绝对做对了:细节。对细节的关注! + +人们能适应新的界面设计范例,能适应新的工作流——iPhone和iPad都证明了这一点——但真正一直让他们操心的是“纸片的割伤”(paper cuts,此处指易于修复但烦人的缺陷,译注)。 + +它带出了KDE和Gnome之间最重要的一个区别。Gnome感觉像一个产品。像一种非凡的体验。你用它的时候,觉得它是完整的,你要的东西都在你的指尖。它让人感觉就像是一个拥有windows或者OS X那样桌面体验的Linux桌面版:你要的都在里面,而且它是被同一个目标一致的团队中的同一个人写出来的。天,即使是一个应用程序发出的sudo请求都感觉是Gnome下的一个特意设计的部分,就像在Windows下的一样。而在KDE它就像是任何应用程序都能创建的那种随机外观的弹窗。它不像是以系统的一部分这样的正式身份停下来说“嘿,有个东西要请求管理员权限!你要给它吗?”。 + +KDE让人体验不到有凝聚力的体验。KDE像是在没有方向地打转,感觉没有完整的体验。它就像是一堆东西往不同的的方向移动,只不过恰好它们都有一个共同享有的工具包。如果开发者对此很开心,那么好吧,他们开心就好,但是如果他们想提供最好体验的话,那么就需要多关注那些小地方了。用户体验跟直观应当做为每一个应用程序的设计中心,应当有一个视野,知道KDE要提供什么——并且——知道它看起来应该是什么样的。 + +是不是有什么原因阻止我在KDE下使用Gnome磁盘管理? Rhythmbox? Evolution? 没有。没有。没有。但是这样说又错过了关键。Gnome和KDE都称它们为“桌面环境”。那么它们就应该是完整的环境,这意味着他们的各个部件应该汇集并紧密结合在一起,意味着你使用它们环境下的工具,因为它们说“您在一个完整的桌面中需要的任何东西,我们都支持。”说真的?只有Gnome看起来能符合完整的要求。KDE在“汇集在一起”这一方面感觉就像个半成品,更不用说提供“完整体验”中你所需要的东西。Gnome磁盘管理没有相应的对手——kpartionmanage要求ROOT权限。KDE不运行“首次用户注册”的过程(原文:No 'First Time User' run through.可能是指系统安装过程中KDE没有创建新用户的过程,译注) ,现在也不过是在Kubuntu下引入了一个用户管理器。老天,Gnome甚至提供了地图,笔记,日历和时钟应用。这些应用都是百分百要紧的吗?不,当然不了。但是正是这些应用帮助Gnome推动“Gnome是一种完整丰富的体验”的想法。 + +我吐槽的KDE问题并非不可能解决,决对不是这样的!但是它需要人去关心它。它需要开发者为他们的作品感到自豪,而不仅仅是为它们实现的功能而感到自豪——组织的价值可大了去了。别夺走用户设置选项的能力——GNOME 3.x就是因为缺乏配置选项的能力而为我所诟病,但别把“好吧,你想怎么设置就怎么设置,”作为借口而不提供任何理智的默认设置。默认设置是用户将看到的东西,它们是用户从打开软件的第一刻开始进行评判的关键。给用户留个好印象吧。 + +我知道KDE开发者们知道设计很重要,这也是为什么Visual Design Group(视觉设计团体)存在的原因,但是感觉好像他们没有让VDG充分发挥。所以KDE里存在组织上的缺陷。不是KDE没办法完整,不是它没办法汇集整合在一起然后解决衰败问题,只是开发者们没做到。他们瞄准了靶心……但是偏了。 + +还有,在任何人说这句话之前……千万别说“补丁很受欢迎啊"。因为当我开心的为个人提交补丁时,只要开发者坚持以他们喜欢的却不直观的方式干事,更多这样的烦事就会不断发生。这不关Muon有没有中心对齐。也不关Amarok的界面太丑。也不关每次我敲下快捷键后,弹出的音量和亮度调节窗口占用了我一大块的屏幕“房地产”(说真的,有人会去缩小这些东西)。 + +这跟心态的冷漠有关,跟开发者们在为他们的应用设计UI时根本就不多加思考有关。KDE团队做的东西都工作得很好。Amarok能播放音乐。Dragon能播放视频。Kwin或Qt和kdelibs似乎比Mutter/gtk更有力更效率(仅根本我的电池电量消耗计算。非科学性测试)。这些都很好,很重要……但是它们呈现的方式也很重要。甚至可以说,呈现方式是最重要的,因为它是用户看到的和与之交互的东西。 + +KDE应用开发者们……让VDG参与进来吧。让VDG审查并核准每一个”核心“应用,让一个VDG的UI/UX专家来设计应用的使用模式和使用流程,以此保证其直观性。真见鬼,不管你们在开发的是啥应用,仅仅把它的模型发到VDG论坛寻求反馈甚至都可能都能得到一些非常好的指点跟反馈。你有这么好的资源在这,现在赶紧用吧。 + +我不想说得好像我一点都不懂感恩。我爱KDE,我爱那些志愿者们为了给Linux用户一个可视化的桌面而付出的工作与努力,也爱可供选择的Gnome。正是因为我关心我才写这篇文章。因为我想看到更好的KDE,我想看到它走得比以前更加遥远。而这样做需要每个人继续努力,并且需要人们不再躲避批评。它需要人们对系统互动及系统崩溃的地方都保持诚实。如果我们不能直言批评,如果我们不说”这真垃圾!”,那么情况永远不会变好。 + +这周后我会继续使用Gnome吗?可能不,不。Gnome还在试着强迫我接受其工作流,而我不想追随,也不想遵循,因为我在使用它的时候感觉变得不够高效,因为它并不遵循我的思维模式。可是对于我的朋友们,当他们问我“我该用哪种桌面环境?”我可能会推荐Gnome,特别是那些不大懂技术,只要求“能工作”就行的朋友。根据目前KDE的形势来看,这可能是我能说出的最狠毒的评估了。 + +-------------------------------------------------------------------------------- + +via: http://www.phoronix.com/scan.php?page=article&item=gnome-week-editorial&num=5 + +作者:Eric Griffith +译者:[XLCYun](https://github.com/XLCYun) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 196acfe054a235f90dcbd8e99174c08d4c1eede9 Mon Sep 17 00:00:00 2001 From: XLCYun Date: Thu, 6 Aug 2015 13:12:55 +0800 Subject: [PATCH 827/965] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=8E=9F=E6=96=87=20?= =?UTF-8?q?=20XLCYun?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...Get Right & Wrong - Page 5 - Conclusion.md | 40 ------------------- 1 file changed, 40 deletions(-) delete mode 100644 sources/tech/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 5 - Conclusion.md diff --git a/sources/tech/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 5 - Conclusion.md b/sources/tech/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 5 - Conclusion.md deleted file mode 100644 index cf9028229d..0000000000 --- a/sources/tech/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 5 - Conclusion.md +++ /dev/null @@ -1,40 +0,0 @@ -Translating by XLCYun. -A Week With GNOME As My Linux Desktop: What They Get Right & Wrong - Page 5 - Conclusion -================================================================================ -### User Experience and Closing Thoughts ### - -When Gnome 2.x and KDE 4.x were going head to head.. I jumped between the two quite happily. Some things I loved, some things I hated, but over all they were both a pleasure to use. Then Gnome 3.x came around and all of the drama with Gnome Shell. I swore off Gnome and avoided it every chance I could. It wasn't user friendly, it was non-intuitive, it broke an establish paradigm in preparation for tablet's taking over the world... A future that, judging from the dropping sales of tablets, will never come. - -Eight releases of Gnome 3 later and the unimaginable happened. Gnome got user friendly. Gnome got intuitive. Is it perfect? Of course not. I still hate the paradigm it tries to push, I hate how it tries to force a work flow onto me, but both of those things can be gotten used to with time and patience. Once you have managed to look past Gnome Shell's alien appearance and you start interacting with it and the other parts of Gnome (Control Center especially) you see what Gnome has definitely gotten right: the little things. The attention to detail. - -People can adapt to new paradigms, people can adapt to new work flows-- the iPhone and iPad proved that-- but what will always bother them are the paper cuts. - -Which brings up an important distinction between KDE and Gnome. Gnome feels like a product. It feels like a singular experience. When you use it, it feels like it is complete and that everything you need is at your fingertips. It feel's like THE Linux desktop in the same way that Windows or OS X have THE desktop experience: what you need is there and it was all written by the same guys working on the same team towards the same goal. Hell, even an application prompting for sudo access feels like an intentional part of the desktop under Gnome, much the way that it is under Windows. In KDE it's just some random-looking window popup that any application could have created. It doesn't feel like a part of the system stopping and going "Hey! Something has requested administrative rights! Do you want to let it go through?" in an official capacity. - -KDE doesn't feel like cohesive experience. KDE doesn't feel like it has a direction its moving in, it doesn't feel like a full experience. KDE feels like its a bunch of pieces that are moving in a bunch of different directions, that just happen to have a shared toolkit beneath them. If that's what the developers are happy with, then fine, good for them, but if the developers still have the hope of offering the best experience possible then the little stuff needs to matter. The user experience and being intuitive needs to be at the forefront of every single application, there needs to be a vision of what KDE wants to offer -and- how it should look. - -Is there anything stopping me from using Gnome Disks under KDE? Rhythmbox? Evolution? Nope. Nope. Nope. But that misses the point. Gnome and KDE both market themselves as "Desktop Environments." They are supposed to be full -environments-, that means they all the pieces come and fit together, that you use that environment's tools because they are saying "We support everything you need to have a full desktop." Honestly? Only Gnome seems to fit the bill of being complete. KDE feel's half-finished when it comes to "coming together" part, let alone offering everything you need for a "full experience". There's no counterpart to Gnome Disks-- kpartitionmanager prompts for root. No "First Time User" run through, it just now got a user manager in Kubuntu. Hell, Gnome even provides a Maps, Notes, Calendar and Clock application. Do all of these applications matter 100%? No, of course not. But the fact that Gnome has them helps to push the idea that Gnome is a full and complete experience. - -My complaints about KDE are not impossible to fix, not by a long shot. But it requires people to care. It requires developers to take pride in their work beyond just function-- form counts for a whole hell of a lot. Don't take away the user's ability to configure things-- the lack of configuration is one of my biggest gripes with GNOME 3.x, but don't use "Well you can configure it however you want," as an excuse for not providing sane defaults. The defaults are what users are going to see, they are what the users are going to judge from the first moment they open your application. Make it a good impression. - -I know the KDE developers know design matters, that is WHY the Visual Design Group exists, but it feels like they aren't using the VDG to their fullest. And therein lies KDE's hamartia. It's not that KDE can't be complete, it's not that it can't come together and fix the downfalls, it just that they haven't. They aimed for the bulls eye... but they missed. - -And before anyone says it... Don't say "Patches are welcome." Because while I can happily submit patches for the individual annoyances more will just keep coming as developers keep on their marry way of doing things in non-intuitive ways. This isn't about Muon not being center-aligned. This isn't about Amarok having an ugly UI. This isn't about the volume and brightness pop-up notifiers taking up a large chunk of my screen real-estate every time I hit my hotkeys (seriously, someone shrink those things). - -This is about a mentality of apathy, this is about developers apparently not thinking things through when they make the UI for their applications. Everything the KDE Community does works fine. Amarok plays music. Dragon Player plays videos. Kwin / Qt & kdelibs is seemingly more power efficient than Mutter / gtk (according to my battery life times. Non-scientific testing). Those things are all well and good, and important.. but the presentation matters to. Arguably, the presentation matters the most because that is what user's see and interact with. - -To KDE application developers... Get the VDG involved. Make every single 'core' application get its design vetted and approved by the VDG, have a UI/UX expert from the VDG go through the usage patterns and usage flow of your application to make sure its intuitive. Hell, even just posting a mock up to the VDG forums and asking for feedback would probably get you some nice pointers and feedback for whatever application you're working on. You have this great resource there, now actually use them. - -I am not trying to sound ungrateful. I love KDE, I love the work and effort that volunteers put into giving Linux users a viable desktop, and an alternative to Gnome. And it is because I care that I write this article. Because I want to see KDE excel, I want to see it go further and farther than it has before. But doing that requires work on everyone's part, and it requires that people don't hold back criticism. It requires that people are honest about their interaction with the system and where it falls apart. If we can't give direct criticism, if we can't say "This sucks!" then it will never get better. - -Will I still use Gnome after this week? Probably not, no. Gnome still trying to force a work flow on me that I don't want to follow or abide by, I feel less productive when I'm using it because it doesn't follow my paradigm. For my friends though, when they ask me "What desktop environment should I use?" I'm probably going to recommend Gnome, especially if they are less technical users who want things to "just work." And that is probably the most damning assessment I could make in regards to the current state of KDE. - --------------------------------------------------------------------------------- - -via: http://www.phoronix.com/scan.php?page=article&item=gnome-week-editorial&num=5 - -作者:Eric Griffith -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 26ad573be26ca3f90eb97bea4fd591febb0c0c58 Mon Sep 17 00:00:00 2001 From: DeadFire Date: Thu, 6 Aug 2015 13:14:12 +0800 Subject: [PATCH 828/965] =?UTF-8?q?20150806-3=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ware Developer is a Great Career Choice.md | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 sources/talk/20150806 5 Reasons Why Software Developer is a Great Career Choice.md diff --git a/sources/talk/20150806 5 Reasons Why Software Developer is a Great Career Choice.md b/sources/talk/20150806 5 Reasons Why Software Developer is a Great Career Choice.md new file mode 100644 index 0000000000..0302c0b006 --- /dev/null +++ b/sources/talk/20150806 5 Reasons Why Software Developer is a Great Career Choice.md @@ -0,0 +1,50 @@ +5 Reasons Why Software Developer is a Great Career Choice +================================================================================ +This week I will give a presentation at a local high school on what it is like to work as a programmer. I am volunteering (through the organization [Transfer][1]) to come to schools and talk about what I work with. This school will have a technology theme day this week, and would like to hear what working in the technology sector is like. Since I develop software, that’s what I will talk about. One section will be on why I think a career in software development is great. The main reasons are: + +### 5 Reasons ### + +**1 Creative**. If you ask people to name creative jobs, chances are they will say things like writer, musician or painter. But few people know that software development is also very creative. It is almost by definition creative, since you create new functionality that didn’t exist before. The solutions can be expressed in many ways, both structurally and in the details. Often there are trade-offs to make (for example speed versus memory consumption). And of course the solution has to be correct. All this requires creativity. + +**2 Collaborative**. Another myth is that programmers sit alone at their computers and code all day. But software development is in fact almost always a team effort. You discuss programming problems and solutions with your colleagues, and discuss requirements and other issues with product managers, testers and customers. It is also telling that pair-programming (two developers programming together on one computer) is a popular practice. + +**3 In demand**. More and more in the world is using software, or as Marc Andreessen put it: “[Software is Eating the World][2]“. Even as there are more programmers (in Stockholm, programmer is now the [most common occupation][3]), demand is still outpacing supply. Software companies report that one of their greatest challenges is [finding good developers][4]. I regularly get contacted by recruiters trying to get me to change jobs. I don’t know of many other professions where employers compete for you like that. + +**4 Pays well**. Developing software can create a lot of value. There is no marginal cost to selling one extra copy of software you have already developed. This combined with the high demand for developers means that pay is quite good. There are of course occupations where you make more money, but compared to the general population, I think software developers are paid quite well. + +**5 Future proof**. Many jobs disappear, often because they can be replaced by computers and software. But all those new programs still need to be developed and maintained, so the outlook for programmers is quite good. + +### But… ### + +**What about outsourcing?** Won’t all software development be outsourced to countries where the salaries are much lower? This is an example of an idea that is better in theory than in practice (much like the [waterfall development methodology][5]). Software development is a discovery activity as much as a design activity. It benefits greatly from intense collaboration. Furthermore, especially when the main product is software, the knowledge gained when developing it is a competitive advantage. The easier that knowledge is shared within the whole company, the better it is. + +Another way to look at it is this. Outsourcing of software development has existed for quite a while now. Yet there is still high demand for local developers. So companies see benefits of hiring local developers that outweigh the higher costs. + +### How to Win ### + +There are many reasons why I think developing software is enjoyable (see also [Why I Love Coding][6]). But it is not for everybody. Fortunately it is quite easy to try programming out. There are innumerable resources on the web for learning to program. For example, both [Coursera][7] and [Udacity][8] have introductory courses. If you have never programmed, try one of the free courses or tutorials to get a feel for it. + +Finding something you really enjoy to do for a living has at least two benefits. First, since you do it every day, work will be much more fun than if you simply do something to make money. Second, if you really like it, you have a much better chance of getting good at it. I like the Venn diagram below (by [@eskimon][9]) on what constitutes a great job. Since programming pays relatively well, I think that if you like it, you have a good chance of ending up in the center of the diagram! + +![](https://henrikwarne1.files.wordpress.com/2014/12/career-planning.png) + +-------------------------------------------------------------------------------- + +via: http://henrikwarne.com/2014/12/08/5-reasons-why-software-developer-is-a-great-career-choice/ + +作者:[Henrik Warne][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://henrikwarne.com/ +[1]:http://www.transfer.nu/omoss/transferinenglish.jspx?pageId=23 +[2]:http://online.wsj.com/articles/SB10001424053111903480904576512250915629460 +[3]:http://www.di.se/artiklar/2014/6/12/jobbet-som-tar-over-landet/ +[4]:http://computersweden.idg.se/2.2683/1.600324/examinationstakten-racker-inte-for-branschens-behov +[5]:http://en.wikipedia.org/wiki/Waterfall_model +[6]:http://henrikwarne.com/2012/06/02/why-i-love-coding/ +[7]:https://www.coursera.org/ +[8]:https://www.udacity.com/ +[9]:https://eskimon.wordpress.com/about/ \ No newline at end of file From bb276ee6be7206faefab7041f6c150560987ca6b Mon Sep 17 00:00:00 2001 From: DeadFire Date: Thu, 6 Aug 2015 13:17:29 +0800 Subject: [PATCH 829/965] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=AF=91=E8=80=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... 5 Reasons Why Software Developer is a Great Career Choice.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/talk/20150806 5 Reasons Why Software Developer is a Great Career Choice.md b/sources/talk/20150806 5 Reasons Why Software Developer is a Great Career Choice.md index 0302c0b006..d24aa83983 100644 --- a/sources/talk/20150806 5 Reasons Why Software Developer is a Great Career Choice.md +++ b/sources/talk/20150806 5 Reasons Why Software Developer is a Great Career Choice.md @@ -1,3 +1,4 @@ +Translating by MousyCoder 5 Reasons Why Software Developer is a Great Career Choice ================================================================================ This week I will give a presentation at a local high school on what it is like to work as a programmer. I am volunteering (through the organization [Transfer][1]) to come to schools and talk about what I work with. This school will have a technology theme day this week, and would like to hear what working in the technology sector is like. Since I develop software, that’s what I will talk about. One section will be on why I think a career in software development is great. The main reasons are: From 16f5b9676503cfc9ed1702e9ebf8e98bf89c32cc Mon Sep 17 00:00:00 2001 From: wxy Date: Thu, 6 Aug 2015 15:03:05 +0800 Subject: [PATCH 830/965] PUB:20150727 Easy Backup Restore and Migrate Containers in Docker @GOLinux --- ...estore and Migrate Containers in Docker.md | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) rename {translated/tech => published}/20150727 Easy Backup Restore and Migrate Containers in Docker.md (61%) diff --git a/translated/tech/20150727 Easy Backup Restore and Migrate Containers in Docker.md b/published/20150727 Easy Backup Restore and Migrate Containers in Docker.md similarity index 61% rename from translated/tech/20150727 Easy Backup Restore and Migrate Containers in Docker.md rename to published/20150727 Easy Backup Restore and Migrate Containers in Docker.md index 420430cca8..7d2d5f26d8 100644 --- a/translated/tech/20150727 Easy Backup Restore and Migrate Containers in Docker.md +++ b/published/20150727 Easy Backup Restore and Migrate Containers in Docker.md @@ -1,32 +1,32 @@ 无忧之道:Docker中容器的备份、恢复和迁移 ================================================================================ -今天,我们将学习如何快速地对docker容器进行快捷备份、恢复和迁移。[Docker][1]是一个开源平台,用于自动化部署应用,以通过快捷的途径在称之为容器的轻量级软件层下打包、发布和运行这些应用。它使得应用平台独立,因为它扮演了Linux上一个额外的操作系统级虚拟化的自动化抽象层。它通过其组件cgroups和命名空间利用Linux内核的资源分离特性,达到避免虚拟机开销的目的。它使得用于部署和扩展web应用、数据库和后端服务的大规模构建块无需依赖于特定的堆栈或供应者。 +今天,我们将学习如何快速地对docker容器进行快捷备份、恢复和迁移。[Docker][1]是一个开源平台,用于自动化部署应用,以通过快捷的途径在称之为容器的轻量级软件层下打包、发布和运行这些应用。它使得应用平台独立,因为它扮演了Linux上一个额外的操作系统级虚拟化的自动化抽象层。它通过其组件cgroups和命名空间利用Linux内核的资源分离特性,达到避免虚拟机开销的目的。它使得用于部署和扩展web应用、数据库和后端服务的大规模构建组件无需依赖于特定的堆栈或供应者。 -所谓的容器,就是那些创建自Docker镜像的软件层,它包含了独立的Linux文件系统和开箱即用的应用程序。如果我们有一个在盒子中运行着的Docker容器,并且想要备份这些容器以便今后使用,或者想要迁移这些容器,那么,本教程将帮助你掌握在Linux操作系统中备份、恢复和迁移Docker容器。 +所谓的容器,就是那些创建自Docker镜像的软件层,它包含了独立的Linux文件系统和开箱即用的应用程序。如果我们有一个在机器中运行着的Docker容器,并且想要备份这些容器以便今后使用,或者想要迁移这些容器,那么,本教程将帮助你掌握在Linux操作系统中备份、恢复和迁移Docker容器的方法。 我们怎样才能在Linux中备份、恢复和迁移Docker容器呢?这里为您提供了一些便捷的步骤。 ### 1. 备份容器 ### -首先,为了备份Docker中的容器,我们会想看看我们想要备份的容器列表。要达成该目的,我们需要在我们运行这Docker引擎,并已创建了容器的Linux机器中运行 docker ps 命令。 +首先,为了备份Docker中的容器,我们会想看看我们想要备份的容器列表。要达成该目的,我们需要在我们运行着Docker引擎,并已创建了容器的Linux机器中运行 docker ps 命令。 # docker ps ![Docker Containers List](http://blog.linoxide.com/wp-content/uploads/2015/07/docker-containers-list.png) -在此之后,我们要选择我们想要备份的容器,然后我们会去创建该容器的快照。我们可以使用 docker commit 命令来创建快照。 +在此之后,我们要选择我们想要备份的容器,然后去创建该容器的快照。我们可以使用 docker commit 命令来创建快照。 # docker commit -p 30b8f18f20b4 container-backup ![Docker Commit](http://blog.linoxide.com/wp-content/uploads/2015/07/docker-commit.png) -该命令会生成一个作为Docker镜像的容器快照,我们可以通过运行 docker images 命令来查看Docker镜像,如下。 +该命令会生成一个作为Docker镜像的容器快照,我们可以通过运行 `docker images` 命令来查看Docker镜像,如下。 # docker images ![Docker Images](http://blog.linoxide.com/wp-content/uploads/2015/07/docker-images.png) -正如我们所看见的,上面做的快照已经作为Docker镜像保存了。现在,为了备份该快照,我们有两个选择,一个是我们可以登陆进Docker注册中心,并推送该镜像;另一个是我们可以将Docker镜像打包成tarball备份,以供今后使用。 +正如我们所看见的,上面做的快照已经作为Docker镜像保存了。现在,为了备份该快照,我们有两个选择,一个是我们可以登录进Docker注册中心,并推送该镜像;另一个是我们可以将Docker镜像打包成tar包备份,以供今后使用。 如果我们想要在[Docker注册中心][2]上传或备份镜像,我们只需要运行 docker login 命令来登录进Docker注册中心,然后推送所需的镜像即可。 @@ -39,23 +39,23 @@ ![Docker Push](http://blog.linoxide.com/wp-content/uploads/2015/07/docker-push.png) -如果我们不想备份到docker注册中心,而是想要将此镜像保存在本地机器中,以供日后使用,那么我们可以将其作为tarball备份。要完成该操作,我们需要运行以下 docker save 命令。 +如果我们不想备份到docker注册中心,而是想要将此镜像保存在本地机器中,以供日后使用,那么我们可以将其作为tar包备份。要完成该操作,我们需要运行以下 `docker save` 命令。 # docker save -o ~/container-backup.tar container-backup ![taking tarball backup](http://blog.linoxide.com/wp-content/uploads/2015/07/taking-tarball-backup.png) -要验证tarball时候已经生成,我们只需要在保存tarball的目录中运行 ls 命令。 +要验证tar包是否已经生成,我们只需要在保存tar包的目录中运行 ls 命令即可。 ### 2. 恢复容器 ### -接下来,在我们成功备份了我们的Docker容器后,我们现在来恢复这些被快照成Docker镜像的容器。如果我们已经在注册中心推送了这些Docker镜像,那么我们仅仅需要把那个Docker镜像拖回并直接运行即可。 +接下来,在我们成功备份了我们的Docker容器后,我们现在来恢复这些制作了Docker镜像快照的容器。如果我们已经在注册中心推送了这些Docker镜像,那么我们仅仅需要把那个Docker镜像拖回并直接运行即可。 # docker pull arunpyasi/container-backup:test ![Docker Pull](http://blog.linoxide.com/wp-content/uploads/2015/07/docker-pull.png) -但是,如果我们将这些Docker镜像作为tarball文件备份到了本地,那么我们只要使用 docker load 命令,后面加上tarball的备份路径,就可以加载该Docker镜像了。 +但是,如果我们将这些Docker镜像作为tar包文件备份到了本地,那么我们只要使用 docker load 命令,后面加上tar包的备份路径,就可以加载该Docker镜像了。 # docker load -i ~/container-backup.tar @@ -63,7 +63,7 @@ # docker images -在镜像被加载后,我们将从加载的镜像去运行Docker容器。 +在镜像被加载后,我们将用加载的镜像去运行Docker容器。 # docker run -d -p 80:80 container-backup @@ -71,11 +71,11 @@ ### 3. 迁移Docker容器 ### -迁移容器同时涉及到了上面两个操作,备份和恢复。我们可以将任何一个Docker容器从一台机器迁移到另一台机器。在迁移过程中,首先我们将容器的备份作为快照Docker镜像。然后,该Docker镜像或者是被推送到了Docker注册中心,或者被作为tarball文件保存到了本地。如果我们将镜像推送到了Docker注册中心,我们简单地从任何我们想要的机器上使用 docker run 命令来恢复并运行该容器。但是,如果我们将镜像打包成tarball备份到了本地,我们只需要拷贝或移动该镜像到我们想要的机器上,加载该镜像并运行需要的容器即可。 +迁移容器同时涉及到了上面两个操作,备份和恢复。我们可以将任何一个Docker容器从一台机器迁移到另一台机器。在迁移过程中,首先我们将把容器备份为Docker镜像快照。然后,该Docker镜像或者是被推送到了Docker注册中心,或者被作为tar包文件保存到了本地。如果我们将镜像推送到了Docker注册中心,我们简单地从任何我们想要的机器上使用 docker run 命令来恢复并运行该容器。但是,如果我们将镜像打包成tar包备份到了本地,我们只需要拷贝或移动该镜像到我们想要的机器上,加载该镜像并运行需要的容器即可。 ### 尾声 ### -最后,我们已经学习了如何快速地备份、恢复和迁移Docker容器,本教程适用于各个成功运行Docker的操作系统平台。真的,Docker是一个相当简单易用,然而功能却十分强大的工具。它的命令相当易记,这些命令都非常短,带有许多简单而强大的标记和参数。上面的方法让我们备份容器时很是安逸,使得我们可以在日后很轻松地恢复它们。这会帮助我们恢复我们的容器和镜像,即便主机系统崩溃,甚至意外地被清除。如果你还有很多问题、建议、反馈,请在下面的评论框中写出来吧,可以帮助我们改进或更新我们的内容。谢谢大家!享受吧 :-) +最后,我们已经学习了如何快速地备份、恢复和迁移Docker容器,本教程适用于各个可以成功运行Docker的操作系统平台。真的,Docker是一个相当简单易用,然而功能却十分强大的工具。它的命令相当易记,这些命令都非常短,带有许多简单而强大的标记和参数。上面的方法让我们备份容器时很是安逸,使得我们可以在日后很轻松地恢复它们。这会帮助我们恢复我们的容器和镜像,即便主机系统崩溃,甚至意外地被清除。如果你还有很多问题、建议、反馈,请在下面的评论框中写出来吧,可以帮助我们改进或更新我们的内容。谢谢大家!享受吧 :-) -------------------------------------------------------------------------------- @@ -83,7 +83,7 @@ via: http://linoxide.com/linux-how-to/backup-restore-migrate-containers-docker/ 作者:[Arun Pyasi][a] 译者:[GOLinux](https://github.com/GOLinux) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From f6f0cfde12d224b51ddcb416a18d01626351c94d Mon Sep 17 00:00:00 2001 From: DeadFire Date: Thu, 6 Aug 2015 15:06:17 +0800 Subject: [PATCH 831/965] =?UTF-8?q?20150806-4=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...minism and increasing diversity in tech.md | 81 +++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 sources/talk/20150806 Torvalds 2.0--Patricia Torvalds on computing college feminism and increasing diversity in tech.md diff --git a/sources/talk/20150806 Torvalds 2.0--Patricia Torvalds on computing college feminism and increasing diversity in tech.md b/sources/talk/20150806 Torvalds 2.0--Patricia Torvalds on computing college feminism and increasing diversity in tech.md new file mode 100644 index 0000000000..36f5642c10 --- /dev/null +++ b/sources/talk/20150806 Torvalds 2.0--Patricia Torvalds on computing college feminism and increasing diversity in tech.md @@ -0,0 +1,81 @@ +Torvalds 2.0: Patricia Torvalds on computing, college, feminism, and increasing diversity in tech +================================================================================ +![Image by : Photo by Becky Svartström. Modified by Opensource.com. CC BY-SA 4.0](http://opensource.com/sites/default/files/styles/image-full-size/public/images/life/osdc-lead-patriciatorvalds.png) +Image by : Photo by Becky Svartström. Modified by Opensource.com. [CC BY-SA 4.0][1] + +Patricia Torvalds isn't the Torvalds name that pops up in Linux and open source circles. Yet. + +![](http://opensource.com/sites/default/files/images/life-uploads/ptorvalds.png) + +At 18, Patricia is a feminist with a growing list of tech achievements, open source industry experience, and her sights set on diving into her freshman year of college at Duke University's Pratt School of Engineering. She works for [Puppet Labs][2] in Portland, Oregon, as an intern, but soon she'll head to Durham, North Carolina, to start the fall semester of college. + +In this exclusive interview, Patricia explains what got her interested in computer science and engineering (spoiler alert: it wasn't her father), what her high school did "right" with teaching tech, the important role feminism plays in her life, and her thoughts on the lack of diversity in technology. + +![](http://opensource.com/sites/default/files/images/life/Interview%20banner%20Q%26A.png) + +### What made you interested in studying computer science and engineering? ### + +My interest in tech really grew throughout high school. I wanted to go into biology for a while, until around my sophomore year. I had a web design internship at the Portland VA after my sophomore year. And I took an engineering class called Exploratory Ventures, which sent an ROV into the Pacific ocean late in my sophomore year, but the turning point was probably when I was named a regional winner and national runner up for the [NCWIT Aspirations in Computing][3] award halfway through my junior year. + +The award made me feel validated in my interest, of course, but I think the most important part of it was getting to join a Facebook group for all the award winners. The girls who have won the award are absolutely incredible and so supportive of each other. I was definitely interested in computer science before I won the award, because of my work in XV and at the VA, but having these girls to talk to solidified my interest and has kept it really strong. Teaching XV—more on that later—my junior and senior year, also, made engineering and computer science really fun for me. + +### What do you plan to study? And do you already know what you want to do after college? ### + +I hope to major in either Mechanical or Electrical and Computer Engineering as well as Computer Science, and minor in Women's Studies. After college, I hope to work for a company that supports or creates technology for social good, or start my own company. + +### My daughter had one high school programming class—Visual Basic. She was the only girl in her class, and she ended up getting harassed and having a miserable experience. What was your experience like? ### + +My high school began offering computer science classes my senior year, and I took Visual Basic as well! The class wasn't bad, but I was definitely one of three or four girls in the class of 20 or so students. Other computing classes seemed to have similar gender breakdowns. However, my high school was extremely small and the teacher was supportive of inclusivity in tech, so there was no harassment that I noticed. Hopefully the classes become more diverse in future years. + +### What did your schools do right technology-wise? And how could they have been better? ### + +My high school gave us consistent access to computers, and teachers occasionally assigned technology-based assignments in unrelated classes—we had to create a website for a social studies class a few times—which I think is great because it exposes everyone to tech. The robotics club was also pretty active and well-funded, but fairly small; I was not a member. One very strong component of the school's technology/engineering program is actually a student-taught engineering class called Exploratory Ventures, which is a hands-on class that tackles a new engineering or computer science problem every year. I taught it for two years with a classmate of mine, and have had students come up to me and tell me they're interested in pursuing engineering or computer science as a result of the class. + +However, my high school was not particularly focused on deliberately including young women in these programs, and it isn't very racially diverse. The computing-based classes and clubs were, by a vast majority, filled with white male students. This could definitely be improved on. + +### Growing up, how did you use technology at home? ### + +Honestly, when I was younger I used my computer time (my dad created a tracker, which logged us off after an hour of Internet use) to play Neopets or similar games. I guess I could have tried to mess with the tracker or played on the computer without Internet use, but I just didn't. I sometimes did little science projects with my dad, and I remember once printing "Hello world" in the terminal with him a thousand times, but mostly I just played online games with my sisters and didn't get my start in computing until high school. + +### You were active in the Feminism Club at your high school. What did you learn from that experience? What feminist issues are most important to you now? ### + +My friend and I co-founded Feminism Club at our high school late in our sophomore year. We did receive lots of resistance to the club at first, and while that never entirely went away, by the time we graduated feminist ideals were absolutely a part of the school's culture. The feminist work we did at my high school was generally on a more immediate scale and focused on issues like the dress code. + +Personally, I'm very focused on intersectional feminism, which is feminism as it applies to other aspects of oppression like racism and classism. The Facebook page [Guerrilla Feminism][4] is a great example of an intersectional feminism and has done so much to educate me. I currently run the Portland branch. + +Feminism is also important to me in terms of diversity in tech, although as an upper-class white woman with strong connections in the tech world, the problems here affect me much less than they do other people. The same goes for my involvement in intersectional feminism. Publications like [Model View Culture][5] are very inspiring to me, and I admire Shanley Kane so much for what she does. + +### What advice would you give parents who want to teach their children how to program? ### + +Honestly, nobody ever pushed me into computer science or engineering. Like I said, for a long time I wanted to be a geneticist. I got a summer internship doing web design for the VA the summer after my sophomore year and totally changed my mind. So I don't know if I can fully answer that question. + +I do think genuine interest is important, though. If my dad had sat me down in front of the computer and told me to configure a webserver when I was 12, I don't think I'd be interested in computer science. Instead, my parents gave me a lot of free reign to do what I wanted, which was mostly coding terrible little HTML sites for my Neopets. Neither of my younger sisters are interested in engineering or computer science, and my parents don't care. I'm really lucky my parents have given me and my sisters the encouragement and resources to explore our interests. + +Still, I grew up saying my future career would be "like my dad's"—even when I didn't know what he did. He has a pretty cool job. Also, one time when I was in middle school, I told him that and he got a little choked up and said I wouldn't think that in high school. So I guess that motivated me a bit. + +### What suggestions do you have for leaders in open source communities to help them attract and maintain a more diverse mix of contributors? ### + +I'm actually not active in particular open source communities. I feel much more comfortable discussing computing with other women; I'm a member of the [NCWIT Aspirations in Computing][6] network and it's been one of the most important aspects of my continued interest in technology, as well as the Facebook group [Ladies Storm Hackathons][7]. + +I think this applies well to attracting and maintaining a talented and diverse mix of contributors: Safe spaces are important. I have seen the misogynistic and racist comments made in some open source communities, and subsequent dismissals when people point out the issues. I think that in maintaining a professional community there have to be strong standards on what constitutes harassment or inappropriate conduct. Of course, people can—and will—have a variety of opinions on what they should be able to express in open source communities, or any community. However, if community leaders actually want to attract and maintain diverse talent, they need to create a safe space and hold community members to high standards. + +I also think that some community leaders just don't value diversity. It's really easy to argue that tech is a meritocracy, and the reason there are so few marginalized people in tech is just that they aren't interested, and that the problem comes from earlier on in the pipeline. They argue that if someone is good enough at their job, their gender or race or sexual orientation doesn't matter. That's the easy argument. But I was raised not to make excuses for mistakes. And I think the lack of diversity is a mistake, and that we should be taking responsibility for it and actively trying to make it better. + +-------------------------------------------------------------------------------- + +via: http://opensource.com/life/15/8/patricia-torvalds-interview + +作者:[Rikki Endsley][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://opensource.com/users/rikki-endsley +[1]:https://creativecommons.org/licenses/by-sa/4.0/ +[2]:https://puppetlabs.com/ +[3]:https://www.aspirations.org/ +[4]:https://www.facebook.com/guerrillafeminism +[5]:https://modelviewculture.com/ +[6]:https://www.aspirations.org/ +[7]:https://www.facebook.com/groups/LadiesStormHackathons/ \ No newline at end of file From 60edce17ba50fa21a0caec3f4350b3b79c249e6b Mon Sep 17 00:00:00 2001 From: DeadFire Date: Thu, 6 Aug 2015 16:05:07 +0800 Subject: [PATCH 832/965] =?UTF-8?q?20150806-5=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...witch for debugging and troubleshooting.md | 69 ++++++++++++++++++ ...or--No module named wxversion' on Linux.md | 49 +++++++++++++ ...th Answers--How to install git on Linux.md | 72 +++++++++++++++++++ 3 files changed, 190 insertions(+) create mode 100644 sources/tech/20150806 Linux FAQs with Answers--How to enable logging in Open vSwitch for debugging and troubleshooting.md create mode 100644 sources/tech/20150806 Linux FAQs with Answers--How to fix 'ImportError--No module named wxversion' on Linux.md create mode 100644 sources/tech/20150806 Linux FAQs with Answers--How to install git on Linux.md diff --git a/sources/tech/20150806 Linux FAQs with Answers--How to enable logging in Open vSwitch for debugging and troubleshooting.md b/sources/tech/20150806 Linux FAQs with Answers--How to enable logging in Open vSwitch for debugging and troubleshooting.md new file mode 100644 index 0000000000..2b4e16bcaf --- /dev/null +++ b/sources/tech/20150806 Linux FAQs with Answers--How to enable logging in Open vSwitch for debugging and troubleshooting.md @@ -0,0 +1,69 @@ +Linux FAQs with Answers--How to enable logging in Open vSwitch for debugging and troubleshooting +================================================================================ +> **Question:** I am trying to troubleshoot my Open vSwitch deployment. For that I would like to inspect its debug messages generated by its built-in logging mechanism. How can I enable logging in Open vSwitch, and change its logging level (e.g., to INFO/DEBUG level) to check more detailed debug information? + +Open vSwitch (OVS) is the most popular open-source implementation of virtual switch on the Linux platform. As the today's data centers increasingly rely on the software-defined network (SDN) architecture, OVS is fastly adopted as the de-facto standard network element in data center's SDN deployments. + +Open vSwitch has a built-in logging mechanism called VLOG. The VLOG facility allows one to enable and customize logging within various components of the switch. The logging information generated by VLOG can be sent to a combination of console, syslog and a separate log file for inspection. You can configure OVS logging dynamically at run-time with a command-line tool called `ovs-appctl`. + +![](https://farm1.staticflickr.com/499/19300367114_cd8aac2fb2_c.jpg) + +Here is how to enable logging and customize logging levels in Open vSwitch with `ovs-appctl`. + +The syntax of `ovs-appctl` to customize VLOG is as follows. + + $ sudo ovs-appctl vlog/set module[:facility[:level]] + +- **Module**: name of any valid component in OVS (e.g., netdev, ofproto, dpif, vswitchd, and many others) +- **Facility**: destination of logging information (must be: console, syslog or file) +- **Level**: verbosity of logging (must be: emer, err, warn, info, or dbg) + +In OVS source code, module name is defined in each source file in the form of: + + VLOG_DEFINE_THIS_MODULE(); + +For example, in lib/netdev.c, you will see: + + VLOG_DEFINE_THIS_MODULE(netdev); + +which indicates that lib/netdev.c is part of netdev module. Any logging messages generated in lib/netdev.c will belong to netdev module. + +In OVS source code, there are multiple severity levels used to define several different kinds of logging messages: VLOG_INFO() for informational, VLOG_WARN() for warning, VLOG_ERR() for error, VLOG_DBG() for debugging, VLOG_EMERG for emergency. Logging level and facility determine which logging messages are sent where. + +To see a full list of available modules, facilities, and their respective logging levels, run the following commands. This command must be invoked after you have started OVS. + + $ sudo ovs-appctl vlog/list + +![](https://farm1.staticflickr.com/465/19734939478_7eb5d44635_c.jpg) + +The output shows the debug levels of each module for three different facilities (console, syslog, file). By default, all modules have their logging level set to INFO. + +Given any one OVS module, you can selectively change the debug level of any particular facility. For example, if you want to see more detailed debug messages of dpif module at the console screen, run the following command. + + $ sudo ovs-appctl vlog/set dpif:console:dbg + +You will see that dpif module's console facility has changed its logging level to DBG. The logging level of two other facilities, syslog and file, remains unchanged. + +![](https://farm1.staticflickr.com/333/19896760146_5d851311ae_c.jpg) + +If you want to change the logging level for all modules, you can specify "ANY" as the module name. For example, the following command will change the console logging level of every module to DBG. + + $ sudo ovs-appctl vlog/set ANY:console:dbg + +![](https://farm1.staticflickr.com/351/19734939828_8c7f59e404_c.jpg) + +Also, if you want to change the logging level of all three facilities at once, you can specify "ANY" as the facility name. For example, the following command will change the logging level of all facilities for every module to DBG. + + $ sudo ovs-appctl vlog/set ANY:ANY:dbg + +-------------------------------------------------------------------------------- + +via: http://ask.xmodulo.com/enable-logging-open-vswitch.html + +作者:[Dan Nanni][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://ask.xmodulo.com/author/nanni \ No newline at end of file diff --git a/sources/tech/20150806 Linux FAQs with Answers--How to fix 'ImportError--No module named wxversion' on Linux.md b/sources/tech/20150806 Linux FAQs with Answers--How to fix 'ImportError--No module named wxversion' on Linux.md new file mode 100644 index 0000000000..11d814d8f4 --- /dev/null +++ b/sources/tech/20150806 Linux FAQs with Answers--How to fix 'ImportError--No module named wxversion' on Linux.md @@ -0,0 +1,49 @@ +Linux FAQs with Answers--How to fix “ImportError: No module named wxversion” on Linux +================================================================================ +> **Question:** I was trying to run a Python application on [insert your Linux distro], but I got an error "ImportError: No module named wxversion." How can I solve this error in the Python program? + + Looking for python... 2.7.9 - Traceback (most recent call last): + File "/home/dev/playonlinux/python/check_python.py", line 1, in + import os, wxversion + ImportError: No module named wxversion + failed tests + +This error indicates that your Python application is GUI-based, relying on a missing Python module called wxPython. [wxPython][1] is a Python extension module for the wxWidgets GUI library, popularly used by C++ programmers to design GUI applications. The wxPython extension allows Python developers to easily design and integrate GUI within any Python application. + +To solve this import error, you need to install wxPython on your Linux, as described below. + +### Install wxPython on Debian, Ubuntu or Linux Mint ### + + $ sudo apt-get install python-wxgtk2.8 + +### Install wxPython on Fedora ### + + $ sudo yum install wxPython + +### Install wxPython on CentOS/RHEL ### + +wxPython is available on the EPEL repository of CentOS/RHEL, not on base repositories. Thus, first [enable EPEL repository][2] on your system, and then use yum command. + + $ sudo yum install wxPython + +### Install wxPython on Arch Linux ### + + $ sudo pacman -S wxpython + +### Install wxPython on Gentoo ### + + $ emerge wxPython + +-------------------------------------------------------------------------------- + +via: http://ask.xmodulo.com/importerror-no-module-named-wxversion.html + +作者:[Dan Nanni][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://ask.xmodulo.com/author/nanni +[1]:http://wxpython.org/ +[2]:http://xmodulo.com/how-to-set-up-epel-repository-on-centos.html \ No newline at end of file diff --git a/sources/tech/20150806 Linux FAQs with Answers--How to install git on Linux.md b/sources/tech/20150806 Linux FAQs with Answers--How to install git on Linux.md new file mode 100644 index 0000000000..c5c34f3a72 --- /dev/null +++ b/sources/tech/20150806 Linux FAQs with Answers--How to install git on Linux.md @@ -0,0 +1,72 @@ +Linux FAQs with Answers--How to install git on Linux +================================================================================ +> **Question:** I am trying to clone a project from a public Git repository, but I am getting "git: command not found" error. How can I install git on [insert your Linux distro]? + +Git is a popular open-source version control system (VCS) originally developed for Linux environment. Contrary to other VCS tools like CVS or SVN, Git's revision control is considered "distributed" in a sense that your local Git working directory can function as a fully-working repository with complete history and version-tracking capabilities. In this model, each collaborator commits to his or her local repository (as opposed to always committing to a central repository), and optionally push to a centralized repository if need be. This brings in scalability and redundancy to the revision control system, which is a must in any kind of large-scale collaboration. + +![](https://farm1.staticflickr.com/341/19433194168_c79d4570aa_b.jpg) + +### Install Git with a Package Manager ### + +Git is shipped with all major Linux distributions. Thus the easiest way to install Git is by using your Linux distro's package manager. + +**Debian, Ubuntu, or Linux Mint** + + $ sudo apt-get install git + +**Fedora, CentOS or RHEL** + + $ sudo yum install git + +**Arch Linux** + + $ sudo pacman -S git + +**OpenSUSE** + + $ sudo zypper install git + +**Gentoo** + + $ emerge --ask --verbose dev-vcs/git + +### Install Git from the Source ### + +If for whatever reason you want to built Git from the source, you can follow the instructions below. + +**Install Dependencies** + +Before building Git, first install dependencies. + +**Debian, Ubuntu or Linux** + + $ sudo apt-get install libcurl4-gnutls-dev libexpat1-dev gettext libz-dev libssl-dev asciidoc xmlto docbook2x + +**Fedora, CentOS or RHEL** + + $ sudo yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel asciidoc xmlto docbook2x + +#### Compile Git from the Source #### + +Download the latest release of Git from [https://github.com/git/git/releases][1]. Then build and install Git under /usr as follows. + +Note that if you want to install it under a different directory (e.g., /opt), replace "--prefix=/usr" in configure command with something else. + + $ cd git-x.x.x + $ make configure + $ ./configure --prefix=/usr + $ make all doc info + $ sudo make install install-doc install-html install-info + +-------------------------------------------------------------------------------- + +via: http://ask.xmodulo.com/install-git-linux.html + +作者:[Dan Nanni][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://ask.xmodulo.com/author/nanni +[1]:https://github.com/git/git/releases \ No newline at end of file From c709912c2c77d4f618418743de6b1eae007c76f6 Mon Sep 17 00:00:00 2001 From: KS Date: Thu, 6 Aug 2015 16:11:10 +0800 Subject: [PATCH 833/965] Update 20150803 Managing Linux Logs.md --- sources/tech/20150803 Managing Linux Logs.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150803 Managing Linux Logs.md b/sources/tech/20150803 Managing Linux Logs.md index d68adddf52..e317a63253 100644 --- a/sources/tech/20150803 Managing Linux Logs.md +++ b/sources/tech/20150803 Managing Linux Logs.md @@ -1,3 +1,4 @@ +wyangsun translating Managing Linux Logs ================================================================================ A key best practice for logging is to centralize or aggregate your logs in one place, especially if you have multiple servers or tiers in your architecture. We’ll tell you why this is a good idea and give tips on how to do it easily. @@ -415,4 +416,4 @@ via: http://www.loggly.com/ultimate-guide/logging/managing-linux-logs/ [19]:http://www.infoworld.com/article/2614204/data-center/puppet-or-chef--the-configuration-management-dilemma.html [20]:http://www.zdnet.com/article/what-is-docker-and-why-is-it-so-darn-popular/ [21]:https://github.com/progrium/logspout -[22]:https://www.loggly.com/docs/sending-logs-unixlinux-system-setup/ \ No newline at end of file +[22]:https://www.loggly.com/docs/sending-logs-unixlinux-system-setup/ From 5a078ed4770c650a2fdc78eab7798b37ae4a8df4 Mon Sep 17 00:00:00 2001 From: mousycoder Date: Thu, 6 Aug 2015 18:54:15 +0800 Subject: [PATCH 834/965] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ware Developer is a Great Career Choice.md | 51 ----------- ...ware Developer is a Great Career Choice.md | 91 +++++++++++++++++++ 2 files changed, 91 insertions(+), 51 deletions(-) delete mode 100644 sources/talk/20150806 5 Reasons Why Software Developer is a Great Career Choice.md create mode 100644 translated/talk/20150806 5 Reasons Why Software Developer is a Great Career Choice.md diff --git a/sources/talk/20150806 5 Reasons Why Software Developer is a Great Career Choice.md b/sources/talk/20150806 5 Reasons Why Software Developer is a Great Career Choice.md deleted file mode 100644 index d24aa83983..0000000000 --- a/sources/talk/20150806 5 Reasons Why Software Developer is a Great Career Choice.md +++ /dev/null @@ -1,51 +0,0 @@ -Translating by MousyCoder -5 Reasons Why Software Developer is a Great Career Choice -================================================================================ -This week I will give a presentation at a local high school on what it is like to work as a programmer. I am volunteering (through the organization [Transfer][1]) to come to schools and talk about what I work with. This school will have a technology theme day this week, and would like to hear what working in the technology sector is like. Since I develop software, that’s what I will talk about. One section will be on why I think a career in software development is great. The main reasons are: - -### 5 Reasons ### - -**1 Creative**. If you ask people to name creative jobs, chances are they will say things like writer, musician or painter. But few people know that software development is also very creative. It is almost by definition creative, since you create new functionality that didn’t exist before. The solutions can be expressed in many ways, both structurally and in the details. Often there are trade-offs to make (for example speed versus memory consumption). And of course the solution has to be correct. All this requires creativity. - -**2 Collaborative**. Another myth is that programmers sit alone at their computers and code all day. But software development is in fact almost always a team effort. You discuss programming problems and solutions with your colleagues, and discuss requirements and other issues with product managers, testers and customers. It is also telling that pair-programming (two developers programming together on one computer) is a popular practice. - -**3 In demand**. More and more in the world is using software, or as Marc Andreessen put it: “[Software is Eating the World][2]“. Even as there are more programmers (in Stockholm, programmer is now the [most common occupation][3]), demand is still outpacing supply. Software companies report that one of their greatest challenges is [finding good developers][4]. I regularly get contacted by recruiters trying to get me to change jobs. I don’t know of many other professions where employers compete for you like that. - -**4 Pays well**. Developing software can create a lot of value. There is no marginal cost to selling one extra copy of software you have already developed. This combined with the high demand for developers means that pay is quite good. There are of course occupations where you make more money, but compared to the general population, I think software developers are paid quite well. - -**5 Future proof**. Many jobs disappear, often because they can be replaced by computers and software. But all those new programs still need to be developed and maintained, so the outlook for programmers is quite good. - -### But… ### - -**What about outsourcing?** Won’t all software development be outsourced to countries where the salaries are much lower? This is an example of an idea that is better in theory than in practice (much like the [waterfall development methodology][5]). Software development is a discovery activity as much as a design activity. It benefits greatly from intense collaboration. Furthermore, especially when the main product is software, the knowledge gained when developing it is a competitive advantage. The easier that knowledge is shared within the whole company, the better it is. - -Another way to look at it is this. Outsourcing of software development has existed for quite a while now. Yet there is still high demand for local developers. So companies see benefits of hiring local developers that outweigh the higher costs. - -### How to Win ### - -There are many reasons why I think developing software is enjoyable (see also [Why I Love Coding][6]). But it is not for everybody. Fortunately it is quite easy to try programming out. There are innumerable resources on the web for learning to program. For example, both [Coursera][7] and [Udacity][8] have introductory courses. If you have never programmed, try one of the free courses or tutorials to get a feel for it. - -Finding something you really enjoy to do for a living has at least two benefits. First, since you do it every day, work will be much more fun than if you simply do something to make money. Second, if you really like it, you have a much better chance of getting good at it. I like the Venn diagram below (by [@eskimon][9]) on what constitutes a great job. Since programming pays relatively well, I think that if you like it, you have a good chance of ending up in the center of the diagram! - -![](https://henrikwarne1.files.wordpress.com/2014/12/career-planning.png) - --------------------------------------------------------------------------------- - -via: http://henrikwarne.com/2014/12/08/5-reasons-why-software-developer-is-a-great-career-choice/ - -作者:[Henrik Warne][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://henrikwarne.com/ -[1]:http://www.transfer.nu/omoss/transferinenglish.jspx?pageId=23 -[2]:http://online.wsj.com/articles/SB10001424053111903480904576512250915629460 -[3]:http://www.di.se/artiklar/2014/6/12/jobbet-som-tar-over-landet/ -[4]:http://computersweden.idg.se/2.2683/1.600324/examinationstakten-racker-inte-for-branschens-behov -[5]:http://en.wikipedia.org/wiki/Waterfall_model -[6]:http://henrikwarne.com/2012/06/02/why-i-love-coding/ -[7]:https://www.coursera.org/ -[8]:https://www.udacity.com/ -[9]:https://eskimon.wordpress.com/about/ \ No newline at end of file diff --git a/translated/talk/20150806 5 Reasons Why Software Developer is a Great Career Choice.md b/translated/talk/20150806 5 Reasons Why Software Developer is a Great Career Choice.md new file mode 100644 index 0000000000..a592cb595e --- /dev/null +++ b/translated/talk/20150806 5 Reasons Why Software Developer is a Great Career Choice.md @@ -0,0 +1,91 @@ +选择软件开发攻城师的5个原因 +================================================================================ +这个星期我将给本地一所高中做一次有关于程序猿是怎样工作的演讲,我是 [Transfer][1] 组织推荐来到这所学校,谈论我的工作。这个学校本周将有一个技术主题日,并且他们很想听听科技行业是怎样工作的。因为我是从事软件开发的,这也是我将和学生们讲的内容。我为什么觉得软件开发是一个很酷的职业将是演讲的其中一部分。主要原因如下: + +### 5个原因 ### + +**1 创造性** + +![](http://7xjl4u.com1.z0.glb.clouddn.com/15-8-6/34042817.jpg) + +如果你问别人创造性的工作有哪些,别人通常会说像作家,音乐家或者画家那样的(工作)。但是极少有人知道软件开发也是一项非常具有创造性的工作。因为你创造了一个以前没有的新功能,这样的功能基本上可以被定义为非常具有创造性。这种解决方案可以在整体和细节上以很多形式来展现。我们经常会遇到一些需要做权衡的场景(比如说运行速度与内存消耗的权衡)。当然前提是这种解决方案必须是正确的。其实这些所有的行为都是需要强大的创造性的。 + +**2 协作性** + +![](http://7xjl4u.com1.z0.glb.clouddn.com/15-8-6/94579377.jpg) + +另外一个表象是程序猿们独自坐在他们的电脑前,然后撸一天的代码。但是软件开发事实上通常总是一个团队努力的结果。你会经常和你的同事讨论编程问题以及解决方案,并且和产品经理,测试人员,客户讨论需求以及其他问题。 +经常有人说,结对编程(2个开发人员一起在一个电脑上编程)是一种流行的最佳实践。 + + +**3 高需性** + +![](http://7xjl4u.com1.z0.glb.clouddn.com/15-8-6/26662164.jpg) + +世界上越来越多的人在用软件,正如 [Marc Andreessen](https://en.wikipedia.org/wiki/Marc_Andreessen) 所说 " [软件正在吞噬世界][2] "。虽然程序猿现在的数量非常巨大(在斯德哥尔摩,程序猿现在是 [最普遍的职业][3] ),但是,需求量一直处于供不应求的局面。据软件公司报告,他们最大的挑战之一就是 [找到优秀的程序猿][4] 。我也经常接到那些想让我跳槽的招聘人员打来的电话。我知道至少除软件行业之外的其他行业的雇主不会那么拼(的去招聘)。 + +**4 高酬性** + + +![](http://7xjl4u.com1.z0.glb.clouddn.com/15-8-6/50538928.jpg) + +软件开发可以带来不菲的收入。卖一份你已经开发好的软件的额外副本是没有 [边际成本][5] 的。这个事实与对程序猿的高需求意味着收入相当可观。当然还有许多更捞金的职业,但是相比一般人群,我认为软件开发者确实“日进斗金”(知足吧!骚年~~)。 + +**5 前瞻性** + +![](http://7xjl4u.com1.z0.glb.clouddn.com/15-8-6/89799239.jpg) + +有许多工作岗位消失,往往是由于它们可以被计算机和软件代替。但是所有这些新的程序依然需要开发和维护,因此,程序猿的前景还是相当好的。 + + +### 但是...### + +**外包又是怎么一回事呢?** + +![](http://7xjl4u.com1.z0.glb.clouddn.com/15-8-6/41615753.jpg) + +难道所有外包到其他地区的软件开发的薪水都很低吗?这是一个理想丰满,现实骨感的例子(有点像 [瀑布开发模型][6] )。软件开发基本上跟设计的工作一样,是一个探索发现的工作。它受益于强有力的合作。更进一步说,特别当你的主打产品是软件的时候,你所掌握的开发知识是绝对的优势。知识在整个公司中分享的越容易,那么公司的发展也将越来越好。 + + +换一种方式去看待这个问题。软件外包已经存在了相当一段时间了。但是对本土程序猿的需求量依旧非常高。因为许多软件公司看到了雇佣本土程序猿的带来的收益要远远超过了相对较高的成本(其实还是赚了)。 + +### 如何成为人生大赢家 ### + + +![](http://7xjl4u.com1.z0.glb.clouddn.com/15-8-6/44219908.jpg) + +虽然我有许多我认为软件开发是一件非常有趣的事情的理由 (详情见: [为什么我热爱编程][7] )。但是这些理由,并不适用于所有人。幸运的是,尝试编程是一件非常容易的事情。在互联网上有数不尽的学习编程的资源。例如,[Coursera][8] 和 [Udacity][9] 都拥有很好的入门课程。如果你从来没有撸过码,可以尝试其中一个免费的课程,找找感觉。 + +寻找一个既热爱又能谋生的事情至少有2个好处。首先,由于你天天去做,工作将比你简单的只为谋生要有趣的多。其次,如果你真的非常喜欢,你将更好的擅长它。我非常喜欢下面一副关于伟大工作组成的韦恩图(作者 [@eskimon)][10] 。因为编码的薪水确实相当不错,我认为如果你真的喜欢它,你将有一个很好的机会,成为人生的大赢家! + +![](http://7xjl4u.com1.z0.glb.clouddn.com/15-8-6/17571624.jpg) + +-------------------------------------------------------------------------------- + +via: http://henrikwarne.com/2014/12/08/5-reasons-why-software-developer-is-a-great-career-choice/ + +作者:[Henrik Warne][a] +译者:[mousycoder](https://github.com/mousycoder) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + + +[a]:http://henrikwarne.com/ +[1]:http://www.transfer.nu/omoss/transferinenglish.jspx?pageId=23 +[2]:http://www.wsj.com/articles/SB10001424053111903480904576512250915629460 +[3]:http://www.di.se/artiklar/2014/6/12/jobbet-som-tar-over-landet/ +[4]:http://computersweden.idg.se/2.2683/1.600324/examinationstakten-racker-inte-for-branschens-behov +[5]:https://en.wikipedia.org/wiki/Marginal_cost +[6]:https://en.wikipedia.org/wiki/Waterfall_model +[7]:http://henrikwarne.com/2012/06/02/why-i-love-coding/ +[8]:https://www.coursera.org/ +[9]:https://www.udacity.com/ +[10]:https://eskimon.wordpress.com/about/ + + + + + + + From a37ff025ebb8b740d71d06ed1e6178a5ab4ccc3c Mon Sep 17 00:00:00 2001 From: wxy Date: Fri, 7 Aug 2015 00:06:17 +0800 Subject: [PATCH 835/965] PUB:20150717 How to monitor NGINX- Part 1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @strugglingyouth 好长,翻译辛苦了。其中有些字句翻译不对,比如 upstreaming 是指上游(服务器),并不专指负载均衡环境。 --- .../20150717 How to monitor NGINX- Part 1.md | 231 ++++++++++ .../20150717 How to monitor NGINX- Part 1.md | 416 ------------------ 2 files changed, 231 insertions(+), 416 deletions(-) create mode 100644 published/20150717 How to monitor NGINX- Part 1.md delete mode 100644 translated/tech/20150717 How to monitor NGINX- Part 1.md diff --git a/published/20150717 How to monitor NGINX- Part 1.md b/published/20150717 How to monitor NGINX- Part 1.md new file mode 100644 index 0000000000..908aa7448e --- /dev/null +++ b/published/20150717 How to monitor NGINX- Part 1.md @@ -0,0 +1,231 @@ +如何监控 NGINX(第一篇) +================================================================================ +![](http://www.datadoghq.com/wp-content/uploads/2015/07/NGINX_hero_1.png) + +### NGINX 是什么? ### + +[NGINX][1] (发音为 “engine X”) 是一种流行的 HTTP 和反向代理服务器。作为一个 HTTP 服务器,NGINX 可以使用较少的内存非常高效可靠地提供静态内容。作为[反向代理][2],它可以用作多个后端服务器或类似缓存和负载平衡这样的其它应用的单一访问控制点。NGINX 是一个自由开源的产品,并有一个具备更全的功能的叫做 NGINX Plus 的商业版。 + +NGINX 也可以用作邮件代理和通用的 TCP 代理,但本文并不直接讨论 NGINX 的那些用例的监控。 + +### NGINX 主要指标 ### + +通过监控 NGINX 可以 捕获到两类问题:NGINX 本身的资源问题,和出现在你的基础网络设施的其它问题。大多数 NGINX 用户会用到以下指标的监控,包括**每秒请求数**,它提供了一个由所有最终用户活动组成的上层视图;**服务器错误率** ,这表明你的服务器已经多长没有处理看似有效的请求;还有**请求处理时间**,这说明你的服务器处理客户端请求的总共时长(并且可以看出性能降低或当前环境的其他问题)。 + +更一般地,至少有三个主要的指标类别来监视: + +- 基本活动指标 +- 错误指标 +- 性能指标 + +下面我们将分析在每个类别中最重要的 NGINX 指标,以及用一个相当普遍但是值得特别提到的案例来说明:使用 NGINX Plus 作反向代理。我们还将介绍如何使用图形工具或可选择的监控工具来监控所有的指标。 + +本文引用指标术语[来自我们的“监控 101 系列”][3],,它提供了一个指标收集和警告框架。 + +#### 基本活跃指标 #### + +无论你在怎样的情况下使用 NGINX,毫无疑问你要监视服务器接收多少客户端请求和如何处理这些请求。 + +NGINX Plus 上像开源 NGINX 一样可以报告基本活跃指标,但它也提供了略有不同的辅助模块。我们首先讨论开源的 NGINX,再来说明 NGINX Plus 提供的其他指标的功能。 + +**NGINX** + +下图显示了一个客户端连接的过程,以及开源版本的 NGINX 如何在连接过程中收集指标。 + +![connection, request states](https://d33tyra1llx9zy.cloudfront.net/blog/images/2015-06-nginx/nginx_connection_diagram-2.png) + +Accepts(接受)、Handled(已处理)、Requests(请求)是一直在增加的计数器。Active(活跃)、Waiting(等待)、Reading(读)、Writing(写)随着请求量而增减。 + +| 名称 | 描述| [指标类型](https://www.datadoghq.com/blog/monitoring-101-collecting-data/)| +|-----------|-----------------|-------------------------------------------------------------------------------------------------------------------------| +| Accepts | NGINX 所接受的客户端连接数 | 资源: 功能 | +| Handled | 成功的客户端连接数 | 资源: 功能 | +| Active | 当前活跃的客户端连接数| 资源: 功能 | +| Dropped(已丢弃,计算得出)| 丢弃的连接数(接受 - 已处理)| 工作:错误*| +| Requests | 客户端请求数 | 工作:吞吐量 | + + +_*严格的来说,丢弃的连接是 [一个资源饱和指标](https://www.datadoghq.com/blog/monitoring-101-collecting-data/#resource-metrics),但是因为饱和会导致 NGINX 停止服务(而不是延后该请求),所以,“已丢弃”视作 [一个工作指标](https://www.datadoghq.com/blog/monitoring-101-collecting-data/#work-metrics) 比较合适。_ + +NGINX worker 进程接受 OS 的连接请求时 **Accepts** 计数器增加,而**Handled** 是当实际的请求得到连接时(通过建立一个新的连接或重新使用一个空闲的)。这两个计数器的值通常都是相同的,如果它们有差别则表明连接被**Dropped**,往往这是由于资源限制,比如已经达到 NGINX 的[worker_connections][4]的限制。 + +一旦 NGINX 成功处理一个连接时,连接会移动到**Active**状态,在这里对客户端请求进行处理: + +Active状态 + +- **Waiting**: 活跃的连接也可以处于 Waiting 子状态,如果有在此刻没有活跃请求的话。新连接可以绕过这个状态并直接变为到 Reading 状态,最常见的是在使用“accept filter(接受过滤器)” 和 “deferred accept(延迟接受)”时,在这种情况下,NGINX 不会接收 worker 进程的通知,直到它具有足够的数据才开始响应。如果连接设置为 keep-alive ,那么它在发送响应后将处于等待状态。 + +- **Reading**: 当接收到请求时,连接离开 Waiting 状态,并且该请求本身使 Reading 状态计数增加。在这种状态下 NGINX 会读取客户端请求首部。请求首部是比较小的,因此这通常是一个快速的操作。 + +- **Writing**: 请求被读取之后,其使 Writing 状态计数增加,并保持在该状态,直到响应返回给客户端。这意味着,该请求在 Writing 状态时, 一方面 NGINX 等待来自上游系统的结果(系统放在 NGINX “后面”),另外一方面,NGINX 也在同时响应。请求往往会在 Writing 状态花费大量的时间。 + +通常,一个连接在同一时间只接受一个请求。在这种情况下,Active 连接的数目 == Waiting 的连接 + Reading 请求 + Writing 。然而,较新的 SPDY 和 HTTP/2 协议允许多个并发请求/响应复用一个连接,所以 Active 可小于 Waiting 的连接、 Reading 请求、Writing 请求的总和。 (在撰写本文时,NGINX 不支持 HTTP/2,但预计到2015年期间将会支持。) + +**NGINX Plus** + +正如上面提到的,所有开源 NGINX 的指标在 NGINX Plus 中是可用的,但另外也提供其他的指标。本节仅说明了 NGINX Plus 可用的指标。 + + +![connection, request states](https://d33tyra1llx9zy.cloudfront.net/blog/images/2015-06-nginx/nginx_plus_connection_diagram-2.png) + +Accepted (已接受)、Dropped,总数是不断增加的计数器。Active、 Idle(空闲)和处于 Current(当前)处理阶段的各种状态下的连接或请​​求的当前数量随着请求量而增减。 + +| 名称 | 描述| [指标类型](https://www.datadoghq.com/blog/monitoring-101-collecting-data/)| +|-----------|-----------------|-------------------------------------------------------------------------------------------------------------------------| +| Accepted | NGINX 所接受的客户端连接数 | 资源: 功能 | +| Dropped |丢弃的连接数(接受 - 已处理)| 工作:错误*| +| Active | 当前活跃的客户端连接数| 资源: 功能 | +| Idle | 没有当前请求的客户端连接| 资源: 功能 | +| Total(全部) | 客户端请求数 | 工作:吞吐量 | + +_*严格的来说,丢弃的连接是 [一个资源饱和指标](https://www.datadoghq.com/blog/monitoring-101-collecting-data/#resource-metrics),但是因为饱和会导致 NGINX 停止服务(而不是延后该请求),所以,“已丢弃”视作 [一个工作指标](https://www.datadoghq.com/blog/monitoring-101-collecting-data/#work-metrics) 比较合适。_ + +当 NGINX Plus worker 进程接受 OS 的连接请求时 **Accepted** 计数器递增。如果 worker 进程为请求建立连接失败(通过建立一个新的连接或重新使用一个空闲),则该连接被丢弃, **Dropped** 计数增加。通常连接被丢弃是因为资源限制,如 NGINX Plus 的[worker_connections][4]的限制已经达到。 + +**Active** 和 **Idle** 和[如上所述][5]的开源 NGINX 的“active” 和 “waiting”状态是相同的,但是有一点关键的不同:在开源 NGINX 上,“waiting”状态包括在“active”中,而在 NGINX Plus 上“idle”的连接被排除在“active” 计数外。**Current** 和开源 NGINX 是一样的也是由“reading + writing” 状态组成。 + +**Total** 为客户端请求的累积计数。请注意,单个客户端连接可涉及多个请求,所以这个数字可能会比连接的累计次数明显大。事实上,(total / accepted)是每个连接的平均请求数量。 + +**开源 和 Plus 之间指标的不同** + +|NGINX (开源) |NGINX Plus| +|-----------------------|----------------| +| accepts | accepted | +| dropped 通过计算得来| dropped 直接得到 | +| reading + writing| current| +| waiting| idle| +| active (包括 “waiting”状态) | active (排除 “idle” 状态)| +| requests| total| + +**提醒指标: 丢弃连接** + +被丢弃的连接数目等于 Accepts 和 Handled 之差(NGINX 中),或是可直接得到标准指标(NGINX Plus 中)。在正常情况下,丢弃连接数应该是零。如果在每个单位时间内丢弃连接的速度开始上升,那么应该看看是否资源饱和了。 + +![Dropped connections](https://d33tyra1llx9zy.cloudfront.net/blog/images/2015-06-nginx/dropped_connections.png) + +**提醒指标: 每秒请求数** + +按固定时间间隔采样你的请求数据(开源 NGINX 的**requests**或者 NGINX Plus 中**total**) 会提供给你单位时间内(通常是分钟或秒)所接受的请求数量。监测这个指标可以查看进入的 Web 流量尖峰,无论是合法的还是恶意的,或者突然的下降,这通常都代表着出现了问题。每秒请求数若发生急剧变化可以提醒你的环境出现问题了,即使它不能告诉你确切问题的位置所在。请注意,所有的请求都同样计数,无论 URL 是什么。 + +![Requests per second](https://d33tyra1llx9zy.cloudfront.net/blog/images/2015-06-nginx/requests_per_sec.png) + +**收集活跃指标** + +开源的 NGINX 提供了一个简单状态页面来显示基本的服务器指标。该状态信息以标准格式显示,实际上任何图形或监控工具可以被配置去解析这些相关数据,以用于分析、可视化、或提醒。NGINX Plus 提供一个 JSON 接口来供给更多的数据。阅读相关文章“[NGINX 指标收集][6]”来启用指标收集的功能。 + +#### 错误指标 #### + +| 名称 | 描述| [指标类型](https://www.datadoghq.com/blog/monitoring-101-collecting-data/)| 可用于 | +|-----------|-----------------|--------------------------------------------------------------------------------------------------------|----------------| +| 4xx 代码 | 客户端错误计数 | 工作:错误 | NGINX 日志, NGINX Plus| +| 5xx 代码| 服务器端错误计数 | 工作:错误 | NGINX 日志, NGINX Plus| + +NGINX 错误指标告诉你服务器是否经常返回错误而不是正常工作。客户端错误返回4XX状态码,服务器端错误返回5XX状态码。 + +**提醒指标: 服务器错误率** + +服务器错误率等于在单位时间(通常为一到五分钟)内5xx错误状态代码的总数除以[状态码][7](1XX,2XX,3XX,4XX,5XX)的总数。如果你的错误率随着时间的推移开始攀升,调查可能的原因。如果突然增加,可能需要采取紧急行动,因为客户端可能收到错误信息。 + +![Server error rate](https://d33tyra1llx9zy.cloudfront.net/blog/images/2015-06-nginx/5xx_rate.png) + +关于客户端错误的注意事项:虽然监控4XX是很有用的,但从该指标中你仅可以捕捉有限的信息,因为它只是衡量客户的行为而不捕捉任何特殊的 URL。换句话说,4xx出现的变化可能是一个信号,例如网络扫描器正在寻找你的网站漏洞时。 + +**收集错误度量** + +虽然开源 NGINX 不能马上得到用于监测的错误率,但至少有两种方法可以得到: + +- 使用商业支持的 NGINX Plus 提供的扩展状态模块 +- 配置 NGINX 的日志模块将响应码写入访问日志 + +关于这两种方法,请阅读相关文章“[NGINX 指标收集][6]”。 + +#### 性能指标 #### + +| 名称 | 描述| [指标类型](https://www.datadoghq.com/blog/monitoring-101-collecting-data/)| 可用于 | +|-----------|-----------------|--------------------------------------------------------------------------------------------------------|----------------| +| request time (请求处理时间)| 处理每个请求的时间,单位为秒 | 工作:性能 | NGINX 日志| + +**提醒指标: 请求处理时间** + +请求处理时间指标记录了 NGINX 处理每个请求的时间,从读到客户端的第一个请求字节到完成请求。较长的响应时间说明问题在上游。 + +**收集处理时间指标** + +NGINX 和 NGINX Plus 用户可以通过添加 $request_time 变量到访问日志格式中来捕​​捉处理时间数据。关于配置日志监控的更多细节在[NGINX指标收集][6]。 + +#### 反向代理指标 #### + +| 名称 | 描述| [指标类型](https://www.datadoghq.com/blog/monitoring-101-collecting-data/)| 可用于 | +|-----------|-----------------|--------------------------------------------------------------------------------------------------------|----------------| +| 上游服务器的活跃链接 | 当前活跃的客户端连接 | 资源:功能 | NGINX Plus | +| 上游服务器的 5xx 错误代码| 服务器错误 | 工作:错误 | NGINX Plus | +| 每个上游组的可用服务器 | 服务器传递健康检查 | 资源:可用性| NGINX Plus + +[反向代理][9]是 NGINX 最常见的使用方法之一。商业支持的 NGINX Plus 显示了大量有关后端(或“上游 upstream”)的服务器指标,这些与反向代理设置相关的。本节重点介绍了几个 NGINX Plus 用户可用的关键上游指标。 + +NGINX Plus 首先将它的上游指标按组分开,然后是针对单个服务器的。因此,例如,你的反向代理将请求分配到五个上游的 Web 服务器上,你可以一眼看出是否有单个服务器压力过大,也可以看出上游组中服务器的健康状况,以确保良好的响应时间。 + +**活跃指标** + +**每上游服务器的活跃连接**的数量可以帮助你确认反向代理是否正确的分配工作到你的整个服务器组上。如果你正在使用 NGINX 作为负载均衡器,任何一台服务器处理的连接数的明显偏差都可能表明服务器正在努力消化请求,或者是你配置使用的负载均衡的方法(例如[round-robin 或 IP hashing][10])不是最适合你流量模式的。 + +**错误指标** + +错误指标,上面所说的高于5XX(服务器错误)状态码,是监控指标中有价值的一个,尤其是响应码部分。 NGINX Plus 允许你轻松地提取**每个上游服务器的 5xx 错误代码**的数量,以及响应的总数量,以此来确定某个特定服务器的错误率。 + +**可用性指标** + +对于 web 服务器的运行状况,还有另一种角度,NGINX 可以通过**每个组中当前可用服务器的总量**很方便监控你的上游组的健康。在一个大的反向代理上,你可能不会非常关心其中一个服务器的当前状态,就像你只要有可用的服务器组能够处理当前的负载就行了。但监视上游组内的所有工作的服务器总量可为判断 Web 服务器的健康状况提供一个更高层面的视角。 + +**收集上游指标** + +NGINX Plus 上游指标显示在内部 NGINX Plus 的监控仪表盘上,并且也可通过一个JSON 接口来服务于各种外部监控平台。在我们的相关文章“[NGINX指标收集][6]”中有个例子。 + +### 结论 ### + +在这篇文章中,我们已经谈到了一些有用的指标,你可以使用表格来监控 NGINX 服务器。如果你是刚开始使用 NGINX,监控下面提供的大部分或全部指标,可以让你很好的了解你的网络基础设施的健康和活跃程度: + +- [已丢弃的连接][12] +- [每秒请求数][13] +- [服务器错误率][14] +- [请求处理数据][15] + +最终,你会学到更多,更专业的衡量指标,尤其是关于你自己基础设施和使用情况的。当然,监控哪一项指标将取决于你可用的工具。参见相关的文章来[逐步指导你的指标收集][6],不管你使用 NGINX 还是 NGINX Plus。 + +在 Datadog 中,我们已经集成了 NGINX 和 NGINX Plus,这样你就可以以最少的设置来收集和监控所有 Web 服务器的指标。 [在本文中][17]了解如何用 NGINX Datadog来监控,并开始[免费试用 Datadog][18]吧。 + +### 诚谢 ### + +在文章发表之前非常感谢 NGINX 团队审阅这篇,并提供重要的反馈和说明。 + + +-------------------------------------------------------------------------------- + +via: https://www.datadoghq.com/blog/how-to-monitor-nginx/ + +作者:K Young +译者:[strugglingyouth](https://github.com/strugglingyouth) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[1]:http://nginx.org/en/ +[2]:http://nginx.com/resources/glossary/reverse-proxy-server/ +[3]:https://www.datadoghq.com/blog/monitoring-101-collecting-data/ +[4]:http://nginx.org/en/docs/ngx_core_module.html#worker_connections +[5]:https://www.datadoghq.com/blog/how-to-monitor-nginx/#active-state +[6]:https://www.datadoghq.com/blog/how-to-collect-nginx-metrics/ +[7]:http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html +[8]:https://www.datadoghq.com/blog/how-to-collect-nginx-metrics/ +[9]:https://en.wikipedia.org/wiki/Reverse_proxy +[10]:http://nginx.com/blog/load-balancing-with-nginx-plus/ +[11]:https://www.datadoghq.com/blog/how-to-collect-nginx-metrics/ +[12]:https://www.datadoghq.com/blog/how-to-monitor-nginx/#dropped-connections +[13]:https://www.datadoghq.com/blog/how-to-monitor-nginx/#requests-per-second +[14]:https://www.datadoghq.com/blog/how-to-monitor-nginx/#server-error-rate +[15]:https://www.datadoghq.com/blog/how-to-monitor-nginx/#request-processing-time +[16]:https://www.datadoghq.com/blog/how-to-collect-nginx-metrics/ +[17]:https://www.datadoghq.com/blog/how-to-monitor-nginx-with-datadog/ +[18]:https://www.datadoghq.com/blog/how-to-monitor-nginx/#sign-up +[19]:https://github.com/DataDog/the-monitor/blob/master/nginx/how_to_monitor_nginx.md +[20]:https://github.com/DataDog/the-monitor/issues diff --git a/translated/tech/20150717 How to monitor NGINX- Part 1.md b/translated/tech/20150717 How to monitor NGINX- Part 1.md deleted file mode 100644 index 86e72c0324..0000000000 --- a/translated/tech/20150717 How to monitor NGINX- Part 1.md +++ /dev/null @@ -1,416 +0,0 @@ -如何监控 NGINX - 第1部分 -================================================================================ -![](http://www.datadoghq.com/wp-content/uploads/2015/07/NGINX_hero_1.png) - -### NGINX 是什么? ### - -[NGINX][1] (发音为 “engine X”) 是一种流行的 HTTP 和反向代理服务器。作为一个 HTTP 服务器,NGINX 提供静态内容非常高效可靠,使用较少的内存。作为[反向代理][2],它可以用作一个单一的控制器来为其他应用代理至后端的多个服务器上,如高速缓存和负载平衡。NGINX 是作为一个免费,开源的产品并有更全的功能,商业版的叫 NGINX Plus。 - -NGINX 也可以用作邮件代理和通用的 TCP 代理,但本文并不直接说明对 NGINX 的这些用例做监控。 - -### NGINX 主要指标 ### - -通过监控 NGINX 可以捕捉两类问题:NGINX 本身的资源问题,也有很多问题会出现在你的基础网络设施处。大多数 NGINX 用户受益于以下指标的监控,包括**requests per second**,它提供了一个所有用户活动的高级视图;**server error rate** ,这表明你的服务器已经多长没有处理看似有效的请求;还有**request processing time**,这说明你的服务器处理客户端请求的总共时长(并且可以看出性能降低时或当前环境的其他问题)。 - -更一般地,至少有三个主要的指标类别来监视: - -- 基本活动指标 -- 错误指标 -- 性能指标 - -下面我们将分析在每个类别中最重要的 NGINX 指标,以及用一个相当普遍的案例来说明,值得特别说明的是:使用 NGINX Plus 作反向代理。我们还将介绍如何使用图形工具或可选择的监控工具来监控所有的指标。 - -本文引用指标术语[介绍我们的监控在 101 系列][3],,它提供了指标收集和警告框架。 - -#### 基本活动指标 #### - -无论你在怎样的情况下使用 NGINX,毫无疑问你要监视服务器接收多少客户端请求和如何处理这些请求。 - -NGINX Plus 上像开源 NGINX 一样可以报告基本活动指标,但它也提供了略有不同的辅助模块。我们首先讨论开源的 NGINX,再来说明 NGINX Plus 提供的其他指标的功能。 - -**NGINX** - -下图显示了一个客户端连接,以及如何在连接过程中收集指标的活动周期在开源 NGINX 版本上。 - -![connection, request states](https://d33tyra1llx9zy.cloudfront.net/blog/images/2015-06-nginx/nginx_connection_diagram-2.png) - -接受,处理,增加请求的计数器。主动,等待,读,写增加和减少请求量。 - -注:表格 - ---- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionMetric type
acceptsCount of client connections attempted by NGINXResource: Utilization
handledCount of successful client connectionsResource: Utilization
activeCurrently active client connectionsResource: Utilization
dropped (calculated)Count of dropped connections (accepts – handled)Work: Errors*
requestsCount of client requestsWork: Throughput
*Strictly speaking, dropped connections is a metric of resource saturation, but since saturation causes NGINX to stop servicing some work (rather than queuing it up for later), “dropped” is best thought of as a work metric.
- -NGINX 进程接受 OS 的连接请求时**accepts** 计数器增加,而**handled** 是当实际的请求得到连接时(通过建立一个新的连接或重新使用一个空闲的)。这两个计数器的值通常都是相同的,表明连接正在被**dropped**,往往由于资源限制,如 NGINX 的[worker_connections][4]的限制已经达到。 - -一旦 NGINX 成功处理一个连接时,连接会移动到**active**状态,然后保持为客户端请求进行处理: - -Active 状态 - -- **Waiting**: 活动的连接也可以是一个 Waiting 子状态,如果有在此刻没有活动请求。新连接绕过这个状态并直接移动到读,最常见的是使用“accept filter” 和 “deferred accept”,在这种情况下,NGINX 不会接收进程的通知,直到它具有足够的数据来开始响应工作。如果连接设置为 keep-alive ,连接在发送响应后将处于等待状态。 - -- **Reading**: 当接收到请求时,连接移出等待状态,并且该请求本身也被视为 Reading。在这种状态下NGINX 正在读取客户端请求首部。请求首部是比较少的,因此这通常是一个快速的操作。 - -- **Writing**: 请求被读取之后,将其计为 Writing,并保持在该状态,直到响应返回给客户端。这意味着,该请求在 Writing 时, NGINX 同时等待来自负载均衡服务器的结果(系统“背后”的 NGINX),NGINX 也同时响应。请求往往会花费大量的时间在 Writing 状态。 - -通常,一个连接在同一时间只接受一个请求。在这种情况下,Active 连接的数目 == Waiting 连接 + Reading 请求 + Writing 请求。然而,较新的 SPDY 和 HTTP/2 协议允许多个并发请求/响应对被复用的连接,所以 Active 可小于 Waiting,Reading,Writing 的总和。 (在撰写本文时,NGINX 不支持 HTTP/2,但预计到2015年期间将会支持。) - -**NGINX Plus** - -正如上面提到的,所有开源 NGINX 的指标在 NGINX Plus 中是可用的,但另外也提供其他的指标。本节仅说明了 NGINX Plus 可用的指标。 - - -![connection, request states](https://d33tyra1llx9zy.cloudfront.net/blog/images/2015-06-nginx/nginx_plus_connection_diagram-2.png) - -接受,中断,总数是不断增加的。活动,空闲和已建立连接的,当前状态下每一个连接或请​​求的数量是随着请求量增加和收缩的。 - -注:表格 - ---- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionMetric type
acceptedCount of client connections attempted by NGINXResource: Utilization
droppedCount of dropped connectionsWork: Errors*
activeCurrently active client connectionsResource: Utilization
idleClient connections with zero current requestsResource: Utilization
totalCount of client requestsWork: Throughput
*Strictly speaking, dropped connections is a metric of resource saturation, but since saturation causes NGINX to stop servicing some work (rather than queuing it up for later), “dropped” is best thought of as a work metric.
- -当 NGINX Plus 进程接受 OS 的连接请求时 **accepted** 计数器递增。如果进程请求连接失败(通过建立一个新的连接或重新使用一个空闲),则该连接断开 **dropped** 计数增加。通常连接被中断是因为资源限制,如 NGINX Plus 的[worker_connections][4]的限制已经达到。 - -**Active** 和 **idle** 和开源 NGINX 的“active” 和 “waiting”状态是相同的,[如上所述][5],有一个不同的地方:在开源 NGINX 上,“waiting”状态包括在“active”中,而在 NGINX Plus 上“idle”的连接被排除在“active” 计数外。**Current** 和开源 NGINX 是一样的也是由“reading + writing” 状态组成。 - - -**Total** 为客户端请求的累积计数。请注意,单个客户端连接可涉及多个请求,所以这个数字可能会比连接的累计次数明显大。事实上,(total / accepted)是每个连接请求的平均数量。 - -**开源 和 Plus 之间指标的不同** - -注:表格 - --- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NGINX (open-source)NGINX Plus
acceptsaccepted
dropped must be calculateddropped is reported directly
reading + writingcurrent
waitingidle
active (includes “waiting” states)active (excludes “idle” states)
requeststotal
- -**提醒指标: 中断连接** - -被中断的连接数目等于接受和处理之差(NGINX),或被公开直接作为指标的标准(NGINX加)。在正常情况下,中断连接数应该是零。如果每秒中中断连接的速度开始上升,寻找资源可能用尽的地方。 - -![Dropped connections](https://d33tyra1llx9zy.cloudfront.net/blog/images/2015-06-nginx/dropped_connections.png) - -**提醒指标: 每秒请求数** - -提供你(开源中的**requests**或者 Plus 中**total**)固定时间间隔每秒或每分钟请求的平均数据。监测这个指标可以查看 Web 的输入流量的最大值,无论是合法的还是恶意的,有可能会突然下降,通常可以看出问题。每秒的请求若发生急剧变化可以提醒你出问题了,即使它不能告诉你确切问题的位置所在。请注意,所有的请求都算作是相同的,无论哪个 URLs。 - -![Requests per second](https://d33tyra1llx9zy.cloudfront.net/blog/images/2015-06-nginx/requests_per_sec.png) - -**收集活动指标** - -开源的 NGINX 提供了一个简单状态页面来显示基本的服务器指标。该状态信息以标准格式被显示,实际上任何图形或监控工具可以被配置去解析相关的数据为分析,可视化,或提醒而用。NGINX Plus 提供一个 JSON 接口来显示更多的数据。阅读[NGINX 指标收集][6]后来启用指标收集的功能。 - -#### 错误指标 #### - -注:表格 - ----- - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionMetric typeAvailability
4xx codesCount of client errorsWork: ErrorsNGINX logs, NGINX Plus
5xx codesCount of server errorsWork: ErrorsNGINX logs, NGINX Plus
- -NGINX 错误指标告诉你服务器经常返回哪些错误,这也是有用的。客户端错误返回4XX状态码,服务器端错误返回5XX状态码。 - -**提醒指标: 服务器错误率** - -服务器错误率等于5xx错误状态代码的总数除以[状态码][7](1XX,2XX,3XX,4XX,5XX)的总数,每单位时间(通常为一到五分钟)的数目。如果你的错误率随着时间的推移开始攀升,调查可能的原因。如果突然增加,可能需要采取紧急行动,因为客户端可能收到错误信息。 - -![Server error rate](https://d33tyra1llx9zy.cloudfront.net/blog/images/2015-06-nginx/5xx_rate.png) - -客户端收到错误时的注意事项:虽然监控4XX是很有用的,但从该指标中你仅可以捕捉有限的信息,因为它只是衡量客户的行为而不捕捉任何特殊的 URLs。换句话说,在4xx出现时只是相当于一点噪音,例如寻找漏洞的网络扫描仪。 - -**收集错误度量** - -虽然开源 NGINX 不会监测错误率,但至少有两种方法可以捕获其信息: - -- 使用商业支持的 NGINX Plus 提供的可扩展状态模块 -- 配置 NGINX 的日志模块将响应码写入访问日志 - -阅读关于 NGINX 指标收集的后两个方法的详细说明。 - -#### 性能指标 #### - -注:表格 - ----- - - - - - - - - - - - - - - - - -
NameDescriptionMetric typeAvailability
request timeTime to process each request, in secondsWork: PerformanceNGINX logs
- -**提醒指标: 请求处理时间** - -请求时间指标记录 NGINX 处理每个请求的时间,从第一个客户端的请求字节读出到完成请求。较长的响应时间可以将问题指向负载均衡服务器。 - -**收集处理时间指标** - -NGINX 和 NGINX Plus 用户可以通过添加 $request_time 变量到访问日志格式中来捕​​捉处理时间数据。关于配置日志监控的更多细节在[NGINX指标收集][8]。 - -#### 反向代理指标 #### - -注:表格 - ----- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionMetric typeAvailability
Active connections by upstream serverCurrently active client connectionsResource: UtilizationNGINX Plus
5xx codes by upstream serverServer errorsWork: ErrorsNGINX Plus
Available servers per upstream groupServers passing health checksResource: AvailabilityNGINX Plus
- -[反向代理][9]是 NGINX 最常见的使用方法之一。商业支持的 NGINX Plus 显示了大量有关后端(或“负载均衡”)的服务器指标,这是反向代理设置的。本节重点介绍了几个关键的负载均衡服务器的指标为 NGINX Plus 用户。 - -NGINX Plus 的负载均衡服务器指标首先是组的,然后是单个服务器的。因此,例如,你的反向代理将请求分配到五个 Web 负载均衡服务器上,你可以一眼看出是否有单个服务器压力过大,也可以看出负载均衡服务器组的健康状况,以确保良好的响应时间。 - -**活动指标** - -**active connections per upstream server**的数量可以帮助你确认反向代理是否正确的分配工作到负载均衡服务器上。如果你正在使用 NGINX 作为负载均衡器,任何一台服务器处理的连接数有显著的偏差都可能表明服务器正在努力处理请求或你配置处理请求的负载均衡的方法(例如[round-robin or IP hashing][10])不是最适合你流量模式的。 - -**错误指标** - -错误指标,上面所说的高于5XX(服务器错误)状态码,是监控指标中有价值的一个,尤其是响应码部分。 NGINX Plus 允许你轻松地提取每个负载均衡服务器 **5xx codes per upstream server**的数量,以及响应的总数量,以此来确定该特定服务器的错误率。 - - -**可用性指标** - -对于 web 服务器的运行状况,另一种观点认为,NGINX 也可以很方便监控你的负载均衡服务器组的健康通过**servers currently available within each group**的总量​​。在一个大的反向代理上,你可能不会非常关心其中一个服务器的当前状态,就像你只要可用的服务器组能够处理当前的负载就行了。但监视负载均衡服务器组内的所有服务器可以提供一个高水平的图像来判断 Web 服务器的健康状况。 - -**收集负载均衡服务器的指标** - -NGINX Plus 负载均衡服务器的指标显示在内部 NGINX Plus 的监控仪表盘上,并且也可通过一个JSON 接口来服务于所有外部的监控平台。在这儿看一个例子[收集 NGINX 指标][11]。 - -### 结论 ### - -在这篇文章中,我们已经谈到了一些有用的指标,你可以使用表格来监控 NGINX 服务器。如果你是刚开始使用 NGINX,下面提供了良好的网络基础设施的健康和活动的可视化工具来监控大部分或所有的指标: - -- [Dropped connections][12] -- [Requests per second][13] -- [Server error rate][14] -- [Request processing time][15] - -最终,你会学到更多,更专业的衡量指标,尤其是关于你自己基础设施和使用情况的。当然,监控哪一项指标将取决于你可用的工具。参见[一步一步来说明指标收集][16],不管你使用 NGINX 还是 NGINX Plus。 - - - -在 Datadog 中,我们已经集成了 NGINX 和 NGINX Plus,这样你就可以以最小的设置来收集和监控所有 Web 服务器的指标。了解如何用 NGINX Datadog来监控 [在本文中][17],并开始使用 [免费的 Datadog][18]。 - -### Acknowledgments ### - -在文章发表之前非常感谢 NGINX 团队审阅这篇,并提供重要的反馈和说明。 - ----------- - -文章来源在这儿 [on GitHub][19]。问题,更正,补充等?请[告诉我们][20]。 - - --------------------------------------------------------------------------------- - -via: https://www.datadoghq.com/blog/how-to-monitor-nginx/ - -作者:K Young -译者:[strugglingyouth](https://github.com/strugglingyouth) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[1]:http://nginx.org/en/ -[2]:http://nginx.com/resources/glossary/reverse-proxy-server/ -[3]:https://www.datadoghq.com/blog/monitoring-101-collecting-data/ -[4]:http://nginx.org/en/docs/ngx_core_module.html#worker_connections -[5]:https://www.datadoghq.com/blog/how-to-monitor-nginx/#active-state -[6]:https://www.datadoghq.com/blog/how-to-collect-nginx-metrics/ -[7]:http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html -[8]:https://www.datadoghq.com/blog/how-to-collect-nginx-metrics/ -[9]:https://en.wikipedia.org/wiki/Reverse_proxy -[10]:http://nginx.com/blog/load-balancing-with-nginx-plus/ -[11]:https://www.datadoghq.com/blog/how-to-collect-nginx-metrics/ -[12]:https://www.datadoghq.com/blog/how-to-monitor-nginx/#dropped-connections -[13]:https://www.datadoghq.com/blog/how-to-monitor-nginx/#requests-per-second -[14]:https://www.datadoghq.com/blog/how-to-monitor-nginx/#server-error-rate -[15]:https://www.datadoghq.com/blog/how-to-monitor-nginx/#request-processing-time -[16]:https://www.datadoghq.com/blog/how-to-collect-nginx-metrics/ -[17]:https://www.datadoghq.com/blog/how-to-monitor-nginx-with-datadog/ -[18]:https://www.datadoghq.com/blog/how-to-monitor-nginx/#sign-up -[19]:https://github.com/DataDog/the-monitor/blob/master/nginx/how_to_monitor_nginx.md -[20]:https://github.com/DataDog/the-monitor/issues From 67aff80abfcf06fefd44d67bb4a263d90f743d38 Mon Sep 17 00:00:00 2001 From: struggling <630441839@qq.com> Date: Fri, 7 Aug 2015 00:25:48 +0800 Subject: [PATCH 836/965] Delete 20150803 Handy commands for profiling your Unix file systems.md --- ...ds for profiling your Unix file systems.md | 65 ------------------- 1 file changed, 65 deletions(-) delete mode 100644 sources/tech/20150803 Handy commands for profiling your Unix file systems.md diff --git a/sources/tech/20150803 Handy commands for profiling your Unix file systems.md b/sources/tech/20150803 Handy commands for profiling your Unix file systems.md deleted file mode 100644 index 359aba14c9..0000000000 --- a/sources/tech/20150803 Handy commands for profiling your Unix file systems.md +++ /dev/null @@ -1,65 +0,0 @@ -translation by strugglingyouth -Handy commands for profiling your Unix file systems -================================================================================ -![Credit: Sandra H-S](http://images.techhive.com/images/article/2015/07/file-profile-100597239-primary.idge.png) -Credit: Sandra H-S - -One of the problems that seems to plague nearly all file systems -- Unix and others -- is the continuous buildup of files. Almost no one takes the time to clean out files that they no longer use and file systems, as a result, become so cluttered with material of little or questionable value that keeping them them running well, adequately backed up, and easy to manage is a constant challenge. - -One way that I have seen to help encourage the owners of all that data detritus to address the problem is to create a summary report or "profile" of a file collection that reports on such things as the number of files; the oldest, newest, and largest of those files; and a count of who owns those files. If someone realizes that a collection of half a million files contains none less than five years old, they might go ahead and remove them -- or, at least, archive and compress them. The basic problem is that huge collections of files are overwhelming and most people are afraid that they might accidentally delete something important. Having a way to characterize a file collection can help demonstrate the nature of the content and encourage those digital packrats to clean out their nests. - -When I prepare a file system summary report on Unix, a handful of Unix commands easily provide some very useful statistics. To count the files in a directory, you can use a find command like this. - - $ find . -type f | wc -l - 187534 - -Finding the oldest and newest files is a bit more complicated, but still quite easy. In the commands below, we're using the find command again to find files, displaying the data with a year-month-day format that makes it possible to sort by file age, and then displaying the top -- thus the oldest -- file in that list. - -In the second command, we do the same, but print the last line -- thus the newest -- file. - - $ find -type f -printf '%T+ %p\n' | sort | head -n 1 - 2006-02-03+02:40:33 ./skel/.xemacs/init.el - $ find -type f -printf '%T+ %p\n' | sort | tail -n 1 - 2015-07-19+14:20:16 ./.bash_history - -The %T (file date and time) and %p (file name with path) parameters with the printf command allow this to work. - -If we're looking at home directories, we're undoubtedly going to find that history files are the newest files and that isn't likely to be a very interesting bit of information. You can omit those files by "un-grepping" them or you can omit all files that start with dots as shown below. - - $ find -type f -printf '%T+ %p\n' | grep -v "\./\." | sort | tail -n 1 - 2015-07-19+13:02:12 ./isPrime - -Finding the largest file involves using the %s (size) parameter and we include the file name (%f) since that's what we want the report to show. - - $ find -type f -printf '%s %f \n' | sort -n | uniq | tail -1 - 20183040 project.org.tar - -To summarize file ownership, use the %u (owner) - - $ find -type f -printf '%u \n' | grep -v "\./\." | sort | uniq -c - 180034 shs - 7500 jdoe - -If your file system also records the last access date, it can be very useful to show that files haven't been accessed in, say, more than two years. This would give your reviewers an important insight into the value of those files. The last access parameter (%a) could be used like this: - - $ find -type f -printf '%a+ %p\n' | sort | head -n 1 - Fri Dec 15 03:00:30 2006+ ./statreport - -Of course, if the most recently accessed file is also in the deep dark past, that's likely to get even more of a reaction. - - $ find -type f -printf '%a+ %p\n' | sort | tail -n 1 - Wed Nov 26 03:00:27 2007+ ./my-notes - -Getting a sense of what's in a file system or large directory by creating a summary report showing the file date ranges, the largest files, the file owners, and the oldest and new access times can help to demonstrate how current and how important a file collection is and help its owners decide if it's time to clean up. - --------------------------------------------------------------------------------- - -via: http://www.itworld.com/article/2949898/linux/profiling-your-file-systems.html - -作者:[Sandra Henry-Stocker][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.itworld.com/author/Sandra-Henry_Stocker/ From 63ad6aab7dce0df6174c05b1dd83a62405af46f3 Mon Sep 17 00:00:00 2001 From: struggling <630441839@qq.com> Date: Fri, 7 Aug 2015 00:27:30 +0800 Subject: [PATCH 837/965] Create 20150803 Handy commands for profiling your Unix file systems.md --- ...ds for profiling your Unix file systems.md | 66 +++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 translated/tech/20150803 Handy commands for profiling your Unix file systems.md diff --git a/translated/tech/20150803 Handy commands for profiling your Unix file systems.md b/translated/tech/20150803 Handy commands for profiling your Unix file systems.md new file mode 100644 index 0000000000..13efdcf0a1 --- /dev/null +++ b/translated/tech/20150803 Handy commands for profiling your Unix file systems.md @@ -0,0 +1,66 @@ + +很实用的命令来分析你的 Unix 文件系统 +================================================================================ +![Credit: Sandra H-S](http://images.techhive.com/images/article/2015/07/file-profile-100597239-primary.idge.png) +Credit: Sandra H-S + +其中一个问题几乎困扰着所有的文件系统 -- 包括 Unix 和其他的 -- 那就是文件的不断积累。几乎没有人愿意花时间清理掉他们不再使用的文件和文件系统,结果,文件变得很混乱,很难找到有用的东西使它们运行良好,能够得到备份,并且易于管理,这将是一种持久的挑战。 + +我见过的一种解决问题的方法是鼓励使用者将所有的数据碎屑创建成一个总结报告或"profile"这样一个文件集合来报告所有的文件数量;最老的,最新的,最大的文件;并统计谁拥有这些文件。如果有人看到一个包含五十万个文件的文件夹并且时间不小于五年,他们可能会去删除哪些文件 -- 或者,至少归档和压缩。主要问题是太大的文件夹会使人产生压制性害怕误删一些重要的东西。有一个描述文件夹的方法能帮助显示文件的性质并期待你去清理它。 + + +当我准备做 Unix 文件系统的总结报告时,几个有用的 Unix 命令能提供一些非常有用的统计信息。要计算目录中的文件数,你可以使用这样一个 find 命令。 + + $ find . -type f | wc -l + 187534 + +查找最老的和最新的文件是比较复杂,但还是相当方便的。在下面的命令,我们使用 find 命令再次查找文件,以文件时间排序并按年-月-日的格式显示在顶部 -- 因此最老的 -- 的文件在列表中。 + +在第二个命令,我们做同样的,但打印的是最后一行 -- 这是最新的 -- 文件 + + $ find -type f -printf '%T+ %p\n' | sort | head -n 1 + 2006-02-03+02:40:33 ./skel/.xemacs/init.el + $ find -type f -printf '%T+ %p\n' | sort | tail -n 1 + 2015-07-19+14:20:16 ./.bash_history + +printf 命令输出 %T(文件日期和时间)和 %P(带路径的文件名)参数。 + +如果我们在查找家目录时,无疑会发现,history 文件是最新的,这不像是一个很有趣的信息。你可以通过 "un-grepping" 来忽略这些文件,也可以忽略以.开头的文件,如下图所示的。 + + $ find -type f -printf '%T+ %p\n' | grep -v "\./\." | sort | tail -n 1 + 2015-07-19+13:02:12 ./isPrime + +寻找最大的文件使用 %s(大小)参数,包括文件名(%f),因为这就是我们想要在报告中显示的。 + + $ find -type f -printf '%s %f \n' | sort -n | uniq | tail -1 + 20183040 project.org.tar + +打印文件的所有着者,使用%u(所有者) + + $ find -type f -printf '%u \n' | grep -v "\./\." | sort | uniq -c + 180034 shs + 7500 jdoe + +如果文件系统能记录上次的访问日期,也将是非常有用的来看该文件有没有被访问,比方说,两年之内。这将使你能明确分辨这些文件的价值。最后一个访问参数(%a)这样使用: + + $ find -type f -printf '%a+ %p\n' | sort | head -n 1 + Fri Dec 15 03:00:30 2006+ ./statreport + +当然,如果最近​​访问的文件也是在很久之前的,这将使你有更多的处理时间。 + + $ find -type f -printf '%a+ %p\n' | sort | tail -n 1 + Wed Nov 26 03:00:27 2007+ ./my-notes + +一个文件系统要层次分明,为大目录创建一个总结报告,显示该文件的日期范围,最大的文件,文件所有者,最老的和访问时间都可以帮助文件拥有者判断当前有哪些文件夹是重要的哪些该清理了。 + +-------------------------------------------------------------------------------- + +via: http://www.itworld.com/article/2949898/linux/profiling-your-file-systems.html + +作者:[Sandra Henry-Stocker][a] +译者:[strugglingyouth](https://github.com/strugglingyouth) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.itworld.com/author/Sandra-Henry_Stocker/ From e33f5e9a1b751567fb5498697363c30c48dff32e Mon Sep 17 00:00:00 2001 From: wxy Date: Fri, 7 Aug 2015 00:35:21 +0800 Subject: [PATCH 838/965] PUB:20150806 5 Reasons Why Software Developer is a Great Career Choice MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @mousycoder 明早9:30 发布:https://linux.cn/article-5971-1.html 原文现在取消了大部分配图(配图有问题),所以我也取消了。 翻译的不错,我基本没怎么改动。 --- ...ware Developer is a Great Career Choice.md | 75 +++++++++++++++ ...ware Developer is a Great Career Choice.md | 91 ------------------- 2 files changed, 75 insertions(+), 91 deletions(-) create mode 100644 published/20150806 5 Reasons Why Software Developer is a Great Career Choice.md delete mode 100644 translated/talk/20150806 5 Reasons Why Software Developer is a Great Career Choice.md diff --git a/published/20150806 5 Reasons Why Software Developer is a Great Career Choice.md b/published/20150806 5 Reasons Why Software Developer is a Great Career Choice.md new file mode 100644 index 0000000000..12831e66ad --- /dev/null +++ b/published/20150806 5 Reasons Why Software Developer is a Great Career Choice.md @@ -0,0 +1,75 @@ +选择成为软件开发工程师的5个原因 +================================================================================ + +![](http://henrikwarne1.files.wordpress.com/2011/09/cropped-desk1.jpg) + +这个星期我将给本地一所高中做一次有关于程序猿是怎样工作的演讲。我是志愿(由 [Transfer][1] 组织的)来到这所学校谈论我的工作的。这个学校本周将有一个技术主题日,并且他们很想听听科技行业是怎样工作的。因为我是从事软件开发的,这也是我将和学生们讲的内容。演讲的其中一部分是我为什么觉得软件开发是一个很酷的职业。主要原因如下: + +### 5个原因 ### + +**1、创造性** + +如果你问别人创造性的工作有哪些,别人通常会说像作家,音乐家或者画家那样的(工作)。但是极少有人知道软件开发也是一项非常具有创造性的工作。它是最符合创造性定义的了,因为你创造了一个以前没有的新功能。这种解决方案可以在整体和细节上以很多形式来展现。我们经常会遇到一些需要做权衡的场景(比如说运行速度与内存消耗的权衡)。当然前提是这种解决方案必须是正确的。这些所有的行为都是需要强大的创造性的。 + +**2、协作性** + +另外一个表象是程序猿们独自坐在他们的电脑前,然后撸一天的代码。但是软件开发事实上通常总是一个团队努力的结果。你会经常和你的同事讨论编程问题以及解决方案,并且和产品经理、测试人员、客户讨论需求以及其他问题。 +经常有人说,结对编程(2个开发人员一起在一个电脑上编程)是一种流行的最佳实践。 + +**3、高需性** + +世界上越来越多的人在用软件,正如 [Marc Andreessen](https://en.wikipedia.org/wiki/Marc_Andreessen) 所说 " [软件正在吞噬世界][2] "。虽然程序猿现在的数量非常巨大(在斯德哥尔摩,程序猿现在是 [最普遍的职业][3] ),但是,需求量一直处于供不应求的局面。据软件公司说,他们最大的挑战之一就是 [找到优秀的程序猿][4] 。我也经常接到那些想让我跳槽的招聘人员打来的电话。我知道至少除软件行业之外的其他行业的雇主不会那么拼(的去招聘)。 + +**4、高酬性** + +软件开发可以带来不菲的收入。卖一份你已经开发好的软件的额外副本是没有 [边际成本][5] 的。这个事实与对程序猿的高需求意味着收入相当可观。当然还有许多更捞金的职业,但是相比一般人群,我认为软件开发者确实“日进斗金”(知足吧!骚年~~)。 + +**5、前瞻性** + +有许多工作岗位消失,往往是由于它们可以被计算机和软件代替。但是所有这些新的程序依然需要开发和维护,因此,程序猿的前景还是相当好的。 + +### 但是...### + +**外包又是怎么一回事呢?** + +难道所有外包到其他国家的软件开发的薪水都很低吗?这是一个理想丰满,现实骨感的例子(有点像 [瀑布开发模型][6] )。软件开发基本上跟设计的工作一样,是一个探索发现的工作。它受益于强有力的合作。更进一步说,特别当你的主打产品是软件的时候,你所掌握的开发知识是绝对的优势。知识在整个公司中分享的越容易,那么公司的发展也将越来越好。 + +换一种方式去看待这个问题。软件外包已经存在了相当一段时间了。但是对本土程序猿的需求量依旧非常高。因为许多软件公司看到了雇佣本土程序猿的带来的收益要远远超过了相对较高的成本(其实还是赚了)。 + +### 如何成为人生大赢家 ### + +虽然我有许多我认为软件开发是一件非常有趣的事情的理由 (详情见: [为什么我热爱编程][7] )。但是这些理由,并不适用于所有人。幸运的是,尝试编程是一件非常容易的事情。在互联网上有数不尽的学习编程的资源。例如,[Coursera][8] 和 [Udacity][9] 都拥有很好的入门课程。如果你从来没有撸过码,可以尝试其中一个免费的课程,找找感觉。 + +寻找一个既热爱又能谋生的事情至少有2个好处。首先,由于你天天去做,工作将比你简单的只为谋生要有趣的多。其次,如果你真的非常喜欢,你将更好的擅长它。我非常喜欢下面一副关于伟大工作组成的韦恩图(作者 [@eskimon)][10]) 。因为编码的薪水确实相当不错,我认为如果你真的喜欢它,你将有一个很好的机会,成为人生的大赢家! + +![](http://7xjl4u.com1.z0.glb.clouddn.com/15-8-6/17571624.jpg) + +-------------------------------------------------------------------------------- + +via: http://henrikwarne.com/2014/12/08/5-reasons-why-software-developer-is-a-great-career-choice/ + +作者:[Henrik Warne][a] +译者:[mousycoder](https://github.com/mousycoder) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + + +[a]:http://henrikwarne.com/ +[1]:http://www.transfer.nu/omoss/transferinenglish.jspx?pageId=23 +[2]:http://www.wsj.com/articles/SB10001424053111903480904576512250915629460 +[3]:http://www.di.se/artiklar/2014/6/12/jobbet-som-tar-over-landet/ +[4]:http://computersweden.idg.se/2.2683/1.600324/examinationstakten-racker-inte-for-branschens-behov +[5]:https://en.wikipedia.org/wiki/Marginal_cost +[6]:https://en.wikipedia.org/wiki/Waterfall_model +[7]:http://henrikwarne.com/2012/06/02/why-i-love-coding/ +[8]:https://www.coursera.org/ +[9]:https://www.udacity.com/ +[10]:https://eskimon.wordpress.com/about/ + + + + + + + diff --git a/translated/talk/20150806 5 Reasons Why Software Developer is a Great Career Choice.md b/translated/talk/20150806 5 Reasons Why Software Developer is a Great Career Choice.md deleted file mode 100644 index a592cb595e..0000000000 --- a/translated/talk/20150806 5 Reasons Why Software Developer is a Great Career Choice.md +++ /dev/null @@ -1,91 +0,0 @@ -选择软件开发攻城师的5个原因 -================================================================================ -这个星期我将给本地一所高中做一次有关于程序猿是怎样工作的演讲,我是 [Transfer][1] 组织推荐来到这所学校,谈论我的工作。这个学校本周将有一个技术主题日,并且他们很想听听科技行业是怎样工作的。因为我是从事软件开发的,这也是我将和学生们讲的内容。我为什么觉得软件开发是一个很酷的职业将是演讲的其中一部分。主要原因如下: - -### 5个原因 ### - -**1 创造性** - -![](http://7xjl4u.com1.z0.glb.clouddn.com/15-8-6/34042817.jpg) - -如果你问别人创造性的工作有哪些,别人通常会说像作家,音乐家或者画家那样的(工作)。但是极少有人知道软件开发也是一项非常具有创造性的工作。因为你创造了一个以前没有的新功能,这样的功能基本上可以被定义为非常具有创造性。这种解决方案可以在整体和细节上以很多形式来展现。我们经常会遇到一些需要做权衡的场景(比如说运行速度与内存消耗的权衡)。当然前提是这种解决方案必须是正确的。其实这些所有的行为都是需要强大的创造性的。 - -**2 协作性** - -![](http://7xjl4u.com1.z0.glb.clouddn.com/15-8-6/94579377.jpg) - -另外一个表象是程序猿们独自坐在他们的电脑前,然后撸一天的代码。但是软件开发事实上通常总是一个团队努力的结果。你会经常和你的同事讨论编程问题以及解决方案,并且和产品经理,测试人员,客户讨论需求以及其他问题。 -经常有人说,结对编程(2个开发人员一起在一个电脑上编程)是一种流行的最佳实践。 - - -**3 高需性** - -![](http://7xjl4u.com1.z0.glb.clouddn.com/15-8-6/26662164.jpg) - -世界上越来越多的人在用软件,正如 [Marc Andreessen](https://en.wikipedia.org/wiki/Marc_Andreessen) 所说 " [软件正在吞噬世界][2] "。虽然程序猿现在的数量非常巨大(在斯德哥尔摩,程序猿现在是 [最普遍的职业][3] ),但是,需求量一直处于供不应求的局面。据软件公司报告,他们最大的挑战之一就是 [找到优秀的程序猿][4] 。我也经常接到那些想让我跳槽的招聘人员打来的电话。我知道至少除软件行业之外的其他行业的雇主不会那么拼(的去招聘)。 - -**4 高酬性** - - -![](http://7xjl4u.com1.z0.glb.clouddn.com/15-8-6/50538928.jpg) - -软件开发可以带来不菲的收入。卖一份你已经开发好的软件的额外副本是没有 [边际成本][5] 的。这个事实与对程序猿的高需求意味着收入相当可观。当然还有许多更捞金的职业,但是相比一般人群,我认为软件开发者确实“日进斗金”(知足吧!骚年~~)。 - -**5 前瞻性** - -![](http://7xjl4u.com1.z0.glb.clouddn.com/15-8-6/89799239.jpg) - -有许多工作岗位消失,往往是由于它们可以被计算机和软件代替。但是所有这些新的程序依然需要开发和维护,因此,程序猿的前景还是相当好的。 - - -### 但是...### - -**外包又是怎么一回事呢?** - -![](http://7xjl4u.com1.z0.glb.clouddn.com/15-8-6/41615753.jpg) - -难道所有外包到其他地区的软件开发的薪水都很低吗?这是一个理想丰满,现实骨感的例子(有点像 [瀑布开发模型][6] )。软件开发基本上跟设计的工作一样,是一个探索发现的工作。它受益于强有力的合作。更进一步说,特别当你的主打产品是软件的时候,你所掌握的开发知识是绝对的优势。知识在整个公司中分享的越容易,那么公司的发展也将越来越好。 - - -换一种方式去看待这个问题。软件外包已经存在了相当一段时间了。但是对本土程序猿的需求量依旧非常高。因为许多软件公司看到了雇佣本土程序猿的带来的收益要远远超过了相对较高的成本(其实还是赚了)。 - -### 如何成为人生大赢家 ### - - -![](http://7xjl4u.com1.z0.glb.clouddn.com/15-8-6/44219908.jpg) - -虽然我有许多我认为软件开发是一件非常有趣的事情的理由 (详情见: [为什么我热爱编程][7] )。但是这些理由,并不适用于所有人。幸运的是,尝试编程是一件非常容易的事情。在互联网上有数不尽的学习编程的资源。例如,[Coursera][8] 和 [Udacity][9] 都拥有很好的入门课程。如果你从来没有撸过码,可以尝试其中一个免费的课程,找找感觉。 - -寻找一个既热爱又能谋生的事情至少有2个好处。首先,由于你天天去做,工作将比你简单的只为谋生要有趣的多。其次,如果你真的非常喜欢,你将更好的擅长它。我非常喜欢下面一副关于伟大工作组成的韦恩图(作者 [@eskimon)][10] 。因为编码的薪水确实相当不错,我认为如果你真的喜欢它,你将有一个很好的机会,成为人生的大赢家! - -![](http://7xjl4u.com1.z0.glb.clouddn.com/15-8-6/17571624.jpg) - --------------------------------------------------------------------------------- - -via: http://henrikwarne.com/2014/12/08/5-reasons-why-software-developer-is-a-great-career-choice/ - -作者:[Henrik Warne][a] -译者:[mousycoder](https://github.com/mousycoder) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - - -[a]:http://henrikwarne.com/ -[1]:http://www.transfer.nu/omoss/transferinenglish.jspx?pageId=23 -[2]:http://www.wsj.com/articles/SB10001424053111903480904576512250915629460 -[3]:http://www.di.se/artiklar/2014/6/12/jobbet-som-tar-over-landet/ -[4]:http://computersweden.idg.se/2.2683/1.600324/examinationstakten-racker-inte-for-branschens-behov -[5]:https://en.wikipedia.org/wiki/Marginal_cost -[6]:https://en.wikipedia.org/wiki/Waterfall_model -[7]:http://henrikwarne.com/2012/06/02/why-i-love-coding/ -[8]:https://www.coursera.org/ -[9]:https://www.udacity.com/ -[10]:https://eskimon.wordpress.com/about/ - - - - - - - From bc21018f00e1834be2d8c597855f247441788256 Mon Sep 17 00:00:00 2001 From: Ping Date: Fri, 7 Aug 2015 08:20:37 +0800 Subject: [PATCH 839/965] Translating --- ...06 Linux FAQs with Answers--How to install git on Linux.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150806 Linux FAQs with Answers--How to install git on Linux.md b/sources/tech/20150806 Linux FAQs with Answers--How to install git on Linux.md index c5c34f3a72..c9610a2dfe 100644 --- a/sources/tech/20150806 Linux FAQs with Answers--How to install git on Linux.md +++ b/sources/tech/20150806 Linux FAQs with Answers--How to install git on Linux.md @@ -1,3 +1,5 @@ +Translating by Ping + Linux FAQs with Answers--How to install git on Linux ================================================================================ > **Question:** I am trying to clone a project from a public Git repository, but I am getting "git: command not found" error. How can I install git on [insert your Linux distro]? @@ -69,4 +71,4 @@ via: http://ask.xmodulo.com/install-git-linux.html 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 [a]:http://ask.xmodulo.com/author/nanni -[1]:https://github.com/git/git/releases \ No newline at end of file +[1]:https://github.com/git/git/releases From 6d313b52541e7bfd243825ad0a9d06a78d7c998b Mon Sep 17 00:00:00 2001 From: joeren Date: Fri, 7 Aug 2015 08:54:23 +0800 Subject: [PATCH 840/965] Update 20150806 Linux FAQs with Answers--How to fix 'ImportError--No module named wxversion' on Linux.md --- ...to fix 'ImportError--No module named wxversion' on Linux.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150806 Linux FAQs with Answers--How to fix 'ImportError--No module named wxversion' on Linux.md b/sources/tech/20150806 Linux FAQs with Answers--How to fix 'ImportError--No module named wxversion' on Linux.md index 11d814d8f4..66af8413fd 100644 --- a/sources/tech/20150806 Linux FAQs with Answers--How to fix 'ImportError--No module named wxversion' on Linux.md +++ b/sources/tech/20150806 Linux FAQs with Answers--How to fix 'ImportError--No module named wxversion' on Linux.md @@ -1,3 +1,4 @@ +Translating by GOLinux! Linux FAQs with Answers--How to fix “ImportError: No module named wxversion” on Linux ================================================================================ > **Question:** I was trying to run a Python application on [insert your Linux distro], but I got an error "ImportError: No module named wxversion." How can I solve this error in the Python program? @@ -46,4 +47,4 @@ via: http://ask.xmodulo.com/importerror-no-module-named-wxversion.html [a]:http://ask.xmodulo.com/author/nanni [1]:http://wxpython.org/ -[2]:http://xmodulo.com/how-to-set-up-epel-repository-on-centos.html \ No newline at end of file +[2]:http://xmodulo.com/how-to-set-up-epel-repository-on-centos.html From f26be7487f95cd3f5098ab147e42da5e74d599e0 Mon Sep 17 00:00:00 2001 From: Jindong Huang Date: Fri, 7 Aug 2015 08:59:37 +0800 Subject: [PATCH 841/965] =?UTF-8?q?=E3=80=90Translating=20by=20dingdongnig?= =?UTF-8?q?etou=E3=80=9120150730=20Howto=20Configure=20Nginx=20as=20Rrever?= =?UTF-8?q?se=20Proxy=20or=20Load=20Balancer=20with=20Weave=20and=20Docker?= =?UTF-8?q?.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... Rreverse Proxy or Load Balancer with Weave and Docker.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150730 Howto Configure Nginx as Rreverse Proxy or Load Balancer with Weave and Docker.md b/sources/tech/20150730 Howto Configure Nginx as Rreverse Proxy or Load Balancer with Weave and Docker.md index 82c592d3b4..f217db9c70 100644 --- a/sources/tech/20150730 Howto Configure Nginx as Rreverse Proxy or Load Balancer with Weave and Docker.md +++ b/sources/tech/20150730 Howto Configure Nginx as Rreverse Proxy or Load Balancer with Weave and Docker.md @@ -1,3 +1,6 @@ + +Translating by dingdongnigetou + Howto Configure Nginx as Rreverse Proxy / Load Balancer with Weave and Docker ================================================================================ Hi everyone today we'll learnHowto configure Nginx as Rreverse Proxy / Load balancer with Weave and Docker Weave creates a virtual network that connects Docker containers with each other, deploys across multiple hosts and enables their automatic discovery. It allows us to focus on developing our application, rather than our infrastructure. It provides such an awesome environment that the applications uses the network as if its containers were all plugged into the same network without need to configure ports, mappings, link, etc. The services of the application containers on the network can be easily accessible to the external world with no matter where its running. Here, in this tutorial we'll be using weave to quickly and easily deploy nginx web server as a load balancer for a simple php application running in docker containers on multiple nodes in Amazon Web Services. Here, we will be introduced to WeaveDNS, which provides a simple way for containers to find each other using hostname with no changes in codes and tells other containers to connect to those names. @@ -123,4 +126,4 @@ via: http://linoxide.com/linux-how-to/nginx-load-balancer-weave-docker/ 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 [a]:http://linoxide.com/author/arunp/ -[1]:http://console.aws.amazon.com/ \ No newline at end of file +[1]:http://console.aws.amazon.com/ From dfa1d5bf8796e70c8ee522a1bb67e6d68efd97a0 Mon Sep 17 00:00:00 2001 From: GOLinux Date: Fri, 7 Aug 2015 09:09:47 +0800 Subject: [PATCH 842/965] [Translated]20150806 Linux FAQs with Answers--How to fix 'ImportError--No module named wxversion' on Linux.md --- ...or--No module named wxversion' on Linux.md | 50 ------------------- ...or--No module named wxversion' on Linux.md | 49 ++++++++++++++++++ 2 files changed, 49 insertions(+), 50 deletions(-) delete mode 100644 sources/tech/20150806 Linux FAQs with Answers--How to fix 'ImportError--No module named wxversion' on Linux.md create mode 100644 translated/tech/20150806 Linux FAQs with Answers--How to fix 'ImportError--No module named wxversion' on Linux.md diff --git a/sources/tech/20150806 Linux FAQs with Answers--How to fix 'ImportError--No module named wxversion' on Linux.md b/sources/tech/20150806 Linux FAQs with Answers--How to fix 'ImportError--No module named wxversion' on Linux.md deleted file mode 100644 index 66af8413fd..0000000000 --- a/sources/tech/20150806 Linux FAQs with Answers--How to fix 'ImportError--No module named wxversion' on Linux.md +++ /dev/null @@ -1,50 +0,0 @@ -Translating by GOLinux! -Linux FAQs with Answers--How to fix “ImportError: No module named wxversion” on Linux -================================================================================ -> **Question:** I was trying to run a Python application on [insert your Linux distro], but I got an error "ImportError: No module named wxversion." How can I solve this error in the Python program? - - Looking for python... 2.7.9 - Traceback (most recent call last): - File "/home/dev/playonlinux/python/check_python.py", line 1, in - import os, wxversion - ImportError: No module named wxversion - failed tests - -This error indicates that your Python application is GUI-based, relying on a missing Python module called wxPython. [wxPython][1] is a Python extension module for the wxWidgets GUI library, popularly used by C++ programmers to design GUI applications. The wxPython extension allows Python developers to easily design and integrate GUI within any Python application. - -To solve this import error, you need to install wxPython on your Linux, as described below. - -### Install wxPython on Debian, Ubuntu or Linux Mint ### - - $ sudo apt-get install python-wxgtk2.8 - -### Install wxPython on Fedora ### - - $ sudo yum install wxPython - -### Install wxPython on CentOS/RHEL ### - -wxPython is available on the EPEL repository of CentOS/RHEL, not on base repositories. Thus, first [enable EPEL repository][2] on your system, and then use yum command. - - $ sudo yum install wxPython - -### Install wxPython on Arch Linux ### - - $ sudo pacman -S wxpython - -### Install wxPython on Gentoo ### - - $ emerge wxPython - --------------------------------------------------------------------------------- - -via: http://ask.xmodulo.com/importerror-no-module-named-wxversion.html - -作者:[Dan Nanni][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://ask.xmodulo.com/author/nanni -[1]:http://wxpython.org/ -[2]:http://xmodulo.com/how-to-set-up-epel-repository-on-centos.html diff --git a/translated/tech/20150806 Linux FAQs with Answers--How to fix 'ImportError--No module named wxversion' on Linux.md b/translated/tech/20150806 Linux FAQs with Answers--How to fix 'ImportError--No module named wxversion' on Linux.md new file mode 100644 index 0000000000..2a937daeff --- /dev/null +++ b/translated/tech/20150806 Linux FAQs with Answers--How to fix 'ImportError--No module named wxversion' on Linux.md @@ -0,0 +1,49 @@ +Linux有问必答——如何修复Linux上的“ImportError: No module named wxversion”错误 +================================================================================ + +> **问题** 我试着在[你的Linux发行版]上运行一个Python应用,但是我得到了这个错误"ImportError: No module named wxversion."。我怎样才能解决Python程序中的这个错误呢? + + Looking for python... 2.7.9 - Traceback (most recent call last): + File "/home/dev/playonlinux/python/check_python.py", line 1, in + import os, wxversion + ImportError: No module named wxversion + failed tests + +该错误表明,你的Python应用是基于GUI的,依赖于一个名为wxPython的缺失模块。[wxPython][1]是一个用于wxWidgets GUI库的Python扩展模块,普遍被C++程序员用来设计GUI应用。该wxPython扩展允许Python开发者在任何Python应用中方便地设计和整合GUI。 +To solve this import error, you need to install wxPython on your Linux, as described below. + +### 安装wxPython到Debian,Ubuntu或Linux Mint ### + + $ sudo apt-get install python-wxgtk2.8 + +### 安装wxPython到Fedora ### + + $ sudo yum install wxPython + +### 安装wxPython到CentOS/RHEL ### + +wxPython可以在CentOS/RHEL的EPEL仓库中获取到,而基本仓库中则没有。因此,首先要在你的系统中[启用EPEL仓库][2],然后使用yum命令来安装。 + + $ sudo yum install wxPython + +### 安装wxPython到Arch Linux ### + + $ sudo pacman -S wxpython + +### 安装wxPython到Gentoo ### + + $ emerge wxPython + +-------------------------------------------------------------------------------- + +via: http://ask.xmodulo.com/importerror-no-module-named-wxversion.html + +作者:[Dan Nanni][a] +译者:[GOLinux](https://github.com/GOLinux) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://ask.xmodulo.com/author/nanni +[1]:http://wxpython.org/ +[2]:http://xmodulo.com/how-to-set-up-epel-repository-on-centos.html From 09b98f265e23ed5ec0c759f2e16c749288a47728 Mon Sep 17 00:00:00 2001 From: joeren Date: Fri, 7 Aug 2015 09:11:45 +0800 Subject: [PATCH 843/965] Update 20150806 Linux FAQs with Answers--How to enable logging in Open vSwitch for debugging and troubleshooting.md --- ...ogging in Open vSwitch for debugging and troubleshooting.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150806 Linux FAQs with Answers--How to enable logging in Open vSwitch for debugging and troubleshooting.md b/sources/tech/20150806 Linux FAQs with Answers--How to enable logging in Open vSwitch for debugging and troubleshooting.md index 2b4e16bcaf..dcf811a003 100644 --- a/sources/tech/20150806 Linux FAQs with Answers--How to enable logging in Open vSwitch for debugging and troubleshooting.md +++ b/sources/tech/20150806 Linux FAQs with Answers--How to enable logging in Open vSwitch for debugging and troubleshooting.md @@ -1,3 +1,4 @@ +Translating by GOlinu! Linux FAQs with Answers--How to enable logging in Open vSwitch for debugging and troubleshooting ================================================================================ > **Question:** I am trying to troubleshoot my Open vSwitch deployment. For that I would like to inspect its debug messages generated by its built-in logging mechanism. How can I enable logging in Open vSwitch, and change its logging level (e.g., to INFO/DEBUG level) to check more detailed debug information? @@ -66,4 +67,4 @@ via: http://ask.xmodulo.com/enable-logging-open-vswitch.html 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 -[a]:http://ask.xmodulo.com/author/nanni \ No newline at end of file +[a]:http://ask.xmodulo.com/author/nanni From 6323f7946f874af701db19742a8c6931b59aeb11 Mon Sep 17 00:00:00 2001 From: Ping Date: Fri, 7 Aug 2015 09:39:48 +0800 Subject: [PATCH 844/965] Complete 20150806 Linux FAQs with Answers--How to install git on Linux.md --- ...th Answers--How to install git on Linux.md | 74 ------------------- ...th Answers--How to install git on Linux.md | 73 ++++++++++++++++++ 2 files changed, 73 insertions(+), 74 deletions(-) delete mode 100644 sources/tech/20150806 Linux FAQs with Answers--How to install git on Linux.md create mode 100644 translated/tech/20150806 Linux FAQs with Answers--How to install git on Linux.md diff --git a/sources/tech/20150806 Linux FAQs with Answers--How to install git on Linux.md b/sources/tech/20150806 Linux FAQs with Answers--How to install git on Linux.md deleted file mode 100644 index c9610a2dfe..0000000000 --- a/sources/tech/20150806 Linux FAQs with Answers--How to install git on Linux.md +++ /dev/null @@ -1,74 +0,0 @@ -Translating by Ping - -Linux FAQs with Answers--How to install git on Linux -================================================================================ -> **Question:** I am trying to clone a project from a public Git repository, but I am getting "git: command not found" error. How can I install git on [insert your Linux distro]? - -Git is a popular open-source version control system (VCS) originally developed for Linux environment. Contrary to other VCS tools like CVS or SVN, Git's revision control is considered "distributed" in a sense that your local Git working directory can function as a fully-working repository with complete history and version-tracking capabilities. In this model, each collaborator commits to his or her local repository (as opposed to always committing to a central repository), and optionally push to a centralized repository if need be. This brings in scalability and redundancy to the revision control system, which is a must in any kind of large-scale collaboration. - -![](https://farm1.staticflickr.com/341/19433194168_c79d4570aa_b.jpg) - -### Install Git with a Package Manager ### - -Git is shipped with all major Linux distributions. Thus the easiest way to install Git is by using your Linux distro's package manager. - -**Debian, Ubuntu, or Linux Mint** - - $ sudo apt-get install git - -**Fedora, CentOS or RHEL** - - $ sudo yum install git - -**Arch Linux** - - $ sudo pacman -S git - -**OpenSUSE** - - $ sudo zypper install git - -**Gentoo** - - $ emerge --ask --verbose dev-vcs/git - -### Install Git from the Source ### - -If for whatever reason you want to built Git from the source, you can follow the instructions below. - -**Install Dependencies** - -Before building Git, first install dependencies. - -**Debian, Ubuntu or Linux** - - $ sudo apt-get install libcurl4-gnutls-dev libexpat1-dev gettext libz-dev libssl-dev asciidoc xmlto docbook2x - -**Fedora, CentOS or RHEL** - - $ sudo yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel asciidoc xmlto docbook2x - -#### Compile Git from the Source #### - -Download the latest release of Git from [https://github.com/git/git/releases][1]. Then build and install Git under /usr as follows. - -Note that if you want to install it under a different directory (e.g., /opt), replace "--prefix=/usr" in configure command with something else. - - $ cd git-x.x.x - $ make configure - $ ./configure --prefix=/usr - $ make all doc info - $ sudo make install install-doc install-html install-info - --------------------------------------------------------------------------------- - -via: http://ask.xmodulo.com/install-git-linux.html - -作者:[Dan Nanni][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://ask.xmodulo.com/author/nanni -[1]:https://github.com/git/git/releases diff --git a/translated/tech/20150806 Linux FAQs with Answers--How to install git on Linux.md b/translated/tech/20150806 Linux FAQs with Answers--How to install git on Linux.md new file mode 100644 index 0000000000..e6d3f59c71 --- /dev/null +++ b/translated/tech/20150806 Linux FAQs with Answers--How to install git on Linux.md @@ -0,0 +1,73 @@ +Linux问答 -- 如何在Linux上安装Git +================================================================================ + +> **问题:** 我尝试从一个Git公共仓库克隆项目,但出现了这样的错误提示:“git: command not found”。 请问我该如何安装Git? [注明一下是哪个Linux发行版]? + +Git是一个流行的并且开源的版本控制系统(VCS),最初是为Linux环境开发的。跟CVS或者SVN这些版本控制系统不同的是,Git的版本控制被认为是“分布式的”,某种意义上,git的本地工作目录可以作为一个功能完善的仓库来使用,它具备完整的历史记录和版本追踪能力。在这种工作模型之下,各个协作者将内容提交到他们的本地仓库中(与之相对的会直接提交到核心仓库),如果有必要,再有选择性地推送到核心仓库。这就为Git这个版本管理系统带来了大型协作系统所必须的可扩展能力和冗余能力。 + +![](https://farm1.staticflickr.com/341/19433194168_c79d4570aa_b.jpg) + +### 使用包管理器安装Git ### + +Git已经被所有的主力Linux发行版所支持。所以安装它最简单的方法就是使用各个Linux发行版的包管理器。 + +**Debian, Ubuntu, 或 Linux Mint** + + $ sudo apt-get install git + +**Fedora, CentOS 或 RHEL** + + $ sudo yum install git + +**Arch Linux** + + $ sudo pacman -S git + +**OpenSUSE** + + $ sudo zypper install git + +**Gentoo** + + $ emerge --ask --verbose dev-vcs/git + +### 从源码安装Git ### + +如果由于某些原因,你希望从源码安装Git,安装如下介绍操作。 + +**安装依赖包** + +在构建Git之前,先安装它的依赖包。 + +**Debian, Ubuntu 或 Linux Mint** + + $ sudo apt-get install libcurl4-gnutls-dev libexpat1-dev gettext libz-dev libssl-dev asciidoc xmlto docbook2x + +**Fedora, CentOS 或 RHEL** + + $ sudo yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel asciidoc xmlto docbook2x + +#### 从源码编译Git #### + +从 [https://github.com/git/git/releases][1] 下载最新版本的Git。然后在/usr下构建和安装。 + +注意,如果你打算安装到其他目录下(例如:/opt),那就把"--prefix=/usr"这个配置命令使用其他路径替换掉。 + + $ cd git-x.x.x + $ make configure + $ ./configure --prefix=/usr + $ make all doc info + $ sudo make install install-doc install-html install-info + +-------------------------------------------------------------------------------- + +via: http://ask.xmodulo.com/install-git-linux.html + +作者:[Dan Nanni][a] +译者:[mr-ping](https://github.com/mr-ping) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://ask.xmodulo.com/author/nanni +[1]:https://github.com/git/git/releases From b2706ff03ec3218931128a03bca7fd05b28817e0 Mon Sep 17 00:00:00 2001 From: ZTinoZ Date: Fri, 7 Aug 2015 09:52:37 +0800 Subject: [PATCH 845/965] Translating by ZTinoZ --- sources/talk/20150806 5 heroes of the Linux world.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/talk/20150806 5 heroes of the Linux world.md b/sources/talk/20150806 5 heroes of the Linux world.md index ae35d674a1..5b5485198c 100644 --- a/sources/talk/20150806 5 heroes of the Linux world.md +++ b/sources/talk/20150806 5 heroes of the Linux world.md @@ -1,3 +1,4 @@ +Translating by ZTinoZ 5 heroes of the Linux world ================================================================================ Who are these people, seen and unseen, whose work affects all of us every day? @@ -96,4 +97,4 @@ via: http://www.itworld.com/article/2955001/linux/5-heros-of-the-linux-world.htm [7]:https://flic.kr/p/hBv8Pp [8]:https://en.wikipedia.org/wiki/Sysfs [9]:https://www.youtube.com/watch?v=CyHAeGBFS8k -[10]:http://www.itworld.com/article/2873200/operating-systems/11-technologies-that-tick-off-linus-torvalds.html \ No newline at end of file +[10]:http://www.itworld.com/article/2873200/operating-systems/11-technologies-that-tick-off-linus-torvalds.html From cf1e4ef93781185b77462724d1c8529ad89a7d60 Mon Sep 17 00:00:00 2001 From: GOLinux Date: Fri, 7 Aug 2015 09:55:36 +0800 Subject: [PATCH 846/965] [Translated]20150806 Linux FAQs with Answers--How to enable logging in Open vSwitch for debugging and troubleshooting.md --- ...witch for debugging and troubleshooting.md | 70 ------------------- ...witch for debugging and troubleshooting.md | 69 ++++++++++++++++++ 2 files changed, 69 insertions(+), 70 deletions(-) delete mode 100644 sources/tech/20150806 Linux FAQs with Answers--How to enable logging in Open vSwitch for debugging and troubleshooting.md create mode 100644 translated/tech/20150806 Linux FAQs with Answers--How to enable logging in Open vSwitch for debugging and troubleshooting.md diff --git a/sources/tech/20150806 Linux FAQs with Answers--How to enable logging in Open vSwitch for debugging and troubleshooting.md b/sources/tech/20150806 Linux FAQs with Answers--How to enable logging in Open vSwitch for debugging and troubleshooting.md deleted file mode 100644 index dcf811a003..0000000000 --- a/sources/tech/20150806 Linux FAQs with Answers--How to enable logging in Open vSwitch for debugging and troubleshooting.md +++ /dev/null @@ -1,70 +0,0 @@ -Translating by GOlinu! -Linux FAQs with Answers--How to enable logging in Open vSwitch for debugging and troubleshooting -================================================================================ -> **Question:** I am trying to troubleshoot my Open vSwitch deployment. For that I would like to inspect its debug messages generated by its built-in logging mechanism. How can I enable logging in Open vSwitch, and change its logging level (e.g., to INFO/DEBUG level) to check more detailed debug information? - -Open vSwitch (OVS) is the most popular open-source implementation of virtual switch on the Linux platform. As the today's data centers increasingly rely on the software-defined network (SDN) architecture, OVS is fastly adopted as the de-facto standard network element in data center's SDN deployments. - -Open vSwitch has a built-in logging mechanism called VLOG. The VLOG facility allows one to enable and customize logging within various components of the switch. The logging information generated by VLOG can be sent to a combination of console, syslog and a separate log file for inspection. You can configure OVS logging dynamically at run-time with a command-line tool called `ovs-appctl`. - -![](https://farm1.staticflickr.com/499/19300367114_cd8aac2fb2_c.jpg) - -Here is how to enable logging and customize logging levels in Open vSwitch with `ovs-appctl`. - -The syntax of `ovs-appctl` to customize VLOG is as follows. - - $ sudo ovs-appctl vlog/set module[:facility[:level]] - -- **Module**: name of any valid component in OVS (e.g., netdev, ofproto, dpif, vswitchd, and many others) -- **Facility**: destination of logging information (must be: console, syslog or file) -- **Level**: verbosity of logging (must be: emer, err, warn, info, or dbg) - -In OVS source code, module name is defined in each source file in the form of: - - VLOG_DEFINE_THIS_MODULE(); - -For example, in lib/netdev.c, you will see: - - VLOG_DEFINE_THIS_MODULE(netdev); - -which indicates that lib/netdev.c is part of netdev module. Any logging messages generated in lib/netdev.c will belong to netdev module. - -In OVS source code, there are multiple severity levels used to define several different kinds of logging messages: VLOG_INFO() for informational, VLOG_WARN() for warning, VLOG_ERR() for error, VLOG_DBG() for debugging, VLOG_EMERG for emergency. Logging level and facility determine which logging messages are sent where. - -To see a full list of available modules, facilities, and their respective logging levels, run the following commands. This command must be invoked after you have started OVS. - - $ sudo ovs-appctl vlog/list - -![](https://farm1.staticflickr.com/465/19734939478_7eb5d44635_c.jpg) - -The output shows the debug levels of each module for three different facilities (console, syslog, file). By default, all modules have their logging level set to INFO. - -Given any one OVS module, you can selectively change the debug level of any particular facility. For example, if you want to see more detailed debug messages of dpif module at the console screen, run the following command. - - $ sudo ovs-appctl vlog/set dpif:console:dbg - -You will see that dpif module's console facility has changed its logging level to DBG. The logging level of two other facilities, syslog and file, remains unchanged. - -![](https://farm1.staticflickr.com/333/19896760146_5d851311ae_c.jpg) - -If you want to change the logging level for all modules, you can specify "ANY" as the module name. For example, the following command will change the console logging level of every module to DBG. - - $ sudo ovs-appctl vlog/set ANY:console:dbg - -![](https://farm1.staticflickr.com/351/19734939828_8c7f59e404_c.jpg) - -Also, if you want to change the logging level of all three facilities at once, you can specify "ANY" as the facility name. For example, the following command will change the logging level of all facilities for every module to DBG. - - $ sudo ovs-appctl vlog/set ANY:ANY:dbg - --------------------------------------------------------------------------------- - -via: http://ask.xmodulo.com/enable-logging-open-vswitch.html - -作者:[Dan Nanni][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://ask.xmodulo.com/author/nanni diff --git a/translated/tech/20150806 Linux FAQs with Answers--How to enable logging in Open vSwitch for debugging and troubleshooting.md b/translated/tech/20150806 Linux FAQs with Answers--How to enable logging in Open vSwitch for debugging and troubleshooting.md new file mode 100644 index 0000000000..542cf31cb3 --- /dev/null +++ b/translated/tech/20150806 Linux FAQs with Answers--How to enable logging in Open vSwitch for debugging and troubleshooting.md @@ -0,0 +1,69 @@ +Linux有问必答——如何启用Open vSwitch的日志功能以便调试和排障 +================================================================================ +> **问题** 我试着为我的Open vSwitch部署排障,鉴于此,我想要检查它的由内建日志机制生成的调试信息。我怎样才能启用Open vSwitch的日志功能,并且修改它的日志等级(如,修改成INFO/DEBUG级别)以便于检查更多详细的调试信息呢? + +Open vSwitch(OVS)是Linux平台上用于虚拟切换的最流行的开源部署。由于当今的数据中心日益依赖于软件定义的网络(SDN)架构,OVS被作为数据中心的SDN部署中实际上的标准网络元素而快速采用。 + +Open vSwitch具有一个内建的日志机制,它称之为VLOG。VLOG工具允许你在各种切换组件中启用并自定义日志,由VLOG生成的日志信息可以被发送到一个控制台,syslog以及一个独立日志文件组合,以供检查。你可以通过一个名为`ovs-appctl`的命令行工具在运行时动态配置OVS日志。 + +![](https://farm1.staticflickr.com/499/19300367114_cd8aac2fb2_c.jpg) + +这里为你演示如何使用`ovs-appctl`启用Open vSwitch中的日志功能,并进行自定义。 + +下面是`ovs-appctl`自定义VLOG的语法。 + + $ sudo ovs-appctl vlog/set module[:facility[:level]] + +- **Module**:OVS中的任何合法组件的名称(如netdev,ofproto,dpif,vswitchd,以及其它大量组件) +- **Facility**:日志信息的目的地(必须是:console,syslog,或者file) +- **Level**:日志的详细程度(必须是:emer,err,warn,info,或者dbg) + +在OVS源代码中,模块名称在源文件中是以以下格式定义的: + + VLOG_DEFINE_THIS_MODULE(); + +例如,在lib/netdev.c中,你可以看到: + + VLOG_DEFINE_THIS_MODULE(netdev); + +这个表明,lib/netdev.c是netdev模块的一部分,任何在lib/netdev.c中生成的日志信息将属于netdev模块。 + +在OVS源代码中,有多个严重度等级用于定义几个不同类型的日志信息:VLOG_INFO()用于报告,VLOG_WARN()用于警告,VLOG_ERR()用于错误提示,VLOG_DBG()用于调试信息,VLOG_EMERG用于紧急情况。日志等级和工具确定哪个日志信息发送到哪里。 + +要查看可用模块、工具和各自日志级别的完整列表,请运行以下命令。该命令必须在你启动OVS后调用。 + + $ sudo ovs-appctl vlog/list + +![](https://farm1.staticflickr.com/465/19734939478_7eb5d44635_c.jpg) + +输出结果显示了用于三个工具(console,syslog,file)的各个模块的调试级别。默认情况下,所有模块的日志等级都被设置为INFO。 + +指定任何一个OVS模块,你可以选择性地修改任何特定工具的调试级别。例如,如果你想要在控制台屏幕中查看dpif更为详细的调试信息,可以运行以下命令。 + + $ sudo ovs-appctl vlog/set dpif:console:dbg + +你将看到dpif模块的console工具已经将其日志等级修改为DBG,而其它两个工具syslog和file的日志级别仍然没有改变。 + +![](https://farm1.staticflickr.com/333/19896760146_5d851311ae_c.jpg) + +如果你想要修改所有模块的日志等级,你可以指定“ANY”作为模块名。例如,下面命令将修改每个模块的console的日志级别为DBG。 + + $ sudo ovs-appctl vlog/set ANY:console:dbg + +![](https://farm1.staticflickr.com/351/19734939828_8c7f59e404_c.jpg) + +同时,如果你想要一次性修改所有三个工具的日志级别,你可以指定“ANY”作为工具名。例如,下面的命令将修改每个模块的所有工具的日志级别为DBG。 + + $ sudo ovs-appctl vlog/set ANY:ANY:dbg + +-------------------------------------------------------------------------------- + +via: http://ask.xmodulo.com/enable-logging-open-vswitch.html + +作者:[Dan Nanni][a] +译者:[GOLinux](https://github.com/GOLinux) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://ask.xmodulo.com/author/nanni From f3cb1163f4d917f9e9db845461f0fbecca88b84f Mon Sep 17 00:00:00 2001 From: ZTinoZ Date: Fri, 7 Aug 2015 10:37:40 +0800 Subject: [PATCH 847/965] Translating by ZTinoZ --- sources/talk/20150806 5 heroes of the Linux world.md | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/sources/talk/20150806 5 heroes of the Linux world.md b/sources/talk/20150806 5 heroes of the Linux world.md index 5b5485198c..bf1d75d562 100644 --- a/sources/talk/20150806 5 heroes of the Linux world.md +++ b/sources/talk/20150806 5 heroes of the Linux world.md @@ -1,16 +1,15 @@ -Translating by ZTinoZ -5 heroes of the Linux world +Linux世界的五个大神 ================================================================================ -Who are these people, seen and unseen, whose work affects all of us every day? +这些人是谁?见或者没见过?谁在每天影响着我们? ![Image courtesy Christopher Michel/Flickr](http://core0.staticworld.net/images/article/2015/07/penguin-100599348-orig.jpg) Image courtesy [Christopher Michel/Flickr][1] -### High-flying penguins ### +### 野心勃勃的企鹅 ### -Linux and open source is driven by passionate people who write best-of-breed software and then release the code to the public so anyone can use it, without any strings attached. (Well, there is one string attached and that’s licence.) +Linux和开源世界一直在被那些热情洋溢的人们驱动着,他们开发出最好的软件并将代码向公众开放,所以每个人都能无条件地看到。(对了,有那么一个条件,那就是许可证。) -Who are these people? These heroes of the Linux world, whose work affects all of us every day. Allow me to introduce you. +那么,这些人是谁?这些Linux世界里的大神们,谁在每天影响着我们?让我来给你一一揭晓。 ![Image courtesy Swapnil Bhartiya](http://images.techhive.com/images/article/2015/07/swap-klaus-100599357-orig.jpg) Image courtesy Swapnil Bhartiya From 14a989ea41ead6ccb5bf70206ca4e96fed54596f Mon Sep 17 00:00:00 2001 From: Ping Date: Fri, 7 Aug 2015 14:38:03 +0800 Subject: [PATCH 848/965] Marking out Translating article --- .../tech/20150518 How to set up a Replica Set on MongoDB.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150518 How to set up a Replica Set on MongoDB.md b/sources/tech/20150518 How to set up a Replica Set on MongoDB.md index 07e16dafc1..83a7da8769 100644 --- a/sources/tech/20150518 How to set up a Replica Set on MongoDB.md +++ b/sources/tech/20150518 How to set up a Replica Set on MongoDB.md @@ -1,3 +1,4 @@ +Translating by Ping How to set up a Replica Set on MongoDB ================================================================================ MongoDB has become the most famous NoSQL database on the market. MongoDB is document-oriented, and its scheme-free design makes it a really attractive solution for all kinds of web applications. One of the features that I like the most is Replica Set, where multiple copies of the same data set are maintained by a group of mongod nodes for redundancy and high availability. @@ -179,4 +180,4 @@ via: http://xmodulo.com/setup-replica-set-mongodb.html 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 [a]:http://xmodulo.com/author/valerio -[1]:http://docs.mongodb.org/ecosystem/drivers/ \ No newline at end of file +[1]:http://docs.mongodb.org/ecosystem/drivers/ From ee9f6a02e8e29bd00c790a8a2098d2654a0269fa Mon Sep 17 00:00:00 2001 From: ZTinoZ Date: Fri, 7 Aug 2015 15:15:02 +0800 Subject: [PATCH 849/965] Translating by ZTinoZ --- sources/talk/20150806 5 heroes of the Linux world.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sources/talk/20150806 5 heroes of the Linux world.md b/sources/talk/20150806 5 heroes of the Linux world.md index bf1d75d562..abc42df7f9 100644 --- a/sources/talk/20150806 5 heroes of the Linux world.md +++ b/sources/talk/20150806 5 heroes of the Linux world.md @@ -7,7 +7,7 @@ Image courtesy [Christopher Michel/Flickr][1] ### 野心勃勃的企鹅 ### -Linux和开源世界一直在被那些热情洋溢的人们驱动着,他们开发出最好的软件并将代码向公众开放,所以每个人都能无条件地看到。(对了,有那么一个条件,那就是许可证。) +Linux和开源世界一直在被那些热情洋溢的人们推动着,他们开发出最好的软件并将代码向公众开放,所以每个人都能无条件地看到。(对了,有那么一个条件,那就是许可证。) 那么,这些人是谁?这些Linux世界里的大神们,谁在每天影响着我们?让我来给你一一揭晓。 @@ -16,9 +16,9 @@ Image courtesy Swapnil Bhartiya ### Klaus Knopper ### -Klaus Knopper, an Austrian developer who lives in Germany, is the founder of Knoppix and Adriana Linux, which he developed for his blind wife. +Klaus Knopper,一个生活在德国的奥地利开发者,他是Knoppix和Adriana Linux的创始人,为了他失明的妻子开发程序。 -Knoppix holds a very special place in heart of those Linux users who started using Linux before Ubuntu came along. What makes Knoppix so special is that it popularized the concept of Live CD. Unlike Windows or Mac OS X, you could run the entire operating system from the CD without installing anything on the system. It allowed new users to test Linux on their systems without formatting the hard drive. The live feature of Linux alone contributed heavily to its popularity. +Knoppix在那些Linux用户心里有着特殊的地位,他们在使用Ubuntu之前都会尝试Knoppix,而Knoppix让人称道的就是它让Live CD的概念普及开来。不像Windows或Mac OS X,你可以通过CD运行整个操作系统而不用再系统上安装任何东西,它允许新用户在他们的机子上快速试用Linux而不用去格式化硬盘。Linux这种实时的特性为它的普及做出了巨大贡献。 ![Image courtesy Fórum Internacional Software Live/Flickr](http://images.techhive.com/images/article/2015/07/lennart-100599356-orig.jpg) Image courtesy [Fórum Internacional Software Live/Flickr][2] From 0fe382d37872929df93bbdc84daa135d253e9d8b Mon Sep 17 00:00:00 2001 From: DeadFire Date: Fri, 7 Aug 2015 15:25:11 +0800 Subject: [PATCH 850/965] =?UTF-8?q?20150807-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...riables on a Linux and Unix-like System.md | 98 +++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 sources/tech/20150807 How To--Temporarily Clear Bash Environment Variables on a Linux and Unix-like System.md diff --git a/sources/tech/20150807 How To--Temporarily Clear Bash Environment Variables on a Linux and Unix-like System.md b/sources/tech/20150807 How To--Temporarily Clear Bash Environment Variables on a Linux and Unix-like System.md new file mode 100644 index 0000000000..b2fa80ff0a --- /dev/null +++ b/sources/tech/20150807 How To--Temporarily Clear Bash Environment Variables on a Linux and Unix-like System.md @@ -0,0 +1,98 @@ +How To: Temporarily Clear Bash Environment Variables on a Linux and Unix-like System +================================================================================ +I'm a bash shell user. I would like to temporarily clear bash shell environment variables. I do not want to delete or unset an exported environment variable. How do I run a program in a temporary environment in bash or ksh shell? + +You can use the env command to set and print environment on a Linux or Unix-like systems. The env command executes utility after modifying the environment as specified on the command line. + +### How do I display my current environment? ### + +Open the terminal application and type any one of the following command: + + printenv + +OR + + env + +Sample outputs: + +![Fig.01: Unix/Linux: List All Environment Variables Command](http://s0.cyberciti.org/uploads/faq/2015/08/env-unix-linux-command-output.jpg) +Fig.01: Unix/Linux: List All Environment Variables Command + +### Counting your environment variables ### + +Type the following command: + + env | wc -l + printenv | wc -l + +Sample outputs: + + 20 + +### Run a program in a clean environment in bash/ksh/zsh ### + +The syntax is as follows: + + env -i your-program-name-here arg1 arg2 ... + +For example, run the wget program without using http_proxy and/or all other variables i.e. temporarily clear all bash/ksh/zsh environment variables and run the wget program: + + env -i /usr/local/bin/wget www.cyberciti.biz + env -i wget www.cyberciti.biz + +This is very useful when you want to run a command ignoring any environment variables you have set. I use this command many times everyday to ignore the http_proxy and other environment variable I have set. + +#### Example: With the http_proxy #### + + $ wget www.cyberciti.biz + --2015-08-03 23:20:23-- http://www.cyberciti.biz/ + Connecting to 10.12.249.194:3128... connected. + Proxy request sent, awaiting response... 200 OK + Length: unspecified [text/html] + Saving to: 'index.html' + index.html [ <=> ] 36.17K 87.0KB/s in 0.4s + 2015-08-03 23:20:24 (87.0 KB/s) - 'index.html' saved [37041] + +#### Example: Ignore the http_proxy #### + + $ env -i /usr/local/bin/wget www.cyberciti.biz + --2015-08-03 23:25:17-- http://www.cyberciti.biz/ + Resolving www.cyberciti.biz... 74.86.144.194 + Connecting to www.cyberciti.biz|74.86.144.194|:80... connected. + HTTP request sent, awaiting response... 200 OK + Length: unspecified [text/html] + Saving to: 'index.html.1' + index.html.1 [ <=> ] 36.17K 115KB/s in 0.3s + 2015-08-03 23:25:18 (115 KB/s) - 'index.html.1' saved [37041] + +The option -i causes env command to completely ignore the environment it inherits. However, it does not prevent your command (such as wget or curl) setting new variables. Also, note down the side effect of running bash/ksh shell: + + env -i env | wc -l ## empty ## + # Now run bash ## + env -i bash + ## New enviroment set by bash program ## + env | wc -l + +#### Example: Set an environmental variable #### + +The syntax is: + + env var=value /path/to/command arg1 arg2 ... + ## OR ## + var=value /path/to/command arg1 arg2 ... + +For example set http_proxy: + + env http_proxy="http://USER:PASSWORD@server1.cyberciti.biz:3128/" \ + /usr/local/bin/wget www.cyberciti.biz + +-------------------------------------------------------------------------------- + +via: http://www.cyberciti.biz/faq/linux-unix-temporarily-clearing-environment-variables-command/ + +作者:Vivek Gite +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 \ No newline at end of file From b9f635745b5dfc4ac1151540c4d74e4a842ddedd Mon Sep 17 00:00:00 2001 From: ictlyh Date: Fri, 7 Aug 2015 17:47:09 +0800 Subject: [PATCH 851/965] [Translating] sources/tech/20150807 How To--Temporarily Clear Bash Environment Variables on a Linux and Unix-like System.md --- ...Bash Environment Variables on a Linux and Unix-like System.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20150807 How To--Temporarily Clear Bash Environment Variables on a Linux and Unix-like System.md b/sources/tech/20150807 How To--Temporarily Clear Bash Environment Variables on a Linux and Unix-like System.md index b2fa80ff0a..715ecc2084 100644 --- a/sources/tech/20150807 How To--Temporarily Clear Bash Environment Variables on a Linux and Unix-like System.md +++ b/sources/tech/20150807 How To--Temporarily Clear Bash Environment Variables on a Linux and Unix-like System.md @@ -1,3 +1,4 @@ +Translating by ictlyh How To: Temporarily Clear Bash Environment Variables on a Linux and Unix-like System ================================================================================ I'm a bash shell user. I would like to temporarily clear bash shell environment variables. I do not want to delete or unset an exported environment variable. How do I run a program in a temporary environment in bash or ksh shell? From cff6b78e5da1392612b87b6975d9cf38b40ce89d Mon Sep 17 00:00:00 2001 From: martin qi Date: Fri, 7 Aug 2015 19:39:10 +0800 Subject: [PATCH 852/965] Update 20150716 Interview--Larry Wall.md --- sources/talk/20150716 Interview--Larry Wall.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/talk/20150716 Interview--Larry Wall.md b/sources/talk/20150716 Interview--Larry Wall.md index 5d0b40d2ed..1362281517 100644 --- a/sources/talk/20150716 Interview--Larry Wall.md +++ b/sources/talk/20150716 Interview--Larry Wall.md @@ -1,3 +1,5 @@ +martin + Interview: Larry Wall ================================================================================ > Perl 6 has been 15 years in the making, and is now due to be released at the end of this year. We speak to its creator to find out what’s going on. @@ -122,4 +124,4 @@ via: http://www.linuxvoice.com/interview-larry-wall/ 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 -[a]:http://www.linuxvoice.com/author/mike/ \ No newline at end of file +[a]:http://www.linuxvoice.com/author/mike/ From a78cf0b53f3c126737ea4b77a4e7af8f552524f3 Mon Sep 17 00:00:00 2001 From: wxy Date: Fri, 7 Aug 2015 22:05:46 +0800 Subject: [PATCH 853/965] PUB:20150728 How To Fix--There is no command installed for 7-zip archive files @GOLinux --- ...There is no command installed for 7-zip archive files.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) rename {translated/tech => published}/20150728 How To Fix--There is no command installed for 7-zip archive files.md (96%) diff --git a/translated/tech/20150728 How To Fix--There is no command installed for 7-zip archive files.md b/published/20150728 How To Fix--There is no command installed for 7-zip archive files.md similarity index 96% rename from translated/tech/20150728 How To Fix--There is no command installed for 7-zip archive files.md rename to published/20150728 How To Fix--There is no command installed for 7-zip archive files.md index 61237467ca..34a7af3190 100644 --- a/translated/tech/20150728 How To Fix--There is no command installed for 7-zip archive files.md +++ b/published/20150728 How To Fix--There is no command installed for 7-zip archive files.md @@ -5,10 +5,12 @@ 我试着在Ubuntu中安装Emerald图标主题,而这个主题被打包成了.7z归档包。和以往一样,我试着通过在GUI中右击并选择“提取到这里”来将它解压缩。但是Ubuntu 15.04却并没有解压文件,取而代之的,却是丢给了我一个下面这样的错误信息: > Could not open this file +> > 无法打开该文件 > > There is no command installed for 7-zip archive files. Do you want to search for a command to open this file? -> 没有安装用于7-zip归档文件的命令。你是否想要搜索命令来打开该文件? +> +> 没有安装用于7-zip归档文件的命令。你是否想要搜索用于来打开该文件的命令? 错误信息看上去是这样的: @@ -42,7 +44,7 @@ via: http://itsfoss.com/fix-there-is-no-command-installed-for-7-zip-archive-file 作者:[Abhishek][a] 译者:[GOLinux](https://github.com/GOLinux) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From fb82c13465c5d60e15a2ddadd8c7f17ac307ea99 Mon Sep 17 00:00:00 2001 From: wxy Date: Fri, 7 Aug 2015 22:47:51 +0800 Subject: [PATCH 854/965] PUB:20150803 Handy commands for profiling your Unix file systems @strugglingyouth --- ...ds for profiling your Unix file systems.md | 65 ++++++++++++++++++ ...ds for profiling your Unix file systems.md | 66 ------------------- 2 files changed, 65 insertions(+), 66 deletions(-) create mode 100644 published/20150803 Handy commands for profiling your Unix file systems.md delete mode 100644 translated/tech/20150803 Handy commands for profiling your Unix file systems.md diff --git a/published/20150803 Handy commands for profiling your Unix file systems.md b/published/20150803 Handy commands for profiling your Unix file systems.md new file mode 100644 index 0000000000..1bfc6ac4bd --- /dev/null +++ b/published/20150803 Handy commands for profiling your Unix file systems.md @@ -0,0 +1,65 @@ +使用 Find 命令来帮你找到那些需要清理的文件 +================================================================================ +![Credit: Sandra H-S](http://images.techhive.com/images/article/2015/07/file-profile-100597239-primary.idge.png) + +*Credit: Sandra H-S* + +有一个问题几乎困扰着所有的文件系统 -- 包括 Unix 和其他的 -- 那就是文件的不断积累。几乎没有人愿意花时间清理掉他们不再使用的文件和整理文件系统,结果,文件变得很混乱,很难找到有用的东西,要使它们运行良好、维护备份、易于管理,这将是一种持久的挑战。 + +我见过的一种解决问题的方法是建议使用者将所有的数据碎屑创建一个文件集合的总结报告或"概况",来报告诸如所有的文件数量;最老的,最新的,最大的文件;并统计谁拥有这些文件等数据。如果有人看到五年前的一个包含五十万个文件的文件夹,他们可能会去删除哪些文件 -- 或者,至少会归档和压缩。主要问题是太大的文件夹会使人担心误删一些重要的东西。如果有一个描述文件夹的方法能帮助显示文件的性质,那么你就可以去清理它了。 + +当我准备做 Unix 文件系统的总结报告时,几个有用的 Unix 命令能提供一些非常有用的统计信息。要计算目录中的文件数,你可以使用这样一个 find 命令。 + + $ find . -type f | wc -l + 187534 + +虽然查找最老的和最新的文件是比较复杂,但还是相当方便的。在下面的命令,我们使用 find 命令再次查找文件,以文件时间排序并按年-月-日的格式显示,在列表顶部的显然是最老的。 + +在第二个命令,我们做同样的,但打印的是最后一行,这是最新的。 + + $ find -type f -printf '%T+ %p\n' | sort | head -n 1 + 2006-02-03+02:40:33 ./skel/.xemacs/init.el + $ find -type f -printf '%T+ %p\n' | sort | tail -n 1 + 2015-07-19+14:20:16 ./.bash_history + +printf 命令输出 %T(文件日期和时间)和 %P(带路径的文件名)参数。 + +如果我们在查找家目录时,无疑会发现,history 文件(如 .bash_history)是最新的,这并没有什么用。你可以通过 "un-grepping" 来忽略这些文件,也可以忽略以.开头的文件,如下图所示的。 + + $ find -type f -printf '%T+ %p\n' | grep -v "\./\." | sort | tail -n 1 + 2015-07-19+13:02:12 ./isPrime + +寻找最大的文件使用 %s(大小)参数,包括文件名(%f),因为这就是我们想要在报告中显示的。 + + $ find -type f -printf '%s %f \n' | sort -n | uniq | tail -1 + 20183040 project.org.tar + +统计文件的所有者,使用%u(所有者) + + $ find -type f -printf '%u \n' | grep -v "\./\." | sort | uniq -c + 180034 shs + 7500 jdoe + +如果文件系统能记录上次的访问日期,也将是非常有用的,可以用来看该文件有没有被访问过,比方说,两年之内没访问过。这将使你能明确分辨这些文件的价值。这个最后访问(%a)参数这样使用: + + $ find -type f -printf '%a+ %p\n' | sort | head -n 1 + Fri Dec 15 03:00:30 2006+ ./statreport + +当然,如果大多数最近​​访问的文件也是在很久之前的,这看起来你需要处理更多文件了。 + + $ find -type f -printf '%a+ %p\n' | sort | tail -n 1 + Wed Nov 26 03:00:27 2007+ ./my-notes + +要想层次分明,可以为一个文件系统或大目录创建一个总结报告,显示这些文件的日期范围、最大的文件、文件所有者们、最老的文件和最新访问时间,可以帮助文件拥有者判断当前有哪些文件夹是重要的哪些该清理了。 + +-------------------------------------------------------------------------------- + +via: http://www.itworld.com/article/2949898/linux/profiling-your-file-systems.html + +作者:[Sandra Henry-Stocker][a] +译者:[strugglingyouth](https://github.com/strugglingyouth) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.itworld.com/author/Sandra-Henry_Stocker/ diff --git a/translated/tech/20150803 Handy commands for profiling your Unix file systems.md b/translated/tech/20150803 Handy commands for profiling your Unix file systems.md deleted file mode 100644 index 13efdcf0a1..0000000000 --- a/translated/tech/20150803 Handy commands for profiling your Unix file systems.md +++ /dev/null @@ -1,66 +0,0 @@ - -很实用的命令来分析你的 Unix 文件系统 -================================================================================ -![Credit: Sandra H-S](http://images.techhive.com/images/article/2015/07/file-profile-100597239-primary.idge.png) -Credit: Sandra H-S - -其中一个问题几乎困扰着所有的文件系统 -- 包括 Unix 和其他的 -- 那就是文件的不断积累。几乎没有人愿意花时间清理掉他们不再使用的文件和文件系统,结果,文件变得很混乱,很难找到有用的东西使它们运行良好,能够得到备份,并且易于管理,这将是一种持久的挑战。 - -我见过的一种解决问题的方法是鼓励使用者将所有的数据碎屑创建成一个总结报告或"profile"这样一个文件集合来报告所有的文件数量;最老的,最新的,最大的文件;并统计谁拥有这些文件。如果有人看到一个包含五十万个文件的文件夹并且时间不小于五年,他们可能会去删除哪些文件 -- 或者,至少归档和压缩。主要问题是太大的文件夹会使人产生压制性害怕误删一些重要的东西。有一个描述文件夹的方法能帮助显示文件的性质并期待你去清理它。 - - -当我准备做 Unix 文件系统的总结报告时,几个有用的 Unix 命令能提供一些非常有用的统计信息。要计算目录中的文件数,你可以使用这样一个 find 命令。 - - $ find . -type f | wc -l - 187534 - -查找最老的和最新的文件是比较复杂,但还是相当方便的。在下面的命令,我们使用 find 命令再次查找文件,以文件时间排序并按年-月-日的格式显示在顶部 -- 因此最老的 -- 的文件在列表中。 - -在第二个命令,我们做同样的,但打印的是最后一行 -- 这是最新的 -- 文件 - - $ find -type f -printf '%T+ %p\n' | sort | head -n 1 - 2006-02-03+02:40:33 ./skel/.xemacs/init.el - $ find -type f -printf '%T+ %p\n' | sort | tail -n 1 - 2015-07-19+14:20:16 ./.bash_history - -printf 命令输出 %T(文件日期和时间)和 %P(带路径的文件名)参数。 - -如果我们在查找家目录时,无疑会发现,history 文件是最新的,这不像是一个很有趣的信息。你可以通过 "un-grepping" 来忽略这些文件,也可以忽略以.开头的文件,如下图所示的。 - - $ find -type f -printf '%T+ %p\n' | grep -v "\./\." | sort | tail -n 1 - 2015-07-19+13:02:12 ./isPrime - -寻找最大的文件使用 %s(大小)参数,包括文件名(%f),因为这就是我们想要在报告中显示的。 - - $ find -type f -printf '%s %f \n' | sort -n | uniq | tail -1 - 20183040 project.org.tar - -打印文件的所有着者,使用%u(所有者) - - $ find -type f -printf '%u \n' | grep -v "\./\." | sort | uniq -c - 180034 shs - 7500 jdoe - -如果文件系统能记录上次的访问日期,也将是非常有用的来看该文件有没有被访问,比方说,两年之内。这将使你能明确分辨这些文件的价值。最后一个访问参数(%a)这样使用: - - $ find -type f -printf '%a+ %p\n' | sort | head -n 1 - Fri Dec 15 03:00:30 2006+ ./statreport - -当然,如果最近​​访问的文件也是在很久之前的,这将使你有更多的处理时间。 - - $ find -type f -printf '%a+ %p\n' | sort | tail -n 1 - Wed Nov 26 03:00:27 2007+ ./my-notes - -一个文件系统要层次分明,为大目录创建一个总结报告,显示该文件的日期范围,最大的文件,文件所有者,最老的和访问时间都可以帮助文件拥有者判断当前有哪些文件夹是重要的哪些该清理了。 - --------------------------------------------------------------------------------- - -via: http://www.itworld.com/article/2949898/linux/profiling-your-file-systems.html - -作者:[Sandra Henry-Stocker][a] -译者:[strugglingyouth](https://github.com/strugglingyouth) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.itworld.com/author/Sandra-Henry_Stocker/ From 96a056137fdee0854671418ce7aae8be952ba66d Mon Sep 17 00:00:00 2001 From: wi-cuckoo Date: Fri, 7 Aug 2015 23:52:45 +0800 Subject: [PATCH 855/965] translating wi-cuckoo --- ... Interview Experience on RedHat Linux Package Management.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150623 Shilpa Nair Shares Her Interview Experience on RedHat Linux Package Management.md b/sources/tech/20150623 Shilpa Nair Shares Her Interview Experience on RedHat Linux Package Management.md index 7915907e6a..6243a8c0de 100644 --- a/sources/tech/20150623 Shilpa Nair Shares Her Interview Experience on RedHat Linux Package Management.md +++ b/sources/tech/20150623 Shilpa Nair Shares Her Interview Experience on RedHat Linux Package Management.md @@ -1,3 +1,4 @@ +translating wi-cuckoo Shilpa Nair Shares Her Interview Experience on RedHat Linux Package Management ================================================================================ **Shilpa Nair has just graduated in the year 2015. She went to apply for Trainee position in a National News Television located in Noida, Delhi. When she was in the last year of graduation and searching for help on her assignments she came across Tecmint. Since then she has been visiting Tecmint regularly.** @@ -345,4 +346,4 @@ via: http://www.tecmint.com/linux-rpm-package-management-interview-questions/ [a]:http://www.tecmint.com/author/avishek/ [1]:http://www.tecmint.com/20-linux-yum-yellowdog-updater-modified-commands-for-package-mangement/ -[2]:http://www.tecmint.com/dnf-commands-for-fedora-rpm-package-management/ \ No newline at end of file +[2]:http://www.tecmint.com/dnf-commands-for-fedora-rpm-package-management/ From 7b64f7af56f5b9513420c849bfbba8c91c12e926 Mon Sep 17 00:00:00 2001 From: wxy Date: Fri, 7 Aug 2015 23:53:07 +0800 Subject: [PATCH 856/965] PUB:20150504 How to access a Linux server behind NAT via reverse SSH tunnel @ictlyh --- ...erver behind NAT via reverse SSH tunnel.md | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) rename {translated/tech => published}/20150504 How to access a Linux server behind NAT via reverse SSH tunnel.md (58%) diff --git a/translated/tech/20150504 How to access a Linux server behind NAT via reverse SSH tunnel.md b/published/20150504 How to access a Linux server behind NAT via reverse SSH tunnel.md similarity index 58% rename from translated/tech/20150504 How to access a Linux server behind NAT via reverse SSH tunnel.md rename to published/20150504 How to access a Linux server behind NAT via reverse SSH tunnel.md index 5f9828e912..c6dddd3639 100644 --- a/translated/tech/20150504 How to access a Linux server behind NAT via reverse SSH tunnel.md +++ b/published/20150504 How to access a Linux server behind NAT via reverse SSH tunnel.md @@ -1,18 +1,18 @@ 如何通过反向 SSH 隧道访问 NAT 后面的 Linux 服务器 ================================================================================ -你在家里运行着一台 Linux 服务器,访问它需要先经过 NAT 路由器或者限制性防火墙。现在你想不在家的时候用 SSH 登录到这台服务器。你如何才能做到呢?SSH 端口转发当然是一种选择。但是,如果你需要处理多个嵌套的 NAT 环境,端口转发可能会变得非常棘手。另外,在多种 ISP 特定条件下可能会受到干扰,例如阻塞转发端口的限制性 ISP 防火墙、或者在用户间共享 IPv4 地址的运营商级 NAT。 +你在家里运行着一台 Linux 服务器,它放在一个 NAT 路由器或者限制性防火墙后面。现在你想在外出时用 SSH 登录到这台服务器。你如何才能做到呢?SSH 端口转发当然是一种选择。但是,如果你需要处理多级嵌套的 NAT 环境,端口转发可能会变得非常棘手。另外,在多种 ISP 特定条件下可能会受到干扰,例如阻塞转发端口的限制性 ISP 防火墙、或者在用户间共享 IPv4 地址的运营商级 NAT。 ### 什么是反向 SSH 隧道? ### -SSH 端口转发的一种替代方案是 **反向 SSH 隧道**。反向 SSH 隧道的概念非常简单。对于此,在限制性家庭网络之外你需要另一台主机(所谓的“中继主机”),你能从当前所在地通过 SSH 登录。你可以用有公共 IP 地址的 [VPS 实例][1] 配置一个中继主机。然后要做的就是从你家庭网络服务器中建立一个到公共中继主机的永久 SSH 隧道。有了这个隧道,你就可以从中继主机中连接“回”家庭服务器(这就是为什么称之为 “反向” 隧道)。不管你在哪里、你家庭网络中的 NAT 或 防火墙限制多么严重,只要你可以访问中继主机,你就可以连接到家庭服务器。 +SSH 端口转发的一种替代方案是 **反向 SSH 隧道**。反向 SSH 隧道的概念非常简单。使用这种方案,在你的受限的家庭网络之外你需要另一台主机(所谓的“中继主机”),你能从当前所在地通过 SSH 登录到它。你可以用有公网 IP 地址的 [VPS 实例][1] 配置一个中继主机。然后要做的就是从你的家庭网络服务器中建立一个到公网中继主机的永久 SSH 隧道。有了这个隧道,你就可以从中继主机中连接“回”家庭服务器(这就是为什么称之为 “反向” 隧道)。不管你在哪里、你的家庭网络中的 NAT 或 防火墙限制多么严格,只要你可以访问中继主机,你就可以连接到家庭服务器。 ![](https://farm8.staticflickr.com/7742/17162647378_c7d9f10de8_b.jpg) ### 在 Linux 上设置反向 SSH 隧道 ### -让我们来看看怎样创建和使用反向 SSH 隧道。我们有如下假设。我们会设置一个从家庭服务器到中继服务器的反向 SSH 隧道,然后我们可以通过中继服务器从客户端计算机 SSH 登录到家庭服务器。**中继服务器** 的公共 IP 地址是 1.1.1.1。 +让我们来看看怎样创建和使用反向 SSH 隧道。我们做如下假设:我们会设置一个从家庭服务器(homeserver)到中继服务器(relayserver)的反向 SSH 隧道,然后我们可以通过中继服务器从客户端计算机(clientcomputer) SSH 登录到家庭服务器。本例中的**中继服务器** 的公网 IP 地址是 1.1.1.1。 -在家庭主机上,按照以下方式打开一个到中继服务器的 SSH 连接。 +在家庭服务器上,按照以下方式打开一个到中继服务器的 SSH 连接。 homeserver~$ ssh -fN -R 10022:localhost:22 relayserver_user@1.1.1.1 @@ -20,11 +20,11 @@ SSH 端口转发的一种替代方案是 **反向 SSH 隧道**。反向 SSH 隧 “-R 10022:localhost:22” 选项定义了一个反向隧道。它转发中继服务器 10022 端口的流量到家庭服务器的 22 号端口。 -用 “-fN” 选项,当你用一个 SSH 服务器成功通过验证时 SSH 会进入后台运行。当你不想在远程 SSH 服务器执行任何命令、就像我们的例子中只想转发端口的时候非常有用。 +用 “-fN” 选项,当你成功通过 SSH 服务器验证时 SSH 会进入后台运行。当你不想在远程 SSH 服务器执行任何命令,就像我们的例子中只想转发端口的时候非常有用。 运行上面的命令之后,你就会回到家庭主机的命令行提示框中。 -登录到中继服务器,确认 127.0.0.1:10022 绑定到了 sshd。如果是的话就表示已经正确设置了反向隧道。 +登录到中继服务器,确认其 127.0.0.1:10022 绑定到了 sshd。如果是的话就表示已经正确设置了反向隧道。 relayserver~$ sudo netstat -nap | grep 10022 @@ -36,13 +36,13 @@ SSH 端口转发的一种替代方案是 **反向 SSH 隧道**。反向 SSH 隧 relayserver~$ ssh -p 10022 homeserver_user@localhost -需要注意的一点是你在本地输入的 SSH 登录/密码应该是家庭服务器的,而不是中继服务器的,因为你是通过隧道的本地端点登录到家庭服务器。因此不要输入中继服务器的登录/密码。成功登陆后,你就在家庭服务器上了。 +需要注意的一点是你在上面为localhost输入的 SSH 登录/密码应该是家庭服务器的,而不是中继服务器的,因为你是通过隧道的本地端点登录到家庭服务器,因此不要错误输入中继服务器的登录/密码。成功登录后,你就在家庭服务器上了。 ### 通过反向 SSH 隧道直接连接到网络地址变换后的服务器 ### 上面的方法允许你访问 NAT 后面的 **家庭服务器**,但你需要登录两次:首先登录到 **中继服务器**,然后再登录到**家庭服务器**。这是因为中继服务器上 SSH 隧道的端点绑定到了回环地址(127.0.0.1)。 -事实上,有一种方法可以只需要登录到中继服务器就能直接访问网络地址变换之后的家庭服务器。要做到这点,你需要让中继服务器上的 sshd 不仅转发回环地址上的端口,还要转发外部主机的端口。这通过指定中继服务器上运行的 sshd 的 **网关端口** 实现。 +事实上,有一种方法可以只需要登录到中继服务器就能直接访问NAT之后的家庭服务器。要做到这点,你需要让中继服务器上的 sshd 不仅转发回环地址上的端口,还要转发外部主机的端口。这通过指定中继服务器上运行的 sshd 的 **GatewayPorts** 实现。 打开**中继服务器**的 /etc/ssh/sshd_conf 并添加下面的行。 @@ -74,23 +74,23 @@ SSH 端口转发的一种替代方案是 **反向 SSH 隧道**。反向 SSH 隧 tcp 0 0 1.1.1.1:10022 0.0.0.0:* LISTEN 1538/sshd: dev -不像之前的情况,现在隧道的端点是 1.1.1.1:10022(中继服务器的公共 IP 地址),而不是 127.0.0.1:10022。这就意味着从外部主机可以访问隧道的端点。 +不像之前的情况,现在隧道的端点是 1.1.1.1:10022(中继服务器的公网 IP 地址),而不是 127.0.0.1:10022。这就意味着从外部主机可以访问隧道的另一端。 现在在任何其它计算机(客户端计算机),输入以下命令访问网络地址变换之后的家庭服务器。 clientcomputer~$ ssh -p 10022 homeserver_user@1.1.1.1 -在上面的命令中,1.1.1.1 是中继服务器的公共 IP 地址,家庭服务器用户必须是和家庭服务器相关联的用户账户。这是因为你真正登录到的主机是家庭服务器,而不是中继服务器。后者只是中继你的 SSH 流量到家庭服务器。 +在上面的命令中,1.1.1.1 是中继服务器的公共 IP 地址,homeserver_user必须是家庭服务器上的用户账户。这是因为你真正登录到的主机是家庭服务器,而不是中继服务器。后者只是中继你的 SSH 流量到家庭服务器。 ### 在 Linux 上设置一个永久反向 SSH 隧道 ### -现在你已经明白了怎样创建一个反向 SSH 隧道,然后把隧道设置为 “永久”,这样隧道启动后就会一直运行(不管临时的网络拥塞、SSH 超时、中继主机重启,等等)。毕竟,如果隧道不是一直有效,你不可能可靠的登录到你的家庭服务器。 +现在你已经明白了怎样创建一个反向 SSH 隧道,然后把隧道设置为 “永久”,这样隧道启动后就会一直运行(不管临时的网络拥塞、SSH 超时、中继主机重启,等等)。毕竟,如果隧道不是一直有效,你就不能可靠的登录到你的家庭服务器。 -对于永久隧道,我打算使用一个叫 autossh 的工具。正如名字暗示的,这个程序允许你不管任何理由自动重启 SSH 会话。因此对于保存一个反向 SSH 隧道有效非常有用。 +对于永久隧道,我打算使用一个叫 autossh 的工具。正如名字暗示的,这个程序可以让你的 SSH 会话无论因为什么原因中断都会自动重连。因此对于保持一个反向 SSH 隧道非常有用。 第一步,我们要设置从家庭服务器到中继服务器的[无密码 SSH 登录][2]。这样的话,autossh 可以不需要用户干预就能重启一个损坏的反向 SSH 隧道。 -下一步,在初始化隧道的家庭服务器上[安装 autossh][3]。 +下一步,在建立隧道的家庭服务器上[安装 autossh][3]。 在家庭服务器上,用下面的参数运行 autossh 来创建一个连接到中继服务器的永久 SSH 隧道。 @@ -113,7 +113,7 @@ SSH 端口转发的一种替代方案是 **反向 SSH 隧道**。反向 SSH 隧 ### 总结 ### -在这篇博文中,我介绍了你如何能从外部中通过反向 SSH 隧道访问限制性防火墙或 NAT 网关之后的 Linux 服务器。尽管我介绍了家庭网络中的一个使用事例,在企业网络中使用时你尤其要小心。这样的一个隧道可能被视为违反公司政策,因为它绕过了企业的防火墙并把企业网络暴露给外部攻击。这很可能被误用或者滥用。因此在使用之前一定要记住它的作用。 +在这篇博文中,我介绍了你如何能从外部通过反向 SSH 隧道访问限制性防火墙或 NAT 网关之后的 Linux 服务器。这里我介绍了家庭网络中的一个使用事例,但在企业网络中使用时你尤其要小心。这样的一个隧道可能被视为违反公司政策,因为它绕过了企业的防火墙并把企业网络暴露给外部攻击。这很可能被误用或者滥用。因此在使用之前一定要记住它的作用。 -------------------------------------------------------------------------------- @@ -121,11 +121,11 @@ via: http://xmodulo.com/access-linux-server-behind-nat-reverse-ssh-tunnel.html 作者:[Dan Nanni][a] 译者:[ictlyh](https://github.com/ictlyh) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 [a]:http://xmodulo.com/author/nanni [1]:http://xmodulo.com/go/digitalocean -[2]:http://xmodulo.com/how-to-enable-ssh-login-without.html -[3]:http://ask.xmodulo.com/install-autossh-linux.html +[2]:https://linux.cn/article-5444-1.html +[3]:https://linux.cn/article-5459-1.html From 569768fdea3706313f31ce6787da102f597d9e44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=AE=A6=E6=88=90?= Date: Sat, 8 Aug 2015 03:26:54 +0800 Subject: [PATCH 857/965] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...o Perform File and Directory Management.md | 194 +++++++++--------- 1 file changed, 98 insertions(+), 96 deletions(-) diff --git a/sources/tech/RHCSA Series/RHCSA Series--Part 02--How to Perform File and Directory Management.md b/sources/tech/RHCSA Series/RHCSA Series--Part 02--How to Perform File and Directory Management.md index abf9910994..f46fd93321 100644 --- a/sources/tech/RHCSA Series/RHCSA Series--Part 02--How to Perform File and Directory Management.md +++ b/sources/tech/RHCSA Series/RHCSA Series--Part 02--How to Perform File and Directory Management.md @@ -1,59 +1,61 @@ -[translating by xiqingongzi] -RHCSA Series: How to Perform File and Directory Management – Part 2 +RHCSA 系列: 如何执行文件并进行文件管理 – Part 2 ================================================================================ -In this article, RHCSA Part 2: File and directory management, we will review some essential skills that are required in the day-to-day tasks of a system administrator. + +在本篇(RHCSA 第二篇:文件和目录管理)中,我们江回顾一些系统管理员日常任务需要的技能 ![RHCSA: Perform File and Directory Management – Part 2](http://www.tecmint.com/wp-content/uploads/2015/03/RHCSA-Part2.png) -RHCSA: Perform File and Directory Management – Part 2 -### Create, Delete, Copy, and Move Files and Directories ### +RHCSA : 运行文件以及进行文件夹管理 - 第二章 +### 创建,删除,复制和移动文件及目录 ### -File and directory management is a critical competence that every system administrator should possess. This includes the ability to create / delete text files from scratch (the core of each program’s configuration) and directories (where you will organize files and other directories), and to find out the type of existing files. +文件和目录管理是每一个系统管理员都应该掌握的必要的技能.它包括了从头开始的创建、删除文本文件(每个程序的核心配置)以及目录(你用来组织文件和其他目录),以及识别存在的文件的类型 -The [touch command][1] can be used not only to create empty files, but also to update the access and modification times of existing files. + [touch 命令][1] 不仅仅能用来创建空文件,还能用来更新已存在的文件的权限和时间表 ![touch command example](http://www.tecmint.com/wp-content/uploads/2015/03/touch-command-example.png) -touch command example +touch 命令示例 -You can use `file [filename]` to determine a file’s type (this will come in handy before launching your preferred text editor to edit it). +你可以使用 `file [filename]`来判断一个文件的类型 (在你用文本编辑器编辑之前,判断类型将会更方便编辑). ![file command example](http://www.tecmint.com/wp-content/uploads/2015/03/file-command-example.png) -file command example +file 命令示例 -and `rm [filename]` to delete it. +使用`rm [filename]` 可以删除文件 ![Linux rm command examples](http://www.tecmint.com/wp-content/uploads/2015/03/rm-command-examples.png) -rm command example +rm 命令示例 + +对于目录,你可以使用`mkdir [directory]`在已经存在的路径中创建目录,或者使用 `mkdir -p [/full/path/to/directory].`带全路径创建文件夹 -As for directories, you can create directories inside existing paths with `mkdir [directory]` or create a full path with `mkdir -p [/full/path/to/directory].` ![mkdir command example](http://www.tecmint.com/wp-content/uploads/2015/03/mkdir-command-example.png) -mkdir command example +mkdir 命令示例 -When it comes to removing directories, you need to make sure that they’re empty before issuing the `rmdir [directory]` command, or use the more powerful (handle with care!) `rm -rf [directory]`. This last option will force remove recursively the `[directory]` and all its contents – so use it at your own risk. +当你想要去删除目录时,在你使用`rmdir [directory]` 前,你需要先确保目录是空的,或者使用更加强力的命令(小心使用它)`rm -rf [directory]`.后者会强制删除`[directory]`以及他的内容.所以使用这个命令存在一定的风险 -### Input and Output Redirection and Pipelining ### +### 输入输出重定向以及管道 ### -The command line environment provides two very useful features that allows to redirect the input and output of commands from and to files, and to send the output of a command to another, called redirection and pipelining, respectively. +命令行环境提供了两个非常有用的功能:允许命令重定向的输入和输出到文件和发送到另一个文件,分别称为重定向和管道 To understand those two important concepts, we must first understand the three most important types of I/O (Input and Output) streams (or sequences) of characters, which are in fact special files, in the *nix sense of the word. +为了理解这两个重要概念,我们首先需要理解通常情况下三个重要的输入输出流的形式 -- Standard input (aka stdin) is by default attached to the keyboard. In other words, the keyboard is the standard input device to enter commands to the command line. -- Standard output (aka stdout) is by default attached to the screen, the device that “receives” the output of commands and display them on the screen. -- Standard error (aka stderr), is where the status messages of a command is sent to by default, which is also the screen. +- 标准输入 (aka stdin) 是指默认使用键盘链接. 换句话说,键盘是输入命令到命令行的标准输入设备。 +- 标准输出 (aka stdout) 是指默认展示再屏幕上, 显示器接受输出命令,并且展示在屏幕上。 +- 标准错误 (aka stderr), 是指命令的状态默认输出, 同时也会展示在屏幕上 In the following example, the output of `ls /var` is sent to stdout (the screen), as well as the result of ls /tecmint. But in the latter case, it is stderr that is shown. +在下面的例子中,`ls /var`的结果被发送到stdout(屏幕展示),就像ls /tecmint 的结果。但在后一种情况下,它是标准错误输出。 ![Linux input output redirect](http://www.tecmint.com/wp-content/uploads/2015/03/Linux-input-output-redirect.png) +输入和输出命令实例 -Input and Output Example - -To more easily identify these special files, they are each assigned a file descriptor, an abstract representation that is used to access them. The essential thing to understand is that these files, just like others, can be redirected. What this means is that you can capture the output from a file or script and send it as input to another file, command, or script. This will allow you to store on disk, for example, the output of commands for later processing or analysis. +为了更容易识别这些特殊文件,每个文件都被分配有一个文件描述符(用于控制他们的抽象标识)。主要要理解的是,这些文件就像其他人一样,可以被重定向。这就意味着你可以从一个文件或脚本中捕获输出,并将它传送到另一个文件、命令或脚本中。你就可以在在磁盘上存储命令的输出结果,用于稍后的分析 To redirect stdin (fd 0), stdout (fd 1), or stderr (fd 2), the following operators are available. @@ -63,102 +65,102 @@ To redirect stdin (fd 0), stdout (fd 1), or stderr (fd 2), the following operato -Redirection Operator -Effect +转向操作 +效果 > -Redirects standard output to a file containing standard output. If the destination file exists, it will be overwritten. +标准输出到一个文件。如果目标文件存在,内容就会被重写 >> -Appends standard output to a file. +添加标准输出到文件尾部 2> -Redirects standard error to a file containing standard output. If the destination file exists, it will be overwritten. +标准错误输出到一个文件。如果目标文件存在,内容就会被重写 2>> -Appends standard error to the existing file. +添加标准错误输出到文件尾部. &> -Redirects both standard output and standard error to a file; if the specified file exists, it will be overwritten. +标准错误和标准输出都到一个文件。如果目标文件存在,内容就会被重写 < -Uses the specified file as standard input. +使用特定的文件做标准输出 <> -The specified file is used for both standard input and standard output. +使用特定的文件做标准输出和标准错误 -As opposed to redirection, pipelining is performed by adding a vertical bar `(|)` after a command and before another one. -Remember: +相比与重定向,管道是通过在命令后添加一个竖杠`(|)`再添加另一个命令 . -- Redirection is used to send the output of a command to a file, or to send a file as input to a command. -- Pipelining is used to send the output of a command to another command as input. +记得: -#### Examples Of Redirection and Pipelining #### +- 重定向是用来定向命令的输出到一个文件,或定向一个文件作为输入到一个命令。 +- 管道是用来将命令的输出转发到另一个命令作为输入。 -**Example 1: Redirecting the output of a command to a file** +#### 重定向和管道的使用实例 #### -There will be times when you will need to iterate over a list of files. To do that, you can first save that list to a file and then read that file line by line. While it is true that you can iterate over the output of ls directly, this example serves to illustrate redirection. +** 例1:将一个命令的输出到文件 ** + +有些时候,你需要遍历一个文件列表。要做到这样,你可以先将该列表保存到文件中,然后再按行读取该文件。虽然你可以遍历直接ls的输出,不过这个例子是用来说明重定向。 # ls -1 /var/mail > mail.txt ![Redirect output of command tot a file](http://www.tecmint.com/wp-content/uploads/2015/03/Redirect-output-to-a-file.png) -Redirect output of command tot a file +将一个命令的输出到文件 -**Example 2: Redirecting both stdout and stderr to /dev/null** +** 例2:重定向stdout和stderr到/dev/null ** -In case we want to prevent both stdout and stderr to be displayed on the screen, we can redirect both file descriptors to `/dev/null`. Note how the output changes when the redirection is implemented for the same command. +如果不想让标准输出和标准错误展示在屏幕上,我们可以把文件描述符重定向到 `/dev/null` 请注意在执行这个命令时该如何更改输出 # ls /var /tecmint # ls /var/ /tecmint &> /dev/null ![Redirecting stdout and stderr ouput to /dev/null](http://www.tecmint.com/wp-content/uploads/2015/03/Redirecting-stdout-stderr-ouput.png) -Redirecting stdout and stderr ouput to /dev/null +重定向stdout和stderr到/dev/null -#### Example 3: Using a file as input to a command #### +#### 例3:使用一个文件作为命令的输入 #### -While the classic syntax of the [cat command][2] is as follows. +当官方的[cat 命令][2]的语法如下时 # cat [file(s)] -You can also send a file as input, using the correct redirection operator. +您还可以使用正确的重定向操作符传送一个文件作为输入。 # cat < mail.txt ![Linux cat command examples](http://www.tecmint.com/wp-content/uploads/2015/03/cat-command-examples.png) -cat command example +cat 命令实例 -#### Example 4: Sending the output of a command as input to another #### +#### 例4:发送一个命令的输出作为另一个命令的输入 #### -If you have a large directory or process listing and want to be able to locate a certain file or process at a glance, you will want to pipeline the listing to grep. +如果你有一个较大的目录或进程列表,并且想快速定位,你或许需要将列表通过管道传送给grep -Note that we use to pipelines in the following example. The first one looks for the required keyword, while the second one will eliminate the actual `grep command` from the results. This example lists all the processes associated with the apache user. +接下来我们使用管道在下面的命令中,第一个是查找所需的关键词,第二个是除去产生的 `grep command`.这个例子列举了所有与apache用户有关的进程 # ps -ef | grep apache | grep -v grep ![Send output of command as input to another](http://www.tecmint.com/wp-content/uploads/2015/03/Send-output-of-command-as-input-to-another1.png) -Send output of command as input to another +发送一个命令的输出作为另一个命令的输入 -### Archiving, Compressing, Unpacking, and Uncompressing Files ### +### 归档,压缩,解包,解压文件 ### -If you need to transport, backup, or send via email a group of files, you will use an archiving (or grouping) tool such as [tar][3], typically used with a compression utility like gzip, bzip2, or xz. - -Your choice of a compression tool will be likely defined by the compression speed and rate of each one. Of these three compression tools, gzip is the oldest and provides the least compression, bzip2 provides improved compression, and xz is the newest and provides the best compression. Typically, files compressed with these utilities have .gz, .bz2, or .xz extensions, respectively. +如果你需要传输,备份,或者通过邮件发送一组文件,你可以使用一个存档(或文件夹)如 [tar][3]工具,通常使用gzip,bzip2,或XZ压缩工具. +您选择的压缩工具每一个都有自己的定义的压缩速度和速率的。这三种压缩工具,gzip是最古老和提供最小压缩的工具,bzip2提供经过改进的压缩,以及XZ提供最信和最好的压缩。通常情况下,这些文件都是被压缩的如.gz .bz2或.xz 注:表格 @@ -166,44 +168,44 @@ Your choice of a compression tool will be likely defined by the compression spee - - - + + + - + - + - + - + - + - + - +
CommandAbbreviationDescription命令缩写描述
–create cCreates a tar archive创建一个tar归档
–concatenate AAppends tar files to an archive向归档中添加tar文件
–append rAppends non-tar files to an archive向归档中添加非tar文件
–update uAppends files that are newer than those in an archive添加比归档中的文件更新的文件
–diff or –compare dCompares an archive to files on disk将归档和硬盘的文件夹进行对比
–list tLists the contents of a tarball列举一个tar的压缩包
–extract or –get xExtracts files from an archive从归档中解压文件
@@ -215,51 +217,51 @@ Your choice of a compression tool will be likely defined by the compression spee -Operation modifier -Abbreviation -Description +操作参数 +缩写 +描述 directory dir C -Changes to directory dir before performing operations +在执行操作前更改目录 same-permissions and same-owner p -Preserves permissions and ownership information, respectively. +分别保留权限和所有者信息 –verbose v -Lists all files as they are read or extracted; if combined with –list, it also displays file sizes, ownership, and timestamps +列举所有文件用于读取或提取,这里包含列表,并显示文件的大小、所有权和时间戳 exclude file -Excludes file from the archive. In this case, file can be an actual file or a pattern. +排除存档文件。在这种情况下,文件可以是一个实际的文件或目录。 gzip or gunzip z -Compresses an archive through gzip +使用gzip压缩文件 –bzip2 j -Compresses an archive through bzip2 +使用bzip2压缩文件 –xz J -Compresses an archive through xz +使用xz压缩文件 -#### Example 5: Creating a tarball and then compressing it using the three compression utilities #### +#### 例5:创建一个文件,然后使用三种压缩工具压缩#### -You may want to compare the effectiveness of each tool before deciding to use one or another. Note that while compressing small files, or a few files, the results may not show much differences, but may give you a glimpse of what they have to offer. +在决定使用一个或另一个工具之前,您可能想比较每个工具的压缩效率。请注意压缩小文件或几个文件,结果可能不会有太大的差异,但可能会给你看出他们的差异 # tar cf ApacheLogs-$(date +%Y%m%d).tar /var/log/httpd/* # Create an ordinary tarball # tar czf ApacheLogs-$(date +%Y%m%d).tar.gz /var/log/httpd/* # Create a tarball and compress with gzip @@ -268,51 +270,51 @@ You may want to compare the effectiveness of each tool before deciding to use on ![Linux tar command examples](http://www.tecmint.com/wp-content/uploads/2015/03/tar-command-examples.png) -tar command examples +tar 命令实例 -#### Example 6: Preserving original permissions and ownership while archiving and when #### +#### 例6:归档时同时保存原始权限和所有权 #### -If you are creating backups from users’ home directories, you will want to store the individual files with the original permissions and ownership instead of changing them to that of the user account or daemon performing the backup. The following example preserves these attributes while taking the backup of the contents in the `/var/log/httpd` directory: +如果你创建的是用户的主目录的备份,你需要要存储的个人文件与原始权限和所有权,而不是通过改变他们的用户帐户或守护进程来执行备份。下面的命令可以在归档时保留文件属性 # tar cJf ApacheLogs-$(date +%Y%m%d).tar.xz /var/log/httpd/* --same-permissions --same-owner -### Create Hard and Soft Links ### +### 创建软连接和硬链接 ### -In Linux, there are two types of links to files: hard links and soft (aka symbolic) links. Since a hard link represents another name for an existing file and is identified by the same inode, it then points to the actual data, as opposed to symbolic links, which point to filenames instead. +在Linux中,有2种类型的链接文件:硬链接和软(也称为符号)链接。因为硬链接文件代表另一个名称是由同一点确定,然后链接到实际的数据;符号链接指向的文件名,而不是实际的数据 -In addition, hard links do not occupy space on disk, while symbolic links do take a small amount of space to store the text of the link itself. The downside of hard links is that they can only be used to reference files within the filesystem where they are located because inodes are unique inside a filesystem. Symbolic links save the day, in that they point to another file or directory by name rather than by inode, and therefore can cross filesystem boundaries. +此外,硬链接不占用磁盘上的空间,而符号链接做占用少量的空间来存储的链接本身的文本。硬链接的缺点就是要求他们必须在同一个innode内。而符号链接没有这个限制,符号链接因为只保存了文件名和目录名,所以可以跨文件系统. -The basic syntax to create links is similar in both cases: +创建链接的基本语法看起来是相似的: - # ln TARGET LINK_NAME # Hard link named LINK_NAME to file named TARGET - # ln -s TARGET LINK_NAME # Soft link named LINK_NAME to file named TARGET + # ln TARGET LINK_NAME #从Link_NAME到Target的硬链接 + # ln -s TARGET LINK_NAME #从Link_NAME到Target的软链接 -#### Example 7: Creating hard and soft links #### +#### 例7:创建硬链接和软链接 #### -There is no better way to visualize the relation between a file and a hard or symbolic link that point to it, than to create those links. In the following screenshot you will see that the file and the hard link that points to it share the same inode and both are identified by the same disk usage of 466 bytes. +没有更好的方式来形象的说明一个文件和一个指向它的符号链接的关系,而不是创建这些链接。在下面的截图中你会看到文件的硬链接指向它共享相同的节点都是由466个字节的磁盘使用情况确定。 -On the other hand, creating a hard link results in an extra disk usage of 5 bytes. Not that you’re going to run out of storage capacity, but this example is enough to illustrate the difference between a hard link and a soft link. +另一方面,在别的磁盘创建一个硬链接将占用5个字节,并不是说你将耗尽存储容量,而是这个例子足以说明一个硬链接和软链接之间的区别。 ![Difference between a hard link and a soft link](http://www.tecmint.com/wp-content/uploads/2015/03/hard-soft-link.png) -Difference between a hard link and a soft link +软连接和硬链接之间的不同 -A typical usage of symbolic links is to reference a versioned file in a Linux system. Suppose there are several programs that need access to file fooX.Y, which is subject to frequent version updates (think of a library, for example). Instead of updating every single reference to fooX.Y every time there’s a version update, it is wiser, safer, and faster, to have programs look to a symbolic link named just foo, which in turn points to the actual fooX.Y. +符号链接的典型用法是在Linux系统的版本文件参考。假设有需要一个访问文件foo X.Y 想图书馆一样经常被访问,你想更新一个就可以而不是更新所有的foo X.Y,这时使用软连接更为明智和安全。有文件被看成foo X.Y的链接符号,从而找到foo X.Y -Thus, when X and Y change, you only need to edit the symbolic link foo with a new destination name instead of tracking every usage of the destination file and updating it. +这样的话,当你的X和Y发生变化后,你只需更新一个文件,而不是更新每个文件。 -### Summary ### +### 总结 ### -In this article we have reviewed some essential file and directory management skills that must be a part of every system administrator’s tool-set. Make sure to review other parts of this series as well in order to integrate these topics with the content covered in this tutorial. +在这篇文章中,我们回顾了一些基本的文件和目录管理技能,这是每个系统管理员的工具集的一部分。请确保阅读了本系列的其他部分,以及复习并将这些主题与本教程所涵盖的内容相结合。 -Feel free to let us know if you have any questions or comments. We are always more than glad to hear from our readers. +如果你有任何问题或意见,请随时告诉我们。我们总是很高兴从读者那获取反馈. -------------------------------------------------------------------------------- via: http://www.tecmint.com/file-and-directory-management-in-linux/ 作者:[Gabriel Cánepa][a] -译者:[译者ID](https://github.com/译者ID) +译者:[xiqingongzi](https://github.com/xiqingongzi) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 483fe49938411ce8d731a9e6893d56246d1a363a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=AE=A6=E6=88=90?= Date: Sat, 8 Aug 2015 03:27:35 +0800 Subject: [PATCH 858/965] =?UTF-8?q?=E9=A2=86RHCSA=E7=AC=AC=E4=B8=89?= =?UTF-8?q?=E7=AF=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...eries--Part 03--How to Manage Users and Groups in RHEL 7.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/RHCSA Series/RHCSA Series--Part 03--How to Manage Users and Groups in RHEL 7.md b/sources/tech/RHCSA Series/RHCSA Series--Part 03--How to Manage Users and Groups in RHEL 7.md index be78c87e3a..0b85744c6c 100644 --- a/sources/tech/RHCSA Series/RHCSA Series--Part 03--How to Manage Users and Groups in RHEL 7.md +++ b/sources/tech/RHCSA Series/RHCSA Series--Part 03--How to Manage Users and Groups in RHEL 7.md @@ -1,3 +1,4 @@ +[translated by xiqingongzi] RHCSA Series: How to Manage Users and Groups in RHEL 7 – Part 3 ================================================================================ Managing a RHEL 7 server, as it is the case with any other Linux server, will require that you know how to add, edit, suspend, or delete user accounts, and grant users the necessary permissions to files, directories, and other system resources to perform their assigned tasks. @@ -245,4 +246,4 @@ via: http://www.tecmint.com/rhcsa-exam-manage-users-and-groups/ [2]:http://www.tecmint.com/usermod-command-examples/ [3]:http://www.tecmint.com/ls-interview-questions/ [4]:http://www.tecmint.com/file-and-directory-management-in-linux/ -[5]:http://www.tecmint.com/rhcsa-exam-reviewing-essential-commands-system-documentation/ \ No newline at end of file +[5]:http://www.tecmint.com/rhcsa-exam-reviewing-essential-commands-system-documentation/ From 6a1641ce6e2328d1ad15908f34c9ecb80e7c19f3 Mon Sep 17 00:00:00 2001 From: xiqingongzi Date: Sat, 8 Aug 2015 03:38:00 +0800 Subject: [PATCH 859/965] Move --- ...t 01--Reviewing Essential Commands and System Documentation.md | 0 ...ries--Part 02--How to Perform File and Directory Management.md | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename {sources/tech/RHCSA Series => translated/tech/RHCSA}/RHCSA Series--Part 01--Reviewing Essential Commands and System Documentation.md (100%) rename {sources/tech/RHCSA Series => translated/tech/RHCSA}/RHCSA Series--Part 02--How to Perform File and Directory Management.md (100%) diff --git a/sources/tech/RHCSA Series/RHCSA Series--Part 01--Reviewing Essential Commands and System Documentation.md b/translated/tech/RHCSA/RHCSA Series--Part 01--Reviewing Essential Commands and System Documentation.md similarity index 100% rename from sources/tech/RHCSA Series/RHCSA Series--Part 01--Reviewing Essential Commands and System Documentation.md rename to translated/tech/RHCSA/RHCSA Series--Part 01--Reviewing Essential Commands and System Documentation.md diff --git a/sources/tech/RHCSA Series/RHCSA Series--Part 02--How to Perform File and Directory Management.md b/translated/tech/RHCSA/RHCSA Series--Part 02--How to Perform File and Directory Management.md similarity index 100% rename from sources/tech/RHCSA Series/RHCSA Series--Part 02--How to Perform File and Directory Management.md rename to translated/tech/RHCSA/RHCSA Series--Part 02--How to Perform File and Directory Management.md From 339bbf0b5c6ba7649972b300e40535316fabbb64 Mon Sep 17 00:00:00 2001 From: ictlyh Date: Sat, 8 Aug 2015 18:06:08 +0800 Subject: [PATCH 860/965] [Translated] tech/20150807 How To--Temporarily Clear Bash Environment Variables on a Linux and Unix-like System.md --- ...riables on a Linux and Unix-like System.md | 47 +++++++++---------- 1 file changed, 23 insertions(+), 24 deletions(-) rename {sources => translated}/tech/20150807 How To--Temporarily Clear Bash Environment Variables on a Linux and Unix-like System.md (50%) diff --git a/sources/tech/20150807 How To--Temporarily Clear Bash Environment Variables on a Linux and Unix-like System.md b/translated/tech/20150807 How To--Temporarily Clear Bash Environment Variables on a Linux and Unix-like System.md similarity index 50% rename from sources/tech/20150807 How To--Temporarily Clear Bash Environment Variables on a Linux and Unix-like System.md rename to translated/tech/20150807 How To--Temporarily Clear Bash Environment Variables on a Linux and Unix-like System.md index 715ecc2084..202c4e304a 100644 --- a/sources/tech/20150807 How To--Temporarily Clear Bash Environment Variables on a Linux and Unix-like System.md +++ b/translated/tech/20150807 How To--Temporarily Clear Bash Environment Variables on a Linux and Unix-like System.md @@ -1,50 +1,49 @@ -Translating by ictlyh -How To: Temporarily Clear Bash Environment Variables on a Linux and Unix-like System +如何在 Linux 和类 Unix 系统上临时清空 Bash 环境变量 ================================================================================ -I'm a bash shell user. I would like to temporarily clear bash shell environment variables. I do not want to delete or unset an exported environment variable. How do I run a program in a temporary environment in bash or ksh shell? +我是个 bash shell 用户。我想临时清空 bash shell 环境变量。但我不想删除或者 unset 一个 export 环境变量。我怎样才能在 bash 或 ksh shell 的临时环境中运行程序呢? -You can use the env command to set and print environment on a Linux or Unix-like systems. The env command executes utility after modifying the environment as specified on the command line. +你可以在 Linux 或类 Unix 系统中使用 env 命令设置并打印环境。env 命令将环境修改为命令行指定的那样之后再执行程序。 -### How do I display my current environment? ### +### 如何显示当前环境? ### -Open the terminal application and type any one of the following command: +打开终端应用程序并输入下面的其中一个命令: printenv -OR +或 env -Sample outputs: +输出样例: -![Fig.01: Unix/Linux: List All Environment Variables Command](http://s0.cyberciti.org/uploads/faq/2015/08/env-unix-linux-command-output.jpg) -Fig.01: Unix/Linux: List All Environment Variables Command +![Fig.01: Unix/Linux: 列出所有环境变量](http://s0.cyberciti.org/uploads/faq/2015/08/env-unix-linux-command-output.jpg) +Fig.01: Unix/Linux: 列出所有环境变量 -### Counting your environment variables ### +### 统计环境变量数目 ### -Type the following command: +输入下面的命令: env | wc -l printenv | wc -l -Sample outputs: +输出样例: 20 -### Run a program in a clean environment in bash/ksh/zsh ### +### 在 bash/ksh/zsh 干净环境中运行程序 ### -The syntax is as follows: +语法如下所示: env -i your-program-name-here arg1 arg2 ... -For example, run the wget program without using http_proxy and/or all other variables i.e. temporarily clear all bash/ksh/zsh environment variables and run the wget program: +例如,不使用 http_proxy 和/或任何其它变量运行 wget 程序。临时清除所有 bash/ksh/zsh 环境变量并运行 wget 程序: env -i /usr/local/bin/wget www.cyberciti.biz env -i wget www.cyberciti.biz -This is very useful when you want to run a command ignoring any environment variables you have set. I use this command many times everyday to ignore the http_proxy and other environment variable I have set. +这当你想忽视任何已经设置的环境变量来运行命令时非常有用。我每天都会多次使用这个命令,以便忽视 http_proxy 和其它我设置的环境变量。 -#### Example: With the http_proxy #### +#### 例子:使用 http_proxy #### $ wget www.cyberciti.biz --2015-08-03 23:20:23-- http://www.cyberciti.biz/ @@ -55,7 +54,7 @@ This is very useful when you want to run a command ignoring any environment vari index.html [ <=> ] 36.17K 87.0KB/s in 0.4s 2015-08-03 23:20:24 (87.0 KB/s) - 'index.html' saved [37041] -#### Example: Ignore the http_proxy #### +#### 例子:忽视 http_proxy #### $ env -i /usr/local/bin/wget www.cyberciti.biz --2015-08-03 23:25:17-- http://www.cyberciti.biz/ @@ -67,7 +66,7 @@ This is very useful when you want to run a command ignoring any environment vari index.html.1 [ <=> ] 36.17K 115KB/s in 0.3s 2015-08-03 23:25:18 (115 KB/s) - 'index.html.1' saved [37041] -The option -i causes env command to completely ignore the environment it inherits. However, it does not prevent your command (such as wget or curl) setting new variables. Also, note down the side effect of running bash/ksh shell: +-i 选项使 env 命令完全忽视它继承的环境。但是,它并不阻止你的命令(例如 wget 或 curl)设置新的变量。同时,也要注意运行 bash/ksh shell 的副作用: env -i env | wc -l ## empty ## # Now run bash ## @@ -75,15 +74,15 @@ The option -i causes env command to completely ignore the environment it inherit ## New enviroment set by bash program ## env | wc -l -#### Example: Set an environmental variable #### +#### 例子:设置一个环境变量 #### -The syntax is: +语法如下: env var=value /path/to/command arg1 arg2 ... ## OR ## var=value /path/to/command arg1 arg2 ... -For example set http_proxy: +例如设置 http_proxy: env http_proxy="http://USER:PASSWORD@server1.cyberciti.biz:3128/" \ /usr/local/bin/wget www.cyberciti.biz @@ -93,7 +92,7 @@ For example set http_proxy: via: http://www.cyberciti.biz/faq/linux-unix-temporarily-clearing-environment-variables-command/ 作者:Vivek Gite -译者:[译者ID](https://github.com/译者ID) +译者:[ictlyh](https://github.com/ictlyh) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 \ No newline at end of file From a2890da52e074dbd6b53ca274db3ce87202569fa Mon Sep 17 00:00:00 2001 From: wxy Date: Sat, 8 Aug 2015 22:53:24 +0800 Subject: [PATCH 861/965] PUB:20150728 Understanding Shell Commands Easily Using 'Explain Shell' Script in Linux @dingdongnigetou --- ...y Using 'Explain Shell' Script in Linux.md | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) rename {translated/tech => published}/20150728 Understanding Shell Commands Easily Using 'Explain Shell' Script in Linux.md (68%) diff --git a/translated/tech/20150728 Understanding Shell Commands Easily Using 'Explain Shell' Script in Linux.md b/published/20150728 Understanding Shell Commands Easily Using 'Explain Shell' Script in Linux.md similarity index 68% rename from translated/tech/20150728 Understanding Shell Commands Easily Using 'Explain Shell' Script in Linux.md rename to published/20150728 Understanding Shell Commands Easily Using 'Explain Shell' Script in Linux.md index b8f993676c..d31df55711 100644 --- a/translated/tech/20150728 Understanding Shell Commands Easily Using 'Explain Shell' Script in Linux.md +++ b/published/20150728 Understanding Shell Commands Easily Using 'Explain Shell' Script in Linux.md @@ -1,16 +1,16 @@ -在Linux中利用"Explain Shell"脚本更容易地理解Shell命令 +轻松使用“Explain Shell”脚本来理解 Shell 命令 ================================================================================ -在某些时刻, 当我们在Linux平台上工作时我们所有人都需要shell命令的帮助信息。 尽管内置的帮助像man pages、whatis命令是有帮助的, 但man pages的输出非常冗长, 除非是个有linux经验的人,不然从大量的man pages中获取帮助信息是非常困难的,而whatis命令的输出很少超过一行, 这对初学者来说是不够的。 +我们在Linux上工作时,每个人都会遇到需要查找shell命令的帮助信息的时候。 尽管内置的帮助像man pages、whatis命令有所助益, 但man pages的输出非常冗长, 除非是个有linux经验的人,不然从大量的man pages中获取帮助信息是非常困难的,而whatis命令的输出很少超过一行, 这对初学者来说是不够的。 ![Explain Shell Commands in Linux Shell](http://www.tecmint.com/wp-content/uploads/2015/07/Explain-Shell-Commands-in-Linux-Shell.jpeg) -在Linux Shell中解释Shell命令 +*在Linux Shell中解释Shell命令* -有一些第三方应用程序, 像我们在[Commandline Cheat Sheet for Linux Users][1]提及过的'cheat'命令。Cheat是个杰出的应用程序,即使计算机没有联网也能提供shell命令的帮助, 但是它仅限于预先定义好的命令。 +有一些第三方应用程序, 像我们在[Linux 用户的命令行速查表][1]提及过的'cheat'命令。cheat是个优秀的应用程序,即使计算机没有联网也能提供shell命令的帮助, 但是它仅限于预先定义好的命令。 -Jackson写了一小段代码,它能非常有效地在bash shell里面解释shell命令,可能最美之处就是你不需要安装第三方包了。他把包含这段代码的的文件命名为”explain.sh“。 +Jackson写了一小段代码,它能非常有效地在bash shell里面解释shell命令,可能最美之处就是你不需要安装第三方包了。他把包含这段代码的的文件命名为“explain.sh”。 -#### Explain工具的特性 #### +#### explain.sh工具的特性 #### - 易嵌入代码。 - 不需要安装第三方工具。 @@ -18,22 +18,22 @@ Jackson写了一小段代码,它能非常有效地在bash shell里面解释she - 需要网络连接才能工作。 - 纯命令行工具。 - 可以解释bash shell里面的大部分shell命令。 -- 无需root账户参与。 +- 无需使用root账户。 **先决条件** -唯一的条件就是'curl'包了。 在如今大多数Linux发行版里面已经预安装了culr包, 如果没有你可以按照下面的命令来安装。 +唯一的条件就是'curl'包了。 在如今大多数Linux发行版里面已经预安装了curl包, 如果没有你可以按照下面的命令来安装。 # apt-get install curl [On Debian systems] # yum install curl [On CentOS systems] ### 在Linux上安装explain.sh工具 ### -我们要将下面这段代码插入'~/.bashrc'文件(LCTT注: 若没有该文件可以自己新建一个)中。我们必须为每个用户以及对应的'.bashrc'文件插入这段代码,笔者建议你不要加在root用户下。 +我们要将下面这段代码插入'~/.bashrc'文件(LCTT译注: 若没有该文件可以自己新建一个)中。我们要为每个用户以及对应的'.bashrc'文件插入这段代码,但是建议你不要加在root用户下。 我们注意到.bashrc文件的第一行代码以(#)开始, 这个是可选的并且只是为了区分余下的代码。 -# explain.sh 标记代码的开始, 我们将代码插入.bashrc文件的底部。 +\# explain.sh 标记代码的开始, 我们将代码插入.bashrc文件的底部。 # explain.sh begins explain () { @@ -53,7 +53,7 @@ Jackson写了一小段代码,它能非常有效地在bash shell里面解释she ### explain.sh工具的使用 ### -在插入代码并保存之后,你必须退出当前的会话然后重新登录来使改变生效(LCTT注:你也可以直接使用命令“source~/.bashrc”来让改变生效)。每件事情都是交由‘curl’命令处理, 它负责将需要解释的命令以及命令选项传送给mankier服务,然后将必要的信息打印到Linux命令行。不必说的就是使用这个工具你总是需要连接网络。 +在插入代码并保存之后,你必须退出当前的会话然后重新登录来使改变生效(LCTT译注:你也可以直接使用命令`source~/.bashrc` 来让改变生效)。每件事情都是交由‘curl’命令处理, 它负责将需要解释的命令以及命令选项传送给mankier服务,然后将必要的信息打印到Linux命令行。不必说的就是使用这个工具你总是需要连接网络。 让我们用explain.sh脚本测试几个笔者不懂的命令例子。 @@ -63,7 +63,7 @@ Jackson写了一小段代码,它能非常有效地在bash shell里面解释she ![Get Help on du Command](http://www.tecmint.com/wp-content/uploads/2015/07/Get-Help-on-du-Command.png) -获得du命令的帮助 +*获得du命令的帮助* **2.如果你忘了'tar -zxvf'的作用,你可以简单地如此做:** @@ -71,7 +71,7 @@ Jackson写了一小段代码,它能非常有效地在bash shell里面解释she ![Tar Command Help](http://www.tecmint.com/wp-content/uploads/2015/07/Tar-Command-Help.png) -Tar命令帮助 +*Tar命令帮助* **3.我的一个朋友经常对'whatis'以及'whereis'命令的使用感到困惑,所以我建议他:** @@ -86,7 +86,7 @@ Tar命令帮助 ![Whatis Whereis Commands Help](http://www.tecmint.com/wp-content/uploads/2015/07/Whatis-Whereis-Commands-Help.png) -Whatis/Whereis命令的帮助 +*Whatis/Whereis命令的帮助* 你只需要使用“Ctrl+c”就能退出交互模式。 @@ -96,11 +96,11 @@ Whatis/Whereis命令的帮助 ![Get Help on Multiple Commands](http://www.tecmint.com/wp-content/uploads/2015/07/Get-Help-on-Multiple-Commands.png) -获取多条命令的帮助 +*获取多条命令的帮助* -同样地,你可以请求你的shell来解释任何shell命令。 前提是你需要一个可用的网络。输出的信息是基于解释的需要从服务器中生成的,因此输出的结果是不可定制的。 +同样地,你可以请求你的shell来解释任何shell命令。 前提是你需要一个可用的网络。输出的信息是基于需要解释的命令,从服务器中生成的,因此输出的结果是不可定制的。 -对于我来说这个工具真的很有用并且它已经荣幸地添加在我的.bashrc文件中。你对这个项目有什么想法?它对你有用么?它的解释令你满意吗?请让我知道吧! +对于我来说这个工具真的很有用,并且它已经荣幸地添加在我的.bashrc文件中。你对这个项目有什么想法?它对你有用么?它的解释令你满意吗?请让我知道吧! 请在下面评论为我们提供宝贵意见,喜欢并分享我们以及帮助我们得到传播。 @@ -110,7 +110,7 @@ via: http://www.tecmint.com/explain-shell-commands-in-the-linux-shell/ 作者:[Avishek Kumar][a] 译者:[dingdongnigetou](https://github.com/dingdongnigetou) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 8a5094fa7787dc36c9761d7128a0bd15b1cb8a64 Mon Sep 17 00:00:00 2001 From: Ezio Date: Sat, 8 Aug 2015 22:54:02 +0800 Subject: [PATCH 862/965] Update 20150728 Process of the Linux kernel building.md --- sources/tech/20150728 Process of the Linux kernel building.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150728 Process of the Linux kernel building.md b/sources/tech/20150728 Process of the Linux kernel building.md index cb7ec19b45..1c03ebbe72 100644 --- a/sources/tech/20150728 Process of the Linux kernel building.md +++ b/sources/tech/20150728 Process of the Linux kernel building.md @@ -1,3 +1,5 @@ +Translating by Ezio + Process of the Linux kernel building ================================================================================ Introduction @@ -671,4 +673,4 @@ via: https://github.com/0xAX/linux-insides/blob/master/Misc/how_kernel_compiled. 译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID) -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 \ No newline at end of file +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From be302cdf123a3ab2492aee561432876902949655 Mon Sep 17 00:00:00 2001 From: wxy Date: Sat, 8 Aug 2015 23:50:31 +0800 Subject: [PATCH 863/965] PUB:20150807 How To--Temporarily Clear Bash Environment Variables on a Linux and Unix-like System @ictlyh --- ...riables on a Linux and Unix-like System.md | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) rename {translated/tech => published}/20150807 How To--Temporarily Clear Bash Environment Variables on a Linux and Unix-like System.md (71%) diff --git a/translated/tech/20150807 How To--Temporarily Clear Bash Environment Variables on a Linux and Unix-like System.md b/published/20150807 How To--Temporarily Clear Bash Environment Variables on a Linux and Unix-like System.md similarity index 71% rename from translated/tech/20150807 How To--Temporarily Clear Bash Environment Variables on a Linux and Unix-like System.md rename to published/20150807 How To--Temporarily Clear Bash Environment Variables on a Linux and Unix-like System.md index 202c4e304a..2157cdc4e6 100644 --- a/translated/tech/20150807 How To--Temporarily Clear Bash Environment Variables on a Linux and Unix-like System.md +++ b/published/20150807 How To--Temporarily Clear Bash Environment Variables on a Linux and Unix-like System.md @@ -1,8 +1,8 @@ -如何在 Linux 和类 Unix 系统上临时清空 Bash 环境变量 +如何在 Linux 上运行命令前临时清空 Bash 环境变量 ================================================================================ -我是个 bash shell 用户。我想临时清空 bash shell 环境变量。但我不想删除或者 unset 一个 export 环境变量。我怎样才能在 bash 或 ksh shell 的临时环境中运行程序呢? +我是个 bash shell 用户。我想临时清空 bash shell 环境变量。但我不想删除或者 unset 一个输出的环境变量。我怎样才能在 bash 或 ksh shell 的临时环境中运行程序呢? -你可以在 Linux 或类 Unix 系统中使用 env 命令设置并打印环境。env 命令将环境修改为命令行指定的那样之后再执行程序。 +你可以在 Linux 或类 Unix 系统中使用 env 命令设置并打印环境。env 命令可以按命令行指定的变量来修改环境,之后再执行程序。 ### 如何显示当前环境? ### @@ -17,29 +17,30 @@ 输出样例: ![Fig.01: Unix/Linux: 列出所有环境变量](http://s0.cyberciti.org/uploads/faq/2015/08/env-unix-linux-command-output.jpg) -Fig.01: Unix/Linux: 列出所有环境变量 + +*Fig.01: Unix/Linux: 列出所有环境变量* ### 统计环境变量数目 ### 输入下面的命令: env | wc -l - printenv | wc -l + printenv | wc -l # 或者 输出样例: 20 -### 在 bash/ksh/zsh 干净环境中运行程序 ### +### 在干净的 bash/ksh/zsh 环境中运行程序 ### 语法如下所示: env -i your-program-name-here arg1 arg2 ... -例如,不使用 http_proxy 和/或任何其它变量运行 wget 程序。临时清除所有 bash/ksh/zsh 环境变量并运行 wget 程序: +例如,要在不使用 http_proxy 和/或任何其它环境变量的情况下运行 wget 程序。临时清除所有 bash/ksh/zsh 环境变量并运行 wget 程序: env -i /usr/local/bin/wget www.cyberciti.biz - env -i wget www.cyberciti.biz + env -i wget www.cyberciti.biz # 或者 这当你想忽视任何已经设置的环境变量来运行命令时非常有用。我每天都会多次使用这个命令,以便忽视 http_proxy 和其它我设置的环境变量。 @@ -66,12 +67,12 @@ Fig.01: Unix/Linux: 列出所有环境变量 index.html.1 [ <=> ] 36.17K 115KB/s in 0.3s 2015-08-03 23:25:18 (115 KB/s) - 'index.html.1' saved [37041] --i 选项使 env 命令完全忽视它继承的环境。但是,它并不阻止你的命令(例如 wget 或 curl)设置新的变量。同时,也要注意运行 bash/ksh shell 的副作用: +-i 选项使 env 命令完全忽视它继承的环境。但是,它并不会阻止你的命令(例如 wget 或 curl)设置新的变量。同时,也要注意运行 bash/ksh shell 的副作用: - env -i env | wc -l ## empty ## - # Now run bash ## + env -i env | wc -l ## 空的 ## + # 现在运行 bash ## env -i bash - ## New enviroment set by bash program ## + ## bash 设置了新的环境变量 ## env | wc -l #### 例子:设置一个环境变量 #### @@ -79,13 +80,12 @@ Fig.01: Unix/Linux: 列出所有环境变量 语法如下: env var=value /path/to/command arg1 arg2 ... - ## OR ## + ## 或 ## var=value /path/to/command arg1 arg2 ... 例如设置 http_proxy: - env http_proxy="http://USER:PASSWORD@server1.cyberciti.biz:3128/" \ - /usr/local/bin/wget www.cyberciti.biz + env http_proxy="http://USER:PASSWORD@server1.cyberciti.biz:3128/" /usr/local/bin/wget www.cyberciti.biz -------------------------------------------------------------------------------- @@ -93,6 +93,6 @@ via: http://www.cyberciti.biz/faq/linux-unix-temporarily-clearing-environment-va 作者:Vivek Gite 译者:[ictlyh](https://github.com/ictlyh) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 \ No newline at end of file From 1f7c172f463723aa85ea3605c88de9e89835f78b Mon Sep 17 00:00:00 2001 From: geekpi Date: Sun, 9 Aug 2015 10:51:47 +0800 Subject: [PATCH 864/965] translating --- ...0 How to Setup iTOP (IT Operational Portal) on CentOS 7.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150730 How to Setup iTOP (IT Operational Portal) on CentOS 7.md b/sources/tech/20150730 How to Setup iTOP (IT Operational Portal) on CentOS 7.md index 38477bb662..8b598999e1 100644 --- a/sources/tech/20150730 How to Setup iTOP (IT Operational Portal) on CentOS 7.md +++ b/sources/tech/20150730 How to Setup iTOP (IT Operational Portal) on CentOS 7.md @@ -1,3 +1,5 @@ +tranlsating---geekpi + How to Setup iTOP (IT Operational Portal) on CentOS 7 ================================================================================ iTOP is a simple, Open source web based IT Service Management tool. It has all of ITIL functionality that includes with Service desk, Configuration Management, Incident Management, Problem Management, Change Management and Service Management. iTop relays on Apache/IIS, MySQL and PHP, so it can run on any operating system supporting these applications. Since iTop is a web based application you don’t need to deploy any client software on each user’s PC. A simple web browser is enough to perform day to day operations of an IT environment with iTOP. @@ -171,4 +173,4 @@ via: http://linoxide.com/tools/setup-itop-centos-7/ 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 [a]:http://linoxide.com/author/kashifs/ -[1]:http://www.combodo.com/spip.php?page=rubrique&id_rubrique=8 \ No newline at end of file +[1]:http://www.combodo.com/spip.php?page=rubrique&id_rubrique=8 From 3e3f2fab11865dd4cdbb700a62507cd8d14d2f4d Mon Sep 17 00:00:00 2001 From: geekpi Date: Sun, 9 Aug 2015 16:34:00 +0800 Subject: [PATCH 865/965] translated --- ...TOP (IT Operational Portal) on CentOS 7.md | 104 +++++++++--------- 1 file changed, 51 insertions(+), 53 deletions(-) diff --git a/sources/tech/20150730 How to Setup iTOP (IT Operational Portal) on CentOS 7.md b/sources/tech/20150730 How to Setup iTOP (IT Operational Portal) on CentOS 7.md index 8b598999e1..dd20493d77 100644 --- a/sources/tech/20150730 How to Setup iTOP (IT Operational Portal) on CentOS 7.md +++ b/sources/tech/20150730 How to Setup iTOP (IT Operational Portal) on CentOS 7.md @@ -1,30 +1,28 @@ -tranlsating---geekpi - -How to Setup iTOP (IT Operational Portal) on CentOS 7 +如何在CentOS上安装iTOP(IT操作门户) ================================================================================ -iTOP is a simple, Open source web based IT Service Management tool. It has all of ITIL functionality that includes with Service desk, Configuration Management, Incident Management, Problem Management, Change Management and Service Management. iTop relays on Apache/IIS, MySQL and PHP, so it can run on any operating system supporting these applications. Since iTop is a web based application you don’t need to deploy any client software on each user’s PC. A simple web browser is enough to perform day to day operations of an IT environment with iTOP. +iTOP简单来说是一个简单的基于网络的开源IT服务管理工具。它有所有的ITIL功能包括服务台、配置管理、事件管理、问题管理、更改管理和服务管理。iTOP依赖于Apache/IIS、MySQL和PHP,因此它可以运行在任何支持这些软件的操作系统中。因为iTOP是一个网络程序,因此你不必在用户的PC端任何客户端程序。一个简单的浏览器就足够每天的IT环境操作了。 -To install and configure iTOP we will be using CentOS 7 as base operating with basic LAMP Stack environment installed on it that will cover its almost all prerequisites. +我们要在一台有满足基本需求的LAMP环境的CentOS 7上安装和配置iTOP。 -### Downloading iTOP ### +### 下载 iTOP ### -iTop download package is present on SourceForge, we can get its link from their official website [link][1]. +iTOP的下载包现在在SOurceForge上,我们可以从这获取它的官方[链接][1]。 ![itop download](http://blog.linoxide.com/wp-content/uploads/2015/07/1-itop-download.png) -We will the download link from here and get this zipped file on server with wget command as below. +我们从这里的连接用wget命令获取压缩文件 [root@centos-007 ~]# wget http://downloads.sourceforge.net/project/itop/itop/2.1.0/iTop-2.1.0-2127.zip -### iTop Extensions and Web Setup ### +### iTop扩展和网络安装 ### -By using unzip command we will extract the downloaded packages in the document root directory of our apache web server in a new directory with name itop. +使用unzip命令解压到apache根目录下的itop文件夹下。 [root@centos-7 ~]# ls iTop-2.1.0-2127.zip [root@centos-7 ~]# unzip iTop-2.1.0-2127.zip -d /var/www/html/itop/ -List the folder to view installation packages in it. +列出安装包中的内容。 [root@centos-7 ~]# ls -lh /var/www/html/itop/ total 68K @@ -33,7 +31,7 @@ List the folder to view installation packages in it. -rw-r--r--. 1 root root 23K Dec 17 2014 README drwxr-xr-x. 19 root root 4.0K Jul 14 13:10 web -Here is all the extensions that we can install. +这些是我们可以安装的扩展。 [root@centos-7 2.x]# ls authent-external itop-backup itop-config-mgmt itop-problem-mgmt itop-service-mgmt-provider itop-welcome-itil @@ -42,132 +40,132 @@ Here is all the extensions that we can install. installation.xml itop-change-mgmt-itil itop-incident-mgmt-itil itop-request-mgmt-itil itop-tickets itop-attachments itop-config itop-knownerror-mgmt itop-service-mgmt itop-virtualization-mgmt -Now from the extracted web directory, moving through different data models we will migrate the required extensions from the datamodels into the web extensions directory of web document root directory with copy command. +在解压的目录下,通过不同的数据模型用复制命令迁移需要的扩展从datamodels复制到web扩展目录下。 [root@centos-7 2.x]# pwd /var/www/html/itop/web/datamodels/2.x [root@centos-7 2.x]# cp -r itop-request-mgmt itop-service-mgmt itop-service-mgmt itop-config itop-change-mgmt /var/www/html/itop/web/extensions/ -### Installing iTop Web Interface ### +### 安装 iTop web界面 ### -Most of our server side settings and configurations are done.Finally we need to complete its web interface installation process to finalize the setup. +大多数服务端设置和配置已经完成了。最后我们安装web界面来完成安装。 -Open your favorite web browser and access the WordPress web directory in your web browser using your server IP or FQDN like. +打开浏览器使用ip地址或者FQDN来访问WordPress web目录。 http://servers_ip_address/itop/web/ -You will be redirected towards the web installation process for iTop. Let’s configure it as per your requirements like we did here in this tutorial. +你会被重定向到iTOP的web安装页面。让我们按照要求配置,就像在这篇教程中做的那样。 -#### Prerequisites Validation #### +#### 先决要求验证 #### -At the stage you will be prompted for welcome screen with prerequisites validation ok. If you get some warning then you have to make resolve it by installing its prerequisites. +这一步你就会看到验证完成的欢迎界面。如果你看到了一些警告信息,你需要先安装这些软件来解决这些问题。 ![mcrypt missing](http://blog.linoxide.com/wp-content/uploads/2015/07/2-itop-web-install.png) -At this stage one optional package named php mcrypt will be missing. Download the following rpm package then try to install php mcrypt package. +这一步一个叫php mcrypt的可选包丢失了。下载下面的rpm包接着尝试安装php mcrypt包。 [root@centos-7 ~]#yum localinstall php-mcrypt-5.3.3-1.el6.x86_64.rpm libmcrypt-2.5.8-9.el6.x86_64.rpm. -After successful installation of php-mcrypt library we need to restart apache web service, then reload the web page and this time its prerequisites validation should be OK. +成功安装完php-mcrypt后,我们需要重启apache服务,接着刷新页面,这时验证应该已经OK。 -#### Install or Upgrade iTop #### +#### 安装或者升级 iTop #### -Here we will choose the fresh installation as we have not installed iTop previously on our server. +现在我们要在没有安装iTOP的服务器上选择全新安装。 ![Install New iTop](http://blog.linoxide.com/wp-content/uploads/2015/07/3.png) -#### iTop License Agreement #### +#### iTop 许可协议 #### -Chose the option to accept the terms of the licenses of all the components of iTop and click "NEXT". +勾选同意iTOP所有组件的许可协议并点击“NEXT”。 ![License Agreement](http://blog.linoxide.com/wp-content/uploads/2015/07/4.png) -#### Database Configuration #### +#### 数据库配置 #### -Here we the do Configuration of the database connection by giving our database servers credentials and then choose from the option to create new database as shown. +现在我们输入数据库凭据来配置数据库连接,接着选择如下选择创建新数据库。 ![DB Connection](http://blog.linoxide.com/wp-content/uploads/2015/07/5.png) -#### Administrator Account #### +#### 管理员账户 #### -In this step we will configure an Admin account by filling out its login details as. +这一步中我们会输入它的登录信息来配置管理员账户。 ![Admin Account](http://blog.linoxide.com/wp-content/uploads/2015/07/6.png) -#### Miscellaneous Parameters #### +#### 杂项参数 #### -Let's choose the additional parameters whether you want to install with demo contents or with fresh database and proceed forward. +让我们选择额外的参数来选择你是否需要安装一个演示内容或者使用全新的数据库,接着下一步。 ![Misc Parameters](http://blog.linoxide.com/wp-content/uploads/2015/07/7.png) -### iTop Configurations Management ### +### iTop 配置管理 ### -The options below allow you to configure the type of elements that are to be managed inside iTop like all the base objects that are mandatory in the iTop CMDB, Manage Data Center devices, storage device and virtualization. +下面的选项允许你配置在iTOP要管理的元素类型,像CMDB、数据中心设备、存储设备和虚拟化这些东西在iTOP中是必须的。 ![Conf Management](http://blog.linoxide.com/wp-content/uploads/2015/07/8.png) -#### Service Management #### +#### 服务管理 #### -Select from the choices that best describes the relationships between the services and the IT infrastructure in your IT environment. So we are choosing Service Management for Service Providers here. +选择一个最能描述你的IT设备和环境之间的关系的选项。因此我们这里选择为服务提供商的服务管理。 ![Service Management](http://blog.linoxide.com/wp-content/uploads/2015/07/9.png) -#### iTop Tickets Management #### +#### iTop Tickets 管理 #### -From the different available options we will Select the ITIL Compliant Tickets Management option to have different types of ticket for managing user requests and incidents. +从不同的可用选项我们选择符合ITIL Tickets管理选项来管理不同类型的用户请求和事件。 ![Ticket Management](http://blog.linoxide.com/wp-content/uploads/2015/07/10.png) -#### Change Management Options #### +#### 改变管理选项 #### -Select the type of tickets you want to use in order to manage changes to the IT infrastructure from the available options. We are going to choose ITIL change management option here. +选择不同的ticket类型以便管理可用选项中的IT设备更改。我们选择ITTL更改管理选项。 ![ITIL Change](http://blog.linoxide.com/wp-content/uploads/2015/07/11.png) -#### iTop Extensions #### +#### iTop 扩展 #### -In this section we can select the additional extensions to install or we can unchecked the ones that you want to skip. +这一节我们选择额外的扩展来安装或者不选直接跳过。 ![iTop Extensions](http://blog.linoxide.com/wp-content/uploads/2015/07/13.png) -### Ready to Start Web Installation ### +### 准备开始web安装 ### -Now we are ready to start installing the components that we choose in previous steps. We can also drop down these installation parameters to view our configuration from the drop down. +现在我们开始准备安装先前先前选择的组件。我们也可以下拉这些安装参数来浏览我们的配置。 -Once you are confirmed with the installation parameters click on the install button. +确认安装参数后点击安装按钮。 ![Installation Parameters](http://blog.linoxide.com/wp-content/uploads/2015/07/16.png) -Let's wait for the progress bar to complete the installation process. It might takes few minutes to complete its installation process. +让我们等待进度条来完成安装步骤。它也许会花费几分钟来完成安装步骤。 ![iTop Installation Process](http://blog.linoxide.com/wp-content/uploads/2015/07/17.png) -### iTop Installation Done ### +### iTop安装完成 ### -Our iTop installation setup is complete, just need to do a simple manual operation as shown and then click to enter iTop. +我们的iTOP安装已经完成了,只要如下一个简单的手动操作就可以进入到iTOP。 ![iTop Done](http://blog.linoxide.com/wp-content/uploads/2015/07/18.png) -### Welcome to iTop (IT Operational Portal) ### +### 欢迎来到iTop (IT操作门户) ### ![itop welcome note](http://blog.linoxide.com/wp-content/uploads/2015/07/20.png) -### iTop Dashboard ### +### iTop 面板 ### -You can manage configuration of everything from here Servers, computers, Contacts, Locations, Contracts, Network devices…. You can create your own. Just the fact, that the installed CMDB module is great which is an essential part of every bigger IT. +你这里可以配置任何东西,服务、计算机、通讯录、位置、合同、网络设备等等。你可以创建你自己的。事实是刚安装的CMDB模块是每一个IT人员的必备模块。 ![iTop Dashboard](http://blog.linoxide.com/wp-content/uploads/2015/07/19.png) -### Conclusion ### +### 总结 ### -ITOP is one of the best Open Source Service Desk solutions. We have successfully installed and configured it on our CentOS 7 cloud host. So, the most powerful aspect of iTop is the ease with which it can be customized via its “extensions”. Feel free to comment if you face any trouble during its setup. +ITOP是一个最棒的开源桌面服务解决方案。我们已经在CentOS 7上成功地安装和配置了。因此,iTOP最强大的一方面是它可以很简单地通过扩展来自定义。如果你在安装中遇到任何问题欢迎评论。 -------------------------------------------------------------------------------- via: http://linoxide.com/tools/setup-itop-centos-7/ 作者:[Kashif Siddique][a] -译者:[译者ID](https://github.com/译者ID) +译者:[geekpi](https://github.com/geekpi) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From b88de33b50ce231372d1ce08194d09a7d28989d7 Mon Sep 17 00:00:00 2001 From: Chang Liu Date: Sun, 9 Aug 2015 19:30:54 +0800 Subject: [PATCH 866/965] [Translated]20150803 Linux Logging Basics.md --- sources/tech/20150803 Linux Logging Basics.md | 92 ------------------- .../tech/20150803 Linux Logging Basics.md | 90 ++++++++++++++++++ 2 files changed, 90 insertions(+), 92 deletions(-) delete mode 100644 sources/tech/20150803 Linux Logging Basics.md create mode 100644 translated/tech/20150803 Linux Logging Basics.md diff --git a/sources/tech/20150803 Linux Logging Basics.md b/sources/tech/20150803 Linux Logging Basics.md deleted file mode 100644 index 6c3c3693a4..0000000000 --- a/sources/tech/20150803 Linux Logging Basics.md +++ /dev/null @@ -1,92 +0,0 @@ -FSSlc translating - -Linux Logging Basics -================================================================================ -First we’ll describe the basics of what Linux logs are, where to find them, and how they get created. If you already know this stuff, feel free to skip to the next section. - -### Linux System Logs ### - -Many valuable log files are automatically created for you by Linux. You can find them in your /var/log directory. Here is what this directory looks like on a typical Ubuntu system: - -![](http://www.loggly.com/ultimate-guide/wp-content/uploads/2015/05/Linux-system-log-terminal.png) - -Some of the most important Linux system logs include: - -- /var/log/syslog or /var/log/messages stores all global system activity data, including startup messages. Debian-based systems like Ubuntu store this in /var/log/syslog. RedHat-based systems like RHEL or CentOS store this in /var/log/messages. -- /var/log/auth.log or /var/log/secure stores logs from the Pluggable Authentication Module (pam) including successful logins, failed login attempts, and authentication methods. Ubuntu and Debian store authentication messages in /var/log/auth.log. RedHat and CentOS store this data in /var/log/secure. -- /var/log/kern stores kernel error and warning data, which is particularly helpful for troubleshooting custom kernels. -- /var/log/cron stores information about cron jobs. Use this data to verify that your cron jobs are running successfully. - -Digital Ocean has a thorough [tutorial][1] on these files and how rsyslog creates them on common distributions like RedHat and CentOS. - -Applications also write log files in this directory. For example, popular servers like Apache, Nginx, MySQL, and more can write log files here. Some of these log files are written by the application itself. Others are created through syslog (see below). - -### What’s Syslog? ### - -How do Linux system log files get created? The answer is through the syslog daemon, which listens for log messages on the syslog socket /dev/log and then writes them to the appropriate log file. - -The word “syslog” is an overloaded term and is often used in short to refer to one of these: - -1. **Syslog daemon** — a program to receive, process, and send syslog messages. It can [send syslog remotely][2] to a centralized server or write it to a local file. Common examples include rsyslogd and syslog-ng. In this usage, people will often say “sending to syslog.” -1. **Syslog protocol** — a transport protocol specifying how logs can be sent over a network and a data format definition for syslog messages (below). It’s officially defined in [RFC-5424][3]. The standard ports are 514 for plaintext logs and 6514 for encrypted logs. In this usage, people will often say “sending over syslog.” -1. **Syslog messages** — log messages or events in the syslog format, which includes a header with several standard fields. In this usage, people will often say “sending syslog.” - -Syslog messages or events include a header with several standard fields, making analysis and routing easier. They include the timestamp, the name of the application, the classification or location in the system where the message originates, and the priority of the issue. - -Here is an example log message with the syslog header included. It’s from the sshd daemon, which controls remote logins to the system. This message describes a failed login attempt: - - <34>1 2003-10-11T22:14:15.003Z server1.com sshd - - pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=10.0.2.2 - -### Syslog Format and Fields ### - -Each syslog message includes a header with fields. Fields are structured data that makes it easier to analyze and route the events. Here is the format we used to generate the above syslog example. You can match each value to a specific field name. - - <%pri%>%protocol-version% %timestamp:::date-rfc3339% %HOSTNAME% %app-name% %procid% %msgid% %msg%n - -Below, you’ll find descriptions of some of the most commonly used syslog fields when searching or troubleshooting issues. - -#### Timestamp #### - -The [timestamp][4] field (2003-10-11T22:14:15.003Z in the example) indicates the time and date that the message was generated on the system sending the message. That time can be different from when another system receives the message. The example timestamp breaks down like this: - -- **2003-10-11** is the year, month, and day. -- **T** is a required element of the TIMESTAMP field, separating the date and the time. -- **22:14:15.003** is the 24-hour format of the time, including the number of milliseconds (**003**) into the next second. -- **Z** is an optional element, indicating UTC time. Instead of Z, the example could have included an offset, such as -08:00, which indicates that the time is offset from UTC by 8 hours, PST. - -#### Hostname #### - -The [hostname][5] field (server1.com in the example above) indicates the name of the host or system that sent the message. - -#### App-Name #### - -The [app-name][6] field (sshd:auth in the example) indicates the name of the application that sent the message. - -#### Priority #### - -The priority field or [pri][7] for short (<34> in the example above) tells you how urgent or severe the event is. It’s a combination of two numerical fields: the facility and the severity. The severity ranges from the number 7 for debug events all the way to 0 which is an emergency. The facility describes which process created the event. It ranges from 0 for kernel messages to 23 for local application use. - -Pri can be output in two ways. The first is as a single number prival which is calculated as the facility field value multiplied by 8, then the result is added to the severity field value: (facility)(8) + (severity). The second is pri-text which will output in the string format “facility.severity.” The latter format can often be easier to read and search but takes up more storage space. - --------------------------------------------------------------------------------- - -via: http://www.loggly.com/ultimate-guide/logging/linux-logging-basics/ - -作者:[Jason Skowronski][a1] -作者:[Amy Echeverri][a2] -作者:[Sadequl Hussain][a3] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a1]:https://www.linkedin.com/in/jasonskowronski -[a2]:https://www.linkedin.com/in/amyecheverri -[a3]:https://www.linkedin.com/pub/sadequl-hussain/14/711/1a7 -[1]:https://www.digitalocean.com/community/tutorials/how-to-view-and-configure-linux-logs-on-ubuntu-and-centos -[2]:https://docs.google.com/document/d/11LXZxWlkNSHkcrCWTUdnLRf_CiZz9kK0cr3yGM_BU_0/edit#heading=h.y2e9tdfk1cdb -[3]:https://tools.ietf.org/html/rfc5424 -[4]:https://tools.ietf.org/html/rfc5424#section-6.2.3 -[5]:https://tools.ietf.org/html/rfc5424#section-6.2.4 -[6]:https://tools.ietf.org/html/rfc5424#section-6.2.5 -[7]:https://tools.ietf.org/html/rfc5424#section-6.2.1 diff --git a/translated/tech/20150803 Linux Logging Basics.md b/translated/tech/20150803 Linux Logging Basics.md new file mode 100644 index 0000000000..00acdf183e --- /dev/null +++ b/translated/tech/20150803 Linux Logging Basics.md @@ -0,0 +1,90 @@ +Linux 日志基础 +================================================================================ +首先,我们将描述有关 Linux 日志是什么,到哪儿去找它们以及它们是如何创建的基础知识。如果你已经知道这些,请随意跳至下一节。 + +### Linux 系统日志 ### + +许多有价值的日志文件都是由 Linux 自动地为你创建的。你可以在 `/var/log` 目录中找到它们。下面是在一个典型的 Ubuntu 系统中这个目录的样子: + +![](http://www.loggly.com/ultimate-guide/wp-content/uploads/2015/05/Linux-system-log-terminal.png) + +一些最为重要的 Linux 系统日志包括: + +- `/var/log/syslog` 或 `/var/log/messages` 存储所有的全局系统活动数据,包括开机信息。基于 Debian 的系统如 Ubuntu 在 `/var/log/syslog` 目录中存储它们,而基于 RedHat 的系统如 RHEL 或 CentOS 则在 `/var/log/messages` 中存储它们。 +- `/var/log/auth.log` 或 `/var/log/secure` 存储来自可插拔认证模块(PAM)的日志,包括成功的登录,失败的登录尝试和认证方式。Ubuntu 和 Debian 在 `/var/log/auth.log` 中存储认证信息,而 RedHat 和 CentOS 则在 `/var/log/secure` 中存储该信息。 +- `/var/log/kern` 存储内核错误和警告数据,这对于排除与自定义内核相关的故障尤为实用。 +- `/var/log/cron` 存储有关 cron 作业的信息。使用这个数据来确保你的 cron 作业正成功地运行着。 + +Digital Ocean 有一个完整的关于这些文件及 rsyslog 如何在常见的发行版本如 RedHat 和 CentOS 中创建它们的 [教程][1] 。 + +应用程序也会在这个目录中写入日志文件。例如像 Apache,Nginx,MySQL 等常见的服务器程序可以在这个目录中写入日志文件。其中一些日志文件由应用程序自己创建,其他的则通过 syslog (具体见下文)来创建。 + +### 什么是 Syslog? ### + +Linux 系统日志文件是如何创建的呢?答案是通过 syslog 守护程序,它在 syslog +套接字 `/dev/log` 上监听日志信息,然后将它们写入适当的日志文件中。 + +单词“syslog” 是一个重载的条目,并经常被用来简称如下的几个名称之一: + +1. **Syslog 守护进程** — 一个用来接收,处理和发送 syslog 信息的程序。它可以[远程发送 syslog][2] 到一个集中式的服务器或写入一个本地文件。常见的例子包括 rsyslogd 和 syslog-ng。在这种使用方式中,人们常说 "发送到 syslog." +1. **Syslog 协议** — 一个指定日志如何通过网络来传送的传输协议和一个针对 syslog 信息(具体见下文) 的数据格式的定义。它在 [RFC-5424][3] 中被正式定义。对于文本日志,标准的端口是 514,对于加密日志,端口是 6514。在这种使用方式中,人们常说"通过 syslog 传送." +1. **Syslog 信息** — syslog 格式的日志信息或事件,它包括一个带有几个标准域的文件头。在这种使用方式中,人们常说"发送 syslog." + +Syslog 信息或事件包括一个带有几个标准域的 header ,使得分析和路由更方便。它们包括时间戳,应用程序的名称,在系统中信息来源的分类或位置,以及事件的优先级。 + +下面展示的是一个包含 syslog header 的日志信息,它来自于 sshd 守护进程,它控制着到该系统的远程登录,这个信息描述的是一次失败的登录尝试: + + <34>1 2003-10-11T22:14:15.003Z server1.com sshd - - pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=10.0.2.2 + +### Syslog 格式和域 ### + +每条 syslog 信息包含一个带有域的 header,这些域是结构化的数据,使得分析和路由事件更加容易。下面是我们使用的用来产生上面的 syslog 例子的格式,你可以将每个值匹配到一个特定的域的名称上。 + + <%pri%>%protocol-version% %timestamp:::date-rfc3339% %HOSTNAME% %app-name% %procid% %msgid% %msg%n + +下面,你将看到一些在查找或排错时最常使用的 syslog 域: + +#### 时间戳 #### + +[时间戳][4] (上面的例子为 2003-10-11T22:14:15.003Z) 暗示了在系统中发送该信息的时间和日期。这个时间在另一系统上接收该信息时可能会有所不同。上面例子中的时间戳可以分解为: + +- **2003-10-11** 年,月,日. +- **T** 为时间戳的必需元素,它将日期和时间分离开. +- **22:14:15.003** 是 24 小时制的时间,包括进入下一秒的毫秒数(**003**). +- **Z** 是一个可选元素,指的是 UTC 时间,除了 Z,这个例子还可以包括一个偏移量,例如 -08:00,这意味着时间从 UTC 偏移 8 小时,即 PST 时间. + +#### 主机名 #### + +[主机名][5] 域(在上面的例子中对应 server1.com) 指的是主机的名称或发送信息的系统. + +#### 应用名 #### + +[应用名][6] 域(在上面的例子中对应 sshd:auth) 指的是发送信息的程序的名称. + +#### 优先级 #### + +优先级域或缩写为 [pri][7] (在上面的例子中对应 <34>) 告诉我们这个事件有多紧急或多严峻。它由两个数字域组成:设备域和紧急性域。紧急性域从代表 debug 类事件的数字 7 一直到代表紧急事件的数字 0 。设备域描述了哪个进程创建了该事件。它从代表内核信息的数字 0 到代表本地应用使用的 23 。 + +Pri 有两种输出方式。第一种是以一个单独的数字表示,可以这样计算:先用设备域的值乘以 8,再加上紧急性域的值:(设备域)(8) + (紧急性域)。第二种是 pri 文本,将以“设备域.紧急性域” 的字符串格式输出。后一种格式更方便阅读和搜索,但占据更多的存储空间。 +-------------------------------------------------------------------------------- + +via: http://www.loggly.com/ultimate-guide/logging/linux-logging-basics/ + +作者:[Jason Skowronski][a1] +作者:[Amy Echeverri][a2] +作者:[Sadequl Hussain][a3] +译者:[FSSlc](https://github.com/FSSlc) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a1]:https://www.linkedin.com/in/jasonskowronski +[a2]:https://www.linkedin.com/in/amyecheverri +[a3]:https://www.linkedin.com/pub/sadequl-hussain/14/711/1a7 +[1]:https://www.digitalocean.com/community/tutorials/how-to-view-and-configure-linux-logs-on-ubuntu-and-centos +[2]:https://docs.google.com/document/d/11LXZxWlkNSHkcrCWTUdnLRf_CiZz9kK0cr3yGM_BU_0/edit#heading=h.y2e9tdfk1cdb +[3]:https://tools.ietf.org/html/rfc5424 +[4]:https://tools.ietf.org/html/rfc5424#section-6.2.3 +[5]:https://tools.ietf.org/html/rfc5424#section-6.2.4 +[6]:https://tools.ietf.org/html/rfc5424#section-6.2.5 +[7]:https://tools.ietf.org/html/rfc5424#section-6.2.1 \ No newline at end of file From 093951ac6cd1e1d65a99bf76c5224a8d146c52a2 Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 9 Aug 2015 23:53:54 +0800 Subject: [PATCH 867/965] PUB:20150730 Must-Know Linux Commands For New Users @GOLinux --- ... Must-Know Linux Commands For New Users.md | 43 ++++++++++--------- 1 file changed, 22 insertions(+), 21 deletions(-) rename {translated/tech => published}/20150730 Must-Know Linux Commands For New Users.md (72%) diff --git a/translated/tech/20150730 Must-Know Linux Commands For New Users.md b/published/20150730 Must-Know Linux Commands For New Users.md similarity index 72% rename from translated/tech/20150730 Must-Know Linux Commands For New Users.md rename to published/20150730 Must-Know Linux Commands For New Users.md index 230cecf736..657d7372bb 100644 --- a/translated/tech/20150730 Must-Know Linux Commands For New Users.md +++ b/published/20150730 Must-Know Linux Commands For New Users.md @@ -1,11 +1,12 @@ 新手应知应会的Linux命令 ================================================================================ ![Manage system updates via the command line with dnf on Fedora.](http://www.linux.com/images/stories/41373/fedora-cli.png) -在Fedora上通过命令行使用dnf来管理系统更新 -基于Linux的系统的优点之一,就是你可以通过终端中使用命令该ing来管理整个系统。使用命令行的优势在于,你可以使用相同的知识和技能来管理随便哪个Linux发行版。 +*在Fedora上通过命令行使用dnf来管理系统更新* -对于各个发行版以及桌面环境(DE)而言,要一致地使用图形化用户界面(GUI)却几乎是不可能的,因为它们都提供了各自的用户界面。要明确的是,有那么些情况,你需要在不同的发行版上使用不同的命令来部署某些特定的任务,但是,或多或少它们的概念和意图却仍然是一致的。 +基于Linux的系统最美妙的一点,就是你可以在终端中使用命令行来管理整个系统。使用命令行的优势在于,你可以使用相同的知识和技能来管理随便哪个Linux发行版。 + +对于各个发行版以及桌面环境(DE)而言,要一致地使用图形化用户界面(GUI)却几乎是不可能的,因为它们都提供了各自的用户界面。要明确的是,有些情况下在不同的发行版上需要使用不同的命令来执行某些特定的任务,但是,基本来说它们的思路和目的是一致的。 在本文中,我们打算讨论Linux用户应当掌握的一些基本命令。我将给大家演示怎样使用命令行来更新系统、管理软件、操作文件以及切换到root,这些操作将在三个主要发行版上进行:Ubuntu(也包括其定制版和衍生版,还有Debian),openSUSE,以及Fedora。 @@ -15,7 +16,7 @@ Linux是基于安全设计的,但事实上是,任何软件都有缺陷,会导致安全漏洞。所以,保持你的系统更新到最新是十分重要的。这么想吧:运行过时的操作系统,就像是你坐在全副武装的坦克里头,而门却没有锁。武器会保护你吗?任何人都可以进入开放的大门,对你造成伤害。同样,在你的系统中也有没有打补丁的漏洞,这些漏洞会危害到你的系统。开源社区,不像专利世界,在漏洞补丁方面反应是相当快的,所以,如果你保持系统最新,你也获得了安全保证。 -留意新闻站点,了解安全漏洞。如果发现了一个漏洞,请阅读之,然后在补丁出来的第一时间更新。不管怎样,在生产机器上,你每星期必须至少运行一次更新命令。如果你运行这一台复杂的服务器,那么就要额外当心了。仔细阅读变更日志,以确保更新不会搞坏你的自定义服务。 +留意新闻站点,了解安全漏洞。如果发现了一个漏洞,了解它,然后在补丁出来的第一时间更新。不管怎样,在生产环境上,你每星期必须至少运行一次更新命令。如果你运行着一台复杂的服务器,那么就要额外当心了。仔细阅读变更日志,以确保更新不会搞坏你的自定义服务。 **Ubuntu**:牢记一点:你在升级系统或安装不管什么软件之前,都必须要刷新仓库(也就是repos)。在Ubuntu上,你可以使用下面的命令来更新系统,第一个命令用于刷新仓库: @@ -29,7 +30,7 @@ Linux是基于安全设计的,但事实上是,任何软件都有缺陷,会 sudo apt-get dist-upgrade -**openSUSE**:如果你是在openSUSE上,你可以使用以下命令来更新系统(照例,第一个命令的意思是更新仓库) +**openSUSE**:如果你是在openSUSE上,你可以使用以下命令来更新系统(照例,第一个命令的意思是更新仓库): sudo zypper refresh sudo zypper up @@ -42,7 +43,7 @@ Linux是基于安全设计的,但事实上是,任何软件都有缺陷,会 ### 软件安装与移除 ### 你只可以安装那些你系统上启用的仓库中可用的包,各个发行版默认都附带有并启用了一些官方或者第三方仓库。 -**Ubuntu**: To install any package on Ubuntu, first update the repo and then use this syntax: + **Ubuntu**:要在Ubuntu上安装包,首先更新仓库,然后使用下面的语句: sudo apt-get install [package_name] @@ -75,9 +76,9 @@ Linux是基于安全设计的,但事实上是,任何软件都有缺陷,会 ### 如何管理第三方软件? ### -在一个庞大的开发者社区中,这些开发者们为用户提供了许多的软件。不同的发行版有不同的机制来使用这些第三方软件,将它们提供给用户。同时也取决于开发者怎样将这些软件提供给用户,有些开发者会提供二进制包,而另外一些开发者则将软件发布到仓库中。 +在一个庞大的开发者社区中,这些开发者们为用户提供了许多的软件。不同的发行版有不同的机制来将这些第三方软件提供给用户。当然,同时也取决于开发者怎样将这些软件提供给用户,有些开发者会提供二进制包,而另外一些开发者则将软件发布到仓库中。 -Ubuntu严重依赖于PPA(个人包归档),但是,不幸的是,它却没有提供一个内建工具来帮助用于搜索这些PPA仓库。在安装软件前,你将需要通过Google搜索PPA,然后手工添加该仓库。下面就是添加PPA到系统的方法: +Ubuntu很多地方都用到PPA(个人包归档),但是,不幸的是,它却没有提供一个内建工具来帮助用于搜索这些PPA仓库。在安装软件前,你将需要通过Google搜索PPA,然后手工添加该仓库。下面就是添加PPA到系统的方法: sudo add-apt-repository ppa: @@ -85,7 +86,7 @@ Ubuntu严重依赖于PPA(个人包归档),但是,不幸的是,它却 sudo add-apt-repository ppa:libreoffice/ppa -它会要你按下回车键来导入秘钥。完成后,使用'update'命令来刷新仓库,然后安装该包。 +它会要你按下回车键来导入密钥。完成后,使用'update'命令来刷新仓库,然后安装该包。 openSUSE拥有一个针对第三方应用的优雅的解决方案。你可以访问software.opensuse.org,一键点击搜索并安装相应包,它会自动将对应的仓库添加到你的系统中。如果你想要手工添加仓库,可以使用该命令: @@ -97,13 +98,13 @@ openSUSE拥有一个针对第三方应用的优雅的解决方案。你可以访 sudo zypper refresh sudo zypper install libreoffice -Fedora用户只需要添加RPMFusion(free和non-free仓库一起),该仓库包含了大量的应用。如果你需要添加仓库,命令如下: +Fedora用户只需要添加RPMFusion(包括自由软件和非自由软件仓库),该仓库包含了大量的应用。如果你需要添加该仓库,命令如下: -dnf config-manager --add-repo http://www.example.com/example.repo + dnf config-manager --add-repo http://www.example.com/example.repo ### 一些基本命令 ### -我已经写了一些关于使用CLI来管理你系统上的文件的[文章][1],下面介绍一些基本米ing令,这些命令在所有发行版上都经常会用到。 +我已经写了一些关于使用CLI来管理你系统上的文件的[文章][1],下面介绍一些基本命令,这些命令在所有发行版上都经常会用到。 拷贝文件或目录到一个新的位置: @@ -113,13 +114,13 @@ dnf config-manager --add-repo http://www.example.com/example.repo cp path_of_files/* path_of_the_directory_where_you_want_to_copy/ -将一个文件从某个位置移动到另一个位置(尾斜杠是说在该目录中): +将一个文件从某个位置移动到另一个位置(尾斜杠是说放在该目录中): - mv path_of_file_1 path_of_the_directory_where_you_want_to_move/ + mv path_of_file_1 path_of_the_directory_where_you_want_to_move/ 将所有文件从一个位置移动到另一个位置: - mv path_of_directory_where_files_are/* path_of_the_directory_where_you_want_to_move/ + mv path_of_directory_where_files_are/* path_of_the_directory_where_you_want_to_move/ 删除一个文件: @@ -135,11 +136,11 @@ dnf config-manager --add-repo http://www.example.com/example.repo ### 创建新目录 ### -要创建一个新目录,首先输入你要创建的目录的位置。比如说,你想要在你的Documents目录中创建一个名为'foundation'的文件夹。让我们使用 cd (即change directory,改变目录)命令来改变目录: +要创建一个新目录,首先进入到你要创建该目录的位置。比如说,你想要在你的Documents目录中创建一个名为'foundation'的文件夹。让我们使用 cd (即change directory,改变目录)命令来改变目录: cd /home/swapnil/Documents -(替换'swapnil'为你系统中的用户) +(替换'swapnil'为你系统中的用户名) 然后,使用 mkdir 命令来创建该目录: @@ -149,13 +150,13 @@ dnf config-manager --add-repo http://www.example.com/example.repo mdkir /home/swapnil/Documents/foundation -如果你想要创建父-子目录,那是指目录中的目录,那么可以使用 -p 选项。它会在指定路径中创建所有目录: +如果你想要连父目录一起创建,那么可以使用 -p 选项。它会在指定路径中创建所有目录: mdkir -p /home/swapnil/Documents/linux/foundation ### 成为root ### -你或许需要成为root,或者具有sudo权力的用户,来实施一些管理任务,如管理软件包或者对根目录或其下的文件进行一些修改。其中一个例子就是编辑'fstab'文件,该文件记录了挂载的硬件驱动器。它在'etc'目录中,而该目录又在根目录中,你只能作为超级用户来修改该文件。在大多数的发行版中,你可以通过'切换用户'来成为root。比如说,在openSUSE上,我想要成为root,因为我要在根目录中工作,你可以使用下面的命令之一: +你或许需要成为root,或者具有sudo权力的用户,来实施一些管理任务,如管理软件包或者对根目录或其下的文件进行一些修改。其中一个例子就是编辑'fstab'文件,该文件记录了挂载的硬盘驱动器。它在'etc'目录中,而该目录又在根目录中,你只能作为超级用户来修改该文件。在大多数的发行版中,你可以通过'su'来成为root。比如说,在openSUSE上,我想要成为root,因为我要在根目录中工作,你可以使用下面的命令之一: sudo su - @@ -165,7 +166,7 @@ dnf config-manager --add-repo http://www.example.com/example.repo 该命令会要求输入密码,然后你就具有root特权了。记住一点:千万不要以root用户来运行系统,除非你知道你正在做什么。另外重要的一点需要注意的是,你以root什么对目录或文件进行修改后,会将它们的拥有关系从该用户或特定的服务改变为root。你必须恢复这些文件的拥有关系,否则该服务或用户就不能访问或写入到那些文件。要改变用户,命令如下: - sudo chown -R user:user /path_of_file_or_directory + sudo chown -R 用户:组 文件或目录名 当你将其它发行版上的分区挂载到系统中时,你可能经常需要该操作。当你试着访问这些分区上的文件时,你可能会碰到权限拒绝错误,你只需要改变这些分区的拥有关系就可以访问它们了。需要额外当心的是,不要改变根目录的权限或者拥有关系。 @@ -177,7 +178,7 @@ via: http://www.linux.com/learn/tutorials/842251-must-know-linux-commands-for-ne 作者:[Swapnil Bhartiya][a] 译者:[GOLinux](https://github.com/GOLinux) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From de0f6fe24b3e4197727221dfedc0fa8fc4e1a42f Mon Sep 17 00:00:00 2001 From: wxy Date: Mon, 10 Aug 2015 00:50:06 +0800 Subject: [PATCH 868/965] PUB:20150629 Autojump--An Advanced 'cd' Command to Quickly Navigate Linux Filesystem @FSSlc --- ...nd to Quickly Navigate Linux Filesystem.md | 98 ++++++++++--------- 1 file changed, 50 insertions(+), 48 deletions(-) rename {translated/tech => published}/20150629 Autojump--An Advanced 'cd' Command to Quickly Navigate Linux Filesystem.md (62%) diff --git a/translated/tech/20150629 Autojump--An Advanced 'cd' Command to Quickly Navigate Linux Filesystem.md b/published/20150629 Autojump--An Advanced 'cd' Command to Quickly Navigate Linux Filesystem.md similarity index 62% rename from translated/tech/20150629 Autojump--An Advanced 'cd' Command to Quickly Navigate Linux Filesystem.md rename to published/20150629 Autojump--An Advanced 'cd' Command to Quickly Navigate Linux Filesystem.md index 546a4b0baf..f749039d5d 100644 --- a/translated/tech/20150629 Autojump--An Advanced 'cd' Command to Quickly Navigate Linux Filesystem.md +++ b/published/20150629 Autojump--An Advanced 'cd' Command to Quickly Navigate Linux Filesystem.md @@ -1,53 +1,54 @@ -Autojump – 一个高级的‘cd’命令用以快速浏览 Linux 文件系统 +Autojump:一个可以在 Linux 文件系统快速导航的高级 cd 命令 ================================================================================ -对于那些主要通过控制台或终端使用 Linux 命令行来工作的 Linux 用户来说,他们真切地感受到了 Linux 的强大。 然而在 Linux 的分层文件系统中进行浏览有时或许是一件头疼的事,尤其是对于那些新手来说。 + +对于那些主要通过控制台或终端使用 Linux 命令行来工作的 Linux 用户来说,他们真切地感受到了 Linux 的强大。 然而在 Linux 的分层文件系统中进行导航有时或许是一件头疼的事,尤其是对于那些新手来说。 现在,有一个用 Python 写的名为 `autojump` 的 Linux 命令行实用程序,它是 Linux ‘[cd][1]’命令的高级版本。 ![Autojump 命令](http://www.tecmint.com/wp-content/uploads/2015/06/Autojump-Command.jpg) -Autojump – 浏览 Linux 文件系统的最快方式 +*Autojump – Linux 文件系统导航的最快方式* 这个应用原本由 Joël Schaerer 编写,现在由 +William Ting 维护。 -Autojump 应用从用户那里学习并帮助用户在 Linux 命令行中进行更轻松的目录浏览。与传统的 `cd` 命令相比,autojump 能够更加快速地浏览至目的目录。 +Autojump 应用可以从用户那里学习并帮助用户在 Linux 命令行中进行更轻松的目录导航。与传统的 `cd` 命令相比,autojump 能够更加快速地导航至目的目录。 #### autojump 的特色 #### -- 免费且开源的应用,在 GPL V3 协议下发布。 -- 自主学习的应用,从用户的浏览习惯中学习。 -- 更快速地浏览。不必包含子目录的名称。 -- 对于大多数的标准 Linux 发行版本,能够在软件仓库中下载得到,它们包括 Debian (testing/unstable), Ubuntu, Mint, Arch, Gentoo, Slackware, CentOS, RedHat and Fedora。 +- 自由开源的应用,在 GPL V3 协议下发布。 +- 自主学习的应用,从用户的导航习惯中学习。 +- 更快速地导航。不必包含子目录的名称。 +- 对于大多数的标准 Linux 发行版本,能够在软件仓库中下载得到,它们包括 Debian (testing/unstable), Ubuntu, Mint, Arch, Gentoo, Slackware, CentOS, RedHat 和 Fedora。 - 也能在其他平台中使用,例如 OS X(使用 Homebrew) 和 Windows (通过 Clink 来实现) -- 使用 autojump 你可以跳至任何特定的目录或一个子目录。你还可以打开文件管理器来到达某个目录,并查看你在某个目录中所待时间的统计数据。 +- 使用 autojump 你可以跳至任何特定的目录或一个子目录。你还可以用文件管理器打开某个目录,并查看你在某个目录中所待时间的统计数据。 #### 前提 #### - 版本号不低于 2.6 的 Python -### 第 1 步: 做一次全局系统升级 ### +### 第 1 步: 做一次完整的系统升级 ### -1. 以 **root** 用户的身份,做一次系统更新或升级,以此保证你安装有最新版本的 Python。 +1、 以 **root** 用户的身份,做一次系统更新或升级,以此保证你安装有最新版本的 Python。 - # apt-get update && apt-get upgrade && apt-get dist-upgrade [APT based systems] - # yum update && yum upgrade [YUM based systems] - # dnf update && dnf upgrade [DNF based systems] + # apt-get update && apt-get upgrade && apt-get dist-upgrade [基于 APT 的系统] + # yum update && yum upgrade [基于 YUM 的系统] + # dnf update && dnf upgrade [基于 DNF 的系统] **注** : 这里特别提醒,在基于 YUM 或 DNF 的系统中,更新和升级执行相同的行动,大多数时间里它们是通用的,这点与基于 APT 的系统不同。 ### 第 2 步: 下载和安装 Autojump ### -2. 正如前面所言,在大多数的 Linux 发行版本的软件仓库中, autojump 都可获取到。通过包管理器你就可以安装它。但若你想从源代码开始来安装它,你需要克隆源代码并执行 python 脚本,如下面所示: +2、 正如前面所言,在大多数的 Linux 发行版本的软件仓库中, autojump 都可获取到。通过包管理器你就可以安装它。但若你想从源代码开始来安装它,你需要克隆源代码并执行 python 脚本,如下面所示: #### 从源代码安装 #### 若没有安装 git,请安装它。我们需要使用它来克隆 git 仓库。 - # apt-get install git [APT based systems] - # yum install git [YUM based systems] - # dnf install git [DNF based systems] + # apt-get install git [基于 APT 的系统] + # yum install git [基于 YUM 的系统] + # dnf install git [基于 DNF 的系统] -一旦安装完 git,以常规用户身份登录,然后像下面那样来克隆 autojump: +一旦安装完 git,以普通用户身份登录,然后像下面那样来克隆 autojump: $ git clone git://github.com/joelthelion/autojump.git @@ -55,29 +56,29 @@ Autojump 应用从用户那里学习并帮助用户在 Linux 命令行中进行 $ cd autojump -下载,赋予脚本文件可执行权限,并以 root 用户身份来运行安装脚本。 +下载,赋予安装脚本文件可执行权限,并以 root 用户身份来运行安装脚本。 # chmod 755 install.py # ./install.py #### 从软件仓库中安装 #### -3. 假如你不想麻烦,你可以以 **root** 用户身份从软件仓库中直接安装它: +3、 假如你不想麻烦,你可以以 **root** 用户身份从软件仓库中直接安装它: 在 Debian, Ubuntu, Mint 及类似系统中安装 autojump : - # apt-get install autojump (注: 这里原文为 autojumo, 应该为 autojump) + # apt-get install autojump 为了在 Fedora, CentOS, RedHat 及类似系统中安装 autojump, 你需要启用 [EPEL 软件仓库][2]。 # yum install epel-release # yum install autojump - OR + 或 # dnf install autojump ### 第 3 步: 安装后的配置 ### -4. 在 Debian 及其衍生系统 (Ubuntu, Mint,…) 中, 激活 autojump 应用是非常重要的。 +4、 在 Debian 及其衍生系统 (Ubuntu, Mint,…) 中, 激活 autojump 应用是非常重要的。 为了暂时激活 autojump 应用,即直到你关闭当前会话或打开一个新的会话之前让 autojump 均有效,你需要以常规用户身份运行下面的命令: @@ -89,7 +90,7 @@ Autojump 应用从用户那里学习并帮助用户在 Linux 命令行中进行 ### 第 4 步: Autojump 的预测试和使用 ### -5. 如先前所言, autojump 将只跳到先前 `cd` 命令到过的目录。所以在我们开始测试之前,我们要使用 `cd` 切换到一些目录中去,并创建一些目录。下面是我所执行的命令。 +5、 如先前所言, autojump 将只跳到先前 `cd` 命令到过的目录。所以在我们开始测试之前,我们要使用 `cd` 切换到一些目录中去,并创建一些目录。下面是我所执行的命令。 $ cd $ cd @@ -120,45 +121,45 @@ Autojump 应用从用户那里学习并帮助用户在 Linux 命令行中进行 现在,我们已经切换到过上面所列的目录,并为了测试创建了一些目录,一切准备就绪,让我们开始吧。 -**需要记住的一点** : `j` 是 autojump 的一个包装,你可以使用 j 来代替 autojump, 相反亦可。 +**需要记住的一点** : `j` 是 autojump 的一个封装,你可以使用 j 来代替 autojump, 相反亦可。 -6. 使用 -v 选项查看安装的 autojump 的版本。 +6、 使用 -v 选项查看安装的 autojump 的版本。 $ j -v - or + 或 $ autojump -v ![查看 Autojump 的版本](http://www.tecmint.com/wp-content/uploads/2015/06/Check-Autojump-Version.png) -查看 Autojump 的版本 +*查看 Autojump 的版本* -7. 跳到先前到过的目录 ‘/var/www‘。 +7、 跳到先前到过的目录 ‘/var/www‘。 $ j www ![跳到目录](http://www.tecmint.com/wp-content/uploads/2015/06/Jump-To-Directory.png) -跳到目录 +*跳到目录* -8. 跳到先前到过的子目录‘/home/avi/autojump-test/b‘ 而不键入子目录的全名。 +8、 跳到先前到过的子目录‘/home/avi/autojump-test/b‘ 而不键入子目录的全名。 $ jc b ![跳到子目录](http://www.tecmint.com/wp-content/uploads/2015/06/Jump-to-Child-Directory.png) -跳到子目录 +*跳到子目录* -9. 使用下面的命令,你就可以从命令行打开一个文件管理器,例如 GNOME Nautilus ,而不是跳到一个目录。 +9、 使用下面的命令,你就可以从命令行打开一个文件管理器,例如 GNOME Nautilus ,而不是跳到一个目录。 $ jo www -![跳到目录](http://www.tecmint.com/wp-content/uploads/2015/06/Jump-to-Direcotory.png) +![打开目录](http://www.tecmint.com/wp-content/uploads/2015/06/Jump-to-Direcotory.png) -跳到目录 +*打开目录* ![在文件管理器中打开目录](http://www.tecmint.com/wp-content/uploads/2015/06/Open-Directory-in-File-Browser.png) -在文件管理器中打开目录 +*在文件管理器中打开目录* 你也可以在一个文件管理器中打开一个子目录。 @@ -166,19 +167,19 @@ Autojump 应用从用户那里学习并帮助用户在 Linux 命令行中进行 ![打开子目录](http://www.tecmint.com/wp-content/uploads/2015/06/Open-Child-Directory1.png) -打开子目录 +*打开子目录* ![在文件管理器中打开子目录](http://www.tecmint.com/wp-content/uploads/2015/06/Open-Child-Directory-in-File-Browser1.png) -在文件管理器中打开子目录 +*在文件管理器中打开子目录* -10. 查看每个文件夹的关键权重和在所有目录权重中的总关键权重的相关统计数据。文件夹的关键权重代表在这个文件夹中所花的总时间。 目录权重是列表中目录的数目。(注: 在这一句中,我觉得原文中的 if 应该为 is) +10、 查看每个文件夹的权重和全部文件夹计算得出的总权重的统计数据。文件夹的权重代表在这个文件夹中所花的总时间。 文件夹权重是该列表中目录的数字。(LCTT 译注: 在这一句中,我觉得原文中的 if 应该为 is) $ j --stat -![查看目录统计数据](http://www.tecmint.com/wp-content/uploads/2015/06/Check-Statistics.png) +![查看文件夹统计数据](http://www.tecmint.com/wp-content/uploads/2015/06/Check-Statistics.png) -查看目录统计数据 +*查看文件夹统计数据* **提醒** : autojump 存储其运行日志和错误日志的地方是文件夹 `~/.local/share/autojump/`。千万不要重写这些文件,否则你将失去你所有的统计状态结果。 @@ -186,15 +187,15 @@ Autojump 应用从用户那里学习并帮助用户在 Linux 命令行中进行 ![Autojump 的日志](http://www.tecmint.com/wp-content/uploads/2015/06/Autojump-Logs.png) -Autojump 的日志 +*Autojump 的日志* -11. 假如需要,你只需运行下面的命令就可以查看帮助 : +11、 假如需要,你只需运行下面的命令就可以查看帮助 : $ j --help ![Autojump 的帮助和选项](http://www.tecmint.com/wp-content/uploads/2015/06/Autojump-help-options.png) -Autojump 的帮助和选项 +*Autojump 的帮助和选项* ### 功能需求和已知的冲突 ### @@ -204,18 +205,19 @@ Autojump 的帮助和选项 ### 结论: ### -假如你是一个命令行用户, autojump 是你必备的实用程序。它可以简化许多事情。它是一个在命令行中浏览 Linux 目录的绝佳的程序。请自行尝试它,并在下面的评论框中让我知晓你宝贵的反馈。保持联系,保持分享。喜爱并分享,帮助我们更好地传播。 +假如你是一个命令行用户, autojump 是你必备的实用程序。它可以简化许多事情。它是一个在命令行中导航 Linux 目录的绝佳的程序。请自行尝试它,并在下面的评论框中让我知晓你宝贵的反馈。保持联系,保持分享。喜爱并分享,帮助我们更好地传播。 + -------------------------------------------------------------------------------- via: http://www.tecmint.com/autojump-a-quickest-way-to-navigate-linux-filesystem/ 作者:[Avishek Kumar][a] 译者:[FSSlc](https://github.com/FSSlc) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 [a]:http://www.tecmint.com/author/avishek/ [1]:http://www.tecmint.com/cd-command-in-linux/ -[2]:http://www.tecmint.com/how-to-enable-epel-repository-for-rhel-centos-6-5/ +[2]:https://linux.cn/article-2324-1.html [3]:http://www.tecmint.com/manage-linux-filenames-with-special-characters/ \ No newline at end of file From 99ef2dab243d3e400189462378026b7cad784472 Mon Sep 17 00:00:00 2001 From: Chang Liu Date: Mon, 10 Aug 2015 09:23:08 +0800 Subject: [PATCH 869/965] Update 20150209 Install OpenQRM Cloud Computing Platform In Debian.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 准备翻译该篇。 --- ...0209 Install OpenQRM Cloud Computing Platform In Debian.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150209 Install OpenQRM Cloud Computing Platform In Debian.md b/sources/tech/20150209 Install OpenQRM Cloud Computing Platform In Debian.md index 127f10affc..2c6a990b83 100644 --- a/sources/tech/20150209 Install OpenQRM Cloud Computing Platform In Debian.md +++ b/sources/tech/20150209 Install OpenQRM Cloud Computing Platform In Debian.md @@ -1,3 +1,5 @@ +FSSlc translating + Install OpenQRM Cloud Computing Platform In Debian ================================================================================ ### Introduction ### @@ -146,4 +148,4 @@ via: http://www.unixmen.com/install-openqrm-cloud-computing-platform-debian/ [a]:http://www.unixmen.com/author/sk/ [1]:http://www.openqrm-enterprise.com/products/edition-comparison.html [2]:http://sourceforge.net/projects/openqrm/files/?source=navbar -[3]:http://www.openqrm-enterprise.com/fileadmin/Documents/Whitepaper/openQRM-Enterprise-Administrator-Guide-5.2.pdf \ No newline at end of file +[3]:http://www.openqrm-enterprise.com/fileadmin/Documents/Whitepaper/openQRM-Enterprise-Administrator-Guide-5.2.pdf From abc7c38b3accd6953e9a40d2b43d3b362a22307b Mon Sep 17 00:00:00 2001 From: wxy Date: Mon, 10 Aug 2015 10:56:03 +0800 Subject: [PATCH 870/965] PUB:20150717 How to Configure Chef (server or client) on Ubuntu 14.04 or 15.04 @geekpi --- ...ver or client) on Ubuntu 14.04 or 15.04.md | 120 +++++++----------- 1 file changed, 48 insertions(+), 72 deletions(-) rename {translated/tech => published}/20150717 How to Configure Chef (server or client) on Ubuntu 14.04 or 15.04.md (68%) diff --git a/translated/tech/20150717 How to Configure Chef (server or client) on Ubuntu 14.04 or 15.04.md b/published/20150717 How to Configure Chef (server or client) on Ubuntu 14.04 or 15.04.md similarity index 68% rename from translated/tech/20150717 How to Configure Chef (server or client) on Ubuntu 14.04 or 15.04.md rename to published/20150717 How to Configure Chef (server or client) on Ubuntu 14.04 or 15.04.md index 38574e6fa7..2fdaa71872 100644 --- a/translated/tech/20150717 How to Configure Chef (server or client) on Ubuntu 14.04 or 15.04.md +++ b/published/20150717 How to Configure Chef (server or client) on Ubuntu 14.04 or 15.04.md @@ -1,6 +1,6 @@ -如何在Ubuntu 14.04/15.04上配置Chef(服务端/客户端) +如何在 Ubuntu 上安装配置管理系统 Chef (大厨) ================================================================================ -Chef是对于信息技术专业人员的一款配置管理和自动化工具,它可以配置和管理你的设备无论它在本地还是在云上。它可以用于加速应用部署并协调多个系统管理员和开发人员的工作,涉及到成百甚至上千的服务器和程序来支持大量的客户群。chef最有用的是让设备变成代码。一旦你掌握了Chef,你可以获得一流的网络IT支持来自动化管理你的云端设备或者终端用户。 +Chef是面对IT专业人员的一款配置管理和自动化工具,它可以配置和管理你的基础设施,无论它在本地还是在云上。它可以用于加速应用部署并协调多个系统管理员和开发人员的工作,这涉及到可支持大量的客户群的成百上千的服务器和程序。chef最有用的是让基础设施变成代码。一旦你掌握了Chef,你可以获得一流的网络IT支持来自动化管理你的云端基础设施或者终端用户。 下面是我们将要在本篇中要设置和配置Chef的主要组件。 @@ -10,34 +10,13 @@ Chef是对于信息技术专业人员的一款配置管理和自动化工具, 我们将在下面的基础环境下设置Chef配置管理系统。 -注:表格 - - - - - - - - - - - - - - - - - - - - - - - - - - -
管理和配置工具:Chef
基础操作系统Ubuntu 14.04.1 LTS (x86_64)
Chef ServerVersion 12.1.0
Chef ManageVersion 1.17.0
Chef Development KitVersion 0.6.2
内存和CPU4 GB  , 2.0+2.0 GHZ
+|管理和配置工具:Chef|| +|-------------------------------|---| +|基础操作系统|Ubuntu 14.04.1 LTS (x86_64)| +|Chef Server|Version 12.1.0| +|Chef Manage|Version 1.17.0| +|Chef Development Kit|Version 0.6.2| +|内存和CPU|4 GB  , 2.0+2.0 GHz| ### Chef服务端的安装和配置 ### @@ -45,15 +24,15 @@ Chef服务端是核心组件,它存储配置以及其他和工作站交互的 我使用下面的命令来下载和安装它。 -**1) 下载Chef服务端** +####1) 下载Chef服务端 root@ubuntu-14-chef:/tmp# wget https://web-dl.packagecloud.io/chef/stable/packages/ubuntu/trusty/chef-server-core_12.1.0-1_amd64.deb -**2) 安装Chef服务端** +####2) 安装Chef服务端 root@ubuntu-14-chef:/tmp# dpkg -i chef-server-core_12.1.0-1_amd64.deb -**3) 重新配置Chef服务端** +####3) 重新配置Chef服务端 现在运行下面的命令来启动所有的chef服务端服务,这步也许会花费一些时间,因为它有许多不同一起工作的服务组成来创建一个正常运作的系统。 @@ -64,35 +43,35 @@ chef服务端启动命令'chef-server-ctl reconfigure'需要运行两次,这 Chef Client finished, 342/350 resources updated in 113.71139964 seconds opscode Reconfigured! -**4) 重启系统 ** +####4) 重启系统 安装完成后重启系统使系统能最好的工作,不然我们或许会在创建用户的时候看到下面的SSL连接错误。 ERROR: Errno::ECONNRESET: Connection reset by peer - SSL_connect -**5) 创建心的管理员** +####5) 创建新的管理员 -运行下面的命令来创建一个新的用它自己的配置的管理员账户。创建过程中,用户的RSA私钥会自动生成并需要被保存到一个安全的地方。--file选项会保存RSA私钥到指定的路径下。 +运行下面的命令来创建一个新的管理员账户及其配置。创建过程中,用户的RSA私钥会自动生成,它需要保存到一个安全的地方。--file选项会保存RSA私钥到指定的路径下。 root@ubuntu-14-chef:/tmp# chef-server-ctl user-create kashi kashi kashi kashif.fareedi@gmail.com kashi123 --filename /root/kashi.pem ### Chef服务端的管理设置 ### -Chef Manage是一个针对企业Chef用户的管理控制台,它启用了可视化的web用户界面并可以管理节点、数据包、规则、环境、配置和基于角色的访问控制(RBAC) +Chef Manage是一个针对企业Chef用户的管理控制台,它提供了可视化的web用户界面,可以管理节点、数据包、规则、环境、Cookbook 和基于角色的访问控制(RBAC) -**1) 下载Chef Manage** +####1) 下载Chef Manage -从官网复制链接病下载chef manage的安装包。 +从官网复制链接并下载chef manage的安装包。 root@ubuntu-14-chef:~# wget https://web-dl.packagecloud.io/chef/stable/packages/ubuntu/trusty/opscode-manage_1.17.0-1_amd64.deb -**2) 安装Chef Manage** +####2) 安装Chef Manage 使用下面的命令在root的家目录下安装它。 root@ubuntu-14-chef:~# chef-server-ctl install opscode-manage --path /root -**3) 重启Chef Manage和服务端** +####3) 重启Chef Manage和服务端 安装完成后我们需要运行下面的命令来重启chef manage和服务端。 @@ -101,28 +80,27 @@ Chef Manage是一个针对企业Chef用户的管理控制台,它启用了可 ### Chef Manage网页控制台 ### -我们可以使用localhost访问网页控制台以及fqdn,并用已经创建的管理员登录 +我们可以使用localhost或它的全称域名来访问网页控制台,并用已经创建的管理员登录 ![chef amanage](http://blog.linoxide.com/wp-content/uploads/2015/07/5-chef-web.png) -**1) Chef Manage创建新的组织 ** +####1) Chef Manage创建新的组织 -你或许被要求创建新的组织或者接受其他阻止的邀请。如下所示,使用缩写和全名来创建一个新的组织。 +你或许被要求创建新的组织,或者也可以接受其他组织的邀请。如下所示,使用缩写和全名来创建一个新的组织。 ![Create Org](http://blog.linoxide.com/wp-content/uploads/2015/07/7-create-org.png) -**2) 用命令行创建心的组织 ** +####2) 用命令行创建新的组织 -We can also create new Organization from the command line by executing the following command. 我们同样也可以运行下面的命令来创建新的组织。 root@ubuntu-14-chef:~# chef-server-ctl org-create linux Linoxide Linux Org. --association_user kashi --filename linux.pem ### 设置工作站 ### -我们已经完成安装chef服务端,现在我们可以开始创建任何recipes、cookbooks、属性和其他任何的我们想要对Chef的修改。 +我们已经完成安装chef服务端,现在我们可以开始创建任何recipes([基础配置元素](https://docs.chef.io/recipes.html))、cookbooks([基础配置集](https://docs.chef.io/cookbooks.html))、attributes([节点属性](https://docs.chef.io/attributes.html))和其他任何的我们想要对Chef做的修改。 -**1) 在Chef服务端上创建新的用户和组织 ** +####1) 在Chef服务端上创建新的用户和组织 为了设置工作站,我们用命令行创建一个新的用户和组织。 @@ -130,25 +108,23 @@ We can also create new Organization from the command line by executing the follo root@ubuntu-14-chef:~# chef-server-ctl org-create blogs Linoxide Blogs Inc. --association_user bloger --filename blogs.pem -**2) 下载工作站入门套件 ** +####2) 下载工作站入门套件 -Now Download and Save starter-kit from the chef manage web console on a workstation and use it to work with Chef server. -在工作站的网页控制台中下面并保存入门套件用于与服务端协同工作 +在工作站的网页控制台中下载保存入门套件,它用于与服务端协同工作 ![Starter Kit](http://blog.linoxide.com/wp-content/uploads/2015/07/8-download-kit.png) -**3) 点击"Proceed"下载套件 ** +####3) 下载套件后,点击"Proceed" ![starter kit](http://blog.linoxide.com/wp-content/uploads/2015/07/9-download-kit.png) -### 对于工作站的Chef开发套件设置 ### +### 用于工作站的Chef开发套件设置 ### -Chef开发套件是一款包含所有开发chef所需工具的软件包。它捆绑了由Chef开发的带Chef客户端的工具。 +Chef开发套件是一款包含开发chef所需的所有工具的软件包。它捆绑了由Chef开发的带Chef客户端的工具。 -**1) 下载 Chef DK** +####1) 下载 Chef DK -We can Download chef development kit from its official web link and choose the required operating system to get its chef development tool kit. -我们可以从它的官网链接中下载开发包,并选择操作系统来得到chef开发包。 +我们可以从它的官网链接中下载开发包,并选择操作系统来下载chef开发包。 ![Chef DK](http://blog.linoxide.com/wp-content/uploads/2015/07/10-CDK.png) @@ -156,13 +132,13 @@ We can Download chef development kit from its official web link and choose the r root@ubuntu-15-WKS:~# wget https://opscode-omnibus-packages.s3.amazonaws.com/ubuntu/12.04/x86_64/chefdk_0.6.2-1_amd64.deb -**1) Chef开发套件安装** +####2) Chef开发套件安装 使用dpkg命令安装开发套件 root@ubuntu-15-WKS:~# dpkg -i chefdk_0.6.2-1_amd64.deb -**3) Chef DK 验证** +####3) Chef DK 验证 使用下面的命令验证客户端是否已经正确安装。 @@ -195,7 +171,7 @@ We can Download chef development kit from its official web link and choose the r Verification of component 'chefspec' succeeded. Verification of component 'package installation' succeeded. -**连接Chef服务端** +####4) 连接Chef服务端 我们将创建 ~/.chef并从chef服务端复制两个用户和组织的pem文件到chef的文件到这个目录下。 @@ -209,7 +185,7 @@ We can Download chef development kit from its official web link and choose the r kashi.pem 100% 1678 1.6KB/s 00:00 linux.pem 100% 1678 1.6KB/s 00:00 -** 编辑配置来管理chef环境 ** +####5) 编辑配置来管理chef环境 现在使用下面的内容创建"~/.chef/knife.rb"。 @@ -231,13 +207,13 @@ We can Download chef development kit from its official web link and choose the r root@ubuntu-15-WKS:/# mkdir cookbooks -**测试Knife配置** +####6) 测试Knife配置 运行“knife user list”和“knife client list”来验证knife是否在工作。 root@ubuntu-15-WKS:/.chef# knife user list -第一次运行的时候可能会得到下面的错误,这是因为工作站上还没有chef服务端的SSL证书。 +第一次运行的时候可能会看到下面的错误,这是因为工作站上还没有chef服务端的SSL证书。 ERROR: SSL Validation failure connecting to host: 172.25.10.173 - SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed ERROR: Could not establish a secure connection to the server. @@ -245,24 +221,24 @@ We can Download chef development kit from its official web link and choose the r If your Chef Server uses a self-signed certificate, you can use `knife ssl fetch` to make knife trust the server's certificates. -要从上面的命令中恢复,运行下面的命令来获取ssl整数并重新运行knife user和client list,这时候应该就可以了。 +要从上面的命令中恢复,运行下面的命令来获取ssl证书,并重新运行knife user和client list,这时候应该就可以了。 root@ubuntu-15-WKS:/.chef# knife ssl fetch WARNING: Certificates from 172.25.10.173 will be fetched and placed in your trusted_cert directory (/.chef/trusted_certs). - knife没有办法验证这些是有效的证书。你应该在下载时候验证这些证书的真实性。 +knife没有办法验证这些是有效的证书。你应该在下载时候验证这些证书的真实性。 - 在/.chef/trusted_certs/ubuntu-14-chef_test_com.crt下面添加ubuntu-14-chef.test.com的证书。 +在/.chef/trusted_certs/ubuntu-14-chef_test_com.crt下面添加ubuntu-14-chef.test.com的证书。 在上面的命令取得ssl证书后,接着运行下面的命令。 root@ubuntu-15-WKS:/.chef#knife client list kashi-linux -### 与chef服务端交互的新的节点 ### +### 配置与chef服务端交互的新节点 ### -节点是执行所有设备自动化的chef客户端。因此是时侯添加新的服务端到我们的chef环境下,在配置完chef-server和knife工作站后配置新的节点与chef-server交互。 +节点是执行所有基础设施自动化的chef客户端。因此,在配置完chef-server和knife工作站后,通过配置新的与chef-server交互的节点,来添加新的服务端到我们的chef环境下。 我们使用下面的命令来添加新的节点与chef服务端工作。 @@ -291,16 +267,16 @@ We can Download chef development kit from its official web link and choose the r 172.25.10.170 to file /tmp/install.sh.26024/metadata.txt 172.25.10.170 trying wget... -之后我们可以在knife节点列表下看到新创建的节点,也会新节点列表下创建新的客户端。 +之后我们可以在knife节点列表下看到新创建的节点,它也会在新节点创建新的客户端。 root@ubuntu-15-WKS:~# knife node list mydns -相似地我们只要提供ssh证书通过上面的knife命令来创建多个节点到chef设备上。 +相似地我们只要提供ssh证书通过上面的knife命令,就可以在chef设施上创建多个节点。 ### 总结 ### -本篇我们学习了chef管理工具并通过安装和配置设置浏览了它的组件。我希望你在学习安装和配置Chef服务端以及它的工作站和客户端节点中获得乐趣。 +本篇我们学习了chef管理工具并通过安装和配置设置基本了解了它的组件。我希望你在学习安装和配置Chef服务端以及它的工作站和客户端节点中获得乐趣。 -------------------------------------------------------------------------------- @@ -308,7 +284,7 @@ via: http://linoxide.com/ubuntu-how-to/install-configure-chef-ubuntu-14-04-15-04 作者:[Kashif Siddique][a] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From eb0ff99810690c7d3078c6a85ddc7731ef544e3e Mon Sep 17 00:00:00 2001 From: wxy Date: Mon, 10 Aug 2015 10:57:27 +0800 Subject: [PATCH 871/965] =?UTF-8?q?=E6=B8=85=E9=99=A4=E9=94=99=E6=94=BE?= =?UTF-8?q?=E7=9A=84=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @xiqingongzi --- ...ntial Commands and System Documentation.md | 320 ------------------ 1 file changed, 320 deletions(-) delete mode 100644 translated/tech/RHCSA Series/RHCSA Series--Part 01--Reviewing Essential Commands and System Documentation.md diff --git a/translated/tech/RHCSA Series/RHCSA Series--Part 01--Reviewing Essential Commands and System Documentation.md b/translated/tech/RHCSA Series/RHCSA Series--Part 01--Reviewing Essential Commands and System Documentation.md deleted file mode 100644 index 93c2787c7e..0000000000 --- a/translated/tech/RHCSA Series/RHCSA Series--Part 01--Reviewing Essential Commands and System Documentation.md +++ /dev/null @@ -1,320 +0,0 @@ -[translating by xiqingongzi] - -RHCSA系列: 复习基础命令及系统文档 – 第一部分 -================================================================================ -RHCSA (红帽认证系统工程师) 是由给商业公司提供开源操作系统和软件的RedHat公司举行的认证考试, 除此之外,红帽公司还为这些企业和机构提供支持、训练以及咨询服务 - -![RHCSA Exam Guide](http://www.tecmint.com/wp-content/uploads/2015/02/RHCSA-Series-by-Tecmint.png) - -RHCSA 考试准备指南 - -RHCSA 考试(考试编号 EX200)通过后可以获取由Red Hat 公司颁发的证书. RHCSA 考试是RHCT(红帽认证技师)的升级版,而且RHCSA必须在新的Red Hat Enterprise Linux(红帽企业版)下完成.RHCT和RHCSA的主要变化就是RHCT基于 RHEL5 , 而RHCSA基于RHEL6或者7, 这两个认证的等级也有所不同. - -红帽认证管理员所会的最基础的是在红帽企业版的环境下执行如下系统管理任务: - -- 理解并会使用命令管理文件、目录、命令行以及系统/软件包的文档 -- 使用不同的启动等级启动系统,认证和控制进程,启动或停止虚拟机 -- 使用分区和逻辑卷管理本地存储 -- 创建并且配置本地文件系统和网络文件系统,设置他们的属性(许可、加密、访问控制表) -- 部署、配置、并且控制系统,包括安装、升级和卸载软件 -- 管理系统用户和组,独立使用集中制的LDAP目录权限控制 -- 确保系统安全,包括基础的防火墙规则和SELinux配置 - - -关于你所在国家的考试注册费用参考 [RHCSA Certification page][1]. - -关于你所在国家的考试注册费用参考RHCSA 认证页面 - - -在这个有15章的RHCSA(红帽认证管理员)备考系列,我们将覆盖以下的关于红帽企业Linux第七版的最新的信息 - -- Part 1: 回顾必会的命令和系统文档 -- Part 2: 在RHEL7如何展示文件和管理目录 -- Part 3: 在RHEL7中如何管理用户和组 -- Part 4: 使用nano和vim管理命令/ 使用grep和正则表达式分析文本 -- Part 5: RHEL7的进程管理:启动,关机,以及其他介于二者之间的. -- Part 6: 使用 'Parted'和'SSM'来管理和加密系统存储 -- Part 7: 使用ACLs(访问控制表)并挂载 Samba /NFS 文件分享 -- Part 8: 加固SSH,设置主机名并开启网络服务 -- Part 9: 安装、配置和加固一个Web,FTP服务器 -- Part 10: Yum 包管理方式,使用Cron进行自动任务管理以及监控系统日志 -- Part 11: 使用FirewallD和Iptables设置防火墙,控制网络流量 -- Part 12: 使用Kickstart 自动安装RHEL 7 -- Part 13: RHEL7:什么是SeLinux?他的原理是什么? -- Part 14: 在RHEL7 中使用基于LDAP的权限控制 -- Part 15: RHEL7的虚拟化:KVM 和虚拟机管理 - -在第一章,我们讲解如何输入和运行正确的命令在终端或者Shell窗口,并且讲解如何找到、插入,以及使用系统文档 - -![RHCSA: Reviewing Essential Linux Commands – Part 1](http://www.tecmint.com/wp-content/uploads/2015/02/Reviewing-Essential-Linux-Commands.png) - -RHCSA:回顾必会的Linux命令 - 第一部分 - -#### 前提: #### - -至少你要熟悉如下命令 - -- [cd command][2] (改变目录) -- [ls command][3] (列举文件) -- [cp command][4] (复制文件) -- [mv command][5] (移动或重命名文件) -- [touch command][6] (创建一个新的文件或更新已存在文件的时间表) -- rm command (删除文件) -- mkdir command (创建目录) - -在这篇文章中你将会找到更多的关于如何更好的使用他们的正确用法和特殊用法. - -虽然没有严格的要求,但是作为讨论常用的Linux命令和方法,你应该安装RHEL7 来尝试使用文章中提到的命令.这将会使你学习起来更省力. - -- [红帽企业版Linux(RHEL)7 安装指南][7] - -### 使用Shell进行交互 ### -如果我们使用文本模式登陆Linux,我们就无法使用鼠标在默认的shell。另一方面,如果我们使用图形化界面登陆,我们将会通过启动一个终端来开启shell,无论那种方式,我们都会看到用户提示,并且我们可以开始输入并且执行命令(当按下Enter时,命令就会被执行) - - -当我们使用文本模式登陆Linux时, -命令是由两个部分组成的: - -- 命令本身 -- 参数 - -某些参数,称为选项(通常使用一个连字符区分),改变了由其他参数定义的命令操作. - -命令的类型可以帮助我们识别某一个特定的命令是由shell内建的还是由一个单独的包提供。这样的区别在于我们能够找到更多关于该信息的命令,对shell内置的命令,我们需要看shell的ManPage,如果是其他提供的,我们需要看它自己的ManPage. - -![Check Shell built in Commands](http://www.tecmint.com/wp-content/uploads/2015/02/Check-shell-built-in-Commands.png) - -检查Shell的内建命令 - -在上面的例子中, cd 和 type 是shell内建的命令,top和 less 是由其他的二进制文件提供的(在这种情况下,type将返回命令的位置) -其他的内建命令 - -- [echo command][8]: 展示字符串 -- [pwd command][9]: 输出当前的工作目录 - -![More Built in Shell Commands](http://www.tecmint.com/wp-content/uploads/2015/02/More-Built-in-Shell-Commands.png) - -更多内建函数 - -**exec 命令** - -运行我们指定的外部程序。请注意,最好是只输入我们想要运行的程序的名字,不过exec命令有一个特殊的特性:使用旧的shell运行,而不是创建新的进程,可以作为子请求的验证. - - # ps -ef | grep [shell 进程的PID] - -当新的进程注销,Shell也随之注销,运行 exec top 然后按下 q键来退出top,你会注意到shell 会话会结束,如下面的屏幕录像展示的那样: - -注:youtube视频 - - -**export 命令** - -输出之后执行的命令的环境的变量 - -**history 命令** - -展示数行之前的历史命令.在感叹号前输入命令编号可以再次执行这个命令.如果我们需要编辑历史列表中的命令,我们可以按下 Ctrl + r 并输入与命令相关的第一个字符. -当我们看到的命令自动补全,我们可以根据我们目前的需要来编辑它: - -注:youtube视频 - - -命令列表会保存在一个叫 .bash_history的文件里.history命令是一个非常有用的用于减少输入次数的工具,特别是进行命令行编辑的时候.默认情况下,bash保留最后输入的500个命令,不过可以通过修改 HISTSIZE 环境变量来增加: - - -![Linux history Command](http://www.tecmint.com/wp-content/uploads/2015/02/Linux-history-Command.png) - -Linux history 命令 - -但上述变化,在我们的下一次启动不会保留。为了保持HISTSIZE变量的变化,我们需要通过手工修改文件编辑: - - # 设置history请看 HISTSIZE 和 HISTFILESIZE 在 bash(1)的文档 - HISTSIZE=1000 - -**重要**: 我们的更改不会生效,除非我们重启了系统 - -**alias 命令** -没有参数或使用-p参数将会以 名称=值的标准形式输出alias 列表.当提供了参数时,一个alias 将被定义给给定的命令和值 - -使用alias ,我们可以创建我们自己的命令,或修改现有的命令,包括需要的参数.举个例子,假设我们想别名 ls 到 ls –color=auto ,这样就可以使用不同颜色输出文件、目录、链接 - - - # alias ls='ls --color=auto' - -![Linux alias Command](http://www.tecmint.com/wp-content/uploads/2015/02/Linux-alias-Command.png) - -Linux 别名命令 - -**Note**: 你可以给你的新命令起任何的名字,并且附上足够多的使用单引号分割的参数,但是这样的情况下你要用分号区分开他们. - - # alias myNewCommand='cd /usr/bin; ls; cd; clear' - -**exit 命令** - -Exit和logout命令都是退出shell.exit命令退出所有的shell,logout命令只注销登陆的shell,其他的自动以文本模式启动的shell不算. - -如果我们对某个程序由疑问,我们可以看他的man Page,可以使用man命令调出它,额外的,还有一些重要的文件的手册页(inittab,fstab,hosts等等),库函数,shells,设备及其他功能 - -#### 举例: #### - -- man uname (输出系统信息,如内核名称、处理器、操作系统类型、架构等). -- man inittab (初始化守护设置). - -另外一个重要的信息的来源就是info命令提供的,info命令常常被用来读取信息文件.这些文件往往比manpage 提供更多信息.通过info 关键词调用某个命令的信息 - - # info ls - # info cut - - -另外,在/usr/share/doc 文件夹包含了大量的子目录,里面可以找到大量的文档.他们包含文本文件或其他友好的格式. -确保你使用这三种方法去查找命令的信息。重点关注每个命令文档中介绍的详细的语法 - -**使用expand命令把tabs转换为空格** - -有时候文本文档包含了tabs但是程序无法很好的处理的tabs.或者我们只是简单的希望将tabs转换成空格.这就是为什么expand (GNU核心组件提供)工具出现, - -举个例子,给我们一个文件 NumberList.txt,让我们使用expand处理它,将tabs转换为一个空格.并且以标准形式输出. - - # expand --tabs=1 NumbersList.txt - -![Linux expand Command](http://www.tecmint.com/wp-content/uploads/2015/02/Linux-expand-Command.png) - -Linux expand 命令 - -unexpand命令可以实现相反的功能(将空格转为tab) - -**使用head输出文件首行及使用tail输出文件尾行** - -通常情况下,head命令后跟着文件名时,将会输出该文件的前十行,我们可以通过 -n 参数来自定义具体的行数。 - - # head -n3 /etc/passwd - # tail -n3 /etc/passwd - -![Linux head and tail Command](http://www.tecmint.com/wp-content/uploads/2015/02/Linux-head-and-tail-Command.png) - -Linux 的 head 和 tail 命令 - -tail 最有意思的一个特性就是能够展现信息(最后一行)就像我们输入文件(tail -f my.log,一行一行的,就像我们在观察它一样。)这在我们监控一个持续增加的日志文件时非常有用 - -更多: [Manage Files Effectively using head and tail Commands][10] - -**使用paste合并文本文件** -paste命令一行一行的合并文件,默认会以tab来区分每一行,或者其他你自定义的分行方式.(下面的例子就是输出使用等号划分行的文件). - # paste -d= file1 file2 - -![Merge Files in Linux](http://www.tecmint.com/wp-content/uploads/2015/02/Merge-Files-in-Linux-with-paste-command.png) - -Merge Files in Linux - -**使用split命令将文件分块** - -split 命令常常用于把一个文件切割成两个或多个文由我们自定义的前缀命名的件文件.这些文件可以通过大小、区块、行数,生成的文件会有一个数字或字母的后缀.在下面的例子中,我们将切割bash.pdf ,每个文件50KB (-b 50KB) ,使用命名后缀 (-d): - - # split -b 50KB -d bash.pdf bash_ - -![Split Files in Linux](http://www.tecmint.com/wp-content/uploads/2015/02/Split-Files-in-Linux-with-split-command.png) - -在Linux下划分文件 - -你可以使用如下命令来合并这些文件,生成源文件: - - # cat bash_00 bash_01 bash_02 bash_03 bash_04 bash_05 > bash.pdf - -**使用tr命令改变字符** - -tr 命令多用于变化(改变)一个一个的字符活使用字符范围.和之前一样,下面的实例我们江使用同样的文件file2,我们将实习: - -- 小写字母 o 变成大写 -- 所有的小写字母都变成大写字母 - - # cat file2 | tr o O - # cat file2 | tr [a-z] [A-Z] - -![Translate Characters in Linux](http://www.tecmint.com/wp-content/uploads/2015/02/Translate-characters-in-Linux-with-tr-command.png) - -在Linux中替换文字 - -**使用uniq和sort检查或删除重复的文字** - -uniq命令可以帮我们查出或删除文件中的重复的行,默认会写出到stdout.我们应当注意, uniq 只能查出相邻的两个相同的单纯,所以, uniq 往往和sort 一起使用(sort一般用于对文本文件的内容进行排序) - - -默认的,sort 以第一个参数(使用空格区分)为关键字.想要定义特殊的关键字,我们需要使用 -k参数,请注意如何使用sort 和uniq输出我们想要的字段,具体可以看下面的例子 - - # cat file3 - # sort file3 | uniq - # sort -k2 file3 | uniq - # sort -k3 file3 | uniq - -![删除文件中重复的行](http://www.tecmint.com/wp-content/uploads/2015/02/Remove-Duplicate-Lines-in-file.png) - -删除文件中重复的行 - -**从文件中提取文本的命令** - -Cut命令基于字节(-b),字符(-c),或者区块(-f)从stdin活文件中提取到的部分将会以标准的形式展现在屏幕上 - -当我们使用区块切割时,默认的分隔符是一个tab,不过你可以通过 -d 参数来自定义分隔符. - - # cut -d: -f1,3 /etc/passwd # 这个例子提取了第一块和第三块的文本 - # cut -d: -f2-4 /etc/passwd # 这个例子提取了第一块到第三块的文本 - -![从文件中提取文本](http://www.tecmint.com/wp-content/uploads/2015/02/Extract-Text-from-a-file.png) - -从文件中提取文本 - - -注意,上方的两个输出的结果是十分简洁的。 - -**使用fmt命令重新格式化文件** - -fmt 被用于去“清理”有大量内容或行的文件,或者有很多缩进的文件.新的锻炼格式每行不会超过75个字符款,你能改变这个设定通过 -w(width 宽度)参数,它可以设置行宽为一个特定的数值 - -举个例子,让我们看看当我们用fmt显示定宽为100个字符的时候的文件/etc/passwd 时会发生什么.再来一次,输出值变得更加简洁. - - # fmt -w100 /etc/passwd - -![File Reformatting in Linux](http://www.tecmint.com/wp-content/uploads/2015/02/File-Reformatting-in-Linux-with-fmt-command.png) - -Linux文件重新格式化 - -**使用pr命令格式化打印内容** - -pr 分页并且在列中展示一个或多个用于打印的文件. 换句话说,使用pr格式化一个文件使他打印出来时看起来更好.举个例子,下面这个命令 - - # ls -a /etc | pr -n --columns=3 -h "Files in /etc" - -以一个友好的排版方式(3列)输出/etc下的文件,自定义了页眉(通过 -h 选项实现),行号(-n) - -![File Formatting in Linux](http://www.tecmint.com/wp-content/uploads/2015/02/File-Formatting-in-Linux-with-pr-command.png) - -Linux的文件格式 - -### 总结 ### - -在这篇文章中,我们已经讨论了如何在Shell或终端以正确的语法输入和执行命令,并解释如何找到,检查和使用系统文档。正如你看到的一样简单,这就是你成为RHCSA的第一大步 - -如果你想添加一些其他的你经常使用的能够有效帮你完成你的日常工作的基础命令,并为分享他们而感到自豪,请在下方留言.也欢迎提出问题.我们期待您的回复. - - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/rhcsa-exam-reviewing-essential-commands-system-documentation/ - -作者:[Gabriel Cánepa][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.tecmint.com/author/gacanepa/ -[1]:https://www.redhat.com/en/services/certification/rhcsa -[2]:http://www.tecmint.com/cd-command-in-linux/ -[3]:http://www.tecmint.com/ls-command-interview-questions/ -[4]:http://www.tecmint.com/advanced-copy-command-shows-progress-bar-while-copying-files/ -[5]:http://www.tecmint.com/rename-multiple-files-in-linux/ -[6]:http://www.tecmint.com/8-pratical-examples-of-linux-touch-command/ -[7]:http://www.tecmint.com/redhat-enterprise-linux-7-installation/ -[8]:http://www.tecmint.com/echo-command-in-linux/ -[9]:http://www.tecmint.com/pwd-command-examples/ -[10]:http://www.tecmint.com/view-contents-of-file-in-linux/ From 0e4b77320242cc007f4cc6ee17a72b6f6dc824de Mon Sep 17 00:00:00 2001 From: DeadFire Date: Mon, 10 Aug 2015 12:38:55 +0800 Subject: [PATCH 872/965] =?UTF-8?q?20150810-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...20150810 For Linux, Supercomputers R Us.md | 59 +++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 sources/talk/20150810 For Linux, Supercomputers R Us.md diff --git a/sources/talk/20150810 For Linux, Supercomputers R Us.md b/sources/talk/20150810 For Linux, Supercomputers R Us.md new file mode 100644 index 0000000000..7bc48125f0 --- /dev/null +++ b/sources/talk/20150810 For Linux, Supercomputers R Us.md @@ -0,0 +1,59 @@ +For Linux, Supercomputers R Us +================================================================================ +![Credit: Michel Ngilen, CC BY 2.0, via Wikimedia Commons](http://images.techhive.com/images/article/2015/08/playstation_3-100602985-primary.idge.jpg) +Credit: Michel Ngilen, CC BY 2.0, via Wikimedia Commons + +> Almost all supercomputers run Linux, including the ones built from Raspberry Pi boards and PlayStation 3 game consoles + +Supercomputers are serious things, called on to do serious computing. They tend to be engaged in serious pursuits like atomic bomb simulations, climate modeling and high-level physics. Naturally, they cost serious money. At the very top of the latest [Top500][1] supercomputer ranking is the Tianhe-2 supercomputer at China’s National University of Defense Technology. It cost about $390 million to build. + +But then there’s the supercomputer that Joshua Kiepert, a doctoral student at Boise State’s Electrical and Computer Engineering department, [created with Raspberry Pi computers][2].It cost less than $2,000. + +No, I’m not making that up. It’s an honest-to-goodness supercomputer made from overclocked 1-GHz [Model B Raspberry Pi][3] ARM11 processors with Videocore IV GPUs. Each one comes with 512MB of RAM, a pair of USB ports and a 10/100 BaseT Ethernet port. + +And what do the Tianhe-2 and the Boise State supercomputer have in common? They both run Linux. As do [486 out of the world’s fastest 500 supercomputers][4]. It’s part of a domination of the category that began over 20 years ago. And now it’s trickling down to built-on-the-cheap supercomputers. Because Kiepert’s machine isn’t the only budget number cruncher out there. + +Gaurav Khanna, an associate professor of physics at the University of Massachusetts Dartmouth, created a [supercomputer with something shy of 200 PlayStation 3 video game consoles][5]. + +The PlayStations are powered by a 3.2-GHz PowerPC-based Power Processing Element. Each comes with 512MB of RAM. You can still buy one, although Sony will be phasing them out by year’s end, for just over $200. Khanna started with only 16 PlayStation 3s for his first supercomputer, so you too could put a supercomputer on your credit card for less than four grand. + +These machines may be built from toys, but they’re not playthings. Khanna has done serious astrophysics on his rig. A white-hat hacking group used a similar [PlayStation 3 supercomputer in 2008 to crack the SSL MD5 hashing algorithm][6] in 2008. + +Two years later, the Air Force Research Laboratory [Condor Cluster was using 1,760 Sony PlayStation 3 processors][7] and 168 general-purpose graphical processing units. This bargain-basement supercomputer runs at about 500TFLOPs, or 500 trillion floating point operations per second. + +Other cheap options for home supercomputers include specialist parallel-processing boards such as the [$99 credit-card-sized Parallella board][8], and high-end graphics boards such as [Nvidia’s Titan Z][9] and [AMD’s FirePro W9100][10]. Those high-end boards, coveted by gamers with visions of a dream machine or even a chance at winning the first-place prize of over $100,000 in the [Intel Extreme Masters World Championship League of][11] [Legends][12], cost considerably more, retailing for about $3,000. On the other hand, a single one can deliver over 2.5TFLOPS all by itself, and for scientists and researchers, they offer an affordable way to get a supercomputer they can call their own. + +As for the Linux connection, that all started in 1994 at the Goddard Space Flight Center with the first [Beowulf supercomputer][13]. + +By our standards, there wasn’t much that was super about the first Beowulf. But in its day, the first homemade supercomputer, with its 16 Intel 486DX processors and 10Mbps Ethernet for the bus, was great. [Beowulf, designed by NASA contractors Don Becker and Thomas Sterling][14], was the first “maker” supercomputer. Its “compute components,” 486DX PCs, cost only a few thousand dollars. While its speed was only in single-digit gigaflops, [Beowulf][15] showed you could build supercomputers from commercial off-the-shelf (COTS) hardware and Linux. + +I wish I’d had a part in its creation, but I’d already left Goddard by 1994 for a career as a full-time technology journalist. Darn it! + +But even from this side of my reporter’s notebook, I can still appreciate how COTS and open-source software changed supercomputing forever. I hope you can too. Because, whether it’s a cluster of Raspberry Pis or a monster with over 3 million Intel Ivy Bridge and Xeon Phi chips, almost all of today’s supercomputers trace their ancestry to Beowulf. + +-------------------------------------------------------------------------------- + +via: + +作者:[Steven J. Vaughan-Nichols][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.computerworld.com/author/Steven-J.-Vaughan_Nichols/ +[1]:http://www.top500.org/ +[2]:http://www.zdnet.com/article/build-your-own-supercomputer-out-of-raspberry-pi-boards/ +[3]:https://www.raspberrypi.org/products/model-b/ +[4]:http://www.zdnet.com/article/linux-still-rules-supercomputing/ +[5]:http://www.nytimes.com/2014/12/23/science/an-economical-way-to-save-progress.html?smid=fb-nytimes&smtyp=cur&bicmp=AD&bicmlukp=WT.mc_id&bicmst=1409232722000&bicmet=1419773522000&_r=4 +[6]:http://www.computerworld.com/article/2529932/cybercrime-hacking/researchers-hack-verisign-s-ssl-scheme-for-securing-web-sites.html +[7]:http://phys.org/news/2010-12-air-playstation-3s-supercomputer.html +[8]:http://www.zdnet.com/article/parallella-the-99-linux-supercomputer/ +[9]:http://blogs.nvidia.com/blog/2014/03/25/titan-z/ +[10]:http://www.amd.com/en-us/press-releases/Pages/amd-flagship-professional-2014apr7.aspx +[11]:http://en.intelextrememasters.com/news/check-out-the-intel-extreme-masters-katowice-prize-money-distribution/ +[12]:http://www.google.com/url?q=http%3A%2F%2Fen.intelextrememasters.com%2Fnews%2Fcheck-out-the-intel-extreme-masters-katowice-prize-money-distribution%2F&sa=D&sntz=1&usg=AFQjCNE6yoAGGz-Hpi2tPF4gdhuPBEckhQ +[13]:http://www.beowulf.org/overview/history.html +[14]:http://yclept.ucdavis.edu/Beowulf/aboutbeowulf.html +[15]:http://www.beowulf.org/ \ No newline at end of file From e58cee17af9223454ed0cead2fa9c52f8027eaaf Mon Sep 17 00:00:00 2001 From: wxy Date: Mon, 10 Aug 2015 14:31:12 +0800 Subject: [PATCH 873/965] PUB:20150717 How to collect NGINX metrics - Part 2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @strugglingyouth 第二篇也发了~~等第三篇哦 --- ...7 How to collect NGINX metrics - Part 2.md | 178 +++++++++++++ ...7 How to collect NGINX metrics - Part 2.md | 237 ------------------ 2 files changed, 178 insertions(+), 237 deletions(-) create mode 100644 published/20150717 How to collect NGINX metrics - Part 2.md delete mode 100644 translated/tech/20150717 How to collect NGINX metrics - Part 2.md diff --git a/published/20150717 How to collect NGINX metrics - Part 2.md b/published/20150717 How to collect NGINX metrics - Part 2.md new file mode 100644 index 0000000000..f1acf82a35 --- /dev/null +++ b/published/20150717 How to collect NGINX metrics - Part 2.md @@ -0,0 +1,178 @@ + +如何收集 NGINX 指标(第二篇) +================================================================================ +![](http://www.datadoghq.com/wp-content/uploads/2015/07/NGINX_hero_2.png) + +### 如何获取你所需要的 NGINX 指标 ### + +如何获取需要的指标取决于你正在使用的 NGINX 版本以及你希望看到哪些指标。(参见 [如何监控 NGINX(第一篇)][1] 来深入了解NGINX指标。)自由开源的 NGINX 和商业版的 NGINX Plus 都有可以报告指标度量的状态模块,NGINX 也可以在其日志中配置输出特定指标: + +**指标可用性** + +| 指标 | [NGINX (开源)](https://www.datadoghq.com/blog/how-to-collect-nginx-metrics/#open-source) | [NGINX Plus](https://www.datadoghq.com/blog/how-to-collect-nginx-metrics/#plus) | [NGINX 日志](https://www.datadoghq.com/blog/how-to-collect-nginx-metrics/#logs)| +|-----|------|-------|-----| +|accepts(接受) / accepted(已接受)|x|x| | +|handled(已处理)|x|x| | +|dropped(已丢弃)|x|x| | +|active(活跃)|x|x| | +|requests (请求数)/ total(全部请求数)|x|x| | +|4xx 代码||x|x| +|5xx 代码||x|x| +|request time(请求处理时间)|||x| + +#### 指标收集:NGINX(开源版) #### + +开源版的 NGINX 会在一个简单的状态页面上显示几个与服务器状态有关的基本指标,它们由你启用的 HTTP [stub status module][2] 所提供。要检查该模块是否已启用,运行以下命令: + + nginx -V 2>&1 | grep -o with-http_stub_status_module + +如果你看到终端输出了 **http_stub_status_module**,说明该状态模块已启用。 + +如果该命令没有输出,你需要启用该状态模块。你可以在[从源代码构建 NGINX ][3]时使用 `--with-http_stub_status_module` 配置参数: + + ./configure \ + … \ + --with-http_stub_status_module + make + sudo make install + +在验证该模块已经启用或你自己启用它后,你还需要修改 NGINX 配置文件,来给状态页面设置一个本地可访问的 URL(例如: /nginx_status): + + server { + location /nginx_status { + stub_status on; + + access_log off; + allow 127.0.0.1; + deny all; + } + } + +注:nginx 配置中的 server 块通常并不放在主配置文件中(例如:/etc/nginx/nginx.conf),而是放在主配置会加载的辅助配置文件中。要找到主配置文件,首先运行以下命令: + + nginx -t + +打开列出的主配置文件,在以 http 块结尾的附近查找以 include 开头的行,如: + + include /etc/nginx/conf.d/*.conf; + +在其中一个包含的配置文件中,你应该会找到主 **server** 块,你可以如上所示配置 NGINX 的指标输出。更改任何配置后,通过执行以下命令重新加载配置文件: + + nginx -s reload + +现在,你可以浏览状态页看到你的指标: + + Active connections: 24 + server accepts handled requests + 1156958 1156958 4491319 + Reading: 0 Writing: 18 Waiting : 6 + +请注意,如果你希望从远程计算机访问该状态页面,则需要将远程计算机的 IP 地址添加到你的状态配置文件的白名单中,在上面的配置文件中的白名单仅有 127.0.0.1。 + +NGINX 的状态页面是一种快速查看指标状况的简单方法,但当连续监测时,你需要按照标准间隔自动记录该数据。监控工具箱 [Nagios][4] 或者 [Datadog][5],以及收集统计信息的服务 [collectD][6] 已经可以解析 NGINX 的状态信息了。 + +#### 指标收集: NGINX Plus #### + +商业版的 NGINX Plus 通过它的 ngx_http_status_module 提供了比开源版 NGINX [更多的指标][7]。NGINX Plus 以字节流的方式提供这些额外的指标,提供了关于上游系统和高速缓存的信息。NGINX Plus 也会报告所有的 HTTP 状态码类型(1XX,2XX,3XX,4XX,5XX)的计数。一个 NGINX Plus 状态报告例子[可在此查看][8]: + +![NGINX Plus status board](https://d33tyra1llx9zy.cloudfront.net/blog/images/2015-06-nginx/status_plus-2.png) + +注:NGINX Plus 在状态仪表盘中的“Active”连接的定义和开源 NGINX 通过 stub_status_module 收集的“Active”连接指标略有不同。在 NGINX Plus 指标中,“Active”连接不包括Waiting状态的连接(即“Idle”连接)。 + +NGINX Plus 也可以输出 [JSON 格式的指标][9],可以用于集成到其他监控系统。在 NGINX Plus 中,你可以看到 [给定的上游服务器组][10]的指标和健康状况,或者简单地从上游服务器的[单个服务器][11]得到响应代码的计数: + + {"1xx":0,"2xx":3483032,"3xx":0,"4xx":23,"5xx":0,"total":3483055} + +要启动 NGINX Plus 指标仪表盘,你可以在 NGINX 配置文件的 http 块内添加状态 server 块。 (参见上一节,为收集开源版 NGINX 指标而如何查找相关的配置文件的说明。)例如,要设置一个状态仪表盘 (http://your.ip.address:8080/status.html)和一个 JSON 接口(http://your.ip.address:8080/status),可以添加以下 server 块来设定: + + server { + listen 8080; + root /usr/share/nginx/html; + + location /status { + status; + } + + location = /status.html { + } + } + +当你重新加载 NGINX 配置后,状态页就可以用了: + + nginx -s reload + +关于如何配置扩展状态模块,官方 NGINX Plus 文档有 [详细介绍][13] 。 + +#### 指标收集:NGINX 日志 #### + +NGINX 的 [日志模块][14] 会把可自定义的访问日志写到你配置的指定位置。你可以通过[添加或移除变量][15]来自定义日志的格式和包含的数据。要存储详细的日志,最简单的方法是添加下面一行在你配置文件的 server 块中(参见上上节,为收集开源版 NGINX 指标而如何查找相关的配置文件的说明。): + + access_log logs/host.access.log combined; + +更改 NGINX 配置文件后,执行如下命令重新加载配置文件: + + nginx -s reload + +默认包含的 “combined” 的日志格式,会包括[一系列关键的数据][17],如实际的 HTTP 请求和相应的响应代码。在下面的示例日志中,NGINX 记录了请求 /index.html 时的 200(成功)状态码和访问不存在的请求文件 /fail 的 404(未找到)错误。 + + 127.0.0.1 - - [19/Feb/2015:12:10:46 -0500] "GET /index.html HTTP/1.1" 200 612 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.111 Safari 537.36" + + 127.0.0.1 - - [19/Feb/2015:12:11:05 -0500] "GET /fail HTTP/1.1" 404 570 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.111 Safari/537.36" + +你可以通过在 NGINX 配置文件中的 http 块添加一个新的日志格式来记录请求处理时间: + + log_format nginx '$remote_addr - $remote_user [$time_local] ' + '"$request" $status $body_bytes_sent $request_time ' + '"$http_referer" "$http_user_agent"'; + +并修改配置文件中 **server** 块的 access_log 行: + + access_log logs/host.access.log nginx; + +重新加载配置文件后(运行 `nginx -s reload`),你的访问日志将包括响应时间,如下所示。单位为秒,精度到毫秒。在这个例子中,服务器接收到一个对 /big.pdf 的请求时,发送 33973115 字节后返回 206(成功)状态码。处理请求用时 0.202 秒(202毫秒): + + 127.0.0.1 - - [19/Feb/2015:15:50:36 -0500] "GET /big.pdf HTTP/1.1" 206 33973115 0.202 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.111 Safari/537.36" + +你可以使用各种工具和服务来解析和分析 NGINX 日志。例如,[rsyslog][18] 可以监视你的日志,并将其传递给多个日志分析服务;你也可以使用自由开源工具,比如 [logstash][19] 来收集和分析日志;或者你可以使用一个统一日志记录层,如 [Fluentd][20] 来收集和解析你的 NGINX 日志。 + +### 结论 ### + +监视 NGINX 的哪一项指标将取决于你可用的工具,以及监控指标所提供的信息是否满足你们的需要。举例来说,错误率的收集是否足够重要到需要你们购买 NGINX Plus ,还是架设一个可以捕获和分析日志的系统就够了? + +在 Datadog 中,我们已经集成了 NGINX 和 NGINX Plus,这样你就可以以最小的设置来收集和监控所有 Web 服务器的指标。[在本文中][21]了解如何用 NGINX Datadog 来监控 ,并开始 [Datadog 的免费试用][22]吧。 + + +-------------------------------------------------------------------------------- + +via: https://www.datadoghq.com/blog/how-to-collect-nginx-metrics/ + +作者:K Young +译者:[strugglingyouth](https://github.com/strugglingyouth) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[1]:https://www.datadoghq.com/blog/how-to-monitor-nginx/ +[2]:http://nginx.org/en/docs/http/ngx_http_stub_status_module.html +[3]:http://wiki.nginx.org/InstallOptions +[4]:https://exchange.nagios.org/directory/Plugins/Web-Servers/nginx +[5]:http://docs.datadoghq.com/integrations/nginx/ +[6]:https://collectd.org/wiki/index.php/Plugin:nginx +[7]:http://nginx.org/en/docs/http/ngx_http_status_module.html#data +[8]:http://demo.nginx.com/status.html +[9]:http://demo.nginx.com/status +[10]:http://demo.nginx.com/status/upstreams/demoupstreams +[11]:http://demo.nginx.com/status/upstreams/demoupstreams/0/responses +[12]:https://www.datadoghq.com/blog/how-to-collect-nginx-metrics/#open-source +[13]:http://nginx.org/en/docs/http/ngx_http_status_module.html#example +[14]:http://nginx.org/en/docs/http/ngx_http_log_module.html +[15]:http://nginx.org/en/docs/http/ngx_http_log_module.html#log_format +[16]:https://www.datadoghq.com/blog/how-to-collect-nginx-metrics/#open-source +[17]:http://nginx.org/en/docs/http/ngx_http_log_module.html#log_format +[18]:http://www.rsyslog.com/ +[19]:https://www.elastic.co/products/logstash +[20]:http://www.fluentd.org/ +[21]:https://www.datadoghq.com/blog/how-to-monitor-nginx-with-datadog/ +[22]:https://www.datadoghq.com/blog/how-to-collect-nginx-metrics/#sign-up +[23]:https://github.com/DataDog/the-monitor/blob/master/nginx/how_to_collect_nginx_metrics.md +[24]:https://github.com/DataDog/the-monitor/issues diff --git a/translated/tech/20150717 How to collect NGINX metrics - Part 2.md b/translated/tech/20150717 How to collect NGINX metrics - Part 2.md deleted file mode 100644 index 848042bf2c..0000000000 --- a/translated/tech/20150717 How to collect NGINX metrics - Part 2.md +++ /dev/null @@ -1,237 +0,0 @@ - -如何收集NGINX指标 - 第2部分 -================================================================================ -![](http://www.datadoghq.com/wp-content/uploads/2015/07/NGINX_hero_2.png) - -### 如何获取你所需要的NGINX指标 ### - -如何获取需要的指标取决于你正在使用的 NGINX 版本。(参见 [the companion article][1] 将深入探索NGINX指标。)免费,开源版的 NGINX 和商业版的 NGINX 都有指标度量的状态模块,NGINX 也可以在其日志中配置指标模块: - -注:表格 - ----- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MetricAvailability
NGINX (open-source)NGINX PlusNGINX logs
accepts / acceptedxx
handledxx
droppedxx
activexx
requests / totalxx
4xx codesxx
5xx codesxx
request timex
- -#### 指标收集:NGINX(开源版) #### - -开源版的 NGINX 会显示几个与服务器状态有关的指标在状态页面上,只要你启用了 HTTP [stub status module][2] 。要检查模块是否被加载,运行以下命令: - - nginx -V 2>&1 | grep -o with-http_stub_status_module - -如果你看到 http_stub_status_module 被输出在终端,说明状态模块已启用。 - -如果该命令没有输出,你需要启用状态模块。你可以使用 --with-http_stub_status_module 参数去配置 [building NGINX from source][3]: - - ./configure \ - … \ - --with-http_stub_status_module - make - sudo make install - -验证模块已经启用或你自己启用它后,你还需要修改 NGINX 配置文件为状态页面设置本地访问的 URL(例如,/ nginx_status): - - server { - location /nginx_status { - stub_status on; - - access_log off; - allow 127.0.0.1; - deny all; - } - } - -注:nginx 配置中的 server 块通常并不在主配置文件中(例如,/etc/nginx/nginx.conf),但主配置中会加载补充的配置文件。要找到主配置文件,首先运行以下命令: - - nginx -t - -打开主配置文件,在以 http 模块结尾的附近查找以 include 开头的行包,如: - - include /etc/nginx/conf.d/*.conf; - -在所包含的配置文件中,你应该会找到主服务器模块,你可以如上所示修改 NGINX 的指标报告。更改任何配置后,通过执行以下命令重新加载配置文件: - - nginx -s reload - -现在,你可以查看指标的状态页: - - Active connections: 24 - server accepts handled requests - 1156958 1156958 4491319 - Reading: 0 Writing: 18 Waiting : 6 - -请注意,如果你正试图从远程计算机访问状态页面,则需要将远程计算机的 IP 地址添加到你的状态配置文件的白名单中,在上面的配置文件中 127.0.0.1 仅在白名单中。 - -nginx 的状态页面是一中查看指标快速又简单的方法,但当连续监测时,你需要每隔一段时间自动记录该数据。然后通过监控工具箱 [Nagios][4] 或者 [Datadog][5],以及收集统计信息的服务 [collectD][6] 来分析已保存的 NGINX 状态信息。 - -#### 指标收集: NGINX Plus #### - -商业版的 NGINX Plus 通过 ngx_http_status_module 提供的可用指标比开源版 NGINX 更多 [many more metrics][7] 。NGINX Plus 附加了更多的字节流指标,以及负载均衡系统和高速缓存的信息。NGINX Plus 还报告所有的 HTTP 状态码类型(1XX,2XX,3XX,4XX,5XX)的计数。一个简单的 NGINX Plus 状态报告 [here][8]。 - -![NGINX Plus status board](https://d33tyra1llx9zy.cloudfront.net/blog/images/2015-06-nginx/status_plus-2.png) - -*注: NGINX Plus 在状态仪表盘"Active”连接定义的收集指标的状态模块和开源 NGINX 的略有不同。在 NGINX Plus 指标中,活动连接不包括等待状态(又叫空闲连接)连接。* - -NGINX Plus 也集成了其他监控系统的报告 [JSON格式指标][9] 。用 NGINX Plus 时,你可以看到 [负载均衡服务器组的][10]指标和健康状况,或着再向下能取得的仅是响应代码计数[从单个服务器][11]在负载均衡服务器中: - {"1xx":0,"2xx":3483032,"3xx":0,"4xx":23,"5xx":0,"total":3483055} - -启动 NGINX Plus 指标仪表盘,你可以在 NGINX 配置文件的 http 块内添加状态 server 块。 ([参见上一页][12]查找相关的配置文件,收集开源 NGINX 版指标的说明。)例如,设立以下一个状态仪表盘在http://your.ip.address:8080/status.html 和一个 JSON 接口 http://your.ip.address:8080/status,可以添加以下 server block 来设定: - - server { - listen 8080; - root /usr/share/nginx/html; - - location /status { - status; - } - - location = /status.html { - } - } - -一旦你重新加载 NGINX 配置,状态页就会被加载: - - nginx -s reload - -关于如何配置扩展状态模块,官方 NGINX Plus 文档有 [详细介绍][13] 。 - -#### 指标收集:NGINX日志 #### - -NGINX 的 [日志模块][14] 写到配置可以自定义访问日志到指定文件。你可以自定义日志的格式和时间通过 [添加或移除变量][15]。捕获日志的详细信息,最简单的方法是添加下面一行在你配置文件的server 块中(参见[此节][16] 通过加载配置文件的信息来收集开源 NGINX 的指标): - - access_log logs/host.access.log combined; - -更改 NGINX 配置文件后,必须要重新加载配置文件: - - nginx -s reload - -“combined” 的日志格式,只包含默认参数,包括[一些关键数据][17],如实际的 HTTP 请求和相应的响应代码。在下面的示例日志中,NGINX 记录了200(成功)状态码当请求 /index.html 时和404(未找到)错误不存在的请求文件 /fail。 - - 127.0.0.1 - - [19/Feb/2015:12:10:46 -0500] "GET /index.html HTTP/1.1" 200 612 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.111 Safari 537.36" - - 127.0.0.1 - - [19/Feb/2015:12:11:05 -0500] "GET /fail HTTP/1.1" 404 570 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.111 Safari/537.36" - -你可以记录请求处理的时间通过添加一个新的日志格式在 NGINX 配置文件中的 http 块: - - log_format nginx '$remote_addr - $remote_user [$time_local] ' - '"$request" $status $body_bytes_sent $request_time ' - '"$http_referer" "$http_user_agent"'; - -通过修改配置文件中 server 块的 access_log 行: - - access_log logs/host.access.log nginx; - -重新加载配置文件(运行 nginx -s reload)后,你的访问日志将包括响应时间,如下图所示。单位为秒,毫秒。在这种情况下,服务器接收 /big.pdf 的请求时,发送33973115字节后返回206(成功)状态码。处理请求用时0.202秒(202毫秒): - - 127.0.0.1 - - [19/Feb/2015:15:50:36 -0500] "GET /big.pdf HTTP/1.1" 206 33973115 0.202 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.111 Safari/537.36" - -你可以使用各种工具和服务来收集和分析 NGINX 日志。例如,[rsyslog][18] 可以监视你的日志,并将其传递给多个日志分析服务;你也可以使用免费的开源工具,如[logstash][19]来收集和分析日志;或者你可以使用一个统一日志记录层,如[Fluentd][20]来收集和分析你的 NGINX 日志。 - -### 结论 ### - -监视 NGINX 的哪一项指标将取决于你提供的工具,以及是否由给定指标证明监控指标的开销。例如,通过收集和分析日志来定位问题是非常重要的在 NGINX Plus 或者 运行的系统中。 - -在 Datadog 中,我们已经集成了 NGINX 和 NGINX Plus,这样你就可以以最小的设置来收集和监控所有 Web 服务器的指标。了解如何用 NGINX Datadog来监控 [在本文中][21],并开始使用 [免费的Datadog][22]。 - ----------- - -原文在这 [on GitHub][23]。问题,更正,补充等?请[让我们知道][24]。 - --------------------------------------------------------------------------------- - -via: https://www.datadoghq.com/blog/how-to-collect-nginx-metrics/ - -作者:K Young -译者:[strugglingyouth](https://github.com/strugglingyouth) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[1]:https://www.datadoghq.com/blog/how-to-monitor-nginx/ -[2]:http://nginx.org/en/docs/http/ngx_http_stub_status_module.html -[3]:http://wiki.nginx.org/InstallOptions -[4]:https://exchange.nagios.org/directory/Plugins/Web-Servers/nginx -[5]:http://docs.datadoghq.com/integrations/nginx/ -[6]:https://collectd.org/wiki/index.php/Plugin:nginx -[7]:http://nginx.org/en/docs/http/ngx_http_status_module.html#data -[8]:http://demo.nginx.com/status.html -[9]:http://demo.nginx.com/status -[10]:http://demo.nginx.com/status/upstreams/demoupstreams -[11]:http://demo.nginx.com/status/upstreams/demoupstreams/0/responses -[12]:https://www.datadoghq.com/blog/how-to-collect-nginx-metrics/#open-source -[13]:http://nginx.org/en/docs/http/ngx_http_status_module.html#example -[14]:http://nginx.org/en/docs/http/ngx_http_log_module.html -[15]:http://nginx.org/en/docs/http/ngx_http_log_module.html#log_format -[16]:https://www.datadoghq.com/blog/how-to-collect-nginx-metrics/#open-source -[17]:http://nginx.org/en/docs/http/ngx_http_log_module.html#log_format -[18]:http://www.rsyslog.com/ -[19]:https://www.elastic.co/products/logstash -[20]:http://www.fluentd.org/ -[21]:https://www.datadoghq.com/blog/how-to-monitor-nginx-with-datadog/ -[22]:https://www.datadoghq.com/blog/how-to-collect-nginx-metrics/#sign-up -[23]:https://github.com/DataDog/the-monitor/blob/master/nginx/how_to_collect_nginx_metrics.md -[24]:https://github.com/DataDog/the-monitor/issues From 843f0e99478af5d7c47fd3e774c79aacfff4732f Mon Sep 17 00:00:00 2001 From: Chang Liu Date: Mon, 10 Aug 2015 15:01:28 +0800 Subject: [PATCH 874/965] [Translated]20150209 Install OpenQRM Cloud Computing Platform In Debian.md --- ...nQRM Cloud Computing Platform In Debian.md | 151 ------------------ ...nQRM Cloud Computing Platform In Debian.md | 148 +++++++++++++++++ 2 files changed, 148 insertions(+), 151 deletions(-) delete mode 100644 sources/tech/20150209 Install OpenQRM Cloud Computing Platform In Debian.md create mode 100644 translated/tech/20150209 Install OpenQRM Cloud Computing Platform In Debian.md diff --git a/sources/tech/20150209 Install OpenQRM Cloud Computing Platform In Debian.md b/sources/tech/20150209 Install OpenQRM Cloud Computing Platform In Debian.md deleted file mode 100644 index 2c6a990b83..0000000000 --- a/sources/tech/20150209 Install OpenQRM Cloud Computing Platform In Debian.md +++ /dev/null @@ -1,151 +0,0 @@ -FSSlc translating - -Install OpenQRM Cloud Computing Platform In Debian -================================================================================ -### Introduction ### - -**openQRM** is a web-based open source Cloud computing and datacenter management platform that integrates flexibly with existing components in enterprise data centers. - -It supports the following virtualization technologies: - -- KVM, -- XEN, -- Citrix XenServer, -- VMWare ESX, -- LXC, -- OpenVZ. - -The Hybrid Cloud Connector in openQRM supports a range of private or public cloud providers to extend your infrastructure on demand via **Amazon AWS**, **Eucalyptus** or **OpenStack**. It, also, automates provisioning, virtualization, storage and configuration management, and it takes care of high-availability. A self-service cloud portal with integrated billing system enables end-users to request new servers and application stacks on-demand. - -openQRM is available in two different flavours such as: - -- Enterprise Edition -- Community Edition - -You can view the difference between both editions [here][1]. - -### Features ### - -- Private/Hybrid Cloud Computing Platform; -- Manages physical and virtualized server systems; -- Integrates with all major open and commercial storage technologies; -- Cross-platform: Linux, Windows, OpenSolaris, and *BSD; -- Supports KVM, XEN, Citrix XenServer, VMWare ESX(i), lxc, OpenVZ and VirtualBox; -- Support for Hybrid Cloud setups using additional Amazon AWS, Eucalyptus, Ubuntu UEC cloud resources; -- Supports P2V, P2P, V2P, V2V Migrations and High-Availability; -- Integrates with the best Open Source management tools – like puppet, nagios/Icinga or collectd; -- Over 50 plugins for extended features and integration with your infrastructure; -- Self-Service Portal for end-users; -- Integrated billing system. - -### Installation ### - -Here, we will install openQRM in Ubuntu 14.04 LTS. Your server must atleast meet the following requirements. - -- 1 GB RAM; -- 100 GB Hdd; -- Optional: Virtualization enabled (VT for Intel CPUs or AMD-V for AMD CPUs) in Bios. - -First, install make package to compile openQRM source package. - - sudo apt-get update - sudo apt-get upgrade - sudo apt-get install make - -Then, run the following commands one by one to install openQRM. - -Download the latest available version [from here][2]. - - wget http://sourceforge.net/projects/openqrm/files/openQRM-Community-5.1/openqrm-community-5.1.tgz - - tar -xvzf openqrm-community-5.1.tgz - - cd openqrm-community-5.1/src/ - - sudo make - - sudo make install - - sudo make start - -During installation, you’ll be asked to update the php.ini file. - -![~-openqrm-community-5.1-src_001](http://180016988.r.cdn77.net/wp-content/uploads/2015/02/sk@server-openqrm-community-5.1-src_001.png) - -Enter mysql root user password. - -![~-openqrm-community-5.1-src_002](http://180016988.r.cdn77.net/wp-content/uploads/2015/02/sk@server-openqrm-community-5.1-src_002.png) - -Re-enter password: - -![~-openqrm-community-5.1-src_003](http://180016988.r.cdn77.net/wp-content/uploads/2015/02/sk@server-openqrm-community-5.1-src_003.png) - -Select the mail server configuration type. - -![~-openqrm-community-5.1-src_004](http://180016988.r.cdn77.net/wp-content/uploads/2015/02/sk@server-openqrm-community-5.1-src_004.png) - -If you’re not sure, select Local only. In our case, I go with **Local only** option. - -![~-openqrm-community-5.1-src_005](http://180016988.r.cdn77.net/wp-content/uploads/2015/02/sk@server-openqrm-community-5.1-src_005.png) - -Enter your system mail name, and finally enter the Nagios administration password. - -![~-openqrm-community-5.1-src_007](http://180016988.r.cdn77.net/wp-content/uploads/2015/02/sk@server-openqrm-community-5.1-src_007.png) - -The above commands will take long time depending upon your Internet connection to download all packages required to run openQRM. Be patient. - -Finally, you’ll get the openQRM configuration URL along with username and password. - -![~_002](http://180016988.r.cdn77.net/wp-content/uploads/2015/02/sk@debian-_002.png) - -### Configuration ### - -After installing openQRM, open up your web browser and navigate to the URL: **http://ip-address/openqrm**. - -For example, in my case http://192.168.1.100/openqrm. - -The default username and password is: **openqrm/openqrm**. - -![Mozilla Firefox_003](http://180016988.r.cdn77.net/wp-content/uploads/2015/02/Mozilla-Firefox_003.png) - -Select a network card to use for the openQRM management network. - -![openQRM Server - Mozilla Firefox_004](http://180016988.r.cdn77.net/wp-content/uploads/2015/02/openQRM-Server-Mozilla-Firefox_004.png) - -Select a database type. In our case, I selected mysql. - -![openQRM Server - Mozilla Firefox_006](http://180016988.r.cdn77.net/wp-content/uploads/2015/02/openQRM-Server-Mozilla-Firefox_006.png) - -Now, configure the database connection and initialize openQRM. Here, I use **openQRM** as database name, and user as **root** and debian as password for the database. Be mindful that you should enter the mysql root user password that you have created while installing openQRM. - -![openQRM Server - Mozilla Firefox_012](http://180016988.r.cdn77.net/wp-content/uploads/2015/02/openQRM-Server-Mozilla-Firefox_012.png) - -Congratulations!! openQRM has been installed and configured. - -![openQRM Server - Mozilla Firefox_013](http://180016988.r.cdn77.net/wp-content/uploads/2015/02/openQRM-Server-Mozilla-Firefox_013.png) - -### Update openQRM ### - -To update openQRM at any time run the following command: - - cd openqrm/src/ - make update - -What we have done so far is just installed and configured openQRM in our Ubuntu server. For creating, running Virtual Machines, managing Storage, integrating additional systems and running your own private Cloud, I suggest you to read the [openQRM Administrator Guide][3]. - -That’s all now. Cheers! Happy weekend!! - --------------------------------------------------------------------------------- - -via: http://www.unixmen.com/install-openqrm-cloud-computing-platform-debian/ - -作者:[SK][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://www.unixmen.com/author/sk/ -[1]:http://www.openqrm-enterprise.com/products/edition-comparison.html -[2]:http://sourceforge.net/projects/openqrm/files/?source=navbar -[3]:http://www.openqrm-enterprise.com/fileadmin/Documents/Whitepaper/openQRM-Enterprise-Administrator-Guide-5.2.pdf diff --git a/translated/tech/20150209 Install OpenQRM Cloud Computing Platform In Debian.md b/translated/tech/20150209 Install OpenQRM Cloud Computing Platform In Debian.md new file mode 100644 index 0000000000..2eacc933b9 --- /dev/null +++ b/translated/tech/20150209 Install OpenQRM Cloud Computing Platform In Debian.md @@ -0,0 +1,148 @@ +在 Debian 中安装 OpenQRM 云计算平台 +================================================================================ +### 简介 ### + +**openQRM**是一个基于 Web 的开源云计算和数据中心管理平台,可灵活地与企业数据中心的现存组件集成。 + +它支持下列虚拟技术: + +- KVM, +- XEN, +- Citrix XenServer, +- VMWare ESX, +- LXC, +- OpenVZ. + +openQRM 中的杂交云连接器通过 **Amazon AWS**, **Eucalyptus** 或 **OpenStack** 来支持一系列的私有或公有云提供商,以此来按需扩展你的基础设施。它也自动地进行资源调配、 虚拟化、 存储和配置管理,且关注高可用性。集成计费系统的自助服务云门户可使终端用户按需请求新的服务器和应用堆栈。 + +openQRM 有两种不同风格的版本可获取: + +- 企业版 +- 社区版 + +你可以在[这里][1] 查看这两个版本间的区别。 + +### 特点 ### + +- 私有/杂交的云计算平台; +- 可管理物理或虚拟的服务器系统; +- 可与所有主流的开源或商业的存储技术集成; +- 跨平台: Linux, Windows, OpenSolaris, and BSD; +- 支持 KVM, XEN, Citrix XenServer, VMWare ESX(i), lxc, OpenVZ 和 VirtualBox; +- 支持使用额外的 Amazon AWS, Eucalyptus, Ubuntu UEC 等云资源来进行杂交云设置; +- 支持 P2V, P2P, V2P, V2V 迁移和高可用性; +- 集成最好的开源管理工具 – 如 puppet, nagios/Icinga 或 collectd; +- 有超过 50 个插件来支持扩展功能并与你的基础设施集成; +- 针对终端用户的自助门户; +- 集成计费系统. + +### 安装 ### + +在这里我们将在 in Debian 7.5 上安装 openQRM。你的服务器必须至少满足以下要求: + +- 1 GB RAM; +- 100 GB Hdd(硬盘驱动器); +- 可选: Bios 支持虚拟化(Intel CPUs 的 VT 或 AMD CPUs AMD-V). + +首先,安装 `make` 软件包来编译 openQRM 源码包: + + sudo apt-get update + sudo apt-get upgrade + sudo apt-get install make + +然后,逐次运行下面的命令来安装 openQRM。 + +从[这里][2] 下载最新的可用版本: + + wget http://sourceforge.net/projects/openqrm/files/openQRM-Community-5.1/openqrm-community-5.1.tgz + + tar -xvzf openqrm-community-5.1.tgz + + cd openqrm-community-5.1/src/ + + sudo make + + sudo make install + + sudo make start + +安装期间,你将被询问去更新文件 `php.ini` + +![~-openqrm-community-5.1-src_001](http://180016988.r.cdn77.net/wp-content/uploads/2015/02/sk@server-openqrm-community-5.1-src_001.png) + +输入 mysql root 用户密码。 + +![~-openqrm-community-5.1-src_002](http://180016988.r.cdn77.net/wp-content/uploads/2015/02/sk@server-openqrm-community-5.1-src_002.png) + +再次输入密码: + +![~-openqrm-community-5.1-src_003](http://180016988.r.cdn77.net/wp-content/uploads/2015/02/sk@server-openqrm-community-5.1-src_003.png) + +选择邮件服务器配置类型。 + +![~-openqrm-community-5.1-src_004](http://180016988.r.cdn77.net/wp-content/uploads/2015/02/sk@server-openqrm-community-5.1-src_004.png) + +假如你不确定该如何选择,可选择 `Local only`。在我们的这个示例中,我选择了 **Local only** 选项。 + +![~-openqrm-community-5.1-src_005](http://180016988.r.cdn77.net/wp-content/uploads/2015/02/sk@server-openqrm-community-5.1-src_005.png) + +输入你的系统邮件名称,并最后输入 Nagios 管理员密码。 + +![~-openqrm-community-5.1-src_007](http://180016988.r.cdn77.net/wp-content/uploads/2015/02/sk@server-openqrm-community-5.1-src_007.png) + +根据你的网络连接状态,上面的命令可能将花费很长的时间来下载所有运行 openQRM 所需的软件包,请耐心等待。 + +最后你将得到 openQRM 配置 URL 地址以及相关的用户名和密码。 + +![~_002](http://180016988.r.cdn77.net/wp-content/uploads/2015/02/sk@debian-_002.png) + +### 配置 ### + +在安装完 openQRM 后,打开你的 Web 浏览器并转到 URL: **http://ip-address/openqrm** + +例如,在我的示例中为 http://192.168.1.100/openqrm 。 + +默认的用户名和密码是: **openqrm/openqrm** 。 + +![Mozilla Firefox_003](http://180016988.r.cdn77.net/wp-content/uploads/2015/02/Mozilla-Firefox_003.png) + +选择一个网卡来给 openQRM 管理网络使用。 + +![openQRM Server - Mozilla Firefox_004](http://180016988.r.cdn77.net/wp-content/uploads/2015/02/openQRM-Server-Mozilla-Firefox_004.png) + +选择一个数据库类型,在我们的示例中,我选择了 mysql。 + +![openQRM Server - Mozilla Firefox_006](http://180016988.r.cdn77.net/wp-content/uploads/2015/02/openQRM-Server-Mozilla-Firefox_006.png) + +现在,配置数据库连接并初始化 openQRM, 在这里,我使用 **openQRM** 作为数据库名称, **root** 作为用户的身份,并将 debian 作为数据库的密码。 请小心,你应该输入先前在安装 openQRM 时创建的 mysql root 用户密码。 + +![openQRM Server - Mozilla Firefox_012](http://180016988.r.cdn77.net/wp-content/uploads/2015/02/openQRM-Server-Mozilla-Firefox_012.png) + +祝贺你!! openQRM 已经安装并配置好了。 + +![openQRM Server - Mozilla Firefox_013](http://180016988.r.cdn77.net/wp-content/uploads/2015/02/openQRM-Server-Mozilla-Firefox_013.png) + +### 更新 openQRM ### + +在任何时候可以使用下面的命令来更新 openQRM: + + cd openqrm/src/ + make update + +到现在为止,我们做的只是在我们的 Ubuntu 服务器中安装和配置 openQRM, 至于 创建、运行虚拟,管理存储,额外的系统集成和运行你自己的私有云等内容,我建议你阅读 [openQRM 管理员指南][3]。 + +就是这些了,欢呼吧!周末快乐! +-------------------------------------------------------------------------------- + +via: http://www.unixmen.com/install-openqrm-cloud-computing-platform-debian/ + +作者:[SK][a] +译者:[FSSlc](https://github.com/FSSlc) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://www.unixmen.com/author/sk/ +[1]:http://www.openqrm-enterprise.com/products/edition-comparison.html +[2]:http://sourceforge.net/projects/openqrm/files/?source=navbar +[3]:http://www.openqrm-enterprise.com/fileadmin/Documents/Whitepaper/openQRM-Enterprise-Administrator-Guide-5.2.pdf \ No newline at end of file From 1664191a8aa7b3137e1f39eb0756e4e60b2e35b1 Mon Sep 17 00:00:00 2001 From: xiaoyu33 <1136299502@qq.com> Date: Mon, 10 Aug 2015 16:50:55 +0800 Subject: [PATCH 875/965] Update 20150810 For Linux, Supercomputers R Us.md add "Translating by xiaoyu33" --- sources/talk/20150810 For Linux, Supercomputers R Us.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/talk/20150810 For Linux, Supercomputers R Us.md b/sources/talk/20150810 For Linux, Supercomputers R Us.md index 7bc48125f0..8f7302cca1 100644 --- a/sources/talk/20150810 For Linux, Supercomputers R Us.md +++ b/sources/talk/20150810 For Linux, Supercomputers R Us.md @@ -1,3 +1,4 @@ +Translating by xiaoyu33 For Linux, Supercomputers R Us ================================================================================ ![Credit: Michel Ngilen, CC BY 2.0, via Wikimedia Commons](http://images.techhive.com/images/article/2015/08/playstation_3-100602985-primary.idge.jpg) @@ -56,4 +57,4 @@ via: [12]:http://www.google.com/url?q=http%3A%2F%2Fen.intelextrememasters.com%2Fnews%2Fcheck-out-the-intel-extreme-masters-katowice-prize-money-distribution%2F&sa=D&sntz=1&usg=AFQjCNE6yoAGGz-Hpi2tPF4gdhuPBEckhQ [13]:http://www.beowulf.org/overview/history.html [14]:http://yclept.ucdavis.edu/Beowulf/aboutbeowulf.html -[15]:http://www.beowulf.org/ \ No newline at end of file +[15]:http://www.beowulf.org/ From 219731a082612b418fd451207170d39264c3f67e Mon Sep 17 00:00:00 2001 From: Chang Liu Date: Tue, 11 Aug 2015 07:34:03 +0800 Subject: [PATCH 876/965] Update RHCSA Series--Part 04--Editing Text Files with Nano and Vim or Analyzing text with grep and regexps.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 准备翻译该篇。 --- ...th Nano and Vim or Analyzing text with grep and regexps.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/tech/RHCSA Series/RHCSA Series--Part 04--Editing Text Files with Nano and Vim or Analyzing text with grep and regexps.md b/sources/tech/RHCSA Series/RHCSA Series--Part 04--Editing Text Files with Nano and Vim or Analyzing text with grep and regexps.md index 1529fecf2e..f3de8528fc 100644 --- a/sources/tech/RHCSA Series/RHCSA Series--Part 04--Editing Text Files with Nano and Vim or Analyzing text with grep and regexps.md +++ b/sources/tech/RHCSA Series/RHCSA Series--Part 04--Editing Text Files with Nano and Vim or Analyzing text with grep and regexps.md @@ -1,3 +1,5 @@ +FSSlc translating + RHCSA Series: Editing Text Files with Nano and Vim / Analyzing text with grep and regexps – Part 4 ================================================================================ Every system administrator has to deal with text files as part of his daily responsibilities. That includes editing existing files (most likely configuration files), or creating new ones. It has been said that if you want to start a holy war in the Linux world, you can ask sysadmins what their favorite text editor is and why. We are not going to do that in this article, but will present a few tips that will be helpful to use two of the most widely used text editors in RHEL 7: nano (due to its simplicity and easiness of use, specially to new users), and vi/m (due to its several features that convert it into more than a simple editor). I am sure that you can find many more reasons to use one or the other, or perhaps some other editor such as emacs or pico. It’s entirely up to you. @@ -251,4 +253,4 @@ via: http://www.tecmint.com/rhcsa-exam-how-to-use-nano-vi-editors/ [2]:http://www.tecmint.com/file-and-directory-management-in-linux/ [3]:http://www.tecmint.com/rhcsa-exam-reviewing-essential-commands-system-documentation/ [4]:http://www.nano-editor.org/ -[5]:http://www.vim.org/ \ No newline at end of file +[5]:http://www.vim.org/ From d0f66e61773cc0d995e0f3b64495f965d742e416 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 11 Aug 2015 09:31:21 +0800 Subject: [PATCH 877/965] Rename sources/tech/20150730 How to Setup iTOP (IT Operational Portal) on CentOS 7.md to translated/tech/20150730 How to Setup iTOP (IT Operational Portal) on CentOS 7.md --- ...50730 How to Setup iTOP (IT Operational Portal) on CentOS 7.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/20150730 How to Setup iTOP (IT Operational Portal) on CentOS 7.md (100%) diff --git a/sources/tech/20150730 How to Setup iTOP (IT Operational Portal) on CentOS 7.md b/translated/tech/20150730 How to Setup iTOP (IT Operational Portal) on CentOS 7.md similarity index 100% rename from sources/tech/20150730 How to Setup iTOP (IT Operational Portal) on CentOS 7.md rename to translated/tech/20150730 How to Setup iTOP (IT Operational Portal) on CentOS 7.md From 83c752ac30a52faf8a0d2b772c2d00180e648f2a Mon Sep 17 00:00:00 2001 From: Ping Date: Mon, 10 Aug 2015 17:27:59 +0800 Subject: [PATCH 878/965] Complete 20150518 How to set up a Replica Set on MongoDB.md --- ... How to set up a Replica Set on MongoDB.md | 183 ------------------ ... How to set up a Replica Set on MongoDB.md | 183 ++++++++++++++++++ 2 files changed, 183 insertions(+), 183 deletions(-) delete mode 100644 sources/tech/20150518 How to set up a Replica Set on MongoDB.md create mode 100644 translated/tech/20150518 How to set up a Replica Set on MongoDB.md diff --git a/sources/tech/20150518 How to set up a Replica Set on MongoDB.md b/sources/tech/20150518 How to set up a Replica Set on MongoDB.md deleted file mode 100644 index 83a7da8769..0000000000 --- a/sources/tech/20150518 How to set up a Replica Set on MongoDB.md +++ /dev/null @@ -1,183 +0,0 @@ -Translating by Ping -How to set up a Replica Set on MongoDB -================================================================================ -MongoDB has become the most famous NoSQL database on the market. MongoDB is document-oriented, and its scheme-free design makes it a really attractive solution for all kinds of web applications. One of the features that I like the most is Replica Set, where multiple copies of the same data set are maintained by a group of mongod nodes for redundancy and high availability. - -This tutorial describes how to configure a Replica Set on MonoDB. - -The most common configuration for a Replica Set involves one primary and multiple secondary nodes. The replication will then be initiated from the primary toward the secondaries. Replica Sets can not only provide database protection against unexpected hardware failure and service downtime, but also improve read throughput of database clients as they can be configured to read from different nodes. - -### Set up the Environment ### - -In this tutorial, we are going to set up a Replica Set with one primary and two secondary nodes. - -![](https://farm8.staticflickr.com/7667/17801038505_529a5224a1.jpg) - -In order to implement this lab, we will use three virtual machines (VMs) running on VirtualBox. I am going to install Ubuntu 14.04 on the VMs, and install official packages for Mongodb. - -I am going to set up a necessary environment on one VM instance, and then clone it to the other two VM instances. Thus pick one VM named master, and perform the following installations. - -First, we need to add the MongoDB key for apt: - - $ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10 - -Then we need to add the official MongoDB repository to our source.list: - - $ sudo su - # echo "deb http://repo.mongodb.org/apt/ubuntu "$(lsb_release -sc)"/mongodb-org/3.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.0.list - -Let's update repositories and install MongoDB. - - $ sudo apt-get update - $ sudo apt-get install -y mongodb-org - -Now let's make some changes in /etc/mongodb.conf. - - auth = true - dbpath=/var/lib/mongodb - logpath=/var/log/mongodb/mongod.log - logappend=true - keyFile=/var/lib/mongodb/keyFile - replSet=myReplica - -The first line is to make sure that we are going to have authentication on our database. keyFile is to set up a keyfile that is going to be used by MongoDB to replicate between nodes. replSet sets up the name of our replica set. - -Now we are going to create our keyfile, so that it can be in all our instances. - - $ echo -n "MyRandomStringForReplicaSet" | md5sum > keyFile - -This will create keyfile that contains a MD5 string, but it has some noise that we need to clean up before using it in MongoDB. Use the following command to clean it up: - - $ echo -n "MyReplicaSetKey" | md5sum|grep -o "[0-9a-z]\+" > keyFile - -What grep command does is to print MD5 string with no spaces or other characters that we don't want. - -Now we are going to make the keyfile ready for use: - - $ sudo cp keyFile /var/lib/mongodb - $ sudo chown mongodb:nogroup keyFile - $ sudo chmod 400 keyFile - -Now we have our Ubuntu VM ready to be cloned. Power it off, and clone it to the other VMs. - -![](https://farm9.staticflickr.com/8729/17800903865_9876a9cc9c.jpg) - -I name the cloned VMs secondary1 and secondary2. Make sure to reinitialize the MAC address of cloned VMs and clone full disks. - -![](https://farm6.staticflickr.com/5333/17613392900_6de45c9450.jpg) - -All three VM instances should be on the same network to communicate with each other. For this, we are going to attach all three VMs to "Internet Network". - -It is recommended that each VM instances be assigned a static IP address, as opposed to DHCP IP address, so that the VMs will not lose connectivity among themselves when a DHCP server assigns different IP addresses to them. - -Let's edit /etc/networks/interfaces of each VM as follows. - -On primary: - - auto eth1 - iface eth1 inet static - address 192.168.50.2 - netmask 255.255.255.0 - -On secondary1: - - auto eth1 - iface eth1 inet static - address 192.168.50.3 - netmask 255.255.255.0 - -On secondary2: - - auto eth1 - iface eth1 inet static - address 192.168.50.4 - netmask 255.255.255.0 - -Another file that needs to be set up is /etc/hosts, because we don't have DNS. We need to set the hostnames in /etc/hosts. - -On primary: - - 127.0.0.1 localhost primary - 192.168.50.2 primary - 192.168.50.3 secondary1 - 192.168.50.4 secondary2 - -On secondary1: - - 127.0.0.1 localhost secondary1 - 192.168.50.2 primary - 192.168.50.3 secondary1 - 192.168.50.4 secondary2 - -On secondary2: - - 127.0.0.1 localhost secondary2 - 192.168.50.2 primary - 192.168.50.3 secondary1 - 192.168.50.4 secondary2 - -Check connectivity among themselves by using ping command: - - $ ping primary - $ ping secondary1 - $ ping secondary2 - -### Set up a Replica Set ### - -After verifying connectivity among VMs, we can go ahead and create the admin user so that we can start working on the Replica Set. - -On primary node, open /etc/mongodb.conf, and comment out two lines that start with auth and replSet: - - dbpath=/var/lib/mongodb - logpath=/var/log/mongodb/mongod.log - logappend=true - #auth = true - keyFile=/var/lib/mongodb/keyFile - #replSet=myReplica - -Restart mongod daemon. - - $ sudo service mongod restart - -Create an admin user after conencting to MongoDB: - - > use admin - > db.createUser({ - user:"admin", - pwd:" - }) - $ sudo service mongod restart - -Connect to MongoDB and use these commands to add secondary1 and secondary2 to our Replicat Set. - - > use admin - > db.auth("admin","myreallyhardpassword") - > rs.initiate() - > rs.add ("secondary1:27017") - > rs.add("secondary2:27017") - -Now that we have our Replica Set, we can start working on our project. Consult the [official driver documentation][1] to see how to connect to a Replica Set. In case you want to query from shell, you have to connect to primary instance to insert or query the database. Secondary nodes will not let you do that. If you attempt to access the database on a secondary node, you will get this error message: - - myReplica:SECONDARY> - myReplica:SECONDARY> show databases - 2015-05-10T03:09:24.131+0000 E QUERY Error: listDatabases failed:{ "note" : "from execCommand", "ok" : 0, "errmsg" : "not master" } - at Error () - at Mongo.getDBs (src/mongo/shell/mongo.js:47:15) - at shellHelper.show (src/mongo/shell/utils.js:630:33) - at shellHelper (src/mongo/shell/utils.js:524:36) - at (shellhelp2):1:1 at src/mongo/shell/mongo.js:47 - -I hope you find this tutorial useful. You can use Vagrant to automate your local environments and help you code faster. - --------------------------------------------------------------------------------- - -via: http://xmodulo.com/setup-replica-set-mongodb.html - -作者:[Christopher Valerio][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://xmodulo.com/author/valerio -[1]:http://docs.mongodb.org/ecosystem/drivers/ diff --git a/translated/tech/20150518 How to set up a Replica Set on MongoDB.md b/translated/tech/20150518 How to set up a Replica Set on MongoDB.md new file mode 100644 index 0000000000..44b8535b82 --- /dev/null +++ b/translated/tech/20150518 How to set up a Replica Set on MongoDB.md @@ -0,0 +1,183 @@ +如何配置MongoDB副本集(Replica Set) +================================================================================ +MongoDB已经成为市面上最知名的NoSQL数据库。MongoDB是面向文档的,它的无模式设计使得它在各种各样的WEB应用当中广受欢迎。最让我喜欢的特性之一是它的副本集,副本集将同一数据的多份拷贝放在一组mongod节点上,从而实现数据的冗余以及高可用性。 + +这篇教程将向你介绍如何配置一个MongoDB副本集。 + +副本集的最常见配置涉及到一个主节点以及多个副节点。这之后启动的复制行为会从这个主节点到其他副节点。副本集不止可以针对意外的硬件故障和停机事件对数据库提供保护,同时也因为提供了更多的结点从而提高了数据库客户端数据读取的吞吐量。 + +### 配置环境 ### + +这个教程里,我们会配置一个包括一个主节点以及两个副节点的副本集。 + +![](https://farm8.staticflickr.com/7667/17801038505_529a5224a1.jpg) + +为了达到这个目的,我们使用了3个运行在VirtualBox上的虚拟机。我会在这些虚拟机上安装Ubuntu 14.04,并且安装MongoDB官方包。 + +我会在一个虚拟机实例上配置好需要的环境,然后将它克隆到其他的虚拟机实例上。因此,选择一个名为master的虚拟机,执行以下安装过程。 + +首先,我们需要在apt中增加一个MongoDB密钥: + + $ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10 + +然后,将官方的MongoDB仓库添加到source.list中: + + $ sudo su + # echo "deb http://repo.mongodb.org/apt/ubuntu "$(lsb_release -sc)"/mongodb-org/3.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.0.list + +接下来更新apt仓库并且安装MongoDB。 + + $ sudo apt-get update + $ sudo apt-get install -y mongodb-org + +现在对/etc/mongodb.conf做一些更改 + + auth = true + dbpath=/var/lib/mongodb + logpath=/var/log/mongodb/mongod.log + logappend=true + keyFile=/var/lib/mongodb/keyFile + replSet=myReplica + +第一行的作用是确认我们的数据库需要验证才可以使用的。keyfile用来配置用于MongoDB结点间复制行为的密钥文件。replSet用来为副本集设置一个名称。 + +接下来我们创建一个用于所有实例的密钥文件。 + + $ echo -n "MyRandomStringForReplicaSet" | md5sum > keyFile + +这将会创建一个含有MD5字符串的密钥文件,但是由于其中包含了一些噪音,我们需要对他们清理后才能正式在MongoDB中使用。 + + $ echo -n "MyReplicaSetKey" | md5sum|grep -o "[0-9a-z]\+" > keyFile + +grep命令的作用的是把将空格等我们不想要的内容过滤掉之后的MD5字符串打印出来。 + +现在我们对密钥文件进行一些操作,让它真正可用。 + + $ sudo cp keyFile /var/lib/mongodb + $ sudo chown mongodb:nogroup keyFile + $ sudo chmod 400 keyFile + +接下来,关闭此虚拟机。将其Ubuntu系统克隆到其他虚拟机上。 + +![](https://farm9.staticflickr.com/8729/17800903865_9876a9cc9c.jpg) + +这是克隆后的副节点1和副节点2。确认你已经将它们的MAC地址重新初始化,并且克隆整个硬盘。 + +![](https://farm6.staticflickr.com/5333/17613392900_6de45c9450.jpg) + +请注意,三个虚拟机示例需要在同一个网络中以便相互通讯。因此,我们需要它们弄到“互联网"上去。 + +这里推荐给每个虚拟机设置一个静态IP地址,而不是使用DHCP。这样它们就不至于在DHCP分配IP地址给他们的时候失去连接。 + +像下面这样编辑每个虚拟机的/etc/networks/interfaces文件。 + +在主结点上: + + auto eth1 + iface eth1 inet static + address 192.168.50.2 + netmask 255.255.255.0 + +在副结点1上: + + auto eth1 + iface eth1 inet static + address 192.168.50.3 + netmask 255.255.255.0 + +在副结点2上: + + auto eth1 + iface eth1 inet static + address 192.168.50.4 + netmask 255.255.255.0 + +由于我们没有DNS服务,所以需要设置设置一下/etc/hosts这个文件,手工将主机名称放到次文件中。 + +在主结点上: + + 127.0.0.1 localhost primary + 192.168.50.2 primary + 192.168.50.3 secondary1 + 192.168.50.4 secondary2 + +在副结点1上: + + 127.0.0.1 localhost secondary1 + 192.168.50.2 primary + 192.168.50.3 secondary1 + 192.168.50.4 secondary2 + +在副结点2上: + + 127.0.0.1 localhost secondary2 + 192.168.50.2 primary + 192.168.50.3 secondary1 + 192.168.50.4 secondary2 + +使用ping命令检查各个结点之间的连接。 + + $ ping primary + $ ping secondary1 + $ ping secondary2 + +### 配置副本集 ### + +验证各个结点可以正常连通后,我们就可以新建一个管理员用户,用于之后的副本集操作。 + +在主节点上,打开/etc/mongodb.conf文件,将auth和replSet两项注释掉。 + + dbpath=/var/lib/mongodb + logpath=/var/log/mongodb/mongod.log + logappend=true + #auth = true + keyFile=/var/lib/mongodb/keyFile + #replSet=myReplica + +重启mongod进程。 + + $ sudo service mongod restart + +连接MongoDB后,新建管理员用户。 + + > use admin + > db.createUser({ + user:"admin", + pwd:" + }) + $ sudo service mongod restart + +连接到MongoDB,用以下命令将secondary1和secondary2节点添加到我们的副本集中。 + + > use admin + > db.auth("admin","myreallyhardpassword") + > rs.initiate() + > rs.add ("secondary1:27017") + > rs.add("secondary2:27017") + + +现在副本集到手了,可以开始我们的项目了。参照 [official driver documentation][1] 来了解如何连接到副本集。如果你想要用Shell来请求数据,那么你需要连接到主节点上来插入或者请求数据,副节点不行。如果你执意要尝试用附件点操作,那么以下错误信息就蹦出来招呼你了。 + + myReplica:SECONDARY> + myReplica:SECONDARY> show databases + 2015-05-10T03:09:24.131+0000 E QUERY Error: listDatabases failed:{ "note" : "from execCommand", "ok" : 0, "errmsg" : "not master" } + at Error () + at Mongo.getDBs (src/mongo/shell/mongo.js:47:15) + at shellHelper.show (src/mongo/shell/utils.js:630:33) + at shellHelper (src/mongo/shell/utils.js:524:36) + at (shellhelp2):1:1 at src/mongo/shell/mongo.js:47 + +希望这篇教程能对你有所帮助。你可以使用Vagrant来自动完成你的本地环境配置,并且加速你的代码。 + +-------------------------------------------------------------------------------- + +via: http://xmodulo.com/setup-replica-set-mongodb.html + +作者:[Christopher Valerio][a] +译者:[mr-ping](https://github.com/mr-ping) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://xmodulo.com/author/valerio +[1]:http://docs.mongodb.org/ecosystem/drivers/ From 5adf534ccbbdb8fc2db27e242835ed78f8ba9220 Mon Sep 17 00:00:00 2001 From: ZTinoZ Date: Tue, 11 Aug 2015 10:13:13 +0800 Subject: [PATCH 879/965] Delete translated article --- .../20150806 5 heroes of the Linux world.md | 99 ------------------- 1 file changed, 99 deletions(-) delete mode 100644 sources/talk/20150806 5 heroes of the Linux world.md diff --git a/sources/talk/20150806 5 heroes of the Linux world.md b/sources/talk/20150806 5 heroes of the Linux world.md deleted file mode 100644 index abc42df7f9..0000000000 --- a/sources/talk/20150806 5 heroes of the Linux world.md +++ /dev/null @@ -1,99 +0,0 @@ -Linux世界的五个大神 -================================================================================ -这些人是谁?见或者没见过?谁在每天影响着我们? - -![Image courtesy Christopher Michel/Flickr](http://core0.staticworld.net/images/article/2015/07/penguin-100599348-orig.jpg) -Image courtesy [Christopher Michel/Flickr][1] - -### 野心勃勃的企鹅 ### - -Linux和开源世界一直在被那些热情洋溢的人们推动着,他们开发出最好的软件并将代码向公众开放,所以每个人都能无条件地看到。(对了,有那么一个条件,那就是许可证。) - -那么,这些人是谁?这些Linux世界里的大神们,谁在每天影响着我们?让我来给你一一揭晓。 - -![Image courtesy Swapnil Bhartiya](http://images.techhive.com/images/article/2015/07/swap-klaus-100599357-orig.jpg) -Image courtesy Swapnil Bhartiya - -### Klaus Knopper ### - -Klaus Knopper,一个生活在德国的奥地利开发者,他是Knoppix和Adriana Linux的创始人,为了他失明的妻子开发程序。 - -Knoppix在那些Linux用户心里有着特殊的地位,他们在使用Ubuntu之前都会尝试Knoppix,而Knoppix让人称道的就是它让Live CD的概念普及开来。不像Windows或Mac OS X,你可以通过CD运行整个操作系统而不用再系统上安装任何东西,它允许新用户在他们的机子上快速试用Linux而不用去格式化硬盘。Linux这种实时的特性为它的普及做出了巨大贡献。 - -![Image courtesy Fórum Internacional Software Live/Flickr](http://images.techhive.com/images/article/2015/07/lennart-100599356-orig.jpg) -Image courtesy [Fórum Internacional Software Live/Flickr][2] - -### Lennart Pottering ### - -Lennart Pottering is yet another genius from Germany. He has written so many core components of a Linux (as well as BSD) system that it’s hard to keep track. Most of his work is towards the successors of aging or broken components of the Linux systems. - -Pottering wrote the modern init system systemd, which shook the Linux world and created a [rift in the Debian community][3]. - -While Linus Torvalds has no problems with systemd, and praises it, he is not a huge fan of the way systemd developers (including the co-author Kay Sievers,) respond to bug reports and criticism. At one point Linus said on the LKML (Linux Kernel Mailing List) that he would [never work with Sievers][4]. - -Lennart is also the author of Pulseaudio, sound server on Linux and Avahi, zero-configuration networking (zeroconf) implementation. - -![Image courtesy Meego Com/Flickr](http://images.techhive.com/images/article/2015/07/jim-zemlin-100599362-orig.jpg) -Image courtesy [Meego Com/Flickr][5] - -### Jim Zemlin ### - -Jim Zemlin isn't a developer, but as founder of The Linux Foundation he is certainly one of the most important figures of the Linux world. - -In 2007, The Linux Foundation was formed as a result of merger between two open source bodies: the Free Standards Group and the Open Source Development Labs. Zemlin was the executive director of the Free Standards Group. Post-merger Zemlin became the executive director of The Linux Foundation and has held that position since. - -Under his leadership, The Linux Foundation has become the central figure in the modern IT world and plays a very critical role for the Linux ecosystem. In order to ensure that key developers like Torvalds and Kroah-Hartman can focus on Linux, the foundation sponsors them as fellows. - -Zemlin also made the foundation a bridge between companies so they can collaborate on Linux while at the same time competing in the market. The foundation also organizes many conferences around the world and [offers many courses for Linux developers][6]. - -People may think of Zemlin as Linus Torvalds' boss, but he refers to himself as "Linus Torvalds' janitor." - -![Image courtesy Coscup/Flickr](http://images.techhive.com/images/article/2015/07/greg-kh-100599350-orig.jpg) -Image courtesy [Coscup/Flickr][7] - -### Greg Kroah-Hartman ### - -Greg Kroah-Hartman is known as second-in-command of the Linux kernel. The ‘gentle giant’ is the maintainer of the stable branch of the kernel and of staging subsystem, USB, driver core, debugfs, kref, kobject, and the [sysfs][8] kernel subsystems along with many other components of a Linux system. - -He is also credited for device drivers for Linux. One of his jobs is to travel around the globe, meet hardware makers and persuade them to make their drivers available for Linux. The next time you plug some random USB device to your system and it works out of the box, thank Kroah-Hartman. (Don't thank the distro. Some distros try to take credit for the work Kroah-Hartman or the Linux kernel did.) - -Kroah-Hartman previously worked for Novell and then joined the Linux Foundation as a fellow, alongside Linus Torvalds. - -Kroah-Hartman is the total opposite of Linus and never rants (at least publicly). One time there was some ripple was when he stated that [Canonical doesn’t contribute much to the Linux kernel][9]. - -On a personal level, Kroah-Hartman is extremely helpful to new developers and users and is easily accessible. - -![Image courtesy Swapnil Bhartiya](http://images.techhive.com/images/article/2015/07/linus-swapnil-100599349-orig.jpg) -Image courtesy Swapnil Bhartiya - -### Linus Torvalds ### - -No collection of Linux heroes would be complete without Linus Torvalds. He is the author of the Linux kernel, the most used open source technology on the planet and beyond. His software powers everything from space stations to supercomputers, military drones to mobile devices and tiny smartwatches. Linus remains the authority on the Linux kernel and makes the final decision on which patches to merge to the kernel. - -Linux isn't Torvalds' only contribution open source. When he got fed-up with the existing software revision control systems, which his kernel heavily relied on, he wrote his own, called Git. Git enjoys the same reputation as Linux; it is the most used version control system in the world. - -Torvalds is also a passionate scuba diver and when he found no decent dive logs for Linux, he wrote his own and called it SubSurface. - -Torvalds is [well known for his rants][10] and once admitted that his ego is as big as a small planet. But he is also known for admitting his mistakes if he realizes he was wrong. - --------------------------------------------------------------------------------- - -via: http://www.itworld.com/article/2955001/linux/5-heros-of-the-linux-world.html - -作者:[Swapnil Bhartiya][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.itworld.com/author/Swapnil-Bhartiya/ -[1]:https://flic.kr/p/siJ25M -[2]:https://flic.kr/p/uTzj54 -[3]:http://www.itwire.com/business-it-news/open-source/66153-systemd-fallout-two-debian-technical-panel-members-resign -[4]:http://www.linuxveda.com/2014/04/04/linus-torvalds-systemd-kay-sievers/ -[5]:https://flic.kr/p/9Lnhpu -[6]:http://www.itworld.com/article/2951968/linux/linux-foundation-offers-cheaper-courses-and-certifications-for-india.html -[7]:https://flic.kr/p/hBv8Pp -[8]:https://en.wikipedia.org/wiki/Sysfs -[9]:https://www.youtube.com/watch?v=CyHAeGBFS8k -[10]:http://www.itworld.com/article/2873200/operating-systems/11-technologies-that-tick-off-linus-torvalds.html From 6aa59c9a58eb024b7cda8c6a1d0d8cc9afd66b07 Mon Sep 17 00:00:00 2001 From: struggling <630441839@qq.com> Date: Tue, 11 Aug 2015 10:17:19 +0800 Subject: [PATCH 880/965] Delete 20150803 Troubleshooting with Linux Logs.md --- ...0150803 Troubleshooting with Linux Logs.md | 117 ------------------ 1 file changed, 117 deletions(-) delete mode 100644 sources/tech/20150803 Troubleshooting with Linux Logs.md diff --git a/sources/tech/20150803 Troubleshooting with Linux Logs.md b/sources/tech/20150803 Troubleshooting with Linux Logs.md deleted file mode 100644 index 9ee0820a9c..0000000000 --- a/sources/tech/20150803 Troubleshooting with Linux Logs.md +++ /dev/null @@ -1,117 +0,0 @@ -translation by strugglingyouth -Troubleshooting with Linux Logs -================================================================================ -Troubleshooting is the main reason people create logs. Often you’ll want to diagnose why a problem happened with your Linux system or application. An error message or a sequence of events can give you clues to the root cause, indicate how to reproduce the issue, and point out ways to fix it. Here are a few use cases for things you might want to troubleshoot in your logs. - -### Cause of Login Failures ### - -If you want to check if your system is secure, you can check your authentication logs for failed login attempts and unfamiliar successes. Authentication failures occur when someone passes incorrect or otherwise invalid login credentials, often to ssh for remote access or su for local access to another user’s permissions. These are logged by the [pluggable authentication module][1], or pam for short. Look in your logs for strings like Failed password and user unknown. Successful authentication records include strings like Accepted password and session opened. - -Failure Examples: - - pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=10.0.2.2 - Failed password for invalid user hoover from 10.0.2.2 port 4791 ssh2 - pam_unix(sshd:auth): check pass; user unknown - PAM service(sshd) ignoring max retries; 6 > 3 - -Success Examples: - - Accepted password for hoover from 10.0.2.2 port 4792 ssh2 - pam_unix(sshd:session): session opened for user hoover by (uid=0) - pam_unix(sshd:session): session closed for user hoover - -You can use grep to find which users accounts have the most failed logins. These are the accounts that potential attackers are trying and failing to access. This example is for an Ubuntu system. - - $ grep "invalid user" /var/log/auth.log | cut -d ' ' -f 10 | sort | uniq -c | sort -nr - 23 oracle - 18 postgres - 17 nagios - 10 zabbix - 6 test - -You’ll need to write a different command for each application and message because there is no standard format. Log management systems that automatically parse logs will effectively normalize them and help you extract key fields like username. - -Log management systems can extract the usernames from your Linux logs using automated parsing. This lets you see an overview of the users and filter on them with a single click. In this example, we can see that the root user logged in over 2,700 times because we are filtering the logs to show login attempts only for the root user. - -![](http://www.loggly.com/ultimate-guide/wp-content/uploads/2015/05/Screen-Shot-2015-03-12-at-11.05.36-AM.png) - -Log management systems also let you view graphs over time to spot unusual trends. If someone had one or two failed logins within a few minutes, it might be that a real user forgot his or her password. However, if there are hundreds of failed logins or they are all different usernames, it’s more likely that someone is trying to attack the system. Here you can see that on March 12, someone tried to login as test and nagios several hundred times. This is clearly not a legitimate use of the system. - -![](http://www.loggly.com/ultimate-guide/wp-content/uploads/2015/05/Screen-Shot-2015-03-12-at-11.12.18-AM.png) - -### Cause of Reboots ### - -Sometimes a server can stop due to a system crash or reboot. How do you know when it happened and who did it? - -#### Shutdown Command #### - -If someone ran the shutdown command manually, you can see it in the auth log file. Here you can see that someone remotely logged in from the IP 50.0.134.125 as the user ubuntu and then shut the system down. - - Mar 19 18:36:41 ip-172-31-11-231 sshd[23437]: Accepted publickey for ubuntu from 50.0.134.125 port 52538 ssh - Mar 19 18:36:41 ip-172-31-11-231 23437]:sshd[ pam_unix(sshd:session): session opened for user ubuntu by (uid=0) - Mar 19 18:37:09 ip-172-31-11-231 sudo: ubuntu : TTY=pts/1 ; PWD=/home/ubuntu ; USER=root ; COMMAND=/sbin/shutdown -r now - -#### Kernel Initializing #### - -If you want to see when the server restarted regardless of reason (including crashes) you can search logs from the kernel initializing. You’d search for the facility kernel messages and Initializing cpu. - - Mar 19 18:39:30 ip-172-31-11-231 kernel: [ 0.000000] Initializing cgroup subsys cpuset - Mar 19 18:39:30 ip-172-31-11-231 kernel: [ 0.000000] Initializing cgroup subsys cpu - Mar 19 18:39:30 ip-172-31-11-231 kernel: [ 0.000000] Linux version 3.8.0-44-generic (buildd@tipua) (gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5) ) #66~precise1-Ubuntu SMP Tue Jul 15 04:01:04 UTC 2014 (Ubuntu 3.8.0-44.66~precise1-generic 3.8.13.25) - -### Detect Memory Problems ### - -There are lots of reasons a server might crash, but one common cause is running out of memory. - -When your system is low on memory, processes are killed, typically in the order of which ones will release the most resources. The error occurs when your system is using all of its memory and a new or existing process attempts to access additional memory. Look in your log files for strings like Out of Memory or for kernel warnings like to kill. These strings indicate that your system intentionally killed the process or application rather than allowing the process to crash. - -Examples: - - [33238.178288] Out of memory: Kill process 6230 (firefox) score 53 or sacrifice child - [29923450.995084] select 5230 (docker), adj 0, size 708, to kill - -You can find these logs using a tool like grep. This example is for Ubuntu: - - $ grep “Out of memory” /var/log/syslog - [33238.178288] Out of memory: Kill process 6230 (firefox) score 53 or sacrifice child - -Keep in mind that grep itself uses memory, so you might cause an out of memory error just by running grep. This is another reason it’s a fabulous idea to centralize your logs! - -### Log Cron Job Errors ### - -The cron daemon is a scheduler that runs processes at specified dates and times. If the process fails to run or fails to finish, then a cron error appears in your log files. You can find these files in /var/log/cron, /var/log/messages, and /var/log/syslog depending on your distribution. There are many reasons a cron job can fail. Usually the problems lie with the process rather than the cron daemon itself. - -By default, cron jobs output through email using Postfix. Here is a log showing that an email was sent. Unfortunately, you cannot see the contents of the message here. - - Mar 13 16:35:01 PSQ110 postfix/pickup[15158]: C3EDC5800B4: uid=1001 from= - Mar 13 16:35:01 PSQ110 postfix/cleanup[15727]: C3EDC5800B4: message-id=<20150310110501.C3EDC5800B4@PSQ110> - Mar 13 16:35:01 PSQ110 postfix/qmgr[15159]: C3EDC5800B4: from=, size=607, nrcpt=1 (queue active) - Mar 13 16:35:05 PSQ110 postfix/smtp[15729]: C3EDC5800B4: to=, relay=gmail-smtp-in.l.google.com[74.125.130.26]:25, delay=4.1, delays=0.26/0/2.2/1.7, dsn=2.0.0, status=sent (250 2.0.0 OK 1425985505 f16si501651pdj.5 - gsmtp) - -You should consider logging the cron standard output to help debug problems. Here is how you can redirect your cron standard output to syslog using the logger command. Replace the echo command with your own script and helloCron with whatever you want to set the appName to. - - */5 * * * * echo ‘Hello World’ 2>&1 | /usr/bin/logger -t helloCron - -Which creates the log entries: - - Apr 28 22:20:01 ip-172-31-11-231 CRON[15296]: (ubuntu) CMD (echo 'Hello World!' 2>&1 | /usr/bin/logger -t helloCron) - Apr 28 22:20:01 ip-172-31-11-231 helloCron: Hello World! - -Each cron job will log differently based on the specific type of job and how it outputs data. Hopefully there are clues to the root cause of problems within the logs, or you can add additional logging as needed. - --------------------------------------------------------------------------------- - -via: http://www.loggly.com/ultimate-guide/logging/troubleshooting-with-linux-logs/ - -作者:[Jason Skowronski][a1] -作者:[Amy Echeverri][a2] -作者:[Sadequl Hussain][a3] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a1]:https://www.linkedin.com/in/jasonskowronski -[a2]:https://www.linkedin.com/in/amyecheverri -[a3]:https://www.linkedin.com/pub/sadequl-hussain/14/711/1a7 -[1]:http://linux.die.net/man/8/pam.d From 55f5e577c8684ad955e5e189172343a6e316af6d Mon Sep 17 00:00:00 2001 From: struggling <630441839@qq.com> Date: Tue, 11 Aug 2015 10:18:16 +0800 Subject: [PATCH 881/965] Create 20150803 Troubleshooting with Linux Logs.md --- ...0150803 Troubleshooting with Linux Logs.md | 117 ++++++++++++++++++ 1 file changed, 117 insertions(+) create mode 100644 translated/tech/20150803 Troubleshooting with Linux Logs.md diff --git a/translated/tech/20150803 Troubleshooting with Linux Logs.md b/translated/tech/20150803 Troubleshooting with Linux Logs.md new file mode 100644 index 0000000000..5950a69d98 --- /dev/null +++ b/translated/tech/20150803 Troubleshooting with Linux Logs.md @@ -0,0 +1,117 @@ +在 Linux 中使用日志来排错 +================================================================================ +人们创建日志的主要原因是排错。通常你会诊断为什么问题发生在你的 Linux 系统或应用程序中。错误信息或一些列事件可以给你提供造成根本原因的线索,说明问题是如何发生的,并指出如何解决它。这里有几个使用日志来解决的样例。 + +### 登录失败原因 ### + +如果你想检查你的系统是否安全,你可以在验证日志中检查登录失败的和登录成功但可疑的用户。当有人通过不正当或无效的凭据来登录时会出现认证失败,经常使用 SSH 进行远程登录或 su 到本地其他用户来进行访问权。这些是由[插入式验证模块][1]来记录,或 PAM 进行短期记录。在你的日志中会看到像 Failed 这样的字符串密码和未知的用户。成功认证记录包括像 Accepted 这样的字符串密码并打开会话。 + +失败的例子: + + pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=10.0.2.2 + Failed password for invalid user hoover from 10.0.2.2 port 4791 ssh2 + pam_unix(sshd:auth): check pass; user unknown + PAM service(sshd) ignoring max retries; 6 > 3 + +成功的例子: + + Accepted password for hoover from 10.0.2.2 port 4792 ssh2 + pam_unix(sshd:session): session opened for user hoover by (uid=0) + pam_unix(sshd:session): session closed for user hoover + +你可以使用 grep 来查找哪些用户失败登录的次数最多。这些都是潜在的攻击者正在尝试和访问失败的账户。这是一个在 ubuntu 系统上的例子。 + + $ grep "invalid user" /var/log/auth.log | cut -d ' ' -f 10 | sort | uniq -c | sort -nr + 23 oracle + 18 postgres + 17 nagios + 10 zabbix + 6 test + +由于没有标准格式,所以你需要为每个应用程序的日志使用不同的命令。日志管理系统,可以自动分析日志,将它们有效的归类,帮助你提取关键字,如用户名。 + +日志管理系统可以使用自动解析功能从 Linux 日志中提取用户名。这使你可以看到用户的信息,并能单个的筛选。在这个例子中,我们可以看到,root 用户登录了 2700 次,因为我们筛选的日志显示尝试登录的只有 root 用户。 + +![](http://www.loggly.com/ultimate-guide/wp-content/uploads/2015/05/Screen-Shot-2015-03-12-at-11.05.36-AM.png) + +日志管理系统也让你以时间为做坐标轴的图标来查看使你更容易发现异常。如果有人在几分钟内登录失败一次或两次,它可能是一个真正的用户而忘记了密码。但是,如果有几百个失败的登录并且使用的都是不同的用户名,它更可能是在试图攻击系统。在这里,你可以看到在3月12日,有人试图登录 Nagios 几百次。这显然​​不是一个合法的系统用户。 + +![](http://www.loggly.com/ultimate-guide/wp-content/uploads/2015/05/Screen-Shot-2015-03-12-at-11.12.18-AM.png) + +### 重启的原因 ### + + +有时候,一台服务器由于系统崩溃或重启而宕机。你怎么知道它何时发生,是谁做的? + +#### 关机命令 #### + +如果有人手动运行 shutdown 命令,你可以看到它的身份在验证日志文件中。在这里,你可以看到,有人从 IP 50.0.134.125 上作为 ubuntu 的用户远程登录了,然后关闭了系统。 + + Mar 19 18:36:41 ip-172-31-11-231 sshd[23437]: Accepted publickey for ubuntu from 50.0.134.125 port 52538 ssh + Mar 19 18:36:41 ip-172-31-11-231 23437]:sshd[ pam_unix(sshd:session): session opened for user ubuntu by (uid=0) + Mar 19 18:37:09 ip-172-31-11-231 sudo: ubuntu : TTY=pts/1 ; PWD=/home/ubuntu ; USER=root ; COMMAND=/sbin/shutdown -r now + +#### 内核初始化 #### + +如果你想看看服务器重新启动的所有原因(包括崩溃),你可以从内核初始化日志中寻找。你需要搜索内核设施和初始化 cpu 的信息。 + + Mar 19 18:39:30 ip-172-31-11-231 kernel: [ 0.000000] Initializing cgroup subsys cpuset + Mar 19 18:39:30 ip-172-31-11-231 kernel: [ 0.000000] Initializing cgroup subsys cpu + Mar 19 18:39:30 ip-172-31-11-231 kernel: [ 0.000000] Linux version 3.8.0-44-generic (buildd@tipua) (gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5) ) #66~precise1-Ubuntu SMP Tue Jul 15 04:01:04 UTC 2014 (Ubuntu 3.8.0-44.66~precise1-generic 3.8.13.25) + +### 检测内存问题 ### + +有很多原因可能导致服务器崩溃,但一个普遍的原因是内存用尽。 + +当你系统的内存不足时,进程会被杀死,通常会杀死使用最多资源的进程。当系统正在使用的内存发生错误并且有新的或现有的进程试图使用更多的内存。在你的日志文件查找像 Out of Memory 这样的字符串,内核也会发出杀死进程的警告。这些信息表明系统故意杀死进程或应用程序,而不是允许进程崩溃。 + +例如: + + [33238.178288] Out of memory: Kill process 6230 (firefox) score 53 or sacrifice child + [29923450.995084] select 5230 (docker), adj 0, size 708, to kill + +你可以使用像 grep 这样的工具找到这些日志。这个例子是在 ubuntu 中: + + $ grep “Out of memory” /var/log/syslog + [33238.178288] Out of memory: Kill process 6230 (firefox) score 53 or sacrifice child + +请记住,grep 也要使用内存,所以导致内存不足的错误可能只是运行的 grep。这是另一个分析日志的独特方法! + +### 定时任务错误日志 ### + +cron 守护程序是一个调度器只在指定的日期和时间运行进程。如果进程运行失败或无法完成,那么 cron 的错误出现在你的日志文件中。你可以找到这些文件在 /var/log/cron,/var/log/messages,和 /var/log/syslog 中,具体取决于你的发行版。cron 任务失败原因有很多。通常情况下,问题出在进程中而不是 cron 守护进程本身。 + +默认情况下,cron 作业会通过电子邮件发送信息。这里是一个日志中记录的发送电子邮件的内容。不幸的是,你不能看到邮件的内容在这里。 + + Mar 13 16:35:01 PSQ110 postfix/pickup[15158]: C3EDC5800B4: uid=1001 from= + Mar 13 16:35:01 PSQ110 postfix/cleanup[15727]: C3EDC5800B4: message-id=<20150310110501.C3EDC5800B4@PSQ110> + Mar 13 16:35:01 PSQ110 postfix/qmgr[15159]: C3EDC5800B4: from=, size=607, nrcpt=1 (queue active) + Mar 13 16:35:05 PSQ110 postfix/smtp[15729]: C3EDC5800B4: to=, relay=gmail-smtp-in.l.google.com[74.125.130.26]:25, delay=4.1, delays=0.26/0/2.2/1.7, dsn=2.0.0, status=sent (250 2.0.0 OK 1425985505 f16si501651pdj.5 - gsmtp) + +你应该想想 cron 在日志中的标准输出以帮助你定位问题。这里展示你可以使用 logger 命令重定向 cron 标准输出到 syslog。用你的脚本来代替 echo 命令,helloCron 可以设置为任何你想要的应用程序的名字。 + + */5 * * * * echo ‘Hello World’ 2>&1 | /usr/bin/logger -t helloCron + +它创建的日志条目: + + Apr 28 22:20:01 ip-172-31-11-231 CRON[15296]: (ubuntu) CMD (echo 'Hello World!' 2>&1 | /usr/bin/logger -t helloCron) + Apr 28 22:20:01 ip-172-31-11-231 helloCron: Hello World! + +每个 cron 作业将根据作业的具体类型以及如何输出数据来记录不同的日志。希望在日志中有问题根源的线索,也可以根据需要添加额外的日志记录。 + +-------------------------------------------------------------------------------- + +via: http://www.loggly.com/ultimate-guide/logging/troubleshooting-with-linux-logs/ + +作者:[Jason Skowronski][a1] +作者:[Amy Echeverri][a2] +作者:[Sadequl Hussain][a3] +译者:[strugglingyouth](https://github.com/strugglingyouth) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a1]:https://www.linkedin.com/in/jasonskowronski +[a2]:https://www.linkedin.com/in/amyecheverri +[a3]:https://www.linkedin.com/pub/sadequl-hussain/14/711/1a7 +[1]:http://linux.die.net/man/8/pam.d From 1252e6195493dd66bcd0f314379c21c6547c5d7e Mon Sep 17 00:00:00 2001 From: ZTinoZ Date: Tue, 11 Aug 2015 10:28:42 +0800 Subject: [PATCH 882/965] Translating by ZTinoZ --- .../20150806 Installation Guide for Puppet on Ubuntu 15.04.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150806 Installation Guide for Puppet on Ubuntu 15.04.md b/sources/tech/20150806 Installation Guide for Puppet on Ubuntu 15.04.md index ea8fcd6e2e..501cb4a8dc 100644 --- a/sources/tech/20150806 Installation Guide for Puppet on Ubuntu 15.04.md +++ b/sources/tech/20150806 Installation Guide for Puppet on Ubuntu 15.04.md @@ -1,3 +1,4 @@ +Translating by ZTinoZ Installation Guide for Puppet on Ubuntu 15.04 ================================================================================ Hi everyone, today in this article we'll learn how to install puppet to manage your server infrastructure running ubuntu 15.04. Puppet is an open source software configuration management tool which is developed and maintained by Puppet Labs that allows us to automate the provisioning, configuration and management of a server infrastructure. Whether we're managing just a few servers or thousands of physical and virtual machines to orchestration and reporting, puppet automates tasks that system administrators often do manually which frees up time and mental space so sysadmins can work on improving other aspects of your overall setup. It ensures consistency, reliability and stability of the automated jobs processed. It facilitates closer collaboration between sysadmins and developers, enabling more efficient delivery of cleaner, better-designed code. Puppet is available in two solutions configuration management and data center automation. They are **puppet open source and puppet enterprise**. Puppet open source is a flexible, customizable solution available under the Apache 2.0 license, designed to help system administrators automate the many repetitive tasks they regularly perform. Whereas puppet enterprise edition is a proven commercial solution for diverse enterprise IT environments which lets us get all the benefits of open source puppet, plus puppet apps, commercial-only enhancements, supported modules and integrations, and the assurance of a fully supported platform. Puppet uses SSL certificates to authenticate communication between master and agent nodes. @@ -426,4 +427,4 @@ via: http://linoxide.com/linux-how-to/install-puppet-ubuntu-15-04/ 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 [a]:http://linoxide.com/author/arunp/ -[1]:https://docs.puppetlabs.com/puppet/latest/reference/config_file_main.html \ No newline at end of file +[1]:https://docs.puppetlabs.com/puppet/latest/reference/config_file_main.html From e0a4f5017065fd958548f89125c41bad72a7d550 Mon Sep 17 00:00:00 2001 From: DeadFire Date: Tue, 11 Aug 2015 10:37:03 +0800 Subject: [PATCH 883/965] =?UTF-8?q?20150811-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...Install Snort and Usage in Ubuntu 15.04.md | 203 ++++++++++++++++++ ...k files from Google Play Store on Linux.md | 99 +++++++++ 2 files changed, 302 insertions(+) create mode 100644 sources/tech/20150811 How to Install Snort and Usage in Ubuntu 15.04.md create mode 100644 sources/tech/20150811 How to download apk files from Google Play Store on Linux.md diff --git a/sources/tech/20150811 How to Install Snort and Usage in Ubuntu 15.04.md b/sources/tech/20150811 How to Install Snort and Usage in Ubuntu 15.04.md new file mode 100644 index 0000000000..7bf2438c95 --- /dev/null +++ b/sources/tech/20150811 How to Install Snort and Usage in Ubuntu 15.04.md @@ -0,0 +1,203 @@ +How to Install Snort and Usage in Ubuntu 15.04 +================================================================================ +Intrusion detection in a network is important for IT security. Intrusion Detection System used for the detection of illegal and malicious attempts in the network. Snort is well-known open source intrusion detection system. Web interface (Snorby) can be used for better analysis of alerts. Snort can be used as an intrusion prevention system with iptables/pf firewall. In this article, we will install and configure an open source IDS system snort. + +### Snort Installation ### + +#### Prerequisite #### + +Data Acquisition library (DAQ) is used by the snort for abstract calls to packet capture libraries. It is available on snort website. Downloading process is shown in the following screenshot. + +![downloading_daq](http://blog.linoxide.com/wp-content/uploads/2015/07/downloading_daq.png) + +Extract it and run ./configure, make and make install commands for DAQ installation. However, DAQ required other tools therefore ./configure script will generate following errors . + +flex and bison error + +![flexandbison_error](http://blog.linoxide.com/wp-content/uploads/2015/07/flexandbison_error.png) + +libpcap error. + +![libpcap error](http://blog.linoxide.com/wp-content/uploads/2015/07/libpcap-error.png) + +Therefore first install flex/bison and libcap before DAQ installation which is shown in the figure. + +![install_flex](http://blog.linoxide.com/wp-content/uploads/2015/07/install_flex.png) + +Installation of libpcap development library is shown below + +![libpcap-dev installation](http://blog.linoxide.com/wp-content/uploads/2015/07/libpcap-dev-installation.png) + +After installation of necessary tools, again run ./configure script which will show following output. + +![without_error_configure](http://blog.linoxide.com/wp-content/uploads/2015/07/without_error_configure.png) + +make and make install commands result is shown in the following screens. + +![make install](http://blog.linoxide.com/wp-content/uploads/2015/07/make-install.png) + +![make](http://blog.linoxide.com/wp-content/uploads/2015/07/make.png) + +After successful installation of DAQ, now we will install snort. Downloading using wget is shown in the below figure. + +![downloading_snort](http://blog.linoxide.com/wp-content/uploads/2015/07/downloading_snort.png) + +Extract compressed package using below given command. + + #tar -xvzf snort-2.9.7.3.tar.gz + +![snort_extraction](http://blog.linoxide.com/wp-content/uploads/2015/07/snort_extraction.png) + +Create installation directory and set prefix parameter in the configure script. It is also recommended to enable sourcefire flag for Packet Performance Monitoring (PPM). + + #mkdir /usr/local/snort + + #./configure --prefix=/usr/local/snort/ --enable-sourcefire + +![snort_installation](http://blog.linoxide.com/wp-content/uploads/2015/07/snort_installation.png) + +Configure script generates error due to missing libpcre-dev , libdumbnet-dev and zlib development libraries. + +error due to missing libpcre library. + +![pcre-error](http://blog.linoxide.com/wp-content/uploads/2015/07/pcre-error.png) + +error due to missing dnet (libdumbnet) library. + +![libdnt error](http://blog.linoxide.com/wp-content/uploads/2015/07/libdnt-error.png) + +configure script generate error due to missing zlib library. + +![zlib error](http://blog.linoxide.com/wp-content/uploads/2015/07/zlib-error.png) + +Installation of all required development libraries is shown in the next screenshots. + + # aptitude install libpcre3-dev + +![libpcre3-dev install](http://blog.linoxide.com/wp-content/uploads/2015/07/libpcre3-dev-install.png) + + # aptitude install libdumbnet-dev + +![libdumnet-dev installation](http://blog.linoxide.com/wp-content/uploads/2015/07/libdumnet-dev-installation.png) + + # aptitude install zlib1g-dev + +![zlibg-dev installation](http://blog.linoxide.com/wp-content/uploads/2015/07/zlibg-dev-installation.png) + +After installation of above required libraries for snort, again run the configure scripts without any error. + +Run make & make install commands for the compilation and installations of snort in /usr/local/snort directory. + + #make + +![make snort](http://blog.linoxide.com/wp-content/uploads/2015/07/make-snort.png) + + #make install + +![make install snort](http://blog.linoxide.com/wp-content/uploads/2015/07/make-install-snort.png) + +Finally snort running from /usr/local/snort/bin directory. Currently it is in promisc mode (packet dump mode) of all traffic on eth0 interface. + +![snort running](http://blog.linoxide.com/wp-content/uploads/2015/07/snort-running.png) + +Traffic dump by the snort interface is shown in following figure. + +![traffic](http://blog.linoxide.com/wp-content/uploads/2015/07/traffic1.png) + +#### Rules and Configuration of Snort #### + +Snort installation from source code required rules and configuration setting therefore now we will copy rules and configuration under /etc/snort directory. We have created single bash scripts for rules and configuration setting. It is used for following snort setting. + +- Creation of snort user for snort IDS service on linux. +- Creation of directories and files under /etc directory for snort configuration. +- Permission setting and copying data from etc directory of snort source code. +- Remove # (comment sign) from rules path in snort.conf file. + + #!/bin/bash##PATH of source code of snort + snort_src="/home/test/Downloads/snort-2.9.7.3" + echo "adding group and user for snort..." + groupadd snort &> /dev/null + useradd snort -r -s /sbin/nologin -d /var/log/snort -c snort_idps -g snort &> /dev/null#snort configuration + echo "Configuring snort..."mkdir -p /etc/snort + mkdir -p /etc/snort/rules + touch /etc/snort/rules/black_list.rules + touch /etc/snort/rules/white_list.rules + touch /etc/snort/rules/local.rules + mkdir /etc/snort/preproc_rules + mkdir /var/log/snort + mkdir -p /usr/local/lib/snort_dynamicrules + chmod -R 775 /etc/snort + chmod -R 775 /var/log/snort + chmod -R 775 /usr/local/lib/snort_dynamicrules + chown -R snort:snort /etc/snort + chown -R snort:snort /var/log/snort + chown -R snort:snort /usr/local/lib/snort_dynamicrules + ###copy configuration and rules from etc directory under source code of snort + echo "copying from snort source to /etc/snort ....." + echo $snort_src + echo "-------------" + cp $snort_src/etc/*.conf* /etc/snort + cp $snort_src/etc/*.map /etc/snort##enable rules + sed -i 's/include \$RULE\_PATH/#include \$RULE\_PATH/' /etc/snort/snort.conf + echo "---DONE---" + +Change the snort source directory in the script and run it. Following output appear in case of success. + +![running script](http://blog.linoxide.com/wp-content/uploads/2015/08/running_script.png) + +Above script copied following files/directories from snort source into /etc/snort configuration file. + +![files copied](http://blog.linoxide.com/wp-content/uploads/2015/08/created.png) + +Snort configuration file is very complex however following necessary changes are required in snort.conf for IDS proper working. + + ipvar HOME_NET 192.168.1.0/24 # LAN side + +---------- + + ipvar EXTERNAL_NET !$HOME_NET # WAN side + +![veriable set](http://blog.linoxide.com/wp-content/uploads/2015/08/12.png) + + var RULE_PATH /etc/snort/rules # snort signature path + var SO_RULE_PATH /etc/snort/so_rules #rules in shared libraries + var PREPROC_RULE_PATH /etc/snort/preproc_rules # Preproces path + var WHITE_LIST_PATH /etc/snort/rules # dont scan + var BLACK_LIST_PATH /etc/snort/rules # Must scan + +![main path](http://blog.linoxide.com/wp-content/uploads/2015/08/rule-path.png) + + include $RULE_PATH/local.rules # file for custom rules + +remove comment sign (#) from other rules such as ftp.rules,exploit.rules etc. + +![path rules](http://blog.linoxide.com/wp-content/uploads/2015/08/path-rules.png) + +Now [Download community][1] rules and extract under /etc/snort/rules directory. Enable community and emerging threats rules in snort.conf file. + +![wget_rules](http://blog.linoxide.com/wp-content/uploads/2015/08/wget_rules.png) + +![community rules](http://blog.linoxide.com/wp-content/uploads/2015/08/community-rules1.png) + +Run following command to test the configuration file after above mentioned changes. + + #snort -T -c /etc/snort/snort.conf + +![snort running](http://blog.linoxide.com/wp-content/uploads/2015/08/snort-final.png) + +### Conclusion ### + +In this article our focus was on the installation and configuration of an open source IDPS system snort on Ubuntu distribution. By default it is used for the monitoring of events however it can con configured inline mode for the protection of network. Snort rules can be tested and analysed in offline mode using pcap capture file. + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/security/install-snort-usage-ubuntu-15-04/ + +作者:[nido][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://linoxide.com/author/naveeda/ +[1]:https://www.snort.org/downloads/community/community-rules.tar.gz \ No newline at end of file diff --git a/sources/tech/20150811 How to download apk files from Google Play Store on Linux.md b/sources/tech/20150811 How to download apk files from Google Play Store on Linux.md new file mode 100644 index 0000000000..529e877d7b --- /dev/null +++ b/sources/tech/20150811 How to download apk files from Google Play Store on Linux.md @@ -0,0 +1,99 @@ +How to download apk files from Google Play Store on Linux +================================================================================ +Suppose you want to install an Android app on your Android device. However, for whatever reason, you cannot access Google Play Store on the Android device. What can you do then? One way to install the app without Google Play Store access is to download its APK file using some other means, and then [install the APK][1] file on the Android device manually. + +There are several ways to download official APK files from Google Play Store on non-Android devices such as regular computers and laptops. For example, there are browser plugins (e.g., for [Chrome][2] or [Firefox][3]) or online APK archives that allow you to download APK files using a web browser. If you do not trust these closed-source plugins or third-party APK repositories, there is yet another way to download official APK files manually, and that is via an open-source Linux app called [GooglePlayDownloader][4]. + +GooglePlayDownloader is a Python-based GUI application that enables you to search and download APK files from Google Play Store. Since this is completely open-source, you can be assured while using it. In this tutorial, I am going to show how to download an APK file from Google Play Store using GooglePlayDownloader in Linux environment. + +### Python requirement ### + +GooglePlayDownloader requires Python with SNI (Server Name Indication) support for SSL/TLS communication. This feature comes with Python 2.7.9 or higher. This leaves out older distributions such as Debian 7 Wheezy or earlier, Ubuntu 14.04 or earlier, or CentOS/RHEL 7 or earlier. Assuming that you have a Linux distribution with Python 2.7.9 or higher, proceed to install GooglePlayDownloader as follows. + +### Install GooglePlayDownloader on Ubuntu ### + +On Ubuntu, you can use the official deb build. One catch is that you may need to install one required dependency manually. + +#### On Ubuntu 14.10 #### + +Download [python-ndg-httpsclient][5] deb package, which is a missing dependency on older Ubuntu distributions. Also download GooglePlayDownloader's official deb package. + + $ wget http://mirrors.kernel.org/ubuntu/pool/main/n/ndg-httpsclient/python-ndg-httpsclient_0.3.2-1ubuntu4_all.deb + $ wget http://codingteam.net/project/googleplaydownloader/download/file/googleplaydownloader_1.7-1_all.deb + +We are going to use [gdebi command][6] to install those two deb files as follows. The gdebi command will automatically handle any other dependencies. + + $ sudo apt-get install gdebi-core + $ sudo gdebi python-ndg-httpsclient_0.3.2-1ubuntu4_all.deb + $ sudo gdebi googleplaydownloader_1.7-1_all.deb + +#### On Ubuntu 15.04 or later #### + +Recent Ubuntu distributions ship all required dependencies, and thus the installation is straightforward as follows. + + $ wget http://codingteam.net/project/googleplaydownloader/download/file/googleplaydownloader_1.7-1_all.deb + $ sudo apt-get install gdebi-core + $ sudo gdebi googleplaydownloader_1.7-1_all.deb + +### Install GooglePlayDownloader on Debian ### + +Due to its Python requirement, GooglePlayDownloader cannot be installed on Debian 7 Wheezy or earlier unless you upgrade its stock Python. + +#### On Debian 8 Jessie and higher: #### + + $ wget http://codingteam.net/project/googleplaydownloader/download/file/googleplaydownloader_1.7-1_all.deb + $ sudo apt-get install gdebi-core + $ sudo gdebi googleplaydownloader_1.7-1_all.deb + +### Install GooglePlayDownloader on Fedora ### + +Since GooglePlayDownloader was originally developed for Debian based distributions, you need to install it from the source if you want to use it on Fedora. + +First, install necessary dependencies. + + $ sudo yum install python-pyasn1 wxPython python-ndg_httpsclient protobuf-python python-requests + +Then install it as follows. + + $ wget http://codingteam.net/project/googleplaydownloader/download/file/googleplaydownloader_1.7.orig.tar.gz + $ tar -xvf googleplaydownloader_1.7.orig.tar.gz + $ cd googleplaydownloader-1.7 + $ chmod o+r -R . + $ sudo python setup.py install + $ sudo sh -c "echo 'python /usr/lib/python2.7/site-packages/googleplaydownloader-1.7-py2.7.egg/googleplaydownloader/googleplaydownloader.py' > /usr/bin/googleplaydownloader" + +### Download APK Files from Google Play Store with GooglePlayDownloader ### + +Once you installed GooglePlayDownloader, you can download APK files from Google Play Store as follows. + +First launch the app by typing: + + $ googleplaydownloader + +![](https://farm1.staticflickr.com/425/20229024898_105396fa68_b.jpg) + +At the search bar, type the name of the app you want to download from Google Play Store. + +![](https://farm1.staticflickr.com/503/20230360479_925f5da613_b.jpg) + +Once you find the app in the search list, choose the app, and click on "Download selected APK(s)" button. You will find the downloaded APK file in your home directory. Now you can move the APK file to the Android device of your choice, and install it manually. + +Hope this helps. + +-------------------------------------------------------------------------------- + +via: http://xmodulo.com/download-apk-files-google-play-store.html + +作者:[Dan Nanni][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://xmodulo.com/author/nanni +[1]:http://xmodulo.com/how-to-install-apk-file-on-android-phone-or-tablet.html +[2]:https://chrome.google.com/webstore/detail/apk-downloader/cgihflhdpokeobcfimliamffejfnmfii +[3]:https://addons.mozilla.org/en-us/firefox/addon/apk-downloader/ +[4]:http://codingteam.net/project/googleplaydownloader +[5]:http://packages.ubuntu.com/vivid/python-ndg-httpsclient +[6]:http://xmodulo.com/how-to-install-deb-file-with-dependencies.html \ No newline at end of file From 4f320ebb4d4b5982e931f6960e3c7fbd41219c2c Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 11 Aug 2015 10:41:56 +0800 Subject: [PATCH 884/965] PUB:20150806 Linux FAQs with Answers--How to install git on Linux @mr-ping --- ...Qs with Answers--How to install git on Linux.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) rename {translated/tech => published}/20150806 Linux FAQs with Answers--How to install git on Linux.md (66%) diff --git a/translated/tech/20150806 Linux FAQs with Answers--How to install git on Linux.md b/published/20150806 Linux FAQs with Answers--How to install git on Linux.md similarity index 66% rename from translated/tech/20150806 Linux FAQs with Answers--How to install git on Linux.md rename to published/20150806 Linux FAQs with Answers--How to install git on Linux.md index e6d3f59c71..1d30a02083 100644 --- a/translated/tech/20150806 Linux FAQs with Answers--How to install git on Linux.md +++ b/published/20150806 Linux FAQs with Answers--How to install git on Linux.md @@ -1,15 +1,15 @@ -Linux问答 -- 如何在Linux上安装Git +Linux有问必答:如何在Linux上安装Git ================================================================================ -> **问题:** 我尝试从一个Git公共仓库克隆项目,但出现了这样的错误提示:“git: command not found”。 请问我该如何安装Git? [注明一下是哪个Linux发行版]? +> **问题:** 我尝试从一个Git公共仓库克隆项目,但出现了这样的错误提示:“git: command not found”。 请问我该如何在某某发行版上安装Git? -Git是一个流行的并且开源的版本控制系统(VCS),最初是为Linux环境开发的。跟CVS或者SVN这些版本控制系统不同的是,Git的版本控制被认为是“分布式的”,某种意义上,git的本地工作目录可以作为一个功能完善的仓库来使用,它具备完整的历史记录和版本追踪能力。在这种工作模型之下,各个协作者将内容提交到他们的本地仓库中(与之相对的会直接提交到核心仓库),如果有必要,再有选择性地推送到核心仓库。这就为Git这个版本管理系统带来了大型协作系统所必须的可扩展能力和冗余能力。 +Git是一个流行的开源版本控制系统(VCS),最初是为Linux环境开发的。跟CVS或者SVN这些版本控制系统不同的是,Git的版本控制被认为是“分布式的”,某种意义上,git的本地工作目录可以作为一个功能完善的仓库来使用,它具备完整的历史记录和版本追踪能力。在这种工作模型之下,各个协作者将内容提交到他们的本地仓库中(与之相对的会总是提交到核心仓库),如果有必要,再有选择性地推送到核心仓库。这就为Git这个版本管理系统带来了大型协作系统所必须的可扩展能力和冗余能力。 ![](https://farm1.staticflickr.com/341/19433194168_c79d4570aa_b.jpg) ### 使用包管理器安装Git ### -Git已经被所有的主力Linux发行版所支持。所以安装它最简单的方法就是使用各个Linux发行版的包管理器。 +Git已经被所有的主流Linux发行版所支持。所以安装它最简单的方法就是使用各个Linux发行版的包管理器。 **Debian, Ubuntu, 或 Linux Mint** @@ -18,6 +18,8 @@ Git已经被所有的主力Linux发行版所支持。所以安装它最简单的 **Fedora, CentOS 或 RHEL** $ sudo yum install git + 或 + $ sudo dnf install git **Arch Linux** @@ -33,7 +35,7 @@ Git已经被所有的主力Linux发行版所支持。所以安装它最简单的 ### 从源码安装Git ### -如果由于某些原因,你希望从源码安装Git,安装如下介绍操作。 +如果由于某些原因,你希望从源码安装Git,按照如下介绍操作。 **安装依赖包** @@ -65,7 +67,7 @@ via: http://ask.xmodulo.com/install-git-linux.html 作者:[Dan Nanni][a] 译者:[mr-ping](https://github.com/mr-ping) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 3726bb850331c17fc57933c997ef739b8cfbb9a7 Mon Sep 17 00:00:00 2001 From: XIAOYU <1136299502@qq.com> Date: Tue, 11 Aug 2015 16:45:36 +0800 Subject: [PATCH 885/965] translated translated this article --- ...20150810 For Linux, Supercomputers R Us.md | 59 ++++++++++++++++++ ...20150810 For Linux, Supercomputers R Us.md | 60 ------------------- 2 files changed, 59 insertions(+), 60 deletions(-) create mode 100644 published/20150810 For Linux, Supercomputers R Us.md delete mode 100644 sources/talk/20150810 For Linux, Supercomputers R Us.md diff --git a/published/20150810 For Linux, Supercomputers R Us.md b/published/20150810 For Linux, Supercomputers R Us.md new file mode 100644 index 0000000000..ef9b32684c --- /dev/null +++ b/published/20150810 For Linux, Supercomputers R Us.md @@ -0,0 +1,59 @@ +Linux:我们最好用的超级计算机系统 +================================================================================ +![Credit: Michel Ngilen, CC BY 2.0, via Wikimedia Commons](http://images.techhive.com/images/article/2015/08/playstation_3-100602985-primary.idge.jpg) +首图来源:By Michel Ngilen,[ CC BY 2.0 ], via Wikimedia Commons + +> 几乎所有超级计算机上运行的系统都是Linux,其中包括那些由树莓派(Raspberry Pi)板和PlayStation 3游戏机板组成的计算机。 + +超级计算机是很正经的工具,目的是做严肃的计算。它们往往从事于严肃的追求,比如原子弹的模拟,气候模拟和高级物理学。当然,它们也需要大笔资金的投资。在最新的超级计算机[500强][1]排名中,中国国防科大研制的天河2号位居第一。天河2号耗资约3.9亿美元。 + +但是,也有一个超级计算机,是由博伊西州立大学电气和计算机工程系的一名在读博士Joshua Kiepert[用树莓派构建完成][2]的。其创建成本低于2000美元。 + +不,这不是我编造的。这是一个真实的超级计算机,由超频1GHz的[B型树莓派][3]ARM11处理器与VideoCore IV GPU组成。每个都配备了512MB的RAM,一对USB端口和1个10/100 BaseT以太网端口。 + +那么天河2号和博伊西州立大学的超级计算机有什么共同点?它们都运行Linux系统。世界最快的超级计算机[前500强中有486][4]个也同样运行的是Linux系统。这是20多年前就开始的一种覆盖。现在Linux开始建立于廉价的超级计算机。因为Kiepert的机器并不是唯一的预算数字计算机。 + +Gaurav Khanna,麻省大学达特茅斯分校的物理学副教授,创建了一台超级计算机仅用了[不足200的PlayStation3视频游戏机][5]。 + +PlayStation游戏机是由一个3.2 GHz的基于PowerPC的电源处理单元供电。每个都配有512M的RAM。你现在仍然可以花200美元买到一个,尽管索尼将在年底逐步淘汰它们。Khanna仅用16个PlayStation 3s构建了他第一台超级计算机,所以你也可以花费不到4000美元就拥有你自己的超级计算机。 + +这些机器可能是从玩具建成的,但他们不是玩具。Khanna已经用它做了严肃的天体物理学研究。一个白帽子黑客组织使用了类似的[PlayStation 3超级计算机在2008年破解了SSL的MD5哈希算法][6]。 + +两年后,美国空军研究实验室研制的[Condor Cluster,使用了1,760个索尼的PlayStation3的处理器][7]和168个通用的图形处理单元。这个低廉的超级计算机,每秒运行约500TFLOPs,或500万亿次浮点运算。 + +其他的一些便宜且适用于构建家庭超级计算机的构件包括,专业并行处理板比如信用卡大小[99美元的Parallella板][8],以及高端显卡比如[Nvidia的 Titan Z][9] 以及[ AMD的 FirePro W9100][10].这些高端主板市场零售价约3000美元,被一些[英特尔极限大师赛世界锦标赛英雄联盟参赛][11]玩家觊觎能够赢得的梦想的机器,c[传说][12]这项比赛第一名能获得超过10万美元奖金。另一方面,一个人能够独自提供超过2.5TFLOPS,并且他们为科学家和研究人员提供了一个经济的方法,使得他们拥有自己专属的超级计算机。 + +作为Linux的连接,这一切都开始于1994年戈达德航天中心的第一个名为[Beowulf超级计算机][13]。 + +按照我们的标准,Beowulf不能算是最优越的。但在那个时期,作为第一台自制的超级计算机,其16英特尔486DX处理器和10Mbps的以太网总线,是伟大的创举。由[美国航空航天局承包人Don Becker和Thomas Sterling设计的Beowulf][14],是第一个“制造者”超级计算机。它的“计算部件”486DX PCs,成本仅有几千美元。尽管它的速度只有一位数的浮点运算,[Beowulf][15]表明了你可以用商用现货(COTS)硬件和Linux创建超级计算机。 + +我真希望我参与创作了一部分,但是我1994年就离开了戈达德,开始了作为一名全职的科技记者的职业生涯。该死。 + +但是尽管我只是使用笔记本的记者,我依然能够体会到COTS和开源软件是如何永远的改变了超级计算机。我希望现在读这篇文章的你也能。因为,无论是Raspberry Pis集群,还是超过300万英特尔的Ivy Bridge和Xeon Phi芯片的庞然大物,几乎所有当代的超级计算机都可以追溯到Beowulf。 + +-------------------------------------------------------------------------------- + +via: + +作者:[Steven J. Vaughan-Nichols][a] +译者:[xiaoyu33](https://github.com/xiaoyu33) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.computerworld.com/author/Steven-J.-Vaughan_Nichols/ +[1]:http://www.top500.org/ +[2]:http://www.zdnet.com/article/build-your-own-supercomputer-out-of-raspberry-pi-boards/ +[3]:https://www.raspberrypi.org/products/model-b/ +[4]:http://www.zdnet.com/article/linux-still-rules-supercomputing/ +[5]:http://www.nytimes.com/2014/12/23/science/an-economical-way-to-save-progress.html?smid=fb-nytimes&smtyp=cur&bicmp=AD&bicmlukp=WT.mc_id&bicmst=1409232722000&bicmet=1419773522000&_r=4 +[6]:http://www.computerworld.com/article/2529932/cybercrime-hacking/researchers-hack-verisign-s-ssl-scheme-for-securing-web-sites.html +[7]:http://phys.org/news/2010-12-air-playstation-3s-supercomputer.html +[8]:http://www.zdnet.com/article/parallella-the-99-linux-supercomputer/ +[9]:http://blogs.nvidia.com/blog/2014/03/25/titan-z/ +[10]:http://www.amd.com/en-us/press-releases/Pages/amd-flagship-professional-2014apr7.aspx +[11]:http://en.intelextrememasters.com/news/check-out-the-intel-extreme-masters-katowice-prize-money-distribution/ +[12]:http://www.google.com/url?q=http%3A%2F%2Fen.intelextrememasters.com%2Fnews%2Fcheck-out-the-intel-extreme-masters-katowice-prize-money-distribution%2F&sa=D&sntz=1&usg=AFQjCNE6yoAGGz-Hpi2tPF4gdhuPBEckhQ +[13]:http://www.beowulf.org/overview/history.html +[14]:http://yclept.ucdavis.edu/Beowulf/aboutbeowulf.html +[15]:http://www.beowulf.org/ diff --git a/sources/talk/20150810 For Linux, Supercomputers R Us.md b/sources/talk/20150810 For Linux, Supercomputers R Us.md deleted file mode 100644 index 8f7302cca1..0000000000 --- a/sources/talk/20150810 For Linux, Supercomputers R Us.md +++ /dev/null @@ -1,60 +0,0 @@ -Translating by xiaoyu33 -For Linux, Supercomputers R Us -================================================================================ -![Credit: Michel Ngilen, CC BY 2.0, via Wikimedia Commons](http://images.techhive.com/images/article/2015/08/playstation_3-100602985-primary.idge.jpg) -Credit: Michel Ngilen, CC BY 2.0, via Wikimedia Commons - -> Almost all supercomputers run Linux, including the ones built from Raspberry Pi boards and PlayStation 3 game consoles - -Supercomputers are serious things, called on to do serious computing. They tend to be engaged in serious pursuits like atomic bomb simulations, climate modeling and high-level physics. Naturally, they cost serious money. At the very top of the latest [Top500][1] supercomputer ranking is the Tianhe-2 supercomputer at China’s National University of Defense Technology. It cost about $390 million to build. - -But then there’s the supercomputer that Joshua Kiepert, a doctoral student at Boise State’s Electrical and Computer Engineering department, [created with Raspberry Pi computers][2].It cost less than $2,000. - -No, I’m not making that up. It’s an honest-to-goodness supercomputer made from overclocked 1-GHz [Model B Raspberry Pi][3] ARM11 processors with Videocore IV GPUs. Each one comes with 512MB of RAM, a pair of USB ports and a 10/100 BaseT Ethernet port. - -And what do the Tianhe-2 and the Boise State supercomputer have in common? They both run Linux. As do [486 out of the world’s fastest 500 supercomputers][4]. It’s part of a domination of the category that began over 20 years ago. And now it’s trickling down to built-on-the-cheap supercomputers. Because Kiepert’s machine isn’t the only budget number cruncher out there. - -Gaurav Khanna, an associate professor of physics at the University of Massachusetts Dartmouth, created a [supercomputer with something shy of 200 PlayStation 3 video game consoles][5]. - -The PlayStations are powered by a 3.2-GHz PowerPC-based Power Processing Element. Each comes with 512MB of RAM. You can still buy one, although Sony will be phasing them out by year’s end, for just over $200. Khanna started with only 16 PlayStation 3s for his first supercomputer, so you too could put a supercomputer on your credit card for less than four grand. - -These machines may be built from toys, but they’re not playthings. Khanna has done serious astrophysics on his rig. A white-hat hacking group used a similar [PlayStation 3 supercomputer in 2008 to crack the SSL MD5 hashing algorithm][6] in 2008. - -Two years later, the Air Force Research Laboratory [Condor Cluster was using 1,760 Sony PlayStation 3 processors][7] and 168 general-purpose graphical processing units. This bargain-basement supercomputer runs at about 500TFLOPs, or 500 trillion floating point operations per second. - -Other cheap options for home supercomputers include specialist parallel-processing boards such as the [$99 credit-card-sized Parallella board][8], and high-end graphics boards such as [Nvidia’s Titan Z][9] and [AMD’s FirePro W9100][10]. Those high-end boards, coveted by gamers with visions of a dream machine or even a chance at winning the first-place prize of over $100,000 in the [Intel Extreme Masters World Championship League of][11] [Legends][12], cost considerably more, retailing for about $3,000. On the other hand, a single one can deliver over 2.5TFLOPS all by itself, and for scientists and researchers, they offer an affordable way to get a supercomputer they can call their own. - -As for the Linux connection, that all started in 1994 at the Goddard Space Flight Center with the first [Beowulf supercomputer][13]. - -By our standards, there wasn’t much that was super about the first Beowulf. But in its day, the first homemade supercomputer, with its 16 Intel 486DX processors and 10Mbps Ethernet for the bus, was great. [Beowulf, designed by NASA contractors Don Becker and Thomas Sterling][14], was the first “maker” supercomputer. Its “compute components,” 486DX PCs, cost only a few thousand dollars. While its speed was only in single-digit gigaflops, [Beowulf][15] showed you could build supercomputers from commercial off-the-shelf (COTS) hardware and Linux. - -I wish I’d had a part in its creation, but I’d already left Goddard by 1994 for a career as a full-time technology journalist. Darn it! - -But even from this side of my reporter’s notebook, I can still appreciate how COTS and open-source software changed supercomputing forever. I hope you can too. Because, whether it’s a cluster of Raspberry Pis or a monster with over 3 million Intel Ivy Bridge and Xeon Phi chips, almost all of today’s supercomputers trace their ancestry to Beowulf. - --------------------------------------------------------------------------------- - -via: - -作者:[Steven J. Vaughan-Nichols][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.computerworld.com/author/Steven-J.-Vaughan_Nichols/ -[1]:http://www.top500.org/ -[2]:http://www.zdnet.com/article/build-your-own-supercomputer-out-of-raspberry-pi-boards/ -[3]:https://www.raspberrypi.org/products/model-b/ -[4]:http://www.zdnet.com/article/linux-still-rules-supercomputing/ -[5]:http://www.nytimes.com/2014/12/23/science/an-economical-way-to-save-progress.html?smid=fb-nytimes&smtyp=cur&bicmp=AD&bicmlukp=WT.mc_id&bicmst=1409232722000&bicmet=1419773522000&_r=4 -[6]:http://www.computerworld.com/article/2529932/cybercrime-hacking/researchers-hack-verisign-s-ssl-scheme-for-securing-web-sites.html -[7]:http://phys.org/news/2010-12-air-playstation-3s-supercomputer.html -[8]:http://www.zdnet.com/article/parallella-the-99-linux-supercomputer/ -[9]:http://blogs.nvidia.com/blog/2014/03/25/titan-z/ -[10]:http://www.amd.com/en-us/press-releases/Pages/amd-flagship-professional-2014apr7.aspx -[11]:http://en.intelextrememasters.com/news/check-out-the-intel-extreme-masters-katowice-prize-money-distribution/ -[12]:http://www.google.com/url?q=http%3A%2F%2Fen.intelextrememasters.com%2Fnews%2Fcheck-out-the-intel-extreme-masters-katowice-prize-money-distribution%2F&sa=D&sntz=1&usg=AFQjCNE6yoAGGz-Hpi2tPF4gdhuPBEckhQ -[13]:http://www.beowulf.org/overview/history.html -[14]:http://yclept.ucdavis.edu/Beowulf/aboutbeowulf.html -[15]:http://www.beowulf.org/ From 0584a85ed9e385ce4967c0563afe1e586c995144 Mon Sep 17 00:00:00 2001 From: XIAOYU <1136299502@qq.com> Date: Tue, 11 Aug 2015 16:47:43 +0800 Subject: [PATCH 886/965] translated translated --- published/20150810 For Linux, Supercomputers R Us.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/published/20150810 For Linux, Supercomputers R Us.md b/published/20150810 For Linux, Supercomputers R Us.md index ef9b32684c..e5022a658f 100644 --- a/published/20150810 For Linux, Supercomputers R Us.md +++ b/published/20150810 For Linux, Supercomputers R Us.md @@ -1,4 +1,4 @@ -Linux:我们最好用的超级计算机系统 +Linux:称霸超级计算机系统 ================================================================================ ![Credit: Michel Ngilen, CC BY 2.0, via Wikimedia Commons](http://images.techhive.com/images/article/2015/08/playstation_3-100602985-primary.idge.jpg) 首图来源:By Michel Ngilen,[ CC BY 2.0 ], via Wikimedia Commons From b0b4e31da96977b4d3a15eb0d978e2d06db2df13 Mon Sep 17 00:00:00 2001 From: XIAOYU <1136299502@qq.com> Date: Tue, 11 Aug 2015 16:56:12 +0800 Subject: [PATCH 887/965] Rename published/20150810 For Linux, Supercomputers R Us.md to translated/talk/20150810 For Linux, Supercomputers R Us.md --- .../talk}/20150810 For Linux, Supercomputers R Us.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {published => translated/talk}/20150810 For Linux, Supercomputers R Us.md (100%) diff --git a/published/20150810 For Linux, Supercomputers R Us.md b/translated/talk/20150810 For Linux, Supercomputers R Us.md similarity index 100% rename from published/20150810 For Linux, Supercomputers R Us.md rename to translated/talk/20150810 For Linux, Supercomputers R Us.md From b8f075d64a773a10553643568f5dde7b83a4d290 Mon Sep 17 00:00:00 2001 From: Chang Liu Date: Tue, 11 Aug 2015 20:15:34 +0800 Subject: [PATCH 888/965] [Translated]RHCSA Series--Part 04--Editing Text Files with Nano and Vim or Analyzing text with grep and regexps.md --- ...or Analyzing text with grep and regexps.md | 256 ----------------- ...or Analyzing text with grep and regexps.md | 258 ++++++++++++++++++ 2 files changed, 258 insertions(+), 256 deletions(-) delete mode 100644 sources/tech/RHCSA Series/RHCSA Series--Part 04--Editing Text Files with Nano and Vim or Analyzing text with grep and regexps.md create mode 100644 translated/tech/RHCSA/RHCSA Series--Part 04--Editing Text Files with Nano and Vim or Analyzing text with grep and regexps.md diff --git a/sources/tech/RHCSA Series/RHCSA Series--Part 04--Editing Text Files with Nano and Vim or Analyzing text with grep and regexps.md b/sources/tech/RHCSA Series/RHCSA Series--Part 04--Editing Text Files with Nano and Vim or Analyzing text with grep and regexps.md deleted file mode 100644 index f3de8528fc..0000000000 --- a/sources/tech/RHCSA Series/RHCSA Series--Part 04--Editing Text Files with Nano and Vim or Analyzing text with grep and regexps.md +++ /dev/null @@ -1,256 +0,0 @@ -FSSlc translating - -RHCSA Series: Editing Text Files with Nano and Vim / Analyzing text with grep and regexps – Part 4 -================================================================================ -Every system administrator has to deal with text files as part of his daily responsibilities. That includes editing existing files (most likely configuration files), or creating new ones. It has been said that if you want to start a holy war in the Linux world, you can ask sysadmins what their favorite text editor is and why. We are not going to do that in this article, but will present a few tips that will be helpful to use two of the most widely used text editors in RHEL 7: nano (due to its simplicity and easiness of use, specially to new users), and vi/m (due to its several features that convert it into more than a simple editor). I am sure that you can find many more reasons to use one or the other, or perhaps some other editor such as emacs or pico. It’s entirely up to you. - -![Learn Nano and vi Editors](http://www.tecmint.com/wp-content/uploads/2015/03/Learn-Nano-and-vi-Editors.png) - -RHCSA: Editing Text Files with Nano and Vim – Part 4 - -### Editing Files with Nano Editor ### - -To launch nano, you can either just type nano at the command prompt, optionally followed by a filename (in this case, if the file exists, it will be opened in edition mode). If the file does not exist, or if we omit the filename, nano will also be opened in edition mode but will present a blank screen for us to start typing: - -![Nano Editor](http://www.tecmint.com/wp-content/uploads/2015/03/Nano-Editor.png) - -Nano Editor - -As you can see in the previous image, nano displays at the bottom of the screen several functions that are available via the indicated shortcuts (^, aka caret, indicates the Ctrl key). To name a few of them: - -- Ctrl + G: brings up the help menu with a complete list of functions and descriptions:Ctrl + X: exits the current file. If changes have not been saved, they are discarded. -- Ctrl + R: lets you choose a file to insert its contents into the present file by specifying a full path. - -![Nano Editor Help Menu](http://www.tecmint.com/wp-content/uploads/2015/03/Nano-Help.png) - -Nano Editor Help Menu - -- Ctrl + O: saves changes made to a file. It will let you save the file with the same name or a different one. Then press Enter to confirm. - -![Nano Editor Save Changes Mode](http://www.tecmint.com/wp-content/uploads/2015/03/Nano-Save-Changes.png) - -Nano Editor Save Changes Mode - -- Ctrl + X: exits the current file. If changes have not been saved, they are discarded. -- Ctrl + R: lets you choose a file to insert its contents into the present file by specifying a full path. - -![Nano: Insert File Content to Parent File](http://www.tecmint.com/wp-content/uploads/2015/03/Insert-File-Content.png) - -Nano: Insert File Content to Parent File - -will insert the contents of /etc/passwd into the current file. - -- Ctrl + K: cuts the current line. -- Ctrl + U: paste. -- Ctrl + C: cancels the current operation and places you at the previous screen. - -To easily navigate the opened file, nano provides the following features: - -- Ctrl + F and Ctrl + B move the cursor forward or backward, whereas Ctrl + P and Ctrl + N move it up or down one line at a time, respectively, just like the arrow keys. -- Ctrl + space and Alt + space move the cursor forward and backward one word at a time. - -Finally, - -- Ctrl + _ (underscore) and then entering X,Y will take you precisely to Line X, column Y, if you want to place the cursor at a specific place in the document. - -![Navigate to Line Numbers in Nano](http://www.tecmint.com/wp-content/uploads/2015/03/Column-Numbers.png) - -Navigate to Line Numbers in Nano - -The example above will take you to line 15, column 14 in the current document. - -If you can recall your early Linux days, specially if you came from Windows, you will probably agree that starting off with nano is the best way to go for a new user. - -### Editing Files with Vim Editor ### - -Vim is an improved version of vi, a famous text editor in Linux that is available on all POSIX-compliant *nix systems, such as RHEL 7. If you have the chance and can install vim, go ahead; if not, most (if not all) the tips given in this article should also work. - -One of vim’s distinguishing features is the different modes in which it operates: - - -- Command mode will allow you to browse through the file and enter commands, which are brief and case-sensitive combinations of one or more letters. If you need to repeat one of them a certain number of times, you can prefix it with a number (there are only a few exceptions to this rule). For example, yy (or Y, short for yank) copies the entire current line, whereas 4yy (or 4Y) copies the entire current line along with the next three lines (4 lines in total). -- In ex mode, you can manipulate files (including saving a current file and running outside programs or commands). To enter ex mode, we must type a colon (:) starting from command mode (or in other words, Esc + :), directly followed by the name of the ex-mode command that you want to use. -- In insert mode, which is accessed by typing the letter i, we simply enter text. Most keystrokes result in text appearing on the screen. -- We can always enter command mode (regardless of the mode we’re working on) by pressing the Esc key. - -Let’s see how we can perform the same operations that we outlined for nano in the previous section, but now with vim. Don’t forget to hit the Enter key to confirm the vim command! - -To access vim’s full manual from the command line, type :help while in command mode and then press Enter: - -![vim Edito Help Menu](http://www.tecmint.com/wp-content/uploads/2015/03/vim-Help-Menu.png) - -vim Edito Help Menu - -The upper section presents an index list of contents, with defined sections dedicated to specific topics about vim. To navigate to a section, place the cursor over it and press Ctrl + ] (closing square bracket). Note that the bottom section displays the current file. - -1. To save changes made to a file, run any of the following commands from command mode and it will do the trick: - - :wq! - :x! - ZZ (yes, double Z without the colon at the beginning) - -2. To exit discarding changes, use :q!. This command will also allow you to exit the help menu described above, and return to the current file in command mode. - -3. Cut N number of lines: type Ndd while in command mode. - -4. Copy M number of lines: type Myy while in command mode. - -5. Paste lines that were previously cutted or copied: press the P key while in command mode. - -6. To insert the contents of another file into the current one: - - :r filename - -For example, to insert the contents of `/etc/fstab`, do: - -![Insert Content of File in vi Editor](http://www.tecmint.com/wp-content/uploads/2015/03/Insert-Content-vi-Editor.png) - -Insert Content of File in vi Editor - -7. To insert the output of a command into the current document: - - :r! command - -For example, to insert the date and time in the line below the current position of the cursor: - -![Insert Time an Date in vi Editor](http://www.tecmint.com/wp-content/uploads/2015/03/Insert-Time-and-Date-in-vi-Editor.png) - -Insert Time an Date in vi Editor - -In another article that I wrote for, ([Part 2 of the LFCS series][1]), I explained in greater detail the keyboard shortcuts and functions available in vim. You may want to refer to that tutorial for further examples on how to use this powerful text editor. - -### Analyzing Text with Grep and Regular Expressions ### - -By now you have learned how to create and edit files using nano or vim. Say you become a text editor ninja, so to speak – now what? Among other things, you will also need how to search for regular expressions inside text. - -A regular expression (also known as “regex” or “regexp“) is a way of identifying a text string or pattern so that a program can compare the pattern against arbitrary text strings. Although the use of regular expressions along with grep would deserve an entire article on its own, let us review the basics here: - -**1. The simplest regular expression is an alphanumeric string (i.e., the word “svm”) or two (when two are present, you can use the | (OR) operator):** - - # grep -Ei 'svm|vmx' /proc/cpuinfo - -The presence of either of those two strings indicate that your processor supports virtualization: - -![Regular Expression Example](http://www.tecmint.com/wp-content/uploads/2015/03/Regular-Expression-Example.png) - -Regular Expression Example - -**2. A second kind of a regular expression is a range list, enclosed between square brackets.** - -For example, `c[aeiou]t` matches the strings cat, cet, cit, cot, and cut, whereas `[a-z]` and `[0-9]` match any lowercase letter or decimal digit, respectively. If you want to repeat the regular expression X certain number of times, type `{X}` immediately following the regexp. - -For example, let’s extract the UUIDs of storage devices from `/etc/fstab`: - - # grep -Ei '[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}' -o /etc/fstab - -![Extract String from a File in Linux](http://www.tecmint.com/wp-content/uploads/2015/03/Extract-String-from-a-File.png) - -Extract String from a File - -The first expression in brackets `[0-9a-f]` is used to denote lowercase hexadecimal characters, and `{8}` is a quantifier that indicates the number of times that the preceding match should be repeated (the first sequence of characters in an UUID is a 8-character long hexadecimal string). - -The parentheses, the `{4}` quantifier, and the hyphen indicate that the next sequence is a 4-character long hexadecimal string, and the quantifier that follows `({3})` denote that the expression should be repeated 3 times. - -Finally, the last sequence of 12-character long hexadecimal string in the UUID is retrieved with `[0-9a-f]{12}`, and the -o option prints only the matched (non-empty) parts of the matching line in /etc/fstab. - -**3. POSIX character classes.** - -注:表格 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Character ClassMatches…
 [[:alnum:]] Any alphanumeric [a-zA-Z0-9] character
 [[:alpha:]] Any alphabetic [a-zA-Z] character
 [[:blank:]] Spaces or tabs
 [[:cntrl:]] Any control characters (ASCII 0 to 32)
 [[:digit:]] Any numeric digits [0-9]
 [[:graph:]] Any visible characters
 [[:lower:]] Any lowercase [a-z] character
 [[:print:]] Any non-control characters
 [[:space:]] Any whitespace
 [[:punct:]] Any punctuation marks
 [[:upper:]] Any uppercase [A-Z] character
 [[:xdigit:]] Any hex digits [0-9a-fA-F]
 [:word:] Any letters, numbers, and underscores [a-zA-Z0-9_]
- -For example, we may be interested in finding out what the used UIDs and GIDs (refer to [Part 2][2] of this series to refresh your memory) are for real users that have been added to our system. Thus, we will search for sequences of 4 digits in /etc/passwd: - - # grep -Ei [[:digit:]]{4} /etc/passwd - -![Search For a String in File](http://www.tecmint.com/wp-content/uploads/2015/03/Search-For-String-in-File.png) - -Search For a String in File - -The above example may not be the best case of use of regular expressions in the real world, but it clearly illustrates how to use POSIX character classes to analyze text along with grep. - -### Conclusion ### - -In this article we have provided some tips to make the most of nano and vim, two text editors for the command-line users. Both tools are supported by extensive documentation, which you can consult in their respective official web sites (links given below) and using the suggestions given in [Part 1][3] of this series. - -#### Reference Links #### - -- [http://www.nano-editor.org/][4] -- [http://www.vim.org/][5] - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/rhcsa-exam-how-to-use-nano-vi-editors/ - -作者:[Gabriel Cánepa][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.tecmint.com/author/gacanepa/ -[1]:http://www.tecmint.com/vi-editor-usage/ -[2]:http://www.tecmint.com/file-and-directory-management-in-linux/ -[3]:http://www.tecmint.com/rhcsa-exam-reviewing-essential-commands-system-documentation/ -[4]:http://www.nano-editor.org/ -[5]:http://www.vim.org/ diff --git a/translated/tech/RHCSA/RHCSA Series--Part 04--Editing Text Files with Nano and Vim or Analyzing text with grep and regexps.md b/translated/tech/RHCSA/RHCSA Series--Part 04--Editing Text Files with Nano and Vim or Analyzing text with grep and regexps.md new file mode 100644 index 0000000000..8438ec0351 --- /dev/null +++ b/translated/tech/RHCSA/RHCSA Series--Part 04--Editing Text Files with Nano and Vim or Analyzing text with grep and regexps.md @@ -0,0 +1,258 @@ +RHCSA 系列:使用 Nano 和 Vim 编辑文本文件/使用 grep 和 regexps 分析文本 – Part 4 +================================================================================ +作为系统管理员的日常职责的一部分,每个系统管理员都必须处理文本文件,这包括编辑现存文件(大多可能是配置文件),或创建新的文件。有这样一个说法,假如你想在 Linux 世界中挑起一场圣战,你可以询问系统管理员们,什么是他们最喜爱的编辑器以及为什么。在这篇文章中,我们并不打算那样做,但我们将向你呈现一些技巧,这些技巧对使用两款在 RHEL 7 中最为常用的文本编辑器: nano(由于其简单和易用,特别是对于新手来说) 和 vi/m(由于其自身的几个特色使得它不仅仅是一个简单的编辑器)来说都大有裨益。我确信你可以找到更多的理由来使用其中的一个或另一个,或许其他的一些编辑器如 emacs 或 pico。这完全取决于你。 + +![学习 Nano 和 vi 编辑器](http://www.tecmint.com/wp-content/uploads/2015/03/Learn-Nano-and-vi-Editors.png) + +RHCSA: 使用 Nano 和 Vim 编辑文本文件 – Part 4 + +### 使用 Nano 编辑器来编辑文件 ### + +要启动 nano,你可以在命令提示符下输入 `nano`,或选择性地跟上一个文件名(在这种情况下,若文件存在,它将在编辑模式中被打开)。若文件不存在,或我们省略了文件名, nano 也将在 编辑模式下开启,但将为我们开启一个空白屏以便开始输入: + +![Nano 编辑器](http://www.tecmint.com/wp-content/uploads/2015/03/Nano-Editor.png) + +Nano 编辑器 + +正如你在上一张图片中所见的那样, nano 在屏幕的底部呈现出一些功能,它们可以通过暗指的快捷键来触发(^,即插入记号,代指 Ctrl 键)。它们中的一些是: + +- Ctrl + G: 触发一个帮助菜单,带有一个关于功能和相应的描述的完整列表; +- Ctrl + X: 离开当前文件,假如更改没有被保存,则它们将被丢弃; +- Ctrl + R: 通过指定一个完整的文件路径,让你选择一个文件来将该文件的内容插入到当前文件中; + +![Nano 编辑器帮助菜单](http://www.tecmint.com/wp-content/uploads/2015/03/Nano-Help.png) + +Nano 编辑器帮助菜单 + +- Ctrl + O: 保存更改到一个文件。它将让你用一个与源文件相同或不同的名称来保存该文件,然后按 Enter 键来确认。 + +![Nano 编辑器保存更改模式](http://www.tecmint.com/wp-content/uploads/2015/03/Nano-Save-Changes.png) + +Nano 编辑器的保存更改模式 + +- Ctrl + X: 离开当前文件,假如更改没有被保存,则它们将被丢弃; +- Ctrl + R: 通过指定一个完整的文件路径,让你选择一个文件来将该文件的内容插入到当前文件中; + +![Nano: 插入文件内容到主文件中](http://www.tecmint.com/wp-content/uploads/2015/03/Insert-File-Content.png) + +Nano: 插入文件内容到主文件中 + +上图的操作将把 `/etc/passwd` 的内容插入到当前文件中。 + +- Ctrl + K: 剪切当前行; +- Ctrl + U: 粘贴; +- Ctrl + C: 取消当前的操作并返回先前的屏幕; + +为了轻松地在打开的文件中浏览, nano 提供了下面的功能: + +- Ctrl + F 和 Ctrl + B 分别先前或向后移动光标;而 Ctrl + P 和 Ctrl + N 则分别向上或向下移动一行,功能与箭头键相同; +- Ctrl + space 和 Alt + space 分别向前或向后移动一个单词; + +最后, + +- 假如你想将光标移动到文档中的特定位置,使用 Ctrl + _ (下划线) 并接着输入 X,Y 将准确地带你到 第 X 行,第 Y 列。 + +![在 nano 中定位到具体的行,列](http://www.tecmint.com/wp-content/uploads/2015/03/Column-Numbers.png) + +在 nano 中定位到具体的行和列 + +上面的例子将带你到当前文档的第 15 行,第 14 列。 + +假如你可以回忆起你早期的 Linux 岁月,特别是当你刚从 Windows 迁移到 Linux 中,你就可能会同意:对于一个新手来说,使用 nano 来开始学习是最好的方式。 + +### 使用 Vim 编辑器来编辑文件 ### + + +Vim 是 vi 的加强版本,它是 Linux 中一个著名的文本编辑器,可在所有兼容 POSIX 的 *nix 系统中获取到,例如在 RHEL 7 中。假如你有机会并可以安装 Vim,请继续;假如不能,这篇文章中的大多数(若不是全部)的提示也应该可以正常工作。 + +Vim 的一个出众的特点是可以在多个不同的模式中进行操作: + +- 命令模式将允许你在文件中跳转和输入命令,这些命令是由一个或多个字母组成的简洁且对大小写敏感的组合。假如你想重复执行某个命令特定次,你可以在这个命令前加上需要重复的次数(这个规则只有极少数例外)。例如, yy(或 Y,yank 的缩写)可以复制整个当前行,而 4yy(或 4Y)则复制整个当前行到接着的 3 行(总共 4 行)。 +- 在 ex 模式中,你可以操作文件(包括保存当前文件和运行外部的程序或命令)。要进入 ex 模式,你必须在命令模式前(或其他词前,Esc + :)输入一个冒号(:),再直接跟上你想使用的 ex 模式命令的名称。 +- 对于插入模式,可以输入字母 i 进入,我们只需要输入文字即可。大多数的键击结果都将出现在屏幕中的文本中。 +- 我们总是可以通过敲击 Esc 键来进入命令模式(无论我们正工作在哪个模式下)。 + +现在,让我们看看如何在 vim 中执行在上一节列举的针对 nano 的相同的操作。不要忘记敲击 Enter 键来确认 vim 命令。 + +为了从命令行中获取 vim 的完整手册,在命令模式下键入 `:help` 并敲击 Enter 键: + +![vim 编辑器帮助菜单](http://www.tecmint.com/wp-content/uploads/2015/03/vim-Help-Menu.png) + +vim 编辑器帮助菜单 + +上面的小节呈现出一个目录列表,而定义过的小节则主要关注 Vim 的特定话题。要浏览某一个小节,可以将光标放到它的上面,然后按 Ctrl + ] (闭方括号)。注意,底部的小节展示的是当前文件的内容。 + +1. 要保存更改到文件,在命令模式中运行下面命令中的任意一个,就可以达到这个目的: + +``` +:wq! +:x! +ZZ (是的,两个 ZZ,前面无需添加冒号) +``` + +2. 要离开并丢弃更改,使用 `:q!`。这个命令也将允许你离开上面描述过的帮助菜单,并返回到命令模式中的当前文件。 + +3. 剪切 N 行:在命令模式中键入 `Ndd`。 + +4. 复制 M 行:在命令模式中键入 `Myy`。 + +5. 粘贴先前剪贴或复制过的行:在命令模式中按 `P`键。 + +6. 要插入另一个文件的内容到当前文件: + + :r filename + +例如,插入 `/etc/fstab` 的内容,可以这样做: + +[在 vi 编辑器中插入文件的内容](http://www.tecmint.com/wp-content/uploads/2015/03/Insert-Content-vi-Editor.png) + +在 vi 编辑器中插入文件的内容 + +7. 插入一个命名的输出到当前文档: + + :r! command + +例如,要在光标所在的当前位置后面插入日期和时间: + +![在 vi 编辑器中插入时间和日期](http://www.tecmint.com/wp-content/uploads/2015/03/Insert-Time-and-Date-in-vi-Editor.png) + +在 vi 编辑器中插入时间和日期 + +在另一篇我写的文章中,([LFCS 系列的 Part 2][1]),我更加详细地解释了在 vim 中可用的键盘快捷键和功能。或许你可以参考那个教程来查看如何使用这个强大的文本编辑器的更深入的例子。 + +### 使用 Grep 和正则表达式来分析文本 ### + +到现在为止,你已经学习了如何使用 nano 或 vim 创建和编辑文件。打个比方说,假如你成为了一个文本编辑器忍者 – 那又怎样呢? 在其他事情上,你也需要知道如何在文本中搜索正则表达式。 + +正则表达式(也称为 "regex" 或 "regexp") 是一种识别一个特定文本字符串或模式的方式,使得一个程序可以将这个模式和任意的文本字符串相比较。尽管利用 grep 来使用正则表达式值得用一整篇文章来描述,这里就让我们复习一些基本的知识: + +**1. 最简单的正则表达式是一个由数字和字母构成的字符串(即,单词 "svm") 或两个(在使用两个字符串时,你可以使用 `|`(或) 操作符):** + + # grep -Ei 'svm|vmx' /proc/cpuinfo + +上面命令的输出结果中若有这两个字符串之一的出现,则标志着你的处理器支持虚拟化: + +![正则表达式示例](http://www.tecmint.com/wp-content/uploads/2015/03/Regular-Expression-Example.png) + +正则表达式示例 + +**2. 第二种正则表达式是一个范围列表,由方括号包裹。** + +例如, `c[aeiou]t` 匹配字符串 cat,cet,cit,cot 和 cut,而 `[a-z]` 和 `[0-9]` 则相应地匹配小写字母或十进制数字。假如你想重复正则表达式 X 次,在正则表达式的后面立即输入 `{X}`即可。 + +例如,让我们从 `/etc/fstab` 中析出存储设备的 UUID: + + # grep -Ei '[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}' -o /etc/fstab + +![在 Linux 中从一个文件中析出字符串](http://www.tecmint.com/wp-content/uploads/2015/03/Extract-String-from-a-File.png) + +从一个文件中析出字符串 + +方括号中的第一个表达式 `[0-9a-f]` 被用来表示小写的十六进制字符,`{8}`是一个量词,暗示前面匹配的字符串应该重复的次数(在一个 UUID 中的开头序列是一个 8 个字符长的十六进制字符串)。 + +在圆括号中,量词 `{4}`和连字符暗示下一个序列是一个 4 个字符长的十六进制字符串,接着的量词 `({3})`表示前面的表达式要重复 3 次。 + +最后,在 UUID 中的最后一个 12 个字符长的十六进制字符串可以由 `[0-9a-f]{12}` 取得, `-o` 选项表示只打印出在 `/etc/fstab`中匹配行中的匹配的(非空)部分。 + +**3. POSIX 字符类 ** + +注:表格 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
字符类匹配 …
 [[:alnum:]] 任意字母或数字 [a-zA-Z0-9]
 [[:alpha:]] 任意字母 [a-zA-Z]
 [[:blank:]] 空格或制表符
 [[:cntrl:]] 任意控制字符 (ASCII 码的 0 至 32)
 [[:digit:]] 任意数字 [0-9]
 [[:graph:]] 任意可见字符
 [[:lower:]] 任意小写字母 [a-z]
 [[:print:]] 任意非控制字符 +
 [[:space:]] 任意空格
 [[:punct:]] 任意标点字符
 [[:upper:]] 任意大写字母 [A-Z]
 [[:xdigit:]] 任意十六进制数字 [0-9a-fA-F]
 [:word:] 任意字母,数字和下划线 [a-zA-Z0-9_]
+ +例如,我们可能会对查找已添加到我们系统中给真实用户的 UID 和 GID(参考这个系列的 [Part 2][2]来回忆起这些知识)感兴趣。那么,我们将在 `/etc/passwd` 文件中查找 4 个字符长的序列: + + # grep -Ei [[:digit:]]{4} /etc/passwd + +![在文件中查找一个字符串](http://www.tecmint.com/wp-content/uploads/2015/03/Search-For-String-in-File.png) + +在文件中查找一个字符串 + +上面的示例可能不是真实世界中使用正则表达式的最好案例,但它清晰地启发了我们如何使用 POSIX 字符类来使用 grep 分析文本。 + +### 总结 ### + + +在这篇文章中,我们已经提供了一些技巧来最大地利用针对命令行用户的两个文本编辑器 nano 和 vim,这两个工具都有相关的扩展文档可供阅读,你可以分别查询它们的官方网站(链接在下面给出)以及使用这个系列中的 [Part 1][3] 给出的建议。 + +#### 参考文件链接 #### + +- [http://www.nano-editor.org/][4] +- [http://www.vim.org/][5] + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/rhcsa-exam-how-to-use-nano-vi-editors/ + +作者:[Gabriel Cánepa][a] +译者:[FSSlc](https://github.com/FSSlc) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/gacanepa/ +[1]:http://www.tecmint.com/vi-editor-usage/ +[2]:http://www.tecmint.com/file-and-directory-management-in-linux/ +[3]:http://www.tecmint.com/rhcsa-exam-reviewing-essential-commands-system-documentation/ +[4]:http://www.nano-editor.org/ +[5]:http://www.vim.org/ From 8e789f8324e065ffd379940e6aaf70234213dbcc Mon Sep 17 00:00:00 2001 From: Chang Liu Date: Tue, 11 Aug 2015 20:20:36 +0800 Subject: [PATCH 889/965] Update 20150811 How to download apk files from Google Play Store on Linux.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 准备翻译该篇。 --- ...w to download apk files from Google Play Store on Linux.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150811 How to download apk files from Google Play Store on Linux.md b/sources/tech/20150811 How to download apk files from Google Play Store on Linux.md index 529e877d7b..50bf618e86 100644 --- a/sources/tech/20150811 How to download apk files from Google Play Store on Linux.md +++ b/sources/tech/20150811 How to download apk files from Google Play Store on Linux.md @@ -1,3 +1,5 @@ +FSSlc translating + How to download apk files from Google Play Store on Linux ================================================================================ Suppose you want to install an Android app on your Android device. However, for whatever reason, you cannot access Google Play Store on the Android device. What can you do then? One way to install the app without Google Play Store access is to download its APK file using some other means, and then [install the APK][1] file on the Android device manually. @@ -96,4 +98,4 @@ via: http://xmodulo.com/download-apk-files-google-play-store.html [3]:https://addons.mozilla.org/en-us/firefox/addon/apk-downloader/ [4]:http://codingteam.net/project/googleplaydownloader [5]:http://packages.ubuntu.com/vivid/python-ndg-httpsclient -[6]:http://xmodulo.com/how-to-install-deb-file-with-dependencies.html \ No newline at end of file +[6]:http://xmodulo.com/how-to-install-deb-file-with-dependencies.html From e0f43461b533db0e4444eb78cc24e749d8209713 Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 11 Aug 2015 22:28:25 +0800 Subject: [PATCH 890/965] PUB:20150810 For Linux, Supercomputers R Us @xiaoyu33 --- ...20150810 For Linux, Supercomputers R Us.md | 61 +++++++++++++++++++ ...20150810 For Linux, Supercomputers R Us.md | 59 ------------------ 2 files changed, 61 insertions(+), 59 deletions(-) create mode 100644 published/20150810 For Linux, Supercomputers R Us.md delete mode 100644 translated/talk/20150810 For Linux, Supercomputers R Us.md diff --git a/published/20150810 For Linux, Supercomputers R Us.md b/published/20150810 For Linux, Supercomputers R Us.md new file mode 100644 index 0000000000..e173d7513c --- /dev/null +++ b/published/20150810 For Linux, Supercomputers R Us.md @@ -0,0 +1,61 @@ +Linux:称霸超级计算机系统 +================================================================================ + +> 几乎所有超级计算机上运行的系统都是 Linux,其中包括那些由树莓派(Raspberry Pi)板卡和 PlayStation 3游戏机组成的计算机。 + +![Credit: Michel Ngilen, CC BY 2.0, via Wikimedia Commons](http://images.techhive.com/images/article/2015/08/playstation_3-100602985-primary.idge.jpg) + +*题图来源:By Michel Ngilen,[ CC BY 2.0 ], via Wikimedia Commons* + +超级计算机是一种严肃的工具,做的都是高大上的计算。它们往往从事于严肃的用途,比如原子弹模拟、气候模拟和高等物理学。当然,它们的花费也很高大上。在最新的超级计算机 [Top500][1] 排名中,中国国防科技大学研制的天河 2 号位居第一,而天河 2 号的建造耗资约 3.9 亿美元! + +但是,也有一个超级计算机,是由博伊西州立大学电气和计算机工程系的一名在读博士 Joshua Kiepert [用树莓派构建完成][2]的,其建造成本低于2000美元。 + +不,这不是我编造的。它一个真实的超级计算机,由超频到 1GHz 的 [B 型树莓派][3]的 ARM11 处理器与 VideoCore IV GPU 组成。每个都配备了 512MB 的内存、一对 USB 端口和 1 个 10/100 BaseT 以太网端口。 + +那么天河 2 号和博伊西州立大学的超级计算机有什么共同点吗?它们都运行 Linux 系统。世界最快的超级计算机[前 500 强中有 486][4] 个也同样运行的是 Linux 系统。这是从 20 多年前就开始的格局。而现在的趋势是超级计算机开始由廉价单元组成,因为 Kiepert 的机器并不是唯一一个无所谓预算的超级计算机。 + +麻省大学达特茅斯分校的物理学副教授 Gaurav Khanna 创建了一台超级计算机仅用了[不足 200 台的 PlayStation3 视频游戏机][5]。 + +PlayStation 游戏机由一个 3.2 GHz 的基于 PowerPC 的 Power 处理器所驱动。每个都配有 512M 的内存。你现在仍然可以花 200 美元买到一个,尽管索尼将在年底逐步淘汰它们。Khanna 仅用了 16 个 PlayStation 3 构建了他第一台超级计算机,所以你也可以花费不到 4000 美元就拥有你自己的超级计算机。 + +这些机器可能是用玩具建成的,但他们不是玩具。Khanna 已经用它做了严肃的天体物理学研究。一个白帽子黑客组织使用了类似的 [PlayStation 3 超级计算机在 2008 年破解了 SSL 的 MD5 哈希算法][6]。 + +两年后,美国空军研究实验室研制的 [Condor Cluster,使用了 1760 个索尼的 PlayStation 3 的处理器][7]和168 个通用的图形处理单元。这个低廉的超级计算机,每秒运行约 500 TFLOP ,即每秒可进行 500 万亿次浮点运算。 + +其他的一些便宜且适用于构建家庭超级计算机的构件包括,专业并行处理板卡,比如信用卡大小的 [99 美元的 Parallella 板卡][8],以及高端显卡,比如 [Nvidia 的 Titan Z][9] 和 [ AMD 的 FirePro W9100][10]。这些高端板卡的市场零售价约 3000 美元,一些想要一台梦幻般的机器的玩家为此参加了[英特尔极限大师赛:英雄联盟世界锦标赛][11],要是甚至有机会得到了第一名的话,能获得超过 10 万美元奖金。另一方面,一个能够自己提供超过 2.5TFLOPS 计算能力的计算机,对于科学家和研究人员来说,这为他们提供了一个可以拥有自己专属的超级计算机的经济的方法。 + +而超级计算机与 Linux 的连接,这一切都始于 1994 年戈达德航天中心的第一个名为 [Beowulf 超级计算机][13]。 + +按照我们的标准,Beowulf 不能算是最优越的。但在那个时期,作为第一台自制的超级计算机,它的 16 个英特尔486DX 处理器和 10Mbps 的以太网总线,是个伟大的创举。[Beowulf 是由美国航空航天局的承建商 Don Becker 和 Thomas Sterling 所设计的][14],是第一台“创客”超级计算机。它的“计算部件” 486DX PC,成本仅有几千美元。尽管它的速度只有个位数的 GFLOPS (吉拍,每秒10亿次)浮点运算,[Beowulf][15] 表明了你可以用商用现货(COTS)硬件和 Linux 创建超级计算机。 + +我真希望我参与创建了一部分,但是我 1994 年就离开了戈达德,开始了作为一名全职的科技记者的职业生涯。该死。 + +但是尽管我只是使用笔记本的记者,我依然能够体会到 COTS 和开源软件是如何永远的改变了超级计算机。我希望现在读这篇文章的你也能。因为,无论是 Raspberry Pi 集群,还是超过 300 万个英特尔的 Ivy Bridge 和 Xeon Phi 芯片的庞然大物,几乎所有当代的超级计算机都可以追溯到 Beowulf。 + +-------------------------------------------------------------------------------- + +via: http://www.computerworld.com/article/2960701/linux/for-linux-supercomputers-r-us.html + +作者:[Steven J. Vaughan-Nichols][a] +译者:[xiaoyu33](https://github.com/xiaoyu33) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.computerworld.com/author/Steven-J.-Vaughan_Nichols/ +[1]:http://www.top500.org/ +[2]:http://www.zdnet.com/article/build-your-own-supercomputer-out-of-raspberry-pi-boards/ +[3]:https://www.raspberrypi.org/products/model-b/ +[4]:http://www.zdnet.com/article/linux-still-rules-supercomputing/ +[5]:http://www.nytimes.com/2014/12/23/science/an-economical-way-to-save-progress.html?smid=fb-nytimes&smtyp=cur&bicmp=AD&bicmlukp=WT.mc_id&bicmst=1409232722000&bicmet=1419773522000&_r=4 +[6]:http://www.computerworld.com/article/2529932/cybercrime-hacking/researchers-hack-verisign-s-ssl-scheme-for-securing-web-sites.html +[7]:http://phys.org/news/2010-12-air-playstation-3s-supercomputer.html +[8]:http://www.zdnet.com/article/parallella-the-99-linux-supercomputer/ +[9]:http://blogs.nvidia.com/blog/2014/03/25/titan-z/ +[10]:http://www.amd.com/en-us/press-releases/Pages/amd-flagship-professional-2014apr7.aspx +[11]:http://en.intelextrememasters.com/news/check-out-the-intel-extreme-masters-katowice-prize-money-distribution/ + +[13]:http://www.beowulf.org/overview/history.html +[14]:http://yclept.ucdavis.edu/Beowulf/aboutbeowulf.html +[15]:http://www.beowulf.org/ diff --git a/translated/talk/20150810 For Linux, Supercomputers R Us.md b/translated/talk/20150810 For Linux, Supercomputers R Us.md deleted file mode 100644 index e5022a658f..0000000000 --- a/translated/talk/20150810 For Linux, Supercomputers R Us.md +++ /dev/null @@ -1,59 +0,0 @@ -Linux:称霸超级计算机系统 -================================================================================ -![Credit: Michel Ngilen, CC BY 2.0, via Wikimedia Commons](http://images.techhive.com/images/article/2015/08/playstation_3-100602985-primary.idge.jpg) -首图来源:By Michel Ngilen,[ CC BY 2.0 ], via Wikimedia Commons - -> 几乎所有超级计算机上运行的系统都是Linux,其中包括那些由树莓派(Raspberry Pi)板和PlayStation 3游戏机板组成的计算机。 - -超级计算机是很正经的工具,目的是做严肃的计算。它们往往从事于严肃的追求,比如原子弹的模拟,气候模拟和高级物理学。当然,它们也需要大笔资金的投资。在最新的超级计算机[500强][1]排名中,中国国防科大研制的天河2号位居第一。天河2号耗资约3.9亿美元。 - -但是,也有一个超级计算机,是由博伊西州立大学电气和计算机工程系的一名在读博士Joshua Kiepert[用树莓派构建完成][2]的。其创建成本低于2000美元。 - -不,这不是我编造的。这是一个真实的超级计算机,由超频1GHz的[B型树莓派][3]ARM11处理器与VideoCore IV GPU组成。每个都配备了512MB的RAM,一对USB端口和1个10/100 BaseT以太网端口。 - -那么天河2号和博伊西州立大学的超级计算机有什么共同点?它们都运行Linux系统。世界最快的超级计算机[前500强中有486][4]个也同样运行的是Linux系统。这是20多年前就开始的一种覆盖。现在Linux开始建立于廉价的超级计算机。因为Kiepert的机器并不是唯一的预算数字计算机。 - -Gaurav Khanna,麻省大学达特茅斯分校的物理学副教授,创建了一台超级计算机仅用了[不足200的PlayStation3视频游戏机][5]。 - -PlayStation游戏机是由一个3.2 GHz的基于PowerPC的电源处理单元供电。每个都配有512M的RAM。你现在仍然可以花200美元买到一个,尽管索尼将在年底逐步淘汰它们。Khanna仅用16个PlayStation 3s构建了他第一台超级计算机,所以你也可以花费不到4000美元就拥有你自己的超级计算机。 - -这些机器可能是从玩具建成的,但他们不是玩具。Khanna已经用它做了严肃的天体物理学研究。一个白帽子黑客组织使用了类似的[PlayStation 3超级计算机在2008年破解了SSL的MD5哈希算法][6]。 - -两年后,美国空军研究实验室研制的[Condor Cluster,使用了1,760个索尼的PlayStation3的处理器][7]和168个通用的图形处理单元。这个低廉的超级计算机,每秒运行约500TFLOPs,或500万亿次浮点运算。 - -其他的一些便宜且适用于构建家庭超级计算机的构件包括,专业并行处理板比如信用卡大小[99美元的Parallella板][8],以及高端显卡比如[Nvidia的 Titan Z][9] 以及[ AMD的 FirePro W9100][10].这些高端主板市场零售价约3000美元,被一些[英特尔极限大师赛世界锦标赛英雄联盟参赛][11]玩家觊觎能够赢得的梦想的机器,c[传说][12]这项比赛第一名能获得超过10万美元奖金。另一方面,一个人能够独自提供超过2.5TFLOPS,并且他们为科学家和研究人员提供了一个经济的方法,使得他们拥有自己专属的超级计算机。 - -作为Linux的连接,这一切都开始于1994年戈达德航天中心的第一个名为[Beowulf超级计算机][13]。 - -按照我们的标准,Beowulf不能算是最优越的。但在那个时期,作为第一台自制的超级计算机,其16英特尔486DX处理器和10Mbps的以太网总线,是伟大的创举。由[美国航空航天局承包人Don Becker和Thomas Sterling设计的Beowulf][14],是第一个“制造者”超级计算机。它的“计算部件”486DX PCs,成本仅有几千美元。尽管它的速度只有一位数的浮点运算,[Beowulf][15]表明了你可以用商用现货(COTS)硬件和Linux创建超级计算机。 - -我真希望我参与创作了一部分,但是我1994年就离开了戈达德,开始了作为一名全职的科技记者的职业生涯。该死。 - -但是尽管我只是使用笔记本的记者,我依然能够体会到COTS和开源软件是如何永远的改变了超级计算机。我希望现在读这篇文章的你也能。因为,无论是Raspberry Pis集群,还是超过300万英特尔的Ivy Bridge和Xeon Phi芯片的庞然大物,几乎所有当代的超级计算机都可以追溯到Beowulf。 - --------------------------------------------------------------------------------- - -via: - -作者:[Steven J. Vaughan-Nichols][a] -译者:[xiaoyu33](https://github.com/xiaoyu33) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.computerworld.com/author/Steven-J.-Vaughan_Nichols/ -[1]:http://www.top500.org/ -[2]:http://www.zdnet.com/article/build-your-own-supercomputer-out-of-raspberry-pi-boards/ -[3]:https://www.raspberrypi.org/products/model-b/ -[4]:http://www.zdnet.com/article/linux-still-rules-supercomputing/ -[5]:http://www.nytimes.com/2014/12/23/science/an-economical-way-to-save-progress.html?smid=fb-nytimes&smtyp=cur&bicmp=AD&bicmlukp=WT.mc_id&bicmst=1409232722000&bicmet=1419773522000&_r=4 -[6]:http://www.computerworld.com/article/2529932/cybercrime-hacking/researchers-hack-verisign-s-ssl-scheme-for-securing-web-sites.html -[7]:http://phys.org/news/2010-12-air-playstation-3s-supercomputer.html -[8]:http://www.zdnet.com/article/parallella-the-99-linux-supercomputer/ -[9]:http://blogs.nvidia.com/blog/2014/03/25/titan-z/ -[10]:http://www.amd.com/en-us/press-releases/Pages/amd-flagship-professional-2014apr7.aspx -[11]:http://en.intelextrememasters.com/news/check-out-the-intel-extreme-masters-katowice-prize-money-distribution/ -[12]:http://www.google.com/url?q=http%3A%2F%2Fen.intelextrememasters.com%2Fnews%2Fcheck-out-the-intel-extreme-masters-katowice-prize-money-distribution%2F&sa=D&sntz=1&usg=AFQjCNE6yoAGGz-Hpi2tPF4gdhuPBEckhQ -[13]:http://www.beowulf.org/overview/history.html -[14]:http://yclept.ucdavis.edu/Beowulf/aboutbeowulf.html -[15]:http://www.beowulf.org/ From cc16c9074da3fd5406449f3e7cadbfd39998790c Mon Sep 17 00:00:00 2001 From: DeadFire Date: Tue, 11 Aug 2015 23:13:10 +0800 Subject: [PATCH 891/965] =?UTF-8?q?20150811-2=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...k Traffic Analyzer--Install it on Linux.md | 62 +++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 sources/tech/20150811 Darkstat is a Web Based Network Traffic Analyzer--Install it on Linux.md diff --git a/sources/tech/20150811 Darkstat is a Web Based Network Traffic Analyzer--Install it on Linux.md b/sources/tech/20150811 Darkstat is a Web Based Network Traffic Analyzer--Install it on Linux.md new file mode 100644 index 0000000000..9f78722cb6 --- /dev/null +++ b/sources/tech/20150811 Darkstat is a Web Based Network Traffic Analyzer--Install it on Linux.md @@ -0,0 +1,62 @@ +Darkstat is a Web Based Network Traffic Analyzer – Install it on Linux +================================================================================ +Darkstat is a simple, web based network traffic analyzer application. It works on many popular operating systems like Linux, Solaris, Mac and AIX. It keeps running in the background as a daemon and continues collecting and sniffing network data and presents it in easily understandable format within its web interface. It can generate traffic reports for hosts, identify which ports are open on some particular host and is IPV 6 complaint application. Let’s see how we can install and configure it on Linux operating system. + +### Installing Darkstat on Linux ### + +**Install Darkstat on Fedora/CentOS/RHEL:** + +In order to install it on Fedora/RHEL and CentOS Linux distributions, run following command on the terminal. + + sudo yum install darkstat + +**Install Darkstat on Ubuntu/Debian:** + +Run following on the terminal to install it on Ubuntu and Debian. + + sudo apt-get install darkstat + +Congratulations, Darkstat has been installed on your Linux system now. + +### Configuring Darkstat ### + +In order to run this application properly, we need to perform some basic configurations. Edit /etc/darkstat/init.cfg file in Gedit text editor by running the following command on the terminal. + + sudo gedit /etc/darkstat/init.cfg + +![](http://linuxpitstop.com/wp-content/uploads/2015/08/13.png) +Edit Darkstat + +Change START_DARKSTAT parameter to “yes” and provide your network interface in “INTERFACE”. Make sure to uncomment DIR, PORT, BINDIP, and LOCAL parameters here. If you wish to bind the web interface for Darkstat to some specific IP, provide it in BINDIP section. + +### Starting Darkstat Daemon ### + +Once the installation and configuration for Darkstat is complete, run following command to start its daemon. + + sudo /etc/init.d/darkstat start + +![Restarting Darkstat](http://linuxpitstop.com/wp-content/uploads/2015/08/23.png) + +You can configure Darkstat to start on system boot by running the following command: + + chkconfig darkstat on + +Launch your browser and load **http://localhost:666** and it will display the web based graphical interface for Darkstat. Start using this tool to analyze your network traffic. + +![Darkstat](http://linuxpitstop.com/wp-content/uploads/2015/08/32.png) + +### Conclusion ### + +It is a lightweight tool with very low memory footprints. The key reason for the popularity of this tool is simplicity, ease of configuration and usage. It is a must-have application for System and Network Administrators. + +-------------------------------------------------------------------------------- + +via: http://linuxpitstop.com/install-darkstat-on-ubuntu-linux/ + +作者:[Aun][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://linuxpitstop.com/author/aun/ \ No newline at end of file From accf7e54ceb2f72f33d9db5b6ce3e35fe1a3e9f3 Mon Sep 17 00:00:00 2001 From: DeadFire Date: Tue, 11 Aug 2015 23:24:39 +0800 Subject: [PATCH 892/965] =?UTF-8?q?20150811-3=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ind and Delete Duplicate Files in Linux.md | 265 ++++++++++++++++++ 1 file changed, 265 insertions(+) create mode 100644 sources/tech/20150811 fdupes--A Comamndline Tool to Find and Delete Duplicate Files in Linux.md diff --git a/sources/tech/20150811 fdupes--A Comamndline Tool to Find and Delete Duplicate Files in Linux.md b/sources/tech/20150811 fdupes--A Comamndline Tool to Find and Delete Duplicate Files in Linux.md new file mode 100644 index 0000000000..f89f060c92 --- /dev/null +++ b/sources/tech/20150811 fdupes--A Comamndline Tool to Find and Delete Duplicate Files in Linux.md @@ -0,0 +1,265 @@ +fdupes – A Comamndline Tool to Find and Delete Duplicate Files in Linux +================================================================================ +It is a common requirement to find and replace duplicate files for most of the computer users. Finding and removing duplicate files is a tiresome job that demands time and patience. Finding duplicate files can be very easy if your machine is powered by GNU/Linux, thanks to ‘**fdupes**‘ utility. + +![Find and Delete Duplicate Files in Linux](http://www.tecmint.com/wp-content/uploads/2015/08/find-and-delete-duplicate-files-in-linux.png) + +Fdupes – Find and Delete Duplicate Files in Linux + +### What is fdupes? ### + +**Fdupes** is a Linux utility written by **Adrian Lopez** in C programming Language released under MIT License. The application is able to find duplicate files in the given set of directories and sub-directories. Fdupes recognize duplicates by comparing MD5 signature of files followed by a byte-to-byte comparison. A lots of options can be passed with Fdupes to list, delete and replace the files with hardlinks to duplicates. + +The comparison starts in the order: + +**size comparison > Partial MD5 Signature Comparison > Full MD5 Signature Comparison > Byte-to-Byte Comparison.** + +### Install fdupes on a Linux ### + +Installation of latest version of fdupes (fdupes version 1.51) as easy as running following command on **Debian** based systems such as **Ubuntu** and **Linux Mint**. + + $ sudo apt-get install fdupes + +On CentOS/RHEL and Fedora based systems, you need to turn on [epel repository][1] to install fdupes package. + + # yum install fdupes + # dnf install fdupes [On Fedora 22 onwards] + +**Note**: The default package manager yum is replaced by dnf from Fedora 22 onwards… + +### How to use fdupes command? ### + +1. For demonstration purpose, let’s a create few duplicate files under a directory (say tecmint) simply as: + + $ mkdir /home/"$USER"/Desktop/tecmint && cd /home/"$USER"/Desktop/tecmint && for i in {1..15}; do echo "I Love Tecmint. Tecmint is a very nice community of Linux Users." > tecmint${i}.txt ; done + +After running above command, let’s verify the duplicates files are created or not using ls [command][2]. + + $ ls -l + + total 60 + -rw-r--r-- 1 tecmint tecmint 65 Aug 8 11:22 tecmint10.txt + -rw-r--r-- 1 tecmint tecmint 65 Aug 8 11:22 tecmint11.txt + -rw-r--r-- 1 tecmint tecmint 65 Aug 8 11:22 tecmint12.txt + -rw-r--r-- 1 tecmint tecmint 65 Aug 8 11:22 tecmint13.txt + -rw-r--r-- 1 tecmint tecmint 65 Aug 8 11:22 tecmint14.txt + -rw-r--r-- 1 tecmint tecmint 65 Aug 8 11:22 tecmint15.txt + -rw-r--r-- 1 tecmint tecmint 65 Aug 8 11:22 tecmint1.txt + -rw-r--r-- 1 tecmint tecmint 65 Aug 8 11:22 tecmint2.txt + -rw-r--r-- 1 tecmint tecmint 65 Aug 8 11:22 tecmint3.txt + -rw-r--r-- 1 tecmint tecmint 65 Aug 8 11:22 tecmint4.txt + -rw-r--r-- 1 tecmint tecmint 65 Aug 8 11:22 tecmint5.txt + -rw-r--r-- 1 tecmint tecmint 65 Aug 8 11:22 tecmint6.txt + -rw-r--r-- 1 tecmint tecmint 65 Aug 8 11:22 tecmint7.txt + -rw-r--r-- 1 tecmint tecmint 65 Aug 8 11:22 tecmint8.txt + -rw-r--r-- 1 tecmint tecmint 65 Aug 8 11:22 tecmint9.txt + +The above script create **15** files namely tecmint1.txt, tecmint2.txt…tecmint15.txt and every files contains the same data i.e., + + "I Love Tecmint. Tecmint is a very nice community of Linux Users." + +2. Now search for duplicate files within the folder **tecmint**. + + $ fdupes /home/$USER/Desktop/tecmint + + /home/tecmint/Desktop/tecmint/tecmint13.txt + /home/tecmint/Desktop/tecmint/tecmint8.txt + /home/tecmint/Desktop/tecmint/tecmint11.txt + /home/tecmint/Desktop/tecmint/tecmint3.txt + /home/tecmint/Desktop/tecmint/tecmint4.txt + /home/tecmint/Desktop/tecmint/tecmint6.txt + /home/tecmint/Desktop/tecmint/tecmint7.txt + /home/tecmint/Desktop/tecmint/tecmint9.txt + /home/tecmint/Desktop/tecmint/tecmint10.txt + /home/tecmint/Desktop/tecmint/tecmint2.txt + /home/tecmint/Desktop/tecmint/tecmint5.txt + /home/tecmint/Desktop/tecmint/tecmint14.txt + /home/tecmint/Desktop/tecmint/tecmint1.txt + /home/tecmint/Desktop/tecmint/tecmint15.txt + /home/tecmint/Desktop/tecmint/tecmint12.txt + +3. Search for duplicates recursively under every directory including it’s sub-directories using the **-r** option. + +It search across all the files and folder recursively, depending upon the number of files and folders it will take some time to scan duplicates. In that mean time, you will be presented with the total progress in terminal, something like this. + + $ fdupes -r /home + + Progress [37780/54747] 69% + +4. See the size of duplicates found within a folder using the **-S** option. + + $ fdupes -S /home/$USER/Desktop/tecmint + + 65 bytes each: + /home/tecmint/Desktop/tecmint/tecmint13.txt + /home/tecmint/Desktop/tecmint/tecmint8.txt + /home/tecmint/Desktop/tecmint/tecmint11.txt + /home/tecmint/Desktop/tecmint/tecmint3.txt + /home/tecmint/Desktop/tecmint/tecmint4.txt + /home/tecmint/Desktop/tecmint/tecmint6.txt + /home/tecmint/Desktop/tecmint/tecmint7.txt + /home/tecmint/Desktop/tecmint/tecmint9.txt + /home/tecmint/Desktop/tecmint/tecmint10.txt + /home/tecmint/Desktop/tecmint/tecmint2.txt + /home/tecmint/Desktop/tecmint/tecmint5.txt + /home/tecmint/Desktop/tecmint/tecmint14.txt + /home/tecmint/Desktop/tecmint/tecmint1.txt + /home/tecmint/Desktop/tecmint/tecmint15.txt + /home/tecmint/Desktop/tecmint/tecmint12.txt + +5. You can see the size of duplicate files for every directory and subdirectories encountered within using the **-S** and **-r** options at the same time, as: + + $ fdupes -Sr /home/avi/Desktop/ + + 65 bytes each: + /home/tecmint/Desktop/tecmint/tecmint13.txt + /home/tecmint/Desktop/tecmint/tecmint8.txt + /home/tecmint/Desktop/tecmint/tecmint11.txt + /home/tecmint/Desktop/tecmint/tecmint3.txt + /home/tecmint/Desktop/tecmint/tecmint4.txt + /home/tecmint/Desktop/tecmint/tecmint6.txt + /home/tecmint/Desktop/tecmint/tecmint7.txt + /home/tecmint/Desktop/tecmint/tecmint9.txt + /home/tecmint/Desktop/tecmint/tecmint10.txt + /home/tecmint/Desktop/tecmint/tecmint2.txt + /home/tecmint/Desktop/tecmint/tecmint5.txt + /home/tecmint/Desktop/tecmint/tecmint14.txt + /home/tecmint/Desktop/tecmint/tecmint1.txt + /home/tecmint/Desktop/tecmint/tecmint15.txt + /home/tecmint/Desktop/tecmint/tecmint12.txt + + 107 bytes each: + /home/tecmint/Desktop/resume_files/r-csc.html + /home/tecmint/Desktop/resume_files/fc.html + +6. Other than searching in one folder or all the folders recursively, you may choose to choose in two folders or three folders as required. Not to mention you can use option **-S** and/or **-r** if required. + + $ fdupes /home/avi/Desktop/ /home/avi/Templates/ + +7. To delete the duplicate files while preserving a copy you can use the option ‘**-d**’. Extra care should be taken while using this option else you might end up loosing necessary files/data and mind it the process is unrecoverable. + + $ fdupes -d /home/$USER/Desktop/tecmint + + [1] /home/tecmint/Desktop/tecmint/tecmint13.txt + [2] /home/tecmint/Desktop/tecmint/tecmint8.txt + [3] /home/tecmint/Desktop/tecmint/tecmint11.txt + [4] /home/tecmint/Desktop/tecmint/tecmint3.txt + [5] /home/tecmint/Desktop/tecmint/tecmint4.txt + [6] /home/tecmint/Desktop/tecmint/tecmint6.txt + [7] /home/tecmint/Desktop/tecmint/tecmint7.txt + [8] /home/tecmint/Desktop/tecmint/tecmint9.txt + [9] /home/tecmint/Desktop/tecmint/tecmint10.txt + [10] /home/tecmint/Desktop/tecmint/tecmint2.txt + [11] /home/tecmint/Desktop/tecmint/tecmint5.txt + [12] /home/tecmint/Desktop/tecmint/tecmint14.txt + [13] /home/tecmint/Desktop/tecmint/tecmint1.txt + [14] /home/tecmint/Desktop/tecmint/tecmint15.txt + [15] /home/tecmint/Desktop/tecmint/tecmint12.txt + + Set 1 of 1, preserve files [1 - 15, all]: + +You may notice that all the duplicates are listed and you are prompted to delete, either one by one or certain range or all in one go. You may select a range something like below to delete files files of specific range. + + Set 1 of 1, preserve files [1 - 15, all]: 2-15 + + [-] /home/tecmint/Desktop/tecmint/tecmint13.txt + [+] /home/tecmint/Desktop/tecmint/tecmint8.txt + [-] /home/tecmint/Desktop/tecmint/tecmint11.txt + [-] /home/tecmint/Desktop/tecmint/tecmint3.txt + [-] /home/tecmint/Desktop/tecmint/tecmint4.txt + [-] /home/tecmint/Desktop/tecmint/tecmint6.txt + [-] /home/tecmint/Desktop/tecmint/tecmint7.txt + [-] /home/tecmint/Desktop/tecmint/tecmint9.txt + [-] /home/tecmint/Desktop/tecmint/tecmint10.txt + [-] /home/tecmint/Desktop/tecmint/tecmint2.txt + [-] /home/tecmint/Desktop/tecmint/tecmint5.txt + [-] /home/tecmint/Desktop/tecmint/tecmint14.txt + [-] /home/tecmint/Desktop/tecmint/tecmint1.txt + [-] /home/tecmint/Desktop/tecmint/tecmint15.txt + [-] /home/tecmint/Desktop/tecmint/tecmint12.txt + +8. From safety point of view, you may like to print the output of ‘**fdupes**’ to file and then check text file to decide what file to delete. This decrease chances of getting your file deleted accidentally. You may do: + + $ fdupes -Sr /home > /home/fdupes.txt + +**Note**: You may replace ‘**/home**’ with the your desired folder. Also use option ‘**-r**’ and ‘**-S**’ if you want to search recursively and Print Size, respectively. + +9. You may omit the first file from each set of matches by using option ‘**-f**’. + +First List files of the directory. + + $ ls -l /home/$USER/Desktop/tecmint + + total 20 + -rw-r--r-- 1 tecmint tecmint 65 Aug 8 11:22 tecmint9 (3rd copy).txt + -rw-r--r-- 1 tecmint tecmint 65 Aug 8 11:22 tecmint9 (4th copy).txt + -rw-r--r-- 1 tecmint tecmint 65 Aug 8 11:22 tecmint9 (another copy).txt + -rw-r--r-- 1 tecmint tecmint 65 Aug 8 11:22 tecmint9 (copy).txt + -rw-r--r-- 1 tecmint tecmint 65 Aug 8 11:22 tecmint9.txt + +and then omit the first file from each set of matches. + + $ fdupes -f /home/$USER/Desktop/tecmint + + /home/tecmint/Desktop/tecmint9 (copy).txt + /home/tecmint/Desktop/tecmint9 (3rd copy).txt + /home/tecmint/Desktop/tecmint9 (another copy).txt + /home/tecmint/Desktop/tecmint9 (4th copy).txt + +10. Check installed version of fdupes. + + $ fdupes --version + + fdupes 1.51 + +11. If you need any help on fdupes you may use switch ‘**-h**’. + + $ fdupes -h + + Usage: fdupes [options] DIRECTORY... + + -r --recurse for every directory given follow subdirectories + encountered within + -R --recurse: for each directory given after this option follow + subdirectories encountered within (note the ':' at + the end of the option, manpage for more details) + -s --symlinks follow symlinks + -H --hardlinks normally, when two or more files point to the same + disk area they are treated as non-duplicates; this + option will change this behavior + -n --noempty exclude zero-length files from consideration + -A --nohidden exclude hidden files from consideration + -f --omitfirst omit the first file in each set of matches + -1 --sameline list each set of matches on a single line + -S --size show size of duplicate files + -m --summarize summarize dupe information + -q --quiet hide progress indicator + -d --delete prompt user for files to preserve and delete all + others; important: under particular circumstances, + data may be lost when using this option together + with -s or --symlinks, or when specifying a + particular directory more than once; refer to the + fdupes documentation for additional information + -N --noprompt together with --delete, preserve the first file in + each set of duplicates and delete the rest without + prompting the user + -v --version display fdupes version + -h --help display this help message + +That’s for all now. Let me know how you were finding and deleting duplicates files till now in Linux? and also tell me your opinion about this utility. Put your valuable feedback in the comment section below and don’t forget to like/share us and help us get spread. + +I am working on another utility called **fslint** to remove duplicate files, will soon post and you people will love to read. + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/fdupes-find-and-delete-duplicate-files-in-linux/ + +作者:[Avishek Kumar][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/avishek/ +[1]:http://www.tecmint.com/how-to-enable-epel-repository-for-rhel-centos-6-5/ +[2]:http://www.tecmint.com/15-basic-ls-command-examples-in-linux/ \ No newline at end of file From 54f9b2ca351aa6a65fa5896a6896aaf93255c5cc Mon Sep 17 00:00:00 2001 From: wxy Date: Wed, 12 Aug 2015 00:35:39 +0800 Subject: [PATCH 893/965] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=A0=87=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- published/20150810 For Linux, Supercomputers R Us.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/published/20150810 For Linux, Supercomputers R Us.md b/published/20150810 For Linux, Supercomputers R Us.md index e173d7513c..f86b3694d0 100644 --- a/published/20150810 For Linux, Supercomputers R Us.md +++ b/published/20150810 For Linux, Supercomputers R Us.md @@ -1,4 +1,4 @@ -Linux:称霸超级计算机系统 +有了 Linux,你就可以搭建自己的超级计算机 ================================================================================ > 几乎所有超级计算机上运行的系统都是 Linux,其中包括那些由树莓派(Raspberry Pi)板卡和 PlayStation 3游戏机组成的计算机。 From d3454dc30effe283eeca9dac490e57e860333fe0 Mon Sep 17 00:00:00 2001 From: joeren Date: Wed, 12 Aug 2015 09:29:13 +0800 Subject: [PATCH 894/965] Update 20150811 fdupes--A Comamndline Tool to Find and Delete Duplicate Files in Linux.md --- ...mndline Tool to Find and Delete Duplicate Files in Linux.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150811 fdupes--A Comamndline Tool to Find and Delete Duplicate Files in Linux.md b/sources/tech/20150811 fdupes--A Comamndline Tool to Find and Delete Duplicate Files in Linux.md index f89f060c92..1e55090d67 100644 --- a/sources/tech/20150811 fdupes--A Comamndline Tool to Find and Delete Duplicate Files in Linux.md +++ b/sources/tech/20150811 fdupes--A Comamndline Tool to Find and Delete Duplicate Files in Linux.md @@ -1,3 +1,4 @@ +Translating by GOLinux! fdupes – A Comamndline Tool to Find and Delete Duplicate Files in Linux ================================================================================ It is a common requirement to find and replace duplicate files for most of the computer users. Finding and removing duplicate files is a tiresome job that demands time and patience. Finding duplicate files can be very easy if your machine is powered by GNU/Linux, thanks to ‘**fdupes**‘ utility. @@ -262,4 +263,4 @@ via: http://www.tecmint.com/fdupes-find-and-delete-duplicate-files-in-linux/ [a]:http://www.tecmint.com/author/avishek/ [1]:http://www.tecmint.com/how-to-enable-epel-repository-for-rhel-centos-6-5/ -[2]:http://www.tecmint.com/15-basic-ls-command-examples-in-linux/ \ No newline at end of file +[2]:http://www.tecmint.com/15-basic-ls-command-examples-in-linux/ From b161d18382714006ea52e2cf6cb46b3febe0ba92 Mon Sep 17 00:00:00 2001 From: GOLinux Date: Wed, 12 Aug 2015 10:51:29 +0800 Subject: [PATCH 895/965] [Translated]20150811 fdupes--A Commandline Tool to Find and Delete Duplicate Files in Linux.md --- ...ind and Delete Duplicate Files in Linux.md | 69 +++++++++---------- 1 file changed, 33 insertions(+), 36 deletions(-) rename {sources => translated}/tech/20150811 fdupes--A Comamndline Tool to Find and Delete Duplicate Files in Linux.md (67%) diff --git a/sources/tech/20150811 fdupes--A Comamndline Tool to Find and Delete Duplicate Files in Linux.md b/translated/tech/20150811 fdupes--A Comamndline Tool to Find and Delete Duplicate Files in Linux.md similarity index 67% rename from sources/tech/20150811 fdupes--A Comamndline Tool to Find and Delete Duplicate Files in Linux.md rename to translated/tech/20150811 fdupes--A Comamndline Tool to Find and Delete Duplicate Files in Linux.md index 1e55090d67..09f10fb546 100644 --- a/sources/tech/20150811 fdupes--A Comamndline Tool to Find and Delete Duplicate Files in Linux.md +++ b/translated/tech/20150811 fdupes--A Comamndline Tool to Find and Delete Duplicate Files in Linux.md @@ -1,40 +1,38 @@ -Translating by GOLinux! -fdupes – A Comamndline Tool to Find and Delete Duplicate Files in Linux +fdupes——Linux中查找并删除重复文件的命令行工具 ================================================================================ -It is a common requirement to find and replace duplicate files for most of the computer users. Finding and removing duplicate files is a tiresome job that demands time and patience. Finding duplicate files can be very easy if your machine is powered by GNU/Linux, thanks to ‘**fdupes**‘ utility. +对于大多数计算机用户而言,查找并替换重复的文件是一个常见的需求。查找并移除重复文件真是一项领人不胜其烦的工作,它耗时又耗力。如果你的机器上跑着GNU/Linux,那么查找重复文件会变得十分简单,这多亏了`**fdupes**`工具。 ![Find and Delete Duplicate Files in Linux](http://www.tecmint.com/wp-content/uploads/2015/08/find-and-delete-duplicate-files-in-linux.png) -Fdupes – Find and Delete Duplicate Files in Linux +Fdupes——在Linux中查找并删除重复文件 -### What is fdupes? ### +### fdupes是啥东东? ### -**Fdupes** is a Linux utility written by **Adrian Lopez** in C programming Language released under MIT License. The application is able to find duplicate files in the given set of directories and sub-directories. Fdupes recognize duplicates by comparing MD5 signature of files followed by a byte-to-byte comparison. A lots of options can be passed with Fdupes to list, delete and replace the files with hardlinks to duplicates. +**Fdupes**是Linux下的一个工具,它由**Adrian Lopez**用C编程语言编写并基于MIT许可证发行,该应用程序可以在指定的目录及子目录中查找重复的文件。Fdupes通过对比文件的MD5签名,以及逐字节比较文件来识别重复内容,可以为Fdupes指定大量的选项以实现对文件的列出、删除、替换到文件副本的硬链接等操作。 -The comparison starts in the order: +对比以下列顺序开始: -**size comparison > Partial MD5 Signature Comparison > Full MD5 Signature Comparison > Byte-to-Byte Comparison.** +**大小对比 > 部分 MD5 签名对比 > 完整 MD5 签名对比 > 逐字节对比** -### Install fdupes on a Linux ### +### 安装 fdupes 到 Linux ### -Installation of latest version of fdupes (fdupes version 1.51) as easy as running following command on **Debian** based systems such as **Ubuntu** and **Linux Mint**. +在基于**Debian**的系统上,如**Ubuntu**和**Linux Mint**,安装最新版fdupes,用下面的命令手到擒来。 $ sudo apt-get install fdupes -On CentOS/RHEL and Fedora based systems, you need to turn on [epel repository][1] to install fdupes package. +在基于CentOS/RHEL和Fedora的系统上,你需要开启[epel仓库][1]来安装fdupes包。 # yum install fdupes # dnf install fdupes [On Fedora 22 onwards] -**Note**: The default package manager yum is replaced by dnf from Fedora 22 onwards… +**注意**:自Fedora 22之后,默认的包管理器yum被dnf取代了。 -### How to use fdupes command? ### - -1. For demonstration purpose, let’s a create few duplicate files under a directory (say tecmint) simply as: +### fdupes命令咋个搞? ### +1.作为演示的目的,让我们来在某个目录(比如 tecmint)下创建一些重复文件,命令如下: $ mkdir /home/"$USER"/Desktop/tecmint && cd /home/"$USER"/Desktop/tecmint && for i in {1..15}; do echo "I Love Tecmint. Tecmint is a very nice community of Linux Users." > tecmint${i}.txt ; done -After running above command, let’s verify the duplicates files are created or not using ls [command][2]. +在执行以上命令后,让我们使用ls[命令][2]验证重复文件是否创建。 $ ls -l @@ -55,11 +53,11 @@ After running above command, let’s verify the duplicates files are created or -rw-r--r-- 1 tecmint tecmint 65 Aug 8 11:22 tecmint8.txt -rw-r--r-- 1 tecmint tecmint 65 Aug 8 11:22 tecmint9.txt -The above script create **15** files namely tecmint1.txt, tecmint2.txt…tecmint15.txt and every files contains the same data i.e., +上面的脚本创建了**15**个文件,名称分别为tecmint1.txt,tecmint2.txt……tecmint15.txt,并且每个文件的数据相同,如 "I Love Tecmint. Tecmint is a very nice community of Linux Users." -2. Now search for duplicate files within the folder **tecmint**. +2.现在在**tecmint**文件夹内搜索重复的文件。 $ fdupes /home/$USER/Desktop/tecmint @@ -79,15 +77,15 @@ The above script create **15** files namely tecmint1.txt, tecmint2.txt…tecmint /home/tecmint/Desktop/tecmint/tecmint15.txt /home/tecmint/Desktop/tecmint/tecmint12.txt -3. Search for duplicates recursively under every directory including it’s sub-directories using the **-r** option. +3.使用**-r**选项在每个目录包括其子目录中递归搜索重复文件。 -It search across all the files and folder recursively, depending upon the number of files and folders it will take some time to scan duplicates. In that mean time, you will be presented with the total progress in terminal, something like this. +它会递归搜索所有文件和文件夹,花一点时间来扫描重复文件,时间的长短取决于文件和文件夹的数量。在此其间,终端中会显示全部过程,像下面这样。 $ fdupes -r /home Progress [37780/54747] 69% -4. See the size of duplicates found within a folder using the **-S** option. +4.使用**-S**选项来查看某个文件夹内找到的重复文件的大小。 $ fdupes -S /home/$USER/Desktop/tecmint @@ -108,7 +106,7 @@ It search across all the files and folder recursively, depending upon the number /home/tecmint/Desktop/tecmint/tecmint15.txt /home/tecmint/Desktop/tecmint/tecmint12.txt -5. You can see the size of duplicate files for every directory and subdirectories encountered within using the **-S** and **-r** options at the same time, as: +5.你可以同时使用**-S**和**-r**选项来查看所有涉及到的目录和子目录中的重复文件的大小,如下: $ fdupes -Sr /home/avi/Desktop/ @@ -133,11 +131,11 @@ It search across all the files and folder recursively, depending upon the number /home/tecmint/Desktop/resume_files/r-csc.html /home/tecmint/Desktop/resume_files/fc.html -6. Other than searching in one folder or all the folders recursively, you may choose to choose in two folders or three folders as required. Not to mention you can use option **-S** and/or **-r** if required. +6.不同于在一个或所有文件夹内递归搜索,你可以选择按要求有选择性地在两个或三个文件夹内进行搜索。不必再提醒你了吧,如有需要,你可以使用**-S**和/或**-r**选项。 $ fdupes /home/avi/Desktop/ /home/avi/Templates/ -7. To delete the duplicate files while preserving a copy you can use the option ‘**-d**’. Extra care should be taken while using this option else you might end up loosing necessary files/data and mind it the process is unrecoverable. +7.要删除重复文件,同时保留一个副本,你可以使用`**-d**`选项。使用该选项,你必须额外小心,否则最终结果可能会是文件/数据的丢失。郑重提醒,此操作不可恢复。 $ fdupes -d /home/$USER/Desktop/tecmint @@ -159,7 +157,7 @@ It search across all the files and folder recursively, depending upon the number Set 1 of 1, preserve files [1 - 15, all]: -You may notice that all the duplicates are listed and you are prompted to delete, either one by one or certain range or all in one go. You may select a range something like below to delete files files of specific range. +你可能注意到了,所有重复的文件被列了出来,并给出删除提示,一个一个来,或者指定范围,或者一次性全部删除。你可以选择一个范围,就像下面这样,来删除指定范围内的文件。 Set 1 of 1, preserve files [1 - 15, all]: 2-15 @@ -179,15 +177,15 @@ You may notice that all the duplicates are listed and you are prompted to delete [-] /home/tecmint/Desktop/tecmint/tecmint15.txt [-] /home/tecmint/Desktop/tecmint/tecmint12.txt -8. From safety point of view, you may like to print the output of ‘**fdupes**’ to file and then check text file to decide what file to delete. This decrease chances of getting your file deleted accidentally. You may do: +8.从安全角度出发,你可能想要打印`**fdupes**`的输出结果到文件中,然后检查文本文件来决定要删除什么文件。这可以降低意外删除文件的风险。你可以这么做: $ fdupes -Sr /home > /home/fdupes.txt -**Note**: You may replace ‘**/home**’ with the your desired folder. Also use option ‘**-r**’ and ‘**-S**’ if you want to search recursively and Print Size, respectively. +**注意**:你可以替换`**/home**`为你想要的文件夹。同时,如果你想要递归搜索并打印大小,可以使用`**-r**`和`**-S**`选项。 -9. You may omit the first file from each set of matches by using option ‘**-f**’. +9.你可以使用`**-f**`选项来忽略每个匹配集中的首个文件。 -First List files of the directory. +首先列出该目录中的文件。 $ ls -l /home/$USER/Desktop/tecmint @@ -198,7 +196,7 @@ First List files of the directory. -rw-r--r-- 1 tecmint tecmint 65 Aug 8 11:22 tecmint9 (copy).txt -rw-r--r-- 1 tecmint tecmint 65 Aug 8 11:22 tecmint9.txt -and then omit the first file from each set of matches. +然后,忽略掉每个匹配集中的首个文件。 $ fdupes -f /home/$USER/Desktop/tecmint @@ -207,13 +205,13 @@ and then omit the first file from each set of matches. /home/tecmint/Desktop/tecmint9 (another copy).txt /home/tecmint/Desktop/tecmint9 (4th copy).txt -10. Check installed version of fdupes. +10.检查已安装的fdupes版本。 $ fdupes --version fdupes 1.51 -11. If you need any help on fdupes you may use switch ‘**-h**’. +11.如果你需要关于fdupes的帮助,可以使用`**-h**`开关。 $ fdupes -h @@ -247,16 +245,15 @@ and then omit the first file from each set of matches. -v --version display fdupes version -h --help display this help message -That’s for all now. Let me know how you were finding and deleting duplicates files till now in Linux? and also tell me your opinion about this utility. Put your valuable feedback in the comment section below and don’t forget to like/share us and help us get spread. +到此为止了。让我知道你到现在为止你是怎么在Linux中查找并删除重复文件的?同时,也让我知道你关于这个工具的看法。在下面的评论部分中提供你有价值的反馈吧,别忘了为我们点赞并分享,帮助我们扩散哦。 -I am working on another utility called **fslint** to remove duplicate files, will soon post and you people will love to read. +我正在使用另外一个移除重复文件的工具,它叫**fslint**。很快就会把使用心得分享给大家哦,你们一定会喜欢看的。 -------------------------------------------------------------------------------- via: http://www.tecmint.com/fdupes-find-and-delete-duplicate-files-in-linux/ -作者:[Avishek Kumar][a] -译者:[译者ID](https://github.com/译者ID) +作者:[GOLinux](https://github.com/GOLinux) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 From 31c2f1416e45300f44b57be5518b824e926053ef Mon Sep 17 00:00:00 2001 From: wi-cuckoo Date: Wed, 12 Aug 2015 12:56:35 +0800 Subject: [PATCH 896/965] translated wi-cuckoo --- ...ence on RedHat Linux Package Management.md | 349 ------------------ ...ence on RedHat Linux Package Management.md | 348 +++++++++++++++++ 2 files changed, 348 insertions(+), 349 deletions(-) delete mode 100644 sources/tech/20150623 Shilpa Nair Shares Her Interview Experience on RedHat Linux Package Management.md create mode 100644 translated/tech/20150623 Shilpa Nair Shares Her Interview Experience on RedHat Linux Package Management.md diff --git a/sources/tech/20150623 Shilpa Nair Shares Her Interview Experience on RedHat Linux Package Management.md b/sources/tech/20150623 Shilpa Nair Shares Her Interview Experience on RedHat Linux Package Management.md deleted file mode 100644 index 6243a8c0de..0000000000 --- a/sources/tech/20150623 Shilpa Nair Shares Her Interview Experience on RedHat Linux Package Management.md +++ /dev/null @@ -1,349 +0,0 @@ -translating wi-cuckoo -Shilpa Nair Shares Her Interview Experience on RedHat Linux Package Management -================================================================================ -**Shilpa Nair has just graduated in the year 2015. She went to apply for Trainee position in a National News Television located in Noida, Delhi. When she was in the last year of graduation and searching for help on her assignments she came across Tecmint. Since then she has been visiting Tecmint regularly.** - -![Linux Interview Questions on RPM](http://www.tecmint.com/wp-content/uploads/2015/06/Linux-Interview-Questions-on-RPM.jpeg) - -Linux Interview Questions on RPM - -All the questions and answers are rewritten based upon the memory of Shilpa Nair. - -> “Hi friends! I am Shilpa Nair from Delhi. I have completed my graduation very recently and was hunting for a Trainee role soon after my degree. I have developed a passion for UNIX since my early days in the collage and I was looking for a role that suits me and satisfies my soul. I was asked a lots of questions and most of them were basic questions related to RedHat Package Management.” - -Here are the questions, that I was asked and their corresponding answers. I am posting only those questions that are related to RedHat GNU/Linux Package Management, as they were mainly asked. - -### 1. How will you find if a package is installed or not? Say you have to find if ‘nano’ is installed or not, what will you do? ### - -> **Answer** : To find the package nano, weather installed or not, we can use rpm command with the option -q is for query and -a stands for all the installed packages. -> -> # rpm -qa nano -> OR -> # rpm -qa | grep -i nano -> -> nano-2.3.1-10.el7.x86_64 -> -> Also the package name must be complete, an incomplete package name will return the prompt without printing anything which means that package (incomplete package name) is not installed. It can be understood easily by the example below: -> -> We generally substitute vim command with vi. But if we find package vi/vim we will get no result on the standard output. -> -> # vi -> # vim -> -> However we can clearly see that the package is installed by firing vi/vim command. Here is culprit is incomplete file name. If we are not sure of the exact file-name we can use wildcard as: -> -> # rpm -qa vim* -> -> vim-minimal-7.4.160-1.el7.x86_64 -> -> This way we can find information about any package, if installed or not. - -### 2. How will you install a package XYZ using rpm? ### - -> **Answer** : We can install any package (*.rpm) using rpm command a shown below, here options -i (install), -v (verbose or display additional information) and -h (print hash mark during package installation). -> -> # rpm -ivh peazip-1.11-1.el6.rf.x86_64.rpm -> -> Preparing... ################################# [100%] -> Updating / installing... -> 1:peazip-1.11-1.el6.rf ################################# [100%] -> -> If upgrading a package from earlier version -U switch should be used, option -v and -h follows to make sure we get a verbose output along with hash Mark, that makes it readable. - -### 3. You have installed a package (say httpd) and now you want to see all the files and directories installed and created by the above package. What will you do? ### - -> **Answer** : We can list all the files (Linux treat everything as file including directories) installed by the package httpd using options -l (List all the files) and -q (is for query). -> -> # rpm -ql httpd -> -> /etc/httpd -> /etc/httpd/conf -> /etc/httpd/conf.d -> ... - -### 4. You are supposed to remove a package say postfix. What will you do? ### - -> **Answer** : First we need to know postfix was installed by what package. Find the package name that installed postfix using options -e erase/uninstall a package) and –v (verbose output). -> -> # rpm -qa postfix* -> -> postfix-2.10.1-6.el7.x86_64 -> -> and then remove postfix as: -> -> # rpm -ev postfix-2.10.1-6.el7.x86_64 -> -> Preparing packages... -> postfix-2:3.0.1-2.fc22.x86_64 - -### 5. Get detailed information about an installed package, means information like Version, Release, Install Date, Size, Summary and a brief description. ### - -> **Answer** : We can get detailed information about an installed package by using option -qa with rpm followed by package name. -> -> For example to find details of package openssh, all I need to do is: -> -> # rpm -qi openssh -> -> [root@tecmint tecmint]# rpm -qi openssh -> Name : openssh -> Version : 6.8p1 -> Release : 5.fc22 -> Architecture: x86_64 -> Install Date: Thursday 28 May 2015 12:34:50 PM IST -> Group : Applications/Internet -> Size : 1542057 -> License : BSD -> .... - -### 6. You are not sure about what are the configuration files provided by a specific package say httpd. How will you find list of all the configuration files provided by httpd and their location. ### - -> **Answer** : We need to run option -c followed by package name with rpm command and it will list the name of all the configuration file and their location. -> -> # rpm -qc httpd -> -> /etc/httpd/conf.d/autoindex.conf -> /etc/httpd/conf.d/userdir.conf -> /etc/httpd/conf.d/welcome.conf -> /etc/httpd/conf.modules.d/00-base.conf -> /etc/httpd/conf/httpd.conf -> /etc/sysconfig/httpd -> -> Similarly we can list all the associated document files as: -> -> # rpm -qd httpd -> -> /usr/share/doc/httpd/ABOUT_APACHE -> /usr/share/doc/httpd/CHANGES -> /usr/share/doc/httpd/LICENSE -> ... -> -> also, we can list the associated License file as: -> -> # rpm -qL openssh -> -> /usr/share/licenses/openssh/LICENCE -> -> Not to mention that the option -d and option -L in the above command stands for ‘documents‘ and ‘License‘, respectively. - -### 7. You came across a configuration file located at ‘/usr/share/alsa/cards/AACI.conf’ and you are not sure this configuration file is associated with what package. How will you find out the parent package name? ### - -> **Answer** : When a package is installed, the relevant information gets stored in the database. So it is easy to trace what provides the above package using option -qf (-f query packages owning files). -> -> # rpm -qf /usr/share/alsa/cards/AACI.conf -> alsa-lib-1.0.28-2.el7.x86_64 -> -> Similarly we can find (what provides) information about any sub-packge, document files and License files. - -### 8. How will you find list of recently installed software’s using rpm? ### - -> **Answer** : As said earlier, everything being installed is logged in database. So it is not difficult to query the rpm database and find the list of recently installed software’s. -> -> We can do this by running the below commands using option –last (prints the most recent installed software’s). -> -> # rpm -qa --last -> -> The above command will print all the packages installed in a order such that, the last installed software appears at the top. -> -> If our concern is to find out specific package, we can grep that package (say sqlite) from the list, simply as: -> -> # rpm -qa --last | grep -i sqlite -> -> sqlite-3.8.10.2-1.fc22.x86_64 Thursday 18 June 2015 05:05:43 PM IST -> -> We can also get a list of 10 most recently installed software simply as: -> -> # rpm -qa --last | head -> -> We can refine the result to output a more custom result simply as: -> -> # rpm -qa --last | head -n 2 -> -> In the above command -n represents number followed by a numeric value. The above command prints a list of 2 most recent installed software. - -### 9. Before installing a package, you are supposed to check its dependencies. What will you do? ### - -> **Answer** : To check the dependencies of a rpm package (XYZ.rpm), we can use switches -q (query package), -p (query a package file) and -R (Requires / List packages on which this package depends i.e., dependencies). -> -> # rpm -qpR gedit-3.16.1-1.fc22.i686.rpm -> -> /bin/sh -> /usr/bin/env -> glib2(x86-32) >= 2.40.0 -> gsettings-desktop-schemas -> gtk3(x86-32) >= 3.16 -> gtksourceview3(x86-32) >= 3.16 -> gvfs -> libX11.so.6 -> ... - -### 10. Is rpm a front-end Package Management Tool? ### - -> **Answer** : No! rpm is a back-end package management for RPM based Linux Distribution. -> -> [YUM][1] which stands for Yellowdog Updater Modified is the front-end for rpm. YUM automates the overall process of resolving dependencies and everything else. -> -> Very recently [DNF][2] (Dandified YUM) replaced YUM in Fedora 22. Though YUM is still available to be used in RHEL and CentOS, we can install dnf and use it alongside of YUM. DNF is said to have a lots of improvement over YUM. -> -> Good to know, you keep yourself updated. Lets move to the front-end part. - -### 11. How will you list all the enabled repolist on a system. ### - -> **Answer** : We can list all the enabled repos on a system simply using following commands. -> -> # yum repolist -> or -> # dnf repolist -> -> Last metadata expiration check performed 0:30:03 ago on Mon Jun 22 16:50:00 2015. -> repo id repo name status -> *fedora Fedora 22 - x86_64 44,762 -> ozonos Repository for Ozon OS 61 -> *updates Fedora 22 - x86_64 - Updates -> -> The above command will only list those repos that are enabled. If we need to list all the repos, enabled or not, we can do. -> -> # yum repolist all -> or -> # dnf repolist all -> -> Last metadata expiration check performed 0:29:45 ago on Mon Jun 22 16:50:00 2015. -> repo id repo name status -> *fedora Fedora 22 - x86_64 enabled: 44,762 -> fedora-debuginfo Fedora 22 - x86_64 - Debug disabled -> fedora-source Fedora 22 - Source disabled -> ozonos Repository for Ozon OS enabled: 61 -> *updates Fedora 22 - x86_64 - Updates enabled: 5,018 -> updates-debuginfo Fedora 22 - x86_64 - Updates - Debug - -### 12. How will you list all the available and installed packages on a system? ### - -> **Answer** : To list all the available packages on a system, we can do: -> -> # yum list available -> or -> # dnf list available -> -> ast metadata expiration check performed 0:34:09 ago on Mon Jun 22 16:50:00 2015. -> Available Packages -> 0ad.x86_64 0.0.18-1.fc22 fedora -> 0ad-data.noarch 0.0.18-1.fc22 fedora -> 0install.x86_64 2.6.1-2.fc21 fedora -> 0xFFFF.x86_64 0.3.9-11.fc22 fedora -> 2048-cli.x86_64 0.9-4.git20141214.723738c.fc22 fedora -> 2048-cli-nocurses.x86_64 0.9-4.git20141214.723738c.fc22 fedora -> .... -> -> To list all the installed Packages on a system, we can do. -> -> # yum list installed -> or -> # dnf list installed -> -> Last metadata expiration check performed 0:34:30 ago on Mon Jun 22 16:50:00 2015. -> Installed Packages -> GeoIP.x86_64 1.6.5-1.fc22 @System -> GeoIP-GeoLite-data.noarch 2015.05-1.fc22 @System -> NetworkManager.x86_64 1:1.0.2-1.fc22 @System -> NetworkManager-libnm.x86_64 1:1.0.2-1.fc22 @System -> aajohan-comfortaa-fonts.noarch 2.004-4.fc22 @System -> .... -> -> To list all the available and installed packages on a system, we can do. -> -> # yum list -> or -> # dnf list -> -> Last metadata expiration check performed 0:32:56 ago on Mon Jun 22 16:50:00 2015. -> Installed Packages -> GeoIP.x86_64 1.6.5-1.fc22 @System -> GeoIP-GeoLite-data.noarch 2015.05-1.fc22 @System -> NetworkManager.x86_64 1:1.0.2-1.fc22 @System -> NetworkManager-libnm.x86_64 1:1.0.2-1.fc22 @System -> aajohan-comfortaa-fonts.noarch 2.004-4.fc22 @System -> acl.x86_64 2.2.52-7.fc22 @System -> .... - -### 13. How will you install and update a package and a group of packages separately on a system using YUM/DNF? ### - -> Answer : To Install a package (say nano), we can do, -> -> # yum install nano -> -> To Install a Group of Package (say Haskell), we can do. -> -> # yum groupinstall 'haskell' -> -> To update a package (say nano), we can do. -> -> # yum update nano -> -> To update a Group of Package (say Haskell), we can do. -> -> # yum groupupdate 'haskell' - -### 14. How will you SYNC all the installed packages on a system to stable release? ### - -> **Answer** : We can sync all the packages on a system (say CentOS or Fedora) to stable release as, -> -> # yum distro-sync [On CentOS/RHEL] -> or -> # dnf distro-sync [On Fedora 20 Onwards] - -Seems you have done a good homework before coming for the interview,Good!. Before proceeding further I just want to ask one more question. - -### 15. Are you familiar with YUM local repository? Have you tried making a Local YUM repository? Let me know in brief what you will do to create a local YUM repo. ### - -> **Answer** : First I would like to Thank you Sir for appreciation. Coming to question, I must admit that I am quiet familiar with Local YUM repositories and I have already implemented it for testing purpose in my local machine. -> -> 1. To set up Local YUM repository, we need to install the below three packages as: -> -> # yum install deltarpm python-deltarpm createrepo -> -> 2. Create a directory (say /home/$USER/rpm) and copy all the RPMs from RedHat/CentOS DVD to that folder. -> -> # mkdir /home/$USER/rpm -> # cp /path/to/rpm/on/DVD/*.rpm /home/$USER/rpm -> -> 3. Create base repository headers as. -> -> # createrepo -v /home/$USER/rpm -> -> 4. Create the .repo file (say abc.repo) at the location /etc/yum.repos.d simply as: -> -> cd /etc/yum.repos.d && cat << EOF > abc.repo -> [local-installation]name=yum-local -> baseurl=file:///home/$USER/rpm -> enabled=1 -> gpgcheck=0 -> EOF - -**Important**: Make sure to remove $USER with user_name. - -That’s all we need to do to create a Local YUM repository. We can now install applications from here, that is relatively fast, secure and most important don’t need an Internet connection. - -Okay! It was nice interviewing you. I am done. I am going to suggest your name to HR. You are a young and brilliant candidate we would like to have in our organization. If you have any question you may ask me. - -**Me**: Sir, it was really a very nice interview and I feel very lucky today, to have cracked the interview.. - -Obviously it didn’t end here. I asked a lots of questions like the project they are handling. What would be my role and responsibility and blah..blah..blah - -Friends, by the time all these were documented I have been called for HR round which is 3 days from now. Hope I do my best there as well. All your blessings will count. - -Thankyou friends and Tecmint for taking time and documenting my experience. Mates I believe Tecmint is doing some really extra-ordinary which must be praised. When we share ours experience with other, other get to know many things from us and we get to know our mistakes. - -It enhances our confidence level. If you have given any such interview recently, don’t keep it to yourself. Spread it! Let all of us know that. You may use the below form to share your experience with us. - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/linux-rpm-package-management-interview-questions/ - -作者:[Avishek Kumar][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.tecmint.com/author/avishek/ -[1]:http://www.tecmint.com/20-linux-yum-yellowdog-updater-modified-commands-for-package-mangement/ -[2]:http://www.tecmint.com/dnf-commands-for-fedora-rpm-package-management/ diff --git a/translated/tech/20150623 Shilpa Nair Shares Her Interview Experience on RedHat Linux Package Management.md b/translated/tech/20150623 Shilpa Nair Shares Her Interview Experience on RedHat Linux Package Management.md new file mode 100644 index 0000000000..f095a31c65 --- /dev/null +++ b/translated/tech/20150623 Shilpa Nair Shares Her Interview Experience on RedHat Linux Package Management.md @@ -0,0 +1,348 @@ +Shilpa Nair 分享了她面试 RedHat Linux 包管理方面的经验 +======================================================================== +**Shilpa Nair 刚于2015年毕业。她之后去了一家位于 Noida,Delhi 的国家新闻电视台,应聘实习生的岗位。在她去年毕业季的时候,常逛 Tecmint 寻求作业上的帮助。从那时开始,她就常去 Tecmint。** + +![Linux Interview Questions on RPM](http://www.tecmint.com/wp-content/uploads/2015/06/Linux-Interview-Questions-on-RPM.jpeg) + +有关 RPM 方面的 Linux 面试题 + +所有的问题和回答都是 Shilpa Nair 根据回忆重写的。 + +> “大家好!我是来自 Delhi 的Shilpa Nair。我不久前才顺利毕业,正寻找一个实习的机会。在大学早期的时候,我就对 UNIX 十分喜爱,所以我也希望这个机会能适合我,满足我的兴趣。我被提问了很多问题,大部分都是关于 RedHat 包管理的基础问题。” + +下面就是我被问到的问题,和对应的回答。我仅贴出了与 RedHat GNU/Linux 包管理相关的,也是主要被提问的。 + +### 1,里如何查找一个包安装与否?假设你需要确认 ‘nano’ 有没有安装,你怎么做? ### + +> **回答**:为了确认 nano 软件包有没有安装,我们可以使用 rpm 命令,配合 -q 和 -a 选项来查询所有已安装的包 +> +> # rpm -qa nano +> OR +> # rpm -qa | grep -i nano +> +> nano-2.3.1-10.el7.x86_64 +> +> 同时包的名字必须是完成的,不完整的包名返回提示,不打印任何东西,就是说这包(包名字不全)未安装。下面的例子会更好理解些: +> +> 我们通常使用 vim 替代 vi 命令。当时如果我们查找安装包 vi/vim 的时候,我们就会看到标准输出上没有任何结果。 +> +> # vi +> # vim +> +> 尽管如此,我们仍然可以通过使用 vi/vim 命令来清楚地知道包有没有安装。Here is ... name(这句不知道)。如果我们不确切知道完整的文件名,我们可以使用通配符: +> +> # rpm -qa vim* +> +> vim-minimal-7.4.160-1.el7.x86_64 +> +> 通过这种方式,我们可以获得任何软件包的信息,安装与否。 + +### 2. 你如何使用 rpm 命令安装 XYZ 软件包? ### + +> **回答**:我们可以使用 rpm 命令安装任何的软件包(*.rpm),像下面这样,选项 -i(install),-v(冗余或者显示额外的信息)和 -h(打印#号显示进度,在安装过程中)。 +> +> # rpm -ivh peazip-1.11-1.el6.rf.x86_64.rpm +> +> Preparing... ################################# [100%] +> Updating / installing... +> 1:peazip-1.11-1.el6.rf ################################# [100%] +> +> 如果要升级一个早期版本的包,应加上 -U 选项,选项 -v 和 -h 可以确保我们得到用 # 号表示的冗余输出,这增加了可读性。 + +### 3. 你已经安装了一个软件包(假设是 httpd),现在你想看看软件包创建并安装的所有文件和目录,你会怎么做? ### + +> **回答**:使用选项 -l(列出所有文件)和 -q(查询)列出 httpd 软件包安装的所有文件(Linux哲学:所有的都是文件,包括目录)。 +> +> # rpm -ql httpd +> +> /etc/httpd +> /etc/httpd/conf +> /etc/httpd/conf.d +> ... + +### 4. 假如你要移除一个软件包,叫 postfix。你会怎么做? ### + +> **回答**:首先我们需要知道什么包安装了 postfix。查找安装 postfix 的包名后,使用 -e(擦除/卸载软件包)和 -v(冗余输出)两个选项来实现。 +> +> # rpm -qa postfix* +> +> postfix-2.10.1-6.el7.x86_64 +> +> 然后移除 postfix,如下: +> +> # rpm -ev postfix-2.10.1-6.el7.x86_64 +> +> Preparing packages... +> postfix-2:3.0.1-2.fc22.x86_64 + +### 5. 获得一个已安装包的具体信息,如版本,发行号,安装日期,大小,总结和一个间短的描述。 ### + +> **回答**:我们通过使用 rpm 的选项 -qi,后面接包名,可以获得关于一个已安装包的具体信息。 +> +> 举个例子,为了获得 openssh 包的具体信息,我需要做的就是: +> +> # rpm -qi openssh +> +> [root@tecmint tecmint]# rpm -qi openssh +> Name : openssh +> Version : 6.8p1 +> Release : 5.fc22 +> Architecture: x86_64 +> Install Date: Thursday 28 May 2015 12:34:50 PM IST +> Group : Applications/Internet +> Size : 1542057 +> License : BSD +> .... + +### 6. 假如你不确定一个指定包的配置文件在哪,比如 httpd。你如何找到所有 httpd 提供的配置文件列表和位置。 ### + +> **回答**: 我们需要用选项 -c 接包名,这会列出所有配置文件的名字和他们的位置。 +> +> # rpm -qc httpd +> +> /etc/httpd/conf.d/autoindex.conf +> /etc/httpd/conf.d/userdir.conf +> /etc/httpd/conf.d/welcome.conf +> /etc/httpd/conf.modules.d/00-base.conf +> /etc/httpd/conf/httpd.conf +> /etc/sysconfig/httpd +> +> 相似地,我们可以列出所有相关的文档文件,如下: +> +> # rpm -qd httpd +> +> /usr/share/doc/httpd/ABOUT_APACHE +> /usr/share/doc/httpd/CHANGES +> /usr/share/doc/httpd/LICENSE +> ... +> +> 我们也可以列出所有相关的证书文件,如下: +> +> # rpm -qL openssh +> +> /usr/share/licenses/openssh/LICENCE +> +> 忘了说明上面的选项 -d 和 -L 分别表示 “文档” 和 “证书”,抱歉。 + +### 7. 你进入了一个配置文件,位于‘/usr/share/alsa/cards/AACI.conf’,现在你不确定该文件属于哪个包。你如何查找出包的名字? ### + +> **回答**:当一个包被安装后,相关的信息就存储在了数据库里。所以使用选项 -qf(-f 查询包拥有的文件)很容易追踪谁提供了上述的包。 +> +> # rpm -qf /usr/share/alsa/cards/AACI.conf +> alsa-lib-1.0.28-2.el7.x86_64 +> +> 类似地,我们可以查找(谁提供的)关于任何子包,文档和证书文件的信息。 + +### 8. 你如何使用 rpm 查找最近安装的软件列表? ### + +> **回答**:如刚刚说的,每一样被安装的文件都记录在了数据库里。所以这并不难,通过查询 rpm 的数据库,找到最近安装软件的列表。 +> +> 我们通过运行下面的命令,使用选项 -last(打印出最近安装的软件)达到目的。 +> +> # rpm -qa --last +> +> 上面的命令会打印出所有安装的软件,最近一次安装的软件在列表的顶部。 +> +> 如果我们关心的是找出特定的包,我们可以使用 grep 命令从列表中匹配包(假设是 sqlite ),简单如下: +> +> # rpm -qa --last | grep -i sqlite +> +> sqlite-3.8.10.2-1.fc22.x86_64 Thursday 18 June 2015 05:05:43 PM IST +> +> 我们也可以获得10个最近安装的软件列表,简单如下: +> +> # rpm -qa --last | head +> +> 我们可以重定义一下,输出想要的结果,简单如下: +> +> # rpm -qa --last | head -n 2 +> +> 上面的命令中,-n 代表数目,后面接一个常数值。该命令是打印2个最近安装的软件的列表。 + +### 9. 安装一个包之前,你如果要检查其依赖。你会怎么做? ### + +> **回答**:检查一个 rpm 包(XYZ.rpm)的依赖,我们可以使用选项 -q(查询包),-p(指定包名)和 -R(查询/列出该包依赖的包,嗯,就是依赖)。 +> +> # rpm -qpR gedit-3.16.1-1.fc22.i686.rpm +> +> /bin/sh +> /usr/bin/env +> glib2(x86-32) >= 2.40.0 +> gsettings-desktop-schemas +> gtk3(x86-32) >= 3.16 +> gtksourceview3(x86-32) >= 3.16 +> gvfs +> libX11.so.6 +> ... + +### 10. rpm 是不是一个前端的包管理工具呢? ### + +> **回答**:不是!rpm 是一个后端管理工具,适用于基于 Linux 发行版的 RPM (此处指 Redhat Package Management)。 +> +> [YUM][1],全称 Yellowdog Updater Modified,是一个 RPM 的前端工具。YUM 命令自动完成所有工作,包括解决依赖和其他一切事务。 +> +> 最近,[DNF][2](YUM命令升级版)在Fedora 22发行版中取代了 YUM。尽管 YUM 仍然可以在 RHEL 和 CentOS 平台使用,我们也可以安装 dnf,与 YUM 命令共存使用。据说 DNF 较于 YUM 有很多提高。 +> +> 知道更多总是好的,保持自我更新。现在我们移步到前端部分来谈谈。 + +### 11. 你如何列出一个系统上面所有可用的仓库列表。 ### + +> **回答**:简单地使用下面的命令,我们就可以列出一个系统上所有可用的仓库列表。 +> +> # yum repolist +> 或 +> # dnf repolist +> +> Last metadata expiration check performed 0:30:03 ago on Mon Jun 22 16:50:00 2015. +> repo id repo name status +> *fedora Fedora 22 - x86_64 44,762 +> ozonos Repository for Ozon OS 61 +> *updates Fedora 22 - x86_64 - Updates +> +> 上面的命令仅会列出可用的仓库。如果你需要列出所有的仓库,不管可用与否,可以这样做。 +> +> # yum repolist all +> or +> # dnf repolist all +> +> Last metadata expiration check performed 0:29:45 ago on Mon Jun 22 16:50:00 2015. +> repo id repo name status +> *fedora Fedora 22 - x86_64 enabled: 44,762 +> fedora-debuginfo Fedora 22 - x86_64 - Debug disabled +> fedora-source Fedora 22 - Source disabled +> ozonos Repository for Ozon OS enabled: 61 +> *updates Fedora 22 - x86_64 - Updates enabled: 5,018 +> updates-debuginfo Fedora 22 - x86_64 - Updates - Debug + +### 12. 你如何列出一个系统上所有可用并且安装了的包? ### + +> **回答**:列出一个系统上所有可用的包,我们可以这样做: +> +> # yum list available +> 或 +> # dnf list available +> +> ast metadata expiration check performed 0:34:09 ago on Mon Jun 22 16:50:00 2015. +> Available Packages +> 0ad.x86_64 0.0.18-1.fc22 fedora +> 0ad-data.noarch 0.0.18-1.fc22 fedora +> 0install.x86_64 2.6.1-2.fc21 fedora +> 0xFFFF.x86_64 0.3.9-11.fc22 fedora +> 2048-cli.x86_64 0.9-4.git20141214.723738c.fc22 fedora +> 2048-cli-nocurses.x86_64 0.9-4.git20141214.723738c.fc22 fedora +> .... +> +> 而列出一个系统上所有已安装的包,我们可以这样做。 +> +> # yum list installed +> or +> # dnf list installed +> +> Last metadata expiration check performed 0:34:30 ago on Mon Jun 22 16:50:00 2015. +> Installed Packages +> GeoIP.x86_64 1.6.5-1.fc22 @System +> GeoIP-GeoLite-data.noarch 2015.05-1.fc22 @System +> NetworkManager.x86_64 1:1.0.2-1.fc22 @System +> NetworkManager-libnm.x86_64 1:1.0.2-1.fc22 @System +> aajohan-comfortaa-fonts.noarch 2.004-4.fc22 @System +> .... +> +> 而要同时满足两个要求的时候,我们可以这样做。 +> +> # yum list +> 或 +> # dnf list +> +> Last metadata expiration check performed 0:32:56 ago on Mon Jun 22 16:50:00 2015. +> Installed Packages +> GeoIP.x86_64 1.6.5-1.fc22 @System +> GeoIP-GeoLite-data.noarch 2015.05-1.fc22 @System +> NetworkManager.x86_64 1:1.0.2-1.fc22 @System +> NetworkManager-libnm.x86_64 1:1.0.2-1.fc22 @System +> aajohan-comfortaa-fonts.noarch 2.004-4.fc22 @System +> acl.x86_64 2.2.52-7.fc22 @System +> .... + +### 13. 你会怎么分别安装和升级一个包与一组包,在一个系统上面使用 YUM/DNF? ### + +> **回答**:安装一个包(假设是 nano),我们可以这样做, +> +> # yum install nano +> +> 而安装一组包(假设是 Haskell),我们可以这样做, +> +> # yum groupinstall 'haskell' +> +> 升级一个包(还是 nano),我们可以这样做, +> +> # yum update nano +> +> 而为了升级一组包(还是 haskell),我们可以这样做, +> +> # yum groupupdate 'haskell' + +### 14. 你会如何同步一个系统上面的所有安装软件到稳定发行版? ### + +> **回答**:我们可以一个系统上(假设是 CentOS 或者 Fedora)的所有包到稳定发行版,如下, +> +> # yum distro-sync [On CentOS/ RHEL] +> 或 +> # dnf distro-sync [On Fedora 20之后版本] + +似乎来面试之前你做了相当不多的功课,很好!在进一步交谈前,我还想问一两个问题。 + +### 15. 你对 YUM 本地仓库熟悉吗?你尝试过建立一个本地 YUM 仓库吗?让我们简单看看你会怎么建立一个本地 YUM 仓库。 ### + +> **回答**:首先,感谢你的夸奖。回到问题,我必须承认我对本地 YUM 仓库十分熟悉,并且在我的本地主机上也部署过,作为测试用。 +> +> 1. 为了建立本地 YUM 仓库,我们需要安装下面三个包: +> +> # yum install deltarpm python-deltarpm createrepo +> +> 2. 新建一个目录(假设 /home/$USER/rpm),然后复制 RedHat/CentOS DVD 上的 RPM 包到这个文件夹下 +> +> # mkdir /home/$USER/rpm +> # cp /path/to/rpm/on/DVD/*.rpm /home/$USER/rpm +> +> 3. 新建基本的库头文件如下。 +> +> # createrepo -v /home/$USER/rpm +> +> 4. 在路径 /etc/yum.repo.d 下创建一个 .repo 文件(如 abc.repo): +> +> cd /etc/yum.repos.d && cat << EOF > abc.repo +> [local-installation]name=yum-local +> baseurl=file:///home/$USER/rpm +> enabled=1 +> gpgcheck=0 +> EOF + +**重要**:用你的用户名替换掉 $USER。 + +以上就是创建一个本地 YUM 仓库所要做的全部工作。我们现在可以从这里安装软件了,相对快一些,安全一些,并且最重要的是不需要 Internet 连接。 + +好了!面试过程很愉快。我已经问完了。我会将你推荐给 HR。你是一个年轻且十分聪明的候选者,我们很愿意你加入进来。如果你有任何问题,你可以问我。 + +**我**:谢谢,这确实是一次愉快的面试,我感到非常幸运今天,然后这次面试就毁了。。。 + +显然,不会在这里结束。我问了很多问题,比如他们正在做的项目。我会担任什么角色,负责什么,,,balabalabala + +小伙伴们,3天以前 HR 轮的所有问题到时候也会被写成文档。希望我当时表现不错。感谢你们所有的祝福。 + +谢谢伙伴们和 Tecmint,花时间来编辑我的面试经历。我相信 Tecmint 好伙伴们做了很大的努力,必要要赞一个。当我们与他人分享我们的经历的时候,其他人从我们这里知道了更多,而我们自己则发现了自己的不足。 + +这增加了我们的信心。如果你最近也有任何类似的面试经历,别自己蔵着。分享出来!让我们所有人都知道。你可以使用如下的格式来与我们分享你的经历。 + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/linux-rpm-package-management-interview-questions/ + +作者:[Avishek Kumar][a] +译者:[wi-cuckoo](https://github.com/wi-cuckoo) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/avishek/ +[1]:http://www.tecmint.com/20-linux-yum-yellowdog-updater-modified-commands-for-package-mangement/ +[2]:http://www.tecmint.com/dnf-commands-for-fedora-rpm-package-management/ From d00a59eee12db7b2ae81fea8ca39046d75e00f77 Mon Sep 17 00:00:00 2001 From: DeadFire Date: Wed, 12 Aug 2015 16:24:17 +0800 Subject: [PATCH 897/965] =?UTF-8?q?20150812-1=20=E9=80=89=E9=A2=98=20=20RH?= =?UTF-8?q?CE=20=E4=B8=93=E9=A2=98=20=E6=96=87=E7=AB=A0=E6=9C=AA=E5=85=A8?= =?UTF-8?q?=E9=83=A8=E5=AE=8C=E7=BB=93=EF=BC=8C=E7=9B=AE=E5=89=8D=E5=8F=AA?= =?UTF-8?q?=E6=9C=89=E4=B8=89=E7=AF=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...o Setup and Test Static Network Routing.md | 227 ++++++++++++++++++ ...ation and Set Kernel Runtime Parameters.md | 177 ++++++++++++++ ...m Activity Reports Using Linux Toolsets.md | 182 ++++++++++++++ 3 files changed, 586 insertions(+) create mode 100644 sources/tech/RHCE/Part 1 - RHCE Series--How to Setup and Test Static Network Routing.md create mode 100644 sources/tech/RHCE/Part 2 - How to Perform Packet Filtering Network Address Translation and Set Kernel Runtime Parameters.md create mode 100644 sources/tech/RHCE/Part 3 - How to Produce and Deliver System Activity Reports Using Linux Toolsets.md diff --git a/sources/tech/RHCE/Part 1 - RHCE Series--How to Setup and Test Static Network Routing.md b/sources/tech/RHCE/Part 1 - RHCE Series--How to Setup and Test Static Network Routing.md new file mode 100644 index 0000000000..03356f9dd1 --- /dev/null +++ b/sources/tech/RHCE/Part 1 - RHCE Series--How to Setup and Test Static Network Routing.md @@ -0,0 +1,227 @@ +Part 1 - RHCE Series: How to Setup and Test Static Network Routing +================================================================================ +RHCE (Red Hat Certified Engineer) is a certification from Red Hat company, which gives an open source operating system and software to the enterprise community, It also gives training, support and consulting services for the companies. + +![RHCE Exam Preparation Guide](http://www.tecmint.com/wp-content/uploads/2015/07/RHCE-Exam-Series-by-TecMint.jpg) + +RHCE Exam Preparation Guide + +This RHCE (Red Hat Certified Engineer) is a performance-based exam (codename EX300), who possesses the additional skills, knowledge, and abilities required of a senior system administrator responsible for Red Hat Enterprise Linux (RHEL) systems. + +**Important**: [Red Hat Certified System Administrator][1] (RHCSA) certification is required to earn RHCE certification. + +Following are the exam objectives based on the Red Hat Enterprise Linux 7 version of the exam, which will going to cover in this RHCE series: + +- Part 1: How to Setup and Test Static Routing in RHEL 7 +- Part 2: How to Perform Packet Filtering, Network Address Translation and Set Kernel Runtime Parameters +- Part 3: How to Produce and Deliver System Activity Reports Using Linux Toolsets +- Part 4: Automate System Maintenance Tasks Using Shell Scripts +- Part 5: How to Configure Local and Remote System Logging +- Part 6: How to Configure a Samba Server and a NFS Server +- Part 7: Setting Up Complete SMTP Server for Mailing +- Part 8: Setting Up HTTPS and TLS on RHEL 7 +- Part 9: Setting Up Network Time Protocol +- Part 10: How to Configure a Cache-Only DNS Server + +To view fees and register for an exam in your country, check the [RHCE Certification][2] page. + +In this Part 1 of the RHCE series and the next, we will present basic, yet typical, cases where the principles of static routing, packet filtering, and network address translation come into play. + +![Setup Static Network Routing in RHEL](http://www.tecmint.com/wp-content/uploads/2015/07/Setup-Static-Network-Routing-in-RHEL-7.jpg) + +RHCE: Setup and Test Network Static Routing – Part 1 + +Please note that we will not cover them in depth, but rather organize these contents in such a way that will be helpful to take the first steps and build from there. + +### Static Routing in Red Hat Enterprise Linux 7 ### + +One of the wonders of modern networking is the vast availability of devices that can connect groups of computers, whether in relatively small numbers and confined to a single room or several machines in the same building, city, country, or across continents. + +However, in order to effectively accomplish this in any situation, network packets need to be routed, or in other words, the path they follow from source to destination must be ruled somehow. + +Static routing is the process of specifying a route for network packets other than the default, which is provided by a network device known as the default gateway. Unless specified otherwise through static routing, network packets are directed to the default gateway; with static routing, other paths are defined based on predefined criteria, such as the packet destination. + +Let us define the following scenario for this tutorial. We have a Red Hat Enterprise Linux 7 box connecting to router #1 [192.168.0.1] to access the Internet and machines in 192.168.0.0/24. + +A second router (router #2) has two network interface cards: enp0s3 is also connected to router #1 to access the Internet and to communicate with the RHEL 7 box and other machines in the same network, whereas the other (enp0s8) is used to grant access to the 10.0.0.0/24 network where internal services reside, such as a web and / or database server. + +This scenario is illustrated in the diagram below: + +![Static Routing Network Diagram](http://www.tecmint.com/wp-content/uploads/2015/07/Static-Routing-Network-Diagram.png) + +Static Routing Network Diagram + +In this article we will focus exclusively on setting up the routing table on our RHEL 7 box to make sure that it can both access the Internet through router #1 and the internal network via router #2. + +In RHEL 7, you will use the [ip command][3] to configure and show devices and routing using the command line. These changes can take effect immediately on a running system but since they are not persistent across reboots, we will use ifcfg-enp0sX and route-enp0sX files inside /etc/sysconfig/network-scripts to save our configuration permanently. + +To begin, let’s print our current routing table: + + # ip route show + +![Check Routing Table in Linux](http://www.tecmint.com/wp-content/uploads/2015/07/Check-Current-Routing-Table.png) + +Check Current Routing Table + +From the output above, we can see the following facts: + +- The default gateway’s IP address is 192.168.0.1 and can be accessed via the enp0s3 NIC. +- When the system booted up, it enabled the zeroconf route to 169.254.0.0/16 (just in case). In few words, if a machine is set to obtain an IP address through DHCP but fails to do so for some reason, it is automatically assigned an address in this network. Bottom line is, this route will allow us to communicate, also via enp0s3, with other machines who have failed to obtain an IP address from a DHCP server. +- Last, but not least, we can communicate with other boxes inside the 192.168.0.0/24 network through enp0s3, whose IP address is 192.168.0.18. + +These are the typical tasks that you would have to perform in such a setting. Unless specified otherwise, the following tasks should be performed in router #2: + +Make sure all NICs have been properly installed: + + # ip link show + +If one of them is down, bring it up: + + # ip link set dev enp0s8 up + +and assign an IP address in the 10.0.0.0/24 network to it: + + # ip addr add 10.0.0.17 dev enp0s8 + +Oops! We made a mistake in the IP address. We will have to remove the one we assigned earlier and then add the right one (10.0.0.18): + + # ip addr del 10.0.0.17 dev enp0s8 + # ip addr add 10.0.0.18 dev enp0s8 + +Now, please note that you can only add a route to a destination network through a gateway that is itself already reachable. For that reason, we need to assign an IP address within the 192.168.0.0/24 range to enp0s3 so that our RHEL 7 box can communicate with it: + + # ip addr add 192.168.0.19 dev enp0s3 + +Finally, we will need to enable packet forwarding: + + # echo "1" > /proc/sys/net/ipv4/ip_forward + +and stop / disable (just for the time being – until we cover packet filtering in the next article) the firewall: + + # systemctl stop firewalld + # systemctl disable firewalld + +Back in our RHEL 7 box (192.168.0.18), let’s configure a route to 10.0.0.0/24 through 192.168.0.19 (enp0s3 in router #2): + + # ip route add 10.0.0.0/24 via 192.168.0.19 + +After that, the routing table looks as follows: + + # ip route show + +![Show Network Routing Table](http://www.tecmint.com/wp-content/uploads/2015/07/Show-Network-Routing.png) + +Confirm Network Routing Table + +Likewise, add the corresponding route in the machine(s) you’re trying to reach in 10.0.0.0/24: + + # ip route add 192.168.0.0/24 via 10.0.0.18 + +You can test for basic connectivity using ping: + +In the RHEL 7 box, run + + # ping -c 4 10.0.0.20 + +where 10.0.0.20 is the IP address of a web server in the 10.0.0.0/24 network. + +In the web server (10.0.0.20), run + + # ping -c 192.168.0.18 + +where 192.168.0.18 is, as you will recall, the IP address of our RHEL 7 machine. + +Alternatively, we can use [tcpdump][4] (you may need to install it with yum install tcpdump) to check the 2-way communication over TCP between our RHEL 7 box and the web server at 10.0.0.20. + +To do so, let’s start the logging in the first machine with: + + # tcpdump -qnnvvv -i enp0s3 host 10.0.0.20 + +and from another terminal in the same system let’s telnet to port 80 in the web server (assuming Apache is listening on that port; otherwise, indicate the right port in the following command): + + # telnet 10.0.0.20 80 + +The tcpdump log should look as follows: + +![Check Network Communication between Servers](http://www.tecmint.com/wp-content/uploads/2015/07/Tcpdump-logs.png) + +Check Network Communication between Servers + +Where the connection has been properly initialized, as we can tell by looking at the 2-way communication between our RHEL 7 box (192.168.0.18) and the web server (10.0.0.20). + +Please remember that these changes will go away when you restart the system. If you want to make them persistent, you will need to edit (or create, if they don’t already exist) the following files, in the same systems where we performed the above commands. + +Though not strictly necessary for our test case, you should know that /etc/sysconfig/network contains system-wide network parameters. A typical /etc/sysconfig/network looks as follows: + + # Enable networking on this system? + NETWORKING=yes + # Hostname. Should match the value in /etc/hostname + HOSTNAME=yourhostnamehere + # Default gateway + GATEWAY=XXX.XXX.XXX.XXX + # Device used to connect to default gateway. Replace X with the appropriate number. + GATEWAYDEV=enp0sX + +When it comes to setting specific variables and values for each NIC (as we did for router #2), you will have to edit /etc/sysconfig/network-scripts/ifcfg-enp0s3 and /etc/sysconfig/network-scripts/ifcfg-enp0s8. + +Following our case, + + TYPE=Ethernet + BOOTPROTO=static + IPADDR=192.168.0.19 + NETMASK=255.255.255.0 + GATEWAY=192.168.0.1 + NAME=enp0s3 + ONBOOT=yes + +and + + TYPE=Ethernet + BOOTPROTO=static + IPADDR=10.0.0.18 + NETMASK=255.255.255.0 + GATEWAY=10.0.0.1 + NAME=enp0s8 + ONBOOT=yes + +for enp0s3 and enp0s8, respectively. + +As for routing in our client machine (192.168.0.18), we will need to edit /etc/sysconfig/network-scripts/route-enp0s3: + + 10.0.0.0/24 via 192.168.0.19 dev enp0s3 + +Now reboot your system and you should see that route in your table. + +### Summary ### + +In this article we have covered the essentials of static routing in Red Hat Enterprise Linux 7. Although scenarios may vary, the case presented here illustrates the required principles and the procedures to perform this task. Before wrapping up, I would like to suggest you to take a look at [Chapter 4][5] of the Securing and Optimizing Linux section in The Linux Documentation Project site for further details on the topics covered here. + +Free ebook on Securing & Optimizing Linux: The Hacking Solution (v.3.0) – This 800+ eBook contains comprehensive collection of Linux security tips and how to use them safely and easily to configure Linux-based applications and services. + +![Linux Security and Optimization Book](http://www.tecmint.com/wp-content/uploads/2015/07/Linux-Security-Optimization-Book.gif) + +Linux Security and Optimization Book + +[Download Now][6] + +In the next article we will talk about packet filtering and network address translation to sum up the networking basic skills needed for the RHCE certification. + +As always, we look forward to hearing from you, so feel free to leave your questions, comments, and suggestions using the form below. + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/how-to-setup-and-configure-static-network-routing-in-rhel/ + +作者:[Gabriel Cánepa][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/gacanepa/ +[1]:http://www.tecmint.com/rhcsa-exam-reviewing-essential-commands-system-documentation/ +[2]:https://www.redhat.com/en/services/certification/rhce +[3]:http://www.tecmint.com/ip-command-examples/ +[4]:http://www.tecmint.com/12-tcpdump-commands-a-network-sniffer-tool/ +[5]:http://www.tldp.org/LDP/solrhe/Securing-Optimizing-Linux-RH-Edition-v1.3/net-manage.html +[6]:http://tecmint.tradepub.com/free/w_opeb01/prgm.cgi \ No newline at end of file diff --git a/sources/tech/RHCE/Part 2 - How to Perform Packet Filtering Network Address Translation and Set Kernel Runtime Parameters.md b/sources/tech/RHCE/Part 2 - How to Perform Packet Filtering Network Address Translation and Set Kernel Runtime Parameters.md new file mode 100644 index 0000000000..8a5f4e6cf4 --- /dev/null +++ b/sources/tech/RHCE/Part 2 - How to Perform Packet Filtering Network Address Translation and Set Kernel Runtime Parameters.md @@ -0,0 +1,177 @@ +Part 2 - How to Perform Packet Filtering, Network Address Translation and Set Kernel Runtime Parameters +================================================================================ +As promised in Part 1 (“[Setup Static Network Routing][1]”), in this article (Part 2 of RHCE series) we will begin by introducing the principles of packet filtering and network address translation (NAT) in Red Hat Enterprise Linux 7, before diving into setting runtime kernel parameters to modify the behavior of a running kernel if certain conditions change or needs arise. + +![Network Packet Filtering in RHEL](http://www.tecmint.com/wp-content/uploads/2015/07/Network-Packet-Filtering-in-RHEL.jpg) + +RHCE: Network Packet Filtering – Part 2 + +### Network Packet Filtering in RHEL 7 ### + +When we talk about packet filtering, we refer to a process performed by a firewall in which it reads the header of each data packet that attempts to pass through it. Then, it filters the packet by taking the required action based on rules that have been previously defined by the system administrator. + +As you probably know, beginning with RHEL 7, the default service that manages firewall rules is [firewalld][2]. Like iptables, it talks to the netfilter module in the Linux kernel in order to examine and manipulate network packets. Unlike iptables, updates can take effect immediately without interrupting active connections – you don’t even have to restart the service. + +Another advantage of firewalld is that it allows us to define rules based on pre-configured service names (more on that in a minute). + +In Part 1, we used the following scenario: + +![Static Routing Network Diagram](http://www.tecmint.com/wp-content/uploads/2015/07/Static-Routing-Network-Diagram.png) + +Static Routing Network Diagram + +However, you will recall that we disabled the firewall on router #2 to simplify the example since we had not covered packet filtering yet. Let’s see now how we can enable incoming packets destined for a specific service or port in the destination. + +First, let’s add a permanent rule to allow inbound traffic in enp0s3 (192.168.0.19) to enp0s8 (10.0.0.18): + + # firewall-cmd --permanent --direct --add-rule ipv4 filter FORWARD 0 -i enp0s3 -o enp0s8 -j ACCEPT + +The above command will save the rule to /etc/firewalld/direct.xml: + + # cat /etc/firewalld/direct.xml + +![Check Firewalld Saved Rules in CentOS 7](http://www.tecmint.com/wp-content/uploads/2015/07/Check-Firewalld-Save-Rules.png) + +Check Firewalld Saved Rules + +Then enable the rule for it to take effect immediately: + + # firewall-cmd --direct --add-rule ipv4 filter FORWARD 0 -i enp0s3 -o enp0s8 -j ACCEPT + +Now you can telnet to the web server from the RHEL 7 box and run [tcpdump][3] again to monitor the TCP traffic between the two machines, this time with the firewall in router #2 enabled. + + # telnet 10.0.0.20 80 + # tcpdump -qnnvvv -i enp0s3 host 10.0.0.20 + +What if you want to only allow incoming connections to the web server (port 80) from 192.168.0.18 and block connections from other sources in the 192.168.0.0/24 network? + +In the web server’s firewall, add the following rules: + + # firewall-cmd --add-rich-rule 'rule family="ipv4" source address="192.168.0.18/24" service name="http" accept' + # firewall-cmd --add-rich-rule 'rule family="ipv4" source address="192.168.0.18/24" service name="http" accept' --permanent + # firewall-cmd --add-rich-rule 'rule family="ipv4" source address="192.168.0.0/24" service name="http" drop' + # firewall-cmd --add-rich-rule 'rule family="ipv4" source address="192.168.0.0/24" service name="http" drop' --permanent + +Now you can make HTTP requests to the web server, from 192.168.0.18 and from some other machine in 192.168.0.0/24. In the first case the connection should complete successfully, whereas in the second it will eventually timeout. + +To do so, any of the following commands will do the trick: + + # telnet 10.0.0.20 80 + # wget 10.0.0.20 + +I strongly advise you to check out the [Firewalld Rich Language][4] documentation in the Fedora Project Wiki for further details on rich rules. + +### Network Address Translation in RHEL 7 ### + +Network Address Translation (NAT) is the process where a group of computers (it can also be just one of them) in a private network are assigned an unique public IP address. As result, they are still uniquely identified by their own private IP address inside the network but to the outside they all “seem” the same. + +In addition, NAT makes it possible that computers inside a network sends requests to outside resources (like the Internet) and have the corresponding responses be sent back to the source system only. + +Let’s now consider the following scenario: + +![Network Address Translation in RHEL](http://www.tecmint.com/wp-content/uploads/2015/07/Network-Address-Translation-Diagram.png) + +Network Address Translation + +In router #2, we will move the enp0s3 interface to the external zone, and enp0s8 to the internal zone, where masquerading, or NAT, is enabled by default: + + # firewall-cmd --list-all --zone=external + # firewall-cmd --change-interface=enp0s3 --zone=external + # firewall-cmd --change-interface=enp0s3 --zone=external --permanent + # firewall-cmd --change-interface=enp0s8 --zone=internal + # firewall-cmd --change-interface=enp0s8 --zone=internal --permanent + +For our current setup, the internal zone – along with everything that is enabled in it will be the default zone: + + # firewall-cmd --set-default-zone=internal + +Next, let’s reload firewall rules and keep state information: + + # firewall-cmd --reload + +Finally, let’s add router #2 as default gateway in the web server: + + # ip route add default via 10.0.0.18 + +You can now verify that you can ping router #1 and an external site (tecmint.com, for example) from the web server: + + # ping -c 2 192.168.0.1 + # ping -c 2 tecmint.com + +![Verify Network Routing](http://www.tecmint.com/wp-content/uploads/2015/07/Verify-Network-Routing.png) + +Verify Network Routing + +### Setting Kernel Runtime Parameters in RHEL 7 ### + +In Linux, you are allowed to change, enable, and disable the kernel runtime parameters, and RHEL is no exception. The /proc/sys interface (sysctl) lets you set runtime parameters on-the-fly to modify the system’s behavior without much hassle when operating conditions change. + +To do so, the echo shell built-in is used to write to files inside /proc/sys/, where is most likely one of the following directories: + +- dev: parameters for specific devices connected to the machine. +- fs: filesystem configuration (quotas and inodes, for example). +- kernel: kernel-specific configuration. +- net: network configuration. +- vm: use of the kernel’s virtual memory. + +To display the list of all the currently available values, run + + # sysctl -a | less + +In Part 1, we changed the value of the net.ipv4.ip_forward parameter by doing + + # echo 1 > /proc/sys/net/ipv4/ip_forward + +in order to allow a Linux machine to act as router. + +Another runtime parameter that you may want to set is kernel.sysrq, which enables the Sysrq key in your keyboard to instruct the system to perform gracefully some low-level functions, such as rebooting the system if it has frozen for some reason: + + # echo 1 > /proc/sys/kernel/sysrq + +To display the value of a specific parameter, use sysctl as follows: + + # sysctl + +For example, + + # sysctl net.ipv4.ip_forward + # sysctl kernel.sysrq + +Some parameters, such as the ones mentioned above, require only one value, whereas others (for example, fs.inode-state) require multiple values: + +![Check Kernel Parameters in Linux](http://www.tecmint.com/wp-content/uploads/2015/07/Check-Kernel-Parameters.png) + +Check Kernel Parameters + +In either case, you need to read the kernel’s documentation before making any changes. + +Please note that these settings will go away when the system is rebooted. To make these changes permanent, we will need to add .conf files inside the /etc/sysctl.d as follows: + + # echo "net.ipv4.ip_forward = 1" > /etc/sysctl.d/10-forward.conf + +(where the number 10 indicates the order of processing relative to other files in the same directory). + +and enable the changes with + + # sysctl -p /etc/sysctl.d/10-forward.conf + +### Summary ### + +In this tutorial we have explained the basics of packet filtering, network address translation, and setting kernel runtime parameters on a running system and persistently across reboots. I hope you have found this information useful, and as always, we look forward to hearing from you! +Don’t hesitate to share with us your questions, comments, or suggestions using the form below. + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/perform-packet-filtering-network-address-translation-and-set-kernel-runtime-parameters-in-rhel/ + +作者:[Gabriel Cánepa][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/gacanepa/ +[1]:http://www.tecmint.com/how-to-setup-and-configure-static-network-routing-in-rhel/ +[2]:http://www.tecmint.com/firewalld-rules-for-centos-7/ +[3]:http://www.tecmint.com/12-tcpdump-commands-a-network-sniffer-tool/ +[4]:https://fedoraproject.org/wiki/Features/FirewalldRichLanguage \ No newline at end of file diff --git a/sources/tech/RHCE/Part 3 - How to Produce and Deliver System Activity Reports Using Linux Toolsets.md b/sources/tech/RHCE/Part 3 - How to Produce and Deliver System Activity Reports Using Linux Toolsets.md new file mode 100644 index 0000000000..34693ea6bf --- /dev/null +++ b/sources/tech/RHCE/Part 3 - How to Produce and Deliver System Activity Reports Using Linux Toolsets.md @@ -0,0 +1,182 @@ +Part 3 - How to Produce and Deliver System Activity Reports Using Linux Toolsets +================================================================================ +As a system engineer, you will often need to produce reports that show the utilization of your system’s resources in order to make sure that: 1) they are being utilized optimally, 2) prevent bottlenecks, and 3) ensure scalability, among other reasons. + +![Monitor Linux Performance Activity Reports](http://www.tecmint.com/wp-content/uploads/2015/08/Monitor-Linux-Performance-Activity-Reports.jpg) + +RHCE: Monitor Linux Performance Activity Reports – Part 3 + +Besides the well-known native Linux tools that are used to check disk, memory, and CPU usage – to name a few examples, Red Hat Enterprise Linux 7 provides two additional toolsets to enhance the data you can collect for your reports: sysstat and dstat. + +In this article we will describe both, but let’s first start by reviewing the usage of the classic tools. + +### Native Linux Tools ### + +With df, you will be able to report disk space and inode usage of by filesystem. You need to monitor both because a lack of space will prevent you from being able to save further files (and may even cause the system to crash), just like running out of inodes will mean you can’t link further files with their corresponding data structures, thus producing the same effect: you won’t be able to save those files to disk. + + # df -h [Display output in human-readable form] + # df -h --total [Produce a grand total] + +![Check Linux Total Disk Usage](http://www.tecmint.com/wp-content/uploads/2015/08/Check-Linux-Total-Disk-Usage.png) + +Check Linux Total Disk Usage + + # df -i [Show inode count by filesystem] + # df -i --total [Produce a grand total] + +![Check Linux Total inode Numbers](http://www.tecmint.com/wp-content/uploads/2015/08/Check-Linux-Total-inode-Numbers.png) + +Check Linux Total inode Numbers + +With du, you can estimate file space usage by either file, directory, or filesystem. + +For example, let’s see how much space is used by the /home directory, which includes all of the user’s personal files. The first command will return the overall space currently used by the entire /home directory, whereas the second will also display a disaggregated list by sub-directory as well: + + # du -sch /home + # du -sch /home/* + +![Check Linux Directory Disk Size](http://www.tecmint.com/wp-content/uploads/2015/08/Check-Linux-Directory-Disk-Size.png) + +Check Linux Directory Disk Size + +Don’t Miss: + +- [12 ‘df’ Command Examples to Check Linux Disk Space Usage][1] +- [10 ‘du’ Command Examples to Find Disk Usage of Files/Directories][2] + +Another utility that can’t be missing from your toolset is vmstat. It will allow you to see at a quick glance information about processes, CPU and memory usage, disk activity, and more. + +If run without arguments, vmstat will return averages since the last reboot. While you may use this form of the command once in a while, it will be more helpful to take a certain amount of system utilization samples, one after another, with a defined time separation between samples. + +For example, + + # vmstat 5 10 + +will return 10 samples taken every 5 seconds: + +![Check Linux System Performance](http://www.tecmint.com/wp-content/uploads/2015/08/Check-Linux-Systerm-Performance.png) + +Check Linux System Performance + +As you can see in the above picture, the output of vmstat is divided by columns: procs (processes), memory, swap, io, system, and cpu. The meaning of each field can be found in the FIELD DESCRIPTION sections in the man page of vmstat. + +Where can vmstat come in handy? Let’s examine the behavior of the system before and during a yum update: + + # vmstat -a 1 5 + +![Vmstat Linux Performance Monitoring](http://www.tecmint.com/wp-content/uploads/2015/08/Vmstat-Linux-Peformance-Monitoring.png) + +Vmstat Linux Performance Monitoring + +Please note that as files are being modified on disk, the amount of active memory increases and so does the number of blocks written to disk (bo) and the CPU time that is dedicated to user processes (us). + +Or during the saving process of a large file directly to disk (caused by dsync): + + # vmstat -a 1 5 + # dd if=/dev/zero of=dummy.out bs=1M count=1000 oflag=dsync + +![VmStat Linux Disk Performance Monitoring](http://www.tecmint.com/wp-content/uploads/2015/08/VmStat-Linux-Disk-Performance-Monitoring.png) + +VmStat Linux Disk Performance Monitoring + +In this case, we can see a yet larger number of blocks being written to disk (bo), which was to be expected, but also an increase of the amount of CPU time that it has to wait for I/O operations to complete before processing tasks (wa). + +**Don’t Miss**: [Vmstat – Linux Performance Monitoring][3] + +### Other Linux Tools ### + +As mentioned in the introduction of this chapter, there are other tools that you can use to check the system status and utilization (they are not only provided by Red Hat but also by other major distributions from their officially supported repositories). + +The sysstat package contains the following utilities: + +- sar (collect, report, or save system activity information). +- sadf (display data collected by sar in multiple formats). +- mpstat (report processors related statistics). +- iostat (report CPU statistics and I/O statistics for devices and partitions). +- pidstat (report statistics for Linux tasks). +- nfsiostat (report input/output statistics for NFS). +- cifsiostat (report CIFS statistics) and +- sa1 (collect and store binary data in the system activity daily data file. +- sa2 (write a daily report in the /var/log/sa directory) tools. + +whereas dstat adds some extra features to the functionality provided by those tools, along with more counters and flexibility. You can find an overall description of each tool by running yum info sysstat or yum info dstat, respectively, or checking the individual man pages after installation. + +To install both packages: + + # yum update && yum install sysstat dstat + +The main configuration file for sysstat is /etc/sysconfig/sysstat. You will find the following parameters in that file: + + # How long to keep log files (in days). + # If value is greater than 28, then log files are kept in + # multiple directories, one for each month. + HISTORY=28 + # Compress (using gzip or bzip2) sa and sar files older than (in days): + COMPRESSAFTER=31 + # Parameters for the system activity data collector (see sadc manual page) + # which are used for the generation of log files. + SADC_OPTIONS="-S DISK" + # Compression program to use. + ZIP="bzip2" + +When sysstat is installed, two cron jobs are added and enabled in /etc/cron.d/sysstat. The first job runs the system activity accounting tool every 10 minutes and stores the reports in /var/log/sa/saXX where XX is the day of the month. + +Thus, /var/log/sa/sa05 will contain all the system activity reports from the 5th of the month. This assumes that we are using the default value in the HISTORY variable in the configuration file above: + + */10 * * * * root /usr/lib64/sa/sa1 1 1 + +The second job generates a daily summary of process accounting at 11:53 pm every day and stores it in /var/log/sa/sarXX files, where XX has the same meaning as in the previous example: + + 53 23 * * * root /usr/lib64/sa/sa2 -A + +For example, you may want to output system statistics from 9:30 am through 5:30 pm of the sixth of the month to a .csv file that can easily be viewed using LibreOffice Calc or Microsoft Excel (this approach will also allow you to create charts or graphs): + + # sadf -s 09:30:00 -e 17:30:00 -dh /var/log/sa/sa06 -- | sed 's/;/,/g' > system_stats20150806.csv + +You could alternatively use the -j flag instead of -d in the sadf command above to output the system stats in JSON format, which could be useful if you need to consume the data in a web application, for example. + +![Linux System Statistics](http://www.tecmint.com/wp-content/uploads/2015/08/Linux-System-Statistics.png) + +Linux System Statistics + +Finally, let’s see what dstat has to offer. Please note that if run without arguments, dstat assumes -cdngy by default (short for CPU, disk, network, memory pages, and system stats, respectively), and adds one line every second (execution can be interrupted anytime with Ctrl + C): + + # dstat + +![Linux Disk Statistics Monitoring](http://www.tecmint.com/wp-content/uploads/2015/08/dstat-command.png) + +Linux Disk Statistics Monitoring + +To output the stats to a .csv file, use the –output flag followed by a file name. Let’s see how this looks on LibreOffice Calc: + +![Monitor Linux Statistics Output](http://www.tecmint.com/wp-content/uploads/2015/08/Monitor-Linux-Statistics-Output.png) + +Monitor Linux Statistics Output + +I strongly advise you to check out the man page of dstat, included with this article along with the man page of sysstat in PDF format for your reading convenience. You will find several other options that will help you create custom and detailed system activity reports. + +**Don’t Miss**: [Sysstat – Linux Usage Activity Monitoring Tool][4] + +### Summary ### + +In this guide we have explained how to use both native Linux tools and specific utilities provided with RHEL 7 in order to produce reports on system utilization. At one point or another, you will come to rely on these reports as best friends. + +You will probably have used other tools that we have not covered in this tutorial. If so, feel free to share them with the rest of the community along with any other suggestions / questions / comments that you may have- using the form below. + +We look forward to hearing from you. + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/linux-performance-monitoring-and-file-system-statistics-reports/ + +作者:[Gabriel Cánepa][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/gacanepa/ +[1]:http://www.tecmint.com/how-to-check-disk-space-in-linux/ +[2]:http://www.tecmint.com/check-linux-disk-usage-of-files-and-directories/ +[3]:http://www.tecmint.com/linux-performance-monitoring-with-vmstat-and-iostat-commands/ +[4]:http://www.tecmint.com/install-sysstat-in-linux/ \ No newline at end of file From eaecf395ae651fbf78bef16e9acc27cea0e636c0 Mon Sep 17 00:00:00 2001 From: DeadFire Date: Wed, 12 Aug 2015 16:39:28 +0800 Subject: [PATCH 898/965] =?UTF-8?q?20150812-2=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...edule a Job and Watch Commands in Linux.md | 143 ++++++++++++++++++ 1 file changed, 143 insertions(+) create mode 100644 sources/tech/20150812 Linux Tricks--Play Game in Chrome Text-to-Speech Schedule a Job and Watch Commands in Linux.md diff --git a/sources/tech/20150812 Linux Tricks--Play Game in Chrome Text-to-Speech Schedule a Job and Watch Commands in Linux.md b/sources/tech/20150812 Linux Tricks--Play Game in Chrome Text-to-Speech Schedule a Job and Watch Commands in Linux.md new file mode 100644 index 0000000000..1ad92c594b --- /dev/null +++ b/sources/tech/20150812 Linux Tricks--Play Game in Chrome Text-to-Speech Schedule a Job and Watch Commands in Linux.md @@ -0,0 +1,143 @@ +Linux Tricks: Play Game in Chrome, Text-to-Speech, Schedule a Job and Watch Commands in Linux +================================================================================ +Here again, I have compiled a list of four things under [Linux Tips and Tricks][1] series you may do to remain more productive and entertained with Linux Environment. + +![Linux Tips and Tricks Series](http://www.tecmint.com/wp-content/uploads/2015/08/Linux-Tips-and-Tricks.png) + +Linux Tips and Tricks Series + +The topics I have covered includes Google-chrome inbuilt small game, Text-to-speech in Linux Terminal, Quick job scheduling using ‘at‘ command and watch a command at regular interval. + +### 1. Play A Game in Google Chrome Browser ### + +Very often when there is a power shedding or no network due to some other reason, I don’t put my Linux box into maintenance mode. I keep myself engage in a little fun game by Google Chrome. I am not a gamer and hence I have not installed third-party creepy games. Security is another concern. + +So when there is Internet related issue and my web page seems something like this: + +![Unable to Connect Internet](http://www.tecmint.com/wp-content/uploads/2015/08/Unable-to-Connect-Internet.png) + +Unable to Connect Internet + +You may play the Google-chrome inbuilt game simply by hitting the space-bar. There is no limitation for the number of times you can play. The best thing is you need not break a sweat installing and using it. + +No third-party application/plugin required. It should work well on other platforms like Windows and Mac but our niche is Linux and I’ll talk about Linux only and mind it, it works well on Linux. It is a very simple game (a kind of time pass). + +Use Space-Bar/Navigation-up-key to jump. A glimpse of the game in action. + +![Play Game in Google Chrome](http://www.tecmint.com/wp-content/uploads/2015/08/Play-Game-in-Google-Chrome.gif) + +Play Game in Google Chrome + +### 2. Text to Speech in Linux Terminal ### + +For those who may not be aware of espeak utility, It is a Linux command-line text to speech converter. Write anything in a variety of languages and espeak utility will read it loud for you. + +Espeak should be installed in your system by default, however it is not installed for your system, you may do: + + # apt-get install espeak (Debian) + # yum install espeak (CentOS) + # dnf install espeak (Fedora 22 onwards) + +You may ask espeak to accept Input Interactively from standard Input device and convert it to speech for you. You may do: + + $ espeak [Hit Return Key] + +For detailed output you may do: + + $ espeak --stdout | aplay [Hit Return Key][Double - Here] + +espeak is flexible and you can ask espeak to accept input from a text file and speak it loud for you. All you need to do is: + + $ espeak --stdout /path/to/text/file/file_name.txt | aplay [Hit Enter] + +You may ask espeak to speak fast/slow for you. The default speed is 160 words per minute. Define your preference using switch ‘-s’. + +To ask espeak to speak 30 words per minute, you may do: + + $ espeak -s 30 -f /path/to/text/file/file_name.txt | aplay + +To ask espeak to speak 200 words per minute, you may do: + + $ espeak -s 200 -f /path/to/text/file/file_name.txt | aplay + +To use another language say Hindi (my mother tongue), you may do: + + $ espeak -v hindi --stdout 'टेकमिंट विश्व की एक बेहतरीन लाइंक्स आधारित वेबसाइट है|' | aplay + +You may choose any language of your preference and ask to speak in your preferred language as suggested above. To get the list of all the languages supported by espeak, you need to run: + + $ espeak --voices + +### 3. Quick Schedule a Job ### + +Most of us are already familiar with [cron][2] which is a daemon to execute scheduled commands. + +Cron is an advanced command often used by Linux SYSAdmins to schedule a job such as Backup or practically anything at certain time/interval. + +Are you aware of ‘at’ command in Linux which lets you schedule a job/command to run at specific time? You can tell ‘at’ what to do and when to do and everything else will be taken care by command ‘at’. + +For an example, say you want to print the output of uptime command at 11:02 AM, All you need to do is: + + $ at 11:02 + uptime >> /home/$USER/uptime.txt + Ctrl+D + +![Schedule Job in Linux](http://www.tecmint.com/wp-content/uploads/2015/08/Schedule-Job-in-Linux.png) + +Schedule Job in Linux + +To check if the command/script/job has been set or not by ‘at’ command, you may do: + + $ at -l + +![View Scheduled Jobs](http://www.tecmint.com/wp-content/uploads/2015/08/View-Scheduled-Jobs.png) + +View Scheduled Jobs + +You may schedule more than one command in one go using at, simply as: + + $ at 12:30 + Command – 1 + Command – 2 + … + command – 50 + … + Ctrl + D + +### 4. Watch a Command at Specific Interval ### + +We need to run some command for specified amount of time at regular interval. Just for example say we need to print the current time and watch the output every 3 seconds. + +To see current time we need to run the below command in terminal. + + $ date +"%H:%M:%S + +![Check Date and Time in Linux](http://www.tecmint.com/wp-content/uploads/2015/08/Check-Date-in-Linux.png) + +Check Date and Time in Linux + +and to check the output of this command every three seconds, we need to run the below command in Terminal. + + $ watch -n 3 'date +"%H:%M:%S"' + +![Watch Command in Linux](http://www.tecmint.com/wp-content/uploads/2015/08/Watch-Command-in-Linux.gif) + +Watch Command in Linux + +The switch ‘-n’ in watch command is for Interval. In the above example we defined Interval to be 3 sec. You may define yours as required. Also you may pass any command/script with watch command to watch that command/script at the defined interval. + +That’s all for now. Hope you are like this series that aims at making you more productive with Linux and that too with fun inside. All the suggestions are welcome in the comments below. Stay tuned for more such posts. Keep connected and Enjoy… + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/text-to-speech-in-terminal-schedule-a-job-and-watch-commands-in-linux/ + +作者:[Avishek Kumar][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/avishek/ +[1]:http://www.tecmint.com/tag/linux-tricks/ +[2]:http://www.tecmint.com/11-cron-scheduling-task-examples-in-linux/ \ No newline at end of file From 4ea6ca5ad27848c8bed914a6ffa5ea4ee08016d5 Mon Sep 17 00:00:00 2001 From: Chang Liu Date: Wed, 12 Aug 2015 19:57:08 +0800 Subject: [PATCH 899/965] [Translated]20150811 How to download apk files from Google Play Store on Linux.md --- ...k files from Google Play Store on Linux.md | 101 ------------------ ...k files from Google Play Store on Linux.md | 99 +++++++++++++++++ 2 files changed, 99 insertions(+), 101 deletions(-) delete mode 100644 sources/tech/20150811 How to download apk files from Google Play Store on Linux.md create mode 100644 translated/tech/20150811 How to download apk files from Google Play Store on Linux.md diff --git a/sources/tech/20150811 How to download apk files from Google Play Store on Linux.md b/sources/tech/20150811 How to download apk files from Google Play Store on Linux.md deleted file mode 100644 index 50bf618e86..0000000000 --- a/sources/tech/20150811 How to download apk files from Google Play Store on Linux.md +++ /dev/null @@ -1,101 +0,0 @@ -FSSlc translating - -How to download apk files from Google Play Store on Linux -================================================================================ -Suppose you want to install an Android app on your Android device. However, for whatever reason, you cannot access Google Play Store on the Android device. What can you do then? One way to install the app without Google Play Store access is to download its APK file using some other means, and then [install the APK][1] file on the Android device manually. - -There are several ways to download official APK files from Google Play Store on non-Android devices such as regular computers and laptops. For example, there are browser plugins (e.g., for [Chrome][2] or [Firefox][3]) or online APK archives that allow you to download APK files using a web browser. If you do not trust these closed-source plugins or third-party APK repositories, there is yet another way to download official APK files manually, and that is via an open-source Linux app called [GooglePlayDownloader][4]. - -GooglePlayDownloader is a Python-based GUI application that enables you to search and download APK files from Google Play Store. Since this is completely open-source, you can be assured while using it. In this tutorial, I am going to show how to download an APK file from Google Play Store using GooglePlayDownloader in Linux environment. - -### Python requirement ### - -GooglePlayDownloader requires Python with SNI (Server Name Indication) support for SSL/TLS communication. This feature comes with Python 2.7.9 or higher. This leaves out older distributions such as Debian 7 Wheezy or earlier, Ubuntu 14.04 or earlier, or CentOS/RHEL 7 or earlier. Assuming that you have a Linux distribution with Python 2.7.9 or higher, proceed to install GooglePlayDownloader as follows. - -### Install GooglePlayDownloader on Ubuntu ### - -On Ubuntu, you can use the official deb build. One catch is that you may need to install one required dependency manually. - -#### On Ubuntu 14.10 #### - -Download [python-ndg-httpsclient][5] deb package, which is a missing dependency on older Ubuntu distributions. Also download GooglePlayDownloader's official deb package. - - $ wget http://mirrors.kernel.org/ubuntu/pool/main/n/ndg-httpsclient/python-ndg-httpsclient_0.3.2-1ubuntu4_all.deb - $ wget http://codingteam.net/project/googleplaydownloader/download/file/googleplaydownloader_1.7-1_all.deb - -We are going to use [gdebi command][6] to install those two deb files as follows. The gdebi command will automatically handle any other dependencies. - - $ sudo apt-get install gdebi-core - $ sudo gdebi python-ndg-httpsclient_0.3.2-1ubuntu4_all.deb - $ sudo gdebi googleplaydownloader_1.7-1_all.deb - -#### On Ubuntu 15.04 or later #### - -Recent Ubuntu distributions ship all required dependencies, and thus the installation is straightforward as follows. - - $ wget http://codingteam.net/project/googleplaydownloader/download/file/googleplaydownloader_1.7-1_all.deb - $ sudo apt-get install gdebi-core - $ sudo gdebi googleplaydownloader_1.7-1_all.deb - -### Install GooglePlayDownloader on Debian ### - -Due to its Python requirement, GooglePlayDownloader cannot be installed on Debian 7 Wheezy or earlier unless you upgrade its stock Python. - -#### On Debian 8 Jessie and higher: #### - - $ wget http://codingteam.net/project/googleplaydownloader/download/file/googleplaydownloader_1.7-1_all.deb - $ sudo apt-get install gdebi-core - $ sudo gdebi googleplaydownloader_1.7-1_all.deb - -### Install GooglePlayDownloader on Fedora ### - -Since GooglePlayDownloader was originally developed for Debian based distributions, you need to install it from the source if you want to use it on Fedora. - -First, install necessary dependencies. - - $ sudo yum install python-pyasn1 wxPython python-ndg_httpsclient protobuf-python python-requests - -Then install it as follows. - - $ wget http://codingteam.net/project/googleplaydownloader/download/file/googleplaydownloader_1.7.orig.tar.gz - $ tar -xvf googleplaydownloader_1.7.orig.tar.gz - $ cd googleplaydownloader-1.7 - $ chmod o+r -R . - $ sudo python setup.py install - $ sudo sh -c "echo 'python /usr/lib/python2.7/site-packages/googleplaydownloader-1.7-py2.7.egg/googleplaydownloader/googleplaydownloader.py' > /usr/bin/googleplaydownloader" - -### Download APK Files from Google Play Store with GooglePlayDownloader ### - -Once you installed GooglePlayDownloader, you can download APK files from Google Play Store as follows. - -First launch the app by typing: - - $ googleplaydownloader - -![](https://farm1.staticflickr.com/425/20229024898_105396fa68_b.jpg) - -At the search bar, type the name of the app you want to download from Google Play Store. - -![](https://farm1.staticflickr.com/503/20230360479_925f5da613_b.jpg) - -Once you find the app in the search list, choose the app, and click on "Download selected APK(s)" button. You will find the downloaded APK file in your home directory. Now you can move the APK file to the Android device of your choice, and install it manually. - -Hope this helps. - --------------------------------------------------------------------------------- - -via: http://xmodulo.com/download-apk-files-google-play-store.html - -作者:[Dan Nanni][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://xmodulo.com/author/nanni -[1]:http://xmodulo.com/how-to-install-apk-file-on-android-phone-or-tablet.html -[2]:https://chrome.google.com/webstore/detail/apk-downloader/cgihflhdpokeobcfimliamffejfnmfii -[3]:https://addons.mozilla.org/en-us/firefox/addon/apk-downloader/ -[4]:http://codingteam.net/project/googleplaydownloader -[5]:http://packages.ubuntu.com/vivid/python-ndg-httpsclient -[6]:http://xmodulo.com/how-to-install-deb-file-with-dependencies.html diff --git a/translated/tech/20150811 How to download apk files from Google Play Store on Linux.md b/translated/tech/20150811 How to download apk files from Google Play Store on Linux.md new file mode 100644 index 0000000000..670c0f331b --- /dev/null +++ b/translated/tech/20150811 How to download apk files from Google Play Store on Linux.md @@ -0,0 +1,99 @@ +如何在 Linux 中从 Google Play 商店里下载 apk 文件 +================================================================================ +假设你想在你的 Android 设备中安装一个 Android 应用,然而由于某些原因,你不能在 Andor 设备上访问 Google Play 商店。接着你该怎么做呢?在不访问 Google Play 商店的前提下安装应用的一种可能的方法是使用其他的手段下载该应用的 APK 文件,然后手动地在 Android 设备上 [安装 APK 文件][1]。 + +在非 Android 设备如常规的电脑和笔记本电脑上,有着几种方式来从 Google Play 商店下载到官方的 APK 文件。例如,使用浏览器插件(例如, 针对 [Chrome][2] 或针对 [Firefox][3] 的插件) 或利用允许你使用浏览器下载 APK 文件的在线的 APK 存档等。假如你不信任这些闭源的插件或第三方的 APK 仓库,这里有另一种手动下载官方 APK 文件的方法,它使用一个名为 [GooglePlayDownloader][4] 的开源 Linux 应用。 + +GooglePlayDownloader 是一个基于 Python 的 GUI 应用,使得你可以从 Google Play 商店上搜索和下载 APK 文件。由于它是完全开源的,你可以放心地使用它。在本篇教程中,我将展示如何在 Linux 环境下,使用 GooglePlayDownloader 来从 Google Play 商店下载 APK 文件。 + +### Python 需求 ### + +GooglePlayDownloader 需要使用 Python 中 SSL 模块的扩展 SNI(服务器名称指示) 来支持 SSL/TLS 通信,该功能由 Python 2.7.9 或更高版本带来。这使得一些旧的发行版本如 Debian 7 Wheezy 及早期版本,Ubuntu 14.04 及早期版本或 CentOS/RHEL 7 及早期版本均不能满足该要求。假设你已经有了一个带有 Python 2.7.9 或更高版本的发行版本,可以像下面这样接着安装 GooglePlayDownloader。 + +### 在 Ubuntu 上安装 GooglePlayDownloader ### + +在 Ubuntu 上,你可以使用官方构建的 deb 包。有一个条件是你可能需要手动地安装一个必需的依赖。 + +#### 在 Ubuntu 14.10 上 #### + +下载 [python-ndg-httpsclient][5] deb 软件包,这在旧一点的 Ubuntu 发行版本中是一个缺失的依赖。同时还要下载 GooglePlayDownloader 的官方 deb 软件包。 + + $ wget http://mirrors.kernel.org/ubuntu/pool/main/n/ndg-httpsclient/python-ndg-httpsclient_0.3.2-1ubuntu4_all.deb + $ wget http://codingteam.net/project/googleplaydownloader/download/file/googleplaydownloader_1.7-1_all.deb + +如下所示,我们将使用 [gdebi 命令][6] 来安装这两个 deb 文件。 gedbi 命令将自动地处理任何其他的依赖。 + + $ sudo apt-get install gdebi-core + $ sudo gdebi python-ndg-httpsclient_0.3.2-1ubuntu4_all.deb + $ sudo gdebi googleplaydownloader_1.7-1_all.deb + +#### 在 Ubuntu 15.04 或更新的版本上 #### + +最近的 Ubuntu 发行版本上已经配备了所有需要的依赖,所以安装过程可以如下面那样直接进行。 + + $ wget http://codingteam.net/project/googleplaydownloader/download/file/googleplaydownloader_1.7-1_all.deb + $ sudo apt-get install gdebi-core + $ sudo gdebi googleplaydownloader_1.7-1_all.deb + +### 在 Debian 上安装 GooglePlayDownloader ### + +由于其 Python 需求, Googleplaydownloader 不能被安装到 Debian 7 Wheezy 或早期版本上,除非你升级了它自备的 Python 版本。 + +#### 在 Debian 8 Jessie 及更高版本上: #### + + $ wget http://codingteam.net/project/googleplaydownloader/download/file/googleplaydownloader_1.7-1_all.deb + $ sudo apt-get install gdebi-core + $ sudo gdebi googleplaydownloader_1.7-1_all.deb + +### 在 Fedora 上安装 GooglePlayDownloader ### + +由于 GooglePlayDownloader 原本是针对基于 Debian 的发行版本所开发的,假如你想在 Fedora 上使用它,你需要从它的源码开始安装。 + +首先安装必需的依赖。 + + $ sudo yum install python-pyasn1 wxPython python-ndg_httpsclient protobuf-python python-requests + +然后像下面这样安装它。 + + $ wget http://codingteam.net/project/googleplaydownloader/download/file/googleplaydownloader_1.7.orig.tar.gz + $ tar -xvf googleplaydownloader_1.7.orig.tar.gz + $ cd googleplaydownloader-1.7 + $ chmod o+r -R . + $ sudo python setup.py install + $ sudo sh -c "echo 'python /usr/lib/python2.7/site-packages/googleplaydownloader-1.7-py2.7.egg/googleplaydownloader/googleplaydownloader.py' > /usr/bin/googleplaydownloader" + +### 使用 GooglePlayDownloader 从 Google Play 商店下载 APK 文件 ### + +一旦你安装好 GooglePlayDownloader 后,你就可以像下面那样从 Google Play 商店下载 APK 文件。 + +首先通过输入下面的命令来启动该应用: + + $ googleplaydownloader + +![](https://farm1.staticflickr.com/425/20229024898_105396fa68_b.jpg) + +在搜索栏中,输入你想从 Google Play 商店下载的应用的名称。 + +![](https://farm1.staticflickr.com/503/20230360479_925f5da613_b.jpg) + +一旦你从搜索列表中找到了该应用,就选择该应用,接着点击 "下载选定的 APK 文件" 按钮。最后你将在你的家目录中找到下载的 APK 文件。现在,你就可以将下载到的 APK 文件转移到你所选择的 Android 设备上,然后手动安装它。 + +希望这篇教程对你有所帮助。 + +-------------------------------------------------------------------------------- + +via: http://xmodulo.com/download-apk-files-google-play-store.html + +作者:[Dan Nanni][a] +译者:[FSSlc](https://github.com/FSSlc) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://xmodulo.com/author/nanni +[1]:http://xmodulo.com/how-to-install-apk-file-on-android-phone-or-tablet.html +[2]:https://chrome.google.com/webstore/detail/apk-downloader/cgihflhdpokeobcfimliamffejfnmfii +[3]:https://addons.mozilla.org/en-us/firefox/addon/apk-downloader/ +[4]:http://codingteam.net/project/googleplaydownloader +[5]:http://packages.ubuntu.com/vivid/python-ndg-httpsclient +[6]:http://xmodulo.com/how-to-install-deb-file-with-dependencies.html From c80b246c12f9be9c9dea4267d399b779f230a186 Mon Sep 17 00:00:00 2001 From: Chang Liu Date: Wed, 12 Aug 2015 20:01:28 +0800 Subject: [PATCH 900/965] Update RHCSA Series--Part 05--Process Management in RHEL 7--Boot Shutdown and Everything in Between.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 准备翻译该篇。 --- ...ment in RHEL 7--Boot Shutdown and Everything in Between.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/tech/RHCSA Series/RHCSA Series--Part 05--Process Management in RHEL 7--Boot Shutdown and Everything in Between.md b/sources/tech/RHCSA Series/RHCSA Series--Part 05--Process Management in RHEL 7--Boot Shutdown and Everything in Between.md index 2befb7bc55..23bf9f0ac1 100644 --- a/sources/tech/RHCSA Series/RHCSA Series--Part 05--Process Management in RHEL 7--Boot Shutdown and Everything in Between.md +++ b/sources/tech/RHCSA Series/RHCSA Series--Part 05--Process Management in RHEL 7--Boot Shutdown and Everything in Between.md @@ -1,3 +1,5 @@ +FSSlc translating + RHCSA Series: Process Management in RHEL 7: Boot, Shutdown, and Everything in Between – Part 5 ================================================================================ We will start this article with an overall and brief revision of what happens since the moment you press the Power button to turn on your RHEL 7 server until you are presented with the login screen in a command line interface. @@ -213,4 +215,4 @@ via: http://www.tecmint.com/rhcsa-exam-boot-process-and-process-management/ [a]:http://www.tecmint.com/author/gacanepa/ [1]:http://www.tecmint.com/dmesg-commands/ [2]:http://www.tecmint.com/systemd-replaces-init-in-linux/ -[3]:http://www.tecmint.com/how-to-kill-a-process-in-linux/ \ No newline at end of file +[3]:http://www.tecmint.com/how-to-kill-a-process-in-linux/ From 69122f983c12c6911363b696af572a6d06a06d68 Mon Sep 17 00:00:00 2001 From: ictlyh Date: Wed, 12 Aug 2015 23:10:47 +0800 Subject: [PATCH 901/965] =?UTF-8?q?[Translating]=20RHCE=20=E7=B3=BB?= =?UTF-8?q?=E5=88=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... RHCE Series--How to Setup and Test Static Network Routing.md | 1 + ...work Address Translation and Set Kernel Runtime Parameters.md | 1 + ...e and Deliver System Activity Reports Using Linux Toolsets.md | 1 + 3 files changed, 3 insertions(+) diff --git a/sources/tech/RHCE/Part 1 - RHCE Series--How to Setup and Test Static Network Routing.md b/sources/tech/RHCE/Part 1 - RHCE Series--How to Setup and Test Static Network Routing.md index 03356f9dd1..731e78e5cf 100644 --- a/sources/tech/RHCE/Part 1 - RHCE Series--How to Setup and Test Static Network Routing.md +++ b/sources/tech/RHCE/Part 1 - RHCE Series--How to Setup and Test Static Network Routing.md @@ -1,3 +1,4 @@ +Translating by ictlyh Part 1 - RHCE Series: How to Setup and Test Static Network Routing ================================================================================ RHCE (Red Hat Certified Engineer) is a certification from Red Hat company, which gives an open source operating system and software to the enterprise community, It also gives training, support and consulting services for the companies. diff --git a/sources/tech/RHCE/Part 2 - How to Perform Packet Filtering Network Address Translation and Set Kernel Runtime Parameters.md b/sources/tech/RHCE/Part 2 - How to Perform Packet Filtering Network Address Translation and Set Kernel Runtime Parameters.md index 8a5f4e6cf4..cd798b906d 100644 --- a/sources/tech/RHCE/Part 2 - How to Perform Packet Filtering Network Address Translation and Set Kernel Runtime Parameters.md +++ b/sources/tech/RHCE/Part 2 - How to Perform Packet Filtering Network Address Translation and Set Kernel Runtime Parameters.md @@ -1,3 +1,4 @@ +Translating by ictlyh Part 2 - How to Perform Packet Filtering, Network Address Translation and Set Kernel Runtime Parameters ================================================================================ As promised in Part 1 (“[Setup Static Network Routing][1]”), in this article (Part 2 of RHCE series) we will begin by introducing the principles of packet filtering and network address translation (NAT) in Red Hat Enterprise Linux 7, before diving into setting runtime kernel parameters to modify the behavior of a running kernel if certain conditions change or needs arise. diff --git a/sources/tech/RHCE/Part 3 - How to Produce and Deliver System Activity Reports Using Linux Toolsets.md b/sources/tech/RHCE/Part 3 - How to Produce and Deliver System Activity Reports Using Linux Toolsets.md index 34693ea6bf..ea0157be4f 100644 --- a/sources/tech/RHCE/Part 3 - How to Produce and Deliver System Activity Reports Using Linux Toolsets.md +++ b/sources/tech/RHCE/Part 3 - How to Produce and Deliver System Activity Reports Using Linux Toolsets.md @@ -1,3 +1,4 @@ +Translating by ictlyh Part 3 - How to Produce and Deliver System Activity Reports Using Linux Toolsets ================================================================================ As a system engineer, you will often need to produce reports that show the utilization of your system’s resources in order to make sure that: 1) they are being utilized optimally, 2) prevent bottlenecks, and 3) ensure scalability, among other reasons. From 604582f47ad84aebdf1df2a0fef838c702f59086 Mon Sep 17 00:00:00 2001 From: wxy Date: Wed, 12 Aug 2015 23:55:02 +0800 Subject: [PATCH 902/965] PUB:20141211 Open source all over the world MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @fyh 这篇不好翻译啊,翻译的不错! --- ...20141211 Open source all over the world.md | 47 +++++++++---------- 1 file changed, 23 insertions(+), 24 deletions(-) rename {translated/talk => published}/20141211 Open source all over the world.md (67%) diff --git a/translated/talk/20141211 Open source all over the world.md b/published/20141211 Open source all over the world.md similarity index 67% rename from translated/talk/20141211 Open source all over the world.md rename to published/20141211 Open source all over the world.md index 0abb08121f..e07db43680 100644 --- a/translated/talk/20141211 Open source all over the world.md +++ b/published/20141211 Open source all over the world.md @@ -2,8 +2,6 @@ ================================================================================ ![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/BUS_OpenSourceExperience_520x292_cm.png) -图片来源 : opensource.com - 经过了一整天的Opensource.com[社区版主][1]年会,最后一项日程提了上来,内容只有“特邀嘉宾:待定”几个字。作为[Opensource.com][3]的项目负责人和社区管理员,[Jason Hibbets][2]起身解释道,“因为这个嘉宾有可能无法到场,因此我不想提前说是谁。在几个月前我问他何时有空过来,他给了我两个时间点,我选了其中一个。今天是这三周中Jim唯一能来的一天”。(译者注:Jim是指下文中提到的Jim Whitehurst,即红帽公司总裁兼首席执行官) 这句话在版主们(Moderators)中引起一阵轰动,他们从世界各地赶来参加此次的[拥抱开源大会(All Things Open Conference)][4]。版主们纷纷往前挪动椅子,仔细聆听。 @@ -14,7 +12,7 @@ “大家好!”,这个家伙开口了。他没穿正装,只是衬衫和休闲裤。 -这时会场中第二高个子的人,红帽全球意识部门(Global Awareness)的高级主管[Jeff Mackanic][5],告诉他大部分社区版本今天都在场,然后让每个人开始作简单的自我介绍。 +这时会场中第二高个子的人,红帽全球意识部门(Global Awareness)的高级主管[Jeff Mackanic][5],告诉他大部分社区版主今天都在场,然后让每个人开始作简单的自我介绍。 “我叫[Jen Wike Huger][6],负责Opensource.com的内容管理,很高兴见到大家。” @@ -22,13 +20,13 @@ “我叫[Robin][9],从2013年开始参与版主项目。我在OSDC做了一些事情,工作是在[City of the Hague][10]维护[网站][11]。” -“我叫[Marcus Hanwell][12],来自英格兰,在[Kitware][13]工作。同时,我是FOSS科学软件的技术总监,和国家实验室在[Titan][14] Z和[Gpu programming][15]方面合作。我主要使用[Gentoo][16]和[KDE][17]。最后,我很激动能加入FOSS和开源科学。” +“我叫[Marcus Hanwell][12],来自英格兰,在[Kitware][13]工作。同时,我是FOSS science software的技术总监,和国家实验室在[Titan][14] Z和[Gpu programming][15]方面合作。我主要使用[Gentoo][16]和[KDE][17]。最后,我很激动能参与到FOSS和开源科学。” -“我叫[Phil Shapiro][18],是华盛顿的一个小图书馆28个Linux工作站的管理员。我视各位为我的同事。非常高兴能一起交流分享,贡献力量。我主要关注FOSS和自豪感的关系,以及FOSS如何提升自豪感。” +“我叫[Phil Shapiro][18],是华盛顿的一个小图书馆的28个Linux工作站的管理员。我视各位为我的同事。非常高兴能一起交流分享,贡献力量。我主要关注FOSS和自豪感的关系,以及FOSS如何提升自豪感。” “我叫[Joshua Holm][19]。我大多数时间都在关注系统更新,以及帮助人们在网上找工作。” -“我叫[Mel Chernoff][20],在红帽工作,和[Jason Hibbets]和[Mark Bohannon]一起主要关注政府渠道方面。” +“我叫[Mel Chernoff][20],在红帽工作,和[Jason Hibbets][22]和[Mark Bohannon][23]一起主要关注[政府][21]渠道方面。” “我叫[Scott Nesbitt][24],写过很多东西,使用FOSS很久了。我是个普通人,不是系统管理员,也不是程序员,只希望能更加高效工作。我帮助人们在商业和生活中使用FOSS。” @@ -38,41 +36,41 @@ “你在[新FOSS Minor][30]教书?!”,Jim说道,“很酷!” -“我叫[Jason Baker][31]。我是红慢的一个云专家,主要做[OpenStack][32]方面的工作。” +“我叫[Jason Baker][31]。我是红帽的一个云专家,主要做[OpenStack][32]方面的工作。” “我叫[Mark Bohannan][33],是红帽全球开放协议的一员,在华盛顿外工作。和Mel一样,我花了相当多时间写作,也从法律和政府部门中找合作者。我做了一个很好的小册子来讨论正在发生在政府中的积极变化。” -“我叫[Jason Hibbets][34],我组织了这次会议。” +“我叫[Jason Hibbets][34],我组织了这次讨论。” 会场中一片笑声。 -“我也组织了这片讨论,可以这么说,”这个棕红色头发笑容灿烂的家伙说道。笑声持续一会逐渐平息。 +“我也组织了这个讨论,可以这么说,”这个棕红色头发笑容灿烂的家伙说道。笑声持续一会逐渐平息。 -我当时在他左边,时不时从转录空隙中抬头看一眼,然后从眼神中注意到微笑背后暗示的那个自2008年1月起开始领导公司的人,红帽的CEO[Jim Whitehurst][35]。 +我当时在他左边,时不时从记录的间隙中抬头看一眼,我注意到淡淡微笑背后的那个令人瞩目的人,是自2008年1月起开始领导红帽公司的CEO [Jim Whitehurst][35]。 -“我有世界上最好的工作,”稍稍向后靠、叉腿抱头,Whitehurst开始了演讲。“我开始领导红帽,在世界各地旅行到处看看情况。在这里的七年中,FOSS和广泛的开源创新所发生的美好的事情是开源已经脱离了条条框框。我现在认为,IT正处在FOSS之前所在的位置。我们可以预见FOSS从一个替代走向创新驱动力。”用户也看到了这一点。他们用FOSS并不是因为它便宜,而是因为它能提供和创新的解决方案。这也十一个全球现象。比如,我刚才还在印度,然后发现那里的用户拥抱开源的两个理由:一个是创新,另一个是那里的市场有些特殊,需要完全的控制。 +“我有世界上最好的工作,”稍稍向后靠、叉腿抱头,Whitehurst开始了演讲。“我开始领导红帽,在世界各地旅行到处看看情况。在这里的七年中,FOSS和广泛的开源创新所发生的最美好的事情是开源已经脱离了条条框框。我现在认为,信息技术正处在FOSS之前所在的位置。我们可以预见FOSS从一个替代品走向创新驱动力。我们的用户也看到了这一点。他们用FOSS并不是因为它便宜,而是因为它能带来可控和创新的解决方案。这也是个全球现象。比如,我刚才还在印度,然后发现那里的用户拥抱开源的两个理由:一个是创新,另一个是那里的市场有些特殊,需要完全的可控。” -“[孟买证券交易所][36]想得到源代码并加以控制,五年前这在证券交易领域闻所未闻。那时FOSS正在重复发明轮子。今天看来,FOSS正在做几乎所有的结合了大数据的事物。几乎所有的新框架,语言和方法论,包括流动(尽管不包括设备),都首先发生在开源世界。” +“[孟买证券交易所][36]想得到源代码并加以控制,五年前这种事情在证券交易领域就没有听说过。那时FOSS正在重复发明轮子。今天看来,实际上大数据的每件事情都出现在FOSS领域。几乎所有的新框架,语言和方法论,包括移动通讯(尽管不包括设备),都首先发生在开源世界。” -“这是因为用户数量已经达到了相当的规模。这不只是红帽遇到的情况,[Google][37],[Amazon][38],[Facebook][39]等也出现这样的情况。他们想解决自己的问题,用开源的方式。忘掉协议吧,开源绝不仅如此。我们建立了一个交通工具,一套规则,例如[Hadoop][40],[Cassandra][41]和其他工具。事实上,开源驱动创新。例如,Hadoop在厂商们意识的规模带来的问题。他们实际上有足够的资和资源金来解决自己的问题。”开源是许多领域的默认技术方案。这在一个更加注重内容的世界中更是如此,例如[3D打印][42]和其他使用信息内容的物理产品。” +“这是因为用户数量已经达到了相当的规模。这不只是红帽遇到的情况,[Google][37],[Amazon][38],[Facebook][39]等也出现这样的情况。他们想解决自己的问题,用开源的方式。忘掉许可协议吧,开源绝不仅如此。我们建立了一个交通工具,一套规则,例如[Hadoop][40],[Cassandra][41]和其他工具。事实上,开源驱动创新。例如,Hadoop是在厂商们意识到规模带来的问题时的一个解决方案。他们实际上有足够的资金和资源来解决自己的问题。开源是许多领域的默认技术方案。这在一个更加注重内容的世界中更是如此,例如[3D打印][42]和其他使用信息内容的实体产品。” “源代码的开源确实很酷,但开源不应当仅限于此。在各行各业不同领域开源仍有可以用武之地。我们要问下自己:‘开源能够为教育,政府,法律带来什么?其它的呢?其它的领域如何能学习我们?’” -“还有内容的问题。内容在现在是免费的,当然我们可以投资更多的免费内容,不过我们也需要商业模式围绕的内容。这是我们更应该关注的。如果你相信开放的创新能带来更好,那么我们需要更多的商业模式。” +“还有内容的问题。内容在现在是免费的,当然我们可以投资更多的免费内容,不过我们也需要商业模式围绕的内容。这是我们更应该关注的。如果你相信开放的创新更好,那么我们需要更多的商业模式。” -“教育让我担心其相比与‘社区’它更关注‘内容’。例如,无论我走到哪里,大学校长们都会说,‘等等,难道教育将会免费?!’对于下游来说FOSS免费很棒,但别忘了上游很强大。免费课程很棒,但我们同样需要社区来不断迭代和完善。这是很多人都在做的事情,Opensource.com是一个提供交流的社区。问题不是‘我们如何控制内容’,也不是‘如何建立和分发内容’,而是要确保它处在不断的完善当中,而且能给其他领域提供有价值的参考。” +“教育让我担心,其相比与‘社区’它更关注‘内容’。例如,无论我走到哪里,大学的校长们都会说,‘等等,难道教育将会免费?!’对于下游来说FOSS免费很棒,但别忘了上游很强大。免费课程很棒,但我们同样需要社区来不断迭代和完善。这是很多人都在做的事情,Opensource.com是一个提供交流的社区。问题不是‘我们如何控制内容’,也不是‘如何建立和分发内容’,而是要确保它处在不断的完善当中,而且能给其他领域提供有价值的参考。” “改变世界的潜力是无穷无尽的,我们已经取得了很棒的进步。”六年前我们痴迷于制定宣言,我们说‘我们是领导者’。我们用错词了,因为那潜在意味着控制。积极的参与者们同样也不能很好理解……[Máirín Duffy][43]提出了[催化剂][44]这个词。然后我们组成了红帽,不断地促进行动,指引方向。” -“Opensource.com也是其他领域的催化剂,而这正是它的本义所在,我希望你们也这样认为。当时的内容质量和现在比起来都令人难以置信。你可以看到每季度它都在进步。谢谢你们的时间!谢谢成为了催化剂!这是一个让世界变得更好的机会。我想听听你们的看法。” +“Opensource.com也是其他领域的催化剂,而这正是它的本义所在,我希望你们也这样认为。当时的内容质量和现在比起来都令人难以置信。你可以看到每季度它都在进步。谢谢你们付出的时间!谢谢成为了催化剂!这是一个让世界变得更好的机会。我想听听你们的看法。” 我瞥了一下桌子,发现几个人眼中带泪。 然后Whitehurst又回顾了大会的开放教育议题。“极端一点看,如果你有一门[Ulysses][45]的公开课。在这里你能和一群人一起合作体验课堂。这样就和代码块一样的:大家一起努力,代码随着时间不断改进。” -在这一点上,我有发言权。当谈论其FOSS和学术团体之间的差异,向基础和可能的不调和这些词语都跳了出来。 +在这一点上,我有发言权。当谈论其FOSS和学术团体之间的差异,像“基础”和“可能不调和”这些词语都跳了出来。 -**Remy**: “倒退带来死亡。如果你在论文或者发布的代码中烦了一个错误,有可能带来十分严重的后果。学校一直都是避免失败寻求正确答案的地方。复制意味着抄袭。轮子在一遍遍地教条地被发明。FOSS你能快速失败,但在学术界,你只能带来无效的结果。” +**Remy**: “倒退带来死亡。如果你在论文或者发布的代码中犯了一个错误,有可能带来十分严重的后果。学校一直都是避免失败寻求正确答案的地方。复制意味着抄袭。轮子在一遍遍地教条地被发明。FOSS让你能快速失败,但在学术界,你只能带来无效的结果。” **Nicole**: “学术界有太多自我的家伙,你们需要一个发布经理。” @@ -80,20 +78,21 @@ **Luis**: “团队和分享应该优先考虑,红帽可以多向它们强调这一点。” -**Jim**: “还有公司在其中扮演积极角色吗?” +**Jim**: “还有公司在其中扮演积极角色了吗?” -[Phil Shapiro][46]: “我对FOSS的临界点感兴趣。联邦没有改用[LibreOffice][47]把我逼疯了。我们没有在软件上花税款,也不应当在字处理软件或者微软的Office上浪费税钱。” +[Phil Shapiro][46]: “我对FOSS的临界点感兴趣。Fed没有改用[LibreOffice][47]把我逼疯了。我们没有在软件上花税款,也不应当在字处理软件或者微软的Office上浪费税钱。” -**Jim**: “我们经常提倡这一点。我们能做更多吗?这是个问题。首先,我们在我们的产品涉足的地方取得了进步。我们在政府中有坚实的专营权。我们比私有公司平均话费更多。银行和电信业都和政府挨着。我们在欧洲做的更好,我认为在那工作又更低的税。下一代计算就像‘终结者’,我们到处取得了进步,但仍然需要忧患意识。” +**Jim**: “我们经常提倡这一点。我们能做更多吗?这是个问题。首先,我们在我们的产品涉足的地方取得了进步。我们在政府中有坚实的专营权。我们比私有公司平均花费更多。银行和电信业都和政府挨着。我们在欧洲做的更好,我认为在那工作有更低的税。下一代计算就像‘终结者’,我们到处取得了进步,但仍然需要忧患意识。” + +突然,门开了。Jim转身向门口站着的执行助理点头。他要去参加下一场会了。他并拢双腿,站着向前微倾。然后,他再次向每个人的工作和奉献表示感谢,微笑着出了门……留给我们更多的激励。 -突然,门开了。Jim转身向门口站着的执行助理点头。他要去参加下一场会了。他并拢双腿,站着向前微倾。然后,他再次向每个人的工作和奉献表示感谢,微笑着除了门……留给我们更多的激励。 -------------------------------------------------------------------------------- via: https://opensource.com/business/14/12/jim-whitehurst-inspiration-open-source 作者:[Remy][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) +译者:[fyh](https://github.com/fyh) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 From 83b197b3ce99246cb5c1965fc1de693d9f090f55 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 13 Aug 2015 09:31:59 +0800 Subject: [PATCH 903/965] translating --- ...Web Based Network Traffic Analyzer--Install it on Linux.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150811 Darkstat is a Web Based Network Traffic Analyzer--Install it on Linux.md b/sources/tech/20150811 Darkstat is a Web Based Network Traffic Analyzer--Install it on Linux.md index 9f78722cb6..3b3fe49a7f 100644 --- a/sources/tech/20150811 Darkstat is a Web Based Network Traffic Analyzer--Install it on Linux.md +++ b/sources/tech/20150811 Darkstat is a Web Based Network Traffic Analyzer--Install it on Linux.md @@ -1,3 +1,5 @@ +translating-----geekpi + Darkstat is a Web Based Network Traffic Analyzer – Install it on Linux ================================================================================ Darkstat is a simple, web based network traffic analyzer application. It works on many popular operating systems like Linux, Solaris, Mac and AIX. It keeps running in the background as a daemon and continues collecting and sniffing network data and presents it in easily understandable format within its web interface. It can generate traffic reports for hosts, identify which ports are open on some particular host and is IPV 6 complaint application. Let’s see how we can install and configure it on Linux operating system. @@ -59,4 +61,4 @@ via: http://linuxpitstop.com/install-darkstat-on-ubuntu-linux/ 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 -[a]:http://linuxpitstop.com/author/aun/ \ No newline at end of file +[a]:http://linuxpitstop.com/author/aun/ From f5f2a55acba0a563381de7dc8718d856de00ff22 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 13 Aug 2015 10:12:57 +0800 Subject: [PATCH 904/965] translating --- ...k Traffic Analyzer--Install it on Linux.md | 40 +++++++++---------- 1 file changed, 19 insertions(+), 21 deletions(-) diff --git a/sources/tech/20150811 Darkstat is a Web Based Network Traffic Analyzer--Install it on Linux.md b/sources/tech/20150811 Darkstat is a Web Based Network Traffic Analyzer--Install it on Linux.md index 3b3fe49a7f..e8e6bace07 100644 --- a/sources/tech/20150811 Darkstat is a Web Based Network Traffic Analyzer--Install it on Linux.md +++ b/sources/tech/20150811 Darkstat is a Web Based Network Traffic Analyzer--Install it on Linux.md @@ -1,62 +1,60 @@ -translating-----geekpi - -Darkstat is a Web Based Network Traffic Analyzer – Install it on Linux +Darkstat一个基于网络的流量分析器 - 在Linux中安装 ================================================================================ -Darkstat is a simple, web based network traffic analyzer application. It works on many popular operating systems like Linux, Solaris, Mac and AIX. It keeps running in the background as a daemon and continues collecting and sniffing network data and presents it in easily understandable format within its web interface. It can generate traffic reports for hosts, identify which ports are open on some particular host and is IPV 6 complaint application. Let’s see how we can install and configure it on Linux operating system. +Darkstat是一个简易的,基于网络的流量分析程序。它可以在主流的操作系统如Linux、Solaris、MAC、AIX上工作。它以守护进程的形式持续工作在后台并不断地嗅探网络数据并以简单易懂的形式展现在网页上。它可以为主机生成流量报告,鉴别特定主机上哪些端口打开并且兼容IPv6。让我们看下如何在Linux中安装和配置它。 -### Installing Darkstat on Linux ### +### 在Linux中安装配置Darkstat ### -**Install Darkstat on Fedora/CentOS/RHEL:** +** 在Fedora/CentOS/RHEL中安装Darkstat:** -In order to install it on Fedora/RHEL and CentOS Linux distributions, run following command on the terminal. +要在Fedora/RHEL和CentOS中安装,运行下面的命令。 sudo yum install darkstat -**Install Darkstat on Ubuntu/Debian:** +**在Ubuntu/Debian中安装Darkstat:** -Run following on the terminal to install it on Ubuntu and Debian. +运行下面的命令在Ubuntu和Debian中安装。 sudo apt-get install darkstat -Congratulations, Darkstat has been installed on your Linux system now. +恭喜你,Darkstat已经在你的Linux中安装了。 -### Configuring Darkstat ### +### 配置 Darkstat ### -In order to run this application properly, we need to perform some basic configurations. Edit /etc/darkstat/init.cfg file in Gedit text editor by running the following command on the terminal. +为了正确运行这个程序,我恩需要执行一些基本的配置。运行下面的命令用gedit编辑器打开/etc/darkstat/init.cfg文件。 sudo gedit /etc/darkstat/init.cfg ![](http://linuxpitstop.com/wp-content/uploads/2015/08/13.png) -Edit Darkstat +编辑 Darkstat -Change START_DARKSTAT parameter to “yes” and provide your network interface in “INTERFACE”. Make sure to uncomment DIR, PORT, BINDIP, and LOCAL parameters here. If you wish to bind the web interface for Darkstat to some specific IP, provide it in BINDIP section. +修改START_DARKSTAT这个参数为yes,并在“INTERFACE”中提供你的网络接口。确保取消了DIR、PORT、BINDIP和LOCAL这些参数的注释。如果你希望绑定Darkstat到特定的IP,在BINDIP中提供它 -### Starting Darkstat Daemon ### +### 启动Darkstat守护进程 ### -Once the installation and configuration for Darkstat is complete, run following command to start its daemon. +安装并配置完Darkstat后,运行下面的命令启动它的守护进程。 sudo /etc/init.d/darkstat start ![Restarting Darkstat](http://linuxpitstop.com/wp-content/uploads/2015/08/23.png) -You can configure Darkstat to start on system boot by running the following command: +你可以用下面的命令来在开机时启动Darkstat: chkconfig darkstat on -Launch your browser and load **http://localhost:666** and it will display the web based graphical interface for Darkstat. Start using this tool to analyze your network traffic. +打开浏览器并打开**http://localhost:666**,它会显示Darkstat的网页界面。使用这个工具来分析你的网络流量。 ![Darkstat](http://linuxpitstop.com/wp-content/uploads/2015/08/32.png) -### Conclusion ### +### 总结 ### -It is a lightweight tool with very low memory footprints. The key reason for the popularity of this tool is simplicity, ease of configuration and usage. It is a must-have application for System and Network Administrators. +它是一个占用很少内存的轻量级工具。这个工具流行的原因是简易、易于配置和使用。这是一个对系统管理员而言必须拥有的程序 -------------------------------------------------------------------------------- via: http://linuxpitstop.com/install-darkstat-on-ubuntu-linux/ 作者:[Aun][a] -译者:[译者ID](https://github.com/译者ID) +译者:[geekpi](https://github.com/geekpi) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 From ed05a3b8483d65879b9bfc48daaa909e29afd347 Mon Sep 17 00:00:00 2001 From: DeadFire Date: Thu, 13 Aug 2015 10:22:14 +0800 Subject: [PATCH 905/965] =?UTF-8?q?20150813-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ow to get Public IP from Linux Terminal.md | 68 +++ ...150813 Linux file system hierarchy v2.0.md | 438 ++++++++++++++++++ ... Install The Latest Nvidia Linux Driver.md | 63 +++ 3 files changed, 569 insertions(+) create mode 100644 sources/tech/20150813 How to get Public IP from Linux Terminal.md create mode 100644 sources/tech/20150813 Linux file system hierarchy v2.0.md create mode 100644 sources/tech/20150813 Ubuntu Want To Make It Easier For You To Install The Latest Nvidia Linux Driver.md diff --git a/sources/tech/20150813 How to get Public IP from Linux Terminal.md b/sources/tech/20150813 How to get Public IP from Linux Terminal.md new file mode 100644 index 0000000000..f0bba2cea9 --- /dev/null +++ b/sources/tech/20150813 How to get Public IP from Linux Terminal.md @@ -0,0 +1,68 @@ +How to get Public IP from Linux Terminal? +================================================================================ +![](http://www.blackmoreops.com/wp-content/uploads/2015/06/256x256xHow-to-get-Public-IP-from-Linux-Terminal-blackMORE-Ops.png.pagespeed.ic.GKEAEd4UNr.png) + +Public addresses are assigned by InterNIC and consist of class-based network IDs or blocks of CIDR-based addresses (called CIDR blocks) that are guaranteed to be globally unique to the Internet. How to get Public IP from Linux Terminal - blackMORE OpsWhen the public addresses are assigned, routes are programmed into the routers of the Internet so that traffic to the assigned public addresses can reach their locations. Traffic to destination public addresses are reachable on the Internet. For example, when an organization is assigned a CIDR block in the form of a network ID and subnet mask, that [network ID, subnet mask] pair also exists as a route in the routers of the Internet. IP packets destined to an address within the CIDR block are routed to the proper destination. In this post I will show several ways to find your public IP address from Linux terminal. This though seems like a waste for normal users, but when you are in a terminal of a headless Linux server(i.e. no GUI or you’re connected as a user with minimal tools). Either way, being able to getHow to get Public IP from Linux Terminal public IP from Linux terminal can be useful in many cases or it could be one of those things that might just come in handy someday. + +There’s two main commands we use, curl and wget. You can use them interchangeably. + +### Curl output in plain text format: ### + + curl icanhazip.com + curl ifconfig.me + curl curlmyip.com + curl ip.appspot.com + curl ipinfo.io/ip + curl ipecho.net/plain + curl www.trackip.net/i + +### curl output in JSON format: ### + + curl ipinfo.io/json + curl ifconfig.me/all.json + curl www.trackip.net/ip?json (bit ugly) + +### curl output in XML format: ### + + curl ifconfig.me/all.xml + +### curl all IP details – The motherload ### + + curl ifconfig.me/all + +### Using DYNDNS (Useful when you’re using DYNDNS service) ### + + curl -s 'http://checkip.dyndns.org' | sed 's/.*Current IP Address: \([0-9\.]*\).*/\1/g' + curl -s http://checkip.dyndns.org/ | grep -o "[[:digit:].]\+" + +### Using wget instead of curl ### + + wget http://ipecho.net/plain -O - -q ; echo + wget http://observebox.com/ip -O - -q ; echo + +### Using host and dig command (cause we can) ### + +You can also use host and dig command assuming they are available or installed + + host -t a dartsclink.com | sed 's/.*has address //' + dig +short myip.opendns.com @resolver1.opendns.com + +### Sample bash script: ### + + #!/bin/bash + + PUBLIC_IP=`wget http://ipecho.net/plain -O - -q ; echo` + echo $PUBLIC_IP + +Quite a few to pick from. + +I was actually writing a small script to track all the IP changes of my router each day and save those into a file. I found these nifty commands and sites to use while doing some online research. Hope they help someone else someday too. Thanks for reading, please Share and RT. + +-------------------------------------------------------------------------------- + +via: http://www.blackmoreops.com/2015/06/14/how-to-get-public-ip-from-linux-terminal/ + +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 \ No newline at end of file diff --git a/sources/tech/20150813 Linux file system hierarchy v2.0.md b/sources/tech/20150813 Linux file system hierarchy v2.0.md new file mode 100644 index 0000000000..9df6d23dcf --- /dev/null +++ b/sources/tech/20150813 Linux file system hierarchy v2.0.md @@ -0,0 +1,438 @@ +Linux file system hierarchy v2.0 +================================================================================ +What is a file in Linux? What is file system in Linux? Where are all the configuration files? Where do I keep my downloaded applications? Is there really a filesystem standard structure in Linux? Well, the above image explains Linux file system hierarchy in a very simple and non-complex way. It’s very useful when you’re looking for a configuration file or a binary file. I’ve added some explanation and examples below, but that’s TL;DR. + +Another issue is when you got configuration and binary files all over the system that creates inconsistency and if you’re a large organization or even an end user, it can compromise your system (binary talking with old lib files etc.) and when you do [security audit of your Linux system][1], you find it is vulnerable to different exploits. So keeping a clean operating system (no matter Windows or Linux) is important. + +### What is a file in Linux? ### + +A simple description of the UNIX system, also applicable to Linux, is this: + +> On a UNIX system, everything is a file; if something is not a file, it is a process. + +This statement is true because there are special files that are more than just files (named pipes and sockets, for instance), but to keep things simple, saying that everything is a file is an acceptable generalization. A Linux system, just like UNIX, makes no difference between a file and a directory, since a directory is just a file containing names of other files. Programs, services, texts, images, and so forth, are all files. Input and output devices, and generally all devices, are considered to be files, according to the system. + +![](http://www.blackmoreops.com/wp-content/uploads/2015/06/Linux-file-system-hierarchy-v2.0-2480px-blackMORE-Ops.png) + +- Version 2.0 – 17-06-2015 + - – Improved: Added title and version history. + - – Improved: Added /srv, /media and /proc. + - – Improved: Updated descriptions to reflect modern Linux File Systems. + - – Fixed: Multiple typo’s. + - – Fixed: Appearance and colour. +- Version 1.0 – 14-02-2015 + - – Created: Initial diagram. + - – Note: Discarded lowercase version. + +### Download Links ### + +Following are two links for download. If you need this in any other format, let me know and I will try to create that and upload it somewhere. + +- [Large (PNG) Format – 2480×1755 px – 184KB][2] +- [Largest (PDF) Format – 9919x7019 px – 1686KB][3] + +**Note**: PDF Format is best for printing and very high in quality + +### Linux file system description ### + +In order to manage all those files in an orderly fashion, man likes to think of them in an ordered tree-like structure on the hard disk, as we know from `MS-DOS` (Disk Operating System) for instance. The large branches contain more branches, and the branches at the end contain the tree’s leaves or normal files. For now we will use this image of the tree, but we will find out later why this is not a fully accurate image. + +注:表格 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
DirectoryDescription
+
/
+
Primary hierarchy root and root directory of the entire file system hierarchy.
+
/bin
+
Essential command binaries that need to be available in single user mode; for all users, e.g., cat, ls, cp.
+
/boot
+
Boot loader files, e.g., kernels, initrd.
+
/dev
+
Essential devices, e.g., /dev/null.
+
/etc
+
Host-specific system-wide configuration filesThere has been controversy over the meaning of the name itself. In early versions of the UNIX Implementation Document from Bell labs, /etc is referred to as the etcetera directory, as this directory historically held everything that did not belong elsewhere (however, the FHS restricts /etc to static configuration files and may not contain binaries). Since the publication of early documentation, the directory name has been re-designated in various ways. Recent interpretations include backronyms such as “Editable Text Configuration” or “Extended Tool Chest”.
+
+
+
/opt
+
+
+
Configuration files for add-on packages that are stored in /opt/.
+
+
+
/sgml
+
+
+
Configuration files, such as catalogs, for software that processes SGML.
+
+
+
/X11
+
+
+
Configuration files for the X Window System, version 11.
+
+
+
/xml
+
+
+
Configuration files, such as catalogs, for software that processes XML.
+
/home
+
Users’ home directories, containing saved files, personal settings, etc.
+
/lib
+
Libraries essential for the binaries in /bin/ and /sbin/.
+
/lib<qual>
+
Alternate format essential libraries. Such directories are optional, but if they exist, they have some requirements.
+
/media
+
Mount points for removable media such as CD-ROMs (appeared in FHS-2.3).
+
/mnt
+
Temporarily mounted filesystems.
+
/opt
+
Optional application software packages.
+
/proc
+
Virtual filesystem providing process and kernel information as files. In Linux, corresponds to a procfs mount.
+
/root
+
Home directory for the root user.
+
/sbin
+
Essential system binaries, e.g., init, ip, mount.
+
/srv
+
Site-specific data which are served by the system.
+
/tmp
+
Temporary files (see also /var/tmp). Often not preserved between system reboots.
+
/usr
+
Secondary hierarchy for read-only user data; contains the majority of (multi-)user utilities and applications.
+
+
+
/bin
+
+
+
Non-essential command binaries (not needed in single user mode); for all users.
+
+
+
/include
+
+
+
Standard include files.
+
+
+
/lib
+
+
+
Libraries for the binaries in /usr/bin/ and /usr/sbin/.
+
+
+
/lib<qual>
+
+
+
Alternate format libraries (optional).
+
+
+
/local
+
+
+
Tertiary hierarchy for local data, specific to this host. Typically has further subdirectories, e.g., bin/, lib/, share/.
+
+
+
/sbin
+
+
+
Non-essential system binaries, e.g., daemons for various network-services.
+
+
+
/share
+
+
+
Architecture-independent (shared) data.
+
+
+
/src
+
+
+
Source code, e.g., the kernel source code with its header files.
+
+
+
/X11R6
+
+
+
X Window System, Version 11, Release 6.
+
/var
+
Variable files—files whose content is expected to continually change during normal operation of the system—such as logs, spool files, and temporary e-mail files.
+
+
+
/cache
+
+
+
Application cache data. Such data are locally generated as a result of time-consuming I/O or calculation. The application must be able to regenerate or restore the data. The cached files can be deleted without loss of data.
+
+
+
/lib
+
+
+
State information. Persistent data modified by programs as they run, e.g., databases, packaging system metadata, etc.
+
+
+
/lock
+
+
+
Lock files. Files keeping track of resources currently in use.
+
+
+
/log
+
+
+
Log files. Various logs.
+
+
+
/mail
+
+
+
Users’ mailboxes.
+
+
+
/opt
+
+
+
Variable data from add-on packages that are stored in /opt/.
+
+
+
/run
+
+
+
Information about the running system since last boot, e.g., currently logged-in users and running daemons.
+
+
+
/spool
+
+
+
Spool for tasks waiting to be processed, e.g., print queues and outgoing mail queue.
+
+
+
+
+
/mail
+
+
+
+
+
Deprecated location for users’ mailboxes.
+
+
+
/tmp
+
+
+
Temporary files to be preserved between reboots.
+ +### Types of files in Linux ### + +Most files are just files, called `regular` files; they contain normal data, for example text files, executable files or programs, input for or output from a program and so on. + +While it is reasonably safe to suppose that everything you encounter on a Linux system is a file, there are some exceptions. + +- `Directories`: files that are lists of other files. +- `Special files`: the mechanism used for input and output. Most special files are in `/dev`, we will discuss them later. +- `Links`: a system to make a file or directory visible in multiple parts of the system’s file tree. We will talk about links in detail. +- `(Domain) sockets`: a special file type, similar to TCP/IP sockets, providing inter-process networking protected by the file system’s access control. +- `Named pipes`: act more or less like sockets and form a way for processes to communicate with each other, without using network socket semantics. + +### File system in reality ### + +For most users and for most common system administration tasks, it is enough to accept that files and directories are ordered in a tree-like structure. The computer, however, doesn’t understand a thing about trees or tree-structures. + +Every partition has its own file system. By imagining all those file systems together, we can form an idea of the tree-structure of the entire system, but it is not as simple as that. In a file system, a file is represented by an `inode`, a kind of serial number containing information about the actual data that makes up the file: to whom this file belongs, and where is it located on the hard disk. + +Every partition has its own set of inodes; throughout a system with multiple partitions, files with the same inode number can exist. + +Each inode describes a data structure on the hard disk, storing the properties of a file, including the physical location of the file data. When a hard disk is initialized to accept data storage, usually during the initial system installation process or when adding extra disks to an existing system, a fixed number of inodes per partition is created. This number will be the maximum amount of files, of all types (including directories, special files, links etc.) that can exist at the same time on the partition. We typically count on having 1 inode per 2 to 8 kilobytes of storage.At the time a new file is created, it gets a free inode. In that inode is the following information: + +- Owner and group owner of the file. +- File type (regular, directory, …) +- Permissions on the file +- Date and time of creation, last read and change. +- Date and time this information has been changed in the inode. +- Number of links to this file (see later in this chapter). +- File size +- An address defining the actual location of the file data. + +The only information not included in an inode, is the file name and directory. These are stored in the special directory files. By comparing file names and inode numbers, the system can make up a tree-structure that the user understands. Users can display inode numbers using the -i option to ls. The inodes have their own separate space on the disk. + +-------------------------------------------------------------------------------- + +via: http://www.blackmoreops.com/2015/06/18/linux-file-system-hierarchy-v2-0/ + +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[1]:http://www.blackmoreops.com/2015/02/15/in-light-of-recent-linux-exploits-linux-security-audit-is-a-must/ +[2]:http://www.blackmoreops.com/wp-content/uploads/2015/06/Linux-file-system-hierarchy-v2.0-2480px-blackMORE-Ops.png +[3]:http://www.blackmoreops.com/wp-content/uploads/2015/06/Linux-File-System-Hierarchy-blackMORE-Ops.pdf \ No newline at end of file diff --git a/sources/tech/20150813 Ubuntu Want To Make It Easier For You To Install The Latest Nvidia Linux Driver.md b/sources/tech/20150813 Ubuntu Want To Make It Easier For You To Install The Latest Nvidia Linux Driver.md new file mode 100644 index 0000000000..2bae0061c4 --- /dev/null +++ b/sources/tech/20150813 Ubuntu Want To Make It Easier For You To Install The Latest Nvidia Linux Driver.md @@ -0,0 +1,63 @@ +Ubuntu Want To Make It Easier For You To Install The Latest Nvidia Linux Driver +================================================================================ +![Ubuntu Gamers are on the rise -and so is demand for the latest drivers](http://www.omgubuntu.co.uk/wp-content/uploads/2014/03/ubuntugamer_logo_dark-500x250.jpg) +Ubuntu Gamers are on the rise -and so is demand for the latest drivers + +**Installing the latest upstream NVIDIA graphics driver on Ubuntu could be about to get much easier. ** + +Ubuntu developers are considering the creation of a brand new ‘official’ PPA to distribute the latest closed-source NVIDIA binary drivers to desktop users. + +The move would benefit Ubuntu gamers **without** risking the stability of the OS for everyone else. + +New upstream drivers would be installed and updated from this new PPA **only** when a user explicitly opts-in to it. Everyone else would continue to receive and use the more recent stable NVIDIA Linux driver snapshot included in the Ubuntu archive. + +### Why Is This Needed? ### + +![Ubuntu provides drivers – but they’re not the latest](http://www.omgubuntu.co.uk/wp-content/uploads/2013/04/drivers.jpg) +Ubuntu provides drivers – but they’re not the latest + +The closed-source NVIDIA graphics drivers that are available to install on Ubuntu from the archive (using the command line, synaptic or through the additional drivers tool) work fine for most and can handle the composited Unity desktop shell with ease. + +For gaming needs it’s a different story. + +If you want to squeeze every last frame and HD texture out of the latest big-name Steam game you’ll need the latest binary drivers blob. + +> ‘Installing the very latest Nvidia Linux driver on Ubuntu is not easy and not always safe.’ + +The more recent the driver the more likely it is to support the latest features and technologies, or come pre-packed with game-specific tweaks and bug fixes too. + +The problem is that installing the very latest Nvidia Linux driver on Ubuntu is not easy and not always safe. + +To fill the void many third-party PPAs maintained by enthusiasts have emerged. Since many of these PPAs also distribute other experimental or bleeding-edge software their use is **not without risk**. Adding a bleeding edge PPA is often the fastest way to entirely hose a system! + +A solution that lets Ubuntu users install the latest propriety graphics drivers as offered in third-party PPAs is needed **but** with the safety catch of being able to roll-back to the stable archive version if needed. + +### ‘Demand for fresh drivers is hard to ignore’ ### + +> ‘A solution that lets Ubuntu users get the latest hardware drivers safely is coming.’ + +‘The demand for fresh drivers in a fast developing market is becoming hard to ignore, users are going to want the latest upstream has to offer,’ Castro explains in an e-mail to the Ubuntu Desktop mailing list. + +‘[NVIDIA] can deliver a kickass experience with almost no effort from the user [in Windows 10]. Until we can convince NVIDIA to do the same with Ubuntu we’re going to have to pick up the slack.’ + +Castro’s proposition of a “blessed” NVIDIA PPA is the easiest way to do this. + +Gamers would be able to opt-in to receive new drivers from the PPA straight from Ubuntu’s default proprietary hardware drivers tool — no need for them to copy and paste terminal commands from websites or wiki pages. + +The drivers within this PPA would be packaged and maintained by a select band of community members and receive benefits from being a semi-official option, namely **automated testing**. + +As Castro himself puts it: ‘People want the latest bling, and no matter what they’re going to do it. We might as well put a framework around it so people can get what they want without breaking their computer.’ + +**Would you make use of this PPA? How would you rate the performance of the default Nvidia drivers on Ubuntu? Share your thoughts in the comments, folks! ** + +-------------------------------------------------------------------------------- + +via: http://www.omgubuntu.co.uk/2015/08/ubuntu-easy-install-latest-nvidia-linux-drivers + +作者:[Joey-Elijah Sneddon][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://plus.google.com/117485690627814051450/?rel=author \ No newline at end of file From cc0d58299115994ccd4982cdb806460dc18e718b Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 13 Aug 2015 10:35:12 +0800 Subject: [PATCH 906/965] translated --- ...s a Web Based Network Traffic Analyzer--Install it on Linux.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/20150811 Darkstat is a Web Based Network Traffic Analyzer--Install it on Linux.md (100%) diff --git a/sources/tech/20150811 Darkstat is a Web Based Network Traffic Analyzer--Install it on Linux.md b/translated/tech/20150811 Darkstat is a Web Based Network Traffic Analyzer--Install it on Linux.md similarity index 100% rename from sources/tech/20150811 Darkstat is a Web Based Network Traffic Analyzer--Install it on Linux.md rename to translated/tech/20150811 Darkstat is a Web Based Network Traffic Analyzer--Install it on Linux.md From 2857115c5c775ef504947bd7cfc8fdffcafcb256 Mon Sep 17 00:00:00 2001 From: DeadFire Date: Thu, 13 Aug 2015 10:45:09 +0800 Subject: [PATCH 907/965] =?UTF-8?q?20150813-2=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...How to Install Logwatch on Ubuntu 15.04.md | 137 +++++++++++++++ ...st Disk I O Performance With dd Command.md | 162 ++++++++++++++++++ 2 files changed, 299 insertions(+) create mode 100644 sources/tech/20150813 How to Install Logwatch on Ubuntu 15.04.md create mode 100644 sources/tech/20150813 Linux and Unix Test Disk I O Performance With dd Command.md diff --git a/sources/tech/20150813 How to Install Logwatch on Ubuntu 15.04.md b/sources/tech/20150813 How to Install Logwatch on Ubuntu 15.04.md new file mode 100644 index 0000000000..fa9458dcb4 --- /dev/null +++ b/sources/tech/20150813 How to Install Logwatch on Ubuntu 15.04.md @@ -0,0 +1,137 @@ +How to Install Logwatch on Ubuntu 15.04 +================================================================================ +Hi, Today we are going to illustrate the setup of Logwatch on Ubuntu 15.04 Operating system where as it can be used for any Linux and UNIX like operating systems. Logwatch is a customizable system log analyzer and reporting log-monitoring system that go through your logs for a given period of time and make a report in the areas that you wish with the details you want. Its an easy tool to install, configure, review and to take actions that will improve security from data it provides. Logwatch scans the log files of major operating system components, like SSH, Web Server and forwards a summary that contains the valuable items in it that needs to be looked at. + +### Pre-installation Setup ### + +We will be using Ubuntu 15.04 operating system to deploy Logwatch on it so as a perquisite for the installation of Logwatch, make sure that your emails setup is working as it will be used to send email to the administrators for daily reports on the gathered reports.Your system repositories should be enabled as we will be installing it from its available universal repositories. + +Then open the terminal of your ubuntu operating system and login with root user to update your system packages before moving to Logwatch installation. + + root@ubuntu-15:~# apt-get update + +### Installing Logwatch ### + +Once your system is updated and your have fulfilled all its prerequisites then run the following command to start the installation of Logwatch in your server. + + root@ubuntu-15:~# apt-get install logwatch + +The logwatch installation process will starts with addition of some extra required packages as shown once you press “Y” to accept the required changes to the system. + +During the installation process you will be prompted to configure the Postfix Configurations according to your mail server’s setup. Here we used “Local only” in the tutorial for ease, we can choose from the other available options as per your infrastructure requirements and then press “OK” to proceed. + +![Potfix Configurations](http://blog.linoxide.com/wp-content/uploads/2015/08/21.png) + +Then you have to choose your mail server’s name that will also be used by other programs, so it should be single fully qualified domain name (FQDN). + +![Postfix Setup](http://blog.linoxide.com/wp-content/uploads/2015/08/31.png) + +Once you press “OK” after postfix configurations, then it will completes the Logwatch installation process with default configurations of Postfix. + +![Logwatch Completion](http://blog.linoxide.com/wp-content/uploads/2015/08/41.png) + +You can check the status of Logwatch by issuing the following command in the terminal that should be in active state. + + root@ubuntu-15:~# service postfix status + +![Postfix Status](http://blog.linoxide.com/wp-content/uploads/2015/08/51.png) + +To confirm the installation of Logwatch with its default configurations, issue the simple “logwatch” command as shown. + + root@ubuntu-15:~# logwatch + +The output from the above executed command will results in following compiled report form in the terminal. + +![Logwatch Report](http://blog.linoxide.com/wp-content/uploads/2015/08/61.png) + +### Logwatch Configurations ### + +Now after successful installation of Logwatch, we need to make few configuration changes in its configuration file located under following shown path. So, let’s open it with the file editor to update its configurations as required. + + root@ubuntu-15:~# vim /usr/share/logwatch/default.conf/logwatch.conf + +**Output/Format Options** + +By default Logwatch will print to stdout in text with no encoding.To make email Default set “Output = mail” and to save to file set “Output = file”. So you can comment out the its default configurations as per your required settings. + + Output = stdout + +To make Html the default formatting update the following line if you are using Internet email configurations. + + Format = text + +Now add the default person to mail reports should be sent to, it could be a local account or a complete email address that you are free to mention in this line + + MailTo = root + #MailTo = user@test.com + +Default person to mail reports sent from can be a local account or any other you wish to use. + + # complete email address. + MailFrom = Logwatch + +Save the changes made in the configuration file of Logwatch while leaving the other parameter as default. + +**Cronjob Configuration** + +Now edit the "00logwatch" file in daily crons directory to configure your desired email address to forward reports from logwatch. + + root@ubuntu-15:~# vim /etc/cron.daily/00logwatch + +Here you need to use "--mailto" user@test.com instead of --output mail and save the file. + +![Logwatch Cronjob](http://blog.linoxide.com/wp-content/uploads/2015/08/71.png) + +### Using Logwatch Report ### + +Now we generate the test report by executing the "logwatch" command in the terminal to get its result shown in the Text format within the terminal. + + root@ubuntu-15:~#logwatch + +The generated report starts with showing its execution time and date, it will be comprising of different sections that starts with its begin status and closed with end status after showing the complete information about its logs of the mentioned sections. + +Here is its starting point looks like, where it starts by showing all the installed packages in the system as shown below. + +![dpkg status](http://blog.linoxide.com/wp-content/uploads/2015/08/81.png) + +The following sections shows the logs informmation about the login sessions, rsyslogs and SSH connections about the current and last sessions enabled on the system. + +![logwatch report](http://blog.linoxide.com/wp-content/uploads/2015/08/9.png) + +The logwatch report will ends up by showing the secure sudo logs and the disk space usage of the root diretory as shown below. + +![Logwatch end report](http://blog.linoxide.com/wp-content/uploads/2015/08/10.png) + +You can also check for the generated emails about the logwatch reports by opening the following file. + + root@ubuntu-15:~# vim /var/mail/root + +Here you will be able to see all the generated emails to your configured users with their message delivery status. + +### More about Logwatch ### + +Logwatch is a great tool to lern more about it, so if your more interested to learn more about its logwatch then you can also get much help from the below few commands. + + root@ubuntu-15:~# man logwatch + +The above command contains all the users manual about the logwatch, so read it carefully and to exit from the manuals section simply press "q". + +To get help about the logwatch commands usage you can run the following help command for further information in details. + + root@ubuntu-15:~# logwatch --help + +### Conclusion ### + +At the end of this tutorial you learn about the complete setup of Logwatch on Ubuntu 15.04 that includes with its installation and configurations guide. Now you can start monitoring your logs in a customize able form, whether you monitor the logs of all the services rnning on your system or you customize it to send you the reports about the specific services on the scheduled days. So, let's use this tool and feel free to leave us a comment if you face any issue or need to know more about logwatch usage. + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/ubuntu-how-to/install-use-logwatch-ubuntu-15-04/ + +作者:[Kashif Siddique][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://linoxide.com/author/kashifs/ \ No newline at end of file diff --git a/sources/tech/20150813 Linux and Unix Test Disk I O Performance With dd Command.md b/sources/tech/20150813 Linux and Unix Test Disk I O Performance With dd Command.md new file mode 100644 index 0000000000..c30619d13e --- /dev/null +++ b/sources/tech/20150813 Linux and Unix Test Disk I O Performance With dd Command.md @@ -0,0 +1,162 @@ +Linux and Unix Test Disk I/O Performance With dd Command +================================================================================ +How can I use dd command on a Linux to test I/O performance of my hard disk drive? How do I check the performance of a hard drive including the read and write speed on a Linux operating systems? + +You can use the following commands on a Linux or Unix-like systems for simple I/O performance test: + +- **dd command** : It is used to monitor the writing performance of a disk device on a Linux and Unix-like system +- **hdparm command** : It is used to get/set hard disk parameters including test the reading and caching performance of a disk device on a Linux based system. + +In this tutorial you will learn how to use the dd command to test disk I/O performance. + +### Use dd command to monitor the reading and writing performance of a disk device: ### + +- Open a shell prompt. +- Or login to a remote server via ssh. +- Use the dd command to measure server throughput (write speed) `dd if=/dev/zero of=/tmp/test1.img bs=1G count=1 oflag=dsync` +- Use the dd command to measure server latency `dd if=/dev/zero of=/tmp/test2.img bs=512 count=1000 oflag=dsync` + +#### Understanding dd command options #### + +In this example, I'm using RAID-10 (Adaptec 5405Z with SAS SSD) array running on a Ubuntu Linux 14.04 LTS server. The basic syntax is + + dd if=/dev/input.file of=/path/to/output.file bs=block-size count=number-of-blocks oflag=dsync + ## GNU dd syntax ## + dd if=/dev/zero of=/tmp/test1.img bs=1G count=1 oflag=dsync + ## OR alternate syntax for GNU/dd ## + dd if=/dev/zero of=/tmp/testALT.img bs=1G count=1 conv=fdatasync + +Sample outputs: + +![Fig.01: Ubuntu Linux Server with RAID10 and testing server throughput with dd](http://s0.cyberciti.org/uploads/faq/2015/08/dd-server-test-io-speed-output.jpg) +Fig.01: Ubuntu Linux Server with RAID10 and testing server throughput with dd + +Please note that one gigabyte was written for the test and 135 MB/s was server throughput for this test. Where, + +- `if=/dev/zero (if=/dev/input.file)` : The name of the input file you want dd the read from. +- `of=/tmp/test1.img (of=/path/to/output.file)` : The name of the output file you want dd write the input.file to. +- `bs=1G (bs=block-size)` : Set the size of the block you want dd to use. 1 gigabyte was written for the test. +- `count=1 (count=number-of-blocks)`: The number of blocks you want dd to read. +- `oflag=dsync (oflag=dsync)` : Use synchronized I/O for data. Do not skip this option. This option get rid of caching and gives you good and accurate results +- `conv=fdatasyn`: Again, this tells dd to require a complete "sync" once, right before it exits. This option is equivalent to oflag=dsync. + +In this example, 512 bytes were written one thousand times to get RAID10 server latency time: + + dd if=/dev/zero of=/tmp/test2.img bs=512 count=1000 oflag=dsync + +Sample outputs: + + 1000+0 records in + 1000+0 records out + 512000 bytes (512 kB) copied, 0.60362 s, 848 kB/s + +Please note that server throughput and latency time depends upon server/application load too. So I recommend that you run these tests on a newly rebooted server as well as peak time to get better idea about your workload. You can now compare these numbers with all your devices. + +#### But why the server throughput and latency time are so low? #### + +Low values does not mean you are using slow hardware. The value can be low because of the HARDWARE RAID10 controller's cache. + +Use hdparm command to see buffered and cached disk read speed + +I suggest you run the following commands 2 or 3 times Perform timings of device reads for benchmark and comparison purposes: + + ### Buffered disk read test for /dev/sda ## + hdparm -t /dev/sda1 + ## OR ## + hdparm -t /dev/sda + +To perform timings of cache reads for benchmark and comparison purposes again run the following command 2-3 times (note the -T option): + + ## Cache read benchmark for /dev/sda ### + hdparm -T /dev/sda1 + ## OR ## + hdparm -T /dev/sda + +OR combine both tests: + + hdparm -Tt /dev/sda + +Sample outputs: + +![Fig.02: Linux hdparm command to test reading and caching disk performance](http://s0.cyberciti.org/uploads/faq/2015/08/hdparam-output.jpg) +Fig.02: Linux hdparm command to test reading and caching disk performance + +Again note that due to filesystems caching on file operations, you will always see high read rates. + +**Use dd command on Linux to test read speed** + +To get accurate read test data, first discard caches before testing by running the following commands: + + flush + echo 3 | sudo tee /proc/sys/vm/drop_caches + time time dd if=/path/to/bigfile of=/dev/null bs=8k + +**Linux Laptop example** + +Run the following command: + + ### Debian Laptop Throughput With Cache ## + dd if=/dev/zero of=/tmp/laptop.bin bs=1G count=1 oflag=direct + + ### Deactivate the cache ### + hdparm -W0 /dev/sda + + ### Debian Laptop Throughput Without Cache ## + dd if=/dev/zero of=/tmp/laptop.bin bs=1G count=1 oflag=direct + +**Apple OS X Unix (Macbook pro) example** + +GNU dd has many more options but OS X/BSD and Unix-like dd command need to run as follows to test real disk I/O and not memory add sync option as follows: + + ## Run command 2-3 times to get good results ### + time sh -c "dd if=/dev/zero of=/tmp/testfile bs=100k count=1k && sync" + +Sample outputs: + + 1024+0 records in + 1024+0 records out + 104857600 bytes transferred in 0.165040 secs (635346520 bytes/sec) + + real 0m0.241s + user 0m0.004s + sys 0m0.113s + +So I'm getting 635346520 bytes (635.347 MB/s) write speed on my MBP. + +**Not a fan of command line...?** + +You can use disk utility (gnome-disk-utility) on a Linux or Unix based system to get the same information. The following screenshot is taken from my Fedora Linux v22 VM. + +**Graphical method** + +Click on the "Activities" or press the "Super" key to switch between the Activities overview and desktop. Type "Disks" + +![Fig.03: Start the Gnome disk utility](http://s0.cyberciti.org/uploads/faq/2015/08/disk-1.jpg) +Fig.03: Start the Gnome disk utility + +Select your hard disk at left pane and click on configure button and click on "Benchmark partition": + +![Fig.04: Benchmark disk/partition](http://s0.cyberciti.org/uploads/faq/2015/08/disks-2.jpg) +Fig.04: Benchmark disk/partition + +Finally, click on the "Start Benchmark..." button (you may be promoted for the admin username and password): + +![Fig.05: Final benchmark result](http://s0.cyberciti.org/uploads/faq/2015/08/disks-3.jpg) +Fig.05: Final benchmark result + +Which method and command do you recommend to use? + +- I recommend dd command on all Unix-like systems (`time sh -c "dd if=/dev/zero of=/tmp/testfile bs=100k count=1k && sync`" +- If you are using GNU/Linux use the dd command (`dd if=/dev/zero of=/tmp/testALT.img bs=1G count=1 conv=fdatasync`) +- Make sure you adjust count and bs arguments as per your setup to get a good set of result. +- The GUI method is recommended only for Linux/Unix laptop users running Gnome2 or 3 desktop. + +-------------------------------------------------------------------------------- + +via: http://www.cyberciti.biz/faq/howto-linux-unix-test-disk-performance-with-dd-command/ + +作者:Vivek Gite +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 \ No newline at end of file From fc087db114a358509e8efdd90b708b5c6e72548a Mon Sep 17 00:00:00 2001 From: runningwater Date: Thu, 13 Aug 2015 10:49:04 +0800 Subject: [PATCH 908/965] by runningwater --- .../tech/20150813 How to Install Logwatch on Ubuntu 15.04.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sources/tech/20150813 How to Install Logwatch on Ubuntu 15.04.md b/sources/tech/20150813 How to Install Logwatch on Ubuntu 15.04.md index fa9458dcb4..24c71b0cbe 100644 --- a/sources/tech/20150813 How to Install Logwatch on Ubuntu 15.04.md +++ b/sources/tech/20150813 How to Install Logwatch on Ubuntu 15.04.md @@ -1,3 +1,4 @@ +(translating by runningwater) How to Install Logwatch on Ubuntu 15.04 ================================================================================ Hi, Today we are going to illustrate the setup of Logwatch on Ubuntu 15.04 Operating system where as it can be used for any Linux and UNIX like operating systems. Logwatch is a customizable system log analyzer and reporting log-monitoring system that go through your logs for a given period of time and make a report in the areas that you wish with the details you want. Its an easy tool to install, configure, review and to take actions that will improve security from data it provides. Logwatch scans the log files of major operating system components, like SSH, Web Server and forwards a summary that contains the valuable items in it that needs to be looked at. @@ -129,9 +130,9 @@ At the end of this tutorial you learn about the complete setup of Logwatch on Ub via: http://linoxide.com/ubuntu-how-to/install-use-logwatch-ubuntu-15-04/ 作者:[Kashif Siddique][a] -译者:[译者ID](https://github.com/译者ID) +译者:[runningwater](https://github.com/runningwater) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 -[a]:http://linoxide.com/author/kashifs/ \ No newline at end of file +[a]:http://linoxide.com/author/kashifs/ From 14f172121f66f179cb7525924c2c46a0cdb064b2 Mon Sep 17 00:00:00 2001 From: DeadFire Date: Thu, 13 Aug 2015 11:01:53 +0800 Subject: [PATCH 909/965] =?UTF-8?q?20150813-3=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ation GA with OData in Docker Container.md | 102 ++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 sources/tech/20150813 Howto Run JBoss Data Virtualization GA with OData in Docker Container.md diff --git a/sources/tech/20150813 Howto Run JBoss Data Virtualization GA with OData in Docker Container.md b/sources/tech/20150813 Howto Run JBoss Data Virtualization GA with OData in Docker Container.md new file mode 100644 index 0000000000..0893b9a361 --- /dev/null +++ b/sources/tech/20150813 Howto Run JBoss Data Virtualization GA with OData in Docker Container.md @@ -0,0 +1,102 @@ +Howto Run JBoss Data Virtualization GA with OData in Docker Container +================================================================================ +Hi everyone, today we'll learn how to run JBoss Data Virtualization 6.0.0.GA with OData in a Docker Container. JBoss Data Virtualization is a data supply and integration solution platform that transforms various scatered multiple sources data, treats them as single source and delivers the required data into actionable information at business speed to any applications or users. JBoss Data Virtualization can help us easily combine and transform data into reusable business friendly data models and make unified data easily consumable through open standard interfaces. It offers comprehensive data abstraction, federation, integration, transformation, and delivery capabilities to combine data from one or multiple sources into reusable for agile data utilization and sharing.For more information about JBoss Data Virtualization, we can check out [its official page][1]. Docker is an open source platform that provides an open platform to pack, ship and run any application as a lightweight container. Running JBoss Data Virtualization with OData in Docker Container makes us easy to handle and launch. + +Here are some easy to follow tutorial on how we can run JBoss Data Virtualization with OData in Docker Container. + +### 1. Cloning the Repository ### + +First of all, we'll wanna clone the repository of OData with Data Virtualization ie [https://github.com/jbossdemocentral/dv-odata-docker-integration-demo][2] using git command. As we have an Ubuntu 15.04 distribution of linux running in our machine. We'll need to install git initially using apt-get command. + + # apt-get install git + +Then after installing git, we'll wanna clone the repository by running the command below. + + # git clone https://github.com/jbossdemocentral/dv-odata-docker-integration-demo + + Cloning into 'dv-odata-docker-integration-demo'... + remote: Counting objects: 96, done. + remote: Total 96 (delta 0), reused 0 (delta 0), pack-reused 96 + Unpacking objects: 100% (96/96), done. + Checking connectivity... done. + +### 2. Downloading JBoss Data Virtualization Installer ### + +Now, we'll need to download JBoss Data Virtualization Installer from the Download Page ie [http://www.jboss.org/products/datavirt/download/][3] . After we download **jboss-dv-installer-6.0.0.GA-redhat-4.jar**, we'll need to keep it under the directory named **software**. + +### 3. Building the Docker Image ### + +Next, after we have downloaded the JBoss Data Virtualization installer, we'll then go for building the docker image using the Dockerfile and its resources we had just cloned from the repository. + + # cd dv-odata-docker-integration-demo/ + # docker build -t jbossdv600 . + + ... + Step 22 : USER jboss + ---> Running in 129f701febd0 + ---> 342941381e37 + Removing intermediate container 129f701febd0 + Step 23 : EXPOSE 8080 9990 31000 + ---> Running in 61e6d2c26081 + ---> 351159bb6280 + Removing intermediate container 61e6d2c26081 + Step 24 : CMD $JBOSS_HOME/bin/standalone.sh -c standalone.xml -b 0.0.0.0 -bmanagement 0.0.0.0 + ---> Running in a9fed69b3000 + ---> 407053dc470e + Removing intermediate container a9fed69b3000 + Successfully built 407053dc470e + +Note: Here, we assume that you have already installed docker and is running in your machine. + +### 4. Starting the Docker Container ### + +As we have built the Docker Image of JBoss Data Virtualization with oData, we'll now gonna run the docker container and expose its port with -P flag. To do so, we'll run the following command. + + # docker run -p 8080:8080 -d -t jbossdv600 + + 7765dee9cd59c49ca26850e88f97c21f46859d2dc1d74166353d898773214c9c + +### 5. Getting the Container IP ### + +After we have started the Docker Container, we'll wanna get the IP address of the running docker container. To do so, we'll run the docker inspect command followed by the running container id. + + # docker inspect <$containerID> + + ... + "NetworkSettings": { + "Bridge": "", + "EndpointID": "3e94c5900ac5954354a89591a8740ce2c653efde9232876bc94878e891564b39", + "Gateway": "172.17.42.1", + "GlobalIPv6Address": "", + "GlobalIPv6PrefixLen": 0, + "HairpinMode": false, + "IPAddress": "172.17.0.8", + "IPPrefixLen": 16, + "IPv6Gateway": "", + "LinkLocalIPv6Address": "", + "LinkLocalIPv6PrefixLen": 0, + +### 6. Web Interface ### + +Now, if everything went as expected as done above, we'll gonna see the login screen of JBoss Data Virtualization with oData when pointing our web browser to http://container-ip:8080/ and the JBoss Management from http://container-ip:9990. The Management credentials for username is admin and password is redhat1! whereas the Data virtualization credentials for username is user and password is user . After that, we can navigate the contents via the web interface. + +**Note**: It is strongly recommended to change the password as soon as possible after the first login. Thanks :) + +### Conclusion ### + +Finally we've successfully run Docker Container running JBoss Data Virtualization with OData Multisource Virtual Database. JBoss Data Virtualization is really an awesome platform for the virtualization of data from different multiple source and transform them into reusable business friendly data models and produces data easily consumable through open standard interfaces. The deployment of JBoss Data Virtualization with OData Multisource Virtual Database has been very easy, secure and fast to setup with the Docker Technology. If you have any questions, suggestions, feedback please write them in the comment box below so that we can improve or update our contents. Thank you ! Enjoy :-) + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/linux-how-to/run-jboss-data-virtualization-ga-odata-docker-container/ + +作者:[Arun Pyasi][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://linoxide.com/author/arunp/ +[1]:http://www.redhat.com/en/technologies/jboss-middleware/data-virtualization +[2]:https://github.com/jbossdemocentral/dv-odata-docker-integration-demo +[3]:http://www.jboss.org/products/datavirt/download/ \ No newline at end of file From e5c72db0c2ee4f1b0b0a57d65de1c17ecbdfe2bd Mon Sep 17 00:00:00 2001 From: DongShuaike Date: Thu, 13 Aug 2015 11:29:35 +0800 Subject: [PATCH 910/965] Update 20150813 Linux and Unix Test Disk I O Performance With dd Command.md --- ...inux and Unix Test Disk I O Performance With dd Command.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150813 Linux and Unix Test Disk I O Performance With dd Command.md b/sources/tech/20150813 Linux and Unix Test Disk I O Performance With dd Command.md index c30619d13e..bcd9f8455f 100644 --- a/sources/tech/20150813 Linux and Unix Test Disk I O Performance With dd Command.md +++ b/sources/tech/20150813 Linux and Unix Test Disk I O Performance With dd Command.md @@ -1,3 +1,5 @@ +DongShuaike is translating. + Linux and Unix Test Disk I/O Performance With dd Command ================================================================================ How can I use dd command on a Linux to test I/O performance of my hard disk drive? How do I check the performance of a hard drive including the read and write speed on a Linux operating systems? @@ -159,4 +161,4 @@ via: http://www.cyberciti.biz/faq/howto-linux-unix-test-disk-performance-with-dd 译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID) -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 \ No newline at end of file +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 363e76972134acc20f1b92efe0b5c4bf2f145615 Mon Sep 17 00:00:00 2001 From: wxy Date: Thu, 13 Aug 2015 13:34:50 +0800 Subject: [PATCH 911/965] PUB:20150803 Linux Logging Basics @FSSlc --- .../20150803 Linux Logging Basics.md | 52 +++++++++---------- 1 file changed, 25 insertions(+), 27 deletions(-) rename {translated/tech => published}/20150803 Linux Logging Basics.md (53%) diff --git a/translated/tech/20150803 Linux Logging Basics.md b/published/20150803 Linux Logging Basics.md similarity index 53% rename from translated/tech/20150803 Linux Logging Basics.md rename to published/20150803 Linux Logging Basics.md index 00acdf183e..de8a5d661c 100644 --- a/translated/tech/20150803 Linux Logging Basics.md +++ b/published/20150803 Linux Logging Basics.md @@ -1,6 +1,6 @@ Linux 日志基础 ================================================================================ -首先,我们将描述有关 Linux 日志是什么,到哪儿去找它们以及它们是如何创建的基础知识。如果你已经知道这些,请随意跳至下一节。 +首先,我们将描述有关 Linux 日志是什么,到哪儿去找它们,以及它们是如何创建的基础知识。如果你已经知道这些,请随意跳至下一节。 ### Linux 系统日志 ### @@ -10,71 +10,69 @@ Linux 日志基础 一些最为重要的 Linux 系统日志包括: -- `/var/log/syslog` 或 `/var/log/messages` 存储所有的全局系统活动数据,包括开机信息。基于 Debian 的系统如 Ubuntu 在 `/var/log/syslog` 目录中存储它们,而基于 RedHat 的系统如 RHEL 或 CentOS 则在 `/var/log/messages` 中存储它们。 +- `/var/log/syslog` 或 `/var/log/messages` 存储所有的全局系统活动数据,包括开机信息。基于 Debian 的系统如 Ubuntu 在 `/var/log/syslog` 中存储它们,而基于 RedHat 的系统如 RHEL 或 CentOS 则在 `/var/log/messages` 中存储它们。 - `/var/log/auth.log` 或 `/var/log/secure` 存储来自可插拔认证模块(PAM)的日志,包括成功的登录,失败的登录尝试和认证方式。Ubuntu 和 Debian 在 `/var/log/auth.log` 中存储认证信息,而 RedHat 和 CentOS 则在 `/var/log/secure` 中存储该信息。 -- `/var/log/kern` 存储内核错误和警告数据,这对于排除与自定义内核相关的故障尤为实用。 +- `/var/log/kern` 存储内核的错误和警告数据,这对于排除与定制内核相关的故障尤为实用。 - `/var/log/cron` 存储有关 cron 作业的信息。使用这个数据来确保你的 cron 作业正成功地运行着。 -Digital Ocean 有一个完整的关于这些文件及 rsyslog 如何在常见的发行版本如 RedHat 和 CentOS 中创建它们的 [教程][1] 。 +Digital Ocean 有一个关于这些文件的完整[教程][1],介绍了 rsyslog 如何在常见的发行版本如 RedHat 和 CentOS 中创建它们。 应用程序也会在这个目录中写入日志文件。例如像 Apache,Nginx,MySQL 等常见的服务器程序可以在这个目录中写入日志文件。其中一些日志文件由应用程序自己创建,其他的则通过 syslog (具体见下文)来创建。 ### 什么是 Syslog? ### -Linux 系统日志文件是如何创建的呢?答案是通过 syslog 守护程序,它在 syslog -套接字 `/dev/log` 上监听日志信息,然后将它们写入适当的日志文件中。 +Linux 系统日志文件是如何创建的呢?答案是通过 syslog 守护程序,它在 syslog 套接字 `/dev/log` 上监听日志信息,然后将它们写入适当的日志文件中。 -单词“syslog” 是一个重载的条目,并经常被用来简称如下的几个名称之一: +单词“syslog” 代表几个意思,并经常被用来简称如下的几个名称之一: -1. **Syslog 守护进程** — 一个用来接收,处理和发送 syslog 信息的程序。它可以[远程发送 syslog][2] 到一个集中式的服务器或写入一个本地文件。常见的例子包括 rsyslogd 和 syslog-ng。在这种使用方式中,人们常说 "发送到 syslog." -1. **Syslog 协议** — 一个指定日志如何通过网络来传送的传输协议和一个针对 syslog 信息(具体见下文) 的数据格式的定义。它在 [RFC-5424][3] 中被正式定义。对于文本日志,标准的端口是 514,对于加密日志,端口是 6514。在这种使用方式中,人们常说"通过 syslog 传送." -1. **Syslog 信息** — syslog 格式的日志信息或事件,它包括一个带有几个标准域的文件头。在这种使用方式中,人们常说"发送 syslog." +1. **Syslog 守护进程** — 一个用来接收、处理和发送 syslog 信息的程序。它可以[远程发送 syslog][2] 到一个集中式的服务器或写入到一个本地文件。常见的例子包括 rsyslogd 和 syslog-ng。在这种使用方式中,人们常说“发送到 syslog”。 +1. **Syslog 协议** — 一个指定日志如何通过网络来传送的传输协议和一个针对 syslog 信息(具体见下文) 的数据格式的定义。它在 [RFC-5424][3] 中被正式定义。对于文本日志,标准的端口是 514,对于加密日志,端口是 6514。在这种使用方式中,人们常说“通过 syslog 传送”。 +1. **Syslog 信息** — syslog 格式的日志信息或事件,它包括一个带有几个标准字段的消息头。在这种使用方式中,人们常说“发送 syslog”。 -Syslog 信息或事件包括一个带有几个标准域的 header ,使得分析和路由更方便。它们包括时间戳,应用程序的名称,在系统中信息来源的分类或位置,以及事件的优先级。 +Syslog 信息或事件包括一个带有几个标准字段的消息头,可以使分析和路由更方便。它们包括时间戳、应用程序的名称、在系统中信息来源的分类或位置、以及事件的优先级。 -下面展示的是一个包含 syslog header 的日志信息,它来自于 sshd 守护进程,它控制着到该系统的远程登录,这个信息描述的是一次失败的登录尝试: +下面展示的是一个包含 syslog 消息头的日志信息,它来自于控制着到该系统的远程登录的 sshd 守护进程,这个信息描述的是一次失败的登录尝试: <34>1 2003-10-11T22:14:15.003Z server1.com sshd - - pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=10.0.2.2 -### Syslog 格式和域 ### +### Syslog 格式和字段 ### -每条 syslog 信息包含一个带有域的 header,这些域是结构化的数据,使得分析和路由事件更加容易。下面是我们使用的用来产生上面的 syslog 例子的格式,你可以将每个值匹配到一个特定的域的名称上。 +每条 syslog 信息包含一个带有字段的信息头,这些字段是结构化的数据,使得分析和路由事件更加容易。下面是我们使用的用来产生上面的 syslog 例子的格式,你可以将每个值匹配到一个特定的字段的名称上。 <%pri%>%protocol-version% %timestamp:::date-rfc3339% %HOSTNAME% %app-name% %procid% %msgid% %msg%n -下面,你将看到一些在查找或排错时最常使用的 syslog 域: +下面,你将看到一些在查找或排错时最常使用的 syslog 字段: #### 时间戳 #### [时间戳][4] (上面的例子为 2003-10-11T22:14:15.003Z) 暗示了在系统中发送该信息的时间和日期。这个时间在另一系统上接收该信息时可能会有所不同。上面例子中的时间戳可以分解为: -- **2003-10-11** 年,月,日. -- **T** 为时间戳的必需元素,它将日期和时间分离开. -- **22:14:15.003** 是 24 小时制的时间,包括进入下一秒的毫秒数(**003**). -- **Z** 是一个可选元素,指的是 UTC 时间,除了 Z,这个例子还可以包括一个偏移量,例如 -08:00,这意味着时间从 UTC 偏移 8 小时,即 PST 时间. +- **2003-10-11** 年,月,日。 +- **T** 为时间戳的必需元素,它将日期和时间分隔开。 +- **22:14:15.003** 是 24 小时制的时间,包括进入下一秒的毫秒数(**003**)。 +- **Z** 是一个可选元素,指的是 UTC 时间,除了 Z,这个例子还可以包括一个偏移量,例如 -08:00,这意味着时间从 UTC 偏移 8 小时,即 PST 时间。 #### 主机名 #### -[主机名][5] 域(在上面的例子中对应 server1.com) 指的是主机的名称或发送信息的系统. +[主机名][5] 字段(在上面的例子中对应 server1.com) 指的是主机的名称或发送信息的系统. #### 应用名 #### -[应用名][6] 域(在上面的例子中对应 sshd:auth) 指的是发送信息的程序的名称. +[应用名][6] 字段(在上面的例子中对应 sshd:auth) 指的是发送信息的程序的名称. #### 优先级 #### -优先级域或缩写为 [pri][7] (在上面的例子中对应 <34>) 告诉我们这个事件有多紧急或多严峻。它由两个数字域组成:设备域和紧急性域。紧急性域从代表 debug 类事件的数字 7 一直到代表紧急事件的数字 0 。设备域描述了哪个进程创建了该事件。它从代表内核信息的数字 0 到代表本地应用使用的 23 。 +优先级字段或缩写为 [pri][7] (在上面的例子中对应 <34>) 告诉我们这个事件有多紧急或多严峻。它由两个数字字段组成:设备字段和紧急性字段。紧急性字段从代表 debug 类事件的数字 7 一直到代表紧急事件的数字 0 。设备字段描述了哪个进程创建了该事件。它从代表内核信息的数字 0 到代表本地应用使用的 23 。 + +Pri 有两种输出方式。第一种是以一个单独的数字表示,可以这样计算:先用设备字段的值乘以 8,再加上紧急性字段的值:(设备字段)(8) + (紧急性字段)。第二种是 pri 文本,将以“设备字段.紧急性字段” 的字符串格式输出。后一种格式更方便阅读和搜索,但占据更多的存储空间。 -Pri 有两种输出方式。第一种是以一个单独的数字表示,可以这样计算:先用设备域的值乘以 8,再加上紧急性域的值:(设备域)(8) + (紧急性域)。第二种是 pri 文本,将以“设备域.紧急性域” 的字符串格式输出。后一种格式更方便阅读和搜索,但占据更多的存储空间。 -------------------------------------------------------------------------------- via: http://www.loggly.com/ultimate-guide/logging/linux-logging-basics/ -作者:[Jason Skowronski][a1] -作者:[Amy Echeverri][a2] -作者:[Sadequl Hussain][a3] +作者:[Jason Skowronski][a1],[Amy Echeverri][a2],[Sadequl Hussain][a3] 译者:[FSSlc](https://github.com/FSSlc) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 1e2265405f51c68843b693a2b28d1895b6f8d286 Mon Sep 17 00:00:00 2001 From: Jindong Huang Date: Thu, 13 Aug 2015 14:31:47 +0800 Subject: [PATCH 912/965] =?UTF-8?q?=E3=80=90Translating=20by=20dingdongnig?= =?UTF-8?q?etou=E3=80=9120150813=20Linux=20file=20system=20hierarchy=20v2.?= =?UTF-8?q?0.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sources/tech/20150813 Linux file system hierarchy v2.0.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150813 Linux file system hierarchy v2.0.md b/sources/tech/20150813 Linux file system hierarchy v2.0.md index 9df6d23dcf..0021bb57c9 100644 --- a/sources/tech/20150813 Linux file system hierarchy v2.0.md +++ b/sources/tech/20150813 Linux file system hierarchy v2.0.md @@ -1,3 +1,6 @@ + +Translating by dingdongnigetou + Linux file system hierarchy v2.0 ================================================================================ What is a file in Linux? What is file system in Linux? Where are all the configuration files? Where do I keep my downloaded applications? Is there really a filesystem standard structure in Linux? Well, the above image explains Linux file system hierarchy in a very simple and non-complex way. It’s very useful when you’re looking for a configuration file or a binary file. I’ve added some explanation and examples below, but that’s TL;DR. @@ -435,4 +438,4 @@ via: http://www.blackmoreops.com/2015/06/18/linux-file-system-hierarchy-v2-0/ [1]:http://www.blackmoreops.com/2015/02/15/in-light-of-recent-linux-exploits-linux-security-audit-is-a-must/ [2]:http://www.blackmoreops.com/wp-content/uploads/2015/06/Linux-file-system-hierarchy-v2.0-2480px-blackMORE-Ops.png -[3]:http://www.blackmoreops.com/wp-content/uploads/2015/06/Linux-File-System-Hierarchy-blackMORE-Ops.pdf \ No newline at end of file +[3]:http://www.blackmoreops.com/wp-content/uploads/2015/06/Linux-File-System-Hierarchy-blackMORE-Ops.pdf From 4aec4761431227cc01ac683281d99eef6c87460e Mon Sep 17 00:00:00 2001 From: XIAOYU <1136299502@qq.com> Date: Thu, 13 Aug 2015 19:41:10 +0800 Subject: [PATCH 913/965] translating by xiaoyu33 translating by xiaoyu33 --- ...kr Is An Open-Source RSS News Ticker for Linux Desktops.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/share/20150610 Tickr Is An Open-Source RSS News Ticker for Linux Desktops.md b/sources/share/20150610 Tickr Is An Open-Source RSS News Ticker for Linux Desktops.md index 638482a144..ccbbd3abd8 100644 --- a/sources/share/20150610 Tickr Is An Open-Source RSS News Ticker for Linux Desktops.md +++ b/sources/share/20150610 Tickr Is An Open-Source RSS News Ticker for Linux Desktops.md @@ -1,3 +1,5 @@ +translating by xiaoyu33 + Tickr Is An Open-Source RSS News Ticker for Linux Desktops ================================================================================ ![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/05/rss-tickr.jpg) @@ -92,4 +94,4 @@ via: http://www.omgubuntu.co.uk/2015/06/tickr-open-source-desktop-rss-news-ticke 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 [a]:https://plus.google.com/117485690627814051450/?rel=author -[1]:apt://tickr \ No newline at end of file +[1]:apt://tickr From efdfdebe94f2ae4e42040c614e7ad05491451d17 Mon Sep 17 00:00:00 2001 From: Kevin Sicong Jiang Date: Thu, 13 Aug 2015 11:45:11 -0500 Subject: [PATCH 914/965] Update 20150813 How to get Public IP from Linux Terminal.md --- .../tech/20150813 How to get Public IP from Linux Terminal.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150813 How to get Public IP from Linux Terminal.md b/sources/tech/20150813 How to get Public IP from Linux Terminal.md index f0bba2cea9..c22fec283d 100644 --- a/sources/tech/20150813 How to get Public IP from Linux Terminal.md +++ b/sources/tech/20150813 How to get Public IP from Linux Terminal.md @@ -1,3 +1,4 @@ +KevinSJ Translating How to get Public IP from Linux Terminal? ================================================================================ ![](http://www.blackmoreops.com/wp-content/uploads/2015/06/256x256xHow-to-get-Public-IP-from-Linux-Terminal-blackMORE-Ops.png.pagespeed.ic.GKEAEd4UNr.png) @@ -65,4 +66,4 @@ via: http://www.blackmoreops.com/2015/06/14/how-to-get-public-ip-from-linux-term 译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID) -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 \ No newline at end of file +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From f166b13f668e522a49246db26e8a746a6fae67d4 Mon Sep 17 00:00:00 2001 From: struggling <630441839@qq.com> Date: Fri, 14 Aug 2015 01:27:35 +0800 Subject: [PATCH 915/965] Delete 20150717 How to monitor NGINX with Datadog - Part 3.md --- ... to monitor NGINX with Datadog - Part 3.md | 151 ------------------ 1 file changed, 151 deletions(-) delete mode 100644 sources/tech/20150717 How to monitor NGINX with Datadog - Part 3.md diff --git a/sources/tech/20150717 How to monitor NGINX with Datadog - Part 3.md b/sources/tech/20150717 How to monitor NGINX with Datadog - Part 3.md deleted file mode 100644 index 727c552ed0..0000000000 --- a/sources/tech/20150717 How to monitor NGINX with Datadog - Part 3.md +++ /dev/null @@ -1,151 +0,0 @@ -translation by strugglingyouth -How to monitor NGINX with Datadog - Part 3 -================================================================================ -![](http://www.datadoghq.com/wp-content/uploads/2015/07/NGINX_hero_3.png) - -If you’ve already read [our post on monitoring NGINX][1], you know how much information you can gain about your web environment from just a handful of metrics. And you’ve also seen just how easy it is to start collecting metrics from NGINX on ad hoc basis. But to implement comprehensive, ongoing NGINX monitoring, you will need a robust monitoring system to store and visualize your metrics, and to alert you when anomalies happen. In this post, we’ll show you how to set up NGINX monitoring in Datadog so that you can view your metrics on customizable dashboards like this: - -![NGINX dashboard](https://d33tyra1llx9zy.cloudfront.net/blog/images/2015-06-nginx/nginx_board_5.png) - -Datadog allows you to build graphs and alerts around individual hosts, services, processes, metrics—or virtually any combination thereof. For instance, you can monitor all of your NGINX hosts, or all hosts in a certain availability zone, or you can monitor a single key metric being reported by all hosts with a certain tag. This post will show you how to: - -- Monitor NGINX metrics on Datadog dashboards, alongside all your other systems -- Set up automated alerts to notify you when a key metric changes dramatically - -### Configuring NGINX ### - -To collect metrics from NGINX, you first need to ensure that NGINX has an enabled status module and a URL for reporting its status metrics. Step-by-step instructions [for configuring open-source NGINX][2] and [NGINX Plus][3] are available in our companion post on metric collection. - -### Integrating Datadog and NGINX ### - -#### Install the Datadog Agent #### - -The Datadog Agent is [the open-source software][4] that collects and reports metrics from your hosts so that you can view and monitor them in Datadog. Installing the agent usually takes [just a single command][5]. - -As soon as your Agent is up and running, you should see your host reporting metrics [in your Datadog account][6]. - -![Datadog infrastructure list](https://d33tyra1llx9zy.cloudfront.net/blog/images/2015-06-nginx/infra_2.png) - -#### Configure the Agent #### - -Next you’ll need to create a simple NGINX configuration file for the Agent. The location of the Agent’s configuration directory for your OS can be found [here][7]. - -Inside that directory, at conf.d/nginx.yaml.example, you will find [a sample NGINX config file][8] that you can edit to provide the status URL and optional tags for each of your NGINX instances: - - init_config: - - instances: - - - nginx_status_url: http://localhost/nginx_status/ - tags: - - instance:foo - -Once you have supplied the status URLs and any tags, save the config file as conf.d/nginx.yaml. - -#### Restart the Agent #### - -You must restart the Agent to load your new configuration file. The restart command varies somewhat by platform—see the specific commands for your platform [here][9]. - -#### Verify the configuration settings #### - -To check that Datadog and NGINX are properly integrated, run the Datadog info command. The command for each platform is available [here][10]. - -If the configuration is correct, you will see a section like this in the output: - - Checks - ====== - - [...] - - nginx - ----- - - instance #0 [OK] - - Collected 8 metrics & 0 events - -#### Install the integration #### - -Finally, switch on the NGINX integration inside your Datadog account. It’s as simple as clicking the “Install Integration” button under the Configuration tab in the [NGINX integration settings][11]. - -![Install integration](https://d33tyra1llx9zy.cloudfront.net/blog/images/2015-06-nginx/install.png) - -### Metrics! ### - -Once the Agent begins reporting NGINX metrics, you will see [an NGINX dashboard][12] among your list of available dashboards in Datadog. - -The basic NGINX dashboard displays a handful of graphs encapsulating most of the key metrics highlighted [in our introduction to NGINX monitoring][13]. (Some metrics, notably request processing time, require log analysis and are not available in Datadog.) - -You can easily create a comprehensive dashboard for monitoring your entire web stack by adding additional graphs with important metrics from outside NGINX. For example, you might want to monitor host-level metrics on your NGINX hosts, such as system load. To start building a custom dashboard, simply clone the default NGINX dashboard by clicking on the gear near the upper right of the dashboard and selecting “Clone Dash”. - -![Clone dash](https://d33tyra1llx9zy.cloudfront.net/blog/images/2015-06-nginx/clone_2.png) - -You can also monitor your NGINX instances at a higher level using Datadog’s [Host Maps][14]—for instance, color-coding all your NGINX hosts by CPU usage to identify potential hotspots. - -![](https://d33tyra1llx9zy.cloudfront.net/blog/images/2015-06-nginx/nginx-host-map-3.png) - -### Alerting on NGINX metrics ### - -Once Datadog is capturing and visualizing your metrics, you will likely want to set up some monitors to automatically keep tabs on your metrics—and to alert you when there are problems. Below we’ll walk through a representative example: a metric monitor that alerts on sudden drops in NGINX throughput. - -#### Monitor your NGINX throughput #### - -Datadog metric alerts can be threshold-based (alert when the metric exceeds a set value) or change-based (alert when the metric changes by a certain amount). In this case we’ll take the latter approach, alerting when our incoming requests per second drop precipitously. Such drops are often indicative of problems. - -1.**Create a new metric monitor**. Select “New Monitor” from the “Monitors” dropdown in Datadog. Select “Metric” as the monitor type. - -![NGINX metric monitor](https://d33tyra1llx9zy.cloudfront.net/blog/images/2015-06-nginx/monitor2_step_1.png) - -2.**Define your metric monitor**. We want to know when our total NGINX requests per second drop by a certain amount. So we define the metric of interest to be the sum of nginx.net.request_per_s across our infrastructure. - -![NGINX metric](https://d33tyra1llx9zy.cloudfront.net/blog/images/2015-06-nginx/monitor2_step_2.png) - -3.**Set metric alert conditions**. Since we want to alert on a change, rather than on a fixed threshold, we select “Change Alert.” We’ll set the monitor to alert us whenever the request volume drops by 30 percent or more. Here we use a one-minute window of data to represent the metric’s value “now” and alert on the average change across that interval, as compared to the metric’s value 10 minutes prior. - -![NGINX metric change alert](https://d33tyra1llx9zy.cloudfront.net/blog/images/2015-06-nginx/monitor2_step_3.png) - -4.**Customize the notification**. If our NGINX request volume drops, we want to notify our team. In this case we will post a notification in the ops team’s chat room and page the engineer on call. In “Say what’s happening”, we name the monitor and add a short message that will accompany the notification to suggest a first step for investigation. We @mention the Slack channel that we use for ops and use @pagerduty to [route the alert to PagerDuty][15] - -![NGINX metric notification](https://d33tyra1llx9zy.cloudfront.net/blog/images/2015-06-nginx/monitor2_step_4v3.png) - -5.**Save the integration monitor**. Click the “Save” button at the bottom of the page. You’re now monitoring a key NGINX [work metric][16], and your on-call engineer will be paged anytime it drops rapidly. - -### Conclusion ### - -In this post we’ve walked you through integrating NGINX with Datadog to visualize your key metrics and notify your team when your web infrastructure shows signs of trouble. - -If you’ve followed along using your own Datadog account, you should now have greatly improved visibility into what’s happening in your web environment, as well as the ability to create automated monitors tailored to your environment, your usage patterns, and the metrics that are most valuable to your organization. - -If you don’t yet have a Datadog account, you can sign up for [a free trial][17] and start monitoring your infrastructure, your applications, and your services today. - ----------- - -Source Markdown for this post is available [on GitHub][18]. Questions, corrections, additions, etc.? Please [let us know][19]. - ------------------------------------------------------------- - -via: https://www.datadoghq.com/blog/how-to-monitor-nginx-with-datadog/ - -作者:K Young -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[1]:https://www.datadoghq.com/blog/how-to-monitor-nginx/ -[2]:https://www.datadoghq.com/blog/how-to-collect-nginx-metrics/#open-source -[3]:https://www.datadoghq.com/blog/how-to-collect-nginx-metrics/#plus -[4]:https://github.com/DataDog/dd-agent -[5]:https://app.datadoghq.com/account/settings#agent -[6]:https://app.datadoghq.com/infrastructure -[7]:http://docs.datadoghq.com/guides/basic_agent_usage/ -[8]:https://github.com/DataDog/dd-agent/blob/master/conf.d/nginx.yaml.example -[9]:http://docs.datadoghq.com/guides/basic_agent_usage/ -[10]:http://docs.datadoghq.com/guides/basic_agent_usage/ -[11]:https://app.datadoghq.com/account/settings#integrations/nginx -[12]:https://app.datadoghq.com/dash/integration/nginx -[13]:https://www.datadoghq.com/blog/how-to-monitor-nginx/ -[14]:https://www.datadoghq.com/blog/introducing-host-maps-know-thy-infrastructure/ -[15]:https://www.datadoghq.com/blog/pagerduty/ -[16]:https://www.datadoghq.com/blog/monitoring-101-collecting-data/#metrics -[17]:https://www.datadoghq.com/blog/how-to-monitor-nginx-with-datadog/#sign-up -[18]:https://github.com/DataDog/the-monitor/blob/master/nginx/how_to_monitor_nginx_with_datadog.md -[19]:https://github.com/DataDog/the-monitor/issues From dda288ff51ce354aed0d3015ec76b2525e678124 Mon Sep 17 00:00:00 2001 From: struggling <630441839@qq.com> Date: Fri, 14 Aug 2015 01:28:35 +0800 Subject: [PATCH 916/965] Create 20150717 How to monitor NGINX with Datadog - Part 3.md --- ... to monitor NGINX with Datadog - Part 3.md | 154 ++++++++++++++++++ 1 file changed, 154 insertions(+) create mode 100644 translated/tech/20150717 How to monitor NGINX with Datadog - Part 3.md diff --git a/translated/tech/20150717 How to monitor NGINX with Datadog - Part 3.md b/translated/tech/20150717 How to monitor NGINX with Datadog - Part 3.md new file mode 100644 index 0000000000..003290a915 --- /dev/null +++ b/translated/tech/20150717 How to monitor NGINX with Datadog - Part 3.md @@ -0,0 +1,154 @@ + +如何使用 Datadog 监控 NGINX - 第3部分 +================================================================================ +![](http://www.datadoghq.com/wp-content/uploads/2015/07/NGINX_hero_3.png) + +如果你已经阅读了[前面的如何监控 NGINX][1],你应该知道从你网络环境的几个指标中可以获取多少信息。而且你也看到了从 NGINX 特定的基础中收集指标是多么容易的。但要实现全面,持续的监控 NGINX,你需要一个强大的监控系统来存储并将指标可视化,当异常发生时能提醒你。在这篇文章中,我们将向你展示如何使用 Datadog 安装 NGINX 监控,以便你可以在定制的仪表盘中查看这些指标: + +![NGINX dashboard](https://d33tyra1llx9zy.cloudfront.net/blog/images/2015-06-nginx/nginx_board_5.png) + +Datadog 允许你建立单个主机,服务,流程,度量,或者几乎任何它们的组合图形周围和警报。例如,你可以在一定的可用性区域监控所有NGINX主机,或所有主机,或者您可以监视被报道具有一定标签的所有主机的一个关键指标。本文将告诉您如何: + +Datadog 允许你来建立图表并报告周围的主机,进程,指标或其他的。例如,你可以在特定的可用性区域监控所有 NGINX 主机,或所有主机,或者你可以监视一个关键指标并将它报告给周围所有标记的主机。本文将告诉你如何做: + +- 在 Datadog 仪表盘上监控 NGINX 指标,对其他所有系统 +- 当一个关键指标急剧变化时设置自动警报来通知你 + +### 配置 NGINX ### + +为了收集 NGINX 指标,首先需要确保 NGINX 已启用 status 模块和一个URL 来报告 status 指标。下面将一步一步展示[配置开源 NGINX ][2]和[NGINX Plus][3]。 + +### 整合 Datadog 和 NGINX ### + +#### 安装 Datadog 代理 #### + +Datadog 代理是 [一个开源软件][4] 能收集和报告你主机的指标,这样就可以使用 Datadog 查看和监控他们。安装代理通常 [仅需要一个命令][5] + +只要你的代理启动并运行着,你会看到你主机的指标报告[在你 Datadog 账号下][6]。 + +![Datadog infrastructure list](https://d33tyra1llx9zy.cloudfront.net/blog/images/2015-06-nginx/infra_2.png) + +#### 配置 Agent #### + + +接下来,你需要为代理创建一个简单的 NGINX 配置文件。在你系统中代理的配置目录应该 [在这儿][7]。 + +在目录里面的 conf.d/nginx.yaml.example 中,你会发现[一个简单的配置文件][8],你可以编辑并提供 status URL 和可选的标签为每个NGINX 实例: + + init_config: + + instances: + + - nginx_status_url: http://localhost/nginx_status/ + tags: + - instance:foo + +一旦你修改了 status URLs 和其他标签,将配置文件保存为 conf.d/nginx.yaml。 + +#### 重启代理 #### + + +你必须重新启动代理程序来加载新的配置文件。重新启动命令 [在这里][9] 根据平台的不同而不同。 + +#### 检查配置文件 #### + +要检查 Datadog 和 NGINX 是否正确整合,运行 Datadog 的信息命令。每个平台使用的命令[看这儿][10]。 + +如果配置是正确的,你会看到这样的输出: + + Checks + ====== + + [...] + + nginx + ----- + - instance #0 [OK] + - Collected 8 metrics & 0 events + +#### 安装整合 #### + +最后,在你的 Datadog 帐户里面整合 Nginx。这非常简单,你只要点击“Install Integration”按钮在 [NGINX 集成设置][11] 配置表中。 + +![Install integration](https://d33tyra1llx9zy.cloudfront.net/blog/images/2015-06-nginx/install.png) + +### 指标! ### + +一旦代理开始报告 NGINX 指标,你会看到 [一个 NGINX 仪表盘][12] 在你 Datadog 可用仪表盘的列表中。 + +基本的 NGINX 仪表盘显示了几个关键指标 [在我们介绍的 NGINX 监控中][13] 的最大值。 (一些指标,特别是请求处理时间,日志分析,Datadog 不提供。) + +你可以轻松创建一个全面的仪表盘来监控你的整个网站区域通过增加额外的图形与 NGINX 外部的重要指标。例如,你可能想监视你 NGINX 主机的host-level 指标,如系统负载。你需要构建一个自定义的仪表盘,只需点击靠近仪表盘的右上角的选项并选择“Clone Dash”来克隆一个默认的 NGINX 仪表盘。 + +![Clone dash](https://d33tyra1llx9zy.cloudfront.net/blog/images/2015-06-nginx/clone_2.png) + +你也可以更高级别的监控你的 NGINX 实例通过使用 Datadog 的 [Host Maps][14] -对于实例,color-coding 你所有的 NGINX 主机通过 CPU 使用率来辨别潜在热点。 + +![](https://d33tyra1llx9zy.cloudfront.net/blog/images/2015-06-nginx/nginx-host-map-3.png) + +### NGINX 指标 ### + +一旦 Datadog 捕获并可视化你的指标,你可能会希望建立一些监控自动密切的关注你的指标,并当有问题提醒你。下面将介绍一个典型的例子:一个提醒你 NGINX 吞吐量突然下降时的指标监控器。 + +#### 监控 NGINX 吞吐量 #### + +Datadog 指标警报可以是 threshold-based(当指标超过设定值会警报)或 change-based(当指标的变化超过一定范围会警报)。在这种情况下,我们会采取后一种方式,当每秒传入的请求急剧下降时会提醒我们。下降往往意味着有问题。 + +1.**创建一个新的指标监控**. 从 Datadog 的“Monitors”下拉列表中选择“New Monitor”。选择“Metric”作为监视器类型。 + +![NGINX metric monitor](https://d33tyra1llx9zy.cloudfront.net/blog/images/2015-06-nginx/monitor2_step_1.png) + +2.**定义你的指标监视器**. 我们想知道 NGINX 每秒总的请求量下降的数量。所以我们在基础设施中定义我们感兴趣的 nginx.net.request_per_s度量和。 + +![NGINX metric](https://d33tyra1llx9zy.cloudfront.net/blog/images/2015-06-nginx/monitor2_step_2.png) + +3.**设置指标警报条件**.我们想要在变化时警报,而不是一个固定的值,所以我们选择“Change Alert”。我们设置监控为无论何时请求量下降了30%以上时警报。在这里,我们使用一个 one-minute 数据窗口来表示“now” 指标的值,警报横跨该间隔内的平均变化,和之前 10 分钟的指标值作比较。 + +![NGINX metric change alert](https://d33tyra1llx9zy.cloudfront.net/blog/images/2015-06-nginx/monitor2_step_3.png) + +4.**自定义通知**.如果 NGINX 的请求量下降,我们想要通知我们的团队。在这种情况下,我们将给 ops 队的聊天室发送通知,网页呼叫工程师。在“Say what’s happening”中,我们将其命名为监控器并添加一个短消息将伴随该通知并建议首先开始调查。我们使用 @mention 作为一般警告,使用 ops 并用 @pagerduty [专门给 PagerDuty 发警告][15]。 + +![NGINX metric notification](https://d33tyra1llx9zy.cloudfront.net/blog/images/2015-06-nginx/monitor2_step_4v3.png) + +5.**保存集成监控**.点击页面底部的“Save”按钮。你现在监控的关键指标NGINX [work 指标][16],它边打电话给工程师并在它迅速下时随时分页。 + +### 结论 ### + +在这篇文章中,我们已经通过整合 NGINX 与 Datadog 来可视化你的关键指标,并当你的网络基础架构有问题时会通知你的团队。 + +如果你一直使用你自己的 Datadog 账号,你现在应该在 web 环境中有了很大的可视化提高,也有能力根据你的环境创建自动监控,你所使用的模式,指标应该是最有价值的对你的组织。 + +如果你还没有 Datadog 帐户,你可以注册[免费试用][17],并开始监视你的基础架构,应用程序和现在的服务。 + +---------- +这篇文章的来源在 [on GitHub][18]. 问题,错误,补充等?请[联系我们][19]. + +------------------------------------------------------------ + +via: https://www.datadoghq.com/blog/how-to-monitor-nginx-with-datadog/ + +作者:K Young +译者:[strugglingyouth](https://github.com/译者ID) +校对:[strugglingyouth](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[1]:https://www.datadoghq.com/blog/how-to-monitor-nginx/ +[2]:https://www.datadoghq.com/blog/how-to-collect-nginx-metrics/#open-source +[3]:https://www.datadoghq.com/blog/how-to-collect-nginx-metrics/#plus +[4]:https://github.com/DataDog/dd-agent +[5]:https://app.datadoghq.com/account/settings#agent +[6]:https://app.datadoghq.com/infrastructure +[7]:http://docs.datadoghq.com/guides/basic_agent_usage/ +[8]:https://github.com/DataDog/dd-agent/blob/master/conf.d/nginx.yaml.example +[9]:http://docs.datadoghq.com/guides/basic_agent_usage/ +[10]:http://docs.datadoghq.com/guides/basic_agent_usage/ +[11]:https://app.datadoghq.com/account/settings#integrations/nginx +[12]:https://app.datadoghq.com/dash/integration/nginx +[13]:https://www.datadoghq.com/blog/how-to-monitor-nginx/ +[14]:https://www.datadoghq.com/blog/introducing-host-maps-know-thy-infrastructure/ +[15]:https://www.datadoghq.com/blog/pagerduty/ +[16]:https://www.datadoghq.com/blog/monitoring-101-collecting-data/#metrics +[17]:https://www.datadoghq.com/blog/how-to-monitor-nginx-with-datadog/#sign-up +[18]:https://github.com/DataDog/the-monitor/blob/master/nginx/how_to_monitor_nginx_with_datadog.md +[19]:https://github.com/DataDog/the-monitor/issues From 0ab376d789381a52cc6928c859782fa63a99faa4 Mon Sep 17 00:00:00 2001 From: joeren Date: Fri, 14 Aug 2015 08:48:38 +0800 Subject: [PATCH 917/965] Update 20150813 Ubuntu Want To Make It Easier For You To Install The Latest Nvidia Linux Driver.md --- ...Easier For You To Install The Latest Nvidia Linux Driver.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150813 Ubuntu Want To Make It Easier For You To Install The Latest Nvidia Linux Driver.md b/sources/tech/20150813 Ubuntu Want To Make It Easier For You To Install The Latest Nvidia Linux Driver.md index 2bae0061c4..2dfc45cc4f 100644 --- a/sources/tech/20150813 Ubuntu Want To Make It Easier For You To Install The Latest Nvidia Linux Driver.md +++ b/sources/tech/20150813 Ubuntu Want To Make It Easier For You To Install The Latest Nvidia Linux Driver.md @@ -1,3 +1,4 @@ +Translating by GOLinux! Ubuntu Want To Make It Easier For You To Install The Latest Nvidia Linux Driver ================================================================================ ![Ubuntu Gamers are on the rise -and so is demand for the latest drivers](http://www.omgubuntu.co.uk/wp-content/uploads/2014/03/ubuntugamer_logo_dark-500x250.jpg) @@ -60,4 +61,4 @@ via: http://www.omgubuntu.co.uk/2015/08/ubuntu-easy-install-latest-nvidia-linux- 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 -[a]:https://plus.google.com/117485690627814051450/?rel=author \ No newline at end of file +[a]:https://plus.google.com/117485690627814051450/?rel=author From 8595d6c8e51f7c3de6417721c1d05e0936617749 Mon Sep 17 00:00:00 2001 From: GOLinux Date: Fri, 14 Aug 2015 11:01:01 +0800 Subject: [PATCH 918/965] [Translated]20150813 Ubuntu Want To Make It Easier For You To Install The Latest Nvidia Linux Driver.md --- ... Install The Latest Nvidia Linux Driver.md | 64 ------------------- ... Install The Latest Nvidia Linux Driver.md | 63 ++++++++++++++++++ 2 files changed, 63 insertions(+), 64 deletions(-) delete mode 100644 sources/tech/20150813 Ubuntu Want To Make It Easier For You To Install The Latest Nvidia Linux Driver.md create mode 100644 translated/tech/20150813 Ubuntu Want To Make It Easier For You To Install The Latest Nvidia Linux Driver.md diff --git a/sources/tech/20150813 Ubuntu Want To Make It Easier For You To Install The Latest Nvidia Linux Driver.md b/sources/tech/20150813 Ubuntu Want To Make It Easier For You To Install The Latest Nvidia Linux Driver.md deleted file mode 100644 index 2dfc45cc4f..0000000000 --- a/sources/tech/20150813 Ubuntu Want To Make It Easier For You To Install The Latest Nvidia Linux Driver.md +++ /dev/null @@ -1,64 +0,0 @@ -Translating by GOLinux! -Ubuntu Want To Make It Easier For You To Install The Latest Nvidia Linux Driver -================================================================================ -![Ubuntu Gamers are on the rise -and so is demand for the latest drivers](http://www.omgubuntu.co.uk/wp-content/uploads/2014/03/ubuntugamer_logo_dark-500x250.jpg) -Ubuntu Gamers are on the rise -and so is demand for the latest drivers - -**Installing the latest upstream NVIDIA graphics driver on Ubuntu could be about to get much easier. ** - -Ubuntu developers are considering the creation of a brand new ‘official’ PPA to distribute the latest closed-source NVIDIA binary drivers to desktop users. - -The move would benefit Ubuntu gamers **without** risking the stability of the OS for everyone else. - -New upstream drivers would be installed and updated from this new PPA **only** when a user explicitly opts-in to it. Everyone else would continue to receive and use the more recent stable NVIDIA Linux driver snapshot included in the Ubuntu archive. - -### Why Is This Needed? ### - -![Ubuntu provides drivers – but they’re not the latest](http://www.omgubuntu.co.uk/wp-content/uploads/2013/04/drivers.jpg) -Ubuntu provides drivers – but they’re not the latest - -The closed-source NVIDIA graphics drivers that are available to install on Ubuntu from the archive (using the command line, synaptic or through the additional drivers tool) work fine for most and can handle the composited Unity desktop shell with ease. - -For gaming needs it’s a different story. - -If you want to squeeze every last frame and HD texture out of the latest big-name Steam game you’ll need the latest binary drivers blob. - -> ‘Installing the very latest Nvidia Linux driver on Ubuntu is not easy and not always safe.’ - -The more recent the driver the more likely it is to support the latest features and technologies, or come pre-packed with game-specific tweaks and bug fixes too. - -The problem is that installing the very latest Nvidia Linux driver on Ubuntu is not easy and not always safe. - -To fill the void many third-party PPAs maintained by enthusiasts have emerged. Since many of these PPAs also distribute other experimental or bleeding-edge software their use is **not without risk**. Adding a bleeding edge PPA is often the fastest way to entirely hose a system! - -A solution that lets Ubuntu users install the latest propriety graphics drivers as offered in third-party PPAs is needed **but** with the safety catch of being able to roll-back to the stable archive version if needed. - -### ‘Demand for fresh drivers is hard to ignore’ ### - -> ‘A solution that lets Ubuntu users get the latest hardware drivers safely is coming.’ - -‘The demand for fresh drivers in a fast developing market is becoming hard to ignore, users are going to want the latest upstream has to offer,’ Castro explains in an e-mail to the Ubuntu Desktop mailing list. - -‘[NVIDIA] can deliver a kickass experience with almost no effort from the user [in Windows 10]. Until we can convince NVIDIA to do the same with Ubuntu we’re going to have to pick up the slack.’ - -Castro’s proposition of a “blessed” NVIDIA PPA is the easiest way to do this. - -Gamers would be able to opt-in to receive new drivers from the PPA straight from Ubuntu’s default proprietary hardware drivers tool — no need for them to copy and paste terminal commands from websites or wiki pages. - -The drivers within this PPA would be packaged and maintained by a select band of community members and receive benefits from being a semi-official option, namely **automated testing**. - -As Castro himself puts it: ‘People want the latest bling, and no matter what they’re going to do it. We might as well put a framework around it so people can get what they want without breaking their computer.’ - -**Would you make use of this PPA? How would you rate the performance of the default Nvidia drivers on Ubuntu? Share your thoughts in the comments, folks! ** - --------------------------------------------------------------------------------- - -via: http://www.omgubuntu.co.uk/2015/08/ubuntu-easy-install-latest-nvidia-linux-drivers - -作者:[Joey-Elijah Sneddon][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://plus.google.com/117485690627814051450/?rel=author diff --git a/translated/tech/20150813 Ubuntu Want To Make It Easier For You To Install The Latest Nvidia Linux Driver.md b/translated/tech/20150813 Ubuntu Want To Make It Easier For You To Install The Latest Nvidia Linux Driver.md new file mode 100644 index 0000000000..bf24d3e5c2 --- /dev/null +++ b/translated/tech/20150813 Ubuntu Want To Make It Easier For You To Install The Latest Nvidia Linux Driver.md @@ -0,0 +1,63 @@ +Ubuntu想要让你安装最新版Nvidia Linux驱动更简单 +================================================================================ +![Ubuntu Gamers are on the rise -and so is demand for the latest drivers](http://www.omgubuntu.co.uk/wp-content/uploads/2014/03/ubuntugamer_logo_dark-500x250.jpg) +Ubuntu游戏在增长——因而需要最新版驱动 + +**Ubuntu上安装上游NVIDIA图形驱动即将变得更加容易。** + +Ubuntu开发者正在考虑构建一个全新的'官方'PPA,以便为桌面用户分发最新的闭源NVIDIA二进制驱动。 + +该项运动将使得Ubuntu游戏玩家收益,并且**不会**给其它人造成OS稳定性方面的风险。 + +新的上游驱动将通过该新PPA安装并更新,**只有**在用户明确选择它。其他人将继续接收并使用更近的包含在Ubuntu归档中的稳定版NVIDIA Linux驱动快照。 + +### 为什么需要该项目? ### + +![Ubuntu provides drivers – but they’re not the latest](http://www.omgubuntu.co.uk/wp-content/uploads/2013/04/drivers.jpg) +Ubuntu提供了驱动——但是它们不是最新的 + +可以从归档中(使用命令行、synaptic,或者通过额外驱动工具)安装到Ubuntu上的闭源NVIDIA图形驱动在大多数情况下都能工作得很好,并且可以轻松地处理混合Unity桌面shell。 + +对于游戏需求而言,那完全是另外一码事儿。 + +如果你想要将所有最后帧和HD纹理从最新的大游戏Steam游戏中挤压出来,你需要最新的二进制驱动对象。 + +> '安装最新Nvidia Linux驱动到Ubuntu不是件容易的事儿,而且也不具安全保证。' + +驱动越新,越可能支持最新的特性和技术,或者预先打包好了游戏专门优化和漏洞修复。 + +问题在于安装最新的Nvidia Linux驱动到Ubuntu上不是件容易的事儿,也没有安全保证。 + +要填补空白,许多由热心人维护的第三方PPA就出现了。由于许多这些PPA也发布了其它实验性的或者前沿软件,它们的使用**没有风险**。添加一个前沿的PPA通常是最快的方式,以完全满足系统需要! + +一个让Ubuntu用户安装作为第三方PPA提供最新专有图形驱动解决方案就十分需要了,**但是**提供了一个安全机制,如果有需要,你可以回滚到稳定版本。 + +### ‘对全新驱动的需求难以忽视’ ### + +> '一个让Ubuntu用户安全地获得最新硬件驱动的解决方案出现了。' + +'在快速开发市场中,对全新驱动的需求正变得难以忽视,用户将想要最新的上游软件,'卡斯特罗在一封给Ubuntu桌面邮件列表的电子邮件中解释道。 + +'[NVIDIA]可以分发一个了不起的体验,几乎像[Windows 10]用户那样毫不费力。直到我们可以证实NVIDIA在Ubuntu中做了同样的工作,我们就可以收拾残局了。' + +卡斯特罗关于一个“神圣的”NVIDIA PPA命题就是最实现这一目的的最容易的方式。 + +游戏玩家将可以在Ubuntu的默认专有软件驱动工具中选择接收来自该PPA的新驱动——不需要它们从网站或维基页面拷贝并粘贴终端命令了。 + +该PPA内的驱动将由一个选定的社区成员组成的团队打包并维护,并从一个名为**自动化测试**的半官方选项受惠。 + +就像卡斯特罗自己说的那样:'人们想要最新的闪光的东西,不管他们想要做什么。我们也许也要在其周围放置一个框架,因此人们可以获得他们所想要的,而不必破坏他们的计算机。' + +**你想要使用这个PPA吗?你怎样来评估Ubuntu上默认Nvidia驱动的性能呢?在评论中分享你的想法吧,伙计们!** + +-------------------------------------------------------------------------------- + +via: http://www.omgubuntu.co.uk/2015/08/ubuntu-easy-install-latest-nvidia-linux-drivers + +作者:[Joey-Elijah Sneddon][a] +译者:[GOLinux](https://github.com/GOLinux) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://plus.google.com/117485690627814051450/?rel=author From 3b7a14d182ecdfb4a1b30861b572d5c2d4566ae9 Mon Sep 17 00:00:00 2001 From: wi-cuckoo Date: Fri, 14 Aug 2015 15:19:33 +0800 Subject: [PATCH 919/965] translating wi-cuckoo --- ...ss Data Virtualization GA with OData in Docker Container.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150813 Howto Run JBoss Data Virtualization GA with OData in Docker Container.md b/sources/tech/20150813 Howto Run JBoss Data Virtualization GA with OData in Docker Container.md index 0893b9a361..f1505c5649 100644 --- a/sources/tech/20150813 Howto Run JBoss Data Virtualization GA with OData in Docker Container.md +++ b/sources/tech/20150813 Howto Run JBoss Data Virtualization GA with OData in Docker Container.md @@ -1,3 +1,4 @@ +translating wi-cuckoo Howto Run JBoss Data Virtualization GA with OData in Docker Container ================================================================================ Hi everyone, today we'll learn how to run JBoss Data Virtualization 6.0.0.GA with OData in a Docker Container. JBoss Data Virtualization is a data supply and integration solution platform that transforms various scatered multiple sources data, treats them as single source and delivers the required data into actionable information at business speed to any applications or users. JBoss Data Virtualization can help us easily combine and transform data into reusable business friendly data models and make unified data easily consumable through open standard interfaces. It offers comprehensive data abstraction, federation, integration, transformation, and delivery capabilities to combine data from one or multiple sources into reusable for agile data utilization and sharing.For more information about JBoss Data Virtualization, we can check out [its official page][1]. Docker is an open source platform that provides an open platform to pack, ship and run any application as a lightweight container. Running JBoss Data Virtualization with OData in Docker Container makes us easy to handle and launch. @@ -99,4 +100,4 @@ via: http://linoxide.com/linux-how-to/run-jboss-data-virtualization-ga-odata-doc [a]:http://linoxide.com/author/arunp/ [1]:http://www.redhat.com/en/technologies/jboss-middleware/data-virtualization [2]:https://github.com/jbossdemocentral/dv-odata-docker-integration-demo -[3]:http://www.jboss.org/products/datavirt/download/ \ No newline at end of file +[3]:http://www.jboss.org/products/datavirt/download/ From 74c949d60bc82fe61d3115007b3335bc6b4e6ed2 Mon Sep 17 00:00:00 2001 From: VicYu Date: Fri, 14 Aug 2015 18:03:52 +0800 Subject: [PATCH 920/965] Update 20150812 Linux Tricks--Play Game in Chrome Text-to-Speech Schedule a Job and Watch Commands in Linux.md --- ...xt-to-Speech Schedule a Job and Watch Commands in Linux.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150812 Linux Tricks--Play Game in Chrome Text-to-Speech Schedule a Job and Watch Commands in Linux.md b/sources/tech/20150812 Linux Tricks--Play Game in Chrome Text-to-Speech Schedule a Job and Watch Commands in Linux.md index 1ad92c594b..28981add17 100644 --- a/sources/tech/20150812 Linux Tricks--Play Game in Chrome Text-to-Speech Schedule a Job and Watch Commands in Linux.md +++ b/sources/tech/20150812 Linux Tricks--Play Game in Chrome Text-to-Speech Schedule a Job and Watch Commands in Linux.md @@ -1,3 +1,5 @@ + Vic020 + Linux Tricks: Play Game in Chrome, Text-to-Speech, Schedule a Job and Watch Commands in Linux ================================================================================ Here again, I have compiled a list of four things under [Linux Tips and Tricks][1] series you may do to remain more productive and entertained with Linux Environment. @@ -140,4 +142,4 @@ via: http://www.tecmint.com/text-to-speech-in-terminal-schedule-a-job-and-watch- [a]:http://www.tecmint.com/author/avishek/ [1]:http://www.tecmint.com/tag/linux-tricks/ -[2]:http://www.tecmint.com/11-cron-scheduling-task-examples-in-linux/ \ No newline at end of file +[2]:http://www.tecmint.com/11-cron-scheduling-task-examples-in-linux/ From dd71c92d85e2bb24c957e6d2179ed005b1ae28ec Mon Sep 17 00:00:00 2001 From: KS Date: Fri, 14 Aug 2015 22:54:04 +0800 Subject: [PATCH 921/965] Create 20150803 Managing Linux Logs.md --- .../tech/20150803 Managing Linux Logs.md | 418 ++++++++++++++++++ 1 file changed, 418 insertions(+) create mode 100644 translated/tech/20150803 Managing Linux Logs.md diff --git a/translated/tech/20150803 Managing Linux Logs.md b/translated/tech/20150803 Managing Linux Logs.md new file mode 100644 index 0000000000..59b41aa831 --- /dev/null +++ b/translated/tech/20150803 Managing Linux Logs.md @@ -0,0 +1,418 @@ +Linux日志管理 +================================================================================ +管理日志的一个关键典型做法是集中或整合你的日志到一个地方,特别是如果你有许多服务器或多层级架构。我们将告诉你为什么这是一个好主意然后给出如何更容易的做这件事的一些小技巧。 + +### 集中管理日志的好处 ### + +如果你有很多服务器,查看单独的一个日志文件可能会很麻烦。现代的网站和服务经常包括许多服务器层级,分布式的负载均衡器,还有更多。这将花费很长时间去获取正确的日志,甚至花更长时间在登录服务器的相关问题上。没什么比发现你找的信息没有被捕获更沮丧的了,或者本能保留答案时正好在重启后丢失了日志文件。 + +集中你的日志使他们查找更快速,可以帮助你更快速的解决产品问题。你不用猜测那个服务器存在问题,因为所有的日志在同一个地方。此外,你可以使用更强大的工具去分析他们,包括日志管理解决方案。一些解决方案能[转换纯文本日志][1]为一些字段,更容易查找和分析。 + +集中你的日志也可以是他们更易于管理: + +- 他们更安全,当他们备份归档一个单独区域时意外或者有意的丢失。如果你的服务器宕机或者无响应,你可以使用集中的日志去调试问题。 +- 你不用担心ssh或者低效的grep命令需要更多的资源在陷入困境的系统。 +- 你不用担心磁盘占满,这个能让你的服务器死机。 +- 你能保持你的产品服务安全性,只是为了查看日志无需给你所有团队登录权限。给你的团队从中心区域访问日志权限更安全。 + +随着集中日志管理,你仍需处理由于网络联通性不好或者用尽大量网络带宽导致不能传输日志到中心区域的风险。在下面的章节我们将要讨论如何聪明的解决这些问题。 + +### 流行的日志归集工具 ### + +在Linux上最常见的日志归集是通过使用系统日志守护进程或者代理。系统日志守护进程支持本地日志的采集,然后通过系统日志协议传输日志到中心服务器。你可以使用很多流行的守护进程来归集你的日志文件: + +- [rsyslog][2]是一个轻量后台程序在大多数Linux分支上已经安装。 +- [syslog-ng][3]是第二流行的Linux系统日志后台程序。 +- [logstash][4]是一个重量级的代理,他可以做更多高级加工和分析。 +- [fluentd][5]是另一个有高级处理能力的代理。 + +Rsyslog是集中日志数据最流行的后台程序因为他在大多数Linux分支上是被默认安装的。你不用下载或安装它,并且它是轻量的,所以不需要占用你太多的系统资源。 + +如果你需要更多先进的过滤或者自定义分析功能,如果你不在乎额外的系统封装Logstash是下一个最流行的选择。 + +### 配置Rsyslog.conf ### + +既然rsyslog成为最广泛使用的系统日志程序,我们将展示如何配置它为日志中心。全局配置文件位于/etc/rsyslog.conf。它加载模块,设置全局指令,和包含应用特有文件位于目录/etc/rsyslog.d中。这些目录包含/etc/rsyslog.d/50-default.conf命令rsyslog写系统日志到文件。在[rsyslog文档][6]你可以阅读更多相关配置。 + +rsyslog配置语言是是[RainerScript][7]。你建立特定的日志输入就像输出他们到另一个目标。Rsyslog已经配置为系统日志输入的默认标准,所以你通常只需增加一个输出到你的日志服务器。这里有一个rsyslog输出到一个外部服务器的配置例子。在举例中,**BEBOP**是一个服务器的主机名,所以你应该替换为你的自己的服务器名。 + + action(type="omfwd" protocol="tcp" target="BEBOP" port="514") + +你可以发送你的日志到一个有丰富存储的日志服务器来存储,提供查询,备份和分析。如果你正存储日志在文件系统,然后你应该建立[日志转储][8]来防止你的磁盘报满。 + +作为一种选择,你可以发送这些日志到一个日志管理方案。如果你的解决方案是安装在本地你可以发送到您的本地系统文档中指定主机和端口。如果你使用基于云提供商,你将发送他们到你的提供商特定的主机名和端口。 + +### 日志目录 ### + +你可以归集一个目录或者匹配一个通配符模式的所有文件。nxlog和syslog-ng程序支持目录和通配符(*)。 + +rsyslog的通用形式不支持直接的监控目录。一种解决方案,你可以设置一个定时任务去监控这个目录的新文件,然后配置rsyslog来发送这些文件到目的地,比如你的日志管理系统。作为一个例子,日志管理提供商Loggly有一个开源版本的[目录监控脚本][9]。 + +### 哪个协议: UDP, TCP, or RELP? ### + +当你使用网络传输数据时,你可以选择三个主流的协议。UDP在你自己的局域网是最常用的,TCP是用在互联网。如果你不能失去日志,就要使用更高级的RELP协议。 + +[UDP][10]发送一个数据包,那只是一个简单的包信息。它是一个只外传的协议,所以他不发送给你回执(ACK)。它只尝试发送包。当网络拥堵时,UDP通常会巧妙的降级或者丢弃日志。它通常使用在类似局域网的可靠网络。 + +[TCP][11]通过多个包和返回确认发送流信息。TCP会多次尝试发送数据包,但是受限于[TCP缓存][12]大小。这是在互联网上发送送日志最常用的协议。 + +[RELP][13]是这三个协议中最可靠的,但是它是为rsyslog创建而且很少有行业应用。它在应用层接收数据然后再发出是否有错误。确认你的目标也支持这个协议。 + +### 用磁盘辅助队列可靠的传送 ### + +如果rsyslog在存储日志时遭遇错误,例如一个不可用网络连接,他能将日志排队直到连接还原。队列日志默认被存储在内存里。无论如何,内存是有限的并且如果问题仍然存在,日志会超出内存容量。 + +**警告:如果你只存储日志到内存,你可能会失去数据。** + +Rsyslog能在内存被占满时将日志队列放到磁盘。[磁盘辅助队列][14]使日志的传输更可靠。这里有一个例子如何配置rsyslog的磁盘辅助队列: + + $WorkDirectory /var/spool/rsyslog # where to place spool files + $ActionQueueFileName fwdRule1 # unique name prefix for spool files + $ActionQueueMaxDiskSpace 1g # 1gb space limit (use as much as possible) + $ActionQueueSaveOnShutdown on # save messages to disk on shutdown + $ActionQueueType LinkedList # run asynchronously + $ActionResumeRetryCount -1 # infinite retries if host is down + +### 使用TLS加密日志 ### + +当你的安全隐私数据是一个关心的事,你应该考虑加密你的日志。如果你使用纯文本在互联网传输日志,嗅探器和中间人可以读到你的日志。如果日志包含私人信息、敏感的身份数据或者政府管制数据,你应该加密你的日志。rsyslog程序能使用TLS协议加密你的日志保证你的数据更安全。 + +建立TLS加密,你应该做如下任务: + +1. 生成一个[证书授权][15](CA)。在/contrib/gnutls有一些简单的证书,只是有助于测试,但是你需要创建自己的产品证书。如果你正在使用一个日志管理服务,它将有一个证书给你。 +1. 为你的服务器生成一个[数字证书][16]使它能SSL运算,或者使用你自己的日志管理服务提供商的一个数字证书。 +1. 配置你的rsyslog程序来发送TLS加密数据到你的日志管理系统。 + +这有一个rsyslog配置TLS加密的例子。替换CERT和DOMAIN_NAME为你自己的服务器配置。 + + $DefaultNetstreamDriverCAFile /etc/rsyslog.d/keys/ca.d/CERT.crt + $ActionSendStreamDriver gtls + $ActionSendStreamDriverMode 1 + $ActionSendStreamDriverAuthMode x509/name + $ActionSendStreamDriverPermittedPeer *.DOMAIN_NAME.com + +### 应用日志的最佳管理方法 ### + +除Linux默认创建的日志之外,归集重要的应用日志也是一个好主意。几乎所有基于Linux的服务器的应用把他们的状态信息写入到独立专门的日志文件。这包括数据库产品,像PostgreSQL或者MySQL,网站服务器像Nginx或者Apache,防火墙,打印和文件共享服务还有DNS服务等等。 + +管理员要做的第一件事是安装一个应用后配置它。Linux应用程序典型的有一个.conf文件在/etc目录里。它也可能在其他地方,但是那是大家找配置文件首先会看的地方。 + +根据应用程序有多复杂多庞大,可配置参数的数量可能会很少或者上百行。如前所述,大多数应用程序可能会在某种日志文件写他们的状态:配置文件是日志设置的地方定义了其他的东西。 + +如果你不确定它在哪,你可以使用locate命令去找到它: + + [root@localhost ~]# locate postgresql.conf + /usr/pgsql-9.4/share/postgresql.conf.sample + /var/lib/pgsql/9.4/data/postgresql.conf + +#### 设置一个日志文件的标准位置 #### + +Linux系统一般保存他们的日志文件在/var/log目录下。如果是,很好,如果不是,你也许想在/var/log下创建一个专用目录?为什么?因为其他程序也在/var/log下保存他们的日志文件,如果你的应用报错多于一个日志文件 - 也许每天一个或者每次重启一个 - 通过这么大的目录也许有点难于搜索找到你想要的文件。 + +如果你有多于一个的应用实例在你网络运行,这个方法依然便利。想想这样的情景,你也许有一打web服务器在你的网络运行。当排查任何一个盒子的问题,你将知道确切的位置。 + +#### 使用一个标准的文件名 #### + +给你的应用最新的日志使用一个标准的文件名。这使一些事变得容易,因为你可以监控和追踪一个单独的文件。很多应用程序在他们的日志上追加一种时间戳。他让rsyslog更难于找到最新的文件和设置文件监控。一个更好的方法是使用日志转储增加时间戳到老的日志文件。这样更易去归档和历史查询。 + +#### 追加日志文件 #### + +日志文件会在每个应用程序重启后被覆盖?如果这样,我们建议关掉它。每次重启app后应该去追加日志文件。这样,你就可以追溯重启前最后的日志。 + +#### 日志文件追加 vs. 转储 #### + +虽然应用程序每次重启后写一个新日志文件,如何保存当前日志?追加到一个单独文件,巨大的文件?Linux系统不是因频繁重启或者崩溃出名的:应用程序可以运行很长时间甚至不间歇,但是也会使日志文件非常大。如果你查询分析上周发生连接错误的原因,你可能无疑的要在成千上万行里搜索。 + +我们建议你配置应用每天半晚转储它的日志文件。 + +为什么?首先它将变得可管理。找一个有特定日期部分的文件名比遍历一个文件指定日期的条目更容易。文件也小的多:你不用考虑当你打开一个日志文件时vi僵住。第二,如果你正发送日志到另一个位置 - 也许每晚备份任务拷贝到归集日志服务器 - 这样不会消耗你的网络带宽。最后第三点,这样帮助你做日志保持。如果你想剔除旧的日志记录,这样删除超过指定日期的文件比一个应用解析一个大文件更容易。 + +#### 日志文件的保持 #### + +你保留你的日志文件多长时间?这绝对可以归结为业务需求。你可能被要求保持一个星期的日志信息,或者管理要求保持一年的数据。无论如何,日志需要在一个时刻或其他从服务器删除。 + +在我们看来,除非必要,只在线保持最近一个月的日志文件,加上拷贝他们到第二个地方如日志服务器。任何比这更旧的日志可以被转到一个单独的介质上。例如,如果你在AWS上,你的旧日志可以被拷贝到Glacier。 + +#### 给日志单独的磁盘分区 #### + +Linux最典型的方式通常建议挂载到/var目录到一个单独度的文件系统。这是因为这个目录的高I/Os。我们推荐挂在/var/log目录到一个单独的磁盘系统下。这样可以节省与主应用的数据I/O竞争。另外,如果一些日志文件变的太多,或者一个文件变的太大,不会占满整个磁盘。 + +#### 日志条目 #### + +每个日志条目什么信息应该被捕获? + +这依赖于你想用日志来做什么。你只想用它来排除故障,或者你想捕获所有发生的事?这是一个规则条件去捕获每个用户在运行什么或查看什么? + +如果你正用日志做错误排查的目的,只保存错误,报警或者致命信息。没有理由去捕获调试信息,例如,应用也许默认记录了调试信息或者另一个管理员也许为了故障排查使用打开了调试信息,但是你应该关闭它,因为它肯定会很快的填满空间。在最低限度上,捕获日期,时间,客户端应用名,原ip或者客户端主机名,执行动作和它自身信息。 + +#### 一个PostgreSQL的实例 #### + +作为一个例子,让我们看看vanilla(这是一个开源论坛)PostgreSQL 9.4安装主配置文件。它叫做postgresql.conf与其他Linux系统中的配置文件不同,他不保存在/etc目录下。在代码段下,我们可以在我们的Centos 7服务器的/var/lib/pgsql目录下看见: + + root@localhost ~]# vi /var/lib/pgsql/9.4/data/postgresql.conf + ... + #------------------------------------------------------------------------------ + # ERROR REPORTING AND LOGGING + #------------------------------------------------------------------------------ + # - Where to Log - + log_destination = 'stderr' + # Valid values are combinations of + # stderr, csvlog, syslog, and eventlog, + # depending on platform. csvlog + # requires logging_collector to be on. + # This is used when logging to stderr: + logging_collector = on + # Enable capturing of stderr and csvlog + # into log files. Required to be on for + # csvlogs. + # (change requires restart) + # These are only used if logging_collector is on: + log_directory = 'pg_log' + # directory where log files are written, + # can be absolute or relative to PGDATA + log_filename = 'postgresql-%a.log' # log file name pattern, + # can include strftime() escapes + # log_file_mode = 0600 . + # creation mode for log files, + # begin with 0 to use octal notation + log_truncate_on_rotation = on # If on, an existing log file with the + # same name as the new log file will be + # truncated rather than appended to. + # But such truncation only occurs on + # time-driven rotation, not on restarts + # or size-driven rotation. Default is + # off, meaning append to existing files + # in all cases. + log_rotation_age = 1d + # Automatic rotation of logfiles will happen after that time. 0 disables. + log_rotation_size = 0 # Automatic rotation of logfiles will happen after that much log output. 0 disables. + # These are relevant when logging to syslog: + #syslog_facility = 'LOCAL0' + #syslog_ident = 'postgres' + # This is only relevant when logging to eventlog (win32): + #event_source = 'PostgreSQL' + # - When to Log - + #client_min_messages = notice # values in order of decreasing detail: + # debug5 + # debug4 + # debug3 + # debug2 + # debug1 + # log + # notice + # warning + # error + #log_min_messages = warning # values in order of decreasing detail: + # debug5 + # debug4 + # debug3 + # debug2 + # debug1 + # info + # notice + # warning + # error + # log + # fatal + # panic + #log_min_error_statement = error # values in order of decreasing detail: + # debug5 + # debug4 + # debug3 + # debug2 + # debug1 + # info + # notice + # warning + # error + # log + # fatal + # panic (effectively off) + #log_min_duration_statement = -1 # -1 is disabled, 0 logs all statements + # and their durations, > 0 logs only + # statements running at least this number + # of milliseconds + # - What to Log + #debug_print_parse = off + #debug_print_rewritten = off + #debug_print_plan = off + #debug_pretty_print = on + #log_checkpoints = off + #log_connections = off + #log_disconnections = off + #log_duration = off + #log_error_verbosity = default + # terse, default, or verbose messages + #log_hostname = off + log_line_prefix = '< %m >' # special values: + # %a = application name + # %u = user name + # %d = database name + # %r = remote host and port + # %h = remote host + # %p = process ID + # %t = timestamp without milliseconds + # %m = timestamp with milliseconds + # %i = command tag + # %e = SQL state + # %c = session ID + # %l = session line number + # %s = session start timestamp + # %v = virtual transaction ID + # %x = transaction ID (0 if none) + # %q = stop here in non-session + # processes + # %% = '%' + # e.g. '<%u%%%d> ' + #log_lock_waits = off # log lock waits >= deadlock_timeout + #log_statement = 'none' # none, ddl, mod, all + #log_temp_files = -1 # log temporary files equal or larger + # than the specified size in kilobytes;5# -1 disables, 0 logs all temp files5 + log_timezone = 'Australia/ACT' + +虽然大多数参数被加上了注释,他们呈现了默认数值。我们可以看见日志文件目录是pg_log(log_directory参数),文件名应该以postgresql开头(log_filename参数),文件每天转储一次(log_rotation_age参数)然后日志记录以时间戳开头(log_line_prefix参数)。特别说明有趣的是log_line_prefix参数:你可以包含很多整体丰富的信息在这。 + +看/var/lib/pgsql/9.4/data/pg_log目录下展现给我们这些文件: + + [root@localhost ~]# ls -l /var/lib/pgsql/9.4/data/pg_log + total 20 + -rw-------. 1 postgres postgres 1212 May 1 20:11 postgresql-Fri.log + -rw-------. 1 postgres postgres 243 Feb 9 21:49 postgresql-Mon.log + -rw-------. 1 postgres postgres 1138 Feb 7 11:08 postgresql-Sat.log + -rw-------. 1 postgres postgres 1203 Feb 26 21:32 postgresql-Thu.log + -rw-------. 1 postgres postgres 326 Feb 10 01:20 postgresql-Tue.log + +所以日志文件命只有工作日命名的标签。我们可以改变他。如何做?在postgresql.conf配置log_filename参数。 + +查看一个日志内容,它的条目仅以日期时间开头: + + [root@localhost ~]# cat /var/lib/pgsql/9.4/data/pg_log/postgresql-Fri.log + ... + < 2015-02-27 01:21:27.020 EST >LOG: received fast shutdown request + < 2015-02-27 01:21:27.025 EST >LOG: aborting any active transactions + < 2015-02-27 01:21:27.026 EST >LOG: autovacuum launcher shutting down + < 2015-02-27 01:21:27.036 EST >LOG: shutting down + < 2015-02-27 01:21:27.211 EST >LOG: database system is shut down + +### 集中应用日志 ### + +#### 使用Imfile监控日志 #### + +习惯上,应用通常记录他们数据在文件里。文件容易在一个机器上寻找但是多台服务器上就不是很恰当了。你可以设置日志文件监控然后当新的日志被添加到底部就发送事件到一个集中服务器。在/etc/rsyslog.d/里创建一个新的配置文件然后增加一个文件输入,像这样: + + $ModLoad imfile + $InputFilePollInterval 10 + $PrivDropToGroup adm + +---------- + + # Input for FILE1 + $InputFileName /FILE1 + $InputFileTag APPNAME1 + $InputFileStateFile stat-APPNAME1 #this must be unique for each file being polled + $InputFileSeverity info + $InputFilePersistStateInterval 20000 + $InputRunFileMonitor + +替换FILE1和APPNAME1位你自己的文件和应用名称。Rsyslog将发送它到你配置的输出中。 + +#### 本地套接字日志与Imuxsock #### + +套接字类似UNIX文件句柄,所不同的是套接字内容是由系统日志程序读取到内存中,然后发送到目的地。没有文件需要被写入。例如,logger命令发送他的日志到这个UNIX套接字。 + +如果你的服务器I/O有限或者你不需要本地文件日志,这个方法使系统资源有效利用。这个方法缺点是套接字有队列大小的限制。如果你的系统日志程序宕掉或者不能保持运行,然后你可能会丢失日志数据。 + +rsyslog程序将默认从/dev/log套接字中种读取,但是你要用[imuxsock输入模块][17]如下命令使它生效: + + $ModLoad imuxsock + +#### UDP日志与Imupd #### + +一些应用程序使用UDP格式输出日志数据,这是在网络上或者本地传输日志文件的标准系统日志协议。你的系统日志程序收集这些日志然后处理他们或者用不同的格式传输他们。交替地,你可以发送日志到你的日志服务器或者到一个日志管理方案中。 + +使用如下命令配置rsyslog来接收标准端口514的UDP系统日志数据: + + $ModLoad imudp + +---------- + + $UDPServerRun 514 + +### 用Logrotate管理日志 ### + +日志转储是当日志到达指定的时期时自动归档日志文件的方法。如果不介入,日志文件一直增长,会用尽磁盘空间。最后他们将破坏你的机器。 + +logrotate实例能随着日志的日期截取你的日志,腾出空间。你的新日志文件保持文件名。你的旧日志文件被重命名为后缀加上数字。每次logrotate实例运行,一个新文件被建立然后现存的文件被逐一重命名。你来决定何时旧文件被删除或归档的阈值。 + +当logrotate拷贝一个文件,新的文件已经有一个新的索引节点,这会妨碍rsyslog监控新文件。你可以通过增加copytruncate参数到你的logrotate定时任务来缓解这个问题。这个参数拷贝现有的日志文件内容到新文件然后从现有文件截短这些内容。这个索引节点从不改变,因为日志文件自己保持不变;它的内容是一个新文件。 + +logrotate实例使用的主配置文件是/etc/logrotate.conf,应用特有设置在/etc/logrotate.d/目录下。DigitalOcean有一个详细的[logrotate教程][18] + +### 管理很多服务器的配置 ### + +当你只有很少的服务器,你可以登陆上去手动配置。一旦你有几打或者更多服务器,你可以用高级工具使这变得更容易和更可扩展。基本上,所有的事情就是拷贝你的rsyslog配置到每个服务器,然后重启rsyslog使更改生效。 + +#### Pssh #### + +这个工具可以让你在很多服务器上并行的运行一个ssh命令。使用pssh部署只有一小部分的服务器。如果你其中一个服务器失败,然后你必须ssh到失败的服务器,然后手动部署。如果你有很多服务器失败,那么手动部署他们会话费很长时间。 + +#### Puppet/Chef #### + +Puppet和Chef是两个不同的工具,他们能在你的网络按你规定的标准自动的配置所有服务器。他们的报表工具使你知道关于错误然后定期重新同步。Puppet和Chef有一些狂热的支持者。如果你不确定那个更适合你的部署配置管理,你可以领会一下[InfoWorld上这两个工具的对比][19] + +一些厂商也提供一些配置rsyslog的模块或者方法。这有一个Loggly上Puppet模块的例子。它提供给rsyslog一个类,你可以添加一个标识令牌: + + node 'my_server_node.example.net' { + # Send syslog events to Loggly + class { 'loggly::rsyslog': + customer_token => 'de7b5ccd-04de-4dc4-fbc9-501393600000', + } + } + +#### Docker #### + +Docker使用容器去运行应用不依赖底层服务。所有东西都从内部的容器运行,你可以想象为一个单元功能。ZDNet有一个深入文章关于在你的数据中心[使用Docker][20]。 + +这有很多方式从Docker容器记录日志,包括链接到一个日志容器,记录到一个共享卷,或者直接在容器里添加一个系统日志代理。其中最流行的日志容器叫做[logspout][21]。 + +#### 供应商的脚本或代理 #### + +大多数日志管理方案提供一些脚本或者代理,从一个或更多服务器比较简单的发送数据。重量级代理会耗尽额外的系统资源。一些供应商像Loggly提供配置脚本,来使用现存的系统日志程序更轻松。这有一个Loggly上的例子[脚本][22],它能运行在任意数量的服务器上。 + +-------------------------------------------------------------------------------- + +via: http://www.loggly.com/ultimate-guide/logging/managing-linux-logs/ + +作者:[Jason Skowronski][a1] +作者:[Amy Echeverri][a2] +作者:[Sadequl Hussain][a3] +译者:[wyangsun](https://github.com/wyangsun) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a1]:https://www.linkedin.com/in/jasonskowronski +[a2]:https://www.linkedin.com/in/amyecheverri +[a3]:https://www.linkedin.com/pub/sadequl-hussain/14/711/1a7 +[1]:https://docs.google.com/document/d/11LXZxWlkNSHkcrCWTUdnLRf_CiZz9kK0cr3yGM_BU_0/edit#heading=h.esrreycnpnbl +[2]:http://www.rsyslog.com/ +[3]:http://www.balabit.com/network-security/syslog-ng/opensource-logging-system +[4]:http://logstash.net/ +[5]:http://www.fluentd.org/ +[6]:http://www.rsyslog.com/doc/rsyslog_conf.html +[7]:http://www.rsyslog.com/doc/master/rainerscript/index.html +[8]:https://docs.google.com/document/d/11LXZxWlkNSHkcrCWTUdnLRf_CiZz9kK0cr3yGM_BU_0/edit#heading=h.eck7acdxin87 +[9]:https://www.loggly.com/docs/file-monitoring/ +[10]:http://www.networksorcery.com/enp/protocol/udp.htm +[11]:http://www.networksorcery.com/enp/protocol/tcp.htm +[12]:http://blog.gerhards.net/2008/04/on-unreliability-of-plain-tcp-syslog.html +[13]:http://www.rsyslog.com/doc/relp.html +[14]:http://www.rsyslog.com/doc/queues.html +[15]:http://www.rsyslog.com/doc/tls_cert_ca.html +[16]:http://www.rsyslog.com/doc/tls_cert_machine.html +[17]:http://www.rsyslog.com/doc/v8-stable/configuration/modules/imuxsock.html +[18]:https://www.digitalocean.com/community/tutorials/how-to-manage-log-files-with-logrotate-on-ubuntu-12-10 +[19]:http://www.infoworld.com/article/2614204/data-center/puppet-or-chef--the-configuration-management-dilemma.html +[20]:http://www.zdnet.com/article/what-is-docker-and-why-is-it-so-darn-popular/ +[21]:https://github.com/progrium/logspout +[22]:https://www.loggly.com/docs/sending-logs-unixlinux-system-setup/ From 3ade8029a018fbac08e0f65bf37dfe8f5dbc6986 Mon Sep 17 00:00:00 2001 From: KS Date: Fri, 14 Aug 2015 22:54:54 +0800 Subject: [PATCH 922/965] Delete 20150803 Managing Linux Logs.md --- sources/tech/20150803 Managing Linux Logs.md | 419 ------------------- 1 file changed, 419 deletions(-) delete mode 100644 sources/tech/20150803 Managing Linux Logs.md diff --git a/sources/tech/20150803 Managing Linux Logs.md b/sources/tech/20150803 Managing Linux Logs.md deleted file mode 100644 index e317a63253..0000000000 --- a/sources/tech/20150803 Managing Linux Logs.md +++ /dev/null @@ -1,419 +0,0 @@ -wyangsun translating -Managing Linux Logs -================================================================================ -A key best practice for logging is to centralize or aggregate your logs in one place, especially if you have multiple servers or tiers in your architecture. We’ll tell you why this is a good idea and give tips on how to do it easily. - -### Benefits of Centralizing Logs ### - -It can be cumbersome to look at individual log files if you have many servers. Modern web sites and services often include multiple tiers of servers, distributed with load balancers, and more. It’d take a long time to hunt down the right file, and even longer to correlate problems across servers. There’s nothing more frustrating than finding the information you are looking for hasn’t been captured, or the log file that could have held the answer has just been lost after a restart. - -Centralizing your logs makes them faster to search, which can help you solve production issues faster. You don’t have to guess which server had the issue because all the logs are in one place. Additionally, you can use more powerful tools to analyze them, including log management solutions. These solutions can [transform plain text logs][1] into fields that can be easily searched and analyzed. - -Centralizing your logs also makes them easier to manage: - -- They are safer from accidental or intentional loss when they are backed up and archived in a separate location. If your servers go down or are unresponsive, you can use the centralized logs to debug the problem. -- You don’t have to worry about ssh or inefficient grep commands requiring more resources on troubled systems. -- You don’t have to worry about full disks, which can crash your servers. -- You can keep your production servers secure without giving your entire team access just to look at logs. It’s much safer to give your team access to logs from the central location. - -With centralized log management, you still must deal with the risk of being unable to transfer logs to the centralized location due to poor network connectivity or of using up a lot of network bandwidth. We’ll discuss how to intelligently address these issues in the sections below. - -### Popular Tools for Centralizing Logs ### - -The most common way of centralizing logs on Linux is by using syslog daemons or agents. The syslog daemon supports local log collection, then transports logs through the syslog protocol to a central server. There are several popular daemons that you can use to centralize your log files: - -- [rsyslog][2] is a light-weight daemon installed on most common Linux distributions. -- [syslog-ng][3] is the second most popular syslog daemon for Linux. -- [logstash][4] is a heavier-weight agent that can do more advanced processing and parsing. -- [fluentd][5] is another agent with advanced processing capabilities. - -Rsyslog is the most popular daemon for centralizing your log data because it’s installed by default in most common distributions of Linux. You don’t need to download it or install it, and it’s lightweight so it won’t take up much of your system resources. - -If you need more advanced filtering or custom parsing capabilities, Logstash is the next most popular choice if you don’t mind the extra system footprint. - -### Configure Rsyslog.conf ### - -Since rsyslog is the most widely used syslog daemon, we’ll show how to configure it to centralize logs. The global configuration file is located at /etc/rsyslog.conf. It loads modules, sets global directives, and has an include for application-specific files located in the directory /etc/rsyslog.d/. This directory contains /etc/rsyslog.d/50-default.conf which instructs rsyslog to write the system logs to file. You can read more about the configuration files in the [rsyslog documentation][6]. - -The configuration language for rsyslog is [RainerScript][7]. You set up specific inputs for logs as well as actions to output them to another destination. Rsyslog already configures standard defaults for syslog input, so you usually just need to add an output to your log server. Here is an example configuration for rsyslog to output logs to an external server. In this example, **BEBOP** is the hostname of the server, so you should replace it with your own server name. - - action(type="omfwd" protocol="tcp" target="BEBOP" port="514") - -You could send your logs to a log server with ample storage to keep a copy for search, backup, and analysis. If you’re storing logs in the file system, then you should set up [log rotation][8] to keep your disk from getting full. - -Alternatively, you can send these logs to a log management solution. If your solution is installed locally you can send it to your local host and port as specified in your system documentation. If you use a cloud-based provider, you will send them to the hostname and port specified by your provider. - -### Log Directories ### - -You can centralize all the files in a directory or matching a wildcard pattern. The nxlog and syslog-ng daemons support both directories and wildcards (*). - -Common versions of rsyslog can’t monitor directories directly. As a workaround, you can setup a cron job to monitor the directory for new files, then configure rsyslog to send those files to a destination, such as your log management system. As an example, the log management vendor Loggly has an open source version of a [script to monitor directories][9]. - -### Which Protocol: UDP, TCP, or RELP? ### - -There are three main protocols that you can choose from when you transmit data over the Internet. The most common is UDP for your local network and TCP for the Internet. If you cannot lose logs, then use the more advanced RELP protocol. - -[UDP][10] sends a datagram packet, which is a single packet of information. It’s an outbound-only protocol, so it doesn’t send you an acknowledgement of receipt (ACK). It makes only one attempt to send the packet. UDP can be used to smartly degrade or drop logs when the network gets congested. It’s most commonly used on reliable networks like localhost. - -[TCP][11] sends streaming information in multiple packets and returns an ACK. TCP makes multiple attempts to send the packet, but is limited by the size of the [TCP buffer][12]. This is the most common protocol for sending logs over the Internet. - -[RELP][13] is the most reliable of these three protocols but was created for rsyslog and has less industry adoption. It acknowledges receipt of data in the application layer and will resend if there is an error. Make sure your destination also supports this protocol. - -### Reliably Send with Disk Assisted Queues ### - -If rsyslog encounters a problem when storing logs, such as an unavailable network connection, it can queue the logs until the connection is restored. The queued logs are stored in memory by default. However, memory is limited and if the problem persists, the logs can exceed memory capacity. - -**Warning: You can lose data if you store logs only in memory.** - -Rsyslog can queue your logs to disk when memory is full. [Disk-assisted queues][14] make transport of logs more reliable. Here is an example of how to configure rsyslog with a disk-assisted queue: - - $WorkDirectory /var/spool/rsyslog # where to place spool files - $ActionQueueFileName fwdRule1 # unique name prefix for spool files - $ActionQueueMaxDiskSpace 1g # 1gb space limit (use as much as possible) - $ActionQueueSaveOnShutdown on # save messages to disk on shutdown - $ActionQueueType LinkedList # run asynchronously - $ActionResumeRetryCount -1 # infinite retries if host is down - -### Encrypt Logs Using TLS ### - -When the security and privacy of your data is a concern, you should consider encrypting your logs. Sniffers and middlemen could read your log data if you transmit it over the Internet in clear text. You should encrypt your logs if they contain private information, sensitive identification data, or government-regulated data. The rsyslog daemon can encrypt your logs using the TLS protocol and keep your data safer. - -To set up TLS encryption, you need to do the following tasks: - -1. Generate a [certificate authority][15] (CA). There are sample certificates in /contrib/gnutls, which are good only for testing, but you need to create your own for production. If you’re using a log management service, it will have one ready for you. -1. Generate a [digital certificate][16] for your server to enable SSL operation, or use one from your log management service provider. -1. Configure your rsyslog daemon to send TLS-encrypted data to your log management system. - -Here’s an example rsyslog configuration with TLS encryption. Replace CERT and DOMAIN_NAME with your own server setting. - - $DefaultNetstreamDriverCAFile /etc/rsyslog.d/keys/ca.d/CERT.crt - $ActionSendStreamDriver gtls - $ActionSendStreamDriverMode 1 - $ActionSendStreamDriverAuthMode x509/name - $ActionSendStreamDriverPermittedPeer *.DOMAIN_NAME.com - -### Best Practices for Application Logging ### - -In addition to the logs that Linux creates by default, it’s also a good idea to centralize logs from important applications. Almost all Linux-based server class applications write their status information in separate, dedicated log files. This includes database products like PostgreSQL or MySQL, web servers like Nginx or Apache, firewalls, print and file sharing services, directory and DNS servers and so on. - -The first thing administrators do after installing an application is to configure it. Linux applications typically have a .conf file somewhere within the /etc directory. It can be somewhere else too, but that’s the first place where people look for configuration files. - -Depending on how complex or large the application is, the number of settable parameters can be few or in hundreds. As mentioned before, most applications would write their status in some sort of log file: configuration file is where log settings are defined among other things. - -If you’re not sure where it is, you can use the locate command to find it: - - [root@localhost ~]# locate postgresql.conf - /usr/pgsql-9.4/share/postgresql.conf.sample - /var/lib/pgsql/9.4/data/postgresql.conf - -#### Set a Standard Location for Log Files #### - -Linux systems typically save their log files under /var/log directory. This works fine, but check if the application saves under a specific directory under /var/log. If it does, great, if not, you may want to create a dedicated directory for the app under /var/log. Why? That’s because other applications save their log files under /var/log too and if your app saves more than one log file – perhaps once every day or after each service restart – it may be a bit difficult to trawl through a large directory to find the file you want. - -If you have the more than one instance of the application running in your network, this approach also comes handy. Think about a situation where you may have a dozen web servers running in your network. When troubleshooting any one of the boxes, you would know exactly where to go. - -#### Use A Standard Filename #### - -Use a standard filename for the latest logs from your application. This makes it easy because you can monitor and tail a single file. Many applications add some sort of date time stamp in them. This makes it much more difficult to find the latest file and to setup file monitoring by rsyslog. A better approach is to add timestamps to older log files using logrotate. This makes them easier to archive and search historically. - -#### Append the Log File #### - -Is the log file going to be overwritten after each application restart? If so, we recommend turning that off. After each restart the app should append to the log file. That way, you can always go back to the last log line before the restart. - -#### Appending vs. Rotation of Log File #### - -Even if the application writes a new log file after each restart, how is it saving in the current log? Is it appending to one single, massive file? Linux systems are not known for frequent reboots or crashes: applications can run for very long periods without even blinking, but that can also make the log file very large. If you are trying to analyze the root cause of a connection failure that happened last week, you could easily be searching through tens of thousands of lines. - -We recommend you configure the application to rotate its log file once every day, say at mid-night. - -Why? Well it becomes manageable for a starter. It’s much easier to find a file name with a specific date time pattern than to search through one file for that date’s entries. Files are also much smaller: you don’t think vi has frozen when you open a log file. Secondly, if you are sending the log file over the wire to a different location – perhaps a nightly backup job copying to a centralized log server – it doesn’t chew up your network’s bandwidth. Third and final, it helps with your log retention. If you want to cull old log entries, it’s easier to delete files older than a particular date than to have an application parsing one single large file. - -#### Retention of Log File #### - -How long do you keep a log file? That definitely comes down to business requirement. You could be asked to keep one week’s worth of logging information, or it may be a regulatory requirement to keep ten years’ worth of data. Whatever it is, logs need to go from the server at one time or other. - -In our opinion, unless otherwise required, keep at least a month’s worth of log files online, plus copy them to a secondary location like a logging server. Anything older than that can be offloaded to a separate media. For example, if you are on AWS, your older logs can be copied to Glacier. - -#### Separate Disk Location for Log Files #### - -Linux best practice usually suggests mounting the /var directory to a separate file system. This is because of the high number of I/Os associated with this directory. We would recommend mounting /var/log directory under a separate disk system. This can save I/O contention with the main application’s data. Also, if the number of log files becomes too large or the single log file becomes too big, it doesn’t fill up the entire disk. - -#### Log Entries #### - -What information should be captured in each log entry? - -That depends on what you want to use the log for. Do you want to use it only for troubleshooting purposes, or do you want to capture everything that’s happening? Is it a legal requirement to capture what each user is running or viewing? - -If you are using logs for troubleshooting purposes, save only errors, warnings or fatal messages. There’s no reason to capture debug messages, for example. The app may log debug messages by default or another administrator might have turned this on for another troubleshooting exercise, but you need to turn this off because it can definitely fill up the space quickly. At a minimum, capture the date, time, client application name, source IP or client host name, action performed and the message itself. - -#### A Practical Example for PostgreSQL #### - -As an example, let’s look at the main configuration file for a vanilla PostgreSQL 9.4 installation. It’s called postgresql.conf and contrary to other config files in Linux systems, it’s not saved under /etc directory. In the code snippet below, we can see it’s in /var/lib/pgsql directory of our CentOS 7 server: - - root@localhost ~]# vi /var/lib/pgsql/9.4/data/postgresql.conf - ... - #------------------------------------------------------------------------------ - # ERROR REPORTING AND LOGGING - #------------------------------------------------------------------------------ - # - Where to Log - - log_destination = 'stderr' - # Valid values are combinations of - # stderr, csvlog, syslog, and eventlog, - # depending on platform. csvlog - # requires logging_collector to be on. - # This is used when logging to stderr: - logging_collector = on - # Enable capturing of stderr and csvlog - # into log files. Required to be on for - # csvlogs. - # (change requires restart) - # These are only used if logging_collector is on: - log_directory = 'pg_log' - # directory where log files are written, - # can be absolute or relative to PGDATA - log_filename = 'postgresql-%a.log' # log file name pattern, - # can include strftime() escapes - # log_file_mode = 0600 . - # creation mode for log files, - # begin with 0 to use octal notation - log_truncate_on_rotation = on # If on, an existing log file with the - # same name as the new log file will be - # truncated rather than appended to. - # But such truncation only occurs on - # time-driven rotation, not on restarts - # or size-driven rotation. Default is - # off, meaning append to existing files - # in all cases. - log_rotation_age = 1d - # Automatic rotation of logfiles will happen after that time. 0 disables. - log_rotation_size = 0 # Automatic rotation of logfiles will happen after that much log output. 0 disables. - # These are relevant when logging to syslog: - #syslog_facility = 'LOCAL0' - #syslog_ident = 'postgres' - # This is only relevant when logging to eventlog (win32): - #event_source = 'PostgreSQL' - # - When to Log - - #client_min_messages = notice # values in order of decreasing detail: - # debug5 - # debug4 - # debug3 - # debug2 - # debug1 - # log - # notice - # warning - # error - #log_min_messages = warning # values in order of decreasing detail: - # debug5 - # debug4 - # debug3 - # debug2 - # debug1 - # info - # notice - # warning - # error - # log - # fatal - # panic - #log_min_error_statement = error # values in order of decreasing detail: - # debug5 - # debug4 - # debug3 - # debug2 - # debug1 - # info - # notice - # warning - # error - # log - # fatal - # panic (effectively off) - #log_min_duration_statement = -1 # -1 is disabled, 0 logs all statements - # and their durations, > 0 logs only - # statements running at least this number - # of milliseconds - # - What to Log - #debug_print_parse = off - #debug_print_rewritten = off - #debug_print_plan = off - #debug_pretty_print = on - #log_checkpoints = off - #log_connections = off - #log_disconnections = off - #log_duration = off - #log_error_verbosity = default - # terse, default, or verbose messages - #log_hostname = off - log_line_prefix = '< %m >' # special values: - # %a = application name - # %u = user name - # %d = database name - # %r = remote host and port - # %h = remote host - # %p = process ID - # %t = timestamp without milliseconds - # %m = timestamp with milliseconds - # %i = command tag - # %e = SQL state - # %c = session ID - # %l = session line number - # %s = session start timestamp - # %v = virtual transaction ID - # %x = transaction ID (0 if none) - # %q = stop here in non-session - # processes - # %% = '%' - # e.g. '<%u%%%d> ' - #log_lock_waits = off # log lock waits >= deadlock_timeout - #log_statement = 'none' # none, ddl, mod, all - #log_temp_files = -1 # log temporary files equal or larger - # than the specified size in kilobytes;5# -1 disables, 0 logs all temp files5 - log_timezone = 'Australia/ACT' - -Although most parameters are commented out, they assume default values. We can see the log file directory is pg_log (log_directory parameter), the file names should start with postgresql (log_filename parameter), the files are rotated once every day (log_rotation_age parameter) and the log entries start with a timestamp (log_line_prefix parameter). Of particular interest is the log_line_prefix parameter: there is a whole gamut of information you can include there. - -Looking under /var/lib/pgsql/9.4/data/pg_log directory shows us these files: - - [root@localhost ~]# ls -l /var/lib/pgsql/9.4/data/pg_log - total 20 - -rw-------. 1 postgres postgres 1212 May 1 20:11 postgresql-Fri.log - -rw-------. 1 postgres postgres 243 Feb 9 21:49 postgresql-Mon.log - -rw-------. 1 postgres postgres 1138 Feb 7 11:08 postgresql-Sat.log - -rw-------. 1 postgres postgres 1203 Feb 26 21:32 postgresql-Thu.log - -rw-------. 1 postgres postgres 326 Feb 10 01:20 postgresql-Tue.log - -So the log files only have the name of the weekday stamped in the file name. We can change it. How? Configure the log_filename parameter in postgresql.conf. - -Looking inside one log file shows its entries start with date time only: - - [root@localhost ~]# cat /var/lib/pgsql/9.4/data/pg_log/postgresql-Fri.log - ... - < 2015-02-27 01:21:27.020 EST >LOG: received fast shutdown request - < 2015-02-27 01:21:27.025 EST >LOG: aborting any active transactions - < 2015-02-27 01:21:27.026 EST >LOG: autovacuum launcher shutting down - < 2015-02-27 01:21:27.036 EST >LOG: shutting down - < 2015-02-27 01:21:27.211 EST >LOG: database system is shut down - -### Centralizing Application Logs ### - -#### Log File Monitoring with Imfile #### - -Traditionally, the most common way for applications to log their data is with files. Files are easy to search on a single machine but don’t scale well with more servers. You can set up log file monitoring and send the events to a centralized server when new logs are appended to the bottom. Create a new configuration file in /etc/rsyslog.d/ then add a file input like this: - - $ModLoad imfile - $InputFilePollInterval 10 - $PrivDropToGroup adm - ----------- - - # Input for FILE1 - $InputFileName /FILE1 - $InputFileTag APPNAME1 - $InputFileStateFile stat-APPNAME1 #this must be unique for each file being polled - $InputFileSeverity info - $InputFilePersistStateInterval 20000 - $InputRunFileMonitor - -Replace FILE1 and APPNAME1 with your own file and application names. Rsyslog will send it to the outputs you have configured. - -#### Local Socket Logs with Imuxsock #### - -A socket is similar to a UNIX file handle except that the socket is read into memory by your syslog daemon and then sent to the destination. No file needs to be written. As an example, the logger command sends its logs to this UNIX socket. - -This approach makes efficient use of system resources if your server is constrained by disk I/O or you have no need for local file logs. The disadvantage of this approach is that the socket has a limited queue size. If your syslog daemon goes down or can’t keep up, then you could lose log data. - -The rsyslog daemon will read from the /dev/log socket by default, but you can specifically enable it with the [imuxsock input module][17] using the following command: - - $ModLoad imuxsock - -#### UDP Logs with Imupd #### - -Some applications output log data in UDP format, which is the standard syslog protocol when transferring log files over a network or your localhost. Your syslog daemon receives these logs and can process them or transmit them in a different format. Alternately, you can send the logs to your log server or to a log management solution. - -Use the following command to configure rsyslog to accept syslog data over UDP on the standard port 514: - - $ModLoad imudp - ----------- - - $UDPServerRun 514 - -### Manage Logs with Logrotate ### - -Log rotation is a process that archives log files automatically when they reach a specified age. Without intervention, log files keep growing, using up disk space. Eventually they will crash your machine. - -The logrotate utility can truncate your logs as they age, freeing up space. Your new log file retains the filename. Your old log file is renamed with a number appended to the end of it. Each time the logrotate utility runs, a new file is created and the existing file is renamed in sequence. You determine the threshold when old files are deleted or archived. - -When logrotate copies a file, the new file has a new inode, which can interfere with rsyslog’s ability to monitor the new file. You can alleviate this issue by adding the copytruncate parameter to your logrotate cron job. This parameter copies existing log file contents to a new file and truncates these contents from the existing file. The inode never changes because the log file itself remains the same; its contents are in a new file. - -The logrotate utility uses the main configuration file at /etc/logrotate.conf and application-specific settings in the directory /etc/logrotate.d/. DigitalOcean has a detailed [tutorial on logrotate][18]. - -### Manage Configuration on Many Servers ### - -When you have just a few servers, you can manually configure logging on them. Once you have a few dozen or more servers, you can take advantage of tools that make this easier and more scalable. At a basic level, all of these copy your rsyslog configuration to each server, and then restart rsyslog so the changes take effect. - -#### Pssh #### - -This tool lets you run an ssh command on several servers in parallel. Use a pssh deployment for only a small number of servers. If one of your servers fails, then you have to ssh into the failed server and do the deployment manually. If you have several failed servers, then the manual deployment on them can take a long time. - -#### Puppet/Chef #### - -Puppet and Chef are two different tools that can automatically configure all of the servers in your network to a specified standard. Their reporting tools let you know about failures and can resync periodically. Both Puppet and Chef have enthusiastic supporters. If you aren’t sure which one is more suitable for your deployment configuration management, you might appreciate [InfoWorld’s comparison of the two tools][19]. - -Some vendors also offer modules or recipes for configuring rsyslog. Here is an example from Loggly’s Puppet module. It offers a class for rsyslog to which you can add an identifying token: - - node 'my_server_node.example.net' { - # Send syslog events to Loggly - class { 'loggly::rsyslog': - customer_token => 'de7b5ccd-04de-4dc4-fbc9-501393600000', - } - } - -#### Docker #### - -Docker uses containers to run applications independent of the underlying server. Everything runs from inside a container, which you can think of as a unit of functionality. ZDNet has an in-depth article about [using Docker][20] in your data center. - -There are several ways to log from Docker containers including linking to a logging container, logging to a shared volume, or adding a syslog agent directly inside the container. One of the most popular logging containers is called [logspout][21]. - -#### Vendor Scripts or Agents #### - -Most log management solutions offer scripts or agents to make sending data from one or more servers relatively easy. Heavyweight agents can use up extra system resources. Some vendors like Loggly offer configuration scripts to make using existing syslog daemons easier. Here is an example [script][22] from Loggly which can run on any number of servers. - --------------------------------------------------------------------------------- - -via: http://www.loggly.com/ultimate-guide/logging/managing-linux-logs/ - -作者:[Jason Skowronski][a1] -作者:[Amy Echeverri][a2] -作者:[Sadequl Hussain][a3] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a1]:https://www.linkedin.com/in/jasonskowronski -[a2]:https://www.linkedin.com/in/amyecheverri -[a3]:https://www.linkedin.com/pub/sadequl-hussain/14/711/1a7 -[1]:https://docs.google.com/document/d/11LXZxWlkNSHkcrCWTUdnLRf_CiZz9kK0cr3yGM_BU_0/edit#heading=h.esrreycnpnbl -[2]:http://www.rsyslog.com/ -[3]:http://www.balabit.com/network-security/syslog-ng/opensource-logging-system -[4]:http://logstash.net/ -[5]:http://www.fluentd.org/ -[6]:http://www.rsyslog.com/doc/rsyslog_conf.html -[7]:http://www.rsyslog.com/doc/master/rainerscript/index.html -[8]:https://docs.google.com/document/d/11LXZxWlkNSHkcrCWTUdnLRf_CiZz9kK0cr3yGM_BU_0/edit#heading=h.eck7acdxin87 -[9]:https://www.loggly.com/docs/file-monitoring/ -[10]:http://www.networksorcery.com/enp/protocol/udp.htm -[11]:http://www.networksorcery.com/enp/protocol/tcp.htm -[12]:http://blog.gerhards.net/2008/04/on-unreliability-of-plain-tcp-syslog.html -[13]:http://www.rsyslog.com/doc/relp.html -[14]:http://www.rsyslog.com/doc/queues.html -[15]:http://www.rsyslog.com/doc/tls_cert_ca.html -[16]:http://www.rsyslog.com/doc/tls_cert_machine.html -[17]:http://www.rsyslog.com/doc/v8-stable/configuration/modules/imuxsock.html -[18]:https://www.digitalocean.com/community/tutorials/how-to-manage-log-files-with-logrotate-on-ubuntu-12-10 -[19]:http://www.infoworld.com/article/2614204/data-center/puppet-or-chef--the-configuration-management-dilemma.html -[20]:http://www.zdnet.com/article/what-is-docker-and-why-is-it-so-darn-popular/ -[21]:https://github.com/progrium/logspout -[22]:https://www.loggly.com/docs/sending-logs-unixlinux-system-setup/ From a14dc152fd6de7cb5357d7a23eed25a89c147afe Mon Sep 17 00:00:00 2001 From: wxy Date: Sat, 15 Aug 2015 00:46:41 +0800 Subject: [PATCH 923/965] PUB:20150728 How to Update Linux Kernel for Improved System Performance @geekpi --- ... Kernel for Improved System Performance.md | 120 ++++++++++++++++ ... Kernel for Improved System Performance.md | 129 ------------------ 2 files changed, 120 insertions(+), 129 deletions(-) create mode 100644 published/20150728 How to Update Linux Kernel for Improved System Performance.md delete mode 100644 translated/tech/20150728 How to Update Linux Kernel for Improved System Performance.md diff --git a/published/20150728 How to Update Linux Kernel for Improved System Performance.md b/published/20150728 How to Update Linux Kernel for Improved System Performance.md new file mode 100644 index 0000000000..89823aaad7 --- /dev/null +++ b/published/20150728 How to Update Linux Kernel for Improved System Performance.md @@ -0,0 +1,120 @@ +如何更新 Linux 内核来提升系统性能 +================================================================================ +![](http://cdn.makeuseof.com/wp-content/uploads/2015/07/update-linux-kernel-644x373.jpg?2c3c1f) + +目前的 [Linux 内核][1]的开发速度是前所未有的,大概每2到3个月就会有一个主要的版本发布。每个发布都带来几个的新的功能和改进,可以让很多人的处理体验更快、更有效率、或者其它的方面更好。 + +问题是,你不能在这些内核发布的时候就用它们,你要等到你的发行版带来新内核的发布。我们先前讲到[定期更新内核的好处][2],所以你不必等到那时。让我们来告诉你该怎么做。 + +> 免责声明: 我们先前的一些文章已经提到过,升级内核有(很小)的风险可能会破坏你系统。如果发生这种情况,通常可以通过使用旧内核来使系统保持工作,但是有时还是不行。因此我们对系统的任何损坏都不负责,你得自己承担风险! + +### 预备工作 ### + +要更新你的内核,你首先要确定你使用的是32位还是64位的系统。打开终端并运行: + + uname -a + +检查一下输出的是 x86\_64 还是 i686。如果是 x86\_64,你就运行64位的版本,否则就运行32位的版本。千万记住这个,这很重要。 + +![](http://cdn.makeuseof.com/wp-content/uploads/2015/07/linux_kernel_arch.jpg?2c3c1f) + +接下来,访问[官方的 Linux 内核网站][3],它会告诉你目前稳定内核的版本。愿意的话,你可以尝试下发布预选版(RC),但是这比稳定版少了很多测试。除非你确定想要需要发布预选版,否则就用稳定内核。 + +![](http://cdn.makeuseof.com/wp-content/uploads/2015/07/kernel_latest_version.jpg?2c3c1f) + +### Ubuntu 指导 ### + +对 Ubuntu 及其衍生版的用户而言升级内核非常简单,这要感谢 Ubuntu 主线内核 PPA。虽然,官方把它叫做 PPA,但是你不能像其他 PPA 一样将它添加到你软件源列表中,并指望它自动升级你的内核。实际上,它只是一个简单的网页,你应该浏览并下载到你想要的内核。 + +![](http://cdn.makeuseof.com/wp-content/uploads/2015/07/ubuntu_new_kernels.jpg?2c3c1f) + +现在,访问这个[内核 PPA 网页][4],并滚到底部。列表的最下面会含有最新发布的预选版本(你可以在名字中看到“rc”字样),但是这上面就可以看到最新的稳定版(说的更清楚些,本文写作时最新的稳定版是4.1.2。LCTT 译注:这里虽然 4.1.2 是当时的稳定版,但是由于尚未进入 Ubuntu 发行版中,所以文件夹名称为“-unstable”)。点击文件夹名称,你会看到几个选择。你需要下载 3 个文件并保存到它们自己的文件夹中(如果你喜欢的话可以放在下载文件夹中),以便它们与其它文件相隔离: + +1. 针对架构的含“generic”(通用)的头文件(我这里是64位,即“amd64”) +2. 放在列表中间,在文件名末尾有“all”的头文件 +3. 针对架构的含“generic”内核文件(再说一次,我会用“amd64”,但是你如果用32位的,你需要使用“i686”) + +你还可以在下面看到含有“lowlatency”(低延时)的文件。但最好忽略它们。这些文件相对不稳定,并且只为那些通用文件不能满足像音频录制这类任务想要低延迟的人准备的。再说一次,首选通用版,除非你有特定的任务需求不能很好地满足。一般的游戏和网络浏览不是使用低延时版的借口。 + +你把它们放在各自的文件夹下,对么?现在打开终端,使用`cd`命令切换到新创建的文件夹下,如 + + cd /home/user/Downloads/Kernel + +接着运行: + + sudo dpkg -i *.deb + +这个命令会标记文件夹中所有的“.deb”文件为“待安装”,接着执行安装。这是推荐的安装方法,因为不可以很简单地选择一个文件安装,它总会报出依赖问题。这这样一起安装就可以避免这个问题。如果你不清楚`cd`和`sudo`是什么。快速地看一下 [Linux 基本命令][5]这篇文章。 + +![](http://cdn.makeuseof.com/wp-content/uploads/2015/07/ubuntu_install_kernel.jpg?2c3c1f) + +安装完成后,**重启**你的系统,这时应该就会运行刚安装的内核了!你可以在命令行中使用`uname -a`来检查输出。 + +### Fedora 指导 ### + +如果你使用的是 Fedora 或者它的衍生版,过程跟 Ubuntu 很类似。不同的是文件获取的位置不同,安装的命令也不同。 + +![](http://cdn.makeuseof.com/wp-content/uploads/2015/07/fedora_new_kernels.jpg?2c3c1f) + +查看 [最新 Fedora 内核构建][6]列表。选取列表中最新的稳定版并翻页到下面选择 i686 或者 x86_64 版。这取决于你的系统架构。这时你需要下载下面这些文件并保存到它们对应的目录下(比如“Kernel”到下载目录下): + +- kernel +- kernel-core +- kernel-headers +- kernel-modules +- kernel-modules-extra +- kernel-tools +- perf 和 python-perf (可选) + +如果你的系统是 i686(32位)同时你有 4GB 或者更大的内存,你需要下载所有这些文件的 PAE 版本。PAE 是用于32位系统上的地址扩展技术,它允许你使用超过 3GB 的内存。 + +现在使用`cd`命令进入文件夹,像这样 + + cd /home/user/Downloads/Kernel + +接着运行下面的命令来安装所有的文件 + + yum --nogpgcheck localinstall *.rpm + +最后**重启**你的系统,这样你就可以运行新的内核了! + +#### 使用 Rawhide #### + +另外一个方案是,Fedora 用户也可以[切换到 Rawhide][7],它会自动更新所有的包到最新版本,包括内核。然而,Rawhide 经常会破坏系统(尤其是在早期的开发阶段中),它**不应该**在你日常使用的系统中用。 + +### Arch 指导 ### + +[Arch 用户][8]应该总是使用的是最新和最棒的稳定版(或者相当接近的版本)。如果你想要更接近最新发布的稳定版,你可以启用测试库提前2到3周获取到主要的更新。 + +要这么做,用[你喜欢的编辑器][9]以`sudo`权限打开下面的文件 + + /etc/pacman.conf + +接着取消注释带有 testing 的三行(删除行前面的#号)。如果你启用了 multilib 仓库,就把 multilib-testing 也做相同的事情。如果想要了解更多参考[这个 Arch 的 wiki 界面][10]。 + +升级内核并不简单(有意这么做的),但是这会给你带来很多好处。只要你的新内核不会破坏任何东西,你可以享受它带来的性能提升,更好的效率,更多的硬件支持和潜在的新特性。尤其是你正在使用相对较新的硬件时,升级内核可以帮助到你。 + + +**怎么升级内核这篇文章帮助到你了么?你认为你所喜欢的发行版对内核的发布策略应该是怎样的?**。在评论栏让我们知道! + +-------------------------------------------------------------------------------- + +via: http://www.makeuseof.com/tag/update-linux-kernel-improved-system-performance/ + +作者:[Danny Stieben][a] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.makeuseof.com/tag/author/danny/ +[1]:http://www.makeuseof.com/tag/linux-kernel-explanation-laymans-terms/ +[2]:http://www.makeuseof.com/tag/5-reasons-update-kernel-linux/ +[3]:http://www.kernel.org/ +[4]:http://kernel.ubuntu.com/~kernel-ppa/mainline/ +[5]:http://www.makeuseof.com/tag/an-a-z-of-linux-40-essential-commands-you-should-know/ +[6]:http://koji.fedoraproject.org/koji/packageinfo?packageID=8 +[7]:http://www.makeuseof.com/tag/bleeding-edge-linux-fedora-rawhide/ +[8]:http://www.makeuseof.com/tag/arch-linux-letting-you-build-your-linux-system-from-scratch/ +[9]:http://www.makeuseof.com/tag/nano-vs-vim-terminal-text-editors-compared/ +[10]:https://wiki.archlinux.org/index.php/Pacman#Repositories diff --git a/translated/tech/20150728 How to Update Linux Kernel for Improved System Performance.md b/translated/tech/20150728 How to Update Linux Kernel for Improved System Performance.md deleted file mode 100644 index 2114549452..0000000000 --- a/translated/tech/20150728 How to Update Linux Kernel for Improved System Performance.md +++ /dev/null @@ -1,129 +0,0 @@ -如何更新Linux内核提升系统性能 -================================================================================ -![](http://cdn.makeuseof.com/wp-content/uploads/2015/07/update-linux-kernel-644x373.jpg?2c3c1f) - -[Linux内核][1]内核的开发速度目前是空前,大概每2到3个月就会有一个主要的版本发布。每个发布都带来让很多人的计算更加快、更加有效率、或者更好的功能和提升。 - -问题是你不能在这些内核发布的时候就用它们-你要等到你的发行版带来新内核的发布。我们先前发布了[定期更新内核的好处][2],你不必等到那时。我们会向你展示该怎么做。 - -> 免责声明: 我们先前的一些文章已经提到过,升级内核会带来(很小的)破坏你系统的风险。在这种情况下,通常可以通过旧内核来使系统工作,但是有时还是不行。因此我们对系统的任何损坏都不负责-你自己承担风险! - -### 预备工作 ### - -![](http://cdn.makeuseof.com/wp-content/uploads/2015/07/linux_kernel_arch.jpg?2c3c1f) - -要更新你的内核,你首先要确定你使用的是32位还是64位的系统。打开终端并运行: - - uname -a - -检查一下输出的是x86_64还是i686。如果是x86_64,你就运行64位的版本,否则就运行32位的版本。记住这个因为这个很重要。 - -![](http://cdn.makeuseof.com/wp-content/uploads/2015/07/kernel_latest_version.jpg?2c3c1f) - -接下来,访问[官方Linux内核网站][3],它会告诉你目前稳定内核的版本。如果你喜欢你可以尝试发布预选版,但是这比稳定版少了很多测试。除非你确定想要用发布预选版否则就用稳定内核。 - -### Ubuntu指导 ### - -对Ubuntu及其衍生版的用户而言升级内核非常简单,这要感谢Ubuntu主线内核PPA。虽然,官方称为一个PPA。但是你不能像其他PPA一样用来添加它到你软件源列表中,并指望它自动升级你的内核。而它只是一个简单的网页,你可以下载到你想要的内核。 - -![](http://cdn.makeuseof.com/wp-content/uploads/2015/07/ubuntu_new_kernels.jpg?2c3c1f) - -现在,访问[内核PPA网页][4],并滚到底部。列表的最下面会含有最新发布的预选版本(你可以在名字中看到“rc”字样),但是这上面就可以看到最新的稳定版(为了更容易地解释这个,这时最新的稳定版是4.1.2)。点击它,你会看到几个选项。你需要下载3个文件并保存到各自的文件夹中(如果你喜欢的话可以在下载文件夹中),这样就可以将它们相互隔离了: - -- 针对架构的含“generic”的头文件(我这里是64位或者“amd64”) -- 中间的头文件在文件名末尾有“all” -- 针对架构的含“generic”内核文件(再说一次,我会用“amd64”,但是你如果用32位的,你需要使用“i686”) - -你会看到还有含有“lowlatency”的文件可以下面。但最好忽略它们。这些文件相对不稳定,并且只为那些通用文件不能满足像录音这类任务想要低延迟的人准备的。再说一次,首选通用版除非你特定的任务需求不能很好地满足。一般的游戏和网络浏览不是使用低延时版的借口。 - -![](http://cdn.makeuseof.com/wp-content/uploads/2015/07/ubuntu_install_kernel.jpg?2c3c1f) - -你把它们放在各自的文件夹下,对么?现在打开终端,使用 - - cd - -命令到新创建的文件夹下,像 - - cd /home/user/Downloads/Kernel - -接着运行: - - sudo dpkg -i *.deb - -这个命令会标记所有文件夹的“.deb”文件为“待安装”,接着执行安装。这是推荐的安装放大,因为除非可以很简单地选择一个文件安装,它总会报出依赖问题。这个方法可以避免这个问题。如果你不清楚cd和sudo是什么。快速地看一下[Linux基本命令][5]这篇文章。 - -安装完成后,**重启**你的系统,这时应该就会运行刚安装的内核了!你可以在命令行中使用uname -a来检查输出。 - -### Fedora指导 ### - -如果你使用的是Fedora或者它的衍生版,过程跟Ubuntu很类似。不同的是文件获取的位置不同,安装的命令也不同。 - -![](http://cdn.makeuseof.com/wp-content/uploads/2015/07/fedora_new_kernels.jpg?2c3c1f) - -查看[Fedora最新内核编译][6]列表。选取列表中最新的稳定版并滚到下面选择i686或者x86_64版。这依赖于你的系统架构。这时你需要下载下面这些文件并保存到它们对应的目录下(比如“Kernel”到下载目录下): - -- kernel -- kernel-core -- kernel-headers -- kernel-modules -- kernel-modules-extra -- kernel-tools -- perf and python-perf (optional) - -如果你的系统是i686(32位)同时你有4GB或者更大的内存,你需要下载所有这些文件的PAE版本。PAE是用于32位的地址扩展技术上,它允许你使用3GB的内存。 - -现在使用 - - cd - -命令进入文件夹,像这样 - - cd /home/user/Downloads/Kernel - -and then run the following command to install all the files: -接着运行下面的命令来安装所有的文件 - - yum --nogpgcheck localinstall *.rpm - -最后**重启**你的系统,这样你就可以运行新的内核了! - -### 使用 Rawhide ### - -另外一个方案是,Fedora用户也可以[切换到Rawhide][7],它会自动更新所有的包到最新版本,包括内核。然而,Rawhide经常会破坏系统(尤其是在早期的开发版中),它**不应该**在你日常使用的系统中用。 - -### Arch指导 ### - -[Arch][8]应该总是使用的是最新和最棒的稳定版(或者相当接近的版本)。如果你想要更接近最新发布的稳定版,你可以启用测试库提前2到3周获取到主要的更新。 - -要这么做,用[你喜欢的编辑器][9]以sudo权限打开下面的文件 - - /etc/pacman.conf - -接着取消注释带有testing的三行(删除行前面的井号)。如果你想要启用multilib仓库,就把multilib-testing也做相同的事情。如果想要了解更多参考[这个Arch的wiki界面][10]。 - -升级内核并不简单(有意这么做),但是这会给你带来很多好处。只要你的新内核不会破坏任何东西,你可以享受它带来的性能提升,更好的效率,支持更多的硬件和潜在的新特性。尤其是你正在使用相对更新的硬件,升级内核可以帮助到它。 - - -**怎么升级内核这篇文章帮助到你了么?你认为你所喜欢的发行版对内核的发布策略应该是怎样的?**。在评论栏让我们知道! - --------------------------------------------------------------------------------- - -via: http://www.makeuseof.com/tag/update-linux-kernel-improved-system-performance/ - -作者:[Danny Stieben][a] -译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.makeuseof.com/tag/author/danny/ -[1]:http://www.makeuseof.com/tag/linux-kernel-explanation-laymans-terms/ -[2]:http://www.makeuseof.com/tag/5-reasons-update-kernel-linux/ -[3]:http://www.kernel.org/ -[4]:http://kernel.ubuntu.com/~kernel-ppa/mainline/ -[5]:http://www.makeuseof.com/tag/an-a-z-of-linux-40-essential-commands-you-should-know/ -[6]:http://koji.fedoraproject.org/koji/packageinfo?packageID=8 -[7]:http://www.makeuseof.com/tag/bleeding-edge-linux-fedora-rawhide/ -[8]:http://www.makeuseof.com/tag/arch-linux-letting-you-build-your-linux-system-from-scratch/ -[9]:http://www.makeuseof.com/tag/nano-vs-vim-terminal-text-editors-compared/ -[10]:https://wiki.archlinux.org/index.php/Pacman#Repositories From 29c2cfb01350f3960ca314df890fc8a3308f8e30 Mon Sep 17 00:00:00 2001 From: wxy Date: Sat, 15 Aug 2015 01:24:33 +0800 Subject: [PATCH 924/965] PUB:20150813 Ubuntu Want To Make It Easier For You To Install The Latest Nvidia Linux Driver @GOLinux --- ... Install The Latest Nvidia Linux Driver.md | 63 +++++++++++++++++++ ... Install The Latest Nvidia Linux Driver.md | 63 ------------------- 2 files changed, 63 insertions(+), 63 deletions(-) create mode 100644 published/20150813 Ubuntu Want To Make It Easier For You To Install The Latest Nvidia Linux Driver.md delete mode 100644 translated/tech/20150813 Ubuntu Want To Make It Easier For You To Install The Latest Nvidia Linux Driver.md diff --git a/published/20150813 Ubuntu Want To Make It Easier For You To Install The Latest Nvidia Linux Driver.md b/published/20150813 Ubuntu Want To Make It Easier For You To Install The Latest Nvidia Linux Driver.md new file mode 100644 index 0000000000..37d106b69f --- /dev/null +++ b/published/20150813 Ubuntu Want To Make It Easier For You To Install The Latest Nvidia Linux Driver.md @@ -0,0 +1,63 @@ +Ubuntu 有望让你安装最新 Nvidia Linux 驱动更简单 +================================================================================ +![Ubuntu Gamers are on the rise -and so is demand for the latest drivers](http://www.omgubuntu.co.uk/wp-content/uploads/2014/03/ubuntugamer_logo_dark-500x250.jpg) + +*Ubuntu 上的游戏玩家在增长——因而需要最新版驱动* + +**在 Ubuntu 上安装上游的 NVIDIA 图形驱动即将变得更加容易。** + +Ubuntu 开发者正在考虑构建一个全新的'官方' PPA,以便为桌面用户分发最新的闭源 NVIDIA 二进制驱动。 + +该项改变会让 Ubuntu 游戏玩家收益,并且*不会*给其它人造成 OS 稳定性方面的风险。 + +**仅**当用户明确选择它时,新的上游驱动将通过这个新 PPA 安装并更新。其他人将继续得到并使用更近的包含在 Ubuntu 归档中的稳定版 NVIDIA Linux 驱动快照。 + +### 为什么需要该项目? ### + +![Ubuntu provides drivers – but they’re not the latest](http://www.omgubuntu.co.uk/wp-content/uploads/2013/04/drivers.jpg) + +*Ubuntu 提供了驱动——但是它们不是最新的* + +可以从归档中(使用命令行、synaptic,或者通过额外驱动工具)安装到 Ubuntu 上的闭源 NVIDIA 图形驱动在大多数情况下都能工作得很好,并且可以轻松地处理 Unity 桌面外壳的混染。 + +但对于游戏需求而言,那完全是另外一码事儿。 + +如果你想要将最高帧率和 HD 纹理从最新流行的 Steam 游戏中压榨出来,你需要最新的二进制驱动文件。 + +驱动越新,越可能支持最新的特性和技术,或者带有预先打包的游戏专门的优化和漏洞修复。 + +问题在于,在 Ubuntu 上安装最新 Nvidia Linux 驱动不是件容易的事儿,而且也不具安全保证。 + +要填补这个空白,许多由热心人维护的第三方 PPA 就出现了。由于许多这些 PPA 也发布了其它实验性的或者前沿软件,它们的使用**并不是毫无风险的**。添加一个前沿的 PPA 通常是搞崩整个系统的最快的方式! + +一个解决方法是,让 Ubuntu 用户安装最新的专有图形驱动以满足对第三方 PPA 的需要,**但是**提供一个安全机制,如果有需要,你可以回滚到稳定版本。 + +### ‘对全新驱动的需求难以忽视’ ### + +> '一个让Ubuntu用户安全地获得最新硬件驱动的解决方案出现了。' + +‘在快速发展的市场中,对全新驱动的需求正变得难以忽视,用户将想要最新的上游软件,’卡斯特罗在一封给 Ubuntu 桌面邮件列表的电子邮件中解释道。 + +‘[NVIDIA] 可以毫不费力为 [Windows 10] 用户带来了不起的体验。直到我们可以说服 NVIDIA 在 Ubuntu 中做了同样的工作,这样我们就可以搞定这一切了。’ + +卡斯特罗的“官方的” NVIDIA PPA 方案就是最实现这一目的的最容易的方式。 + +游戏玩家将可以在 Ubuntu 的默认专有软件驱动工具中选择接收来自该 PPA 的新驱动,再也不需要它们从网站或维基页面拷贝并粘贴终端命令了。 + +该 PPA 内的驱动将由一个选定的社区成员组成的团队打包并维护,并受惠于一个名为**自动化测试**的半官方方式。 + +就像卡斯特罗自己说的那样:'人们想要最新的闪光的东西,而不管他们想要做什么。我们也许也要在其周围放置一个框架,因此人们可以获得他们所想要的,而不必破坏他们的计算机。' + +**你想要使用这个 PPA 吗?你怎样来评估 Ubuntu 上默认 Nvidia 驱动的性能呢?在评论中分享你的想法吧,伙计们!** + +-------------------------------------------------------------------------------- + +via: http://www.omgubuntu.co.uk/2015/08/ubuntu-easy-install-latest-nvidia-linux-drivers + +作者:[Joey-Elijah Sneddon][a] +译者:[GOLinux](https://github.com/GOLinux) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://plus.google.com/117485690627814051450/?rel=author diff --git a/translated/tech/20150813 Ubuntu Want To Make It Easier For You To Install The Latest Nvidia Linux Driver.md b/translated/tech/20150813 Ubuntu Want To Make It Easier For You To Install The Latest Nvidia Linux Driver.md deleted file mode 100644 index bf24d3e5c2..0000000000 --- a/translated/tech/20150813 Ubuntu Want To Make It Easier For You To Install The Latest Nvidia Linux Driver.md +++ /dev/null @@ -1,63 +0,0 @@ -Ubuntu想要让你安装最新版Nvidia Linux驱动更简单 -================================================================================ -![Ubuntu Gamers are on the rise -and so is demand for the latest drivers](http://www.omgubuntu.co.uk/wp-content/uploads/2014/03/ubuntugamer_logo_dark-500x250.jpg) -Ubuntu游戏在增长——因而需要最新版驱动 - -**Ubuntu上安装上游NVIDIA图形驱动即将变得更加容易。** - -Ubuntu开发者正在考虑构建一个全新的'官方'PPA,以便为桌面用户分发最新的闭源NVIDIA二进制驱动。 - -该项运动将使得Ubuntu游戏玩家收益,并且**不会**给其它人造成OS稳定性方面的风险。 - -新的上游驱动将通过该新PPA安装并更新,**只有**在用户明确选择它。其他人将继续接收并使用更近的包含在Ubuntu归档中的稳定版NVIDIA Linux驱动快照。 - -### 为什么需要该项目? ### - -![Ubuntu provides drivers – but they’re not the latest](http://www.omgubuntu.co.uk/wp-content/uploads/2013/04/drivers.jpg) -Ubuntu提供了驱动——但是它们不是最新的 - -可以从归档中(使用命令行、synaptic,或者通过额外驱动工具)安装到Ubuntu上的闭源NVIDIA图形驱动在大多数情况下都能工作得很好,并且可以轻松地处理混合Unity桌面shell。 - -对于游戏需求而言,那完全是另外一码事儿。 - -如果你想要将所有最后帧和HD纹理从最新的大游戏Steam游戏中挤压出来,你需要最新的二进制驱动对象。 - -> '安装最新Nvidia Linux驱动到Ubuntu不是件容易的事儿,而且也不具安全保证。' - -驱动越新,越可能支持最新的特性和技术,或者预先打包好了游戏专门优化和漏洞修复。 - -问题在于安装最新的Nvidia Linux驱动到Ubuntu上不是件容易的事儿,也没有安全保证。 - -要填补空白,许多由热心人维护的第三方PPA就出现了。由于许多这些PPA也发布了其它实验性的或者前沿软件,它们的使用**没有风险**。添加一个前沿的PPA通常是最快的方式,以完全满足系统需要! - -一个让Ubuntu用户安装作为第三方PPA提供最新专有图形驱动解决方案就十分需要了,**但是**提供了一个安全机制,如果有需要,你可以回滚到稳定版本。 - -### ‘对全新驱动的需求难以忽视’ ### - -> '一个让Ubuntu用户安全地获得最新硬件驱动的解决方案出现了。' - -'在快速开发市场中,对全新驱动的需求正变得难以忽视,用户将想要最新的上游软件,'卡斯特罗在一封给Ubuntu桌面邮件列表的电子邮件中解释道。 - -'[NVIDIA]可以分发一个了不起的体验,几乎像[Windows 10]用户那样毫不费力。直到我们可以证实NVIDIA在Ubuntu中做了同样的工作,我们就可以收拾残局了。' - -卡斯特罗关于一个“神圣的”NVIDIA PPA命题就是最实现这一目的的最容易的方式。 - -游戏玩家将可以在Ubuntu的默认专有软件驱动工具中选择接收来自该PPA的新驱动——不需要它们从网站或维基页面拷贝并粘贴终端命令了。 - -该PPA内的驱动将由一个选定的社区成员组成的团队打包并维护,并从一个名为**自动化测试**的半官方选项受惠。 - -就像卡斯特罗自己说的那样:'人们想要最新的闪光的东西,不管他们想要做什么。我们也许也要在其周围放置一个框架,因此人们可以获得他们所想要的,而不必破坏他们的计算机。' - -**你想要使用这个PPA吗?你怎样来评估Ubuntu上默认Nvidia驱动的性能呢?在评论中分享你的想法吧,伙计们!** - --------------------------------------------------------------------------------- - -via: http://www.omgubuntu.co.uk/2015/08/ubuntu-easy-install-latest-nvidia-linux-drivers - -作者:[Joey-Elijah Sneddon][a] -译者:[GOLinux](https://github.com/GOLinux) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://plus.google.com/117485690627814051450/?rel=author From aa0754b2b1578f65ba69065fb6b3b2ffb3db9a51 Mon Sep 17 00:00:00 2001 From: wxy Date: Sat, 15 Aug 2015 01:40:34 +0800 Subject: [PATCH 925/965] PUB:20150811 How to download apk files from Google Play Store on Linux @FSSlc --- ...k files from Google Play Store on Linux.md | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) rename {translated/tech => published}/20150811 How to download apk files from Google Play Store on Linux.md (67%) diff --git a/translated/tech/20150811 How to download apk files from Google Play Store on Linux.md b/published/20150811 How to download apk files from Google Play Store on Linux.md similarity index 67% rename from translated/tech/20150811 How to download apk files from Google Play Store on Linux.md rename to published/20150811 How to download apk files from Google Play Store on Linux.md index 670c0f331b..615dcca7c2 100644 --- a/translated/tech/20150811 How to download apk files from Google Play Store on Linux.md +++ b/published/20150811 How to download apk files from Google Play Store on Linux.md @@ -1,14 +1,15 @@ -如何在 Linux 中从 Google Play 商店里下载 apk 文件 +如何在 Linux 上从 Google Play 商店里下载 apk 文件 ================================================================================ -假设你想在你的 Android 设备中安装一个 Android 应用,然而由于某些原因,你不能在 Andor 设备上访问 Google Play 商店。接着你该怎么做呢?在不访问 Google Play 商店的前提下安装应用的一种可能的方法是使用其他的手段下载该应用的 APK 文件,然后手动地在 Android 设备上 [安装 APK 文件][1]。 -在非 Android 设备如常规的电脑和笔记本电脑上,有着几种方式来从 Google Play 商店下载到官方的 APK 文件。例如,使用浏览器插件(例如, 针对 [Chrome][2] 或针对 [Firefox][3] 的插件) 或利用允许你使用浏览器下载 APK 文件的在线的 APK 存档等。假如你不信任这些闭源的插件或第三方的 APK 仓库,这里有另一种手动下载官方 APK 文件的方法,它使用一个名为 [GooglePlayDownloader][4] 的开源 Linux 应用。 +假设你想在你的 Android 设备中安装一个 Android 应用,然而由于某些原因,你不能在 Andord 设备上访问 Google Play 商店(LCTT 译注:显然这对于我们来说是常态)。接着你该怎么做呢?在不访问 Google Play 商店的前提下安装应用的一种可能的方法是,使用其他的手段下载该应用的 APK 文件,然后手动地在 Android 设备上 [安装 APK 文件][1]。 -GooglePlayDownloader 是一个基于 Python 的 GUI 应用,使得你可以从 Google Play 商店上搜索和下载 APK 文件。由于它是完全开源的,你可以放心地使用它。在本篇教程中,我将展示如何在 Linux 环境下,使用 GooglePlayDownloader 来从 Google Play 商店下载 APK 文件。 +在非 Android 设备如常规的电脑和笔记本电脑上,有着几种方式来从 Google Play 商店下载到官方的 APK 文件。例如,使用浏览器插件(例如,针对 [Chrome][2] 或针对 [Firefox][3] 的插件) 或利用允许你使用浏览器下载 APK 文件的在线的 APK 存档等。假如你不信任这些闭源的插件或第三方的 APK 仓库,这里有另一种手动下载官方 APK 文件的方法,它使用一个名为 [GooglePlayDownloader][4] 的开源 Linux 应用。 + +GooglePlayDownloader 是一个基于 Python 的 GUI 应用,它可以让你从 Google Play 商店上搜索和下载 APK 文件。由于它是完全开源的,你可以放心地使用它。在本篇教程中,我将展示如何在 Linux 环境下,使用 GooglePlayDownloader 来从 Google Play 商店下载 APK 文件。 ### Python 需求 ### -GooglePlayDownloader 需要使用 Python 中 SSL 模块的扩展 SNI(服务器名称指示) 来支持 SSL/TLS 通信,该功能由 Python 2.7.9 或更高版本带来。这使得一些旧的发行版本如 Debian 7 Wheezy 及早期版本,Ubuntu 14.04 及早期版本或 CentOS/RHEL 7 及早期版本均不能满足该要求。假设你已经有了一个带有 Python 2.7.9 或更高版本的发行版本,可以像下面这样接着安装 GooglePlayDownloader。 +GooglePlayDownloader 需要使用带有 SNI(Server Name Indication 服务器名称指示)的 Python 来支持 SSL/TLS 通信,该功能由 Python 2.7.9 或更高版本引入。这使得一些旧的发行版本如 Debian 7 Wheezy 及早期版本,Ubuntu 14.04 及早期版本或 CentOS/RHEL 7 及早期版本均不能满足该要求。这里假设你已经有了一个带有 Python 2.7.9 或更高版本的发行版本,可以像下面这样接着安装 GooglePlayDownloader。 ### 在 Ubuntu 上安装 GooglePlayDownloader ### @@ -16,7 +17,7 @@ GooglePlayDownloader 需要使用 Python 中 SSL 模块的扩展 SNI(服务器 #### 在 Ubuntu 14.10 上 #### -下载 [python-ndg-httpsclient][5] deb 软件包,这在旧一点的 Ubuntu 发行版本中是一个缺失的依赖。同时还要下载 GooglePlayDownloader 的官方 deb 软件包。 +下载 [python-ndg-httpsclient][5] deb 软件包,这是一个较旧的 Ubuntu 发行版本中缺失的依赖。同时还要下载 GooglePlayDownloader 的官方 deb 软件包。 $ wget http://mirrors.kernel.org/ubuntu/pool/main/n/ndg-httpsclient/python-ndg-httpsclient_0.3.2-1ubuntu4_all.deb $ wget http://codingteam.net/project/googleplaydownloader/download/file/googleplaydownloader_1.7-1_all.deb @@ -64,7 +65,7 @@ GooglePlayDownloader 需要使用 Python 中 SSL 模块的扩展 SNI(服务器 ### 使用 GooglePlayDownloader 从 Google Play 商店下载 APK 文件 ### -一旦你安装好 GooglePlayDownloader 后,你就可以像下面那样从 Google Play 商店下载 APK 文件。 +一旦你安装好 GooglePlayDownloader 后,你就可以像下面那样从 Google Play 商店下载 APK 文件。(LCTT 译注:显然你需要让你的 Linux 能爬梯子) 首先通过输入下面的命令来启动该应用: @@ -76,7 +77,7 @@ GooglePlayDownloader 需要使用 Python 中 SSL 模块的扩展 SNI(服务器 ![](https://farm1.staticflickr.com/503/20230360479_925f5da613_b.jpg) -一旦你从搜索列表中找到了该应用,就选择该应用,接着点击 "下载选定的 APK 文件" 按钮。最后你将在你的家目录中找到下载的 APK 文件。现在,你就可以将下载到的 APK 文件转移到你所选择的 Android 设备上,然后手动安装它。 +一旦你从搜索列表中找到了该应用,就选择该应用,接着点击 “下载选定的 APK 文件” 按钮。最后你将在你的家目录中找到下载的 APK 文件。现在,你就可以将下载到的 APK 文件转移到你所选择的 Android 设备上,然后手动安装它。 希望这篇教程对你有所帮助。 @@ -86,7 +87,7 @@ via: http://xmodulo.com/download-apk-files-google-play-store.html 作者:[Dan Nanni][a] 译者:[FSSlc](https://github.com/FSSlc) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From eaf4b2444bbff4896171b0e4dbdef671d9435a52 Mon Sep 17 00:00:00 2001 From: XIAOYU <1136299502@qq.com> Date: Sat, 15 Aug 2015 09:58:49 +0800 Subject: [PATCH 926/965] translated translated --- ...urce RSS News Ticker for Linux Desktops.md | 93 +++++++++---------- 1 file changed, 46 insertions(+), 47 deletions(-) diff --git a/sources/share/20150610 Tickr Is An Open-Source RSS News Ticker for Linux Desktops.md b/sources/share/20150610 Tickr Is An Open-Source RSS News Ticker for Linux Desktops.md index ccbbd3abd8..d7bb0e425b 100644 --- a/sources/share/20150610 Tickr Is An Open-Source RSS News Ticker for Linux Desktops.md +++ b/sources/share/20150610 Tickr Is An Open-Source RSS News Ticker for Linux Desktops.md @@ -1,94 +1,93 @@ -translating by xiaoyu33 - -Tickr Is An Open-Source RSS News Ticker for Linux Desktops +Trickr:一个开源的Linux桌面RSS新闻速递 ================================================================================ ![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/05/rss-tickr.jpg) -**Latest! Latest! Read all about it!** +**最新的!最新的!阅读关于它的一切!** -Alright, so the app we’re highlighting today isn’t quite the binary version of an old newspaper seller — but it is a great way to have the latest news brought to you, on your desktop. +好了,所以我们今天要强调的应用程序不是相当于旧报纸的二进制版本—而是它会以一个伟大的方式,将最新的新闻推送到你的桌面上。 -Tick is a GTK-based news ticker for the Linux desktop that scrolls the latest headlines and article titles from your favourite RSS feeds in horizontal strip that you can place anywhere on your desktop. +Tick是一个基于GTK的Linux桌面新闻速递,能够在水平带滚动显示最新头条新闻,以及你最爱的RSS资讯文章标题,当然你可以放置在你桌面的任何地方。 -Call me Joey Calamezzo; I put mine on the bottom TV news station style. +请叫我Joey Calamezzo;我把我的放在底部,有电视新闻台的风格。 -“Over to you, sub-heading.” +“到你了,子标题” -### RSS — Remember That? ### +### RSS -还记得吗? ### -“Thanks paragraph ending.” +“谢谢段落结尾。” -In an era of push notifications, social media, and clickbait, cajoling us into reading the latest mind-blowing, humanity saving listicle ASAP, RSS can seem a bit old hat. +在一个推送通知,社交媒体,以及点击诱饵的时代,哄骗我们阅读最新的令人惊奇的,人人都爱读的清单,RSS看起来有一点过时了。 -For me? Well, RSS lives up to its name of Really Simple Syndication. It’s the easiest, most manageable way to have news come to me. I can manage and read stuff when I want; there’s no urgency to view lest the tweet vanish into the stream or the push notification vanish. +对我来说?恩,RSS是名副其实的真正简单的聚合。这是将消息通知给我的最简单,最易于管理的方式。我可以在我愿意的时候,管理和阅读一些东西;没必要匆忙的去看,以防这条微博消失在信息流中,或者推送通知消失。 -The beauty of Tickr is in its utility. You can have a constant stream of news trundling along the bottom of your screen, which you can passively glance at from time to time. +tickr的美在于它的实用性。你可以不断地有新闻滚动在屏幕的底部,然后不时地瞥一眼。 ![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/05/tickr-close-up-750x58.jpg) -There’s no pressure to ‘read’ or ‘mark all read’ or any of that. When you see something you want to read you just click it to open it in a web browser. +你不会有“阅读”或“标记所有为已读”的压力。当你看到一些你想读的东西,你只需点击它,将它在Web浏览器中打开。 -### Setting it Up ### +### 开始设置 ### ![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/05/tickr-rss-settings.jpg) -Although Tickr is available to install from the Ubuntu Software Centre it hasn’t been updated for a long time. Nowhere is this sense of abandonment more keenly felt than when opening the unwieldy and unintuitive configuration panel. +尽管虽然tickr可以从Ubuntu软件中心安装,然而它已经很久没有更新了。当你打开笨拙的不直观的控制面板的时候,没有什么能够比这更让人感觉被遗弃的了。 -To open it: +打开它: -1. Right click on the Tickr bar -1. Go to Edit > Preferences -1. Adjust the various settings +1. 右键单击tickr条 +1. 转至编辑>首选项 +1. 调整各种设置 -Row after row of options and settings, few of which seem to make sense at first. But poke and prod around and you’ll controls for pretty much everything, including: +选项和设置行的后面,有些似乎是容易理解的。但是知己知彼你能够几乎掌控一切,包括: -- Set scrolling speed -- Choose behaviour when mousing over -- Feed update frequency -- Font, including font sizes and color -- Separator character (‘delineator’) -- Position of Tickr on screen -- Color and opacity of Tickr bar -- Choose how many articles each feed displays +- 设置滚动速度 +- 选择鼠标经过时的行为 +- 资讯更新频率 +- 字体,包括字体大小和颜色 +- 分隔符(“delineator”) +- tickr在屏幕上的位置 +- tickr条的颜色和不透明度 +- 选择每种资讯显示多少文章 -One ‘quirk’ worth mentioning is that pressing the ‘Apply’ only updates the on-screen Tickr to preview changes. For changes to take effect when you exit the Preferences window you need to click ‘OK’. +有个值得一提的“怪癖”是,当你点击“应用”按钮,只会更新tickr的屏幕预览。当您退出“首选项”窗口时,请单击“确定”。 -Getting the bar to sit flush on your display can also take a fair bit of tweaking, especially on Unity. +想要滚动条在你的显示屏上水平显示,也需要公平一点的调整,特别是统一显示。 -Press the “full width button” to have the app auto-detect your screen width. By default when placed at the top or bottom it leaves a 25px gap (the app was created back in the days of GNOME 2.x desktops). After hitting the top or bottom buttons just add an extra 25 pixels to the input box compensate for this. +按下“全宽按钮”,能够让应用程序自动检测你的屏幕宽度。默认情况下,当放置在顶部或底部时,会留下25像素的间距(应用程序被创建在过去的GNOME2.x桌面)。只需添加额外的25像素到输入框,来弥补这个问题。 -Other options available include: choose which browser articles open in; whether Tickr appears within a regular window frame; whether a clock is shown; and how often the app checks feed for articles. +其他可供选择的选项包括:选择文章在哪个浏览器打开;tickr是否以一个常规的窗口出现; +是否显示一个时钟;以及应用程序多久检查一次文章资讯。 -#### Adding Feeds #### +#### 添加资讯 #### -Tickr comes with a built-in list of over 30 different feeds, ranging from technology blogs to mainstream news services. +tickr自带的有超过30种不同的资讯列表,从技术博客到主流新闻服务。 ![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/05/feed-picker-750x398.jpg) -You can select as many of these as you like to show headlines in the on screen ticker. If you want to add your own feeds you can: – +你可以选择很多你想在屏幕上显示的新闻提要。如果你想添加自己的资讯,你可以:— -1. Right click on the Tickr bar -1. Go to File > Open Feed -1. Enter Feed URL -1. Click ‘Add/Upd’ button -1. Click ‘OK (select)’ +1. 右键单击tickr条 +1. 转至文件>打开资讯 +1. 输入资讯网址 +1. 点击“添加/更新”按钮 +1. 单击“确定”(选择) -To set how many items from each feed shows in the ticker change the “Read N items max per feed” in the other preferences window. +如果想设置每个资讯在ticker中显示多少条文章,可以去另一个首选项窗口修改“每个资讯最大读取N条文章” -### Install Tickr in Ubuntu 14.04 LTS and Up ### +### 在Ubuntu 14.04 LTS或更高版本上安装Tickr ### -So that’s Tickr. It’s not going to change the world but it will keep you abreast of what’s happening in it. +在Ubuntu 14.04 LTS或更高版本上安装Tickr -To install it in Ubuntu 14.04 LTS or later head to the Ubuntu Software Centre but clicking the button below. +在Ubuntu 14.04 LTS或更高版本中安装,转到Ubuntu软件中心,但要点击下面的按钮。 -- [Click to install Tickr form the Ubuntu Software Center][1] +- [点击此处进入Ubuntu软件中心安装tickr][1] -------------------------------------------------------------------------------- via: http://www.omgubuntu.co.uk/2015/06/tickr-open-source-desktop-rss-news-ticker 作者:[Joey-Elijah Sneddon][a] -译者:[译者ID](https://github.com/译者ID) +译者:[xiaoyu33](https://github.com/xiaoyu33) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 6c69a46dc31c5ac42d88dee04c787b82d804d77b Mon Sep 17 00:00:00 2001 From: XIAOYU <1136299502@qq.com> Date: Sat, 15 Aug 2015 10:00:20 +0800 Subject: [PATCH 927/965] translated change the url --- ... Tickr Is An Open-Source RSS News Ticker for Linux Desktops.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/share/20150610 Tickr Is An Open-Source RSS News Ticker for Linux Desktops.md (100%) diff --git a/sources/share/20150610 Tickr Is An Open-Source RSS News Ticker for Linux Desktops.md b/translated/share/20150610 Tickr Is An Open-Source RSS News Ticker for Linux Desktops.md similarity index 100% rename from sources/share/20150610 Tickr Is An Open-Source RSS News Ticker for Linux Desktops.md rename to translated/share/20150610 Tickr Is An Open-Source RSS News Ticker for Linux Desktops.md From 8de21554f0dd6220e53f6d3cee738a5a4c40a372 Mon Sep 17 00:00:00 2001 From: geekpi Date: Sat, 15 Aug 2015 10:39:03 +0800 Subject: [PATCH 928/965] translating --- ...20150811 How to Install Snort and Usage in Ubuntu 15.04.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150811 How to Install Snort and Usage in Ubuntu 15.04.md b/sources/tech/20150811 How to Install Snort and Usage in Ubuntu 15.04.md index 7bf2438c95..96759a29e6 100644 --- a/sources/tech/20150811 How to Install Snort and Usage in Ubuntu 15.04.md +++ b/sources/tech/20150811 How to Install Snort and Usage in Ubuntu 15.04.md @@ -1,3 +1,5 @@ +translating----geekpi + How to Install Snort and Usage in Ubuntu 15.04 ================================================================================ Intrusion detection in a network is important for IT security. Intrusion Detection System used for the detection of illegal and malicious attempts in the network. Snort is well-known open source intrusion detection system. Web interface (Snorby) can be used for better analysis of alerts. Snort can be used as an intrusion prevention system with iptables/pf firewall. In this article, we will install and configure an open source IDS system snort. @@ -200,4 +202,4 @@ via: http://linoxide.com/security/install-snort-usage-ubuntu-15-04/ 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 [a]:http://linoxide.com/author/naveeda/ -[1]:https://www.snort.org/downloads/community/community-rules.tar.gz \ No newline at end of file +[1]:https://www.snort.org/downloads/community/community-rules.tar.gz From 1c9c7bcec0630789c0a7b3a8aeff64abfafddda2 Mon Sep 17 00:00:00 2001 From: geekpi Date: Sat, 15 Aug 2015 11:34:52 +0800 Subject: [PATCH 929/965] translating --- ...Install Snort and Usage in Ubuntu 15.04.md | 80 +++++++++---------- 1 file changed, 39 insertions(+), 41 deletions(-) diff --git a/sources/tech/20150811 How to Install Snort and Usage in Ubuntu 15.04.md b/sources/tech/20150811 How to Install Snort and Usage in Ubuntu 15.04.md index 96759a29e6..06fbfd62b8 100644 --- a/sources/tech/20150811 How to Install Snort and Usage in Ubuntu 15.04.md +++ b/sources/tech/20150811 How to Install Snort and Usage in Ubuntu 15.04.md @@ -1,56 +1,54 @@ -translating----geekpi - -How to Install Snort and Usage in Ubuntu 15.04 +在Ubuntu 15.04中如何安装和使用Snort ================================================================================ -Intrusion detection in a network is important for IT security. Intrusion Detection System used for the detection of illegal and malicious attempts in the network. Snort is well-known open source intrusion detection system. Web interface (Snorby) can be used for better analysis of alerts. Snort can be used as an intrusion prevention system with iptables/pf firewall. In this article, we will install and configure an open source IDS system snort. +对于IT安全而言入侵检测是一件非常重要的事。入侵检测系统用于检测网络中非法与恶意的请求。Snort是一款知名的开源入侵检测系统。Web界面(Snorby)可以用于更好地分析警告。Snort使用iptables/pf防火墙来作为入侵检测系统。本篇中,我们会安装并配置一个开源的IDS系统snort。 -### Snort Installation ### +### Snort 安装 ### -#### Prerequisite #### +#### 要求 #### -Data Acquisition library (DAQ) is used by the snort for abstract calls to packet capture libraries. It is available on snort website. Downloading process is shown in the following screenshot. +snort所使用的数据采集库(DAQ)用于抽象地调用采集库。这个在snort上就有。下载过程如下截图所示。 ![downloading_daq](http://blog.linoxide.com/wp-content/uploads/2015/07/downloading_daq.png) -Extract it and run ./configure, make and make install commands for DAQ installation. However, DAQ required other tools therefore ./configure script will generate following errors . +解压并运行./configure、make、make install来安装DAQ。然而,DAQ要求其他的工具,因此,./configure脚本会生成下面的错误。 -flex and bison error +flex和bison错误 ![flexandbison_error](http://blog.linoxide.com/wp-content/uploads/2015/07/flexandbison_error.png) -libpcap error. +libpcap错误 ![libpcap error](http://blog.linoxide.com/wp-content/uploads/2015/07/libpcap-error.png) -Therefore first install flex/bison and libcap before DAQ installation which is shown in the figure. +因此在安装DAQ之前先安装flex/bison和libcap。 ![install_flex](http://blog.linoxide.com/wp-content/uploads/2015/07/install_flex.png) -Installation of libpcap development library is shown below +如下所示安装libpcap开发库 ![libpcap-dev installation](http://blog.linoxide.com/wp-content/uploads/2015/07/libpcap-dev-installation.png) -After installation of necessary tools, again run ./configure script which will show following output. +安装完必要的工具后,再次运行./configure脚本,将会显示下面的输出。 ![without_error_configure](http://blog.linoxide.com/wp-content/uploads/2015/07/without_error_configure.png) -make and make install commands result is shown in the following screens. +make和make install 命令的结果如下所示。 ![make install](http://blog.linoxide.com/wp-content/uploads/2015/07/make-install.png) ![make](http://blog.linoxide.com/wp-content/uploads/2015/07/make.png) -After successful installation of DAQ, now we will install snort. Downloading using wget is shown in the below figure. +成功安装DAQ之后,我们现在安装snort。如下图使用wget下载它。 ![downloading_snort](http://blog.linoxide.com/wp-content/uploads/2015/07/downloading_snort.png) -Extract compressed package using below given command. +使用下面的命令解压安装包。 #tar -xvzf snort-2.9.7.3.tar.gz ![snort_extraction](http://blog.linoxide.com/wp-content/uploads/2015/07/snort_extraction.png) -Create installation directory and set prefix parameter in the configure script. It is also recommended to enable sourcefire flag for Packet Performance Monitoring (PPM). +创建安装目录并在脚本中设置prefix参数。同样也建议启用包性能监控(PPM)标志。 #mkdir /usr/local/snort @@ -58,21 +56,21 @@ Create installation directory and set prefix parameter in the configure script. ![snort_installation](http://blog.linoxide.com/wp-content/uploads/2015/07/snort_installation.png) -Configure script generates error due to missing libpcre-dev , libdumbnet-dev and zlib development libraries. +配置脚本由于缺少libpcre-dev、libdumbnet-dev 和zlib开发库而报错。 -error due to missing libpcre library. +配置脚本由于缺少libpcre库报错。 ![pcre-error](http://blog.linoxide.com/wp-content/uploads/2015/07/pcre-error.png) -error due to missing dnet (libdumbnet) library. +配置脚本由于缺少dnet(libdumbnet)库而报错。 ![libdnt error](http://blog.linoxide.com/wp-content/uploads/2015/07/libdnt-error.png) -configure script generate error due to missing zlib library. +配置脚本由于缺少zlib库而报错 ![zlib error](http://blog.linoxide.com/wp-content/uploads/2015/07/zlib-error.png) -Installation of all required development libraries is shown in the next screenshots. +如下所示,安装所有需要的开发库。 # aptitude install libpcre3-dev @@ -86,9 +84,9 @@ Installation of all required development libraries is shown in the next screensh ![zlibg-dev installation](http://blog.linoxide.com/wp-content/uploads/2015/07/zlibg-dev-installation.png) -After installation of above required libraries for snort, again run the configure scripts without any error. +安装完snort需要的库之后,再次运行配置脚本就不会报错了。 -Run make & make install commands for the compilation and installations of snort in /usr/local/snort directory. +运行make和make install命令在/usr/local/snort目录下完成安装。 #make @@ -98,22 +96,22 @@ Run make & make install commands for the compilation and installations of snort ![make install snort](http://blog.linoxide.com/wp-content/uploads/2015/07/make-install-snort.png) -Finally snort running from /usr/local/snort/bin directory. Currently it is in promisc mode (packet dump mode) of all traffic on eth0 interface. +最终snort在/usr/local/snort/bin中运行。现在它对eth0的所有流量都处在promisc模式(包转储模式)。 ![snort running](http://blog.linoxide.com/wp-content/uploads/2015/07/snort-running.png) -Traffic dump by the snort interface is shown in following figure. +如下图所示snort转储流量。 ![traffic](http://blog.linoxide.com/wp-content/uploads/2015/07/traffic1.png) -#### Rules and Configuration of Snort #### +#### Snort的规则和配置 #### -Snort installation from source code required rules and configuration setting therefore now we will copy rules and configuration under /etc/snort directory. We have created single bash scripts for rules and configuration setting. It is used for following snort setting. +从源码安装的snort需要规则和安装配置,因此我们会从/etc/snort下面复制规则和配置。我们已经创建了单独的bash脚本来用于规则和配置。它会设置下面这些snort设置。 -- Creation of snort user for snort IDS service on linux. -- Creation of directories and files under /etc directory for snort configuration. -- Permission setting and copying data from etc directory of snort source code. -- Remove # (comment sign) from rules path in snort.conf file. +- 在linux中创建snort用户用于snort IDS服务。 +- 在/etc下面创建snort的配置文件和文件夹。 +- 权限设置并从etc中复制snortsnort源代码 +- 从snort文件中移除规则中的#(注释符号)。 #!/bin/bash##PATH of source code of snort snort_src="/home/test/Downloads/snort-2.9.7.3" @@ -143,15 +141,15 @@ Snort installation from source code required rules and configuration setting the sed -i 's/include \$RULE\_PATH/#include \$RULE\_PATH/' /etc/snort/snort.conf echo "---DONE---" -Change the snort source directory in the script and run it. Following output appear in case of success. +改变脚本中的snort源目录并运行。下面是成功的输出。 ![running script](http://blog.linoxide.com/wp-content/uploads/2015/08/running_script.png) -Above script copied following files/directories from snort source into /etc/snort configuration file. +上面的脚本从snort源中复制下面的文件/文件夹到/etc/snort配置文件中 ![files copied](http://blog.linoxide.com/wp-content/uploads/2015/08/created.png) -Snort configuration file is very complex however following necessary changes are required in snort.conf for IDS proper working. +、snort的配置非常复杂,然而为了IDS能正常工作需要进行下面必要的修改。 ipvar HOME_NET 192.168.1.0/24 # LAN side @@ -171,32 +169,32 @@ Snort configuration file is very complex however following necessary changes are include $RULE_PATH/local.rules # file for custom rules -remove comment sign (#) from other rules such as ftp.rules,exploit.rules etc. +移除ftp.rules、exploit.rules前面的注释符号(#)。 ![path rules](http://blog.linoxide.com/wp-content/uploads/2015/08/path-rules.png) -Now [Download community][1] rules and extract under /etc/snort/rules directory. Enable community and emerging threats rules in snort.conf file. +下载[下载社区][1]规则并解压到/etc/snort/rules。启用snort.conf中的社区及紧急威胁规则。 ![wget_rules](http://blog.linoxide.com/wp-content/uploads/2015/08/wget_rules.png) ![community rules](http://blog.linoxide.com/wp-content/uploads/2015/08/community-rules1.png) -Run following command to test the configuration file after above mentioned changes. +进行了上面的更改后,运行下面的命令来检验配置文件。 #snort -T -c /etc/snort/snort.conf ![snort running](http://blog.linoxide.com/wp-content/uploads/2015/08/snort-final.png) -### Conclusion ### +### 总结 ### -In this article our focus was on the installation and configuration of an open source IDPS system snort on Ubuntu distribution. By default it is used for the monitoring of events however it can con configured inline mode for the protection of network. Snort rules can be tested and analysed in offline mode using pcap capture file. +本篇中,我们致力于开源IDPS系统snort在Ubuntu上的安装和配置。默认它用于监控时间,然而它可以被配置成用于网络保护的内联模式。snort规则可以在离线模式中可以使用pcap文件测试和分析 -------------------------------------------------------------------------------- via: http://linoxide.com/security/install-snort-usage-ubuntu-15-04/ 作者:[nido][a] -译者:[译者ID](https://github.com/译者ID) +译者:[geekpi](https://github.com/geekpi) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 19ccf708732b86651de67cef8804946927b127aa Mon Sep 17 00:00:00 2001 From: ictlyh Date: Sat, 15 Aug 2015 11:41:25 +0800 Subject: [PATCH 930/965] [Translate] tech/RHCE/Part 1 - RHCE Series--How to Setup and Test Static Network Routing.md --- ...o Setup and Test Static Network Routing.md | 228 ------------------ ...o Setup and Test Static Network Routing.md | 227 +++++++++++++++++ 2 files changed, 227 insertions(+), 228 deletions(-) delete mode 100644 sources/tech/RHCE/Part 1 - RHCE Series--How to Setup and Test Static Network Routing.md create mode 100644 translated/tech/Part 1 - RHCE Series--How to Setup and Test Static Network Routing.md diff --git a/sources/tech/RHCE/Part 1 - RHCE Series--How to Setup and Test Static Network Routing.md b/sources/tech/RHCE/Part 1 - RHCE Series--How to Setup and Test Static Network Routing.md deleted file mode 100644 index 731e78e5cf..0000000000 --- a/sources/tech/RHCE/Part 1 - RHCE Series--How to Setup and Test Static Network Routing.md +++ /dev/null @@ -1,228 +0,0 @@ -Translating by ictlyh -Part 1 - RHCE Series: How to Setup and Test Static Network Routing -================================================================================ -RHCE (Red Hat Certified Engineer) is a certification from Red Hat company, which gives an open source operating system and software to the enterprise community, It also gives training, support and consulting services for the companies. - -![RHCE Exam Preparation Guide](http://www.tecmint.com/wp-content/uploads/2015/07/RHCE-Exam-Series-by-TecMint.jpg) - -RHCE Exam Preparation Guide - -This RHCE (Red Hat Certified Engineer) is a performance-based exam (codename EX300), who possesses the additional skills, knowledge, and abilities required of a senior system administrator responsible for Red Hat Enterprise Linux (RHEL) systems. - -**Important**: [Red Hat Certified System Administrator][1] (RHCSA) certification is required to earn RHCE certification. - -Following are the exam objectives based on the Red Hat Enterprise Linux 7 version of the exam, which will going to cover in this RHCE series: - -- Part 1: How to Setup and Test Static Routing in RHEL 7 -- Part 2: How to Perform Packet Filtering, Network Address Translation and Set Kernel Runtime Parameters -- Part 3: How to Produce and Deliver System Activity Reports Using Linux Toolsets -- Part 4: Automate System Maintenance Tasks Using Shell Scripts -- Part 5: How to Configure Local and Remote System Logging -- Part 6: How to Configure a Samba Server and a NFS Server -- Part 7: Setting Up Complete SMTP Server for Mailing -- Part 8: Setting Up HTTPS and TLS on RHEL 7 -- Part 9: Setting Up Network Time Protocol -- Part 10: How to Configure a Cache-Only DNS Server - -To view fees and register for an exam in your country, check the [RHCE Certification][2] page. - -In this Part 1 of the RHCE series and the next, we will present basic, yet typical, cases where the principles of static routing, packet filtering, and network address translation come into play. - -![Setup Static Network Routing in RHEL](http://www.tecmint.com/wp-content/uploads/2015/07/Setup-Static-Network-Routing-in-RHEL-7.jpg) - -RHCE: Setup and Test Network Static Routing – Part 1 - -Please note that we will not cover them in depth, but rather organize these contents in such a way that will be helpful to take the first steps and build from there. - -### Static Routing in Red Hat Enterprise Linux 7 ### - -One of the wonders of modern networking is the vast availability of devices that can connect groups of computers, whether in relatively small numbers and confined to a single room or several machines in the same building, city, country, or across continents. - -However, in order to effectively accomplish this in any situation, network packets need to be routed, or in other words, the path they follow from source to destination must be ruled somehow. - -Static routing is the process of specifying a route for network packets other than the default, which is provided by a network device known as the default gateway. Unless specified otherwise through static routing, network packets are directed to the default gateway; with static routing, other paths are defined based on predefined criteria, such as the packet destination. - -Let us define the following scenario for this tutorial. We have a Red Hat Enterprise Linux 7 box connecting to router #1 [192.168.0.1] to access the Internet and machines in 192.168.0.0/24. - -A second router (router #2) has two network interface cards: enp0s3 is also connected to router #1 to access the Internet and to communicate with the RHEL 7 box and other machines in the same network, whereas the other (enp0s8) is used to grant access to the 10.0.0.0/24 network where internal services reside, such as a web and / or database server. - -This scenario is illustrated in the diagram below: - -![Static Routing Network Diagram](http://www.tecmint.com/wp-content/uploads/2015/07/Static-Routing-Network-Diagram.png) - -Static Routing Network Diagram - -In this article we will focus exclusively on setting up the routing table on our RHEL 7 box to make sure that it can both access the Internet through router #1 and the internal network via router #2. - -In RHEL 7, you will use the [ip command][3] to configure and show devices and routing using the command line. These changes can take effect immediately on a running system but since they are not persistent across reboots, we will use ifcfg-enp0sX and route-enp0sX files inside /etc/sysconfig/network-scripts to save our configuration permanently. - -To begin, let’s print our current routing table: - - # ip route show - -![Check Routing Table in Linux](http://www.tecmint.com/wp-content/uploads/2015/07/Check-Current-Routing-Table.png) - -Check Current Routing Table - -From the output above, we can see the following facts: - -- The default gateway’s IP address is 192.168.0.1 and can be accessed via the enp0s3 NIC. -- When the system booted up, it enabled the zeroconf route to 169.254.0.0/16 (just in case). In few words, if a machine is set to obtain an IP address through DHCP but fails to do so for some reason, it is automatically assigned an address in this network. Bottom line is, this route will allow us to communicate, also via enp0s3, with other machines who have failed to obtain an IP address from a DHCP server. -- Last, but not least, we can communicate with other boxes inside the 192.168.0.0/24 network through enp0s3, whose IP address is 192.168.0.18. - -These are the typical tasks that you would have to perform in such a setting. Unless specified otherwise, the following tasks should be performed in router #2: - -Make sure all NICs have been properly installed: - - # ip link show - -If one of them is down, bring it up: - - # ip link set dev enp0s8 up - -and assign an IP address in the 10.0.0.0/24 network to it: - - # ip addr add 10.0.0.17 dev enp0s8 - -Oops! We made a mistake in the IP address. We will have to remove the one we assigned earlier and then add the right one (10.0.0.18): - - # ip addr del 10.0.0.17 dev enp0s8 - # ip addr add 10.0.0.18 dev enp0s8 - -Now, please note that you can only add a route to a destination network through a gateway that is itself already reachable. For that reason, we need to assign an IP address within the 192.168.0.0/24 range to enp0s3 so that our RHEL 7 box can communicate with it: - - # ip addr add 192.168.0.19 dev enp0s3 - -Finally, we will need to enable packet forwarding: - - # echo "1" > /proc/sys/net/ipv4/ip_forward - -and stop / disable (just for the time being – until we cover packet filtering in the next article) the firewall: - - # systemctl stop firewalld - # systemctl disable firewalld - -Back in our RHEL 7 box (192.168.0.18), let’s configure a route to 10.0.0.0/24 through 192.168.0.19 (enp0s3 in router #2): - - # ip route add 10.0.0.0/24 via 192.168.0.19 - -After that, the routing table looks as follows: - - # ip route show - -![Show Network Routing Table](http://www.tecmint.com/wp-content/uploads/2015/07/Show-Network-Routing.png) - -Confirm Network Routing Table - -Likewise, add the corresponding route in the machine(s) you’re trying to reach in 10.0.0.0/24: - - # ip route add 192.168.0.0/24 via 10.0.0.18 - -You can test for basic connectivity using ping: - -In the RHEL 7 box, run - - # ping -c 4 10.0.0.20 - -where 10.0.0.20 is the IP address of a web server in the 10.0.0.0/24 network. - -In the web server (10.0.0.20), run - - # ping -c 192.168.0.18 - -where 192.168.0.18 is, as you will recall, the IP address of our RHEL 7 machine. - -Alternatively, we can use [tcpdump][4] (you may need to install it with yum install tcpdump) to check the 2-way communication over TCP between our RHEL 7 box and the web server at 10.0.0.20. - -To do so, let’s start the logging in the first machine with: - - # tcpdump -qnnvvv -i enp0s3 host 10.0.0.20 - -and from another terminal in the same system let’s telnet to port 80 in the web server (assuming Apache is listening on that port; otherwise, indicate the right port in the following command): - - # telnet 10.0.0.20 80 - -The tcpdump log should look as follows: - -![Check Network Communication between Servers](http://www.tecmint.com/wp-content/uploads/2015/07/Tcpdump-logs.png) - -Check Network Communication between Servers - -Where the connection has been properly initialized, as we can tell by looking at the 2-way communication between our RHEL 7 box (192.168.0.18) and the web server (10.0.0.20). - -Please remember that these changes will go away when you restart the system. If you want to make them persistent, you will need to edit (or create, if they don’t already exist) the following files, in the same systems where we performed the above commands. - -Though not strictly necessary for our test case, you should know that /etc/sysconfig/network contains system-wide network parameters. A typical /etc/sysconfig/network looks as follows: - - # Enable networking on this system? - NETWORKING=yes - # Hostname. Should match the value in /etc/hostname - HOSTNAME=yourhostnamehere - # Default gateway - GATEWAY=XXX.XXX.XXX.XXX - # Device used to connect to default gateway. Replace X with the appropriate number. - GATEWAYDEV=enp0sX - -When it comes to setting specific variables and values for each NIC (as we did for router #2), you will have to edit /etc/sysconfig/network-scripts/ifcfg-enp0s3 and /etc/sysconfig/network-scripts/ifcfg-enp0s8. - -Following our case, - - TYPE=Ethernet - BOOTPROTO=static - IPADDR=192.168.0.19 - NETMASK=255.255.255.0 - GATEWAY=192.168.0.1 - NAME=enp0s3 - ONBOOT=yes - -and - - TYPE=Ethernet - BOOTPROTO=static - IPADDR=10.0.0.18 - NETMASK=255.255.255.0 - GATEWAY=10.0.0.1 - NAME=enp0s8 - ONBOOT=yes - -for enp0s3 and enp0s8, respectively. - -As for routing in our client machine (192.168.0.18), we will need to edit /etc/sysconfig/network-scripts/route-enp0s3: - - 10.0.0.0/24 via 192.168.0.19 dev enp0s3 - -Now reboot your system and you should see that route in your table. - -### Summary ### - -In this article we have covered the essentials of static routing in Red Hat Enterprise Linux 7. Although scenarios may vary, the case presented here illustrates the required principles and the procedures to perform this task. Before wrapping up, I would like to suggest you to take a look at [Chapter 4][5] of the Securing and Optimizing Linux section in The Linux Documentation Project site for further details on the topics covered here. - -Free ebook on Securing & Optimizing Linux: The Hacking Solution (v.3.0) – This 800+ eBook contains comprehensive collection of Linux security tips and how to use them safely and easily to configure Linux-based applications and services. - -![Linux Security and Optimization Book](http://www.tecmint.com/wp-content/uploads/2015/07/Linux-Security-Optimization-Book.gif) - -Linux Security and Optimization Book - -[Download Now][6] - -In the next article we will talk about packet filtering and network address translation to sum up the networking basic skills needed for the RHCE certification. - -As always, we look forward to hearing from you, so feel free to leave your questions, comments, and suggestions using the form below. - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/how-to-setup-and-configure-static-network-routing-in-rhel/ - -作者:[Gabriel Cánepa][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.tecmint.com/author/gacanepa/ -[1]:http://www.tecmint.com/rhcsa-exam-reviewing-essential-commands-system-documentation/ -[2]:https://www.redhat.com/en/services/certification/rhce -[3]:http://www.tecmint.com/ip-command-examples/ -[4]:http://www.tecmint.com/12-tcpdump-commands-a-network-sniffer-tool/ -[5]:http://www.tldp.org/LDP/solrhe/Securing-Optimizing-Linux-RH-Edition-v1.3/net-manage.html -[6]:http://tecmint.tradepub.com/free/w_opeb01/prgm.cgi \ No newline at end of file diff --git a/translated/tech/Part 1 - RHCE Series--How to Setup and Test Static Network Routing.md b/translated/tech/Part 1 - RHCE Series--How to Setup and Test Static Network Routing.md new file mode 100644 index 0000000000..03038b92d5 --- /dev/null +++ b/translated/tech/Part 1 - RHCE Series--How to Setup and Test Static Network Routing.md @@ -0,0 +1,227 @@ +RHCE 系列第一部分:如何设置和测试静态网络路由 +================================================================================ +RHCE(Red Hat Certified Engineer,红帽认证工程师)是红帽公司的一个认证,红帽向企业社区贡献开源操作系统和软件,同时它还给公司提供训练、支持和咨询服务。 + +![RHCE 考试准备指南](http://www.tecmint.com/wp-content/uploads/2015/07/RHCE-Exam-Series-by-TecMint.jpg) + +RHCE 考试准备指南 + +这个 RHCE 是基于性能的考试(代号 EX300),面向那些拥有更多的技能、知识和能力的红帽企业版 Linux(RHEL)系统高级系统管理员。 + +**重要**: [红帽认证系统管理员][1] (Red Hat Certified System Administrator,RHCSA)认证要求先有 RHCE 认证。 + +以下是基于红帽企业版 Linux 7 考试的考试目标,我们会在该 RHCE 系列中分别介绍: + +- 第一部分:如何在 RHEL 7 中设置和测试静态路由 +- 第二部分:如果进行包过滤、网络地址转换和设置内核运行时参数 +- 第三部分:如果使用 Linux 工具集产生和发送系统活动报告 +- 第四部分:使用 Shell 脚本进行自动化系统维护 +- 第五部分:如果配置本地和远程系统日志 +- 第六部分:如果配置一个 Samba 服务器或 NFS 服务器(译者注:Samba 是在 Linux 和 UNI X系统上实现 SMB 协议的一个免费软件,由服务器及客户端程序构成。SMB,Server Messages Block,信息服务块,是一种在局域网上共享文件和打印机的一种通信协议,它为局域网内的不同计算机之间提供文件及打印机等资源的共享服务。) +- 第七部分:为收发邮件配置完整的 SMTP 服务器 +- 第八部分:在 RHEL 7 上设置 HTTPS 和 TLS +- 第九部分:设置网络时间协议 +- 第十部分:如何配置一个 Cache-Only DNS 服务器 + +在你的国家查看考试费用和注册考试,可以到 [RHCE 认证][2] 网页。 + +在 RHCE 的第一和第二部分,我们会介绍一些基本的但典型的情形,也就是静态路由原理、包过滤和网络地址转换。 + +![在 RHEL 中设置静态网络路由](http://www.tecmint.com/wp-content/uploads/2015/07/Setup-Static-Network-Routing-in-RHEL-7.jpg) + +RHCE 系列第一部分:设置和测试网络静态路由 + +请注意我们不会作深入的介绍,但以这种方式组织内容能帮助你开始第一步并继续后面的内容。 + +### 红帽企业版 Linux 7 中的静态路由 ### + +现代网络的一个奇迹就是有很多可用的设备能将一组计算机连接起来,不管是在一个房间里少量的机器还是在一栋建筑物、城市、国家或者大洲之间的多台机器。 + +然而,为了能在任意情形下有效的实现这些,需要对网络包进行路由,或者换句话说,它们从源到目的地的路径需要按照某种规则。 + +静态路由是为网络包指定一个路由的过程,而不是使用网络设备提供的默认网关。除非另有指定,否则通过路由,网络包会被导向默认网关;基于预定义的标准,例如数据包目的地,使用静态路由可以定义其它路径。 + +我们在该篇指南中会考虑以下场景。我们有一台红帽企业版 Linux 7,连接到路由器 1号 [192.168.0.1] 以访问因特网以及 192.168.0.0/24 中的其它机器。 + +第二个路由器(路由器 2号)有两个网卡:enp0s3 同样通过网络连接到路由器 1号,以便连接RHEL 7 以及相同网络中的其它机器,另外一个网卡(enp0s8)用于授权访问内部服务所在的 10.0.0.0/24 网络,例如 web 或数据库服务器。 + +该场景可以用下面的示意图表示: + +![静态路由网络示意图](http://www.tecmint.com/wp-content/uploads/2015/07/Static-Routing-Network-Diagram.png) + +静态路由网络示意图 + +在这篇文章中我们会集中介绍在 RHEL 7 中设置路由表,确保它能通过路由器 1号访问因特网以及通过路由器 2号访问内部网络。 + +在 RHEL 7 中,你会通过命令行用 [命令 ip][3] 配置和显示设备和路由。这些更改能在运行的系统中及时生效,但由于重启后不会保存,我们会使用 /etc/sysconfig/network-scripts 目录下的 ifcfg-enp0sX 和 route-enp0sX 文件永久保存我们的配置。 + +首先,让我们打印出当前的路由表: + + # ip route show + +![在 Linux 中检查路由表](http://www.tecmint.com/wp-content/uploads/2015/07/Check-Current-Routing-Table.png) + +检查当前路由表 + +从上面的输出中,我们可以得出以下结论: + +- 默认网关的 IP 是 192.168.0.1,可以通过网卡 enp0s3 访问。 +- 系统启动的时候,它启用了到 169.254.0.0/16 的 zeroconf 路由(只是在本例中)。也就是说,如果机器设置为通过 DHCP 获取一个 IP 地址,但是由于某些原因失败了,它就会在该网络中自动分配到一个地址。这一行的意思是,该路由会允许我们通过 enp0s3 和其它没有从 DHCP 服务器中成功获得 IP 地址的机器机器连接。 +- 最后,但同样重要的是,我们也可以通过 IP 地址是 192.168.0.18 的 enp0s3 和 192.168.0.0/24 网络中的其它机器连接。 + +下面是这样的配置中你需要做的一些典型任务。除非另有说明,下面的任务都在路由器 2号上进行。 + +确保正确安装了所有网卡: + + # ip link show + +如果有某块网卡停用了,启动它: + + # ip link set dev enp0s8 up + +分配 10.0.0.0/24 网络中的一个 IP 地址给它: + + # ip addr add 10.0.0.17 dev enp0s8 + +噢!我们分配了一个错误的 IP 地址。我们需要删除之前分配的那个并添加正确的地址(10.0.0.18): + + # ip addr del 10.0.0.17 dev enp0s8 + # ip addr add 10.0.0.18 dev enp0s8 + +现在,请注意你只能添加一个通过已经能访问的网关到目标网络的路由。因为这个原因,我们需要在 192.168.0.0/24 范围中给 enp0s3 分配一个 IP 地址,这样我们的 RHEL 7 才能连接到它: + + # ip addr add 192.168.0.19 dev enp0s3 + +最后,我们需要启用包转发: + + # echo "1" > /proc/sys/net/ipv4/ip_forward + +并停用/取消防火墙(从现在开始,直到下一篇文章中我们介绍了包过滤): + + # systemctl stop firewalld + # systemctl disable firewalld + +回到我们的 RHEL 7(192.168.0.18),让我们配置一个通过 192.168.0.19(路由器 2号的 enp0s3)到 10.0.0.0/24 的路由: + + # ip route add 10.0.0.0/24 via 192.168.0.19 + +之后,路由表看起来像下面这样: + + # ip route show + +![显示网络路由表](http://www.tecmint.com/wp-content/uploads/2015/07/Show-Network-Routing.png) + +确认网络路由表 + +同样,在你尝试连接的 10.0.0.0/24 网络的机器中添加对应的路由: + + # ip route add 192.168.0.0/24 via 10.0.0.18 + +你可以使用 ping 测试基本连接: + +在 RHEL 7 中运行: + + # ping -c 4 10.0.0.20 + +10.0.0.20 是 10.0.0.0/24 网络中一个 web 服务器的 IP 地址。 + +在 web 服务器(10.0.0.20)中运行 + + # ping -c 192.168.0.18 + +192.168.0.18 也就是我们的 RHEL 7 机器的 IP 地址。 + +另外,我们还可以使用 [tcpdump][4](需要通过 yum install tcpdump 安装)来检查我们 RHEL 7 和 10.0.0.20 中 web 服务器之间的 TCP 双向通信。 + +首先在第一台机器中启用日志: + + # tcpdump -qnnvvv -i enp0s3 host 10.0.0.20 + +在同一个系统上的另一个终端,让我们通过 telnet 连接到 web 服务器的 80 号端口(假设 Apache 正在监听该端口;否则在下面命令中使用正确的端口): + + # telnet 10.0.0.20 80 + +tcpdump 日志看起来像下面这样: + +![检查服务器之间的网络连接](http://www.tecmint.com/wp-content/uploads/2015/07/Tcpdump-logs.png) + +检查服务器之间的网络连接 + +通过查看我们 RHEL 7(192.168.0.18)和 web 服务器(10.0.0.20)之间的双向通信,可以看出已经正确地初始化了连接。 + +请注意你重启系统后会丢失这些更改。如果你想把它们永久保存下来,你需要在我们运行上面的命令的相同系统中编辑(如果不存在的话就创建)以下的文件。 + +尽管对于我们的测试例子不是严格要求,你需要知道 /etc/sysconfig/network 包含了一些系统范围的网络参数。一个典型的 /etc/sysconfig/network 看起来类似下面这样: + + # Enable networking on this system? + NETWORKING=yes + # Hostname. Should match the value in /etc/hostname + HOSTNAME=yourhostnamehere + # Default gateway + GATEWAY=XXX.XXX.XXX.XXX + # Device used to connect to default gateway. Replace X with the appropriate number. + GATEWAYDEV=enp0sX + +当需要为每个网卡设置特定的变量和值时(正如我们在路由器 2号上面做的),你需要编辑 /etc/sysconfig/network-scripts/ifcfg-enp0s3 和 /etc/sysconfig/network-scripts/ifcfg-enp0s8 文件。 + +下面是我们的例子, + + TYPE=Ethernet + BOOTPROTO=static + IPADDR=192.168.0.19 + NETMASK=255.255.255.0 + GATEWAY=192.168.0.1 + NAME=enp0s3 + ONBOOT=yes + +以及 + + TYPE=Ethernet + BOOTPROTO=static + IPADDR=10.0.0.18 + NETMASK=255.255.255.0 + GATEWAY=10.0.0.1 + NAME=enp0s8 + ONBOOT=yes + +分别对应 enp0s3 和 enp0s8。 + +由于要为我们的客户端机器(192.168.0.18)进行路由,我们需要编辑 /etc/sysconfig/network-scripts/route-enp0s3: + + 10.0.0.0/24 via 192.168.0.19 dev enp0s3 + +现在重启系统你可以在路由表中看到该路由规则。 + +### 总结 ### + +在这篇文章中我们介绍了红帽企业版 Linux 7 的静态路由。尽管场景可能不同,这里介绍的例子说明了所需的原理以及进行该任务的步骤。结束之前,我还建议你看一下 Linux 文档项目中 [第四章 4][5] 保护和优化 Linux 部分,以了解这里介绍主题的更详细内容。 + +免费电子书 Securing & Optimizing Linux: The Hacking Solution (v.3.0) - 这本 800 多页的电子书全面收集了 Linux 安全的小技巧以及如果安全和简便的使用它们去配置基于 Linux 的应用和服务。 + +![Linux 安全和优化](http://www.tecmint.com/wp-content/uploads/2015/07/Linux-Security-Optimization-Book.gif) + +Linux 安全和优化 + +[马上下载][6] + +在下篇文章中我们会介绍数据包过滤和网络地址转换,结束 RHCE 验证需要的网络基本技巧。 + +如往常一样,我们期望听到你的回复,用下面的表格留下你的疑问、评论和建议吧。 + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/how-to-setup-and-configure-static-network-routing-in-rhel/ + +作者:[Gabriel Cánepa][a] +译者:[ictlyh](https://github.com/ictlyh) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/gacanepa/ +[1]:http://www.tecmint.com/rhcsa-exam-reviewing-essential-commands-system-documentation/ +[2]:https://www.redhat.com/en/services/certification/rhce +[3]:http://www.tecmint.com/ip-command-examples/ +[4]:http://www.tecmint.com/12-tcpdump-commands-a-network-sniffer-tool/ +[5]:http://www.tldp.org/LDP/solrhe/Securing-Optimizing-Linux-RH-Edition-v1.3/net-manage.html +[6]:http://tecmint.tradepub.com/free/w_opeb01/prgm.cgi \ No newline at end of file From 2177afef00a1e6fcb1108dad75fb280cc9d040af Mon Sep 17 00:00:00 2001 From: geekpi Date: Sat, 15 Aug 2015 12:32:52 +0800 Subject: [PATCH 931/965] Rename sources/tech/20150811 How to Install Snort and Usage in Ubuntu 15.04.md to translated/tech/20150811 How to Install Snort and Usage in Ubuntu 15.04.md --- .../20150811 How to Install Snort and Usage in Ubuntu 15.04.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/20150811 How to Install Snort and Usage in Ubuntu 15.04.md (100%) diff --git a/sources/tech/20150811 How to Install Snort and Usage in Ubuntu 15.04.md b/translated/tech/20150811 How to Install Snort and Usage in Ubuntu 15.04.md similarity index 100% rename from sources/tech/20150811 How to Install Snort and Usage in Ubuntu 15.04.md rename to translated/tech/20150811 How to Install Snort and Usage in Ubuntu 15.04.md From 4452a5c19d27820e077a99971d68c633e4ae8818 Mon Sep 17 00:00:00 2001 From: ictlyh Date: Sat, 15 Aug 2015 16:25:13 +0800 Subject: [PATCH 932/965] [Translated] tech/RHCE/Part 2 - How to Perform Packet Filtering Network Address Translation and Set Kernel Runtime Parameters.md --- ...ation and Set Kernel Runtime Parameters.md | 178 ------------------ ...o Setup and Test Static Network Routing.md | 0 ...ation and Set Kernel Runtime Parameters.md | 175 +++++++++++++++++ 3 files changed, 175 insertions(+), 178 deletions(-) delete mode 100644 sources/tech/RHCE/Part 2 - How to Perform Packet Filtering Network Address Translation and Set Kernel Runtime Parameters.md rename translated/tech/{ => RHCE}/Part 1 - RHCE Series--How to Setup and Test Static Network Routing.md (100%) create mode 100644 translated/tech/RHCE/Part 2 - How to Perform Packet Filtering Network Address Translation and Set Kernel Runtime Parameters.md diff --git a/sources/tech/RHCE/Part 2 - How to Perform Packet Filtering Network Address Translation and Set Kernel Runtime Parameters.md b/sources/tech/RHCE/Part 2 - How to Perform Packet Filtering Network Address Translation and Set Kernel Runtime Parameters.md deleted file mode 100644 index cd798b906d..0000000000 --- a/sources/tech/RHCE/Part 2 - How to Perform Packet Filtering Network Address Translation and Set Kernel Runtime Parameters.md +++ /dev/null @@ -1,178 +0,0 @@ -Translating by ictlyh -Part 2 - How to Perform Packet Filtering, Network Address Translation and Set Kernel Runtime Parameters -================================================================================ -As promised in Part 1 (“[Setup Static Network Routing][1]”), in this article (Part 2 of RHCE series) we will begin by introducing the principles of packet filtering and network address translation (NAT) in Red Hat Enterprise Linux 7, before diving into setting runtime kernel parameters to modify the behavior of a running kernel if certain conditions change or needs arise. - -![Network Packet Filtering in RHEL](http://www.tecmint.com/wp-content/uploads/2015/07/Network-Packet-Filtering-in-RHEL.jpg) - -RHCE: Network Packet Filtering – Part 2 - -### Network Packet Filtering in RHEL 7 ### - -When we talk about packet filtering, we refer to a process performed by a firewall in which it reads the header of each data packet that attempts to pass through it. Then, it filters the packet by taking the required action based on rules that have been previously defined by the system administrator. - -As you probably know, beginning with RHEL 7, the default service that manages firewall rules is [firewalld][2]. Like iptables, it talks to the netfilter module in the Linux kernel in order to examine and manipulate network packets. Unlike iptables, updates can take effect immediately without interrupting active connections – you don’t even have to restart the service. - -Another advantage of firewalld is that it allows us to define rules based on pre-configured service names (more on that in a minute). - -In Part 1, we used the following scenario: - -![Static Routing Network Diagram](http://www.tecmint.com/wp-content/uploads/2015/07/Static-Routing-Network-Diagram.png) - -Static Routing Network Diagram - -However, you will recall that we disabled the firewall on router #2 to simplify the example since we had not covered packet filtering yet. Let’s see now how we can enable incoming packets destined for a specific service or port in the destination. - -First, let’s add a permanent rule to allow inbound traffic in enp0s3 (192.168.0.19) to enp0s8 (10.0.0.18): - - # firewall-cmd --permanent --direct --add-rule ipv4 filter FORWARD 0 -i enp0s3 -o enp0s8 -j ACCEPT - -The above command will save the rule to /etc/firewalld/direct.xml: - - # cat /etc/firewalld/direct.xml - -![Check Firewalld Saved Rules in CentOS 7](http://www.tecmint.com/wp-content/uploads/2015/07/Check-Firewalld-Save-Rules.png) - -Check Firewalld Saved Rules - -Then enable the rule for it to take effect immediately: - - # firewall-cmd --direct --add-rule ipv4 filter FORWARD 0 -i enp0s3 -o enp0s8 -j ACCEPT - -Now you can telnet to the web server from the RHEL 7 box and run [tcpdump][3] again to monitor the TCP traffic between the two machines, this time with the firewall in router #2 enabled. - - # telnet 10.0.0.20 80 - # tcpdump -qnnvvv -i enp0s3 host 10.0.0.20 - -What if you want to only allow incoming connections to the web server (port 80) from 192.168.0.18 and block connections from other sources in the 192.168.0.0/24 network? - -In the web server’s firewall, add the following rules: - - # firewall-cmd --add-rich-rule 'rule family="ipv4" source address="192.168.0.18/24" service name="http" accept' - # firewall-cmd --add-rich-rule 'rule family="ipv4" source address="192.168.0.18/24" service name="http" accept' --permanent - # firewall-cmd --add-rich-rule 'rule family="ipv4" source address="192.168.0.0/24" service name="http" drop' - # firewall-cmd --add-rich-rule 'rule family="ipv4" source address="192.168.0.0/24" service name="http" drop' --permanent - -Now you can make HTTP requests to the web server, from 192.168.0.18 and from some other machine in 192.168.0.0/24. In the first case the connection should complete successfully, whereas in the second it will eventually timeout. - -To do so, any of the following commands will do the trick: - - # telnet 10.0.0.20 80 - # wget 10.0.0.20 - -I strongly advise you to check out the [Firewalld Rich Language][4] documentation in the Fedora Project Wiki for further details on rich rules. - -### Network Address Translation in RHEL 7 ### - -Network Address Translation (NAT) is the process where a group of computers (it can also be just one of them) in a private network are assigned an unique public IP address. As result, they are still uniquely identified by their own private IP address inside the network but to the outside they all “seem” the same. - -In addition, NAT makes it possible that computers inside a network sends requests to outside resources (like the Internet) and have the corresponding responses be sent back to the source system only. - -Let’s now consider the following scenario: - -![Network Address Translation in RHEL](http://www.tecmint.com/wp-content/uploads/2015/07/Network-Address-Translation-Diagram.png) - -Network Address Translation - -In router #2, we will move the enp0s3 interface to the external zone, and enp0s8 to the internal zone, where masquerading, or NAT, is enabled by default: - - # firewall-cmd --list-all --zone=external - # firewall-cmd --change-interface=enp0s3 --zone=external - # firewall-cmd --change-interface=enp0s3 --zone=external --permanent - # firewall-cmd --change-interface=enp0s8 --zone=internal - # firewall-cmd --change-interface=enp0s8 --zone=internal --permanent - -For our current setup, the internal zone – along with everything that is enabled in it will be the default zone: - - # firewall-cmd --set-default-zone=internal - -Next, let’s reload firewall rules and keep state information: - - # firewall-cmd --reload - -Finally, let’s add router #2 as default gateway in the web server: - - # ip route add default via 10.0.0.18 - -You can now verify that you can ping router #1 and an external site (tecmint.com, for example) from the web server: - - # ping -c 2 192.168.0.1 - # ping -c 2 tecmint.com - -![Verify Network Routing](http://www.tecmint.com/wp-content/uploads/2015/07/Verify-Network-Routing.png) - -Verify Network Routing - -### Setting Kernel Runtime Parameters in RHEL 7 ### - -In Linux, you are allowed to change, enable, and disable the kernel runtime parameters, and RHEL is no exception. The /proc/sys interface (sysctl) lets you set runtime parameters on-the-fly to modify the system’s behavior without much hassle when operating conditions change. - -To do so, the echo shell built-in is used to write to files inside /proc/sys/, where is most likely one of the following directories: - -- dev: parameters for specific devices connected to the machine. -- fs: filesystem configuration (quotas and inodes, for example). -- kernel: kernel-specific configuration. -- net: network configuration. -- vm: use of the kernel’s virtual memory. - -To display the list of all the currently available values, run - - # sysctl -a | less - -In Part 1, we changed the value of the net.ipv4.ip_forward parameter by doing - - # echo 1 > /proc/sys/net/ipv4/ip_forward - -in order to allow a Linux machine to act as router. - -Another runtime parameter that you may want to set is kernel.sysrq, which enables the Sysrq key in your keyboard to instruct the system to perform gracefully some low-level functions, such as rebooting the system if it has frozen for some reason: - - # echo 1 > /proc/sys/kernel/sysrq - -To display the value of a specific parameter, use sysctl as follows: - - # sysctl - -For example, - - # sysctl net.ipv4.ip_forward - # sysctl kernel.sysrq - -Some parameters, such as the ones mentioned above, require only one value, whereas others (for example, fs.inode-state) require multiple values: - -![Check Kernel Parameters in Linux](http://www.tecmint.com/wp-content/uploads/2015/07/Check-Kernel-Parameters.png) - -Check Kernel Parameters - -In either case, you need to read the kernel’s documentation before making any changes. - -Please note that these settings will go away when the system is rebooted. To make these changes permanent, we will need to add .conf files inside the /etc/sysctl.d as follows: - - # echo "net.ipv4.ip_forward = 1" > /etc/sysctl.d/10-forward.conf - -(where the number 10 indicates the order of processing relative to other files in the same directory). - -and enable the changes with - - # sysctl -p /etc/sysctl.d/10-forward.conf - -### Summary ### - -In this tutorial we have explained the basics of packet filtering, network address translation, and setting kernel runtime parameters on a running system and persistently across reboots. I hope you have found this information useful, and as always, we look forward to hearing from you! -Don’t hesitate to share with us your questions, comments, or suggestions using the form below. - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/perform-packet-filtering-network-address-translation-and-set-kernel-runtime-parameters-in-rhel/ - -作者:[Gabriel Cánepa][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.tecmint.com/author/gacanepa/ -[1]:http://www.tecmint.com/how-to-setup-and-configure-static-network-routing-in-rhel/ -[2]:http://www.tecmint.com/firewalld-rules-for-centos-7/ -[3]:http://www.tecmint.com/12-tcpdump-commands-a-network-sniffer-tool/ -[4]:https://fedoraproject.org/wiki/Features/FirewalldRichLanguage \ No newline at end of file diff --git a/translated/tech/Part 1 - RHCE Series--How to Setup and Test Static Network Routing.md b/translated/tech/RHCE/Part 1 - RHCE Series--How to Setup and Test Static Network Routing.md similarity index 100% rename from translated/tech/Part 1 - RHCE Series--How to Setup and Test Static Network Routing.md rename to translated/tech/RHCE/Part 1 - RHCE Series--How to Setup and Test Static Network Routing.md diff --git a/translated/tech/RHCE/Part 2 - How to Perform Packet Filtering Network Address Translation and Set Kernel Runtime Parameters.md b/translated/tech/RHCE/Part 2 - How to Perform Packet Filtering Network Address Translation and Set Kernel Runtime Parameters.md new file mode 100644 index 0000000000..74b162be1c --- /dev/null +++ b/translated/tech/RHCE/Part 2 - How to Perform Packet Filtering Network Address Translation and Set Kernel Runtime Parameters.md @@ -0,0 +1,175 @@ +RHCE 第二部分 - 如何进行包过滤、网络地址转换和设置内核运行时参数 +================================================================================ +正如第一部分(“[设置静态网络路由][1]”)承诺的,在这篇文章(RHCE 系列第二部分),我们首先介绍红帽企业版 Linux 7中包过滤和网络地址转换原理,然后再介绍某些条件发送变化或者需要激活时设置运行时内核参数以改变运行时内核行为。 + +![RHEL 中的网络包过滤](http://www.tecmint.com/wp-content/uploads/2015/07/Network-Packet-Filtering-in-RHEL.jpg) + +RHCE 第二部分:网络包过滤 + +### RHEL 7 中的网络包过滤 ### + +当我们讨论数据包过滤的时候,我们指防火墙读取每个尝试通过它的数据包的包头所进行的处理。然后,根据系统管理员之前定义的规则,通过采取所要求的动作过滤数据包。 + +正如你可能知道的,从 RHEL 7 开始,管理防火墙的默认服务是 [firewalld][2]。类似 iptables,它和 Linux 内核的 netfilter 模块交互以便检查和操作网络数据包。不像 iptables,Firewalld 的更新可以立即生效,而不用中断活跃的连接 - 你甚至不需要重启服务。 + +Firewalld 的另一个优势是它允许我们定义基于预配置服务名称的规则(之后会详细介绍)。 + +在第一部分,我们用了下面的场景: + +![静态路由网络示意图](http://www.tecmint.com/wp-content/uploads/2015/07/Static-Routing-Network-Diagram.png) + +静态路由网络示意图 + +然而,你应该记得,由于还没有介绍包过滤,为了简化例子,我们停用了路由器 2号 的防火墙。现在让我们来看看如何可以使接收的数据包发送到目的地的特定服务或端口。 + +首先,让我们添加一条永久规则允许从 enp0s3 (192.168.0.19) 到 enp0s8 (10.0.0.18) 的绑定流量: + + # firewall-cmd --permanent --direct --add-rule ipv4 filter FORWARD 0 -i enp0s3 -o enp0s8 -j ACCEPT + +上面的命令会把规则保存到 /etc/firewalld/direct.xml: + + # cat /etc/firewalld/direct.xml + +![在 CentOS 7 中检查 Firewalld 保存的规则](http://www.tecmint.com/wp-content/uploads/2015/07/Check-Firewalld-Save-Rules.png) + +检查 Firewalld 保存的规则 + +然后启用规则使其立即生效: + + # firewall-cmd --direct --add-rule ipv4 filter FORWARD 0 -i enp0s3 -o enp0s8 -j ACCEPT + +现在你可以从 RHEL 7 中通过 telnet 登录到 web 服务器并再次运行 [tcpdump][3] 监视两台机器之间的 TCP 流量,这次路由器 2号已经启用了防火墙。 + + # telnet 10.0.0.20 80 + # tcpdump -qnnvvv -i enp0s3 host 10.0.0.20 + +如果你想只允许从 192.168.0.18 到 web 服务器(80 号端口)的连接而阻塞 192.168.0.0/24 网络中的其它来源呢? + +在 web 服务器的防火墙中添加以下规则: + + # firewall-cmd --add-rich-rule 'rule family="ipv4" source address="192.168.0.18/24" service name="http" accept' + # firewall-cmd --add-rich-rule 'rule family="ipv4" source address="192.168.0.18/24" service name="http" accept' --permanent + # firewall-cmd --add-rich-rule 'rule family="ipv4" source address="192.168.0.0/24" service name="http" drop' + # firewall-cmd --add-rich-rule 'rule family="ipv4" source address="192.168.0.0/24" service name="http" drop' --permanent + +现在你可以从 192.168.0.18 和 192.168.0.0/24 中的其它机器发送到 web 服务器的 HTTP 请求。第一种情况连接会成功完成,但第二种情况最终会超时。 + +任何下面的命令可以验证这个结果: + + # telnet 10.0.0.20 80 + # wget 10.0.0.20 + +我强烈建议你看看 Fedora Project Wiki 中的 [Firewalld Rich Language][4] 文档更详细地了解关于富规则的内容。 + +### RHEL 7 中的网络地址转换 ### + +网络地址转换(NAT)是为专用网络中的一组计算机(也可能是其中的一台)分配一个独立的公共 IP 地址的过程。结果,在内部网络中仍然可以用它们自己的私有 IP 地址区别,但外部“看来”它们是一样的。 + +另外,网络地址转换使得内部网络中的计算机发送请求到外部资源(例如因特网)然后只有源系统能接收到对应的响应成为可能。 + +现在让我们考虑下面的场景: + +![RHEL 中的网络地址转换](http://www.tecmint.com/wp-content/uploads/2015/07/Network-Address-Translation-Diagram.png) + +网络地址转换 + +在路由器 2 中,我们会把 enp0s3 接口移动到外部区域,enp0s8 到内部区域,伪装或者说 NAT 默认是启用的: + + # firewall-cmd --list-all --zone=external + # firewall-cmd --change-interface=enp0s3 --zone=external + # firewall-cmd --change-interface=enp0s3 --zone=external --permanent + # firewall-cmd --change-interface=enp0s8 --zone=internal + # firewall-cmd --change-interface=enp0s8 --zone=internal --permanent + +对于我们当前的设置,内部区域 - 以及和它一起启用的任何东西都是默认区域: + + # firewall-cmd --set-default-zone=internal + +下一步,让我们重载防火墙规则并保持状态信息: + + # firewall-cmd --reload + +最后,在 web 服务器中添加路由器 2 为默认网关: + + # ip route add default via 10.0.0.18 + +现在你会发现在 web 服务器中你可以 ping 路由器 1 和外部网站(例如 tecmint.com): + + # ping -c 2 192.168.0.1 + # ping -c 2 tecmint.com + +![验证网络路由](http://www.tecmint.com/wp-content/uploads/2015/07/Verify-Network-Routing.png) + +验证网络路由 + +### 在 RHEL 7 中设置内核运行时参数 ### + +在 Linux 中,允许你更改、启用以及停用内核运行时参数,RHEL 也不例外。/proc/sys 接口允许你当操作条件发生变化时实时设置运行时参数以改变系统行为而不需太多麻烦。 + +为了实现这个目的,会用内建的 echo shell 写 /proc/sys/ 中的文件,其中 很可能是以下目录中的一个: + +- dev: 连接到机器中的特定设备的参数。 +- fs: 文件系统配置(例如 quotas 和 inodes)。 +- kernel: 内核配置。 +- net: 网络配置。 +- vm: 内核虚拟内存的使用。 + +要显示所有当前可用值的列表,运行 + + # sysctl -a | less + +在第一部分中,我们通过以下命令改变了 net.ipv4.ip_forward 参数的值以允许 Linux 机器作为一个路由器。 + + # echo 1 > /proc/sys/net/ipv4/ip_forward + +另一个你可能想要设置的运行时参数是 kernel.sysrq,它会启用你键盘上的 Sysrq 键,以使系统更好的运行一些底层函数,例如如果由于某些原因冻结了后重启系统: + + # echo 1 > /proc/sys/kernel/sysrq + +要显示特定参数的值,可以按照下面方式使用 sysctl: + + # sysctl + +例如, + + # sysctl net.ipv4.ip_forward + # sysctl kernel.sysrq + +一些参数,例如上面提到的一个,只需要一个值,而其它一些(例如 fs.inode-state)要求多个值: + +![在 Linux 中查看内核参数](http://www.tecmint.com/wp-content/uploads/2015/07/Check-Kernel-Parameters.png) + +查看内核参数 + +不管什么情况下,做任何更改之前你都需要阅读内核文档。 + +请注意系统重启后这些设置会丢失。要使这些更改永久生效,我们需要添加内容到 /etc/sysctl.d 目录的 .conf 文件,像下面这样: + + # echo "net.ipv4.ip_forward = 1" > /etc/sysctl.d/10-forward.conf + +(其中数字 10 表示相对同一个目录中其它文件的处理顺序)。 + +并用下面命令启用更改 + + # sysctl -p /etc/sysctl.d/10-forward.conf + +### 总结 ### + +在这篇指南中我们解释了基本的包过滤、网络地址变换和在运行的系统中设置内核运行时参数并使重启后能持久化。我希望这些信息能对你有用,如往常一样,我们期望收到你的回复! +别犹豫,在下面的表格中和我们分享你的疑问、评论和建议吧。 + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/perform-packet-filtering-network-address-translation-and-set-kernel-runtime-parameters-in-rhel/ + +作者:[Gabriel Cánepa][a] +译者:[ictlyh](https://github.com/ictlyh) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/gacanepa/ +[1]:http://www.tecmint.com/how-to-setup-and-configure-static-network-routing-in-rhel/ +[2]:http://www.tecmint.com/firewalld-rules-for-centos-7/ +[3]:http://www.tecmint.com/12-tcpdump-commands-a-network-sniffer-tool/ +[4]:https://fedoraproject.org/wiki/Features/FirewalldRichLanguage \ No newline at end of file From cf65318b5f157da02ce80fade5ce656818407155 Mon Sep 17 00:00:00 2001 From: Jindong Huang Date: Sat, 15 Aug 2015 16:33:29 +0800 Subject: [PATCH 933/965] =?UTF-8?q?=E3=80=90=E7=BF=BB=E8=AF=91=E5=AE=8C?= =?UTF-8?q?=E6=AF=95=E3=80=9120150730=20Howto=20Configure=20Nginx=20as=20R?= =?UTF-8?q?reverse=20Proxy=20or=20Load=20Balancer=20with=20Weave=20and=20D?= =?UTF-8?q?ocker.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... or Load Balancer with Weave and Docker.md | 49 +++++++++---------- 1 file changed, 23 insertions(+), 26 deletions(-) diff --git a/sources/tech/20150730 Howto Configure Nginx as Rreverse Proxy or Load Balancer with Weave and Docker.md b/sources/tech/20150730 Howto Configure Nginx as Rreverse Proxy or Load Balancer with Weave and Docker.md index f217db9c70..f38acdd874 100644 --- a/sources/tech/20150730 Howto Configure Nginx as Rreverse Proxy or Load Balancer with Weave and Docker.md +++ b/sources/tech/20150730 Howto Configure Nginx as Rreverse Proxy or Load Balancer with Weave and Docker.md @@ -1,24 +1,21 @@ - -Translating by dingdongnigetou - -Howto Configure Nginx as Rreverse Proxy / Load Balancer with Weave and Docker +如何使用Weave以及Docker搭建Nginx反向代理/负载均衡服务器 ================================================================================ -Hi everyone today we'll learnHowto configure Nginx as Rreverse Proxy / Load balancer with Weave and Docker Weave creates a virtual network that connects Docker containers with each other, deploys across multiple hosts and enables their automatic discovery. It allows us to focus on developing our application, rather than our infrastructure. It provides such an awesome environment that the applications uses the network as if its containers were all plugged into the same network without need to configure ports, mappings, link, etc. The services of the application containers on the network can be easily accessible to the external world with no matter where its running. Here, in this tutorial we'll be using weave to quickly and easily deploy nginx web server as a load balancer for a simple php application running in docker containers on multiple nodes in Amazon Web Services. Here, we will be introduced to WeaveDNS, which provides a simple way for containers to find each other using hostname with no changes in codes and tells other containers to connect to those names. +Hi, 今天我们将会学习如何使用如何使用Weave和Docker搭建Nginx反向代理/负载均衡服务器。Weave创建一个虚拟网络将跨主机部署的Docker容器连接在一起并使它们自动暴露给外部世界。它让我们更加专注于应用的开发,而不是基础架构。Weave提供了一个如此棒的环境,仿佛它的所有容器都属于同个网络,不需要端口/映射/连接等的配置。容器中的应用提供的服务在weave网络中可以轻易地被外部世界访问,不论你的容器运行在哪里。在这个教程里我们将会使用weave快速并且轻易地将nginx web服务器部署为一个负载均衡器,反向代理一个运行在Amazon Web Services里面多个节点上的docker容器中的简单php应用。这里我们将会介绍WeaveDNS,它提供一个简单的方式让容器利用主机名找到彼此,不需要改变代码,并且能够告诉其他容器连接到这些主机名。 -Here, in this tutorial, we will use Nginx to load balance requests to a set of containers running Apache. Here are the simple and easy to do steps on using Weave to configure nginx as a load balancer running in ubuntu docker container. +在这篇教程里,我们需要一个运行的容器集合来配置nginx负载均衡服务器。最简单轻松的方法就是使用Weave在ubuntu的docker容器中搭建nginx负载均衡服务器。 -### 1. Settting up AWS Instances ### +### 1. 搭建AWS实例 ### -First of all, we'll need to setup Amazon Web Service Instances so that we can run docker containers with Weave and Ubuntu as Operating System. We will use the [AWS CLI][1] to setup and configure two AWS EC2 instances. Here, in this tutorial, we'll use the smallest available instances, t1.micro. We will need to have a valid **Amazon Web Services account** with AWS CLI setup and configured. We'll first gonna clone the repository of weave from the github by running the following command in AWS CLI. +首先,我们需要搭建Amzaon Web Service实例,这样才能在ubuntu下用weave跑docker容器。我们将会使用[AWS CLI][1]来搭建和配置两个AWS EC2实例。在这里,我们使用最小的有效实例,t1.micro。我们需要一个有效的**Amazon Web Services账户**用以AWS命令行界面的搭建和配置。我们先在AWS命令行界面下使用下面的命令将github上的weave仓库克隆下来。 $ git clone http://github.com/fintanr/weave-gs $ cd weave-gs/aws-nginx-ubuntu-simple -After cloning the repository, we wanna run the script that will deploy two instances of t1.micro instance running Weave and Docker in Ubuntu Operating System. +在克隆完仓库之后,我们执行下面的脚本,这个脚本将会部署两个t1.micro实例,每个实例中都是ubuntu作为操作系统并用weave跑着docker容器。 $ sudo ./demo-aws-setup.sh -Here, for this tutorial we'll need the IP addresses of these instances further in future. These are stored in an environment file weavedemo.env which is created during the execution of the demo-aws-setup.sh. To get those ip addresses, we need to run the following command which will give the output similar to the output below. +在这里,我们将会在以后用到这些实例的IP地址。这些地址储存在一个weavedemo.env文件中,这个文件在执行demo-aws-setup.sh脚本的期间被创建。为了获取这些IP地址,我们需要执行下面的命令,命令输出类似下面的信息。 $ cat weavedemo.env @@ -27,56 +24,56 @@ Here, for this tutorial we'll need the IP addresses of these instances further i export WEAVE_AWS_DEMO_HOSTCOUNT=2 export WEAVE_AWS_DEMO_HOSTS=(52.26.175.175 52.26.83.141) -Please note these are not the IP addresses for our tutorial, AWS dynamically allocate IP addresses to our instances. +请注意这些不是固定的IP地址,AWS会为我们的实例动态地分配IP地址。 -As were are using a bash, we will just source this file and execute it using the command below. +我们在bash下执行下面的命令使环境变量生效。 . ./weavedemo.env -### 2. Launching Weave and WeaveDNS ### +### 2. 启动Weave and WeaveDNS ### -After deploying the instances, we'll want to launch weave and weavedns on each hosts. Weave and weavedns allows us to easily deploy our containers to a new infrastructure and configuration without the need of changing the codes and without the need to understand concepts such as ambassador containers and links. Here are the commands to launch them in the first host. +在安装完实例之后,我们将会在每台主机上启动weave以及weavedns。Weave以及weavedns使得我们能够轻易地将容器部署到一个全新的基础架构以及配置中, 不需要改变代码,也不需要去理解像Ambassador容器以及Link机制之类的概念。下面是在第一台主机上启动weave以及weavedns的命令。 ssh -i weavedemo-key.pem ubuntu@$WEAVE_AWS_DEMO_HOST1 $ sudo weave launch $ sudo weave launch-dns 10.2.1.1/24 -Next, we'll also wanna launch them in our second host. +下一步,我也准备在第二台主机上启动weave以及weavedns。 ssh -i weavedemo-key.pem ubuntu@$WEAVE_AWS_DEMO_HOST2 $ sudo weave launch $WEAVE_AWS_DEMO_HOST1 $ sudo weave launch-dns 10.2.1.2/24 -### 3. Launching Application Containers ### +### 3. 启动应用容器 ### -Now, we wanna launch six containers across our two hosts running an Apache2 Web Server instance with our simple php site. So, we'll be running the following commands which will run 3 containers running Apache2 Web Server on our 1st instance. +现在,我们准备跨两台主机启动六个容器,这两台主机都用Apache2 Web服务实例跑着简单的php网站。为了在第一个Apache2 Web服务器实例跑三个容器, 我们将会使用下面的命令。 ssh -i weavedemo-key.pem ubuntu@$WEAVE_AWS_DEMO_HOST1 $ sudo weave run --with-dns 10.3.1.1/24 -h ws1.weave.local fintanr/weave-gs-nginx-apache $ sudo weave run --with-dns 10.3.1.2/24 -h ws2.weave.local fintanr/weave-gs-nginx-apache $ sudo weave run --with-dns 10.3.1.3/24 -h ws3.weave.local fintanr/weave-gs-nginx-apache -After that, we'll again launch 3 containers running apache2 web server in our 2nd instance as shown below. +在那之后,我们将会在第二个实例上启动另外三个容器,请使用下面的命令。 ssh -i weavedemo-key.pem ubuntu@$WEAVE_AWS_DEMO_HOST2 $ sudo weave run --with-dns 10.3.1.4/24 -h ws4.weave.local fintanr/weave-gs-nginx-apache $ sudo weave run --with-dns 10.3.1.5/24 -h ws5.weave.local fintanr/weave-gs-nginx-apache $ sudo weave run --with-dns 10.3.1.6/24 -h ws6.weave.local fintanr/weave-gs-nginx-apache -Note: Here, --with-dns option tells the container to use weavedns to resolve names and -h x.weave.local allows the host to be resolvable with WeaveDNS. +注意: 在这里,--with-dns选项告诉容器使用weavedns来解析主机名,-h x.weave.local则使得weavedns能够解析指定主机。 -### 4. Launching Nginx Container ### +### 4. 启动Nginx容器 ### -After our application containers are running well as expected, we'll wanna launch an nginx container which contains the nginx configuration which will round-robin across the severs for the reverse proxy or load balancing. To run the nginx container, we'll need to run the following command. +在应用容器运行得有如意料中的稳定之后,我们将会启动nginx容器,它将会在六个应用容器服务之间轮询并提供反向代理或者负载均衡。 为了启动nginx容器,请使用下面的命令。 ssh -i weavedemo-key.pem ubuntu@$WEAVE_AWS_DEMO_HOST1 $ sudo weave run --with-dns 10.3.1.7/24 -ti -h nginx.weave.local -d -p 80:80 fintanr/weave-gs-nginx-simple -Hence, our Nginx container is publicly exposed as a http server on $WEAVE_AWS_DEMO_HOST1. +因此,我们的nginx容器在$WEAVE_AWS_DEMO_HOST1上公开地暴露成为一个http服务器。 -### 5. Testing the Load Balancer ### +### 5. 测试负载均衡服务器 ### -To test our load balancer is working or not, we'll run a script that will make http requests to our nginx container. We'll make six requests so that we can see nginx moving through each of the webservers in round-robin turn. +为了测试我们的负载均衡服务器是否可以工作,我们执行一段可以发送http请求给nginx容器的脚本。我们将会发送6个请求,这样我们就能看到nginx在一次的轮询中服务于每台web服务器之间。 $ ./access-aws-hosts.sh @@ -113,14 +110,14 @@ To test our load balancer is working or not, we'll run a script that will make h ### Conclusion ### -Finally, we've successfully configured nginx as a reverse proxy or load balancer with weave and docker running ubuntu server in AWS (Amazon Web Service) EC2 . From the above output in above step, it is clear that we have configured it correctly. We can see that the request is being sent to 6 application containers in round-robin turn which is running a PHP app hosted in apache web server. Here, weave and weavedns did great work to deploy a containerised PHP application using nginx across multiple hosts on AWS EC2 without need to change in codes and connected the containers to eachother with the hostname using weavedns. If you have any questions, suggestions, feedback please write them in the comment box below so that we can improve or update our contents. Thank you ! Enjoy :-) +我们最终成功地将nginx配置成一个反向代理/负载均衡服务器,通过使用weave以及运行在AWS(Amazon Web Service)EC2之中的ubuntu服务器里面的docker。从上面的步骤输出可以清楚的看到我们已经成功地配置了nginx。我们可以看到请求在一次循环中被发送到6个应用容器,这些容器在Apache2 Web服务器中跑着PHP应用。在这里,我们部署了一个容器化的PHP应用,使用nginx横跨多台在AWS EC2上的主机而不需要改变代码,利用weavedns使得每个容器连接在一起,只需要主机名就够了,眼前的这些便捷, 都要归功于weave以及weavedns。 如果你有任何的问题、建议、反馈,请在评论中注明,这样我们才能够做得更好,谢谢:-) -------------------------------------------------------------------------------- via: http://linoxide.com/linux-how-to/nginx-load-balancer-weave-docker/ 作者:[Arun Pyasi][a] -译者:[译者ID](https://github.com/译者ID) +译者:[dingdongnigetou](https://github.com/dingdongnigetou) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From a7ac6a469b2bd157ce10739bc1cf2a4162a48b36 Mon Sep 17 00:00:00 2001 From: Jindong Huang Date: Sat, 15 Aug 2015 16:34:48 +0800 Subject: [PATCH 934/965] =?UTF-8?q?=E3=80=90=E7=BF=BB=E8=AF=91=E5=AE=8C?= =?UTF-8?q?=E6=AF=95=E3=80=9120150730=20Howto=20Configure=20Nginx=20as=20R?= =?UTF-8?q?reverse=20Proxy=20or=20Load=20Balancer=20with=20Weave=20and=20D?= =?UTF-8?q?ocker.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... as Rreverse Proxy or Load Balancer with Weave and Docker.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20150730 Howto Configure Nginx as Rreverse Proxy or Load Balancer with Weave and Docker.md b/sources/tech/20150730 Howto Configure Nginx as Rreverse Proxy or Load Balancer with Weave and Docker.md index f38acdd874..f90a1ce76d 100644 --- a/sources/tech/20150730 Howto Configure Nginx as Rreverse Proxy or Load Balancer with Weave and Docker.md +++ b/sources/tech/20150730 Howto Configure Nginx as Rreverse Proxy or Load Balancer with Weave and Docker.md @@ -108,7 +108,7 @@ Hi, 今天我们将会学习如何使用如何使用Weave和Docker搭建Nginx反 "date" : "2015-06-26 12:24:23" } -### Conclusion ### +### 结束语 ### 我们最终成功地将nginx配置成一个反向代理/负载均衡服务器,通过使用weave以及运行在AWS(Amazon Web Service)EC2之中的ubuntu服务器里面的docker。从上面的步骤输出可以清楚的看到我们已经成功地配置了nginx。我们可以看到请求在一次循环中被发送到6个应用容器,这些容器在Apache2 Web服务器中跑着PHP应用。在这里,我们部署了一个容器化的PHP应用,使用nginx横跨多台在AWS EC2上的主机而不需要改变代码,利用weavedns使得每个容器连接在一起,只需要主机名就够了,眼前的这些便捷, 都要归功于weave以及weavedns。 如果你有任何的问题、建议、反馈,请在评论中注明,这样我们才能够做得更好,谢谢:-) From 9a3838add4034cdec57f4a73c89d1506795a5b8e Mon Sep 17 00:00:00 2001 From: Jindong Huang Date: Sat, 15 Aug 2015 16:39:06 +0800 Subject: [PATCH 935/965] Create 20150730 Howto Configure Nginx as Rreverse Proxy or Load Balancer with Weave and Docker.md --- ... or Load Balancer with Weave and Docker.md | 126 ++++++++++++++++++ 1 file changed, 126 insertions(+) create mode 100644 translated/tech/20150730 Howto Configure Nginx as Rreverse Proxy or Load Balancer with Weave and Docker.md diff --git a/translated/tech/20150730 Howto Configure Nginx as Rreverse Proxy or Load Balancer with Weave and Docker.md b/translated/tech/20150730 Howto Configure Nginx as Rreverse Proxy or Load Balancer with Weave and Docker.md new file mode 100644 index 0000000000..f90a1ce76d --- /dev/null +++ b/translated/tech/20150730 Howto Configure Nginx as Rreverse Proxy or Load Balancer with Weave and Docker.md @@ -0,0 +1,126 @@ +如何使用Weave以及Docker搭建Nginx反向代理/负载均衡服务器 +================================================================================ +Hi, 今天我们将会学习如何使用如何使用Weave和Docker搭建Nginx反向代理/负载均衡服务器。Weave创建一个虚拟网络将跨主机部署的Docker容器连接在一起并使它们自动暴露给外部世界。它让我们更加专注于应用的开发,而不是基础架构。Weave提供了一个如此棒的环境,仿佛它的所有容器都属于同个网络,不需要端口/映射/连接等的配置。容器中的应用提供的服务在weave网络中可以轻易地被外部世界访问,不论你的容器运行在哪里。在这个教程里我们将会使用weave快速并且轻易地将nginx web服务器部署为一个负载均衡器,反向代理一个运行在Amazon Web Services里面多个节点上的docker容器中的简单php应用。这里我们将会介绍WeaveDNS,它提供一个简单的方式让容器利用主机名找到彼此,不需要改变代码,并且能够告诉其他容器连接到这些主机名。 + +在这篇教程里,我们需要一个运行的容器集合来配置nginx负载均衡服务器。最简单轻松的方法就是使用Weave在ubuntu的docker容器中搭建nginx负载均衡服务器。 + +### 1. 搭建AWS实例 ### + +首先,我们需要搭建Amzaon Web Service实例,这样才能在ubuntu下用weave跑docker容器。我们将会使用[AWS CLI][1]来搭建和配置两个AWS EC2实例。在这里,我们使用最小的有效实例,t1.micro。我们需要一个有效的**Amazon Web Services账户**用以AWS命令行界面的搭建和配置。我们先在AWS命令行界面下使用下面的命令将github上的weave仓库克隆下来。 + + $ git clone http://github.com/fintanr/weave-gs + $ cd weave-gs/aws-nginx-ubuntu-simple + +在克隆完仓库之后,我们执行下面的脚本,这个脚本将会部署两个t1.micro实例,每个实例中都是ubuntu作为操作系统并用weave跑着docker容器。 + + $ sudo ./demo-aws-setup.sh + +在这里,我们将会在以后用到这些实例的IP地址。这些地址储存在一个weavedemo.env文件中,这个文件在执行demo-aws-setup.sh脚本的期间被创建。为了获取这些IP地址,我们需要执行下面的命令,命令输出类似下面的信息。 + + $ cat weavedemo.env + + export WEAVE_AWS_DEMO_HOST1=52.26.175.175 + export WEAVE_AWS_DEMO_HOST2=52.26.83.141 + export WEAVE_AWS_DEMO_HOSTCOUNT=2 + export WEAVE_AWS_DEMO_HOSTS=(52.26.175.175 52.26.83.141) + +请注意这些不是固定的IP地址,AWS会为我们的实例动态地分配IP地址。 + +我们在bash下执行下面的命令使环境变量生效。 + + . ./weavedemo.env + +### 2. 启动Weave and WeaveDNS ### + +在安装完实例之后,我们将会在每台主机上启动weave以及weavedns。Weave以及weavedns使得我们能够轻易地将容器部署到一个全新的基础架构以及配置中, 不需要改变代码,也不需要去理解像Ambassador容器以及Link机制之类的概念。下面是在第一台主机上启动weave以及weavedns的命令。 + + ssh -i weavedemo-key.pem ubuntu@$WEAVE_AWS_DEMO_HOST1 + $ sudo weave launch + $ sudo weave launch-dns 10.2.1.1/24 + +下一步,我也准备在第二台主机上启动weave以及weavedns。 + + ssh -i weavedemo-key.pem ubuntu@$WEAVE_AWS_DEMO_HOST2 + $ sudo weave launch $WEAVE_AWS_DEMO_HOST1 + $ sudo weave launch-dns 10.2.1.2/24 + +### 3. 启动应用容器 ### + +现在,我们准备跨两台主机启动六个容器,这两台主机都用Apache2 Web服务实例跑着简单的php网站。为了在第一个Apache2 Web服务器实例跑三个容器, 我们将会使用下面的命令。 + + ssh -i weavedemo-key.pem ubuntu@$WEAVE_AWS_DEMO_HOST1 + $ sudo weave run --with-dns 10.3.1.1/24 -h ws1.weave.local fintanr/weave-gs-nginx-apache + $ sudo weave run --with-dns 10.3.1.2/24 -h ws2.weave.local fintanr/weave-gs-nginx-apache + $ sudo weave run --with-dns 10.3.1.3/24 -h ws3.weave.local fintanr/weave-gs-nginx-apache + +在那之后,我们将会在第二个实例上启动另外三个容器,请使用下面的命令。 + + ssh -i weavedemo-key.pem ubuntu@$WEAVE_AWS_DEMO_HOST2 + $ sudo weave run --with-dns 10.3.1.4/24 -h ws4.weave.local fintanr/weave-gs-nginx-apache + $ sudo weave run --with-dns 10.3.1.5/24 -h ws5.weave.local fintanr/weave-gs-nginx-apache + $ sudo weave run --with-dns 10.3.1.6/24 -h ws6.weave.local fintanr/weave-gs-nginx-apache + +注意: 在这里,--with-dns选项告诉容器使用weavedns来解析主机名,-h x.weave.local则使得weavedns能够解析指定主机。 + +### 4. 启动Nginx容器 ### + +在应用容器运行得有如意料中的稳定之后,我们将会启动nginx容器,它将会在六个应用容器服务之间轮询并提供反向代理或者负载均衡。 为了启动nginx容器,请使用下面的命令。 + + ssh -i weavedemo-key.pem ubuntu@$WEAVE_AWS_DEMO_HOST1 + $ sudo weave run --with-dns 10.3.1.7/24 -ti -h nginx.weave.local -d -p 80:80 fintanr/weave-gs-nginx-simple + +因此,我们的nginx容器在$WEAVE_AWS_DEMO_HOST1上公开地暴露成为一个http服务器。 + +### 5. 测试负载均衡服务器 ### + +为了测试我们的负载均衡服务器是否可以工作,我们执行一段可以发送http请求给nginx容器的脚本。我们将会发送6个请求,这样我们就能看到nginx在一次的轮询中服务于每台web服务器之间。 + + $ ./access-aws-hosts.sh + + { + "message" : "Hello Weave - nginx example", + "hostname" : "ws1.weave.local", + "date" : "2015-06-26 12:24:23" + } + { + "message" : "Hello Weave - nginx example", + "hostname" : "ws2.weave.local", + "date" : "2015-06-26 12:24:23" + } + { + "message" : "Hello Weave - nginx example", + "hostname" : "ws3.weave.local", + "date" : "2015-06-26 12:24:23" + } + { + "message" : "Hello Weave - nginx example", + "hostname" : "ws4.weave.local", + "date" : "2015-06-26 12:24:23" + } + { + "message" : "Hello Weave - nginx example", + "hostname" : "ws5.weave.local", + "date" : "2015-06-26 12:24:23" + } + { + "message" : "Hello Weave - nginx example", + "hostname" : "ws6.weave.local", + "date" : "2015-06-26 12:24:23" + } + +### 结束语 ### + +我们最终成功地将nginx配置成一个反向代理/负载均衡服务器,通过使用weave以及运行在AWS(Amazon Web Service)EC2之中的ubuntu服务器里面的docker。从上面的步骤输出可以清楚的看到我们已经成功地配置了nginx。我们可以看到请求在一次循环中被发送到6个应用容器,这些容器在Apache2 Web服务器中跑着PHP应用。在这里,我们部署了一个容器化的PHP应用,使用nginx横跨多台在AWS EC2上的主机而不需要改变代码,利用weavedns使得每个容器连接在一起,只需要主机名就够了,眼前的这些便捷, 都要归功于weave以及weavedns。 如果你有任何的问题、建议、反馈,请在评论中注明,这样我们才能够做得更好,谢谢:-) + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/linux-how-to/nginx-load-balancer-weave-docker/ + +作者:[Arun Pyasi][a] +译者:[dingdongnigetou](https://github.com/dingdongnigetou) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://linoxide.com/author/arunp/ +[1]:http://console.aws.amazon.com/ From b95ff897f01ac5378675bbbe5a390d395c7db16e Mon Sep 17 00:00:00 2001 From: Jindong Huang Date: Sat, 15 Aug 2015 16:39:26 +0800 Subject: [PATCH 936/965] Delete 20150730 Howto Configure Nginx as Rreverse Proxy or Load Balancer with Weave and Docker.md --- ... or Load Balancer with Weave and Docker.md | 126 ------------------ 1 file changed, 126 deletions(-) delete mode 100644 sources/tech/20150730 Howto Configure Nginx as Rreverse Proxy or Load Balancer with Weave and Docker.md diff --git a/sources/tech/20150730 Howto Configure Nginx as Rreverse Proxy or Load Balancer with Weave and Docker.md b/sources/tech/20150730 Howto Configure Nginx as Rreverse Proxy or Load Balancer with Weave and Docker.md deleted file mode 100644 index f90a1ce76d..0000000000 --- a/sources/tech/20150730 Howto Configure Nginx as Rreverse Proxy or Load Balancer with Weave and Docker.md +++ /dev/null @@ -1,126 +0,0 @@ -如何使用Weave以及Docker搭建Nginx反向代理/负载均衡服务器 -================================================================================ -Hi, 今天我们将会学习如何使用如何使用Weave和Docker搭建Nginx反向代理/负载均衡服务器。Weave创建一个虚拟网络将跨主机部署的Docker容器连接在一起并使它们自动暴露给外部世界。它让我们更加专注于应用的开发,而不是基础架构。Weave提供了一个如此棒的环境,仿佛它的所有容器都属于同个网络,不需要端口/映射/连接等的配置。容器中的应用提供的服务在weave网络中可以轻易地被外部世界访问,不论你的容器运行在哪里。在这个教程里我们将会使用weave快速并且轻易地将nginx web服务器部署为一个负载均衡器,反向代理一个运行在Amazon Web Services里面多个节点上的docker容器中的简单php应用。这里我们将会介绍WeaveDNS,它提供一个简单的方式让容器利用主机名找到彼此,不需要改变代码,并且能够告诉其他容器连接到这些主机名。 - -在这篇教程里,我们需要一个运行的容器集合来配置nginx负载均衡服务器。最简单轻松的方法就是使用Weave在ubuntu的docker容器中搭建nginx负载均衡服务器。 - -### 1. 搭建AWS实例 ### - -首先,我们需要搭建Amzaon Web Service实例,这样才能在ubuntu下用weave跑docker容器。我们将会使用[AWS CLI][1]来搭建和配置两个AWS EC2实例。在这里,我们使用最小的有效实例,t1.micro。我们需要一个有效的**Amazon Web Services账户**用以AWS命令行界面的搭建和配置。我们先在AWS命令行界面下使用下面的命令将github上的weave仓库克隆下来。 - - $ git clone http://github.com/fintanr/weave-gs - $ cd weave-gs/aws-nginx-ubuntu-simple - -在克隆完仓库之后,我们执行下面的脚本,这个脚本将会部署两个t1.micro实例,每个实例中都是ubuntu作为操作系统并用weave跑着docker容器。 - - $ sudo ./demo-aws-setup.sh - -在这里,我们将会在以后用到这些实例的IP地址。这些地址储存在一个weavedemo.env文件中,这个文件在执行demo-aws-setup.sh脚本的期间被创建。为了获取这些IP地址,我们需要执行下面的命令,命令输出类似下面的信息。 - - $ cat weavedemo.env - - export WEAVE_AWS_DEMO_HOST1=52.26.175.175 - export WEAVE_AWS_DEMO_HOST2=52.26.83.141 - export WEAVE_AWS_DEMO_HOSTCOUNT=2 - export WEAVE_AWS_DEMO_HOSTS=(52.26.175.175 52.26.83.141) - -请注意这些不是固定的IP地址,AWS会为我们的实例动态地分配IP地址。 - -我们在bash下执行下面的命令使环境变量生效。 - - . ./weavedemo.env - -### 2. 启动Weave and WeaveDNS ### - -在安装完实例之后,我们将会在每台主机上启动weave以及weavedns。Weave以及weavedns使得我们能够轻易地将容器部署到一个全新的基础架构以及配置中, 不需要改变代码,也不需要去理解像Ambassador容器以及Link机制之类的概念。下面是在第一台主机上启动weave以及weavedns的命令。 - - ssh -i weavedemo-key.pem ubuntu@$WEAVE_AWS_DEMO_HOST1 - $ sudo weave launch - $ sudo weave launch-dns 10.2.1.1/24 - -下一步,我也准备在第二台主机上启动weave以及weavedns。 - - ssh -i weavedemo-key.pem ubuntu@$WEAVE_AWS_DEMO_HOST2 - $ sudo weave launch $WEAVE_AWS_DEMO_HOST1 - $ sudo weave launch-dns 10.2.1.2/24 - -### 3. 启动应用容器 ### - -现在,我们准备跨两台主机启动六个容器,这两台主机都用Apache2 Web服务实例跑着简单的php网站。为了在第一个Apache2 Web服务器实例跑三个容器, 我们将会使用下面的命令。 - - ssh -i weavedemo-key.pem ubuntu@$WEAVE_AWS_DEMO_HOST1 - $ sudo weave run --with-dns 10.3.1.1/24 -h ws1.weave.local fintanr/weave-gs-nginx-apache - $ sudo weave run --with-dns 10.3.1.2/24 -h ws2.weave.local fintanr/weave-gs-nginx-apache - $ sudo weave run --with-dns 10.3.1.3/24 -h ws3.weave.local fintanr/weave-gs-nginx-apache - -在那之后,我们将会在第二个实例上启动另外三个容器,请使用下面的命令。 - - ssh -i weavedemo-key.pem ubuntu@$WEAVE_AWS_DEMO_HOST2 - $ sudo weave run --with-dns 10.3.1.4/24 -h ws4.weave.local fintanr/weave-gs-nginx-apache - $ sudo weave run --with-dns 10.3.1.5/24 -h ws5.weave.local fintanr/weave-gs-nginx-apache - $ sudo weave run --with-dns 10.3.1.6/24 -h ws6.weave.local fintanr/weave-gs-nginx-apache - -注意: 在这里,--with-dns选项告诉容器使用weavedns来解析主机名,-h x.weave.local则使得weavedns能够解析指定主机。 - -### 4. 启动Nginx容器 ### - -在应用容器运行得有如意料中的稳定之后,我们将会启动nginx容器,它将会在六个应用容器服务之间轮询并提供反向代理或者负载均衡。 为了启动nginx容器,请使用下面的命令。 - - ssh -i weavedemo-key.pem ubuntu@$WEAVE_AWS_DEMO_HOST1 - $ sudo weave run --with-dns 10.3.1.7/24 -ti -h nginx.weave.local -d -p 80:80 fintanr/weave-gs-nginx-simple - -因此,我们的nginx容器在$WEAVE_AWS_DEMO_HOST1上公开地暴露成为一个http服务器。 - -### 5. 测试负载均衡服务器 ### - -为了测试我们的负载均衡服务器是否可以工作,我们执行一段可以发送http请求给nginx容器的脚本。我们将会发送6个请求,这样我们就能看到nginx在一次的轮询中服务于每台web服务器之间。 - - $ ./access-aws-hosts.sh - - { - "message" : "Hello Weave - nginx example", - "hostname" : "ws1.weave.local", - "date" : "2015-06-26 12:24:23" - } - { - "message" : "Hello Weave - nginx example", - "hostname" : "ws2.weave.local", - "date" : "2015-06-26 12:24:23" - } - { - "message" : "Hello Weave - nginx example", - "hostname" : "ws3.weave.local", - "date" : "2015-06-26 12:24:23" - } - { - "message" : "Hello Weave - nginx example", - "hostname" : "ws4.weave.local", - "date" : "2015-06-26 12:24:23" - } - { - "message" : "Hello Weave - nginx example", - "hostname" : "ws5.weave.local", - "date" : "2015-06-26 12:24:23" - } - { - "message" : "Hello Weave - nginx example", - "hostname" : "ws6.weave.local", - "date" : "2015-06-26 12:24:23" - } - -### 结束语 ### - -我们最终成功地将nginx配置成一个反向代理/负载均衡服务器,通过使用weave以及运行在AWS(Amazon Web Service)EC2之中的ubuntu服务器里面的docker。从上面的步骤输出可以清楚的看到我们已经成功地配置了nginx。我们可以看到请求在一次循环中被发送到6个应用容器,这些容器在Apache2 Web服务器中跑着PHP应用。在这里,我们部署了一个容器化的PHP应用,使用nginx横跨多台在AWS EC2上的主机而不需要改变代码,利用weavedns使得每个容器连接在一起,只需要主机名就够了,眼前的这些便捷, 都要归功于weave以及weavedns。 如果你有任何的问题、建议、反馈,请在评论中注明,这样我们才能够做得更好,谢谢:-) - --------------------------------------------------------------------------------- - -via: http://linoxide.com/linux-how-to/nginx-load-balancer-weave-docker/ - -作者:[Arun Pyasi][a] -译者:[dingdongnigetou](https://github.com/dingdongnigetou) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://linoxide.com/author/arunp/ -[1]:http://console.aws.amazon.com/ From db0e5a7401554ce7ab4b6e0baa04d17242cee1a2 Mon Sep 17 00:00:00 2001 From: Chang Liu Date: Sat, 15 Aug 2015 17:12:33 +0800 Subject: [PATCH 937/965] [Translated]RHCSA Series--Part 05--Process Management in RHEL 7--Boot Shutdown and Everything in Between.md --- ...Boot Shutdown and Everything in Between.md | 218 ------------------ ...Boot Shutdown and Everything in Between.md | 214 +++++++++++++++++ 2 files changed, 214 insertions(+), 218 deletions(-) delete mode 100644 sources/tech/RHCSA Series/RHCSA Series--Part 05--Process Management in RHEL 7--Boot Shutdown and Everything in Between.md create mode 100644 translated/tech/RHCSA/RHCSA Series--Part 05--Process Management in RHEL 7--Boot Shutdown and Everything in Between.md diff --git a/sources/tech/RHCSA Series/RHCSA Series--Part 05--Process Management in RHEL 7--Boot Shutdown and Everything in Between.md b/sources/tech/RHCSA Series/RHCSA Series--Part 05--Process Management in RHEL 7--Boot Shutdown and Everything in Between.md deleted file mode 100644 index 23bf9f0ac1..0000000000 --- a/sources/tech/RHCSA Series/RHCSA Series--Part 05--Process Management in RHEL 7--Boot Shutdown and Everything in Between.md +++ /dev/null @@ -1,218 +0,0 @@ -FSSlc translating - -RHCSA Series: Process Management in RHEL 7: Boot, Shutdown, and Everything in Between – Part 5 -================================================================================ -We will start this article with an overall and brief revision of what happens since the moment you press the Power button to turn on your RHEL 7 server until you are presented with the login screen in a command line interface. - -![RHEL 7 Boot Process](http://www.tecmint.com/wp-content/uploads/2015/03/RHEL-7-Boot-Process.png) - -Linux Boot Process - -**Please note that:** - -1. the same basic principles apply, with perhaps minor modifications, to other Linux distributions as well, and -2. the following description is not intended to represent an exhaustive explanation of the boot process, but only the fundamentals. - -### Linux Boot Process ### - -1. The POST (Power On Self Test) initializes and performs hardware checks. - -2. When the POST finishes, the system control is passed to the first stage boot loader, which is stored on either the boot sector of one of the hard disks (for older systems using BIOS and MBR), or a dedicated (U)EFI partition. - -3. The first stage boot loader then loads the second stage boot loader, most usually GRUB (GRand Unified Boot Loader), which resides inside /boot, which in turn loads the kernel and the initial RAM–based file system (also known as initramfs, which contains programs and binary files that perform the necessary actions needed to ultimately mount the actual root filesystem). - -4. We are presented with a splash screen that allows us to choose an operating system and kernel to boot: - -![RHEL 7 Boot Screen](http://www.tecmint.com/wp-content/uploads/2015/03/RHEL-7-Boot-Screen.png) - -Boot Menu Screen - -5. The kernel sets up the hardware attached to the system and once the root filesystem has been mounted, launches process with PID 1, which in turn will initialize other processes and present us with a login prompt. - -Note: That if we wish to do so at a later time, we can examine the specifics of this process using the [dmesg command][1] and filtering its output using the tools that we have explained in previous articles of this series. - -![Login Screen and Process PID](http://www.tecmint.com/wp-content/uploads/2015/03/Login-Screen-Process-PID.png) - -Login Screen and Process PID - -In the example above, we used the well-known ps command to display a list of current processes whose parent process (or in other words, the process that started them) is systemd (the system and service manager that most modern Linux distributions have switched to) during system startup: - - # ps -o ppid,pid,uname,comm --ppid=1 - -Remember that the -o flag (short for –format) allows you to present the output of ps in a customized format to suit your needs using the keywords specified in the STANDARD FORMAT SPECIFIERS section in man ps. - -Another case in which you will want to define the output of ps instead of going with the default is when you need to find processes that are causing a significant CPU and / or memory load, and sort them accordingly: - - # ps aux --sort=+pcpu # Sort by %CPU (ascending) - # ps aux --sort=-pcpu # Sort by %CPU (descending) - # ps aux --sort=+pmem # Sort by %MEM (ascending) - # ps aux --sort=-pmem # Sort by %MEM (descending) - # ps aux --sort=+pcpu,-pmem # Combine sort by %CPU (ascending) and %MEM (descending) - -![http://www.tecmint.com/wp-content/uploads/2015/03/ps-command-output.png](http://www.tecmint.com/wp-content/uploads/2015/03/ps-command-output.png) - -Customize ps Command Output - -### An Introduction to SystemD ### - -Few decisions in the Linux world have caused more controversies than the adoption of systemd by major Linux distributions. Systemd’s advocates name as its main advantages the following facts: - -Read Also: [The Story Behind ‘init’ and ‘systemd’][2] - -1. Systemd allows more processing to be done in parallel during system startup (as opposed to older SysVinit, which always tends to be slower because it starts processes one by one, checks if one depends on another, and then waits for daemons to launch so more services can start), and - -2. It works as a dynamic resource management in a running system. Thus, services are started when needed (to avoid consuming system resources if they are not being used) instead of being launched without a valid reason during boot. - -3. Backwards compatibility with SysVinit scripts. - -Systemd is controlled by the systemctl utility. If you come from a SysVinit background, chances are you will be familiar with: - -- the service tool, which -in those older systems- was used to manage SysVinit scripts, and -- the chkconfig utility, which served the purpose of updating and querying runlevel information for system services. -- shutdown, which you must have used several times to either restart or halt a running system. - -The following table shows the similarities between the use of these legacy tools and systemctl: - -注:表格 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Legacy toolSystemctl equivalentDescription
service name startsystemctl start nameStart name (where name is a service)
service name stopsystemctl stop nameStop name
service name condrestartsystemctl try-restart nameRestarts name (if it’s already running)
service name restartsystemctl restart nameRestarts name
service name reloadsystemctl reload nameReloads the configuration for name
service name statussystemctl status nameDisplays the current status of name
service –status-allsystemctlDisplays the status of all current services
chkconfig name onsystemctl enable nameEnable name to run on startup as specified in the unit file (the file to which the symlink points). The process of enabling or disabling a service to start automatically on boot consists in adding or removing symbolic links inside the /etc/systemd/system directory.
chkconfig name offsystemctl disable nameDisables name to run on startup as specified in the unit file (the file to which the symlink points)
chkconfig –list namesystemctl is-enabled nameVerify whether name (a specific service) is currently enabled
chkconfig –listsystemctl –type=serviceDisplays all services and tells whether they are enabled or disabled
shutdown -h nowsystemctl poweroffPower-off the machine (halt)
shutdown -r nowsystemctl rebootReboot the system
- -Systemd also introduced the concepts of units (which can be either a service, a mount point, a device, or a network socket) and targets (which is how systemd manages to start several related process at the same time, and can be considered -though not equal- as the equivalent of runlevels in SysVinit-based systems. - -### Summing Up ### - -Other tasks related with process management include, but may not be limited to, the ability to: - -**1. Adjust the execution priority as far as the use of system resources is concerned of a process:** - -This is accomplished through the renice utility, which alters the scheduling priority of one or more running processes. In simple terms, the scheduling priority is a feature that allows the kernel (present in versions => 2.6) to allocate system resources as per the assigned execution priority (aka niceness, in a range from -20 through 19) of a given process. - -The basic syntax of renice is as follows: - - # renice [-n] priority [-gpu] identifier - -In the generic command above, the first argument is the priority value to be used, whereas the other argument can be interpreted as process IDs (which is the default setting), process group IDs, user IDs, or user names. A normal user (other than root) can only modify the scheduling priority of a process he or she owns, and only increase the niceness level (which means taking up less system resources). - -![Renice Process in Linux](http://www.tecmint.com/wp-content/uploads/2015/03/Process-Scheduling-Priority.png) - -Process Scheduling Priority - -**2. Kill (or interrupt the normal execution) of a process as needed:** - -In more precise terms, killing a process entitles sending it a signal to either finish its execution gracefully (SIGTERM=15) or immediately (SIGKILL=9) through the [kill or pkill commands][3]. - -The difference between these two tools is that the former is used to terminate a specific process or a process group altogether, while the latter allows you to do the same based on name and other attributes. - -In addition, pkill comes bundled with pgrep, which shows you the PIDs that will be affected should pkill be used. For example, before running: - - # pkill -u gacanepa - -It may be useful to view at a glance which are the PIDs owned by gacanepa: - - # pgrep -l -u gacanepa - -![Find PIDs of User](http://www.tecmint.com/wp-content/uploads/2015/03/Find-PIDs-of-User.png) - -Find PIDs of User - -By default, both kill and pkill send the SIGTERM signal to the process. As we mentioned above, this signal can be ignored (while the process finishes its execution or for good), so when you seriously need to stop a running process with a valid reason, you will need to specify the SIGKILL signal on the command line: - - # kill -9 identifier # Kill a process or a process group - # kill -s SIGNAL identifier # Idem - # pkill -s SIGNAL identifier # Kill a process by name or other attributes - -### Conclusion ### - -In this article we have explained the basics of the boot process in a RHEL 7 system, and analyzed some of the tools that are available to help you with managing processes using common utilities and systemd-specific commands. - -Note that this list is not intended to cover all the bells and whistles of this topic, so feel free to add your own preferred tools and commands to this article using the comment form below. Questions and other comments are also welcome. - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/rhcsa-exam-boot-process-and-process-management/ - -作者:[Gabriel Cánepa][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.tecmint.com/author/gacanepa/ -[1]:http://www.tecmint.com/dmesg-commands/ -[2]:http://www.tecmint.com/systemd-replaces-init-in-linux/ -[3]:http://www.tecmint.com/how-to-kill-a-process-in-linux/ diff --git a/translated/tech/RHCSA/RHCSA Series--Part 05--Process Management in RHEL 7--Boot Shutdown and Everything in Between.md b/translated/tech/RHCSA/RHCSA Series--Part 05--Process Management in RHEL 7--Boot Shutdown and Everything in Between.md new file mode 100644 index 0000000000..91e2482e49 --- /dev/null +++ b/translated/tech/RHCSA/RHCSA Series--Part 05--Process Management in RHEL 7--Boot Shutdown and Everything in Between.md @@ -0,0 +1,214 @@ +RHECSA 系列:RHEL7 中的进程管理:开机,关机,以及两者之间的所有其他事项 – Part 5 +================================================================================ +我们将概括和简要地复习从你按开机按钮来打开你的 RHEL 7 服务器到呈现出命令行界面的登录屏幕之间所发生的所有事情,以此来作为这篇文章的开始。 + +![RHEL 7 开机过程](http://www.tecmint.com/wp-content/uploads/2015/03/RHEL-7-Boot-Process.png) + +Linux 开机过程 + +**请注意:** + +1. 相同的基本原则也可以应用到其他的 Linux 发行版本中,但可能需要较小的更改,并且 +2. 下面的描述并不是旨在给出开机过程的一个详尽的解释,而只是介绍一些基础的东西 + +### Linux 开机过程 ### + +1.初始化 POST(加电自检)并执行硬件检查; + +2.当 POST 完成后,系统的控制权将移交给启动管理器的第一阶段,它存储在一个硬盘的引导扇区(对于使用 BIOS 和 MBR 的旧式的系统)或存储在一个专门的 (U)EFI 分区上。 + +3.启动管理器的第一阶段完成后,接着进入启动管理器的第二阶段,通常大多数使用的是 GRUB(GRand Unified Boot Loader 的简称),它驻留在 `/boot` 中,反过来加载内核和驻留在 RAM 中的初始化文件系统(被称为 initramfs,它包含执行必要操作所需要的程序和二进制文件,以此来最终挂载真实的根文件系统)。 + +4.接着经历了闪屏过后,呈现在我们眼前的是类似下图的画面,它允许我们选择一个操作系统和内核来启动: + +![RHEL 7 开机屏幕](http://www.tecmint.com/wp-content/uploads/2015/03/RHEL-7-Boot-Screen.png) + +启动菜单屏幕 + +5.然后内核对挂载到系统的硬件进行设置,一旦根文件系统被挂载,接着便启动 PID 为 1 的进程,反过来这个进程将初始化其他的进程并最终呈现给我们一个登录提示符界面。 + +注意:假如我们想在后面这样做(注:这句话我总感觉不通顺,不明白它的意思,希望改一下),我们可以使用 [dmesg 命令][1](注:这篇文章已经翻译并发表了,链接是 https://linux.cn/article-3587-1.html )并使用这个系列里的上一篇文章中解释过的工具(注:即 grep)来过滤它的输出。 + +![登录屏幕和进程的 PID](http://www.tecmint.com/wp-content/uploads/2015/03/Login-Screen-Process-PID.png) + +登录屏幕和进程的 PID + +在上面的例子中,我们使用了众所周知的 `ps` 命令来显示在系统启动过程中的一系列当前进程的信息,它们的父进程(或者换句话说,就是那个开启这些进程的进程) 为 systemd(大多数现代的 Linux 发行版本已经切换到的系统和服务管理器): + + # ps -o ppid,pid,uname,comm --ppid=1 + +记住 `-o`(为 -format 的简写)选项允许你以一个自定义的格式来显示 ps 的输出,以此来满足你的需求;这个自定义格式使用 man ps 里 STANDARD FORMAT SPECIFIERS 一节中的特定关键词。 + +另一个你想自定义 ps 的输出而不是使用其默认输出的情形是:当你需要找到引起 CPU 或内存消耗过多的那些进程,并按照下列方式来对它们进行排序时: + + # ps aux --sort=+pcpu # 以 %CPU 来排序(增序) + # ps aux --sort=-pcpu # 以 %CPU 来排序(降序) + # ps aux --sort=+pmem # 以 %MEM 来排序(增序) + # ps aux --sort=-pmem # 以 %MEM 来排序(降序) + # ps aux --sort=+pcpu,-pmem # 结合 %CPU (增序) 和 %MEM (降序)来排列 + +![http://www.tecmint.com/wp-content/uploads/2015/03/ps-command-output.png](http://www.tecmint.com/wp-content/uploads/2015/03/ps-command-output.png) + +自定义 ps 命令的输出 + +### systemd 的一个介绍 ### + +在 Linux 世界中,很少有决定能够比在主流的 Linux 发行版本中采用 systemd 引起更多的争论。systemd 的倡导者根据以下事实命名其主要的优势: + +另外请阅读: ['init' 和 'systemd' 背后的故事][2] + +1. 在系统启动期间,systemd 允许并发地启动更多的进程(相比于先前的 SysVinit,SysVinit 似乎总是表现得更慢,因为它一个接一个地启动进程,检查一个进程是否依赖于另一个进程,然后等待守护进程去开启可以开始的更多的服务),并且 +2. 在一个运行着的系统中,它作为一个动态的资源管理器来工作。这样在开机期间,当一个服务被需要时,才启动它(以此来避免消耗系统资源)而不是在没有一个合理的原因的情况下启动额外的服务。 +3. 向后兼容 sysvinit 的脚本。 + +systemd 由 systemctl 工具控制,假如你带有 SysVinit 背景,你将会对以下的内容感到熟悉: + +- service 工具, 在旧一点的系统中,它被用来管理 SysVinit 脚本,以及 +- chkconfig 工具, 为系统服务升级和查询运行级别信息 +- shutdown, 你一定使用过几次来重启或关闭一个运行的系统。 + +下面的表格展示了使用传统的工具和 systemctl 之间的相似之处: + +注:表格 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Legacy toolSystemctl equivalentDescription
service name startsystemctl start nameStart name (where name is a service)
service name stopsystemctl stop nameStop name
service name condrestartsystemctl try-restart nameRestarts name (if it’s already running)
service name restartsystemctl restart nameRestarts name
service name reloadsystemctl reload nameReloads the configuration for name
service name statussystemctl status nameDisplays the current status of name
service –status-allsystemctlDisplays the status of all current services
chkconfig name onsystemctl enable nameEnable name to run on startup as specified in the unit file (the file to which the symlink points). The process of enabling or disabling a service to start automatically on boot consists in adding or removing symbolic links inside the /etc/systemd/system directory.
chkconfig name offsystemctl disable nameDisables name to run on startup as specified in the unit file (the file to which the symlink points)
chkconfig –list namesystemctl is-enabled nameVerify whether name (a specific service) is currently enabled
chkconfig –listsystemctl –type=serviceDisplays all services and tells whether they are enabled or disabled
shutdown -h nowsystemctl poweroffPower-off the machine (halt)
shutdown -r nowsystemctl rebootReboot the system
+ +systemd 也引进了单元(它可能是一个服务,一个挂载点,一个设备或者一个网络套接字)和目标(它们定义了 systemd 如何去管理和同时开启几个相关的进程,并可认为它们与在基于 SysVinit 的系统中的运行级别等价,尽管事实上它们并不等价)。 + +### 总结归纳 ### + +其他与进程管理相关,但并不仅限于下面所列的功能的任务有: + +**1. 在考虑到系统资源的使用上,调整一个进程的执行优先级:** + +这是通过 `renice` 工具来完成的,它可以改变一个或多个正在运行着的进程的调度优先级。简单来说,调度优先级是一个允许内核(当前只支持 >= 2.6 的版本)根据某个给定进程被分配的执行优先级(即优先级,从 -20 到 19)来为其分配系统资源的功能。 + +`renice` 的基本语法如下: + + # renice [-n] priority [-gpu] identifier + +在上面的通用命令中,第一个参数是将要使用的优先级数值,而另一个参数可以解释为进程 ID(这是默认的设定),进程组 ID,用户 ID 或者用户名。一个常规的用户(即除 root 以外的用户)只可以更改他或她所拥有的进程的调度优先级,并且只能增加优先级的层次(这意味着占用更少的系统资源)。 + +![在 Linux 中调整进程的优先级](http://www.tecmint.com/wp-content/uploads/2015/03/Process-Scheduling-Priority.png) + +进程调度优先级 + +**2. 按照需要杀死一个进程(或终止其正常执行):** + +更精确地说,杀死一个进程指的是通过 [kill 或 pkill][3]命令给该进程发送一个信号,让它优雅地(SIGTERM=15)或立即(SIGKILL=9)结束它的执行。 + +这两个工具的不同之处在于前一个被用来终止一个特定的进程或一个进程组,而后一个则允许你在进程的名称和其他属性的基础上,执行相同的动作。 + +另外, pkill 与 pgrep 相捆绑,pgrep 提供将受影响的进程的 PID 给 pkill 来使用。例如,在运行下面的命令之前: + + # pkill -u gacanepa + +查看一眼由 gacanepa 所拥有的 PID 或许会带来点帮助: + + # pgrep -l -u gacanepa + +![找到用户拥有的 PID](http://www.tecmint.com/wp-content/uploads/2015/03/Find-PIDs-of-User.png) + +找到用户拥有的 PID + +默认情况下,kill 和 pkiill 都发送 SIGTERM 信号给进程,如我们上面提到的那样,这个信号可以被忽略(即该进程可能会终止其自身的执行或者不终止),所以当你因一个合理的理由要真正地停止一个运行着的进程,则你将需要在命令行中带上特定的 SIGKILL 信号: + + # kill -9 identifier # 杀死一个进程或一个进程组 + # kill -s SIGNAL identifier # 同上 + # pkill -s SIGNAL identifier # 通过名称或其他属性来杀死一个进程 + +### 结论 ### + +在这篇文章中,我们解释了在 RHEL 7 系统中,有关开机启动过程的基本知识,并分析了一些可用的工具来帮助你通过使用一般的程序和 systemd 特有的命令来管理进程。 + +请注意,这个列表并不旨在涵盖有关这个话题的所有花哨的工具,请随意使用下面的评论栏来添加你自已钟爱的工具和命令。同时欢迎你的提问和其他的评论。 + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/rhcsa-exam-boot-process-and-process-management/ + +作者:[Gabriel Cánepa][a] +译者:[FSSlc](https://github.com/FSSlc) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/gacanepa/ +[1]:http://www.tecmint.com/dmesg-commands/ +[2]:http://www.tecmint.com/systemd-replaces-init-in-linux/ +[3]:http://www.tecmint.com/how-to-kill-a-process-in-linux/ From 1d98d80fc80ef59545d36b7b4fe98f11ab6b7947 Mon Sep 17 00:00:00 2001 From: Chang Liu Date: Sat, 15 Aug 2015 17:20:30 +0800 Subject: [PATCH 938/965] Update RHCSA Series--Part 06--Using 'Parted' and 'SSM' to Configure and Encrypt System Storage.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 准备翻译该篇。 --- ...rted' and 'SSM' to Configure and Encrypt System Storage.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/tech/RHCSA Series/RHCSA Series--Part 06--Using 'Parted' and 'SSM' to Configure and Encrypt System Storage.md b/sources/tech/RHCSA Series/RHCSA Series--Part 06--Using 'Parted' and 'SSM' to Configure and Encrypt System Storage.md index 474b707d23..0e631ce37d 100644 --- a/sources/tech/RHCSA Series/RHCSA Series--Part 06--Using 'Parted' and 'SSM' to Configure and Encrypt System Storage.md +++ b/sources/tech/RHCSA Series/RHCSA Series--Part 06--Using 'Parted' and 'SSM' to Configure and Encrypt System Storage.md @@ -1,3 +1,5 @@ +FSSlc translating + RHCSA Series: Using ‘Parted’ and ‘SSM’ to Configure and Encrypt System Storage – Part 6 ================================================================================ In this article we will discuss how to set up and configure local system storage in Red Hat Enterprise Linux 7 using classic tools and introducing the System Storage Manager (also known as SSM), which greatly simplifies this task. @@ -266,4 +268,4 @@ via: http://www.tecmint.com/rhcsa-exam-create-format-resize-delete-and-encrypt-p 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 [a]:http://www.tecmint.com/author/gacanepa/ -[1]:http://www.tecmint.com/create-lvm-storage-in-linux/ \ No newline at end of file +[1]:http://www.tecmint.com/create-lvm-storage-in-linux/ From 26c93e98c624b0e916b8f6b78fab8ed4c29f062a Mon Sep 17 00:00:00 2001 From: ictlyh Date: Sat, 15 Aug 2015 17:53:07 +0800 Subject: [PATCH 939/965] [Translated] tech/RHCE/Part 3 - How to Produce and Deliver System Activity Reports Using Linux Toolsets.md --- ...m Activity Reports Using Linux Toolsets.md | 183 ------------------ ...m Activity Reports Using Linux Toolsets.md | 182 +++++++++++++++++ 2 files changed, 182 insertions(+), 183 deletions(-) delete mode 100644 sources/tech/RHCE/Part 3 - How to Produce and Deliver System Activity Reports Using Linux Toolsets.md create mode 100644 translated/tech/RHCE/Part 3 - How to Produce and Deliver System Activity Reports Using Linux Toolsets.md diff --git a/sources/tech/RHCE/Part 3 - How to Produce and Deliver System Activity Reports Using Linux Toolsets.md b/sources/tech/RHCE/Part 3 - How to Produce and Deliver System Activity Reports Using Linux Toolsets.md deleted file mode 100644 index ea0157be4f..0000000000 --- a/sources/tech/RHCE/Part 3 - How to Produce and Deliver System Activity Reports Using Linux Toolsets.md +++ /dev/null @@ -1,183 +0,0 @@ -Translating by ictlyh -Part 3 - How to Produce and Deliver System Activity Reports Using Linux Toolsets -================================================================================ -As a system engineer, you will often need to produce reports that show the utilization of your system’s resources in order to make sure that: 1) they are being utilized optimally, 2) prevent bottlenecks, and 3) ensure scalability, among other reasons. - -![Monitor Linux Performance Activity Reports](http://www.tecmint.com/wp-content/uploads/2015/08/Monitor-Linux-Performance-Activity-Reports.jpg) - -RHCE: Monitor Linux Performance Activity Reports – Part 3 - -Besides the well-known native Linux tools that are used to check disk, memory, and CPU usage – to name a few examples, Red Hat Enterprise Linux 7 provides two additional toolsets to enhance the data you can collect for your reports: sysstat and dstat. - -In this article we will describe both, but let’s first start by reviewing the usage of the classic tools. - -### Native Linux Tools ### - -With df, you will be able to report disk space and inode usage of by filesystem. You need to monitor both because a lack of space will prevent you from being able to save further files (and may even cause the system to crash), just like running out of inodes will mean you can’t link further files with their corresponding data structures, thus producing the same effect: you won’t be able to save those files to disk. - - # df -h [Display output in human-readable form] - # df -h --total [Produce a grand total] - -![Check Linux Total Disk Usage](http://www.tecmint.com/wp-content/uploads/2015/08/Check-Linux-Total-Disk-Usage.png) - -Check Linux Total Disk Usage - - # df -i [Show inode count by filesystem] - # df -i --total [Produce a grand total] - -![Check Linux Total inode Numbers](http://www.tecmint.com/wp-content/uploads/2015/08/Check-Linux-Total-inode-Numbers.png) - -Check Linux Total inode Numbers - -With du, you can estimate file space usage by either file, directory, or filesystem. - -For example, let’s see how much space is used by the /home directory, which includes all of the user’s personal files. The first command will return the overall space currently used by the entire /home directory, whereas the second will also display a disaggregated list by sub-directory as well: - - # du -sch /home - # du -sch /home/* - -![Check Linux Directory Disk Size](http://www.tecmint.com/wp-content/uploads/2015/08/Check-Linux-Directory-Disk-Size.png) - -Check Linux Directory Disk Size - -Don’t Miss: - -- [12 ‘df’ Command Examples to Check Linux Disk Space Usage][1] -- [10 ‘du’ Command Examples to Find Disk Usage of Files/Directories][2] - -Another utility that can’t be missing from your toolset is vmstat. It will allow you to see at a quick glance information about processes, CPU and memory usage, disk activity, and more. - -If run without arguments, vmstat will return averages since the last reboot. While you may use this form of the command once in a while, it will be more helpful to take a certain amount of system utilization samples, one after another, with a defined time separation between samples. - -For example, - - # vmstat 5 10 - -will return 10 samples taken every 5 seconds: - -![Check Linux System Performance](http://www.tecmint.com/wp-content/uploads/2015/08/Check-Linux-Systerm-Performance.png) - -Check Linux System Performance - -As you can see in the above picture, the output of vmstat is divided by columns: procs (processes), memory, swap, io, system, and cpu. The meaning of each field can be found in the FIELD DESCRIPTION sections in the man page of vmstat. - -Where can vmstat come in handy? Let’s examine the behavior of the system before and during a yum update: - - # vmstat -a 1 5 - -![Vmstat Linux Performance Monitoring](http://www.tecmint.com/wp-content/uploads/2015/08/Vmstat-Linux-Peformance-Monitoring.png) - -Vmstat Linux Performance Monitoring - -Please note that as files are being modified on disk, the amount of active memory increases and so does the number of blocks written to disk (bo) and the CPU time that is dedicated to user processes (us). - -Or during the saving process of a large file directly to disk (caused by dsync): - - # vmstat -a 1 5 - # dd if=/dev/zero of=dummy.out bs=1M count=1000 oflag=dsync - -![VmStat Linux Disk Performance Monitoring](http://www.tecmint.com/wp-content/uploads/2015/08/VmStat-Linux-Disk-Performance-Monitoring.png) - -VmStat Linux Disk Performance Monitoring - -In this case, we can see a yet larger number of blocks being written to disk (bo), which was to be expected, but also an increase of the amount of CPU time that it has to wait for I/O operations to complete before processing tasks (wa). - -**Don’t Miss**: [Vmstat – Linux Performance Monitoring][3] - -### Other Linux Tools ### - -As mentioned in the introduction of this chapter, there are other tools that you can use to check the system status and utilization (they are not only provided by Red Hat but also by other major distributions from their officially supported repositories). - -The sysstat package contains the following utilities: - -- sar (collect, report, or save system activity information). -- sadf (display data collected by sar in multiple formats). -- mpstat (report processors related statistics). -- iostat (report CPU statistics and I/O statistics for devices and partitions). -- pidstat (report statistics for Linux tasks). -- nfsiostat (report input/output statistics for NFS). -- cifsiostat (report CIFS statistics) and -- sa1 (collect and store binary data in the system activity daily data file. -- sa2 (write a daily report in the /var/log/sa directory) tools. - -whereas dstat adds some extra features to the functionality provided by those tools, along with more counters and flexibility. You can find an overall description of each tool by running yum info sysstat or yum info dstat, respectively, or checking the individual man pages after installation. - -To install both packages: - - # yum update && yum install sysstat dstat - -The main configuration file for sysstat is /etc/sysconfig/sysstat. You will find the following parameters in that file: - - # How long to keep log files (in days). - # If value is greater than 28, then log files are kept in - # multiple directories, one for each month. - HISTORY=28 - # Compress (using gzip or bzip2) sa and sar files older than (in days): - COMPRESSAFTER=31 - # Parameters for the system activity data collector (see sadc manual page) - # which are used for the generation of log files. - SADC_OPTIONS="-S DISK" - # Compression program to use. - ZIP="bzip2" - -When sysstat is installed, two cron jobs are added and enabled in /etc/cron.d/sysstat. The first job runs the system activity accounting tool every 10 minutes and stores the reports in /var/log/sa/saXX where XX is the day of the month. - -Thus, /var/log/sa/sa05 will contain all the system activity reports from the 5th of the month. This assumes that we are using the default value in the HISTORY variable in the configuration file above: - - */10 * * * * root /usr/lib64/sa/sa1 1 1 - -The second job generates a daily summary of process accounting at 11:53 pm every day and stores it in /var/log/sa/sarXX files, where XX has the same meaning as in the previous example: - - 53 23 * * * root /usr/lib64/sa/sa2 -A - -For example, you may want to output system statistics from 9:30 am through 5:30 pm of the sixth of the month to a .csv file that can easily be viewed using LibreOffice Calc or Microsoft Excel (this approach will also allow you to create charts or graphs): - - # sadf -s 09:30:00 -e 17:30:00 -dh /var/log/sa/sa06 -- | sed 's/;/,/g' > system_stats20150806.csv - -You could alternatively use the -j flag instead of -d in the sadf command above to output the system stats in JSON format, which could be useful if you need to consume the data in a web application, for example. - -![Linux System Statistics](http://www.tecmint.com/wp-content/uploads/2015/08/Linux-System-Statistics.png) - -Linux System Statistics - -Finally, let’s see what dstat has to offer. Please note that if run without arguments, dstat assumes -cdngy by default (short for CPU, disk, network, memory pages, and system stats, respectively), and adds one line every second (execution can be interrupted anytime with Ctrl + C): - - # dstat - -![Linux Disk Statistics Monitoring](http://www.tecmint.com/wp-content/uploads/2015/08/dstat-command.png) - -Linux Disk Statistics Monitoring - -To output the stats to a .csv file, use the –output flag followed by a file name. Let’s see how this looks on LibreOffice Calc: - -![Monitor Linux Statistics Output](http://www.tecmint.com/wp-content/uploads/2015/08/Monitor-Linux-Statistics-Output.png) - -Monitor Linux Statistics Output - -I strongly advise you to check out the man page of dstat, included with this article along with the man page of sysstat in PDF format for your reading convenience. You will find several other options that will help you create custom and detailed system activity reports. - -**Don’t Miss**: [Sysstat – Linux Usage Activity Monitoring Tool][4] - -### Summary ### - -In this guide we have explained how to use both native Linux tools and specific utilities provided with RHEL 7 in order to produce reports on system utilization. At one point or another, you will come to rely on these reports as best friends. - -You will probably have used other tools that we have not covered in this tutorial. If so, feel free to share them with the rest of the community along with any other suggestions / questions / comments that you may have- using the form below. - -We look forward to hearing from you. - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/linux-performance-monitoring-and-file-system-statistics-reports/ - -作者:[Gabriel Cánepa][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.tecmint.com/author/gacanepa/ -[1]:http://www.tecmint.com/how-to-check-disk-space-in-linux/ -[2]:http://www.tecmint.com/check-linux-disk-usage-of-files-and-directories/ -[3]:http://www.tecmint.com/linux-performance-monitoring-with-vmstat-and-iostat-commands/ -[4]:http://www.tecmint.com/install-sysstat-in-linux/ \ No newline at end of file diff --git a/translated/tech/RHCE/Part 3 - How to Produce and Deliver System Activity Reports Using Linux Toolsets.md b/translated/tech/RHCE/Part 3 - How to Produce and Deliver System Activity Reports Using Linux Toolsets.md new file mode 100644 index 0000000000..7a373cd76b --- /dev/null +++ b/translated/tech/RHCE/Part 3 - How to Produce and Deliver System Activity Reports Using Linux Toolsets.md @@ -0,0 +1,182 @@ +RHCE 第三部分 - 如何使用 Linux 工具集产生和发送系统活动报告 +================================================================================ +作为一个系统工程师,你经常需要生成一些显示系统资源利用率的报告,以便确保:1)正最佳利用它们,2)防止出现瓶颈,3)确保可扩展性,以及其它原因。 + +![监视 Linux 性能活动报告](http://www.tecmint.com/wp-content/uploads/2015/08/Monitor-Linux-Performance-Activity-Reports.jpg) + +RHCE 第三部分:监视 Linux 性能活动报告 + +除了著名的用于检测磁盘、内存和 CPU 使用率的原生 Linux 工具 - 可以给出很多例子,红帽企业版 Linux 7 还提供了两个额外的工具集用于为你的报告增加可以收集的数据:sysstat 和 dstat。 + +在这篇文章中,我们会介绍两者,但首先让我们来回顾一下传统工具的使用。 + +### 原生 Linux 工具 ### + +使用 df,你可以报告磁盘空间以及文件系统的 inode 使用情况。你需要监视两者,因为缺少磁盘空间会阻止你保存更多文件(甚至会导致系统崩溃),就像耗尽 inode 意味着你不能将文件链接到对应的数据结构,从而导致同样的结果:你不能将那些文件保存到磁盘中。 + + # df -h [以人类可读形式显示输出] + # df -h --total [生成总计] + +![检查 Linux 总的磁盘使用](http://www.tecmint.com/wp-content/uploads/2015/08/Check-Linux-Total-Disk-Usage.png) + +检查 Linux 总的磁盘使用 + + # df -i [显示文件系统的 inode 数目] + # df -i --total [生成总计] + +![检查 Linux 总的 inode 数目](http://www.tecmint.com/wp-content/uploads/2015/08/Check-Linux-Total-inode-Numbers.png) + +检查 Linux 总的 inode 数目 + +用 du,你可以估计文件、目录或文件系统的文件空间使用。 + +举个例子,让我们来看看 /home 目录使用了多少空间,它包括了所有用户的个人文件。第一条命令会返回整个 /home 目录当前使用的所有空间,第二条命令会显示子目录的分类列表: + + # du -sch /home + # du -sch /home/* + +![检查 Linux 目录磁盘大小](http://www.tecmint.com/wp-content/uploads/2015/08/Check-Linux-Directory-Disk-Size.png) + +检查 Linux 目录磁盘大小 + +别错过了: + +- [检查 Linux 磁盘空间使用的 12 个 ‘df’ 命令例子][1] +- [查看文件/目录磁盘使用的 10 个 ‘du’ 命令例子][2] + +另一个你工具集中不容忽视的工具就是 vmstat。它允许你查看进程、CPU 和 内存使用、磁盘活动以及其它的大概信息。 + +如果不带参数运行,vmstat 会返回自从上一次启动后的平均信息。尽管你可能以这种方式使用该命令有一段时间了,再看一些系统使用率的例子会有更多帮助,例如在例子中定义了时间间隔。 + +例如 + + # vmstat 5 10 + +会每个 5 秒返回 10 个事例: + +![检查 Linux 系统性能](http://www.tecmint.com/wp-content/uploads/2015/08/Check-Linux-Systerm-Performance.png) + +检查 Linux 系统性能 + +正如你从上面图片看到的,vmstat 的输出分为很多列:proc(process)、memory、swap、io、system、和 CPU。每个字段的意义可以在 vmstat man 手册的 FIELD DESCRIPTION 部分找到。 + +在哪里 vmstat 可以派上用场呢?让我们在 yum 升级之前和升级时检查系统行为: + + # vmstat -a 1 5 + +![Vmstat Linux 性能监视](http://www.tecmint.com/wp-content/uploads/2015/08/Vmstat-Linux-Peformance-Monitoring.png) + +Vmstat Linux 性能监视 + +请注意当磁盘上的文件被更改时,活跃内存的数量增加,写到磁盘的块数目(bo)和属于用户进程的 CPU 时间(us)也是这样。 + +或者一个保存大文件到磁盘时(dsync 引发): + + # vmstat -a 1 5 + # dd if=/dev/zero of=dummy.out bs=1M count=1000 oflag=dsync + +![Vmstat Linux 磁盘性能监视](http://www.tecmint.com/wp-content/uploads/2015/08/VmStat-Linux-Disk-Performance-Monitoring.png) + +Vmstat Linux 磁盘性能监视 + +在这个例子中,我们可以看到很大数目的块被写入到磁盘(bo),这正如预期的那样,同时 CPU 处理任务之前等待 IO 操作完成的时间(wa)也增加了。 + +**别错过**: [Vmstat – Linux 性能监视][3] + +### 其它 Linux 工具 ### + +正如本文介绍部分提到的,这里有其它的工具你可以用来检测系统状态和利用率(不仅红帽,其它主流发行版的官方支持库中也提供了这些工具)。 + +sysstat 软件包包含以下工具: + +- sar (收集、报告、或者保存系统活动信息)。 +- sadf (以多种方式显式 sar 收集的数据)。 +- mpstat (报告处理器相关的统计信息)。 +- iostat (报告 CPU 统计信息和设备以及分区的 IO统计信息)。 +- pidstat (报告 Linux 任务统计信息)。 +- nfsiostat (报告 NFS 的输出/输出统计信息)。 +- cifsiostat (报告 CIFS 统计信息) +- sa1 (收集并保存系统活动日常文件的二进制数据)。 +- sa2 (在 /var/log/sa 目录写每日报告)。 + +dstat 为这些工具提供的功能添加了一些额外的特性,以及更多的计数器和更大的灵活性。你可以通过运行 yum info sysstat 或者 yum info dstat 找到每个工具完整的介绍,或者安装完成后分别查看每个工具的 man 手册。 + +安装两个软件包: + + # yum update && yum install sysstat dstat + +sysstat 主要的配置文件是 /etc/sysconfig/sysstat。你可以在该文件中找到下面的参数: + + # How long to keep log files (in days). + # If value is greater than 28, then log files are kept in + # multiple directories, one for each month. + HISTORY=28 + # Compress (using gzip or bzip2) sa and sar files older than (in days): + COMPRESSAFTER=31 + # Parameters for the system activity data collector (see sadc manual page) + # which are used for the generation of log files. + SADC_OPTIONS="-S DISK" + # Compression program to use. + ZIP="bzip2" + +sysstat 安装完成后,/etc/cron.d/sysstat 中会添加和启用两个 cron 作业。第一个作业每 10 分钟运行系统活动计数工具并在 /var/log/sa/saXX 中保存报告,其中 XX 是该月的一天。 + +因此,/var/log/sa/sa05 会包括该月份第 5 天所有的系统活动报告。这里假设我们在上面的配置文件中对 HISTORY 变量使用默认的值: + + */10 * * * * root /usr/lib64/sa/sa1 1 1 + +第二个作业在每天夜间 11:53 生成每日进程计数总结并把它保存到 /var/log/sa/sarXX 文件,其中 XX 和之前例子中的含义相同: + + 53 23 * * * root /usr/lib64/sa/sa2 -A + +例如,你可能想要输出该月份第 6 天从上午 9:30 到晚上 5:30 的系统统计信息到一个 LibreOffice Calc 或 Microsoft Excel 可以查看的 .csv 文件(它也允许你创建表格和图片): + + # sadf -s 09:30:00 -e 17:30:00 -dh /var/log/sa/sa06 -- | sed 's/;/,/g' > system_stats20150806.csv + +你可以在上面的 sadf 命令中用 -j 标记代替 -d 以 JSON 格式输出系统统计信息,这当你在 web 应用中使用这些数据的时候非常有用。 + +![Linux 系统统计信息](http://www.tecmint.com/wp-content/uploads/2015/08/Linux-System-Statistics.png) + +Linux 系统统计信息 + +最后,让我们看看 dstat 提供什么功能。请注意如果不带参数运行,dstat 默认使用 -cdngy(表示 CPU、磁盘、网络、内存页、和系统统计信息),并每秒添加一行(可以在任何时候用 Ctrl + C 中断执行): + + # dstat + +![Linux 磁盘统计检测](http://www.tecmint.com/wp-content/uploads/2015/08/dstat-command.png) + +Linux 磁盘统计检测 + +要输出统计信息到 .csv 文件,可以用 -output 标记后面跟一个文件名称。让我们来看看在 LibreOffice Calc 中该文件看起来是怎样的: + +![检测 Linux 统计信息输出](http://www.tecmint.com/wp-content/uploads/2015/08/Monitor-Linux-Statistics-Output.png) + +检测 Linux 统计信息输出 + +我强烈建议你查看 dstat 的 man 手册,为了方便你的阅读用 PDF 格式包括本文以及 sysstat 的 man 手册。你会找到其它能帮助你创建自定义的详细系统活动报告的选项。 + +**别错过**: [Sysstat – Linux 的使用活动检测工具][4] + +### 总结 ### + +在该指南中我们解释了如何使用 Linux 原生工具以及 RHEL 7 提供的特定工具来生成系统使用报告。在某种情况下,你可能像依赖最好的朋友那样依赖这些报告。 + +你很可能使用过这篇指南中我们没有介绍到的其它工具。如果真是这样的话,用下面的表格和社区中的其他成员一起分享吧,也可以是任何其它的建议/疑问/或者评论。 + +我们期待你的回复。 + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/linux-performance-monitoring-and-file-system-statistics-reports/ + +作者:[Gabriel Cánepa][a] +译者:[ictlyh](https://github.com/ictlyh) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/gacanepa/ +[1]:http://www.tecmint.com/how-to-check-disk-space-in-linux/ +[2]:http://www.tecmint.com/check-linux-disk-usage-of-files-and-directories/ +[3]:http://www.tecmint.com/linux-performance-monitoring-with-vmstat-and-iostat-commands/ +[4]:http://www.tecmint.com/install-sysstat-in-linux/ \ No newline at end of file From 973441749b1e0fcc303d5cc53653850a2baf7247 Mon Sep 17 00:00:00 2001 From: wxy Date: Sat, 15 Aug 2015 18:07:53 +0800 Subject: [PATCH 940/965] PUB:20150811 Darkstat is a Web Based Network Traffic Analyzer--Install it on Linux @geekpi --- ...work Traffic Analyzer--Install it on Linux.md | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) rename {translated/tech => published}/20150811 Darkstat is a Web Based Network Traffic Analyzer--Install it on Linux.md (73%) diff --git a/translated/tech/20150811 Darkstat is a Web Based Network Traffic Analyzer--Install it on Linux.md b/published/20150811 Darkstat is a Web Based Network Traffic Analyzer--Install it on Linux.md similarity index 73% rename from translated/tech/20150811 Darkstat is a Web Based Network Traffic Analyzer--Install it on Linux.md rename to published/20150811 Darkstat is a Web Based Network Traffic Analyzer--Install it on Linux.md index e8e6bace07..53f7b8a9d4 100644 --- a/translated/tech/20150811 Darkstat is a Web Based Network Traffic Analyzer--Install it on Linux.md +++ b/published/20150811 Darkstat is a Web Based Network Traffic Analyzer--Install it on Linux.md @@ -1,6 +1,7 @@ -Darkstat一个基于网络的流量分析器 - 在Linux中安装 +在 Linux 中安装 Darkstat:基于网页的流量分析器 ================================================================================ -Darkstat是一个简易的,基于网络的流量分析程序。它可以在主流的操作系统如Linux、Solaris、MAC、AIX上工作。它以守护进程的形式持续工作在后台并不断地嗅探网络数据并以简单易懂的形式展现在网页上。它可以为主机生成流量报告,鉴别特定主机上哪些端口打开并且兼容IPv6。让我们看下如何在Linux中安装和配置它。 + +Darkstat是一个简易的,基于网页的流量分析程序。它可以在主流的操作系统如Linux、Solaris、MAC、AIX上工作。它以守护进程的形式持续工作在后台,不断地嗅探网络数据,以简单易懂的形式展现在它的网页上。它可以为主机生成流量报告,识别特定的主机上哪些端口是打开的,它兼容IPv6。让我们看下如何在Linux中安装和配置它。 ### 在Linux中安装配置Darkstat ### @@ -20,14 +21,15 @@ Darkstat是一个简易的,基于网络的流量分析程序。它可以在主 ### 配置 Darkstat ### -为了正确运行这个程序,我恩需要执行一些基本的配置。运行下面的命令用gedit编辑器打开/etc/darkstat/init.cfg文件。 +为了正确运行这个程序,我们需要执行一些基本的配置。运行下面的命令用gedit编辑器打开/etc/darkstat/init.cfg文件。 sudo gedit /etc/darkstat/init.cfg ![](http://linuxpitstop.com/wp-content/uploads/2015/08/13.png) -编辑 Darkstat -修改START_DARKSTAT这个参数为yes,并在“INTERFACE”中提供你的网络接口。确保取消了DIR、PORT、BINDIP和LOCAL这些参数的注释。如果你希望绑定Darkstat到特定的IP,在BINDIP中提供它 +*编辑 Darkstat* + +修改START_DARKSTAT这个参数为yes,并在“INTERFACE”中提供你的网络接口。确保取消了DIR、PORT、BINDIP和LOCAL这些参数的注释。如果你希望绑定Darkstat到特定的IP,在BINDIP参数中提供它。 ### 启动Darkstat守护进程 ### @@ -47,7 +49,7 @@ Darkstat是一个简易的,基于网络的流量分析程序。它可以在主 ### 总结 ### -它是一个占用很少内存的轻量级工具。这个工具流行的原因是简易、易于配置和使用。这是一个对系统管理员而言必须拥有的程序 +它是一个占用很少内存的轻量级工具。这个工具流行的原因是简易、易于配置使用。这是一个对系统管理员而言必须拥有的程序。 -------------------------------------------------------------------------------- @@ -55,7 +57,7 @@ via: http://linuxpitstop.com/install-darkstat-on-ubuntu-linux/ 作者:[Aun][a] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 From 1e48d11ef118229b2618fec29cdd44276a58a4da Mon Sep 17 00:00:00 2001 From: DongShuaike Date: Sat, 15 Aug 2015 18:18:42 +0800 Subject: [PATCH 941/965] Delete 20150813 Linux and Unix Test Disk I O Performance With dd Command.md --- ...st Disk I O Performance With dd Command.md | 164 ------------------ 1 file changed, 164 deletions(-) delete mode 100644 sources/tech/20150813 Linux and Unix Test Disk I O Performance With dd Command.md diff --git a/sources/tech/20150813 Linux and Unix Test Disk I O Performance With dd Command.md b/sources/tech/20150813 Linux and Unix Test Disk I O Performance With dd Command.md deleted file mode 100644 index bcd9f8455f..0000000000 --- a/sources/tech/20150813 Linux and Unix Test Disk I O Performance With dd Command.md +++ /dev/null @@ -1,164 +0,0 @@ -DongShuaike is translating. - -Linux and Unix Test Disk I/O Performance With dd Command -================================================================================ -How can I use dd command on a Linux to test I/O performance of my hard disk drive? How do I check the performance of a hard drive including the read and write speed on a Linux operating systems? - -You can use the following commands on a Linux or Unix-like systems for simple I/O performance test: - -- **dd command** : It is used to monitor the writing performance of a disk device on a Linux and Unix-like system -- **hdparm command** : It is used to get/set hard disk parameters including test the reading and caching performance of a disk device on a Linux based system. - -In this tutorial you will learn how to use the dd command to test disk I/O performance. - -### Use dd command to monitor the reading and writing performance of a disk device: ### - -- Open a shell prompt. -- Or login to a remote server via ssh. -- Use the dd command to measure server throughput (write speed) `dd if=/dev/zero of=/tmp/test1.img bs=1G count=1 oflag=dsync` -- Use the dd command to measure server latency `dd if=/dev/zero of=/tmp/test2.img bs=512 count=1000 oflag=dsync` - -#### Understanding dd command options #### - -In this example, I'm using RAID-10 (Adaptec 5405Z with SAS SSD) array running on a Ubuntu Linux 14.04 LTS server. The basic syntax is - - dd if=/dev/input.file of=/path/to/output.file bs=block-size count=number-of-blocks oflag=dsync - ## GNU dd syntax ## - dd if=/dev/zero of=/tmp/test1.img bs=1G count=1 oflag=dsync - ## OR alternate syntax for GNU/dd ## - dd if=/dev/zero of=/tmp/testALT.img bs=1G count=1 conv=fdatasync - -Sample outputs: - -![Fig.01: Ubuntu Linux Server with RAID10 and testing server throughput with dd](http://s0.cyberciti.org/uploads/faq/2015/08/dd-server-test-io-speed-output.jpg) -Fig.01: Ubuntu Linux Server with RAID10 and testing server throughput with dd - -Please note that one gigabyte was written for the test and 135 MB/s was server throughput for this test. Where, - -- `if=/dev/zero (if=/dev/input.file)` : The name of the input file you want dd the read from. -- `of=/tmp/test1.img (of=/path/to/output.file)` : The name of the output file you want dd write the input.file to. -- `bs=1G (bs=block-size)` : Set the size of the block you want dd to use. 1 gigabyte was written for the test. -- `count=1 (count=number-of-blocks)`: The number of blocks you want dd to read. -- `oflag=dsync (oflag=dsync)` : Use synchronized I/O for data. Do not skip this option. This option get rid of caching and gives you good and accurate results -- `conv=fdatasyn`: Again, this tells dd to require a complete "sync" once, right before it exits. This option is equivalent to oflag=dsync. - -In this example, 512 bytes were written one thousand times to get RAID10 server latency time: - - dd if=/dev/zero of=/tmp/test2.img bs=512 count=1000 oflag=dsync - -Sample outputs: - - 1000+0 records in - 1000+0 records out - 512000 bytes (512 kB) copied, 0.60362 s, 848 kB/s - -Please note that server throughput and latency time depends upon server/application load too. So I recommend that you run these tests on a newly rebooted server as well as peak time to get better idea about your workload. You can now compare these numbers with all your devices. - -#### But why the server throughput and latency time are so low? #### - -Low values does not mean you are using slow hardware. The value can be low because of the HARDWARE RAID10 controller's cache. - -Use hdparm command to see buffered and cached disk read speed - -I suggest you run the following commands 2 or 3 times Perform timings of device reads for benchmark and comparison purposes: - - ### Buffered disk read test for /dev/sda ## - hdparm -t /dev/sda1 - ## OR ## - hdparm -t /dev/sda - -To perform timings of cache reads for benchmark and comparison purposes again run the following command 2-3 times (note the -T option): - - ## Cache read benchmark for /dev/sda ### - hdparm -T /dev/sda1 - ## OR ## - hdparm -T /dev/sda - -OR combine both tests: - - hdparm -Tt /dev/sda - -Sample outputs: - -![Fig.02: Linux hdparm command to test reading and caching disk performance](http://s0.cyberciti.org/uploads/faq/2015/08/hdparam-output.jpg) -Fig.02: Linux hdparm command to test reading and caching disk performance - -Again note that due to filesystems caching on file operations, you will always see high read rates. - -**Use dd command on Linux to test read speed** - -To get accurate read test data, first discard caches before testing by running the following commands: - - flush - echo 3 | sudo tee /proc/sys/vm/drop_caches - time time dd if=/path/to/bigfile of=/dev/null bs=8k - -**Linux Laptop example** - -Run the following command: - - ### Debian Laptop Throughput With Cache ## - dd if=/dev/zero of=/tmp/laptop.bin bs=1G count=1 oflag=direct - - ### Deactivate the cache ### - hdparm -W0 /dev/sda - - ### Debian Laptop Throughput Without Cache ## - dd if=/dev/zero of=/tmp/laptop.bin bs=1G count=1 oflag=direct - -**Apple OS X Unix (Macbook pro) example** - -GNU dd has many more options but OS X/BSD and Unix-like dd command need to run as follows to test real disk I/O and not memory add sync option as follows: - - ## Run command 2-3 times to get good results ### - time sh -c "dd if=/dev/zero of=/tmp/testfile bs=100k count=1k && sync" - -Sample outputs: - - 1024+0 records in - 1024+0 records out - 104857600 bytes transferred in 0.165040 secs (635346520 bytes/sec) - - real 0m0.241s - user 0m0.004s - sys 0m0.113s - -So I'm getting 635346520 bytes (635.347 MB/s) write speed on my MBP. - -**Not a fan of command line...?** - -You can use disk utility (gnome-disk-utility) on a Linux or Unix based system to get the same information. The following screenshot is taken from my Fedora Linux v22 VM. - -**Graphical method** - -Click on the "Activities" or press the "Super" key to switch between the Activities overview and desktop. Type "Disks" - -![Fig.03: Start the Gnome disk utility](http://s0.cyberciti.org/uploads/faq/2015/08/disk-1.jpg) -Fig.03: Start the Gnome disk utility - -Select your hard disk at left pane and click on configure button and click on "Benchmark partition": - -![Fig.04: Benchmark disk/partition](http://s0.cyberciti.org/uploads/faq/2015/08/disks-2.jpg) -Fig.04: Benchmark disk/partition - -Finally, click on the "Start Benchmark..." button (you may be promoted for the admin username and password): - -![Fig.05: Final benchmark result](http://s0.cyberciti.org/uploads/faq/2015/08/disks-3.jpg) -Fig.05: Final benchmark result - -Which method and command do you recommend to use? - -- I recommend dd command on all Unix-like systems (`time sh -c "dd if=/dev/zero of=/tmp/testfile bs=100k count=1k && sync`" -- If you are using GNU/Linux use the dd command (`dd if=/dev/zero of=/tmp/testALT.img bs=1G count=1 conv=fdatasync`) -- Make sure you adjust count and bs arguments as per your setup to get a good set of result. -- The GUI method is recommended only for Linux/Unix laptop users running Gnome2 or 3 desktop. - --------------------------------------------------------------------------------- - -via: http://www.cyberciti.biz/faq/howto-linux-unix-test-disk-performance-with-dd-command/ - -作者:Vivek Gite -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 7fc831fe8fd5ada1167f8f4bc7f57bff9b5e1034 Mon Sep 17 00:00:00 2001 From: DongShuaike Date: Sat, 15 Aug 2015 18:22:26 +0800 Subject: [PATCH 942/965] Create Linux and Unix Test Disk IO Performance With dd Command.MD --- ...est Disk IO Performance With dd Command.MD | 167 ++++++++++++++++++ 1 file changed, 167 insertions(+) create mode 100644 translated/tech/Linux and Unix Test Disk IO Performance With dd Command.MD diff --git a/translated/tech/Linux and Unix Test Disk IO Performance With dd Command.MD b/translated/tech/Linux and Unix Test Disk IO Performance With dd Command.MD new file mode 100644 index 0000000000..ab3615876c --- /dev/null +++ b/translated/tech/Linux and Unix Test Disk IO Performance With dd Command.MD @@ -0,0 +1,167 @@ +使用dd命令在Linux和Unix环境下进行硬盘I/O性能检测 +================================================================================ +如何使用dd命令测试硬盘的性能?如何在linux操作系统下检测硬盘的读写能力? + +你可以使用以下命令在一个Linux或类Unix操作系统上进行简单的I/O性能测试。 + +- **dd命令** :它被用来在Linux和类Unix系统下对硬盘设备进行写性能的检测。 +- **hparm命令**:它被用来获取或设置硬盘参数,包括测试读性能以及缓存性能等。 + +在这篇指南中,你将会学到如何使用dd命令来测试硬盘性能。 + +### 使用dd命令来监控硬盘的读写性能:### + +- 打开shell终端(这里貌似不能翻译为终端提示符)。 +- 通过ssh登录到远程服务器。 +- 使用dd命令来测量服务器的吞吐率(写速度) `dd if=/dev/zero of=/tmp/test1.img bs=1G count=1 oflag=dsync` +- 使用dd命令测量服务器延迟 `dd if=/dev/zero of=/tmp/test2.img bs=512 count=1000 oflag=dsync` + +####理解dd命令的选项### + +在这个例子当中,我将使用搭载Ubuntu Linux 14.04 LTS系统的RAID-10(配有SAS SSD的Adaptec 5405Z)服务器阵列来运行。基本语法为: + + dd if=/dev/input.file of=/path/to/output.file bs=block-size count=number-of-blocks oflag=dsync + ## GNU dd syntax ## + dd if=/dev/zero of=/tmp/test1.img bs=1G count=1 oflag=dsync + ## OR alternate syntax for GNU/dd ## + dd if=/dev/zero of=/tmp/testALT.img bs=1G count=1 conv=fdatasync + +输出样例: + +![Fig.01: Ubuntu Linux Server with RAID10 and testing server throughput with dd](http://s0.cyberciti.org/uploads/faq/2015/08/dd-server-test-io-speed-output.jpg) +Fig.01: 使用dd命令获取的服务器吞吐率 + +请各位注意在这个实验中,我们写入一个G的数据,可以发现,服务器的吞吐率是135 MB/s,这其中 + +- `if=/dev/zero (if=/dev/input.file)` :用来设置dd命令读取的输入文件名。 +- `of=/tmp/test1.img (of=/path/to/output.file)` :dd命令将input.file写入的输出文件的名字。 +- `bs=1G (bs=block-size)` :设置dd命令读取的块的大小。例子中为1个G。 +- `count=1 (count=number-of-blocks)`: dd命令读取的块的个数。 +- `oflag=dsync (oflag=dsync)` :使用同步I/O。不要省略这个选项。这个选项能够帮助你去除caching的影响,以便呈现给你精准的结果。 +- `conv=fdatasyn`: 这个选项和`oflag=dsync`含义一样。 + +在这个例子中,一共写了1000次,每次写入512字节来获得RAID10服务器的延迟时间: + + dd if=/dev/zero of=/tmp/test2.img bs=512 count=1000 oflag=dsync + +输出样例: + + 1000+0 records in + 1000+0 records out + 512000 bytes (512 kB) copied, 0.60362 s, 848 kB/s + +请注意服务器的吞吐率以及延迟时间也取决于服务器/应用的加载。所以我推荐你在一个刚刚重启过并且处于峰值时间的服务器上来运行测试,以便得到更加准确的度量。现在你可以在你的所有设备上互相比较这些测试结果了。 + +####为什么服务器的吞吐率和延迟时间都这么差?### + +低的数值并不意味着你在使用差劲的硬件。可能是HARDWARE RAID10的控制器缓存导致的。 + +使用hdparm命令来查看硬盘缓存的读速度。 + +我建议你运行下面的命令2-3次来对设备读性能进行检测,以作为参照和相互比较: + + ### 有缓存的硬盘读性能测试——/dev/sda ### + hdparm -t /dev/sda1 + ## 或者 ## + hdparm -t /dev/sda + +然后运行下面这个命令2-3次来对缓存的读性能进行对照性检测: + + ## Cache读基准——/dev/sda ### + hdparm -T /dev/sda1 + ## 或者 ## + hdparm -T /dev/sda + +或者干脆把两个测试结合起来: + + hdparm -Tt /dev/sda + +输出样例: + +![Fig.02: Linux hdparm command to test reading and caching disk performance](http://s0.cyberciti.org/uploads/faq/2015/08/hdparam-output.jpg) +Fig.02: 检测硬盘读入以及缓存性能的Linux hdparm命令 + +请再一次注意由于文件文件操作的缓存属性,你将总是会看到很高的读速度。 + +**使用dd命令来测试读入速度** + +为了获得精确的读测试数据,首先在测试前运行下列命令,来将缓存设置为无效: + + flush + echo 3 | sudo tee /proc/sys/vm/drop_caches + time time dd if=/path/to/bigfile of=/dev/null bs=8k + +**笔记本上的示例** + +运行下列命令: + + ### Cache存在的Debian系统笔记本吞吐率### + dd if=/dev/zero of=/tmp/laptop.bin bs=1G count=1 oflag=direct + + ###使cache失效### + hdparm -W0 /dev/sda + + ###没有Cache的Debian系统笔记本吞吐率### + dd if=/dev/zero of=/tmp/laptop.bin bs=1G count=1 oflag=direct + +**苹果OS X Unix(Macbook pro)的例子** + +GNU dd has many more options but OS X/BSD and Unix-like dd command need to run as follows to test real disk I/O and not memory add sync option as follows: +GNU dd命令有其他许多选项但是在 OS X/BSD 以及类Unix中, dd命令需要像下面那样执行来检测去除掉内存地址同步的硬盘真实I/O性能: + + ## 运行这个命令2-3次来获得更好地结果 ### + time sh -c "dd if=/dev/zero of=/tmp/testfile bs=100k count=1k && sync" + +输出样例: + + 1024+0 records in + 1024+0 records out + 104857600 bytes transferred in 0.165040 secs (635346520 bytes/sec) + + real 0m0.241s + user 0m0.004s + sys 0m0.113s + +本人Macbook Pro的写速度是635346520字节(635.347MB/s)。 + +**不喜欢用命令行?^_^** + +你可以在Linux或基于Unix的系统上使用disk utility(gnome-disk-utility)这款工具来得到同样的信息。下面的那个图就是在我的Fedora Linux v22 VM上截取的。 + +**图形化方法** + +点击“Activites”或者“Super”按键来在桌面和Activites视图间切换。输入“Disks” + +![Fig.03: Start the Gnome disk utility](http://s0.cyberciti.org/uploads/faq/2015/08/disk-1.jpg) +Fig.03: 打开Gnome硬盘工具 + +在左边的面板上选择你的硬盘,点击configure按钮,然后点击“Benchmark partition”: + +![Fig.04: Benchmark disk/partition](http://s0.cyberciti.org/uploads/faq/2015/08/disks-2.jpg) +Fig.04: 评测硬盘/分区 + +最后,点击“Start Benchmark...”按钮(你可能被要求输入管理员用户名和密码): + +![Fig.05: Final benchmark result](http://s0.cyberciti.org/uploads/faq/2015/08/disks-3.jpg) +Fig.05: 最终的评测结果 + +如果你要问,我推荐使用哪种命令和方法? + +- 我推荐在所有的类Unix系统上使用dd命令(`time sh -c "dd if=/dev/zero of=/tmp/testfile bs=100k count=1k && sync`) +- 如果你在使用GNU/Linux,使用dd命令 (`dd if=/dev/zero of=/tmp/testALT.img bs=1G count=1 conv=fdatasync`) +- 确保你每次使用时,都调整了count以及bs参数以获得更好的结果。 +- GUI方法只适合桌面系统为Gnome2或Gnome3的Linux/Unix笔记本用户。 + +-------------------------------------------------------------------------------- + +via: http://www.cyberciti.biz/faq/howto-linux-unix-test-disk-performance-with-dd-command/ + +作者:Vivek Gite +译者:[DongShuaike](https://github.com/DongShuaike) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + + + + From af421be7153844a90ebc512b164be5b92da1bca1 Mon Sep 17 00:00:00 2001 From: DongShuaike Date: Sat, 15 Aug 2015 18:24:35 +0800 Subject: [PATCH 943/965] Update Linux and Unix Test Disk IO Performance With dd Command.MD --- ...Linux and Unix Test Disk IO Performance With dd Command.MD | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/translated/tech/Linux and Unix Test Disk IO Performance With dd Command.MD b/translated/tech/Linux and Unix Test Disk IO Performance With dd Command.MD index ab3615876c..be5986b78e 100644 --- a/translated/tech/Linux and Unix Test Disk IO Performance With dd Command.MD +++ b/translated/tech/Linux and Unix Test Disk IO Performance With dd Command.MD @@ -21,9 +21,9 @@ 在这个例子当中,我将使用搭载Ubuntu Linux 14.04 LTS系统的RAID-10(配有SAS SSD的Adaptec 5405Z)服务器阵列来运行。基本语法为: dd if=/dev/input.file of=/path/to/output.file bs=block-size count=number-of-blocks oflag=dsync - ## GNU dd syntax ## + ## GNU dd语法 ## dd if=/dev/zero of=/tmp/test1.img bs=1G count=1 oflag=dsync - ## OR alternate syntax for GNU/dd ## + ##另外一种GNU dd的语法 ## dd if=/dev/zero of=/tmp/testALT.img bs=1G count=1 conv=fdatasync 输出样例: From 2bf20aff9200598742e6b7646426fe03c843f6bf Mon Sep 17 00:00:00 2001 From: wxy Date: Sat, 15 Aug 2015 23:41:11 +0800 Subject: [PATCH 944/965] PUB:20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 1 - Introduction MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @XLCYun 翻译的很好!下周每天连载一篇 --- ...t Right & Wrong - Page 1 - Introduction.md | 56 +++++++++++++++++++ ...t Right & Wrong - Page 1 - Introduction.md | 55 ------------------ 2 files changed, 56 insertions(+), 55 deletions(-) create mode 100644 published/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 1 - Introduction.md delete mode 100644 translated/tech/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 1 - Introduction.md diff --git a/published/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 1 - Introduction.md b/published/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 1 - Introduction.md new file mode 100644 index 0000000000..61e181c80c --- /dev/null +++ b/published/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 1 - Introduction.md @@ -0,0 +1,56 @@ + 一周 GNOME 之旅:品味它和 KDE 的是是非非(第一节 介绍) +================================================================================ + +*作者声明: 如果你是因为某种神迹而在没看标题的情况下点开了这篇文章,那么我想再重申一些东西……这是一篇评论文章,文中的观点都是我自己的,不代表 Phoronix 网站和 Michael 的观点。它们完全是我自己的想法。* + +另外,没错……这可能是一篇引战的文章。我希望 KDE 和 Gnome 社团变得更好一些,因为我想发起一个讨论并反馈给他们。为此,当我想指出(我所看到的)一个瑕疵时,我会尽量地做到具体而直接。这样,相关的讨论也能做到同样的具体和直接。再次声明:本文另一可选标题为“死于成千上万的[纸割][1]”(LCTT 译注:paper cuts——纸割,被纸片割伤——指易修复但烦人的缺陷。Ubuntu 从 9.10 开始,发起了 [One Hundred Papercuts][1] 项目,用于修复那些小而烦人的易用性问题)。 + +现在,重申完毕……文章开始。 + +![](http://www.phoronix.net/image.php?id=fedora-22-fan&image=fedora_22_good1_show&w=1920) + +当我把[《评价 Fedora 22 KDE 》][2]一文发给 Michael 时,感觉很不是滋味。不是因为我不喜欢 KDE,或者不待见 Fedora,远非如此。事实上,我刚开始想把我的 T450s 的系统换为 Arch Linux 时,马上又决定放弃了,因为我很享受 fedora 在很多方面所带来的便捷性。 + +我感觉很不是滋味的原因是 Fedora 的开发者花费了大量的时间和精力在他们的“工作站”产品上,但是我却一点也没看到。在使用 Fedora 时,我并没用采用那些主要开发者希望用户采用的那种使用方式,因此我也就体验不到所谓的“ Fedora 体验”。它感觉就像一个人评价 Ubuntu 时用的却是 Kubuntu,评价 OS X 时用的却是 Hackintosh,或者评价 Gentoo 时用的却是 Sabayon。根据论坛里大量读者对 Michael 的说法,他们在评价各种发行版时都是使用的默认设置——我也不例外。但是我还是认为这些评价应该在“真实”配置下完成,当然我也知道在给定的情况下评论某些东西也的确是有价值的——无论是好是坏。 + +正是在怀着这种态度的情况下,我决定跳到 Gnome 这个水坑里来泡泡澡。 + +但是,我还要在此多加一个声明……我在这里所看到的 KDE 和 Gnome 都是打包在 Fedora 中的。OpenSUSE、 Kubuntu、 Arch等发行版的各个桌面可能有不同的实现方法,使得我这里所说的具体的“痛点”跟你所用的发行版有所不同。还有,虽然用了这个标题,但这篇文章将会是一篇“很 KDE”的重量级文章。之所以这样称呼,是因为我在“使用” Gnome 之后,才知道 KDE 的“纸割”到底有多么的多。 + +### 登录界面 ### + +![Gnome 登录界面](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_login1_show&w=1920) + +我一般情况下都不会介意发行版带着它们自己的特别主题,因为一般情况下桌面看起来会更好看。可我今天可算是找到了一个例外。 + +第一印象很重要,对吧?那么,GDM(LCTT 译注: Gnome Display Manage:Gnome 显示管理器。)绝对干得漂亮。它的登录界面看起来极度简洁,每一部分都应用了一致的设计风格。使用通用图标而不是文本框为它的简洁加了分。 + +![ KDE 登录界面](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_login2_show&w=1920) + +这并不是说 Fedora 22 KDE ——现在已经是 SDDM 而不是 KDM 了——的登录界面不好看,但是看起来绝对没有它这样和谐。 + +问题到底出来在哪?顶部栏。看看 Gnome 的截图——你选择一个用户,然后用一个很小的齿轮简单地选择想登入哪个会话。设计很简洁,一点都不碍事,实话讲,如果你没注意的话可能完全会看不到它。现在看看那蓝色( LCTT 译注:blue,有忧郁之意,一语双关)的 KDE 截图,顶部栏看起来甚至不像是用同一个工具渲染出来的,它的整个位置的安排好像是某人想着:“哎哟妈呀,我们需要把这个选项扔在哪个地方……”之后决定下来的。 + +对于右上角的重启和关机选项也一样。为什么不单单用一个电源按钮,点击后会下拉出一个菜单,里面包括重启,关机,挂起的功能?按钮的颜色跟背景色不同肯定会让它更加突兀和显眼……但我可不觉得这样子有多好。同样,这看起来可真像“苦思”后的决定。 + +从实用观点来看,GDM 还要远远实用的多,再看看顶部一栏。时间被列了出来,还有一个音量控制按钮,如果你想保持周围安静,你甚至可以在登录前设置静音,还有一个可用性按钮来实现高对比度、缩放、语音转文字等功能,所有可用的功能通过简单的一个开关按钮就能得到。 + +![](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_login3_show&w=1920) + +切换到上游(KDE 自带)的 Breeve 主题……突然间,我抱怨的大部分问题都被解决了。通用图标,所有东西都放在了屏幕中央,但不是那么重要的被放到了一边。因为屏幕顶部和底部都是同样的空白,在中间也就酝酿出了一种美好的和谐。还是有一个文本框来切换会话,但既然电源按钮被做成了通用图标,那么这点还算可以原谅。当前时间以一种漂亮的感觉呈现,旁边还有电量指示器。当然 gnome 还是有一些很好的附加物,例如音量小程序和可用性按钮,但 Breeze 总归要比 Fedora 的 KDE 主题进步。 + +到 Windows(Windows 8和10之前)或者 OS X 中去,你会看到类似的东西——非常简洁的,“不碍事”的锁屏与登录界面,它们都没有文本框或者其它分散视觉的小工具。这是一种有效的不分散人注意力的设计。Fedora……默认带有 Breeze 主题。VDG 在 Breeze 主题设计上干得不错。可别糟蹋了它。 + +-------------------------------------------------------------------------------- + +via: http://www.phoronix.com/scan.php?page=article&item=gnome-week-editorial&num=1 + +作者:Eric Griffith +译者:[XLCYun](https://github.com/XLCYun) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[1]:https://wiki.ubuntu.com/One%20Hundred%20Papercuts +[2]:http://www.phoronix.com/scan.php?page=article&item=fedora-22-kde&num=1 +[3]:https://launchpad.net/hundredpapercuts diff --git a/translated/tech/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 1 - Introduction.md b/translated/tech/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 1 - Introduction.md deleted file mode 100644 index 582708f5a4..0000000000 --- a/translated/tech/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 1 - Introduction.md +++ /dev/null @@ -1,55 +0,0 @@ -将GNOME作为我的Linux桌面的一周: 他们做对的与做错的 - 第一节 - 简介 -================================================================================ -*作者声明: 如果你是因为某种神迹而在没看标题的情况下点开了这篇文章,那么我想再重申一些东西...这是一篇评论文章。文中的观点都是我自己的,不代表Phoronix和Michael的观点。它们完全是我自己的想法。 - -另外,没错……这可能是一篇引战的文章。我希望社团成员们更沉稳一些,因为我确实想在KDE和Gnome的社团上发起讨论,反馈。因此当我想指出——我所看到的——一个瑕疵时,我会尽量地做到具体而直接。这样,相关的讨论也能做到同样的具体和直接。再次声明:本文另一可选标题为“被[细纸片][1]千刀万剐”(原文含paper cuts一词,指易修复但烦人的缺陷,译者注)。 - -现在,重申完毕……文章开始。 - -![](http://www.phoronix.net/image.php?id=fedora-22-fan&image=fedora_22_good1_show&w=1920) - -当我把[《评价Fedora 22 KDE》][2]一文发给Michael时,感觉很不是滋味。不是因为我不喜欢KDE,或者不享受Fedora,远非如此。事实上,我刚开始想把我的T450s的系统换为Arch Linux时,马上又决定放弃了,因为我很享受fedora在很多方面所带来的便捷性。 - -我感觉很不是滋味的原因是Fedora的开发者花费了大量的时间和精力在他们的“工作站”产品上,但是我却一点也没看到。在使用Fedora时,我采用的并非那些主要开发者希望用户采用的那种使用方式,因此我也就体验不到所谓的“Fedora体验”。它感觉就像一个人评价Ubuntu时用的却是Kubuntu,评价OS X时用的却是Hackintosh,或者评价Gentoo时用的却是Sabayon。根据大量Michael论坛的读者的说法,它们在评价各种发行版时使用的都是默认设置的发行版——我也不例外。但是我还是认为这些评价应该在“真实”配置下完成,当然我也知道在给定的情况下评论某些东西也的确是有价值的——无论是好是坏。 - -正是在怀着这种态度的情况下,我决定到Gnome这个水坑里来泡泡澡。 - -但是,我还要在此多加一个声明……我在这里所看到的KDE和Gnome都是打包在Fedora中的。OpenSUSE, Kubuntu, Arch等发行版的各个桌面可能有不同的实现方法,使得我这里所说的具体的“痛处”跟你所用的发行版有所不同。还有,虽然用了这个标题,但这篇文章将会是一篇很沉重的非常“KDE”的文章。之所以这样称呼这篇文章,是因为我在使用了Gnome之后,才知道KDE的“剪纸”到底有多多。 - -### 登录界面 ### - -![](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_login1_show&w=1920) - -我一般情况下都不会介意发行版装载它们自己的特别主题,因为一般情况下桌面看起来会更好看。可我今天可算是找到了一个例外。 - -第一印象很重要,对吧?那么,GDM(Gnome Display Manage:Gnome显示管理器,译者注,下同。)决对干得漂亮。它的登录界面看起来极度简洁,每一部分都应用了一致的设计风格。使用通用图标而不是输入框为它的简洁加了分。 - -![](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_login2_show&w=1920) - -这并不是说Fedora 22 KDE——现在已经是SDDM而不是KDM了——的登录界面不好看,但是看起来决对没有它这样和谐。 - -问题到底出来在哪?顶部栏。看看Gnome的截图——你选择一个用户,然后用一个很小的齿轮简单地选择想登入哪个会话。设计很简洁,它不挡着你的道儿,实话讲,如果你没注意的话可能完全会看不到它。现在看看那蓝色( blue,有忧郁之意,一语双关,译者注)的KDE截图,顶部栏看起来甚至不像是用同一个工具渲染出来的,它的整个位置的安排好像是某人想着:“哎哟妈呀,我们需要把这个选项扔在哪个地方……”之后决定下来的。 - -对于右上角的重启和关机选项也一样。为什么不单单用一个电源按钮,点击后会下拉出一个菜单,里面包括重启,关机,挂起的功能?按钮的颜色跟背景色不同肯定会让它更加突兀和显眼……但我可不觉得这样子有多好。同样,这看起来可真像“苦思”后的决定。 - -从实用观点来看,GDM还要远远实用的多,再看看顶部一栏。时间被列了出来,还有一个音量控制按钮,如果你想保持周围安静,你甚至可以在登录前设置静音,还有一个可用的按钮来实现高对比度,缩放,语音转文字等功能,所有可用的功能通过简单的一个开关按钮就能得到。 - -![](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_login3_show&w=1920) - -切换到upstream的Breeve主题……突然间,我抱怨的大部分问题都被完善了。通用图标,所有东西都放在了屏幕中央,但不是那么重要的被放到了一边。因为屏幕顶部和底部都是同样的空白,在中间也就酝酿出了一种美好的和谐。还是有一个输入框来切换会话,但既然电源按钮被做成了通用图标,那么这点还算可以原谅。当然gnome还是有一些很好的附加物,例如音量小程序和可访问按钮,但Breeze总归是Fedora的KDE主题的一个进步。 - -到Windows(Windows 8和10之前)或者OS X中去,你会看到类似的东西——非常简洁的,“不挡你道”的锁屏与登录界面,它们都没有输入框或者其它分散视觉的小工具。这是一种有效的不分散人注意力的设计。Fedora……默认装有Breeze。VDG在Breeze主题设计上干得不错。可别糟蹋了它。 - --------------------------------------------------------------------------------- - -via: http://www.phoronix.com/scan.php?page=article&item=gnome-week-editorial&num=1 - -作者:Eric Griffith -译者:[XLCYun](https://github.com/XLCYun) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[1]:https://wiki.ubuntu.com/One%20Hundred%20Papercuts -[2]:http://www.phoronix.com/scan.php?page=article&item=fedora-22-kde&num=1 -[3]:https://launchpad.net/hundredpapercuts From 716529e17d8b7ab2a7bf975282f1f34ea00ecf07 Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 16 Aug 2015 00:38:02 +0800 Subject: [PATCH 945/965] PUB:20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 2 - The GNOME Desktop @XLCYun --- ...ht & Wrong - Page 2 - The GNOME Desktop.md | 32 +++++++++++++++++++ ...ht & Wrong - Page 2 - The GNOME Desktop.md | 31 ------------------ 2 files changed, 32 insertions(+), 31 deletions(-) create mode 100644 published/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 2 - The GNOME Desktop.md delete mode 100644 translated/tech/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 2 - The GNOME Desktop.md diff --git a/published/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 2 - The GNOME Desktop.md b/published/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 2 - The GNOME Desktop.md new file mode 100644 index 0000000000..e47e59eaed --- /dev/null +++ b/published/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 2 - The GNOME Desktop.md @@ -0,0 +1,32 @@ +一周 GNOME 之旅:品味它和 KDE 的是是非非(第二节 GNOME桌面) +================================================================================ + +### 桌面 ### + +![](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_gdm_show&w=1920) + +在我这一周的前五天中,我都是直接手动登录进 Gnome 的——没有打开自动登录功能。在第五天的晚上,每一次都要手动登录让我觉得很厌烦,所以我就到用户管理器中打开了自动登录功能。下一次我登录的时候收到了一个提示:“你的密钥链(keychain)未解锁,请输入你的密码解锁”。在这时我才意识到了什么……Gnome 以前一直都在自动解锁我的密钥链(KDE 中叫做我的钱包),每当我通过 GDM 登录时 !当我绕开 GDM 的登录程序时,Gnome 才不得不介入让我手动解锁。 + +现在,鄙人的陋见是如果你打开了自动登录功能,那么你的密钥链也应当自动解锁——否则,这功能还有何用?无论如何,你还是需要输入你的密码,况且在 GDM 登录界面你还有机会选择要登录的会话,如果你想换的话。 + +但是,这点且不提,也就是在那一刻,我意识到要让这桌面感觉就像它在**和我**一起工作一样是多么简单的一件事。当我通过 SDDM 登录 KDE 时?甚至连启动界面都还没加载完成,就有一个窗口弹出来遮挡了启动动画(因此启动动画也就被破坏了),它提示我解锁我的 KDE 钱包或 GPG 钥匙环。 + +如果当前还没有钱包,你就会收到一个创建钱包的提醒——就不能在创建用户的时候同时为我创建一个吗?接着它又让你在两种加密模式中选择一种,甚至还暗示我们其中一种(Blowfish)是不安全的,既然是为了安全,为什么还要我选择一个不安全的东西?作者声明:如果你安装了真正的 KDE spin 版本而不是仅仅安装了被 KDE 搞过的版本,那么在创建用户时,它就会为你创建一个钱包。但很不幸的是,它不会帮你自动解锁,并且它似乎还使用了更老的 Blowfish 加密模式,而不是更新而且更安全的 GPG 模式。 + +![](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_kgpg_show&w=1920) + +如果你选择了那个安全的加密模式(GPG),那么它会尝试加载 GPG 密钥……我希望你已经创建过一个了,因为如果你没有,那么你可又要被指责一番了。怎么样才能创建一个?额……它不帮你创建一个……也不告诉你怎么创建……假如你真的搞明白了你应该使用 KGpg 来创建一个密钥,接着在你就会遇到一层层的菜单和一个个的提示,而这些菜单和提示只能让新手感到困惑。为什么你要问我 GPG 的二进制文件在哪?天知道在哪!如果不止一个,你就不能为我选择一个最新的吗?如果只有一个,我再问一次,为什么你还要问我? + +为什么你要问我要使用多大的密钥大小和加密算法?你既然默认选择了 2048 和 RSA/RSA,为什么不直接使用?如果你想让这些选项能够被修改,那就把它们扔在下面的“Expert mode(专家模式)” 按钮里去。这里不仅仅是说让配置可被用户修改的问题,而是说根本不需要默认把多余的东西扔在了用户面前。这种问题将会成为这篇文章剩下的主要内容之一……KDE 需要更理智的默认配置。配置是好的,我很喜欢在使用 KDE 时的配置,但它还需要知道什么时候应该,什么时候不应该去提示用户。而且它还需要知道“嗯,它是可配置的”不能做为默认配置做得不好的借口。用户最先接触到的就是默认配置,不好的默认配置注定要失去用户。 + +让我们抛开密钥链的问题,因为我想我已经表达出了我的想法。 + +-------------------------------------------------------------------------------- + +via: http://www.phoronix.com/scan.php?page=article&item=gnome-week-editorial&num=2 + +作者:Eric Griffith +译者:[XLCYun](https://github.com/XLCYun) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 diff --git a/translated/tech/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 2 - The GNOME Desktop.md b/translated/tech/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 2 - The GNOME Desktop.md deleted file mode 100644 index 5ce4dcd8d5..0000000000 --- a/translated/tech/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 2 - The GNOME Desktop.md +++ /dev/null @@ -1,31 +0,0 @@ -将GNOME作为我的Linux桌面的一周:他们做对的与做错的 - 第二节 - GNOME桌面 -================================================================================ -### 桌面 ### - -![](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_gdm_show&w=1920) - -在我这一周的前五天中,我都是直接手动登录进Gnome的——没有打开自动登录功能。在第五天的晚上,每一次都要手动登录让我觉得很厌烦,所以我就到用户管理器中打开了自动登录功能。下一次我登录的时候收到了一个提示:“你的密钥链(keychain)未解锁,请输入你的密码解锁”。在这时我才意识到了什么……每一次我通过GDM登录时——我的KDB钱包提示——Gnome以前一直都在自动解锁我的密钥链!当我绕开GDM的登录程序时,Gnome才不得不介入让我手动解锁。 - -现在,鄙人的陋见是如果你打开了自动登录功能,那么你的密钥链也应当自动解锁——否则,这功能还有何用?无论如何,你还是要输入你的密码,况且在GDM登录界面你还能有机会选择要登录的会话。 - -但是,这点且不提,也就是在那一刻,我意识到要让这桌面感觉是它在**和我**一起工作是多么简单的一件事。当我通过SDDM登录KDE时?甚至连启动界面都还没加载完成,就有一个窗口弹出来遮挡了启动动画——因此启动动画也就被破坏了——提示我解锁我的KDE钱包或GPG钥匙环。 - -如果当前不存在钱包,你就会收到一个创建钱包的提醒——就不能在创建用户的时候同时为我创建一个吗?——接着它又让你在两种加密模式中选择一种,甚至还暗示我们其中一种是不安全的(Blowfish),既然是为了安全,为什么还要我选择一个不安全的东西?作者声明:如果你安装了真正的KDE spin版本而不是仅仅安装了KDE的事后版本,那么在创建用户时,它就会为你创建一个钱包。但很不幸的是,它不会帮你解锁,并且它似乎还使用了更老的Blowfish加密模式,而不是更新而且更安全的GPG模式。 - -![](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_kgpg_show&w=1920) - -如果你选择了那个安全的加密模式(GPG),那么它会尝试加载GPG密钥……我希望你已经创建过一个了,因为如果你没有,那么你可又要被批一顿了。怎么样才能创建一个?额……它不帮你创建一个……也不告诉你怎么创建……假如你真的搞明白了你应该使用KGpg来创建一个密钥,接着在你就会遇到一层层的菜单和一个个的提示,而这些菜单和提示只能让新手感到困惑。为什么你要问我GPG的二进制文件在哪?天知道在哪!如果不止一个,你就不能为我选择一个最新的吗?如果只有一个,我再问一次,为什么你还要问我? - -为什么你要问我要使用多大的密钥大小和加密算法?你既然默认选择了2048和RSA/RSA,为什么不直接使用?如果你想让这些选项能够被改变,那就把它们扔在下面的"Expert mode(专家模式)"按钮里去。这不仅仅关于使配置可被用户改变,而是关于默认地把多余的东西扔在了用户面前。这种问题将会成为剩下文章的主题之一……KDE需要更好更理智的默认配置。配置是好的,我很喜欢在使用KDE时的配置,但它还需要知道什么时候应该,什么时候不应该去提示用户。而且它还需要知道“嗯,它是可配置的”不能做为默认配置做得不好的借口。用户最先接触到的就是默认配置,不好的默认配置注定要失去用户。 - -让我们抛开密钥链的问题,因为我想我已经表达出了我的想法。 - --------------------------------------------------------------------------------- - -via: http://www.phoronix.com/scan.php?page=article&item=gnome-week-editorial&num=2 - -作者:Eric Griffith -译者:[XLCYun](https://github.com/XLCYun) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 88435ed2b8be50e2c4e7534259af9336397bb1c6 Mon Sep 17 00:00:00 2001 From: DeadFire Date: Sun, 16 Aug 2015 02:34:08 +0800 Subject: [PATCH 946/965] =?UTF-8?q?20150816-1=20RHCE=20=E7=AC=AC=E5=9B=9B?= =?UTF-8?q?=E7=AF=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...Automate Linux System Maintenance Tasks.md | 207 ++++++++++++++++++ 1 file changed, 207 insertions(+) create mode 100644 sources/tech/RHCE/Part 4 - Using Shell Scripting to Automate Linux System Maintenance Tasks.md diff --git a/sources/tech/RHCE/Part 4 - Using Shell Scripting to Automate Linux System Maintenance Tasks.md b/sources/tech/RHCE/Part 4 - Using Shell Scripting to Automate Linux System Maintenance Tasks.md new file mode 100644 index 0000000000..bcd058611a --- /dev/null +++ b/sources/tech/RHCE/Part 4 - Using Shell Scripting to Automate Linux System Maintenance Tasks.md @@ -0,0 +1,207 @@ +Part 4 - Using Shell Scripting to Automate Linux System Maintenance Tasks +================================================================================ +Some time ago I read that one of the distinguishing characteristics of an effective system administrator / engineer is laziness. It seemed a little contradictory at first but the author then proceeded to explain why: + +![Automate Linux System Maintenance Tasks](http://www.tecmint.com/wp-content/uploads/2015/08/Automate-Linux-System-Maintenance-Tasks.png) + +RHCE Series: Automate Linux System Maintenance Tasks – Part 4 + +if a sysadmin spends most of his time solving issues and doing repetitive tasks, you can suspect he or she is not doing things quite right. In other words, an effective system administrator / engineer should develop a plan to perform repetitive tasks with as less action on his / her part as possible, and should foresee problems by using, + +for example, the tools reviewed in Part 3 – [Monitor System Activity Reports Using Linux Toolsets][1] of this series. Thus, although he or she may not seem to be doing much, it’s because most of his / her responsibilities have been taken care of with the help of shell scripting, which is what we’re going to talk about in this tutorial. + +### What is a shell script? ### + +In few words, a shell script is nothing more and nothing less than a program that is executed step by step by a shell, which is another program that provides an interface layer between the Linux kernel and the end user. + +By default, the shell used for user accounts in RHEL 7 is bash (/bin/bash). If you want a detailed description and some historical background, you can refer to [this Wikipedia article][2]. + +To find out more about the enormous set of features provided by this shell, you may want to check out its **man page**, which is downloaded in in PDF format at ([Bash Commands][3]). Other than that, it is assumed that you are familiar with Linux commands (if not, I strongly advise you to go through [A Guide from Newbies to SysAdmin][4] article in **Tecmint.com** before proceeding). Now let’s get started. + +### Writing a script to display system information ### + +For our convenience, let’s create a directory to store our shell scripts: + + # mkdir scripts + # cd scripts + +And open a new text file named `system_info.sh` with your preferred text editor. We will begin by inserting a few comments at the top and some commands afterwards: + + #!/bin/bash + + # Sample script written for Part 4 of the RHCE series + # This script will return the following set of system information: + # -Hostname information: + echo -e "\e[31;43m***** HOSTNAME INFORMATION *****\e[0m" + hostnamectl + echo "" + # -File system disk space usage: + echo -e "\e[31;43m***** FILE SYSTEM DISK SPACE USAGE *****\e[0m" + df -h + echo "" + # -Free and used memory in the system: + echo -e "\e[31;43m ***** FREE AND USED MEMORY *****\e[0m" + free + echo "" + # -System uptime and load: + echo -e "\e[31;43m***** SYSTEM UPTIME AND LOAD *****\e[0m" + uptime + echo "" + # -Logged-in users: + echo -e "\e[31;43m***** CURRENTLY LOGGED-IN USERS *****\e[0m" + who + echo "" + # -Top 5 processes as far as memory usage is concerned + echo -e "\e[31;43m***** TOP 5 MEMORY-CONSUMING PROCESSES *****\e[0m" + ps -eo %mem,%cpu,comm --sort=-%mem | head -n 6 + echo "" + echo -e "\e[1;32mDone.\e[0m" + +Next, give the script execute permissions: + + # chmod +x system_info.sh + +and run it: + + ./system_info.sh + +Note that the headers of each section are shown in color for better visualization: + +![Server Monitoring Shell Script](http://www.tecmint.com/wp-content/uploads/2015/08/Server-Monitoring-Shell-Script.png) + +Server Monitoring Shell Script + +That functionality is provided by this command: + + echo -e "\e[COLOR1;COLOR2m\e[0m" + +Where COLOR1 and COLOR2 are the foreground and background colors, respectively (more info and options are explained in this entry from the [Arch Linux Wiki][5]) and is the string that you want to show in color. + +### Automating Tasks ### + +The tasks that you may need to automate may vary from case to case. Thus, we cannot possibly cover all of the possible scenarios in a single article, but we will present three classic tasks that can be automated using shell scripting: + +**1)** update the local file database, 2) find (and alternatively delete) files with 777 permissions, and 3) alert when filesystem usage surpasses a defined limit. + +Let’s create a file named `auto_tasks.sh` in our scripts directory with the following content: + + #!/bin/bash + + # Sample script to automate tasks: + # -Update local file database: + echo -e "\e[4;32mUPDATING LOCAL FILE DATABASE\e[0m" + updatedb + if [ $? == 0 ]; then + echo "The local file database was updated correctly." + else + echo "The local file database was not updated correctly." + fi + echo "" + + # -Find and / or delete files with 777 permissions. + echo -e "\e[4;32mLOOKING FOR FILES WITH 777 PERMISSIONS\e[0m" + # Enable either option (comment out the other line), but not both. + # Option 1: Delete files without prompting for confirmation. Assumes GNU version of find. + #find -type f -perm 0777 -delete + # Option 2: Ask for confirmation before deleting files. More portable across systems. + find -type f -perm 0777 -exec rm -i {} +; + echo "" + # -Alert when file system usage surpasses a defined limit + echo -e "\e[4;32mCHECKING FILE SYSTEM USAGE\e[0m" + THRESHOLD=30 + while read line; do + # This variable stores the file system path as a string + FILESYSTEM=$(echo $line | awk '{print $1}') + # This variable stores the use percentage (XX%) + PERCENTAGE=$(echo $line | awk '{print $5}') + # Use percentage without the % sign. + USAGE=${PERCENTAGE%?} + if [ $USAGE -gt $THRESHOLD ]; then + echo "The remaining available space in $FILESYSTEM is critically low. Used: $PERCENTAGE" + fi + done < <(df -h --total | grep -vi filesystem) + +Please note that there is a space between the two `<` signs in the last line of the script. + +![Shell Script to Find 777 Permissions](http://www.tecmint.com/wp-content/uploads/2015/08/Shell-Script-to-Find-777-Permissions.png) + +Shell Script to Find 777 Permissions + +### Using Cron ### + +To take efficiency one step further, you will not want to sit in front of your computer and run those scripts manually. Rather, you will use cron to schedule those tasks to run on a periodic basis and sends the results to a predefined list of recipients via email or save them to a file that can be viewed using a web browser. + +The following script (filesystem_usage.sh) will run the well-known **df -h** command, format the output into a HTML table and save it in the **report.html** file: + + #!/bin/bash + # Sample script to demonstrate the creation of an HTML report using shell scripting + # Web directory + WEB_DIR=/var/www/html + # A little CSS and table layout to make the report look a little nicer + echo " + + + + + " > $WEB_DIR/report.html + # View hostname and insert it at the top of the html body + HOST=$(hostname) + echo "Filesystem usage for host $HOST
+ Last updated: $(date)

+ + " >> $WEB_DIR/report.html + # Read the output of df -h line by line + while read line; do + echo "" >> $WEB_DIR/report.html + done < <(df -h | grep -vi filesystem) + echo "
Filesystem + Size + Use % +
" >> $WEB_DIR/report.html + echo $line | awk '{print $1}' >> $WEB_DIR/report.html + echo "" >> $WEB_DIR/report.html + echo $line | awk '{print $2}' >> $WEB_DIR/report.html + echo "" >> $WEB_DIR/report.html + echo $line | awk '{print $5}' >> $WEB_DIR/report.html + echo "
" >> $WEB_DIR/report.html + +In our **RHEL 7** server (**192.168.0.18**), this looks as follows: + +![Server Monitoring Report](http://www.tecmint.com/wp-content/uploads/2015/08/Server-Monitoring-Report.png) + +Server Monitoring Report + +You can add to that report as much information as you want. To run the script every day at 1:30 pm, add the following crontab entry: + + 30 13 * * * /root/scripts/filesystem_usage.sh + +### Summary ### + +You will most likely think of several other tasks that you want or need to automate; as you can see, using shell scripting will greatly simplify this effort. Feel free to let us know if you find this article helpful and don't hesitate to add your own ideas or comments via the form below. + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/using-shell-script-to-automate-linux-system-maintenance-tasks/ + +作者:[Gabriel Cánepa][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/gacanepa/ +[1]:http://www.tecmint.com/linux-performance-monitoring-and-file-system-statistics-reports/ +[2]:https://en.wikipedia.org/wiki/Bash_%28Unix_shell%29 +[3]:http://www.tecmint.com/wp-content/pdf/bash.pdf +[4]:http://www.tecmint.com/60-commands-of-linux-a-guide-from-newbies-to-system-administrator/ +[5]:https://wiki.archlinux.org/index.php/Color_Bash_Prompt \ No newline at end of file From 71b69ec5747ae3160a79e0fd15dd181d35871fa6 Mon Sep 17 00:00:00 2001 From: DeadFire Date: Sun, 16 Aug 2015 02:59:16 +0800 Subject: [PATCH 947/965] =?UTF-8?q?20150816-2=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...raphics Drivers PPA Is Ready For Action.md | 62 ++++++ ...box--A Web based AJAX Terminal Emulator.md | 157 +++++++++++++++ ...ow to migrate MySQL to MariaDB on Linux.md | 186 ++++++++++++++++++ 3 files changed, 405 insertions(+) create mode 100644 sources/news/20150816 Ubuntu NVIDIA Graphics Drivers PPA Is Ready For Action.md create mode 100644 sources/share/20150816 shellinabox--A Web based AJAX Terminal Emulator.md create mode 100644 sources/tech/20150816 How to migrate MySQL to MariaDB on Linux.md diff --git a/sources/news/20150816 Ubuntu NVIDIA Graphics Drivers PPA Is Ready For Action.md b/sources/news/20150816 Ubuntu NVIDIA Graphics Drivers PPA Is Ready For Action.md new file mode 100644 index 0000000000..e2a78e88dc --- /dev/null +++ b/sources/news/20150816 Ubuntu NVIDIA Graphics Drivers PPA Is Ready For Action.md @@ -0,0 +1,62 @@ +Ubuntu NVIDIA Graphics Drivers PPA Is Ready For Action +================================================================================ +![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/08/Screen-Shot-2015-08-12-at-14.19.42.png) + +Get your frame-rate on + +**Well, that didn’t take long. ** + +Just days after [proposing][1] the creation of a new PPA to provide Ubuntu users with the latest NVIDIA graphics drivers the Ubuntu community has clubbed together to do, well, just that. + +The plainly named ‘**Graphics Drivers PPA**‘ contains the latest release of NVIDIA’s proprietary Linux grapics drivers, packaged up for Ubuntu users to upgrade to – no binary runtime headaches needed! + +The PPA is designed to offer gamers a way to run the latest games on the latest on Ubuntu as easily as possible. + +#### Ready, But Not Ready #### + +Jorge Castro’s idea to create a ‘blessed’ PPA containing newer NVIDIA graphics drivers for those wot want ’em has been greeted with enthusiasm by Ubuntu users and games developers alike. + +Even those involved in porting some of Steam’s biggest titles to Linux have chimed in to offer advice and suggestions. + +Edwin Smith, head of production at Feral Interactive (‘Shadow of Mordor’) welcomed the initiative to prove users with “easier way of updating drivers”. + +### How To Use The New Nvidia Drivers PPA ### + +Although the new ‘Graphic Drivers PPA’ is live it is not strictly ready for the prime time. Its maintainers caution: + +> “This PPA is currently in testing, you should be experienced with packaging before you dive in here. Give a few days to sort out the kinks.” + +Jorge, who soft launched the PPA in a post to the Ubuntu desktop mailing list, also notes that gamers using existing PPAs, like xorg-edgers, for timely graphics driver updates won’t notice any driver difference for now (as the drivers have simply been copied over from some of those PPAs to this new one). + +“The real fun begins when new drivers are released,” he adds. + +Right now, as of writing, the PPA contains a batch of recent Nvidia drivers for Ubuntu 12.04.1 through 15.10. Note all drivers are available for all releases. + +> **It should go without saying: unless you know what you’re doing, and how to undo it, do not follow the instructions that follow. ** + +To add the PPA run the following in a new Terminal window: + + sudo add-apt-repository ppa:graphics-drivers/ppa + +To upgrade to or install the latest Nvidia drivers: + + sudo apt-get update && sudo apt-get install nvidia-355 + +Remember: if the PPA breaks your system you are allowed to keep both halves. + +To roll back/undo changes made the PPA you should use the ppa-purge command. + +Feel free to leave any advice/help/corrections/thoughts on the PPA (and as I don’t have NVIDIA hardware to test the above out for myself, it’s all appreciated) in the comments below. + +-------------------------------------------------------------------------------- + +via: http://www.omgubuntu.co.uk/2015/08/ubuntu-nvidia-graphics-drivers-ppa-is-ready-for-action + +作者:[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://www.omgubuntu.co.uk/2015/08/ubuntu-easy-install-latest-nvidia-linux-drivers \ No newline at end of file diff --git a/sources/share/20150816 shellinabox--A Web based AJAX Terminal Emulator.md b/sources/share/20150816 shellinabox--A Web based AJAX Terminal Emulator.md new file mode 100644 index 0000000000..002a2ed10f --- /dev/null +++ b/sources/share/20150816 shellinabox--A Web based AJAX Terminal Emulator.md @@ -0,0 +1,157 @@ +shellinabox – A Web based AJAX Terminal Emulator +================================================================================ +### About shellinabox ### + +Greetings Unixmen readers! + +We, usually, access any remote servers using well known communication tools like OpenSSH, and Putty etc. But, one important thing is we can’t access the remote systems using those tools behind a Firewall or the firewalls that allow only HTTPS traffic. No worries! We, still, have some options to access your remote systems even if you’re behind a firewall. And also, you don’t need to install any communications tools like OpenSSH or Putty. All you need is only a modern JavaScript and CSS enabled browser. And you don’t need to install any plugins or third party softwares either. + +Meet **Shell In A Box**, pronounced as **shellinabox**, a free, open source, web based AJAX Terminal emulator developed by **Markus Gutschke**. It uses AJAX technology to provide the look and feel of a native shell via a web browser. The **shellinaboxd** daemon implements a webserver that listens on the specified port. The web server publishes one or more services that will be displayed in a VT100 emulator implemented as an AJAX web application. By default, the port is 4200. You can change the default port to any random port number of your choice. After installing shellinabox on all your remote servers that you want to access them from your local system, open up the web browser and navigate to: **http://IP-Address:4200/**. Enter your user name and password and start using your remote system’s shell. Seems interesting, isn’t it? Indeed! + +**Disclaimer**: + +Shellinabox is not a ssh client or any sort of security software. It is just a application that emulates a remote system’s shell via a web browser. Also, It has nothing to do with SSH in anyway. It’s not a bullet proof security way to remote your systems. It is just one of the easiest methods so far. You should not run it on any public network for any reason. + +### Install shellinabox ### + +#### In Debian/Ubuntu based systems: #### + +shellinabox is available in the default repositories. So, you can install it using command: + + $ sudo apt-get install shellinabox + +#### In RHEL/CentOS systems: #### + +First, install EPEL repository using command: + + # yum install epel-release + +Then, install shellinabox using command: + + # yum install shellinabox + +Done! + +### Configure shellinabox ### + +As I mentioned before, shellinabox listens on port **4200** by default. You can change this port to any random number of your choice to make it difficult to guess by anyone. + +The shellinabox config file is located in **/etc/default/shellinabox** file by default in Debian/Ubuntu systems. In RHEL/CentOS/Fedora, the default location of config file is **/etc/sysconfig/shellinaboxd**. + +If you want to change the default port, + +In Debian/Ubuntu: + + $ sudo vi /etc/default/shellinabox + +In RHEL/CentOS/Fedora: + + # vi /etc/sysconfig/shellinaboxd + +Change your port to any random number. Since I am testing it on my local network, I use the default values. + + # Shell in a box daemon configuration + # For details see shellinaboxd man page + + # Basic options + USER=shellinabox + GROUP=shellinabox + CERTDIR=/var/lib/shellinabox + PORT=4200 + OPTS="--disable-ssl-menu -s /:LOGIN" + + # Additional examples with custom options: + + # Fancy configuration with right-click menu choice for black-on-white: + # OPTS="--user-css Normal:+black-on-white.css,Reverse:-white-on-black.css --disable-ssl-menu -s /:LOGIN" + + # Simple configuration for running it as an SSH console with SSL disabled: + # OPTS="-t -s /:SSH:host.example.com" + +Restart shelinabox service. + +**In Debian/Ubuntu:** + + $ sudo systemctl restart shellinabox + +Or + + $ sudo service shellinabox restart + +In RHEL/CentOS systems run the following command to start shellinaboxd service automatically on every reboot. + + # systemctl enable shellinaboxd + +Or + + # chkconfig shellinaboxd on + +Remember to open up port **4200** or any port that you assign if you are running a firewall. + +For example, in RHEL/CentOS systems, you can allow the port as shown below. + + # firewall-cmd --permanent --add-port=4200/tcp + +---------- + + # firewall-cmd --reload + +### Usage ### + +Now, go to your client systems, open up the web browser and navigate to: **https://ip-address-of-remote-servers:4200**. + +**Note**: Mention the correct port if you have changed it. + +You’ll get a warning message of certificate issue. Accept the certificate and go on. + +![Privacy error - Google Chrome_001](http://www.unixmen.com/wp-content/uploads/2015/08/Privacy-error-Google-Chrome_001.jpg) + +Enter your remote system’s username and password. Now, you’ll be able to access the remote system’s shell right from the browser itself. + +![Shell In A Box - Google Chrome_003](http://www.unixmen.com/wp-content/uploads/2015/08/sk@server1-Shell-In-A-Box-Google-Chrome_003.jpg) + +You can get some additional menu options which might be useful by right clicking on the empty space of your browser. + +![Shell In A Box - Google Chrome_004](http://www.unixmen.com/wp-content/uploads/2015/08/sk@server1-Shell-In-A-Box-Google-Chrome_004.jpg) + +From now on, you can do whatever you want to do in your remote server from the local system’s web browser. + +Once you done, type **exit** in the shell. + +To connect again to the remote system, click the **Connect** button and then type the user name and password of your remote server. + +![Shell In A Box - Google Chrome_005](http://www.unixmen.com/wp-content/uploads/2015/08/sk@server1-Shell-In-A-Box-Google-Chrome_005.jpg) + +For more details about shellinabox, type the following command in your Terminal: + + # man shellinabox + +Or + + # shellinaboxd -help + +Also, refer the [shellinabox wiki page][1] for comprehensive usage details. + +### Conclusion ### + +Like I mentioned before, web-based SSH tools are very useful if you’re running servers behind a Firewall. There are many web-based ssh tools, but Shellinabox is pretty simple and useful tool to emulate a remote system’s shell from anywhere in your network. Since, it is browser based, you can access your remote server from any device as long as you have a JavaScript and CSS enabled browser. + +That’s all for now. Have a good day! + +#### Reference link: #### + +- [shellinabox website][2] + +-------------------------------------------------------------------------------- + +via: http://www.unixmen.com/shellinabox-a-web-based-ajax-terminal-emulator/ + +作者:[SK][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://www.unixmen.com/author/sk/ +[1]:https://code.google.com/p/shellinabox/wiki/shellinaboxd_man +[2]:https://code.google.com/p/shellinabox/ \ No newline at end of file diff --git a/sources/tech/20150816 How to migrate MySQL to MariaDB on Linux.md b/sources/tech/20150816 How to migrate MySQL to MariaDB on Linux.md new file mode 100644 index 0000000000..8c1b68b1ed --- /dev/null +++ b/sources/tech/20150816 How to migrate MySQL to MariaDB on Linux.md @@ -0,0 +1,186 @@ +How to migrate MySQL to MariaDB on Linux +================================================================================ +Since the Oracle's acquisition of MySQL, a lot of MySQL developers and users moved away from MySQL due to Oracle's more closed-door stance on MySQL development and maintenance. The community-driven outcome of such movement is a fork of MySQL, called MariaDB. Led by original MySQL developers, the development of MariaDB follows the open-source philosophy and makes sure of [its binary compatibility with MySQL][1]. The Linux distributions such as Red Hat families (Fedora, CentOS, RHEL), Ubuntu and Mint, openSUSE and Debian already started to use and support MariaDB as a drop-in replacement of MySQL. + +If you want to migrate your database from MySQL to MariaDB, this article is what you are looking for. Fortunately, due to their binary compatibility, MySQL-to-MariaDB migration process is pretty much straightforward. If you follow the steps below, the migration from MySQL to MariaDB will most likely be painless. + +### Prepare a MySQL Database and a Table ### + +For demonstration purpose, let's create a test MySQL database and one table in the database before doing the migration. Skip this step if you already have existing MySQL database(s) to migrate to MariaDB. Otherwise proceed as follows. + +Log in into MySQL from a terminal by typing your MySQL root user password. + + $ mysql -u root -p + +Create a database and a table. + + mysql> create database test01; + mysql> use test01; + mysql> create table pet(name varchar(30), owner varchar(30), species varchar(20), sex char(1)); + +Add some records to the table. + + mysql> insert into pet values('brandon','Jack','puddle','m'),('dixie','Danny','chihuahua','f'); + +Then quit the MySQL database. + +### Backup the MySQL Database ### + +The next step is to back up existing MySQL database(s). Use the following mysqldump command to export all existing databases to a file. Before running this command, make sure that binary logging is enabled in your MySQL server. If you don't know how to enable binary logging, see the instructions toward the end of the tutorial. + + $ mysqldump --all-databases --user=root --password --master-data > backupdb.sql + +![](https://farm6.staticflickr.com/5775/20555772385_21b89335e3_b.jpg) + +Now create a backup of my.cnf file somewhere in your system before uninstalling MySQL. This step is optional. + + $ sudo cp /etc/mysql/my.cnf /opt/my.cnf.bak + +### Uninstall MySQL Package ### + +First, you need to stop the MySQL service. + + $ sudo service mysql stop + +or: + + $ sudo systemctl stop mysql + +or: + + $ sudo /etc/init.d/mysql stop + +Then go ahead and remove MySQL packages and configurations as follows. + +On RPM based system (e.g., CentOS, Fedora or RHEL): + + $ sudo yum remove mysql* mysql-server mysql-devel mysql-libs + $ sudo rm -rf /var/lib/mysql + +On Debian based system (e.g., Debian, Ubuntu or Mint): + + $ sudo apt-get remove mysql-server mysql-client mysql-common + $ sudo apt-get autoremove + $ sudo apt-get autoclean + $ sudo deluser mysql + $ sudo rm -rf /var/lib/mysql + +### Install MariaDB Package ### + +The latest CentOS/RHEL 7 and Ubuntu (14.04 or later) contain MariaDB packages in their official repositories. In Fedora, MariaDB has become a replacement of MySQL since version 19. If you are using an old version or LTS type like Ubuntu 13.10 or earlier, you still can install MariaDB by adding its official repository. + +[MariaDB website][2] provide an online tool to help you add MariaDB's official repository according to your Linux distribution. This tool provides steps to add the MariaDB repository for openSUSE, Arch Linux, Mageia, Fedora, CentOS, RedHat, Mint, Ubuntu, and Debian. + +![](https://farm6.staticflickr.com/5809/20367745260_073020b910_c.jpg) + +As an example, let's use the Ubuntu 14.04 distribution and CentOS 7 to configure the MariaDB repository. + +**Ubuntu 14.04** + + $ sudo apt-get install software-properties-common + $ sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xcbcb082a1bb943db + $ sudo add-apt-repository 'deb http://mirror.mephi.ru/mariadb/repo/5.5/ubuntu trusty main' + $ sudo apt-get update + $ sudo apt-get install mariadb-server + +**CentOS 7** + +Create a custom yum repository file for MariaDB as follows. + + $ sudo vi /etc/yum.repos.d/MariaDB.repo + +---------- + + [mariadb] + name = MariaDB + baseurl = http://yum.mariadb.org/5.5/centos7-amd64 + gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB + gpgcheck=1 + +---------- + + $ sudo yum install MariaDB-server MariaDB-client + +After all necessary packages are installed, you may be asked to type a new password for root user account. After setting the root password, don't forget to recover my.cnf backup file. + + $ sudo cp /opt/my.cnf /etc/mysql/ + +Now start MariaDB service as follows. + + $ sudo service mariadb start + +or: + + $ sudo systemctl start mariadb + +or: + + $ sudo /etc/init.d/mariadb start + +### Importing MySQL Database(s) ### + +Finally, we have to import the previously exported database(s) back to MariaDB server as follows. + + $ mysql -u root -p < backupdb.sql + +Enter your MariaDB's root password, and the database import process will start. When the import process is finished, it will return to a command prompt. + +To check whether or not the import process is completed successfully, log in into MariaDB server and perform some sample queries. + + $ mysql -u root -p + +---------- + + MariaDB [(none)]> show databases; + MariaDB [(none)]> use test01; + MariaDB [test01]> select * from pet; + +![](https://farm6.staticflickr.com/5820/20562243721_428a9a12a7_b.jpg) + +### Conclusion ### + +As you can see in this tutorial, MySQL-to-MariaDB migration is not difficult. MariaDB has a lot of new features than MySQL, that you should know about. As far as configuration is concerned, in my test case, I simply used my old MySQL configuration file (my.cnf) as a MariaDB configuration file, and the import process was completed fine without any issue. My suggestion for the configuration is that you read the documentation on MariaDB configuration options carefully before the migration, especially if you are using specific MySQL configurations. + +If you are running more complex setup with tons of tables and databases including clustering or master-slave replication, take a look at the [more detailed guide][3] by the Mozilla IT and Operations team, or the [official MariaDB documentation][4]. + +### Troubleshooting ### + +1. While running mysqldump command to back up databases, you are getting the following error. + + $ mysqldump --all-databases --user=root --password --master-data > backupdb.sql + +---------- + + mysqldump: Error: Binlogging on server not active + +By using "--master-data", you are trying to include binary log information in the exported output, which is useful for database replication and recovery. However, binary logging is not enabled in MySQL server. To fix this error, modify your my.cnf file, and add the following option under [mysqld] section. + + log-bin=mysql-bin + +Save my.cnf file, and restart the MySQL service: + + $ sudo service mysql restart + +or: + + $ sudo systemctl restart mysql + +or: + + $ sudo /etc/init.d/mysql restart + +-------------------------------------------------------------------------------- + +via: http://xmodulo.com/migrate-mysql-to-mariadb-linux.html + +作者:[Kristophorus Hadiono][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/kristophorus +[1]:https://mariadb.com/kb/en/mariadb/mariadb-vs-mysql-compatibility/ +[2]:https://downloads.mariadb.org/mariadb/repositories/#mirror=aasaam +[3]:https://blog.mozilla.org/it/2013/12/16/upgrading-from-mysql-5-1-to-mariadb-5-5/ +[4]:https://mariadb.com/kb/en/mariadb/documentation/ \ No newline at end of file From bf1893ed319087970b2a8b1cf72ba1cbc4f11871 Mon Sep 17 00:00:00 2001 From: DongShuaike Date: Sun, 16 Aug 2015 08:45:34 +0800 Subject: [PATCH 948/965] Update 20150816 Ubuntu NVIDIA Graphics Drivers PPA Is Ready For Action.md --- ... Ubuntu NVIDIA Graphics Drivers PPA Is Ready For Action.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/news/20150816 Ubuntu NVIDIA Graphics Drivers PPA Is Ready For Action.md b/sources/news/20150816 Ubuntu NVIDIA Graphics Drivers PPA Is Ready For Action.md index e2a78e88dc..9309069bb8 100644 --- a/sources/news/20150816 Ubuntu NVIDIA Graphics Drivers PPA Is Ready For Action.md +++ b/sources/news/20150816 Ubuntu NVIDIA Graphics Drivers PPA Is Ready For Action.md @@ -1,3 +1,5 @@ +DongShuaike is translating. + Ubuntu NVIDIA Graphics Drivers PPA Is Ready For Action ================================================================================ ![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/08/Screen-Shot-2015-08-12-at-14.19.42.png) @@ -59,4 +61,4 @@ via: http://www.omgubuntu.co.uk/2015/08/ubuntu-nvidia-graphics-drivers-ppa-is-re 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 [a]:https://plus.google.com/117485690627814051450/?rel=author -[1]:http://www.omgubuntu.co.uk/2015/08/ubuntu-easy-install-latest-nvidia-linux-drivers \ No newline at end of file +[1]:http://www.omgubuntu.co.uk/2015/08/ubuntu-easy-install-latest-nvidia-linux-drivers From 04b06a015b47139520f7940ee17e5a2d5e861c8b Mon Sep 17 00:00:00 2001 From: struggling <630441839@qq.com> Date: Sun, 16 Aug 2015 09:51:17 +0800 Subject: [PATCH 949/965] Update 20150816 How to migrate MySQL to MariaDB on Linux.md --- .../tech/20150816 How to migrate MySQL to MariaDB on Linux.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150816 How to migrate MySQL to MariaDB on Linux.md b/sources/tech/20150816 How to migrate MySQL to MariaDB on Linux.md index 8c1b68b1ed..83dfe7b923 100644 --- a/sources/tech/20150816 How to migrate MySQL to MariaDB on Linux.md +++ b/sources/tech/20150816 How to migrate MySQL to MariaDB on Linux.md @@ -1,3 +1,4 @@ +translation by strugglingyouth How to migrate MySQL to MariaDB on Linux ================================================================================ Since the Oracle's acquisition of MySQL, a lot of MySQL developers and users moved away from MySQL due to Oracle's more closed-door stance on MySQL development and maintenance. The community-driven outcome of such movement is a fork of MySQL, called MariaDB. Led by original MySQL developers, the development of MariaDB follows the open-source philosophy and makes sure of [its binary compatibility with MySQL][1]. The Linux distributions such as Red Hat families (Fedora, CentOS, RHEL), Ubuntu and Mint, openSUSE and Debian already started to use and support MariaDB as a drop-in replacement of MySQL. @@ -183,4 +184,4 @@ via: http://xmodulo.com/migrate-mysql-to-mariadb-linux.html [1]:https://mariadb.com/kb/en/mariadb/mariadb-vs-mysql-compatibility/ [2]:https://downloads.mariadb.org/mariadb/repositories/#mirror=aasaam [3]:https://blog.mozilla.org/it/2013/12/16/upgrading-from-mysql-5-1-to-mariadb-5-5/ -[4]:https://mariadb.com/kb/en/mariadb/documentation/ \ No newline at end of file +[4]:https://mariadb.com/kb/en/mariadb/documentation/ From 83ff975b611de4e0b84c8d799c2a0c1cd13056b0 Mon Sep 17 00:00:00 2001 From: DongShuaike Date: Sun, 16 Aug 2015 10:14:53 +0800 Subject: [PATCH 950/965] Delete 20150816 Ubuntu NVIDIA Graphics Drivers PPA Is Ready For Action.md --- ...raphics Drivers PPA Is Ready For Action.md | 64 ------------------- 1 file changed, 64 deletions(-) delete mode 100644 sources/news/20150816 Ubuntu NVIDIA Graphics Drivers PPA Is Ready For Action.md diff --git a/sources/news/20150816 Ubuntu NVIDIA Graphics Drivers PPA Is Ready For Action.md b/sources/news/20150816 Ubuntu NVIDIA Graphics Drivers PPA Is Ready For Action.md deleted file mode 100644 index 9309069bb8..0000000000 --- a/sources/news/20150816 Ubuntu NVIDIA Graphics Drivers PPA Is Ready For Action.md +++ /dev/null @@ -1,64 +0,0 @@ -DongShuaike is translating. - -Ubuntu NVIDIA Graphics Drivers PPA Is Ready For Action -================================================================================ -![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/08/Screen-Shot-2015-08-12-at-14.19.42.png) - -Get your frame-rate on - -**Well, that didn’t take long. ** - -Just days after [proposing][1] the creation of a new PPA to provide Ubuntu users with the latest NVIDIA graphics drivers the Ubuntu community has clubbed together to do, well, just that. - -The plainly named ‘**Graphics Drivers PPA**‘ contains the latest release of NVIDIA’s proprietary Linux grapics drivers, packaged up for Ubuntu users to upgrade to – no binary runtime headaches needed! - -The PPA is designed to offer gamers a way to run the latest games on the latest on Ubuntu as easily as possible. - -#### Ready, But Not Ready #### - -Jorge Castro’s idea to create a ‘blessed’ PPA containing newer NVIDIA graphics drivers for those wot want ’em has been greeted with enthusiasm by Ubuntu users and games developers alike. - -Even those involved in porting some of Steam’s biggest titles to Linux have chimed in to offer advice and suggestions. - -Edwin Smith, head of production at Feral Interactive (‘Shadow of Mordor’) welcomed the initiative to prove users with “easier way of updating drivers”. - -### How To Use The New Nvidia Drivers PPA ### - -Although the new ‘Graphic Drivers PPA’ is live it is not strictly ready for the prime time. Its maintainers caution: - -> “This PPA is currently in testing, you should be experienced with packaging before you dive in here. Give a few days to sort out the kinks.” - -Jorge, who soft launched the PPA in a post to the Ubuntu desktop mailing list, also notes that gamers using existing PPAs, like xorg-edgers, for timely graphics driver updates won’t notice any driver difference for now (as the drivers have simply been copied over from some of those PPAs to this new one). - -“The real fun begins when new drivers are released,” he adds. - -Right now, as of writing, the PPA contains a batch of recent Nvidia drivers for Ubuntu 12.04.1 through 15.10. Note all drivers are available for all releases. - -> **It should go without saying: unless you know what you’re doing, and how to undo it, do not follow the instructions that follow. ** - -To add the PPA run the following in a new Terminal window: - - sudo add-apt-repository ppa:graphics-drivers/ppa - -To upgrade to or install the latest Nvidia drivers: - - sudo apt-get update && sudo apt-get install nvidia-355 - -Remember: if the PPA breaks your system you are allowed to keep both halves. - -To roll back/undo changes made the PPA you should use the ppa-purge command. - -Feel free to leave any advice/help/corrections/thoughts on the PPA (and as I don’t have NVIDIA hardware to test the above out for myself, it’s all appreciated) in the comments below. - --------------------------------------------------------------------------------- - -via: http://www.omgubuntu.co.uk/2015/08/ubuntu-nvidia-graphics-drivers-ppa-is-ready-for-action - -作者:[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://www.omgubuntu.co.uk/2015/08/ubuntu-easy-install-latest-nvidia-linux-drivers From 3dc4222fa12ead237c9b256a171beaf6d9071e5d Mon Sep 17 00:00:00 2001 From: DongShuaike Date: Sun, 16 Aug 2015 10:15:33 +0800 Subject: [PATCH 951/965] Create 20150816 Ubuntu NVIDIA Graphics Drivers PPA Is Ready For Action.md --- ...raphics Drivers PPA Is Ready For Action.md | 66 +++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 translated/news/20150816 Ubuntu NVIDIA Graphics Drivers PPA Is Ready For Action.md diff --git a/translated/news/20150816 Ubuntu NVIDIA Graphics Drivers PPA Is Ready For Action.md b/translated/news/20150816 Ubuntu NVIDIA Graphics Drivers PPA Is Ready For Action.md new file mode 100644 index 0000000000..3726a6465a --- /dev/null +++ b/translated/news/20150816 Ubuntu NVIDIA Graphics Drivers PPA Is Ready For Action.md @@ -0,0 +1,66 @@ +Ubuntu NVIDIA显卡驱动PPA已经做好准备 +================================================================================ +![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/08/Screen-Shot-2015-08-12-at-14.19.42.png) + +加速你的帧频! + +**嘿,各位,稍安勿躁,很快就好。** + +就在提议开发一个新的PPA来提供给Ubuntu用户们最新的NVIDIA显卡驱动后不久,ubuntu社区的人们又集结起来了,就是为了这件事。 + +顾名思义,‘**Graphics Drivers PPA**’包含了最新的NVIDIA Linux显卡驱动发行版,打包起来给用户升级用——没有让人头疼的二进制运行时文件! + +PPA被设计用来让家们尽可能方便地在Ubuntu上上运行最新款的游戏。 + +#### 万事俱备,只欠东风 #### + +Jorge Castro开发一个包含NVIDIA最新显卡驱动的PPA神器的想法得到了Ubuntu用户和广大游戏开发者的热烈响应。 + +就连那些致力于将游戏从“Steam平台”移植到Linux的游戏人员,也给了不少建议。 + +Edwin Smith,Feral Interactive公司的生产总监,对于“开发PPA源,让用户更方便地更新驱动”这种原创行为表示非常欣慰。 + +### 如何使用最新的Nvidia Drivers PPA### + +虽然新的“显卡PPA”已经开发出来,但是现在还远远达不到成熟。开发者们提醒到: + +>“这款PPA还处于测试阶段,在你使用它之前最好对打包经验丰富。请大家稍安勿躁,再等几天。” + +将PPA试发布给Ubuntu desktop邮件列表的Jorge,也强调说,使用现行的一些PPA(比如xorg-edgers)的玩家可能发现不了什么区别(因为现在的驱动只不过是把内容从其他那些现存驱动拷贝过来了) + +“新驱动发布的时候,好戏才会上演呢,”他说。 + +截至写作本文时为止,这个PPA囊括了从Ubuntu 12.04.1到 15.10各个版本的Nvidia驱动。注意这些驱动对所有的发行版都适用。 + +> **毫无疑问,除非你清楚自己在干些什么,并且知道如果出了问题应该怎么撤销,否则就不要进行下面的操作。** + +新打开一个终端窗口,运行下面的命令加入PPA: + + sudo add-apt-repository ppa:graphics-drivers/ppa + +安装或更新到最新的Nvidia显卡驱动: + + sudo apt-get update && sudo apt-get install nvidia-355 + +记住:如果PPA把你的系统弄崩了,你可得自己去想办法,我们提醒过了哦。(译者注:切记!) + +如果想要撤销对PPA的改变,使用ppa-purge命令。 + +有什么意见,想法,或者指正,就在下面的评论栏里写下来吧。(我没有NVIDIA的硬件来为我自己验证上面的这些东西,如果你可以验证的话,那就太感谢了。) + +-------------------------------------------------------------------------------- + +via: http://www.omgubuntu.co.uk/2015/08/ubuntu-nvidia-graphics-drivers-ppa-is-ready-for-action + +作者:[Joey-Elijah Sneddon][a] +译者:[DongShuaike](https://github.com/DongShuaike) +校对:[校对者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/2015/08/ubuntu-easy-install-latest-nvidia-linux-drivers + + + + From 4df5e8680dd705fad61bbe298684e8a24bb46391 Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 16 Aug 2015 10:56:35 +0800 Subject: [PATCH 952/965] PUB:20150816 Ubuntu NVIDIA Graphics Drivers PPA Is Ready For Action MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @DongShuaike 翻译的挺好~加油。 --- ...raphics Drivers PPA Is Ready For Action.md | 66 +++++++++++++++++++ ...raphics Drivers PPA Is Ready For Action.md | 66 ------------------- 2 files changed, 66 insertions(+), 66 deletions(-) create mode 100644 published/20150816 Ubuntu NVIDIA Graphics Drivers PPA Is Ready For Action.md delete mode 100644 translated/news/20150816 Ubuntu NVIDIA Graphics Drivers PPA Is Ready For Action.md diff --git a/published/20150816 Ubuntu NVIDIA Graphics Drivers PPA Is Ready For Action.md b/published/20150816 Ubuntu NVIDIA Graphics Drivers PPA Is Ready For Action.md new file mode 100644 index 0000000000..a310c6be3a --- /dev/null +++ b/published/20150816 Ubuntu NVIDIA Graphics Drivers PPA Is Ready For Action.md @@ -0,0 +1,66 @@ +Ubuntu NVIDIA 显卡驱动 PPA 已经做好准备 +================================================================================ +![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/08/Screen-Shot-2015-08-12-at-14.19.42.png) + +加速你的帧率! + +**嘿,各位,稍安勿躁,很快就好。** + +就在提议开发一个[新的 PPA][1] 来给 Ubuntu 用户们提供最新的 NVIDIA 显卡驱动后不久,ubuntu 社区的人们又集结起来了,就是为了这件事。 + +顾名思义,‘**Graphics Drivers PPA**’ 包含了最新的 NVIDIA Linux 显卡驱动发布,已经打包好可供用户升级使用,没有让人头疼的二进制运行时文件! + +这个 PPA 被设计用来让玩家们尽可能方便地在 Ubuntu 上运行最新款的游戏。 + +#### 万事俱备,只欠东风 #### + +Jorge Castro 开发一个包含 NVIDIA 最新显卡驱动的 PPA 神器的想法得到了 Ubuntu 用户和广大游戏开发者的热烈响应。 + +就连那些致力于将“Steam平台”上的知名大作移植到 Linux 上的人们,也给了不少建议。 + +Edwin Smith,Feral Interactive 公司(‘Shadow of Mordor’) 的产品总监,对于“让用户更方便地更新驱动”的倡议表示非常欣慰。 + +### 如何使用最新的 Nvidia Drivers PPA### + +虽然新的“显卡PPA”已经开发出来,但是现在还远远达不到成熟。开发者们提醒到: + +> “这个 PPA 还处于测试阶段,在你使用它之前最好有一些打包的经验。请大家稍安勿躁,再等几天。” + +将 PPA 试发布给 Ubuntu desktop 邮件列表的 Jorge,也强调说,使用现行的一些 PPA(比如 xorg-edgers)的玩家可能发现不了什么区别(因为现在的驱动只不过是把内容从其他那些现存驱动拷贝过来了) + +“新驱动发布的时候,好戏才会上演呢,”他说。 + +截至写作本文时为止,这个 PPA 囊括了从 Ubuntu 12.04.1 到 15.10 各个版本的 Nvidia 驱动。注意这些驱动对所有的发行版都适用。 + +> **毫无疑问,除非你清楚自己在干些什么,并且知道如果出了问题应该怎么撤销,否则就不要进行下面的操作。** + +新打开一个终端窗口,运行下面的命令加入 PPA: + + sudo add-apt-repository ppa:graphics-drivers/ppa + +安装或更新到最新的 Nvidia 显卡驱动: + + sudo apt-get update && sudo apt-get install nvidia-355 + +记住:如果PPA把你的系统弄崩了,你可得自己去想办法,我们提醒过了哦。(译者注:切记!) + +如果想要撤销对PPA的改变,使用 `ppa-purge` 命令。 + +有什么意见,想法,或者指正,就在下面的评论栏里写下来吧。(我没有 NVIDIA 的硬件来为我自己验证上面的这些东西,如果你可以验证的话,那就太感谢了。) + +-------------------------------------------------------------------------------- + +via: http://www.omgubuntu.co.uk/2015/08/ubuntu-nvidia-graphics-drivers-ppa-is-ready-for-action + +作者:[Joey-Elijah Sneddon][a] +译者:[DongShuaike](https://github.com/DongShuaike) +校对:[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://linux.cn/article-6030-1.html + + + + diff --git a/translated/news/20150816 Ubuntu NVIDIA Graphics Drivers PPA Is Ready For Action.md b/translated/news/20150816 Ubuntu NVIDIA Graphics Drivers PPA Is Ready For Action.md deleted file mode 100644 index 3726a6465a..0000000000 --- a/translated/news/20150816 Ubuntu NVIDIA Graphics Drivers PPA Is Ready For Action.md +++ /dev/null @@ -1,66 +0,0 @@ -Ubuntu NVIDIA显卡驱动PPA已经做好准备 -================================================================================ -![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/08/Screen-Shot-2015-08-12-at-14.19.42.png) - -加速你的帧频! - -**嘿,各位,稍安勿躁,很快就好。** - -就在提议开发一个新的PPA来提供给Ubuntu用户们最新的NVIDIA显卡驱动后不久,ubuntu社区的人们又集结起来了,就是为了这件事。 - -顾名思义,‘**Graphics Drivers PPA**’包含了最新的NVIDIA Linux显卡驱动发行版,打包起来给用户升级用——没有让人头疼的二进制运行时文件! - -PPA被设计用来让家们尽可能方便地在Ubuntu上上运行最新款的游戏。 - -#### 万事俱备,只欠东风 #### - -Jorge Castro开发一个包含NVIDIA最新显卡驱动的PPA神器的想法得到了Ubuntu用户和广大游戏开发者的热烈响应。 - -就连那些致力于将游戏从“Steam平台”移植到Linux的游戏人员,也给了不少建议。 - -Edwin Smith,Feral Interactive公司的生产总监,对于“开发PPA源,让用户更方便地更新驱动”这种原创行为表示非常欣慰。 - -### 如何使用最新的Nvidia Drivers PPA### - -虽然新的“显卡PPA”已经开发出来,但是现在还远远达不到成熟。开发者们提醒到: - ->“这款PPA还处于测试阶段,在你使用它之前最好对打包经验丰富。请大家稍安勿躁,再等几天。” - -将PPA试发布给Ubuntu desktop邮件列表的Jorge,也强调说,使用现行的一些PPA(比如xorg-edgers)的玩家可能发现不了什么区别(因为现在的驱动只不过是把内容从其他那些现存驱动拷贝过来了) - -“新驱动发布的时候,好戏才会上演呢,”他说。 - -截至写作本文时为止,这个PPA囊括了从Ubuntu 12.04.1到 15.10各个版本的Nvidia驱动。注意这些驱动对所有的发行版都适用。 - -> **毫无疑问,除非你清楚自己在干些什么,并且知道如果出了问题应该怎么撤销,否则就不要进行下面的操作。** - -新打开一个终端窗口,运行下面的命令加入PPA: - - sudo add-apt-repository ppa:graphics-drivers/ppa - -安装或更新到最新的Nvidia显卡驱动: - - sudo apt-get update && sudo apt-get install nvidia-355 - -记住:如果PPA把你的系统弄崩了,你可得自己去想办法,我们提醒过了哦。(译者注:切记!) - -如果想要撤销对PPA的改变,使用ppa-purge命令。 - -有什么意见,想法,或者指正,就在下面的评论栏里写下来吧。(我没有NVIDIA的硬件来为我自己验证上面的这些东西,如果你可以验证的话,那就太感谢了。) - --------------------------------------------------------------------------------- - -via: http://www.omgubuntu.co.uk/2015/08/ubuntu-nvidia-graphics-drivers-ppa-is-ready-for-action - -作者:[Joey-Elijah Sneddon][a] -译者:[DongShuaike](https://github.com/DongShuaike) -校对:[校对者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/2015/08/ubuntu-easy-install-latest-nvidia-linux-drivers - - - - From faaf65211719dfa5152015f20cf6780b4a17beec Mon Sep 17 00:00:00 2001 From: XIAOYU <1136299502@qq.com> Date: Sun, 16 Aug 2015 11:43:06 +0800 Subject: [PATCH 953/965] translating by xiaoyu33 translating by xiaoyu33 --- ...0150816 shellinabox--A Web based AJAX Terminal Emulator.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/share/20150816 shellinabox--A Web based AJAX Terminal Emulator.md b/sources/share/20150816 shellinabox--A Web based AJAX Terminal Emulator.md index 002a2ed10f..c6f44a30f5 100644 --- a/sources/share/20150816 shellinabox--A Web based AJAX Terminal Emulator.md +++ b/sources/share/20150816 shellinabox--A Web based AJAX Terminal Emulator.md @@ -1,3 +1,5 @@ +translating by xiaoyu33 + shellinabox – A Web based AJAX Terminal Emulator ================================================================================ ### About shellinabox ### @@ -154,4 +156,4 @@ via: http://www.unixmen.com/shellinabox-a-web-based-ajax-terminal-emulator/ [a]:http://www.unixmen.com/author/sk/ [1]:https://code.google.com/p/shellinabox/wiki/shellinaboxd_man -[2]:https://code.google.com/p/shellinabox/ \ No newline at end of file +[2]:https://code.google.com/p/shellinabox/ From fd32cc53be0833b4a5609b44c75ade3a6b884f73 Mon Sep 17 00:00:00 2001 From: struggling <630441839@qq.com> Date: Sun, 16 Aug 2015 12:58:38 +0800 Subject: [PATCH 954/965] Delete 20150816 How to migrate MySQL to MariaDB on Linux.md --- ...ow to migrate MySQL to MariaDB on Linux.md | 187 ------------------ 1 file changed, 187 deletions(-) delete mode 100644 sources/tech/20150816 How to migrate MySQL to MariaDB on Linux.md diff --git a/sources/tech/20150816 How to migrate MySQL to MariaDB on Linux.md b/sources/tech/20150816 How to migrate MySQL to MariaDB on Linux.md deleted file mode 100644 index 83dfe7b923..0000000000 --- a/sources/tech/20150816 How to migrate MySQL to MariaDB on Linux.md +++ /dev/null @@ -1,187 +0,0 @@ -translation by strugglingyouth -How to migrate MySQL to MariaDB on Linux -================================================================================ -Since the Oracle's acquisition of MySQL, a lot of MySQL developers and users moved away from MySQL due to Oracle's more closed-door stance on MySQL development and maintenance. The community-driven outcome of such movement is a fork of MySQL, called MariaDB. Led by original MySQL developers, the development of MariaDB follows the open-source philosophy and makes sure of [its binary compatibility with MySQL][1]. The Linux distributions such as Red Hat families (Fedora, CentOS, RHEL), Ubuntu and Mint, openSUSE and Debian already started to use and support MariaDB as a drop-in replacement of MySQL. - -If you want to migrate your database from MySQL to MariaDB, this article is what you are looking for. Fortunately, due to their binary compatibility, MySQL-to-MariaDB migration process is pretty much straightforward. If you follow the steps below, the migration from MySQL to MariaDB will most likely be painless. - -### Prepare a MySQL Database and a Table ### - -For demonstration purpose, let's create a test MySQL database and one table in the database before doing the migration. Skip this step if you already have existing MySQL database(s) to migrate to MariaDB. Otherwise proceed as follows. - -Log in into MySQL from a terminal by typing your MySQL root user password. - - $ mysql -u root -p - -Create a database and a table. - - mysql> create database test01; - mysql> use test01; - mysql> create table pet(name varchar(30), owner varchar(30), species varchar(20), sex char(1)); - -Add some records to the table. - - mysql> insert into pet values('brandon','Jack','puddle','m'),('dixie','Danny','chihuahua','f'); - -Then quit the MySQL database. - -### Backup the MySQL Database ### - -The next step is to back up existing MySQL database(s). Use the following mysqldump command to export all existing databases to a file. Before running this command, make sure that binary logging is enabled in your MySQL server. If you don't know how to enable binary logging, see the instructions toward the end of the tutorial. - - $ mysqldump --all-databases --user=root --password --master-data > backupdb.sql - -![](https://farm6.staticflickr.com/5775/20555772385_21b89335e3_b.jpg) - -Now create a backup of my.cnf file somewhere in your system before uninstalling MySQL. This step is optional. - - $ sudo cp /etc/mysql/my.cnf /opt/my.cnf.bak - -### Uninstall MySQL Package ### - -First, you need to stop the MySQL service. - - $ sudo service mysql stop - -or: - - $ sudo systemctl stop mysql - -or: - - $ sudo /etc/init.d/mysql stop - -Then go ahead and remove MySQL packages and configurations as follows. - -On RPM based system (e.g., CentOS, Fedora or RHEL): - - $ sudo yum remove mysql* mysql-server mysql-devel mysql-libs - $ sudo rm -rf /var/lib/mysql - -On Debian based system (e.g., Debian, Ubuntu or Mint): - - $ sudo apt-get remove mysql-server mysql-client mysql-common - $ sudo apt-get autoremove - $ sudo apt-get autoclean - $ sudo deluser mysql - $ sudo rm -rf /var/lib/mysql - -### Install MariaDB Package ### - -The latest CentOS/RHEL 7 and Ubuntu (14.04 or later) contain MariaDB packages in their official repositories. In Fedora, MariaDB has become a replacement of MySQL since version 19. If you are using an old version or LTS type like Ubuntu 13.10 or earlier, you still can install MariaDB by adding its official repository. - -[MariaDB website][2] provide an online tool to help you add MariaDB's official repository according to your Linux distribution. This tool provides steps to add the MariaDB repository for openSUSE, Arch Linux, Mageia, Fedora, CentOS, RedHat, Mint, Ubuntu, and Debian. - -![](https://farm6.staticflickr.com/5809/20367745260_073020b910_c.jpg) - -As an example, let's use the Ubuntu 14.04 distribution and CentOS 7 to configure the MariaDB repository. - -**Ubuntu 14.04** - - $ sudo apt-get install software-properties-common - $ sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xcbcb082a1bb943db - $ sudo add-apt-repository 'deb http://mirror.mephi.ru/mariadb/repo/5.5/ubuntu trusty main' - $ sudo apt-get update - $ sudo apt-get install mariadb-server - -**CentOS 7** - -Create a custom yum repository file for MariaDB as follows. - - $ sudo vi /etc/yum.repos.d/MariaDB.repo - ----------- - - [mariadb] - name = MariaDB - baseurl = http://yum.mariadb.org/5.5/centos7-amd64 - gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB - gpgcheck=1 - ----------- - - $ sudo yum install MariaDB-server MariaDB-client - -After all necessary packages are installed, you may be asked to type a new password for root user account. After setting the root password, don't forget to recover my.cnf backup file. - - $ sudo cp /opt/my.cnf /etc/mysql/ - -Now start MariaDB service as follows. - - $ sudo service mariadb start - -or: - - $ sudo systemctl start mariadb - -or: - - $ sudo /etc/init.d/mariadb start - -### Importing MySQL Database(s) ### - -Finally, we have to import the previously exported database(s) back to MariaDB server as follows. - - $ mysql -u root -p < backupdb.sql - -Enter your MariaDB's root password, and the database import process will start. When the import process is finished, it will return to a command prompt. - -To check whether or not the import process is completed successfully, log in into MariaDB server and perform some sample queries. - - $ mysql -u root -p - ----------- - - MariaDB [(none)]> show databases; - MariaDB [(none)]> use test01; - MariaDB [test01]> select * from pet; - -![](https://farm6.staticflickr.com/5820/20562243721_428a9a12a7_b.jpg) - -### Conclusion ### - -As you can see in this tutorial, MySQL-to-MariaDB migration is not difficult. MariaDB has a lot of new features than MySQL, that you should know about. As far as configuration is concerned, in my test case, I simply used my old MySQL configuration file (my.cnf) as a MariaDB configuration file, and the import process was completed fine without any issue. My suggestion for the configuration is that you read the documentation on MariaDB configuration options carefully before the migration, especially if you are using specific MySQL configurations. - -If you are running more complex setup with tons of tables and databases including clustering or master-slave replication, take a look at the [more detailed guide][3] by the Mozilla IT and Operations team, or the [official MariaDB documentation][4]. - -### Troubleshooting ### - -1. While running mysqldump command to back up databases, you are getting the following error. - - $ mysqldump --all-databases --user=root --password --master-data > backupdb.sql - ----------- - - mysqldump: Error: Binlogging on server not active - -By using "--master-data", you are trying to include binary log information in the exported output, which is useful for database replication and recovery. However, binary logging is not enabled in MySQL server. To fix this error, modify your my.cnf file, and add the following option under [mysqld] section. - - log-bin=mysql-bin - -Save my.cnf file, and restart the MySQL service: - - $ sudo service mysql restart - -or: - - $ sudo systemctl restart mysql - -or: - - $ sudo /etc/init.d/mysql restart - --------------------------------------------------------------------------------- - -via: http://xmodulo.com/migrate-mysql-to-mariadb-linux.html - -作者:[Kristophorus Hadiono][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/kristophorus -[1]:https://mariadb.com/kb/en/mariadb/mariadb-vs-mysql-compatibility/ -[2]:https://downloads.mariadb.org/mariadb/repositories/#mirror=aasaam -[3]:https://blog.mozilla.org/it/2013/12/16/upgrading-from-mysql-5-1-to-mariadb-5-5/ -[4]:https://mariadb.com/kb/en/mariadb/documentation/ From bd1a96a2eb86a075400dec864a6501f8e943bcab Mon Sep 17 00:00:00 2001 From: struggling <630441839@qq.com> Date: Sun, 16 Aug 2015 12:59:52 +0800 Subject: [PATCH 955/965] Create 20150816 How to migrate MySQL to MariaDB on Linux.md --- ...ow to migrate MySQL to MariaDB on Linux.md | 188 ++++++++++++++++++ 1 file changed, 188 insertions(+) create mode 100644 translated/tech/20150816 How to migrate MySQL to MariaDB on Linux.md diff --git a/translated/tech/20150816 How to migrate MySQL to MariaDB on Linux.md b/translated/tech/20150816 How to migrate MySQL to MariaDB on Linux.md new file mode 100644 index 0000000000..70856ec874 --- /dev/null +++ b/translated/tech/20150816 How to migrate MySQL to MariaDB on Linux.md @@ -0,0 +1,188 @@ + +在 Linux 中怎样将 MySQL 迁移到 MariaDB 上 +================================================================================ + +自从甲骨文收购 MySQL 后,很多 MySQL 的开发者和用户放弃了 MySQL 由于甲骨文对 MySQL 的开发和维护更多倾向于闭门的立场。在社区驱动下,促使更多人移到 MySQL 的另一个分支中,叫 MariaDB。在原有 MySQL 开发人员的带领下,MariaDB 的开发遵循开源的理念,并确保 [它的二进制格式与 MySQL 兼容][1]。Linux 发行版如 Red Hat 家族(Fedora,CentOS,RHEL),Ubuntu 和Mint,openSUSE 和 Debian 已经开始使用,并支持 MariaDB 作为 MySQL 的简易替换品。 + +如果想要将 MySQL 中的数据库迁移到 MariaDB 中,这篇文章就是你所期待的。幸运的是,由于他们的二进制兼容性,MySQL-to-MariaDB 迁移过程是非常简单的。如果你按照下面的步骤,将 MySQL 迁移到 MariaDB 会是无痛的。 + +### 准备 MySQL 数据库和表 ### + +出于演示的目的,我们在做迁移之前在数据库中创建一个测试的 MySQL 数据库和表。如果你在 MySQL 中已经有了要迁移到 MariaDB 的数据库,跳过此步骤。否则,按以下步骤操作。 + +在终端输入 root 密码登录到 MySQL 。 + + $ mysql -u root -p + +创建一个数据库和表。 + + mysql> create database test01; + mysql> use test01; + mysql> create table pet(name varchar(30), owner varchar(30), species varchar(20), sex char(1)); + +在表中添加一些数据。 + + mysql> insert into pet values('brandon','Jack','puddle','m'),('dixie','Danny','chihuahua','f'); + +退出 MySQL 数据库. + +### 备份 MySQL 数据库 ### + +下一步是备份现有的 MySQL 数据库。使用下面的 mysqldump 命令导出现有的数据库到文件中。运行此命令之前,请确保你的 MySQL 服务器上启用了二进制日志。如果你不知道如何启用二进制日志,请参阅结尾的教程说明。 + + $ mysqldump --all-databases --user=root --password --master-data > backupdb.sql + +![](https://farm6.staticflickr.com/5775/20555772385_21b89335e3_b.jpg) + +现在,在卸载 MySQL 之前先在系统上备份 my.cnf 文件。此步是可选的。 + + $ sudo cp /etc/mysql/my.cnf /opt/my.cnf.bak + +### 卸载 MySQL ### + +首先,停止 MySQL 服务。 + + $ sudo service mysql stop + +或者: + + $ sudo systemctl stop mysql + +或: + + $ sudo /etc/init.d/mysql stop + +然后继续下一步,使用以下命令移除 MySQL 和配置文件。 + +在基于 RPM 的系统上 (例如, CentOS, Fedora 或 RHEL): + + $ sudo yum remove mysql* mysql-server mysql-devel mysql-libs + $ sudo rm -rf /var/lib/mysql + +在基于 Debian 的系统上(例如, Debian, Ubuntu 或 Mint): + + $ sudo apt-get remove mysql-server mysql-client mysql-common + $ sudo apt-get autoremove + $ sudo apt-get autoclean + $ sudo deluser mysql + $ sudo rm -rf /var/lib/mysql + +### 安装 MariaDB ### + +在 CentOS/RHEL 7和Ubuntu(14.04或更高版本)上,最新的 MariaDB 包含在其官方源。在 Fedora 上,自19版本后 MariaDB 已经替代了 MySQL。如果你使用的是旧版本或 LTS 类型如 Ubuntu 13.10 或更早的,你仍然可以通过添加其官方仓库来安装 MariaDB。 + +[MariaDB 网站][2] 提供了一个在线工具帮助你依据你的 Linux 发行版中来添加 MariaDB 的官方仓库。此工具为 openSUSE, Arch Linux, Mageia, Fedora, CentOS, RedHat, Mint, Ubuntu, 和 Debian 提供了 MariaDB 的官方仓库. + +![](https://farm6.staticflickr.com/5809/20367745260_073020b910_c.jpg) + +下面例子中,我们使用 Ubuntu 14.04 发行版和 CentOS 7 配置 MariaDB 库。 + +**Ubuntu 14.04** + + $ sudo apt-get install software-properties-common + $ sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xcbcb082a1bb943db + $ sudo add-apt-repository 'deb http://mirror.mephi.ru/mariadb/repo/5.5/ubuntu trusty main' + $ sudo apt-get update + $ sudo apt-get install mariadb-server + +**CentOS 7** + +以下为 MariaDB 创建一个自定义的 yum 仓库文件。 + + $ sudo vi /etc/yum.repos.d/MariaDB.repo + +---------- + + [mariadb] + name = MariaDB + baseurl = http://yum.mariadb.org/5.5/centos7-amd64 + gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB + gpgcheck=1 + +---------- + + $ sudo yum install MariaDB-server MariaDB-client + +安装了所有必要的软件包后,你可能会被要求为 root 用户创建一个新密码。设置 root 的密码后,别忘了恢复备份的 my.cnf 文件。 + + $ sudo cp /opt/my.cnf /etc/mysql/ + +现在启动 MariaDB 服务。 + + $ sudo service mariadb start + +或者: + + $ sudo systemctl start mariadb + +或: + + $ sudo /etc/init.d/mariadb start + +### 导入 MySQL 的数据库 ### + +最后,我们将以前导出的数据库导入到 MariaDB 服务器中。 + + $ mysql -u root -p < backupdb.sql + +输入你 MariaDB 的 root 密码,数据库导入过程将开始。导入过程完成后,将返回到命令提示符下。 + +要检查导入过程是否完全成功,请登录到 MariaDB 服务器,并查看一些样本来检查。 + + $ mysql -u root -p + +---------- + + MariaDB [(none)]> show databases; + MariaDB [(none)]> use test01; + MariaDB [test01]> select * from pet; + +![](https://farm6.staticflickr.com/5820/20562243721_428a9a12a7_b.jpg) + +### 结论 ### + +如你在本教程中看到的,MySQL-to-MariaDB 的迁移并不难。MariaDB 相比 MySQL 有很多新的功能,你应该知道的。至于配置方面,在我的测试情况下,我只是将我旧的 MySQL 配置文件(my.cnf)作为 MariaDB 的配置文件,导入过程完全没有出现任何问题。对于配置文件,我建议你在迁移之前请仔细阅读MariaDB 配置选项的文件,特别是如果你正在使用 MySQL 的特殊配置。 + +如果你正在运行更复杂的配置有海量的数据库和表,包括群集或主从复制,看一看 Mozilla IT 和 Operations 团队的 [更详细的指南][3] ,或者 [官方的 MariaDB 文档][4]。 + +### 故障排除 ### + +1.在运行 mysqldump 命令备份数据库时出现以下错误。 + + $ mysqldump --all-databases --user=root --password --master-data > backupdb.sql + +---------- + + mysqldump: Error: Binlogging on server not active + +通过使用 "--master-data",你要在导出的输出中包含二进制日志信息,这对于数据库的复制和恢复是有用的。但是,二进制日志未在 MySQL 服务器启用。要解决这个错误,修改 my.cnf 文件,并在 [mysqld] 部分添加下面的选项。 + + log-bin=mysql-bin + +保存 my.cnf 文件,并重新启动 MySQL 服务: + + $ sudo service mysql restart + +或者: + + $ sudo systemctl restart mysql + +或: + + $ sudo /etc/init.d/mysql restart + +-------------------------------------------------------------------------------- + +via: http://xmodulo.com/migrate-mysql-to-mariadb-linux.html + +作者:[Kristophorus Hadiono][a] +译者:[strugglingyouth](https://github.com/译者ID) +校对:[strugglingyouth](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://xmodulo.com/author/kristophorus +[1]:https://mariadb.com/kb/en/mariadb/mariadb-vs-mysql-compatibility/ +[2]:https://downloads.mariadb.org/mariadb/repositories/#mirror=aasaam +[3]:https://blog.mozilla.org/it/2013/12/16/upgrading-from-mysql-5-1-to-mariadb-5-5/ +[4]:https://mariadb.com/kb/en/mariadb/documentation/ From 686b2855ac1c72f760ac469f12728e08e1f216a2 Mon Sep 17 00:00:00 2001 From: XIAOYU <1136299502@qq.com> Date: Sun, 16 Aug 2015 13:55:13 +0800 Subject: [PATCH 956/965] translated shellinabox--A Web based AJAX translated shellinabox--A Web based AJAX Terminal Emulator --- ...box--A Web based AJAX Terminal Emulator.md | 159 ------------------ ...box--A Web based AJAX Terminal Emulator.md | 157 +++++++++++++++++ 2 files changed, 157 insertions(+), 159 deletions(-) delete mode 100644 sources/share/20150816 shellinabox--A Web based AJAX Terminal Emulator.md create mode 100644 translated/share/20150816 shellinabox--A Web based AJAX Terminal Emulator.md diff --git a/sources/share/20150816 shellinabox--A Web based AJAX Terminal Emulator.md b/sources/share/20150816 shellinabox--A Web based AJAX Terminal Emulator.md deleted file mode 100644 index c6f44a30f5..0000000000 --- a/sources/share/20150816 shellinabox--A Web based AJAX Terminal Emulator.md +++ /dev/null @@ -1,159 +0,0 @@ -translating by xiaoyu33 - -shellinabox – A Web based AJAX Terminal Emulator -================================================================================ -### About shellinabox ### - -Greetings Unixmen readers! - -We, usually, access any remote servers using well known communication tools like OpenSSH, and Putty etc. But, one important thing is we can’t access the remote systems using those tools behind a Firewall or the firewalls that allow only HTTPS traffic. No worries! We, still, have some options to access your remote systems even if you’re behind a firewall. And also, you don’t need to install any communications tools like OpenSSH or Putty. All you need is only a modern JavaScript and CSS enabled browser. And you don’t need to install any plugins or third party softwares either. - -Meet **Shell In A Box**, pronounced as **shellinabox**, a free, open source, web based AJAX Terminal emulator developed by **Markus Gutschke**. It uses AJAX technology to provide the look and feel of a native shell via a web browser. The **shellinaboxd** daemon implements a webserver that listens on the specified port. The web server publishes one or more services that will be displayed in a VT100 emulator implemented as an AJAX web application. By default, the port is 4200. You can change the default port to any random port number of your choice. After installing shellinabox on all your remote servers that you want to access them from your local system, open up the web browser and navigate to: **http://IP-Address:4200/**. Enter your user name and password and start using your remote system’s shell. Seems interesting, isn’t it? Indeed! - -**Disclaimer**: - -Shellinabox is not a ssh client or any sort of security software. It is just a application that emulates a remote system’s shell via a web browser. Also, It has nothing to do with SSH in anyway. It’s not a bullet proof security way to remote your systems. It is just one of the easiest methods so far. You should not run it on any public network for any reason. - -### Install shellinabox ### - -#### In Debian/Ubuntu based systems: #### - -shellinabox is available in the default repositories. So, you can install it using command: - - $ sudo apt-get install shellinabox - -#### In RHEL/CentOS systems: #### - -First, install EPEL repository using command: - - # yum install epel-release - -Then, install shellinabox using command: - - # yum install shellinabox - -Done! - -### Configure shellinabox ### - -As I mentioned before, shellinabox listens on port **4200** by default. You can change this port to any random number of your choice to make it difficult to guess by anyone. - -The shellinabox config file is located in **/etc/default/shellinabox** file by default in Debian/Ubuntu systems. In RHEL/CentOS/Fedora, the default location of config file is **/etc/sysconfig/shellinaboxd**. - -If you want to change the default port, - -In Debian/Ubuntu: - - $ sudo vi /etc/default/shellinabox - -In RHEL/CentOS/Fedora: - - # vi /etc/sysconfig/shellinaboxd - -Change your port to any random number. Since I am testing it on my local network, I use the default values. - - # Shell in a box daemon configuration - # For details see shellinaboxd man page - - # Basic options - USER=shellinabox - GROUP=shellinabox - CERTDIR=/var/lib/shellinabox - PORT=4200 - OPTS="--disable-ssl-menu -s /:LOGIN" - - # Additional examples with custom options: - - # Fancy configuration with right-click menu choice for black-on-white: - # OPTS="--user-css Normal:+black-on-white.css,Reverse:-white-on-black.css --disable-ssl-menu -s /:LOGIN" - - # Simple configuration for running it as an SSH console with SSL disabled: - # OPTS="-t -s /:SSH:host.example.com" - -Restart shelinabox service. - -**In Debian/Ubuntu:** - - $ sudo systemctl restart shellinabox - -Or - - $ sudo service shellinabox restart - -In RHEL/CentOS systems run the following command to start shellinaboxd service automatically on every reboot. - - # systemctl enable shellinaboxd - -Or - - # chkconfig shellinaboxd on - -Remember to open up port **4200** or any port that you assign if you are running a firewall. - -For example, in RHEL/CentOS systems, you can allow the port as shown below. - - # firewall-cmd --permanent --add-port=4200/tcp - ----------- - - # firewall-cmd --reload - -### Usage ### - -Now, go to your client systems, open up the web browser and navigate to: **https://ip-address-of-remote-servers:4200**. - -**Note**: Mention the correct port if you have changed it. - -You’ll get a warning message of certificate issue. Accept the certificate and go on. - -![Privacy error - Google Chrome_001](http://www.unixmen.com/wp-content/uploads/2015/08/Privacy-error-Google-Chrome_001.jpg) - -Enter your remote system’s username and password. Now, you’ll be able to access the remote system’s shell right from the browser itself. - -![Shell In A Box - Google Chrome_003](http://www.unixmen.com/wp-content/uploads/2015/08/sk@server1-Shell-In-A-Box-Google-Chrome_003.jpg) - -You can get some additional menu options which might be useful by right clicking on the empty space of your browser. - -![Shell In A Box - Google Chrome_004](http://www.unixmen.com/wp-content/uploads/2015/08/sk@server1-Shell-In-A-Box-Google-Chrome_004.jpg) - -From now on, you can do whatever you want to do in your remote server from the local system’s web browser. - -Once you done, type **exit** in the shell. - -To connect again to the remote system, click the **Connect** button and then type the user name and password of your remote server. - -![Shell In A Box - Google Chrome_005](http://www.unixmen.com/wp-content/uploads/2015/08/sk@server1-Shell-In-A-Box-Google-Chrome_005.jpg) - -For more details about shellinabox, type the following command in your Terminal: - - # man shellinabox - -Or - - # shellinaboxd -help - -Also, refer the [shellinabox wiki page][1] for comprehensive usage details. - -### Conclusion ### - -Like I mentioned before, web-based SSH tools are very useful if you’re running servers behind a Firewall. There are many web-based ssh tools, but Shellinabox is pretty simple and useful tool to emulate a remote system’s shell from anywhere in your network. Since, it is browser based, you can access your remote server from any device as long as you have a JavaScript and CSS enabled browser. - -That’s all for now. Have a good day! - -#### Reference link: #### - -- [shellinabox website][2] - --------------------------------------------------------------------------------- - -via: http://www.unixmen.com/shellinabox-a-web-based-ajax-terminal-emulator/ - -作者:[SK][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://www.unixmen.com/author/sk/ -[1]:https://code.google.com/p/shellinabox/wiki/shellinaboxd_man -[2]:https://code.google.com/p/shellinabox/ diff --git a/translated/share/20150816 shellinabox--A Web based AJAX Terminal Emulator.md b/translated/share/20150816 shellinabox--A Web based AJAX Terminal Emulator.md new file mode 100644 index 0000000000..71acf990c1 --- /dev/null +++ b/translated/share/20150816 shellinabox--A Web based AJAX Terminal Emulator.md @@ -0,0 +1,157 @@ +shellinabox–基于Web的Ajax的终端模拟器安装及使用详解 +================================================================================ +### shellinabox简介 ### + +unixmen的读者朋友们,你们好! + +通常情况下,我们访问任何远程服务器时,使用常见的通信工具如OpenSSH和Putty等。但是如果我们在防火墙外,或者防火墙只允许HTTPS流量才能通过,那么我们就不能再使用这些工具来访问远程系统了。不用担心!即使你在防火墙后面,我们依然有办法来访问你的远程系统。而且,你不需要安装任何类似于OpenSSH或Putty的通讯工具。你只需要有一个支持JavaScript和CSS的现代浏览器。并且你不用安装任何插件或第三方应用软件。 + +Meet **Shell In A Box**,发音是**shellinabox**,是由**Markus Gutschke**开发的一款免费的,开源的,基于Web的Ajax的终端模拟器。它使用AJAX技术,通过Web浏览器提供的外观和感觉像一个原生壳。该**shellinaboxd**的守护进程实现了一个Web服务器,能够侦听指定的端口。Web服务器发布一个或多个服务,这些服务将在VT100模拟器实现为一个AJAX的Web应用程序显示。默认情况下,端口为4200。你可以更改默认端口到任意选择的任意端口号。在你的远程服务器安装shellinabox以后,如果你想从本地系统接入,打开Web浏览器并导航到:**http://IP-Address:4200/**。输入你的用户名和密码,然后就可以开始使用你远程系统的外壳。看起来很有趣,不是吗?确实! + +**免责声明**: + +shellinabox不是SSH客户端或任何安全软件。它仅仅是一个应用程序,能够通过Web浏览器模拟一个远程系统的壳。同时,它和SSH没有任何关系。这不是防弹的安全的方式来远程控制您的系统。这只是迄今为止最简单的方法之一。无论什么原因,你都不应该在任何公共网络上运行它。 + +### 安装shellinabox ### + +#### 在Debian / Ubuntu系统上: #### + +shellinabox在默认库是可用的。所以,你可以使用命令来安装它: + + $ sudo apt-get install shellinabox + +#### 在RHEL / CentOS系统上: #### + +首先,使用命令安装EPEL仓库: + + # yum install epel-release + +然后,使用命令安装shellinabox: + + # yum install shellinabox + +完成! + +### 配置shellinabox ### + +正如我之前提到的,shellinabox侦听端口默认为**4200**。你可以将此端口更改为任意数字,以防别人猜到。 + +在Debian/Ubuntu系统上shellinabox配置文件的默认位置是**/etc/default/shellinabox**。在RHEL/CentOS/Fedora上,默认位置在**/etc/sysconfig/shellinaboxd**。 + +如果要更改默认端口, + +在Debian / Ubuntu: + + $ sudo vi /etc/default/shellinabox + +在RHEL / CentOS / Fedora: + + # vi /etc/sysconfig/shellinaboxd + +更改你的端口到任意数量。因为我在本地网络上测试它,所以我使用默认值。 + + # Shell in a box daemon configuration + # For details see shellinaboxd man page + + # Basic options + USER=shellinabox + GROUP=shellinabox + CERTDIR=/var/lib/shellinabox + PORT=4200 + OPTS="--disable-ssl-menu -s /:LOGIN" + + # Additional examples with custom options: + + # Fancy configuration with right-click menu choice for black-on-white: + # OPTS="--user-css Normal:+black-on-white.css,Reverse:-white-on-black.css --disable-ssl-menu -s /:LOGIN" + + # Simple configuration for running it as an SSH console with SSL disabled: + # OPTS="-t -s /:SSH:host.example.com" + +重启shelinabox服务。 + +**在Debian/Ubuntu:** + + $ sudo systemctl restart shellinabox + +或者 + + $ sudo service shellinabox restart + +在RHEL/CentOS系统,运行下面的命令能在每次重启时自动启动shellinaboxd服务 + + # systemctl enable shellinaboxd + +或者 + + # chkconfig shellinaboxd on + +如果你正在运行一个防火墙,记得要打开端口**4200**或任何你指定的端口。 + +例如,在RHEL/CentOS系统,你可以如下图所示允许端口。 + + # firewall-cmd --permanent --add-port=4200/tcp + +---------- + + # firewall-cmd --reload + +### 使用 ### + +现在,去你的客户端系统,打开Web浏览器并导航到:**https://ip-address-of-remote-servers:4200**。 + +**注意**:如果你改变了端口,请填写修改后的端口。 + +你会得到一个证书问题的警告信息。接受该证书并继续。 + +![Privacy error - Google Chrome_001](http://www.unixmen.com/wp-content/uploads/2015/08/Privacy-error-Google-Chrome_001.jpg) + +输入远程系统的用户名和密码。现在,您就能够从浏览器本身访问远程系统的外壳。 + +![Shell In A Box - Google Chrome_003](http://www.unixmen.com/wp-content/uploads/2015/08/sk@server1-Shell-In-A-Box-Google-Chrome_003.jpg) + +右键点击你浏览器的空白位置。你可以得到一些有很有用的额外的菜单选项。 + +![Shell In A Box - Google Chrome_004](http://www.unixmen.com/wp-content/uploads/2015/08/sk@server1-Shell-In-A-Box-Google-Chrome_004.jpg) + +从现在开始,你可以通过本地系统的Web浏览器在你的远程服务器随意操作。 + +当你完成时,记得点击**退出**。 + +当再次连接到远程系统时,单击**连接**按钮,然后输入远程服务器的用户名和密码。 + +![Shell In A Box - Google Chrome_005](http://www.unixmen.com/wp-content/uploads/2015/08/sk@server1-Shell-In-A-Box-Google-Chrome_005.jpg) + +如果想了解shellinabox更多细节,在你的终端键入下面的命令: + + # man shellinabox + +或者 + + # shellinaboxd -help + +同时,参考[shellinabox 在wiki页面的介绍][1],来了解shellinabox的综合使用细节。 + +### 结论 ### + +正如我之前提到的,如果你在服务器运行在防火墙后面,那么基于web的SSH工具是非常有用的。有许多基于web的SSH工具,但shellinabox是非常简单并且有用的工具,能从的网络上的任何地方,模拟一个远程系统的壳。因为它是基于浏览器的,所以你可以从任何设备访问您的远程服务器,只要你有一个支持JavaScript和CSS的浏览器。 + +就这些啦。祝你今天有个好心情! + +#### 参考链接: #### + +- [shellinabox website][2] + +-------------------------------------------------------------------------------- + +via: http://www.unixmen.com/shellinabox-a-web-based-ajax-terminal-emulator/ + +作者:[SK][a] +译者:[xiaoyu33](https://github.com/xiaoyu33) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://www.unixmen.com/author/sk/ +[1]:https://code.google.com/p/shellinabox/wiki/shellinaboxd_man +[2]:https://code.google.com/p/shellinabox/ From a545ebe14d5e8611fdcc905db5296ed53a2a4c97 Mon Sep 17 00:00:00 2001 From: ictlyh Date: Sun, 16 Aug 2015 16:37:23 +0800 Subject: [PATCH 957/965] [Translating] tech/RHCE/Part 4 - Using Shell Scripting to Automate Linux System Maintenance Tasks.md --- ...Shell Scripting to Automate Linux System Maintenance Tasks.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/RHCE/Part 4 - Using Shell Scripting to Automate Linux System Maintenance Tasks.md b/sources/tech/RHCE/Part 4 - Using Shell Scripting to Automate Linux System Maintenance Tasks.md index bcd058611a..6b534423e7 100644 --- a/sources/tech/RHCE/Part 4 - Using Shell Scripting to Automate Linux System Maintenance Tasks.md +++ b/sources/tech/RHCE/Part 4 - Using Shell Scripting to Automate Linux System Maintenance Tasks.md @@ -1,3 +1,4 @@ +ictlyh Translating Part 4 - Using Shell Scripting to Automate Linux System Maintenance Tasks ================================================================================ Some time ago I read that one of the distinguishing characteristics of an effective system administrator / engineer is laziness. It seemed a little contradictory at first but the author then proceeded to explain why: From ef473497499f650a03962097e990cb74babe2f27 Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 16 Aug 2015 18:49:19 +0800 Subject: [PATCH 958/965] PUB:20150806 Linux FAQs with Answers--How to fix 'ImportError--No module named wxversion' on Linux @GOLinux --- ...mportError--No module named wxversion' on Linux.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) rename {translated/tech => published}/20150806 Linux FAQs with Answers--How to fix 'ImportError--No module named wxversion' on Linux.md (75%) diff --git a/translated/tech/20150806 Linux FAQs with Answers--How to fix 'ImportError--No module named wxversion' on Linux.md b/published/20150806 Linux FAQs with Answers--How to fix 'ImportError--No module named wxversion' on Linux.md similarity index 75% rename from translated/tech/20150806 Linux FAQs with Answers--How to fix 'ImportError--No module named wxversion' on Linux.md rename to published/20150806 Linux FAQs with Answers--How to fix 'ImportError--No module named wxversion' on Linux.md index 2a937daeff..4b3eaf0aa0 100644 --- a/translated/tech/20150806 Linux FAQs with Answers--How to fix 'ImportError--No module named wxversion' on Linux.md +++ b/published/20150806 Linux FAQs with Answers--How to fix 'ImportError--No module named wxversion' on Linux.md @@ -1,7 +1,7 @@ -Linux有问必答——如何修复Linux上的“ImportError: No module named wxversion”错误 +Linux有问必答:如何修复“ImportError: No module named wxversion”错误 ================================================================================ -> **问题** 我试着在[你的Linux发行版]上运行一个Python应用,但是我得到了这个错误"ImportError: No module named wxversion."。我怎样才能解决Python程序中的这个错误呢? +> **问题** 我试着在[某某 Linux 发行版]上运行一个 Python 应用,但是我得到了这个错误“ImportError: No module named wxversion.”。我怎样才能解决 Python 程序中的这个错误呢? Looking for python... 2.7.9 - Traceback (most recent call last): File "/home/dev/playonlinux/python/check_python.py", line 1, in @@ -10,7 +10,8 @@ Linux有问必答——如何修复Linux上的“ImportError: No module named wx failed tests 该错误表明,你的Python应用是基于GUI的,依赖于一个名为wxPython的缺失模块。[wxPython][1]是一个用于wxWidgets GUI库的Python扩展模块,普遍被C++程序员用来设计GUI应用。该wxPython扩展允许Python开发者在任何Python应用中方便地设计和整合GUI。 -To solve this import error, you need to install wxPython on your Linux, as described below. + +摇解决这个 import 错误,你需要在你的 Linux 上安装 wxPython,如下: ### 安装wxPython到Debian,Ubuntu或Linux Mint ### @@ -40,10 +41,10 @@ via: http://ask.xmodulo.com/importerror-no-module-named-wxversion.html 作者:[Dan Nanni][a] 译者:[GOLinux](https://github.com/GOLinux) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 [a]:http://ask.xmodulo.com/author/nanni [1]:http://wxpython.org/ -[2]:http://xmodulo.com/how-to-set-up-epel-repository-on-centos.html +[2]:https://linux.cn/article-2324-1.html From 3b29580b83bb95018b748cea58036b45882bc9cc Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 16 Aug 2015 19:07:46 +0800 Subject: [PATCH 959/965] PUB:20150728 Tips to Create ISO from CD, Watch User Activity and Check Memory Usages of Browser @strugglingyouth --- ...vity and Check Memory Usages of Browser.md | 57 +++++++++++-------- 1 file changed, 32 insertions(+), 25 deletions(-) rename {translated/tech => published}/20150728 Tips to Create ISO from CD, Watch User Activity and Check Memory Usages of Browser.md (72%) diff --git a/translated/tech/20150728 Tips to Create ISO from CD, Watch User Activity and Check Memory Usages of Browser.md b/published/20150728 Tips to Create ISO from CD, Watch User Activity and Check Memory Usages of Browser.md similarity index 72% rename from translated/tech/20150728 Tips to Create ISO from CD, Watch User Activity and Check Memory Usages of Browser.md rename to published/20150728 Tips to Create ISO from CD, Watch User Activity and Check Memory Usages of Browser.md index 02805f62ff..97dd874c43 100644 --- a/translated/tech/20150728 Tips to Create ISO from CD, Watch User Activity and Check Memory Usages of Browser.md +++ b/published/20150728 Tips to Create ISO from CD, Watch User Activity and Check Memory Usages of Browser.md @@ -1,47 +1,52 @@ - -用 CD 创建 ISO,观察用户活动和检查浏览器内存的技巧 +一些 Linux 小技巧 ================================================================================ 我已经写过 [Linux 提示和技巧][1] 系列的一篇文章。写这篇文章的目的是让你知道这些小技巧可以有效地管理你的系统/服务器。 ![Create Cdrom ISO Image and Monitor Users in Linux](http://www.tecmint.com/wp-content/uploads/2015/07/creating-cdrom-iso-watch-users-in-linux.jpg) -在Linux中创建 Cdrom ISO 镜像和监控用户 +*在Linux中创建 Cdrom ISO 镜像和监控用户* -在这篇文章中,我们将看到如何使用 CD/DVD 驱动器中加载到的内容来创建 ISO 镜像,打开随机手册页学习,看到登录用户的详细情况和查看浏览器内存使用量,而所有这些完全使用本地工具/命令无任何第三方应用程序/组件。让我们开始吧... +在这篇文章中,我们将看到如何使用 CD/DVD 驱动器中载入的碟片来创建 ISO 镜像;打开随机手册页学习;看到登录用户的详细情况和查看浏览器内存使用量,而所有这些完全使用本地工具/命令,无需任何第三方应用程序/组件。让我们开始吧…… -### 用 CD 中创建 ISO 映像 ### +### 用 CD 碟片创建 ISO 映像 ### 我们经常需要备份/复制 CD/DVD 的内容。如果你是在 Linux 平台上,不需要任何额外的软件。所有需要的是进入 Linux 终端。 要从 CD/DVD 上创建 ISO 镜像,你需要做两件事。第一件事就是需要找到CD/DVD 驱动器的名称。要找到 CD/DVD 驱动器的名称,可以使用以下三种方法。 -**1. 从终端/控制台上运行 lsblk 命令(单个驱动器).** +**1. 从终端/控制台上运行 lsblk 命令(列出块设备)** $ lsblk ![Find Block Devices in Linux](http://www.tecmint.com/wp-content/uploads/2015/07/Find-Block-Devices.png) -找驱动器 +*找块设备* -**2.要查看有关 CD-ROM 的信息,可以使用以下命令。** +从上图可以看到,sr0 就是你的 cdrom (即 /dev/sr0 )。 + +**2. 要查看有关 CD-ROM 的信息,可以使用以下命令** $ less /proc/sys/dev/cdrom/info ![Check Cdrom Information](http://www.tecmint.com/wp-content/uploads/2015/07/Check-Cdrom-Inforamtion.png) -检查 Cdrom 信息 +*检查 Cdrom 信息* + +从上图可以看到, 设备名称是 sr0 (即 /dev/sr0)。 **3. 使用 [dmesg 命令][2] 也会得到相同的信息,并使用 egrep 来自定义输出。** -命令 ‘dmesg‘ 命令的输出/控制内核缓冲区信息。‘egrep‘ 命令输出匹配到的行。选项 -i 和 -color 与 egrep 连用时会忽略大小写,并高亮显示匹配的字符串。 +命令 ‘dmesg‘ 命令的输出/控制内核缓冲区信息。‘egrep‘ 命令输出匹配到的行。egrep 使用选项 -i 和 -color 时会忽略大小写,并高亮显示匹配的字符串。 $ dmesg | egrep -i --color 'cdrom|dvd|cd/rw|writer' ![Find Device Information](http://www.tecmint.com/wp-content/uploads/2015/07/Find-Device-Information.png) -查找设备信息 +*查找设备信息* -一旦知道 CD/DVD 的名称后,在 Linux 上你可以用下面的命令来创建 ISO 镜像。 +从上图可以看到,设备名称是 sr0 (即 /dev/sr0)。 + +一旦知道 CD/DVD 的名称后,在 Linux 上你可以用下面的命令来创建 ISO 镜像(你看,只需要 cat 即可!)。 $ cat /dev/sr0 > /path/to/output/folder/iso_name.iso @@ -49,11 +54,11 @@ ![Create ISO Image of CDROM in Linux](http://www.tecmint.com/wp-content/uploads/2015/07/Create-ISO-Image-of-CDROM.png) -创建 CDROM 的 ISO 映像 +*创建 CDROM 的 ISO 映像* ### 随机打开一个手册页 ### -如果你是 Linux 新人并想学习使用命令行开关,这个修改是为你做的。把下面的代码行添加在`〜/ .bashrc`文件的末尾。 +如果你是 Linux 新人并想学习使用命令行开关,这个技巧就是给你的。把下面的代码行添加在`〜/ .bashrc`文件的末尾。 /use/bin/man $(ls /bin | shuf | head -1) @@ -63,17 +68,19 @@ ![LoadKeys Man Pages](http://www.tecmint.com/wp-content/uploads/2015/07/LoadKeys-Man-Pages.png) -LoadKeys 手册页 +*LoadKeys 手册页* ![Zgrep Man Pages](http://www.tecmint.com/wp-content/uploads/2015/07/Zgrep-Man-Pages.png) -Zgrep 手册页 +*Zgrep 手册页* + +希望你知道如何退出手册页浏览——如果你已经厌烦了每次都看到手册页,你可以删除你添加到 `.bashrc`文件中的那几行。 ### 查看登录用户的状态 ### 了解其他用户正在共享服务器上做什么。 -一般情况下,你是共享的 Linux 服务器的用户或管理员的。如果你担心自己服务器的安全并想要查看哪些用户在做什么,你可以使用命令 'w'。 +一般情况下,你是共享的 Linux 服务器的用户或管理员的。如果你担心自己服务器的安全并想要查看哪些用户在做什么,你可以使用命令 `w`。 这个命令可以让你知道是否有人在执行恶意代码或篡改服务器,让他停下或使用其他方法。'w' 是查看登录用户状态的首选方式。 @@ -83,33 +90,33 @@ Zgrep 手册页 ![Check Linux User Activity](http://www.tecmint.com/wp-content/uploads/2015/07/Check-Linux-User-Activity.png) -检查 Linux 用户状态 +*检查 Linux 用户状态* ### 查看浏览器的内存使用状况 ### -最近有不少谈论关于 Google-chrome 内存使用量。如果你想知道一个浏览器的内存用量,你可以列出进程名,PID 和它的使用情况。要检查浏览器的内存使用情况,只需在地址栏输入 “about:memory” 不要带引号。 +最近有不少谈论关于 Google-chrome 的内存使用量。如要检查浏览器的内存使用情况,只需在地址栏输入 “about:memory”,不要带引号。 我已经在 Google-Chrome 和 Mozilla 的 Firefox 网页浏览器进行了测试。你可以查看任何浏览器,如果它工作得很好,你可能会承认我们在下面的评论。你也可以杀死浏览器进程在 Linux 终端的进程/服务中。 -在 Google Chrome 中,在地址栏输入 `about:memory`,你应该得到类似下图的东西。 +在 Google Chrome 中,在地址栏输入 `about:memory`,你应该得到类似下图的东西。 ![Check Chrome Memory Usage](http://www.tecmint.com/wp-content/uploads/2015/07/Check-Chrome-Memory-Usage.png) -查看 Chrome 内存使用状况 +*查看 Chrome 内存使用状况* 在Mozilla Firefox浏览器,在地址栏输入 `about:memory`,你应该得到类似下图的东西。 ![Check Firefox Memory Usage](http://www.tecmint.com/wp-content/uploads/2015/07/Check-Firefox-Memory-Usage.png) -查看 Firefox 内存使用状况 +*查看 Firefox 内存使用状况* 如果你已经了解它是什么,除了这些选项。要检查内存用量,你也可以点击最左边的 ‘Measure‘ 选项。 ![Firefox Main Process](http://www.tecmint.com/wp-content/uploads/2015/07/Firefox-Main-Processes.png) -Firefox 主进程 +*Firefox 主进程* -它将通过浏览器树形展示进程内存使用量 +它将通过浏览器树形展示进程内存使用量。 目前为止就这样了。希望上述所有的提示将会帮助你。如果你有一个(或多个)技巧,分享给我们,将帮助 Linux 用户更有效地管理他们的 Linux 系统/服务器。 @@ -122,7 +129,7 @@ via: http://www.tecmint.com/creating-cdrom-iso-image-watch-user-activity-in-linu 作者:[Avishek Kumar][a] 译者:[strugglingyouth](https://github.com/strugglingyouth) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 85aa60c1a7364d152d0471ce09b0125b59e90d3e Mon Sep 17 00:00:00 2001 From: wxy Date: Mon, 17 Aug 2015 00:41:29 +0800 Subject: [PATCH 960/965] PUB:20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 3 - GNOME Applications @XLCYun --- ...t & Wrong - Page 3 - GNOME Applications.md | 66 +++++++++++++++++++ ...t & Wrong - Page 3 - GNOME Applications.md | 61 ----------------- 2 files changed, 66 insertions(+), 61 deletions(-) create mode 100644 published/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 3 - GNOME Applications.md delete mode 100644 translated/tech/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 3 - GNOME Applications.md diff --git a/published/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 3 - GNOME Applications.md b/published/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 3 - GNOME Applications.md new file mode 100644 index 0000000000..61600366c9 --- /dev/null +++ b/published/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 3 - GNOME Applications.md @@ -0,0 +1,66 @@ +一周 GNOME 之旅:品味它和 KDE 的是是非非(第三节 GNOME应用) +================================================================================ + +### 应用 ### + +![](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_videos_show&w=1920) + +这是一个基本扯平的方面。每一个桌面环境都有一些非常好的应用,也有一些不怎么样的。再次强调,Gnome 把那些 KDE 完全错失的小细节给做对了。我不是想说 KDE 中有哪些应用不好。他们都能工作,但仅此而已。也就是说:它们合格了,但确实还没有达到甚至接近100分。 + +Gnome 是一个样子,KDE 是另外一种。Dragon 播放器运行得很好,清晰的标出了播放文件、URL或和光盘的按钮,正如你在 Gnome Videos 中能做到的一样……但是在便利的文件名和用户的友好度方面,Gnome 多走了一小步。它默认显示了在你的电脑上检测到的所有影像文件,不需要你做任何事情。KDE 有 [Baloo][](正如之前的 [Nepomuk][2],LCTT 译注:这是 KDE 中一种文件索引服务框架)为什么不使用它们?它们能列出可读取的影像文件……但却没被使用。 + +下一步……音乐播放器 + +![](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_rhythmbox_show&w=1920) + +![](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_amarok_show&w=1920) + +这两个应用,左边的是 Rhythmbox ,右边的是 Amarok,都是打开后没有做任何修改直接截屏的。看到差别了吗?Rhythmbox 看起来像个音乐播放器,直接了当,排序文件的方法也很清晰,它知道它应该是什么样的,它的工作是什么:就是播放音乐。 + +Amarok 感觉就像是某个人为了展示而把所有的扩展和选项都尽可能地塞进一个应用程序中去,而做出来的一个技术演示产品(tech demos),或者一个库演示产品(library demos)——而这些是不应该做为产品装进去的,它只应该展示其中一点东西。而 Amarok 给人的感觉却是这样的:好像是某个人想把每一个感觉可能很酷的东西都塞进一个媒体播放器里,甚至都不停下来想“我想写啥来着?一个播放音乐的应用?” + +看看默认布局就行了。前面和中心都呈现了什么?一个可视化工具和集成了维基百科——占了整个页面最大和最显眼的区域。第二大的呢?播放列表。第三大,同时也是最小的呢?真正的音乐列表。这种默认设置对于一个核心应用来说,怎么可能称得上理智? + +软件管理器!它在最近几年当中有很大的进步,而且接下来的几个月中,很可能只能看到它更大的进步。不幸的是,这是另一个 KDE 做得差一点点就能……但还是在终点线前以脸戗地了。 + +![](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_software_show&w=1920) + +![](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_apper_show&w=1920) + +![](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_muon_show&w=1920) + +Gnome 软件中心可能是我的新的最爱的软件中心,先放下牢骚等下再发。Muon, 我想爱上你,真的。但你就是个设计上的梦魇。当 VDG 给你画设计草稿时(草图如下),你看起来真漂亮。白色空间用得很好,设计简洁,类别列表也很好,你的整个“不要分开做成两个应用程序”的设计都很不错。 + +![](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_muon1_show&w=1920) + +接着就有人为你写代码,实现真正的UI,但是,我猜这些家伙当时一定是喝醉了。 + +我们来看看 Gnome 软件中心。正中间是什么?软件,软件截图和软件描述等等。Muon 的正中心是什么?白白浪费的大块白色空间。Gnome 软件中心还有一个贴心便利特点,那就是放了一个“运行”的按钮在那儿,以防你已经安装了这个软件。便利性和易用性很重要啊,大哥。说实话,仅仅让 Muon 把东西都居中对齐了可能看起来的效果都要好得多。 + +Gnome 软件中心沿着顶部的东西是什么,像个标签列表?所有软件,已安装软件,软件升级。语言简洁,直接,直指要点。Muon,好吧,我们有个“发现”,这个语言表达上还算差强人意,然后我们又有一个“已安装软件”,然后,就没有然后了。软件升级哪去了? + +好吧……开发者决定把升级独立分开成一个应用程序,这样你就得打开两个应用程序才能管理你的软件——一个用来安装,一个用来升级——自从有了新立得图形软件包管理器以来,首次有这种破天荒的设计,与任何已存的软件中心的设计范例相违背。 + +我不想贴上截图给你们看,因为我不想等下还得清理我的电脑,如果你进入 Muon 安装了什么,那么它就会在屏幕下方根据安装的应用名创建一个标签,所以如果你一次性安装很多软件的话,那么下面的标签数量就会慢慢的增长,然后你就不得不手动检查清除它们,因为如果你不这样做,当标签增长到超过屏幕显示时,你就不得不一个个找过去来才能找到最近正在安装的软件。想想:在火狐浏览器中打开50个标签是什么感受。太烦人,太不方便! + +我说过我会给 Gnome 一点打击,我是认真的。Muon 有一点做得比 Gnome 软件中心做得好。在 Muon 的设置栏下面有个“显示技术包”,即:编辑器,软件库,非图形应用程序,无 AppData 的应用等等(LCTT 译注:AppData 是软件包中的一个特殊文件,用于专门存储软件的信息)。Gnome 则没有。如果你想安装其中任何一项你必须跑到终端操作。我想这是他们做得不对的一点。我完全理解他们推行 AppData 的心情,但我想他们太急了(LCTT 译注:推行所有软件包带有 AppData 是 Gnome 软件中心的目标之一)。我是在想安装 PowerTop,而 Gnome 不显示这个软件时我才发现这点的——因为它没有 AppData,也没有“显示技术包”设置。 + +更不幸的事实是,如果你在 KDE 下你不能说“用 [Apper][3] 就行了”,因为…… + +![](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_apperlocal_show&w=1920) + +Apper 对安装本地软件包的支持大约在 Fedora 19 时就中止了,几乎两年了。我喜欢关注细节与质量。 + +-------------------------------------------------------------------------------- + +via: http://www.phoronix.com/scan.php?page=article&item=gnome-week-editorial&num=3 + +作者:Eric Griffith +译者:[XLCYun](https://github.com/XLCYun) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[1]:https://community.kde.org/Baloo +[2]:http://www.ikde.org/tech/kde-tech-nepomuk/ +[3]:https://en.wikipedia.org/wiki/Apper diff --git a/translated/tech/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 3 - GNOME Applications.md b/translated/tech/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 3 - GNOME Applications.md deleted file mode 100644 index 42539badcc..0000000000 --- a/translated/tech/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 3 - GNOME Applications.md +++ /dev/null @@ -1,61 +0,0 @@ -将GNOME作为我的Linux桌面的一周: 他们做对的与做错的 - 第三节 - GNOME应用 -================================================================================ -### 应用 ### - -![](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_videos_show&w=1920) - -这是一个基本上一潭死水的地方。每一个桌面环境都有一些非常好的和不怎么样的应用。再次强调,Gnome把那些KDE完全错失的小细节给做对了。我不是想说KDE中有哪些应用不好。他们都能工作。但仅此而已。也就是说:它们合格了,但确实还没有达到甚至接近100分。 - -Gnome的在左边,KDE的在右边。Dragon运行得很好,清晰的标出了播放文件、URL或和光盘的按钮,正如你在Gnome Videos中能做到的一样……但是在便利的文件名和用户的友好度方面,Gnome多走了一小步。它默认显示了在你的电脑上检测到的所有影像文件,不需要你做任何事情。KDE有Baloo——正如之前有Nepomuk——为什么不使用它们?它们能列出可读取的影像文件……但却没被使用。 - -下一步……音乐播放器 - -![](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_rhythmbox_show&w=1920) - -![](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_amarok_show&w=1920) - -这两个应用,左边的Rhythmbox和右边的Amarok,都是打开后没有做任何修改直接截屏的。看到差别了吗?Rhythmbox看起来像个音乐播放器,直接了当,排序文件的方法也很清晰,它知道它应该是什么样的,它的工作是什么:就是播放音乐。 - -Amarok感觉就像是某个人为了展示而把所有的扩展和选项都尽可能地塞进一个应用程序中去而做出来的一个技术演示产品(tech demos),或者一个库演示产品(library demos)——而这些是不应该做为产品装进去的,它只应该展示一些零碎的东西。而Amarok给人的感觉却是这样的:好像是某个人想把每一个感觉可能很酷的东西都塞进一个媒体播放器里,甚至都不停下来想“我想写啥来着?一个播放音乐的应用?” - -看看默认布局就行了。前面和中心都呈现了什么?一个可视化工具和维基集成(wikipedia integration)——占了整个页面最大和最显眼的区域。第二大的呢?播放列表。第三大,同时也是最小的呢?真正的音乐列表。这种默认设置对于一个核心应用来说,怎么可能称得上理智? - -软件管理器!它在最近几年当中有很大的进步,而且接下来的几个月中,很可能只能看到它更大的进步。不幸的是,这是另一个地方KDE做得差一点点就能……但还是在终点线前摔了脸。 - -![](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_software_show&w=1920) - -![](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_apper_show&w=1920) - -![](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_muon_show&w=1920) - -Gnome软件中心可能是我最新的最爱,先放下牢骚等下再发。Muon, 我想爱上你,真的。但你就是个设计上的梦魇。当VDG给你画设计草稿时(模型在下面),你看起来真漂亮。白色空间用得很好,设计简洁,类别列表也很好,你的整个“不要分开做成两个应用程序”的设计都很不错。 - -![](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_muon1_show&w=1920) - -接着就有人为你写代码,实现真正的UI,但是,我猜这些家伙当时一定是喝醉了。 - -我们来看看Gnome软件中心。正中间是什么?软件,软件截图和软件描述等等。Muon的正中心是什么?白白浪费的大块白色空间。Gnome软件中心还有一个贴心便利特点,那就是放了一个“运行“的按钮在那儿,以防你已经安装了这个软件。便利性和易用性很重要啊,大哥。说实话,仅仅让Muon把东西都居中对齐了可能看起来的效果都要好得多。 - -Gnome软件中心沿着顶部的东西是什么,像个标签列表?所有软件,已安装软件,软件升级。语言简洁,直接,直指要点。Muon,好吧,我们有个”发现“,这个语言表达上还算差强人意,然后我们又有一个”已安装软件“,然后,就没有然后了。软件升级哪去了? - -好吧……开发者决定把升级独立分开成一个应用程序,这样你就得打开两个应用程序才能管理你的软件——一个用来安装,一个用来升级——自从有了新得立图形软件包管理器以来,首次有这种破天荒的设计,与任何已存的软件中心的设计范例相违背。 - -我不想贴上截图给你们看,因为我不想等下还得清理我的电脑,如果你进入Muon安装了什么,那么它就会在屏幕下方根据安装的应用名创建一个标签,所以如果你一次性安装很多软件的话,那么下面的标签数量就会慢慢的增长,然后你就不得不手动检查清除它们,因为如果你不这样做,当标签增长到超过屏幕显示时,你就不得不一个个找过去来才能找到最近正在安装的软件。想想:在火狐浏览器打开50个标签。太烦人,太不方便! - -我说过我会给Gnome一点打击,我是认真的。Muon有一点做得比Gnome软件中心做得好。在Muon的设置栏下面有个“显示技术包”,即:编辑器,软件库,非图形应用程序,无AppData的应用等等(AppData,软件包中的一个特殊文件,用于专门存储软件的信息,译注)。Gnome则没有。如果你想安装其中任何一项你必须跑到终端操作。我想这是他们做得不对的一点。我完全理解他们推行AppData的心情,但我想他们太急了(推行所有软件包带有AppData,是Gnome软件中心的目标之一,译注)。我是在想安装PowerTop,而Gnome不显示这个软件时我才发现这点的——没有AppData,没有“显示技术包“设置。 - -更不幸的事实是你不能“用Apper就行了”,自从…… - -![](http://www.phoronix.net/image.php?id=gnome-week-editorial&image=gnome_week_apperlocal_show&w=1920) - -Apper对安装本地软件包的支持大约在Fedora 19时就中止了,几乎两年了。我喜欢那种对细节与质量的关注。 - --------------------------------------------------------------------------------- - -via: http://www.phoronix.com/scan.php?page=article&item=gnome-week-editorial&num=3 - -作者:Eric Griffith -译者:[XLCYun](https://github.com/XLCYun) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 4dbc0c3601189cae703cd9e97bb1507fa0d39c2e Mon Sep 17 00:00:00 2001 From: DeadFire Date: Mon, 17 Aug 2015 10:56:51 +0800 Subject: [PATCH 961/965] =?UTF-8?q?20150817-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... Top 5 Torrent Clients For Ubuntu Linux.md | 117 ++++++++++++++++++ ...number of threads in a process on Linux.md | 50 ++++++++ 2 files changed, 167 insertions(+) create mode 100644 sources/share/20150817 Top 5 Torrent Clients For Ubuntu Linux.md create mode 100644 sources/tech/20150817 Linux FAQs with Answers--How to count the number of threads in a process on Linux.md diff --git a/sources/share/20150817 Top 5 Torrent Clients For Ubuntu Linux.md b/sources/share/20150817 Top 5 Torrent Clients For Ubuntu Linux.md new file mode 100644 index 0000000000..5ae03e4df1 --- /dev/null +++ b/sources/share/20150817 Top 5 Torrent Clients For Ubuntu Linux.md @@ -0,0 +1,117 @@ +Top 5 Torrent Clients For Ubuntu Linux +================================================================================ +![Best Torrent clients for Ubuntu Linux](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/08/5_Best_Torrent_Ubuntu.png) + +Looking for the **best torrent client in Ubuntu**? Indeed there are a number of torrent clients available for desktop Linux. But which ones are the **best Ubuntu torrent clients** among them? + +I am going to list top 5 torrent clients for Linux, which are lightweight, feature rich and have impressive GUI. Ease of installation and using is also a factor. + +### Best torrent programs for Ubuntu ### + +Since Ubuntu comes by default with Transmission, I am going to exclude it from the list. This doesn’t mean that Transmission doesn’t deserve to be on the list. Transmission is a good to have torrent client for Ubuntu and this is the reason why it is the default Torrent application in several Linux distributions, including Ubuntu. + +---------- + +### Deluge ### + +![Logo of Deluge torrent client for Ubuntu](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/08/Deluge.png) + +[Deluge][1] has been chosen as the best torrent client for Linux by Lifehacker and that speaks itself of the usefulness of Deluge. And it’s not just Lifehacker who is fan of Deluge, check out any forum and you’ll find a number of people admitting that Deluge is their favorite. + +Fast, sleek and intuitive interface makes Deluge a hot favorite among Linux users. + +Deluge is available in Ubuntu repositories and you can install it in Ubuntu Software Center or by using the command below: + + sudo apt-get install deluge + +---------- + +### qBittorrent ### + +![qBittorrent client for Linux](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/08/qbittorrent_icon.png) + +As the name suggests, [qBittorrent][2] is the Qt version of famous [Bittorrent][3] application. You’ll see an interface similar to Bittorrent client in Windows, if you ever used it. Sort of lightweight and have all the standard features of a torrent program, qBittorrent is also available in default Ubuntu repository. + +It could be installed from Ubuntu Software Center or using the command below: + + sudo apt-get install qbittorrent + +---------- + +### Tixati ### + +![Tixati torrent client logo](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/08/tixati_icon.png) + +[Tixati][4] is another nice to have torrent client for Ubuntu. It has a default dark theme which might be preferred by many but not me. It has all the standard features that you can seek in a torrent client. + +In addition to that, there are additional feature of data analysis. You can measure and analyze bandwidth and other statistics in nice charts. + +- [Download Tixati][5] + +---------- + +### Vuze ### + +![Vuze Torrent Logo](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/08/vuze_icon_for_mac_os_x_by_hamzasaleem-d6yx1fp.png) + +[Vuze][6] is favorite torrent application of a number of Linux as well as Windows users. Apart from the standard features, you can search for torrents directly in the application. You can also subscribe to episodic content so that you won’t have to search for new contents as you can see it in your subscription in sidebar. + +It also comes with a video player that can play HD videos with subtitles and all. But I don’t think you would like to use it over the better video players such as VLC. + +Vuze can be installed from Ubuntu Software Center or using the command below: + + sudo apt-get install vuze + +---------- + +### Frostwire ### + +![Logo of Frostwire torrent client](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/08/frostwire.png) + +[Frostwire][7] is the torrent application you might want to try. It is more than just a simple torrent client. Also available for Android, you can use it to share files over WiFi. + +You can search for torrents from within the application and play them inside the application. In addition to the downloaded files, it can browse your local media and have them organized inside the player. The same is applicable for the Android version. + +An additional feature is that Frostwire also provides access to legal music by indi artists. You can download them and listen to it, for free, for legal. + +- [Download Frostwire][8] + +---------- + +### Honorable mention ### + +On Windows, uTorrent (pronounced mu torrent) is my favorite torrent application. While uTorrent may be available for Linux, I deliberately skipped it from the list because installing and using uTorrent in Linux is neither easy nor does it provide a complete application experience (runs with in web browser). + +You can read about uTorrent installation in Ubuntu [here][9]. + +#### Quick tip: #### + +Most of the time, torrent applications do not start by default. You might want to change this behavior. Read this post to learn [how to manage startup applications in Ubuntu][10]. + +### What’s your favorite? ### + +That was my opinion on the best Torrent clients in Ubuntu. What is your favorite one? Do leave a comment. You can also check the [best download managers for Ubuntu][11] in related posts. And if you use Popcorn Time, check these [Popcorn Time Tips][12]. + +-------------------------------------------------------------------------------- + +via: http://itsfoss.com/best-torrent-ubuntu/ + +作者:[Abhishek][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://itsfoss.com/author/abhishek/ +[1]:http://deluge-torrent.org/ +[2]:http://www.qbittorrent.org/ +[3]:http://www.bittorrent.com/ +[4]:http://www.tixati.com/ +[5]:http://www.tixati.com/download/ +[6]:http://www.vuze.com/ +[7]:http://www.frostwire.com/ +[8]:http://www.frostwire.com/downloads +[9]:http://sysads.co.uk/2014/05/install-utorrent-3-3-ubuntu-14-04-13-10/ +[10]:http://itsfoss.com/manage-startup-applications-ubuntu/ +[11]:http://itsfoss.com/4-best-download-managers-for-linux/ +[12]:http://itsfoss.com/popcorn-time-tips/ \ No newline at end of file diff --git a/sources/tech/20150817 Linux FAQs with Answers--How to count the number of threads in a process on Linux.md b/sources/tech/20150817 Linux FAQs with Answers--How to count the number of threads in a process on Linux.md new file mode 100644 index 0000000000..7993b32628 --- /dev/null +++ b/sources/tech/20150817 Linux FAQs with Answers--How to count the number of threads in a process on Linux.md @@ -0,0 +1,50 @@ +Linux FAQs with Answers--How to count the number of threads in a process on Linux +================================================================================ +> **Question**: I have an application running, which forks a number of threads at run-time. I want to know how many threads are actively running in the program. What is the easiest way to check the thread count of a process on Linux? + +If you want to see the number of threads per process in Linux environments, there are several ways to do it. + +### Method One: /proc ### + +The proc pseudo filesystem, which resides in /proc directory, is the easiest way to see the thread count of any active process. The /proc directory exports in the form of readable text files a wealth of information related to existing processes and system hardware such as CPU, interrupts, memory, disk, etc. + + $ cat /proc//status + +The above command will show detailed information about the process with , which includes process state (e.g., sleeping, running), parent PID, UID, GID, the number of file descriptors used, and the number of context switches. The output also indicates **the total number of threads created in a process** as follows. + + Threads: + +For example, to check the thread count of a process with PID 20571: + + $ cat /proc/20571/status + +![](https://farm6.staticflickr.com/5649/20341236279_f4a4d809d2_b.jpg) + +The output indicates that the process has 28 threads in it. + +Alternatively, you could simply count the number of directories found in /proc//task, as shown below. + + $ ls /proc//task | wc + +This is because, for every thread created within a process, there is a corresponding directory created in /proc//task, named with its thread ID. Thus the total number of directories in /proc//task represents the number of threads in the process. + +### Method Two: ps ### + +If you are an avid user of the versatile ps command, this command can also show you individual threads of a process (with "H" option). The following command will print the thread count of a process. The "h" option is needed to hide the header in the top output. + + $ ps hH p | wc -l + +If you want to monitor the hardware resources (CPU & memory) consumed by different threads of a process, refer to [this tutorial][1].(注:此文我们翻译过) + +-------------------------------------------------------------------------------- + +via: http://ask.xmodulo.com/number-of-threads-process-linux.html + +作者:[Dan Nanni][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://ask.xmodulo.com/author/nanni +[1]:http://ask.xmodulo.com/view-threads-process-linux.html \ No newline at end of file From 66bcdcee0665664be02af42b513d49a4680560b2 Mon Sep 17 00:00:00 2001 From: DeadFire Date: Mon, 17 Aug 2015 11:11:24 +0800 Subject: [PATCH 962/965] =?UTF-8?q?20150817-2=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...cketing System in Fedora 22 or Centos 7.md | 179 ++++++++++++++++++ ...x Wireshark GUI freeze on Linux desktop.md | 61 ++++++ 2 files changed, 240 insertions(+) create mode 100644 sources/tech/20150817 How to Install OsTicket Ticketing System in Fedora 22 or Centos 7.md create mode 100644 sources/tech/20150817 Linux FAQs with Answers--How to fix Wireshark GUI freeze on Linux desktop.md diff --git a/sources/tech/20150817 How to Install OsTicket Ticketing System in Fedora 22 or Centos 7.md b/sources/tech/20150817 How to Install OsTicket Ticketing System in Fedora 22 or Centos 7.md new file mode 100644 index 0000000000..515b15844a --- /dev/null +++ b/sources/tech/20150817 How to Install OsTicket Ticketing System in Fedora 22 or Centos 7.md @@ -0,0 +1,179 @@ +How to Install OsTicket Ticketing System in Fedora 22 / Centos 7 +================================================================================ +In this article, we'll learn how to setup help desk ticketing system with osTicket in our machine or server running Fedora 22 or CentOS 7 as operating system. osTicket is a free and open source popular customer support ticketing system developed and maintained by [Enhancesoft][1] and its contributors. osTicket is the best solution for help and support ticketing system and management for better communication and support assistance with clients and customers. It has the ability to easily integrate with inquiries created via email, phone and web based forms into a beautiful multi-user web interface. osTicket makes us easy to manage, organize and log all our support requests and responses in one single place. It is a simple, lightweight, reliable, open source, web-based and easy to setup and use help desk ticketing system. + +Here are some easy steps on how we can setup Help Desk ticketing system with osTicket in Fedora 22 or CentOS 7 operating system. + +### 1. Installing LAMP stack ### + +First of all, we'll need to install LAMP Stack to make osTicket working. LAMP stack is the combination of Apache web server, MySQL or MariaDB database system and PHP. To install a complete suit of LAMP stack that we need for the installation of osTicket, we'll need to run the following commands in a shell or a terminal. + +**On Fedora 22** + +LAMP stack is available on the official repository of Fedora 22. As the default package manager of Fedora 22 is the latest DNF package manager, we'll need to run the following command. + + $ sudo dnf install httpd mariadb mariadb-server php php-mysql php-fpm php-cli php-xml php-common php-gd php-imap php-mbstring wget + +**On CentOS 7** + +As there is LAMP stack available on the official repository of CentOS 7, we'll gonna install it using yum package manager. + + $ sudo yum install httpd mariadb mariadb-server php php-mysql php-fpm php-cli php-xml php-common php-gd php-imap php-mbstring wget + +### 2. Starting Apache Web Server and MariaDB ### + +Next, we'll gonna start MariaDB server and Apache Web Server to get started. + + $ sudo systemctl start mariadb httpd + +Then, we'll gonna enable them to start on every boot of the system. + + $ sudo systemctl enable mariadb httpd + + Created symlink from /etc/systemd/system/multi-user.target.wants/mariadb.service to /usr/lib/systemd/system/mariadb.service. + Created symlink from /etc/systemd/system/multi-user.target.wants/httpd.service to /usr/lib/systemd/system/httpd.service. + +### 3. Downloading osTicket package ### + +Next, we'll gonna download the latest release of osTicket ie version 1.9.9 . We can download it from the official download page [http://osticket.com/download][2] or from the official github repository. [https://github.com/osTicket/osTicket-1.8/releases][3] . Here, in this tutorial we'll download the tarball of the latest release of osTicket from the github release page using wget command. + + $ cd /tmp/ + $ wget https://github.com/osTicket/osTicket-1.8/releases/download/v1.9.9/osTicket-v1.9.9-1-gbe2f138.zip + + --2015-07-16 09:14:23-- https://github.com/osTicket/osTicket-1.8/releases/download/v1.9.9/osTicket-v1.9.9-1-gbe2f138.zip + Resolving github.com (github.com)... 192.30.252.131 + ... + Connecting to s3.amazonaws.com (s3.amazonaws.com)|54.231.244.4|:443... connected. + HTTP request sent, awaiting response... 200 OK + Length: 7150871 (6.8M) [application/octet-stream] + Saving to: ‘osTicket-v1.9.9-1-gbe2f138.zip’ + osTicket-v1.9.9-1-gb 100%[========================>] 6.82M 1.25MB/s in 12s + 2015-07-16 09:14:37 (604 KB/s) - ‘osTicket-v1.9.9-1-gbe2f138.zip’ saved [7150871/7150871] + +### 4. Extracting the osTicket ### + +After we have successfully downloaded the osTicket zipped package, we'll now gonna extract the zip. As the default root directory of Apache web server is /var/www/html/ , we'll gonna create a directory called "**support**" where we'll extract the whole directory and files of the compressed zip file. To do so, we'll need to run the following commands in a terminal or a shell. + + $ unzip osTicket-v1.9.9-1-gbe2f138.zip + +Then, we'll move the whole extracted files to it. + + $ sudo mv /tmp/upload /var/www/html/support + +### 5. Fixing Ownership and Permission ### + +Now, we'll gonna assign the ownership of the directories and files under /var/ww/html/support to apache to enable writable access to the apache process owner. To do so, we'll need to run the following command. + + $ sudo chown apache: -R /var/www/html/support + +Then, we'll also need to copy a sample configuration file to its default configuration file. To do so, we'll need to run the below command. + + $ cd /var/www/html/support/ + $ sudo cp include/ost-sampleconfig.php include/ost-config.php + $ sudo chmod 0666 include/ost-config.php + +If you have SELinux enabled on the system, run the following command. + + $ sudo chcon -R -t httpd_sys_content_t /var/www/html/vtigercrm + $ sudo chcon -R -t httpd_sys_rw_content_t /var/www/html/vtigercrm + +### 6. Configuring MariaDB ### + +As this is the first time we're going to configure MariaDB, we'll need to create a password for the root user of mariadb so that we can use it to login and create the database for our osTicket installation. To do so, we'll need to run the following command in a terminal or a shell. + + $ sudo mysql_secure_installation + + ... + Enter current password for root (enter for none): + OK, successfully used password, moving on... + + Setting the root password ensures that nobody can log into the MariaDB + root user without the proper authorisation. + + Set root password? [Y/n] y + New password: + Re-enter new password: + Password updated successfully! + Reloading privilege tables.. + Success! + ... + All done! If you've completed all of the above steps, your MariaDB + installation should now be secure. + + Thanks for using MariaDB! + +Note: Above, we are asked to enter the root password of the mariadb server but as we are setting for the first time and no password has been set yet, we'll simply hit enter while asking the current mariadb root password. Then, we'll need to enter twice the new password we wanna set. Then, we can simply hit enter in every argument in order to set default configurations. + +### 7. Creating osTicket Database ### + +As osTicket needs a database system to store its data and information, we'll be configuring MariaDB for osTicket. So, we'll need to first login into the mariadb command environment. To do so, we'll need to run the following command. + + $ sudo mysql -u root -p + +Now, we'll gonna create a new database "**osticket_db**" with user "**osticket_user**" and password "osticket_password" which will be granted access to the database. To do so, we'll need to run the following commands inside the MariaDB command environment. + + > CREATE DATABASE osticket_db; + > CREATE USER 'osticket_user'@'localhost' IDENTIFIED BY 'osticket_password'; + > GRANT ALL PRIVILEGES on osticket_db.* TO 'osticket_user'@'localhost' ; + > FLUSH PRIVILEGES; + > EXIT; + +**Note**: It is strictly recommended to replace the database name, user and password as your desire for security issue. + +### 8. Allowing Firewall ### + +If we are running a firewall program, we'll need to configure our firewall to allow port 80 so that the Apache web server's default port will be accessible externally. This will allow us to navigate our web browser to osTicket's web interface with the default http port 80. To do so, we'll need to run the following command. + + $ sudo firewall-cmd --zone=public --add-port=80/tcp --permanent + +After done, we'll need to reload our firewall service. + + $ sudo firewall-cmd --reload + +### 9. Web based Installation ### + +Finally, is everything is done as described above, we'll now should be able to navigate osTicket's Installer by pointing our web browser to http://domain.com/support or http://ip-address/support . Now, we'll be shown if the dependencies required by osTicket are installed or not. As we've already installed all the necessary packages, we'll be welcomed with **green colored tick** to proceed forward. + +![osTicket Requirements Check](http://blog.linoxide.com/wp-content/uploads/2015/07/osticket-requirements-check1.png) + +After that, we'll be required to enter the details for our osTicket instance as shown below. We'll need to enter the database name, username, password and hostname and other important account information that we'll require while logging into the admin panel. + +![osticket configuration](http://blog.linoxide.com/wp-content/uploads/2015/07/osticket-configuration.png) + +After the installation has been completed successfully, we'll be welcomed by a Congratulations screen. There we can see two links, one for our Admin Panel and the other for the support center as the homepage of the osTicket Support Help Desk. + +![osticket installation completed](http://blog.linoxide.com/wp-content/uploads/2015/07/osticket-installation-completed.png) + +If we click on http://ip-address/support or http://domain.com/support, we'll be redirected to the osTicket support page which is as shown below. + +![osticket support homepage](http://blog.linoxide.com/wp-content/uploads/2015/07/osticket-support-homepage.png) + +Next, to login into the admin panel, we'll need to navigate our web browser to http://ip-address/support/scp or http://domain.com/support/scp . Then, we'll need to enter the login details we had just created above while configuring the database and other information in the web installer. After successful login, we'll be able to access our dashboard and other admin sections. + +![osticket admin panel](http://blog.linoxide.com/wp-content/uploads/2015/07/osticket-admin-panel.png) + +### 10. Post Installation ### + +After we have finished the web installation of osTicket, we'll now need to secure some of our configuration files. To do so, we'll need to run the following command. + + $ sudo rm -rf /var/www/html/support/setup/ + $ sudo chmod 644 /var/www/html/support/include/ost-config.php + +### Conclusion ### + +osTicket is an awesome help desk ticketing system providing several new features. It supports rich text or HTML emails, ticket filters, agent collision avoidance, auto-responder and many more features. The user interface of osTicket is very beautiful with easy to use control panel. It is a complete set of tools required for a help and support ticketing system. It is the best solution for providing customers a better way to communicate with the support team. It helps a company to make their customers happy with them regarding the support and help desk. If you have any questions, suggestions, feedback please write them in the comment box below so that we can improve or update our contents. Thank you ! Enjoy :-) + +------------------------------------------------------------------------------ + +via: http://linoxide.com/linux-how-to/install-osticket-fedora-22-centos-7/ + +作者:[Arun Pyasi][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://linoxide.com/author/arunp/ +[1]:http://www.enhancesoft.com/ +[2]:http://osticket.com/download +[3]:https://github.com/osTicket/osTicket-1.8/releases \ No newline at end of file diff --git a/sources/tech/20150817 Linux FAQs with Answers--How to fix Wireshark GUI freeze on Linux desktop.md b/sources/tech/20150817 Linux FAQs with Answers--How to fix Wireshark GUI freeze on Linux desktop.md new file mode 100644 index 0000000000..f6fb3be325 --- /dev/null +++ b/sources/tech/20150817 Linux FAQs with Answers--How to fix Wireshark GUI freeze on Linux desktop.md @@ -0,0 +1,61 @@ +Linux FAQs with Answers--How to fix Wireshark GUI freeze on Linux desktop +================================================================================ +> **Question**: When I try to open a pre-recorded packet dump on Wireshark on Ubuntu, its UI suddenly freezes, and the following errors and warnings appear in the terminal where I launched Wireshark. How can I fix this problem? + +Wireshark is a GUI-based packet capture and sniffer tool. This tool is popularly used by network administrators, network security engineers or developers for various tasks where packet-level network analysis is required, for example during network troubleshooting, vulnerability testing, application debugging, or protocol reverse engineering. Wireshark allows one to capture live packets and browse their protocol headers and payloads via a convenient GUI. + +![](https://farm1.staticflickr.com/722/20584224675_f4d7a59474_c.jpg) + +It is known that Wireshark's UI, especially run under Ubuntu desktop, sometimes hangs or freezes with the following errors, while you are scrolling up or down the packet list view, or starting to load a pre-recorded packet dump file. + + (wireshark:3480): GLib-GObject-WARNING **: invalid unclassed pointer in cast to 'GObject' + (wireshark:3480): GLib-GObject-CRITICAL **: g_object_set_qdata_full: assertion 'G_IS_OBJECT (object)' failed + (wireshark:3480): GLib-GObject-WARNING **: invalid unclassed pointer in cast to 'GtkRange' + (wireshark:3480): Gtk-CRITICAL **: gtk_range_get_adjustment: assertion 'GTK_IS_RANGE (range)' failed + (wireshark:3480): GLib-GObject-WARNING **: invalid unclassed pointer in cast to 'GtkOrientable' + (wireshark:3480): Gtk-CRITICAL **: gtk_orientable_get_orientation: assertion 'GTK_IS_ORIENTABLE (orientable)' failed + (wireshark:3480): GLib-GObject-WARNING **: invalid unclassed pointer in cast to 'GtkScrollbar' + (wireshark:3480): GLib-GObject-WARNING **: invalid unclassed pointer in cast to 'GtkWidget' + (wireshark:3480): GLib-GObject-WARNING **: invalid unclassed pointer in cast to 'GObject' + (wireshark:3480): GLib-GObject-CRITICAL **: g_object_get_qdata: assertion 'G_IS_OBJECT (object)' failed + (wireshark:3480): Gtk-CRITICAL **: gtk_widget_set_name: assertion 'GTK_IS_WIDGET (widget)' failed + +Apparently this error is caused by some incompatibility between Wireshark and overlay-scrollbar, and has not been fixed in the latest Ubuntu desktop (e.g., as of Ubuntu 15.04 Vivid Vervet). + +A workaround to avoid this Wireshark UI freeze problem is to **temporarily disabling overlay-scrollbar**. There are two ways to disable overlay-scrollbar in Wireshark, depending on how you launch Wireshark on your desktop. + +### Command-Line Solution ### + +Overlay-scrollbar can be disabled by setting "**LIBOVERLAY_SCROLLBAR**" environment variable to "0". + +So if you are launching Wireshark from the command in a terminal, you can disable overlay-scrollbar in Wireshark as follows. + +Open your .bashrc, and define the following alias. + + alias wireshark="LIBOVERLAY_SCROLLBAR=0 /usr/bin/wireshark" + +### Desktop Launcher Solution ### + +If you are launching Wireshark using a desktop launcher, you can edit its desktop launcher file. + + $ sudo vi /usr/share/applications/wireshark.desktop + +Look for a line that starts with "Exec", and change it as follows. + + Exec=env LIBOVERLAY_SCROLLBAR=0 wireshark %f + +While this solution will be beneficial for all desktop users system-wide, it will not survive Wireshark upgrade. If you want to preserve the modified .desktop file, copy it to your home directory as follows. + + $ cp /usr/share/applications/wireshark.desktop ~/.local/share/applications/ + +-------------------------------------------------------------------------------- + +via: http://ask.xmodulo.com/fix-wireshark-gui-freeze-linux-desktop.html + +作者:[Dan Nanni][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://ask.xmodulo.com/author/nanni \ No newline at end of file From 64ff0afb64ffd64f11f553e6517d0d64c8d1e834 Mon Sep 17 00:00:00 2001 From: struggling <630441839@qq.com> Date: Mon, 17 Aug 2015 11:40:27 +0800 Subject: [PATCH 963/965] Update 20150817 Linux FAQs with Answers--How to count the number of threads in a process on Linux.md --- ...How to count the number of threads in a process on Linux.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150817 Linux FAQs with Answers--How to count the number of threads in a process on Linux.md b/sources/tech/20150817 Linux FAQs with Answers--How to count the number of threads in a process on Linux.md index 7993b32628..35ee2f00de 100644 --- a/sources/tech/20150817 Linux FAQs with Answers--How to count the number of threads in a process on Linux.md +++ b/sources/tech/20150817 Linux FAQs with Answers--How to count the number of threads in a process on Linux.md @@ -1,3 +1,4 @@ +translation by strugglingyouth Linux FAQs with Answers--How to count the number of threads in a process on Linux ================================================================================ > **Question**: I have an application running, which forks a number of threads at run-time. I want to know how many threads are actively running in the program. What is the easiest way to check the thread count of a process on Linux? @@ -47,4 +48,4 @@ via: http://ask.xmodulo.com/number-of-threads-process-linux.html 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 [a]:http://ask.xmodulo.com/author/nanni -[1]:http://ask.xmodulo.com/view-threads-process-linux.html \ No newline at end of file +[1]:http://ask.xmodulo.com/view-threads-process-linux.html From 63bfa49922873b3c26beac5a4217e7f5bb1df899 Mon Sep 17 00:00:00 2001 From: struggling <630441839@qq.com> Date: Mon, 17 Aug 2015 11:45:19 +0800 Subject: [PATCH 964/965] Update 20150817 Linux FAQs with Answers--How to fix Wireshark GUI freeze on Linux desktop.md --- ...nswers--How to fix Wireshark GUI freeze on Linux desktop.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150817 Linux FAQs with Answers--How to fix Wireshark GUI freeze on Linux desktop.md b/sources/tech/20150817 Linux FAQs with Answers--How to fix Wireshark GUI freeze on Linux desktop.md index f6fb3be325..d906349ff9 100644 --- a/sources/tech/20150817 Linux FAQs with Answers--How to fix Wireshark GUI freeze on Linux desktop.md +++ b/sources/tech/20150817 Linux FAQs with Answers--How to fix Wireshark GUI freeze on Linux desktop.md @@ -1,3 +1,4 @@ +translation by strugglingyouth Linux FAQs with Answers--How to fix Wireshark GUI freeze on Linux desktop ================================================================================ > **Question**: When I try to open a pre-recorded packet dump on Wireshark on Ubuntu, its UI suddenly freezes, and the following errors and warnings appear in the terminal where I launched Wireshark. How can I fix this problem? @@ -58,4 +59,4 @@ via: http://ask.xmodulo.com/fix-wireshark-gui-freeze-linux-desktop.html 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 -[a]:http://ask.xmodulo.com/author/nanni \ No newline at end of file +[a]:http://ask.xmodulo.com/author/nanni From 93096c2c2bb8675b0b9da23a0438b69b37094d0e Mon Sep 17 00:00:00 2001 From: DeadFire Date: Mon, 17 Aug 2015 14:59:32 +0800 Subject: [PATCH 965/965] =?UTF-8?q?20150817-3=20=E9=80=89=E9=A2=98=20LFCS?= =?UTF-8?q?=20=E4=B8=93=E9=A2=98=201-5=EF=BC=8C=E5=85=B1=E5=8D=81=E7=AF=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...eate Edit and Manipulate files in Linux.md | 220 ++++++++++ ...and Use vi or vim as a Full Text Editor.md | 387 ++++++++++++++++++ ...e Attributes and Finding Files in Linux.md | 382 +++++++++++++++++ ...esystems and Configuring Swap Partition.md | 191 +++++++++ ...work Samba and NFS Filesystems in Linux.md | 232 +++++++++++ 5 files changed, 1412 insertions(+) create mode 100644 sources/tech/LFCS/Part 1 - LFCS--How to use GNU 'sed' Command to Create Edit and Manipulate files in Linux.md create mode 100644 sources/tech/LFCS/Part 2 - LFCS--How to Install and Use vi or vim as a Full Text Editor.md create mode 100644 sources/tech/LFCS/Part 3 - LFCS--How to Archive or Compress Files and Directories Setting File Attributes and Finding Files in Linux.md create mode 100644 sources/tech/LFCS/Part 4 - LFCS--Partitioning Storage Devices Formatting Filesystems and Configuring Swap Partition.md create mode 100644 sources/tech/LFCS/Part 5 - LFCS--How to Mount or Unmount Local and Network Samba and NFS Filesystems in Linux.md diff --git a/sources/tech/LFCS/Part 1 - LFCS--How to use GNU 'sed' Command to Create Edit and Manipulate files in Linux.md b/sources/tech/LFCS/Part 1 - LFCS--How to use GNU 'sed' Command to Create Edit and Manipulate files in Linux.md new file mode 100644 index 0000000000..ca96b7dac6 --- /dev/null +++ b/sources/tech/LFCS/Part 1 - LFCS--How to use GNU 'sed' Command to Create Edit and Manipulate files in Linux.md @@ -0,0 +1,220 @@ +Part 1 - LFCS: How to use GNU ‘sed’ Command to Create, Edit, and Manipulate files in Linux +================================================================================ +The Linux Foundation announced the LFCS (Linux Foundation Certified Sysadmin) certification, a new program that aims at helping individuals all over the world to get certified in basic to intermediate system administration tasks for Linux systems. This includes supporting running systems and services, along with first-hand troubleshooting and analysis, and smart decision-making to escalate issues to engineering teams. + +![Linux Foundation Certified Sysadmin](http://www.tecmint.com/wp-content/uploads/2014/10/lfcs-Part-1.png) + +Linux Foundation Certified Sysadmin – Part 1 + +Please watch the following video that demonstrates about The Linux Foundation Certification Program. + +注:youtube 视频 + + +The series will be titled Preparation for the LFCS (Linux Foundation Certified Sysadmin) Parts 1 through 10 and cover the following topics for Ubuntu, CentOS, and openSUSE: + +- Part 1: How to use GNU ‘sed’ Command to Create, Edit, and Manipulate files in Linux +- Part 2: How to Install and Use vi/m as a full Text Editor +- Part 3: Archiving Files/Directories and Finding Files on the Filesystem +- Part 4: Partitioning Storage Devices, Formatting Filesystems and Configuring Swap Partition +- Part 5: Mount/Unmount Local and Network (Samba & NFS) Filesystems in Linux +- Part 6: Assembling Partitions as RAID Devices – Creating & Managing System Backups +- Part 7: Managing System Startup Process and Services (SysVinit, Systemd and Upstart +- Part 8: Managing Users & Groups, File Permissions & Attributes and Enabling sudo Access on Accounts +- Part 9: Linux Package Management with Yum, RPM, Apt, Dpkg, Aptitude and Zypper +- Part 10: Learning Basic Shell Scripting and Filesystem Troubleshooting + + +This post is Part 1 of a 10-tutorial series, which will cover the necessary domains and competencies that are required for the LFCS certification exam. That being said, fire up your terminal, and let’s start. + +### Processing Text Streams in Linux ### + +Linux treats the input to and the output from programs as streams (or sequences) of characters. To begin understanding redirection and pipes, we must first understand the three most important types of I/O (Input and Output) streams, which are in fact special files (by convention in UNIX and Linux, data streams and peripherals, or device files, are also treated as ordinary files). + +The difference between > (redirection operator) and | (pipeline operator) is that while the first connects a command with a file, the latter connects the output of a command with another command. + + # command > file + # command1 | command2 + +Since the redirection operator creates or overwrites files silently, we must use it with extreme caution, and never mistake it with a pipeline. One advantage of pipes on Linux and UNIX systems is that there is no intermediate file involved with a pipe – the stdout of the first command is not written to a file and then read by the second command. + +For the following practice exercises we will use the poem “A happy child” (anonymous author). + +![cat command](http://www.tecmint.com/wp-content/uploads/2014/10/cat-command.png) + +cat command example + +#### Using sed #### + +The name sed is short for stream editor. For those unfamiliar with the term, a stream editor is used to perform basic text transformations on an input stream (a file or input from a pipeline). + +The most basic (and popular) usage of sed is the substitution of characters. We will begin by changing every occurrence of the lowercase y to UPPERCASE Y and redirecting the output to ahappychild2.txt. The g flag indicates that sed should perform the substitution for all instances of term on every line of file. If this flag is omitted, sed will replace only the first occurrence of term on each line. + +**Basic syntax:** + + # sed ‘s/term/replacement/flag’ file + +**Our example:** + + # sed ‘s/y/Y/g’ ahappychild.txt > ahappychild2.txt + +![sed command](http://www.tecmint.com/wp-content/uploads/2014/10/sed-command.png) + +sed command example + +Should you want to search for or replace a special character (such as /, \, &) you need to escape it, in the term or replacement strings, with a backward slash. + +For example, we will substitute the word and for an ampersand. At the same time, we will replace the word I with You when the first one is found at the beginning of a line. + + # sed 's/and/\&/g;s/^I/You/g' ahappychild.txt + +![sed replace string](http://www.tecmint.com/wp-content/uploads/2014/10/sed-replace-string.png) + +sed replace string + +In the above command, a ^ (caret sign) is a well-known regular expression that is used to represent the beginning of a line. + +As you can see, we can combine two or more substitution commands (and use regular expressions inside them) by separating them with a semicolon and enclosing the set inside single quotes. + +Another use of sed is showing (or deleting) a chosen portion of a file. In the following example, we will display the first 5 lines of /var/log/messages from Jun 8. + + # sed -n '/^Jun 8/ p' /var/log/messages | sed -n 1,5p + +Note that by default, sed prints every line. We can override this behaviour with the -n option and then tell sed to print (indicated by p) only the part of the file (or the pipe) that matches the pattern (Jun 8 at the beginning of line in the first case and lines 1 through 5 inclusive in the second case). + +Finally, it can be useful while inspecting scripts or configuration files to inspect the code itself and leave out comments. The following sed one-liner deletes (d) blank lines or those starting with # (the | character indicates a boolean OR between the two regular expressions). + + # sed '/^#\|^$/d' apache2.conf + +![sed match string](http://www.tecmint.com/wp-content/uploads/2014/10/sed-match-string.png) + +sed match string + +#### uniq Command #### + +The uniq command allows us to report or remove duplicate lines in a file, writing to stdout by default. We must note that uniq does not detect repeated lines unless they are adjacent. Thus, uniq is commonly used along with a preceding sort (which is used to sort lines of text files). By default, sort takes the first field (separated by spaces) as key field. To specify a different key field, we need to use the -k option. + +**Examples** + +The du –sch /path/to/directory/* command returns the disk space usage per subdirectories and files within the specified directory in human-readable format (also shows a total per directory), and does not order the output by size, but by subdirectory and file name. We can use the following command to sort by size. + + # du -sch /var/* | sort –h + +![sort command](http://www.tecmint.com/wp-content/uploads/2014/10/sort-command.jpg) + +sort command example + +You can count the number of events in a log by date by telling uniq to perform the comparison using the first 6 characters (-w 6) of each line (where the date is specified), and prefixing each output line by the number of occurrences (-c) with the following command. + + # cat /var/log/mail.log | uniq -c -w 6 + +![Count Numbers in File](http://www.tecmint.com/wp-content/uploads/2014/10/count-numbers-in-file.jpg) + +Count Numbers in File + +Finally, you can combine sort and uniq (as they usually are). Consider the following file with a list of donors, donation date, and amount. Suppose we want to know how many unique donors there are. We will use the following command to cut the first field (fields are delimited by a colon), sort by name, and remove duplicate lines. + + # cat sortuniq.txt | cut -d: -f1 | sort | uniq + +![Find Unique Records in File](http://www.tecmint.com/wp-content/uploads/2014/10/find-uniqu-records-in-file.jpg) + +Find Unique Records in File + +- Read Also: [13 “cat” Command Examples][1] + +#### grep Command #### + +grep searches text files or (command output) for the occurrence of a specified regular expression and outputs any line containing a match to standard output. + +**Examples** + +Display the information from /etc/passwd for user gacanepa, ignoring case. + + # grep -i gacanepa /etc/passwd + +![grep Command](http://www.tecmint.com/wp-content/uploads/2014/10/grep-command.jpg) + +grep command example + +Show all the contents of /etc whose name begins with rc followed by any single number. + + # ls -l /etc | grep rc[0-9] + +![List Content Using grep](http://www.tecmint.com/wp-content/uploads/2014/10/list-content-using-grep.jpg) + +List Content Using grep + +- Read Also: [12 “grep” Command Examples][2] + +#### tr Command Usage #### + +The tr command can be used to translate (change) or delete characters from stdin, and write the result to stdout. + +**Examples** + +Change all lowercase to uppercase in sortuniq.txt file. + + # cat sortuniq.txt | tr [:lower:] [:upper:] + +![Sort Strings in File](http://www.tecmint.com/wp-content/uploads/2014/10/sort-strings.jpg) + +Sort Strings in File + +Squeeze the delimiter in the output of ls –l to only one space. + + # ls -l | tr -s ' ' + +![Squeeze Delimiter](http://www.tecmint.com/wp-content/uploads/2014/10/squeeze-delimeter.jpg) + +Squeeze Delimiter + +#### cut Command Usage #### + +The cut command extracts portions of input lines (from stdin or files) and displays the result on standard output, based on number of bytes (-b option), characters (-c), or fields (-f). In this last case (based on fields), the default field separator is a tab, but a different delimiter can be specified by using the -d option. + +**Examples** + +Extract the user accounts and the default shells assigned to them from /etc/passwd (the –d option allows us to specify the field delimiter, and the –f switch indicates which field(s) will be extracted. + + # cat /etc/passwd | cut -d: -f1,7 + +![Extract User Accounts](http://www.tecmint.com/wp-content/uploads/2014/10/extract-user-accounts.jpg) + +Extract User Accounts + +Summing up, we will create a text stream consisting of the first and third non-blank files of the output of the last command. We will use grep as a first filter to check for sessions of user gacanepa, then squeeze delimiters to only one space (tr -s ‘ ‘). Next, we’ll extract the first and third fields with cut, and finally sort by the second field (IP addresses in this case) showing unique. + + # last | grep gacanepa | tr -s ‘ ‘ | cut -d’ ‘ -f1,3 | sort -k2 | uniq + +![last command](http://www.tecmint.com/wp-content/uploads/2014/10/last-command.png) + +last command example + +The above command shows how multiple commands and pipes can be combined so as to obtain filtered data according to our desires. Feel free to also run it by parts, to help you see the output that is pipelined from one command to the next (this can be a great learning experience, by the way!). + +### Summary ### + +Although this example (along with the rest of the examples in the current tutorial) may not seem very useful at first sight, they are a nice starting point to begin experimenting with commands that are used to create, edit, and manipulate files from the Linux command line. Feel free to leave your questions and comments below – they will be much appreciated! + +#### Reference Links #### + +- [About the LFCS][3] +- [Why get a Linux Foundation Certification?][4] +- [Register for the LFCS exam][5] + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/sed-command-to-create-edit-and-manipulate-files-in-linux/ + +作者:[Gabriel Cánepa][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/gacanepa/ +[1]:http://www.tecmint.com/13-basic-cat-command-examples-in-linux/ +[2]:http://www.tecmint.com/12-practical-examples-of-linux-grep-command/ +[3]:https://training.linuxfoundation.org/certification/LFCS +[4]:https://training.linuxfoundation.org/certification/why-certify-with-us +[5]:https://identity.linuxfoundation.org/user?destination=pid/1 \ No newline at end of file diff --git a/sources/tech/LFCS/Part 2 - LFCS--How to Install and Use vi or vim as a Full Text Editor.md b/sources/tech/LFCS/Part 2 - LFCS--How to Install and Use vi or vim as a Full Text Editor.md new file mode 100644 index 0000000000..7537f784bd --- /dev/null +++ b/sources/tech/LFCS/Part 2 - LFCS--How to Install and Use vi or vim as a Full Text Editor.md @@ -0,0 +1,387 @@ +Part 2 - LFCS: How to Install and Use vi/vim as a Full Text Editor +================================================================================ +A couple of months ago, the Linux Foundation launched the LFCS (Linux Foundation Certified Sysadmin) certification in order to help individuals from all over the world to verify they are capable of doing basic to intermediate system administration tasks on Linux systems: system support, first-hand troubleshooting and maintenance, plus intelligent decision-making to know when it’s time to raise issues to upper support teams. + +![Learning VI Editor in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/LFCS-Part-2.png) + +Learning VI Editor in Linux + +Please take a look at the below video that explains The Linux Foundation Certification Program. + +注:youtube 视频 + + +This post is Part 2 of a 10-tutorial series, here in this part, we will cover the basic file editing operations and understanding modes in vi/m editor, that are required for the LFCS certification exam. + +### Perform Basic File Editing Operations Using vi/m ### + +Vi was the first full-screen text editor written for Unix. Although it was intended to be small and simple, it can be a bit challenging for people used exclusively to GUI text editors, such as NotePad++, or gedit, to name a few examples. + +To use Vi, we must first understand the 3 modes in which this powerful program operates, in order to begin learning later about the its powerful text-editing procedures. + +Please note that most modern Linux distributions ship with a variant of vi known as vim (“Vi improved”), which supports more features than the original vi does. For that reason, throughout this tutorial we will use vi and vim interchangeably. + +If your distribution does not have vim installed, you can install it as follows. + +- Ubuntu and derivatives: aptitude update && aptitude install vim +- Red Hat-based distributions: yum update && yum install vim +- openSUSE: zypper update && zypper install vim + +### Why should I want to learn vi? ### + +There are at least 2 good reasons to learn vi. + +1. vi is always available (no matter what distribution you’re using) since it is required by POSIX. + +2. vi does not consume a considerable amount of system resources and allows us to perform any imaginable tasks without lifting our fingers from the keyboard. + +In addition, vi has a very extensive built-in manual, which can be launched using the :help command right after the program is started. This built-in manual contains more information than vi/m’s man page. + +![vi Man Pages](http://www.tecmint.com/wp-content/uploads/2014/10/vi-man-pages.png) + +vi Man Pages + +#### Launching vi #### + +To launch vi, type vi in your command prompt. + +![Start vi Editor](http://www.tecmint.com/wp-content/uploads/2014/10/start-vi-editor.png) + +Start vi Editor + +Then press i to enter Insert mode, and you can start typing. Another way to launch vi/m is. + + # vi filename + +Which will open a new buffer (more on buffers later) named filename, which you can later save to disk. + +#### Understanding Vi modes #### + +1. In command mode, vi allows the user to navigate around the file and enter vi commands, which are brief, case-sensitive combinations of one or more letters. Almost all of them can be prefixed with a number to repeat the command that number of times. + +For example, yy (or Y) copies the entire current line, whereas 3yy (or 3Y) copies the entire current line along with the two next lines (3 lines in total). We can always enter command mode (regardless of the mode we’re working on) by pressing the Esc key. The fact that in command mode the keyboard keys are interpreted as commands instead of text tends to be confusing to beginners. + +2. In ex mode, we can manipulate files (including saving a current file and running outside programs). To enter this mode, we must type a colon (:) from command mode, directly followed by the name of the ex-mode command that needs to be used. After that, vi returns automatically to command mode. + +3. In insert mode (the letter i is commonly used to enter this mode), we simply enter text. Most keystrokes result in text appearing on the screen (one important exception is the Esc key, which exits insert mode and returns to command mode). + +![vi Insert Mode](http://www.tecmint.com/wp-content/uploads/2014/10/vi-insert-mode.png) + +vi Insert Mode + +#### Vi Commands #### + +The following table shows a list of commonly used vi commands. File edition commands can be enforced by appending the exclamation sign to the command (for example, + + + + + + +  Key command +  Description + + +  h or left arrow +  Go one character to the left + + +  j or down arrow +  Go down one line + + +  k or up arrow +  Go up one line + + +  l (lowercase L) or right arrow +  Go one character to the right + + +  H +  Go to the top of the screen + + +  L +  Go to the bottom of the screen + + +  G +  Go to the end of the file + + +  w +  Move one word to the right + + +  b +  Move one word to the left + + +  0 (zero) +  Go to the beginning of the current line + + +  ^ +  Go to the first nonblank character on the current line + + +  $ +  Go to the end of the current line + + +  Ctrl-B +  Go back one screen + + +  Ctrl-F +  Go forward one screen + + +  i +  Insert at the current cursor position + + +  I (uppercase i) +  Insert at the beginning of the current line + + +  J (uppercase j) +  Join current line with the next one (move next line up) + + +  a +  Append after the current cursor position + + +  o (lowercase O) +  Creates a blank line after the current line + + +  O (uppercase o) +  Creates a blank line before the current line + + +  r +  Replace the character at the current cursor position + + +  R +  Overwrite at the current cursor position + + +  x +  Delete the character at the current cursor position + + +  X +  Delete the character immediately before (to the left) of the current cursor position + + +  dd +  Cut (for later pasting) the entire current line + + +  D +  Cut from the current cursor position to the end of the line (this command is equivalent to d$) + + +  yX +  Give a movement command X, copy (yank) the appropriate number of characters, words, or lines from the current cursor position + + +  yy or Y +  Yank (copy) the entire current line + + +  p +  Paste after (next line) the current cursor position + + +  P +  Paste before (previous line) the current cursor position + + +  . (period) +  Repeat the last command + + +  u +  Undo the last command + + +  U +  Undo the last command in the last line. This will work as long as the cursor is still on the line. + + +  n +  Find the next match in a search + + +  N +  Find the previous match in a search + + +  :n +  Next file; when multiple files are specified for editing, this commands loads the next file. + + +  :e file +  Load file in place of the current file. + + +  :r file +  Insert the contents of file after (next line) the current cursor position + + +  :q +  Quit without saving changes. + + +  :w file +  Write the current buffer to file. To append to an existing file, use :w >> file. + + +  :wq +  Write the contents of the current file and quit. Equivalent to x! and ZZ + + +  :r! command +  Execute command and insert output after (next line) the current cursor position. + + + + +#### Vi Options #### + +The following options can come in handy while running vim (we need to add them in our ~/.vimrc file). + + # echo set number >> ~/.vimrc + # echo syntax on >> ~/.vimrc + # echo set tabstop=4 >> ~/.vimrc + # echo set autoindent >> ~/.vimrc + +![vi Editor Options](http://www.tecmint.com/wp-content/uploads/2014/10/vi-options.png) + +vi Editor Options + +- set number shows line numbers when vi opens an existing or a new file. +- syntax on turns on syntax highlighting (for multiple file extensions) in order to make code and config files more readable. +- set tabstop=4 sets the tab size to 4 spaces (default value is 8). +- set autoindent carries over previous indent to the next line. + +#### Search and replace #### + +vi has the ability to move the cursor to a certain location (on a single line or over an entire file) based on searches. It can also perform text replacements with or without confirmation from the user. + +a). Searching within a line: the f command searches a line and moves the cursor to the next occurrence of a specified character in the current line. + +For example, the command fh would move the cursor to the next instance of the letter h within the current line. Note that neither the letter f nor the character you’re searching for will appear anywhere on your screen, but the character will be highlighted after you press Enter. + +For example, this is what I get after pressing f4 in command mode. + +![Search String in Vi](http://www.tecmint.com/wp-content/uploads/2014/10/vi-search-string.png) + +Search String in Vi + +b). Searching an entire file: use the / command, followed by the word or phrase to be searched for. A search may be repeated using the previous search string with the n command, or the next one (using the N command). This is the result of typing /Jane in command mode. + +![Vi Search String in File](http://www.tecmint.com/wp-content/uploads/2014/10/vi-search-line.png) + +Vi Search String in File + +c). vi uses a command (similar to sed’s) to perform substitution operations over a range of lines or an entire file. To change the word “old” to “young” for the entire file, we must enter the following command. + + :%s/old/young/g + +**Notice**: The colon at the beginning of the command. + +![Vi Search and Replace](http://www.tecmint.com/wp-content/uploads/2014/10/vi-search-and-replace.png) + +Vi Search and Replace + +The colon (:) starts the ex command, s in this case (for substitution), % is a shortcut meaning from the first line to the last line (the range can also be specified as n,m which means “from line n to line m”), old is the search pattern, while young is the replacement text, and g indicates that the substitution should be performed on every occurrence of the search string in the file. + +Alternatively, a c can be added to the end of the command to ask for confirmation before performing any substitution. + + :%s/old/young/gc + +Before replacing the original text with the new one, vi/m will present us with the following message. + +![Replace String in Vi](http://www.tecmint.com/wp-content/uploads/2014/10/vi-replace-old-with-young.png) + +Replace String in Vi + +- y: perform the substitution (yes) +- n: skip this occurrence and go to the next one (no) +- a: perform the substitution in this and all subsequent instances of the pattern. +- q or Esc: quit substituting. +- l (lowercase L): perform this substitution and quit (last). +- Ctrl-e, Ctrl-y: Scroll down and up, respectively, to view the context of the proposed substitution. + +#### Editing Multiple Files at a Time #### + +Let’s type vim file1 file2 file3 in our command prompt. + + # vim file1 file2 file3 + +First, vim will open file1. To switch to the next file (file2), we need to use the :n command. When we want to return to the previous file, :N will do the job. + +In order to switch from file1 to file3. + +a). The :buffers command will show a list of the file currently being edited. + + :buffers + +![Edit Multiple Files](http://www.tecmint.com/wp-content/uploads/2014/10/vi-edit-multiple-files.png) + +Edit Multiple Files + +b). The command :buffer 3 (without the s at the end) will open file3 for editing. + +In the image above, a pound sign (#) indicates that the file is currently open but in the background, while %a marks the file that is currently being edited. On the other hand, a blank space after the file number (3 in the above example) indicates that the file has not yet been opened. + +#### Temporary vi buffers #### + +To copy a couple of consecutive lines (let’s say 4, for example) into a temporary buffer named a (not associated with a file) and place those lines in another part of the file later in the current vi section, we need to… + +1. Press the ESC key to be sure we are in vi Command mode. + +2. Place the cursor on the first line of the text we wish to copy. + +3. Type “a4yy to copy the current line, along with the 3 subsequent lines, into a buffer named a. We can continue editing our file – we do not need to insert the copied lines immediately. + +4. When we reach the location for the copied lines, use “a before the p or P commands to insert the lines copied into the buffer named a: + +- Type “ap to insert the lines copied into buffer a after the current line on which the cursor is resting. +- Type “aP to insert the lines copied into buffer a before the current line. + +If we wish, we can repeat the above steps to insert the contents of buffer a in multiple places in our file. A temporary buffer, as the one in this section, is disposed when the current window is closed. + +### Summary ### + +As we have seen, vi/m is a powerful and versatile text editor for the CLI. Feel free to share your own tricks and comments below. + +#### Reference Links #### + +- [About the LFCS][1] +- [Why get a Linux Foundation Certification?][2] +- [Register for the LFCS exam][3] + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/vi-editor-usage/ + +作者:[Gabriel Cánepa][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/gacanepa/ +[1]:https://training.linuxfoundation.org/certification/LFCS +[2]:https://training.linuxfoundation.org/certification/why-certify-with-us +[3]:https://identity.linuxfoundation.org/user?destination=pid/1 \ No newline at end of file diff --git a/sources/tech/LFCS/Part 3 - LFCS--How to Archive or Compress Files and Directories Setting File Attributes and Finding Files in Linux.md b/sources/tech/LFCS/Part 3 - LFCS--How to Archive or Compress Files and Directories Setting File Attributes and Finding Files in Linux.md new file mode 100644 index 0000000000..6ac3d104a0 --- /dev/null +++ b/sources/tech/LFCS/Part 3 - LFCS--How to Archive or Compress Files and Directories Setting File Attributes and Finding Files in Linux.md @@ -0,0 +1,382 @@ +Part 3 - LFCS: How to Archive/Compress Files & Directories, Setting File Attributes and Finding Files in Linux +================================================================================ +Recently, the Linux Foundation started the LFCS (Linux Foundation Certified Sysadmin) certification, a brand new program whose purpose is allowing individuals from all corners of the globe to have access to an exam, which if approved, certifies that the person is knowledgeable in performing basic to intermediate system administration tasks on Linux systems. This includes supporting already running systems and services, along with first-level troubleshooting and analysis, plus the ability to decide when to escalate issues to engineering teams. + +![Linux Foundation Certified Sysadmin – Part 3](http://www.tecmint.com/wp-content/uploads/2014/10/lfcs-Part-3.png) + +Linux Foundation Certified Sysadmin – Part 3 + +Please watch the below video that gives the idea about The Linux Foundation Certification Program. + +注:youtube 视频 + + +This post is Part 3 of a 10-tutorial series, here in this part, we will cover how to archive/compress files and directories, set file attributes, and find files on the filesystem, that are required for the LFCS certification exam. + +### Archiving and Compression Tools ### + +A file archiving tool groups a set of files into a single standalone file that we can backup to several types of media, transfer across a network, or send via email. The most frequently used archiving utility in Linux is tar. When an archiving utility is used along with a compression tool, it allows to reduce the disk size that is needed to store the same files and information. + +#### The tar utility #### + +tar bundles a group of files together into a single archive (commonly called a tar file or tarball). The name originally stood for tape archiver, but we must note that we can use this tool to archive data to any kind of writeable media (not only to tapes). Tar is normally used with a compression tool such as gzip, bzip2, or xz to produce a compressed tarball. + +**Basic syntax:** + + # tar [options] [pathname ...] + +Where … represents the expression used to specify which files should be acted upon. + +#### Most commonly used tar commands #### + +注:表格 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Long optionAbbreviationDescription
 –create c Creates a tar archive
 –concatenate A Appends tar files to an archive
 –append r Appends files to the end of an archive
 –update u Appends files newer than copy in archive
 –diff or –compare d Find differences between archive and file system
 –file archive f Use archive file or device ARCHIVE
 –list t Lists the contents of a tarball
 –extract or –get x Extracts files from an archive
+ +#### Normally used operation modifiers #### + +注:表格 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Long optionAbbreviationDescription
 –directory dir C Changes to directory dir before performing operations
 –same-permissions p Preserves original permissions
 –verbose v Lists all files read or extracted. When this flag is used along with –list, the file sizes, ownership, and time stamps are displayed.
 –verify W Verifies the archive after writing it
 –exclude file — Excludes file from the archive
 –exclude=pattern X Exclude files, given as a PATTERN
 –gzip or –gunzip z Processes an archive through gzip
 –bzip2 j Processes an archive through bzip2
 –xz J Processes an archive through xz
+ +Gzip is the oldest compression tool and provides the least compression, while bzip2 provides improved compression. In addition, xz is the newest but (usually) provides the best compression. This advantages of best compression come at a price: the time it takes to complete the operation, and system resources used during the process. + +Normally, tar files compressed with these utilities have .gz, .bz2, or .xz extensions, respectively. In the following examples we will be using these files: file1, file2, file3, file4, and file5. + +**Grouping and compressing with gzip, bzip2 and xz** + +Group all the files in the current working directory and compress the resulting bundle with gzip, bzip2, and xz (please note the use of a regular expression to specify which files should be included in the bundle – this is to prevent the archiving tool to group the tarballs created in previous steps). + + # tar czf myfiles.tar.gz file[0-9] + # tar cjf myfiles.tar.bz2 file[0-9] + # tar cJf myfile.tar.xz file[0-9] + +![Compress Multiple Files Using tar](http://www.tecmint.com/wp-content/uploads/2014/10/Compress-Multiple-Files.png) + +Compress Multiple Files + +**Listing the contents of a tarball and updating / appending files to the bundle** + +List the contents of a tarball and display the same information as a long directory listing. Note that update or append operations cannot be applied to compressed files directly (if you need to update or append a file to a compressed tarball, you need to uncompress the tar file and update / append to it, then compress again). + + # tar tvf [tarball] + +![Check Files in tar Archive](http://www.tecmint.com/wp-content/uploads/2014/10/List-Archive-Content.png) + +List Archive Content + +Run any of the following commands: + + # gzip -d myfiles.tar.gz [#1] + # bzip2 -d myfiles.tar.bz2 [#2] + # xz -d myfiles.tar.xz [#3] + +Then + + # tar --delete --file myfiles.tar file4 (deletes the file inside the tarball) + # tar --update --file myfiles.tar file4 (adds the updated file) + +and + + # gzip myfiles.tar [ if you choose #1 above ] + # bzip2 myfiles.tar [ if you choose #2 above ] + # xz myfiles.tar [ if you choose #3 above ] + +Finally, + + # tar tvf [tarball] #again + +and compare the modification date and time of file4 with the same information as shown earlier. + +**Excluding file types** + +Suppose you want to perform a backup of user’s home directories. A good sysadmin practice would be (may also be specified by company policies) to exclude all video and audio files from backups. + +Maybe your first approach would be to exclude from the backup all files with an .mp3 or .mp4 extension (or other extensions). What if you have a clever user who can change the extension to .txt or .bkp, your approach won’t do you much good. In order to detect an audio or video file, you need to check its file type with file. The following shell script will do the job. + + #!/bin/bash + # Pass the directory to backup as first argument. + DIR=$1 + # Create the tarball and compress it. Exclude files with the MPEG string in its file type. + # -If the file type contains the string mpeg, $? (the exit status of the most recently executed command) expands to 0, and the filename is redirected to the exclude option. Otherwise, it expands to 1. + # -If $? equals 0, add the file to the list of files to be backed up. + tar X <(for i in $DIR/*; do file $i | grep -i mpeg; if [ $? -eq 0 ]; then echo $i; fi;done) -cjf backupfile.tar.bz2 $DIR/* + +![Exclude Files in tar Archive](http://www.tecmint.com/wp-content/uploads/2014/10/Exclude-Files-in-Tar.png) + +Exclude Files in tar + +**Restoring backups with tar preserving permissions** + +You can then restore the backup to the original user’s home directory (user_restore in this example), preserving permissions, with the following command. + + # tar xjf backupfile.tar.bz2 --directory user_restore --same-permissions + +![Restore Files from tar Archive](http://www.tecmint.com/wp-content/uploads/2014/10/Restore-tar-Backup-Files.png) + +Restore Files from Archive + +**Read Also:** + +- [18 tar Command Examples in Linux][1] +- [Dtrx – An Intelligent Archive Tool for Linux][2] + +### Using find Command to Search for Files ### + +The find command is used to search recursively through directory trees for files or directories that match certain characteristics, and can then either print the matching files or directories or perform other operations on the matches. + +Normally, we will search by name, owner, group, type, permissions, date, and size. + +#### Basic syntax: #### + +# find [directory_to_search] [expression] + +**Finding files recursively according to Size** + +Find all files (-f) in the current directory (.) and 2 subdirectories below (-maxdepth 3 includes the current working directory and 2 levels down) whose size (-size) is greater than 2 MB. + + # find . -maxdepth 3 -type f -size +2M + +![Find Files by Size in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Find-Files-Based-on-Size.png) + +Find Files Based on Size + +**Finding and deleting files that match a certain criteria** + +Files with 777 permissions are sometimes considered an open door to external attackers. Either way, it is not safe to let anyone do anything with files. We will take a rather aggressive approach and delete them! (‘{}‘ + is used to “collect” the results of the search). + + # find /home/user -perm 777 -exec rm '{}' + + +![Find all 777 Permission Files](http://www.tecmint.com/wp-content/uploads/2014/10/Find-Files-with-777-Permission.png) + +Find Files with 777Permission + +**Finding files per atime or mtime** + +Search for configuration files in /etc that have been accessed (-atime) or modified (-mtime) more (+180) or less (-180) than 6 months ago or exactly 6 months ago (180). + +Modify the following command as per the example below: + + # find /etc -iname "*.conf" -mtime -180 -print + +![Find Files by Modification Time](http://www.tecmint.com/wp-content/uploads/2014/10/Find-Modified-Files.png) + +Find Modified Files + +- Read Also: [35 Practical Examples of Linux ‘find’ Command][3] + +### File Permissions and Basic Attributes ### + +The first 10 characters in the output of ls -l are the file attributes. The first of these characters is used to indicate the file type: + +- – : a regular file +- -d : a directory +- -l : a symbolic link +- -c : a character device (which treats data as a stream of bytes, i.e. a terminal) +- -b : a block device (which handles data in blocks, i.e. storage devices) + +The next nine characters of the file attributes are called the file mode and represent the read (r), write (w), and execute (x) permissions of the file’s owner, the file’s group owner, and the rest of the users (commonly referred to as “the world”). + +Whereas the read permission on a file allows the same to be opened and read, the same permission on a directory allows its contents to be listed if the execute permission is also set. In addition, the execute permission in a file allows it to be handled as a program and run, while in a directory it allows the same to be cd’ed into it. + +File permissions are changed with the chmod command, whose basic syntax is as follows: + + # chmod [new_mode] file + +Where new_mode is either an octal number or an expression that specifies the new permissions. + +The octal number can be converted from its binary equivalent, which is calculated from the desired file permissions for the owner, the group, and the world, as follows: + +The presence of a certain permission equals a power of 2 (r=22, w=21, x=20), while its absence equates to 0. For example: + +![Linux File Permissions](http://www.tecmint.com/wp-content/uploads/2014/10/File-Permissions.png) + +File Permissions + +To set the file’s permissions as above in octal form, type: + + # chmod 744 myfile + +You can also set a file’s mode using an expression that indicates the owner’s rights with the letter u, the group owner’s rights with the letter g, and the rest with o. All of these “individuals” can be represented at the same time with the letter a. Permissions are granted (or revoked) with the + or – signs, respectively. + +**Revoking execute permission for a shell script to all users** + +As we explained earlier, we can revoke a certain permission prepending it with the minus sign and indicating whether it needs to be revoked for the owner, the group owner, or all users. The one-liner below can be interpreted as follows: Change mode for all (a) users, revoke (–) execute permission (x). + + # chmod a-x backup.sh + +Granting read, write, and execute permissions for a file to the owner and group owner, and read permissions for the world. + +When we use a 3-digit octal number to set permissions for a file, the first digit indicates the permissions for the owner, the second digit for the group owner and the third digit for everyone else: + +- Owner: (r=22 + w=21 + x=20 = 7) +- Group owner: (r=22 + w=21 + x=20 = 7) +- World: (r=22 + w=0 + x=0 = 4), + + # chmod 774 myfile + +In time, and with practice, you will be able to decide which method to change a file mode works best for you in each case. A long directory listing also shows the file’s owner and its group owner (which serve as a rudimentary yet effective access control to files in a system): + +![Linux File Listing](http://www.tecmint.com/wp-content/uploads/2014/10/Linux-File-Listing.png) + +Linux File Listing + +File ownership is changed with the chown command. The owner and the group owner can be changed at the same time or separately. Its basic syntax is as follows: + + # chown user:group file + +Where at least user or group need to be present. + +**Few Examples** + +Changing the owner of a file to a certain user. + + # chown gacanepa sent + +Changing the owner and group of a file to an specific user:group pair. + + # chown gacanepa:gacanepa TestFile + +Changing only the group owner of a file to a certain group. Note the colon before the group’s name. + + # chown :gacanepa email_body.txt + +### Conclusion ### + +As a sysadmin, you need to know how to create and restore backups, how to find files in your system and change their attributes, along with a few tricks that can make your life easier and will prevent you from running into future issues. + +I hope that the tips provided in the present article will help you to achieve that goal. Feel free to add your own tips and ideas in the comments section for the benefit of the community. Thanks in advance! +Reference Links + +- [About the LFCS][4] +- [Why get a Linux Foundation Certification?][5] +- [Register for the LFCS exam][6] + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/compress-files-and-finding-files-in-linux/ + +作者:[Gabriel Cánepa][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/gacanepa/ +[1]:http://www.tecmint.com/18-tar-command-examples-in-linux/ +[2]:http://www.tecmint.com/dtrx-an-intelligent-archive-extraction-tar-zip-cpio-rpm-deb-rar-tool-for-linux/ +[3]:http://www.tecmint.com/35-practical-examples-of-linux-find-command/ +[4]:https://training.linuxfoundation.org/certification/LFCS +[5]:https://training.linuxfoundation.org/certification/why-certify-with-us +[6]:https://identity.linuxfoundation.org/user?destination=pid/1 \ No newline at end of file diff --git a/sources/tech/LFCS/Part 4 - LFCS--Partitioning Storage Devices Formatting Filesystems and Configuring Swap Partition.md b/sources/tech/LFCS/Part 4 - LFCS--Partitioning Storage Devices Formatting Filesystems and Configuring Swap Partition.md new file mode 100644 index 0000000000..ada637fabb --- /dev/null +++ b/sources/tech/LFCS/Part 4 - LFCS--Partitioning Storage Devices Formatting Filesystems and Configuring Swap Partition.md @@ -0,0 +1,191 @@ +Part 4 - LFCS: Partitioning Storage Devices, Formatting Filesystems and Configuring Swap Partition +================================================================================ +Last August, the Linux Foundation launched the LFCS certification (Linux Foundation Certified Sysadmin), a shiny chance for system administrators to show, through a performance-based exam, that they can perform overall operational support of Linux systems: system support, first-level diagnosing and monitoring, plus issue escalation – if needed – to other support teams. + +![Linux Foundation Certified Sysadmin – Part 4](http://www.tecmint.com/wp-content/uploads/2014/10/lfcs-Part-4.png) + +Linux Foundation Certified Sysadmin – Part 4 + +Please aware that Linux Foundation certifications are precise, totally based on performance and available through an online portal anytime, anywhere. Thus, you no longer have to travel to a examination center to get the certifications you need to establish your skills and expertise. + +Please watch the below video that explains The Linux Foundation Certification Program. + +注:youtube 视频 + + +This post is Part 4 of a 10-tutorial series, here in this part, we will cover the Partitioning storage devices, Formatting filesystems and Configuring swap partition, that are required for the LFCS certification exam. + +### Partitioning Storage Devices ### + +Partitioning is a means to divide a single hard drive into one or more parts or “slices” called partitions. A partition is a section on a drive that is treated as an independent disk and which contains a single type of file system, whereas a partition table is an index that relates those physical sections of the hard drive to partition identifications. + +In Linux, the traditional tool for managing MBR partitions (up to ~2009) in IBM PC compatible systems is fdisk. For GPT partitions (~2010 and later) we will use gdisk. Each of these tools can be invoked by typing its name followed by a device name (such as /dev/sdb). + +#### Managing MBR Partitions with fdisk #### + +We will cover fdisk first. + + # fdisk /dev/sdb + +A prompt appears asking for the next operation. If you are unsure, you can press the ‘m‘ key to display the help contents. + +![fdisk Help Menu](http://www.tecmint.com/wp-content/uploads/2014/10/fdisk-help.png) + +fdisk Help Menu + +In the above image, the most frequently used options are highlighted. At any moment, you can press ‘p‘ to display the current partition table. + +![Check Partition Table in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Show-Partition-Table.png) + +Show Partition Table + +The Id column shows the partition type (or partition id) that has been assigned by fdisk to the partition. A partition type serves as an indicator of the file system, the partition contains or, in simple words, the way data will be accessed in that partition. + +Please note that a comprehensive study of each partition type is out of the scope of this tutorial – as this series is focused on the LFCS exam, which is performance-based. + +**Some of the options used by fdisk as follows:** + +You can list all the partition types that can be managed by fdisk by pressing the ‘l‘ option (lowercase l). + +Press ‘d‘ to delete an existing partition. If more than one partition is found in the drive, you will be asked which one should be deleted. + +Enter the corresponding number, and then press ‘w‘ (write modifications to partition table) to apply changes. + +In the following example, we will delete /dev/sdb2, and then print (p) the partition table to verify the modifications. + +![fdisk Command Options](http://www.tecmint.com/wp-content/uploads/2014/10/fdisk-options.png) + +fdisk Command Options + +Press ‘n‘ to create a new partition, then ‘p‘ to indicate it will be a primary partition. Finally, you can accept all the default values (in which case the partition will occupy all the available space), or specify a size as follows. + +![Create New Partition in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Create-New-Partition.png) + +Create New Partition + +If the partition Id that fdisk chose is not the right one for our setup, we can press ‘t‘ to change it. + +![Change Partition Name in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Change-Partition-Name.png) + +Change Partition Name + +When you’re done setting up the partitions, press ‘w‘ to commit the changes to disk. + +![Save Partition Changes](http://www.tecmint.com/wp-content/uploads/2014/10/Save-Partition-Changes.png) + +Save Partition Changes + +#### Managing GPT Partitions with gdisk #### + +In the following example, we will use /dev/sdb. + + # gdisk /dev/sdb + +We must note that gdisk can be used either to create MBR or GPT partitions. + +![Create GPT Partitions in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Create-GPT-Partitions.png) + +Create GPT Partitions + +The advantage of using GPT partitioning is that we can create up to 128 partitions in the same disk whose size can be up to the order of petabytes, whereas the maximum size for MBR partitions is 2 TB. + +Note that most of the options in fdisk are the same in gdisk. For that reason, we will not go into detail about them, but here’s a screenshot of the process. + +![gdisk Command Options](http://www.tecmint.com/wp-content/uploads/2014/10/gdisk-options.png) + +gdisk Command Options + +### Formatting Filesystems ### + +Once we have created all the necessary partitions, we must create filesystems. To find out the list of filesystems supported in your system, run. + + # ls /sbin/mk* + +![Check Filesystems Type in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Check-Filesystems.png) + +Check Filesystems Type + +The type of filesystem that you should choose depends on your requirements. You should consider the pros and cons of each filesystem and its own set of features. Two important attributes to look for in a filesystem are. + +- Journaling support, which allows for faster data recovery in the event of a system crash. +- Security Enhanced Linux (SELinux) support, as per the project wiki, “a security enhancement to Linux which allows users and administrators more control over access control”. + +In our next example, we will create an ext4 filesystem (supports both journaling and SELinux) labeled Tecmint on /dev/sdb1, using mkfs, whose basic syntax is. + + # mkfs -t [filesystem] -L [label] device + or + # mkfs.[filesystem] -L [label] device + +![Create ext4 Filesystems in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Create-ext4-Filesystems.png) + +Create ext4 Filesystems + +### Creating and Using Swap Partitions ### + +Swap partitions are necessary if we need our Linux system to have access to virtual memory, which is a section of the hard disk designated for use as memory, when the main system memory (RAM) is all in use. For that reason, a swap partition may not be needed on systems with enough RAM to meet all its requirements; however, even in that case it’s up to the system administrator to decide whether to use a swap partition or not. + +A simple rule of thumb to decide the size of a swap partition is as follows. + +Swap should usually equal 2x physical RAM for up to 2 GB of physical RAM, and then an additional 1x physical RAM for any amount above 2 GB, but never less than 32 MB. + +So, if: + +M = Amount of RAM in GB, and S = Amount of swap in GB, then + + If M < 2 + S = M *2 + Else + S = M + 2 + +Remember this is just a formula and that only you, as a sysadmin, have the final word as to the use and size of a swap partition. + +To configure a swap partition, create a regular partition as demonstrated earlier with the desired size. Next, we need to add the following entry to the /etc/fstab file (X can be either b or c). + + /dev/sdX1 swap swap sw 0 0 + +Finally, let’s format and enable the swap partition. + + # mkswap /dev/sdX1 + # swapon -v /dev/sdX1 + +To display a snapshot of the swap partition(s). + + # cat /proc/swaps + +To disable the swap partition. + + # swapoff /dev/sdX1 + +For the next example, we’ll use /dev/sdc1 (=512 MB, for a system with 256 MB of RAM) to set up a partition with fdisk that we will use as swap, following the steps detailed above. Note that we will specify a fixed size in this case. + +![Create-Swap-Partition in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Create-Swap-Partition.png) + +Create Swap Partition + +![Add Swap Partition in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Enable-Swap-Partition.png) + +Enable Swap Partition + +### Conclusion ### + +Creating partitions (including swap) and formatting filesystems are crucial in your road to Sysadminship. I hope that the tips given in this article will guide you to achieve your goals. Feel free to add your own tips & ideas in the comments section below, for the benefit of the community. +Reference Links + +- [About the LFCS][1] +- [Why get a Linux Foundation Certification?][2] +- [Register for the LFCS exam][3] + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/create-partitions-and-filesystems-in-linux/ + +作者:[Gabriel Cánepa][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/gacanepa/ +[1]:https://training.linuxfoundation.org/certification/LFCS +[2]:https://training.linuxfoundation.org/certification/why-certify-with-us +[3]:https://identity.linuxfoundation.org/user?destination=pid/1 \ No newline at end of file diff --git a/sources/tech/LFCS/Part 5 - LFCS--How to Mount or Unmount Local and Network Samba and NFS Filesystems in Linux.md b/sources/tech/LFCS/Part 5 - LFCS--How to Mount or Unmount Local and Network Samba and NFS Filesystems in Linux.md new file mode 100644 index 0000000000..1544a378bc --- /dev/null +++ b/sources/tech/LFCS/Part 5 - LFCS--How to Mount or Unmount Local and Network Samba and NFS Filesystems in Linux.md @@ -0,0 +1,232 @@ +Part 5 - LFCS: How to Mount/Unmount Local and Network (Samba & NFS) Filesystems in Linux +================================================================================ +The Linux Foundation launched the LFCS certification (Linux Foundation Certified Sysadmin), a brand new program whose purpose is allowing individuals from all corners of the globe to get certified in basic to intermediate system administration tasks for Linux systems, which includes supporting running systems and services, along with overall monitoring and analysis, plus smart decision-making when it comes to raising issues to upper support teams. + +![Linux Foundation Certified Sysadmin – Part 5](http://www.tecmint.com/wp-content/uploads/2014/10/lfcs-Part-5.png) + +Linux Foundation Certified Sysadmin – Part 5 + +The following video shows an introduction to The Linux Foundation Certification Program. + +注:youtube 视频 + + +This post is Part 5 of a 10-tutorial series, here in this part, we will explain How to mount/unmount local and network filesystems in linux, that are required for the LFCS certification exam. + +### Mounting Filesystems ### + +Once a disk has been partitioned, Linux needs some way to access the data on the partitions. Unlike DOS or Windows (where this is done by assigning a drive letter to each partition), Linux uses a unified directory tree where each partition is mounted at a mount point in that tree. + +A mount point is a directory that is used as a way to access the filesystem on the partition, and mounting the filesystem is the process of associating a certain filesystem (a partition, for example) with a specific directory in the directory tree. + +In other words, the first step in managing a storage device is attaching the device to the file system tree. This task can be accomplished on a one-time basis by using tools such as mount (and then unmounted with umount) or persistently across reboots by editing the /etc/fstab file. + +The mount command (without any options or arguments) shows the currently mounted filesystems. + + # mount + +![Check Mounted Filesystem in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/check-mounted-filesystems.png) + +Check Mounted Filesystem + +In addition, mount is used to mount filesystems into the filesystem tree. Its standard syntax is as follows. + + # mount -t type device dir -o options + +This command instructs the kernel to mount the filesystem found on device (a partition, for example, that has been formatted with a filesystem type) at the directory dir, using all options. In this form, mount does not look in /etc/fstab for instructions. + +If only a directory or device is specified, for example. + + # mount /dir -o options + or + # mount device -o options + +mount tries to find a mount point and if it can’t find any, then searches for a device (both cases in the /etc/fstab file), and finally attempts to complete the mount operation (which usually succeeds, except for the case when either the directory or the device is already being used, or when the user invoking mount is not root). + +You will notice that every line in the output of mount has the following format. + + device on directory type (options) + +For example, + + /dev/mapper/debian-home on /home type ext4 (rw,relatime,user_xattr,barrier=1,data=ordered) + +Reads: + +dev/mapper/debian-home is mounted on /home, which has been formatted as ext4, with the following options: rw,relatime,user_xattr,barrier=1,data=ordered + +**Mount Options** + +Most frequently used mount options include. + +- async: allows asynchronous I/O operations on the file system being mounted. +- auto: marks the file system as enabled to be mounted automatically using mount -a. It is the opposite of noauto. +- defaults: this option is an alias for async,auto,dev,exec,nouser,rw,suid. Note that multiple options must be separated by a comma without any spaces. If by accident you type a space between options, mount will interpret the subsequent text string as another argument. +- loop: Mounts an image (an .iso file, for example) as a loop device. This option can be used to simulate the presence of the disk’s contents in an optical media reader. +- noexec: prevents the execution of executable files on the particular filesystem. It is the opposite of exec. +- nouser: prevents any users (other than root) to mount and unmount the filesystem. It is the opposite of user. +- remount: mounts the filesystem again in case it is already mounted. +- ro: mounts the filesystem as read only. +- rw: mounts the file system with read and write capabilities. +- relatime: makes access time to files be updated only if atime is earlier than mtime. +- user_xattr: allow users to set and remote extended filesystem attributes. + +**Mounting a device with ro and noexec options** + + # mount -t ext4 /dev/sdg1 /mnt -o ro,noexec + +In this case we can see that attempts to write a file to or to run a binary file located inside our mounting point fail with corresponding error messages. + + # touch /mnt/myfile + # /mnt/bin/echo “Hi there” + +![Mount Device in Read Write Mode](http://www.tecmint.com/wp-content/uploads/2014/10/Mount-Device-Read-Write.png) + +Mount Device Read Write + +**Mounting a device with default options** + +In the following scenario, we will try to write a file to our newly mounted device and run an executable file located within its filesystem tree using the same commands as in the previous example. + + # mount -t ext4 /dev/sdg1 /mnt -o defaults + +![Mount Device in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Mount-Device.png) + +Mount Device + +In this last case, it works perfectly. + +### Unmounting Devices ### + +Unmounting a device (with the umount command) means finish writing all the remaining “on transit” data so that it can be safely removed. Note that if you try to remove a mounted device without properly unmounting it first, you run the risk of damaging the device itself or cause data loss. + +That being said, in order to unmount a device, you must be “standing outside” its block device descriptor or mount point. In other words, your current working directory must be something else other than the mounting point. Otherwise, you will get a message saying that the device is busy. + +![Unmount Device in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Unmount-Device.png) + +Unmount Device + +An easy way to “leave” the mounting point is typing the cd command which, in lack of arguments, will take us to our current user’s home directory, as shown above. + +### Mounting Common Networked Filesystems ### + +The two most frequently used network file systems are SMB (which stands for “Server Message Block”) and NFS (“Network File System”). Chances are you will use NFS if you need to set up a share for Unix-like clients only, and will opt for Samba if you need to share files with Windows-based clients and perhaps other Unix-like clients as well. + +Read Also + +- [Setup Samba Server in RHEL/CentOS and Fedora][1] +- [Setting up NFS (Network File System) on RHEL/CentOS/Fedora and Debian/Ubuntu][2] + +The following steps assume that Samba and NFS shares have already been set up in the server with IP 192.168.0.10 (please note that setting up a NFS share is one of the competencies required for the LFCE exam, which we will cover after the present series). + +#### Mounting a Samba share on Linux #### + +Step 1: Install the samba-client samba-common and cifs-utils packages on Red Hat and Debian based distributions. + + # yum update && yum install samba-client samba-common cifs-utils + # aptitude update && aptitude install samba-client samba-common cifs-utils + +Then run the following command to look for available samba shares in the server. + + # smbclient -L 192.168.0.10 + +And enter the password for the root account in the remote machine. + +![Mount Samba Share in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Mount-Samba-Share.png) + +Mount Samba Share + +In the above image we have highlighted the share that is ready for mounting on our local system. You will need a valid samba username and password on the remote server in order to access it. + +Step 2: When mounting a password-protected network share, it is not a good idea to write your credentials in the /etc/fstab file. Instead, you can store them in a hidden file somewhere with permissions set to 600, like so. + + # mkdir /media/samba + # echo “username=samba_username” > /media/samba/.smbcredentials + # echo “password=samba_password” >> /media/samba/.smbcredentials + # chmod 600 /media/samba/.smbcredentials + +Step 3: Then add the following line to /etc/fstab file. + + # //192.168.0.10/gacanepa /media/samba cifs credentials=/media/samba/.smbcredentials,defaults 0 0 + +Step 4: You can now mount your samba share, either manually (mount //192.168.0.10/gacanepa) or by rebooting your machine so as to apply the changes made in /etc/fstab permanently. + +![Mount Password Protect Samba Share](http://www.tecmint.com/wp-content/uploads/2014/10/Mount-Password-Protect-Samba-Share.png) + +Mount Password Protect Samba Share + +#### Mounting a NFS share on Linux #### + +Step 1: Install the nfs-common and portmap packages on Red Hat and Debian based distributions. + + # yum update && yum install nfs-utils nfs-utils-lib + # aptitude update && aptitude install nfs-common + +Step 2: Create a mounting point for the NFS share. + + # mkdir /media/nfs + +Step 3: Add the following line to /etc/fstab file. + +192.168.0.10:/NFS-SHARE /media/nfs nfs defaults 0 0 + +Step 4: You can now mount your nfs share, either manually (mount 192.168.0.10:/NFS-SHARE) or by rebooting your machine so as to apply the changes made in /etc/fstab permanently. + +![Mount NFS Share in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Mount-NFS-Share.png) + +Mount NFS Share + +### Mounting Filesystems Permanently ### + +As shown in the previous two examples, the /etc/fstab file controls how Linux provides access to disk partitions and removable media devices and consists of a series of lines that contain six fields each; the fields are separated by one or more spaces or tabs. A line that begins with a hash mark (#) is a comment and is ignored. + +Each line has the following format. + + + +Where: + +- : The first column specifies the mount device. Most distributions now specify partitions by their labels or UUIDs. This practice can help reduce problems if partition numbers change. +- : The second column specifies the mount point. +- : The file system type code is the same as the type code used to mount a filesystem with the mount command. A file system type code of auto lets the kernel auto-detect the filesystem type, which can be a convenient option for removable media devices. Note that this option may not be available for all filesystems out there. +- : One (or more) mount option(s). +- : You will most likely leave this to 0 (otherwise set it to 1) to disable the dump utility to backup the filesystem upon boot (The dump program was once a common backup tool, but it is much less popular today.) +- : This column specifies whether the integrity of the filesystem should be checked at boot time with fsck. A 0 means that fsck should not check a filesystem. The higher the number, the lowest the priority. Thus, the root partition will most likely have a value of 1, while all others that should be checked should have a value of 2. + +**Mount Examples** + +1. To mount a partition with label TECMINT at boot time with rw and noexec attributes, you should add the following line in /etc/fstab file. + + LABEL=TECMINT /mnt ext4 rw,noexec 0 0 + +2. If you want the contents of a disk in your DVD drive be available at boot time. + + /dev/sr0 /media/cdrom0 iso9660 ro,user,noauto 0 0 + +Where /dev/sr0 is your DVD drive. + +### Summary ### + +You can rest assured that mounting and unmounting local and network filesystems from the command line will be part of your day-to-day responsibilities as sysadmin. You will also need to master /etc/fstab. I hope that you have found this article useful to help you with those tasks. Feel free to add your comments (or ask questions) below and to share this article through your network social profiles. +Reference Links + +- [About the LFCS][3] +- [Why get a Linux Foundation Certification?][4] +- [Register for the LFCS exam][5] + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/mount-filesystem-in-linux/ + +作者:[Gabriel Cánepa][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/gacanepa/ +[1]:http://www.tecmint.com/setup-samba-server-using-tdbsam-backend-on-rhel-centos-6-3-5-8-and-fedora-17-12/ +[2]:http://www.tecmint.com/how-to-setup-nfs-server-in-linux/ +[3]:https://training.linuxfoundation.org/certification/LFCS +[4]:https://training.linuxfoundation.org/certification/why-certify-with-us +[5]:https://identity.linuxfoundation.org/user?destination=pid/1 \ No newline at end of file