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 001/507] 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 f9cd744a41862d2153ce9c3e53c168568d90899b Mon Sep 17 00:00:00 2001 From: ZTinoZ Date: Mon, 13 Jul 2015 11:39:33 +0800 Subject: [PATCH 002/507] 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 f210181ca95efbf33ffc870c1189ae1347d67794 Mon Sep 17 00:00:00 2001 From: ZTinoZ Date: Tue, 14 Jul 2015 17:54:06 +0800 Subject: [PATCH 003/507] 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 ddc0809059d70424748055b1a64f07721848dffa Mon Sep 17 00:00:00 2001 From: ZTinoZ Date: Wed, 15 Jul 2015 18:08:18 +0800 Subject: [PATCH 004/507] 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 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 005/507] 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 02812ef883af3ccb750c7592da8503154e4a43d8 Mon Sep 17 00:00:00 2001 From: ZTinoZ Date: Thu, 16 Jul 2015 15:49:52 +0800 Subject: [PATCH 006/507] 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 fc929cf5ac5a9a43b74e17eadb6280c9fb272bd6 Mon Sep 17 00:00:00 2001 From: chenjt Date: Thu, 16 Jul 2015 18:36:51 +0800 Subject: [PATCH 007/507] tmp commit --- ...st Using Docker Machine in a VirtualBox.md | 114 ++++++++++++++++++ 1 file changed, 114 insertions(+) create mode 100644 translated/tech/20150527 Howto Manage Host Using Docker Machine in a VirtualBox.md diff --git a/translated/tech/20150527 Howto Manage Host Using Docker Machine in a VirtualBox.md b/translated/tech/20150527 Howto Manage Host Using Docker Machine in a VirtualBox.md new file mode 100644 index 0000000000..64c044b100 --- /dev/null +++ b/translated/tech/20150527 Howto Manage Host Using Docker Machine in a VirtualBox.md @@ -0,0 +1,114 @@ +[bazz2] +在 VirtualBox 中使用 Docker Machine 管理主机 +================================================================================ +大家好,今天我们学习在 VirtualBox 中使用 Docker Machine 来创建和管理 Docker 主机。Docker Machine 是一个应用,用于在我们的电脑上、在云端、在数据中心创建 Docker 主机,然后用户可以使用 Docker 客户端来配置一些东西。这个 API 为本地主机、或数据中心的虚拟机、或云端的实例提供 Docker 服务。Docker Machine 支持 Windows、OSX 和 Linux,并且是以一个独立的二进制文件包形式安装的。使用(与现有 Docker 工具)相同的接口,我们就可以充分利用已经提供 Docker 基础框架的生态系统。只要一个命令,用户就能快速部署 Docker 容器。 + +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 From 706a3d48f481a0bc5292a8574590cad31d18a2a2 Mon Sep 17 00:00:00 2001 From: DeadFire Date: Fri, 17 Jul 2015 13:00:05 +0800 Subject: [PATCH 008/507] =?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 009/507] =?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 010/507] =?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 011/507] =?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 012/507] 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 013/507] [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 014/507] 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 015/507] 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 016/507] 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 017/507] =?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 018/507] 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 019/507] =?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 020/507] 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 021/507] 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 022/507] =?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 056/507] 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 057/507] 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 058/507] [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 059/507] 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 060/507] 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 061/507] 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 062/507] [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 063/507] 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 064/507] =?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 065/507] [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 066/507] [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 067/507] 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 068/507] 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 069/507] 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 070/507] 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 071/507] =?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 072/507] 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 073/507] 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 074/507] [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 075/507] 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 076/507] 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 077/507] 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 078/507] 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 079/507] 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 080/507] [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 081/507] [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 082/507] [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 083/507] [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 084/507] [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 085/507] 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 086/507] [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 087/507] 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 088/507] 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 089/507] [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 090/507] 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 091/507] 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 092/507] 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 093/507] 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 094/507] 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 095/507] 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 096/507] 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 097/507] 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 098/507] [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 099/507] 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 100/507] 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 101/507] 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 102/507] =?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 103/507] [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 104/507] 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 105/507] 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 106/507] 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 107/507] =?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 108/507] =?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 109/507] =?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 110/507] 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 111/507] =?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 112/507] =?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 113/507] 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 114/507] [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 115/507] 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 116/507] 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 117/507] [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 118/507] 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 119/507] [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 120/507] 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 121/507] 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 122/507] 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 123/507] =?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 124/507] =?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 125/507] =?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 126/507] =?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 127/507] 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 128/507] 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 129/507] [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 130/507] 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 131/507] 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 132/507] 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 133/507] 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 134/507] 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 135/507] 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 136/507] [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 137/507] 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 138/507] =?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 139/507] 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 140/507] [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 141/507] 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 142/507] 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 143/507] 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 144/507] 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 145/507] =?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 146/507] 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 147/507] 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 148/507] [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 149/507] 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 150/507] 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 151/507] 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 152/507] =?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 153/507] =?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 154/507] =?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 155/507] =?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 156/507] =?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 157/507] 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 158/507] =?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 159/507] 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 160/507] 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 161/507] 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 162/507] 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 163/507] =?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 164/507] =?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 165/507] =?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 166/507] =?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 167/507] 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 168/507] 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 169/507] 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 170/507] =?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 171/507] 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 172/507] 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 173/507] [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 174/507] [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 175/507] =?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 176/507] =?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 177/507] 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 178/507] 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 179/507] 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 180/507] 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 181/507] 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 182/507] =?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 183/507] 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 184/507] 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 185/507] =?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 186/507] =?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 187/507] 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 188/507] =?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 189/507] =?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 190/507] =?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 191/507] 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 192/507] 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 193/507] =?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 194/507] =?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 195/507] =?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 196/507] 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 197/507] =?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 198/507] 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 199/507] =?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 200/507] 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 201/507] =?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 202/507] =?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 203/507] =?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 204/507] 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 205/507] 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 206/507] 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 207/507] 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 208/507] =?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 209/507] =?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 210/507] [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 211/507] 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 212/507] 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 213/507] =?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 214/507] =?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 215/507] 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 216/507] =?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 217/507] =?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 218/507] =?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 219/507] =?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 220/507] 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 221/507] =?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 222/507] =?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 223/507] 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 224/507] =?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 225/507] 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 226/507] 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 227/507] 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 228/507] 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 229/507] 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 230/507] 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 231/507] =?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 232/507] [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 233/507] 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 234/507] 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 235/507] 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 236/507] [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 237/507] 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 238/507] 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 239/507] 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 240/507] =?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 241/507] [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 242/507] 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 243/507] 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 244/507] 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 245/507] 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 246/507] 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 247/507] =?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 248/507] =?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 249/507] 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 250/507] [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 251/507] 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 252/507] 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 253/507] 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 254/507] 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 255/507] 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 256/507] [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 257/507] 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 258/507] 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 259/507] 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 260/507] 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 261/507] =?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 262/507] =?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 263/507] 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 264/507] [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 265/507] 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 266/507] 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 267/507] 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 268/507] 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 269/507] 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 270/507] 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 271/507] 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 272/507] 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 273/507] =?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 274/507] 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 275/507] 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 276/507] 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 277/507] 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 278/507] [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 279/507] 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 280/507] 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 281/507] =?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 282/507] =?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 283/507] =?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 284/507] 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 285/507] [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 286/507] 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 287/507] =?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 288/507] =?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 289/507] [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 290/507] 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 291/507] =?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 292/507] 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 293/507] 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 294/507] 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 295/507] =?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 296/507] 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 297/507] =?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 298/507] 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 299/507] =?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 300/507] 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 301/507] 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 302/507] =?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 303/507] 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 304/507] 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 305/507] 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 306/507] 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 307/507] 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 308/507] [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 309/507] 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 310/507] 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 311/507] 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 312/507] 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 313/507] 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 314/507] 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 315/507] 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 316/507] 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 317/507] 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 318/507] 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 319/507] 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 320/507] [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 321/507] 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 9a5f4c41627956b74c3daaa6b1e2ee3e31bc0014 Mon Sep 17 00:00:00 2001 From: Ezio Date: Sat, 15 Aug 2015 15:31:15 +0800 Subject: [PATCH 322/507] Update 20150728 Process of the Linux kernel building.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 翻译了一部分,太长了 --- ...28 Process of the Linux kernel building.md | 23 ++++++++++++++++++- 1 file changed, 22 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 1c03ebbe72..f11c1cc7a2 100644 --- a/sources/tech/20150728 Process of the Linux kernel building.md +++ b/sources/tech/20150728 Process of the Linux kernel building.md @@ -1,26 +1,41 @@ Translating by Ezio Process of the Linux kernel building +如何构建Linux 内核的 ================================================================================ -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. +我不会告诉你怎么在自己的电脑上去构建、安装一个定制化的Linux 内核,这样的[资料](https://encrypted.google.com/search?q=building+linux+kernel#q=building+linux+kernel+from+source+code) 太多了,它们会对你有帮助。本文会告诉你当你在内核源码路径里敲下`make` 时会发生什么。当我刚刚开始学习内核代码时,[Makefile](https://github.com/torvalds/linux/blob/master/Makefile) 是我打开的第一个文件,这个文件真令人害怕 :)。那时候这个[Makefile](https://en.wikipedia.org/wiki/Make_%28software%29) 包含了`1591` 行代码,当我开始写本文是,这个[Makefile](https://github.com/torvalds/linux/commit/52721d9d3334c1cb1f76219a161084094ec634dc) 已经是第三个候选版本了。 + 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. +这个makefile 是Linux 内核代码的顶端makefile ,内核构件就始于此处。是的,它的内容很多,但是如果你已经读过内核源代码,你就会发现每个包含代码的目录都有一个自己的makefile。当然了,我们不会去描述每个代码文件是怎么编译链接的。所以我们将只会挑选一些通用的例子来说明问题,而你不会在这里找到构建内核的文档,如何整洁内核代码, [tags](https://en.wikipedia.org/wiki/Ctags) 的生成,和[交叉编译](https://en.wikipedia.org/wiki/Cross_compiler) 相关的说明,等等。我们将从`make` 开始,使用标准的内核配置文件,到生成了内核镜像[bzImage](https://en.wikipedia.org/wiki/Vmlinux#bzImage) 结束。 + +如果你已经很了解[make](https://en.wikipedia.org/wiki/Make_%28software%29) 工具那是最好,但是我也会描述本文出现的相关代码。 + +让我们开始吧 + + 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. +在开始便以前要进行很多准备工作。最主要的就是找到并配置好配置文件,`make` 命令要使用到的参数都需要从这些配置文件获取。 + 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` 负责构建两个主要的产品:[vmlinux](https://en.wikipedia.org/wiki/Vmlinux) (内核镜像可执行文件)和模块文件。内核的 [Makefile](https://github.com/torvalds/linux/blob/master/Makefile) 以次开始: + ```Makefile VERSION = 4 PATCHLEVEL = 2 @@ -31,12 +46,16 @@ 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: +这些变量决定了当前内核的版本,并且被使用在很多不同的地方,比如`KERNELVERSION` : + ```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: +接下来我们会看到很多`ifeq` 条件判断语句,它们负责检查传给`make` 的参数。内核的`Makefile` 提供了一个特殊的编译选项`make help` ,这个选项可以生成所有的可用目标和一些能传给`make` 的有效的命令行参数。举个例子,`make V=1` 会在构建过程中输出详细的编译信息,第一个`ifeq` 就是检查传递给make的`V=n` 选项。 + ```Makefile ifeq ("$(origin V)", "command line") KBUILD_VERBOSE = $(V) @@ -58,6 +77,8 @@ 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`: +如果`V=n` 这个选项传给了`make` ,系统就会给变量`KBUILD_VERBOSE` 选项附上`V` 的值,否则的话`KBUILD_VERBOSE` 就会为0。然后系统会检查`KBUILD_VERBOSE` 的值,以此来决定`quiet` 和`Q` 的值。符号`@` 控制命令的输出,如果它被放在一个命令之前,这条命令的执行将会是`CC scripts/mod/empty.o`,而不是`Compiling .... scripts/mod/empty.o`(注:CC 在makefile 中一般都是编译命令)。最后系统仅仅导出所有的变量。下一个`ifeq` 语句检查的是传递给`make` 的选项`O=/dir`,这个选项允许在指定的目录`dir` 输出所有的结果文件: + ```Makefile ifeq ($(KBUILD_SRC),) From 4452a5c19d27820e077a99971d68c633e4ae8818 Mon Sep 17 00:00:00 2001 From: ictlyh Date: Sat, 15 Aug 2015 16:25:13 +0800 Subject: [PATCH 323/507] [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 324/507] =?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 325/507] =?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 326/507] 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 327/507] 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 328/507] [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 329/507] 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 330/507] [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 331/507] 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 332/507] 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 333/507] 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 334/507] 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 335/507] 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 336/507] 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 337/507] =?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 338/507] =?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 339/507] 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 340/507] 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 341/507] 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 342/507] 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 343/507] 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 344/507] 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 345/507] 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 346/507] 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 b01218101e32a365db7a9f75ec47269e647aa4cd Mon Sep 17 00:00:00 2001 From: Ezio Date: Sun, 16 Aug 2015 13:13:39 +0800 Subject: [PATCH 347/507] Update 20150728 Process of the Linux kernel building.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 翻译到212line --- ...28 Process of the Linux kernel building.md | 24 ++++++++++++++++++- 1 file changed, 23 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 f11c1cc7a2..4191968e04 100644 --- a/sources/tech/20150728 Process of the Linux kernel building.md +++ b/sources/tech/20150728 Process of the Linux kernel building.md @@ -110,6 +110,14 @@ We check the `KBUILD_SRC` that represent top directory of the source code of the * 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: +系统会检查变量`KBUILD_SRC`,如果他是空的(第一次执行makefile 时总是空的),并且变量`KBUILD_OUTPUT` 被设成了选项`O` 的值(如果这个选项被传进来了),那么这个值就会用来代表内核源码的顶层目录。下一步会检查变量`KBUILD_OUTPUT` ,如果之前设置过这个变量,那么接下来会做一下几件事: + +* 将变量`KBUILD_OUTPUT` 的值保存到临时变量`saved-output`; +* 尝试创建输出目录; +* 检查创建的输出目录,如果失败了就打印错误; +* 如果成功创建了输出目录,那么就在新目录重新执行`make` 命令(参见选项`-C`)。 + +下一个`ifeq` 语句会检查传递给make 的选项`C` 和`M`: ```Makefile ifeq ("$(origin C)", "command line") @@ -126,6 +134,8 @@ 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 `.`: +第一个选项`C` 会告诉`makefile` 需要使用环境变量`$CHECK` 提供的工具来检查全部`c` 代码,默认情况下会使用[sparse](https://en.wikipedia.org/wiki/Sparse)。第二个选项`M` 会用来编译外部模块(本文不做讨论)。因为设置了这两个变量,系统还会检查变量`KBUILD_SRC`,如果`KBUILD_SRC` 没有被设置,系统会设置变量`srctree` 为`.`: + ```Makefile ifeq ($(KBUILD_SRC),) srctree := . @@ -138,7 +148,9 @@ 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: +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 setting value for the `SUBARCH` variable that will represent what the underlying archicecture is: + +这将会告诉`Makefile` 内核的源码树就在执行make 命令的目录。然后要设置`objtree` 和其他变量为执行make 命令的目录,并且将这些变量导出。接着就是要获取`SUBARCH` 的值,这个变量代表了当前的系统架构(注:一般值CPU 架构): ```Makefile SUBARCH := $(shell uname -m | sed -e s/i.86/x86/ -e s/x86_64/x86/ \ @@ -151,6 +163,8 @@ SUBARCH := $(shell uname -m | sed -e s/i.86/x86/ -e s/x86_64/x86/ \ 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: +如你所见,系统执行[uname](https://en.wikipedia.org/wiki/Uname) 得到机器、操作系统和架构的信息。因为我们得到的是`uname` 的输出,所以我们需要做一些处理在赋给变量`SUBARCH` 。获得`SUBARCH` 之后就要设置`SRCARCH` 和`hfr-arch`,`SRCARCH`提供了硬件架构相关代码的目录,`hfr-arch` 提供了相关头文件的目录: + ```Makefile ifeq ($(ARCH),i386) SRCARCH := x86 @@ -164,6 +178,8 @@ 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: +注意:`ARCH` 是`SUBARCH` 的别名。如果没有设置过代表内核配置文件路径的变量`KCONFIG_CONFIG`,下一步系统会设置他,默认情况下就是`.config` : + ```Makefile KCONFIG_CONFIG ?= .config export KCONFIG_CONFIG @@ -171,6 +187,8 @@ export KCONFIG_CONFIG and the [shell](https://en.wikipedia.org/wiki/Shell_%28computing%29) that will be used during kernel compilation: +和编译内核过程中要用到的[shell](https://en.wikipedia.org/wiki/Shell_%28computing%29) + ```Makefile CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \ else if [ -x /bin/bash ]; then echo /bin/bash; \ @@ -179,6 +197,9 @@ CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \ 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: +接下来就要设置一组和编译内核的编译器相关的变量。我们会设置host 的C 和C++ 的编译器及相关配置项: + + ```Makefile HOSTCC = gcc HOSTCXX = g++ @@ -188,6 +209,7 @@ 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): +然后会去适配代表编译器的变量`CC`,为什么还要`HOST*` 这些选项呢?`CC` 是编译内核过程中要使用的目标架构的编译器,但是`HOSTCC` 是要被用来编译一组`host` 程序的(下面我们就会看到)。然后我们就看看变量`KBUILD_MODULES` 和`KBUILD_BUILTIN` 的定义,这两个变量据欸的那个了我们要编译什么(内核、模块还是其他?): ```Makefile KBUILD_MODULES := KBUILD_BUILTIN := 1 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 348/507] 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 349/507] [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 350/507] 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 351/507] 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 352/507] 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 a083bab979c96d4b979a0c5cdbb34dbe2fbed3be Mon Sep 17 00:00:00 2001 From: Ezio Date: Mon, 17 Aug 2015 10:19:17 +0800 Subject: [PATCH 353/507] Update 20150728 Process of the Linux kernel building.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 翻译到300行 --- ...150728 Process of the Linux kernel building.md | 15 ++++++++++++++- 1 file changed, 14 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 4191968e04..d3c71f0a43 100644 --- a/sources/tech/20150728 Process of the Linux kernel building.md +++ b/sources/tech/20150728 Process of the Linux kernel building.md @@ -210,6 +210,7 @@ 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): 然后会去适配代表编译器的变量`CC`,为什么还要`HOST*` 这些选项呢?`CC` 是编译内核过程中要使用的目标架构的编译器,但是`HOSTCC` 是要被用来编译一组`host` 程序的(下面我们就会看到)。然后我们就看看变量`KBUILD_MODULES` 和`KBUILD_BUILTIN` 的定义,这两个变量据欸的那个了我们要编译什么(内核、模块还是其他?): + ```Makefile KBUILD_MODULES := KBUILD_BUILTIN := 1 @@ -221,12 +222,16 @@ 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: +在这我们可以看到这些变量的定义,并且,如果们仅仅传递了`modules` 给`make`,变量`KBUILD_BUILTIN` 会依赖于内核配置选项`CONFIG_MODVERSIONS`。下一步操作是引入: + ```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...): +文件`kbuild` ,[Kbuild](https://github.com/torvalds/linux/blob/master/Documentation/kbuild/kbuild.txt) 或者又叫做 `Kernel Build System`是一个用来管理构建内核和模块的特殊框架。`kbuild` 文件的语法与makefile 一样。文件[scripts/Kbuild.include](https://github.com/torvalds/linux/blob/master/scripts/Kbuild.include) 为`kbuild` 系统同提供了一些原生的定义。因为我们包含了这个`kbuild` 文件,我们可以看到和不同工具关联的这些变量的定义,这些工具会在内核和模块编译过程中被使用(比如链接器、编译器、二进制工具包[binutils](http://www.gnu.org/software/binutils/),等等): + ```Makefile AS = $(CROSS_COMPILE)as LD = $(CROSS_COMPILE)ld @@ -245,6 +250,8 @@ 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): +在这些定义好的变量之后,我们又定义了两个变量:`USERINCLUDE` 和`LINUXINCLUDE`。他们为包含头文件的路径(第一个是给用户用的,第二个是给内核用的): + ```Makefile USERINCLUDE := \ -I$(srctree)/arch/$(hdr-arch)/include/uapi \ @@ -259,7 +266,7 @@ LINUXINCLUDE := \ ``` And the standard flags for the C compiler: - +以及标准的C 编译器标志: ```Makefile KBUILD_CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \ -fno-strict-aliasing -fno-common \ @@ -269,6 +276,7 @@ KBUILD_CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \ ``` 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 里面更新(比如`arch/` 里面的kbuild)。经过所有这些,全部变量会被导出,这样其他makefile 就可以直接使用了。下面的两个变量`RCS_FIND_IGNORE` 和 `RCS_TAR_IGNORE` 包含了被版本控制系统忽略的文件: ```Makefile export RCS_FIND_IGNORE := \( -name SCCS -o -name BitKeeper -o -name .svn -o \ @@ -280,11 +288,16 @@ export RCS_TAR_IGNORE := --exclude SCCS --exclude BitKeeper --exclude .svn \ That's all. We have finished with the all preparations, next point is the building of `vmlinux`. +这就是全部了,我们已经完成了所有的准备工作,下一个点就是如果构建`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(注:内核根目录下的makefile)的下一步工作就是和编译内核相关的了。在我们执行`make` 命令之前,我们不会在终端看到任何东西。但是现在编译的第一步开始了,这里我们需要从内核根makefile的的[598](https://github.com/torvalds/linux/blob/master/Makefile#L598) 行开始,这里可以看到目标`vmlinux`: + ```Makefile all: vmlinux include arch/$(SRCARCH)/Makefile From 4dbc0c3601189cae703cd9e97bb1507fa0d39c2e Mon Sep 17 00:00:00 2001 From: DeadFire Date: Mon, 17 Aug 2015 10:56:51 +0800 Subject: [PATCH 354/507] =?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 355/507] =?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 356/507] 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 357/507] 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 358/507] =?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 From 2bd491e4887a8ccf9e80670d9ef772cf3dc54ea8 Mon Sep 17 00:00:00 2001 From: KS Date: Mon, 17 Aug 2015 16:25:20 +0800 Subject: [PATCH 359/507] Update 20150205 Install Strongswan - A Tool to Setup IPsec Based VPN in Linux.md --- ...ll Strongswan - A Tool to Setup IPsec Based VPN in Linux.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150205 Install Strongswan - A Tool to Setup IPsec Based VPN in Linux.md b/sources/tech/20150205 Install Strongswan - A Tool to Setup IPsec Based VPN in Linux.md index ca909934fa..cd9ee43213 100644 --- a/sources/tech/20150205 Install Strongswan - A Tool to Setup IPsec Based VPN in Linux.md +++ b/sources/tech/20150205 Install Strongswan - A Tool to Setup IPsec Based VPN in Linux.md @@ -1,3 +1,4 @@ +wyangsun translating Install Strongswan - A Tool to Setup IPsec Based VPN in Linux ================================================================================ IPsec is a standard which provides the security at network layer. It consist of authentication header (AH) and encapsulating security payload (ESP) components. AH provides the packet Integrity and confidentiality is provided by ESP component . IPsec ensures the following security features at network layer. @@ -110,4 +111,4 @@ via: http://linoxide.com/security/install-strongswan/ 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 [a]:http://linoxide.com/author/naveeda/ -[1]:https://www.strongswan.org/ \ No newline at end of file +[1]:https://www.strongswan.org/ From ca3975194fd28a2a417cd36a198be1034033bea2 Mon Sep 17 00:00:00 2001 From: Ezio Date: Mon, 17 Aug 2015 21:22:39 +0800 Subject: [PATCH 360/507] Update 20150728 Process of the Linux kernel building.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 翻译一点点 --- sources/tech/20150728 Process of the Linux kernel building.md | 4 ++++ 1 file changed, 4 insertions(+) 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 d3c71f0a43..e139143ccc 100644 --- a/sources/tech/20150728 Process of the Linux kernel building.md +++ b/sources/tech/20150728 Process of the Linux kernel building.md @@ -305,8 +305,12 @@ all: vmlinux 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. +不要操心我们略过的从`export RCS_FIND_IGNORE.....` 到`all: vmlinux.....` 这一部分makefile 代码,他们只是负责根据各种配置文件生成不同目标内核的,因为之前我就说了这一部分我们只讨论构建内核的通用途径。 + 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: +目标`all:` 是在命令行里不指定目标时默认生成的目标。你可以看到这里我们包含了架构相关的makefile(默认情况下会是[arch/x86/Makefile](https://github.com/torvalds/linux/blob/master/arch/x86/Makefile))。从这一时刻起,我们会从这个makefile 继续进行下去。如我们所见,目标`all` 依赖于根makefile 后面一点的生命`vmlinux`: + ```Makefile vmlinux: scripts/link-vmlinux.sh $(vmlinux-deps) FORCE ``` From 8cceff8c289b4e4c694af9de6bb755634cb10297 Mon Sep 17 00:00:00 2001 From: wxy Date: Mon, 17 Aug 2015 22:44:42 +0800 Subject: [PATCH 361/507] PUB:20150816 shellinabox--A Web based AJAX Terminal Emulator @xiaoyu33 --- ...box--A Web based AJAX Terminal Emulator.md | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) rename {translated/share => published}/20150816 shellinabox--A Web based AJAX Terminal Emulator.md (66%) diff --git a/translated/share/20150816 shellinabox--A Web based AJAX Terminal Emulator.md b/published/20150816 shellinabox--A Web based AJAX Terminal Emulator.md similarity index 66% rename from translated/share/20150816 shellinabox--A Web based AJAX Terminal Emulator.md rename to published/20150816 shellinabox--A Web based AJAX Terminal Emulator.md index 71acf990c1..c4d9523d50 100644 --- a/translated/share/20150816 shellinabox--A Web based AJAX Terminal Emulator.md +++ b/published/20150816 shellinabox--A Web based AJAX Terminal Emulator.md @@ -1,16 +1,17 @@ -shellinabox–基于Web的Ajax的终端模拟器安装及使用详解 +shellinabox:一款使用 AJAX 的基于 Web 的终端模拟器 ================================================================================ + ### shellinabox简介 ### -unixmen的读者朋友们,你们好! +通常情况下,我们在访问任何远程服务器时,会使用常见的通信工具如OpenSSH和Putty等。但是,有可能我们在防火墙后面不能使用这些工具访问远程系统,或者防火墙只允许HTTPS流量才能通过。不用担心!即使你在这样的防火墙后面,我们依然有办法来访问你的远程系统。而且,你不需要安装任何类似于OpenSSH或Putty的通讯工具。你只需要有一个支持JavaScript和CSS的现代浏览器,并且你不用安装任何插件或第三方应用软件。 -通常情况下,我们访问任何远程服务器时,使用常见的通信工具如OpenSSH和Putty等。但是如果我们在防火墙外,或者防火墙只允许HTTPS流量才能通过,那么我们就不能再使用这些工具来访问远程系统了。不用担心!即使你在防火墙后面,我们依然有办法来访问你的远程系统。而且,你不需要安装任何类似于OpenSSH或Putty的通讯工具。你只需要有一个支持JavaScript和CSS的现代浏览器。并且你不用安装任何插件或第三方应用软件。 +这个 **Shell In A Box**,发音是**shellinabox**,是由**Markus Gutschke**开发的一款自由开源的基于Web的Ajax的终端模拟器。它使用AJAX技术,通过Web浏览器提供了类似原生的 Shell 的外观和感受。 -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/**。输入你的用户名和密码,然后就可以开始使用你远程系统的外壳。看起来很有趣,不是吗?确实! +这个**shellinaboxd**守护进程实现了一个Web服务器,能够侦听指定的端口。其Web服务器可以发布一个或多个服务,这些服务显示在用 AJAX Web 应用实现的VT100模拟器中。默认情况下,端口为4200。你可以更改默认端口到任意选择的任意端口号。在你的远程服务器安装shellinabox以后,如果你想从本地系统接入,打开Web浏览器并导航到:**http://IP-Address:4200/**。输入你的用户名和密码,然后就可以开始使用你远程系统的Shell。看起来很有趣,不是吗?确实 有趣! **免责声明**: -shellinabox不是SSH客户端或任何安全软件。它仅仅是一个应用程序,能够通过Web浏览器模拟一个远程系统的壳。同时,它和SSH没有任何关系。这不是防弹的安全的方式来远程控制您的系统。这只是迄今为止最简单的方法之一。无论什么原因,你都不应该在任何公共网络上运行它。 +shellinabox不是SSH客户端或任何安全软件。它仅仅是一个应用程序,能够通过Web浏览器模拟一个远程系统的Shell。同时,它和SSH没有任何关系。这不是可靠的安全地远程控制您的系统的方式。这只是迄今为止最简单的方法之一。无论如何,你都不应该在任何公共网络上运行它。 ### 安装shellinabox ### @@ -48,7 +49,7 @@ shellinabox在默认库是可用的。所以,你可以使用命令来安装它 # vi /etc/sysconfig/shellinaboxd -更改你的端口到任意数量。因为我在本地网络上测试它,所以我使用默认值。 +更改你的端口到任意数字。因为我在本地网络上测试它,所以我使用默认值。 # Shell in a box daemon configuration # For details see shellinaboxd man page @@ -98,7 +99,7 @@ shellinabox在默认库是可用的。所以,你可以使用命令来安装它 ### 使用 ### -现在,去你的客户端系统,打开Web浏览器并导航到:**https://ip-address-of-remote-servers:4200**。 +现在,在你的客户端系统,打开Web浏览器并导航到:**https://ip-address-of-remote-servers:4200**。 **注意**:如果你改变了端口,请填写修改后的端口。 @@ -110,13 +111,13 @@ shellinabox在默认库是可用的。所以,你可以使用命令来安装它 ![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浏览器在你的远程服务器随意操作。 -当你完成时,记得点击**退出**。 +当你完成工作时,记得输入`exit`退出。 当再次连接到远程系统时,单击**连接**按钮,然后输入远程服务器的用户名和密码。 @@ -134,7 +135,7 @@ shellinabox在默认库是可用的。所以,你可以使用命令来安装它 ### 结论 ### -正如我之前提到的,如果你在服务器运行在防火墙后面,那么基于web的SSH工具是非常有用的。有许多基于web的SSH工具,但shellinabox是非常简单并且有用的工具,能从的网络上的任何地方,模拟一个远程系统的壳。因为它是基于浏览器的,所以你可以从任何设备访问您的远程服务器,只要你有一个支持JavaScript和CSS的浏览器。 +正如我之前提到的,如果你在服务器运行在防火墙后面,那么基于web的SSH工具是非常有用的。有许多基于web的SSH工具,但shellinabox是非常简单而有用的工具,可以从的网络上的任何地方,模拟一个远程系统的Shell。因为它是基于浏览器的,所以你可以从任何设备访问您的远程服务器,只要你有一个支持JavaScript和CSS的浏览器。 就这些啦。祝你今天有个好心情! @@ -148,7 +149,7 @@ via: http://www.unixmen.com/shellinabox-a-web-based-ajax-terminal-emulator/ 作者:[SK][a] 译者:[xiaoyu33](https://github.com/xiaoyu33) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 From 40cbb17f9ee6f21418829d1c6ebf83976f2ad59a Mon Sep 17 00:00:00 2001 From: wxy Date: Mon, 17 Aug 2015 23:53:26 +0800 Subject: [PATCH 362/507] PUB:20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 4 - GNOME Settings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @XLCYun 翻译的渐入佳境了! --- ...t & Wrong - Page 3 - GNOME Applications.md | 2 +- ...Right & Wrong - Page 4 - GNOME Settings.md | 52 ++++++++++++++++++ ...Right & Wrong - Page 4 - GNOME Settings.md | 54 ------------------- 3 files changed, 53 insertions(+), 55 deletions(-) create mode 100644 published/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 4 - GNOME Settings.md delete 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/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 index 61600366c9..4dd942dd29 100644 --- 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 @@ -7,7 +7,7 @@ 这是一个基本扯平的方面。每一个桌面环境都有一些非常好的应用,也有一些不怎么样的。再次强调,Gnome 把那些 KDE 完全错失的小细节给做对了。我不是想说 KDE 中有哪些应用不好。他们都能工作,但仅此而已。也就是说:它们合格了,但确实还没有达到甚至接近100分。 -Gnome 是一个样子,KDE 是另外一种。Dragon 播放器运行得很好,清晰的标出了播放文件、URL或和光盘的按钮,正如你在 Gnome Videos 中能做到的一样……但是在便利的文件名和用户的友好度方面,Gnome 多走了一小步。它默认显示了在你的电脑上检测到的所有影像文件,不需要你做任何事情。KDE 有 [Baloo][](正如之前的 [Nepomuk][2],LCTT 译注:这是 KDE 中一种文件索引服务框架)为什么不使用它们?它们能列出可读取的影像文件……但却没被使用。 +Gnome 在左,KDE 在右。Dragon 播放器运行得很好,清晰的标出了播放文件、URL或和光盘的按钮,正如你在 Gnome Videos 中能做到的一样……但是在便利的文件名和用户的友好度方面,Gnome 多走了一小步。它默认显示了在你的电脑上检测到的所有影像文件,不需要你做任何事情。KDE 有 [Baloo][](正如之前的 [Nepomuk][2],LCTT 译注:这是 KDE 中一种文件索引服务框架)为什么不使用它们?它们能列出可读取的影像文件……但却没被使用。 下一步……音乐播放器 diff --git a/published/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 4 - GNOME Settings.md b/published/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..289c1cb14e --- /dev/null +++ b/published/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 4 - GNOME Settings.md @@ -0,0 +1,52 @@ +一周 GNOME 之旅:品味它和 KDE 的是是非非(第四节 GNOME设置) +================================================================================ + +### 设置 ### + +在这我要挑一挑几个特定 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) +校对:[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 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 deleted file mode 100644 index 1c0cc4bd86..0000000000 --- a/translated/tech/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 4 - GNOME Settings.md +++ /dev/null @@ -1,54 +0,0 @@ -将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 d675e982b31faa8e48135ab58931502ba44c0ce4 Mon Sep 17 00:00:00 2001 From: struggling <630441839@qq.com> Date: Tue, 18 Aug 2015 00:55:00 +0800 Subject: [PATCH 363/507] Delete 20150817 Linux FAQs with Answers--How to count the number of threads in a process on Linux.md --- ...number of threads in a process on Linux.md | 51 ------------------- 1 file changed, 51 deletions(-) delete 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/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 deleted file mode 100644 index 35ee2f00de..0000000000 --- a/sources/tech/20150817 Linux FAQs with Answers--How to count the number of threads in a process on Linux.md +++ /dev/null @@ -1,51 +0,0 @@ -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? - -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 From 56225b0911420c15454682f279958d0ccde22755 Mon Sep 17 00:00:00 2001 From: struggling <630441839@qq.com> Date: Tue, 18 Aug 2015 00:55:36 +0800 Subject: [PATCH 364/507] Create 20150817 Linux FAQs with Answers--How to count the number of threads in a process on Linux.md --- ...number of threads in a process on Linux.md | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 translated/tech/20150817 Linux FAQs with Answers--How to count the number of threads in a process on Linux.md diff --git a/translated/tech/20150817 Linux FAQs with Answers--How to count the number of threads in a process on Linux.md b/translated/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..96bf143533 --- /dev/null +++ b/translated/tech/20150817 Linux FAQs with Answers--How to count the number of threads in a process on Linux.md @@ -0,0 +1,51 @@ + +Linux 有问必答 - 如何在 Linux 中统计一个进程的线程数 +================================================================================ +> **问题**: 我正在运行一个程序,它在运行时会派生出多个线程。我想知道程序在运行时会有多少线程。在 Linux 中检查进程的线程数最简单的方法是什么? + +如果你想看到 Linux 中每个进程的线程数,有以下几种方法可以做到这一点。 + +### 方法一: /proc ### + + proc 伪文件系统,它驻留在 /proc 目录,这是最简单的方法来查看任何活动进程的线程数。 /proc 目录以可读文本文件形式输出,提供现有进程和系统硬件相关的信息如 CPU, interrupts, memory, disk, 等等. + + $ cat /proc//status + +上面的命令将显示进程 的详细信息,包括过程状态(例如, sleeping, running),父进程 PID,UID,GID,使用的文件描述符的数量,以及上下文切换的数量。输出也包括**进程创建的总线程数**如下所示。 + + Threads: + +例如,检查 PID 20571进程的线程数: + + $ cat /proc/20571/status + +![](https://farm6.staticflickr.com/5649/20341236279_f4a4d809d2_b.jpg) + +输出表明该进程有28个线程。 + +或者,你可以在 /proc//task 中简单的统计目录的数量,如下所示。 + + $ ls /proc//task | wc + +这是因为,对于一个进程中创建的每个线程,在 /proc//task 中会创建一个相应的目录,命名为其线程 ID。由此在 /proc//task 中目录的总数表示在进程中线程的数目。 + +### 方法二: ps ### + +如果你是功能强大的 ps 命令的忠实用户,这个命令也可以告诉你一个进程(用“H”选项)的线程数。下面的命令将输出进程的线程数。“h”选项需要放在前面。 + + $ ps hH p | wc -l + +如果你想监视一个进程的不同线程消耗的硬件资源(CPU & memory),请参阅[此教程][1]。(注:此文我们翻译过) + +-------------------------------------------------------------------------------- + +via: http://ask.xmodulo.com/number-of-threads-process-linux.html + +作者:[Dan Nanni][a] +译者:[strugglingyouth](https://github.com/strugglingyouth) +校对:[校对者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 From 579b625083dad361059c070506a5218a8badd6c0 Mon Sep 17 00:00:00 2001 From: Vic___ Date: Tue, 18 Aug 2015 01:19:45 +0800 Subject: [PATCH 365/507] translated --- ...edule a Job and Watch Commands in Linux.md | 104 +++++++++--------- 1 file changed, 53 insertions(+), 51 deletions(-) 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 28981add17..54d3996e0e 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,102 +1,103 @@ - Vic020 - -Linux Tricks: Play Game in Chrome, Text-to-Speech, Schedule a Job and Watch Commands in Linux +Linux小技巧:Chrome小游戏,文字说话,计划作业,重复执行命令 ================================================================================ -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提示与彩蛋][1]系列,让你的Linux获得更多创造和娱乐。 -Linux Tips and Tricks Series +![Linux提示与彩蛋系列](http://www.tecmint.com/wp-content/uploads/2015/08/Linux-Tips-and-Tricks.png) -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. +Linux提示与彩蛋系列 -### 1. Play A Game in Google Chrome Browser ### +本文,我将会讲解Google-chrome内建小游戏,在终端中如何让文字说话,使用‘at’命令设置作业和使用watch命令重复执行命令。 -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. +### 1. Google Chrome 浏览器小游戏彩蛋 ### -So when there is Internet related issue and my web page seems something like this: +网线脱掉或者其他什么原因连不上网时,Google Chrome就会出现一个小游戏。声明,我并不是游戏玩家,因此我的电脑上并没有安装任何第三方的恶意游戏。安全是第一位。 -![Unable to Connect Internet](http://www.tecmint.com/wp-content/uploads/2015/08/Unable-to-Connect-Internet.png) +所以当Internet发生出错,会出现一个这样的界面: -Unable to Connect Internet +![不能连接到互联网](http://www.tecmint.com/wp-content/uploads/2015/08/Unable-to-Connect-Internet.png) -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). +按下空格键来激活Google-chrome彩蛋游戏。游戏没有时间限制。并且还不需要浪费时间安装使用。 -Use Space-Bar/Navigation-up-key to jump. A glimpse of the game in action. +不需要第三方软件的支持。同样支持Windows和Mac平台,但是我的平台是Linux,我也只谈论Linux。当然在Linux,这个游戏运行很好。游戏简单,但也很花费时间。 -![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 +![Google Chrome中玩游戏](http://www.tecmint.com/wp-content/uploads/2015/08/Play-Game-in-Google-Chrome.gif) -### 2. Text to Speech in Linux Terminal ### +Google Chrome中玩游戏 -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. +### 2. Linux 终端中朗读文字 ### -Espeak should be installed in your system by default, however it is not installed for your system, you may do: +对于那些不能文字朗读的设备,有个小工具可以实现文字说话的转换器。 +espeak支持多种语言,可以及时朗读输入文字。 + +系统应该默认安装了Espeak,如果你的系统没有安装,你可以使用下列命令来安装: # 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] + $ espeak [按回车键] -For detailed output you may do: +更详细的输出你可以这样做: - $ espeak --stdout | aplay [Hit Return Key][Double - Here] + $ espeak --stdout | aplay [按回车键][这里需要双击] -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设置灵活,也可以朗读文本文件。你可以这样设置: $ 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’. +espeak可以设置朗读速度。默认速度是160词每分钟。使用-s参数来设置。 -To ask espeak to speak 30 words per minute, you may do: +设置30词每分钟: $ espeak -s 30 -f /path/to/text/file/file_name.txt | aplay -To ask espeak to speak 200 words per minute, you may do: +设置200词每分钟: $ 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支持多种语言,支持自定义设置。使用下列命令来获得语言表: $ espeak --voices -### 3. Quick Schedule a Job ### +### 3. 快速计划作业 ### -Most of us are already familiar with [cron][2] which is a daemon to execute scheduled commands. +我们已经非常熟悉使用[cron][2]后台执行一个计划命令。 -Cron is an advanced command often used by Linux SYSAdmins to schedule a job such as Backup or practically anything at certain time/interval. +Cron是一个Linux系统管理的高级命令,用于计划定时任务如备份或者指定时间或间隔的任何事情。 -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’. +但是,你是否知道at命令可以让你计划一个作业或者命令在指定时间?at命令可以指定时间和指定内容执行作业。 -For an example, say you want to print the output of uptime command at 11:02 AM, All you need to do is: +例如,你打算在早上11点2分执行uptime命令,你只需要这样做: $ 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) +![Linux中计划作业](http://www.tecmint.com/wp-content/uploads/2015/08/Schedule-Job-in-Linux.png) -Schedule Job in Linux +Linux中计划作业 -To check if the command/script/job has been set or not by ‘at’ command, you may do: +检查at命令是否成功设置,使用: $ at -l -![View Scheduled Jobs](http://www.tecmint.com/wp-content/uploads/2015/08/View-Scheduled-Jobs.png) +![浏览计划作业](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支持计划多个命令,例如: $ at 12:30 Command – 1 @@ -106,36 +107,37 @@ You may schedule more than one command in one go using at, simply as: … Ctrl + D -### 4. Watch a Command at Specific Interval ### +### 4. 特定时间重复执行命令 ### -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. +有时,我们可以需要在指定时间间隔执行特定命令。例如,每3秒,想打印一次时间。 -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) +![Linux中查看日期和时间](http://www.tecmint.com/wp-content/uploads/2015/08/Check-Date-in-Linux.png) -Check Date and Time in Linux +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) +![Linux中watch命令](http://www.tecmint.com/wp-content/uploads/2015/08/Watch-Command-in-Linux.gif) -Watch Command in Linux +Linux中watch命令 -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. +watch命令的‘-n’开关设定时间间隔。在上诉命令中,我们定义了时间间隔为3秒。你可以按你的需求定义。同样watch +也支持其他命令或者脚本。 -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… +至此。希望你喜欢这个系列的文章,让你的linux更有创造性,获得更多快乐。所有的建议欢迎评论。欢迎你也看看其他文章,谢谢。 -------------------------------------------------------------------------------- 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) +译者:[VicYu/Vic020](http://vicyu.net) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 5a1be0ab80258ceb49b2240bd72a83f89d8438b4 Mon Sep 17 00:00:00 2001 From: Vic___ Date: Tue, 18 Aug 2015 01:20:29 +0800 Subject: [PATCH 366/507] moved --- ...e Text-to-Speech Schedule a Job and Watch Commands in Linux.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/20150812 Linux Tricks--Play Game in Chrome Text-to-Speech Schedule a Job and Watch Commands in Linux.md (100%) 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/translated/tech/20150812 Linux Tricks--Play Game in Chrome Text-to-Speech Schedule a Job and Watch Commands in Linux.md similarity index 100% rename from sources/tech/20150812 Linux Tricks--Play Game in Chrome Text-to-Speech Schedule a Job and Watch Commands in Linux.md rename to translated/tech/20150812 Linux Tricks--Play Game in Chrome Text-to-Speech Schedule a Job and Watch Commands in Linux.md From 46cf1d082cb263bb04cf0919c2d3bd1800e54199 Mon Sep 17 00:00:00 2001 From: Ezio Date: Tue, 18 Aug 2015 10:14:10 +0800 Subject: [PATCH 367/507] Update 20150728 Process of the Linux kernel building.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 编译到400行 --- ...28 Process of the Linux kernel building.md | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) 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 e139143ccc..f4510d81b2 100644 --- a/sources/tech/20150728 Process of the Linux kernel building.md +++ b/sources/tech/20150728 Process of the Linux kernel building.md @@ -309,7 +309,7 @@ Don't worry that we have missed many lines in Makefile that are placed after `ex 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: -目标`all:` 是在命令行里不指定目标时默认生成的目标。你可以看到这里我们包含了架构相关的makefile(默认情况下会是[arch/x86/Makefile](https://github.com/torvalds/linux/blob/master/arch/x86/Makefile))。从这一时刻起,我们会从这个makefile 继续进行下去。如我们所见,目标`all` 依赖于根makefile 后面一点的生命`vmlinux`: +目标`all:` 是在命令行里不指定目标时默认生成的目标。你可以看到这里我们包含了架构相关的makefile(默认情况下会是[arch/x86/Makefile](https://github.com/torvalds/linux/blob/master/arch/x86/Makefile))。从这一时刻起,我们会从这个makefile 继续进行下去。如我们所见,目标`all` 依赖于根makefile 后面声明的`vmlinux`: ```Makefile vmlinux: scripts/link-vmlinux.sh $(vmlinux-deps) FORCE @@ -317,12 +317,17 @@ 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: +`vmlinux` 是linux 内核的静态链接可执行文件格式。脚本[scripts/link-vmlinux.sh](https://github.com/torvalds/linux/blob/master/scripts/link-vmlinux.sh) 把不同的编译好的子模块链接到一起形成了vmlinux。第二个目标是`vmlinux-deps`,它的定义如下: + + ```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: +它是由内核代码下的每个顶级目录的`built-in.o` 组成的。之后我们还会检查内核所有的目录,`kbuild` 会编译各个目录下所有的对应`$obj-y` 的源文件。接着调用`$(LD) -r` 把这些文件合并到一个`build-in.o` 文件里。此时我们还没有`vmloinux-deps`, 所以目标`vmlinux` 现在还不会被构建。对我而言`vmlinux-deps` 包含下面的文件 + ``` arch/x86/kernel/vmlinux.lds arch/x86/kernel/head_64.o arch/x86/kernel/head64.o arch/x86/kernel/head.o @@ -341,6 +346,8 @@ net/built-in.o The next target that can be executed is following: +下一个可以被执行的目标如下: + ```Makefile $(sort $(vmlinux-deps)): $(vmlinux-dirs) ; $(vmlinux-dirs): prepare scripts @@ -349,6 +356,8 @@ $(vmlinux-dirs): prepare scripts 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: +就像我们看到的,`vmlinux-dir` 依赖于两部分:`prepare` 和`scripts`。第一个`prepare` 定义在内核的根`makefile` ,准备工作分成三个阶段: + ```Makefile prepare: prepare0 prepare0: archprepare FORCE @@ -361,7 +370,9 @@ prepare1: prepare2 $(version_h) include/generated/utsrelease.h \ 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: +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: + +第一个`prepare0` 展开到`archprepare` ,后者又展开到`archheader` 和`archscripts`,这两个变量定义在`x86_64` 相关的[Makefile](https://github.com/torvalds/linux/blob/master/arch/x86/Makefile)。让我们看看这个文件。`x86_64` 特定的makefile从变量定义开始,这些变量都是和特定架构的配置文件 ([defconfig](https://github.com/torvalds/linux/tree/master/arch/x86/configs),等等)有关联。变量定义之后,这个makefile 定义了编译[16-bit](https://en.wikipedia.org/wiki/Real_mode)代码的编译选项,根据变量`BITS` 的值,如果是`32` 汇编代码、链接器、以及其它很多东西(全部的定义都可以在[arch/x86/Makefile](https://github.com/torvalds/linux/blob/master/arch/x86/Makefile)找到)对应的参数就是`i386`,而`64`就对应的是`x86_84`。生成的系统调用列表(syscall table)的makefile 里第一个目标就是`archheaders` : ```Makefile archheaders: @@ -370,6 +381,8 @@ archheaders: And the second target is `archscripts` in this makefile is: +这个makefile 里第二个目标就是`archscripts`: + ```Makefile archscripts: scripts_basic $(Q)$(MAKE) $(build)=arch/x86/tools relocs @@ -377,6 +390,8 @@ archscripts: scripts_basic 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: + 我们可以看到`archscripts` 是依赖于根[Makefile](https://github.com/torvalds/linux/blob/master/Makefile)里的`scripts_basic` 。首先我们可以看出`scripts_basic` 是根据[scripts/basic](https://github.com/torvalds/linux/blob/master/scripts/basic/Makefile) 的mekefile 执行的: + ```Maklefile scripts_basic: $(Q)$(MAKE) $(build)=scripts/basic @@ -384,6 +399,8 @@ scripts_basic: The `scripts/basic/Makefile` contains targets for compilation of the two host programs: `fixdep` and `bin2`: +`scripts/basic/Makefile`包含了编译两个主机程序`fixdep` 和`bin2` 的目标: + ```Makefile hostprogs-y := fixdep hostprogs-$(CONFIG_BUILD_BIN2C) += bin2c From dc7c041b3ce8958672f07089b74b1c8b34918f42 Mon Sep 17 00:00:00 2001 From: DeadFire Date: Tue, 18 Aug 2015 10:55:26 +0800 Subject: [PATCH 368/507] =?UTF-8?q?20150818-1=20=E9=80=89=E9=A2=98=20LFCS?= =?UTF-8?q?=20=E4=B8=93=E9=A2=98=206-10=20=E5=85=B1=E5=8D=81=E7=AF=87=20?= =?UTF-8?q?=E5=AE=8C=E7=BB=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ng and Linux Filesystem Troubleshooting.md | 315 +++++++++++++++ ...es – Creating & Managing System Backups.md | 276 +++++++++++++ ...d Services SysVinit Systemd and Upstart.md | 367 ++++++++++++++++++ ...es and Enabling sudo Access on Accounts.md | 330 ++++++++++++++++ ...th Yum RPM Apt Dpkg Aptitude and Zypper.md | 229 +++++++++++ 5 files changed, 1517 insertions(+) create mode 100644 sources/tech/LFCS/Part 10 - LFCS--Understanding and Learning Basic Shell Scripting and Linux Filesystem Troubleshooting.md create mode 100644 sources/tech/LFCS/Part 6 - LFCS--Assembling Partitions as RAID Devices – Creating & Managing System Backups.md create mode 100644 sources/tech/LFCS/Part 7 - LFCS--Managing System Startup Process and Services SysVinit Systemd and Upstart.md create mode 100644 sources/tech/LFCS/Part 8 - LFCS--Managing Users and Groups File Permissions and Attributes and Enabling sudo Access on Accounts.md create mode 100644 sources/tech/LFCS/Part 9 - LFCS--Linux Package Management with Yum RPM Apt Dpkg Aptitude and Zypper.md diff --git a/sources/tech/LFCS/Part 10 - LFCS--Understanding and Learning Basic Shell Scripting and Linux Filesystem Troubleshooting.md b/sources/tech/LFCS/Part 10 - LFCS--Understanding and Learning Basic Shell Scripting and Linux Filesystem Troubleshooting.md new file mode 100644 index 0000000000..45029ac20e --- /dev/null +++ b/sources/tech/LFCS/Part 10 - LFCS--Understanding and Learning Basic Shell Scripting and Linux Filesystem Troubleshooting.md @@ -0,0 +1,315 @@ +Part 10 - LFCS: Understanding & Learning Basic Shell Scripting and Linux Filesystem Troubleshooting +================================================================================ +The Linux Foundation launched the LFCS certification (Linux Foundation Certified Sysadmin), a brand new initiative whose purpose is to allow individuals everywhere (and anywhere) to get certified in basic to intermediate operational support 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. + +![Basic Shell Scripting and Filesystem Troubleshooting](http://www.tecmint.com/wp-content/uploads/2014/11/lfcs-Part-10.png) + +Linux Foundation Certified Sysadmin – Part 10 + +Check out the following video that guides you an introduction to the Linux Foundation Certification Program. + +注:youtube 视频 + + + +This is the last article (Part 10) of the present 10-tutorial long series. In this article we will focus on basic shell scripting and troubleshooting Linux file systems. Both topics are required for the LFCS certification exam. + +### Understanding Terminals and Shells ### + +Let’s clarify a few concepts first. + +- A shell is a program that takes commands and gives them to the operating system to be executed. +- A terminal is a program that allows us as end users to interact with the shell. One example of a terminal is GNOME terminal, as shown in the below image. + +![Gnome Terminal](http://www.tecmint.com/wp-content/uploads/2014/11/Gnome-Terminal.png) + +Gnome Terminal + +When we first start a shell, it presents a command prompt (also known as the command line), which tells us that the shell is ready to start accepting commands from its standard input device, which is usually the keyboard. + +You may want to refer to another article in this series ([Use Command to Create, Edit, and Manipulate files – Part 1][1]) to review some useful commands. + +Linux provides a range of options for shells, the following being the most common: + +**bash Shell** + +Bash stands for Bourne Again SHell and is the GNU Project’s default shell. It incorporates useful features from the Korn shell (ksh) and C shell (csh), offering several improvements at the same time. This is the default shell used by the distributions covered in the LFCS certification, and it is the shell that we will use in this tutorial. + +**sh Shell** + +The Bourne SHell is the oldest shell and therefore has been the default shell of many UNIX-like operating systems for many years. +ksh Shell + +The Korn SHell is a Unix shell which was developed by David Korn at Bell Labs in the early 1980s. It is backward-compatible with the Bourne shell and includes many features of the C shell. + +A shell script is nothing more and nothing less than a text file turned into an executable program that combines commands that are executed by the shell one after another. + +### Basic Shell Scripting ### + +As mentioned earlier, a shell script is born as a plain text file. Thus, can be created and edited using our preferred text editor. You may want to consider using vi/m (refer to [Usage of vi Editor – Part 2][2] of this series), which features syntax highlighting for your convenience. + +Type the following command to create a file named myscript.sh and press Enter. + + # vim myscript.sh + +The very first line of a shell script must be as follows (also known as a shebang). + + #!/bin/bash + +It “tells” the operating system the name of the interpreter that should be used to run the text that follows. + +Now it’s time to add our commands. We can clarify the purpose of each command, or the entire script, by adding comments as well. Note that the shell ignores those lines beginning with a pound sign # (explanatory comments). + + #!/bin/bash + echo This is Part 10 of the 10-article series about the LFCS certification + echo Today is $(date +%Y-%m-%d) + +Once the script has been written and saved, we need to make it executable. + + # chmod 755 myscript.sh + +Before running our script, we need to say a few words about the $PATH environment variable. If we run, + + echo $PATH + +from the command line, we will see the contents of $PATH: a colon-separated list of directories that are searched when we enter the name of a executable program. It is called an environment variable because it is part of the shell environment – a set of information that becomes available for the shell and its child processes when the shell is first started. + +When we type a command and press Enter, the shell searches in all the directories listed in the $PATH variable and executes the first instance that is found. Let’s see an example, + +![Linux Environment Variables](http://www.tecmint.com/wp-content/uploads/2014/11/Environment-Variable.png) + +Environment Variables + +If there are two executable files with the same name, one in /usr/local/bin and another in /usr/bin, the one in the first directory will be executed first, whereas the other will be disregarded. + +If we haven’t saved our script inside one of the directories listed in the $PATH variable, we need to append ./ to the file name in order to execute it. Otherwise, we can run it just as we would do with a regular command. + + # pwd + # ./myscript.sh + # cp myscript.sh ../bin + # cd ../bin + # pwd + # myscript.sh + +![Execute Script in Linux](http://www.tecmint.com/wp-content/uploads/2014/11/Execute-Script.png) + +Execute Script + +#### Conditionals #### + +Whenever you need to specify different courses of action to be taken in a shell script, as result of the success or failure of a command, you will use the if construct to define such conditions. Its basic syntax is: + + if CONDITION; then + COMMANDS; + else + OTHER-COMMANDS + fi + +Where CONDITION can be one of the following (only the most frequent conditions are cited here) and evaluates to true when: + +- [ -a file ] → file exists. +- [ -d file ] → file exists and is a directory. +- [ -f file ] →file exists and is a regular file. +- [ -u file ] →file exists and its SUID (set user ID) bit is set. +- [ -g file ] →file exists and its SGID bit is set. +- [ -k file ] →file exists and its sticky bit is set. +- [ -r file ] →file exists and is readable. +- [ -s file ]→ file exists and is not empty. +- [ -w file ]→file exists and is writable. +- [ -x file ] is true if file exists and is executable. +- [ string1 = string2 ] → the strings are equal. +- [ string1 != string2 ] →the strings are not equal. + +[ int1 op int2 ] should be part of the preceding list, while the items that follow (for example, -eq –> is true if int1 is equal to int2.) should be a “children” list of [ int1 op int2 ] where op is one of the following comparison operators. + +- -eq –> is true if int1 is equal to int2. +- -ne –> true if int1 is not equal to int2. +- -lt –> true if int1 is less than int2. +- -le –> true if int1 is less than or equal to int2. +- -gt –> true if int1 is greater than int2. +- -ge –> true if int1 is greater than or equal to int2. + +#### For Loops #### + +This loop allows to execute one or more commands for each value in a list of values. Its basic syntax is: + + for item in SEQUENCE; do + COMMANDS; + done + +Where item is a generic variable that represents each value in SEQUENCE during each iteration. + +#### While Loops #### + +This loop allows to execute a series of repetitive commands as long as the control command executes with an exit status equal to zero (successfully). Its basic syntax is: + + while EVALUATION_COMMAND; do + EXECUTE_COMMANDS; + done + +Where EVALUATION_COMMAND can be any command(s) that can exit with a success (0) or failure (other than 0) status, and EXECUTE_COMMANDS can be any program, script or shell construct, including other nested loops. + +#### Putting It All Together #### + +We will demonstrate the use of the if construct and the for loop with the following example. + +**Determining if a service is running in a systemd-based distro** + +Let’s create a file with a list of services that we want to monitor at a glance. + + # cat myservices.txt + + sshd + mariadb + httpd + crond + firewalld + +![Script to Monitor Linux Services](http://www.tecmint.com/wp-content/uploads/2014/11/Monitor-Services.png) + +Script to Monitor Linux Services + +Our shell script should look like. + + #!/bin/bash + + # This script iterates over a list of services and + # is used to determine whether they are running or not. + + for service in $(cat myservices.txt); do + systemctl status $service | grep --quiet "running" + if [ $? -eq 0 ]; then + echo $service "is [ACTIVE]" + else + echo $service "is [INACTIVE or NOT INSTALLED]" + fi + done + +![Linux Service Monitoring Script](http://www.tecmint.com/wp-content/uploads/2014/11/Monitor-Script.png) + +Linux Service Monitoring Script + +**Let’s explain how the script works.** + +1). The for loop reads the myservices.txt file one element of LIST at a time. That single element is denoted by the generic variable named service. The LIST is populated with the output of, + + # cat myservices.txt + +2). The above command is enclosed in parentheses and preceded by a dollar sign to indicate that it should be evaluated to populate the LIST that we will iterate over. + +3). For each element of LIST (meaning every instance of the service variable), the following command will be executed. + + # systemctl status $service | grep --quiet "running" + +This time we need to precede our generic variable (which represents each element in LIST) with a dollar sign to indicate it’s a variable and thus its value in each iteration should be used. The output is then piped to grep. + +The –quiet flag is used to prevent grep from displaying to the screen the lines where the word running appears. When that happens, the above command returns an exit status of 0 (represented by $? in the if construct), thus verifying that the service is running. + +An exit status different than 0 (meaning the word running was not found in the output of systemctl status $service) indicates that the service is not running. + +![Services Monitoring Script](http://www.tecmint.com/wp-content/uploads/2014/11/Services-Monitoring-Script.png) + +Services Monitoring Script + +We could go one step further and check for the existence of myservices.txt before even attempting to enter the for loop. + + #!/bin/bash + + # This script iterates over a list of services and + # is used to determine whether they are running or not. + + if [ -f myservices.txt ]; then + for service in $(cat myservices.txt); do + systemctl status $service | grep --quiet "running" + if [ $? -eq 0 ]; then + echo $service "is [ACTIVE]" + else + echo $service "is [INACTIVE or NOT INSTALLED]" + fi + done + else + echo "myservices.txt is missing" + fi + +**Pinging a series of network or internet hosts for reply statistics** + +You may want to maintain a list of hosts in a text file and use a script to determine every now and then whether they’re pingable or not (feel free to replace the contents of myhosts and try for yourself). + +The read shell built-in command tells the while loop to read myhosts line by line and assigns the content of each line to variable host, which is then passed to the ping command. + + #!/bin/bash + + # This script is used to demonstrate the use of a while loop + + while read host; do + ping -c 2 $host + done < myhosts + +![Script to Ping Servers](http://www.tecmint.com/wp-content/uploads/2014/11/Script-to-Ping-Servers.png) + +Script to Ping Servers + +Read Also: + +- [Learn Shell Scripting: A Guide from Newbies to System Administrator][3] +- [5 Shell Scripts to Learn Shell Programming][4] + +### Filesystem Troubleshooting ### + +Although Linux is a very stable operating system, if it crashes for some reason (for example, due to a power outage), one (or more) of your file systems will not be unmounted properly and thus will be automatically checked for errors when Linux is restarted. + +In addition, each time the system boots during a normal boot, it always checks the integrity of the filesystems before mounting them. In both cases this is performed using a tool named fsck (“file system check”). + +fsck will not only check the integrity of file systems, but also attempt to repair corrupt file systems if instructed to do so. Depending on the severity of damage, fsck may succeed or not; when it does, recovered portions of files are placed in the lost+found directory, located in the root of each file system. + +Last but not least, we must note that inconsistencies may also happen if we try to remove an USB drive when the operating system is still writing to it, and may even result in hardware damage. + +The basic syntax of fsck is as follows: + + # fsck [options] filesystem + +**Checking a filesystem for errors and attempting to repair automatically** + +In order to check a filesystem with fsck, we must first unmount it. + + # mount | grep sdg1 + # umount /mnt + # fsck -y /dev/sdg1 + +![Scan Linux Filesystem for Errors](http://www.tecmint.com/wp-content/uploads/2014/11/Check-Filesystem-Errors.png) + +Check Filesystem Errors + +Besides the -y flag, we can use the -a option to automatically repair the file systems without asking any questions, and force the check even when the filesystem looks clean. + + # fsck -af /dev/sdg1 + +If we’re only interested in finding out what’s wrong (without trying to fix anything for the time being) we can run fsck with the -n option, which will output the filesystem issues to standard output. + + # fsck -n /dev/sdg1 + +Depending on the error messages in the output of fsck, we will know whether we can try to solve the issue ourselves or escalate it to engineering teams to perform further checks on the hardware. + +### Summary ### + +We have arrived at the end of this 10-article series where have tried to cover the basic domain competencies required to pass the LFCS exam. + +For obvious reasons, it is not possible to cover every single aspect of these topics in any single tutorial, and that’s why we hope that these articles have put you on the right track to try new stuff yourself and continue learning. + +If you have any questions or comments, they are always welcome – so don’t hesitate to drop us a line via the form below! + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/linux-basic-shell-scripting-and-linux-filesystem-troubleshooting/ + +作者:[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/sed-command-to-create-edit-and-manipulate-files-in-linux/ +[2]:http://www.tecmint.com/vi-editor-usage/ +[3]:http://www.tecmint.com/learning-shell-scripting-language-a-guide-from-newbies-to-system-administrator/ +[4]:http://www.tecmint.com/basic-shell-programming-part-ii/ \ No newline at end of file diff --git a/sources/tech/LFCS/Part 6 - LFCS--Assembling Partitions as RAID Devices – Creating & Managing System Backups.md b/sources/tech/LFCS/Part 6 - LFCS--Assembling Partitions as RAID Devices – Creating & Managing System Backups.md new file mode 100644 index 0000000000..bdabfb1f9d --- /dev/null +++ b/sources/tech/LFCS/Part 6 - LFCS--Assembling Partitions as RAID Devices – Creating & Managing System Backups.md @@ -0,0 +1,276 @@ +Part 6 - LFCS: Assembling Partitions as RAID Devices – Creating & Managing System Backups +================================================================================ +Recently, the Linux Foundation launched the LFCS (Linux Foundation Certified Sysadmin) certification, a shiny chance for system administrators everywhere to demonstrate, through a performance-based exam, that they are capable of performing overall operational support on Linux systems: system support, first-level diagnosing and monitoring, plus issue escalation, when required, to other support teams. + +![Linux Foundation Certified Sysadmin – Part 6](http://www.tecmint.com/wp-content/uploads/2014/10/lfcs-Part-6.png) + +Linux Foundation Certified Sysadmin – Part 6 + +The following video provides an introduction to The Linux Foundation Certification Program. + +注:youtube 视频 + + +This post is Part 6 of a 10-tutorial series, here in this part, we will explain How to Assemble Partitions as RAID Devices – Creating & Managing System Backups, that are required for the LFCS certification exam. + +### Understanding RAID ### + +The technology known as Redundant Array of Independent Disks (RAID) is a storage solution that combines multiple hard disks into a single logical unit to provide redundancy of data and/or improve performance in read / write operations to disk. + +However, the actual fault-tolerance and disk I/O performance lean on how the hard disks are set up to form the disk array. Depending on the available devices and the fault tolerance / performance needs, different RAID levels are defined. You can refer to the RAID series here in Tecmint.com for a more detailed explanation on each RAID level. + +- RAID Guide: [What is RAID, Concepts of RAID and RAID Levels Explained][1] + +Our tool of choice for creating, assembling, managing, and monitoring our software RAIDs is called mdadm (short for multiple disks admin). + + ---------------- Debian and Derivatives ---------------- + # aptitude update && aptitude install mdadm + +---------- + + ---------------- Red Hat and CentOS based Systems ---------------- + # yum update && yum install mdadm + +---------- + + ---------------- On openSUSE ---------------- + # zypper refresh && zypper install mdadm # + +#### Assembling Partitions as RAID Devices #### + +The process of assembling existing partitions as RAID devices consists of the following steps. + +**1. Create the array using mdadm** + +If one of the partitions has been formatted previously, or has been a part of another RAID array previously, you will be prompted to confirm the creation of the new array. Assuming you have taken the necessary precautions to avoid losing important data that may have resided in them, you can safely type y and press Enter. + + # mdadm --create --verbose /dev/md0 --level=stripe --raid-devices=2 /dev/sdb1 /dev/sdc1 + +![Creating RAID Array](http://www.tecmint.com/wp-content/uploads/2014/10/Creating-RAID-Array.png) + +Creating RAID Array + +**2. Check the array creation status** + +After creating RAID array, you an check the status of the array using the following commands. + + # cat /proc/mdstat + or + # mdadm --detail /dev/md0 [More detailed summary] + +![Check RAID Array Status](http://www.tecmint.com/wp-content/uploads/2014/10/Check-RAID-Array-Status.png) + +Check RAID Array Status + +**3. Format the RAID Device** + +Format the device with a filesystem as per your needs / requirements, as explained in [Part 4][2] of this series. + +**4. Monitor RAID Array Service** + +Instruct the monitoring service to “keep an eye” on the array. Add the output of mdadm –detail –scan to /etc/mdadm/mdadm.conf (Debian and derivatives) or /etc/mdadm.conf (CentOS / openSUSE), like so. + + # mdadm --detail --scan + +![Monitor RAID Array](http://www.tecmint.com/wp-content/uploads/2014/10/Monitor-RAID-Array.png) + +Monitor RAID Array + + # mdadm --assemble --scan [Assemble the array] + +To ensure the service starts on system boot, run the following commands as root. + +**Debian and Derivatives** + +Debian and derivatives, though it should start running on boot by default. + + # update-rc.d mdadm defaults + +Edit the /etc/default/mdadm file and add the following line. + + AUTOSTART=true + +**On CentOS and openSUSE (systemd-based)** + + # systemctl start mdmonitor + # systemctl enable mdmonitor + +**On CentOS and openSUSE (SysVinit-based)** + + # service mdmonitor start + # chkconfig mdmonitor on + +**5. Check RAID Disk Failure** + +In RAID levels that support redundancy, replace failed drives when needed. When a device in the disk array becomes faulty, a rebuild automatically starts only if there was a spare device added when we first created the array. + +![Check RAID Faulty Disk](http://www.tecmint.com/wp-content/uploads/2014/10/Check-RAID-Faulty-Disk.png) + +Check RAID Faulty Disk + +Otherwise, we need to manually attach an extra physical drive to our system and run. + + # mdadm /dev/md0 --add /dev/sdX1 + +Where /dev/md0 is the array that experienced the issue and /dev/sdX1 is the new device. + +**6. Disassemble a working array** + +You may have to do this if you need to create a new array using the devices – (Optional Step). + + # mdadm --stop /dev/md0 # Stop the array + # mdadm --remove /dev/md0 # Remove the RAID device + # mdadm --zero-superblock /dev/sdX1 # Overwrite the existing md superblock with zeroes + +**7. Set up mail alerts** + +You can configure a valid email address or system account to send alerts to (make sure you have this line in mdadm.conf). – (Optional Step) + + MAILADDR root + +In this case, all alerts that the RAID monitoring daemon collects will be sent to the local root account’s mail box. One of such alerts looks like the following. + +**Note**: This event is related to the example in STEP 5, where a device was marked as faulty and the spare device was automatically built into the array by mdadm. Thus, we “ran out” of healthy spare devices and we got the alert. + +![RAID Monitoring Alerts](http://www.tecmint.com/wp-content/uploads/2014/10/RAID-Monitoring-Alerts.png) + +RAID Monitoring Alerts + +#### Understanding RAID Levels #### + +**RAID 0** + +The total array size is n times the size of the smallest partition, where n is the number of independent disks in the array (you will need at least two drives). Run the following command to assemble a RAID 0 array using partitions /dev/sdb1 and /dev/sdc1. + + # mdadm --create --verbose /dev/md0 --level=stripe --raid-devices=2 /dev/sdb1 /dev/sdc1 + +Common uses: Setups that support real-time applications where performance is more important than fault-tolerance. + +**RAID 1 (aka Mirroring)** + +The total array size equals the size of the smallest partition (you will need at least two drives). Run the following command to assemble a RAID 1 array using partitions /dev/sdb1 and /dev/sdc1. + + # mdadm --create --verbose /dev/md0 --level=1 --raid-devices=2 /dev/sdb1 /dev/sdc1 + +Common uses: Installation of the operating system or important subdirectories, such as /home. + +**RAID 5 (aka drives with Parity)** + +The total array size will be (n – 1) times the size of the smallest partition. The “lost” space in (n-1) is used for parity (redundancy) calculation (you will need at least three drives). + +Note that you can specify a spare device (/dev/sde1 in this case) to replace a faulty part when an issue occurs. Run the following command to assemble a RAID 5 array using partitions /dev/sdb1, /dev/sdc1, /dev/sdd1, and /dev/sde1 as spare. + + # mdadm --create --verbose /dev/md0 --level=5 --raid-devices=3 /dev/sdb1 /dev/sdc1 /dev/sdd1 --spare-devices=1 /dev/sde1 + +Common uses: Web and file servers. + +**RAID 6 (aka drives with double Parity** + +The total array size will be (n*s)-2*s, where n is the number of independent disks in the array and s is the size of the smallest disk. Note that you can specify a spare device (/dev/sdf1 in this case) to replace a faulty part when an issue occurs. + +Run the following command to assemble a RAID 6 array using partitions /dev/sdb1, /dev/sdc1, /dev/sdd1, /dev/sde1, and /dev/sdf1 as spare. + + # mdadm --create --verbose /dev/md0 --level=6 --raid-devices=4 /dev/sdb1 /dev/sdc1 /dev/sdd1 /dev/sde --spare-devices=1 /dev/sdf1 + +Common uses: File and backup servers with large capacity and high availability requirements. + +**RAID 1+0 (aka stripe of mirrors)** + +The total array size is computed based on the formulas for RAID 0 and RAID 1, since RAID 1+0 is a combination of both. First, calculate the size of each mirror and then the size of the stripe. + +Note that you can specify a spare device (/dev/sdf1 in this case) to replace a faulty part when an issue occurs. Run the following command to assemble a RAID 1+0 array using partitions /dev/sdb1, /dev/sdc1, /dev/sdd1, /dev/sde1, and /dev/sdf1 as spare. + + # mdadm --create --verbose /dev/md0 --level=10 --raid-devices=4 /dev/sd[b-e]1 --spare-devices=1 /dev/sdf1 + +Common uses: Database and application servers that require fast I/O operations. + +#### Creating and Managing System Backups #### + +It never hurts to remember that RAID with all its bounties IS NOT A REPLACEMENT FOR BACKUPS! Write it 1000 times on the chalkboard if you need to, but make sure you keep that idea in mind at all times. Before we begin, we must note that there is no one-size-fits-all solution for system backups, but here are some things that you do need to take into account while planning a backup strategy. + +- What do you use your system for? (Desktop or server? If the latter case applies, what are the most critical services – whose configuration would be a real pain to lose?) +- How often do you need to take backups of your system? +- What is the data (e.g. files / directories / database dumps) that you want to backup? You may also want to consider if you really need to backup huge files (such as audio or video files). +- Where (meaning physical place and media) will those backups be stored? + +**Backing Up Your Data** + +Method 1: Backup entire drives with dd command. You can either back up an entire hard disk or a partition by creating an exact image at any point in time. Note that this works best when the device is offline, meaning it’s not mounted and there are no processes accessing it for I/O operations. + +The downside of this backup approach is that the image will have the same size as the disk or partition, even when the actual data occupies a small percentage of it. For example, if you want to image a partition of 20 GB that is only 10% full, the image file will still be 20 GB in size. In other words, it’s not only the actual data that gets backed up, but the entire partition itself. You may consider using this method if you need exact backups of your devices. + +**Creating an image file out of an existing device** + + # dd if=/dev/sda of=/system_images/sda.img + OR + --------------------- Alternatively, you can compress the image file --------------------- + # dd if=/dev/sda | gzip -c > /system_images/sda.img.gz + +**Restoring the backup from the image file** + + # dd if=/system_images/sda.img of=/dev/sda + OR + + --------------------- Depending on your choice while creating the image --------------------- + gzip -dc /system_images/sda.img.gz | dd of=/dev/sda + +Method 2: Backup certain files / directories with tar command – already covered in [Part 3][3] of this series. You may consider using this method if you need to keep copies of specific files and directories (configuration files, users’ home directories, and so on). + +Method 3: Synchronize files with rsync command. Rsync is a versatile remote (and local) file-copying tool. If you need to backup and synchronize your files to/from network drives, rsync is a go. + +Whether you’re synchronizing two local directories or local < — > remote directories mounted on the local filesystem, the basic syntax is the same. +Synchronizing two local directories or local < — > remote directories mounted on the local filesystem + + # rsync -av source_directory destination directory + +Where, -a recurse into subdirectories (if they exist), preserve symbolic links, timestamps, permissions, and original owner / group and -v verbose. + +![rsync Synchronizing Files](http://www.tecmint.com/wp-content/uploads/2014/10/rsync-synchronizing-Files.png) + +rsync Synchronizing Files + +In addition, if you want to increase the security of the data transfer over the wire, you can use ssh over rsync. + +**Synchronizing local → remote directories over ssh** + + # rsync -avzhe ssh backups root@remote_host:/remote_directory/ + +This example will synchronize the backups directory on the local host with the contents of /root/remote_directory on the remote host. + +Where the -h option shows file sizes in human-readable format, and the -e flag is used to indicate a ssh connection. + +![rsync Synchronize Remote Files](http://www.tecmint.com/wp-content/uploads/2014/10/rsync-synchronize-Remote-Files.png) + +rsync Synchronize Remote Files + +Synchronizing remote → local directories over ssh. + +In this case, switch the source and destination directories from the previous example. + + # rsync -avzhe ssh root@remote_host:/remote_directory/ backups + +Please note that these are only 3 examples (most frequent cases you’re likely to run into) of the use of rsync. For more examples and usages of rsync commands can be found at the following article. + +- Read Also: [10 rsync Commands to Sync Files in Linux][4] + +### Summary ### + +As a sysadmin, you need to ensure that your systems perform as good as possible. If you’re well prepared, and if the integrity of your data is well supported by a storage technology such as RAID and regular system backups, you’ll be safe. + +If you have questions, comments, or further ideas on how this article can be improved, feel free to speak out below. In addition, please consider sharing this series through your social network profiles. + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/creating-and-managing-raid-backups-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/understanding-raid-setup-in-linux/ +[2]:http://www.tecmint.com/create-partitions-and-filesystems-in-linux/ +[3]:http://www.tecmint.com/compress-files-and-finding-files-in-linux/ +[4]:http://www.tecmint.com/rsync-local-remote-file-synchronization-commands/ \ No newline at end of file diff --git a/sources/tech/LFCS/Part 7 - LFCS--Managing System Startup Process and Services SysVinit Systemd and Upstart.md b/sources/tech/LFCS/Part 7 - LFCS--Managing System Startup Process and Services SysVinit Systemd and Upstart.md new file mode 100644 index 0000000000..b024c89540 --- /dev/null +++ b/sources/tech/LFCS/Part 7 - LFCS--Managing System Startup Process and Services SysVinit Systemd and Upstart.md @@ -0,0 +1,367 @@ +Part 7 - LFCS: Managing System Startup Process and Services (SysVinit, Systemd and Upstart) +================================================================================ +A couple of months ago, the Linux Foundation announced the LFCS (Linux Foundation Certified Sysadmin) certification, an exciting new program whose aim is allowing individuals from all ends of the world to get certified in performing basic to intermediate system administration tasks on Linux systems. This includes supporting already running systems and services, along with first-hand problem-finding and analysis, plus the ability to decide when to raise issues to engineering teams. + +![Linux Foundation Certified Sysadmin – Part 7](http://www.tecmint.com/wp-content/uploads/2014/10/lfcs-Part-7.png) + +Linux Foundation Certified Sysadmin – Part 7 + +The following video describes an brief introduction to The Linux Foundation Certification Program. + +注:youtube 视频 + + +This post is Part 7 of a 10-tutorial series, here in this part, we will explain how to Manage Linux System Startup Process and Services, that are required for the LFCS certification exam. + +### Managing the Linux Startup Process ### + +The boot process of a Linux system consists of several phases, each represented by a different component. The following diagram briefly summarizes the boot process and shows all the main components involved. + +![Linux Boot Process](http://www.tecmint.com/wp-content/uploads/2014/10/Linux-Boot-Process.png) + +Linux Boot Process + +When you press the Power button on your machine, the firmware that is stored in a EEPROM chip in the motherboard initializes the POST (Power-On Self Test) to check on the state of the system’s hardware resources. When the POST is finished, the firmware then searches and loads the 1st stage boot loader, located in the MBR or in the EFI partition of the first available disk, and gives control to it. + +#### MBR Method #### + +The MBR is located in the first sector of the disk marked as bootable in the BIOS settings and is 512 bytes in size. + +- First 446 bytes: The bootloader contains both executable code and error message text. +- Next 64 bytes: The Partition table contains a record for each of four partitions (primary or extended). Among other things, each record indicates the status (active / not active), size, and start / end sectors of each partition. +- Last 2 bytes: The magic number serves as a validation check of the MBR. + +The following command performs a backup of the MBR (in this example, /dev/sda is the first hard disk). The resulting file, mbr.bkp can come in handy should the partition table become corrupt, for example, rendering the system unbootable. + +Of course, in order to use it later if the need arises, we will need to save it and store it somewhere else (like a USB drive, for example). That file will help us restore the MBR and will get us going once again if and only if we do not change the hard drive layout in the meanwhile. + +**Backup MBR** + + # dd if=/dev/sda of=mbr.bkp bs=512 count=1 + +![Backup MBR in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Backup-MBR-in-Linux.png) + +Backup MBR in Linux + +**Restoring MBR** + + # dd if=mbr.bkp of=/dev/sda bs=512 count=1 + +![Restore MBR in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Restore-MBR-in-Linux.png) + +Restore MBR in Linux + +#### EFI/UEFI Method #### + +For systems using the EFI/UEFI method, the UEFI firmware reads its settings to determine which UEFI application is to be launched and from where (i.e., in which disk and partition the EFI partition is located). + +Next, the 2nd stage boot loader (aka boot manager) is loaded and run. GRUB [GRand Unified Boot] is the most frequently used boot manager in Linux. One of two distinct versions can be found on most systems used today. + +- GRUB legacy configuration file: /boot/grub/menu.lst (older distributions, not supported by EFI/UEFI firmwares). +- GRUB2 configuration file: most likely, /etc/default/grub. + +Although the objectives of the LFCS exam do not explicitly request knowledge about GRUB internals, if you’re brave and can afford to mess up your system (you may want to try it first on a virtual machine, just in case), you need to run. + + # update-grub + +As root after modifying GRUB’s configuration in order to apply the changes. + +Basically, GRUB loads the default kernel and the initrd or initramfs image. In few words, initrd or initramfs help to perform the hardware detection, the kernel module loading and the device discovery necessary to get the real root filesystem mounted. + +Once the real root filesystem is up, the kernel executes the system and service manager (init or systemd, whose process identification or PID is always 1) to begin the normal user-space boot process in order to present a user interface. + +Both init and systemd are daemons (background processes) that manage other daemons, as the first service to start (during boot) and the last service to terminate (during shutdown). + +![Systemd and Init](http://www.tecmint.com/wp-content/uploads/2014/10/systemd-and-init.png) + +Systemd and Init + +### Starting Services (SysVinit) ### + +The concept of runlevels in Linux specifies different ways to use a system by controlling which services are running. In other words, a runlevel controls what tasks can be accomplished in the current execution state = runlevel (and which ones cannot). + +Traditionally, this startup process was performed based on conventions that originated with System V UNIX, with the system passing executing collections of scripts that start and stop services as the machine entered a specific runlevel (which, in other words, is a different mode of running the system). + +Within each runlevel, individual services can be set to run, or to be shut down if running. Latest versions of some major distributions are moving away from the System V standard in favour of a rather new service and system manager called systemd (which stands for system daemon), but usually support sysv commands for compatibility purposes. This means that you can run most of the well-known sysv init tools in a systemd-based distribution. + +- Read Also: [Why ‘systemd’ replaces ‘init’ in Linux][1] + +Besides starting the system process, init looks to the /etc/inittab file to decide what runlevel must be entered. + +注:表格 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Runlevel Description
0 Halt the system. Runlevel 0 is a special transitional state used to shutdown the system quickly.
1 Also aliased to s, or S, this runlevel is sometimes called maintenance mode. What services, if any, are started at this runlevel varies by distribution. It’s typically used for low-level system maintenance that may be impaired by normal system operation.
2 Multiuser. On Debian systems and derivatives, this is the default runlevel, and includes -if available- a graphical login. On Red-Hat based systems, this is multiuser mode without networking.
3 On Red-Hat based systems, this is the default multiuser mode, which runs everything except the graphical environment. This runlevel and levels 4 and 5 usually are not used on Debian-based systems.
4 Typically unused by default and therefore available for customization.
5 On Red-Hat based systems, full multiuser mode with GUI login. This runlevel is like level 3, but with a GUI login available.
6 Reboot the system.
+ +To switch between runlevels, we can simply issue a runlevel change using the init command: init N (where N is one of the runlevels listed above). Please note that this is not the recommended way of taking a running system to a different runlevel because it gives no warning to existing logged-in users (thus causing them to lose work and processes to terminate abnormally). + +Instead, the shutdown command should be used to restart the system (which first sends a warning message to all logged-in users and blocks any further logins; it then signals init to switch runlevels); however, the default runlevel (the one the system will boot to) must be edited in the /etc/inittab file first. + +For that reason, follow these steps to properly switch between runlevels, As root, look for the following line in /etc/inittab. + + id:2:initdefault: + +and change the number 2 for the desired runlevel with your preferred text editor, such as vim (described in [How to use vi/vim editor in Linux – Part 2][2] of this series). + +Next, run as root. + + # shutdown -r now + +That last command will restart the system, causing it to start in the specified runlevel during next boot, and will run the scripts located in the /etc/rc[runlevel].d directory in order to decide which services should be started and which ones should not. For example, for runlevel 2 in the following system. + +![Change Runlevels in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Change-Runlevels-in-Linux.jpeg) + +Change Runlevels in Linux + +#### Manage Services using chkconfig #### + +To enable or disable system services on boot, we will use [chkconfig command][3] in CentOS / openSUSE and sysv-rc-conf in Debian and derivatives. This tool can also show us what is the preconfigured state of a service for a particular runlevel. + +- Read Also: [How to Stop and Disable Unwanted Services in Linux][4] + +Listing the runlevel configuration for a service. + + # chkconfig --list [service name] + # chkconfig --list postfix + # chkconfig --list mysqld + +![Listing Runlevel Configuration](http://www.tecmint.com/wp-content/uploads/2014/10/Listing-Runlevel-Configuration.png) + +Listing Runlevel Configuration + +In the above image we can see that postfix is set to start when the system enters runlevels 2 through 5, whereas mysqld will be running by default for runlevels 2 through 4. Now suppose that this is not the expected behaviour. + +For example, we need to turn on mysqld for runlevel 5 as well, and turn off postfix for runlevels 4 and 5. Here’s what we would do in each case (run the following commands as root). + +**Enabling a service for a particular runlevel** + + # chkconfig --level [level(s)] service on + # chkconfig --level 5 mysqld on + +**Disabling a service for particular runlevels** + + # chkconfig --level [level(s)] service off + # chkconfig --level 45 postfix off + +![Enable Disable Services in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Enable-Disable-Services.png) + +Enable Disable Services + +We will now perform similar tasks in a Debian-based system using sysv-rc-conf. + +#### Manage Services using sysv-rc-conf #### + +Configuring a service to start automatically on a specific runlevel and prevent it from starting on all others. + +1. Let’s use the following command to see what are the runlevels where mdadm is configured to start. + + # ls -l /etc/rc[0-6].d | grep -E 'rc[0-6]|mdadm' + +![Check Runlevel of Service Running](http://www.tecmint.com/wp-content/uploads/2014/10/Check-Service-Runlevel.png) + +Check Runlevel of Service Running + +2. We will use sysv-rc-conf to prevent mdadm from starting on all runlevels except 2. Just check or uncheck (with the space bar) as desired (you can move up, down, left, and right with the arrow keys). + + # sysv-rc-conf + +![SysV Runlevel Config](http://www.tecmint.com/wp-content/uploads/2014/10/SysV-Runlevel-Config.png) + +SysV Runlevel Config + +Then press q to quit. + +3. We will restart the system and run again the command from STEP 1. + + # ls -l /etc/rc[0-6].d | grep -E 'rc[0-6]|mdadm' + +![Verify Service Runlevel](http://www.tecmint.com/wp-content/uploads/2014/10/Verify-Service-Runlevel.png) + +Verify Service Runlevel + +In the above image we can see that mdadm is configured to start only on runlevel 2. + +### What About systemd? ### + +systemd is another service and system manager that is being adopted by several major Linux distributions. It aims to allow more processing to be done in parallel during system startup (unlike sysvinit, which always tends to be slower because it starts processes one at a time, checks whether one depends on another, and waits for daemons to launch so more services can start), and to serve as a dynamic resource management to a running system. + +Thus, services are started when needed (to avoid consuming system resources) instead of being launched without a solid reason during boot. + +Viewing the status of all the processes running on your system, both systemd native and SysV services, run the following command. + + # systemctl + +![Check All Running Processes in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Check-All-Running-Processes.png) + +Check All Running Processes + +The LOAD column shows whether the unit definition (refer to the UNIT column, which shows the service or anything maintained by systemd) was properly loaded, while the ACTIVE and SUB columns show the current status of such unit. +Displaying information about the current status of a service + +When the ACTIVE column indicates that an unit’s status is other than active, we can check what happened using. + + # systemctl status [unit] + +For example, in the image above, media-samba.mount is in failed state. Let’s run. + + # systemctl status media-samba.mount + +![Check Linux Service Status](http://www.tecmint.com/wp-content/uploads/2014/10/Check-Service-Status.png) + +Check Service Status + +We can see that media-samba.mount failed because the mount process on host dev1 was unable to find the network share at //192.168.0.10/gacanepa. + +### Starting or Stopping Services ### + +Once the network share //192.168.0.10/gacanepa becomes available, let’s try to start, then stop, and finally restart the unit media-samba.mount. After performing each action, let’s run systemctl status media-samba.mount to check on its status. + + # systemctl start media-samba.mount + # systemctl status media-samba.mount + # systemctl stop media-samba.mount + # systemctl restart media-samba.mount + # systemctl status media-samba.mount + +![Starting Stoping Services](http://www.tecmint.com/wp-content/uploads/2014/10/Starting-Stoping-Service.jpeg) + +Starting Stoping Services + +**Enabling or disabling a service to start during boot** + +Under systemd you can enable or disable a service when it boots. + + # systemctl enable [service] # enable a service + # systemctl disable [service] # prevent a service from starting at boot + +The process of enabling or disabling a service to start automatically on boot consists in adding or removing symbolic links in the /etc/systemd/system/multi-user.target.wants directory. + +![Enabling Disabling Services](http://www.tecmint.com/wp-content/uploads/2014/10/Enabling-Disabling-Services.jpeg) + +Enabling Disabling Services + +Alternatively, you can find out a service’s current status (enabled or disabled) with the command. + + # systemctl is-enabled [service] + +For example, + + # systemctl is-enabled postfix.service + +In addition, you can reboot or shutdown the system with. + + # systemctl reboot + # systemctl shutdown + +### Upstart ### + +Upstart is an event-based replacement for the /sbin/init daemon and was born out of the need for starting services only, when they are needed (also supervising them while they are running), and handling events as they occur, thus surpassing the classic, dependency-based sysvinit system. + +It was originally developed for the Ubuntu distribution, but is used in Red Hat Enterprise Linux 6.0. Though it was intended to be suitable for deployment in all Linux distributions as a replacement for sysvinit, in time it was overshadowed by systemd. On February 14, 2014, Mark Shuttleworth (founder of Canonical Ltd.) announced that future releases of Ubuntu would use systemd as the default init daemon. + +Because the SysV startup script for system has been so common for so long, a large number of software packages include SysV startup scripts. To accommodate such packages, Upstart provides a compatibility mode: It runs SysV startup scripts in the usual locations (/etc/rc.d/rc?.d, /etc/init.d/rc?.d, /etc/rc?.d, or a similar location). Thus, if we install a package that doesn’t yet include an Upstart configuration script, it should still launch in the usual way. + +Furthermore, if we have installed utilities such as [chkconfig][5], you should be able to use them to manage your SysV-based services just as we would on sysvinit based systems. + +Upstart scripts also support starting or stopping services based on a wider variety of actions than do SysV startup scripts; for example, Upstart can launch a service whenever a particular hardware device is attached. + +A system that uses Upstart and its native scripts exclusively replaces the /etc/inittab file and the runlevel-specific SysV startup script directories with .conf scripts in the /etc/init directory. + +These *.conf scripts (also known as job definitions) generally consists of the following: + +- Description of the process. +- Runlevels where the process should run or events that should trigger it. +- Runlevels where process should be stopped or events that should stop it. +- Options. +- Command to launch the process. + +For example, + + # My test service - Upstart script demo description "Here goes the description of 'My test service'" author "Dave Null " + # Stanzas + + # + # Stanzas define when and how a process is started and stopped + # See a list of stanzas here: http://upstart.ubuntu.com/wiki/Stanzas#respawn + # When to start the service + start on runlevel [2345] + # When to stop the service + stop on runlevel [016] + # Automatically restart process in case of crash + respawn + # Specify working directory + chdir /home/dave/myfiles + # Specify the process/command (add arguments if needed) to run + exec bash backup.sh arg1 arg2 + +To apply changes, you will need to tell upstart to reload its configuration. + + # initctl reload-configuration + +Then start your job by typing the following command. + + $ sudo start yourjobname + +Where yourjobname is the name of the job that was added earlier with the yourjobname.conf script. + +A more complete and detailed reference guide for Upstart is available in the project’s web site under the menu “[Cookbook][6]”. + +### Summary ### + +A knowledge of the Linux boot process is necessary to help you with troubleshooting tasks as well as with adapting the computer’s performance and running services to your needs. + +In this article we have analyzed what happens from the moment when you press the Power switch to turn on the machine until you get a fully operational user interface. I hope you have learned reading it as much as I did while putting it together. Feel free to leave your comments or questions below. We always look forward to hearing from our readers! + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/linux-boot-process-and-manage-services/ + +作者:[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/systemd-replaces-init-in-linux/ +[2]:http://www.tecmint.com/vi-editor-usage/ +[3]:http://www.tecmint.com/chkconfig-command-examples/ +[4]:http://www.tecmint.com/remove-unwanted-services-from-linux/ +[5]:http://www.tecmint.com/chkconfig-command-examples/ +[6]:http://upstart.ubuntu.com/cookbook/ \ No newline at end of file diff --git a/sources/tech/LFCS/Part 8 - LFCS--Managing Users and Groups File Permissions and Attributes and Enabling sudo Access on Accounts.md b/sources/tech/LFCS/Part 8 - LFCS--Managing Users and Groups File Permissions and Attributes and Enabling sudo Access on Accounts.md new file mode 100644 index 0000000000..4ccf3f20f6 --- /dev/null +++ b/sources/tech/LFCS/Part 8 - LFCS--Managing Users and Groups File Permissions and Attributes and Enabling sudo Access on Accounts.md @@ -0,0 +1,330 @@ +Part 8 - LFCS: Managing Users & Groups, File Permissions & Attributes and Enabling sudo Access on Accounts +================================================================================ +Last August, the Linux Foundation started the LFCS certification (Linux Foundation Certified Sysadmin), a brand new program whose purpose is to allow individuals everywhere and anywhere take an exam in order to get certified in basic to intermediate operational support for Linux systems, which includes supporting running systems and services, along with overall monitoring and analysis, plus intelligent decision-making to be able to decide when it’s necessary to escalate issues to higher level support teams. + +![Linux Users and Groups Management](http://www.tecmint.com/wp-content/uploads/2014/10/lfcs-Part-8.png) + +Linux Foundation Certified Sysadmin – Part 8 + +Please have a quick look at the following video that describes an introduction to the Linux Foundation Certification Program. + +注:youtube视频 + + +This article is Part 8 of a 10-tutorial long series, here in this section, we will guide you on how to manage users and groups permissions in Linux system, that are required for the LFCS certification exam. + +Since Linux is a multi-user operating system (in that it allows multiple users on different computers or terminals to access a single system), you will need to know how to perform effective user management: how to add, edit, suspend, or delete user accounts, along with granting them the necessary permissions to do their assigned tasks. + +### Adding User Accounts ### + +To add a new user account, you can run either of the following two commands as root. + + # adduser [new_account] + # useradd [new_account] + +When a new user account is added to the system, the following operations are performed. + +1. His/her home directory is created (/home/username by default). + +2. The following hidden files are copied into the user’s home directory, and will be used to provide environment variables for his/her user session. + + .bash_logout + .bash_profile + .bashrc + +3. A mail spool is created for the user at /var/spool/mail/username. + +4. A group is created and given the same name as the new user account. + +**Understanding /etc/passwd** + +The full account information is stored in the /etc/passwd file. This file contains a record per system user account and has the following format (fields are delimited by a colon). + + [username]:[x]:[UID]:[GID]:[Comment]:[Home directory]:[Default shell] + +- Fields [username] and [Comment] are self explanatory. +- The x in the second field indicates that the account is protected by a shadowed password (in /etc/shadow), which is needed to logon as [username]. +- The [UID] and [GID] fields are integers that represent the User IDentification and the primary Group IDentification to which [username] belongs, respectively. +- The [Home directory] indicates the absolute path to [username]’s home directory, and +- The [Default shell] is the shell that will be made available to this user when he or she logins the system. + +**Understanding /etc/group** + +Group information is stored in the /etc/group file. Each record has the following format. + + [Group name]:[Group password]:[GID]:[Group members] + +- [Group name] is the name of group. +- An x in [Group password] indicates group passwords are not being used. +- [GID]: same as in /etc/passwd. +- [Group members]: a comma separated list of users who are members of [Group name]. + +![Add User Accounts in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/add-user-accounts.png) + +Add User Accounts + +After adding an account, you can edit the following information (to name a few fields) using the usermod command, whose basic syntax of usermod is as follows. + + # usermod [options] [username] + +**Setting the expiry date for an account** + +Use the –expiredate flag followed by a date in YYYY-MM-DD format. + + # usermod --expiredate 2014-10-30 tecmint + +**Adding the user to supplementary groups** + +Use the combined -aG, or –append –groups options, followed by a comma separated list of groups. + + # usermod --append --groups root,users tecmint + +**Changing the default location of the user’s home directory** + +Use the -d, or –home options, followed by the absolute path to the new home directory. + + # usermod --home /tmp tecmint + +**Changing the shell the user will use by default** + +Use –shell, followed by the path to the new shell. + + # usermod --shell /bin/sh tecmint + +**Displaying the groups an user is a member of** + + # groups tecmint + # id tecmint + +Now let’s execute all the above commands in one go. + + # usermod --expiredate 2014-10-30 --append --groups root,users --home /tmp --shell /bin/sh tecmint + +![usermod Command Examples](http://www.tecmint.com/wp-content/uploads/2014/10/usermod-command-examples.png) + +usermod Command Examples + +Read Also: + +- [15 useradd Command Examples in Linux][1] +- [15 usermod Command Examples in Linux][2] + +For existing accounts, we can also do the following. + +**Disabling account by locking password** + +Use the -L (uppercase L) or the –lock option to lock a user’s password. + + # usermod --lock tecmint + +**Unlocking user password** + +Use the –u or the –unlock option to unlock a user’s password that was previously blocked. + + # usermod --unlock tecmint + +![Lock User in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/lock-user-in-linux.png) + +Lock User Accounts + +**Creating a new group for read and write access to files that need to be accessed by several users** + +Run the following series of commands to achieve the goal. + + # groupadd common_group # Add a new group + # chown :common_group common.txt # Change the group owner of common.txt to common_group + # usermod -aG common_group user1 # Add user1 to common_group + # usermod -aG common_group user2 # Add user2 to common_group + # usermod -aG common_group user3 # Add user3 to common_group + +**Deleting a group** + +You can delete a group with the following command. + + # groupdel [group_name] + +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. + +### Linux File Permissions ### + +Besides the basic read, write, and execute permissions that we discussed in [Setting File Attributes – Part 3][3] of this series, there are other less used (but not less important) permission settings, sometimes referred to as “special permissions”. + +Like the basic permissions discussed earlier, they are set using an octal file or through a letter (symbolic notation) that indicates the type of permission. +Deleting user accounts + +You can delete an account (along with its home directory, if it’s owned by the user, and all the files residing therein, and also the mail spool) using the userdel command with the –remove option. + + # userdel --remove [username] + +#### Group Management #### + +Every time a new user account is added to the system, a group with the same name is created with the username as its only member. Other users can be added to the group later. One of the purposes of groups is to implement a simple access control to files and other system resources by setting the right permissions on those resources. + +For example, suppose you have the following users. + +- user1 (primary group: user1) +- user2 (primary group: user2) +- user3 (primary group: user3) + +All of them need read and write access to a file called common.txt located somewhere on your local system, or maybe on a network share that user1 has created. You may be tempted to do something like, + + # chmod 660 common.txt + OR + # chmod u=rw,g=rw,o= common.txt [notice the space between the last equal sign and the file name] + +However, this will only provide read and write access to the owner of the file and to those users who are members of the group owner of the file (user1 in this case). Again, you may be tempted to add user2 and user3 to group user1, but that will also give them access to the rest of the files owned by user user1 and group user1. + +This is where groups come in handy, and here’s what you should do in a case like this. + +**Understanding Setuid** + +When the setuid permission is applied to an executable file, an user running the program inherits the effective privileges of the program’s owner. Since this approach can reasonably raise security concerns, the number of files with setuid permission must be kept to a minimum. You will likely find programs with this permission set when a system user needs to access a file owned by root. + +Summing up, it isn’t just that the user can execute the binary file, but also that he can do so with root’s privileges. For example, let’s check the permissions of /bin/passwd. This binary is used to change the password of an account, and modifies the /etc/shadow file. The superuser can change anyone’s password, but all other users should only be able to change their own. + +![passwd Command Examples](http://www.tecmint.com/wp-content/uploads/2014/10/passwd-command.png) + +passwd Command Examples + +Thus, any user should have permission to run /bin/passwd, but only root will be able to specify an account. Other users can only change their corresponding passwords. + +![Change User Password in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/change-user-password.png) + +Change User Password + +**Understanding Setgid** + +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. You will most likely use this approach whenever members of a certain group need access to all the files in a directory, regardless of the file owner’s primary group. + + # 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] + +**Setting the SETGID in a directory** + +![Add Setgid in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/add-setgid-to-directory.png) + +Add Setgid to Directory + +**Understanding Sticky Bit** + +When the “sticky bit” is set on files, Linux just ignores it, whereas for directories it has the effect of preventing users from deleting or even renaming the files it contains unless the user owns the directory, the file, or is root. + +# chmod o+t [directory] + +To set the sticky bit in octal form, prepend the number 1 to the current (or desired) basic permissions. + +# chmod 1755 [directory] + +Without the sticky bit, anyone able to write to the directory can delete or rename files. For that reason, the sticky bit is commonly found on directories, such as /tmp, that are world-writable. + +![Add Stickybit in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/add-sticky-bit-to-directory.png) + +Add Stickybit to Directory + +### Special Linux File Attributes ### + +There are other attributes that enable further limits on the operations that are allowed on files. For example, prevent the file from being renamed, moved, deleted, or even modified. They are set with the [chattr command][4] and can be viewed using the lsattr tool, as follows. + + # chattr +i file1 + # chattr +a file2 + +After executing those two commands, file1 will be immutable (which means it cannot be moved, renamed, modified or deleted) whereas file2 will enter append-only mode (can only be open in append mode for writing). + +![Protect File from Deletion](http://www.tecmint.com/wp-content/uploads/2014/10/chattr-command.png) + +Chattr Command to Protect Files + +### Accessing the root Account and Using sudo ### + +One of the ways users can gain access to the root account is by typing. + + $ su + +and then entering root’s password. + +If authentication succeeds, you will be logged on as root with the current working directory as the same as you were before. If you want to be placed in root’s home directory instead, run. + + $ su - + +and then enter root’s password. + +![Enable sudo Access on Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Enable-Sudo-Access.png) + +Enable Sudo Access on Users + +The above procedure requires that a normal user knows root’s password, which poses a serious security risk. For that reason, the sysadmin can configure the sudo command to allow an ordinary user to execute commands as a different user (usually the superuser) in a very controlled and limited way. Thus, restrictions can be set on a user so as to enable him to run one or more specific privileged commands and no others. + +- Read Also: [Difference Between su and sudo User][5] + +To authenticate using sudo, the user uses his/her own password. After entering the command, we will be prompted for our password (not the superuser’s) and if the authentication succeeds (and if the user has been granted privileges to run the command), the specified command is carried out. + +To grant access to sudo, the system administrator must edit the /etc/sudoers file. It is recommended that this file is edited using the visudo command instead of opening it directly with a text editor. + + # visudo + +This opens the /etc/sudoers file using vim (you can follow the instructions given in [Install and Use vim as Editor – Part 2][6] of this series to edit the file). + +These are the most relevant lines. + + Defaults secure_path="/usr/sbin:/usr/bin:/sbin" + root ALL=(ALL) ALL + tecmint ALL=/bin/yum update + gacanepa ALL=NOPASSWD:/bin/updatedb + %admin ALL=(ALL) ALL + +Let’s take a closer look at them. + + Defaults secure_path="/usr/sbin:/usr/bin:/sbin:/usr/local/bin" + +This line lets you specify the directories that will be used for sudo, and is used to prevent using user-specific directories, which can harm the system. + +The next lines are used to specify permissions. + + root ALL=(ALL) ALL + +- The first ALL keyword indicates that this rule applies to all hosts. +- The second ALL indicates that the user in the first column can run commands with the privileges of any user. +- The third ALL means any command can be run. + + tecmint ALL=/bin/yum update + +If no user is specified after the = sign, sudo assumes the root user. In this case, user tecmint will be able to run yum update as root. + + gacanepa ALL=NOPASSWD:/bin/updatedb + +The NOPASSWD directive allows user gacanepa to run /bin/updatedb without needing to enter his password. + + %admin ALL=(ALL) ALL + +The % sign indicates that this line applies to a group called “admin”. The meaning of the rest of the line is identical to that of an regular user. This means that members of the group “admin” can run all commands as any user on all hosts. + +To see what privileges are granted to you by sudo, use the “-l” option to list them. + +![Sudo Access Rules](http://www.tecmint.com/wp-content/uploads/2014/10/sudo-access-rules.png) + +Sudo Access Rules + +### Summary ### + +Effective user and file management skills are essential tools for any system administrator. In this article we have covered the basics and hope you can use it as a good starting to point to build upon. Feel free to leave your comments or questions below, and we’ll respond quickly. + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/manage-users-and-groups-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/add-users-in-linux/ +[2]:http://www.tecmint.com/usermod-command-examples/ +[3]:http://www.tecmint.com/compress-files-and-finding-files-in-linux/ +[4]:http://www.tecmint.com/chattr-command-examples/ +[5]:http://www.tecmint.com/su-vs-sudo-and-how-to-configure-sudo-in-linux/ +[6]:http://www.tecmint.com/vi-editor-usage/ \ No newline at end of file diff --git a/sources/tech/LFCS/Part 9 - LFCS--Linux Package Management with Yum RPM Apt Dpkg Aptitude and Zypper.md b/sources/tech/LFCS/Part 9 - LFCS--Linux Package Management with Yum RPM Apt Dpkg Aptitude and Zypper.md new file mode 100644 index 0000000000..7b58a467d7 --- /dev/null +++ b/sources/tech/LFCS/Part 9 - LFCS--Linux Package Management with Yum RPM Apt Dpkg Aptitude and Zypper.md @@ -0,0 +1,229 @@ +Part 9 - LFCS: Linux Package Management with Yum, RPM, Apt, Dpkg, Aptitude and Zypper +================================================================================ +Last August, the Linux Foundation announced the LFCS certification (Linux Foundation Certified Sysadmin), a shiny chance for system administrators everywhere to demonstrate, through a performance-based exam, that they are capable of succeeding at overall operational support for Linux systems. A Linux Foundation Certified Sysadmin has the expertise to ensure effective system support, first-level troubleshooting and monitoring, including finally issue escalation, when needed, to engineering support teams. + +![Linux Package Management](http://www.tecmint.com/wp-content/uploads/2014/11/lfcs-Part-9.png) + +Linux Foundation Certified Sysadmin – Part 9 + +Watch the following video that explains about the Linux Foundation Certification Program. + +注:youtube 视频 + + +This article is a Part 9 of 10-tutorial long series, today in this article we will guide you about Linux Package Management, that are required for the LFCS certification exam. + +### Package Management ### + +In few words, package management is a method of installing and maintaining (which includes updating and probably removing as well) software on the system. + +In the early days of Linux, programs were only distributed as source code, along with the required man pages, the necessary configuration files, and more. Nowadays, most Linux distributors use by default pre-built programs or sets of programs called packages, which are presented to users ready for installation on that distribution. However, one of the wonders of Linux is still the possibility to obtain source code of a program to be studied, improved, and compiled. + +**How package management systems work** + +If a certain package requires a certain resource such as a shared library, or another package, it is said to have a dependency. All modern package management systems provide some method of dependency resolution to ensure that when a package is installed, all of its dependencies are installed as well. + +**Packaging Systems** + +Almost all the software that is installed on a modern Linux system will be found on the Internet. It can either be provided by the distribution vendor through central repositories (which can contain several thousands of packages, each of which has been specifically built, tested, and maintained for the distribution) or be available in source code that can be downloaded and installed manually. + +Because different distribution families use different packaging systems (Debian: *.deb / CentOS: *.rpm / openSUSE: *.rpm built specially for openSUSE), a package intended for one distribution will not be compatible with another distribution. However, most distributions are likely to fall into one of the three distribution families covered by the LFCS certification. + +**High and low-level package tools** + +In order to perform the task of package management effectively, you need to be aware that you will have two types of available utilities: low-level tools (which handle in the backend the actual installation, upgrade, and removal of package files), and high-level tools (which are in charge of ensuring that the tasks of dependency resolution and metadata searching -”data about the data”- are performed). + +注:表格 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
DISTRIBUTIONLOW-LEVEL TOOLHIGH-LEVEL TOOL
 Debian and derivatives dpkg apt-get / aptitude
 CentOS rpm yum
 openSUSE rpm zypper
+ +Let us see the descrption of the low-level and high-level tools. + +dpkg is a low-level package manager for Debian-based systems. It can install, remove, provide information about and build *.deb packages but it can’t automatically download and install their corresponding dependencies. + +- Read More: [15 dpkg Command Examples][1] + +apt-get is a high-level package manager for Debian and derivatives, and provides a simple way to retrieve and install packages, including dependency resolution, from multiple sources using the command line. Unlike dpkg, apt-get does not work directly with *.deb files, but with the package proper name. + +- Read More: [25 apt-get Command Examples][2] + +aptitude is another high-level package manager for Debian-based systems, and can be used to perform management tasks (installing, upgrading, and removing packages, also handling dependency resolution automatically) in a fast and easy way. It provides the same functionality as apt-get and additional ones, such as offering access to several versions of a package. + +rpm is the package management system used by Linux Standard Base (LSB)-compliant distributions for low-level handling of packages. Just like dpkg, it can query, install, verify, upgrade, and remove packages, and is more frequently used by Fedora-based distributions, such as RHEL and CentOS. + +- Read More: [20 rpm Command Examples][3] + +yum adds the functionality of automatic updates and package management with dependency management to RPM-based systems. As a high-level tool, like apt-get or aptitude, yum works with repositories. + +- Read More: [20 yum Command Examples][4] +- +### Common Usage of Low-Level Tools ### + +The most frequent tasks that you will do with low level tools are as follows: + +**1. Installing a package from a compiled (*.deb or *.rpm) file** + +The downside of this installation method is that no dependency resolution is provided. You will most likely choose to install a package from a compiled file when such package is not available in the distribution’s repositories and therefore cannot be downloaded and installed through a high-level tool. Since low-level tools do not perform dependency resolution, they will exit with an error if we try to install a package with unmet dependencies. + + # dpkg -i file.deb [Debian and derivative] + # rpm -i file.rpm [CentOS / openSUSE] + +**Note**: Do not attempt to install on CentOS a *.rpm file that was built for openSUSE, or vice-versa! + +**2. Upgrading a package from a compiled file** + +Again, you will only upgrade an installed package manually when it is not available in the central repositories. + + # dpkg -i file.deb [Debian and derivative] + # rpm -U file.rpm [CentOS / openSUSE] + +**3. Listing installed packages** + +When you first get your hands on an already working system, chances are you’ll want to know what packages are installed. + + # dpkg -l [Debian and derivative] + # rpm -qa [CentOS / openSUSE] + +If you want to know whether a specific package is installed, you can pipe the output of the above commands to grep, as explained in [manipulate files in Linux – Part 1][6] of this series. Suppose we need to verify if package mysql-common is installed on an Ubuntu system. + + # dpkg -l | grep mysql-common + +![Check Installed Packages in Linux](http://www.tecmint.com/wp-content/uploads/2014/11/Check-Installed-Package.png) + +Check Installed Packages + +Another way to determine if a package is installed. + + # dpkg --status package_name [Debian and derivative] + # rpm -q package_name [CentOS / openSUSE] + +For example, let’s find out whether package sysdig is installed on our system. + + # rpm -qa | grep sysdig + +![Check sysdig Package](http://www.tecmint.com/wp-content/uploads/2014/11/Check-sysdig-Package.png) + +Check sysdig Package + +**4. Finding out which package installed a file** + + # dpkg --search file_name + # rpm -qf file_name + +For example, which package installed pw_dict.hwm? + + # rpm -qf /usr/share/cracklib/pw_dict.hwm + +![Query File in Linux](http://www.tecmint.com/wp-content/uploads/2014/11/Query-File-in-Linux.png) + +Query File in Linux + +### Common Usage of High-Level Tools ### + +The most frequent tasks that you will do with high level tools are as follows. + +**1. Searching for a package** + +aptitude update will update the list of available packages, and aptitude search will perform the actual search for package_name. + + # aptitude update && aptitude search package_name + +In the search all option, yum will search for package_name not only in package names, but also in package descriptions. + + # yum search package_name + # yum search all package_name + # yum whatprovides “*/package_name” + +Let’s supposed we need a file whose name is sysdig. To know that package we will have to install, let’s run. + + # yum whatprovides “*/sysdig” + +![Check Package Description in Linux](http://www.tecmint.com/wp-content/uploads/2014/11/Check-Package-Description.png) + +Check Package Description + +whatprovides tells yum to search the package the will provide a file that matches the above regular expression. + + # zypper refresh && zypper search package_name [On openSUSE] + +**2. Installing a package from a repository** + +While installing a package, you may be prompted to confirm the installation after the package manager has resolved all dependencies. Note that running update or refresh (according to the package manager being used) is not strictly necessary, but keeping installed packages up to date is a good sysadmin practice for security and dependency reasons. + + # aptitude update && aptitude install package_name [Debian and derivatives] + # yum update && yum install package_name [CentOS] + # zypper refresh && zypper install package_name [openSUSE] + +**3. Removing a package** + +The option remove will uninstall the package but leaving configuration files intact, whereas purge will erase every trace of the program from your system. +# aptitude remove / purge package_name +# yum erase package_name + + ---Notice the minus sign in front of the package that will be uninstalled, openSUSE --- + + # zypper remove -package_name + +Most (if not all) package managers will prompt you, by default, if you’re sure about proceeding with the uninstallation before actually performing it. So read the onscreen messages carefully to avoid running into unnecessary trouble! + +**4. Displaying information about a package** + +The following command will display information about the birthday package. + + # aptitude show birthday + # yum info birthday + # zypper info birthday + +![Check Package Information in Linux](http://www.tecmint.com/wp-content/uploads/2014/11/Check-Package-Information.png) + +Check Package Information + +### Summary ### + +Package management is something you just can’t sweep under the rug as a system administrator. You should be prepared to use the tools described in this article at a moment’s notice. Hope you find it useful in your preparation for the LFCS exam and for your daily tasks. Feel free to leave your comments or questions below. We will be more than glad to get back to you as soon as possible. + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/linux-package-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/dpkg-command-examples/ +[2]:http://www.tecmint.com/useful-basic-commands-of-apt-get-and-apt-cache-for-package-management/ +[3]:http://www.tecmint.com/20-practical-examples-of-rpm-commands-in-linux/ +[4]:http://www.tecmint.com/20-linux-yum-yellowdog-updater-modified-commands-for-package-mangement/ +[5]:http://www.tecmint.com/sed-command-to-create-edit-and-manipulate-files-in-linux/ \ No newline at end of file From e07871e6e337a534fa779edab8cbf90a275f9fa3 Mon Sep 17 00:00:00 2001 From: DeadFire Date: Tue, 18 Aug 2015 17:04:51 +0800 Subject: [PATCH 369/507] =?UTF-8?q?20150818-2=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... Limits--IBM Launch LinuxONE Mainframes.md | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 sources/news/20150818 Linux Without Limits--IBM Launch LinuxONE Mainframes.md diff --git a/sources/news/20150818 Linux Without Limits--IBM Launch LinuxONE Mainframes.md b/sources/news/20150818 Linux Without Limits--IBM Launch LinuxONE Mainframes.md new file mode 100644 index 0000000000..f97c690e3a --- /dev/null +++ b/sources/news/20150818 Linux Without Limits--IBM Launch LinuxONE Mainframes.md @@ -0,0 +1,52 @@ +Linux Without Limits: IBM Launch LinuxONE Mainframes +================================================================================ +![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/08/Screenshot-2015-08-17-at-12.58.10.png) + +LinuxONE Emperor MainframeGood news for Ubuntu’s server team today as [IBM launch the LinuxONE][1] a Linux-only mainframe that is also able to run Ubuntu. + +The largest of the LinuxONE systems launched by IBM is called ‘Emperor’ and can scale up to 8000 virtual machines or tens of thousands of containers – a possible record for any one single Linux system. + +The LinuxONE is described by IBM as a ‘game changer’ that ‘unleashes the potential of Linux for business’. + +IBM and Canonical are working together on the creation of an Ubuntu distribution for LinuxONE and other IBM z Systems. Ubuntu will join RedHat and SUSE as ‘premier Linux distributions’ on IBM z. + +Alongside the ‘Emperor’ IBM is also offering the LinuxONE Rockhopper, a smaller mainframe for medium-sized businesses and organisations. + +IBM is the market leader in mainframes and commands over 90% of the mainframe market. + +注:youtube 视频 + + +### What Is a Mainframe Computer Used For? ### + +The computer you’re reading this article on would be dwarfed by a ‘big iron’ mainframe. They are large, hulking great cabinets packed full of high-end components, custom designed technology and dizzying amounts of storage (that is data storage, not ample room for pens and rulers). + +Mainframes computers are used by large organizations and businesses to process and store large amounts of data, crunch through statistics, and handle large-scale transaction processing. + +### ‘World’s Fastest Processor’ ### + +IBM has teamed up with Canonical Ltd to use Ubuntu on the LinuxONE and other IBM z Systems. + +The LinuxONE Emperor uses the IBM z13 processor. The chip, announced back in January, is said to be the world’s fastest microprocessor. It is able to deliver transaction response times in the milliseconds. + +But as well as being well equipped to handle for high-volume mobile transactions, the z13 inside the LinuxONE is also an ideal cloud system. + +It can handle more than 50 virtual servers per core for a total of 8000 virtual servers, making it a cheaper, greener and more performant way to scale-out to the cloud. + +**You don’t have to be a CIO or mainframe spotter to appreciate this announcement. The possibilities LinuxONE provides are clear enough. ** + +Source: [Reuters (h/t @popey)][2] + +-------------------------------------------------------------------------------- + +via: http://www.omgubuntu.co.uk/2015/08/ibm-linuxone-mainframe-ubuntu-partnership + +作者:[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-03.ibm.com/systems/z/announcement.html +[2]:http://www.reuters.com/article/2015/08/17/us-ibm-linuxone-idUSKCN0QM09P20150817 \ No newline at end of file From bb62496b06ad16f7baf2c1a992b84d7f73b156c7 Mon Sep 17 00:00:00 2001 From: DeadFire Date: Tue, 18 Aug 2015 17:29:00 +0800 Subject: [PATCH 370/507] =?UTF-8?q?20150818-3=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...After More than 8 Years--See Comparison.md | 344 ++++++++++++++++++ ... 22 Years of Journey and Still Counting.md | 109 ++++++ ...k quotes from the command line on Linux.md | 99 +++++ 3 files changed, 552 insertions(+) create mode 100644 sources/talk/20150818 A Linux User Using Windows 10 After More than 8 Years--See Comparison.md create mode 100644 sources/talk/20150818 Debian GNU or Linux Birthday-- A 22 Years of Journey and Still Counting.md create mode 100644 sources/tech/20150818 How to monitor stock quotes from the command line on Linux.md diff --git a/sources/talk/20150818 A Linux User Using Windows 10 After More than 8 Years--See Comparison.md b/sources/talk/20150818 A Linux User Using Windows 10 After More than 8 Years--See Comparison.md new file mode 100644 index 0000000000..cf472613c4 --- /dev/null +++ b/sources/talk/20150818 A Linux User Using Windows 10 After More than 8 Years--See Comparison.md @@ -0,0 +1,344 @@ +A Linux User Using ‘Windows 10′ After More than 8 Years – See Comparison +================================================================================ +Windows 10 is the newest member of windows NT family of which general availability was made on July 29, 2015. It is the successor of Windows 8.1. Windows 10 is supported on Intel Architecture 32 bit, AMD64 and ARMv7 processors. + +![Windows 10 and Linux Comparison](http://www.tecmint.com/wp-content/uploads/2015/08/Windows-10-vs-Linux.jpg) + +Windows 10 and Linux Comparison + +As a Linux-user for more than 8 continuous years, I thought to test Windows 10, as it is making a lots of news these days. This article is a breakthrough of my observation. I will be seeing everything from the perspective of a Linux user so you may find it a bit biased towards Linux but with absolutely no false information. + +1. I searched Google with the text “download windows 10” and clicked the first link. + +![Search Windows 10](http://www.tecmint.com/wp-content/uploads/2015/08/Search-Windows-10.jpg) + +Search Windows 10 + +You may directly go to link : [https://www.microsoft.com/en-us/software-download/windows10ISO][1] + +2. I was supposed to select a edition from ‘windows 10‘, ‘windows 10 KN‘, ‘windows 10 N‘ and ‘windows 10 single language‘. + +![Select Windows 10 Edition](http://www.tecmint.com/wp-content/uploads/2015/08/Select-Windows-10-Edition.jpg) + +Select Windows 10 Edition + +For those who want to know details of different editions of Windows 10, here is the brief details of editions. + +- Windows 10 – Contains everything offered by Microsoft for this OS. +- Windows 10N – This edition comes without Media-player. +- Windows 10KN – This edition comes without media playing capabilities. +- Windows 10 Single Language – Only one Language Pre-installed. + +3. I selected the first option ‘Windows 10‘ and clicked ‘Confirm‘. Then I was supposed to select a product language. I choose ‘English‘. + +I was provided with Two Download Links. One for 32-bit and other for 64-bit. I clicked 64-bit, as per my architecture. + +![Download Windows 10](http://www.tecmint.com/wp-content/uploads/2015/08/Download-Windows-10.jpg) + +Download Windows 10 + +With my download speed (15Mbps), it took me 3 long hours to download it. Unfortunately there were no torrent file to download the OS, which could otherwise have made the overall process smooth. The OS iso image size is 3.8 GB. + +I could not find an image of smaller size but again the truth is there don’t exist net-installer image like things for Windows. Also there is no way to calculate hash value after the iso image has been downloaded. + +Wonder why so ignorance from windows on such issues. To verify if the iso is downloaded correctly I need to write the image to a disk or to a USB flash drive and then boot my system and keep my finger crossed till the setup is finished. + +Lets start. I made my USB flash drive bootable with the windows 10 iso using dd command, as: + + # dd if=/home/avi/Downloads/Win10_English_x64.iso of=/dev/sdb1 bs=512M; sync + +It took a few minutes to complete the process. I then rebooted the system and choose to boot from USB flash Drive in my UEFI (BIOS) settings. + +#### System Requirements #### + +If you are upgrading + +- Upgrade supported only from Windows 7 SP1 or Windows 8.1 + +If you are fresh Installing + +- Processor: 1GHz or faster +- RAM : 1GB and Above(32-bit), 2GB and Above(64-bit) +- HDD: 16GB and Above(32-bit), 20GB and Above(64-bit) +- Graphic card: DirectX 9 or later + WDDM 1.0 Driver + +### Installation of Windows 10 ### + +1. Windows 10 boots. Yet again they changed the logo. Also no information on whats going on. + +![Windows 10 Logo](http://www.tecmint.com/wp-content/uploads/2015/08/Windows-10-Logo.jpg) + +Windows 10 Logo + +2. Selected Language to install, Time & currency format and keyboard & Input methods before clicking Next. + +![Select Language and Time](http://www.tecmint.com/wp-content/uploads/2015/08/Select-Language-and-Time.jpg) + +Select Language and Time + +3. And then ‘Install Now‘ Menu. + +![Install Windows 10](http://www.tecmint.com/wp-content/uploads/2015/08/Install-Windows-10.jpg) + +Install Windows 10 + +4. The next screen is asking for Product key. I clicked ‘skip’. + +![Windows 10 Product Key](http://www.tecmint.com/wp-content/uploads/2015/08/Windows-10-Product-Key.jpg) + +Windows 10 Product Key + +5. Choose from a listed OS. I chose ‘windows 10 pro‘. + +![Select Install Operating System](http://www.tecmint.com/wp-content/uploads/2015/08/Select-Install-Operating-System.jpg) + +Select Install Operating System + +6. oh yes the license agreement. Put a check mark against ‘I accept the license terms‘ and click next. + +![Accept License](http://www.tecmint.com/wp-content/uploads/2015/08/Accept-License.jpg) + +Accept License + +7. Next was to upgrade (to windows 10 from previous versions of windows) and Install Windows. Don’t know why custom: Windows Install only is suggested as advanced by windows. Anyway I chose to Install windows only. + +![Select Installation Type](http://www.tecmint.com/wp-content/uploads/2015/08/Select-Installation-Type.jpg) + +Select Installation Type + +8. Selected the file-system and clicked ‘next’. + +![Select Install Drive](http://www.tecmint.com/wp-content/uploads/2015/08/Select-Install-Drive.jpg) + +Select Install Drive + +9. The installer started to copy files, getting files ready for installation, installing features, installing updates and finishing up. It would be better if the installer would have shown verbose output on the action is it taking. + +![Installing Windows](http://www.tecmint.com/wp-content/uploads/2015/08/Installing-Windows.jpg) + +Installing Windows + +10. And then windows restarted. They said reboot was needed to continue. + +![Windows Installation Process](http://www.tecmint.com/wp-content/uploads/2015/08/Windows-Installation-Process.jpg) + +Windows Installation Process + +11. And then all I got was the below screen which reads “Getting Ready”. It took 5+ minutes at this point. No idea what was going on. No output. + +![Windows Getting Ready](http://www.tecmint.com/wp-content/uploads/2015/08/Windows-Getting-Ready.jpg) + +Windows Getting Ready + +12. yet again, it was time to “Enter Product Key”. I clicked “Do this later” and then used expressed settings. + +![Enter Product Key](http://www.tecmint.com/wp-content/uploads/2015/08/Enter-Product-Key.jpg) + +Enter Product Key + +![Select Express Settings](http://www.tecmint.com/wp-content/uploads/2015/08/Select-Express-Settings.jpg) + +Select Express Settings + +14. And then three more output screens, where I as a Linuxer expected that the Installer will tell me what it is doing but all in vain. + +![Loading Windows](http://www.tecmint.com/wp-content/uploads/2015/08/Loading-Windows.jpg) + +Loading Windows + +![Getting Updates](http://www.tecmint.com/wp-content/uploads/2015/08/Getting-Updates.jpg) + +Getting Updates + +![Still Loading Windows](http://www.tecmint.com/wp-content/uploads/2015/08/Still-Loading-Windows.jpg) + +Still Loading Windows + +15. And then the installer wanted to know who owns this machine “My organization” or I myself. Chose “I own it” and then next. + +![Select Organization](http://www.tecmint.com/wp-content/uploads/2015/08/Select-Organization.jpg) + +Select Organization + +16. Installer prompted me to join “Azure Ad” or “Join a domain”, before I can click ‘continue’. I chooses the later option. + +![Connect Windows](http://www.tecmint.com/wp-content/uploads/2015/08/Connect-Windows.jpg) + +Connect Windows + +17. The Installer wants me to create an account. So I entered user_name and clicked ‘Next‘, I was expecting an error message that I must enter a password. + +![Create Account](http://www.tecmint.com/wp-content/uploads/2015/08/Create-Account.jpg) + +Create Account + +18. To my surprise Windows didn’t even showed warning/notification that I must create password. Such a negligence. Anyway I got my desktop. + +![Windows 10 Desktop](http://www.tecmint.com/wp-content/uploads/2015/08/Windows-10-Desktop.jpg) + +Windows 10 Desktop + +#### Experience of a Linux-user (Myself) till now #### + +- No Net-installer Image +- Image size too heavy +- No way to check the integrity of iso downloaded (no hash check) +- The booting and installation remains same as it was in XP, Windows 7 and 8 perhaps. +- As usual no output on what windows Installer is doing – What file copying or what package installing. +- Installation was straight forward and easy as compared to the installation of a Linux distribution. + +### Windows 10 Testing ### + +19. The default Desktop is clean. It has a recycle bin Icon on the default desktop. Search web directly from the desktop itself. Additionally icons for Task viewing, Internet browsing, folder browsing and Microsoft store is there. As usual notification bar is present on the bottom right to sum up desktop. + +![Deskop Shortcut Icons](http://www.tecmint.com/wp-content/uploads/2015/08/Deskop-Shortcut-icons.jpg) + +Deskop Shortcut Icons + +20. Internet Explorer replaced with Microsoft Edge. Windows 10 has replace the legacy web browser Internet Explorer also known as IE with Edge aka project spartan. + +![Microsoft Edge Browser](http://www.tecmint.com/wp-content/uploads/2015/08/Edge-browser.jpg) + +Microsoft Edge Browser + +It is fast at least as compared to IE (as it seems it testing). Familiar user Interface. The home screen contains news feed updates. There is also a search bar title that reads ‘Where to next?‘. The browser loads time is considerably low which result in improving overall speed and performance. The memory usages of Edge seems normal. + +![Windows Performance](http://www.tecmint.com/wp-content/uploads/2015/08/Windows-Performance.jpg) + +Windows Performance + +Edge has got cortana – Intelligent Personal Assistant, Support for chrome-extension, web Note – Take notes while Browsing, Share – Right from the tab without opening any other TAB. + +#### Experience of a Linux-user (Myself) on this point #### + +21. Microsoft has really improved web browsing. Lets see how stable and fine it remains. It don’t lag as of now. + +22. Though RAM usages by Edge was fine for me, a lots of users are complaining that Edge is notorious for Excessive RAM Usages. + +23. Difficult to say at this point if Edge is ready to compete with Chrome and/or Firefox at this point of time. Lets see what future unfolds. + +#### A few more Virtual Tour #### + +24. Start Menu redesigned – Seems clear and effective. Metro icons make it live. Populated with most commonly applications viz., Calendar, Mail, Edge, Photos, Contact, Temperature, Companion suite, OneNote, Store, Xbox, Music, Movies & TV, Money, News, Store, etc. + +![Windows Look and Feel](http://www.tecmint.com/wp-content/uploads/2015/08/Windows-Look.jpg) + +Windows Look and Feel + +In Linux on Gnome Desktop Environment, I use to search required applications simply by pressing windows key and then type the name of the application. + +![Search Within Desktop](http://www.tecmint.com/wp-content/uploads/2015/08/Search-Within-Desktop.jpg) + +Search Within Desktop + +25. File Explorer – seems clear Designing. Edges are sharp. In the left pane there is link to quick access folders. + +![Windows File Explorer](http://www.tecmint.com/wp-content/uploads/2015/08/Windows-File-Explorer.jpg) + +Windows File Explorer + +Equally clear and effective file explorer on Gnome Desktop Environment on Linux. Removed UN-necessary graphics and images from icons is a plus point. + +![File Browser on Gnome](http://www.tecmint.com/wp-content/uploads/2015/08/File-Browser.jpg) + +File Browser on Gnome + +26. Settings – Though the settings are a bit refined on Windows 10, you may compare it with the settings on a Linux Box. + +**Settings on Windows** + +![Windows 10 Settings](http://www.tecmint.com/wp-content/uploads/2015/08/Windows-10-Settings.jpg) + +Windows 10 Settings + +**Setting on Linux Gnome** + +![Gnome Settings](http://www.tecmint.com/wp-content/uploads/2015/08/Gnome-Settings.jpg) + +Gnome Settings + +27. List of Applications – List of Application on Linux is better than what they use to provide (based upon my memory, when I was a regular windows user) but still it stands low as compared to how Gnome3 list application. + +**Application Listed by Windows** + +![Application List on Windows 10](http://www.tecmint.com/wp-content/uploads/2015/08/Application-List-on-Windows-10.jpg) + +Application List on Windows 10 + +**Application Listed by Gnome3 on Linux** + +![Gnome Application List on Linux](http://www.tecmint.com/wp-content/uploads/2015/08/Gnome-Application-List-on-Linux.jpg) + +Gnome Application List on Linux + +28. Virtual Desktop – Virtual Desktop feature of Windows 10 is one of those topic which are very much talked about these days. + +Here is the virtual Desktop in Windows 10. + +![Windows Virtual Desktop](http://www.tecmint.com/wp-content/uploads/2015/08/Windows-Virtual-Desktop.jpg) + +Windows Virtual Desktop + +and the virtual Desktop on Linux we are using for more than 2 decades. + +![Virtual Desktop on Linux](http://www.tecmint.com/wp-content/uploads/2015/08/Virtual-Desktop-on-Linux.jpg) + +Virtual Desktop on Linux + +#### A few other features of Windows 10 #### + +29. Windows 10 comes with wi-fi sense. It shares your password with others. Anyone who is in the range of your wi-fi and connected to you over Skype, Outlook, Hotmail or Facebook can be granted access to your wifi network. And mind it this feature has been added as a feature by microsoft to save time and hassle-free connection. + +In a reply to question raised by Tecmint, Microsoft said – The user has to agree to enable wifi sense, everytime on a new network. oh! What a pathetic taste as far as security is concerned. I am not convinced. + +30. Up-gradation from Windows 7 and Windows 8.1 is free though the retail cost of Home and pro editions are approximately $119 and $199 respectively. + +31. Microsoft released first cumulative update for windows 10, which is said to put system into endless crash loop for a few people. Windows perhaps don’t understand such problem or don’t want to work on that part don’t know why. + +32. Microsoft’s inbuilt utility to block/hide unwanted updates don’t work in my case. This means If a update is there, there is no way to block/hide it. Sorry windows users! + +#### A few features native to Linux that windows 10 have #### + +Windows 10 has a lots of features that were taken directly from Linux. If Linux were not released under GNU License perhaps Microsoft would never had the below features. + +33. Command-line package management – Yup! You heard it right. Windows 10 has a built-in package management. It works only in Windows Power Shell. OneGet is the official package manager for windows. Windows package manager in action. + +![Windows 10 Package Manager](http://www.tecmint.com/wp-content/uploads/2015/08/Windows-10-Package-Manager.jpg) + +Windows 10 Package Manager + +- Border-less windows +- Flat Icons +- Virtual Desktop +- One search for Online+offline search +- Convergence of mobile and desktop OS + +### Overall Conclusion ### + +- Improved responsiveness +- Well implemented Animation +- low on resource +- Improved battery life +- Microsoft Edge web-browser is rock solid +- Supported on Raspberry pi 2. +- It is good because windows 8/8.1 was not upto mark and really bad. +- It is a the same old wine in new bottle. Almost the same things with brushed up icons. + +What my testing suggest is Windows 10 has improved on a few things like look and feel (as windows always did), +1 for Project spartan, Virtual Desktop, Command-line package management, one search for online and offline search. It is overall an improved product but those who thinks that Windows 10 will prove to be the last nail in the coffin of Linux are mistaken. + +Linux is years ahead of Windows. Their approach is different. In near future windows won’t stand anywhere around Linux and there is nothing for which a Linux user need to go to Windows 10. + +That’s all for now. Hope you liked the post. I will be here again with another interesting post you people will love to read. Provide us with your valuable feedback in the comments below. + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/a-linux-user-using-windows-10-after-more-than-8-years-see-comparison/ + +作者:[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]:https://www.microsoft.com/en-us/software-download/windows10ISO \ No newline at end of file diff --git a/sources/talk/20150818 Debian GNU or Linux Birthday-- A 22 Years of Journey and Still Counting.md b/sources/talk/20150818 Debian GNU or Linux Birthday-- A 22 Years of Journey and Still Counting.md new file mode 100644 index 0000000000..f74384b616 --- /dev/null +++ b/sources/talk/20150818 Debian GNU or Linux Birthday-- A 22 Years of Journey and Still Counting.md @@ -0,0 +1,109 @@ +Debian GNU/Linux Birthday : A 22 Years of Journey and Still Counting… +================================================================================ +On 16th August 2015, the Debian project has celebrated its 22nd anniversary, making it one of the oldest popular distribution in open source world. Debian project was conceived and founded in the year 1993 by Ian Murdock. By that time Slackware had already made a remarkable presence as one of the earliest Linux Distribution. + +![Happy 22nd Birthday to Debian](http://www.tecmint.com/wp-content/uploads/2014/08/Debian-22nd-Birthday.png) + +Happy 22nd Birthday to Debian Linux + +Ian Ashley Murdock, an American Software Engineer by profession, conceived the idea of Debian project, when he was a student of Purdue University. He named the project Debian after the name of his then-girlfriend Debra Lynn (Deb) and his name. He later married her and then got divorced in January 2008. + +![Ian Murdock](http://www.tecmint.com/wp-content/uploads/2014/08/Ian-Murdock.jpeg) + +Debian Creator: Ian Murdock + +Ian is currently serving as Vice President of Platform and Development Community at ExactTarget. + +Debian (as Slackware) was the result of unavailability of up-to mark Linux Distribution, that time. Ian in an interview said – “Providing the first class Product without profit would be the sole aim of Debian Project. Even Linux was not reliable and up-to mark that time. I Remember…. Moving files between file-system and dealing with voluminous file would often result in Kernel Panic. However the project Linux was promising. The availability of Source Code freely and the potential it seemed was qualitative.” + +I remember … like everyone else I wanted to solve problem, run something like UNIX at home, but it was not possible…neither financially nor legally, in the other sense . Then I come to know about GNU kernel Development and its non-association with any kind of legal issues, he added. He was sponsored by Free Software Foundation (FSF) in the early days when he was working on Debian, it also helped Debian to take a giant step though Ian needed to finish his degree and hence quited FSF roughly after one year of sponsorship. + +### Debian Development History ### + +- **Debian 0.01 – 0.09** : Released between August 1993 – December 1993. +- **Debian 0.91 ** – Released in January 1994 with primitive package system, No dependencies. +- **Debian 0.93 rc5** : March 1995. It is the first modern release of Debian, dpkg was used to install and maintain packages after base system installation. +- **Debian 0.93 rc6**: Released in November 1995. It was last a.out release, deselect made an appearance for the first time – 60 developers were maintaining packages, then at that time. +- **Debian 1.1**: Released in June 1996. Code name – Buzz, Packages count – 474, Package Manager dpkg, Kernel 2.0, ELF. +- **Debian 1.2**: Released in December 1996. Code name – Rex, Packages count – 848, Developers Count – 120. +- **Debian 1.3**: Released in July 1997. Code name – Bo, package count 974, Developers count – 200. +- **Debian 2.0**: Released in July 1998. Code name: Hamm, Support for architecture – Intel i386 and Motorola 68000 series, Number of Packages: 1500+, Number of Developers: 400+, glibc included. +- **Debian 2.1**: Released on March 09, 1999. Code name – slink, support architecture Alpha and Sparc, apt came in picture, Number of package – 2250. +- **Debian 2.2**: Released on August 15, 2000. Code name – Potato, Supported architecture – Intel i386, Motorola 68000 series, Alpha, SUN Sparc, PowerPC and ARM architecture. Number of packages: 3900+ (binary) and 2600+ (Source), Number of Developers – 450. There were a group of people studied and came with an article called Counting potatoes, which shows – How a free software effort could lead to a modern operating system despite all the issues around it. +- **Debian 3.0** : Released on July 19th, 2002. Code name – woody, Architecture supported increased– HP, PA_RISC, IA-64, MIPS and IBM, First release in DVD, Package Count – 8500+, Developers Count – 900+, Cryptography. +- **Debian 3.1**: Release on June 6th, 2005. Code name – sarge, Architecture support – same as woody + AMD64 – Unofficial Port released, Kernel – 2.4 qnd 2.6 series, Number of Packages: 15000+, Number of Developers : 1500+, packages like – OpenOffice Suite, Firefox Browser, Thunderbird, Gnome 2.8, kernel 3.3 Advanced Installation Support: RAID, XFS, LVM, Modular Installer. +- **Debian 4.0**: Released on April 8th, 2007. Code name – etch, architecture support – same as sarge, included AMD64. Number of packages: 18,200+ Developers count : 1030+, Graphical Installer. +- **Debian 5.0**: Released on February 14th, 2009. Code name – lenny, Architecture Support – Same as before + ARM. Number of packages: 23000+, Developers Count: 1010+. +- **Debian 6.0** : Released on July 29th, 2009. Code name – squeeze, Package included : kernel 2.6.32, Gnome 2.3. Xorg 7.5, DKMS included, Dependency-based. Architecture : Same as pervious + kfreebsd-i386 and kfreebsd-amd64, Dependency based booting. +- **Debian 7.0**: Released on may 4, 2013. Code name: wheezy, Support for Multiarch, Tools for private cloud, Improved Installer, Third party repo need removed, full featured multimedia-codec, Kernel 3.2, Xen Hypervisor 4.1.4 Package Count: 37400+. +- **Debian 8.0**: Released on May 25, 2015 and Code name: Jessie, Systemd as the default init system, powered by Kernel 3.16, fast booting, cgroups for services, possibility of isolating part of the services, 43000+ packages. Sysvinit init system available in Jessie. + +**Note**: Linux Kernel initial release was on October 05, 1991 and Debian initial release was on September 15, 1993. So, Debian is there for 22 Years running Linux Kernel which is there for 24 years. + +### Debian Facts ### + +Year 1994 was spent on organizing and managing Debian project so that it would be easy for others to contribute. Hence no release for users were made this year however there were certain internal release. + +Debian 1.0 was never released. A CDROM manufacturer company by mistakenly labelled an unreleased version as Debian 1.0. Hence to avoid confusion Debian 1.0 was released as Debian 1.1 and since then only the concept of official CDROM images came into existence. + +Each release of Debian is a character of Toy Story. + +Debian remains available in old stable, stable, testing and experimental, all the time. + +The Debian Project continues to work on the unstable distribution (codenamed sid, after the evil kid from the Toy Story). Sid is the permanent name for the unstable distribution and is remains ‘Still In Development’. The testing release is intended to become the next stable release and is currently codenamed jessie. + +Debian official distribution includes only Free and OpenSource Software and nothing else. However the availability of contrib and Non-free Packages makes it possible to install those packages which are free but their dependencies are not licensed free (contrib) and Packages licensed under non-free softwares. + +Debian is the mother of a lot of Linux distribution. Some of these Includes: + +- Damn Small Linux +- KNOPPIX +- Linux Advanced +- MEPIS +- Ubuntu +- 64studio (No more active) +- LMDE + +Debian is the world’s largest non commercial Linux Distribution. It is written in C (32.1%) programming language and rest in 70 other languages. + +![Debian Contribution](http://www.tecmint.com/wp-content/uploads/2014/08/Debian-Programming.png) + +Debian Contribution + +Image Source: [Xmodulo][1] + +Debian project contains 68.5 million actual loc (lines of code) + 4.5 million lines of comments and white spaces. + +International Space station dropped Windows & Red Hat for adopting Debian – These astronauts are using one release back – now “squeeze” for stability and strength from community. + +Thank God! Who would have heard the scream from space on Windows Metro Screen :P + +#### The Black Wednesday #### + +On November 20th, 2002 the University of Twente Network Operation Center (NOC) caught fire. The fire department gave up protecting the server area. NOC hosted satie.debian.org which included Security, non-US archive, New Maintainer, quality assurance, databases – Everything was turned to ashes. Later these services were re-built by debian. + +#### The Future Distro #### + +Next in the list is Debian 9, code name – Stretch, what it will have is yet to be revealed. The best is yet to come, Just Wait for it! + +A lot of distribution made an appearance in Linux Distro genre and then disappeared. In most cases managing as it gets bigger was a concern. But certainly this is not the case with Debian. It has hundreds of thousands of developer and maintainer all across the globe. It is a one Distro which was there from the initial days of Linux. + +The contribution of Debian in Linux ecosystem can’t be measured in words. If there had been no Debian, Linux would not have been so rich and user-friendly. Debian is among one of the disto which is considered highly reliable, secure and stable and a perfect choice for Web Servers. + +That’s the beginning of Debian. It came a long way and still going. The Future is Here! The world is here! If you have not used Debian till now, What are you Waiting for. Just Download Your Image and get started, we will be here if you get into trouble. + +- [Debian Homepage][2] + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/happy-birthday-to-debian-gnu-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://xmodulo.com/2013/08/interesting-facts-about-debian-linux.html +[2]:https://www.debian.org/ \ No newline at end of file diff --git a/sources/tech/20150818 How to monitor stock quotes from the command line on Linux.md b/sources/tech/20150818 How to monitor stock quotes from the command line on Linux.md new file mode 100644 index 0000000000..662ac1eb84 --- /dev/null +++ b/sources/tech/20150818 How to monitor stock quotes from the command line on Linux.md @@ -0,0 +1,99 @@ +How to monitor stock quotes from the command line on Linux +================================================================================ +If you are one of those stock investors or traders, monitoring the stock market will be one of your daily routines. Most likely you will be using an online trading platform which comes with some fancy real-time charts and all sort of advanced stock analysis and tracking tools. While such sophisticated market research tools are a must for any serious stock investors to read the market, monitoring the latest stock quotes still goes a long way to build a profitable portfolio. + +If you are a full-time system admin constantly sitting in front of terminals while trading stocks as a hobby during the day, a simple command-line tool that shows real-time stock quotes will be a blessing for you. + +In this tutorial, let me introduce a neat command-line tool that allows you to monitor stock quotes from the command line on Linux. + +This tool is called [Mop][1]. Written in Go, this lightweight command-line tool is extremely handy for tracking the latest stock quotes from the U.S. markets. You can easily customize the list of stocks to monitor, and it shows the latest stock quotes in ncurses-based, easy-to-read interface. + +**Note**: Mop obtains the latest stock quotes via Yahoo! Finance API. Be aware that their stock quotes are known to be delayed by 15 minutes. So if you are looking for "real-time" stock quotes with zero delay, Mop is not a tool for you. Such "live" stock quote feeds are usually available for a fee via some proprietary closed-door interface. With that being said, let's see how you can use Mop under Linux environment. + +### Install Mop on Linux ### + +Since Mop is implemented in Go, you will need to install Go language first. If you don't have Go installed, follow [this guide][2] to install Go on your Linux platform. Make sure to set GOPATH environment variable as described in the guide. + +Once Go is installed, proceed to install Mop as follows. + +**Debian, Ubuntu or Linux Mint** + + $ sudo apt-get install git + $ go get github.com/michaeldv/mop + $ cd $GOPATH/src/github.com/michaeldv/mop + $ make install + +Fedora, CentOS, RHEL + + $ sudo yum install git + $ go get github.com/michaeldv/mop + $ cd $GOPATH/src/github.com/michaeldv/mop + $ make install + +The above commands will install Mop under $GOPATH/bin. + +Now edit your .bashrc to include $GOPATH/bin in your PATH variable. + + export PATH="$PATH:$GOPATH/bin" + +---------- + + $ source ~/.bashrc + +### Monitor Stock Quotes from the Command Line with Mop ### + +To launch Mod, simply run the command called cmd. + + $ cmd + +At the first launch, you will see a few stock tickers which Mop comes pre-configured with. + +![](https://farm6.staticflickr.com/5749/20018949104_c8c64e0e06_c.jpg) + +The quotes show information like the latest price, %change, daily low/high, 52-week low/high, dividend, and annual yield. Mop obtains market overview information from [CNN][3], and individual stock quotes from [Yahoo Finance][4]. The stock quote information updates itself within the terminal periodically. + +### Customize Stock Quotes in Mop ### + +Let's try customizing the stock list. Mop provides easy-to-remember shortcuts for this: '+' to add a new stock, and '-' to remove a stock. + +To add a new stock, press '+', and type a stock ticker symbol to add (e.g., MSFT). You can add more than one stock at once by typing a comma-separated list of tickers (e.g., "MSFT, AMZN, TSLA"). + +![](https://farm1.staticflickr.com/636/20648164441_642ae33a22_c.jpg) + +Removing stocks from the list can be done similarly by pressing '-'. + +### Sort Stock Quotes in Mop ### + +You can sort the stock quote list based on any column. To sort, press 'o', and use left/right key to choose the column to sort by. When a particular column is chosen, you can sort the list either in increasing order or in decreasing order by pressing ENTER. + +![](https://farm1.staticflickr.com/724/20648164481_15631eefcf_c.jpg) + +By pressing 'g', you can group your stocks based on whether they are advancing or declining for the day. Advancing issues are represented in green color, while declining issues are colored in white. + +![](https://c2.staticflickr.com/6/5633/20615252696_a5bd44d3aa_b.jpg) + +If you want to access help page, simply press '?'. + +![](https://farm1.staticflickr.com/573/20632365342_da196b657f_c.jpg) + +### Conclusion ### + +As you can see, Mop is a lightweight, yet extremely handy stock monitoring tool. Of course you can easily access stock quotes information elsewhere, from online websites, your smartphone, etc. However, if you spend a great deal of your time in a terminal environment, Mop can easily fit in to your workspace, hopefully without distracting must of your workflow. Just let it run and continuously update market date in one of your terminals, and be done with it. + +Happy trading! + +-------------------------------------------------------------------------------- + +via: http://xmodulo.com/monitor-stock-quotes-command-line-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://xmodulo.com/author/nanni +[1]:https://github.com/michaeldv/mop +[2]:http://ask.xmodulo.com/install-go-language-linux.html +[3]:http://money.cnn.com/data/markets/ +[4]:http://finance.yahoo.com/ \ No newline at end of file From 95631da14d2cff6bfb59aee4227d291999a3b4f6 Mon Sep 17 00:00:00 2001 From: DeadFire Date: Tue, 18 Aug 2015 17:34:47 +0800 Subject: [PATCH 371/507] =?UTF-8?q?20150818-4=20=E9=80=89=E9=A2=98=20?= =?UTF-8?q?=E5=8F=A6=E4=B8=80=E7=AF=87=20IBM=20=E7=9A=84=E5=A4=87=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...Ubuntu Linux is coming to IBM mainframes.md | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 sources/news/20150818 ​Ubuntu Linux is coming to IBM mainframes.md diff --git a/sources/news/20150818 ​Ubuntu Linux is coming to IBM mainframes.md b/sources/news/20150818 ​Ubuntu Linux is coming to IBM mainframes.md new file mode 100644 index 0000000000..8da7227eee --- /dev/null +++ b/sources/news/20150818 ​Ubuntu Linux is coming to IBM mainframes.md @@ -0,0 +1,46 @@ +​Ubuntu Linux is coming to IBM mainframes +================================================================================ +SEATTLE -- It's finally happened. At [LinuxCon][1], IBM and [Canonical][2] announced that [Ubuntu Linux][3] will soon be running on IBM mainframes. + +![](http://zdnet2.cbsistatic.com/hub/i/2015/08/17/f389e12f-03f5-48cc-8019-af4ccf6c6ecd/f15b099e439c0e3a5fd823637d4bcf87/ubuntu-mainframe.jpg) + +You'll soon to be able to get your IBM mainframe in Ubuntu Linux orange + +According to Ross Mauri, IBM's General Manager of System z, and Mark Shuttleworth, Canonical and Ubuntu's founder, this move came about because of customer demand. For over a decade, [Red Hat Enterprise Linux (RHEL)][4] and [SUSE Linux Enterprise Server (SLES)][5] were the only supported IBM mainframe Linux distributions. + +As Ubuntu matured, more and more businesses turned to it for the enterprise Linux, and more and more of them wanted it on IBM big iron hardware. In particular, banks wanted Ubuntu there. Soon, financial CIOs will have their wish granted. + +In an interview Shuttleworth said that Ubuntu Linux will be available on the mainframe by April 2016 in the next long-term support version of Ubuntu: Ubuntu 16.04. Canonical and IBM already took the first move in this direction in late 2014 by bringing [Ubuntu to IBM's POWER][6] architecture. + +Before that, Canonical and IBM almost signed the dotted line to bring [Ubuntu to IBM mainframes in 2011][7] but that deal was never finalized. This time, it's happening. + +Jane Silber, Canonical's CEO, explained in a statement, "Our [expansion of Ubuntu platform][8] support to [IBM z Systems][9] is a recognition of the number of customers that count on z Systems to run their businesses, and the maturity the hybrid cloud is reaching in the marketplace. + +**Silber continued:** + +> With support of z Systems, including [LinuxONE][10], Canonical is also expanding our relationship with IBM, building on our support for the POWER architecture and OpenPOWER ecosystem. Just as Power Systems clients are now benefiting from the scaleout capabilities of Ubuntu, and our agile development process which results in first to market support of new technologies such as CAPI (Coherent Accelerator Processor Interface) on POWER8, z Systems clients can expect the same rapid rollout of technology advancements, and benefit from [Juju][11] and our other cloud tools to enable faster delivery of new services to end users. In addition, our collaboration with IBM includes the enablement of scale-out deployment of many IBM software solutions with Juju Charms. Mainframe clients will delight in having a wealth of 'charmed' IBM solutions, other software provider products, and open source solutions, deployable on mainframes via Juju. + +Shuttleworth expects Ubuntu on z to be very successful. "It's blazingly fast, and with its support for OpenStack, people who want exceptional cloud region performance will be very happy. + +-------------------------------------------------------------------------------- + +via: http://www.zdnet.com/article/ubuntu-linux-is-coming-to-the-mainframe/#ftag=RSSbaffb68 + +作者:[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.zdnet.com/meet-the-team/us/steven-j-vaughan-nichols/ +[1]:http://events.linuxfoundation.org/events/linuxcon-north-america +[2]:http://www.canonical.com/ +[3]:http://www.ubuntu.comj/ +[4]:http://www.redhat.com/en/technologies/linux-platforms/enterprise-linux +[5]:https://www.suse.com/products/server/ +[6]:http://www.zdnet.com/article/ibm-doubles-down-on-linux/ +[7]:http://www.zdnet.com/article/mainframe-ubuntu-linux/ +[8]:https://insights.ubuntu.com/2015/08/17/ibm-and-canonical-plan-ubuntu-support-on-ibm-z-systems-mainframe/ +[9]:http://www-03.ibm.com/systems/uk/z/ +[10]:http://www.zdnet.com/article/linuxone-ibms-new-linux-mainframes/ +[11]:https://jujucharms.com/ \ No newline at end of file From 6d3282d2b50edc9a671187069efdcb768c4d761e Mon Sep 17 00:00:00 2001 From: DeadFire Date: Tue, 18 Aug 2015 17:41:53 +0800 Subject: [PATCH 372/507] =?UTF-8?q?20150818-5=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ity Components Live Container Migration.md | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 sources/talk/20150818 Docker Working on Security Components Live Container Migration.md diff --git a/sources/talk/20150818 Docker Working on Security Components Live Container Migration.md b/sources/talk/20150818 Docker Working on Security Components Live Container Migration.md new file mode 100644 index 0000000000..ad974b4859 --- /dev/null +++ b/sources/talk/20150818 Docker Working on Security Components Live Container Migration.md @@ -0,0 +1,53 @@ +Docker Working on Security Components, Live Container Migration +================================================================================ +![Docker Container Talk](http://www.eweek.com/imagesvr_ce/1905/290x195DockerMarianna.jpg) + +**Docker developers take the stage at Containercon and discuss their work on future container innovations for security and live migration.** + +SEATTLE—Containers are one of the hottest topics in IT today and at the Linuxcon USA event here there is a co-located event called Containercon, dedicated to this virtualization technology. + +Docker, the lead commercial sponsor of the open-source Docker effort brought three of its top people to the keynote stage today, but not Docker founder Solomon Hykes. + +Hykes who delivered a Linuxcon keynote in 2014 was in the audience though, as Senior Vice President of Engineering Marianna Tessel, Docker security chief Diogo Monica and Docker chief maintainer Michael Crosby presented what's new and what's coming in Docker. + +Tessel emphasized that Docker is very real today and used in production environments at some of the largest organizations on the planet, including the U.S. Government. Docker also is working in small environments too, including the Raspberry Pi small form factor ARM computer, which now can support up to 2,300 containers on a single device. + +"We're getting more powerful and at the same time Docker will also get simpler to use," Tessel said. + +As a metaphor, Tessel said that the whole Docker experience is much like a cruise ship, where there is powerful and complex machinery that powers the ship, yet the experience for passengers is all smooth sailing. + +One area that Docker is trying to make easier is security. Tessel said that security is mind-numbingly complex for most people as organizations constantly try to avoid network breaches. + +That's where Docker Content Trust comes into play, which is a configurable feature in the recent Docker 1.8 release. Diogo Mónica, security lead for Docker joined Tessel on stage and said that security is a hard topic, which is why Docker content trust is being developed. + +With Docker Content Trust there is a verifiable way to make sure that a given Docker application image is authentic. There also are controls to limit fraud and potential malicious code injection by verifying application freshness. + +To prove his point, Monica did a live demonstration of what could happen if Content Trust is not enabled. In one instance, a Website update is manipulated to allow the demo Web app to be defaced. When Content Trust is enabled, the hack didn't work and was blocked. + +"Don't let the simple demo fool you," Tessel said. "You have seen the best security possible." + +One area where containers haven't been put to use before is for live migration, which on VMware virtual machines is a technology called vMotion. It's an area that Docker is currently working on. + +Docker chief maintainer Michael Crosby did an onstage demonstration of a live migration of Docker containers. Crosby referred to the approach as checkpoint and restore, where a running container gets a checkpoint snapshot and is then restored to another location. + +A container also can be cloned and then run in another location. Crosby humorously referred to his cloned container as "Dolly," a reference to the world's first cloned animal, Dolly the sheep. + +Tessel also took time to talk about the RunC component of containers, which is now a technology component that is being developed by the Open Containers Initiative as a multi-stakeholder process. With RunC, containers expand beyond Linux to multiple operating systems including Windows and Solaris. + +Overall, Tessel said that she can't predict the future of Docker, though she is very optimistic. + +"I'm not sure what the future is, but I'm sure it'll be out of this world," Tessel said. + +Sean Michael Kerner is a senior editor at eWEEK and InternetNews.com. Follow him on Twitter @TechJournalist. + +-------------------------------------------------------------------------------- + +via: http://www.eweek.com/virtualization/docker-working-on-security-components-live-container-migration.html + +作者:[Sean Michael Kerner][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.eweek.com/cp/bio/Sean-Michael-Kerner/ \ No newline at end of file From 4d084a2f3144ab58cf65b7f540a5058e97c85d65 Mon Sep 17 00:00:00 2001 From: Chang Liu Date: Tue, 18 Aug 2015 22:36:23 +0800 Subject: [PATCH 373/507] [Translated]RHCSA Series--Part 06--Using 'Parted' and 'SSM' to Configure and Encrypt System Storage.md --- ...to Configure and Encrypt System Storage.md | 271 ------------------ ...to Configure and Encrypt System Storage.md | 269 +++++++++++++++++ 2 files changed, 269 insertions(+), 271 deletions(-) delete mode 100644 sources/tech/RHCSA Series/RHCSA Series--Part 06--Using 'Parted' and 'SSM' to Configure and Encrypt System Storage.md create mode 100644 translated/tech/RHCSA/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 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 deleted file mode 100644 index 0e631ce37d..0000000000 --- a/sources/tech/RHCSA Series/RHCSA Series--Part 06--Using 'Parted' and 'SSM' to Configure and Encrypt System Storage.md +++ /dev/null @@ -1,271 +0,0 @@ -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. - -![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/ diff --git a/translated/tech/RHCSA/RHCSA Series--Part 06--Using 'Parted' and 'SSM' to Configure and Encrypt System Storage.md b/translated/tech/RHCSA/RHCSA Series--Part 06--Using 'Parted' and 'SSM' to Configure and Encrypt System Storage.md new file mode 100644 index 0000000000..41890b2280 --- /dev/null +++ b/translated/tech/RHCSA/RHCSA Series--Part 06--Using 'Parted' and 'SSM' to Configure and Encrypt System Storage.md @@ -0,0 +1,269 @@ +RHCSA 系列:使用 'Parted' 和 'SSM' 来配置和加密系统存储 – Part 6 +================================================================================ +在本篇文章中,我们将讨论在 RHEL 7 中如何使用传统的工具来设置和配置本地系统存储,并介绍系统存储管理器(也称为 SSM),它将极大地简化上面的任务。 + +![配置和加密系统存储](http://www.tecmint.com/wp-content/uploads/2015/04/Configure-and-Encrypt-System-Storage.png) + +RHCSA: 配置和加密系统存储 – Part 6 + +请注意,我们将在这篇文章中展开这个话题,但由于该话题的宽泛性,我们将在下一期(Part 7)中继续介绍有关它的描述和使用。 + +### 在 RHEL 7 中创建和修改分区 ### + +在 RHEL 7 中, parted 是默认的用来处理分区的程序,且它允许你: + +- 展示当前的分区表 +- 操纵(增加或减少分区的大小)现有的分区 +- 利用空余的磁盘空间或额外的物理存储设备来创建分区 + +强烈建议你在试图增加一个新的分区或对一个现有分区进行更改前,你应当确保设备上没有任何一个分区正在使用(`umount /dev/partition`),且假如你正使用设备的一部分来作为 swap 分区,在进行上面的操作期间,你需要将它禁用(`swapoff -v /dev/partition`) 。 + +实施上面的操作的最简单的方法是使用一个安装介质例如一个 RHEL 7 安装 DVD 或 USB 以急救模式启动 RHEL(Troubleshooting → Rescue a Red Hat Enterprise Linux system),然后当让你选择一个选项来挂载现有的 Linux 安装时,选择'跳过'这个选项,接着你将看到一个命令行提示符,在其中你可以像下图显示的那样开始键入与在一个未被使用的物理设备上创建一个正常的分区时所用的相同的命令。 + +![RHEL 7 急救模式](http://www.tecmint.com/wp-content/uploads/2015/04/RHEL-7-Rescue-Mode.png) + +RHEL 7 急救模式 + +要启动 parted,只需键入: + + # parted /dev/sdb + +其中 `/dev/sdb` 是你将要创建新分区所在的设备;然后键入 `print` 来显示当前设备的分区表: + +![创建新的分区](http://www.tecmint.com/wp-content/uploads/2015/04/Create-New-Partition.png) + +创建新的分区 + +正如你所看到的那样,在这个例子中,我们正在使用一个 5 GB 的虚拟光驱。现在我们将要创建一个 4 GB 的主分区,然后将它格式化为 xfs 文件系统,它是 RHEL 7 中默认的文件系统。 + +你可以从一系列的文件系统中进行选择。你将需要使用 mkpart 来手动地创建分区,接着和平常一样,用 mkfs.fstype 来对分区进行格式化,因为 mkpart 并不支持许多现代的文件系统以达到即开即用。 + +在下面的例子中,我们将为设备设定一个标记,然后在 `/dev/sdb` 上创建一个主分区 `(p)`,它从设备的 0% 开始,并在 4000MB(4 GB) 处结束。 + +![在 Linux 中设定分区名称](http://www.tecmint.com/wp-content/uploads/2015/04/Label-Partition.png) + +标记分区的名称 + +接下来,我们将把分区格式化为 xfs 文件系统,然后再次打印出分区表,以此来确保更改已被应用。 + + # mkfs.xfs /dev/sdb1 + # parted /dev/sdb print + +![在 Linux 中格式化分区](http://www.tecmint.com/wp-content/uploads/2015/04/Format-Partition-in-Linux.png) + +格式化分区为 XFS 文件系统 + +对于旧一点的文件系统,在 parted 中你应该使用 `resize` 命令来改变分区的大小。不幸的是,这只适用于 ext2, fat16, fat32, hfs, linux-swap, 和 reiserfs (若 libreiserfs 已被安装)。 + +因此,改变分区大小的唯一方式是删除它然后再创建它(所以确保你对你的数据做了完整的备份!)。毫无疑问,在 RHEL 7 中默认的分区方案是基于 LVM 的。 + +使用 parted 来移除一个分区,可以用: + + # parted /dev/sdb print + # parted /dev/sdb rm 1 + +![在 Linux 中移除分区](http://www.tecmint.com/wp-content/uploads/2015/04/Remove-Partition-in-Linux.png) + +移除或删除分区 + +### 逻辑卷管理(LVM) ### + +一旦一个磁盘被分好了分区,再去更改分区的大小就是一件困难或冒险的事了。基于这个原因,假如我们计划在我们的系统上对分区的大小进行更改,我们应当考虑使用 LVM 的可能性,而不是使用传统的分区系统。这样多个物理设备可以组成一个逻辑组,以此来寄宿可自定义数目的逻辑卷,而逻辑卷的增大或减少不会带来任何麻烦。 + +简单来说,你会发现下面的示意图对记住 LVM 的基础架构或许有用。 + +![LVM 的基本架构](http://www.tecmint.com/wp-content/uploads/2015/04/LVM-Diagram.png) + +LVM 的基本架构 + +#### 创建物理卷,卷组和逻辑卷 #### + +遵循下面的步骤是为了使用传统的卷管理工具来设置 LVM。由于你可以通过阅读这个网站上的 LVM 系列来扩展这个话题,我将只是概要的介绍设置 LVM 的基本步骤,然后与使用 SSM 来实现相同功能做个比较。 + +**注**: 我们将使用整个磁盘 `/dev/sdb` 和 `/dev/sdc` 来作为 PVs (物理卷),但是否执行相同的操作完全取决于你。 + +**1. 使用 /dev/sdb 和 /dev/sdc 中 100% 的可用磁盘空间来创建分区 `/dev/sdb1` 和 `/dev/sdc1`:** + + # parted /dev/sdb print + # parted /dev/sdc print + +![创建新分区](http://www.tecmint.com/wp-content/uploads/2015/04/Create-New-Partitions.png) + +创建新分区 + +**2. 分别在 /dev/sdb1 和 /dev/sdc1 上共创建 2 个物理卷。** + + # pvcreate /dev/sdb1 + # pvcreate /dev/sdc1 + +![创建两个物理卷](http://www.tecmint.com/wp-content/uploads/2015/04/Create-Physical-Volumes.png) + +创建两个物理卷 + +记住,你可以使用 pvdisplay /dev/sd{b,c}1 来显示有关新建的 PV 的信息。 + +**3. 在上一步中创建的 PV 之上创建一个 VG:** + + # vgcreate tecmint_vg /dev/sd{b,c}1 + +![在 Linux 中创建卷组](http://www.tecmint.com/wp-content/uploads/2015/04/Create-Volume-Group.png) + +创建卷组 + +记住,你可使用 vgdisplay tecmint_vg 来显示有关新建的 VG 的信息。 + +**4. 像下面那样,在 VG tecmint_vg 之上创建 3 个逻辑卷:** + + # 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] + +![在 LVM 中创建逻辑卷](http://www.tecmint.com/wp-content/uploads/2015/04/Create-Logical-Volumes.png) + +创建逻辑卷 + +记住,你可以使用 lvdisplay tecmint_vg 来显示有关在 VG tecmint_vg 之上新建的 LV 的信息。 + +**5. 格式化每个逻辑卷为 xfs 文件系统格式(假如你计划在以后将要缩小卷的大小,请别使用 xfs 文件系统格式!):** + + # mkfs.xfs /dev/tecmint_vg/vol01_docs + # mkfs.xfs /dev/tecmint_vg/vol02_logs + # mkfs.xfs /dev/tecmint_vg/vol03_homes + +**6. 最后,挂载它们:** + + # mount /dev/tecmint_vg/vol01_docs /mnt/docs + # mount /dev/tecmint_vg/vol02_logs /mnt/logs + # mount /dev/tecmint_vg/vol03_homes /mnt/homes + +#### 移除逻辑卷,卷组和物理卷 #### + +**7.现在我们将进行与刚才相反的操作并移除 LV,VG 和 PV:** + + # 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. 现在,让我们来安装 SSM,我们将看到如何只用一步就完成上面所有的操作!** + + # yum update && yum install system-storage-manager + +我们将和上面一样,使用相同的名称和大小: + + # 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 + +是的! SSM 可以让你: + +- 初始化块设备来作为物理卷 +- 创建一个卷组 +- 创建逻辑卷 +- 格式化 LV 和 +- 只使用一个命令来挂载它们 + +**9. 现在,我们可以使用下面的命令来展示有关 PV,VG 或 LV 的信息:** + + # ssm list dev + # ssm list pool + # ssm list vol + +![检查有关 PV, VG,或 LV 的信息](http://www.tecmint.com/wp-content/uploads/2015/04/Display-LVM-Information.png) + +检查有关 PV, VG,或 LV 的信息 + +**10. 正如我们知道的那样, LVM 的一个显著的特点是可以在不停机的情况下更改(增大或缩小) 逻辑卷的大小:** + +假定在 vol02_logs 上我们用尽了空间,而 vol03_homes 还留有足够的空间。我们将把 vol03_homes 的大小调整为 4 GB,并使用剩余的空间来扩展 vol02_logs: + + # ssm resize -s 4G /dev/tecmint_vg/vol03_homes + +再次运行 `ssm list pool`,并记录 tecmint_vg 中的剩余空间的大小: + +![查看卷的大小](http://www.tecmint.com/wp-content/uploads/2015/04/Check-LVM-Free-Space.png) + +查看卷的大小 + +然后执行: + + # ssm resize -s+1.99 /dev/tecmint_vg/vol02_logs + +**注**: 在 `-s` 后的加号暗示特定值应该被加到当前值上。 + +**11. 使用 ssm 来移除逻辑卷和卷组也更加简单,只需使用:** + + # ssm remove tecmint_vg + +这个命令将返回一个提示,询问你是否确认删除 VG 和它所包含的 LV: + +![移除逻辑卷和卷组](http://www.tecmint.com/wp-content/uploads/2015/04/Remove-LV-VG.png) + +移除逻辑卷和卷组 + +### 管理加密的卷 ### + +SSM 也给系统管理员提供了为新的或现存的卷加密的能力。首先,你将需要安装 cryptsetup 软件包: + + # yum update && yum install cryptsetup + +然后写出下面的命令来创建一个加密卷,你将被要求输入一个密码来增强安全性: + + # 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 + +我们的下一个任务是往 /etc/fstab 中添加条目来让这些逻辑卷在启动时可用,而不是使用设备识别编号(/dev/something)。 + +我们将使用每个 LV 的 UUID (使得当我们添加其他的逻辑卷或设备后,我们的设备仍然可以被唯一的标记),而我们可以使用 blkid 应用来找到它们的 UUID: + + # 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 + +在我们的例子中: + +![找到逻辑卷的 UUID](http://www.tecmint.com/wp-content/uploads/2015/04/Logical-Volume-UUID.png) + +找到逻辑卷的 UUID + +接着,使用下面的内容来创建 /etc/crypttab 文件(请更改 UUID 来适用于你的设置): + + docs UUID=ba77d113-f849-4ddf-8048-13860399fca8 none + logs UUID=58f89c5a-f694-4443-83d6-2e83878e30e4 none + homes UUID=92245af6-3f38-4e07-8dd8-787f4690d7ac none + +然后在 /etc/fstab 中添加如下的条目。请注意到 device_name (/dev/mapper/device_name) 是出现在 /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 + +现在重启(systemctl reboot),则你将被要求为每个 LV 输入密码。随后,你可以通过检查相应的挂载点来确保挂载操作是否成功: + +![确保逻辑卷挂载点](http://www.tecmint.com/wp-content/uploads/2015/04/Verify-LV-Mount-Points.png) + +确保逻辑卷挂载点 + +### 总结 ### + +在这篇教程中,我们开始探索如何使用传统的卷管理工具和 SSM 来设置和配置系统存储,SSM 也在一个软件包中集成了文件系统和加密功能。这使得对于任何系统管理员来说,SSM 是一个非常有价值的工具。 + +假如你有任何的问题或评论,请让我们知晓 – 请随意使用下面的评论框来与我们保存联系! + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/rhcsa-exam-create-format-resize-delete-and-encrypt-partitions-in-linux/ + +作者:[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/create-lvm-storage-in-linux/ From 9be2a6d3692adc8a49338a52ce31b4ca2b21068d Mon Sep 17 00:00:00 2001 From: Chang Liu Date: Tue, 18 Aug 2015 22:42:37 +0800 Subject: [PATCH 374/507] Update RHCSA Series--Part 07--Using ACLs (Access Control Lists) and Mounting Samba or NFS Shares.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 准备翻译该篇。 --- ...(Access Control Lists) and Mounting Samba or NFS Shares.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 index d4801d9923..9237e8bd1c 100644 --- 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 @@ -1,3 +1,5 @@ +FSSlc translating + 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. @@ -209,4 +211,4 @@ via: http://www.tecmint.com/rhcsa-exam-configure-acls-and-mount-nfs-samba-shares [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 +[3]:https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Storage_Administration_Guide/ch-acls.html From daa0150cb50a7ad9e3a28a301cd969c30dd20215 Mon Sep 17 00:00:00 2001 From: struggling <630441839@qq.com> Date: Wed, 19 Aug 2015 09:33:47 +0800 Subject: [PATCH 375/507] Delete Part 3 - Setting up RAID 1 (Mirroring) using 'Two Disks' in Linux.md --- ... (Mirroring) using 'Two Disks' in Linux.md | 213 ------------------ 1 file changed, 213 deletions(-) delete mode 100644 sources/tech/RAID/Part 3 - Setting up RAID 1 (Mirroring) using 'Two Disks' in Linux.md 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 deleted file mode 100644 index 4acfe4366b..0000000000 --- a/sources/tech/RAID/Part 3 - Setting up RAID 1 (Mirroring) using 'Two Disks' in Linux.md +++ /dev/null @@ -1,213 +0,0 @@ -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. - -![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 From e229a59ce691a09656ed58958d06edbabf81dbc7 Mon Sep 17 00:00:00 2001 From: struggling <630441839@qq.com> Date: Wed, 19 Aug 2015 09:34:00 +0800 Subject: [PATCH 376/507] Delete Part 4 - Creating RAID 5 (Striping with Distributed Parity) in Linux.md --- ...iping with Distributed Parity) in Linux.md | 286 ------------------ 1 file changed, 286 deletions(-) delete mode 100644 sources/tech/RAID/Part 4 - Creating RAID 5 (Striping with Distributed Parity) in Linux.md 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 deleted file mode 100644 index dafdf514aa..0000000000 --- a/sources/tech/RAID/Part 4 - Creating RAID 5 (Striping with Distributed Parity) in Linux.md +++ /dev/null @@ -1,286 +0,0 @@ -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. - -![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 From 6ae6e7cd43e62c6d22e2621c689dd892e88ba7b1 Mon Sep 17 00:00:00 2001 From: Ezio Date: Wed, 19 Aug 2015 10:05:45 +0800 Subject: [PATCH 377/507] Update 20150728 Process of the Linux kernel building.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 翻译到Line 483 --- ...50728 Process of the Linux kernel building.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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 f4510d81b2..e55605f863 100644 --- a/sources/tech/20150728 Process of the Linux kernel building.md +++ b/sources/tech/20150728 Process of the Linux kernel building.md @@ -411,6 +411,8 @@ $(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: +第一个工具是`fixdep`:用来优化[gcc](https://gcc.gnu.org/) 生成的依赖列表,然后在重新编译源文件的时候告诉make。第二个工具是`bin2c`,他依赖于内核配置选项`CONFIG_BUILD_BIN2C`,并且它是一个用来将标准输入接口(注:即stdin)收到的二进制流通过标准输出接口(即:stdout)转换成C 头文件的非常小的C 程序。你可以注意到这里有些奇怪的标志,如`hostprogs-y`等。这些标志使用在所有的`kbuild` 文件,更多的信息你可以从[documentation](https://github.com/torvalds/linux/blob/master/Documentation/kbuild/makefiles.txt) 获得。在我们的用例`hostprogs-y` 中,他告诉`kbuild` 这里有个名为`fixed` 的程序,这个程序会通过和`Makefile` 相同目录的`fixdep.c` 编译而来。执行make 之后,终端的第一个输出就是`kbuild` 的结果: + ``` $ make HOSTCC scripts/basic/fixdep @@ -418,12 +420,16 @@ $ make 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: +当目标`script_basic` 被执行,目标`archscripts` 就会make [arch/x86/tools](https://github.com/torvalds/linux/blob/master/arch/x86/tools/Makefile) 下的makefile 和目标`relocs`: + ```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: +代码`relocs_32.c` 和`relocs_64.c` 包含了[重定位](https://en.wikipedia.org/wiki/Relocation_%28computing%29) 的信息,将会被编译,者可以在`make` 的输出中看到: + ```Makefile HOSTCC arch/x86/tools/relocs_32.o HOSTCC arch/x86/tools/relocs_64.o @@ -433,6 +439,8 @@ The `relocs_32.c` and the `relocs_64.c` will be compiled that will contain [relo There is checking of the `version.h` after compiling of the `relocs.c`: +在编译完`relocs.c` 之后会检查`version.h`: + ```Makefile $(version_h): $(srctree)/Makefile FORCE $(call filechk,version.h) @@ -441,12 +449,17 @@ $(version_h): $(srctree)/Makefile FORCE 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: +以及在内核根Makefiel 使用`arch/x86/include/generated/asm`的目标`asm-generic` 来构建`generic` 汇编头文件。在目标`asm-generic` 之后,`archprepare` 就会被完成,所以目标`prepare0` 会接着被执行,如我上面所写: + ```Makefile prepare0: archprepare FORCE $(Q)$(MAKE) $(build)=. @@ -454,12 +467,15 @@ prepare0: archprepare FORCE 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: +注意`build`,它是定义在文件[scripts/Kbuild.include](https://github.com/torvalds/linux/blob/master/scripts/Kbuild.include),内容是这样的: + ```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=. ``` From 01457fa101936d30230d3b2c0a5cb5175c3a3da6 Mon Sep 17 00:00:00 2001 From: wi-cuckoo Date: Wed, 19 Aug 2015 21:11:44 +0800 Subject: [PATCH 378/507] cancel pr --- ...Boss Data Virtualization GA with OData in Docker Container.md | 1 - 1 file changed, 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 f1505c5649..007f16493b 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,4 +1,3 @@ -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. From 554825a1f4a7069a42bc7b2a7b4560e4152be42b Mon Sep 17 00:00:00 2001 From: wxy Date: Wed, 19 Aug 2015 21:29:41 +0800 Subject: [PATCH 379/507] PUB:20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 5 - Conclusion MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @XLCYun 翻译这个系列辛苦啦! --- ...Get Right & Wrong - Page 5 - Conclusion.md | 40 +++++++++++++++++++ ...Get Right & Wrong - Page 5 - Conclusion.md | 39 ------------------ 2 files changed, 40 insertions(+), 39 deletions(-) create mode 100644 published/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 5 - Conclusion.md delete 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/published/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 5 - Conclusion.md b/published/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 5 - Conclusion.md new file mode 100644 index 0000000000..ee9ded7f77 --- /dev/null +++ b/published/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 5 - Conclusion.md @@ -0,0 +1,40 @@ +一周 GNOME 之旅:品味它和 KDE 的是是非非(第三节 总结) +================================================================================ + +### 用户体验和最后想法 ### + +当 Gnome 2.x 和 KDE 4.x 要正面交锋时……我在它们之间左右逢源。我对它们爱恨交织,但总的来说它们使用起来还算是一种乐趣。然后 Gnome 3.x 来了,带着一场 Gnome Shell 的戏剧。那时我就放弃了 Gnome,我尽我所能的避开它。当时它对用户是不友好的,而且不直观,它打破了原有的设计典范,只为平板的统治世界做准备……而根据平板下跌的销量来看,这样的未来不可能实现。 + +在 Gnome 3 后续发布了八个版本后,奇迹发生了。Gnome 变得对对用户友好了,变得直观了。它完美吗?当然不。我还是很讨厌它想推动的那种设计范例,我讨厌它总想给我强加一种工作流(work flow),但是在付出时间和耐心后,这两都能被接受。只要你能够回头去看看 Gnome Shell 那外星人一样的界面,然后开始跟 Gnome 的其它部分(特别是控制中心)互动,你就能发现 Gnome 绝对做对了:细节,对细节的关注! + +人们能适应新的界面设计范例,能适应新的工作流—— iPhone 和 iPad 都证明了这一点——但真正让他们操心的一直是“纸割”——那些不完美的细节。 + +它带出了 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 开发者们知道设计很重要,这也是为什么VDG(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) +校对:[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 5 - Conclusion.md b/translated/tech/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 5 - Conclusion.md deleted file mode 100644 index 02ee7425fc..0000000000 --- a/translated/tech/20150716 A Week With GNOME As My Linux Desktop--What They Get Right & Wrong - Page 5 - Conclusion.md +++ /dev/null @@ -1,39 +0,0 @@ -将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 5cbc818b77dd1743ebac25a7b6f1bac3610a6ae5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=AE=A6=E6=88=90?= Date: Thu, 20 Aug 2015 01:21:17 +0800 Subject: [PATCH 380/507] RHCSA Series--Part 03-Done MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 更新完成 --- ...ow to Manage Users and Groups in RHEL 7.md | 224 ++++++++++++++++++ 1 file changed, 224 insertions(+) create mode 100644 translated/tech/RHCSA/RHCSA Series--Part 03--How to Manage Users and Groups in RHEL 7.md diff --git a/translated/tech/RHCSA/RHCSA Series--Part 03--How to Manage Users and Groups in RHEL 7.md b/translated/tech/RHCSA/RHCSA Series--Part 03--How to Manage Users and Groups in RHEL 7.md new file mode 100644 index 0000000000..1436621c4e --- /dev/null +++ b/translated/tech/RHCSA/RHCSA Series--Part 03--How to Manage Users and Groups in RHEL 7.md @@ -0,0 +1,224 @@ +RHCSA 系列: 如何管理RHEL7的用户和组 – Part 3 +================================================================================ +和管理其他Linux服务器一样,管理一个 RHEL 7 服务器 要求你能够添加,修改,暂停或删除用户帐户,并且授予他们文件,目录,其他系统资源所必要的权限。 +![User and Group Management in Linux](http://www.tecmint.com/wp-content/uploads/2015/03/User-and-Group-Management-in-Linux.png) + +RHCSA: 用户和组管理 – Part 3 + +### 管理用户帐户## + +如果想要给RHEL 7 服务器添加账户,你需要以root用户执行如下两条命令 + + # adduser [new_account] + # useradd [new_account] + +当添加新的用户帐户时,默认会执行下列操作。 + +- 他/她 的主目录就会被创建(一般是"/home/用户名",除非你特别设置) +- 一些隐藏文件 如`.bash_logout`, `.bash_profile` 以及 `.bashrc` 会被复制到用户的主目录,并且会为用户的回话提供环境变量.你可以进一步查看他们的相关细节。 +- 会为您的账号添加一个邮件池目录 +- 会创建一个和用户名同样的组 + +用户帐户的全部信息被保存在`/etc/passwd `文件。这个文件以如下格式保存了每一个系统帐户的所有信息(以:分割) + [username]:[x]:[UID]:[GID]:[Comment]:[Home directory]:[Default shell] + +- `[username]` 和`[Comment]` 是用于自我解释的 +- ‘x’表示帐户的密码保护(详细在`/etc/shadow`文件),就是我们用于登录的`[username]`. +- `[UID]` 和`[GID]`是用于显示`[username]` 的 用户认证和主用户组。 + +最后, + +- `[Home directory]`显示`[username]`的主目录的绝对路径 +- `[Default shell]` 是当用户登录系统后使用的默认shell + +另外一个你必须要熟悉的重要的文件是存储组信息的`/etc/group`.因为和`/etc/passwd`类似,所以也是由:分割 + [Group name]:[Group password]:[GID]:[Group members] + + + +- `[Group name]` 是组名 +- 这个组是否使用了密码 (如果是"X"意味着没有). +- `[GID]`: 和`/etc/passwd`中一样 +- `[Group members]`:用户列表,使用,隔开。里面包含组内的所有用户 + +添加过帐户后,任何时候你都可以通过 usermod 命令来修改用户战壕沟,基础的语法如下: + # usermod [options] [username] + +相关阅读 + +- [15 ‘useradd’ Command Examples][1] +- [15 ‘usermod’ Command Examples][2] + +#### 示例1 : 设置帐户的过期时间 #### + +如果你的公司有一些短期使用的帐户或者你相应帐户在有限时间内使用,你可以使用 `--expiredate` 参数 ,后加YYYY-MM-DD格式的日期。为了查看是否生效,你可以使用如下命令查看 + # chage -l [username] + +帐户更新前后的变动如下图所示 +![Change User Account Information](http://www.tecmint.com/wp-content/uploads/2015/03/Change-User-Account-Information.png) + +修改用户信息 + +#### 示例 2: 向组内追加用户 #### + +除了创建用户时的主用户组,一个用户还能被添加到别的组。你需要使用 -aG或 -append -group 选项,后跟逗号分隔的组名 +#### 示例 3: 修改用户主目录或默认Shell #### + +如果因为一些原因,你需要修改默认的用户主目录(一般为 /home/用户名),你需要使用 -d 或 -home 参数,后跟绝对路径来修改主目录 +如果有用户想要使用其他的shell来取代bash(比如sh ),一般默认是bash .使用 usermod ,并使用 -shell 的参数,后加新的shell的路径 +#### 示例 4: 展示组内的用户 #### + +当把用户添加到组中后,你可以使用如下命令验证属于哪一个组 + + # groups [username] + # id [username] + +下面图片的演示了示例2到示例四 + +![Adding User to Supplementary Group](http://www.tecmint.com/wp-content/uploads/2015/03/Adding-User-to-Supplementary-Group.png) + +添加用户到额外的组 + +在上面的示例中: + + # usermod --append --groups gacanepa,users --home /tmp --shell /bin/sh tecmint + +如果想要从组内删除用户,省略 `--append` 切换,并且可以使用 `--groups` 来列举组内的用户 + +#### 示例 5: 通过锁定密码来停用帐户 #### + +如果想要关闭帐户,你可以使用 -l(小写的L)或 -lock 选项来锁定用户的密码。这将会阻止用户登录。 + +#### 示例 6: 解锁密码 #### + +当你想要重新启用帐户让他可以继续登录时,属于 -u 或 –unlock 选项来解锁用户的密码,就像示例5 介绍的那样 + + # usermod --unlock tecmint + +下面的图片展示了示例5和示例6 + +![Lock Unlock User Account](http://www.tecmint.com/wp-content/uploads/2015/03/Lock-Unlock-User-Account.png) + +锁定上锁用户 + +#### 示例 7:删除组和用户 #### + +如果要删除一个组,你需要使用 groupdel ,如果需要删除用户 你需要使用 userdel (添加 -r 可以删除主目录和邮件池的内容) + # groupdel [group_name] # 删除组 + # userdel -r [user_name] # 删除用户,并删除主目录和邮件池 + +如果一些文件属于组,他们将不会被删除。但是组拥有者将会被设置为删除掉的组的GID +### 列举,设置,并且修改 ugo/rwx 权限 ### + +著名的 [ls 命令][3] 是管理员最好的助手. 当我们使用 -l 参数, 这个工具允许您查看一个目录中的内容(或详细格式). + +而且,该命令还可以应用于单个文件中。无论哪种方式,在“ls”输出中的前10个字符表示每个文件的属性。 +这10个字符序列的第一个字符用于表示文件类型: + +- – (连字符): 一个标准文件 +- d: 一个目录 +- l: 一个符号链接 +- c: 字符设备(将数据作为字节流,即一个终端) +- b: 块设备(处理数据块,即存储设备) + +文件属性的下一个九个字符,分为三个组,被称为文件模式,并注明读(r),写(w),并执行(x)授予文件的所有者,文件的所有组,和其他的用户(通常被称为“世界”)。 +在文件的读取权限允许打开和读取相同的权限时,允许其内容被列出,如果还设置了执行权限,还允许它作为一个程序和运行。 +文件权限是通过chmod命令改变的,它的基本语法如下: + + # chmod [new_mode] file + +new_mode是一个八进制数或表达式,用于指定新的权限。适合每一个随意的案例。或者您已经有了一个更好的方式来设置文件的权限,所以你觉得可以自由地使用最适合你自己的方法。 +八进制数可以基于二进制等效计算,可以从所需的文件权限的文件的所有者,所有组,和世界。一定权限的存在等于2的幂(R = 22,W = 21,x = 20),没有时意为0。例如: +![File Permissions](http://www.tecmint.com/wp-content/uploads/2015/03/File-Permissions.png) + +文件权限 + +在八进制形式下设置文件的权限,如上图所示 + + # chmod 744 myfile + +请用一分钟来对比一下我们以前的计算,在更改文件的权限后,我们的实际输出为: + +![Long List Format](http://www.tecmint.com/wp-content/uploads/2015/03/Long-List-Format.png) + +长列表格式 + +#### 示例 8: 寻找777权限的文件 #### + +出于安全考虑,你应该确保在正常情况下,尽可能避免777权限(读、写、执行的文件)。虽然我们会在以后的教程中教你如何更有效地找到所有的文件在您的系统的权限集的说明,你现在仍可以使用LS grep获取这种信息。 +在下面的例子,我们会寻找 /etc 目录下的777权限文件. 注意,我们要使用第二章讲到的管道的知识[第二章:文件和目录管理][4]: + + # 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) + +查找所有777权限的文件 + +#### 示例 9: 为所有用户指定特定权限 #### + +shell脚本,以及一些二进制文件,所有用户都应该有权访问(不只是其相应的所有者和组),应该有相应的执行权限(我们会讨论特殊情况下的问题): + # chmod a+x script.sh + +**注意**: 我们可以设置文件模式使用表示用户权限的字母如“u”,组所有者权限的字母“g”,其余的为o 。所有权限为a.权限可以通过`+` 或 `-` 来管理。 + +![Set Execute Permission on File](http://www.tecmint.com/wp-content/uploads/2015/03/Set-Execute-Permission-on-File.png) + +为文件设置执行权限 + +长目录列表还显示了该文件的所有者和其在第一和第二列中的组主。此功能可作为系统中文件的第一级访问控制方法: + +![Check File Owner and Group](http://www.tecmint.com/wp-content/uploads/2015/03/Check-File-Owner-and-Group.png) + +检查文件的属主和属组 + +改变文件的所有者,您将使用chown命令。请注意,您可以在同一时间或单独的更改文件的所有权: + # chown user:group file + +虽然可以在同一时间更改用户或组,或在同一时间的两个属性,但是不要忘记冒号区分,如果你想要更新其他属性,让另外的选项保持空白: + # chown :group file # Change group ownership only + # chown user: file # Change user ownership only + +#### 示例 10:从一个文件复制权限到另一个文件#### + +If you would like to “clone” ownership from one file to another, you can do so using the –reference flag, as follows: +如果你想“克隆”一个文件的所有权到另一个,你可以这样做,使用–reference参数,如下: + # chown --reference=ref_file file + +ref_file的所有信息会复制给 file + +![Clone File Ownership](http://www.tecmint.com/wp-content/uploads/2015/03/Clone-File-Ownership.png) + +复制文件属主信息 + +### 设置 SETGID 协作目录 ### + +你应该授予在一个特定的目录中拥有访问所有的文件的权限给一个特点的用户组,你将有可能使用目录设置setgid的方法。当setgid后设置,真实用户的有效GID成为团队的主人。 +因此,任何用户都可以访问该文件的组所有者授予的权限的文件。此外,当setgid设置在一个目录中,新创建的文件继承同一组目录,和新创建的子目录也将继承父目录的setgid。 + # chmod g+s [filename] + +为了设置 setgid 在八进制形式,预先准备好数字2 来给基本的权限 + # chmod 2755 [directory] + +### 总结 ### + +扎实的用户和组管理知识,符合规则的,Linux权限管理,以及部分实践,可以帮你快速解决RHEL 7 服务器的文件权限。 +我向你保证,当你按照本文所概述的步骤和使用系统文档(和第一章解释的那样 [Part 1: Reviewing Essential Commands & System Documentation][5] of this series) 你将掌握基本的系统管理的能力。 + +请随时让我们知道你是否有任何问题或意见使用下面的表格。 + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/rhcsa-exam-manage-users-and-groups/ + +作者:[Gabriel Cánepa][a] +译者:[xiqingongzi](https://github.com/xiqingongzi) +校对:[校对者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/ From a450026ce4ddab845ce40bffc5f6e6c86e79da78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=AE=A6=E6=88=90?= Date: Thu, 20 Aug 2015 01:21:53 +0800 Subject: [PATCH 381/507] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=A4=9A=E4=BD=99?= =?UTF-8?q?=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ow to Manage Users and Groups in RHEL 7.md | 249 ------------------ 1 file changed, 249 deletions(-) delete mode 100644 sources/tech/RHCSA Series/RHCSA Series--Part 03--How to Manage Users and Groups in RHEL 7.md 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 deleted file mode 100644 index 0b85744c6c..0000000000 --- a/sources/tech/RHCSA Series/RHCSA Series--Part 03--How to Manage Users and Groups in RHEL 7.md +++ /dev/null @@ -1,249 +0,0 @@ -[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. - -![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/ From c4c3eca5f243fd41b4cfa2da2cca0aa2bdf9517c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=AE=A6=E6=88=90?= Date: Thu, 20 Aug 2015 01:24:52 +0800 Subject: [PATCH 382/507] =?UTF-8?q?=E3=80=90=E7=BF=BB=E8=AF=91=E4=B8=AD?= =?UTF-8?q?=E3=80=91RHCSA=20Series--Part=2007?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... (Access Control Lists) and Mounting Samba or NFS Shares.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 index d4801d9923..f8d9d45d27 100644 --- 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 @@ -1,3 +1,4 @@ +[xiqingongzi Translating] 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. @@ -209,4 +210,4 @@ via: http://www.tecmint.com/rhcsa-exam-configure-acls-and-mount-nfs-samba-shares [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 +[3]:https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Storage_Administration_Guide/ch-acls.html From 9c78c7296ec672e8e0825d08106bcba40362f8f4 Mon Sep 17 00:00:00 2001 From: Ezio Date: Thu, 20 Aug 2015 10:03:16 +0800 Subject: [PATCH 383/507] Update 20150728 Process of the Linux kernel building.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 翻译到line 600 --- ...28 Process of the Linux kernel building.md | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) 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 e55605f863..c622e43ba0 100644 --- a/sources/tech/20150728 Process of the Linux kernel building.md +++ b/sources/tech/20150728 Process of the Linux kernel building.md @@ -482,12 +482,16 @@ $(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: +参数`obj` 会告诉脚本[scripts/Makefile.build](https://github.com/torvalds/linux/blob/master/scripts/Makefile.build) 那些目录包含`kbuild` 文件,脚本以此来寻找各个`kbuild` 文件: + ```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: +然后根据这个构建目标。我们这里`.` 包含了[Kbuild](https://github.com/torvalds/linux/blob/master/Kbuild),就用这个文件来生成`kernel/bounds.s` 和`arch/x86/kernel/asm-offsets.s`。这样目标`prepare` 就完成了它的工作。`vmlinux-dirs` 也依赖于第二个目标——`scripts` ,`scripts`会编译接下来的几个程序:`filealias`,`mk_elfconfig`,`modpost`等等。`scripts/host-programs` 编译完之后,我们的目标`vmlinux-dirs` 就可以开始编译了。第一步,我们先来理解一下`vmlinux-dirs` 都包含了那些东西。在我们的例子中它包含了接下来的内核目录的路径: + ``` init usr arch/x86 kernel mm fs ipc security crypto block drivers sound firmware arch/x86/pci arch/x86/power @@ -496,6 +500,8 @@ 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](https://github.com/torvalds/linux/blob/master/Makefile) 里找到`vmlinux-dirs` 的定义: + ```Makefile vmlinux-dirs := $(patsubst %/,%,$(filter %/, $(init-y) $(init-m) \ $(core-y) $(core-m) $(drivers-y) $(drivers-m) \ @@ -512,6 +518,8 @@ 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: +这里我们借助函数`patsubst` 和`filter`去掉了每个目录路径里的符号`/`,并且把结果放到`vmlinux-dirs` 里。所以我们就有了`vmlinux-dirs` 里的目录的列表,以及下面的代码: + ```Makefile $(vmlinux-dirs): prepare scripts $(Q)$(MAKE) $(build)=$@ @@ -519,6 +527,8 @@ $(vmlinux-dirs): prepare scripts 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: +符号`$@` 在这里代表了`vmlinux-dirs`,这就表明程序会递归遍历从`vmlinux-dirs` 以及它内部的全部目录(依赖于配置),并且在对应的目录下执行`make` 命令。我们可以在输出看到结果: + ``` CC init/main.o CHK include/generated/compile.h @@ -535,7 +545,7 @@ The `$@` represents `vmlinux-dirs` here that means that it will go recursively o ``` Source code in each directory will be compiled and linked to the `built-in.o`: - +每个目录下的源代码将会被编译并且链接到`built-io.o` 里: ``` $ find . -name built-in.o ./arch/x86/crypto/built-in.o @@ -549,6 +559,8 @@ $ find . -name 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. +好了,所有的`built-in.o` 都构建完了,现在我们回到目标`vmlinux` 上。你应该还记得,目标`vmlinux` 是在内核的根makefile 里。在链接`vmlinux` 之前,系统会构建[samples](https://github.com/torvalds/linux/tree/master/samples), [Documentation](https://github.com/torvalds/linux/tree/master/Documentation)等等,但是如上文所述,我不会在本文描述这些。 + ```Makefile vmlinux: scripts/link-vmlinux.sh $(vmlinux-deps) FORCE ... @@ -558,6 +570,8 @@ vmlinux: scripts/link-vmlinux.sh $(vmlinux-deps) FORCE 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: +你可以看到,`vmlinux` 的调用脚本[scripts/link-vmlinux.sh](https://github.com/torvalds/linux/blob/master/scripts/link-vmlinux.sh) 的主要目的是把所有的`built-in.o` 链接成一个静态可执行文件、生成[System.map](https://en.wikipedia.org/wiki/System.map)。 最后我们来看看下面的输出: + ``` LINK vmlinux LD vmlinux.o @@ -575,7 +589,7 @@ As you can see main purpose of it is a call of the [scripts/link-vmlinux.sh](htt ``` and `vmlinux` and `System.map` in the root of the Linux kernel source tree: - +还有内核源码树根目录下的`vmlinux` 和`System.map` ``` $ ls vmlinux System.map System.map vmlinux @@ -583,7 +597,10 @@ System.map vmlinux That's all, `vmlinux` is ready. The next step is creation of the [bzImage](https://en.wikipedia.org/wiki/Vmlinux#bzImage). +这就是全部了,`vmlinux` 构建好了,下一步就是创建[bzImage](https://en.wikipedia.org/wiki/Vmlinux#bzImage). + Building bzImage +制作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: From 60092d5f44b9660dca43a1fe5e8df24cf19073c1 Mon Sep 17 00:00:00 2001 From: DeadFire Date: Thu, 20 Aug 2015 16:16:43 +0800 Subject: [PATCH 384/507] =?UTF-8?q?20150820-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...con--The Changing Role of the Server OS.md | 49 +++++++++++++++++++ ... Torvalds muses about open-source software.md | 46 +++++++++++++++++ 2 files changed, 95 insertions(+) create mode 100644 sources/talk/20150819 Linuxcon--The Changing Role of the Server OS.md create mode 100644 sources/talk/20150820 LinuxCon's surprise keynote speaker ​Linus Torvalds muses about open-source software.md diff --git a/sources/talk/20150819 Linuxcon--The Changing Role of the Server OS.md b/sources/talk/20150819 Linuxcon--The Changing Role of the Server OS.md new file mode 100644 index 0000000000..8f6d80c7e9 --- /dev/null +++ b/sources/talk/20150819 Linuxcon--The Changing Role of the Server OS.md @@ -0,0 +1,49 @@ +Linuxcon: The Changing Role of the Server OS +================================================================================ +SEATTLE - Containers might one day change the world, but it will take time and it will also change the role of the operating system. That's the message delivered during a Linuxcon keynote here today by Wim Coekaerts, SVP Linux and virtualization engineering at Oracle. + +![](http://www.serverwatch.com/imagesvr_ce/6421/wim-200x150.jpg) + +Coekaerts started his presentation by putting up a slide stating it's the year of the desktop, which generated a few laughs from the audience. Oracle Wim Coekarts Truly, though, Coekaerts said it is now apparent that 2015 is the year of the container, and more importantly the year of the application, which is what containers really are all about. + +"What do you need an operating system for?" Coekaerts asked. "It's really just there to run an application; an operating system is there to manage hardware and resources so your app can run." + +Coekaerts added that with Docker containers, the focus is once again on the application. At Oracle, Coekaerts said much of the focus is on how to make the app run better on the OS. + +"Many people are used to installing apps, but many of the younger generation just click a button on their mobile device and it runs," Coekaerts said. + +Coekaerts said that people now wonder why it's more complex in the enterprise to install software, and Docker helps to change that. + +"The role of the operating system is changing," Coekaerts said. + +The rise of Docker does not mean the demise of virtual machines (VMs), though. Coekaerts said it will take a very long time for things to mature in the containerization space and get used in real world. + +During that period VMs and containers will co-exist and there will be a need for transition and migration tools between containers and VMs. For example, Coekaerts noted that Oracle's VirtualBox open-source technology is widely used on desktop systems today as a way to help users run Docker. The Docker Kitematic project makes use of VirtualBox to boot Docker on Macs today. + +### The Open Compute Initiative and Write Once, Deploy Anywhere for Containers ### + +A key promise that needs to be enabled for containers to truly be successful is the concept of write once, deploy anywhere. That's an area where the Linux Foundations' Open Compute Initiative (OCI) will play a key role in enabling interoperability across container runtimes. + +"With OCI, it will make it easier to build once and run anywhere, so what you package locally you can run wherever you want," Coekaerts said. + +Overall, though, Coekaerts said that while there is a lot of interest in moving to the container model, it's not quite ready yet. He noted Oracle is working on certifying its products to run in containers, but it's a hard process. + +"Running the database is easy; it's everything else around it that is complex," Coekaerts said. "Containers don't behave the same as VMs, and some applications depend on low-level system configuration items that are not exposed from the host to the container." + +Additionally, Coekaerts commented that debugging problems inside a container is different than in a VM, and there is currently a lack of mature tools for proper container app debugging. + +Coekaerts emphasized that as containers matures it's important to not forget about the existing technology that organizations use to run and deploy applications on servers today. He said enterprises don't typically throw out everything they have just to start with new technology. + +"Deploying new technology is hard, and you need to be able to transition from what you have," Coekaerts said. "The technology that allows you to transition easily is the technology that wins." + +-------------------------------------------------------------------------------- + +via: http://www.serverwatch.com/server-news/linuxcon-the-changing-role-of-the-server-os.html + +作者:[Sean Michael Kerner][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.serverwatch.com/author/Sean-Michael-Kerner-101580.htm \ No newline at end of file diff --git a/sources/talk/20150820 LinuxCon's surprise keynote speaker ​Linus Torvalds muses about open-source software.md b/sources/talk/20150820 LinuxCon's surprise keynote speaker ​Linus Torvalds muses about open-source software.md new file mode 100644 index 0000000000..c045233630 --- /dev/null +++ b/sources/talk/20150820 LinuxCon's surprise keynote speaker ​Linus Torvalds muses about open-source software.md @@ -0,0 +1,46 @@ +LinuxCon's surprise keynote speaker ​Linus Torvalds muses about open-source software +================================================================================ +> In a broad-ranging question and answer session, Linus Torvalds, Linux's founder, shared his thoughts on the current state of open source and Linux. + +**SEATTLE** -- [LinuxCon][1] attendees got an early Christmas present when the Wednesday morning "surprise" keynote speaker turned out to be Linux's founder, Linus Torvalds. + +![zemlin-and-torvalds-08192015-1.jpg](http://zdnet2.cbsistatic.com/hub/i/2015/08/19/9951f05a-fedf-4bf4-a4a1-3b4a15458de6/c19c89ded58025eccd090787ba40e803/zemlin-and-torvalds-08192015-1.jpg) + +Jim Zemlin and Linus Torvalds shooting the breeze at LinuxCon in Seattle. -- sjvn + +Jim Zemlin, the Linux Foundation's executive director, opened the question and answer session by quoting from a recent article about Linus, "[Torvalds may be the most influential individual economic force][2] of the past 20 years. ... Torvalds has, in effect, been as instrumental in retooling the production lines of the modern economy as Henry Ford was 100 years earlier." + +Torvalds replied, "I don't think I'm all that powerful, but I'm glad to get all the credit for open source." For someone who's arguably been more influential on technology than Bill Gates, Steve Jobs, or Larry Ellison, Torvalds remains amusingly modest. That's probably one reason [Torvalds, who doesn't suffer fools gladly][3], remains the unchallenged leader of Linux. + +It also helps that he doesn't take himself seriously, except when it comes to code quality. Zemlin reminded him that he was also described in the same article as being "5-feet, ho-hum tall with a paunch, ... his body type and gait resemble that of Tux, the penguin mascot of Linux." Torvald's reply was to grin and say "What is this? A roast?" He added that 5'8" was a perfectly good height. + +More seriously, Zemlin asked Torvalds what he thought about the current excitement over containers. Indeed, at times LinuxCon has felt like DockerCon. Torvalds replied, "I'm glad that the kernel is far removed from containers and other buzzwords. We only care about just the kernel. I'm so focused on the kernel I really don't care. I don't get involved in the politics above the kernel and I'm really happy that I don't know." + +Moving on, Zemlin asked Torvalds what he thought about the demand from the Internet of Things (IoT) for an even smaller Linux kernel. "Everyone has always wished for a smaller kernel," Torvalds said. "But, with all the modules it's still tens of MegaBytes in size. It's shocking that it used to fit into a MB. We'd like it to be mean lean, mean IT machine again." + +But, "Torvalds continued, "It's hard to get rid of unnecessary fat. Things tend to grow. Realistically I don't think we can get down to the sizes we were 20 years ago." + +As for security, the next topic, Torvalds said, "I'm at odds with the security community. They tend to see technology as black and white. If it's not security they don't care at all about it." The truth is "security is bugs. Most of the security issues we've had in the kernel hasn't been that big. Most of them have been really stupid and then some clever person takes advantage of it." + +The bottom line is, "We'll never get rid of bugs so security will never be perfect. We do try to be really careful about code. With user space we have to be very strict." But, "Bugs happen and all you can do is mitigate them. Open source is doing fairly well, but anyone who thinks we'll ever be completely secure is foolish." + +Zemlin concluded by asking Torvalds where he saw Linux ten years from now. Torvalds replied that he doesn't look at it this way. "I'm plodding, pedestrian, I look ahead six months, I don't plan 10 years ahead. I think that's insane." + +Sure, "companies plan ten years, and their plans use open source. Their whole process is very forward thinking. But I'm not worried about 10 years ahead. I look to the next release and the release beyond that." + +For Torvalds, who works at home where "the FedEx guy is no longer surprised to find me in my bathrobe at 2 in the afternoon," looking ahead a few months works just fine. And so do all the businesses -- both technology-based Amazon, Google, Facebook and more mainstream, WalMart, the New York Stock Exchange, and McDonalds -- that live on Linux every day. + +-------------------------------------------------------------------------------- + +via: http://www.zdnet.com/article/linus-torvalds-muses-about-open-source-software/ + +作者:[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.zdnet.com/meet-the-team/us/steven-j-vaughan-nichols/ +[1]:http://events.linuxfoundation.org/events/linuxcon-north-america +[2]:http://www.bloomberg.com/news/articles/2015-06-16/the-creator-of-linux-on-the-future-without-him +[3]:http://www.zdnet.com/article/linus-torvalds-finds-gnome-3-4-to-be-a-total-user-experience-design-failure/ \ No newline at end of file From 42ff87dfae1d59fe49974424b2849c3fbfc88a66 Mon Sep 17 00:00:00 2001 From: DeadFire Date: Thu, 20 Aug 2015 16:31:42 +0800 Subject: [PATCH 385/507] =?UTF-8?q?20150820-2=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ook at What's Next for the Linux Kernel.md | 49 ++++++ ...butions Would Presidential Hopefuls Run.md | 53 +++++++ .../20150820 Why did you start using Linux.md | 147 ++++++++++++++++++ 3 files changed, 249 insertions(+) create mode 100644 sources/talk/20150820 A Look at What's Next for the Linux Kernel.md create mode 100644 sources/talk/20150820 Which Open Source Linux Distributions Would Presidential Hopefuls Run.md create mode 100644 sources/talk/20150820 Why did you start using Linux.md diff --git a/sources/talk/20150820 A Look at What's Next for the Linux Kernel.md b/sources/talk/20150820 A Look at What's Next for the Linux Kernel.md new file mode 100644 index 0000000000..9705fd3a90 --- /dev/null +++ b/sources/talk/20150820 A Look at What's Next for the Linux Kernel.md @@ -0,0 +1,49 @@ +A Look at What's Next for the Linux Kernel +================================================================================ +![](http://www.eweek.com/imagesvr_ce/485/290x195cilinux1.jpg) + +**The upcoming Linux 4.2 kernel will have more contributors than any other Linux kernel in history, according to Linux kernel developer Jonathan Corbet.** + +SEATTLE—The Linux kernel continues to grow—both in lines of code and the number of developers that contribute to it—yet some challenges need to be addressed. That was one of the key messages from Linux kernel developer Jonathan Corbet during his annual Kernel Report session at the LinuxCon conference here. + +The Linux 4.2 kernel is still under development, with general availability expected on Aug. 23. Corbet noted that 1,569 developers have contributed code for the Linux 4.2 kernel. Of those, 277 developers made their first contribution ever, during the Linux 4.2 development cycle. + +Even as more developers are coming to Linux, the pace of development and releases is very fast, Corbet said. He estimates that it now takes approximately 63 days for the community to build a new Linux kernel milestone. + +Linux 4.2 will benefit from a number of improvements that have been evolving in Linux over the last several releases. One such improvement is the introduction of OverlayFS, a new type of read-only file system that is useful because it can enable many containers to be layered on top of each other, Corbet said. + +Linux networking also is set to improve small packet performance, which is important for areas such as high-frequency financial trading. The improvements are aimed at reducing the amount of time and power needed to process each data packet, Corbet said. + +New drivers are always being added to Linux. On average, there are 60 to 80 new or updated drivers added in every Linux kernel development cycle, Corbet said. + +Another key area that continues to improve is that of Live Kernel patching, first introduced in the Linux 4.0 kernel. With live kernel patching, the promise is that a system administrator can patch a live running kernel without the need to reboot a running production system. While the basic elements of live kernel patching are in the kernel already, work is under way to make the technology all work with the right level of consistency and stability, Corbet explained. + +**Linux Security, IoT and Other Concerns** + +Security has been a hot topic in the open-source community in the past year due to high-profile issues, including Heartbleed and Shellshock. + +"I don't doubt there are some unpleasant surprises in the neglected Linux code at this point," Corbet said. + +He noted that there are more than 3 millions lines of code in the Linux kernel today that have been untouched in the last decade by developers and that the Shellshock vulnerability was a flaw in 20-year-old code that hadn't been looked at in some time. + +Another issue that concerns Corbet is the Unix 2038 issue—the Linux equivalent of the Y2K bug, which could have caused global havoc in the year 2000 if it hadn't been fixed. With the 2038 issue, there is a bug that could shut down Linux and Unix machines in the year 2038. Corbet said that while 2038 is still 23 years away, there are systems being deployed now that will be in use in the 2038. + +Some initial work took place to fix the 2038 flaw in Linux, but much more remains to be done, Corbet said. "The time to fix this is now, not 20 years from now in a panic when we're all trying to enjoy our retirement," Corbet said. + +The Internet of things (IoT) is another area of Linux concern for Corbet. Today, Linux is a leading embedded operating system for IoT, but that might not always be the case. Corbet is concerned that the Linux kernel's growth is making it too big in terms of memory footprint to work in future IoT devices. + +A Linux project is now under way to minimize the size of the Linux kernel, and it's important that it gets the support it needs, Corbet said. + +"Either Linux is suitable for IoT, or something else will come along and that something else might not be as free and open as Linux," Corbet said. "We can't assume the continued dominance of Linux in IoT. We have to earn it. We have to pay attention to stuff that makes the kernel bigger." + +-------------------------------------------------------------------------------- + +via: http://www.eweek.com/enterprise-apps/a-look-at-whats-next-for-the-linux-kernel.html + +作者:[Sean Michael Kerner][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.eweek.com/cp/bio/Sean-Michael-Kerner/ \ No newline at end of file diff --git a/sources/talk/20150820 Which Open Source Linux Distributions Would Presidential Hopefuls Run.md b/sources/talk/20150820 Which Open Source Linux Distributions Would Presidential Hopefuls Run.md new file mode 100644 index 0000000000..2a850a7468 --- /dev/null +++ b/sources/talk/20150820 Which Open Source Linux Distributions Would Presidential Hopefuls Run.md @@ -0,0 +1,53 @@ +Which Open Source Linux Distributions Would Presidential Hopefuls Run? +================================================================================ +![Republican presidential candidate Donald Trump +](http://thevarguy.com/site-files/thevarguy.com/files/imagecache/medium_img/uploads/2015/08/donaldtrump.jpg) + +Republican presidential candidate Donald Trump + +If people running for president used Linux or another open source operating system, which distribution would it be? That's a key question that the rest of the press—distracted by issues of questionable relevance such as "policy platforms" and whether it's appropriate to add an exclamation point to one's Christian name—has been ignoring. But the ignorance ends here: Read on for this sometime-journalist's take on presidential elections and Linux distributions. + +If this sounds like a familiar topic to those of you who have been reading my drivel for years (is anyone, other than my dear editor, unfortunate enough to have actually done that?), it's because I wrote a [similar post][1] during the last presidential election cycle. Some kind readers took that article more seriously than I intended, so I'll take a moment to point out that I don't actually believe that open source software and political campaigns have anything meaningful to do with one another. I am just trying to amuse myself at the start of a new week. + +But you can make of this what you will. You're the reader, after all. + +### Linux Distributions of Choice: Republicans ### + +Today, I'll cover just the Republicans. And I won't even discuss all of them, since the candidates hoping for the Republican party's nomination are too numerous to cover fully here in one post. But for starters: + +If **Jeb (Jeb!?) Bush** ran Linux, it would be [Debian][2]. It's a relatively boring distribution designed for serious, grown-up hackers—the kind who see it as their mission to be the adults in the pack and clean up the messes that less-experienced open source fans create. Of course, this also makes Debian relatively unexciting, and its user base remains perennially small as a result. + +**Scott Walker**, for his part, would be a [Damn Small Linux][3] (DSL) user. Requiring merely 50MB of disk space and 16MB of RAM to run, DSL can breathe new life into 20-year-old 486 computers—which is exactly what a cost-cutting guru like Walker would want. Of course, the user experience you get from DSL is damn primitive; the platform barely runs a browser. But at least you won't be wasting money on new computer hardware when the stuff you bought in 1993 can still serve you perfectly well. + +How about **Chris Christie**? He'd obviously be clinging to [Relax-and-Recover Linux][4], which bills itself as a "setup-and-forget Linux bare metal disaster recovery solution." "Setup-and-forget" has basically been Christie's political strategy ever since that unfortunate incident on the George Washington Bridge stymied his political momentum. Disaster recovery may or may not bring back everything for Christie in the end, but at least he might succeed in recovering a confidential email or two that accidentally disappeared when his computer crashed. + +As for **Carly Fiorina**, she'd no doubt be using software developed for "[The Machine][5]" operating system from [Hewlett-Packard][6] (HPQ), the company she led from 1999 to 2005. The Machine actually may run several different operating systems, which may or may not be based on Linux—details remain unclear—and its development began well after Fiorina's tenure at HP came to a conclusion. Still, her roots as a successful executive in the IT world form an important part of her profile today, meaning that her ties to HP have hardly been severed fully. + +Last but not least—and you knew this was coming—there's **Donald Trump**. He'd most likely pay a team of elite hackers millions of dollars to custom-build an operating system just for him—even though he could obtain a perfectly good, ready-made operating system for free—to show off how much money he has to waste. He'd then brag about it being the best operating system ever made, though it would of course not be compliant with POSIX or anything else, because that would mean catering to the establishment. The platform would also be totally undocumented, since, if Trump explained how his operating system actually worked, he'd risk giving away all his secrets to the Islamic State—obviously. + +Alternatively, if Trump had to go with a Linux platform already out there, [Ubuntu][7] seems like the most obvious choice. Like Trump, the Ubuntu developers have taken a we-do-what-we-want approach to building open source software by implementing their own, sometimes proprietary applications and interfaces. Free-software purists hate Ubuntu for that, but plenty of ordinary people like it a lot. Of course, whether playing purely by your own rules—in the realms of either software or politics—is sustainable in the long run remains to be seen. + +### Stay Tuned ### + +If you're wondering why I haven't yet mentioned the Democratic candidates, worry not. I am not leaving them out of today's writing because I like them any more or less than the Republicans. (Personally, I think the peculiar American practice of having only two viable political parties—which virtually no other functioning democracy does—is ridiculous, and I am suspicious of all of these candidates as a result.) + +On the contrary, there's plenty to say about the Linux distributions the Democrats might use, too. And I will, in a future post. Stay tuned. + +-------------------------------------------------------------------------------- + +via: http://thevarguy.com/open-source-application-software-companies/081715/which-open-source-linux-distributions-would-presidential- + +作者:[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]:http://thevarguy.com/open-source-application-software-companies/aligning-linux-distributions-presidential-hopefuls +[2]:http://debian.org/ +[3]:http://www.damnsmalllinux.org/ +[4]:http://relax-and-recover.org/ +[5]:http://thevarguy.com/open-source-application-software-companies/061614/hps-machine-open-source-os-truly-revolutionary +[6]:http://hp.com/ +[7]:http://ubuntu.com/ \ No newline at end of file diff --git a/sources/talk/20150820 Why did you start using Linux.md b/sources/talk/20150820 Why did you start using Linux.md new file mode 100644 index 0000000000..f83742a7a1 --- /dev/null +++ b/sources/talk/20150820 Why did you start using Linux.md @@ -0,0 +1,147 @@ +Why did you start using Linux? +================================================================================ +> In today's open source roundup: What got you started with Linux? Plus: IBM's Linux only Mainframe. And why you should skip Windows 10 and go with Linux + +### Why did you start using Linux? ### + +Linux has become quite popular over the years, with many users defecting to it from OS X or Windows. But have you ever wondered what got people started with Linux? A redditor asked that question and got some very interesting answers. + +SilverKnight asked his question on the Linux subreddit: + +> I know this has been asked before, but I wanted to hear more from the younger generation why it is that they started using linux and what keeps them here. +> +> I dont want to discourage others from giving their linux origin stories, because those are usually pretty good, but I was mostly curious about our younger population since there isn't much out there from them yet. +> +> I myself am 27 and am a linux dabbler. I have installed quite a few different distros over the years but I haven't made the plunge to full time linux. I guess I am looking for some more reasons/inspiration to jump on the bandwagon. +> +> [More at Reddit][1] + +Fellow redditors in the Linux subreddit responded with their thoughts: + +> **DoublePlusGood**: "I started using Backtrack Linux (now Kali) at 12 because I wanted to be a "1337 haxor". I've stayed with Linux (Archlinux currently) because it lets me have the endless freedom to make my computer do what I want." +> +> **Zack**: "I'm a Linux user since, I think, the age of 12 or 13, I'm 15 now. +> +> It started when I got tired with Windows XP at 11 and the waiting, dammit am I impatient sometimes, but waiting for a basic task such as shutting down just made me tired of Windows all together. +> +> A few months previously I had started participating in discussions in a channel on the freenode IRC network which was about a game, and as freenode usually goes, it was open source and most of the users used Linux. +> +> I kept on hearing about this Linux but wasn't that interested in it at the time. However, because the channel (and most of freenode) involved quite a bit of programming I started learning Python. +> +> A year passed and I was attempting to install GNU/Linux (specifically Ubuntu) on my new (technically old, but I had just got it for my birthday) PC, unfortunately it continually froze, for reasons unknown (probably a bad hard drive, or a lot of dust or something else...). +> +> Back then I was the type to give up on things, so I just continually nagged my dad to try and install Ubuntu, he couldn't do it for the same reasons. +> +> After wanting Linux for a while I became determined to get Linux and ditch windows for good. So instead of Ubuntu I tried Linux Mint, being a derivative of Ubuntu(?) I didn't have high hopes, but it worked! +> +> I continued using it for another 6 months. +> +> During that time a friend on IRC gave me a virtual machine (which ran Ubuntu) on their server, I kept it for a year a bit until my dad got me my own server. +> +> After the 6 months I got a new PC (which I still use!) I wanted to try something different. +> +> I decided to install openSUSE. +> +> I liked it a lot, and on the same Christmas I obtained a Raspberry Pi, and stuck with Debian on it for a while due to the lack of support other distros had for it." +> +> **Cqz**: "Was about 9 when the Windows 98 machine handed down to me stopped working for reasons unknown. We had no Windows install disk, but Dad had one of those magazines that comes with demo programs and stuff on CDs. This one happened to have install media for Mandrake Linux, and so suddenly I was a Linux user. Had no idea what I was doing but had a lot of fun doing it, and although in following years I often dual booted with various Windows versions, the FLOSS world always felt like home. Currently only have one Windows installation, which is a virtual machine for games." +> +> **Tosmarcel**: "I was 15 and was really curious about this new concept called 'programming' and then I stumbled upon this Harvard course, CS50. They told users to install a Linux vm to use the command line. But then I asked myself: "Why doesn't windows have this command line?!". I googled 'linux' and Ubuntu was the top result -Ended up installing Ubuntu and deleted the windows partition accidentally... It was really hard to adapt because I knew nothing about linux. Now I'm 16 and running arch linux, never looked back and I love it!" +> +> **Micioonthet**: "First heard about Linux in the 5th grade when I went over to a friend's house and his laptop was running MEPIS (an old fork of Debian) instead of Windows XP. +> +> Turns out his dad was a socialist (in America) and their family didn't trust Microsoft. This was completely foreign to me, and I was confused as to why he would bother using an operating system that didn't support the majority of software that I knew. +> +> Fast forward to when I was 13 and without a laptop. Another friend of mine was complaining about how slow his laptop was, so I offered to buy it off of him so I could fix it up and use it for myself. I paid $20 and got a virus filled, unusable HP Pavilion with Windows Vista. Instead of trying to clean up the disgusting Windows install, I remembered that Linux was a thing and that it was free. I burned an Ubuntu 12.04 disc and installed it right away, and was absolutely astonished by the performance. +> +> Minecraft (one of the few early Linux games because it ran on Java), which could barely run at 5 FPS on Vista, ran at an entirely playable 25 FPS on a clean install of Ubuntu. +> +> I actually still have that old laptop and use it occasionally, because why not? Linux doesn't care how old your hardware is. +> +> I since converted my dad to Linux and we buy old computers at lawn sales and thrift stores for pennies and throw Linux Mint or some other lightweight distros on them." +> +> **Webtm**: "My dad had every computer in the house with some distribution on it, I think a couple with OpenSUSE and Debian, and his personal computer had Slackware on it. So I remember being little and playing around with Debian and not really getting into it much. So I had a Windows laptop for a few years and my dad asked me if I wanted to try out Debian. It was a fun experience and ever since then I've been using Debian and trying out distributions. I currently moved away from Linux and have been using FreeBSD for around 5 months now, and I am absolutely happy with it. +> +> The control over your system is fantastic. There are a lot of cool open source projects. I guess a lot of the fun was figuring out how to do the things I want by myself and tweaking those things in ways to make them do something else. Stability and performance is also a HUGE plus. Not to mention the level of privacy when switching." +> +> **Wyronaut**: "I'm currently 18, but I first started using Linux when I was 13. Back then my first distro was Ubuntu. The reason why I wanted to check out Linux, was because I was hosting little Minecraft game servers for myself and a couple of friends, back then Minecraft was pretty new-ish. I read that the defacto operating system for hosting servers was Linux. +> +> I was a big newbie when it came to command line work, so Linux scared me a little, because I had to take care of a lot of things myself. But thanks to google and a few wiki pages I managed to get up a couple of simple servers running on a few older PC's I had lying around. Great use for all that older hardware no one in the house ever uses. +> +> After running a few game servers I started running a few web servers as well. Experimenting with HTML, CSS and PHP. I worked with those for a year or two. Afterwards, took a look at Java. I made the terrible mistake of watching TheNewBoston video's. +> +> So after like a week I gave up on Java and went to pick up a book on Python instead. That book was Learn Python The Hard Way by Zed A. Shaw. After I finished that at the fast pace of two weeks, I picked up the book C++ Primer, because at the time I wanted to become a game developer. Went trough about half of the book (~500 pages) and burned out on learning. At that point I was spending a sickening amount of time behind my computer. +> +> After taking a bit of a break, I decided to pick up JavaScript. Read like 2 books, made like 4 different platformers and called it a day. +> +> Now we're arriving at the present. I had to go through the horrendous process of finding a school and deciding what job I wanted to strive for when I graduated. I ruled out anything in the gaming sector as I didn't want anything to do with graphics programming anymore, I also got completely sick of drawing and modelling. And I found this bachelor that had something to do with netsec and I instantly fell in love. I picked up a couple books on C to shred this vacation period and brushed up on some maths and I'm now waiting for the new school year to commence. +> +> Right now, I am having loads of fun with Arch Linux, made couple of different arrangements on different PC's and it's going great! +> +> In a sense Linux is what also got me into programming and ultimately into what I'm going to study in college starting this september. I probably have my future life to thank for it." +> +> **Linuxllc**: "You also can learn from old farts like me. +> +> The crutch, The crutch, The crutch. Getting rid of the crutch will inspired you and have good reason to stick with Linux. +> +> I got rid of my crutch(Windows XP) back in 2003. Took me only 5 days to get all my computer task back and running at a 100% workflow. Including all my peripheral devices. Minus any Windows games. I just play native Linux games." +> +> **Highclass**: "Hey I'm 28 not sure if this is the age group you are looking for. +> +> To be honest, I was always interested in computers and the thought of a free operating system was intriguing even though at the time I didn't fully grasp the free software philosophy, to me it was free as in no cost. I also did not find the CLI too intimidating as from an early age I had exposure to DOS. +> +> I believe my first distro was Mandrake, I was 11 or 12, I messed up the family computer on several occasions.... I ended up sticking with it always trying to push myself to the next level. Now I work in the industry with Linux everyday. +> +> /shrug" +> +> Matto: "My computer couldn't run fast enough for XP (got it at a garage sale), so I started looking for alternatives. Ubuntu came up in Google. I was maybe 15 or 16 at the time. Now I'm 23 and have a job working on a product that uses Linux internally." +> +> [More at Reddit][2] + +### IBM's Linux only Mainframe ### + +IBM has a long history with Linux, and now the company has created a Mainframe that features Ubuntu Linux. The new machine is named LinuxOne. + +Ron Miller reports for TechCrunch: + +> The new mainframes come in two flavors, named for penguins (Linux — penguins — get it?). The first is called Emperor and runs on the IBM z13, which we wrote about in January. The other is a smaller mainframe called the Rockhopper designed for a more “entry level” mainframe buyer. +> +> You may have thought that mainframes went the way of the dinosaur, but they are still alive and well and running in large institutions throughout the world. IBM as part of its broader strategy to promote the cloud, analytics and security is hoping to expand the potential market for mainframes by running Ubuntu Linux and supporting a range of popular open source enterprise software such as Apache Spark, Node.js, MongoDB, MariaDB, PostgreSQL and Chef. +> +> The metered mainframe will still sit inside the customer’s on-premises data center, but billing will be based on how much the customer uses the system, much like a cloud model, Mauri explained. +> +> ...IBM is looking for ways to increase those sales. Partnering with Canonical and encouraging use of open source tools on a mainframe gives the company a new way to attract customers to a small, but lucrative market. +> +> [More at TechCrunch][3] + +### Why you should skip Windows 10 and opt for Linux ### + +Since Windows 10 has been released there has been quite a bit of media coverage about its potential to spy on users. ZDNet has listed some reasons why you should skip Windows 10 and opt for Linux instead on your computer. + +SJVN reports for ZDNet: + +> You can try to turn Windows 10's data-sharing ways off, but, bad news: Windows 10 will keep sharing some of your data with Microsoft anyway. There is an alternative: Desktop Linux. +> +> You can do a lot to keep Windows 10 from blabbing, but you can't always stop it from talking. Cortana, Windows 10's voice activated assistant, for example, will share some data with Microsoft, even when it's disabled. That data includes a persistent computer ID to identify your PC to Microsoft. +> +> So, if that gives you a privacy panic attack, you can either stick with your old operating system, which is likely Windows 7, or move to Linux. Eventually, when Windows 7 is no longer supported, if you want privacy you'll have no other viable choice but Linux. +> +> There are other, more obscure desktop operating systems that are also desktop-based and private. These include the BSD Unix family such as FreeBSD, PCBSD, and NetBSD and eComStation, OS/2 for the 21st century. Your best choice, though, is a desktop-based Linux with a low learning curve. +> +> [More at ZDNet][4] + +-------------------------------------------------------------------------------- + +via: http://www.itworld.com/article/2972587/linux/why-did-you-start-using-linux.html + +作者:[Jim Lynch][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/Jim-Lynch/ +[1]:https://www.reddit.com/r/linux/comments/3hb2sr/question_for_younger_users_why_did_you_start/ +[2]:https://www.reddit.com/r/linux/comments/3hb2sr/question_for_younger_users_why_did_you_start/ +[3]:http://techcrunch.com/2015/08/16/ibm-teams-with-canonical-on-linux-mainframe/ +[4]:http://www.zdnet.com/article/sick-of-windows-spying-on-you-go-linux/ \ No newline at end of file From cabdaf5b35fda0ad86949befaa9075e2ebe4a483 Mon Sep 17 00:00:00 2001 From: Jindong Huang Date: Fri, 21 Aug 2015 09:00:19 +0800 Subject: [PATCH 386/507] =?UTF-8?q?=E6=92=A4=E9=94=80=E7=BF=BB=E8=AF=91=20?= =?UTF-8?q?20150813=20Linux=20file=20system=20hierarchy=20v2.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 | 3 --- 1 file changed, 3 deletions(-) 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 0021bb57c9..ec4f47234c 100644 --- a/sources/tech/20150813 Linux file system hierarchy v2.0.md +++ b/sources/tech/20150813 Linux file system hierarchy v2.0.md @@ -1,6 +1,3 @@ - -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. From 81e6ae11687c0af2cb40e455bb805aac0b7470a2 Mon Sep 17 00:00:00 2001 From: "Y.C.S.M" Date: Fri, 21 Aug 2015 09:13:10 +0800 Subject: [PATCH 387/507] Update 20150813 Linux file system hierarchy v2.0.md --- sources/tech/20150813 Linux file system hierarchy v2.0.md | 2 ++ 1 file changed, 2 insertions(+) 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 ec4f47234c..23f70258b1 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,5 @@ +translating by tnuoccalanosrep + 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. From e48fefb9952ead67f4bc5592cce6d79f8e33659a Mon Sep 17 00:00:00 2001 From: Ezio Date: Fri, 21 Aug 2015 09:35:40 +0800 Subject: [PATCH 388/507] Update 20150728 Process of the Linux kernel building.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 翻译到line 699 --- ...0728 Process of the Linux kernel building.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) 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 c622e43ba0..00504e60fd 100644 --- a/sources/tech/20150728 Process of the Linux kernel building.md +++ b/sources/tech/20150728 Process of the Linux kernel building.md @@ -605,12 +605,16 @@ 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: +`bzImage` 就是压缩了的linux 内核镜像。我们可以在构建了`vmlinux` 之后通过执行`make bzImage` 获得`bzImage`。同时我们可以仅仅执行`make` 而不带任何参数也可以生成`bzImage` ,因为它是在[arch/x86/kernel/Makefile](https://github.com/torvalds/linux/blob/master/arch/x86/Makefile) 里定义的、默认会生成的镜像: + ```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: +让我们看看这个目标,他能帮助我们理解这个镜像是怎么构建的。我已经说过了`bzImage` 师被定义在[arch/x86/kernel/Makefile](https://github.com/torvalds/linux/blob/master/arch/x86/Makefile),定义如下: + ```Makefile bzImage: vmlinux $(Q)$(MAKE) $(build)=$(boot) $(KBUILD_IMAGE) @@ -620,12 +624,16 @@ bzImage: vmlinux We can see here, that first of all called `make` for the boot directory, in our case it is: +在这里我们可以看到第一次为boot 目录执行`make`,在我们的例子里是这样的: + ```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`: +现在的主要目标是编译目录`arch/x86/boot` 和`arch/x86/boot/compressed` 的代码,构建`setup.bin` 和`vmlinux.bin`,然后用这两个文件生成`bzImage`。第一个目标是定义在[arch/x86/boot/Makefile](https://github.com/torvalds/linux/blob/master/arch/x86/boot/Makefile) 的`$(obj)/setup.elf`: + ```Makefile $(obj)/setup.elf: $(src)/setup.ld $(SETUP_OBJS) FORCE $(call if_changed,ld) @@ -633,6 +641,8 @@ $(obj)/setup.elf: $(src)/setup.ld $(SETUP_OBJS) FORCE 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: +我们已经在目录`arch/x86/boot`有了链接脚本`setup.ld`,并且将变量`SETUP_OBJS` 扩展到`boot` 目录下的全部源代码。我们可以看看第一个输出: + ```Makefile AS arch/x86/boot/bioscall.o CC arch/x86/boot/cmdline.o @@ -648,11 +658,14 @@ We already have the `setup.ld` linker script in the `arch/x86/boot` directory an 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: +下一个源码文件是[arch/x86/boot/header.S](https://github.com/torvalds/linux/blob/master/arch/x86/boot/header.S),但是我们不能现在就编译他,因为这个目标依赖于下面两个头文件: + ```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: +第一个头文件`voffset.h` 是使用`sed` 脚本生成的,包含用`nm` 工具从`vmlinux` 获取的两个地址: ```C #define VO__end 0xffffffff82ab0000 @@ -661,6 +674,8 @@ The first is `voffset.h` generated by the `sed` script that gets two addresses f 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): +这两个地址是内核的起始和结束地址。第二个头文件`zoffset.h` 在[arch/x86/boot/compressed/Makefile](https://github.com/torvalds/linux/blob/master/arch/x86/boot/compressed/Makefile) 可以看出是依赖于目标`vmlinux`的: + ```Makefile $(obj)/zoffset.h: $(obj)/compressed/vmlinux FORCE $(call if_changed,zoffset) @@ -668,6 +683,8 @@ $(obj)/zoffset.h: $(obj)/compressed/vmlinux FORCE 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: +目标`$(obj)/compressed/vmlinux` 依赖于变量`vmlinux-objs-y` —— 表明要编译目录[arch/x86/boot/compressed](https://github.com/torvalds/linux/tree/master/arch/x86/boot/compressed) 下的源代码,然后生成`vmlinux.bin`, `vmlinux.bin.bz2`, 和编译工具 - `mkpiggy`。我们可以在下面的输出看出来: + ```Makefile LDS arch/x86/boot/compressed/vmlinux.lds AS arch/x86/boot/compressed/head_64.o From a6b8923adb1e6c085115162b17b824a93532c8f1 Mon Sep 17 00:00:00 2001 From: bazz2 Date: Fri, 21 Aug 2015 12:54:09 +0800 Subject: [PATCH 389/507] [translated]Howto Manage Host Using Docker Machine in a VirtualBox --- ...st Using Docker Machine in a VirtualBox.md | 63 +++++++++---------- 1 file changed, 30 insertions(+), 33 deletions(-) diff --git a/translated/tech/20150527 Howto Manage Host Using Docker Machine in a VirtualBox.md b/translated/tech/20150527 Howto Manage Host Using Docker Machine in a VirtualBox.md index 64c044b100..153035c9f4 100644 --- a/translated/tech/20150527 Howto Manage Host Using Docker Machine in a VirtualBox.md +++ b/translated/tech/20150527 Howto Manage Host Using Docker Machine in a VirtualBox.md @@ -1,63 +1,60 @@ -[bazz2] 在 VirtualBox 中使用 Docker Machine 管理主机 ================================================================================ 大家好,今天我们学习在 VirtualBox 中使用 Docker Machine 来创建和管理 Docker 主机。Docker Machine 是一个应用,用于在我们的电脑上、在云端、在数据中心创建 Docker 主机,然后用户可以使用 Docker 客户端来配置一些东西。这个 API 为本地主机、或数据中心的虚拟机、或云端的实例提供 Docker 服务。Docker Machine 支持 Windows、OSX 和 Linux,并且是以一个独立的二进制文件包形式安装的。使用(与现有 Docker 工具)相同的接口,我们就可以充分利用已经提供 Docker 基础框架的生态系统。只要一个命令,用户就能快速部署 Docker 容器。 -Here are some easy and simple steps that helps us to deploy docker containers using Docker Machine. +本文列出一些简单的步骤用 Docker Machine 来部署 docker 容器。 -### 1. Installing Docker Machine ### +### 1. 安装 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 . +Docker Machine 完美支持所有 Linux 操作系统。首先我们需要从 [github][1] 下载最新版本的 Docker Machine,本文使用 curl 作为下载工具,Docker Machine 版本为 0.2.0。 -**For 64 Bit Operating System** +** 64 位操作系统 ** # 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** +** 32 位操作系统 ** # 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. +下载完成后,找到 **/usr/local/bin** 目录下的 **docker-machine** 文件,执行一下: # 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,可以运行下面的命令,它会打印 Docker Machine 的版本信息: # docker-machine -v -![Installing Docker Machine](http://blog.linoxide.com/wp-content/uploads/2015/05/installing-docker-machine.png) +![安装 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. +运行下面的命令,安装 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. Creating VirualBox VM ### +### 2. 创建 VirtualBox 虚拟机 ### -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. +在 Linux 系统上安装完 Docker Machine 后,接下来我们可以安装 VirtualBox 虚拟机,运行下面的就可以了。--driver virtualbox 选项表示我们要在 VirtualBox 的虚拟机里面部署 docker,最后的参数“linux” 是虚拟机的名称。这个命令会下载 [boot2docker][2] iso,它是个基于 Tiny Core Linux 的轻量级发行版,自带 Docker 程序,然后 docker-machine 命令会创建一个 VirtualBox 虚拟机(LCTT:当然,我们也可以选择其他的虚拟机软件)来运行这个 boot2docker 系统。 # docker-machine create --driver virtualbox linux -![Creating Docker Machine](http://blog.linoxide.com/wp-content/uploads/2015/05/creating-docker-machine.png) +![创建 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. +测试下有没有成功运行 VirtualBox 和 Docker,运行命令: # 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. +如果执行成功,我们可以看到在 ACTIVE 那列下面会出现一个星号“*”。 -### 3. Setting Environment Variables ### +### 3. 设置环境变量 ### -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. +现在我们需要让 docker 与虚拟机通信,运行 docker-machine env <虚拟机名称> 来实现这个目的。 # 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. +这个命令会设置 TLS 认证的环境变量,每次重启机器或者重新打开一个会话都需要执行一下这个命令,我们可以看到它的输出内容: # docker-machine env linux @@ -65,46 +62,46 @@ This will set environment variables that the Docker client will read which speci export DOCKER_CERT_PATH=/Users//.docker/machine/machines/dev export DOCKER_HOST=tcp://192.168.99.100:2376 -### 4. Running Docker Containers ### +### 4. 运行 Docker 容器 ### -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. +完成配置后我们就可以在 VirtualBox 上运行 docker 容器了。测试一下,在虚拟机里执行 **docker run busybox echo hello world** 命令,我们可以看到容器的输出信息。 # docker run busybox echo hello world -![Running Docker Container](http://blog.linoxide.com/wp-content/uploads/2015/05/running-docker-container.png) +![运行 Docker 容器](http://blog.linoxide.com/wp-content/uploads/2015/05/running-docker-container.png) -### 5. Getting Docker Host's IP ### +### 5. 拿到 Docker 主机的 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 主机的 IP 地址。 # docker-machine ip -![Docker IP Address](http://blog.linoxide.com/wp-content/uploads/2015/05/docker-ip-address.png) +![Docker IP 地址](http://blog.linoxide.com/wp-content/uploads/2015/05/docker-ip-address.png) -### 6. Managing the Hosts ### +### 6. 管理主机 ### -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 +现在我们可以随心所欲地使用上述的 docker-machine 命令来不断创建主机了。 -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 时,可以运行 **docker-machine stop** 来停止所有主机,如果想开启所有主机,运行 **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 :-) +最后,我们使用 Docker Machine 成功在 VirtualBox 上创建并管理一台 Docker 主机。Docker Machine 确实能让用户快速地在不同的平台上部署 Docker 主机,就像我们这里部署在 VirtualBox 上一样。这个 --driver virtulbox 驱动可以在本地机器上使用,也可以在数据中心的虚拟机上使用。Docker Machine 驱动除了支持本地的 VirtualBox 之外,还支持远端的 Digital Ocean、AWS、Azure、VMware 以及其他基础设施。如果你有任何疑问,或者建议,请在评论栏中写出来,我们会不断改进我们的内容。谢谢,祝愉快。 -------------------------------------------------------------------------------- via: http://linoxide.com/linux-how-to/host-virtualbox-docker-machine/ 作者:[Arun Pyasi][a] -译者:[译者ID](https://github.com/译者ID) +译者:[bazz2](https://github.com/bazz2) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 35731ea8f2793176705cd62264b3447fc1acb3f7 Mon Sep 17 00:00:00 2001 From: wxy Date: Fri, 21 Aug 2015 14:53:23 +0800 Subject: [PATCH 390/507] =?UTF-8?q?PR=20=E8=A1=A5=E5=AE=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @bazz2 --- ...st Using Docker Machine in a VirtualBox.md | 114 ------------------ 1 file changed, 114 deletions(-) delete mode 100644 sources/tech/20150527 Howto Manage Host Using Docker Machine in a VirtualBox.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 deleted file mode 100644 index 77292a03ee..0000000000 --- a/sources/tech/20150527 Howto Manage Host Using Docker Machine in a VirtualBox.md +++ /dev/null @@ -1,114 +0,0 @@ -[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. - -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 From 530b8c6af21937d0930548f4124963c025a08d5d Mon Sep 17 00:00:00 2001 From: DeadFire Date: Fri, 21 Aug 2015 15:47:47 +0800 Subject: [PATCH 391/507] =?UTF-8?q?20150821-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... to Install Visual Studio Code in Linux.md | 127 ++++++++++++++++++ 1 file changed, 127 insertions(+) create mode 100644 sources/tech/20150821 How to Install Visual Studio Code in Linux.md diff --git a/sources/tech/20150821 How to Install Visual Studio Code in Linux.md b/sources/tech/20150821 How to Install Visual Studio Code in Linux.md new file mode 100644 index 0000000000..2fac79701e --- /dev/null +++ b/sources/tech/20150821 How to Install Visual Studio Code in Linux.md @@ -0,0 +1,127 @@ +How to Install Visual Studio Code in Linux +================================================================================ +Hi everyone, today we'll learn how to install Visual Studio Code in Linux Distributions. Visual Studio Code is a code-optimized editor based on Electron, a piece of software that is based on Chromium, which is used to deploy io.js applications for the desktop. It is a source code editor and text editor developed by Microsoft for all the operating system platforms including Linux. Visual Studio Code is free but not an open source software ie. its under proprietary software license terms. It is an awesome powerful and fast code editor for our day to day use. Some of the cool features of visual studio code are navigation, intellisense support, syntax highlighting, bracket matching, auto indentation, and snippets, keyboard support with customizable bindings and support for dozens of languages like Python, C++, jade, PHP, XML, Batch, F#, DockerFile, Coffee Script, Java, HandleBars, R, Objective-C, PowerShell, Luna, Visual Basic, .Net, Asp.Net, C#, JSON, Node.js, Javascript, HTML, CSS, Less, Sass and Markdown. Visual Studio Code integrates with package managers and repositories, and builds and other common tasks to make everyday workflows faster. The most popular feature in Visual Studio Code is its debugging feature which includes a streamlined support for Node.js debugging in the preview. + +Note: Please note that, Visual Studio Code is only available for 64-bit versions of Linux Distributions. + +Here, are some easy to follow steps on how to install Visual Sudio Code in all Linux Distribution. + +### 1. Downloading Visual Studio Code Package ### + +First of all, we'll gonna download the Visual Studio Code Package for 64-bit Linux Operating System from the Microsoft server using the given url [http://go.microsoft.com/fwlink/?LinkID=534108][1] . Here, we'll use wget to download it and keep it under /tmp/VSCODE directory as shown below. + + # mkdir /tmp/vscode; cd /tmp/vscode/ + # wget https://az764295.vo.msecnd.net/public/0.3.0/VSCode-linux-x64.zip + + --2015-06-24 06:02:54-- https://az764295.vo.msecnd.net/public/0.3.0/VSCode-linux-x64.zip + Resolving az764295.vo.msecnd.net (az764295.vo.msecnd.net)... 93.184.215.200, 2606:2800:11f:179a:1972:2405:35b:459 + Connecting to az764295.vo.msecnd.net (az764295.vo.msecnd.net)|93.184.215.200|:443... connected. + HTTP request sent, awaiting response... 200 OK + Length: 64992671 (62M) [application/octet-stream] + Saving to: ‘VSCode-linux-x64.zip’ + 100%[================================================>] 64,992,671 14.9MB/s in 4.1s + 2015-06-24 06:02:58 (15.0 MB/s) - ‘VSCode-linux-x64.zip’ saved [64992671/64992671] + +### 2. Extracting the Package ### + +Now, after we have successfully downloaded the zipped package of Visual Studio Code, we'll gonna extract it using the unzip command to /opt/directory. To do so, we'll need to run the following command in a terminal or a console. + + # unzip /tmp/vscode/VSCode-linux-x64.zip -d /opt/ + +Note: If we don't have unzip already installed, we'll need to install it via our Package Manager. If you're running Ubuntu, apt-get whereas if you're running Fedora, CentOS, dnf or yum can be used to install it. + +### 3. Running Visual Studio Code ### + +After we have extracted the package, we can directly launch the Visual Studio Code by executing a file named Code. + + # sudo chmod +x /opt/VSCode-linux-x64/Code + # sudo /opt/VSCode-linux-x64/Code + +If we want to launch Code and want to be available globally via terminal in any place, we'll need to create the link of /opt/vscode/Code as/usr/local/bin/code . + + # ln -s /opt/VSCode-linux-x64/Code /usr/local/bin/code + +Now, we can launch Visual Studio Code by running the following command in a terminal. + + # code . + +### 4. Creating a Desktop Launcher ### + +Next, after we have successfully extracted the Visual Studio Code package, we'll gonna create a desktop launcher so that it will be easily available in the launchers, menus, desktop, according to the desktop environment so that anyone can launch it from them. So, first we'll gonna copy the icon file to /usr/share/icons/ directory. + + # cp /opt/VSCode-linux-x64/resources/app/vso.png /usr/share/icons/ + +Then, we'll gonna create the desktop launcher having the extension as .desktop. Here, we'll create a file named visualstudiocode.desktop under /tmp/VSCODE/ folder using our favorite text editor. + + # vi /tmp/vscode/visualstudiocode.desktop + +Then, we'll gonna paste the following lines into that file. + + [Desktop Entry] + Name=Visual Studio Code + Comment=Multi-platform code editor for Linux + Exec=/opt/VSCode-linux-x64/Code + Icon=/usr/share/icons/vso.png + Type=Application + StartupNotify=true + Categories=TextEditor;Development;Utility; + MimeType=text/plain; + +After we're done creating the desktop file, we'll wanna copy that desktop file to /usr/share/applications/ directory so that it will be available in launchers and menus for use with single click. + + # cp /tmp/vscode/visualstudiocode.desktop /usr/share/applications/ + +Once its done, we can launch it by opening it from the Launcher or Menu. + +![Visual Studio Code](http://blog.linoxide.com/wp-content/uploads/2015/06/visual-studio-code.png) + +### Installing Visual Studio Code in Ubuntu ### + +We can use Ubuntu Make 0.7 in order to install Visual Studio Code in Ubuntu 14.04/14.10/15.04 distribution of linux. This method is the most easiest way to setup Code in ubuntu as we just need to execute few commands for it. First of all, we'll need to install Ubuntu Make 0.7 in our ubuntu distribution of linux. To install it, we'll need to add PPA for it. This can be done by running the command below. + + # add-apt-repository ppa:ubuntu-desktop/ubuntu-make + + This ppa proposes package backport of Ubuntu make for supported releases. + More info: https://launchpad.net/~ubuntu-desktop/+archive/ubuntu/ubuntu-make + Press [ENTER] to continue or ctrl-c to cancel adding it + gpg: keyring `/tmp/tmpv0vf24us/secring.gpg' created + gpg: keyring `/tmp/tmpv0vf24us/pubring.gpg' created + gpg: requesting key A1231595 from hkp server keyserver.ubuntu.com + gpg: /tmp/tmpv0vf24us/trustdb.gpg: trustdb created + gpg: key A1231595: public key "Launchpad PPA for Ubuntu Desktop" imported + gpg: no ultimately trusted keys found + gpg: Total number processed: 1 + gpg: imported: 1 (RSA: 1) + OK + +Then, we'll gonna update the local repository index and install ubuntu-make. + + # apt-get update + # apt-get install ubuntu-make + +After Ubuntu Make is installed in our ubuntu operating system, we'll gonna install Code by running the following command in a terminal. + + # umake web visual-studio-code + +![Umake Web Code](http://blog.linoxide.com/wp-content/uploads/2015/06/umake-web-code.png) + +After running the above command, we'll be asked to enter the path where we want to install it. Then, it will ask for permission to install Visual Studio Code in our ubuntu system. Then, we'll press "a". Once we do that, it will download and install it in our ubuntu machine. Finally, we can launch it by opening it from the Launcher or Menu. + +### Conclusion ### + +We have successfully installed Visual Studio Code in Linux Distribution. Installing Visual Studio Code in every linux distribution is the same as shown in the above steps where we can also use umake to install it in ubuntu distributions. Umake is a popular tool for the development tools, IDEs, Languages. We can easily install Android Studios, Eclipse and many other popular IDEs with umake. Visual Studio Code is based on a project in Github called [Electron][2] which is a part of [Atom.io][3] Editor. It has a bunch of new cool and improved features that Atom.io Editor doesn't have. Visual Studio Code is currently only available in 64-bit platform of linux operating system. 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/install-visual-studio-code-linux/ + +作者:[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://go.microsoft.com/fwlink/?LinkID=534108 +[2]:https://github.com/atom/electron +[3]:https://github.com/atom/atom \ No newline at end of file From 8710f13ab6ee96fb7b425d6a53cfe58ce8309b86 Mon Sep 17 00:00:00 2001 From: DeadFire Date: Fri, 21 Aug 2015 16:30:54 +0800 Subject: [PATCH 392/507] =?UTF-8?q?20150821-2=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... open source command-line email clients.md | 79 +++++++++++++++++++ ...Kernel To Add The MOST Driver Subsystem.md | 28 +++++++ 2 files changed, 107 insertions(+) create mode 100644 sources/share/20150821 Top 4 open source command-line email clients.md create mode 100644 sources/talk/20150821 Linux 4.3 Kernel To Add The MOST Driver Subsystem.md diff --git a/sources/share/20150821 Top 4 open source command-line email clients.md b/sources/share/20150821 Top 4 open source command-line email clients.md new file mode 100644 index 0000000000..df96173c18 --- /dev/null +++ b/sources/share/20150821 Top 4 open source command-line email clients.md @@ -0,0 +1,79 @@ +Top 4 open source command-line email clients +================================================================================ +![](http://opensource.com/sites/default/files/styles/image-full-size/public/images/life/life_mail.png) + +Like it or not, email isn't dead yet. And for Linux power users who live and die by the command line, leaving the shell to use a traditional desktop or web based email client just doesn't cut it. After all, if there's one thing that the command line excels at, it's letting you process files, and especially text, with uninterrupted efficiency. + +Fortunately, there are a number of great command-line email clients, many with a devoted following of users who can help you get started and answer any questions you might have along the way. But fair warning: once you've mastered one of these clients, you may find it hard to go back to your old GUI-based solution! + +To install any of these four clients is pretty easy; most are available in standard repositories for major Linux distributions, and can be installed with a normal package manager. You may also have luck finding and running them on other operating systems as well, although I haven't tried it and can't speak to the experience. + +### Mutt ### + +- [Project page][1] +- [Source code][2] +- License: [GPLv2][3] + +Many terminal enthusiasts may already have heard of or even be familiar with Mutt and Alpine, which have both been on the scene for many years. Let's first take a look at Mutt. + +Mutt supports many of the features you've come to expect from any email system: message threading, color coding, availability in a number of languages, and lots of configuration options. It supports POP3 and IMAP, the two most common email transfer protocols, and multiple mailbox formats. Having first been released in 1995, Mutt still has an active development community, but in recent years, new releases have focused on bug fixes and security updates rather than new features. That's okay for many Mutt users, though, who are comfortable with the interface and adhere to the project's slogan: "All mail clients suck. This one just sucks less." + +### Alpine ### + +- [Project page][4] +- [Source code][5] +- License: [Apache 2.0][6] + +Alpine is the other well-known client for terminal email, developed at the University of Washington and designed to be an open source, Unicode-friendly alternative to Pine, also originally from UW. + +Designed to be friendly to beginners, but also chocked full of features for advanced users, Alpine also supports a multitude of protocols—IMAP, LDAP, NNTP, POP, SMTP, etc.—as well as different mailbox formats. Alpine is packaged with Pico, a simple text editing utility that many use as a standalone tool, but it also should work with your text editor of choice: vi, Emacs, etc. + +While Alpine is still infrequently updated, there is also a fork, re-alpine, which was created to allow a different set of maintainers to continue the project's development. + +Alpine features contextual help on the screen, which some users may prefer to breaking out the manual with Mutt, but both are well documented. Between Mutt and Alpine, users may want to try both and let personal preference guide their decision, or they may wish to check out a couple of the newer options below. + +### Sup ### + +- [Project page][7] +- [Source code][8] +- License: [GPLv2][9] + +Sup is the first of two of what can be called "high volume email clients" on our list. Described as a "console-based email client for people with a lot of email," Sup's goal is to provide an interface to email with a hierarchical design and to allow tagging of threads for easier organization. + +Written in Ruby, Sup provides exceptionally fast searching, manages your contact list automatically, and allows for custom extensions. For people who are used to Gmail as a webmail interface, these features will seem familiar, and Sup might be seen as a more modern approach to email on the command line. + +### Notmuch ### + +- [Project page][10] +- [Source code][11] +- License: [GPLv3][12] + +"Sup? Notmuch." Notmuch was written as a response to Sup, originally starting out as a speed-focused rewrite of some portions of Sup to enhance performance. Eventually, the project grew in scope and is now a stand-alone email client. + +Notmuch is also a fairly trim program. It doesn't actually send or receive email messages on its own, and the code which enables Notmuch's super-fast searching is actually designed as a separate library which the program can call. But its modular nature enables you to pick your favorite tools for composing, sending, and receiving, and instead focuses on doing one task and doing it well—efficient browsing and management of your email. + +This list isn’t by any means comprehensive; there are a lot more email clients out there which might be an even better fit for you. What’s your favorite? Did we leave one out that you want to share about? Let us know in the comments below! + +-------------------------------------------------------------------------------- + +via: http://opensource.com/life/15/8/top-4-open-source-command-line-email-clients + +作者:[Jason Baker][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/jason-baker +[1]:http://www.mutt.org/ +[2]:http://dev.mutt.org/trac/ +[3]:https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html +[4]:http://www.washington.edu/alpine/ +[5]:http://www.washington.edu/alpine/acquire/ +[6]:http://www.apache.org/licenses/LICENSE-2.0 +[7]:http://supmua.org/ +[8]:https://github.com/sup-heliotrope/sup +[9]:https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html +[10]:http://notmuchmail.org/ +[11]:http://notmuchmail.org/releases/ +[12]:http://www.gnu.org/licenses/gpl.html \ No newline at end of file diff --git a/sources/talk/20150821 Linux 4.3 Kernel To Add The MOST Driver Subsystem.md b/sources/talk/20150821 Linux 4.3 Kernel To Add The MOST Driver Subsystem.md new file mode 100644 index 0000000000..5b4ad2251f --- /dev/null +++ b/sources/talk/20150821 Linux 4.3 Kernel To Add The MOST Driver Subsystem.md @@ -0,0 +1,28 @@ +Linux 4.3 Kernel To Add The MOST Driver Subsystem +================================================================================ + While the [Linux 4.2][1] kernel hasn't been officially released yet, Greg Kroah-Hartman sent in early his pull requests for the various subsystems he maintains for the Linux 4.3 merge window. + +The pull requests sent in by Greg KH on Thursday include the Linux 4.3 merge window updates for the driver core, TTY/serial, USB driver, char/misc, and the staging area. These pull requests don't offer any really shocking changes but mostly routine work on improvements / additions / bug-fixes. The staging area once again is heavy with various fixes and clean-ups but there's also a new driver subsystem. + +Greg mentioned of the [4.3 staging changes][2], "Lots of things all over the place, almost all of them trivial fixups and changes. The usual IIO updates and new drivers and we have added the MOST driver subsystem which is getting cleaned up in the tree. The ozwpan driver is finally being deleted as it is obviously abandoned and no one cares about it." + +The MOST driver subsystem is short for the Media Oriented Systems Transport. The documentation to be added in the Linux 4.3 kernel explains, "The Media Oriented Systems Transport (MOST) driver gives Linux applications access a MOST network: The Automotive Information Backbone and the de-facto standard for high-bandwidth automotive multimedia networking. MOST defines the protocol, hardware and software layers necessary to allow for the efficient and low-cost transport of control, real-time and packet data using a single medium (physical layer). Media currently in use are fiber optics, unshielded twisted pair cables (UTP) and coax cables. MOST also supports various speed grades up to 150 Mbps." As explained, MOST is mostly about Linux in automotive applications. + +While Greg KH sent in his various subsystem updates for Linux 4.3, he didn't yet propose the [KDBUS][5] kernel code be pulled. He's previously expressed plans for [KDBUS in Linux 4.3][3] so we'll wait until the 4.3 merge window officially gets going to see what happens. Stay tuned to Phoronix for more Linux 4.3 kernel coverage next week when the merge window will begin, [assuming Linus releases 4.2][4] this weekend. + +-------------------------------------------------------------------------------- + +via: http://www.phoronix.com/scan.php?page=news_item&px=Linux-4.3-Staging-Pull + +作者:[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/scan.php?page=search&q=Linux+4.2 +[2]:http://lkml.iu.edu/hypermail/linux/kernel/1508.2/02604.html +[3]:http://www.phoronix.com/scan.php?page=news_item&px=KDBUS-Not-In-Linux-4.2 +[4]:http://www.phoronix.com/scan.php?page=news_item&px=Linux-4.2-rc7-Released +[5]:http://www.phoronix.com/scan.php?page=search&q=KDBUS \ No newline at end of file From 778c920c34eda71845723237a4bf4bfa714aa636 Mon Sep 17 00:00:00 2001 From: DeadFire Date: Fri, 21 Aug 2015 16:37:50 +0800 Subject: [PATCH 393/507] =?UTF-8?q?20150821-3=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...rs--How to check MariaDB server version.md | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 sources/tech/20150821 Linux FAQs with Answers--How to check MariaDB server version.md diff --git a/sources/tech/20150821 Linux FAQs with Answers--How to check MariaDB server version.md b/sources/tech/20150821 Linux FAQs with Answers--How to check MariaDB server version.md new file mode 100644 index 0000000000..11bf478f09 --- /dev/null +++ b/sources/tech/20150821 Linux FAQs with Answers--How to check MariaDB server version.md @@ -0,0 +1,49 @@ +Linux FAQs with Answers--How to check MariaDB server version +================================================================================ +> **Question**: I am on a VPS server where MariaDB server is running. How can I find out which version of MariaDB server it is running? + +There are circumstances where you need to know the version of your database server, e.g., when upgrading the database or patching any known server vulnerabilities. There are a few ways to find out what the version of your MariaDB server is. + +### Method One ### + +The first method to identify MariaDB server version is by logging in to the MariaDB server. Right after you log in, your will see a welcome message where MariaDB server version is indicated. + +![](https://farm6.staticflickr.com/5807/20669891016_91249d3239_c.jpg) + +Alternatively, simply type 'status' command at the MariaDB prompt any time while you are logged in. The output will show server version as well as protocol version as follows. + +![](https://farm6.staticflickr.com/5801/20669891046_73f60e5c81_c.jpg) + +### Method Two ### + +If you don't have access to the MariaDB server, you cannot use the first method. In this case, you can infer MariaDB server version by checking which MariaDB package was installed. This works only when the MariaDB server was installed using a distribution's package manager. + +You can search for the installed MariaDB server package as follows. + +#### Debian, Ubuntu or Linux Mint: #### + + $ dpkg -l | grep mariadb + +The output below indicates that installed MariaDB server is version 10.0.17. + +![](https://farm1.staticflickr.com/607/20669890966_b611fcd915_c.jpg) + +#### Fedora, CentOS or RHEL: #### + + $ rpm -qa | grep mariadb + +The output below indicates that the installed version is 5.5.41. + +![](https://farm1.staticflickr.com/764/20508160748_23d9808256_b.jpg) + +-------------------------------------------------------------------------------- + +via: http://ask.xmodulo.com/check-mariadb-server-version.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 f038435d712622128d7d3cc811e2c4380a00cbb3 Mon Sep 17 00:00:00 2001 From: bazz2 Date: Sat, 22 Aug 2015 08:36:54 +0800 Subject: [PATCH 394/507] [translating by bazz2]Docker Working on Security Components Live Container Migration --- ... Working on Security Components Live Container Migration.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) rename {sources => translated}/talk/20150818 Docker Working on Security Components Live Container Migration.md (98%) diff --git a/sources/talk/20150818 Docker Working on Security Components Live Container Migration.md b/translated/talk/20150818 Docker Working on Security Components Live Container Migration.md similarity index 98% rename from sources/talk/20150818 Docker Working on Security Components Live Container Migration.md rename to translated/talk/20150818 Docker Working on Security Components Live Container Migration.md index ad974b4859..356c6f943c 100644 --- a/sources/talk/20150818 Docker Working on Security Components Live Container Migration.md +++ b/translated/talk/20150818 Docker Working on Security Components Live Container Migration.md @@ -1,3 +1,4 @@ +[bazz2 translating] Docker Working on Security Components, Live Container Migration ================================================================================ ![Docker Container Talk](http://www.eweek.com/imagesvr_ce/1905/290x195DockerMarianna.jpg) @@ -50,4 +51,4 @@ via: http://www.eweek.com/virtualization/docker-working-on-security-components-l 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 -[a]:http://www.eweek.com/cp/bio/Sean-Michael-Kerner/ \ No newline at end of file +[a]:http://www.eweek.com/cp/bio/Sean-Michael-Kerner/ From 3417a617f81e13d2b5930cf6efc1ccaef0dc8a06 Mon Sep 17 00:00:00 2001 From: bazz2 Date: Sat, 22 Aug 2015 08:50:21 +0800 Subject: [PATCH 395/507] [place it into error place] --- ...ker Working on Security Components Live Container Migration.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated => sources}/talk/20150818 Docker Working on Security Components Live Container Migration.md (100%) diff --git a/translated/talk/20150818 Docker Working on Security Components Live Container Migration.md b/sources/talk/20150818 Docker Working on Security Components Live Container Migration.md similarity index 100% rename from translated/talk/20150818 Docker Working on Security Components Live Container Migration.md rename to sources/talk/20150818 Docker Working on Security Components Live Container Migration.md From de5e769323a47f73f7cdba495524ffe9425c27f7 Mon Sep 17 00:00:00 2001 From: geekpi Date: Sat, 22 Aug 2015 09:09:52 +0800 Subject: [PATCH 396/507] translating --- ...18 Linux Without Limits--IBM Launch LinuxONE Mainframes.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/news/20150818 Linux Without Limits--IBM Launch LinuxONE Mainframes.md b/sources/news/20150818 Linux Without Limits--IBM Launch LinuxONE Mainframes.md index f97c690e3a..dc1f0e8986 100644 --- a/sources/news/20150818 Linux Without Limits--IBM Launch LinuxONE Mainframes.md +++ b/sources/news/20150818 Linux Without Limits--IBM Launch LinuxONE Mainframes.md @@ -1,3 +1,5 @@ +Translating----geekpi + Linux Without Limits: IBM Launch LinuxONE Mainframes ================================================================================ ![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/08/Screenshot-2015-08-17-at-12.58.10.png) @@ -49,4 +51,4 @@ via: http://www.omgubuntu.co.uk/2015/08/ibm-linuxone-mainframe-ubuntu-partnershi [a]:https://plus.google.com/117485690627814051450/?rel=author [1]:http://www-03.ibm.com/systems/z/announcement.html -[2]:http://www.reuters.com/article/2015/08/17/us-ibm-linuxone-idUSKCN0QM09P20150817 \ No newline at end of file +[2]:http://www.reuters.com/article/2015/08/17/us-ibm-linuxone-idUSKCN0QM09P20150817 From 5842e697b11a834c1b9b57757800a95ca9aafc0c Mon Sep 17 00:00:00 2001 From: Kevin Sicong Jiang Date: Fri, 21 Aug 2015 20:13:54 -0500 Subject: [PATCH 397/507] Update 20150813 How to get Public IP from Linux Terminal.md --- ...ow to get Public IP from Linux Terminal.md | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) 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 c22fec283d..98c0ec7b31 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,13 +1,13 @@ -KevinSJ Translating -How to get Public IP from Linux Terminal? +如何在 Linux 终端中获取公有 IP ================================================================================ ![](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. +公有地址由InterNIC分配并由基于类的网络 ID 或基于 CIDR 地址块构成(被称为 CIDR 块)并保证了在全球英特网中的唯一性。当公有地址被分配时,路径将会被记录到互联网中的路由器中,这样访问公有地址的流量就能顺利到达。访问目标公有地址的流量可通过互联网获取。比如,当一个一个 CIDR 块被以网络 ID 和子网掩码的形式分配给一个组织时,对应的 [网络 ID,子网掩码] 也会同时作为路径储存在英特网中的路由器中。访问 CIDR 块中的地址的 IP 封包会被导向对应的位置。在本文中我将会介绍在几种在 Linux 终端中查看你的公有 IP 地址的方法。这对普通用户来说并无意义,但 Linux 服务器(无GUI或者作为只能使用基本工具的用户登录时)会很有用。无论如何,从 Linux 终端中获取公有 IP 在各种方面都很意义,说不定某一天就能用得着。 -There’s two main commands we use, curl and wget. You can use them interchangeably. -### Curl output in plain text format: ### +以下是我们主要使用的两个命令,curl 和 wget。你可以换着用。 + +### Curl 纯文本格式输出: ### curl icanhazip.com curl ifconfig.me @@ -17,53 +17,53 @@ There’s two main commands we use, curl and wget. You can use them interchangea curl ipecho.net/plain curl www.trackip.net/i -### curl output in JSON format: ### +### curl JSON格式输出: ### curl ipinfo.io/json curl ifconfig.me/all.json curl www.trackip.net/ip?json (bit ugly) -### curl output in XML format: ### +### curl XML格式输出: ### curl ifconfig.me/all.xml -### curl all IP details – The motherload ### +### curl 所有IP细节 ### curl ifconfig.me/all -### Using DYNDNS (Useful when you’re using DYNDNS service) ### +### 使用 DYDNS (当你使用 DYDNS 服务时有用)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 代替 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) ### +### 使用 host 和 dig 命令 ### -You can also use host and dig command assuming they are available or installed +在可用时,你可以直接使用 host 和 dig 命令。 host -t a dartsclink.com | sed 's/.*has address //' dig +short myip.opendns.com @resolver1.opendns.com -### Sample bash script: ### +### bash 脚本示例: ### #!/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. +我实际上写了一个用于记录每日我的路由器中所有 IP 变化并保存到一个文件的脚本。我在搜索过程中找到了这些很好用的命令。希望某天它能帮到其他人。 -------------------------------------------------------------------------------- via: http://www.blackmoreops.com/2015/06/14/how-to-get-public-ip-from-linux-terminal/ -译者:[译者ID](https://github.com/译者ID) +译者:[KevinSJ](https://github.com/KevinSJ) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From e965dbb00062f017cf5c64e93103adc22e6d597c Mon Sep 17 00:00:00 2001 From: Kevin Sicong Jiang Date: Fri, 21 Aug 2015 20:15:39 -0500 Subject: [PATCH 398/507] Rename sources/tech/20150813 How to get Public IP from Linux Terminal.md to translated/tech/20150813 How to get Public IP from Linux Terminal.md --- .../tech/20150813 How to get Public IP from Linux Terminal.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/20150813 How to get Public IP from Linux Terminal.md (100%) diff --git a/sources/tech/20150813 How to get Public IP from Linux Terminal.md b/translated/tech/20150813 How to get Public IP from Linux Terminal.md similarity index 100% rename from sources/tech/20150813 How to get Public IP from Linux Terminal.md rename to translated/tech/20150813 How to get Public IP from Linux Terminal.md From a4d55d4f6da743e381beec1e26fd37e7871e24f2 Mon Sep 17 00:00:00 2001 From: ictlyh Date: Sat, 22 Aug 2015 14:53:23 +0800 Subject: [PATCH 399/507] [Translated] tech/RHCE/Part 4 - Using Shell Scripting to Automate Linux System Maintenance Tasks.md --- ...Automate Linux System Maintenance Tasks.md | 208 ------------------ ...Automate Linux System Maintenance Tasks.md | 205 +++++++++++++++++ 2 files changed, 205 insertions(+), 208 deletions(-) delete mode 100644 sources/tech/RHCE/Part 4 - Using Shell Scripting to Automate Linux System Maintenance Tasks.md create mode 100644 translated/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 deleted file mode 100644 index 6b534423e7..0000000000 --- a/sources/tech/RHCE/Part 4 - Using Shell Scripting to Automate Linux System Maintenance Tasks.md +++ /dev/null @@ -1,208 +0,0 @@ -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: - -![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 diff --git a/translated/tech/RHCE/Part 4 - Using Shell Scripting to Automate Linux System Maintenance Tasks.md b/translated/tech/RHCE/Part 4 - Using Shell Scripting to Automate Linux System Maintenance Tasks.md new file mode 100644 index 0000000000..37a3dbe11c --- /dev/null +++ b/translated/tech/RHCE/Part 4 - Using Shell Scripting to Automate Linux System Maintenance Tasks.md @@ -0,0 +1,205 @@ +第四部分 - 使用 Shell 脚本自动化 Linux 系统维护任务 +================================================================================ +之前我听说高效系统管理员/工程师的其中一个特点是懒惰。一开始看起来很矛盾,但作者接下来解释了其中的原因: + +![自动化 Linux 系统维护任务](http://www.tecmint.com/wp-content/uploads/2015/08/Automate-Linux-System-Maintenance-Tasks.png) + +RHCE 系列:第四部分 - 自动化 Linux 系统维护任务 + +如果一个系统管理员花费大量的时间解决问题以及做重复的工作,你就应该怀疑他这么做是否正确。换句话说,一个高效的系统管理员/工程师应该制定一个计划使得尽量花费少的时间去做重复的工作,以及通过使用该系列中第三部分 [使用 Linux 工具集监视系统活动报告][1] 介绍的工具预见问题。因此,尽管看起来他/她没有做很多的工作,但那是因为 shell 脚本帮助完成了他的/她的大部分任务,这也就是本章我们将要探讨的东西。 + +### 什么是 shell 脚本? ### + +简单的说,shell 脚本就是一个由 shell 一步一步执行的程序,而 shell 是在 Linux 内核和端用户之间提供接口的另一个程序。 + +默认情况下,RHEL 7 中用户使用的 shell 是 bash(/bin/bash)。如果你想知道详细的信息和历史背景,你可以查看 [维基页面][2]。 + +关于这个 shell 提供的众多功能的介绍,可以查看 **man 手册**,也可以从 ([Bash 命令][3])下载 PDF 格式。除此之外,假设你已经熟悉 Linux 命令(否则我强烈建议你首先看一下 **Tecmint.com** 中的文章 [从新手到系统管理员指南][4] )。现在让我们开始吧。 + +### 写一个脚本显示系统信息 ### + +为了方便,首先让我们新建一个目录用于保存我们的 shell 脚本: + + # mkdir scripts + # cd scripts + +然后用喜欢的文本编辑器打开新的文本文件 `system_info.sh`。我们首先在头部插入一些注释以及一些命令: + + #!/bin/bash + + # RHCE 系列第四部分事例脚本 + # 该脚本会返回以下这些系统信息: + # -主机名称: + echo -e "\e[31;43m***** HOSTNAME INFORMATION *****\e[0m" + hostnamectl + echo "" + # -文件系统磁盘空间使用: + echo -e "\e[31;43m***** FILE SYSTEM DISK SPACE USAGE *****\e[0m" + df -h + echo "" + # -系统空闲和使用中的内存: + echo -e "\e[31;43m ***** FREE AND USED MEMORY *****\e[0m" + free + echo "" + # -系统启动时间: + echo -e "\e[31;43m***** SYSTEM UPTIME AND LOAD *****\e[0m" + uptime + echo "" + # -登录的用户: + echo -e "\e[31;43m***** CURRENTLY LOGGED-IN USERS *****\e[0m" + who + echo "" + # -使用内存最多的 5 个进程 + 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" + +然后,给脚本可执行权限: + + # chmod +x system_info.sh + +运行脚本: + + ./system_info.sh + +注意为了更好的可视化效果各部分标题都用颜色显示: + +![服务器监视 Shell 脚本](http://www.tecmint.com/wp-content/uploads/2015/08/Server-Monitoring-Shell-Script.png) + +服务器监视 Shell 脚本 + +该功能用以下命令提供: + + echo -e "\e[COLOR1;COLOR2m\e[0m" + +其中 COLOR1 和 COLOR2 是前景色和背景色([Arch Linux Wiki][5] 有更多的信息和选项解释), 是你想用颜色显示的字符串。 + +### 使任务自动化 ### + +你想使其自动化的任务可能因情况而不同。因此,我们不可能在一篇文章中覆盖所有可能的场景,但是我们会介绍使用 shell 脚本可以使其自动化的三种典型任务: + +**1)** 更新本地文件数据库, 2) 查找(或者删除)有 777 权限的文件, 以及 3) 文件系统使用超过定义的阀值时发出警告。 + +让我们在脚本目录中新建一个名为 `auto_tasks.sh` 的文件并添加以下内容: + + #!/bin/bash + + # 自动化任务事例脚本: + # -更新本地文件数据库: + 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 "" + + # -查找 和/或 删除有 777 权限的文件。 + 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 "" + # -文件系统使用率超过定义的阀值时发出警告 + 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) + +请注意该脚本最后一行两个 `<` 符号之间有个空格。 + +![查找 777 权限文件的 Shell 脚本](http://www.tecmint.com/wp-content/uploads/2015/08/Shell-Script-to-Find-777-Permissions.png) + +查找 777 权限文件的 Shell 脚本 + +### 使用 Cron ### + +想更进一步提高效率,你不会想只是坐在你的电脑前手动执行这些脚本。相反,你会使用 cron 来调度这些任务周期性地执行,并把结果通过邮件发动给预定义的接收者或者将它们保存到使用 web 浏览器可以查看的文件中。 + +下面的脚本(filesystem_usage.sh)会运行有名的 **df -h** 命令,格式化输出到 HTML 表格并保存到 **report.html** 文件中: + + #!/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 + +在我们的 **RHEL 7** 服务器(**192.168.0.18**)中,看起来像下面这样: + +![服务器监视报告](http://www.tecmint.com/wp-content/uploads/2015/08/Server-Monitoring-Report.png) + +服务器监视报告 + +你可以添加任何你想要的信息到那个报告中。添加下面的 crontab 条目在每天下午的 1:30 运行该脚本: + + 30 13 * * * /root/scripts/filesystem_usage.sh + +### 总结 ### + +你很可能想起各种其他想要自动化的任务;正如你看到的,使用 shell 脚本能极大的简化任务。如果你觉得这篇文章对你有所帮助就告诉我们吧,别犹豫在下面的表格中添加你自己的想法或评论。 + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/using-shell-script-to-automate-linux-system-maintenance-tasks/ + +作者:[Gabriel Cánepa][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/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 94448c4d63edaa885d1e3506d39883fc3781196e Mon Sep 17 00:00:00 2001 From: geekpi Date: Sat, 22 Aug 2015 16:13:59 +0800 Subject: [PATCH 400/507] translated --- ... Limits--IBM Launch LinuxONE Mainframes.md | 54 ------------------- ... Limits--IBM Launch LinuxONE Mainframes.md | 52 ++++++++++++++++++ 2 files changed, 52 insertions(+), 54 deletions(-) delete mode 100644 sources/news/20150818 Linux Without Limits--IBM Launch LinuxONE Mainframes.md create mode 100644 translated/news/20150818 Linux Without Limits--IBM Launch LinuxONE Mainframes.md diff --git a/sources/news/20150818 Linux Without Limits--IBM Launch LinuxONE Mainframes.md b/sources/news/20150818 Linux Without Limits--IBM Launch LinuxONE Mainframes.md deleted file mode 100644 index dc1f0e8986..0000000000 --- a/sources/news/20150818 Linux Without Limits--IBM Launch LinuxONE Mainframes.md +++ /dev/null @@ -1,54 +0,0 @@ -Translating----geekpi - -Linux Without Limits: IBM Launch LinuxONE Mainframes -================================================================================ -![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/08/Screenshot-2015-08-17-at-12.58.10.png) - -LinuxONE Emperor MainframeGood news for Ubuntu’s server team today as [IBM launch the LinuxONE][1] a Linux-only mainframe that is also able to run Ubuntu. - -The largest of the LinuxONE systems launched by IBM is called ‘Emperor’ and can scale up to 8000 virtual machines or tens of thousands of containers – a possible record for any one single Linux system. - -The LinuxONE is described by IBM as a ‘game changer’ that ‘unleashes the potential of Linux for business’. - -IBM and Canonical are working together on the creation of an Ubuntu distribution for LinuxONE and other IBM z Systems. Ubuntu will join RedHat and SUSE as ‘premier Linux distributions’ on IBM z. - -Alongside the ‘Emperor’ IBM is also offering the LinuxONE Rockhopper, a smaller mainframe for medium-sized businesses and organisations. - -IBM is the market leader in mainframes and commands over 90% of the mainframe market. - -注:youtube 视频 - - -### What Is a Mainframe Computer Used For? ### - -The computer you’re reading this article on would be dwarfed by a ‘big iron’ mainframe. They are large, hulking great cabinets packed full of high-end components, custom designed technology and dizzying amounts of storage (that is data storage, not ample room for pens and rulers). - -Mainframes computers are used by large organizations and businesses to process and store large amounts of data, crunch through statistics, and handle large-scale transaction processing. - -### ‘World’s Fastest Processor’ ### - -IBM has teamed up with Canonical Ltd to use Ubuntu on the LinuxONE and other IBM z Systems. - -The LinuxONE Emperor uses the IBM z13 processor. The chip, announced back in January, is said to be the world’s fastest microprocessor. It is able to deliver transaction response times in the milliseconds. - -But as well as being well equipped to handle for high-volume mobile transactions, the z13 inside the LinuxONE is also an ideal cloud system. - -It can handle more than 50 virtual servers per core for a total of 8000 virtual servers, making it a cheaper, greener and more performant way to scale-out to the cloud. - -**You don’t have to be a CIO or mainframe spotter to appreciate this announcement. The possibilities LinuxONE provides are clear enough. ** - -Source: [Reuters (h/t @popey)][2] - --------------------------------------------------------------------------------- - -via: http://www.omgubuntu.co.uk/2015/08/ibm-linuxone-mainframe-ubuntu-partnership - -作者:[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-03.ibm.com/systems/z/announcement.html -[2]:http://www.reuters.com/article/2015/08/17/us-ibm-linuxone-idUSKCN0QM09P20150817 diff --git a/translated/news/20150818 Linux Without Limits--IBM Launch LinuxONE Mainframes.md b/translated/news/20150818 Linux Without Limits--IBM Launch LinuxONE Mainframes.md new file mode 100644 index 0000000000..8d9b3dbccb --- /dev/null +++ b/translated/news/20150818 Linux Without Limits--IBM Launch LinuxONE Mainframes.md @@ -0,0 +1,52 @@ +Linux无极限:IBM发布LinuxONE大型机 +================================================================================ +![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/08/Screenshot-2015-08-17-at-12.58.10.png) + +LinuxONE Emperor MainframeGood的Ubuntu服务器团队今天发布了一条消息关于[IBM发布了LinuxONE][1],一种只支持Linux的大型机,也可以运行Ubuntu。 + +IBM发布的最大的LinuxONE系统称作‘Emperor’,它可以扩展到8000台虚拟机或者上万台容器- 对任何一台Linux系统都可能的记录。 + +LinuxONE被IBM称作‘游戏改变者’,它‘释放了Linux的商业潜力’。 + +IBM和Canonical正在一起协作为LinuxONE和其他IBM z系统创建Ubuntu发行版。Ubuntu将会在IBM z加入RedHat和SUSE作为首屈一指的Linux发行版。 + +随着IBM ‘Emperor’发布的还有LinuxONE Rockhopper,一个为中等规模商业或者组织小一点的大型机。 + +IBM是大型机中的领导者,并且占有大型机市场中90%的份额。 + +注:youtube 视频 + + +### 大型机用于什么? ### + +你阅读这篇文章所使用的电脑在一个‘大铁块’一样的大型机前会显得很矮小。它们是巨大的,笨重的机柜里面充满了高端的组件、自己设计的技术和眼花缭乱的大量存储(就是数据存储,没有空间放钢笔和尺子)。 + +大型机被大型机构和商业用来处理和存储大量数据,通过统计来处理数据和处理大规模的事务处理。 + +### ‘世界最快的处理器’ ### + +IBM已经与Canonical Ltd组成了团队来在LinuxONE和其他IBM z系统中使用Ubuntu。 + +LinuxONE Emperor使用IBM z13处理器。发布于一月的芯片声称是时间上最快的微处理器。它可以在几毫秒内响应事务。 + +但是也可以很好地处理高容量的移动事务,z13中的LinuxONE系统也是一个理想的云系统。 + +每个核心可以处理超过50个虚拟服务器,总共可以超过8000台虚拟服务器么,这使它以更便宜,更环保、更高效的方式扩展到云。 + +**在阅读这篇文章时你不必是一个CIO或者大型机巡查员。LinuxONE提供的可能性足够清晰。** + +来源: [Reuters (h/t @popey)][2] + +-------------------------------------------------------------------------------- + +via: http://www.omgubuntu.co.uk/2015/08/ibm-linuxone-mainframe-ubuntu-partnership + +作者:[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-03.ibm.com/systems/z/announcement.html +[2]:http://www.reuters.com/article/2015/08/17/us-ibm-linuxone-idUSKCN0QM09P20150817 From 5877780a5dfb3e99fd82039e47b0d20b7053e934 Mon Sep 17 00:00:00 2001 From: geekpi Date: Sat, 22 Aug 2015 16:15:50 +0800 Subject: [PATCH 401/507] translating --- ... FAQs with Answers--How to check MariaDB server version.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150821 Linux FAQs with Answers--How to check MariaDB server version.md b/sources/tech/20150821 Linux FAQs with Answers--How to check MariaDB server version.md index 11bf478f09..f358d20756 100644 --- a/sources/tech/20150821 Linux FAQs with Answers--How to check MariaDB server version.md +++ b/sources/tech/20150821 Linux FAQs with Answers--How to check MariaDB server version.md @@ -1,3 +1,5 @@ +translating---geekpi + Linux FAQs with Answers--How to check MariaDB server version ================================================================================ > **Question**: I am on a VPS server where MariaDB server is running. How can I find out which version of MariaDB server it is running? @@ -46,4 +48,4 @@ via: http://ask.xmodulo.com/check-mariadb-server-version.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 c18956ce3476f54064bf39b0ea58d5b4c2ad476e Mon Sep 17 00:00:00 2001 From: geekpi Date: Sat, 22 Aug 2015 16:30:41 +0800 Subject: [PATCH 402/507] translated --- ...rs--How to check MariaDB server version.md | 51 ------------------- ...rs--How to check MariaDB server version.md | 49 ++++++++++++++++++ 2 files changed, 49 insertions(+), 51 deletions(-) delete mode 100644 sources/tech/20150821 Linux FAQs with Answers--How to check MariaDB server version.md create mode 100644 translated/tech/20150821 Linux FAQs with Answers--How to check MariaDB server version.md diff --git a/sources/tech/20150821 Linux FAQs with Answers--How to check MariaDB server version.md b/sources/tech/20150821 Linux FAQs with Answers--How to check MariaDB server version.md deleted file mode 100644 index f358d20756..0000000000 --- a/sources/tech/20150821 Linux FAQs with Answers--How to check MariaDB server version.md +++ /dev/null @@ -1,51 +0,0 @@ -translating---geekpi - -Linux FAQs with Answers--How to check MariaDB server version -================================================================================ -> **Question**: I am on a VPS server where MariaDB server is running. How can I find out which version of MariaDB server it is running? - -There are circumstances where you need to know the version of your database server, e.g., when upgrading the database or patching any known server vulnerabilities. There are a few ways to find out what the version of your MariaDB server is. - -### Method One ### - -The first method to identify MariaDB server version is by logging in to the MariaDB server. Right after you log in, your will see a welcome message where MariaDB server version is indicated. - -![](https://farm6.staticflickr.com/5807/20669891016_91249d3239_c.jpg) - -Alternatively, simply type 'status' command at the MariaDB prompt any time while you are logged in. The output will show server version as well as protocol version as follows. - -![](https://farm6.staticflickr.com/5801/20669891046_73f60e5c81_c.jpg) - -### Method Two ### - -If you don't have access to the MariaDB server, you cannot use the first method. In this case, you can infer MariaDB server version by checking which MariaDB package was installed. This works only when the MariaDB server was installed using a distribution's package manager. - -You can search for the installed MariaDB server package as follows. - -#### Debian, Ubuntu or Linux Mint: #### - - $ dpkg -l | grep mariadb - -The output below indicates that installed MariaDB server is version 10.0.17. - -![](https://farm1.staticflickr.com/607/20669890966_b611fcd915_c.jpg) - -#### Fedora, CentOS or RHEL: #### - - $ rpm -qa | grep mariadb - -The output below indicates that the installed version is 5.5.41. - -![](https://farm1.staticflickr.com/764/20508160748_23d9808256_b.jpg) - --------------------------------------------------------------------------------- - -via: http://ask.xmodulo.com/check-mariadb-server-version.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/20150821 Linux FAQs with Answers--How to check MariaDB server version.md b/translated/tech/20150821 Linux FAQs with Answers--How to check MariaDB server version.md new file mode 100644 index 0000000000..36ea2d15d6 --- /dev/null +++ b/translated/tech/20150821 Linux FAQs with Answers--How to check MariaDB server version.md @@ -0,0 +1,49 @@ +Linux有问必答--如何检查MatiaDB服务端版本 +================================================================================ +> **提问**: 我使用的是一台运行MariaDB的VPS。我该如何检查MariaDB服务端的版本? + +你需要知道数据库版本的情况有:当你生你数据库或者为服务器打补丁。这里有几种方法找出MariaDB版本的方法。 + +### 方法一 ### + +第一种找出版本的方法是登录MariaDB服务器,登录之后,你会看到一些MariaDB的版本信息。 + +![](https://farm6.staticflickr.com/5807/20669891016_91249d3239_c.jpg) + +另一种方法是在登录MariaDB后出现的命令行中输入‘status’命令。输出会显示服务器的版本还有协议版本。 + +![](https://farm6.staticflickr.com/5801/20669891046_73f60e5c81_c.jpg) + +### 方法二 ### + +如果你不能访问MariaDB,那么你就不能用第一种方法。这种情况下你可以根据MariaDB的安装包的版本来推测。这种方法只有在MariaDB通过包管理器安装的才有用。 + +你可以用下面的方法检查MariaDB的安装包。 + +#### Debian、Ubuntu或者Linux Mint: #### + + $ dpkg -l | grep mariadb + +下面的输出说明MariaDB的版本是10.0.17。 + +![](https://farm1.staticflickr.com/607/20669890966_b611fcd915_c.jpg) + +#### Fedora、CentOS或者 RHEL: #### + + $ rpm -qa | grep mariadb + +下面的输出说明安装的版本是5.5.41。 + +![](https://farm1.staticflickr.com/764/20508160748_23d9808256_b.jpg) + +-------------------------------------------------------------------------------- + +via: http://ask.xmodulo.com/check-mariadb-server-version.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 From 595f01ffe4122410e9cc05f2592d14ed4ac1af80 Mon Sep 17 00:00:00 2001 From: geekpi Date: Sat, 22 Aug 2015 16:32:02 +0800 Subject: [PATCH 403/507] Update 20150818 Linux Without Limits--IBM Launch LinuxONE Mainframes.md --- ...0818 Linux Without Limits--IBM Launch LinuxONE Mainframes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/translated/news/20150818 Linux Without Limits--IBM Launch LinuxONE Mainframes.md b/translated/news/20150818 Linux Without Limits--IBM Launch LinuxONE Mainframes.md index 8d9b3dbccb..7899bfaf31 100644 --- a/translated/news/20150818 Linux Without Limits--IBM Launch LinuxONE Mainframes.md +++ b/translated/news/20150818 Linux Without Limits--IBM Launch LinuxONE Mainframes.md @@ -42,7 +42,7 @@ LinuxONE Emperor使用IBM z13处理器。发布于一月的芯片声称是时间 via: http://www.omgubuntu.co.uk/2015/08/ibm-linuxone-mainframe-ubuntu-partnership 作者:[Joey-Elijah Sneddon][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 dddad3bdeb95ac64c57565bd62a0f4f221f3c408 Mon Sep 17 00:00:00 2001 From: ictlyh Date: Sat, 22 Aug 2015 19:57:00 +0800 Subject: [PATCH 404/507] =?UTF-8?q?[Translating]=20news/20150818=20?= =?UTF-8?q?=E2=80=8BUbuntu=20Linux=20is=20coming=20to=20IBM=20mainframes.m?= =?UTF-8?q?d?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../news/20150818 ​Ubuntu Linux is coming to IBM mainframes.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/news/20150818 ​Ubuntu Linux is coming to IBM mainframes.md b/sources/news/20150818 ​Ubuntu Linux is coming to IBM mainframes.md index 8da7227eee..3eec354255 100644 --- a/sources/news/20150818 ​Ubuntu Linux is coming to IBM mainframes.md +++ b/sources/news/20150818 ​Ubuntu Linux is coming to IBM mainframes.md @@ -1,4 +1,5 @@ -​Ubuntu Linux is coming to IBM mainframes +ictlyh Translating​ +Ubuntu Linux is coming to IBM mainframes ================================================================================ SEATTLE -- It's finally happened. At [LinuxCon][1], IBM and [Canonical][2] announced that [Ubuntu Linux][3] will soon be running on IBM mainframes. From e34f824c8a877802d09f41b8cba8d1ddc693f8a1 Mon Sep 17 00:00:00 2001 From: ictlyh Date: Sat, 22 Aug 2015 20:35:29 +0800 Subject: [PATCH 405/507] =?UTF-8?q?[Translated]=20news/20150818=20?= =?UTF-8?q?=E2=80=8BUbuntu=20Linux=20is=20coming=20to=20IBM=20mainframes.m?= =?UTF-8?q?d?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...Ubuntu Linux is coming to IBM mainframes.md | 47 ------------------- ...Ubuntu Linux is coming to IBM mainframes.md | 46 ++++++++++++++++++ 2 files changed, 46 insertions(+), 47 deletions(-) delete mode 100644 sources/news/20150818 ​Ubuntu Linux is coming to IBM mainframes.md create mode 100644 translated/news/20150818 ​Ubuntu Linux is coming to IBM mainframes.md diff --git a/sources/news/20150818 ​Ubuntu Linux is coming to IBM mainframes.md b/sources/news/20150818 ​Ubuntu Linux is coming to IBM mainframes.md deleted file mode 100644 index 3eec354255..0000000000 --- a/sources/news/20150818 ​Ubuntu Linux is coming to IBM mainframes.md +++ /dev/null @@ -1,47 +0,0 @@ -ictlyh Translating​ -Ubuntu Linux is coming to IBM mainframes -================================================================================ -SEATTLE -- It's finally happened. At [LinuxCon][1], IBM and [Canonical][2] announced that [Ubuntu Linux][3] will soon be running on IBM mainframes. - -![](http://zdnet2.cbsistatic.com/hub/i/2015/08/17/f389e12f-03f5-48cc-8019-af4ccf6c6ecd/f15b099e439c0e3a5fd823637d4bcf87/ubuntu-mainframe.jpg) - -You'll soon to be able to get your IBM mainframe in Ubuntu Linux orange - -According to Ross Mauri, IBM's General Manager of System z, and Mark Shuttleworth, Canonical and Ubuntu's founder, this move came about because of customer demand. For over a decade, [Red Hat Enterprise Linux (RHEL)][4] and [SUSE Linux Enterprise Server (SLES)][5] were the only supported IBM mainframe Linux distributions. - -As Ubuntu matured, more and more businesses turned to it for the enterprise Linux, and more and more of them wanted it on IBM big iron hardware. In particular, banks wanted Ubuntu there. Soon, financial CIOs will have their wish granted. - -In an interview Shuttleworth said that Ubuntu Linux will be available on the mainframe by April 2016 in the next long-term support version of Ubuntu: Ubuntu 16.04. Canonical and IBM already took the first move in this direction in late 2014 by bringing [Ubuntu to IBM's POWER][6] architecture. - -Before that, Canonical and IBM almost signed the dotted line to bring [Ubuntu to IBM mainframes in 2011][7] but that deal was never finalized. This time, it's happening. - -Jane Silber, Canonical's CEO, explained in a statement, "Our [expansion of Ubuntu platform][8] support to [IBM z Systems][9] is a recognition of the number of customers that count on z Systems to run their businesses, and the maturity the hybrid cloud is reaching in the marketplace. - -**Silber continued:** - -> With support of z Systems, including [LinuxONE][10], Canonical is also expanding our relationship with IBM, building on our support for the POWER architecture and OpenPOWER ecosystem. Just as Power Systems clients are now benefiting from the scaleout capabilities of Ubuntu, and our agile development process which results in first to market support of new technologies such as CAPI (Coherent Accelerator Processor Interface) on POWER8, z Systems clients can expect the same rapid rollout of technology advancements, and benefit from [Juju][11] and our other cloud tools to enable faster delivery of new services to end users. In addition, our collaboration with IBM includes the enablement of scale-out deployment of many IBM software solutions with Juju Charms. Mainframe clients will delight in having a wealth of 'charmed' IBM solutions, other software provider products, and open source solutions, deployable on mainframes via Juju. - -Shuttleworth expects Ubuntu on z to be very successful. "It's blazingly fast, and with its support for OpenStack, people who want exceptional cloud region performance will be very happy. - --------------------------------------------------------------------------------- - -via: http://www.zdnet.com/article/ubuntu-linux-is-coming-to-the-mainframe/#ftag=RSSbaffb68 - -作者:[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.zdnet.com/meet-the-team/us/steven-j-vaughan-nichols/ -[1]:http://events.linuxfoundation.org/events/linuxcon-north-america -[2]:http://www.canonical.com/ -[3]:http://www.ubuntu.comj/ -[4]:http://www.redhat.com/en/technologies/linux-platforms/enterprise-linux -[5]:https://www.suse.com/products/server/ -[6]:http://www.zdnet.com/article/ibm-doubles-down-on-linux/ -[7]:http://www.zdnet.com/article/mainframe-ubuntu-linux/ -[8]:https://insights.ubuntu.com/2015/08/17/ibm-and-canonical-plan-ubuntu-support-on-ibm-z-systems-mainframe/ -[9]:http://www-03.ibm.com/systems/uk/z/ -[10]:http://www.zdnet.com/article/linuxone-ibms-new-linux-mainframes/ -[11]:https://jujucharms.com/ \ No newline at end of file diff --git a/translated/news/20150818 ​Ubuntu Linux is coming to IBM mainframes.md b/translated/news/20150818 ​Ubuntu Linux is coming to IBM mainframes.md new file mode 100644 index 0000000000..d31f9c34a7 --- /dev/null +++ b/translated/news/20150818 ​Ubuntu Linux is coming to IBM mainframes.md @@ -0,0 +1,46 @@ +IBM 大型机将搭载 Ubuntu Linux +================================================================================ +西雅图 -- 最终还是发生了。在 [LinuxCon][1] 上,IBM 和 [Canonical][2] 宣布 [Ubuntu Linux][3] 不久就会运行在 IBM 大型机上。 + +![](http://zdnet2.cbsistatic.com/hub/i/2015/08/17/f389e12f-03f5-48cc-8019-af4ccf6c6ecd/f15b099e439c0e3a5fd823637d4bcf87/ubuntu-mainframe.jpg) + +很快你就可以在你的 IBM 大型机上安装 Ubuntu Linux orange 啦 + +根据 IBM z 系统的总经理 Ross Mauri 以及 Canonical 和 Ubuntu 的创立者 Mark Shuttleworth 所言,这是因为客户需要。十多年来,IBM 大型机只支持 [红帽企业版 Linux (RHEL)][4] 和 [SUSE Linux 企业版 (SLES)][5] Linux 发行版。 + +随着 Ubuntu 越来越成熟,更多的企业把它作为企业级 Linux,也有更多的人希望它能运行在 IBM 大型机上。尤其是银行希望如此。不久,金融 CIO 们就可以满足他们的需求啦。 + +在一次采访中 Shuttleworth 说 Ubuntu Linux 在 2016 年 4 月下一次长期支持版 Ubuntu 16.04 中就可以用到大型机上。2014 年底 Canonical 和 IBM 将 [Ubuntu 带到 IBM 的 POWER][6] 架构中就迈出了第一步。 + +在那之前,Canonical 和 IBM 几乎签署协议 [在 2011 年实现 Ubuntu 支持 IBM 大型机][7],但最终也没有实现。这次,真的发生了。 + +Canonical 的 CEO Jane Silber 解释说 “[扩大 Ubuntu 平台支持][8] 到 [IBM z 系统][9] 是因为认识到需要 z 系统运行其业务的客户数量以及混合云市场的成熟。” + +**Silber 还说:** + +> 由于 z 系统的支持,包括 [LinuxONE][10],Canonical 和 IBM 的关系进一步加深,构建了对 POWER 架构的支持和 OpenPOWER 生态系统。正如 Power 系统的客户受益于 Ubuntu 的可扩展能力,我们的敏捷开发过程也使得类似 POWER8 CAPI(Coherent Accelerator Processor Interface,一致性加速器接口)达到市场支持,z 系统的客户也可以期望技术进步能快速部署,并从 [Juju][11] 和我们的其它云工具中获益,使得能快速向端用户提供新服务。另外,我们和 IBM 的合作包括实现扩展部署很多 IBM 和 Juju 的软件解决方案。大型机客户对于能通过 Juju 将丰富‘迷人的’ IBM 解决方案、其它软件供应商的产品、开源解决方案部署到大型机上感到高兴。 + +Shuttleworth 期望 z 系统上的 Ubuntu 能取得巨大成功。它发展很快,由于对 OpenStack 的支持,希望有卓越云性能的人会感到非常高兴。 + +-------------------------------------------------------------------------------- + +via: http://www.zdnet.com/article/ubuntu-linux-is-coming-to-the-mainframe/#ftag=RSSbaffb68 + +作者:[Steven J. Vaughan-Nichols][a] +译者:[ictlyh](https://github.com/ictlyh) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.zdnet.com/meet-the-team/us/steven-j-vaughan-nichols/ +[1]:http://events.linuxfoundation.org/events/linuxcon-north-america +[2]:http://www.canonical.com/ +[3]:http://www.ubuntu.comj/ +[4]:http://www.redhat.com/en/technologies/linux-platforms/enterprise-linux +[5]:https://www.suse.com/products/server/ +[6]:http://www.zdnet.com/article/ibm-doubles-down-on-linux/ +[7]:http://www.zdnet.com/article/mainframe-ubuntu-linux/ +[8]:https://insights.ubuntu.com/2015/08/17/ibm-and-canonical-plan-ubuntu-support-on-ibm-z-systems-mainframe/ +[9]:http://www-03.ibm.com/systems/uk/z/ +[10]:http://www.zdnet.com/article/linuxone-ibms-new-linux-mainframes/ +[11]:https://jujucharms.com/ \ No newline at end of file From a252e2a53ed53a47e2420e45f7b908ce5ca53e03 Mon Sep 17 00:00:00 2001 From: Chang Liu Date: Sat, 22 Aug 2015 20:41:11 +0800 Subject: [PATCH 406/507] [Translated]RHCSA Series--Part 07--Using ACLs (Access Control Lists) and Mounting Samba or NFS shares.md --- ...Lists) and Mounting Samba or NFS Shares.md | 214 ----------------- ...Lists) and Mounting Samba or NFS Shares.md | 215 ++++++++++++++++++ 2 files changed, 215 insertions(+), 214 deletions(-) delete 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 translated/tech/RHCSA/RHCSA Series--Part 07--Using ACLs (Access Control Lists) and Mounting Samba or NFS Shares.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 deleted file mode 100644 index 9237e8bd1c..0000000000 --- a/sources/tech/RHCSA Series/RHCSA Series--Part 07--Using ACLs (Access Control Lists) and Mounting Samba or NFS Shares.md +++ /dev/null @@ -1,214 +0,0 @@ -FSSlc translating - -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 diff --git a/translated/tech/RHCSA/RHCSA Series--Part 07--Using ACLs (Access Control Lists) and Mounting Samba or NFS Shares.md b/translated/tech/RHCSA/RHCSA Series--Part 07--Using ACLs (Access Control Lists) and Mounting Samba or NFS Shares.md new file mode 100644 index 0000000000..a68d36de2b --- /dev/null +++ b/translated/tech/RHCSA/RHCSA Series--Part 07--Using ACLs (Access Control Lists) and Mounting Samba or NFS Shares.md @@ -0,0 +1,215 @@ +RHCSA 系列:使用 ACL(访问控制列表) 和挂载 Samba/NFS 共享 – Part 7 +================================================================================ +在上一篇文章([RHCSA 系列 Part 6][1])中,我们解释了如何使用 parted 和 ssm 来设置和配置本地系统存储。 + +![配置 ACL 及挂载 NFS/Samba 共享](http://www.tecmint.com/wp-content/uploads/2015/04/Configure-ACLs-and-Mounting-NFS-Samba-Shares.png) + +RHCSA Series: 配置 ACL 及挂载 NFS/Samba 共享 – Part 7 + +我们也讨论了如何创建和在系统启动时使用一个密码来挂载加密的卷。另外,我们告诫过你要避免在挂载的文件系统上执行苛刻的存储管理操作。记住了这点后,现在,我们将回顾在 RHEL 7 中最常使用的文件系统格式,然后将涵盖有关手动或自动挂载、使用和卸载网络文件系统(CIFS 和 NFS)的话题以及在你的操作系统上实现访问控制列表的使用。 + +#### 前提条件 #### + +在进一步深入之前,请确保你可使用 Samba 服务和 NFS 服务(注意在 RHEL 7 中 NFSv2 已不再被支持)。 + +在本次指导中,我们将使用一个IP 地址为 192.168.0.10 且同时运行着 Samba 服务和 NFS 服务的机子来作为服务器,使用一个 IP 地址为 192.168.0.18 的 RHEL 7 机子来作为客户端。在这篇文章的后面部分,我们将告诉你在客户端上你需要安装哪些软件包。 + +### RHEL 7 中的文件系统格式 ### + +从 RHEL 7 开始,由于 XFS 的高性能和可扩展性,它已经被引入所有的架构中来作为默认的文件系统。 +根据 Red Hat 及其合作伙伴在主流硬件上执行的最新测试,当前 XFS 已支持最大为 500 TB 大小的文件系统。 + +另外, XFS 启用了 user_xattr(扩展用户属性) 和 acl( +POSIX 访问控制列表)来作为默认的挂载选项,而不像 ext3 或 ext4(对于 RHEL 7 来说, ext2 已过时),这意味着当挂载一个 XFS 文件系统时,你不必显式地在命令行或 /etc/fstab 中指定这些选项(假如你想在后一种情况下禁用这些选项,你必须显式地使用 no_acl 和 no_user_xattr)。 + +请记住扩展用户属性可以被指定到文件和目录中来存储任意的额外信息如 mime 类型,字符集或文件的编码,而用户属性中的访问权限由一般的文件权限位来定义。 + +#### 访问控制列表 #### + +作为一名系统管理员,无论你是新手还是专家,你一定非常熟悉与文件和目录有关的常规访问权限,这些权限为所有者,所有组和"世界"(所有的其他人)指定了特定的权限(可读,可写及可执行)。但如若你需要稍微更新你的记忆,请随意参考 [RHCSA 系列的 Part 3][3]. + +但是,由于标准的 `ugo/rwx` 集合并不允许为不同的用户配置不同的权限,所以 ACL 便被引入了进来,为的是为文件和目录定义更加详细的访问权限,而不仅仅是这些特别指定的特定权限。 + +事实上, ACL 定义的权限是由文件权限位所特别指定的权限的一个超集。下面就让我们看看这个转换是如何在真实世界中被应用的吧。 + +1. 存在两种类型的 ACL:访问 ACL,可被应用到一个特定的文件或目录上,以及默认 ACL,只可被应用到一个目录上。假如目录中的文件没有 ACL,则它们将继承它们的父目录的默认 ACL 。 + +2. 从一开始, ACL 就可以为每个用户,每个组或不在文件所属组中的用户配置相应的权限。 + +3. ACL 可使用 `setfacl` 来设置(和移除),可相应地使用 -m 或 -x 选项。 + +例如,让我们创建一个名为 tecmint 的组,并将用户 johndoe 和 davenull 加入该组: + + # groupadd tecmint + # useradd johndoe + # useradd davenull + # usermod -a -G tecmint johndoe + # usermod -a -G tecmint davenull + +并且让我们检验这两个用户都已属于追加的组 tecmint: + + # id johndoe + # id davenull + +![检验用户](http://www.tecmint.com/wp-content/uploads/2015/04/Verify-Users.png) + +检验用户 + +现在,我们在 /mnt 下创建一个名为 playground 的目录,并在该目录下创建一个名为 testfile.txt 的文件。我们将设定该文件的属组为 tecmint,并更改它的默认 ugo/rwx 权限为 770(即赋予该文件的属主和属组可读,可写和可执行权限): + + # mkdir /mnt/playground + # touch /mnt/playground/testfile.txt + # chmod 770 /mnt/playground/testfile.txt + +接着,依次切换为 johndoe 和 davenull 用户,并在文件中写入一些信息: + + echo "My name is John Doe" > /mnt/playground/testfile.txt + echo "My name is Dave Null" >> /mnt/playground/testfile.txt + +到目前为止,一切正常。现在我们让用户 gacanepa 来向该文件执行写操作 – 则写操作将会失败,这是可以预料的。 + +但实际上我们需要用户 gacanepa(TA 不是组 tecmint 的成员)在文件 /mnt/playground/testfile.txt 上有写权限,那又该怎么办呢?首先映入你脑海里的可能是将该用户添加到组 tecmint 中。但那将使得他在所有该组具有写权限位的文件上均拥有写权限,但我们并不想这样,我们只想他能够在文件 /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 + +![管理用户的权限](http://www.tecmint.com/wp-content/uploads/2015/04/User-Permissions.png) + +管理用户的权限 + +现在,让我们给用户 gacanepa 在 /mnt/playground/testfile.txt 文件上有读和写权限。 + +以 root 的身份运行如下命令: + + # setfacl -R -m u:gacanepa:rwx /mnt/playground + +则你将成功地添加一条 ACL,运行 gacanepa 对那个测试文件可写。然后切换为 gacanepa 用户,并再次尝试向该文件写入一些信息: + + $ echo "My name is Gabriel Canepa" >> /mnt/playground/testfile.txt + +要观察一个特定的文件或目录的 ACL,可以使用 `getfacl` 命令: + + # getfacl /mnt/playground/testfile.txt + +![检查文件的 ACL](http://www.tecmint.com/wp-content/uploads/2015/04/Check-ACL-of-File.png) + +检查文件的 ACL + +要为目录设定默认 ACL(它的内容将被该目录下的文件继承,除非另外被覆写),在规则前添加 `d:`并特别指定一个目录名,而不是文件名: + + # setfacl -m d:o:r /mnt/playground + +上面的 ACL 将允许不在属组中的用户对目录 /mnt/playground 中的内容有读权限。请注意观察这次更改前后 +`getfacl /mnt/playground` 的输出结果的不同: + +![在 Linux 中设定默认 ACL](http://www.tecmint.com/wp-content/uploads/2015/04/Set-Default-ACL-in-Linux.png) + +在 Linux 中设定默认 ACL + +[在官方的 RHEL 7 存储管理指导手册的第 20 章][3] 中提供了更多有关 ACL 的例子,我极力推荐你看一看它并将它放在身边作为参考。 + +#### 挂载 NFS 网络共享 #### + +要显示你服务器上可用的 NFS 共享的列表,你可以使用带有 -e 选项的 `showmount` 命令,再跟上机器的名称或它的 IP 地址。这个工具包含在 `nfs-utils` 软件包中: + + # yum update && yum install nfs-utils + +接着运行: + + # showmount -e 192.168.0.10 + +则你将得到一个在 192.168.0.10 上可用的 NFS 共享的列表: + +![检查可用的 NFS 共享](http://www.tecmint.com/wp-content/uploads/2015/04/Mount-NFS-Shares.png) + +检查可用的 NFS 共享 + +要按照需求在本地客户端上使用命令行来挂载 NFS 网络共享,可使用下面的语法: + + # mount -t nfs -o [options] remote_host:/remote/directory /local/directory + +其中,在我们的例子中,对应为: + + # mount -t nfs 192.168.0.10:/NFS-SHARE /mnt/nfs + +若你得到如下的错误信息:“Job for rpc-statd.service failed. See “systemctl status rpc-statd.service”及“journalctl -xn” for details.”,请确保 `rpcbind` 服务被启用且已在你的系统中启动了。 + + # systemctl enable rpcbind.socket + # systemctl restart rpcbind.service + +接着重启。这就应该达到了上面的目的,且你将能够像先前解释的那样挂载你的 NFS 共享了。若你需要在系统启动时自动挂载 NFS 共享,可以向 /etc/fstab 文件添加一个有效的条目: + + remote_host:/remote/directory /local/directory nfs options 0 0 + +上面的变量 remote_host, /remote/directory, /local/directory 和 options(可选) 和在命令行中手动挂载一个 NFS 共享时使用的一样。按照我们前面的例子,对应为: + + 192.168.0.10:/NFS-SHARE /mnt/nfs nfs defaults 0 0 + +#### 挂载 CIFS (Samba) 网络共享 #### + +Samba 代表一个特别的工具,使得在由 *nix 和 Windows 机器组成的网络中进行网络共享成为可能。要显示可用的 Samba 共享,可使用带有 -L 选项的 smbclient 命令,再跟上机器的名称或它的 IP 地址。这个工具包含在 samba_client 软件包中: + +你将被提示在远程主机上输入 root 用户的密码: + + # smbclient -L 192.168.0.10 + +![检查 Samba 共享](http://www.tecmint.com/wp-content/uploads/2015/04/Check-Samba-Shares.png) + +检查 Samba 共享 + +要在本地客户端上挂载 Samba 网络共享,你需要已安装好 cifs-utils 软件包: + + # yum update && yum install cifs-utils + +然后在命令行中使用下面的语法: + + # mount -t cifs -o credentials=/path/to/credentials/file //remote_host/samba_share /local/directory + +其中,在我们的例子中,对应为: + + # mount -t cifs -o credentials=~/.smbcredentials //192.168.0.10/gacanepa /mnt/samba + +其中 `smbcredentials` + + username=gacanepa + password=XXXXXX + +是一个位于 root 用户的家目录(/root/) 中的隐藏文件,其权限被设置为 600,所以除了该文件的属主外,其他人对该文件既不可读也不可写。 + +请注意 samba_share 是 Samba 分享的名称,由上面展示的 `smbclient -L remote_host` 所返回。 + +现在,若你需要在系统启动时自动地使得 Samba 分享可用,可以向 /etc/fstab 文件添加一个像下面这样的有效条目: + + //remote_host:/samba_share /local/directory cifs options 0 0 + +上面的变量 remote_host, /remote/directory, /local/directory 和 options(可选) 和在命令行中手动挂载一个 Samba 共享时使用的一样。按照我们前面的例子中所给的定义,对应为: + + //192.168.0.10/gacanepa /mnt/samba cifs credentials=/root/smbcredentials,defaults 0 0 + +### 结论 ### + +在这篇文章中,我们已经解释了如何在 Linux 中设置 ACL,并讨论了如何在一个 RHEL 7 客户端上挂载 CIFS 和 NFS 网络共享。 + +我建议你去练习这些概念,甚至混合使用它们(试着在一个挂载的网络共享上设置 ACL),直至你感觉舒适。假如你有问题或评论,请随时随意地使用下面的评论框来联系我们。另外,请随意通过你的社交网络分享这篇文章。 + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/rhcsa-exam-configure-acls-and-mount-nfs-samba-shares/ + +作者:[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/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 From 0ff0aa172f23fc7372361f35a179e925f50769ca Mon Sep 17 00:00:00 2001 From: ictlyh Date: Sat, 22 Aug 2015 20:42:00 +0800 Subject: [PATCH 407/507] [Translating] sources/tech/20150821 How to Install Visual Studio Code in Linux.md --- .../tech/20150821 How to Install Visual Studio Code in Linux.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20150821 How to Install Visual Studio Code in Linux.md b/sources/tech/20150821 How to Install Visual Studio Code in Linux.md index 2fac79701e..9c00401f76 100644 --- a/sources/tech/20150821 How to Install Visual Studio Code in Linux.md +++ b/sources/tech/20150821 How to Install Visual Studio Code in Linux.md @@ -1,3 +1,4 @@ +ictlyh Translating How to Install Visual Studio Code in Linux ================================================================================ Hi everyone, today we'll learn how to install Visual Studio Code in Linux Distributions. Visual Studio Code is a code-optimized editor based on Electron, a piece of software that is based on Chromium, which is used to deploy io.js applications for the desktop. It is a source code editor and text editor developed by Microsoft for all the operating system platforms including Linux. Visual Studio Code is free but not an open source software ie. its under proprietary software license terms. It is an awesome powerful and fast code editor for our day to day use. Some of the cool features of visual studio code are navigation, intellisense support, syntax highlighting, bracket matching, auto indentation, and snippets, keyboard support with customizable bindings and support for dozens of languages like Python, C++, jade, PHP, XML, Batch, F#, DockerFile, Coffee Script, Java, HandleBars, R, Objective-C, PowerShell, Luna, Visual Basic, .Net, Asp.Net, C#, JSON, Node.js, Javascript, HTML, CSS, Less, Sass and Markdown. Visual Studio Code integrates with package managers and repositories, and builds and other common tasks to make everyday workflows faster. The most popular feature in Visual Studio Code is its debugging feature which includes a streamlined support for Node.js debugging in the preview. From 90ccfc60e7d072ac6c3ab2ea07381e3ce43ca2fa Mon Sep 17 00:00:00 2001 From: Chang Liu Date: Sat, 22 Aug 2015 20:47:45 +0800 Subject: [PATCH 408/507] Update RHCSA Series--Part 08--Securing SSH, Setting Hostname and Enabling Network Services.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 准备翻译该篇。 --- ...ing SSH, Setting Hostname and Enabling Network Services.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 index a381b1c94a..40fa771580 100644 --- 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 @@ -1,3 +1,5 @@ +FSSlc translating + 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. @@ -212,4 +214,4 @@ via: http://www.tecmint.com/rhcsa-series-secure-ssh-set-hostname-enable-network- [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 +[2]:http://www.tecmint.com/ssh-passwordless-login-using-ssh-keygen-in-5-easy-steps/ From 0f984b2a584921758f4d6afba60ebf0bb65d2af5 Mon Sep 17 00:00:00 2001 From: runningwater Date: Sun, 23 Aug 2015 00:21:15 +0800 Subject: [PATCH 409/507] =?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 --- ...How to Install Logwatch on Ubuntu 15.04.md | 138 ------------------ ...How to Install Logwatch on Ubuntu 15.04.md | 137 +++++++++++++++++ 2 files changed, 137 insertions(+), 138 deletions(-) delete mode 100644 sources/tech/20150813 How to Install Logwatch on Ubuntu 15.04.md create mode 100644 translated/tech/20150813 How to Install Logwatch on Ubuntu 15.04.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 deleted file mode 100644 index 24c71b0cbe..0000000000 --- a/sources/tech/20150813 How to Install Logwatch on Ubuntu 15.04.md +++ /dev/null @@ -1,138 +0,0 @@ -(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. - -### 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] -译者:[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/ diff --git a/translated/tech/20150813 How to Install Logwatch on Ubuntu 15.04.md b/translated/tech/20150813 How to Install Logwatch on Ubuntu 15.04.md new file mode 100644 index 0000000000..8bb0836755 --- /dev/null +++ b/translated/tech/20150813 How to Install Logwatch on Ubuntu 15.04.md @@ -0,0 +1,137 @@ +Ubuntu 15.04 and系统中安装 Logwatch +================================================================================ +大家好,今天我们会讲述在 Ubuntu 15.04 操作系统上如何安装 Logwatch 软件,它也可以在任意的 Linux 系统和类 Unix 系统上安装。Logwatch 是一款可定制的日志分析和日志监控报告生成系统,它可以根据一段时间的日志文件生成您所希望关注的详细报告。它具有易安装、易配置、可审查等特性,同时对其提供的数据的安全性上也有一些保障措施。Logwatch 会扫描重要的操作系统组件像 SSH、网站服务等的日志文件,然后生成用户所关心的有价值的条目汇总报告。 + +### 预安装设置 ### + +我们会使用 Ubuntu 15.04 版本的操作系统来部署 Logwatch,所以安装 Logwatch 之前,要确保系统上邮件服务设置是正常可用的。因为它会每天把生成的报告通过日报的形式发送邮件给管理员。您的系统的源库也应该设置可用,以便可以从通用源库来安装 Logwatch。 + +然后打开您 ubuntu 系统的终端,用 root 账号登陆,在进入 Logwatch 的安装操作前,先更新您的系统软件包。 + + root@ubuntu-15:~# apt-get update + +### 安装 Logwatch ### + +只要你的系统已经更新和已经满足前面说的先决条件,那么就可以在您的机器上输入如下命令来安装 Logwatch。 + + root@ubuntu-15:~# apt-get install logwatch + +在安装过程中,一旦您按提示按下“Y”健同意对系统修改的话,Logwatch 将会开始安装一些额外的必须软件包。 + +在安装过程中会根据您机器上的邮件服务器设置情况弹出提示对 Postfix 设置的配置界面。在这篇教程中我们使用最容易的 “仅本地” 选项。根据您的基础设施情况也可以选择其它的可选项,然后点击“确定”继续。 + +![Potfix Configurations](http://blog.linoxide.com/wp-content/uploads/2015/08/21.png) + +随后您得选择邮件服务器名,这邮件服务器名也会被其它程序使用,所以它应该是一个完全合格域名/全称域名(FQDN),且只一个。 + +![Postfix Setup](http://blog.linoxide.com/wp-content/uploads/2015/08/31.png) + +一旦按下在 postfix 配置提示底端的 “OK”,安装进程就会用 Postfix 的默认配置来安装,并且完成 Logwatch 的整个安装。 + +![Logwatch Completion](http://blog.linoxide.com/wp-content/uploads/2015/08/41.png) + +您可以在终端下发出如下命令来检查 Logwatch 状态,正常情况下它应该是激活状态。 + + root@ubuntu-15:~# service postfix status + +![Postfix Status](http://blog.linoxide.com/wp-content/uploads/2015/08/51.png) + +要确认 Logwatch 在默认配置下的安装信息,可以如下示简单的发出“logwatch” 命令。 + + root@ubuntu-15:~# logwatch + +上面执行命令的输出就是终端下编制出的报表展现格式。 + +![Logwatch Report](http://blog.linoxide.com/wp-content/uploads/2015/08/61.png) + +### 配置 Logwatch ### + +在成功安装好 Logwatch 后,我们需要在它的配置文件中做一些修改,配置文件位于如下所示的路径。那么,就让我们用文本编辑器打开它,然后按需要做些变动。 + + root@ubuntu-15:~# vim /usr/share/logwatch/default.conf/logwatch.conf + +**输出/格式化选项** + +默认情况下 Logwatch 会以无编码的文本打印到标准输出方式。要改为以邮件为默认方式,需设置“Output = mail”,要改为保存成文件方式,需设置“Output = file”。所以您可以根据您的要求设置其默认配置。 + + Output = stdout + +如果使用的是因特网电子邮件配置,要用 Html 格式为默认出格式,需要修改成如下行所示的样子。 + + Format = text + +现在增加默认的邮件报告接收人地址,可以是本地账号也可以是完整的邮件地址,需要的都可以在这行上写上 + + MailTo = root + #MailTo = user@test.com + +默认的邮件发送人可以是本地账号,也可以是您需要使用的其它名字。 + + # complete email address. + MailFrom = Logwatch + +对这个配置文件保存修改,至于其它的参数就让它是默认的,无需改动。 + +**调度任务配置** + +现在编辑在日常 crons 目录下的 “00logwatch” 文件来配置从 logwatch 生成的报告需要发送的邮件地址。 + + root@ubuntu-15:~# vim /etc/cron.daily/00logwatch + +在这儿您需要作用“--mailto user@test.com”来替换掉“--output mail”,然后保存文件。 + +![Logwatch Cronjob](http://blog.linoxide.com/wp-content/uploads/2015/08/71.png) + +### 生成报告 ### + +现在我们在终端中执行“logwatch”命令来生成测试报告,生成的结果在终端中会以文本格式显示出来。 + + root@ubuntu-15:~#logwatch + +生成的报告开始部分显示的是执行的时间和日期。它包含不同的部分,每个部分以开始标识开始而以结束标识结束,中间显示的标识部分提到的完整日志信息。 + +这儿演示的是开始标识头的样子,要显示系统上所有安装包的信息,如下所示: + +![dpkg status](http://blog.linoxide.com/wp-content/uploads/2015/08/81.png) + +接下来的部分显示的日志信息是关于当前系统登陆会话、rsyslogs 和当前及最后可用的会话 SSH 连接信息。 + +![logwatch report](http://blog.linoxide.com/wp-content/uploads/2015/08/9.png) + +Logwatch 报告最后显示的是安全 sudo 日志及root目录磁盘使用情况,如下示: + +![Logwatch end report](http://blog.linoxide.com/wp-content/uploads/2015/08/10.png) + +您也可以打开如下的文件来检查生成的 logwatch 报告电子邮件。 + + root@ubuntu-15:~# vim /var/mail/root + +您会看到所有已生成的邮件到其配置用户的信息传送状态。 + +### 更多详情 ### + +Logwatch 是一款很不错的工具,可以学习的很多很多,所以如果您对它的日志监控功能很感兴趣的话,也以通过如下所示的简短命令来获得更多帮助。 + + root@ubuntu-15:~# man logwatch + +上面的命令包含所有关于 logwatch 的用户手册,所以仔细阅读,要退出手册的话可以简单的输入“q”。 + +关于 logwatch 命令的使用,您可以使用如下所示的帮助命令来获得更多的详细信息。 + + root@ubuntu-15:~# logwatch --help + +### 结论 ### + +教程结束,您也学会了如何在 Ubuntu 15.04 上对 Logwatch 的安装、配置等全部设置指导。现在您就可以自定义监控您的系统日志,不管是监控所有服务的运行情况还是对特定的服务在指定的时间发送报告都可以。所以,开始使用这工具吧,无论何时有问题或想知道更多关于 logwatch 的使用的都可以给我们留言。 + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/ubuntu-how-to/install-use-logwatch-ubuntu-15-04/ + +作者:[Kashif Siddique][a] +译者:[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/ From 4eb314a47b3d8decfb737dccd8ac92e45603c7e3 Mon Sep 17 00:00:00 2001 From: DongShuaike Date: Sun, 23 Aug 2015 09:43:03 +0800 Subject: [PATCH 410/507] Create 20150823 How learning data structures and algorithms make you a better developer.md --- ... algorithms make you a better developer.md | 126 ++++++++++++++++++ 1 file changed, 126 insertions(+) create mode 100644 sources/talk/20150823 How learning data structures and algorithms make you a better developer.md diff --git a/sources/talk/20150823 How learning data structures and algorithms make you a better developer.md b/sources/talk/20150823 How learning data structures and algorithms make you a better developer.md new file mode 100644 index 0000000000..7152efa1ed --- /dev/null +++ b/sources/talk/20150823 How learning data structures and algorithms make you a better developer.md @@ -0,0 +1,126 @@ +How learning data structures and algorithms make you a better developer +================================================================================ + +> "I'm a huge proponent of designing your code around the data, rather than the other way around, and I think it's one of the reasons git has been fairly successful […] I will, in fact, claim that the difference between a bad programmer and a good one is whether he considers his code or his data structures more important." +-- Linus Torvalds + +--- + +> "Smart data structures and dumb code works a lot better than the other way around." +-- Eric S. Raymond, The Cathedral and The Bazaar + +Learning about data structures and algorithms makes you a stonking good programmer. + +**Data structures and algorithms are patterns for solving problems.** The more of them you have in your utility belt, the greater variety of problems you'll be able to solve. You'll also be able to come up with more elegant solutions to new problems than you would otherwise be able to. + +You'll understand, ***in depth***, how your computer gets things done. This informs any technical decisions you make, regardless of whether or not you're using a given algorithm directly. Everything from memory allocation in the depths of your operating system, to the inner workings of your RDBMS to how your networking stack manages to send data from one corner of Earth to another. All computers rely on fundamental data structures and algorithms, so understanding them better makes you understand the computer better. + +Cultivate a broad and deep knowledge of algorithms and you'll have stock solutions to large classes of problems. Problem spaces that you had difficulty modelling before often slot neatly into well-worn data structures that elegantly handle the known use-cases. Dive deep into the implementation of even the most basic data structures and you'll start seeing applications for them in your day-to-day programming tasks. + +You'll also be able to come up with novel solutions to the somewhat fruitier problems you're faced with. Data structures and algorithms have the habit of proving themselves useful in situations that they weren't originally intended for, and the only way you'll discover these on your own is by having a deep and intuitive knowledge of at least the basics. + +But enough with the theory, have a look at some examples + +###Figuring out the fastest way to get somewhere### +Let's say we're creating software to figure out the shortest distance from one international airport to another. Assume we're constrained to following routes: + +![](http://www.happybearsoftware.com/assets/posts/how-learning-data-structures-and-algorithms-makes-you-a-better-developer/airport-graph-d2e32b3344b708383e405d67a80c29ea.svg) + +graph of destinations and the distances between them, how can we find the shortest distance say, from Helsinki to London? **Dijkstra's algorithm** is the algorithm that will definitely get us the right answer in the shortest time. + +In all likelihood, if you ever came across this problem and knew that Dijkstra's algorithm was the solution, you'd probably never have to implement it from scratch. Just ***knowing*** about it would point you to a library implementation that solves the problem for you. + +If you did dive deep into the implementation, you'd be working through one of the most important graph algorithms we know of. You'd know that in practice it's a little resource intensive so an extension called A* is often used in it's place. It gets used everywhere from robot guidance to routing TCP packets to GPS pathfinding. + +###Figuring out the order to do things in### +Let's say you're trying to model courses on a new Massive Open Online Courses platform (like Udemy or Khan Academy). Some of the courses depend on each other. For example, a user has to have taken Calculus before she's eligible for the course on Newtonian Mechanics. Courses can have multiple dependencies. Here's are some examples of what that might look like written out in YAML: + + # Mapping from course name to requirements + # + # If you're a physcist or a mathematicisn and you're reading this, sincere + # apologies for the completely made-up dependency tree :) + courses: + arithmetic: [] + algebra: [arithmetic] + trigonometry: [algebra] + calculus: [algebra, trigonometry] + geometry: [algebra] + mechanics: [calculus, trigonometry] + atomic_physics: [mechanics, calculus] + electromagnetism: [calculus, atomic_physics] + radioactivity: [algebra, atomic_physics] + astrophysics: [radioactivity, calculus] + quantumn_mechanics: [atomic_physics, radioactivity, calculus] + +Given those dependencies, as a user, I want to be able to pick any course and have the system give me an ordered list of courses that I would have to take to be eligible. So if I picked `calculus`, I'd want the system to return the list: + + arithmetic -> algebra -> trigonometry -> calculus + +Two important constraints on this that may not be self-evident: + + - At every stage in the course list, the dependencies of the next course must be met. + - We don't want any duplicate courses in the list. + +This is an example of resolving dependencies and the algorithm we're looking for to solve this problem is called topological sort (tsort). Tsort works on a dependency graph like we've outlined in the YAML above. Here's what that would look like in a graph (where each arrow means `requires`): + +![](http://www.happybearsoftware.com/assets/posts/how-learning-data-structures-and-algorithms-makes-you-a-better-developer/course-graph-2f60f42bb0dc95319954ce34c02705a2.svg) + +topological sort does is take a graph like the one above and find an ordering in which all the dependencies are met at each stage. So if we took a sub-graph that only contained `radioactivity` and it's dependencies, then ran tsort on it, we might get the following ordering: + + arithmetic + algebra + trigonometry + calculus + mechanics + atomic_physics + radioactivity + +This meets the requirements set out by the use case we described above. A user just has to pick `radioactivity` and they'll get an ordered list of all the courses they have to work through before they're allowed to. + +We don't even need to go into the details of how topological sort works before we put it to good use. In all likelihood, your programming language of choice probably has an implementation of it in the standard library. In the worst case scenario, your Unix probably has the `tsort` utility installed by default, run man `tsort` and have a play with it. + +###Other places tsort get's used### + + - **Tools like** `make` allow you to declare task dependencies. Topological sort is used under the hood to figure out what order the tasks should be executed in. + - **Any programming language that has a `require` directive**, indicating that the current file requires the code in a different file to be run first. Here topological sort can be used to figure out what order the files should be loaded in so that each is only loaded once and all dependencies are met. + - **Project management tools with Gantt charts**. A Gantt chart is a graph that outlines all the dependencies of a given task and gives you an estimate of when it will be complete based on those dependencies. I'm not a fan of Gantt charts, but it's highly likely that tsort will be used to draw them. + +###Squeezing data with Huffman coding### +[Huffman coding](http://en.wikipedia.org/wiki/Huffman_coding) is an algorithm used for lossless data compression. It works by analyzing the data you want to compress and creating a binary code for each character. More frequently occurring characters get smaller codes, so `e` might be encoded as `111` while `x` might be `10010`. The codes are created so that they can be concatenated without a delimeter and still be decoded accurately. + +Huffman coding is used along with LZ77 in the DEFLATE algorithm which is used by gzip to compress things. gzip is used all over the place, in particular for compressing files (typically anything with a `.gz` extension) and for http requests/responses in transit. + +Knowing how to implement and use Huffman coding has a number of benefits: + + - You'll know why a larger compression context results in better compression overall (e.g. the more you compress, the better the compression ratio). This is one of the proposed benefits of SPDY: that you get better compression on multiple HTTP requests/responses. + - You'll know that if you're compressing your javascript/css in transit anyway, it's completely pointless to run a minifier on them. Sames goes for PNG files, which use DEFLATE internally for compression already. + - If you ever find yourself trying to forcibly decipher encrypted information , you may realize that since repeating data compresses better, the compression ratio of a given bit of ciphertext will help you determine it's [block cipher mode of operation](http://en.wikipedia.org/wiki/Block_cipher_mode_of_operation). + +###Picking what to learn next is hard### +Being a programmer involves learning constantly. To operate as a web developer you need to know markup languages, high level languages like ruby/python, regular expressions, SQL and JavaScript. You need to know the fine details of HTTP, how to drive a unix terminal and the subtle art of object oriented programming. It's difficult to navigate that landscape effectively and choose what to learn next. + +I'm not a fast learner so I have to choose what to spend time on very carefully. As much as possible, I want to learn skills and techniques that are evergreen, that is, won't be rendered obsolete in a few years time. That means I'm hesitant to learn the javascript framework of the week or untested programming languages and environments. + +As long as our dominant model of computation stays the same, data structures and algorithms that we use today will be used in some form or another in the future. You can safely spend time on gaining a deep and thorough knowledge of them and know that they will pay dividends for your entire career as a programmer. + +###Sign up to the Happy Bear Software List### +Find this article useful? For a regular dose of freshly squeezed technical content delivered straight to your inbox, **click on the big green button below to sign up to the Happy Bear Software mailing list.** + +We'll only be in touch a few times per month and you can unsubscribe at any time. + +-------------------------------------------------------------------------------- + +via: http://www.happybearsoftware.com/how-learning-data-structures-and-algorithms-makes-you-a-better-developer + +作者:[Happy Bear][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.happybearsoftware.com/ +[1]:http://en.wikipedia.org/wiki/Huffman_coding +[2]:http://en.wikipedia.org/wiki/Block_cipher_mode_of_operation + + + From 308d8a627262cc3cc9b7a25701b1813fe02cea01 Mon Sep 17 00:00:00 2001 From: ictlyh Date: Sun, 23 Aug 2015 15:30:33 +0800 Subject: [PATCH 411/507] [Translated] tech/20150821 How to Install Visual Studio Code in Linux.md --- ... to Install Visual Studio Code in Linux.md | 128 ------------------ ... to Install Visual Studio Code in Linux.md | 127 +++++++++++++++++ 2 files changed, 127 insertions(+), 128 deletions(-) delete mode 100644 sources/tech/20150821 How to Install Visual Studio Code in Linux.md create mode 100644 translated/tech/20150821 How to Install Visual Studio Code in Linux.md diff --git a/sources/tech/20150821 How to Install Visual Studio Code in Linux.md b/sources/tech/20150821 How to Install Visual Studio Code in Linux.md deleted file mode 100644 index 9c00401f76..0000000000 --- a/sources/tech/20150821 How to Install Visual Studio Code in Linux.md +++ /dev/null @@ -1,128 +0,0 @@ -ictlyh Translating -How to Install Visual Studio Code in Linux -================================================================================ -Hi everyone, today we'll learn how to install Visual Studio Code in Linux Distributions. Visual Studio Code is a code-optimized editor based on Electron, a piece of software that is based on Chromium, which is used to deploy io.js applications for the desktop. It is a source code editor and text editor developed by Microsoft for all the operating system platforms including Linux. Visual Studio Code is free but not an open source software ie. its under proprietary software license terms. It is an awesome powerful and fast code editor for our day to day use. Some of the cool features of visual studio code are navigation, intellisense support, syntax highlighting, bracket matching, auto indentation, and snippets, keyboard support with customizable bindings and support for dozens of languages like Python, C++, jade, PHP, XML, Batch, F#, DockerFile, Coffee Script, Java, HandleBars, R, Objective-C, PowerShell, Luna, Visual Basic, .Net, Asp.Net, C#, JSON, Node.js, Javascript, HTML, CSS, Less, Sass and Markdown. Visual Studio Code integrates with package managers and repositories, and builds and other common tasks to make everyday workflows faster. The most popular feature in Visual Studio Code is its debugging feature which includes a streamlined support for Node.js debugging in the preview. - -Note: Please note that, Visual Studio Code is only available for 64-bit versions of Linux Distributions. - -Here, are some easy to follow steps on how to install Visual Sudio Code in all Linux Distribution. - -### 1. Downloading Visual Studio Code Package ### - -First of all, we'll gonna download the Visual Studio Code Package for 64-bit Linux Operating System from the Microsoft server using the given url [http://go.microsoft.com/fwlink/?LinkID=534108][1] . Here, we'll use wget to download it and keep it under /tmp/VSCODE directory as shown below. - - # mkdir /tmp/vscode; cd /tmp/vscode/ - # wget https://az764295.vo.msecnd.net/public/0.3.0/VSCode-linux-x64.zip - - --2015-06-24 06:02:54-- https://az764295.vo.msecnd.net/public/0.3.0/VSCode-linux-x64.zip - Resolving az764295.vo.msecnd.net (az764295.vo.msecnd.net)... 93.184.215.200, 2606:2800:11f:179a:1972:2405:35b:459 - Connecting to az764295.vo.msecnd.net (az764295.vo.msecnd.net)|93.184.215.200|:443... connected. - HTTP request sent, awaiting response... 200 OK - Length: 64992671 (62M) [application/octet-stream] - Saving to: ‘VSCode-linux-x64.zip’ - 100%[================================================>] 64,992,671 14.9MB/s in 4.1s - 2015-06-24 06:02:58 (15.0 MB/s) - ‘VSCode-linux-x64.zip’ saved [64992671/64992671] - -### 2. Extracting the Package ### - -Now, after we have successfully downloaded the zipped package of Visual Studio Code, we'll gonna extract it using the unzip command to /opt/directory. To do so, we'll need to run the following command in a terminal or a console. - - # unzip /tmp/vscode/VSCode-linux-x64.zip -d /opt/ - -Note: If we don't have unzip already installed, we'll need to install it via our Package Manager. If you're running Ubuntu, apt-get whereas if you're running Fedora, CentOS, dnf or yum can be used to install it. - -### 3. Running Visual Studio Code ### - -After we have extracted the package, we can directly launch the Visual Studio Code by executing a file named Code. - - # sudo chmod +x /opt/VSCode-linux-x64/Code - # sudo /opt/VSCode-linux-x64/Code - -If we want to launch Code and want to be available globally via terminal in any place, we'll need to create the link of /opt/vscode/Code as/usr/local/bin/code . - - # ln -s /opt/VSCode-linux-x64/Code /usr/local/bin/code - -Now, we can launch Visual Studio Code by running the following command in a terminal. - - # code . - -### 4. Creating a Desktop Launcher ### - -Next, after we have successfully extracted the Visual Studio Code package, we'll gonna create a desktop launcher so that it will be easily available in the launchers, menus, desktop, according to the desktop environment so that anyone can launch it from them. So, first we'll gonna copy the icon file to /usr/share/icons/ directory. - - # cp /opt/VSCode-linux-x64/resources/app/vso.png /usr/share/icons/ - -Then, we'll gonna create the desktop launcher having the extension as .desktop. Here, we'll create a file named visualstudiocode.desktop under /tmp/VSCODE/ folder using our favorite text editor. - - # vi /tmp/vscode/visualstudiocode.desktop - -Then, we'll gonna paste the following lines into that file. - - [Desktop Entry] - Name=Visual Studio Code - Comment=Multi-platform code editor for Linux - Exec=/opt/VSCode-linux-x64/Code - Icon=/usr/share/icons/vso.png - Type=Application - StartupNotify=true - Categories=TextEditor;Development;Utility; - MimeType=text/plain; - -After we're done creating the desktop file, we'll wanna copy that desktop file to /usr/share/applications/ directory so that it will be available in launchers and menus for use with single click. - - # cp /tmp/vscode/visualstudiocode.desktop /usr/share/applications/ - -Once its done, we can launch it by opening it from the Launcher or Menu. - -![Visual Studio Code](http://blog.linoxide.com/wp-content/uploads/2015/06/visual-studio-code.png) - -### Installing Visual Studio Code in Ubuntu ### - -We can use Ubuntu Make 0.7 in order to install Visual Studio Code in Ubuntu 14.04/14.10/15.04 distribution of linux. This method is the most easiest way to setup Code in ubuntu as we just need to execute few commands for it. First of all, we'll need to install Ubuntu Make 0.7 in our ubuntu distribution of linux. To install it, we'll need to add PPA for it. This can be done by running the command below. - - # add-apt-repository ppa:ubuntu-desktop/ubuntu-make - - This ppa proposes package backport of Ubuntu make for supported releases. - More info: https://launchpad.net/~ubuntu-desktop/+archive/ubuntu/ubuntu-make - Press [ENTER] to continue or ctrl-c to cancel adding it - gpg: keyring `/tmp/tmpv0vf24us/secring.gpg' created - gpg: keyring `/tmp/tmpv0vf24us/pubring.gpg' created - gpg: requesting key A1231595 from hkp server keyserver.ubuntu.com - gpg: /tmp/tmpv0vf24us/trustdb.gpg: trustdb created - gpg: key A1231595: public key "Launchpad PPA for Ubuntu Desktop" imported - gpg: no ultimately trusted keys found - gpg: Total number processed: 1 - gpg: imported: 1 (RSA: 1) - OK - -Then, we'll gonna update the local repository index and install ubuntu-make. - - # apt-get update - # apt-get install ubuntu-make - -After Ubuntu Make is installed in our ubuntu operating system, we'll gonna install Code by running the following command in a terminal. - - # umake web visual-studio-code - -![Umake Web Code](http://blog.linoxide.com/wp-content/uploads/2015/06/umake-web-code.png) - -After running the above command, we'll be asked to enter the path where we want to install it. Then, it will ask for permission to install Visual Studio Code in our ubuntu system. Then, we'll press "a". Once we do that, it will download and install it in our ubuntu machine. Finally, we can launch it by opening it from the Launcher or Menu. - -### Conclusion ### - -We have successfully installed Visual Studio Code in Linux Distribution. Installing Visual Studio Code in every linux distribution is the same as shown in the above steps where we can also use umake to install it in ubuntu distributions. Umake is a popular tool for the development tools, IDEs, Languages. We can easily install Android Studios, Eclipse and many other popular IDEs with umake. Visual Studio Code is based on a project in Github called [Electron][2] which is a part of [Atom.io][3] Editor. It has a bunch of new cool and improved features that Atom.io Editor doesn't have. Visual Studio Code is currently only available in 64-bit platform of linux operating system. 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/install-visual-studio-code-linux/ - -作者:[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://go.microsoft.com/fwlink/?LinkID=534108 -[2]:https://github.com/atom/electron -[3]:https://github.com/atom/atom \ No newline at end of file diff --git a/translated/tech/20150821 How to Install Visual Studio Code in Linux.md b/translated/tech/20150821 How to Install Visual Studio Code in Linux.md new file mode 100644 index 0000000000..48f68ade0b --- /dev/null +++ b/translated/tech/20150821 How to Install Visual Studio Code in Linux.md @@ -0,0 +1,127 @@ +如何在 Linux 中安装 Visual Studio Code +================================================================================ +大家好,今天我们一起来学习如何在 Linux 发行版中安装 Visual Studio Code。Visual Studio Code 是基于 Electron 优化代码后的编辑器,后者是基于 Chromium 的一款软件,用于为桌面系统发布 io.js 应用。Visual Studio Code 是微软开发的包括 Linux 在内的全平台代码编辑器和文本编辑器。它是免费软件但不开源,在专有软件许可条款下发布。它是我们日常使用的超级强大和快速的代码编辑器。Visual Studio Code 有很多很酷的功能,例如导航、智能感知支持、语法高亮、括号匹配、自动补全、片段、支持自定义键盘绑定、并且支持多种语言,例如 Python、C++、Jade、PHP、XML、Batch、F#、DockerFile、Coffee Script、Java、HandleBars、 R、 Objective-C、 PowerShell、 Luna、 Visual Basic、 .Net、 Asp.Net、 C#、 JSON、 Node.js、 Javascript、 HTML、 CSS、 Less、 Sass 和 Markdown。Visual Studio Code 集成了包管理器和库,并构建通用任务使得加速每日的工作流。Visual Studio Code 中最受欢迎的是它的调试功能,它包括流式支持 Node.js 的预览调试。 + +注意:请注意 Visual Studio Code 只支持 64 位 Linux 发行版。 + +下面是在所有 Linux 发行版中安装 Visual Studio Code 的几个简单步骤。 + +### 1. 下载 Visual Studio Code 软件包 ### + +首先,我们要从微软服务器中下载 64 位 Linux 操作系统的 Visual Studio Code 安装包,链接是 [http://go.microsoft.com/fwlink/?LinkID=534108][1]。这里我们使用 wget 下载并保存到 tmp/VSCODE 目录。 + + # mkdir /tmp/vscode; cd /tmp/vscode/ + # wget https://az764295.vo.msecnd.net/public/0.3.0/VSCode-linux-x64.zip + + --2015-06-24 06:02:54-- https://az764295.vo.msecnd.net/public/0.3.0/VSCode-linux-x64.zip + Resolving az764295.vo.msecnd.net (az764295.vo.msecnd.net)... 93.184.215.200, 2606:2800:11f:179a:1972:2405:35b:459 + Connecting to az764295.vo.msecnd.net (az764295.vo.msecnd.net)|93.184.215.200|:443... connected. + HTTP request sent, awaiting response... 200 OK + Length: 64992671 (62M) [application/octet-stream] + Saving to: ‘VSCode-linux-x64.zip’ + 100%[================================================>] 64,992,671 14.9MB/s in 4.1s + 2015-06-24 06:02:58 (15.0 MB/s) - ‘VSCode-linux-x64.zip’ saved [64992671/64992671] + +### 2. 提取软件包 ### + +现在,下载好 Visual Studio Code 的 zip 压缩包之后,我们打算使用 unzip 命令解压它。我们要在终端或者控制台中运行以下命令。 + + # unzip /tmp/vscode/VSCode-linux-x64.zip -d /opt/ + +注意:如果我们还没有安装 unzip,我们首先需要通过软件包管理器安装它。如果你运行的是 Ubuntu,使用 apt-get,如果运行的是 Fedora、CentOS、可以用 dnf 或 yum 安装它。 + +### 3. 运行 Visual Studio Code ### + +提取软件包之后,我们可以直接运行一个名为 Code 的文件启动 Visual Studio Code。 + + # sudo chmod +x /opt/VSCode-linux-x64/Code + # sudo /opt/VSCode-linux-x64/Code + +如果我们想启动 Code 并通过终端能在任何地方打开,我们就需要创建 /opt/vscode/Code 的一个链接 /usr/local/bin/code。 + + # ln -s /opt/VSCode-linux-x64/Code /usr/local/bin/code + +现在,我们就可以在终端中运行以下命令启动 Visual Studio Code 了。 + + # code . + +### 4. 创建桌面启动 ### + +下一步,成功抽取 Visual Studio Code 软件包之后,我们打算创建桌面启动程序,使得根据不同桌面环境能够从启动器、菜单、桌面启动它。首先我们要复制一个图标文件到 /usr/share/icons/ 目录。 + + # cp /opt/VSCode-linux-x64/resources/app/vso.png /usr/share/icons/ + +然后,我们创建一个桌面启动程序,文件扩展名为 .desktop。这里我们在 /tmp/VSCODE/ 目录中使用喜欢的文本编辑器创建名为 visualstudiocode.desktop 的文件。 + + # vi /tmp/vscode/visualstudiocode.desktop + +然后,粘贴下面的行到那个文件中。 + + [Desktop Entry] + Name=Visual Studio Code + Comment=Multi-platform code editor for Linux + Exec=/opt/VSCode-linux-x64/Code + Icon=/usr/share/icons/vso.png + Type=Application + StartupNotify=true + Categories=TextEditor;Development;Utility; + MimeType=text/plain; + +创建完桌面文件之后,我们会复制这个桌面文件到 /usr/share/applications/ 目录,这样启动器和菜单中就可以单击启动 Visual Studio Code 了。 + + # cp /tmp/vscode/visualstudiocode.desktop /usr/share/applications/ + +完成之后,我们可以在启动器或者菜单中启动它。 + +![Visual Studio Code](http://blog.linoxide.com/wp-content/uploads/2015/06/visual-studio-code.png) + +### 在 Ubuntu 中 Visual Studio Code ### + +要在 Ubuntu 14.04/14.10/15.04 Linux 发行版中安装 Visual Studio Code,我们可以使用 Ubuntu Make 0.7。这是在 ubuntu 中安装 code 最简单的方法,因为我们只需要执行几个命令。首先,我们要在我们的 ubuntu linux 发行版中安装 Ubuntu Make 0.7。要安装它,首先要为它添加 PPA。可以通过运行下面命令完成。 + + # add-apt-repository ppa:ubuntu-desktop/ubuntu-make + + This ppa proposes package backport of Ubuntu make for supported releases. + More info: https://launchpad.net/~ubuntu-desktop/+archive/ubuntu/ubuntu-make + Press [ENTER] to continue or ctrl-c to cancel adding it + gpg: keyring `/tmp/tmpv0vf24us/secring.gpg' created + gpg: keyring `/tmp/tmpv0vf24us/pubring.gpg' created + gpg: requesting key A1231595 from hkp server keyserver.ubuntu.com + gpg: /tmp/tmpv0vf24us/trustdb.gpg: trustdb created + gpg: key A1231595: public key "Launchpad PPA for Ubuntu Desktop" imported + gpg: no ultimately trusted keys found + gpg: Total number processed: 1 + gpg: imported: 1 (RSA: 1) + OK + +然后,更新本地库索引并安装 ubuntu-make。 + + # apt-get update + # apt-get install ubuntu-make + +在我们的 ubuntu 操作系统上安装完 Ubuntu Make 之后,我们打算在一个终端中运行以下命令安装 Code。 + + # umake web visual-studio-code + +![Umake Web Code](http://blog.linoxide.com/wp-content/uploads/2015/06/umake-web-code.png) + +运行完上面的命令之后,会要求我们输入想要的安装路径。然后,会请求我们允许在 ubuntu 系统中安装 Visual Studio Code。我们敲击 “a”。点击完后,它会在 ubuntu 机器上下载和安装 Code。最后,我们可以在启动器或者菜单中启动它。 + +### 总结 ### + +我们已经成功地在 Linux 发行版上安装了 Visual Studio Code。在所有 linux 发行版上安装 Visual Studio Code 都和上面介绍的相似,我们同样可以使用 umake 在 linux 发行版中安装。Umake 是一个安装开发工具,IDEs 和语言流行的工具。我们可以用 Umake 轻松地安装 Android Studios、Eclipse 和很多其它流行 IDE。Visual Studio Code 是基于 Github 上一个叫 [Electron][2] 的项目,它是 [Atom.io][3] 编辑器的一部分。它有很多 Atom.io 编辑器没有的改进功能。当前 Visual Studio Code 只支持 64 位 linux 操作系统平台。如果你有任何疑问、建议或者反馈,请在下面的评论框中留言以便我们改进和更新我们的内容。非常感谢!Enjoy :-) + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/linux-how-to/install-visual-studio-code-linux/ + +作者:[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://go.microsoft.com/fwlink/?LinkID=534108 +[2]:https://github.com/atom/electron +[3]:https://github.com/atom/atom \ No newline at end of file From eeac34ccc2ad8e98ff8f31caa9679ebf513e326e Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 23 Aug 2015 22:09:26 +0800 Subject: [PATCH 412/507] =?UTF-8?q?PUB:20150818=20=E2=80=8BUbuntu=20Linux?= =?UTF-8?q?=20is=20coming=20to=20IBM=20mainframes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @ictlyh --- ...Ubuntu Linux is coming to IBM mainframes.md | 29 ++++++++++++------- 1 file changed, 18 insertions(+), 11 deletions(-) rename {translated/news => published}/20150818 ​Ubuntu Linux is coming to IBM mainframes.md (53%) diff --git a/translated/news/20150818 ​Ubuntu Linux is coming to IBM mainframes.md b/published/20150818 ​Ubuntu Linux is coming to IBM mainframes.md similarity index 53% rename from translated/news/20150818 ​Ubuntu Linux is coming to IBM mainframes.md rename to published/20150818 ​Ubuntu Linux is coming to IBM mainframes.md index d31f9c34a7..d3bacb3da6 100644 --- a/translated/news/20150818 ​Ubuntu Linux is coming to IBM mainframes.md +++ b/published/20150818 ​Ubuntu Linux is coming to IBM mainframes.md @@ -1,34 +1,41 @@ -IBM 大型机将搭载 Ubuntu Linux +Ubuntu Linux 来到 IBM 大型机 ================================================================================ -西雅图 -- 最终还是发生了。在 [LinuxCon][1] 上,IBM 和 [Canonical][2] 宣布 [Ubuntu Linux][3] 不久就会运行在 IBM 大型机上。 +最终来到了。在 [LinuxCon][1] 上,IBM 和 [Canonical][2] 宣布 [Ubuntu Linux][3] 不久就会运行在 IBM 大型机 [LinuxONE][1] 上,这是一种只支持 Linux 的大型机,现在也可以运行 Ubuntu 了。 + +这个 IBM 发布的最大的 LinuxONE 系统称作‘Emperor’,它可以扩展到 8000 台虚拟机或者上万台容器,这可能是单独一台 Linux 系统的记录。 + +LinuxONE 被 IBM 称作‘游戏改变者’,它‘释放了 Linux 的商业潜力’。 ![](http://zdnet2.cbsistatic.com/hub/i/2015/08/17/f389e12f-03f5-48cc-8019-af4ccf6c6ecd/f15b099e439c0e3a5fd823637d4bcf87/ubuntu-mainframe.jpg) -很快你就可以在你的 IBM 大型机上安装 Ubuntu Linux orange 啦 +*很快你就可以在你的 IBM 大型机上安装 Ubuntu Linux orange 啦* 根据 IBM z 系统的总经理 Ross Mauri 以及 Canonical 和 Ubuntu 的创立者 Mark Shuttleworth 所言,这是因为客户需要。十多年来,IBM 大型机只支持 [红帽企业版 Linux (RHEL)][4] 和 [SUSE Linux 企业版 (SLES)][5] Linux 发行版。 随着 Ubuntu 越来越成熟,更多的企业把它作为企业级 Linux,也有更多的人希望它能运行在 IBM 大型机上。尤其是银行希望如此。不久,金融 CIO 们就可以满足他们的需求啦。 -在一次采访中 Shuttleworth 说 Ubuntu Linux 在 2016 年 4 月下一次长期支持版 Ubuntu 16.04 中就可以用到大型机上。2014 年底 Canonical 和 IBM 将 [Ubuntu 带到 IBM 的 POWER][6] 架构中就迈出了第一步。 +在一次采访中 Shuttleworth 说 Ubuntu Linux 在 2016 年 4 月下一次长期支持版 Ubuntu 16.04 中就可以用到大型机上。而在 2014 年底 Canonical 和 IBM 将 [Ubuntu 带到 IBM 的 POWER][6] 架构中就迈出了第一步。 -在那之前,Canonical 和 IBM 几乎签署协议 [在 2011 年实现 Ubuntu 支持 IBM 大型机][7],但最终也没有实现。这次,真的发生了。 +在那之前,Canonical 和 IBM 差点签署了协议 [在 2011 年实现 Ubuntu 支持 IBM 大型机][7],但最终也没有实现。这次,真的发生了。 -Canonical 的 CEO Jane Silber 解释说 “[扩大 Ubuntu 平台支持][8] 到 [IBM z 系统][9] 是因为认识到需要 z 系统运行其业务的客户数量以及混合云市场的成熟。” +Canonical 的 CEO Jane Silber 解释说 “[把 Ubuntu 平台支持扩大][8]到 [IBM z 系统][9] 是因为认识到需要 z 系统运行其业务的客户数量以及混合云市场的成熟。” **Silber 还说:** -> 由于 z 系统的支持,包括 [LinuxONE][10],Canonical 和 IBM 的关系进一步加深,构建了对 POWER 架构的支持和 OpenPOWER 生态系统。正如 Power 系统的客户受益于 Ubuntu 的可扩展能力,我们的敏捷开发过程也使得类似 POWER8 CAPI(Coherent Accelerator Processor Interface,一致性加速器接口)达到市场支持,z 系统的客户也可以期望技术进步能快速部署,并从 [Juju][11] 和我们的其它云工具中获益,使得能快速向端用户提供新服务。另外,我们和 IBM 的合作包括实现扩展部署很多 IBM 和 Juju 的软件解决方案。大型机客户对于能通过 Juju 将丰富‘迷人的’ IBM 解决方案、其它软件供应商的产品、开源解决方案部署到大型机上感到高兴。 +> 由于 z 系统的支持,包括 [LinuxONE][10],Canonical 和 IBM 的关系进一步加深,构建了对 POWER 架构的支持和 OpenPOWER 生态系统。正如 Power 系统的客户受益于 Ubuntu 的可扩展能力,我们的敏捷开发过程也使得类似 POWER8 CAPI (Coherent Accelerator Processor Interface,一致性加速器接口)得到了市场支持,z 系统的客户也可以期望技术进步能快速部署,并从 [Juju][11] 和我们的其它云工具中获益,使得能快速向端用户提供新服务。另外,我们和 IBM 的合作包括实现扩展部署很多 IBM 和 Juju 的软件解决方案。大型机客户对于能通过 Juju 将丰富‘迷人的’ IBM 解决方案、其它软件供应商的产品、开源解决方案部署到大型机上感到高兴。 Shuttleworth 期望 z 系统上的 Ubuntu 能取得巨大成功。它发展很快,由于对 OpenStack 的支持,希望有卓越云性能的人会感到非常高兴。 + -------------------------------------------------------------------------------- -via: http://www.zdnet.com/article/ubuntu-linux-is-coming-to-the-mainframe/#ftag=RSSbaffb68 +via: http://www.zdnet.com/article/ubuntu-linux-is-coming-to-the-mainframe/ -作者:[Steven J. Vaughan-Nichols][a] -译者:[ictlyh](https://github.com/ictlyh) -校对:[校对者ID](https://github.com/校对者ID) +via: http://www.omgubuntu.co.uk/2015/08/ibm-linuxone-mainframe-ubuntu-partnership + +作者:[Steven J. Vaughan-Nichols][a],[Joey-Elijah Sneddon][a] +译者:[ictlyh](https://github.com/ictlyh),[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 8ac7cb03119286775fcf23de3bc511c03fb1078a Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 23 Aug 2015 22:11:48 +0800 Subject: [PATCH 413/507] =?UTF-8?q?=E6=9C=AA=E6=A0=A1=E5=AF=B9=EF=BC=8C?= =?UTF-8?q?=E6=91=98=E5=8F=96=E9=83=A8=E5=88=86=E5=86=85=E5=AE=B9=E5=90=88?= =?UTF-8?q?=E5=B9=B6=E5=88=B0=E7=9B=B8=E4=BC=BC=E6=96=87=E7=AB=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @geekpi 这篇翻译质量不行啊,请翻译后通读一遍。此外,这篇和另外一篇内容相近,合并发布了。 --- ...150818 Linux Without Limits--IBM Launch LinuxONE Mainframes.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/news => published}/20150818 Linux Without Limits--IBM Launch LinuxONE Mainframes.md (100%) diff --git a/translated/news/20150818 Linux Without Limits--IBM Launch LinuxONE Mainframes.md b/published/20150818 Linux Without Limits--IBM Launch LinuxONE Mainframes.md similarity index 100% rename from translated/news/20150818 Linux Without Limits--IBM Launch LinuxONE Mainframes.md rename to published/20150818 Linux Without Limits--IBM Launch LinuxONE Mainframes.md From 60a0d30df8bea3b4d6b16cdf2a5259f105090756 Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 23 Aug 2015 22:52:41 +0800 Subject: [PATCH 414/507] PUB:20150610 Tickr Is An Open-Source RSS News Ticker for Linux Desktops MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @xiaoyu33 这篇有一些口语化的动向,如果你再细心些,可以翻译的更好。 --- ...urce RSS News Ticker for Linux Desktops.md | 35 +++++++++---------- 1 file changed, 17 insertions(+), 18 deletions(-) rename {translated/share => published}/20150610 Tickr Is An Open-Source RSS News Ticker for Linux Desktops.md (59%) diff --git a/translated/share/20150610 Tickr Is An Open-Source RSS News Ticker for Linux Desktops.md b/published/20150610 Tickr Is An Open-Source RSS News Ticker for Linux Desktops.md similarity index 59% rename from translated/share/20150610 Tickr Is An Open-Source RSS News Ticker for Linux Desktops.md rename to published/20150610 Tickr Is An Open-Source RSS News Ticker for Linux Desktops.md index d7bb0e425b..fec42d22fa 100644 --- a/translated/share/20150610 Tickr Is An Open-Source RSS News Ticker for Linux Desktops.md +++ b/published/20150610 Tickr Is An Open-Source RSS News Ticker for Linux Desktops.md @@ -1,24 +1,24 @@ -Trickr:一个开源的Linux桌面RSS新闻速递 +Tickr:一个开源的 Linux 桌面 RSS 新闻速递应用 ================================================================================ ![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/05/rss-tickr.jpg) **最新的!最新的!阅读关于它的一切!** -好了,所以我们今天要强调的应用程序不是相当于旧报纸的二进制版本—而是它会以一个伟大的方式,将最新的新闻推送到你的桌面上。 +好了,我们今天要推荐的应用程序可不是旧式报纸的二进制版本——它会以一种漂亮的方式将最新的新闻推送到你的桌面上。 -Tick是一个基于GTK的Linux桌面新闻速递,能够在水平带滚动显示最新头条新闻,以及你最爱的RSS资讯文章标题,当然你可以放置在你桌面的任何地方。 +Tickr 是一个基于 GTK 的 Linux 桌面新闻速递应用,能够以横条方式滚动显示最新头条新闻以及你最爱的RSS资讯文章标题,当然你可以放置在你桌面的任何地方。 -请叫我Joey Calamezzo;我把我的放在底部,有电视新闻台的风格。 +请叫我 Joey Calamezzo;我把它放在底部,就像电视新闻台的滚动字幕一样。 (LCTT 译注: Joan Callamezzo 是 Pawnee Today 的主持人,一位 Pawnee 的本地新闻/脱口秀主持人。而本文作者是 Joey。) -“到你了,子标题” +“到你了,副标题”。 ### RSS -还记得吗? ### -“谢谢段落结尾。” +“谢谢,这段结束了。” -在一个推送通知,社交媒体,以及点击诱饵的时代,哄骗我们阅读最新的令人惊奇的,人人都爱读的清单,RSS看起来有一点过时了。 +在一个充斥着推送通知、社交媒体、标题党,以及哄骗人们点击的清单体的时代,RSS看起来有一点过时了。 -对我来说?恩,RSS是名副其实的真正简单的聚合。这是将消息通知给我的最简单,最易于管理的方式。我可以在我愿意的时候,管理和阅读一些东西;没必要匆忙的去看,以防这条微博消失在信息流中,或者推送通知消失。 +对我来说呢?恩,RSS是名副其实的真正简单的聚合(RSS : Really Simple Syndication)。这是将消息通知给我的最简单、最易于管理的方式。我可以在我愿意的时候,管理和阅读一些东西;没必要匆忙的去看,以防这条微博消失在信息流中,或者推送通知消失。 tickr的美在于它的实用性。你可以不断地有新闻滚动在屏幕的底部,然后不时地瞥一眼。 @@ -32,31 +32,30 @@ tickr的美在于它的实用性。你可以不断地有新闻滚动在屏幕的 尽管虽然tickr可以从Ubuntu软件中心安装,然而它已经很久没有更新了。当你打开笨拙的不直观的控制面板的时候,没有什么能够比这更让人感觉被遗弃的了。 -打开它: +要打开它: 1. 右键单击tickr条 1. 转至编辑>首选项 1. 调整各种设置 -选项和设置行的后面,有些似乎是容易理解的。但是知己知彼你能够几乎掌控一切,包括: +选项和设置行的后面,有些似乎是容易理解的。但是详细了解这些你才能够掌握一切,包括: - 设置滚动速度 - 选择鼠标经过时的行为 - 资讯更新频率 - 字体,包括字体大小和颜色 -- 分隔符(“delineator”) +- 消息分隔符(“delineator”) - tickr在屏幕上的位置 - tickr条的颜色和不透明度 - 选择每种资讯显示多少文章 有个值得一提的“怪癖”是,当你点击“应用”按钮,只会更新tickr的屏幕预览。当您退出“首选项”窗口时,请单击“确定”。 -想要滚动条在你的显示屏上水平显示,也需要公平一点的调整,特别是统一显示。 +想要得到完美的显示效果, 你需要一点点调整,特别是在 Unity 上。 -按下“全宽按钮”,能够让应用程序自动检测你的屏幕宽度。默认情况下,当放置在顶部或底部时,会留下25像素的间距(应用程序被创建在过去的GNOME2.x桌面)。只需添加额外的25像素到输入框,来弥补这个问题。 +按下“全宽按钮”,能够让应用程序自动检测你的屏幕宽度。默认情况下,当放置在顶部或底部时,会留下25像素的间距(应用程序以前是在GNOME2.x桌面上创建的)。只需添加额外的25像素到输入框,来弥补这个问题。 -其他可供选择的选项包括:选择文章在哪个浏览器打开;tickr是否以一个常规的窗口出现; -是否显示一个时钟;以及应用程序多久检查一次文章资讯。 +其他可供选择的选项包括:选择文章在哪个浏览器打开;tickr是否以一个常规的窗口出现;是否显示一个时钟;以及应用程序多久检查一次文章资讯。 #### 添加资讯 #### @@ -76,9 +75,9 @@ tickr自带的有超过30种不同的资讯列表,从技术博客到主流新 ### 在Ubuntu 14.04 LTS或更高版本上安装Tickr ### -在Ubuntu 14.04 LTS或更高版本上安装Tickr +这就是 Tickr,它不会改变世界,但是它能让你知道世界上发生了什么。 -在Ubuntu 14.04 LTS或更高版本中安装,转到Ubuntu软件中心,但要点击下面的按钮。 +在Ubuntu 14.04 LTS或更高版本中安装,点击下面的按钮转到Ubuntu软件中心。 - [点击此处进入Ubuntu软件中心安装tickr][1] @@ -88,7 +87,7 @@ via: http://www.omgubuntu.co.uk/2015/06/tickr-open-source-desktop-rss-news-ticke 作者:[Joey-Elijah Sneddon][a] 译者:[xiaoyu33](https://github.com/xiaoyu33) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 2080842fadc7b00bfa207fc528aa808368c397b8 Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 23 Aug 2015 23:13:01 +0800 Subject: [PATCH 415/507] PUB:20150813 How to get Public IP from Linux Terminal @KevinSJ --- ...ow to get Public IP from Linux Terminal.md | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) rename {translated/tech => published}/20150813 How to get Public IP from Linux Terminal.md (50%) diff --git a/translated/tech/20150813 How to get Public IP from Linux Terminal.md b/published/20150813 How to get Public IP from Linux Terminal.md similarity index 50% rename from translated/tech/20150813 How to get Public IP from Linux Terminal.md rename to published/20150813 How to get Public IP from Linux Terminal.md index 98c0ec7b31..c454db655c 100644 --- a/translated/tech/20150813 How to get Public IP from Linux Terminal.md +++ b/published/20150813 How to get Public IP from Linux Terminal.md @@ -1,9 +1,10 @@ -如何在 Linux 终端中获取公有 IP +如何在 Linux 终端中知道你的公有 IP ================================================================================ ![](http://www.blackmoreops.com/wp-content/uploads/2015/06/256x256xHow-to-get-Public-IP-from-Linux-Terminal-blackMORE-Ops.png.pagespeed.ic.GKEAEd4UNr.png) -公有地址由InterNIC分配并由基于类的网络 ID 或基于 CIDR 地址块构成(被称为 CIDR 块)并保证了在全球英特网中的唯一性。当公有地址被分配时,路径将会被记录到互联网中的路由器中,这样访问公有地址的流量就能顺利到达。访问目标公有地址的流量可通过互联网获取。比如,当一个一个 CIDR 块被以网络 ID 和子网掩码的形式分配给一个组织时,对应的 [网络 ID,子网掩码] 也会同时作为路径储存在英特网中的路由器中。访问 CIDR 块中的地址的 IP 封包会被导向对应的位置。在本文中我将会介绍在几种在 Linux 终端中查看你的公有 IP 地址的方法。这对普通用户来说并无意义,但 Linux 服务器(无GUI或者作为只能使用基本工具的用户登录时)会很有用。无论如何,从 Linux 终端中获取公有 IP 在各种方面都很意义,说不定某一天就能用得着。 +公有地址由 InterNIC 分配并由基于类的网络 ID 或基于 CIDR 的地址块构成(被称为 CIDR 块),并保证了在全球互联网中的唯一性。当公有地址被分配时,其路由将会被记录到互联网中的路由器中,这样访问公有地址的流量就能顺利到达。访问目标公有地址的流量可经由互联网抵达。比如,当一个 CIDR 块被以网络 ID 和子网掩码的形式分配给一个组织时,对应的 [网络 ID,子网掩码] 也会同时作为路由储存在互联网中的路由器中。目标是 CIDR 块中的地址的 IP 封包会被导向对应的位置。 +在本文中我将会介绍在几种在 Linux 终端中查看你的公有 IP 地址的方法。这对普通用户来说并无意义,但 Linux 服务器(无GUI或者作为只能使用基本工具的用户登录时)会很有用。无论如何,从 Linux 终端中获取公有 IP 在各种方面都很意义,说不定某一天就能用得着。 以下是我们主要使用的两个命令,curl 和 wget。你可以换着用。 @@ -21,17 +22,17 @@ curl ipinfo.io/json curl ifconfig.me/all.json - curl www.trackip.net/ip?json (bit ugly) + curl www.trackip.net/ip?json (有点丑陋) ### curl XML格式输出: ### curl ifconfig.me/all.xml -### curl 所有IP细节 ### +### curl 得到所有IP细节 (挖掘机)### curl ifconfig.me/all -### 使用 DYDNS (当你使用 DYDNS 服务时有用)Using DYNDNS (Useful when you’re using DYNDNS service) ### +### 使用 DYDNS (当你使用 DYDNS 服务时有用)### curl -s 'http://checkip.dyndns.org' | sed 's/.*Current IP Address: \([0-9\.]*\).*/\1/g' curl -s http://checkip.dyndns.org/ | grep -o "[[:digit:].]\+" @@ -43,7 +44,7 @@ ### 使用 host 和 dig 命令 ### -在可用时,你可以直接使用 host 和 dig 命令。 +如果有的话,你也可以直接使用 host 和 dig 命令。 host -t a dartsclink.com | sed 's/.*has address //' dig +short myip.opendns.com @resolver1.opendns.com @@ -55,15 +56,15 @@ PUBLIC_IP=`wget http://ipecho.net/plain -O - -q ; echo` echo $PUBLIC_IP -已经由不少选项了。 +简单易用。 -我实际上写了一个用于记录每日我的路由器中所有 IP 变化并保存到一个文件的脚本。我在搜索过程中找到了这些很好用的命令。希望某天它能帮到其他人。 +我实际上是在写一个用于记录每日我的路由器中所有 IP 变化并保存到一个文件的脚本。我在搜索过程中找到了这些很好用的命令。希望某天它能帮到其他人。 -------------------------------------------------------------------------------- via: http://www.blackmoreops.com/2015/06/14/how-to-get-public-ip-from-linux-terminal/ 译者:[KevinSJ](https://github.com/KevinSJ) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 5f42179fb3c8b136b74f29bb174e376fae1d5d1f Mon Sep 17 00:00:00 2001 From: Kevin Sicong Jiang Date: Sun, 23 Aug 2015 10:20:33 -0500 Subject: [PATCH 416/507] KevinSJ Translating --- .../20150821 Top 4 open source command-line email clients.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/share/20150821 Top 4 open source command-line email clients.md b/sources/share/20150821 Top 4 open source command-line email clients.md index df96173c18..afdcd8cf4a 100644 --- a/sources/share/20150821 Top 4 open source command-line email clients.md +++ b/sources/share/20150821 Top 4 open source command-line email clients.md @@ -1,3 +1,4 @@ +KevinSJ Translating Top 4 open source command-line email clients ================================================================================ ![](http://opensource.com/sites/default/files/styles/image-full-size/public/images/life/life_mail.png) @@ -76,4 +77,4 @@ via: http://opensource.com/life/15/8/top-4-open-source-command-line-email-client [9]:https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html [10]:http://notmuchmail.org/ [11]:http://notmuchmail.org/releases/ -[12]:http://www.gnu.org/licenses/gpl.html \ No newline at end of file +[12]:http://www.gnu.org/licenses/gpl.html From e076870e0de5683c653bcbc0d79ea359e97275e4 Mon Sep 17 00:00:00 2001 From: joeren Date: Mon, 24 Aug 2015 09:34:38 +0800 Subject: [PATCH 417/507] Update 20150818 How to monitor stock quotes from the command line on Linux.md --- ...w to monitor stock quotes from the command line on Linux.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150818 How to monitor stock quotes from the command line on Linux.md b/sources/tech/20150818 How to monitor stock quotes from the command line on Linux.md index 662ac1eb84..48c4979f3e 100644 --- a/sources/tech/20150818 How to monitor stock quotes from the command line on Linux.md +++ b/sources/tech/20150818 How to monitor stock quotes from the command line on Linux.md @@ -1,3 +1,4 @@ +Translating by GOLinux! How to monitor stock quotes from the command line on Linux ================================================================================ If you are one of those stock investors or traders, monitoring the stock market will be one of your daily routines. Most likely you will be using an online trading platform which comes with some fancy real-time charts and all sort of advanced stock analysis and tracking tools. While such sophisticated market research tools are a must for any serious stock investors to read the market, monitoring the latest stock quotes still goes a long way to build a profitable portfolio. @@ -96,4 +97,4 @@ via: http://xmodulo.com/monitor-stock-quotes-command-line-linux.html [1]:https://github.com/michaeldv/mop [2]:http://ask.xmodulo.com/install-go-language-linux.html [3]:http://money.cnn.com/data/markets/ -[4]:http://finance.yahoo.com/ \ No newline at end of file +[4]:http://finance.yahoo.com/ From 7680623bb62923e10160f70655fba96023da0ab8 Mon Sep 17 00:00:00 2001 From: Ezio Date: Mon, 24 Aug 2015 10:08:48 +0800 Subject: [PATCH 418/507] Update 20150728 Process of the Linux kernel building.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 全部翻译完 --- ...28 Process of the Linux kernel building.md | 27 ++++++++++++++++++- 1 file changed, 26 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 00504e60fd..6f9368384c 100644 --- a/sources/tech/20150728 Process of the Linux kernel building.md +++ b/sources/tech/20150728 Process of the Linux kernel building.md @@ -698,6 +698,8 @@ The `$(obj)/compressed/vmlinux` target depends on the `vmlinux-objs-y` that comp 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: +`vmlinux.bin` 是去掉了调试信息和注释的`vmlinux` 二进制文件,加上了占用了`u32` (注:即4-Byte)的长度信息的`vmlinux.bin.all` 压缩后就是`vmlinux.bin.bz2`。其中`vmlinux.bin.all` 包含了`vmlinux.bin` 和`vmlinux.relocs`(注:vmlinux 的重定位信息),其中`vmlinux.relocs` 是`vmlinux` 经过程序`relocs` 处理之后的`vmlinux` 镜像(见上文所述)。我们现在已经获取到了这些文件,汇编文件`piggy.S` 将会被`mkpiggy` 生成、然后编译: + ```Makefile MKPIGGY arch/x86/boot/compressed/piggy.S AS arch/x86/boot/compressed/piggy.o @@ -705,12 +707,16 @@ Where the `vmlinux.bin` is the `vmlinux` with striped debuging information and c This assembly files will contain computed offset from a compressed kernel. After this we can see that `zoffset` generated: +这个汇编文件会包含经过计算得来的、压缩内核的偏移信息。处理完这个汇编文件,我们就可以看到`zoffset` 生成了: + ```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: +现在`zoffset.h` 和`voffset.h` 已经生成了,[arch/x86/boot](https://github.com/torvalds/linux/tree/master/arch/x86/boot/) 里的源文件可以继续编译: + ```Makefile AS arch/x86/boot/header.o CC arch/x86/boot/main.o @@ -731,36 +737,48 @@ As the `zoffset.h` and the `voffset.h` are generated, compilation of the source As all source code files will be compiled, they will be linked to the `setup.elf`: +所有的源代码会被编译,他们最终会被链接到`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: +最后两件事是创建包含目录`arch/x86/boot/*` 下的编译过的代码的`setup.bin`: + ``` objcopy -O binary arch/x86/boot/setup.elf arch/x86/boot/setup.bin ``` and the creation of the `vmlinux.bin` from the `vmlinux`: +以及从`vmlinux` 生成`vmlinux.bin` : + ``` 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.c](https://github.com/torvalds/linux/blob/master/arch/x86/boot/tools/build.c),它将会用来把`setup.bin` 和`vmlinux.bin` 打包成`bzImage`: + ``` 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: +实际上`bzImage` 就是把`setup.bin` 和`vmlinux.bin` 连接到一起。最终我们会看到输出结果,就和那些用源码编译过内核的同行的结果一样: + ``` Setup is 16268 bytes (padded to 16384 bytes). System is 4704 kB @@ -770,12 +788,19 @@ 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. +这就是本文的最后一节。本文我们了解了编译内核的全部步骤:从执行`make` 命令开始,到最后生成`bzImage`。我知道,linux 内核的makefiles 和构建linux 的过程第一眼看起来可能比较迷惑,但是这并不是很难。希望本文可以帮助你理解构建linux 内核的整个流程。 + + Links +链接 ================================================================================ * [GNU make util](https://en.wikipedia.org/wiki/Make_%28software%29) @@ -797,7 +822,7 @@ Links via: https://github.com/0xAX/linux-insides/blob/master/Misc/how_kernel_compiled.md -译者:[译者ID](https://github.com/译者ID) +译者:[译者ID](https://github.com/oska874) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 31094aa2e37bf5449c639b400433517c39b47508 Mon Sep 17 00:00:00 2001 From: GOLinux Date: Mon, 24 Aug 2015 10:41:43 +0800 Subject: [PATCH 419/507] [Translated]20150818 How to monitor stock quotes from the command line on Linux.md --- ...k quotes from the command line on Linux.md | 100 ------------------ ...k quotes from the command line on Linux.md | 99 +++++++++++++++++ 2 files changed, 99 insertions(+), 100 deletions(-) delete mode 100644 sources/tech/20150818 How to monitor stock quotes from the command line on Linux.md create mode 100644 translated/tech/20150818 How to monitor stock quotes from the command line on Linux.md diff --git a/sources/tech/20150818 How to monitor stock quotes from the command line on Linux.md b/sources/tech/20150818 How to monitor stock quotes from the command line on Linux.md deleted file mode 100644 index 48c4979f3e..0000000000 --- a/sources/tech/20150818 How to monitor stock quotes from the command line on Linux.md +++ /dev/null @@ -1,100 +0,0 @@ -Translating by GOLinux! -How to monitor stock quotes from the command line on Linux -================================================================================ -If you are one of those stock investors or traders, monitoring the stock market will be one of your daily routines. Most likely you will be using an online trading platform which comes with some fancy real-time charts and all sort of advanced stock analysis and tracking tools. While such sophisticated market research tools are a must for any serious stock investors to read the market, monitoring the latest stock quotes still goes a long way to build a profitable portfolio. - -If you are a full-time system admin constantly sitting in front of terminals while trading stocks as a hobby during the day, a simple command-line tool that shows real-time stock quotes will be a blessing for you. - -In this tutorial, let me introduce a neat command-line tool that allows you to monitor stock quotes from the command line on Linux. - -This tool is called [Mop][1]. Written in Go, this lightweight command-line tool is extremely handy for tracking the latest stock quotes from the U.S. markets. You can easily customize the list of stocks to monitor, and it shows the latest stock quotes in ncurses-based, easy-to-read interface. - -**Note**: Mop obtains the latest stock quotes via Yahoo! Finance API. Be aware that their stock quotes are known to be delayed by 15 minutes. So if you are looking for "real-time" stock quotes with zero delay, Mop is not a tool for you. Such "live" stock quote feeds are usually available for a fee via some proprietary closed-door interface. With that being said, let's see how you can use Mop under Linux environment. - -### Install Mop on Linux ### - -Since Mop is implemented in Go, you will need to install Go language first. If you don't have Go installed, follow [this guide][2] to install Go on your Linux platform. Make sure to set GOPATH environment variable as described in the guide. - -Once Go is installed, proceed to install Mop as follows. - -**Debian, Ubuntu or Linux Mint** - - $ sudo apt-get install git - $ go get github.com/michaeldv/mop - $ cd $GOPATH/src/github.com/michaeldv/mop - $ make install - -Fedora, CentOS, RHEL - - $ sudo yum install git - $ go get github.com/michaeldv/mop - $ cd $GOPATH/src/github.com/michaeldv/mop - $ make install - -The above commands will install Mop under $GOPATH/bin. - -Now edit your .bashrc to include $GOPATH/bin in your PATH variable. - - export PATH="$PATH:$GOPATH/bin" - ----------- - - $ source ~/.bashrc - -### Monitor Stock Quotes from the Command Line with Mop ### - -To launch Mod, simply run the command called cmd. - - $ cmd - -At the first launch, you will see a few stock tickers which Mop comes pre-configured with. - -![](https://farm6.staticflickr.com/5749/20018949104_c8c64e0e06_c.jpg) - -The quotes show information like the latest price, %change, daily low/high, 52-week low/high, dividend, and annual yield. Mop obtains market overview information from [CNN][3], and individual stock quotes from [Yahoo Finance][4]. The stock quote information updates itself within the terminal periodically. - -### Customize Stock Quotes in Mop ### - -Let's try customizing the stock list. Mop provides easy-to-remember shortcuts for this: '+' to add a new stock, and '-' to remove a stock. - -To add a new stock, press '+', and type a stock ticker symbol to add (e.g., MSFT). You can add more than one stock at once by typing a comma-separated list of tickers (e.g., "MSFT, AMZN, TSLA"). - -![](https://farm1.staticflickr.com/636/20648164441_642ae33a22_c.jpg) - -Removing stocks from the list can be done similarly by pressing '-'. - -### Sort Stock Quotes in Mop ### - -You can sort the stock quote list based on any column. To sort, press 'o', and use left/right key to choose the column to sort by. When a particular column is chosen, you can sort the list either in increasing order or in decreasing order by pressing ENTER. - -![](https://farm1.staticflickr.com/724/20648164481_15631eefcf_c.jpg) - -By pressing 'g', you can group your stocks based on whether they are advancing or declining for the day. Advancing issues are represented in green color, while declining issues are colored in white. - -![](https://c2.staticflickr.com/6/5633/20615252696_a5bd44d3aa_b.jpg) - -If you want to access help page, simply press '?'. - -![](https://farm1.staticflickr.com/573/20632365342_da196b657f_c.jpg) - -### Conclusion ### - -As you can see, Mop is a lightweight, yet extremely handy stock monitoring tool. Of course you can easily access stock quotes information elsewhere, from online websites, your smartphone, etc. However, if you spend a great deal of your time in a terminal environment, Mop can easily fit in to your workspace, hopefully without distracting must of your workflow. Just let it run and continuously update market date in one of your terminals, and be done with it. - -Happy trading! - --------------------------------------------------------------------------------- - -via: http://xmodulo.com/monitor-stock-quotes-command-line-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://xmodulo.com/author/nanni -[1]:https://github.com/michaeldv/mop -[2]:http://ask.xmodulo.com/install-go-language-linux.html -[3]:http://money.cnn.com/data/markets/ -[4]:http://finance.yahoo.com/ diff --git a/translated/tech/20150818 How to monitor stock quotes from the command line on Linux.md b/translated/tech/20150818 How to monitor stock quotes from the command line on Linux.md new file mode 100644 index 0000000000..c2a9e5d576 --- /dev/null +++ b/translated/tech/20150818 How to monitor stock quotes from the command line on Linux.md @@ -0,0 +1,99 @@ +Linux中通过命令行监控股票报价 +================================================================================ +如果你是那些股票投资者或者交易者中的一员,那么监控证券市场将成为你日常工作中的其中一项任务。最有可能是你会使用一个在线交易平台,这个平台有着一些漂亮的实时图表和全部种类的高级股票分析和交易工具。虽然这种复杂的市场研究工具是任何严肃的证券投资者阅读市场的必备,但是监控最新的股票报价来构建有利可图的投资组合仍然有很长一段路要走。 + +如果你是一位长久坐在终端前的全职系统管理员,而证券交易又成了你日常生活中的业余兴趣,那么一个简单地显示实时股票报价的命令行工具会是你的恩赐。 + +在本教程中,让我来介绍一个灵巧而简洁的命令行工具,它可以让你在Linux上从命令行监控股票报价。 + +这个工具叫做[Mop][1]。它是用GO编写的一个轻量级命令行工具,可以极其方便地跟踪来自美国市场的最新股票报价。你可以很轻松地自定义要监控的证券列表,它会在一个基于ncurses的便于阅读的界面显示最新的股票报价。 + +**注意**:Mop是通过雅虎金融API获取最新的股票报价的。你必须意识到,他们的的股票报价已知会有15分钟的延时。所以,如果你正在寻找0延时的“实时”股票报价,那么Mop就不是你的菜了。这种“现场”股票报价订阅通常可以通过向一些不开放的私有接口付费获取。对于上面讲得,让我们来看看怎样在Linux环境下使用Mop吧。 + +### 安装 Mop 到 Linux ### + +由于Mop部署在Go中,你首先需要安装Go语言。如果你还没有安装Go,请参照[此指南][2]将Go安装到你的Linux平台中。请确保按指南中所讲的设置GOPATH环境变量。 + +安装完Go后,继续像下面这样安装Mop。 + +**Debian,Ubuntu 或 Linux Mint** + + $ sudo apt-get install git + $ go get github.com/michaeldv/mop + $ cd $GOPATH/src/github.com/michaeldv/mop + $ make install + +**Fedora,CentOS,RHEL** + + $ sudo yum install git + $ go get github.com/michaeldv/mop + $ cd $GOPATH/src/github.com/michaeldv/mop + $ make install + +上述命令将安装Mop到$GOPATH/bin。 + +现在,编辑你的.bashrc,将$GOPATH/bin写到你的PATH变量中。 + + export PATH="$PATH:$GOPATH/bin" + +---------- + + $ source ~/.bashrc + +### 使用Mop来通过命令行监控股票报价 ### + +要启动Mop,只需运行名为cmd的命令。 + + $ cmd + +首次启动,你将看到一些Mop预配置的证券行情自动收录器。 + +![](https://farm6.staticflickr.com/5749/20018949104_c8c64e0e06_c.jpg) + +报价显示了像最新价格、交易百分比、每日低/高、52周低/高、股利以及年产量等信息。Mop从[CNN][3]获取市场总览信息,从[雅虎金融][4]获得个股报价,股票报价信息它自己会在终端内周期性更新。 + +### 自定义Mop中的股票报价 ### + +让我们来试试自定义证券列表吧。对此,Mop提供了易于记忆的快捷键:‘+’用于添加一只新股,而‘-’则用于移除一只股票。 + +要添加新股,请按‘+’,然后输入股票代码来添加(如MSFT)。你可以通过输入一个由逗号分隔的交易代码列表来一次添加多个股票(如”MSFT, AMZN, TSLA”)。 + +![](https://farm1.staticflickr.com/636/20648164441_642ae33a22_c.jpg) + +从列表中移除股票可以类似地按‘-’来完成。 + +### 对Mop中的股票报价排序 ### + +你可以基于任何栏目对股票报价列表进行排序。要排序,请按‘o’,然后使用左/右键来选择排序的基准栏目。当选定了一个特定栏目后,你可以按回车来对列表进行升序排序,或者降序排序。 + +![](https://farm1.staticflickr.com/724/20648164481_15631eefcf_c.jpg) + +通过按‘g’,你可以根据股票当日的涨或跌来分组。涨的情况以绿色表示,跌的情况以白色表示。 + +![](https://c2.staticflickr.com/6/5633/20615252696_a5bd44d3aa_b.jpg) + +如果你想要访问帮助页,只需要按‘?’。 + +![](https://farm1.staticflickr.com/573/20632365342_da196b657f_c.jpg) + +### 尾声 ### + +正如你所见,Mop是一个轻量级的,然而极其方便的证券监控工具。当然,你可以很轻松地从其它别的什么地方,从在线站点,你的智能手机等等访问到股票报价信息。然而,如果你在终端环境中花费大量时间,Mop可以很容易地适应你的工作空间,希望没有让你过多地从你的公罗流程中分心。只要让它在你其中一个终端中运行并保持市场日期持续更新,就让它在那干着吧。 + +交易快乐! + +-------------------------------------------------------------------------------- + +via: http://xmodulo.com/monitor-stock-quotes-command-line-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://xmodulo.com/author/nanni +[1]:https://github.com/michaeldv/mop +[2]:http://ask.xmodulo.com/install-go-language-linux.html +[3]:http://money.cnn.com/data/markets/ +[4]:http://finance.yahoo.com/ From ec95766dae136d277438da8d53d59186df375fa4 Mon Sep 17 00:00:00 2001 From: bazz2 Date: Mon, 24 Aug 2015 12:36:06 +0800 Subject: [PATCH 420/507] [translated by bazz2]Docker Working on Security Components Live Container Migration --- ...ity Components Live Container Migration.md | 54 ------------------- ...ity Components Live Container Migration.md | 53 ++++++++++++++++++ 2 files changed, 53 insertions(+), 54 deletions(-) delete mode 100644 sources/talk/20150818 Docker Working on Security Components Live Container Migration.md create mode 100644 translated/talk/20150818 Docker Working on Security Components Live Container Migration.md diff --git a/sources/talk/20150818 Docker Working on Security Components Live Container Migration.md b/sources/talk/20150818 Docker Working on Security Components Live Container Migration.md deleted file mode 100644 index 356c6f943c..0000000000 --- a/sources/talk/20150818 Docker Working on Security Components Live Container Migration.md +++ /dev/null @@ -1,54 +0,0 @@ -[bazz2 translating] -Docker Working on Security Components, Live Container Migration -================================================================================ -![Docker Container Talk](http://www.eweek.com/imagesvr_ce/1905/290x195DockerMarianna.jpg) - -**Docker developers take the stage at Containercon and discuss their work on future container innovations for security and live migration.** - -SEATTLE—Containers are one of the hottest topics in IT today and at the Linuxcon USA event here there is a co-located event called Containercon, dedicated to this virtualization technology. - -Docker, the lead commercial sponsor of the open-source Docker effort brought three of its top people to the keynote stage today, but not Docker founder Solomon Hykes. - -Hykes who delivered a Linuxcon keynote in 2014 was in the audience though, as Senior Vice President of Engineering Marianna Tessel, Docker security chief Diogo Monica and Docker chief maintainer Michael Crosby presented what's new and what's coming in Docker. - -Tessel emphasized that Docker is very real today and used in production environments at some of the largest organizations on the planet, including the U.S. Government. Docker also is working in small environments too, including the Raspberry Pi small form factor ARM computer, which now can support up to 2,300 containers on a single device. - -"We're getting more powerful and at the same time Docker will also get simpler to use," Tessel said. - -As a metaphor, Tessel said that the whole Docker experience is much like a cruise ship, where there is powerful and complex machinery that powers the ship, yet the experience for passengers is all smooth sailing. - -One area that Docker is trying to make easier is security. Tessel said that security is mind-numbingly complex for most people as organizations constantly try to avoid network breaches. - -That's where Docker Content Trust comes into play, which is a configurable feature in the recent Docker 1.8 release. Diogo Mónica, security lead for Docker joined Tessel on stage and said that security is a hard topic, which is why Docker content trust is being developed. - -With Docker Content Trust there is a verifiable way to make sure that a given Docker application image is authentic. There also are controls to limit fraud and potential malicious code injection by verifying application freshness. - -To prove his point, Monica did a live demonstration of what could happen if Content Trust is not enabled. In one instance, a Website update is manipulated to allow the demo Web app to be defaced. When Content Trust is enabled, the hack didn't work and was blocked. - -"Don't let the simple demo fool you," Tessel said. "You have seen the best security possible." - -One area where containers haven't been put to use before is for live migration, which on VMware virtual machines is a technology called vMotion. It's an area that Docker is currently working on. - -Docker chief maintainer Michael Crosby did an onstage demonstration of a live migration of Docker containers. Crosby referred to the approach as checkpoint and restore, where a running container gets a checkpoint snapshot and is then restored to another location. - -A container also can be cloned and then run in another location. Crosby humorously referred to his cloned container as "Dolly," a reference to the world's first cloned animal, Dolly the sheep. - -Tessel also took time to talk about the RunC component of containers, which is now a technology component that is being developed by the Open Containers Initiative as a multi-stakeholder process. With RunC, containers expand beyond Linux to multiple operating systems including Windows and Solaris. - -Overall, Tessel said that she can't predict the future of Docker, though she is very optimistic. - -"I'm not sure what the future is, but I'm sure it'll be out of this world," Tessel said. - -Sean Michael Kerner is a senior editor at eWEEK and InternetNews.com. Follow him on Twitter @TechJournalist. - --------------------------------------------------------------------------------- - -via: http://www.eweek.com/virtualization/docker-working-on-security-components-live-container-migration.html - -作者:[Sean Michael Kerner][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.eweek.com/cp/bio/Sean-Michael-Kerner/ diff --git a/translated/talk/20150818 Docker Working on Security Components Live Container Migration.md b/translated/talk/20150818 Docker Working on Security Components Live Container Migration.md new file mode 100644 index 0000000000..bd3f0451c7 --- /dev/null +++ b/translated/talk/20150818 Docker Working on Security Components Live Container Migration.md @@ -0,0 +1,53 @@ +Docker Working on Security Components, Live Container Migration +================================================================================ +![Docker Container Talk](http://www.eweek.com/imagesvr_ce/1905/290x195DockerMarianna.jpg) + +**Docker 开发者在 Containercon 上的演讲,谈论将来的容器在安全和实时迁移方面的创新** + +来自西雅图的消息。当前 IT 界最热的词汇是“容器”,美国有两大研讨会:Linuxcon USA 和 Containercon,后者就是为容器而生的。 + +Docker 公司是开源 Docker 项目的商业赞助商,本次研讨会这家公司有 3 位高管带来主题演讲,但公司创始人 Solomon Hykes 没上场演讲。 + +Hykes 曾在 2014 年的 Linuxcon 上进行过一次主题演讲,但今年的 Containeron 他只坐在观众席上。而工程部高级副总裁 Marianna Tessel、Docker 首席安全员 Diogo Monica 和核心维护员 Michael Crosby 为我们演讲 Docker 新增的功能和将来会有的功能。 + +Tessel 强调 Docker 现在已经被很多世界上最大的组织用在生产环境中,包括美国政府。Docker 也被用在小环境中,比如树莓派,一块树莓派上可以跑 2300 个容器。 + +“Docker 的功能正在变得越来越强大,而部署方法变得越来越简单。”Tessel 在会上说道。 + +Tessel 把 Docker 形容成一艘游轮,内部由强大而复杂的机器驱动,外部为乘客提供平稳航行的体验。 + +Docker 试图解决的领域是简化安全配置。Tessel 认为对于大多数用户和组织来说,避免网络漏洞所涉及的安全问题是一个乏味而且复杂的过程。 + +于是 Docker Content Trust 就出现在 Docker 1.8 release 版本中了。安全项目领导 Diogo Mónica 中加入 Tessel 上台讨论,说安全是一个难题,而 Docker Content Trust 就是为解决这个难道而存在的。 + +Docker Content Trusst 提供一种方法来验证一个 Docker 应用是否可信,以及多种方法来限制欺骗和病毒注入。 + +为了证明他的观点,Monica 做了个现场示范,演示 Content Trust 的效果。在一个实验中,一个网站在更新过程中其 Web App 被人为攻破,而当 Content Trust 启动后,这个黑客行为再也无法得逞。 + +“不要被这个表面上简单的演示欺骗了,”Tessel 说道,“你们看的是最安全的可行方案。” + +Docker 以前没有实现的领域是实时迁移,这个技术在 VMware 虚拟机中叫做 vMotion,而现在,Docker 也实现了这个功能。 + +Docker 首席维护员 Micheal Crosby 在台上做了个实时迁移的演示,Crosby 把这个过程称为快照和恢复:首先从运行中的容器拿到一个快照,之后将这个快照移到另一个地方恢复。 + +一个容器也可以克隆到另一个地方,Crosby 将他的克隆容器称为“多利”,就是世界上第一只被克隆出来的羊的名字。 + +Tessel 也花了点时间聊了下 RunC 组件,这是个正在被 Open Container Initiative 作为多方开发的项目,目的是让窗口兼容 Linux、Windows 和 Solaris。 + +Tessel 总结说她不知道 Docker 的未来是什么样,但对此抱非常乐观的态度。 + +“我不确定未来是什么样的,但我很确定 Docker 会在这个世界中脱颖而出”,Tessel 说的。 + +Sean Michael Kerner 是 eWEEK 和 InternetNews.com 网站的高级编辑,可通过推特 @TechJournalist 关注他。 + +-------------------------------------------------------------------------------- + +via: http://www.eweek.com/virtualization/docker-working-on-security-components-live-container-migration.html + +作者:[Sean Michael Kerner][a] +译者:[bazz2](https://github.com/bazz2) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.eweek.com/cp/bio/Sean-Michael-Kerner/ From ac233258c71eb2db6d53f037eed36ef9ef67789c Mon Sep 17 00:00:00 2001 From: DeadFire Date: Mon, 24 Aug 2015 14:18:37 +0800 Subject: [PATCH 421/507] =?UTF-8?q?20150824-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...Open Source Collaborative Editing Tools.md | 228 ++++++++++++++++++ ...out to gain a new file system--bcachefs.md | 25 ++ ... NetworkManager Command Line Tool Nmcli.md | 153 ++++++++++++ ...u 15.04 to connect to Android or iPhone.md | 74 ++++++ 4 files changed, 480 insertions(+) create mode 100644 sources/share/20150824 Great Open Source Collaborative Editing Tools.md create mode 100644 sources/talk/20150824 Linux about to gain a new file system--bcachefs.md create mode 100644 sources/tech/20150824 Basics Of NetworkManager Command Line Tool Nmcli.md create mode 100644 sources/tech/20150824 How to create an AP in Ubuntu 15.04 to connect to Android or iPhone.md diff --git a/sources/share/20150824 Great Open Source Collaborative Editing Tools.md b/sources/share/20150824 Great Open Source Collaborative Editing Tools.md new file mode 100644 index 0000000000..8f3ab16110 --- /dev/null +++ b/sources/share/20150824 Great Open Source Collaborative Editing Tools.md @@ -0,0 +1,228 @@ +Great Open Source Collaborative Editing Tools +================================================================================ +In a nutshell, collaborative writing is writing done by more than one person. There are benefits and risks of collaborative working. Some of the benefits include a more integrated / co-ordinated approach, better use of existing resources, and a stronger, united voice. For me, the greatest advantage is one of the most transparent. That's when I need to take colleagues' views. Sending files back and forth between colleagues is inefficient, causes unnecessary delays and leaves people (i.e. me) unhappy with the whole notion of collaboration. With good collaborative software, I can share notes, data and files, and use comments to share thoughts in real-time or asynchronously. Working together on documents, images, video, presentations, and tasks is made less of a chore. + +There are many ways to collaborate online, and it has never been easier. This article highlights my favourite open source tools to collaborate on documents in real time. + +Google Docs is an excellent productivity application with most of the features I need. It serves as a collaborative tool for editing documents in real time. Documents can be shared, opened, and edited by multiple users simultaneously and users can see character-by-character changes as other collaborators make edits. While Google Docs is free for individuals, it is not open source. + +Here is my take on the finest open source collaborative editors which help you focus on writing without interruption, yet work mutually with others. + +---------- + +### Hackpad ### + +![Hackpad in action](http://www.linuxlinks.com/portal/content/reviews/Editors/Screenshot-Hackpad.png) + +Hackpad is an open source web-based realtime wiki, based on the open source EtherPad collaborative document editor. + +Hackpad allows users to share your docs realtime and it uses color coding to show which authors have contributed to which content. It also allows in line photos, checklists and can also be used for coding as it offers syntax highlighting. + +While Dropbox acquired Hackpad in April 2014, it is only this month that the software has been released under an open source license. It has been worth the wait. + +Features include: + +- Very rich set of functions, similar to those offered by wikis +- Take collaborative notes, share data and files, and use comments to share your thoughts in real-time or asynchronously +- Granular privacy permissions enable you to invite a single friend, a dozen teammates, or thousands of Twitter followers +- Intelligent execution +- Directly embed videos from popular video sharing sites +- Tables +- Syntax highlighting for most common programming languages including C, C#, CSS, CoffeeScript, Java, and HTML + +- Website: [hackpad.com][1] +- Source code: [github.com/dropbox/hackpad][2] +- Developer: [Contributors][3] +- License: Apache License, Version 2.0 +- Version Number: - + +---------- + +### Etherpad ### + +![Etherpad in action](http://www.linuxlinks.com/portal/content/reviews/Editors/Screenshot-Etherpad.png) + +Etherpad is an open source web-based collaborative real-time editor, allowing authors to simultaneously edit a text document leave comments, and interact with others using an integrated chat. + +Etherpad is implemented in JavaScript, on top of the AppJet platform, with the real-time functionality achieved using Comet streaming. + +Features include: + +- Well designed spartan interface +- Simple text formatting features +- "Time slider" - explore the history of a pad +- Download documents in plain text, PDF, Microsoft Word, Open Document, and HTML +- Auto-saves the document at regular, short intervals +- Highly customizable +- Client side plugins extend the editor functionality +- Hundreds of plugins extend Etherpad including support for email notifications, pad management, authentication +- Accessibility enabled +- Interact with Pad contents in real time from within Node and from your CLI + +- Website: [etherpad.org][4] +- Source code: [github.com/ether/etherpad-lite][5] +- Developer: David Greenspan, Aaron Iba, J.D. Zamfiresc, Daniel Clemens, David Cole +- License: Apache License Version 2.0 +- Version Number: 1.5.7 + +---------- + +### Firepad ### + +![Firepad in action](http://www.linuxlinks.com/portal/content/reviews/Editors/Screenshot-Firepad.png) + +Firepad is an open source, collaborative text editor. It is designed to be embedded inside larger web applications with collaborative code editing added in only a few days. + +Firepad is a full-featured text editor, with capabilities like conflict resolution, cursor synchronization, user attribution, and user presence detection. It uses Firebase as a backend, and doesn't need any server-side code. It can be added to any web app. Firepad can use either the CodeMirror editor or the Ace editor to render documents, and its operational transform code borrows from ot.js. + +If you want to extend your web application capabilities by adding the simple document and code editor, Firepad is perfect. + +Firepad is used by several editors, including the Atlassian Stash Realtime Editor, Nitrous.IO, LiveMinutes, and Koding. + +Features include: + +- True collaborative editing +- Intelligent OT-based merging and conflict resolution +- Support for both rich text and code editing +- Cursor position synchronization +- Undo / redo +- Text highlighting +- User attribution +- Presence detection +- Version checkpointing +- Images +- Extend Firepad through its API +- Supports all modern browsers: Chrome, Safari, Opera 11+, IE8+, Firefox 3.6+ + +- Website: [www.firepad.io][6] +- Source code: [github.com/firebase/firepad][7] +- Developer: Michael Lehenbauer and the team at Firebase +- License: MIT +- Version Number: 1.1.1 + +---------- + +### OwnCloud Documents ### + +![ownCloud Documents in action](http://www.linuxlinks.com/portal/content/reviews/Editors/Screenshot-ownCloud.png) + +ownCloud Documents is an ownCloud app to work with office documents alone and/or collaboratively. It allows up to 5 individuals to collaborate editing .odt and .doc files in a web browser. + +ownCloud is a self-hosted file sync and share server. It provides access to your data through a web interface, sync clients or WebDAV while providing a platform to view, sync and share across devices easily. + +Features include: + +- Cooperative edit, with multiple users editing files simultaneously +- Document creation within ownCloud +- Document upload +- Share and edit files in the browser, and then share them inside ownCloud or through a public link +- ownCloud features like versioning, local syncing, encryption, undelete +- Seamless support for Microsoft Word documents by way of transparent conversion of file formats + +- Website: [owncloud.org][8] +- Source code: [github.com/owncloud/documents][9] +- Developer: OwnCloud Inc. +- License: AGPLv3 +- Version Number: 8.1.1 + +---------- + +### Gobby ### + +![Gobby in action](http://www.linuxlinks.com/portal/content/reviews/Editors/Screenshot-Gobby.png) + +Gobby is a collaborative editor supporting multiple documents in one session and a multi-user chat. All users could work on the file simultaneously without the need to lock it. The parts the various users write are highlighted in different colours and it supports syntax highlighting of various programming and markup languages. + +Gobby allows multiple users to edit the same document together over the internet in real-time. It integrates well with the GNOME environment. It features a client-server architecture which supports multiple documents in one session, document synchronisation on request, password protection and an IRC-like chat for communication out of band. Users can choose a colour to highlight the text they have written in a document. + +A dedicated server called infinoted is also provided. + +Features include: + +- Full-fledged text editing capabilities including syntax highlighting using GtkSourceView +- Real-time, lock-free collaborative text editing through encrypted connections (including PFS) +- Integrated group chat +- Local group undo: Undo does not affect changes of remote users +- Shows cursors and selections of remote users +- Highlights text written by different users with different colors +- Syntax highlighting for most programming languages, auto indentation, configurable tab width +- Zeroconf support +- Encrypted data transfer including perfect forward secrecy (PFS) +- Sessions can be password-protected +- Sophisticated access control with Access Control Lists (ACLs) +- Highly configurable dedicated server +- Automatic saving of documents +- Advanced search and replace options +- Internationalisation +- Full Unicode support + +- Website: [gobby.github.io][10] +- Source code: [github.com/gobby][11] +- Developer: Armin Burgmeier, Philipp Kern and contributors +- License: GNU GPLv2+ and ISC +- Version Number: 0.5.0 + +---------- + +### OnlyOffice ### + +![OnlyOffice in action](http://www.linuxlinks.com/portal/content/reviews/Editors/Screenshot-OnlyOffice.png) + +ONLYOFFICE (formerly known as Teamlab Office) is a multifunctional cloud online office suite integrated with CRM system, document and project management toolset, Gantt chart and email aggregator. + +It allows you to organize business tasks and milestones, store and share your corporate or personal documents, use social networking tools such as blogs and forums, as well as communicate with your team members via corporate IM. + +Manage documents, projects, team and customer relations in one place. OnlyOffice combines text, spreadsheet and presentation editors that include features similar to Microsoft desktop editors (Word, Excel and PowerPoint), but then allow to co-edit, comment and chat in real time. + +OnlyOffice is written in ASP.NET, based on HTML5 Canvas element, and translated to 21 languages. + +Features include: + +- As powerful as a desktop editor when working with large documents, paging and zooming +- Document sharing in view / edit modes +- Document embedding +- Spreadsheet and presentation editors +- Co-editing +- Commenting +- Integrated chat +- Mobile applications +- Gantt charts +- Time management +- Access right management +- Invoicing system +- Calendar +- Integration with file storage systems: Google Drive, Box, OneDrive, Dropbox, OwnCloud +- Integration with CRM, email aggregator and project management module +- Mail server +- Mail aggregator +- Edit documents, spreadsheets and presentations of the most popular formats: DOC, DOCX, ODT, RTF, TXT, XLS, XLSX, ODS, CSV, PPTX, PPT, ODP + +- Website: [www.onlyoffice.com][12] +- Source code: [github.com/ONLYOFFICE/DocumentServer][13] +- Developer: Ascensio System SIA +- License: GNU GPL v3 +- Version Number: 7.7 + +-------------------------------------------------------------------------------- + +via: http://www.linuxlinks.com/article/20150823085112605/CollaborativeEditing.html + +作者:Frazer Kline +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[1]:https://hackpad.com/ +[2]:https://github.com/dropbox/hackpad +[3]:https://github.com/dropbox/hackpad/blob/master/CONTRIBUTORS +[4]:http://etherpad.org/ +[5]:https://github.com/ether/etherpad-lite +[6]:http://www.firepad.io/ +[7]:https://github.com/firebase/firepad +[8]:https://owncloud.org/ +[9]:http://github.com/owncloud/documents/ +[10]:https://gobby.github.io/ +[11]:https://github.com/gobby +[12]:https://www.onlyoffice.com/free-edition.aspx +[13]:https://github.com/ONLYOFFICE/DocumentServer \ No newline at end of file diff --git a/sources/talk/20150824 Linux about to gain a new file system--bcachefs.md b/sources/talk/20150824 Linux about to gain a new file system--bcachefs.md new file mode 100644 index 0000000000..df3cd14682 --- /dev/null +++ b/sources/talk/20150824 Linux about to gain a new file system--bcachefs.md @@ -0,0 +1,25 @@ +Linux about to gain a new file system – bcachefs +================================================================================ +A five year old file system built by Kent Overstreet, formerly of Google, is near feature complete with all critical components in place. Bcachefs boasts the performance and reliability of the widespread ext4 and xfs as well as the feature list similar to that of btrfs and zfs. Notable features include checksumming, compression, multiple devices, caching and eventually snapshots and other “nifty” features. + +Bcachefs started out as **bcache** which was a block caching layer, the evolution from bcache to a fully featured [copy-on-write][1] file system has been described as a metamorphosis. + +Responding to the self-imposed question “Yet another new filesystem? Why?” Kent Overstreet replies with the following “Well, years ago (going back to when I was still at Google), I and the other people working on bcache realized that what we were working on was, almost by accident, a good chunk of the functionality of a full blown filesystem – and there was a really clean and elegant design to be had there if we took it and ran with it. And a fast one – the main goal of bcachefs to match ext4 and xfs on performance and reliability, but with the features of btrfs/xfs.” + +Overstreet has invited people to use and test bcachefs out on their own systems. To find instructions to use bcachefs on your system check out the mailing list [announcement][2]. + +The file system situation on Linux is a fairly drawn out one, Fedora 16 for instance aimed to use btrfs instead of ext4 as the default file system, this switch still has not happened. Currently all of the Debian based distros, including Ubuntu, Mint and elementary OS, still use ext4 as their default file systems and none have even whispered about switching to a new default file system yet. + +-------------------------------------------------------------------------------- + +via: http://www.linuxveda.com/2015/08/22/linux-gain-new-file-system-bcachefs/ + +作者:[Paul Hill][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/paul_hill/ +[1]:https://en.wikipedia.org/wiki/Copy-on-write +[2]:https://lkml.org/lkml/2015/8/21/22 \ No newline at end of file diff --git a/sources/tech/20150824 Basics Of NetworkManager Command Line Tool Nmcli.md b/sources/tech/20150824 Basics Of NetworkManager Command Line Tool Nmcli.md new file mode 100644 index 0000000000..577411f58a --- /dev/null +++ b/sources/tech/20150824 Basics Of NetworkManager Command Line Tool Nmcli.md @@ -0,0 +1,153 @@ + Basics Of NetworkManager Command Line Tool, Nmcli +================================================================================ +![](http://1102047360.rsc.cdn77.org/wp-content/uploads/2015/08/networking1.jpg) + +### Introduction ### + +In this tutorial, we will discuss NetworkManager command line tool, aka **nmcli**, in CentOS / RHEL 7. Users who are using **ifconfig** should avoid this command in Centos 7. + +Lets configure some networking settings with nmcli utility. + +#### To get all address information of all interfaces connected with System #### + + [root@localhost ~]# ip addr show + +**Sample Output:** + + 1: lo: mtu 65536 qdisc noqueue state UNKNOWN + link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 + inet 127.0.0.1/8 scope host lo + valid_lft forever preferred_lft forever + inet6 ::1/128 scope host + valid_lft forever preferred_lft forever + 2: eno16777736: mtu 1500 qdisc pfifo_fast state UP qlen 1000 + link/ether 00:0c:29:67:2f:4c brd ff:ff:ff:ff:ff:ff + inet 192.168.1.51/24 brd 192.168.1.255 scope global eno16777736 + valid_lft forever preferred_lft forever + inet6 fe80::20c:29ff:fe67:2f4c/64 scope link + valid_lft forever preferred_lft forever + +#### To retrieve packets statistics related with connected interfaces #### + + [root@localhost ~]# ip -s link show eno16777736 + +**Sample Output:** + +![unxmen_(011)](http://www.unixmen.com/wp-content/uploads/2015/08/unxmen_0111.png) + +#### Get routing configuration #### + + [root@localhost ~]# ip route + +Sample Output: + + default via 192.168.1.1 dev eno16777736 proto static metric 100 + 192.168.1.0/24 dev eno16777736 proto kernel scope link src 192.168.1.51 metric 100 + +#### Analyze path for some host/website #### + + [root@localhost ~]# tracepath unixmen.com + +Output will be just like traceroute but in more managed form. + +![unxmen_0121](http://www.unixmen.com/wp-content/uploads/2015/08/unxmen_01211.png) + +### nmcli utility ### + +**Nmcli** is a very rich and flexible command line utility. some of the terms used in nmcli are: + +- **Device** – A network interface being used. +- **Connection** – A set of configuration settings, for a single device you can have multiple connections, you can switch between connections. + +#### Find out how many connections are available for how many devices #### + + [root@localhost ~]# nmcli connection show + +![unxmen_(013)](http://www.unixmen.com/wp-content/uploads/2015/08/unxmen_013.png) + +#### Get details of a specific connection #### + + [root@localhost ~]# nmcli connection show eno1 + +**Sample output:** + +![unxmen_(014)](http://www.unixmen.com/wp-content/uploads/2015/08/unxmen_0141.png) + +#### Get the Network device status #### + + [root@localhost ~]# nmcli device status + +---------- + + DEVICE TYPE STATE CONNECTION + eno16777736 ethernet connected eno1 + lo loopback unmanaged -- + +#### Create a new connection with “dhcp” #### + + [root@localhost ~]# nmcli connection add con-name "dhcp" type ethernet ifname eno16777736 + +Where, + +- **Connection add** – To add new connection +- **con-name** – connection name +- **type** – type of device +- **ifname** – interface name + +This command will add connection with dhcp protocol. + +**Sample output:** + + Connection 'dhcp' (163a6822-cd50-4d23-bb42-8b774aeab9cb) successfully added. + +#### Instead of assigning an IP via dhcp, you can add ip address as “static” #### + + [root@localhost ~]# nmcli connection add con-name "static" ifname eno16777736 autoconnect no type ethernet ip4 192.168.1.240 gw4 192.168.1.1 + +**Sample Output:** + + Connection 'static' (8e69d847-03d7-47c7-8623-bb112f5cc842) successfully added. + +**Update connection:** + + [root@localhost ~]# nmcli connection up eno1 + +Again Check, whether ip address is changed or not. + + [root@localhost ~]# ip addr show + +![unxmen_(015)](http://www.unixmen.com/wp-content/uploads/2015/08/unxmen_0151.png) + +#### Add DNS settings to Static connections. #### + + [root@localhost ~]# nmcli connection modify "static" ipv4.dns 202.131.124.4 + +#### Add additional DNS value. #### + +[root@localhost ~]# nmcli connection modify "static" +ipv4.dns 8.8.8.8 + +**Note**: For additional entries **+** symbol will be used and **+ipv4.dns** will be used instead on **ip4.dns** + +Put an additional ip address: + + [root@localhost ~]# nmcli connection modify "static" +ipv4.addresses 192.168.200.1/24 + +Refresh settings using command: + + [root@localhost ~]# nmcli connection up eno1 + +![unxmen_(016)](http://www.unixmen.com/wp-content/uploads/2015/08/unxmen_016.png) + +You will see, setting are effective now. + +That’s it. + +-------------------------------------------------------------------------------- + +via: http://www.unixmen.com/basics-networkmanager-command-line-tool-nmcli/ + +作者:Rajneesh Upadhyay +译者:[译者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/20150824 How to create an AP in Ubuntu 15.04 to connect to Android or iPhone.md b/sources/tech/20150824 How to create an AP in Ubuntu 15.04 to connect to Android or iPhone.md new file mode 100644 index 0000000000..a8e21419fb --- /dev/null +++ b/sources/tech/20150824 How to create an AP in Ubuntu 15.04 to connect to Android or iPhone.md @@ -0,0 +1,74 @@ +How to create an AP in Ubuntu 15.04 to connect to Android/iPhone +================================================================================ +I tried creating a wireless access point via Gnome Network Manager in 15.04 and was successful. I’m sharing the steps with our readers. Please note: you must have a wifi card which allows you to create an Access Point. If you want to know how to find that, type iw list in a terminal. + +If you don’t have iw installed, you can install iw in Ubuntu using the command sudo apt-get install iw. + +After you type iw list, look for supported interface section, where it should be a entry called AP like the one shown below: + +Supported interface modes: + +* IBSS +* managed +* AP +* AP/VLAN +* monitor +* mesh point + +Let’s see the steps in detail + +1. Disconnect WIFI. Get a an internet cable and plug into your laptop so that you are connected to a wired internet connection +1. Go to Network Icon on the top panel -> Edit Connections then click the Add button in the pop-up window +1. Choose Wi-Fi from the drop-down menu +1. Next, + +a. Type in a connection name e.g. Hotspot + +b. Type in a SSID e.g. Hotspot + +c. Select mode: Infrastructure + +d. Device MAC address: select your wireless card from drop-down menu + +![](http://i2.wp.com/www.linuxveda.com/wp-content/uploads/2015/08/ubuntu-ap-gnome1.jpg) + +1. Go to Wi-Fi Security tab, select security type WPA & WPA2 Personal and set a password +1. Go to IPv4 Settings tab, from Method drop-down box, select Shared to other computers + +![](http://i1.wp.com/www.linuxveda.com/wp-content/uploads/2015/08/ubuntu-ap-gnome4.jpg) + +1. Go to IPv6 tab and set Method to ignore (do this only if you do not use IPv6) +1. Hit the “Save” button to save the configuration +1. Open a terminal from the menu/dash +1. Now, edit the connection with you just created via network settings + +VIM editor: + + sudo vim /etc/NetworkManager/system-connections/Hotspot + +Gedit: + + gksu gedit /etc/NetworkManager/system-connections/Hotspot + +Replace name Hotspot with the connection name you have given in step 4 + +![](http://i2.wp.com/www.linuxveda.com/wp-content/uploads/2015/08/ubuntu-ap-gnome2.jpg?resize=640%2C402) + +1. Change the line mode=infrastructure to mode=ap and save the file +1. Once you save the file, you should be able to see the wifi named Hotspot showing up in the list of available wifi networks. (If the network does not show, disable and enable wifi ) + +![](http://i1.wp.com/www.linuxveda.com/wp-content/uploads/2015/08/ubuntu-ap-gnome3.jpg?resize=290%2C375) + +1. You can now connect your Android phone. Connection tested using Xioami Mi4i running Android 5.0 (Downloaded 1GB to test speed and reliability) + +-------------------------------------------------------------------------------- + +via: http://www.linuxveda.com/2015/08/23/how-to-create-an-ap-in-ubuntu-15-04-to-connect-to-androidiphone/ + +作者:[Sayantan Das][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/sayantan_das/ \ No newline at end of file From 90c65877863ed475a05d0e87023217510503e4ee Mon Sep 17 00:00:00 2001 From: DeadFire Date: Mon, 24 Aug 2015 14:47:25 +0800 Subject: [PATCH 422/507] =?UTF-8?q?20150824-2=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...aving Fun With Linux Terminal In Ubuntu.md | 37 +++ ...ice Found Error After Installing Ubuntu.md | 97 ++++++++ ...gari Support In Antergos And Arch Linux.md | 47 ++++ ...phyr Test Management Tool on CentOS 7.x.md | 233 ++++++++++++++++++ 4 files changed, 414 insertions(+) create mode 100644 sources/share/20150824 Watch These Kids Having Fun With Linux Terminal In Ubuntu.md create mode 100644 sources/tech/20150824 Fix No Bootable Device Found Error After Installing Ubuntu.md create mode 100644 sources/tech/20150824 How To Add Hindi And Devanagari Support In Antergos And Arch Linux.md create mode 100644 sources/tech/20150824 How to Setup Zephyr Test Management Tool on CentOS 7.x.md diff --git a/sources/share/20150824 Watch These Kids Having Fun With Linux Terminal In Ubuntu.md b/sources/share/20150824 Watch These Kids Having Fun With Linux Terminal In Ubuntu.md new file mode 100644 index 0000000000..6adcbbc3bc --- /dev/null +++ b/sources/share/20150824 Watch These Kids Having Fun With Linux Terminal In Ubuntu.md @@ -0,0 +1,37 @@ +Watch These Kids Having Fun With Linux Terminal In Ubuntu +================================================================================ +I found this short video of children having fun with Linux terminals in their computer lab at school. I do not know where do they belong to, but I guess it is either in Indonesia or Malaysia. + +注:youtube 视频 + + +### Run train in Linux terminal ### + +There is no magic here. It’s just a small command line fun tool called ‘sl’. I presume that it was developed entirely to have some fun when command ls is wrongly typed. If you ever worked on Linux terminal, you know that ls is one of the most commonly used commands and perhaps one of the most frequently mis-typed command as well. + +If you want to have little fun with this terminal train, you can install it using the following command: + + sudo apt-get install sl + +To run the terminal train, just type **sl** in the terminal. It also has the following options: + +- -a : Accident mode. You can see people crying help +- -l : shows a smaller train but with more coaches +- -F : A flying train +- -e : Allows interrupt by Ctrl+C. In other mode you cannot use Ctrl+C to stop the train. But then, it doesn’t run for long. + +Normally, you should hear the whistle as well but it doesn’t work in most of the Linux OS, Ubuntu 14.04 being one of them. Here is the accidental terminal train :) + +![Linux Terminal Train](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/04/Linux_Terminal_Train.jpeg) + +-------------------------------------------------------------------------------- + +via: http://itsfoss.com/ubuntu-terminal-train/ + +作者:[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/ \ No newline at end of file diff --git a/sources/tech/20150824 Fix No Bootable Device Found Error After Installing Ubuntu.md b/sources/tech/20150824 Fix No Bootable Device Found Error After Installing Ubuntu.md new file mode 100644 index 0000000000..3281a51137 --- /dev/null +++ b/sources/tech/20150824 Fix No Bootable Device Found Error After Installing Ubuntu.md @@ -0,0 +1,97 @@ +Fix No Bootable Device Found Error After Installing Ubuntu +================================================================================ +Usually, I dual boot Ubuntu and Windows but this time I decided to go for a clean Ubuntu installation i.e. eliminating Windows completely. After the clean install of Ubuntu, I ended up with a screen saying **no bootable device found** instead of the Grub screen. Clearly, the installation messed up with the UEFI boot settings. + +![No Bootable Device Found After Installing Ubuntu](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/08/No_Bootable_Device_Found_1.jpg) + +I am going to show you how I fixed **no bootable device found error after installing Ubuntu in Acer laptops**. It is important that I mention that I am using Acer Aspire R13 because we have to change things in firmware settings and those settings might look different from manufacturer to manufacturer and from device to device. + +So before you go on trying the steps mentioned here, let’s first see what state my computer was in during this error: + +- My Acer Aspire R13 came preinstalled with Windows 8.1 and with UEFI boot manager +- Secure boot was not turned off (my laptop has just come from repair and the service guy had put the secure boot on again, I did not know until I ran up in the problem). You can read this post to know [how disable secure boot in Acer laptops][1] +- I chose to install Ubuntu by erasing everything i.e. existing Windows 8.1, various partitions etc. +- After installing Ubuntu, I saw no bootable device found error while booting from the hard disk. Booting from live USB worked just fine + +In my opinion, not disabling the secure boot was the reason of this error. However, I have no data to backup my claim. It is just a hunch. Interestingly, dual booting Windows and Linux often ends up in common Grub issues like these two: + +- [error: no such partition grub rescue][2] +- [Minimal BASH like line editing is supported][3] + +If you are in similar situation, you can try the fix which worked for me. + +### Fix no bootable device found error after installing Ubuntu ### + +Pardon me for poor quality images. My OnePlus camera seems to be not very happy with my laptop screen. + +#### Step 1 #### + +Turn the power off and boot into boot settings. I had to press Fn+F2 (to press F2 key) on Acer Aspire R13 quickly. You have to be very quick with it if you are using SSD hard disk because SSDs are very fast in booting. Depending upon your manufacturer/model, you might need to use Del or F10 or F12 keys. + +#### Step 2 #### + +In the boot settings, make sure that Secure Boot is turned on. It should be under the Boot tab. + +#### Step 3 #### + +Go to Security tab and look for “Select an UEFI file as trusted for executing” and click enter. + +![Fix no bootable device found ](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/08/No_Bootable_Device_Found_2.jpg) + +Just for your information, what we are going to do here is to add the UEFI settings file (it was generated while Ubuntu installation) among the trusted UEFI boots in your device. If you remember, UEFI boot’s main aim is to provide security and since Secure Boot was not disabled (perhaps) the device did not intend to boot from the newly installed OS. Adding it as trusted, kind of whitelisting, will let the device boot from the Ubuntu UEFI file. + +#### Step 4 #### + +You should see your hard disk like HDD0 etc here. If you have more than one hard disk, I hope you remember where did you install Ubuntu. Press Enter here as well. + +![Fix no bootable device found in boot settings](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/08/No_Bootable_Device_Found_3.jpg) + +#### Step 5 #### + +You should see here. Press enter. + +![Fix settings in UEFI](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/08/No_Bootable_Device_Found_4.jpg) + +#### Step 6 #### + +You’ll see in next screen. Don’t get impatient, you are almost there + +![Fixing boot error after installing Ubuntu](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/08/No_Bootable_Device_Found_5.jpg) + +#### Step 7 #### + +You’ll see shimx64.efi, grubx64.efi and MokManager.efi file here. The important one is shimx64.efi here. Select it and click enter. + + +![Fix no bootable device found](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/08/No_Bootable_Device_Found_6.jpg) + +In next screen, type Yes and click enter. + +![No_Bootable_Device_Found_7](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/08/No_Bootable_Device_Found_7.jpg) + +#### Step 8 #### + +Once we have added it as trused EFI file to be executed, press F10 to save and exit. + +![Save and exist firmware settings](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/08/No_Bootable_Device_Found_8.jpg) + +Reboot your system and this time you should be seeing the familiar Grub screen. Even if you do not see Grub screen, you should at least not be seeing “no bootable device found” screen anymore. You should be able to boot into Ubuntu. + +If your Grub screen was messed up after the fix but you got to login into it, you can reinstall Grub to boot into the familiar purple Grub screen of Ubuntu. + +I hope this tutorial helped you to fix no bootable device found error. Any questions or suggestions or a word of thanks is always welcomed. + +-------------------------------------------------------------------------------- + +via: http://itsfoss.com/no-bootable-device-found-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/disable-secure-boot-in-acer/ +[2]:http://itsfoss.com/solve-error-partition-grub-rescue-ubuntu-linux/ +[3]:http://itsfoss.com/fix-minimal-bash-line-editing-supported-grub-error-linux/ \ No newline at end of file diff --git a/sources/tech/20150824 How To Add Hindi And Devanagari Support In Antergos And Arch Linux.md b/sources/tech/20150824 How To Add Hindi And Devanagari Support In Antergos And Arch Linux.md new file mode 100644 index 0000000000..db36df66e6 --- /dev/null +++ b/sources/tech/20150824 How To Add Hindi And Devanagari Support In Antergos And Arch Linux.md @@ -0,0 +1,47 @@ +How To Add Hindi And Devanagari Support In Antergos And Arch Linux +================================================================================ +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/08/Indian-languages.jpg) + +You might be knowing by now that I have been trying my hands on [Antergos Linux][1] lately. One of the first few things I noticed after installing [Antergos][2] was that **Hindi scripts were not displayed properly** in the default chromium browser. + +This is a strange thing that I never encountered before in my desktop Linux experience ever. First, I thought maybe it could be a browser problem so I went on to install Firefox only to see the same story repeated. Firefox also could not display Hindi properly. Unlike Chromium that displayed nothing, Firefox did display something but it was not readable. + +![No hindi support in Arch Linux based Antergos](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/08/Hindi_Support_Antergos_Arch_linux_1.jpeg) + +Hindi display in Chromium + +![No hindi support in Arch Linux based Antergos](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/08/Hindi_Support_Antergos_Arch_linux_2.jpeg) + +Hindi display in Firefox + +Strange? So no Hindi support in Arch based Antergos Linux by default? I did not verify, but I presume that it would be the same for other Indian languages etc that are also based on Devanagari script. + +I this quick tutorial, I am going to show you how to add Devanagari support so that Hindi and other Indian languages are displayed properly. + +### Add Indian language support in Antergos and Arch Linux ### + +Open a terminal and use the following command: + + sudo yaourt -S ttf-indic-otf + +Enter the password. And it will provide rendering support for Indian languages. + +Restarting Firefox displayed Hindi correctly immediately, but it took a restart to display Hindi. For that reason, I advise that you **restart your system** after installing the Indian fonts. + +![Adding Hindi display support in Arch based Antergos Linux](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/08/Hindi_Support_Antergos_Arch_linux_4.jpeg) + +I hope tis quick helped you to read Hindi, Sanskrit, Tamil, Telugu, Malayalam, Bangla and other Indian languages in Antergos and other Arch based Linux distros such as Manjaro Linux. + +-------------------------------------------------------------------------------- + +via: http://itsfoss.com/display-hindi-arch-antergos/ + +作者:[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://antergos.com/ +[2]:http://itsfoss.com/tag/antergos/ \ No newline at end of file diff --git a/sources/tech/20150824 How to Setup Zephyr Test Management Tool on CentOS 7.x.md b/sources/tech/20150824 How to Setup Zephyr Test Management Tool on CentOS 7.x.md new file mode 100644 index 0000000000..b4014bb009 --- /dev/null +++ b/sources/tech/20150824 How to Setup Zephyr Test Management Tool on CentOS 7.x.md @@ -0,0 +1,233 @@ +How to Setup Zephyr Test Management Tool on CentOS 7.x +================================================================================ +Test Management encompasses anything and everything that you need to do as testers. Test management tools are used to store information on how testing is to be done, plan testing activities and report the status of quality assurance activities. So in this article we will illustrate you about the setup of Zephyr test management tool that includes everything needed to manage the test process can save testers hassle of installing separate applications that are necessary for the testing process. Once you have done with its setup you will be able to track bugs, defects and allows the project tasks for collaboration with your team as you can easily share and access the data across multiple project teams for communication and collaboration throughout the testing process. + +### Requirements for Zephyr ### + +We are going to install and run Zephyr under the following set of its minimum resources. Resources can be enhanced as per your infrastructure requirements. We will be installing Zephyr on the CentOS-7 64-bit while its binary distributions are available for almost all Linux operating systems. + +注:表格 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Zephyr test management tool
Linux OSCentOS Linux 7 (Core), 64-bit
PackagesJDK 7 or above ,  Oracle JDK 6 updateNo Prior Tomcat, MySQL installed
RAM4 GBPreferred 8 GB
CPU2.0 GHZ or Higher
Hard Disk30 GB , Atleast 5GB must be free
+ +You must have super user (root) access to perform the installation process for Zephyr and make sure that you have properly configured yout network with static IP address and its default set of ports must be available and allowed in the firewall where as the Port 80/443, 8005, 8009, 8010 will used by tomcat and Port 443 or 2099 will used within Zephyr by flex for the RTMP protocol. + +### Install Java JDK 7 ### + +Java JDK 7 is the basic requirement for the installation of Zephyr, if its not already installed in your operating system then do the following to install Java and setup its JAVA_HOME environment variables to be properly configured. + +Let’s issue the below commands to install Java JDK 7. + + [root@centos-007 ~]# yum install java-1.7.0-openjdk-1.7.0.79-2.5.5.2.el7_1 + +---------- + + [root@centos-007 ~]# yum install java-1.7.0-openjdk-devel-1.7.0.85-2.6.1.2.el7_1.x86_64 + +Once your java is installed including its required dependencies, run the following commands to set its JAVA_HOME environment variables. + + [root@centos-007 ~]# export JAVA_HOME=/usr/java/default + [root@centos-007 ~]# export PATH=/usr/java/default/bin:$PATH + +Now check the version of java to verify its installation with following command. + + [root@centos-007 ~]# java –version + +---------- + + java version "1.7.0_79" + OpenJDK Runtime Environment (rhel-2.5.5.2.el7_1-x86_64 u79-b14) + OpenJDK 64-Bit Server VM (build 24.79-b02, mixed mode) + +The output shows that we we have successfully installed OpenJDK Java verion 1.7.0_79. + +### Install MySQL 5.6.X ### + +If you have other MySQLs on the machine then it is recommended to remove them and +install this version on top of them or upgrade their schemas to what is specified. As this specific major/minor (5.6.X) version of MySQL is required with the root username as a prerequisite of Zephyr. + +To install MySQL 5.6 on CentOS-7.1 lets do the following steps: + +Download the rpm package, which will create a yum repo file for MySQL Server installation. + + [root@centos-007 ~]# yum install wget + [root@centos-007 ~]# wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm + +Now Install this downloaded rpm package by using rpm command. + + [root@centos-007 ~]# rpm -ivh mysql-community-release-el7-5.noarch.rpm + +After the installation of this package you will get two new yum repo related to MySQL. Then by using yum command, now we will install MySQL Server 5.6 and all dependencies will be installed itself. + + [root@centos-007 ~]# yum install mysql-server + +Once the installation process completes, run the following commands to start mysqld services and check its status whether its active or not. + + [root@centos-007 ~]# service mysqld start + [root@centos-007 ~]# service mysqld status + +On fresh installation of MySQL Server. The MySQL root user password is blank. +For good security practice, we should reset the password MySQL root user. + +Connect to MySQL using the auto-generated empty password and change the +root password. + + [root@centos-007 ~]# mysql + mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('your_password'); + mysql> flush privileges; + mysql> quit; + +Now we need to configure the required database parameters in the default configuration file of MySQL. Let's open its file located in "/etc/" folder and update it as follow. + + [root@centos-007 ~]# vi /etc/my.cnf + +---------- + + [mysqld] + datadir=/var/lib/mysql + socket=/var/lib/mysql/mysql.sock + symbolic-links=0 + + sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES + max_allowed_packet=150M + max_connections=600 + default-storage-engine=INNODB + character-set-server=utf8 + collation-server=utf8_unicode_ci + + [mysqld_safe] + log-error=/var/log/mysqld.log + pid-file=/var/run/mysqld/mysqld.pid + default-storage-engine=INNODB + character-set-server=utf8 + collation-server=utf8_unicode_ci + + [mysql] + max_allowed_packet = 150M + [mysqldump] + quick + +Save the changes made in the configuration file and restart mysql services. + + [root@centos-007 ~]# service mysqld restart + +### Download Zephyr Installation Package ### + +We done with installation of required packages necessary to install Zephyr. Now we need to get the binary distributed package of Zephyr and its license key. Go to official download link of Zephyr that is http://download.yourzephyr.com/linux/download.php give your email ID and click to download. + +![Zephyr Download](http://blog.linoxide.com/wp-content/uploads/2015/08/13.png) + +Then and confirm your mentioned Email Address and you will get the Zephyr Download link and its License Key link. So click on the provided links and choose the appropriate version of your Operating system to download the binary installation package and its license file to the server. + +We have placed it in the home directory and modify its permissions to make it executable. + +![Zephyr Binary](http://blog.linoxide.com/wp-content/uploads/2015/08/22.png) + +### Start Zephyr Installation and Configuration ### + +Now we are ready to start the installation of Zephyr by executing its binary installation script as below. + + [root@centos-007 ~]# ./zephyr_4_7_9213_linux_setup.sh –c + +Once you run the above command, it will check for the Java environment variables to be properly setup and configured. If there's some mis-configuration you might the error like. + + testing JVM in /usr ... + Starting Installer ... + Error : Either JDK is not found at expected locations or JDK version is mismatched. + Zephyr requires Oracle Java Development Kit (JDK) version 1.7 or higher. + +Once you have properly configured your Java, then it will start installation of Zephyr and asks to press "o" to proceed and "c" to cancel the setup. Let's type "o" and press "Enter" key to start installation. + +![install zephyr](http://blog.linoxide.com/wp-content/uploads/2015/08/32.png) + +The next option is to review all the requirements for the Zephyr setup and Press "Enter" to move forward to next option. + +![zephyr requirements](http://blog.linoxide.com/wp-content/uploads/2015/08/42.png) + +To accept the license agreement type "1" and Press Enter. + + I accept the terms of this license agreement [1], I do not accept the terms of this license agreement [2, Enter] + +Here we need to choose the appropriate destination location where we want to install the zephyr and choose the default ports, if you want to choose other than default ports, you are free to mention here. + +![installation folder](http://blog.linoxide.com/wp-content/uploads/2015/08/52.png) + +Then customize the mysql database parameters and give the right paths to the configurations file. You might the an error at this point as shown below. + + Please update MySQL configuration. Configuration parameter max_connection should be at least 500 (max_connection = 500) and max_allowed_packet should be at least 50MB (max_allowed_packet = 50M). + +To overcome this error make sure that you have configure the "max_connection" and "max_allowed_packet" limits properly in the mysql configuration file. So confirm these settings, connect to mysql server and run the commands as shown. + +![mysql connections](http://blog.linoxide.com/wp-content/uploads/2015/08/62.png) + +Once you have configured your mysql database properly, it will extract the configuration files to complete the setup. + +![mysql customization](http://blog.linoxide.com/wp-content/uploads/2015/08/72.png) + +The installation process completes with successful installation of Zephyr 4.7 on your computer. To Launch Zephyr Desktop type "y" to finish Zephyr installation. + +![launch zephyr](http://blog.linoxide.com/wp-content/uploads/2015/08/82.png) + +### Launch Zephyr Desktop ### + +Open your web browser to launch Zephyr Desktop with your localhost IP adress and you will be direted to the Zephyr Desktop. + + http://your_server_IP/zephyr/desktop/ + +![Zephyr Desktop](http://blog.linoxide.com/wp-content/uploads/2015/08/91.png) + +From your Zephyr Dashboard click on the "Test Manager" and login with the dault user name and password that is "test.manager". + +![Test Manage Login](http://blog.linoxide.com/wp-content/uploads/2015/08/test_manager_login.png) + +Once you are loged in you will be able to configure your administrative settings as shown. So choose the settings you wish to put according to your environment. + +![Test Manage Administration](http://blog.linoxide.com/wp-content/uploads/2015/08/test_manage_admin.png) + +Save the settings after you have done with your administrative settings, similarly do the settings of resources management and project setup and start using Zephyr as a complete set of your testing management tool. You check and edit the status of your administrative settings from the Department Dashboard Management as shown. + +![zephyr dashboard](http://blog.linoxide.com/wp-content/uploads/2015/08/dashboard.png) + +### Conclusion ### + +Cheers! we have done with the complete setup of Zephyr installation setup on Centos 7.1. We hope you are now much aware of Zephyr Test management tool which offer the prospect of streamlining the testing process and allow quick access to data analysis, collaborative tools and easy communication across multiple project teams. Feel free to comment us if you find any difficulty while you are doing it in your environment. + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/linux-how-to/setup-zephyr-tool-centos-7-x/ + +作者:[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 d29562dafcdb2241616dd46beff562c2107f80ca Mon Sep 17 00:00:00 2001 From: DeadFire Date: Mon, 24 Aug 2015 15:24:44 +0800 Subject: [PATCH 423/507] =?UTF-8?q?20150824-3=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ng before CoreOS and the Atomic Project.md | 92 +++++++++ ...artition into One Large Virtual Storage.md | 186 ++++++++++++++++++ 2 files changed, 278 insertions(+) create mode 100644 sources/talk/20150824 LinuxCon exclusive--Mark Shuttleworth says Snappy was born long before CoreOS and the Atomic Project.md create mode 100644 sources/tech/20150824 Mhddfs--Combine Several Smaller Partition into One Large Virtual Storage.md diff --git a/sources/talk/20150824 LinuxCon exclusive--Mark Shuttleworth says Snappy was born long before CoreOS and the Atomic Project.md b/sources/talk/20150824 LinuxCon exclusive--Mark Shuttleworth says Snappy was born long before CoreOS and the Atomic Project.md new file mode 100644 index 0000000000..2c45b6064b --- /dev/null +++ b/sources/talk/20150824 LinuxCon exclusive--Mark Shuttleworth says Snappy was born long before CoreOS and the Atomic Project.md @@ -0,0 +1,92 @@ +LinuxCon exclusive: Mark Shuttleworth says Snappy was born long before CoreOS and the Atomic Project +================================================================================ +![](http://images.techhive.com/images/article/2015/08/mark-100608730-primary.idge.jpg) + +Mark Shuttleworth at LinuxCon Credit: Swapnil Bhartiya + +> Mark Shuttleworth, founder of Canonical and Ubuntu, made a surprise visit at LinuxCon. I sat down with him for a video interview and talked about Ubuntu on IBM’s new LinuxONE systems, Canonical’s plans for containers, open source in the enterprise space and much more. + +### You made a surprise entry during the keynote. What brought you to LinuxCon? ### + +**Mark Shuttleworth**: I am here at LinuxCon to support IBM and Canonical in their announcement of Ubuntu on their new Linux-only super-high-end mainframe LinuxONE. These are the biggest machines in the world, purpose-built to run only Linux. And we will be bringing Ubuntu to them, which is a real privilege for us and is going to be incredible for developers. + +![mark selfie](http://images.techhive.com/images/article/2015/08/mark-selfie-100608731-large.idge.jpg) + +Swapnil Bhartiya + +Mark Shuttleworth and Swapnil Bhartiya, mandatory selfie at LinuxCon + +### Only Red Hat and SUSE were supported on it. Why was Ubuntu missing from the mainframe scene? ### + +**Mark**: Ubuntu has always been about developers. It has been about enabling the free software platform from where it is collaboratively built to be available at no cost to developers in the world, so they are limited only by their imagination—not by money, not by geography. + +There was an incredible story told today about a 12-year-old kid who started out with Ubuntu; there are incredible stories about people building giant businesses with Ubuntu. And for me, being able to empower people, whether they come from one part of the world or another to express their ideas on free software, is what Ubuntu is all about. It's been a journey for us essentially, going to the platforms those developers care about, and just in the last year, we suddenly saw a flood of requests from companies who run mainframes, who are using Ubuntu for their infrastructure—70% of OpenStack deployments are on Ubuntu. Those same people said, “Look, there is the mainframe, and we like to unleash it and think of it as a region in the cloud.” So when IBM started talking to us, saying that they have this project in the works, it felt like a very natural fit: You are going to be able to take your Ubuntu laptop, build code there and ship it straight to every cloud, every virtualization environment, every bare metal in every architecture including the mainframe, and that's going to be beautiful. + +### Will Canonical be offering support for these systems? ### + +**Mark**: Yes. Ubuntu on z Systems is going to be completely supported. We will make long-term commitments to that. The idea is to bring together scale-out-fast cloud-like workloads, which is really born on Ubuntu; 70% of workloads on Amazon and other public clouds run on Ubuntu. Now you can think of running that on a mainframe if that makes sense to you. + +We are going to provide exactly the same platform that we do on the cloud, and we are going to provide that on the mainframe as well. We are also going to expose it to the OpenStack API so you can consume it on a mainframe with exactly the same tools and exactly the same processes that you would consume on a laptop, or OpenStack or public cloud resources. So all of the things that Ubuntu builds to make your life easy as a developer are going to be available across that full range of platforms and systems, and all of that is commercially supported. + +### Canonical is doing a lot of things: It is into enterprise, and it’s in the consumer space with mobile and desktop. So what is the core focus of Canonical now? ### + +**Mark**: The trick for us is to enable the reuse of specifically the same parts [of our technology] in as many useful ways as possible. So if you look at the work that we do at z Systems, it's absolutely defined by the work that we do on the cloud. We want to deliver exactly the same libraries on exactly the same date for the mainframe as we do for public clouds and for x86, ARM and Power servers today. + +We don't allow Ubuntu or our focus to fragment very dramatically because we don't allow different products managers to find Ubuntu in different ways in different environments. We just want to bring that standard experience that developers love to this new environment. + +Similarly if you look at the work we are doing on IoT [Internet of Things], Snappy Ubuntu is the heart of the phone. It’s the phone without the GUI. So the definitions, the tools, the kernels, the mechanisms are shared across those projects. So we are able to multiply the impact of the work. We have an incredible community, and we try to enable the community to do things that they want to do that we can’t do. So that's why we have so many buntus, and it's kind of incredible for me to see what they do with that. + +We also see the community climbing in. We see hundreds of developers working with Snappy for IoT, and we see developers working with Snappy on mobile, for personal computing as convergence becomes real. And, of course, there is the cloud server story: 70% of the world is Ubuntu, so there is a huge audience. We don't have to do all the work that we do; we just have to be open and willing to, kind of, do the core infrastructure and then reuse it as efficiently as possible. + +### Is Snappy a response to Atomic or CoreOS? ### + +**Mark**: Snappy as a project was born four years ago when we started working on the phone, which was long before the CoreOS, long before Atomic. I think the principles of atomicity, transactionality are beautiful, but remember: We needed to build the same things for the phone. And with Snappy, we have the ability to deliver transactional updates to any of these systems—phones, servers and cloud devices. + +Of course, it feels a little different because in order to provide those guarantees, we have to shape the system in such a way that we can guarantee the guarantees. And that's why Snappy is snappy; it's a new thing. It's not based on an old packaging system. Though we will keep both of them: All Snaps for us that Canonical makes, the core snaps that define the OS, are all built from Debian packages. They are two different faces of the same coin for us, and developers will use them as tools. We use the right tools for the job. + +There are couple of key advantages for Snappy over CoreOS and Atomic, and the main one is this: We took the view that we wanted the base idea to be extensible. So with Snappy, the core operating system is tiny. You make all the choices, and you take all the decisions about things you want to bolt on that: you want to bolt on Docker; you want to bolt on Kubernete; you want to bolt on Mesos; you want to bolt on Lattice from Pivotal; you want to bolt on OpenStack. Those are the things you choose to add with Snappy. Whereas with Atomic and CoreOS, it's one blob and you have to do it exactly the way they want you to do it. You have to live with the versions of software and the choices they make. + +Whereas with Snappy, we really preserve this idea of the choices you have got in Ubuntu are now transactionally available on Snappy systems. That makes the core much smaller, and it gives you the choice of different container systems, different container management systems, different cloud infrastructure systems or different apps of every description. I think that's the winning idea. In fullness of time, people will realize that they wanted to make those choices themselves; they just want Canonical to do the work of providing the updates in a really efficient manner. + +### There is so much competition in the container space with Docker, Rocket and many other players. Where will Canonical stand amid this competition? ### + +**Mark**: Canonical is focused on platform tools, and we see things like the Rocket and Docker as things super-useful for developers; we just make sure that those work best on Ubuntu. Docker, for years, ran only Ubuntu because we work very closely with them, and we are glad now that it's available everywhere else. But if you look at the numbers, the vast majority of Docker containers are on Ubuntu. Because we work really hard, as developers, you get the best experience with all of these tools on Ubuntu. We don't want to try and control everything, and it’s great for us to have those guys competing. + +I think in the end people will see that there is really two kinds of containers. 1) There are cases where a container is just like a VM machine. It feels like a whole machine, it runs all processes, all the logs and cron jobs are there. It's like a VM, just that it's much cheaper, much lighter, much faster, and that's LXD. 2) And then there would be process containers, which are like Docker or Rocket; they are there to run a specific application very fast. I think we lead the world in general machine container story, which is our hypervisor LXD, and I think Docker leads the story when it comes to applications containers, process containers. And those two work together really beautifully. + +### Microsoft and Canonical are working together on LXD? Can you tell us about this engagement? ### + +Mark: LXD is two things. First, it's an implementation on top of Canonical's work on the kernel so that you can start to create full machine containers on any host. But it's also a REST API. That’s the transitions from LXC to LXD. We got a daemon there so you can talk to the daemon over the network, if it's listening on the network, and says tell me about the containers on that machine, tell me about the file systems on that machine, the networks on that machine, start or stop the container. + +So LXD becomes a distributed hypervisor effectively. Very interestingly, last week Microsoft announced that they like REST API. It is very clean, very simple, very well engineered, and they are going to implement the same API for Windows machines. It's completely cross-platform, which means you will be able to talk to any machine—Linux or Windows. So it gives you very clean and simple APIs to talk about containers on any host on the network. + +Of course, we have led the work in [OpenStack to bind LXD to Nova][1], which is the control system to compute in OpenStack, so that's how we create a whole cloud with OpenStack API with the individual VMs being actually containers, so much denser, much faster, much lighter, much cheaper. + +### Open Source is becoming a norm in the enterprise segment. What do you think is driving the adoption of open source in the enterprise? ### + +**Mark**: The reason why open source has become so popular in the enterprise is because it enables them to go faster. We are all competing at some level, and if you can't make progress because you have to call up some vendor, you can't dig in and help yourself go faster, then you feel frustrated. And given the choice between frustration and at least the ability to dig into a problem, enterprises over time will always choose to give themselves the ability to dig in and help themselves. So that is why open source is phenomenal. + +I think it goes a bit deeper than that. I think people have started to realize as much as we compete, 99% of what we need to do is shared, and there is something meaningful about contributing to something that is shared. As I have seen Ubuntu go from something that developers love, to something that CIOs love that developers love Ubuntu. As that happens, it's not a one-way ticket. They often want to say how can we help contribute to make this whole thing go faster. + +We have always seen a curve of complexity, and open source has traditionally been higher up on the curve of complexity and therefore considered threatening or difficult or too uncertain for people who are not comfortable with the complexity. What's wonderful to me is that many open source projects have identified that as a blocker for their own future. So in Ubuntu we have made user experience, design and “making it easy” a first-class goal. We have done the same for OpenStack. With Ubuntu tools for OpenStack anybody can build an OpenStack cloud in an hour, and if you want, that cloud can run itself, scale itself, manage itself, can deal with failures. It becomes something you can just fire up and forget, which also makes it really cheap. It also makes it something that's not a distraction, and so by making open source easier and easier, we are broadening its appeal to consumers and into the enterprise and potentially into the government. + +### How open are governments to open source? Can you tell us about the utilization of open source by governments, especially in the U.S.? ### + +**Mark**: I don't track the usage in government, but part of government utilization in the modern era is the realization that how untrustworthy other governments might be. There is a desire for people to be able to say, “Look, I want to review or check and potentially self-build all the things that I depend on.” That's a really important mission. At the end of the day, some people see this as a game where maybe they can get something out of the other guy. I see it as a game where we can make a level playing field, where everybody gets to compete. I have a very strong interest in making sure that Ubuntu is trustworthy, which means the way we build it, the way we run it, the governance around it is such that people can have confidence in it as an independent thing. + +### You are quite vocal about freedom, privacy and other social issues on Google+. How do you see yourself, your company and Ubuntu playing a role in making the world a better place? ### + +**Mark**: The most important thing for us to do is to build confidence in trusted platforms, platforms that are freely available but also trustworthy. At any given time, there will always be people who can make arguments about why they should have access to something. But we know from history that at the end of the day, due process of law, justice, doesn't depend on the abuse of privacy, abuse of infrastructure, the abuse of data. So I am very strongly of the view that in the fullness of time, all of the different major actors will come to the view that their primary interest is in having something that is conceptually trustworthy. This isn't about what America can steal from Germany or what China can learn in Russia. This is about saying we’re all going to be able to trust our infrastructure; that's a generational journey. But I believe Ubuntu can be right at the center of people's thinking about that. + +-------------------------------------------------------------------------------- + +via: http://www.itworld.com/article/2973116/linux/linuxcon-exclusive-mark-shuttleworth-says-snappy-was-born-long-before-coreos-and-the-atomic-project.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://wiki.openstack.org/wiki/HypervisorSupportMatrix \ No newline at end of file diff --git a/sources/tech/20150824 Mhddfs--Combine Several Smaller Partition into One Large Virtual Storage.md b/sources/tech/20150824 Mhddfs--Combine Several Smaller Partition into One Large Virtual Storage.md new file mode 100644 index 0000000000..6815fa64d8 --- /dev/null +++ b/sources/tech/20150824 Mhddfs--Combine Several Smaller Partition into One Large Virtual Storage.md @@ -0,0 +1,186 @@ +Mhddfs – Combine Several Smaller Partition into One Large Virtual Storage +================================================================================ +Let’s assume that you have 30GB of movies and you have 3 drives each 20 GB in size. So how will you store? + +Obviously you can split your videos in two or three different volumes and store them on the drive manually. This certainly is not a good idea, it is an exhaustive work which requires manual intervention and a lots of your time. + +Another solution is to create a [RAID array of disk][1]. The RAID has always remained notorious for loss of storage reliability and usable disk space. Another solution is mhddfs. + +![Combine Multiple Partitions in Linux](http://www.tecmint.com/wp-content/uploads/2015/08/Combine-Multiple-Partitions-in-Linux.png) + +Mhddfs – Combine Multiple Partitions in Linux + +mhddfs is a driver for Linux that combines several mount points into one virtual disk. It is a fuse based driver, which provides a easy solution for large data storage. It combines all small file systems to create a single big virtual filesystem which contains every particle of its member filesystem including files and free spaces. + +#### Why you need Mhddfs? #### + +All your storage devices creates a single virtual pool and it can be mounted right at the boot. This small utility takes care of, which drive is full and which is empty and to write data to what drive, intelligently. Once you create virtual drives successfully, you can share your virtual filesystem using [SAMBA][2]. Your client will always see a huge drive and lots of free space. + +#### Features of Mhddfs #### + +- Get attributes of the file system and system information. +- Set attributes of the file system. +- Create, Read, Remove and write Directories and files. +- Support for file locks and Hardlinks on single device. + +注:表格 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Pros of mhddfsCons of mhddfs
 Perfect for home users.mhddfs driver is not built in the Linux Kernel
 Simple to run. Required lots of processing power during runtime
 No evidence of Data loss No redundancy solution.
 Do not split the file. Hardlinks moving not supported
 Add new files to the combined virtual filesystem. 
 Manage the location where these files are saved. 
  Extended file attributes 
+ +### Installation of Mhddfs in Linux ### + +On Debian and portable to alike systems, you can install mhddfs package using following command. + + # apt-get update && apt-get install mhddfs + +![Install Mhddfs on Debian based Systems](http://www.tecmint.com/wp-content/uploads/2015/08/Install-Mhddfs-on-Ubuntu.png) + +Install Mhddfs on Debian based Systems + +On RHEL/CentOS Linux systems, you need to turn on [epel-repository][3] and then execute the below command to install mhddfs package. + + # yum install mhddfs + +On Fedora 22+ systems, you may get it by dnf package manger as shown below. + + # dnf install mhddfs + +![Install Mhddfs on Fedora](http://www.tecmint.com/wp-content/uploads/2015/08/Install-Mhddfs-on-Fedora.png) + +Install Mhddfs on Fedora + +If incase, mhddfs package isn’t available from epel repository, then you need to resolve following dependencies to install and compile it from source as shown below. + +- FUSE header files +- GCC +- libc6 header files +- uthash header files +- libattr1 header files (optional) + +Next, download the latest source package simply as suggested below and compile it. + + # wget http://mhddfs.uvw.ru/downloads/mhddfs_0.1.39.tar.gz + # tar -zxvf mhddfs*.tar.gz + # cd mhddfs-0.1.39/ + # make + +You should be able to see binary mhddfs in the current directory. Move it to /usr/bin/ and /usr/local/bin/ as root. + + # cp mhddfs /usr/bin/ + # cp mhddfs /usr/local/bin/ + +All set, mhddfs is ready to be used. + +### How do I use Mhddfs? ### + +1. Lets see all the HDD mounted to my system currently. + + $ df -h + +![Check Mounted Devices](http://www.tecmint.com/wp-content/uploads/2015/08/Check-Mounted-Devices.gif) + +**Sample Output** + + Filesystem Size Used Avail Use% Mounted on + + /dev/sda1 511M 132K 511M 1% /boot/efi + /dev/sda2 451G 92G 336G 22% / + /dev/sdb1 1.9T 161G 1.7T 9% /media/avi/BD9B-5FCE + /dev/sdc1 555M 555M 0 100% /media/avi/Debian 8.1.0 M-A 1 + +Notice the ‘Mount Point‘ name here, which we will be using later. + +2. Create a directory `/mnt/virtual_hdd` where all these all file system will be grouped together as, + + # mkdir /mnt/virtual_hdd + +3. And then mount all the file-systems. Either as root or as a user who is a member of FUSE group. + + # mhddfs /boot/efi, /, /media/avi/BD9B-5FCE/, /media/avi/Debian\ 8.1.0\ M-A\ 1/ /mnt/virtual_hdd -o allow_other + +![Mount All File System in Linux](http://www.tecmint.com/wp-content/uploads/2015/08/Mount-All-File-System-in-Linux.png) + +Mount All File System in Linux + +**Note**: We are used mount Point names here of all the HDDs. Obviously the mount point in your case will be different. Also notice “-o allow_other” option makes this Virtual file system visible to all others and not only the person who created it. + +4. Now run “df -h” see all the filesystems. It should contain the one you created just now. + + $ df -h + +![Verify Virtual File System Mount](http://www.tecmint.com/wp-content/uploads/2015/08/Verify-Virtual-File-System.png) + +Verify Virtual File System Mount + +You can perform all the option to the Virtual File System you created as you would have done to a Mounted Drive. + +5. To create this Virtual File system on every system boot, you should add the below line of code (in your case it should be different, depending upon your mount point), at the end of /etc/fstab file as root. + + mhddfs# /boot/efi, /, /media/avi/BD9B-5FCE/, /media/avi/Debian\ 8.1.0\ M-A\ 1/ /mnt/virtual_hdd fuse defaults,allow_other 0 0 + +6. If at any point of time you want to add/remove a new drive to Virtual_hdd, you may mount a new drive, copy the contents of mount point /mnt/virtual_hdd, un-mount the volume, Eject the Drive you want to remove and/or mount the new drive you want to include, Mount the overall filesystem under Virtual_hdd using mhddfs command and you should be done. + +#### How do I Un-Mount Virtual_hdd? #### + +Unmounting virtual_hdd is as easy as, + + # umount /mnt/virtual_hdd + +![Unmount Virtual Filesystem](http://www.tecmint.com/wp-content/uploads/2015/08/Unmount-Virtual-Filesystem.png) + +Unmount Virtual Filesystem + +Notice it is umount and not unmount. A lot of user type it wrong. + +That’s all for now. I am working on another post you people will love to read. 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/combine-partitions-into-one-in-linux-using-mhddfs/ + +作者:[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/understanding-raid-setup-in-linux/ +[2]:http://www.tecmint.com/mount-filesystem-in-linux/ +[3]:http://www.tecmint.com/how-to-enable-epel-repository-for-rhel-centos-6-5/ \ No newline at end of file From 401102481e8c4ae48d054704c1e1e8d32e3bd3d9 Mon Sep 17 00:00:00 2001 From: wxy Date: Mon, 24 Aug 2015 17:35:32 +0800 Subject: [PATCH 424/507] PUB:Part 1 - Introduction to RAID, Concepts of RAID and RAID Levels MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @strugglingyouth 有些地方原文有误,应根据理解修正。 --- ... RAID, Concepts of RAID and RAID Levels.md | 156 ++++++++++++++++++ ... RAID, Concepts of RAID and RAID Levels.md | 146 ---------------- 2 files changed, 156 insertions(+), 146 deletions(-) create mode 100644 published/Part 1 - Introduction to RAID, Concepts of RAID and RAID Levels.md delete mode 100644 translated/tech/RAID/Part 1 - Introduction to RAID, Concepts of RAID and RAID Levels.md diff --git a/published/Part 1 - Introduction to RAID, Concepts of RAID and RAID Levels.md b/published/Part 1 - Introduction to RAID, Concepts of RAID and RAID Levels.md new file mode 100644 index 0000000000..d54e794459 --- /dev/null +++ b/published/Part 1 - Introduction to RAID, Concepts of RAID and RAID Levels.md @@ -0,0 +1,156 @@ +在 Linux 下使用 RAID(一):介绍 RAID 的级别和概念 +================================================================================ + +RAID 的意思是廉价磁盘冗余阵列(Redundant Array of Inexpensive Disks),但现在它被称为独立磁盘冗余阵列(Redundant Array of Independent Drives)。早先一个容量很小的磁盘都是非常昂贵的,但是现在我们可以很便宜的买到一个更大的磁盘。Raid 是一系列放在一起,成为一个逻辑卷的磁盘集合。 + +![RAID in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/RAID.jpg) + +*在 Linux 中理解 RAID 设置* + +RAID 包含一组或者一个集合甚至一个阵列。使用一组磁盘结合驱动器组成 RAID 阵列或 RAID 集。将至少两个磁盘连接到一个 RAID 控制器,而成为一个逻辑卷,也可以将多个驱动器放在一个组中。一组磁盘只能使用一个 RAID 级别。使用 RAID 可以提高服务器的性能。不同 RAID 的级别,性能会有所不同。它通过容错和高可用性来保存我们的数据。 + +这个系列被命名为“在 Linux 下使用 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 的性能较高。他们采用 PCI Express 卡物理地提供有专用的 RAID 控制器。它不会使用主机资源。他们有 NVRAM 用于缓存的读取和写入。缓存用于 RAID 重建时,即使出现电源故障,它会使用后备的电池电源保持缓存。对于大规模使用是非常昂贵的投资。 + +硬件 RAID 卡如下所示: + +![Hardware RAID](http://www.tecmint.com/wp-content/uploads/2014/10/Hardware-RAID.jpg) + +*硬件 RAID* + +#### 重要的 RAID 概念 #### + +- **校验**方式用在 RAID 重建中从校验所保存的信息中重新生成丢失的内容。 RAID 5,RAID 6 基于校验。 +- **条带化**是将切片数据随机存储到多个磁盘。它不会在单个磁盘中保存完整的数据。如果我们使用2个磁盘,则每个磁盘存储我们的一半数据。 +- **镜像**被用于 RAID 1 和 RAID 10。镜像会自动备份数据。在 RAID 1 中,它会保存相同的内容到其他盘上。 +- **热备份**只是我们的服务器上的一个备用驱动器,它可以自动更换发生故障的驱动器。在我们的阵列中,如果任何一个驱动器损坏,热备份驱动器会自动用于重建 RAID。 +- **块**是 RAID 控制器每次读写数据时的最小单位,最小 4KB。通过定义块大小,我们可以增加 I/O 性能。 + +RAID有不同的级别。在这里,我们仅列出在真实环境下的使用最多的 RAID 级别。 + +- RAID0 = 条带化 +- RAID1 = 镜像 +- RAID5 = 单磁盘分布式奇偶校验 +- RAID6 = 双磁盘分布式奇偶校验 +- RAID10 = 镜像 + 条带。(嵌套RAID) + +RAID 在大多数 Linux 发行版上使用名为 mdadm 的软件包进行管理。让我们先对每个 RAID 级别认识一下。 + +#### RAID 0 / 条带化 #### + +![](https://upload.wikimedia.org/wikipedia/commons/thumb/9/9b/RAID_0.svg/150px-RAID_0.svg.png) + +条带化有很好的性能。在 RAID 0(条带化)中数据将使用切片的方式被写入到磁盘。一半的内容放在一个磁盘上,另一半内容将被写入到另一个磁盘。 + +假设我们有2个磁盘驱动器,例如,如果我们将数据“TECMINT”写到逻辑卷中,“T”将被保存在第一盘中,“E”将保存在第二盘,'C'将被保存在第一盘,“M”将保存在第二盘,它会一直继续此循环过程。(LCTT 译注:实际上不可能按字节切片,是按数据块切片的。) + +在这种情况下,如果驱动器中的任何一个发生故障,我们就会丢失数据,因为一个盘中只有一半的数据,不能用于重建 RAID。不过,当比较写入速度和性能时,RAID 0 是非常好的。创建 RAID 0(条带化)至少需要2个磁盘。如果你的数据是非常宝贵的,那么不要使用此 RAID 级别。 + +- 高性能。 +- RAID 0 中容量零损失。 +- 零容错。 +- 写和读有很高的性能。 + +#### RAID 1 / 镜像化 #### + +![](https://upload.wikimedia.org/wikipedia/commons/thumb/b/b7/RAID_1.svg/150px-RAID_1.svg.png) + +镜像也有不错的性能。镜像可以对我们的数据做一份相同的副本。假设我们有两个2TB的硬盘驱动器,我们总共有4TB,但在镜像中,但是放在 RAID 控制器后面的驱动器形成了一个逻辑驱动器,我们只能看到这个逻辑驱动器有2TB。 + +当我们保存数据时,它将同时写入这两个2TB驱动器中。创建 RAID 1(镜像化)最少需要两个驱动器。如果发生磁盘故障,我们可以通过更换一个新的磁盘恢复 RAID 。如果在 RAID 1 中任何一个磁盘发生故障,我们可以从另一个磁盘中获取相同的数据,因为另外的磁盘中也有相同的数据。所以是零数据丢失。 + +- 良好的性能。 +- 总容量丢失一半可用空间。 +- 完全容错。 +- 重建会更快。 +- 写性能变慢。 +- 读性能变好。 +- 能用于操作系统和小规模的数据库。 + +#### RAID 5 / 分布式奇偶校验 #### + +![](https://upload.wikimedia.org/wikipedia/commons/thumb/6/64/RAID_5.svg/300px-RAID_5.svg.png) + +RAID 5 多用于企业级。 RAID 5 的以分布式奇偶校验的方式工作。奇偶校验信息将被用于重建数据。它从剩下的正常驱动器上的信息来重建。在驱动器发生故障时,这可以保护我们的数据。 + +假设我们有4个驱动器,如果一个驱动器发生故障而后我们更换发生故障的驱动器后,我们可以从奇偶校验中重建数据到更换的驱动器上。奇偶校验信息存储在所有的4个驱动器上,如果我们有4个 1TB 的驱动器。奇偶校验信息将被存储在每个驱动器的256G中,而其它768GB是用户自己使用的。单个驱动器故障后,RAID 5 依旧正常工作,如果驱动器损坏个数超过1个会导致数据的丢失。 + +- 性能卓越 +- 读速度将非常好。 +- 写速度处于平均水准,如果我们不使用硬件 RAID 控制器,写速度缓慢。 +- 从所有驱动器的奇偶校验信息中重建。 +- 完全容错。 +- 1个磁盘空间将用于奇偶校验。 +- 可以被用在文件服务器,Web服务器,非常重要的备份中。 + +#### RAID 6 双分布式奇偶校验磁盘 #### + +![](https://upload.wikimedia.org/wikipedia/commons/thumb/7/70/RAID_6.svg/300px-RAID_6.svg.png) + +RAID 6 和 RAID 5 相似但它有两个分布式奇偶校验。大多用在大数量的阵列中。我们最少需要4个驱动器,即使有2个驱动器发生故障,我们依然可以更换新的驱动器后重建数据。 + +它比 RAID 5 慢,因为它将数据同时写到4个驱动器上。当我们使用硬件 RAID 控制器时速度就处于平均水准。如果我们有6个的1TB驱动器,4个驱动器将用于数据保存,2个驱动器将用于校验。 + +- 性能不佳。 +- 读的性能很好。 +- 如果我们不使用硬件 RAID 控制器写的性能会很差。 +- 从两个奇偶校验驱动器上重建。 +- 完全容错。 +- 2个磁盘空间将用于奇偶校验。 +- 可用于大型阵列。 +- 用于备份和视频流中,用于大规模。 + +#### RAID 10 / 镜像+条带 #### + +![](https://upload.wikimedia.org/wikipedia/commons/thumb/e/e6/RAID_10_01.svg/300px-RAID_10_01.svg.png) + +![](https://upload.wikimedia.org/wikipedia/commons/thumb/a/ad/RAID_01.svg/300px-RAID_01.svg.png) + +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) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/babinlonston/ 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 deleted file mode 100644 index 8ca0ecbd7e..0000000000 --- a/translated/tech/RAID/Part 1 - Introduction to RAID, Concepts of RAID and RAID Levels.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 43ec03e9126a76f442cb07c3a995670b8649d184 Mon Sep 17 00:00:00 2001 From: Jerry Ling Date: Mon, 24 Aug 2015 18:00:30 +0800 Subject: [PATCH 425/507] =?UTF-8?q?[20150824=20How=20to=20create=20an=20AP?= =?UTF-8?q?=20in=20Ubuntu=2015.04=20to=20connect=20to=20Android=20or=20iPh?= =?UTF-8?q?one]=20=E7=BF=BB=E8=AF=91=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 翻译完成 20150824 How to create an AP in Ubuntu 15.04 to connect to Android or iPhone --- ...u 15.04 to connect to Android or iPhone.md | 74 ------------------- 1 file changed, 74 deletions(-) delete mode 100644 sources/tech/20150824 How to create an AP in Ubuntu 15.04 to connect to Android or iPhone.md diff --git a/sources/tech/20150824 How to create an AP in Ubuntu 15.04 to connect to Android or iPhone.md b/sources/tech/20150824 How to create an AP in Ubuntu 15.04 to connect to Android or iPhone.md deleted file mode 100644 index a8e21419fb..0000000000 --- a/sources/tech/20150824 How to create an AP in Ubuntu 15.04 to connect to Android or iPhone.md +++ /dev/null @@ -1,74 +0,0 @@ -How to create an AP in Ubuntu 15.04 to connect to Android/iPhone -================================================================================ -I tried creating a wireless access point via Gnome Network Manager in 15.04 and was successful. I’m sharing the steps with our readers. Please note: you must have a wifi card which allows you to create an Access Point. If you want to know how to find that, type iw list in a terminal. - -If you don’t have iw installed, you can install iw in Ubuntu using the command sudo apt-get install iw. - -After you type iw list, look for supported interface section, where it should be a entry called AP like the one shown below: - -Supported interface modes: - -* IBSS -* managed -* AP -* AP/VLAN -* monitor -* mesh point - -Let’s see the steps in detail - -1. Disconnect WIFI. Get a an internet cable and plug into your laptop so that you are connected to a wired internet connection -1. Go to Network Icon on the top panel -> Edit Connections then click the Add button in the pop-up window -1. Choose Wi-Fi from the drop-down menu -1. Next, - -a. Type in a connection name e.g. Hotspot - -b. Type in a SSID e.g. Hotspot - -c. Select mode: Infrastructure - -d. Device MAC address: select your wireless card from drop-down menu - -![](http://i2.wp.com/www.linuxveda.com/wp-content/uploads/2015/08/ubuntu-ap-gnome1.jpg) - -1. Go to Wi-Fi Security tab, select security type WPA & WPA2 Personal and set a password -1. Go to IPv4 Settings tab, from Method drop-down box, select Shared to other computers - -![](http://i1.wp.com/www.linuxveda.com/wp-content/uploads/2015/08/ubuntu-ap-gnome4.jpg) - -1. Go to IPv6 tab and set Method to ignore (do this only if you do not use IPv6) -1. Hit the “Save” button to save the configuration -1. Open a terminal from the menu/dash -1. Now, edit the connection with you just created via network settings - -VIM editor: - - sudo vim /etc/NetworkManager/system-connections/Hotspot - -Gedit: - - gksu gedit /etc/NetworkManager/system-connections/Hotspot - -Replace name Hotspot with the connection name you have given in step 4 - -![](http://i2.wp.com/www.linuxveda.com/wp-content/uploads/2015/08/ubuntu-ap-gnome2.jpg?resize=640%2C402) - -1. Change the line mode=infrastructure to mode=ap and save the file -1. Once you save the file, you should be able to see the wifi named Hotspot showing up in the list of available wifi networks. (If the network does not show, disable and enable wifi ) - -![](http://i1.wp.com/www.linuxveda.com/wp-content/uploads/2015/08/ubuntu-ap-gnome3.jpg?resize=290%2C375) - -1. You can now connect your Android phone. Connection tested using Xioami Mi4i running Android 5.0 (Downloaded 1GB to test speed and reliability) - --------------------------------------------------------------------------------- - -via: http://www.linuxveda.com/2015/08/23/how-to-create-an-ap-in-ubuntu-15-04-to-connect-to-androidiphone/ - -作者:[Sayantan Das][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/sayantan_das/ \ No newline at end of file From 34c8df979a55aa0507c226d1bfcfc7efe1f5a8d5 Mon Sep 17 00:00:00 2001 From: Jerry Ling Date: Mon, 24 Aug 2015 19:22:45 +0800 Subject: [PATCH 426/507] =?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 --- ...u 15.04 to connect to Android or iPhone.md | 74 +++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 translated/tech/20150824 How to create an AP in Ubuntu 15.04 to connect to Android or iPhone.md diff --git a/translated/tech/20150824 How to create an AP in Ubuntu 15.04 to connect to Android or iPhone.md b/translated/tech/20150824 How to create an AP in Ubuntu 15.04 to connect to Android or iPhone.md new file mode 100644 index 0000000000..02aef62d82 --- /dev/null +++ b/translated/tech/20150824 How to create an AP in Ubuntu 15.04 to connect to Android or iPhone.md @@ -0,0 +1,74 @@ +如何在 Ubuntu 15.04 下创建连接至 Android/iOS 的 AP +================================================================================ +我成功地在 Ubuntu 15.04 下用 Gnome Network Manager 创建了一个无线AP热点. 接下来我要分享一下我的步骤. 请注意: 你必须要有一个可以用来创建AP热点的无线网卡. 如果你不知道如何找到连上了的设备的话, 在终端(Terminal)里输入`iw list`. + +如果你没有安装`iw`的话, 在Ubuntu下你可以使用`udo apt-get install iw`进行安装. + +在你键入`iw list`之后, 寻找可用的借口, 你应该会看到类似下列的条目: + +Supported interface modes: + +* IBSS +* managed +* AP +* AP/VLAN +* monitor +* mesh point + +让我们一步步看 + +1. 断开WIFI连接. 使用有线网络接入你的笔记本. +1. 在顶栏面板里点击网络的图标 -> Edit Connections(编辑连接) -> 在弹出窗口里点击Add(新增)按钮. +1. 在下拉菜单内选择Wi-Fi. +1. 接下来, + +a. 输入一个链接名 比如: Hotspot + +b. 输入一个 SSID 比如: Hotspot + +c. 选择模式(mode): Infrastructure + +d. 设备 MAC 地址: 在下拉菜单里选择你的无线设备 + +![](http://i2.wp.com/www.linuxveda.com/wp-content/uploads/2015/08/ubuntu-ap-gnome1.jpg) + +1. 进入Wi-Fi安全选项卡, 选择 WPA & WPA2 Personal 并且输入密码. +1. 进入IPv4设置选项卡, 在Method(方法)下拉菜单里, 选择Shared to other computers(共享至其他电脑). + +![](http://i1.wp.com/www.linuxveda.com/wp-content/uploads/2015/08/ubuntu-ap-gnome4.jpg) + +1. 进入IPv6选项卡, 在Method(方法)里设置为忽略ignore (只有在你不使用IPv6的情况下这么做) +1. 点击 Save(保存) 按钮以保存配置. +1. 从 menu/dash 里打开Terminal. +1. 修改你刚刚使用 network settings 创建的连接. + +使用 VIM 编辑器: + + sudo vim /etc/NetworkManager/system-connections/Hotspot + +使用Gedit 编辑器: + + gksu gedit /etc/NetworkManager/system-connections/Hotspot + +把名字 Hotspot 用你在第4步里起的连接名替换掉. + +![](http://i2.wp.com/www.linuxveda.com/wp-content/uploads/2015/08/ubuntu-ap-gnome2.jpg?resize=640%2C402) + +1. 把 `mode=infrastructure` 改成 `mode=ap` 并且保存文件 +1. 一旦你保存了这个文件, 你应该能在 Wifi 菜单里看到你刚刚建立的AP了. (如果没有的话请再顶栏里 关闭/打开 Wifi 选项一次) + +![](http://i1.wp.com/www.linuxveda.com/wp-content/uploads/2015/08/ubuntu-ap-gnome3.jpg?resize=290%2C375) + +1. 你现在可以把你的设备连上Wifi了. 已经过 Android 5.0的小米4测试.(下载了1GB的文件以测试速度与稳定性) + +-------------------------------------------------------------------------------- + +via: http://www.linuxveda.com/2015/08/23/how-to-create-an-ap-in-ubuntu-15-04-to-connect-to-androidiphone/ + +作者:[Sayantan Das][a] +译者:[jerryling315](https://github.com/jerryling315) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.linuxveda.com/author/sayantan_das/ From 8168cc7b2e85e9b26839ab33c45ac7a3bca579be Mon Sep 17 00:00:00 2001 From: struggling <630441839@qq.com> Date: Mon, 24 Aug 2015 22:13:59 +0800 Subject: [PATCH 427/507] Delete Part 5 - Setup RAID Level 6 (Striping with Double Distributed Parity) in Linux.md --- ...ith Double Distributed Parity) in Linux.md | 321 ------------------ 1 file changed, 321 deletions(-) delete mode 100644 sources/tech/RAID/Part 5 - Setup RAID Level 6 (Striping with Double Distributed Parity) in Linux.md 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 deleted file mode 100644 index ea1d5993c0..0000000000 --- a/sources/tech/RAID/Part 5 - Setup RAID Level 6 (Striping with Double Distributed Parity) in Linux.md +++ /dev/null @@ -1,321 +0,0 @@ -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. - -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 From cb66c17ac5617ef4f84b17efef743bed9fe83369 Mon Sep 17 00:00:00 2001 From: struggling <630441839@qq.com> Date: Mon, 24 Aug 2015 22:15:25 +0800 Subject: [PATCH 428/507] Create Part 5 - Setup RAID Level 6 (Striping with Double Distributed Parity) in Linux.md --- ...ith Double Distributed Parity) in Linux.md | 321 ++++++++++++++++++ 1 file changed, 321 insertions(+) create mode 100644 translated/tech/RAID/Part 5 - Setup RAID Level 6 (Striping with Double Distributed Parity) in Linux.md diff --git a/translated/tech/RAID/Part 5 - Setup RAID Level 6 (Striping with Double Distributed Parity) in Linux.md b/translated/tech/RAID/Part 5 - Setup RAID Level 6 (Striping with Double Distributed Parity) in Linux.md new file mode 100644 index 0000000000..1890a242e2 --- /dev/null +++ b/translated/tech/RAID/Part 5 - Setup RAID Level 6 (Striping with Double Distributed Parity) in Linux.md @@ -0,0 +1,321 @@ + +在 Linux 中安装 RAID 6(条带化双分布式奇偶校验) - 第5部分 +================================================================================ +RAID 6 是 RAID 5 的升级版,它有两个分布式奇偶校验,即时两个磁盘发生故障后依然有容错能力。两并列的磁盘发生故障时,系统的关键任务仍然能运行。它与 RAID 5 相似,但性能更健壮,因为它多用了一个磁盘来进行奇偶校验。 + +在之前的文章中,我们已经在 RAID 5 看了分布式奇偶校验,但在本文中,我们将看到的是 RAID 6 双分布式奇偶校验。不要期望比其他 RAID 有额外的性能,我们仍然需要安装一个专用的 RAID 控制器。在 RAID 6 中,即使我们失去了2个磁盘,我们仍可以取回数据通过更换磁盘,然后从校验中构建数据。 + +![Setup RAID 6 in CentOS](http://www.tecmint.com/wp-content/uploads/2014/11/Setup-RAID-6-in-Linux.jpg) + +在 Linux 中安装 RAID 6 + +要建立一个 RAID 6,一组最少需要4个磁盘。RAID 6 甚至在有些设定中会有多组磁盘,当读取数据时,它会同时从所有磁盘读取,所以读取速度会更快,当写数据时,因为它要将数据写在条带化的多个磁盘上,所以性能会较差。 + +现在,很多人都在讨论为什么我们需要使用 RAID 6,它的性能和其他 RAID 相比并不太好。提出这个问题首先需要知道的是,如果需要高容错的必须选择 RAID 6。在每一个对数据库的高可用性要求较高的环境中,他们需要 RAID 6 因为数据库是最重要,无论花费多少都需要保护其安全,它在视频流环境中也是非常有用的。 + +#### RAID 6 的的优点和缺点 #### + +- 性能很不错。 +- RAID 6 非常昂贵,因为它要求两个独立的磁盘用于奇偶校验功能。 +- 将失去两个磁盘的容量来保存奇偶校验信息(双奇偶校验)。 +- 不存在数据丢失,即时两个磁盘损坏。我们可以在更换损坏的磁盘后从校验中重建数据。 +- 读性能比 RAID 5 更好,因为它从多个磁盘读取,但对于没有专用的 RAID 控制器的设备写性能将非常差。 + +#### 要求 #### + +要创建一个 RAID 6 最少需要4个磁盘.你也可以添加更多的磁盘,但你必须有专用的 RAID 控制器。在软件 RAID 中,我们在 RAID 6 中不会得到更好的性能,所以我们需要一个物理 RAID 控制器。 + +这些是新建一个 RAID 需要的设置,我们建议先看完以下 RAID 文章。 + +- [Linux 中 RAID 的基本概念 – 第一部分][1] +- [在 Linux 上创建软件 RAID 0 (条带化) – 第二部分][2] +- [在 Linux 上创建软件 RAID 1 (镜像) – 第三部分][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 + +这篇文章是9系列 RAID 教程的第5部分,在这里我们将看到我们如何在 Linux 系统或者服务器上创建和设置软件 RAID 6 或条带化双分布式奇偶校验,使用四个 20GB 的磁盘 /dev/sdb, /dev/sdc, /dev/sdd 和 /dev/sde. + +### 第1步:安装 mdadm 工具,并检查磁盘 ### + +1.如果你按照我们最进的两篇 RAID 文章(第2篇和第3篇),我们已经展示了如何安装‘mdadm‘工具。如果你直接看的这篇文章,我们先来解释下在Linux系统中如何使用‘mdadm‘工具来创建和管理 RAID,首先根据你的 Linux 发行版使用以下命令来安装。 + + # yum install mdadm [on RedHat systems] + # apt-get install mdadm [on Debain systems] + +2.安装该工具后,然后来验证需要的四个磁盘,我们将会使用下面的‘fdisk‘命令来检验用于创建 RAID 的磁盘。 + + # fdisk -l | grep sd + +![Check Hard Disk in Linux](http://www.tecmint.com/wp-content/uploads/2014/11/Verify-Linux-Disks.png) + +在 Linux 中检查磁盘 + +3.在创建 RAID 磁盘前,先检查下我们的磁盘是否创建过 RAID 分区。 + + # 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) + +在磁盘上检查 Raid 分区 + +**注意**: 在上面的图片中,没有检测到任何 super-block 或者说在四个磁盘上没有 RAID 存在。现在我们开始创建 RAID 6。 + +### 第2步:为 RAID 6 创建磁盘分区 ### + +4.现在为 raid 创建分区‘/dev/sdb‘, ‘/dev/sdc‘, ‘/dev/sdd‘ 和 ‘/dev/sde‘使用下面 fdisk 命令。在这里,我们将展示如何创建分区在 sdb 磁盘,同样的步骤也适用于其他分区。 + +**创建 /dev/sdb 分区** + + # fdisk /dev/sdb + +请按照说明进行操作,如下图所示创建分区。 + +- 按 ‘n’ 创建新的分区。 +- 然后按 ‘P’ 选择主分区。 +- 接下来选择分区号为1。 +- 只需按两次回车键选择默认值即可。 +- 然后,按 ‘P’ 来打印创建好的分区。 +- 按 ‘L’,列出所有可用的类型。 +- 按 ‘t’ 去修改分区。 +- 键入 ‘fd’ 设置为 Linux 的 RAID 类型,然后按 Enter 确认。 +- 然后再次使用‘p’查看我们所做的更改。 +- 使用‘w’保存更改。 + +![Create sdb Partition](http://www.tecmint.com/wp-content/uploads/2014/11/Create-sdb-Partition.png) + +创建 /dev/sdb 分区 + +**创建 /dev/sdc 分区** + + # fdisk /dev/sdc + +![Create sdc Partition](http://www.tecmint.com/wp-content/uploads/2014/11/Create-sdc-Partition.png) + +创建 /dev/sdc 分区 + +**创建 /dev/sdd 分区** + + # fdisk /dev/sdd + +![Create sdd Partition](http://www.tecmint.com/wp-content/uploads/2014/11/Create-sdd-Partition.png) + +创建 /dev/sdd 分区 + +**创建 /dev/sde 分区** + + # fdisk /dev/sde + +![Create sde Partition](http://www.tecmint.com/wp-content/uploads/2014/11/Create-sde-Partition.png) + +创建 /dev/sde 分区 + +5.创建好分区后,检查磁盘的 super-blocks 是个好的习惯。如果 super-blocks 不存在我们可以按前面的创建一个新的 RAID。 + + # mdadm -E /dev/sd[b-e]1 + + + 或者 + + # 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) + +在新分区中检查 Raid + +### 步骤3:创建 md 设备(RAID) ### + +6,现在是时候来创建 RAID 设备‘md0‘ (即 /dev/md0)并应用 RAID 级别在所有新创建的分区中,确认 raid 使用以下命令。 + + # 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) + +创建 Raid 6 设备 + +7.你还可以使用 watch 命令来查看当前 raid 的进程,如下图所示。 + + # watch -n1 cat /proc/mdstat + +![Check Raid 6 Process](http://www.tecmint.com/wp-content/uploads/2014/11/Check-Raid-6-Process.png) + +检查 Raid 6 进程 + +8.使用以下命令验证 RAID 设备。 + +# mdadm -E /dev/sd[b-e]1 + +**注意**::上述命令将显示四个磁盘的信息,这是相当长的,所以没有截取其完整的输出。 + +9.接下来,验证 RAID 阵列,以确认 re-syncing 被启动。 + + # mdadm --detail /dev/md0 + +![Check Raid 6 Array](http://www.tecmint.com/wp-content/uploads/2014/11/Check-Raid-6-Array.png) + +检查 Raid 6 阵列 + +### 第4步:在 RAID 设备上创建文件系统 ### + +10.使用 ext4 为‘/dev/md0‘创建一个文件系统并将它挂载在 /mnt/raid5 。这里我们使用的是 ext4,但你可以根据你的选择使用任意类型的文件系统。 + + # mkfs.ext4 /dev/md0 + +![Create File System on Raid](http://www.tecmint.com/wp-content/uploads/2014/11/Create-File-System-on-Raid.png) + +在 Raid 6 上创建文件系统 + +11.挂载创建的文件系统到 /mnt/raid6,并验证挂载点下的文件,我们可以看到 lost+found 目录。 + + # mkdir /mnt/raid6 + # mount /dev/md0 /mnt/raid6/ + # ls -l /mnt/raid6/ + +12.在挂载点下创建一些文件,在任意文件中添加一些文字并验证其内容。 + + # 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) + +验证 Raid 内容 + +13.在 /etc/fstab 中添加以下条目使系统启动时自动挂载设备,环境不同挂载点可能会有所不同。 + + # 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) + +自动挂载 Raid 6 设备 + +14.接下来,执行‘mount -a‘命令来验证 fstab 中的条目是否有错误。 + + # mount -av + +![Verify Raid Automount](http://www.tecmint.com/wp-content/uploads/2014/11/Verify-Automount-Raid-Devices.png) + +验证 Raid 是否自动挂载 + +### 第5步:保存 RAID 6 的配置 ### + +15.请注意默认 RAID 没有配置文件。我们需要使用以下命令手动保存它,然后检查设备‘/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) + +保存 Raid 6 配置 + +![Check Raid 6 Status](http://www.tecmint.com/wp-content/uploads/2014/11/Check-Raid-Status.png) + +检查 Raid 6 状态 + +### 第6步:添加备用磁盘 ### + +16.现在,它使用了4个磁盘,并且有两个作为奇偶校验信息来使用。在某些情况下,如果任意一个磁盘出现故障,我们仍可以得到数据,因为在 RAID 6 使用双奇偶校验。 + +如果第二个磁盘也出现故障,在第三块磁盘损坏前我们可以添加一个​​新的。它可以作为一个备用磁盘并入 RAID 集合,但我在创建 raid 集合前没有定义备用的磁盘。但是,在磁盘损坏后或者创建 RAId 集合时我们可以添加一块磁盘。现在,我们已经创建好了 RAID,下面让我演示如何添加备用磁盘。 + +为了达到演示的目的,我已经热插入了一个新的 HDD 磁盘(即 /dev/sdf),让我们来验证接入的磁盘。 + + # ls -l /dev/ | grep sd + +![Check New Disk](http://www.tecmint.com/wp-content/uploads/2014/11/Check-New-Disk.png) + +检查新 Disk + +17.现在再次确认新连接的磁盘没有配置过 RAID ,使用 mdadm 来检查。 + + # mdadm --examine /dev/sdf + +![Check Raid on New Disk](http://www.tecmint.com/wp-content/uploads/2014/11/Check-Raid-on-New-Disk.png) + +在新磁盘中检查 Raid + +**注意**: 像往常一样,我们早前已经为四个磁盘创建了分区,同样,我们使用 fdisk 命令为新插入的磁盘创建新分区。 + + # fdisk /dev/sdf + +![Create sdf Partition](http://www.tecmint.com/wp-content/uploads/2014/11/Create-Partition-on-sdf.png) + +为 /dev/sdf 创建分区 + +18.在 /dev/sdf 创建新的分区后,在新分区上确认 raid,包括/dev/md0 raid 设备的备用磁盘,并验证添加的设备。 + + # 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) + +在 sdf 分区上验证 Raid + +![Add sdf Partition to Raid](http://www.tecmint.com/wp-content/uploads/2014/11/Add-sdf-Partition-to-Raid.png) + +为 RAID 添加 sdf 分区 + +![Verify sdf Partition Details](http://www.tecmint.com/wp-content/uploads/2014/11/Verify-sdf-Details.png) + +验证 sdf 分区信息 + +### 第7步:检查 RAID 6 容错 ### + +19.现在,让我们检查备用驱动器是否能自动工作,当我们阵列中的任何一个磁盘出现故障时。为了测试,我亲自将一个磁盘模拟为故障设备。 + +在这里,我们标记 /dev/sdd1 为故障磁盘。 + + # 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) + +检查 Raid 6 容错 + +20.让我们查看 RAID 的详细信息,并检查备用磁盘是否开始同步。 + + # mdadm --detail /dev/md0 + +![Check Auto Raid Syncing](http://www.tecmint.com/wp-content/uploads/2014/11/Check-Auto-Raid-Syncing.png) + +检查 Raid 自动同步 + +**哇塞!** 这里,我们看到备用磁盘激活了,并开始重建进程。在底部,我们可以看到有故障的磁盘 /dev/sdd1 标记为 faulty。可以使用下面的命令查看进程重建。 + + # cat /proc/mdstat + +![Raid 6 Auto Syncing](http://www.tecmint.com/wp-content/uploads/2014/11/Raid-6-Auto-Syncing.png) + +Raid 6 自动同步 + +### 结论: ### + +在这里,我们看到了如何使用四个磁盘设置 RAID 6。这种 RAID 级别是具有高冗余的昂贵设置之一。在接下来的文章中,我们将看到如何建立一个嵌套的 RAID 10 甚至更多。至此,请继续关注 TECMINT。 + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/create-raid-6-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/ From 079be8dc226607baac11d0663901e3b3f6a15c2c Mon Sep 17 00:00:00 2001 From: wxy Date: Mon, 24 Aug 2015 22:29:00 +0800 Subject: [PATCH 429/507] =?UTF-8?q?PUB:Part=202=20-=20Creating=20Software?= =?UTF-8?q?=20RAID0=20(Stripe)=20on=20=E2=80=98Two=20Devices=E2=80=99=20Us?= =?UTF-8?q?ing=20=E2=80=98mdadm=E2=80=99=20Tool=20in=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @strugglingyouth --- ...Two Devices’ Using ‘mdadm’ Tool in Linux.md | 219 ++++++++++++++++++ ...Two Devices’ Using ‘mdadm’ Tool in Linux.md | 218 ----------------- 2 files changed, 219 insertions(+), 218 deletions(-) create mode 100644 published/Part 2 - Creating Software RAID0 (Stripe) on ‘Two Devices’ Using ‘mdadm’ Tool in Linux.md delete mode 100644 translated/tech/RAID/Part 2 - Creating Software RAID0 (Stripe) on ‘Two Devices’ Using ‘mdadm’ Tool in Linux.md diff --git a/published/Part 2 - Creating Software RAID0 (Stripe) on ‘Two Devices’ Using ‘mdadm’ Tool in Linux.md b/published/Part 2 - Creating Software RAID0 (Stripe) on ‘Two Devices’ Using ‘mdadm’ Tool in Linux.md new file mode 100644 index 0000000000..650897d1d5 --- /dev/null +++ b/published/Part 2 - Creating Software RAID0 (Stripe) on ‘Two Devices’ Using ‘mdadm’ Tool in Linux.md @@ -0,0 +1,219 @@ +在 Linux 下使用 RAID(一):使用 mdadm 工具创建软件 RAID 0 (条带化) +================================================================================ + +RAID 即廉价磁盘冗余阵列,其高可用性和可靠性适用于大规模环境中,相比正常使用,数据更需要被保护。RAID 是一些磁盘的集合,是包含一个阵列的逻辑卷。驱动器可以组合起来成为一个阵列或称为(组的)集合。 + +创建 RAID 最少应使用2个连接到 RAID 控制器的磁盘组成,来构成逻辑卷,可以根据定义的 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 不是一种好的做法。唯一的解决办法就是安装有 RAID 0 逻辑卷的操作系统来提高重要文件的安全性。 + +- RAID 0 性能较高。 +- 在 RAID 0 上,空间零浪费。 +- 零容错(如果硬盘中的任何一个发生故障,无法取回数据)。 +- 写和读性能都很好。 + +#### 要求 #### + +创建 RAID 0 允许的最小磁盘数目是2个,但你可以添加更多的磁盘,不过数目应该是2,4,6,8等的偶数。如果你有一个物理 RAID 卡并且有足够的端口,你可以添加更多磁盘。 + +在这里,我们没有使用硬件 RAID,此设置只需要软件 RAID。如果我们有一个物理硬件 RAID 卡,我们可以从它的功能界面访问它。有些主板默认内建 RAID 功能,还可以使用 Ctrl + I 键访问它的界面。 + +如果你是刚开始设置 RAID,请阅读我们前面的文章,我们已经介绍了一些关于 RAID 基本的概念。 + +- [介绍 RAID 的级别和概念][1] + +**我的服务器设置** + + 操作系统 : CentOS 6.5 Final + IP 地址 : 192.168.0.225 + 两块盘 : 20 GB each + +这是9篇系列教程的第2部分,在这部分,我们将看看如何能够在 Linux 上创建和使用 RAID 0(条带化),以名为 sdb 和 sdc 两个 20GB 的硬盘为例。 + +### 第1步:更新系统和安装管理 RAID 的 mdadm 软件 ### + +1、 在 Linux 上设置 RAID 0 前,我们先更新一下系统,然后安装`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 类型,然后按回车确认。 +- 然后再次使用`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 – 创建 +- -l – 级别 +- -n – RAID 设备数 + +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、 在 RAID 设备上创建好 ext4 文件系统后,现在创建一个挂载点(即 /mnt/raid0),并将设备 /dev/md0 挂载在它下。 + + # mkdir /mnt/raid0 + # mount /dev/md0 /mnt/raid0/ + +10、下一步,使用 df 命令验证设备 /dev/md0 是否被挂载在 /mnt/raid0 下。 + + # df -h + +11、 接下来,在挂载点 /mnt/raid0 下创建一个名为`tecmint.txt` 的文件,为创建的文件添加一些内容,并查看文件和目录的内容。 + + # 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 配置到一个文件中,以供将来使用。我们再次使用带有`-s` (scan) 和`-v` (verbose) 选项的 `mdadm` 命令,如图所示。 + + # 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 配置* + +就这样,我们在这里看到,如何通过使用两个硬盘配置具有条带化的 RAID 0 。在接下来的文章中,我们将看到如何设置 RAID 1。 + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/create-raid0-in-linux/ + +作者:[Babin Lonston][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/babinlonston/ +[1]:https://linux.cn/article-6085-1.html 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 deleted file mode 100644 index 9feba99609..0000000000 --- a/translated/tech/RAID/Part 2 - Creating Software RAID0 (Stripe) on ‘Two Devices’ Using ‘mdadm’ Tool in Linux.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 234e307b477bcad5a12a40c540be4f08b125d8c4 Mon Sep 17 00:00:00 2001 From: struggling <630441839@qq.com> Date: Mon, 24 Aug 2015 23:58:14 +0800 Subject: [PATCH 430/507] Delete 20150817 Linux FAQs with Answers--How to fix Wireshark GUI freeze on Linux desktop.md --- ...x Wireshark GUI freeze on Linux desktop.md | 62 ------------------- 1 file changed, 62 deletions(-) delete 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 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 deleted file mode 100644 index d906349ff9..0000000000 --- a/sources/tech/20150817 Linux FAQs with Answers--How to fix Wireshark GUI freeze on Linux desktop.md +++ /dev/null @@ -1,62 +0,0 @@ -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? - -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 From 68ca6216a812bae6178844c68fadf162a57d7db1 Mon Sep 17 00:00:00 2001 From: struggling <630441839@qq.com> Date: Mon, 24 Aug 2015 23:58:40 +0800 Subject: [PATCH 431/507] Create 20150817 Linux FAQs with Answers--How to fix Wireshark GUI freeze on Linux desktop.md --- ...x Wireshark GUI freeze on Linux desktop.md | 64 +++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 translated/tech/20150817 Linux FAQs with Answers--How to fix Wireshark GUI freeze on Linux desktop.md diff --git a/translated/tech/20150817 Linux FAQs with Answers--How to fix Wireshark GUI freeze on Linux desktop.md b/translated/tech/20150817 Linux FAQs with Answers--How to fix Wireshark GUI freeze on Linux desktop.md new file mode 100644 index 0000000000..9db7231a68 --- /dev/null +++ b/translated/tech/20150817 Linux FAQs with Answers--How to fix Wireshark GUI freeze on Linux desktop.md @@ -0,0 +1,64 @@ + +Linux 有问必答--如何解决 Linux 桌面上的 Wireshark GUI 死机 +================================================================================ +> **问题**: 当我试图在 Ubuntu 上的 Wireshark 中打开一个 pre-recorded 数据包转储时,它的 UI 突然死机,在我发起 Wireshark 的终端出现了下面的错误和警告。我该如何解决这个问题? + +Wireshark 是一个基于 GUI 的数据包捕获和嗅探工具。该工具被网络管理员普遍使用,网络安全工程师或开发人员对于各种任务的 packet-level 网络分析是必需的,例如在网络故障,漏洞测试,应用程序调试,或逆向协议工程是必需的。 Wireshark 允许记录存活数据包,并通过便捷的图形用户界面浏览他们的协议首部和有效负荷。 + +![](https://farm1.staticflickr.com/722/20584224675_f4d7a59474_c.jpg) + +这是 Wireshark 的 UI,尤其是在 Ubuntu 桌面下运行,有时会挂起或冻结出现以下错误,而你是向上或向下滚动分组列表视图时,就开始加载一个 pre-recorded 包转储文件。 + + + (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 + +显然,这个错误是由 Wireshark 和叠加滚动条之间的一些不兼容造成的,在最新的 Ubuntu 桌面还没有被解决(例如,Ubuntu 15.04 的桌面)。 + +一种避免 Wireshark 的 UI 卡死的办法就是 **暂时禁用叠加滚动条**。在 Wireshark 上有两种方法来禁用叠加滚动条,这取决于你在桌面上如何启动 Wireshark 的。 + +### 命令行解决方法 ### + +叠加滚动条可以通过设置"**LIBOVERLAY_SCROLLBAR**"环境变量为“0”来被禁止。 + +所以,如果你是在终端使用命令行启动 Wireshark 的,你可以在 Wireshark 中禁用叠加滚动条,如下所示。 + +打开你的 .bashrc 文件,并定义以下 alias。 + + alias wireshark="LIBOVERLAY_SCROLLBAR=0 /usr/bin/wireshark" + +### 桌面启动解决方法 ### + +如果你是使用桌面启动器启动的 Wireshark,你可以编辑它的桌面启动器文件。 + + $ sudo vi /usr/share/applications/wireshark.desktop + +查找以"Exec"开头的行,并如下更改。 + + Exec=env LIBOVERLAY_SCROLLBAR=0 wireshark %f + +虽然这种解决方法将有利于所有桌面用户的 system-wide,但它将无法升级 Wireshark。如果你想保留修改的 .desktop 文件,如下所示将它复制到你的主目录。 + + $ cp /usr/share/applications/wireshark.desktop ~/.local/share/applications/ + +-------------------------------------------------------------------------------- + +via: http://ask.xmodulo.com/fix-wireshark-gui-freeze-linux-desktop.html + +作者:[Dan Nanni][a] +译者:[strugglingyouth](https://github.com/strugglingyouth) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://ask.xmodulo.com/author/nanni + From 98d249980e03d618467d60c8145d859d84ff91da Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 25 Aug 2015 00:28:35 +0800 Subject: [PATCH 432/507] PUB:20150717 How to monitor NGINX with Datadog - Part 3 @strugglingyouth --- ... to monitor NGINX with Datadog - Part 3.md | 146 +++++++++++++++++ ... to monitor NGINX with Datadog - Part 3.md | 154 ------------------ 2 files changed, 146 insertions(+), 154 deletions(-) create mode 100644 published/20150717 How to monitor NGINX with Datadog - Part 3.md delete mode 100644 translated/tech/20150717 How to monitor NGINX with Datadog - Part 3.md diff --git a/published/20150717 How to monitor NGINX with Datadog - Part 3.md b/published/20150717 How to monitor NGINX with Datadog - Part 3.md new file mode 100644 index 0000000000..fecab87e66 --- /dev/null +++ b/published/20150717 How to monitor NGINX with Datadog - Part 3.md @@ -0,0 +1,146 @@ +如何使用 Datadog 监控 NGINX(第三篇) +================================================================================ +![](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 指标,就像监控其他系统一样 +- 当一个关键指标急剧变化时设置自动警报来通知你 + +### 配置 NGINX ### + +为了收集 NGINX 指标,首先需要确保 NGINX 已启用 status 模块和一个 报告 status 指标的 URL。一步步的[配置开源 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 URL 和任意 tag,将配置文件保存为 conf.d/nginx.yaml。 + +#### 重启代理 #### + +你必须重新启动代理程序来加载新的配置文件。重新启动命令[在这里][9],根据平台的不同而不同。 + +#### 检查配置文件 #### + +要检查 Datadog 和 NGINX 是否正确整合,运行 Datadog 的 info 命令。每个平台使用的命令[看这儿][10]。 + +如果配置是正确的,你会看到这样的输出: + + Checks + ====== + + [...] + + nginx + ----- + - instance #0 [OK] + - Collected 8 metrics & 0 events + +#### 安装整合 #### + +最后,在你的 Datadog 帐户打开“Nginx 整合”。这非常简单,你只要在 [NGINX 整合设置][11]中点击“Install Integration”按钮。 + +![Install integration](https://d33tyra1llx9zy.cloudfront.net/blog/images/2015-06-nginx/install.png) + +### 指标! ### + +一旦代理开始报告 NGINX 指标,你会看到[一个 NGINX 仪表盘][12]出现在在你 Datadog 可用仪表盘的列表中。 + +基本的 NGINX 仪表盘显示有用的图表,囊括了几个[我们的 NGINX 监控介绍][13]中的关键指标。 (一些指标,特别是请求处理时间要求进行日志分析,Datadog 不支持。) + +你可以通过增加 NGINX 之外的重要指标的图表来轻松创建一个全面的仪表盘,以监控你的整个网站设施。例如,你可能想监视你 NGINX 的主机级的指标,如系统负载。要构建一个自定义的仪表盘,只需点击靠近仪表盘的右上角的选项并选择“Clone Dash”来克隆一个默认的 NGINX 仪表盘。 + +![Clone dash](https://d33tyra1llx9zy.cloudfront.net/blog/images/2015-06-nginx/clone_2.png) + +你也可以使用 Datadog 的[主机地图][14]在更高层面监控你的 NGINX 实例,举个例子,用颜色标示你所有的 NGINX 主机的 CPU 使用率来辨别潜在热点。 + +![](https://d33tyra1llx9zy.cloudfront.net/blog/images/2015-06-nginx/nginx-host-map-3.png) + +### NGINX 指标警告 ### + +一旦 Datadog 捕获并可视化你的指标,你可能会希望建立一些监控自动地密切关注你的指标,并当有问题提醒你。下面将介绍一个典型的例子:一个提醒你 NGINX 吞吐量突然下降时的指标监控器。 + +#### 监控 NGINX 吞吐量 #### + +Datadog 指标警报可以是“基于吞吐量的”(当指标超过设定值会警报)或“基于变化幅度的”(当指标的变化超过一定范围会警报)。在这个例子里,我们会采取后一种方式,当每秒传入的请求急剧下降时会提醒我们。下降往往意味着有问题。 + +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%以上时警报。在这里,我们使用一个一分钟的数据窗口来表示 “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”中,我们会为监控器命名,并添加一个伴随该通知的短消息,建议首先开始调查的内容。我们会 @ ops 团队使用的 Slack,并 @pagerduty [将警告发给短信][15]。 + + ![NGINX metric notification](https://d33tyra1llx9zy.cloudfront.net/blog/images/2015-06-nginx/monitor2_step_4v3.png) + +5. **保存集成监控**。点击页面底部的“Save”按钮。你现在在监控一个关键的 NGINX [工作指标][16],而当它快速下跌时会给值班工程师发短信。 + +### 结论 ### + +在这篇文章中,我们谈到了通过整合 NGINX 与 Datadog 来可视化你的关键指标,并当你的网络基础架构有问题时会通知你的团队。 + +如果你一直使用你自己的 Datadog 账号,你现在应该可以极大的提升你的 web 环境的可视化,也有能力对你的环境、你所使用的模式、和对你的组织最有价值的指标创建自动监控。 + +如果你还没有 Datadog 帐户,你可以注册[免费试用][17],并开始监视你的基础架构,应用程序和现在的服务。 + +------------------------------------------------------------ + +via: https://www.datadoghq.com/blog/how-to-monitor-nginx-with-datadog/ + +作者:K Young +译者:[strugglingyouth](https://github.com/strugglingyouth) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[1]:https://linux.cn/article-5970-1.html +[2]:https://linux.cn/article-5985-1.html#open-source +[3]:https://linux.cn/article-5985-1.html#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://linux.cn/article-5970-1.html +[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 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 deleted file mode 100644 index 003290a915..0000000000 --- a/translated/tech/20150717 How to monitor NGINX with Datadog - Part 3.md +++ /dev/null @@ -1,154 +0,0 @@ - -如何使用 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 999fbdbcc2b902c5c8e023bd7351d05b6f945c6d Mon Sep 17 00:00:00 2001 From: Kevin Sicong Jiang Date: Mon, 24 Aug 2015 19:40:44 -0500 Subject: [PATCH 433/507] KevinSJ translated --- ... open source command-line email clients.md | 80 ------------------- ... open source command-line email clients.md | 80 +++++++++++++++++++ 2 files changed, 80 insertions(+), 80 deletions(-) delete mode 100644 sources/share/20150821 Top 4 open source command-line email clients.md create mode 100644 translated/share/20150821 Top 4 open source command-line email clients.md diff --git a/sources/share/20150821 Top 4 open source command-line email clients.md b/sources/share/20150821 Top 4 open source command-line email clients.md deleted file mode 100644 index afdcd8cf4a..0000000000 --- a/sources/share/20150821 Top 4 open source command-line email clients.md +++ /dev/null @@ -1,80 +0,0 @@ -KevinSJ Translating -Top 4 open source command-line email clients -================================================================================ -![](http://opensource.com/sites/default/files/styles/image-full-size/public/images/life/life_mail.png) - -Like it or not, email isn't dead yet. And for Linux power users who live and die by the command line, leaving the shell to use a traditional desktop or web based email client just doesn't cut it. After all, if there's one thing that the command line excels at, it's letting you process files, and especially text, with uninterrupted efficiency. - -Fortunately, there are a number of great command-line email clients, many with a devoted following of users who can help you get started and answer any questions you might have along the way. But fair warning: once you've mastered one of these clients, you may find it hard to go back to your old GUI-based solution! - -To install any of these four clients is pretty easy; most are available in standard repositories for major Linux distributions, and can be installed with a normal package manager. You may also have luck finding and running them on other operating systems as well, although I haven't tried it and can't speak to the experience. - -### Mutt ### - -- [Project page][1] -- [Source code][2] -- License: [GPLv2][3] - -Many terminal enthusiasts may already have heard of or even be familiar with Mutt and Alpine, which have both been on the scene for many years. Let's first take a look at Mutt. - -Mutt supports many of the features you've come to expect from any email system: message threading, color coding, availability in a number of languages, and lots of configuration options. It supports POP3 and IMAP, the two most common email transfer protocols, and multiple mailbox formats. Having first been released in 1995, Mutt still has an active development community, but in recent years, new releases have focused on bug fixes and security updates rather than new features. That's okay for many Mutt users, though, who are comfortable with the interface and adhere to the project's slogan: "All mail clients suck. This one just sucks less." - -### Alpine ### - -- [Project page][4] -- [Source code][5] -- License: [Apache 2.0][6] - -Alpine is the other well-known client for terminal email, developed at the University of Washington and designed to be an open source, Unicode-friendly alternative to Pine, also originally from UW. - -Designed to be friendly to beginners, but also chocked full of features for advanced users, Alpine also supports a multitude of protocols—IMAP, LDAP, NNTP, POP, SMTP, etc.—as well as different mailbox formats. Alpine is packaged with Pico, a simple text editing utility that many use as a standalone tool, but it also should work with your text editor of choice: vi, Emacs, etc. - -While Alpine is still infrequently updated, there is also a fork, re-alpine, which was created to allow a different set of maintainers to continue the project's development. - -Alpine features contextual help on the screen, which some users may prefer to breaking out the manual with Mutt, but both are well documented. Between Mutt and Alpine, users may want to try both and let personal preference guide their decision, or they may wish to check out a couple of the newer options below. - -### Sup ### - -- [Project page][7] -- [Source code][8] -- License: [GPLv2][9] - -Sup is the first of two of what can be called "high volume email clients" on our list. Described as a "console-based email client for people with a lot of email," Sup's goal is to provide an interface to email with a hierarchical design and to allow tagging of threads for easier organization. - -Written in Ruby, Sup provides exceptionally fast searching, manages your contact list automatically, and allows for custom extensions. For people who are used to Gmail as a webmail interface, these features will seem familiar, and Sup might be seen as a more modern approach to email on the command line. - -### Notmuch ### - -- [Project page][10] -- [Source code][11] -- License: [GPLv3][12] - -"Sup? Notmuch." Notmuch was written as a response to Sup, originally starting out as a speed-focused rewrite of some portions of Sup to enhance performance. Eventually, the project grew in scope and is now a stand-alone email client. - -Notmuch is also a fairly trim program. It doesn't actually send or receive email messages on its own, and the code which enables Notmuch's super-fast searching is actually designed as a separate library which the program can call. But its modular nature enables you to pick your favorite tools for composing, sending, and receiving, and instead focuses on doing one task and doing it well—efficient browsing and management of your email. - -This list isn’t by any means comprehensive; there are a lot more email clients out there which might be an even better fit for you. What’s your favorite? Did we leave one out that you want to share about? Let us know in the comments below! - --------------------------------------------------------------------------------- - -via: http://opensource.com/life/15/8/top-4-open-source-command-line-email-clients - -作者:[Jason Baker][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/jason-baker -[1]:http://www.mutt.org/ -[2]:http://dev.mutt.org/trac/ -[3]:https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html -[4]:http://www.washington.edu/alpine/ -[5]:http://www.washington.edu/alpine/acquire/ -[6]:http://www.apache.org/licenses/LICENSE-2.0 -[7]:http://supmua.org/ -[8]:https://github.com/sup-heliotrope/sup -[9]:https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html -[10]:http://notmuchmail.org/ -[11]:http://notmuchmail.org/releases/ -[12]:http://www.gnu.org/licenses/gpl.html diff --git a/translated/share/20150821 Top 4 open source command-line email clients.md b/translated/share/20150821 Top 4 open source command-line email clients.md new file mode 100644 index 0000000000..db28f4c543 --- /dev/null +++ b/translated/share/20150821 Top 4 open source command-line email clients.md @@ -0,0 +1,80 @@ +KevinSJ Translating +四大开源版命令行邮件客户端 +================================================================================ +![](http://opensource.com/sites/default/files/styles/image-full-size/public/images/life/life_mail.png) + +无论你承认与否,email并没有消亡。对依赖命令行的 Linux 高级用户而言,离开 shell 转而使用传统的桌面或网页版邮件客户端并不合适。归根结底,命令行最善于处理文件,特别是文本文件,能使效率倍增。 + +幸运的是,也有不少的命令行邮件客户端,他们的用户大都乐于帮助你入门并回答你使用中遇到的问题。但别说我没警告过你:一旦你完全掌握了其中一个客户端,要再使用图基于图形界面的客户端将回变得很困难! + +要安装下述四个客户端中的任何一个是非常容易的;主要 Linux 发行版的软件仓库中都提供此类软件,并可通过包管理器进行安装。你也可以再其他的操作系统中寻找并安装这类客户端,但我并未尝试过也没有相关的经验。 + +### Mutt ### + +- [项目主页][1] +- [源代码][2] +- 授权协议: [GPLv2][3] + +许多终端爱好者都听说过甚至熟悉 Mutt 和 Alpine, 他们已经存在多年。让我们先看看 Mutt。 + +Mutt 支持许多你所期望 email 系统支持的功能:会话,颜色区分,支持多语言,同时还有很多设置选项。它支持 POP3 和 IMAP, 两个主要的邮件传输协议,以及许多邮箱格式。自从1995年诞生以来, Mutt 即拥有一个活跃的开发社区,但最近几年,新版本更多的关注于修复问题和安全更新而非提供新功能。这对大多数 Mutt 用户而言并无大碍,他们钟爱这样的界面,并支持此项目的口号:“所有邮件客户端都很烂,只是这个烂的没那么彻底。” + +### Alpine ### + +- [项目主页][4] +- [源代码][5] +- 授权协议: [Apache 2.0][6] + +Alpine 是另一款知名的终端邮件客户端,它由华盛顿大学开发,初衷是作为 UW 开发的 Pine 的开源,支持unicode的替代版本。 + +Alpine 不仅容易上手,还为高级用户提供了很多特性,它支持很多协议 —— IMAP, LDAP, NNTP, POP, SMTP 等,同时也支持不同的邮箱格式。Alpine 内置了一款名为 Pico 的可独立使用的简易文本编辑工具,但你也可以使用你常用的文本编辑器: vi, Emacs等。 + +尽管Alpine的升级并不频繁,名为re-alpine的分支为不同的开发者提供了开发此项目的机会。 + +Alpine 支持再屏幕上显示上下文帮助,但一些用户回喜欢 Mutt 式的独立说明手册,但这两种提供了较好的说明。用户可以同时尝试 Mutt 和 Alpine,并由个人喜好作出决定,也可以尝试以下几个比较新颖的选项。 + +### Sup ### + +- [项目主页][7] +- [源代码][8] +- 授权协议: [GPLv2][9] + +Sup 是我们列表中能被称为“大容量邮件客户端”的两个之一。自称“为邮件较多的人设计的命令行客户端”,Sup 的目标是提供一个支持层次化设计并允许再为会话添加标签进行简单整理的界面。 + +由于采用 Ruby 编写,Sup 能提供十分快速的搜索并能自动管理联系人列表,同时还允许自定义插件。对于使用 Gmail 作为网页邮件客户端的人们,这些功能都是耳熟能详的,这就使得 Sup 成为一种比较现代的命令行邮件管理方式。 +Written in Ruby, Sup provides exceptionally fast searching, manages your contact list automatically, and allows for custom extensions. For people who are used to Gmail as a webmail interface, these features will seem familiar, and Sup might be seen as a more modern approach to email on the command line. + +### Notmuch ### + +- [项目主页][10] +- [源代码][11] +- 授权协议: [GPLv3][12] + +"Sup? Notmuch." Notmuch 作为 Sup 的回应,最初只是重写了 Sup 的一小部分来提高性能。最终,这个项目逐渐变大并成为了一个独立的邮件客户端。 + +Notmuch是一款相当精简的软件。它并不能独立的收发邮件,启用 Notmuch 的快速搜索功能的代码实际上是一个需要调用的独立库。但这样的模块化设计也使得你能使用你最爱的工具进行写信,发信和收信,集中精力做好一件事情并有效浏览和管理你的邮件。 + +这个列表并不完整,还有很多 email 客户端,他们或许才是你的最佳选择。你喜欢什么客户端呢? +-------------------------------------------------------------------------------- + +via: http://opensource.com/life/15/8/top-4-open-source-command-line-email-clients + +作者:[Jason Baker][a] +译者:[KevinSJ](https://github.com/KevinSj) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://opensource.com/users/jason-baker +[1]:http://www.mutt.org/ +[2]:http://dev.mutt.org/trac/ +[3]:https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html +[4]:http://www.washington.edu/alpine/ +[5]:http://www.washington.edu/alpine/acquire/ +[6]:http://www.apache.org/licenses/LICENSE-2.0 +[7]:http://supmua.org/ +[8]:https://github.com/sup-heliotrope/sup +[9]:https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html +[10]:http://notmuchmail.org/ +[11]:http://notmuchmail.org/releases/ +[12]:http://www.gnu.org/licenses/gpl.html From 27d3c91bd4976c5e27e4a82658f2cb56e59aa5f3 Mon Sep 17 00:00:00 2001 From: Kevin Sicong Jiang Date: Mon, 24 Aug 2015 19:47:16 -0500 Subject: [PATCH 434/507] KevinSJ Translating --- sources/talk/20150820 Why did you start using Linux.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/talk/20150820 Why did you start using Linux.md b/sources/talk/20150820 Why did you start using Linux.md index f83742a7a1..3ddf90c560 100644 --- a/sources/talk/20150820 Why did you start using Linux.md +++ b/sources/talk/20150820 Why did you start using Linux.md @@ -1,3 +1,4 @@ +KevinSJ translating Why did you start using Linux? ================================================================================ > In today's open source roundup: What got you started with Linux? Plus: IBM's Linux only Mainframe. And why you should skip Windows 10 and go with Linux @@ -144,4 +145,4 @@ via: http://www.itworld.com/article/2972587/linux/why-did-you-start-using-linux. [1]:https://www.reddit.com/r/linux/comments/3hb2sr/question_for_younger_users_why_did_you_start/ [2]:https://www.reddit.com/r/linux/comments/3hb2sr/question_for_younger_users_why_did_you_start/ [3]:http://techcrunch.com/2015/08/16/ibm-teams-with-canonical-on-linux-mainframe/ -[4]:http://www.zdnet.com/article/sick-of-windows-spying-on-you-go-linux/ \ No newline at end of file +[4]:http://www.zdnet.com/article/sick-of-windows-spying-on-you-go-linux/ From 2f88b1dba1741c25a5c56c3770c81be33b06f009 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 25 Aug 2015 09:14:48 +0800 Subject: [PATCH 435/507] translating --- ...tch These Kids Having Fun With Linux Terminal In Ubuntu.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/share/20150824 Watch These Kids Having Fun With Linux Terminal In Ubuntu.md b/sources/share/20150824 Watch These Kids Having Fun With Linux Terminal In Ubuntu.md index 6adcbbc3bc..3ce51b9379 100644 --- a/sources/share/20150824 Watch These Kids Having Fun With Linux Terminal In Ubuntu.md +++ b/sources/share/20150824 Watch These Kids Having Fun With Linux Terminal In Ubuntu.md @@ -1,3 +1,5 @@ +translating---geekpi + Watch These Kids Having Fun With Linux Terminal In Ubuntu ================================================================================ I found this short video of children having fun with Linux terminals in their computer lab at school. I do not know where do they belong to, but I guess it is either in Indonesia or Malaysia. @@ -34,4 +36,4 @@ via: http://itsfoss.com/ubuntu-terminal-train/ 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 -[a]:http://itsfoss.com/author/abhishek/ \ No newline at end of file +[a]:http://itsfoss.com/author/abhishek/ From 4b56b819865e4dce4e392add7b9860a61437aa52 Mon Sep 17 00:00:00 2001 From: bazz2 Date: Tue, 25 Aug 2015 09:20:24 +0800 Subject: [PATCH 436/507] [bazz2 translating]A Look at What's Next for the Linux Kernel --- .../20150820 A Look at What's Next for the Linux Kernel.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/talk/20150820 A Look at What's Next for the Linux Kernel.md b/sources/talk/20150820 A Look at What's Next for the Linux Kernel.md index 9705fd3a90..e46a4b538d 100644 --- a/sources/talk/20150820 A Look at What's Next for the Linux Kernel.md +++ b/sources/talk/20150820 A Look at What's Next for the Linux Kernel.md @@ -1,3 +1,4 @@ +[bazz22222222222] A Look at What's Next for the Linux Kernel ================================================================================ ![](http://www.eweek.com/imagesvr_ce/485/290x195cilinux1.jpg) @@ -46,4 +47,4 @@ via: http://www.eweek.com/enterprise-apps/a-look-at-whats-next-for-the-linux-ker 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 -[a]:http://www.eweek.com/cp/bio/Sean-Michael-Kerner/ \ No newline at end of file +[a]:http://www.eweek.com/cp/bio/Sean-Michael-Kerner/ From 8c98033bc94605d350e1ff4b7acb89adad181e7d Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 25 Aug 2015 09:32:07 +0800 Subject: [PATCH 437/507] translated --- ...aving Fun With Linux Terminal In Ubuntu.md | 39 ------------------- ...aving Fun With Linux Terminal In Ubuntu.md | 37 ++++++++++++++++++ 2 files changed, 37 insertions(+), 39 deletions(-) delete mode 100644 sources/share/20150824 Watch These Kids Having Fun With Linux Terminal In Ubuntu.md create mode 100644 translated/share/20150824 Watch These Kids Having Fun With Linux Terminal In Ubuntu.md diff --git a/sources/share/20150824 Watch These Kids Having Fun With Linux Terminal In Ubuntu.md b/sources/share/20150824 Watch These Kids Having Fun With Linux Terminal In Ubuntu.md deleted file mode 100644 index 3ce51b9379..0000000000 --- a/sources/share/20150824 Watch These Kids Having Fun With Linux Terminal In Ubuntu.md +++ /dev/null @@ -1,39 +0,0 @@ -translating---geekpi - -Watch These Kids Having Fun With Linux Terminal In Ubuntu -================================================================================ -I found this short video of children having fun with Linux terminals in their computer lab at school. I do not know where do they belong to, but I guess it is either in Indonesia or Malaysia. - -注:youtube 视频 - - -### Run train in Linux terminal ### - -There is no magic here. It’s just a small command line fun tool called ‘sl’. I presume that it was developed entirely to have some fun when command ls is wrongly typed. If you ever worked on Linux terminal, you know that ls is one of the most commonly used commands and perhaps one of the most frequently mis-typed command as well. - -If you want to have little fun with this terminal train, you can install it using the following command: - - sudo apt-get install sl - -To run the terminal train, just type **sl** in the terminal. It also has the following options: - -- -a : Accident mode. You can see people crying help -- -l : shows a smaller train but with more coaches -- -F : A flying train -- -e : Allows interrupt by Ctrl+C. In other mode you cannot use Ctrl+C to stop the train. But then, it doesn’t run for long. - -Normally, you should hear the whistle as well but it doesn’t work in most of the Linux OS, Ubuntu 14.04 being one of them. Here is the accidental terminal train :) - -![Linux Terminal Train](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/04/Linux_Terminal_Train.jpeg) - --------------------------------------------------------------------------------- - -via: http://itsfoss.com/ubuntu-terminal-train/ - -作者:[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/ diff --git a/translated/share/20150824 Watch These Kids Having Fun With Linux Terminal In Ubuntu.md b/translated/share/20150824 Watch These Kids Having Fun With Linux Terminal In Ubuntu.md new file mode 100644 index 0000000000..3d0efff7b5 --- /dev/null +++ b/translated/share/20150824 Watch These Kids Having Fun With Linux Terminal In Ubuntu.md @@ -0,0 +1,37 @@ +看这些孩子在Ubuntu的Linux终端下玩耍 +================================================================================ +我发现了一个孩子们在他们的计算机教室里玩得很开心的视频。我不知道他们在哪里,但我猜测是在印度尼西亚或者马来西亚。 + +注:youtube 视频 + + +### 在Linux终端下面跑火车 ### + +这里没有魔术。只是一个叫做“sl”的命令行工具。我假定它是在把ls打错的情况下为了好玩而开发的。如果你曾经在Linux的命令行下工作,你会知道ls是一个最常使用的一个命令,也许也是一个最经常打错的命令。 + +如果你想从这个终端下的火车获得一些乐趣,你可以使用下面的命令安装它。 + + sudo apt-get install sl + +要运行终端火车,只需要在终端中输入**sl**。它有以下几个选项: + +- -a : 意外模式。你会看见哭救的群众 +- -l : 显示一个更小的火车但有更多的车厢 +- -F : 一个飞行的火车 +- -e : 允许通过Ctrl+C。使用其他模式你不能使用Ctrl+C中断火车。但是,它不能长时间运行。 + +正常情况下,你应该会听到汽笛声但是在大多数Linux系统下都不管用,Ubuntu是其中一个。这就是一个意外的终端火车。 + +![Linux Terminal Train](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/04/Linux_Terminal_Train.jpeg) + +-------------------------------------------------------------------------------- + +via: http://itsfoss.com/ubuntu-terminal-train/ + +作者:[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/ From 24b14a84926db605be221bff4de094cbc60a5129 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 25 Aug 2015 09:34:06 +0800 Subject: [PATCH 438/507] Revert "translated" This reverts commit 8c98033bc94605d350e1ff4b7acb89adad181e7d. --- ...aving Fun With Linux Terminal In Ubuntu.md | 39 +++++++++++++++++++ ...aving Fun With Linux Terminal In Ubuntu.md | 37 ------------------ 2 files changed, 39 insertions(+), 37 deletions(-) create mode 100644 sources/share/20150824 Watch These Kids Having Fun With Linux Terminal In Ubuntu.md delete mode 100644 translated/share/20150824 Watch These Kids Having Fun With Linux Terminal In Ubuntu.md diff --git a/sources/share/20150824 Watch These Kids Having Fun With Linux Terminal In Ubuntu.md b/sources/share/20150824 Watch These Kids Having Fun With Linux Terminal In Ubuntu.md new file mode 100644 index 0000000000..3ce51b9379 --- /dev/null +++ b/sources/share/20150824 Watch These Kids Having Fun With Linux Terminal In Ubuntu.md @@ -0,0 +1,39 @@ +translating---geekpi + +Watch These Kids Having Fun With Linux Terminal In Ubuntu +================================================================================ +I found this short video of children having fun with Linux terminals in their computer lab at school. I do not know where do they belong to, but I guess it is either in Indonesia or Malaysia. + +注:youtube 视频 + + +### Run train in Linux terminal ### + +There is no magic here. It’s just a small command line fun tool called ‘sl’. I presume that it was developed entirely to have some fun when command ls is wrongly typed. If you ever worked on Linux terminal, you know that ls is one of the most commonly used commands and perhaps one of the most frequently mis-typed command as well. + +If you want to have little fun with this terminal train, you can install it using the following command: + + sudo apt-get install sl + +To run the terminal train, just type **sl** in the terminal. It also has the following options: + +- -a : Accident mode. You can see people crying help +- -l : shows a smaller train but with more coaches +- -F : A flying train +- -e : Allows interrupt by Ctrl+C. In other mode you cannot use Ctrl+C to stop the train. But then, it doesn’t run for long. + +Normally, you should hear the whistle as well but it doesn’t work in most of the Linux OS, Ubuntu 14.04 being one of them. Here is the accidental terminal train :) + +![Linux Terminal Train](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/04/Linux_Terminal_Train.jpeg) + +-------------------------------------------------------------------------------- + +via: http://itsfoss.com/ubuntu-terminal-train/ + +作者:[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/ diff --git a/translated/share/20150824 Watch These Kids Having Fun With Linux Terminal In Ubuntu.md b/translated/share/20150824 Watch These Kids Having Fun With Linux Terminal In Ubuntu.md deleted file mode 100644 index 3d0efff7b5..0000000000 --- a/translated/share/20150824 Watch These Kids Having Fun With Linux Terminal In Ubuntu.md +++ /dev/null @@ -1,37 +0,0 @@ -看这些孩子在Ubuntu的Linux终端下玩耍 -================================================================================ -我发现了一个孩子们在他们的计算机教室里玩得很开心的视频。我不知道他们在哪里,但我猜测是在印度尼西亚或者马来西亚。 - -注:youtube 视频 - - -### 在Linux终端下面跑火车 ### - -这里没有魔术。只是一个叫做“sl”的命令行工具。我假定它是在把ls打错的情况下为了好玩而开发的。如果你曾经在Linux的命令行下工作,你会知道ls是一个最常使用的一个命令,也许也是一个最经常打错的命令。 - -如果你想从这个终端下的火车获得一些乐趣,你可以使用下面的命令安装它。 - - sudo apt-get install sl - -要运行终端火车,只需要在终端中输入**sl**。它有以下几个选项: - -- -a : 意外模式。你会看见哭救的群众 -- -l : 显示一个更小的火车但有更多的车厢 -- -F : 一个飞行的火车 -- -e : 允许通过Ctrl+C。使用其他模式你不能使用Ctrl+C中断火车。但是,它不能长时间运行。 - -正常情况下,你应该会听到汽笛声但是在大多数Linux系统下都不管用,Ubuntu是其中一个。这就是一个意外的终端火车。 - -![Linux Terminal Train](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/04/Linux_Terminal_Train.jpeg) - --------------------------------------------------------------------------------- - -via: http://itsfoss.com/ubuntu-terminal-train/ - -作者:[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/ From 373fbde7526c0f45ddd783871703b3dea575a3ee Mon Sep 17 00:00:00 2001 From: Ezio Date: Tue, 25 Aug 2015 09:34:30 +0800 Subject: [PATCH 439/507] Update 20150728 Process of the Linux kernel building.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 校对到200line --- ...28 Process of the Linux kernel building.md | 75 ++++--------------- 1 file changed, 13 insertions(+), 62 deletions(-) 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 6f9368384c..b1c4388e66 100644 --- a/sources/tech/20150728 Process of the Linux kernel building.md +++ b/sources/tech/20150728 Process of the Linux kernel building.md @@ -1,40 +1,25 @@ Translating by Ezio -Process of the Linux kernel building -如何构建Linux 内核的 +如何构建Linux 内核 ================================================================================ 介绍 -------------------------------------------------------------------------------- -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. +我不会告诉你怎么在自己的电脑上去构建、安装一个定制化的Linux 内核,这样的[资料](https://encrypted.google.com/search?q=building+linux+kernel#q=building+linux+kernel+from+source+code) 太多了,它们会对你有帮助。本文会告诉你当你在内核源码路径里敲下`make` 时会发生什么。当我刚刚开始学习内核代码时,[Makefile](https://github.com/torvalds/linux/blob/master/Makefile) 是我打开的第一个文件,这个文件看起来真令人害怕 :)。那时候这个[Makefile](https://en.wikipedia.org/wiki/Make_%28software%29) 还只包含了`1591` 行代码,当我开始写本文是,这个[Makefile](https://github.com/torvalds/linux/commit/52721d9d3334c1cb1f76219a161084094ec634dc) 已经是第三个候选版本了。 -我不会告诉你怎么在自己的电脑上去构建、安装一个定制化的Linux 内核,这样的[资料](https://encrypted.google.com/search?q=building+linux+kernel#q=building+linux+kernel+from+source+code) 太多了,它们会对你有帮助。本文会告诉你当你在内核源码路径里敲下`make` 时会发生什么。当我刚刚开始学习内核代码时,[Makefile](https://github.com/torvalds/linux/blob/master/Makefile) 是我打开的第一个文件,这个文件真令人害怕 :)。那时候这个[Makefile](https://en.wikipedia.org/wiki/Make_%28software%29) 包含了`1591` 行代码,当我开始写本文是,这个[Makefile](https://github.com/torvalds/linux/commit/52721d9d3334c1cb1f76219a161084094ec634dc) 已经是第三个候选版本了。 - -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. - -这个makefile 是Linux 内核代码的顶端makefile ,内核构件就始于此处。是的,它的内容很多,但是如果你已经读过内核源代码,你就会发现每个包含代码的目录都有一个自己的makefile。当然了,我们不会去描述每个代码文件是怎么编译链接的。所以我们将只会挑选一些通用的例子来说明问题,而你不会在这里找到构建内核的文档,如何整洁内核代码, [tags](https://en.wikipedia.org/wiki/Ctags) 的生成,和[交叉编译](https://en.wikipedia.org/wiki/Cross_compiler) 相关的说明,等等。我们将从`make` 开始,使用标准的内核配置文件,到生成了内核镜像[bzImage](https://en.wikipedia.org/wiki/Vmlinux#bzImage) 结束。 +这个makefile 是Linux 内核代码的根makefile ,内核构建就始于此处。是的,它的内容很多,但是如果你已经读过内核源代码,你就会发现每个包含代码的目录都有一个自己的makefile。当然了,我们不会去描述每个代码文件是怎么编译链接的。所以我们将只会挑选一些通用的例子来说明问题,而你不会在这里找到构建内核的文档、如何整洁内核代码、[tags](https://en.wikipedia.org/wiki/Ctags) 的生成和[交叉编译](https://en.wikipedia.org/wiki/Cross_compiler) 相关的说明,等等。我们将从`make` 开始,使用标准的内核配置文件,到生成了内核镜像[bzImage](https://en.wikipedia.org/wiki/Vmlinux#bzImage) 结束。 如果你已经很了解[make](https://en.wikipedia.org/wiki/Make_%28software%29) 工具那是最好,但是我也会描述本文出现的相关代码。 让我们开始吧 -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. +在开始编译前要进行很多准备工作。最主要的就是找到并配置好配置文件,`make` 命令要使用到的参数都需要从这些配置文件获取。现在就让我们深入内核的根`makefile` 吧 -在开始便以前要进行很多准备工作。最主要的就是找到并配置好配置文件,`make` 命令要使用到的参数都需要从这些配置文件获取。 - -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` 负责构建两个主要的产品:[vmlinux](https://en.wikipedia.org/wiki/Vmlinux) (内核镜像可执行文件)和模块文件。内核的 [Makefile](https://github.com/torvalds/linux/blob/master/Makefile) 以次开始: +内核的根`Makefile` 负责构建两个主要的文件:[vmlinux](https://en.wikipedia.org/wiki/Vmlinux) (内核镜像可执行文件)和模块文件。内核的 [Makefile](https://github.com/torvalds/linux/blob/master/Makefile) 从此处开始: ```Makefile VERSION = 4 @@ -44,16 +29,12 @@ 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: - 这些变量决定了当前内核的版本,并且被使用在很多不同的地方,比如`KERNELVERSION` : ```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: - 接下来我们会看到很多`ifeq` 条件判断语句,它们负责检查传给`make` 的参数。内核的`Makefile` 提供了一个特殊的编译选项`make help` ,这个选项可以生成所有的可用目标和一些能传给`make` 的有效的命令行参数。举个例子,`make V=1` 会在构建过程中输出详细的编译信息,第一个`ifeq` 就是检查传递给make的`V=n` 选项。 ```Makefile @@ -75,9 +56,7 @@ 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`: - -如果`V=n` 这个选项传给了`make` ,系统就会给变量`KBUILD_VERBOSE` 选项附上`V` 的值,否则的话`KBUILD_VERBOSE` 就会为0。然后系统会检查`KBUILD_VERBOSE` 的值,以此来决定`quiet` 和`Q` 的值。符号`@` 控制命令的输出,如果它被放在一个命令之前,这条命令的执行将会是`CC scripts/mod/empty.o`,而不是`Compiling .... scripts/mod/empty.o`(注:CC 在makefile 中一般都是编译命令)。最后系统仅仅导出所有的变量。下一个`ifeq` 语句检查的是传递给`make` 的选项`O=/dir`,这个选项允许在指定的目录`dir` 输出所有的结果文件: +如果`V=n` 这个选项传给了`make` ,系统就会给变量`KBUILD_VERBOSE` 选项附上`V` 的值,否则的话`KBUILD_VERBOSE` 就会为`0`。然后系统会检查`KBUILD_VERBOSE` 的值,以此来决定`quiet` 和`Q` 的值。符号`@` 控制命令的输出,如果它被放在一个命令之前,这条命令的执行将会是`CC scripts/mod/empty.o`,而不是`Compiling .... scripts/mod/empty.o`(注:CC 在makefile 中一般都是编译命令)。最后系统仅仅导出所有的变量。下一个`ifeq` 语句检查的是传递给`make` 的选项`O=/dir`,这个选项允许在指定的目录`dir` 输出所有的结果文件: ```Makefile ifeq ($(KBUILD_SRC),) @@ -102,15 +81,7 @@ 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: -系统会检查变量`KBUILD_SRC`,如果他是空的(第一次执行makefile 时总是空的),并且变量`KBUILD_OUTPUT` 被设成了选项`O` 的值(如果这个选项被传进来了),那么这个值就会用来代表内核源码的顶层目录。下一步会检查变量`KBUILD_OUTPUT` ,如果之前设置过这个变量,那么接下来会做一下几件事: +系统会检查变量`KBUILD_SRC`,如果他是空的(第一次执行makefile 时总是空的),并且变量`KBUILD_OUTPUT` 被设成了选项`O` 的值(如果这个选项被传进来了),那么这个值就会用来代表内核源码的顶层目录。下一步会检查变量`KBUILD_OUTPUT` ,如果之前设置过这个变量,那么接下来会做以下几件事: * 将变量`KBUILD_OUTPUT` 的值保存到临时变量`saved-output`; * 尝试创建输出目录; @@ -132,8 +103,6 @@ ifeq ("$(origin M)", "command line") 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 `.`: - 第一个选项`C` 会告诉`makefile` 需要使用环境变量`$CHECK` 提供的工具来检查全部`c` 代码,默认情况下会使用[sparse](https://en.wikipedia.org/wiki/Sparse)。第二个选项`M` 会用来编译外部模块(本文不做讨论)。因为设置了这两个变量,系统还会检查变量`KBUILD_SRC`,如果`KBUILD_SRC` 没有被设置,系统会设置变量`srctree` 为`.`: ```Makefile @@ -148,9 +117,7 @@ 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 setting value for the `SUBARCH` variable that will represent what the underlying archicecture is: - -这将会告诉`Makefile` 内核的源码树就在执行make 命令的目录。然后要设置`objtree` 和其他变量为执行make 命令的目录,并且将这些变量导出。接着就是要获取`SUBARCH` 的值,这个变量代表了当前的系统架构(注:一般值CPU 架构): +这将会告诉`Makefile` 内核的源码树就在执行make 命令的目录。然后要设置`objtree` 和其他变量为执行make 命令的目录,并且将这些变量导出。接着就是要获取`SUBARCH` 的值,这个变量代表了当前的系统架构(注:一般都指CPU 架构): ```Makefile SUBARCH := $(shell uname -m | sed -e s/i.86/x86/ -e s/x86_64/x86/ \ @@ -161,8 +128,6 @@ SUBARCH := $(shell uname -m | sed -e s/i.86/x86/ -e s/x86_64/x86/ \ -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: - 如你所见,系统执行[uname](https://en.wikipedia.org/wiki/Uname) 得到机器、操作系统和架构的信息。因为我们得到的是`uname` 的输出,所以我们需要做一些处理在赋给变量`SUBARCH` 。获得`SUBARCH` 之后就要设置`SRCARCH` 和`hfr-arch`,`SRCARCH`提供了硬件架构相关代码的目录,`hfr-arch` 提供了相关头文件的目录: ```Makefile @@ -176,18 +141,13 @@ 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: - -注意:`ARCH` 是`SUBARCH` 的别名。如果没有设置过代表内核配置文件路径的变量`KCONFIG_CONFIG`,下一步系统会设置他,默认情况下就是`.config` : +注意:`ARCH` 是`SUBARCH` 的别名。如果没有设置过代表内核配置文件路径的变量`KCONFIG_CONFIG`,下一步系统会设置它,默认情况下就是`.config` : ```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: - -和编译内核过程中要用到的[shell](https://en.wikipedia.org/wiki/Shell_%28computing%29) +以及编译内核过程中要用到的[shell](https://en.wikipedia.org/wiki/Shell_%28computing%29) ```Makefile CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \ @@ -195,10 +155,7 @@ CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$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: - -接下来就要设置一组和编译内核的编译器相关的变量。我们会设置host 的C 和C++ 的编译器及相关配置项: - +接下来就要设置一组和编译内核的编译器相关的变量。我们会设置主机的`C` 和`C++` 的编译器及相关配置项: ```Makefile HOSTCC = gcc @@ -207,9 +164,7 @@ HOSTCFLAGS = -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-p 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): - -然后会去适配代表编译器的变量`CC`,为什么还要`HOST*` 这些选项呢?`CC` 是编译内核过程中要使用的目标架构的编译器,但是`HOSTCC` 是要被用来编译一组`host` 程序的(下面我们就会看到)。然后我们就看看变量`KBUILD_MODULES` 和`KBUILD_BUILTIN` 的定义,这两个变量据欸的那个了我们要编译什么(内核、模块还是其他?): +下一步会去适配代表编译器的变量`CC`,那为什么还要`HOST*` 这些选项呢?这是因为`CC` 是编译内核过程中要使用的目标架构的编译器,但是`HOSTCC` 是要被用来编译一组`host` 程序的(下面我们就会看到)。然后我们就看看变量`KBUILD_MODULES` 和`KBUILD_BUILTIN` 的定义,这两个变量决定了我们要编译什么东西(内核、模块还是其他): ```Makefile KBUILD_MODULES := @@ -220,16 +175,12 @@ ifeq ($(MAKECMDGOALS),modules) 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: - -在这我们可以看到这些变量的定义,并且,如果们仅仅传递了`modules` 给`make`,变量`KBUILD_BUILTIN` 会依赖于内核配置选项`CONFIG_MODVERSIONS`。下一步操作是引入: +在这我们可以看到这些变量的定义,并且,如果们仅仅传递了`modules` 给`make`,变量`KBUILD_BUILTIN` 会依赖于内核配置选项`CONFIG_MODVERSIONS`。下一步操作是引入下面的文件: ```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...): - 文件`kbuild` ,[Kbuild](https://github.com/torvalds/linux/blob/master/Documentation/kbuild/kbuild.txt) 或者又叫做 `Kernel Build System`是一个用来管理构建内核和模块的特殊框架。`kbuild` 文件的语法与makefile 一样。文件[scripts/Kbuild.include](https://github.com/torvalds/linux/blob/master/scripts/Kbuild.include) 为`kbuild` 系统同提供了一些原生的定义。因为我们包含了这个`kbuild` 文件,我们可以看到和不同工具关联的这些变量的定义,这些工具会在内核和模块编译过程中被使用(比如链接器、编译器、二进制工具包[binutils](http://www.gnu.org/software/binutils/),等等): ```Makefile From 640b23a26acd2f824897e27b7d033398edc16989 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 25 Aug 2015 09:35:53 +0800 Subject: [PATCH 440/507] translated --- ...aving Fun With Linux Terminal In Ubuntu.md | 26 +++++++++---------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/sources/share/20150824 Watch These Kids Having Fun With Linux Terminal In Ubuntu.md b/sources/share/20150824 Watch These Kids Having Fun With Linux Terminal In Ubuntu.md index 3ce51b9379..3d0efff7b5 100644 --- a/sources/share/20150824 Watch These Kids Having Fun With Linux Terminal In Ubuntu.md +++ b/sources/share/20150824 Watch These Kids Having Fun With Linux Terminal In Ubuntu.md @@ -1,28 +1,26 @@ -translating---geekpi - -Watch These Kids Having Fun With Linux Terminal In Ubuntu +看这些孩子在Ubuntu的Linux终端下玩耍 ================================================================================ -I found this short video of children having fun with Linux terminals in their computer lab at school. I do not know where do they belong to, but I guess it is either in Indonesia or Malaysia. +我发现了一个孩子们在他们的计算机教室里玩得很开心的视频。我不知道他们在哪里,但我猜测是在印度尼西亚或者马来西亚。 注:youtube 视频 -### Run train in Linux terminal ### +### 在Linux终端下面跑火车 ### -There is no magic here. It’s just a small command line fun tool called ‘sl’. I presume that it was developed entirely to have some fun when command ls is wrongly typed. If you ever worked on Linux terminal, you know that ls is one of the most commonly used commands and perhaps one of the most frequently mis-typed command as well. +这里没有魔术。只是一个叫做“sl”的命令行工具。我假定它是在把ls打错的情况下为了好玩而开发的。如果你曾经在Linux的命令行下工作,你会知道ls是一个最常使用的一个命令,也许也是一个最经常打错的命令。 -If you want to have little fun with this terminal train, you can install it using the following command: +如果你想从这个终端下的火车获得一些乐趣,你可以使用下面的命令安装它。 sudo apt-get install sl -To run the terminal train, just type **sl** in the terminal. It also has the following options: +要运行终端火车,只需要在终端中输入**sl**。它有以下几个选项: -- -a : Accident mode. You can see people crying help -- -l : shows a smaller train but with more coaches -- -F : A flying train -- -e : Allows interrupt by Ctrl+C. In other mode you cannot use Ctrl+C to stop the train. But then, it doesn’t run for long. +- -a : 意外模式。你会看见哭救的群众 +- -l : 显示一个更小的火车但有更多的车厢 +- -F : 一个飞行的火车 +- -e : 允许通过Ctrl+C。使用其他模式你不能使用Ctrl+C中断火车。但是,它不能长时间运行。 -Normally, you should hear the whistle as well but it doesn’t work in most of the Linux OS, Ubuntu 14.04 being one of them. Here is the accidental terminal train :) +正常情况下,你应该会听到汽笛声但是在大多数Linux系统下都不管用,Ubuntu是其中一个。这就是一个意外的终端火车。 ![Linux Terminal Train](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/04/Linux_Terminal_Train.jpeg) @@ -31,7 +29,7 @@ Normally, you should hear the whistle as well but it doesn’t work in most of t via: http://itsfoss.com/ubuntu-terminal-train/ 作者:[Abhishek][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 2fccde8110f326870b455cc0613c4ac8a6f96b69 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 25 Aug 2015 09:38:06 +0800 Subject: [PATCH 441/507] Rename sources/share/20150824 Watch These Kids Having Fun With Linux Terminal In Ubuntu.md to translated/share/20150824 Watch These Kids Having Fun With Linux Terminal In Ubuntu.md --- ...4 Watch These Kids Having Fun With Linux Terminal In Ubuntu.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/share/20150824 Watch These Kids Having Fun With Linux Terminal In Ubuntu.md (100%) diff --git a/sources/share/20150824 Watch These Kids Having Fun With Linux Terminal In Ubuntu.md b/translated/share/20150824 Watch These Kids Having Fun With Linux Terminal In Ubuntu.md similarity index 100% rename from sources/share/20150824 Watch These Kids Having Fun With Linux Terminal In Ubuntu.md rename to translated/share/20150824 Watch These Kids Having Fun With Linux Terminal In Ubuntu.md From 734846d1c71a5a96351b16d5d8b0e2913bf78df6 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 25 Aug 2015 09:41:56 +0800 Subject: [PATCH 442/507] translating --- ...0824 Basics Of NetworkManager Command Line Tool Nmcli.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sources/tech/20150824 Basics Of NetworkManager Command Line Tool Nmcli.md b/sources/tech/20150824 Basics Of NetworkManager Command Line Tool Nmcli.md index 577411f58a..d911cfcc0e 100644 --- a/sources/tech/20150824 Basics Of NetworkManager Command Line Tool Nmcli.md +++ b/sources/tech/20150824 Basics Of NetworkManager Command Line Tool Nmcli.md @@ -1,4 +1,6 @@ - Basics Of NetworkManager Command Line Tool, Nmcli +translating----geekpi + +Basics Of NetworkManager Command Line Tool, Nmcli ================================================================================ ![](http://1102047360.rsc.cdn77.org/wp-content/uploads/2015/08/networking1.jpg) @@ -150,4 +152,4 @@ via: http://www.unixmen.com/basics-networkmanager-command-line-tool-nmcli/ 译者:[译者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 e156ecf77804e1661f6625c3d9dac3a81cbf37f2 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 25 Aug 2015 10:16:45 +0800 Subject: [PATCH 443/507] translated --- ... NetworkManager Command Line Tool Nmcli.md | 82 +++++++++---------- 1 file changed, 41 insertions(+), 41 deletions(-) rename {sources => translated}/tech/20150824 Basics Of NetworkManager Command Line Tool Nmcli.md (62%) diff --git a/sources/tech/20150824 Basics Of NetworkManager Command Line Tool Nmcli.md b/translated/tech/20150824 Basics Of NetworkManager Command Line Tool Nmcli.md similarity index 62% rename from sources/tech/20150824 Basics Of NetworkManager Command Line Tool Nmcli.md rename to translated/tech/20150824 Basics Of NetworkManager Command Line Tool Nmcli.md index d911cfcc0e..5ddb31d1ea 100644 --- a/sources/tech/20150824 Basics Of NetworkManager Command Line Tool Nmcli.md +++ b/translated/tech/20150824 Basics Of NetworkManager Command Line Tool Nmcli.md @@ -1,20 +1,18 @@ -translating----geekpi - -Basics Of NetworkManager Command Line Tool, Nmcli +网络管理命令行工具基础,Nmcli ================================================================================ ![](http://1102047360.rsc.cdn77.org/wp-content/uploads/2015/08/networking1.jpg) -### Introduction ### +### 介绍 ### -In this tutorial, we will discuss NetworkManager command line tool, aka **nmcli**, in CentOS / RHEL 7. Users who are using **ifconfig** should avoid this command in Centos 7. +在本教程中,我们会在CentOS / RHEL 7中讨论网络管理工具,也叫**nmcli**。那些使用**ifconfig**的用户应该在CentOS 7中避免使用这个命令。 -Lets configure some networking settings with nmcli utility. +让我们用nmcli工具配置一些网络设置。 -#### To get all address information of all interfaces connected with System #### +### 要得到系统中所有接口的地址信息 ### [root@localhost ~]# ip addr show -**Sample Output:** +**示例输出:** 1: lo: mtu 65536 qdisc noqueue state UNKNOWN link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 @@ -29,53 +27,53 @@ Lets configure some networking settings with nmcli utility. inet6 fe80::20c:29ff:fe67:2f4c/64 scope link valid_lft forever preferred_lft forever -#### To retrieve packets statistics related with connected interfaces #### +#### 检索与连接的接口相关的数据包统计 #### [root@localhost ~]# ip -s link show eno16777736 -**Sample Output:** +**示例输出:** ![unxmen_(011)](http://www.unixmen.com/wp-content/uploads/2015/08/unxmen_0111.png) -#### Get routing configuration #### +#### 得到路由配置 #### [root@localhost ~]# ip route -Sample Output: +示例输出: default via 192.168.1.1 dev eno16777736 proto static metric 100 192.168.1.0/24 dev eno16777736 proto kernel scope link src 192.168.1.51 metric 100 -#### Analyze path for some host/website #### +#### 分析主机/网站路径 #### [root@localhost ~]# tracepath unixmen.com -Output will be just like traceroute but in more managed form. +输出像traceroute,但是更加完整。 ![unxmen_0121](http://www.unixmen.com/wp-content/uploads/2015/08/unxmen_01211.png) -### nmcli utility ### +### nmcli 工具 ### -**Nmcli** is a very rich and flexible command line utility. some of the terms used in nmcli are: +**Nmcli** 是一个非常丰富和灵活的命令行工具。nmcli使用的情况有: -- **Device** – A network interface being used. -- **Connection** – A set of configuration settings, for a single device you can have multiple connections, you can switch between connections. +- **设备** – 正在使用的网络接口 +- **连接** – 一组配置设置,对于一个单一的设备可以有多个连接,可以在连接之间切换。 -#### Find out how many connections are available for how many devices #### +#### 找出有多少连接服务于多少设备 #### [root@localhost ~]# nmcli connection show ![unxmen_(013)](http://www.unixmen.com/wp-content/uploads/2015/08/unxmen_013.png) -#### Get details of a specific connection #### +#### 得到特定连接的详情 #### [root@localhost ~]# nmcli connection show eno1 -**Sample output:** +**示例输出:** ![unxmen_(014)](http://www.unixmen.com/wp-content/uploads/2015/08/unxmen_0141.png) -#### Get the Network device status #### +#### 得到网络设备状态 #### [root@localhost ~]# nmcli device status @@ -85,71 +83,73 @@ Output will be just like traceroute but in more managed form. eno16777736 ethernet connected eno1 lo loopback unmanaged -- -#### Create a new connection with “dhcp” #### +#### 使用“dhcp”创建新的连接 #### [root@localhost ~]# nmcli connection add con-name "dhcp" type ethernet ifname eno16777736 -Where, +这里, -- **Connection add** – To add new connection -- **con-name** – connection name -- **type** – type of device -- **ifname** – interface name +- **Connection add** – 添加新的连接 +- **con-name** – 连接名 +- **type** – 设备类型 +- **ifname** – 接口名 -This command will add connection with dhcp protocol. +这个命令会使用dhcp协议添加连接 -**Sample output:** +**示例输出:** Connection 'dhcp' (163a6822-cd50-4d23-bb42-8b774aeab9cb) successfully added. -#### Instead of assigning an IP via dhcp, you can add ip address as “static” #### +#### 不同过dhcp分配IP,使用“static”添加地址 #### [root@localhost ~]# nmcli connection add con-name "static" ifname eno16777736 autoconnect no type ethernet ip4 192.168.1.240 gw4 192.168.1.1 -**Sample Output:** +**示例输出:** Connection 'static' (8e69d847-03d7-47c7-8623-bb112f5cc842) successfully added. -**Update connection:** +**更新连接:** [root@localhost ~]# nmcli connection up eno1 Again Check, whether ip address is changed or not. +再检查一遍,ip地址是否已经改变 [root@localhost ~]# ip addr show ![unxmen_(015)](http://www.unixmen.com/wp-content/uploads/2015/08/unxmen_0151.png) -#### Add DNS settings to Static connections. #### +#### 添加DNS设置到静态连接中 #### [root@localhost ~]# nmcli connection modify "static" ipv4.dns 202.131.124.4 -#### Add additional DNS value. #### +#### 添加额外的DNS值 #### [root@localhost ~]# nmcli connection modify "static" +ipv4.dns 8.8.8.8 -**Note**: For additional entries **+** symbol will be used and **+ipv4.dns** will be used instead on **ip4.dns** +**注意**:要使用额外的**+**符号,并且要是**+ipv4.dns**,而不是**ip4.dns**。 -Put an additional ip address: + +添加一个额外的ip地址: [root@localhost ~]# nmcli connection modify "static" +ipv4.addresses 192.168.200.1/24 -Refresh settings using command: +使用命令刷新设置: [root@localhost ~]# nmcli connection up eno1 ![unxmen_(016)](http://www.unixmen.com/wp-content/uploads/2015/08/unxmen_016.png) -You will see, setting are effective now. +你会看见,设置生效了。 -That’s it. +完结 -------------------------------------------------------------------------------- via: http://www.unixmen.com/basics-networkmanager-command-line-tool-nmcli/ 作者:Rajneesh Upadhyay -译者:[译者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 dec3d0e0bde984923c90b288293efabd641d9a4a Mon Sep 17 00:00:00 2001 From: bazz2 Date: Tue, 25 Aug 2015 11:59:20 +0800 Subject: [PATCH 444/507] [translated by bazz2]A Look at What's Next for the Linux Kernel --- ...ook at What's Next for the Linux Kernel.md | 50 ------------------- ...ook at What's Next for the Linux Kernel.md | 49 ++++++++++++++++++ 2 files changed, 49 insertions(+), 50 deletions(-) delete mode 100644 sources/talk/20150820 A Look at What's Next for the Linux Kernel.md create mode 100644 translated/talk/20150820 A Look at What's Next for the Linux Kernel.md diff --git a/sources/talk/20150820 A Look at What's Next for the Linux Kernel.md b/sources/talk/20150820 A Look at What's Next for the Linux Kernel.md deleted file mode 100644 index e46a4b538d..0000000000 --- a/sources/talk/20150820 A Look at What's Next for the Linux Kernel.md +++ /dev/null @@ -1,50 +0,0 @@ -[bazz22222222222] -A Look at What's Next for the Linux Kernel -================================================================================ -![](http://www.eweek.com/imagesvr_ce/485/290x195cilinux1.jpg) - -**The upcoming Linux 4.2 kernel will have more contributors than any other Linux kernel in history, according to Linux kernel developer Jonathan Corbet.** - -SEATTLE—The Linux kernel continues to grow—both in lines of code and the number of developers that contribute to it—yet some challenges need to be addressed. That was one of the key messages from Linux kernel developer Jonathan Corbet during his annual Kernel Report session at the LinuxCon conference here. - -The Linux 4.2 kernel is still under development, with general availability expected on Aug. 23. Corbet noted that 1,569 developers have contributed code for the Linux 4.2 kernel. Of those, 277 developers made their first contribution ever, during the Linux 4.2 development cycle. - -Even as more developers are coming to Linux, the pace of development and releases is very fast, Corbet said. He estimates that it now takes approximately 63 days for the community to build a new Linux kernel milestone. - -Linux 4.2 will benefit from a number of improvements that have been evolving in Linux over the last several releases. One such improvement is the introduction of OverlayFS, a new type of read-only file system that is useful because it can enable many containers to be layered on top of each other, Corbet said. - -Linux networking also is set to improve small packet performance, which is important for areas such as high-frequency financial trading. The improvements are aimed at reducing the amount of time and power needed to process each data packet, Corbet said. - -New drivers are always being added to Linux. On average, there are 60 to 80 new or updated drivers added in every Linux kernel development cycle, Corbet said. - -Another key area that continues to improve is that of Live Kernel patching, first introduced in the Linux 4.0 kernel. With live kernel patching, the promise is that a system administrator can patch a live running kernel without the need to reboot a running production system. While the basic elements of live kernel patching are in the kernel already, work is under way to make the technology all work with the right level of consistency and stability, Corbet explained. - -**Linux Security, IoT and Other Concerns** - -Security has been a hot topic in the open-source community in the past year due to high-profile issues, including Heartbleed and Shellshock. - -"I don't doubt there are some unpleasant surprises in the neglected Linux code at this point," Corbet said. - -He noted that there are more than 3 millions lines of code in the Linux kernel today that have been untouched in the last decade by developers and that the Shellshock vulnerability was a flaw in 20-year-old code that hadn't been looked at in some time. - -Another issue that concerns Corbet is the Unix 2038 issue—the Linux equivalent of the Y2K bug, which could have caused global havoc in the year 2000 if it hadn't been fixed. With the 2038 issue, there is a bug that could shut down Linux and Unix machines in the year 2038. Corbet said that while 2038 is still 23 years away, there are systems being deployed now that will be in use in the 2038. - -Some initial work took place to fix the 2038 flaw in Linux, but much more remains to be done, Corbet said. "The time to fix this is now, not 20 years from now in a panic when we're all trying to enjoy our retirement," Corbet said. - -The Internet of things (IoT) is another area of Linux concern for Corbet. Today, Linux is a leading embedded operating system for IoT, but that might not always be the case. Corbet is concerned that the Linux kernel's growth is making it too big in terms of memory footprint to work in future IoT devices. - -A Linux project is now under way to minimize the size of the Linux kernel, and it's important that it gets the support it needs, Corbet said. - -"Either Linux is suitable for IoT, or something else will come along and that something else might not be as free and open as Linux," Corbet said. "We can't assume the continued dominance of Linux in IoT. We have to earn it. We have to pay attention to stuff that makes the kernel bigger." - --------------------------------------------------------------------------------- - -via: http://www.eweek.com/enterprise-apps/a-look-at-whats-next-for-the-linux-kernel.html - -作者:[Sean Michael Kerner][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.eweek.com/cp/bio/Sean-Michael-Kerner/ diff --git a/translated/talk/20150820 A Look at What's Next for the Linux Kernel.md b/translated/talk/20150820 A Look at What's Next for the Linux Kernel.md new file mode 100644 index 0000000000..daf3e4d0e3 --- /dev/null +++ b/translated/talk/20150820 A Look at What's Next for the Linux Kernel.md @@ -0,0 +1,49 @@ +Linux 内核的发展方向 +================================================================================ +![](http://www.eweek.com/imagesvr_ce/485/290x195cilinux1.jpg) + +**即将到来的 Linux 4.2 内核涉及到史上最多的贡献者数量,内核开发者 Jonathan Corbet 如是说。** + +来自西雅图。Linux 内核持续增长:代码量在增加,代码贡献者数量也在增加。而随之而来的一些挑战需要处理一下。以上是 Jonathan Corbet 在今年的 LinuxCon 的内核年度报告上提出的主要观点。以下是他的主要演讲内容: + +Linux 4.2 内核依然处于开发阶段,预计在8月23号释出。Corbet 强调有 1569 名开发者为这个版本贡献了代码,其中 277 名是第一次提交代码。 + +越来越多的开发者的加入,内核更新非常快,Corbet 估计现在大概 63 天就能产生一个新的内核里程碑。 + +Linux 4.2 涉及多方面的更新。其中一个就是引进了 OverLayFS,这是一种只读型文件系统,它可以实现在一个容器之上再放一个容器。 + +网络系统对小包传输性能也有了提升,这对于高频传输领域如金融交易而言非常重要。提升的方面主要集中在减小处理数据包的时间的能耗。 + +依然有新的驱动中加入内核。在每个内核发布周期,平均会有 60 到 80 个新增或升级驱动中加入。 + +另一个主要更新是实时内核补丁,这个特性在 4.0 版首次引进,好处是系统管理员可以在生产环境中打上内核补丁而不需要重启系统。当补丁所需要的元素都已准备就绪,打补丁的过程会在后台持续而稳定地进行。 + +**Linux 安全, IoT 和其他关注点 ** + +过去一年中,安全问题在开源社区是一个很热的话题,这都归因于那些引发高度关注的事件,比如 Heartbleed 和 Shellshock。 + +“我毫不怀疑 Linux 代码对这些方面的忽视会产生一些令人不悦的问题”,Corbet 原话。 + +他强调说过去 10 年间有超过 3 百万行代码不再被开发者修改,而产生 Shellshock 漏洞的代码的年龄已经是 20 岁了,近年来更是无人问津。 + +另一个关注点是 2038 问题,Linux 界的“千年虫”,如果不解决,2000 年出现过的问题还会重现。2038 问题说的是在 2038 年一些 Linux 和 Unix 机器会死机(LCTT:32 位系统记录的时间,在2038年1月19日星期二晚上03:14:07之后的下一秒,会变成负数)。Corbet 说现在离 2038 年还有 23 年时间,现在部署的系统都会考虑 2038 问题。 + +Linux 已经开始一些初步的方案来修复 2038 问题了,但做的还远远不够。“现在就要修复这个问题,而不是等 20 年后把这个头疼的问题留给下一代解决,我们却享受着退休的美好时光”。 + +物联网(IoT)也是 Linux 关注的领域,Linux 是物联网嵌入式操作系统的主要占有者,然而这并没有什么卵用。Corget 认为日渐臃肿的内核对于未来的物联网设备来说肯定过于庞大。 + +现在有一个项目就是做内核最小化的,获取足够的支持对于这个项目来说非常重要。 + +“除了 Linux 之外,也有其他项目可以做物联网,但那些项目不会像 Linux 一样开放”,Corbet 说,“我们不能指望 Linux 在物联网领域一直保持优势,我们需要靠自己的努力去做到这点,我们需要注意不能让内核变得越来越臃肿。” + +-------------------------------------------------------------------------------- + +via: http://www.eweek.com/enterprise-apps/a-look-at-whats-next-for-the-linux-kernel.html + +作者:[Sean Michael Kerner][a] +译者:[bazz2](https://github.com/bazz2) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.eweek.com/cp/bio/Sean-Michael-Kerner/ From bb90b935cb19af90b0dd9a5b118f0e5e3cd185f3 Mon Sep 17 00:00:00 2001 From: bazz2 Date: Tue, 25 Aug 2015 12:04:59 +0800 Subject: [PATCH 445/507] [translating by bazz2]Linuxcon--The Changing Role of the Server OS --- .../20150819 Linuxcon--The Changing Role of the Server OS.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/talk/20150819 Linuxcon--The Changing Role of the Server OS.md b/sources/talk/20150819 Linuxcon--The Changing Role of the Server OS.md index 8f6d80c7e9..832cb6a30a 100644 --- a/sources/talk/20150819 Linuxcon--The Changing Role of the Server OS.md +++ b/sources/talk/20150819 Linuxcon--The Changing Role of the Server OS.md @@ -1,3 +1,4 @@ +[bazz2222222] Linuxcon: The Changing Role of the Server OS ================================================================================ SEATTLE - Containers might one day change the world, but it will take time and it will also change the role of the operating system. That's the message delivered during a Linuxcon keynote here today by Wim Coekaerts, SVP Linux and virtualization engineering at Oracle. @@ -46,4 +47,4 @@ via: http://www.serverwatch.com/server-news/linuxcon-the-changing-role-of-the-se 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 -[a]:http://www.serverwatch.com/author/Sean-Michael-Kerner-101580.htm \ No newline at end of file +[a]:http://www.serverwatch.com/author/Sean-Michael-Kerner-101580.htm From 451807e602f9dc33916e0a76e9056e582440b778 Mon Sep 17 00:00:00 2001 From: bazz2 Date: Tue, 25 Aug 2015 14:18:53 +0800 Subject: [PATCH 446/507] [translated by bazz2]Linuxcon--The Changing Role of the Server OS --- ...con--The Changing Role of the Server OS.md | 50 ------------------- ...con--The Changing Role of the Server OS.md | 50 +++++++++++++++++++ 2 files changed, 50 insertions(+), 50 deletions(-) delete mode 100644 sources/talk/20150819 Linuxcon--The Changing Role of the Server OS.md create mode 100644 translated/talk/20150819 Linuxcon--The Changing Role of the Server OS.md diff --git a/sources/talk/20150819 Linuxcon--The Changing Role of the Server OS.md b/sources/talk/20150819 Linuxcon--The Changing Role of the Server OS.md deleted file mode 100644 index 832cb6a30a..0000000000 --- a/sources/talk/20150819 Linuxcon--The Changing Role of the Server OS.md +++ /dev/null @@ -1,50 +0,0 @@ -[bazz2222222] -Linuxcon: The Changing Role of the Server OS -================================================================================ -SEATTLE - Containers might one day change the world, but it will take time and it will also change the role of the operating system. That's the message delivered during a Linuxcon keynote here today by Wim Coekaerts, SVP Linux and virtualization engineering at Oracle. - -![](http://www.serverwatch.com/imagesvr_ce/6421/wim-200x150.jpg) - -Coekaerts started his presentation by putting up a slide stating it's the year of the desktop, which generated a few laughs from the audience. Oracle Wim Coekarts Truly, though, Coekaerts said it is now apparent that 2015 is the year of the container, and more importantly the year of the application, which is what containers really are all about. - -"What do you need an operating system for?" Coekaerts asked. "It's really just there to run an application; an operating system is there to manage hardware and resources so your app can run." - -Coekaerts added that with Docker containers, the focus is once again on the application. At Oracle, Coekaerts said much of the focus is on how to make the app run better on the OS. - -"Many people are used to installing apps, but many of the younger generation just click a button on their mobile device and it runs," Coekaerts said. - -Coekaerts said that people now wonder why it's more complex in the enterprise to install software, and Docker helps to change that. - -"The role of the operating system is changing," Coekaerts said. - -The rise of Docker does not mean the demise of virtual machines (VMs), though. Coekaerts said it will take a very long time for things to mature in the containerization space and get used in real world. - -During that period VMs and containers will co-exist and there will be a need for transition and migration tools between containers and VMs. For example, Coekaerts noted that Oracle's VirtualBox open-source technology is widely used on desktop systems today as a way to help users run Docker. The Docker Kitematic project makes use of VirtualBox to boot Docker on Macs today. - -### The Open Compute Initiative and Write Once, Deploy Anywhere for Containers ### - -A key promise that needs to be enabled for containers to truly be successful is the concept of write once, deploy anywhere. That's an area where the Linux Foundations' Open Compute Initiative (OCI) will play a key role in enabling interoperability across container runtimes. - -"With OCI, it will make it easier to build once and run anywhere, so what you package locally you can run wherever you want," Coekaerts said. - -Overall, though, Coekaerts said that while there is a lot of interest in moving to the container model, it's not quite ready yet. He noted Oracle is working on certifying its products to run in containers, but it's a hard process. - -"Running the database is easy; it's everything else around it that is complex," Coekaerts said. "Containers don't behave the same as VMs, and some applications depend on low-level system configuration items that are not exposed from the host to the container." - -Additionally, Coekaerts commented that debugging problems inside a container is different than in a VM, and there is currently a lack of mature tools for proper container app debugging. - -Coekaerts emphasized that as containers matures it's important to not forget about the existing technology that organizations use to run and deploy applications on servers today. He said enterprises don't typically throw out everything they have just to start with new technology. - -"Deploying new technology is hard, and you need to be able to transition from what you have," Coekaerts said. "The technology that allows you to transition easily is the technology that wins." - --------------------------------------------------------------------------------- - -via: http://www.serverwatch.com/server-news/linuxcon-the-changing-role-of-the-server-os.html - -作者:[Sean Michael Kerner][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.serverwatch.com/author/Sean-Michael-Kerner-101580.htm diff --git a/translated/talk/20150819 Linuxcon--The Changing Role of the Server OS.md b/translated/talk/20150819 Linuxcon--The Changing Role of the Server OS.md new file mode 100644 index 0000000000..98a0f94b03 --- /dev/null +++ b/translated/talk/20150819 Linuxcon--The Changing Role of the Server OS.md @@ -0,0 +1,50 @@ +LinuxCon: 服务器操作系统的转型 +================================================================================ +来自西雅图。容器迟早要改变世界,以及改变操作系统的角色。这是 Wim Coekaerts 带来的 LinuxCon 演讲主题,Coekaerts 是 Oracle 公司 Linux 与虚拟化工程的高级副总裁。 + +![](http://www.serverwatch.com/imagesvr_ce/6421/wim-200x150.jpg) + +Coekaerts 在开始演讲的时候拿出一张关于“桌面之年”的幻灯片,引发了现场观众的一片笑声。之后他说 2015 年很明显是容器之年,更是应用之年,应用才是容器的关键。 + +“你需要操作系统做什么事情?”,Coekaerts 回答现场观众:“只需一件事:运行一个应用。操作系统负责管理硬件和资源,来让你的应用运行起来。” + +Coakaerts 说在 Docker 容器的帮助下,我们的注意力再次集中在应用上,而在 Oracle,我们将注意力放在如何让应用更好地运行在操作系统上。 + +“许多人过去常常需要繁琐地安装应用,而现在的年轻人只需要按一个按钮就能让应用在他们的移动设备上运行起来”。 + +人们对安装企业版的软件需要这么复杂的步骤而感到惊讶,而 Docker 帮助他们脱离了这片苦海。 + +“操作系统的角色已经变了。” Coekaerts 说。 + +Docker 的出现不代表虚拟机的淘汰,容器化过程需要经过很长时间才能变得成熟,然后才能在世界范围内得到应用。 + +在这段时间内,容器会与虚拟机共存,并且我们需要一些工具,将应用在容器和虚拟机之间进行转换迁移。Coekaerts 举例说 Oracle 的 VirtualBox 就可以用来帮助用户运行 Docker,而它原来是被广泛用在桌面系统上的一项开源技术。现在 Docker 的 Kitematic 项目将在 Mac 上使用 VirtualBox 运行 Docker。 + +### The Open Compute Initiative and Write Once, Deploy Anywhere for Containers ### +### 容器的开放计算计划和一次写随处部署 ### + +一个能让容器成功的关键是“一次写,随处部署”的概念。而在容器之间的互操作领域,Linux 基金会的开放计算计划(OCI)扮演一个非常关键的角色。 + +“使用 OCI,应用编译一次后就可以很方便地在多地运行,所以你可以将你的应用部署在任何地方”。 + +Coekaerts 总结说虽然在迁移到容器模型过程中会发生很多好玩的事情,但容器还没真正做好准备,他强调 Oracle 现在正在验证将产品运行在容器内的可行性,但这是一个非常艰难的过程。 + +“运行数据库很简单,难的是要搞定数据库所需的环境”,Coekaerts 说:“容器与虚拟机不一样,一些需要依赖底层系统配置的应用无法从主机迁移到容器中。” + +另外,Coekaerts 指出在容器内调试问题与在虚拟机内调试问题也是不一样的,现在还没有成熟的工具来进行容器应用的调试。 + +Coekaerts 强调当容器足够成熟时,有一点很重要:不要抛弃现有的技术。组织和企业不能抛弃现有的部署好的应用,而完全投入新技术的怀抱。 + +“部署新技术是很困难的事情,你需要缓慢地迁移过去,能让你顺利迁移的技术才是成功的技术。”Coekaerts 说。 + +-------------------------------------------------------------------------------- + +via: http://www.serverwatch.com/server-news/linuxcon-the-changing-role-of-the-server-os.html + +作者:[Sean Michael Kerner][a] +译者:[bazz2](https://github.com/bazz2) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.serverwatch.com/author/Sean-Michael-Kerner-101580.htm From 82d34ad4dac28b9c63901c546981e892d2da581b Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 25 Aug 2015 14:54:10 +0800 Subject: [PATCH 447/507] PUB:20150209 Install OpenQRM Cloud Computing Platform In Debian @FSSlc --- ...nQRM Cloud Computing Platform In Debian.md | 84 ++++++++++--------- 1 file changed, 43 insertions(+), 41 deletions(-) rename {translated/tech => published}/20150209 Install OpenQRM Cloud Computing Platform In Debian.md (54%) diff --git a/translated/tech/20150209 Install OpenQRM Cloud Computing Platform In Debian.md b/published/20150209 Install OpenQRM Cloud Computing Platform In Debian.md similarity index 54% rename from translated/tech/20150209 Install OpenQRM Cloud Computing Platform In Debian.md rename to published/20150209 Install OpenQRM Cloud Computing Platform In Debian.md index 2eacc933b9..fdaa039b2f 100644 --- a/translated/tech/20150209 Install OpenQRM Cloud Computing Platform In Debian.md +++ b/published/20150209 Install OpenQRM Cloud Computing Platform In Debian.md @@ -1,48 +1,49 @@ 在 Debian 中安装 OpenQRM 云计算平台 ================================================================================ + ### 简介 ### **openQRM**是一个基于 Web 的开源云计算和数据中心管理平台,可灵活地与企业数据中心的现存组件集成。 它支持下列虚拟技术: -- KVM, -- XEN, -- Citrix XenServer, -- VMWare ESX, -- LXC, -- OpenVZ. +- KVM +- XEN +- Citrix XenServer +- VMWare ESX +- LXC +- OpenVZ -openQRM 中的杂交云连接器通过 **Amazon AWS**, **Eucalyptus** 或 **OpenStack** 来支持一系列的私有或公有云提供商,以此来按需扩展你的基础设施。它也自动地进行资源调配、 虚拟化、 存储和配置管理,且关注高可用性。集成计费系统的自助服务云门户可使终端用户按需请求新的服务器和应用堆栈。 +openQRM 中的混合云连接器支持 **Amazon AWS**, **Eucalyptus** 或 **OpenStack** 等一系列的私有或公有云提供商,以此来按需扩展你的基础设施。它也可以自动地进行资源调配、 虚拟化、 存储和配置管理,且保证高可用性。集成的计费系统的自服务云门户可使终端用户按需请求新的服务器和应用堆栈。 openQRM 有两种不同风格的版本可获取: - 企业版 - 社区版 -你可以在[这里][1] 查看这两个版本间的区别。 +你可以在[这里][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 个插件来支持扩展功能并与你的基础设施集成; -- 针对终端用户的自助门户; -- 集成计费系统. +- 私有/混合的云计算平台 +- 可管理物理或虚拟的服务器系统 +- 集成了所有主流的开源或商业的存储技术 +- 跨平台: Linux, Windows, OpenSolaris 和 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。你的服务器必须至少满足以下要求: +在这里我们将在 Debian 7.5 上安装 openQRM。你的服务器必须至少满足以下要求: -- 1 GB RAM; -- 100 GB Hdd(硬盘驱动器); -- 可选: Bios 支持虚拟化(Intel CPUs 的 VT 或 AMD CPUs AMD-V). +- 1 GB RAM +- 100 GB Hdd(硬盘驱动器) +- 可选: Bios 支持虚拟化(Intel CPUs 的 VT 或 AMD CPUs AMD-V) 首先,安装 `make` 软件包来编译 openQRM 源码包: @@ -52,7 +53,7 @@ openQRM 有两种不同风格的版本可获取: 然后,逐次运行下面的命令来安装 openQRM。 -从[这里][2] 下载最新的可用版本: +从[这里][2]下载最新的可用版本: wget http://sourceforge.net/projects/openqrm/files/openQRM-Community-5.1/openqrm-community-5.1.tgz @@ -66,35 +67,35 @@ openQRM 有两种不同风格的版本可获取: sudo make start -安装期间,你将被询问去更新文件 `php.ini` +安装期间,会要求你更新文件 `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) +![~-openqrm-community-5.1-src_001](http://1102047360.rsc.cdn77.org/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_002](http://1102047360.rsc.cdn77.org/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_003](http://1102047360.rsc.cdn77.org/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) +![~-openqrm-community-5.1-src_004](http://1102047360.rsc.cdn77.org/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) +![~-openqrm-community-5.1-src_005](http://1102047360.rsc.cdn77.org/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-community-5.1-src_007](http://1102047360.rsc.cdn77.org/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) +![~_002](http://1102047360.rsc.cdn77.org/wp-content/uploads/2015/02/sk@debian-_002.png) ### 配置 ### @@ -104,23 +105,23 @@ openQRM 有两种不同风格的版本可获取: 默认的用户名和密码是: **openqrm/openqrm** 。 -![Mozilla Firefox_003](http://180016988.r.cdn77.net/wp-content/uploads/2015/02/Mozilla-Firefox_003.png) +![Mozilla Firefox_003](http://1102047360.rsc.cdn77.org/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) +![openQRM Server - Mozilla Firefox_004](http://1102047360.rsc.cdn77.org/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 Server - Mozilla Firefox_006](http://1102047360.rsc.cdn77.org/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 Server - Mozilla Firefox_012](http://1102047360.rsc.cdn77.org/wp-content/uploads/2015/02/openQRM-Server-Mozilla-Firefox_012.png) -祝贺你!! openQRM 已经安装并配置好了。 +祝贺你! openQRM 已经安装并配置好了。 -![openQRM Server - Mozilla Firefox_013](http://180016988.r.cdn77.net/wp-content/uploads/2015/02/openQRM-Server-Mozilla-Firefox_013.png) +![openQRM Server - Mozilla Firefox_013](http://1102047360.rsc.cdn77.org/wp-content/uploads/2015/02/openQRM-Server-Mozilla-Firefox_013.png) ### 更新 openQRM ### @@ -129,16 +130,17 @@ openQRM 有两种不同风格的版本可获取: cd openqrm/src/ make update -到现在为止,我们做的只是在我们的 Ubuntu 服务器中安装和配置 openQRM, 至于 创建、运行虚拟,管理存储,额外的系统集成和运行你自己的私有云等内容,我建议你阅读 [openQRM 管理员指南][3]。 +到现在为止,我们做的只是在我们的 Debian 服务器中安装和配置 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) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 From dd8a39c8fd46ad9f708a39f0c87ddf817c4879c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BC=A9=E6=B6=A1?= Date: Tue, 25 Aug 2015 19:46:26 +0800 Subject: [PATCH 448/507] Update 20150817 Top 5 Torrent Clients For Ubuntu Linux.md --- .../share/20150817 Top 5 Torrent Clients For Ubuntu Linux.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 index 5ae03e4df1..95ad8d2b5d 100644 --- a/sources/share/20150817 Top 5 Torrent Clients For Ubuntu Linux.md +++ b/sources/share/20150817 Top 5 Torrent Clients For Ubuntu Linux.md @@ -1,3 +1,5 @@ +Translating by Xuanwo + 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) @@ -114,4 +116,4 @@ via: http://itsfoss.com/best-torrent-ubuntu/ [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 +[12]:http://itsfoss.com/popcorn-time-tips/ From 26056a3f72760922c6a54a97cb7ad9ba537d5c42 Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 25 Aug 2015 23:37:34 +0800 Subject: [PATCH 449/507] PUB:Part 3 - Setting up RAID 1 (Mirroring) using 'Two Disks' in Linux @strugglingyouth --- ... (Mirroring) using 'Two Disks' in Linux.md | 126 +++++++++--------- 1 file changed, 63 insertions(+), 63 deletions(-) rename {translated/tech/RAID => published}/Part 3 - Setting up RAID 1 (Mirroring) using 'Two Disks' in Linux.md (50%) diff --git a/translated/tech/RAID/Part 3 - Setting up RAID 1 (Mirroring) using 'Two Disks' in Linux.md b/published/Part 3 - Setting up RAID 1 (Mirroring) using 'Two Disks' in Linux.md similarity index 50% rename from translated/tech/RAID/Part 3 - Setting up RAID 1 (Mirroring) using 'Two Disks' in Linux.md rename to published/Part 3 - Setting up RAID 1 (Mirroring) using 'Two Disks' in Linux.md index 948e530ed8..dba520121f 100644 --- a/translated/tech/RAID/Part 3 - Setting up RAID 1 (Mirroring) using 'Two Disks' in Linux.md +++ b/published/Part 3 - Setting up RAID 1 (Mirroring) using 'Two Disks' in Linux.md @@ -1,83 +1,82 @@ -在 Linux 中使用"两个磁盘"创建 RAID 1(镜像) - 第3部分 +在 Linux 下使用 RAID(三):用两块磁盘创建 RAID 1(镜像) ================================================================================ -RAID 镜像意味着相同数据的完整克隆(或镜像)写入到两个磁盘中。创建 RAID1 至少需要两个磁盘,它的读取性能或者可靠性比数据存储容量更好。 + +**RAID 镜像**意味着相同数据的完整克隆(或镜像),分别写入到两个磁盘中。创建 RAID 1 至少需要两个磁盘,而且仅用于读取性能或者可靠性要比数据存储容量更重要的场合。 ![Create Raid1 in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/Create-RAID1-in-Linux.jpeg) -在 Linux 中设置 RAID1 +*在 Linux 中设置 RAID 1* 创建镜像是为了防止因硬盘故障导致数据丢失。镜像中的每个磁盘包含数据的完整副本。当一个磁盘发生故障时,相同的数据可以从其它正常磁盘中读取。而后,可以从正在运行的计算机中直接更换发生故障的磁盘,无需任何中断。 ### RAID 1 的特点 ### --镜像具有良好的性能。 +- 镜像具有良好的性能。 --磁盘利用率为50%。也就是说,如果我们有两个磁盘每个500GB,总共是1TB,但在镜像中它只会显示500GB。 +- 磁盘利用率为50%。也就是说,如果我们有两个磁盘每个500GB,总共是1TB,但在镜像中它只会显示500GB。 --在镜像如果一个磁盘发生故障不会有数据丢失,因为两个磁盘中的内容相同。 +- 在镜像如果一个磁盘发生故障不会有数据丢失,因为两个磁盘中的内容相同。 --读取数据会比写入性能更好。 +- 读取性能会比写入性能更好。 #### 要求 #### +创建 RAID 1 至少要有两个磁盘,你也可以添加更多的磁盘,磁盘数需为2,4,6,8等偶数。要添加更多的磁盘,你的系统必须有 RAID 物理适配器(硬件卡)。 -创建 RAID 1 至少要有两个磁盘,你也可以添加更多的磁盘,磁盘数需为2,4,6,8的两倍。为了能够添加更多的磁盘,你的系统必须有 RAID 物理适配器(硬件卡)。 +这里,我们使用软件 RAID 不是硬件 RAID,如果你的系统有一个内置的物理硬件 RAID 卡,你可以从它的功能界面或使用 Ctrl + I 键来访问它。 -这里,我们使用软件 RAID 不是硬件 RAID,如果你的系统有一个内置的物理硬件 RAID 卡,你可以从它的 UI 组件或使用 Ctrl + I 键来访问它。 - -需要阅读: [Basic Concepts of RAID in Linux][1] +需要阅读: [介绍 RAID 的级别和概念][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 + 操作系统 : CentOS 6.5 Final + IP 地址 : 192.168.0.226 + 主机名 : rd1.tecmintlocal.com + 磁盘 1 [20GB] : /dev/sdb + 磁盘 2 [20GB] : /dev/sdc -本文将指导你使用 mdadm (创建和管理 RAID 的)一步一步的建立一个软件 RAID 1 或镜像在 Linux 平台上。但同样的做法也适用于其它 Linux 发行版如 RedHat,CentOS,Fedora 等等。 +本文将指导你在 Linux 平台上使用 mdadm (用于创建和管理 RAID )一步步的建立一个软件 RAID 1 (镜像)。同样的做法也适用于如 RedHat,CentOS,Fedora 等 Linux 发行版。 -### 第1步:安装所需要的并且检查磁盘 ### +### 第1步:安装所需软件并且检查磁盘 ### -1.正如我前面所说,在 Linux 中我们需要使用 mdadm 软件来创建和管理 RAID。所以,让我们用 yum 或 apt-get 的软件包管理工具在 Linux 上安装 mdadm 软件包。 +1、 正如我前面所说,在 Linux 中我们需要使用 mdadm 软件来创建和管理 RAID。所以,让我们用 yum 或 apt-get 的软件包管理工具在 Linux 上安装 mdadm 软件包。 - # yum install mdadm [on RedHat systems] - # apt-get install mdadm [on Debain systems] + # yum install mdadm [在 RedHat 系统] + # apt-get install mdadm [在 Debain 系统] -2. 一旦安装好‘mdadm‘包,我们需要使用下面的命令来检查磁盘是否已经配置好。 +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 的磁盘* 正如你从上面图片看到的,没有检测到任何超级块,这意味着还没有创建RAID。 ### 第2步:为 RAID 创建分区 ### -3. 正如我提到的,我们最少使用两个分区 /dev/sdb 和 /dev/sdc 来创建 RAID1。我们首先使用‘fdisk‘命令来创建这两个分区并更改其类型为 raid。 +3、 正如我提到的,我们使用最少的两个分区 /dev/sdb 和 /dev/sdc 来创建 RAID 1。我们首先使用`fdisk`命令来创建这两个分区并更改其类型为 raid。 # fdisk /dev/sdb 按照下面的说明 -- 按 ‘n’ 创建新的分区。 -- 然后按 ‘P’ 选择主分区。 +- 按 `n` 创建新的分区。 +- 然后按 `P` 选择主分区。 - 接下来选择分区号为1。 - 按两次回车键默认将整个容量分配给它。 -- 然后,按 ‘P’ 来打印创建好的分区。 -- 按 ‘L’,列出所有可用的类型。 -- 按 ‘t’ 修改分区类型。 -- 键入 ‘fd’ 设置为Linux 的 RAID 类型,然后按 Enter 确认。 -- 然后再次使用‘p’查看我们所做的更改。 -- 使用‘w’保存更改。 +- 然后,按 `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 。 @@ -85,59 +84,59 @@ RAID 镜像意味着相同数据的完整克隆(或镜像)写入到两个磁 ![Create Second Partitions](http://www.tecmint.com/wp-content/uploads/2014/10/Create-Second-Partitions.png) -创建第二个分区 +*创建第二个分区* -4. 一旦这两个分区创建成功后,使用相同的命令来检查 sdb & sdc 分区并确认 RAID 分区的类型如上图所示。 +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 类型 +*检查 RAID 类型* **注意**: 正如你在上图所看到的,在 sdb1 和 sdc1 中没有任何对 RAID 的定义,这就是我们没有检测到超级块的原因。 -### 步骤3:创建 RAID1 设备 ### +### 第3步:创建 RAID 1 设备 ### -5.接下来使用以下命令来创建一个名为 /dev/md0 的“RAID1”设备并验证它 +5、 接下来使用以下命令来创建一个名为 /dev/md0 的“RAID 1”设备并验证它 # 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设备 +*创建RAID设备* -6. 接下来使用如下命令来检查 RAID 设备类型和 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 设备类型 +*检查 RAID 设备类型* ![Check RAID Device Array](http://www.tecmint.com/wp-content/uploads/2014/10/Check-RAID-Device-Array.png) -检查 RAID 设备阵列 +*检查 RAID 设备阵列* -从上图中,人们很容易理解,RAID1 已经使用的 /dev/sdb1 和 /dev/sdc1 分区被创建,你也可以看到状态为 resyncing。 +从上图中,人们很容易理解,RAID 1 已经创建好了,使用了 /dev/sdb1 和 /dev/sdc1 分区,你也可以看到状态为 resyncing(重新同步中)。 ### 第4步:在 RAID 设备上创建文件系统 ### -7. 使用 ext4 为 md0 创建文件系统并挂载到 /mnt/raid1 . +7、 给 md0 上创建 ext4 文件系统 # mkfs.ext4 /dev/md0 ![Create RAID Device Filesystem](http://www.tecmint.com/wp-content/uploads/2014/10/Create-RAID-Device-Filesystem.png) -创建 RAID 设备文件系统 +*创建 RAID 设备文件系统* -8. 接下来,挂载新创建的文件系统到“/mnt/raid1”,并创建一些文件,验证在挂载点的数据 +8、 接下来,挂载新创建的文件系统到“/mnt/raid1”,并创建一些文件,验证在挂载点的数据 # mkdir /mnt/raid1 # mount /dev/md0 /mnt/raid1/ @@ -146,51 +145,52 @@ RAID 镜像意味着相同数据的完整克隆(或镜像)写入到两个磁 ![Mount Raid Device](http://www.tecmint.com/wp-content/uploads/2014/10/Mount-RAID-Device.png) -挂载 RAID 设备 +*挂载 RAID 设备* -9.为了在系统重新启动自动挂载 RAID1,需要在 fstab 文件中添加条目。打开“/etc/fstab”文件并添加以下行。 +9、为了在系统重新启动自动挂载 RAID 1,需要在 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 设备 +*自动挂载 Raid 设备* + +10、 运行`mount -av`,检查 fstab 中的条目是否有错误 -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 中的错误 +*检查 fstab 中的错误* -11. 接下来,使用下面的命令保存 raid 的配置到文件“mdadm.conf”中。 +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 的配置* 上述配置文件在系统重启时会读取并加载 RAID 设备。 ### 第5步:在磁盘故障后检查数据 ### -12.我们的主要目的是,即使在任何磁盘故障或死机时必须保证数据是可用的。让我们来看看,当任何一个磁盘不可用时会发生什么。 +12、我们的主要目的是,即使在任何磁盘故障或死机时必须保证数据是可用的。让我们来看看,当任何一个磁盘不可用时会发生什么。 # mdadm --detail /dev/md0 ![Raid Device Verify](http://www.tecmint.com/wp-content/uploads/2014/10/Raid-Device-Verify.png) -验证 Raid 设备 +*验证 RAID 设备* -在上面的图片中,我们可以看到在 RAID 中有2个设备是可用的并且 Active Devices 是2.现在让我们看看,当一个磁盘拔出(移除 sdc 磁盘)或损坏后会发生什么。 +在上面的图片中,我们可以看到在 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 设备 +*测试 RAID 设备* 现在,在上面的图片中你可以看到,一个磁盘不见了。我从虚拟机上删除了一个磁盘。此时让我们来检查我们宝贵的数据。 @@ -199,9 +199,9 @@ RAID 镜像意味着相同数据的完整克隆(或镜像)写入到两个磁 ![Verify RAID Data](http://www.tecmint.com/wp-content/uploads/2014/10/Verify-RAID-Data.png) -验证 RAID 数据 +*验证 RAID 数据* -你有没有看到我们的数据仍然可用。由此,我们可以知道 RAID 1(镜像)的优势。在接下来的文章中,我们将看到如何设置一个 RAID 5 条带化分布式奇偶校验。希望这可以帮助你了解 RAID 1(镜像)是如何工作的。 +你可以看到我们的数据仍然可用。由此,我们可以了解 RAID 1(镜像)的优势。在接下来的文章中,我们将看到如何设置一个 RAID 5 条带化分布式奇偶校验。希望这可以帮助你了解 RAID 1(镜像)是如何工作的。 -------------------------------------------------------------------------------- @@ -209,9 +209,9 @@ via: http://www.tecmint.com/create-raid1-in-linux/ 作者:[Babin Lonston][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/) 荣誉推出 [a]:http://www.tecmint.com/author/babinlonston/ -[1]:http://www.tecmint.com/understanding-raid-setup-in-linux/ +[1]:https://linux.cn/article-6085-1.html From 39a941d9846d6f0fd2494f44979e26d211918cef Mon Sep 17 00:00:00 2001 From: struggling <630441839@qq.com> Date: Wed, 26 Aug 2015 00:01:44 +0800 Subject: [PATCH 450/507] Delete Part 6 - Setting Up RAID 10 or 1+0 (Nested) in Linux.md --- ...ing Up RAID 10 or 1+0 (Nested) in Linux.md | 276 ------------------ 1 file changed, 276 deletions(-) delete mode 100644 sources/tech/RAID/Part 6 - Setting Up RAID 10 or 1+0 (Nested) in Linux.md 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 deleted file mode 100644 index a08903e00e..0000000000 --- a/sources/tech/RAID/Part 6 - Setting Up RAID 10 or 1+0 (Nested) in Linux.md +++ /dev/null @@ -1,276 +0,0 @@ -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. - -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 From fe8f7603a69585d6bbaa8f75149dd0a5558b636f Mon Sep 17 00:00:00 2001 From: struggling <630441839@qq.com> Date: Wed, 26 Aug 2015 00:02:53 +0800 Subject: [PATCH 451/507] Create Part 6 - Setting Up RAID 10 or 1+0 (Nested) in Linux.md --- ...ing Up RAID 10 or 1+0 (Nested) in Linux.md | 277 ++++++++++++++++++ 1 file changed, 277 insertions(+) create mode 100644 translated/tech/RAID/Part 6 - Setting Up RAID 10 or 1+0 (Nested) in Linux.md diff --git a/translated/tech/RAID/Part 6 - Setting Up RAID 10 or 1+0 (Nested) in Linux.md b/translated/tech/RAID/Part 6 - Setting Up RAID 10 or 1+0 (Nested) in Linux.md new file mode 100644 index 0000000000..850f6c3e49 --- /dev/null +++ b/translated/tech/RAID/Part 6 - Setting Up RAID 10 or 1+0 (Nested) in Linux.md @@ -0,0 +1,277 @@ + +在 Linux 中设置 RAID 10 或 1 + 0(嵌套) - 第6部分 +================================================================================ +RAID 10 是结合 RAID 0 和 RAID 1 形成的。要设置 RAID 10,我们至少需要4个磁盘。在之前的文章中,我们已经看到了如何使用两个磁盘设置 RAID 0 和 RAID 1。 + +在这里,我们将使用最少4个磁盘结合 RAID 0 和 RAID 1 来设置 RAID 10。假设,我们已经在逻辑卷保存了一些数据,这是 RAID 10 创建的,如果我们要保存数据“apple”,它将使用以下方法将其保存在4个磁盘中。 + +![Create Raid 10 in Linux](http://www.tecmint.com/wp-content/uploads/2014/11/raid10.jpg) + +在 Linux 中创建 Raid 10 + +使用 RAID 0 时,它将“A”保存在第一个磁盘,“p”保存在第二个磁盘,下一个“P”又在第一个磁盘,“L”在第二个磁盘。然后,“e”又在第一个磁盘,像这样它会继续循环此过程将数据保存完整。由此我们知道,RAID 0 是将数据的一半保存到第一个磁盘,另一半保存到第二个磁盘。 + +在 RAID 1 方法中,相同的数据将被写入到两个磁盘中。 “A”将同时被写入到第一和第二个磁盘中,“P”也将被同时写入到两个磁盘中,下一个“P”也将同时被写入到两个磁盘。因此,使用 RAID 1 将同时写入到两个磁盘。它将继续循环此过程。 + +现在大家来了解 RAID 10 怎样结合 RAID 0 和 RAID 1 来工作。如果我们有4个20 GB 的磁盘,总共为 80 GB,但我们将只能得到40 GB 的容量,另一半的容量将用于构建 RAID 10。 + +#### RAID 10 的优点和缺点 #### + +- 提供更好的性能。 +- 在 RAID 10 中我们将失去两个磁盘的容量。 +- 读与写的性能将会很好,因为它会同时进行写入和读取。 +- 它能解决数据库的高 I/O 磁盘写操作。 + +#### 要求 #### + +在 RAID 10 中,我们至少需要4个磁盘,2个磁盘为 RAID 0,其他2个磁盘为 RAID 1,就像我之前说的,RAID 10 仅仅是结合了 RAID 0和1。如果我们需要扩展 RAID 组,最少需要添加4个磁盘。 + +**我的服务器设置** + + 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 + +有两种方法来设置 RAID 10,在这里两种方法我都会演示,但我更喜欢第一种方法,使用它来设置 RAID 10 更简单。 + +### 方法1:设置 RAID 10 ### + +1.首先,使用以下命令确认所添加的4块磁盘没有被使用。 + + # ls -l /dev | grep sd + +2.四个磁盘被检测后,然后来检查磁盘是否存在 RAID 分区。 + + # 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) + +验证添加的4块磁盘 + +**注意**: 在上面的输出中,如果没有检测到 super-block 意味着在4块磁盘中没有定义过 RAID。 + +#### 第1步:为 RAID 分区 #### + +3.现在,使用‘fdisk’,命令为4个磁盘(/dev/sdb, /dev/sdc, /dev/sdd 和 /dev/sde)创建新分区。 + + # fdisk /dev/sdb + # fdisk /dev/sdc + # fdisk /dev/sdd + # fdisk /dev/sde + +**为 /dev/sdb 创建分区** + +我来告诉你如何使用 fdisk 为磁盘(/dev/sdb)进行分区,此步也适用于其他磁盘。 + + # fdisk /dev/sdb + +请使用以下步骤为 /dev/sdb 创建一个新的分区。 + +- 按 ‘n’ 创建新的分区。 +- 然后按 ‘P’ 选择主分区。 +- 接下来选择分区号为1。 +- 只需按两次回车键选择默认值即可。 +- 然后,按 ‘P’ 来打印创建好的分区。 +- 按 ‘L’,列出所有可用的类型。 +- 按 ‘t’ 去修改分区。 +- 键入 ‘fd’ 设置为 Linux 的 RAID 类型,然后按 Enter 确认。 +- 然后再次使用‘p’查看我们所做的更改。 +- 使用‘w’保存更改。 + +![Disk sdb Partition](http://www.tecmint.com/wp-content/uploads/2014/11/Disk-sdb-Partition.png) + +为磁盘 sdb 分区 + +**注意**: 请使用上面相同的指令对其他磁盘(sdc, sdd sdd sde)进行分区。 + +4.创建好4个分区后,需要使用下面的命令来检查磁盘是否存在 raid。 + + # mdadm -E /dev/sd[b-e] + # mdadm -E /dev/sd[b-e]1 + + 或者 + + # 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) + +检查磁盘 + +**注意**: 以上输出显示,新创建的四个分区中没有检测到 super-block,这意味着我们可以继续在这些磁盘上创建 RAID 10。 + +#### 第2步: 创建 RAID 设备 ‘md’ #### + +5.现在改创建一个‘md’(即 /dev/md0)设备,使用“mdadm” raid 管理工具。在创建设备之前,必须确保系统已经安装了‘mdadm’工具,如果没有请使用下面的命令来安装。 + + # yum install mdadm [on RedHat systems] + # apt-get install mdadm [on Debain systems] + +‘mdadm’工具安装完成后,可以使用下面的命令创建一个‘md’ raid 设备。 + + # mdadm --create /dev/md0 --level=10 --raid-devices=4 /dev/sd[b-e]1 + +6.接下来使用‘cat’命令验证新创建的 raid 设备。 + + # cat /proc/mdstat + +![Create md raid Device](http://www.tecmint.com/wp-content/uploads/2014/11/Create-md-raid-Device.png) + +创建 md raid 设备 + +7.接下来,使用下面的命令来检查4个磁盘。下面命令的输出会很长,因为它会显示4个磁盘的所有信息。 + + # mdadm --examine /dev/sd[b-e]1 + +8.接下来,使用以下命令来查看 RAID 阵列的详细信息。 + + # mdadm --detail /dev/md0 + +![Check Raid Array Details](http://www.tecmint.com/wp-content/uploads/2014/11/Check-Raid-Array-Details.png) + +查看 Raid 阵列详细信息 + +**注意**: 你在上面看到的结果,该 RAID 的状态是 active 和re-syncing。 + +#### 第3步:创建文件系统 #### + +9.使用 ext4 作为‘md0′的文件系统并将它挂载到‘/mnt/raid10‘下。在这里,我用的是 ext4,你可以使用你想要的文件系统类型。 + + # mkfs.ext4 /dev/md0 + +![Create md Filesystem](http://www.tecmint.com/wp-content/uploads/2014/11/Create-md-Filesystem.png) + +创建 md 文件系统 + +10.在创建文件系统后,挂载文件系统到‘/mnt/raid10‘下,并使用‘ls -l’命令列出挂载点下的内容。 + + # mkdir /mnt/raid10 + # mount /dev/md0 /mnt/raid10/ + # ls -l /mnt/raid10/ + +接下来,在挂载点下创建一些文件,并在文件中添加些内容,然后检查内容。 + + # 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) + +挂载 md 设备 + +11.要想自动挂载,打开‘/etc/fstab‘文件并添加下面的条目,挂载点根据你环境的不同来添加。使用 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) + +挂载 md 设备 + +12.接下来,在重新启动系统前使用‘mount -a‘来确认‘/etc/fstab‘文件是否有错误。 + + # mount -av + +![Check Errors in Fstab](http://www.tecmint.com/wp-content/uploads/2014/11/Check-Errors-in-Fstab.png) + +检查 Fstab 中的错误 + +#### 第四步:保存 RAID 配置 #### + +13.默认情况下 RAID 没有配置文件,所以我们需要在上述步骤完成后手动保存它。 + + # mdadm --detail --scan --verbose >> /etc/mdadm.conf + +![Save Raid10 Configuration](http://www.tecmint.com/wp-content/uploads/2014/11/Save-Raid10-Configuration.png) + +保存 Raid10 的配置 + +就这样,我们使用方法1创建完了 RAID 10,这种方法是比较容易的。现在,让我们使用方法2来设置 RAID 10。 + +### 方法2:创建 RAID 10 ### + +1.在方法2中,我们必须定义2组 RAID 1,然后我们需要使用这些创建好的 RAID 1 的集来定义一个 RAID 0。在这里,我们将要做的是先创建2个镜像(RAID1),然后创建 RAID0 (条带化)。 + +首先,列出所有的可用于创建 RAID 10 的磁盘。 + + # ls -l /dev | grep sd + +![List 4 Devices](http://www.tecmint.com/wp-content/uploads/2014/11/List-4-Devices.png) + +列出了 4 设备 + +2.将4个磁盘使用‘fdisk’命令进行分区。对于如何分区,您可以按照 #步骤 3。 + + # fdisk /dev/sdb + # fdisk /dev/sdc + # fdisk /dev/sdd + # fdisk /dev/sde + +3.在完成4个磁盘的分区后,现在检查磁盘是否存在 RAID块。 + + # 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) + +检查 4 个磁盘 + +#### 第1步:创建 RAID 1 #### + +4.首先,使用4块磁盘创建2组 RAID 1,一组为‘sdb1′和 ‘sdc1′,另一组是‘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) + +创建 Raid 1 + +![Check Details of Raid 1](http://www.tecmint.com/wp-content/uploads/2014/11/Creating-Raid-1.png) + +查看 Raid 1 的详细信息 + +#### 第2步:创建 RAID 0 #### + +5.接下来,使用 md1 和 md2 来创建 RAID 0。 + + # 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) + +创建 Raid 0 + +#### 第3步:保存 RAID 配置 #### + +6.我们需要将配置文件保存在‘/etc/mdadm.conf‘文件中,使其每次重新启动后都能加载所有的 raid 设备。 + + # mdadm --detail --scan --verbose >> /etc/mdadm.conf + +在此之后,我们需要按照方法1中的#第3步来创建文件系统。 + +就是这样!我们采用的方法2创建完了 RAID 1+0.我们将会失去两个磁盘的空间,但相比其他 RAID ,它的性能将是非常好的。 + +### 结论 ### + +在这里,我们采用两种方法创建 RAID 10。RAID 10 具有良好的性能和冗余性。希望这篇文章可以帮助你了解 RAID 10(嵌套 RAID 的级别)。在后面的文章中我们会看到如何扩展现有的 RAID 阵列以及更多精彩的。 + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/create-raid-10-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 7b242fb2a91191ed601102eff134a0edbace3389 Mon Sep 17 00:00:00 2001 From: Xuanwo Date: Wed, 26 Aug 2015 06:10:36 +0800 Subject: [PATCH 452/507] finish the translating of 20150817 Top 5 Torrent Clients For Ubuntu Linux --- ... Top 5 Torrent Clients For Ubuntu Linux.md | 119 ----------------- ... Top 5 Torrent Clients For Ubuntu Linux.md | 120 ++++++++++++++++++ 2 files changed, 120 insertions(+), 119 deletions(-) delete mode 100644 sources/share/20150817 Top 5 Torrent Clients For Ubuntu Linux.md create mode 100644 translated/share/20150817 Top 5 Torrent Clients For Ubuntu 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 deleted file mode 100644 index 95ad8d2b5d..0000000000 --- a/sources/share/20150817 Top 5 Torrent Clients For Ubuntu Linux.md +++ /dev/null @@ -1,119 +0,0 @@ -Translating by Xuanwo - -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/ diff --git a/translated/share/20150817 Top 5 Torrent Clients For Ubuntu Linux.md b/translated/share/20150817 Top 5 Torrent Clients For Ubuntu Linux.md new file mode 100644 index 0000000000..0ba1ac3e03 --- /dev/null +++ b/translated/share/20150817 Top 5 Torrent Clients For Ubuntu Linux.md @@ -0,0 +1,120 @@ +Translating by Xuanwo + +介绍Ubuntu下五大BT客户端 +================================================================================ +![Best Torrent clients for Ubuntu Linux](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/08/5_Best_Torrent_Ubuntu.png) + +你在寻找**Ubuntu中最好的BT客户端**吗?事实上,桌面平台中有许多可用的BT客户端,但是它们中的哪些才是**最好的**呢? + +我将会列出最好的五个BT客户端,它们都拥有着体积轻盈,功能强大的特点,而且还有令人印象深刻的用户界面。自然,易于安装和使用也是特性之一。 + +### Ubuntu下最好的BT客户端 ### + +考虑到Ubuntu默认安装了Transmission,所以我将会从这个列表中删去Transmission。但是这并不意味着Transmission没有资格出现在这个列表中,事实上,Transmission是一个非常好的BT客户端,这也正是它被多个发行版默认安装的原因,Ubuntu也不例外。 + +---------- + +### Deluge ### + +![Logo of Deluge torrent client for Ubuntu](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/08/Deluge.png) + +[Deluge][1] 被Lifehacker选为Linux下最好的BT客户端,这说明了Deluge是多么的有用。而且,并不仅仅只有Lifehacker是Deluge的粉丝,纵观多个论坛,你都会发现不少Deluge的忠实拥趸。 + +快速,时尚而且直观的界面使得Deluge成为Linux用户的挚爱。 + +Deluge可在Ubuntu的仓库中获取,你能够在Ubuntu软件中心中安装它,或者使用下面的命令: + + sudo apt-get install delugeFast, sleek and intuitive interface makes Deluge a hot favorite among Linux users. + +---------- + +### qBittorrent ### + +![qBittorrent client for Linux](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/08/qbittorrent_icon.png) + +正如它的名字所暗示的,[qBittorrent][2] 是著名的 [Bittorrent][3] 应用的Qt版本。如果你曾经使用过它,你将会看到和Windows下的Bittorrent相似的界面。同样轻巧并且有着BT客户端的所有标准功能,qBittorrent也可以在Ubuntu的默认仓库中找到。 + +它可以通过Ubuntu软件仓库安装,或者使用下面的命令: + + 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] 是另一个不错的Ubuntu下的BT客户端。它有着一个默认的黑暗主题,尽管很多人喜欢,但是我例外。它拥有着一切你能在BT客户端中找到的功能。 + +除此之外,它还有着数据分析的额外功能。你可以在美观的图表中分析流量以及其它数据。 + +- [下载 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]是许多Linux以及Windows用户最喜欢的BT客户端。除了标准的功能,你可以直接在应用程序中搜索种子。你也可以订阅系列片源,这样你就无需再去寻找新的片源了,因为你可以在侧边栏中的订阅看到它们。 + +它还配备了一个视频播放器,可以播放带有字幕的高清视频以及一切。但是我不认为你会用它来代替那些更好的视频播放器,比如VLC。 + +Vuze可以通过Ubuntu软件中心安装或者使用下列命令: + + 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]可能会是一个你想要去尝试的应用。它不仅仅是一个简单的BT客户端,它还可以应用于安卓,你可以用它通过Wifi来共享文件。 + +你可以在应用中搜索种子并且播放他们。除了下载文件,它还可以浏览你本地的影音文件,并且将它们有条理的呈现在播放器中。这同样适用于安卓版本。 + +还有一个特点是:Frostwire提供了印度艺术家的合法音乐下载。你可以下载并且欣赏它们,免费而且合法。 + +- [下载 Frostwire][8] + +---------- + +### 荣誉奖 ### + +在Windows中,uTorrent(发音:mu torrent)是我最喜欢的BT应用。尽管uTorrent可以在Linux下运行,但是我还是特意忽略了它。因为在Linux下使用uTorrent不仅困难,而且无法获得完整的应用体验(运行在浏览器中)。 + +你可以[在这里][9]阅读Ubuntu下uTorrent的安装教程。 + +#### 快速提示: #### + +大多数情况下,BT应用不会默认自动自动启动。如果你想改变这一行为,阅读[如何管理Ubuntu下的自启程序][10]来学习。 + +### 你最喜欢的是什么? ### + +这些是我对于Ubuntu下最好的BT客户端的一键。你最喜欢的是什么呢?请发表评论。你也可以查看与本主题相关的[Ubuntu最好的下载管理器][11]。如果你使用Popcorn Time,试试[Popcorn Time技巧][12] + +-------------------------------------------------------------------------------- + +via: http://itsfoss.com/best-torrent-ubuntu/ + +作者:[Abhishek][a] +译者:[Xuanwo](https://github.com/Xuanwo) +校对:[校对者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/ + From 8040c6c76cfaa973d7700e59e51f724a88a5e961 Mon Sep 17 00:00:00 2001 From: bazz2 Date: Wed, 26 Aug 2015 07:54:27 +0800 Subject: [PATCH 453/507] [bazz2 translating]Linux about to gain a new file system--bcachefs --- ...20150824 Linux about to gain a new file system--bcachefs.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/talk/20150824 Linux about to gain a new file system--bcachefs.md b/sources/talk/20150824 Linux about to gain a new file system--bcachefs.md index df3cd14682..9568d05836 100644 --- a/sources/talk/20150824 Linux about to gain a new file system--bcachefs.md +++ b/sources/talk/20150824 Linux about to gain a new file system--bcachefs.md @@ -1,3 +1,4 @@ +[bazz2222222] Linux about to gain a new file system – bcachefs ================================================================================ A five year old file system built by Kent Overstreet, formerly of Google, is near feature complete with all critical components in place. Bcachefs boasts the performance and reliability of the widespread ext4 and xfs as well as the feature list similar to that of btrfs and zfs. Notable features include checksumming, compression, multiple devices, caching and eventually snapshots and other “nifty” features. @@ -22,4 +23,4 @@ via: http://www.linuxveda.com/2015/08/22/linux-gain-new-file-system-bcachefs/ [a]:http://www.linuxveda.com/author/paul_hill/ [1]:https://en.wikipedia.org/wiki/Copy-on-write -[2]:https://lkml.org/lkml/2015/8/21/22 \ No newline at end of file +[2]:https://lkml.org/lkml/2015/8/21/22 From 2c0561dc2f517c08dca59d4fa1948c18cb2c0704 Mon Sep 17 00:00:00 2001 From: Xuanwo Date: Wed, 26 Aug 2015 08:41:08 +0800 Subject: [PATCH 454/507] apply for the LFCS translate --- ...eate Edit and Manipulate files in Linux.md | 2 ++ ...ng and Linux Filesystem Troubleshooting.md | 28 ++++++++++--------- ...and Use vi or vim as a Full Text Editor.md | 4 ++- ...e Attributes and Finding Files in Linux.md | 8 ++++-- ...esystems and Configuring Swap Partition.md | 2 ++ ...work Samba and NFS Filesystems in Linux.md | 2 ++ ...es – Creating & Managing System Backups.md | 22 ++++++++------- ...d Services SysVinit Systemd and Upstart.md | 6 ++-- ...es and Enabling sudo Access on Accounts.md | 4 ++- ...th Yum RPM Apt Dpkg Aptitude and Zypper.md | 12 ++++---- 10 files changed, 55 insertions(+), 35 deletions(-) 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 index ca96b7dac6..083078fa62 100644 --- 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 @@ -1,3 +1,5 @@ +Translating by Xuanwo + 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. diff --git a/sources/tech/LFCS/Part 10 - LFCS--Understanding and Learning Basic Shell Scripting and Linux Filesystem Troubleshooting.md b/sources/tech/LFCS/Part 10 - LFCS--Understanding and Learning Basic Shell Scripting and Linux Filesystem Troubleshooting.md index 45029ac20e..5dd1782a98 100644 --- a/sources/tech/LFCS/Part 10 - LFCS--Understanding and Learning Basic Shell Scripting and Linux Filesystem Troubleshooting.md +++ b/sources/tech/LFCS/Part 10 - LFCS--Understanding and Learning Basic Shell Scripting and Linux Filesystem Troubleshooting.md @@ -1,3 +1,5 @@ +Translating by Xuanwo + Part 10 - LFCS: Understanding & Learning Basic Shell Scripting and Linux Filesystem Troubleshooting ================================================================================ The Linux Foundation launched the LFCS certification (Linux Foundation Certified Sysadmin), a brand new initiative whose purpose is to allow individuals everywhere (and anywhere) to get certified in basic to intermediate operational support 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. @@ -99,10 +101,10 @@ Execute Script Whenever you need to specify different courses of action to be taken in a shell script, as result of the success or failure of a command, you will use the if construct to define such conditions. Its basic syntax is: - if CONDITION; then + if CONDITION; then COMMANDS; else - OTHER-COMMANDS + OTHER-COMMANDS fi Where CONDITION can be one of the following (only the most frequent conditions are cited here) and evaluates to true when: @@ -133,8 +135,8 @@ Where CONDITION can be one of the following (only the most frequent conditions a This loop allows to execute one or more commands for each value in a list of values. Its basic syntax is: - for item in SEQUENCE; do - COMMANDS; + for item in SEQUENCE; do + COMMANDS; done Where item is a generic variable that represents each value in SEQUENCE during each iteration. @@ -143,8 +145,8 @@ Where item is a generic variable that represents each value in SEQUENCE during e This loop allows to execute a series of repetitive commands as long as the control command executes with an exit status equal to zero (successfully). Its basic syntax is: - while EVALUATION_COMMAND; do - EXECUTE_COMMANDS; + while EVALUATION_COMMAND; do + EXECUTE_COMMANDS; done Where EVALUATION_COMMAND can be any command(s) that can exit with a success (0) or failure (other than 0) status, and EXECUTE_COMMANDS can be any program, script or shell construct, including other nested loops. @@ -158,7 +160,7 @@ We will demonstrate the use of the if construct and the for loop with the follow Let’s create a file with a list of services that we want to monitor at a glance. # cat myservices.txt - + sshd mariadb httpd @@ -172,10 +174,10 @@ Script to Monitor Linux Services Our shell script should look like. #!/bin/bash - + # This script iterates over a list of services and # is used to determine whether they are running or not. - + for service in $(cat myservices.txt); do systemctl status $service | grep --quiet "running" if [ $? -eq 0 ]; then @@ -214,10 +216,10 @@ Services Monitoring Script We could go one step further and check for the existence of myservices.txt before even attempting to enter the for loop. #!/bin/bash - + # This script iterates over a list of services and # is used to determine whether they are running or not. - + if [ -f myservices.txt ]; then for service in $(cat myservices.txt); do systemctl status $service | grep --quiet "running" @@ -238,9 +240,9 @@ You may want to maintain a list of hosts in a text file and use a script to dete The read shell built-in command tells the while loop to read myhosts line by line and assigns the content of each line to variable host, which is then passed to the ping command. #!/bin/bash - + # This script is used to demonstrate the use of a while loop - + while read host; do ping -c 2 $host done < myhosts 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 index 7537f784bd..1d069e08ea 100644 --- 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 @@ -1,3 +1,5 @@ +Translating by Xuanwo + 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. @@ -295,7 +297,7 @@ 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 + :%s/old/young/g **Notice**: The colon at the beginning of the command. 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 index 6ac3d104a0..77fe5cf040 100644 --- 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 @@ -1,3 +1,5 @@ +Translating by Xuanwo + 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. @@ -178,9 +180,9 @@ 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] + # gzip -d myfiles.tar.gz [#1] + # bzip2 -d myfiles.tar.bz2 [#2] + # xz -d myfiles.tar.xz [#3] Then 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 index ada637fabb..93e4b2966b 100644 --- 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 @@ -1,3 +1,5 @@ +Translating by Xuanwo + 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. 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 index 1544a378bc..4316e32c16 100644 --- 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 @@ -1,3 +1,5 @@ +Translating by Xuanwo + 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. diff --git a/sources/tech/LFCS/Part 6 - LFCS--Assembling Partitions as RAID Devices – Creating & Managing System Backups.md b/sources/tech/LFCS/Part 6 - LFCS--Assembling Partitions as RAID Devices – Creating & Managing System Backups.md index bdabfb1f9d..901fb7b4f1 100644 --- a/sources/tech/LFCS/Part 6 - LFCS--Assembling Partitions as RAID Devices – Creating & Managing System Backups.md +++ b/sources/tech/LFCS/Part 6 - LFCS--Assembling Partitions as RAID Devices – Creating & Managing System Backups.md @@ -1,3 +1,5 @@ +Translating by Xuanwo + Part 6 - LFCS: Assembling Partitions as RAID Devices – Creating & Managing System Backups ================================================================================ Recently, the Linux Foundation launched the LFCS (Linux Foundation Certified Sysadmin) certification, a shiny chance for system administrators everywhere to demonstrate, through a performance-based exam, that they are capable of performing overall operational support on Linux systems: system support, first-level diagnosing and monitoring, plus issue escalation, when required, to other support teams. @@ -24,7 +26,7 @@ However, the actual fault-tolerance and disk I/O performance lean on how the har Our tool of choice for creating, assembling, managing, and monitoring our software RAIDs is called mdadm (short for multiple disks admin). ---------------- Debian and Derivatives ---------------- - # aptitude update && aptitude install mdadm + # aptitude update && aptitude install mdadm ---------- @@ -34,7 +36,7 @@ Our tool of choice for creating, assembling, managing, and monitoring our softwa ---------- ---------------- On openSUSE ---------------- - # zypper refresh && zypper install mdadm # + # zypper refresh && zypper install mdadm # #### Assembling Partitions as RAID Devices #### @@ -55,7 +57,7 @@ Creating RAID Array After creating RAID array, you an check the status of the array using the following commands. # cat /proc/mdstat - or + or # mdadm --detail /dev/md0 [More detailed summary] ![Check RAID Array Status](http://www.tecmint.com/wp-content/uploads/2014/10/Check-RAID-Array-Status.png) @@ -203,16 +205,16 @@ The downside of this backup approach is that the image will have the same size a # dd if=/dev/sda of=/system_images/sda.img OR - --------------------- Alternatively, you can compress the image file --------------------- - # dd if=/dev/sda | gzip -c > /system_images/sda.img.gz + --------------------- Alternatively, you can compress the image file --------------------- + # dd if=/dev/sda | gzip -c > /system_images/sda.img.gz **Restoring the backup from the image file** # dd if=/system_images/sda.img of=/dev/sda - OR - - --------------------- Depending on your choice while creating the image --------------------- - gzip -dc /system_images/sda.img.gz | dd of=/dev/sda + OR + + --------------------- Depending on your choice while creating the image --------------------- + gzip -dc /system_images/sda.img.gz | dd of=/dev/sda Method 2: Backup certain files / directories with tar command – already covered in [Part 3][3] of this series. You may consider using this method if you need to keep copies of specific files and directories (configuration files, users’ home directories, and so on). @@ -247,7 +249,7 @@ Synchronizing remote → local directories over ssh. In this case, switch the source and destination directories from the previous example. - # rsync -avzhe ssh root@remote_host:/remote_directory/ backups + # rsync -avzhe ssh root@remote_host:/remote_directory/ backups Please note that these are only 3 examples (most frequent cases you’re likely to run into) of the use of rsync. For more examples and usages of rsync commands can be found at the following article. diff --git a/sources/tech/LFCS/Part 7 - LFCS--Managing System Startup Process and Services SysVinit Systemd and Upstart.md b/sources/tech/LFCS/Part 7 - LFCS--Managing System Startup Process and Services SysVinit Systemd and Upstart.md index b024c89540..4b7cdf9fe2 100644 --- a/sources/tech/LFCS/Part 7 - LFCS--Managing System Startup Process and Services SysVinit Systemd and Upstart.md +++ b/sources/tech/LFCS/Part 7 - LFCS--Managing System Startup Process and Services SysVinit Systemd and Upstart.md @@ -1,3 +1,5 @@ +Translating by Xuanwo + Part 7 - LFCS: Managing System Startup Process and Services (SysVinit, Systemd and Upstart) ================================================================================ A couple of months ago, the Linux Foundation announced the LFCS (Linux Foundation Certified Sysadmin) certification, an exciting new program whose aim is allowing individuals from all ends of the world to get certified in performing basic to intermediate system administration tasks on Linux systems. This includes supporting already running systems and services, along with first-hand problem-finding and analysis, plus the ability to decide when to raise issues to engineering teams. @@ -267,7 +269,7 @@ Starting Stoping Services Under systemd you can enable or disable a service when it boots. - # systemctl enable [service] # enable a service + # systemctl enable [service] # enable a service # systemctl disable [service] # prevent a service from starting at boot The process of enabling or disabling a service to start automatically on boot consists in adding or removing symbolic links in the /etc/systemd/system/multi-user.target.wants directory. @@ -315,7 +317,7 @@ For example, # My test service - Upstart script demo description "Here goes the description of 'My test service'" author "Dave Null " # Stanzas - + # # Stanzas define when and how a process is started and stopped # See a list of stanzas here: http://upstart.ubuntu.com/wiki/Stanzas#respawn diff --git a/sources/tech/LFCS/Part 8 - LFCS--Managing Users and Groups File Permissions and Attributes and Enabling sudo Access on Accounts.md b/sources/tech/LFCS/Part 8 - LFCS--Managing Users and Groups File Permissions and Attributes and Enabling sudo Access on Accounts.md index 4ccf3f20f6..50f39ee2d9 100644 --- a/sources/tech/LFCS/Part 8 - LFCS--Managing Users and Groups File Permissions and Attributes and Enabling sudo Access on Accounts.md +++ b/sources/tech/LFCS/Part 8 - LFCS--Managing Users and Groups File Permissions and Attributes and Enabling sudo Access on Accounts.md @@ -1,3 +1,5 @@ +Translating by Xuanwo + Part 8 - LFCS: Managing Users & Groups, File Permissions & Attributes and Enabling sudo Access on Accounts ================================================================================ Last August, the Linux Foundation started the LFCS certification (Linux Foundation Certified Sysadmin), a brand new program whose purpose is to allow individuals everywhere and anywhere take an exam in order to get certified in basic to intermediate operational support for Linux systems, which includes supporting running systems and services, along with overall monitoring and analysis, plus intelligent decision-making to be able to decide when it’s necessary to escalate issues to higher level support teams. @@ -191,7 +193,7 @@ Thus, any user should have permission to run /bin/passwd, but only root will be ![Change User Password in Linux](http://www.tecmint.com/wp-content/uploads/2014/10/change-user-password.png) Change User Password - + **Understanding Setgid** 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. You will most likely use this approach whenever members of a certain group need access to all the files in a directory, regardless of the file owner’s primary group. diff --git a/sources/tech/LFCS/Part 9 - LFCS--Linux Package Management with Yum RPM Apt Dpkg Aptitude and Zypper.md b/sources/tech/LFCS/Part 9 - LFCS--Linux Package Management with Yum RPM Apt Dpkg Aptitude and Zypper.md index 7b58a467d7..a363a50c09 100644 --- a/sources/tech/LFCS/Part 9 - LFCS--Linux Package Management with Yum RPM Apt Dpkg Aptitude and Zypper.md +++ b/sources/tech/LFCS/Part 9 - LFCS--Linux Package Management with Yum RPM Apt Dpkg Aptitude and Zypper.md @@ -1,3 +1,5 @@ +Translating by Xuanwo + Part 9 - LFCS: Linux Package Management with Yum, RPM, Apt, Dpkg, Aptitude and Zypper ================================================================================ Last August, the Linux Foundation announced the LFCS certification (Linux Foundation Certified Sysadmin), a shiny chance for system administrators everywhere to demonstrate, through a performance-based exam, that they are capable of succeeding at overall operational support for Linux systems. A Linux Foundation Certified Sysadmin has the expertise to ensure effective system support, first-level troubleshooting and monitoring, including finally issue escalation, when needed, to engineering support teams. @@ -85,7 +87,7 @@ rpm is the package management system used by Linux Standard Base (LSB)-compliant yum adds the functionality of automatic updates and package management with dependency management to RPM-based systems. As a high-level tool, like apt-get or aptitude, yum works with repositories. - Read More: [20 yum Command Examples][4] -- +- ### Common Usage of Low-Level Tools ### The most frequent tasks that you will do with low level tools are as follows: @@ -155,7 +157,7 @@ The most frequent tasks that you will do with high level tools are as follows. aptitude update will update the list of available packages, and aptitude search will perform the actual search for package_name. - # aptitude update && aptitude search package_name + # aptitude update && aptitude search package_name In the search all option, yum will search for package_name not only in package names, but also in package descriptions. @@ -190,8 +192,8 @@ The option remove will uninstall the package but leaving configuration files int # yum erase package_name ---Notice the minus sign in front of the package that will be uninstalled, openSUSE --- - - # zypper remove -package_name + + # zypper remove -package_name Most (if not all) package managers will prompt you, by default, if you’re sure about proceeding with the uninstallation before actually performing it. So read the onscreen messages carefully to avoid running into unnecessary trouble! @@ -199,7 +201,7 @@ Most (if not all) package managers will prompt you, by default, if you’re sure The following command will display information about the birthday package. - # aptitude show birthday + # aptitude show birthday # yum info birthday # zypper info birthday From f87d0c6fdfc6cc275997d7b679719349609d14e8 Mon Sep 17 00:00:00 2001 From: Xuanwo Date: Wed, 26 Aug 2015 08:46:50 +0800 Subject: [PATCH 455/507] small bug fixed --- ...50817 Top 5 Torrent Clients For Ubuntu Linux.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/translated/share/20150817 Top 5 Torrent Clients For Ubuntu Linux.md b/translated/share/20150817 Top 5 Torrent Clients For Ubuntu Linux.md index 0ba1ac3e03..80c9899637 100644 --- a/translated/share/20150817 Top 5 Torrent Clients For Ubuntu Linux.md +++ b/translated/share/20150817 Top 5 Torrent Clients For Ubuntu Linux.md @@ -4,7 +4,7 @@ Translating by Xuanwo ================================================================================ ![Best Torrent clients for Ubuntu Linux](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/08/5_Best_Torrent_Ubuntu.png) -你在寻找**Ubuntu中最好的BT客户端**吗?事实上,桌面平台中有许多可用的BT客户端,但是它们中的哪些才是**最好的**呢? +在寻找**Ubuntu中最好的BT客户端**吗?事实上,桌面平台中有许多可用的BT客户端,但是它们中的哪些才是**最好的**呢? 我将会列出最好的五个BT客户端,它们都拥有着体积轻盈,功能强大的特点,而且还有令人印象深刻的用户界面。自然,易于安装和使用也是特性之一。 @@ -32,7 +32,7 @@ Deluge可在Ubuntu的仓库中获取,你能够在Ubuntu软件中心中安装 ![qBittorrent client for Linux](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/08/qbittorrent_icon.png) -正如它的名字所暗示的,[qBittorrent][2] 是著名的 [Bittorrent][3] 应用的Qt版本。如果你曾经使用过它,你将会看到和Windows下的Bittorrent相似的界面。同样轻巧并且有着BT客户端的所有标准功能,qBittorrent也可以在Ubuntu的默认仓库中找到。 +正如它的名字所暗示的,[qBittorrent][2] 是著名的 [Bittorrent][3] 应用的Qt版本。如果曾经使用过它,你将会看到和Windows下的Bittorrent相似的界面。同样轻巧并且有着BT客户端的所有标准功能,qBittorrent也可以在Ubuntu的默认仓库中找到。 它可以通过Ubuntu软件仓库安装,或者使用下面的命令: @@ -56,7 +56,7 @@ Deluge可在Ubuntu的仓库中获取,你能够在Ubuntu软件中心中安装 ![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]是许多Linux以及Windows用户最喜欢的BT客户端。除了标准的功能,你可以直接在应用程序中搜索种子。你也可以订阅系列片源,这样你就无需再去寻找新的片源了,因为你可以在侧边栏中的订阅看到它们。 +[Vuze][6]是许多Linux以及Windows用户最喜欢的BT客户端。除了标准的功能,你可以直接在应用程序中搜索种子,也可以订阅系列片源,这样就无需再去寻找新的片源了,因为你可以在侧边栏中的订阅看到它们。 它还配备了一个视频播放器,可以播放带有字幕的高清视频以及一切。但是我不认为你会用它来代替那些更好的视频播放器,比如VLC。 @@ -72,7 +72,7 @@ Vuze可以通过Ubuntu软件中心安装或者使用下列命令: [Frostwire][7]可能会是一个你想要去尝试的应用。它不仅仅是一个简单的BT客户端,它还可以应用于安卓,你可以用它通过Wifi来共享文件。 -你可以在应用中搜索种子并且播放他们。除了下载文件,它还可以浏览你本地的影音文件,并且将它们有条理的呈现在播放器中。这同样适用于安卓版本。 +你可以在应用中搜索种子并且播放他们。除了下载文件,它还可以浏览本地的影音文件,并且将它们有条理的呈现在播放器中。这同样适用于安卓版本。 还有一个特点是:Frostwire提供了印度艺术家的合法音乐下载。你可以下载并且欣赏它们,免费而且合法。 @@ -84,15 +84,15 @@ Vuze可以通过Ubuntu软件中心安装或者使用下列命令: 在Windows中,uTorrent(发音:mu torrent)是我最喜欢的BT应用。尽管uTorrent可以在Linux下运行,但是我还是特意忽略了它。因为在Linux下使用uTorrent不仅困难,而且无法获得完整的应用体验(运行在浏览器中)。 -你可以[在这里][9]阅读Ubuntu下uTorrent的安装教程。 +可以[在这里][9]阅读Ubuntu下uTorrent的安装教程。 #### 快速提示: #### -大多数情况下,BT应用不会默认自动自动启动。如果你想改变这一行为,阅读[如何管理Ubuntu下的自启程序][10]来学习。 +大多数情况下,BT应用不会默认自动自动启动。如果想改变这一行为,请阅读[如何管理Ubuntu下的自启程序][10]来学习。 ### 你最喜欢的是什么? ### -这些是我对于Ubuntu下最好的BT客户端的一键。你最喜欢的是什么呢?请发表评论。你也可以查看与本主题相关的[Ubuntu最好的下载管理器][11]。如果你使用Popcorn Time,试试[Popcorn Time技巧][12] +这些是我对于Ubuntu下最好的BT客户端的意见。你最喜欢的是什么呢?请发表评论。也可以查看与本主题相关的[Ubuntu最好的下载管理器][11]。如果使用Popcorn Time,试试[Popcorn Time技巧][12] -------------------------------------------------------------------------------- From 3646e757e6ecde5c85cfcdcbddae02e91d71aa7c Mon Sep 17 00:00:00 2001 From: bazz2 Date: Wed, 26 Aug 2015 08:50:34 +0800 Subject: [PATCH 456/507] [translated by bazz2]Linux about to gain a new file system--bcachefs --- ...out to gain a new file system--bcachefs.md | 26 ------------------- ...out to gain a new file system--bcachefs.md | 25 ++++++++++++++++++ 2 files changed, 25 insertions(+), 26 deletions(-) delete mode 100644 sources/talk/20150824 Linux about to gain a new file system--bcachefs.md create mode 100644 translated/talk/20150824 Linux about to gain a new file system--bcachefs.md diff --git a/sources/talk/20150824 Linux about to gain a new file system--bcachefs.md b/sources/talk/20150824 Linux about to gain a new file system--bcachefs.md deleted file mode 100644 index 9568d05836..0000000000 --- a/sources/talk/20150824 Linux about to gain a new file system--bcachefs.md +++ /dev/null @@ -1,26 +0,0 @@ -[bazz2222222] -Linux about to gain a new file system – bcachefs -================================================================================ -A five year old file system built by Kent Overstreet, formerly of Google, is near feature complete with all critical components in place. Bcachefs boasts the performance and reliability of the widespread ext4 and xfs as well as the feature list similar to that of btrfs and zfs. Notable features include checksumming, compression, multiple devices, caching and eventually snapshots and other “nifty” features. - -Bcachefs started out as **bcache** which was a block caching layer, the evolution from bcache to a fully featured [copy-on-write][1] file system has been described as a metamorphosis. - -Responding to the self-imposed question “Yet another new filesystem? Why?” Kent Overstreet replies with the following “Well, years ago (going back to when I was still at Google), I and the other people working on bcache realized that what we were working on was, almost by accident, a good chunk of the functionality of a full blown filesystem – and there was a really clean and elegant design to be had there if we took it and ran with it. And a fast one – the main goal of bcachefs to match ext4 and xfs on performance and reliability, but with the features of btrfs/xfs.” - -Overstreet has invited people to use and test bcachefs out on their own systems. To find instructions to use bcachefs on your system check out the mailing list [announcement][2]. - -The file system situation on Linux is a fairly drawn out one, Fedora 16 for instance aimed to use btrfs instead of ext4 as the default file system, this switch still has not happened. Currently all of the Debian based distros, including Ubuntu, Mint and elementary OS, still use ext4 as their default file systems and none have even whispered about switching to a new default file system yet. - --------------------------------------------------------------------------------- - -via: http://www.linuxveda.com/2015/08/22/linux-gain-new-file-system-bcachefs/ - -作者:[Paul Hill][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/paul_hill/ -[1]:https://en.wikipedia.org/wiki/Copy-on-write -[2]:https://lkml.org/lkml/2015/8/21/22 diff --git a/translated/talk/20150824 Linux about to gain a new file system--bcachefs.md b/translated/talk/20150824 Linux about to gain a new file system--bcachefs.md new file mode 100644 index 0000000000..4fe4bf8ff9 --- /dev/null +++ b/translated/talk/20150824 Linux about to gain a new file system--bcachefs.md @@ -0,0 +1,25 @@ +Linux 界将出现一个新的文件系统:bcachefs +================================================================================ +这个有 5 年历史,由 Kent Oberstreet 创建,过去属于谷歌的文件系统,最近完成了关键的组件。Bcachefs 文件系统自称其性能和稳定性与 ext4 和 xfs 相同,而其他方面的功能又可以与 btrfs 和 zfs 相媲美。主要特性包括校验、压缩、多设备支持、缓存、快照与其他好用的特性。 + +Bcachefs 来自 **bcache**,这是一个块级缓存层,从 bcaceh 到一个功能完整的[写时复制][1]文件系统,堪称是一项质的转变。 + +在自己提出问题“为什么要出一个新的文件系统”中,Kent Oberstreet 作了以下回答:当我还在谷歌的时候,我与其他在 bcache 上工作的同事在偶然的情况下意识到我们正在使用的东西可以成为一个成熟文件系统的功能块,我们可以用 bcache 创建一个拥有干净而优雅设计的文件系统,而最重要的一点是,bcachefs 的主要目的就是在性能和稳定性上能与 ext4 和 xfs 匹敌,同时拥有 btrfs 和 zfs 的特性。 + +Overstreet 邀请人们在自己的系统上测试 bcachefs,可以通过邮件列表[通告]获取 bcachefs 的操作指南。 + +Linux 生态系统中文件系统几乎处于一家独大状态,Fedora 在第 16 版的时候就想用 btrfs 换掉 ext4 作为其默认文件系统,但是到现在(LCTT:都出到 Fedora 22 了)还在使用 ext4。而几乎所有 Debian 系的发行版(Ubuntu、Mint、elementary OS 等)也使用 ext4 作为默认文件系统,并且这些主流的发生版都没有替换默认文件系统的意思。 + +-------------------------------------------------------------------------------- + +via: http://www.linuxveda.com/2015/08/22/linux-gain-new-file-system-bcachefs/ + +作者:[Paul Hill][a] +译者:[bazz2](https://github.com/bazz2) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.linuxveda.com/author/paul_hill/ +[1]:https://en.wikipedia.org/wiki/Copy-on-write +[2]:https://lkml.org/lkml/2015/8/21/22 From 43513f894f561fb8013d27ed9f90a3cb54d28aa2 Mon Sep 17 00:00:00 2001 From: joeren Date: Wed, 26 Aug 2015 08:58:41 +0800 Subject: [PATCH 457/507] Update 20150824 How To Add Hindi And Devanagari Support In Antergos And Arch Linux.md --- ... Hindi And Devanagari Support In Antergos And Arch Linux.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150824 How To Add Hindi And Devanagari Support In Antergos And Arch Linux.md b/sources/tech/20150824 How To Add Hindi And Devanagari Support In Antergos And Arch Linux.md index db36df66e6..826fa248a0 100644 --- a/sources/tech/20150824 How To Add Hindi And Devanagari Support In Antergos And Arch Linux.md +++ b/sources/tech/20150824 How To Add Hindi And Devanagari Support In Antergos And Arch Linux.md @@ -1,3 +1,4 @@ +Translating by GOLinux! How To Add Hindi And Devanagari Support In Antergos And Arch Linux ================================================================================ ![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/08/Indian-languages.jpg) @@ -44,4 +45,4 @@ via: http://itsfoss.com/display-hindi-arch-antergos/ [a]:http://itsfoss.com/author/abhishek/ [1]:http://antergos.com/ -[2]:http://itsfoss.com/tag/antergos/ \ No newline at end of file +[2]:http://itsfoss.com/tag/antergos/ From 678a245caf421c84d52e5cabbed3d4b167e6c1f0 Mon Sep 17 00:00:00 2001 From: GOLinux Date: Wed, 26 Aug 2015 09:24:56 +0800 Subject: [PATCH 458/507] [Translated]20150824 How To Add Hindi And Devanagari Support In Antergos And Arch Linux.md --- ...gari Support In Antergos And Arch Linux.md | 48 ------------------- ...gari Support In Antergos And Arch Linux.md | 46 ++++++++++++++++++ 2 files changed, 46 insertions(+), 48 deletions(-) delete mode 100644 sources/tech/20150824 How To Add Hindi And Devanagari Support In Antergos And Arch Linux.md create mode 100644 translated/tech/20150824 How To Add Hindi And Devanagari Support In Antergos And Arch Linux.md diff --git a/sources/tech/20150824 How To Add Hindi And Devanagari Support In Antergos And Arch Linux.md b/sources/tech/20150824 How To Add Hindi And Devanagari Support In Antergos And Arch Linux.md deleted file mode 100644 index 826fa248a0..0000000000 --- a/sources/tech/20150824 How To Add Hindi And Devanagari Support In Antergos And Arch Linux.md +++ /dev/null @@ -1,48 +0,0 @@ -Translating by GOLinux! -How To Add Hindi And Devanagari Support In Antergos And Arch Linux -================================================================================ -![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/08/Indian-languages.jpg) - -You might be knowing by now that I have been trying my hands on [Antergos Linux][1] lately. One of the first few things I noticed after installing [Antergos][2] was that **Hindi scripts were not displayed properly** in the default chromium browser. - -This is a strange thing that I never encountered before in my desktop Linux experience ever. First, I thought maybe it could be a browser problem so I went on to install Firefox only to see the same story repeated. Firefox also could not display Hindi properly. Unlike Chromium that displayed nothing, Firefox did display something but it was not readable. - -![No hindi support in Arch Linux based Antergos](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/08/Hindi_Support_Antergos_Arch_linux_1.jpeg) - -Hindi display in Chromium - -![No hindi support in Arch Linux based Antergos](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/08/Hindi_Support_Antergos_Arch_linux_2.jpeg) - -Hindi display in Firefox - -Strange? So no Hindi support in Arch based Antergos Linux by default? I did not verify, but I presume that it would be the same for other Indian languages etc that are also based on Devanagari script. - -I this quick tutorial, I am going to show you how to add Devanagari support so that Hindi and other Indian languages are displayed properly. - -### Add Indian language support in Antergos and Arch Linux ### - -Open a terminal and use the following command: - - sudo yaourt -S ttf-indic-otf - -Enter the password. And it will provide rendering support for Indian languages. - -Restarting Firefox displayed Hindi correctly immediately, but it took a restart to display Hindi. For that reason, I advise that you **restart your system** after installing the Indian fonts. - -![Adding Hindi display support in Arch based Antergos Linux](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/08/Hindi_Support_Antergos_Arch_linux_4.jpeg) - -I hope tis quick helped you to read Hindi, Sanskrit, Tamil, Telugu, Malayalam, Bangla and other Indian languages in Antergos and other Arch based Linux distros such as Manjaro Linux. - --------------------------------------------------------------------------------- - -via: http://itsfoss.com/display-hindi-arch-antergos/ - -作者:[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://antergos.com/ -[2]:http://itsfoss.com/tag/antergos/ diff --git a/translated/tech/20150824 How To Add Hindi And Devanagari Support In Antergos And Arch Linux.md b/translated/tech/20150824 How To Add Hindi And Devanagari Support In Antergos And Arch Linux.md new file mode 100644 index 0000000000..1bcc05a080 --- /dev/null +++ b/translated/tech/20150824 How To Add Hindi And Devanagari Support In Antergos And Arch Linux.md @@ -0,0 +1,46 @@ +为Antergos与Arch Linux添加印度语和梵文支持 +================================================================================ +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/08/Indian-languages.jpg) + +你们到目前或许知道,我最近一直在尝试体验[Antergos Linux][1]。在安装完[Antergos][2]后我所首先注意到的一些事情是在默认的Chromium浏览器中**没法正确显示印度语脚本**。 + +这是一件奇怪的事情,在我之前桌面Linux的体验中是从未遇到过的。起初,我认为是浏览器的问题,所以我安装了Firefox,然而问题依旧,Firefox也不能正确显示印度语。和Chromium不显示任何东西不同的是,Firefox确实显示了一些东西,但是毫无可读性。 + +![No hindi support in Arch Linux based Antergos](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/08/Hindi_Support_Antergos_Arch_linux_1.jpeg) +Chromium中的印度语显示 + + +![No hindi support in Arch Linux based Antergos](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/08/Hindi_Support_Antergos_Arch_linux_2.jpeg) +Firefox中的印度语显示 + +奇怪吧?那么,默认情况下基于Arch的Antergos Linux中没有印度语的支持吗?我没有去验证,但是我假设其它基于梵语脚本的印地语之类会产生同样的问题。 + +在这个快速指南中,我打算为大家演示如何来添加梵语支持,以便让印度语和其它印地语都能正确显示。 + +### 在Antergos和Arch Linux中添加印地语支持 ### + +打开终端,使用以下命令: + + sudo yaourt -S ttf-indic-otf + +键入密码,它会提供给你对于印地语的译文支持。 + +重启Firefox,会马上正确显示印度语了,但是它需要一次重启来显示印度语。因此,我建议你在安装了印地语字体后**重启你的系统**。 + +![Adding Hindi display support in Arch based Antergos Linux](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/08/Hindi_Support_Antergos_Arch_linux_4.jpeg) + +我希望这篇快速指南能够帮助你,让你可以在Antergos和其它基于Arch的Linux发行版中,如Manjaro Linux,阅读印度语、梵文、泰米尔语、泰卢固语、马拉雅拉姆语、孟加拉语,以及其它印地语。 + +-------------------------------------------------------------------------------- + +via: http://itsfoss.com/display-hindi-arch-antergos/ + +作者:[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://antergos.com/ +[2]:http://itsfoss.com/tag/antergos/ From d0b3823ee81ddae2ddc374aee4bacb2d34956387 Mon Sep 17 00:00:00 2001 From: joeren Date: Wed, 26 Aug 2015 09:27:15 +0800 Subject: [PATCH 459/507] Update 20150824 Mhddfs--Combine Several Smaller Partition into One Large Virtual Storage.md --- ...Several Smaller Partition into One Large Virtual Storage.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150824 Mhddfs--Combine Several Smaller Partition into One Large Virtual Storage.md b/sources/tech/20150824 Mhddfs--Combine Several Smaller Partition into One Large Virtual Storage.md index 6815fa64d8..ebf3a9c4fd 100644 --- a/sources/tech/20150824 Mhddfs--Combine Several Smaller Partition into One Large Virtual Storage.md +++ b/sources/tech/20150824 Mhddfs--Combine Several Smaller Partition into One Large Virtual Storage.md @@ -1,3 +1,4 @@ +Translating by GOLinux! Mhddfs – Combine Several Smaller Partition into One Large Virtual Storage ================================================================================ Let’s assume that you have 30GB of movies and you have 3 drives each 20 GB in size. So how will you store? @@ -183,4 +184,4 @@ via: http://www.tecmint.com/combine-partitions-into-one-in-linux-using-mhddfs/ [a]:http://www.tecmint.com/author/avishek/ [1]:http://www.tecmint.com/understanding-raid-setup-in-linux/ [2]:http://www.tecmint.com/mount-filesystem-in-linux/ -[3]:http://www.tecmint.com/how-to-enable-epel-repository-for-rhel-centos-6-5/ \ No newline at end of file +[3]:http://www.tecmint.com/how-to-enable-epel-repository-for-rhel-centos-6-5/ From 08862d689ef1eb4776633573c33b7b8f9257c2c7 Mon Sep 17 00:00:00 2001 From: Ezio Date: Wed, 26 Aug 2015 09:43:49 +0800 Subject: [PATCH 460/507] Update 20150728 Process of the Linux kernel building.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 翻译完成 20150728 Process of the Linux kernel building.md --- ...28 Process of the Linux kernel building.md | 127 ++---------------- 1 file changed, 12 insertions(+), 115 deletions(-) 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 b1c4388e66..9ee5f795ef 100644 --- a/sources/tech/20150728 Process of the Linux kernel building.md +++ b/sources/tech/20150728 Process of the Linux kernel building.md @@ -199,9 +199,7 @@ 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): - -在这些定义好的变量之后,我们又定义了两个变量:`USERINCLUDE` 和`LINUXINCLUDE`。他们为包含头文件的路径(第一个是给用户用的,第二个是给内核用的): +在这些定义好的变量后面,我们又定义了两个变量:`USERINCLUDE` 和`LINUXINCLUDE`。他们包含了头文件的路径(第一个是给用户用的,第二个是给内核用的): ```Makefile USERINCLUDE := \ @@ -216,7 +214,6 @@ LINUXINCLUDE := \ ... ``` -And the standard flags for the C compiler: 以及标准的C 编译器标志: ```Makefile KBUILD_CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \ @@ -226,8 +223,7 @@ KBUILD_CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \ -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 里面更新(比如`arch/` 里面的kbuild)。经过所有这些,全部变量会被导出,这样其他makefile 就可以直接使用了。下面的两个变量`RCS_FIND_IGNORE` 和 `RCS_TAR_IGNORE` 包含了被版本控制系统忽略的文件: +这并不是最终确定的编译器标志,他们还可以在其他makefile 里面更新(比如`arch/` 里面的kbuild)。变量定义完之后,全部会被导出供其他makefile 使用。下面的两个变量`RCS_FIND_IGNORE` 和 `RCS_TAR_IGNORE` 包含了被版本控制系统忽略的文件: ```Makefile export RCS_FIND_IGNORE := \( -name SCCS -o -name BitKeeper -o -name .svn -o \ @@ -237,16 +233,11 @@ 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`. - 这就是全部了,我们已经完成了所有的准备工作,下一个点就是如果构建`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(注:内核根目录下的makefile)的下一步工作就是和编译内核相关的了。在我们执行`make` 命令之前,我们不会在终端看到任何东西。但是现在编译的第一步开始了,这里我们需要从内核根makefile的的[598](https://github.com/torvalds/linux/blob/master/Makefile#L598) 行开始,这里可以看到目标`vmlinux`: ```Makefile @@ -254,29 +245,20 @@ 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. - 不要操心我们略过的从`export RCS_FIND_IGNORE.....` 到`all: vmlinux.....` 这一部分makefile 代码,他们只是负责根据各种配置文件生成不同目标内核的,因为之前我就说了这一部分我们只讨论构建内核的通用途径。 -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: - -目标`all:` 是在命令行里不指定目标时默认生成的目标。你可以看到这里我们包含了架构相关的makefile(默认情况下会是[arch/x86/Makefile](https://github.com/torvalds/linux/blob/master/arch/x86/Makefile))。从这一时刻起,我们会从这个makefile 继续进行下去。如我们所见,目标`all` 依赖于根makefile 后面声明的`vmlinux`: +目标`all:` 是在命令行如果不指定具体目标时默认使用的目标。你可以看到这里包含了架构相关的makefile(在这里就指的是[arch/x86/Makefile](https://github.com/torvalds/linux/blob/master/arch/x86/Makefile))。从这一时刻起,我们会从这个makefile 继续进行下去。如我们所见,目标`all` 依赖于根makefile 后面声明的`vmlinux`: ```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: - `vmlinux` 是linux 内核的静态链接可执行文件格式。脚本[scripts/link-vmlinux.sh](https://github.com/torvalds/linux/blob/master/scripts/link-vmlinux.sh) 把不同的编译好的子模块链接到一起形成了vmlinux。第二个目标是`vmlinux-deps`,它的定义如下: - ```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: - 它是由内核代码下的每个顶级目录的`built-in.o` 组成的。之后我们还会检查内核所有的目录,`kbuild` 会编译各个目录下所有的对应`$obj-y` 的源文件。接着调用`$(LD) -r` 把这些文件合并到一个`build-in.o` 文件里。此时我们还没有`vmloinux-deps`, 所以目标`vmlinux` 现在还不会被构建。对我而言`vmlinux-deps` 包含下面的文件 ``` @@ -295,8 +277,6 @@ 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 @@ -305,8 +285,6 @@ $(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: - 就像我们看到的,`vmlinux-dir` 依赖于两部分:`prepare` 和`scripts`。第一个`prepare` 定义在内核的根`makefile` ,准备工作分成三个阶段: ```Makefile @@ -321,17 +299,13 @@ prepare1: prepare2 $(version_h) include/generated/utsrelease.h \ 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: - -第一个`prepare0` 展开到`archprepare` ,后者又展开到`archheader` 和`archscripts`,这两个变量定义在`x86_64` 相关的[Makefile](https://github.com/torvalds/linux/blob/master/arch/x86/Makefile)。让我们看看这个文件。`x86_64` 特定的makefile从变量定义开始,这些变量都是和特定架构的配置文件 ([defconfig](https://github.com/torvalds/linux/tree/master/arch/x86/configs),等等)有关联。变量定义之后,这个makefile 定义了编译[16-bit](https://en.wikipedia.org/wiki/Real_mode)代码的编译选项,根据变量`BITS` 的值,如果是`32` 汇编代码、链接器、以及其它很多东西(全部的定义都可以在[arch/x86/Makefile](https://github.com/torvalds/linux/blob/master/arch/x86/Makefile)找到)对应的参数就是`i386`,而`64`就对应的是`x86_84`。生成的系统调用列表(syscall table)的makefile 里第一个目标就是`archheaders` : +第一个`prepare0` 展开到`archprepare` ,后者又展开到`archheader` 和`archscripts`,这两个变量定义在`x86_64` 相关的[Makefile](https://github.com/torvalds/linux/blob/master/arch/x86/Makefile)。让我们看看这个文件。`x86_64` 特定的makefile从变量定义开始,这些变量都是和特定架构的配置文件 ([defconfig](https://github.com/torvalds/linux/tree/master/arch/x86/configs),等等)有关联。变量定义之后,这个makefile 定义了编译[16-bit](https://en.wikipedia.org/wiki/Real_mode)代码的编译选项,根据变量`BITS` 的值,如果是`32`, 汇编代码、链接器、以及其它很多东西(全部的定义都可以在[arch/x86/Makefile](https://github.com/torvalds/linux/blob/master/arch/x86/Makefile)找到)对应的参数就是`i386`,而`64`就对应的是`x86_84`。生成的系统调用列表(syscall table)的makefile 里第一个目标就是`archheaders` : ```Makefile archheaders: $(Q)$(MAKE) $(build)=arch/x86/entry/syscalls all ``` -And the second target is `archscripts` in this makefile is: - 这个makefile 里第二个目标就是`archscripts`: ```Makefile @@ -339,17 +313,13 @@ 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: - - 我们可以看到`archscripts` 是依赖于根[Makefile](https://github.com/torvalds/linux/blob/master/Makefile)里的`scripts_basic` 。首先我们可以看出`scripts_basic` 是根据[scripts/basic](https://github.com/torvalds/linux/blob/master/scripts/basic/Makefile) 的mekefile 执行的: + 我们可以看到`archscripts` 是依赖于根[Makefile](https://github.com/torvalds/linux/blob/master/Makefile)里的`scripts_basic` 。首先我们可以看出`scripts_basic` 是按照[scripts/basic](https://github.com/torvalds/linux/blob/master/scripts/basic/Makefile) 的mekefile 执行make 的: ```Maklefile scripts_basic: $(Q)$(MAKE) $(build)=scripts/basic ``` -The `scripts/basic/Makefile` contains targets for compilation of the two host programs: `fixdep` and `bin2`: - `scripts/basic/Makefile`包含了编译两个主机程序`fixdep` 和`bin2` 的目标: ```Makefile @@ -360,8 +330,6 @@ 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: - 第一个工具是`fixdep`:用来优化[gcc](https://gcc.gnu.org/) 生成的依赖列表,然后在重新编译源文件的时候告诉make。第二个工具是`bin2c`,他依赖于内核配置选项`CONFIG_BUILD_BIN2C`,并且它是一个用来将标准输入接口(注:即stdin)收到的二进制流通过标准输出接口(即:stdout)转换成C 头文件的非常小的C 程序。你可以注意到这里有些奇怪的标志,如`hostprogs-y`等。这些标志使用在所有的`kbuild` 文件,更多的信息你可以从[documentation](https://github.com/torvalds/linux/blob/master/Documentation/kbuild/makefiles.txt) 获得。在我们的用例`hostprogs-y` 中,他告诉`kbuild` 这里有个名为`fixed` 的程序,这个程序会通过和`Makefile` 相同目录的`fixdep.c` 编译而来。执行make 之后,终端的第一个输出就是`kbuild` 的结果: ``` @@ -369,16 +337,12 @@ $ 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: - 当目标`script_basic` 被执行,目标`archscripts` 就会make [arch/x86/tools](https://github.com/torvalds/linux/blob/master/arch/x86/tools/Makefile) 下的makefile 和目标`relocs`: ```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: - 代码`relocs_32.c` 和`relocs_64.c` 包含了[重定位](https://en.wikipedia.org/wiki/Relocation_%28computing%29) 的信息,将会被编译,者可以在`make` 的输出中看到: ```Makefile @@ -388,8 +352,6 @@ The `relocs_32.c` and the `relocs_64.c` will be compiled that will contain [relo HOSTLD arch/x86/tools/relocs ``` -There is checking of the `version.h` after compiling of the `relocs.c`: - 在编译完`relocs.c` 之后会检查`version.h`: ```Makefile @@ -398,17 +360,12 @@ $(version_h): $(srctree)/Makefile FORCE $(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: - 以及在内核根Makefiel 使用`arch/x86/include/generated/asm`的目标`asm-generic` 来构建`generic` 汇编头文件。在目标`asm-generic` 之后,`archprepare` 就会被完成,所以目标`prepare0` 会接着被执行,如我上面所写: ```Makefile @@ -416,32 +373,24 @@ 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: - 注意`build`,它是定义在文件[scripts/Kbuild.include](https://github.com/torvalds/linux/blob/master/scripts/Kbuild.include),内容是这样的: ```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: - 参数`obj` 会告诉脚本[scripts/Makefile.build](https://github.com/torvalds/linux/blob/master/scripts/Makefile.build) 那些目录包含`kbuild` 文件,脚本以此来寻找各个`kbuild` 文件: ```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: - -然后根据这个构建目标。我们这里`.` 包含了[Kbuild](https://github.com/torvalds/linux/blob/master/Kbuild),就用这个文件来生成`kernel/bounds.s` 和`arch/x86/kernel/asm-offsets.s`。这样目标`prepare` 就完成了它的工作。`vmlinux-dirs` 也依赖于第二个目标——`scripts` ,`scripts`会编译接下来的几个程序:`filealias`,`mk_elfconfig`,`modpost`等等。`scripts/host-programs` 编译完之后,我们的目标`vmlinux-dirs` 就可以开始编译了。第一步,我们先来理解一下`vmlinux-dirs` 都包含了那些东西。在我们的例子中它包含了接下来的内核目录的路径: +然后根据这个构建目标。我们这里`.` 包含了[Kbuild](https://github.com/torvalds/linux/blob/master/Kbuild),就用这个文件来生成`kernel/bounds.s` 和`arch/x86/kernel/asm-offsets.s`。这样目标`prepare` 就完成了它的工作。`vmlinux-dirs` 也依赖于第二个目标——`scripts` ,`scripts`会编译接下来的几个程序:`filealias`,`mk_elfconfig`,`modpost`等等。`scripts/host-programs` 编译完之后,我们的目标`vmlinux-dirs` 就可以开始编译了。第一步,我们先来理解一下`vmlinux-dirs` 都包含了那些东西。在我们的例子中它包含了接下来要使用的内核目录的路径: ``` init usr arch/x86 kernel mm fs ipc security crypto block @@ -449,8 +398,6 @@ 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](https://github.com/torvalds/linux/blob/master/Makefile) 里找到`vmlinux-dirs` 的定义: ```Makefile @@ -467,8 +414,6 @@ 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: - 这里我们借助函数`patsubst` 和`filter`去掉了每个目录路径里的符号`/`,并且把结果放到`vmlinux-dirs` 里。所以我们就有了`vmlinux-dirs` 里的目录的列表,以及下面的代码: ```Makefile @@ -476,8 +421,6 @@ $(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: - 符号`$@` 在这里代表了`vmlinux-dirs`,这就表明程序会递归遍历从`vmlinux-dirs` 以及它内部的全部目录(依赖于配置),并且在对应的目录下执行`make` 命令。我们可以在输出看到结果: ``` @@ -495,8 +438,8 @@ The `$@` represents `vmlinux-dirs` here that means that it will go recursively o CC arch/x86/entry/syscall_64.o ``` -Source code in each directory will be compiled and linked to the `built-in.o`: 每个目录下的源代码将会被编译并且链接到`built-io.o` 里: + ``` $ find . -name built-in.o ./arch/x86/crypto/built-in.o @@ -508,8 +451,6 @@ $ find . -name 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. - 好了,所有的`built-in.o` 都构建完了,现在我们回到目标`vmlinux` 上。你应该还记得,目标`vmlinux` 是在内核的根makefile 里。在链接`vmlinux` 之前,系统会构建[samples](https://github.com/torvalds/linux/tree/master/samples), [Documentation](https://github.com/torvalds/linux/tree/master/Documentation)等等,但是如上文所述,我不会在本文描述这些。 ```Makefile @@ -519,8 +460,6 @@ 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: - 你可以看到,`vmlinux` 的调用脚本[scripts/link-vmlinux.sh](https://github.com/torvalds/linux/blob/master/scripts/link-vmlinux.sh) 的主要目的是把所有的`built-in.o` 链接成一个静态可执行文件、生成[System.map](https://en.wikipedia.org/wiki/System.map)。 最后我们来看看下面的输出: ``` @@ -539,31 +478,24 @@ As you can see main purpose of it is a call of the [scripts/link-vmlinux.sh](htt SYSMAP System.map ``` -and `vmlinux` and `System.map` in the root of the Linux kernel source tree: -还有内核源码树根目录下的`vmlinux` 和`System.map` +以及内核源码树根目录下的`vmlinux` 和`System.map` + ``` $ 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). - 这就是全部了,`vmlinux` 构建好了,下一步就是创建[bzImage](https://en.wikipedia.org/wiki/Vmlinux#bzImage). -Building bzImage 制作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: - -`bzImage` 就是压缩了的linux 内核镜像。我们可以在构建了`vmlinux` 之后通过执行`make bzImage` 获得`bzImage`。同时我们可以仅仅执行`make` 而不带任何参数也可以生成`bzImage` ,因为它是在[arch/x86/kernel/Makefile](https://github.com/torvalds/linux/blob/master/arch/x86/Makefile) 里定义的、默认会生成的镜像: +`bzImage` 就是压缩了的linux 内核镜像。我们可以在构建了`vmlinux` 之后通过执行`make bzImage` 获得`bzImage`。同时我们可以仅仅执行`make` 而不带任何参数也可以生成`bzImage` ,因为它是在[arch/x86/kernel/Makefile](https://github.com/torvalds/linux/blob/master/arch/x86/Makefile) 里预定义的、默认生成的镜像: ```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: - 让我们看看这个目标,他能帮助我们理解这个镜像是怎么构建的。我已经说过了`bzImage` 师被定义在[arch/x86/kernel/Makefile](https://github.com/torvalds/linux/blob/master/arch/x86/Makefile),定义如下: ```Makefile @@ -573,16 +505,12 @@ bzImage: vmlinux $(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: - 在这里我们可以看到第一次为boot 目录执行`make`,在我们的例子里是这样的: ```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`: - 现在的主要目标是编译目录`arch/x86/boot` 和`arch/x86/boot/compressed` 的代码,构建`setup.bin` 和`vmlinux.bin`,然后用这两个文件生成`bzImage`。第一个目标是定义在[arch/x86/boot/Makefile](https://github.com/torvalds/linux/blob/master/arch/x86/boot/Makefile) 的`$(obj)/setup.elf`: ```Makefile @@ -590,8 +518,6 @@ $(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: - 我们已经在目录`arch/x86/boot`有了链接脚本`setup.ld`,并且将变量`SETUP_OBJS` 扩展到`boot` 目录下的全部源代码。我们可以看看第一个输出: ```Makefile @@ -607,15 +533,12 @@ We already have the `setup.ld` linker script in the `arch/x86/boot` directory an 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: - -下一个源码文件是[arch/x86/boot/header.S](https://github.com/torvalds/linux/blob/master/arch/x86/boot/header.S),但是我们不能现在就编译他,因为这个目标依赖于下面两个头文件: +下一个源码文件是[arch/x86/boot/header.S](https://github.com/torvalds/linux/blob/master/arch/x86/boot/header.S),但是我们不能现在就编译它,因为这个目标依赖于下面两个头文件: ```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: 第一个头文件`voffset.h` 是使用`sed` 脚本生成的,包含用`nm` 工具从`vmlinux` 获取的两个地址: ```C @@ -623,8 +546,6 @@ The first is `voffset.h` generated by the `sed` script that gets two addresses f #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): - 这两个地址是内核的起始和结束地址。第二个头文件`zoffset.h` 在[arch/x86/boot/compressed/Makefile](https://github.com/torvalds/linux/blob/master/arch/x86/boot/compressed/Makefile) 可以看出是依赖于目标`vmlinux`的: ```Makefile @@ -632,9 +553,7 @@ $(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: - -目标`$(obj)/compressed/vmlinux` 依赖于变量`vmlinux-objs-y` —— 表明要编译目录[arch/x86/boot/compressed](https://github.com/torvalds/linux/tree/master/arch/x86/boot/compressed) 下的源代码,然后生成`vmlinux.bin`, `vmlinux.bin.bz2`, 和编译工具 - `mkpiggy`。我们可以在下面的输出看出来: +目标`$(obj)/compressed/vmlinux` 依赖于变量`vmlinux-objs-y` —— 说明需要编译目录[arch/x86/boot/compressed](https://github.com/torvalds/linux/tree/master/arch/x86/boot/compressed) 下的源代码,然后生成`vmlinux.bin`, `vmlinux.bin.bz2`, 和编译工具 - `mkpiggy`。我们可以在下面的输出看出来: ```Makefile LDS arch/x86/boot/compressed/vmlinux.lds @@ -647,8 +566,6 @@ The `$(obj)/compressed/vmlinux` target depends on the `vmlinux-objs-y` that comp 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: - `vmlinux.bin` 是去掉了调试信息和注释的`vmlinux` 二进制文件,加上了占用了`u32` (注:即4-Byte)的长度信息的`vmlinux.bin.all` 压缩后就是`vmlinux.bin.bz2`。其中`vmlinux.bin.all` 包含了`vmlinux.bin` 和`vmlinux.relocs`(注:vmlinux 的重定位信息),其中`vmlinux.relocs` 是`vmlinux` 经过程序`relocs` 处理之后的`vmlinux` 镜像(见上文所述)。我们现在已经获取到了这些文件,汇编文件`piggy.S` 将会被`mkpiggy` 生成、然后编译: ```Makefile @@ -656,16 +573,12 @@ Where the `vmlinux.bin` is the `vmlinux` with striped debuging information and c 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: - 这个汇编文件会包含经过计算得来的、压缩内核的偏移信息。处理完这个汇编文件,我们就可以看到`zoffset` 生成了: ```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: - 现在`zoffset.h` 和`voffset.h` 已经生成了,[arch/x86/boot](https://github.com/torvalds/linux/tree/master/arch/x86/boot/) 里的源文件可以继续编译: ```Makefile @@ -686,15 +599,12 @@ As the `zoffset.h` and the `voffset.h` are generated, compilation of the source CC arch/x86/boot/video-bios.o ``` -As all source code files will be compiled, they will be linked to the `setup.elf`: - 所有的源代码会被编译,他们最终会被链接到`setup.elf` : ```Makefile LD arch/x86/boot/setup.elf ``` -or: 或者: @@ -702,32 +612,24 @@ 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: - 最后两件事是创建包含目录`arch/x86/boot/*` 下的编译过的代码的`setup.bin`: ``` objcopy -O binary arch/x86/boot/setup.elf arch/x86/boot/setup.bin ``` -and the creation of the `vmlinux.bin` from the `vmlinux`: - 以及从`vmlinux` 生成`vmlinux.bin` : ``` 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.c](https://github.com/torvalds/linux/blob/master/arch/x86/boot/tools/build.c),它将会用来把`setup.bin` 和`vmlinux.bin` 打包成`bzImage`: ``` 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: - 实际上`bzImage` 就是把`setup.bin` 和`vmlinux.bin` 连接到一起。最终我们会看到输出结果,就和那些用源码编译过内核的同行的结果一样: ``` @@ -737,20 +639,15 @@ 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. - 这就是本文的最后一节。本文我们了解了编译内核的全部步骤:从执行`make` 命令开始,到最后生成`bzImage`。我知道,linux 内核的makefiles 和构建linux 的过程第一眼看起来可能比较迷惑,但是这并不是很难。希望本文可以帮助你理解构建linux 内核的整个流程。 -Links 链接 ================================================================================ From a4e422dd35b5560e84bc1955ab2a2797a03abf59 Mon Sep 17 00:00:00 2001 From: zl Date: Wed, 26 Aug 2015 10:01:29 +0800 Subject: [PATCH 461/507] move file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 翻译完成 Process of the Linux kernel building.md 并移动到translated --- .../tech/20150728 Process of the Linux kernel building.md | 2 -- 1 file changed, 2 deletions(-) rename {sources => translated}/tech/20150728 Process of the Linux kernel building.md (99%) diff --git a/sources/tech/20150728 Process of the Linux kernel building.md b/translated/tech/20150728 Process of the Linux kernel building.md similarity index 99% rename from sources/tech/20150728 Process of the Linux kernel building.md rename to translated/tech/20150728 Process of the Linux kernel building.md index 9ee5f795ef..b8ded80179 100644 --- a/sources/tech/20150728 Process of the Linux kernel building.md +++ b/translated/tech/20150728 Process of the Linux kernel building.md @@ -1,5 +1,3 @@ -Translating by Ezio - 如何构建Linux 内核 ================================================================================ 介绍 From 461ef3145bae861e099915bfa1e9c50a836a2850 Mon Sep 17 00:00:00 2001 From: wxy Date: Wed, 26 Aug 2015 11:55:19 +0800 Subject: [PATCH 462/507] PUB:20150817 Top 5 Torrent Clients For Ubuntu Linux MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @Xuanwo 其中有一处 indi artists, 根据我的判断,应该是指“independent artists” ,独立音乐人。根据其网站描述,应该是指以 CC 协议提供音乐的人。所以我径直调整了,如有不当,请讨论。:> --- ... Top 5 Torrent Clients For Ubuntu Linux.md | 115 +++++++++++++++++ ... Top 5 Torrent Clients For Ubuntu Linux.md | 120 ------------------ 2 files changed, 115 insertions(+), 120 deletions(-) create mode 100644 published/20150817 Top 5 Torrent Clients For Ubuntu Linux.md delete mode 100644 translated/share/20150817 Top 5 Torrent Clients For Ubuntu Linux.md diff --git a/published/20150817 Top 5 Torrent Clients For Ubuntu Linux.md b/published/20150817 Top 5 Torrent Clients For Ubuntu Linux.md new file mode 100644 index 0000000000..0ad6d04671 --- /dev/null +++ b/published/20150817 Top 5 Torrent Clients For Ubuntu Linux.md @@ -0,0 +1,115 @@ +Ubuntu 下五个最好的 BT 客户端 +================================================================================ + +![Best Torrent clients for Ubuntu Linux](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/08/5_Best_Torrent_Ubuntu.png) + +在寻找 **Ubuntu 中最好的 BT 客户端**吗?事实上,Linux 桌面平台中有许多 BT 客户端,但是它们中的哪些才是**最好的 Ubuntu 客户端**呢? + +我将会列出 Linux 上最好的五个 BT 客户端,它们都拥有着体积轻盈,功能强大的特点,而且还有令人印象深刻的用户界面。自然,易于安装和使用也是特性之一。 + +### Ubuntu 下最好的 BT 客户端 ### + +考虑到 Ubuntu 默认安装了 Transmission,所以我将会从这个列表中排除了 Transmission。但是这并不意味着 Transmission 没有资格出现在这个列表中,事实上,Transmission 是一个非常好的BT客户端,这也正是它被包括 Ubuntu 在内的多个发行版默认安装的原因。 + +### Deluge ### + +![Logo of Deluge torrent client for Ubuntu](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/08/Deluge.png) + +[Deluge][1] 被 Lifehacker 评选为 Linux 下最好的 BT 客户端,这说明了 Deluge 是多么的有用。而且,并不仅仅只有 Lifehacker 是 Deluge 的粉丝,纵观多个论坛,你都会发现不少 Deluge 的忠实拥趸。 + +快速,时尚而直观的界面使得 Deluge 成为 Linux 用户的挚爱。 + +Deluge 可在 Ubuntu 的仓库中获取,你能够在 Ubuntu 软件中心中安装它,或者使用下面的命令: + + sudo apt-get install deluge + +### qBittorrent ### + +![qBittorrent client for Linux](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/08/qbittorrent_icon.png) + +正如它的名字所暗示的,[qBittorrent][2] 是著名的 [Bittorrent][3] 应用的 Qt 版本。如果曾经使用过它,你将会看到和 Windows 下的 Bittorrent 相似的界面。同样轻巧并且有着 BT 客户端的所有标准功能, qBittorrent 也可以在 Ubuntu 的默认仓库中找到。 + +它可以通过 Ubuntu 软件仓库安装,或者使用下面的命令: + + 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] 是另一个不错的 Ubuntu 下的 BT 客户端。它有着一个默认的黑暗主题,尽管很多人喜欢,但是我例外。它拥有着一切你能在 BT 客户端中找到的功能。 + +除此之外,它还有着数据分析的额外功能。你可以在美观的图表中分析流量以及其它数据。 + +- [下载 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] 是许多 Linux 以及 Windows 用户最喜欢的 BT 客户端。除了标准的功能,你可以直接在应用程序中搜索种子,也可以订阅系列片源,这样就无需再去寻找新的片源了,因为你可以在侧边栏中的订阅看到它们。 + +它还配备了一个视频播放器,可以播放带有字幕的高清视频等等。但是我不认为你会用它来代替那些更好的视频播放器,比如 VLC。 + +Vuze 可以通过 Ubuntu 软件中心安装或者使用下列命令: + + 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] 是一个你应该试一下的应用。它不仅仅是一个简单的 BT 客户端,它还可以应用于安卓,你可以用它通过 Wifi 来共享文件。 + +你可以在应用中搜索种子并且播放他们。除了下载文件,它还可以浏览本地的影音文件,并且将它们有条理的呈现在播放器中。这同样适用于安卓版本。 + +还有一个特点是:Frostwire 提供了独立音乐人的[合法音乐下载][13]。你可以下载并且欣赏它们,免费而且合法。 + +- [下载 Frostwire][8] + + + +### 荣誉奖 ### + +在 Windows 中,uTorrent(发音:mu torrent)是我最喜欢的 BT 应用。尽管 uTorrent 可以在 Linux 下运行,但是我还是特意忽略了它。因为在 Linux 下使用 uTorrent 不仅困难,而且无法获得完整的应用体验(运行在浏览器中)。 + +可以[在这里][9]阅读 Ubuntu下uTorrent 的安装教程。 + +#### 快速提示: #### + +大多数情况下,BT 应用不会默认自动启动。如果想改变这一行为,请阅读[如何管理 Ubuntu 下的自启动程序][10]来学习。 + +### 你最喜欢的是什么? ### + +这些是我对于 Ubuntu 下最好的 BT 客户端的意见。你最喜欢的是什么呢?请发表评论。也可以查看与本主题相关的[Ubuntu 最好的下载管理器][11]。如果使用 Popcorn Time,试试 [Popcorn Time 技巧][12] + +-------------------------------------------------------------------------------- + +via: http://itsfoss.com/best-torrent-ubuntu/ + +作者:[Abhishek][a] +译者:[Xuanwo](https://github.com/Xuanwo) +校对:[wxy](https://github.com/wxy) + +本文由 [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/ +[13]:http://www.frostclick.com/wp/ + diff --git a/translated/share/20150817 Top 5 Torrent Clients For Ubuntu Linux.md b/translated/share/20150817 Top 5 Torrent Clients For Ubuntu Linux.md deleted file mode 100644 index 80c9899637..0000000000 --- a/translated/share/20150817 Top 5 Torrent Clients For Ubuntu Linux.md +++ /dev/null @@ -1,120 +0,0 @@ -Translating by Xuanwo - -介绍Ubuntu下五大BT客户端 -================================================================================ -![Best Torrent clients for Ubuntu Linux](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/08/5_Best_Torrent_Ubuntu.png) - -在寻找**Ubuntu中最好的BT客户端**吗?事实上,桌面平台中有许多可用的BT客户端,但是它们中的哪些才是**最好的**呢? - -我将会列出最好的五个BT客户端,它们都拥有着体积轻盈,功能强大的特点,而且还有令人印象深刻的用户界面。自然,易于安装和使用也是特性之一。 - -### Ubuntu下最好的BT客户端 ### - -考虑到Ubuntu默认安装了Transmission,所以我将会从这个列表中删去Transmission。但是这并不意味着Transmission没有资格出现在这个列表中,事实上,Transmission是一个非常好的BT客户端,这也正是它被多个发行版默认安装的原因,Ubuntu也不例外。 - ----------- - -### Deluge ### - -![Logo of Deluge torrent client for Ubuntu](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/08/Deluge.png) - -[Deluge][1] 被Lifehacker选为Linux下最好的BT客户端,这说明了Deluge是多么的有用。而且,并不仅仅只有Lifehacker是Deluge的粉丝,纵观多个论坛,你都会发现不少Deluge的忠实拥趸。 - -快速,时尚而且直观的界面使得Deluge成为Linux用户的挚爱。 - -Deluge可在Ubuntu的仓库中获取,你能够在Ubuntu软件中心中安装它,或者使用下面的命令: - - sudo apt-get install delugeFast, sleek and intuitive interface makes Deluge a hot favorite among Linux users. - ----------- - -### qBittorrent ### - -![qBittorrent client for Linux](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/08/qbittorrent_icon.png) - -正如它的名字所暗示的,[qBittorrent][2] 是著名的 [Bittorrent][3] 应用的Qt版本。如果曾经使用过它,你将会看到和Windows下的Bittorrent相似的界面。同样轻巧并且有着BT客户端的所有标准功能,qBittorrent也可以在Ubuntu的默认仓库中找到。 - -它可以通过Ubuntu软件仓库安装,或者使用下面的命令: - - 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] 是另一个不错的Ubuntu下的BT客户端。它有着一个默认的黑暗主题,尽管很多人喜欢,但是我例外。它拥有着一切你能在BT客户端中找到的功能。 - -除此之外,它还有着数据分析的额外功能。你可以在美观的图表中分析流量以及其它数据。 - -- [下载 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]是许多Linux以及Windows用户最喜欢的BT客户端。除了标准的功能,你可以直接在应用程序中搜索种子,也可以订阅系列片源,这样就无需再去寻找新的片源了,因为你可以在侧边栏中的订阅看到它们。 - -它还配备了一个视频播放器,可以播放带有字幕的高清视频以及一切。但是我不认为你会用它来代替那些更好的视频播放器,比如VLC。 - -Vuze可以通过Ubuntu软件中心安装或者使用下列命令: - - 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]可能会是一个你想要去尝试的应用。它不仅仅是一个简单的BT客户端,它还可以应用于安卓,你可以用它通过Wifi来共享文件。 - -你可以在应用中搜索种子并且播放他们。除了下载文件,它还可以浏览本地的影音文件,并且将它们有条理的呈现在播放器中。这同样适用于安卓版本。 - -还有一个特点是:Frostwire提供了印度艺术家的合法音乐下载。你可以下载并且欣赏它们,免费而且合法。 - -- [下载 Frostwire][8] - ----------- - -### 荣誉奖 ### - -在Windows中,uTorrent(发音:mu torrent)是我最喜欢的BT应用。尽管uTorrent可以在Linux下运行,但是我还是特意忽略了它。因为在Linux下使用uTorrent不仅困难,而且无法获得完整的应用体验(运行在浏览器中)。 - -可以[在这里][9]阅读Ubuntu下uTorrent的安装教程。 - -#### 快速提示: #### - -大多数情况下,BT应用不会默认自动自动启动。如果想改变这一行为,请阅读[如何管理Ubuntu下的自启程序][10]来学习。 - -### 你最喜欢的是什么? ### - -这些是我对于Ubuntu下最好的BT客户端的意见。你最喜欢的是什么呢?请发表评论。也可以查看与本主题相关的[Ubuntu最好的下载管理器][11]。如果使用Popcorn Time,试试[Popcorn Time技巧][12] - --------------------------------------------------------------------------------- - -via: http://itsfoss.com/best-torrent-ubuntu/ - -作者:[Abhishek][a] -译者:[Xuanwo](https://github.com/Xuanwo) -校对:[校对者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/ - From 09c53626e630571fc79671978a3f52e7039d0cb7 Mon Sep 17 00:00:00 2001 From: DeadFire Date: Wed, 26 Aug 2015 15:41:08 +0800 Subject: [PATCH 463/507] =?UTF-8?q?20150826-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...Is Out And It's Packed Full Of Features.md | 87 +++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 sources/news/20150826 Plasma 5.4 Is Out And It's Packed Full Of Features.md diff --git a/sources/news/20150826 Plasma 5.4 Is Out And It's Packed Full Of Features.md b/sources/news/20150826 Plasma 5.4 Is Out And It's Packed Full Of Features.md new file mode 100644 index 0000000000..a103c6b505 --- /dev/null +++ b/sources/news/20150826 Plasma 5.4 Is Out And It's Packed Full Of Features.md @@ -0,0 +1,87 @@ +Plasma 5.4 Is Out And It’s Packed Full Of Features +================================================================================ +KDE has [announced][1] a brand new feature release of Plasma 5 — and it’s a corker. + +![kde network applet graphs](http://www.omgubuntu.co.uk/wp-content/uploads/2015/08/kde-network-applet-graphs.jpg) + +Better network details are among the changes + +Plasma 5.4.0 builds on [April’s 5.3.0 milestone][2] in a number of ways, ranging from the inherently technical, Wayland preview session, ahoy, to lavish aesthetic touches, like **1,400 brand new icons**. + +A handful of new components also feature in the release, including a new Plasma Widget for volume control, a monitor calibration tool and an improved user management tool. + +The ‘Kicker’ application menu has been powered up to let you favourite all types of content, not just applications. + +**KRunner now remembers searches** so that it can automatically offer suggestions based on your earlier queries as you type. + +The **network applet displays a graph** to give you a better understanding of your network traffic. It also gains two new VPN plugins for SSH and SSTP connections. + +Minor tweaks to the digital clock see it adapt better in slim panel mode, it gains ISO date support and makes it easier for you to toggle between 12 hour and 24 hour clock. Week numbers have been added to the calendar. + +### Application Dashboard ### + +![plasma 5.4 fullscreen dashboard](http://www.omgubuntu.co.uk/wp-content/uploads/2015/08/plasma-fullscreen-dashboard.jpg) + +The new ‘Application Dashboard’ in KDE Plasma 5.4.0 + +**A new full screen launcher, called ‘Application Dashboard’**, is also available. + +This full-screen dash offers the same features as the traditional Application Menu but with “sophisticated scaling to screen size and full spatial keyboard navigation”. + +Like the Unity launch, the new Plasma Application Dashboard helps you quickly find applications, sift through files and contacts based on your previous activity. + +### Changes in KDE Plasma 5.4.0 at a glance ### + +- Improved high DPI support +- KRunner autocompletion +- KRunner search history +- Application Dashboard add on +- 1,400 New icons +- Wayland tech preview + +For a full list of changes in Plasma 5.4 refer to [this changelog][3]. + +### Install Plasma 5.4 in Kubuntu 15.04 ### + +![new plasma desktop](http://www.omgubuntu.co.uk/wp-content/uploads/2015/08/new-plasma-desktop-.jpg) + +![Kubuntu logo](http://www.omgubuntu.co.uk/wp-content/uploads/2012/02/logo-kubuntu.png) + +To **install Plasma 5.4 in Kubuntu 15.04** you will need to add the KDE Backports PPA to your Software Sources. + +Adding the Kubuntu backports PPA **is not strictly advised** as it may upgrade other parts of the KDE desktop, application suite, developer frameworks or Kubuntu specific config files. + +If you like your desktop being stable, don’t proceed. + +The quickest way to upgrade to Plasma 5.4 once it lands in the Kubuntu Backports PPA is to use the Terminal: + + sudo add-apt-repository ppa:kubuntu-ppa/backports + + sudo apt-get update && sudo apt-get dist-upgrade + +Let the upgrade process complete. Assuming no errors emerge, reboot your computer for changes to take effect. + +If you’re not already using Kubuntu, i.e. you’re using the Unity version of Ubuntu, you should first install the Kubuntu desktop package (you’ll find it in the Ubuntu Software Centre). + +To undo the changes above and downgrade to the most recent version of Plasma available in the Ubuntu archives 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/08/plasma-5-4-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://dot.kde.org/2015/08/25/kde-ships-plasma-540-feature-release-august +[2]:http://www.omgubuntu.co.uk/2015/04/kde-plasma-5-3-released-heres-how-to-upgrade-in-kubuntu-15-04 +[3]:https://www.kde.org/announcements/plasma-5.3.2-5.4.0-changelog.php \ No newline at end of file From 14fba98900ff292c4029455f6e7d5fe14f6023de Mon Sep 17 00:00:00 2001 From: DeadFire Date: Wed, 26 Aug 2015 15:59:39 +0800 Subject: [PATCH 464/507] =?UTF-8?q?20150826-2=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...stem status page of your infrastructure.md | 294 ++++++++++++++++++ 1 file changed, 294 insertions(+) create mode 100644 sources/tech/20150826 How to set up a system status page of your infrastructure.md diff --git a/sources/tech/20150826 How to set up a system status page of your infrastructure.md b/sources/tech/20150826 How to set up a system status page of your infrastructure.md new file mode 100644 index 0000000000..44fb4ed8d5 --- /dev/null +++ b/sources/tech/20150826 How to set up a system status page of your infrastructure.md @@ -0,0 +1,294 @@ +How to set up a system status page of your infrastructure +================================================================================ +If you are a system administrator who is responsible for critical IT infrastructure or services of your organization, you will understand the importance of effective communication in your day-to-day tasks. Suppose your production storage server is on fire. You want your entire team on the same page in order to resolve the issue as fast as you can. While you are at it, you don't want half of all users contacting you asking why they cannot access their documents. When a scheduled maintenance is coming up, you want to notify interested parties of the event ahead of the schedule, so that unnecessary support tickets can be avoided. + +All these require some sort of streamlined communication channel between you, your team and people you serve. One way to achieve that is to maintain a centralized system status page, where the detail of downtime incidents, progress updates and maintenance schedules are reported and chronicled. That way, you can minimize unnecessary distractions during downtime, and also have any interested party informed and opt-in for any status update. + +One good **open-source, self-hosted system status page solution** is [Cachet][1]. In this tutorial, I am going to describe how to set up a self-hosted system status page using Cachet. + +### Cachet Features ### + +Before going into the detail of setting up Cachet, let me briefly introduce its main features. + +- **Full JSON API**: The Cachet API allows you to connect any external program or script (e.g., uptime script) to Cachet to report incidents or update status automatically. +- **Authentication**: Cachet supports Basic Auth and API token in JSON API, so that only authorized personnel can update the status page. +- **Metrics system**: This is useful to visualize custom data over time (e.g., server load or response time). +- **Notification**: Optionally you can send notification emails about reported incidents to anyone who signed up to the status page. +- **Multiple languages**: The status page can be translated into 11 different languages. +- **Two factor authentication**: This allows you to lock your Cachet admin account with Google's two-factor authentication. +- **Cross database support**: You can choose between MySQL, SQLite, Redis, APC, and PostgreSQL for a backend storage. + +In the rest of the tutorial, I explain how to install and configure Cachet on Linux. + +### Step One: Download and Install Cachet ### + +Cachet requires a web server and a backend database to operate. In this tutorial, I am going to use the LAMP stack. Here are distro-specific instructions to install Cachet and LAMP stack. + +#### Debian, Ubuntu or Linux Mint #### + + $ sudo apt-get install curl git apache2 mysql-server mysql-client php5 php5-mysql + $ sudo git clone https://github.com/cachethq/Cachet.git /var/www/cachet + $ cd /var/www/cachet + $ sudo git checkout v1.1.1 + $ sudo chown -R www-data:www-data . + +For more detail on setting up LAMP stack on Debian-based systems, refer to [this tutorial][2]. + +#### Fedora, CentOS or RHEL #### + +On Red Hat based systems, you first need to [enable REMI repository][3] (to meet PHP version requirement). Then proceed as follows. + + $ sudo yum install curl git httpd mariadb-server + $ sudo yum --enablerepo=remi-php56 install php php-mysql php-mbstring + $ sudo git clone https://github.com/cachethq/Cachet.git /var/www/cachet + $ cd /var/www/cachet + $ sudo git checkout v1.1.1 + $ sudo chown -R apache:apache . + $ sudo firewall-cmd --permanent --zone=public --add-service=http + $ sudo firewall-cmd --reload + $ sudo systemctl enable httpd.service; sudo systemctl start httpd.service + $ sudo systemctl enable mariadb.service; sudo systemctl start mariadb.service + +For more details on setting up LAMP on Red Hat-based systems, refer to [this tutorial][4]. + +### Configure a Backend Database for Cachet ### + +The next step is to configure database backend. + +Log in to MySQL/MariaDB server, and create an empty database called 'cachet'. + + $ sudo mysql -uroot -p + +---------- + + mysql> create database cachet; + mysql> quit + +Now create a Cachet configuration file by using a sample configuration file. + + $ cd /var/www/cachet + $ sudo mv .env.example .env + +In .env file, fill in database information (i.e., DB_*) according to your setup. Leave other fields unchanged for now. + + APP_ENV=production + APP_DEBUG=false + APP_URL=http://localhost + APP_KEY=SomeRandomString + + DB_DRIVER=mysql + DB_HOST=localhost + DB_DATABASE=cachet + DB_USERNAME=root + DB_PASSWORD= + + CACHE_DRIVER=apc + SESSION_DRIVER=apc + QUEUE_DRIVER=database + + MAIL_DRIVER=smtp + MAIL_HOST=mailtrap.io + MAIL_PORT=2525 + MAIL_USERNAME=null + MAIL_PASSWORD=null + MAIL_ADDRESS=null + MAIL_NAME=null + + REDIS_HOST=null + REDIS_DATABASE=null + REDIS_PORT=null + +### Step Three: Install PHP Dependencies and Perform DB Migration ### + +Next, we are going to install necessary PHP dependencies. For that we will use composer. If you do not have composer installed on your system, install it first: + + $ curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer + +Now go ahead and install PHP dependencies using composer. + + $ cd /var/www/cachet + $ sudo composer install --no-dev -o + +Next, perform one-time database migration. This step will populate the empty database we created earlier with necessary tables. + + $ sudo php artisan migrate + +Assuming the database config in /var/www/cachet/.env is correct, database migration should be completed successfully as shown below. + +![](https://farm6.staticflickr.com/5814/20235620184_54048676b0_c.jpg) + +Next, create a security key, which will be used to encrypt the data entered in Cachet. + + $ sudo php artisan key:generate + $ sudo php artisan config:cache + +![](https://farm6.staticflickr.com/5717/20831952096_7105c9fdc7_c.jpg) + +The generated app key will be automatically added to the APP_KEY variable of your .env file. No need to edit .env on your own here. + +### Step Four: Configure Apache HTTP Server ### + +Now it's time to configure the web server that Cachet will be running on. As we are using Apache HTTP server, create a new [virtual host][5] for Cachet as follows. + +#### Debian, Ubuntu or Linux Mint #### + + $ sudo vi /etc/apache2/sites-available/cachet.conf + +---------- + + + ServerName cachethost + ServerAlias cachethost + DocumentRoot "/var/www/cachet/public" + + Require all granted + Options Indexes FollowSymLinks + AllowOverride All + Order allow,deny + Allow from all + + + +Enable the new Virtual Host and mod_rewrite with: + + $ sudo a2ensite cachet.conf + $ sudo a2enmod rewrite + $ sudo service apache2 restart + +#### Fedora, CentOS or RHEL #### + +On Red Hat based systems, create a virtual host file as follows. + + $ sudo vi /etc/httpd/conf.d/cachet.conf + +---------- + + + ServerName cachethost + ServerAlias cachethost + DocumentRoot "/var/www/cachet/public" + + Require all granted + Options Indexes FollowSymLinks + AllowOverride All + Order allow,deny + Allow from all + + + +Now reload Apache configuration: + + $ sudo systemctl reload httpd.service + +### Step Five: Configure /etc/hosts for Testing Cachet ### + +At this point, the initial Cachet status page should be up and running, and now it's time to test. + +Since Cachet is configured as a virtual host of Apache HTTP server, we need to tweak /etc/hosts of your client computer to be able to access it. Here the client computer is the one from which you will be accessing the Cachet page. + +Open /etc/hosts, and add the following entry. + + $ sudo vi /etc/hosts + +---------- + + cachethost + +In the above, the name "cachethost" must match with ServerName specified in the Apache virtual host file for Cachet. + +### Test Cachet Status Page ### + +Now you are ready to access Cachet status page. Type http://cachethost in your browser address bar. You will be redirected to the initial Cachet setup page as follows. + +![](https://farm6.staticflickr.com/5745/20858228815_405fce1301_c.jpg) + +Choose cache/session driver. Here let's choose "File" for both cache and session drivers. + +Next, type basic information about the status page (e.g., site name, domain, timezone and language), as well as administrator account. + +![](https://farm1.staticflickr.com/611/20237229693_c22014e4fd_c.jpg) + +![](https://farm6.staticflickr.com/5707/20858228875_b056c9e1b4_c.jpg) + +![](https://farm6.staticflickr.com/5653/20671482009_8629572886_c.jpg) + +Your initial status page will finally be ready. + +![](https://farm6.staticflickr.com/5692/20237229793_f6a48f379a_c.jpg) + +Go ahead and create components (units of your system), incidents or any scheduled maintenance as you want. + +For example, to add a new component: + +![](https://farm6.staticflickr.com/5672/20848624752_9d2e0a07be_c.jpg) + +To add a scheduled maintenance: + +This is what the public Cachet status page looks like: + +![](https://farm1.staticflickr.com/577/20848624842_df68c0026d_c.jpg) + +With SMTP integration, you can send out emails on status updates to any subscribers. Also, you can fully customize the layout and style of the status page using CSS and markdown formatting. + +### Conclusion ### + +Cachet is pretty easy-to-use, self-hosted status page software. One of the nicest features of Cachet is its support for full JSON API. Using its RESTful API, one can easily hook up Cachet with separate monitoring backends (e.g., [Nagios][6]), and feed Cachet with incident reports and status updates automatically. This is far quicker and efficient than manually manage a status page. + +As final words, I'd like to mention one thing. While setting up a fancy status page with Cachet is straightforward, making the best use of the software is not as easy as installing it. You need total commitment from the IT team on updating the status page in an accurate and timely manner, thereby building credibility of the published information. At the same time, you need to educate users to turn to the status page. At the end of the day, it would be pointless to set up a status page if it's not populated well, and/or no one is checking it. Remember this when you consider deploying Cachet in your work environment. + +### Troubleshooting ### + +As a bonus, here are some useful troubleshooting tips in case you encounter problems while setting up Cachet. + +1. The Cachet page does not load anything, and you are getting the following error. + + production.ERROR: exception 'RuntimeException' with message 'No supported encrypter found. The cipher and / or key length are invalid.' in /var/www/cachet/bootstrap/cache/compiled.php:6695 + +**Solution**: Make sure that you create an app key, as well as clear configuration cache as follows. + + $ cd /path/to/cachet + $ sudo php artisan key:generate + $ sudo php artisan config:cache + +2. You are getting the following error while invoking composer command. + + - danielstjules/stringy 1.10.0 requires ext-mbstring * -the requested PHP extension mbstring is missing from your system. + - laravel/framework v5.1.8 requires ext-mbstring * -the requested PHP extension mbstring is missing from your system. + - league/commonmark 0.10.0 requires ext-mbstring * -the requested PHP extension mbstring is missing from your system. + +**Solution**: Make sure to install the required PHP extension mbstring on your system which is compatible with your PHP. On Red Hat based system, since we installed PHP from REMI-56 repository, we install the extension from the same repository. + + $ sudo yum --enablerepo=remi-php56 install php-mbstring + +3. You are getting a blank page while trying to access Cachet status page. The HTTP log shows the following error. + + PHP Fatal error: Uncaught exception 'UnexpectedValueException' with message 'The stream or file "/var/www/cachet/storage/logs/laravel-2015-08-21.log" could not be opened: failed to open stream: Permission denied' in /var/www/cachet/bootstrap/cache/compiled.php:12851 + +**Solution**: Try the following commands. + + $ cd /var/www/cachet + $ sudo php artisan cache:clear + $ sudo chmod -R 777 storage + $ sudo composer dump-autoload + +If the above solution does not work, try disabling SELinux: + + $ sudo setenforce 0 + +-------------------------------------------------------------------------------- + +via: http://xmodulo.com/setup-system-status-page.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]:https://cachethq.io/ +[2]:http://xmodulo.com/install-lamp-stack-ubuntu-server.html +[3]:http://ask.xmodulo.com/install-remi-repository-centos-rhel.html +[4]:http://xmodulo.com/install-lamp-stack-centos.html +[5]:http://xmodulo.com/configure-virtual-hosts-apache-http-server.html +[6]:http://xmodulo.com/monitor-common-services-nagios.html \ No newline at end of file From 52b47060e88e3bc423bdc82b15c0af5531076e79 Mon Sep 17 00:00:00 2001 From: DeadFire Date: Wed, 26 Aug 2015 16:12:45 +0800 Subject: [PATCH 465/507] =?UTF-8?q?20150826-3=20RHCE=20=E7=AC=AC=E4=BA=94?= =?UTF-8?q?=E7=AF=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ate and Import Into Database) in RHEL 7.md | 165 ++++++++++++++++++ 1 file changed, 165 insertions(+) create mode 100644 sources/tech/RHCE/Part 5 - How to Manage System Logs (Configure, Rotate and Import Into Database) in RHEL 7.md diff --git a/sources/tech/RHCE/Part 5 - How to Manage System Logs (Configure, Rotate and Import Into Database) in RHEL 7.md b/sources/tech/RHCE/Part 5 - How to Manage System Logs (Configure, Rotate and Import Into Database) in RHEL 7.md new file mode 100644 index 0000000000..217116cfee --- /dev/null +++ b/sources/tech/RHCE/Part 5 - How to Manage System Logs (Configure, Rotate and Import Into Database) in RHEL 7.md @@ -0,0 +1,165 @@ +Part 5 - How to Manage System Logs (Configure, Rotate and Import Into Database) in RHEL 7 +================================================================================ +In order to keep your RHEL 7 systems secure, you need to know how to monitor all of the activities that take place on such systems by examining log files. Thus, you will be able to detect any unusual or potentially malicious activity and perform system troubleshooting or take another appropriate action. + +![Linux Rotate Log Files Using Rsyslog and Logrotate](http://www.tecmint.com/wp-content/uploads/2015/08/Manage-and-Rotate-Linux-Logs-Using-Rsyslog-Logrotate.jpg) + +RHCE Exam: Manage System LogsUsing Rsyslogd and Logrotate – Part 5 + +In RHEL 7, the [rsyslogd][1] daemon is responsible for system logging and reads its configuration from /etc/rsyslog.conf (this file specifies the default location for all system logs) and from files inside /etc/rsyslog.d, if any. + +### Rsyslogd Configuration ### + +A quick inspection of the [rsyslog.conf][2] will be helpful to start. This file is divided into 3 main sections: Modules (since rsyslog follows a modular design), Global directives (used to set global properties of the rsyslogd daemon), and Rules. As you will probably guess, this last section indicates what gets logged or shown (also known as the selector) and where, and will be our focus throughout this article. + +A typical line in rsyslog.conf is as follows: + +![Rsyslogd Configuration](http://www.tecmint.com/wp-content/uploads/2015/08/Rsyslogd-Configuration.png) + +Rsyslogd Configuration + +In the image above, we can see that a selector consists of one or more pairs Facility:Priority separated by semicolons, where Facility describes the type of message (refer to [section 4.1.1 in RFC 3164][3] to see the complete list of facilities available for rsyslog) and Priority indicates its severity, which can be one of the following self-explanatory words: + +- debug +- info +- notice +- warning +- err +- crit +- alert +- emerg + +Though not a priority itself, the keyword none means no priority at all of the given facility. + +**Note**: That a given priority indicates that all messages of such priority and above should be logged. Thus, the line in the example above instructs the rsyslogd daemon to log all messages of priority info or higher (regardless of the facility) except those belonging to mail, authpriv, and cron services (no messages coming from this facilities will be taken into account) to /var/log/messages. + +You can also group multiple facilities using the colon sign to apply the same priority to all of them. Thus, the line: + + *.info;mail.none;authpriv.none;cron.none /var/log/messages + +Could be rewritten as + + *.info;mail,authpriv,cron.none /var/log/messages + +In other words, the facilities mail, authpriv, and cron are grouped and the keyword none is applied to the three of them. + +#### Creating a custom log file #### + +To log all daemon messages to /var/log/tecmint.log, we need to add the following line either in rsyslog.conf or in a separate file (easier to manage) inside /etc/rsyslog.d: + + daemon.* /var/log/tecmint.log + +Let’s restart the daemon (note that the service name does not end with a d): + + # systemctl restart rsyslog + +And check the contents of our custom log before and after restarting two random daemons: + +![Linux Create Custom Log File](http://www.tecmint.com/wp-content/uploads/2015/08/Create-Custom-Log-File.png) + +Create Custom Log File + +As a self-study exercise, I would recommend you play around with the facilities and priorities and either log additional messages to existing log files or create new ones as in the previous example. + +### Rotating Logs using Logrotate ### + +To prevent log files from growing endlessly, the logrotate utility is used to rotate, compress, remove, and alternatively mail logs, thus easing the administration of systems that generate large numbers of log files. + +Logrotate runs daily as a cron job (/etc/cron.daily/logrotate) and reads its configuration from /etc/logrotate.conf and from files located in /etc/logrotate.d, if any. + +As with the case of rsyslog, even when you can include settings for specific services in the main file, creating separate configuration files for each one will help organize your settings better. + +Let’s take a look at a typical logrotate.conf: + +![Logrotate Configuration](http://www.tecmint.com/wp-content/uploads/2015/08/Logrotate-Configuration.png) + +Logrotate Configuration + +In the example above, logrotate will perform the following actions for /var/loh/wtmp: attempt to rotate only once a month, but only if the file is at least 1 MB in size, then create a brand new log file with permissions set to 0664 and ownership given to user root and group utmp. Next, only keep one archived log, as specified by the rotate directive: + +![Logrotate Logs Monthly](http://www.tecmint.com/wp-content/uploads/2015/08/Logrotate-Logs-Monthly.png) + +Logrotate Logs Monthly + +Let’s now consider another example as found in /etc/logrotate.d/httpd: + +![Rotate Apache Log Files](http://www.tecmint.com/wp-content/uploads/2015/08/Rotate-Apache-Log-Files.png) + +Rotate Apache Log Files + +You can read more about the settings for logrotate in its man pages ([man logrotate][4] and [man logrotate.conf][5]). Both files are provided along with this article in PDF format for your reading convenience. + +As a system engineer, it will be pretty much up to you to decide for how long logs will be stored and in what format, depending on whether you have /var in a separate partition / logical volume. Otherwise, you really want to consider removing old logs to save storage space. On the other hand, you may be forced to keep several logs for future security auditing according to your company’s or client’s internal policies. + +#### Saving Logs to a Database #### + +Of course examining logs (even with the help of tools such as grep and regular expressions) can become a rather tedious task. For that reason, rsyslog allows us to export them into a database (OTB supported RDBMS include MySQL, MariaDB, PostgreSQL, and Oracle. + +This section of the tutorial assumes that you have already installed the MariaDB server and client in the same RHEL 7 box where the logs are being managed: + + # yum update && yum install mariadb mariadb-server mariadb-client rsyslog-mysql + # systemctl enable mariadb && systemctl start mariadb + +Then use the `mysql_secure_installation` utility to set the password for the root user and other security considerations: + +![Secure MySQL Database](http://www.tecmint.com/wp-content/uploads/2015/08/Secure-MySQL-Database.png) + +Secure MySQL Database + +Note: If you don’t want to use the MariaDB root user to insert log messages to the database, you can configure another user account to do so. Explaining how to do that is out of the scope of this tutorial but is explained in detail in [MariaDB knowledge][6] base. In this tutorial we will use the root account for simplicity. + +Next, download the createDB.sql script from [GitHub][7] and import it into your database server: + + # mysql -u root -p < createDB.sql + +![Save Server Logs to Database](http://www.tecmint.com/wp-content/uploads/2015/08/Save-Server-Logs-to-Database.png) + +Save Server Logs to Database + +Finally, add the following lines to /etc/rsyslog.conf: + + $ModLoad ommysql + $ActionOmmysqlServerPort 3306 + *.* :ommysql:localhost,Syslog,root,YourPasswordHere + +Restart rsyslog and the database server: + + # systemctl restart rsyslog + # systemctl restart mariadb + +#### Querying the Logs using SQL syntax #### + +Now perform some tasks that will modify the logs (like stopping and starting services, for example), then log to your DB server and use standard SQL commands to display and search in the logs: + + USE Syslog; + SELECT ReceivedAt, Message FROM SystemEvents; + +![Query Logs in Database](http://www.tecmint.com/wp-content/uploads/2015/08/Query-Logs-in-Database.png) + +Query Logs in Database + +### Summary ### + +In this article we have explained how to set up system logging, how to rotate logs, and how to redirect the messages to a database for easier search. We hope that these skills will be helpful as you prepare for the [RHCE exam][8] and in your daily responsibilities as well. + +As always, your feedback is more than welcome. Feel free to use the form below to reach us. + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/manage-linux-system-logs-using-rsyslogd-and-logrotate/ + +作者:[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/wp-content/pdf/rsyslogd.pdf +[2]:http://www.tecmint.com/wp-content/pdf/rsyslog.conf.pdf +[3]:https://tools.ietf.org/html/rfc3164#section-4.1.1 +[4]:http://www.tecmint.com/wp-content/pdf/logrotate.pdf +[5]:http://www.tecmint.com/wp-content/pdf/logrotate.conf.pdf +[6]:https://mariadb.com/kb/en/mariadb/create-user/ +[7]:https://github.com/sematext/rsyslog/blob/master/plugins/ommysql/createDB.sql +[8]:http://www.tecmint.com/how-to-setup-and-configure-static-network-routing-in-rhel/ \ No newline at end of file From 8c775ab3d9ad4a223a37da1785f7b1ff00412dc4 Mon Sep 17 00:00:00 2001 From: DeadFire Date: Wed, 26 Aug 2015 16:24:27 +0800 Subject: [PATCH 466/507] =?UTF-8?q?20150826-4=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...Connecting Remote Unix or Linux Systems.md | 110 ++++++++++++++++++ 1 file changed, 110 insertions(+) create mode 100644 sources/share/20150826 Mosh Shell--A SSH Based Client for Connecting Remote Unix or Linux Systems.md diff --git a/sources/share/20150826 Mosh Shell--A SSH Based Client for Connecting Remote Unix or Linux Systems.md b/sources/share/20150826 Mosh Shell--A SSH Based Client for Connecting Remote Unix or Linux Systems.md new file mode 100644 index 0000000000..f36e1b21df --- /dev/null +++ b/sources/share/20150826 Mosh Shell--A SSH Based Client for Connecting Remote Unix or Linux Systems.md @@ -0,0 +1,110 @@ +Mosh Shell – A SSH Based Client for Connecting Remote Unix/Linux Systems +================================================================================ +Mosh, which stands for Mobile Shell is a command-line application which is used for connecting to the server from a client computer, over the Internet. It can be used as SSH and contains more feature than Secure Shell. It is an application similar to SSH, but with additional features. The application is written originally by Keith Winstein for Unix like operating system and released under GNU GPL v3. + +![Mosh Shell SSH Client](http://www.tecmint.com/wp-content/uploads/2015/08/Mosh-Shell-SSH-Client.png) + +Mosh Shell SSH Client + +#### Features of Mosh #### + +- It is a remote terminal application that supports roaming. +- Available for all major UNIX-like OS viz., Linux, FreeBSD, Solaris, Mac OS X and Android. +- Intermittent Connectivity supported. +- Provides intelligent local echo. +- Line editing of user keystrokes supported. +- Responsive design and Robust Nature over wifi, cellular and long-distance links. +- Remain Connected even when IP changes. It usages UDP in place of TCP (used by SSH). TCP time out when connect is reset or new IP assigned but UDP keeps the connection open. +- The Connection remains intact when you resume the session after a long time. +- No network lag. Shows users typed key and deletions immediately without network lag. +- Same old method to login as it was in SSH. +- Mechanism to handle packet loss. + +### Installation of Mosh Shell in Linux ### + +On Debian, Ubuntu and Mint alike systems, you can easily install the Mosh package with the help of [apt-get package manager][1] as shown. + + # apt-get update + # apt-get install mosh + +On RHEL/CentOS/Fedora based distributions, you need to turn on third party repository called [EPEL][2], in order to install mosh from this repository using [yum package manager][3] as shown. + + # yum update + # yum install mosh + +On Fedora 22+ version, you need to use [dnf package manager][4] to install mosh as shown. + + # dnf install mosh + +### How do I use Mosh Shell? ### + +1. Let’s try to login into remote Linux server using mosh shell. + + $ mosh root@192.168.0.150 + +![Mosh Shell Remote Connection](http://www.tecmint.com/wp-content/uploads/2015/08/Mosh-Shell-Remote-Connection.png) + +Mosh Shell Remote Connection + +**Note**: Did you see I got an error in connecting since the port was not open in my remote CentOS 7 box. A quick but not recommended solution I performed was: + + # systemctl stop firewalld [on Remote Server] + +The preferred way is to open a port and update firewall rules. And then connect to mosh on a predefined port. For in-depth details on firewalld you may like to visit this post. + +- [How to Configure Firewalld][5] + +2. Let’s assume that the default SSH port 22 was changed to port 70, in this case you can define custom port with the help of ‘-p‘ switch with mosh. + + $ mosh -p 70 root@192.168.0.150 + +3. Check the version of installed Mosh. + + $ mosh --version + +![Check Mosh Version](http://www.tecmint.com/wp-content/uploads/2015/08/Check-Mosh-Version.png) + +Check Mosh Version + +4. You can close mosh session type ‘exit‘ on the prompt. + + $ exit + +5. Mosh supports a lot of options, which you may see as: + + $ mosh --help + +![Mosh Shell Options](http://www.tecmint.com/wp-content/uploads/2015/08/Mosh-Shell-Options.png) + +Mosh Shell Options + +#### Cons of Mosh Shell #### + +- Mosh requires additional prerequisite for example, allow direct connection via UDP, which was not required by SSH. +- Dynamic port allocation in the range of 60000-61000. The first open fort is allocated. It requires one port per connection. +- Default port allocation is a serious security concern, especially in production. +- IPv6 connections supported, but roaming on IPv6 not supported. +- Scrollback not supported. +- No X11 forwarding supported. +- No support for ssh-agent forwarding. + +### Conclusion ### + +Mosh is a nice small utility which is available for download in the repository of most of the Linux Distributions. Though it has a few discrepancies specially security concern and additional requirement it’s features like remaining connected even while roaming is its plus point. My recommendation is Every Linux-er who deals with SSH should try this application and mind it, Mosh is worth a try. + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/install-mosh-shell-ssh-client-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/useful-basic-commands-of-apt-get-and-apt-cache-for-package-management/ +[2]:http://www.tecmint.com/how-to-enable-epel-repository-for-rhel-centos-6-5/ +[3]:http://www.tecmint.com/20-linux-yum-yellowdog-updater-modified-commands-for-package-mangement/ +[4]:http://www.tecmint.com/dnf-commands-for-fedora-rpm-package-management/ +[5]:http://www.tecmint.com/configure-firewalld-in-centos-7/ \ No newline at end of file From 455f69011e3d39c5668f35173c529842fa77872a Mon Sep 17 00:00:00 2001 From: DeadFire Date: Wed, 26 Aug 2015 17:01:18 +0800 Subject: [PATCH 467/507] =?UTF-8?q?20150826-5=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...50826 Five Super Cool Open Source Games.md | 65 ++++++++++++++++ ... Run Kali Linux 2.0 In Docker Container.md | 74 +++++++++++++++++++ 2 files changed, 139 insertions(+) create mode 100644 sources/share/20150826 Five Super Cool Open Source Games.md create mode 100644 sources/tech/20150826 How to Run Kali Linux 2.0 In Docker Container.md diff --git a/sources/share/20150826 Five Super Cool Open Source Games.md b/sources/share/20150826 Five Super Cool Open Source Games.md new file mode 100644 index 0000000000..0b92dcedff --- /dev/null +++ b/sources/share/20150826 Five Super Cool Open Source Games.md @@ -0,0 +1,65 @@ +Five Super Cool Open Source Games +================================================================================ +In 2014 and 2015, Linux became home to a list of popular commercial titles such as the popular Borderlands, Witcher, Dead Island, and Counter Strike series of games. While this is exciting news, what of the gamer on a budget? Commercial titles are good, but even better are free-to-play alternatives made by developers who know what players like. + +Some time ago, I came across a three year old YouTube video with the ever optimistic title [5 Open Source Games that Don’t Suck][1]. Although the video praises some open source games, I’d prefer to approach the subject with a bit more enthusiasm, at least as far as the title goes. So, here’s my list of five super cool open source games. + +### Tux Racer ### + +![Tux Racer](http://fossforce.com/wp-content/uploads/2015/08/tuxracer-550x413.jpg) + +Tux Racer + +[Tux Racer][2] is the first game on this list because I’ve had plenty of experience with it. On a [recent trip to Mexico][3] that my brother and I took with [Kids on Computers][4], Tux Racer was one of the games that kids and teachers alike enjoyed. In this game, players use the Linux mascot, the penguin Tux, to race on downhill ski slopes in time trials in which players challenge their own personal bests. Currently there’s no multiplayer version available, but that could be subject to change. Available for Linux, OS X, Windows, and Android. + +### Warsow ### + +![Warsow](http://fossforce.com/wp-content/uploads/2015/08/warsow-550x413.jpg) + +Warsow + +The [Warsow][5] website explains: “Set in a futuristic cartoonish world, Warsow is a completely free fast-paced first-person shooter (FPS) for Windows, Linux and Mac OS X. Warsow is the Art of Respect and Sportsmanship Over the Web.” I was reluctant to include games from the FPS genre on this list, because many have played games in this genre, but I was amused by Warsow. It prioritizes lots of movement and the game is fast paced with a set of eight weapons to start with. The cartoonish style makes playing feel less serious and more casual, something for friends and family to play together. However, it boasts competitive play, and when I experienced the game I found there were, indeed, some expert players around. Available for Linux, Windows and OS X. + +### M.A.R.S – A ridiculous shooter ### + +![M.A.R.S. - A ridiculous shooter](http://fossforce.com/wp-content/uploads/2015/08/MARS-screenshot-550x344.jpg) + +M.A.R.S. – A ridiculous shooter + +[M.A.R.S – A ridiculous shooter][6] is appealing because of it’s vibrant coloring and style. There is support for two players on the same keyboard, but an online multiplayer version is currently in the works — meaning plans to play with friends have to wait for now. Regardless, it’s an entertaining space shooter with a few different ships and weapons to play as. There are different shaped ships, ranging from shotguns, lasers, scattered shots and more (one of the random ships shot bubbles at my opponents, which was funny amid the chaotic gameplay). There are a few modes of play, such as the standard death match against opponents to score a certain limit or score high, along with other modes called Spaceball, Grave-itation Pit and Cannon Keep. Available for Linux, Windows and OS X. + +### Valyria Tear ### + +![Valyria Tear](http://fossforce.com/wp-content/uploads/2015/08/bronnan-jump-to-enemy-550x413.jpg) + +Valyria Tear + +[Valyria Tear][7] resembles many fan favorite role-playing games (RPGs) spanning the years. The story is set in the usual era of fantasy games, full of knights, kingdoms and wizardry, and follows the main character Bronann. The design team did great work in designing the world and gives players everything expected from the genre: hidden chests, random monster encounters, non-player character (NPC) interaction, and something no RPG would be complete without: grinding for experience on lower level slime monsters until you’re ready for the big bosses. When I gave it a try, time didn’t permit me to play too far into the campaign, but for those interested there is a ‘[Let’s Play][8]‘ series by YouTube user Yohann Ferriera. Available for Linux, Windows and OS X. + +### SuperTuxKart ### + +![SuperTuxKart](http://fossforce.com/wp-content/uploads/2015/08/hacienda_tux_antarctica-550x293.jpg) + +SuperTuxKart + +Last but not least is [SuperTuxKart][9], a clone of Mario Kart that is every bit as fun as the original. It started development around 2000-2004 as Tux Kart, but there were errors in its production which led to a cease in development for a few years. Since development picked up again in 2006, it’s been improving, with version 0.9 debuting four months ago. In the game, our old friend Tux starts in the role of Mario and a few other open source mascots. One recognizable face among them is Suzanne, the monkey mascot for Blender. The graphics are solid and gameplay is fluent. While online play is in the planning stages, split screen multiplayer action is available, with up to four players supported on a single computer. Available for Linux, Windows, OS X, AmigaOS 4, AROS and MorphOS. + +-------------------------------------------------------------------------------- + +via: http://fossforce.com/2015/08/five-super-cool-open-source-games/ + +作者:Hunter Banks +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[1]:https://www.youtube.com/watch?v=BEKVl-XtOP8 +[2]:http://tuxracer.sourceforge.net/download.html +[3]:http://fossforce.com/2015/07/banks-family-values-texas-linux-fest/ +[4]:http://www.kidsoncomputers.org/an-amazing-week-in-oaxaca +[5]:https://www.warsow.net/download +[6]:http://mars-game.sourceforge.net/ +[7]:http://valyriatear.blogspot.com/ +[8]:https://www.youtube.com/channel/UCQ5KrSk9EqcT_JixWY2RyMA +[9]:http://supertuxkart.sourceforge.net/ \ No newline at end of file diff --git a/sources/tech/20150826 How to Run Kali Linux 2.0 In Docker Container.md b/sources/tech/20150826 How to Run Kali Linux 2.0 In Docker Container.md new file mode 100644 index 0000000000..8018ca17e9 --- /dev/null +++ b/sources/tech/20150826 How to Run Kali Linux 2.0 In Docker Container.md @@ -0,0 +1,74 @@ +How to Run Kali Linux 2.0 In Docker Container +================================================================================ +### Introduction ### + +Kali Linux is a well known operating system for security testers and ethical hackers. It comes bundled with a large list of security related applications and make it easy to perform penetration testing. Recently, [Kali Linux 2.0][1] is out and it is being considered as one of the most important release for this operating system. On the other hand, Docker technology is getting massive popularity due to its scalability and ease of use. Dockers make it super easy to ship your software applications to your users. Breaking news is that you can now run Kali Linux via Dockers; let’s see how :) + +### Running Kali Linux 2.0 In Docker ### + +**Related Notes** + +If you don’t have docker installed on your system, you can do it by using the following commands: + +**For Ubuntu/Linux Mint/Debian:** + + sudo apt-get install docker + +**For Fedora/RHEL/CentOS:** + + sudo yum install docker + +**For Fedora 22:** + + dnf install docker + +You can start docker service by running: + + sudo docker start + +First of all make sure that docker service is running fine by using the following command: + + sudo docker status + +Kali Linux docker image has been uploaded online by Kali Linux development team, simply run following command to download this image to your system. + + docker pull kalilinux/kali-linux-docker + +![Pull Kali Linux docker](http://linuxpitstop.com/wp-content/uploads/2015/08/129.png) + +Once download is complete, run following command to find out the Image ID for your downloaded Kali Linux docker image file. + + docker images + +![Kali Linux Image ID](http://linuxpitstop.com/wp-content/uploads/2015/08/230.png) + +Now run following command to start your kali Linux docker container from image file (Here replace Image ID with correct one). + + docker run -i -t 198cd6df71ab3 /bin/bash + +It will immediately start the container and will log you into the operating system, you can start working on Kali Linux here. + +![Kali Linux Login](http://linuxpitstop.com/wp-content/uploads/2015/08/328.png) + +You can verify that container is started/running fine, by using the following command: + + docker ps + +![Docker Kali](http://linuxpitstop.com/wp-content/uploads/2015/08/421.png) + +### Conclusion ### + +Dockers are the smartest way to deploy and distribute your packages. Kali Linux docker image is pretty handy, does not consume any high amount of space on the disk and it is pretty easy to test this wonderful distro on any docker installed operating system now. + +-------------------------------------------------------------------------------- + +via: http://linuxpitstop.com/run-kali-linux-2-0-in-docker-container/ + +作者:[Aun][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://linuxpitstop.com/author/aun/ +[1]:http://linuxpitstop.com/install-kali-linux-2-0/ \ No newline at end of file From 83975466763ab52f4e455bdc788b110496c0a1d0 Mon Sep 17 00:00:00 2001 From: Luoyuanhao Date: Wed, 26 Aug 2015 19:19:47 +0800 Subject: [PATCH 468/507] [Translating] tech/RHCE/Part 5 - How to Manage System Logs (Configure, Rotate and Import Into Database) in RHEL 7.md --- ...ogs (Configure, Rotate and Import Into Database) in RHEL 7.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/RHCE/Part 5 - How to Manage System Logs (Configure, Rotate and Import Into Database) in RHEL 7.md b/sources/tech/RHCE/Part 5 - How to Manage System Logs (Configure, Rotate and Import Into Database) in RHEL 7.md index 217116cfee..8f3370f741 100644 --- a/sources/tech/RHCE/Part 5 - How to Manage System Logs (Configure, Rotate and Import Into Database) in RHEL 7.md +++ b/sources/tech/RHCE/Part 5 - How to Manage System Logs (Configure, Rotate and Import Into Database) in RHEL 7.md @@ -1,3 +1,4 @@ +ictlyh Translating Part 5 - How to Manage System Logs (Configure, Rotate and Import Into Database) in RHEL 7 ================================================================================ In order to keep your RHEL 7 systems secure, you need to know how to monitor all of the activities that take place on such systems by examining log files. Thus, you will be able to detect any unusual or potentially malicious activity and perform system troubleshooting or take another appropriate action. From 5c0aeccce15bf2f8d6efbc16defeba75e422913b Mon Sep 17 00:00:00 2001 From: locez Date: Thu, 27 Aug 2015 02:31:11 +0800 Subject: [PATCH 469/507] kde-plasma-5.4 --- translated/kde-plasma-5.4.md | 77 ++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 translated/kde-plasma-5.4.md diff --git a/translated/kde-plasma-5.4.md b/translated/kde-plasma-5.4.md new file mode 100644 index 0000000000..4c6e66bd69 --- /dev/null +++ b/translated/kde-plasma-5.4.md @@ -0,0 +1,77 @@ +#KDE 发行 Plasma 5.4.0 , 8 月版本特性 + +![Plasma 5.4](https://www.kde.org/announcements/plasma-5.4/plasma-screen-desktop-2-shadow.png) +2015 年 8 月 25 ,星期二,KDE发布了 Plasma 5 的一个新版本。 +此版本为我们带来了许多非常棒的触感,如优化了对高 DPI 的支持,KRunner 自动补全和一些新的美观的 Breeze 图标。这还为不久以后的 Wayland 桌面奠定了基础。我们还发行了几个新组件,如声音部件,显示器校准工具和测试版的用户管理工具。 + +###新的音频音量程序 +![The new Audio Volume Applet](https://www.kde.org/announcements/plasma-5.4/plasma-screen-audiovolume-shadows-wee.png) +新的音频音量程序直接与 PulseAudio (Linux 上一个非常流行的音频服务) 共同提供服务,并且在一个漂亮的简约的界面提供一个完全的音量控制和输出设定。 + +###应用控制面板起动器 +![he new Dashboard alternative launcher](https://www.kde.org/announcements/plasma-5.4/plasma-screen-dashboard-2-shadow-wee.png) +Plasma 5.4 在 kdeplasma-addons 带来了一个全新的全屏应用控制面板,它具有应用菜单的所有功能还支持缩放和全空间键盘导航。新的起动器可以像你目前所用的最近使用的或收藏的文档和联系人一样简单和快速地查找应用。 + +###丰富的艺术图标 +![Just some of the new icons in this release](https://kver.files.wordpress.com/2015/07/image10430.png) +Plasma 5.4 加入了 1400 多个新图标,其中不仅包含 KDE 程序的,而且还为 Inkscape, Firefox 和 Libreoffice 提供 Breeze 主题的艺术图标,可以体验到更加集成和本地化的感觉。 + +###KRunner 历史记录 +![KRunner](https://www.kde.org/announcements/plasma-5.4/plasma-screen-krunner-shadow-wee.png) +KRunner 现在可以记住之前的搜索历史并根据历史记录进行自动补全。 + +###Network 程序中实用的图形展示 +![Network Graphs](https://www.kde.org/announcements/plasma-5.4/plasma-screen-nm-graph-shadow-wee.png) +Network 程序现在可以以图形显示网络流量了,这也支持两个新的 VPN 插件,甚至是 SSH 或 SSTP。 + +###Wayland 技术预览 +Plasma 5.4 ,这个第一个 Wayland 桌面技术预览版已经发布了。在使用开源驱动的系统上可以使用 KWin,Plasma 的 Wayland 复合器, X11 窗口管理器和通过内核设定来运行 Plasma。现在已经支持的功能需求来自于[手机 Plasma 项目](https://dot.kde.org/2015/07/25/plasma-mobile-free-mobile-platform),更多的桌面原生功能还未被完全实现。现在还不能作为替换 Xorg 的基础桌面来使用,但可以轻松地测试它,贡献和观看感人的免费视频。有关如何在 Wayland 中使用 Plasma 的介绍请到:[KWin wiki pages](https://community.kde.org/KWin/Wayland#Start_a_Plasma_session_on_Wayland)。Wlayland 将会在我们构建一个稳定的版本的目标中得到改进。 + +###其他的改变和添加 + - 优化对高 DPI 支持 + - 更少的内存占用 + - 桌面搜索更新和更快的后端处理 + - 便笺添加拖拉和支持键盘导航 + - 回收站重新支持拖拉 + - 系统托盘获得更快的可配置性 + - 文档重新修订和更新 + - 优化数字时钟的布局 + - 数字时钟支持 ISO 日期 + - 更简单的方式切换数字时钟 12/24 格式 + - 日历显示第几周 + - 任何项目都可以收藏进应用菜单,支持收藏文档和 Telepathy 联系人 + - Telepathy 联系人收藏可以展示联系人的照片和实时状态 + - 优化程序与容器间的焦点和激活处理 + - 文件夹视图中各种小修复:更好的默认大喜哦,鼠标交互问题以及文本标签换行 + - 任务管理器更好的呈现起动器默认的应用图标 + - 可再次通过在任务管理器删除程序来添加起动器 + - 可配置中间点击在任务管理器中的行为:无动作,关闭窗口,起动一个相同的程序 + - 任务管理器现在以列排序优先无论用户是否更倾向于行优先;许多用户更喜欢这样排序是因为它会使更少的任务按钮像窗口一样移来移去 + - 优化任务管理器的图标和页边标度 + - 任务管理器中各种小修复:垂直下拉,触摸事件处理,组扩展箭头视觉问题 + - 提供可用的目的框架技术预览版,可以使用 QuickShare Plasmoid 在许多 web 服务分享文件 + - 添加 显示器配置工具 + - 添加 kwallet-pam 来在登陆时打开 wallet + - 用户管理器现在已经接入到设置中,并且用户账户模块被舍弃 + - 应用程序菜单(Kicker)的性能得到改善 + - 应用程序菜单(Kicker)各种小修复:可用 隐藏/显示 程序更加可靠,顶部面板对齐修复,文件夹视图中 “添加到桌面”更加可靠,在 KActivities-based 最新的模块中有更好的表现 + - 支持自定义菜单布局 (kmenuedit)和应用程序菜单(Kicker)支持菜单项目分隔 + - 文件夹视图已经优化在面板中的模式 [blog](https://blogs.kde.org/2015/06/04/folder-view-panel-popups-are-list-views-again) + - 在桌面容器中删除一个文件夹现在可在文件夹视图中恢复 + + [Full Plasma 5.4 changelog](https://www.kde.org/announcements/plasma-5.3.2-5.4.0-changelog.php) + + ###Live 镜像 + 偿鲜的最简单的方式就是从 U 盘中启动,可以在 KDE 社区 Wiki 中找到 各种 [ Live Images with Plasma 5](https://community.kde.org/Plasma/LiveImages) + + ###下载软件包 + 各发行版已经构建了软件包,或者正在构建,wiki 中的列出了各发行版的软件包名:[Package download wiki page](https://community.kde.org/Plasma/Packages) + + ###源码下载 + 可以直接从源码中安装 Plasma 5。KDE 社区 Wiki 已经介绍了怎样编译[instructions to compile](http://community.kde.org/Frameworks/Building)。 +注意,Plasma 5 与 Plasma 4 不兼容,必须先卸载旧版本,或者安装到不同的前缀处。 + - [Source Info Page](https://www.kde.org/info/plasma-5.4.0.php) + + --- + via:https://www.kde.org/announcements/plasma-5.4.0.php + 译者:[Locez](http://locez.com) \ No newline at end of file From 777337a9ff87a9322c11ca57dd89ec7b636784bf Mon Sep 17 00:00:00 2001 From: wxy Date: Wed, 26 Aug 2015 22:32:52 +0800 Subject: [PATCH 470/507] PUB:kde-plasma-5.4 @Locez --- published/kde-plasma-5.4.md | 109 +++++++++++++++++++++++++++++++++++ translated/kde-plasma-5.4.md | 77 ------------------------- 2 files changed, 109 insertions(+), 77 deletions(-) create mode 100644 published/kde-plasma-5.4.md delete mode 100644 translated/kde-plasma-5.4.md diff --git a/published/kde-plasma-5.4.md b/published/kde-plasma-5.4.md new file mode 100644 index 0000000000..6d5b77bfd0 --- /dev/null +++ b/published/kde-plasma-5.4.md @@ -0,0 +1,109 @@ +KDE Plasma 5.4.0 发布,八月特色版 +============================= + +![Plasma 5.4](https://www.kde.org/announcements/plasma-5.4/plasma-screen-desktop-2-shadow.png) + +2015 年 8 月 25 ,星期二,KDE 发布了 Plasma 5 的一个特色新版本。 + +此版本为我们带来了许多非常棒的感受,如优化了对高分辨率的支持,KRunner 自动补全和一些新的 Breeze 漂亮图标。这还为不久以后的技术预览版的 Wayland 桌面奠定了基础。我们还带来了几个新组件,如声音音量部件,显示器校准工具和测试版的用户管理工具。 + +###新的音频音量程序 + +![The new Audio Volume Applet](https://www.kde.org/announcements/plasma-5.4/plasma-screen-audiovolume-shadows.png) + +新的音频音量程序直接工作于 PulseAudio (Linux 上一个非常流行的音频服务) 之上 ,并且在一个漂亮的简约的界面提供一个完整的音量控制和输出设定。 + +###替代的应用控制面板起动器 + +![he new Dashboard alternative launcher](https://www.kde.org/announcements/plasma-5.4/plasma-screen-dashboard-2-shadow.png) + +Plasma 5.4 在 kdeplasma-addons 软件包中提供了一个全新的全屏的应用控制面板,它具有应用菜单的所有功能,还支持缩放和全空间键盘导航。新的起动器可以像你目前所用的“最近使用的”或“收藏的文档和联系人”一样简单和快速地查找应用。 + +###丰富的艺术图标 + +![Just some of the new icons in this release](https://kver.files.wordpress.com/2015/07/image10430.png) + +Plasma 5.4 提供了超过 1400 个的新图标,其中不仅包含 KDE 程序的,而且还为 Inkscape, Firefox 和 Libreoffice 提供 Breeze 主题的艺术图标,可以体验到更加一致和本地化的感觉。 + +###KRunner 历史记录 + +![KRunner](https://www.kde.org/announcements/plasma-5.4/plasma-screen-krunner-shadow.png) + +KRunner 现在可以记住之前的搜索历史并根据历史记录进行自动补全。 + +###Network 程序中实用的图形展示 + +![Network Graphs](https://www.kde.org/announcements/plasma-5.4/plasma-screen-nm-graph-shadow.png) + +Network 程序现在可以以图形形式显示网络流量了,同时也支持两个新的 VPN 插件:通过 SSH 连接或通过 SSTP 连接。 + +###Wayland 技术预览 + +随着 Plasma 5.4 ,Wayland 桌面发布了第一个技术预览版。在使用自由图形驱动(free graphics drivers)的系统上可以使用 KWin(Plasma 的 Wayland 合成器和 X11 窗口管理器)通过[内核模式设定][1]来运行 Plasma。现在已经支持的功能需求来自于[手机 Plasma 项目][2],更多的面向桌面的功能还未被完全实现。现在还不能作为替换那些基于 Xorg 的桌面,但可以轻松地对它测试和贡献,以及观看令人激动视频。有关如何在 Wayland 中使用 Plasma 的介绍请到:[KWin 维基页][3]。Wlayland 将随着我们构建的稳定版本而逐步得到改进。 + +###其他的改变和添加 + + - 优化对高 DPI 支持 + - 更少的内存占用 + - 桌面搜索使用了更快的新后端 + - 便笺增加拖拉支持和键盘导航 + - 回收站重新支持拖拉 + - 系统托盘获得更快的可配置性 + - 文档重新修订和更新 + - 优化了窄小面板上的数字时钟的布局 + - 数字时钟支持 ISO 日期 + - 切换数字时钟 12/24 格式更简单 + - 日历显示第几周 + - 任何项目都可以收藏进应用菜单(Kicker),支持收藏文档和 Telepathy 联系人 + - Telepathy 联系人收藏可以展示联系人的照片和实时状态 + - 优化程序与容器间的焦点和激活处理 + - 文件夹视图中各种小修复:更好的默认尺寸,鼠标交互问题以及文本标签换行 + - 任务管理器更好的呈现起动器默认的应用图标 + - 可再次通过将程序拖入任务管理器来添加启动器 + - 可配置中间键点击在任务管理器中的行为:无动作,关闭窗口,启动一个相同的程序的新实例 + - 任务管理器现在以列排序优先,无论用户是否更倾向于行优先;许多用户更喜欢这样排序是因为它会使更少的任务按钮像窗口一样移来移去 + - 优化任务管理器的图标和缩放边 + - 任务管理器中各种小修复:垂直下拉,触摸事件处理现在支持所有系统,组扩展箭头的视觉问题 + - 提供可用的目的框架技术预览版,可以使用 QuickShare Plasmoid,它可以让许多 web 服务分享文件更容易 + - 增加了显示器配置工具 + - 增加的 kwallet-pam 可以在登录时打开 wallet + - 用户管理器现在会同步联系人到 KConfig 的设置中,用户账户模块被丢弃了 + - 应用程序菜单(Kicker)的性能得到改善 + - 应用程序菜单(Kicker)各种小修复:隐藏/显示程序更加可靠,顶部面板的对齐修复,文件夹视图中 “添加到桌面”更加可靠,在基于 KActivities 的最新模块中有更好的表现 + - 支持自定义菜单布局 (kmenuedit)和应用程序菜单(Kicker)支持菜单项目分隔 + - 当在面板中时,改进了文件夹视图,参见 [blog][4] + - 将文件夹拖放到桌面容器现在会再次创建一个文件夹视图 + +[完整的 Plasma 5.4 变更日志在此](https://www.kde.org/announcements/plasma-5.3.2-5.4.0-changelog.php) + +###Live 镜像 + +尝鲜的最简单的方式就是从 U 盘中启动,可以在 KDE 社区 Wiki 中找到 各种 [带有 Plasma 5 的 Live 镜像][5]。 + +###下载软件包 + +各发行版已经构建了软件包,或者正在构建,wiki 中的列出了各发行版的软件包名:[软件包下载维基页][6]。 + +###源码下载 + +可以直接从源码中安装 Plasma 5。KDE 社区 Wiki 已经介绍了[怎样编译][7]。 + +注意,Plasma 5 与 Plasma 4 不兼容,必须先卸载旧版本,或者安装到不同的前缀处。 + + +- [源代码信息页][8] + +--- + +via: https://www.kde.org/announcements/plasma-5.4.0.php + +译者:[Locez](http://locez.com) 校对:[wxy](http://github.com/wxy) + +[1]:https://en.wikipedia.org/wiki/Direct_Rendering_Manager +[2]:https://dot.kde.org/2015/07/25/plasma-mobile-free-mobile-platform +[3]:https://community.kde.org/KWin/Wayland#Start_a_Plasma_session_on_Wayland +[4]:https://blogs.kde.org/2015/06/04/folder-view-panel-popups-are-list-views-again +[5]:https://community.kde.org/Plasma/LiveImages +[6]:https://community.kde.org/Plasma/Packages +[7]:http://community.kde.org/Frameworks/Building +[8]:https://www.kde.org/info/plasma-5.4.0.php \ No newline at end of file diff --git a/translated/kde-plasma-5.4.md b/translated/kde-plasma-5.4.md deleted file mode 100644 index 4c6e66bd69..0000000000 --- a/translated/kde-plasma-5.4.md +++ /dev/null @@ -1,77 +0,0 @@ -#KDE 发行 Plasma 5.4.0 , 8 月版本特性 - -![Plasma 5.4](https://www.kde.org/announcements/plasma-5.4/plasma-screen-desktop-2-shadow.png) -2015 年 8 月 25 ,星期二,KDE发布了 Plasma 5 的一个新版本。 -此版本为我们带来了许多非常棒的触感,如优化了对高 DPI 的支持,KRunner 自动补全和一些新的美观的 Breeze 图标。这还为不久以后的 Wayland 桌面奠定了基础。我们还发行了几个新组件,如声音部件,显示器校准工具和测试版的用户管理工具。 - -###新的音频音量程序 -![The new Audio Volume Applet](https://www.kde.org/announcements/plasma-5.4/plasma-screen-audiovolume-shadows-wee.png) -新的音频音量程序直接与 PulseAudio (Linux 上一个非常流行的音频服务) 共同提供服务,并且在一个漂亮的简约的界面提供一个完全的音量控制和输出设定。 - -###应用控制面板起动器 -![he new Dashboard alternative launcher](https://www.kde.org/announcements/plasma-5.4/plasma-screen-dashboard-2-shadow-wee.png) -Plasma 5.4 在 kdeplasma-addons 带来了一个全新的全屏应用控制面板,它具有应用菜单的所有功能还支持缩放和全空间键盘导航。新的起动器可以像你目前所用的最近使用的或收藏的文档和联系人一样简单和快速地查找应用。 - -###丰富的艺术图标 -![Just some of the new icons in this release](https://kver.files.wordpress.com/2015/07/image10430.png) -Plasma 5.4 加入了 1400 多个新图标,其中不仅包含 KDE 程序的,而且还为 Inkscape, Firefox 和 Libreoffice 提供 Breeze 主题的艺术图标,可以体验到更加集成和本地化的感觉。 - -###KRunner 历史记录 -![KRunner](https://www.kde.org/announcements/plasma-5.4/plasma-screen-krunner-shadow-wee.png) -KRunner 现在可以记住之前的搜索历史并根据历史记录进行自动补全。 - -###Network 程序中实用的图形展示 -![Network Graphs](https://www.kde.org/announcements/plasma-5.4/plasma-screen-nm-graph-shadow-wee.png) -Network 程序现在可以以图形显示网络流量了,这也支持两个新的 VPN 插件,甚至是 SSH 或 SSTP。 - -###Wayland 技术预览 -Plasma 5.4 ,这个第一个 Wayland 桌面技术预览版已经发布了。在使用开源驱动的系统上可以使用 KWin,Plasma 的 Wayland 复合器, X11 窗口管理器和通过内核设定来运行 Plasma。现在已经支持的功能需求来自于[手机 Plasma 项目](https://dot.kde.org/2015/07/25/plasma-mobile-free-mobile-platform),更多的桌面原生功能还未被完全实现。现在还不能作为替换 Xorg 的基础桌面来使用,但可以轻松地测试它,贡献和观看感人的免费视频。有关如何在 Wayland 中使用 Plasma 的介绍请到:[KWin wiki pages](https://community.kde.org/KWin/Wayland#Start_a_Plasma_session_on_Wayland)。Wlayland 将会在我们构建一个稳定的版本的目标中得到改进。 - -###其他的改变和添加 - - 优化对高 DPI 支持 - - 更少的内存占用 - - 桌面搜索更新和更快的后端处理 - - 便笺添加拖拉和支持键盘导航 - - 回收站重新支持拖拉 - - 系统托盘获得更快的可配置性 - - 文档重新修订和更新 - - 优化数字时钟的布局 - - 数字时钟支持 ISO 日期 - - 更简单的方式切换数字时钟 12/24 格式 - - 日历显示第几周 - - 任何项目都可以收藏进应用菜单,支持收藏文档和 Telepathy 联系人 - - Telepathy 联系人收藏可以展示联系人的照片和实时状态 - - 优化程序与容器间的焦点和激活处理 - - 文件夹视图中各种小修复:更好的默认大喜哦,鼠标交互问题以及文本标签换行 - - 任务管理器更好的呈现起动器默认的应用图标 - - 可再次通过在任务管理器删除程序来添加起动器 - - 可配置中间点击在任务管理器中的行为:无动作,关闭窗口,起动一个相同的程序 - - 任务管理器现在以列排序优先无论用户是否更倾向于行优先;许多用户更喜欢这样排序是因为它会使更少的任务按钮像窗口一样移来移去 - - 优化任务管理器的图标和页边标度 - - 任务管理器中各种小修复:垂直下拉,触摸事件处理,组扩展箭头视觉问题 - - 提供可用的目的框架技术预览版,可以使用 QuickShare Plasmoid 在许多 web 服务分享文件 - - 添加 显示器配置工具 - - 添加 kwallet-pam 来在登陆时打开 wallet - - 用户管理器现在已经接入到设置中,并且用户账户模块被舍弃 - - 应用程序菜单(Kicker)的性能得到改善 - - 应用程序菜单(Kicker)各种小修复:可用 隐藏/显示 程序更加可靠,顶部面板对齐修复,文件夹视图中 “添加到桌面”更加可靠,在 KActivities-based 最新的模块中有更好的表现 - - 支持自定义菜单布局 (kmenuedit)和应用程序菜单(Kicker)支持菜单项目分隔 - - 文件夹视图已经优化在面板中的模式 [blog](https://blogs.kde.org/2015/06/04/folder-view-panel-popups-are-list-views-again) - - 在桌面容器中删除一个文件夹现在可在文件夹视图中恢复 - - [Full Plasma 5.4 changelog](https://www.kde.org/announcements/plasma-5.3.2-5.4.0-changelog.php) - - ###Live 镜像 - 偿鲜的最简单的方式就是从 U 盘中启动,可以在 KDE 社区 Wiki 中找到 各种 [ Live Images with Plasma 5](https://community.kde.org/Plasma/LiveImages) - - ###下载软件包 - 各发行版已经构建了软件包,或者正在构建,wiki 中的列出了各发行版的软件包名:[Package download wiki page](https://community.kde.org/Plasma/Packages) - - ###源码下载 - 可以直接从源码中安装 Plasma 5。KDE 社区 Wiki 已经介绍了怎样编译[instructions to compile](http://community.kde.org/Frameworks/Building)。 -注意,Plasma 5 与 Plasma 4 不兼容,必须先卸载旧版本,或者安装到不同的前缀处。 - - [Source Info Page](https://www.kde.org/info/plasma-5.4.0.php) - - --- - via:https://www.kde.org/announcements/plasma-5.4.0.php - 译者:[Locez](http://locez.com) \ No newline at end of file From e97706ebbf6275e19c35e8ea6e75333b95187f43 Mon Sep 17 00:00:00 2001 From: Xuanwo Date: Thu, 27 Aug 2015 01:21:06 +0800 Subject: [PATCH 471/507] update --- ... 'sed' Command to Create Edit and Manipulate files in Linux.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/LFCS/Part 1 - LFCS--How to use GNU 'sed' Command to Create Edit and Manipulate files in Linux.md (100%) 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/translated/tech/LFCS/Part 1 - LFCS--How to use GNU 'sed' Command to Create Edit and Manipulate files in Linux.md similarity index 100% rename from sources/tech/LFCS/Part 1 - LFCS--How to use GNU 'sed' Command to Create Edit and Manipulate files in Linux.md rename to translated/tech/LFCS/Part 1 - LFCS--How to use GNU 'sed' Command to Create Edit and Manipulate files in Linux.md From bea736fc794a2f7986cf6aa969e00adb7745dd65 Mon Sep 17 00:00:00 2001 From: Xuanwo Date: Thu, 27 Aug 2015 02:08:59 +0800 Subject: [PATCH 472/507] woking hard >.< --- ...eate Edit and Manipulate files in Linux.md | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/translated/tech/LFCS/Part 1 - LFCS--How to use GNU 'sed' Command to Create Edit and Manipulate files in Linux.md b/translated/tech/LFCS/Part 1 - LFCS--How to use GNU 'sed' Command to Create Edit and Manipulate files in Linux.md index 083078fa62..80f7aa6339 100644 --- a/translated/tech/LFCS/Part 1 - LFCS--How to use GNU 'sed' Command to Create Edit and Manipulate files in Linux.md +++ b/translated/tech/LFCS/Part 1 - LFCS--How to use GNU 'sed' Command to Create Edit and Manipulate files in Linux.md @@ -1,33 +1,33 @@ Translating by Xuanwo Part 1 - LFCS: How to use GNU ‘sed’ Command to Create, Edit, and Manipulate files in Linux +LFCS系列第一讲:如何在Linux上使用GNU'sed'命令来创建、编辑和操作文件 ================================================================================ -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基金会宣布了一个全新的LFCS(Linux Foundation Certified Sysadmin,Linux基金会认证系统管理员)认证计划。这一计划旨在帮助遍布全世界的人们获得其在处理Linux系统管理任务上能力的认证。这些能力包括支持运行的系统服务,以及第一手的故障诊断和分析和为工程师团队在升级时提供智能决策。 ![Linux Foundation Certified Sysadmin](http://www.tecmint.com/wp-content/uploads/2014/10/lfcs-Part-1.png) -Linux Foundation Certified Sysadmin – Part 1 +Linux基金会认证系统管理员——第一讲 -Please watch the following video that demonstrates about The Linux Foundation Certification Program. +请观看下面关于Linux基金会认证计划的演示: 注: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: +该系列将命名为《LFCS预备第一讲》至《LFCS预备第十讲》并覆盖关于Ubuntu,CentOS以及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 +- 第一讲:如何在Linux上使用GNU'sed'命令来创建、编辑和操作文件 +- 第二讲:如何安装和使用vi/m全功能文字编辑器 +- 第三讲:归档文件/目录和在文件系统中寻找文件 +- 第四讲:为存储设备分区,格式化文件系统和配置交换分区 +- 第五讲:在Linux中挂载/卸载本地和网络(Samba & NFS)文件系统 +- 第六讲:组合分区作为RAID设备——创建&管理系统备份 +- 第七讲:管理系统启动进程和服务(使用SysVinit, Systemd 和 Upstart) +- 第八讲:管理用户和组,文件权限和属性以及启用账户的sudo权限 +- 第九讲:Linux包管理与Yum,RPM,Apt,Dpkg,Aptitude,Zypper +- 第十讲:学习简单的Shell脚本和文件系统故障排除 - -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. +本文是覆盖这个参加LFCS认证考试的所必需的范围和能力的十个教程的第一讲。话虽如此,快打开你的终端,让我们开始吧! ### Processing Text Streams in Linux ### From ffdee792a740a45fbbcb9e5172a4b97ca87dc8e4 Mon Sep 17 00:00:00 2001 From: Xuanwo Date: Thu, 27 Aug 2015 02:42:24 +0800 Subject: [PATCH 473/507] have a break: --- ...eate Edit and Manipulate files in Linux.md | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/translated/tech/LFCS/Part 1 - LFCS--How to use GNU 'sed' Command to Create Edit and Manipulate files in Linux.md b/translated/tech/LFCS/Part 1 - LFCS--How to use GNU 'sed' Command to Create Edit and Manipulate files in Linux.md index 80f7aa6339..21579f0ed9 100644 --- a/translated/tech/LFCS/Part 1 - LFCS--How to use GNU 'sed' Command to Create Edit and Manipulate files in Linux.md +++ b/translated/tech/LFCS/Part 1 - LFCS--How to use GNU 'sed' Command to Create Edit and Manipulate files in Linux.md @@ -29,34 +29,34 @@ Linux基金会认证系统管理员——第一讲 本文是覆盖这个参加LFCS认证考试的所必需的范围和能力的十个教程的第一讲。话虽如此,快打开你的终端,让我们开始吧! -### Processing Text Streams in Linux ### +### 处理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). +Linux将程序中的输入和输出当成字符流或者字符序列。在开始理解重定向和管道之前,我们必须先了解三种最重要的I/O(Input and Output,输入和输出)流,事实上,它们都是特殊的文件(根据UNIX和Linux中的约定,数据流和外围设备或者设备文件也被视为普通文件)。 -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. +由于重定向操作符静默创建或覆盖文件,我们必须特别小心谨慎地使用它,并且永远不要把它和管道混淆起来。在Linux和UNIX系统上管道的优势是:第一个命令的输出不会写入一个文件而是直接被第二个命令读取。 -For the following practice exercises we will use the poem “A happy child” (anonymous author). +在下面的操作练习中,我们将会使用这首诗——《A happy child》(匿名作者) ![cat command](http://www.tecmint.com/wp-content/uploads/2014/10/cat-command.png) cat command example -#### Using sed #### +#### 使用 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). +sed是流编辑器(stream editor)的缩写。为那些不懂术语的人额外解释一下,流编辑器是用来在一个输入流(文件或者管道中的输入)执行基本的文本转换的工具。 -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. +sed最基本的用法是字符替换。我们将通过把每个出现的小写y改写为大写Y并且将输出重定向到ahappychild2.txt开始。g标志表示sed应该替换文件每一行中所有应当替换的实例。如果这个标志省略了,sed将会只替换每一行中第一次出现的实例。 -**Basic syntax:** +**基本语法:** # sed ‘s/term/replacement/flag’ file -**Our example:** +**我们的样例:** # sed ‘s/y/Y/g’ ahappychild.txt > ahappychild2.txt @@ -64,9 +64,9 @@ The most basic (and popular) usage of sed is the substitution of characters. We 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. +例如,我们将会用一个符号来替换一个文字。与此同时,我们将把一行最开始出现的第一个I替换为You。 # sed 's/and/\&/g;s/^I/You/g' ahappychild.txt @@ -74,9 +74,9 @@ For example, we will substitute the word and for an ampersand. At the same time, 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. From c8652ceacacb5784660136aece5fc8e0c137a394 Mon Sep 17 00:00:00 2001 From: GOLinux Date: Thu, 27 Aug 2015 08:52:38 +0800 Subject: [PATCH 474/507] [Translated]20150824 Mhddfs--Combine Several Smaller Partition into One Large Virtual Storage.md --- ...artition into One Large Virtual Storage.md | 187 ------------------ ...artition into One Large Virtual Storage.md | 183 +++++++++++++++++ 2 files changed, 183 insertions(+), 187 deletions(-) delete mode 100644 sources/tech/20150824 Mhddfs--Combine Several Smaller Partition into One Large Virtual Storage.md create mode 100644 translated/tech/20150824 Mhddfs--Combine Several Smaller Partition into One Large Virtual Storage.md diff --git a/sources/tech/20150824 Mhddfs--Combine Several Smaller Partition into One Large Virtual Storage.md b/sources/tech/20150824 Mhddfs--Combine Several Smaller Partition into One Large Virtual Storage.md deleted file mode 100644 index ebf3a9c4fd..0000000000 --- a/sources/tech/20150824 Mhddfs--Combine Several Smaller Partition into One Large Virtual Storage.md +++ /dev/null @@ -1,187 +0,0 @@ -Translating by GOLinux! -Mhddfs – Combine Several Smaller Partition into One Large Virtual Storage -================================================================================ -Let’s assume that you have 30GB of movies and you have 3 drives each 20 GB in size. So how will you store? - -Obviously you can split your videos in two or three different volumes and store them on the drive manually. This certainly is not a good idea, it is an exhaustive work which requires manual intervention and a lots of your time. - -Another solution is to create a [RAID array of disk][1]. The RAID has always remained notorious for loss of storage reliability and usable disk space. Another solution is mhddfs. - -![Combine Multiple Partitions in Linux](http://www.tecmint.com/wp-content/uploads/2015/08/Combine-Multiple-Partitions-in-Linux.png) - -Mhddfs – Combine Multiple Partitions in Linux - -mhddfs is a driver for Linux that combines several mount points into one virtual disk. It is a fuse based driver, which provides a easy solution for large data storage. It combines all small file systems to create a single big virtual filesystem which contains every particle of its member filesystem including files and free spaces. - -#### Why you need Mhddfs? #### - -All your storage devices creates a single virtual pool and it can be mounted right at the boot. This small utility takes care of, which drive is full and which is empty and to write data to what drive, intelligently. Once you create virtual drives successfully, you can share your virtual filesystem using [SAMBA][2]. Your client will always see a huge drive and lots of free space. - -#### Features of Mhddfs #### - -- Get attributes of the file system and system information. -- Set attributes of the file system. -- Create, Read, Remove and write Directories and files. -- Support for file locks and Hardlinks on single device. - -注:表格 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Pros of mhddfsCons of mhddfs
 Perfect for home users.mhddfs driver is not built in the Linux Kernel
 Simple to run. Required lots of processing power during runtime
 No evidence of Data loss No redundancy solution.
 Do not split the file. Hardlinks moving not supported
 Add new files to the combined virtual filesystem. 
 Manage the location where these files are saved. 
  Extended file attributes 
- -### Installation of Mhddfs in Linux ### - -On Debian and portable to alike systems, you can install mhddfs package using following command. - - # apt-get update && apt-get install mhddfs - -![Install Mhddfs on Debian based Systems](http://www.tecmint.com/wp-content/uploads/2015/08/Install-Mhddfs-on-Ubuntu.png) - -Install Mhddfs on Debian based Systems - -On RHEL/CentOS Linux systems, you need to turn on [epel-repository][3] and then execute the below command to install mhddfs package. - - # yum install mhddfs - -On Fedora 22+ systems, you may get it by dnf package manger as shown below. - - # dnf install mhddfs - -![Install Mhddfs on Fedora](http://www.tecmint.com/wp-content/uploads/2015/08/Install-Mhddfs-on-Fedora.png) - -Install Mhddfs on Fedora - -If incase, mhddfs package isn’t available from epel repository, then you need to resolve following dependencies to install and compile it from source as shown below. - -- FUSE header files -- GCC -- libc6 header files -- uthash header files -- libattr1 header files (optional) - -Next, download the latest source package simply as suggested below and compile it. - - # wget http://mhddfs.uvw.ru/downloads/mhddfs_0.1.39.tar.gz - # tar -zxvf mhddfs*.tar.gz - # cd mhddfs-0.1.39/ - # make - -You should be able to see binary mhddfs in the current directory. Move it to /usr/bin/ and /usr/local/bin/ as root. - - # cp mhddfs /usr/bin/ - # cp mhddfs /usr/local/bin/ - -All set, mhddfs is ready to be used. - -### How do I use Mhddfs? ### - -1. Lets see all the HDD mounted to my system currently. - - $ df -h - -![Check Mounted Devices](http://www.tecmint.com/wp-content/uploads/2015/08/Check-Mounted-Devices.gif) - -**Sample Output** - - Filesystem Size Used Avail Use% Mounted on - - /dev/sda1 511M 132K 511M 1% /boot/efi - /dev/sda2 451G 92G 336G 22% / - /dev/sdb1 1.9T 161G 1.7T 9% /media/avi/BD9B-5FCE - /dev/sdc1 555M 555M 0 100% /media/avi/Debian 8.1.0 M-A 1 - -Notice the ‘Mount Point‘ name here, which we will be using later. - -2. Create a directory `/mnt/virtual_hdd` where all these all file system will be grouped together as, - - # mkdir /mnt/virtual_hdd - -3. And then mount all the file-systems. Either as root or as a user who is a member of FUSE group. - - # mhddfs /boot/efi, /, /media/avi/BD9B-5FCE/, /media/avi/Debian\ 8.1.0\ M-A\ 1/ /mnt/virtual_hdd -o allow_other - -![Mount All File System in Linux](http://www.tecmint.com/wp-content/uploads/2015/08/Mount-All-File-System-in-Linux.png) - -Mount All File System in Linux - -**Note**: We are used mount Point names here of all the HDDs. Obviously the mount point in your case will be different. Also notice “-o allow_other” option makes this Virtual file system visible to all others and not only the person who created it. - -4. Now run “df -h” see all the filesystems. It should contain the one you created just now. - - $ df -h - -![Verify Virtual File System Mount](http://www.tecmint.com/wp-content/uploads/2015/08/Verify-Virtual-File-System.png) - -Verify Virtual File System Mount - -You can perform all the option to the Virtual File System you created as you would have done to a Mounted Drive. - -5. To create this Virtual File system on every system boot, you should add the below line of code (in your case it should be different, depending upon your mount point), at the end of /etc/fstab file as root. - - mhddfs# /boot/efi, /, /media/avi/BD9B-5FCE/, /media/avi/Debian\ 8.1.0\ M-A\ 1/ /mnt/virtual_hdd fuse defaults,allow_other 0 0 - -6. If at any point of time you want to add/remove a new drive to Virtual_hdd, you may mount a new drive, copy the contents of mount point /mnt/virtual_hdd, un-mount the volume, Eject the Drive you want to remove and/or mount the new drive you want to include, Mount the overall filesystem under Virtual_hdd using mhddfs command and you should be done. - -#### How do I Un-Mount Virtual_hdd? #### - -Unmounting virtual_hdd is as easy as, - - # umount /mnt/virtual_hdd - -![Unmount Virtual Filesystem](http://www.tecmint.com/wp-content/uploads/2015/08/Unmount-Virtual-Filesystem.png) - -Unmount Virtual Filesystem - -Notice it is umount and not unmount. A lot of user type it wrong. - -That’s all for now. I am working on another post you people will love to read. 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/combine-partitions-into-one-in-linux-using-mhddfs/ - -作者:[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/understanding-raid-setup-in-linux/ -[2]:http://www.tecmint.com/mount-filesystem-in-linux/ -[3]:http://www.tecmint.com/how-to-enable-epel-repository-for-rhel-centos-6-5/ diff --git a/translated/tech/20150824 Mhddfs--Combine Several Smaller Partition into One Large Virtual Storage.md b/translated/tech/20150824 Mhddfs--Combine Several Smaller Partition into One Large Virtual Storage.md new file mode 100644 index 0000000000..04d9f18eb9 --- /dev/null +++ b/translated/tech/20150824 Mhddfs--Combine Several Smaller Partition into One Large Virtual Storage.md @@ -0,0 +1,183 @@ +Mhddfs——将多个小分区合并成一个大的虚拟存储 +================================================================================ + +让我们假定你有30GB的电影,并且你有3个驱动器,每个的大小为20GB。那么,你会怎么来存放东西呢? + +很明显,你可以将你的视频分割成2个或者3个不同的卷,并将它们手工存储到驱动器上。这当然不是一个好主意,它成了一项费力的工作,它需要你手工干预,而且花费你大量时间。 + +另外一个解决方案是创建一个[RAID磁盘阵列][1]。然而,RAID在缺乏存储可靠性,磁盘空间可用性差等方面声名狼藉。另外一个解决方案,就是mhddfs。 + +![Combine Multiple Partitions in Linux](http://www.tecmint.com/wp-content/uploads/2015/08/Combine-Multiple-Partitions-in-Linux.png) +Mhddfs——在Linux中合并多个分区 + +mhddfs是一个用于Linux的驱动,它可以将多个挂载点合并到一个虚拟磁盘中。它是一个基于FUSE的驱动,提供了一个用于大数据存储的简单解决方案。它将所有小文件系统合并,以创建一个单一的大虚拟文件系统,该文件系统包含其成员文件系统的所有颗粒,包括文件和空闲空间。 + +#### 你为什么需要Mhddfs? #### + +你所有存储设备创建了一个单一的虚拟池,它可以在启动时被挂载。这个小工具可以智能地照看并处理哪个驱动器满了,哪个驱动器空着,将数据写到哪个驱动器中。当你成功创建虚拟驱动器后,你可以使用[SAMBA][2]来共享你的虚拟文件系统。你的客户端将在任何时候都看到一个巨大的驱动器和大量的空闲空间。 + +#### Mhddfs特性 #### + +- 获取文件系统属性和系统信息。 +- 设置文件系统属性。 +- 创建、读取、移除和写入目录和文件。 +- 支持文件锁和单一设备上的硬链接。 + +注:表格 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
mhddfs的优点mhddfs的缺点
 适合家庭用户mhddfs驱动没有内建在Linux内核中
 运行简单 运行时需要大量处理能力
 没有明显的数据丢失 没有冗余解决方案
 不分割文件 不支持移动硬链接
 添加新文件到合并的虚拟文件系统 
 管理文件保存的位置 
  扩展文件属性 
+ +### Linux中安装Mhddfs ### + +在Debian及其类似的移植系统中,你可以使用下面的命令来安装mhddfs包。 + + # apt-get update && apt-get install mhddfs + +![Install Mhddfs on Debian based Systems](http://www.tecmint.com/wp-content/uploads/2015/08/Install-Mhddfs-on-Ubuntu.png) +安装Mhddfs到基于Debian的系统中 + +在RHEL/CentOS Linux系统中,你需要开启[epel仓库][3],然后执行下面的命令来安装mhddfs包。 + + # yum install mhddfs + +在Fedora 22及以上系统中,你可以通过dnf包管理来获得它,就像下面这样。 + + # dnf install mhddfs + +![Install Mhddfs on Fedora](http://www.tecmint.com/wp-content/uploads/2015/08/Install-Mhddfs-on-Fedora.png) +安装Mhddfs到Fedora + +如果万一mhddfs包不能从epel仓库获取到,那么你需要解决下面的依赖,然后像下面这样来编译源码并安装。 + +- FUSE头文件 +- GCC +- libc6头文件 +- uthash头文件 +- libattr1头文件(可选) + +接下来,只需从下面建议的地址下载最新的源码包,然后编译。 + + # wget http://mhddfs.uvw.ru/downloads/mhddfs_0.1.39.tar.gz + # tar -zxvf mhddfs*.tar.gz + # cd mhddfs-0.1.39/ + # make + +你应该可以在当前目录中看到mhddfs的二进制文件,以root身份将它移动到/usr/bin/和/usr/local/bin/中。 + + # cp mhddfs /usr/bin/ + # cp mhddfs /usr/local/bin/ + +一切搞定,mhddfs已经可以用了。 + +### 我怎么使用Mhddfs? ### + +1.让我们看看当前所有挂载到我们系统中的硬盘。 + + + $ df -h + +![Check Mounted Devices](http://www.tecmint.com/wp-content/uploads/2015/08/Check-Mounted-Devices.gif) +**样例输出** + + Filesystem Size Used Avail Use% Mounted on + + /dev/sda1 511M 132K 511M 1% /boot/efi + /dev/sda2 451G 92G 336G 22% / + /dev/sdb1 1.9T 161G 1.7T 9% /media/avi/BD9B-5FCE + /dev/sdc1 555M 555M 0 100% /media/avi/Debian 8.1.0 M-A 1 + +注意这里的‘挂载点’名称,我们后面会使用到它们。 + +2.创建目录‘/mnt/virtual_hdd’,在这里,所有这些文件系统将被组成组。 + + + # mkdir /mnt/virtual_hdd + +3.然后,挂载所有文件系统。你可以通过root或者FUSE组中的某个成员来完成。 + + + # mhddfs /boot/efi, /, /media/avi/BD9B-5FCE/, /media/avi/Debian\ 8.1.0\ M-A\ 1/ /mnt/virtual_hdd -o allow_other + +![Mount All File System in Linux](http://www.tecmint.com/wp-content/uploads/2015/08/Mount-All-File-System-in-Linux.png) +在Linux中挂载所有文件系统 + +**注意**:这里我们使用了所有硬盘的挂载点名称,很明显,你的挂载点名称会有所不同。也请注意“-o allow_other”选项可以让这个虚拟文件系统让其它所有人可见,而不仅仅是创建它的人。 + +4.现在,运行“df -h”来看看所有文件系统。它应该包含了你刚才创建的那个。 + + + $ df -h + +![Verify Virtual File System Mount](http://www.tecmint.com/wp-content/uploads/2015/08/Verify-Virtual-File-System.png) +验证虚拟文件系统挂载 + +你可以像对已挂在的驱动器那样给虚拟文件系统部署所有的选项。 + +5.要在每次系统启动创建这个虚拟文件系统,你应该以root身份添加下面的这行代码(在你那里会有点不同,取决于你的挂载点)到/etc/fstab文件的末尾。 + + mhddfs# /boot/efi, /, /media/avi/BD9B-5FCE/, /media/avi/Debian\ 8.1.0\ M-A\ 1/ /mnt/virtual_hdd fuse defaults,allow_other 0 0 + +6.如果在任何时候你想要添加/移除一个新的驱动器到/从虚拟硬盘,你可以挂载一个新的驱动器,拷贝/mnt/vritual_hdd的内容,卸载卷,弹出你要移除的的驱动器并/或挂载你要包含的新驱动器。使用mhddfs命令挂载全部文件系统到Virtual_hdd下,这样就全部搞定了。 +#### 我怎么卸载Virtual_hdd? #### + +卸载virtual_hdd相当简单,就像下面这样 + + # umount /mnt/virtual_hdd + +![Unmount Virtual Filesystem](http://www.tecmint.com/wp-content/uploads/2015/08/Unmount-Virtual-Filesystem.png) +卸载虚拟文件系统 + +注意,是umount,而不是unmount,很多用户都输错了。 + +到现在为止全部结束了。我正在写另外一篇文章,你们一定喜欢读的。到那时,请保持连线到Tecmint。请在下面的评论中给我们提供有用的反馈吧。请为我们点赞并分享,帮助我们扩散。 + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/combine-partitions-into-one-in-linux-using-mhddfs/ + +作者:[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/understanding-raid-setup-in-linux/ +[2]:http://www.tecmint.com/mount-filesystem-in-linux/ +[3]:http://www.tecmint.com/how-to-enable-epel-repository-for-rhel-centos-6-5/ From 3bf11430e3f94531e8aa8d686244163ffb2cb9f4 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 27 Aug 2015 10:40:18 +0800 Subject: [PATCH 475/507] translating --- .../20150826 How to Run Kali Linux 2.0 In Docker Container.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150826 How to Run Kali Linux 2.0 In Docker Container.md b/sources/tech/20150826 How to Run Kali Linux 2.0 In Docker Container.md index 8018ca17e9..15c8d1011e 100644 --- a/sources/tech/20150826 How to Run Kali Linux 2.0 In Docker Container.md +++ b/sources/tech/20150826 How to Run Kali Linux 2.0 In Docker Container.md @@ -1,3 +1,5 @@ +translating---geekpi + How to Run Kali Linux 2.0 In Docker Container ================================================================================ ### Introduction ### @@ -71,4 +73,4 @@ via: http://linuxpitstop.com/run-kali-linux-2-0-in-docker-container/ 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 [a]:http://linuxpitstop.com/author/aun/ -[1]:http://linuxpitstop.com/install-kali-linux-2-0/ \ No newline at end of file +[1]:http://linuxpitstop.com/install-kali-linux-2-0/ From f7dcc0a1b9da2726bd4d6d9e02cbea7b027c5d0c Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 27 Aug 2015 10:59:21 +0800 Subject: [PATCH 476/507] translated --- ... Run Kali Linux 2.0 In Docker Container.md | 76 ------------------- ... Run Kali Linux 2.0 In Docker Container.md | 74 ++++++++++++++++++ 2 files changed, 74 insertions(+), 76 deletions(-) delete mode 100644 sources/tech/20150826 How to Run Kali Linux 2.0 In Docker Container.md create mode 100644 translated/tech/20150826 How to Run Kali Linux 2.0 In Docker Container.md diff --git a/sources/tech/20150826 How to Run Kali Linux 2.0 In Docker Container.md b/sources/tech/20150826 How to Run Kali Linux 2.0 In Docker Container.md deleted file mode 100644 index 15c8d1011e..0000000000 --- a/sources/tech/20150826 How to Run Kali Linux 2.0 In Docker Container.md +++ /dev/null @@ -1,76 +0,0 @@ -translating---geekpi - -How to Run Kali Linux 2.0 In Docker Container -================================================================================ -### Introduction ### - -Kali Linux is a well known operating system for security testers and ethical hackers. It comes bundled with a large list of security related applications and make it easy to perform penetration testing. Recently, [Kali Linux 2.0][1] is out and it is being considered as one of the most important release for this operating system. On the other hand, Docker technology is getting massive popularity due to its scalability and ease of use. Dockers make it super easy to ship your software applications to your users. Breaking news is that you can now run Kali Linux via Dockers; let’s see how :) - -### Running Kali Linux 2.0 In Docker ### - -**Related Notes** - -If you don’t have docker installed on your system, you can do it by using the following commands: - -**For Ubuntu/Linux Mint/Debian:** - - sudo apt-get install docker - -**For Fedora/RHEL/CentOS:** - - sudo yum install docker - -**For Fedora 22:** - - dnf install docker - -You can start docker service by running: - - sudo docker start - -First of all make sure that docker service is running fine by using the following command: - - sudo docker status - -Kali Linux docker image has been uploaded online by Kali Linux development team, simply run following command to download this image to your system. - - docker pull kalilinux/kali-linux-docker - -![Pull Kali Linux docker](http://linuxpitstop.com/wp-content/uploads/2015/08/129.png) - -Once download is complete, run following command to find out the Image ID for your downloaded Kali Linux docker image file. - - docker images - -![Kali Linux Image ID](http://linuxpitstop.com/wp-content/uploads/2015/08/230.png) - -Now run following command to start your kali Linux docker container from image file (Here replace Image ID with correct one). - - docker run -i -t 198cd6df71ab3 /bin/bash - -It will immediately start the container and will log you into the operating system, you can start working on Kali Linux here. - -![Kali Linux Login](http://linuxpitstop.com/wp-content/uploads/2015/08/328.png) - -You can verify that container is started/running fine, by using the following command: - - docker ps - -![Docker Kali](http://linuxpitstop.com/wp-content/uploads/2015/08/421.png) - -### Conclusion ### - -Dockers are the smartest way to deploy and distribute your packages. Kali Linux docker image is pretty handy, does not consume any high amount of space on the disk and it is pretty easy to test this wonderful distro on any docker installed operating system now. - --------------------------------------------------------------------------------- - -via: http://linuxpitstop.com/run-kali-linux-2-0-in-docker-container/ - -作者:[Aun][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://linuxpitstop.com/author/aun/ -[1]:http://linuxpitstop.com/install-kali-linux-2-0/ diff --git a/translated/tech/20150826 How to Run Kali Linux 2.0 In Docker Container.md b/translated/tech/20150826 How to Run Kali Linux 2.0 In Docker Container.md new file mode 100644 index 0000000000..5c65ec0286 --- /dev/null +++ b/translated/tech/20150826 How to Run Kali Linux 2.0 In Docker Container.md @@ -0,0 +1,74 @@ +如何在Docker容器中运行Kali Linux 2.0 +================================================================================ +### 介绍 ### + +Kali Linux是一个对于安全测试人员和白帽的一个知名的操作系统。它带有大量安全相关的程序,这让它很容易用于渗透测试。最近,[Kali Linux 2.0][1]发布了,并且它被认为是这个操作系统最重要的一次发布。另一方面,Docker技术由于它的可扩展性和易用性让它变得很流行。Dokcer让你非常容易地将你的程序带给你的用户。好消息是你可以通过Docker运行Kali Linux了,让我们看看该怎么做:) + +### 在Docker中运行Kali Linux 2.0 ### + +**相关提示** + +如果你还没有在系统中安装docker,你可以运行下面的命令: + +**对于 Ubuntu/Linux Mint/Debian:** + + sudo apt-get install docker + +**对于 Fedora/RHEL/CentOS:** + + sudo yum install docker + +**对于 Fedora 22:** + + dnf install docker + +你可以运行下面的命令来启动docker: + + sudo docker start + +首先运行下面的命令确保服务正在运行: + + sudo docker status + +Kali Linux的开发团队已将Kali Linux的docker镜像上传了,只需要输入下面的命令来下载镜像。 + + docker pull kalilinux/kali-linux-docker + +![Pull Kali Linux docker](http://linuxpitstop.com/wp-content/uploads/2015/08/129.png) + +下载完成后,运行下面的命令来找出你下载的docker镜像的ID。 + + docker images + +![Kali Linux Image ID](http://linuxpitstop.com/wp-content/uploads/2015/08/230.png) + +现在运行下面的命令来从镜像文件启动kali linux docker容器(这里用正确的镜像ID替换)。 + + docker run -i -t 198cd6df71ab3 /bin/bash + +它会立刻启动容器并且会登录操作系统,你现在可以在Kaili Linux中工作了。 + +![Kali Linux Login](http://linuxpitstop.com/wp-content/uploads/2015/08/328.png) + +你可以通过下面的命令来验证通气已经启动/运行中了: + + docker ps + +![Docker Kali](http://linuxpitstop.com/wp-content/uploads/2015/08/421.png) + +### 总结 ### + +Docker是一种最聪明的用来部署和分发包的方式。Kali Linux docker镜像非常容易上手,也不会消耗很大的硬盘空间,这样也容易地在任何安装了docker的操作系统上测试这个很棒的发行版了。 + +-------------------------------------------------------------------------------- + +via: http://linuxpitstop.com/run-kali-linux-2-0-in-docker-container/ + +作者:[Aun][a] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://linuxpitstop.com/author/aun/ +[1]:http://linuxpitstop.com/install-kali-linux-2-0/ From 223b0022828c66ca36215a5d35aa5c474fcc31fe Mon Sep 17 00:00:00 2001 From: Chang Liu Date: Thu, 27 Aug 2015 11:53:55 +0800 Subject: [PATCH 477/507] [Translated]RHCSA Series--Part 08--Securing SSH,Setting Hostname and Enabling Network Services.md --- ... Hostname and Enabling Network Services.md | 217 ------------------ ... Hostname and Enabling Network Services.md | 215 +++++++++++++++++ 2 files changed, 215 insertions(+), 217 deletions(-) delete mode 100644 sources/tech/RHCSA Series/RHCSA Series--Part 08--Securing SSH, Setting Hostname and Enabling Network Services.md create mode 100644 translated/tech/RHCSA/RHCSA Series--Part 08--Securing SSH, Setting Hostname and Enabling Network Services.md 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 deleted file mode 100644 index 40fa771580..0000000000 --- a/sources/tech/RHCSA Series/RHCSA Series--Part 08--Securing SSH, Setting Hostname and Enabling Network Services.md +++ /dev/null @@ -1,217 +0,0 @@ -FSSlc translating - -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/ diff --git a/translated/tech/RHCSA/RHCSA Series--Part 08--Securing SSH, Setting Hostname and Enabling Network Services.md b/translated/tech/RHCSA/RHCSA Series--Part 08--Securing SSH, Setting Hostname and Enabling Network Services.md new file mode 100644 index 0000000000..82245f33b1 --- /dev/null +++ b/translated/tech/RHCSA/RHCSA Series--Part 08--Securing SSH, Setting Hostname and Enabling Network Services.md @@ -0,0 +1,215 @@ +RHCSA 系列:安全 SSH,设定主机名及开启网络服务 – Part 8 +================================================================================ +作为一名系统管理员,你将经常使用一个终端模拟器来登陆到一个远程的系统中,执行一系列的管理任务。你将很少有机会坐在一个真实的(物理)终端前,所以你需要设定好一种方法来使得你可以登陆到你被要求去管理的那台远程主机上。 + +事实上,当你必须坐在一台物理终端前的时候,就可能是你登陆到该主机的最后一种方法。基于安全原因,使用 Telnet 来达到以上目的并不是一个好主意,因为穿行在线缆上的流量并没有被加密,它们以文本方式在传送。 + +另外,在这篇文章中,我们也将复习如何配置网络服务来使得它在开机时被自动开启,并学习如何设置网络和静态或动态地解析主机名。 + +![RHCSA: 安全 SSH 和开启网络服务](http://www.tecmint.com/wp-content/uploads/2015/05/Secure-SSH-Server-and-Enable-Network-Services.png) + +RHCSA: 安全 SSH 和开启网络服务 – Part 8 + +### 安装并确保 SSH 通信安全 ### + +对于你来说,要能够使用 SSH 远程登陆到一个 RHEL 7 机子,你必须安装 `openssh`,`openssh-clients` 和 `openssh-servers` 软件包。下面的命令不仅将安装远程登陆程序,也会安装安全的文件传输工具以及远程文件复制程序: + + # yum update && yum install openssh openssh-clients openssh-servers + +注意,安装上服务器所需的相应软件包是一个不错的主意,因为或许在某个时刻,你想使用同一个机子来作为客户端和服务器。 + +在安装完成后,如若你想安全地访问你的 SSH 服务器,你还需要考虑一些基本的事情。下面的设定应该在文件 `/etc/ssh/sshd_config` 中得以呈现。 + +1. 更改 sshd 守护进程的监听端口,从 22(默认的端口值)改为一个更高的端口值(2000 或更大),但首先要确保所选的端口没有被占用。 + +例如,让我们假设你选择了端口 2500 。使用 [netstat][1] 来检查所选的端口是否被占用: + + # netstat -npltu | grep 2500 + +假如 netstat 没有返回任何信息,则你可以安全地为 sshd 使用端口 2500,并且你应该在上面的配置文件中更改端口的设定,具体如下: + + Port 2500 + +2. 只允许协议 2: + + Protocol 2 + +3. 配置验证超时的时间为 2 分钟,不允许以 root 身份登陆,并将允许通过 ssh 登陆的人数限制到最小: + + LoginGraceTime 2m + PermitRootLogin no + AllowUsers gacanepa + +4. 假如可能,使用基于公钥的验证方式而不是使用密码: + + PasswordAuthentication no + RSAAuthentication yes + PubkeyAuthentication yes + +这假设了你已经在你的客户端机子上创建了带有你的用户名的一个密钥对,并将公钥复制到了你的服务器上。 + +- [开启 SSH 无密码登陆][2] + +### 配置网络和名称的解析 ### + +1. 每个系统管理员应该对下面这个系统配置文件非常熟悉: + +- /etc/hosts 被用来在小型网络中解析名称 <---> IP 地址。 + +文件 `/etc/hosts` 中的每一行拥有如下的结构: + + IP address - Hostname - FQDN + +例如, + + 192.168.0.10 laptop laptop.gabrielcanepa.com.ar + +2. `/etc/resolv.conf` 特别指定 DNS 服务器的 IP 地址和搜索域,它被用来在没有提供域名后缀时,将一个给定的查询名称对应为一个全称域名。 + +在正常情况下,你不必编辑这个文件,因为它是由系统管理的。然而,若你非要改变 DNS 服务器的 IP 地址,建议你在该文件的每一行中,都应该遵循下面的结构: + + nameserver - IP address + +例如, + + nameserver 8.8.8.8 + +3. `/etc/host.conf` 特别指定在一个网络中主机名被解析的方法和顺序。换句话说,告诉名称解析器使用哪个服务,并以什么顺序来使用。 + +尽管这个文件由几个选项,但最为常见和基本的设置包含如下的一行: + + order bind,hosts + +它意味着解析器应该首先查看 `resolv.conf` 中特别指定的域名服务器,然后到 `/etc/hosts` 文件中查找解析的名称。 + +4. `/etc/sysconfig/network` 包含了所有网络接口的路由和全局主机信息。下面的值可能会被使用: + + NETWORKING=yes|no + HOSTNAME=value + +其中的 value 应该是全称域名(FQDN)。 + + GATEWAY=XXX.XXX.XXX.XXX + +其中的 XXX.XXX.XXX.XXX 是网关的 IP 地址。 + + GATEWAYDEV=value + +在一个带有多个网卡的机器中, value 为网关设备名,例如 enp0s3。 + +5. 位于 `/etc/sysconfig/network-scripts` 中的文件(网络适配器配置文件)。 + +在上面提到的目录中,你将找到几个被命名为如下格式的文本文件。 + + ifcfg-name + +其中 name 为网卡的名称,由 `ip link show` 返回: + +![检查网络连接状态](http://www.tecmint.com/wp-content/uploads/2015/05/Check-IP-Address.png) + +检查网络连接状态 + +例如: + +![网络文件](http://www.tecmint.com/wp-content/uploads/2015/05/Network-Files.png) + +网络文件 + +除了环回接口,你还可以为你的网卡进行一个相似的配置。注意,假如设定了某些变量,它们将为这个特别的接口,覆盖掉 `/etc/sysconfig/network` 中定义的值。在这篇文章中,为了能够解释清楚,每行都被加上了注释,但在实际的文件中,你应该避免加上注释: + + 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 + +### 设定主机名 ### + +在 RHEL 7 中, `hostnamectl` 命令被同时用来查询和设定系统的主机名。 + +要展示当前的主机名,输入: + + # hostnamectl status + +![在RHEL 7 中检查系统的主机名](http://www.tecmint.com/wp-content/uploads/2015/05/Check-System-hostname.png) + +检查系统的主机名 + +要更改主机名,使用 + + # hostnamectl set-hostname [new hostname] + +例如, + + # hostnamectl set-hostname cinderella + +要想使得更改生效,你需要重启 hostnamed 守护进程(这样你就不必因为要应用更改而登出系统并再登陆系统): + + # systemctl restart systemd-hostnamed + +![在 RHEL7 中设定系统主机名](http://www.tecmint.com/wp-content/uploads/2015/05/Set-System-Hostname.png) + +设定系统主机名 + +另外, RHEL 7 还包含 `nmcli` 工具,它可被用来达到相同的目的。要展示主机名,运行: + + # nmcli general hostname + +且要改变主机名,则运行: + + # nmcli general hostname [new hostname] + +例如, + + # nmcli general hostname rhel7 + +![使用 nmcli 命令来设定主机名](http://www.tecmint.com/wp-content/uploads/2015/05/nmcli-command.png) + +使用 nmcli 命令来设定主机名 + +### 在开机时开启网络服务 ### + +作为本文的最后部分,就让我们看看如何确保网络服务在开机时被自动开启。简单来说,这个可通过创建符号链接到某些由服务的配置文件中的 [Install] 小节中指定的文件来实现。 + +以 firewalld(/usr/lib/systemd/system/firewalld.service) 为例: + + [Install] + WantedBy=basic.target + Alias=dbus-org.fedoraproject.FirewallD1.service + +要开启该服务,运行: + + # systemctl enable firewalld + +另一方面,要禁用 firewalld,则需要移除符号链接: + + # systemctl disable firewalld + +![在开机时开启服务](http://www.tecmint.com/wp-content/uploads/2015/05/Enable-Service-at-System-Boot.png) + +在开机时开启服务 + +### 总结 ### + +在这篇文章中,我们总结了如何安装 SSH 及使用它安全地连接到一个 RHEL 服务器,如何改变主机名,并在最后如何确保在系统启动时开启服务。假如你注意到某个服务启动失败,你可以使用 `systemctl status -l [service]` 和 `journalctl -xn` 来进行排错。 + +请随意使用下面的评论框来让我们知晓你对本文的看法。提问也同样欢迎。我们期待着你的反馈! + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/rhcsa-series-secure-ssh-set-hostname-enable-network-services-in-rhel-7/ + +作者:[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/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 From 8bb04b7614a497065fa820b2576dc4aeb84e00cb Mon Sep 17 00:00:00 2001 From: Chang Liu Date: Thu, 27 Aug 2015 11:59:36 +0800 Subject: [PATCH 478/507] Update RHCSA Series--Part 09--Installing, Configuring and Securing a Web and FTP Server.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 继续翻译该系列。 --- ...stalling, Configuring and Securing a Web and FTP Server.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 index 6a1e544de3..437612f124 100644 --- 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 @@ -1,3 +1,5 @@ +FSSlc Translating + 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. @@ -173,4 +175,4 @@ via: http://www.tecmint.com/rhcsa-series-install-and-secure-apache-web-server-an [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 +[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 From 95cf2c6be1ca32d22b42c4a34deda014f0f01ea3 Mon Sep 17 00:00:00 2001 From: wxy Date: Thu, 27 Aug 2015 13:09:10 +0800 Subject: [PATCH 479/507] PUB:Part 4 - Creating RAID 5 (Striping with Distributed Parity) in Linux @strugglingyouth --- ...iping with Distributed Parity) in Linux.md | 163 +++++++++--------- 1 file changed, 79 insertions(+), 84 deletions(-) rename {translated/tech/RAID => published}/Part 4 - Creating RAID 5 (Striping with Distributed Parity) in Linux.md (50%) diff --git a/translated/tech/RAID/Part 4 - Creating RAID 5 (Striping with Distributed Parity) in Linux.md b/published/Part 4 - Creating RAID 5 (Striping with Distributed Parity) in Linux.md similarity index 50% rename from translated/tech/RAID/Part 4 - Creating RAID 5 (Striping with Distributed Parity) in Linux.md rename to published/Part 4 - Creating RAID 5 (Striping with Distributed Parity) in Linux.md index 7de5199a08..34ac7f18b2 100644 --- a/translated/tech/RAID/Part 4 - Creating RAID 5 (Striping with Distributed Parity) in Linux.md +++ b/published/Part 4 - Creating RAID 5 (Striping with Distributed Parity) in Linux.md @@ -1,89 +1,90 @@ - -在 Linux 中创建 RAID 5(条带化与分布式奇偶校验) - 第4部分 +在 Linux 下使用 RAID(四):创建 RAID 5(条带化与分布式奇偶校验) ================================================================================ -在 RAID 5 中,条带化数据跨多个驱磁盘使用分布式奇偶校验。分布式奇偶校验的条带化意味着它将奇偶校验信息和条带中的数据分布在多个磁盘上,它将有很好的数据冗余。 + +在 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 +*在 Linux 中配置 RAID 5* -对于此 RAID 级别它至少应该有三个或更多个磁盘。RAID 5 通常被用于大规模生产环境中花费更多的成本来提供更好的数据冗余性能。 +对于此 RAID 级别它至少应该有三个或更多个磁盘。RAID 5 通常被用于大规模生产环境中,以花费更多的成本来提供更好的数据冗余性能。 #### 什么是奇偶校验? #### -奇偶校验是在数据存储中检测错误最简单的一个方法。奇偶校验信息存储在每个磁盘中,比如说,我们有4个磁盘,其中一个磁盘空间被分割去存储所有磁盘的奇偶校验信息。如果任何一个磁盘出现故障,我们可以通过更换故障磁盘后,从奇偶校验信息重建得到原来的数据。 +奇偶校验是在数据存储中检测错误最简单的常见方式。奇偶校验信息存储在每个磁盘中,比如说,我们有4个磁盘,其中相当于一个磁盘大小的空间被分割去存储所有磁盘的奇偶校验信息。如果任何一个磁盘出现故障,我们可以通过更换故障磁盘后,从奇偶校验信息重建得到原来的数据。 #### RAID 5 的优点和缺点 #### -- 提供更好的性能 +- 提供更好的性能。 - 支持冗余和容错。 - 支持热备份。 -- 将失去一个磁盘的容量存储奇偶校验信息。 +- 将用掉一个磁盘的容量存储奇偶校验信息。 - 单个磁盘发生故障后不会丢失数据。我们可以更换故障硬盘后从奇偶校验信息中重建数据。 -- 事务处理读操作会更快。 -- 由于奇偶校验占用资源,写操作将是缓慢的。 +- 适合于面向事务处理的环境,读操作会更快。 +- 由于奇偶校验占用资源,写操作会慢一些。 - 重建需要很长的时间。 #### 要求 #### + 创建 RAID 5 最少需要3个磁盘,你也可以添加更多的磁盘,前提是你要有多端口的专用硬件 RAID 控制器。在这里,我们使用“mdadm”包来创建软件 RAID。 -mdadm 是一个允许我们在 Linux 下配置和管理 RAID 设备的包。默认情况下 RAID 没有可用的配置文件,我们在创建和配置 RAID 后必须将配置文件保存在一个单独的文件中,例如:mdadm.conf。 +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] +- [介绍 RAID 的级别和概念][1] +- [使用 mdadm 工具创建软件 RAID 0 (条带化)][2] +- [用两块磁盘创建 RAID 1(镜像)][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 + 操作系统 : CentOS 6.5 Final + IP 地址 : 192.168.0.227 + 主机名 : rd5.tecmintlocal.com + 磁盘 1 [20GB] : /dev/sdb + 磁盘 2 [20GB] : /dev/sdc + 磁盘 3 [20GB] : /dev/sdd -这篇文章是 RAID 系列9教程的第4部分,在这里我们要建立一个软件 RAID 5(分布式奇偶校验)使用三个20GB(名为/dev/sdb, /dev/sdc 和 /dev/sdd)的磁盘在 Linux 系统或服务器中上。 +这是9篇系列教程的第4部分,在这里我们要在 Linux 系统或服务器上使用三个20GB(名为/dev/sdb, /dev/sdc 和 /dev/sdd)的磁盘建立带有分布式奇偶校验的软件 RAID 5。 ### 第1步:安装 mdadm 并检验磁盘 ### -1.正如我们前面所说,我们使用 CentOS 6.5 Final 版本来创建 RAID 设置,但同样的做法也适用于其他 Linux 发行版。 +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 摘要 +*CentOS 6.5 摘要* -2. 如果你按照我们的 RAID 系列去配置的,我们假设你已经安装了“mdadm”包,如果没有,根据你的 Linux 发行版使用下面的命令安装。 +2、 如果你按照我们的 RAID 系列去配置的,我们假设你已经安装了“mdadm”包,如果没有,根据你的 Linux 发行版使用下面的命令安装。 - # yum install mdadm [on RedHat systems] - # apt-get install mdadm [on Debain systems] + # yum install mdadm [在 RedHat 系统] + # apt-get install mdadm [在 Debain 系统] -3. “mdadm”包安装后,先使用‘fdisk‘命令列出我们在系统上增加的三个20GB的硬盘。 +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 工具 +*安装 mdadm 工具* -4. 现在该检查这三个磁盘是否存在 RAID 块,使用下面的命令来检查。 +4、 现在该检查这三个磁盘是否存在 RAID 块,使用下面的命令来检查。 # mdadm -E /dev/sd[b-d] - # mdadm --examine /dev/sdb /dev/sdc /dev/sdd + # 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 磁盘* **注意**: 上面的图片说明,没有检测到任何超级块。所以,这三个磁盘中没有定义 RAID。让我们现在开始创建一个吧! ### 第2步:为磁盘创建 RAID 分区 ### -5. 首先,在创建 RAID 前我们要为磁盘分区(/dev/sdb, /dev/sdc 和 /dev/sdd),在进行下一步之前,先使用‘fdisk’命令进行分区。 +5、 首先,在创建 RAID 前磁盘(/dev/sdb, /dev/sdc 和 /dev/sdd)必须有分区,因此,在进行下一步之前,先使用`fdisk`命令进行分区。 # fdisk /dev/sdb # fdisk /dev/sdc @@ -93,20 +94,20 @@ CentOS 6.5 摘要 请按照下面的说明在 /dev/sdb 硬盘上创建分区。 -- 按 ‘n’ 创建新的分区。 -- 然后按 ‘P’ 选择主分区。选择主分区是因为还没有定义过分区。 -- 接下来选择分区号为1。默认就是1. +- 按 `n` 创建新的分区。 +- 然后按 `P` 选择主分区。选择主分区是因为还没有定义过分区。 +- 接下来选择分区号为1。默认就是1。 - 这里是选择柱面大小,我们没必要选择指定的大小,因为我们需要为 RAID 使用整个分区,所以只需按两次 Enter 键默认将整个容量分配给它。 -- 然后,按 ‘P’ 来打印创建好的分区。 -- 改变分区类型,按 ‘L’可以列出所有可用的类型。 -- 按 ‘t’ 修改分区类型。 -- 这里使用‘fd’设置为 RAID 的类型。 -- 然后再次使用‘p’查看我们所做的更改。 -- 使用‘w’保存更改。 +- 然后,按 `P` 来打印创建好的分区。 +- 改变分区类型,按 `L`可以列出所有可用的类型。 +- 按 `t` 修改分区类型。 +- 这里使用`fd`设置为 RAID 的类型。 +- 然后再次使用`p`查看我们所做的更改。 +- 使用`w`保存更改。 ![Create sdb Partition](http://www.tecmint.com/wp-content/uploads/2014/11/Create-sdb-Partition1.png) -创建 sdb 分区 +*创建 sdb 分区* **注意**: 我们仍要按照上面的步骤来创建 sdc 和 sdd 的分区。 @@ -118,7 +119,7 @@ CentOS 6.5 摘要 ![Create sdc Partition](http://www.tecmint.com/wp-content/uploads/2014/11/Create-sdc-Partition1.png) -创建 sdc 分区 +*创建 sdc 分区* #### 创建 /dev/sdd 分区 #### @@ -126,93 +127,87 @@ CentOS 6.5 摘要 ![Create sdd Partition](http://www.tecmint.com/wp-content/uploads/2014/11/Create-sdd-Partition1.png) -创建 sdd 分区 +*创建 sdd 分区* -6. 创建分区后,检查三个磁盘 sdb, sdc, sdd 的变化。 +6、 创建分区后,检查三个磁盘 sdb, sdc, sdd 的变化。 # mdadm --examine /dev/sdb /dev/sdc /dev/sdd - - or - - # mdadm -E /dev/sd[b-c] + # 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 的设置在这些磁盘中。 +7、 现在在新创建的分区检查 RAID 块。如果没有检测到超级块,我们就能够继续下一步,在这些磁盘中创建一个新的 RAID 5 配置。 ![Check Raid on Partition](http://www.tecmint.com/wp-content/uploads/2014/11/Check-Raid-on-Partitions.png) -在分区中检查 Raid +*在分区中检查 RAID * ### 第3步:创建 md 设备 md0 ### -8. 现在创建一个 RAID 设备“md0”(即 /dev/md0)使用所有新创建的分区(sdb1, sdc1 and sdd1) ,使用以下命令。 +8、 现在使用所有新创建的分区(sdb1, sdc1 和 sdd1)创建一个 RAID 设备“md0”(即 /dev/md0),使用以下命令。 # 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 + # mdadm -C /dev/md0 -l=5 -n=3 /dev/sd[b-d]1 # 或 -9. 创建 RAID 设备后,检查并确认 RAID,包括设备和从 mdstat 中输出的 RAID 级别。 +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 设备 +*验证 Raid 设备* -如果你想监视当前的创建过程,你可以使用‘watch‘命令,使用 watch ‘cat /proc/mdstat‘,它会在屏幕上显示且每隔1秒刷新一次。 +如果你想监视当前的创建过程,你可以使用`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 构建过程* ![Raid 5 Process Summary](http://www.tecmint.com/wp-content/uploads/2014/11/Raid-Process-Summary.png) -Raid 5 过程概要 +*Raid 5 过程概要* -10. 创建 RAID 后,使用以下命令验证 RAID 设备 +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 级别 +*验证 Raid 级别* **注意**: 因为它显示三个磁盘的信息,上述命令的输出会有点长。 -11. 接下来,验证 RAID 阵列的假设,这包含正在运行 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 阵列 +*验证 RAID 阵列* ### 第4步:为 md0 创建文件系统### -12. 在挂载前为“md0”设备创建 ext4 文件系统。 +12、 在挂载前为“md0”设备创建 ext4 文件系统。 # mkfs.ext4 /dev/md0 ![Create md0 Filesystem](http://www.tecmint.com/wp-content/uploads/2014/11/Create-md0-Filesystem.png) -创建 md0 文件系统 +*创建 md0 文件系统* -13.现在,在‘/mnt‘下创建目录 raid5,然后挂载文件系统到 /mnt/raid5/ 下并检查下挂载点的文件,你会看到 lost+found 目录。 +13、 现在,在`/mnt`下创建目录 raid5,然后挂载文件系统到 /mnt/raid5/ 下,并检查挂载点下的文件,你会看到 lost+found 目录。 # mkdir /mnt/raid5 # mount /dev/md0 /mnt/raid5/ # ls -l /mnt/raid5/ -14. 在挂载点 /mnt/raid5 下创建几个文件,并在其中一个文件中添加一些内容然后去验证。 +14、 在挂载点 /mnt/raid5 下创建几个文件,并在其中一个文件中添加一些内容然后去验证。 # touch /mnt/raid5/raid5_tecmint_{1..5} # ls -l /mnt/raid5/ @@ -222,9 +217,9 @@ Raid 5 过程概要 ![Mount Raid 5 Device](http://www.tecmint.com/wp-content/uploads/2014/11/Mount-Raid-Device.png) -挂载 Raid 设备 +*挂载 RAID 设备* -15. 我们需要在 fstab 中添加条目,否则系统重启后将不会显示我们的挂载点。然后编辑 fstab 文件添加条目,在文件尾追加以下行,如下图所示。挂载点会根据你环境的不同而不同。 +15、 我们需要在 fstab 中添加条目,否则系统重启后将不会显示我们的挂载点。编辑 fstab 文件添加条目,在文件尾追加以下行。挂载点会根据你环境的不同而不同。 # vim /etc/fstab @@ -232,19 +227,19 @@ Raid 5 过程概要 ![Raid 5 Automount](http://www.tecmint.com/wp-content/uploads/2014/11/Raid-Device-Automount.png) -自动挂载 Raid 5 +*自动挂载 RAID 5* -16. 接下来,运行‘mount -av‘命令检查 fstab 条目中是否有错误。 +16、 接下来,运行`mount -av`命令检查 fstab 条目中是否有错误。 # mount -av ![Check Fstab Errors](http://www.tecmint.com/wp-content/uploads/2014/11/Check-Fstab-Errors.png) -检查 Fstab 错误 +*检查 Fstab 错误* ### 第5步:保存 Raid 5 的配置 ### -17. 在前面章节已经说过,默认情况下 RAID 没有配置文件。我们必须手动保存。如果此步不跟 RAID 设备将不会存在 md0,它将会跟一些其他数子。 +17、 在前面章节已经说过,默认情况下 RAID 没有配置文件。我们必须手动保存。如果此步中没有跟随不属于 md0 的 RAID 设备,它会是一些其他随机数字。 所以,我们必须要在系统重新启动之前保存配置。如果配置保存它在系统重新启动时会被加载到内核中然后 RAID 也将被加载。 @@ -252,17 +247,17 @@ Raid 5 过程概要 ![Save Raid 5 Configuration](http://www.tecmint.com/wp-content/uploads/2014/11/Save-Raid-5-Configuration.png) -保存 Raid 5 配置 +*保存 RAID 5 配置* -注意:保存配置将保持 RAID 级别的稳定性在 md0 设备中。 +注意:保存配置将保持 md0 设备的 RAID 级别稳定不变。 ### 第6步:添加备用磁盘 ### -18.备用磁盘有什么用?它是非常有用的,如果我们有一个备用磁盘,当我们阵列中的任何一个磁盘发生故障后,这个备用磁盘会主动添加并重建进程,并从其他磁盘上同步数据,所以我们可以在这里看到冗余。 +18、 备用磁盘有什么用?它是非常有用的,如果我们有一个备用磁盘,当我们阵列中的任何一个磁盘发生故障后,这个备用磁盘会进入激活重建过程,并从其他磁盘上同步数据,这样就有了冗余。 更多关于添加备用磁盘和检查 RAID 5 容错的指令,请阅读下面文章中的第6步和第7步。 -- [Add Spare Drive to Raid 5 Setup][4] +- [在 RAID 5 中添加备用磁盘][4] ### 结论 ### @@ -274,12 +269,12 @@ via: http://www.tecmint.com/create-raid-5-in-linux/ 作者:[Babin Lonston][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/) 荣誉推出 [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/ +[1]:https://linux.cn/article-6085-1.html +[2]:https://linux.cn/article-6087-1.html +[3]:https://linux.cn/article-6093-1.html [4]:http://www.tecmint.com/create-raid-6-in-linux/ From 3ea905d9e58574f61849d3f93091293016435083 Mon Sep 17 00:00:00 2001 From: DeadFire Date: Thu, 27 Aug 2015 15:34:16 +0800 Subject: [PATCH 480/507] =?UTF-8?q?20150827-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...Download Manager Updated With Fresh GUI.md | 67 ++++++++ ... DEB and DEB to RPM Package Using Alien.md | 159 ++++++++++++++++++ 2 files changed, 226 insertions(+) create mode 100644 sources/share/20150827 Xtreme Download Manager Updated With Fresh GUI.md create mode 100644 sources/tech/20150827 How to Convert From RPM to DEB and DEB to RPM Package Using Alien.md diff --git a/sources/share/20150827 Xtreme Download Manager Updated With Fresh GUI.md b/sources/share/20150827 Xtreme Download Manager Updated With Fresh GUI.md new file mode 100644 index 0000000000..767c2fdcd4 --- /dev/null +++ b/sources/share/20150827 Xtreme Download Manager Updated With Fresh GUI.md @@ -0,0 +1,67 @@ +Xtreme Download Manager Updated With Fresh GUI +================================================================================ +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/08/Xtreme-Download-Manager-Linux.jpg) + +[Xtreme Download Manager][1], unarguably one of the [best download managers for Linux][2], has a new version named XDM 2015 which brings a fresh new look to it. + +Xtreme Download Manager, also known as XDM or XDMAN, is a popular cross-platform download manager available for Linux, Windows and Mac OS X. It is also compatible with all major web browsers such as Chrome, Firefox, Safari enabling you to download directly from XDM when you try to download something in your web browser. + +Applications such as XDM are particularly useful when you have slow/limited network connectivity and you need to manage your downloads. Imagine downloading a huge file from internet on a slow network. What if you could pause and resume the download at will? XDM helps you in such situations. + +Some of the main features of XDM are: + +- Pause and resume download +- [Download videos from YouTube][3] and other video sites +- Force assemble +- Download speed acceleration +- Schedule downloads +- Limit download speed +- Web browser integration +- Support for proxy servers + +Here you can see the difference between the old and new XDM. + +![Old XDM](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/08/Xtreme-Download-Manager-700x400_c.jpg) + +Old XDM + +![New XDM](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/08/Xtreme_Download_Manager.png) + +New XDM + +### Install Xtreme Download Manager in Ubuntu based Linux distros ### + +Thanks to the PPA by Noobslab, you can easily install Xtreme Download Manager using the commands below. XDM requires Java but thanks to the PPA, you don’t need to bother with installing dependencies separately. + + sudo add-apt-repository ppa:noobslab/apps + sudo apt-get update + sudo apt-get install xdman + +The above PPA should be available for Ubuntu and other Ubuntu based Linux distributions such as Linux Mint, elementary OS, Linux Lite etc. + +#### Remove XDM #### + +To remove XDM (installed using the PPA), use the commands below: + + sudo apt-get remove xdman + sudo add-apt-repository --remove ppa:noobslab/apps + +For other Linux distributions, you can download it from the link below: + +- [Download Xtreme Download Manager][4] + +-------------------------------------------------------------------------------- + +via: http://itsfoss.com/xtreme-download-manager-install/ + +作者:[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://xdman.sourceforge.net/ +[2]:http://itsfoss.com/4-best-download-managers-for-linux/ +[3]:http://itsfoss.com/download-youtube-videos-ubuntu/ +[4]:http://xdman.sourceforge.net/download.html \ No newline at end of file diff --git a/sources/tech/20150827 How to Convert From RPM to DEB and DEB to RPM Package Using Alien.md b/sources/tech/20150827 How to Convert From RPM to DEB and DEB to RPM Package Using Alien.md new file mode 100644 index 0000000000..2d3f203676 --- /dev/null +++ b/sources/tech/20150827 How to Convert From RPM to DEB and DEB to RPM Package Using Alien.md @@ -0,0 +1,159 @@ +How to Convert From RPM to DEB and DEB to RPM Package Using Alien +================================================================================ +As I’m sure you already know, there are plenty of ways to install software in Linux: using the package management system provided by your distribution ([aptitude, yum, or zypper][1], to name a few examples), compiling from source (though somewhat rare these days, it was the only method available during the early days of Linux), or utilizing a low level tool such as dpkg or rpm with .deb and .rpm standalone, precompiled packages, respectively. + +![Convert RPM to DEB and DEB to RPM](http://www.tecmint.com/wp-content/uploads/2015/08/Convert-RPM-to-DEB-and-DEB-to-RPM.png) + +Convert RPM to DEB and DEB to RPM Package Using Alien + +In this article we will introduce you to alien, a tool that converts between different Linux package formats, with .rpm to .deb (and vice versa) being the most common usage. + +This tool, even when its author is no longer maintaining it and states in his website that alien will always probably remain in experimental status, can come in handy if you need a certain type of package but can only find that program in another package format. + +For example, alien saved my day once when I was looking for a .deb driver for a inkjet printer and couldn’t find any – the manufacturer only provided a .rpm package. I installed alien, converted the package, and before long I was able to use my printer without issues. + +That said, we must clarify that this utility should not be used to replace important system files and libraries since they are set up differently across distributions. Only use alien as a last resort if the suggested installation methods at the beginning of this article are out of the question for the required program. + +Last but not least, we must note that even though we will use CentOS and Debian in this article, alien is also known to work in Slackware and even in Solaris, besides the first two distributions and their respective families. + +### Step 1: Installing Alien and Dependencies ### + +To install alien in CentOS/RHEL 7, you will need to enable the EPEL and the Nux Dextop (yes, it’s Dextop – not Desktop) repositories, in that order: + + # yum install epel-release + # rpm --import http://li.nux.ro/download/nux/RPM-GPG-KEY-nux.ro + +The latest version of the package that enables this repository is currently 0.5 (published on Aug. 10, 2015). You should check [http://li.nux.ro/download/nux/dextop/el7/x86_64/][2] to see whether there’s a newer version before proceeding further: + + # rpm -Uvh http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-5.el7.nux.noarch.rpm + +then do, + + # yum update && yum install alien + +In Fedora, you will only need to run the last command. + +In Debian and derivatives, simply do: + + # aptitude install alien + +### Step 2: Converting from .deb to .rpm Package ### + +For this test we have chosen dateutils, which provides a set of date and time utilities to deal with large amounts of financial data. We will download the .deb package to our CentOS 7 box, convert it to .rpm and install it: + +![Check CentOS Version](http://www.tecmint.com/wp-content/uploads/2015/08/Check-Linux-OS-Version.png) + +Check CentOS Version + + # cat /etc/centos-release + # wget http://ftp.us.debian.org/debian/pool/main/d/dateutils/dateutils_0.3.1-1.1_amd64.deb + # alien --to-rpm --scripts dateutils_0.3.1-1.1_amd64.deb + +![Convert .deb to .rpm package in Linux](http://www.tecmint.com/wp-content/uploads/2015/08/Convert-deb-to-rpm-package.png) + +Convert .deb to .rpm package in Linux + +**Important**: (Please note how, by default, alien increases the version minor number of the target package. If you want to override this behavior, add the –keep-version flag). + +If we try to install the package right away, we will run into a slight issue: + + # rpm -Uvh dateutils-0.3.1-2.1.x86_64.rpm + +![Install RPM Package](http://www.tecmint.com/wp-content/uploads/2015/08/Install-RPM-Package.png) + +Install RPM Package + +To solve this issue, we will enable the epel-testing repository and install the rpmrebuild utility to edit the settings of the package to be rebuilt: + + # yum --enablerepo=epel-testing install rpmrebuild + +Then run, + + # rpmrebuild -pe dateutils-0.3.1-2.1.x86_64.rpm + +Which will open up your default text editor. Go to the `%files` section and delete the lines that refer to the directories mentioned in the error message, then save the file and exit: + +![Convert .deb to Alien Version](http://www.tecmint.com/wp-content/uploads/2015/08/Convert-Deb-Package-to-Alien-Version.png) + +Convert .deb to Alien Version + +When you exit the file you will be prompted to continue with the rebuild. If you choose Y, the file will be rebuilt into the specified directory (different than the current working directory): + + # rpmrebuild –pe dateutils-0.3.1-2.1.x86_64.rpm + +![Build RPM Package](http://www.tecmint.com/wp-content/uploads/2015/08/Build-RPM-Package.png) + +Build RPM Package + +Now you can proceed to install the package and verify as usual: + + # rpm -Uvh /root/rpmbuild/RPMS/x86_64/dateutils-0.3.1-2.1.x86_64.rpm + # rpm -qa | grep dateutils + +![Install Build RPM Package](http://www.tecmint.com/wp-content/uploads/2015/08/Install-Build-RPM-Package.png) + +Install Build RPM Package + +Finally, you can list the individual tools that were included with dateutils and alternatively check their respective man pages: + + # ls -l /usr/bin | grep dateutils + +![Verify Installed RPM Package](http://www.tecmint.com/wp-content/uploads/2015/08/Verify-Installed-Package.png) + +Verify Installed RPM Package + +### Step 3: Converting from .rpm to .deb Package ### + +In this section we will illustrate how to convert from .rpm to .deb. In a 32-bit Debian Wheezy box, let’s download the .rpm package for the zsh shell from the CentOS 6 OS repository. Note that this shell is not available by default in Debian and derivatives. + + # cat /etc/shells + # lsb_release -a | tail -n 4 + +![Check Shell and Debian OS Version](http://www.tecmint.com/wp-content/uploads/2015/08/Check-Shell-Debian-OS-Version.png) + +Check Shell and Debian OS Version + + # wget http://mirror.centos.org/centos/6/os/i386/Packages/zsh-4.3.11-4.el6.centos.i686.rpm + # alien --to-deb --scripts zsh-4.3.11-4.el6.centos.i686.rpm + +You can safely disregard the messages about a missing signature: + +![Convert .rpm to .deb Package](http://www.tecmint.com/wp-content/uploads/2015/08/Convert-rpm-to-deb-Package.png) + +Convert .rpm to .deb Package + +After a few moments, the .deb file should have been generated and be ready to install: + + # dpkg -i zsh_4.3.11-5_i386.deb + +![Install RPM Converted Deb Package](http://www.tecmint.com/wp-content/uploads/2015/08/Install-Deb-Package.png) + +Install RPM Converted Deb Package + +After the installation, you can verify that zsh is added to the list of valid shells: + + # cat /etc/shells + +![Confirm Installed Zsh Package](http://www.tecmint.com/wp-content/uploads/2015/08/Confirm-Installed-Package.png) + +Confirm Installed Zsh Package + +### Summary ### + +In this article we have explained how to convert from .rpm to .deb and vice versa to install packages as a last resort when such programs are not available in the repositories or as distributable source code. You will want to bookmark this article because all of us will need alien at one time or another. + +Feel free to share your thoughts about this article using the form below. + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/convert-from-rpm-to-deb-and-deb-to-rpm-package-using-alien/ + +作者:[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/linux-package-management/ +[2]:http://li.nux.ro/download/nux/dextop/el7/x86_64/ \ No newline at end of file From ef6c926d18b3617c8a0d65cd04cf28c58ee19ea1 Mon Sep 17 00:00:00 2001 From: DeadFire Date: Thu, 27 Aug 2015 16:02:02 +0800 Subject: [PATCH 481/507] =?UTF-8?q?20150827-2=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...The Strangest Most Unique Linux Distros.md | 67 ++++++++ ... or UNIX--Bash Read a File Line By Line.md | 162 ++++++++++++++++++ 2 files changed, 229 insertions(+) create mode 100644 sources/talk/20150827 The Strangest Most Unique Linux Distros.md create mode 100644 sources/tech/20150827 Linux or UNIX--Bash Read a File Line By Line.md diff --git a/sources/talk/20150827 The Strangest Most Unique Linux Distros.md b/sources/talk/20150827 The Strangest Most Unique Linux Distros.md new file mode 100644 index 0000000000..04ff47952a --- /dev/null +++ b/sources/talk/20150827 The Strangest Most Unique Linux Distros.md @@ -0,0 +1,67 @@ +The Strangest, Most Unique Linux Distros +================================================================================ +From the most consumer focused distros like Ubuntu, Fedora, Mint or elementary OS to the more obscure, minimal and enterprise focused ones such as Slackware, Arch Linux or RHEL, I thought I've seen them all. Couldn't have been any further from the truth. Linux eco-system is very diverse. There's one for everyone. Let's discuss the weird and wacky world of niche Linux distros that represents the true diversity of open platforms. + +![strangest linux distros](http://2.bp.blogspot.com/--cSL2-6rIgA/VcwNc5hFebI/AAAAAAAAJzk/AgB55mVtJVQ/s1600/Puppy-Linux.png) + +**Puppy Linux**: An operating system which is about 1/10th the size of an average DVD quality movie rip, that's Puppy Linux for you. The OS is just 100 MB in size! And it can run from RAM making it unusually fast even in older PCs. You can even remove the boot medium after the operating system has started! Can it get any better than that? System requirements are bare minimum, most hardware are automatically detected, and it comes loaded with software catering to your basic needs. [Experience Puppy Linux][1]. + +![suicide linux](http://3.bp.blogspot.com/-dfeehRIQKpo/VdMgRVQqIJI/AAAAAAAAJz0/TmBs-n2K9J8/s1600/suicide-linux.jpg) + +**Suicide Linux**: Did the name scare you? Well it should. 'Any time - any time - you type any remotely incorrect command, the interpreter creatively resolves it into rm -rf / and wipes your hard drive'. Simple as that. I really want to know the ones who are confident enough to risk their production machines with [Suicide Linux][2]. **Warning: DO NOT try this on production machines!** The whole thing is available in a neat [DEB package][3] if you're interested. + +![top 10 strangest linux distros](http://3.bp.blogspot.com/-Q0hlEMCD9-o/VdMieAiXY1I/AAAAAAAAJ0M/iS_ZjVaZAk8/s1600/papyros.png) + +**PapyrOS**: "Strange" in a good way. PapyrOS is trying to adapt the material design language of Android into their brand new Linux distribution. Though the project is in early stages, it already looks very promising. The project page says the OS is 80% complete and one can expect the first Alpha release anytime soon. We did a small write up on [PapyrOS][4] when it was announced and by the looks of it, PapyrOS might even become a trend-setter of sorts. Follow the project on [Google+][5] and contribute via [BountySource][6] if you're interested. + +![10 most unique linux distros](http://3.bp.blogspot.com/-8aOtnTp3Yxk/VdMo_KWs4sI/AAAAAAAAJ0o/3NTqhaw60jM/s1600/qubes-linux.png) + +**Qubes OS**: Qubes is an open-source operating system designed to provide strong security using a Security by Compartmentalization approach. The assumption is that there can be no perfect, bug-free desktop environment. And by implementing a 'Security by Isolation' approach, [Qubes Linux][7] intends to remedy that. Qubes is based on Xen, the X Window System, and Linux, and can run most Linux applications and supports most Linux drivers. Qubes was selected as a finalist of Access Innovation Prize 2014 for Endpoint Security Solution. + +![top10 linux distros](http://3.bp.blogspot.com/-2Sqvb_lilC0/VdMq_ceoXnI/AAAAAAAAJ00/kot20ugVJFk/s1600/ubuntu-satanic.jpg) + +**Ubuntu Satanic Edition**: Ubuntu SE is a Linux distribution based on Ubuntu. "It brings together the best of free software and free metal music" in one comprehensive package consisting of themes, wallpapers, and even some heavy-metal music sourced from talented new artists. Though the project doesn't look actively developed anymore, Ubuntu Satanic Edition is strange in every sense of that word. [Ubuntu SE (Slightly NSFW)][8]. + +![10 strange linux distros](http://2.bp.blogspot.com/-ZtIVjGMqdx0/VdMv136Pz1I/AAAAAAAAJ1E/-q34j-TXyUY/s1600/tiny-core-linux.png) + +**Tiny Core Linux**: Puppy Linux not small enough? Try this. Tiny Core Linux is a 12 MB graphical Linux desktop! Yep, you read it right. One major caveat: It is not a complete desktop nor is all hardware completely supported. It represents only the core needed to boot into a very minimal X desktop typically with wired internet access. There is even a version without the GUI called Micro Core Linux which is just 9MB in size. [Tiny Core Linux][9] folks. + +![top 10 unique and special linux distros](http://4.bp.blogspot.com/-idmCvIxtxeo/VdcqcggBk1I/AAAAAAAAJ1U/DTQCkiLqlLk/s1600/nixos.png) + +**NixOS**: A very experienced-user focused Linux distribution with a unique approach to package and configuration management. In other distributions, actions such as upgrades can be dangerous. Upgrading a package can cause other packages to break, upgrading an entire system is much less reliable than reinstalling from scratch. And top of all that you can't safely test what the results of a configuration change will be, there's no "Undo" so to speak. In NixOS, the entire operating system is built by the Nix package manager from a description in a purely functional build language. This means that building a new configuration cannot overwrite previous configurations. Most of the other features follow this pattern. Nix stores all packages in isolation from each other. [More about NixOS][10]. + +![strangest linux distros](http://4.bp.blogspot.com/-rOYfBXg-UiU/VddCF7w_xuI/AAAAAAAAJ1w/Nf11bOheOwM/s1600/gobolinux.jpg) + +**GoboLinux**: This is another very unique Linux distro. What makes GoboLinux so different from the rest is its unique re-arrangement of the filesystem. It has its own subdirectory tree, where all of its files and programs are stored. GoboLinux does not have a package database because the filesystem is its database. In some ways, this sort of arrangement is similar to that seen in OS X. [Get GoboLinux][11]. + +![strangest linux distros](http://1.bp.blogspot.com/-3P22pYfih6Y/VdcucPOv4LI/AAAAAAAAJ1g/PszZDbe83sQ/s1600/hannah-montana-linux.jpg) + +**Hannah Montana Linux**: Here is a Linux distro based on Kubuntu with a Hannah Montana themed boot screen, KDM, icon set, ksplash, plasma, color scheme, and wallpapers (I'm so sorry). [Link][12]. Project not active anymore. + +**RLSD Linux**: An extremely minimalistic, small, lightweight and security-hardened, text-based operating system built on Linux. "It's a unique distribution that provides a selection of console applications and home-grown security features which might appeal to hackers," developers claim. [RLSD Linux][13]. + +Did we miss anything even stranger? Let us know. + +-------------------------------------------------------------------------------- + +via: http://www.techdrivein.com/2015/08/the-strangest-most-unique-linux-distros.html + +作者:Manuel Jose +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[1]:http://puppylinux.org/main/Overview%20and%20Getting%20Started.htm +[2]:http://qntm.org/suicide +[3]:http://sourceforge.net/projects/suicide-linux/files/ +[4]:http://www.techdrivein.com/2015/02/papyros-material-design-linux-coming-soon.html +[5]:https://plus.google.com/communities/109966288908859324845/stream/3262a3d3-0797-4344-bbe0-56c3adaacb69 +[6]:https://www.bountysource.com/teams/papyros +[7]:https://www.qubes-os.org/ +[8]:http://ubuntusatanic.org/ +[9]:http://tinycorelinux.net/ +[10]:https://nixos.org/ +[11]:http://www.gobolinux.org/ +[12]:http://hannahmontana.sourceforge.net/ +[13]:http://rlsd2.dimakrasner.com/ \ No newline at end of file diff --git a/sources/tech/20150827 Linux or UNIX--Bash Read a File Line By Line.md b/sources/tech/20150827 Linux or UNIX--Bash Read a File Line By Line.md new file mode 100644 index 0000000000..971adc0a0c --- /dev/null +++ b/sources/tech/20150827 Linux or UNIX--Bash Read a File Line By Line.md @@ -0,0 +1,162 @@ +Linux/UNIX: Bash Read a File Line By Line +================================================================================ +How do I read a file line by line under a Linux or UNIX-like system using KSH or BASH shell? + +You can use while..do..done bash loop to read file line by line on a Linux, OSX, *BSD, or Unix-like system. + +**Syntax to read file line by line on a Bash Unix & Linux shell:** + +1. The syntax is as follows for bash, ksh, zsh, and all other shells - +1. while read -r line; do COMMAND; done < input.file +1. The -r option passed to red command prevents backslash escapes from being interpreted. +1. Add IFS= option before read command to prevent leading/trailing whitespace from being trimmed - +1. while IFS= read -r line; do COMMAND_on $line; done < input.file + +Here is more human readable syntax for you: + + #!/bin/bash + input="/path/to/txt/file" + while IFS= read -r var + do + echo "$var" + done < "$input" + +**Examples** + +Here are some examples: + + #!/bin/ksh + file="/home/vivek/data.txt" + while IFS= read line + do + # display $line or do somthing with $line + echo "$line" + done <"$file" + +The same example using bash shell: + + #!/bin/bash + file="/home/vivek/data.txt" + while IFS= read -r line + do + # display $line or do somthing with $line + printf '%s\n' "$line" + done <"$file" + +You can also read field wise: + + #!/bin/bash + file="/etc/passwd" + while IFS=: read -r f1 f2 f3 f4 f5 f6 f7 + do + # display fields using f1, f2,..,f7 + printf 'Username: %s, Shell: %s, Home Dir: %s\n' "$f1" "$f7" "$f6" + done <"$file" + +Sample outputs: + +![Fig.01: Bash shell scripting- read file line by line demo outputs](http://s0.cyberciti.org/uploads/faq/2011/01/Bash-Scripting-Read-File-line-by-line-demo.jpg) + +Fig.01: Bash shell scripting- read file line by line demo outputs + +**Bash Scripting: Read text file line-by-line to create pdf files** + +My input file is as follows (faq.txt): + + 4|http://www.cyberciti.biz/faq/mysql-user-creation/|Mysql User Creation: Setting Up a New MySQL User Account + 4096|http://www.cyberciti.biz/faq/ksh-korn-shell/|What is UNIX / Linux Korn Shell? + 4101|http://www.cyberciti.biz/faq/what-is-posix-shell/|What Is POSIX Shell? + 17267|http://www.cyberciti.biz/faq/linux-check-battery-status/|Linux: Check Battery Status Command + 17245|http://www.cyberciti.biz/faq/restarting-ntp-service-on-linux/|Linux Restart NTPD Service Command + 17183|http://www.cyberciti.biz/faq/ubuntu-linux-determine-your-ip-address/|Ubuntu Linux: Determine Your IP Address + 17172|http://www.cyberciti.biz/faq/determine-ip-address-of-linux-server/|HowTo: Determine an IP Address My Linux Server + 16510|http://www.cyberciti.biz/faq/unix-linux-restart-php-service-command/|Linux / Unix: Restart PHP Service Command + 8292|http://www.cyberciti.biz/faq/mounting-harddisks-in-freebsd-with-mount-command/|FreeBSD: Mount Hard Drive / Disk Command + 8190|http://www.cyberciti.biz/faq/rebooting-solaris-unix-server/|Reboot a Solaris UNIX System + +My bash script: + + #!/bin/bash + # Usage: Create pdf files from input (wrapper script) + # Author: Vivek Gite under GPL v2.x+ + #--------------------------------------------------------- + + #Input file + _db="/tmp/wordpress/faq.txt" + + #Output location + o="/var/www/prviate/pdf/faq" + + _writer="~/bin/py/pdfwriter.py" + + # If file exists + if [[ -f "$_db" ]] + then + # read it + while IFS='|' read -r pdfid pdfurl pdftitle + do + local pdf="$o/$pdfid.pdf" + echo "Creating $pdf file ..." + #Genrate pdf file + $_writer --quiet --footer-spacing 2 \ + --footer-left "nixCraft is GIT UL++++ W+++ C++++ M+ e+++ d-" \ + --footer-right "Page [page] of [toPage]" --footer-line \ + --footer-font-size 7 --print-media-type "$pdfurl" "$pdf" + done <"$_db" + fi + +**Tip: Read from bash variable** + +Let us say you want a list of all installed php packages on a Debian or Ubuntu Linux, enter: + + # My input source is the contents of a variable called $list # + list=$(dpkg --list php\* | awk '/ii/{print $2}') + printf '%s\n' "$list" + +Sample outputs: + + php-pear + php5-cli + php5-common + php5-fpm + php5-gd + php5-json + php5-memcache + php5-mysql + php5-readline + php5-suhosin-extension + +You can now read from $list and install the package: + + #!/bin/bash + # BASH can iterate over $list variable using a "here string" # + while IFS= read -r pkg + do + printf 'Installing php package %s...\n' "$pkg" + /usr/bin/apt-get -qq install $pkg + done <<< "$list" + printf '*** Do not forget to run php5enmod and restart the server (httpd or php5-fpm) ***\n' + +Sample outputs: + + Installing php package php-pear... + Installing php package php5-cli... + Installing php package php5-common... + Installing php package php5-fpm... + Installing php package php5-gd... + Installing php package php5-json... + Installing php package php5-memcache... + Installing php package php5-mysql... + Installing php package php5-readline... + Installing php package php5-suhosin-extension... + *** Do not forget to run php5enmod and restart the server (httpd or php5-fpm) *** + +-------------------------------------------------------------------------------- + +via: http://www.cyberciti.biz/faq/unix-howto-read-line-by-line-from-file/ + +作者:[作者名][a] +译者:[译者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 11cf23fc623947c5939ec69b51c0809268121d8c Mon Sep 17 00:00:00 2001 From: KS Date: Thu, 27 Aug 2015 17:35:37 +0800 Subject: [PATCH 482/507] Create 20150205 Install Strongswan - A Tool to Setup IPsec Based VPN in Linux.md --- ... Tool to Setup IPsec Based VPN in Linux.md | 113 ++++++++++++++++++ 1 file changed, 113 insertions(+) create mode 100644 translated/tech/20150205 Install Strongswan - A Tool to Setup IPsec Based VPN in Linux.md diff --git a/translated/tech/20150205 Install Strongswan - A Tool to Setup IPsec Based VPN in Linux.md b/translated/tech/20150205 Install Strongswan - A Tool to Setup IPsec Based VPN in Linux.md new file mode 100644 index 0000000000..3c16463951 --- /dev/null +++ b/translated/tech/20150205 Install Strongswan - A Tool to Setup IPsec Based VPN in Linux.md @@ -0,0 +1,113 @@ +安装Strongswan - Linux上一个基于IPsec的vpn工具 +================================================================================ +IPsec是一个提供网络层安全的标准。它包含认证头(AH)和安全负载封装(ESP)组件。AH提供包的完整性,ESP组件提供包的保密性。IPsec确保了在网络层的安全特性。 + +- 保密性 +- 数据包完整性 +- 来源不可抵赖性 +- 重放攻击防护 + +[Strongswan][1]是一个IPsec协议实现的开源代码,Strongswan代表强壮开源广域网(StrongS/WAN)。它支持IPsec的VPN两个版本的密钥自动交换(网络密钥交换(IKE)V1和V2)。 + +Strongswan基本上提供了自动交换密钥共享VPN两个节点或网络,然后它使用Linux内核的IPsec(AH和ESP)实现。密钥共享使用了IKE机制的特性使用ESP编码数据。在IKE阶段,strongswan使用OpenSSL加密算法(AES,SHA等等)和其他加密类库。无论如何,ESP组成IPsec使用的安全算法,它是Linux内核实现的。Strongswan的主要特性是下面这些。 + +- x.509证书或基于预共享密钥认证 +- 支持IKEv1和IKEv2密钥交换协议 +- 可选内置插件和库的完整性和加密测试 +- 支持椭圆曲线DH群体和ECDSA证书 +- 在智能卡上存储RSA私钥和证书 + +它能被使用在客户端或服务器(road warrior模式)和网关到网关的情景。 + +### 如何安装 ### + +几乎所有的Linux发行版都支持Strongswan的二进制包。在这个教程,我们将从二进制包安装strongswan也编译strongswan合适的特性的源代码。 + +### 使用二进制包 ### + +可以使用以下命令安装Strongswan到Ubuntu 14.04 LTS + + $sudo aptitude install strongswan + +![安装strongswan](http://blog.linoxide.com/wp-content/uploads/2014/12/strongswan-binary.png) + +strongswan的全局配置(strongswan.conf)文件和ipsec配置(ipsec.conf/ipsec.secrets)文件都在/etc/目录下。 + +### strongswan源码编译安装的依赖包 ### + +- GMP(strongswan使用的Mathematical/Precision 库) +- OpenSSL(加密算法在这个库里) +- PKCS(1,7,8,11,12)(证书编码和智能卡与Strongswan集成) + +#### 步骤 #### + +**1)** 在终端使用下面命令到/usr/src/目录 + + $cd /usr/src + +**2)** 用下面命令从strongswan网站下载源代码 + + $sudo wget http://download.strongswan.org/strongswan-5.2.1.tar.gz + +(strongswan-5.2.1.tar.gz 是最新版。) + +![下载软件](http://blog.linoxide.com/wp-content/uploads/2014/12/download_strongswan.png) + +**3)** 用下面命令提取下载软件,然后进入目录。 + + $sudo tar –xvzf strongswan-5.2.1.tar.gz; cd strongswan-5.2.1 + +**4)** 使用configure命令配置strongswan每个想要的选项。 + + ./configure --prefix=/usr/local -–enable-pkcs11 -–enable-openssl + +![检查strongswan包](http://blog.linoxide.com/wp-content/uploads/2014/12/strongswan-configure.png) + +如果GMP库没有安装,然后配置脚本将会发生下面的错误。 + +![GMP library error](http://blog.linoxide.com/wp-content/uploads/2014/12/gmp-error.png) + +因此,首先,使用下面命令安装GMP库然后执行配置脚本。 + +![gmp installation](http://blog.linoxide.com/wp-content/uploads/2014/12/gmp-installation1.png) + +无论如何,如果GMP已经安装而且还一致报错,然后在Ubuntu上使用下面命令创建libgmp.so库的软连到/usr/lib,/lib/,/usr/lib/x86_64-linux-gnu/路径下。 + + $ sudo ln -s /usr/lib/x86_64-linux-gnu/libgmp.so.10.1.3 /usr/lib/x86_64-linux-gnu/libgmp.so + +![softlink of libgmp.so library](http://blog.linoxide.com/wp-content/uploads/2014/12/softlink.png) + +创建libgmp.so软连后,再执行./configure脚本也许就找到gmp库了。无论如何,gmp头文件也许发生其他错误,像下面这样。 + +![GMP header file issu](http://blog.linoxide.com/wp-content/uploads/2014/12/gmp-header.png) + +为解决上面的错误,使用下面命令安装libgmp-dev包 + + $sudo aptitude install libgmp-dev + +![Installation of Development library of GMP](http://blog.linoxide.com/wp-content/uploads/2014/12/gmp-dev.png) + +安装gmp的开发库后,在运行一遍配置脚本,如果没有发生错误,则将看见下面的这些输出。 + +![Output of Configure scirpt](http://blog.linoxide.com/wp-content/uploads/2014/12/successful-run.png) + +使用下面的命令编译安装strongswan。 + + $ sudo make ; sudo make install + +安装strongswan后,全局配置(strongswan.conf)和ipsec策略/密码配置文件(ipsec.conf/ipsec.secretes)被放在**/usr/local/etc**目录。 + +根据我们的安全需要Strongswan可以用作隧道或者传输模式。它提供众所周知的site-2-site模式和road warrior模式的VPN。它很容易使用在Cisco,Juniper设备上。 + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/security/install-strongswan/ + +作者:[nido][a] +译者:[wyangsun](https://github.com/wyangsun) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://linoxide.com/author/naveeda/ +[1]:https://www.strongswan.org/ From 9be5244464896eeceaa76ca8151c7f032d188b28 Mon Sep 17 00:00:00 2001 From: KS Date: Thu, 27 Aug 2015 17:35:55 +0800 Subject: [PATCH 483/507] Delete 20150205 Install Strongswan - A Tool to Setup IPsec Based VPN in Linux.md --- ... Tool to Setup IPsec Based VPN in Linux.md | 114 ------------------ 1 file changed, 114 deletions(-) delete mode 100644 sources/tech/20150205 Install Strongswan - A Tool to Setup IPsec Based VPN in Linux.md diff --git a/sources/tech/20150205 Install Strongswan - A Tool to Setup IPsec Based VPN in Linux.md b/sources/tech/20150205 Install Strongswan - A Tool to Setup IPsec Based VPN in Linux.md deleted file mode 100644 index cd9ee43213..0000000000 --- a/sources/tech/20150205 Install Strongswan - A Tool to Setup IPsec Based VPN in Linux.md +++ /dev/null @@ -1,114 +0,0 @@ -wyangsun translating -Install Strongswan - A Tool to Setup IPsec Based VPN in Linux -================================================================================ -IPsec is a standard which provides the security at network layer. It consist of authentication header (AH) and encapsulating security payload (ESP) components. AH provides the packet Integrity and confidentiality is provided by ESP component . IPsec ensures the following security features at network layer. - -- Confidentiality -- Integrity of packet -- Source Non. Repudiation -- Replay attack protection - -[Strongswan][1] is an open source implementation of IPsec protocol and Strongswan stands for Strong Secure WAN (StrongS/WAN). It supports the both version of automatic keying exchange in IPsec VPN (Internet keying Exchange (IKE) V1 & V2). - -Strongswan basically provides the automatic keying sharing between two nodes/gateway of the VPN and after that it uses the Linux Kernel implementation of IPsec (AH & ESP). Key shared using IKE mechanism is further used in the ESP for the encryption of data. In IKE phase, strongswan uses the encryption algorithms (AES,SHA etc) of OpenSSL and other crypto libraries. However, ESP component of IPsec uses the security algorithm which are implemented in the Linux Kernel. The main features of Strongswan are given below. - -- 509 certificates or pre-shared keys based Authentication -- Support of IKEv1 and IKEv2 key exchange protocols -- Optional built-in integrity and crypto tests for plugins and libraries -- Support of elliptic curve DH groups and ECDSA certificates -- Storage of RSA private keys and certificates on a smartcard. - -It can be used in the client / server (road warrior) and gateway to gateway scenarios. - -### How to Install ### - -Almost all Linux distro’s, supports the binary package of Strongswan. In this tutorial, we will install the strongswan from binary package and also the compilation of strongswan source code with desirable features. - -### Using binary package ### - -Strongswan can be installed using following command on Ubuntu 14.04 LTS . - - $sudo aptitude install strongswan - -![Installation of strongswan](http://blog.linoxide.com/wp-content/uploads/2014/12/strongswan-binary.png) - -The global configuration (strongswan.conf) file and ipsec configuration (ipsec.conf/ipsec.secrets) files of strongswan are under /etc/ directory. - -### Pre-requisite for strongswan source compilation & installation ### - -- GMP (Mathematical/Precision Library used by strongswan) -- OpenSSL (Crypto Algorithms from this library) -- PKCS (1,7,8,11,12)(Certificate encoding and smart card integration with Strongswan ) - -#### Procedure #### - -**1)** Go to /usr/src/ directory using following command in the terminal. - - $cd /usr/src - -**2)** Download the source code from strongswan site suing following command - - $sudo wget http://download.strongswan.org/strongswan-5.2.1.tar.gz - -(strongswan-5.2.1.tar.gz is the latest version.) - -![Downloading software](http://blog.linoxide.com/wp-content/uploads/2014/12/download_strongswan.png) - -**3)** Extract the downloaded software and go inside it using following command. - - $sudo tar –xvzf strongswan-5.2.1.tar.gz; cd strongswan-5.2.1 - -**4)** Configure the strongswan as per desired options using configure command. - - ./configure --prefix=/usr/local -–enable-pkcs11 -–enable-openssl - -![checking packages for strongswan](http://blog.linoxide.com/wp-content/uploads/2014/12/strongswan-configure.png) - -If GMP library is not installed, then configure script will generate following error. - -![GMP library error](http://blog.linoxide.com/wp-content/uploads/2014/12/gmp-error.png) - -Therefore, first of all, install the GMP library using following command and then run the configure script. - -![gmp installation](http://blog.linoxide.com/wp-content/uploads/2014/12/gmp-installation1.png) - -However, if GMP is already installed and still above error exists then create soft link of libgmp.so library at /usr/lib , /lib/, /usr/lib/x86_64-linux-gnu/ paths in Ubuntu using following command. - - $ sudo ln -s /usr/lib/x86_64-linux-gnu/libgmp.so.10.1.3 /usr/lib/x86_64-linux-gnu/libgmp.so - -![softlink of libgmp.so library](http://blog.linoxide.com/wp-content/uploads/2014/12/softlink.png) - -After the creation of libgmp.so softlink, again run the ./configure script and it may find the gmp library. However, it may generate another error of gmp header file which is shown the following figure. - -![GMP header file issu](http://blog.linoxide.com/wp-content/uploads/2014/12/gmp-header.png) - -Install the libgmp-dev package using following command for the solution of above error. - - $sudo aptitude install libgmp-dev - -![Installation of Development library of GMP](http://blog.linoxide.com/wp-content/uploads/2014/12/gmp-dev.png) - -After installation of development package of gmp library, again run the configure script and if it does not produce any error, then the following output will be displayed. - -![Output of Configure scirpt](http://blog.linoxide.com/wp-content/uploads/2014/12/successful-run.png) - -Type the following commands for the compilation and installation of strongswan. - - $ sudo make ; sudo make install - -After the installation of strongswan , the Global configuration (strongswan.conf) and ipsec policy/secret configuration files (ipsec.conf/ipsec.secretes) are placed in **/usr/local/etc** directory. - -Strongswan can be used as tunnel or transport mode depends on our security need. It provides well known site-2-site and road warrior VPNs. It can be use easily with Cisco,Juniper devices. - --------------------------------------------------------------------------------- - -via: http://linoxide.com/security/install-strongswan/ - -作者:[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]:https://www.strongswan.org/ From 217911c8876de1313460771cfa1f1be3e0c7b33b Mon Sep 17 00:00:00 2001 From: struggling <630441839@qq.com> Date: Thu, 27 Aug 2015 17:55:34 +0800 Subject: [PATCH 484/507] Update 20150827 Linux or UNIX--Bash Read a File Line By Line.md --- .../20150827 Linux or UNIX--Bash Read a File Line By Line.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150827 Linux or UNIX--Bash Read a File Line By Line.md b/sources/tech/20150827 Linux or UNIX--Bash Read a File Line By Line.md index 971adc0a0c..c0a4b6c27c 100644 --- a/sources/tech/20150827 Linux or UNIX--Bash Read a File Line By Line.md +++ b/sources/tech/20150827 Linux or UNIX--Bash Read a File Line By Line.md @@ -1,3 +1,4 @@ +translation by strugglingyouth Linux/UNIX: Bash Read a File Line By Line ================================================================================ How do I read a file line by line under a Linux or UNIX-like system using KSH or BASH shell? @@ -159,4 +160,4 @@ via: http://www.cyberciti.biz/faq/unix-howto-read-line-by-line-from-file/ 译者:[译者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 f0c171116875e4ea6cb783bda1dcdfa615d0644f Mon Sep 17 00:00:00 2001 From: KS Date: Thu, 27 Aug 2015 19:32:42 +0800 Subject: [PATCH 485/507] Update 20150826 How to set up a system status page of your infrastructure.md --- ...ow to set up a system status page of your infrastructure.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150826 How to set up a system status page of your infrastructure.md b/sources/tech/20150826 How to set up a system status page of your infrastructure.md index 44fb4ed8d5..f696e91638 100644 --- a/sources/tech/20150826 How to set up a system status page of your infrastructure.md +++ b/sources/tech/20150826 How to set up a system status page of your infrastructure.md @@ -1,3 +1,4 @@ +wyangsun translating How to set up a system status page of your infrastructure ================================================================================ If you are a system administrator who is responsible for critical IT infrastructure or services of your organization, you will understand the importance of effective communication in your day-to-day tasks. Suppose your production storage server is on fire. You want your entire team on the same page in order to resolve the issue as fast as you can. While you are at it, you don't want half of all users contacting you asking why they cannot access their documents. When a scheduled maintenance is coming up, you want to notify interested parties of the event ahead of the schedule, so that unnecessary support tickets can be avoided. @@ -291,4 +292,4 @@ via: http://xmodulo.com/setup-system-status-page.html [3]:http://ask.xmodulo.com/install-remi-repository-centos-rhel.html [4]:http://xmodulo.com/install-lamp-stack-centos.html [5]:http://xmodulo.com/configure-virtual-hosts-apache-http-server.html -[6]:http://xmodulo.com/monitor-common-services-nagios.html \ No newline at end of file +[6]:http://xmodulo.com/monitor-common-services-nagios.html From 720999b380ca95fe4007b5e817639f56f7b23f5d Mon Sep 17 00:00:00 2001 From: wxy Date: Thu, 27 Aug 2015 22:42:14 +0800 Subject: [PATCH 486/507] PUB:20150826 How to Run Kali Linux 2.0 In Docker Container @geekpi --- ... Run Kali Linux 2.0 In Docker Container.md | 74 +++++++++++++++++++ ... Run Kali Linux 2.0 In Docker Container.md | 74 ------------------- 2 files changed, 74 insertions(+), 74 deletions(-) create mode 100644 published/20150826 How to Run Kali Linux 2.0 In Docker Container.md delete mode 100644 translated/tech/20150826 How to Run Kali Linux 2.0 In Docker Container.md diff --git a/published/20150826 How to Run Kali Linux 2.0 In Docker Container.md b/published/20150826 How to Run Kali Linux 2.0 In Docker Container.md new file mode 100644 index 0000000000..83248bb51e --- /dev/null +++ b/published/20150826 How to Run Kali Linux 2.0 In Docker Container.md @@ -0,0 +1,74 @@ +如何在 Docker 容器中运行 Kali Linux 2.0 +================================================================================ +### 介绍 ### + +Kali Linux 是一个对于安全测试人员和白帽的一个知名操作系统。它带有大量安全相关的程序,这让它很容易用于渗透测试。最近,[Kali Linux 2.0][1] 发布了,它被认为是这个操作系统最重要的一次发布。另一方面,Docker 技术由于它的可扩展性和易用性让它变得很流行。Dokcer 让你非常容易地将你的程序带给你的用户。好消息是你可以通过 Docker 运行Kali Linux 了,让我们看看该怎么做 :) + +### 在 Docker 中运行 Kali Linux 2.0 ### + +**相关提示** + +> 如果你还没有在系统中安装docker,你可以运行下面的命令: + +> **对于 Ubuntu/Linux Mint/Debian:** + +> sudo apt-get install docker + +> **对于 Fedora/RHEL/CentOS:** + +> sudo yum install docker + +> **对于 Fedora 22:** + +> dnf install docker + +> 你可以运行下面的命令来启动docker: + +> sudo docker start + +首先运行下面的命令确保 Docker 服务运行正常: + + sudo docker status + +Kali Linux 的开发团队已将 Kali Linux 的 docker 镜像上传了,只需要输入下面的命令来下载镜像。 + + docker pull kalilinux/kali-linux-docker + +![Pull Kali Linux docker](http://linuxpitstop.com/wp-content/uploads/2015/08/129.png) + +下载完成后,运行下面的命令来找出你下载的 docker 镜像的 ID。 + + docker images + +![Kali Linux Image ID](http://linuxpitstop.com/wp-content/uploads/2015/08/230.png) + +现在运行下面的命令来从镜像文件启动 kali linux docker 容器(这里需用正确的镜像ID替换)。 + + docker run -i -t 198cd6df71ab3 /bin/bash + +它会立刻启动容器并且让你登录到该操作系统,你现在可以在 Kaili Linux 中工作了。 + +![Kali Linux Login](http://linuxpitstop.com/wp-content/uploads/2015/08/328.png) + +你可以在容器外面通过下面的命令来验证容器已经启动/运行中了: + + docker ps + +![Docker Kali](http://linuxpitstop.com/wp-content/uploads/2015/08/421.png) + +### 总结 ### + +Docker 是一种最聪明的用来部署和分发包的方式。Kali Linux docker 镜像非常容易上手,也不会消耗很大的硬盘空间,这样也可以很容易地在任何安装了 docker 的操作系统上测试这个很棒的发行版了。 + +-------------------------------------------------------------------------------- + +via: http://linuxpitstop.com/run-kali-linux-2-0-in-docker-container/ + +作者:[Aun][a] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://linuxpitstop.com/author/aun/ +[1]:https://linux.cn/article-6005-1.html diff --git a/translated/tech/20150826 How to Run Kali Linux 2.0 In Docker Container.md b/translated/tech/20150826 How to Run Kali Linux 2.0 In Docker Container.md deleted file mode 100644 index 5c65ec0286..0000000000 --- a/translated/tech/20150826 How to Run Kali Linux 2.0 In Docker Container.md +++ /dev/null @@ -1,74 +0,0 @@ -如何在Docker容器中运行Kali Linux 2.0 -================================================================================ -### 介绍 ### - -Kali Linux是一个对于安全测试人员和白帽的一个知名的操作系统。它带有大量安全相关的程序,这让它很容易用于渗透测试。最近,[Kali Linux 2.0][1]发布了,并且它被认为是这个操作系统最重要的一次发布。另一方面,Docker技术由于它的可扩展性和易用性让它变得很流行。Dokcer让你非常容易地将你的程序带给你的用户。好消息是你可以通过Docker运行Kali Linux了,让我们看看该怎么做:) - -### 在Docker中运行Kali Linux 2.0 ### - -**相关提示** - -如果你还没有在系统中安装docker,你可以运行下面的命令: - -**对于 Ubuntu/Linux Mint/Debian:** - - sudo apt-get install docker - -**对于 Fedora/RHEL/CentOS:** - - sudo yum install docker - -**对于 Fedora 22:** - - dnf install docker - -你可以运行下面的命令来启动docker: - - sudo docker start - -首先运行下面的命令确保服务正在运行: - - sudo docker status - -Kali Linux的开发团队已将Kali Linux的docker镜像上传了,只需要输入下面的命令来下载镜像。 - - docker pull kalilinux/kali-linux-docker - -![Pull Kali Linux docker](http://linuxpitstop.com/wp-content/uploads/2015/08/129.png) - -下载完成后,运行下面的命令来找出你下载的docker镜像的ID。 - - docker images - -![Kali Linux Image ID](http://linuxpitstop.com/wp-content/uploads/2015/08/230.png) - -现在运行下面的命令来从镜像文件启动kali linux docker容器(这里用正确的镜像ID替换)。 - - docker run -i -t 198cd6df71ab3 /bin/bash - -它会立刻启动容器并且会登录操作系统,你现在可以在Kaili Linux中工作了。 - -![Kali Linux Login](http://linuxpitstop.com/wp-content/uploads/2015/08/328.png) - -你可以通过下面的命令来验证通气已经启动/运行中了: - - docker ps - -![Docker Kali](http://linuxpitstop.com/wp-content/uploads/2015/08/421.png) - -### 总结 ### - -Docker是一种最聪明的用来部署和分发包的方式。Kali Linux docker镜像非常容易上手,也不会消耗很大的硬盘空间,这样也容易地在任何安装了docker的操作系统上测试这个很棒的发行版了。 - --------------------------------------------------------------------------------- - -via: http://linuxpitstop.com/run-kali-linux-2-0-in-docker-container/ - -作者:[Aun][a] -译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://linuxpitstop.com/author/aun/ -[1]:http://linuxpitstop.com/install-kali-linux-2-0/ From b790e5703a27c4b45474431fc96e4922aec600de Mon Sep 17 00:00:00 2001 From: wxy Date: Thu, 27 Aug 2015 23:09:15 +0800 Subject: [PATCH 487/507] PUB:Linux and Unix Test Disk IO Performance With dd Command @DongShuaike --- ...est Disk IO Performance With dd Command.md | 69 ++++++++++--------- 1 file changed, 38 insertions(+), 31 deletions(-) rename translated/tech/Linux and Unix Test Disk IO Performance With dd Command.MD => published/Linux and Unix Test Disk IO Performance With dd Command.md (70%) diff --git a/translated/tech/Linux and Unix Test Disk IO Performance With dd Command.MD b/published/Linux and Unix Test Disk IO Performance With dd Command.md similarity index 70% rename from translated/tech/Linux and Unix Test Disk IO Performance With dd Command.MD rename to published/Linux and Unix Test Disk IO Performance With dd Command.md index be5986b78e..be96c3941b 100644 --- a/translated/tech/Linux and Unix Test Disk IO Performance With dd Command.MD +++ b/published/Linux and Unix Test Disk IO Performance With dd Command.md @@ -1,24 +1,25 @@ -使用dd命令在Linux和Unix环境下进行硬盘I/O性能检测 +使用 dd 命令进行硬盘 I/O 性能检测 ================================================================================ -如何使用dd命令测试硬盘的性能?如何在linux操作系统下检测硬盘的读写能力? + +如何使用dd命令测试我的硬盘性能?如何在linux操作系统下检测硬盘的读写速度? 你可以使用以下命令在一个Linux或类Unix操作系统上进行简单的I/O性能测试。 -- **dd命令** :它被用来在Linux和类Unix系统下对硬盘设备进行写性能的检测。 -- **hparm命令**:它被用来获取或设置硬盘参数,包括测试读性能以及缓存性能等。 +- **dd命令** :它被用来在Linux和类Unix系统下对硬盘设备进行写性能的检测。 +- **hparm命令**:它用来在基于 Linux 的系统上获取或设置硬盘参数,包括测试读性能以及缓存性能等。 在这篇指南中,你将会学到如何使用dd命令来测试硬盘性能。 ### 使用dd命令来监控硬盘的读写性能:### -- 打开shell终端(这里貌似不能翻译为终端提示符)。 -- 通过ssh登录到远程服务器。 +- 打开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)服务器阵列来运行。基本语法为: +在这个例子当中,我将使用搭载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语法 ## @@ -29,18 +30,19 @@ 输出样例: ![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命令获取的服务器吞吐率 + +*图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的影响,以便呈现给你精准的结果。 +- `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服务器的延迟时间: +在下面这个例子中,一共写了1000次,每次写入512字节来获得RAID10服务器的延迟时间: dd if=/dev/zero of=/tmp/test2.img bs=512 count=1000 oflag=dsync @@ -50,11 +52,11 @@ Fig.01: 使用dd命令获取的服务器吞吐率 1000+0 records out 512000 bytes (512 kB) copied, 0.60362 s, 848 kB/s -请注意服务器的吞吐率以及延迟时间也取决于服务器/应用的加载。所以我推荐你在一个刚刚重启过并且处于峰值时间的服务器上来运行测试,以便得到更加准确的度量。现在你可以在你的所有设备上互相比较这些测试结果了。 +请注意服务器的吞吐率以及延迟时间也取决于服务器/应用的负载。所以我推荐你在一个刚刚重启过并且处于峰值时间的服务器上来运行测试,以便得到更加准确的度量。现在你可以在你的所有设备上互相比较这些测试结果了。 -####为什么服务器的吞吐率和延迟时间都这么差?### +###为什么服务器的吞吐率和延迟时间都这么差?### -低的数值并不意味着你在使用差劲的硬件。可能是HARDWARE RAID10的控制器缓存导致的。 +低的数值并不意味着你在使用差劲的硬件。可能是硬件 RAID10的控制器缓存导致的。 使用hdparm命令来查看硬盘缓存的读速度。 @@ -79,11 +81,12 @@ Fig.01: 使用dd命令获取的服务器吞吐率 输出样例: ![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命令 -请再一次注意由于文件文件操作的缓存属性,你将总是会看到很高的读速度。 +*图02: 检测硬盘读入以及缓存性能的Linux hdparm命令* -**使用dd命令来测试读入速度** +请再次注意,由于文件文件操作的缓存属性,你将总是会看到很高的读速度。 + +###使用dd命令来测试读取速度### 为了获得精确的读测试数据,首先在测试前运行下列命令,来将缓存设置为无效: @@ -91,11 +94,11 @@ Fig.02: 检测硬盘读入以及缓存性能的Linux hdparm命令 echo 3 | sudo tee /proc/sys/vm/drop_caches time time dd if=/path/to/bigfile of=/dev/null bs=8k -**笔记本上的示例** +####笔记本上的示例#### 运行下列命令: - ### Cache存在的Debian系统笔记本吞吐率### + ### 带有Cache的Debian系统笔记本吞吐率### dd if=/dev/zero of=/tmp/laptop.bin bs=1G count=1 oflag=direct ###使cache失效### @@ -104,10 +107,11 @@ Fig.02: 检测硬盘读入以及缓存性能的Linux hdparm命令 ###没有Cache的Debian系统笔记本吞吐率### dd if=/dev/zero of=/tmp/laptop.bin bs=1G count=1 oflag=direct -**苹果OS X Unix(Macbook pro)的例子** +####苹果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性能: + +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" @@ -124,26 +128,29 @@ GNU dd命令有其他许多选项但是在 OS X/BSD 以及类Unix中, dd命令 本人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硬盘工具 + +*图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...”按钮(你可能被要求输入管理员用户名和密码): +*图04: 评测硬盘/分区* + +最后,点击“Start Benchmark...”按钮(你可能需要输入管理员用户名和密码): ![Fig.05: Final benchmark result](http://s0.cyberciti.org/uploads/faq/2015/08/disks-3.jpg) -Fig.05: 最终的评测结果 + +*图05: 最终的评测结果* 如果你要问,我推荐使用哪种命令和方法? @@ -158,7 +165,7 @@ via: http://www.cyberciti.biz/faq/howto-linux-unix-test-disk-performance-with-dd 作者:Vivek Gite 译者:[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 8e1b11caca9e5c6cf499f4f42bfabee5e8a3eca0 Mon Sep 17 00:00:00 2001 From: wxy Date: Thu, 27 Aug 2015 23:14:15 +0800 Subject: [PATCH 488/507] PUB:20150821 Linux FAQs with Answers--How to check MariaDB server version @geekpi --- ...s with Answers--How to check MariaDB server version.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) rename {translated/tech => published}/20150821 Linux FAQs with Answers--How to check MariaDB server version.md (75%) diff --git a/translated/tech/20150821 Linux FAQs with Answers--How to check MariaDB server version.md b/published/20150821 Linux FAQs with Answers--How to check MariaDB server version.md similarity index 75% rename from translated/tech/20150821 Linux FAQs with Answers--How to check MariaDB server version.md rename to published/20150821 Linux FAQs with Answers--How to check MariaDB server version.md index 36ea2d15d6..899c2775de 100644 --- a/translated/tech/20150821 Linux FAQs with Answers--How to check MariaDB server version.md +++ b/published/20150821 Linux FAQs with Answers--How to check MariaDB server version.md @@ -1,8 +1,8 @@ -Linux有问必答--如何检查MatiaDB服务端版本 +Linux有问必答:如何检查MariaDB服务端版本 ================================================================================ > **提问**: 我使用的是一台运行MariaDB的VPS。我该如何检查MariaDB服务端的版本? -你需要知道数据库版本的情况有:当你生你数据库或者为服务器打补丁。这里有几种方法找出MariaDB版本的方法。 +有时候你需要知道你的数据库版本,比如当你升级你数据库或对已知缺陷打补丁时。这里有几种方法找出MariaDB版本的方法。 ### 方法一 ### @@ -16,7 +16,7 @@ Linux有问必答--如何检查MatiaDB服务端版本 ### 方法二 ### -如果你不能访问MariaDB,那么你就不能用第一种方法。这种情况下你可以根据MariaDB的安装包的版本来推测。这种方法只有在MariaDB通过包管理器安装的才有用。 +如果你不能访问MariaDB服务器,那么你就不能用第一种方法。这种情况下你可以根据MariaDB的安装包的版本来推测。这种方法只有在MariaDB通过包管理器安装的才有用。 你可以用下面的方法检查MariaDB的安装包。 @@ -42,7 +42,7 @@ via: http://ask.xmodulo.com/check-mariadb-server-version.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 966aeb1be5ec49ec838c8a90c934208a588b58c4 Mon Sep 17 00:00:00 2001 From: struggling <630441839@qq.com> Date: Thu, 27 Aug 2015 23:34:29 +0800 Subject: [PATCH 489/507] Delete Part 7 - Growing an Existing RAID Array and Removing Failed Disks in Raid.md --- ...Array and Removing Failed Disks in Raid.md | 180 ------------------ 1 file changed, 180 deletions(-) delete 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 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 deleted file mode 100644 index 76039f4371..0000000000 --- a/sources/tech/RAID/Part 7 - Growing an Existing RAID Array and Removing Failed Disks in Raid.md +++ /dev/null @@ -1,180 +0,0 @@ -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. - -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 436e11b38c5e15bf85beee1c5a89187fa6d2261f Mon Sep 17 00:00:00 2001 From: struggling <630441839@qq.com> Date: Thu, 27 Aug 2015 23:35:02 +0800 Subject: [PATCH 490/507] Create Part 7 - Growing an Existing RAID Array and Removing Failed Disks in Raid.md --- ...Array and Removing Failed Disks in Raid.md | 182 ++++++++++++++++++ 1 file changed, 182 insertions(+) create mode 100644 translated/tech/RAID/Part 7 - Growing an Existing RAID Array and Removing Failed Disks in Raid.md diff --git a/translated/tech/RAID/Part 7 - Growing an Existing RAID Array and Removing Failed Disks in Raid.md b/translated/tech/RAID/Part 7 - Growing an Existing RAID Array and Removing Failed Disks in Raid.md new file mode 100644 index 0000000000..94d18edde2 --- /dev/null +++ b/translated/tech/RAID/Part 7 - Growing an Existing RAID Array and Removing Failed Disks in Raid.md @@ -0,0 +1,182 @@ + +在 Raid 中扩展现有的 RAID 阵列和删除故障的磁盘 - 第7部分 +================================================================================ +每个新手都会对阵列的意思产生疑惑。阵列只是磁盘的一个集合。换句话说,我们可以称阵列为一个集合或一组。就像一组鸡蛋中包含6个。同样 RAID 阵列中包含着多个磁盘,可能是2,4,6,8,12,16等,希望你现在知道了什么是阵列。 + +在这里,我们将看到如何扩展现有的阵列或 raid 组。例如,如果我们在一组 raid 中使用2个磁盘形成一个 raid 1,在某些情况,如果该组中需要更多的空间,就可以使用mdadm -grow 命令来扩展阵列大小,只是将一个磁盘加入到现有的阵列中。在扩展(添加磁盘到现有的阵列中)后,我们将看看如何从阵列中删除故障的磁盘。 + +![Grow Raid Array in Linux](http://www.tecmint.com/wp-content/uploads/2014/11/Growing-Raid-Array.jpg) + +扩展 RAID 阵列和删除故障的磁盘 + +假设磁盘中的一个有问题了需要删除该磁盘,但我们需要添加一个备用磁盘来扩展该镜像再删除磁盘前,因为我们需要保存数据。当磁盘发生故障时我们需要从阵列中删除它,这是这个主题中我们将要学习到的。 + +#### 扩展 RAID 的特性 #### + +- 我们可以增加(扩大)所有 RAID 集和的大小。 +- 我们在使用新磁盘扩展 RAID 阵列后删除故障的磁盘。 +- 我们可以扩展 RAID 阵列不存在宕机时间。 + +要求 + +- 为了扩展一个RAID阵列,我们需要已有的 RAID 组(阵列)。 +- 我们需要额外的磁盘来扩展阵列。 +- 在这里,我们使用一块磁盘来扩展现有的阵列。 + +在我们了解扩展和恢复阵列前,我们必须了解有关 RAID 级别和设置的基本知识。点击下面的链接了解这些。 + +- [理解 RAID 的基础概念 – 第一部分][1] +- [在 Linux 中创建软件 Raid 0 – 第二部分][2] + +#### 我的服务器设置 #### + + 操作系统 : CentOS 6.5 Final +  IP地址 : 192.168.0.230 +  主机名 : grow.tecmintlocal.com + 2 块现有磁盘 : 1 GB + 1 块额外磁盘 : 1 GB + +在这里,现有的 RAID 有2块磁盘,每个大小为1GB,我们现在再增加一个磁盘到我们现有的 RAID 阵列中,其大小为1GB。 + +### 扩展现有的 RAID 阵列 ### + +1. 在扩展阵列前,首先使用下面的命令列出现有的 RAID 阵列。 + + # mdadm --detail /dev/md0 + +![Check Existing Raid Array](http://www.tecmint.com/wp-content/uploads/2014/11/Check-Existing-Raid-Array.png) + +检查现有的 RAID 阵列 + +**注意**: 以上输出显示,已经有了两个磁盘在 RAID 阵列中,级别为 RAID 1。现在我们在这里再增加一个磁盘到现有的阵列。 + +2.现在让我们添加新的磁盘“sdd”,并使用‘fdisk‘命令来创建分区。 + + # fdisk /dev/sdd + +请使用以下步骤为 /dev/sdd 创建一个新的分区。 + +- 按 ‘n’ 创建新的分区。 +- 然后按 ‘P’ 选择主分区。 +- 接下来选择分区号为1。 +- 只需按两次回车键选择默认值即可。 +- 然后,按 ‘P’ 来打印创建好的分区。 +- 按 ‘L’,列出所有可用的类型。 +- 按 ‘t’ 去修改分区。 +- 键入 ‘fd’ 设置为 Linux 的 RAID 类型,然后按 Enter 确认。 +- 然后再次使用‘p’查看我们所做的更改。 +- 使用‘w’保存更改。 + +![Create New Partition in Linux](http://www.tecmint.com/wp-content/uploads/2014/11/Create-New-sdd-Partition.png) + +为 sdd 创建新的分区 + +3. 一旦新的 sdd 分区创建完成后,你可以使用下面的命令验证它。 + + # ls -l /dev/ | grep sd + +![Confirm sdd Partition](http://www.tecmint.com/wp-content/uploads/2014/11/Confirm-sdd-Partition.png) + +确认 sdd 分区 + +4.接下来,在添加到阵列前先检查磁盘是否有 RAID 分区。 + + # mdadm --examine /dev/sdd1 + +![Check Raid on sdd Partition](http://www.tecmint.com/wp-content/uploads/2014/11/Check-Raid-on-sdd-Partition.png) + +在 sdd 分区中检查 raid + +**注意**:以上输出显示,该盘有没有发现 super-blocks,意味着我们可以将新的磁盘添加到现有阵列。 + +4. 要添加新的分区 /dev/sdd1 到现有的阵列 md0,请使用以下命令。 + + # 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) + +添加磁盘到 Raid 阵列 + +5. 一旦新的磁盘被添加后,在我们的阵列中检查新添加的磁盘。 + + # mdadm --detail /dev/md0 + +![Confirm Disk Added to Raid](http://www.tecmint.com/wp-content/uploads/2014/11/Confirm-Disk-Added-To-Raid.png) + +确认将新磁盘添加到 Raid 中 + +**注意**: 在上面的输出,你可以看到磁盘已经被添加作为备用的。在这里,我们的阵列中已经有了2个磁盘,但我们期待阵列中有3个磁盘,因此我们需要扩展阵列。 + +6. 要扩展阵列,我们需要使用下面的命令。 + + # mdadm --grow --raid-devices=3 /dev/md0 + +![Grow Raid Array](http://www.tecmint.com/wp-content/uploads/2014/11/Grow-Raid-Array.png) + +扩展 Raid 阵列 + +现在我们可以看到第三块磁盘(sdd1)已被添加到阵列中,在第三块磁盘被添加后,它将从另外两块磁盘上同步数据。 + + # mdadm --detail /dev/md0 + +![Confirm Raid Array](http://www.tecmint.com/wp-content/uploads/2014/11/Confirm-Raid-Array.png) + +确认 Raid 阵列 + +**注意**: 对于容量磁盘会需要几个小时来同步数据。在这里,我们使用的是1GB的虚拟磁盘,所以它非常快在几秒钟内便会完成。 + +### 从阵列中删除磁盘 ### + +7. 在数据被从其他两个磁盘同步到新磁盘‘sdd1‘后,现在三个磁盘中的数据已经相同了。 + +正如我前面所说的,假定一个磁盘出问题了需要被删除。所以,现在假设磁盘‘sdc1‘出问题了,需要从现有阵列中删除。 + +在删除磁盘前我们要将其标记为 failed,然后我们才可以将其删除。 + + # 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) + +在 Raid 阵列中模拟磁盘故障 + +从上面的输出中,我们清楚地看到,磁盘在底部被标记为 faulty。即使它是 faulty 的,我们仍然可以看到 raid 设备有3个,1个损坏了 state 是 degraded。 + +现在我们要从阵列中删除 faulty 的磁盘,raid 设备将像之前一样继续有2个设备。 + + # 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) + +在 Raid 阵列中删除磁盘 + +8. 一旦故障的磁盘被删除,然后我们只能使用2个磁盘来扩展 raid 阵列了。 + + # 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) + +在 RAID 阵列扩展磁盘 + +从上面的输出中可以看到,我们的阵列中仅有2台设备。如果你需要再次扩展阵列,按照同样的步骤,如上所述。如果你需要添加一个磁盘作为备用,将其标记为 spare,因此,如果磁盘出现故障时,它会自动顶上去并重建数据。 + +### 结论 ### + +在这篇文章中,我们已经看到了如何扩展现有的 RAID 集合,以及如何从一个阵列中删除故障磁盘在重新同步已有磁盘的数据后。所有这些步骤都可以不用停机来完成。在数据同步期间,系统用户,文件和应用程序不会受到任何影响。 + +在接下来的文章我将告诉你如何管理 RAID,敬请关注更新,不要忘了写评论。 + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/grow-raid-array-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/ From 7ae7928abc2cdd47f7e3dabe8cc03a735da4cdad Mon Sep 17 00:00:00 2001 From: wxy Date: Thu, 27 Aug 2015 23:35:46 +0800 Subject: [PATCH 491/507] PUB:20150818 How to monitor stock quotes from the command line on Linux @GOLinux --- ...ock quotes from the command line on Linux.md | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) rename {translated/tech => published}/20150818 How to monitor stock quotes from the command line on Linux.md (75%) diff --git a/translated/tech/20150818 How to monitor stock quotes from the command line on Linux.md b/published/20150818 How to monitor stock quotes from the command line on Linux.md similarity index 75% rename from translated/tech/20150818 How to monitor stock quotes from the command line on Linux.md rename to published/20150818 How to monitor stock quotes from the command line on Linux.md index c2a9e5d576..53be8376a4 100644 --- a/translated/tech/20150818 How to monitor stock quotes from the command line on Linux.md +++ b/published/20150818 How to monitor stock quotes from the command line on Linux.md @@ -1,18 +1,19 @@ Linux中通过命令行监控股票报价 ================================================================================ -如果你是那些股票投资者或者交易者中的一员,那么监控证券市场将成为你日常工作中的其中一项任务。最有可能是你会使用一个在线交易平台,这个平台有着一些漂亮的实时图表和全部种类的高级股票分析和交易工具。虽然这种复杂的市场研究工具是任何严肃的证券投资者阅读市场的必备,但是监控最新的股票报价来构建有利可图的投资组合仍然有很长一段路要走。 -如果你是一位长久坐在终端前的全职系统管理员,而证券交易又成了你日常生活中的业余兴趣,那么一个简单地显示实时股票报价的命令行工具会是你的恩赐。 +如果你是那些股票投资者或者交易者中的一员,那么监控证券市场将是你的日常工作之一。最有可能的是你会使用一个在线交易平台,这个平台有着一些漂亮的实时图表和全部种类的高级股票分析和交易工具。虽然这种复杂的市场研究工具是任何严肃的证券投资者了解市场的必备工具,但是监控最新的股票报价来构建有利可图的投资组合仍然有很长一段路要走。 + +如果你是一位长久坐在终端前的全职系统管理员,而证券交易又成了你日常生活中的业余兴趣,那么一个简单地显示实时股票报价的命令行工具会是给你的恩赐。 在本教程中,让我来介绍一个灵巧而简洁的命令行工具,它可以让你在Linux上从命令行监控股票报价。 这个工具叫做[Mop][1]。它是用GO编写的一个轻量级命令行工具,可以极其方便地跟踪来自美国市场的最新股票报价。你可以很轻松地自定义要监控的证券列表,它会在一个基于ncurses的便于阅读的界面显示最新的股票报价。 -**注意**:Mop是通过雅虎金融API获取最新的股票报价的。你必须意识到,他们的的股票报价已知会有15分钟的延时。所以,如果你正在寻找0延时的“实时”股票报价,那么Mop就不是你的菜了。这种“现场”股票报价订阅通常可以通过向一些不开放的私有接口付费获取。对于上面讲得,让我们来看看怎样在Linux环境下使用Mop吧。 +**注意**:Mop是通过雅虎金融API获取最新的股票报价的。你必须意识到,他们的的股票报价已知会有15分钟的延时。所以,如果你正在寻找0延时的“实时”股票报价,那么Mop就不是你的菜了。这种“现场”股票报价订阅通常可以通过向一些不开放的私有接口付费获取。了解这些之后,让我们来看看怎样在Linux环境下使用Mop吧。 ### 安装 Mop 到 Linux ### -由于Mop部署在Go中,你首先需要安装Go语言。如果你还没有安装Go,请参照[此指南][2]将Go安装到你的Linux平台中。请确保按指南中所讲的设置GOPATH环境变量。 +由于Mop是用Go实现的,你首先需要安装Go语言。如果你还没有安装Go,请参照[此指南][2]将Go安装到你的Linux平台中。请确保按指南中所讲的设置GOPATH环境变量。 安装完Go后,继续像下面这样安装Mop。 @@ -42,7 +43,7 @@ Linux中通过命令行监控股票报价 ### 使用Mop来通过命令行监控股票报价 ### -要启动Mop,只需运行名为cmd的命令。 +要启动Mop,只需运行名为cmd的命令(LCTT 译注:这名字实在是……)。 $ cmd @@ -50,7 +51,7 @@ Linux中通过命令行监控股票报价 ![](https://farm6.staticflickr.com/5749/20018949104_c8c64e0e06_c.jpg) -报价显示了像最新价格、交易百分比、每日低/高、52周低/高、股利以及年产量等信息。Mop从[CNN][3]获取市场总览信息,从[雅虎金融][4]获得个股报价,股票报价信息它自己会在终端内周期性更新。 +报价显示了像最新价格、交易百分比、每日低/高、52周低/高、股息以及年收益率等信息。Mop从[CNN][3]获取市场总览信息,从[雅虎金融][4]获得个股报价,股票报价信息它自己会在终端内周期性更新。 ### 自定义Mop中的股票报价 ### @@ -78,7 +79,7 @@ Linux中通过命令行监控股票报价 ### 尾声 ### -正如你所见,Mop是一个轻量级的,然而极其方便的证券监控工具。当然,你可以很轻松地从其它别的什么地方,从在线站点,你的智能手机等等访问到股票报价信息。然而,如果你在终端环境中花费大量时间,Mop可以很容易地适应你的工作空间,希望没有让你过多地从你的公罗流程中分心。只要让它在你其中一个终端中运行并保持市场日期持续更新,就让它在那干着吧。 +正如你所见,Mop是一个轻量级的,然而极其方便的证券监控工具。当然,你可以很轻松地从其它别的什么地方,从在线站点,你的智能手机等等访问到股票报价信息。然而,如果你在整天使用终端环境,Mop可以很容易地适应你的工作环境,希望没有让你过多地从你的工作流程中分心。只要让它在你其中一个终端中运行并保持市场日期持续更新,那就够了。 交易快乐! @@ -88,7 +89,7 @@ via: http://xmodulo.com/monitor-stock-quotes-command-line-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 b36ab92cb463c9c947bb4070a29c89a11247f4c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=AE=A6=E6=88=90?= Date: Fri, 28 Aug 2015 02:46:10 +0800 Subject: [PATCH 492/507] =?UTF-8?q?=E3=80=90=E7=BF=BB=E8=AF=91=E5=AE=8C?= =?UTF-8?q?=E6=88=90=E3=80=91RHCSA=20Series--Part=2007?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 翻译完成第七篇 --- ...Lists) and Mounting Samba or NFS Shares.md | 192 ++++++++++++++++++ 1 file changed, 192 insertions(+) create mode 100644 translated/tech/RHCSA/RHCSA Series--Part 07--Using ACLs (Access Control Lists) and Mounting Samba or NFS Shares.md diff --git a/translated/tech/RHCSA/RHCSA Series--Part 07--Using ACLs (Access Control Lists) and Mounting Samba or NFS Shares.md b/translated/tech/RHCSA/RHCSA Series--Part 07--Using ACLs (Access Control Lists) and Mounting Samba or NFS Shares.md new file mode 100644 index 0000000000..a9c56b1cbe --- /dev/null +++ b/translated/tech/RHCSA/RHCSA Series--Part 07--Using ACLs (Access Control Lists) and Mounting Samba or NFS Shares.md @@ -0,0 +1,192 @@ +[xiqingongzi Translating] +RHCSA Series: Using ACLs (Access Control Lists) and Mounting Samba / NFS Shares – Part 7 +================================================================================ +在第六篇文章的最后,我们开始解释如何使用parted和SSM 设置和配置本地文件存储([RHCSA series Part 6][1]) + +![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系列::第七章 ACL的配置和安装NFS/Samba文件分享系统 + +我们还讨论了如何创建和在启动启动时用密码挂载加密逻辑卷。另外,我们要提醒您要避免在安装 在管理操作系统的存储文件系统事执行关键的操作。接下来我们要回顾在红帽Linux 7 中常用的文件系统格式然后卸载和挂载网络文件系统(CIFS和NFS), +#### 前提 #### + +在开始之前,请确保你有一个线上Samba服务器和一个线上NFS服务器(RHEL7 将很快不支持 NFS V2) + +在这个指南中,我们将使用一个IP为192.168.0.10的机器作为服务端,RHEL7 盒子作为客户端,IP为192.168.0.18,稍后我们会告诉你该安装哪些软件包。 + +### RHEL7中的文件格式 ### + +从RHEL7 开始,XFS 因为其高可用性和可拓展性被设置为所有架构的默认文件系统。目前,红帽和合作伙伴测试的主流硬件线上他支持最大500TB 每个文件系统。 +同时,XFS使user_xattr(扩展用户属性)和ACL(POSIX访问控制列表)作为默认的挂载选项,不像ext3或ext4(ext2在RHEL 7中是过时的),这意味着你不需要明确的指定命令行选项或在/etc/fstab挂载时XFS文件系统(如果你想禁用在后一种情况下,这样的选择你要明确使用no_acl和no_user_xattr)。 +记住,扩展用户属性可以指定文件和目录用于存储任意等附加信息的MIME类型,字符集或文件的编码,而对用户属性的访问权限由普通文件权限位的定义。 +#### 权限控制列表 #### + +每一个系统管理员,无论新手还是专家,都熟悉文件和目录的权限和许可。它能制定特定的权限(读,写和执行)的所有者,属组,和其他的正常访问权限。如果需要,可以回去看看 [Part 3 of the RHCSA series][2] +然而,由于标准的 ugo/rwx 设置不允许配置不同用户不同权限,所以ACL可以比一般规定更多的文件和目录权限。 +事实上,ACL定义的权限是文件权限的一个超集,我们来看一下在真正的场景下是如何转换的。 +1. 有两种类型:访问ACL (可以适用于任何一个特定的文件或目录),也是默认的ACL,它只能应用于目录。如果文件包含在其中没有ACL设置,他们继承父目录的默认ACL。 +2. 首先,ACL可以配置每个用户,每个组,或不在组内的用户拥有文件。 +3。设置ACL(和删除)使用setfacl,分别使用M或X选项。 +例如,让我们创建一个组名为tecmint和添加用户johndoe和davenull: + # groupadd tecmint + # useradd johndoe + # useradd davenull + # usermod -a -G tecmint johndoe + # usermod -a -G tecmint davenull + +让我们确认用户属于组tecmint: + + # id johndoe + # id davenull + +![Verify Users](http://www.tecmint.com/wp-content/uploads/2015/04/Verify-Users.png) + +验证用户 + +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): +现在让我们创建一个在/mnt下的目录名为playground,和一个名叫testfile.txt文件。我们将tecmint和更改其默认 ugo/rwx 权限为 770组所有者(读,写,和执行给予属主和属组所有者权限): + # mkdir /mnt/playground + # touch /mnt/playground/testfile.txt + # chmod 770 /mnt/playground/testfile.txt + +然后切换用户johndoe和davenull,按照这个顺序,并写入文件: + + echo "My name is John Doe" > /mnt/playground/testfile.txt + echo "My name is Dave Null" >> /mnt/playground/testfile.txt + +到目前为止很好。现在,让我们的用户gacanepa写入文件–和写操作,可以预料到出现的结果。 + +但如果我们真的需要用户gacanepa(不是tecmint组的成员)有/mnt/playground/testfile.txt的写入权限。首先,可能是你的想法是添加用户帐户组tecmint。但这会给他写上所有文件的权限,写入的是该组的权限,我们不希望这样。我们只希望他能写/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) + +管理用户权限 + +让我们给用户gacanepa添加/mnt/playground/testfile.txt的读写权限 +在root下执行 + + # setfacl -R -m u:gacanepa:rwx /mnt/playground + +您已经成功添加了一个ACL允许gacanepa写入测试文件。然后切换到用户gacanepa试图写入文件: + + $ echo "My name is Gabriel Canepa" >> /mnt/playground/testfile.txt + +要查看特定的文件或目录的ACL,使用getfacl: + + # getfacl /mnt/playground/testfile.txt + +![Check ACLs of Files](http://www.tecmint.com/wp-content/uploads/2015/04/Check-ACL-of-File.png) + +检查文件的ACLs + +设置默认ACL目录(它的内容将会继承除非被覆盖),添加d:以前的规则并且指定一个文件名来替代 + # setfacl -m d:o:r /mnt/playground + +以上的ACL将允许用户不在属组属主有/mnt/playground的读权限。注意在getfacl /mnt/playground 之前和之后的改变输出的差异: +![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] 提供了更多ACL的例子,我强烈推荐你去读读它,参考起来非常方便。 + +#### 安装NFS网络共享 #### + +显示在你的服务器的NFS共享可用的列表,您可以使用showmount命令与E选项,其次是机器名或IP地址。这个工具包含在NFS utils包: + + # yum update && yum install nfs-utils + +然后: + + # showmount -e 192.168.0.10 + +你会得到一个列表的可用的NFS分享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 + +在使用命令行对必要的本地客户端挂载NFS网络共享,使用以下语法: + + # mount -t nfs -o [options] remote_host:/remote/directory /local/directory + +在我们的例子中,翻译成: + + # mount -t nfs 192.168.0.10:/NFS-SHARE /mnt/nfs + +如果您收到一下错误消息:"rpc-statd.service工作失败,看 “systemctl status rpc-statd.service” 和“journalctl -xn” 获取详细信息.确保你的rpcbind服务在开机时开启。 + # systemctl enable rpcbind.socket + # systemctl restart rpcbind.service + +然后重新启动。这应该做的技巧,你将能够挂载NFS共享就和前面所解释的那样。如果你需要安装NFS共享的自动引导系统,添加一个有效的条目到/etc/fstab文件: + + 远程主机:远程目录 本地目录 nfs 选项 0 0 + +变量远程主机, 远程目录, 本地目录, and 选项 (可选的)在我们手动挂载是谁同样的,就和我们之前的例子一样。 + + 192.168.0.10:/NFS-SHARE /mnt/nfs nfs defaults 0 0 + +#### 挂载 Samba 网络文件共享 #### + +Samba 代表选择可以在×nix和Windows之间进行网络共享的工具.使用Samba客户端包内的 smbclient 命令 加 -L 参数来展示 Samba 文件分享,其次是机器名或IP地址 +将会提示你输入远程主机上的密码: + # 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 + +在本地客户端,你需要首先安装CIFS utils来挂载Samba: + + # yum update && yum install cifs-utils + +然后在命令行上使用下面的语法: + + # mount -t cifs -o credentials=/path/to/credentials/file //remote_host/samba_share /local/directory + +在我们的例子中,翻译成: + + # mount -t cifs -o credentials=~/.smbcredentials //192.168.0.10/gacanepa /mnt/samba + +smbcredentials内容为: + + username=gacanepa + password=XXXXXX + +是一个隐藏文件在root的主目录(/root/),权限设置为600,因此,除了该文件的所有者可以读或写,没有人能够读写。 +请注意,samba_share是Samba共享的名字就像 smbclient -L remote_host 返回的那样 + +现在,如果你需要samba共享可自动在系统启动时,添加一个有效的条目/etc/fstab文件如下: + + //远程主机:/samba_share 本地目录 cifs 选项 0 0 + +变量 远程主机, /samba_share, 本地目录, 选项 (可选的) 和我们手动安装的意义一样 + + //192.168.0.10/gacanepa /mnt/samba cifs credentials=/root/smbcredentials,defaults 0 0 + +### 结论 ### + +在这篇文章中我们已经讲解了如何在Linux设置ACL,并探讨RHEL7中该如何挂载CIFS和NFS网络共享。 +我建议你去实践这些概念,甚至把它们一起安装(先尝试安装网络共享设置ACL)如果你有疑问或意见,请随时使用下面的表格,随时与我们联系。还可以通过你的社交网络来分享这篇文章。 +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/rhcsa-exam-configure-acls-and-mount-nfs-samba-shares/ + +作者:[Gabriel Cánepa][a] +译者:[xiqingongzi](https://github.com/xiqingongzi) +校对:[校对者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 From 4180b6aa1f70ff8fe1852ce8c2eb19fd8195123c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=AE=A6=E6=88=90?= Date: Fri, 28 Aug 2015 02:46:32 +0800 Subject: [PATCH 493/507] Delete RHCSA Series--Part 07--Using ACLs (Access Control Lists) and Mounting Samba or NFS Shares.md --- ...Lists) and Mounting Samba or NFS Shares.md | 213 ------------------ 1 file changed, 213 deletions(-) delete mode 100644 sources/tech/RHCSA Series/RHCSA Series--Part 07--Using ACLs (Access Control Lists) and Mounting Samba or NFS Shares.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 deleted file mode 100644 index f8d9d45d27..0000000000 --- a/sources/tech/RHCSA Series/RHCSA Series--Part 07--Using ACLs (Access Control Lists) and Mounting Samba or NFS Shares.md +++ /dev/null @@ -1,213 +0,0 @@ -[xiqingongzi Translating] -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 From 8f3984987fc2e2cc778109e39b343d9cdf38dd29 Mon Sep 17 00:00:00 2001 From: "Y.C.S.M" Date: Fri, 28 Aug 2015 08:56:28 +0800 Subject: [PATCH 494/507] Delete 20150813 Linux file system hierarchy v2.0.md --- ...150813 Linux file system hierarchy v2.0.md | 440 ------------------ 1 file changed, 440 deletions(-) delete mode 100644 sources/tech/20150813 Linux file system hierarchy v2.0.md diff --git a/sources/tech/20150813 Linux file system hierarchy v2.0.md b/sources/tech/20150813 Linux file system hierarchy v2.0.md deleted file mode 100644 index 23f70258b1..0000000000 --- a/sources/tech/20150813 Linux file system hierarchy v2.0.md +++ /dev/null @@ -1,440 +0,0 @@ -translating by tnuoccalanosrep - -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 From d4b3fcf6a82cc5eaf9c46d2bb21127e2bf2a9189 Mon Sep 17 00:00:00 2001 From: "Y.C.S.M" Date: Fri, 28 Aug 2015 09:00:36 +0800 Subject: [PATCH 495/507] Create 20150813 Linux file system hierarchy v2.0.md --- ...150813 Linux file system hierarchy v2.0.md | 432 ++++++++++++++++++ 1 file changed, 432 insertions(+) create mode 100644 translated/tech/20150813 Linux file system hierarchy v2.0.md diff --git a/translated/tech/20150813 Linux file system hierarchy v2.0.md b/translated/tech/20150813 Linux file system hierarchy v2.0.md new file mode 100644 index 0000000000..6f92d3bb53 --- /dev/null +++ b/translated/tech/20150813 Linux file system hierarchy v2.0.md @@ -0,0 +1,432 @@ +translating by tnuoccalanosrep +Linux文件系统结构 v2.0 +================================================================================ +Linux中的文件是什么?它的文件系统又是什么?那些配置文件又在哪里?我下载好的程序保存在哪里了?好了,上图简明地阐释了Linux的文件系统的层次关系。当你苦于寻找配置文件或者二进制文件的时候,这便显得十分有用了。我在下方添加了一些解释以及例子,但“篇幅过长,没有阅读”。 + +有一种情况便是当你在系统中获取配置以及二进制文件时,出现了不一致性问题,如果你是一个大型组织,或者只是一个终端用户,这也有可能会破坏你的系统(比如,二进制文件运行在就旧的库文件上了)。若然你在你的Linux系统上做安全审计([security audit of your Linux system][1])的话,你将会发现它很容易遭到不同的攻击。所以,清洁操作(无论是Windows还是Linux)都显得十分重要。 +### What is a file in Linux? ### +Linux的文件是什么? +对于UNIX系统来说(同样适用于Linux),以下便是对文件简单的描述: +> 在UNIX系统中,一切皆为文件;若非文件,则为进程 + +> 这种定义是比较正确的,因为有些特殊的文件不仅仅是普通文件(比如命名管道和套接字),不过为了让事情变的简单,“一切皆为文件”也是一个可以让人接受的说法。Linux系统也像UNXI系统一样,将文件和目录视如同物,因为目录只是一个包含了其他文件名的文件而已。程序,服务,文本,图片等等,都是文件。对于系统来说,输入和输出设备,基本上所有的设备,都被当做是文件。 +![](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: 添加标题以及版本历史 + - – Improved: 添加/srv,/meida和/proc + - – Improved: 更新了反映当前的Linux文件系统的描述 + - – Fixed: 多处的打印错误 + - – Fixed: 外观和颜色 +- Version 1.0 – 14-02-2015 + - – Created: 基本的图表 + - – Note: 摒弃更低的版本 + +### Download Links ### +以下是结构图的下载地址。如果你需要其他结构,请跟原作者联系,他会尝试制作并且上传到某个地方以供下载 +- [Large (PNG) Format – 2480×1755 px – 184KB][2] +- [Largest (PDF) Format – 9919x7019 px – 1686KB][3] + +**注意**: PDF格式文件是打印的最好选择,因为它画质很高。 +### Linux 文件系统描述 ### +为了有序地管理那些文件,人们习惯把这些文件当做是硬盘上的有序的类树结构体,正如我们熟悉的'MS-DOS'(硬盘操作系统)。大的分枝包括更多的分枝,分枝的末梢是树的叶子或者普通的文件。现在我们将会以这树形图为例,但晚点我们会发现为什么这不是一个完全准确的一幅图。 +注:表格 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Directory(目录)Description(描述)
+
/
+
主层次 的根,也是整个文件系统层次结构的根目录
+
/bin
+
存放在单用户模式可用的必要命令二进制文件,对于所有用户而言,则是像cat,ls,cp等等的文件
+
/boot
+
存放引导加载程序文件,例如kernels,initrd等
+
/dev
+
存放必要的设备文件
+
/etc
+
存放主机特定的系统范围内的配置文件。其实这里有个关于它名字本身意义上的的争议。在贝尔实验室的早期UNIX实施文档版本中,/etc表示是“其他目录”,因为从历史上看,这个目录是存放各种不属于其他目录的文件(然而,FSH(文件系统目录标准)限定 /ect是用于存放静态配置文件,这里不该存有二进制文件)。早期文档出版后,这个目录名又重新定义成不同的形式。近期的解释中包含着诸如“可编辑文本配置”或者“额外的工具箱”这样的重定义
+
+
+
/opt
+
+
+
存储着新增包的配置文件 /opt/.
+
+
+
/sgml
+
+
+
存放配置文件,比如目录,还有那些处理SGML(译者注:标准通用标记语言)的软件的配置文件
+
+
+
/X11
+
+
+
X Window系统的配置文件,版本号为11
+
+
+
/xml
+
+
+
配置文件,比如目录,处理XML(译者注:可扩展标记语言)的软件的配置文件
+
/home
+
用户的主目录,包括保存的文件, 个人配置, 等等.
+
/lib
+
/bin/ and /sbin/中的二进制文件必不可少的库文件
+
/lib<qual>
+
备用格式的必要的库文件. 这样的目录视可选的,但如果他们存在的话, 他们还有一些要求.
+
/media
+
可移动的多媒体(如CD-ROMs)的挂载点.(出现于 FHS-2.3)
+
/mnt
+
临时挂载的文件系统
+
/opt
+
自定义应用程序软件包
+
/proc
+
以文件形式提供进程以及内核信息的虚拟文件系统,在Linux中,对应进程文件系统的挂载点
+
/root
+
根用户的主目录
+
/sbin
+
必要系统二进制文件, 比如, init, ip, mount.
+
/srv
+
系统提供的站点特定数据
+
/tmp
+
临时文件 (另见 /var/tmp). 通常在系统重启后删除
+
/usr
+
二级层级 存储用户的只读数据; 包含(多)用户主要的公共文件以及应用程序
+
+
+
/bin
+
+
+
非必要的命令二进制文件 (在单用户模式中不需要用到的); 用于所有用户.
+
+
+
/include
+
+
+
标准的包含文件
+
+
+
/lib
+
+
+
库文件,用于/usr/bin//usr/sbin/.中的二进制文件
+
+
+
/lib<qual>
+
+
+
备用格式库(可选的).
+
+
+
/local
+
+
+
三级层次 用于本地数据, 具体到该主机上的.通常会有下一个子目录, 比如, bin/, lib/, share/.
+
+
+
/sbin
+
+
+
非必要系统的二进制文件, 比如,用于不同网络服务的守护进程
+
+
+
/share
+
+
+
独立架构的 (共享) 数据.
+
+
+
/src
+
+
+
源代码, 比如, 内核源文件以及与它相关的头文件
+
+
+
/X11R6
+
+
+
X Window系统,版本号:11,发行版本:6
+
/var
+
各式各样的文件,一些随着系统常规操作而持续改变的文件就放在这里,比如日志文件,脱机文件,还有临时的电子邮件文件
+
+
+
/cache
+
+
+
应用程序缓存数据. 这些数据是根据I/O(输入/输出)的耗时结果或者是运算生成的.这些应用程序是可以重新生成或者恢复数据的.当没有数据丢失的时候,可以删除缓存文件.
+
+
+
/lib
+
+
+
状态信息.这些信息随着程序的运行而不停地改变,比如,数据库,系统元数据的打包等等
+
+
+
/lock
+
+
+
锁文件。这些文件会持续监控正在使用的资源
+
+
+
/log
+
+
+
日志文件. 包含各种日志.
+
+
+
/mail
+
+
+
内含用户邮箱的相关文件
+
+
+
/opt
+
+
+
来自附加包的各种数据都会存储在 /opt/.
+
+
+
/run
+
+
+
Information about the running system since last boot, e.g., currently logged-in users and running daemons.存放当前系统上次启动的相关信息, 例如, 当前登入的用户以及当前运行的daemons(守护进程).
+
+
+
/spool
+
+
+
该spool主要用于存放将要被处理的任务, 比如, 打印队列以及邮件传出队列
+
+
+
+
+
/mail
+
+
+
+
+
过时的位置,用于放置用户邮箱文件
+
+
+
/tmp
+
+
+
存放重启之前的临时接口
+ +### Types of files in Linux ### +### Linux的文件类型 ### +大多数文件也仅仅是文件,他们被称为`regular`文件;他们包含普通数据,比如,文本,可执行文件,或者程序,程序输入或输出文件等等 +While it is reasonably safe to suppose that everything you encounter on a Linux system is a file, there are some exceptions. +虽然你可以认为“在Linux中,一切你看到的皆为文件”这个观点相当保险,但这里仍有着一些例外。 + +- `目录`:由其他文件组成的文件 +- `特殊文件`:用于输入和输出的途径。大多数特殊文件都储存在`/dev`中,我们将会在后面讨论这个问题。 +- `链接文件`:让文件或者目录在系统文件树结构上可见的机制。我们将详细地讨论这个链接文件。 +- `(域)套接字`:特殊的文件类型,和TCP/IP协议中的套接字有点像,提供进程网络,并受文件系统的访问控制机制保护。 +-`命名管道` : 或多或少有点像sockets(套接字),提供一个进程间的通信机制,而不用网络套接字协议。 +### File system in reality ### +### 现实中的文件系统 ### +对于大多数用户和常规系统管理任务而言,"文件和目录是一个有序的类树结构"是可以接受的。然而,对于电脑而言,它是不会理解什么是树,或者什么是树结构。 + +每个分区都有它自己的文件系统。想象一下,如果把那些文件系统想成一个整体,我们可以构思一个关于整个系统的树结构,不过这并没有这么简单。在文件系统中,一个文件代表着一个`inode`(索引节点),一种包含着构建文件的实际数据信息的序列号:这些数据表示文件是属于谁的,还有它在硬盘中的位置。 + +每个分区都有一套属于他们自己的inodes,在一个系统的不同分区中,可以存在有相同inodes的文件。 + +每个inode都表示着一种在硬盘上的数据结构,保存着文件的属性,包括文件数据的物理地址。当硬盘被格式化并用来存储数据时(通常发生在初始系统安装过程,或者是在一个已经存在的系统中添加额外的硬盘),每个分区都会创建关于inodes的固定值。这个值表示这个分区能够同时存储各类文件的最大数量。我们通常用一个inode去映射2-8k的数据块。当一个新的文件生成后,它就会获得一个空闲的indoe。在这个inode里面存储着以下信息: + +- 文件属主和组属主 +- 文件类型(常规文件,目录文件......) +- 文件权限 +- 创建、最近一次读文件和修改文件的时间 +- inode里该信息被修改的时间 +- 文件的链接数(详见下一章) +- 文件大小 +- 文件数据的实际地址 + +唯一不在inode的信息是文件名和目录。它们存储在特殊的目录文件。通过比较文件名和inodes的数目,系统能够构造出一个便于用户理解的树结构。用户可以通过ls -i查看inode的数目。在硬盘上,inodes有他们独立的空间。 + + + +via: http://www.blackmoreops.com/2015/06/18/linux-file-system-hierarchy-v2-0/ + +译者:[译者ID](https://github.com/tnuoccalanosrep) +校对:[校对者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 From 640802a25af32cec263d382f8620fc14897265ec Mon Sep 17 00:00:00 2001 From: Xuanwo Date: Fri, 28 Aug 2015 09:28:13 +0800 Subject: [PATCH 496/507] finished the translate --- ...eate Edit and Manipulate files in Linux.md | 74 +++++++++---------- 1 file changed, 36 insertions(+), 38 deletions(-) diff --git a/translated/tech/LFCS/Part 1 - LFCS--How to use GNU 'sed' Command to Create Edit and Manipulate files in Linux.md b/translated/tech/LFCS/Part 1 - LFCS--How to use GNU 'sed' Command to Create Edit and Manipulate files in Linux.md index 21579f0ed9..c8c56c0077 100644 --- a/translated/tech/LFCS/Part 1 - LFCS--How to use GNU 'sed' Command to Create Edit and Manipulate files in Linux.md +++ b/translated/tech/LFCS/Part 1 - LFCS--How to use GNU 'sed' Command to Create Edit and Manipulate files in Linux.md @@ -1,7 +1,6 @@ Translating by Xuanwo -Part 1 - LFCS: How to use GNU ‘sed’ Command to Create, Edit, and Manipulate files in Linux -LFCS系列第一讲:如何在Linux上使用GNU'sed'命令来创建、编辑和操作文件 +Part 1 - LFCS系列第一讲:如何在Linux上使用GNU'sed'命令来创建、编辑和操作文件 ================================================================================ Linux基金会宣布了一个全新的LFCS(Linux Foundation Certified Sysadmin,Linux基金会认证系统管理员)认证计划。这一计划旨在帮助遍布全世界的人们获得其在处理Linux系统管理任务上能力的认证。这些能力包括支持运行的系统服务,以及第一手的故障诊断和分析和为工程师团队在升级时提供智能决策。 @@ -11,8 +10,7 @@ Linux基金会认证系统管理员——第一讲 请观看下面关于Linux基金会认证计划的演示: -注:youtube 视频 - + 该系列将命名为《LFCS预备第一讲》至《LFCS预备第十讲》并覆盖关于Ubuntu,CentOS以及openSUSE的下列话题。 @@ -78,13 +76,13 @@ sed replace string 正如你所看到的,我们可以通过使用分号分隔以及用括号包裹来把两个或者更多的替换命令(并在他们中使用正则表达式)链接起来。 -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的用法是显示或者删除文件中选中的一部分。在下面的样例中,将会显示/var/log/messages中从6月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). +请注意,在默认的情况下,sed会打印每一行。我们可以使用-n选项来覆盖这一行为并且告诉sed只需要打印(用p来表示)文件(或管道)中匹配的部分(第一种情况下行开头的第一个6月8日以及第二种情况下的一到五行*此处翻译欠妥,需要修正*)。 -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)空行或者是开头为`#`的行(|字符返回两个正则表达式之间的布尔值)。 # sed '/^#\|^$/d' apache2.conf @@ -92,13 +90,13 @@ Finally, it can be useful while inspecting scripts or configuration files to ins sed match string -#### uniq Command #### +#### uniq C命令 #### -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. +uniq命令允许我们返回或者删除文件中重复的行,默认写入标准输出。我们必须注意到,除非两个重复的行相邻,否则uniq命令不会删除他们。因此,uniq经常和前序排序(此处翻译欠妥)(一种用来对文本行进行排序的算法)搭配使用。默认情况下,排序使用第一个字段(用空格分隔)作为关键字段。要指定一个不同的关键字段,我们需要使用-k选项。 -**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 /path/to/directory/* 命令将会以人类可读的格式返回在指定目录下每一个子文件夹和文件的磁盘空间使用情况(也会显示每个目录总体的情况),而且不是按照大小输出,而是按照子文件夹和文件的名称。我们可以使用下面的命令来让它通过大小排序。 # du -sch /var/* | sort –h @@ -106,7 +104,8 @@ The du –sch /path/to/directory/* command returns the disk space usage per subd 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. +你可以通过使用下面的命令告诉uniq比较每一行的前6个字符(-w 6)(指定了不同的日期)来统计日志事件的个数,而且在每一行的开头输出出现的次数(-c)。 + # cat /var/log/mail.log | uniq -c -w 6 @@ -114,7 +113,7 @@ You can count the number of events in a log by date by telling uniq to perform t 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. +最后,你可以组合使用sort和uniq命令(通常如此)。考虑下面文件中捐助者,捐助日期和金额的列表。假设我们想知道有多少个捐助者。我们可以使用下面的命令来分隔第一字段(字段由冒号分隔),按名称排序并且删除重复的行。 # cat sortuniq.txt | cut -d: -f1 | sort | uniq @@ -122,15 +121,15 @@ Finally, you can combine sort and uniq (as they usually are). Consider the follo Find Unique Records in File -- Read Also: [13 “cat” Command Examples][1] +- 也可阅读: [13个“cat”命令样例][1] -#### grep Command #### +#### grep 命令 #### -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. +grep在文件(或命令输出)中搜索指定正则表达式并且在标准输出中输出匹配的行。 -**Examples** +**样例** -Display the information from /etc/passwd for user gacanepa, ignoring case. +显示文件/etc/passwd中用户gacanepa的信息,忽略大小写。 # grep -i gacanepa /etc/passwd @@ -138,7 +137,7 @@ Display the information from /etc/passwd for user gacanepa, ignoring case. grep command example -Show all the contents of /etc whose name begins with rc followed by any single number. +显示/etc文件夹下所有rc开头并跟随任意数字的内容。 # ls -l /etc | grep rc[0-9] @@ -146,15 +145,15 @@ Show all the contents of /etc whose name begins with rc followed by any single n List Content Using grep -- Read Also: [12 “grep” Command Examples][2] +- 也可阅读: [12个“grep”命令样例][2] #### tr Command Usage #### -The tr command can be used to translate (change) or delete characters from stdin, and write the result to stdout. +tr命令可以用来从标准输入中翻译(改变)或者删除字符并将结果写入到标准输出中。 -**Examples** +**样例** -Change all lowercase to uppercase in sortuniq.txt file. +把sortuniq.txt文件中所有的小写改为大写。 # cat sortuniq.txt | tr [:lower:] [:upper:] @@ -162,21 +161,20 @@ Change all lowercase to uppercase in sortuniq.txt file. Sort Strings in File -Squeeze the delimiter in the output of ls –l to only one space. - +压缩`ls –l`输出中的定界符至一个空格。 # ls -l | tr -s ' ' ![Squeeze Delimiter](http://www.tecmint.com/wp-content/uploads/2014/10/squeeze-delimeter.jpg) Squeeze Delimiter -#### cut Command Usage #### +#### cut 命令使用方法 #### -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. +cut命令可以基于字节数(-b选项),字符(-c)或者字段(-f)提取部分输入(从标准输入或者文件中)并且将结果输出到标准输出。在最后一种情况下(基于字段),默认的字段分隔符是一个tab,但不同的分隔符可以由-d选项来指定。 -**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. +从/etc/passwd中提取用户账户和他们被分配的默认shell(-d选项允许我们指定分界符,-f选项指定那些字段将被提取)。 # cat /etc/passwd | cut -d: -f1,7 @@ -184,7 +182,7 @@ Extract the user accounts and the default shells assigned to them from /etc/pass 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. +总结一下,我们将使用最后一个命令的输出中第一和第三个非空文件创建一个文本流。我们将使用grep作为第一过滤器来检查用户gacanepa的会话,然后将分隔符压缩至一个空格(tr -s ' ')。下一步,我们将使用cut来提取第一和第三个字段,最后使用第二个字段(本样例中,指的是IP地址)来排序之后再用uniq去重。 # last | grep gacanepa | tr -s ‘ ‘ | cut -d’ ‘ -f1,3 | sort -k2 | uniq @@ -192,24 +190,24 @@ Summing up, we will create a text stream consisting of the first and third non-b 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! +尽管这个例子(以及在当前教程中的其他实例)第一眼看上去可能不是非常有用,但是他们是体验在Linux命令行中创建,编辑和操作文件的一个非常好的开始。请随时留下你的问题和意见——不胜感激! -#### Reference Links #### +#### 参考链接 #### -- [About the LFCS][3] -- [Why get a Linux Foundation Certification?][4] -- [Register for the LFCS exam][5] +- [关于LFCS][3] +- [为什么需要Linux基金会认证?][4] +- [注册LFCS考试][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) +译者:[Xuanwo](https://github.com/Xuanwo) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From b663886aa6da8c94947f11a0a901b56a3bba60a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=AE=A6=E6=88=90?= Date: Fri, 28 Aug 2015 10:41:26 +0800 Subject: [PATCH 497/507] Delete RHCSA Series--Part 07--Using ACLs (Access Control Lists) and Mounting Samba or NFS Shares.md --- ...Lists) and Mounting Samba or NFS Shares.md | 192 ------------------ 1 file changed, 192 deletions(-) delete mode 100644 translated/tech/RHCSA/RHCSA Series--Part 07--Using ACLs (Access Control Lists) and Mounting Samba or NFS Shares.md diff --git a/translated/tech/RHCSA/RHCSA Series--Part 07--Using ACLs (Access Control Lists) and Mounting Samba or NFS Shares.md b/translated/tech/RHCSA/RHCSA Series--Part 07--Using ACLs (Access Control Lists) and Mounting Samba or NFS Shares.md deleted file mode 100644 index a9c56b1cbe..0000000000 --- a/translated/tech/RHCSA/RHCSA Series--Part 07--Using ACLs (Access Control Lists) and Mounting Samba or NFS Shares.md +++ /dev/null @@ -1,192 +0,0 @@ -[xiqingongzi Translating] -RHCSA Series: Using ACLs (Access Control Lists) and Mounting Samba / NFS Shares – Part 7 -================================================================================ -在第六篇文章的最后,我们开始解释如何使用parted和SSM 设置和配置本地文件存储([RHCSA series Part 6][1]) - -![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系列::第七章 ACL的配置和安装NFS/Samba文件分享系统 - -我们还讨论了如何创建和在启动启动时用密码挂载加密逻辑卷。另外,我们要提醒您要避免在安装 在管理操作系统的存储文件系统事执行关键的操作。接下来我们要回顾在红帽Linux 7 中常用的文件系统格式然后卸载和挂载网络文件系统(CIFS和NFS), -#### 前提 #### - -在开始之前,请确保你有一个线上Samba服务器和一个线上NFS服务器(RHEL7 将很快不支持 NFS V2) - -在这个指南中,我们将使用一个IP为192.168.0.10的机器作为服务端,RHEL7 盒子作为客户端,IP为192.168.0.18,稍后我们会告诉你该安装哪些软件包。 - -### RHEL7中的文件格式 ### - -从RHEL7 开始,XFS 因为其高可用性和可拓展性被设置为所有架构的默认文件系统。目前,红帽和合作伙伴测试的主流硬件线上他支持最大500TB 每个文件系统。 -同时,XFS使user_xattr(扩展用户属性)和ACL(POSIX访问控制列表)作为默认的挂载选项,不像ext3或ext4(ext2在RHEL 7中是过时的),这意味着你不需要明确的指定命令行选项或在/etc/fstab挂载时XFS文件系统(如果你想禁用在后一种情况下,这样的选择你要明确使用no_acl和no_user_xattr)。 -记住,扩展用户属性可以指定文件和目录用于存储任意等附加信息的MIME类型,字符集或文件的编码,而对用户属性的访问权限由普通文件权限位的定义。 -#### 权限控制列表 #### - -每一个系统管理员,无论新手还是专家,都熟悉文件和目录的权限和许可。它能制定特定的权限(读,写和执行)的所有者,属组,和其他的正常访问权限。如果需要,可以回去看看 [Part 3 of the RHCSA series][2] -然而,由于标准的 ugo/rwx 设置不允许配置不同用户不同权限,所以ACL可以比一般规定更多的文件和目录权限。 -事实上,ACL定义的权限是文件权限的一个超集,我们来看一下在真正的场景下是如何转换的。 -1. 有两种类型:访问ACL (可以适用于任何一个特定的文件或目录),也是默认的ACL,它只能应用于目录。如果文件包含在其中没有ACL设置,他们继承父目录的默认ACL。 -2. 首先,ACL可以配置每个用户,每个组,或不在组内的用户拥有文件。 -3。设置ACL(和删除)使用setfacl,分别使用M或X选项。 -例如,让我们创建一个组名为tecmint和添加用户johndoe和davenull: - # groupadd tecmint - # useradd johndoe - # useradd davenull - # usermod -a -G tecmint johndoe - # usermod -a -G tecmint davenull - -让我们确认用户属于组tecmint: - - # id johndoe - # id davenull - -![Verify Users](http://www.tecmint.com/wp-content/uploads/2015/04/Verify-Users.png) - -验证用户 - -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): -现在让我们创建一个在/mnt下的目录名为playground,和一个名叫testfile.txt文件。我们将tecmint和更改其默认 ugo/rwx 权限为 770组所有者(读,写,和执行给予属主和属组所有者权限): - # mkdir /mnt/playground - # touch /mnt/playground/testfile.txt - # chmod 770 /mnt/playground/testfile.txt - -然后切换用户johndoe和davenull,按照这个顺序,并写入文件: - - echo "My name is John Doe" > /mnt/playground/testfile.txt - echo "My name is Dave Null" >> /mnt/playground/testfile.txt - -到目前为止很好。现在,让我们的用户gacanepa写入文件–和写操作,可以预料到出现的结果。 - -但如果我们真的需要用户gacanepa(不是tecmint组的成员)有/mnt/playground/testfile.txt的写入权限。首先,可能是你的想法是添加用户帐户组tecmint。但这会给他写上所有文件的权限,写入的是该组的权限,我们不希望这样。我们只希望他能写/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) - -管理用户权限 - -让我们给用户gacanepa添加/mnt/playground/testfile.txt的读写权限 -在root下执行 - - # setfacl -R -m u:gacanepa:rwx /mnt/playground - -您已经成功添加了一个ACL允许gacanepa写入测试文件。然后切换到用户gacanepa试图写入文件: - - $ echo "My name is Gabriel Canepa" >> /mnt/playground/testfile.txt - -要查看特定的文件或目录的ACL,使用getfacl: - - # getfacl /mnt/playground/testfile.txt - -![Check ACLs of Files](http://www.tecmint.com/wp-content/uploads/2015/04/Check-ACL-of-File.png) - -检查文件的ACLs - -设置默认ACL目录(它的内容将会继承除非被覆盖),添加d:以前的规则并且指定一个文件名来替代 - # setfacl -m d:o:r /mnt/playground - -以上的ACL将允许用户不在属组属主有/mnt/playground的读权限。注意在getfacl /mnt/playground 之前和之后的改变输出的差异: -![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] 提供了更多ACL的例子,我强烈推荐你去读读它,参考起来非常方便。 - -#### 安装NFS网络共享 #### - -显示在你的服务器的NFS共享可用的列表,您可以使用showmount命令与E选项,其次是机器名或IP地址。这个工具包含在NFS utils包: - - # yum update && yum install nfs-utils - -然后: - - # showmount -e 192.168.0.10 - -你会得到一个列表的可用的NFS分享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 - -在使用命令行对必要的本地客户端挂载NFS网络共享,使用以下语法: - - # mount -t nfs -o [options] remote_host:/remote/directory /local/directory - -在我们的例子中,翻译成: - - # mount -t nfs 192.168.0.10:/NFS-SHARE /mnt/nfs - -如果您收到一下错误消息:"rpc-statd.service工作失败,看 “systemctl status rpc-statd.service” 和“journalctl -xn” 获取详细信息.确保你的rpcbind服务在开机时开启。 - # systemctl enable rpcbind.socket - # systemctl restart rpcbind.service - -然后重新启动。这应该做的技巧,你将能够挂载NFS共享就和前面所解释的那样。如果你需要安装NFS共享的自动引导系统,添加一个有效的条目到/etc/fstab文件: - - 远程主机:远程目录 本地目录 nfs 选项 0 0 - -变量远程主机, 远程目录, 本地目录, and 选项 (可选的)在我们手动挂载是谁同样的,就和我们之前的例子一样。 - - 192.168.0.10:/NFS-SHARE /mnt/nfs nfs defaults 0 0 - -#### 挂载 Samba 网络文件共享 #### - -Samba 代表选择可以在×nix和Windows之间进行网络共享的工具.使用Samba客户端包内的 smbclient 命令 加 -L 参数来展示 Samba 文件分享,其次是机器名或IP地址 -将会提示你输入远程主机上的密码: - # 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 - -在本地客户端,你需要首先安装CIFS utils来挂载Samba: - - # yum update && yum install cifs-utils - -然后在命令行上使用下面的语法: - - # mount -t cifs -o credentials=/path/to/credentials/file //remote_host/samba_share /local/directory - -在我们的例子中,翻译成: - - # mount -t cifs -o credentials=~/.smbcredentials //192.168.0.10/gacanepa /mnt/samba - -smbcredentials内容为: - - username=gacanepa - password=XXXXXX - -是一个隐藏文件在root的主目录(/root/),权限设置为600,因此,除了该文件的所有者可以读或写,没有人能够读写。 -请注意,samba_share是Samba共享的名字就像 smbclient -L remote_host 返回的那样 - -现在,如果你需要samba共享可自动在系统启动时,添加一个有效的条目/etc/fstab文件如下: - - //远程主机:/samba_share 本地目录 cifs 选项 0 0 - -变量 远程主机, /samba_share, 本地目录, 选项 (可选的) 和我们手动安装的意义一样 - - //192.168.0.10/gacanepa /mnt/samba cifs credentials=/root/smbcredentials,defaults 0 0 - -### 结论 ### - -在这篇文章中我们已经讲解了如何在Linux设置ACL,并探讨RHEL7中该如何挂载CIFS和NFS网络共享。 -我建议你去实践这些概念,甚至把它们一起安装(先尝试安装网络共享设置ACL)如果你有疑问或意见,请随时使用下面的表格,随时与我们联系。还可以通过你的社交网络来分享这篇文章。 --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/rhcsa-exam-configure-acls-and-mount-nfs-samba-shares/ - -作者:[Gabriel Cánepa][a] -译者:[xiqingongzi](https://github.com/xiqingongzi) -校对:[校对者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 From 20227444b13f1cea4976677c9c559cbbb191e3c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=AE=A6=E6=88=90?= Date: Fri, 28 Aug 2015 11:11:16 +0800 Subject: [PATCH 498/507] Update RHCSA Series--Part 10--Yum Package Management, Automating Tasks with Cron and Monitoring System Logs.md --- ...t, Automating Tasks with Cron and Monitoring System Logs.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 index 04c7d7a29e..307ec72515 100644 --- 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 @@ -1,3 +1,4 @@ +[xiqingongzi translating] 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. @@ -194,4 +195,4 @@ via: http://www.tecmint.com/yum-package-management-cron-job-scheduling-monitorin [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 +[4]:http://www.tecmint.com/dmesg-commands/ From c242f434c900997a28380b2e50620bba14b2f00b Mon Sep 17 00:00:00 2001 From: Jerry Ling Date: Fri, 28 Aug 2015 12:21:27 +0800 Subject: [PATCH 499/507] [Translating] Debian GNU or Linux Birthday-- A 22 Years of Journey and Still Counting --- ...inux Birthday-- A 22 Years of Journey and Still Counting.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/talk/20150818 Debian GNU or Linux Birthday-- A 22 Years of Journey and Still Counting.md b/sources/talk/20150818 Debian GNU or Linux Birthday-- A 22 Years of Journey and Still Counting.md index f74384b616..da750a495a 100644 --- a/sources/talk/20150818 Debian GNU or Linux Birthday-- A 22 Years of Journey and Still Counting.md +++ b/sources/talk/20150818 Debian GNU or Linux Birthday-- A 22 Years of Journey and Still Counting.md @@ -1,3 +1,4 @@ +[jerryling315](https://github.com/jerryling315/) is translating. Debian GNU/Linux Birthday : A 22 Years of Journey and Still Counting… ================================================================================ On 16th August 2015, the Debian project has celebrated its 22nd anniversary, making it one of the oldest popular distribution in open source world. Debian project was conceived and founded in the year 1993 by Ian Murdock. By that time Slackware had already made a remarkable presence as one of the earliest Linux Distribution. @@ -106,4 +107,4 @@ via: http://www.tecmint.com/happy-birthday-to-debian-gnu-linux/ [a]:http://www.tecmint.com/author/avishek/ [1]:http://xmodulo.com/2013/08/interesting-facts-about-debian-linux.html -[2]:https://www.debian.org/ \ No newline at end of file +[2]:https://www.debian.org/ From 829b9cbb09aabfac61a8a578a31d4b8a2edfafb7 Mon Sep 17 00:00:00 2001 From: Ping Date: Fri, 28 Aug 2015 13:54:05 +0800 Subject: [PATCH 500/507] Translating sources/share/20150827 Xtreme Download Manager Updated With Fresh GUI --- .../20150827 Xtreme Download Manager Updated With Fresh GUI.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/share/20150827 Xtreme Download Manager Updated With Fresh GUI.md b/sources/share/20150827 Xtreme Download Manager Updated With Fresh GUI.md index 767c2fdcd4..8879d6bf64 100644 --- a/sources/share/20150827 Xtreme Download Manager Updated With Fresh GUI.md +++ b/sources/share/20150827 Xtreme Download Manager Updated With Fresh GUI.md @@ -1,3 +1,4 @@ +Translating by Ping Xtreme Download Manager Updated With Fresh GUI ================================================================================ ![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/08/Xtreme-Download-Manager-Linux.jpg) @@ -64,4 +65,4 @@ via: http://itsfoss.com/xtreme-download-manager-install/ [1]:http://xdman.sourceforge.net/ [2]:http://itsfoss.com/4-best-download-managers-for-linux/ [3]:http://itsfoss.com/download-youtube-videos-ubuntu/ -[4]:http://xdman.sourceforge.net/download.html \ No newline at end of file +[4]:http://xdman.sourceforge.net/download.html From 8697100000ccaba0be7f29aa03595410ff96dbe5 Mon Sep 17 00:00:00 2001 From: wxy Date: Fri, 28 Aug 2015 14:42:22 +0800 Subject: [PATCH 501/507] PUB:20150518 How to set up a Replica Set on MongoDB @mr-ping --- ... How to set up a Replica Set on MongoDB.md | 78 +++++++++++-------- 1 file changed, 47 insertions(+), 31 deletions(-) rename {translated/tech => published}/20150518 How to set up a Replica Set on MongoDB.md (51%) diff --git a/translated/tech/20150518 How to set up a Replica Set on MongoDB.md b/published/20150518 How to set up a Replica Set on MongoDB.md similarity index 51% rename from translated/tech/20150518 How to set up a Replica Set on MongoDB.md rename to published/20150518 How to set up a Replica Set on MongoDB.md index 44b8535b82..7d05a48d95 100644 --- a/translated/tech/20150518 How to set up a Replica Set on MongoDB.md +++ b/published/20150518 How to set up a Replica Set on MongoDB.md @@ -1,10 +1,11 @@ -如何配置MongoDB副本集(Replica Set) +如何配置 MongoDB 副本集 ================================================================================ -MongoDB已经成为市面上最知名的NoSQL数据库。MongoDB是面向文档的,它的无模式设计使得它在各种各样的WEB应用当中广受欢迎。最让我喜欢的特性之一是它的副本集,副本集将同一数据的多份拷贝放在一组mongod节点上,从而实现数据的冗余以及高可用性。 -这篇教程将向你介绍如何配置一个MongoDB副本集。 +MongoDB 已经成为市面上最知名的 NoSQL 数据库。MongoDB 是面向文档的,它的无模式设计使得它在各种各样的WEB 应用当中广受欢迎。最让我喜欢的特性之一是它的副本集(Replica Set),副本集将同一数据的多份拷贝放在一组 mongod 节点上,从而实现数据的冗余以及高可用性。 -副本集的最常见配置涉及到一个主节点以及多个副节点。这之后启动的复制行为会从这个主节点到其他副节点。副本集不止可以针对意外的硬件故障和停机事件对数据库提供保护,同时也因为提供了更多的结点从而提高了数据库客户端数据读取的吞吐量。 +这篇教程将向你介绍如何配置一个 MongoDB 副本集。 + +副本集的最常见配置需要一个主节点以及多个副节点。这之后启动的复制行为会从这个主节点到其他副节点。副本集不止可以针对意外的硬件故障和停机事件对数据库提供保护,同时也因为提供了更多的节点从而提高了数据库客户端数据读取的吞吐量。 ### 配置环境 ### @@ -12,25 +13,25 @@ MongoDB已经成为市面上最知名的NoSQL数据库。MongoDB是面向文档 ![](https://farm8.staticflickr.com/7667/17801038505_529a5224a1.jpg) -为了达到这个目的,我们使用了3个运行在VirtualBox上的虚拟机。我会在这些虚拟机上安装Ubuntu 14.04,并且安装MongoDB官方包。 +为了达到这个目的,我们使用了3个运行在 VirtualBox 上的虚拟机。我会在这些虚拟机上安装 Ubuntu 14.04,并且安装 MongoDB 官方包。 -我会在一个虚拟机实例上配置好需要的环境,然后将它克隆到其他的虚拟机实例上。因此,选择一个名为master的虚拟机,执行以下安装过程。 +我会在一个虚拟机实例上配置好所需的环境,然后将它克隆到其他的虚拟机实例上。因此,选择一个名为 master 的虚拟机,执行以下安装过程。 -首先,我们需要在apt中增加一个MongoDB密钥: +首先,我们需要给 apt 增加一个 MongoDB 密钥: $ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10 -然后,将官方的MongoDB仓库添加到source.list中: +然后,将官方的 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。 +接下来更新 apt 仓库并且安装 MongoDB。 $ sudo apt-get update $ sudo apt-get install -y mongodb-org -现在对/etc/mongodb.conf做一些更改 +现在对 /etc/mongodb.conf 做一些更改 auth = true dbpath=/var/lib/mongodb @@ -39,17 +40,17 @@ MongoDB已经成为市面上最知名的NoSQL数据库。MongoDB是面向文档 keyFile=/var/lib/mongodb/keyFile replSet=myReplica -第一行的作用是确认我们的数据库需要验证才可以使用的。keyfile用来配置用于MongoDB结点间复制行为的密钥文件。replSet用来为副本集设置一个名称。 +第一行的作用是表明我们的数据库需要验证才可以使用。keyfile 配置用于 MongoDB 节点间复制行为的密钥文件。replSet 为副本集设置一个名称。 接下来我们创建一个用于所有实例的密钥文件。 $ echo -n "MyRandomStringForReplicaSet" | md5sum > keyFile -这将会创建一个含有MD5字符串的密钥文件,但是由于其中包含了一些噪音,我们需要对他们清理后才能正式在MongoDB中使用。 +这将会创建一个含有 MD5 字符串的密钥文件,但是由于其中包含了一些噪音,我们需要对他们清理后才能正式在 MongoDB 中使用。 $ echo -n "MyReplicaSetKey" | md5sum|grep -o "[0-9a-z]\+" > keyFile -grep命令的作用的是把将空格等我们不想要的内容过滤掉之后的MD5字符串打印出来。 +grep 命令的作用的是把将空格等我们不想要的内容过滤掉之后的 MD5 字符串打印出来。 现在我们对密钥文件进行一些操作,让它真正可用。 @@ -57,7 +58,7 @@ grep命令的作用的是把将空格等我们不想要的内容过滤掉之后 $ sudo chown mongodb:nogroup keyFile $ sudo chmod 400 keyFile -接下来,关闭此虚拟机。将其Ubuntu系统克隆到其他虚拟机上。 +接下来,关闭此虚拟机。将其 Ubuntu 系统克隆到其他虚拟机上。 ![](https://farm9.staticflickr.com/8729/17800903865_9876a9cc9c.jpg) @@ -67,55 +68,55 @@ grep命令的作用的是把将空格等我们不想要的内容过滤掉之后 请注意,三个虚拟机示例需要在同一个网络中以便相互通讯。因此,我们需要它们弄到“互联网"上去。 -这里推荐给每个虚拟机设置一个静态IP地址,而不是使用DHCP。这样它们就不至于在DHCP分配IP地址给他们的时候失去连接。 +这里推荐给每个虚拟机设置一个静态 IP 地址,而不是使用 DHCP。这样它们就不至于在 DHCP 分配IP地址给他们的时候失去连接。 -像下面这样编辑每个虚拟机的/etc/networks/interfaces文件。 +像下面这样编辑每个虚拟机的 /etc/networks/interfaces 文件。 -在主结点上: +在主节点上: auto eth1 iface eth1 inet static address 192.168.50.2 netmask 255.255.255.0 -在副结点1上: +在副节点1上: auto eth1 iface eth1 inet static address 192.168.50.3 netmask 255.255.255.0 -在副结点2上: +在副节点2上: auto eth1 iface eth1 inet static address 192.168.50.4 netmask 255.255.255.0 -由于我们没有DNS服务,所以需要设置设置一下/etc/hosts这个文件,手工将主机名称放到次文件中。 +由于我们没有 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上: +在副节点1上: 127.0.0.1 localhost secondary1 192.168.50.2 primary 192.168.50.3 secondary1 192.168.50.4 secondary2 -在副结点2上: +在副节点2上: 127.0.0.1 localhost secondary2 192.168.50.2 primary 192.168.50.3 secondary1 192.168.50.4 secondary2 -使用ping命令检查各个结点之间的连接。 +使用 ping 命令检查各个节点之间的连接。 $ ping primary $ ping secondary1 @@ -123,9 +124,9 @@ grep命令的作用的是把将空格等我们不想要的内容过滤掉之后 ### 配置副本集 ### -验证各个结点可以正常连通后,我们就可以新建一个管理员用户,用于之后的副本集操作。 +验证各个节点可以正常连通后,我们就可以新建一个管理员用户,用于之后的副本集操作。 -在主节点上,打开/etc/mongodb.conf文件,将auth和replSet两项注释掉。 +在主节点上,打开 /etc/mongodb.conf 文件,将 auth 和 replSet 两项注释掉。 dbpath=/var/lib/mongodb logpath=/var/log/mongodb/mongod.log @@ -133,21 +134,30 @@ grep命令的作用的是把将空格等我们不想要的内容过滤掉之后 #auth = true keyFile=/var/lib/mongodb/keyFile #replSet=myReplica + +在一个新安装的 MongoDB 上配置任何用户或副本集之前,你需要注释掉 auth 行。默认情况下,MongoDB 并没有创建任何用户。而如果在你创建用户前启用了 auth,你就不能够做任何事情。你可以在创建一个用户后再次启用 auth。 -重启mongod进程。 +修改 /etc/mongodb.conf 之后,重启 mongod 进程。 $ sudo service mongod restart -连接MongoDB后,新建管理员用户。 +现在连接到 MongoDB master: + + $ mongo :27017 + +连接 MongoDB 后,新建管理员用户。 > use admin > db.createUser({ user:"admin", pwd:" }) + +重启 MongoDB: + $ sudo service mongod restart -连接到MongoDB,用以下命令将secondary1和secondary2节点添加到我们的副本集中。 +再次连接到 MongoDB,用以下命令将 副节点1 和副节点2节点添加到我们的副本集中。 > use admin > db.auth("admin","myreallyhardpassword") @@ -156,7 +166,7 @@ grep命令的作用的是把将空格等我们不想要的内容过滤掉之后 > rs.add("secondary2:27017") -现在副本集到手了,可以开始我们的项目了。参照 [official driver documentation][1] 来了解如何连接到副本集。如果你想要用Shell来请求数据,那么你需要连接到主节点上来插入或者请求数据,副节点不行。如果你执意要尝试用附件点操作,那么以下错误信息就蹦出来招呼你了。 +现在副本集到手了,可以开始我们的项目了。参照 [官方驱动文档][1] 来了解如何连接到副本集。如果你想要用 Shell 来请求数据,那么你需要连接到主节点上来插入或者请求数据,副节点不行。如果你执意要尝试用副本集操作,那么以下错误信息就蹦出来招呼你了。 myReplica:SECONDARY> myReplica:SECONDARY> show databases @@ -166,6 +176,12 @@ grep命令的作用的是把将空格等我们不想要的内容过滤掉之后 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 + +如果你要从 shell 连接到整个副本集,你可以安装如下命令。在副本集中的失败切换是自动的。 + + $ mongo primary,secondary1,secondary2:27017/?replicaSet=myReplica + +如果你使用其它驱动语言(例如,JavaScript、Ruby 等等),格式也许不同。 希望这篇教程能对你有所帮助。你可以使用Vagrant来自动完成你的本地环境配置,并且加速你的代码。 @@ -175,7 +191,7 @@ via: http://xmodulo.com/setup-replica-set-mongodb.html 作者:[Christopher Valerio][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 117acaf5d0b79a7b1054f488e29410d8fbf354c6 Mon Sep 17 00:00:00 2001 From: wxy Date: Fri, 28 Aug 2015 14:46:58 +0800 Subject: [PATCH 502/507] =?UTF-8?q?=E5=9B=9E=E6=94=B6=E8=B6=85=E6=9C=9F?= =?UTF-8?q?=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @H-mudcup @zpl1025 @martin2011qi --- ...Is Out And It's Packed Full Of Features.md | 87 ------------------- ...20141223 Defending the Free Linux World.md | 2 - ...s--Linus Torvalds Answers Your Question.md | 1 - .../talk/20150716 Interview--Larry Wall.md | 2 - 4 files changed, 92 deletions(-) delete mode 100644 sources/news/20150826 Plasma 5.4 Is Out And It's Packed Full Of Features.md diff --git a/sources/news/20150826 Plasma 5.4 Is Out And It's Packed Full Of Features.md b/sources/news/20150826 Plasma 5.4 Is Out And It's Packed Full Of Features.md deleted file mode 100644 index a103c6b505..0000000000 --- a/sources/news/20150826 Plasma 5.4 Is Out And It's Packed Full Of Features.md +++ /dev/null @@ -1,87 +0,0 @@ -Plasma 5.4 Is Out And It’s Packed Full Of Features -================================================================================ -KDE has [announced][1] a brand new feature release of Plasma 5 — and it’s a corker. - -![kde network applet graphs](http://www.omgubuntu.co.uk/wp-content/uploads/2015/08/kde-network-applet-graphs.jpg) - -Better network details are among the changes - -Plasma 5.4.0 builds on [April’s 5.3.0 milestone][2] in a number of ways, ranging from the inherently technical, Wayland preview session, ahoy, to lavish aesthetic touches, like **1,400 brand new icons**. - -A handful of new components also feature in the release, including a new Plasma Widget for volume control, a monitor calibration tool and an improved user management tool. - -The ‘Kicker’ application menu has been powered up to let you favourite all types of content, not just applications. - -**KRunner now remembers searches** so that it can automatically offer suggestions based on your earlier queries as you type. - -The **network applet displays a graph** to give you a better understanding of your network traffic. It also gains two new VPN plugins for SSH and SSTP connections. - -Minor tweaks to the digital clock see it adapt better in slim panel mode, it gains ISO date support and makes it easier for you to toggle between 12 hour and 24 hour clock. Week numbers have been added to the calendar. - -### Application Dashboard ### - -![plasma 5.4 fullscreen dashboard](http://www.omgubuntu.co.uk/wp-content/uploads/2015/08/plasma-fullscreen-dashboard.jpg) - -The new ‘Application Dashboard’ in KDE Plasma 5.4.0 - -**A new full screen launcher, called ‘Application Dashboard’**, is also available. - -This full-screen dash offers the same features as the traditional Application Menu but with “sophisticated scaling to screen size and full spatial keyboard navigation”. - -Like the Unity launch, the new Plasma Application Dashboard helps you quickly find applications, sift through files and contacts based on your previous activity. - -### Changes in KDE Plasma 5.4.0 at a glance ### - -- Improved high DPI support -- KRunner autocompletion -- KRunner search history -- Application Dashboard add on -- 1,400 New icons -- Wayland tech preview - -For a full list of changes in Plasma 5.4 refer to [this changelog][3]. - -### Install Plasma 5.4 in Kubuntu 15.04 ### - -![new plasma desktop](http://www.omgubuntu.co.uk/wp-content/uploads/2015/08/new-plasma-desktop-.jpg) - -![Kubuntu logo](http://www.omgubuntu.co.uk/wp-content/uploads/2012/02/logo-kubuntu.png) - -To **install Plasma 5.4 in Kubuntu 15.04** you will need to add the KDE Backports PPA to your Software Sources. - -Adding the Kubuntu backports PPA **is not strictly advised** as it may upgrade other parts of the KDE desktop, application suite, developer frameworks or Kubuntu specific config files. - -If you like your desktop being stable, don’t proceed. - -The quickest way to upgrade to Plasma 5.4 once it lands in the Kubuntu Backports PPA is to use the Terminal: - - sudo add-apt-repository ppa:kubuntu-ppa/backports - - sudo apt-get update && sudo apt-get dist-upgrade - -Let the upgrade process complete. Assuming no errors emerge, reboot your computer for changes to take effect. - -If you’re not already using Kubuntu, i.e. you’re using the Unity version of Ubuntu, you should first install the Kubuntu desktop package (you’ll find it in the Ubuntu Software Centre). - -To undo the changes above and downgrade to the most recent version of Plasma available in the Ubuntu archives 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/08/plasma-5-4-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://dot.kde.org/2015/08/25/kde-ships-plasma-540-feature-release-august -[2]:http://www.omgubuntu.co.uk/2015/04/kde-plasma-5-3-released-heres-how-to-upgrade-in-kubuntu-15-04 -[3]:https://www.kde.org/announcements/plasma-5.3.2-5.4.0-changelog.php \ No newline at end of file diff --git a/sources/talk/20141223 Defending the Free Linux World.md b/sources/talk/20141223 Defending the Free Linux World.md index 0a552e640d..0df2a47383 100644 --- a/sources/talk/20141223 Defending the Free Linux World.md +++ b/sources/talk/20141223 Defending the Free Linux World.md @@ -1,5 +1,3 @@ -Translating by H-mudcup - Defending the Free Linux World ================================================================================ ![](http://www.linuxinsider.com/ai/908455/open-invention-network.jpg) 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 f1420fd0e4..bb04ddf0c8 100644 --- a/sources/talk/20150709 Interviews--Linus Torvalds Answers Your Question.md +++ b/sources/talk/20150709 Interviews--Linus Torvalds Answers Your Question.md @@ -1,4 +1,3 @@ -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]. diff --git a/sources/talk/20150716 Interview--Larry Wall.md b/sources/talk/20150716 Interview--Larry Wall.md index 1362281517..3010691cff 100644 --- a/sources/talk/20150716 Interview--Larry Wall.md +++ b/sources/talk/20150716 Interview--Larry Wall.md @@ -1,5 +1,3 @@ -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. From 8ba608059ea9e9247ec89e6c7ddd8fd5ee52ecd4 Mon Sep 17 00:00:00 2001 From: martin qi Date: Fri, 28 Aug 2015 19:01:24 +0800 Subject: [PATCH 503/507] Update 20150716 Interview--Larry Wall.md --- sources/talk/20150716 Interview--Larry Wall.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/talk/20150716 Interview--Larry Wall.md b/sources/talk/20150716 Interview--Larry Wall.md index 3010691cff..f3fea9c596 100644 --- a/sources/talk/20150716 Interview--Larry Wall.md +++ b/sources/talk/20150716 Interview--Larry Wall.md @@ -1,3 +1,5 @@ +translating... + 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. From 3df7b23d8f3d5916d78684ea621a2d5cf4d57ab2 Mon Sep 17 00:00:00 2001 From: struggling <630441839@qq.com> Date: Fri, 28 Aug 2015 23:33:13 +0800 Subject: [PATCH 504/507] Delete 20150827 Linux or UNIX--Bash Read a File Line By Line.md --- ... or UNIX--Bash Read a File Line By Line.md | 163 ------------------ 1 file changed, 163 deletions(-) delete mode 100644 sources/tech/20150827 Linux or UNIX--Bash Read a File Line By Line.md diff --git a/sources/tech/20150827 Linux or UNIX--Bash Read a File Line By Line.md b/sources/tech/20150827 Linux or UNIX--Bash Read a File Line By Line.md deleted file mode 100644 index c0a4b6c27c..0000000000 --- a/sources/tech/20150827 Linux or UNIX--Bash Read a File Line By Line.md +++ /dev/null @@ -1,163 +0,0 @@ -translation by strugglingyouth -Linux/UNIX: Bash Read a File Line By Line -================================================================================ -How do I read a file line by line under a Linux or UNIX-like system using KSH or BASH shell? - -You can use while..do..done bash loop to read file line by line on a Linux, OSX, *BSD, or Unix-like system. - -**Syntax to read file line by line on a Bash Unix & Linux shell:** - -1. The syntax is as follows for bash, ksh, zsh, and all other shells - -1. while read -r line; do COMMAND; done < input.file -1. The -r option passed to red command prevents backslash escapes from being interpreted. -1. Add IFS= option before read command to prevent leading/trailing whitespace from being trimmed - -1. while IFS= read -r line; do COMMAND_on $line; done < input.file - -Here is more human readable syntax for you: - - #!/bin/bash - input="/path/to/txt/file" - while IFS= read -r var - do - echo "$var" - done < "$input" - -**Examples** - -Here are some examples: - - #!/bin/ksh - file="/home/vivek/data.txt" - while IFS= read line - do - # display $line or do somthing with $line - echo "$line" - done <"$file" - -The same example using bash shell: - - #!/bin/bash - file="/home/vivek/data.txt" - while IFS= read -r line - do - # display $line or do somthing with $line - printf '%s\n' "$line" - done <"$file" - -You can also read field wise: - - #!/bin/bash - file="/etc/passwd" - while IFS=: read -r f1 f2 f3 f4 f5 f6 f7 - do - # display fields using f1, f2,..,f7 - printf 'Username: %s, Shell: %s, Home Dir: %s\n' "$f1" "$f7" "$f6" - done <"$file" - -Sample outputs: - -![Fig.01: Bash shell scripting- read file line by line demo outputs](http://s0.cyberciti.org/uploads/faq/2011/01/Bash-Scripting-Read-File-line-by-line-demo.jpg) - -Fig.01: Bash shell scripting- read file line by line demo outputs - -**Bash Scripting: Read text file line-by-line to create pdf files** - -My input file is as follows (faq.txt): - - 4|http://www.cyberciti.biz/faq/mysql-user-creation/|Mysql User Creation: Setting Up a New MySQL User Account - 4096|http://www.cyberciti.biz/faq/ksh-korn-shell/|What is UNIX / Linux Korn Shell? - 4101|http://www.cyberciti.biz/faq/what-is-posix-shell/|What Is POSIX Shell? - 17267|http://www.cyberciti.biz/faq/linux-check-battery-status/|Linux: Check Battery Status Command - 17245|http://www.cyberciti.biz/faq/restarting-ntp-service-on-linux/|Linux Restart NTPD Service Command - 17183|http://www.cyberciti.biz/faq/ubuntu-linux-determine-your-ip-address/|Ubuntu Linux: Determine Your IP Address - 17172|http://www.cyberciti.biz/faq/determine-ip-address-of-linux-server/|HowTo: Determine an IP Address My Linux Server - 16510|http://www.cyberciti.biz/faq/unix-linux-restart-php-service-command/|Linux / Unix: Restart PHP Service Command - 8292|http://www.cyberciti.biz/faq/mounting-harddisks-in-freebsd-with-mount-command/|FreeBSD: Mount Hard Drive / Disk Command - 8190|http://www.cyberciti.biz/faq/rebooting-solaris-unix-server/|Reboot a Solaris UNIX System - -My bash script: - - #!/bin/bash - # Usage: Create pdf files from input (wrapper script) - # Author: Vivek Gite under GPL v2.x+ - #--------------------------------------------------------- - - #Input file - _db="/tmp/wordpress/faq.txt" - - #Output location - o="/var/www/prviate/pdf/faq" - - _writer="~/bin/py/pdfwriter.py" - - # If file exists - if [[ -f "$_db" ]] - then - # read it - while IFS='|' read -r pdfid pdfurl pdftitle - do - local pdf="$o/$pdfid.pdf" - echo "Creating $pdf file ..." - #Genrate pdf file - $_writer --quiet --footer-spacing 2 \ - --footer-left "nixCraft is GIT UL++++ W+++ C++++ M+ e+++ d-" \ - --footer-right "Page [page] of [toPage]" --footer-line \ - --footer-font-size 7 --print-media-type "$pdfurl" "$pdf" - done <"$_db" - fi - -**Tip: Read from bash variable** - -Let us say you want a list of all installed php packages on a Debian or Ubuntu Linux, enter: - - # My input source is the contents of a variable called $list # - list=$(dpkg --list php\* | awk '/ii/{print $2}') - printf '%s\n' "$list" - -Sample outputs: - - php-pear - php5-cli - php5-common - php5-fpm - php5-gd - php5-json - php5-memcache - php5-mysql - php5-readline - php5-suhosin-extension - -You can now read from $list and install the package: - - #!/bin/bash - # BASH can iterate over $list variable using a "here string" # - while IFS= read -r pkg - do - printf 'Installing php package %s...\n' "$pkg" - /usr/bin/apt-get -qq install $pkg - done <<< "$list" - printf '*** Do not forget to run php5enmod and restart the server (httpd or php5-fpm) ***\n' - -Sample outputs: - - Installing php package php-pear... - Installing php package php5-cli... - Installing php package php5-common... - Installing php package php5-fpm... - Installing php package php5-gd... - Installing php package php5-json... - Installing php package php5-memcache... - Installing php package php5-mysql... - Installing php package php5-readline... - Installing php package php5-suhosin-extension... - *** Do not forget to run php5enmod and restart the server (httpd or php5-fpm) *** - --------------------------------------------------------------------------------- - -via: http://www.cyberciti.biz/faq/unix-howto-read-line-by-line-from-file/ - -作者:[作者名][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From b1a1328295ee4624811029e6f03b82485bbc0175 Mon Sep 17 00:00:00 2001 From: struggling <630441839@qq.com> Date: Fri, 28 Aug 2015 23:34:09 +0800 Subject: [PATCH 505/507] Create 20150827 Linux or UNIX--Bash Read a File Line By Line.md --- ... or UNIX--Bash Read a File Line By Line.md | 166 ++++++++++++++++++ 1 file changed, 166 insertions(+) create mode 100644 translated/tech/20150827 Linux or UNIX--Bash Read a File Line By Line.md diff --git a/translated/tech/20150827 Linux or UNIX--Bash Read a File Line By Line.md b/translated/tech/20150827 Linux or UNIX--Bash Read a File Line By Line.md new file mode 100644 index 0000000000..37473334d1 --- /dev/null +++ b/translated/tech/20150827 Linux or UNIX--Bash Read a File Line By Line.md @@ -0,0 +1,166 @@ + +Linux/UNIX: Bash 下如何逐行读取一个文件 +================================================================================ + 在 Linux 或类 UNIX 系统下如何使用 KSH 或 BASH shell 逐行读取一个文件? + +在 Linux, OSX, * BSD ,或者类 Unix 系统下你可以使用​​while..do..done bash 的循环来逐行读取一个文件。 + +**在 Bash Unix 或者 Linux shell 中逐行读取一个文件的语法:** + +1.对于 bash, ksh, zsh,和其他的 shells 语法如下 - +1. while read -r line; do COMMAND; done < input.file +1.通过 -r 选项传递给红色的命令阻止反斜杠被解释。 +1.在 read 命令之前添加 IFS= option,来防止 leading/trailing 尾随的空白字符被分割 - +1. while IFS= read -r line; do COMMAND_on $line; done < input.file + +这是更适合人类阅读的语法: + + #!/bin/bash + input="/path/to/txt/file" + while IFS= read -r var + do + echo "$var" + done < "$input" + +**示例** + +下面是一些例子: + + #!/bin/ksh + file="/home/vivek/data.txt" + while IFS= read line + do + # display $line or do somthing with $line + echo "$line" + done <"$file" + +在 bash shell 中相同的例子: + + #!/bin/bash + file="/home/vivek/data.txt" + while IFS= read -r line + do + # display $line or do somthing with $line + printf '%s\n' "$line" + done <"$file" + +你还可以看看这个更好的: + + #!/bin/bash + file="/etc/passwd" + while IFS=: read -r f1 f2 f3 f4 f5 f6 f7 + do + # display fields using f1, f2,..,f7 + printf 'Username: %s, Shell: %s, Home Dir: %s\n' "$f1" "$f7" "$f6" + done <"$file" + +示例输出: + +![Fig.01: Bash shell scripting- read file line by line demo outputs](http://s0.cyberciti.org/uploads/faq/2011/01/Bash-Scripting-Read-File-line-by-line-demo.jpg) + +图01:Bash shell scripting- 读取文件并逐行输出文件 + +**Bash Scripting: 逐行读取文本文件并创建为 pdf 文件** + +我的输入文件如下(faq.txt): + + 4|http://www.cyberciti.biz/faq/mysql-user-creation/|Mysql User Creation: Setting Up a New MySQL User Account + 4096|http://www.cyberciti.biz/faq/ksh-korn-shell/|What is UNIX / Linux Korn Shell? + 4101|http://www.cyberciti.biz/faq/what-is-posix-shell/|What Is POSIX Shell? + 17267|http://www.cyberciti.biz/faq/linux-check-battery-status/|Linux: Check Battery Status Command + 17245|http://www.cyberciti.biz/faq/restarting-ntp-service-on-linux/|Linux Restart NTPD Service Command + 17183|http://www.cyberciti.biz/faq/ubuntu-linux-determine-your-ip-address/|Ubuntu Linux: Determine Your IP Address + 17172|http://www.cyberciti.biz/faq/determine-ip-address-of-linux-server/|HowTo: Determine an IP Address My Linux Server + 16510|http://www.cyberciti.biz/faq/unix-linux-restart-php-service-command/|Linux / Unix: Restart PHP Service Command + 8292|http://www.cyberciti.biz/faq/mounting-harddisks-in-freebsd-with-mount-command/|FreeBSD: Mount Hard Drive / Disk Command + 8190|http://www.cyberciti.biz/faq/rebooting-solaris-unix-server/|Reboot a Solaris UNIX System + +我的 bash script: + + #!/bin/bash + # Usage: Create pdf files from input (wrapper script) + # Author: Vivek Gite under GPL v2.x+ + #--------------------------------------------------------- + + #Input file + _db="/tmp/wordpress/faq.txt" + + #Output location + o="/var/www/prviate/pdf/faq" + + _writer="~/bin/py/pdfwriter.py" + + # If file exists + if [[ -f "$_db" ]] + then + # read it + while IFS='|' read -r pdfid pdfurl pdftitle + do + local pdf="$o/$pdfid.pdf" + echo "Creating $pdf file ..." + #Genrate pdf file + $_writer --quiet --footer-spacing 2 \ + --footer-left "nixCraft is GIT UL++++ W+++ C++++ M+ e+++ d-" \ + --footer-right "Page [page] of [toPage]" --footer-line \ + --footer-font-size 7 --print-media-type "$pdfurl" "$pdf" + done <"$_db" + fi + +**提示:从 bash 的变量开始读取** + +让我们看看如何在 Debian 或者 Ubuntu Linux 下列出所有安装过的 php 包,请输入: + + # 我将输出内容赋值到一个变量名为$list中 # + + list=$(dpkg --list php\* | awk '/ii/{print $2}') + printf '%s\n' "$list" + +示例输出: + + php-pear + php5-cli + php5-common + php5-fpm + php5-gd + php5-json + php5-memcache + php5-mysql + php5-readline + php5-suhosin-extension + +你现在可以从 $list 中看到安装的包: + + #!/bin/bash + # BASH can iterate over $list variable using a "here string" # + while IFS= read -r pkg + do + printf 'Installing php package %s...\n' "$pkg" + /usr/bin/apt-get -qq install $pkg + done <<< "$list" + printf '*** Do not forget to run php5enmod and restart the server (httpd or php5-fpm) ***\n' + +示例输出: + + Installing php package php-pear... + Installing php package php5-cli... + Installing php package php5-common... + Installing php package php5-fpm... + Installing php package php5-gd... + Installing php package php5-json... + Installing php package php5-memcache... + Installing php package php5-mysql... + Installing php package php5-readline... + Installing php package php5-suhosin-extension... + + + *** 不要忘了运行php5enmod并重新启动服务(httpd 或 php5-fpm) *** + +-------------------------------------------------------------------------------- + +via: http://www.cyberciti.biz/faq/unix-howto-read-line-by-line-from-file/ + +作者:[作者名][a] +译者:[strugglingyouth](https://github.com/strugglingyouth) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 772a5d000de163d51f039ed4ac0e38f373552541 Mon Sep 17 00:00:00 2001 From: Jerry Ling Date: Fri, 28 Aug 2015 23:38:22 +0800 Subject: [PATCH 506/507] =?UTF-8?q?=E5=AE=8C=E6=88=90=E7=BF=BB=E8=AF=91=20?= =?UTF-8?q?Debian=20GNU=20or=20Linux=20Birthday--=20A=2022=20Years=20of=20?= =?UTF-8?q?Journey=20and=20Still=20Counting?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 完成翻译 Debian GNU or Linux Birthday-- A 22 Years of Journey and Still Counting Update 20150818 Debian GNU or Linux Birthday-- A 22 Years of Journey and Still Counting.md fix error --- ... 22 Years of Journey and Still Counting.md | 110 ------------------ ... 22 Years of Journey and Still Counting.md | 109 +++++++++++++++++ 2 files changed, 109 insertions(+), 110 deletions(-) delete mode 100644 sources/talk/20150818 Debian GNU or Linux Birthday-- A 22 Years of Journey and Still Counting.md create mode 100644 translated/talk/20150818 Debian GNU or Linux Birthday-- A 22 Years of Journey and Still Counting.md diff --git a/sources/talk/20150818 Debian GNU or Linux Birthday-- A 22 Years of Journey and Still Counting.md b/sources/talk/20150818 Debian GNU or Linux Birthday-- A 22 Years of Journey and Still Counting.md deleted file mode 100644 index da750a495a..0000000000 --- a/sources/talk/20150818 Debian GNU or Linux Birthday-- A 22 Years of Journey and Still Counting.md +++ /dev/null @@ -1,110 +0,0 @@ -[jerryling315](https://github.com/jerryling315/) is translating. -Debian GNU/Linux Birthday : A 22 Years of Journey and Still Counting… -================================================================================ -On 16th August 2015, the Debian project has celebrated its 22nd anniversary, making it one of the oldest popular distribution in open source world. Debian project was conceived and founded in the year 1993 by Ian Murdock. By that time Slackware had already made a remarkable presence as one of the earliest Linux Distribution. - -![Happy 22nd Birthday to Debian](http://www.tecmint.com/wp-content/uploads/2014/08/Debian-22nd-Birthday.png) - -Happy 22nd Birthday to Debian Linux - -Ian Ashley Murdock, an American Software Engineer by profession, conceived the idea of Debian project, when he was a student of Purdue University. He named the project Debian after the name of his then-girlfriend Debra Lynn (Deb) and his name. He later married her and then got divorced in January 2008. - -![Ian Murdock](http://www.tecmint.com/wp-content/uploads/2014/08/Ian-Murdock.jpeg) - -Debian Creator: Ian Murdock - -Ian is currently serving as Vice President of Platform and Development Community at ExactTarget. - -Debian (as Slackware) was the result of unavailability of up-to mark Linux Distribution, that time. Ian in an interview said – “Providing the first class Product without profit would be the sole aim of Debian Project. Even Linux was not reliable and up-to mark that time. I Remember…. Moving files between file-system and dealing with voluminous file would often result in Kernel Panic. However the project Linux was promising. The availability of Source Code freely and the potential it seemed was qualitative.” - -I remember … like everyone else I wanted to solve problem, run something like UNIX at home, but it was not possible…neither financially nor legally, in the other sense . Then I come to know about GNU kernel Development and its non-association with any kind of legal issues, he added. He was sponsored by Free Software Foundation (FSF) in the early days when he was working on Debian, it also helped Debian to take a giant step though Ian needed to finish his degree and hence quited FSF roughly after one year of sponsorship. - -### Debian Development History ### - -- **Debian 0.01 – 0.09** : Released between August 1993 – December 1993. -- **Debian 0.91 ** – Released in January 1994 with primitive package system, No dependencies. -- **Debian 0.93 rc5** : March 1995. It is the first modern release of Debian, dpkg was used to install and maintain packages after base system installation. -- **Debian 0.93 rc6**: Released in November 1995. It was last a.out release, deselect made an appearance for the first time – 60 developers were maintaining packages, then at that time. -- **Debian 1.1**: Released in June 1996. Code name – Buzz, Packages count – 474, Package Manager dpkg, Kernel 2.0, ELF. -- **Debian 1.2**: Released in December 1996. Code name – Rex, Packages count – 848, Developers Count – 120. -- **Debian 1.3**: Released in July 1997. Code name – Bo, package count 974, Developers count – 200. -- **Debian 2.0**: Released in July 1998. Code name: Hamm, Support for architecture – Intel i386 and Motorola 68000 series, Number of Packages: 1500+, Number of Developers: 400+, glibc included. -- **Debian 2.1**: Released on March 09, 1999. Code name – slink, support architecture Alpha and Sparc, apt came in picture, Number of package – 2250. -- **Debian 2.2**: Released on August 15, 2000. Code name – Potato, Supported architecture – Intel i386, Motorola 68000 series, Alpha, SUN Sparc, PowerPC and ARM architecture. Number of packages: 3900+ (binary) and 2600+ (Source), Number of Developers – 450. There were a group of people studied and came with an article called Counting potatoes, which shows – How a free software effort could lead to a modern operating system despite all the issues around it. -- **Debian 3.0** : Released on July 19th, 2002. Code name – woody, Architecture supported increased– HP, PA_RISC, IA-64, MIPS and IBM, First release in DVD, Package Count – 8500+, Developers Count – 900+, Cryptography. -- **Debian 3.1**: Release on June 6th, 2005. Code name – sarge, Architecture support – same as woody + AMD64 – Unofficial Port released, Kernel – 2.4 qnd 2.6 series, Number of Packages: 15000+, Number of Developers : 1500+, packages like – OpenOffice Suite, Firefox Browser, Thunderbird, Gnome 2.8, kernel 3.3 Advanced Installation Support: RAID, XFS, LVM, Modular Installer. -- **Debian 4.0**: Released on April 8th, 2007. Code name – etch, architecture support – same as sarge, included AMD64. Number of packages: 18,200+ Developers count : 1030+, Graphical Installer. -- **Debian 5.0**: Released on February 14th, 2009. Code name – lenny, Architecture Support – Same as before + ARM. Number of packages: 23000+, Developers Count: 1010+. -- **Debian 6.0** : Released on July 29th, 2009. Code name – squeeze, Package included : kernel 2.6.32, Gnome 2.3. Xorg 7.5, DKMS included, Dependency-based. Architecture : Same as pervious + kfreebsd-i386 and kfreebsd-amd64, Dependency based booting. -- **Debian 7.0**: Released on may 4, 2013. Code name: wheezy, Support for Multiarch, Tools for private cloud, Improved Installer, Third party repo need removed, full featured multimedia-codec, Kernel 3.2, Xen Hypervisor 4.1.4 Package Count: 37400+. -- **Debian 8.0**: Released on May 25, 2015 and Code name: Jessie, Systemd as the default init system, powered by Kernel 3.16, fast booting, cgroups for services, possibility of isolating part of the services, 43000+ packages. Sysvinit init system available in Jessie. - -**Note**: Linux Kernel initial release was on October 05, 1991 and Debian initial release was on September 15, 1993. So, Debian is there for 22 Years running Linux Kernel which is there for 24 years. - -### Debian Facts ### - -Year 1994 was spent on organizing and managing Debian project so that it would be easy for others to contribute. Hence no release for users were made this year however there were certain internal release. - -Debian 1.0 was never released. A CDROM manufacturer company by mistakenly labelled an unreleased version as Debian 1.0. Hence to avoid confusion Debian 1.0 was released as Debian 1.1 and since then only the concept of official CDROM images came into existence. - -Each release of Debian is a character of Toy Story. - -Debian remains available in old stable, stable, testing and experimental, all the time. - -The Debian Project continues to work on the unstable distribution (codenamed sid, after the evil kid from the Toy Story). Sid is the permanent name for the unstable distribution and is remains ‘Still In Development’. The testing release is intended to become the next stable release and is currently codenamed jessie. - -Debian official distribution includes only Free and OpenSource Software and nothing else. However the availability of contrib and Non-free Packages makes it possible to install those packages which are free but their dependencies are not licensed free (contrib) and Packages licensed under non-free softwares. - -Debian is the mother of a lot of Linux distribution. Some of these Includes: - -- Damn Small Linux -- KNOPPIX -- Linux Advanced -- MEPIS -- Ubuntu -- 64studio (No more active) -- LMDE - -Debian is the world’s largest non commercial Linux Distribution. It is written in C (32.1%) programming language and rest in 70 other languages. - -![Debian Contribution](http://www.tecmint.com/wp-content/uploads/2014/08/Debian-Programming.png) - -Debian Contribution - -Image Source: [Xmodulo][1] - -Debian project contains 68.5 million actual loc (lines of code) + 4.5 million lines of comments and white spaces. - -International Space station dropped Windows & Red Hat for adopting Debian – These astronauts are using one release back – now “squeeze” for stability and strength from community. - -Thank God! Who would have heard the scream from space on Windows Metro Screen :P - -#### The Black Wednesday #### - -On November 20th, 2002 the University of Twente Network Operation Center (NOC) caught fire. The fire department gave up protecting the server area. NOC hosted satie.debian.org which included Security, non-US archive, New Maintainer, quality assurance, databases – Everything was turned to ashes. Later these services were re-built by debian. - -#### The Future Distro #### - -Next in the list is Debian 9, code name – Stretch, what it will have is yet to be revealed. The best is yet to come, Just Wait for it! - -A lot of distribution made an appearance in Linux Distro genre and then disappeared. In most cases managing as it gets bigger was a concern. But certainly this is not the case with Debian. It has hundreds of thousands of developer and maintainer all across the globe. It is a one Distro which was there from the initial days of Linux. - -The contribution of Debian in Linux ecosystem can’t be measured in words. If there had been no Debian, Linux would not have been so rich and user-friendly. Debian is among one of the disto which is considered highly reliable, secure and stable and a perfect choice for Web Servers. - -That’s the beginning of Debian. It came a long way and still going. The Future is Here! The world is here! If you have not used Debian till now, What are you Waiting for. Just Download Your Image and get started, we will be here if you get into trouble. - -- [Debian Homepage][2] - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/happy-birthday-to-debian-gnu-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://xmodulo.com/2013/08/interesting-facts-about-debian-linux.html -[2]:https://www.debian.org/ diff --git a/translated/talk/20150818 Debian GNU or Linux Birthday-- A 22 Years of Journey and Still Counting.md b/translated/talk/20150818 Debian GNU or Linux Birthday-- A 22 Years of Journey and Still Counting.md new file mode 100644 index 0000000000..1c92079b57 --- /dev/null +++ b/translated/talk/20150818 Debian GNU or Linux Birthday-- A 22 Years of Journey and Still Counting.md @@ -0,0 +1,109 @@ +Debian GNU/Linux 生日: 22年未完的美妙旅程. +================================================================================ +在2015年8月16日, Debian项目组庆祝了 Debian 的22周年纪念日; 这也是开源世界历史最悠久, 热门的发行版之一. Debian项目于1993年由Ian Murdock创立. 彼时, Slackware 作为最早的 Linux 发行版已经名声在外. + +![Happy 22nd Birthday to Debian](http://www.tecmint.com/wp-content/uploads/2014/08/Debian-22nd-Birthday.png) + +22岁生日快乐! Debian Linux! + +Ian Ashly Murdock, 一个美国职业软件工程师, 在他还是普渡大学的学生时构想出了 Debia n项目的计划. 他把这个项目命名为 Debian 是由于这个名字组合了他彼时女友的名字, Debra Lynn, 和他自己的名字(译者: Ian). 他之后和Lynn顺利结婚并在2008年1月离婚. + +![Ian Murdock](http://www.tecmint.com/wp-content/uploads/2014/08/Ian-Murdock.jpeg) + +Debian 创始人:Ian Murdock + +Ian 目前是 ExactTarget 下 Platform and Development Community 的副总裁. + +Debian (如同Slackware一样) 都是由于当时缺乏满足作者标准的发行版才应运而生的. Ian 在一次采访中说:"免费提供一流的产品会是Debian项目的唯一使命. 尽管过去的 Linux 发行版均不尽然可靠抑或是优秀. 我印象里...比如在不同的文件系统间移动文件, 处理大型文件经常会导致内核出错. 但是 Linux 其实是很可靠的, 免费的源代码让这个项目本质上很有前途. + +"我记得过去我也像其他人一样想解决问题, 想在家里运营一个像 UNIX 的东西. 但那是不可能的, 无论是经济上还是法律上或是别的什么角度. 然后我就听闻了GNU内核开发项目, 以及这个项目是如何没有任何法律纷争", Ian 补充到. 他早年在开发 Debian 时曾被自由软件基金会(FSF)资助, 这份资助帮助 Debian 向前迈了一大步; 尽管一年后由于学业原因 Ian 退出了 FSF 转而去完成他的学位. + +### Debian开发历史 ### + +- **Debian 0.01 – 0.09** : 发布于 1993 八月 – 1993 十二月. +- **Debian 0.91 ** – 发布于 1994 一月. 有了原始的包管理系统, 没有依赖管理机制. +- **Debian 0.93 rc5** : 发布于 1995 三月. "现代"意义的 Debian 的第一次发布, dpkg 会在系统安装后被用作安装以及管理其他软件包. +- **Debian 0.93 rc6**: 发布于1995 十一月. 最后一次a.out发布, deselect机制第一次出现, 有60位开发者在彼时维护着软件包. +- **Debian 1.1**: 发布于1996 六月. 项目代号 – Buzz, 软件包数量 – 474, 包管理器 dpkg, 内核版本 2.0, ELF. +- **Debian 1.2**: 发布于1996 十二月. 项目代号 – Rex, 软件包数量 – 848, 开发者数量 – 120. +- **Debian 1.3**: 发布于1997 七月. 项目代号 – Bo, 软件包数量 974, 开发者数量 – 200. +- **Debian 2.0**: 发布于1998 七月. 项目代号 - Hamm, 支持构架 – Intel i386 以及 Motorola 68000 系列, 软件包数量: 1500+, 开发者数量: 400+, 内置了 glibc. +- **Debian 2.1**: 发布于1999 三月九日. 项目代号 – slink, 支持构架 - Alpha 和 Sparc, apt 包管理器开始成型, 软件包数量 – 2250. +- **Debian 2.2**: 发布于2000 八月十五日. 项目代号 – Potato, 支持构架 – Intel i386, Motorola 68000 系列, Alpha, SUN Sparc, PowerPC 以及 ARM 构架. 软件包数量: 3900+ (二进制) 以及 2600+ (源代码), 开发者数量 – 450. 有一群人在那时研究并发表了一篇论文, 论文展示了自由软件是如何在被各种问题包围的情况下依然逐步成长为优秀的现代操作系统的. +- **Debian 3.0**: 发布于2002 七月十九日. 项目代号 – woody, 支持构架新增– HP, PA_RISC, IA-64, MIPS 以及 IBM, 首次以DVD的形式发布, 软件包数量 – 8500+, 开发者数量 – 900+, 支持加密. +- **Debian 3.1**: 发布于2005 六月六日. 项目代号 – sarge, 支持构架 – 不变基础上新增 AMD64 – 非官方渠道发布, 内核 – 2.4 以及 2.6 系列, 软件包数量: 15000+, 开发者数量 : 1500+, 增加了诸如 – OpenOffice 套件, Firefox 浏览器, Thunderbird, Gnome 2.8, 内核版本 3.3 先进地支持了: RAID, XFS, LVM, Modular Installer. +- **Debian 4.0**: 发布于2007 四月八日. 项目代号 – etch, 支持构架 – 不变基础上新增 AMD64. 软件包数量: 18,200+ 开发者数量 : 1030+, 图形化安装器. +- **Debian 5.0**: Released on February 14th, 发布于2009. 项目代号 – lenny, 支持构架 – 保不变基础上新增 ARM. 软件包数量: 23000+, 开发者数量: 1010+. +- **Debian 6.0**: 发布于2009 七月二十九日. 项目代号 – squeeze, 包含的软件包: 内核 2.6.32, Gnome 2.3. Xorg 7.5, 同时包含了 DKMS, 基于依赖包支持. 支持构架 : 不变基础上新增 kfreebsd-i386 以及 kfreebsd-amd64, 基于依赖管理的启动过程. +- **Debian 7.0**: 发布于2013 五月四日. 项目代号: wheezy, 支持 Multiarch, 私人云工具, 升级了安装器, 移除了第三方软件依赖, 万能的多媒体套件-codec, 内核版本 3.2, Xen Hypervisor 4.1.4 软件包数量: 37400+. +- **Debian 8.0**: 发布于2015 五月二十五日. 项目代号: Jessie, 将 Systemd 作为默认的启动加载器, 内核版本 3.16, 增加了快速启动(fast booting), service进程所依赖的 cgroups 使隔离部分 service 进程成为可能, 43000+ packages. Sysvinit 初始化工具首次在 Jessie 中可用. + +**注意**: Linux的内核第一次是在1991 十月五日被发布, 而 Debian 的首次发布则在1993 九月十三日. 所以 Debian 已经在只有24岁的 Linux 内核上运行了整整22年了. + +### 有关 Debian 的小知识 ### + +1994年被用来管理和重整 Debian 项目以使得其他开发者能更好地加入. 所以在那一年并没有面向用户的更新被发布, 当然, 内部版本肯定是有的. + +Debian 1.0 从来就没有被发布过. 一家 CD-ROM 的生产商错误地把某个未发布的版本标注为了 1.0, 为了避免产生混乱, 原本的 Debian 1.0 以1.1的面貌发布了. 从那以后才有了所谓的官方CD-ROM的概念. + +每个 Debian 新版本的代号都是玩具总动员里某个角色的名字哦. + +Debian 有四种可用版本: 旧稳定版(old stable), 稳定版, 测试版 以及 试验版(experimental). 始终如此. + +Debian 项目组一直致力于开发写一代发行版的不稳定版本, 这个不稳定版本始终被叫做Sid(玩具总动员里那个邪恶的臭小孩). Sid是unstable版本的永久名称, 同时Sid也取自'Still In Development"(译者:还在开发中)的首字母. Sid 将会成为下一个稳定版, 此时的下一个稳定版本代号为 jessie. + +Debian 的官方发行版只包含开源并且免费的软件, 绝无其他东西. 不过contrib 和 不免费的软件包使得安装那些本身免费但是依赖的软件包不免费的软件成为了可能. 那些依赖包本身的证书可能不属于自由/免费软件. + +Debian 是一堆Linux 发行版的母亲. 举几个例子: + +- Damn Small Linux +- KNOPPIX +- Linux Advanced +- MEPIS +- Ubuntu +- 64studio (不再活跃开发) +- LMDE + +Debian 是世界上最大的非商业Linux 发行版.他主要是由C书写的(32.1%), 一并的还有其他70多种语言. + +![Debian 开发语言贡献表](http://www.tecmint.com/wp-content/uploads/2014/08/Debian-Programming.png) + +Debian Contribution + +图片来源: [Xmodulo][1] + +Debian 项目包含6,850万行代码, 以及, 450万行空格和注释. + +国际空间站放弃了 Windows 和红帽子, 进而换成了Debian - 在上面的宇航员使用落后一个版本的稳定发行版, 目前是squeeze; 这么做是为了稳定程度以及来自 Debian 社区的雄厚帮助支持. + +感谢上帝! 我们差点就听到来自国际空间宇航员面对 Windows Metro 界面的尖叫了 :P + +#### 黑色星期三 #### + +2002 十一月而是日, Twente 大学的 Network Operation Center 着火 (NOC). 当地消防部门放弃了服务器区域. NOC维护了satie.debian.org的网站服务器, 这个网站包含了安全, 非美国相关的存档, 新维护者资料, 数量报告, 数据库; 这一切都化为了灰烬. 之后这些服务被使用 Debian 重新实现了. + +#### 未来版本 #### + +下一个待发布版本是 Debian 9, 项目代号 – Stretch, 它会带来什么还是个未知数. 满心期待吧! + +有很多发行版在 Linux 发行版的历史上出现过一瞬然后很快消失了. 在多数情况下, 维护一个日渐庞大的项目是开发者们面临的挑战. 但这对 Debian 来说不是问题. Debian 项目有全世界成百上千的开发者, 维护者. 它在 Linux 诞生的之初起便一直存在. + +Debian 在 Linux 生态环境中的贡献是难以用语言描述的. 如果 Debian 没有出现过, 那么 Linux 世界将不会像现在这样丰富, 用户友好. Debian 是为数不多可以被认为安全可靠又稳定, 是作为网络服务器完美选择的发行版. + +这仅仅是 Debian 的一个开始. 它从远古时代一路走到今天, 并将一直走下去. 未来即是现在! 世界近在眼前! 如果你到现在还从来没有使用过 Debian, 我只想问, 你还再等什么? 快去下载一份镜像试试吧, 我们会在此守候遇到任何问题的你. + +- [Debian 主页][2] + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/happy-birthday-to-debian-gnu-linux/ + +作者:[Avishek Kumar][a] +译者:[jerryling315](http://moelf.xyz) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/avishek/ +[1]:http://xmodulo.com/2013/08/interesting-facts-about-debian-linux.html +[2]:https://www.debian.org/ From f61c12b96c475ae4701c362e645b8504b26b689b Mon Sep 17 00:00:00 2001 From: Luoyuanhao Date: Sat, 29 Aug 2015 09:34:10 +0800 Subject: [PATCH 507/507] [Translated] tech/RHCE/Part 5 - How to Manage System Logs (Configure, Rotate and Import Into Database) in RHEL 7.md --- ...ate and Import Into Database) in RHEL 7.md | 166 ----------------- ...ate and Import Into Database) in RHEL 7.md | 169 ++++++++++++++++++ 2 files changed, 169 insertions(+), 166 deletions(-) delete mode 100644 sources/tech/RHCE/Part 5 - How to Manage System Logs (Configure, Rotate and Import Into Database) in RHEL 7.md create mode 100644 translated/tech/RHCE/Part 5 - How to Manage System Logs (Configure, Rotate and Import Into Database) in RHEL 7.md diff --git a/sources/tech/RHCE/Part 5 - How to Manage System Logs (Configure, Rotate and Import Into Database) in RHEL 7.md b/sources/tech/RHCE/Part 5 - How to Manage System Logs (Configure, Rotate and Import Into Database) in RHEL 7.md deleted file mode 100644 index 8f3370f741..0000000000 --- a/sources/tech/RHCE/Part 5 - How to Manage System Logs (Configure, Rotate and Import Into Database) in RHEL 7.md +++ /dev/null @@ -1,166 +0,0 @@ -ictlyh Translating -Part 5 - How to Manage System Logs (Configure, Rotate and Import Into Database) in RHEL 7 -================================================================================ -In order to keep your RHEL 7 systems secure, you need to know how to monitor all of the activities that take place on such systems by examining log files. Thus, you will be able to detect any unusual or potentially malicious activity and perform system troubleshooting or take another appropriate action. - -![Linux Rotate Log Files Using Rsyslog and Logrotate](http://www.tecmint.com/wp-content/uploads/2015/08/Manage-and-Rotate-Linux-Logs-Using-Rsyslog-Logrotate.jpg) - -RHCE Exam: Manage System LogsUsing Rsyslogd and Logrotate – Part 5 - -In RHEL 7, the [rsyslogd][1] daemon is responsible for system logging and reads its configuration from /etc/rsyslog.conf (this file specifies the default location for all system logs) and from files inside /etc/rsyslog.d, if any. - -### Rsyslogd Configuration ### - -A quick inspection of the [rsyslog.conf][2] will be helpful to start. This file is divided into 3 main sections: Modules (since rsyslog follows a modular design), Global directives (used to set global properties of the rsyslogd daemon), and Rules. As you will probably guess, this last section indicates what gets logged or shown (also known as the selector) and where, and will be our focus throughout this article. - -A typical line in rsyslog.conf is as follows: - -![Rsyslogd Configuration](http://www.tecmint.com/wp-content/uploads/2015/08/Rsyslogd-Configuration.png) - -Rsyslogd Configuration - -In the image above, we can see that a selector consists of one or more pairs Facility:Priority separated by semicolons, where Facility describes the type of message (refer to [section 4.1.1 in RFC 3164][3] to see the complete list of facilities available for rsyslog) and Priority indicates its severity, which can be one of the following self-explanatory words: - -- debug -- info -- notice -- warning -- err -- crit -- alert -- emerg - -Though not a priority itself, the keyword none means no priority at all of the given facility. - -**Note**: That a given priority indicates that all messages of such priority and above should be logged. Thus, the line in the example above instructs the rsyslogd daemon to log all messages of priority info or higher (regardless of the facility) except those belonging to mail, authpriv, and cron services (no messages coming from this facilities will be taken into account) to /var/log/messages. - -You can also group multiple facilities using the colon sign to apply the same priority to all of them. Thus, the line: - - *.info;mail.none;authpriv.none;cron.none /var/log/messages - -Could be rewritten as - - *.info;mail,authpriv,cron.none /var/log/messages - -In other words, the facilities mail, authpriv, and cron are grouped and the keyword none is applied to the three of them. - -#### Creating a custom log file #### - -To log all daemon messages to /var/log/tecmint.log, we need to add the following line either in rsyslog.conf or in a separate file (easier to manage) inside /etc/rsyslog.d: - - daemon.* /var/log/tecmint.log - -Let’s restart the daemon (note that the service name does not end with a d): - - # systemctl restart rsyslog - -And check the contents of our custom log before and after restarting two random daemons: - -![Linux Create Custom Log File](http://www.tecmint.com/wp-content/uploads/2015/08/Create-Custom-Log-File.png) - -Create Custom Log File - -As a self-study exercise, I would recommend you play around with the facilities and priorities and either log additional messages to existing log files or create new ones as in the previous example. - -### Rotating Logs using Logrotate ### - -To prevent log files from growing endlessly, the logrotate utility is used to rotate, compress, remove, and alternatively mail logs, thus easing the administration of systems that generate large numbers of log files. - -Logrotate runs daily as a cron job (/etc/cron.daily/logrotate) and reads its configuration from /etc/logrotate.conf and from files located in /etc/logrotate.d, if any. - -As with the case of rsyslog, even when you can include settings for specific services in the main file, creating separate configuration files for each one will help organize your settings better. - -Let’s take a look at a typical logrotate.conf: - -![Logrotate Configuration](http://www.tecmint.com/wp-content/uploads/2015/08/Logrotate-Configuration.png) - -Logrotate Configuration - -In the example above, logrotate will perform the following actions for /var/loh/wtmp: attempt to rotate only once a month, but only if the file is at least 1 MB in size, then create a brand new log file with permissions set to 0664 and ownership given to user root and group utmp. Next, only keep one archived log, as specified by the rotate directive: - -![Logrotate Logs Monthly](http://www.tecmint.com/wp-content/uploads/2015/08/Logrotate-Logs-Monthly.png) - -Logrotate Logs Monthly - -Let’s now consider another example as found in /etc/logrotate.d/httpd: - -![Rotate Apache Log Files](http://www.tecmint.com/wp-content/uploads/2015/08/Rotate-Apache-Log-Files.png) - -Rotate Apache Log Files - -You can read more about the settings for logrotate in its man pages ([man logrotate][4] and [man logrotate.conf][5]). Both files are provided along with this article in PDF format for your reading convenience. - -As a system engineer, it will be pretty much up to you to decide for how long logs will be stored and in what format, depending on whether you have /var in a separate partition / logical volume. Otherwise, you really want to consider removing old logs to save storage space. On the other hand, you may be forced to keep several logs for future security auditing according to your company’s or client’s internal policies. - -#### Saving Logs to a Database #### - -Of course examining logs (even with the help of tools such as grep and regular expressions) can become a rather tedious task. For that reason, rsyslog allows us to export them into a database (OTB supported RDBMS include MySQL, MariaDB, PostgreSQL, and Oracle. - -This section of the tutorial assumes that you have already installed the MariaDB server and client in the same RHEL 7 box where the logs are being managed: - - # yum update && yum install mariadb mariadb-server mariadb-client rsyslog-mysql - # systemctl enable mariadb && systemctl start mariadb - -Then use the `mysql_secure_installation` utility to set the password for the root user and other security considerations: - -![Secure MySQL Database](http://www.tecmint.com/wp-content/uploads/2015/08/Secure-MySQL-Database.png) - -Secure MySQL Database - -Note: If you don’t want to use the MariaDB root user to insert log messages to the database, you can configure another user account to do so. Explaining how to do that is out of the scope of this tutorial but is explained in detail in [MariaDB knowledge][6] base. In this tutorial we will use the root account for simplicity. - -Next, download the createDB.sql script from [GitHub][7] and import it into your database server: - - # mysql -u root -p < createDB.sql - -![Save Server Logs to Database](http://www.tecmint.com/wp-content/uploads/2015/08/Save-Server-Logs-to-Database.png) - -Save Server Logs to Database - -Finally, add the following lines to /etc/rsyslog.conf: - - $ModLoad ommysql - $ActionOmmysqlServerPort 3306 - *.* :ommysql:localhost,Syslog,root,YourPasswordHere - -Restart rsyslog and the database server: - - # systemctl restart rsyslog - # systemctl restart mariadb - -#### Querying the Logs using SQL syntax #### - -Now perform some tasks that will modify the logs (like stopping and starting services, for example), then log to your DB server and use standard SQL commands to display and search in the logs: - - USE Syslog; - SELECT ReceivedAt, Message FROM SystemEvents; - -![Query Logs in Database](http://www.tecmint.com/wp-content/uploads/2015/08/Query-Logs-in-Database.png) - -Query Logs in Database - -### Summary ### - -In this article we have explained how to set up system logging, how to rotate logs, and how to redirect the messages to a database for easier search. We hope that these skills will be helpful as you prepare for the [RHCE exam][8] and in your daily responsibilities as well. - -As always, your feedback is more than welcome. Feel free to use the form below to reach us. - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/manage-linux-system-logs-using-rsyslogd-and-logrotate/ - -作者:[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/wp-content/pdf/rsyslogd.pdf -[2]:http://www.tecmint.com/wp-content/pdf/rsyslog.conf.pdf -[3]:https://tools.ietf.org/html/rfc3164#section-4.1.1 -[4]:http://www.tecmint.com/wp-content/pdf/logrotate.pdf -[5]:http://www.tecmint.com/wp-content/pdf/logrotate.conf.pdf -[6]:https://mariadb.com/kb/en/mariadb/create-user/ -[7]:https://github.com/sematext/rsyslog/blob/master/plugins/ommysql/createDB.sql -[8]:http://www.tecmint.com/how-to-setup-and-configure-static-network-routing-in-rhel/ \ No newline at end of file diff --git a/translated/tech/RHCE/Part 5 - How to Manage System Logs (Configure, Rotate and Import Into Database) in RHEL 7.md b/translated/tech/RHCE/Part 5 - How to Manage System Logs (Configure, Rotate and Import Into Database) in RHEL 7.md new file mode 100644 index 0000000000..a37c9610fd --- /dev/null +++ b/translated/tech/RHCE/Part 5 - How to Manage System Logs (Configure, Rotate and Import Into Database) in RHEL 7.md @@ -0,0 +1,169 @@ +第五部分 - 如何在 RHEL 7 中管理系统日志(配置、旋转以及导入到数据库) +================================================================================ +为了确保你的 RHEL 7 系统安全,你需要通过查看日志文件监控系统中发生的所有活动。这样,你就可以检测任何不正常或有潜在破坏的活动并进行系统故障排除或者其它恰当的操作。 + +![Linux 中使用 Rsyslog 和 Logrotate 旋转日志文件](http://www.tecmint.com/wp-content/uploads/2015/08/Manage-and-Rotate-Linux-Logs-Using-Rsyslog-Logrotate.jpg) + +(译者注:[日志旋转][9]是系统管理中归档每天产生的日志文件的自动化过程) + +RHCE 考试 - 第五部分:使用 Rsyslog 和 Logrotate 管理系统日志 + +在 RHEL 7 中,[rsyslogd][1] 守护进程负责系统日志,它从 /etc/rsyslog.conf(该文件指定所有系统日志的默认路径)和 /etc/rsyslog.d 中的所有文件(如果有的话)读取配置信息。 + +### Rsyslogd 配置 ### + +快速浏览一下 [rsyslog.conf][2] 会是一个好的开端。该文件分为 3 个主要部分:模块(rsyslong 按照模块化设计),全局指令(用于设置 rsyslogd 守护进程的全局属性),以及规则。正如你可能猜想的,最后一个部分指示获取,显示以及在哪里保存什么的日志(也称为选择子),这也是这篇博文关注的重点。 + +rsyslog.conf 中典型的一行如下所示: + +![Rsyslogd 配置](http://www.tecmint.com/wp-content/uploads/2015/08/Rsyslogd-Configuration.png) + +Rsyslogd 配置 + +在上面的图片中,我们可以看到一个选择子包括了一个或多个用分号分隔的设备:优先级(Facility:Priority)对,其中设备描述了消息类型(参考 [RFC 3164 4.1.1 章节][3] 查看 rsyslog 可用的完整设备列表),优先级指示它的严重性,这可能是以下几种之一: + +- debug +- info +- notice +- warning +- err +- crit +- alert +- emerg + +尽管自身并不是一个优先级,关键字 none 意味着指定设备没有任何优先级。 + +**注意**:给定一个优先级表示该优先级以及之上的消息都应该记录到日志中。因此,上面例子中的行指示 rsyslogd 守护进程记录所有优先级为 info 以及以上(不管是什么设备)的除了属于 mail、authpriv、以及 cron 服务(不考虑来自这些设备的消息)的消息到 /var/log/messages。 + +你也可以使用逗号将多个设备分为一组,对同组中的设备使用相同的优先级。例如下面这行: + + *.info;mail.none;authpriv.none;cron.none /var/log/messages + +也可以这样写: + + *.info;mail,authpriv,cron.none /var/log/messages + +换句话说,mail、authpriv 以及 cron 被分为一组,并使用关键字 none。 + +#### 创建自定义日志文件 #### + +要把所有的守护进程消息记录到 /var/log/tecmint.log,我们需要在 rsyslog.conf 或者 /etc/rsyslog.d 目录中的单独文件(易于管理)添加下面一行: + + daemon.* /var/log/tecmint.log + +然后重启守护进程(注意服务名称不以 d 结尾): + + # systemctl restart rsyslog + +在随机重启两个守护进程之前和之后查看自定义日志的内容: + +![Linux 创建自定义日志文件](http://www.tecmint.com/wp-content/uploads/2015/08/Create-Custom-Log-File.png) + +创建自定义日志文件 + +作为一个自学练习,我建议你重点关注设备和优先级,添加额外的消息到已有的日志文件或者像上面那样创建一个新的日志文件。 + +### 使用 Logrotate 旋转日志 ### + +为了防止日志文件无限制增长,logrotate 工具用于旋转、压缩、移除或者通过电子邮件发送日志,从而减轻管理会产生大量日志文件系统的困难。 + +Logrotate 作为一个 cron 作业(/etc/cron.daily/logrotate)每天运行,并从 /etc/logrotate.conf 和 /etc/logrotate.d 中的文件(如果有的话)读取配置信息。 + +对于 rsyslog,即使你可以在主文件中为指定服务包含设置,为每个服务创建单独的配置文件能帮助你更好地组织设置。 + +让我们来看一个典型的 logrotate.conf: + +![Logrotate 配置](http://www.tecmint.com/wp-content/uploads/2015/08/Logrotate-Configuration.png) + +Logrotate 配置 + +在上面的例子中,logrotate 会为 /var/log/wtmp 进行以下操作:尝试每个月旋转一次,但至少文件要大于 1MB,然后用 0664 权限、用户 root、组 utmp 创建一个新的日志文件。下一步只保存一个归档日志,正如旋转指令指定的: + +![每月 Logrotate 日志](http://www.tecmint.com/wp-content/uploads/2015/08/Logrotate-Logs-Monthly.png) + +每月 Logrotate 日志 + +让我们再来看看 /etc/logrotate.d/httpd 中的另一个例子: + +![旋转 Apache 日志文件](http://www.tecmint.com/wp-content/uploads/2015/08/Rotate-Apache-Log-Files.png) + +旋转 Apache 日志文件 + +你可以在 logrotate 的 man 手册([man logrotate][4] 和 [man logrotate.conf][5])中阅读更多有关它的设置。为了方便你的阅读,本文还提供了两篇文章的 PDF 格式。 + +作为一个系统工程师,很可能由你决定多久按照什么格式保存一次日志,取决于你是否有一个单独的分区/逻辑卷给 /var。否则,你真的要考虑删除旧日志以节省存储空间。另一方面,根据你公司和客户内部的政策,为了以后的安全审核,你可能被迫要保留多个日志。 + +#### 保存日志到数据库 #### + +当然检查日志可能是一个很繁琐的工作(即使有类似 grep 工具和正则表达式的帮助)。因为这个原因,rsyslog 允许我们把它们导出到数据库(OTB 支持的关系数据库管理系统包括 MySQL、MariaDB、PostgreSQL 和 Oracle)。 + +指南的这部分假设你已经在要管理日志的 RHEL 7 上安装了 MariaDB 服务器和客户端: + + # yum update && yum install mariadb mariadb-server mariadb-client rsyslog-mysql + # systemctl enable mariadb && systemctl start mariadb + +然后使用 `mysql_secure_installation` 工具为 root 用户设置密码以及其它安全考量: + + +![保证 MySQL 数据库安全](http://www.tecmint.com/wp-content/uploads/2015/08/Secure-MySQL-Database.png) + +保证 MySQL 数据库安全 + +注意:如果你不想用 MariaDB root 用户插入日志消息到数据库,你也可以配置用另一个用户账户。如何实现的介绍已经超出了本文的范围,但在 [MariaDB 知识][6] 中有详细解析。为了简单在这篇指南中我们会使用 root 账户。 + +下一步,从 [GitHub][7] 下载 createDB.sql 脚本并导入到你的数据库服务器: + + # mysql -u root -p < createDB.sql + +![保存服务器日志到数据库](http://www.tecmint.com/wp-content/uploads/2015/08/Save-Server-Logs-to-Database.png) + +保存服务器日志到数据库 + +最后,添加下面的行到 /etc/rsyslog.conf: + + $ModLoad ommysql + $ActionOmmysqlServerPort 3306 + *.* :ommysql:localhost,Syslog,root,YourPasswordHere + +重启 rsyslog 和数据库服务器: + + # systemctl restart rsyslog + # systemctl restart mariadb + +#### 使用 SQL 语法查询日志 #### + +现在执行一些会改变日志的操作(例如停止和启动服务),然后登陆到你的 DB 服务器并使用标准的 SQL 命令显示和查询日志: + + USE Syslog; + SELECT ReceivedAt, Message FROM SystemEvents; + +![在数据库中查询日志](http://www.tecmint.com/wp-content/uploads/2015/08/Query-Logs-in-Database.png) + +在数据库中查询日志 + +### 总结 ### + +在这篇文章中我们介绍了如何设置系统日志,如果旋转日志以及为了简化查询如何重定向消息到数据库。我们希望这些技巧能对你准备 [RHCE 考试][8] 和日常工作有所帮助。 + +正如往常,非常欢迎你的反馈。用下面的表单和我们联系吧。 + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/manage-linux-system-logs-using-rsyslogd-and-logrotate/ + +作者:[Gabriel Cánepa][a] +译者:[ictlyh](http://www.mutouxiaogui.cn/blog/) +校对:[校对者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/wp-content/pdf/rsyslogd.pdf +[2]:http://www.tecmint.com/wp-content/pdf/rsyslog.conf.pdf +[3]:https://tools.ietf.org/html/rfc3164#section-4.1.1 +[4]:http://www.tecmint.com/wp-content/pdf/logrotate.pdf +[5]:http://www.tecmint.com/wp-content/pdf/logrotate.conf.pdf +[6]:https://mariadb.com/kb/en/mariadb/create-user/ +[7]:https://github.com/sematext/rsyslog/blob/master/plugins/ommysql/createDB.sql +[8]:http://www.tecmint.com/how-to-setup-and-configure-static-network-routing-in-rhel/ +[9]:https://en.wikipedia.org/wiki/Log_rotation \ No newline at end of file